@serifpersia/dango 3.7.7 → 3.7.9

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 (86) hide show
  1. package/README.md +3 -1
  2. package/client/dist/assets/{AnimeCard-aZA4-g8o.js → AnimeCard-DWnU-rCc.js} +1 -1
  3. package/client/dist/assets/{AnimeInfo-CFGRb1OW.js → AnimeInfo-Ck-fMvdY.js} +1 -1
  4. package/client/dist/assets/{AnimeInfoPage-CozJH4AM.js → AnimeInfoPage-_iM5y3E4.js} +2 -2
  5. package/client/dist/assets/Asmr-CzqLNY2c.js +2 -0
  6. package/client/dist/assets/{AsmrResetProgressModal-NKywttOY.js → AsmrResetProgressModal-73jUOcAL.js} +1 -1
  7. package/client/dist/assets/Home--RCZI3_q.js +1 -0
  8. package/client/dist/assets/Insights-B5oANHfN.js +1 -0
  9. package/client/dist/assets/{LibraryListPage-CJxNJYC3.js → LibraryListPage-CV2FpbUe.js} +1 -1
  10. package/client/dist/assets/{ListeningList-VZTVSt_i.js → ListeningList-Bb7qLeQy.js} +1 -1
  11. package/client/dist/assets/Manga-RzxC02lH.js +1 -0
  12. package/client/dist/assets/{MangaInfoPage-DzaSKarW.js → MangaInfoPage-DLANpxOs.js} +1 -1
  13. package/client/dist/assets/MangaReadPage-DuMOiKID.js +1 -0
  14. package/client/dist/assets/{MangaResetProgressModal-DrqN7OF0.js → MangaResetProgressModal-Y2PuLQHz.js} +1 -1
  15. package/client/dist/assets/Mature-DfO3sop8.js +1 -0
  16. package/client/dist/assets/{MatureConsentModal-DLVOORqW.js → MatureConsentModal-DiWSp3Of.js} +1 -1
  17. package/client/dist/assets/{MediaCard-DJNRuWDJ.js → MediaCard-ChUKs5Sb.js} +1 -1
  18. package/client/dist/assets/OptionListMenu-Cwb6MHoZ.js +1 -0
  19. package/client/dist/assets/Player-JA7rXoBD.js +56 -0
  20. package/client/dist/assets/PlayerProvider--aaVRFly.js +1 -0
  21. package/client/dist/assets/PlayerSettings-CxlbcdU4.js +1 -0
  22. package/client/dist/assets/{QueueOptionsButton-ByAwxtJ-.js → QueueOptionsButton-C6ArqpM5.js} +1 -1
  23. package/client/dist/assets/{QueueRail-BLf4fWOA.js → QueueRail-Derl5yzz.js} +1 -1
  24. package/client/dist/assets/{ReadingList-Cm5omw5j.js → ReadingList-BYbV0CvS.js} +1 -1
  25. package/client/dist/assets/{ResetProgressModal-Dq-B23o_.js → ResetProgressModal-DtUE-wCy.js} +1 -1
  26. package/client/dist/assets/Search-CzTO0VVY.js +1 -0
  27. package/client/dist/assets/Settings-D37LNfis.css +1 -0
  28. package/client/dist/assets/Settings-DKGEpLWL.js +21 -0
  29. package/client/dist/assets/{SkeletonGrid-sA6_IQY1.js → SkeletonGrid-BO0am1za.js} +1 -1
  30. package/client/dist/assets/Trackers-uUzceJl6.js +2 -0
  31. package/client/dist/assets/Tv-CuM6Jhjn.js +4 -0
  32. package/client/dist/assets/TvInfo-4DOit0hL.js +1 -0
  33. package/client/dist/assets/TvPopup-DYYtMp7D.js +1 -0
  34. package/client/dist/assets/TvSearch-C-IYU0V4.js +1 -0
  35. package/client/dist/assets/{TvWatchlist-SjHmyo2P.js → TvWatchlist--kFfdVIF.js} +1 -1
  36. package/client/dist/assets/VirtualKeyboard-BYc_6hb4.js +1 -0
  37. package/client/dist/assets/WatchAlong-zZPGaH2D.js +1 -0
  38. package/client/dist/assets/WatchAlongPanel-DbJuLqxU.css +1 -0
  39. package/client/dist/assets/WatchAlongPanel-DxC7pX1I.js +1 -0
  40. package/client/dist/assets/{Watchlist-BnmsAcx0.js → Watchlist-CX9qGh-b.js} +1 -1
  41. package/client/dist/assets/index-DP9TtvZX.css +1 -0
  42. package/client/dist/assets/index-DbRDs7tF.js +178 -0
  43. package/client/dist/assets/{libraryInvalidation-2sAPXNhJ.js → libraryInvalidation-cJ1WjrJq.js} +1 -1
  44. package/client/dist/assets/playbackCompletion-CnxK6_Vz.js +1 -0
  45. package/client/dist/assets/{useAnimeInfoData-Ai39I_f0.js → useAnimeInfoData-YbePqj-M.js} +1 -1
  46. package/client/dist/assets/{useAsmr-XBCV7iDw.js → useAsmr-DO5DUI_t.js} +1 -1
  47. package/client/dist/assets/{useAsmrPopup-DViHcQnO.js → useAsmrPopup-S_XfgKDh.js} +1 -1
  48. package/client/dist/assets/{useMangaLibrary-DrPp5K_1.js → useMangaLibrary-B4ZJLZXD.js} +1 -1
  49. package/client/dist/assets/{useMangaPopup-VGTfdKEu.js → useMangaPopup-B4ntcNg0.js} +1 -1
  50. package/client/dist/assets/{useProviders-Bt-p5Jxv.js → useProviders-Bnw0sBAP.js} +1 -1
  51. package/client/dist/assets/useTv-gF7SJCl9.js +1 -0
  52. package/client/dist/assets/useTvLibrary-DTWM3iOC.js +1 -0
  53. package/client/dist/assets/useWatchAlongPlayer-Do0c9QsI.js +10 -0
  54. package/client/dist/index.html +2 -2
  55. package/package.json +2 -2
  56. package/server/dist/config.js +1 -1
  57. package/server/dist/profile-scope.js +1 -0
  58. package/server/dist/server.js +257 -249
  59. package/server/dist/shipped-defaults.js +1 -1
  60. package/server/package.json +2 -2
  61. package/client/dist/assets/Asmr-AxjnBdsh.js +0 -2
  62. package/client/dist/assets/Home-CkdWZK2L.js +0 -1
  63. package/client/dist/assets/Insights-DgnlUFjW.js +0 -1
  64. package/client/dist/assets/Manga-dDQAtejO.js +0 -1
  65. package/client/dist/assets/MangaReadPage-CT6THZho.js +0 -1
  66. package/client/dist/assets/Mature-BGitA9fy.js +0 -1
  67. package/client/dist/assets/OptionListMenu-CRaHF9k4.js +0 -1
  68. package/client/dist/assets/Player-CdSjfMoO.js +0 -56
  69. package/client/dist/assets/PlayerProvider-D02-hqdz.js +0 -1
  70. package/client/dist/assets/PlayerSettings-CXmAyRJh.js +0 -1
  71. package/client/dist/assets/Search-C8rfGyYH.js +0 -1
  72. package/client/dist/assets/Settings-DYjRBgpE.css +0 -1
  73. package/client/dist/assets/Settings-Do5F5e2c.js +0 -21
  74. package/client/dist/assets/Trackers-DeJr1sbR.js +0 -2
  75. package/client/dist/assets/Tv-BkApELpu.js +0 -4
  76. package/client/dist/assets/TvInfo-C5cVdHka.js +0 -1
  77. package/client/dist/assets/TvPopup-DyFUi32m.js +0 -1
  78. package/client/dist/assets/TvSearch-BBYYrww5.js +0 -1
  79. package/client/dist/assets/VirtualKeyboard-DeP7fb3P.js +0 -1
  80. package/client/dist/assets/index-5x1mF1nD.css +0 -1
  81. package/client/dist/assets/index-vb4WPdcb.js +0 -178
  82. package/client/dist/assets/playbackCompletion-IPHm9fp5.js +0 -1
  83. package/client/dist/assets/usePlaybackEnd-C5EyqR1L.js +0 -10
  84. package/client/dist/assets/useTv-BpVapcT5.js +0 -1
  85. package/client/dist/assets/useTvLibrary-BFRidauf.js +0 -1
  86. /package/client/dist/assets/{usePlaybackEnd-BMf_H2dw.css → useWatchAlongPlayer-BMf_H2dw.css} +0 -0
package/README.md CHANGED
@@ -6,7 +6,7 @@ _A local-first anime web app focused on performance, privacy, and personal libra
6
6
 
