diff --git a/app/(site)/favorites/page.tsx b/app/(site)/favorites/page.tsx index bed8903..0d98beb 100644 --- a/app/(site)/favorites/page.tsx +++ b/app/(site)/favorites/page.tsx @@ -1,28 +1,14 @@ import { Metadata } from 'next'; import UsersList from '@/components/UsersLists'; -import { session as getSession } from '@/data'; -import usersShowsQuery from '@/data/queries/usersShows'; +import { session } from '@/data'; import { TITLE } from '@/env'; -import getQueryClient from '@/lib/queryClient'; export const metadata: Metadata = { title: `My Favorite Shows - ${TITLE}`, description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.` }; -const Favorites = async () => { - const session = await getSession(); - const queryClient = getQueryClient(); - - const list = 'favorite'; - const showType = 'movie'; - - if (session) { - queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session })); - } - - return ; -}; +const Favorites = async () => ; export default Favorites; diff --git a/app/(site)/page.tsx b/app/(site)/page.tsx index a254a02..306021a 100644 --- a/app/(site)/page.tsx +++ b/app/(site)/page.tsx @@ -1,16 +1,5 @@ -import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental'; - -import randomQuery from '@/data/queries/random'; -import getQueryClient from '@/lib/queryClient'; - import Container from './container'; -const Random = () => { - const queryClient = getQueryClient(); - - queryClient.prefetchInfiniteQuery(randomQuery()); - - return ; -}; +const Random = () => ; export default Random; diff --git a/app/(site)/popular/page.tsx b/app/(site)/popular/page.tsx index 7219371..76be957 100644 --- a/app/(site)/popular/page.tsx +++ b/app/(site)/popular/page.tsx @@ -1,8 +1,6 @@ import { Metadata } from 'next'; -import popularQuery from '@/data/queries/popular'; import { TITLE } from '@/env'; -import getQueryClient from '@/lib/queryClient'; import Container from './container'; @@ -11,12 +9,6 @@ export const metadata: Metadata = { description: `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.` }; -const Popular = () => { - const queryClient = getQueryClient(); - - queryClient.prefetchInfiniteQuery(popularQuery()); - - return ; -}; +const Popular = () => ; export default Popular; diff --git a/app/(site)/similar/page.tsx b/app/(site)/similar/page.tsx index b599190..08c2ad0 100644 --- a/app/(site)/similar/page.tsx +++ b/app/(site)/similar/page.tsx @@ -1,16 +1,5 @@ -import similarQuery from '@/data/queries/similar'; -import getQueryClient from '@/lib/queryClient'; - import Container from './container'; -const Similar = ({ searchParams }: { searchParams: Record }) => { - const queryClient = getQueryClient(); - - const { id, type } = searchParams || {}; - - queryClient.prefetchInfiniteQuery(similarQuery({ showId: id, showType: type as Show['type'] })); - - return ; -}; +const Similar = () => ; export default Similar; diff --git a/app/(site)/starring/page.tsx b/app/(site)/starring/page.tsx index 1c96cc9..8690762 100644 --- a/app/(site)/starring/page.tsx +++ b/app/(site)/starring/page.tsx @@ -1,16 +1,5 @@ -import popularQuery from '@/data/queries/popular'; -import getQueryClient from '@/lib/queryClient'; - import Container from './container'; -const Starring = ({ searchParams }: { searchParams: Record }) => { - const queryClient = getQueryClient(); - - const { actorId } = searchParams || {}; - - queryClient.prefetchInfiniteQuery(popularQuery({ sortBy: 'vote_average.desc', starring: actorId })); - - return ; -}; +const Starring = () => ; export default Starring; diff --git a/app/(site)/top/page.tsx b/app/(site)/top/page.tsx index 4aff874..804e675 100644 --- a/app/(site)/top/page.tsx +++ b/app/(site)/top/page.tsx @@ -1,8 +1,6 @@ import { Metadata } from 'next'; -import popularQuery from '@/data/queries/popular'; import { TITLE } from '@/env'; -import getQueryClient from '@/lib/queryClient'; import Container from './container'; @@ -11,12 +9,6 @@ export const metadata: Metadata = { description: `Discover the top-rated movies on ${TITLE}. Find the highest-rated films and make informed viewing choices.` }; -const Top = () => { - const queryClient = getQueryClient(); - - queryClient.prefetchInfiniteQuery(popularQuery({ sortBy: 'vote_average.desc' })); - - return ; -}; +const Top = () => ; export default Top; diff --git a/app/(site)/watch-list/page.tsx b/app/(site)/watch-list/page.tsx index 3f5c2c9..0bc3d9c 100644 --- a/app/(site)/watch-list/page.tsx +++ b/app/(site)/watch-list/page.tsx @@ -1,28 +1,14 @@ import { Metadata } from 'next'; import UsersList from '@/components/UsersLists'; -import { session as getSession } from '@/data'; -import usersShowsQuery from '@/data/queries/usersShows'; +import { session } from '@/data'; import { TITLE } from '@/env'; -import getQueryClient from '@/lib/queryClient'; export const metadata: Metadata = { title: `My watch list - ${TITLE}`, description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.` }; -const WatchList = async () => { - const session = await getSession(); - const queryClient = getQueryClient(); - - const list = 'watchlist'; - const showType = 'movie'; - - if (session) { - queryClient.prefetchInfiniteQuery(usersShowsQuery({ showType, list, session })); - } - - return ; -}; +const WatchList = async () => ; export default WatchList; diff --git a/components/Header/components/Search/index.tsx b/components/Header/components/Search/index.tsx index 7691c55..bcef5bf 100644 --- a/components/Header/components/Search/index.tsx +++ b/components/Header/components/Search/index.tsx @@ -2,10 +2,11 @@ import { ChangeEvent, MutableRefObject, useRef, useState } from 'react'; import { create } from 'react-modal-promise'; -import { Search as SearchIcon, XCircle } from 'lucide-react'; +import { Search as SearchIcon, X } from 'lucide-react'; import List from '@/components/List'; import { Button } from '@/components/ui/button'; +import ButtonsGroup from '@/components/ui/buttons-group'; import { Modal } from '@/components/ui/dialog'; import { Input } from '@/components/ui/input'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; @@ -46,25 +47,25 @@ export const showSearchModal = create(({ onResolve }) => { return ( -
- - +
+ + + +
{isFetchedRef.current && (
diff --git a/components/Preview/components/Torrents/index.tsx b/components/Preview/components/Torrents/index.tsx index e1bf6fd..e271c48 100644 --- a/components/Preview/components/Torrents/index.tsx +++ b/components/Preview/components/Torrents/index.tsx @@ -1,10 +1,13 @@ -import React, { useState } from 'react'; +import React, { FormEvent, useState } from 'react'; import { create, InstanceProps } from 'react-modal-promise'; import { TabsContent } from '@radix-ui/react-tabs'; import { Loader } from 'lucide-react'; +import { Search } from 'lucide-react'; import { Button } from '@/components/ui/button'; +import ButtonsGroup from '@/components/ui/buttons-group'; import { Modal } from '@/components/ui/dialog'; +import { Input } from '@/components/ui/input'; import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { Sort } from '@/data/parsers'; @@ -19,20 +22,31 @@ interface Props extends InstanceProps { backdrop: string; } -const showTorrentsModal = create(({ title, year, imdbID, backdrop, onResolve }: Props) => { +const showTorrentsModal = create(({ title: initialTitle, year, imdbID, backdrop, onResolve }: Props) => { const [sort, setSort] = useState(Sort.seeds); - const [withYear, setWithYear] = useState(true); - const yts = useTorrents({ query: title, queryFn: providers.yts.queryFn, sort, key: providers.yts.key, imdbID }); + const initialQuery = `${initialTitle} ${year}`; + + const [title, setTitle] = useState(initialQuery); + + const [query, setQuery] = useState(title); + + const yts = useTorrents({ + query: initialTitle, + queryFn: providers.yts.queryFn, + sort, + key: providers.yts.key, + imdbID + }); const tpb = useTorrents({ - query: withYear ? `${title} ${year}` : title, + query, queryFn: providers.tpb.queryFn, sort, key: providers.tpb.key, imdbID }); const tlk = useTorrents({ - query: withYear ? `${title} ${year}` : title, + query, queryFn: providers.tlk.queryFn, sort, key: providers.tlk.key, @@ -54,21 +68,33 @@ const showTorrentsModal = create(({ title, year, imdbID, backdrop, onResolve }: } ]; + const handleSearch = (event: FormEvent) => { + event.preventDefault(); + + setQuery(title || initialQuery); + }; + const checkIsEmpty = (query: (typeof tabs)[number]['query']) => query.isFetched && !query.isLoading && !query.data?.length; return ( -
- {title} - -
+
+ + setTitle(target.value)} placeholder='Start typing title...' /> + + +
{tabs.map(({ provider, query }) => ( - + {query.isLoading ? : provider.label} ))} diff --git a/components/ui/input.tsx b/components/ui/input.tsx index d279c51..6a52546 100644 --- a/components/ui/input.tsx +++ b/components/ui/input.tsx @@ -1,10 +1,29 @@ import * as React from 'react'; +import { useLayoutEffect, useRef } from 'react'; import { cn } from '@/lib/utils'; export interface InputProps extends React.InputHTMLAttributes {} const Input = React.forwardRef(({ className, type, ...props }, ref) => { + const inputRef = useRef(); + + const handleRef = (element: HTMLInputElement) => { + if (!element) return; + + inputRef.current = element; + + if (!ref) return; + + typeof ref === 'function' ? ref(element) : (ref.current = element); + }; + + useLayoutEffect(() => { + if (!inputRef.current || props.autoFocus) return; + + setTimeout(() => inputRef.current?.blur()); + }, [props.autoFocus]); + return ( (({ className, type, 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50', className )} - ref={ref} + ref={handleRef} {...props} /> ); diff --git a/lib/queryClient.ts b/lib/queryClient.ts index 5981eb6..c0e1052 100644 --- a/lib/queryClient.ts +++ b/lib/queryClient.ts @@ -1,4 +1,4 @@ -import { defaultShouldDehydrateQuery, isServer, QueryClient } from '@tanstack/react-query'; +import { isServer, QueryClient } from '@tanstack/react-query'; const makeQueryClient = () => { return new QueryClient({ diff --git a/public/sw.js b/public/sw.js index dcd0a54..25d2dc8 100644 --- a/public/sw.js +++ b/public/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const t=(t,a)=>(t=new URL(t+".js",a).href,s[t]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=t,e.onload=s,document.head.appendChild(e)}else e=t,importScripts(t),s()})).then((()=>{let e=s[t];if(!e)throw new Error(`Module ${t} didn’t register its module`);return e})));self.define=(a,n)=>{const c=e||("document"in self?document.currentScript.src:"")||location.href;if(s[c])return;let i={};const r=e=>t(e,c),o={module:{uri:c},exports:i,require:r};s[c]=Promise.all(a.map((e=>o[e]||r(e)))).then((e=>(n(...e),i)))}}define(["./workbox-4754cb34"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"08b649330f381637ab1bbf3c3c9c33b9"},{url:"/_next/static/chunks/104-a725ed2d2f5f6aaf.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/152.b96372f7a5392cef.js",revision:"b96372f7a5392cef"},{url:"/_next/static/chunks/209-449ff161889aaf29.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/23-e0259c2123520d87.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/26.286553a5ff2812fc.js",revision:"286553a5ff2812fc"},{url:"/_next/static/chunks/276.c3c1130f2adade69.js",revision:"c3c1130f2adade69"},{url:"/_next/static/chunks/344.05938a041227e582.js",revision:"05938a041227e582"},{url:"/_next/static/chunks/348-69892922065c6e19.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/383.78d47f7582340f53.js",revision:"78d47f7582340f53"},{url:"/_next/static/chunks/460.ac20021c7496f1d6.js",revision:"ac20021c7496f1d6"},{url:"/_next/static/chunks/497.48f1dfd129122432.js",revision:"48f1dfd129122432"},{url:"/_next/static/chunks/61.e269d4a699fba0b6.js",revision:"e269d4a699fba0b6"},{url:"/_next/static/chunks/621-fa4d2ff1cf645813.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/671-198cda5935173a5a.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/673.362c29137dd3e968.js",revision:"362c29137dd3e968"},{url:"/_next/static/chunks/695.156d21364de6e419.js",revision:"156d21364de6e419"},{url:"/_next/static/chunks/755.5cd959eac5682527.js",revision:"5cd959eac5682527"},{url:"/_next/static/chunks/792.b51012549074b93f.js",revision:"b51012549074b93f"},{url:"/_next/static/chunks/810.6105e84414768b0d.js",revision:"6105e84414768b0d"},{url:"/_next/static/chunks/922.9ce4bf0553cfb724.js",revision:"9ce4bf0553cfb724"},{url:"/_next/static/chunks/app/(site)/favorites/page-427f58e0c5275c4d.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/loading-96645736797edde7.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/page-56a52200c7f26ccc.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/popular/page-3247fedf3d739d2b.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/similar/page-952dd48ac008e176.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/starring/page-f8bea10ecebeaaab.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/top/page-8507fdbf8869090d.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/(site)/watch-list/page-793228b9c3abb45d.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/_not-found/page-97bde446d7f1c840.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/app/layout-30e56da691df9498.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/c8bcbd21.63daf74955ffea8b.js",revision:"63daf74955ffea8b"},{url:"/_next/static/chunks/fd9d1056-d1448f0cd0a3dc26.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/framework-f66176bb897dc684.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/main-a339d49e77d6dbd3.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/main-app-51cdaff1a81e6b49.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/pages/_app-6a626577ffa902a4.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/pages/_error-1be831200e60c5c0.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-2727b4b69a6c8e6c.js",revision:"o1ZEta884Q-FeKO2wUJuc"},{url:"/_next/static/css/0d5f6452b2682b9b.css",revision:"0d5f6452b2682b9b"},{url:"/_next/static/css/30fc28b4ca88767d.css",revision:"30fc28b4ca88767d"},{url:"/_next/static/media/a9b1453781eac9e6-s.p.woff2",revision:"c754cf60aba699077f00948285bf54b5"},{url:"/_next/static/media/dd843ebd3ff03195-s.p.woff2",revision:"333341dc4117f45b7fcee6b5223a56db"},{url:"/_next/static/media/e9ecf55e71a874cd-s.woff2",revision:"62348655e2d5baed97a39f0590491d09"},{url:"/_next/static/o1ZEta884Q-FeKO2wUJuc/_buildManifest.js",revision:"2ec694eb52ae4f523f265a46bae4d768"},{url:"/_next/static/o1ZEta884Q-FeKO2wUJuc/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/apple-touch-icon.png",revision:"6ed7ad78b222698b2872b5a7f104fe08"},{url:"/favicon-48x48.png",revision:"d2db6eb5ce8ce1da63114250c9652da7"},{url:"/favicon.ico",revision:"d7c46eb2b2574863f72315ed861b1c99"},{url:"/favicon.svg",revision:"15b76ab693bd3a8320d8f8778332d396"},{url:"/manifest.json",revision:"5707bda32aaccb2ce142908f0baf8a1b"},{url:"/web-app-manifest-192x192.png",revision:"5d8538e4362b4ddbd7ff195fb24c25dc"},{url:"/web-app-manifest-512x512.png",revision:"e0a092cab607727cbe6f61adb0b1e6cf"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:t,state:a})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")}),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")}),new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>!(self.origin===e.origin)),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")})); +if(!self.define){let e,a={};const s=(s,n)=>(s=new URL(s+".js",n).href,a[s]||new Promise((a=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=a,document.head.appendChild(e)}else e=s,importScripts(s),a()})).then((()=>{let e=a[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e})));self.define=(n,t)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(a[i])return;let c={};const r=e=>s(e,i),o={module:{uri:i},exports:c,require:r};a[i]=Promise.all(n.map((e=>o[e]||r(e)))).then((e=>(t(...e),c)))}}define(["./workbox-4754cb34"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"2a57774e1ed6331c1395fd1ea2d7b22c"},{url:"/_next/static/chunks/132-9c5907bb6e658bd4.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/152.362c71763f5f1192.js",revision:"362c71763f5f1192"},{url:"/_next/static/chunks/23-e0259c2123520d87.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/26.286553a5ff2812fc.js",revision:"286553a5ff2812fc"},{url:"/_next/static/chunks/276.c3c1130f2adade69.js",revision:"c3c1130f2adade69"},{url:"/_next/static/chunks/344.05938a041227e582.js",revision:"05938a041227e582"},{url:"/_next/static/chunks/383.78d47f7582340f53.js",revision:"78d47f7582340f53"},{url:"/_next/static/chunks/460.ac20021c7496f1d6.js",revision:"ac20021c7496f1d6"},{url:"/_next/static/chunks/497.48f1dfd129122432.js",revision:"48f1dfd129122432"},{url:"/_next/static/chunks/584-87bcccb137b07dd4.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/61.e269d4a699fba0b6.js",revision:"e269d4a699fba0b6"},{url:"/_next/static/chunks/617-ef0cc8cd639c8a92.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/621-fa4d2ff1cf645813.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/673.362c29137dd3e968.js",revision:"362c29137dd3e968"},{url:"/_next/static/chunks/695.156d21364de6e419.js",revision:"156d21364de6e419"},{url:"/_next/static/chunks/755.5cd959eac5682527.js",revision:"5cd959eac5682527"},{url:"/_next/static/chunks/792.b51012549074b93f.js",revision:"b51012549074b93f"},{url:"/_next/static/chunks/810.6105e84414768b0d.js",revision:"6105e84414768b0d"},{url:"/_next/static/chunks/922.9ce4bf0553cfb724.js",revision:"9ce4bf0553cfb724"},{url:"/_next/static/chunks/app/(site)/favorites/page-d41cd989d3aca261.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/loading-96645736797edde7.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/page-b696c31e16ee2a97.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/popular/page-8f35320a3ee7322d.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/similar/page-6c052528908c0b81.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/starring/page-7f395dbf442510bd.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/top/page-8b739e20efddb8bf.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/(site)/watch-list/page-0e517d3ae10f5b63.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/_not-found/page-97bde446d7f1c840.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/app/layout-951f602929e02aa5.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/c8bcbd21.63daf74955ffea8b.js",revision:"63daf74955ffea8b"},{url:"/_next/static/chunks/fd9d1056-d1448f0cd0a3dc26.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/framework-f66176bb897dc684.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/main-a339d49e77d6dbd3.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/main-app-51cdaff1a81e6b49.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/pages/_app-6a626577ffa902a4.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/pages/_error-1be831200e60c5c0.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/chunks/polyfills-42372ed130431b0a.js",revision:"846118c33b2c0e922d7b3a7676f81f6f"},{url:"/_next/static/chunks/webpack-cc221c8a98e29fdd.js",revision:"mwtiyaWB8nTaaSMQ6ajGA"},{url:"/_next/static/css/0d5f6452b2682b9b.css",revision:"0d5f6452b2682b9b"},{url:"/_next/static/css/de5e7a9d0c8570d7.css",revision:"de5e7a9d0c8570d7"},{url:"/_next/static/media/a9b1453781eac9e6-s.p.woff2",revision:"c754cf60aba699077f00948285bf54b5"},{url:"/_next/static/media/dd843ebd3ff03195-s.p.woff2",revision:"333341dc4117f45b7fcee6b5223a56db"},{url:"/_next/static/media/e9ecf55e71a874cd-s.woff2",revision:"62348655e2d5baed97a39f0590491d09"},{url:"/_next/static/mwtiyaWB8nTaaSMQ6ajGA/_buildManifest.js",revision:"2ec694eb52ae4f523f265a46bae4d768"},{url:"/_next/static/mwtiyaWB8nTaaSMQ6ajGA/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/apple-touch-icon.png",revision:"6ed7ad78b222698b2872b5a7f104fe08"},{url:"/favicon-48x48.png",revision:"d2db6eb5ce8ce1da63114250c9652da7"},{url:"/favicon.ico",revision:"d7c46eb2b2574863f72315ed861b1c99"},{url:"/favicon.svg",revision:"15b76ab693bd3a8320d8f8778332d396"},{url:"/manifest.json",revision:"5707bda32aaccb2ce142908f0baf8a1b"},{url:"/web-app-manifest-192x192.png",revision:"5d8538e4362b4ddbd7ff195fb24c25dc"},{url:"/web-app-manifest-512x512.png",revision:"e0a092cab607727cbe6f61adb0b1e6cf"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:a,event:s,state:n})=>a&&"opaqueredirect"===a.type?new Response(a.body,{status:200,statusText:"OK",headers:a.headers}):a}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;const a=e.pathname;return!a.startsWith("/api/auth/")&&!!a.startsWith("/api/")}),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")}),new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>!(self.origin===e.origin)),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")}));