1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1cd45fef-c886-4586-90d1-59faac53d6df",e._sentryDebugIdIdentifier="sentry-dbid-1cd45fef-c886-4586-90d1-59faac53d6df")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7255],{404:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ToastProvider:()=>d,useToast:()=>u,useToastController:()=>h});var i=r(95155),n=r(12115),a=r(47650),l=r(73651),s=r(41429);let o=(0,n.createContext)(void 0),c={"top-right":"top-6 right-6","top-left":"top-6 left-6","bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6",responsive:"bottom-6 left-4 right-4 md:left-auto md:top-6 md:bottom-auto md:right-6"};function d(e){let{children:t,placement:r="top-right"}=e,[d,u]=(0,n.useState)([]),h=(0,n.useRef)(new Map),p=(0,n.useCallback)(e=>{let t=h.current.get(e);t&&(clearTimeout(t),h.current.delete(e))},[]),m=(0,n.useCallback)(e=>{p(e),u(t=>t.filter(t=>t.id!==e))},[p]),f=(0,n.useCallback)((e,t)=>{if(0===t||t===1/0)return;let r=window.setTimeout(()=>{m(e)},null!=t?t:5e3);h.current.set(e,r)},[m]),x=(0,n.useCallback)(e=>{var t;let r=null!=(t=e.id)?t:"undefined"!=typeof crypto&&"randomUUID"in crypto?crypto.randomUUID():"toast-".concat(Date.now(),"-").concat(Math.random().toString(16).slice(2));return u(t=>[...t.filter(e=>e.id!==r),{...e,id:r}]),p(r),f(r,e.duration),r},[p,f]),v=(0,n.useCallback)(()=>{h.current.forEach(e=>clearTimeout(e)),h.current.clear(),u([])},[]);(0,n.useEffect)(()=>()=>{v()},[v]);let b=(0,n.useMemo)(()=>({toasts:d,showToast:x,dismissToast:m,clearToasts:v}),[d,x,m,v]),g=(0,i.jsx)("div",{className:(0,s.cx)("pointer-events-none fixed z-[80] flex max-w-md flex-col gap-3",c[r]),"aria-live":"polite",role:"region",children:d.map(e=>{let{id:t,duration:r,...n}=e;return(0,i.jsx)(l.y,{...n,onDismiss:()=>m(t),className:"pointer-events-auto","data-duration":null!=r?r:5e3},t)})});return(0,i.jsxs)(o.Provider,{value:b,children:[t,"undefined"==typeof document?g:(0,a.createPortal)(g,document.body)]})}function u(){let e=(0,n.useContext)(o);if(!e)throw Error("useToast must be used within a ToastProvider");return e}function h(){return u()}},1517:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Drawer:()=>s});var i=r(95155),n=r(12115),a=r(47650),l=r(41429);function s(e){var t;let{isOpen:r,onClose:s,children:o,anchor:c="bottom",ariaLabel:d,ariaLabelledBy:u}=e,h=(0,n.useRef)(null),p=(0,n.useRef)(null);if((0,n.useEffect)(()=>{if("undefined"==typeof document||!r)return;p.current=document.activeElement,document.body.style.overflow="hidden";let e=()=>{let e=(0,l.iq)(h.current);return e.length>0&&(e[0].focus({preventScroll:!0}),!0)};e()||window.setTimeout(()=>{if(!e()){var t;null==(t=h.current)||t.focus({preventScroll:!0})}},0);let t=e=>{if("Escape"===e.key)e.stopPropagation(),null==s||s();else if("Tab"===e.key){let r=(0,l.iq)(h.current);if(0===r.length){var t;e.preventDefault(),null==(t=h.current)||t.focus({preventScroll:!0});return}let i=document.activeElement,n=r.indexOf(i),a=r.length-1;if(-1===n){e.preventDefault();let t=e.shiftKey?r[a]:r[0];null==t||t.focus({preventScroll:!0});return}e.shiftKey?n<=0&&(e.preventDefault(),r[a].focus({preventScroll:!0})):n===a&&(e.preventDefault(),r[0].focus({preventScroll:!0}))}};return document.addEventListener("keydown",t,!0),()=>{var e;document.removeEventListener("keydown",t,!0),document.body.style.overflow="",null==(e=p.current)||e.focus({preventScroll:!0})}},[r,s]),!r)return null;let m=e=>{e.target===e.currentTarget&&(null==s||s())},f=(0,i.jsxs)("div",{ref:h,role:"dialog","aria-modal":"true","aria-label":null!=d?d:u?void 0:"Drawer panel","aria-labelledby":d?void 0:u,tabIndex:-1,className:(0,l.cx)("fixed z-[70] flex w-full max-w-md flex-col bg-base-100 p-6 shadow-hard focus-visible:outline-none transition-transform",{bottom:"bottom-0 left-0 right-0 translate-y-0 rounded-t-3xl",left:"left-0 top-0 bottom-0 translate-x-0 rounded-r-3xl",right:"right-0 top-0 bottom-0 translate-x-0 rounded-l-3xl"}[c]),children:["bottom"===c&&(0,i.jsx)("div",{className:"mx-auto mb-4 h-1.5 w-12 rounded-full bg-base-300","aria-hidden":"true"}),(0,i.jsx)("div",{className:"flex-1 overflow-y-auto text-base-content",children:o})]}),x=(0,i.jsx)("div",{className:"fixed inset-0 z-[65] bg-black/60",onMouseDown:m,onClick:m,role:"presentation","data-role":"drawer-overlay"});if("undefined"==typeof document)return(0,i.jsxs)(i.Fragment,{children:[x,f]});
1let v=null!=(t=document.getElementById("drawer-root"))?t:document.body;return(0,a.createPortal)((0,i.jsxs)(i.Fragment,{children:[x,f]}),v)}},1703:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConditionalFooter:()=>l});var i=r(95155),n=r(20063),a=r(21512);function l(e){let{children:t}=e,r=(0,n.usePathname)(),l=r?(0,a.Wi)(r):"";return l.startsWith("/show/")||"/login"===l?null:(0,i.jsx)(i.Fragment,{children:t})}},1752:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowHeroControls:()=>c});var i=r(95155),n=r(12115),a=r(34779),l=r(92489),s=r(69505),o=r(41429);function c(e){let{show:t,episode:r,showId:c,nextFreeEpisode:d,className:u}=e,[h,p]=(0,n.useState)(!1),m=(null==t?void 0:t.id)||c,f=r||d,x=(0,n.useCallback)(()=>{m&&f&&(window.location.href="/show/".concat(m,"/episode/").concat(f.id))},[m,f]);return f?(0,i.jsx)("div",{className:(0,o.cx)("absolute inset-0 flex items-end justify-center","transition-opacity duration-300","pointer-events-none",h?"opacity-100":"opacity-0",u),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),role:"group","aria-label":"Video controls",children:(0,i.jsxs)("div",{className:"mb-6 flex w-full items-center justify-between px-6 pointer-events-auto",children:[(0,i.jsx)("div",{className:"flex-1"}),(0,i.jsx)("button",{onClick:x,className:(0,o.cx)("flex items-center justify-center","h-12 w-12 rounded-full","bg-black/60 text-white","hover:bg-black/70 hover:scale-105 active:bg-black/80","transition-all duration-200","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60","shadow-lg backdrop-blur-sm"),"aria-label":"Play show",type:"button",children:(0,i.jsx)(a.A,{className:"h-6 w-6 ml-0.5"})}),(0,i.jsxs)("div",{className:"flex flex-1 items-center justify-end gap-2",children:[(0,i.jsx)("button",{className:(0,o.cx)("flex items-center justify-center","h-9 w-9 rounded-full","bg-black/60 text-white","hover:bg-black/70 hover:scale-105 active:bg-black/80","transition-all duration-200","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60","backdrop-blur-sm"),"aria-label":"Volume control",type:"button",disabled:!0,title:"Volume control (available with preview video)",children:(0,i.jsx)(l.A,{className:"h-5 w-5"})}),(0,i.jsx)("button",{className:(0,o.cx)("flex items-center justify-center","h-9 w-9 rounded-full","bg-black/60 text-white","hover:bg-black/70 hover:scale-105 active:bg-black/80","transition-all duration-200","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60","backdrop-blur-sm"),"aria-label":"Fullscreen",type:"button",disabled:!0,title:"Fullscreen (available with preview video)",children:(0,i.jsx)(s.A,{className:"h-5 w-5"})})]})]})}):null}},3996:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowCard:()=>m});var i=r(95155),n=r(15239),a=r(52619),l=r.n(a),s=r(86814),o=r(21512),c=r(31267),d=r(7e3),u=r(78826),h=r(35796),p=r(38038);function m(e){let{show:t,loading:r=!1,basePath:a,location:m}=e,f=(0,o.Rq)();if(r||!t)return(0,i.jsx)("div",{className:"overflow-hidden rounded-episode-card",children:(0,i.jsxs)("div",{className:"relative aspect-[5/7]",children:[(0,i.jsx)(s.EA,{className:"h-full w-full rounded-episode-card"}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0 flex justify-center bg-gradient-to-t from-black/80 to-transparent px-8 pb-3 pt-6",children:(0,i.jsx)(s.EA,{className:"h-[15px] w-3/4 rounded"})})]})});let x=t.isExclusive||t.creatorKnownFor&&t.creatorName;return(0,i.jsx)(l(),{href:"".concat(null!=a?a:f,"/").concat(t.id),className:"group block","aria-label":"View ".concat(t.title),title:t.title,"data-testid":"show-card",onClick:()=>{t&&(0,c.j4)(parseInt(t.id,10)||t.id,{location:null!=m?m:"Carousel"})},children:(0,i.jsx)("div",{className:"overflow-hidden rounded-episode-card border border-episode-card-border shadow-lg transition-shadow duration-300 hover:shadow-xl",children:(0,i.jsxs)("div",{className:"relative aspect-[5/7] overflow-hidden",children:[t.posterPrompt?(0,i.jsx)(s.Mr,{prompt:t.posterPrompt,fallbackSrc:t.posterImage,alt:t.title,fill:!0,className:"object-cover transition-transform duration-300 group-hover:scale-105",sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 25vw, 20vw",options:{width:768,height:1024,model:"flux"}}):(0,i.jsx)(n.default,{src:t.posterImage,alt:t.title,fill:!0,className:"object-cover transition-transform duration-300 group-hover:scale-105",sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 25vw, 20vw"}),x&&(0,i.jsx)(i.Fragment,{children:t.creatorKnownFor&&t.creatorName?(0,i.jsx)(u.M,{knownFor:t.creatorKnownFor,creatorName:t.creatorName,position:"top-left"}):t.isExclusive?(0,i.jsx)(h.I,{position:"top-left"}):null}),void 0!==t.viewCount&&t.viewCount>0&&(0,i.jsx)(p.l,{viewCount:t.viewCount}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent px-8 pb-3 pt-6",children:(0,i.jsx)("h3",{className:"truncate text-center font-outfit text-base font-medium leading-tight tracking-[0.1px] text-white",title:(0,d.Sn)(t.title),children:(0,d.Sn)(t.title)})})]})})})}},4387:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExternalVideoControls:()=>a});var i=r(95155),n=r(41429);function a(e){let{isPlaying:t,isMuted:r,isFullscreen:a,onPlayPause:l,onMuteToggle:s,onFullscreenToggle:o,className:c}=e,d=(0,n.cx)("flex items-center justify-center","h-14 w-14 roun
1ded-full","bg-white/[0.08] text-white","hover:bg-white/[0.12] hover:scale-105 active:bg-white/[0.16]","transition-all duration-200","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60");return(0,i.jsxs)("div",{className:(0,n.cx)("pointer-events-none",c),children:[(0,i.jsx)("div",{className:"absolute left-4 bottom-8 pointer-events-auto",children:(0,i.jsx)("button",{onClick:l,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),l())},className:d,"aria-label":t?"Pause video":"Play video",type:"button",children:t?(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-7 w-7","aria-hidden":"true",children:[(0,i.jsx)("rect",{x:"6",y:"4",width:"4",height:"16",fill:"white",rx:"1"}),(0,i.jsx)("rect",{x:"14",y:"4",width:"4",height:"16",fill:"white",rx:"1"})]}):(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"white",className:"h-7 w-7 ml-0.5","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M8 5v14l11-7z"})})})}),(0,i.jsxs)("div",{className:"absolute right-4 bottom-8 flex items-center gap-3 pointer-events-auto",children:[(0,i.jsx)("button",{onClick:s,className:d,"aria-label":r?"Unmute":"Mute",type:"button",children:r?(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",fill:"white"})}):(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",fill:"white"})})}),(0,i.jsx)("button",{onClick:o,className:d,"aria-label":a?"Exit fullscreen":"Enter fullscreen",type:"button",children:a?(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"white"})}):(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"white"})})})]})]})}},4795:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Logo:()=>u});var i=r(95155),n=r(52619),a=r.n(n),l=r(15239),s=r(12115),o=r(20063),c=r(85396);let d={sm:{width:168,height:50},default:{width:210,height:64},lg:{width:210,height:64}};function u(e){let{size:t="default",asLink:r=!0,className:n="",style:u}=e,{width:h,height:p}
1=d[t],m=(0,o.usePathname)(),[f,x]=(0,s.useState)("/");(0,s.useEffect)(()=>{x((0,c.WN)("/"))},[m]);let v=(0,i.jsx)("span",{className:"inline-block ".concat(n),style:{...u,aspectRatio:"264/80"},"aria-label":"GammaTime",children:(0,i.jsx)(l.default,{src:"/gamma-logo-new.png",alt:"GammaTime",width:h,height:p,className:"object-contain",priority:!0})});return r?(0,i.jsx)(a(),{href:f,className:"inline-block transition-opacity hover:opacity-80",children:v}):v}},5594:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WatchNowButton:()=>a});var i=r(95155),n=r(12115);function a(e){let{showId:t,nextFreeEpisode:r,onWatchNow:a}=e,l=(0,n.useCallback)(()=>{r&&(a?a(r.id):window.location.href="/show/".concat(t,"/episode/").concat(r.id))},[t,r,a]);return(0,i.jsxs)("button",{type:"button",onClick:l,disabled:!r,className:"flex w-full items-center justify-center gap-2 rounded-full bg-white px-6 py-4 text-base font-semibold text-black transition-colors hover:bg-white/90 disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Watch first episode",children:[(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M8 5v14l11-7z"})}),"Watch Now"]})}},6121:(e,t,r)=>{"use strict";r.d(t,{ReelShortHeader:()=>a});var i=r(95155),n=r(4795);function a(){return(0,i.jsx)("header",{className:"sticky top-0 z-50 w-full bg-background/95 backdrop-blur-md border-b border-white/10",children:(0,i.jsx)("div",{className:"flex h-16 w-full items-center pl-10",children:(0,i.jsx)(n.Logo,{size:"lg",asLink:!0,className:"text-white"})})})}},6811:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContinueWatchingCard:()=>c});var i=r(95155),n=r(15239),a=r(52619),l=r.n(a),s=r(86814),o=r(85396);function c(e){let{item:t,basePath:r="/show"}=e,a=Math.round(100*t.progressPercent);return(0,i.jsx)(l(),{href:(0,o.WN)("".concat(r,"/").concat(t.showId,"?episodeId=").concat(t.episodeId)),className:"group block",children:(0,i.jsx)("div",{className:"overflow-hidden rounded-[6px] border border-episode-card-border shadow-lg transition-shadow duration-300 hover:shadow-xl",children:(0,i.jsxs)("div",{className:"relative aspect-[218/285] overflow-hidden",children:[t.showPosterPrompt?(0,i.jsx)(s.Mr,{prompt:t.showPosterPrompt,fallbackSrc:t.showPosterImage,alt:t.showTitle,fill:!0,className:"object-cover transition-transform duration-300 group-hover:scale-105",sizes:"(max-width: 768px) 50vw, 25vw",options:{width:480,height:640,model:"flux"}}):(0,i.jsx)(n.default,{src:t.showPosterImage,alt:t.showTitle,fill:!0,className:"object-cover transition-transform duration-300 group-hover:scale-105",sizes:"(max-width: 768px) 50vw, 25vw"}),(0,i.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/20 to-transparent"}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none opacity-0 transition-opacity duration-300 group-hover:opacity-100","aria-hidden":"true",children:(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-white/90 shadow-lg transition-transform duration-300 group-hover:scale-110",children:(0,i.jsx)("svg",{className:"h-5 w-5 translate-x-0.5 text-black",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M8 5v14l11-7z"})})})}),(0,i.jsx)("div",{className:"absolute bottom-3 left-3",children:(0,i.jsxs)("span",{className:"text-sm font-semibold text-white drop-shadow-md",children:["Eps.",t.episodeNumber]})}),(0,i.jsx)("div",{className:"absolute inset-x-0 bottom-0",children:(0,i.jsx)("div",{className:"relative h-1 w-full bg-white/30",children:(0,i.jsx)("div",{className:"absolute left-0 top-0 h-full bg-white transition-all duration-300",style:{width:"".concat(a,"%")}})})})]})})})}},7e3:(e,t,r)=>{"use strict";r.d(t,{PI:()=>s,Sn:()=>o,a3:()=>l,i9:()=>c});var i,n,a=r(87358);function l(e){let t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,"m ").concat(r.toString().padStart(2,"0"),"s")}function s(e){return"Episode ".concat(e.episodeNumber)}function o(e){if(!e)return e;let t=new Set(["a","an","the","and","but","or","for","nor","on","at","to","by","of","in"]),r=new Set(["US","USA","UK","FBI","CIA","CEO","DNA","TV","NYC","LA","PI"]);return e.split(" ").map((e,i)=>{if(r.has(e.toUpperCase()))return e.toUpperCase();let n=e.toLowerCase();return 0===i?n.charAt(0).toUpperCase()+n.slice(1):t.has(n)?n:n.charAt(0).toUpperCase()+n.slice(1)}).join(" ")}function c(e){if(!e)return;let t=e.split(/[?&#]/)[0].trim();return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)?t:void 0}void 0!==a&&((null==(n=a.env)||null==(i=n.GAMMATIME_USE_MOCK_DATA)?void 0:i.toLowerCase())==="true"||a.env)},8601:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Modal:()=>o});var i=r(95155),n=r(12115),a=r(47650),l=r(28182),s=r(41429);function o(e){var t;let{isOpen:r,title:o,description:c,onClose:d,actions:u,children:h,ariaLabel:p}=e,m=(0,n.useRef)(null),f=(0,n.useRef)(null),x=(0,n.useId)(),v=(0,n.useId)();if((0,n.useEffect)(()=>
1{if("undefined"==typeof document||!r)return;f.current=document.activeElement,document.body.style.overflow="hidden";let e=()=>{var e;let t=null==(e=m.current)?void 0:e.querySelector("[data-modal-close]");if(t)return t.focus({preventScroll:!0}),!0;let r=(0,s.iq)(m.current);return r.length>0&&(r[0].focus({preventScroll:!0}),!0)};e()||window.setTimeout(()=>{if(!e()){var t;null==(t=m.current)||t.focus({preventScroll:!0})}},0);let t=e=>{if("Escape"===e.key)e.stopPropagation(),null==d||d();else if("Tab"===e.key){let r=(0,s.iq)(m.current);if(0===r.length){var t;e.preventDefault(),null==(t=m.current)||t.focus({preventScroll:!0});return}let i=document.activeElement,n=r.indexOf(i),a=r.length-1;if(-1===n){e.preventDefault();let t=e.shiftKey?r[a]:r[0];null==t||t.focus({preventScroll:!0});return}e.shiftKey?n<=0&&(r[a].focus({preventScroll:!0}),e.preventDefault()):n===a&&(r[0].focus({preventScroll:!0}),e.preventDefault())}};return document.addEventListener("keydown",t,!0),()=>{var e;document.removeEventListener("keydown",t,!0),document.body.style.overflow="",null==(e=f.current)||e.focus({preventScroll:!0})}},[r,d]),!r)return null;let b=e=>{e.target===e.currentTarget&&(null==d||d())},g=p?void 0:o?x:void 0,w=c?v:void 0,y=(0,i.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-6",onMouseDown:b,onClick:b,role:"presentation","data-role":"modal-overlay",children:(0,i.jsxs)("div",{ref:m,role:"dialog","aria-modal":"true","aria-label":p,"aria-labelledby":g,"aria-describedby":w,tabIndex:-1,className:"w-full max-w-lg rounded-3xl bg-base-100 p-8 shadow-hard focus-visible:outline-none",children:[(0,i.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,i.jsxs)("div",{children:[o&&(0,i.jsx)("h2",{id:x,className:"text-xl font-semibold text-base-content",children:o}),c&&(0,i.jsx)("p",{id:v,className:"mt-2 text-sm text-base-content/70",children:c})]}),d&&(0,i.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:d,"aria-label":"Close dialog","data-modal-close":!0,children:"\xd7"})]}),(0,i.jsx)("div",{className:"mt-6 flex flex-col gap-4 text-base-content",children:h}),u&&(0,i.jsx)("div",{className:"mt-8 flex items-center justify-end gap-3",children:u})]})});if("undefined"==typeof document)return y;let j=null!=(t=document.getElementById("modal-root"))?t:document.body;return(0,a.createPortal)(y,j)}},9852:(e,t,r)=>{"use strict";function i(){let e="https://app.gammatime.live",t=null==e?void 0:e.trim().replace(/\/$/,"");return t||"https://www.gammatime.ai"}function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i(),r=e?e.trim():"/";try{return new URL(r,t).toString()}catch(i){let e=r.startsWith("/")?r:"/".concat(r);return"".concat(t).concat(e)}}function a(e){var t;let r={"@context":"https://schema.org","@type":"CreativeWorkSeries",name:e.title,description:e.description,image:function(e){let t=i();try{return new URL(e,t).toString()}catch(i){let r=e.startsWith("/")?e:"/".concat(e);return"".concat(t).concat(r)}}(e.coverImage),url:n("/show/".concat(e.id)),numberOfEpisodes:e.episodes.length};return(null==(t=e.tags)?void 0:t.length)&&(r.genre=e.tags),e.category&&(r.category=e.category),r}r.d(t,{Kf:()=>n,U7:()=>a}),r(87358)},10393:(e,t,r)=>{"use strict";r.d(t,{ReelShortEpisodeGrid:()=>a});var i=r(95155),n=r(12115);function a(e){let{episodes:t,currentEpisodeId:r,onEpisodeSelect:a,originalEpisodes:l}=e,[s,o]=(0,n.useState)([0,49]),c=(0,n.useMemo)(()=>[...t].sort((e,t)=>e.episodeNumber-t.episodeNumber),[t]),d=(0,n.useMemo)(()=>{let e=[];for(let t=0;t<c.length;t+=50){let r=t,i=Math.min(t+50-1,c.length-1);e.push([r,i])}return e},[c.length]),u=(0,n.useMemo)(()=>c.slice(s[0],s[1]+1),[c,s]),h=r?c.find(e=>e.id===r):void 0;return(0,i.jsxs)("div",{className:"space-y-4",children:[d.length>1&&(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[d.map((e,t)=>{var r,n;let[a,l]=e,d=(null==(r=c[a])?void 0:r.episodeNumber)||a+1,u=(null==(n=c[l])?void 0:n.episodeNumber)||l+1,h=s[0]===a;return(0,i.jsxs)("button",{type:"button",onClick:()=>o([a,l]),className:"px-3 py-1 text-sm rounded transition-colors ".concat(h?"bg-red-600 text-white":"bg-white/10 text-white/70 hover:bg-white/20 hover:text-white"),children:[d," - ",u]},t)}),(0,i.jsxs)("span",{className:"text-sm text-white/50 ml-2",children:["All Episodes",(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"inline ml-1",children:(0,i.jsx)("path",{d:"m9 18 6-6-6-6"})})]})]}),(0,i.jsx)("div",{className:"grid grid-cols-6 sm:grid-cols-7 md:grid-cols-8 lg:grid-cols-9 gap-2",children:u.map(e=>{let t=e.id===r,n=!e.isFree,s=null==l?void 0:l.find(t=>
1t.id===e.id),o=s?!s.isFree:!e.isFree,c=h&&e.episodeNumber<h.episodeNumber;return(0,i.jsxs)("button",{type:"button",onClick:()=>{a(e.id)},"data-testid":"episode-item","data-free":e.isFree?"true":"false",className:"aspect-square rounded-lg flex items-center justify-center text-sm font-medium transition-all relative ".concat(t?"bg-red-600 text-white ring-2 ring-red-400":n?"bg-white/5 text-white/30 hover:bg-white/10 cursor-pointer":c?"bg-white/20 text-white":"bg-white/10 text-white/70 hover:bg-white/20 hover:text-white"),"aria-label":"Episode ".concat(e.episodeNumber).concat(n?" (Locked - Get the app to watch)":""),title:e.title||"Episode ".concat(e.episodeNumber),children:[t?(0,i.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,i.jsx)("span",{className:"w-0.5 h-3 bg-white rounded-full animate-pulse"}),(0,i.jsx)("span",{className:"w-0.5 h-4 bg-white rounded-full animate-pulse delay-75"}),(0,i.jsx)("span",{className:"w-0.5 h-3 bg-white rounded-full animate-pulse delay-150"})]}):e.episodeNumber,o&&!t&&(n?(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"currentColor",className:"absolute bottom-1 right-1 text-white/50",children:(0,i.jsx)("path",{d:"M12 1a5 5 0 0 0-5 5v2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2h-2V6a5 5 0 0 0-5-5zm-3 5a3 3 0 1 1 6 0v2H9V6z"})}):(0,i.jsx)("span",{className:"absolute top-0.5 right-0.5 px-1 py-0.5 rounded text-[7px] font-bold font-outfit leading-none text-white bg-brand-purple/80",children:"VIP"}))]},e.id)})})]})}},12909:(e,t,r)=>{"use strict";r.d(t,{ReelShortShowInfo:()=>a});var i=r(95155),n=r(12115);function a(e){let{show:t,currentEpisode:r}=e,a=r?"Episode ".concat(r.episodeNumber," - ").concat(t.title):t.title,l=(null==r?void 0:r.description)||t.description||"",[s,o]=(0,n.useState)(!1),c=l.length>200&&!s?"".concat(l.slice(0,200),"..."):l,d=t.tags||[];return(0,i.jsxs)("div",{className:"space-y-4",children:[(0,i.jsx)("div",{children:(0,i.jsx)("h1",{className:"text-xl font-bold text-white leading-tight","data-testid":"show-title",children:a})}),(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("h2",{className:"text-sm font-semibold text-white/90",children:["Plot of Episode ",(null==r?void 0:r.episodeNumber)||1]}),(0,i.jsxs)("p",{className:"text-sm text-white/70 leading-relaxed",children:[c,l.length>200&&(0,i.jsx)("button",{type:"button",onClick:()=>o(!s),className:"text-red-500 hover:text-red-400 ml-1 font-medium",children:s?"Less":"More"})]})]}),d.length>0&&(0,i.jsx)("div",{className:"flex flex-wrap gap-2",children:d.map((e,t)=>(0,i.jsx)("span",{className:"px-3 py-1 bg-white/10 text-white/80 text-xs rounded-full hover:bg-white/20 transition-colors cursor-pointer",children:e},t))}),(0,i.jsx)("div",{className:"flex items-center gap-8 pt-2",children:(0,i.jsxs)("button",{type:"button",onClick:()=>{navigator.share&&navigator.share({title:t.title,text:"Watch ".concat(t.title," on GammaTime"),url:window.location.href})},className:"flex flex-col items-center gap-1 group",children:[(0,i.jsx)("div",{className:"w-10 h-10 rounded-full bg-white/10 group-hover:bg-white/20 flex items-center justify-center transition-colors",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/70",children:[(0,i.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,i.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,i.jsx)("line",{x1:"12",x2:"12",y1:"2",y2:"15"})]})}),(0,i.jsx)("span",{className:"text-xs text-white/70",children:"Share"})]})})]})}},14191:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ProfileDropdown:()=>o});var i=r(95155),n=r(12115),a=r(47650),l=r(20063),s=r(15239);function o(e){let{user:t,isGuest:r=!1,isPaying:o=!1,onSignIn:c,onSignOut:d}=e,u=(0,l.useRouter)(),[h,p]=(0,n.useState)(!1),m=(0,n.useRef)(null),f=(0,n.useRef)(null),x=(0,n.useRef)(null),[v,b]=(0,n.useState)(null),g=(0,n.useCallback)(()=>{let e=f.current;if(!e)return;let t=e.getBoundingClientRect();b({top:t.bottom+8,right:window.innerWidth-t.right})},[]);(0,n.useEffect)(()=>
1{if(h)return g(),window.addEventListener("resize",g),window.addEventListener("scroll",g,!0),()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",g,!0)}},[h,g]),(0,n.useEffect)(()=>{let e=e=>{let t=e.target;!m.current||m.current.contains(t)||x.current&&x.current.contains(t)||p(!1)};return h&&document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h]);let w=r?"Guest":t.displayName||t.email||"User",y=r?"G":function(e){let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}(w);return(0,i.jsxs)("div",{className:"relative",ref:m,children:[(0,i.jsxs)("div",{className:"relative",ref:f,children:[(0,i.jsx)("button",{type:"button",onClick:()=>p(!h),className:"flex h-9 w-9 items-center justify-center rounded-full text-sm font-semibold text-white transition-transform hover:scale-105 focus:outline-none focus-visible:ring-2 focus-visible:ring-gamma/70 focus-visible:ring-offset-2 focus-visible:ring-offset-base-100 overflow-hidden",style:r?{borderRadius:"175px",border:"0.778px solid rgba(255, 255, 255, 0.18)",background:"#B8B8B8"}:{borderRadius:"225px",border:"1px solid rgba(255, 255, 255, 0.18)",background:"rgba(159, 122, 254, 0.92)"},children:r?(0,i.jsx)(s.default,{src:"/images/guest-avatar.svg",alt:"Guest",width:36,height:36,className:"h-full w-full object-cover",draggable:!1}):y}),o&&!r&&(0,i.jsxs)("div",{className:"pointer-events-none absolute flex items-center justify-center",style:{bottom:"-4px",left:"50%",transform:"translateX(-50%)",width:"32px",height:"14px"},children:[(0,i.jsx)(s.default,{src:"/images/vip-badge.svg",alt:"VIP",width:32,height:14,style:{width:"32px",height:"14px"},draggable:!1}),(0,i.jsx)("span",{style:{position:"absolute",fontFamily:"Outfit, sans-serif",fontSize:"7px",fontWeight:700,color:"#fff",lineHeight:1,letterSpacing:"0.5px"},children:"VIP"})]})]}),h&&"undefined"!=typeof document&&v&&(0,a.createPortal)((0,i.jsxs)("div",{ref:x,className:"fixed w-60 overflow-hidden shadow-xl z-[60]",style:{top:v.top,right:v.right,borderRadius:"13.075px",border:"0.545px solid rgba(255, 255, 255, 0.18)",background:r?"rgba(171, 138, 255, 0.08)":"rgba(20, 20, 20, 0.95)",backdropFilter:"blur(14.9px)",WebkitBackdropFilter:"blur(14.9px)"},children:[!r&&(0,i.jsxs)("div",{className:"px-4 py-3 border-b border-white/10",children:[(0,i.jsx)("p",{className:"text-white text-sm font-medium font-outfit truncate",children:w}),t.email&&(0,i.jsx)("p",{className:"text-white/50 text-xs font-outfit truncate",children:t.email})]}),(0,i.jsx)("div",{className:"py-1",children:r?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"px-4 pt-4 pb-3 text-center border-b border-white/10",children:[(0,i.jsx)("p",{className:"text-white text-[18px] font-bold font-outfit leading-tight",children:"Welcome"}),(0,i.jsx)("p",{className:"text-white/55 text-[14px] font-normal font-outfit mt-1",children:"Sign in to sync across devices"})]}),(0,i.jsx)("button",{onClick:()=>{p(!1),u.push("/profile")},className:"w-full px-4 py-3.5 text-left text-[15px] font-outfit text-white hover:bg-white/10 transition-colors border-b border-white/10",children:"My Profile"}),(0,i.jsx)("div",{className:"px-3 pt-3 pb-3",children:(0,i.jsx)("button",{onClick:()=>{p(!1),c&&c()},className:"w-full h-[52px] flex items-center justify-center rounded-[14px] text-white text-[15px] font-semibold font-outfit transition-transform hover:scale-[1.02] active:scale-[0.98]",style:{background:"linear-gradient(97deg, #6528FF -0.17%, #AB8AFF 100%)",boxShadow:"0 0 20px 0 rgba(123, 71, 255, 0.55), 0 0 40px 0 rgba(123, 71, 255, 0.28)"},children:"Sign in"})})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{onClick:()=>{p(!1),u.push("/profile")},className:"w-full px-4 py-2.5 text-left text-sm font-outfit text-white hover:bg-white/10 transition-colors",children:"My Profile"}),(0,i.jsx)("a",{href:"mailto:[email protected]",onClick:()=>p(!1),className:"block w-full px-4 py-2.5 text-left text-sm font-outfit text-white/70 hover:bg-white/10 transition-colors",children:"Contact Support"}),(0,i.jsx)("div",{className:"border-t border-white/10 my-1"}),(0,i.jsx)("button",{onClick:()=>{p(!1),d()},className:"w-full px-4 py-2.5 text-left text-sm font-outfit text-red-400 hover:bg-white/10 transition-colors",children:"Sign Out"})]})})]}),document.body)]})}},14240:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SubscriptionModalLegacy:()=>s});var i=r(95155),n=r(12115),a=r(47650);let l=[];function s(e){var t,r,s,o;let{plans:c,onSelectPlan:d,onClose:u,isLoading:h=!1,error:p=null}=e,m=c.length>
10?c:l,[f,x]=(0,n.useState)((null==(t=m[0])?void 0:t.id)||""),v=m.find(e=>e.id===f),b=(0,n.useCallback)(()=>{f&&!h&&d(f)},[f,h,d]),g=(0,i.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-end md:items-center justify-center",onClick:u,role:"presentation",children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-black/60"}),(0,i.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"relative w-full md:max-w-[420px] rounded-t-[28px] md:rounded-[28px] overflow-hidden max-h-[90vh] overflow-y-auto",children:[(0,i.jsxs)("div",{className:"absolute inset-0",children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-[#090909]"}),(0,i.jsx)("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 w-[300px] h-[300px] rounded-full opacity-50 blur-[80px]",style:{background:"rgba(101, 40, 255, 1)"}}),(0,i.jsx)("div",{className:"absolute top-20 left-0 w-[200px] h-[300px] opacity-30 blur-[60px]",style:{background:"linear-gradient(180deg, rgba(97, 22, 235, 1) 0%, rgba(39, 7, 110, 1) 100%)"}})]}),(0,i.jsxs)("div",{className:"relative z-10 flex flex-col px-5 pt-5 pb-6",children:[p&&(0,i.jsx)("div",{className:"flex justify-center mb-3",children:(0,i.jsx)("div",{className:"px-4 py-2.5 rounded-[10px] bg-white shadow-lg",children:"failed"===p?(0,i.jsx)("span",{className:"text-[#EF274B] text-[14px] font-semibold font-outfit",children:"Purchase failed, please try again"}):(0,i.jsx)("span",{className:"text-[#090909] text-[14px] font-normal font-outfit",children:"Purchase canceled!"})})}),(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-full bg-white/10",children:[(0,i.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,i.jsx)("path",{d:"M12 6v6l4 2"})]}),(0,i.jsx)("span",{className:"text-white text-[15px] font-medium font-outfit",children:"Limited Time Offer"})]}),(0,i.jsx)("button",{onClick:u,className:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10","aria-label":"Close",children:(0,i.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2.5",children:(0,i.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsxs)("h1",{className:"text-white text-[26px] font-semibold font-outfit text-center leading-tight",children:["Keep Watching.","\n","No limits. No interruptions."]}),(0,i.jsx)("div",{className:"mt-8 space-y-4",children:m.map((e,t)=>{let r=f===e.id,n=0===t;return(0,i.jsxs)("button",{onClick:()=>{h||(x(e.id),d(e.id))},disabled:h,className:"w-full text-left relative",children:[e.badge&&(0,i.jsx)("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 px-4 py-1 rounded-full text-[15px] font-semibold font-outfit text-white whitespace-nowrap z-10",style:{background:"linear-gradient(135deg, rgba(101, 35, 236, 1) 0%, rgba(158, 120, 254, 1) 100%)"},children:e.badge}),(0,i.jsx)("div",{className:"rounded-[22px] p-[2px]",style:{background:r?n?"linear-gradient(135deg, rgba(111, 40, 255, 1), rgba(251, 197, 112, 1))":"rgba(171, 138, 255, 1)":"rgba(255, 255, 255, 0.1)"},children:(0,i.jsxs)("div",{className:"rounded-[20px] p-5 flex items-center justify-between",style:{background:n?"linear-gradient(135deg, rgba(39, 7, 110, 1) 0%, rgba(111, 40, 255, 1) 100%)":"#090909"},children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("div",{className:"w-6 h-6 rounded-full border-2 flex items-center justify-center flex-shrink-0 ".concat(r?"border-[#C2185B] bg-[#C2185B]":"border-white/30"),children:r&&(0,i.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-white"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-white text-[20px] font-bold font-outfit",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[e.originalPrice&&(0,i.jsx)("span",{className:"text-white/50 text-[15px] font-outfit line-through",children:e.originalPrice}),(0,i.jsx)("span",{className:"text-white text-[15px] font-semibold font-outfit",children:e.price})]}),e.description&&(0,i.jsx)("p",{className:"text-white/60 text-[11px] font-medium font-outfit mt-1",children:e.description})]})]}),(0,i.jsx)("div",{className:"text-right",children:(0,i.jsxs)("div",{className:"text-white text-[17px] font-semibold font-outfit",children:[e.pricePerDay," / day"]})})]})})]},e.id)})})]}),(0,i.jsxs)("div",{className:"mt-6 space-y-3",children:[(null==v?void 0:v.renewalPrice)?(0,i.jsxs)("p",{className:"text-white/60 text-[13px] leading-relaxed font-outfit text-center",children:["By clicking Start Watching Now, you agree to an intro offer of"," ",v.price," for the first"," ",null!=(r=v.renewalInterval)?r:"peri
1od",", then"," ",v.renewalPrice," every"," ",null!=(s=v.renewalInterval)?s:"period",", with automatic renewals unless canceled through the applicable subscription management service. You also agree to our"," ",(0,i.jsx)("a",{href:"/privacy-policy",className:"underline",target:"_blank",children:"Privacy Policy"}),","," ",(0,i.jsx)("a",{href:"/terms-of-service",className:"underline",target:"_blank",children:"Subscription Terms"})," ","&"," ",(0,i.jsx)("a",{href:"/subscription-policy",className:"underline",target:"_blank",children:"Subscription Policy"}),". Intro offer for first-time subscribers only."]}):(0,i.jsx)("p",{className:"text-white/60 text-[14px] font-outfit text-center",children:"Auto-renew \xa0\xb7\xa0 Cancel anytime"}),(0,i.jsx)("button",{onClick:b,disabled:h||!f,className:"w-full py-4 bg-white font-outfit font-semibold text-[#090909] text-[15px] transition-transform hover:scale-[1.02] active:scale-[0.97] disabled:opacity-50",style:{borderRadius:"16px"},children:h?"Processing...":"Start Watching Now"}),(0,i.jsxs)("div",{className:"flex items-center justify-center gap-6 pt-2",children:[(0,i.jsx)("a",{href:"/terms-of-service",className:"text-white/60 text-[14px] font-outfit hover:text-white/80",target:"_blank",children:"Terms"}),(0,i.jsx)("a",{href:"/privacy-policy",className:"text-white/60 text-[14px] font-outfit hover:text-white/80",target:"_blank",children:"Privacy"})]})]})]})]})]});return"undefined"==typeof document?null:(0,a.createPortal)(g,null!=(o=document.getElementById("modal-root"))?o:document.body)}},14849:(e,t,r)=>{"use strict";r.d(t,{PlayStopControl:()=>s});var i=r(95155),n=r(12115),a=r(88563),l=r(34779);function s(e){let{isPlaying:t,onToggle:r,className:s=""}=e,o=(0,n.useCallback)(e=>{e.stopPropagation(),r()},[r]);return(0,i.jsx)("button",{type:"button",onClick:o,className:"flex h-12 w-12 items-center justify-center rounded-full bg-black/60 text-white backdrop-blur-sm transition-all hover:bg-black/80 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black ".concat(s),"aria-label":t?"Pause video":"Play video",title:t?"Pause":"Play","data-testid":"play-stop-control",children:t?(0,i.jsx)(a.A,{className:"h-6 w-6"}):(0,i.jsx)(l.A,{className:"h-6 w-6"})})}},14944:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContentProtection:()=>a});var i=r(12115);let n="false"!==r(87358).env.NEXT_PUBLIC_CONTENT_PROTECTION;function a(){let e=(0,i.useRef)(!1),t=(0,i.useRef)(null),r=(0,i.useCallback)(()=>{if(e.current)return;e.current=!0,console.clear(),console.log("%câ ï¸ Warning!","color: red; font-size: 48px; font-weight: bold;"),console.log("%cThis browser feature is intended for developers. If someone told you to copy-paste something here, it is a scam and will give them access to your account.","color: red; font-size: 16px;");let t=document.getElementById("__next")||document.body;t.style.filter="blur(20px)",t.style.pointerEvents="none",t.style.userSelect="none";let r=document.createElement("div");r.id="protection-overlay",r.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.95);\n z-index: 999999;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n color: white;\n font-family: system-ui, -apple-system, sans-serif;\n ",r.innerHTML='\n <div style="font-size: 64px; margin-bottom: 20px;">\uD83D\uDEE1ï¸</div>\n <h1 style="font-size: 24px; margin-bottom: 10px;">Developer Tools Detected</h1>\n <p style="color: #888; text-align: center; max-width: 400px;">\n For security reasons, this page cannot be viewed with developer tools open.\n Please close developer tools and refresh the page.\n </p>\n ',document.body.appendChild(r)},[]),a=(0,i.useCallback)(()=>{if("undefined"!=typeof navigator&&/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent))return;let e=performance.now();for(let e=0;e<100;e++);if(performance.now()-e>100)return void r();let t=new Image;Object.defineProperty(t,"id",{get:function(){return r(),""}}),console.debug(t)},[r]),l=(0,i.useCallback)(e=>{let t=e.code;return"F12"!==e.key&&"F12"!==t&&(!e.ctrlKey||!e.shiftKey||"I"!==e.key&&"KeyI"!==t)&&(!e.ctrlKey||!e.shiftKey||"J"!==e.key&&"KeyJ"!==t)&&(!e.ctrlKey||!e.shiftKey||"C"!==e.key&&"KeyC"!==t)&&(!e.ctrlKey||"u"!==e.key&&"U"!==e.key&&"KeyU"!==t)&&(!e.metaKey||!e.altKey||"KeyI"!==t)&&(!e.metaKey||!e.altKey||"KeyJ"!==t)&&(!e.metaKey||!e.altKey||"KeyC"!==t)&&(!e.metaKey||!e.altKey||"KeyU"!==t)&&(!e.metaKey||!e.shiftKey||"KeyC"!==t)||(e.preventDefault(),e.stopPropagation(),!1)},[]),s=(0,i.useCallback)(e=>(e.preventDefault(),e.stopPropagation(),!1),[]),o=(0,i.useCallback)(e=>{let t=e.target;return!t||!t.tagName||!("VIDEO"===t.tagName||"function"==typeof t.closest&&t.closest("video"))||(e.preventDefault(),!1)},[]),c=(0,i.useCallback)(()=>{let e=Date.now();Date.now()-e>100&&r()},[r]);return(0,i.useEffect)(()=>
1{if(!n)return;let e=document.createElement("style");if(e.textContent="\n /* Makes video content appear black in screen recordings on supported browsers */\n video {\n -webkit-content-visibility: auto;\n }\n /* Prevent PiP which could bypass protections */\n video::-webkit-media-controls-picture-in-picture-button {\n display: none !important;\n }\n ",document.head.appendChild(e),navigator.mediaDevices){let t=navigator.mediaDevices.getDisplayMedia;return navigator.mediaDevices.getDisplayMedia=function(){return Promise.reject(new DOMException("Screen capture is not allowed","NotAllowedError"))},MediaDevices.prototype.getDisplayMedia&&(MediaDevices.prototype.getDisplayMedia=function(){return Promise.reject(new DOMException("Screen capture is not allowed","NotAllowedError"))}),()=>{navigator.mediaDevices.getDisplayMedia=t,e.remove()}}return()=>{e.remove()}},[]),(0,i.useEffect)(()=>{if(!n)return;let e=!1,t=()=>{document.querySelectorAll("video").forEach(t=>{t.paused||(t.pause(),e=!0)})},r=()=>{e&&(document.querySelectorAll("video").forEach(e=>{e.paused&&e.readyState>=2&&e.play().catch(()=>{})}),e=!1)},i=()=>{document.hidden?t():r()},a=()=>{t()},l=()=>{r()};return document.addEventListener("visibilitychange",i),window.addEventListener("blur",a),window.addEventListener("focus",l),()=>{document.removeEventListener("visibilitychange",i),window.removeEventListener("blur",a),window.removeEventListener("focus",l)}},[]),(0,i.useEffect)(()=>{if(!n)return;console.clear(),document.addEventListener("keydown",l,!0),document.addEventListener("contextmenu",s,!0),document.addEventListener("selectstart",o,!0);let e=()=>{document.querySelectorAll("video").forEach(e=>{var t,r;e.disablePictureInPicture=!0,null==(t=e.controlsList)||t.add("nodownload"),null==(r=e.controlsList)||r.add("noplaybackrate")})};e();let r=new MutationObserver(e);r.observe(document.body,{childList:!0,subtree:!0}),t.current=setInterval(()=>{a()},1e3);let i=setInterval(()=>{c()},5e3),d={...console};return console.log=()=>{},console.info=()=>{},console.debug=()=>{},console.table=()=>{},console.dir=()=>{},console.dirxml=()=>{},console.group=()=>{},console.groupEnd=()=>{},console.time=()=>{},console.timeEnd=()=>{},console.trace=()=>{},console.assert=()=>{},console.count=()=>{},()=>{document.removeEventListener("keydown",l,!0),document.removeEventListener("contextmenu",s,!0),document.removeEventListener("selectstart",o,!0),r.disconnect(),t.current&&clearInterval(t.current),clearInterval(i),Object.assign(console,d)}},[l,s,o,a,c]),null}},17314:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DownloadAppButton:()=>o});var i=r(95155),n=r(7776),a=r(15239),l=r(52619),s=r.n(l);function o(e){let{className:t="",position:r="fixed"}=e;return(0,i.jsx)("div",{className:"".concat(t," ").concat("fixed"===r?"fixed bottom-6 right-6 z-50 hidden lg:block":""),children:(0,i.jsx)("div",{className:"rounded-xl p-[1px]",style:{background:"linear-gradient(135deg, #7259C3 0%, #392C80 100%)"},children:(0,i.jsxs)("div",{className:"flex items-center gap-2 rounded-xl px-5 py-4 backdrop-blur-sm",style:{backgroundColor:"#15002A"},children:[(0,i.jsx)(a.default,{src:"/images/branding/gamma-app-icon.png",alt:"GammaTime",width:48,height:48,className:"flex-shrink-0",priority:!0}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-white font-semibold text-sm",children:"Download the app"}),(0,i.jsx)("span",{className:"text-white/60 text-xs",children:"Get the app just within the app stores"})]}),(0,i.jsxs)(s(),{href:"/download",className:"group flex items-center gap-2 rounded-full bg-primary px-4 py-2 text-sm font-medium text-primary-content hover:bg-primary/90 transition-colors",children:[(0,i.jsx)("span",{children:"Get the App"}),(0,i.jsx)(n.A,{className:"w-4 h-4 group-hover:translate-x-0.5 transition-transform"})]})]})})})}},18006:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Tabs:()=>l});var i=r(95155),n=r(12115),a=r(41429);function l(e){var t;let{items:r,defaultValue:l}=e,s=(0,n.useId)(),o=(0,n.useMemo)(()=>r.map(e=>({tab:"".concat(s,"-tab-").concat(e.id),panel:"".concat(s,"-panel-").concat(e.id)}
1)),[s,r]),[c,d]=(0,n.useState)(()=>{var e;return l&&r.some(e=>e.id===l)?l:null==(e=r[0])?void 0:e.id});(0,n.useEffect)(()=>{var e;c&&r.some(e=>e.id===c)||d(null==(e=r[0])?void 0:e.id)},[c,r]);let u=(0,n.useRef)({}),h=e=>{e&&c!==e&&(d(e),window.setTimeout(()=>{var t;null==(t=u.current[e])||t.focus({preventScroll:!0})},0))},p=(e,t)=>{var i,n,a,l;if(0===r.length)return;let s=e;do s=(s+t+r.length)%r.length;while((null==(i=r[s])?void 0:i.disabled)&&s!==e);let o=null==(n=r[s])?void 0:n.id;!o||(null==(a=r[s])?void 0:a.disabled)||(null==(l=u.current[o])||l.focus({preventScroll:!0}),d(o))},m=r.findIndex(e=>e.id===c),f=o[m],x=null==(t=r[m])?void 0:t.content;return(0,i.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,i.jsx)("div",{className:"flex flex-wrap gap-3",role:"tablist","aria-orientation":"horizontal",children:r.map((e,t)=>{let n=e.id===c,l=o[t];return(0,i.jsx)("button",{ref:t=>{u.current[e.id]=t},id:null==l?void 0:l.tab,role:"tab",type:"button","aria-controls":null==l?void 0:l.panel,"aria-selected":n,tabIndex:n?0:-1,disabled:e.disabled,className:(0,a.cx)("rounded-full px-4 py-2 text-sm font-medium transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60",n?"bg-primary text-primary-content shadow-soft":"bg-base-200/60 text-base-content/70 hover:bg-base-200"),onClick:()=>h(e.id),onKeyDown:e=>((e,t)=>{var i,n,a;switch(e.key){case"ArrowRight":case"ArrowDown":e.preventDefault(),p(t,1);break;case"ArrowLeft":case"ArrowUp":e.preventDefault(),p(t,-1);break;case"Home":e.preventDefault(),h(null==(i=r.find(e=>!e.disabled))?void 0:i.id);break;case"End":e.preventDefault(),h(null==(n=[...r].reverse().find(e=>!e.disabled))?void 0:n.id);break;case"Enter":case" ":e.preventDefault(),h(null==(a=r[t])?void 0:a.id)}})(e,t),children:e.label},e.id)})}),(0,i.jsx)("div",{id:null==f?void 0:f.panel,role:"tabpanel","aria-labelledby":null==f?void 0:f.tab,tabIndex:0,className:"rounded-3xl border border-base-300 bg-base-200/40 p-6 shadow-soft focus-visible:outline-none",children:null!=x?x:(0,i.jsx)("div",{className:"text-base-content/70",children:"No content"})})]})}},19606:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MobileEpisodeHeader:()=>a});var i=r(95155),n=r(20063);function a(e){let{episode:t,showId:r,onBack:a,onMenuClick:l}=e,s=(0,n.useRouter)();return(0,i.jsxs)("div",{className:"fixed left-0 right-0 top-0 z-50 flex items-center justify-between bg-gradient-to-b from-black/70 to-transparent p-4 md:hidden",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("button",{onClick:()=>{a?a():s.push("/show/".concat(r))},className:"flex h-8 w-8 items-center justify-center text-white hover:opacity-80","aria-label":"Go back to show",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-6 w-6",children:(0,i.jsx)("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),(0,i.jsxs)("span",{className:"text-sm font-semibold text-white",children:["EP.",t.episodeNumber]})]}),(0,i.jsx)("button",{onClick:()=>{l?l():console.log("Episode menu clicked")},className:"flex h-8 w-8 items-center justify-center text-white hover:opacity-80","aria-label":"More options",children:(0,i.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-6 w-6",children:[(0,i.jsx)("circle",{cx:"12",cy:"5",r:"1",fill:"currentColor"}),(0,i.jsx)("circle",{cx:"12",cy:"12",r:"1",fill:"currentColor"}),(0,i.jsx)("circle",{cx:"12",cy:"19",r:"1",fill:"currentColor"})]})})]})}},20717:(e,t,r)=>{"use strict";r.d(t,{VideoUtilityControls:()=>c});var i=r(95155),n=r(12115),a=r(6059),l=r(92489),s=r(65406),o=r(69505);function c(e){let{isMuted:t,isFullscreen:r,onToggleMute:c,onToggleFullscreen:d,className:u=""}=e,h=(0,n.useCallback)(e=>{e.stopPropagation(),c()},[c]),p=(0,n.useCallback)(e=>{e.stopPropagation(),d()},[d]);return(0,i.jsxs)("div",{className:"flex items-center gap-2 ".concat(u),children:[(0,i.jsx)("button",{type:"button",onClick:h,className:"flex h-12 w-12 items-center justify-center rounded-full bg-black/60 text-white backdrop-blur-sm transition-all hover:bg-black/80 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black","aria-label":t?"Unmute video":"Mute video",title:t?"Unmute":"Mute","data-testid":"mute-control",children:t?(0,i.jsx)(a.A,{className:"h-6 w-6"}):(0,i.jsx)(l.A,{className:"h-6 w-6"})}),(0,i.jsx)("button",{type:"button",onClick:p,className:"flex h-12 w-12 items-center justify-center rounded-full bg-black/60 text-white backdrop-blur-sm transition-all hover:bg-black/80 hover:scale-105 focus:outline-none focus:ring-2 focus:ring-white/50 focus:ring-offset-2 focus:ring-offset-black","aria-label":r?"Exit fullscreen":"Enter fullscreen",title:r?"Exit Fullscreen":"Fullscreen","data-testid":"fullscreen-control",children:r?(0,i.jsx)(s.A,{className:"h-6 w-6"}):(0,i.jsx)(o.A,{className:"h-6 w-6"})})]})}},21185:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MobileMetadataSheet:()=>o});var i=r(95155),n=r(12115),a=r(86814),l=r(32921),s=r(9852);function o(e){let{episode:t,show:r,defaultOpen:o=!1}
1=e,[c,d]=(0,n.useState)(o);return(0,i.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-base-100 shadow-2xl transition-transform duration-300 ease-out md:hidden ".concat(c?"translate-y-0":"translate-y-[calc(100%-4rem)]"),children:[(0,i.jsx)("button",{onClick:()=>d(!c),className:"flex w-full cursor-pointer items-center justify-center border-t border-base-300 bg-base-100 py-3 hover:bg-base-200","aria-label":c?"Hide episode details":"Show episode details","aria-expanded":c,children:(0,i.jsx)("div",{className:"h-1 w-12 rounded-full bg-base-content/30"})}),(0,i.jsxs)("div",{className:"max-h-[70vh] overflow-y-auto p-6",children:[(0,i.jsxs)(a.Ex,{variant:"accent",className:"mb-4",children:["Episode ",t.episodeNumber]}),(0,i.jsx)("h2",{className:"mb-3 text-2xl font-semibold text-base-content",children:t.title}),(0,i.jsx)("p",{className:"mb-4 text-base text-base-content/80",children:t.description}),!t.isFree&&(0,i.jsx)("p",{className:"mb-4 text-sm text-base-content/70",children:"This episode requires the GammaTime app. Download the app to continue watching the full season."}),(0,i.jsx)(l.ShareButtons,{className:"pt-2",title:t.title,text:'Watch "'.concat(t.title,'" from "').concat(r.title,'" on GammaTime.'),url:(0,s.Kf)("/show/".concat(r.id,"/episode/").concat(t.id)),analyticsContext:{source:"episode_page_mobile",showId:r.id,episodeId:t.id}})]})]})}},21512:(e,t,r)=>{"use strict";r.d(t,{Wi:()=>m,v1:()=>n,Ub:()=>a,qs:()=>l,Iu:()=>d,vl:()=>u,Rq:()=>p,Ri:()=>f,RU:()=>b,l:()=>g.l});var i=r(12115);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{root:t,rootMargin:r,threshold:n,disabled:a=!1}=e,[l,s]=(0,i.useState)(),o=(0,i.useRef)(null),c=(0,i.useRef)(null),d=(0,i.useCallback)(()=>{var e;null==(e=o.current)||e.disconnect(),o.current=null},[]),u=(0,i.useCallback)(()=>{"undefined"!=typeof IntersectionObserver&&(d(),o.current=new IntersectionObserver(e=>{let[t]=e;t&&s(t)},{root:t,rootMargin:r,threshold:n}),c.current&&o.current.observe(c.current))},[d,t,r,n]);return(0,i.useEffect)(()=>a?void d():(u(),()=>{d()}),[u,d,a]),{ref:(0,i.useCallback)(e=>{let t=c.current;t&&o.current&&o.current.unobserve(t),c.current=e,o.current&&e&&!a&&o.current.observe(e)},[a]),entry:l,isIntersecting:!!(null==l?void 0:l.isIntersecting)}}function a(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],[r,n]=(0,i.useState)(t);return(0,i.useEffect)(()=>{let t=window.matchMedia(e);n(t.matches);let r=e=>{n(e.matches)};return t.addEventListener?t.addEventListener("change",r):t.addListener(r),()=>{t.removeEventListener?t.removeEventListener("change",r):t.removeListener(r)}},[e]),r}function l(e,t){let r=(0,i.useRef)([]);(0,i.useEffect)(()=>{let i=function(){if("undefined"==typeof navigator)return null;let e=navigator.mediaSession;return null!=e?e:null}();if(!i)return;if(e)try{i.metadata=new MediaMetadata(e)}catch(e){i.metadata=null}else i.metadata=null;let n=Object.entries(null!=t?t:{});return n.forEach(e=>{let[t,r]=e;i.setActionHandler(t,null!=r?r:null)}),r.current=n.filter(e=>{let[,t]=e;return!!t}).map(e=>{let[t]=e;return t}),()=>{r.current.forEach(e=>{try{i.setActionHandler(e,null)}catch(e){}}),i.metadata=null,r.current=[]}},[e,t])}let s="gamma.playback";function o(){let e=window.localStorage.getItem(s);if(!e)return{};try{let t=JSON.parse(e);return null!=t?t:{}}catch(e){return{}}}function c(e){window.localStorage.setItem(s,JSON.stringify(e))}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{autoClearThreshold:r=.95}=t,[n,a]=(0,i.useState)(),l=(0,i.useRef)(e);(0,i.useEffect)(()=>{l.current=e},[e]),(0,i.useEffect)(()=>{a(o()[e]);let t=e=>{e.key===s&&a(o()[l.current])};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}},[e]);let d=(0,i.useCallback)((e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return;let i=Math.max(0,Math.min(e,t)),n=i/t,s=o();if(n>=r){delete s[l.current],c(s),a(void 0);return}let d={currentTime:i,duration:t,updatedAt:Date.now()};s[l.current]=d,c(s),a(d)},[r]),u=(0,i.useCallback)(()=>{let e=o();e[l.current]&&(delete e[l.current],c(e)),a(void 0)},[]);return{resumeTime:n?n.currentTime:0,progress:(0,i.useMemo)(()=>!n||n.duration<=0?0:Math.min(1,Math.max(0,n.currentTime/n.duration)),[n]),lastUpdatedAt:null==n?void 0:n.updatedAt,saveProgress:d,clearProgress:u}}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{pageSize:t}=e,r=(0,i.useRef)(null),[n,a]=(0,i.useState)(!1),[l,s]=(0,i.useState)(!1),o=(0,i.useCallback)(()=>{let e=r.current;if(!e){a(!1),s(!1);return}let t=e.scrollWidth-e.clientWidth,i=e.scrollLeft;a(i>8),s(t-i>8)},[]),c=(0,i.useCallback)(e=>{let i=r.current;if(!i)return;let n=t&&t>0?t:i.clientWidth||360;i.scrollBy({left:e*n,behavior:"smooth"}),setTimeout(o,350)},[t,o]),d=(0,i.useCallback)(()=>{c(-1)},[c]),u=(0,i.useCallback)(()=>{c(1)},[c]),h=(0,i.useCallback)(e=>{e.defaultPrevented||("ArrowLeft"===e.key&&(e.preventDefault(),d()),"ArrowRight"===e.key&&(e.preventDefault(),u()))},[u,d]);return(0,i.useEffect)(()=>{let e=r.current;if(!e)return;requestAnimationFrame(o);let t=()=>{o()},i=()=>{o()};return e.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",i),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",i)}}
1,[o]),{containerRef:r,canScrollPrev:n,canScrollNext:l,scrollPrev:d,scrollNext:u,onKeyDown:h}}var h=r(20063);function p(){var e;let t=(0,h.usePathname)();return null!=(e=null==t?void 0:t.startsWith("/telegram/"))&&e?"/telegram/show":"/show"}function m(e){if(e.startsWith("/telegram")){let t=e.slice(9);return""===t?"/":t}return e}function f(e,t){let[r,n]=(0,i.useState)(!1),[a,l]=(0,i.useState)(!1),[s,o]=(0,i.useState)(!1),[c,d]=(0,i.useState)(null),u=(0,i.useCallback)(()=>{e.current&&e.current.togglePlayPause()},[e]),h=(0,i.useCallback)(()=>{e.current&&e.current.toggleMute()},[e]),p=(0,i.useCallback)(()=>{e.current&&e.current.toggleFullscreen()},[e]);return(0,i.useEffect)(()=>{var t;d(null),n(!1);let r=null==(t=e.current)?void 0:t.getVideoElement();if(r)return void d(r);let i=setInterval(()=>{var t;let r=null==(t=e.current)?void 0:t.getVideoElement();r&&(d(r),clearInterval(i))},100),a=setTimeout(()=>{clearInterval(i)},1e4);return()=>{clearInterval(i),clearTimeout(a)}},[e,t]),(0,i.useEffect)(()=>{if(!c)return void n(!1);let e=()=>n(!0),t=()=>n(!1),r=()=>l(c.muted);return c.addEventListener("play",e),c.addEventListener("pause",t),c.addEventListener("volumechange",r),n(!c.paused),l(c.muted),()=>{c.removeEventListener("play",e),c.removeEventListener("pause",t),c.removeEventListener("volumechange",r)}},[c]),(0,i.useEffect)(()=>{let e=()=>{o(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[]),{isPlaying:r,isMuted:a,isFullscreen:s,handlePlayToggle:u,handleMuteToggle:h,handleFullscreenToggle:p}}var x=r(27036),v=r(31267);function b(e){let{currentVideoId:t,nextVideoId:r,showId:n}=e,[a,l]=(0,i.useState)("idle"),[s,o]=(0,i.useState)(),[c,d]=(0,i.useState)({}),u=(0,i.useRef)({}),h=(0,i.useRef)(null),p=(0,i.useRef)(new Set),m=(0,i.useRef)(!1),f=(0,i.useRef)(null),b=(0,i.useRef)(null),g=(0,i.useRef)(null),w=(0,i.useRef)(null);(0,i.useEffect)(()=>{u.current=c},[c]);let y=(0,i.useCallback)(()=>{g.current&&(g.current.remove(),g.current=null)},[]),j=(0,i.useCallback)(e=>{var t;if("undefined"==typeof document||!e||(null==(t=g.current)?void 0:t.href)===e)return;y();let r=document.createElement("link");r.rel="prefetch",r.as="fetch",r.href=e,r.crossOrigin="anonymous",document.head.appendChild(r),g.current=r},[y]),k=(0,i.useCallback)(()=>{null!==h.current&&(window.clearTimeout(h.current),h.current=null)},[]),N=(0,i.useCallback)(async function(e,t){let{updateStatus:r=!1,signal:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};console.log("[useVideoTokens] Fetching tokens for:",t);let n=Array.from(new Set(t.filter(e=>!!e)));if(!n.length)return r&&(l("idle"),o(void 0)),{};n.forEach(e=>p.current.add(e)),r&&(l(e=>"success"===e?e:"loading"),o(void 0));try{let t=await (0,x.l0)(e,n,{signal:i}),a={};t.forEach(e=>{let t=(0,x.mu)(e.streamToken);t&&(a[e.videoId]={videoId:e.videoId,streamToken:e.streamToken,expiresAt:new Date(e.expiresAt).getTime(),streamUrl:t})});let s=Object.keys(a),o=n.filter(e=>!a[e]);return d(e=>{let t={...e};return s.forEach(e=>{let r=a[e];r&&(t[e]=r)}),o.forEach(e=>{delete t[e]}),t}),(0,v.He)("refresh_success",{requestedIds:n,resolvedIds:s,missingIds:o}),r&&l("success"),a}catch(t){if(t instanceof Error&&("AbortError"===t.name||t.message.includes("abort")))return console.log("[useVideoTokens] Request aborted for:",n,"(this is expected during rapid episode switching)"),{};let e=t instanceof Error?t:Error(String(t));return(0,v.He)("refresh_error",{requestedIds:n,message:e.message}),r&&(o(e),l("error")),{}}},[]),E=(0,i.useCallback)(async()=>{let e=Array.from(p.current);if(!e.length){d({}),l("idle"),o(void 0);return}await N(n,e,{updateStatus:!0})},[N,n]),_=(0,i.useCallback)(e=>{k();let t=Array.from(p.current);if(!t.length)return;let r=t.map(t=>{var r;return null==(r=e[t])?void 0:r.expiresAt}).filter(e=>"number"==typeof e&&Number.isFinite(e));if(!r.length)return;let i=Math.max(15e3,Math.min(...r)-Date.now()-12e4);h.current=window.setTimeout(()=>{E()},i)},[k,E]),C=(0,i.useCallback)(()=>{if(!r)return Promise.resolve(!1);if(b.current)return b.current;let e=(async()=>{var e;let t=u.current[r];if((0,v.He)("prefetch_request",{videoId:r,hasToken:!!t}),m.current=!0,f.current=r,t)return j(t.streamUrl),!0;let i=null!=(e=(await N(n,[r],{updateStatus:!1}))[r])?e:u.current[r];return i?(j(i.streamUrl),!0):(m.current=!1,f.current=null,p.current.delete(r),!1)})().finally(()=>{b.current=null});return b.current=e,e},[j,N,r,n]);(0,i.useEffect)(()=>{w.current&&w.current.abort();let e=new AbortController;if(w.current=e,m.current=!1,f.current=null,k(),y(),!t){p.current=ne
1w Set,d({}),u.current={},l("idle"),o(void 0);return}return p.current.add(t),N(n,[t],{updateStatus:!0,signal:e.signal}),()=>{e.abort()}},[k,t,N,n,y]),(0,i.useEffect)(()=>{let e=f.current;e&&e!==r&&(p.current.delete(e),d(t=>{if(!t[e])return t;let r={...t};return delete r[e],r}),m.current=!1,f.current=null,y()),r||(m.current=!1,f.current=null,y())},[r,y]),(0,i.useEffect)(()=>{_(c)},[_,c]),(0,i.useEffect)(()=>{if(!m.current)return;let e=f.current;if(!e)return;let t=c[e];j(null==t?void 0:t.streamUrl)},[j,c]),(0,i.useEffect)(()=>()=>{k(),y(),w.current&&w.current.abort()},[k,y]);let S=t?c[t]:void 0,I=S&&S.videoId===t?S:void 0,P=r?c[r]:void 0;return{status:a,error:s,current:I,next:P&&P.videoId===r?P:void 0,refresh:E,prefetchNext:C}}var g=r(33336)},22080:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PaidLimitScreen:()=>p});var i,n,a=r(95155),l=r(12115),s=r(47650),o=r(15239),c=r(12834),d=r(87358);let u=null!=(i=d.env.NEXT_PUBLIC_IOS_STORE_URL)?i:"https://apps.apple.com/us/app/gamma-time/id6504227709",h=null!=(n=d.env.NEXT_PUBLIC_ANDROID_STORE_URL)?n:"https://play.google.com/store/apps/details?id=com.gamma.gamma.prod";function p(e){var t;let{isOpen:r,onClose:i,posterImage:n,episodeNumber:d}=e,p=(0,l.useCallback)(()=>{let e="undefined"==typeof navigator?u:/Android/i.test(navigator.userAgent)?h:u;window.open(e,"_blank","noopener,noreferrer")},[]),m=(0,l.useCallback)(()=>{i()},[i]);if(!r)return null;let f="for better experience Just switch to the app, log in with your current account and pick up right where you left off.",x=(0,a.jsxs)("div",{className:"hidden md:flex absolute inset-0 z-10 bg-black items-center",children:[(0,a.jsxs)("div",{className:"flex flex-col justify-center w-[45%] pl-[6%] pr-6",children:[(0,a.jsxs)("h2",{className:"text-white font-outfit font-bold leading-[1.1]",style:{fontSize:"clamp(32px, 3vw, 48px)"},children:["Ready For Next",(0,a.jsx)("br",{}),"Episode?"]}),(0,a.jsx)("p",{className:"mt-5 font-outfit text-white/60 leading-relaxed",style:{fontSize:"clamp(14px, 1.1vw, 17px)"},children:f}),(0,a.jsx)("div",{className:"mt-8 rounded-xl bg-white p-3 self-start",style:{width:150,height:150},children:(0,a.jsx)(c.h,{value:u,size:126,level:"M",bgColor:"#ffffff",fgColor:"#000000",title:"QR code to download Gamma Time app",imageSettings:{src:"/images/branding/gamma-app-icon.png",height:26,width:26,excavate:!0}})}),(0,a.jsx)("p",{className:"mt-2 font-outfit text-sm text-white/40",children:"Download on iOS or Android"})]}),(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center h-full py-6",children:(0,a.jsxs)("div",{className:"relative h-full",style:{aspectRatio:"390/844"},children:[(0,a.jsxs)("div",{className:"absolute overflow-hidden z-20",style:{top:"4.5%",left:"3.8%",right:"3.8%",bottom:"4.5%",borderRadius:"clamp(24px, 3vw, 40px)"},children:[n&&(0,a.jsx)("img",{src:n,alt:"App preview",className:"absolute inset-0 w-full h-full object-cover"}),(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 bg-gradient-to-b from-black/80 to-transparent px-4 pt-10 pb-8",children:(0,a.jsx)("p",{className:"text-white text-sm font-outfit",children:"Continue watching"})}),(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black via-black/80 to-transparent px-4 pb-6 pt-16",children:[d&&(0,a.jsxs)("p",{className:"text-white text-lg font-outfit text-center mb-3",children:["Eps.",d]}),(0,a.jsx)("div",{className:"h-1 bg-white/20 rounded-full mx-2",children:(0,a.jsx)("div",{className:"h-full w-[35%] bg-white rounded-full"})}),(0,a.jsxs)("div",{className:"flex justify-between mt-1.5 px-2",children:[(0,a.jsx)("span",{className:"text-white/60 text-xs font-outfit",children:"0:47"}),(0,a.jsx)("span",{className:"text-white/60 text-xs font-outfit",children:"-2:13"})]}),(0,a.jsx)("div",{className:"flex justify-center mt-3",children:(0,a.jsx)("div",{className:"w-[35%] h-1 rounded-full bg-white/50"})})]})]}),(0,a.jsx)(o.default,{src:"/images/iphone-frame.png",alt:"",fill:!0,className:"object-contain relative z-10 pointer-events-none",sizes:"400px","aria-hidden":"true"})]})})]}),v=(0,a.jsx)("div",{className:"md:hidden fixed inset-0 z-[70] flex items-center justify-center bg-black/70 px-6",onClick:m,role:"presentation",children:(0,a.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"w-full max-w-sm rounded-3xl p-8 text-center",style:{background:"linear-gradient(180deg, #1a1040 0%, #0d0a1a 100%)",border:"2px s
1olid rgba(100, 70, 200, 0.5)"},children:[(0,a.jsx)("h2",{className:"text-white font-outfit font-bold",style:{fontSize:"24px",lineHeight:"1.2"},children:"Ready For Next Episode?"}),(0,a.jsx)("p",{className:"mt-3 font-outfit text-white/70",style:{fontSize:"15px",lineHeight:"1.5"},children:f}),(0,a.jsx)("button",{type:"button",onClick:p,className:"mt-6 w-full rounded-2xl bg-white py-4 font-outfit font-semibold text-black text-base transition-transform hover:scale-[1.02] active:scale-[0.98]",children:"Continue in App"}),(0,a.jsx)("button",{type:"button",onClick:m,className:"mt-3 w-full rounded-2xl py-3 font-outfit text-sm text-white/60 transition-colors hover:text-white/80",children:"Not now"})]})}),b="undefined"!=typeof document?(0,s.createPortal)(v,null!=(t=document.getElementById("modal-root"))?t:document.body):v;return(0,a.jsxs)(a.Fragment,{children:[x,b]})}},23238:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EmailCaptureModal:()=>l});var i=r(95155),n=r(12115),a=r(47650);function l(e){var t;let{onSubmit:r,onCheckEmail:l,onSignIn:s,onClose:o,isLoading:c=!1}
1=e,[d,u]=(0,n.useState)(""),[h,p]=(0,n.useState)(""),[m,f]=(0,n.useState)(!1),[x,v]=(0,n.useState)("email"),[b,g]=(0,n.useState)(""),[w,y]=(0,n.useState)(!1),[j,k]=(0,n.useState)(!1),[N,E]=(0,n.useState)(!1),_=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(_.current&&!c){E(!0);let e=setTimeout(()=>E(!1),800);return()=>clearTimeout(e)}_.current=c},[c]);let C=(0,n.useCallback)(async e=>{if(e.preventDefault(),"password"===x){if(!b)return void p("Please enter your password");if(!s)return;p(""),k(!0);try{await s(d.trim(),b)}catch(e){p("Incorrect password. Please try again.")}finally{k(!1)}return}let t=d.trim();if(!t)return void p("Please enter your email address");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return void p("Please enter a valid email address");if(p(""),l){k(!0);try{if(await l(t))return void v("password")}catch(e){}finally{k(!1)}}r(t,m)},[x,d,b,m,r,l,s]),S=c||N||j,I=(0,i.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-end md:items-center justify-center animate-in fade-in duration-200",onClick:o,role:"presentation",children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-black/60 animate-in fade-in duration-200"}),(0,i.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"relative w-full md:max-w-[400px] rounded-t-[28px] md:rounded-[28px] overflow-hidden animate-in slide-in-from-bottom-4 duration-300 ease-out",children:[(0,i.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, rgba(111, 40, 255, 0.8) 0%, rgba(97, 22, 235, 0.36) 33%, rgba(39, 7, 110, 0.36) 100%)"}}),(0,i.jsx)("div",{className:"absolute inset-0",style:{background:"rgba(0, 0, 0, 0.16)",backdropFilter:"blur(50px)",WebkitBackdropFilter:"blur(50px)"}}),(0,i.jsxs)("div",{className:"relative z-10 px-6 pt-8 pb-8",children:[(0,i.jsx)("button",{type:"button",onClick:o,"aria-label":"Close",className:"absolute top-6 right-6 w-9 h-9 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition-colors",children:(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:(0,i.jsx)("path",{d:"M12 4L4 12M4 4l8 8",stroke:"white",strokeWidth:"2",strokeLinecap:"round"})})}),(0,i.jsx)("h1",{className:"text-white text-[28px] font-bold font-outfit text-center leading-tight",children:"Sign in"}),(0,i.jsx)("p",{className:"mt-2 text-white/70 text-[16px] font-outfit text-center",children:"password"===x?"Enter your password to sign in":"Please enter your email"}),(0,i.jsxs)("form",{onSubmit:C,className:"mt-7",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("input",{type:"email",value:d,onChange:e=>{u(e.target.value),h&&p("")},placeholder:"[email protected]",disabled:S||"password"===x,readOnly:"password"===x,className:"w-full px-5 py-4 rounded-2xl bg-white/[0.06] border border-white/20 text-white placeholder-white/40 font-outfit text-[16px] focus:outline-none focus:border-purple-400 disabled:opacity-60"}),"password"===x&&(0,i.jsxs)("div",{className:"mt-3 relative",children:[(0,i.jsx)("input",{type:w?"text":"password",value:b,onChange:e=>{g(e.target.value),h&&p("")},placeholder:"Password",autoFocus:!0,disabled:S,className:"w-full px-5 py-4 pr-14 rounded-2xl bg-white/[0.06] border border-white/20 text-white placeholder-white/40 font-outfit text-[16px] focus:outline-none focus:border-purple-400 disabled:opacity-60"}),(0,i.jsx)("button",{type:"button",onClick:()=>y(e=>!e),"aria-label":w?"Hide password":"Show password",className:"absolute right-4 top-1/2 -translate-y-1/2 text-white/80 hover:text-white",children:w?(0,i.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,i.jsx)("path",{d:"M12 5c5 0 9 5 9 7s-4 7-9 7-9-5-9-7 4-7 9-7Z",stroke:"currentColor",strokeWidth:"1.8"}),(0,i.jsx)("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"1.8"})]}):(0,i.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:[(0,i.jsx)("path",{d:"M12 5c5 0 9 5 9 7a11 11 0 0 1-1.8 2.8M6.3 6.4C3.9 7.9 3 11 3 12c0 2 4 7 9 7 1.6 0 3-.5 4.3-1.2",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M4 4l16 16",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round"})]})})]}),h&&(0,i.jsx)("p",{className:"mt-2 text-red-400 text-[13px] font-outfit",children:h})]}),(0,i.jsx)("button",{type:"submit",disabled:S,className:S?"mt-8 w-full py-4 flex items-center justify-center rounded-2xl bg-white/10 font-outfit":"mt-8 w-full py-4 flex items-center justify-center rounded-2xl bg-white font-outfit font-semibold text-[#090909] text-[16px] transition-transform hover:scale-[1.02] active:scale-[0.97]","aria-label":S?"Please wait":"password"===x?"Sign in":"Continue with Email",children:c||j?(0,i.jsxs)("svg",{className:"animate-spin",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,
1children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"white",strokeOpacity:"0.25",strokeWidth:"2.5"}),(0,i.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round"})]}):N?(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:(0,i.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}):"password"===x?"Sign in":"Continue with Email"})]}),"email"===x&&(0,i.jsxs)("label",{className:"mt-5 flex items-start gap-3 cursor-pointer select-none",children:[(0,i.jsx)("input",{type:"checkbox",checked:m,onChange:e=>f(e.target.checked),className:"sr-only peer"}),(0,i.jsx)("span",{className:"mt-0.5 shrink-0 w-6 h-6 rounded-[7px] border-2 border-white/40 flex items-center justify-center transition-colors peer-checked:bg-[#6528FF] peer-checked:border-[#6528FF]","aria-hidden":!0,children:m&&(0,i.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:(0,i.jsx)("path",{d:"M2.5 7.5l3 3 6-6.5",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,i.jsx)("span",{className:"text-white/85 text-[16px] font-outfit leading-snug",children:"I'd like to receive emails with updates and special offers from GammaTime"})]}),(0,i.jsxs)("p",{className:"mt-7 text-white/40 text-[13px] font-outfit text-center leading-relaxed",children:["By clicking continue, you agree and accept our"," ",(0,i.jsx)("a",{href:"/terms-of-service",className:"underline text-white/60",target:"_blank",children:"Terms and Conditions Use"})," ","and acknowledge that your information will be handled in accordance with our"," ",(0,i.jsx)("a",{href:"/privacy-policy",className:"underline text-white/60",target:"_blank",children:"Privacy Policy"})]})]})]})]});return"undefined"==typeof document?null:(0,a.createPortal)(I,null!=(t=document.getElementById("modal-root"))?t:document.body)}},27036:(e,t,r)=>{"use strict";let i;function n(e){return[{language:"en",label:"English",src:"".concat("https://".concat("demo-gammatime",".cloudflarestream.com"),"/").concat(e,"/caption/en"),isDefault:!0}]}r.d(t,{Rv:()=>eg,mu:()=>ev,Bc:()=>eu,l0:()=>ef,getStreamTokens:()=>eh});let a=[{id:"mock-starfall",title:"Starfall Overture",description:"A rookie idol trio navigates fame and hidden rivalries across twelve dazzling episodes.",coverImage:"/images/mock/starfall-cover.svg",coverPrompt:"Wide cinematic key art of a futuristic K-pop trio performing on a neon stage with shimmering spotlights",posterImage:"/images/mock/starfall-poster.svg",posterPrompt:"Vertical streaming poster of three young pop idols in glittering outfits posing under holographic lights with a cosmic city backdrop",category:"music",freeEpisodeCount:2,tags:["music","friendship"],viewCount:643100},{id:"mock-skyline",title:"Skyline Heist",description:"A daredevil hacker partners with a stoic detective to expose a megacity conspiracy.",coverImage:"/images/mock/skyline-cover.svg",coverPrompt:"Wide cinematic illustration of a neon cyberpunk skyline with a hacker and detective overlooking the city at dusk",posterImage:"/images/mock/skyline-poster.svg",posterPrompt:"Vertical thriller poster featuring a tech-savy hacker silhouetted against glowing skyscrapers beside a determined detective",category:"thriller",freeEpisodeCount:1,tags:["tech","mystery"],viewCount:125e4},{id:"mock-luminous",title:"Luminous Hearts",description:"Two chefs with clashing styles are forced to co-lead a pop-up kitchen marathon.",coverImage:"/images/mock/luminous-cover.svg",coverPrompt:"Warm cinematic artwork of two rival chefs plating dishes in a bustling night market kitchen",posterImage:"/images/mock/luminous-poster.svg",posterPrompt:"Vertical romantic drama poster with two chefs back-to-back holding utensils with floating spices and warm lighting",category:"romance",freeEpisodeCount:1,tags:["romance","food"],viewCount:89500}],l={featured:["mock-starfall","mock-skyline","mock-luminous"],romance:["mock-luminous","mock-starfall","mock-skyline"],thrillers:["mock-skyline","mock-starfall"]},s={"mock-starfall":[{id:"mock-starfall-ep1",title:"Debut Night",description:"The trio's first showcase erupts into chaos when a rival crew sabotages the set.",episodeNumber:1,duration:540,isFree:!0,coverImage:"/images/mock/starfall-ep1.svg",releaseDate:"2024-01-12T00:00:00.000Z",showId:"mock-starfall",videoId:"vid-starfall-01",streamToken:"tok-starfall-01",captions:n("tok-starfall-01")},{id:"mock-starfall-ep2",title:"Break the Chord",description:"An unexpected mentor trains the group in exchange for a mysterious favour.",episodeNumber:2,duration:560,isFree:!1,
1coverImage:"/images/mock/starfall-ep2.svg",releaseDate:"2024-01-19T00:00:00.000Z",showId:"mock-starfall",videoId:"vid-starfall-02",captions:[]}],"mock-skyline":[{id:"mock-skyline-ep1",title:"Signal Intercept",description:"A cryptic broadcast leads to an encrypted map hidden in the skyline billboards.",episodeNumber:1,duration:610,isFree:!0,coverImage:"/images/mock/skyline-ep1.svg",releaseDate:"2024-02-02T00:00:00.000Z",showId:"mock-skyline",videoId:"vid-skyline-01",streamToken:"tok-skyline-01",captions:n("tok-skyline-01")},{id:"mock-skyline-ep2",title:"Firewall",description:"The team infiltrates a corporate gala to plant a data siphon.",episodeNumber:2,duration:595,isFree:!1,coverImage:"/images/mock/skyline-ep2.svg",releaseDate:"2024-02-09T00:00:00.000Z",showId:"mock-skyline",videoId:"vid-skyline-02",captions:[]}],"mock-luminous":[{id:"mock-luminous-ep1",title:"First Flame",description:"A TV producer pits sworn culinary rivals together for a pop-up challenge.",episodeNumber:1,duration:520,isFree:!0,coverImage:"/images/mock/luminous-ep1.svg",releaseDate:"2024-03-05T00:00:00.000Z",showId:"mock-luminous",videoId:"vid-luminous-01",streamToken:"tok-luminous-01",captions:n("tok-luminous-01")},{id:"mock-luminous-ep2",title:"Recipe for Rivalry",description:"Sparks fly when a critic exposes the duo's complicated history.",episodeNumber:2,duration:545,isFree:!1,coverImage:"/images/mock/luminous-ep2.svg",releaseDate:"2024-03-12T00:00:00.000Z",showId:"mock-luminous",videoId:"vid-luminous-02",captions:[]}]},o="demo-gammatime",c={"vid-starfall-01":{videoId:"vid-starfall-01",streamToken:"tok-starfall-01",expiresAt:Date.now()+36e5,streamUrl:"https://".concat(o,".cloudflarestream.com/tok-starfall-01/manifest/video.m3u8")},"vid-skyline-01":{videoId:"vid-skyline-01",streamToken:"tok-skyline-01",expiresAt:Date.now()+27e5,streamUrl:"https://".concat(o,".cloudflarestream.com/tok-skyline-01/manifest/video.m3u8")},"vid-luminous-01":{videoId:"vid-luminous-01",streamToken:"tok-luminous-01",expiresAt:Date.now()+18e5,streamUrl:"https://".concat(o,".cloudflarestream.com/tok-luminous-01/manifest/video.m3u8")}},d=e=>({...e,tags:e.tags?[...e.tags]:void 0}),u=e=>({...e}),h=e=>e.map(e=>({...e})),p=e=>({...e,captions:h(e.captions)}),m=e=>{var t;return{...d(e),episodes:(null!=(t=s[e.id])?t:[]).map(p)}},f=Object.fromEntries(a.map(e=>[e.id,m(e)])),x=e=>{let t=a.find(t=>t.id===e);if(!t)throw Error("Unknown fixture show id: ".concat(e));return t},v={heroShows:[d(x("mock-starfall")),d(x("mock-skyline")),d(x("mock-luminous"))],rails:[{id:"featured",title:"Featured Shorts",position:1,isActive:!0},{id:"romance",title:"Romance Rush",position:2,isActive:!0},{id:"thrillers",title:"Edge of Seat",position:3,isActive:!0}].map(e=>{var t;return{slider:u(e),shows:(null!=(t=l[e.id])?t:[]).map(e=>{var t;return null!=(t=f[e])?t:m(x(e))}).map(e=>d(e))}})},b=f["mock-starfall"],g=f["mock-skyline"],w=f["mock-luminous"],y=(e,t)=>{var r;return(null!=(r=s[e])?r:[]).find(t)},j=y("mock-starfall",e=>e.isFree),k=y("mock-starfall",e=>!e.isFree),N=y("mock-skyline",e=>e.isFree),E=y("mock-luminous",e=>!e.isFree);if(!j||!k||!N)throw Error("Fixture episodes are missing required entries");let _=null!=E?E:k,C=e=>e?h(e.captions):[],S={E1:{show:b,episode:j,nextEpisode:k,streamUrl:c["vid-starfall-01"].streamUrl,nextStreamUrl:void 0,captions:C(j)},E2:{show:w,episode:_,nextEpisode:void 0,streamUrl:void 0,nextStreamUrl:void 0,captions:C(_)},E3:{show:g,episode:N,nextEpisode:void 0,streamUrl:void 0,nextStreamUrl:void 0,captions:C(N)},E4:{show:b,episode:j,nextEpisode:k,streamUrl:c["vid-starfall-01"].streamUrl,nextStreamUrl:void 0,captions:C(j)},E5:{show:g,episode:N,nextEpisode:j,streamUrl:c["vid-skyline-01"].streamUrl,nextStreamUrl:c["vid-starfall-01"].streamUrl,captions:C(N)},E6:{show:w,episode:_,nextEpisode:void 0,streamUrl:void 0,nextStreamUrl:void 0,captions:C(_)},E7:{show:b,episode:j,nextEpisode:N,streamUrl:c["vid-starfall-01"].streamUrl,nextStreamUrl:c["vid-skyline-01"].streamUrl,captions:C(j)},E8:{show:g,episode:N,nextEpisode:_,streamUrl:c["vid-skyline-01"].streamUrl,nextStreamUrl:void 0,captions:C(N)}},I=e=>({...d(e),episodes:e.episodes.map(p)}),P=e=>({show:I(e.show),episode:p(e.episode),nextEpisode:e.nextEpisode?p(e.nextEpisode):void 0,streamUrl:e.streamUrl,nextStreamUrl:e.nextStreamUrl,captions:h(e.captions)}),T={H1:{id:"H1",label:"Hero carousel populated",description:"Featured hero rail with three spotlight shows and populated rails.",data:v},H2:{id:"H2",label:"Hero empty fallback",description:"No hero shows returned; rails still render.",data:{heroShows:[],rails:v.rails}},H3:{id:"H3",label:"Rails populated",description:"Rails show three to four cards leveraging virtualization thresholds.",data:{heroShows:[v.heroShows[0]],rails:v.rails}},H4:{id:"H4",label:"Rails empty",description:"No curation available; surfaces inline empty state.",data:{heroShows:v.heroShows,rails:[]}},H5:{id:"H5",label:"Loading placeholder",description:"Represents the Suspense fallback before data resolves."},H6:{id:"H6",label:"Global error",description:"Trigger for `app/error.tsx` boundary on the home route."}
1,H7:{id:"H7",label:"Support teaser",description:"Support section fixture with default copy and CTAs.",data:v}},L={S1:{id:"S1",label:"Show detail default",description:"Loaded show with free pilot episode and follow-up locked content.",data:b},S2:{id:"S2",label:"All episodes locked",description:"Demonstrates paywall copy when only locked episodes are available.",data:{...d(w),episodes:(null!=(M=s["mock-luminous"])?M:[]).map(e=>({...e,isFree:!1}))}},S3:{id:"S3",label:"Episode loading",description:"Spinner state when episode list is fetching."},S4:{id:"S4",label:"Episode error",description:"Error banner when episode fetch rejects."},S5:{id:"S5",label:"Empty season",description:"No episodes returned for the show id.",data:{...d(g),episodes:[]}},S6:{id:"S6",label:"Season with next-up CTA",description:"Highlights next-up rail and deep linking behaviour.",data:b}},A={E1:{id:"E1",label:"Free episode streaming",description:"Stream token resolved for a free episode with locked next episode.",data:S.E1},E2:{id:"E2",label:"Locked episode",description:"Episode requires unlock; stream URL is unavailable.",data:S.E2},E3:{id:"E3",label:"Stream fallback",description:"Token lookup failed and surfaces the retry overlay.",data:S.E3},E4:{id:"E4",label:"Prefetch ready",description:"Prefetch triggered with a locked follow-up episode.",data:S.E4},E5:{id:"E5",label:"Next episode available",description:"Next free episode is queued with prefetch token.",data:S.E5},E6:{id:"E6",label:"Resume required",description:"Progress saved locally but stream token missing.",data:S.E6},E7:{id:"E7",label:"Sequential binge",description:"Current and next stream URLs resolved for binge controls.",data:S.E7},E8:{id:"E8",label:"Fallback with CTA",description:"Locked follow-up prompts the upsell overlay.",data:S.E8}},R=Object.values(T);Object.values(L),Object.values(A);let F={...c};R.filter(e=>e.data).map(e=>({id:e.id,label:e.label,data:(e=>({heroShows:e.heroShows.map(d),rails:e.rails.map(e=>({slider:u(e.slider),shows:e.shows.map(d)}))}))(e.data)})),["E1","E2","E3","E5"].map(e=>(function(e){let t=A[e];if(!t)throw Error("Unknown episode scene fixture: ".concat(e));return{...t,data:t.data?P(t.data):void 0}})(e)).filter(e=>e.data).map(e=>({id:e.id,label:e.label,context:P(e.data)})),["S1","S2","S5"].map(e=>(function(e){let t=L[e];if(!t)throw Error("Unknown show scene fixture: ".concat(e));return{...t,data:t.data?I(t.data):void 0}})(e)).filter(e=>e.data).map(e=>({id:e.id,label:e.label,detail:I(e.data)})),r(7e3);var M,z,D,U,B,W,O,V=r(85878),K=r(87358);D=null!=(z=K.env.BACKEND_BASE_URL)?z:"https://prod.api.gammatime.ai/api/v1";let H=function(e){if(!e)return"/api/proxy";let t=e.endsWith("/")&&e.length>1?e.slice(0,-1):e;return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")?t:"/".concat(t)}(null!=(B=null!=(U=K.env.GAMMATIME_PROXY_BASE_PATH)?U:K.env.NEXT_PUBLIC_GAMMATIME_PROXY_BASE_PATH)?B:"/api/proxy"),G=H.startsWith("http://")||H.startsWith("https://"),q="http://localhost:".concat(K.env.PORT||3001),X=["GAMMATIME_INTERNAL_SITE_URL","NEXT_RUNTIME_SITE_URL","NEXT_RUNTIME_INTERNAL_ORIGIN","NEXT_INTERNAL_SITE_URL","INTERNAL_SITE_URL"],Y=["NEXT_PUBLIC_SITE_URL","SITE_URL","NEXT_PUBLIC_APP_ORIGIN","APP_ORIGIN","GAMMATIME_SITE_URL","NEXT_PUBLIC_ROOT_URL","ROOT_URL","NEXT_PUBLIC_GAMMA_SITE_URL"],J=!!K.env.VITEST,$=[K.env.CI,"1"].some(e=>"string"==typeof e&&"true"===e.toLowerCase()),Z=null!=(O=null!=(W=K.env.GAMMATIME_USE_MOCK_DATA)?W:"")?O:J?"false":$?"true":"false",Q="true"===Z.toLowerCase();!Q||J||$||(console.warn("[api] WARNING: Mock data is enabled in a production-like environment!",{NODE_ENV:"production",SITE_URL:"https://app.gammatime.live",GAMMATIME_USE_MOCK_DATA:Z}),console.warn("[api] Mock data should only be used for development/testing. Set GAMMATIME_USE_MOCK_DATA=false for staging/production.")),new WeakMap;let ee=new WeakMap,et=null;function er(e){return e&&("object"!=typeof e||null===e||"function"!=typeof e.then)&&"function"==typeof e.get?e:null}function ei(){return void 0!==i?i:i=null}class en extends Error{constructor(e){super(e),this.name="ApiNotFoundError"}}
1class ea extends Error{constructor(e,t){super(e),this.status=t,this.name="ApiRequestError"}}function el(e){if(!e)return null;let t=e.trim();return t?/^https?:\/\//i.test(t)?t.replace(/\/$/,""):"https://".concat(t):null}function es(){let e=function(){for(let e of X){let t=el(K.env[e]);if(t)return t}return null}();if(e)return"".concat(e).concat(H);let t=function(){var e,t,r,i;if(null==(e=window.location)?void 0:e.origin)return window.location.origin;let n=ei();if(!n)return null;try{let e=er(n());if(!e)return null;let a=null!=(i=e.get("x-forwarded-host"))?i:e.get("host");if(!a)return null;let l=null==(t=a.split(",")[0])?void 0:t.trim();if(!l)return null;let s=e.get("x-forwarded-proto"),o=(null==s||null==(r=s.split(",")[0])?void 0:r.trim().toLowerCase())||(l.startsWith("localhost")?"http":"https");return"".concat(o,"://").concat(l)}catch(e){return null}}();if(t)return"".concat(t).concat(H);let r=function(){for(let e of Y){let t=el(K.env[e]);if(t)return t}let e=K.env.VERCEL_URL?el(K.env.VERCEL_URL.includes("://")?K.env.VERCEL_URL:"https://".concat(K.env.VERCEL_URL)):null;if(e)return e;let t=el(K.env.AMPLIFY_DOMAIN);return t||null}();return r?"".concat(r).concat(H):"".concat(q).concat(H)}async function eo(e){try{return await e.text()}catch(e){return"Failed to read response body: ".concat(e.message)}}async function ec(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,n=function(e){let t=e.startsWith("/")?e:"/".concat(e),r=function(){if(G)return H;let e=function(){let e=ei();if(!e)return null;try{let t=er(e());if(t&&"object"==typeof t)return t}catch(e){}return null}();if(e){let t=ee.get(e);return t||(t=es(),ee.set(e,t)),t}return et||(et=es()),et}();return"".concat(r).concat(t)}(e),a=new Headers(null!=(t=r.headers)?t:{});a.has("Accept")||a.set("Accept","application/json"),r.body&&!a.has("Content-Type")&&a.set("Content-Type","application/json");let l=await fetch(n,{...r,headers:a});if(404===l.status)throw new en("".concat(i," not found at ").concat(n));if(!l.ok){let e=await eo(l);throw new ea("[api] ".concat(i," failed: ").concat(l.status," ").concat(e),l.status)}if(204===l.status)return null;let s=await l.json();return void 0!==s.data&&null!==s.data?s.data:void 0!==s.result&&null!==s.result?s.result:void 0!==s.payload&&null!==s.payload?s.payload:void 0!==s.response&&null!==s.response?s.response:s}let ed={showEpisodes:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;return"/shows/".concat(e,"/episodes?platform=android&page=").concat(t,"&limit=").concat(r)},streamTokens:"/stream/get-video-tokens"};async function eu(e){var t,r;if(Q)return(null!=(t=s[e])?t:[]).map(e=>{var t;return{...e,captions:(null!=(t=e.captions)?t:[]).map(e=>({...e}))}});let i=[],n=1,a=1;do{let t=await ec(ed.showEpisodes(e,n),{method:"GET",cache:"no-store"},"fetch show ".concat(e," episodes page ").concat(n));if(!t)break;if(Array.isArray(t)){i.push(...t);break}if(t.data&&Array.isArray(t.data))i.push(...t.data),a=null!=(r=t.totalPages)?r:1,n++;else{console.warn("[api] Unexpected episodes response format for show ".concat(e,":"),t);break}}while(n<=a);return i.map(t=>(function(e,t){var r,i,n,a,l,s,o,c,d,u,h,p,m,f,x,v,b,g,w,y,j,k,N,E,_,C,S,I,P,T,L,A,R,F,M,z,D,U,B;let W="episode"in e&&e.episode?e.episode:e,O=null!=(n=null!=(i=null!=(r=W.duration)?r:W.durationSeconds)?i:W.duration_seconds)?n:0,V=null!=(l=null!=(a=W.isFree)?a:W.is_free)&&l||null!=(o=null!=(s=e.isUnlocked)?s:e.is_unlocked)&&o,K=[...null!=(c=W.captions)?c:[],...null!=(d=W.captionTracks)?d:[],...null!=(u=W.caption_tracks)?u:[],...null!=(h=W.textTracks)?h:[],...null!=(p=W.text_tracks)?p:[],...null!=(m=W.subtitles)?m:[],...null!=(f=e.captions)?f:[],...null!=(x=e.captionTracks)?x:[],...null!=(v=e.caption_tracks)?v:[],...null!=(b=e.textTracks)?b:[],...null!=(g=e.text_tracks)?g:[],...null!=(w=e.subtitles)?w:[]],H=new Set,G=K.map(e=>(function(e){var t,r,i,n,a,l,s,o,c,d,u,h,p,m,f,x,v;if(!e)return null;let b=null!=(l=null!=(a=null!=(n=null!=(i=null!=(r=null!=(t=e.languageTag)?t:e.languageCode)?r:e.language_code)?i:e.language)?n:e.lang)?a:e.locale)?l:null,g=b?b.trim().toLowerCase():"und",w=null!=(c=null!=(o=null!=(s=e.src)?s:e.url)?o:e.href)?c:e.path;if(!w)return null;let y=w.trim();if(!y)return null;let j=null!=(p=null!=(h=null!=(u=null!=(d=e.label)?d:e.displayLabel)?u:e.name)?h:e.title)?p:b,k=j?j.trim():g,N=null!=(v=null!=(x=null!=(f=null!=(m=e.isDefault)?m:e.default)?f:e.defaultTrack)?x:e.default_track)&&v,E={language:g,label:k&&k.length>0?k:g,src:y};return N&&(E.isDefault=!0),E})(e)).filter(e=>!!e).filter(e=>{let t="".concat(e.language,"|").concat(e.src);return!H.has(t)&&(H.add(t),!0)}),q=null!=(y=W.streamToken)?y:W.stream_token,X=G.length>0?G:q?eg(q,["en"]):[],Y=null!=(I=null!=(S=null!=(C=null!=(_=null!=(E=null!=(N=null!=(k=null!=(j=W.coverImage)?j:W.cover_image)?k:W.CoverImage)?N:W.thumbnail)?E:W.thumbnailImage)?_:W.thumbnail_image)?C:W.posterImage)?S:W.poster_image)?I:"";Y||console.warn("[api] Episode ".concat(W.id," for show ").concat(t," has no thumbnail/cover image"));let J=[W.videoId,W.video_id,W.VideoId,W.video_Id,W.videoid,W.videoID,e.videoId,e.video_id,e.VideoId,String(null!=(P=W.id)?P:"")].find(e=>"string"==typeof e&&e.trim().length>0);return{id:String(null!=(T=W.id)?T:""),showId:t,title:null!=(L=W.title)?L:"Untitled Episode",description:null!=(A=W.description)?A:"",episodeNumber:null!=(F=null!=(R=W.episodeNumber)?R:W.episode_number)?F:0,duration:O,isFree:!!V,isTrailer:null!=(z=null!=(M=W.isTrailer)?M:W.is_trailer)&&z,coverImage:Y,releaseDate:null!=(U=null!=(D=W.releaseDate)?D:W.release_date)?U:new Date(0).toISOString(),videoId:J,captions:X,streamToken:null!=(B=W.streamToken)?B:W.stream_token}})(t,e)).sort((e,t)=>
1e.episodeNumber-t.episodeNumber)}async function eh(e,t,r){if(!t.length)return[];if(Q){let e=t.map(e=>F[e]).filter(e=>!!e).map(e=>({videoId:e.videoId,streamToken:e.streamToken,expiresAt:new Date(e.expiresAt).toISOString()}));if(e.length===t.length)return e;let r=new Date(Date.now()+9e5).toISOString();return t.map(e=>{var t,i;return{videoId:e,streamToken:null!=(i=null==(t=F[e])?void 0:t.streamToken)?i:"mock-stream-token-".concat(e),expiresAt:F[e]?new Date(F[e].expiresAt).toISOString():r}})}let i=await ep(e,t,r);return 0===i.length&&t.length>0&&(console.log("[api] getStreamTokens: token endpoint returned empty, falling back to episodes endpoint"),i=await em(e,t,r)),i}async function ep(e,t,r){try{let i=await ec(ed.streamTokens,{method:"POST",cache:"no-store",body:JSON.stringify({showId:e,videoIds:t}),signal:null==r?void 0:r.signal},"fetch stream tokens"),n=null==i?void 0:i.tokens;return(Array.isArray(n)?n:n&&"object"==typeof n&&(n.videoId||n.video_id)?[n]:i&&(i.videoId||i.video_id)?[i]:[]).filter(e=>{var t,r;return(null!=(t=e.videoId)?t:e.video_id)&&
1(null!=(r=e.streamToken)?r:e.stream_token)}).map(e=>{var t,r,i,n,a,l;return{videoId:null!=(r=null!=(t=e.videoId)?t:e.video_id)?r:"",streamToken:null!=(n=null!=(i=e.streamToken)?i:e.stream_token)?n:"",expiresAt:null!=(l=null!=(a=e.expiresAt)?a:e.expires_at)?l:new Date(0).toISOString()}})}catch(e){return console.warn("[api] fetchTokensFromEndpoint failed:",e),[]}}async function em(e,t,r){try{let l=await ec(ed.showEpisodes(e),{method:"GET",cache:"no-store",signal:null==r?void 0:r.signal},"fetch episodes for tokens (show ".concat(e,")"));if(!l||!Array.isArray(l))return[];let s=new Date(Date.now()+36e5).toISOString(),o=new Set(t),c=[];for(let e of l){var i,n,a;let t="episode"in e&&e.episode?e.episode:e,r=null!=(n=null!=(i=t.videoId)?i:t.video_id)?n:String(t.id),l=null!=(a=t.streamToken)?a:t.stream_token;o.has(r)&&l&&c.push({videoId:r,streamToken:l,expiresAt:s})}return console.log("[api] fetchTokensFromEpisodes: found ".concat(c.length,"/").concat(t.length," tokens")),c}catch(e){return console.warn("[api] fetchTokensFromEpisodes failed:",e),[]}}async function ef(e,t,r){return eh(e,t,r)}function ex(){let e="https://customer-gl5pzevn531lvsl3.cloudflarestream.com";if(e)return e;let t=(0,V._j)();if(t)return"https://".concat(t,".cloudflarestream.com")}function ev(e){if(e){var t=ex();return e&&t?"".concat(t,"/").concat(e,"/manifest/video.m3u8"):void 0}}let eb=[{language:"en",label:"English"},{language:"es",label:"Spanish"},{language:"fr",label:"French"},{language:"de",label:"German"},{language:"pt",label:"Portuguese"},{language:"zh",label:"Chinese"},{language:"ja",label:"Japanese"},{language:"ko",label:"Korean"}];function eg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["en"],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en";if(!e||0===t.length)return[];let i=[];for(let a of t){var n;let t=function(e,t){if(e&&t){var r=ex();return e&&r&&t?"".concat(r,"/").concat(e,"/caption/").concat(t):void 0}}(e,a);if(!t)continue;let l=eb.find(e=>e.language===a),s=null!=(n=null==l?void 0:l.label)?n:a.toUpperCase(),o={language:a,label:s,src:t};a===r&&(o.isDefault=!0),i.push(o)}return i}},28182:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Button:()=>o});var i=r(95155),n=r(12115),a=r(41429);let l={primary:"bg-button-primary text-button-primary-text shadow-lg hover:bg-button-primary/95 active:bg-button-primary/90",secondary:"bg-secondary text-secondary-content shadow-soft hover:bg-secondary/90",ghost:"bg-transparent text-base-content hover:bg-base-200/80",outline:"border-2 border-white bg-transparent text-white hover:bg-white/10 active:bg-white/20",link:"bg-transparent text-primary underline-offset-4 hover:underline"},s={sm:"h-11 px-4 text-sm",md:"h-11 px-6 text-sm",lg:"h-[52px] px-8 text-base font-semibold"},o=(0,n.forwardRef)((e,t)=>{let{className:r,children:n,variant:o="primary",size:c="md",loading:d=!1,disabled:u,...h}=e;return(0,i.jsxs)("button",{ref:t,className:(0,a.cx)("inline-flex items-center justify-center gap-2 rounded-full font-medium transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/70",l[o],s[c],u||d?"opacity-60 cursor-not-allowed":"",r),disabled:u||d,"aria-busy":d||void 0,...h,children:[d&&(0,i.jsx)("span",{className:"loading loading-spinner loading-xs","aria-hidden":"true"}),n]})});o.displayName="Button"},29564:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Top10ShowCard:()=>u});var i=r(95155),n=r(15239),a=r(52619),l=r.n(a),s=r(86814),o=r(21512),c=r(78826),d=r(35796);function u(e){let{show:t,loading:r=!1,rank:a,basePath:u}=e,h=(0,o.Rq)();if(r||!t)return(0,i.jsxs)("div",{className:"relative flex items-end",children:[(0,i.jsx)("span",{className:"top10-number select-none",children:a}),(0,i.jsx)("div",{className:"relative z-10 w-[180px] overflow-hidden rounded-[6px]",children:(0,i.jsx)(s.EA,{className:"aspect-[218/285] w-[180px] rounded-[6px]"})})]});let p=t.isExclusive||t.creatorKnownFor&&t.creatorName;return(0,i.jsxs)("div",{className:"relative flex items-end",children:[(0,i.jsx)("span",{className:"top10-number select-none","aria-hidden":"true",children:a}),(0,i.jsx)(l(),{href:"".concat(null!=u?u:h,"/").concat(t.id),className:"group relative z-10 block w-[180px]","aria-label":"#".concat(a," - View ").concat(t.title),title:t.title,"data-testid":"top10-show-card",children:(0,i.jsx)("div",{className:"aspect-[218/285] w-[180px] overflow-hidden rounded-[6px] border border-episode-card-border shadow-lg transition-all duration-300 hover:scale-[1.03] hover:shadow-xl",children:(0,i.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[t.posterPrompt?(0,i.jsx)(s.Mr,{prompt:t.posterPrompt,fallbackSrc:t.posterImage,alt:t.title,fill:!0,className:"object-cover",sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 25vw, 20vw",options:{width:768,height:1024,model:"flux"}}):(0,i.jsx)(n.default,{src:t.posterImage,alt:t.title,fill:!0,className:"object-cover",sizes:"(max-width: 768px) 50vw, (max-width: 1200px) 25vw, 20vw"}),p&&(0,i.jsx)(i.Fragment,{children:t.creatorKnownFor&&t.creatorName?(0,i.jsx)(c.M,{knownFor:t.creatorKnownFor,creatorName:t.creatorName,position:"top-left"}):t.isExclusive?(0,i.jsx)(d.I,{position:"top-left"}):null})]})})})]})}},30883:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BottomAppBanner:()=>c});var i=r(95155),n=r(12115),a=r(15239),l=r(20063),s=r(87358);function o(){return(0,i.jsx)(a.default,{src:"/images/branding/gamma-app-icon.png",alt:"GammaTime",width:32,height:32,className:"flex-shrink-0 rounded-lg",priority:!0})}function c(e){var t;let{title:r="Download the app",ctaText:a="Get the App",ctaHref:c,onDismiss:d,dismissText:u="Not now"}=e,h=(0,l.usePathname)(),p=c||s.env.NEXT_PUBLIC_APP_STORE_URL||"#",m=null!=(t=null==h?void 0:h.startsWith("/telegram/"))&&t,f="/login"===h,x="/profile"===h,v=(0,n.useCallback)(()=>{"#"!==p&&(window.location.href=p)},[p]),b=(0,n.useCallback)(()=>{d&&d()},[d]);return m||f||x?null:(0,i.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-50 lg:hidden",role:"complementary","aria-label":"App download banner",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 border-t border-white/10 px-4 py-2.5 backdrop-blur-sm",style:{backgroundColor:"#15002A",paddingBottom:"calc(0.
1625rem + env(safe-area-inset-bottom))"},children:[(0,i.jsx)(o,{}),(0,i.jsx)("span",{className:"flex-1 min-w-0 truncate text-white font-semibold text-sm",children:r}),(0,i.jsx)("button",{type:"button",onClick:v,className:"flex-shrink-0 rounded-full bg-white px-4 py-1.5 text-sm font-semibold text-black transition-transform hover:scale-[1.02] active:scale-[0.98]","aria-label":"Download the app",children:a})]}),d&&(0,i.jsx)("button",{type:"button",onClick:b,className:"mt-2 w-full px-4 py-2 text-sm font-medium text-gray-400 transition-colors hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500 active:text-gray-300","aria-label":"Dismiss banner",children:u})]})}},32080:(e,t,r)=>{"use strict";r.d(t,{AllEpisodesDrawer:()=>a});var i=r(95155),n=r(12115);function a(e){let{isOpen:t,onClose:r,episodes:a,originalEpisodes:l,showTitle:s,currentEpisodeId:o,onEpisodeSelect:c}=e,d=(0,n.useRef)(null);if((0,n.useEffect)(()=>{if(t&&d.current){let e=d.current.querySelector("[data-current]");e&&e.scrollIntoView({block:"center",behavior:"smooth"})}},[t]),!t)return null;let u=[...a].sort((e,t)=>e.episodeNumber-t.episodeNumber);return(0,i.jsxs)("div",{className:"fixed inset-0 z-[65] flex flex-col",children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-black/60",onClick:r}),(0,i.jsxs)("div",{className:"mt-auto relative z-10 max-h-[70vh] flex flex-col rounded-t-2xl overflow-hidden",style:{background:"linear-gradient(180deg, #1a1040 0%, #0d0a1a 100%)"},children:[(0,i.jsx)("div",{className:"flex justify-center py-2",children:(0,i.jsx)("div",{className:"w-10 h-1 rounded-full bg-white/20"})}),(0,i.jsxs)("div",{className:"flex items-center justify-between px-5 pb-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h2",{className:"text-white font-outfit font-semibold text-base truncate max-w-[200px]",children:s}),(0,i.jsxs)("span",{className:"text-white/50 font-outfit text-xs",children:["Episodes 1 â ",u.length]})]}),(0,i.jsx)("button",{type:"button",onClick:r,className:"w-8 h-8 flex items-center justify-center rounded-full bg-white/10","aria-label":"Close",children:(0,i.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2.5",children:(0,i.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),(0,i.jsx)("div",{className:"h-px bg-white/10 mx-4"}),(0,i.jsx)("div",{ref:d,className:"flex-1 overflow-y-auto px-4 py-3",children:(0,i.jsx)("div",{className:"grid grid-cols-6 gap-1.5",children:u.map(e=>{let t=e.id===o,n=!e.isFree,a=null==l?void 0:l.find(t=>t.id===e.id),s=a?!a.isFree:!e.isFree;return(0,i.jsxs)("button",{type:"button","data-current":t?"":void 0,onClick:()=>{c(e.id),r()},className:"relative aspect-square rounded-md flex items-center justify-center text-[14px] font-outfit font-medium transition-all ".concat(t?"bg-brand-purple text-white ring-2 ring-brand-purple ring-offset-1 ring-offset-transparent":"bg-[#2a2a3a] text-white/70 hover:bg-[#353548]"),children:[e.episodeNumber,n&&!t&&(0,i.jsx)("span",{className:"absolute top-0.5 right-0.5",children:(0,i.jsx)("svg",{width:"9",height:"9",viewBox:"0 0 24 24",fill:"#E91E63",children:(0,i.jsx)("path",{d:"M12 1a5 5 0 0 0-5 5v2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2h-2V6a5 5 0 0 0-5-5zm-3 5a3 3 0 1 1 6 0v2H9V6z"})})}),s&&!n&&!t&&(0,i.jsx)("span",{className:"absolute top-0.5 right-0.5 px-0.5 rounded text-[5px] font-bold leading-none text-white bg-brand-purple/80",children:"VIP"})]},e.id)})})})]})]})}},32813:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Header:()=>c});var i=r(95155),n=r(12115),a=r(20063),l=r(56364),s=r(89599),o=r(4795);function c(){var e,t,c,d,u,h,p,m;let f=(0,a.usePathname)(),x=(0,a.useRouter)(),{user:v,profile:b,isAnonymous:g,signOut:w,getServerToken:y,signInWithGoogle:j,signInWithApple:k,signInWithFacebook:N}
1=(0,s.A)(),[E,_]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!1),[I,P]=(0,n.useState)(!1);(0,n.useEffect)(()=>{!v||g||I||(async()=>{try{let e=await y();if(!e)return;let{fetchWalletBalance:t}=await r.e(4047).then(r.bind(r,64047));(await t(e)).hasActiveSubscription&&P(!0)}catch(e){}})()},[v,g,y,I]);let T="/"===f,L=f.startsWith("/show/"),A="/login"===f;return((0,n.useEffect)(()=>{if(!T)return;let e=()=>{S(window.scrollY>50)};return window.addEventListener("scroll",e),e(),()=>window.removeEventListener("scroll",e)},[T]),T)?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("header",{className:"fixed top-0 z-40 w-full transition-all duration-300 ".concat(C?"bg-black/60 backdrop-blur-md border-b border-white/10":"bg-transparent"),children:(0,i.jsxs)("div",{className:"mx-auto flex h-16 w-full max-w-[1920px] items-center justify-between px-4 md:px-[60px]",children:[(0,i.jsx)("button",{type:"button",onClick:()=>_(!0),"aria-label":"Open menu",className:"flex h-10 w-10 items-center justify-center md:hidden",children:(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,i.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,i.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,i.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),(0,i.jsx)("div",{className:"flex items-center gap-6",children:(0,i.jsx)(o.Logo,{size:"lg",asLink:!0,className:"text-white"})}),(0,i.jsxs)("div",{className:"flex items-center gap-4",children:[(0,i.jsx)(l.u4,{}),!A&&(0,i.jsx)(i.Fragment,{children:v&&!g?(0,i.jsx)(l.tN,{user:{displayName:null!=(e=null==b?void 0:b.displayName)?e:v.displayName,email:null!=(t=null==b?void 0:b.email)?t:v.email,photoURL:null!=(c=null==b?void 0:b.profileImage)?c:v.photoURL,uid:v.uid},isPaying:(null==b?void 0:b.isPaying)||!!(null==b?void 0:b.subscriptionProductId)||I,onSignOut:w}):(0,i.jsx)(l.tN,{user:{displayName:"Guest",email:null,photoURL:null,uid:null!=(d=null==v?void 0:v.uid)?d:"anonymous"},isGuest:!0,onSignOut:w,onSignIn:()=>x.push("/login"),onSignInWithGoogle:j,onSignInWithApple:k,onSignInWithFacebook:N})})]})]})}),(0,i.jsx)(l.BQ,{isOpen:E,onClose:()=>_(!1)})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("header",{className:L?"sticky top-0 z-50 bg-base-100/95 backdrop-blur-md border-b border-base-300/30":"sticky top-0 z-50 border-b border-base-300/50 bg-base-100/80 backdrop-blur-md",children:(0,i.jsxs)("div",{className:"mx-auto flex h-16 w-full max-w-[1920px] items-center justify-between px-4 md:px-[60px]",children:[(0,i.jsx)("button",{type:"button",onClick:()=>_(!0),"aria-label":"Open menu",className:"flex h-10 w-10 items-center justify-center md:hidden",children:(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,i.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),(0,i.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),(0,i.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),(0,i.jsx)("div",{className:"flex items-center gap-6",children:(0,i.jsx)(o.Logo,{size:"lg",asLink:!0,className:"text-white"})}),(0,i.jsxs)("div",{className:"flex items-center gap-4",children:[(0,i.jsx)(l.u4,{}),!A&&(0,i.jsx)(i.Fragment,{children:v&&!g?(0,i.jsx)(l.tN,{user:{displayName:null!=(u=null==b?void 0:b.displayName)?u:v.displayName,email:null!=(h=null==b?void 0:b.email)?h:v.email,photoURL:null!=(p=null==b?void 0:b.profileImage)?p:v.photoURL,uid:v.uid},isPaying:(null==b?void 0:b.isPaying)||!!(null==b?void 0:b.subscriptionProductId),onSignOut:w}):(0,i.jsx)(l.tN,{user:{displayName:"Guest",email:null,photoURL:null,uid:null!=(m=null==v?void 0:v.uid)?m:"anonymous"},isGuest:!0,onSignOut:w,onSignIn:()=>x.push("/login")})})]})]})}),(0,i.jsx)(l.BQ,{isOpen:E,onClose:()=>_(!1)})]})}},32921:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShareButtons:()=>o});var i=r(95155),n=r(12115),a=r(86814),l=r(41429);async function s(e){let t=document.createElement("textarea");t.value=e,t.setAttribute("readonly","readonly"),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select();let r=document.execCommand("copy");if(document.body.removeChild(t),!r)throw Error("Clipboard copy failed")}function o(e){let{title:t,url:r,text:o,className:c,analyticsContext:d}=e,{showToast:u}
1=(0,a.dj)(),[h,p]=(0,n.useState)(!1),[m,f]=(0,n.useState)(!1);(0,n.useEffect)(()=>{"undefined"!=typeof navigator&&(p("function"==typeof navigator.share),f(void 0!==navigator.clipboard&&"function"==typeof navigator.clipboard.writeText))},[]);let x=(0,n.useMemo)(()=>({title:t,text:null!=o?o:t,url:r}),[o,t,r]),v=(0,n.useCallback)(async()=>{if("undefined"==typeof navigator)return void u({variant:"error",title:"Copy failed",description:"Clipboard is unavailable in this environment."});try{m?await navigator.clipboard.writeText(r):await s(r),u({variant:"success",title:"Link copied",description:"The page link is ready to share.",duration:4e3})}catch(e){u({variant:"error",title:"Copy failed",description:"We couldn't copy the link. Please try manually.",duration:6e3})}},[u,m,r]),b=(0,n.useCallback)(async()=>{if("undefined"==typeof navigator||"function"!=typeof navigator.share)return void await v();try{if(!("function"!=typeof navigator.canShare||navigator.canShare(x)))throw Error("Share data unsupported");await navigator.share(x)}catch(e){if("object"==typeof e&&null!==e&&"name"in e&&"AbortError"===e.name)return;u({variant:"warning",title:"Sharing unavailable",description:"We couldn't open the share sheet. The link was copied instead.",duration:6e3}),await v()}},[v,x,u]),g=h?b:v;return(0,i.jsxs)("div",{className:(0,l.cx)("flex flex-wrap items-center gap-3",c),children:[(0,i.jsx)(a.$n,{onClick:g,size:"sm",children:h?"Share":"Copy link"}),h&&(0,i.jsx)(a.$n,{variant:"outline",size:"sm",onClick:v,children:"Copy link"})]})}},33336:(e,t,r)=>{"use strict";r.d(t,{l:()=>s});var i=r(12115);let n="gamma.watchHistory";function a(){let e=window.localStorage.getItem(n);if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}}function l(e){let t=e.slice(0,50);window.localStorage.setItem(n,JSON.stringify(t))}function s(){let[e,t]=(0,i.useState)([]);(0,i.useEffect)(()=>{t(a());let e=e=>{e.key===n&&t(a())};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[]);let r=(0,i.useCallback)(e=>{let r=a().filter(t=>t.episodeId!==e.episodeId),i=[{...e,lastWatchedAt:Date.now()},...r];l(i),t(i)},[]);return{items:e,addOrUpdateItem:r,removeItem:(0,i.useCallback)(e=>{let r=a().filter(t=>t.episodeId!==e);l(r),t(r)},[]),clearHistory:(0,i.useCallback)(()=>{window.localStorage.removeItem(n),t([])},[])}}},35796:(e,t,r)=>{"use strict";r.d(t,{I:()=>a});var i=r(95155);let n={"top-left":"top-3 left-3","top-right":"top-3 right-3","top-center":"top-3 left-1/2 -translate-x-1/2"};function a(e){let{position:t="top-left",className:r=""}=e;return(0,i.jsx)("div",{className:"absolute z-10 ".concat(n[t]," ").concat(r),"aria-label":"Exclusive content",children:(0,i.jsx)("div",{className:"rounded-lg bg-gradient-to-r from-secondary to-accent px-3 py-1.5 shadow-md",children:(0,i.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-white",children:"Exclusive Content"})})})}},37943:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Tooltip:()=>s});var i=r(95155),n=r(12115),a=r(41429);let l={top:"left-1/2 -translate-x-1/2 bottom-full mb-2",bottom:"left-1/2 -translate-x-1/2 top-full mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};function s(e){let{content:t,children:r,position:s="top"}=e,o=(0,n.useId)(),[c,d]=(0,n.useState)(!1),u=(0,n.isValidElement)(r)?r:(0,i.jsx)("span",{tabIndex:0,className:"inline-flex",children:r}),h=[u.props["aria-describedby"],o].filter(e=>"string"==typeof e&&e.length>0).join(" ")||void 0,p=(0,n.cloneElement)(u,{"aria-describedby":h,onFocus:(0,a.mK)(u.props.onFocus,()=>d(!0)),onBlur:(0,a.mK)(u.props.onBlur,()=>d(!1)),onMouseEnter:(0,a.mK)(u.props.onMouseEnter,()=>d(!0)),onMouseLeave:(0,a.mK)(u.props.onMouseLeave,()=>d(!1)),onKeyDown:(0,a.mK)(u.props.onKeyDown,e=>{"Escape"===e.key&&d(!1)})});return(0,i.jsxs)("span",{className:"relative inline-flex max-w-full",children:[p,(0,i.jsx)("span",{role:"tooltip",id:o,className:(0,a.cx)("pointer-events-none absolute z-50 max-w-xs rounded-xl bg-base-100 px-3 py-2 text-xs font-medium text-base-content shadow-soft transition-all duration-150",c?"opacity-100 translate-y-0":"opacity-0 translate-y-1",l[s]),children:t})]})}},38038:(e,t,r)=>{"use strict";r.d(t,{l:()=>n});var i=r(95155);function n(e){let{viewCount:t,className:r=""}=e;if(!t||t<=0)return null;let n=function(e){if(e>=1e6){let t=e/1e6;return t%1==0?"".concat(t,"M"):"".concat(t.toFixed(1),"M")}if(e>=1e3){let t=e/1e3;return t%1==0?"".concat(t,"K"):"".concat(t.toFixed(1),"K")}return String(e)}(t);return(0,i.jsx)("div",{className:"absolute top-3 right-3 z-10 flex h-8 items-center justify-center gap-1 rounded-full px-2 ".concat(r),style:{background:"rgba(0, 0, 0, 0.32)",backdropFilter:"blur(10px)",WebkitBackdropFilter:"blur(10px)",minWidth:"55px"}
1,"aria-label":"".concat(t.toLocaleString()," views"),children:(0,i.jsx)("span",{className:"text-center font-outfit text-[13px] font-normal tracking-[0.1px] text-white",style:{fontFeatureSettings:"'rvrn' on, 'liga' off"},children:n})})}},40327:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HashFocusHandler:()=>u,HeaderNav:()=>d});var i=r(95155),n=r(52619),a=r.n(n),l=r(20063),s=r(12115);let o=[{label:"Shows",hash:"shows"},{label:"Episodes",hash:"episodes"}];function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;window.requestAnimationFrame(()=>{let r=document.getElementById(e);if(!r||!(r instanceof HTMLElement)||"function"!=typeof r.focus){t<20&&window.setTimeout(()=>c(e,t+1),50);return}let i=r.getAttribute("tabindex");if(null===i&&r.setAttribute("tabindex","-1"),r.focus({preventScroll:!0}),document.activeElement!==r){null===i&&r.removeAttribute("tabindex"),t<20&&window.setTimeout(()=>c(e,t+1),50);return}r.scrollIntoView({behavior:"smooth",block:"start"}),null===i&&r.removeAttribute("tabindex")})}function d(){let e=(0,l.usePathname)(),t=(0,l.useRouter)(),[r,n]=(0,s.useState)("");(0,s.useEffect)(()=>{let e=()=>{n(window.location.hash.slice(1))};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]);let d=(0,s.useCallback)((r,i)=>{r.preventDefault();let n="#".concat(i);if("/"!==e){t.push("/".concat(n),{scroll:!1}),c(i);return}if(window.location.hash!==n){window.location.hash=n,c(i);return}c(i)},[e,t]);return(0,i.jsx)("nav",{className:"flex items-center gap-8",children:o.map(e=>{let t=r===e.hash;return(0,i.jsx)(a(),{href:{pathname:"/",hash:e.hash},className:"text-sm font-medium transition-colors ".concat(t?"text-base-content":"text-base-content/60 hover:text-base-content/90"),onClick:t=>d(t,e.hash),children:e.label},e.hash)})})}function u(){let e=(0,l.usePathname)();return(0,s.useEffect)(()=>{let e=()=>{let{hash:e}=window.location;if(!e.startsWith("#"))return;let t=e.slice(1);o.some(e=>e.hash===t)&&c(t)};return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[e]),null}},41301:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowLogoOverlay:()=>l});var i=r(95155),n=r(15239),a=r(41429);function l(e){let{show:t,className:r}=e;return(0,i.jsxs)("div",{className:(0,a.cx)("flex items-center gap-3 rounded-lg bg-black/60 px-4 py-3 backdrop-blur-md shadow-xl",r),children:[(0,i.jsx)("div",{className:"relative flex-shrink-0",style:{width:210,height:64,aspectRatio:"264/80"},children:(0,i.jsx)(n.default,{src:"/gamma-logo-new.png",alt:"GammaTime",fill:!0,className:"object-contain",priority:!0})}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-xs font-medium text-white/60",children:"Now Playing"}),(0,i.jsx)("h2",{className:"text-sm font-bold text-white line-clamp-1",children:t.title})]})]})}},43188:(e,t,r)=>{"use strict";r.r(t),r.d(t,{StreamPrefetch:()=>n});var i=r(12115);function n(e){let{url:t}=e;return(0,i.useEffect)(()=>{if(!t)return;let e=new AbortController;return fetch(t,{method:"GET",mode:"no-cors",signal:e.signal}).catch(()=>{}),()=>e.abort()},[t]),null}},44689:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SystemUpdatePopup:()=>d});var i,n=r(95155),a=r(12115),l=r(47650),s=r(98590),o=r(41429);let c=null!=(i=r(87358).env.NEXT_PUBLIC_APP_STORE_URL)?i:"https://gammatime.app.link/update";function d(e){var t;let{isOpen:r,onClose:i,popupType:d,title:u,subtitle:h,updateButtonText:p="Update Now",dismissButtonText:m="Later",updateUrl:f}=e,x=(0,a.useRef)(null),v=(0,a.useRef)(null),b=(0,a.useRef)(!1),g="should_update"===d?"Update Available":"Update Required",w="should_update"===d?"A new version of Gamma is available.":"Please update to continue using Gamma.",y="should_update"===d,j=(0,a.useCallback)(()=>{let e=null!=f?f:c;(0,s.Zl)({popup_type:d,click_on_x_button:!1,click_on_cta_button:!0}),"#"!==e&&(window.location.href=e)},[f,d]),k=(0,a.useCallback)(()=>{y&&((0,s.Zl)({popup_type:d,click_on_x_button:!0,click_on_cta_button:!1}),i())},[y,i,d]);if((0,a.useEffect)(()=>{r&&!b.current&&(b.current=!0,(0,s.xX)({popup_type:d})),r||(b.current=!1)}
1,[r,d]),(0,a.useEffect)(()=>{if("undefined"==typeof document||!r)return;v.current=document.activeElement,document.body.style.overflow="hidden";let e=()=>{var e;let t=null==(e=x.current)?void 0:e.querySelector('[data-primary-action="true"]');if(t)return t.focus({preventScroll:!0}),!0;let r=(0,o.iq)(x.current);return r.length>0&&(r[0].focus({preventScroll:!0}),!0)};e()||window.setTimeout(()=>{if(!e()){var t;null==(t=x.current)||t.focus({preventScroll:!0})}},0);let t=e=>{if("Escape"===e.key&&y)e.stopPropagation(),k();else if("Tab"===e.key){let r=(0,o.iq)(x.current);if(0===r.length){var t;e.preventDefault(),null==(t=x.current)||t.focus({preventScroll:!0});return}let i=document.activeElement,n=r.indexOf(i),a=r.length-1;if(-1===n){e.preventDefault();let t=e.shiftKey?r[a]:r[0];null==t||t.focus({preventScroll:!0});return}e.shiftKey?n<=0&&(r[a].focus({preventScroll:!0}),e.preventDefault()):n===a&&(r[0].focus({preventScroll:!0}),e.preventDefault())}};return document.addEventListener("keydown",t,!0),()=>{var e;document.removeEventListener("keydown",t,!0),document.body.style.overflow="",null==(e=v.current)||e.focus({preventScroll:!0})}},[r,k,y]),!r)return null;let N=(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",onClick:y?k:void 0,role:"presentation","data-testid":"system-update-popup-overlay",children:(0,n.jsxs)("div",{ref:x,role:"alertdialog","aria-modal":"true","aria-label":null!=u?u:g,tabIndex:-1,onClick:e=>e.stopPropagation(),className:"mx-4 w-full max-w-sm animate-fade-in focus-visible:outline-none","data-testid":"system-update-popup",style:{backgroundColor:"#181818",borderRadius:"24px"},children:[y&&(0,n.jsx)("div",{className:"flex justify-end p-4 pb-0",children:(0,n.jsx)("button",{type:"button",onClick:k,"data-testid":"system-update-popup-close",className:"flex h-8 w-8 items-center justify-center rounded-full text-white/70 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white","aria-label":"Close",children:(0,n.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),(0,n.jsxs)("div",{className:"flex flex-col items-center px-6 pb-8 ".concat(y?"pt-0":"pt-8"),children:[(0,n.jsx)("div",{className:"mb-4 flex h-16 w-16 items-center justify-center rounded-full",style:{backgroundColor:"#262626"},children:(0,n.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M12 16V12M12 8H12.01M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z",stroke:"must_update"===d?"#EF4444":"#FBBF24",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)("h2",{className:"text-center text-white",style:{fontFamily:"var(--font-outfit, sans-serif)",fontWeight:600,fontSize:"22px",lineHeight:"100%",letterSpacing:"0.1px"},children:null!=u?u:g}),(0,n.jsx)("p",{className:"mt-3 text-center",style:{fontFamily:"var(--font-outfit, sans-serif)",fontWeight:400,fontSize:"15px",lineHeight:"140%",letterSpacing:"0.1px",color:"#A3A3A3"},children:null!=h?h:w}),(0,n.jsx)("button",{type:"button",onClick:j,"data-primary-action":"true","data-testid":"system-update-popup-update",className:"mt-6 flex items-center justify-center transition-transform hover:scale-[1.02] active:scale-[0.98] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",style:{width:"100%",maxWidth:"280px",height:"56px",borderRadius:"16px",backgroundColor:"#FFFFFF",color:"#000000",fontFamily:"var(--font-outfit, sans-serif)",fontWeight:600,fontSize:"16px",padding:"16px"},children:p}),y&&(0,n.jsx)("button",{type:"button",onClick:k,"data-testid":"system-update-popup-dismiss",className:"mt-3 flex items-center justify-center transition-transform hover:scale-[1.02] active:scale-[0.98] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500",style:{width:"100%",maxWidth:"280px",height:"56px",borderRadius:"16px",backgroundColor:"transparent",color:"#A3A3A3",fontFamily:"var(--font-outfit, sans-serif)",fontWeight:500,fontSize:"16px",padding:"16px"},children:m})]})]})});if("undefined"==typeof document)return N;let E=null!=(t=document.getElementById("modal-root"))?t:document.body;return(0,l.createPortal)(N,E)}},45228:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowVideoControls:()=>o});var i=r(95155),n=r(12115),a=r(41429),l=r(53975),s=r(64034);function o(e){let{episodes:t,showId:r,currentEpisodeId:o,onEpisodeChange:c,className:d}=e,{freeEpisodes:u,currentEpisode:h,previousEpisode:p,nextEpisode:m}=function(e,t){let r=(0,n.useMemo)(()=>e.filter(e=>e.isFree).sort((e,t)=>
1e.episodeNumber-t.episodeNumber),[e]),i=(0,n.useMemo)(()=>{var e;return t&&null!=(e=r.find(e=>e.id===t))?e:null},[r,t]),a=(0,n.useMemo)(()=>t?r.findIndex(e=>e.id===t):-1,[r,t]),l=(0,n.useMemo)(()=>a>0?r[a-1]:null,[r,a]),s=(0,n.useMemo)(()=>a>=0&&a<r.length-1?r[a+1]:null,[r,a]);return{freeEpisodes:r,currentEpisode:i,currentIndex:a,previousEpisode:l,nextEpisode:s}}(t,o),f=(0,n.useCallback)(()=>{p&&(c?c(p.id):window.location.href="/show/".concat(r,"/episode/").concat(p.id))},[r,p,c]),x=(0,n.useCallback)(()=>{m&&(c?c(m.id):window.location.href="/show/".concat(r,"/episode/").concat(m.id))},[r,m,c]);return 0!==u.length&&h?(0,i.jsxs)("div",{className:(0,a.cx)("flex items-center justify-between gap-4 rounded-t-lg bg-gradient-to-t from-black/90 via-black/80 to-transparent px-6 py-4 backdrop-blur-sm",d),children:[(0,i.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,i.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,i.jsxs)("span",{className:"text-xs font-semibold text-white/60",children:["Episode ",h.episodeNumber]}),(0,i.jsx)("span",{className:"text-white/40",children:"â¢"}),(0,i.jsxs)("span",{className:"text-xs text-white/60",children:[u.length," Episodes"]})]}),(0,i.jsx)("h3",{className:"text-sm font-semibold text-white line-clamp-1 mt-0.5",children:h.title})]}),(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[(0,i.jsx)("button",{type:"button",onClick:f,disabled:!p,className:"flex h-9 w-9 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm transition-all hover:bg-white/30 hover:scale-105 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:scale-100","aria-label":"Previous episode",title:p?"Episode ".concat(p.episodeNumber):"No previous episode",children:(0,i.jsx)(l.A,{className:"h-5 w-5"})}),(0,i.jsx)("button",{type:"button",onClick:x,disabled:!m,className:"flex h-9 w-9 items-center justify-center rounded-full bg-white/20 text-white backdrop-blur-sm transition-all hover:bg-white/30 hover:scale-105 disabled:cursor-not-allowed disabled:opacity-30 disabled:hover:scale-100","aria-label":"Next episode",title:m?"Episode ".concat(m.episodeNumber):"No next episode",children:(0,i.jsx)(s.A,{className:"h-5 w-5"})})]})]}):null}},45333:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowHeroPlayer:()=>o});var i=r(95155),n=r(15239),a=r(12115),l=r(86814),s=r(76951);let o=(0,a.forwardRef)(function(e,t){let{show:r,episode:o,streamUrl:c,className:d,onProgress:u,autoPlay:h=!1,hideOverlayControls:p=!1,onEnded:m,totalEpisodes:f,onLockedClick:x,onEpisodesClick:v,onControlsVisibilityChange:b}=e,g=(0,a.useRef)(null),w=(0,a.useRef)(null);if((0,a.useImperativeHandle)(t,()=>({play:()=>{var e,t;let r=null==(e=g.current)?void 0:e.getVideoElement();r&&r.paused&&(null==(t=g.current)||t.togglePlayPause())},pause:()=>{var e,t;let r=null==(e=g.current)?void 0:e.getVideoElement();r&&!r.paused&&(null==(t=g.current)||t.togglePlayPause())},togglePlayPause:()=>{var e;null==(e=g.current)||e.togglePlayPause()},mute:()=>{var e,t;let r=null==(e=g.current)?void 0:e.getVideoElement();r&&!r.muted&&(null==(t=g.current)||t.toggleMute())},unmute:()=>{var e,t;let r=null==(e=g.current)?void 0:e.getVideoElement();r&&r.muted&&(null==(t=g.current)||t.toggleMute())},toggleMute:()=>{var e;null==(e=g.current)||e.toggleMute()},enterFullscreen:()=>
1{if(!document.fullscreenElement){var e;null==(e=g.current)||e.toggleFullscreen()}},exitFullscreen:()=>{if(document.fullscreenElement){var e;null==(e=g.current)||e.toggleFullscreen()}},toggleFullscreen:()=>{var e;null==(e=g.current)||e.toggleFullscreen()},getVideoElement:()=>{var e,t;return null!=(t=null==(e=g.current)?void 0:e.getVideoElement())?t:null},getVideoContainer:()=>w.current}),[]),o&&!o.isFree)return(0,i.jsx)("div",{className:d,ref:w,children:(0,i.jsxs)("div",{className:"relative w-full h-full bg-black",children:[(0,i.jsx)(n.default,{src:o.coverImage||r.coverImage||r.posterImage,alt:o.title||r.title,fill:!0,priority:!0,className:"object-cover",sizes:"40vw"}),(0,i.jsx)("div",{className:"absolute inset-0 bg-black/40"}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)("button",{type:"button",onClick:()=>{x&&o&&x(o.id)},className:"flex items-center justify-center w-16 h-16 rounded-full bg-black/60 backdrop-blur-sm transition-transform hover:scale-110","aria-label":"This episode is locked",children:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-8 h-8","aria-hidden":"true",children:[(0,i.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,i.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})})})]})});if(!o)return(0,i.jsx)("div",{className:d,ref:w,children:(0,i.jsx)("div",{className:"relative w-full h-full",children:(0,i.jsx)(n.default,{src:r.coverImage||r.posterImage,alt:r.title,fill:!0,priority:!0,className:"object-cover",sizes:"40vw"})})});if(!c){let e=o.coverImage&&o.coverImage.trim().length>0?o.coverImage:r.coverImage||r.posterImage;return(0,i.jsx)("div",{className:d,ref:w,children:(0,i.jsxs)("div",{className:"relative w-full h-full",children:[(0,i.jsx)(n.default,{src:e,alt:o.title||r.title,fill:!0,priority:!0,className:"object-cover",sizes:"40vw"}),o.isFree&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40","data-testid":"episode-loading-state",children:(0,i.jsx)(l.y$,{size:"lg",className:"text-white"})})]})})}let y=o.coverImage&&o.coverImage.trim().length>0?o.coverImage:r.coverImage||r.posterImage;return(0,i.jsx)("div",{className:d,ref:w,children:(0,i.jsx)(s.Player,{ref:g,title:r.title,subtitle:o.title,posterImage:y,posterPrompt:r.coverPrompt||r.posterPrompt,streamUrl:c,isFree:o.isFree,videoId:o.id,showId:r.id,captions:o.captions,pipEnabled:!1,showNativeControls:!1,aspectRatio:"portrait",onProgress:u,autoPlay:h,hideOverlayControls:p,onEnded:()=>{void 0!==f&&o.episodeNumber,null==m||m()},onEpisodesClick:v,onControlsVisibilityChange:b,mediaSession:{metadata:{title:r.title,artist:o.title,album:"Episode ".concat(o.episodeNumber),artwork:[{src:r.posterImage,sizes:"512x512",type:"image/jpeg"}]}}})})})},45454:(e,t,r)=>{"use strict";r.d(t,{ReelShortRail:()=>d});var i=r(95155),n=r(52619),a=r.n(n),l=r(12115),s=r(21512),o=r(7e3),c=r(90091);function d(e){let{title:t,shows:r,href:n,loading:d=!1,placeholderCount:u=7,basePath:h}=e,p=(0,s.Rq)(),m=null!=h?h:p,f=(0,l.useRef)(null),[x,v]=(0,l.useState)(!1),[b,g]=(0,l.useState)(!1),w=(0,l.useCallback)(()=>{let e=f.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:i}=e;v(t>0),g(t+i<r-1)},[]);(0,l.useEffect)(()=>{let e=f.current;if(e)return requestAnimationFrame(w),e.addEventListener("scroll",w),window.addEventListener("resize",w),()=>{e.removeEventListener("scroll",w),window.removeEventListener("resize",w)}},[w]),(0,l.useEffect)(()=>{requestAnimationFrame(w)},[r,d,w]);let y=e=>{if(!f.current)return;let t=f.current,r=.8*t.clientWidth;t.scrollBy({left:"left"===e?-r:r,behavior:"smooth"}),setTimeout(w,350)};return(0,i.jsxs)("section",{className:"relative",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-white md:text-3xl",children:(0,o.Sn)(t)}),n&&(0,i.jsxs)(a(),{href:n,className:"flex items-center gap-1 text-sm text-white/70 hover:text-white transition-colors",children:["View all",(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m9 18 6-6-6-6"})})]})]}),(0,i.jsxs)("div",{className:"relative group/rail",children:[x&&(0,i.jsx)("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover/rail:opacity-100 transition-opacity duration-200",children:(0,i.jsx)("button",{type:"button",onClick:()=>y("left"),className:"flex h-14 w-14 items-center justify-center rounded-full bg-neutral-800/90 hover:bg-neutral-700 text-white shadow-lg transition-all hover:scale-105","aria-label":"Scroll ".concat(t," left"),children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m15 18-6-6 6-6"})})})}),b&&(0,i.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover/rail:opacity-100 transition-opacity duration-200",children:(0,i.jsx)("button",{type:"button",onClick:()=>y("right"),className:"flex h-14 w-14 items-center justify-center rounded-full bg-neutral-800/90 hover:bg-neutral-700 text-white shadow-lg transition-all hover:scale-105","aria-label":"Scroll ".concat(t," right"),children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m9 18 6-6-6-6"})})})}),(0,i.jsx)("div",{ref:f,className:"flex gap-4 overflow-x-scroll scrollbar-hide pb-2 touch-manipulation",style:{scrollbarWidth:"none",msOverflowStyle:"none"},role:"list","aria-label":t,children:d?Array.from({length:u}).map((e,t)=>(0,i.jsx)("div",{className:"w-[220px] shrink-0 snap-start",role:"listitem",children:(0,i.jsx)(c.ReelShortShowCard,{loading:!0,basePath:m})},"placeholder-".concat(t))):r.map(e=>(0,i.jsx)("div",{className:"w-[220px] shrink-0 snap-start",role:"listitem",children:(0,i.jsx)(c.ReelShortShowCard,{show:e,basePath:m,location:t})},e.id))})]})]})}},46369:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SubscriptionModal:()=>f});var i=r(95155),n=r(12115),a=r(47650),l=r(15239);let s=[],o=[{title:"Great Dramas!",name:"Laura Collins",body:"I downloaded it just to try it out... now I check it every day \uD83D\uDE05 The stories are really good."},{title:"Love the vibe",name:"Ric Bellefonte",body:"Everything looks clean and cinematic. Not cheap content at all. Big fan"},{title:"Hooked on these dramas! Amazing actors!",name:"Flawless appa",body:"By far the best cast projects on any vertical I've seen! Love love love!"}],c=[[{text:"Real actors. Real productions. "},{text:"Never AI-generated.",bold:!0}],[{text:"Exclusive Series",bold:!0},{text:" you won't find anywhere else."}],[{text:"Watch "},{text:"Without Ads",bold:!0},{text:" or interruptions."}],[{text:"5,000+ episodes, with "},{text:"New Releases Every Day.",bold:!0}]],d=[{label:"Romance",img:"/images/paywall/genre-romance.png"},{label:"True Crime",img:"/images/paywall/genre-truecrime.png"},{label:"Drama",img:"/images/paywall/genre-drama.png"},{label:"Reality",img:"/images/paywall/genre-reality.png",comingSoon:!0}],u=[{q:"What devices are supported?",a:"GammaTime is available on any modern web browser on your phone, tablet, laptop, or desktop, as well as on our iOS and Android apps. Your subscription syncs seamlessly across all supported devices."},{q:"Can I cancel anytime?",a:"Yes. You can cancel your subscription at any time through your subscription management service. Your access will remain active until the end of your current billing period."},{q:"Is this AI-generated?",a:"No. Every Gamma series features real actors and is professionally produced. We don't use AI-generated actors or AI-generated video content."},{q:"How often are new episodes added?",a:"We regularly release new episodes and series, with fresh content added every few days, so there's always something new to wat
1ch."}],h=[{title:"ABOUT",links:[{label:"Terms of Service",href:"/terms-of-service"},{label:"Privacy Policy",href:"/privacy-policy"}]},{title:"SUPPORT",links:[{label:"Contact Us",href:"mailto:[email protected]"},{label:"Subscription Policy",href:"/subscription-policy"}]},{title:"COMMUNITY",links:[]}];function p(){return(0,i.jsx)("span",{className:"flex-shrink-0 w-[21px] h-[21px] rounded-full flex items-center justify-center mt-0.5",style:{background:"linear-gradient(135deg, rgba(101, 40, 255, 1) 0%, rgba(171, 138, 255, 1) 100%)",boxShadow:"0 0 19.5px rgba(171, 138, 255, 0.89)"},children:(0,i.jsx)("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{d:"M5 13l4 4L19 7",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})})}function m(){return(0,i.jsx)("div",{className:"flex gap-0.5 text-[16px] leading-none","aria-label":"5 out of 5 stars",children:Array.from({length:5}).map((e,t)=>(0,i.jsx)("span",{"aria-hidden":!0,children:"â"},t))})}function f(e){var t,r,f,x,v,b,g,w;let{plans:y,onSelectPlan:j,onClose:k,isLoading:N=!1,error:E=null}=e,_=y.length>0?y:s,[C,S]=(0,n.useState)((null==(t=_[1])?void 0:t.id)||(null==(r=_[0])?void 0:r.id)||""),[I,P]=(0,n.useState)(600),[T,L]=(0,n.useState)(2),[A,R]=(0,n.useState)(null),[F,M]=(0,n.useState)(!1),z=(0,n.useRef)(null);(0,n.useEffect)(()=>{M(!0)},[]),(0,n.useEffect)(()=>{if(I<=0)return;let e=setInterval(()=>{P(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[I]),(0,n.useEffect)(()=>{if("undefined"==typeof navigator)return;let e=navigator.userAgent||"",t=/iPad|iPhone|iPod/.test(e)||e.includes("Macintosh")&&navigator.maxTouchPoints>1,r=/Android/.test(e);t?R("apple"):r&&R("google")},[]);let D=(0,n.useCallback)(e=>{N||S(e)},[N]),U=(0,n.useCallback)(()=>{C&&!N&&j(C)},[C,N,j]),B=null!=(f=_.find(e=>e.id===C))?f:_[0],W=(0,n.useCallback)(()=>{var e;let t=null==(e=z.current)?void 0:e.querySelector("[data-plans-anchor]");null==t||t.scrollIntoView({behavior:"smooth",block:"start"})},[]),O=e=>(0,i.jsxs)("div",{className:"flex flex-col",children:["top"===e?(0,i.jsxs)("div",{className:"rounded-t-[22px] px-4 pt-3 pb-2.5 text-center mb-2",style:{background:"#6528FF"},children:[(0,i.jsx)("div",{className:"text-white text-[22px] font-semibold font-outfit leading-tight",children:"Choose your plan"}),(0,i.jsx)("div",{className:"text-white text-[14px] font-normal font-outfit tracking-[0.06em] mt-0.5",children:"CHEAPER THAN IN THE APP"})]}):(0,i.jsxs)("div",{className:"text-center mb-2",children:[(0,i.jsx)("div",{className:"text-white text-[22px] font-semibold font-outfit leading-tight",children:"Choose your plan"}),(0,i.jsx)("div",{className:"text-white/70 text-[14px] font-normal font-outfit tracking-[0.06em] mt-0.5",children:"CHEAPER THAN IN THE APP"})]}),(0,i.jsx)("div",{className:"space-y-[9px]",children:_.map((t,r)=>{let n=C===t.id,a=t.badge||(1===r?"BEST VALUE":void 0),{dollars:l,cents:s}=function(e){var t;let r=e.replace(/\/.*/,"").trim(),i=r.match(/\$?\s*(\d+)(?:[.,](\d{1,2}))?/);return i?{dollars:i[1],cents:null!=(t=i[2])?t:""}:{dollars:r,cents:""}}(t.pricePerDay);return(0,i.jsxs)("button",{onClick:()=>D(t.id),disabled:N,className:"w-full text-left relative disabled:opacity-70",children:[n&&(0,i.jsx)("div",{"aria-hidden":!0,className:"absolute -inset-1 rounded-[22px] pointer-events-none",style:{background:"linear-gradient(45deg, rgba(39, 7, 110, 1) 0%, rgba(111, 40, 255, 1) 100%)",filter:"blur(28px)",opacity:.75}}),(0,i.jsx)("div",{className:"relative rounded-[22px]",style:{padding:n?"2px":"0",background:n?"linear-gradient(45deg, rgba(111, 40, 255, 1) 0%, rgba(251, 197, 112, 1) 100%)":"transparent",boxShadow:n?"1px 0 10px 0 rgba(111, 40, 255, 0.02), 1px 0 9px 0 rgba(111, 40, 255, 0.15), 0 0 8px 0 rgba(111, 40, 255, 0.50), 0 0 6px 0 rgba(111, 40, 255, 0.85), 0 0 3px 0 rgba(111, 40, 255, 0.98)":"none"},children:(0,i.jsxs)("div",{className:"rounded-[21px] overflow-hidden backdrop-blur-[25px]",style:{background:n?"linear-gradient(84deg, #27076E 0%, #6F28FF 100%)":"rgba(255, 255, 255, 0.08)"},children:[a&&(0,i.jsx)("div",{className:"w-full bg-white py-1.5 text-center",children:(0,i.jsx)("span",{className:"text-black text-[14px] font-semibold font-outfit tracking-[0.1em]",children:a})}),(0,i.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,i.jsx)("span",{className:"w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0",style:{background:"linear-gradient(135deg, rgba(101, 40, 255, 1) 33%, rgba(171, 138, 255, 1) 100%)",boxShadow:"0 0 22.3px rgba(171, 138, 255, 0.89)"},children:n&&(0,i.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{d:"M5 13l4 4L19 7",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-white text-[22px] font-semibold font-outfit leading-[1.1]",children:t.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,i.jsx)("span",{className:"text-white/[0.56] text-[15px] font-semibold font-outfit",children:t.price}),t.originalPrice&&(0,i.jsx)("span",{className:"text-white/[0.56] text-[15px] font-[450] font-outfit line-through",children:t.originalPrice})]})]})]}),(0,i.jsxs)("div",{className:"flex items-start flex-shrink-0",children:[(0,i.jsx)("span",{className:"text-white text-[15px] font-semibold font-outfit mt-2",children:"$"}),(0,i.jsx)("span",{className:"text-white text-[60px] font-normal font-outfit leading-[0.75]",children:l}),(0,i.jsxs)("span",{className:"flex flex-col items-start ml-1.5 mt-1.5",children:[t.originalPricePerDay&&(0,i.jsx)("span",{className:"text-white/[0.56] text-[10px] font-[450] font-outfit line-through leading-none",children:t.originalPricePerDay}),s&&(0,i.jsx)("span",{className:"text-white text-[17px] font-semibold font-outfit leading-none mt-0.5",children:s}),(0,i.jsx)("span",{className:"text-white text-[12px] font-normal font-outfit leading-none mt-1",children:"/day"})]})]})]})]})})]},"".concat(e,"-").concat(t.id))})})]}),V=(0,i.jsxs)("div",{className:"fixed inset-0 z-[80] flex items-stretch justify-center",role:"presentation",children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-black/70",onClick:k,role:"presentation"}),(0,i.jsxs)("div",{className:"absolute top-0 left-0 right-0 z-20 flex items-center justify-between px-4 md:px-8 h-14 md:h-16",
1style:{background:"linear-gradient(90deg, rgba(97, 22, 235, 1) 0%, rgba(158, 120, 254, 1) 100%)"},children:[(0,i.jsxs)("div",{className:"flex items-center gap-3 md:gap-8 min-w-0 flex-1",children:[(0,i.jsx)("span",{className:"hidden md:inline text-white text-[22px] font-bold font-outfit whitespace-nowrap",children:"GammaTime"}),(0,i.jsxs)("div",{className:"flex flex-col leading-tight min-w-0",children:[(0,i.jsxs)("span",{className:"text-white/90 text-[11px] md:text-[12px] font-outfit whitespace-nowrap",children:[(0,i.jsx)("span",{className:"font-bold",children:"60%"})," discount reserved for:"]}),(0,i.jsx)("span",{className:"text-white text-[15px] md:text-[17px] font-bold font-outfit tabular-nums",children:function(e){let t=Math.floor(e/60);return"".concat(String(t).padStart(2,"0"),":").concat(String(e%60).padStart(2,"0"))}(I)})]})]}),(0,i.jsx)("button",{onClick:W,className:"px-4 md:px-6 py-2 rounded-full bg-white text-[#1A0A3C] text-[13px] md:text-[15px] font-bold font-outfit whitespace-nowrap hover:scale-[1.03] transition-transform",children:"Get Unlimited Access"})]}),(0,i.jsxs)("div",{onClick:e=>e.stopPropagation(),ref:z,className:"relative w-full md:max-w-[480px] mt-14 md:mt-[88px] overflow-y-auto overflow-x-hidden max-h-[calc(100dvh-3.5rem)] md:max-h-[calc(100dvh-88px)] no-scrollbar",style:{background:"linear-gradient(180deg, rgba(97, 22, 235, 1) 0%, rgba(88, 34, 214, 1) 30%, rgba(78, 30, 190, 1) 55%, rgba(66, 26, 165, 1) 78%, rgba(54, 22, 138, 1) 100%), #0B0416"},children:[(0,i.jsxs)("div",{className:"absolute inset-0 pointer-events-none",children:[(0,i.jsx)("div",{className:"absolute top-[820px] left-1/2 -translate-x-1/2 w-[540px] h-[540px] rounded-full opacity-45 blur-[140px]",style:{background:"rgba(130, 60, 255, 1)"}}),(0,i.jsx)("div",{className:"absolute top-[1700px] left-1/2 -translate-x-1/2 w-[520px] h-[520px] rounded-full opacity-35 blur-[150px]",style:{background:"rgba(120, 50, 245, 1)"}})]}),(0,i.jsxs)("div",{className:"relative z-10",children:[E&&(0,i.jsx)("div",{className:"flex justify-center pt-4 px-5",children:(0,i.jsx)("div",{className:"px-4 py-2.5 rounded-[10px] bg-white shadow-lg",children:"failed"===E?(0,i.jsx)("span",{className:"text-[#EF274B] text-[14px] font-semibold font-outfit",children:"Purchase failed, please try again"}):(0,i.jsx)("span",{className:"text-[#090909] text-[14px] font-normal font-outfit",children:"Purchase canceled!"})})}),(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("button",{onClick:k,className:"absolute top-4 left-4 z-20 w-9 h-9 flex items-center justify-center rounded-full bg-black/40 backdrop-blur-sm hover:bg-black/60 transition-colors","aria-label":"Close",children:(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2.5",children:(0,i.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})}),(0,i.jsx)(l.default,{src:"/images/paywall/hero-collage.png",alt:"GammaTime originals",width:393,height:217,className:"w-full h-auto",priority:!0})]}),(0,i.jsxs)("div",{className:"px-5 mt-5 text-center",children:[(0,i.jsxs)("h1",{className:"text-white text-[26px] md:text-[28px] font-bold font-outfit leading-tight",children:["Keep Watching on the",(0,i.jsx)("br",{}),"#1 Premium Vertical App"]}),(0,i.jsx)("p",{className:"text-white/80 text-[16px] font-medium font-outfit mt-2",children:"Premium Stories. Daily Drops."})]}),(0,i.jsx)("div",{className:"px-5 mt-5","data-plans-anchor":"top",children:O("top")}),(0,i.jsxs)("p",{className:"px-4 mt-4 text-center text-white/45 text-[12px] leading-relaxed font-outfit",children:[(null==B?void 0:B.renewalPrice)?(0,i.jsxs)(i.Fragment,{children:["By clicking Get Unlimited Access, you agree to an intro offer of"," ",B.price," for the first"," ",null!=(x=B.renewalInterval)?x:"period",", then"," ",B.renewalPrice," every"," ",null!=(v=B.renewalInterval)?v:"period",", with automatic renewals unless canceled through the applicable subscription management service. You also agree to our"," "]}):(0,i.jsxs)(i.Fragment,{children:["By clicking Get Unlimited Access, you agree to a subscription of"," ",null!=(b=null==B?void 0:B.price)?b:"$11.99"," every"," ",null!=(g=null==B?void 0:B.renewalInterval)?g
1:"2 weeks",", with automatic renewals unless canceled through the applicable subscription management service. You also agree to our"," "]}),(0,i.jsx)("a",{href:"/privacy-policy",className:"underline",target:"_blank",children:"Privacy Policy"}),","," ",(0,i.jsx)("a",{href:"/terms-of-service",className:"underline",target:"_blank",children:"Subscription Terms"})," ","&"," ",(0,i.jsx)("a",{href:"/subscription-policy",className:"underline",target:"_blank",children:"Subscription Policy"}),".",(null==B?void 0:B.renewalPrice)?" Intro offer for first-time subscribers only.":""]}),(0,i.jsxs)("div",{className:"relative mt-10 pb-4",children:[(0,i.jsxs)("div",{"aria-hidden":!0,className:"pointer-events-none absolute -inset-x-8 -top-24 -bottom-24",children:[(0,i.jsx)("div",{className:"absolute left-1/2 top-[120px] h-[640px] w-[120%] -translate-x-1/2",style:{background:"radial-gradient(ellipse at center, rgba(111,40,255,0.9) 0%, rgba(39,7,110,0.55) 55%, transparent 78%)",filter:"blur(90px)"}}),(0,i.jsx)("div",{className:"absolute left-1/2 top-[150px] h-[230px] w-[86%] -translate-x-1/2 -translate-y-1/2",style:{borderRadius:"50%",background:"radial-gradient(ellipse at center, #4A17B8 0%, #2E0B85 45%, transparent 75%)",filter:"blur(44px)"}})]}),(0,i.jsxs)("div",{className:"relative z-10 flex items-center justify-center gap-3 px-5",children:[(0,i.jsx)(l.default,{src:"/images/paywall/laurel-left.svg",alt:"",width:31,height:55,className:"h-[52px] w-auto flex-shrink-0","aria-hidden":!0}),(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"text-white text-[28px] font-extrabold font-outfit leading-none tracking-tight",children:"5000 + EPISODES"}),(0,i.jsx)("div",{className:"text-white text-[15px] font-bold font-outfit tracking-[0.12px] mt-2",children:"NEW RELEASES EVERY DAY"})]}),(0,i.jsx)(l.default,{src:"/images/paywall/laurel-right.svg",alt:"",width:31,height:55,className:"h-[52px] w-auto flex-shrink-0","aria-hidden":!0})]}),(0,i.jsx)(l.default,{src:"/images/paywall/episodes-phones.png",alt:"A selection of GammaTime series playing across phones",width:922,height:738,className:"relative z-10 w-full h-auto -mt-1 px-3"})]}),(0,i.jsx)("div",{className:"relative z-10 px-6 mt-4 space-y-5",children:c.map((e,t)=>(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)(p,{}),(0,i.jsx)("span",{className:"text-white text-[15px] font-normal font-outfit leading-snug tracking-[0.088px]",children:e.map((e,t)=>e.bold?(0,i.jsx)("strong",{className:"font-bold",children:e.text},t):(0,i.jsx)("span",{children:e.text},t))})]},t))}),(0,i.jsxs)("div",{className:"relative z-10 px-5 mt-9 text-center",children:[(0,i.jsx)("div",{className:"flex justify-center mb-2",children:(0,i.jsx)(m,{})}),(0,i.jsx)("h2",{className:"text-white text-[22px] font-bold font-outfit",children:"Loved by viewers"})]}),(0,i.jsx)("div",{className:"mt-4 overflow-x-auto no-scrollbar",children:(0,i.jsx)("div",{className:"flex gap-3 px-5 w-max",children:o.map((e,t)=>{let r=new Date;r.setDate(r.getDate()-(t+1)*7);let n=r.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return(0,i.jsxs)("div",{className:"rounded-[16px] p-4 text-left bg-white w-[280px] flex-shrink-0",children:[(0,i.jsx)("div",{className:"text-[#0B0416] text-[16px] font-bold font-outfit",children:e.title}),(0,i.jsxs)("div",{className:"text-black/45 text-[12px] font-outfit mt-0.5",children:[n," - ",e.name]}),(0,i.jsx)("div",{className:"my-2",children:(0,i.jsx)(m,{})}),(0,i.jsxs)("p",{className:"text-black/70 text-[13px] font-outfit leading-snug",children:['"',e.body,'"']})]},t)})})}),(0,i.jsx)("div",{className:"px-5 mt-6",children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("div",{className:"absolute inset-0 rounded-[22px] blur-[40px] pointer-events-none",style:{background:"rgba(111, 40, 255, 0.12)"}}),(0,i.jsxs)("div",{className:"relative rounded-[22px] p-3 flex items-center gap-3",style:{background:"rgba(255, 255, 255, 0.08)"},children:[(0,i.jsx)("div",{className:"absolute inset-0 rounded-[22px] pointer-events-none",style:{padding:"2px",background:"linear-gradient(135deg, rgba(101, 40, 255, 1) 33%, rgba(171, 138, 255, 1) 100%)",WebkitMask:"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",WebkitMaskComposite:"xor",maskComposite:"exclude"}}),(0,i.jsx)("div",{className:"w-12 h-12 rounded-full flex-shrink-0 overflow-hidden bg-white",children:(0,i.jsx)(l.default,{src:"/images/paywall/investor-avatar.png",alt:"",width:48,height:48,className:"w-full h-full object-cover","aria-hidden":!0})}),(0,i.jsx)("a",{href:"https://variety.com/2026/tv/news/versant-media-gammatime-microdramas-1236765109/",target:"_blank",rel:"noopener noreferrer",className:"text-white text-[14px] font-normal font-outfit leading-snug hover:text-white/80 transition-colors",children:'"Versant Media Invests in GammaTime, the Premium Microdrama Platform Previously Backed by Kim Kardashian and Kris Jenner."'})]})]})}),(0,i.jsxs)("div",{className:"mt-9 text-center",children:[(0,i.jsx)("h2",{className:"text-white text-[22px] font-semibold font-outfit mb-5",children:"Featured In"}),(0,i.jsx)("div",{className:"flex items-center gap-4 overflow-x-auto px-6 no-scrollbar [mask-image:linear-gradient(to_right,transparent,#000_24px,#000_calc(100%-24px),transparent)]",children:[{src:"variety.svg",alt:"Variety",w:61,h:18,href:"https://variety.com/2026/tv/news/versant-media-gammatime-microdramas-1236765109/"},{src:"forbes.svg",alt:"Forbes",w:60,h:22,href:"https://www.forbes.com/sites/maureenkerr/2026/06/07/versants-gammatime-deal-tests-old-tv-ip-in-a-microdrama-funnel/"},{src:"theverge.svg",alt:"The Verge",w:73,h:23,href:"https://www.theverge.com/column/821345/micro-dramas-how-hollywood"},{src:"wsj.svg",alt:"The Wall Street Journal",w:174,h:22,href:"https://www.wsj.com/business/media/gammatime-microdrama-video-platform-aa333984"},{src:"business-insider.svg",alt:"Business Insider",w:44,h:15,href:"https://www.businessinsider.com/micro-dramas-hollywood-peacock-hbo-streaming-service-challengers-2025-10"}].map((e,t,r)=>(0,i.jsxs)("div",{className:"flex shrink-0 items-center gap-4",children:[(0,i.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"shrink-0 transition-opacity hover:opacity-80",children:(0,i.jsx)(l.default,{src:"/images/paywall/press/".concat(e.src),alt:"Featured in ".concat(e.alt),width:e.w,height:e.h,className:"h-[24px] w-auto shrink-0"})}),t<r.length-1&&(0,i.jsx)("span",{className:"h-[5px] w-[5px] shrink-0 rounded-full bg-[#F4C56E]"})]},e.src))})]}),(0,i.jsxs)("div",{className:"px-5 mt-9",children:[(0,i.jsx)("h2",{className:"text-white text-[22px] font-semibold font-outfit text-center mb-4",children:"Genres"}),(0,i.jsx)("div",{className:"grid grid-cols-2 gap-6",children:d.map(e=>(0,i.jsxs)("div",{className:"relative rounded-[14px] overflow-hidden aspect-[4/5]",style:{border:"0.8px solid rgba(255,255,255,0.16)",boxShadow:"0px 0.35px 14px 0px rgba(255, 227, 104, 0.77)"},children:[(0,i.jsx)(l.default,{src:e.img,alt:e.label,fill:!0,className:"object-cover",sizes:"(max-width: 480px) 50vw, 240px"}),(0,i.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, rgba(0,0,0,0) 15%, rgba(0,0,0,0.5) 42%, rgba(0,0,0,1) 100%)"}}),e.comingSoon&&(0,i.jsx)("span",{className:"absolute top-0 right-0 px-1.5 pt-0.5 pb-[3px] rounded-bl-[8px] bg-white text-[#090909] text-[10px] font-bold font-outfit tracking-tight",children:"COMING SOON"}),(0,i.jsx)("span",{className:"absolute bottom-3 left-3 text-white text-[23px] font-semibold font-outfit drop-shadow-lg",children:e.label})]},e.label))})]}),(0,i.jsx)("div",{className:"px-5 mt-10",children:O("bottom")}),(0,i.jsxs)("div",{className:"px-5 mt-2 flex items-center justify-center gap-2 text-white/55 text-[12px] font-outfit",children:[(0,i.jsx)("span",{children:"Secure Checkout"}
1),(0,i.jsx)("span",{"aria-hidden":!0,children:"\xb7"}),(0,i.jsx)("a",{href:"/terms-of-service",target:"_blank",className:"underline hover:text-white/80",children:"Terms"}),(0,i.jsx)("span",{"aria-hidden":!0,children:"\xb7"}),(0,i.jsx)("a",{href:"/privacy-policy",target:"_blank",className:"underline hover:text-white/80",children:"Privacy"}),(0,i.jsx)("span",{"aria-hidden":!0,children:"\xb7"}),(0,i.jsx)("a",{href:"/subscription-policy",target:"_blank",className:"underline hover:text-white/80",children:"Subscription Policy"})]}),(0,i.jsx)("div",{className:"px-5 mt-8 space-y-3",children:u.map((e,t)=>{let r=T===t;return(0,i.jsxs)("div",{className:"rounded-[14px] overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:[(0,i.jsxs)("button",{onClick:()=>L(r?null:t),className:"w-full px-4 py-3.5 flex items-center justify-between text-left",children:[(0,i.jsx)("span",{className:"text-[14px] font-normal font-outfit leading-[1.26] pr-3",style:{color:r?"#AB8AFF":"#FFFFFF"},children:e.q}),(0,i.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:r?"#AB8AFF":"white",strokeWidth:"2",className:"flex-shrink-0 transition-transform ".concat(r?"rotate-180":""),children:(0,i.jsx)("path",{d:"M6 9l6 6 6-6"})})]}),r&&(0,i.jsx)("p",{className:"px-4 pb-4 -mt-0.5 text-white text-[14px] font-normal font-outfit leading-relaxed",children:e.a})]},t)})}),(0,i.jsxs)("div",{className:"px-5 mt-9 pb-6 border-t border-white/10 pt-6",children:[(0,i.jsx)("div",{className:"grid grid-cols-3 gap-4",children:h.map(e=>(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"text-white/80 text-[12px] font-bold font-outfit tracking-wide mb-2",children:e.title}),(0,i.jsx)("div",{className:"space-y-1.5",children:e.links.map(e=>(0,i.jsx)("a",{href:e.href,target:e.href.startsWith("mailto:")?void 0:"_blank",rel:e.href.startsWith("mailto:")?void 0:"noopener noreferrer",className:"block text-white/50 text-[12px] font-outfit hover:text-white/80",children:e.label},e.label))})]},e.title))}),(0,i.jsx)("p",{className:"text-white/30 text-[11px] font-outfit mt-6",children:"All rights reserved, 2026 GammaTime."})]}),(0,i.jsx)("div",{className:"h-40"})]}),(0,i.jsx)("div",{className:"sticky bottom-0 left-0 right-0 z-20",children:(0,i.jsxs)("div",{className:"px-5 pt-4 pb-5",style:{background:"linear-gradient(180deg, rgba(11,4,22,0) 0%, rgba(11,4,22,0.95) 30%, rgba(11,4,22,1) 100%)"},children:[(0,i.jsx)("button",{onClick:U,disabled:N||!C,className:"w-full py-3.5 bg-white rounded-[16px] flex items-center justify-center gap-2 font-outfit font-bold text-[#0B0416] text-[16px] transition-transform hover:scale-[1.01] active:scale-[0.98] disabled:opacity-50",children:N?"Processing...":"apple"===A?(0,i.jsx)(l.default,{src:"/images/paywall/apple-pay-mark.png",alt:"Apple Pay",width:61,height:26,className:"h-[26px] w-auto"}):"google"===A?(0,i.jsx)(l.default,{src:"/images/paywall/google-pay-mark.png",alt:"Google Pay",width:62,height:26,className:"h-[26px] w-auto"}):"Get Unlimited Access"}),(0,i.jsx)("div",{className:"flex justify-center mt-3",children:(0,i.jsx)(l.default,{src:"/images/paywall/pay-methods.png",alt:"Accepted payment methods",width:343,height:33,className:"h-8 w-auto opacity-90"})}),(0,i.jsx)("div",{className:"flex justify-center mt-2",children:(0,i.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[#4ADE80] text-[13px] font-semibold font-outfit",children:[(0,i.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#4ADE80",strokeWidth:"2",children:[(0,i.jsx)("path",{d:"M12 2l7 4v6c0 5-3.5 8-7 10-3.5-2-7-5-7-10V6z"}),(0,i.jsx)("path",{d:"M9 12l2 2 4-4"})]}),"Pay safe & secure"]})})]})})]})]});return F&&"undefined"!=typeof document?(0,a.createPortal)(V,null!=(w=document.getElementById("modal-root"))?w:document.body):null}},47400:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowCarousel:()=>c});var i=r(95155),n=r(12115),a=r(96195),l=r(86814),s=r(21512),o=r(3996);function c(e){let{shows:t,loading:r=!1,placeholderCount:c=7,onEndVisible:d}=e,{containerRef:u,canScrollPrev:h,canScrollNext:p,scrollPrev:m,scrollNext:f,onKeyDown:x}=(0,s.vl)(),{ref:v,isIntersecting:b}=(0,s.v1)({threshold:1,disabled:!d}
1),[g,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{w(!0)},[]);let y=g&&!r&&t.length>=10,j=y?t.length+ +!!d:0,k=(0,a.Te)({horizontal:!0,count:j,gap:24,estimateSize:e=>y&&d&&e===t.length?1:284,getScrollElement:()=>u.current,overscan:4,getItemKey:e=>{var r,i;return y&&d&&e===t.length?"carousel-sentinel":null!=(i=null==(r=t[e])?void 0:r.id)?i:e}}),N=y?k.getVirtualItems():[],E=N.length>0?N[N.length-1]:void 0,_=N.length>0?N[0].start:0,C=Math.max((y&&E?k.getTotalSize()-E.end:0)-24,0);return(0,n.useEffect)(()=>{b&&d&&d()},[b,d]),(0,i.jsx)("section",{className:"page-section",children:(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("div",{className:"pointer-events-none absolute left-0 top-1/2 z-10 -translate-y-1/2 pl-2",children:(0,i.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:m,disabled:!h,"aria-label":"Scroll shows backward",className:"pointer-events-auto h-11 w-11 rounded-full bg-base-200/80 p-0 text-lg backdrop-blur-sm transition-all hover:bg-base-200 disabled:opacity-0",children:"â¹"})}),(0,i.jsx)("div",{className:"pointer-events-none absolute right-0 top-1/2 z-10 -translate-y-1/2 pr-2",children:(0,i.jsx)(l.$n,{size:"sm",variant:"ghost",onClick:f,disabled:!p,"aria-label":"Scroll shows forward",className:"pointer-events-auto h-11 w-11 rounded-full bg-base-200/80 p-0 text-lg backdrop-blur-sm transition-all hover:bg-base-200 disabled:opacity-0",children:"âº"})}),(0,i.jsx)("div",{ref:u,className:"flex snap-x snap-mandatory overflow-x-auto px-2 pb-4 scrollbar-hide focus:outline-none",tabIndex:0,role:"list","aria-label":"Featured shows",onKeyDown:x,children:(0,i.jsxs)("div",{className:"flex items-stretch".concat(y?"":" gap-6"),style:{paddingLeft:"".concat(_,"px"),paddingRight:"".concat(C,"px")},children:[r?Array.from({length:c}).map((e,t)=>(0,i.jsx)("div",{className:"w-show-card shrink-0 snap-start md:w-show-card-md",role:"listitem",children:(0,i.jsx)(o.ShowCard,{loading:!0})},"placeholder-".concat(t))):y?N.map(e=>{if(d&&e.index===t.length)return(0,i.jsx)("div",{ref:v,className:"h-1 w-1 shrink-0","aria-hidden":!0,"data-index":e.index},e.key);let r=t[e.index],n=e.index===t.length-1;return(0,i.jsx)("div",{"data-index":e.index,ref:e=>{e&&k.measureElement(e)},className:"flex shrink-0 snap-start",role:"listitem",style:{paddingInlineEnd:24*!n},children:(0,i.jsx)("div",{className:"w-show-card shrink-0 md:w-show-card-md",children:(0,i.jsx)(o.ShowCard,{show:r})})},e.key)}):t.map(e=>(0,i.jsx)("div",{className:"w-show-card shrink-0 snap-start md:w-show-card-md",role:"listitem",children:(0,i.jsx)(o.ShowCard,{show:e})},e.id)),!y&&d?(0,i.jsx)("div",{ref:v,className:"h-1 w-1 shrink-0"}):null]})})]})})}},47430:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Toggle:()=>l});var i=r(95155),n=r(12115),a=r(41429);function l(e){let{defaultOn:t=!1,label:r,className:l,onClick:s,...o}=e,[c,d]=(0,n.useState)(t);return(0,i.jsx)("button",{type:"button",role:"switch","aria-checked":c,"aria-label":r,className:(0,a.cx)("relative inline-flex h-6 w-12 items-center rounded-full border border-base-300 bg-base-200/70 transition-all",c?"bg-primary/80":"bg-base-200/70",l),onClick:e=>{d(e=>!e),null==s||s(e)},...o,children:(0,i.jsx)("span",{className:(0,a.cx)("inline-block h-4 w-4 rounded-full bg-base-100 shadow-soft transition-all",c?"translate-x-6":"translate-x-1")})})}},47440:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EpisodeList:()=>m});var i=r(95155),n=r(12115),a=r(96195),l=r(15239),s=r(52619),o=r.n(s),c=r(87776),d=r(59130),u=r(14474),h=r(34779);function p(e){let{episode:t,showId:r,showCoverImage:n,onUnlock:a,onEpisodeSelect:s}=e,c="/show/".concat(r,"/episode/").concat(t.id),d=!t.isFree,p="Eps.".concat(t.episodeNumber," - ").concat(t.title),m=t.coverImage&&t.coverImage.trim().length>0?t.coverImage:n&&n.trim().length>0?n:null,f=(0,i.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,i.jsxs)("div",{className:"relative w-episode-card h-episode-card overflow-hidden bg-base-300 rounded-episode-card border border-episode-card-border",children:[m?(0,i.jsx)(l.default,{src:m,alt:t.title,fill:!0,className:"object-cover transition-all duration-300 group-hover:scale-105 group-hover:brightness-110",sizes:"280px"}):(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gradient-to-br from-base-300 to-base-200",children:(0,i.jsx)("div",{className:"text-center",children:(0,i.jsxs)("div",{className:"text-2xl font-bold text-base-content/20",children:["Eps.",t.episodeNumber]})})}),(0,i.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent"}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:d?(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-black/70 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-black/80",children:(0,i.jsx)(u.A,{className:"h-6 w-6 text-white"})}):(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/90 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-primary",children:(0,i.jsx)(h.A,{className:"h-6 w-6 text-primary-content"})})}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:(0,i.jsx)("h3",{className:"font-outfit text-[15px] font-medium text-white leading-normal tracking-[0.1px] overflow-hidden text-ellipsis whitespace-nowrap",children:p})})]})});return d?(0,i.jsx)("button",{type:"button",className:"group relative h-full w-full text-left transition-all hover:-translate-y-1",onClick:()=>{a(t)},"aria-label":"Locked episode: ".concat(t.title,". Get the app to wat
1ch."),"data-testid":"episode-item","data-free":"false",children:f}):s?(0,i.jsx)("button",{type:"button",className:"group relative h-full w-full text-left transition-all hover:-translate-y-1",onClick:()=>s(t.id),"aria-label":"Watch ".concat(t.title),"data-testid":"episode-item","data-free":"true",children:f}):(0,i.jsx)(o(),{href:c,className:"group relative block h-full transition-all hover:-translate-y-1","aria-label":"Watch ".concat(t.title),"data-testid":"episode-item","data-free":"true",children:f})}function m(e){let{episodes:t,showId:r,showCoverImage:l,overscan:s=6,layout:o="vertical",showHeader:u=!0,onEpisodeSelect:h}=e,[m,f]=(0,n.useState)(!1),[x,v]=(0,n.useState)(null),[b,g]=(0,n.useState)(!1),w=(0,n.useRef)(null);(0,n.useEffect)(()=>{f(!0)},[]);let y=(0,n.useCallback)(e=>{v(e),g(!0)},[]),j=(0,n.useCallback)(()=>{g(!1),v(null)},[]);(0,n.useEffect)(()=>{if(!b||!x){b||(w.current=null);return}let e="".concat(r,":").concat(x.id);w.current!==e&&(w.current=e)},[b,x,r]);let k=m&&"vertical"===o&&t.length>=18,N=(0,a.XW)({count:k?t.length:0,estimateSize:()=>192,overscan:s,getItemKey:e=>{var r,i;return null!=(i=null==(r=t[e])?void 0:r.id)?i:e}}),E=k?N.getVirtualItems():[],_=0,C=0;if(k&&E.length>0){var S,I;let e=E[0],t=E[E.length-1],r=N.getTotalSize();_=null!=(S=null==e?void 0:e.start)?S:0,C=Math.max(r-(null!=(I=null==t?void 0:t.end)?I:0),0)}let P=(0,i.jsxs)("div",{className:"relative",children:[(0,i.jsx)("div",{className:"sr-only",role:"status","aria-live":"polite",children:"Use arrow keys or tab to navigate through episodes. Use the scroll bar or swipe to view more episodes."}),(0,i.jsx)("div",{className:"scrollbar-hide flex gap-3 overflow-x-auto pb-2 snap-x snap-mandatory touch-pan-x focus-within:outline-none focus-within:ring-2 focus-within:ring-primary/50 focus-within:ring-offset-2 rounded-lg",role:"list","aria-label":"Episodes",tabIndex:0,"data-testid":"episode-list-horizontal",children:t.map(e=>(0,i.jsx)("div",{role:"listitem",className:"h-episode-card w-episode-card flex-shrink-0 snap-start",children:(0,i.jsx)(p,{episode:e,showId:r,showCoverImage:l,onUnlock:y,onEpisodeSelect:h})},e.id))})]}),T=k?(0,i.jsxs)("div",{className:"flex flex-col",role:"list","aria-label":"Episodes",children:[_>0?(0,i.jsx)("div",{style:{height:_},"aria-hidden":!0}):null,E.map(e=>{let n=t[e.index];return n?(0,i.jsx)("div",{role:"listitem",ref:e=>{e&&N.measureElement(e)},"data-index":e.index,className:"pb-4",children:(0,i.jsx)(c.EpisodeRow,{episode:n,showId:r,showCoverImage:l,onUnlock:y,onEpisodeSelect:h})},e.key):null}),C>0?(0,i.jsx)("div",{style:{height:C},"aria-hidden":!0}):null]}):(0,i.jsx)("div",{className:"flex flex-col gap-3",role:"list","aria-label":"Episodes",children:t.map(e=>(0,i.jsx)("div",{role:"listitem",children:(0,i.jsx)(c.EpisodeRow,{episode:e,showId:r,showCoverImage:l,onUnlock:y,onEpisodeSelect:h})},e.id))}),L=b&&!!x;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("section",{className:"space-y-6",children:[u&&(0,i.jsx)("h2",{className:"text-2xl font-bold text-base-content md:text-3xl",children:"Episodes"}),"horizontal"===o?P:T]}),(0,i.jsx)(d.GetAppPopup,{isOpen:L,onClose:j,title:x?'Get the app to keep watching "'.concat(x.title,'"'):"Get the app to continue the show"})]})}},47453:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Rail:()=>h});var i=r(95155),n=r(52619),a=r.n(n),l=r(12115),s=r(96195),o=r(21512),c=r(7e3),d=r(3996),u=r(29564);function h(e){let{title:t,shows:r,href:n,loading:h=!1,placeholderCount:p=7,onEndVisible:m,basePath:f}=e,x=(0,o.Rq)(),v=null!=f?f:x,{containerRef:b,canScrollPrev:g,canScrollNext:w,scrollPrev:y,scrollNext:j}=(0,o.vl)(),{ref:k,isIntersecting:N}=(0,o.v1)({threshold:1,disabled:!m}),[E,_]=(0,l.useState)(!1),C=(0,l.useMemo)(()=>t.toLowerCase().includes("top 10"),[t]);(0,l.useEffect)(()=>{_(!0)},[]);let S=E&&!h&&r.length>=10,I=S?r.length+ +!!m:0,P=C?16:24,T=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=0===e?"w-top10-container-first md:w-top10-container-first-md":"w-top10-container md:w-top10-container-md";return t?"".concat(r," shrink-0"):r},L=(0,s.Te)({horizontal:!0,count:I,gap:P,estimateSize:e=>S&&m&&e===r.length?1:C?0===e?246:262:224,getScrollElement:()=>b.current,overscan:4,getItemKey:e=>{var t,i;return S&&m&&e===r.length?"rail-sentinel":null!=(i=null==(t=r[e])?void 0:t.id)?i:e}}),A=S?L.getVirtualItems():[],R=A.length>0?A[A.length-1]:void 0,F=A.length>0?A[0].start:0,M=Math.max((S&&R?L.getTotalSize()-R.end:0)-P,0);return(0,l.useEffect)(()=>{N&&m&&m()},[N,m]),(0,i.jsxs)("section",{className:"page-section",children:[(0,i.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-base-content md:text-3xl",children:(0,c.Sn)(t)}),n&&(0,i.jsx)(a(),{href:n,className:"text-sm font-semibold text-secondary transition-colors hover:text-base-content",children:"View all"})]}),(0,i.jsxs)("div",{className:"relative group/rail",children:[g&&(0,i.jsx)("div",{className:"absolute left-2 top-1/2 z-50 -translate-y-1/2 opacity-0 group-hover/rail:opacity-100 transition-opacity duration-200",children:(0,i.jsx)("button",{type:"button",onClick:y,"aria-label":"Scroll ".concat(t," backward"),className:"flex h-14 w-14 items-center justify-center rounded-full bg-neutral-800/90 hover:bg-neutral-700 text-white shadow-lg transition-all hover:scale-105",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m15 18-6-6 6-6"})})})}),w&&(0,i.jsx)("div",{className:"absolute right-2 top-1/2 z-50 -translate-y-1/2 opacity-0 group-hover/rail:opacity-100 transition-opacity duration-200",children:(0,i.jsx)("button",{type:"button",onClick:j,"aria-label":"Scroll ".concat(t," forward"),className:"flex h-14 w-14 items-center justify-center rounded-full bg-neutral-800/90 hover:bg-neutral-700 text-white shadow-lg transition-all hover:scale-105",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m9 18 6-6-6-6"})})})}),(0,i.jsx)("div",{ref:b,className:"mt-6 flex overflow-x-scroll overflow-y-clip px-2 pb-4 scrollbar-hide touch-manipulation",style:{scrollbarWidth:"none",msOverflowStyle:"none"},role:"list","aria-label":t,children:(0,i.jsxs)("div",{className:"flex items-stretch".concat(S?"":C?" gap-4":" gap-6"),style:{paddingLeft:"".concat(F,"px"),paddingRight:"".concat(M,"px")},children:[h?Array.from({length:p}).map((e,t)=>(0,i.jsx)("div",{className:"shrink-0 snap-start ".concat(C?T(t):"w-show-card md:w-show-card-md"),role:"listitem",children:C?(0,i.jsx)(u.Top10S
1howCard,{loading:!0,rank:t+1,basePath:v}):(0,i.jsx)(d.ShowCard,{loading:!0,basePath:v})},"placeholder-".concat(t))):S?A.map(e=>{if(m&&e.index===r.length)return(0,i.jsx)("div",{ref:k,className:"h-1 w-1 shrink-0","aria-hidden":!0,"data-index":e.index},e.key);let t=r[e.index],n=e.index===r.length-1;return(0,i.jsx)("div",{"data-index":e.index,ref:e=>{e&&L.measureElement(e)},className:"flex shrink-0 snap-start",role:"listitem",style:{paddingInlineEnd:n?0:P},children:(0,i.jsx)("div",{className:C?T(e.index,!0):"w-show-card shrink-0 md:w-show-card-md",children:C?(0,i.jsx)(u.Top10ShowCard,{show:t,rank:e.index+1,basePath:v}):(0,i.jsx)(d.ShowCard,{show:t,basePath:v})})},e.key)}):r.map((e,t)=>(0,i.jsx)("div",{className:"shrink-0 snap-start ".concat(C?T(t):"w-show-card md:w-show-card-md"),role:"listitem",children:C?(0,i.jsx)(u.Top10ShowCard,{show:e,rank:t+1,basePath:v}):(0,i.jsx)(d.ShowCard,{show:e,basePath:v})},e.id)),!S&&m?(0,i.jsx)("div",{ref:k,className:"h-1 w-1 shrink-0"}):null]})})]})]})}},49907:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CloseButton:()=>a});var i=r(95155),n=r(12115);function a(e){let{onClose:t,className:r}=e,a=(0,n.useCallback)(()=>{t?t():window.history.back()},[t]);return(0,i.jsx)("button",{type:"button",onClick:a,className:"absolute right-4 top-4 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-black/40 text-white backdrop-blur-sm ".concat(r||""),"aria-label":"Close",children:"â"})}},51634:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CookieConsent:()=>o});var i=r(95155),n=r(12115),a=r(52619),l=r.n(a);let s="gamma_cookie_consent";function o(){let[e,t]=(0,n.useState)(!1);return((0,n.useEffect)(()=>{localStorage.getItem(s)||t(!0)},[]),e)?(0,i.jsx)("div",{className:"fixed bottom-0 left-0 right-0 z-[60]",role:"dialog","aria-label":"Cookie consent",children:(0,i.jsx)("div",{className:"mx-auto w-full border-t border-white/10 backdrop-blur-md",style:{background:"rgba(0, 0, 0, 0.85)",maxWidth:"600px"},children:(0,i.jsxs)("div",{className:"flex flex-col gap-3 px-6 py-4",children:[(0,i.jsxs)("p",{className:"font-outfit text-sm leading-relaxed text-white/70",children:["We use cookies to personalize your experience, analyze site traffic, and serve targeted advertisements. By continuing to use this site, you consent to the use of cookies in accordance with our"," ",(0,i.jsx)(l(),{href:"/privacy-policy",className:"text-white underline underline-offset-2 hover:text-white/90",children:"Cookie Policy"}),"."]}),(0,i.jsx)("button",{type:"button",onClick:()=>{localStorage.setItem(s,"accepted"),t(!1)},className:"w-full rounded-lg bg-white py-2.5 font-outfit text-sm font-semibold text-black transition-colors hover:bg-white/90",children:"Accept"})]})})}):null}},52419:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GammaLogoOverlay:()=>a});var i=r(95155),n=r(4795);function a(){return(0,i.jsx)("div",{className:"absolute left-4 md:left-[120px] top-8 z-50",children:(0,i.jsx)(n.Logo,{size:"lg",asLink:!0,className:"text-white drop-shadow-lg",style:{textShadow:"0 2px 8px rgba(0, 0, 0, 0.5)"}})})}},52483:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowPageClient:()=>L});var i=r(95155),n=r(12115),a=r(20063),l=r(15239),s=r(21512),o=r(52619),c=r.n(o),d=r(56364),u=r(76951),h=r(27036),p=r(7e3),m=r(89599),f=r(85396),x=r(74595),v=r(40373),b=r(87358);let g=b.env.NEXT_PUBLIC_TWIST_EVENTS_URL||b.env.TWIST_EVENTS_URL||"https://rev-track2.twist.win/external-events/gamma",w="https://prod.api.gammatime.ai/api/v1";class y extends Error{constructor(e,t,r){super(e),this.name="CapiEventError",this.status=t,this.body=r}}function j(e){var t;return"undefined"==typeof document?"":(null==(t=document.cookie.split("; ").find(t=>t.startsWith("".concat(e,"="))))?void 0:t.split("=")[1])||""}function k(e,t){if("undefined"!=typeof document)try{let r="https:"===window.location.protocol?"; Secure":"";document.cookie="".concat(e,"=").concat(t,"; path=/; max-age=").concat(7776e3,"; SameSite=Lax").concat(r)}catch(e){}}async function N(e,t){let r=await fetch("".concat(w,"/events"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(e)}),i=await r.text().catch(()=>"");
1if(!r.ok)throw new y("[capi-events] POST /events failed: ".concat(r.status," ").concat(i),r.status,i);try{return i?JSON.parse(i):null}catch(e){return i}}async function E(e,t,r){let i=function(){var e;let t=(0,f.gz)(),r=j("_fbp")||(null==t?void 0:t.fbp)||"";r||k("_fbp",r=function(){let e=Math.floor(1e10*Math.random());return"fb.1.".concat(Date.now(),".").concat(e)}());let i=j("_fbc")||(null==t?void 0:t.fbc)||"";!i&&(null==t?void 0:t.fbclid)&&k("_fbc",i=(0,f.tx)(t.fbclid));let n=(0,f.wR)(),a=(null==t||null==(e=t.singular)?void 0:e.wpcn)||(null==t?void 0:t.utm_campaign)||"",l={};return r&&(l.browser_id=r),i&&(l.fbc=i),(null==t?void 0:t.fbclid)&&(l.fbclid=t.fbclid),n&&(l.marketing_source=n),a&&(l.campaign_name=a),l}(),n={event_name:t,event_time:Date.now(),event_source_url:function(){try{return window.location.href}catch(e){return""}}(),app_instance_id:null!=(s=r.app_instance_id)?s:function(){try{var e;return null!=(e=window.localStorage.getItem("singular_device_id"))?e:""}catch(e){return""}}(),...i,...r},a=function(){var e,t,r,i;let n=(0,f.gz)();return n&&"matan"===(null!=(i=null!=(r=null==(e=n.all_params)?void 0:e.wpsrc)?r:null==(t=n.singular)?void 0:t.wpsrc)?i:"").toLowerCase()&&n.clickid||null}();if(a)try{fetch("/api/messenger-postback",{method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0,body:JSON.stringify({clickid:a,event:n})}).catch(e=>{console.error("[messenger-postback] client send failed:",e)})}catch(e){console.error("[messenger-postback] client send failed:",e)}let l=function(){try{if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID()}catch(e){}return"evt_".concat(Date.now(),"_").concat(Math.floor(1e12*Math.random()))}();var s,o,c,d={...n,event_id:l};try{fetch("/api/meta-capi",{method:"POST",headers:{"Content-Type":"application/json"},keepalive:!0,body:JSON.stringify(d)}).catch(e=>{console.error("[meta-capi] client send failed:",e)})}catch(e){console.error("[meta-capi] client send failed:",e)}var u={...n,event_id:l};let h=window.fbq;if("function"==typeof h&&v.dN)try{let e={};u.content_id&&(e.content_ids=[u.content_id],e.content_type="product"),u.package_name&&(e.content_name=u.package_name),h("trackSingle",v.dN,u.event_name,e,{eventID:u.event_id})}catch(e){console.error("[meta-pixel] browser send failed:",e)}!function(e){var t;let r={};e.browser_id&&(r.fbp=e.browser_id),e.fbc&&(r.fbc=e.fbc);let i={};e.content_id&&(i.content_ids=[e.content_id],i.content_type="product"),e.package_id&&(i.package_id=e.package_id),e.package_name&&(i.content_name=e.package_name),e.series_id&&(i.series_id=e.series_id),e.episode_id&&(i.episode_id=e.episode_id),e.paywall_id&&(i.paywall_id=e.paywall_id),e.marketing_source&&(i.marketing_source=e.marketing_source),e.campaign_name&&(i.campaign_name=e.campaign_name),e.fbclid&&(i.fbclid=e.fbclid);let n={event_name:e.event_name,event_time:Math.floor((null!=(t=e.event_time)?t:Date.now())/1e3),action_source:"website",user_data:r};e.event_id&&(n.event_id=e.event_id),e.event_source_url&&(n.event_source_url=e.event_source_url),Object.keys(i).length>0&&(n.custom_data=i),function(e){if(!function(e){if(!e)return!1;let t=function(){let e=(b.env.NEXT_PUBLIC_TWIST_ENABLED_EVENTS||b.env.TWIST_ENABLED_EVENTS||"ViewContent").trim();return"*"===e?["*"]:e.split(",").map(e=>e.trim()).filter(Boolean)}();return!!t.includes("*")||t.some(t=>t.toLowerCase()===e.toLowerCase())}(e.event_name))return;let t=function(e,t){let r;try{r=JSON.stringify(e)}catch(e){return null}if(!r)return null;let i="undefined"!=typeof TextEncoder?new TextEncoder().encode(r).length:r.length;return i>262144?(console.warn("[twist] ".concat(t," payload ").concat(i,"B exceeds the 256KB cap â not sent")),null):r}(e,"browser");if(!t)return;let r="".concat(g,"/browser");try{var i;let e=null==(i=navigator.sendBeacon)?void 0:i.bind(navigator);if(e&&e(r,t))return;fetch(r,{method:"POST",body:t,headers:{"Content-Type":"text/plain;charset=UTF-8"},keepalive:!0,mode:"no-cors"}).catch(()=>{})}catch(e){}}(n)}({...n,event_id:l});let p=(0,f.gz)(),m=!!(null==p?void 0:p.fbclid),w=m&&!n.fbc,E=!n.browser_id;(0,x.K3)("info","capi: event sent",{area:"capi-event",event_name:t,content_id:n.content_id,external_id:n.external_id||"",external_id_present:!!n.external_id,app_instance_id:n.app_instance_id||"",app_instance_id_present:!!n.app_instance_id,fbc:n.fbc||"",fbp:n.browser_id||"",fbclid:(null==p?void 0:p.fbclid)||"",fbc_present:!!n.fbc,fbp_present:!!n.browser_id,had_fbclid_at_landing:m,marketing_source:(0,f.wR)()||"",campaign_name:n.campaign_name||"",singular:JSON.stringify(null!=(o=null==p?void 0:p.singular)?o:null)}),(w||E)&&(0,x.K3)("warn","capi: missing fb identifier",{area:"capi-attribution",event_name:t,missing_fbc:w,missing_fbp:E,had_fbclid_at_landing:m,fbc:n.fbc||"",fbp:n.browser_id||"",fbclid:(null==p?void 0:p.fbclid)||"",fbc_present:!!n.fbc,fbp_present:!!n.browser_id,singular:JSON.stringify(null!=(c=null==p?void 0:p.singular)?c:null)});try{let r=await N(n,e);return(0,x.K3)("info","capi: event accepted",{area:"capi-event",event_name:t,status:200}),{ok:!0,status:200,body:r}}catch(r){let e=r instanceof y?r.status:0;return console.error("[capi-events] send failed:",r),(0,x.K3)("error","capi: event rejected",{area:"capi-event",event_name:t,status:e,body:r instanceof y?r.body:String(r)}),{ok:!1,status:e,body:r instanceof y?r.body:String(r)}}}var _=r(57959),C=r(934),S=r(31267);let I=["7502877","7543420"];
1function P(e,t){try{e.document.open(),e.document.write('<!doctype html><html><head><meta charset="utf-8">\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <title>Checkout</title>\n <style>\n html,body{height:100%;margin:0;background:#0b0b0f;color:#fff;\n font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}\n .wrap{height:100%;display:flex;flex-direction:column;align-items:center;\n justify-content:center;gap:14px;text-align:center;padding:24px}\n .sub{color:#9aa0aa;font-size:14px}\n .spinner{width:34px;height:34px;border:3px solid #ffffff30;\n border-top-color:#fff;border-radius:50%;animation:spin 0.8s linear infinite}\n button{margin-top:8px;padding:10px 20px;border:0;border-radius:10px;\n background:#fff;color:#0b0b0f;font-weight:600;font-size:14px}\n @keyframes spin{to{transform:rotate(360deg)}}\n </style></head>\n <body><div class="wrap">'.concat("loading"===t?'<div class="spinner"></div><p>Loading checkoutâ¦</p>':'<p>We couldn\'t open checkout just now.</p>\n <p class="sub">Please close this tab and tap the plan again.</p>\n <button onclick="window.close()">Close</button>',"</div></body></html>")),e.document.close()}catch(e){}}async function T(e,t,r){try{let i,n=await fetch("/api/proxy/stream/get-video-tokens",{method:"POST",headers:{"Content-Type":"application/json","x-gamma-user-token":e,Accept:"application/json"},body:JSON.stringify({showId:t,videoIds:r})});if(!n.ok)return[];let a=await n.json();if(Array.isArray(a))i=a;else if(a&&"object"==typeof a&&Array.isArray(a.tokens))i=a.tokens;else{if(!a||!a.videoId&&!a.video_id)return[];i=[a]}return i.filter(e=>
1(e.videoId||e.video_id)&&(e.streamToken||e.stream_token)).map(e=>{var t,r;return{videoId:null!=(t=e.videoId)?t:e.video_id,streamToken:null!=(r=e.streamToken)?r:e.stream_token}})}catch(e){return[]}}function L(e){let{show:t,nextEpisode:o,nextFreeEpisode:v,initialStreamUrl:b,basePath:g}=e,w=(0,s.Rq)(),y=null!=g?g:w,j=(0,a.useSearchParams)(),k=(0,a.useRouter)(),N=(0,p.i9)(j.get("episodeId")),L=(0,s.Ub)("(min-width: 768px)"),A=(0,n.useMemo)(()=>{if(N){let e=t.episodes.find(e=>e.id===N);if(e)return e}return v},[N,t.episodes,v]),[R,F]=(0,n.useState)(A),M=(0,n.useRef)(R);(0,n.useEffect)(()=>{M.current=R},[R]);let[z,D]=(0,n.useState)(t.episodes),U=(0,n.useRef)(z);(0,n.useEffect)(()=>{U.current=z},[z]);let B=(0,n.useRef)(null),[W,O]=(0,n.useState)(!0),[V,K]=(0,n.useState)(!0),[H,G]=(0,n.useState)(!1),[q,X]=(0,n.useState)(!1),[Y,J]=(0,n.useState)(!1),[$,Z]=(0,n.useState)(!1),[Q,ee]=(0,n.useState)(!1),[et,er]=(0,n.useState)(!1),[ei,en]=(0,n.useState)([]),{getServerToken:ea,user:el,profile:es,loading:eo,isAnonymous:ec,serverToken:ed,linkEmailPassword:eu,signInWithEmail:eh,emailHasPasswordAccount:ep}=(0,m.A)(),em=(0,n.useRef)(ec);(0,n.useEffect)(()=>{em.current=ec},[ec]);let[ef,ex]=(0,n.useState)(!1),ev=(null==es?void 0:es.isPaying)||!!(null==es?void 0:es.subscriptionProductId)||ef,eb=(0,n.useCallback)(async(e,r)=>{let i=await ea();if(!i)return;let{screen_name:n,content_id:a,...l}=r;E(i,e,{screen_name:n,source:"web",content_id:a,series_id:t.id,...(null==el?void 0:el.uid)?{external_id:el.uid}:{},...l})},[ea,t.id,null==el?void 0:el.uid]),eg=(0,n.useRef)("");(0,n.useEffect)(()=>{try{let e=window.localStorage.getItem("gamma-captured-email");e&&(eg.current=e)}catch(e){}},[]);let ew=(0,n.useCallback)(e=>{var r,i,n,a,l;null==(r=eC.current)||r.pause(),null==(i=eS.current)||i.pause(),e&&(ez.current=e.id);let s=null!=(a=null!=(n=null==e?void 0:e.id)?n:null==R?void 0:R.id)?a:t.id;eb("AddToCart",{screen_name:"paywall",content_id:s,episode_id:null!=(l=null==e?void 0:e.id)?l:null==R?void 0:R.id,paywall_id:"ooc_web"}),(0,x.K3)("info","paywall: shown",{area:"ooc-checkout",content_id:s,show_id:t.
1id,next_step:"plans"}),Z(!0)},[eb,null==R?void 0:R.id,t.id]);(0,n.useEffect)(()=>{if(!(0,_.XW)()||(B.current=(0,_.yw)(),!ed))return;let e=!1;return(0,_.Yv)("web").then(t=>{e||(B.current=t)}),()=>{e=!0}},[ed]),(0,n.useEffect)(()=>{ev&&D(e=>e.map(e=>e.isFree?e:{...e,isFree:!0}))},[ev]),(0,n.useEffect)(()=>{$&&!(ei.length>0)&&(async()=>{try{var e,t;(0,_.e2)()&&(B.current=await (0,_.Yv)("web"));let{fetchTebexSubscriptionPrices:i}=await r.e(4047).then(r.bind(r,64047)),n=(0,_.e2)(),a=await i(n);if(0===a.length)return;let l=function(e){var t,r,i;let n=new Map;for(let a of(null!=(t=null==e?void 0:e.popup_chain)?t:[]).flatMap(e=>{var t;return null!=(t=e.data)?t:[]})){let e=String(null!=(i=null!=(r=a.product_id)?r:a.tebex_product_id)?i:"");if(!e)continue;let t=a.first_payment_sale_amount,l="number"==typeof t?t:"string"==typeof t&&""!==t.trim()?Number(t):NaN;Number.isFinite(l)&&l>0&&n.set(e,l)}return n}(B.current),s=a.map(e=>{let t=e.name.toLowerCase(),r=t.match(/(\d+)\s*-?\s*week/),i=t.includes("year")||t.includes("annual"),n=r?parseInt(r[1],10):i?52:1,a=i?365:7*n,s=l.get(String(e.id)),o="number"==typeof s&&s>0&&s<e.price-.001,c=o?e.price-s:e.price,d=(c/a).toFixed(2),u=o?e.price:e.basePrice>e.price+.001?e.basePrice:2.5*e.price,h="$".concat(u.toFixed(2)),p="$".concat((u/a).toFixed(2));return{id:String(e.id),name:e.name,price:"$".concat(c.toFixed(2)),period:i?"year":"week",renewalInterval:i?"year":1===n?"week":"".concat(n," weeks"),pricePerDay:"$".concat(d),originalPrice:h,originalPricePerDay:p,renewalPrice:o?"$".concat(e.price.toFixed(2)):void 0,description:"Unlock all series for ".concat(i?"one year":1===n?"7 days":"".concat(n," weeks")),badge:i?"BEST VALUE":void 0}}),o=(0,_.e2)()?(null!=(t=null==(e=B.current)?void 0:e.popup_chain)?t:[]).flatMap(e=>{var t;return null!=(t=e.data)?t:[]}).map(e=>{var t,r;return String(null!=(r=null!=(t=null==e?void 0:e.product_id)?t:null==e?void 0:e.tebex_product_id)?r:"")}).filter(Boolean):[];if((0,_.e2)()){let e=new Map(s.map(e=>[e.id,e])),t=o.map(t=>e.get(t)).filter(e=>!!e);if(t.length>0)en(t);else{let t=I.map(t=>e.get(t)).filter(e=>!!e);en(t)}}else if(o.length>0){let e=new Map(s.map(e=>[e.id,e])),t=o.map(t=>e.get(t)).filter(e=>!!e);en(t.length>0?t:s)}else en(s)}catch(e){}})()},[$,ei.length]);let ey=(0,n.useRef)(!1),ej=!ey.current&&(null==R?void 0:R.id)===(null==A?void 0:A.id),[ek,eN]=(0,n.useState)(null),eE=(0,n.useMemo)(()=>ek&&ek.videoId===(null==R?void 0:R.videoId)?(0,h.mu)(ek.streamToken):ej&&b?b:(null==R?void 0:R.streamToken)&&R.isFree?(0,h.mu)(R.streamToken):void 0,[ek,ej,b,null==R?void 0:R.videoId,null==R?void 0:R.streamToken,null==R?void 0:R.isFree]);(0,n.useEffect)(()=>{eN(null)},[null==R?void 0:R.id]),(0,n.useEffect)(()=>{if(!eE||!(null==R?void 0:R.videoId)||!R.isFree)return;let e=(()=>{try{let e=new URL(eE).pathname.split("/").filter(Boolean)[0];if(!e)return;let t=e.split(".");if(3!==t.length)return;let r=t[1].replace(/-/g,"+").replace(/_/g,"/"),i=atob(r),n=JSON.parse(i);return"number"==typeof n.exp?1e3*n.exp:void 0}catch(e){return}})();if(!e)return;let i=Math.max(0,e-12e4-Date.now()),n=R.videoId,a=t.id,l=setTimeout(async()=>{try{let{getStreamTokens:e}=await Promise.resolve().then(r.bind(r,27036)),t=(await e(a,[n])).find(e=>e.videoId===n);t&&eN({videoId:t.videoId,streamToken:t.streamToken})}catch(e){console.warn("[ShowPageClient] Token refresh failed:",e)}},i);return()=>clearTimeout(l)},[eE,null==R?void 0:R.videoId,null==R?void 0:R.isFree,t.id]);let e_=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(eE||!(null==R?void 0:R.isFree)||!R.videoId||e_.current===R.id)return;e_.current=R.id;let e=R.videoId,i=R.id;(async()=>{try{let n=await ea();if(n){let r=(await T(n,t.id,[e])).find(t=>t.videoId===e);if(r)return void F(e=>(null==e?void 0:e.id)===i?{...e,streamToken:r.streamToken}:e)}let{getStreamTokens:a}=await Promise.resolve().then(r.bind(r,27036)),l=(await a(t.id,[e])).find(t=>t.videoId===e);l&&F(e=>(null==e?void 0:e.id)===i?{...e,streamToken:l.streamToken}:e)}catch(e){console.warn("[ShowPageClient] Fallback stream token fetch failed:",e)}})()},[eE,null==R?void 0:R.id,null==R?void 0:R.videoId,null==R?void 0:R.isFree,t.id,ea]);let eC=(0,n.useRef)(null),eS=(0,n.useRef)(null),eI=(0,n.useRef)(!1),eP=(0,n.useRef)(!1),eT=(0,n.useRef)(!1),eL=(0,n.useRef)(!1),eA=(0,n.useRef)(null),eR=(0,n.useRef)(!0);(0,n.useEffect)(()=>(eR.current=!0,()=>{eR.current=!1}),[]),(0,n.useEffect)(()=>{var e;Y&&(0,S.oV)({email:null!=(e=null==es?void 0:es.email)?e:void 0})},[Y,null==es?void 0:es.email]),(0,n.useEffect)(()=>{$&&(0,S.Cp)(t.id)},[$,t.id]);let eF=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=null==R?void 0:R.id;e&&eF.current!==e&&(eF.current=e,eb("ViewContent",{screen_name:"show_page",content_id:e,episode_id:e}))},[null==R?void 0:R.id,eb]);let eM=(0,n.useCallback)(async()=>{var e,i,n,a,l,s,o,c,d;if(eI.current||eT.current)return;eT.current=!0;let u={area:"ooc-checkout",content_id:null!=(i=null==(e=M.current)?void 0:e.id)?i:t.id,show_id:t.
1id};(0,x.K3)("info","activation: polling started",u);let h=Date.now(),p=await ea();if(!p){(0,x.K3)("error","activation: no token",u),eT.current=!1;return}let{pollForActiveSubscription:m}=await r.e(4047).then(r.bind(r,64047)),f=await m(p,30,2e3);if(eT.current=!1,!(null==f?void 0:f.hasActiveSubscription)||!eR.current)return void(0,x.K3)("warn","activation: not active after poll",{...u,poll_ms:Date.now()-h,has_wallet:!!f,mounted:eR.current});if(eI.current)return;eI.current=!0,eP.current=!1;try{let{trackWebPaymentsClient:e}=await Promise.resolve().then(r.bind(r,31267)),i=null==(n=f.subscriptions)?void 0:n.find(e=>"ACTIVE"===e.status||"RENEWED"===e.status),c=eA.current,d=(null==c?void 0:c.id)||(null==i?void 0:i.productId)||"",u=/weekly|week/i.test(null!=(s=null==c?void 0:c.name)?s:"")||/weekly|week/i.test(null!=(o=null==i?void 0:i.productId)?o:""),h=(null==c?void 0:c.name)||(u?"Weekly Subscription":"Yearly Subscription"),p=(null==i?void 0:i.status)==="RENEWED";e({price_in_usd:(null==i?void 0:i.price)||0,currency:(null==i?void 0:i.currency)||"USD",product_id:d,product_name:h,status:p?"renewed":"started",status_description:(null==i?void 0:i.status)||"",location_series_id:t.id,location_episode_id:(null==(a=M.current)?void 0:a.id)||"",transaction_id:(null==i?void 0:i.subscriptionId)||""}),(0,x.K3)("info","payment: successful",{area:"payment",transaction_id:(null==i?void 0:i.subscriptionId)||"",product_id:d,product_name:h,price_in_usd:(null==i?void 0:i.price)||0,currency:(null==i?void 0:i.currency)||"USD",is_renewal:p,series_id:t.id,episode_id:(null==(l=M.current)?void 0:l.id)||""})}catch(e){}ex(!0),D(e=>e.map(e=>e.isFree?e:{...e,isFree:!0})),em.current?((0,x.K3)("info","post-payment: account completion shown",{area:"post-payment",series_id:t.id}),ee(!0)):(0,x.K3)("info","post-payment: account completion skipped",{area:"post-payment",series_id:t.id,reason:"not-anonymous"});let v=ez.current,b=v?U.current.find(e=>e.id===v):null;if(b)try{let e=await fetch("/api/proxy/stream/unlock-episode",{method:"POST",headers:{"Content-Type":"application/json","x-gamma-user-token":p,Accept:"application/json"},body:JSON.stringify({episodeId:b.id,showId:t.id,platform:"android"})});if(e.ok){let t=await e.json(),r=null!=(d=null!=(c=t.token)?c:t.streamToken)?d:t.stream_token;r&&(eK.current.add(b.id),D(e=>e.map(e=>e.id===b.id?{...e,isFree:!0,streamToken:r}:e)),F({...b,isFree:!0,streamToken:r}))}}catch(e){}},[ea,t.id]);(0,n.useEffect)(()=>{var e,t;Q&&(null==(e=eC.current)||e.pause(),null==(t=eS.current)||t.pause())},[Q,null==R?void 0:R.id,null==R?void 0:R.streamToken]),(0,n.useEffect)(()=>{let e=()=>{"visible"===document.visibilityState&&eP.current&&!eI.current&&(em.current&&!eL.current&&ee(!0),eT.current||((0,x.K3)("info","activation: resumed on tab return",{area:"ooc-checkout",show_id:t.id}),eM().catch(e=>{console.warn("[ShowPageClient] Resumed activation failed:",e)})))};return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),()=>{document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e)}},[eM,t.id]),(0,n.useEffect)(()=>{let e=e=>{var r;if(e.origin!==window.location.origin)return;let i=e.data;if(i&&"object"==typeof i){if("tebex-cancel"===i.type){eP.current=!1;return}"tebex-complete"===i.type&&!eI.current&&((0,x.K3)("info","checkout: tebex-complete received",{area:"ooc-checkout",show_id:t.id,transaction_id:null!=(r=i.transactionId)?r:""}),em.current&&!eL.current&&ee(!0),eT.current||eM().catch(e=>{console.warn("[ShowPageClient] Activation after tebex-complete failed:",e)}))}};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[eM,t.id]),(0,s.Ri)(eC,null==R?void 0:R.id);let ez=(0,n.useRef)(null),{addOrUpdateItem:eD}=(0,s.l)(),eU=(0,n.useRef)(!1),eB=(0,n.useRef)(!1),eW=(0,n.useRef)(null),eO=(0,n.useRef)(new Set);(0,n.useEffect)(()=>{if(!eB.current){eB.current=!0;try{localStorage.setItem("gammatime:series:".concat(t.id),"true")}catch(e){}}},[t.id,null==R?void 0:R.id]),(0,n.useEffect)(()=>{let e=()=>{};return window.addEventListener("beforeunload",e),()=>
1{window.removeEventListener("beforeunload",e),e()}},[t.id]);let eV=(0,n.useCallback)(e=>{if(!R||e.duration<=0)return;e.currentTime>0&&(eU.current=!0,eW.current!==R.id&&(eW.current=R.id,(0,S.nV)({series_id:t.id,episode_id:R.id,is_first_time:!eO.current.has(R.id)}),eO.current.add(R.id)));let r=e.currentTime/e.duration;eD({episodeId:R.id,showId:t.id,showTitle:t.title,showPosterImage:t.coverImage||t.posterImage,showPosterPrompt:t.coverPrompt||t.posterPrompt,episodeTitle:R.title,episodeNumber:R.episodeNumber,progressPercent:r})},[R,t,eD]),eK=(0,n.useRef)(new Set),eH=!eo&&!!el;(0,n.useEffect)(()=>{if(!eH)return;let e=!1;return(async()=>{try{var r,i,n,a;let l=await ea();if(!l||e)return;console.log("[ShowPageClient] Refreshing episode unlock status...");let s=(r="https://prod.api.gammatime.ai/api/v1",void 0!==r)?r:"https://dev.api.gammatime.ai/api/v1",o=await fetch("".concat(s,"/shows/").concat(t.id,"/episodes?platform=android&page=1&limit=100"),{headers:{Authorization:"Bearer ".concat(l),Accept:"application/json"}});if(!o.ok||e)return void console.warn("[ShowPageClient] Episode refresh failed:",o.status,await o.text().catch(()=>""));let c=await o.json();console.log("[ShowPageClient] Episode refresh response keys:",c&&"object"==typeof c?Object.keys(c):c);let d=[];if(Array.isArray(c)?d=c:(null==c?void 0:c.data)&&Array.isArray(c.data)?d=c.data:Array.isArray(null==c?void 0:c.response)&&(d=c.response),e||0===d.length)return void console.log("[ShowPageClient] No episodes in refresh response");let u=new Set;for(let e of d){let t=e.episode||e,r=t.id,l=null!=(a=null!=(n=null!=(i=e.isUnlocked)?i:e.is_unlocked)?n:t.isUnlocked)?a:t.is_unlocked;r&&l&&u.add(r)}if(console.log("[ShowPageClient] Unlocked episode count:",u.size,[...u]),e||0===u.size)return;for(let e of(D(e=>e.map(e=>u.has(e.id)&&!e.isFree?{...e,isFree:!0}:e)),u))eK.current.add(e)}catch(e){console.warn("[ShowPageClient] Failed to refresh episode unlock status:",e)}})(),()=>{e=!0}},[eH,t.id]),(0,n.useCallback)(()=>{let e=0;for(let r of eK.current){let i=z.find(e=>e.id===r),n=t.episodes.find(e=>e.id===r);i&&!(null==n?void 0:n.isFree)&&e++}return e},[z,t.episodes]);let eG=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(eo||!R||R.isFree||eK.current.has(R.id)||eG.current===R.id||ez.current)return;eG.current=R.id;let e=R.id;el&&(console.log("[ShowPageClient] Auto-unlock: attempting for episode",e),(async()=>{try{let n,a=await ea();if(!a)return void console.log("[ShowPageClient] Auto-unlock: no server token available");try{console.log("[ShowPageClient] Auto-unlock: calling unlock-episode...");let l=await fetch("/api/proxy/stream/unlock-episode",{method:"POST",headers:{"Content-Type":"application/json","x-gamma-user-token":a,Accept:"application/json"},body:JSON.stringify({episodeId:e,showId:t.id,platform:"android"})});if(l.ok){var r,i;let e=await l.json();(n=null!=(i=null!=(r=e.token)?r:e.streamToken)?i:e.stream_token)?console.log("[ShowPageClient] Auto-unlock: unlockEpisode returned token"):console.log("[ShowPageClient] Auto-unlock: unlockEpisode returned no token, trying direct fetch",e)}else console.warn("[ShowPageClient] Auto-unlock: unlock-episode returned",l.status)}catch(e){console.warn("[ShowPageClient] Auto-unlock: unlockEpisode failed, trying direct fetch",e)}if(!n)try{let e=R.videoId||R.id,r=(await T(a,t.id,[e])).find(t=>t.videoId===e);r?(n=r.streamToken,console.log("[ShowPageClient] Auto-unlock: got token via direct fetch")):console.log("[ShowPageClient] Auto-unlock: direct fetch returned no matching token")}catch(e){console.warn("[ShowPageClient] Auto-unlock: direct fetch failed",e)}n?(ex(!0),eK.current.add(e),D(e=>e.map(e=>e.isFree?e:{...e,isFree:!0})),ey.current=!0,F({...R,isFree:!0,streamToken:n}),O(!0)):console.log("[ShowPageClient] Auto-unlock: all attempts failed, episode remains locked")}catch(e){console.error("[ShowPageClient] Auto-unlock failed:",e)}})())},[R,t.id,ea,eo,el]);let eq=(0,n.useCallback)(()=>{if(!R)return;(0,S.QR)({series_id:t.id,episode_id:R.id,is_first_time:!eO.current.has(R.id)}),eW.current===R.id&&(eW.current=null);let e=z.findIndex(e=>e.id===R.id),i=e>=0?z[e+1]:void 0;if(!i)return;if(!i.isFree&&!eK.current.has(i.id)&&!ev)return void ew(i);let n=e=>{ey.current=!0,ez.current=e.id,F(e),k.replace((0,f.WN)("".concat(y,"/").concat(t.id,"?episodeId=").concat(e.id)),{scroll:!1})};(async()=>{try{if(i.isFree||eK.current.has(i.id)){let e=i.videoId||i.id;try{let{getStreamTokens:a}=await Promise.resolve().then(r.bind(r,27036)),l=(await a(t.id,[e])).find(t=>t.videoId===e);if(l)return void n({...i,isFree:!0,streamToken:l.streamToken})}catch(e){console.warn("[handleEpisodeEnded] Fresh token fetch failed, trying with existing token:",e)}n(i);return}n(i),ew(i)}catch(e){console.error("[auto-unlock] Failed:",e),ew(i)}})()},[R,z,t.id,k,y,ew,ev]),eX=(0,a.usePathname)();(0,n.useEffect)(()=>
1{if(!(void 0!==window.playwright||window.navigator.userAgent.includes("Playwright"))&&"undefined"!=typeof document&&document.pictureInPictureEnabled)try{let e=async()=>{var e;let t=null==(e=eC.current)?void 0:e.getVideoElement();if(t&&!t.paused)try{await t.requestPictureInPicture()}catch(e){}},r=()=>{e()},i=r=>{let i=r.target.closest("a[href]");if(!i)return;let n=i.getAttribute("href");n&&(!n.startsWith("/")||n.startsWith("//")||n.startsWith("".concat(y,"/").concat(t.id))||e())};return window.addEventListener("beforeunload",r),document.addEventListener("click",i),()=>{window.removeEventListener("beforeunload",r),document.removeEventListener("click",i)}}catch(e){console.error("Auto-PiP setup failed:",e);return}},[eX,t.id,y]);let eY=(0,n.useCallback)(async e=>{let i=z.find(t=>t.id===e);if(!i)return;(0,u.markUserStartedPlayback)(),ey.current=!0,ez.current=e;let n=(0,f.WN)("".concat(y,"/").concat(t.id,"?episodeId=").concat(e));if(k.replace(n,{scroll:!1}),!i.isFree&&!eK.current.has(e))return void(async()=>{try{let l,s=await ea();if(!s)return void ew(i);try{var r,n,a;let o=await fetch("/api/proxy/stream/unlock-episode",{method:"POST",headers:{"Content-Type":"application/json","x-gamma-user-token":s,Accept:"application/json"},body:JSON.stringify({episodeId:e,showId:t.id,platform:"android"})});if(!o.ok)return void ew(i);let c=await o.json();l=null!=(a=null!=(n=null!=(r=c.token)?r:c.streamToken)?n:c.stream_token)?a:c.streamingToken}catch(e){console.warn("[handleEpisodeSelect] unlock-episode failed:",e),ew(i);return}if(ex(!0),eK.current.add(e),D(e=>e.map(e=>e.isFree?e:{...e,isFree:!0})),l)F({...i,isFree:!0,streamToken:l});else{F({...i,isFree:!0});try{let e=i.videoId||i.id,r=(await T(s,t.id,[e])).find(t=>t.videoId===e);r&&F({...i,isFree:!0,streamToken:r.streamToken})}catch(e){}}}catch(e){console.error("[handleEpisodeSelect] Unlock error:",e),ew(i)}})();if((i.isFree||eK.current.has(e))&&!i.streamToken){let e={...i,isFree:!0};F(e),(async()=>{try{let n=await ea();if(!n)return;let a=i.videoId||i.id,l=(await T(n,t.id,[a])).find(e=>e.videoId===a);if(l)F({...e,streamToken:l.streamToken});else{let{getStreamTokens:i}=await Promise.resolve().then(r.bind(r,27036)),n=(await i(t.id,[a])).find(e=>e.videoId===a);n&&F({...e,streamToken:n.streamToken})}}catch(e){console.warn("[ShowPageClient] Failed to fetch stream token for unlocked episode:",e)}})()}else eK.current.has(e)&&!i.isFree?F({...i,isFree:!0}):F(i)},[t.id,z,k,y,ea,ew]);(0,n.useEffect)(()=>{if(ez.current){N===ez.current&&(ez.current=null);return}if(N){let e=z.find(e=>e.id===N);e&&e.id!==(null==R?void 0:R.id)&&eY(N)}else if(R){let e=(0,f.WN)("".concat(y,"/").concat(t.id,"?episodeId=").concat(R.id));k.replace(e,{scroll:!1})}},[N,z,t.id,null==R?void 0:R.id,R,eY,k,y]);let eJ=[{label:"Home",href:"/"},{label:t.title,href:"".concat(y,"/").concat(t.id)},...R?[{label:"Episode ".concat(R.episodeNumber)}]:[]];return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.cQ,{url:eE}),!W&&(0,i.jsxs)("div",{className:"md:hidden min-h-screen bg-background overflow-x-hidden",children:[(0,i.jsx)("h1",{className:"sr-only","data-testid":"show-title",children:t.title}),(0,i.jsxs)("div",{className:"relative w-full",style:{height:"65vh"},children:[(0,i.jsx)(l.default,{src:t.coverImage||t.posterImage,alt:t.title,fill:!0,priority:!0,className:"object-cover",sizes:"100vw"}),(0,i.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/40 to-transparent"}),(0,i.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 px-4 pb-4 space-y-3",children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-white leading-tight",children:t.title}),t.description&&(0,i.jsx)("p",{className:"text-sm text-white/70 line-clamp-2",children:t.description}),t.tags&&t.tags.length>0&&(0,i.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.tags.slice(0,4).map((e,t)=>(0,i.jsx)("span",{className:"px-2 py-0.5 bg-white/10 text-white/70 text-xs rounded-full",children:e},t))}),(0,i.jsx)(d.qI,{showId:t.id,nextFreeEpisode:R||v,onWatchNow:e=>{eY(e),O(!0)}})]})]}),(0,i.jsxs)("div",{className:"px-4 py-4",children:[(0,i.jsx)("h3",{className:"text-sm font-semibold text-white/80 mb-3",children:"Episodes"}),(0,i.jsx)(d.cC,{episodes:z,originalEpisodes:t.episodes,currentEpisodeId:null==R?void 0:R.id,onEpisodeSelect:e=>{eY(e),O(!0)}})]})]}),W&&(0,i.jsxs)("div",{className:"md:hidden fixed inset-0 z-[60] bg-black overflow-hidden",onTouchStart:e=>{let t=e.currentTarget;t.dataset.touchY=String(e.touches[0].clientY),t.dataset.swiping="false"},onTouchMove:e=>{let t=e.currentTarget,r=Number(t.dataset.touchY||0),i=e.touches[0].clientY-r,n=t.querySelector("[data-feed]");n&&Math.abs(i)>10&&(t.dataset.swiping="true",n.style.transition="none",n.style.transform="translateY(".concat(i,"px)"))},onTouchEnd:e=>{let t=e.currentTarget,r=Number(t.dataset.touchY||0)-e.changedTouches[0].clientY,i=t.querySelector("[data-feed]");if(Math.abs(r)>80){let e=[...z].sort((e,t)=>
1e.episodeNumber-t.episodeNumber),t=e.findIndex(e=>e.id===(null==R?void 0:R.id));if(r>0&&t<e.length-1){i&&(i.style.transition="transform 0.3s ease-out",i.style.transform="translateY(-100%)",setTimeout(()=>{eY(e[t+1].id),i&&(i.style.transition="none",i.style.transform="translateY(0)")},300));return}if(r<0&&t>0){i&&(i.style.transition="transform 0.3s ease-out",i.style.transform="translateY(100%)",setTimeout(()=>{eY(e[t-1].id),i&&(i.style.transition="none",i.style.transform="translateY(0)")},300));return}}i&&(i.style.transition="transform 0.2s ease-out",i.style.transform="translateY(0)")},children:[(0,i.jsx)("h1",{className:"sr-only","data-testid":"show-title",children:t.title}),(0,i.jsxs)("div",{className:"absolute top-0 left-0 right-0 z-30 flex items-center justify-between px-4 h-12 bg-gradient-to-b from-black/60 to-transparent transition-opacity duration-300",style:{opacity:+!!V,pointerEvents:V?"auto":"none"},"aria-hidden":!V,children:[(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsx)("button",{type:"button",onClick:()=>k.back(),className:"w-8 h-8 flex items-center justify-center","aria-label":"Go back",children:(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",children:(0,i.jsx)("path",{d:"m15 18-6-6 6-6"})})}),(0,i.jsx)("span",{className:"text-white font-outfit font-semibold text-sm truncate max-w-[180px]",children:t.title})]}),(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[(0,i.jsxs)("span",{className:"text-white/70 font-outfit text-sm",children:[(null==R?void 0:R.episodeNumber)||1,"/",z.length]}),(0,i.jsx)("button",{onClick:()=>X(!0),className:"w-8 h-8 flex items-center justify-center","aria-label":"Episode list",children:(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",children:(0,i.jsx)("path",{d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),(0,i.jsxs)("div",{className:"absolute inset-0","data-feed":!0,children:[(0,i.jsx)(l.default,{src:t.posterImage||t.coverImage,alt:"",fill:!0,className:"object-cover",sizes:"100vw",priority:!0}),R?(0,i.jsx)(d.xY,{ref:eS,show:t,episode:R,streamUrl:L?void 0:eE,className:"absolute inset-0 w-full h-full [&_[data-testid=video-player]]:!aspect-auto [&_[data-testid=video-player]]:!h-full [&_[data-testid=video-player]]:!max-h-none [&_[data-testid=video-player]]:!rounded-none [&_.vjs-tech]:!object-cover [&_.vjs-tech]:!h-full [&_.vjs-tech]:!max-h-none",hideOverlayControls:!1,onProgress:eV,onEnded:eq,autoPlay:!Q,totalEpisodes:z.length,onLockedClick:e=>{eY(e)},onControlsVisibilityChange:K}):(0,i.jsx)("div",{className:"relative w-full h-full",children:(0,i.jsx)(l.default,{src:t.coverImage||t.posterImage,alt:t.title,fill:!0,priority:!0,className:"object-cover",sizes:"100vw"})})]}),(0,i.jsxs)("button",{onClick:()=>X(!0),className:"absolute right-4 bottom-40 flex flex-col items-center gap-1.5 z-30 transition-opacity duration-300",style:{opacity:+!!V,pointerEvents:V?"auto":"none"},"aria-hidden":!V,tabIndex:V?void 0:-1,children:[(0,i.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"1.5",children:[(0,i.jsx)("rect",{x:"3",y:"3",width:"18",height:"14",rx:"2"}),(0,i.jsx)("path",{d:"M10 9l4 2.5-4 2.5V9z",fill:"white",stroke:"none"}),(0,i.jsx)("line",{x1:"3",y1:"20",x2:"21",y2:"20",strokeWidth:"2"})]}),(0,i.jsx)("span",{className:"text-white text-[13px] font-outfit font-semibold",children:"Episodes"})]}),(0,i.jsx)(d.x$,{isOpen:q,onClose:()=>X(!1),episodes:z,showTitle:t.title,currentEpisodeId:null==R?void 0:R.id,onEpisodeSelect:e=>{eY(e),X(!1)}})]}),(0,i.jsxs)("div",{className:"hidden md:block h-[calc(100vh-65px)] overflow-hidden bg-background",children:[(0,i.jsxs)("div",{className:"grid grid-cols-[7fr_3fr] h-full",children:[(0,i.jsxs)("div",{className:"relative flex items-center justify-center border-r border-white/20 overflow-hidden",style:{backgroundColor:"#000"},children:[(0,i.jsx)(c(),{href:"/",className:"absolute top-4 left-4 z-10 w-10 h-10 rounded-full bg-black/40 hover:bg-black/60 flex items-center justify-center transition-colors","aria-label":"Go back",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white",children:(0,i.jsx)("path",{d:"m15 18-6-6 6-6"})})}),H&&(0,i.jsx)(d.aF,{isOpen:H,onClose:()=>G(!1),posterImage:t.coverImage||t.posterImage,episodeNumber:null==R?void 0:R.episodeNumber}),!H&&(0,i.jsx)("div",{className:"relative h-full aspect-[9/16]",children:R?(0,i.jsx)(d.xY,{ref:eC,show:t,episode:R,streamUrl:L?eE:void 0,className:"w-full h-full overflow-hidden",onProgress:eV,onEnded:eq,autoPlay:!Q,hideOverlayControls:!1,totalEpisodes:z.length,onLockedClick:e=>{eY(e)}}):(0,i.jsxs)("div",{className:"relative w-full h-full",children:[(0,i.jsx)(l.default,{src:t.coverImage||t.posterImage,alt:t.title,fill:!0,priority:!0,className:"object-cover",sizes:"(min-width: 768px) 70vw, 100vw"}),(0,i.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-trans
1parent to-transparent"}),(0,i.jsx)(d.Uo,{show:t,episode:R,className:"absolute inset-x-0 bottom-0 p-6"})]})}),!H&&R&&(0,i.jsx)(d.SE,{episodes:z,showId:t.id,currentEpisodeId:R.id,onEpisodeChange:eY})]}),(0,i.jsxs)("aside",{className:"flex flex-col overflow-y-auto bg-background p-6 h-full",children:[eJ.length>0&&(0,i.jsx)("nav",{className:"flex items-center gap-2 text-sm mb-4 min-w-0","aria-label":"Breadcrumb",children:eJ.map((e,t)=>(0,i.jsxs)("span",{className:"flex min-w-0 shrink items-center gap-2",children:[t>0&&(0,i.jsx)("span",{className:"shrink-0 text-white/30",children:"/"}),e.href?(0,i.jsx)(c(),{href:e.href,className:"block max-w-[10rem] truncate text-white/70 transition-colors hover:text-white",title:e.label,children:e.label}):(0,i.jsx)("span",{className:"block max-w-[10rem] truncate text-white",title:e.label,children:e.label})]},t))}),(0,i.jsx)("div",{className:"mb-6",children:(0,i.jsx)(d.AZ,{show:t,currentEpisode:R})}),(0,i.jsx)("div",{className:"flex-1 min-h-0",children:(0,i.jsx)(d.cC,{episodes:z,originalEpisodes:t.episodes,currentEpisodeId:null==R?void 0:R.id,onEpisodeSelect:eY})})]})]}),(0,i.jsx)(d.Ok,{})]}),(0,i.jsx)("div",{className:"md:hidden",children:(0,i.jsx)(d.aF,{isOpen:H,onClose:()=>G(!1)})}),Y&&(0,i.jsx)(d.Af,{isLoading:et,onClose:()=>J(!1),onCheckEmail:ep,onSignIn:async(e,r)=>{var i;await eh(e,r),(0,x.K3)("info","paywall: returning user signed in",{area:"ooc-checkout",content_id:null!=(i=null==R?void 0:R.id)?i:t.id,show_id:t.id}),eg.current=e;try{window.localStorage.setItem("gamma-captured-email",e)}catch(e){}J(!1),Z(!0)},onSubmit:async(e,r)=>{var i,n,a;er(!0),(0,x.K3)("info","paywall: email submitted",{area:"ooc-checkout",content_id:null!=(i=null==R?void 0:R.id)?i:t.id,show_id:t.id,marketing_opt_in:r});try{eg.current=e;try{window.localStorage.setItem("gamma-captured-email",e)}catch(e){}try{let t=await ea();if(t){let i=(n="https://prod.api.gammatime.ai/api/v1",void 0!==n)?n:"https://dev.api.gammatime.ai/api/v1",l={facebookEmail:e,marketingOptIn:r,...(0,f.y4)()},s=await fetch("".concat(i,"/profile/defaults-web"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(l)});try{let e=(0,f.gz)();(0,x.K3)("info","attribution: defaults-web sent",{area:"attribution-send",caller:"email-capture",user_type:(0,C.x)()?"new":"returning",has_tracking_params:(0,f.my)(e),status:s.status,ok:s.ok,...(0,f.MB)(l),singular:JSON.stringify(null!=(a=null==e?void 0:e.singular)?a:{})})}catch(e){}}}catch(e){}(0,S.Yh)(e),J(!1),Z(!0)}catch(e){J(!1),Z(!0)}finally{er(!1)}}}),$&&ei.length>0&&(()=>{let e=!function(){let e=(0,_.yw)(),t=null==e?void 0:e.ab_test;if(!t)return!1;if("c3330f93-1c29-4cff-accb-f8c067cf72fb"===t.variant_id)return!0;let r=t.variant_label;return"string"==typeof r&&"C"===r.trim().toUpperCase()}()?d.qx:d.Vq;return(0,i.jsx)(e,{plans:ei,onClose:()=>Z(!1),onSelectPlan:async e=>{var r,i,n,a,l,s,o;let c=ei.find(t=>t.id===e);eA.current={id:e,name:null!=(r=null==c?void 0:c.name)?r:""},eb("InitiateCheckout",{screen_name:"subscription_modal",content_id:null!=(i=null==R?void 0:R.id)?i:t.id,episode_id:null==R?void 0:R.id,package_id:e,package_name:null==c?void 0:c.name,paywall_id:"ooc_web"});let d=window.open("about:blank","tebex_checkout","width=500,height=700"),u={area:"ooc-checkout",product_id:e,content_id:null!=(n=null==R?void 0:R.id)?n:t.id,show_id:t.id};if((0,x.K3)("info","checkout: popup opened",{...u,popup_blocked:!d}),!d){(0,x.K3)("warn","checkout: popup blocked",u),alert("Please allow pop-ups for this site to continue to checkout, then tap the plan again.");return}P(d,"loading"),(0,x.K3)("info","checkout: requesting token",u);let h=Date.now(),p=null;try{p=await ea()}catch(e){(0,x.K3)("error","checkout: token threw",{...u,token_ms:Date.now()-h,error:null!=(a=null==e?void 0:e.message)?a:String(e)}),P(d,"error");return}if(!p){(0,x.K3)("error","checkout: no server token",{...u,token_ms:Date.now()-h}),P(d,"error");return}(0,x.K3)("info","checkout: token acquired",{...u,token_ms:Date.now()-h});try{let r=(null==es?void 0:es.email)||eg.current||"",i="ooc_web_".concat(t.id,"_").concat(null!=(s=null==R?void 0:R.id)?s:"");(0,x.K3)("info","checkout: requesting url",{...u,has_email:!!r});let n=Date.now(),a=await fetch("/api/checkout/initiate-tebex",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({productId:e,email:r,location:i,seriesId:t.id,episodeId:null==R?void 0:R.id})}),o=Date.now()-n,c=a.ok?null==(l=await a.json())?void 0:l.checkoutUrl:void 0;c?((0,x.K3)("info","checkout: url received, redirecting",{...u,initiate_ms:o}),d.location.href=c):((0,x.K3)("error","checkout: no url in response",{...u,initiate_ms:o,status:a.status}),P(d,"error")),Z(!1),eI.current=!1,eL.current=!1,eP.current=!0,eM().catch(e=>{console.warn("[ShowPageClient] Subscription activation failed:",e)})}catch(e){console.warn("[ShowPageClient] Tebex checkout failed:",e),(0,x.K3)("error","checkout: initiate failed",{...u,error:null!=(o=null==e?void 0:e.message)?o:String(e),status:null==e?void 0:e.status}),P(d,"error"),Z(!1)}}})})(),Q&&(0,i.jsx)(d.Dm,{email:(null==es?void 0:es.email)||eg.current||"",onSetPassword:async(e,r)=>{await eu(e,r),(0,x.K3)("info","post-payment: password set",{area:"post-payment",series_id:t.id})},onContinueWithApp:async()=>{try{var e;let i=await ea();if(!i)throw Error("no server token");let{requestHandoffCode:n,buildHandoffDeepLink:a}=await r.e(2970).then(r.bind(r,82970)),{code:l}=await n(i),s=a(l,{seriesId:t.id,episodeId:null==(e=M.current)?void 0:e.id});(0,x.K3)("info","post-payment: continue with app",{area:"post-payment",series_id:t.id,handoff:!0,deeplink:s,handoff_code:l}),window.location.href=s}catch(e){(0,x.K3)("warn","post-payment: handoff code failed",{area:"post-payment",series_id:t.id,handoff:!1,error:e instanceof Error?e.message:String(e)}),window.location.href="/download"}},onClose:()=>{var e,t;ee(!1),eL.current=!0,null==(e=eC.current)||e.play(),null==(t=eS.current)||t.play()}})]})}},54590:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ShowNavigationArrows:()=>a});var i=r(95155),n=r(12115);function a(e){let{episodes:t,showId:r,currentEpisodeId:a,onEpisodeChange:l}=e,s=(0,n.useMemo)(()=>t.filter(e=>e.isFree).sort((e,t)=>
1e.episodeNumber-t.episodeNumber),[t]),o=(0,n.useMemo)(()=>a?s.findIndex(e=>e.id===a):-1,[s,a]),c=(0,n.useMemo)(()=>o>0?s[o-1]:null,[s,o]),d=(0,n.useMemo)(()=>o>=0&&o<s.length-1?s[o+1]:null,[s,o]),u=(0,n.useCallback)(()=>{c&&(l?l(c.id):window.location.href="/show/".concat(r,"/episode/").concat(c.id))},[r,c,l]),h=(0,n.useCallback)(()=>{d&&(l?l(d.id):window.location.href="/show/".concat(r,"/episode/").concat(d.id))},[r,d,l]);return 0===s.length?null:(0,i.jsxs)("div",{className:"absolute -right-20 top-1/2 -translate-y-1/2 z-10 flex flex-col gap-3",children:[(0,i.jsx)("button",{type:"button",onClick:u,disabled:!c,className:"flex h-14 w-14 items-center justify-center rounded-[50px] bg-white/[0.08] pl-[2.5px] text-white transition-all hover:bg-white/[0.12] hover:scale-105 disabled:cursor-not-allowed disabled:opacity-30","aria-label":"Previous episode",title:c?"Episode ".concat(c.episodeNumber):"No previous episode",children:(0,i.jsx)("span",{className:"text-xl",children:"â"})}),(0,i.jsx)("button",{type:"button",onClick:h,disabled:!d,className:"flex h-14 w-14 items-center justify-center rounded-[50px] bg-white/[0.08] pl-[2.5px] text-white transition-all hover:bg-white/[0.12] hover:scale-105 disabled:cursor-not-allowed disabled:opacity-30","aria-label":"Next episode",title:d?"Episode ".concat(d.episodeNumber):"No next episode",children:(0,i.jsx)("span",{className:"text-xl",children:"â"})})]})}},55554:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PlayPauseControl:()=>l});var i=r(95155),n=r(88563),a=r(34779);function l(e){let{isPlaying:t,onToggle:r,className:l=""}=e;return(0,i.jsx)("button",{type:"button",onClick:r,className:"flex h-12 w-12 items-center justify-center rounded-full bg-black/60 text-white backdrop-blur-sm transition-all hover:bg-black/80 hover:scale-105 ".concat(l),"aria-label":t?"Pause video":"Play video",title:t?"Pause":"Play",children:t?(0,i.jsx)(n.A,{className:"h-6 w-6"}):(0,i.jsx)(a.A,{className:"h-6 w-6"})})}},56364:(e,t,r)=>{"use strict";r.d(t,{x$:()=>N.AllEpisodesDrawer,Ok:()=>n.DownloadAppButton,u4:()=>a.DownloadDropdown,Af:()=>d.EmailCaptureModal,BQ:()=>s.MobileNavDrawer,aF:()=>c.PaidLimitScreen,Dm:()=>u.PostPaymentAccountModal,tN:()=>o.ProfileDropdown,cC:()=>j.ReelShortEpisodeGrid,AZ:()=>k.ReelShortShowInfo,g7:()=>f,Uo:()=>v.ShowHeroControls,xY:()=>b.ShowHeroPlayer,SE:()=>g.ShowNavigationArrows,QL:()=>w.ShowPageClient,cQ:()=>x.StreamPrefetch,Vq:()=>h.SubscriptionModal,qx:()=>p.SubscriptionModalLegacy,qI:()=>y.WatchNowButton}),r(30883);var i=r(95155);r(52619),r(49907),r(83957);var n=r(17314),a=r(75234);r(6811),r(78826),r(82458),r(87776),r(47440),r(83383),r(35796),r(38038),r(4387),r(78215),r(12115),r(86814);var l=r(87358);l.env.NEXT_PUBLIC_IOS_APP_URL,l.env.NEXT_PUBLIC_ANDROID_APP_URL,l.env.NEXT_PUBLIC_APP_DEEP_LINK,r(15239),r(19606);var s=r(87465);r(21185),r(60785),r(55554),r(76951),r(46166);var o=r(14191);r(95480),r(52419),r(59130);var c=r(22080),d=r(23238);r(67532);var u=r(52999),h=r(46369),p=r(14240);r(47453),r(32921);var m=r(68321);function f(e){let{data:t,id:r="json-ld"}=e;return(0,i.jsx)(m.default,{id:r,type:"application/ld+json",children:JSON.stringify(t)})}r(48910);var x=r(43188);r(3996),r(47400),r(29564);var v=r(1752),b=r(45333);r(41301);var g=r(54590);r(45228),r(14849),r(20717);var w=r(52483);r(83276),r(44689);var y=r(5594);r(6121),r(90091),r(45454);var j=r(10393),k=r(12909);r(91175);var N=r(32080)},57959:(e,t,r)=>{"use strict";r.d(t,{XW:()=>l,Yv:()=>u,e2:()=>s,yw:()=>d});var i=r(48921),n=r(31267),a=r(74595);function l(){return!0}function s(){return!0}let o=null,c=null;function d(){return c}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"web";return o||(o=(async()=>{await (0,i.P)();let t=null,r=!1;try{let i=await fetch("/api/ooc-config?platform=".concat(e),{headers:{Accept:"application/json"}});i.ok?t=await i.json():r=!0}catch(e){t=null,r=!0}return r?(o=null,null):(c=t,t&&function(e){var t,r,i,l,s,o,c,d,u,h,p,m,f,x,v,b,g,w,y,j;let k=(null!=(j=null==e?void 0:e.popup_chain)?j:[]).flatMap(e=>{var t;return null!=(t=e.data)?t:[]}).map(e=>{var t;return null!=(t=null==e?void 0:e.product_id)?t:null==e?void 0:e.tebex_product_id}
1).filter(Boolean).map(String),N=k.map(e=>"string"==typeof e?e:"").join(","),E=(null!=(i=null==e?void 0:e.popup_chain)?i:[]).map(e=>{var t;return String(null!=(t=e.popup_type)?t:"")}).filter(Boolean).join(","),_=null!=(l=null==e||null==(t=e.matched_segment)?void 0:t.id)?l:"",C=null!=(s=null==e||null==(r=e.matched_segment)?void 0:r.name)?s:"";if(!(null==e?void 0:e.ab_test))return(0,a.K3)("info","ooc: config resolved, no ab test",{area:"ooc-ab",rule_id:null!=(o=null==e?void 0:e.rule_id)?o:"",segment_id:_,segment_name:C,config_platform:null!=(c=null==e?void 0:e.platform)?c:"web",config_user_id:null!=(d=null==e?void 0:e.user_id)?d:"",product_ids:N,product_count:k.length,popup_types:E});let S=e.ab_test;if(!0!==S.first_exposure)return void 0===S.first_exposure?(0,a.K3)("warn","ooc: first_exposure flag missing â suppressed event, check deploy order",{area:"ooc-ab",experiment_id:S.experiment_id,test_id:S.test_id,variant_label:S.variant_label,variant_id:S.variant_id,is_control:S.is_control,rule_id:null!=(u=e.rule_id)?u:"",segment_id:_,segment_name:C,config_platform:null!=(h=e.platform)?h:"web",config_user_id:null!=(p=e.user_id)?p:"",popup_types:E,product_ids:N,product_count:k.length}):(0,a.K3)("info","ooc: ab variant assigned (repeat exposure, suppressed)",{area:"ooc-ab",experiment_id:S.experiment_id,test_id:S.test_id,test_name:S.test_name,variant_label:S.variant_label,variant_id:S.variant_id,is_control:S.is_control,rule_id:null!=(m=e.rule_id)?m:"",segment_id:_,segment_name:C,config_platform:null!=(f=e.platform)?f:"web",config_user_id:null!=(x=e.user_id)?x:"",popup_types:E,product_ids:N,product_count:k.length});(0,n.fO)({experiment_id:S.experiment_id,variant_label:S.variant_label,is_control:S.is_control,test_id:S.test_id,variant_id:S.variant_id,rule_id:null!=(v=e.rule_id)?v:"",segment_id:_,segment_name:C,product_ids:N,product_count:k.length,popup_types:E,config_platform:null!=(b=e.platform)?b:"web"}),(0,a.K3)("info","ooc: ab variant assigned",{area:"ooc-ab",experiment_id:S.experiment_id,test_id:S.test_id,test_name:S.test_name,variant_label:S.variant_label,variant_id:S.variant_id,is_control:S.is_control,rule_id:null!=(g=e.rule_id)?g:"",segment_id:_,segment_name:C,config_platform:null!=(w=e.platform)?w:"web",config_user_id:null!=(y=e.user_id)?y:"",popup_types:E,product_ids:N,product_count:k.length})}(t),t)})())}},59130:(e,t,r)=>{"use strict";r.r(t),r.d(t,{GetAppPopup:()=>h});var i,n,a=r(95155),l=r(12115),s=r(47650),o=r(41429),c=r(87358);let d=null!=(i=c.env.NEXT_PUBLIC_IOS_STORE_URL)?i:"https://apps.apple.com/us/app/gamma-time/id6504227709",u=null!=(n=c.env.NEXT_PUBLIC_ANDROID_STORE_URL)?n:"https://play.google.com/store/apps/details?id=com.gamma.gamma.prod";function h(e){var t;let{isOpen:r,onClose:i,title:n="Get the app to continue the show",subtitle:c="Explore all Truecrime shows and episodes.",primaryButtonText:h="Open the app",dismissButtonText:p="Not now",deepLinkUrl:m}=e,f=(0,l.useRef)(null),x=(0,l.useRef)(null),v=(0,l.useCallback)(()=>{let e=null!=m?m:function(){if("undefined"==typeof navigator)return d;let e=navigator.userAgent;return/Android/i.test(e)?u:d}();"#"!==e&&window.open(e,"_blank","noopener,noreferrer")},[m]),b=(0,l.useCallback)(()=>{i()},[i]);if((0,l.useEffect)(()=>{if("undefined"==typeof document||!r)return;x.current=document.activeElement,document.body.style.overflow="hidden";let e=()=>{var e;let t=null==(e=f.current)?void 0:e.querySelector('[data-primary-action="true"]');if(t)return t.focus({preventScroll:!0}),!0;let r=(0,o.iq)(f.current);return r.length>0&&(r[0].focus({preventScroll:!0}),!0)};e()||window.setTimeout(()=>{if(!e()){var t;null==(t=f.current)||t.focus({preventScroll:!0})}},0);let t=e=>{if("Escape"===e.key)e.stopPropagation(),b();else if("Tab"===e.key){let r=(0,o.iq)(f.current);if(0===r.length){var t;e.preventDefault(),null==(t=f.current)||t.focus({preventScroll:!0});return}let i=document.activeElement,n=r.indexOf(i),a=r.length-1;if(-1===n){e.preventDefault();let t=e.shiftKey?r[a]:r[0];null==t||t.focus({preventScroll:!0});return}e.shiftKey?n<=0&&(r[a].focus({preventScroll:!0}),e.preventDefault()):n===a&&(r[0].focus({preventScroll:!0}),e.preventDefault())}};return document.addEventListener("keydown",t,!0),()=>{var e;document.removeEventListener("keydown",t,!0),document.body.style.overflow="",null==(e=x.current)||e.focus({preventScroll:!0})}},[r,b]),!r)return null;let g=(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center bg-black/70",onClick:b,role:"presentation","data-testid":"get-app-popup-overlay",children:(0,a.jsxs)("div",{ref:f,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,onClick:e=>e.stopPropagation(),className:"w-full animate-slide-up focus-visible:outline-none","data-testid":"get-app-popup",style:{backgroundColor:"#181818",borderTopLeftRadius:"24px",borderTopRightRadius:"24px"},children:[(0,a.jsx)("div",{className:"flex justify-center pt-3 pb-2",children:(0,a.jsx)("div",{className:"h-1 w-10 rounded-full",style:{backgroundColor:"#4D4D4D"},"aria-hidden":"true"})}),(0,a.jsxs)("div",{className:"flex flex-col items-center px-6 pb-8 pt-4",children:[(0,a.jsx)("h2",{className:"text-white text-center",style:{fontFamily:"var(--font-outfit, sans-serif)",fontWeight:600,fontSize:"22px",lineHeight:"100%",letterSpacing:"0.1px"},children:n}),(0,a.jsx)("p",{className:"mt-3 text-center",style:{fontFamily:"var(--font-outfit, sans-serif)",fontWeight:400,fontSize:"15px",lineHeight:"100%",letterSpacing:"0.1px",color:"#A3A3A3"},children:c}),(0,a.jsx)("button",{type:"button",onClick:v,"data-primary-action":"true","data-testid":"get-app-popup-open-app",className:"mt-8 flex items-center justify-center transition-transform hover:scale-[1.02] active:scale-[0.98] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white",style:{width:"345px",maxWidth:"calc(100% - 48px)",height:"56px",borderRadius:"16px",backgroundColor:"#FFFFFF",color:"#000000",fontFamily:"var(--font-outfit, sans-serif)",fontWeight:600,fontSize:"16px",padding:"16px"},children:h}),(0,a.jsx)("button",{type:"button",onClick:b,"data-testid":"get-app-popup-dismiss",className:"mt-4 flex items-center justify-center transition-transform hover:scale-[1.02] active:scale-[0.98] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500",style:{width:"345px",maxWidth:"calc(100% - 48px)",height:"56px",borderRadius:"16px",backgroundColor:"#262626",color:"#FFFFFF",fontFamily:"var(--font-outfit, sans-serif)",fontWeight:500,fontSize:"16px",padding:"16px"},children:p})]})]})});if("undefined"==typeof document)return g;let w=null!=(t=document.getElementById("modal-root"))?t:document.body;return(0,s.createPortal)(g,w)}},60785:(e,t,r)=>{"use strict";r.d(t,{r:()=>o});var i=r(95155),n=r(52619),a=r.n(n),l=r(86814),s=r(7e3);function o(e){let{episode:t,showId:r,loading:n=!1,isPrefetched:o=!1,onEpisodeSelect:c}=e;return n?(0,i.jsxs)("div",{className:"flex flex-col gap-3 rounded-xl border border-base-300 bg-base-200/40 p-6 shadow-soft",children:[(0,i.jsx)(l.EA,{className:"h-6 w-20 rounded-full"}),(0,i.jsx)(l.EA,{className:"h-4 w-48"}),(0,i.jsx)(l.EA,{className:"h-4 w-full"}),(0,i.jsx)(l.EA,{className:"h-10 w-32"})]}):t?(0,i.jsxs)("div",{className:"flex flex-col gap-3 rounded-xl border border-base-300/50 bg-base-200/60 p-6 shadow-soft backdrop-blur-sm transition-all hover:border-base-300 hover:shadow-lg md:flex-row md:items-center md:justify-between md:p-7",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)(l.Ex,{variant:"accent",children:"Next up"}),o&&(0,i.jsx)(l.Ex,{className:"border border-accent/40 bg-transparent text-accent-content",children:"Prefetched"})]}),(0,i.jsxs)("div",{className:"text-xs font-medium text-base-content/65",children:[(0,s.PI)(t)," ⢠",(0,s.a3)(t.duration)]}),(0,i.jsx)("h3",{className:"text-lg font-semibold text-base-content leading-tight",children:t.title})]}),c?(0,i.jsx)("button",{type:"button",onClick:()=>c(t.id),className:"inline-flex items-center rounded-full bg-primary px-5 py-2.5 text-sm font-semibold text-primary-content shadow-md transition-all hover:scale-105 hover:bg-primary/90 hover:shadow-lg",children:"Keep watching"}):(0,i.jsx)(a(),{href:"/show/".concat(r,"/episode/").concat(t.id),className:"inline-flex items-center rounded-full bg-primary px-5 py-2.5 text-sm font-semibold text-primary-content shadow-md transition-all hover:scale-105 hover:bg-primary/90 hover:shadow-lg",children:"Keep watching"})]}):(0,i.jsx)("div",{className:"rounded-xl border border-base-300 bg-base-200/40 p-6 text-sm text-base-content/60 shadow-soft",children:"More episodes coming soon."})}},65151:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AIImage:()=>c});var i=r(95155),n=r(15239),a=r(12115),l=r(85457),s=r(87358);let o={width:1024,height:1024,model:"flux",nologo:!0,enhance:!1};function c(e){let{prompt:t,fallbackSrc:r,options:c,alt:d,...u}=e,h="true"!==s.env.NEXT_PUBLIC_GAMMATIME_DISABLE_AI_IMAGES&&t.trim().length>0,p=(0,a.useMemo)(()=>{var e,t,r,i,n;let a=null==c?void 0:c.seed,l={width:null!=(e=null==c?void 0:c.width)?e:o.width,height:null!=(t=null==c?void 0:c.height)?t:o.height,model:null!=(r=null==c?void 0:c.model)?r:o.model,nologo:null!=(i=null==c?void 0:c.nologo)?i:o.nologo,enhance:null!=(n=null==c?void 0:c.enhance)?n:o.enhance};return"number"==typeof a&&Number.isFinite(a)&&(l.seed=a),l},[c]),m=(0,l.A)(t,p),f=h?m:r;return f?(0,i.jsx)(n.default,{...u,alt:d,src:f}):null}},73651:(e,t,r)=>{"use strict";r.d(t,{y:()=>s});var i=r(95155),n=r(41429);let a={info:"bg-info/10 text-info",success:"bg-success/10 text-success",warning:"bg-warning/10 text-warning",error:"bg-white/20 backdrop-blur-md text-red-500 border-transparent"}
1,l={info:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.75"}),(0,i.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:"12",cy:"7.5",r:"1.2",fill:"currentColor"})]}),success:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.75"}),(0,i.jsx)("path",{d:"M9.25 12.5L11 14.25L14.75 10.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",children:[(0,i.jsx)("path",{d:"M11.02 4.52L3.68 17.31C3.21 18.12 3.79 19.12 4.72 19.12H19.28C20.21 19.12 20.79 18.12 20.32 17.31L12.98 4.52C12.52 3.73 11.48 3.73 11.02 4.52Z",stroke:"currentColor",strokeWidth:"1.75",strokeLinejoin:"round"}),(0,i.jsx)("line",{x1:"12",y1:"10",x2:"12",y2:"14.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"}),(0,i.jsx)("circle",{cx:"12",cy:"17.2",r:"1.1",fill:"currentColor"})]}),error:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"1.75"}),(0,i.jsx)("path",{d:"M9.5 9.5L14.5 14.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"}),(0,i.jsx)("path",{d:"M14.5 9.5L9.5 14.5",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round"})]})};function s(e){let{className:t,variant:r="info",title:s,description:o,children:c,icon:d,onDismiss:u,dismissLabel:h="Dismiss notification",...p}=e,m=null!=d?d:l[r];return(0,i.jsxs)("div",{className:(0,n.cx)("flex flex-col gap-4 roun
1ded-2xl border border-base-300 px-4 py-4 shadow-soft",a[r],t),role:"status","aria-live":"error"===r?"assertive":"polite",...p,children:[(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[m&&(0,i.jsx)("span",{"aria-hidden":"true",className:"mt-0.5 inline-flex flex-shrink-0 items-center justify-center text-current",children:m}),(0,i.jsxs)("div",{className:"flex flex-1 flex-col gap-2",children:[s&&(0,i.jsx)("span",{className:"text-xs font-semibold uppercase tracking-[0.35em]",children:s}),o&&(0,i.jsx)("p",{className:(0,n.cx)("text-sm","error"===r?"text-current":"text-base-content/80"),children:o}),c]})]}),u&&"error"!==r&&(0,i.jsx)("button",{type:"button",onClick:u,className:"self-end text-xs font-medium uppercase tracking-[0.25em] text-base-content/70 underline-offset-4 hover:text-base-content",children:h})]})}},75234:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DownloadDropdown:()=>h});var i,n,a=r(95155),l=r(12115),s=r(12834),o=r(40373),c=r(87358);let d=null!=(i=c.env.NEXT_PUBLIC_IOS_STORE_URL)?i:"https://apps.apple.com/us/app/gamma-time/id6504227709",u=null!=(n=c.env.NEXT_PUBLIC_ANDROID_STORE_URL)?n:"https://play.google.com/store/apps/details?id=com.gamma.gamma.prod";function h(){let[e,t]=(0,l.useState)(!1),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{function e(e){r.current&&!r.current.contains(e.target)&&t(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,a.jsxs)("div",{className:"relative",ref:r,children:[(0,a.jsx)("button",{type:"button",onClick:()=>t(!e),className:"hidden font-outfit text-[15px] font-medium text-white/80 transition-colors hover:text-white md:inline-flex","aria-expanded":e,"aria-haspopup":"true",children:"Download"}),e&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-2 origin-top-right rounded-xl border border-base-300/50 bg-base-200 p-5 shadow-hard",style:{width:"280px"},children:[(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)("div",{className:"flex items-center justify-center rounded-xl bg-white p-3",style:{width:"160px",height:"160px"},children:(0,a.jsx)(s.h,{value:o.Fz,size:134,level:"M",bgColor:"#ffffff",fgColor:"#000000",title:"QR code to download Gamma Time app",imageSettings:{src:"/images/branding/gamma-app-icon.png",height:28,width:28,excavate:!0}})}),(0,a.jsx)("p",{className:"mt-3 text-center font-outfit text-sm font-medium text-white",children:"Scan to download"}),(0,a.jsx)("p",{className:"mt-1 text-center font-outfit text-xs text-white/50",children:"Point your camera at the QR code"})]}),(0,a.jsx)("div",{className:"my-4 border-t border-base-300/50"}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"text-white/60 transition-colors hover:text-white","aria-label":"Download on Google Play",onClick:()=>t(!1),children:(0,a.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M3.18 1.18L14.66 12 3.18 22.82C2.84 22.5 2.63 22.02 2.63 21.46V2.54c0-.56.21-1.04.55-1.36zm1.37-.62l12.84 7.3-2.94 2.94L3.73.27c.22-.08.51-.02.82.29zm0 22.88c-.31.31-.6.37-.82.29l10.72-10.63 2.94 2.94-12.84 7.4zm14.49-8.24l-3.19-1.82L12.91 12l2.94-2.94 3.19 1.82c.88.5 1.34 1.16 1.34 1.82s-.46 1.32-1.34 1.82z"})})}),(0,a.jsx)("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-white/60 transition-colors hover:text-white","aria-label":"Download on App Store",onClick:()=>t(!1),children:(0,a.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.8-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})})})]}),(0,a.jsx)("p",{className:"font-outfit text-xs text-white/50",children:"Download on iOS or Android"})]})]})]})}},76951:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Player:()=>j,markUserStartedPlayback:()=>b});var i=r(95155);r(69698);var n=r(15239),a=r(12115),l=r(40370),s=r(86814),o=r(41429);function c(e){if(e.startsWith("data:")||e.startsWith("/")||e.startsWith(window.location.origin))return e;let t=encodeURIComponent(e);return"/api/image-proxy?url=".concat(t)}r(88633);var d=r(21512);function u(e){let{onPrevious:t,onNext:r,hasPrevious:n,hasNext:a,currentEpisodeIndex:l,totalEpisodes:s}=e;return(0,i.jsxs)("div",{className:"flex flex-col gap-3 items-center",role:"navigation","aria-label":"Episode navigation",children:[(0,i.jsx)("button",{onClick:t,disabled:!n,className:(0,o.cx
1)("flex items-center justify-center rounded-full","bg-black/60 backdrop-blur-sm","transition-all duration-200","w-11 h-11","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60",n?"hover:bg-black/80 hover:scale-110 active:scale-95 cursor-pointer":"opacity-40 cursor-not-allowed"),"aria-label":"Previous episode",type:"button",children:(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-5 h-5","aria-hidden":"true",children:(0,i.jsx)("polyline",{points:"18 15 12 9 6 15"})})}),"number"==typeof l&&"number"==typeof s&&(0,i.jsx)("div",{className:"flex flex-col gap-1 items-center py-2","aria-label":"Episode ".concat(l+1," of ").concat(s),children:Array.from({length:Math.min(s,5)}).map((e,t)=>{let r=t===l;return s<=5||0===t||t===s-1||1>=Math.abs(t-l)?(0,i.jsx)("div",{className:(0,o.cx)("rounded-full transition-all duration-200",r?"w-2 h-2 bg-white":"w-1.5 h-1.5 bg-white/50"),"aria-hidden":"true"},t):null})}),(0,i.jsx)("button",{onClick:r,disabled:!a,className:(0,o.cx)("flex items-center justify-center rounded-full","bg-black/60 backdrop-blur-sm","transition-all duration-200","w-11 h-11","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60",a?"hover:bg-black/80 hover:scale-110 active:scale-95 cursor-pointer":"opacity-40 cursor-not-allowed"),"aria-label":"Next episode",type:"button",children:(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-5 h-5","aria-hidden":"true",children:(0,i.jsx)("polyline",{points:"6 9 12 15 18 9"})})})]})}function h(e){if(!Number.isFinite(e)||e<0)return"0:00";let t=Math.floor(e/60),r=Math.floor(e%60);return"".concat(t,":").concat(r.toString().padStart(2,"0"))}function p(e){let{isPlaying:t,currentTime:r,duration:n,onPlayPause:l,show:s=!0,onInteraction:c,episodeNavigation:d,alwaysShowControls:p=!1,onMuteToggle:m,onFullscreenToggle:f,isMuted:x=!1,isFullscreen:v=!1,hideOverlayControls:b=!1,onSeek:g,onControlsVisibilityChange:w}=e,[y,j]=(0,a.useState)(s),k=n>0?Math.min(100,r/n*100):0,N=(0,a.useRef)(null),E=(0,a.useCallback)(()=>{N.current&&clearTimeout(N.current),p||(N.current=setTimeout(()=>{t&&j(!1)},3e3))},[p,t]),_=(0,a.useCallback)(()=>{null==c||c(),p||j(e=>{let r=!e;return r&&t&&E(),r})},[p,c,t,E]),C=(0,a.useCallback)(()=>{l()},[l]),S=(0,a.useRef)(null),[I,P]=(0,a.useState)(!1),[T,L]=(0,a.useState)(null),A=(0,a.useCallback)(e=>{let t=S.current;if(!t||n<=0)return;let r=t.getBoundingClientRect();return Math.max(0,Math.min(1,(e-r.left)/r.width))*n},[n]),R=(0,a.useCallback)(e=>{if(!g||n<=0)return;e.stopPropagation(),e.preventDefault();let t=S.current;t&&t.setPointerCapture(e.pointerId);let r=A(e.clientX);if(void 0===r)return;let i=r/n*100;P(!0),L(i),M.current=i},[g,n,A]),F=(0,a.useCallback)(e=>{if(!I||n<=0)return;e.stopPropagation(),e.preventDefault();let t=A(e.clientX);if(void 0===t)return;let r=t/n*100;L(r),M.current=r},[I,n,A]),M=(0,a.useRef)(0),z=(0,a.useCallback)(e=>{if(!I)return;e.stopPropagation(),e.preventDefault();let t=A(e.clientX);P(!1),L(null),void 0!==t&&g&&g(t)},[I,g,A]),D=(0,a.useCallback)(()=>{if(!I)return;let e=M.current/100*n;P(!1),L(null),Number.isFinite(e)&&e>=0&&g&&g(e)},[I,g,n]),U=null!==T?T:k;(0,a.useEffect)(()=>{j(s)},[s]),(0,a.useEffect)(()=>{(!t||p)&&j(!0)},[t,p]);let B=(0,a.useCallback)(()=>{null==c||c(),j(!0),E()},[c,E]),W=y||p||!t;return(0,a.useEffect)(()=>{null==w||w(W)},[W,w]),(0,i.jsxs)("div",{className:(0,o.cx)("absolute inset-0 z-10 transition-opacity duration-300",W?"opacity-100":"opacity-0"),onClick:_,onMouseMove:t?B:void 0,"aria-hidden":!W,children:[d&&(0,i.jsx)("div",{className:"absolute right-4 top-1/2 -translate-y-1/2",children:(0,i.jsx)(u,{...d})}),!b&&!t&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:(0,i.jsx)("button",{onClick:e=>{e.stopPropagation(),C()},className:(0,o.cx)("pointer-events-auto flex items-center justify-center rounded-full","h-20 w-20 bg-black/50 backdrop-blur-sm","transition-all duration-200","hover:bg-black/60 hover:scale-105 active:scale-95","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60"),"aria-label":"Play video",type:"button",children:(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"white",className:"h-10 w-10 ml-1","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M8 5v14l11-7z"})})})}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0",style:{background:"linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0) 100%)"},onClick:e=>e.stopPropagation(),children:(0,i.jsx)("div",{className:"px-4 pb-4 pt-8 md:px-6 md:pb-6",children:(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsxs)("div",{ref:S,className:(0,o.cx
1)("relative h-8 flex items-center touch-none select-none",g&&n>0&&"cursor-pointer"),onPointerDown:R,onPointerMove:F,onPointerUp:z,onPointerCancel:D,role:"slider","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":n,"aria-label":"Video progress - drag or tap to seek",tabIndex:g&&n>0?0:-1,onKeyDown:e=>{g&&!(n<=0)&&("ArrowLeft"===e.key?(e.preventDefault(),g(Math.max(0,r-10))):"ArrowRight"===e.key&&(e.preventDefault(),g(Math.min(n,r+10))))},children:[(0,i.jsx)("div",{className:(0,o.cx)("absolute left-0 right-0 rounded-full bg-white/30",I?"h-1.5":"h-1"),children:(0,i.jsx)("div",{className:"absolute left-0 top-0 h-full bg-white rounded-full",style:{width:"".concat(U,"%")}})}),g&&n>0&&(0,i.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 pointer-events-none",style:{left:"".concat(U,"%")},children:(0,i.jsx)("div",{className:(0,o.cx)("rounded-full bg-white shadow-md",I?"w-4 h-4":"w-3 h-3")})})]}),(0,i.jsxs)("div",{className:"flex items-center justify-between text-sm text-white/90 mb-2",children:[(0,i.jsx)("span",{children:h(r)}),(0,i.jsx)("span",{children:h(n)})]}),!b&&(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("button",{onClick:C,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),C())},className:(0,o.cx)("flex items-center justify-center rounded-full","bg-white/[0.08]","transition-all duration-200","hover:bg-white/[0.12] hover:scale-105 active:bg-white/[0.16]","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60","h-14 w-14"),"aria-label":t?"Pause video":"Play video",type:"button",children:t?(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-7 w-7","aria-hidden":"true",children:[(0,i.jsx)("rect",{x:"6",y:"4",width:"4",height:"16",fill:"white",rx:"1"}),(0,i.jsx)("rect",{x:"14",y:"4",width:"4",height:"16",fill:"white",rx:"1"})]}):(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"white",className:"h-7 w-7 ml-0.5","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M8 5v14l11-7z"})})}),(0,i.jsxs)("div",{className:"flex items-center gap-3",children:[m&&(0,i.jsx)("button",{onClick:m,className:(0,o.cx)("flex items-center justify-center","h-14 w-14 rounded-full","bg-white/[0.08] text-white","hover:bg-white/[0.12] hover:scale-105 active:bg-white/[0.16]","transition-all duration-200","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60"),"aria-label":x?"Unmute":"Mute",type:"button",children:x?(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z",fill:"white"})}):(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z",fill:"white"})})}),f&&(0,i.jsx)("button",{onClick:f,className:(0,o.cx)("flex items-center justify-center","h-14 w-14 rounded-full","bg-white/[0.08] text-white","hover:bg-white/[0.12] hover:scale-105 active:bg-white/[0.16]","transition-all duration-200","focus:outline-none focus-visible:ring-4 focus-visible:ring-white/60"),"aria-label":v?"Exit fullscreen":"Enter fullscreen",type:"button",children:v?(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z",fill:"white"})}):(0,i.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",className:"h-6 w-6","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z",fill:"white"})})})]})]})]})})})]})}var m=r(59130);let f="__off__";function x(e){try{let t=e.play();t&&"function"==typeof t.catch&&t.catch(e=>{var t;let r=null==e?void 0:e.name,i=null!=(t=null==e?void 0:e.message)?t:"";if(!("AbortError"===r||/interrupted by a call to pause\(\)|operation was aborted/i.test(i)))throw e})}catch(e){}}let v=!1;function b(){v=!0}function g(e){return"".concat("gammatime:captions",":").concat(e)}function w(e,t){if(e)try{let r=g(e);t?window.sessionStorage.setItem(r,t):window.sessionStorage.removeItem(r)}catch(e){}}function y(){return"undefined"!=typeof performance?performance.now():Date.now()}let j=(0,a.forwardRef)(function(e,t){let{title:r,subtitle:u,posterImage:h,posterPrompt:b,streamUrl:j,isFree:k,isLoading:N=!1,resumeTime:E,onProgress:_,onEnded:C,pipEnabled:S=!0,videoId:I,streamFallback:P,mediaSession:T,captions:L=[],showId:A,episodeNavigation:R,showNativeControls:F,aspectRatio:M="landscape",autoPlay:z=!1,hideOverlayControls:D=!1,onEpisodesClick:U,onControlsVisibilityChange:B}=e,W=null!=F?F:!R,O=(0,a.useRef)(null),V=(0,a.useRef)(null),K=(0,a.useRef)(null),H=(0,a.useRef)(!1),G=(0,a.useRef)(0),q=(0,a.useRef)(null),X=(0,a.useRef)(!1),Y=(0,a.useRef)(!1),J=(0,a.useRef)(!1),$=(0,a.useRef)(null),Z=(0,a.useRef)(!1),Q=(0,a.useRef)({start:null,count:0,total:0}),ee=(0,a.useRef)(!1),et=(0,a.useRef)([]),er=(0,a.useRef)(!1),ei=(0,a.useRef)(null),en=(0,a.useRef)(I),ea=(0,a.useRef)(!1),el=(0,a.useRef)(_),es=(0,a.useRef)(C),eo=(0,a.useRef)(()=>{}),ec=(0,a.useRef)(()=>{}),[ed,eu]=(0,a.useState)(!1),[eh,ep]=(0,a.useState)(!1),[em,ef]=(0,a.useState)(!1),[ex,ev]=(0,a.useState)(),[eb,eg]=(0,a.useState)(!1),[ew,ey]=(0,a.useState)(!1),[ej,ek]=(0,a.useState)(0),[eN,eE]=(0,a.useState)(0),[e_,eC]=(0,a.useState)(!1),[eS,eI]=(0,a.useState)(!1),[eP,eT]=(0,a.useState)(!0),eL=(0,a.useRef)(B);(0,a.useEffect)(()=>{eL.current=B},[B]);let eA=(0,a.useCallback)(e=>{var t;eT(e),null==(t=eL.current)||t.call(eL,e)},[]),[eR,eF]=(0,a.useState)(!1);(0,a.useEffect)(()=>{el.current=_},[_]),(0,a.useEffect)(()=>{es.current=C},[C]),(0,a.useEffect)(()=>{eF(S&&"undefined"!=typeof document&&!!document.pictureInPictureEnabled)},[S]),(0,a.useEffect)(()=>{let e=()=>{var e;eI(!!(null!=(e=document.fullscreenElement)?e:document.webkitFullscreenElement))};return document.addEventListener("fullscreenchange",e),document.addEventListener("webkitfullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e),document.removeEventListener("webkitfullscreenchange",e)}},[]);let eM=(0,a.useCallback)(e=>{let t=V.current;if(!t||"function"!=typeof t.currentTime)return;let r=Number(t.currentTime());if(!Number.isFinite(r))return;let i="function"==typeof t.duration?Number(t.duration()):void 0,n=void 0!==i&&Number.isFinite(i)?i:void 0,a=Math.max(0,r+e),l=void 0!==n?Math.min(n,a):a;Number.isFinite(l)&&t.currentTime(l)},[]),ez=(0,a.useCallback)((e,t)=>{},[]),eD=(0,a.useCallback)((e,t)=>{var r,i,n;if(!e||(null==(r=e.isDisposed)?void 0:r.call(e)))return;let a=e.controlBar;if(!a||"function"!=typeof a.getChild||!a.childNameIndex_)return;let l=a.getChild("SubsCapsButton"),s=null==l||null==(i=l.el)?void 0:i.call(l);s&&(s.setAttribute("aria-label","Captions"),s.setAttribute("title","Captions"),s.setAttribute("tabindex",t?"0":"-1"),t?s.removeAttribute("aria-disabled"):(s.setAttribute("aria-disabled","true"),null==(n=s.blur)||n.call(s)))},[]),eU=(0,a.useCallback)(()=>{var e,t;if(!k||!V.current)return;let r=et.current;if(!r.length){ei.current=null;return}let i=function(e){if(!e)return null;try{return window.sessionStorage.getItem(g(e))}catch(e){return null}}(A);
1if(i===f){er.current=!0,r.forEach(e=>{let{track:t}=e;t.mode="disabled"}),er.current=!1,ei.current=null;return}let n=i?r.find(e=>{let{caption:t}=e;return t.language===i}):void 0,a=r.find(e=>{let{caption:t}=e;return t.isDefault}),l=r[0],s=null!=(t=null!=(e=null!=n?n:a)?e:l)?t:null;er.current=!0,r.forEach(e=>{let{track:t}=e;t.mode=s&&t===s.track?"showing":"disabled"}),er.current=!1,ei.current=s?s.track:null,s?w(A,s.caption.language):w(A,null)},[k,A]),eB=(0,a.useMemo)(()=>k&&!!T,[k,T]),eW=(0,a.useMemo)(()=>{if(eB&&T)return T.metadata},[eB,T]),eO=(0,a.useMemo)(()=>{if(eB&&T)return{nexttrack:()=>{var e;null==(e=T.onNextTrack)||e.call(T)},previoustrack:()=>{var e;null==(e=T.onPreviousTrack)||e.call(T)},seekbackward:()=>{eM(-5)},seekforward:()=>{eM(10)}}},[eB,T,eM]);(0,d.qs)(eW,eO);let eV=(0,a.useCallback)(()=>{if(ee.current)return;ee.current=!0;let{count:e,total:t}=Q.current;(e>0||t>0)&&ez("buffer_summary",{rebufferCount:e,totalBufferMs:Math.round(t)})},[ez]);(0,a.useEffect)(()=>{eo.current=ez},[ez]),(0,a.useEffect)(()=>{ec.current=eV},[eV]);let eK=(0,a.useCallback)(()=>{q.current=y(),X.current=!1,Y.current=!1,$.current=null,Q.current={start:null,count:0,total:0},ee.current=!1},[]),eH=(0,a.useCallback)(e=>{O.current=e},[]);(0,a.useCallback)(async()=>{if(!eR)return;let e=V.current,t=null==e?void 0:e.tech(!0),r=null==t?void 0:t.el();if(r)try{document.pictureInPictureElement&&document.pictureInPictureElement===r?await document.exitPictureInPicture():await r.requestPictureInPicture()}catch(e){}},[eR]);let eG=(0,a.useCallback)(()=>{let e=V.current;if(!e){ea.current=!0;return}e.paused()?x(e):e.pause()},[]),eq=(0,a.useCallback)(()=>{let e=V.current;if(!e||"function"!=typeof e.muted)return;let t=e.muted();e.muted(!t),eC(!t)},[]),eX=(0,a.useCallback)(()=>{var e,t,r;let i=V.current;if(i)if(null!=(e=document.fullscreenElement)?e:document.webkitFullscreenElement)if(document.exitFullscreen)document.exitFullscreen();else{let e=document;null==(r=e.webkitExitFullscreen)||r.call(e)}else{let e=null!=(t=K.current)?t:i.el(),r=()=>{};if(null==e?void 0:e.requestFullscreen)return void e.requestFullscreen().catch(r);if(null==e?void 0:e.webkitRequestFullscreen)return void Promise.resolve(e.webkitRequestFullscreen()).catch(r);let n=i.tech(!0),a=null==n?void 0:n.el();if(null==a?void 0:a.webkitEnterFullscreen)try{a.webkitEnterFullscreen()}catch(e){}}},[]),eY=(0,a.useCallback)(e=>{let t=V.current;if(!t||"function"!=typeof t.currentTime)return;let r="function"==typeof t.duration?Number(t.duration()):void 0,i=Math.max(0,void 0!==r&&Number.isFinite(r)?Math.min(e,r):e);Number.isFinite(i)&&(t.currentTime(i),ez("seek",{seekTime:i}))},[ez]);if((0,a.useImperativeHandle)(t,()=>({togglePlayPause:eG,toggleMute:eq,toggleFullscreen:eX,getVideoElement:()=>{let e=V.current;if(!e)return null;let t=e.tech(!0);return null==t?void 0:t.el()}}),[eG,eq,eX]),(0,a.useEffect)(()=>{if(!k)return;let e=O.current;if(!e||V.current)return;eK();let t=document.createElement("video");t.className="video-js vjs-big-play-centered h-full w-full bg-black",t.playsInl
1ine=!0,t.preload="auto",S||(t.disablePictureInPicture=!0),t.crossOrigin="anonymous",e.appendChild(t);let i=c(h),n=(0,l.A)(t,{controls:W,preload:"auto",poster:i,autoplay:!1,playsinline:!0,sources:[],html5:{vhs:{withCredentials:!1,cacheEncryptionKeys:!0,useForcedSubtitles:!0,enableLowInitialPlaylist:!0,limitRenditionByPlayerDimensions:!0,bandwidth:5e5},nativeAudioTracks:!1,nativeVideoTracks:!1,nativeTextTracks:!1}});n.el().setAttribute("tabindex","0"),n.el().setAttribute("aria-label","".concat(r," video player")),J.current||(J.current=!0,eo.current("session_start",{hasStream:!!j}));let a=()=>{ep(!0),ev(void 0);let e=Number(n.duration()||0);if(Number.isFinite(e)&&eE(e),!X.current&&null!==q.current){X.current=!0;let e=y()-q.current;eo.current("player_ready",{readyTimeMs:Math.round(e)})}},s=()=>{ef(!0);let e=Q.current;e.start=y(),e.count+=1},o=()=>{ef(!1),ey(!0);let e=Q.current;if(null!==e.start){let t=y()-e.start;e.total+=t,eo.current("rebuffer",{durationMs:Math.round(t)}),e.start=null}if(!Y.current&&null!==$.current){Y.current=!0;let e=y()-$.current;eo.current("first_frame",{latencyMs:Math.round(e)})}},d=()=>{var e;if(Z.current)return;Z.current=!0,ec.current();let t=Number(n.duration()||0),r=Number(n.currentTime());eo.current("ended",{duration:t,currentTime:r}),null==(e=es.current)||e.call(es)},u=()=>{if(ey(!1),!Z.current){let e=Number(n.currentTime()),t=Number(n.duration()||0);Number.isFinite(e)&&Number.isFinite(t)&&t>0&&t-e<1&&d()}},p=()=>{ey(!0),v=!0},m=()=>{var e;let t=Number(n.currentTime()),r=Number(n.duration()||0);if(Number.isFinite(t)&&ek(t),Number.isFinite(r)&&r>0&&eE(r),!Z.current&&Number.isFinite(r)&&r>0&&Number.isFinite(t)&&r-t<.5&&(n.ended()||n.paused())&&d(),!_)return;let i=y();!(i-G.current<500)&&Number.isFinite(t)&&Number.isFinite(r)&&!(r<=0)&&(G.current=i,null==(e=el.current)||e.call(el,{currentTime:t,duration:r}))},f=()=>{var e;let t=n.error();ev(null!=(e=null==t?void 0:t.message)?e:"Unable to play this video"),(null==t?void 0:t.message)&&eo.current("playback_error",{code:t.code,message:t.message})},b=()=>{"function"==typeof n.muted&&eC(!!n.muted())},g=e=>{let t=V.current;if(!t||e.defaultPrevented)return;let r=t.el(),i=e.target;if(!i||!r.contains(i))return;let n=e.key.toLowerCase();if(" "===n||"spacebar"===n||"k"===n){e.preventDefault(),t.paused()?x(t):t.pause();return}if("arrowleft"===n||"j"===n){e.preventDefault(),eM(-5);return}("arrowright"===n||"l"===n)&&(e.preventDefault(),eM(10))};n.on("loadedmetadata",a),n.on("waiting",s),n.on("playing",o),n.on("play",p),n.on("pause",u),n.on("timeupdate",m),n.on("ended",d),n.on("error",f),n.on("volumechange",b);let w=()=>d(),N=()=>{if(Z.current)return;let e=t.currentTime,r=t.duration;Number.isFinite(e)&&Number.isFinite(r)&&r>0&&r-e<1&&d()};t.addEventListener("ended",w),t.addEventListener("pause",N);let E=n.el();return E.addEventListener("keydown",g),V.current=n,eu(!0),()=>{n.paused()||n.pause(),eu(!1),ec.current(),n.off("loadedmetadata",a),n.off("waiting",s),n.off("playing",o),n.off("play",p),n.off("pause",u),n.off("timeupdate",m),n.off("ended",d),n.off("error",f),n.off("volumechange",b),E.removeEventListener("keydown",g),t.removeEventListener("ended",w),t.removeEventListener("pause",N),n.dispose(),V.current=null,ea.current=!1,ep(!1),ef(!1),ey(!1),ek(0),eE(0)}},[k,eK,eM,r,W]),(0,a.useEffect)(()=>{var e;if(!k||!ed)return;let t=V.current;if(!t)return;if(!j){t.pause(),eo.current("stream_unavailable");return}let r="function"==typeof t.currentSource?t.currentSource():void 0,i=null!=(e=null==r?void 0:r.src)?e:t.currentSrc(),n=I!==en.current;if(!i||i!==j||n){t.paused()||t.pause(),ec.current(),H.current=!1,Z.current=!1,ev(void 0),ep(!1),ef(!1),eK(),$.current=y(),en.current=I,eo.current("stream_attached",{hasStream:!0,videoIdChanged:n,autoPlay:z});let e=z||ea.current;ea.current=!1;let r=e&&v;r?t.autoplay("play"):t.autoplay(!1),t.src({src:j,type:"application/x-mpegURL"}),t.ready(()=>{let e=V.current;if(e){if(e.poster(c(h)),r&&e.paused()){let t=e.play();t&&"function"==typeof t.catch&&t.catch(()=>{})}e.autoplay(!1)}})}},[z,k,ed,h,eK,j,I]),(0,a.useEffect)(()=>{if(!k)return;let e=V.current;if(!e)return;let t=()=>{et.current.forEach(t=>{let{element:r}=t;e.removeRemoteTextTrack(r)}),et.current=[],ei.current=null,eD(e,!1)};return t(),L.length&&(et.current=L.map(t=>{let r=e.addRemoteTextTrack({kind:"captions",src:t.src,srclang:t.language,label:t.label,default:!1},!0),i=r.track;return i.mode="disabled",{element:r,track:i,caption:t}}),eU(),eD(e,!0)),t},[eU,L,eD,k,j]),(0,a.useEffect)(()=>
1{if(!k)return;let e=V.current;if(!e)return;if(void 0===E||E<=0){H.current=!0;return}let t=Number(e.currentTime());if(!Number.isFinite(t))return;if(1>Math.abs(t-E)){H.current=!0;return}H.current=!1;let r=()=>{let t=e.duration()||E,r=t>0?Math.max(t-.5,0):E,i=Math.min(Math.max(E,0),r>0?r:E);Number.isFinite(i)&&(e.currentTime(i),H.current=!0)};e.readyState()>=1?r():e.one("loadedmetadata",r)},[k,E]),(0,a.useEffect)(()=>{if(!k)return;let e=V.current;if(!e)return;let t=()=>{var e,t,r,i,n;if(er.current)return;let a=et.current;if(!a.length){ei.current=null;return}let l=a.find(e=>{let{track:t}=e;return("captions"===t.kind||"subtitles"===t.kind)&&"showing"===t.mode}),s=ei.current,o=s?a.find(e=>{let{track:t}=e;return t===s}):void 0;if((null!=(e=null==l?void 0:l.track)?e:null)!==(null!=(t=null==o?void 0:o.track)?t:null))if(ei.current=l?l.track:null,er.current=!0,a.forEach(e=>{let{track:t}=e,r=!!(l&&t===l.track);t.mode=r?"showing":"disabled"}),er.current=!1,l){w(A,l.caption.language);let e={language:l.caption.language,label:l.caption.label};o?o.track!==l.track&&ez("captions_language_changed",{...e,previousLanguage:o.caption.language,previousLabel:o.caption.label}):ez("captions_enabled",e)}else o?(w(A,f),ez("captions_disabled",{language:o.caption.language,label:o.caption.label})):s?(w(A,f),ez("captions_disabled",{language:null!=(r=s.language)?r:"unknown",label:null!=(n=null!=(i=s.label)?i:s.language)?n:"unknown"})):w(A,f)};return e.on("texttrackchange",t),()=>{e.off("texttrackchange",t)}},[k,ez,A]),(0,a.useEffect)(()=>{if(!eR)return;let e=V.current,t=null==e?void 0:e.tech(!0),r=null==t?void 0:t.el();if(!r)return;let i=()=>eg(!0),n=()=>eg(!1);return r.addEventListener("enterpictureinpicture",i),r.addEventListener("leavepictureinpicture",n),()=>{r.removeEventListener("enterpictureinpicture",i),r.removeEventListener("leavepictureinpicture",n)}},[eR,eh]),!k)return(0,i.jsxs)("div",{className:(0,o.cx)("relative overflow-hidden border border-base-300 bg-base-200/40 shadow-hard","portrait"===M?"aspect-[9/16]":"aspect-video"),children:[b?(0,i.jsx)(s.Mr,{prompt:b,fallbackSrc:h,alt:r,fill:!0,className:"object-cover",sizes:"100vw",options:{width:1920,height:1080,model:"flux"}}):(0,i.jsx)(n.default,{src:h,alt:r,fill:!0,className:"object-cover",sizes:"100vw"}),(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4 bg-black/50",children:[(0,i.jsx)("div",{className:"flex items-center justify-center w-16 h-16 rounded-full bg-black/60 backdrop-blur-sm",children:(0,i.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-8 h-8","aria-hidden":"true",children:[(0,i.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,i.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),(0,i.jsx)("p",{className:"text-white text-sm font-medium",children:"Episode locked"})]}),(0,i.jsx)(m.GetAppPopup,{isOpen:!0,onClose:()=>{window.history.back()},title:'Get the app to watch "'.concat(r,'"')})]});let eJ=!j,e$=!!(P&&eJ);return(0,i.jsxs)("div",{ref:K,"data-testid":"video-player",className:(0,o.cx)("relative overflow-hidden bg-black focus:outline-none select-none touch-manipulation","focus-visible:ring-4 focus-visible:ring-primary/60","portrait"===M?"aspect-[9/16]":"aspect-video"),children:[(0,i.jsx)("div",{ref:eH,className:"w-full h-full"}),eJ&&(b?(0,i.jsx)(s.Mr,{prompt:b,fallbackSrc:h,alt:r,fill:!0,className:"object-cover",sizes:"100vw",options:{width:1920,height:1080,model:"flux"}}):(0,i.jsx)(n.default,{src:h,alt:r,fill:!0,className:"object-cover",sizes:"100vw"})),e$&&P&&(0,i.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4 bg-base-900/80 p-6 text-center text-base-content",children:[(0,i.jsxs)("div",{className:"space-y-2",children:[(0,i.jsx)("p",{className:"text-lg font-semibold",children:P.title}),P.description?(0,i.jsx)("p",{className:"max-w-sm text-sm text-base-content/80",children:P.description}):null]}),P.onRetry?(0,i.jsx)(s.$n,{size:"sm",variant:"primary",onClick:P.onRetry,disabled:P.isRetrying,children:P.isRetrying?(0,i.jsxs)("span",{className:"flex items-center gap-2",children:[(0,i.jsx)(s.y$,{size:"sm"}),"Retrying"]}):"Retry"}):null]}),!e$&&em&&ew&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40 pointer-events-none",children:(0,i.jsx)(s.y$,{size:"lg"})}),ex&&(0,i.jsx)("div",{className:"absolute inset-x-0 bottom-0 rounded-t-3xl bg-base-900/90 p-4 text-center text-sm text-error-content",children:ex}),j&&!e$&&!ex&&(0,i.jsx)(p,{title:r,subtitle:u,isPlaying:ew,currentTime:ej,duration:eN,onPlayPause:eG,show:!em||!eh,episodeNavigation:R,alwaysShowControls:!eh,onMuteToggle:eq,onFullscreenToggle:eX,isMuted:e_,isFullscreen:eS,hideOverlayControls:D,onSeek:eY,onControlsVisibilityChange:eA}),U&&(0,i.jsxs)("button",{onTouchEnd:e=>{e.preventDefault(),e.stopPropagation(),U()},onClick:e=>{e.stopPropagation(),U()},className:"absolute right-3 bottom-24 flex flex-col items-center gap-1 z-[100] md:hidden transition-opacity duration-300",style:{pointerEvents:eP?"auto":"none",touchAction:"none",opacity:+!!eP},"aria-hidden":!eP,tabIndex:eP?void 0:-1,children:[(0,i.jsx)("div",{className:"w-11 h-11 rounded-full bg-black/40 backdrop-blur-sm flex items-center justify-center border border-white/20",children:(0,i.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"1.5",children:[(0,i.jsx)("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),(0,i.jsx)("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),(0,i.jsx)("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),(0,i.jsx)("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),(0,i.jsx)("span",{className:"text-white text-[10px] font-outfit font-medium",children:"Episodes"})]})]})})},78215:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HeroCarousel:()=>u});
1var i=r(95155),n=r(15239),a=r(20063),l=r(12115),s=r(86814),o=r(27036),c=r(98590),d=r(21512);function u(e){let{shows:t,id:r,loading:u=!1,basePath:h}=e,p=(0,d.Rq)(),m=null!=h?h:p,[f,x]=(0,l.useState)(0),[v,b]=(0,l.useState)(!1),g=(0,l.useRef)(null),[w,y]=(0,l.useState)(!1),j=(0,l.useRef)(null),k=(0,a.useRouter)(),N=(0,l.useRef)(new Map),[E,_]=(0,l.useState)({state:"idle"}),C=t.length>0,S=(0,l.useCallback)(async e=>{let t=N.current.get(e.id);if(t)return t;let r={href:"".concat(m,"/").concat(e.id),kind:"show"};if(e.freeEpisodeCount<=0)return N.current.set(e.id,r),r;try{let t;for(let r of(await (0,o.Bc)(e.id)))r.isFree&&(!t||r.episodeNumber<t.episodeNumber)&&(t=r);if(t){let r={href:"".concat(m,"/").concat(e.id,"/episode/").concat(t.id),kind:"episode",episodeNumber:t.episodeNumber};return N.current.set(e.id,r),r}}catch(t){console.warn("[HeroCarousel] Failed to resolve hero CTA for show ".concat(e.id),t)}return N.current.set(e.id,r),r},[m]);(0,l.useEffect)(()=>{if(!C)return void x(0);f>t.length-1&&x(0)},[f,C,t.length]);let I=(0,l.useCallback)(e=>{if(!C||v)return;let r=(e+t.length)%t.length;if(r===f)return;b(!0),x(r);let i=t[r];i&&(0,c.jF)({series_id:i.id,carousel_location:r+1}),setTimeout(()=>{b(!1)},400)},[C,v,f,t]),P=(0,l.useCallback)(()=>{I(f-1)},[f,I]),T=(0,l.useCallback)(()=>{I(f+1)},[f,I]),L=(0,l.useCallback)(()=>{y(!0),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{y(!1)},8e3)},[]),A=(0,l.useCallback)(e=>{g.current=e.clientX,L()},[L]),R=(0,l.useCallback)(e=>{if(null===g.current)return;let t=e.clientX-g.current;g.current=null,40>Math.abs(t)||(t>0?P():T())},[T,P]),F=(0,l.useMemo)(()=>{if(C)return t[f]},[f,C,t]),M=(0,l.useRef)(T);(0,l.useEffect)(()=>{M.current=T},[T]),(0,l.useEffect)(()=>{var e,r,i;if(t.length<2||w||(null==(r=(i=window).matchMedia)||null==(e=r.call(i,"(prefers-reduced-motion: reduce)"))?void 0:e.matches))return;let n=setInterval(()=>{"undefined"!=typeof document&&document.hidden||M.current()},6e3);return()=>clearInterval(n)},[t.length,w]),(0,l.useEffect)(()=>()=>{j.current&&clearTimeout(j.current)},[]),(0,l.useEffect)(()=>{if(!F)return void _({state:"idle"});let e=N.current.get(F.id);if(e)return void _({state:"ready",target:e});let t=!0;return _({state:"loading"}),S(F).then(e=>{t&&_({state:"ready",target:e})}),()=>{t=!1}},[F,S]);let z=(0,l.useCallback)(async()=>{if(!F)return;if("ready"===E.state)return void k.push(E.target.href);_({state:"loading"});let e=await S(F);(null==F?void 0:F.id)===F.id&&_({state:"ready",target:e}),k.push(e.href)},[F,E,S,k]),D=(0,l.useMemo)(()=>{if(!F)return;let e="Start watching ".concat(F.title);return"ready"!==E.state?e:"episode"===E.target.kind?"".concat(e,", episode ").concat(E.target.episodeNumber):"".concat(e," from the show page")},[F,E]),U="ready"!==E.state;return C||u?(0,i.jsx)("section",{id:r,className:"w-full bg-black","aria-roledescription":"carousel","aria-label":"Featured shows",tabIndex:-1,onKeyDown:e=>{"ArrowLeft"===e.key&&(e.preventDefault(),P()),"ArrowRight"===e.key&&(e.preventDefault(),T())},children:(0,i.jsx)("div",{className:"group relative aspect-[393/664] w-full overflow-hidden bg-black md:aspect-[3/1] md:rounded-2xl touch-pan-y select-none",onPointerDown:A,onPointerUp:R,onPointerLeave:()=>{g.current=null},children:u||!F?(0,i.jsx)(s.EA,{className:"h-full w-full rounded-none"}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"absolute inset-0 z-0 isolate",children:t.map((e,t)=>{let r=e.coverImage,a=e.wideImage||e.coverImage,l=!!e.wideImage,o=t===f;return(0,i.jsxs)("div",{className:"absolute inset-0 h-full w-full transition-opacity ease-in-out",style:{opacity:+!!o,transitionDuration:"".concat(400,"ms"),zIndex:+!!o,pointerEvents:o?void 0:"none"},"aria-hidden":!o,children:[e.coverPrompt?(0,i.jsx)(s.Mr,{prompt:e.coverPrompt,fallbackSrc:r,alt:e.title,fill:!0,priority:0===t,draggable:!1,className:"object-cover object-top pointer-events-none ".concat(l?"md:hidden":""),sizes:"100vw",options:{width:1600,height:900,model:"flux"}}):(0,i.jsx)(n.default,{src:r,alt:e.title,fill:!0,priority:0===t,draggable:!1,className:"object-cover object-top pointer-events-none ".concat(l?"md:hidden":""),sizes:l?"(max-width: 767px) 100v
1w, 0px":"100vw"}),l&&(0,i.jsx)(n.default,{src:a,alt:e.title,fill:!0,priority:0===t,draggable:!1,className:"hidden md:block object-cover object-top pointer-events-none",sizes:"(min-width: 768px) 100vw, 0px"})]},e.id)})}),(0,i.jsx)("div",{className:"pointer-events-none absolute left-0 top-0 h-full w-[19%] hidden md:block",style:{background:"linear-gradient(90deg, #000000 0%, rgba(0, 0, 0, 0) 100%)"}}),(0,i.jsx)("div",{className:"pointer-events-none absolute right-0 top-0 h-full w-[19%] hidden md:block",style:{background:"linear-gradient(270deg, #000000 0%, rgba(0, 0, 0, 0) 100%)"}}),(0,i.jsx)("div",{className:"pointer-events-none absolute top-0 h-2/5 w-full bg-gradient-to-b from-black to-transparent md:max-h-[170px] hidden md:block"}),(0,i.jsx)("div",{className:"pointer-events-none absolute bottom-0 h-2/5 w-full bg-gradient-to-t from-black to-transparent md:max-h-[170px] hidden md:block"}),(0,i.jsx)("div",{className:"pointer-events-none absolute inset-0 md:hidden",style:{background:"radial-gradient(96.57% 58% at 50.13% 48%, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.00) 47.34%, rgba(0, 0, 0, 0.93) 85.1%, #000 94.71%)"}}),(0,i.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-24 md:hidden",style:{background:"linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 55%, transparent 100%)"}}),F.isVip&&(0,i.jsx)("div",{className:"absolute inset-x-0 top-16 flex justify-center md:inset-x-auto md:left-6 md:justify-start pointer-events-none",children:(0,i.jsx)("span",{className:"vip-badge",children:"VIP"})}),F.isExclusive&&!F.isVip&&(0,i.jsx)("div",{className:"absolute inset-x-0 top-16 hidden md:flex md:inset-x-auto md:left-6 md:justify-start pointer-events-none",children:(0,i.jsxs)("span",{className:"pill-label",children:["Gamma ",(0,i.jsx)("span",{className:"font-bold",children:"EXCLUSIVE"})]})}),(0,i.jsxs)("div",{className:"absolute inset-x-0 bottom-0 flex flex-col items-center gap-4 px-4 pb-14 md:pb-8 text-base-content md:items-start md:pl-[120px] md:pr-6 pointer-events-none",children:[(0,i.jsx)("h1",{className:"sr-only","data-testid":"hero-heading",children:F.title}),(0,i.jsxs)("div",{className:"flex flex-col items-center gap-2",style:{width:"212px"},children:[(0,i.jsx)("div",{className:"relative hidden md:block",style:{width:"180px",height:"21.724px",padding:"0 16px",boxSizing:"content-box"},children:(0,i.jsx)(n.default,{src:"/images/branding/gamma-exclusive-logo.png",alt:"Gamma Exclusive",fill:!0,draggable:!1,className:"object-contain pointer-events-none",sizes:"180px"})}),F.category&&(0,i.jsxs)("p",{className:"hidden text-sm text-white/80 md:block",children:["TV Show ⢠",F.category]}),(0,i.jsxs)(s.$n,{type:"button",size:"lg",variant:"primary",loading:U,onClick:z,"aria-label":D,className:"bg-white text-black hover:bg-white/90 font-semibold shadow-lg pointer-events-auto",style:{display:"flex",width:"212px",height:"48px",padding:"8px",justifyContent:"center",alignItems:"center",borderRadius:"12px",background:"var(--onBackground, #FFF)"},children:[(0,i.jsx)("svg",{width:"16",height:"18",viewBox:"0 0 16 18",fill:"currentColor","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M15 9L1 17.6603V0.339746L15 9Z"})}),"Play"]})]})]}),C&&(0,i.jsx)("div",{className:"absolute inset-x-0 bottom-0 z-10 flex",style:{padding:"12px",justifyContent:"center",alignItems:"center",gap:"12px"},children:t.map((e,t)=>(0,i.jsx)("button",{type:"button",className:"transition-all duration-300 pointer-events-auto","aria-label":"View ".concat(e.title),"aria-pressed":t===f,onClick:()=>{L(),I(t)},style:{width:t===f?"10px":"8px",height:t===f?"10px":"8px",aspectRatio:"1/1",borderRadius:"50px",background:"var(--onBackground, #FFF)",opacity:t===f?1:.16}},e.id))}),t.length>1&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("button",{type:"button",onClick:()=>{L(),P()},"aria-label":"Previous slide",className:"pointer-events-auto absolute left-4 top-1/2 z-20 hidden h-12 w-12 -translate-y-1/2 items-center justify-center rounded-full border border-white/20 bg-black/50 text-white opacity-0 backdrop-blur-sm transition-all duration-300 hover:bg-black/70 hover:border-white/40 group-hover:opacity-100 md:flex",children:(0,i.jsx)("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),(0,i.jsx)("button",{type:"button",onClick:()=>{L(),T()},"aria-label":"Next slide",className:"pointer-events-auto absolute right-4 top-1/2 z-20 hidden h-12 w-12 -translate-y-1/2 items-center justify-center rounded-full border border-white/20 bg-black/50 text-white opacity-0 backdrop-blur-sm transition-all duration-300 hover:bg-black/70 hover:border-white/40 group-hover:opacity-100 md:flex",children:(0,i.jsx)("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})})]})]})})}):null}},78826:(e,t,r)=>{"use strict";r.d(t,{M:()=>a});var i=r(95155);let n={"top-left":"top-3 left-3","top-right":"top-3 right-3","to
1p-center":"top-3 left-1/2 -translate-x-1/2"};function a(e){let{knownFor:t,creatorName:r,position:a="top-left",className:l=""}=e;return(0,i.jsx)("div",{className:"absolute z-10 ".concat(n[a]," ").concat(l),"aria-label":"From the creator of ".concat(t,": ").concat(r),children:(0,i.jsx)("div",{className:"rounded-lg bg-gradient-to-r from-secondary/95 to-accent/95 px-3 py-2 shadow-md backdrop-blur-sm",children:(0,i.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,i.jsxs)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-white/90",children:["From The Creator of ",t]}),(0,i.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-white",children:r})]})})})}},80542:()=>{},82458:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EpisodeCarousel:()=>p});var i=r(95155),n=r(12115),a=r(15239),l=r(52619),s=r.n(l),o=r(14474),c=r(34779),d=r(59130);let u="/placeholder/episode-1.svg";function h(e){let{episode:t,showId:r,onUnlock:l,onEpisodeSelect:d}=e,[h,p]=(0,n.useState)(t.coverImage||u),m="/show/".concat(r,"/episode/").concat(t.id),f=!t.isFree,x="Eps.".concat(t.episodeNumber," - ").concat(t.title),v=(0,i.jsx)("div",{className:"flex h-full w-full items-center justify-center",children:(0,i.jsxs)("div",{className:"relative w-episode-card h-episode-card overflow-hidden bg-base-300 rounded-episode-card border border-episode-card-border",children:[(0,i.jsx)(a.default,{src:h,alt:t.title,fill:!0,className:"object-cover transition-all duration-300 group-hover:scale-105 group-hover:brightness-110",sizes:"280px",onError:()=>{p(u)}}),(0,i.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent"}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:f?(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-black/70 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-black/80",children:(0,i.jsx)(o.A,{className:"h-6 w-6 text-white"})}):(0,i.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary/90 backdrop-blur-sm transition-all duration-300 group-hover:scale-110 group-hover:bg-primary",children:(0,i.jsx)(c.A,{className:"h-6 w-6 text-primary-content"})})}),(0,i.jsx)("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:(0,i.jsx)("h3",{className:"font-outfit text-[15px] font-medium text-white leading-normal tracking-[0.1px] overflow-hidden text-ellipsis whitespace-nowrap",children:x})})]})});return f?(0,i.jsx)("button",{type:"button",className:"group relative h-full w-full text-left transition-all hover:-translate-y-1",onClick:()=>{l(t)},"aria-label":"Locked episode: ".concat(t.title,". Get the app to watch."),children:v}):d?(0,i.jsx)("button",{type:"button",className:"group relative h-full w-full text-left transition-all hover:-translate-y-1",onClick:()=>d(t.id),"aria-label":"Watch ".concat(t.title),children:v}):(0,i.jsx)(s(),{href:m,className:"group relative block h-full transition-all hover:-translate-y-1","aria-label":"Watch ".concat(t.title),children:v})}function p(e){let{episodes:t,showId:r,onUnlock:a,onEpisodeSelect:l}
1=e,[s,o]=(0,n.useState)(null),[c,u]=(0,n.useState)(!1),p=(0,n.useRef)(null),m=(0,n.useRef)(null),f=(0,n.useCallback)(e=>{a?a(e):(o(e),u(!0))},[a]),x=(0,n.useCallback)(()=>{u(!1),o(null)},[]);(0,n.useEffect)(()=>{if(!c||!s){c||(p.current=null);return}let e="".concat(r,":").concat(s.id);p.current!==e&&(p.current=e)},[c,s,r]),(0,n.useEffect)(()=>{let e=m.current;if(!e)return;let t=t=>{if("ArrowLeft"===t.key||"ArrowRight"===t.key){t.preventDefault();let r="ArrowLeft"===t.key?-1:1;e.scrollBy({left:292*r,behavior:"smooth"})}};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)},[]);let v=c&&!!s;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{ref:m,className:"scrollbar-hide flex gap-3 overflow-x-auto scroll-smooth pb-2 snap-x snap-mandatory touch-pan-x",role:"list","aria-label":"Episodes",tabIndex:0,"data-testid":"episode-carousel",children:t.map(e=>(0,i.jsx)("div",{role:"listitem","data-testid":"episode-item","data-free":e.isFree?"true":"false",className:"h-episode-card w-episode-card flex-shrink-0 snap-start",children:(0,i.jsx)(h,{episode:e,showId:r,onUnlock:f,onEpisodeSelect:l})},e.id))}),(0,i.jsx)(d.GetAppPopup,{isOpen:v,onClose:x,title:s?'Get the app to keep watching "'.concat(s.title,'"'):"Get the app to continue the show"})]})}},83276:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SupportSection:()=>o});var i=r(95155),n=r(12115),a=r(52619),l=r.n(a),s=r(86814);function o(){let e=(0,n.useCallback)(()=>{window.open("mailto:".concat("[email protected]"),"_blank","noopener,noreferrer")},[]),t=(0,n.useCallback)(()=>{},[]);return(0,i.jsxs)("section",{id:"support",className:"page-section rounded-3xl border border-base-300 bg-base-200/40 p-10 text-base-content shadow-soft",tabIndex:-1,"aria-labelledby":"support-heading",children:[(0,i.jsx)("h2",{id:"support-heading",className:"text-2xl font-semibold",children:"Need help?"}),(0,i.jsx)("p",{className:"mt-3 max-w-2xl text-base text-base-content/80",children:"Reach the Gamma support team or review the onboarding checklist to finish wiring integrations without losing momentum."}),(0,i.jsxs)("div",{className:"mt-6 flex flex-wrap items-center gap-3",children:[(0,i.jsx)(s.$n,{type:"button",size:"md",variant:"primary",onClick:e,children:"Contact support"}),(0,i.jsx)(l(),{href:"https://docs.gammatime.ai/onboarding-checklist",target:"_blank",rel:"noreferrer",onClick:t,className:"inline-flex items-center justify-center gap-2 rounded-full border border-base-300 px-5 py-3 text-sm font-medium text-base-content transition-colors hover:bg-base-200/60 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/70",children:"View onboarding checklist"})]}),(0,i.jsx)("p",{className:"mt-3 text-sm text-base-content/70",children:"We respond within one business day on weekdays."})]})}},83383:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EpisodesGrid:()=>m});var i=r(95155),n=r(12115),a=r(15239),l=r(52619),s=r.n(l),o=r(86814),c=r(14474),d=r(34779),u=r(59130),h=r(41429);function p(e){let{episode:t,showId:r,onUnlock:n,onEpisodeSelect:l}=e,u="/show/".concat(r,"/episode/").concat(t.id),h=!t.isFree,p="Ep.".concat(t.episodeNumber),m=(0,i.jsxs)("div",{className:"flex h-full flex-col",children:[(0,i.jsxs)("div",{className:"relative w-full h-episode-card overflow-hidden bg-base-300 rounded-episode-card border border-episode-card-border",children:[(0,i.jsx)(a.default,{src:t.coverImage,alt:t.title,fill:!0,className:"object-cover transition-all duration-300 group-hover:scale-105 group-hover:brightness-110",sizes:"280px"}),(0,i.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-trans
1parent to-transparent opacity-0 transition-opacity duration-300 group-hover:opacity-100"}),(0,i.jsx)("div",{className:"absolute left-2 top-2 rounded-md bg-black/80 px-2 py-1 text-xs font-bold text-white backdrop-blur-md shadow-lg",children:p}),(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:h?(0,i.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-black/80 backdrop-blur-md shadow-xl transition-all duration-300 group-hover:scale-110 group-hover:bg-black/90",children:(0,i.jsx)(c.A,{className:"h-5 w-5 text-white"})}):(0,i.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-primary/95 backdrop-blur-md shadow-xl transition-all duration-300 group-hover:scale-110 group-hover:bg-primary group-hover:shadow-2xl",children:(0,i.jsx)(d.A,{className:"h-5 w-5 text-primary-content"})})})]}),(0,i.jsxs)("div",{className:"flex flex-1 flex-col p-2.5",children:[(0,i.jsx)("h3",{className:"text-xs font-semibold text-base-content leading-snug line-clamp-2",children:t.title}),h&&(0,i.jsx)("div",{className:"mt-2",children:(0,i.jsx)(o.Ex,{variant:"warning",className:"text-xs font-semibold",children:"Locked"})})]})]});return h?(0,i.jsx)("button",{type:"button",className:"group relative h-full w-full text-left transition-all hover:-translate-y-1",onClick:()=>{n(t)},"aria-label":"Locked episode: ".concat(t.title,". Get the app to watch."),children:m}):l?(0,i.jsx)("button",{type:"button",className:"group relative h-full w-full text-left transition-all hover:-translate-y-1",onClick:()=>l(t.id),"aria-label":"Watch ".concat(t.title),children:m}):(0,i.jsx)(s(),{href:u,className:"group relative block h-full transition-all hover:-translate-y-1","aria-label":"Watch ".concat(t.title),children:m})}function m(e){let{episodes:t,showId:r,onUnlock:a,onEpisodeSelect:l,className:s}
1=e,[o,c]=(0,n.useState)(null),[d,m]=(0,n.useState)(!1),f=(0,n.useRef)(null),x=(0,n.useCallback)(e=>{a?a(e):(c(e),m(!0))},[a]),v=(0,n.useCallback)(()=>{m(!1),c(null)},[]);(0,n.useEffect)(()=>{if(!d||!o){d||(f.current=null);return}let e="".concat(r,":").concat(o.id);f.current!==e&&(f.current=e)},[d,o,r]);let b=d&&!!o;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:(0,h.cx)("grid grid-cols-3 gap-3 auto-rows-fr",s),role:"list","aria-label":"Episodes",children:t.map(e=>(0,i.jsx)("div",{role:"listitem",className:"h-full",children:(0,i.jsx)(p,{episode:e,showId:r,onUnlock:x,onEpisodeSelect:l})},e.id))}),(0,i.jsx)(u.GetAppPopup,{isOpen:b,onClose:v,title:o?'Get the app to keep watching "'.concat(o.title,'"'):"Get the app to continue the show"})]})}},83957:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ContinueWatching:()=>o,ContinueWatchingSkeleton:()=>c});var i=r(95155),n=r(12115),a=r(33336),l=r(6811),s=r(86814);function o(e){let{limit:t=10,className:r="",basePath:s="/show"}=e,{items:o}=(0,a.l)(),c=(0,n.useRef)(null),[d,u]=(0,n.use
1State)(!1),[h,p]=(0,n.useState)(!1),m=(0,n.useCallback)(()=>{let e=c.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:i}=e;u(t>0),p(t+i<r-1)},[]);(0,n.useEffect)(()=>{let e=c.current;if(e)return requestAnimationFrame(m),e.addEventListener("scroll",m),window.addEventListener("resize",m),()=>{e.removeEventListener("scroll",m),window.removeEventListener("resize",m)}},[m]);let f=e=>{if(!c.current)return;let t=c.current,r=.8*t.clientWidth;t.scrollBy({left:"left"===e?-r:r,behavior:"smooth"}),setTimeout(m,350)},x=(0,n.useMemo)(()=>(function(e){let t=new Set,r=[];for(let i of e)t.has(i.showId)||(t.add(i.showId),r.push(i));return r})(o).slice(0,t),[o,t]);return((0,n.useEffect)(()=>{m()},[x,m]),0===x.length)?null:(0,i.jsxs)("section",{className:"flex flex-col gap-4 ".concat(r),children:[(0,i.jsx)("h2",{className:"text-2xl font-bold text-base-content md:text-3xl",children:"Continue watching"}),(0,i.jsxs)("div",{className:"relative group/rail",children:[d&&(0,i.jsx)("div",{className:"absolute left-2 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover/rail:opacity-100 transition-opacity duration-200",children:(0,i.jsx)("button",{type:"button",onClick:()=>f("left"),className:"flex h-14 w-14 items-center justify-center rounded-full bg-neutral-800/90 hover:bg-neutral-700 text-white shadow-lg transition-all hover:scale-105","aria-label":"Scroll continue watching left",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m15 18-6-6 6-6"})})})}),h&&(0,i.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 z-10 opacity-0 group-hover/rail:opacity-100 transition-opacity duration-200",children:(0,i.jsx)("button",{type:"button",onClick:()=>f("right"),className:"flex h-14 w-14 items-center justify-center rounded-full bg-neutral-800/90 hover:bg-neutral-700 text-white shadow-lg transition-all hover:scale-105","aria-label":"Scroll continue watching right",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m9 18 6-6-6-6"})})})}),(0,i.jsx)("div",{ref:c,className:"flex gap-4 overflow-x-scroll scrollbar-hide pb-2 md:gap-6 touch-manipulation",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:x.map(e=>(0,i.jsx)("div",{className:"w-[160px] shrink-0 sm:w-[180px] lg:w-[218px]",children:(0,i.jsx)(l.ContinueWatchingCard,{item:e,basePath:s})},"".concat(e.showId,"-").concat(e.episodeId)))})]})]})}function c(e){let{limit:t=4,className:r=""}=e;return(0,i.jsxs)("section",{className:"flex flex-col gap-4 ".concat(r),children:[(0,i.jsx)(s.EA,{className:"h-8 w-48"}),(0,i.jsx)("div",{className:"flex gap-4 overflow-x-auto scrollbar-hide pb-2 md:gap-6",children:Array.from({length:t}).map((e,t)=>(0,i.jsx)("div",{className:"w-[160px] shrink-0 sm:w-[180px] lg:w-[218px]",children:(0,i.jsx)(s.EA,{className:"aspect-[218/285] w-full rounded-[6px]"})},t))})]})}},85878:(e,t,r)=>{"use strict";let i;function n(e){if("string"!=typeof e)return;let t=e.trim();return t.length>0?t:void 0}function a(){var e,t;return null!=(t=null!=(e=n(i))?e:n(""))?t:"demo-gammatime"}function l(){var e;return!!(null!=(e=n(i))?e:n(""))}r.d(t,{_j:()=>a,qv:()=>l})},86814:(e,t,r)=>{"use strict";r.d(t,{Mr:()=>s.AIImage,Ex:()=>l,$n:()=>o.Button,EA:()=>d,y$:()=>h,dj:()=>p.useToast}),r(24567);var i=r(95155),n=r(41429);let a={default:"bg-base-200/80 text-base-content",accent:"bg-accent text-accent-content",success:"bg-success/20 text-success",warning:"bg-warning/20 text-warning",error:"bg-error/20 text-error-content"};function l(e){let{className:t,variant:r="default",...l}=e;return(0,i.jsx)("span",{className:(0,n.cx)("inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-[0.2em]",a[r],t),...l})}r(14944),r(51634);var s=r(65151),o=r(28182),c=r(12115);function d(e){let{className:t,shimmer:r=!0,...a}=e;return(0,i.jsx)("div",{className:(0,n.cx)("animate-pulse rounded-2xl bg-base-300/60",r?"bg-gradient-to-r from-base-300/20 via-base-300/60 to-base-300/20":"",t),...a})}(0,c.forwardRef)((e,t)=>{let{className:r,...a}=e;return(0,i.jsx)("input",{ref:t,type:"checkbox",className:(0,n.cx)("checkbox checkbox-primary h-5 w-5 border-base-300",r),...a})}).displayName="Checkbox",r(1703),r(93415),r(98157),r(1517),r(32813),(0,c.forwardRef)((e,t)=>{let{className:r,hasError:a=!1,...l}=e;return(0,i.jsx)("input",{ref:t,className:(0,n.cx)("h-11 w-full rounded-xl border border-base-300 bg-base-200/60 px-4 text-base text-base-content placeholder:text-base-content/50 shadow-soft focus-visible:border-primary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",a?"border-error focus-visible:ring-error/40":"",r),...l})}).displayName="Input",r(4795),r(8601),r(40327),(0,c.forwardRef)((e,t)=>{let{className:r,...a}=e;return(0,i.jsx)("input",{ref:t,type:"radio",className:(0,n.cx)("radio radio-primary h-4 w-4 border-base-300",r),...a})}).displayName="Radio",(0,c.forwardRef)((e,t)=>{let{className:r,hasError:a=!1,children:l,...s}=e;return(0,i.jsx)("select",{ref:t,className:(0,n.cx)("h-11 w-full rounded-xl border border-base-300 bg-base-200/80 px-4 text-base text-base-content shadow-soft focus-visible:border-primary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",a?"border-error focus-visible:ring-error/40":"",r),...s,children:l})}).displayName="Select";let u={sm:"loading-xs",md:"loading-sm",lg:"loading-md"};function h(e){let{size:t="md",className:r,...a}=e;return(0,i.jsx)("span",{className:(0,n.cx)("loading loading-spinner text-primary",u[t],r),"aria-hidden":"true",...a})}r(18006),(0,c.forwardRef)((e,t)=>{let{className:r,hasError:a=!1,rows:l=4,...s}=e;return(0,i.jsx)("textarea",{ref:t,rows:l,className:(0,n.cx)("w-full rounded-2xl border border-base-300 bg-base-200/60 px-4 py-3 text-base text-base-content placeholder:text-base-content/50 shadow-soft focus-visible:border-primary/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30",a?"border-error focus-visible:ring-error/40":"",r),...s})}).displayName="TextArea",r(73651);var p=r(404);r(47430),r(37943)},87465:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MobileNavDrawer:()=>d});var i=r(95155),n=r(20063),a=r(1517),l=r(89599);function s(){return(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M3 10.5L12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1V10.5Z"})})}function o(){return(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,i.jsx)("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),(0,i.jsx)("circle",{cx:"12",cy:"7",r:"4"})]})}function c(){return(0,i.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,i.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,i.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function d(e){let{isOpen:t,onClose:r}=e,d=(0,n.useRouter)(),u=(0,n.usePathname)(),{isAnonymous:h}=(0,l.A)(),p=[{label:"Home",href:"/",icon:(0,i.jsx)(s,{})},{label:"Profile",href:"/profile",icon:(0,i.jsx)(o,{})}],m=[{label:"Home",href:"/",icon:(0,i.jsx)(s,{})},{label:"Profile",href:"/profile",icon:(0,i.jsx)(o,{})}];return(0,i.jsx)(a.Drawer,{isOpen:t,onClose:r,anchor:"left",ariaLabel:"Navigation menu",children:(0,i.jsxs)("div",{className:"-mx-6 -mt-6 -mb-6 flex flex-col bg-[#090909] font-outfit",children:[(0,i.jsx)("div",{className:"flex items-center h-16 px-4",children:(0,i.jsx)("button",{type:"button",onClick:r,"aria-label":"Close navigation",className:"flex h-10 w-10 items-center justify-center text-white focus:outline-none",children:(0,i.jsx)(c,{})})}),(0,i.jsx)("nav",{className:"flex flex-col gap-1 px-4 pt-2",children:(h?p:m).map(e=>{let t="/"===e.href?"/"===u:u.startsWith(e.href);return(0,i.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.href,void(d.push(t),r())},className:"flex h-[60px] items-center gap-3 rounded-xl px-4 text-white transition-colors ".concat(t?"bg-[rgba(255,255,255,0.06)]":"bg-transparent"),children:[(0,i.jsx)("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center",children:e.icon}),(0,i.jsx)("span",{className:"text-[16px] font-normal leading-none",children:e.label})]},"".concat(e.label,"-").concat(e.href))})})]})})}},87776:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EpisodeRow:()=>p});var i,n=r(95155),a=r(15239),l=r(52619),s=r.n(l),o=r(86814),c=r(7e3),d=r(14474),u=r(34779);let h=null!=(i=r(87358).env.NEXT_PUBLIC_APP_DEEP_LINK)?i:"https://gammatime.app.link/open";function p(e){let{episode:t,showId:r,loading:i=!1,showCoverImage:l,onUnlock:p,onEpisodeSelect:m}=e;if(i||!t)return(0,n.jsxs)("div",{className:"group relative overflow-hidden rounded-xl bg-base-200/40 shadow-soft",children:[(0,n.jsx)(o.EA,{className:"aspect-video w-full"}),(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsx)(o.EA,{className:"mb-2 h-4 w-20"}),(0,n.jsx)(o.EA,{className:"mb-2 h-5 w-3/4"}),(0,n.jsx)(o.EA,{className:"h-4 w-full"})]})]});let f="/show/".concat(r,"/episode/").concat(t.id),x=!t.isFree,v="Eps.".concat(t.episodeNumber),b=t.coverImage&&t.coverImage.trim().length>0?t.coverImage:l&&l.trim().length>0?l:null,g=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"relative aspect-video w-full overflow-hidden bg-base-300",children:[b?(0,n.jsx)(a.default,{src:b,alt:t.title,fill:!0,className:"object-cover transition-transform duration-300 group-hover:scale-105",sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",onError:e=>{e.target.style.display="none"}}):(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gradient-to-br from-base-300 to-base-200",children:(0,n.jsx)("div",{className:"text-center",children:(0,n.jsx)("div",{className:"text-4xl font-bold text-base-content/20",children:v})})}),(0,n.jsx)("div",{className:"absolute left-3 top-3 rounded-md bg-black/80 px-2.5 py-1.5 text-xs font-semibold text-white backdrop-blur-sm",children:v}),(0,n.jsx)("div",{className:"absolute right-3 top-3 rounded-md bg-black/80 px-2.5 py-1.5 text-xs text-white backdrop-blur-sm",children:(0,c.a3)(t.duration)}),(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none","aria-hidden":"true",children:x?(0,n.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-black/70 backdrop-blur-sm transition-all group-hover:scale-110",children:(0,n.jsx)(d.A,{className:"h-7 w-7 text-white","aria-hidden":"true"})}):(0,n.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-primary/90 backdrop-blur-sm transition-all group-hover:scale-110 group-hover:bg-primary",children:(0,n.jsx)(u.A,{className:"h-7 w-7 text-primary-content","aria-hidden":"true"})})}),(0,n.jsx)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 via-black/40 to-transparent p-4",children:(0,n.jsx)("h3",{className:"text-base font-semibold text-white line-clamp-2",children:t.title})})]}),(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsx)("p",{className:"text-sm text-base-content/70 line-clamp-2",children:t.description}),x&&(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,n.jsx)(o.Ex,{variant:"warning",className:"text-xs",children:"Locked"}),(0,n.jsx)(o.$n,{variant:"outline",size:"sm",onClick:()=>
1{if(p)return void p(t);window.location.href=h},"aria-label":"Get the app to watch ".concat(t.title),className:"text-xs",children:"Get the app"})]})]})]});return x?(0,n.jsx)("article",{className:"group relative overflow-hidden rounded-xl bg-base-200/40 shadow-soft transition-shadow hover:shadow-lg","aria-label":"".concat(t.title," - Locked episode"),"data-testid":"episode-item","data-free":"false",children:g}):m?(0,n.jsx)("button",{onClick:e=>{m&&(e.preventDefault(),m(t.id))},className:"group relative block w-full overflow-hidden rounded-xl bg-base-200/40 shadow-soft transition-shadow hover:shadow-lg text-left","aria-label":"Watch ".concat(t.title),"data-testid":"episode-item","data-free":"true",children:g}):(0,n.jsx)(s(),{href:f,className:"group relative block overflow-hidden rounded-xl bg-base-200/40 shadow-soft transition-shadow hover:shadow-lg","aria-label":"Watch ".concat(t.title),"data-testid":"episode-item","data-free":"true",children:g})}},90091:(e,t,r)=>{"use strict";r.d(t,{ReelShortShowCard:()=>u});var i=r(95155),n=r(15239),a=r(52619),l=r.n(a),s=r(86814),o=r(21512),c=r(31267),d=r(7e3);function u(e){let{show:t,loading:r=!1,basePath:a,location:u="Carousel"}=e,h=(0,o.Rq)();if(r||!t)return(0,i.jsxs)("div",{className:"w-full",children:[(0,i.jsx)("div",{className:"relative aspect-[220/294] overflow-hidden rounded-[6px]",children:(0,i.jsx)(s.EA,{className:"h-full w-full"})}),(0,i.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,i.jsx)(s.EA,{className:"h-4 w-3/4"}),(0,i.jsx)(s.EA,{className:"h-3 w-1/2"})]})]});let p=t.freeEpisodeCount||0;return(0,i.jsxs)(l(),{href:"".concat(null!=a?a:h,"/").concat(t.id),className:"group/card block w-full","aria-label":"View ".concat(t.title),title:t.title,"data-testid":"show-card",onClick:()=>{t&&(0,c.j4)(parseInt(t.id,10)||t.id,{location:u})},children:[(0,i.jsxs)("div",{className:"relative aspect-[220/294] overflow-hidden rounded-[6px]",children:[t.posterPrompt?(0,i.jsx)(s.Mr,{prompt:t.posterPrompt,fallbackSrc:t.brightImage||t.posterImage,alt:t.title,fill:!0,className:"object-cover transition-transform duration-300 md:group-hover/card:scale-105",sizes:"(max-width: 640px) 45vw, (max-width: 1024px) 30vw, 20vw",options:{width:400,height:533,model:"flux"}}):(0,i.jsx)(n.default,{src:t.brightImage||t.posterImage,alt:t.title,fill:!0,className:"object-cover transition-transform duration-300 md:group-hover/card:scale-105",sizes:"(max-width: 640px) 45vw, (max-width: 1024px) 30vw, 20vw"}),(0,i.jsx)("div",{className:"absolute inset-0 hidden items-center justify-center opacity-0 md:flex group-hover/card:opacity-100 transition-opacity duration-300 bg-black/20",children:(0,i.jsx)("div",{className:"w-14 h-14 rounded-full bg-white/90 flex items-center justify-center",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"w-7 h-7 text-black ml-1",children:(0,i.jsx)("path",{d:"M8 5v14l11-7z"})})})}),t.isExclusive&&(0,i.jsx)("div",{className:"absolute top-2 left-2",children:(0,i.jsx)("span",{className:"px-2 py-0.5 bg-red-600 text-white text-xs font-semibold rounded",children:"EXCLUSIVE"})}),t.isVip&&(0,i.jsx)("div",{className:"absolute top-2 left-2",children:(0,i.jsx)("span",{className:"px-2 py-0.5 bg-gradient-to-r from-amber-500 to-yellow-400 text-black text-xs font-bold rounded",children:"VIP"})})]}),(0,i.jsxs)("div",{className:"mt-3",children:[(0,i.jsx)("h3",{className:"text-white font-semibold text-base leading-tight group-hover/card:text-white/90 transition-colors",children:(0,d.Sn)(t.title)}),p>0&&(0,i.jsxs)("p",{className:"mt-1 text-xs",children:[(0,i.jsx)("span",{className:"text-red-500 font-medium",children:p}),(0,i.jsx)("span",{className:"text-white/50",children:" free episodes"})]})]})]})}},91175:(e,t,r)=>{"use strict";r.d(t,{MobileEpisodePicker:()=>a});var i=r(95155),n=r(12115);function a(e){let{episodes:t,showTitle:r,currentEpisodeId:a,onEpisodeSelect:l,onAllEpisodes:s}=e,[o,c]=(0,n.useState)([0,49]),d=(0,n.useRef)(null),u=(0,n.useRef)(null),h=(0,n.useMemo)(()=>[...t].sort((e,t)=>e.episodeNumber-t.episodeNumber),[t]),p=(0,n.useMemo)(()=>{let e=[];for(let t=0;t<h.length;t+=50){let r=t,i=Math.min(t+50-1,h.length-1);e.push([r,i])}return e},[h.length]),m=(0,n.useMemo)(()=>h.slice(o[0],o[1]+1),[h,o]),f=a?h.find(e=>e.id===a):void 0,x=f?"Episode ".concat(f.episodeNumber," - ").concat(r):r;return(0,n.useEffect)(()=>
1{if(u.current&&d.current){let e=d.current,t=u.current,r=t.getBoundingClientRect(),i=t.offsetLeft-e.offsetWidth/2+r.width/2;e.scrollTo({left:Math.max(0,i),behavior:"smooth"})}},[o,a]),(0,n.useEffect)(()=>{if(f){let e=h.findIndex(e=>e.id===f.id);if(e>=0){let t=p[Math.floor(e/50)];t&&(t[0]!==o[0]||t[1]!==o[1])&&c(t)}}},[a]),(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)("div",{className:"space-y-3",children:[(0,i.jsx)("h2",{className:"text-lg font-semibold text-white leading-tight italic",children:x}),(0,i.jsxs)("div",{className:"flex items-center justify-between",children:[(0,i.jsx)("div",{className:"flex items-center gap-2",children:p.map((e,t)=>{var r,n;let[a,l]=e,s=(null==(r=h[a])?void 0:r.episodeNumber)||a+1,d=(null==(n=h[l])?void 0:n.episodeNumber)||l+1,u=o[0]===a;return(0,i.jsxs)("button",{type:"button",onClick:()=>c([a,l]),className:"px-3 py-1.5 text-sm rounded transition-colors ".concat(u?"text-white font-medium":"text-white/50 hover:text-white/70"),children:[1===s?0:s,"-",d]},t)})}),(0,i.jsxs)("button",{type:"button",onClick:s,className:"flex items-center gap-1 text-sm text-white/60 hover:text-white/80 transition-colors",children:["All Episodes",(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("path",{d:"m9 18 6-6-6-6"})})]})]}),(0,i.jsx)("div",{ref:d,className:"flex gap-2 overflow-x-auto pb-2 scrollbar-hide snap-x snap-mandatory",children:m.map(e=>{let t=e.id===a,r=!e.isFree;return(0,i.jsxs)("button",{ref:t?u:void 0,type:"button",onClick:()=>l(e.id),"data-testid":"episode-item","data-free":e.isFree?"true":"false",className:"flex-shrink-0 w-14 h-10 rounded-lg flex items-center justify-center text-sm font-medium transition-all snap-start relative ".concat(t?"bg-[#2a2a2a] text-white border border-white/10":r?"bg-[#2a2a2a] text-white/40":"bg-[#2a2a2a] text-white/70 hover:bg-[#3a3a3a] hover:text-white"),"aria-label":"Episode ".concat(e.episodeNumber).concat(r?" (Locked)":""),title:e.title||"Episode ".concat(e.episodeNumber),children:[t?(0,i.jsxs)("span",{className:"flex items-end gap-[3px] h-5",children:[(0,i.jsx)("span",{className:"w-[3px] h-3 bg-red-500 rounded-full animate-pulse"}),(0,i.jsx)("span",{className:"w-[3px] h-4 bg-red-500 rounded-full animate-pulse delay-75"}),(0,i.jsx)("span",{className:"w-[3px] h-5 bg-red-500 rounded-full animate-pulse delay-150"}),(0,i.jsx)("span",{className:"w-[3px] h-3 bg-red-500 rounded-full animate-pulse delay-200"})]}):e.episodeNumber,r&&!t&&(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"8",height:"8",viewBox:"0 0 24 24",fill:"currentColor",className:"absolute bottom-1 right-1 text-white/50",children:(0,i.jsx)("path",{d:"M12 1a5 5 0 0 0-5 5v2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2h-2V6a5 5 0 0 0-5-5zm-3 5a3 3 0 1 1 6 0v2H9V6z"})})]},e.id)})})]})})}},93415:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Footer:()=>f});var i=r(95155),n=r(52619),a=r.n(n),l=r(12115),s=r(12834),o=r(40373);let c={facebook:"https://www.facebook.com/profile.php?id=61574904143223",youtube:"https://www.youtube.com/channel/UC9QnTqflZ56M2daVf2wCjSw",instagram:"https://www.instagram.com/gamma.time/",tiktok:"https://www.tiktok.com/@gamma.time"};function d(e){let{className:t}=e;return(0,i.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M22 12c0-5.523-4.477-10-10-10S2 6.477 2 12c0 4.991 3.657 9.128 8.438 9.878v-6.987
1h-2.54V12h2.54V9.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V12h2.773l-.443 2.89h-2.33v6.988C18.343 21.128 22 16.991 22 12z",clipRule:"evenodd"})})}function u(e){let{className:t}=e;return(0,i.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M19.812 5.418c.861.23 1.538.907 1.768 1.768C21.998 8.746 22 12 22 12s0 3.255-.418 4.814a2.504 2.504 0 0 1-1.768 1.768c-1.56.419-7.814.419-7.814.419s-6.255 0-7.814-.419a2.505 2.505 0 0 1-1.768-1.768C2 15.255 2 12 2 12s0-3.255.417-4.814a2.507 2.507 0 0 1 1.768-1.768C5.744 5 11.998 5 11.998 5s6.255 0 7.814.418ZM15.194 12 10 15V9l5.194 3Z",clipRule:"evenodd"})})}function h(e){let{className:t}=e;return(0,i.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,i.jsx)("path",{fillRule:"evenodd",d:"M12.315 2c2.43 0 2.784.013 3.808.06 1.064.049 1.791.218 2.427.465a4.902 4.902 0 011.772 1.153 4.902 4.902 0 011.153 1.772c.247.636.416 1.363.465 2.427.048 1.067.06 1.407.06 4.123v.08c0 2.643-.012 2.987-.06 4.043-.049 1.064-.218 1.791-.465 2.427a4.902 4.902 0 01-1.153 1.772 4.902 4.902 0 01-1.772 1.153c-.636.247-1.363.416-2.427.465-1.067.048-1.407.06-4.123.06h-.08c-2.643 0-2.987-.012-4.043-.06-1.064-.049-1.791-.218-2.427-.465a4.902 4.902 0 01-1.772-1.153 4.902 4.902 0 01-1.153-1.772c-.247-.636-.416-1.363-.465-2.427-.047-1.024-.06-1.379-.06-3.808v-.63c0-2.43.013-2.784.06-3.808.049-1.064.218-1.791.465-2.427a4.902 4.902 0 011.153-1.772A4.902 4.902 0 015.45 2.525c.636-.247 1.363-.416 2.427-.465C8.901 2.013 9.256 2 11.685 2h.63zm-.081 1.802h-.468c-2.456 0-2.784.011-3.807.058-.975.045-1.504.207-1.857.344-.467.182-.8.398-1.15.748-.35.35-.566.683-.748 1.15-.137.353-.3.882-.344 1.857-.047 1.023-.058 1.351-.058 3.807v.468c0 2.456.011 2.784.058 3.807.045.975.207 1.504.344 1.857.182.466.399.8.748 1.15.35.35.683.566 1.15.748.353.137.882.3 1.857.344 1.054.048 1.37.058 4.041.058h.08c2.597 0 2.917-.01 3.96-.058.976-.045 1.505-.207 1.858-.344.466-.182.8-.398 1.15-.748.35-.35.566-.683.748-1.15.137-.353.3-.882.344-1.857.048-1.055.058-1.37.058-4.041v-.08c0-2.597-.01-2.917-.058-3.96-.045-.976-.207-1.505-.344-1.858a3.097 3.097 0 00-.748-1.15 3.098 3.098 0 00-1.15-.748c-.353-.137-.882-.3-1.857-.344-1.023-.047-1.351-.058-3.807-.058zM12 6.865a5.135 5.135 0 110 10.27 5.135 5.135 0 010-10.27zm0 1.802a3.333 3.333 0 100 6.666 3.333 3.333 0 000-6.666zm5.338-3.205a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z",clipRule:"evenodd"})})}function p(e){let{className:t}=e;return(0,i.jsx)("svg",{className:t,fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,i.jsx)("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"})})}function m(){let[e,t]=(0,l.useState)(!1);(0,l.useEffect)(()=>{let e=()=>{window.scrollY>400?t(!0):t(!1)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]);let r=(0,l.useCallback)(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]);return e?(0,i.jsx)("button",{onClick:r,className:"fixed bottom-6 right-6 z-50 flex h-12 w-12 items-center justify-center rounded-full bg-gamma text-white shadow-lg transition-all hover:bg-gamma-light focus:outline-none focus:ring-2 focus:ring-gamma focus:ring-offset-2","aria-label":"Scroll to top",children:(0,i.jsx)("svg",{className:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})}):null}function f(e){let{siteName:t="Crazy Maple Studio Inc.",currentYear:r=new Date().getFullYear()}=e,n=o.Fz;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{}),(0,i.jsx)("footer",{className:"border-t border-white/[0.06] bg-[#111]",children:(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1920px] px-4 md:px-[60px] py-6",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-6 md:flex-row md:items-start md:justify-between md:gap-8",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-start gap-x-12 gap-y-5",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-widest text-white/70",children:"About"}),(0,i.jsxs)("nav",{className:"flex flex-col gap-1 text-[13px] text-white/50",children:[(0,i.jsx)(a(),{href:"/terms-of-service",className:"w-fit transition-colors hover:text-white",children:"Terms of Service"}),(0,i.jsx)(a(),{href:"/privacy-policy",className:"w-fit transition-colors hover:text-white",children:"Privacy Policy"}),(0,i.jsx)(a(),{href:"/subscription-policy",className:"w-fit transition-colors hover:text-white",children:"Subscription Policy"})]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-widest text-white/70",children:"Support"}),(0,i.jsx)("nav",{className:"flex flex-col gap-1 text-[13px] text-white/50",children:(0,i.jsx)(a(),{href:"/support",className:"w-fit transition-colors hover:text-white",children:"Contact Us"})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{className:"mb-2 text-xs font-semibold uppercase tracking-widest text-white/70",children:"Community"}),(0,i.jsxs)("div",{className:"flex gap-3",children:[(0,i.jsx)("a",{href:c.facebook,target:"_blank",rel:"noopener noreferrer",className:"text-white/70 transition-colors hover:text-white","aria-label":"Facebook",children:(0,i.jsx)(d,{className:"h-5 w-5"})}),(0,i.jsx)("a",{href:c.youtube,target:"_blank",rel:"noopener noreferrer",className:"text-white/70 transition-colors hover:text-white","aria-label":"YouTube",children:(0,i.jsx)(u,{className:"h-5 w-5"})}),(0,i.jsx)("a",{href:c.instagram,target:"_blank",rel:"noopener noreferrer",className:"text-white/70 transition-colors hover:text-white","aria-label":"Instagram",children:(0,i.jsx)(h,{className:"h-5 w-5"})}),(0,i.jsx)("a",{href:c.tiktok,target:"_blank",rel:"noopener noreferrer",className:"text-white/70 transition-colors hover:text-white","aria-label":"TikTok",children:(0,i.jsx)(p,{className:"h-5 w-5"})})]})]})]}),(0,i.jsxs)("div",{className:"flex items-start gap-3",children:[(0,i.jsx)("div",{className:"inline-block rounded-md bg-white p-1.5",children:(0,i.jsx)(s.h,{value:n,size:72,level:"M",bgColor:"#ffffff",fgColor:"#000000",title:"QR code to download Gamma Time app",imageSettings:{src:"/images/branding/gamma-app-icon.png",height:16,width:16,excavate:!0}})}),(0,i.jsxs)("div",{className:"flex flex-col",children:[(0,i.jsx)("span",{className:"text-xs font-semibold uppercase tracking-widest text-white/70",children:"Download"}),(0,i.jsx)("span",{className:"mt-0.5 text-[12px] text-white/60",children:"Scan to get the app"})]})]})]}),(0,i.jsx)("div",{className:"mt-5 border-t border-white/[0.06] pt-4 text-[12px] text-white/50",children:(0,i.jsxs)("p",{children:[r," ",t,". All rights reserved."]})})]})})]})}},95480:(e,t,r)=>{"use strict";r.r(t),r.d(t,{EpisodeWatchExperience:()=>f});var i=r(95155),n=r(15239),a=r(12115),l=r(20063),s=r(59130),o=r(60785),c=r(76951),d=r(21512),u=r(27036),h=r(31267),p=r(85878);function m(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"session-".concat(Math.random().toString(36).slice(2,11))}function f(e){var t,r,f,x,v;let b,{show:g,episode:w,nextEpisode:y,captions:j,fullScreen:k=!1,streamUrl:N,location:E="Series_Page",isFirstTime:_=!1}=e,C=(0,l.useRouter)(),[S,I]=(0,a.useState)(!1),P=w.isFree&&null!=(t=w.videoId)?t:void 0,T=y&&y.isFree&&null!=(r=y.videoId)?r:void 0,{resumeTime:L,saveProgress:A,clearProgress:R}=(0,d.Iu)(w.id),{addOrUpdateItem:F,removeItem:M}=(0,d.l)(),z=(0,p.qv)(),{current:D}=(0,d.RU)({currentVideoId:w.isFree?P:null,nextVideoId:T,showId:g.id}),U=w.isFree?null!=(f=null!=N?N:null==D?void 0:D.streamUrl)?f:w.streamToken?(0,u.mu)(w.streamToken):void 0:void 0,B=(0,a.useRef)(function(e){let t=Array.from(new Set(e)).sort((e,t)=>
1e-t),r=new Set;return{emit:e=>{if(!Number.isFinite(e)||e<0)return[];let i=[];return t.forEach(t=>{e>=t&&!r.has(t)&&(r.add(t),i.push(t))}),i},reset:()=>{r.clear()}}}([.25,.5,.75,.95])),W=(0,a.useRef)(null),O=(0,a.useRef)(m()),V=(0,a.useRef)(!1),K=(0,a.useRef)(0),H=(0,a.useRef)(0),G=(0,a.useRef)(null);(0,a.useEffect)(()=>{B.current.reset(),O.current=m(),V.current=!1,K.current=0,H.current=0,G.current=null},[w.id]);let{ref:q}=(0,d.v1)({threshold:.5});(0,a.useEffect)(()=>{I(!1)},[w.id,T]);let X=(0,a.useCallback)(e=>{let{currentTime:t,duration:r}=e;if(A(t,r),K.current=t,null!==G.current){let e=t-G.current;e>0&&e<2&&(H.current+=e)}G.current=t,!V.current&&H.current>=10&&(V.current=!0,(0,h.nV)({series_id:String(g.id),episode_id:String(w.id),is_first_time:_,sound_id:void 0,subtitles_id:void 0}));let i=r>0?t/r:0;B.current.emit(i).forEach(()=>{}),F({episodeId:w.id,showId:g.id,showTitle:g.title,showPosterImage:g.coverImage,showPosterPrompt:g.coverPrompt,episodeTitle:w.title,episodeNumber:w.episodeNumber,progressPercent:i})},[w.id,w.episodeNumber,w.title,A,g.id,g.coverImage,g.coverPrompt,g.title,F,_]),Y=(0,a.useCallback)(()=>{R(),M(w.id),(0,h.QR)({series_id:String(g.id),episode_id:String(w.id),is_first_time:_,sound_id:void 0,subtitles_id:void 0}),y&&y.isFree&&C.prefetch("/show/".concat(g.id,"/episode/").concat(y.id))},[R,w.id,_,y,M,C,g.id]),J=(0,a.useMemo)(()=>{let e=g.episodes,t=e.findIndex(e=>e.id===w.id);if(!(t<=0))for(let r=t-1;r>=0;r-=1){let t=e[r];if(t.isFree)return t}},[w.id,g.episodes]),$=(0,a.useMemo)(()=>{if(w.isFree)return{metadata:{title:w.title,artist:g.title,album:g.title,artwork:[{src:w.coverImage,sizes:"640x360"}]},onNextTrack:y&&y.isFree?()=>{C.push("/show/".concat(g.id,"/episode/").concat(y.id))}:void 0,onPreviousTrack:()=>{J&&C.push("/show/".concat(g.id,"/episode/").concat(J.id))}}},[w.coverImage,w.isFree,w.title,y,J,C,g.id,g.title]);w.isFree&&(P?U||(b=z?"missing_stream_token":"missing_customer_subdomain"):b="missing_video_id"),(0,a.useEffect)(()=>{if(!b){W.current=null;return}let e="".concat(w.id,":").concat(b);W.current!==e&&(W.current=e)},[w.id,z,g.id,b]);let Z=(0,a.useMemo)(()=>{let e;if(b){switch(b){case"missing_stream_token":e="We couldnât load this video just now. Please retry or come back later.";break;case"missing_customer_subdomain":e="Streaming setup is incomplete. Please contact support to enable playback.";break;case"missing_video_id":e="This episode is missing its stream source. Please check back soon.";break;default:e="Streaming is temporarily unavailable."}return{title:"Streaming temporarily unavailable",description:e}}},[b]),Q=(0,a.useMemo)(()=>{if(y&&y.isFree)return y},[y]),ee=null!=(x=null!=j?j:w.captions)?x:[],et=ee.length>0,er=(0,a.useMemo)(()=>{let e=g.episodes.filter(e=>e.isFree),t=e.findIndex(e=>e.id===w.id);return{onPrevious:J?()=>{J&&((0,h.NT)("episode_swipe",{series_id_from:String(g.id),episode_id_from:String(w.id),episode_time:Math.floor(K.current),series_id_to:String(g.id),episode_id_to:String(J.id),location:E}),C.push("/show/".concat(g.id,"/episode/").concat(J.id)))}:void 0,onNext:y&&y.isFree?()=>{y&&y.isFree&&((0,h.NT)("episode_swipe",{series_id_from:String(g.id),episode_id_from:String(w.id),episode_time:Math.floor(K.current),series_id_to:String(g.id),episode_id_to:String(y.id),location:E}),C.push("/show/".concat(g.id,"/episode/").concat(y.id)))}:void 0,hasPrevious:!!J,hasNext:!!(y&&y.isFree),currentEpisodeIndex:t>=0?t:void 0,totalEpisodes:e.length}},[w.id,y,J,C,g.episodes,g.id,E]);return(0,i.jsxs)("div",{className:k?"flex min-h-[100dvh] flex-col":"flex flex-col gap-6",children:[(0,i.jsx)("div",{className:k?"relative flex-1 overflow-hidden bg-black":"relative aspect-video overflow-hidden rounded-3xl border border-base-300 bg-base-200/40 shadow-hard",children:!k&&(0,i.jsx)(n.default,{src:w.coverImage,alt:w.title,fill:!0,priority:!0,className:"relative z-0 object-cover",sizes:"(max-width: 1024px) 100vw, 75vw"})}),!w.isFree&&(0,i.jsx)(s.GetAppPopup,{isOpen:!w.isFree,onClose:()=>{C.back()}}),w.isFree&&(0,i.jsx)(c.Player,{title:w.title,posterImage:w.coverImage,streamUrl:U,isFree:!0,isLoading:!1,resumeTime:L,onProgress:X,onEnded:Y,videoId:null!=(v=w.videoId)?v:void 0,streamFallback:Z,mediaSession:$,captions:ee,showId:g.id,episodeNavigation:er}),!k&&w.isFree&&!et&&(0,i.jsx)("div",{className:"rounded-2xl border border-base-300 bg-base-200/50 p-4 text-sm text-base-content/70",role:"status","aria-live":"polite",children:"Captions are not available for this episode yet."}),!k&&(0,i.jsx)("div",{ref:q,children:(0,i.jsx)(o.r,{episode:Q,showId:g.id,isPrefetched:S})})]})}},98157:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConditionalHeader:()=>l});var i=r(95155),n=r(20063),a=r(32813);function l(){let e=(0,n.usePathname)(),t=null==e?void 0:e.startsWith("/telegram"),r="/login"===e,l="/profile"===e;return t||r?null:(0,i.jsx)("div",{className:l?"hidden md:block":void 0,children:(0,i.jsx)(a.Header,{})})}},98590:(e,t,r)=>{"use strict";r.d(t,{Zl:()=>o,iS:()=>l,jF:()=>a,xX:()=>s,yD:()=>n});var i=r(31267);function n(){(0,i._u)("reach_end_of_content")}function a(e){(0,i._u)("scrolling_carousel",e)}
1function l(e){(0,i._u)("bottom_bar_clicks",e)}function s(e){(0,i._u)("lobby_system_popup_loading",e)}function o(e){(0,i._u)("lobby_system_popup_actions",e)}}}]);
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.