@serifpersia/dango 3.7.3 → 3.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +10 -6
  2. package/client/dist/assets/{AnimeCard-BVufFeLC.js → AnimeCard-BxhPLWBG.js} +1 -1
  3. package/client/dist/assets/{AnimeInfo-Dihook4h.js → AnimeInfo-DcpKPBLS.js} +1 -1
  4. package/client/dist/assets/{AnimeInfoPage-K0ErjilQ.js → AnimeInfoPage-jKNSPHbX.js} +2 -2
  5. package/client/dist/assets/{Asmr-CP7vVwsh.js → Asmr-DlKBykO-.js} +2 -2
  6. package/client/dist/assets/Asmr-Do89pEHG.css +1 -0
  7. package/client/dist/assets/{AsmrResetProgressModal-cYO4Sr2k.js → AsmrResetProgressModal-DPHPLqPo.js} +1 -1
  8. package/client/dist/assets/{Home-BYuAVKgx.js → Home-D7-FNOmo.js} +1 -1
  9. package/client/dist/assets/{Insights-Bx01GySp.js → Insights-C9HufjGJ.js} +1 -1
  10. package/client/dist/assets/{LibraryListPage-BnrEDG8j.js → LibraryListPage-BT_xDjEq.js} +1 -1
  11. package/client/dist/assets/{ListeningList-kRSLAo3B.js → ListeningList-DL1rdCRi.js} +1 -1
  12. package/client/dist/assets/{Manga-COhyMd3K.js → Manga-BfFRq7eK.js} +1 -1
  13. package/client/dist/assets/{MangaInfoPage-LTEvl_nL.js → MangaInfoPage-wBJjn2FL.js} +1 -1
  14. package/client/dist/assets/{MangaReadPage-sEwzyBQ7.js → MangaReadPage-BAgsRqxt.js} +1 -1
  15. package/client/dist/assets/{MangaResetProgressModal-CbMR36Zu.js → MangaResetProgressModal-Br5zqZ-U.js} +1 -1
  16. package/client/dist/assets/{Mature-CMvs_-gf.js → Mature-MO7ZwJVT.js} +1 -1
  17. package/client/dist/assets/{MatureConsentModal-BnB-RHYQ.js → MatureConsentModal-Beq4JL0b.js} +1 -1
  18. package/client/dist/assets/{MediaCard-B0PJStxp.css → MediaCard-CoyScn-7.css} +1 -1
  19. package/client/dist/assets/MediaCard-lz7FdOe_.js +1 -0
  20. package/client/dist/assets/{OptionListMenu-onM2KK2X.js → OptionListMenu-BSUcso28.js} +1 -1
  21. package/client/dist/assets/Player-CnLC-x2S.js +56 -0
  22. package/client/dist/assets/{PlayerSettings-BfSv-hut.js → PlayerSettings-kqYmlLDl.js} +1 -1
  23. package/client/dist/assets/{QueueOptionsButton-B4Re8F3V.js → QueueOptionsButton-B8xuoYlH.js} +1 -1
  24. package/client/dist/assets/{QueueRail-Dkx_M6ng.js → QueueRail-D1FmM-GR.js} +1 -1
  25. package/client/dist/assets/{ReadingList-C--ZvTe2.js → ReadingList-D8ZiOnWi.js} +1 -1
  26. package/client/dist/assets/{ResetProgressModal-BuESoxbY.js → ResetProgressModal-0PvvM2XJ.js} +1 -1
  27. package/client/dist/assets/{Search-CEErwr88.js → Search-D1T-PrGX.js} +1 -1
  28. package/client/dist/assets/Settings-DALBQcFc.js +21 -0
  29. package/client/dist/assets/Settings-DYjRBgpE.css +1 -0
  30. package/client/dist/assets/{SkeletonGrid-QWMGLCGp.js → SkeletonGrid-pA-dcLBM.js} +1 -1
  31. package/client/dist/assets/Trackers-CvO6aWVx.css +1 -0
  32. package/client/dist/assets/Trackers-D68sJf1y.js +2 -0
  33. package/client/dist/assets/{Tv-C6F9655r.js → Tv-DO-WeaMv.js} +1 -1
  34. package/client/dist/assets/{TvInfo-BajXP7JJ.js → TvInfo-CpPIymn8.js} +1 -1
  35. package/client/dist/assets/{TvPopup-DZtX79Ol.js → TvPopup-BwGJ1Tjg.js} +1 -1
  36. package/client/dist/assets/{TvSearch-DcWcxRb1.js → TvSearch-D9SrfJjK.js} +1 -1
  37. package/client/dist/assets/{TvWatchlist-Cf_25dKi.js → TvWatchlist-25tpA8ln.js} +1 -1
  38. package/client/dist/assets/{Watchlist-DBmU8PNR.js → Watchlist-mlZQTcqR.js} +1 -1
  39. package/client/dist/assets/{hls-Bi-DS5KL.js → hls-qvAoYTJt.js} +1 -1
  40. package/client/dist/assets/index-DlcgJVM6.js +178 -0
  41. package/client/dist/assets/{index-B7katXv0.css → index-ZssheiHa.css} +1 -1
  42. package/client/dist/assets/{libraryInvalidation-DI-v-DQ1.js → libraryInvalidation-DdnIPcOQ.js} +1 -1
  43. package/client/dist/assets/{useAnimeInfoData-DpUA78Mv.js → useAnimeInfoData-tcGkDs2b.js} +1 -1
  44. package/client/dist/assets/{useAsmr-BwyYDnlP.js → useAsmr-B-FYJW2L.js} +1 -1
  45. package/client/dist/assets/{useAsmrPopup-BrrEaBlV.js → useAsmrPopup-Ct9jC6X6.js} +1 -1
  46. package/client/dist/assets/{useMangaLibrary-BAUaug-u.js → useMangaLibrary-BacTdrw2.js} +1 -1
  47. package/client/dist/assets/{useMangaPopup-3Lx5tEub.js → useMangaPopup-B_wRaMyP.js} +1 -1
  48. package/client/dist/assets/usePlaybackEnd-DLFOYx3Q.css +1 -0
  49. package/client/dist/assets/{usePlaybackEnd-CuDnNZ8o.js → usePlaybackEnd-DuEfjKb8.js} +2 -2
  50. package/client/dist/assets/{useProviders-CKqOSX5-.js → useProviders-D0XOHCsj.js} +1 -1
  51. package/client/dist/assets/{useTv-CZB47zUF.js → useTv-IidbSQU4.js} +1 -1
  52. package/client/dist/assets/{useTvLibrary-BGz7Unv_.js → useTvLibrary-DiCSdUOj.js} +1 -1
  53. package/client/dist/index.html +2 -2
  54. package/package.json +2 -2
  55. package/server/dist/server.js +251 -246
  56. package/server/dist/shipped-defaults.js +1 -1
  57. package/server/package.json +1 -1
  58. package/client/dist/assets/Asmr-Dl1EZqaI.css +0 -1
  59. package/client/dist/assets/MediaCard-hWGCEHWx.js +0 -1
  60. package/client/dist/assets/Player-2YKevlG4.js +0 -56
  61. package/client/dist/assets/Settings-BEHII_8K.css +0 -1
  62. package/client/dist/assets/Settings-C-QEEujv.js +0 -21
  63. package/client/dist/assets/Trackers-1i4Hd5D3.js +0 -2
  64. package/client/dist/assets/Trackers-D5XBOCDp.css +0 -1
  65. package/client/dist/assets/index-DB81Su4I.js +0 -178
  66. package/client/dist/assets/usePlaybackEnd-BtUHM1mW.css +0 -1
