@serifpersia/dango 3.7.2 → 3.7.3
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.
- package/README.md +1 -1
- package/client/dist/assets/{AnimeCard-CoPx634q.js → AnimeCard-BVufFeLC.js} +1 -1
- package/client/dist/assets/{AnimeInfo-COVCRujg.js → AnimeInfo-Dihook4h.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-BwlKpRXY.js → AnimeInfoPage-K0ErjilQ.js} +2 -2
- package/client/dist/assets/{Asmr-nOUcDsWe.js → Asmr-CP7vVwsh.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-Mj1PYE2c.js → AsmrResetProgressModal-cYO4Sr2k.js} +1 -1
- package/client/dist/assets/{Home-wi0a_BDQ.js → Home-BYuAVKgx.js} +1 -1
- package/client/dist/assets/{Insights-MLCDyTnY.js → Insights-Bx01GySp.js} +1 -1
- package/client/dist/assets/{LibraryListPage-CRqv737t.js → LibraryListPage-BnrEDG8j.js} +1 -1
- package/client/dist/assets/{ListeningList-8dzhiDeb.js → ListeningList-kRSLAo3B.js} +1 -1
- package/client/dist/assets/{Manga-dkD-uWJk.js → Manga-COhyMd3K.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-nCeWZNcO.js → MangaInfoPage-LTEvl_nL.js} +1 -1
- package/client/dist/assets/{MangaReadPage-NdDNCyLg.js → MangaReadPage-sEwzyBQ7.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-C28AiLJl.js → MangaResetProgressModal-CbMR36Zu.js} +1 -1
- package/client/dist/assets/{Mature-D5WSkhIJ.js → Mature-CMvs_-gf.js} +1 -1
- package/client/dist/assets/{MatureConsentModal-BsdpNeXA.js → MatureConsentModal-BnB-RHYQ.js} +1 -1
- package/client/dist/assets/{MediaCard-C1jNesfK.js → MediaCard-hWGCEHWx.js} +1 -1
- package/client/dist/assets/OptionListMenu-onM2KK2X.js +1 -0
- package/client/dist/assets/Player-2YKevlG4.js +56 -0
- package/client/dist/assets/PlayerSettings-BfSv-hut.js +1 -0
- package/client/dist/assets/{QueueOptionsButton-DNzKPzPw.js → QueueOptionsButton-B4Re8F3V.js} +1 -1
- package/client/dist/assets/{QueueRail-BWcDVSHd.js → QueueRail-Dkx_M6ng.js} +1 -1
- package/client/dist/assets/{ReadingList-zkFp3wpF.js → ReadingList-C--ZvTe2.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-BYNYqwwl.js → ResetProgressModal-BuESoxbY.js} +1 -1
- package/client/dist/assets/{Search-yDP_wGJ1.js → Search-CEErwr88.js} +1 -1
- package/client/dist/assets/{Settings-BpKwWesn.js → Settings-C-QEEujv.js} +1 -1
- package/client/dist/assets/{SkeletonGrid-CYJeh04P.js → SkeletonGrid-QWMGLCGp.js} +1 -1
- package/client/dist/assets/{Trackers-D2KUt71k.js → Trackers-1i4Hd5D3.js} +1 -1
- package/client/dist/assets/Tv-C6F9655r.js +4 -0
- package/client/dist/assets/{TvInfo-D_4QdgV4.js → TvInfo-BajXP7JJ.js} +1 -1
- package/client/dist/assets/{TvPopup-DHXB5ZSF.js → TvPopup-DZtX79Ol.js} +1 -1
- package/client/dist/assets/{TvSearch-COwVoGru.js → TvSearch-DcWcxRb1.js} +1 -1
- package/client/dist/assets/{TvWatchlist-CU3r-NO5.js → TvWatchlist-Cf_25dKi.js} +1 -1
- package/client/dist/assets/{Watchlist-DHyuTLJG.js → Watchlist-DBmU8PNR.js} +1 -1
- package/client/dist/assets/{hls-DOAVt6Ry.js → hls-Bi-DS5KL.js} +1 -1
- package/client/dist/assets/{index-BLh_CXtu.js → index-DB81Su4I.js} +2 -2
- package/client/dist/assets/{libraryInvalidation-AzFLnbjH.js → libraryInvalidation-DI-v-DQ1.js} +1 -1
- package/client/dist/assets/playbackCompletion-IPHm9fp5.js +1 -0
- package/client/dist/assets/{useAnimeInfoData-MPNJXLaM.js → useAnimeInfoData-DpUA78Mv.js} +1 -1
- package/client/dist/assets/{useAsmr-2dFEmQD_.js → useAsmr-BwyYDnlP.js} +1 -1
- package/client/dist/assets/{useAsmrPopup-N2vUf3Pw.js → useAsmrPopup-BrrEaBlV.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-B3Ni34a7.js → useMangaLibrary-BAUaug-u.js} +1 -1
- package/client/dist/assets/{useMangaPopup-h8NHEPUk.js → useMangaPopup-3Lx5tEub.js} +1 -1
- package/client/dist/assets/usePlaybackEnd-CuDnNZ8o.js +10 -0
- package/client/dist/assets/{useProviders-z8L8GKy0.js → useProviders-CKqOSX5-.js} +1 -1
- package/client/dist/assets/{useTv-D4zQ1BsQ.js → useTv-CZB47zUF.js} +1 -1
- package/client/dist/assets/{useTvLibrary-B4vcRzQc.js → useTvLibrary-BGz7Unv_.js} +1 -1
- package/client/dist/index.html +1 -1
- package/package.json +2 -2
- package/server/dist/server.js +2 -2
- package/server/package.json +1 -1
- package/client/dist/assets/AvSyncCalibrator-C5GxpyPE.js +0 -10
- package/client/dist/assets/OptionListMenu-CIvW5WmO.js +0 -1
- package/client/dist/assets/Player-PGj8YYO8.js +0 -56
- package/client/dist/assets/PlayerSettings-CAYfF0sA.js +0 -1
- package/client/dist/assets/Tv-Ul3jFq-x.js +0 -4
- package/client/dist/assets/playbackCompletion-DuUs8u-8.js +0 -1
- /package/client/dist/assets/{AvSyncCalibrator-BtUHM1mW.css → usePlaybackEnd-BtUHM1mW.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
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|

|
|
9
|
-
[](https://github.com/serifpersia/dango)
|
|
10
10
|
|
|
11
11
|
[](https://dango-users-badge.ramiserifpersia.workers.dev/?view=status)
|
|
12
12
|
|
|
@@ -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-
|
|
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-DpUA78Mv.js";import{d as C,s as P,g as v}from"./index-DB81Su4I.js";import{Q as D}from"./QueueOptionsButton-B4Re8F3V.js";import{p as y,a as I,m as N,M as _}from"./MediaCard-hWGCEHWx.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 +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-
|
|
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-DpUA78Mv.js";import{d as w,e as M,f as m,s as x,M as A,B as p}from"./index-DB81Su4I.js";import{A as D}from"./AnimeMetaDetails-D8WIiO4b.js";import{S as G}from"./SynopsisText-B3Sa5pRv.js";import{Q as P}from"./QueueOptionsButton-B4Re8F3V.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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-
|
|
2
|
-
import{a0 as r,_ as t}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AnimeInfo-Dihook4h.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-icons-DrybRNxP.js","assets/useAnimeInfoData-DpUA78Mv.js","assets/vendor-query-BBT5_sHx.js","assets/index-DB81Su4I.js","assets/index-B7katXv0.css","assets/QueueOptionsButton-B4Re8F3V.js","assets/vendor-ui-3qrARCPr.js","assets/QueueOptionsButton-CM15uQn8.css","assets/AnimeMetaDetails-D8WIiO4b.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-DB81Su4I.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-Dihook4h.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,2 +1,2 @@
|
|
|
1
|
-
import{T as We,u as e,A as $,d as f,h as w,a as Ye,g as Pe,q as Q,S as O,$ as qe,o as gt,p as kt}from"./vendor-core-DfaOB3Rn.js";import{I as _}from"./vendor-icons-DrybRNxP.js";import{u as ft}from"./vendor-query-BBT5_sHx.js";import{T as Ue}from"./ToggleSwitch-CN_ppEc9.js";import{M as _t}from"./MatureConsentModal-
|
|
1
|
+
import{T as We,u as e,A as $,d as f,h as w,a as Ye,g as Pe,q as Q,S as O,$ as qe,o as gt,p as kt}from"./vendor-core-DfaOB3Rn.js";import{I as _}from"./vendor-icons-DrybRNxP.js";import{u as ft}from"./vendor-query-BBT5_sHx.js";import{T as Ue}from"./ToggleSwitch-CN_ppEc9.js";import{M as _t}from"./MatureConsentModal-BnB-RHYQ.js";import{M as bt,P as yt}from"./MediaCard-hWGCEHWx.js";import{c as Ke,a as Qe,d as vt,e as Xe,f as Ze,g as wt,h as Ct,i as Nt,j as Tt,k as Ve,l as Ie}from"./useAsmr-BwyYDnlP.js";import{g as ve,t as xe,W as jt,B as Je,M as et,P as M,A as te,e as St,X as At,q as ze}from"./index-DB81Su4I.js";import{u as Bt,A as Lt}from"./useAsmrPopup-BrrEaBlV.js";import{l as Rt}from"./hls-Bi-DS5KL.js";import{p as ae}from"./page.module-C1MlZzf3.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./libraryInvalidation-DI-v-DQ1.js";import"./usePopup-DS9jMzp6.js";const Mt="_sortSelect_12kj5_1",It="_grid_12kj5_11",Pt="_fetching_12kj5_18",xt="_thumbPlaceholder_12kj5_57",$t="_asmrCardWrap_12kj5_93",Et="_bookmarkBtn_12kj5_98",Ht="_bookmarked_12kj5_122",Ft="_statusMsg_12kj5_145",Ot="_skeletonCard_12kj5_153",Dt="_skeletonThumb_12kj5_158",Wt="_skeletonLine_12kj5_164",qt="_shimmer_12kj5_171",Ut="_matureToggleWrap_12kj5_212",Vt="_matureLabel_12kj5_219",Jt="_translateToggleWrap_12kj5_225",zt="_filterTogglesGroup_12kj5_232",Gt="_filterBar_12kj5_244",Yt="_filterLabel_12kj5_251",Kt="_detailOverlay_12kj5_256",Qt="_detailModal_12kj5_268",Xt="_detailClose_12kj5_280",Zt="_detailHeader_12kj5_296",ea="_detailCover_12kj5_302",ta="_detailInfo_12kj5_311",aa="_detailTitle_12kj5_315",na="_detailRj_12kj5_322",ra="_metaRow_12kj5_328",sa="_metaLabel_12kj5_334",la="_tagChips_12kj5_340",oa="_tagChip_12kj5_340",ca="_npOverlay_12kj5_356",ia="_playerBarDocked_12kj5_371",da="_playerBarDockedHidden_12kj5_385",ua="_npOverlayControlsHidden_12kj5_396",ma="_npArrow_12kj5_396",ha="_npImageCount_12kj5_397",pa="_npStage_12kj5_406",ga="_sliderViewport_12kj5_422",ka="_slide_12kj5_422",fa="_slideImg_12kj5_424",_a="_npStageBlank_12kj5_443",ba="_sliderTrack_12kj5_462",ya="_slideImgLoaded_12kj5_495",va="_slideSpinner_12kj5_500",wa="_npArrowLeft_12kj5_550",Ca="_npArrowRight_12kj5_554",Na="_chapterPanel_12kj5_571",Ta="_chapterRow_12kj5_586",ja="_chapterRowActive_12kj5_605",Sa="_chapterRowTime_12kj5_609",Aa="_chapterRowLabel_12kj5_620",Ba="_npBackdrop_12kj5_626",La="_playerBtn_12kj5_632",Ra="_playerBtnActive_12kj5_632",Ma="_tracksSection_12kj5_638",Ia="_tracksHeading_12kj5_642",Pa="_trackList_12kj5_648",xa="_trackRow_12kj5_657",$a="_trackIcon_12kj5_675",Ea="_trackLabel_12kj5_680",Ha="_trackType_12kj5_685",Fa="_noTracks_12kj5_690",Oa="_playAllBtn_12kj5_695",Da="_detailActions_12kj5_708",Wa="_playerBar_12kj5_371",qa="_playerActions_12kj5_731",Ua="_playerInfo_12kj5_737",Va="_playerTitle_12kj5_742",Ja="_playerTrack_12kj5_751",za="_playerControls_12kj5_757",Ga="_seekRow_12kj5_764",Ya="_playerButtons_12kj5_772",Ka="_seekBtn_12kj5_807",Qa="_seekBtnLabel_12kj5_812",Xa="_playBtn_12kj5_817",Za="_seekBar_12kj5_864",en="_volumeBar_12kj5_865",tn="_timeLabel_12kj5_957",an="_playerRight_12kj5_963",nn="_volumeIcon_12kj5_969",rn="_playerToggle_12kj5_1013",t={sortSelect:Mt,grid:It,fetching:Pt,thumbPlaceholder:xt,asmrCardWrap:$t,bookmarkBtn:Et,bookmarked:Ht,statusMsg:Ft,skeletonCard:Ot,skeletonThumb:Dt,skeletonLine:Wt,shimmer:qt,matureToggleWrap:Ut,matureLabel:Vt,translateToggleWrap:Jt,filterTogglesGroup:zt,filterBar:Gt,filterLabel:Yt,detailOverlay:Kt,detailModal:Qt,detailClose:Xt,detailHeader:Zt,detailCover:ea,detailInfo:ta,detailTitle:aa,detailRj:na,metaRow:ra,metaLabel:sa,tagChips:la,tagChip:oa,npOverlay:ca,playerBarDocked:ia,playerBarDockedHidden:da,npOverlayControlsHidden:ua,npArrow:ma,npImageCount:ha,npStage:pa,sliderViewport:ga,slide:ka,slideImg:fa,npStageBlank:_a,sliderTrack:ba,slideImgLoaded:ya,slideSpinner:va,npArrowLeft:wa,npArrowRight:Ca,chapterPanel:Na,chapterRow:Ta,chapterRowActive:ja,chapterRowTime:Sa,chapterRowLabel:Aa,npBackdrop:Ba,playerBtn:La,playerBtnActive:Ra,tracksSection:Ma,tracksHeading:Ia,trackList:Pa,trackRow:xa,trackIcon:$a,trackLabel:Ea,trackType:Ha,noTracks:Fa,playAllBtn:Oa,detailActions:Da,playerBar:Wa,playerActions:qa,playerInfo:Ua,playerTitle:Va,playerTrack:Ja,playerControls:za,seekRow:Ga,playerButtons:Ya,seekBtn:Ka,seekBtnLabel:Qa,playBtn:Xa,seekBar:Za,volumeBar:en,timeLabel:tn,playerRight:an,volumeIcon:nn,playerToggle:rn},sn=({work:s,onClose:o,onPlay:C,t:g})=>{const{data:i,isLoading:h}=Ke(s.id||null),b=Qe(s),{data:j}=vt(b||void 0),{toggle:y,bookmarkedIds:T}=Xe(),{data:I}=Ze(b||void 0),R=b?T.has(b):!!j?.inLibrary,v=We(()=>(i?.description||s.description||"").split(`
|
|
2
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,s.description]),k=i?.tracks||[],S=s.thumbnail||i?.images?.[0],N=We(()=>{const c=I?.progress??[];return c.length>0?c.reduce((l,A)=>l.updatedAt>=A.updatedAt?l:A):null},[I]),u=N&&N.trackIndex<k.length?N.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(_,{name:"times"})}),e("div",{className:t.detailHeader,children:[S?e("img",{className:t.detailCover,src:S,alt:s.name,decoding:"async"}):e("div",{className:`${t.detailCover} ${t.thumbPlaceholder}`}),e("div",{className:t.detailInfo,children:[e("h2",{className:t.detailTitle,children:g?g(s.name):s.name}),e("p",{className:t.detailRj,children:s.id}),v.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:h?"Loading tracks…":`Tracks (${k.length})`}),!h&&(k.length>0?e("ul",{className:t.trackList,children:k.map((c,l)=>e("li",{children:e("button",{className:t.trackRow,onClick:()=>C(s,k,l),children:[e(_,{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:[!h&&k.length>0&&e("button",{className:t.playAllBtn,onClick:()=>C(s,k,0),children:[e(_,{name:"play"})," Play from start"]}),!h&&u!==null&&N&&e("button",{className:t.playAllBtn,onClick:()=>C(s,k,u),children:[e(_,{name:"history"})," Resume track ",u+1," ·"," ",ve(N.currentTime),N.duration>0?` / ${ve(N.duration)}`:""]}),b&&e("button",{className:t.playAllBtn,onClick:()=>y({rjCode:b,title:s.name,thumbnail:s.thumbnail||"",isAdult:!!s.isAdult}),"aria-pressed":R,children:[e(_,{name:R?"check":"plus"})," ",R?"In listening list":"Add to listening list"]})]})]})})},ln=({title:s,images:o,chapters:C,tracks:g,trackIndex:i,expanded:h,isAdult:b,rjCode:j,t:y,onTrackChange:T,onExpandedChange:I,onClose:R})=>{const v=$(null),k=$(null),[S,N]=f(!1),[u,c]=f(0),[l,A]=f(0),[p,q]=f(0),[B,X]=f(!0),[H,Y]=f(0),[E,ne]=f(new Set),[D,Z]=f(!1),[me,P]=f(!0),ee=$("");ee.current||(ee.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`asmr-${Date.now()}-${Math.random().toString(36).slice(2)}`);const[W,we]=f(()=>{const a=parseFloat(localStorage.getItem("asmrVolume")||"");return Number.isFinite(a)?a:1}),he=$(W);w(()=>{he.current=W},[W]);const pe=Ye(),z=Pe.useMemo(()=>j?wt(j):"",[j]),Ce=Ct(),re=Nt(),{data:se}=Ze(z||void 0),[Be,le]=f(!1),K=$(""),U=$(null),ge=$(0),G=$(0),oe=$(0),ce=g[i],V=ce?.link,Ne=ce?.hls,ke=ce?.resolutionStr||"",ie=o.length>0,fe=`${z}:${i}`,de=Pe.useMemo(()=>(se?.progress??[]).find(r=>r.trackIndex===i)??null,[se,i]),n=$({workId:"",trackIndex:0,trackLabel:""}),d=$(se);d.current=se,n.current={workId:z,trackIndex:i,trackLabel:ke};const L=Q((a,r,m,x=!1)=>{!a.workId||!m||m<10||!x&&Math.abs(r-ge.current)<5||(ge.current=r,Ce.mutate({workId:a.workId,trackIndex:a.trackIndex,trackLabel:a.trackLabel,currentTime:Math.floor(r),duration:Math.floor(m),title:s,thumbnail:o[0]||"",rjCode:a.workId,isAdult:b?1:0}))},[Ce,s,o,b]),ue=Q((a=!1)=>{U.current&&(clearTimeout(U.current),U.current=null),L(n.current,G.current,oe.current,a)},[L]),J=$(ue);J.current=ue;const _e=$(L);_e.current=L;const F=Q(()=>{k.current&&(k.current.destroy(),k.current=null)},[]);w(()=>{const a=v.current;if(!a||!V)return;const r={workId:z,trackIndex:i,trackLabel:ke},m=()=>{U.current&&(clearTimeout(U.current),U.current=null),_e.current(r,G.current,oe.current,!0)};c(0),A(0),q(0),N(!1),G.current=0,oe.current=0,ge.current=0,F();const x=d.current?.progress?.find(Ae=>Ae.trackIndex===i),Se=x?.currentTime||0,Le=x?.duration||0,ye=Se>=10&&Le-Se>=15;if(Ne){let Ae=!1;return(async()=>{const Re=await Rt();if(!Ae)if(Re&&Re.isSupported()){const Me=new Re({enableWorker:!0});k.current=Me,Me.loadSource(V),Me.attachMedia(a),ye||a.play().catch(()=>N(!1))}else a.src=V,a.load(),a.volume=he.current,ye||a.play().catch(()=>N(!1))})(),()=>{Ae=!0,F(),a.removeAttribute("src"),m()}}else a.src=V;return a.load(),a.volume=he.current,ye||a.play().catch(()=>N(!1)),()=>{F(),a.removeAttribute("src"),m()}},[V,Ne,F,z,i,ke]),w(()=>()=>F(),[F]),w(()=>{const a=()=>{document.visibilityState==="hidden"&&J.current()},r=()=>J.current();return document.addEventListener("visibilitychange",a),window.addEventListener("pagehide",r),()=>{document.removeEventListener("visibilitychange",a),window.removeEventListener("pagehide",r)}},[]),w(()=>{if(!de||K.current===fe||!(l>0))return;const a=de.currentTime||0,r=de.duration||l;if(K.current=fe,!(a>=10&&r-a>=15&&G.current<a))return;const m=v.current;m&&(m.currentTime=a,G.current=a,c(a),m.play().catch(()=>{}))},[de,l,fe]),w(()=>{const a=v.current;a&&(a.volume=W)},[W]),w(()=>{if(h)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[h]),w(()=>{Y(0)},[o]),w(()=>{h&&P(!0)},[h]),w(()=>{D&&P(!0)},[D]);const Te=Q(a=>{if(!s||g.length===0)return;const r=g[i],m=r?`${r.resolutionStr} (${i+1}/${g.length})`:"",x=v.current,Se=x?x.currentTime:0,Le=x&&x.duration||0,ye=o[0]||"";xe.discord.asmrPresence.mutate({title:s,trackLabel:m,isPlaying:a,thumbnail:ye,thumbnails:o,currentTime:Se,duration:Le,isAdult:!!b,rjCode:j||"",sessionId:ee.current}).catch(()=>{}),xe.discord.heartbeat.mutate({sessionId:ee.current}).catch(()=>{})},[s,g,i,o,b,j]);w(()=>{Te(S)},[Te,S,i,s,h]),w(()=>{if(!S)return;const a=window.setInterval(()=>Te(!0),15e3);return()=>window.clearInterval(a)},[S,Te]),w(()=>{const a=ee.current,r=()=>jt(a),m=()=>r(),x=()=>{document.visibilityState==="hidden"&&r()};return window.addEventListener("pagehide",m),window.addEventListener("beforeunload",m),document.addEventListener("visibilitychange",x),()=>{window.removeEventListener("pagehide",m),window.removeEventListener("beforeunload",m),document.removeEventListener("visibilitychange",x),r()}},[]);const je=Q(a=>{ne(r=>{if(r.has(a))return r;const m=new Set(r);return m.add(a),m})},[]),at=Q((a,r)=>{a&&a.complete&&a.naturalWidth>0&&je(r)},[je]);w(()=>{if(!h)return;const a=r=>{if(r.key==="Escape"){D?Z(!1):I(!1);return}!B||o.length<2||(r.key==="ArrowLeft"&&Y(m=>Math.max(0,m-1)),r.key==="ArrowRight"&&Y(m=>Math.min(o.length-1,m+1)))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[h,B,o.length,D,I]);const nt=()=>{const a=v.current;a&&(a.paused?a.play().catch(()=>{}):a.pause())},rt=a=>{const r=v.current;if(!r||!l)return;const m=parseFloat(a.currentTarget.value);r.currentTime=m,c(m)},st=()=>{ue(!0),i<g.length-1?T(i+1):le(!0)},lt=a=>{const r=a.currentTarget.currentTime;G.current=r,c(r),U.current&&clearTimeout(U.current),U.current=setTimeout(()=>J.current(),5e3)},ot=()=>{N(!1),J.current()},ct=a=>{const r=a.currentTarget.duration;oe.current=Number.isFinite(r)?r:0,A(a.currentTarget.duration)},it=Q(()=>{z&&re.mutate({rjCode:z,title:s,thumbnail:o[0]||"",status:"Completed",isAdult:!!b,silent:!0}),le(!1),R(),pe("/")},[z,re,s,o,b,R,pe]),dt=C.reduce((a,r,m)=>u>=r.time?m:a,-1),ut=a=>{const r=v.current;r&&(r.currentTime=a,c(a))},$e=a=>{const r=v.current;if(!r)return;const m=Number.isFinite(r.currentTime)?r.currentTime:u,x=Math.max(0,Math.min(l||1/0,m+a));r.currentTime=x,c(x),P(!0)},Ee=l?Math.min(100,u/l*100):0,mt=l?Math.min(100,Math.max(Ee,p/l*100)):0,ht=e(O,{children:[e("div",{className:t.playerButtons,children:[e("button",{className:t.playerBtn,onClick:()=>T(Math.max(0,i-1)),disabled:i===0,"aria-label":"Previous track",children:e(_,{name:"step-backward"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>$e(-10),"aria-label":"Seek back 10 seconds",title:"Back 10s",children:[e(_,{name:"undo"}),e("span",{className:t.seekBtnLabel,children:"10"})]}),e("button",{className:`${t.playerBtn} ${t.playBtn}`,onClick:nt,"aria-label":S?"Pause":"Play",children:S?e(_,{name:"pause"}):e(_,{name:"play"})}),e("button",{className:`${t.playerBtn} ${t.seekBtn}`,onClick:()=>$e(10),"aria-label":"Seek forward 10 seconds",title:"Forward 10s",children:[e(_,{name:"redo"}),e("span",{className:t.seekBtnLabel,children:"10"})]}),e("button",{className:t.playerBtn,onClick:()=>T(Math.min(g.length-1,i+1)),disabled:i>=g.length-1,"aria-label":"Next track",children:e(_,{name:"step-forward"})})]}),e("div",{className:t.seekRow,children:[e("span",{className:t.timeLabel,children:ve(u)}),e("input",{className:t.seekBar,type:"range",min:0,max:l||0,step:.1,value:Math.min(u,l||0),onChange:rt,style:{"--played-percent":`${Ee}%`,"--buffered-percent":`${mt}%`},"aria-label":"Seek"}),e("span",{className:t.timeLabel,children:ve(l)})]})]}),He=e(O,{children:[e("button",{className:`${t.playerBtn} ${t.playerToggle}`,onClick:()=>I(!h),"aria-label":h?"Minimize player":"Expand player",title:h?"Minimize to browse":"Expand",children:h?e(_,{name:"chevron-down"}):e(_,{name:"chevron-up"})}),e("div",{className:t.playerInfo,children:[e("p",{className:t.playerTitle,title:s,children:y?y(s):s}),e("p",{className:t.playerTrack,children:[ce?.resolutionStr||"",g.length>1?` (${i+1}/${g.length})`:""]})]}),e("div",{className:t.playerControls,children:ht}),e("div",{className:t.playerRight,children:[W===0?e(_,{name:"volume-mute",className:t.volumeIcon}):W<.5?e(_,{name:"volume-down",className:t.volumeIcon}):e(_,{name:"volume-up",className:t.volumeIcon}),e("input",{className:t.volumeBar,type:"range",min:0,max:1,step:.01,value:W,onChange:a=>{const r=parseFloat(a.currentTarget.value);we(r),localStorage.setItem("asmrVolume",String(r))},style:{"--volume-percent":`${W*100}%`},"aria-label":"Volume"})]}),e("div",{className:t.playerActions,children:[h&&ie&&e("button",{className:t.playerBtn,onClick:()=>X(a=>!a),"aria-label":B?"Hide images":"Show images",title:B?"Hide images":"Show images",children:B?e(_,{name:"eye-slash"}):e(_,{name:"image"})}),h&&C.length>0&&e("button",{className:`${t.playerBtn} ${D?t.playerBtnActive:""}`,onClick:()=>Z(a=>!a),"aria-label":D?"Hide bookmarks":"Show bookmarks",title:"Timestamps",children:e(_,{name:"list-ol"})}),e("button",{className:t.playerBtn,onClick:R,"aria-label":"Close player",children:e(_,{name:"times"})})]})]}),Fe=e("audio",{ref:v,preload:"metadata",onPlay:()=>N(!0),onPause:ot,onTimeUpdate:lt,onLoadedMetadata:ct,onProgress:a=>{const r=a.currentTarget;r.buffered.length>0&&q(r.buffered.end(r.buffered.length-1))},onEnded:st}),Oe=e(et,{isOpen:Be,onClose:()=>le(!1),title:"Finished!",children:e("div",{style:{padding:"1rem",textAlign:"center"},children:[e(_,{name:"check-circle",size:48,style:{color:"var(--accent-lighter)",marginBottom:"0.5rem"}}),e("p",{style:{fontSize:"1.1rem",fontWeight:600},children:y?y(s):s}),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(Je,{variant:"secondary",onClick:()=>le(!1),children:"Close"}),e(Je,{onClick:it,children:"Mark Completed & Back to Home"})]})]})});if(!h)return qe(e(O,{children:[Fe,e("div",{className:t.playerBar,children:He}),Oe]}),document.body);const be=Math.min(H,Math.max(0,o.length-1)),De=o[be],pt=B&&ie&&!!De&&!E.has(De);return qe(e(O,{children:[Fe,Oe,e("div",{className:`${t.npOverlay} ${me?"":t.npOverlayControlsHidden}`,children:[e("div",{className:`${t.npStage} ${!B||!ie?t.npStageBlank:""}`,onClick:()=>P(a=>!a),children:B&&ie&&e(O,{children:[e("div",{className:t.sliderViewport,children:[e("div",{className:t.sliderTrack,style:{transform:`translateX(-${be*100}%)`},children:o.map(a=>e("div",{className:t.slide,children:e("img",{ref:r=>at(r,a),src:a,alt:`${y?y(s):s} - work image`,loading:"lazy",decoding:"async",draggable:!1,onLoad:()=>je(a),onError:()=>je(a),className:`${t.slideImg} ${E.has(a)?t.slideImgLoaded:""}`})},a))}),pt&&e("span",{className:t.slideSpinner,"aria-label":"Loading image"})]}),o.length>1&&e(O,{children:[e("button",{className:`${t.npArrow} ${t.npArrowLeft}`,onClick:a=>{a.stopPropagation(),Y(r=>Math.max(0,r-1)),P(!0)},disabled:be===0,"aria-label":"Previous image",children:e(_,{name:"chevron-left"})}),e("button",{className:`${t.npArrow} ${t.npArrowRight}`,onClick:a=>{a.stopPropagation(),Y(r=>Math.min(o.length-1,r+1)),P(!0)},disabled:be===o.length-1,"aria-label":"Next image",children:e(_,{name:"chevron-right"})}),e("span",{className:t.npImageCount,onClick:a=>a.stopPropagation(),children:[be+1," / ",o.length]})]})]})}),e("div",{className:`${t.playerBar} ${t.playerBarDocked} ${me?"":t.playerBarDockedHidden}`,onClick:a=>a.stopPropagation(),children:[He,D&&e(O,{children:[e("div",{className:t.npBackdrop,onClick:()=>Z(!1)}),e("div",{className:t.chapterPanel,children:C.map((a,r)=>e("button",{className:`${t.chapterRow} ${r===dt?t.chapterRowActive:""}`,title:y?y(a.label):a.label,onClick:()=>{ut(a.time),Z(!1)},children:[e("span",{className:t.chapterRowTime,children:ve(a.time)}),e("span",{className:t.chapterRowLabel,title:y?y(a.label):a.label,children:y?y(a.label):a.label})]},`${a.time}-${r}`))})]})]})]})]}),document.body)},on="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",cn=s=>{try{return JSON.parse(s.detail)}catch{return null}},dn=({isOpen:s,onClose:o,onSuccess:C})=>{const[g,i]=f(1),[h,b]=f(typeof navigator<"u"?navigator.userAgent:""),[j,y]=f(""),[T,I]=f(!1),[R,v]=f(!1),k=$(null),S=typeof navigator<"u"?navigator.userAgent:"",N=/android/i.test(S),u=/firefox|fxios/i.test(S)&&!N,c=!u&&!N&&/chrome|chromium|edg|brave/i.test(S),l=u||c;w(()=>{s&&(i(1),b(typeof navigator<"u"?navigator.userAgent:""),y(""),I(!1),v(!1))},[s]),w(()=>()=>{k.current&&(window.removeEventListener("dango:jasmr-cookie",k.current),k.current=null)},[]);const A=async()=>{localStorage.setItem("jasmr_ua",h),window.open("https://japaneseasmr.com","_blank","noopener,noreferrer"),i(2)},p=()=>{if(R)return;v(!0);const B=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,X=window.setTimeout(()=>{v(!1),k.current&&(window.removeEventListener("dango:jasmr-cookie",k.current),k.current=null),te.error("Helper not detected - install it via about:debugging first.")},3e3),H=Y=>{const E=cn(Y);if(!(!E||E.requestId!==B))if(window.clearTimeout(X),window.removeEventListener("dango:jasmr-cookie",H),k.current=null,v(!1),E?.ok&&E.cookie)y(E.cookie),te.success("Cookie extracted from helper!");else if(E?.error==="NO_COOKIE"){const ne=E.debug?.stores?.length??0,D=E.debug?.names??[];te.error(`Helper found no cf_clearance (checked ${ne} stores, saw: ${D.join(", ")||"none"}) - solve the challenge on the JapaneseASMR tab first.`)}else te.error("Helper request failed - try again.")};k.current=H,window.addEventListener("dango:jasmr-cookie",H),window.dispatchEvent(new CustomEvent("dango:get-jasmr-cookie",{detail:{requestId:B}}))},q=async()=>{if(!j.trim()){te.error("Please enter the cf_clearance cookie");return}I(!0);try{localStorage.setItem("jasmr_cookie",j.trim()),te.success("Cookie updated successfully!"),C?.(),o()}catch{te.error("Failed to save cookie")}finally{I(!1)}};return e(et,{isOpen:s,onClose:o,title:"JapaneseASMR Verification Required",children:e("div",{className:M.container,children:g===1?e(O,{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:h,onChange:B=>b(B.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:A,children:"Start Verification (Opens JapaneseASMR)"})]})]}):e(O,{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):"})," ",u?e(O,{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(O,{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:j,onChange:B=>y(B.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:q,disabled:T,children:T?"Saving...":"Submit"})]})]})})})},tt="asmrTranslateCache",un=10080*60*1e3;function mn(){try{const s=localStorage.getItem(tt);if(!s)return new Map;const o=JSON.parse(s);return new Map(Object.entries(o))}catch{return new Map}}function hn(s){try{const o={};for(const[C,g]of s)o[C]=g;localStorage.setItem(tt,JSON.stringify(o))}catch{}}function Ge(s){return/[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FAF]/.test(s)}async function pn(s){const o=s.map(i=>i.trim()).filter(Boolean);if(o.length===0)return new Map;const C=await xe.settings.translate.mutate({texts:o,source:"ja",target:"en"}),g=new Map;for(const[i,h]of Object.entries(C.translations||{}))g.set(i,h);for(const i of o)g.has(i)||g.set(i,i);return g}function gn(s,o){const[C,g]=f(new Map),[i,h]=f(!1),b=$(null),j=s.join("");return w(()=>{const T=j?j.split(""):[];if(!o||T.length===0){g(new Map),h(!1);return}const I=Array.from(new Set(T.map(u=>u.trim()).filter(Boolean).filter(Ge)));if(I.length===0){g(new Map);return}b.current||(b.current=mn());const R=Date.now(),v=new Map,k=[];for(const u of I){const c=b.current.get(u);c&&R-c.ts<un?v.set(u,c.t):k.push(u)}if(k.length===0){g(v);return}let S=!1;h(!0);const N=[];for(let u=0;u<k.length;u+=15)N.push(k.slice(u,u+15));return(async()=>{const u=new Map;for(const l of N){try{const A=await pn(l);for(const[p,q]of A)u.set(p,q)}catch{}await new Promise(A=>setTimeout(A,120))}if(S)return;if(b.current){for(const[l,A]of u)b.current.set(l,{t:A,ts:Date.now()});hn(b.current)}const c=new Map([...v,...u]);g(c),h(!1)})(),()=>{S=!0}},[o,j]),{t:T=>!o||!T||!Ge(T)?T:C.get(T.trim())||T,map:C,isTranslating:i}}const kn=[{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 / グロ"}],_n=[{value:"sfw",label:"SFW / 全年齢"}],Pn=()=>{const{rj:s}=gt(),o=Ye(),[C,g]=kt(),{hasConsent:i,grant:h}=St(),[b,j]=f(!1),[y,T]=f(()=>C.get("q")||""),[I,R]=f(()=>C.get("q")||""),[v,k]=f("latest"),[S,N]=f("sfw"),[u,c]=f(1),[l,A]=f(null),[p,q]=f(null),[B,X]=f(!0),[H,Y]=f(()=>localStorage.getItem("asmrTranslateEN")==="true"),[E,ne]=f(!1),D=ft(),{toggle:Z,bookmarkedIds:me}=Xe(),{popup:P,openPopup:ee,scheduleClose:W,cancelClose:we,closePopup:he}=Bt();w(()=>At("jasmr",()=>ne(!0)),[]),w(()=>{localStorage.setItem("asmrTranslateEN",String(H))},[H]);const pe=i,z=pe?S:"sfw",Ce=pe?fn:_n,{data:re,isLoading:se,isError:Be,isFetching:le}=Tt(I,u,v,z),K=Pe.useMemo(()=>re?.shows??[],[re?.shows]),U=re?.hasNext??!1;w(()=>{if(!s){l&&!p&&A(null);return}const n=s.toUpperCase();if(p&&(p.work.id?.toUpperCase()===n||p.work._id?.toUpperCase()===n)){l&&A(null);return}const d=K.find(L=>(L.id||L._id)?.toUpperCase()===n);d?(!l||(l.id||l._id)!==(d.id||d._id))&&A(d):(!l||(l.id||l._id)?.toUpperCase()!==n)&&A({_id:n,id:n,name:n})},[s,K,p,l]);const ge=Q(()=>{o("/asmr")},[o]);w(()=>{!s&&p&&q(null)},[s,p]);const{data:G}=Ke(p&&p.work.id||null),oe=p?[p.work.thumbnail,...G?.images||[]].filter(Boolean):[],ce=[...K.map(n=>n.name),l?.name||"",p?.work.name||"",...G?.chapters?.map(n=>n.label)||[]].filter(Boolean),{t:V}=gn(ce,H);w(()=>{const n=p?p.work.name:l?l.name:s?s.toUpperCase():"",d=n?H?V(n):n:"",L=d?`${d} - dango`:"dango";document.title=L;try{window.history.replaceState(window.history.state,L,window.location.href)}catch{}},[l,p,s,H,V]);const Ne=n=>{n.preventDefault(),R(y),c(1);const d=new URLSearchParams(C);y.trim()?d.set("q",y.trim()):d.delete("q"),d.delete("page"),g(d,{replace:!0})};w(()=>{const n=C.get("q")||"";T(d=>d===n?d:n),R(d=>d===n?d:n),c(1)},[C]);const ke=n=>{n.currentTarget.checked&&!i&&j(!0)},ie=()=>{h(),j(!1),c(1)},fe=()=>{j(!1)},de=Q((n,d,L)=>{A(null),X(!0),q({work:n,tracks:d,index:L})},[]);return e("div",{className:`${ae.page} ${p?ae.pageWithPlayer:""}`,children:[!(p&&B)&&e(O,{children:[e("header",{className:ae.header,children:[e("h1",{className:ae.pageTitle,children:[e(_,{name:"headphones"})," ASMR"]}),e("form",{className:ae.searchForm,onSubmit:Ne,children:[e("input",{className:ae.searchInput,type:"text",value:y,onChange:n=>T(n.currentTarget.value),placeholder:"Search works, circles, CV… (-word excludes)","aria-label":"Search ASMR works"}),e("button",{className:ae.searchBtn,type:"submit","aria-label":"Search",children:e(_,{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:v,onChange:n=>{k(n.currentTarget.value),c(1)},children:kn.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:S,onChange:n=>{N(n.currentTarget.value),c(1)},children:Ce.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(Ue,{id:"asmr-translate-toggle",isChecked:H,onChange:n=>Y(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(Ue,{id:"asmr-mature-toggle",isChecked:!1,onChange:ke})]})]})]}),Be?e("p",{className:t.statusMsg,children:"Failed to load works. Please try again."}):se&&K.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))}):K.length===0?e("p",{className:t.statusMsg,children:"No works found."}):e(O,{children:[e("div",{className:`${t.grid} ${le?t.fetching:""}`,children:K.map(n=>{const d=H?{...n,name:V(n.name)}:n,L=Qe(n),ue=Ve(L),J=me.has(ue),_e=`/asmr/${encodeURIComponent(L)}`;return e("div",{className:t.asmrCardWrap,children:[e(bt,{item:{id:ue,title:d.name,thumbnail:n.thumbnail||"",typeBadge:L||void 0,isAdult:Ie(n)},linkTo:_e,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:F=>ee(F,{rjCode:L,title:d.name,thumbnail:n.thumbnail||"",isAdult:Ie(n),rating:n.rating,listenTarget:_e}),onPopupHoverIntent:F=>F?we():W(),rawThumbnail:!0}),e("button",{className:`${t.bookmarkBtn} ${J?t.bookmarked:""}`,onClick:F=>{F.preventDefault(),F.stopPropagation(),Z({rjCode:L,title:n.name,thumbnail:n.thumbnail||"",isAdult:Ie(n)})},title:J?"Remove from listening list":"Add to listening list","aria-label":J?"Remove from listening list":"Add to listening list","aria-pressed":J,children:e(_,{name:J?"check":"plus",size:12})})]},n._id||n.id)})}),e(yt,{page:u,canGoNext:U,onChange:n=>c(n),variant:"labeled"})]})]}),l&&e(sn,{work:l,onClose:ge,onPlay:de,t:V}),P&&e(Lt,{data:P.data,anchorRect:P.rect,bookmarked:me.has(Ve(P.data.rjCode)),onToggleBookmark:()=>Z({rjCode:P.data.rjCode,title:P.data.title,thumbnail:P.data.thumbnail||"",isAdult:P.data.isAdult}),onMouseEnter:we,onMouseLeave:W,onRequestClose:he}),E&&e(dn,{isOpen:E,onClose:()=>ne(!1),onSuccess:()=>{D.invalidateQueries({queryKey:[ze.asmrBrowse]}),D.invalidateQueries({queryKey:[ze.asmrWork]})}}),b&&e(_t,{isOpen:!0,scope:"section",showResetHint:!0,onClose:fe,onGrant:ie}),p&&e(ln,{title:p.work.name,images:oe,chapters:G?.chapters||[],tracks:p.tracks,trackIndex:p.index,expanded:B,isAdult:!!p.work.isAdult,rjCode:p.work.id||p.work._id,t:V,onTrackChange:n=>q(d=>d&&{...d,index:n}),onExpandedChange:X,onClose:()=>{q(null),X(!0),s&&o("/asmr")}})]})};export{Pn as default};
|
package/client/dist/assets/{AsmrResetProgressModal-Mj1PYE2c.js → AsmrResetProgressModal-cYO4Sr2k.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as i}from"./vendor-core-DfaOB3Rn.js";import{R as n}from"./ResetProgressModal-
|
|
1
|
+
import{u as i}from"./vendor-core-DfaOB3Rn.js";import{R as n}from"./ResetProgressModal-BuESoxbY.js";import{s as a,n as g}from"./useAsmr-BwyYDnlP.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 +1 @@
|
|
|
1
|
-
import{d as E,A as q,h as O,q as P,g as G,u as e,L as Ee,T as Q,S as se,a as J,_ as je}from"./vendor-core-DfaOB3Rn.js";import{b as Ze,u as Je,a as et}from"./vendor-query-BBT5_sHx.js";import{M as me,P as tt}from"./MediaCard-C1jNesfK.js";import{A as le}from"./AnimeCard-CoPx634q.js";import{S as De,A as We}from"./SkeletonGrid-CYJeh04P.js";import{I as V}from"./vendor-icons-DrybRNxP.js";import{u as Se,a as oe,b as at,c as nt,q as Oe,t as rt,d as Ve,s as ot,f as Te,B as Fe,e as st,g as ne,h as we,i as lt,j as Le,k as it,l as ct,m as dt,n as ut,o as ht,p as pt,r as mt,v as gt,w as vt}from"./index-BLh_CXtu.js";import{u as _t}from"./vendor-ui-3qrARCPr.js";import{E as ke}from"./ErrorMessage-DAxegITP.js";import{R as qe}from"./ResetProgressModal-BYNYqwwl.js";import{Q as ft}from"./QueueRail-BWcDVSHd.js";import{u as ze,M as Ge}from"./useMangaPopup-h8NHEPUk.js";import{M as bt}from"./MangaResetProgressModal-C28AiLJl.js";import{u as Ue,a as yt,m as Ne,i as Qe,b as Ce,c as Ye,d as Tt,e as Nt}from"./useMangaLibrary-B3Ni34a7.js";import{u as St}from"./useProviders-z8L8GKy0.js";import{u as He,a as $e,T as wt}from"./useTv-D4zQ1BsQ.js";import{T as kt}from"./TvPopup-DHXB5ZSF.js";import{u as Ct,a as It,b as At,t as Rt,i as Lt,c as $t,M as Mt,T as xt}from"./useTvLibrary-B4vcRzQc.js";import{A as Bt}from"./AsmrResetProgressModal-Mj1PYE2c.js";import{u as Pt,a as Et,b as Dt}from"./useAsmr-2dFEmQD_.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-BsdpNeXA.js";import"./useAnimeInfoData-MPNJXLaM.js";import"./QueueOptionsButton-DNzKPzPw.js";import"./playbackCompletion-DuUs8u-8.js";import"./usePopup-DS9jMzp6.js";import"./libraryInvalidation-AzFLnbjH.js";const Wt="_sectionWrapper_2p2l1_9",Ot="_sectionTitleNoMargin_2p2l1_13",Vt="_carousel_2p2l1_178",B={"section-header":"_section-header_2p2l1_1",sectionWrapper:Wt,sectionTitleNoMargin:Ot,"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:Vt,"carousel-inner":"_carousel-inner_2p2l1_187","carousel-card":"_carousel-card_2p2l1_192"};function ge({align:n="start",containScroll:s="trimSnaps",scrollFraction:h=.8,threshold:t=.6,onReachThreshold:o}={}){const[l,i]=_t({align:n,containScroll:s,dragFree:!0}),[d,T]=E(!1),_=q({scrollFraction:h,threshold:t,onReachThreshold:o}),m=q(!1);O(()=>{_.current={scrollFraction:h,threshold:t,onReachThreshold:o}});const p=P(u=>{T(u.canScrollPrev()||u.canScrollNext())},[]);O(()=>{if(!i)return;const u=()=>{const c=i.scrollProgress();c>=_.current.threshold&&!m.current?(m.current=!0,_.current.onReachThreshold?.()):c<_.current.threshold&&(m.current=!1),p(i)};return i.on("init",u),i.on("reInit",u),i.on("scroll",u),i.on("resize",u),()=>{i.off("init",u),i.off("reInit",u),i.off("scroll",u),i.off("resize",u)}},[i,p]);const N=P(u=>{const c=u.containerNode().firstElementChild;if(!c)return 1;const g=u.rootNode().getBoundingClientRect().width,k=c.getBoundingClientRect().width;return k?Math.max(1,Math.round(g/k)):1},[]),r=P((u,c=!1)=>{if(!i)return;const g=Math.max(1,Math.round(N(i)*_.current.scrollFraction)),k=i.selectedScrollSnap()+(u==="left"?-g:g);i.scrollTo(k,c)},[i,N]),w=P((u=!1)=>{i?.scrollTo(0,u)},[i]);return{emblaRef:l,api:i,canScroll:d,stepBy:r,scrollToStart:w}}const Z=({title:n,eyebrow:s,titleLink:h,loading:t,emptyState:o,carousel:l,layout:i,collapsible:d,defaultExpanded:T=!0,onReachThreshold:_,scrollThreshold:m,isFetchingNextPage:p,resetScrollOnShrink:N,itemCount:r=0,highlight:w,headerActions:u,loadingSkeleton:c,skeletonCount:g=7,children:k})=>{const{lowEndMode:S}=Se(),{emblaRef:A,stepBy:$,scrollToStart:R}=ge({onReachThreshold:_,threshold:m}),[C,U]=G.useState(T);G.useEffect(()=>{U(T)},[T]);const x=G.useRef(0);return G.useEffect(()=>{N&&r>0&&C&&(r<=x.current||x.current===0)&&R(),r>0&&(x.current=r)},[r,N,C,R]),!t&&r===0&&!o&&!d?null:e("section",{className:`${B.sectionWrapper} ${w?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(Ee,{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",S)},children:e(V,{name:"chevron-left"})}),e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll right",onClick:I=>{I.preventDefault(),$("right",S)},children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:B["header-controls"],children:[u,d&&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(V,{name:"chevron-up"}):e(V,{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:g}).map((I,F)=>e("div",{className:B["carousel-card"],children:c},F)):G.Children.map(k,(I,F)=>e("div",{className:B["carousel-card"],children:I},G.isValidElement(I)&&I.key!=null?I.key:`slide-${F}`)),p&&c&&e("div",{className:B["carousel-card"],children:c})]})})}):e("div",{className:"grid-container",children:t&&r===0?e(De,{count:6,layout:i}):r>0?k:t?null:e("div",{style:{gridColumn:"1 / -1"},children:o})}))]})},Ft=({title:n,eyebrow:s,animeList:h,continueWatching:t,titleLink:o,onRemove:l,loading:i,emptyState:d,carousel:T,cardConfig:_,layout:m,onReachThreshold:p,scrollThreshold:N,isFetchingNextPage:r,collapsible:w,defaultExpanded:u=!0})=>{const c=m||"vertical";return e(Z,{title:n,eyebrow:s,titleLink:o,loading:i,emptyState:d,carousel:T,layout:c,collapsible:w,defaultExpanded:u,onReachThreshold:p,scrollThreshold:N,isFetchingNextPage:r,resetScrollOnShrink:t,highlight:t,itemCount:h.length,loadingSkeleton:e(We,{layout:c}),skeletonCount:7,children:h.map(g=>e(le,{anime:g,continueWatching:t,onRemove:l,config:_,layout:c},g._id))})},Me=G.memo(Ft),qt="_sectionWrapper_xt8h9_2",zt="_sectionTitleNoMargin_xt8h9_6",Gt="_timeSelect_xt8h9_80",Ut="_carouselContainer_xt8h9_111",Qt="_carousel_xt8h9_111",Yt="_carouselInner_xt8h9_122",Ht="_carouselItem_xt8h9_127",Xt="_rankCard_xt8h9_164",Kt="_rankPill_xt8h9_168",jt="_rankGold_xt8h9_179",Zt="_rankSilver_xt8h9_183",Jt="_rankBronze_xt8h9_187",ea="_skeletonPoster_xt8h9_198",ta="_skeletonText_xt8h9_199",v={sectionWrapper:qt,sectionTitleNoMargin:zt,"section-header":"_section-header_xt8h9_10","title-wrapper":"_title-wrapper_xt8h9_18","nav-arrows":"_nav-arrows_xt8h9_40","nav-button":"_nav-button_xt8h9_49",timeSelect:Gt,carouselContainer:Ut,carousel:Qt,carouselInner:Yt,carouselItem:Ht,rankCard:Xt,rankPill:Kt,rankGold:jt,rankSilver:Zt,rankBronze:Jt,skeletonPoster:ea,skeletonText:ta,"header-actions":"_header-actions_xt8h9_236"},xe="TRENDING_DESC",aa="POPULARITY_DESC",na=10;function ra({title:n,eyebrow:s}){const{lowEndMode:h}=Se(),[t,o]=oe("trending_sort",xe),l=[{value:xe,label:"Trending"},{value:aa,label:"All Time"}],{data:i,fetchNextPage:d,hasNextPage:T,isFetchingNextPage:_,isLoading:m,isError:p,error:N}=at(t,na),r=Q(()=>i?.pages.flatMap(g=>g)||[],[i]),w=P(()=>{T&&!_&&!m&&d()},[T,_,m,d]),{emblaRef:u,stepBy:c}=ge({onReachThreshold:w});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:g=>{g.preventDefault(),c("left",h)},"aria-label":"Scroll left",children:e(V,{name:"chevron-left"})}),e("button",{className:v["nav-button"],type:"button",onClick:g=>{g.preventDefault(),c("right",h)},"aria-label":"Scroll right",children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:v["header-actions"],children:e("select",{className:v.timeSelect,value:t,onChange:g=>o(g.currentTarget.value),children:l.map(g=>e("option",{value:g.value,children:g.label},g.value))})})]}),m?e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,children:e("div",{className:v.carouselInner,children:Array.from({length:7}).map((g,k)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.skeletonPoster}),e("div",{className:v.skeletonText})]},k))})})}):p?e(ke,{message:N instanceof Error?N.message:"An unknown error occurred"}):e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,ref:u,children:e("div",{className:v.carouselInner,children:[r.map((g,k)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.rankCard,children:e(le,{anime:g})}),e("div",{className:`${v.rankPill} ${k===0?v.rankGold:k===1?v.rankSilver:k===2?v.rankBronze:""}`,children:k+1})]},g._id)),_&&e("div",{className:v.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:v.skeletonPoster})})]})})})]})}const oa=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}],sa=10;function la({eyebrow:n}){const{lowEndMode:s}=Se(),[h,t]=oe("latest_releases_format","TV"),{data:o,fetchNextPage:l,hasNextPage:i,isFetchingNextPage:d,isLoading:T,isError:_,error:m}=nt(h,sa),p=Q(()=>o?.pages.flatMap(u=>u)||[],[o]),N=P(()=>{i&&!d&&!T&&l()},[i,d,T,l]),{emblaRef:r,stepBy:w}=ge({onReachThreshold:N});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:u=>{u.preventDefault(),w("left",s)},"aria-label":"Scroll left",children:e(V,{name:"chevron-left"})}),e("button",{className:v["nav-button"],type:"button",onClick:u=>{u.preventDefault(),w("right",s)},"aria-label":"Scroll right",children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:v["header-actions"],children:e("select",{className:v.timeSelect,value:h,onChange:u=>t(u.currentTarget.value),children:oa.map(u=>e("option",{value:u.value,children:u.label},u.value))})})]}),T?e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,children:e("div",{className:v.carouselInner,children:Array.from({length:7}).map((u,c)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.skeletonPoster}),e("div",{className:v.skeletonText})]},c))})})}):_?e(ke,{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(u=>e("div",{className:v.carouselItem,children:e(le,{anime:u})},u._id)),d&&e("div",{className:v.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:v.skeletonPoster})})]})})})]})}const ia="_scheduleSection_10dfe_1",ca="_sectionTitleRow_10dfe_5",da="_sectionTitleNoMargin_10dfe_11",ua="_sectionHeader_10dfe_15",ha="_headerActions_10dfe_25",pa="_timeSelect_10dfe_31",ma="_daySelectorContainer_10dfe_62",ga="_daySelector_10dfe_62",va="_daySelectorInner_10dfe_79",_a="_dayBtn_10dfe_90",fa="_active_10dfe_113",ba="_dayMonth_10dfe_121",ya="_dayNum_10dfe_129",Ta="_dayName_10dfe_135",Na="_navArrows_10dfe_148",Sa="_navButton_10dfe_157",wa="_carouselContainer_10dfe_181",ka="_carousel_10dfe_181",Ca="_carouselInner_10dfe_193",Ia="_carouselCard_10dfe_198",L={scheduleSection:ia,sectionTitleRow:ca,sectionTitleNoMargin:da,sectionHeader:ua,headerActions:ha,timeSelect:pa,daySelectorContainer:ma,daySelector:ga,daySelectorInner:va,dayBtn:_a,active:fa,dayMonth:ba,dayNum:ya,dayName:Ta,navArrows:Na,navButton:Sa,carouselContainer:wa,carousel:ka,carouselInner:Ca,carouselCard:Ia},ie=n=>{const s=n.getFullYear(),h=String(n.getMonth()+1).padStart(2,"0"),t=String(n.getDate()).padStart(2,"0");return`${s}-${h}-${t}`},Aa=async(n,s)=>await rt.data.schedule.query({date:n,format:s}),Ra=({eyebrow:n})=>{const[s,h]=E(()=>ie(new Date)),[t,o]=oe("schedule_format","TV"),{emblaRef:l,canScroll:i,stepBy:d,scrollToStart:T}=ge(),_=q(null),m=q(!0),{data:p=[],isLoading:N,error:r}=Ze({queryKey:[Oe.schedule,s,t],queryFn:()=>Aa(s,t),staleTime:1e3*60*5}),w=Q(()=>{const c=[],g=new Date,k=ie(g),S=new Date(g);S.setDate(g.getDate()-1);const A=ie(S),$=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let R=-6;R<=6;R++){const C=new Date(g);C.setDate(g.getDate()+R),c.push(C)}return c.map(R=>{const C=ie(R),I=C===k?"Today":C===A?"Yest":$[R.getDay()],F=R.getDate(),M=new Intl.DateTimeFormat("en-US",{month:"short"}).format(R);return{dateString:C,dayLabel:I,dayNum:F,monthName:M}})},[]);O(()=>{if(m.current){m.current=!1;return}if(_.current){const c=_.current.querySelector(`[data-date="${s}"]`);c&&c.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[s]),O(()=>{T(!0)},[s,T]);const u=[{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:()=>d("left"),"aria-label":"Scroll left",children:e(V,{name:"chevron-left"})}),e("button",{className:L.navButton,onClick:()=>d("right"),"aria-label":"Scroll right",children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:L.headerActions,children:e("select",{className:L.timeSelect,value:t,onChange:c=>o(c.currentTarget.value),children:u.map(c=>e("option",{value:c.value,children:c.label},c.value))})})]}),e("div",{className:L.daySelectorContainer,children:e("div",{className:L.daySelector,ref:_,children:e("div",{className:L.daySelectorInner,children:w.map(c=>e("button",{type:"button","data-date":c.dateString,className:`${L.dayBtn} ${s===c.dateString?L.active:""}`,onClick:()=>h(c.dateString),children:[e("span",{className:L.dayMonth,children:c.monthName}),e("span",{className:L.dayNum,children:c.dayNum}),e("span",{className:L.dayName,children:c.dayLabel})]},c.dateString))})})}),e("div",{className:L.carouselContainer,children:e("div",{className:L.carousel,ref:l,children:e("div",{className:L.carouselInner,children:N?Array.from({length:7}).map((c,g)=>e("div",{className:L.carouselCard,children:e(We,{layout:"vertical"})},g)):r?e("div",{style:{width:"100%"},children:e(ke,{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(c=>e("div",{className:L.carouselCard,children:e(le,{anime:c,continueWatching:!1,layout:"vertical"},c._id)},c._id))})})})]})},La="_bannerContainer_1l49p_1",$a="_hero_1l49p_28",Ma="_ambient_1l49p_37",xa="_ambientShow_1l49p_49",Ba="_scrim_1l49p_53",Pa="_progressLine_1l49p_69",Ea="_paused_1l49p_89",Da="_dots_1l49p_103",Wa="_dot_1l49p_103",Oa="_dotActive_1l49p_126",Va="_viewport_1l49p_137",Fa="_track_1l49p_144",qa="_slide_1l49p_150",za="_slideInner_1l49p_158",Ga="_poster_1l49p_168",Ua="_posterLandscape_1l49p_179",Qa="_info_1l49p_203",Ya="_kicker_1l49p_208",Ha="_featureLabel_1l49p_215",Xa="_scoreChip_1l49p_227",Ka="_rise_1l49p_245",ja="_active_1l49p_249",Za="_metaRow_1l49p_305",Ja="_metaItem_1l49p_316",en="_metaDivider_1l49p_322",tn="_title_1l49p_329",an="_genres_1l49p_345",nn="_genreTag_1l49p_353",rn="_summary_1l49p_364",on="_actions_1l49p_376",sn="_watchBtn_1l49p_383",ln="_detailsBtn_1l49p_405",cn="_navArrow_1l49p_426",dn="_prevArrow_1l49p_459",un="_nextArrow_1l49p_463",b={bannerContainer:La,hero:$a,ambient:Ma,ambientShow:xa,scrim:Ba,progressLine:Pa,paused:Ea,dots:Da,dot:Wa,dotActive:Oa,viewport:Va,track:Fa,slide:qa,slideInner:za,poster:Ga,posterLandscape:Ua,info:Qa,kicker:Ya,featureLabel:Ha,scoreChip:Xa,rise:Ka,active:ja,metaRow:Za,metaItem:Ja,metaDivider:en,title:tn,genres:an,genreTag:nn,summary:rn,actions:on,watchBtn:sn,detailsBtn:ln,navArrow:cn,prevArrow:dn,nextArrow:un},hn=8e3,ce=()=>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"}}),ve=({slides:n,posterAspect:s="portrait",eyebrow:h="Spotlight"})=>{const[t,o]=E(0),[l,i]=E(0),[d,T]=E(!1),[_,m]=E(null),[p,N]=E(0),[r,w]=E({front:"",back:"",flip:!1}),u=q(0),c=q(0),g=q(new Set),k=q(null),S=q(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 f=A(n[a]);w(y=>y.flip?{front:f,back:y.back,flip:!1}:{front:y.front,back:f,flip:!0}),o(a)},[$,n,A]),C=P(a=>{if(n.length===0)return;const f=(a%n.length+n.length)%n.length;g.current.has(A(n[f]))?R(f):m(f)},[n,A,R]);O(()=>{let a=!1;return n.forEach(f=>{const y=A(f);if(!y||g.current.has(y))return;const D=new Image;D.src=y;const K=()=>{a||g.current.has(y)||(g.current.add(y),N(z=>z+1))};D.onload=K,D.onerror=K}),()=>{a=!0}},[n,A]),O(()=>{if(n.length!==0&&!r.front){const a=A(n[0]);w({front:a,back:"",flip:!1})}},[n,r.front,A]),O(()=>{if(_!==null){if(_<0||_>=n.length){m(null);return}g.current.has(A(n[_]))&&R(_)}},[_,p,n,A,R]),O(()=>{if(_===null)return;k.current!==null&&window.clearTimeout(k.current);const a=_;return k.current=window.setTimeout(()=>{k.current=null,R(a)},2500),()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)}},[_,R]);const U=P(a=>{C(a)},[C]),x=P(()=>{C(S.current+1)},[C]),I=P(()=>{C(S.current-1)},[C]),F=q(null);if(O(()=>{const a=F.current;if(!a)return;const f=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-u.current<300)return;u.current=D,$(),y.deltaY>0?x():I()}};return a.addEventListener("wheel",f,{passive:!1}),()=>a.removeEventListener("wheel",f)},[n.length,x,I,$]),O(()=>{if(n.length===0||d)return;const a=setTimeout(x,hn);return()=>clearTimeout(a)},[t,x,n.length,l,d]),O(()=>{const a=f=>{const y=f.target;y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.tagName==="SELECT"||y.isContentEditable)||(f.key==="ArrowRight"?(f.preventDefault(),x()):f.key==="ArrowLeft"&&(f.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;S.current=M;const ee=a=>{c.current=a.touches[0].clientX},H=a=>{const y=a.changedTouches[0].clientX-c.current;Math.abs(y)>50&&($(),y>0?I():x())};return e("div",{className:b.bannerContainer,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:e("div",{className:`${b.hero} ${d?b.paused:""}`,onTouchStart:ee,onTouchEnd:H,children:[r.front&&e("img",{src:r.front,alt:"","aria-hidden":"true",className:`${b.ambient} ${r.flip?"":b.ambientShow}`}),r.back&&e("img",{src:r.back,alt:"","aria-hidden":"true",className:`${b.ambient} ${r.flip?b.ambientShow:""}`}),e("div",{className:b.scrim,"aria-hidden":"true"}),n.length>1&&e("div",{className:b.progressLine,"aria-hidden":"true"},`progress-${l}-${M}`),n.length>1&&e("div",{className:b.dots,ref:F,role:"tablist","aria-label":"Spotlight slides",children:n.map((a,f)=>e("button",{role:"tab","aria-selected":f===M,"aria-label":`Go to slide ${f+1}: ${a.title}`,className:`${b.dot} ${f===M?b.dotActive:""}`,onClick:()=>U(f),tabIndex:f===M?0:-1},a.key))}),e("div",{className:b.viewport,children:e("div",{className:b.track,style:{transform:`translateX(-${M*100}%)`},children:n.map((a,f)=>e("div",{className:`${b.slide} ${f===M?b.active:""}`,"aria-hidden":f!==M,children:e("div",{className:b.slideInner,children:[e("img",{src:a.posterSrc,alt:a.posterAlt,className:s==="landscape"?b.posterLandscape:b.poster,decoding:"async"}),e("div",{className:b.info,children:[e("div",{className:`${b.kicker} ${b.rise}`,children:[e("span",{className:b.featureLabel,children:h}),a.score!==void 0&&a.score!==null&&a.score!==""&&e("span",{className:b.scoreChip,children:[e(V,{name:"star",size:12}),e("span",{children:a.score})]})]}),e(Ee,{to:a.detailTo,className:`${b.title} ${b.rise}`,"aria-label":`View details for ${a.title}`,tabIndex:f===M?0:-1,children:a.title}),a.metaItems.length>0&&e("div",{className:`${b.metaRow} ${b.rise}`,children:a.metaItems.map((y,D)=>e(G.Fragment,{children:[e("span",{className:b.metaItem,children:y}),D<a.metaItems.length-1&&e("div",{className:b.metaDivider})]},D))}),a.tags.length>0&&e("div",{className:`${b.genres} ${b.rise}`,children:a.tags.slice(0,3).map(y=>e("span",{className:b.genreTag,children:y},y))}),a.synopsis&&e("p",{className:`${b.summary} ${b.rise}`,children:a.synopsis}),e("div",{className:`${b.actions} ${b.rise}`,children:[e("button",{className:b.watchBtn,onClick:a.onPrimary,tabIndex:f===M?0:-1,children:[e(V,{name:a.primaryIcon,size:14}),e("span",{children:a.primaryLabel})]}),e("button",{className:b.detailsBtn,onClick:a.onDetails,tabIndex:f===M?0:-1,children:[e(V,{name:"info-circle",size:15}),e("span",{children:"Details"})]})]})]})]})},a.key))})}),n.length>1&&e(se,{children:[e("button",{className:`${b.navArrow} ${b.prevArrow}`,onClick:()=>{$(),I()},"aria-label":"Previous slide",children:e(V,{name:"chevron-left",size:20})}),e("button",{className:`${b.navArrow} ${b.nextArrow}`,onClick:()=>{$(),x()},"aria-label":"Next slide",children:e(V,{name:"chevron-right",size:20})})]})]})})},pn=({animeList:n})=>{const{titlePreference:s}=Ve(),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:ot(o.description??""),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>h(`/watch/${o._id}`),onDetails:()=>h(`/anime/${o._id}`)}}),[n,s,h]);return e(ve,{slides:t})},mn="_emptyState_19tmt_1",gn="_emptyStateIcon_19tmt_16",vn="_emptyStateTitle_19tmt_23",_n="_emptyStateText_19tmt_30",de={emptyState:mn,emptyStateIcon:gn,emptyStateTitle:vn,emptyStateText:_n},_e=({icon:n,text:s,actionLabel:h,onAction:t,title:o="Nothing is here..."})=>e("div",{className:de.emptyState,children:[e(V,{name:n,size:48,className:de.emptyStateIcon}),e("div",{children:[e("h3",{className:de.emptyStateTitle,children:o}),e("p",{className:de.emptyStateText,children:s})]}),e(Fe,{variant:"primary",size:"sm",onClick:t,style:{marginTop:"1rem"},children:h})]}),fn="_select_1dw63_1",bn={select:fn},he=({value:n,options:s,onChange:h,ariaLabel:t,width:o})=>e("select",{className:bn.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))}),yn="_tabBar_irwbm_1",Tn="_tabIndicator_irwbm_24",Nn="_tabButton_irwbm_38",Sn="_tabActive_irwbm_64",ue={tabBar:yn,tabIndicator:Tn,tabButton:Nn,tabActive:Sn};function wn({options:n,value:s,onChange:h,ariaLabel:t},o){const l=q(null),i=q(new Map),d=q(null),[T,_]=E({left:0,width:0}),m=P((p,N)=>{const r=i.current.get(p),w=l.current;if(r&&w){const u=w.getBoundingClientRect(),c=r.getBoundingClientRect();_({left:c.left-u.left+w.scrollLeft,width:c.width}),N&&r.scrollIntoView({block:"nearest",inline:"nearest"})}},[]);return je(()=>{const p=d.current!==null&&d.current!==s;d.current=s,m(s,p)},[s,n.length,m]),O(()=>{if(m(s,!1),typeof ResizeObserver>"u")return;let p=0;const N=l.current;if(!N)return;const r=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(()=>m(s,!1))});r.observe(N);let w=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{w||m(s,!1)}),()=>{w=!0,cancelAnimationFrame(p),r.disconnect()}},[s,n.length,m]),e("div",{className:ue.tabBar,ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p)},"aria-label":t,children:[e("div",{className:ue.tabIndicator,style:{left:T.left,width:T.width}}),n.map(p=>e(Fe,{ref:N=>{N&&i.current.set(p.value,N)},variant:"secondary",size:"sm",className:`${ue.tabButton} ${s===p.value?ue.tabActive:""}`,onClick:()=>h(p.value),children:p.label},p.value))]})}const pe=G.forwardRef(wn),kn=[{value:"popular",label:"Popular"},{value:"followed",label:"Most Followed"},{value:"rating",label:"Top Rated"}],Be=({title:n,eyebrow:s,sort:h,mature:t,headerActions:o})=>{const{toggle:l,bookmarkedIds:i}=Ue(),{popup:d,openPopup:T,scheduleClose:_,cancelClose:m,closePopup:p}=ze(),{data:N,isLoading:r,fetchNextPage:w,hasNextPage:u,isFetchingNextPage:c}=yt({provider:"",query:"",sort:h,status:"",type:"",rating:t?"safe,suggestive,erotica,pornographic":"safe",mature:t}),g=Q(()=>N?.pages.flatMap(S=>S.items)??[],[N]),k=P(()=>{u&&!c&&!r&&w()},[u,c,r,w]);return e(se,{children:[e(Z,{title:n,eyebrow:s,loading:r,carousel:!0,itemCount:g.length,headerActions:o,onReachThreshold:k,isFetchingNextPage:c,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,children:g.map(S=>{const A=Ne(S.provider,S.id);return e(me,{item:{id:A,title:S.title,...Ye(S),thumbnail:Ce(S.provider,S.cover),typeBadge:S.type||void 0,chapterBadge:S.latestChapter?`Ch. ${S.latestChapter}`:null,isAdult:Qe(S)},linkTo:`/manga/${S.provider}/${encodeURIComponent(S.id)}`,hoverIcon:"info",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:$=>T($,{provider:S.provider,mangaId:S.id,title:S.title,altTitle:S.altTitle,cover:S.cover,contentRating:S.contentRating,readTarget:`/manga/${S.provider}/${encodeURIComponent(S.id)}`,mature:t}),onPopupHoverIntent:$=>$?m():_(),rawThumbnail:!0},`${S.provider}-${S.id}`)})}),d&&e(Ge,{data:d.data,anchorRect:d.rect,bookmarked:i.has(Ne(d.data.provider,d.data.mangaId)),onToggleBookmark:()=>l({id:d.data.mangaId,provider:d.data.provider,title:d.data.title,cover:d.data.cover,altTitle:d.data.altTitle??void 0,contentRating:d.data.contentRating}),onMouseEnter:m,onMouseLeave:_,onRequestClose:p})]})},Cn=()=>{const{options:n}=St(),s=Q(()=>n.some(d=>d.kind==="manga"),[n]),{hasConsent:h}=st(),[t,o]=oe("manga_discover_tab","latest"),[l,i]=oe("manga_trending_sort","popular");return s?e(se,{children:[e(pe,{ariaLabel:"Discover manga",options:[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],value:t,onChange:o}),t==="latest"?e(Be,{title:"Latest Releases",eyebrow:"Fresh chapters",sort:"latest",mature:h}):e(Be,{title:"Trending",eyebrow:"Discover",sort:l,mature:h,headerActions:e("select",{className:B["header-select"],value:l,onChange:d=>i(d.currentTarget.value),"aria-label":"Trending sort",children:kn.map(d=>e("option",{value:d.value,children:d.label},d.value))})})]}):null},In=()=>{const n=J(),{data:s,isLoading:h}=Tt(24),[t,o]=E(null),{popup:l,openPopup:i,scheduleClose:d,cancelClose:T,closePopup:_}=ze(),{toggle:m,bookmarkedIds:p}=Ue(),N=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:N.length>0,highlight:!0,itemCount:N.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(_e,{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:N.map(r=>{const w=r.page??0,u=r.pageCount??0,c=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(me,{item:{id:r.id,title:r.title||"",...Ye({title:r.title||"",altTitle:r.altTitle}),thumbnail:r.provider?Ce(r.provider,r.cover||""):r.cover||"",chapterBadge:r.chapterNumber?`Ch. ${r.chapterNumber}`:null,isAdult:Qe(r)},linkTo:c,hoverIcon:"book",progress:u>0?{percent:w/u*100,label:`Ch. ${r.chapterNumber} · p. ${w}/${u}`}: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:g=>i(g,{provider:r.provider||"",mangaId:r.mangaId||"",title:r.title||"",altTitle:r.altTitle,cover:r.cover||"",contentRating:r.contentRating||void 0,readTarget:c}),onPopupHoverIntent:g=>g?T():d(),rawThumbnail:!0},r.id)})}),e(bt,{mangaId:t?t.libId:null,title:t?.title,onClose:()=>o(null)}),l&&l.data.provider&&e(Ge,{data:l.data,anchorRect:l.rect,bookmarked:p.has(Ne(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:T,onMouseLeave:d,onRequestClose:_}),e(Cn,{})]})},An="_seasonGrid_knq79_24",X={"section-header":"_section-header_knq79_1","title-wrapper":"_title-wrapper_knq79_8","pagination-controls":"_pagination-controls_knq79_14",seasonGrid:An},Rn="_emptyState_bpz5x_1",Pe={emptyState:Rn},Ln=[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],$n=[{value:"trending_week",label:"Trending Now"},{value:"trending_day",label:"Trending Today"},{value:"popular",label:"Popular All Time"},{value:"top_rated",label:"Top Rated"}],Mn=()=>{const n=J(),{data:s,isLoading:h}=Ct(24),t=It(),o=At(),[l,i]=E(null),[d,T]=E(()=>localStorage.getItem("tv_home_activeTab")||"latest"),[_,m]=E("tv"),[p,N]=E("trending_week"),[r,w]=E("multi"),u=s?.data??[];G.useEffect(()=>{localStorage.setItem("tv_home_activeTab",d)},[d]);const c=p.startsWith("trending_"),g=p==="trending_day"?"day":"week",k={popular:"popularity.desc",top_rated:"vote_average.desc"},{data:S,isLoading:A}=He(r==="multi"?"all":r,g,1,c&&d==="trending"),{data:$,isLoading:R}=$e({type:r,sort_by:k[p]||"popularity.desc",page:1}),C=c?S?.results||[]:$?.results||[],U=c?A:R,{data:x,isLoading:I}=$e({type:_,sort_by:"primary_release_date.desc",page:1}),F=x?.results||[],M=a=>{l&&(o.mutate({mediaId:l.libId}),a&&t.mutate(l.libId))},ee=P(a=>e(wt,{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(d){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(he,{ariaLabel:"Latest type",value:_,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,f)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},f))}):F.length>0?e(Z,{carousel:!0,itemCount:F.length,children:F.map(ee)}):e("div",{className:Pe.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(he,{ariaLabel:"Trending sort",value:p,onChange:N,options:$n.map(a=>({value:a.value,label:a.label}))}),e(he,{ariaLabel:"Trending type",value:r,onChange:a=>w(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,f)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},f))}):C.length>0?e(Z,{carousel:!0,itemCount:C.length,children:C.map(ee)}):e("div",{className:Pe.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:u.length>0,highlight:!0,itemCount:u.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(_e,{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:u.map(a=>{const f=a.currentTime??0,y=a.duration??0,D=a.season??1,K=a.episode??1,z=a.mediaType==="movie",j=z?"Movie":`S${D} E${K}`,te=a.completed===1||y>0&&f>=y*.8,ae=te?100:y>0&&f>0?f/y*100:0,fe=te?"Watched":y>0?z?`${ne(f)} / ${ne(y)}`:`${j} · ${ne(f)} / ${ne(y)}`:j;return e(me,{item:{id:a.id,title:a.title||"",thumbnail:a.poster||"",typeBadge:z?"Movie":"TV",chapterBadge:j,isAdult:Lt({adult:a.adult===1})},linkTo:Rt(a.mediaType,a.tmdbId??0,z?void 0:D,z?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:(be,re)=>e(kt,{item:{id:a.tmdbId??0,title:a.title||"",year:a.year||"",type:a.mediaType||"tv",image:a.poster||""},anchorRect:be,onMouseEnter:re.onMouseEnter,onMouseLeave:re.onMouseLeave,onRequestClose:re.close})},a.id)})}),e(pe,{ariaLabel:"Browse TV",options:Ln,value:d,onChange:T}),e("div",{children:H()}),e(qe,{isOpen:!!l,itemName:l?.title,progressKind:"watch",listLabel:"my TV watchlist",onClose:()=>{i(null)},onConfirm:M})]})};function xn(n){const s=n.currentTime??0,h=n.duration??0,t=(n.trackIndex??0)+1;return h>0?`Track ${t} · ${ne(s)} / ${ne(h)}`:n.trackLabel?`Track ${t} · ${n.trackLabel}`:`Track ${t}`}const Bn=({title:n="Continue Listening",limit:s=24,titleLink:h,showEmptyState:t=!0})=>{const o=J(),{data:l,isLoading:i}=Pt(s),[d,T]=E(null),_=l?.data??[];return e(se,{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:_.length>0,highlight:!0,itemCount:_.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"16 / 9"}}),skeletonCount:7,emptyState:t?e(_e,{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:_.map(m=>{const p=m.currentTime??0,N=m.duration??0,r=m.rjCode||m.id;return e(me,{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:N>0?{percent:Math.min(100,p/N*100),label:xn(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:()=>T({workId:m.id,title:m.title||""}),rawThumbnail:!0},m.id)})}),e(Bt,{workId:d?d.workId:null,title:d?.title,onClose:()=>T(null)})]})},Pn=()=>e("div",{style:{paddingBottom:"2rem"},children:e(Bn,{})}),En=({items:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map(t=>{const o=$t(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=>Mt[l]??xt[l]).filter(Boolean),synopsis:we(t.overview,200),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>s(o),onDetails:()=>s(o)}}),[n,s]);return e(ve,{slides:h,eyebrow:"TV Spotlight"})},Dn=({mangaList:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map(t=>{const o=`/manga/${t.provider||"mangadex"}/${t.id}`,l=Ce(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:we(t.description,200,""),primaryLabel:"Read Now",primaryIcon:"book",onPrimary:()=>s(o),onDetails:()=>s(o)}}),[n,s]);return e(ve,{slides:h,eyebrow:"Manga Spotlight"})};function Wn(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 On=({works:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map((t,o)=>{const l=Et(t),i=`/asmr/${encodeURIComponent(l)}`,d=Wn(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,d?`${d} track${d===1?"":"s"}`:void 0].filter(T=>!!T),tags:[],synopsis:we(t.description,160,""),primaryLabel:"Listen Now",primaryIcon:"play",onPrimary:()=>s(i),onDetails:()=>s(i)}}),[n,s]);return e(ve,{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"}],mr=()=>{const n=Je(),s=lt(),[h,t]=G.useState(1),[o,l]=E(()=>localStorage.getItem("home_activeTab")||"latest"),[i,d]=E(()=>localStorage.getItem("season_format")||"TV"),T=q(null),{data:_}=Le(h+1,i,o==="season"),{titlePreference:m}=Ve(),{contentType:p,setContentType:N}=it(),[r,w]=G.useState(null),u=ct(),{data:c=[]}=dt(),g=ut(),k=ht(),S=pt();O(()=>{document.title="Home - dango"},[]);const{data:A,isLoading:$}=mt();O(()=>{localStorage.setItem("home_activeTab",o)},[o]),O(()=>{localStorage.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}=gt(),F=P(()=>{x&&!I&&!C&&U()},[x,I,C,U]),{data:M,isLoading:ee}=vt(),{data:H,isLoading:a}=He("all","week",1,p==="tv"),{data:f,isLoading:y}=Dt(p==="asmr"),{data:D,isLoading:K}=Nt(),z=Q(()=>R?.pages||[],[R]),{data:j,isLoading:te}=Le(h,i,o==="season"),ae=14,fe=j&&j.length>=ae&&_&&_.length>0,be=et(s.continueWatching.remove.mutationOptions({onSuccess:async()=>{n.invalidateQueries(s.continueWatching.pathFilter()),await n.invalidateQueries({queryKey:[Oe.continueWatching]}),x&&z.length-1<14&&U()}})),re=P(W=>{const Y=z?.find(ye=>String(ye.id)===String(W));if(Y){const ye=Y[m]||Y.name;w({id:W,name:ye})}},[z,m]),Ie=[{key:"latest",label:"Latest Releases"},{key:"season",label:"Current Season"},{key:"popular",label:"Trending"}],Ae=A!==void 0&&A.length>0,Xe=Ae?[{key:"week",label:"This Week"},...Ie]:Ie,Re=o==="week"&&!Ae?"latest":o,Ke=()=>{switch(Re){case"latest":return e(la,{eyebrow:"Fresh episodes"});case"season":return e("section",{style:{marginBottom:"2.5rem"},children:[e("div",{className:X["section-header"],ref:T,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(he,{ariaLabel:"Season format",width:90,value:i,onChange:d,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(tt,{page:h,canGoNext:fe,onChange:W=>{if(t(W),T.current){const Y=T.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(De,{count:ae}):j?.slice(0,ae).map(W=>e(le,{anime:W},W._id))})]});case"popular":return e(ra,{title:"Trending",eyebrow:"Discover"});case"week":return e(Me,{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(ce,{}):M&&M.length>0&&e(pn,{animeList:M})),p==="tv"&&(a&&!H?.results?.length?e(ce,{}):H?.results&&H.results.length>0&&e(En,{items:H.results})),p==="manga"&&(K&&!D?.length?e(ce,{}):D&&D.length>0&&e(Dn,{mangaList:D})),p==="asmr"&&(y&&!f?.length?e(ce,{}):f&&f.length>0&&e(On,{works:f})),e(pe,{ariaLabel:"Content type",options:Vn,value:p,onChange:N}),p==="manga"?e(In,{}):p==="tv"?e(Mn,{}):p==="asmr"?e(Pn,{}):e(se,{children:[e(Me,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/watchlist/Continue Watching",animeList:z,continueWatching:!0,carousel:!0,collapsible:!0,defaultExpanded:z.length>0,onRemove:re,loading:C,onReachThreshold:F,scrollThreshold:.7,isFetchingNextPage:I,emptyState:e(_e,{icon:"history",text:"You haven't watched anything yet. Start exploring and watch something first!",actionLabel:"Explore Trending",onAction:()=>l("popular")})}),e(ft,{title:"Queue",eyebrow:"Up next",items:c,onRemove:W=>g.mutate({showId:W.showId,episodeNumber:W.episodeNumber}),showClearAll:!0,onClear:()=>k.mutate(),onReorder:W=>S.mutate(W.map(Y=>({id:Y.id,showId:Y.showId,episodeNumber:Y.episodeNumber})))}),e(pe,{ariaLabel:"Browse anime",options:Xe.map(W=>({value:W.key,label:W.label})),value:Re,onChange:l}),e("div",{children:Ke()}),e(Ra,{eyebrow:"Never miss an episode"}),e(qe,{isOpen:!!r,itemName:r?.name,progressKind:"watch",listLabel:"my watchlist",onClose:()=>{w(null)},onConfirm:W=>{r&&(be.mutate({showId:r.id}),W&&u.mutate({id:r.id}))}})]})]})};export{mr as default};
|
|
1
|
+
import{d as E,A as q,h as O,q as P,g as G,u as e,L as Ee,T as Q,S as se,a as J,_ as je}from"./vendor-core-DfaOB3Rn.js";import{b as Ze,u as Je,a as et}from"./vendor-query-BBT5_sHx.js";import{M as me,P as tt}from"./MediaCard-hWGCEHWx.js";import{A as le}from"./AnimeCard-BVufFeLC.js";import{S as De,A as We}from"./SkeletonGrid-QWMGLCGp.js";import{I as V}from"./vendor-icons-DrybRNxP.js";import{u as Se,a as oe,b as at,c as nt,q as Oe,t as rt,d as Ve,s as ot,f as Te,B as Fe,e as st,g as ne,h as we,i as lt,j as Le,k as it,l as ct,m as dt,n as ut,o as ht,p as pt,r as mt,v as gt,w as vt}from"./index-DB81Su4I.js";import{u as _t}from"./vendor-ui-3qrARCPr.js";import{E as ke}from"./ErrorMessage-DAxegITP.js";import{R as qe}from"./ResetProgressModal-BuESoxbY.js";import{Q as ft}from"./QueueRail-Dkx_M6ng.js";import{u as ze,M as Ge}from"./useMangaPopup-3Lx5tEub.js";import{M as bt}from"./MangaResetProgressModal-CbMR36Zu.js";import{u as Ue,a as yt,m as Ne,i as Qe,b as Ce,c as Ye,d as Tt,e as Nt}from"./useMangaLibrary-BAUaug-u.js";import{u as St}from"./useProviders-CKqOSX5-.js";import{u as He,a as $e,T as wt}from"./useTv-CZB47zUF.js";import{T as kt}from"./TvPopup-DZtX79Ol.js";import{u as Ct,a as It,b as At,t as Rt,i as Lt,c as $t,M as Mt,T as xt}from"./useTvLibrary-BGz7Unv_.js";import{A as Bt}from"./AsmrResetProgressModal-cYO4Sr2k.js";import{u as Pt,a as Et,b as Dt}from"./useAsmr-BwyYDnlP.js";import"./useIsMobile-Dvx1uJ82.js";import"./MatureConsentModal-BnB-RHYQ.js";import"./useAnimeInfoData-DpUA78Mv.js";import"./QueueOptionsButton-B4Re8F3V.js";import"./playbackCompletion-IPHm9fp5.js";import"./usePopup-DS9jMzp6.js";import"./libraryInvalidation-DI-v-DQ1.js";const Wt="_sectionWrapper_2p2l1_9",Ot="_sectionTitleNoMargin_2p2l1_13",Vt="_carousel_2p2l1_178",B={"section-header":"_section-header_2p2l1_1",sectionWrapper:Wt,sectionTitleNoMargin:Ot,"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:Vt,"carousel-inner":"_carousel-inner_2p2l1_187","carousel-card":"_carousel-card_2p2l1_192"};function ge({align:n="start",containScroll:s="trimSnaps",scrollFraction:h=.8,threshold:t=.6,onReachThreshold:o}={}){const[l,i]=_t({align:n,containScroll:s,dragFree:!0}),[d,T]=E(!1),_=q({scrollFraction:h,threshold:t,onReachThreshold:o}),m=q(!1);O(()=>{_.current={scrollFraction:h,threshold:t,onReachThreshold:o}});const p=P(u=>{T(u.canScrollPrev()||u.canScrollNext())},[]);O(()=>{if(!i)return;const u=()=>{const c=i.scrollProgress();c>=_.current.threshold&&!m.current?(m.current=!0,_.current.onReachThreshold?.()):c<_.current.threshold&&(m.current=!1),p(i)};return i.on("init",u),i.on("reInit",u),i.on("scroll",u),i.on("resize",u),()=>{i.off("init",u),i.off("reInit",u),i.off("scroll",u),i.off("resize",u)}},[i,p]);const N=P(u=>{const c=u.containerNode().firstElementChild;if(!c)return 1;const g=u.rootNode().getBoundingClientRect().width,k=c.getBoundingClientRect().width;return k?Math.max(1,Math.round(g/k)):1},[]),r=P((u,c=!1)=>{if(!i)return;const g=Math.max(1,Math.round(N(i)*_.current.scrollFraction)),k=i.selectedScrollSnap()+(u==="left"?-g:g);i.scrollTo(k,c)},[i,N]),w=P((u=!1)=>{i?.scrollTo(0,u)},[i]);return{emblaRef:l,api:i,canScroll:d,stepBy:r,scrollToStart:w}}const Z=({title:n,eyebrow:s,titleLink:h,loading:t,emptyState:o,carousel:l,layout:i,collapsible:d,defaultExpanded:T=!0,onReachThreshold:_,scrollThreshold:m,isFetchingNextPage:p,resetScrollOnShrink:N,itemCount:r=0,highlight:w,headerActions:u,loadingSkeleton:c,skeletonCount:g=7,children:k})=>{const{lowEndMode:S}=Se(),{emblaRef:A,stepBy:$,scrollToStart:R}=ge({onReachThreshold:_,threshold:m}),[C,U]=G.useState(T);G.useEffect(()=>{U(T)},[T]);const x=G.useRef(0);return G.useEffect(()=>{N&&r>0&&C&&(r<=x.current||x.current===0)&&R(),r>0&&(x.current=r)},[r,N,C,R]),!t&&r===0&&!o&&!d?null:e("section",{className:`${B.sectionWrapper} ${w?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(Ee,{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",S)},children:e(V,{name:"chevron-left"})}),e("button",{className:B["nav-button"],type:"button","aria-label":"Scroll right",onClick:I=>{I.preventDefault(),$("right",S)},children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:B["header-controls"],children:[u,d&&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(V,{name:"chevron-up"}):e(V,{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:g}).map((I,F)=>e("div",{className:B["carousel-card"],children:c},F)):G.Children.map(k,(I,F)=>e("div",{className:B["carousel-card"],children:I},G.isValidElement(I)&&I.key!=null?I.key:`slide-${F}`)),p&&c&&e("div",{className:B["carousel-card"],children:c})]})})}):e("div",{className:"grid-container",children:t&&r===0?e(De,{count:6,layout:i}):r>0?k:t?null:e("div",{style:{gridColumn:"1 / -1"},children:o})}))]})},Ft=({title:n,eyebrow:s,animeList:h,continueWatching:t,titleLink:o,onRemove:l,loading:i,emptyState:d,carousel:T,cardConfig:_,layout:m,onReachThreshold:p,scrollThreshold:N,isFetchingNextPage:r,collapsible:w,defaultExpanded:u=!0})=>{const c=m||"vertical";return e(Z,{title:n,eyebrow:s,titleLink:o,loading:i,emptyState:d,carousel:T,layout:c,collapsible:w,defaultExpanded:u,onReachThreshold:p,scrollThreshold:N,isFetchingNextPage:r,resetScrollOnShrink:t,highlight:t,itemCount:h.length,loadingSkeleton:e(We,{layout:c}),skeletonCount:7,children:h.map(g=>e(le,{anime:g,continueWatching:t,onRemove:l,config:_,layout:c},g._id))})},Me=G.memo(Ft),qt="_sectionWrapper_xt8h9_2",zt="_sectionTitleNoMargin_xt8h9_6",Gt="_timeSelect_xt8h9_80",Ut="_carouselContainer_xt8h9_111",Qt="_carousel_xt8h9_111",Yt="_carouselInner_xt8h9_122",Ht="_carouselItem_xt8h9_127",Xt="_rankCard_xt8h9_164",Kt="_rankPill_xt8h9_168",jt="_rankGold_xt8h9_179",Zt="_rankSilver_xt8h9_183",Jt="_rankBronze_xt8h9_187",ea="_skeletonPoster_xt8h9_198",ta="_skeletonText_xt8h9_199",v={sectionWrapper:qt,sectionTitleNoMargin:zt,"section-header":"_section-header_xt8h9_10","title-wrapper":"_title-wrapper_xt8h9_18","nav-arrows":"_nav-arrows_xt8h9_40","nav-button":"_nav-button_xt8h9_49",timeSelect:Gt,carouselContainer:Ut,carousel:Qt,carouselInner:Yt,carouselItem:Ht,rankCard:Xt,rankPill:Kt,rankGold:jt,rankSilver:Zt,rankBronze:Jt,skeletonPoster:ea,skeletonText:ta,"header-actions":"_header-actions_xt8h9_236"},xe="TRENDING_DESC",aa="POPULARITY_DESC",na=10;function ra({title:n,eyebrow:s}){const{lowEndMode:h}=Se(),[t,o]=oe("trending_sort",xe),l=[{value:xe,label:"Trending"},{value:aa,label:"All Time"}],{data:i,fetchNextPage:d,hasNextPage:T,isFetchingNextPage:_,isLoading:m,isError:p,error:N}=at(t,na),r=Q(()=>i?.pages.flatMap(g=>g)||[],[i]),w=P(()=>{T&&!_&&!m&&d()},[T,_,m,d]),{emblaRef:u,stepBy:c}=ge({onReachThreshold:w});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:g=>{g.preventDefault(),c("left",h)},"aria-label":"Scroll left",children:e(V,{name:"chevron-left"})}),e("button",{className:v["nav-button"],type:"button",onClick:g=>{g.preventDefault(),c("right",h)},"aria-label":"Scroll right",children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:v["header-actions"],children:e("select",{className:v.timeSelect,value:t,onChange:g=>o(g.currentTarget.value),children:l.map(g=>e("option",{value:g.value,children:g.label},g.value))})})]}),m?e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,children:e("div",{className:v.carouselInner,children:Array.from({length:7}).map((g,k)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.skeletonPoster}),e("div",{className:v.skeletonText})]},k))})})}):p?e(ke,{message:N instanceof Error?N.message:"An unknown error occurred"}):e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,ref:u,children:e("div",{className:v.carouselInner,children:[r.map((g,k)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.rankCard,children:e(le,{anime:g})}),e("div",{className:`${v.rankPill} ${k===0?v.rankGold:k===1?v.rankSilver:k===2?v.rankBronze:""}`,children:k+1})]},g._id)),_&&e("div",{className:v.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:v.skeletonPoster})})]})})})]})}const oa=[{value:"TV",label:"TV"},{value:"ONA",label:"ONA"},{value:"OVA",label:"OVA"},{value:"MOVIE",label:"Movie"},{value:"ALL",label:"All"},{value:"ADULT",label:"Mature"}],sa=10;function la({eyebrow:n}){const{lowEndMode:s}=Se(),[h,t]=oe("latest_releases_format","TV"),{data:o,fetchNextPage:l,hasNextPage:i,isFetchingNextPage:d,isLoading:T,isError:_,error:m}=nt(h,sa),p=Q(()=>o?.pages.flatMap(u=>u)||[],[o]),N=P(()=>{i&&!d&&!T&&l()},[i,d,T,l]),{emblaRef:r,stepBy:w}=ge({onReachThreshold:N});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:u=>{u.preventDefault(),w("left",s)},"aria-label":"Scroll left",children:e(V,{name:"chevron-left"})}),e("button",{className:v["nav-button"],type:"button",onClick:u=>{u.preventDefault(),w("right",s)},"aria-label":"Scroll right",children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:v["header-actions"],children:e("select",{className:v.timeSelect,value:h,onChange:u=>t(u.currentTarget.value),children:oa.map(u=>e("option",{value:u.value,children:u.label},u.value))})})]}),T?e("div",{className:v.carouselContainer,children:e("div",{className:v.carousel,children:e("div",{className:v.carouselInner,children:Array.from({length:7}).map((u,c)=>e("div",{className:v.carouselItem,children:[e("div",{className:v.skeletonPoster}),e("div",{className:v.skeletonText})]},c))})})}):_?e(ke,{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(u=>e("div",{className:v.carouselItem,children:e(le,{anime:u})},u._id)),d&&e("div",{className:v.carouselItem,style:{minWidth:"150px",display:"flex",alignItems:"center",justifyContent:"center"},children:e("div",{className:v.skeletonPoster})})]})})})]})}const ia="_scheduleSection_10dfe_1",ca="_sectionTitleRow_10dfe_5",da="_sectionTitleNoMargin_10dfe_11",ua="_sectionHeader_10dfe_15",ha="_headerActions_10dfe_25",pa="_timeSelect_10dfe_31",ma="_daySelectorContainer_10dfe_62",ga="_daySelector_10dfe_62",va="_daySelectorInner_10dfe_79",_a="_dayBtn_10dfe_90",fa="_active_10dfe_113",ba="_dayMonth_10dfe_121",ya="_dayNum_10dfe_129",Ta="_dayName_10dfe_135",Na="_navArrows_10dfe_148",Sa="_navButton_10dfe_157",wa="_carouselContainer_10dfe_181",ka="_carousel_10dfe_181",Ca="_carouselInner_10dfe_193",Ia="_carouselCard_10dfe_198",L={scheduleSection:ia,sectionTitleRow:ca,sectionTitleNoMargin:da,sectionHeader:ua,headerActions:ha,timeSelect:pa,daySelectorContainer:ma,daySelector:ga,daySelectorInner:va,dayBtn:_a,active:fa,dayMonth:ba,dayNum:ya,dayName:Ta,navArrows:Na,navButton:Sa,carouselContainer:wa,carousel:ka,carouselInner:Ca,carouselCard:Ia},ie=n=>{const s=n.getFullYear(),h=String(n.getMonth()+1).padStart(2,"0"),t=String(n.getDate()).padStart(2,"0");return`${s}-${h}-${t}`},Aa=async(n,s)=>await rt.data.schedule.query({date:n,format:s}),Ra=({eyebrow:n})=>{const[s,h]=E(()=>ie(new Date)),[t,o]=oe("schedule_format","TV"),{emblaRef:l,canScroll:i,stepBy:d,scrollToStart:T}=ge(),_=q(null),m=q(!0),{data:p=[],isLoading:N,error:r}=Ze({queryKey:[Oe.schedule,s,t],queryFn:()=>Aa(s,t),staleTime:1e3*60*5}),w=Q(()=>{const c=[],g=new Date,k=ie(g),S=new Date(g);S.setDate(g.getDate()-1);const A=ie(S),$=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];for(let R=-6;R<=6;R++){const C=new Date(g);C.setDate(g.getDate()+R),c.push(C)}return c.map(R=>{const C=ie(R),I=C===k?"Today":C===A?"Yest":$[R.getDay()],F=R.getDate(),M=new Intl.DateTimeFormat("en-US",{month:"short"}).format(R);return{dateString:C,dayLabel:I,dayNum:F,monthName:M}})},[]);O(()=>{if(m.current){m.current=!1;return}if(_.current){const c=_.current.querySelector(`[data-date="${s}"]`);c&&c.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})}},[s]),O(()=>{T(!0)},[s,T]);const u=[{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:()=>d("left"),"aria-label":"Scroll left",children:e(V,{name:"chevron-left"})}),e("button",{className:L.navButton,onClick:()=>d("right"),"aria-label":"Scroll right",children:e(V,{name:"chevron-right"})})]})]}),e("div",{className:L.headerActions,children:e("select",{className:L.timeSelect,value:t,onChange:c=>o(c.currentTarget.value),children:u.map(c=>e("option",{value:c.value,children:c.label},c.value))})})]}),e("div",{className:L.daySelectorContainer,children:e("div",{className:L.daySelector,ref:_,children:e("div",{className:L.daySelectorInner,children:w.map(c=>e("button",{type:"button","data-date":c.dateString,className:`${L.dayBtn} ${s===c.dateString?L.active:""}`,onClick:()=>h(c.dateString),children:[e("span",{className:L.dayMonth,children:c.monthName}),e("span",{className:L.dayNum,children:c.dayNum}),e("span",{className:L.dayName,children:c.dayLabel})]},c.dateString))})})}),e("div",{className:L.carouselContainer,children:e("div",{className:L.carousel,ref:l,children:e("div",{className:L.carouselInner,children:N?Array.from({length:7}).map((c,g)=>e("div",{className:L.carouselCard,children:e(We,{layout:"vertical"})},g)):r?e("div",{style:{width:"100%"},children:e(ke,{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(c=>e("div",{className:L.carouselCard,children:e(le,{anime:c,continueWatching:!1,layout:"vertical"},c._id)},c._id))})})})]})},La="_bannerContainer_1l49p_1",$a="_hero_1l49p_28",Ma="_ambient_1l49p_37",xa="_ambientShow_1l49p_49",Ba="_scrim_1l49p_53",Pa="_progressLine_1l49p_69",Ea="_paused_1l49p_89",Da="_dots_1l49p_103",Wa="_dot_1l49p_103",Oa="_dotActive_1l49p_126",Va="_viewport_1l49p_137",Fa="_track_1l49p_144",qa="_slide_1l49p_150",za="_slideInner_1l49p_158",Ga="_poster_1l49p_168",Ua="_posterLandscape_1l49p_179",Qa="_info_1l49p_203",Ya="_kicker_1l49p_208",Ha="_featureLabel_1l49p_215",Xa="_scoreChip_1l49p_227",Ka="_rise_1l49p_245",ja="_active_1l49p_249",Za="_metaRow_1l49p_305",Ja="_metaItem_1l49p_316",en="_metaDivider_1l49p_322",tn="_title_1l49p_329",an="_genres_1l49p_345",nn="_genreTag_1l49p_353",rn="_summary_1l49p_364",on="_actions_1l49p_376",sn="_watchBtn_1l49p_383",ln="_detailsBtn_1l49p_405",cn="_navArrow_1l49p_426",dn="_prevArrow_1l49p_459",un="_nextArrow_1l49p_463",b={bannerContainer:La,hero:$a,ambient:Ma,ambientShow:xa,scrim:Ba,progressLine:Pa,paused:Ea,dots:Da,dot:Wa,dotActive:Oa,viewport:Va,track:Fa,slide:qa,slideInner:za,poster:Ga,posterLandscape:Ua,info:Qa,kicker:Ya,featureLabel:Ha,scoreChip:Xa,rise:Ka,active:ja,metaRow:Za,metaItem:Ja,metaDivider:en,title:tn,genres:an,genreTag:nn,summary:rn,actions:on,watchBtn:sn,detailsBtn:ln,navArrow:cn,prevArrow:dn,nextArrow:un},hn=8e3,ce=()=>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"}}),ve=({slides:n,posterAspect:s="portrait",eyebrow:h="Spotlight"})=>{const[t,o]=E(0),[l,i]=E(0),[d,T]=E(!1),[_,m]=E(null),[p,N]=E(0),[r,w]=E({front:"",back:"",flip:!1}),u=q(0),c=q(0),g=q(new Set),k=q(null),S=q(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 f=A(n[a]);w(y=>y.flip?{front:f,back:y.back,flip:!1}:{front:y.front,back:f,flip:!0}),o(a)},[$,n,A]),C=P(a=>{if(n.length===0)return;const f=(a%n.length+n.length)%n.length;g.current.has(A(n[f]))?R(f):m(f)},[n,A,R]);O(()=>{let a=!1;return n.forEach(f=>{const y=A(f);if(!y||g.current.has(y))return;const D=new Image;D.src=y;const K=()=>{a||g.current.has(y)||(g.current.add(y),N(z=>z+1))};D.onload=K,D.onerror=K}),()=>{a=!0}},[n,A]),O(()=>{if(n.length!==0&&!r.front){const a=A(n[0]);w({front:a,back:"",flip:!1})}},[n,r.front,A]),O(()=>{if(_!==null){if(_<0||_>=n.length){m(null);return}g.current.has(A(n[_]))&&R(_)}},[_,p,n,A,R]),O(()=>{if(_===null)return;k.current!==null&&window.clearTimeout(k.current);const a=_;return k.current=window.setTimeout(()=>{k.current=null,R(a)},2500),()=>{k.current!==null&&(window.clearTimeout(k.current),k.current=null)}},[_,R]);const U=P(a=>{C(a)},[C]),x=P(()=>{C(S.current+1)},[C]),I=P(()=>{C(S.current-1)},[C]),F=q(null);if(O(()=>{const a=F.current;if(!a)return;const f=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-u.current<300)return;u.current=D,$(),y.deltaY>0?x():I()}};return a.addEventListener("wheel",f,{passive:!1}),()=>a.removeEventListener("wheel",f)},[n.length,x,I,$]),O(()=>{if(n.length===0||d)return;const a=setTimeout(x,hn);return()=>clearTimeout(a)},[t,x,n.length,l,d]),O(()=>{const a=f=>{const y=f.target;y&&(y.tagName==="INPUT"||y.tagName==="TEXTAREA"||y.tagName==="SELECT"||y.isContentEditable)||(f.key==="ArrowRight"?(f.preventDefault(),x()):f.key==="ArrowLeft"&&(f.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;S.current=M;const ee=a=>{c.current=a.touches[0].clientX},H=a=>{const y=a.changedTouches[0].clientX-c.current;Math.abs(y)>50&&($(),y>0?I():x())};return e("div",{className:b.bannerContainer,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:e("div",{className:`${b.hero} ${d?b.paused:""}`,onTouchStart:ee,onTouchEnd:H,children:[r.front&&e("img",{src:r.front,alt:"","aria-hidden":"true",className:`${b.ambient} ${r.flip?"":b.ambientShow}`}),r.back&&e("img",{src:r.back,alt:"","aria-hidden":"true",className:`${b.ambient} ${r.flip?b.ambientShow:""}`}),e("div",{className:b.scrim,"aria-hidden":"true"}),n.length>1&&e("div",{className:b.progressLine,"aria-hidden":"true"},`progress-${l}-${M}`),n.length>1&&e("div",{className:b.dots,ref:F,role:"tablist","aria-label":"Spotlight slides",children:n.map((a,f)=>e("button",{role:"tab","aria-selected":f===M,"aria-label":`Go to slide ${f+1}: ${a.title}`,className:`${b.dot} ${f===M?b.dotActive:""}`,onClick:()=>U(f),tabIndex:f===M?0:-1},a.key))}),e("div",{className:b.viewport,children:e("div",{className:b.track,style:{transform:`translateX(-${M*100}%)`},children:n.map((a,f)=>e("div",{className:`${b.slide} ${f===M?b.active:""}`,"aria-hidden":f!==M,children:e("div",{className:b.slideInner,children:[e("img",{src:a.posterSrc,alt:a.posterAlt,className:s==="landscape"?b.posterLandscape:b.poster,decoding:"async"}),e("div",{className:b.info,children:[e("div",{className:`${b.kicker} ${b.rise}`,children:[e("span",{className:b.featureLabel,children:h}),a.score!==void 0&&a.score!==null&&a.score!==""&&e("span",{className:b.scoreChip,children:[e(V,{name:"star",size:12}),e("span",{children:a.score})]})]}),e(Ee,{to:a.detailTo,className:`${b.title} ${b.rise}`,"aria-label":`View details for ${a.title}`,tabIndex:f===M?0:-1,children:a.title}),a.metaItems.length>0&&e("div",{className:`${b.metaRow} ${b.rise}`,children:a.metaItems.map((y,D)=>e(G.Fragment,{children:[e("span",{className:b.metaItem,children:y}),D<a.metaItems.length-1&&e("div",{className:b.metaDivider})]},D))}),a.tags.length>0&&e("div",{className:`${b.genres} ${b.rise}`,children:a.tags.slice(0,3).map(y=>e("span",{className:b.genreTag,children:y},y))}),a.synopsis&&e("p",{className:`${b.summary} ${b.rise}`,children:a.synopsis}),e("div",{className:`${b.actions} ${b.rise}`,children:[e("button",{className:b.watchBtn,onClick:a.onPrimary,tabIndex:f===M?0:-1,children:[e(V,{name:a.primaryIcon,size:14}),e("span",{children:a.primaryLabel})]}),e("button",{className:b.detailsBtn,onClick:a.onDetails,tabIndex:f===M?0:-1,children:[e(V,{name:"info-circle",size:15}),e("span",{children:"Details"})]})]})]})]})},a.key))})}),n.length>1&&e(se,{children:[e("button",{className:`${b.navArrow} ${b.prevArrow}`,onClick:()=>{$(),I()},"aria-label":"Previous slide",children:e(V,{name:"chevron-left",size:20})}),e("button",{className:`${b.navArrow} ${b.nextArrow}`,onClick:()=>{$(),x()},"aria-label":"Next slide",children:e(V,{name:"chevron-right",size:20})})]})]})})},pn=({animeList:n})=>{const{titlePreference:s}=Ve(),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:ot(o.description??""),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>h(`/watch/${o._id}`),onDetails:()=>h(`/anime/${o._id}`)}}),[n,s,h]);return e(ve,{slides:t})},mn="_emptyState_19tmt_1",gn="_emptyStateIcon_19tmt_16",vn="_emptyStateTitle_19tmt_23",_n="_emptyStateText_19tmt_30",de={emptyState:mn,emptyStateIcon:gn,emptyStateTitle:vn,emptyStateText:_n},_e=({icon:n,text:s,actionLabel:h,onAction:t,title:o="Nothing is here..."})=>e("div",{className:de.emptyState,children:[e(V,{name:n,size:48,className:de.emptyStateIcon}),e("div",{children:[e("h3",{className:de.emptyStateTitle,children:o}),e("p",{className:de.emptyStateText,children:s})]}),e(Fe,{variant:"primary",size:"sm",onClick:t,style:{marginTop:"1rem"},children:h})]}),fn="_select_1dw63_1",bn={select:fn},he=({value:n,options:s,onChange:h,ariaLabel:t,width:o})=>e("select",{className:bn.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))}),yn="_tabBar_irwbm_1",Tn="_tabIndicator_irwbm_24",Nn="_tabButton_irwbm_38",Sn="_tabActive_irwbm_64",ue={tabBar:yn,tabIndicator:Tn,tabButton:Nn,tabActive:Sn};function wn({options:n,value:s,onChange:h,ariaLabel:t},o){const l=q(null),i=q(new Map),d=q(null),[T,_]=E({left:0,width:0}),m=P((p,N)=>{const r=i.current.get(p),w=l.current;if(r&&w){const u=w.getBoundingClientRect(),c=r.getBoundingClientRect();_({left:c.left-u.left+w.scrollLeft,width:c.width}),N&&r.scrollIntoView({block:"nearest",inline:"nearest"})}},[]);return je(()=>{const p=d.current!==null&&d.current!==s;d.current=s,m(s,p)},[s,n.length,m]),O(()=>{if(m(s,!1),typeof ResizeObserver>"u")return;let p=0;const N=l.current;if(!N)return;const r=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(()=>m(s,!1))});r.observe(N);let w=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{w||m(s,!1)}),()=>{w=!0,cancelAnimationFrame(p),r.disconnect()}},[s,n.length,m]),e("div",{className:ue.tabBar,ref:p=>{l.current=p,typeof o=="function"?o(p):o&&(o.current=p)},"aria-label":t,children:[e("div",{className:ue.tabIndicator,style:{left:T.left,width:T.width}}),n.map(p=>e(Fe,{ref:N=>{N&&i.current.set(p.value,N)},variant:"secondary",size:"sm",className:`${ue.tabButton} ${s===p.value?ue.tabActive:""}`,onClick:()=>h(p.value),children:p.label},p.value))]})}const pe=G.forwardRef(wn),kn=[{value:"popular",label:"Popular"},{value:"followed",label:"Most Followed"},{value:"rating",label:"Top Rated"}],Be=({title:n,eyebrow:s,sort:h,mature:t,headerActions:o})=>{const{toggle:l,bookmarkedIds:i}=Ue(),{popup:d,openPopup:T,scheduleClose:_,cancelClose:m,closePopup:p}=ze(),{data:N,isLoading:r,fetchNextPage:w,hasNextPage:u,isFetchingNextPage:c}=yt({provider:"",query:"",sort:h,status:"",type:"",rating:t?"safe,suggestive,erotica,pornographic":"safe",mature:t}),g=Q(()=>N?.pages.flatMap(S=>S.items)??[],[N]),k=P(()=>{u&&!c&&!r&&w()},[u,c,r,w]);return e(se,{children:[e(Z,{title:n,eyebrow:s,loading:r,carousel:!0,itemCount:g.length,headerActions:o,onReachThreshold:k,isFetchingNextPage:c,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,children:g.map(S=>{const A=Ne(S.provider,S.id);return e(me,{item:{id:A,title:S.title,...Ye(S),thumbnail:Ce(S.provider,S.cover),typeBadge:S.type||void 0,chapterBadge:S.latestChapter?`Ch. ${S.latestChapter}`:null,isAdult:Qe(S)},linkTo:`/manga/${S.provider}/${encodeURIComponent(S.id)}`,hoverIcon:"info",showInfoButton:!0,display:{elements:{poster:{typeBadge:!0,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!1,meta:!1}}},onOpenDetails:$=>T($,{provider:S.provider,mangaId:S.id,title:S.title,altTitle:S.altTitle,cover:S.cover,contentRating:S.contentRating,readTarget:`/manga/${S.provider}/${encodeURIComponent(S.id)}`,mature:t}),onPopupHoverIntent:$=>$?m():_(),rawThumbnail:!0},`${S.provider}-${S.id}`)})}),d&&e(Ge,{data:d.data,anchorRect:d.rect,bookmarked:i.has(Ne(d.data.provider,d.data.mangaId)),onToggleBookmark:()=>l({id:d.data.mangaId,provider:d.data.provider,title:d.data.title,cover:d.data.cover,altTitle:d.data.altTitle??void 0,contentRating:d.data.contentRating}),onMouseEnter:m,onMouseLeave:_,onRequestClose:p})]})},Cn=()=>{const{options:n}=St(),s=Q(()=>n.some(d=>d.kind==="manga"),[n]),{hasConsent:h}=st(),[t,o]=oe("manga_discover_tab","latest"),[l,i]=oe("manga_trending_sort","popular");return s?e(se,{children:[e(pe,{ariaLabel:"Discover manga",options:[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],value:t,onChange:o}),t==="latest"?e(Be,{title:"Latest Releases",eyebrow:"Fresh chapters",sort:"latest",mature:h}):e(Be,{title:"Trending",eyebrow:"Discover",sort:l,mature:h,headerActions:e("select",{className:B["header-select"],value:l,onChange:d=>i(d.currentTarget.value),"aria-label":"Trending sort",children:kn.map(d=>e("option",{value:d.value,children:d.label},d.value))})})]}):null},In=()=>{const n=J(),{data:s,isLoading:h}=Tt(24),[t,o]=E(null),{popup:l,openPopup:i,scheduleClose:d,cancelClose:T,closePopup:_}=ze(),{toggle:m,bookmarkedIds:p}=Ue(),N=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:N.length>0,highlight:!0,itemCount:N.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(_e,{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:N.map(r=>{const w=r.page??0,u=r.pageCount??0,c=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(me,{item:{id:r.id,title:r.title||"",...Ye({title:r.title||"",altTitle:r.altTitle}),thumbnail:r.provider?Ce(r.provider,r.cover||""):r.cover||"",chapterBadge:r.chapterNumber?`Ch. ${r.chapterNumber}`:null,isAdult:Qe(r)},linkTo:c,hoverIcon:"book",progress:u>0?{percent:w/u*100,label:`Ch. ${r.chapterNumber} · p. ${w}/${u}`}: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:g=>i(g,{provider:r.provider||"",mangaId:r.mangaId||"",title:r.title||"",altTitle:r.altTitle,cover:r.cover||"",contentRating:r.contentRating||void 0,readTarget:c}),onPopupHoverIntent:g=>g?T():d(),rawThumbnail:!0},r.id)})}),e(bt,{mangaId:t?t.libId:null,title:t?.title,onClose:()=>o(null)}),l&&l.data.provider&&e(Ge,{data:l.data,anchorRect:l.rect,bookmarked:p.has(Ne(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:T,onMouseLeave:d,onRequestClose:_}),e(Cn,{})]})},An="_seasonGrid_knq79_24",X={"section-header":"_section-header_knq79_1","title-wrapper":"_title-wrapper_knq79_8","pagination-controls":"_pagination-controls_knq79_14",seasonGrid:An},Rn="_emptyState_bpz5x_1",Pe={emptyState:Rn},Ln=[{value:"latest",label:"Latest Releases"},{value:"trending",label:"Trending"}],$n=[{value:"trending_week",label:"Trending Now"},{value:"trending_day",label:"Trending Today"},{value:"popular",label:"Popular All Time"},{value:"top_rated",label:"Top Rated"}],Mn=()=>{const n=J(),{data:s,isLoading:h}=Ct(24),t=It(),o=At(),[l,i]=E(null),[d,T]=E(()=>localStorage.getItem("tv_home_activeTab")||"latest"),[_,m]=E("tv"),[p,N]=E("trending_week"),[r,w]=E("multi"),u=s?.data??[];G.useEffect(()=>{localStorage.setItem("tv_home_activeTab",d)},[d]);const c=p.startsWith("trending_"),g=p==="trending_day"?"day":"week",k={popular:"popularity.desc",top_rated:"vote_average.desc"},{data:S,isLoading:A}=He(r==="multi"?"all":r,g,1,c&&d==="trending"),{data:$,isLoading:R}=$e({type:r,sort_by:k[p]||"popularity.desc",page:1}),C=c?S?.results||[]:$?.results||[],U=c?A:R,{data:x,isLoading:I}=$e({type:_,sort_by:"primary_release_date.desc",page:1}),F=x?.results||[],M=a=>{l&&(o.mutate({mediaId:l.libId}),a&&t.mutate(l.libId))},ee=P(a=>e(wt,{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(d){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(he,{ariaLabel:"Latest type",value:_,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,f)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},f))}):F.length>0?e(Z,{carousel:!0,itemCount:F.length,children:F.map(ee)}):e("div",{className:Pe.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(he,{ariaLabel:"Trending sort",value:p,onChange:N,options:$n.map(a=>({value:a.value,label:a.label}))}),e(he,{ariaLabel:"Trending type",value:r,onChange:a=>w(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,f)=>e("div",{className:"skeleton",style:{aspectRatio:"3 / 4",borderRadius:"var(--radius-lg)"}},f))}):C.length>0?e(Z,{carousel:!0,itemCount:C.length,children:C.map(ee)}):e("div",{className:Pe.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:u.length>0,highlight:!0,itemCount:u.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"3 / 4"}}),skeletonCount:7,emptyState:e(_e,{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:u.map(a=>{const f=a.currentTime??0,y=a.duration??0,D=a.season??1,K=a.episode??1,z=a.mediaType==="movie",j=z?"Movie":`S${D} E${K}`,te=a.completed===1||y>0&&f>=y*.8,ae=te?100:y>0&&f>0?f/y*100:0,fe=te?"Watched":y>0?z?`${ne(f)} / ${ne(y)}`:`${j} · ${ne(f)} / ${ne(y)}`:j;return e(me,{item:{id:a.id,title:a.title||"",thumbnail:a.poster||"",typeBadge:z?"Movie":"TV",chapterBadge:j,isAdult:Lt({adult:a.adult===1})},linkTo:Rt(a.mediaType,a.tmdbId??0,z?void 0:D,z?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:(be,re)=>e(kt,{item:{id:a.tmdbId??0,title:a.title||"",year:a.year||"",type:a.mediaType||"tv",image:a.poster||""},anchorRect:be,onMouseEnter:re.onMouseEnter,onMouseLeave:re.onMouseLeave,onRequestClose:re.close})},a.id)})}),e(pe,{ariaLabel:"Browse TV",options:Ln,value:d,onChange:T}),e("div",{children:H()}),e(qe,{isOpen:!!l,itemName:l?.title,progressKind:"watch",listLabel:"my TV watchlist",onClose:()=>{i(null)},onConfirm:M})]})};function xn(n){const s=n.currentTime??0,h=n.duration??0,t=(n.trackIndex??0)+1;return h>0?`Track ${t} · ${ne(s)} / ${ne(h)}`:n.trackLabel?`Track ${t} · ${n.trackLabel}`:`Track ${t}`}const Bn=({title:n="Continue Listening",limit:s=24,titleLink:h,showEmptyState:t=!0})=>{const o=J(),{data:l,isLoading:i}=Pt(s),[d,T]=E(null),_=l?.data??[];return e(se,{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:_.length>0,highlight:!0,itemCount:_.length,loadingSkeleton:e("div",{className:"skeleton",style:{aspectRatio:"16 / 9"}}),skeletonCount:7,emptyState:t?e(_e,{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:_.map(m=>{const p=m.currentTime??0,N=m.duration??0,r=m.rjCode||m.id;return e(me,{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:N>0?{percent:Math.min(100,p/N*100),label:xn(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:()=>T({workId:m.id,title:m.title||""}),rawThumbnail:!0},m.id)})}),e(Bt,{workId:d?d.workId:null,title:d?.title,onClose:()=>T(null)})]})},Pn=()=>e("div",{style:{paddingBottom:"2rem"},children:e(Bn,{})}),En=({items:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map(t=>{const o=$t(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=>Mt[l]??xt[l]).filter(Boolean),synopsis:we(t.overview,200),primaryLabel:"Watch Now",primaryIcon:"play",onPrimary:()=>s(o),onDetails:()=>s(o)}}),[n,s]);return e(ve,{slides:h,eyebrow:"TV Spotlight"})},Dn=({mangaList:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map(t=>{const o=`/manga/${t.provider||"mangadex"}/${t.id}`,l=Ce(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:we(t.description,200,""),primaryLabel:"Read Now",primaryIcon:"book",onPrimary:()=>s(o),onDetails:()=>s(o)}}),[n,s]);return e(ve,{slides:h,eyebrow:"Manga Spotlight"})};function Wn(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 On=({works:n})=>{const s=J(),h=Q(()=>n.slice(0,6).map((t,o)=>{const l=Et(t),i=`/asmr/${encodeURIComponent(l)}`,d=Wn(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,d?`${d} track${d===1?"":"s"}`:void 0].filter(T=>!!T),tags:[],synopsis:we(t.description,160,""),primaryLabel:"Listen Now",primaryIcon:"play",onPrimary:()=>s(i),onDetails:()=>s(i)}}),[n,s]);return e(ve,{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"}],mr=()=>{const n=Je(),s=lt(),[h,t]=G.useState(1),[o,l]=E(()=>localStorage.getItem("home_activeTab")||"latest"),[i,d]=E(()=>localStorage.getItem("season_format")||"TV"),T=q(null),{data:_}=Le(h+1,i,o==="season"),{titlePreference:m}=Ve(),{contentType:p,setContentType:N}=it(),[r,w]=G.useState(null),u=ct(),{data:c=[]}=dt(),g=ut(),k=ht(),S=pt();O(()=>{document.title="Home - dango"},[]);const{data:A,isLoading:$}=mt();O(()=>{localStorage.setItem("home_activeTab",o)},[o]),O(()=>{localStorage.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}=gt(),F=P(()=>{x&&!I&&!C&&U()},[x,I,C,U]),{data:M,isLoading:ee}=vt(),{data:H,isLoading:a}=He("all","week",1,p==="tv"),{data:f,isLoading:y}=Dt(p==="asmr"),{data:D,isLoading:K}=Nt(),z=Q(()=>R?.pages||[],[R]),{data:j,isLoading:te}=Le(h,i,o==="season"),ae=14,fe=j&&j.length>=ae&&_&&_.length>0,be=et(s.continueWatching.remove.mutationOptions({onSuccess:async()=>{n.invalidateQueries(s.continueWatching.pathFilter()),await n.invalidateQueries({queryKey:[Oe.continueWatching]}),x&&z.length-1<14&&U()}})),re=P(W=>{const Y=z?.find(ye=>String(ye.id)===String(W));if(Y){const ye=Y[m]||Y.name;w({id:W,name:ye})}},[z,m]),Ie=[{key:"latest",label:"Latest Releases"},{key:"season",label:"Current Season"},{key:"popular",label:"Trending"}],Ae=A!==void 0&&A.length>0,Xe=Ae?[{key:"week",label:"This Week"},...Ie]:Ie,Re=o==="week"&&!Ae?"latest":o,Ke=()=>{switch(Re){case"latest":return e(la,{eyebrow:"Fresh episodes"});case"season":return e("section",{style:{marginBottom:"2.5rem"},children:[e("div",{className:X["section-header"],ref:T,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(he,{ariaLabel:"Season format",width:90,value:i,onChange:d,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(tt,{page:h,canGoNext:fe,onChange:W=>{if(t(W),T.current){const Y=T.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(De,{count:ae}):j?.slice(0,ae).map(W=>e(le,{anime:W},W._id))})]});case"popular":return e(ra,{title:"Trending",eyebrow:"Discover"});case"week":return e(Me,{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(ce,{}):M&&M.length>0&&e(pn,{animeList:M})),p==="tv"&&(a&&!H?.results?.length?e(ce,{}):H?.results&&H.results.length>0&&e(En,{items:H.results})),p==="manga"&&(K&&!D?.length?e(ce,{}):D&&D.length>0&&e(Dn,{mangaList:D})),p==="asmr"&&(y&&!f?.length?e(ce,{}):f&&f.length>0&&e(On,{works:f})),e(pe,{ariaLabel:"Content type",options:Vn,value:p,onChange:N}),p==="manga"?e(In,{}):p==="tv"?e(Mn,{}):p==="asmr"?e(Pn,{}):e(se,{children:[e(Me,{title:"Continue Watching",eyebrow:"Pick up where you left off",titleLink:"/watchlist/Continue Watching",animeList:z,continueWatching:!0,carousel:!0,collapsible:!0,defaultExpanded:z.length>0,onRemove:re,loading:C,onReachThreshold:F,scrollThreshold:.7,isFetchingNextPage:I,emptyState:e(_e,{icon:"history",text:"You haven't watched anything yet. Start exploring and watch something first!",actionLabel:"Explore Trending",onAction:()=>l("popular")})}),e(ft,{title:"Queue",eyebrow:"Up next",items:c,onRemove:W=>g.mutate({showId:W.showId,episodeNumber:W.episodeNumber}),showClearAll:!0,onClear:()=>k.mutate(),onReorder:W=>S.mutate(W.map(Y=>({id:Y.id,showId:Y.showId,episodeNumber:Y.episodeNumber})))}),e(pe,{ariaLabel:"Browse anime",options:Xe.map(W=>({value:W.key,label:W.label})),value:Re,onChange:l}),e("div",{children:Ke()}),e(Ra,{eyebrow:"Never miss an episode"}),e(qe,{isOpen:!!r,itemName:r?.name,progressKind:"watch",listLabel:"my watchlist",onClose:()=>{w(null)},onConfirm:W=>{r&&(be.mutate({showId:r.id}),W&&u.mutate({id:r.id}))}})]})]})};export{mr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as P,T as c,d as O,u as e,L as A}from"./vendor-core-DfaOB3Rn.js";import{b as S,u as F,a as q}from"./vendor-query-BBT5_sHx.js";import{q as _,t as g,$ as V,d as Y,A as L,f as B}from"./index-BLh_CXtu.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",$e="_seasonalChart_1geik_414",Me="_seasonalBarContainer_1geik_422",Re="_seasonalBar_1geik_422",Ge="_seasonalLabel_1geik_444",We="_genreList_1geik_452",Pe="_genreRow_1geik_459",Oe="_genreInfo_1geik_465",Ae="_genreName_1geik_472",Fe="_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:$e,seasonalBarContainer:Me,seasonalBar:Re,seasonalLabel:Ge,genreList:We,genreRow:Pe,genreInfo:Oe,genreName:Ae,genreCount:Fe,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=F(),{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()),$=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]),M=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:$.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/M*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(A,{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
|
+
import{h as P,T as c,d as O,u as e,L as A}from"./vendor-core-DfaOB3Rn.js";import{b as S,u as F,a as q}from"./vendor-query-BBT5_sHx.js";import{q as _,t as g,$ as V,d as Y,A as L,f as B}from"./index-DB81Su4I.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",$e="_seasonalChart_1geik_414",Me="_seasonalBarContainer_1geik_422",Re="_seasonalBar_1geik_422",Ge="_seasonalLabel_1geik_444",We="_genreList_1geik_452",Pe="_genreRow_1geik_459",Oe="_genreInfo_1geik_465",Ae="_genreName_1geik_472",Fe="_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:$e,seasonalBarContainer:Me,seasonalBar:Re,seasonalLabel:Ge,genreList:We,genreRow:Pe,genreInfo:Oe,genreName:Ae,genreCount:Fe,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=F(),{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()),$=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]),M=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:$.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/M*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(A,{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-
|
|
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-hWGCEHWx.js";import{S as de}from"./SkeletonGrid-QWMGLCGp.js";import{E as oe}from"./ErrorMessage-DAxegITP.js";import{C as me,D as he,M as k,B as q}from"./index-DB81Su4I.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};
|