PageSourceSearch

https://www.anime.com/_next/static/chunks/0~wpq8f6gu5~s.js?dpl=dpl_CdjZC5KVz9ko3Vnic96QemM8pBux

js anime.com collected 2026-10-03 21:55:06 UTC 49,378 bytes, 130 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,951297,e=>{"use strict";var t=e.i(843476),s=e.i(772475),a=e.i(3763),l=e.i(126698),i=e.i(5569),r=e.i(185642),n=e.i(193902),o=e.i(130672),c=e.i(840278),d=e.i(534471);let m=new Intl.DateTimeFormat("en-US",{weekday:"short",month:"numeric",day:"numeric"}),u=new Intl.DateTimeFormat("en-US",{hour:"numeric",minute:"2-digit",timeZoneName:"short"}),h=["Airing","Upcoming"],p=e=>"Upcoming"===e?"Release Date":"Next Episode",x=({activeTab:e})=>(0,t.jsxs)("div",{className:(0,d.cn)("flex flex-col",r.SHOW_LIST_CONTAINER_GAP),children:[(0,t.jsxs)("div",{className:(0,d.cn)(r.SHOW_LIST_ROW_BASE_CLASS,"hidden rounded-2xl border border-white/5 bg-white/5 text-xs uppercase tracking-wide text-white/50 lg:flex"),"aria-hidden":!0,children:[(0,t.jsx)("span",{className:"w-16 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 font-medium",children:"Title"}),(0,t.jsxs)("div",{className:"hidden min-w-0 flex-1 grid-cols-2 gap-8 lg:grid",children:[(0,t.jsx)("span",{className:(0,d.cn)("font-medium",!h.includes(e)&&"invisible"),children:p(e)}),(0,t.jsx)("span",{className:(0,d.cn)("text-center font-medium","All"===e&&"invisible","All"!==e&&"md:block"),children:"Season"})]}),(0,t.jsx)("span",{className:"w-11 shrink-0"})]}),Array.from({length:10}).map((e,s)=>(0,t.jsxs)("div",{id:0===s?"scroll-sentinel":void 0,className:r.SHOW_LIST_CARD_CLASS,children:[(0,t.jsx)("div",{className:(0,d.cn)(r.SHOW_LIST_POSTER_CLASS,"animate-pulse")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,t.jsx)("div",{className:"bg-overlay-tertiary h-4 w-32 animate-pulse rounded"}),(0,t.jsxs)("div",{className:"flex h-6 items-center gap-1 rounded-lg",children:[(0,t.jsx)("div",{className:"bg-overlay-tertiary h-3 w-3 animate-pulse rounded-sm"}),(0,t.jsx)("div",{className:"bg-overlay-tertiary h-4 w-8 animate-pulse rounded"})]})]}),(0,t.jsxs)("div",{className:"hidden min-w-0 flex-1 grid-cols-2 gap-8 lg:grid",children:[(0,t.jsx)("div",{className:"bg-overlay-tertiary h-4 w-full max-w-40 animate-pulse rounded"}),(0,t.jsx)("div",{className:"flex justify-center",children:(0,t.jsx)("div",{className:"bg-overlay-tertiary h-4 w-6 animate-pulse rounded"})})]}),(0,t.jsx)("div",{className:"h-11 w-11 shrink-0 animate-pulse rounded-full bg-overlay-tertiary"})]},s))]}),g=({ipTitles:e,onShowClick:s,activeTab:a})=>{let{push:x}=(0,o.useStackedNavigation)();return(0,t.jsxs)("div",{className:(0,d.cn)("flex flex-col",r.SHOW_LIST_CONTAINER_GAP),children:[(0,t.jsxs)("div",{className:(0,d.cn)(r.SHOW_LIST_ROW_BASE_CLASS,"hidden rounded-2xl border border-white/5 bg-white/5 text-xs uppercase tracking-wide text-white/50 lg:flex"),"aria-hidden":!0,children:[(0,t.jsx)("span",{className:"w-16 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 flex-1 font-medium",children:"Title"}),(0,t.jsxs)("div",{className:"hidden min-w-0 flex-1 grid-cols-2 gap-8 lg:grid",children:[(0,t.jsx)("span",{className:(0,d.cn)("font-medium",!h.includes(a)&&"invisible"),children:p(a)}),(0,t.jsx)("span",{className:(0,d.cn)("text-center font-medium","All"===a&&"invisible","All"!==a&&"md:block"),children:"Season"})]}),(0,t.jsx)("span",{className:"w-11 shrink-0"})]}),e.map((e,o)=>{var p;let g,w,f,S,y,v,j=e.translation?.name??e.slug??"Unknown Title",I=e.translation?.posterImageUrl||e.translation?.backdropImageUrl,b=e.showPageSlug??e.slug,N=`/shows/${b}`,T=(0,c.getRatingFromVoteAverage)(e?.voteAverage),C=(0,c.titleTracksEpisodes)(e.type),A=C&&e.nextAiringEpisode?(g=new Date((p=e.nextAiringEpisode).episodeDate),w=`Ep ${p.episodeNumber}`,f=m.format(g),{episode:w,day:f,time:S=u.format(g),oneLine:`${w} • ${f} at ${S}`}):null,_=(0,c.resolveSeasonalPremiere)(e.seasonPremiere,e.seasonAirStartDate),k=(0,c.getSeasonalPremiereDisplay)(_),R="Upcoming"===a||!C,E=h.includes(a)?R?k?.shortLabel??null:A?.oneLine??null:null,P=h.includes(a)?R?k?.sentenceLabel??null:A?.oneLine??null:null;return(0,t.jsxs)("div",{role:"button",tabIndex:0,className:(0,d.cn)(r.SHOW_LIST_CARD_CLASS,"cursor-pointer"),onClick:e=>{e.defaultPrevented||e.target.closest("a,button,[role='button']")||(s(),x("show",N,{showSlug:b,detailVie
1wSource:"shows"}))},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s(),x("show",N,{showSlug:b,detailViewSource:"shows"}))},children:[(0,t.jsx)(l.default,{type:"show",path:N,params:{detailViewSource:"shows"},className:r.SHOW_LIST_POSTER_CLASS,onClick:s,children:I&&(0,t.jsx)("img",{src:(0,c.convertToSmallImageUrl)(I),alt:j,loading:"lazy",className:"absolute inset-0 h-full w-full object-cover"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1",children:[(0,t.jsx)(l.default,{type:"show",path:N,params:{detailViewSource:"shows"},className:"text-base font-medium text-primary",onClick:s,children:j}),T&&(0,t.jsxs)("div",{className:"flex h-6 items-center gap-1 rounded-lg","aria-label":`Rating: ${T} stars`,children:[(0,t.jsx)("svg",{viewBox:i.STAR_VIEWBOX,className:"h-3 w-3 shrink-0",fill:"none","aria-hidden":!0,children:(0,t.jsx)("path",{d:i.FULL_STAR_PATH,fill:"rgba(255, 255, 255, 0.5)"})}),(0,t.jsx)("span",{className:"text-base text-white/50 tabular-nums",children:T})]}),P&&(0,t.jsx)("div",{className:"text-sm text-white/50 tabular-nums lg:hidden",suppressHydrationWarning:!0,children:P})]}),(0,t.jsxs)("div",{className:"hidden min-w-0 flex-1 grid-cols-2 gap-8 lg:grid",children:[(0,t.jsx)("div",{className:"text-base text-white/50 tabular-nums",suppressHydrationWarning:!0,children:h.includes(a)?E??"-":""}),(0,t.jsx)("div",{className:(0,d.cn)("text-center text-base text-white/50 tabular-nums","All"===a?"hidden":"md:block"),children:"All"!==a?(v=(y="Upcoming"===a&&C?_?.seasonNumber:null)&&y>0?y:e.seasonCount)?`S${v}`:"-":""})]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center justify-end",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(n.default,{itemId:e.id,itemName:j,iconOnly:!0,source:"shows_homepage",ipTitle:e,position:"bottom-right"})})]},`${e.id}-${o}`)})]})};var w=e.i(428626),f=e.i(727925),S=e.i(493150),y=e.i(681684),v=e.i(795606),j=e.i(702807),I=e.i(138413),b=e.i(271645);let N=j.gql`
2  query GetUserTitleRatings($ipTitleIds: [ID!]!) {
3    getUserTitleRatings(ipTitleIds: $ipTitleIds) {
4      id
5      ipTitleId
6      rating
7      createdAt
8      updatedAt
9    }
10  }
11`,T=j.gql`
12  query GetUserTitleRatingsByUserId($userId: ID!, $ipTitleIds: [ID!]!) {
13    getUserTitleRatingsByUserId(userId: $userId, ipTitleIds: $ipTitleIds) {
14      id
15      ipTitleId
16      rating
17      createdAt
18      updatedAt
19    }
20  }
21`,C=({ipTitleIds:e,userId:t,skip:s=!1})=>{let a="string"==typeof t&&t.length>0,l=s||0===e.length||void 0!==t&&!a,{data:i,loading:r,error:n,refetch:o}=(0,I.useQuery)(N,{variables:{ipTitleIds:e},skip:l||a,fetchPolicy:"cache-and-network"}),{data:c,loading:d,error:m,refetch:u}=(0,I.useQuery)(T,{variables:{userId:t??"",ipTitleIds:e},skip:l||!a,fetchPolicy:"cache-and-network"}),h=a?c?.getUserTitleRatingsByUserId??[]:i?.getUserTitleRatings??[],p=(0,b.useMemo)(()=>h.reduce((e,t)=>(e[t.ipTitleId]=t.rating,e),{}),[h]),x=a?d:r;return{ratings:h,ratingsByTitleId:p,loading:x,error:a?m:n,refetch:a?u:o}};var A=e.i(581794),_=e.i(556533),k=e.i(5405),R=e.i(768673),E=e.i(846981),P=e.i(522016);let L=({ipInfo:e,episodeInfo:s,watchPartyId:l})=>{let i,r=(i=s.currentState)>=E.WatchPartyState.CHAT_OPEN&&i<=E.WatchPartyState.CREDITS,n=(0,R.getWatchPartyUrl)(l);return(0,t.jsx)("div",{className:"block w-full sm:hidden",children:(0,t.jsxs)(P.default,{href:n,prefetch:!1,className:"mb-2.5 flex w-full flex-row items-center gap-3",children:[(0,t.jsx)("div",{className:"bg-overlay-secondary relative h-full w-[calc(33.3333%-8px)] flex-shrink-0 overflow-hidden rounded-xl",style:{aspectRatio:a.CARD_ASPECT_RATIO},children:(0,t.jsx)("img",{src:e.posterImageUrl,alt:`${e.name} anime poster`,loading:"eager",decoding:"async",fetchPriority:"high",className:"absolute inset-0 h-full w-full object-cover"})}),(0,t.jsxs)("div",{className:"",children:[(0,t.jsx)(S.default,{theme:r?"pink":"green",currentEpisodeInfo:s,freeText:"Watch FREE",noBg:!r}),(0,t.jsx)("h1",{className:(0,d.cn)("text-primary line-clamp-2 text-sm font-medium",r?"mt-4":"mt-2"),children:e.name}),r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-secondary line-clamp-1 text-sm",children:e.isMarathon?e.marathonName||"":`E${s.episode.episodeNumber}${s.episode.episodeName?` - ${s.episode.episodeName}`:""}`}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(f.default,{size:"xs"})})]}):(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(w.default,{text:"More info"})})]})]})})}
21,M=({ipInfo:e,episodeInfo:s,onShowClick:l,watchPartyId:i})=>{let{ipTitle:r}=(0,y.useBasicShowPageIpTitle)({slug:e.slug}),n=(0,b.useMemo)(()=>(0,_.buildSimpleIpTitle)({id:e.id,installmentId:r?.installmentId??null,slug:e.slug,showPageSlug:r?.showPageSlug??e.slug,seasonCount:e.seasonCount,adult:r?.adult??!1,type:r?.type??null,status:r?.status??null,translation:{id:r?.translation?.id??e.id,name:e.name,posterImageUrl:e.posterImageUrl}}),[e.id,e.name,e.posterImageUrl,e.seasonCount,e.slug,r?.adult,r?.installmentId,r?.showPageSlug,r?.status,r?.translation?.id,r?.type]);return(0,t.jsx)("div",{className:"hidden sm:block",children:(0,t.jsx)(a.default,{ipTitle:n,onShowClick:l,currentEpisodeInfo:s,showWatchPartyStates:!0,watchPartyId:i,source:"shows_homepage",eager:!0,priority:!0,captionBelow:!0})})},W=({ipTitles:e,loading:s,hasError:l,hasMoreToLoad:i,loadMore:r,onShowClick:n,searchTextDebounced:o,selectedGenreIndexes:d,selectedTypeFilters:m,selectedNavContentTypes:u,viewMode:h,activeTab:p,showCommunityMeta:w=!1,suppressWatchPartyPromos:f=!1})=>{let S,{currentEpisodeInfo:y}=(0,v.useWatchPartyById)("fate-ubw"),j=((e,t,s)=>{if(!e||f||u.size>0||s&&m.has("movies")&&!m.has("shows")||o&&!t.searchKeywords.some(e=>e.toLowerCase().includes(o.toLowerCase())))return!1;if(d.size>0){let{genres:e=[],demographics:s=[],themes:a=[]}=(0,c.genreCategoriesToFilter)(Array.from(d).map(e=>c.ORDERED_GENRE_CATEGORIES[e])),l=t.themes??[];if(!e.every(e=>t.genres.includes(e))||s.length>0&&(!t.demographic||!s.includes(t.demographic))||!a.every(e=>l.includes(e)))return!1}return!0})(R.IS_FATE_STAY_NIGHT_WATCH_PARTY_ACTIVE,k.FATE_STAY_NIGHT_WATCH_PARTY_IP_INFO,!0);(0,b.useEffect)(()=>{if(!i||s||l)return;let e=new IntersectionObserver(e=>{e[0].isIntersecting&&r?.()},{threshold:0,rootMargin:"0px 0px 2000px 0px"}),t=document.getElementById("scroll-sentinel");return t&&e.observe(t),()=>e.disconnect()},[l,i,r,s]);let I=(S=new Set,(j&&S.add(k.FATE_STAY_NIGHT_WATCH_PARTY_IP_INFO.id),0===S.size)?e:e.filter(e=>!S.has(e.id))),{authenticated:N,ready:T}=(0,A.useAuth)(),{ratingsByTitleId:_}=C({ipTitleIds:(0,b.useMemo)(()=>e.map(e=>e.id).filter(e=>!!e),[e]),skip:!T||!N});return"list"===h?(0,t.jsx)(t.Fragment,{children:s||l?(0,t.jsx)(x,{activeTab:p}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(g,{ipTitles:I,onShowClick:n,activeTab:p}),i&&(0,t.jsx)(x,{activeTab:p})]})}):(0,t.jsxs)(t.Fragment,{children:[!s&&!l&&j&&(0,t.jsx)(L,{ipInfo:k.FATE_STAY_NIGHT_WATCH_PARTY_IP_INFO,episodeInfo:y,watchPartyId:"fate-ubw"}),(0,t.jsx)("div",{className:"grid w-full grid-cols-3 gap-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 xl:gap-x-4 xl:gap-y-8 2xl:grid-cols-7",children:s||l?(0,t.jsx)(a.LoadingCards,{numCards:28,withCaption:!0}):(0,t.jsxs)(t.Fragment,{children:[j&&(0,t.jsx)(M,{ipInfo:k.FATE_STAY_NIGHT_WATCH_PARTY_IP_INFO,episodeInfo:y,onShowClick:n,watchPartyId:"fate-ubw"}),I.map((e,s)=>(0,t.jsx)(a.default,{ipTitle:e,onShowClick:n,source:"shows_homepage",eager:s<12,priority:s<3,showCommunityMeta:w,activeTab:p,captionBelow:!0,ownerRating:_[e.id]},`${e.id}-${s}`)),i&&(0,t.jsx)(a.LoadingCards,{numCards:14,isPulsing:!0,withCaption:!0})]})})]})};var D=e.i(738751),O=e.i(857521),F=e.i(558184),U=e.i(417673);let B=({entry:e})=>{let s=e.coverImageUrls.slice(0,5);return 0===s.length?(0,t.jsx)("div",{className:"relative flex h-[132px] w-full min-w-0 items-end overflow-hidden",children:(0,t.jsx)("div",{className:"h-[132px] w-[90px] shrink-0 rounded-lg border-2 border-[hsla(var(--bg-l0))] bg-l1"})}):(0,t.jsx)("div",{className:"relative flex h-[132px] w-full min-w-0 items-end overflow-hidden",children:s.map((e,a)=>(0,t.jsx)("img",{src:e,alt:"",loading:"lazy",style:{zIndex:s.length-a},className:"relative h-[132px] w-[90px] shrink-0 -ml-[42px] first:ml-0 rounded-lg border-2 border-[hsla(var(--bg-l0))] object-cover shadow-[0_6px_16px_rgba(0,0,0,0.5)]"},a))})},$="group/card -m-2.5 flex min-w-0 flex-col rounded-[14px] p-2.5 transition-colors hover:bg-overlay-tertiary",G=({entry:e,position:s})=>{let{trackEvent:a}=(0,F.usePosthogMetrics)(),i=()=>a("watchGuideClicked",{guideId:e.id,kind:e.kind,position:s,isPostLink:e.isPostLink,source:"shows_featured"}),r=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B,{entry:e}),(0,t.jsxs)("div",{className:"min-w-0 pt-3.5",children:[(0,t.jsx)("h3",{className:"mb-2.5 line-clamp-2 text-[20px] font-bold leading-[1.16] tracking-[-0.01em] text-primary",children:e.title}),(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(D.GuideAuthorAvatar,{entry:e,className:"h-[22px] w-[22px]"}),(0,t.jsx)("span",{className:"truncate text-[13px] text-secondary",children:e.authorName}),(0,t.jsxs)("span",{className:"shrink-0 text-[13px] text-tertiary tabular-nums",children:["· ",e.picks," ",1===e.picks?"pick":"picks"]})]})]})]});return e.isPostLink?(0,t.jsx)(l.default,{type:"post",path:e.linkUrl,params:{id:e.id},"aria-label":e.title,className:$,onClick:i,children:r}):(0,t.jsx)(P.default,{href:e.linkUrl,prefetch:!1,"aria-label":e.title,className:$,onClick:i,children:r})},H=()=>(0,t.jsxs)("div",{className:"-m-2.5 flex animate-pulse flex-col p-2.5",children:[(0,t.jsx)("div",{className:"flex h-[132px] items-end overflow-hidden",children:(0,t.jsx)("div",{className:"h-[132px] w-[90px] rounded-lg bg-overlay-secondary"})}),(0,t.jsxs)("div",{className:"pt-3.5",children:[(0,t.jsx)("div",{className:"mb-2.5 h-[18px] w-4/5 rounded bg-overlay-secondary"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-[22px] w-[22px] rounded-md bg-overlay-secondary"}),(0,t.jsx)("div",{className:"h-[13px] w-24 rounded bg-overlay-secondary"})]})]})]}),z=()=>{let{featuredEntries:e,loading:s}=(0,O.useFeaturedGuides)(),{trackEvent:a}=(0,F.usePosthogMetrics)();return s||0!==e.length?(0,t.jsxs)("section",{className:"mt-12 border-t border-tertiary pt-10",children:[(0,t.jsxs)("div",{className:"mb-[18px] flex items-end justify-between gap-4",children:[(0,t.jsx)("h2",{className:"text-[23px] font-bold tracking-[-0.01em] text-primary",children:"Watch Guides"}),(0,t.jsxs)(P.default,{href:"/guides",prefetch:!1,onClick:()=>a("watchGuidesSeeMoreClicked",{source:"shows_featured"}),className:"group/more inline-flex shrink-0 items-center gap-1 text-sm font-semibold text-secondary transition-colors hover:text-primary",children:["See more",(0,t.jsx)(U.ChevronRightIcon,{className:"h-4 w-4 transition-transform group-hover/more:translate-x-[3px]"})]})]}),(0,t.jsx)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(185px,1fr))] gap-x-[22px] gap-y-6",children:s&&0===e.length?Array.from({length:3},(e,s)=>(0,t.jsx)(H,{},s)):e.map((e,s)=>(0,t.jsx)(G,{entry:e,position:s},e.id))})]}):null};var V=e.i(738692);let Y=j.gql`
22  query GetFeaturedIpTitlesPublic(
23    $languageCode: String!
24    $countryCode: String
25    $limit: Int
26    $dateKey: String
27  ) {
28    featuredIpTitles(
29      languageCode: $languageCode
30      countryCode: $countryCode
31      limit: $limit
32      dateKey: $dateKey
33    ) {
34      edges {
35        node {
36          id
37          installmentId
38          slug
39          showPageSlug
40          type
41          adult
42          status
43          genres
44          runtime
45          episodeCount
46          seasonCount
47          originalLanguageCode
48          originalCountryCode
49          originalAirDate
50          popularityScore
51          voteAverage
52          voteCount
53          animeIx
54          isAiringNow
55          translation(languageCode: $languageCode, countryCode: $countryCode) {
56            id
57            languageCode
58            name
59            alternativeNames
60            description
61            synopsis
62            localAirStartDate
63            localAirEndDate
64            posterImageUrl
65            backdropImageUrl
66            imageUrls
67            videos
68          }
69        }
70        cursor
71      }
72    }
73  }
74`,q=new Set,Q=new Set,K=new Set,J=({onShowClick:e})=>{let{ipTitles:a,loading:l,error:i}=(({limit:e=60,skip:t=!1}={})=>{let{languageCode:s,countryCode:a}=(0,V.getLocale)(),{data:l,loading:i,error:r}=(0,I.useQuery)(Y,{variables:{languageCode:s,countryCode:a,limit:e,dateKey:new Date().toISOString().slice(0,10)},skip:t});return{ipTitles:(0,b.useMemo)(()=>{let e=l?.featuredIpTitles?.edges;return e?e.map(({node:e})=>e).filter(e=>e.translation?.name&&(e.translation.posterImageUrl||e.translation.backdropImageUrl)):[]},[l]),loading:i,error:r}})({limit:60});return i?(0,t.jsx)(s.default,{}):l||0!==a.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W,{ipTitles:a,loading:l,hasError:!!i,hasMoreToLoad:!1,onShowClick:e,searchTextDebounced:"",selectedGenreIndexes:q,selectedTypeFilters:Q,selectedNavContentTypes:K,viewMode:"visual",activeTab:"All",showCommunityMeta:!0,suppressWatchPartyPromos:!0}),(0,t.jsx)(z,{})]}):(0,t.jsx)("div",{className:"flex min-h-[calc(100vh-300px)] w-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-secondary",children:"No featured titles right now. Check back soon."})})};var Z=e.i(705751),X=e.i(684937),ee=e.i(649980),et=e.i(743172);let es=()=>{let{authenticated:e,ready:s}=(0,A.useAuth)(),a=(0,ee.useStore)(e=>e.openSignupPopup);return!s||e?null:(0,t.jsx)("div",{className:"hidden shrink-0 items-center sm:flex",children:(0,t.jsxs)(X.Button,{variant:"secondary",size:"small",rounded:!0,className:"px-2 xl:px-3",leftIcon:(0,t.jsx)(et.ArrowUpTrayIcon,{}),onClick:()=>{let e=new URLSearchParams(window.location.search);e.set("type","watchlist"),a("mal_import_shows",`${window.location.pathname}?${e.toString()}`)},children:[(0,t.jsx)("span",{className:"xl:hidden",children:"Import"}),(0,t.jsx)("span",{className:"hidden xl:inline",children:"Import from MAL/AniList"})]})})};var ea=e.i(628878),el=e.i(414530),ei=e.i(411647);let er=()=>{let{trackEvent:e}=(0,F.usePosthogMetrics)(),s=(0,ee.useStore)(e=>e.watchListItems),a=(0,b.useMemo)(()=>(0,ei.getWatchlistRatingsTierListAvailability)(s??[]),[s]),[l,i]=(0,b.useState)(!1),[r,n]=(0,b.useState)(!1);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"hidden shrink-0 items-center gap-2 sm:flex",children:[(0,t.jsx)(ea.GenerateRatingsTierListButton,{availability:a,source:"shows_watchlist"}),(0,t.jsxs)(X.Button,{variant:"secondary",size:"small",rounded:!0,className:"px-2 xl:px-3",leftIcon:(0,t.jsx)(et.ArrowUpTrayIcon,{}),onClick:()=>{e("malImportStarted",{source:"shows_watchlist"}),n(!0),i(!0)},children:[(0,t.jsx)("span",{className:"xl:hidden",children:"Import"}),(0,t.jsx)("span",{className:"hidden xl:inline",children:"Import from MAL/AniList"})]})]}),r&&(0,t.jsx)(el.MalImportModalLazy,{open:l,onOpenChange:i,source:"shows_watchlist"})]})};var en=e.i(827929);function eo({selected:e,children:s,onClick:a,ariaLabel:l,disabled:i,className:r}){return(0,t.jsx)(X.Button,{type:"button",variant:e?"primary-neutral":"secondary",size:"small",rounded:!0,"aria-pressed":e,"aria-label":l,disabled:i,onClick:a,className:r,children:s})}var ec=e.i(977552),ed=e.i(628876),em=e.i(527986),eu=e.i(196463),eh=e.i(170202),ep=e.i(705971);let ex="watchlist",eg="recommendations",ew="fixedSeason",ef=c.ORDERED_GENRE_CATEGORIES.map((e,t)=>({...e,originalIndex:t})).filter(e=>!e.disabled),eS=ef.slice(0,7),ey=ef.slice(7);function ev({browseMode:e,onBrowseModeChange:s,seasonalSnapshotDate:a,fixedSeasonLabel:l,isWatchlistActive:i,isRecsActive:r,onSelectWatchlist:n,onSelectRecommendations:o,selectedGenreIndexes:m,setSelectedGenreIndexes:u,scrollToTop:h,searchText:p,setSearchText:x,viewMode:g,setViewMode:w,showWatchlistTab:f,watchlistStatusFilter:S,setWatchlistStatusFilter:y,watchlistSort:v,setWatchlistSort:j,watchlistFilterOptions:I}){let N=!!p.trim(),T=(0,b.useMemo)(()=>(0,c.getShowsBrowseModeOptions)(a),[a]),C=(0,b.useMemo)(()=>[...l?[{label:l,value:ew}]:[],...f?[{label:"My Watchlist",value:ex},{label:"Recommended for you",value:eg}]:[],...T],[f,T,l]),A=l?ew:i?ex:r?eg:e,_=m.size>0,k=(0,b.useMemo)(()=>ey.filter(e=>m.has(e.originalIndex)).length,[m]),R=e=>{let t=new Set(m);t.has(e)?t.delete(e):t.add(e),u(t)}
74,E=(0,b.useRef)(null),[P,L]=(0,b.useState)(!1),M=(0,b.useCallback)(()=>{let e=E.current;e&&L(e.scrollWidth-e.scrollLeft-e.clientWidth>1)},[]);return(0,b.useEffect)(()=>{let e=E.current;if(!e)return;M();let t=new ResizeObserver(M);return t.observe(e),()=>t.disconnect()},[M]),(0,b.useEffect)(()=>{M()},[M,i,r,f]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"sticky top-[63px] flex items-center justify-between gap-3 bg-l0 pb-3 pt-3 sm:top-[83px] sm:pb-4 sm:pt-4",style:{zIndex:eu.Z_NAVBAR-1},children:[(0,t.jsxs)("div",{className:"relative flex min-w-0 flex-1 items-center",children:[(0,t.jsxs)("div",{ref:E,onScroll:M,className:"flex w-full items-center gap-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[(0,t.jsx)(Z.default,{value:A,options:C,onChange:e=>{e!==ew&&(e===ex?n():e===eg?o():s(e))},placeholder:"Popular",className:"shrink-0"}),i&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Z.default,{value:S,options:I,onChange:e=>y(e),placeholder:"All statuses",className:"shrink-0"}),(0,t.jsx)(Z.default,{value:v,options:en.WATCHLIST_SORT_OPTIONS,onChange:e=>j(e),placeholder:"Sort",className:"shrink-0"})]}),!r&&(i||"featured"!==e)&&(0,t.jsxs)(t.Fragment,{children:[eS.map(e=>(0,t.jsx)(eo,{selected:m.has(e.originalIndex),disabled:N&&!i,ariaLabel:`Filter by ${e.displayName}`,className:"shrink-0",onClick:()=>R(e.originalIndex),children:e.displayName},e.displayName)),(0,t.jsxs)(ed.DropdownMenu,{children:[(0,t.jsx)(ed.DropdownMenuTrigger,{asChild:!0,disabled:N&&!i,children:(0,t.jsx)(X.Button,{variant:k>0?"primary-neutral":"secondary",size:"small",rounded:!0,rightIcon:(0,t.jsx)(ep.ChevronDownIcon,{}),className:"shrink-0",children:k>0?`More (${k})`:"More"})}),(0,t.jsxs)(ed.DropdownMenuContent,{align:"start",sideOffset:4,className:"bg-l0 border-secondary max-h-[400px] min-w-[200px] overflow-y-auto rounded-[14px] border p-2 shadow-2xl [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[_&&(0,t.jsx)(ed.DropdownMenuItem,{onSelect:e=>{e.preventDefault(),u(new Set),h()},className:"text-secondary flex w-full flex-row items-center justify-between gap-2 rounded-[10px] px-3 py-2.5 text-sm font-medium outline-none transition-colors focus:bg-transparent focus:outline-none focus-visible:ring-0 data-[highlighted]:bg-overlay-tertiary",children:"Reset"}),ey.map(e=>{let s=m.has(e.originalIndex);return(0,t.jsxs)(ed.DropdownMenuItem,{onSelect:t=>{t.preventDefault(),R(e.originalIndex)},className:(0,d.cn)("text-primary flex w-full flex-row items-center justify-between gap-2 rounded-[10px] px-3 py-2.5 text-sm font-medium outline-none transition-colors focus:bg-transparent focus:outline-none focus-visible:ring-0 data-[highlighted]:bg-overlay-tertiary",s&&"bg-overlay-secondary"),children:[e.displayName,s&&(0,t.jsx)(eh.CheckIcon,{className:"text-primary h-4 w-4"})]},e.displayName)})]})]})]})]}),P&&(0,t.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-0 right-0 w-10 bg-gradient-to-l from-[#0A0A0A] to-transparent"})]}),i&&(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,t.jsx)(er,{}),(0,t.jsx)(em.ViewModeToggle,{viewMode:g,setViewMode:w})]}),(0,t.jsx)(es,{})]}),(0,t.jsx)("div",{className:"mb-5 mt-3 sm:hidden",children:(0,t.jsx)(ec.default,{value:p,onChange:x,className:"w-full"})})]})}var ej=e.i(656084),eI=e.i(631197);function eb(){return(0,t.jsx)("div",{className:"h-[320px] animate-pulse rounded-[20px] bg-overlay-tertiary lg:h-[236px]"})}var eN=e.i(309757),eT=e.i(813316),eC=e.i(597561),eA=e.i(346944);let e_=(0,eC.buildAuthPopupHref)("/signup","/shows"),ek=j.gql`
75  query GetShowsHeroReviewStats {
76    myStats {
77      id
78      totalReviews
79    }
80  }
81`,eR=()=>{let{trackEvent:e}=(0,F.usePosthogMetrics)();return(0,t.jsxs)("section",{className:"relative flex min-h-[320px] flex-col-reverse items-start gap-5 overflow-hidden rounded-[20px] border border-border-secondary bg-overlay-tertiary px-6 py-8 sm:px-10 sm:py-[34px] lg:min-h-[236px] lg:flex-row lg:flex-wrap lg:items-center lg:justify-between lg:gap-8",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("h1",{className:"font-replica text-[22px] font-black leading-[1.22] tracking-[-0.02em] text-primary sm:whitespace-nowrap sm:text-[26px]",children:["Rate the anime you've watched.",(0,t.jsx)("br",{}),"Save the ones you want to see.",(0,t.jsx)("br",{}),"Tell everyone what's worth it."]}),(0,t.jsx)("div",{className:"mt-[22px]",children:(0,t.jsx)(X.Button,{variant:"primary-accent-raised",size:"large",href:e_,prefetch:!1,onClick:()=>e("signupAttempt",{source:"signup_banner"}),children:"Sign up free"})})]}),(0,t.jsx)("img",{src:"/deckysignup.png",alt:"",className:"h-16 w-auto shrink-0 object-contain lg:h-[150px]"})]})},eE=({onStatClick:e,onStatDeselect:s,isWatchlistActive:a,currentFilter:l})=>{let{authenticated:i}=(0,A.useAuth)(),{data:r,username:n}=(0,eN.useViewerSummary)(),o=r?.me?.pfpUrl??"",c=r?.me?.pfpBackgroun
81dColorHex,m=(0,ee.useStore)(e=>e.hasFetchedWatchList),u=(0,ee.useStore)((0,eA.useShallow)(e=>(0,eT.computeWatchlistStats)(e.watchListItems??[]))),{data:h}=(0,I.useQuery)(ek,{skip:!i,fetchPolicy:"cache-first"}),p=h?.myStats?.totalReviews,x=[{label:n?`${n}'s Watchlist`:"My Watchlist",value:m?u.totalCount:"—",filter:"ALL",withPfp:!0},{label:"Completed",value:m?u.completedCount:"—",filter:eI.WatchListStatus.Completed},{label:"Watching",value:m?u.watchingCount:"—",filter:eI.WatchListStatus.Watching},{label:"Planning",value:m?u.planningCount:"—",filter:eI.WatchListStatus.Planning},{label:"Dropped",value:m?u.droppedCount:"—",filter:eI.WatchListStatus.Dropped}],g=m&&null!==u.avgRating?u.avgRating.toFixed(1):"—";return(0,t.jsx)("div",{className:"flex flex-col gap-3 sm:gap-6",children:(0,t.jsxs)("div",{className:"grid w-full grid-cols-3 gap-1.5 sm:w-auto sm:gap-3 lg:grid-cols-6",children:[x.map(i=>{let r=a&&l===i.filter;return(0,t.jsxs)("button",{type:"button",onClick:()=>{r?s?.():e?.(i.filter)},className:(0,d.cn)("flex min-w-0 cursor-pointer rounded-2xl p-4 text-left transition-colors sm:h-20 sm:px-4 sm:py-3",i.withPfp?"flex-row items-center gap-2 sm:gap-3":"flex-col justify-center",r?"bg-overlay-secondary ring-1 ring-white/20":"bg-overlay-tertiary hover:bg-overlay-secondary"),children:[i.withPfp&&(0,t.jsx)(ej.default,{pfpUrl:o,background:c,enablePopOut:!1,className:"h-9 w-9 shrink-0 rounded-[9px] border border-white/10 sm:h-12 sm:w-12 sm:rounded-xl"}),(0,t.jsxs)("span",{className:"flex min-w-0 flex-col justify-center",children:[(0,t.jsx)("span",{className:"text-xs font-semibold leading-[1.15] text-primary tabular-nums sm:pb-0.5 sm:text-base",children:i.value}),(0,t.jsx)("span",{className:(0,d.cn)("text-[10px] leading-normal text-secondary sm:text-sm",i.withPfp&&"truncate"),children:i.label})]})]},i.filter)}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col justify-center gap-0.5 rounded-2xl bg-overlay-tertiary p-4 sm:h-20 sm:px-4 sm:py-3",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-semibold leading-[1.15] text-primary tabular-nums sm:text-base",children:g}),(0,t.jsx)("span",{className:"text-[10px] leading-normal text-secondary sm:text-sm",children:"Avg rating"})]}),(0,t.jsxs)("div",{className:"flex items-baseline gap-1.5",children:[(0,t.jsx)("span",{className:"text-xs font-semibold leading-[1.15] text-primary tabular-nums sm:text-base",children:p??"—"}),(0,t.jsx)("span",{className:"text-[10px] leading-normal text-secondary sm:text-sm",children:"Reviews"})]})]})]})})},eP=({onStatClick:e,onStatDeselect:s,isWatchlistActive:a,currentFilter:l})=>{let{authenticated:i,ready:r}=(0,A.useAuth)();return r?i?(0,t.jsx)(eE,{onStatClick:e,onStatDeselect:s,isWatchlistActive:a,currentFilter:l}):(0,t.jsx)(eR,{}):(0,t.jsx)(eb,{})};var eL=e.i(49987),eM=e.i(780428);let eW=()=>(0,t.jsx)("div",{className:en.WATCHLIST_GRID_CLASS,children:(0,t.jsx)(a.LoadingCards,{numCards:14,isPulsing:!0,withCaption:!0})});function eD(){let e=(0,b.useRef)(null),[t,s]=(0,b.useState)(0);return(0,b.useEffect)(()=>{let t=e.current;if(!t)return;let a=()=>{let e=getComputedStyle(t).gridTemplateColumns;s(e&&"none"!==e?e.split(" ").filter(Boolean).length:0)};if(a(),"u"<typeof ResizeObserver)return;let l=new ResizeObserver(a);return l.observe(t),()=>l.disconnect()},[]),[e,t]}let eO=j.gql`
82  query RecommendationsFromOnboardingShows(
83    $limit: Int
84    $excludeIds: [ID!]
85    $usePrimary: Boolean
86  ) {
87    recommendationsFromOnboardingShows(
88      limit: $limit
89      excludeIds: $excludeIds
90      usePrimary: $usePrimary
91    ) {
92      standardRecs {
93        ipTitleId
94        installmentId
95        showPageSlug
96        name
97        posterImageUrl
98        adult
99        reasons {
100          ipEntryId
101          name
102        }
103      }
104      trendsetterRecs {
105        ipTitleId
106        installmentId
107        showPageSlug
108        name
109        posterImageUrl
110        adult
111        reasons {
112          ipEntryId
113          name
114        }
115      }
116      contrarianRecs {
117        ipTitleId
118        installmentId
119        showPageSlug
120        name
121        posterImageUrl
122        adult
123        reasons {
124          ipEntryId
125          name
126        }
127      }
128    }
129  }
130`,eF=({recs:e,hasMore:s,loading:l,onShowMore:i,onShowClick:r,ratings
130ByTitleId:n})=>{let[o,c]=eD(),d=s&&c>0?e.slice(0,(0,en.fullRowItemCount)(e.length,c)):e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{ref:o,className:en.WATCHLIST_GRID_CLASS,children:d.map(e=>{let s=(0,_.buildSimpleIpTitle)({id:e.ipTitleId,installmentId:e.installmentId??null,slug:e.showPageSlug??"",showPageSlug:e.showPageSlug??null,adult:e.adult,translation:{name:e.name,posterImageUrl:e.posterImageUrl}});return(0,t.jsxs)("div",{children:[(0,t.jsx)(a.default,{ipTitle:s,source:"shows_homepage",onShowClick:r,captionBelow:!0,ownerRating:n[e.ipTitleId]}),e.reasons&&e.reasons.length>0&&(0,t.jsxs)("div",{className:"text-tertiary mt-0.5 text-xs leading-[1.4]",children:["Because you liked"," ",(0,t.jsx)("span",{className:"text-secondary",children:e.reasons[0].name}),e.reasons[1]&&(0,t.jsxs)(t.Fragment,{children:[" & ",(0,t.jsx)("span",{className:"text-secondary",children:e.reasons[1].name})]})]})]},e.installmentId??e.ipTitleId)})}),s&&(0,t.jsx)("div",{className:"w-full pt-4 md:pt-6",children:(0,t.jsx)(eM.ShowMore,{displayText:"Show more",icon:ep.ChevronDownIcon,loading:l,onClick:i})})]})},eU=({onShowClick:e,standalone:s=!1,emptyState:a})=>{let{authenticated:l,ready:i}=(0,A.useAuth)(),{trackEvent:r}=(0,F.usePosthogMetrics)(),n=(0,ee.useStore)(e=>e.watchListItems),o=(0,b.useMemo)(()=>(n??[]).filter(e=>e.status!==eI.WatchListStatus.Dropped).map(e=>`${(0,eL.getWatchlistItemId)(e)}:${e.rating??""}`).sort().join("|"),[n]),c=(0,ee.useStore)(e=>e.pendingWatchListWrites),d=(0,b.useRef)(o),m=c>0?d.current:o;d.current=m;let u=(0,ee.useStore)(e=>e.lastWatchListWriteCommittedAt),[h,p]=(0,b.useState)(()=>(0,eL.shouldReadWatchListFromPrimary)(ee.useStore.getState().lastWatchListWriteCommittedAt)),x=(0,b.useRef)(h);x.current=h;let g=(0,b.useCallback)(()=>{let e=(0,eL.shouldReadWatchListFromPrimary)(ee.useStore.getState().lastWatchListWriteCommittedAt);return e!==x.current&&(p(e),!0)},[]),[w,f]=(0,b.useState)([]),S=(0,b.useRef)(w);S.current=w;let y=(0,b.useRef)(m),{data:v,previousData:j,loading:N,error:T,refetch:_}=(0,I.useQuery)(eO,{variables:{limit:25,excludeIds:w,usePrimary:h},skip:!i||!l,fetchPolicy:"no-cache",onError:()=>{}}),[k,R]=(0,b.useState)(7),[E,P]=(0,b.useState)([]),[L,M]=(0,b.useState)(!1),W=(0,b.useRef)(!1),[D,O]=(0,b.useState)(null);(0,b.useEffect)(()=>{v&&O(y.current)},[v]);let U=i&&l,B=(0,b.useRef)(!1),$=(0,b.useRef)(m);(0,b.useEffect)(()=>{if(!U){B.current=!1;return}let e=$.current!==m;if($.current=m,!B.current){B.current=!0;return}e&&(R(7),P([]),M(!1),W.current=!1),y.current=m;let t=g();e&&S.current.length>0?f([]):t||_().catch(()=>{})},[U,m,u,g,_]);let G=(0,b.useMemo)(()=>{let e=new Set;for(let t of n??[]){let s=(0,eL.getWatchlistItemId)(t);s&&e.add(s),t.ipTitle?.id&&e.add(t.ipTitle.id),t.ipTitle?.installmentId&&e.add(t.ipTitle.installmentId)}return e},[n]),H=(0,b.useMemo)(()=>{let e=D===m?(v??j)?.recommendationsFromOnboardingShows:void 0;if(!e)return[];let t=[e.standardRecs??[],e.trendsetterRecs??[],e.contrarianRecs??[]],s=Math.max(0,...t.map(e=>e.length)),a=[];for(let e=0;e<s;e++)for(let s of t)e<s.length&&a.push(s[e]);let l=new Set,i=[];for(let e of a){if(!e.ipTitleId||G.has(e.ipTitleId)||e.installmentId&&G.has(e.installmentId))continue;let t=e.installmentId??e.ipTitleId;if(!l.has(t)&&(l.add(t),i.push(e),i.length>=35))break}return i},[v,j,D,m,G]),z=(0,b.useMemo)(()=>{let e=new Set,t=[];for(let s of[...E,...H]){let a=s.installmentId??s.ipTitleId;!a||e.has(a)||(e.add(a),t.push(s))}return t},[E,H]),V=(0,b.useRef)(0);(0,b.useEffect)(()=>{!W.current||N||(W.current=!1,!T&&z.length<=V.current&&M(!0))},[N,T,z.length]);let Y=z.length>0&&(k<z.length||!L),q=(0,b.useCallback)(()=>{let e=k+14,t=e>=z.length;if(r("watchlistRecsShowMoreClicked",{poolSize:z.length,refetched:t}),R(e),!t)return;W.current=!0,V.current=z.length,y.current=m;let s=g();P(z);let a=new Set(w);for(let e of z)e.ipTitleId&&a.add(e.ipTitleId),e.installmentId&&a.add(e.installmentId);let l=Array.from(a).slice(-400);if(l.length===w.length){s||_().catch(()=>{});return}f(l)},[z,k,w,m,g,_,r]),Q=(0,b.useMemo)(()=>z.slice(0,k),[z,k]),K=(0,b.useRef)(!1);(0,b.useEffect)(()=>{!K.current&&Q.length>0&&(K.current=!0,r("watchlistRecsSectionViewed",{poolSize:H.length}))},[Q.length,H.length,r]);let{ratingsByTitleId:J}=C({ipTitleIds:(0,b.useMemo)(()=>Q.map(e=>e.ipTitleId).filter(e=>!!e),[Q]),skip:!i||!l});return 0===Q.length?s?N?(0,t.jsx)(eW,{}):!T&&a?a:(0,t.jsx)("p",{className:"text-tertiary py-8 text-center text-sm",children:"No recommendations to show right now. Rate a few more shows or check back later."}):null:(0,t.jsxs)("section",{className:s?void 0:"mt-8",children:[!s&&(0,t.jsx)("div",{className:"mb-3 flex items-center gap-3",children:(0,t.jsx)("h2",{className:"text-primary text-lg font-bold",children:"Recommended for you"})}),(0,t.jsx)(eF,{recs:Q,hasMore:Y,loading:N,onShowMore:q,onShowClick:e,ratings
130ByTitleId:J})]})};var eB=e.i(650661);let e$=({onRateShows:e})=>(0,t.jsx)("div",{className:"flex min-h-[calc(100vh-300px)] w-full flex-col items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:"mb-4 h-[200px] w-[200px]",children:(0,t.jsx)("img",{src:"https://animedotcom.b-cdn.net/stickers/first-fans/default/8.png",alt:"",className:"h-full w-full"})}),(0,t.jsx)("p",{className:"text-secondary text-center",children:"Rate a few shows and we'll recommend what to watch next."}),(0,t.jsx)("p",{className:"text-tertiary mt-1 text-center text-sm",children:"Personalized picks build from the shows you've rated."}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsx)(X.Button,{onClick:e,variant:"primary-accent",size:"base",rounded:!0,leftIcon:(0,t.jsx)(eB.StarIcon,{}),children:"Rate shows"})})]})}),eG=({onShowClick:e,onRateShows:s})=>(0,t.jsx)(eU,{onShowClick:e,standalone:!0,emptyState:(0,t.jsx)(e$,{onRateShows:s})}),eH=({onRateShows:e})=>(0,t.jsx)("div",{className:"flex min-h-[calc(100vh-300px)] w-full flex-col items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:"mb-4 h-[200px] w-[200px]",children:(0,t.jsx)("img",{src:"https://animedotcom.b-cdn.net/stickers/first-fans/default/8.png",alt:"",className:"h-full w-full"})}),(0,t.jsx)("p",{className:"text-secondary text-center",children:"Add shows to your watchlist and they'll appear here!"}),(0,t.jsx)("p",{className:"text-tertiary mt-1 text-center text-sm",children:"Not sure where to start? Rate what you've watched to get personalized recs."}),(0,t.jsx)("div",{className:"mt-5",children:(0,t.jsx)(X.Button,{onClick:e,variant:"primary-accent",size:"base",rounded:!0,leftIcon:(0,t.jsx)(eB.StarIcon,{}),children:"Rate shows"})})]})});var ez=e.i(558662);let eV=({items:e,onShowClick:s,trimIncompleteLastRow:l=!1})=>{let[i,r]=eD(),n=l&&r>0?e.slice(0,(0,en.fullRowItemCount)(e.length,r)):e;return(0,t.jsx)("div",{ref:i,className:en.WATCHLIST_GRID_CLASS,children:n.map((e,l)=>(0,t.jsx)(a.default,{ipTitle:e.ipTitle,source:"shows_homepage",ownerRating:e.rating,onShowClick:s,eager:l<12,priority:l<3,captionBelow:!0},e.id))})};var eY=e.i(488568),eq=e.i(737197);let eQ=({viewMode:e,searchText:s,statusFilter:a,selectedGenreIndexes:l,sort:i,onShowClick:r})=>{let{watchListItems:n,updateStatusWithEpisodeSync:o,removeFromWatchList:d}=(0,eY.useWatchListStatusActions)(),{rateTitleRating:m,clearTitleRating:u,readyToUseRatings:h}=(0,eq.useUserTitleRatingActions)(),[p,x]=(0,b.useState)(null),g=(0,b.useMemo)(()=>n.filter(e=>null!=e.ipTitle),[n]),w=(0,b.useMemo)(()=>{let e=s.trim().toLowerCase(),t=e?g.filter(t=>(t.ipTitle?.translation?.name??t.ipTitle?.slug??"").toLowerCase().includes(e)):g,r=(0,en.filterWatchlistItemsByGenres)((0,en.filterWatchlistItemsByStatus)(t,a),l);return(0,en.sortWatchlistItems)(r,i)},[g,s,a,l,i]),f=(0,b.useCallback)(async(e,t,s,a)=>{if(m){x(e);try{await m(e,t,{ipName:s,source:"shows_watchlist",status:a})}finally{x(t=>t===e?null:t)}}},[m]),S=(0,b.useCallback)(async(e,t,s)=>{if(u){x(e);try{await u(e,{ipName:t,source:"shows_watchlist",status:s})}finally{x(t=>t===e?null:t)}}},[u]),y=(0,b.useCallback)(async(e,t)=>{let s=g.find(t=>(0,eL.getWatchlistItemId)(t)===e);if(!await o(e,t,{analyticsSource:"shows_watchlist",totalEpisodes:s?.ipTitle?(0,c.getTrackableEpisodeTotal)(s.ipTitle):null}))return},[o,g]),v=(0,b.useCallback)(async e=>{d&&await d(e,"shows_watchlist")},[d]),[j,I]=(0,b.useState)(24);(0,b.useEffect)(()=>{I(24)},[a,i,s,l]);let N=(0,b.useMemo)(()=>w.slice(0,j),[w,j]),T=w.length>j;if(0===w.length)return(0,t.jsx)("p",{className:"text-tertiary py-8 text-center text-sm",children:"No titles in your watchlist match these filters."});let C="ALL"===a&&""===s.trim()&&0===l.size;return(0,t.jsxs)(t.Fragment,{children:["list"===e?(0,t.jsx)(ez.ProfileWatchlistListView,{items:N,isOwnerViewing:!0,readyToUseRatings:!!h,pendingRatingIpTitleId:p,onRatingChange:f,onRatingClear:S,onStatusChange:y,onRemove:v,onShowClick:r}):(0,t.jsx)(eV,{items:N,onShowClick:r,trimIncompleteLastRow:T}),T&&(0,t.jsx)("div",{className:"w-full pt-4 md:pt-6",children:(0,t.jsx)(eM.ShowMore,{displayText:"Show more",icon:ep.ChevronDownIcon,onClick:()=>I(e=>e+24)})}),"list"!==e&&C&&(0,t.jsx)(eU,{onShowClick:r})]})};var eK=e.i(745891),eJ=e.i(267926),eZ=e.i(272220),eX=e.i(891947),e0=e.i(973722),e1=e.i(591103),e2=e.i(618566);let e5={"My Watchlist":"watchlist",Airing:null,Upcoming:"upcoming",All:"all"}
130,e3=new Set,e4=e=>{let t=new URL(window.location.href),s=e5[e];s?t.searchParams.set("type",s):t.searchParams.delete("type"),window.history.replaceState({},"",t)},e6=e=>{let t=new URL(window.location.href),s=c.SHOWS_BROWSE_MODE_TO_QUERY_PARAM[e];s?t.searchParams.set("type",s):t.searchParams.delete("type"),window.history.replaceState({},"",t)};e.s(["default",0,({seasonalSnapshotDateIso:e,fixedSeason:a})=>{let l=(0,e2.useRouter)(),i=a?(0,e0.getSeasonBrowseLabel)(a):void 0,{isMobile:r,isMobileOnly:n}=(0,e1.useDevice)(),o=(0,b.useRef)(null),m=(0,b.useRef)(null),u=(0,b.useMemo)(()=>new Date(e),[e]),h=(0,ee.useStore)(e=>e.showsSearchQuery),p=(0,ee.useStore)(e=>e.setShowsSearchQuery),[x,g]=(0,b.useState)(""),[w,f]=(0,b.useState)(0),[S,y]=(0,b.useState)(new Set([])),[v,j]=(0,b.useState)("popular"),[I,N]=(0,b.useState)(!1),[T,C]=(0,b.useState)(!1),[_,k]=(0,b.useState)("visual"),[R,E]=(0,b.useState)("ALL"),[P,L]=(0,b.useState)("UPDATED_NEWEST"),[M,D]=(0,b.useState)(!1),{isSmallScreen:O}=(0,eZ.useScreenSize)(),{authenticated:U,ready:B}=(0,A.useAuth)(),{trackEvent:$}=(0,F.usePosthogMetrics)(),G=(0,b.useCallback)(e=>{P!==e&&(L(e),$("watchlistSortSelected",{source:"my_watchlist",sort:(0,en.watchlistSortAnalyticsValue)(e)}))},[$,P]),H=I?"My Watchlist":"airing"===v?"Airing":"upcoming"===v?"Upcoming":"All",z=(0,b.useMemo)(()=>"All"===H?new Set:new Set([H]),[H]),V=M||I||T,{watchListError:Y}=(0,eX.useUserWatchListData)({skip:!V}),q=(0,ee.useStore)((0,eA.useShallow)(e=>(e.watchListItems??[]).map(e=>(0,eL.getWatchlistItemId)(e)).filter(e=>!!e))),Q=(0,ee.useStore)(e=>e.hasFetchedWatchList),K=(0,ee.useStore)(e=>e.watchListItems),Z=(0,b.useMemo)(()=>(0,en.buildWatchlistFilterOptions)(K??[]),[K]),X=U&&Q,et=I&&Q&&0===q.length,es=I&&U&&!Q&&!Y,ea=T&&U&&!Q&&!Y,[el,ei]=(0,b.useState)([]),[er,eo]=(0,b.useState)(!1),ec=(0,b.useMemo)(()=>(0,c.getNavContentFilters)(u),[u]);(0,b.useEffect)(()=>{let e=null,t=null,s=!1,a=()=>{s||D(!0)},l=()=>{if("function"==typeof window.requestIdleCallback){t=window.requestIdleCallback(a,{timeout:500});return}e=window.setTimeout(a,500)};return"complete"===document.readyState?l():window.addEventListener("load",l,{once:!0}),()=>{s=!0,window.removeEventListener("load",l),null!==t&&"function"==typeof window.cancelIdleCallback&&window.cancelIdleCallback(t),null!==e&&window.clearTimeout(e)}},[]);let ed=(0,b.useMemo)(()=>"allShows"===v?[...c.SHOW_TYPES]:"allMovies"===v?[...c.MOVIE_TYPES]:0===z.size?[...c.SHOW_TYPES,...c.MOVIE_TYPES]:Array.from(z).map(e=>ec[e]).reduce((e,t)=>0===e.length?t.types:e.filter(e=>t.types.includes(e)),[]),[v,ec,z]),em=(0,b.useMemo)(()=>a?(0,c.toGraphqlAnimeScheduleSeasonFilter)(a):Array.from(z).map(e=>ec[e].animeScheduleSeason).filter(e=>!!e)[0],[a,ec,z]),eu=(0,b.useCallback)(e=>{N(!1),C(!1),j(e)},[]),eh=(0,b.useMemo)(()=>{switch(v){case"recent":{let e=new Date(u);return e.setUTCHours(0,0,0,0),{sortByAirDate:!0,originalAirDateStart:e.toISOString(),limit:c.RECENTLY_ADDED_LIMIT}}case"top":return{sortByVoteAverage:!0,voteAverageMin:c.HIGHEST_RATED_MIN_VOTE_AVERAGE};default:return{sortByVoteCount:!0}}},[v,u]);(0,b.useEffect)(()=>{if(i)return void p("");{let e=new URLSearchParams(window.location.search),t=e.get("type"),s=e.has("type");s&&(t?.toLowerCase()==="watchlist"?N(!0):t?.toLowerCase()==="recommendations"?C(!0):eu((0,c.getShowsBrowseModeFromQueryParam)(t)));let a=sessionStorage.getItem("shows_searchText"),l=sessionStorage.getItem("shows_genreIndexes"),i=sessionStorage.getItem("shows_browseMode"),r=sessionStorage.getItem("shows_watchlistActive"),n=sessionStorage.getItem("shows_recsActive"),m=sessionStorage.getItem("shows_scrollY");if(a&&(p(a),sessionStorage.removeItem("shows_searchText")),l){let e=JSON.parse(l);y(new Set((Array.isArray(e)?e:[]).filter(e=>"number"==typeof e&&e>=0&&e<c.ORDERED_GENRE_CATEGORIES.length))),sessionStorage.removeItem("shows_genreIndexes")}!s&&("true"===r?N(!0):"true"===n?C(!0):i&&eu((0,c.getShowsBrowseModeFromQueryParam)(i))),sessionStorage.removeItem("shows_browseMode"),sessionStorage.removeItem("shows_watchlistActive"),sessionStorage.removeItem("shows_recsActive");let u=sessionStorage.getItem("shows_watchlistStatusFilter");u&&(E(u),sessionStorage.removeItem("shows_watchlistStatusFilter"));let h=sessionStorage.getItem("shows_watchlistSort");if(h&&(L(h),sessionStorage.removeItem("shows_watchlistSort")),m){let e=Number(m);f(e),sessionStorage.removeItem("shows_scrollY"),e>0&&(0,d.scrollTargetTo)((0,d.getScrollTarget)(o.current),e,"instant")}}},[eu,i,p]),(0,b.useEffect)(()=>()=>{p(""),sessionStorage.removeItem("shows_searchText")},[p]);let{ipTitles:ep,loading:ex,error:eg,hasMoreToLoad:ew,loadMore:ef}=(0,eJ.useShowsBrowseIpTitles)({first:eh.limit??(n||O?15:24),filter:{name:x.trim(),languageCode:"en",fallbackOnOriginalVersion:!0,sortByVoteCount:eh.sortByVoteCount,sortByVoteAverage:eh.sortByVoteAverage,sortByAirDate:eh.sortByAirDate,voteAverageMin:eh.voteAverageMin,originalAirDateStart:eh.originalAirDateStart,sortOrder:"DESC",adult:!1,...(0,c.genreCategoriesToFilter)(Array.from(S).map(e=>c.ORDERED_GENRE_CATEGORIES[e])),types:ed,animeScheduleSeason:em},skip:I||T||"featured"===v,includeExtendedFields:!1,includeNextEpisode:"airing"===v,includeReleaseDate:"upcoming"===v||"airing"===v}),eS=null==eh.limit&&ew,ey=(0,b.useMemo)(()=>ex&&x?el:ep,[ep,x,ex]),ej=()=>{let e=(0,d.getScrollTarget)(o.current),t=m.current,s=window.matchMedia("(min-width: 640px)").matches?84:64;if(!t||!(0,d.isElementScrollTarget)(e))return void(0,d.scrollTargetTo)(e,0,"instant");let a=e.getBoundingClientRect().top,l=t.getBoundingClientRect().top,i=Math.max(0,e.scrollTop+(l-a)-s);e.scrollTop<=i||(0,d.scrollTargetTo)(e,i,"instant")},eI=e=>{for(let e of["shows_searchText","shows_genreIndexes","shows_browseMode","shows_watchlistActive","shows_re
130csActive","shows_scrollY"])sessionStorage.removeItem(e);l.push(`/shows?type=${e}`)},eb=e=>{a?eI(c.SHOWS_BROWSE_MODE_TO_QUERY_PARAM[e]??"all"):(h.trim()&&(p(""),g("")),eu(e),e6(e),ej())},eN=(0,b.useCallback)(e=>{h.trim()&&(p(""),g("")),C(!1),N(!0),E(e),e4("My Watchlist"),ej()},[h,p]),eT=(0,b.useCallback)(()=>{N(!1),C(!1),e6(v)},[v]);(0,b.useEffect)(()=>{!B||(!U||Q||Y)&&!X&&(I||T)&&(N(!1),C(!1),j("popular"),e6("popular"))},[B,U,Q,Y,X,I,T]),(0,b.useEffect)(()=>{i||h.trim()&&!I&&(y(new Set),C(!1),j("popular"),e6("popular"))},[h,I,i]),(0,b.useEffect)(()=>{let e=window.setTimeout(()=>{g(h)},300);return()=>window.clearTimeout(e)},[h]),(0,b.useEffect)(()=>{ex||eg||ei(ep)},[ep,ex,eg]);let eC=(0,b.useCallback)(()=>{let e=(0,d.getScrollTargetTop)((0,d.getScrollTarget)(o.current));!er||h||r||eo(!1),f(e)},[er,h]),e_=()=>{!a&&(h&&sessionStorage.setItem("shows_searchText",h),S.size>0&&sessionStorage.setItem("shows_genreIndexes",JSON.stringify(Array.from(S))),sessionStorage.setItem("shows_browseMode",v),sessionStorage.setItem("shows_watchlistActive",String(I)),sessionStorage.setItem("shows_recsActive",String(T)),sessionStorage.setItem("shows_watchlistStatusFilter",R),sessionStorage.setItem("shows_watchlistSort",P),w&&sessionStorage.setItem("shows_scrollY",w.toString()))};(0,b.useEffect)(()=>(0,d.addScrollTargetListener)((0,d.getScrollTarget)(o.current),eC),[eC]);let ek=0===ep.length&&!ex&&!eg,eR=ex&&x&&el.length>0,eE=S.size>0||z.size>0,eM=(0,t.jsx)("div",{className:"flex min-h-[calc(100vh-300px)] w-full flex-col items-center justify-center",children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center ",children:[(0,t.jsx)("div",{className:"mb-4 h-[200px] w-[200px]",children:(0,t.jsx)("img",{src:"https://animedotcom.b-cdn.net/stickers/first-fans/default/8.png",alt:"",className:"h-full w-full"})}),(0,t.jsx)("p",{className:"text-secondary",children:I?"No titles in your watchlist match these filters.":"Oops! Looks like nothing matched your search."}),I?(0,t.jsx)("p",{className:"text-tertiary mt-1 text-sm",children:"Try removing some filters or add more shows to your watchlist."}):eE&&(0,t.jsx)("p",{className:"text-tertiary mt-1 text-sm",children:"Try removing some filters to see more results."})]})});return(0,t.jsx)("div",{className:"flex min-h-screen w-full",children:(0,t.jsx)("div",{className:"flex w-full items-start",children:(0,t.jsx)("div",{ref:o,className:"h-screen w-full overflow-x-clip overflow-y-auto desktop-scrollbar [scrollbar-gutter:stable]","data-radix-scroll-area-viewport":"","data-page-scroll-container":"shows-homepage",children:(0,t.jsx)("div",{className:"w-full",children:(0,t.jsxs)("div",{className:"relative flex min-h-screen flex-col px-page-content-x pt-page-content-top sm:px-page-content-x-sm sm:pt-page-content-top-sm",children:[(0,t.jsx)("div",{className:"mb-4 sm:mb-5",children:i?(0,t.jsxs)("h1",{className:"font-replica text-2xl font-bold text-primary sm:text-3xl",children:[i," Anime"]}):(0,t.jsx)(eP,{onStatClick:eN,onStatDeselect:eT,isWatchlistActive:I,currentFilter:R})}),(0,t.jsx)("div",{ref:m,"aria-hidden":!0}),(0,t.jsx)(ev,{browseMode:v,onBrowseModeChange:eb,seasonalSnapshotDate:u,fixedSeasonLabel:i,isWatchlistActive:I,isRecsActive:T,onSelectWatchlist:()=>{a?eI("watchlist"):(h.trim()&&(p(""),g("")),C(!1),N(!0),e4("My Watchlist"),ej())},onSelectRecommendations:()=>{let e;a?eI("recommendations"):(h.trim()&&(p(""),g("")),N(!1),C(!0),(e=new URL(window.location.href)).searchParams.set("type","recommendations"),window.history.replaceState({},"",e),ej())},selectedGenreIndexes:S,setSelectedGenreIndexes:y,scrollToTop:ej,searchText:h,setSearchText:p,showWatchlistTab:X,viewMode:_,setViewMode:k,watchlistStatusFilter:R,setWatchlistStatusFilter:E,watchlistSort:P,setWatchlistSort:G,watchlistFilterOptions:Z}),(0,t.jsx)("div",{className:"flex-1",children:T?ea?(0,t.jsx)(eW,{}):(0,t.jsx)(eG,{onShowClick:e_,onRateShows:()=>eb("popular")}):es?(0,t.jsx)(eW,{}):et?(0,t.jsx)(eH,{onRateShows:()=>eb("popular")}):X&&I?(0,t.jsx)(eQ,{viewMode:_,searchText:x,statusFilter:R,selectedGenreIndexes:S,sort:P,onShowClick:e_}):"featured"===v?(0,t.jsx)(J,{onShowClick:e_}):eg?(0,t.jsx)(s.default,{}):ek?eM:(0,t.jsx)(W,{ipTitles:ey,loading:ex&&!eR,hasError:!!eg,hasMoreToLoad:eS,loadMore:ef,onShowClick:e_,searchTextDebounced:x,selectedGenreIndexes:S,selectedTypeFilters:e3,selectedNavContentTypes:z,viewMode:"visual",activeTab:H,suppressWatchPartyPromos:!!a})}),(0,t.jsx)(eK.default,{})]})})})})})}],951297)}]);

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.