@@ -1 +1 @@
1
- import{o as R,a as q,p as E,d as l,h as C,T,u as e,g as F}from"./vendor-core-DfaOB3Rn.js";import{I as a}from"./vendor-icons-DrybRNxP.js";import{e as j,t as U,B as w}from"./index-DB81Su4I.js";import{n as H,d as J,e as K,f as Q,t as I}from"./useTvLibrary-BGz7Unv_.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-DI-v-DQ1.js";const X="_container_198yg_1",Y="_heroSection_198yg_11",Z="_bannerContainer_198yg_17",ee="_banner_198yg_17",ne="_bannerOverlay_198yg_37",te="_heroContent_198yg_49",se="_posterContainer_198yg_62",ae="_poster_198yg_62",oe="_infoGlass_198yg_86",ie="_title_198yg_100",re="_quickMeta_198yg_110",le="_metaItem_198yg_118",ce="_iconStar_198yg_126",de="_iconTv_198yg_130",me="_iconType_198yg_134",_e="_genres_198yg_139",he="_genre_198yg_139",ge="_metaRow_198yg_156",ve="_metaValue_198yg_164",pe="_metaDivider_198yg_168",ue="_synopsisSection_198yg_173",ye="_sectionTitleSmall_198yg_179",ke="_synopsis_198yg_173",be="_actions_198yg_196",Ne="_watchBtn_198yg_202",Se="_watchlistBtn_198yg_226",fe="_active_198yg_250",Ce="_seasonPickerLabel_198yg_256",Te="_seasonSelect_198yg_267",we="_detailsToggleBtn_198yg_286",Ie="_expandedContent_198yg_304",Be="_detailGrid_198yg_309",De="_detailItem_198yg_315",Me="_imdbLink_198yg_333",Le="_heroSkeleton_198yg_343",Pe="_skeletonBanner_198yg_347",$e="_skeletonContent_198yg_354",Ge="_skeletonPoster_198yg_365",xe="_skeletonInfo_198yg_373",Oe="_skeletonTitle_198yg_380",Ae="_skeletonMeta_198yg_388",Ve="_skeletonDesc_198yg_396",We="_skeletonActions_198yg_404",ze="_errorState_198yg_413",Re="_matureOverlay_198yg_434",qe="_matureContent_198yg_444",n={container:X,heroSection:Y,bannerContainer:Z,banner:ee,bannerOverlay:ne,heroContent:te,posterContainer:se,poster:ae,infoGlass:oe,title:ie,quickMeta:re,metaItem:le,iconStar:ce,iconTv:de,iconType:me,genres:_e,genre:he,metaRow:ge,metaValue:ve,metaDivider:pe,synopsisSection:ue,sectionTitleSmall:ye,synopsis:ke,actions:be,watchBtn:Ne,watchlistBtn:Se,active:fe,seasonPickerLabel:Ce,seasonSelect:Te,detailsToggleBtn:we,expandedContent:Ie,detailGrid:Be,detailItem:De,imdbLink:Me,heroSkeleton:Le,skeletonBanner:Pe,skeletonContent:$e,skeletonPoster:Ge,skeletonInfo:xe,skeletonTitle:Oe,skeletonMeta:Ae,skeletonDesc:Ve,skeletonActions:We,errorState:ze,matureOverlay:Re,matureContent:qe};function Ke(){const{id:o}=R(),c=q(),[B]=E(),i=H(B.get("type")),{hasConsent:D}=j(),[t,M]=l(null),[L,_]=l(!0),[u,y]=l(""),[d,P]=l(!1),[h,$]=l(1),G=J(i,o??""),x=Number(o),{data:O}=K(t?G:void 0),g=!!O?.inLibrary,{toggle:A}=Q();C(()=>{o&&(_(!0),y(""),U.tv.details.query({type:i,id:String(o)}).then(s=>{const m={id:s.id,title:s.title||"",overview:s.overview||"",vote_average:s.vote_average,year:s.year,poster:s.poster,backdrop:s.backdrop,imdb_id:s.imdb_id||void 0,adult:s.adult,seasons:s.seasons?.map(z=>({...z,name:""})),number_of_seasons:s.number_of_seasons};M(m),_(!1)}).catch(s=>{y(s.message),_(!1)}))},[o,i]),C(()=>{document.title=t?.title?`${t.title} - dango`:"TV & Movies - dango"},[t?.title]);const V=()=>{!o||!t||c(r?I(i,o):I(i,o,h,1))},W=()=>{t&&A({tmdbId:x,mediaType:i,title:t.title,poster:t.poster,year:t.year,adult:t.adult})},r=i==="movie",v=!r,k=t?.backdrop?`https://image.tmdb.org/t/p/w1280${t.backdrop}`:"",b=t?.poster?`https://image.tmdb.org/t/p/w500${t.poster}`:"",N=T(()=>t?.genres?t.genres.map(s=>s.name).slice(0,5):[],[t?.genres]),S=T(()=>t?.seasons?t.seasons.filter(s=>s.season_number>0):[],[t?.seasons]),p=[t?.year,t?.status,v&&t?.number_of_seasons?`${t.number_of_seasons} Season${t.number_of_seasons>1?"s":""}`:null,v&&t?.number_of_episodes?`${t.number_of_episodes} Episodes`:null].filter(Boolean);if(L)return e("div",{className:n.container,children:e("div",{className:n.heroSkeleton,children:[e("div",{className:n.skeletonBanner}),e("div",{className:n.skeletonContent,children:[e("div",{className:n.skeletonPoster}),e("div",{className:n.skeletonInfo,children:[e("div",{className:n.skeletonTitle}),e("div",{className:n.skeletonMeta}),e("div",{className:n.skeletonDesc}),e("div",{className:n.skeletonActions})]})]})]})});if(u||!t)return e("div",{className:n.container,children:e("div",{className:n.errorState,children:[e(a,{name:"exclamation-triangle",size:48}),e("h2",{children:"Failed to load details"}),e("p",{children:u||"Something went wrong"}),e(w,{onClick:()=>c(-1),children:"Go Back"})]})});const f=t.adult&&!D;return e("div",{className:n.container,style:f?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:n.heroSection,children:[e("div",{className:n.bannerContainer,children:[k&&e("div",{className:n.banner,style:{backgroundImage:`url(${k})`}}),e("div",{className:n.bannerOverlay})]}),e("div",{className:n.heroContent,children:[e("div",{className:n.posterContainer,children:b&&e("img",{src:b,alt:t.title,className:n.poster,decoding:"async"})}),e("div",{className:n.infoGlass,children:[e("div",{children:[e("h1",{className:n.title,children:t.title}),e("div",{className:n.quickMeta,children:[t.vote_average!=null&&t.vote_average>0&&e("div",{className:n.metaItem,children:[e(a,{name:"star",className:n.iconStar}),e("span",{children:Number(t.vote_average).toFixed(1)})]}),e("div",{className:n.metaItem,children:[e(a,{name:"tv",className:n.iconTv}),e("span",{children:r?"Movie":"TV Show"})]}),t.vote_count!=null&&e("div",{className:n.metaItem,children:[e(a,{name:"users",className:n.iconType}),e("span",{children:[t.vote_count.toLocaleString()," votes"]})]})]}),N.length>0&&e("div",{className:n.genres,children:N.map(s=>e("span",{className:n.genre,children:s},s))})]}),p.length>0&&e("div",{className:n.metaRow,children:p.map((s,m)=>e(F.Fragment,{children:[e("span",{className:n.metaValue,children:s}),m<p.length-1&&e("span",{className:n.metaDivider,children:"·"})]},m))}),t.overview&&e("div",{className:n.synopsisSection,children:[e("h2",{className:n.sectionTitleSmall,children:"Synopsis"}),e("p",{className:n.synopsis,children:t.overview})]}),e("div",{className:n.actions,children:[e("button",{className:n.watchBtn,onClick:V,children:[e(a,{name:"play",size:14}),r?"Watch Now":`Start S${h}`]}),e("button",{className:`${n.watchlistBtn} ${g?n.active:""}`,onClick:W,children:[g?e(a,{name:"check",size:14}):e(a,{name:"plus",size:14}),g?"In Watchlist":"Add to Watchlist"]})]}),v&&S.length>1&&e("label",{className:n.seasonPickerLabel,children:[e("span",{children:"Season"}),e("select",{value:h,onChange:s=>$(parseInt(s.currentTarget.value,10)||1),className:n.seasonSelect,children:S.map(s=>e("option",{value:s.season_number,children:["Season ",s.season_number," (",s.episode_count," Episodes)"]},s.season_number))})]}),e("button",{className:n.detailsToggleBtn,onClick:()=>P(!d),children:[d?e(a,{name:"chevron-up"}):e(a,{name:"chevron-down"}),d?"Hide Details":"Show Details"]}),d&&e("div",{className:n.expandedContent,children:e("div",{className:n.detailGrid,children:[t.first_air_date&&e("div",{className:n.detailItem,children:[e("strong",{children:r?"Release Date":"First Air Date"}),e("span",{children:t.first_air_date})]}),t.last_air_date&&e("div",{className:n.detailItem,children:[e("strong",{children:"Last Air Date"}),e("span",{children:t.last_air_date})]}),t.networks&&t.networks.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Networks"}),e("span",{children:t.networks.map(s=>s.name).join(", ")})]}),t.created_by&&t.created_by.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Created By"}),e("span",{children:t.created_by.map(s=>s.name).join(", ")})]}),t.episode_run_time&&t.episode_run_time.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Episode Runtime"}),e("span",{children:[t.episode_run_time[0]," min"]})]}),t.imdb_id&&e("div",{className:n.detailItem,children:[e("strong",{children:"IMDb"}),e("a",{href:`https://www.imdb.com/title/${t.imdb_id}`,target:"_blank",rel:"noopener noreferrer",className:n.imdbLink,children:"View on IMDb"})]})]})})]})]})]}),f&&e("div",{className:n.matureOverlay,children:e("div",{className:n.matureContent,children:[e(a,{name:"exclamation-triangle",size:48}),e("h2",{children:"Content Warning"}),e("p",{children:"This content may contain mature themes."}),e(w,{onClick:()=>c("/"),children:"Go Back"})]})})]})}export{Ke as default};
1
+ import{o as R,a as q,p as E,d as l,h as C,T,u as e,g as F}from"./vendor-core-DfaOB3Rn.js";import{I as a}from"./vendor-icons-DrybRNxP.js";import{e as j,t as U,B as w}from"./index-DlcgJVM6.js";import{n as H,d as J,e as K,f as Q,t as I}from"./useTvLibrary-DiCSdUOj.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-DdnIPcOQ.js";const X="_container_198yg_1",Y="_heroSection_198yg_11",Z="_bannerContainer_198yg_17",ee="_banner_198yg_17",ne="_bannerOverlay_198yg_37",te="_heroContent_198yg_49",se="_posterContainer_198yg_62",ae="_poster_198yg_62",oe="_infoGlass_198yg_86",ie="_title_198yg_100",re="_quickMeta_198yg_110",le="_metaItem_198yg_118",ce="_iconStar_198yg_126",de="_iconTv_198yg_130",me="_iconType_198yg_134",_e="_genres_198yg_139",he="_genre_198yg_139",ge="_metaRow_198yg_156",ve="_metaValue_198yg_164",pe="_metaDivider_198yg_168",ue="_synopsisSection_198yg_173",ye="_sectionTitleSmall_198yg_179",ke="_synopsis_198yg_173",be="_actions_198yg_196",Ne="_watchBtn_198yg_202",Se="_watchlistBtn_198yg_226",fe="_active_198yg_250",Ce="_seasonPickerLabel_198yg_256",Te="_seasonSelect_198yg_267",we="_detailsToggleBtn_198yg_286",Ie="_expandedContent_198yg_304",Be="_detailGrid_198yg_309",De="_detailItem_198yg_315",Me="_imdbLink_198yg_333",Le="_heroSkeleton_198yg_343",Pe="_skeletonBanner_198yg_347",$e="_skeletonContent_198yg_354",Ge="_skeletonPoster_198yg_365",xe="_skeletonInfo_198yg_373",Oe="_skeletonTitle_198yg_380",Ae="_skeletonMeta_198yg_388",Ve="_skeletonDesc_198yg_396",We="_skeletonActions_198yg_404",ze="_errorState_198yg_413",Re="_matureOverlay_198yg_434",qe="_matureContent_198yg_444",n={container:X,heroSection:Y,bannerContainer:Z,banner:ee,bannerOverlay:ne,heroContent:te,posterContainer:se,poster:ae,infoGlass:oe,title:ie,quickMeta:re,metaItem:le,iconStar:ce,iconTv:de,iconType:me,genres:_e,genre:he,metaRow:ge,metaValue:ve,metaDivider:pe,synopsisSection:ue,sectionTitleSmall:ye,synopsis:ke,actions:be,watchBtn:Ne,watchlistBtn:Se,active:fe,seasonPickerLabel:Ce,seasonSelect:Te,detailsToggleBtn:we,expandedContent:Ie,detailGrid:Be,detailItem:De,imdbLink:Me,heroSkeleton:Le,skeletonBanner:Pe,skeletonContent:$e,skeletonPoster:Ge,skeletonInfo:xe,skeletonTitle:Oe,skeletonMeta:Ae,skeletonDesc:Ve,skeletonActions:We,errorState:ze,matureOverlay:Re,matureContent:qe};function Ke(){const{id:o}=R(),c=q(),[B]=E(),i=H(B.get("type")),{hasConsent:D}=j(),[t,M]=l(null),[L,_]=l(!0),[u,y]=l(""),[d,P]=l(!1),[h,$]=l(1),G=J(i,o??""),x=Number(o),{data:O}=K(t?G:void 0),g=!!O?.inLibrary,{toggle:A}=Q();C(()=>{o&&(_(!0),y(""),U.tv.details.query({type:i,id:String(o)}).then(s=>{const m={id:s.id,title:s.title||"",overview:s.overview||"",vote_average:s.vote_average,year:s.year,poster:s.poster,backdrop:s.backdrop,imdb_id:s.imdb_id||void 0,adult:s.adult,seasons:s.seasons?.map(z=>({...z,name:""})),number_of_seasons:s.number_of_seasons};M(m),_(!1)}).catch(s=>{y(s.message),_(!1)}))},[o,i]),C(()=>{document.title=t?.title?`${t.title} - dango`:"TV & Movies - dango"},[t?.title]);const V=()=>{!o||!t||c(r?I(i,o):I(i,o,h,1))},W=()=>{t&&A({tmdbId:x,mediaType:i,title:t.title,poster:t.poster,year:t.year,adult:t.adult})},r=i==="movie",v=!r,k=t?.backdrop?`https://image.tmdb.org/t/p/w1280${t.backdrop}`:"",b=t?.poster?`https://image.tmdb.org/t/p/w500${t.poster}`:"",N=T(()=>t?.genres?t.genres.map(s=>s.name).slice(0,5):[],[t?.genres]),S=T(()=>t?.seasons?t.seasons.filter(s=>s.season_number>0):[],[t?.seasons]),p=[t?.year,t?.status,v&&t?.number_of_seasons?`${t.number_of_seasons} Season${t.number_of_seasons>1?"s":""}`:null,v&&t?.number_of_episodes?`${t.number_of_episodes} Episodes`:null].filter(Boolean);if(L)return e("div",{className:n.container,children:e("div",{className:n.heroSkeleton,children:[e("div",{className:n.skeletonBanner}),e("div",{className:n.skeletonContent,children:[e("div",{className:n.skeletonPoster}),e("div",{className:n.skeletonInfo,children:[e("div",{className:n.skeletonTitle}),e("div",{className:n.skeletonMeta}),e("div",{className:n.skeletonDesc}),e("div",{className:n.skeletonActions})]})]})]})});if(u||!t)return e("div",{className:n.container,children:e("div",{className:n.errorState,children:[e(a,{name:"exclamation-triangle",size:48}),e("h2",{children:"Failed to load details"}),e("p",{children:u||"Something went wrong"}),e(w,{onClick:()=>c(-1),children:"Go Back"})]})});const f=t.adult&&!D;return e("div",{className:n.container,style:f?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:n.heroSection,children:[e("div",{className:n.bannerContainer,children:[k&&e("div",{className:n.banner,style:{backgroundImage:`url(${k})`}}),e("div",{className:n.bannerOverlay})]}),e("div",{className:n.heroContent,children:[e("div",{className:n.posterContainer,children:b&&e("img",{src:b,alt:t.title,className:n.poster,decoding:"async"})}),e("div",{className:n.infoGlass,children:[e("div",{children:[e("h1",{className:n.title,children:t.title}),e("div",{className:n.quickMeta,children:[t.vote_average!=null&&t.vote_average>0&&e("div",{className:n.metaItem,children:[e(a,{name:"star",className:n.iconStar}),e("span",{children:Number(t.vote_average).toFixed(1)})]}),e("div",{className:n.metaItem,children:[e(a,{name:"tv",className:n.iconTv}),e("span",{children:r?"Movie":"TV Show"})]}),t.vote_count!=null&&e("div",{className:n.metaItem,children:[e(a,{name:"users",className:n.iconType}),e("span",{children:[t.vote_count.toLocaleString()," votes"]})]})]}),N.length>0&&e("div",{className:n.genres,children:N.map(s=>e("span",{className:n.genre,children:s},s))})]}),p.length>0&&e("div",{className:n.metaRow,children:p.map((s,m)=>e(F.Fragment,{children:[e("span",{className:n.metaValue,children:s}),m<p.length-1&&e("span",{className:n.metaDivider,children:"·"})]},m))}),t.overview&&e("div",{className:n.synopsisSection,children:[e("h2",{className:n.sectionTitleSmall,children:"Synopsis"}),e("p",{className:n.synopsis,children:t.overview})]}),e("div",{className:n.actions,children:[e("button",{className:n.watchBtn,onClick:V,children:[e(a,{name:"play",size:14}),r?"Watch Now":`Start S${h}`]}),e("button",{className:`${n.watchlistBtn} ${g?n.active:""}`,onClick:W,children:[g?e(a,{name:"check",size:14}):e(a,{name:"plus",size:14}),g?"In Watchlist":"Add to Watchlist"]})]}),v&&S.length>1&&e("label",{className:n.seasonPickerLabel,children:[e("span",{children:"Season"}),e("select",{value:h,onChange:s=>$(parseInt(s.currentTarget.value,10)||1),className:n.seasonSelect,children:S.map(s=>e("option",{value:s.season_number,children:["Season ",s.season_number," (",s.episode_count," Episodes)"]},s.season_number))})]}),e("button",{className:n.detailsToggleBtn,onClick:()=>P(!d),children:[d?e(a,{name:"chevron-up"}):e(a,{name:"chevron-down"}),d?"Hide Details":"Show Details"]}),d&&e("div",{className:n.expandedContent,children:e("div",{className:n.detailGrid,children:[t.first_air_date&&e("div",{className:n.detailItem,children:[e("strong",{children:r?"Release Date":"First Air Date"}),e("span",{children:t.first_air_date})]}),t.last_air_date&&e("div",{className:n.detailItem,children:[e("strong",{children:"Last Air Date"}),e("span",{children:t.last_air_date})]}),t.networks&&t.networks.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Networks"}),e("span",{children:t.networks.map(s=>s.name).join(", ")})]}),t.created_by&&t.created_by.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Created By"}),e("span",{children:t.created_by.map(s=>s.name).join(", ")})]}),t.episode_run_time&&t.episode_run_time.length>0&&e("div",{className:n.detailItem,children:[e("strong",{children:"Episode Runtime"}),e("span",{children:[t.episode_run_time[0]," min"]})]}),t.imdb_id&&e("div",{className:n.detailItem,children:[e("strong",{children:"IMDb"}),e("a",{href:`https://www.imdb.com/title/${t.imdb_id}`,target:"_blank",rel:"noopener noreferrer",className:n.imdbLink,children:"View on IMDb"})]})]})})]})]})]}),f&&e("div",{className:n.matureOverlay,children:e("div",{className:n.matureContent,children:[e(a,{name:"exclamation-triangle",size:48}),e("h2",{children:"Content Warning"}),e("p",{children:"This content may contain mature themes."}),e(w,{onClick:()=>c("/"),children:"Go Back"})]})})]})}export{Ke as default};
@@ -1 +1 @@
1
- import{d as n,h as b,T,u as _}from"./vendor-core-DfaOB3Rn.js";import{f as k,d as m,c as w,t as I}from"./useTvLibrary-BGz7Unv_.js";import{t as P,h as D}from"./index-DB81Su4I.js";import{a as W}from"./MediaCard-hWGCEHWx.js";const S=({item:e,anchorRect:l,onMouseEnter:i,onMouseLeave:c,onRequestClose:p})=>{const[t,u]=n(null),[d,r]=n(!0),{toggle:v,bookmarkedIds:g}=k(),y=m(e.type,e.id),f=g.has(y);b(()=>{let o=!1;return r(!0),P.tv.details.query({type:e.type,id:String(e.id)}).then(s=>{o||(u({overview:s.overview,vote_average:s.vote_average,number_of_seasons:s.number_of_seasons}),r(!1))}).catch(()=>{o||r(!1)}),()=>{o=!0}},[e.id,e.type]);const h=T(()=>t?.genres?t.genres.slice(0,4).map(o=>o.name):[],[t?.genres]),a=[];return t?.vote_average!=null&&t.vote_average>0&&a.push({icon:"star",label:Number(t.vote_average).toFixed(1),accent:!0}),a.push({icon:"tv",label:e.type==="tv"?"TV Show":"Movie"}),e.year&&a.push({label:e.year}),t?.status&&a.push({label:t.status}),_(W,{anchorRect:l,title:e.title,loading:d,meta:a,genres:h,synopsis:D(t?.overview,200),primaryAction:{to:I(e.type,e.id),label:"Watch now",icon:"play"},secondaryAction:{to:w(e.type,e.id),label:"Details",icon:"info-circle"},bookmarked:f,onToggleBookmark:()=>v({tmdbId:e.id,mediaType:e.type,title:e.title,poster:e.image,year:e.year}),onMouseEnter:i,onMouseLeave:c,onRequestClose:p})};export{S as T};
1
+ import{d as n,h as b,T,u as _}from"./vendor-core-DfaOB3Rn.js";import{f as k,d as m,c as w,t as I}from"./useTvLibrary-DiCSdUOj.js";import{t as P,h as D}from"./index-DlcgJVM6.js";import{a as W}from"./MediaCard-lz7FdOe_.js";const S=({item:e,anchorRect:l,onMouseEnter:i,onMouseLeave:c,onRequestClose:p})=>{const[t,u]=n(null),[d,r]=n(!0),{toggle:v,bookmarkedIds:g}=k(),y=m(e.type,e.id),f=g.has(y);b(()=>{let o=!1;return r(!0),P.tv.details.query({type:e.type,id:String(e.id)}).then(s=>{o||(u({overview:s.overview,vote_average:s.vote_average,number_of_seasons:s.number_of_seasons}),r(!1))}).catch(()=>{o||r(!1)}),()=>{o=!0}},[e.id,e.type]);const h=T(()=>t?.genres?t.genres.slice(0,4).map(o=>o.name):[],[t?.genres]),a=[];return t?.vote_average!=null&&t.vote_average>0&&a.push({icon:"star",label:Number(t.vote_average).toFixed(1),accent:!0}),a.push({icon:"tv",label:e.type==="tv"?"TV Show":"Movie"}),e.year&&a.push({label:e.year}),t?.status&&a.push({label:t.status}),_(W,{anchorRect:l,title:e.title,loading:d,meta:a,genres:h,synopsis:D(t?.overview,200),primaryAction:{to:I(e.type,e.id),label:"Watch now",icon:"play"},secondaryAction:{to:w(e.type,e.id),label:"Details",icon:"info-circle"},bookmarked:f,onToggleBookmark:()=>v({tmdbId:e.id,mediaType:e.type,title:e.title,poster:e.image,year:e.year}),onMouseEnter:i,onMouseLeave:c,onRequestClose:p})};export{S as T};
@@ -1 +1 @@
1
- import{h as I,p as ae,A as re,d as o,T as Y,q as M,u as t}from"./vendor-core-DfaOB3Rn.js";import{I as h}from"./vendor-icons-DrybRNxP.js";import{P as D}from"./MediaCard-hWGCEHWx.js";import{a as ne,T as se}from"./useTv-CZB47zUF.js";import{S as le}from"./SkeletonGrid-QWMGLCGp.js";import{u as ie,U as oe,B as x}from"./index-DB81Su4I.js";import{E as ce}from"./ErrorMessage-DAxegITP.js";import{T as W,M as Q}from"./useTvLibrary-BGz7Unv_.js";import{s as r}from"./Search.module-C_qwCdHS.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-BnB-RHYQ.js";import"./TvPopup-DZtX79Ol.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-DI-v-DQ1.js";const de=[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}],ue=[{value:"popularity.desc",label:"Popularity"},{value:"vote_average.desc",label:"Top Rated"},{value:"primary_release_date.desc",label:"Newest"},{value:"primary_release_date.asc",label:"Oldest"},{value:"vote_count.desc",label:"Most Voted"}],O=new Date().getFullYear(),me=[{value:"ALL",label:"All Years"},...Array.from({length:O-1980+1},(l,m)=>({value:String(O-m),label:String(O-m)}))];function _e(){I(()=>{document.title="Search TV & Movies - dango"},[]);const[l,m]=ae(),{lowEndMode:K}=ie(),C=re(null),[g,U]=o(l.get("q")||""),[p,H]=o(l.get("q")||""),[u,v]=o(parseInt(l.get("page")||"1",10)||1),[i,J]=o(l.get("type")||"multi"),[$,k]=o(l.get("genre")||""),[y,B]=o(l.get("year")||"ALL"),[f,E]=o(l.get("sort_by")||"popularity.desc"),[b,X]=o(!1),[c,N]=o(()=>{const e={},a=l.get("genre")||"";return a&&(e[a]="include"),e}),P=Y(()=>{if(i==="tv")return Object.entries(W).map(([a,n])=>({id:a,name:n}));if(i==="movie")return Object.entries(Q).map(([a,n])=>({id:a,name:n}));const e=new Map;for(const[a,n]of Object.entries(W))e.set(a,n);for(const[a,n]of Object.entries(Q))e.set(a,n);return Array.from(e.entries()).map(([a,n])=>({id:a,name:n}))},[i]),S=Y(()=>Object.entries(c).filter(([,a])=>a==="include").map(([a])=>a).join(","),[c]),{data:L,isLoading:w,isError:Z,error:ee}=ne({query:p,type:i,genre:S,year:y,sort_by:f,page:u}),T=L?.results||[],_=L?.total_pages||0,j=L?.total_results||0,R=u<Math.min(_,500),d=M((e={})=>{const a=new URLSearchParams,n=e.q!==void 0?e.q:p,s=e.type!==void 0?e.type:i,G=e.year!==void 0?e.year:y,V=e.sort!==void 0?e.sort:f,F=e.page!==void 0?e.page:String(u),z=e.genre!==void 0?e.genre:S;n.trim()&&a.set("q",n.trim()),s!=="multi"&&a.set("type",s),z&&a.set("genre",z),G!=="ALL"&&a.set("year",G),V!=="popularity.desc"&&a.set("sort_by",V),F!=="1"&&a.set("page",F),m(a,{replace:!0})},[p,i,y,f,u,S,m]),A=M(()=>{oe(),v(1),H(g),d({q:g,page:"1"}),window.scrollTo({top:0,behavior:"smooth"})},[g,d]),q=M(e=>{if(v(e),d({page:String(e)}),C.current){const a=C.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:a,behavior:"smooth"})}},[d]),te=M(e=>{N(a=>{const n=a[e],s={...a};return n==="include"?s[e]="exclude":n==="exclude"?delete s[e]:s[e]="include",s}),v(1)},[]);return I(()=>{const a=Object.entries(c).filter(([,n])=>n==="include").map(([n])=>n).join(",");a!==$&&(k(a),d({genre:a,page:"1"}))},[c,$,k,d]),t("div",{className:"page-container",children:[t("div",{className:r.header,children:[t("h1",{className:r.pageTitle,children:"Search TV & Movies"}),t("p",{className:r.pageSubtitle,children:"Discover trending shows, movies, and more powered by TMDB"})]}),t("div",{className:r.filterContainer,children:[t("div",{className:r.searchBarWrapper,children:[t("div",{className:r.inputIconWrapper,children:[t(h,{name:"search",className:r.searchIcon}),t("input",{type:"text","data-virtual-keyboard":"true",className:r.searchInput,placeholder:"Search titles...",value:g,onInput:e=>U(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&A()})]}),t("div",{className:r.searchActions,children:[t("select",{value:i,onChange:e=>{J(e.currentTarget.value),N({})},className:r.providerSelect,"aria-label":"Media type",children:de.map(e=>t("option",{value:e.value,children:e.label},e.value))}),t(x,{onClick:A,className:r.searchBtn,children:"Search"}),t("button",{className:`${r.filterToggleBtn} ${b?r.active:""}`,onClick:()=>X(!b),children:[t(h,{name:"filter",size:14}),t("span",{children:"Filters"}),b?t(h,{name:"chevron-up",size:12}):t(h,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${r.advancedFilters} ${b?r.show:""}`,children:[t("div",{className:r.filterDivider}),t("div",{className:r.filterGrid,children:[t("div",{className:r.filterItem,children:[t("label",{children:"Sort By"}),t("select",{value:f,onChange:e=>E(e.currentTarget.value),children:ue.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:r.filterItem,children:[t("label",{children:"Year"}),t("select",{value:y,onChange:e=>B(e.currentTarget.value),children:me.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),P.length>0&&t("div",{className:r.genreSection,children:[t("label",{className:r.genreLabel,children:"Genres"}),t("div",{className:r.genreContainer,children:P.map(e=>t("button",{className:`${r.genreButton} ${r[c[e.id]||""]}`,onClick:()=>te(e.id),children:e.name},e.id))})]}),t("div",{className:r.filterActions,children:[t(x,{variant:"secondary",onClick:()=>{N({}),B("ALL"),E("popularity.desc"),v(1),d({genre:"",year:"ALL",sort:"popularity.desc",page:"1"})},children:"Reset All"}),t(x,{onClick:A,className:r.searchBtn,children:"Apply Filters"})]})]})]}),Z&&t(ce,{message:ee?.message||"Search failed"}),Object.keys(c).length>0&&t("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"1.5rem"},children:[t("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),Object.entries(c).map(([e,a])=>{const n=P.find(s=>s.id===e)?.name||e;return t("span",{className:`badge ${a==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[a==="include"?`+ ${n}`:`- ${n}`,t("button",{onClick:()=>{const s={...c};delete s[e],N(s)},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e)})]}),t("div",{className:r.resultsHeader,ref:C,children:[t("h2",{className:r.resultsTitle,children:[p?`Results for "${p}"`:S?"Browsing genres":i==="tv"?"Popular TV Shows":i==="movie"?"Popular Movies":"Trending",j>0&&t("span",{style:{fontWeight:400,color:"var(--text-tertiary)",fontSize:"0.85em",marginLeft:"0.5em"},children:["(",j.toLocaleString(),")"]})]}),T.length>0&&t(D,{page:u,totalPages:Math.max(1,Math.min(_,500)),canGoNext:R,onChange:q,isLoading:w})]}),t("div",{className:`${r.resultsGrid} ${K?r.lowEnd:""}`,children:w?t(le,{}):T.map(e=>t(se,{item:{id:e.id,title:e.title,year:e.year,type:e.type,image:e.image,vote_average:e.vote_average,adult:e.adult}},`${e.type}-${e.id}`))}),!w&&T.length===0&&t("div",{className:r.noResults,children:[t(h,{name:"search",size:48,className:r.noResultsIcon}),t("h3",{children:"No results found"}),t("p",{children:"Try adjusting your search or filters to find what you're looking for."})]}),T.length>0&&t("div",{className:r.bottomPagination,children:t(D,{page:u,totalPages:Math.max(1,Math.min(_,500)),canGoNext:R,onChange:q,isLoading:w,variant:"labeled"})})]})}export{_e as default};
1
+ import{h as I,p as ae,A as re,d as o,T as Y,q as M,u as t}from"./vendor-core-DfaOB3Rn.js";import{I as h}from"./vendor-icons-DrybRNxP.js";import{P as D}from"./MediaCard-lz7FdOe_.js";import{a as ne,T as se}from"./useTv-IidbSQU4.js";import{S as le}from"./SkeletonGrid-pA-dcLBM.js";import{u as ie,U as oe,B as x}from"./index-DlcgJVM6.js";import{E as ce}from"./ErrorMessage-DAxegITP.js";import{T as W,M as Q}from"./useTvLibrary-DiCSdUOj.js";import{s as r}from"./Search.module-C_qwCdHS.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-Beq4JL0b.js";import"./TvPopup-BwGJ1Tjg.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-DdnIPcOQ.js";const de=[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}],ue=[{value:"popularity.desc",label:"Popularity"},{value:"vote_average.desc",label:"Top Rated"},{value:"primary_release_date.desc",label:"Newest"},{value:"primary_release_date.asc",label:"Oldest"},{value:"vote_count.desc",label:"Most Voted"}],O=new Date().getFullYear(),me=[{value:"ALL",label:"All Years"},...Array.from({length:O-1980+1},(l,m)=>({value:String(O-m),label:String(O-m)}))];function _e(){I(()=>{document.title="Search TV & Movies - dango"},[]);const[l,m]=ae(),{lowEndMode:K}=ie(),C=re(null),[g,U]=o(l.get("q")||""),[p,H]=o(l.get("q")||""),[u,v]=o(parseInt(l.get("page")||"1",10)||1),[i,J]=o(l.get("type")||"multi"),[$,k]=o(l.get("genre")||""),[y,B]=o(l.get("year")||"ALL"),[f,E]=o(l.get("sort_by")||"popularity.desc"),[b,X]=o(!1),[c,N]=o(()=>{const e={},a=l.get("genre")||"";return a&&(e[a]="include"),e}),P=Y(()=>{if(i==="tv")return Object.entries(W).map(([a,n])=>({id:a,name:n}));if(i==="movie")return Object.entries(Q).map(([a,n])=>({id:a,name:n}));const e=new Map;for(const[a,n]of Object.entries(W))e.set(a,n);for(const[a,n]of Object.entries(Q))e.set(a,n);return Array.from(e.entries()).map(([a,n])=>({id:a,name:n}))},[i]),S=Y(()=>Object.entries(c).filter(([,a])=>a==="include").map(([a])=>a).join(","),[c]),{data:L,isLoading:w,isError:Z,error:ee}=ne({query:p,type:i,genre:S,year:y,sort_by:f,page:u}),T=L?.results||[],_=L?.total_pages||0,j=L?.total_results||0,R=u<Math.min(_,500),d=M((e={})=>{const a=new URLSearchParams,n=e.q!==void 0?e.q:p,s=e.type!==void 0?e.type:i,G=e.year!==void 0?e.year:y,V=e.sort!==void 0?e.sort:f,F=e.page!==void 0?e.page:String(u),z=e.genre!==void 0?e.genre:S;n.trim()&&a.set("q",n.trim()),s!=="multi"&&a.set("type",s),z&&a.set("genre",z),G!=="ALL"&&a.set("year",G),V!=="popularity.desc"&&a.set("sort_by",V),F!=="1"&&a.set("page",F),m(a,{replace:!0})},[p,i,y,f,u,S,m]),A=M(()=>{oe(),v(1),H(g),d({q:g,page:"1"}),window.scrollTo({top:0,behavior:"smooth"})},[g,d]),q=M(e=>{if(v(e),d({page:String(e)}),C.current){const a=C.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:a,behavior:"smooth"})}},[d]),te=M(e=>{N(a=>{const n=a[e],s={...a};return n==="include"?s[e]="exclude":n==="exclude"?delete s[e]:s[e]="include",s}),v(1)},[]);return I(()=>{const a=Object.entries(c).filter(([,n])=>n==="include").map(([n])=>n).join(",");a!==$&&(k(a),d({genre:a,page:"1"}))},[c,$,k,d]),t("div",{className:"page-container",children:[t("div",{className:r.header,children:[t("h1",{className:r.pageTitle,children:"Search TV & Movies"}),t("p",{className:r.pageSubtitle,children:"Discover trending shows, movies, and more powered by TMDB"})]}),t("div",{className:r.filterContainer,children:[t("div",{className:r.searchBarWrapper,children:[t("div",{className:r.inputIconWrapper,children:[t(h,{name:"search",className:r.searchIcon}),t("input",{type:"text","data-virtual-keyboard":"true",className:r.searchInput,placeholder:"Search titles...",value:g,onInput:e=>U(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&A()})]}),t("div",{className:r.searchActions,children:[t("select",{value:i,onChange:e=>{J(e.currentTarget.value),N({})},className:r.providerSelect,"aria-label":"Media type",children:de.map(e=>t("option",{value:e.value,children:e.label},e.value))}),t(x,{onClick:A,className:r.searchBtn,children:"Search"}),t("button",{className:`${r.filterToggleBtn} ${b?r.active:""}`,onClick:()=>X(!b),children:[t(h,{name:"filter",size:14}),t("span",{children:"Filters"}),b?t(h,{name:"chevron-up",size:12}):t(h,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${r.advancedFilters} ${b?r.show:""}`,children:[t("div",{className:r.filterDivider}),t("div",{className:r.filterGrid,children:[t("div",{className:r.filterItem,children:[t("label",{children:"Sort By"}),t("select",{value:f,onChange:e=>E(e.currentTarget.value),children:ue.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:r.filterItem,children:[t("label",{children:"Year"}),t("select",{value:y,onChange:e=>B(e.currentTarget.value),children:me.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),P.length>0&&t("div",{className:r.genreSection,children:[t("label",{className:r.genreLabel,children:"Genres"}),t("div",{className:r.genreContainer,children:P.map(e=>t("button",{className:`${r.genreButton} ${r[c[e.id]||""]}`,onClick:()=>te(e.id),children:e.name},e.id))})]}),t("div",{className:r.filterActions,children:[t(x,{variant:"secondary",onClick:()=>{N({}),B("ALL"),E("popularity.desc"),v(1),d({genre:"",year:"ALL",sort:"popularity.desc",page:"1"})},children:"Reset All"}),t(x,{onClick:A,className:r.searchBtn,children:"Apply Filters"})]})]})]}),Z&&t(ce,{message:ee?.message||"Search failed"}),Object.keys(c).length>0&&t("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",marginBottom:"1.5rem"},children:[t("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),Object.entries(c).map(([e,a])=>{const n=P.find(s=>s.id===e)?.name||e;return t("span",{className:`badge ${a==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[a==="include"?`+ ${n}`:`- ${n}`,t("button",{onClick:()=>{const s={...c};delete s[e],N(s)},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e)})]}),t("div",{className:r.resultsHeader,ref:C,children:[t("h2",{className:r.resultsTitle,children:[p?`Results for "${p}"`:S?"Browsing genres":i==="tv"?"Popular TV Shows":i==="movie"?"Popular Movies":"Trending",j>0&&t("span",{style:{fontWeight:400,color:"var(--text-tertiary)",fontSize:"0.85em",marginLeft:"0.5em"},children:["(",j.toLocaleString(),")"]})]}),T.length>0&&t(D,{page:u,totalPages:Math.max(1,Math.min(_,500)),canGoNext:R,onChange:q,isLoading:w})]}),t("div",{className:`${r.resultsGrid} ${K?r.lowEnd:""}`,children:w?t(le,{}):T.map(e=>t(se,{item:{id:e.id,title:e.title,year:e.year,type:e.type,image:e.image,vote_average:e.vote_average,adult:e.adult}},`${e.type}-${e.id}`))}),!w&&T.length===0&&t("div",{className:r.noResults,children:[t(h,{name:"search",size:48,className:r.noResultsIcon}),t("h3",{children:"No results found"}),t("p",{children:"Try adjusting your search or filters to find what you're looking for."})]}),T.length>0&&t("div",{className:r.bottomPagination,children:t(D,{page:u,totalPages:Math.max(1,Math.min(_,500)),canGoNext:R,onChange:q,isLoading:w,variant:"labeled"})})]})}export{_e as default};
@@ -1 +1 @@
1
- import{o as $,d as f,h as L,T as U,u as d}from"./vendor-core-DfaOB3Rn.js";import{M as x}from"./MediaCard-hWGCEHWx.js";import{L as F}from"./LibraryListPage-BnrEDG8j.js";import{R as N}from"./ResetProgressModal-BuESoxbY.js";import{T as _}from"./TvPopup-DZtX79Ol.js";import{g as u}from"./index-DB81Su4I.js";import{m as q,u as K,a as O,b as Q,h as Y,o as z,p as G,q as Z,t as y,i as R,r as I}from"./useTvLibrary-BGz7Unv_.js";import"./vendor-icons-DrybRNxP.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-BnB-RHYQ.js";import"./SkeletonGrid-QWMGLCGp.js";import"./ErrorMessage-DAxegITP.js";import"./LibraryListPage.module-r6k9nyT9.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-DI-v-DQ1.js";const j=["All","Continue Watching",...I],S=24;function ct(){const{filter:l="All"}=$(),[c,m]=f(1),[s,v]=f(null);L(()=>{document.title="TV Watchlist - dango"},[]),L(()=>{m(1)},[l]);const o=l==="Continue Watching",r=q(o?"All":l,c,S),i=K(100),T=O(),P=Q(),w=Y(),k=z(),C=G(),B=Z(),M=U(()=>o?(i.data?.data??[]).map(t=>{const a=t.currentTime??0,e=t.duration??0,g=t.season??1,h=t.episode??1,n=t.mediaType==="movie",p=n?"Movie":`S${g} E${h}`,b=t.completed===1||e>0&&a>=e*.8;return{key:t.id,libId:t.id,tmdbId:t.tmdbId??0,mediaType:t.mediaType,title:t.title||"",poster:t.poster||"",year:t.year,adult:R({adult:t.adult===1}),status:t.watchlistStatus??"",badge:p,progressPercent:b?100:e>0?a/e*100:0,progressLabel:e>0?b?"Watched":n?`${u(a)} / ${u(e)}`:`${p} · ${u(a)} / ${u(e)}`:p,watchTarget:y(t.mediaType,t.tmdbId??0,n?void 0:g,n?void 0:h)}}):(r.data?.data??[]).map(t=>({key:t.id,libId:t.id,tmdbId:t.tmdbId,mediaType:t.mediaType,title:t.title,poster:t.poster||"",year:t.year,adult:R({adult:t.adult===1}),status:t.status,badge:t.lastSeason&&t.lastEpisode?`S${t.lastSeason} E${t.lastEpisode}`:void 0,progressPercent:void 0,progressLabel:void 0,watchTarget:y(t.mediaType,t.tmdbId,t.lastSeason??void 0,t.lastEpisode??void 0)})),[o,i.data,r.data]),W=o?i.data?.total??0:r.data?.total??0,E=o?i.isLoading:r.isLoading,A=o?i.error:r.error,V=t=>{s&&(P.mutate({mediaId:s.libId}),t&&T.mutate(s.libId))};return d(F,{headerTitle:"My TV Watchlist",headerSubtitle:"Track and manage your movies and shows",filters:j,filterBy:l,filterBasePath:"/tv-watchlist",continueFilter:"Continue Watching",statusOptions:[...I],entries:M,total:W,isLoading:E,error:A,page:c,pageSize:S,onPageChange:m,emptyTitle:"Your TV watchlist is looking a bit empty",emptyFilteredText:"No titles match this filter.",emptyAllText:"Let's find something to watch!",browseLabel:"Browse TV & Movies",browseTarget:"/tv",removeListLabel:"Remove from TV Watchlist",listNoun:"TV watchlist",skipConfirmKey:"tvSkipRemoveConfirmation",onBulkStatus:(t,a)=>k.mutate({ids:t,status:a}),onBulkRemove:t=>{o?B.mutate(t):C.mutate(t)},onStatusChange:(t,a)=>w.mutate({id:t,status:a}),onRemoveItem:t=>T.mutate(t),renderCard:t=>d(x,{item:{id:t.libId,title:t.title,thumbnail:t.poster,typeBadge:t.mediaType==="movie"?"Movie":"TV",chapterBadge:t.badge??null,isAdult:t.adult},linkTo:t.watchTarget,hoverIcon:"play",progress:t.progressPercent!==void 0&&t.progressLabel?{percent:t.progressPercent,label:t.progressLabel}:void 0,showProgress:o,metaRow:t.year?d("span",{style:{opacity:.75},children:t.year}):void 0,onRemove:o?()=>v(t):void 0,renderPopup:(a,e)=>d(_,{item:{id:t.tmdbId??0,title:t.title||"",year:t.year||"",type:t.mediaType||"tv",image:t.poster||""},anchorRect:a,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onRequestClose:e.close})}),modals:d(N,{isOpen:!!s,itemName:s?.title,progressKind:"watch",listLabel:"my TV watchlist",onClose:()=>{v(null)},onConfirm:V})})}export{ct as default};
1
+ import{o as $,d as f,h as L,T as U,u as d}from"./vendor-core-DfaOB3Rn.js";import{M as x}from"./MediaCard-lz7FdOe_.js";import{L as F}from"./LibraryListPage-BT_xDjEq.js";import{R as N}from"./ResetProgressModal-0PvvM2XJ.js";import{T as _}from"./TvPopup-BwGJ1Tjg.js";import{g as u}from"./index-DlcgJVM6.js";import{m as q,u as K,a as O,b as Q,h as Y,o as z,p as G,q as Z,t as y,i as R,r as I}from"./useTvLibrary-DiCSdUOj.js";import"./vendor-icons-DrybRNxP.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-Beq4JL0b.js";import"./SkeletonGrid-pA-dcLBM.js";import"./ErrorMessage-DAxegITP.js";import"./LibraryListPage.module-r6k9nyT9.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-DdnIPcOQ.js";const j=["All","Continue Watching",...I],S=24;function ct(){const{filter:l="All"}=$(),[c,m]=f(1),[s,v]=f(null);L(()=>{document.title="TV Watchlist - dango"},[]),L(()=>{m(1)},[l]);const o=l==="Continue Watching",r=q(o?"All":l,c,S),i=K(100),T=O(),P=Q(),w=Y(),k=z(),C=G(),B=Z(),M=U(()=>o?(i.data?.data??[]).map(t=>{const a=t.currentTime??0,e=t.duration??0,g=t.season??1,h=t.episode??1,n=t.mediaType==="movie",p=n?"Movie":`S${g} E${h}`,b=t.completed===1||e>0&&a>=e*.8;return{key:t.id,libId:t.id,tmdbId:t.tmdbId??0,mediaType:t.mediaType,title:t.title||"",poster:t.poster||"",year:t.year,adult:R({adult:t.adult===1}),status:t.watchlistStatus??"",badge:p,progressPercent:b?100:e>0?a/e*100:0,progressLabel:e>0?b?"Watched":n?`${u(a)} / ${u(e)}`:`${p} · ${u(a)} / ${u(e)}`:p,watchTarget:y(t.mediaType,t.tmdbId??0,n?void 0:g,n?void 0:h)}}):(r.data?.data??[]).map(t=>({key:t.id,libId:t.id,tmdbId:t.tmdbId,mediaType:t.mediaType,title:t.title,poster:t.poster||"",year:t.year,adult:R({adult:t.adult===1}),status:t.status,badge:t.lastSeason&&t.lastEpisode?`S${t.lastSeason} E${t.lastEpisode}`:void 0,progressPercent:void 0,progressLabel:void 0,watchTarget:y(t.mediaType,t.tmdbId,t.lastSeason??void 0,t.lastEpisode??void 0)})),[o,i.data,r.data]),W=o?i.data?.total??0:r.data?.total??0,E=o?i.isLoading:r.isLoading,A=o?i.error:r.error,V=t=>{s&&(P.mutate({mediaId:s.libId}),t&&T.mutate(s.libId))};return d(F,{headerTitle:"My TV Watchlist",headerSubtitle:"Track and manage your movies and shows",filters:j,filterBy:l,filterBasePath:"/tv-watchlist",continueFilter:"Continue Watching",statusOptions:[...I],entries:M,total:W,isLoading:E,error:A,page:c,pageSize:S,onPageChange:m,emptyTitle:"Your TV watchlist is looking a bit empty",emptyFilteredText:"No titles match this filter.",emptyAllText:"Let's find something to watch!",browseLabel:"Browse TV & Movies",browseTarget:"/tv",removeListLabel:"Remove from TV Watchlist",listNoun:"TV watchlist",skipConfirmKey:"tvSkipRemoveConfirmation",onBulkStatus:(t,a)=>k.mutate({ids:t,status:a}),onBulkRemove:t=>{o?B.mutate(t):C.mutate(t)},onStatusChange:(t,a)=>w.mutate({id:t,status:a}),onRemoveItem:t=>T.mutate(t),renderCard:t=>d(x,{item:{id:t.libId,title:t.title,thumbnail:t.poster,typeBadge:t.mediaType==="movie"?"Movie":"TV",chapterBadge:t.badge??null,isAdult:t.adult},linkTo:t.watchTarget,hoverIcon:"play",progress:t.progressPercent!==void 0&&t.progressLabel?{percent:t.progressPercent,label:t.progressLabel}:void 0,showProgress:o,metaRow:t.year?d("span",{style:{opacity:.75},children:t.year}):void 0,onRemove:o?()=>v(t):void 0,renderPopup:(a,e)=>d(_,{item:{id:t.tmdbId??0,title:t.title||"",year:t.year||"",type:t.mediaType||"tv",image:t.poster||""},anchorRect:a,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onRequestClose:e.close})}),modals:d(N,{isOpen:!!s,itemName:s?.title,progressKind:"watch",listLabel:"my TV watchlist",onClose:()=>{v(null)},onConfirm:V})})}export{ct as default};
@@ -1 +1 @@
1
- import{h as fe,o as He,a as Ze,p as Je,d as h,A as ye,T,u as t,S as Xe}from"./vendor-core-DfaOB3Rn.js";import{u as et,a as Se}from"./vendor-query-BBT5_sHx.js";import{i as tt,u as at,d as nt,x as st,y as _e,z as Ae,q as we,A as lt,t as rt,l as ct,C as it,D as ot,E as dt,F as ht,G as ut,B as W,M as se}from"./index-DB81Su4I.js";import{I as g}from"./vendor-icons-DrybRNxP.js";import{A as mt}from"./AnimeCard-BVufFeLC.js";import{S as pt}from"./SkeletonGrid-QWMGLCGp.js";import{E as gt}from"./ErrorMessage-DAxegITP.js";import{P as Le}from"./MediaCard-hWGCEHWx.js";import{s as n}from"./LibraryListPage.module-r6k9nyT9.js";import{A as vt}from"./ActiveFilterChips-olGfwxle.js";import"./useAnimeInfoData-DpUA78Mv.js";import"./QueueOptionsButton-B4Re8F3V.js";import"./vendor-ui-3qrARCPr.js";import"./playbackCompletion-IPHm9fp5.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-BnB-RHYQ.js";const ft=(d,v)=>{const l=new URLSearchParams(v);return l.delete("page"),l.sort(),`${d}|${l.toString()}`},yt=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.add(A)),l},St=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.delete(A)),l},_t="_sortSelect_cahhw_1",At="_filterContainer_cahhw_30",wt="_slideUpIn_cahhw_1",Lt="_searchBarWrapper_cahhw_44",Ct="_inputIconWrapper_cahhw_50",Nt="_searchIcon_cahhw_55",bt="_searchInput_cahhw_64",Bt="_searchActions_cahhw_84",kt="_searchBtn_cahhw_89",Rt="_filterToggleBtn_cahhw_94",Tt="_advancedFilters_cahhw_115",Wt="_show_cahhw_122",It="_filterDivider_cahhw_128",xt="_filterGrid_cahhw_134",$t="_filterItem_cahhw_141",Pt="_genreSection_cahhw_183",Ft="_genreLabel_cahhw_189",Gt="_genreContainer_cahhw_199",Mt="_genreButton_cahhw_205",Ot="_include_cahhw_222",Et="_exclude_cahhw_228",Dt="_filterActions_cahhw_235",zt="_applyBtn_cahhw_246",c={sortSelect:_t,filterContainer:At,slideUpIn:wt,searchBarWrapper:Lt,inputIconWrapper:Ct,searchIcon:Nt,searchInput:bt,searchActions:Bt,searchBtn:kt,filterToggleBtn:Rt,advancedFilters:Tt,show:Wt,filterDivider:It,filterGrid:xt,filterItem:$t,genreSection:Pt,genreLabel:Ft,genreContainer:Gt,genreButton:Mt,include:Ot,exclude:Et,filterActions:Dt,applyBtn:zt},Ne=["All","Continue Watching","Watching","Completed","On-Hold","Dropped","Planned"],Ce=Ne.slice(2),Ut=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Adult (18+)"}],qt=[{value:"ALL",label:"All Seasons"},{value:"WINTER",label:"Winter"},{value:"SPRING",label:"Spring"},{value:"SUMMER",label:"Summer"},{value:"FALL",label:"Fall"}],ca=()=>{fe(()=>{document.title="Watchlist - dango"},[]);const{filter:d="All"}=He(),v=Ze(),[l,A]=Je(),Q=et(),le=tt(),[f,I]=h(parseInt(l.get("page")||"1")),[w,x]=h(l.get("query")||""),[L,V]=h(l.get("sortBy")||"last_added"),[C,$]=h(l.get("type")||"ALL"),[N,P]=h(l.get("season")||"ALL"),[b,F]=h(l.get("year")||"ALL"),[k,G]=h(()=>{const e={},a=l.get("genres")?.split(",").map(r=>r.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(r=>r.trim()).filter(Boolean)||[];return a.forEach(r=>r&&(e[r]="include")),s.forEach(r=>r&&(e[r]="exclude")),e}),[M,be]=h(()=>["type","season","year","genres","excludeGenres"].some(e=>l.has(e))),{lowEndMode:Be}=at(),{titlePreference:O}=nt(),{data:ke}=st(),re=ke?.genres||[],H=ye(null),[o,B]=h(null),[Z,E]=h(!1),[ce,D]=h(!1),[z,Re]=h(!1),[p,y]=h(new Set),J=ye(null),i=d==="Continue Watching",U=T(()=>{const e=new URLSearchParams(l);return e.delete("page"),e.set("titlePreference",O),e.toString()},[l,O]),{data:q,isLoading:Te,error:We}=_e(U,f,14),{data:Y,isLoading:Ie,error:xe}=Ae(d,U,f,14),{data:$e}=_e(U,f+1,14),{data:Pe}=Ae(d,U,f+1,14),X=T(()=>(i?q?.data:Y?.data)||[],[i,q,Y]),R=T(()=>(i?q?.total:Y?.total)||0,[i,q,Y]),j=i?Te:Ie,ie=i?We:xe,oe=i?$e:Pe;fe(()=>{x(l.get("query")||""),V(l.get("sortBy")||"last_added"),$(l.get("type")||"ALL"),P(l.get("season")||"ALL"),F(l.get("year")||"ALL");const e={},a=l.get("genres")?.split(",").map(u=>u.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(u=>u.trim()).filter(Boolean)||[];a.forEach(u=>u&&(e[u]="include")),s.forEach(u=>u&&(e[u]="exclude")),G(e),I(parseInt(l.get("page")||"1"));const r=ft(d,l);J.current!==null&&J.current!==r&&y(new Set),J.current=r},[l,d]);const Fe=Se({mutationFn:async({id:e,status:a})=>{await rt.watchlist.setStatus.mutate({id:e,status:a})},onSuccess:()=>{Q.invalidateQueries({queryKey:[we.watchlist]}),lt.success("Status updated")}}),Ge=Se(le.continueWatching.remove.mutationOptions({onSuccess:()=>{Q.invalidateQueries(le.continueWatching.pathFilter()),Q.invalidateQueries({queryKey:[we.continueWatching]})}})),ee=ct(),{data:de}=it("skipRemoveConfirmation"),Me=ot(),te=T(()=>{const e=a=>a[O]||a.name||"";return[...X].sort((a,s)=>L==="name_asc"?e(a).localeCompare(e(s)):L==="name_desc"?e(s).localeCompare(e(a)):0)},[X,L,O]),ae=new Date().getFullYear(),Oe=[{value:"ALL",label:"All Years"},...Array.from({length:ae-1980+1},(e,a)=>({value:String(ae-a),label:String(ae-a)}))],m=(e=L,a=1)=>{const s=new URLSearchParams;w.trim()&&s.set("query",w.trim()),e!=="last_added"&&s.set("sortBy",e),C!=="ALL"&&s.set("type",C),N!=="ALL"&&s.set("season",N),b!=="ALL"&&s.set("year",b);const r=Object.entries(k).filter(([,_])=>_==="include").map(([_])=>_),u=Object.entries(k).filter(([,_])=>_==="exclude").map(([_])=>_);r.length>0&&s.set("genres",r.join(",")),u.length>0&&s.set("excludeGenres",u.join(",")),a>1&&s.set("page",a.toString()),A(s),a!==f&&I(a)},he=e=>{if(m(L,e),H.current){const a=H.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:a,behavior:"smooth"})}},Ee=()=>{x(""),V("last_added"),$("ALL"),P("ALL"),F("ALL"),G({}),A(new URLSearchParams),I(1)},De=e=>{G(a=>{const s=a[e],r={...a};return s==="include"?r[e]="exclude":s==="exclude"?delete r[e]:r[e]="include",r})},ue=(e,a)=>{if(i){B({id:e,name:a});return}String(de)==="true"||String(de)==="1"?ee.mutate({id:e}):B({id:e,name:a})},ze=()=>{if(o){if(o.ids){i?(Ue.mutate({ids:o.ids}),Z&&pe.mutate({ids:o.ids})):pe.mutate({ids:o.ids}),y(new Set),B(null),E(!1),D(!1);return}i?(Ge.mutate({showId:o.id}),Z&&ee.mutate({id:o.id})):ee.mutate({id:o.id}),ce&&Me.mutate({key:"skipRemoveConfirmation",value:!0}),B(null),E(!1),D(!1)}},me=()=>{B(null),E(!1),D(!1)},pe=dt(),Ue=ht(),qe=ut(),Ye=()=>{Re(e=>{const a=!e;return a||y(new Set),a})},je=e=>{y(a=>{const s=new Set(a);return s.has(e)?s.delete(e):s.add(e),s})},K=te.map(e=>e.id),ne=K.length>0&&K.every(e=>p.has(e)),Ke=()=>{y(ne?e=>St(e,K):e=>yt(e,K))},Qe=e=>{p.size!==0&&(qe.mutate({ids:[...p],status:e}),y(new Set))},Ve=()=>{p.size!==0&&B({ids:[...p]})},ge=X.length>=14&&oe&&oe.data.length>0,ve=T(()=>Math.max(1,Math.ceil(R/14)),[R]),S=[];w.trim()&&S.push({key:"query",label:`Search: ${w}`,onRemove:()=>{x(""),m()}}),C!=="ALL"&&S.push({key:"type",label:`Type: ${C}`,onRemove:()=>{$("ALL"),m()}}),N!=="ALL"&&S.push({key:"season",label:`Season: ${N}`,onRemove:()=>{P("ALL"),m()}}),b!=="ALL"&&S.push({key:"year",label:`Year: ${b}`,onRemove:()=>{F("ALL"),m()}});for(const[e,a]of Object.entries(k))S.push({key:e,label:a==="include"?`+ ${e}`:`-${e}`,tone:a==="include"?"primary":"danger",onRemove:()=>{G(s=>{const r={...s};return delete r[e],r}),m()}});return t("div",{className:"page-container",children:[t("header",{className:n.header,children:[t("h2",{className:n.title,children:"My Watchlist"}),t("p",{className:n.subtitle,children:"Track and manage your anime collection"})]}),t("div",{className:n.controls,children:[t("div",{className:n.filters,children:Ne.map(e=>t("button",{className:`${n.filterBtn} ${d===e?n.active:""}`,onClick:()=>{const a=new URLSearchParams(l);a.delete("page"),v({pathname:`/watchlist/${e}`,search:a.toString()}),I(1)},children:e},e))}),t("div",{children:t("select",{className:c.sortSelect,value:L,onChange:e=>{const a=e.currentTarget.value;V(a),m(a,f)},children:[t("option",{value:"last_added",children:"Recently Added"}),t("option",{value:"name_asc",children:"Name (A-Z)"}),t("option",{value:"name_desc",children:"Name (Z-A)"})]})})]}),t("div",{className:c.filterContainer,children:[t("div",{className:c.searchBarWrapper,children:[t("div",{className:c.inputIconWrapper,children:[t(g,{name:"search",className:c.searchIcon}),t("input",{className:c.searchInput,placeholder:"Search your watchlist by title...",value:w,onInput:e=>x(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&m()})]}),t("div",{className:c.searchActions,children:[t(W,{onClick:()=>m(),className:c.searchBtn,children:"Search"}),t("button",{className:`${c.filterToggleBtn} ${M?n.active:""}`,onClick:()=>be(!M),children:[t(g,{name:"filter",size:14}),t("span",{children:"Filters"}),M?t(g,{name:"chevron-up",size:12}):t(g,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${c.advancedFilters} ${M?c.show:""}`,children:[t("div",{className:c.filterDivider}),t("div",{className:c.filterGrid,children:[t("div",{className:c.filterItem,children:[t("label",{children:"Type"}),t("select",{value:C,onChange:e=>$(e.currentTarget.value),children:Ut.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Season"}),t("select",{value:N,onChange:e=>P(e.currentTarget.value),children:qt.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Year"}),t("select",{value:b,onChange:e=>F(e.currentTarget.value),children:Oe.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),re.length>0&&t("div",{className:c.genreSection,children:[t("label",{className:c.genreLabel,children:"Genres"}),t("div",{className:c.genreContainer,children:re.map(e=>t("button",{className:`${c.genreButton} ${c[k[e]||""]}`,onClick:()=>De(e),children:e},e))})]}),t("div",{className:c.filterActions,children:[t(W,{variant:"secondary",onClick:Ee,children:"Reset All"}),t(W,{onClick:()=>m(),className:c.applyBtn,children:"Apply Filters"})]})]})]}),t("div",{className:n.resultsHeader,ref:H,children:[t("h3",{className:n.resultsTitle,children:[i?"Continue Watching":d,t("span",{className:n.itemCount,children:["(",R," items)"]})]}),t("div",{className:n.headerActions,children:[t("button",{className:`${n.manageBtn} ${z?n.active:""}`,onClick:Ye,children:[t(g,{name:"pencil-alt",size:13}),t("span",{children:"Bulk Manage"})]}),R>0&&t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j})]})]}),z&&t("div",{className:n.manageBar,children:[t("button",{className:n.selectAllBtn,onClick:Ke,children:[t("span",{className:`${n.selectAllBox} ${ne?n.selectAllBoxChecked:""}`,"aria-hidden":"true"}),t("span",{children:ne?"Clear Page":"Select All"})]}),t("span",{className:n.manageCount,children:[p.size," selected"]}),t("div",{className:n.manageSpacer}),!i&&t("select",{className:n.manageStatusSelect,value:"",onChange:e=>{e.currentTarget.value&&Qe(e.currentTarget.value)},disabled:p.size===0,title:"Set status for selected items",children:[t("option",{value:"",children:"Set status…"}),Ce.map(e=>t("option",{value:e,children:e},e))]}),t("button",{className:n.manageRemoveBtn,onClick:Ve,disabled:p.size===0,children:[t(g,{name:"trash",size:13}),t("span",{children:"Remove Selected"})]})]}),j?t(pt,{}):ie?t(gt,{message:ie.message}):t(Xe,{children:[S.length>0&&t(vt,{chips:S}),t("div",{className:`${n.grid} ${Be?n.lowEnd:""}`,children:te.map(e=>{const a=p.has(e.id);return t("div",{className:`${n.itemWrapper} ${a?n.selected:""}`,children:[z&&t("div",{className:n.selectOverlay,onClick:()=>je(e.id),title:a?"Deselect":"Select",children:t("span",{className:n.selectBadge,children:a?t(g,{name:"check",size:12}):null})}),t(mt,{anime:e,continueWatching:i,onRemove:()=>ue(e.id,e.name),layout:"vertical"}),!i&&!z&&t("div",{className:n.cardActions,children:[t("select",{className:n.statusSelect,value:e.status,onChange:s=>Fe.mutate({id:e.id,status:s.currentTarget.value}),children:Ce.map(s=>t("option",{value:s,children:s},s))}),t("button",{className:n.removeBtn,onClick:()=>ue(e.id,e.name),title:"Remove from Watchlist","aria-label":"Remove from Watchlist",children:t(g,{name:"trash",size:12})})]})]},e._id)})})]}),!j&&te.length===0&&t("div",{className:n.emptyState,children:[t("h3",{className:n.emptyTitle,children:"Your watchlist is looking a bit lonely"}),t("p",{className:n.emptyText,children:d!=="All"||w||C!=="ALL"||N!=="ALL"||b!=="ALL"||Object.keys(k).length>0?"No anime match these filters. Try adjusting them to see more titles.":"Let's find something to watch!"}),t("button",{className:n.emptyBtn,onClick:()=>v("/search"),children:[t(g,{name:"search",size:14}),t("span",{children:"Browse Anime"})]})]}),R>0&&t("div",{className:n.bottomPagination,children:t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j,variant:"labeled"})}),t(se,{isOpen:!!o,onClose:me,title:i?"Reset Progress":"Remove from Watchlist",children:[t(se.Body,{children:[t("p",{children:o?.ids&&o.ids.length>1?i?`Are you sure you want to remove watch progress for ${o.ids.length} items?`:`Are you sure you want to remove ${o.ids.length} items from your watchlist?`:i?`Are you sure you want to remove your watch progress for "${o?.name}"?`:`Are you sure you want to remove "${o?.name}" from your watchlist?`}),i&&t("label",{children:[t("input",{type:"checkbox",checked:Z,onChange:e=>E(e.currentTarget.checked)}),"Also remove from my watchlist"]}),!i&&!(o?.ids&&o.ids.length>1)&&t("label",{children:[t("input",{type:"checkbox",checked:ce,onChange:e=>D(e.currentTarget.checked)}),"Remember my choice"]})]}),t(se.Actions,{children:[t(W,{variant:"secondary",onClick:me,children:"No"}),t(W,{variant:"danger",onClick:ze,children:"Yes"})]})]})]})};export{ca as default};
1
+ import{h as fe,o as He,a as Ze,p as Je,d as h,A as ye,T,u as t,S as Xe}from"./vendor-core-DfaOB3Rn.js";import{u as et,a as Se}from"./vendor-query-BBT5_sHx.js";import{i as tt,u as at,d as nt,x as st,y as _e,z as Ae,q as we,A as lt,t as rt,l as ct,C as it,D as ot,E as dt,F as ht,G as ut,B as W,M as se}from"./index-DlcgJVM6.js";import{I as g}from"./vendor-icons-DrybRNxP.js";import{A as mt}from"./AnimeCard-BxhPLWBG.js";import{S as pt}from"./SkeletonGrid-pA-dcLBM.js";import{E as gt}from"./ErrorMessage-DAxegITP.js";import{P as Le}from"./MediaCard-lz7FdOe_.js";import{s as n}from"./LibraryListPage.module-r6k9nyT9.js";import{A as vt}from"./ActiveFilterChips-olGfwxle.js";import"./useAnimeInfoData-tcGkDs2b.js";import"./QueueOptionsButton-B8xuoYlH.js";import"./vendor-ui-3qrARCPr.js";import"./playbackCompletion-IPHm9fp5.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-Beq4JL0b.js";const ft=(d,v)=>{const l=new URLSearchParams(v);return l.delete("page"),l.sort(),`${d}|${l.toString()}`},yt=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.add(A)),l},St=(d,v)=>{const l=new Set(d);return v.forEach(A=>l.delete(A)),l},_t="_sortSelect_cahhw_1",At="_filterContainer_cahhw_30",wt="_slideUpIn_cahhw_1",Lt="_searchBarWrapper_cahhw_44",Ct="_inputIconWrapper_cahhw_50",Nt="_searchIcon_cahhw_55",bt="_searchInput_cahhw_64",Bt="_searchActions_cahhw_84",kt="_searchBtn_cahhw_89",Rt="_filterToggleBtn_cahhw_94",Tt="_advancedFilters_cahhw_115",Wt="_show_cahhw_122",It="_filterDivider_cahhw_128",xt="_filterGrid_cahhw_134",$t="_filterItem_cahhw_141",Pt="_genreSection_cahhw_183",Ft="_genreLabel_cahhw_189",Gt="_genreContainer_cahhw_199",Mt="_genreButton_cahhw_205",Ot="_include_cahhw_222",Et="_exclude_cahhw_228",Dt="_filterActions_cahhw_235",zt="_applyBtn_cahhw_246",c={sortSelect:_t,filterContainer:At,slideUpIn:wt,searchBarWrapper:Lt,inputIconWrapper:Ct,searchIcon:Nt,searchInput:bt,searchActions:Bt,searchBtn:kt,filterToggleBtn:Rt,advancedFilters:Tt,show:Wt,filterDivider:It,filterGrid:xt,filterItem:$t,genreSection:Pt,genreLabel:Ft,genreContainer:Gt,genreButton:Mt,include:Ot,exclude:Et,filterActions:Dt,applyBtn:zt},Ne=["All","Continue Watching","Watching","Completed","On-Hold","Dropped","Planned"],Ce=Ne.slice(2),Ut=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Adult (18+)"}],qt=[{value:"ALL",label:"All Seasons"},{value:"WINTER",label:"Winter"},{value:"SPRING",label:"Spring"},{value:"SUMMER",label:"Summer"},{value:"FALL",label:"Fall"}],ca=()=>{fe(()=>{document.title="Watchlist - dango"},[]);const{filter:d="All"}=He(),v=Ze(),[l,A]=Je(),Q=et(),le=tt(),[f,I]=h(parseInt(l.get("page")||"1")),[w,x]=h(l.get("query")||""),[L,V]=h(l.get("sortBy")||"last_added"),[C,$]=h(l.get("type")||"ALL"),[N,P]=h(l.get("season")||"ALL"),[b,F]=h(l.get("year")||"ALL"),[k,G]=h(()=>{const e={},a=l.get("genres")?.split(",").map(r=>r.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(r=>r.trim()).filter(Boolean)||[];return a.forEach(r=>r&&(e[r]="include")),s.forEach(r=>r&&(e[r]="exclude")),e}),[M,be]=h(()=>["type","season","year","genres","excludeGenres"].some(e=>l.has(e))),{lowEndMode:Be}=at(),{titlePreference:O}=nt(),{data:ke}=st(),re=ke?.genres||[],H=ye(null),[o,B]=h(null),[Z,E]=h(!1),[ce,D]=h(!1),[z,Re]=h(!1),[p,y]=h(new Set),J=ye(null),i=d==="Continue Watching",U=T(()=>{const e=new URLSearchParams(l);return e.delete("page"),e.set("titlePreference",O),e.toString()},[l,O]),{data:q,isLoading:Te,error:We}=_e(U,f,14),{data:Y,isLoading:Ie,error:xe}=Ae(d,U,f,14),{data:$e}=_e(U,f+1,14),{data:Pe}=Ae(d,U,f+1,14),X=T(()=>(i?q?.data:Y?.data)||[],[i,q,Y]),R=T(()=>(i?q?.total:Y?.total)||0,[i,q,Y]),j=i?Te:Ie,ie=i?We:xe,oe=i?$e:Pe;fe(()=>{x(l.get("query")||""),V(l.get("sortBy")||"last_added"),$(l.get("type")||"ALL"),P(l.get("season")||"ALL"),F(l.get("year")||"ALL");const e={},a=l.get("genres")?.split(",").map(u=>u.trim()).filter(Boolean)||[],s=l.get("excludeGenres")?.split(",").map(u=>u.trim()).filter(Boolean)||[];a.forEach(u=>u&&(e[u]="include")),s.forEach(u=>u&&(e[u]="exclude")),G(e),I(parseInt(l.get("page")||"1"));const r=ft(d,l);J.current!==null&&J.current!==r&&y(new Set),J.current=r},[l,d]);const Fe=Se({mutationFn:async({id:e,status:a})=>{await rt.watchlist.setStatus.mutate({id:e,status:a})},onSuccess:()=>{Q.invalidateQueries({queryKey:[we.watchlist]}),lt.success("Status updated")}}),Ge=Se(le.continueWatching.remove.mutationOptions({onSuccess:()=>{Q.invalidateQueries(le.continueWatching.pathFilter()),Q.invalidateQueries({queryKey:[we.continueWatching]})}})),ee=ct(),{data:de}=it("skipRemoveConfirmation"),Me=ot(),te=T(()=>{const e=a=>a[O]||a.name||"";return[...X].sort((a,s)=>L==="name_asc"?e(a).localeCompare(e(s)):L==="name_desc"?e(s).localeCompare(e(a)):0)},[X,L,O]),ae=new Date().getFullYear(),Oe=[{value:"ALL",label:"All Years"},...Array.from({length:ae-1980+1},(e,a)=>({value:String(ae-a),label:String(ae-a)}))],m=(e=L,a=1)=>{const s=new URLSearchParams;w.trim()&&s.set("query",w.trim()),e!=="last_added"&&s.set("sortBy",e),C!=="ALL"&&s.set("type",C),N!=="ALL"&&s.set("season",N),b!=="ALL"&&s.set("year",b);const r=Object.entries(k).filter(([,_])=>_==="include").map(([_])=>_),u=Object.entries(k).filter(([,_])=>_==="exclude").map(([_])=>_);r.length>0&&s.set("genres",r.join(",")),u.length>0&&s.set("excludeGenres",u.join(",")),a>1&&s.set("page",a.toString()),A(s),a!==f&&I(a)},he=e=>{if(m(L,e),H.current){const a=H.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:a,behavior:"smooth"})}},Ee=()=>{x(""),V("last_added"),$("ALL"),P("ALL"),F("ALL"),G({}),A(new URLSearchParams),I(1)},De=e=>{G(a=>{const s=a[e],r={...a};return s==="include"?r[e]="exclude":s==="exclude"?delete r[e]:r[e]="include",r})},ue=(e,a)=>{if(i){B({id:e,name:a});return}String(de)==="true"||String(de)==="1"?ee.mutate({id:e}):B({id:e,name:a})},ze=()=>{if(o){if(o.ids){i?(Ue.mutate({ids:o.ids}),Z&&pe.mutate({ids:o.ids})):pe.mutate({ids:o.ids}),y(new Set),B(null),E(!1),D(!1);return}i?(Ge.mutate({showId:o.id}),Z&&ee.mutate({id:o.id})):ee.mutate({id:o.id}),ce&&Me.mutate({key:"skipRemoveConfirmation",value:!0}),B(null),E(!1),D(!1)}},me=()=>{B(null),E(!1),D(!1)},pe=dt(),Ue=ht(),qe=ut(),Ye=()=>{Re(e=>{const a=!e;return a||y(new Set),a})},je=e=>{y(a=>{const s=new Set(a);return s.has(e)?s.delete(e):s.add(e),s})},K=te.map(e=>e.id),ne=K.length>0&&K.every(e=>p.has(e)),Ke=()=>{y(ne?e=>St(e,K):e=>yt(e,K))},Qe=e=>{p.size!==0&&(qe.mutate({ids:[...p],status:e}),y(new Set))},Ve=()=>{p.size!==0&&B({ids:[...p]})},ge=X.length>=14&&oe&&oe.data.length>0,ve=T(()=>Math.max(1,Math.ceil(R/14)),[R]),S=[];w.trim()&&S.push({key:"query",label:`Search: ${w}`,onRemove:()=>{x(""),m()}}),C!=="ALL"&&S.push({key:"type",label:`Type: ${C}`,onRemove:()=>{$("ALL"),m()}}),N!=="ALL"&&S.push({key:"season",label:`Season: ${N}`,onRemove:()=>{P("ALL"),m()}}),b!=="ALL"&&S.push({key:"year",label:`Year: ${b}`,onRemove:()=>{F("ALL"),m()}});for(const[e,a]of Object.entries(k))S.push({key:e,label:a==="include"?`+ ${e}`:`-${e}`,tone:a==="include"?"primary":"danger",onRemove:()=>{G(s=>{const r={...s};return delete r[e],r}),m()}});return t("div",{className:"page-container",children:[t("header",{className:n.header,children:[t("h2",{className:n.title,children:"My Watchlist"}),t("p",{className:n.subtitle,children:"Track and manage your anime collection"})]}),t("div",{className:n.controls,children:[t("div",{className:n.filters,children:Ne.map(e=>t("button",{className:`${n.filterBtn} ${d===e?n.active:""}`,onClick:()=>{const a=new URLSearchParams(l);a.delete("page"),v({pathname:`/watchlist/${e}`,search:a.toString()}),I(1)},children:e},e))}),t("div",{children:t("select",{className:c.sortSelect,value:L,onChange:e=>{const a=e.currentTarget.value;V(a),m(a,f)},children:[t("option",{value:"last_added",children:"Recently Added"}),t("option",{value:"name_asc",children:"Name (A-Z)"}),t("option",{value:"name_desc",children:"Name (Z-A)"})]})})]}),t("div",{className:c.filterContainer,children:[t("div",{className:c.searchBarWrapper,children:[t("div",{className:c.inputIconWrapper,children:[t(g,{name:"search",className:c.searchIcon}),t("input",{className:c.searchInput,placeholder:"Search your watchlist by title...",value:w,onInput:e=>x(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&m()})]}),t("div",{className:c.searchActions,children:[t(W,{onClick:()=>m(),className:c.searchBtn,children:"Search"}),t("button",{className:`${c.filterToggleBtn} ${M?n.active:""}`,onClick:()=>be(!M),children:[t(g,{name:"filter",size:14}),t("span",{children:"Filters"}),M?t(g,{name:"chevron-up",size:12}):t(g,{name:"chevron-down",size:12})]})]})]}),t("div",{className:`${c.advancedFilters} ${M?c.show:""}`,children:[t("div",{className:c.filterDivider}),t("div",{className:c.filterGrid,children:[t("div",{className:c.filterItem,children:[t("label",{children:"Type"}),t("select",{value:C,onChange:e=>$(e.currentTarget.value),children:Ut.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Season"}),t("select",{value:N,onChange:e=>P(e.currentTarget.value),children:qt.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:c.filterItem,children:[t("label",{children:"Year"}),t("select",{value:b,onChange:e=>F(e.currentTarget.value),children:Oe.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),re.length>0&&t("div",{className:c.genreSection,children:[t("label",{className:c.genreLabel,children:"Genres"}),t("div",{className:c.genreContainer,children:re.map(e=>t("button",{className:`${c.genreButton} ${c[k[e]||""]}`,onClick:()=>De(e),children:e},e))})]}),t("div",{className:c.filterActions,children:[t(W,{variant:"secondary",onClick:Ee,children:"Reset All"}),t(W,{onClick:()=>m(),className:c.applyBtn,children:"Apply Filters"})]})]})]}),t("div",{className:n.resultsHeader,ref:H,children:[t("h3",{className:n.resultsTitle,children:[i?"Continue Watching":d,t("span",{className:n.itemCount,children:["(",R," items)"]})]}),t("div",{className:n.headerActions,children:[t("button",{className:`${n.manageBtn} ${z?n.active:""}`,onClick:Ye,children:[t(g,{name:"pencil-alt",size:13}),t("span",{children:"Bulk Manage"})]}),R>0&&t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j})]})]}),z&&t("div",{className:n.manageBar,children:[t("button",{className:n.selectAllBtn,onClick:Ke,children:[t("span",{className:`${n.selectAllBox} ${ne?n.selectAllBoxChecked:""}`,"aria-hidden":"true"}),t("span",{children:ne?"Clear Page":"Select All"})]}),t("span",{className:n.manageCount,children:[p.size," selected"]}),t("div",{className:n.manageSpacer}),!i&&t("select",{className:n.manageStatusSelect,value:"",onChange:e=>{e.currentTarget.value&&Qe(e.currentTarget.value)},disabled:p.size===0,title:"Set status for selected items",children:[t("option",{value:"",children:"Set status…"}),Ce.map(e=>t("option",{value:e,children:e},e))]}),t("button",{className:n.manageRemoveBtn,onClick:Ve,disabled:p.size===0,children:[t(g,{name:"trash",size:13}),t("span",{children:"Remove Selected"})]})]}),j?t(pt,{}):ie?t(gt,{message:ie.message}):t(Xe,{children:[S.length>0&&t(vt,{chips:S}),t("div",{className:`${n.grid} ${Be?n.lowEnd:""}`,children:te.map(e=>{const a=p.has(e.id);return t("div",{className:`${n.itemWrapper} ${a?n.selected:""}`,children:[z&&t("div",{className:n.selectOverlay,onClick:()=>je(e.id),title:a?"Deselect":"Select",children:t("span",{className:n.selectBadge,children:a?t(g,{name:"check",size:12}):null})}),t(mt,{anime:e,continueWatching:i,onRemove:()=>ue(e.id,e.name),layout:"vertical"}),!i&&!z&&t("div",{className:n.cardActions,children:[t("select",{className:n.statusSelect,value:e.status,onChange:s=>Fe.mutate({id:e.id,status:s.currentTarget.value}),children:Ce.map(s=>t("option",{value:s,children:s},s))}),t("button",{className:n.removeBtn,onClick:()=>ue(e.id,e.name),title:"Remove from Watchlist","aria-label":"Remove from Watchlist",children:t(g,{name:"trash",size:12})})]})]},e._id)})})]}),!j&&te.length===0&&t("div",{className:n.emptyState,children:[t("h3",{className:n.emptyTitle,children:"Your watchlist is looking a bit lonely"}),t("p",{className:n.emptyText,children:d!=="All"||w||C!=="ALL"||N!=="ALL"||b!=="ALL"||Object.keys(k).length>0?"No anime match these filters. Try adjusting them to see more titles.":"Let's find something to watch!"}),t("button",{className:n.emptyBtn,onClick:()=>v("/search"),children:[t(g,{name:"search",size:14}),t("span",{children:"Browse Anime"})]})]}),R>0&&t("div",{className:n.bottomPagination,children:t(Le,{page:f,totalPages:ve,canGoNext:ge,onChange:he,isLoading:j,variant:"labeled"})}),t(se,{isOpen:!!o,onClose:me,title:i?"Reset Progress":"Remove from Watchlist",children:[t(se.Body,{children:[t("p",{children:o?.ids&&o.ids.length>1?i?`Are you sure you want to remove watch progress for ${o.ids.length} items?`:`Are you sure you want to remove ${o.ids.length} items from your watchlist?`:i?`Are you sure you want to remove your watch progress for "${o?.name}"?`:`Are you sure you want to remove "${o?.name}" from your watchlist?`}),i&&t("label",{children:[t("input",{type:"checkbox",checked:Z,onChange:e=>E(e.currentTarget.checked)}),"Also remove from my watchlist"]}),!i&&!(o?.ids&&o.ids.length>1)&&t("label",{children:[t("input",{type:"checkbox",checked:ce,onChange:e=>D(e.currentTarget.checked)}),"Remember my choice"]})]}),t(se.Actions,{children:[t(W,{variant:"secondary",onClick:me,children:"No"}),t(W,{variant:"danger",onClick:ze,children:"Yes"})]})]})]})};export{ca as default};
@@ -1 +1 @@
1
- import{_ as n}from"./index-DB81Su4I.js";let a=null,e=null;async function r(){return a||(e||(e=n(()=>import("./hls-BOLXTnjL.js"),[]).then(l=>(a=l.default,a)).catch(()=>null)),e)}function c(l){return l.canPlayType("application/vnd.apple.mpegurl")!==""||l.canPlayType("application/x-mpegURL")!==""}export{c,r as l};
1
+ import{_ as n}from"./index-DlcgJVM6.js";let a=null,e=null;async function r(){return a||(e||(e=n(()=>import("./hls-BOLXTnjL.js"),[]).then(l=>(a=l.default,a)).catch(()=>null)),e)}function c(l){return l.canPlayType("application/vnd.apple.mpegurl")!==""||l.canPlayType("application/x-mpegURL")!==""}export{c,r as l};