7
7
  [![License: MIT](https://img.shields.io/badge/License-MIT-897cff?style=for-the-badge)](https://opensource.org/licenses/MIT)
8
8
  ![Github stars](https://img.shields.io/github/stars/serifpersia/dango.svg?style=for-the-badge&color=897cff)
9
- [![App version](https://img.shields.io/badge/dango-3.7.7-897cff?style=for-the-badge)](https://github.com/serifpersia/dango)
9
+ [![App version](https://img.shields.io/badge/dango-3.7.9-897cff?style=for-the-badge)](https://github.com/serifpersia/dango)
10
10
 
11
11
  [![Provider Status](https://dango-users-badge.ramiserifpersia.workers.dev/?provider=all)](https://dango-users-badge.ramiserifpersia.workers.dev/?view=status)
12
12
 
@@ -23,11 +23,13 @@ _A local-first anime web app focused on performance, privacy, and personal libra
23
23
  - **Hardware Efficient:** Engineered with a minimal footprint to run effortlessly on low-spec hardware, SBCs, and mobile environments.
24
24
  - **Metadata & Discovery:** Browse trending titles, search catalog entries, and view release schedules locally.
25
25
  - **Multi-Provider Playback:** Switch seamlessly between multiple third-party streaming providers directly within the player interface.
26
+ - **Watch Along:** Create a room below a direct HLS anime, TV, or movie player and share the invite. Each viewer uses their own Dango; the host controls playback. No port forwarding needed. End the room when finished, or it expires after six hours.
26
27
  - **Watchlist Tracking:** Categorize titles (Watching, Completed, Plan to Watch) with fine-grained progress states.
27
28
  - **Library Insights:** Built-in dashboard tracking viewing habits, personal stats, and completion ratios.
28
29
  - **Trackers & Sync:** Bi-directional AniList and MyAnimeList sync for anime and manga, plus username and XML list imports.
29
30
  - **Expanded Media Hub:** Dedicated interfaces for Manga, ASMR, and TV/Movies.
30
31
  - **LAN Security:** Optional LAN authentication with password enforcement for multi-device local network deployments.
32
+ - **[Profiles](docs/profiles.md):** Separate libraries, tracker/cloud connections and preferences, with optional profile passwords and custom images.
31
33
 
32
34
  ---
33
35
 
@@ -1 +1 @@
1
- import{T as A,u as o,N as M,S as $}from"./vendor-core-DfaOB3Rn.js";import{I as b}from"./vendor-icons-DrybRNxP.js";import{u as B}from"./useAnimeInfoData-Ai39I_f0.js";import{d as C,s as P,g as v}from"./index-vb4WPdcb.js";import{Q as D}from"./QueueOptionsButton-ByAwxtJ-.js";import{p as y,a as I,m as N,M as _}from"./MediaCard-DJNRuWDJ.js";import{C as w}from"./playbackCompletion-IPHm9fp5.js";const k=({showId:e,anchorRect:r,onMouseEnter:d,onMouseLeave:c,onRequestClose:u})=>{const{showMeta:t,loadingMeta:i,inWatchlist:h,toggleWatchlist:m}=B(e),{titlePreference:s}=C(),n=A(()=>t?.name?s==="name"?t.name:s==="nativeName"?t.names?.native||t.name:s==="englishName"&&t.names?.english||t.name:"",[t,s]),l=[];t?.score&&l.push({icon:"star",label:String(t.score),accent:!0}),t?.status&&l.push({icon:"tv",label:t.status});const f=Array.isArray(t?.genres)&&t.genres.length>0?t.genres.filter(Boolean).slice(0,4).map(a=>typeof a=="string"?a:a?.name).filter(a=>!!a):[];return o(I,{anchorRect:r,title:n,loading:i,error:t?void 0:"Failed to load info.",meta:l,genres:f,synopsis:t?.description?P(t.description):"No synopsis available.",primaryAction:{to:`/watch/${t?.id||e}`,label:"Watch now",icon:"play"},secondaryAction:{to:`/anime/${t?.id||e}`,label:"Read more"},bookmarked:h,onToggleBookmark:m,extraActions:a=>t?o(D,{showId:e,showName:t.name||t.names?.romaji,showThumbnail:t.thumbnail,nativeName:t.names?.native,englishName:t.names?.english,showType:t.type,className:y.watchlistBtn,activeClassName:y.active,align:"left",onMenuOpenChange:a}):null,onMouseEnter:d,onMouseLeave:c,onRequestClose:u})},j=M(({anime:e,continueWatching:r=!1,onRemove:d,config:c,layout:u="vertical"})=>{const t=e.currentTime||0,i=e.duration||0,h=t>5&&i>5&&t<i*w,m=t>0&&(i<=5||t>=i*w),s=e.episodeNumber,n=r?{pathname:s?`/watch/${e._id}/${s}`:`/watch/${e._id}`,state:{name:e.name,thumbnail:e.thumbnail||"",nativeName:e.nativeName,englishName:e.englishName,type:e.type}}:s?`/watch/${e._id}/${s}`:`/anime/${e._id}`,l=(()=>{if(typeof n=="string")return n.startsWith("/watch/");const p=n.pathname;return typeof p=="string"&&p.startsWith("/watch/")})(),f=r&&s?`EP ${s}`:e.watchedCount!==void 0&&e.watchedCount>0?`EP ${e.watchedCount}`:null,a=[e.airTime,e.aired===!1&&e.nextEpisodeAirDate?`· ${e.nextEpisodeAirDate.split(",")[0]}`:""].filter(Boolean).join(" "),E=e.isAdult||e.rating==="R+"||e.rating==="Rx"||e.rating?.includes("17+"),T=o($,{children:[(e.availableEpisodesDetail?.sub||e.availableEpisodes?.sub)&&o("div",{className:N.metaItem,children:[o(b,{name:"closed-captioning",size:10}),e.availableEpisodesDetail?.sub?.length??e.availableEpisodes?.sub]}),(e.availableEpisodesDetail?.dub||e.availableEpisodes?.dub)&&o("div",{className:N.metaItem,children:[o(b,{name:"microphone",size:10}),e.availableEpisodesDetail?.dub?.length??e.availableEpisodes?.dub]})]});return o(_,{item:{id:e.id||e.showId||e._id,title:e.name,nativeName:e.nativeName,englishName:e.englishName,thumbnail:e.thumbnail,typeBadge:e.type||"TV",chapterBadge:f,airMeta:a||void 0,isAdult:E,notAired:e.aired===!1},linkTo:n,hoverIcon:l?"play":"info",progress:h?{percent:t/i*100,label:`${v(t)} / ${v(i)}`}:m?{percent:100,label:"Watched"}:void 0,showProgress:r,metaRow:T,display:c,layout:u,onRemove:d,showRemoveButton:c?.elements?.poster?.removeButton??(r&&!!d),showInfoButton:!r,enrichedId:e._id,renderPopup:(p,g)=>o(k,{showId:e._id,anchorRect:p,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onRequestClose:g.close})})});export{j as A};
1
+ import{T as A,u as o,N as M,S as $}from"./vendor-core-DfaOB3Rn.js";import{I as b}from"./vendor-icons-DrybRNxP.js";import{u as B}from"./useAnimeInfoData-YbePqj-M.js";import{d as C,s as P,g as v}from"./index-DbRDs7tF.js";import{Q as D}from"./QueueOptionsButton-C6ArqpM5.js";import{p as y,a as I,m as N,M as _}from"./MediaCard-ChUKs5Sb.js";import{C as w}from"./playbackCompletion-CnxK6_Vz.js";const k=({showId:e,anchorRect:r,onMouseEnter:d,onMouseLeave:c,onRequestClose:u})=>{const{showMeta:t,loadingMeta:i,inWatchlist:h,toggleWatchlist:m}=B(e),{titlePreference:s}=C(),n=A(()=>t?.name?s==="name"?t.name:s==="nativeName"?t.names?.native||t.name:s==="englishName"&&t.names?.english||t.name:"",[t,s]),l=[];t?.score&&l.push({icon:"star",label:String(t.score),accent:!0}),t?.status&&l.push({icon:"tv",label:t.status});const f=Array.isArray(t?.genres)&&t.genres.length>0?t.genres.filter(Boolean).slice(0,4).map(a=>typeof a=="string"?a:a?.name).filter(a=>!!a):[];return o(I,{anchorRect:r,title:n,loading:i,error:t?void 0:"Failed to load info.",meta:l,genres:f,synopsis:t?.description?P(t.description):"No synopsis available.",primaryAction:{to:`/watch/${t?.id||e}`,label:"Watch now",icon:"play"},secondaryAction:{to:`/anime/${t?.id||e}`,label:"Read more"},bookmarked:h,onToggleBookmark:m,extraActions:a=>t?o(D,{showId:e,showName:t.name||t.names?.romaji,showThumbnail:t.thumbnail,nativeName:t.names?.native,englishName:t.names?.english,showType:t.type,className:y.watchlistBtn,activeClassName:y.active,align:"left",onMenuOpenChange:a}):null,onMouseEnter:d,onMouseLeave:c,onRequestClose:u})},j=M(({anime:e,continueWatching:r=!1,onRemove:d,config:c,layout:u="vertical"})=>{const t=e.currentTime||0,i=e.duration||0,h=t>5&&i>5&&t<i*w,m=t>0&&(i<=5||t>=i*w),s=e.episodeNumber,n=r?{pathname:s?`/watch/${e._id}/${s}`:`/watch/${e._id}`,state:{name:e.name,thumbnail:e.thumbnail||"",nativeName:e.nativeName,englishName:e.englishName,type:e.type}}:s?`/watch/${e._id}/${s}`:`/anime/${e._id}`,l=(()=>{if(typeof n=="string")return n.startsWith("/watch/");const p=n.pathname;return typeof p=="string"&&p.startsWith("/watch/")})(),f=r&&s?`EP ${s}`:e.watchedCount!==void 0&&e.watchedCount>0?`EP ${e.watchedCount}`:null,a=[e.airTime,e.aired===!1&&e.nextEpisodeAirDate?`· ${e.nextEpisodeAirDate.split(",")[0]}`:""].filter(Boolean).join(" "),E=e.isAdult||e.rating==="R+"||e.rating==="Rx"||e.rating?.includes("17+"),T=o($,{children:[(e.availableEpisodesDetail?.sub||e.availableEpisodes?.sub)&&o("div",{className:N.metaItem,children:[o(b,{name:"closed-captioning",size:10}),e.availableEpisodesDetail?.sub?.length??e.availableEpisodes?.sub]}),(e.availableEpisodesDetail?.dub||e.availableEpisodes?.dub)&&o("div",{className:N.metaItem,children:[o(b,{name:"microphone",size:10}),e.availableEpisodesDetail?.dub?.length??e.availableEpisodes?.dub]})]});return o(_,{item:{id:e.id||e.showId||e._id,title:e.name,nativeName:e.nativeName,englishName:e.englishName,thumbnail:e.thumbnail,typeBadge:e.type||"TV",chapterBadge:f,airMeta:a||void 0,isAdult:E,notAired:e.aired===!1},linkTo:n,hoverIcon:l?"play":"info",progress:h?{percent:t/i*100,label:`${v(t)} / ${v(i)}`}:m?{percent:100,label:"Watched"}:void 0,showProgress:r,metaRow:T,display:c,layout:u,onRemove:d,showRemoveButton:c?.elements?.poster?.removeButton??(r&&!!d),showInfoButton:!r,enrichedId:e._id,renderPopup:(p,g)=>o(k,{showId:e._id,anchorRect:p,onMouseEnter:g.onMouseEnter,onMouseLeave:g.onMouseLeave,onRequestClose:g.close})})});export{j as A};
@@ -1 +1 @@
1
- import{o as y,a as I,d as T,h as b,T as S,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{u as B}from"./useAnimeInfoData-Ai39I_f0.js";import{d as w,e as M,f as m,s as x,M as A,B as p}from"./index-vb4WPdcb.js";import{A as D}from"./AnimeMetaDetails-B3-A7O5H.js";import{S as G}from"./SynopsisText-B3Sa5pRv.js";import{Q as P}from"./QueueOptionsButton-ByAwxtJ-.js";import"./vendor-query-BBT5_sHx.js";import"./useIsMobile-Dvx1uJ82.js";import"./vendor-ui-3qrARCPr.js";const W="_container_1obln_1",O="_heroSection_1obln_11",$="_bannerContainer_1obln_17",U="_banner_1obln_17",j="_bannerOverlay_1obln_37",q="_heroContent_1obln_49",z="_posterContainer_1obln_62",V="_floatIn_1obln_1",Q="_poster_1obln_62",E="_infoGlass_1obln_86",H="_slideUpIn_1obln_1",F="_title_1obln_100",J="_quickMeta_1obln_109",K="_metaItem_1obln_117",L="_iconStar_1obln_126",R="_iconTv_1obln_129",X="_iconType_1obln_132",Y="_iconClock_1obln_135",Z="_genres_1obln_139",ee="_genre_1obln_139",ne="_infoColumns_1obln_165",te="_synopsisSection_1obln_180",oe="_sectionTitleSmall_1obln_188",se="_actions_1obln_210",ae="_watchBtn_1obln_216",ie="_watchlistBtn_1obln_238",le="_active_1obln_258",ce="_detailsToggleBtn_1obln_265",re="_expandedContent_1obln_288",me="_fadeIn_1obln_1",_e="_detailsGridContainer_1obln_293",de="_detailItem_1obln_301",he="_airingValue_1obln_320",be="_loadingDetails_1obln_325",pe="_spinner_1obln_334",ue="_spin_1obln_334",ve="_heroSkeleton_1obln_349",ge="_skeletonBanner_1obln_353",ke="_skeletonPoster_1obln_354",fe="_skeletonTitle_1obln_355",Ne="_skeletonMeta_1obln_356",Ce="_skeletonDesc_1obln_357",ye="_skeletonActions_1obln_358",Ie="_skeletonContent_1obln_391",Te="_skeletonInfo_1obln_405",t={container:W,heroSection:O,bannerContainer:$,banner:U,bannerOverlay:j,heroContent:q,posterContainer:z,floatIn:V,poster:Q,infoGlass:E,slideUpIn:H,title:F,quickMeta:J,metaItem:K,iconStar:L,iconTv:R,iconType:X,iconClock:Y,genres:Z,genre:ee,infoColumns:ne,synopsisSection:te,sectionTitleSmall:oe,actions:se,watchBtn:ae,watchlistBtn:ie,active:le,detailsToggleBtn:ce,expandedContent:re,fadeIn:me,detailsGridContainer:_e,detailItem:de,airingValue:he,loadingDetails:be,spinner:pe,spin:ue,heroSkeleton:ve,skeletonBanner:ge,skeletonPoster:ke,skeletonTitle:fe,skeletonMeta:Ne,skeletonDesc:Ce,skeletonActions:ye,"skeleton-wave":"_skeleton-wave_1obln_1",skeletonContent:Ie,skeletonInfo:Te};function Oe(){const{id:s}=y(),a=I(),{titlePreference:l}=w(),[i,u]=T(!1),{showMeta:n,loadingMeta:v,toggleWatchlist:g,inWatchlist:c}=B(s),{hasConsent:k,grant:f}=M();b(()=>{s&&n?.id&&n.id!==s&&a(`/anime/${n.id}`,{replace:!0})},[s,n,a]),b(()=>{document.title=n?.name?`${n.name} - dango`:"Anime - dango"},[n?.name]);const N=()=>n?.name?l==="name"?n.name:l==="nativeName"?n.names?.native||n.name:l==="englishName"&&n.names?.english||n.name:"",C=()=>{s&&a(`/watch/${s}`)},_=S(()=>n?.bannerImage?m(n.bannerImage):n?.thumbnail?m(n.thumbnail,1200,450):"",[n?.bannerImage,n?.thumbnail]);if(v||!n?.name)return e("div",{className:t.container,children:e("div",{className:t.heroSkeleton,children:[e("div",{className:t.skeletonBanner}),e("div",{className:t.skeletonContent,children:[e("div",{className:t.skeletonPoster}),e("div",{className:t.skeletonInfo,children:[e("div",{className:t.skeletonTitle}),e("div",{className:t.skeletonMeta}),e("div",{className:t.skeletonDesc}),e("div",{className:t.skeletonActions})]})]})]})});const d=n.isAdult===!0&&!k;return e("div",{className:t.container,style:d?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:t.heroSection,children:[e("div",{className:t.bannerContainer,children:[e("div",{className:t.banner,style:_?{backgroundImage:`url(${_})`}:void 0}),e("div",{className:t.bannerOverlay})]}),e("div",{className:t.heroContent,children:[e("div",{className:t.posterContainer,children:e("img",{src:m(n.thumbnail||"",320,480),alt:n.name,className:t.poster,decoding:"async"})}),e("div",{className:t.infoGlass,children:[e("div",{children:[e("h1",{className:t.title,children:N()}),e("div",{className:t.quickMeta,children:[n.score&&e("div",{className:t.metaItem,children:[e(o,{name:"star",className:t.iconStar}),e("span",{children:n.score})]}),n.status&&e("div",{className:t.metaItem,children:[e(o,{name:"tv",className:t.iconTv}),e("span",{children:n.status})]}),n.type&&e("div",{className:t.metaItem,children:[e(o,{name:"layer-group",className:t.iconType}),e("span",{children:n.type})]})]}),Array.isArray(n.genres)&&n.genres.length>0&&e("div",{className:t.genres,children:n.genres.filter(Boolean).slice(0,5).map(r=>{const h=typeof r=="string"?r:r?.name;return e("span",{className:t.genre,children:h},h)})})]}),e("div",{className:t.infoColumns,children:[e("div",{className:t.synopsisSection,children:[e("h2",{className:t.sectionTitleSmall,children:"Synopsis"}),e(G,{text:x(n.description),emptyText:"No description available."}),e("button",{className:t.detailsToggleBtn,onClick:()=>{u(!i)},children:[i?e(o,{name:"chevron-up"}):e(o,{name:"chevron-down"}),i?"Hide Details":"Show Details"]})]}),i&&e("div",{className:t.expandedContent,children:e(D,{showMeta:n,styles:t})})]}),e("div",{className:t.actions,children:[e("button",{className:t.watchBtn,onClick:C,children:[e(o,{name:"play",size:14}),"Start Watching"]}),e("button",{className:`${t.watchlistBtn} ${c?t.active:""}`,onClick:g,children:[c?e(o,{name:"check",size:14}):e(o,{name:"plus",size:14}),c?"In Watchlist":"Add to Watchlist"]}),e(P,{showId:s,showName:n.name||n.names?.romaji,showThumbnail:n.thumbnail,nativeName:n.names?.native,englishName:n.names?.english,showType:n.type,className:t.watchlistBtn,activeClassName:t.active})]})]})]})]}),d&&e(A,{isOpen:!0,title:"Content Warning",onClose:()=>a("/"),children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e("p",{children:"This title contains mature content intended for adult audiences."}),e("p",{children:["By proceeding, you confirm that you are ",e("strong",{children:"18 years of age or older"})," (or the age of majority in your jurisdiction) and wish to view this content."]}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(p,{variant:"secondary",onClick:()=>a("/"),children:"Go Back"}),e(p,{onClick:f,children:"I'm 18+, Continue"})]})]})})]})}export{Oe as default};
1
+ import{o as y,a as I,d as T,h as b,T as S,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{u as B}from"./useAnimeInfoData-YbePqj-M.js";import{d as w,e as M,f as m,s as x,L as A,B as p}from"./index-DbRDs7tF.js";import{A as D}from"./AnimeMetaDetails-B3-A7O5H.js";import{S as G}from"./SynopsisText-B3Sa5pRv.js";import{Q as P}from"./QueueOptionsButton-C6ArqpM5.js";import"./vendor-query-BBT5_sHx.js";import"./useIsMobile-Dvx1uJ82.js";import"./vendor-ui-3qrARCPr.js";const W="_container_1obln_1",O="_heroSection_1obln_11",$="_bannerContainer_1obln_17",U="_banner_1obln_17",j="_bannerOverlay_1obln_37",q="_heroContent_1obln_49",z="_posterContainer_1obln_62",V="_floatIn_1obln_1",Q="_poster_1obln_62",E="_infoGlass_1obln_86",H="_slideUpIn_1obln_1",L="_title_1obln_100",F="_quickMeta_1obln_109",J="_metaItem_1obln_117",K="_iconStar_1obln_126",R="_iconTv_1obln_129",X="_iconType_1obln_132",Y="_iconClock_1obln_135",Z="_genres_1obln_139",ee="_genre_1obln_139",ne="_infoColumns_1obln_165",te="_synopsisSection_1obln_180",oe="_sectionTitleSmall_1obln_188",se="_actions_1obln_210",ae="_watchBtn_1obln_216",ie="_watchlistBtn_1obln_238",le="_active_1obln_258",ce="_detailsToggleBtn_1obln_265",re="_expandedContent_1obln_288",me="_fadeIn_1obln_1",_e="_detailsGridContainer_1obln_293",de="_detailItem_1obln_301",he="_airingValue_1obln_320",be="_loadingDetails_1obln_325",pe="_spinner_1obln_334",ue="_spin_1obln_334",ve="_heroSkeleton_1obln_349",ge="_skeletonBanner_1obln_353",ke="_skeletonPoster_1obln_354",fe="_skeletonTitle_1obln_355",Ne="_skeletonMeta_1obln_356",Ce="_skeletonDesc_1obln_357",ye="_skeletonActions_1obln_358",Ie="_skeletonContent_1obln_391",Te="_skeletonInfo_1obln_405",t={container:W,heroSection:O,bannerContainer:$,banner:U,bannerOverlay:j,heroContent:q,posterContainer:z,floatIn:V,poster:Q,infoGlass:E,slideUpIn:H,title:L,quickMeta:F,metaItem:J,iconStar:K,iconTv:R,iconType:X,iconClock:Y,genres:Z,genre:ee,infoColumns:ne,synopsisSection:te,sectionTitleSmall:oe,actions:se,watchBtn:ae,watchlistBtn:ie,active:le,detailsToggleBtn:ce,expandedContent:re,fadeIn:me,detailsGridContainer:_e,detailItem:de,airingValue:he,loadingDetails:be,spinner:pe,spin:ue,heroSkeleton:ve,skeletonBanner:ge,skeletonPoster:ke,skeletonTitle:fe,skeletonMeta:Ne,skeletonDesc:Ce,skeletonActions:ye,"skeleton-wave":"_skeleton-wave_1obln_1",skeletonContent:Ie,skeletonInfo:Te};function Oe(){const{id:s}=y(),a=I(),{titlePreference:l}=w(),[i,u]=T(!1),{showMeta:n,loadingMeta:v,toggleWatchlist:g,inWatchlist:c}=B(s),{hasConsent:k,grant:f}=M();b(()=>{s&&n?.id&&n.id!==s&&a(`/anime/${n.id}`,{replace:!0})},[s,n,a]),b(()=>{document.title=n?.name?`${n.name} - dango`:"Anime - dango"},[n?.name]);const N=()=>n?.name?l==="name"?n.name:l==="nativeName"?n.names?.native||n.name:l==="englishName"&&n.names?.english||n.name:"",C=()=>{s&&a(`/watch/${s}`)},_=S(()=>n?.bannerImage?m(n.bannerImage):n?.thumbnail?m(n.thumbnail,1200,450):"",[n?.bannerImage,n?.thumbnail]);if(v||!n?.name)return e("div",{className:t.container,children:e("div",{className:t.heroSkeleton,children:[e("div",{className:t.skeletonBanner}),e("div",{className:t.skeletonContent,children:[e("div",{className:t.skeletonPoster}),e("div",{className:t.skeletonInfo,children:[e("div",{className:t.skeletonTitle}),e("div",{className:t.skeletonMeta}),e("div",{className:t.skeletonDesc}),e("div",{className:t.skeletonActions})]})]})]})});const d=n.isAdult===!0&&!k;return e("div",{className:t.container,style:d?{filter:"blur(14px)",pointerEvents:"none",userSelect:"none"}:void 0,children:[e("div",{className:t.heroSection,children:[e("div",{className:t.bannerContainer,children:[e("div",{className:t.banner,style:_?{backgroundImage:`url(${_})`}:void 0}),e("div",{className:t.bannerOverlay})]}),e("div",{className:t.heroContent,children:[e("div",{className:t.posterContainer,children:e("img",{src:m(n.thumbnail||"",320,480),alt:n.name,className:t.poster,decoding:"async"})}),e("div",{className:t.infoGlass,children:[e("div",{children:[e("h1",{className:t.title,children:N()}),e("div",{className:t.quickMeta,children:[n.score&&e("div",{className:t.metaItem,children:[e(o,{name:"star",className:t.iconStar}),e("span",{children:n.score})]}),n.status&&e("div",{className:t.metaItem,children:[e(o,{name:"tv",className:t.iconTv}),e("span",{children:n.status})]}),n.type&&e("div",{className:t.metaItem,children:[e(o,{name:"layer-group",className:t.iconType}),e("span",{children:n.type})]})]}),Array.isArray(n.genres)&&n.genres.length>0&&e("div",{className:t.genres,children:n.genres.filter(Boolean).slice(0,5).map(r=>{const h=typeof r=="string"?r:r?.name;return e("span",{className:t.genre,children:h},h)})})]}),e("div",{className:t.infoColumns,children:[e("div",{className:t.synopsisSection,children:[e("h2",{className:t.sectionTitleSmall,children:"Synopsis"}),e(G,{text:x(n.description),emptyText:"No description available."}),e("button",{className:t.detailsToggleBtn,onClick:()=>{u(!i)},children:[i?e(o,{name:"chevron-up"}):e(o,{name:"chevron-down"}),i?"Hide Details":"Show Details"]})]}),i&&e("div",{className:t.expandedContent,children:e(D,{showMeta:n,styles:t})})]}),e("div",{className:t.actions,children:[e("button",{className:t.watchBtn,onClick:C,children:[e(o,{name:"play",size:14}),"Start Watching"]}),e("button",{className:`${t.watchlistBtn} ${c?t.active:""}`,onClick:g,children:[c?e(o,{name:"check",size:14}):e(o,{name:"plus",size:14}),c?"In Watchlist":"Add to Watchlist"]}),e(P,{showId:s,showName:n.name||n.names?.romaji,showThumbnail:n.thumbnail,nativeName:n.names?.native,englishName:n.names?.english,showType:n.type,className:t.watchlistBtn,activeClassName:t.active})]})]})]})]}),d&&e(A,{isOpen:!0,title:"Content Warning",onClose:()=>a("/"),children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e("p",{children:"This title contains mature content intended for adult audiences."}),e("p",{children:["By proceeding, you confirm that you are ",e("strong",{children:"18 years of age or older"})," (or the age of majority in your jurisdiction) and wish to view this content."]}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(p,{variant:"secondary",onClick:()=>a("/"),children:"Go Back"}),e(p,{onClick:f,children:"I'm 18+, Continue"})]})]})})]})}export{Oe as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-CFGRb1OW.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-icons-DrybRNxP.js","assets/useAnimeInfoData-Ai39I_f0.js","assets/vendor-query-BBT5_sHx.js","assets/index-vb4WPdcb.js","assets/index-5x1mF1nD.css","assets/QueueOptionsButton-ByAwxtJ-.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/AnimeMetaDetails-B3-A7O5H.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/useIsMobile-Dvx1uJ82.js","assets/SynopsisText-CYv2W3yR.css","assets/AnimeInfo-BivVqWcB.css"])))=>i.map(i=>d[i]);
2
- import{a0 as r,_ as t}from"./index-vb4WPdcb.js";import{u as o,P as e,z as i}from"./vendor-core-DfaOB3Rn.js";import"./vendor-query-BBT5_sHx.js";import"./vendor-icons-DrybRNxP.js";const a=i(()=>t(()=>import("./AnimeInfo-CFGRb1OW.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])));function p(){return o(e,{fallback:o(r,{}),children:o(a,{})})}export{p as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-Ck-fMvdY.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-icons-DrybRNxP.js","assets/useAnimeInfoData-YbePqj-M.js","assets/vendor-query-BBT5_sHx.js","assets/index-DbRDs7tF.js","assets/index-DP9TtvZX.css","assets/QueueOptionsButton-C6ArqpM5.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/AnimeMetaDetails-B3-A7O5H.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/useIsMobile-Dvx1uJ82.js","assets/SynopsisText-CYv2W3yR.css","assets/AnimeInfo-BivVqWcB.css"])))=>i.map(i=>d[i]);
2
+ import{af as r,_ as t}from"./index-DbRDs7tF.js";import{u as o,P as e,z as i}from"./vendor-core-DfaOB3Rn.js";import"./vendor-query-BBT5_sHx.js";import"./vendor-icons-DrybRNxP.js";const a=i(()=>t(()=>import("./AnimeInfo-Ck-fMvdY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])));function p(){return o(e,{fallback:o(r,{}),children:o(a,{})})}export{p as default};
@@ -0,0 +1,2 @@
1
+ import{T as Ee,u as e,d as b,A as H,a as Ve,g as Re,q as Y,h as T,S as E,$ as je,o as rt,p as st}from"./vendor-core-DfaOB3Rn.js";import{g as Le,t as Me,a6 as ot,B as Oe,L as Je,a1 as M,p as ue,F as ae,e as lt,a7 as it,q as He}from"./index-DbRDs7tF.js";import{I as w}from"./vendor-icons-DrybRNxP.js";import{u as ct}from"./vendor-query-BBT5_sHx.js";import{T as De}from"./ToggleSwitch-CN_ppEc9.js";import{M as dt}from"./MatureConsentModal-DiWSp3Of.js";import{M as ut,P as mt}from"./MediaCard-ChUKs5Sb.js";import{c as Ke,a as ze,d as ht,e as Ge,f as Ye,g as pt,h as gt,i as ft,j as yt,k as Fe,l as Be}from"./useAsmr-DO5DUI_t.js";import{u as _t,A as bt}from"./useAsmrPopup-S_XfgKDh.js";import{u as kt,d as vt,e as wt,f as Ct,g as Nt,h as Tt,S as We,a as St,i as qe,j as At,k as Bt,V as Rt,l as Lt}from"./PlayerProvider--aaVRFly.js";import{p as ne}from"./page.module-C1MlZzf3.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./libraryInvalidation-cJ1WjrJq.js";import"./usePopup-DS9jMzp6.js";const Mt="_sortSelect_1f2gy_1",Pt="_grid_1f2gy_11",It="_fetching_1f2gy_25",xt="_thumbPlaceholder_1f2gy_64",$t="_asmrCardWrap_1f2gy_100",Et="_bookmarkBtn_1f2gy_105",jt="_bookmarked_1f2gy_129",Ot="_statusMsg_1f2gy_152",Ht="_skeletonCard_1f2gy_160",Dt="_skeletonThumb_1f2gy_165",Ft="_skeletonLine_1f2gy_171",Wt="_shimmer_1f2gy_178",qt="_matureToggleWrap_1f2gy_219",Ut="_matureLabel_1f2gy_226",Vt="_translateToggleWrap_1f2gy_232",Jt="_filterTogglesGroup_1f2gy_239",Kt="_filterBar_1f2gy_251",zt="_filterLabel_1f2gy_258",Gt="_detailOverlay_1f2gy_263",Yt="_detailModal_1f2gy_275",Qt="_detailClose_1f2gy_287",Zt="_detailHeader_1f2gy_303",Xt="_detailCover_1f2gy_309",ea="_detailInfo_1f2gy_318",ta="_detailTitle_1f2gy_322",aa="_detailRj_1f2gy_329",na="_metaRow_1f2gy_335",ra="_metaLabel_1f2gy_341",sa="_tagChips_1f2gy_347",oa="_tagChip_1f2gy_347",la="_npOverlay_1f2gy_363",ia="_playerBarDocked_1f2gy_378",ca="_playerBarDockedHidden_1f2gy_392",da="_npOverlayControlsHidden_1f2gy_403",ua="_npArrow_1f2gy_403",ma="_npImageCount_1f2gy_404",ha="_npStage_1f2gy_413",pa="_sliderViewport_1f2gy_429",ga="_slide_1f2gy_429",fa="_slideImg_1f2gy_431",ya="_npStageBlank_1f2gy_450",_a="_sliderTrack_1f2gy_469",ba="_slideImgLoaded_1f2gy_502",ka="_slideSpinner_1f2gy_507",va="_npArrowLeft_1f2gy_557",wa="_npArrowRight_1f2gy_561",Ca="_chapterPanel_1f2gy_578",Na="_chapterRow_1f2gy_593",Ta="_chapterRowActive_1f2gy_612",Sa="_chapterRowTime_1f2gy_616",Aa="_chapterRowLabel_1f2gy_627",Ba="_npBackdrop_1f2gy_633",Ra="_playerBtn_1f2gy_639",La="_playerBtnActive_1f2gy_639",Ma="_tracksSection_1f2gy_645",Pa="_tracksHeading_1f2gy_649",Ia="_trackList_1f2gy_655",xa="_trackRow_1f2gy_664",$a="_trackIcon_1f2gy_682",Ea="_trackLabel_1f2gy_687",ja="_trackType_1f2gy_692",Oa="_noTracks_1f2gy_697",Ha="_playAllBtn_1f2gy_702",Da="_detailActions_1f2gy_715",Fa="_playerBar_1f2gy_378",Wa="_playerActions_1f2gy_738",qa="_playerInfo_1f2gy_744",Ua="_playerTitle_1f2gy_749",Va="_playerTrack_1f2gy_758",Ja="_playerControls_1f2gy_764",Ka="_seekRow_1f2gy_771",za="_playerButtons_1f2gy_779",Ga="_seekBtn_1f2gy_814",Ya="_playBtn_1f2gy_824",Qa="_seekBar_1f2gy_871",Za="_volumeBar_1f2gy_872",Xa="_timeLabel_1f2gy_964",en="_playerRight_1f2gy_970",tn="_volumeIcon_1f2gy_976",an="_playerToggle_1f2gy_1020",t={sortSelect:Mt,grid:Pt,fetching:It,thumbPlaceholder:xt,asmrCardWrap:$t,bookmarkBtn:Et,bookmarked:jt,statusMsg:Ot,skeletonCard:Ht,skeletonThumb:Dt,skeletonLine:Ft,shimmer:Wt,matureToggleWrap:qt,matureLabel:Ut,translateToggleWrap:Vt,filterTogglesGroup:Jt,filterBar:Kt,filterLabel:zt,detailOverlay:Gt,detailModal:Yt,detailClose:Qt,detailHeader:Zt,detailCover:Xt,detailInfo:ea,detailTitle:ta,detailRj:aa,metaRow:na,metaLabel:ra,tagChips:sa,tagChip:oa,npOverlay:la,playerBarDocked:ia,playerBarDockedHidden:ca,npOverlayControlsHidden:da,npArrow:ua,npImageCount:ma,npStage:ha,sliderViewport:pa,slide:ga,slideImg:fa,npStageBlank:ya,sliderTrack:_a,slideImgLoaded:ba,slideSpinner:ka,npArrowLeft:va,npArrowRight:wa,chapterPanel:Ca,chapterRow:Na,chapterRowActive:Ta,chapterRowTime:Sa,chapterRowLabel:Aa,npBackdrop:Ba,playerBtn:Ra,playerBtnActive:La,tracksSection:Ma,tracksHeading:Pa,trackList:Ia,trackRow:xa,trackIcon:$a,trackLabel:Ea,trackType:ja,noTracks:Oa,playAllBtn:Ha,detailActions:Da,playerBar:Fa,playerActions:Wa,playerInfo:qa,playerTitle:Ua,playerTrack:Va,playerControls:Ja,seekRow:Ka,playerButtons:za,seekBtn:Ga,playBtn:Ya,seekBar:Qa,volumeBar:Za,timeLabel:Xa,playerRight:en,volumeIcon:tn,playerToggle:an},nn=({work:r,onClose:o,onPlay:k,t:g})=>{const{data:i,isLoading:u}=Ke(r.id||null),y=ze(r),{data:S}=ht(y||void 0),{toggle:_,bookmarkedIds:C}=Ge(),{data:P}=Ye(y||void 0),R=y?C.has(y):!!S?.inLibrary,f=Ee(()=>(i?.description||r.description||"").split(`
2
+ `).map(c=>{const l=c.indexOf(":");return l===-1?null:{label:c.slice(0,l),value:c.slice(l+1).trim()}}).filter(c=>!!c&&!!c.value),[i?.description,r.description]),m=i?.tracks||[],L=r.thumbnail||i?.images?.[0],A=Ee(()=>{const c=P?.progress??[];return c.length>0?c.reduce((l,B)=>l.updatedAt>=B.updatedAt?l:B):null},[P]),h=A&&A.trackIndex<m.length?A.trackIndex:null;return e("div",{className:t.detailOverlay,onClick:o,children:e("div",{className:t.detailModal,onClick:c=>c.stopPropagation(),children:[e("button",{className:t.detailClose,onClick:o,"aria-label":"Close",children:e(w,{name:"times"})}),e("div",{className:t.detailHeader,children:[L?e("img",{className:t.detailCover,src:L,alt:r.name,decoding:"async"}):e("div",{className:`${t.detailCover} ${t.thumbPlaceholder}`}),e("div",{className:t.detailInfo,children:[e("h2",{className:t.detailTitle,children:g?g(r.name):r.name}),e("p",{className:t.detailRj,children:r.id}),f.map(c=>c.label==="Tags"?e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:"Tags"}),e("span",{className:t.tagChips,children:c.value.split(", ").map(l=>e("span",{className:t.tagChip,children:l},l))})]},c.label):e("p",{className:t.metaRow,children:[e("span",{className:t.metaLabel,children:c.label}),c.value]},c.label))]})]}),e("div",{className:t.tracksSection,children:[e("h3",{className:t.tracksHeading,children:u?"Loading tracks…":`Tracks (${m.length})`}),!u&&(m.length>0?e("ul",{className:t.trackList,children:m.map((c,l)=>e("li",{children:e("button",{className:t.trackRow,onClick:()=>k(r,m,l),children:[e(w,{name:"play",className:t.trackIcon}),e("span",{className:t.trackLabel,children:c.resolutionStr}),e("span",{className:t.trackType,children:c.hls?"HLS":"MP3"})]})},c.link))}):e("p",{className:t.noTracks,children:"No audio streams available for this work."}))]}),e("div",{className:t.detailActions,children:[!u&&m.length>0&&e("button",{className:t.playAllBtn,onClick:()=>k(r,m,0),children:[e(w,{name:"play"})," Play from start"]}),!u&&h!==null&&A&&e("button",{className:t.playAllBtn,onClick:()=>k(r,m,h),children:[e(w,{name:"history"})," Resume track ",h+1," ·"," ",Le(A.currentTime),A.duration>0?` / ${Le(A.duration)}`:""]}),y&&e("button",{className:t.playAllBtn,onClick:()=>_({rjCode:y,title:r.name,thumbnail:r.thumbnail||"",isAdult:!!r.isAdult}),"aria-pressed":R,children:[e(w,{name:R?"check":"plus"})," ",R?"In listening list":"Add to listening list"]})]})]})})},rn=r=>{const{engine:o}=kt({volumeKey:"asmrVolume",mutedKey:"asmrMuted"});return e(vt,{engine:o,children:e(sn,{...r})})},sn=({title:r,images:o,chapters:k,tracks:g,trackIndex:i,expanded:u,isAdult:y,rjCode:S,t:_,onTrackChange:C,onExpandedChange:P,onClose:R})=>{const f=wt(),m=f.mediaRef,{duration:L,volume:A,isPlaying:h}=Ct(f),{currentTime:c}=Nt(f),[l,B]=b(!0),[p,x]=b(0),[j,Q]=b(new Set),[N,K]=b(!1),[$,D]=b(!0),U=H("");U.current||(U.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`asmr-${Date.now()}-${Math.random().toString(36).slice(2)}`);const me=Ve(),F=Re.useMemo(()=>S?pt(S):"",[S]),W=gt(),be=ft(),{data:Z}=Ye(F||void 0),[ke,re]=b(!1),he=H(""),q=H(null),pe=H(0),V=H(0),se=H(0),oe=g[i],ge=oe?.link,J=oe?.hls,fe=oe?.resolutionStr||"",le=o.length>0,X=`${F}:${i}`,ie=Re.useMemo(()=>(Z?.progress??[]).find(s=>s.trackIndex===i)??null,[Z,i]),ve=H({workId:"",trackIndex:0,trackLabel:""}),z=H(Z);z.current=Z,ve.current={workId:F,trackIndex:i,trackLabel:fe};const ce=Y((a,s,v,O=!1)=>{!a.workId||!v||v<10||!O&&Math.abs(s-pe.current)<5||(pe.current=s,W.mutate({workId:a.workId,trackIndex:a.trackIndex,trackLabel:a.trackLabel,currentTime:Math.floor(s),duration:Math.floor(v),title:r,thumbnail:o[0]||"",rjCode:a.workId,isAdult:y?1:0}))},[W,r,o,y]),ye=Y((a=!1)=>{q.current&&(clearTimeout(q.current),q.current=null),ce(ve.current,V.current,se.current,a)},[ce]),ee=H(ye);ee.current=ye;const we=H(ce);we.current=ce,T(()=>{if(!m.current||!ge)return;const s={workId:F,trackIndex:i,trackLabel:fe},v=()=>{q.current&&(clearTimeout(q.current),q.current=null),we.current(s,f.getTimeline().currentTime,f.getState().duration||se.current,!0)};V.current=0,se.current=0,pe.current=0;const O=z.current?.progress?.find(nt=>nt.trackIndex===i),Te=O?.currentTime||0,Se=O?.duration||0,Ae=Te>=10&&Se-Te>=15,at=f.loadSource({url:ge,hls:J},{autoPlay:!Ae});return()=>{v(),at()}},[f,ge,J,F,i,fe,m]),T(()=>{const a=()=>{document.visibilityState==="hidden"&&ee.current()},s=()=>ee.current();return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",s),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",s)}},[]),T(()=>{if(!ie||he.current===X||!(L>0))return;const a=ie.currentTime||0,s=ie.duration||L;he.current=X,!(!(a>=10&&s-a>=15&&V.current<a)||!m.current)&&(f.seek(a),V.current=a,f.play())},[f,m,ie,L,X]),T(()=>{if(u)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[u]),T(()=>{x(0)},[o]),T(()=>{u&&D(!0)},[u]),T(()=>{N&&D(!0)},[N]);const de=Y(a=>{if(!r||g.length===0)return;const s=g[i],v=s?`${s.resolutionStr} (${i+1}/${g.length})`:"",O=m.current,Te=O?O.currentTime:0,Se=O&&O.duration||0,Ae=o[0]||"";Me.discord.asmrPresence.mutate({title:r,trackLabel:v,isPlaying:a,thumbnail:Ae,thumbnails:o,currentTime:Te,duration:Se,isAdult:!!y,rjCode:S||"",sessionId:U.current}).catch(()=>{}),Me.discord.heartbeat.mutate({sessionId:U.current}).catch(()=>{})},[m,r,g,i,o,y,S]);T(()=>{de(h)},[de,h,i,r,u]),T(()=>{if(!h)return;const a=window.setInterval(()=>de(!0),15e3);return()=>window.clearInterval(a)},[h,de]),T(()=>{const a=U.current,s=()=>ot(a),v=()=>s(),O=()=>{document.visibilityState==="hidden"&&s()};return window.addEventListener("pagehide",v),window.addEventListener("beforeunload",v),document.addEventListener("visibilitychange",O),()=>{window.removeEventListener("pagehide",v),window.removeEventListener("beforeunload",v),document.removeEventListener("visibilitychange",O),s()}},[]);const n=Y(a=>{Q(s=>{if(s.has(a))return s;const v=new Set(s);return v.add(a),v})},[]),d=Y((a,s)=>{a&&a.complete&&a.naturalWidth>0&&n(s)},[n]);T(()=>{if(!u)return;const a=s=>{if(!(s.defaultPrevented||s.ctrlKey||s.metaKey||s.altKey||s.target instanceof Element&&s.target.closest('input, textarea, select, button, [role="slider"], [contenteditable="true"]'))){if(s.key==="Escape"){N?K(!1):P(!1);return}!l||o.length<2||(s.key==="ArrowLeft"&&x(v=>Math.max(0,v-1)),s.key==="ArrowRight"&&x(v=>Math.min(o.length-1,v+1)))}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[u,l,o.length,N,P]);const I=()=>{ye(!0),i<g.length-1?C(i+1):re(!0)},Ce=a=>{const s=a.currentTarget.currentTime;V.current=s,q.current&&clearTimeout(q.current),q.current=setTimeout(()=>ee.current(),5e3)},te=()=>{ee.current()},Ne=a=>{const s=a.currentTarget.duration;se.current=Number.isFinite(s)?s:0},G=Y(()=>{F&&be.mutate({rjCode:F,title:r,thumbnail:o[0]||"",status:"Completed",isAdult:!!y,silent:!0}),re(!1),R(),me("/")},[F,be,r,o,y,R,me]),Ze=k.reduce((a,s,v)=>c>=s.time?v:a,-1),Xe=a=>f.seek(a);Tt(f,()=>D(!0),!u||!l&&!N);const et=e(E,{children:[e("div",{className:t.playerButtons,children:[e("button",{className:t.playerBtn,onClick:()=>C(Math.max(0,i-1)),disabled:i===0,"aria-label":"Previous track",children:e(w,{name:"step-backward"})}),e(We,{seconds:-10,className:`${t.playerBtn} ${t.seekBtn}`}),e(St,{className:`${t.playerBtn} ${t.playBtn}`}),e(We,{seconds:10,className:`${t.playerBtn} ${t.seekBtn}`}),e("button",{className:t.playerBtn,onClick:()=>C(Math.min(g.length-1,i+1)),disabled:i>=g.length-1,"aria-label":"Next track",children:e(w,{name:"step-forward"})})]}),e("div",{className:t.seekRow,children:[e(qe,{className:t.timeLabel}),e(At,{className:t.seekBar}),e(qe,{className:t.timeLabel,durationOnly:!0})]})]}),Pe=e(E,{children:[e("button",{className:`${t.playerBtn} ${t.playerToggle}`,onClick:()=>P(!u),"aria-label":u?"Minimize player":"Expand player",title:u?"Minimize to browse":"Expand",children:u?e(w,{name:"chevron-down"}):e(w,{name:"chevron-up"})}),e("div",{className:t.playerInfo,children:[e(Bt,{}),e("p",{className:t.playerTitle,title:r,children:_?_(r):r}),e("p",{className:t.playerTrack,children:[oe?.resolutionStr||"",g.length>1?` (${i+1}/${g.length})`:""]})]}),e("div",{className:t.playerControls,children:et}),e("div",{className:t.playerRight,children:[A===0?e(w,{name:"volume-mute",className:t.volumeIcon}):A<.5?e(w,{name:"volume-down",className:t.volumeIcon}):e(w,{name:"volume-up",className:t.volumeIcon}),e(Rt,{className:t.volumeBar})]}),e("div",{className:t.playerActions,children:[u&&le&&e("button",{className:t.playerBtn,onClick:()=>B(a=>!a),"aria-label":l?"Hide images":"Show images",title:l?"Hide images":"Show images",children:l?e(w,{name:"eye-slash"}):e(w,{name:"image"})}),u&&k.length>0&&e("button",{className:`${t.playerBtn} ${N?t.playerBtnActive:""}`,onClick:()=>K(a=>!a),"aria-label":N?"Hide bookmarks":"Show bookmarks",title:"Timestamps",children:e(w,{name:"list-ol"})}),e("button",{className:t.playerBtn,onClick:R,"aria-label":"Close player",children:e(w,{name:"times"})})]})]}),Ie=e(Lt,{preload:"metadata",onPause:te,onTimeUpdate:Ce,onLoadedMetadata:Ne,onEnded:I}),xe=e(Je,{isOpen:ke,onClose:()=>re(!1),title:"Finished!",children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e(w,{name:"check-circle",size:48,style:{color:"var(--accent-lighter)",marginBottom:"0.5rem"}}),e("p",{style:{fontSize:"1.1rem",fontWeight:600},children:_?_(r):r}),e("p",{style:{color:"var(--text-secondary)"},children:"You finished this work!"}),e("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[e(Oe,{variant:"secondary",onClick:()=>re(!1),children:"Close"}),e(Oe,{onClick:G,children:"Mark Completed & Back to Home"})]})]})});if(!u)return je(e(E,{children:[Ie,e("div",{ref:f.containerRef,"data-player-root":"true",className:t.playerBar,children:Pe}),xe]}),document.body);const _e=Math.min(p,Math.max(0,o.length-1)),$e=o[_e],tt=l&&le&&!!$e&&!j.has($e);return je(e(E,{children:[Ie,xe,e("div",{ref:f.containerRef,"data-player-root":"true",className:`${t.npOverlay} ${$?"":t.npOverlayControlsHidden}`,children:[e("div",{className:`${t.npStage} ${!l||!le?t.npStageBlank:""}`,onClick:()=>D(a=>!a),children:l&&le&&e(E,{children:[e("div",{className:t.sliderViewport,children:[e("div",{className:t.sliderTrack,style:{transform:`translateX(-${_e*100}%)`},children:o.map(a=>e("div",{className:t.slide,children:e("img",{ref:s=>d(s,a),src:a,alt:`${_?_(r):r} - work image`,loading:"lazy",decoding:"async",draggable:!1,onLoad:()=>n(a),onError:()=>n(a),className:`${t.slideImg} ${j.has(a)?t.slideImgLoaded:""}`})},a))}),tt&&e("span",{className:t.slideSpinner,"aria-label":"Loading image"})]}),o.length>1&&e(E,{children:[e("button",{className:`${t.npArrow} ${t.npArrowLeft}`,onClick:a=>{a.stopPropagation(),x(s=>Math.max(0,s-1)),D(!0)},disabled:_e===0,"aria-label":"Previous image",children:e(w,{name:"chevron-left"})}),e("button",{className:`${t.npArrow} ${t.npArrowRight}`,onClick:a=>{a.stopPropagation(),x(s=>Math.min(o.length-1,s+1)),D(!0)},disabled:_e===o.length-1,"aria-label":"Next image",children:e(w,{name:"chevron-right"})}),e("span",{className:t.npImageCount,onClick:a=>a.stopPropagation(),children:[_e+1," / ",o.length]})]})]})}),e("div",{className:`${t.playerBar} ${t.playerBarDocked} ${$?"":t.playerBarDockedHidden}`,onClick:a=>a.stopPropagation(),children:[Pe,N&&e(E,{children:[e("div",{className:t.npBackdrop,onClick:()=>K(!1)}),e("div",{className:t.chapterPanel,children:k.map((a,s)=>e("button",{className:`${t.chapterRow} ${s===Ze?t.chapterRowActive:""}`,title:_?_(a.label):a.label,onClick:()=>{Xe(a.time),K(!1)},children:[e("span",{className:t.chapterRowTime,children:Le(a.time)}),e("span",{className:t.chapterRowLabel,title:_?_(a.label):a.label,children:_?_(a.label):a.label})]},`${a.time}-${s}`))})]})]})]})]}),document.body)},on="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",ln=r=>{try{return JSON.parse(r.detail)}catch{return null}},cn=({isOpen:r,onClose:o,onSuccess:k})=>{const[g,i]=b(1),[u,y]=b(typeof navigator<"u"?navigator.userAgent:""),[S,_]=b(""),[C,P]=b(!1),[R,f]=b(!1),m=H(null),L=typeof navigator<"u"?navigator.userAgent:"",A=/android/i.test(L),h=/firefox|fxios/i.test(L)&&!A,c=!h&&!A&&/chrome|chromium|edg|brave/i.test(L),l=h||c;T(()=>{r&&(i(1),y(typeof navigator<"u"?navigator.userAgent:""),_(""),P(!1),f(!1))},[r]),T(()=>()=>{m.current&&(window.removeEventListener("dango:jasmr-cookie",m.current),m.current=null)},[]);const B=async()=>{ue.setItem("jasmr_ua",u),window.open("https://japaneseasmr.com","_blank","noopener,noreferrer"),i(2)},p=()=>{if(R)return;f(!0);const j=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,Q=window.setTimeout(()=>{f(!1),m.current&&(window.removeEventListener("dango:jasmr-cookie",m.current),m.current=null),ae.error("Helper not detected - install it via about:debugging first.")},3e3),N=K=>{const $=ln(K);if(!(!$||$.requestId!==j))if(window.clearTimeout(Q),window.removeEventListener("dango:jasmr-cookie",N),m.current=null,f(!1),$?.ok&&$.cookie)_($.cookie),ae.success("Cookie extracted from helper!");else if($?.error==="NO_COOKIE"){const D=$.debug?.stores?.length??0,U=$.debug?.names??[];ae.error(`Helper found no cf_clearance (checked ${D} stores, saw: ${U.join(", ")||"none"}) - solve the challenge on the JapaneseASMR tab first.`)}else ae.error("Helper request failed - try again.")};m.current=N,window.addEventListener("dango:jasmr-cookie",N),window.dispatchEvent(new CustomEvent("dango:get-jasmr-cookie",{detail:{requestId:j}}))},x=async()=>{if(!S.trim()){ae.error("Please enter the cf_clearance cookie");return}P(!0);try{ue.setItem("jasmr_cookie",S.trim()),ae.success("Cookie updated successfully!"),k?.(),o()}catch{ae.error("Failed to save cookie")}finally{P(!1)}};return e(Je,{isOpen:r,onClose:o,title:"JapaneseASMR Verification Required",children:e("div",{className:M.container,children:g===1?e(E,{children:[e("p",{children:["JapaneseASMR is protected by a Cloudflare challenge. Solve it once in your browser and paste the ",e("strong",{children:"cf_clearance"})," cookie so the app can load the site for you."]}),e("div",{className:M.field,children:[e("label",{children:"Your User-Agent (must match the browser you solve the challenge with):"}),e("textarea",{value:u,onChange:j=>y(j.currentTarget.value),rows:3,className:M.textarea})]}),e("div",{className:M.actions,children:[e("button",{className:M.secondaryButton,onClick:o,children:"Cancel"}),e("button",{className:M.button,onClick:B,children:"Start Verification (Opens JapaneseASMR)"})]})]}):e(E,{children:[e("p",{children:["1. Solve the challenge on the ",e("strong",{children:"JapaneseASMR tab"})," (keep that tab open).",e("br",{}),"2. Copy the ",e("strong",{children:"cf_clearance"})," cookie value using one of these:",e("br",{}),e("br",{}),e("strong",{children:"Chrome / Edge — DevTools:"})," press ",e("code",{children:"F12"})," →"," ",e("strong",{children:"Application"})," → ",e("strong",{children:"Cookies"})," →"," ",e("code",{children:"https://japaneseasmr.com"}),". Find ",e("strong",{children:"cf_clearance"}),", double-click its ",e("strong",{children:"Value"})," to select it, then copy.",e("br",{}),e("br",{}),e("strong",{children:"Firefox — Storage Inspector:"})," press ",e("code",{children:"F12"})," →"," ",e("strong",{children:"Storage"})," → ",e("strong",{children:"Cookies"})," →"," ",e("code",{children:"https://japaneseasmr.com"}),". Find ",e("strong",{children:"cf_clearance"}),", right-click the value → ",e("strong",{children:"Copy Value"}),".",e("br",{}),e("br",{}),e("strong",{children:"Either browser — extension:"})," open"," ",e("strong",{children:"Cookie Manager"})," while on the JapaneseASMR tab, find"," ",e("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",e("br",{}),e("br",{}),"3. Paste it below. Copy ",e("strong",{children:"only the value"})," — remove any"," ",e("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),l&&e("div",{className:M.hint,children:[e("strong",{children:"Dango helper (one-time setup):"})," ",h?e(E,{children:["type ",e("code",{children:"about:debugging"})," in the address bar →"," ",e("strong",{children:"This Firefox"})," → ",e("strong",{children:"Load Temporary Add-on"})," ","→ open the ",e("code",{children:"dango-extension/firefox"})," folder and pick"," ",e("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes - repeat after a restart.)"]}):e(E,{children:["type ",e("code",{children:"chrome://extensions"})," in the address bar → enable"," ",e("strong",{children:"Developer mode"})," → ",e("strong",{children:"Load unpacked"})," → open the ",e("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice - expected.)"]})," ","Use this link to download the extension and extract it:"," ",e("a",{href:on,target:"_blank",rel:"noreferrer",className:M.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",e("div",{className:M.actions,children:e("button",{className:M.button,onClick:p,disabled:R,type:"button",children:R?"Extracting…":"Extract cookie from helper"})})]}),e("div",{className:M.field,children:[e("label",{children:"cf_clearance cookie value:"}),e("input",{type:"text",value:S,onChange:j=>_(j.currentTarget.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:M.input})]}),e("div",{className:M.actions,children:[e("button",{className:M.secondaryButton,onClick:o,children:"Cancel"}),e("button",{className:M.secondaryButton,onClick:()=>i(1),children:"Back"}),e("button",{className:M.button,onClick:x,disabled:C,children:C?"Saving...":"Submit"})]})]})})})},Qe="asmrTranslateCache",dn=10080*60*1e3;function un(){try{const r=ue.getItem(Qe);if(!r)return new Map;const o=JSON.parse(r);return new Map(Object.entries(o))}catch{return new Map}}function mn(r){try{const o={};for(const[k,g]of r)o[k]=g;ue.setItem(Qe,JSON.stringify(o))}catch{}}function Ue(r){return/[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]/.test(r)}async function hn(r){const o=r.map(i=>i.trim()).filter(Boolean);if(o.length===0)return new Map;const k=await Me.settings.translate.mutate({texts:o,source:"ja",target:"en"}),g=new Map;for(const[i,u]of Object.entries(k.translations||{}))g.set(i,u);for(const i of o)g.has(i)||g.set(i,i);return g}function pn(r,o){const[k,g]=b(new Map),[i,u]=b(!1),y=H(null),S=r.join("");return T(()=>{const C=S?S.split(""):[];if(!o||C.length===0){g(new Map),u(!1);return}const P=Array.from(new Set(C.map(h=>h.trim()).filter(Boolean).filter(Ue)));if(P.length===0){g(new Map);return}y.current||(y.current=un());const R=Date.now(),f=new Map,m=[];for(const h of P){const c=y.current.get(h);c&&R-c.ts<dn?f.set(h,c.t):m.push(h)}if(m.length===0){g(f);return}let L=!1;u(!0);const A=[];for(let h=0;h<m.length;h+=15)A.push(m.slice(h,h+15));return(async()=>{const h=new Map;for(const l of A){try{const B=await hn(l);for(const[p,x]of B)h.set(p,x)}catch{}await new Promise(B=>setTimeout(B,120))}if(L)return;if(y.current){for(const[l,B]of h)y.current.set(l,{t:B,ts:Date.now()});mn(y.current)}const c=new Map([...f,...h]);g(c),u(!1)})(),()=>{L=!0}},[o,S]),{t:C=>!o||!C||!Ue(C)?C:k.get(C.trim())||C,map:k,isTranslating:i}}const gn=[{label:"Date",options:[{value:"latest",label:"Latest"},{value:"oldest",label:"Oldest"}]},{label:"Title",options:[{value:"title_asc",label:"A → Z"},{value:"title_desc",label:"Z → A"}]},{label:"Popular (Views)",options:[{value:"popular_recent",label:"Recent"},{value:"popular_week",label:"Week"},{value:"popular_month",label:"Month"},{value:"popular_6_months",label:"6 Months"},{value:"popular_year",label:"Year"},{value:"popular",label:"All Time"}]},{label:"Most Commented",options:[{value:"comments_week",label:"Week"},{value:"comments_month",label:"Month"},{value:"comments_year",label:"Year"},{value:"comments",label:"All Time"}]},{label:"Other",options:[{value:"random",label:"Random"}]}],fn=[{value:"",label:"All"},{value:"sfw",label:"SFW / 全年齢"},{value:"r-15",label:"R-15"},{value:"r-18",label:"NSFW / R18"},{value:"yuri",label:"Yuri / Girls love / 百合"},{value:"otokonoko",label:"Otoko no ko / 男の娘"},{value:"futanari",label:"Futanari / フタナリ"},{value:"r-18g",label:"R-18G / グロ"}],yn=[{value:"sfw",label:"SFW / 全年齢"}],In=()=>{const{rj:r}=rt(),o=Ve(),[k,g]=st(),{hasConsent:i,grant:u}=lt(),[y,S]=b(!1),[_,C]=b(()=>k.get("q")||""),[P,R]=b(()=>k.get("q")||""),[f,m]=b("latest"),[L,A]=b("sfw"),[h,c]=b(1),[l,B]=b(null),[p,x]=b(null),[j,Q]=b(!0),[N,K]=b(()=>ue.getItem("asmrTranslateEN")==="true"),[$,D]=b(!1),U=ct(),{toggle:me,bookmarkedIds:F}=Ge(),{popup:W,openPopup:be,scheduleClose:Z,cancelClose:ke,closePopup:re}=_t();T(()=>it("jasmr",()=>D(!0)),[]),T(()=>{ue.setItem("asmrTranslateEN",String(N))},[N]);const he=i,q=he?L:"sfw",pe=he?fn:yn,{data:V,isLoading:se,isError:oe,isFetching:ge}=yt(P,h,f,q),J=Re.useMemo(()=>V?.shows??[],[V?.shows]),fe=V?.hasNext??!1;T(()=>{if(!r){l&&!p&&B(null);return}const n=r.toUpperCase();if(p&&(p.work.id?.toUpperCase()===n||p.work._id?.toUpperCase()===n)){l&&B(null);return}const d=J.find(I=>(I.id||I._id)?.toUpperCase()===n);d?(!l||(l.id||l._id)!==(d.id||d._id))&&B(d):(!l||(l.id||l._id)?.toUpperCase()!==n)&&B({_id:n,id:n,name:n})},[r,J,p,l]);const le=Y(()=>{o("/asmr")},[o]);T(()=>{!r&&p&&x(null)},[r,p]);const{data:X}=Ke(p&&p.work.id||null),ie=p?[p.work.thumbnail,...X?.images||[]].filter(Boolean):[],ve=[...J.map(n=>n.name),l?.name||"",p?.work.name||"",...X?.chapters?.map(n=>n.label)||[]].filter(Boolean),{t:z}=pn(ve,N);T(()=>{const n=p?p.work.name:l?l.name:r?r.toUpperCase():"",d=n?N?z(n):n:"",I=d?`${d} - dango`:"dango";document.title=I;try{window.history.replaceState(window.history.state,I,window.location.href)}catch{}},[l,p,r,N,z]);const ce=n=>{n.preventDefault(),R(_),c(1);const d=new URLSearchParams(k);_.trim()?d.set("q",_.trim()):d.delete("q"),d.delete("page"),g(d,{replace:!0})};T(()=>{const n=k.get("q")||"";C(d=>d===n?d:n),R(d=>d===n?d:n),c(1)},[k]);const ye=n=>{n.currentTarget.checked&&!i&&S(!0)},ee=()=>{u(),S(!1),c(1)},we=()=>{S(!1)},de=Y((n,d,I)=>{B(null),Q(!0),x({work:n,tracks:d,index:I})},[]);return e("div",{className:`${ne.page} ${p?ne.pageWithPlayer:""}`,children:[!(p&&j)&&e(E,{children:[e("header",{className:ne.header,children:[e("h1",{className:ne.pageTitle,children:[e(w,{name:"headphones"})," ASMR"]}),e("form",{className:ne.searchForm,onSubmit:ce,children:[e("input",{className:ne.searchInput,type:"text",value:_,onChange:n=>C(n.currentTarget.value),placeholder:"Search works, circles, CV… (-word excludes)","aria-label":"Search ASMR works"}),e("button",{className:ne.searchBtn,type:"submit","aria-label":"Search",children:e(w,{name:"search"})})]})]}),e("div",{className:t.filterBar,children:[e("label",{className:t.filterLabel,htmlFor:"asmr-sort",children:"Sort"}),e("select",{id:"asmr-sort",className:t.sortSelect,value:f,onChange:n=>{m(n.currentTarget.value),c(1)},children:gn.map(n=>e("optgroup",{label:n.label,children:n.options.map(d=>e("option",{value:d.value,children:d.label},d.value))},n.label))}),e("label",{className:t.filterLabel,htmlFor:"asmr-rating",children:"Type"}),e("select",{id:"asmr-rating",className:t.sortSelect,value:L,onChange:n=>{A(n.currentTarget.value),c(1)},children:pe.map(n=>e("option",{value:n.value,children:n.label},n.value))}),e("div",{className:t.filterTogglesGroup,children:[e("div",{className:t.translateToggleWrap,children:[e("span",{className:t.filterLabel,children:"JP"}),e(De,{id:"asmr-translate-toggle",isChecked:N,onChange:n=>K(n.currentTarget.checked)}),e("span",{className:t.filterLabel,children:"EN"})]}),!i&&e("div",{className:t.matureToggleWrap,children:[e("label",{className:t.matureLabel,htmlFor:"asmr-mature-toggle",children:"Mature"}),e(De,{id:"asmr-mature-toggle",isChecked:!1,onChange:ye})]})]})]}),oe?e("p",{className:t.statusMsg,children:"Failed to load works. Please try again."}):se&&J.length===0?e("div",{className:t.grid,"aria-hidden":!0,children:Array.from({length:12}).map((n,d)=>e("div",{className:t.skeletonCard,children:[e("div",{className:`${t.skeletonThumb} ${t.shimmer}`}),e("div",{className:`${t.skeletonLine} ${t.shimmer}`,style:{width:"88%"}}),e("div",{className:`${t.skeletonLine} ${t.shimmer}`,style:{width:"55%"}})]},d))}):J.length===0?e("p",{className:t.statusMsg,children:"No works found."}):e(E,{children:[e("div",{className:`${t.grid} ${ge?t.fetching:""}`,children:J.map(n=>{const d=N?{...n,name:z(n.name)}:n,I=ze(n),Ce=Fe(I),te=F.has(Ce),Ne=`/asmr/${encodeURIComponent(I)}`;return e("div",{className:t.asmrCardWrap,children:[e(ut,{item:{id:Ce,title:d.name,thumbnail:n.thumbnail||"",typeBadge:I||void 0,isAdult:Be(n)},linkTo:Ne,hoverIcon:"info",layout:"horizontal",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!1,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:G=>be(G,{rjCode:I,title:d.name,thumbnail:n.thumbnail||"",isAdult:Be(n),rating:n.rating,listenTarget:Ne}),onPopupHoverIntent:G=>G?ke():Z(),rawThumbnail:!0}),e("button",{className:`${t.bookmarkBtn} ${te?t.bookmarked:""}`,onClick:G=>{G.preventDefault(),G.stopPropagation(),me({rjCode:I,title:n.name,thumbnail:n.thumbnail||"",isAdult:Be(n)})},title:te?"Remove from listening list":"Add to listening list","aria-label":te?"Remove from listening list":"Add to listening list","aria-pressed":te,children:e(w,{name:te?"check":"plus",size:12})})]},n._id||n.id)})}),e(mt,{page:h,canGoNext:fe,onChange:n=>c(n),variant:"labeled"})]})]}),l&&e(nn,{work:l,onClose:le,onPlay:de,t:z}),W&&e(bt,{data:W.data,anchorRect:W.rect,bookmarked:F.has(Fe(W.data.rjCode)),onToggleBookmark:()=>me({rjCode:W.data.rjCode,title:W.data.title,thumbnail:W.data.thumbnail||"",isAdult:W.data.isAdult}),onMouseEnter:ke,onMouseLeave:Z,onRequestClose:re}),$&&e(cn,{isOpen:$,onClose:()=>D(!1),onSuccess:()=>{U.invalidateQueries({queryKey:[He.asmrBrowse]}),U.invalidateQueries({queryKey:[He.asmrWork]})}}),y&&e(dt,{isOpen:!0,scope:"section",showResetHint:!0,onClose:we,onGrant:ee}),p&&e(rn,{title:p.work.name,images:ie,chapters:X?.chapters||[],tracks:p.tracks,trackIndex:p.index,expanded:j,isAdult:!!p.work.isAdult,rjCode:p.work.id||p.work._id,t:z,onTrackChange:n=>x(d=>d&&{...d,index:n}),onExpandedChange:Q,onClose:()=>{x(null),Q(!0),r&&o("/asmr")}})]})};export{In as default};
@@ -1 +1 @@
1
- import{u as i}from"./vendor-core-DfaOB3Rn.js";import{R as n}from"./ResetProgressModal-Dq-B23o_.js";import{s as a,n as g}from"./useAsmr-XBCV7iDw.js";const p=({workId:e,title:s,onClose:r})=>{const o=a(),m=g();return i(n,{isOpen:!!e,itemName:s,progressKind:"listening",listLabel:"my listening list",onClose:r,onConfirm:t=>{e&&(o.mutate({workId:e}),t&&m.mutate({id:e}))}})};export{p as A};
1
+ import{u as i}from"./vendor-core-DfaOB3Rn.js";import{R as n}from"./ResetProgressModal-DtUE-wCy.js";import{s as a,n as g}from"./useAsmr-DO5DUI_t.js";const p=({workId:e,title:s,onClose:r})=>{const o=a(),m=g();return i(n,{isOpen:!!e,itemName:s,progressKind:"listening",listLabel:"my listening list",onClose:r,onConfirm:t=>{e&&(o.mutate({workId:e}),t&&m.mutate({id:e}))}})};export{p as A};
@@ -0,0 +1 @@
1
+ import{d as E,A as F,h as O,q as P,g as G,u as e,L as We,T as Q,S as ie,a as J,_ as Je}from"./vendor-core-DfaOB3Rn.js";import{u as ke,a as le,b as et,c as tt,q as Oe,t as at,d as ze,s as nt,f as Te,B as Ve,e as rt,p as ne,g as re,h as ot,i as st,j as lt,k as Ce,M as it,T as ct,l as dt,m as Me,n as ut,o as ht,r as pt,v as mt,w as gt,x as vt,y as _t,z as bt,A as ft}from"./index-DbRDs7tF.js";import{b as yt,u as Nt,a as Tt}from"./vendor-query-BBT5_sHx.js";import{M as ge,P as wt}from"./MediaCard-ChUKs5Sb.js";import{A as ce}from"./AnimeCard-DWnU-rCc.js";import{S as Fe,A as qe}from"./SkeletonGrid-BO0am1za.js";import{I as z}from"./vendor-icons-DrybRNxP.js";import{u as St}from"./vendor-ui-3qrARCPr.js";import{E as Ie}from"./ErrorMessage-DAxegITP.js";import{R as Ge}from"./ResetProgressModal-DtUE-wCy.js";import{Q as kt}from"./QueueRail-Derl5yzz.js";import{u as Ue,M as Qe}from"./useMangaPopup-B4ntcNg0.js";import{M as Ct}from"./MangaResetProgressModal-Y2PuLQHz.js";import{u as Ye,a as It,m as Se,i as He,b as Ae,c as Xe,d as At,e as Rt}from"./useMangaLibrary-B4ZJLZXD.js";import{u as Lt}from"./useProviders-Bnw0sBAP.js";import{u as Ke,a as xe,T as $t}from"./useTv-gF7SJCl9.js";import{T as Mt}from"./TvPopup-DYYtMp7D.js";import{u as xt,a as Bt,b as Pt}from"./useTvLibrary-DTWM3iOC.js";import{A as Et}from"./AsmrResetProgressModal-73jUOcAL.js";import{u as Dt,a as Wt,b as Ot}from"./useAsmr-DO5DUI_t.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-DiWSp3Of.js";import"./useAnimeInfoData-YbePqj-M.js";import"./QueueOptionsButton-C6ArqpM5.js";import"./playbackCompletion-CnxK6_Vz.js";import"./usePopup-DS9jMzp6.js";import"./libraryInvalidation-cJ1WjrJq.js";const zt="_sectionWrapper_2p2l1_9",Vt="_sectionTitleNoMargin_2p2l1_13",Ft="_carousel_2p2l1_178",B={"section-header":"_section-header_2p2l1_1",sectionWrapper:zt,sectionTitleNoMargin:Vt,"title-wrapper":"_title-wrapper_2p2l1_17","header-controls":"_header-controls_2p2l1_24","header-select":"_header-select_2p2l1_30","collapse-button":"_collapse-button_2p2l1_79","title-link":"_title-link_2p2l1_98","continue-watching":"_continue-watching_2p2l1_117","nav-arrows":"_nav-arrows_2p2l1_139","nav-button":"_nav-button_2p2l1_148","carousel-container":"_carousel-container_2p2l1_178",carousel:Ft,"carousel-inner":"_carousel-inner_2p2l1_187","carousel-card":"_carousel-card_2p2l1_192"};function ve({align:n="start",containScroll:s="trimSnaps",scrollFraction:h=.8,threshold:t=.6,onReachThreshold:o}={}){const[l,i]=St({align:n,containScroll:s,dragFree:!0}),[c,N]=E(!1),g=F({scrollFraction:h,threshold:t,onReachThreshold:o}),m=F(!1);O(()=>{g.current={scrollFraction:h,threshold:t,onReachThreshold:o}});const p=P(d=>{N(d.canScrollPrev()||d.canScrollNext())},[]);O(()=>{if(!i)return;const d=()=>{const u=i.scrollProgress();u>=g.current.threshold&&!m.current?(m.current=!0,g.current.onReachThreshold?.()):u<g.current.threshold&&(m.current=!1),p(i)};return i.on("init",d),i.on("reInit",d),i.on("scroll",d),i.on("resize",d),()=>{i.off("init",d),i.off("reInit",d),i.off("scroll",d),i.off("resize",d)}},[i,p]);const T=P(d=>{const u=d.containerNode().firstElementChild;if(!u)return 1;const b=d.rootNode().getBoundingClientRect().width,k=u.getBoundingClientRect().width;return k?Math.max(1,Math.round(b/k)):1},[]),r=P((d,u=!1)=>{if(!i)return;const b=Math.max(1,Math.round(T(i)*g.current.scrollFraction)),k=i.selectedScrollSnap()+(d==="left"?-b:b);i.scrollTo(k,u)},[i,T]),S=P((d=!1)=>{i?.scrollTo(0,d)},[i]);return{emblaRef:l,api:i,canScroll:c,stepBy:r,scrollToStart:S}}const Z=({title:n,eyebrow:s,titleLink:h,loading:t,emptyState:o,carousel:l,layout:i,collapsible:c,defaultExpanded:N=!0,onReachThreshold:g,scrollThreshold:m,isFetchingNextPage:p,resetScrollOnShrink:T,itemCount:r=0,highlight:S,headerActions:d,loadingSkeleton:u,skeletonCount:b=7,children:k})=>{const{lowEndMode:w}=ke(),{emblaRef:A,stepBy:$,scrollToStart:R}=ve({onReachThreshold:g,threshold:m}),[C,U]=G.useState(N);G.useEffect(()=>{U(N)},[N]);const x=G.useRef(0);return G.useEffect(()=>{T&&r>0&&C&&(r<=x.current||x.current===0)&&R(),r>0&&(x.current=r)},[r,T,C,R]),!t&&r===0&&!o&&!c?null:e("section",{className:`${B.sectionWrapper} ${S?B["continue-watching"]:""}`,children:[e("div",{className:B["section-header"],children:[e("div",{className:B["title-wrapper"],children:[e("div",{className:"title-stack",children:[s&&e("div",{className:"section-eyebrow",children:s}),h?e(We,{to:h,className:B["title-link"],children:e("div",{className:`section-title ${B.sectionTitleNoMargin}`,children:n})}):e("div",{className:`section-title ${B.sectionTitleNoMargin}`,children:n})]}),l&&r>0&&C&&e("div",{className:B["nav-arrows"],children:[e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll left",onClick:I=>{I.preventDefault(),$("left",w)},children:e(z,{name:"chevron-left"})}),e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll right",onClick:I=>{I.preventDefault(),$("right",w)},children:e(z,{name:"chevron-right"})})]})]}),e("div",{className:B["header-controls"],children:[d,c&&e("button",{className:B["collapse-button"],type:"button",onClick:()=>U(I=>!I),"aria-expanded":C,"aria-label":C?`Collapse ${n}`:`Expand ${n}`,children:C?e(z,{name:"chevron-up"}):e(z,{name:"chevron-down"})})]})]}),C&&(l?!t&&r===0&&o?e("div",{children:o}):e("div",{className:B["carousel-container"],children:e("div",{className:B.carousel,ref:A,children:e("div",{className:B["carousel-inner"],children:[t&&r===0?Array.from({length:b}).map((I,V)=>e("div",{className:B["carousel-card"],children:u},V)):G.Children.map(k,(I,V)=>e("div",{className:B["carousel-card"],children:I},G.isValidElement(I)&&I.key!=null?I.key:`slide-${V}`)),p&&u&&e("div",{className:B["carousel-card"],children:u})]})})}):e("div",{className:"grid-container",children:t&&r===0?e(Fe,{count:6,layout:i}):r>0?k:t?null:e("div",{style:{gridColumn:"1 / -1"},children:o})}))]})},qt=({title:n,eyebrow:s,animeList:h,continueWatching:t,titleLink:o,onRemove:l,loading:i,emptyState:c,carousel:N,cardConfig:g,layout:m,onReachThreshold:p,scrollThreshold:T,isFetchingNextPage:r,collapsible:S,defaultExpanded:d=!0})=>{const u=m||"vertical";return e(Z,{title:n,eyebrow:s,titleLink:o,loading:i,emptyState:c,carousel:N,layout:u,collapsible:S,defaultExpanded:d,onReachThreshold:p,scrollThreshold:T,isFetchingNextPage:r,resetScrollOnShrink:t,highlight:t,itemCount:h.length,loadingSkeleton:e(qe,{layout:u}),skeletonCount:7,children:h.map(b=>e(ce,{anime:b,continueWatching:t,onRemove:l,config:g,layout:u},b._id))})},Be=G.memo(qt),Gt="_wrapper_16dme_1",Ut="_arrow_16dme_6",Qt="_select_16dme_15",we={wrapper:Gt,arrow:Ut,select:Qt},oe=({value:n,options:s,onChange:h,ariaLabel:t,width:o})=>e("span",{className:we.wrapper,children:[e("select",{className:we.select,style:o!==void 0?{width:o}:void 0,value:n,"aria-label":t,onChange:l=>h(l.currentTarget.value),children:s.map(l=>e("option",{value:l.value,children:l.label},l.value))}),e(z,{name:"chevron-down",size:12,className:we.arrow})]}),Yt="_sectionWrapper_1he76_2",Ht="_sectionTitleNoMargin_1he76_6",Xt="_carouselContainer_1he76_80",Kt="_carousel_1he76_80",jt="_carouselInner_1he76_91",Zt="_carouselItem_1he76_96",Jt="_rankCard_1he76_133",ea="_rankPill_1he76_137",ta="_rankGold_1he76_148",aa="_rankSilver_1he76_152",na="_rankBronze_1he76_156",ra="_skeletonPoster_1he76_167",oa="_skeletonText_1he76_168",v={sectionWrapper:Yt,sectionTitleNoMargin:Ht,"section-header":"_section-header_1he76_10","title-wrapper":"_title-wrapper_1he76_18","nav-arrows":"_nav-arrows_1he76_40","nav-button":"_nav-button_1he76_49",carouselContainer:Xt,carousel:Kt,carouselInner:jt,carouselItem:Zt,rankCard:Jt,rankPill:ea,rankGold:ta,rankSilver:aa,rankBronze:na,skeletonPoster:ra,skeletonText:oa,"header-actions":"_header-actions_1he76_205"},Pe="TRENDING_DESC",sa="POPULARITY_DESC",la=10;function ia({title:n,eyebrow:s}){const{lowEndMode:h}=ke(),[t,o]=le("trending_sort",Pe),l=[{value:Pe,label:"Trending"},{value:sa,label:"All Time"}],{data:i,fetchNextPage:c,hasNextPage:N,isFetchingNextPage:g,isLoading:m,isError:p,error:T}=et(t,la),r=Q(()=>i?.pages.flatMap(b=>b)||[],[i]),S=P(()=>{N&&!g&&!m&&c()},[N,g,m,c]),{emblaRef:d,stepBy:u}=ve({onReachThreshold:S});return e("section",{className:v.sectionWrapper,children:[e("div",{className:v["section-header"],children:[e("div",{className:v["title-wrapper"],children:[e("div",{className:"title-stack",children:[s&&e("div",{className:"section-eyebrow",children:s}),e("div",{className:`section-title ${v.sectionTitleNoMargin}`,children:n})]}),e("div",{className:v["nav-arrows"],children:[e("button",{className:v["nav-button"],type:"button",onClick:b=>{b.preventDefault(),u("left",h)},"aria-label":"Scroll left",children:e(z,{name:"chevron-left"})}),e("button",{className:v["nav-button"],type:"button",onClick:b=>{b.preventDefault(),u("right",h)},"aria-label":"Scroll right",children:e(z,{name:"chevron-right"})})]})]}),e("div",{className:v["header-actions"],children:e(oe,{ariaLabel:"Trending sort",width:120,value:t,options:l,onChange:o})})]}),m?e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,children:e("div",{className:v.carouselInner,children:Array.from({length:7}).map((b,k)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.skeletonPoster}),e("div",{className:v.skeletonText})]},k))})})}):p?e(Ie,{message:T instanceof Error?T.message:"An unknown error occurred"}):e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,ref:d,children:e("div",{className:v.carouselInner,children:[r.map((b,k)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.rankCard,children:e(ce,{anime:b})}),e("div",{className:`${v.rankPill} ${k===0?v.rankGold:k===1?v.rankSilver:k===2?v.rankBronze:""}`,children:k+1})]},b._id)),g&&e("div",{className:v.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:v.skeletonPoster})})]})})})]})}const ca=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}],da=10;function ua({eyebrow:n}){const{lowEndMode:s}=ke(),[h,t]=le("latest_releases_format","TV"),{data:o,fetchNextPage:l,hasNextPage:i,isFetchingNextPage:c,isLoading:N,isError:g,error:m}=tt(h,da),p=Q(()=>o?.pages.flatMap(d=>d)||[],[o]),T=P(()=>{i&&!c&&!N&&l()},[i,c,N,l]),{emblaRef:r,stepBy:S}=ve({onReachThreshold:T});return e("section",{className:v.sectionWrapper,children:[e("div",{className:v["section-header"],children:[e("div",{className:v["title-wrapper"],children:[e("div",{className:"title-stack",children:[n&&e("div",{className:"section-eyebrow",children:n}),e("div",{className:`section-title ${v.sectionTitleNoMargin}`,children:"Latest Releases"})]}),e("div",{className:v["nav-arrows"],children:[e("button",{className:v["nav-button"],type:"button",onClick:d=>{d.preventDefault(),S("left",s)},"aria-label":"Scroll left",children:e(z,{name:"chevron-left"})}),e("button",{className:v["nav-button"],type:"button",onClick:d=>{d.preventDefault(),S("right",s)},"aria-label":"Scroll right",children:e(z,{name:"chevron-right"})})]})]}),e("div",{className:v["header-actions"],children:e("select",{className:v.timeSelect,value:h,onChange:d=>t(d.currentTarget.value),children:ca.map(d=>e("option",{value:d.value,children:d.label},d.value))})})]}),N?e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,children:e("div",{className:v.carouselInner,children:Array.from({length:7}).map((d,u)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.skeletonPoster}),e("div",{className:v.skeletonText})]},u))})})}):g?e(Ie,{message:m instanceof Error?m.message:"An unknown error occurred"}):e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,ref:r,children:e("div",{className:v.carouselInner,children:[p.map(d=>e("div",{className:v.carouselItem,children:e(ce,{anime:d})},d._id)),c&&e("div",{className:v.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:v.skeletonPoster})})]})})})]})}const ha="_scheduleSection_lnxz1_1",pa="_sectionTitleRow_lnxz1_5",ma="_sectionTitleNoMargin_lnxz1_11",ga="_sectionHeader_lnxz1_15",va="_headerActions_lnxz1_25",_a="_daySelectorContainer_lnxz1_32",ba="_daySelector_lnxz1_32",fa="_daySelectorInner_lnxz1_49",ya="_dayBtn_lnxz1_60",Na="_active_lnxz1_83",Ta="_dayMonth_lnxz1_91",wa="_dayNum_lnxz1_99",Sa="_dayName_lnxz1_105",ka="_navArrows_lnxz1_118",Ca="_navButton_lnxz1_127",Ia="_carouselContainer_lnxz1_158",Aa="_carousel_lnxz1_158",Ra="_carouselInner_lnxz1_170",La="_carouselCard_lnxz1_175",L={scheduleSection:ha,sectionTitleRow:pa,sectionTitleNoMargin:ma,sectionHeader:ga,headerActions:va,daySelectorContainer:_a,daySelector:ba,daySelectorInner:fa,dayBtn:ya,active:Na,dayMonth:Ta,dayNum:wa,dayName:Sa,navArrows:ka,navButton:Ca,carouselContainer:Ia,carousel:Aa,carouselInner:Ra,carouselCard:La},de=n=>{const s=n.getFullYear(),h=String(n.getMonth()+1).padStart(2,"0"),t=String(n.getDate()).padStart(2,"0");return`${s}-${h}-${t}`},$a=async(n,s)=>await at.data.schedule.query({date:n,format:s}),Ma=({eyebrow:n})=>{const[s,h]=E(()=>de(new Date)),[t,o]=le("schedule_format","TV"),{emblaRef:l,canScroll:i,stepBy:c,scrollToStart:N}=ve(),g=F(null),m=F(!0),{data:p=[],isLoading:T,error:r}=yt({queryKey:[Oe.schedule,s,t],queryFn:()=>$a(s,t),staleTime:1e3*60*5}),S=Q(()=>{const u=[],b=new Date,k=de(b),w=new Date(b);w.setDate(b.getDate()-1);const A=de(w),$=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let R=-6;R<=6;R++){const C=new Date(b);C.setDate(b.getDate()+R),u.push(C)}return u.map(R=>{const C=de(R),I=C===k?"Today":C===A?"Yest":$[R.getDay()],V=R.getDate(),M=new Intl.DateTimeFormat("en-US",{month:"short"}).format(R);return{dateString:C,dayLabel:I,dayNum:V,monthName:M}})},[]);O(()=>{if(m.current){m.current=!1;return}if(g.current){const u=g.current.querySelector(`[data-date="${s}"]`);u&&u.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[s]),O(()=>{N(!0)},[s,N]);const d=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}];return e("div",{className:L.scheduleSection,children:[e("div",{className:L.sectionHeader,children:[e("div",{className:L.sectionTitleRow,children:[e("div",{className:"title-stack",children:[n&&e("div",{className:"section-eyebrow",children:n}),e("h2",{className:`section-title ${L.sectionTitleNoMargin}`,children:"Episode Schedule"})]}),p.length>0&&i&&e("div",{className:L.navArrows,children:[e("button",{className:L.navButton,onClick:()=>c("left"),"aria-label":"Scroll left",children:e(z,{name:"chevron-left"})}),e("button",{className:L.navButton,onClick:()=>c("right"),"aria-label":"Scroll right",children:e(z,{name:"chevron-right"})})]})]}),e("div",{className:L.headerActions,children:e(oe,{ariaLabel:"Schedule format",width:120,value:t,options:d,onChange:o})})]}),e("div",{className:L.daySelectorContainer,children:e("div",{className:L.daySelector,ref:g,children:e("div",{className:L.daySelectorInner,children:S.map(u=>e("button",{type:"button","data-date":u.dateString,"aria-pressed":s===u.dateString,className:`${L.dayBtn} ${s===u.dateString?L.active:""}`,onClick:()=>h(u.dateString),children:[e("span",{className:L.dayMonth,children:u.monthName}),e("span",{className:L.dayNum,children:u.dayNum}),e("span",{className:L.dayName,children:u.dayLabel})]},u.dateString))})})}),e("div",{className:L.carouselContainer,children:e("div",{className:L.carousel,ref:l,children:e("div",{className:L.carouselInner,children:T?Array.from({length:7}).map((u,b)=>e("div",{className:L.carouselCard,children:e(qe,{layout:"vertical"})},b)):r?e("div",{style:{width:"100%"},children:e(Ie,{message:r instanceof Error?r.message:"An unknown error occurred"})}):p.length===0?e("p",{style:{textAlign:"center",marginTop:"1rem",width:"100%"},children:"No episodes scheduled for this day."}):p.map(u=>e("div",{className:L.carouselCard,children:e(ce,{anime:u,continueWatching:!1,layout:"vertical"},u._id)},u._id))})})})]})},xa="_bannerContainer_1l49p_1",Ba="_hero_1l49p_28",Pa="_ambient_1l49p_37",Ea="_ambientShow_1l49p_49",Da="_scrim_1l49p_53",Wa="_progressLine_1l49p_69",Oa="_paused_1l49p_89",za="_dots_1l49p_103",Va="_dot_1l49p_103",Fa="_dotActive_1l49p_126",qa="_viewport_1l49p_137",Ga="_track_1l49p_144",Ua="_slide_1l49p_150",Qa="_slideInner_1l49p_158",Ya="_poster_1l49p_168",Ha="_posterLandscape_1l49p_179",Xa="_info_1l49p_203",Ka="_kicker_1l49p_208",ja="_featureLabel_1l49p_215",Za="_scoreChip_1l49p_227",Ja="_rise_1l49p_245",en="_active_1l49p_249",tn="_metaRow_1l49p_305",an="_metaItem_1l49p_316",nn="_metaDivider_1l49p_322",rn="_title_1l49p_329",on="_genres_1l49p_345",sn="_genreTag_1l49p_353",ln="_summary_1l49p_364",cn="_actions_1l49p_376",dn="_watchBtn_1l49p_383",un="_detailsBtn_1l49p_405",hn="_navArrow_1l49p_426",pn="_prevArrow_1l49p_459",mn="_nextArrow_1l49p_463",f={bannerContainer:xa,hero:Ba,ambient:Pa,ambientShow:Ea,scrim:Da,progressLine:Wa,paused:Oa,dots:za,dot:Va,dotActive:Fa,viewport:qa,track:Ga,slide:Ua,slideInner:Qa,poster:Ya,posterLandscape:Ha,info:Xa,kicker:Ka,featureLabel:ja,scoreChip:Za,rise:Ja,active:en,metaRow:tn,metaItem:an,metaDivider:nn,title:rn,genres:on,genreTag:sn,summary:ln,actions:cn,watchBtn:dn,detailsBtn:un,navArrow:hn,prevArrow:pn,nextArrow:mn},gn=8e3,ue=()=>e("div",{className:"skeleton",style:{width:"100vw",maxWidth:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",height:"clamp(480px, 72vh, 660px)",marginTop:"calc(-1 * var(--header-height))",marginBottom:"2.5rem"}}),_e=({slides:n,posterAspect:s="portrait",eyebrow:h="Spotlight"})=>{const[t,o]=E(0),[l,i]=E(0),[c,N]=E(!1),[g,m]=E(null),[p,T]=E(0),[r,S]=E({front:"",back:"",flip:!1}),d=F(0),u=F(0),b=F(new Set),k=F(null),w=F(0),A=P(a=>a.bannerSrc,[]),$=P(()=>{i(a=>a+1)},[]),R=P(a=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null),m(null),$();const _=A(n[a]);S(y=>y.flip?{front:_,back:y.back,flip:!1}:{front:y.front,back:_,flip:!0}),o(a)},[$,n,A]),C=P(a=>{if(n.length===0)return;const _=(a%n.length+n.length)%n.length;b.current.has(A(n[_]))?R(_):m(_)},[n,A,R]);O(()=>{let a=!1;return n.forEach(_=>{const y=A(_);if(!y||b.current.has(y))return;const D=new Image;D.src=y;const K=()=>{a||b.current.has(y)||(b.current.add(y),T(q=>q+1))};D.onload=K,D.onerror=K}),()=>{a=!0}},[n,A]),O(()=>{if(n.length!==0&&!r.front){const a=A(n[0]);S({front:a,back:"",flip:!1})}},[n,r.front,A]),O(()=>{if(g!==null){if(g<0||g>=n.length){m(null);return}b.current.has(A(n[g]))&&R(g)}},[g,p,n,A,R]),O(()=>{if(g===null)return;k.current!==null&&window.clearTimeout(k.current);const a=g;return k.current=window.setTimeout(()=>{k.current=null,R(a)},2500),()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)}},[g,R]);const U=P(a=>{C(a)},[C]),x=P(()=>{C(w.current+1)},[C]),I=P(()=>{C(w.current-1)},[C]),V=F(null);if(O(()=>{const a=V.current;if(!a)return;const _=y=>{if(Math.abs(y.deltaY)>Math.abs(y.deltaX)&&Math.abs(y.deltaY)>5){y.preventDefault(),y.stopPropagation();const D=Date.now();if(D-d.current<300)return;d.current=D,$(),y.deltaY>0?x():I()}};return a.addEventListener("wheel",_,{passive:!1}),()=>a.removeEventListener("wheel",_)},[n.length,x,I,$]),O(()=>{if(n.length===0||c)return;const a=setTimeout(x,gn);return()=>clearTimeout(a)},[t,x,n.length,l,c]),O(()=>{const a=_=>{const y=_.target;y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.tagName==="SELECT"||y.isContentEditable)||(_.key==="ArrowRight"?(_.preventDefault(),x()):_.key==="ArrowLeft"&&(_.preventDefault(),I()))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[x,I]),O(()=>{t>=n.length&&o(0)},[n.length,t]),n.length===0)return null;const M=t>=n.length?0:t;w.current=M;const ee=a=>{u.current=a.touches[0].clientX},H=a=>{const y=a.changedTouches[0].clientX-u.current;Math.abs(y)>50&&($(),y>0?I():x())};return e("div",{className:f.bannerContainer,onMouseEnter:()=>N(!0),onMouseLeave:()=>N(!1),children:e("div",{className:`${f.hero} ${c?f.paused:""}`,onTouchStart:ee,onTouchEnd:H,children:[r.front&&e("img",{src:r.front,alt:"","aria-hidden":"true",className:`${f.ambient} ${r.flip?"":f.ambientShow}`}),r.back&&e("img",{src:r.back,alt:"","aria-hidden":"true",className:`${f.ambient} ${r.flip?f.ambientShow:""}`}),e("div",{className:f.scrim,"aria-hidden":"true"}),n.length>1&&e("div",{className:f.progressLine,"aria-hidden":"true"},`progress-${l}-${M}`),n.length>1&&e("div",{className:f.dots,ref:V,role:"tablist","aria-label":"Spotlight slides",children:n.map((a,_)=>e("button",{role:"tab","aria-selected":_===M,"aria-label":`Go to slide ${_+1}: ${a.title}`,className:`${f.dot} ${_===M?f.dotActive:""}`,onClick:()=>U(_),tabIndex:_===M?0:-1},a.key))}),e("div",{className:f.viewport,children:e("div",{className:f.track,style:{transform:`translateX(-${M*100}%)`},children:n.map((a,_)=>e("div",{className:`${f.slide} ${_===M?f.active:""}`,"aria-hidden":_!==M,children:e("div",{className:f.slideInner,children:[e("img",{src:a.posterSrc,alt:a.posterAlt,className:s==="landscape"?f.posterLandscape:f.poster,decoding:"async"}),e("div",{className:f.info,children:[e("div",{className:`${f.kicker} ${f.rise}`,children:[e("span",{className:f.featureLabel,children:h}),a.score!==void 0&&a.score!==null&&a.score!==""&&e("span",{className:f.scoreChip,children:[e(z,{name:"star",size:12}),e("span",{children:a.score})]})]}),e(We,{to:a.detailTo,className:`${f.title} ${f.rise}`,"aria-label":`View details for ${a.title}`,tabIndex:_===M?0:-1,children:a.title}),a.metaItems.length>0&&e("div",{className:`${f.metaRow} ${f.rise}`,children:a.metaItems.map((y,D)=>e(G.Fragment,{children:[e("span",{className:f.metaItem,children:y}),D<a.metaItems.length-1&&e("div",{className:f.metaDivider})]},D))}),a.tags.length>0&&e("div",{className:`${f.genres} ${f.rise}`,children:a.tags.slice(0,3).map(y=>e("span",{className:f.genreTag,children:y},y))}),a.synopsis&&e("p",{className:`${f.summary} ${f.rise}`,children:a.synopsis}),e("div",{className:`${f.actions} ${f.rise}`,children:[e("button",{className:f.watchBtn,onClick:a.onPrimary,tabIndex:_===M?0:-1,children:[e(z,{name:a.primaryIcon,size:14}),e("span",{children:a.primaryLabel})]}),e("button",{className:f.detailsBtn,onClick:a.onDetails,tabIndex:_===M?0:-1,children:[e(z,{name:"info-circle",size:15}),e("span",{children:"Details"})]})]})]})]})},a.key))})}),n.length>1&&e(ie,{children:[e("button",{className:`${f.navArrow} ${f.prevArrow}`,onClick:()=>{$(),I()},"aria-label":"Previous slide",children:e(z,{name:"chevron-left",size:20})}),e("button",{className:`${f.navArrow} ${f.nextArrow}`,onClick:()=>{$(),x()},"aria-label":"Next slide",children:e(z,{name:"chevron-right",size:20})})]})]})})},vn=({animeList:n})=>{const{titlePreference:s}=ze(),h=J(),t=Q(()=>n.slice(0,6).map(o=>{const l=s==="nativeName"?o.nativeName||o.name:s==="englishName"&&o.englishName||o.name;return{key:o._id,bannerSrc:o.bannerImage?Te(o.bannerImage,1280,560):Te(o.thumbnail,1280,450),posterSrc:Te(o.thumbnail,460,650),posterAlt:l,title:l,detailTo:`/anime/${o._id}`,score:o.score,metaItems:[o.type||"Anime",o.status,o.episodeCount?`${o.episodeCount} Episodes`:void 0,o.rating].filter(i=>!!i),tags:(o.genres??[]).slice(0,3).map(i=>typeof i=="string"?i:i?.name).filter(i=>!!i),synopsis:nt(o.description??""),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>h(`/watch/${o._id}`),onDetails:()=>h(`/anime/${o._id}`)}}),[n,s,h]);return e(_e,{slides:t})},_n="_emptyState_19tmt_1",bn="_emptyStateIcon_19tmt_16",fn="_emptyStateTitle_19tmt_23",yn="_emptyStateText_19tmt_30",he={emptyState:_n,emptyStateIcon:bn,emptyStateTitle:fn,emptyStateText:yn},be=({icon:n,text:s,actionLabel:h,onAction:t,title:o="Nothing is here..."})=>e("div",{className:he.emptyState,children:[e(z,{name:n,size:48,className:he.emptyStateIcon}),e("div",{children:[e("h3",{className:he.emptyStateTitle,children:o}),e("p",{className:he.emptyStateText,children:s})]}),e(Ve,{variant:"primary",size:"sm",onClick:t,style:{marginTop:"1rem"},children:h})]}),Nn="_tabBar_irwbm_1",Tn="_tabIndicator_irwbm_24",wn="_tabButton_irwbm_38",Sn="_tabActive_irwbm_64",pe={tabBar:Nn,tabIndicator:Tn,tabButton:wn,tabActive:Sn};function kn({options:n,value:s,onChange:h,ariaLabel:t},o){const l=F(null),i=F(new Map),c=F(null),[N,g]=E({left:0,width:0}),m=P((p,T)=>{const r=i.current.get(p),S=l.current;if(r&&S){const d=S.getBoundingClientRect(),u=r.getBoundingClientRect();g({left:u.left-d.left+S.scrollLeft,width:u.width}),T&&r.scrollIntoView({block:"nearest",inline:"nearest"})}},[]);return Je(()=>{const p=c.current!==null&&c.current!==s;c.current=s,m(s,p)},[s,n.length,m]),O(()=>{if(m(s,!1),typeof ResizeObserver>"u")return;let p=0;const T=l.current;if(!T)return;const r=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(()=>m(s,!1))});r.observe(T);let S=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{S||m(s,!1)}),()=>{S=!0,cancelAnimationFrame(p),r.disconnect()}},[s,n.length,m]),e("div",{className:pe.tabBar,ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p)},"aria-label":t,children:[e("div",{className:pe.tabIndicator,style:{left:N.left,width:N.width}}),n.map(p=>e(Ve,{ref:T=>{T&&i.current.set(p.value,T)},variant:"secondary",size:"sm",className:`${pe.tabButton} ${s===p.value?pe.tabActive:""}`,onClick:()=>h(p.value),children:p.label},p.value))]})}const me=G.forwardRef(kn),Cn=[{value:"popular",label:"Popular"},{value:"followed",label:"Most Followed"},{value:"rating",label:"Top Rated"}],Ee=({title:n,eyebrow:s,sort:h,mature:t,headerActions:o})=>{const{toggle:l,bookmarkedIds:i}=Ye(),{popup:c,openPopup:N,scheduleClose:g,cancelClose:m,closePopup:p}=Ue(),{data:T,isLoading:r,fetchNextPage:S,hasNextPage:d,isFetchingNextPage:u}=It({provider:"",query:"",sort:h,status:"",type:"",rating:t?"safe,suggestive,erotica,pornographic":"safe",mature:t}),b=Q(()=>T?.pages.flatMap(w=>w.items)??[],[T]),k=P(()=>{d&&!u&&!r&&S()},[d,u,r,S]);return e(ie,{children:[e(Z,{title:n,eyebrow:s,loading:r,carousel:!0,itemCount:b.length,headerActions:o,onReachThreshold:k,isFetchingNextPage:u,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,children:b.map(w=>{const A=Se(w.provider,w.id);return e(ge,{item:{id:A,title:w.title,...Xe(w),thumbnail:Ae(w.provider,w.cover),typeBadge:w.type||void 0,chapterBadge:w.latestChapter?`Ch. ${w.latestChapter}`:null,isAdult:He(w)},linkTo:`/manga/${w.provider}/${encodeURIComponent(w.id)}`,hoverIcon:"info",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:$=>N($,{provider:w.provider,mangaId:w.id,title:w.title,altTitle:w.altTitle,cover:w.cover,contentRating:w.contentRating,readTarget:`/manga/${w.provider}/${encodeURIComponent(w.id)}`,mature:t}),onPopupHoverIntent:$=>$?m():g(),rawThumbnail:!0},`${w.provider}-${w.id}`)})}),c&&e(Qe,{data:c.data,anchorRect:c.rect,bookmarked:i.has(Se(c.data.provider,c.data.mangaId)),onToggleBookmark:()=>l({id:c.data.mangaId,provider:c.data.provider,title:c.data.title,cover:c.data.cover,altTitle:c.data.altTitle??void 0,contentRating:c.data.contentRating}),onMouseEnter:m,onMouseLeave:g,onRequestClose:p})]})},In=()=>{const{options:n}=Lt(),s=Q(()=>n.some(c=>c.kind==="manga"),[n]),{hasConsent:h}=rt(),[t,o]=le("manga_discover_tab","latest"),[l,i]=le("manga_trending_sort","popular");return s?e(ie,{children:[e(me,{ariaLabel:"Discover manga",options:[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],value:t,onChange:o}),t==="latest"?e(Ee,{title:"Latest Releases",eyebrow:"Fresh chapters",sort:"latest",mature:h}):e(Ee,{title:"Trending",eyebrow:"Discover",sort:l,mature:h,headerActions:e("select",{className:B["header-select"],value:l,onChange:c=>i(c.currentTarget.value),"aria-label":"Trending sort",children:Cn.map(c=>e("option",{value:c.value,children:c.label},c.value))})})]}):null},An=()=>{const n=J(),{data:s,isLoading:h}=At(24),[t,o]=E(null),{popup:l,openPopup:i,scheduleClose:c,cancelClose:N,closePopup:g}=Ue(),{toggle:m,bookmarkedIds:p}=Ye(),T=s?.data??[];return e("div",{style:{paddingBottom:"2rem"},children:[e(Z,{title:"Continue Reading",eyebrow:"Pick up where you left off",titleLink:"/reading-list/Continue Reading",loading:h,carousel:!0,collapsible:!0,defaultExpanded:T.length>0,highlight:!0,itemCount:T.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(be,{icon:"book",text:"You haven't read anything yet. Browse manga and open a chapter to start tracking.",actionLabel:"Browse Manga",onAction:()=>n("/manga")}),children:T.map(r=>{const S=r.page??0,d=r.pageCount??0,u=r.chapterId&&r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}/read?chapter=${encodeURIComponent(r.chapterId)}`:r.provider?`/manga/${r.provider}/${encodeURIComponent(r.mangaId)}`:"#";return e(ge,{item:{id:r.id,title:r.title||"",...Xe({title:r.title||"",altTitle:r.altTitle}),thumbnail:r.provider?Ae(r.provider,r.cover||""):r.cover||"",chapterBadge:r.chapterNumber?`Ch. ${r.chapterNumber}`:null,isAdult:He(r)},linkTo:u,hoverIcon:"book",progress:d>0?{percent:S/d*100,label:`Ch. ${r.chapterNumber} · p. ${S}/${d}`}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>o({libId:r.id,title:r.title||""}),onOpenDetails:b=>i(b,{provider:r.provider||"",mangaId:r.mangaId||"",title:r.title||"",altTitle:r.altTitle,cover:r.cover||"",contentRating:r.contentRating||void 0,readTarget:u}),onPopupHoverIntent:b=>b?N():c(),rawThumbnail:!0},r.id)})}),e(Ct,{mangaId:t?t.libId:null,title:t?.title,onClose:()=>o(null)}),l&&l.data.provider&&e(Qe,{data:l.data,anchorRect:l.rect,bookmarked:p.has(Se(l.data.provider,l.data.mangaId)),onToggleBookmark:()=>m({id:l.data.mangaId,provider:l.data.provider,title:l.data.title,cover:l.data.cover,altTitle:l.data.altTitle??void 0,contentRating:l.data.contentRating}),onMouseEnter:N,onMouseLeave:c,onRequestClose:g}),e(In,{})]})},Rn="_seasonGrid_knq79_24",X={"section-header":"_section-header_knq79_1","title-wrapper":"_title-wrapper_knq79_8","pagination-controls":"_pagination-controls_knq79_14",seasonGrid:Rn},Ln="_emptyState_bpz5x_1",De={emptyState:Ln},$n=[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],Mn=[{value:"trending_week",label:"Trending Now"},{value:"trending_day",label:"Trending Today"},{value:"popular",label:"Popular All Time"},{value:"top_rated",label:"Top Rated"}],xn=()=>{const n=J(),{data:s,isLoading:h}=xt(24),t=Bt(),o=Pt(),[l,i]=E(null),[c,N]=E(()=>ne.getItem("tv_home_activeTab")||"latest"),[g,m]=E("tv"),[p,T]=E("trending_week"),[r,S]=E("multi"),d=s?.data??[];G.useEffect(()=>{ne.setItem("tv_home_activeTab",c)},[c]);const u=p.startsWith("trending_"),b=p==="trending_day"?"day":"week",k={popular:"popularity.desc",top_rated:"vote_average.desc"},{data:w,isLoading:A}=Ke(r==="multi"?"all":r,b,1,u&&c==="trending"),{data:$,isLoading:R}=xe({type:r,sort_by:k[p]||"popularity.desc",page:1}),C=u?w?.results||[]:$?.results||[],U=u?A:R,{data:x,isLoading:I}=xe({type:g,sort_by:"primary_release_date.desc",page:1}),V=x?.results||[],M=a=>{l&&(o.mutate({mediaId:l.libId}),a&&t.mutate(l.libId))},ee=P(a=>e($t,{item:{id:a.id,title:a.title,year:a.year,type:a.type,image:a.image,vote_average:a.vote_average,adult:a.adult}},`${a.type}-${a.id}`),[]),H=()=>{switch(c){case"latest":return e("section",{children:[e("div",{className:X["section-header"],children:[e("div",{className:X["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Fresh picks"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Latest Releases"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:e(oe,{ariaLabel:"Latest type",value:g,onChange:a=>m(a),options:[{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})})]}),I?e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"var(--space-6)"},children:Array.from({length:7}).map((a,_)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},_))}):V.length>0?e(Z,{carousel:!0,itemCount:V.length,children:V.map(ee)}):e("div",{className:De.emptyState,children:e("p",{children:"No latest releases available right now."})})]});case"trending":return e("section",{children:[e("div",{className:X["section-header"],children:[e("div",{className:X["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"Discover"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Trending"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(oe,{ariaLabel:"Trending sort",value:p,onChange:T,options:Mn.map(a=>({value:a.value,label:a.label}))}),e(oe,{ariaLabel:"Trending type",value:r,onChange:a=>S(a),options:[{value:"multi",label:"All"},{value:"tv",label:"TV Shows"},{value:"movie",label:"Movies"}]})]})]}),U?e("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(150px, 1fr))",gap:"var(--space-6)"},children:Array.from({length:7}).map((a,_)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},_))}):C.length>0?e(Z,{carousel:!0,itemCount:C.length,children:C.map(ee)}):e("div",{className:De.emptyState,children:e("p",{children:"No trending content available right now."})})]})}};return e("div",{style:{paddingBottom:"2rem"},children:[e(Z,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/tv-watchlist/Continue Watching",loading:h,carousel:!0,collapsible:!0,defaultExpanded:d.length>0,highlight:!0,itemCount:d.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(be,{icon:"tv",text:"You haven't watched anything yet. Search TV & Movies and start watching to track progress.",actionLabel:"Browse TV & Movies",onAction:()=>n("/tv-search")}),children:d.map(a=>{const _=a.currentTime??0,y=a.duration??0,D=a.season??1,K=a.episode??1,q=a.mediaType==="movie",j=q?"Movie":`S${D} E${K}`,te=a.completed===1||y>0&&_>=y*.8,ae=te?100:y>0&&_>0?_/y*100:0,fe=te?"Watched":y>0?q?`${re(_)} / ${re(y)}`:`${j} · ${re(_)} / ${re(y)}`:j;return e(ge,{item:{id:a.id,title:a.title||"",thumbnail:a.poster||"",typeBadge:q?"Movie":"TV",chapterBadge:j,isAdult:st({adult:a.adult===1})},linkTo:ot(a.mediaType,a.tmdbId??0,q?void 0:D,q?void 0:K),hoverIcon:"play",progress:(y>0||te)&&ae>0?{percent:ae,label:fe}:void 0,showProgress:!0,metaRow:a.year?e("span",{style:{opacity:.75},children:a.year}):void 0,onRemove:()=>i({libId:a.id,title:a.title||""}),renderPopup:(ye,se)=>e(Mt,{item:{id:a.tmdbId??0,title:a.title||"",year:a.year||"",type:a.mediaType||"tv",image:a.poster||""},anchorRect:ye,onMouseEnter:se.onMouseEnter,onMouseLeave:se.onMouseLeave,onRequestClose:se.close})},a.id)})}),e(me,{ariaLabel:"Browse TV",options:$n,value:c,onChange:N}),e("div",{children:H()}),e(Ge,{isOpen:!!l,itemName:l?.title,progressKind:"watch",listLabel:"my TV watchlist",onClose:()=>{i(null)},onConfirm:M})]})};function Bn(n){const s=n.currentTime??0,h=n.duration??0,t=(n.trackIndex??0)+1;return h>0?`Track ${t} · ${re(s)} / ${re(h)}`:n.trackLabel?`Track ${t} · ${n.trackLabel}`:`Track ${t}`}const Pn=({title:n="Continue Listening",limit:s=24,titleLink:h,showEmptyState:t=!0})=>{const o=J(),{data:l,isLoading:i}=Dt(s),[c,N]=E(null),g=l?.data??[];return e(ie,{children:[e(Z,{title:n,eyebrow:"Pick up where you left off",titleLink:h??"/listening-list/Continue Listening",loading:i,carousel:!0,collapsible:!0,defaultExpanded:g.length>0,highlight:!0,itemCount:g.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"16 / 9"}}),skeletonCount:7,emptyState:t?e(be,{icon:"headphones",text:"You haven't listened to anything yet. Browse ASMR and play a track to start tracking.",actionLabel:"Browse ASMR",onAction:()=>o("/asmr")}):void 0,children:g.map(m=>{const p=m.currentTime??0,T=m.duration??0,r=m.rjCode||m.id;return e(ge,{item:{id:m.id,title:m.title||"",thumbnail:m.thumbnail||"",chapterBadge:`Track ${(m.trackIndex??0)+1}`,isAdult:!!m.isAdult},linkTo:`/asmr/${encodeURIComponent(r)}`,hoverIcon:"play",layout:"horizontal",progress:T>0?{percent:Math.min(100,p/T*100),label:Bn(m)??""}:void 0,showProgress:!0,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0,removeButton:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:()=>N({workId:m.id,title:m.title||""}),rawThumbnail:!0},m.id)})}),e(Et,{workId:c?c.workId:null,title:c?.title,onClose:()=>N(null)})]})},En=()=>e("div",{style:{paddingBottom:"2rem"},children:e(Pn,{})}),Dn=({items:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map(t=>{const o=lt(t.type,t.id);return{key:String(t.id),bannerSrc:t.backdrop?t.backdrop:t.image,posterSrc:t.image,posterAlt:t.title,title:t.title,detailTo:o,score:t.vote_average>0?Number(t.vote_average).toFixed(1):null,metaItems:[t.type==="tv"?"TV Show":"Movie",t.year].filter(Boolean),tags:t.genre_ids.slice(0,3).map(l=>it[l]??ct[l]).filter(Boolean),synopsis:Ce(t.overview,200),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>s(o),onDetails:()=>s(o)}}),[n,s]);return e(_e,{slides:h,eyebrow:"TV Spotlight"})},Wn=({mangaList:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map(t=>{const o=`/manga/${t.provider||"mangadex"}/${t.id}`,l=Ae(t.provider||"mangadex",t.cover||"");return{key:`${t.provider}-${t.id}`,bannerSrc:l,posterSrc:l,posterAlt:t.title,title:t.title,detailTo:o,metaItems:[t.year?String(t.year):void 0,t.status??void 0].filter(i=>!!i),tags:t.tags.slice(0,3),synopsis:Ce(t.description,200,""),primaryLabel:"Read Now",primaryIcon:"book",onPrimary:()=>s(o),onDetails:()=>s(o)}}),[n,s]);return e(_e,{slides:h,eyebrow:"Manga Spotlight"})};function On(n){const s=n.availableEpisodes?.sub;if(typeof s=="number"&&s>0)return s;const h=n.availableEpisodesDetail?.sub,t=n.availableEpisodesDetail?.dub,o=(Array.isArray(h)?h.length:0)+(Array.isArray(t)?t.length:0);return o>0?o:null}const zn=({works:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map((t,o)=>{const l=Wt(t),i=`/asmr/${encodeURIComponent(l)}`,c=On(t);return{key:l||t._id||String(o),bannerSrc:t.thumbnail||"",posterSrc:t.thumbnail||"",posterAlt:t.name,title:t.name,detailTo:i,metaItems:[t.rating?t.rating.toUpperCase():void 0,c?`${c} track${c===1?"":"s"}`:void 0].filter(N=>!!N),tags:[],synopsis:Ce(t.description,160,""),primaryLabel:"Listen Now",primaryIcon:"play",onPrimary:()=>s(i),onDetails:()=>s(i)}}),[n,s]);return e(_e,{slides:h,eyebrow:"ASMR Spotlight",posterAspect:"landscape"})},Vn=[{value:"anime",label:"Anime"},{value:"manga",label:"Manga"},{value:"tv",label:"TV & Movies"},{value:"asmr",label:"ASMR"}],gr=()=>{const n=Nt(),s=dt(),[h,t]=G.useState(1),[o,l]=E(()=>ne.getItem("home_activeTab")||"latest"),[i,c]=E(()=>ne.getItem("season_format")||"TV"),N=F(null),{data:g}=Me(h+1,i,o==="season"),{titlePreference:m}=ze(),{contentType:p,setContentType:T}=ut(),[r,S]=G.useState(null),d=ht(),{data:u=[]}=pt(),b=mt(),k=gt(),w=vt();O(()=>{document.title="Home - dango"},[]);const{data:A,isLoading:$}=_t();O(()=>{ne.setItem("home_activeTab",o)},[o]),O(()=>{ne.setItem("season_format",i),t(1)},[i]),O(()=>{A!==void 0&&A.length===0&&o==="week"&&l("latest")},[A,o]);const{data:R,isLoading:C,fetchNextPage:U,hasNextPage:x,isFetchingNextPage:I}=bt(),V=P(()=>{x&&!I&&!C&&U()},[x,I,C,U]),{data:M,isLoading:ee}=ft(),{data:H,isLoading:a}=Ke("all","week",1,p==="tv"),{data:_,isLoading:y}=Ot(p==="asmr"),{data:D,isLoading:K}=Rt(),q=Q(()=>R?.pages||[],[R]),{data:j,isLoading:te}=Me(h,i,o==="season"),ae=14,fe=j&&j.length>=ae&&g&&g.length>0,ye=Tt(s.continueWatching.remove.mutationOptions({onSuccess:async()=>{n.invalidateQueries(s.continueWatching.pathFilter()),await n.invalidateQueries({queryKey:[Oe.continueWatching]}),x&&q.length-1<14&&U()}})),se=P(W=>{const Y=q?.find(Ne=>String(Ne.id)===String(W));if(Y){const Ne=Y[m]||Y.name;S({id:W,name:Ne})}},[q,m]),Re=[{key:"latest",label:"Latest Releases"},{key:"season",label:"Current Season"},{key:"popular",label:"Trending"}],Le=A!==void 0&&A.length>0,je=Le?[{key:"week",label:"This Week"},...Re]:Re,$e=o==="week"&&!Le?"latest":o,Ze=()=>{switch($e){case"latest":return e(ua,{eyebrow:"Fresh episodes"});case"season":return e("section",{style:{marginBottom:"2.5rem"},children:[e("div",{className:X["section-header"],ref:N,children:[e("div",{className:X["title-wrapper"],children:e("div",{className:"title-stack",children:[e("div",{className:"section-eyebrow",children:"This season"}),e("div",{className:"section-title",style:{marginBottom:0},children:"Current Season"})]})}),e("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[e(oe,{ariaLabel:"Season format",width:90,value:i,onChange:c,options:[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}]}),e("div",{className:X["pagination-controls"],children:e(wt,{page:h,canGoNext:fe,onChange:W=>{if(t(W),N.current){const Y=N.current.getBoundingClientRect().top+window.scrollY-120;window.scrollTo({top:Y,behavior:"smooth"})}},isLoading:te})})]})]}),e("div",{className:`grid-container ${X.seasonGrid}`,style:{minHeight:"300px",alignContent:"start"},children:te?e(Fe,{count:ae}):j?.slice(0,ae).map(W=>e(ce,{anime:W},W._id))})]});case"popular":return e(ia,{title:"Trending",eyebrow:"Discover"});case"week":return e(Be,{title:"This Week",eyebrow:"Aired this week",animeList:A||[],continueWatching:!1,carousel:!0,loading:$});default:return null}};return e("div",{style:{paddingBottom:"2rem"},children:[p==="anime"&&(ee&&!M?.length?e(ue,{}):M&&M.length>0&&e(vn,{animeList:M})),p==="tv"&&(a&&!H?.results?.length?e(ue,{}):H?.results&&H.results.length>0&&e(Dn,{items:H.results})),p==="manga"&&(K&&!D?.length?e(ue,{}):D&&D.length>0&&e(Wn,{mangaList:D})),p==="asmr"&&(y&&!_?.length?e(ue,{}):_&&_.length>0&&e(zn,{works:_})),e(me,{ariaLabel:"Content type",options:Vn,value:p,onChange:T}),p==="manga"?e(An,{}):p==="tv"?e(xn,{}):p==="asmr"?e(En,{}):e(ie,{children:[e(Be,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/watchlist/Continue Watching",animeList:q,continueWatching:!0,carousel:!0,collapsible:!0,defaultExpanded:q.length>0,onRemove:se,loading:C,onReachThreshold:V,scrollThreshold:.7,isFetchingNextPage:I,emptyState:e(be,{icon:"history",text:"You haven't watched anything yet. Start exploring and watch something first!",actionLabel:"Explore Trending",onAction:()=>l("popular")})}),e(kt,{title:"Queue",eyebrow:"Up next",items:u,onRemove:W=>b.mutate({showId:W.showId,episodeNumber:W.episodeNumber}),showClearAll:!0,onClear:()=>k.mutate(),onReorder:W=>w.mutate(W.map(Y=>({id:Y.id,showId:Y.showId,episodeNumber:Y.episodeNumber})))}),e(me,{ariaLabel:"Browse anime",options:je.map(W=>({value:W.key,label:W.label})),value:$e,onChange:l}),e("div",{children:Ze()}),e(Ma,{eyebrow:"Never miss an episode"}),e(Ge,{isOpen:!!r,itemName:r?.name,progressKind:"watch",listLabel:"my watchlist",onClose:()=>{S(null)},onConfirm:W=>{r&&(ye.mutate({showId:r.id}),W&&d.mutate({id:r.id}))}})]})]})};export{gr as default};
@@ -0,0 +1 @@
1
+ import{h as P,T as c,d as O,u as e,L as F}from"./vendor-core-DfaOB3Rn.js";import{b as S,u as A,a as q}from"./vendor-query-BBT5_sHx.js";import{q as _,t as g,ae as V,d as Y,F as L,f as B}from"./index-DbRDs7tF.js";import{I as l}from"./vendor-icons-DrybRNxP.js";const H="_header_1geik_1",E="_fadeIn_1geik_1",U="_personaBadge_1geik_9",z="_personaInfo_1geik_37",K="_personaLabel_1geik_42",Q="_personaValue_1geik_51",j="_statsGrid_1geik_57",J="_slideUpIn_1geik_1",X="_statCard_1geik_65",Z="_statIcon_1geik_82",ee="_statInfo_1geik_98",ae="_statValue_1geik_103",te="_statLabel_1geik_112",se="_wideSection_1geik_120",ne="_sectionHeader_1geik_132",re="_yearSelect_1geik_147",ie="_heatmapLayout_1geik_176",le="_dayLabels_1geik_183",oe="_heatmapWrapper_1geik_195",ce="_heatmapMonthLabels_1geik_201",de="_heatmapGrid_1geik_212",he="_heatBox_1geik_220",me="_hiddenBox_1geik_229",_e="_level0_1geik_240",ge="_level1_1geik_243",pe="_level2_1geik_247",ue="_level3_1geik_251",ke="_level4_1geik_255",Ne="_heatmapFooter_1geik_260",ve="_heatLegend_1geik_267",ye="_chartsContainer_1geik_277",be="_chartWrapper_1geik_285",fe="_hourlyChart_1geik_312",Ce="_hourlyBarContainer_1geik_320",Se="_hourlyBar_1geik_320",Le="_hourlyLabel_1geik_346",Be="_chartSubtext_1geik_353",we="_popScale_1geik_365",Ie="_popTrack_1geik_369",De="_popThumb_1geik_377",xe="_popLabels_1geik_389",Te="_popDescription_1geik_399",Me="_seasonalChart_1geik_414",$e="_seasonalBarContainer_1geik_422",Re="_seasonalBar_1geik_422",Ge="_seasonalLabel_1geik_444",We="_genreList_1geik_452",Pe="_genreRow_1geik_459",Oe="_genreInfo_1geik_465",Fe="_genreName_1geik_472",Ae="_genreCount_1geik_479",qe="_genreBarBg_1geik_486",Ve="_genreBar_1geik_486",Ye="_warningSection_1geik_499",He="_warningHeader_1geik_510",Ee="_droppedGrid_1geik_526",Ue="_droppedCard_1geik_532",ze="_droppedName_1geik_549",Ke="_droppedDate_1geik_556",Qe="_genreGrid_1geik_597",je="_genreCard_1geik_609",Je="_rankBadge_1geik_618",Xe="_rankNumber_1geik_631",Ze="_genreTitle_1geik_637",ea="_genreStats_1geik_645",aa="_posterRow_1geik_653",ta="_miniPoster_1geik_660",sa="_genreCardSkeleton_1geik_674",na="_pulse_1geik_1",ra="_skeletonRank_1geik_682",ia="_skeletonTitle_1geik_696",la="_skeletonStats_1geik_709",oa="_skeletonPosters_1geik_721",ca="_recSection_1geik_752",da="_recSubtext_1geik_763",ha="_recGrid_1geik_769",ma="_recCard_1geik_775",_a="_recCover_1geik_790",ga="_recInfo_1geik_798",pa="_recTitle_1geik_805",ua="_recMatch_1geik_816",ka="_recMeta_1geik_822",Na="_recWhy_1geik_827",va="_recNote_1geik_832",ya="_recAddBtn_1geik_838",ba="_loading_1geik_860",fa="_error_1geik_866",a={header:H,fadeIn:E,personaBadge:U,personaInfo:z,personaLabel:K,personaValue:Q,statsGrid:j,slideUpIn:J,statCard:X,statIcon:Z,statInfo:ee,statValue:ae,statLabel:te,wideSection:se,sectionHeader:ne,yearSelect:re,heatmapLayout:ie,dayLabels:le,heatmapWrapper:oe,heatmapMonthLabels:ce,heatmapGrid:de,heatBox:he,hiddenBox:me,level0:_e,level1:ge,level2:pe,level3:ue,level4:ke,heatmapFooter:Ne,heatLegend:ve,chartsContainer:ye,chartWrapper:be,hourlyChart:fe,hourlyBarContainer:Ce,hourlyBar:Se,hourlyLabel:Le,chartSubtext:Be,popScale:we,popTrack:Ie,popThumb:De,popLabels:xe,popDescription:Te,seasonalChart:Me,seasonalBarContainer:$e,seasonalBar:Re,seasonalLabel:Ge,genreList:We,genreRow:Pe,genreInfo:Oe,genreName:Fe,genreCount:Ae,genreBarBg:qe,genreBar:Ve,warningSection:Ye,warningHeader:He,droppedGrid:Ee,droppedCard:Ue,droppedName:ze,droppedDate:Ke,genreGrid:Qe,genreCard:je,rankBadge:Je,rankNumber:Xe,genreTitle:Ze,genreStats:ea,posterRow:aa,miniPoster:ta,genreCardSkeleton:sa,pulse:na,skeletonRank:ra,skeletonTitle:ia,skeletonStats:la,skeletonPosters:oa,recSection:ca,recSubtext:da,recGrid:ha,recCard:ma,recCover:_a,recInfo:ga,recTitle:pa,recMatch:ua,recMeta:ka,recWhy:Na,recNote:va,recAddBtn:ya,loading:ba,error:fa},wa=()=>{P(()=>{document.title="Insights - dango"},[]);const{data:n,isLoading:w,isError:I}=S({queryKey:[_.insights],queryFn:async()=>await g.insights.summary.query()}),{data:D,isLoading:p}=V(),{titlePreference:x}=Y(),u=A(),{data:k}=S({queryKey:[_.insightsRecommendations],queryFn:async()=>await g.insights.recommendations.query(),staleTime:300*1e3,retry:1}),N=q({mutationFn:async t=>{await g.watchlist.add.mutate({id:String(t.id),name:t.title,thumbnail:t.cover||"",status:"Plan to Watch",type:t.format})},onSuccess:()=>{u.invalidateQueries({queryKey:[_.watchlist]}),u.invalidateQueries({queryKey:[_.insightsRecommendations]}),L.success("Added to Plan to Watch")},onError:()=>L.error("Could not add to watchlist")}),v=c(()=>[...k?.candidates||[]].sort((t,s)=>s.matchPct-t.matchPct).slice(0,6),[k]),y=t=>{const s=t.name||t.englishName||t.nativeName||"";switch(x){case"nativeName":return t.nativeName||s;case"englishName":return t.englishName||s;default:return s}},[d,T]=O(new Date().getFullYear()),M=c(()=>{if(!n?.activityGrid)return[new Date().getFullYear()];const t=new Set(n.activityGrid.map(s=>parseInt(s.day.split("-")[0])));return t.add(new Date().getFullYear()),Array.from(t).sort((s,r)=>r-s)},[n]),b=c(()=>{if(!n?.activityGrid)return[];const t=new Map(n.activityGrid.map(m=>[m.day,m.count])),s=[],r=new Date(d,0,1),o=new Date(d,11,31),h=r.getDay(),i=new Date(r);for(i.setDate(i.getDate()-h);(i<=o||i.getDay()!==0)&&!(i>o&&i.getDay()===0);){const m=i.getFullYear(),G=String(i.getMonth()+1).padStart(2,"0"),W=String(i.getDate()).padStart(2,"0"),f=`${m}-${G}-${W}`,C=i<r||i>o;s.push({date:f,count:C?0:t.get(f)||0,month:i.getMonth(),isOutOfRange:C}),i.setDate(i.getDate()+1)}return s},[n,d]),$=c(()=>n?.seasonality?.length?Math.max(...n.seasonality.map(t=>t.seconds),1):0,[n]),R=c(()=>n?.hourlyDist?.length?Math.max(...n.hourlyDist.map(t=>t.count),1):0,[n]);return w||p?e("div",{className:a.loading,children:"Analyzing your anime lifestyle..."}):I?e("div",{className:a.error,children:"Could not load insights. Data might be syncing."}):n?e("div",{className:"page-container",children:[e("div",{className:a.header,children:[e("h2",{className:"section-title",children:"Watch Insights"}),e("div",{className:a.personaBadge,children:[e(l,{name:"user-astronaut"}),e("div",{className:a.personaInfo,children:[e("span",{className:a.personaLabel,children:"Your Persona"}),e("span",{className:a.personaValue,children:n.persona})]})]})]}),e("div",{className:a.statsGrid,children:[e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(138, 79, 255, 0.2)",color:"var(--accent)"},children:e(l,{name:"clock"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.totalHours,"h"]}),e("span",{className:a.statLabel,children:"Watch Time"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(167, 139, 250, 0.2)",color:"#a78bfa"},children:e(l,{name:"bookmark"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalAnime}),e("span",{className:a.statLabel,children:"Total Anime"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(l,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.totalEpisodes}),e("span",{className:a.statLabel,children:"Episodes Watched"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(34, 197, 94, 0.2)",color:"#22c55e"},children:e(l,{name:"check-circle"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.completionRate,"%"]}),e("span",{className:a.statLabel,children:"Completion Rate"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(45, 212, 191, 0.2)",color:"#2dd4bf"},children:e(l,{name:"tv"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.completedAnime}),e("span",{className:a.statLabel,children:"Completed Shows"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(239, 68, 68, 0.2)",color:"#ef4444"},children:e(l,{name:"fire"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:n.bingeFactor}),e("span",{className:a.statLabel,children:"Max Daily Binge"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(59, 130, 246, 0.2)",color:"#3b82f6"},children:e(l,{name:"history"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgSessionMinutes,"m"]}),e("span",{className:a.statLabel,children:"Avg. Session"})]})]}),e("div",{className:a.statCard,children:[e("div",{className:a.statIcon,style:{background:"rgba(251, 191, 36, 0.2)",color:"#fbbf24"},children:e(l,{name:"layer-group"})}),e("div",{className:a.statInfo,children:[e("span",{className:a.statValue,children:[n.avgCompletionDays,"d"]}),e("span",{className:a.statLabel,children:"Avg. Speed"})]})]})]}),e("div",{className:a.wideSection,children:[e("div",{className:a.sectionHeader,children:[e("h3",{children:"Activity"}),e("select",{className:a.yearSelect,value:d,onChange:t=>T(Number(t.currentTarget.value)),children:M.map(t=>e("option",{value:t,children:t},t))})]}),e("div",{className:a.heatmapLayout,children:[e("div",{className:a.dayLabels,children:[e("span",{style:{gridRow:2},children:"Mon"}),e("span",{style:{gridRow:4},children:"Wed"}),e("span",{style:{gridRow:6},children:"Fri"})]}),e("div",{className:a.heatmapWrapper,children:[e("div",{className:a.heatmapMonthLabels,children:(()=>{const t=[];let s=-1;return b.forEach((r,o)=>{if(r.month!==s&&!r.isOutOfRange){const h=Math.floor(o/7)+1;h>(t.length>0?t[t.length-1].props.style?.gridColumn+2:-1)&&(t.push(e("span",{style:{gridColumn:h,whiteSpace:"nowrap"},children:new Date(0,r.month).toLocaleString("default",{month:"short"})},o)),s=r.month)}}),t})()}),e("div",{className:a.heatmapGrid,children:b.map((t,s)=>{let r=0;return t.count>0&&!t.isOutOfRange&&(r=1),t.count>2&&!t.isOutOfRange&&(r=2),t.count>5&&!t.isOutOfRange&&(r=3),t.count>10&&!t.isOutOfRange&&(r=4),e("div",{className:`${a.heatBox} ${a[`level${r}`]} ${t.isOutOfRange?a.hiddenBox:""}`,title:t.isOutOfRange?"":`${t.count} episodes on ${t.date}`},s)})}),e("div",{className:a.heatmapFooter,children:e("div",{className:a.heatLegend,children:[e("span",{children:"Less"}),e("div",{className:`${a.heatBox} ${a.level0}`}),e("div",{className:`${a.heatBox} ${a.level1}`}),e("div",{className:`${a.heatBox} ${a.level2}`}),e("div",{className:`${a.heatBox} ${a.level3}`}),e("div",{className:`${a.heatBox} ${a.level4}`}),e("span",{children:"More"})]})})]})]})]}),e("div",{className:a.chartsContainer,children:[e("div",{className:a.chartWrapper,children:[e("h3",{children:"Time Distribution (24h)"}),e("div",{className:a.hourlyChart,children:n.hourlyDist?.map((t,s)=>e("div",{className:a.hourlyBarContainer,children:[e("div",{className:a.hourlyBar,style:{height:`${t.count/R*100||2}%`,width:"100%",maxWidth:"12px"},title:`${t.count} watches at ${t.hour}:00`}),e("span",{className:a.hourlyLabel,style:{visibility:s%4===0?"visible":"hidden"},children:t.hour})]},s))}),e("div",{className:a.chartSubtext,children:(()=>{if(!n.hourlyDist?.length)return"Watch more to see your peak hours!";const t=parseInt([...n.hourlyDist].sort((s,r)=>r.count-s.count)[0].hour);return t>=6&&t<19?"You prefer daytime watching ☀️":"You're a confirmed Night Owl 🦉"})()})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Popularity Bias"}),e("div",{className:a.popScale,children:[e("div",{className:a.popTrack,children:e("div",{className:a.popThumb,style:{left:`${Math.max(0,Math.min(100,100-n.popularityScore*10))}%`}})}),e("div",{className:a.popLabels,children:[e("span",{children:"Mainstream"}),e("span",{children:"Underground"})]})]}),e("p",{className:a.popDescription,children:["Your taste score is ",e("strong",{children:[n.popularityScore,"/10"]}),".",n.popularityScore>=5?" You follow the big hits!":" You're a connoisseur of the obscure!"]})]}),e("div",{className:a.chartWrapper,children:[e("h3",{children:"Monthly Activity"}),e("div",{className:a.seasonalChart,children:n.seasonality?.map((t,s)=>e("div",{className:a.seasonalBarContainer,children:[e("div",{className:a.seasonalBar,style:{height:`${t.seconds/$*100||5}%`,width:"100%",maxWidth:"24px"},title:`${Math.round(t.seconds/3600)}h in ${new Date(0,s).toLocaleString("default",{month:"long"})}`}),e("span",{className:a.seasonalLabel,children:new Date(0,s).toLocaleString("default",{month:"short"})})]},s))})]})]}),e("div",{className:a.genreGrid,children:p?Array.from({length:4}).map((t,s)=>e("div",{className:a.genreCardSkeleton,children:[e("div",{className:a.skeletonRank}),e("div",{className:a.skeletonTitle}),e("div",{className:a.skeletonStats}),e("div",{className:a.skeletonPosters})]},s)):D?.map(t=>e("div",{className:a.genreCard,children:[e("div",{className:a.rankBadge,children:e("span",{className:a.rankNumber,children:t.rank})}),e("h3",{className:a.genreTitle,children:t.name}),e("div",{className:a.genreStats,children:[e("span",{children:[t.count," episodes"]}),e("span",{children:t.meanScore>0?`${t.meanScore.toFixed(1)} avg score`:"-"}),e("span",{children:t.timeWatched})]}),e("div",{className:a.posterRow,children:t.topShows.map(s=>e("img",{src:B(s.thumbnail),alt:y(s),className:a.miniPoster,title:y(s),loading:"lazy",decoding:"async"},s.id))})]},t.name))}),v.length>0&&e("div",{className:a.recSection,children:[e("h3",{children:"Recommended For You"}),e("p",{className:a.recSubtext,children:"From your library taste - updates automatically as you watch"}),e("div",{className:a.recGrid,children:v.map(t=>e("div",{className:a.recCard,children:[t.cover&&e("img",{src:B(t.cover),alt:t.title,className:a.recCover,loading:"lazy",decoding:"async"}),e("div",{className:a.recInfo,children:[e(F,{to:`/anime/${t.id}`,className:a.recTitle,children:t.title}),e("span",{className:a.recMatch,children:[t.matchPct,"% match"]}),e("span",{className:a.recMeta,children:[t.year,t.format,t.episodes?`${t.episodes}ep`:null].filter(Boolean).join(" · ")}),e("span",{className:a.recWhy,children:["Shares ",t.sharedGenres.join(", "),t.exemplars.length>0&&` - like ${t.exemplars.join(", ")}`]}),t.kind==="continue"&&e("span",{className:a.recNote,children:"Continue - you watched the earlier part."}),t.kind==="sequel"&&t.prequelTitle&&e("span",{className:a.recNote,children:['Sequel - start with "',t.prequelTitle,'" first.']}),e("button",{className:a.recAddBtn,onClick:()=>N.mutate(t),disabled:N.isPending,children:"+ Plan to Watch"})]})]},t.id))})]}),n.droppedShows?.length>0&&e("div",{className:a.warningSection,children:[e("div",{className:a.warningHeader,children:[e(l,{name:"exclamation-triangle"}),e("h3",{children:"Dusty Watchlist (Inactive 90+ days)"})]}),e("div",{className:a.droppedGrid,children:n.droppedShows.map(t=>e("div",{className:a.droppedCard,children:[e("span",{className:a.droppedName,children:t.name}),e("span",{className:a.droppedDate,children:["Last watched: ",new Date(t.lastActivity).toLocaleDateString()]})]},t.id))})]})]}):null};export{wa as default};
@@ -1 +1 @@
1
- import{a as ie,d as N,h as re,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as h}from"./vendor-icons-DrybRNxP.js";import{P as E}from"./MediaCard-DJNRuWDJ.js";import{S as de}from"./SkeletonGrid-sA6_IQY1.js";import{E as oe}from"./ErrorMessage-DAxegITP.js";import{C as me,D as he,M as k,B as q}from"./index-vb4WPdcb.js";import{s as l}from"./LibraryListPage.module-r6k9nyT9.js";function be({headerTitle:H,headerSubtitle:O,filters:U,filterBy:r,filterBasePath:V,continueFilter:W,statusOptions:$,entries:d,total:o,isLoading:f,error:A,page:M,pageSize:u,onPageChange:I,emptyTitle:Y,emptyFilteredText:j,emptyAllText:F,browseLabel:J,browseTarget:Q,removeListLabel:w,listNoun:S,skipConfirmKey:x,onBulkStatus:X,onBulkRemove:B,onStatusChange:Z,onRemoveItem:R,renderCard:_,modals:K}){const z=ie(),[g,T]=N(!1),[t,i]=N(new Set),[n,p]=N(null),[P,b]=N(!1),{data:y}=me(x),L=he();re(()=>{i(new Set),T(!1)},[r]);const m=r===W,D=String(y)==="true"||String(y)==="1",ee=()=>{T(a=>(a&&i(new Set),!a))},ae=a=>{i(s=>{const c=new Set(s);return c.has(a)?c.delete(a):c.add(a),c})},v=d.map(a=>a.libId),C=v.length>0&&v.every(a=>t.has(a)),le=()=>{i(a=>{const s=new Set(a);if(C)for(const c of v)s.delete(c);else for(const c of v)s.add(c);return s})},te=a=>{t.size!==0&&(X([...t],a),i(new Set))},se=()=>{t.size!==0&&(m||D?(B([...t]),i(new Set)):p({ids:[...t]}))},ne=a=>{m||D?R(a.libId):p({ids:[a.libId],title:a.title})},ce=()=>{n&&(P&&L.mutate({key:x,value:!0}),n.ids.length===1?R(n.ids[0]):B(n.ids),i(new Set),p(null),b(!1))},G=()=>{p(null),b(!1)};return e("div",{className:"page-container",children:[e("header",{className:l.header,children:[e("h2",{className:l.title,children:H}),e("p",{className:l.subtitle,children:O})]}),e("div",{className:l.controls,children:e("div",{className:l.filters,children:U.map(a=>e("button",{className:`${l.filterBtn} ${r===a?l.active:""}`,onClick:()=>z(`${V}/${a==="All"?"":a}`),children:a},a))})}),e("div",{className:l.resultsHeader,children:[e("h3",{className:l.resultsTitle,children:[r,e("span",{className:l.itemCount,children:["(",o," items)"]})]}),e("div",{className:l.headerActions,children:[e("button",{className:`${l.manageBtn} ${g?l.active:""}`,onClick:ee,children:[e(h,{name:"pencil-alt",size:13}),e("span",{children:"Bulk Manage"})]}),o>0&&e(E,{page:M,totalPages:Math.max(1,Math.ceil(o/u)),canGoNext:d.length>=u,onChange:I,isLoading:f})]})]}),g&&e("div",{className:l.manageBar,children:[e("button",{className:l.selectAllBtn,onClick:le,children:[e("span",{className:`${l.selectAllBox} ${C?l.selectAllBoxChecked:""}`,"aria-hidden":"true"}),e("span",{children:C?"Clear Page":"Select All"})]}),e("span",{className:l.manageCount,children:[t.size," selected"]}),e("div",{className:l.manageSpacer}),!m&&e("select",{className:l.manageStatusSelect,value:"",onChange:a=>{a.currentTarget.value&&te(a.currentTarget.value)},disabled:t.size===0,title:"Set status for selected items",children:[e("option",{value:"",children:"Set status…"}),$.map(a=>e("option",{value:a,children:a},a))]}),e("button",{className:l.manageRemoveBtn,onClick:se,disabled:t.size===0,children:[e(h,{name:"trash",size:13}),e("span",{children:m?"Reset Selected":"Remove Selected"})]})]}),f?e(de,{}):A?e(oe,{message:A.message}):d.length===0?e("div",{className:l.emptyState,children:[e("h3",{className:l.emptyTitle,children:Y}),e("p",{className:l.emptyText,children:r!=="All"?j:F}),e("button",{className:l.emptyBtn,onClick:()=>z(Q),children:[e(h,{name:"search",size:14}),e("span",{children:J})]})]}):e("div",{className:l.grid,children:d.map(a=>e("div",{className:`${l.itemWrapper} ${t.has(a.libId)?l.selected:""}`,children:[g&&e("div",{className:l.selectOverlay,onClick:()=>ae(a.libId),title:t.has(a.libId)?"Deselect":"Select",children:e("span",{className:l.selectBadge,children:t.has(a.libId)?e(h,{name:"check",size:12}):null})}),_(a),!m&&!g&&e("div",{className:l.cardActions,children:[e("select",{className:l.statusSelect,value:a.status,onChange:s=>Z(a.libId,s.currentTarget.value),children:$.map(s=>e("option",{value:s,children:s},s))}),e("button",{className:l.removeBtn,onClick:()=>ne(a),title:w,"aria-label":w,children:e(h,{name:"trash",size:12})})]})]},a.key))}),o>0&&e("div",{className:l.bottomPagination,children:e(E,{page:M,totalPages:Math.max(1,Math.ceil(o/u)),canGoNext:d.length>=u,onChange:I,isLoading:f,variant:"labeled"})}),K,e(k,{isOpen:!!n,onClose:G,title:`Remove from ${S}`,children:[e(k.Body,{children:[e("p",{children:n&&n.ids.length===1?`Are you sure you want to remove "${n.title}" from your ${S}?`:`Are you sure you want to remove ${n?.ids.length??0} selected items from your ${S}?`}),e("label",{children:[e("input",{type:"checkbox",checked:P,onChange:a=>b(a.currentTarget.checked)}),"Don't ask again"]})]}),e(k.Actions,{children:[e(q,{variant:"secondary",onClick:G,children:"No"}),e(q,{variant:"danger",onClick:ce,children:"Yes"})]})]})]})}export{be as L};
1
+ import{a as ie,d as N,h as re,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as h}from"./vendor-icons-DrybRNxP.js";import{P as E}from"./MediaCard-ChUKs5Sb.js";import{S as de}from"./SkeletonGrid-BO0am1za.js";import{E as oe}from"./ErrorMessage-DAxegITP.js";import{G as me,H as he,L as C,B as H}from"./index-DbRDs7tF.js";import{s as l}from"./LibraryListPage.module-r6k9nyT9.js";function be({headerTitle:q,headerSubtitle:O,filters:U,filterBy:r,filterBasePath:V,continueFilter:W,statusOptions:$,entries:d,total:o,isLoading:f,error:A,page:I,pageSize:u,onPageChange:M,emptyTitle:Y,emptyFilteredText:j,emptyAllText:F,browseLabel:J,browseTarget:L,removeListLabel:w,listNoun:S,skipConfirmKey:x,onBulkStatus:Q,onBulkRemove:B,onStatusChange:X,onRemoveItem:R,renderCard:Z,modals:_}){const z=ie(),[g,T]=N(!1),[t,i]=N(new Set),[n,p]=N(null),[P,b]=N(!1),{data:y}=me(x),K=he();re(()=>{i(new Set),T(!1)},[r]);const m=r===W,G=String(y)==="true"||String(y)==="1",ee=()=>{T(a=>(a&&i(new Set),!a))},ae=a=>{i(s=>{const c=new Set(s);return c.has(a)?c.delete(a):c.add(a),c})},v=d.map(a=>a.libId),k=v.length>0&&v.every(a=>t.has(a)),le=()=>{i(a=>{const s=new Set(a);if(k)for(const c of v)s.delete(c);else for(const c of v)s.add(c);return s})},te=a=>{t.size!==0&&(Q([...t],a),i(new Set))},se=()=>{t.size!==0&&(m||G?(B([...t]),i(new Set)):p({ids:[...t]}))},ne=a=>{m||G?R(a.libId):p({ids:[a.libId],title:a.title})},ce=()=>{n&&(P&&K.mutate({key:x,value:!0}),n.ids.length===1?R(n.ids[0]):B(n.ids),i(new Set),p(null),b(!1))},D=()=>{p(null),b(!1)};return e("div",{className:"page-container",children:[e("header",{className:l.header,children:[e("h2",{className:l.title,children:q}),e("p",{className:l.subtitle,children:O})]}),e("div",{className:l.controls,children:e("div",{className:l.filters,children:U.map(a=>e("button",{className:`${l.filterBtn} ${r===a?l.active:""}`,onClick:()=>z(`${V}/${a==="All"?"":a}`),children:a},a))})}),e("div",{className:l.resultsHeader,children:[e("h3",{className:l.resultsTitle,children:[r,e("span",{className:l.itemCount,children:["(",o," items)"]})]}),e("div",{className:l.headerActions,children:[e("button",{className:`${l.manageBtn} ${g?l.active:""}`,onClick:ee,children:[e(h,{name:"pencil-alt",size:13}),e("span",{children:"Bulk Manage"})]}),o>0&&e(E,{page:I,totalPages:Math.max(1,Math.ceil(o/u)),canGoNext:d.length>=u,onChange:M,isLoading:f})]})]}),g&&e("div",{className:l.manageBar,children:[e("button",{className:l.selectAllBtn,onClick:le,children:[e("span",{className:`${l.selectAllBox} ${k?l.selectAllBoxChecked:""}`,"aria-hidden":"true"}),e("span",{children:k?"Clear Page":"Select All"})]}),e("span",{className:l.manageCount,children:[t.size," selected"]}),e("div",{className:l.manageSpacer}),!m&&e("select",{className:l.manageStatusSelect,value:"",onChange:a=>{a.currentTarget.value&&te(a.currentTarget.value)},disabled:t.size===0,title:"Set status for selected items",children:[e("option",{value:"",children:"Set status…"}),$.map(a=>e("option",{value:a,children:a},a))]}),e("button",{className:l.manageRemoveBtn,onClick:se,disabled:t.size===0,children:[e(h,{name:"trash",size:13}),e("span",{children:m?"Reset Selected":"Remove Selected"})]})]}),f?e(de,{}):A?e(oe,{message:A.message}):d.length===0?e("div",{className:l.emptyState,children:[e("h3",{className:l.emptyTitle,children:Y}),e("p",{className:l.emptyText,children:r!=="All"?j:F}),e("button",{className:l.emptyBtn,onClick:()=>z(L),children:[e(h,{name:"search",size:14}),e("span",{children:J})]})]}):e("div",{className:l.grid,children:d.map(a=>e("div",{className:`${l.itemWrapper} ${t.has(a.libId)?l.selected:""}`,children:[g&&e("div",{className:l.selectOverlay,onClick:()=>ae(a.libId),title:t.has(a.libId)?"Deselect":"Select",children:e("span",{className:l.selectBadge,children:t.has(a.libId)?e(h,{name:"check",size:12}):null})}),Z(a),!m&&!g&&e("div",{className:l.cardActions,children:[e("select",{className:l.statusSelect,value:a.status,onChange:s=>X(a.libId,s.currentTarget.value),children:$.map(s=>e("option",{value:s,children:s},s))}),e("button",{className:l.removeBtn,onClick:()=>ne(a),title:w,"aria-label":w,children:e(h,{name:"trash",size:12})})]})]},a.key))}),o>0&&e("div",{className:l.bottomPagination,children:e(E,{page:I,totalPages:Math.max(1,Math.ceil(o/u)),canGoNext:d.length>=u,onChange:M,isLoading:f,variant:"labeled"})}),_,e(C,{isOpen:!!n,onClose:D,title:`Remove from ${S}`,children:[e(C.Body,{children:[e("p",{children:n&&n.ids.length===1?`Are you sure you want to remove "${n.title}" from your ${S}?`:`Are you sure you want to remove ${n?.ids.length??0} selected items from your ${S}?`}),e("label",{children:[e("input",{type:"checkbox",checked:P,onChange:a=>b(a.currentTarget.checked)}),"Don't ask again"]})]}),e(C.Actions,{children:[e(H,{variant:"secondary",onClick:D,children:"No"}),e(H,{variant:"danger",onClick:ce,children:"Yes"})]})]})]})}export{be as L};
@@ -1 +1 @@
1
- import{o as U,d as k,h as L,T as E,u,S as y}from"./vendor-core-DfaOB3Rn.js";import{M as F}from"./MediaCard-DJNRuWDJ.js";import{L as N}from"./LibraryListPage-CJxNJYC3.js";import{u as _,A as q}from"./useAsmrPopup-DViHcQnO.js";import{A as z}from"./AsmrResetProgressModal-NKywttOY.js";import{g as h}from"./index-vb4WPdcb.js";import{m as O,u as Q,n as Y,o as D,e as G,p as H,q as K,r as Z,A as T,k as J}from"./useAsmr-XBCV7iDw.js";import"./vendor-icons-DrybRNxP.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-DLVOORqW.js";import"./SkeletonGrid-sA6_IQY1.js";import"./ErrorMessage-DAxegITP.js";import"./LibraryListPage.module-r6k9nyT9.js";import"./usePopup-DS9jMzp6.js";import"./ResetProgressModal-Dq-B23o_.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-2sAPXNhJ.js";const V=["All","Continue Listening",...T],A=24;function W(a){const d=a.currentTime??0,i=a.duration??0,r=(a.trackIndex??0)+1;return i>0?`Track ${r} · ${h(d)} / ${h(i)}`:`Track ${r}`}function Lt(){const{filter:a="All"}=U(),[d,i]=k(1),[r,m]=k(null);L(()=>{document.title="Listening List - dango"},[]),L(()=>{i(1)},[a]);const o=a==="Continue Listening",n=O(o?"All":a,d,A),l=Q(100),f=Y(),C=D(),{toggle:v,bookmarkedIds:R}=G(),{popup:s,openPopup:I,scheduleClose:c,cancelClose:p,closePopup:B}=_(),P=H(),S=K(),j=Z(),M=E(()=>o?(l.data?.data??[]).map(t=>{const e=t.currentTime??0,g=t.duration??0,b=t.rjCode||t.id;return{key:t.id,libId:t.id,rjCode:b,title:t.title||"",thumbnail:t.thumbnail||"",status:t.watchlistStatus??"",isAdult:!!t.isAdult,trackLabel:`Track ${(t.trackIndex??0)+1}`,progressPercent:g>0?Math.min(100,e/g*100):0,progressLabel:W(t),detailTarget:`/asmr/${encodeURIComponent(b)}`}}):(n.data?.data??[]).map(t=>{const e=t.rjCode||t.id;return{key:t.id,libId:t.id,rjCode:e,title:t.title,thumbnail:t.thumbnail||"",status:t.status,isAdult:!!t.isAdult,trackLabel:t.lastTrackIndex!==null&&t.lastTrackIndex!==void 0?`Track ${t.lastTrackIndex+1}`:void 0,progressPercent:void 0,progressLabel:void 0,detailTarget:`/asmr/${encodeURIComponent(e)}`}}),[o,l.data,n.data]),w=o?l.data?.total??0:n.data?.total??0,x=o?l.isLoading:n.isLoading,$=o?l.error:n.error;return u(N,{headerTitle:"My Listening List",headerSubtitle:"Track and manage your ASMR collection",filters:V,filterBy:a,filterBasePath:"/listening-list",continueFilter:"Continue Listening",statusOptions:[...T],entries:M,total:w,isLoading:x,error:$,page:d,pageSize:A,onPageChange:i,emptyTitle:"Your listening list is looking a bit lonely",emptyFilteredText:"No works match this filter.",emptyAllText:"Let's find something to listen to!",browseLabel:"Browse ASMR",browseTarget:"/asmr",removeListLabel:"Remove from Listening List",listNoun:"listening list",skipConfirmKey:"asmrSkipRemoveConfirmation",onBulkStatus:(t,e)=>P.mutate({ids:t,status:e}),onBulkRemove:t=>{o?j.mutate({ids:t}):S.mutate({ids:t})},onStatusChange:(t,e)=>C.mutate({id:t,status:e}),onRemoveItem:t=>f.mutate({id:t}),renderCard:t=>u(F,{item:{id:t.libId,title:t.title,thumbnail:t.thumbnail,typeBadge:t.rjCode||void 0,chapterBadge:t.trackLabel??null,isAdult:t.isAdult},linkTo:t.detailTarget,hoverIcon:"info",layout:"horizontal",showInfoButton:!o,progress:t.progressPercent!==void 0&&t.progressLabel?{percent:t.progressPercent,label:t.progressLabel}:void 0,showProgress:o,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:o?()=>m(t):void 0,onOpenDetails:o?void 0:e=>I(e,{rjCode:t.rjCode,title:t.title,thumbnail:t.thumbnail,isAdult:t.isAdult,listenTarget:t.detailTarget,progressLabel:t.progressLabel}),onPopupHoverIntent:e=>e?p():c(),rawThumbnail:!0}),modals:u(y,{children:[u(z,{workId:r?r.libId:null,title:r?.title,onClose:()=>m(null)}),s&&u(q,{data:s.data,anchorRect:s.rect,bookmarked:R.has(J(s.data.rjCode)),onToggleBookmark:()=>v({rjCode:s.data.rjCode,title:s.data.title,thumbnail:s.data.thumbnail||"",isAdult:s.data.isAdult}),onMouseEnter:p,onMouseLeave:c,onRequestClose:B})]})})}export{Lt as default};
1
+ import{o as U,d as k,h as L,T as E,u,S as y}from"./vendor-core-DfaOB3Rn.js";import{M as F}from"./MediaCard-ChUKs5Sb.js";import{L as N}from"./LibraryListPage-CV2FpbUe.js";import{u as _,A as q}from"./useAsmrPopup-S_XfgKDh.js";import{A as z}from"./AsmrResetProgressModal-73jUOcAL.js";import{g as h}from"./index-DbRDs7tF.js";import{m as O,u as Q,n as Y,o as D,e as G,p as H,q as K,r as Z,A as T,k as J}from"./useAsmr-DO5DUI_t.js";import"./vendor-icons-DrybRNxP.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-DiWSp3Of.js";import"./SkeletonGrid-BO0am1za.js";import"./ErrorMessage-DAxegITP.js";import"./LibraryListPage.module-r6k9nyT9.js";import"./usePopup-DS9jMzp6.js";import"./ResetProgressModal-DtUE-wCy.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-cJ1WjrJq.js";const V=["All","Continue Listening",...T],A=24;function W(a){const d=a.currentTime??0,i=a.duration??0,r=(a.trackIndex??0)+1;return i>0?`Track ${r} · ${h(d)} / ${h(i)}`:`Track ${r}`}function Lt(){const{filter:a="All"}=U(),[d,i]=k(1),[r,m]=k(null);L(()=>{document.title="Listening List - dango"},[]),L(()=>{i(1)},[a]);const o=a==="Continue Listening",n=O(o?"All":a,d,A),l=Q(100),f=Y(),C=D(),{toggle:v,bookmarkedIds:R}=G(),{popup:s,openPopup:I,scheduleClose:c,cancelClose:p,closePopup:B}=_(),P=H(),S=K(),j=Z(),M=E(()=>o?(l.data?.data??[]).map(t=>{const e=t.currentTime??0,g=t.duration??0,b=t.rjCode||t.id;return{key:t.id,libId:t.id,rjCode:b,title:t.title||"",thumbnail:t.thumbnail||"",status:t.watchlistStatus??"",isAdult:!!t.isAdult,trackLabel:`Track ${(t.trackIndex??0)+1}`,progressPercent:g>0?Math.min(100,e/g*100):0,progressLabel:W(t),detailTarget:`/asmr/${encodeURIComponent(b)}`}}):(n.data?.data??[]).map(t=>{const e=t.rjCode||t.id;return{key:t.id,libId:t.id,rjCode:e,title:t.title,thumbnail:t.thumbnail||"",status:t.status,isAdult:!!t.isAdult,trackLabel:t.lastTrackIndex!==null&&t.lastTrackIndex!==void 0?`Track ${t.lastTrackIndex+1}`:void 0,progressPercent:void 0,progressLabel:void 0,detailTarget:`/asmr/${encodeURIComponent(e)}`}}),[o,l.data,n.data]),w=o?l.data?.total??0:n.data?.total??0,x=o?l.isLoading:n.isLoading,$=o?l.error:n.error;return u(N,{headerTitle:"My Listening List",headerSubtitle:"Track and manage your ASMR collection",filters:V,filterBy:a,filterBasePath:"/listening-list",continueFilter:"Continue Listening",statusOptions:[...T],entries:M,total:w,isLoading:x,error:$,page:d,pageSize:A,onPageChange:i,emptyTitle:"Your listening list is looking a bit lonely",emptyFilteredText:"No works match this filter.",emptyAllText:"Let's find something to listen to!",browseLabel:"Browse ASMR",browseTarget:"/asmr",removeListLabel:"Remove from Listening List",listNoun:"listening list",skipConfirmKey:"asmrSkipRemoveConfirmation",onBulkStatus:(t,e)=>P.mutate({ids:t,status:e}),onBulkRemove:t=>{o?j.mutate({ids:t}):S.mutate({ids:t})},onStatusChange:(t,e)=>C.mutate({id:t,status:e}),onRemoveItem:t=>f.mutate({id:t}),renderCard:t=>u(F,{item:{id:t.libId,title:t.title,thumbnail:t.thumbnail,typeBadge:t.rjCode||void 0,chapterBadge:t.trackLabel??null,isAdult:t.isAdult},linkTo:t.detailTarget,hoverIcon:"info",layout:"horizontal",showInfoButton:!o,progress:t.progressPercent!==void 0&&t.progressLabel?{percent:t.progressPercent,label:t.progressLabel}:void 0,showProgress:o,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:o?()=>m(t):void 0,onOpenDetails:o?void 0:e=>I(e,{rjCode:t.rjCode,title:t.title,thumbnail:t.thumbnail,isAdult:t.isAdult,listenTarget:t.detailTarget,progressLabel:t.progressLabel}),onPopupHoverIntent:e=>e?p():c(),rawThumbnail:!0}),modals:u(y,{children:[u(z,{workId:r?r.libId:null,title:r?.title,onClose:()=>m(null)}),s&&u(q,{data:s.data,anchorRect:s.rect,bookmarked:R.has(J(s.data.rjCode)),onToggleBookmark:()=>v({rjCode:s.data.rjCode,title:s.data.title,thumbnail:s.data.thumbnail||"",isAdult:s.data.isAdult}),onMouseEnter:p,onMouseLeave:c,onRequestClose:B})]})})}export{Lt as default};
@@ -0,0 +1 @@
1
+ import{p as le,d as O,T as re,h as U,u as a,m as ne,S as q}from"./vendor-core-DfaOB3Rn.js";import{I as M}from"./vendor-icons-DrybRNxP.js";import{T as se}from"./ToggleSwitch-CN_ppEc9.js";import{M as oe}from"./MatureConsentModal-DiWSp3Of.js";import{E as ie}from"./ErrorMessage-DAxegITP.js";import{M as ce,P as de}from"./MediaCard-ChUKs5Sb.js";import{u as ue,M as ge}from"./useMangaPopup-B4ntcNg0.js";import{e as pe,a5 as he}from"./index-DbRDs7tF.js";import{f as me,u as ve,m as D,i as be,b as fe,c as Se}from"./useMangaLibrary-B4ZJLZXD.js";import{u as Te}from"./useProviders-Bnw0sBAP.js";import{s as l}from"./Manga.module-depGEacJ.js";import{p as c}from"./page.module-C1MlZzf3.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./usePopup-DS9jMzp6.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-cJ1WjrJq.js";const ye=[{value:"popular",label:"Popular"},{value:"latest",label:"Latest"},{value:"rating",label:"Top Rated"},{value:"followed",label:"Most Followed"}],Me=[{value:"",label:"Any Status"},{value:"ongoing",label:"Ongoing"},{value:"completed",label:"Completed"},{value:"hiatus",label:"Hiatus"},{value:"cancelled",label:"Cancelled"}],Ne=[{value:"",label:"Any Status"},{value:"publishing",label:"Publishing"},{value:"finished",label:"Finished"},{value:"on hiatus",label:"On Hiatus"},{value:"discontinued",label:"Discontinued"}],Ce=[{value:"",label:"All Types"},{value:"manga",label:"Manga"},{value:"novel",label:"Novel"},{value:"one-shot",label:"One-Shot"},{value:"doujinshi",label:"Doujinshi"}],Pe=[{value:"safe",label:"Safe"}],Ie=[{value:"safe",label:"Safe"},{value:"suggestive",label:"Suggestive"},{value:"erotica",label:"Erotica"},{value:"pornographic",label:"Pornographic"}];function He(){const[n,N]=le(),{hasConsent:v,grant:_}=pe(),[j,b]=O(!1),[C,P]=O(n.get("q")||""),{options:I,isLoading:R,refetch:G}=Te(),d=re(()=>I.filter(e=>e.kind==="manga").map(e=>({value:e.id,label:e.label})),[I]),f=n.get("provider")||"",S=f&&d.some(e=>e.value===f)?f:"",T=n.get("q")||"",L=parseInt(n.get("page")||"1"),$=n.get("sort")||"popular",k=n.get("status")||"",w=n.get("type")||"",u=n.get("rating")||"safe",A=n.get("id")||"";U(()=>{document.title="Manga - dango"},[]);const o=v,y=o?u:"safe",H=o?Ie:Pe,i=(e,t=!1)=>{const r=new URLSearchParams(n);for(const[m,E]of Object.entries(e))E?r.set(m,E):r.delete(m);t&&r.delete("page"),N(r)},g=me({provider:S,query:T,page:L,sort:$,status:k,type:w,rating:y,mature:o}),h=g.data?.items??[],z=g.data?.hasNext??!1,p=S||h[0]?.provider||"",{toggle:V,bookmarkedIds:X}=ve(),{popup:s,openPopup:K,scheduleClose:x,cancelClose:B,closePopup:Q}=ue();if(U(()=>{P(T)},[T]),A){const e=new URLSearchParams;o&&u!=="safe"&&e.set("rating",u);const t=n.get("chapter")||"";t&&e.set("chapter",t);const r=e.toString()?`?${e.toString()}`:"",m=`/manga/${p||"mangadex"}/${encodeURIComponent(A)}${t?`/read${r}`:r}`;return a(ne,{to:m,replace:!0})}const W=e=>{e.preventDefault(),he(),i({q:C},!0)},Y=e=>{e.currentTarget.checked&&!v&&b(!0)},J=()=>{_(),b(!1),i({},!0)},Z=()=>{b(!1)},F=e=>{const t=new URLSearchParams;o&&u!=="safe"&&t.set("rating",u);const r=t.toString()?`?${t.toString()}`:"";return`/manga/${e.provider}/${encodeURIComponent(e.id)}${r}`},ee=p==="mangapill"?Ne:Me,ae=p==="mangapill",te=p==="mangadex";return a("div",{className:c.page,children:[a("div",{className:c.header,children:[a("h1",{className:c.pageTitle,children:[a(M,{name:"book"})," Manga"]}),a("form",{className:c.searchForm,onSubmit:W,children:[a("input",{className:c.searchInput,value:C,onChange:e=>P(e.currentTarget.value),placeholder:"Search manga titles...","aria-label":"Search manga"}),a("button",{className:c.searchBtn,type:"submit","aria-label":"Search",children:a(M,{name:"search",size:14})})]}),a("select",{className:l.select,value:S,disabled:d.length===0,onChange:e=>{const t=new URLSearchParams(n);t.set("provider",e.currentTarget.value),t.delete("page"),t.delete("id"),t.delete("chapter"),t.delete("status"),t.delete("type"),N(t)},"aria-label":"Manga provider",children:d.length===0?a("option",{value:"",children:R?"Loading providers…":"No providers available"}):a(q,{children:[a("option",{value:"",children:"Auto"}),d.map(e=>a("option",{value:e.value,children:e.label},e.value))]})}),d.length===0&&!R&&a("button",{className:c.searchBtn,type:"button",onClick:()=>G(),"aria-label":"Retry loading providers",children:a(M,{name:"redo",size:14})})]}),a("div",{className:l.filterRow,children:[p==="mangadex"&&a("select",{className:l.select,value:$,onChange:e=>i({sort:e.currentTarget.value},!0),"aria-label":"Sort manga",children:ye.map(e=>a("option",{value:e.value,children:e.label},e.value))}),a("select",{className:l.select,value:k,onChange:e=>i({status:e.currentTarget.value},!0),"aria-label":"Filter by status",children:ee.map(e=>a("option",{value:e.value,children:e.label},e.label))}),ae&&a("select",{className:l.select,value:w,onChange:e=>i({type:e.currentTarget.value},!0),"aria-label":"Filter by type",children:Ce.filter(e=>e.value!=="doujinshi"||o).map(e=>a("option",{value:e.value,children:e.label},e.value))}),te&&a("select",{className:l.select,value:y,onChange:e=>i({rating:e.currentTarget.value},!0),"aria-label":"Content rating",children:H.map(e=>a("option",{value:e.value,children:e.label},e.value))}),!v&&a("div",{className:l.matureToggleWrap,children:[a("label",{className:l.matureLabel,htmlFor:"manga-mature-toggle",children:"Mature"}),a(se,{id:"manga-mature-toggle",isChecked:!1,onChange:Y})]})]}),g.isError?a(ie,{message:"Failed to load manga. Please try again."}):g.isLoading&&h.length===0?a("div",{className:l.grid,"aria-hidden":!0,children:Array.from({length:12}).map((e,t)=>a("div",{className:l.skeletonCard,children:[a("div",{className:`${l.skeletonThumb} ${l.shimmer}`}),a("div",{className:`${l.skeletonLine} ${l.shimmer}`,style:{width:"88%"}}),a("div",{className:`${l.skeletonLine} ${l.shimmer}`,style:{width:"55%"}})]},t))}):h.length===0?a("p",{className:l.statusMsg,children:"No titles found. Try another search or provider."}):a(q,{children:[a("div",{className:`${l.grid} ${g.isFetching?l.fetching:""}`,children:h.map(e=>{const t=D(e.provider,e.id);return a(ce,{item:{id:t,title:e.title,...Se(e),thumbnail:fe(e.provider,e.cover),typeBadge:e.type||void 0,chapterBadge:e.latestChapter?`Ch. ${e.latestChapter}`:null,isAdult:be(e)},linkTo:F(e),hoverIcon:"info",display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:r=>K(r,{provider:e.provider,mangaId:e.id,title:e.title,altTitle:e.altTitle,cover:e.cover,contentRating:e.contentRating,readTarget:F(e),rating:y,mature:o}),onPopupHoverIntent:r=>r?B():x(),rawThumbnail:!0},`${e.provider}-${e.id}`)})}),a(de,{page:L,canGoNext:z,onChange:e=>i({page:String(e)}),variant:"labeled"})]}),s&&a(ge,{data:s.data,anchorRect:s.rect,bookmarked:X.has(D(s.data.provider,s.data.mangaId)),onToggleBookmark:()=>V({id:s.data.mangaId,provider:s.data.provider,title:s.data.title,cover:s.data.cover,altTitle:s.data.altTitle??void 0,contentRating:s.data.contentRating}),onMouseEnter:B,onMouseLeave:x,onRequestClose:Q}),j&&a(oe,{isOpen:!0,scope:"section",showResetHint:!0,onClose:Z,onGrant:J})]})}export{He as default};
@@ -1 +1 @@
1
- import{u as e,a as Q,d as z,S as E,o as O,p as G,T as $,h as Y}from"./vendor-core-DfaOB3Rn.js";import{I as x}from"./vendor-icons-DrybRNxP.js";import{B as M,e as H,d as J}from"./index-vb4WPdcb.js";import{E as K}from"./ErrorMessage-DAxegITP.js";import{b as D,g as V,f as U,h as j,j as X,m as A,k as Z,l as ee,n as te,r as ae,o as re,p as ne,q as se,s as ie,M as oe}from"./useMangaLibrary-DrPp5K_1.js";import{s as r}from"./Manga.module-depGEacJ.js";import{p as le}from"./page.module-C1MlZzf3.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-2sAPXNhJ.js";const ce=({detail:a,altTitle:c,onBack:b,onOpenChapter:v,bookmarkButton:n,statusSelect:g,primaryAction:k,progressByChapter:d})=>{const h=[a.type,a.status,a.year?String(a.year):"",a.author?`by ${a.author}`:""].filter(Boolean);return e("div",{children:[e("button",{className:r.backBtn,onClick:b,children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),e("div",{className:r.detail,children:[a.cover&&e("img",{className:r.detailCover,src:D(a.provider,a.cover),alt:a.title,decoding:"async",draggable:!1}),e("div",{className:r.detailInfo,children:[e("h2",{className:r.detailTitle,children:a.title}),c&&e("p",{className:r.detailAltTitle,children:["Also known as: ",c]}),h.length>0&&e("div",{className:r.detailMeta,children:h.map(t=>e("span",{className:r.badge,children:t},t))}),a.genres&&a.genres.length>0&&e("div",{className:r.detailMeta,children:a.genres.map(t=>e("span",{className:r.badge,children:t},t))}),a.description&&e("p",{className:r.detailDesc,children:a.description}),(n||g||k)&&e("div",{className:r.detailActions,children:[k,n,g]})]})]}),e("h3",{className:r.detailTitle,style:{fontSize:"1rem"},children:["Chapters (",a.chapters.length,")"]}),a.chapters.length===0?e("p",{className:r.statusMsg,children:"No chapters found for this title on this provider."}):e("div",{className:r.chapterList,children:a.chapters.map(t=>{const o=d?.get(t.id),p=!!o&&o.pageCount>0&&o.page>=o.pageCount;return e("button",{className:`${r.chapterRow} ${p?r.chapterDone:""}`,onClick:()=>v(t),title:t.externalUrl?"External only - opens on source site":void 0,children:[e("span",{children:["Ch. ",t.number,t.title?` - ${t.title}`:""]}),e("span",{className:r.chapterMeta,children:[o&&o.pageCount>0?p?"read":`p. ${o.page}/${o.pageCount}`:"",t.group,t.externalUrl?"external":""].filter(Boolean).join(" · ")})]},t.id)})})]})},de=({libId:a,anilistId:c})=>{const b=Q(),v=V(a),n=v.data?.item,[g,k]=z(null),[d,h]=z(null),t=g??n?.title??"",o=U({provider:"mangadex",query:t,page:1,sort:"",status:"",type:"",rating:"safe",mature:!1},!!t),p=U({provider:"mangapill",query:t,page:1,sort:"",status:"",type:"",rating:"safe",mature:!1},!!t),S=j(),y=X(),T=async s=>{const u=A(s.provider,s.id);h(u);try{await S.mutateAsync({provider:s.provider,mangaId:s.id,title:s.title,cover:s.cover,altTitle:s.altTitle,contentRating:s.contentRating,silent:!0}),await y.mutateAsync({id:u,anilistId:c}),b(`/manga/${s.provider}/${encodeURIComponent(s.id)}`)}catch{return}finally{h(null)}},C=(s,u,B)=>e("div",{style:{marginTop:"12px"},children:[e("div",{style:{fontWeight:600,textTransform:"capitalize",marginBottom:"6px"},children:s}),B?e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:"Searching…"}):!u||u.length===0?e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:"No matches."}):u.slice(0,6).map(l=>{const I=A(l.provider,l.id),N=d===I;return e("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"6px 0",borderTop:"1px solid var(--border, #223)"},children:[l.cover&&e("img",{src:D(l.provider,l.cover),alt:"",loading:"lazy",style:{width:"34px",height:"48px",objectFit:"cover",borderRadius:"4px"}}),e("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.title}),l.latestChapter&&e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.75rem"},children:l.latestChapter})]}),e(M,{onClick:()=>T(l),disabled:N,children:[e(x,{name:"external-link-alt",size:12})," ",N?"Linking…":"Link"]})]},I)})]});return e("div",{children:[e("button",{onClick:()=>b("/manga"),style:{background:"none",border:"none",color:"var(--accent)",cursor:"pointer",marginBottom:"12px"},children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),v.isLoading?e("div",{style:{color:"var(--text-tertiary)"},children:"Loading library entry…"}):n?e(E,{children:[e("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[n.cover&&e("img",{src:n.cover,alt:"",style:{width:"64px",height:"90px",objectFit:"cover",borderRadius:"6px"}}),e("div",{children:[e("h2",{style:{margin:"0 0 4px"},children:n.title}),e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:["Tracked on AniList",n.lastChapterNumber?` · Ch. ${n.lastChapterNumber}`:"",n.status?` · ${n.status}`:""]})]})]}),e("p",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem",marginTop:"12px"},children:"AniList doesn't host chapters. Search your providers below and link the matching manga - your AniList status and chapter progress will sync to it from now on."}),e("div",{style:{display:"flex",gap:"8px",marginTop:"8px"},children:e("input",{type:"text",value:g??n.title,onChange:s=>k(s.currentTarget.value),placeholder:"Search providers…",style:{flex:1,padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--border, #223)",background:"var(--bg-secondary, transparent)",color:"inherit"}})}),C("mangadex",o.data?.items,o.isLoading),C("mangapill",p.data?.items,p.isLoading)]}):e("div",{style:{color:"var(--text-tertiary)"},children:"This AniList entry is no longer in your library."})]})};function ke(){const{provider:a="",id:c=""}=O(),[b]=G(),v=Q(),{hasConsent:n}=H(),g=b.get("rating")||"safe",k=n?g:"safe",d=a&&c?A(a,c):void 0,h=Z(a||null,c||null,k,n),t=h.data,o=ee(d),p=te(d),{titlePreference:S}=J(),y=$(()=>t&&{...t,title:ae(t,S)},[t,S]),T=j(),C=re(),s=ne();Y(()=>{y&&(document.title=`${y.title} - dango`)},[y]);const u=$(()=>{const i=new Map;for(const m of p.data?.progress??[])i.set(m.chapterId,m);return i},[p.data]),B=a.toLowerCase()==="anilist"&&/^\d+$/.test(c)?parseInt(c,10):null,l=o.data?.inLibrary??!1,I=o.data?.status??"Reading",N=$(()=>(t?.chapters??[]).filter(i=>!i.externalUrl),[t]),f=$(()=>{if(!t)return null;const i=[...p.data?.progress??[]].sort((m,L)=>L.updatedAt-m.updatedAt);for(const m of i){const L=t.chapters.find(w=>w.id===m.chapterId);if(L&&!L.externalUrl)return L;const P=se(m.chapterId);if(P!=null){const w=ie(t.chapters,P);if(w&&!w.externalUrl)return w}}return N[0]??null},[t,p.data,N]),q=f?u.get(f.id):void 0,F=(p.data?.progress?.length??0)>0,W=f&&(q||F)?`Continue Ch. ${f?.number}`:"Start Reading",R=i=>{if(i.externalUrl){window.open(i.externalUrl,"_blank","noopener,noreferrer");return}const m=new URLSearchParams;m.set("chapter",i.id),n&&g!=="safe"&&m.set("rating",g),v(`/manga/${a}/${encodeURIComponent(c)}/read?${m.toString()}`)},_=()=>{!t||!d||(l?C.mutate(d):T.mutate({provider:a,mangaId:c,title:t.title,cover:t.cover,author:t.author,altTitle:t.altTitle,contentRating:t.contentRating}))};return e("div",{className:le.page,children:h.isLoading?e("div",{"aria-hidden":!0,children:[e("div",{className:`${r.skeletonThumb} ${r.shimmer}`,style:{maxWidth:"12rem"}}),e("div",{className:`${r.skeletonLine} ${r.shimmer}`,style:{width:"40%"}}),e("div",{className:`${r.skeletonLine} ${r.shimmer}`,style:{width:"70%"}})]}):h.isError||!t||!y?B!=null&&d?e(de,{libId:d,anilistId:B}):e(E,{children:[e("button",{className:r.backBtn,onClick:()=>v("/manga"),children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),e(K,{message:"Failed to load this title. Please try again."})]}):e(ce,{detail:y,altTitle:t.altTitle!==y.title?t.altTitle:void 0,onBack:()=>v("/manga"),onOpenChapter:R,progressByChapter:u,primaryAction:f?e(M,{onClick:()=>f&&R(f),children:[e(x,{name:"book",size:13})," ",W]}):void 0,bookmarkButton:e(M,{variant:l?"secondary":"primary",onClick:_,disabled:T.isPending||C.isPending,children:[e(x,{name:"bookmark",size:13})," ",l?"Bookmarked":"Bookmark"]}),statusSelect:l?e("select",{className:r.detailSelect,value:I,onChange:i=>d&&s.mutate({id:d,status:i.currentTarget.value}),"aria-label":"Reading status",children:oe.map(i=>e("option",{value:i,children:i},i))}):void 0})})}export{ke as default};
1
+ import{u as e,a as Q,d as z,S as E,o as O,p as G,T as $,h as Y}from"./vendor-core-DfaOB3Rn.js";import{I as x}from"./vendor-icons-DrybRNxP.js";import{B as M,e as H,d as J}from"./index-DbRDs7tF.js";import{E as K}from"./ErrorMessage-DAxegITP.js";import{b as D,g as V,f as U,h as j,j as X,m as A,k as Z,l as ee,n as te,r as ae,o as re,p as ne,q as se,s as ie,M as oe}from"./useMangaLibrary-B4ZJLZXD.js";import{s as r}from"./Manga.module-depGEacJ.js";import{p as le}from"./page.module-C1MlZzf3.js";import"./vendor-query-BBT5_sHx.js";import"./libraryInvalidation-cJ1WjrJq.js";const ce=({detail:a,altTitle:c,onBack:b,onOpenChapter:v,bookmarkButton:n,statusSelect:g,primaryAction:k,progressByChapter:d})=>{const h=[a.type,a.status,a.year?String(a.year):"",a.author?`by ${a.author}`:""].filter(Boolean);return e("div",{children:[e("button",{className:r.backBtn,onClick:b,children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),e("div",{className:r.detail,children:[a.cover&&e("img",{className:r.detailCover,src:D(a.provider,a.cover),alt:a.title,decoding:"async",draggable:!1}),e("div",{className:r.detailInfo,children:[e("h2",{className:r.detailTitle,children:a.title}),c&&e("p",{className:r.detailAltTitle,children:["Also known as: ",c]}),h.length>0&&e("div",{className:r.detailMeta,children:h.map(t=>e("span",{className:r.badge,children:t},t))}),a.genres&&a.genres.length>0&&e("div",{className:r.detailMeta,children:a.genres.map(t=>e("span",{className:r.badge,children:t},t))}),a.description&&e("p",{className:r.detailDesc,children:a.description}),(n||g||k)&&e("div",{className:r.detailActions,children:[k,n,g]})]})]}),e("h3",{className:r.detailTitle,style:{fontSize:"1rem"},children:["Chapters (",a.chapters.length,")"]}),a.chapters.length===0?e("p",{className:r.statusMsg,children:"No chapters found for this title on this provider."}):e("div",{className:r.chapterList,children:a.chapters.map(t=>{const o=d?.get(t.id),p=!!o&&o.pageCount>0&&o.page>=o.pageCount;return e("button",{className:`${r.chapterRow} ${p?r.chapterDone:""}`,onClick:()=>v(t),title:t.externalUrl?"External only - opens on source site":void 0,children:[e("span",{children:["Ch. ",t.number,t.title?` - ${t.title}`:""]}),e("span",{className:r.chapterMeta,children:[o&&o.pageCount>0?p?"read":`p. ${o.page}/${o.pageCount}`:"",t.group,t.externalUrl?"external":""].filter(Boolean).join(" · ")})]},t.id)})})]})},de=({libId:a,anilistId:c})=>{const b=Q(),v=V(a),n=v.data?.item,[g,k]=z(null),[d,h]=z(null),t=g??n?.title??"",o=U({provider:"mangadex",query:t,page:1,sort:"",status:"",type:"",rating:"safe",mature:!1},!!t),p=U({provider:"mangapill",query:t,page:1,sort:"",status:"",type:"",rating:"safe",mature:!1},!!t),S=j(),y=X(),T=async s=>{const u=A(s.provider,s.id);h(u);try{await S.mutateAsync({provider:s.provider,mangaId:s.id,title:s.title,cover:s.cover,altTitle:s.altTitle,contentRating:s.contentRating,silent:!0}),await y.mutateAsync({id:u,anilistId:c}),b(`/manga/${s.provider}/${encodeURIComponent(s.id)}`)}catch{return}finally{h(null)}},C=(s,u,B)=>e("div",{style:{marginTop:"12px"},children:[e("div",{style:{fontWeight:600,textTransform:"capitalize",marginBottom:"6px"},children:s}),B?e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:"Searching…"}):!u||u.length===0?e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:"No matches."}):u.slice(0,6).map(l=>{const I=A(l.provider,l.id),N=d===I;return e("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"6px 0",borderTop:"1px solid var(--border, #223)"},children:[l.cover&&e("img",{src:D(l.provider,l.cover),alt:"",loading:"lazy",style:{width:"34px",height:"48px",objectFit:"cover",borderRadius:"4px"}}),e("div",{style:{flex:1,minWidth:0},children:[e("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l.title}),l.latestChapter&&e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.75rem"},children:l.latestChapter})]}),e(M,{onClick:()=>T(l),disabled:N,children:[e(x,{name:"external-link-alt",size:12})," ",N?"Linking…":"Link"]})]},I)})]});return e("div",{children:[e("button",{onClick:()=>b("/manga"),style:{background:"none",border:"none",color:"var(--accent)",cursor:"pointer",marginBottom:"12px"},children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),v.isLoading?e("div",{style:{color:"var(--text-tertiary)"},children:"Loading library entry…"}):n?e(E,{children:[e("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[n.cover&&e("img",{src:n.cover,alt:"",style:{width:"64px",height:"90px",objectFit:"cover",borderRadius:"6px"}}),e("div",{children:[e("h2",{style:{margin:"0 0 4px"},children:n.title}),e("div",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem"},children:["Tracked on AniList",n.lastChapterNumber?` · Ch. ${n.lastChapterNumber}`:"",n.status?` · ${n.status}`:""]})]})]}),e("p",{style:{color:"var(--text-tertiary)",fontSize:"0.85rem",marginTop:"12px"},children:"AniList doesn't host chapters. Search your providers below and link the matching manga - your AniList status and chapter progress will sync to it from now on."}),e("div",{style:{display:"flex",gap:"8px",marginTop:"8px"},children:e("input",{type:"text",value:g??n.title,onChange:s=>k(s.currentTarget.value),placeholder:"Search providers…",style:{flex:1,padding:"8px 10px",borderRadius:"6px",border:"1px solid var(--border, #223)",background:"var(--bg-secondary, transparent)",color:"inherit"}})}),C("mangadex",o.data?.items,o.isLoading),C("mangapill",p.data?.items,p.isLoading)]}):e("div",{style:{color:"var(--text-tertiary)"},children:"This AniList entry is no longer in your library."})]})};function ke(){const{provider:a="",id:c=""}=O(),[b]=G(),v=Q(),{hasConsent:n}=H(),g=b.get("rating")||"safe",k=n?g:"safe",d=a&&c?A(a,c):void 0,h=Z(a||null,c||null,k,n),t=h.data,o=ee(d),p=te(d),{titlePreference:S}=J(),y=$(()=>t&&{...t,title:ae(t,S)},[t,S]),T=j(),C=re(),s=ne();Y(()=>{y&&(document.title=`${y.title} - dango`)},[y]);const u=$(()=>{const i=new Map;for(const m of p.data?.progress??[])i.set(m.chapterId,m);return i},[p.data]),B=a.toLowerCase()==="anilist"&&/^\d+$/.test(c)?parseInt(c,10):null,l=o.data?.inLibrary??!1,I=o.data?.status??"Reading",N=$(()=>(t?.chapters??[]).filter(i=>!i.externalUrl),[t]),f=$(()=>{if(!t)return null;const i=[...p.data?.progress??[]].sort((m,L)=>L.updatedAt-m.updatedAt);for(const m of i){const L=t.chapters.find(w=>w.id===m.chapterId);if(L&&!L.externalUrl)return L;const P=se(m.chapterId);if(P!=null){const w=ie(t.chapters,P);if(w&&!w.externalUrl)return w}}return N[0]??null},[t,p.data,N]),q=f?u.get(f.id):void 0,F=(p.data?.progress?.length??0)>0,W=f&&(q||F)?`Continue Ch. ${f?.number}`:"Start Reading",R=i=>{if(i.externalUrl){window.open(i.externalUrl,"_blank","noopener,noreferrer");return}const m=new URLSearchParams;m.set("chapter",i.id),n&&g!=="safe"&&m.set("rating",g),v(`/manga/${a}/${encodeURIComponent(c)}/read?${m.toString()}`)},_=()=>{!t||!d||(l?C.mutate(d):T.mutate({provider:a,mangaId:c,title:t.title,cover:t.cover,author:t.author,altTitle:t.altTitle,contentRating:t.contentRating}))};return e("div",{className:le.page,children:h.isLoading?e("div",{"aria-hidden":!0,children:[e("div",{className:`${r.skeletonThumb} ${r.shimmer}`,style:{maxWidth:"12rem"}}),e("div",{className:`${r.skeletonLine} ${r.shimmer}`,style:{width:"40%"}}),e("div",{className:`${r.skeletonLine} ${r.shimmer}`,style:{width:"70%"}})]}):h.isError||!t||!y?B!=null&&d?e(de,{libId:d,anilistId:B}):e(E,{children:[e("button",{className:r.backBtn,onClick:()=>v("/manga"),children:[e(x,{name:"chevron-left",size:12})," Back to browse"]}),e(K,{message:"Failed to load this title. Please try again."})]}):e(ce,{detail:y,altTitle:t.altTitle!==y.title?t.altTitle:void 0,onBack:()=>v("/manga"),onOpenChapter:R,progressByChapter:u,primaryAction:f?e(M,{onClick:()=>f&&R(f),children:[e(x,{name:"book",size:13})," ",W]}):void 0,bookmarkButton:e(M,{variant:l?"secondary":"primary",onClick:_,disabled:T.isPending||C.isPending,children:[e(x,{name:"bookmark",size:13})," ",l?"Bookmarked":"Bookmark"]}),statusSelect:l?e("select",{className:r.detailSelect,value:I,onChange:i=>d&&s.mutate({id:d,status:i.currentTarget.value}),"aria-label":"Reading status",children:oe.map(i=>e("option",{value:i,children:i},i))}):void 0})})}export{ke as default};
@@ -0,0 +1 @@
1
+ import{d as D,A as w,q as Z,h as g,u as e,S as le,o as be,p as we,a as Ne,T as ye}from"./vendor-core-DfaOB3Rn.js";import{E as Ce}from"./ErrorMessage-DAxegITP.js";import{p as X,q as ke,e as Ie,d as $e,t as ce}from"./index-DbRDs7tF.js";import{I as S}from"./vendor-icons-DrybRNxP.js";import{u as Se}from"./vendor-query-BBT5_sHx.js";import{t as Pe,v as Re,m as Me,k as xe,r as Ee,n as Te,w as Le,q as Be,s as ze}from"./useMangaLibrary-B4ZJLZXD.js";import{s as t}from"./Manga.module-depGEacJ.js";import{p as Ae}from"./page.module-C1MlZzf3.js";import"./libraryInvalidation-cJ1WjrJq.js";const de="mangaReadMode",ue="mangaFitMode";function Fe(){try{return X.getItem(de)==="page"?"page":"strip"}catch{return"strip"}}function Ue(){try{return X.getItem(ue)==="height"?"height":"width"}catch{return"width"}}const De=({provider:h,mangaTitle:p,chapter:f,chapters:y,onBack:C,onOpenChapter:v,initialPage:u=0,onProgress:V})=>{const[c,P]=D(Fe),[B,i]=D(Ue),[d,z]=D(0),[A,M]=D(new Set),[b,k]=D(0),N=w(null),x=w([]),Y=Se(),{data:_,isLoading:j,isError:R}=Pe(h,f.id),s=_?.pages??[],m=s.map(n=>Re(h,n)),$=w(0),F=w(0),E=w(!1);F.current=s.length;const T=y.findIndex(n=>n.id===f.id),r=T>0?[...y.slice(0,T)].reverse().find(n=>!n.externalUrl)??null:null,o=T>=0?y.slice(T+1).find(n=>!n.externalUrl)??null:null,I=Z(n=>{E.current=!0,z(a=>{const l=a+n;return l<0?(r&&v(r),0):l>=s.length?(o&&v(o),a):l})},[s.length,r,o,v]);g(()=>{E.current=!1,$.current=Math.max(0,u),z(Math.max(0,u)),M(new Set),x.current=[],u<=0&&window.scrollTo(0,0)},[f.id,u]);const J=w(V);J.current=V;const ee=w(""),O=w(null),te=w(null),[W,ge]=D(0),L=Z(()=>{const n=c==="strip"?x.current[$.current]:te.current,a=n?.querySelector("img");if(!n||!a)return;const l=Math.max(0,(n.clientWidth-a.clientWidth)/2)+8;ge(H=>Math.abs(H-l)<1?H:l)},[c]);g(()=>{$.current=d,s.length!==0&&J.current?.(Math.min(d+1,s.length),s.length)},[d,s.length]),g(()=>{u<=0||E.current||$.current===0&&(E.current=!1,$.current=u,z(u))},[u]),g(()=>{if(c!=="strip"||s.length===0||u<=0)return;const n=`${f.id}:${u}`;if(ee.current===n)return;ee.current=n;const a=window.setTimeout(()=>{x.current[Math.min(u,s.length-1)]?.scrollIntoView({block:"start"})},150);return()=>window.clearTimeout(a)},[c,s.length,u,f.id]),g(()=>{document.title=`${p} Ch. ${f.number} - dango`},[p,f.number]),g(()=>{try{X.setItem(de,c)}catch{}},[c]),g(()=>{try{X.setItem(ue,B)}catch{}},[B]),g(()=>{c==="page"&&window.scrollTo(0,0)},[c]),g(()=>{if(c!=="page"||s.length===0)return;const n=a=>{a.key==="ArrowRight"||a.key===" "?(a.preventDefault(),I(1)):a.key==="ArrowLeft"&&(a.preventDefault(),I(-1))};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[c,s.length,I]),g(()=>{if(c!=="strip"||s.length===0)return;let n=0;const a=()=>{n=0;const H=window.innerHeight*.3,G=x.current;let q=-1,se=0;for(let Q=0;Q<G.length;Q++){const ie=G[Q];if(!ie)continue;const oe=ie.getBoundingClientRect();if(oe.height>4&&se++,oe.top<=H)q=Q;else break}q<0||se<Math.min(3,G.length)||(q!==$.current&&(E.current=!0,$.current=q,z(q)),L())},l=()=>{n||(n=requestAnimationFrame(a))};return O.current=l,l(),window.addEventListener("scroll",l,{passive:!0}),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l),window.removeEventListener("resize",l),n&&cancelAnimationFrame(n),O.current=null}},[c,s.length,_,L]),g(()=>{if(!(c!=="page"||s.length===0))return L(),window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[c,d,s.length,L]);const he=n=>{N.current=n.touches[0].clientX},me=n=>{if(N.current===null)return;const a=n.changedTouches[0].clientX-N.current;N.current=null,!(Math.abs(a)<50)&&I(a<0?1:-1)},K=n=>{n&&v(n)},ne=n=>M(a=>{if(a.has(n))return a;const l=new Set(a);return l.add(n),l}),pe=n=>{M(a=>{const l=new Set(a);return l.delete(n),l}),k(a=>a+1)},fe=()=>{M(new Set),k(n=>n+1),Y.invalidateQueries({queryKey:[ke.mangaPages,h,f.id]})},ve=s.length>0&&A.size>=s.length,re=n=>b>0?`${n}&n=${b}`:n,ae=n=>e("div",{className:t.deadPage,role:"alert",children:[e("span",{children:["Page ",n+1," failed to load"]}),e("button",{className:t.pageBtn,onClick:()=>pe(n),children:[e(S,{name:"sync-alt",size:12})," Retry"]})]}),U=B==="height";return e("div",{className:t.readerShell,children:[e("div",{className:t.readerBar,children:[e("button",{className:t.readerIconBtn,onClick:C,"aria-label":"Back to chapters",children:e(S,{name:"chevron-left",size:14})}),e("span",{className:t.readerTitle,children:[p," - Ch. ",f.number,f.title?` ${f.title}`:""]}),s.length>0&&e("span",{className:t.readerCounter,children:[Math.min(d+1,s.length)," / ",s.length]}),e("div",{className:t.readerSegment,role:"group","aria-label":"Reading mode",children:[e("button",{type:"button","aria-pressed":c==="strip",className:c==="strip"?t.readerSegmentActive:"",onClick:()=>P("strip"),children:"Strip"}),e("button",{type:"button","aria-pressed":c==="page",className:c==="page"?t.readerSegmentActive:"",onClick:()=>P("page"),children:"Page"})]}),e("div",{className:t.readerSegment,role:"group","aria-label":"Fit mode",children:[e("button",{type:"button","aria-pressed":!U,className:U?"":t.readerSegmentActive,onClick:()=>i("width"),title:"Fit width - best for portrait / phones",children:"Wide"}),e("button",{type:"button","aria-pressed":U,className:U?t.readerSegmentActive:"",onClick:()=>i("height"),title:"Fit height - best for landscape / desktop",children:"Tall"})]}),e("button",{className:t.readerIconBtn,disabled:!r,onClick:()=>K(r),"aria-label":"Previous chapter",children:e(S,{name:"chevron-left",size:14})}),e("button",{className:t.readerIconBtn,disabled:!o,onClick:()=>K(o),"aria-label":"Next chapter",children:e(S,{name:"chevron-right",size:14})})]}),R?e("p",{className:t.statusMsg,children:"Failed to load pages. Please try again."}):j?e("div",{className:t.readerPages,"aria-hidden":!0,children:Array.from({length:3}).map((n,a)=>e("div",{className:`${t.skeletonThumb} ${t.shimmer}`,style:{width:"100%",maxWidth:"56rem",aspectRatio:"3 / 4"}},a))}):s.length===0?e("p",{className:t.statusMsg,children:"No pages found for this chapter."}):ve?e("div",{className:t.failedBox,children:[e("p",{className:t.statusMsg,children:"Page images failed to load (expired or blocked links)."}),e("button",{className:t.pageBtn,onClick:fe,children:[e(S,{name:"sync-alt",size:12})," Reload pages"]})]}):c==="strip"?e("div",{className:`${t.readerPages} ${U?t.readerPagesTall:""}`,children:m.map((n,a)=>e("div",{ref:l=>{x.current[a]=l},className:t.readerPageWrap,children:[a===d&&e("div",{className:t.ribbon,style:W>0?{right:W}:void 0,"aria-hidden":"true",children:e(S,{name:"bookmark",size:12})},d),A.has(a)?ae(a):e("img",{className:t.readerPage,src:re(n),alt:`Page ${a+1}`,loading:a<3?"eager":"lazy",decoding:"async",draggable:!1,onLoad:()=>O.current?.(),onError:()=>ne(a)})]},`${a}-${s[a].slice(-32)}`))}):e(le,{children:[e("div",{ref:te,className:`${t.pageView} ${U?t.pageViewTall:""}`,onTouchStart:he,onTouchEnd:me,children:[e("div",{className:t.ribbon,style:W>0?{right:W}:void 0,"aria-hidden":"true",children:e(S,{name:"bookmark",size:12})},d),e("button",{className:`${t.tapZone} ${t.tapZoneLeft}`,onClick:()=>I(-1),"aria-label":"Previous page",children:e("span",{className:t.tapChevron,children:e(S,{name:"chevron-left",size:16})})}),A.has(d)?ae(d):e("img",{className:t.pageImage,src:re(m[d]),alt:`Page ${d+1} of ${s.length}`,decoding:"async",draggable:!1,onLoad:()=>L(),onError:()=>ne(d)},`${d}-${s[d].slice(-32)}`),e("button",{className:`${t.tapZone} ${t.tapZoneRight}`,onClick:()=>I(1),"aria-label":"Next page",children:e("span",{className:t.tapChevron,children:e(S,{name:"chevron-right",size:16})})})]}),e("nav",{className:t.pagination,"aria-label":"Page navigation",children:[e("button",{className:t.pageBtn,disabled:d<=0,onClick:()=>I(-1),children:"Previous page"}),e("span",{className:t.pageIndicator,children:[d+1," / ",s.length]}),e("button",{className:t.pageBtn,disabled:d>=s.length-1,onClick:()=>I(1),children:"Next page"})]})]}),(r||o)&&e("nav",{className:t.pagination,children:[e("button",{className:t.pageBtn,disabled:!r,onClick:()=>K(r),children:"Previous chapter"}),e("button",{className:t.pageBtn,disabled:!o,onClick:()=>K(o),children:"Next chapter"})]})]})},_e=800,qe=5e3;function Oe(){const{provider:h="",id:p=""}=be(),[f]=we(),y=Ne(),C=f.get("chapter")||"",v=f.get("rating")||"safe",{hasConsent:u}=Ie(),V=u?v:"safe",c=h&&p?Me(h,p):"",P=h.toLowerCase()==="anilist";g(()=>{P&&p&&y(`/manga/anilist/${encodeURIComponent(p)}`,{replace:!0})},[P,p,y]);const B=xe(!P&&h?h:null,!P&&p?p:null,V,u),i=B.data,{titlePreference:d}=$e(),z=i?Ee(i,d):"Manga",A=Te(c||void 0),M=Le(),b=i&&C?i.chapters.find(r=>r.id===C)??null:null,k=Be(C),N=k!=null&&i?ze(i.chapters,k):null;g(()=>{if(k!=null&&N&&N.id!==C){const r=new URLSearchParams;r.set("chapter",N.id),u&&v!=="safe"&&r.set("rating",v),y(`/manga/${h}/${encodeURIComponent(p)}/read?${r.toString()}`,{replace:!0})}},[k,N,C,u,v,h,p,y]);const x=k!=null&&!!i&&!!N,Y=k!=null&&!!i&&!N,_=ye(()=>{const r=(A.data?.progress??[]).find(o=>o.chapterId===C);return r&&r.page>0?r.page:0},[A.data,C]),j=_>1?_-1:0,R=w(null),s=w(null),m=Z(()=>{R.current&&(clearTimeout(R.current),R.current=null);const r=s.current;s.current=null,r&&c&&M.mutate({mangaId:c,chapterId:r.chapterId,chapterNumber:r.chapterNumber,page:r.page,pageCount:r.pageCount,title:i?.title??null,cover:i?.cover??null,provider:h||null,altTitle:i?.altTitle??null,contentRating:i?.contentRating??null})},[c,M,i?.title,i?.cover,i?.altTitle,i?.contentRating,h]),$=Z((r,o)=>{b&&(s.current={chapterId:b.id,chapterNumber:b.number,page:r,pageCount:o},R.current&&clearTimeout(R.current),R.current=setTimeout(m,_e))},[b,m]);g(()=>{m()},[C,m]),g(()=>()=>m(),[m]),g(()=>{const r=window.setInterval(()=>{s.current&&m()},qe);return()=>window.clearInterval(r)},[m]),g(()=>{const r=()=>{document.visibilityState==="hidden"&&m()},o=()=>m();return document.addEventListener("visibilitychange",r),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",r),window.removeEventListener("pagehide",o)}},[m]);const F=w("");F.current||(F.current=`manga-${Date.now()}-${Math.random().toString(36).slice(2)}`),g(()=>{if(!i||!b)return;const r=i.contentRating==="erotica"||i.contentRating==="pornographic"||i.type==="doujinshi",o=()=>{ce.discord.mangaPresence.mutate({title:i.title,chapterLabel:`Chapter ${b.number}`,isPlaying:!0,thumbnail:i.cover||"",thumbnails:[i.cover].filter(Boolean),isAdult:r,sessionId:F.current}).catch(()=>{}),ce.discord.heartbeat.mutate({sessionId:F.current}).catch(()=>{})};o();const I=window.setInterval(o,6e4);return()=>window.clearInterval(I)},[i,b]);const E=r=>{if(m(),r.externalUrl){window.open(r.externalUrl,"_blank","noopener,noreferrer");return}const o=new URLSearchParams;o.set("chapter",r.id),u&&v!=="safe"&&o.set("rating",v),y(`/manga/${h}/${encodeURIComponent(p)}/read?${o.toString()}`)},T=()=>{m();const r=new URLSearchParams;u&&v!=="safe"&&r.set("rating",v);const o=r.toString()?`?${r.toString()}`:"";y(`/manga/${h}/${encodeURIComponent(p)}${o}`)};return P?null:e("div",{className:Ae.page,children:B.isLoading||x?e("div",{className:t.readerPages,"aria-hidden":!0,children:Array.from({length:3}).map((r,o)=>e("div",{className:`${t.skeletonThumb} ${t.shimmer}`,style:{width:"100%",maxWidth:"56rem",aspectRatio:"3 / 4"}},o))}):!i||!b?e(le,{children:[e("button",{className:t.backBtn,onClick:T,children:"Back to title"}),e(Ce,{message:Y?`Chapter ${k} isn't available from ${h} for this title.`:"Failed to load this chapter. Please try again."})]}):e(De,{provider:h,mangaTitle:z,chapter:b,chapters:i.chapters,onBack:T,onOpenChapter:E,initialPage:j,onProgress:$},b.id)})}export{Oe as default};
@@ -1 +1 @@
1
- import{u as a}from"./vendor-core-DfaOB3Rn.js";import{R as i}from"./ResetProgressModal-Dq-B23o_.js";import{B as n,o as g}from"./useMangaLibrary-DrPp5K_1.js";const M=({mangaId:e,title:o,onClose:r})=>{const s=n(),t=g();return a(i,{isOpen:!!e,itemName:o,progressKind:"reading",listLabel:"my reading list",onClose:r,onConfirm:m=>{e&&(s.mutate({mangaId:e}),m&&t.mutate(e))}})};export{M};
1
+ import{u as a}from"./vendor-core-DfaOB3Rn.js";import{R as i}from"./ResetProgressModal-DtUE-wCy.js";import{B as n,o as g}from"./useMangaLibrary-B4ZJLZXD.js";const M=({mangaId:e,title:o,onClose:r})=>{const s=n(),t=g();return a(i,{isOpen:!!e,itemName:o,progressKind:"reading",listLabel:"my reading list",onClose:r,onConfirm:m=>{e&&(s.mutate({mangaId:e}),m&&t.mutate(e))}})};export{M};
@@ -0,0 +1 @@
1
+ import{a as $e,p as ke,h as ue,d as i,T as me,u as t,S as he}from"./vendor-core-DfaOB3Rn.js";import{b as ge}from"./vendor-query-BBT5_sHx.js";import{l as Fe,e as qe,B as W,a5 as Ue,t as F,F as Ye}from"./index-DbRDs7tF.js";import{I as pe}from"./vendor-icons-DrybRNxP.js";import{P as ve}from"./MediaCard-ChUKs5Sb.js";import{A as xe}from"./AnimeCard-DWnU-rCc.js";import{S as Ve}from"./SkeletonGrid-BO0am1za.js";import{M as He}from"./MatureConsentModal-DiWSp3Of.js";import{E as Ke}from"./ErrorMessage-DAxegITP.js";import{u as Qe}from"./useProviders-Bnw0sBAP.js";import{s as a}from"./Search.module-C_qwCdHS.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./useAnimeInfoData-YbePqj-M.js";import"./QueueOptionsButton-C6ArqpM5.js";import"./playbackCompletion-CnxK6_Vz.js";const We="_shrinkSelect_130sm_1",ze="_tightGrid_130sm_7",z={shrinkSelect:We,tightGrid:ze},je=[{value:"anilist",label:"AniList"},{value:"mal",label:"MAL"}],Ze=[{value:"POPULARITY_DESC",label:"Popularity"},{value:"TRENDING_DESC",label:"Trending"},{value:"SCORE_DESC",label:"Score"},{value:"START_DATE_DESC",label:"Newest"},{value:"FAVOURITES_DESC",label:"Favourites"}],Je=[{value:"",label:"All Status"},{value:"RELEASING",label:"Currently Airing"},{value:"FINISHED",label:"Finished"},{value:"NOT_YET_RELEASED",label:"Not Yet Released"}],Xe=[{value:"",label:"Relevance"},{value:"visits:desc",label:"Most Visited"},{value:"title:asc",label:"Title A-Z"}],et={recent:"Latest",popular:"Popular",views:"Most Viewed",rating:"Top Rated",random:"Random"},tt=[{value:"ALL",label:"All Seasons"},{value:"Winter",label:"Winter"},{value:"Spring",label:"Spring"},{value:"Summer",label:"Summer"},{value:"Fall",label:"Fall"}],fe=m=>m.split("-").map(u=>u&&u[0].toUpperCase()+u.slice(1)).join(" "),at=new Set(["page","limit","year","minScore","minEpisodes"]),rt=new Set(["provider","query","page","limit","type","status","season","year","country","genres","genre","excludeGenres","sortBy","order","studio","blacklist","minScore","minEpisodes"]);function st(m){const u=new URLSearchParams(m),s={};for(const[b,y]of u.entries())rt.has(b)&&(at.has(b)?s[b]=Number(y)||0:s[b]=y);return s}function Ct(){const m=$e(),u=Fe(),[s,b]=ke(),{hasConsent:y,grant:Se}=qe();ue(()=>{document.title="Mature - dango"},[]);const[l,be]=i(s.get("provider")||"anilist"),[N,j]=i(s.get("query")||""),[L,q]=i(s.get("query")||""),[O,g]=i(parseInt(s.get("page")||"1",10)||1),[I,U]=i(()=>{const e=s.get("sortBy");return e||(l==="mal"?"SCORE_DESC":"POPULARITY_DESC")}),[_,Z]=i(s.get("sortBy")||""),[C,ye]=i(s.get("status")||""),[D,Ne]=i(s.get("season")||"ALL"),[G,Ce]=i(s.get("year")||"ALL"),[p,M]=i(s.get("genre")||s.get("genres")||""),[Y,Ae]=i(s.get("order")||"recent"),[x,Ee]=i(s.get("studio")||""),[B,Te]=i(s.get("studio")||""),[J,X]=i([]),[V,Pe]=i(!1),[Re,ee]=i(null),{options:te}=Qe(),ae=me(()=>te.filter(e=>e.mature&&(e.kind??"anime")==="anime"),[te]),re=me(()=>[...je,...ae.map(e=>({value:e.id,label:e.label}))],[ae]),{data:w}=ge({...u.data.matureFilters.queryOptions(),enabled:y,staleTime:1/0}),c=l==="anilist"||l==="mal",H=c?void 0:w?.providers?.[l],T=H?.browse,P=H?.genres??[],A=H?.orders??[],se=A.length>0&&!A.includes(Y)?A[0]:Y,$=!c&&(T?.genre===!0||P.length>0||J.length>0),v=!c&&(T?.order===!0||A.length>0),E=!c&&T?.studio===!0,le=!c&&T?.sort===!0,K=c?14:T?.pageSize??14,f=e=>{const r=new URLSearchParams;if(e.provider!=="anilist"&&r.set("provider",e.provider),e.query.trim()&&r.set("query",e.query.trim()),e.page>1&&r.set("page",String(e.page)),e.provider==="anilist")e.sort!=="POPULARITY_DESC"&&r.set("sortBy",e.sort),e.status&&r.set("status",e.status),e.season!=="ALL"&&r.set("season",e.season),e.year!=="ALL"&&r.set("year",e.year);else if(e.provider==="mal")e.sort!=="SCORE_DESC"&&r.set("sortBy",e.sort),e.status&&r.set("status",e.status);else{const n=w?.providers?.[e.provider]?.browse,d=w?.providers?.[e.provider]?.orders??[],o=d.length>0&&!d.includes(e.remoteOrder)?d[0]:e.remoteOrder;(!n||n.sort)&&e.remoteSort&&r.set("sortBy",e.remoteSort),(!n||n.genre)&&e.genre&&r.set("genre",e.genre),(!n||n.order)&&o!==(d[0]??"recent")&&r.set("order",o),(!n||n.studio)&&e.studio.trim()&&r.set("studio",e.studio.trim())}b(r,{replace:!0})},S=(e={})=>({provider:l,query:L,page:O,sort:I,remoteSort:_,status:C,season:D,year:G,genre:p,remoteOrder:Y,studio:B,...e}),Le=(()=>{const e=new URLSearchParams;return e.set("provider",l),L.trim()&&e.set("query",L.trim()),e.set("page",String(O)),e.set("limit",String(K)),l==="anilist"&&(e.set("sortBy",I),C&&e.set("status",C),D!=="ALL"&&e.set("season",D),G!=="ALL"&&e.set("year",G)),l==="mal"?(e.set("sortBy",I),C&&e.set("status",C)):c||($&&p&&e.set("genre",p),v&&e.set("order",se),le&&_&&e.set("sortBy",_),E&&B.trim()&&e.set("studio",B.trim())),e.toString()})(),{data:h,isLoading:Oe,isError:Ie,error:_e}=ge({...u.data.matureSearch.queryOptions(st(Le)),enabled:y});ue(()=>{const e=h?.genres;!c&&P.length===0&&e&&e.length>0&&X(r=>{const n=new Set(r.map(o=>o.slug)),d=[...r];for(const o of e)o.slug&&!n.has(o.slug)&&(n.add(o.slug),d.push(o));return d.length===r.length?r:d})},[h,l,c,P.length]);const k=(h?.data||[]).map(e=>({...e,isAdult:!0})),ie=h?.hasMore??!1,ne=h?.total!=null?Math.max(1,Math.ceil(h.total/K)):void 0,R=()=>{Ue(),g(1);let e=p;!c&&!v&&N.trim()&&(e=""),M(e),E&&Te(x),q(N),f(S({query:N,page:1,genre:e,studio:E?x:B}))},De=e=>{be(e),g(1),Z(""),M(""),X([]),e==="mal"?U("SCORE_DESC"):e==="anilist"&&U("POPULARITY_DESC"),q(N),f(S({provider:e,page:1,remoteSort:"",genre:"",query:N}))},Ge=e=>{M(e),g(1),e&&(j(""),q("")),f(S({genre:e,page:1,query:e?"":L}))},oe=e=>{g(e),f(S({page:e})),window.scrollTo({top:0,behavior:"smooth"})},Me=async(e,r)=>{const n=r.id||r._id;if(l!=="mal"&&!/^\d+$/.test(n)&&(e.preventDefault(),e.stopPropagation(),!Re)){ee(n);try{if(l!=="anilist"){let o=!1;try{o=(await F.data.anilistStatus.query())?.available===!0}catch{o=!1}if(o){const de=await F.data.matureResolve.query({title:r.name});m(`/anime/${de.id}`);return}const ce=await F.data.matureAllocate.mutate({provider:l,nativeId:n,title:r.name,thumbnail:r.thumbnail});if(!ce?.id)throw new Error("Allocate failed");m(`/anime/${ce.id}`);return}const d=await F.data.matureResolve.query({title:r.name});m(`/anime/${d.id}`)}catch{Ye.error("Could not match this title on AniList")}finally{ee(null)}}},Q=new Date().getFullYear(),Be=[{value:"ALL",label:"All Years"},...Array.from({length:Q-1980+1},(e,r)=>({value:String(Q-r),label:String(Q-r)}))],we=P.length>0?P.map(e=>({value:e,label:fe(e)})):J.map(e=>({value:e.slug,label:e.name}));return y?t("div",{className:"page-container",children:[t("div",{className:a.header,children:[t("h1",{className:a.pageTitle,children:"Mature"}),t("p",{className:a.pageSubtitle,children:"Browse 18+ titles across AniList and streaming providers"})]}),t("div",{className:a.filterContainer,children:[t("div",{className:a.searchBarWrapper,children:[t("div",{className:a.inputIconWrapper,children:[t(pe,{name:"search",className:a.searchIcon}),t("input",{type:"text",placeholder:`Search ${re.find(e=>e.value===l)?.label}...`,value:N,onChange:e=>j(e.currentTarget.value),onKeyDown:e=>{e.key==="Enter"&&R()},className:a.searchInput})]}),t("div",{className:a.searchActions,children:[t("select",{value:l,onChange:e=>De(e.currentTarget.value),className:a.providerSelect,"aria-label":"Provider",children:re.map(e=>t("option",{value:e.value,children:e.label},e.value))}),t(W,{onClick:R,className:a.searchBtn,children:"Search"}),c&&t("button",{onClick:()=>Pe(!V),className:`${a.filterToggleBtn} ${V?a.active:""}`,children:[t(pe,{name:"filter"})," Filters"]}),le&&t("select",{value:_,onChange:e=>{Z(e.currentTarget.value),g(1),f(S({remoteSort:e.currentTarget.value,page:1}))},className:a.providerSelect,"aria-label":"Sort",children:Xe.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]}),(l==="anilist"||l==="mal")&&t("div",{className:`${a.advancedFilters} ${V?a.show:""}`,children:[t("div",{className:a.filterDivider}),t("div",{className:a.filterGrid,children:[t("div",{className:a.filterItem,children:[t("label",{children:"Sort By"}),t("select",{value:I,onChange:e=>U(e.currentTarget.value),children:Ze.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:a.filterItem,children:[t("label",{children:"Status"}),t("select",{value:C,onChange:e=>ye(e.currentTarget.value),children:Je.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),l==="anilist"&&t(he,{children:[t("div",{className:a.filterItem,children:[t("label",{children:"Season"}),t("select",{value:D,onChange:e=>Ne(e.currentTarget.value),children:tt.map(e=>t("option",{value:e.value,children:e.label},e.value))})]}),t("div",{className:a.filterItem,children:[t("label",{children:"Year"}),t("select",{value:G,onChange:e=>Ce(e.currentTarget.value),children:Be.map(e=>t("option",{value:e.value,children:e.label},e.value))})]})]})]}),t("div",{className:a.filterActions,children:t(W,{onClick:R,className:a.searchBtn,children:"Apply Filters"})})]}),!c&&!!w&&($||v||E)&&t("div",{className:`${a.advancedFilters} ${a.show}`,children:[t("div",{className:a.filterDivider}),t("div",{className:`${a.filterGrid} ${z.tightGrid}`,children:[v&&t("div",{className:`${a.filterItem} ${z.shrinkSelect}`,children:[t("label",{children:"Order"}),t("select",{value:se,onChange:e=>{Ae(e.currentTarget.value),g(1),f(S({remoteOrder:e.currentTarget.value,page:1}))},children:(A.length>0?A:["recent"]).map(e=>t("option",{value:e,children:et[e]||e},e))})]}),$&&t("div",{className:`${a.filterItem} ${z.shrinkSelect}`,children:[t("label",{children:"Genre"}),t("select",{value:p,onChange:e=>{v?(M(e.currentTarget.value),g(1),f(S({genre:e.currentTarget.value,page:1}))):Ge(e.currentTarget.value)},children:[t("option",{value:"",children:"All Genres"}),we.map(e=>t("option",{value:e.value,children:e.label},e.value))]})]}),E&&t("div",{className:a.filterItem,children:[t("label",{children:"Studio"}),t("input",{type:"text",placeholder:"Studio name...",value:x,onChange:e=>Ee(e.currentTarget.value),onKeyDown:e=>{e.key==="Enter"&&R()},className:a.searchInput})]})]}),p&&$&&!v&&t("p",{className:a.pageSubtitle,children:["Browsing the ",fe(p)," genre - search text is ignored while a genre is selected."]}),(v||E)&&t("div",{className:a.filterActions,children:t(W,{onClick:R,className:a.searchBtn,children:"Apply Filters"})})]})]}),Ie&&t(Ke,{message:_e?.message||"Search failed"}),Oe?t(Ve,{count:K}):k.length===0?t("div",{className:a.noResults,children:[t("h3",{children:"No results found"}),t("p",{children:"Try a different query, genre or provider"})]}):t(he,{children:[t("div",{className:a.resultsHeader,children:[t("h2",{className:a.resultsTitle,children:[h?.total??k.length," result",(h?.total??k.length)===1?"":"s"]}),t("div",{className:a.pagination,children:t(ve,{page:O,totalPages:ne,canGoNext:ie,onChange:oe,variant:"labeled"})})]}),t("div",{className:a.resultsGrid,children:k.map(e=>t("div",{onClickCapture:r=>Me(r,e),children:t(xe,{anime:e})},`${l}-${e._id}`))}),t("div",{className:a.bottomPagination,children:t("div",{className:a.pagination,children:t(ve,{page:O,totalPages:ne,canGoNext:ie,onChange:oe,variant:"labeled"})})})]})]}):t(He,{isOpen:!0,onClose:()=>m("/"),onGrant:Se})}export{Ct as default};