@serifpersia/dango 3.5.7 → 3.5.8
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 +2 -2
- package/client/dist/assets/{AnimeCard-Bj5amdPt.js → AnimeCard-Vxac3CKU.js} +1 -1
- package/client/dist/assets/{AnimeInfo-B4b7iyCZ.js → AnimeInfo-z1nSbaco.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-_p_S9R09.js → AnimeInfoPage-Brb3TFXh.js} +2 -2
- package/client/dist/assets/{Asmr-B4idhS3o.js → Asmr-BvM8UKQ3.js} +1 -1
- package/client/dist/assets/{AsmrResetProgressModal-BBrzzQFJ.js → AsmrResetProgressModal-CndzdTHo.js} +1 -1
- package/client/dist/assets/{AvSyncCalibrator-DipT4BfD.js → AvSyncCalibrator-XH4E6Sfp.js} +1 -1
- package/client/dist/assets/{Home-B3U4UeUo.js → Home-CW24x23t.js} +1 -1
- package/client/dist/assets/{Insights-CLwUQoct.js → Insights-DLqUhamB.js} +1 -1
- package/client/dist/assets/{LibraryListPage-CcsUAzeL.js → LibraryListPage-BcHi-OIb.js} +1 -1
- package/client/dist/assets/{ListeningList-DZDivEEp.js → ListeningList-gNfL7dv7.js} +1 -1
- package/client/dist/assets/{Manga-DLLGgY3d.js → Manga-B26xL6Dq.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-CAoertK2.js → MangaInfoPage-CFI4_GgJ.js} +1 -1
- package/client/dist/assets/{MangaReadPage-86iAGfPF.js → MangaReadPage-CL2TKQc8.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-BrgEfFCo.js → MangaResetProgressModal-yIv7jY4h.js} +1 -1
- package/client/dist/assets/{Mature-u1Zfj04I.js → Mature-q8lBiSsb.js} +1 -1
- package/client/dist/assets/{MediaCard-DlN3VNy8.js → MediaCard-DM2d5vjg.js} +1 -1
- package/client/dist/assets/{Music-stf7yXDU.js → Music-Dbswx5jU.js} +1 -1
- package/client/dist/assets/{OptionListMenu-BFOitF3F.js → OptionListMenu-BQnYYHpM.js} +1 -1
- package/client/dist/assets/{Player-DYz2t2Zv.js → Player-lSQC6rcr.js} +2 -2
- package/client/dist/assets/{PlayerSettings-D2Gz6FgV.js → PlayerSettings-Bns1A0RY.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-DFny02Po.js → QueueOptionsButton-CGQAqTtM.js} +1 -1
- package/client/dist/assets/{QueueRail-C3FF1-f3.js → QueueRail-ByOPjeHY.js} +1 -1
- package/client/dist/assets/{Radio-BiRQreJI.js → Radio-C7BD7L1o.js} +1 -1
- package/client/dist/assets/{ReadingList-kAreUiz-.js → ReadingList-L0kcgqzm.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-DGE5sfz2.js → ResetProgressModal-aeUUSFYc.js} +1 -1
- package/client/dist/assets/{Search-Dvt7ZYbV.js → Search-DP0QouO-.js} +1 -1
- package/client/dist/assets/Settings-C7iOaCMq.js +21 -0
- package/client/dist/assets/{SkeletonGrid-CtRkgW2V.js → SkeletonGrid-DyG9u20F.js} +1 -1
- package/client/dist/assets/{Trackers-DqaC4bYh.js → Trackers-COKJmOew.js} +1 -1
- package/client/dist/assets/{Tv-Ug-q07EH.js → Tv-QYoBwOlH.js} +1 -1
- package/client/dist/assets/{TvInfo-BfjnqnCn.js → TvInfo-DS9pbimS.js} +1 -1
- package/client/dist/assets/{TvPopup-DgTptetJ.js → TvPopup-C9Xhv1dW.js} +1 -1
- package/client/dist/assets/{TvSearch-D_VbFQF-.js → TvSearch-BjyAFYCg.js} +1 -1
- package/client/dist/assets/{TvWatchlist-DCx1lBta.js → TvWatchlist-CAuCk-AT.js} +1 -1
- package/client/dist/assets/{Watchlist-Cdi7veTd.js → Watchlist-hgU-RPay.js} +1 -1
- package/client/dist/assets/{hls-PlQLwAyI.js → hls-E2REEW_P.js} +1 -1
- package/client/dist/assets/index-Ck-R0JKv.css +1 -0
- package/client/dist/assets/index-_iy8RyKU.js +178 -0
- package/client/dist/assets/{useAnimeInfoData-nFJhxeIK.js → useAnimeInfoData-CgmVQOsk.js} +1 -1
- package/client/dist/assets/{useAsmr-BFiC1M0v.js → useAsmr-BxU_JBAI.js} +1 -1
- package/client/dist/assets/{useAsmrPopup-BfVuxWTa.js → useAsmrPopup-BYMMk2rG.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-DKLDWCwz.js → useMangaLibrary-BrKhv-sI.js} +1 -1
- package/client/dist/assets/{useMangaPopup-C1z1dsYB.js → useMangaPopup-BQe7Ug-A.js} +1 -1
- package/client/dist/assets/{useProviders-aF3Qns7U.js → useProviders-swR4Flu5.js} +1 -1
- package/client/dist/assets/{useTv-DkUFW44b.js → useTv-mq8TkTZl.js} +1 -1
- package/client/dist/assets/{useTvLibrary-CrUDB1RB.js → useTvLibrary-BuMreQuF.js} +1 -1
- package/client/dist/index.html +2 -2
- package/client/dist/repo_logo.svg +78 -0
- package/package.json +2 -2
- package/server/dist/trpc/routers/settings.js +1 -0
- package/server/package.json +1 -1
- package/client/dist/assets/Settings-D-BMTUko.js +0 -21
- package/client/dist/assets/index-NKjVUCZV.js +0 -178
- package/client/dist/assets/index-w_r2lTCe.css +0 -1
- package/client/dist/logo.png +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PlayerSettings-
|
|
2
|
-
import{u as r,g as Ot,h as B,P as Br,z as Lr,d as ue,A as f,q as K,y as Ir,T as Je,o as Dr,a as $r,c as Fr,_ as Wr,S as Mt}from"./vendor-core-DfaOB3Rn.js";import{_ as mr,S as _t,h as Or,t as Ee,z as We,J as Ur,e as Vr,l as qr,m as Qr,n as zr,o as Gr,d as Kr,u as Hr,M as $e,B as it,K as jr,f as Yr}from"./index-NKjVUCZV.js";import{u as fr,b as lr,a as jt}from"./vendor-query-BBT5_sHx.js";import{S as Xr,U as Jr,p as Yt,s as Zr,C as en,a as tn,b as rn,c as at,l as nn,u as sn,d as on,e as an,f as ln,i as cn,g as cr,h as un,j as dn,k as ur,m as dr,n as pn,o as mn,q as fn,r as hn,t as Fe,A as vn,R as gn,E as bn,v as yn,w as p,x as Sn,y as En,P as wn,z as Tn,B as kn}from"./AvSyncCalibrator-DipT4BfD.js";import{I as Z}from"./vendor-icons-DrybRNxP.js";import{l as Cn}from"./hls-PlQLwAyI.js";import{u as Rn}from"./useIsMobile-Dvx1uJ82.js";import{s as ze,Q as Mn}from"./QueueRail-C3FF1-f3.js";import{u as _n,Q as Nn}from"./QueueOptionsButton-DFny02Po.js";import{u as hr}from"./useProviders-aF3Qns7U.js";import{A as xn}from"./AnimeMetaDetails-BogOi_bM.js";import{S as Pn}from"./SynopsisText-B3Sa5pRv.js";import"./vendor-ui-3qrARCPr.js";const An={soft:"Softsub",hard:"Hardsub",mixed:"Mixed"},Bn={direct:"Direct",embed:"Embed",cookie:"Needs cookie"},Ln=["direct","cookie","embed"],In="_controlsOverlay_1b7ea_1",Dn="_hidden_1b7ea_21",$n="_topControls_1b7ea_27",Fn="_backBtn_1b7ea_47",Wn="_videoTitleInfo_1b7ea_67",On="_animeTitle_1b7ea_73",Un="_episodeNumber_1b7ea_81",Vn="_bottomControls_1b7ea_89",qn="_progressBarContainer_1b7ea_108",Qn="_progressBar_1b7ea_108",zn="_thumb_1b7ea_127",Gn="_scrubbing_1b7ea_142",Kn="_watchedBar_1b7ea_146",Hn="_bufferedBar_1b7ea_147",jn="_timeBubble_1b7ea_185",Yn="_skipSegment_1b7ea_219",Xn="_op_1b7ea_229",Jn="_ed_1b7ea_232",Zn="_recap_1b7ea_235",es="_bottomControlsRow_1b7ea_239",ts="_leftControls_1b7ea_247",rs="_rightControls_1b7ea_248",ns="_controlBtn_1b7ea_255",ss="_theaterBtn_1b7ea_296",os="_nextEpisodeBtn_1b7ea_300",is="_active_1b7ea_317",as="_timeDisplay_1b7ea_321",ls="_skipControls_1b7ea_329",cs="_skipBtn_1b7ea_335",us="_volumeContainer_1b7ea_376",ds="_volumeSlider_1b7ea_382",ps="_playerPageLayout_1b7ea_440",ms="_videoPlayerWrapper_1b7ea_444",fs="_playerInfoContainer_1b7ea_449",hs="_visible_1b7ea_566",vs="_shortcuts_1b7ea_584",C={controlsOverlay:In,hidden:Dn,topControls:$n,backBtn:Fn,videoTitleInfo:Wn,animeTitle:On,episodeNumber:Un,bottomControls:Vn,progressBarContainer:qn,progressBar:Qn,thumb:zn,scrubbing:Gn,watchedBar:Kn,bufferedBar:Hn,timeBubble:jn,skipSegment:Yn,op:Xn,ed:Jn,recap:Zn,bottomControlsRow:es,leftControls:ts,rightControls:rs,controlBtn:ns,theaterBtn:ss,nextEpisodeBtn:os,active:is,timeDisplay:as,skipControls:ls,skipBtn:cs,volumeContainer:us,volumeSlider:ds,playerPageLayout:ps,videoPlayerWrapper:ms,playerInfoContainer:fs,visible:hs,shortcuts:vs},gs=({player:n,handlers:l,visible:m,skipIntervals:D,showNextEpisodeButton:h,onNextEpisode:S,isTheaterMode:b,onTheaterModeToggle:A,settingsBtnRef:x,timeDisplayRef:$})=>{const{state:T,refs:e,actions:o}=n,{showSettings:J}=T,g=()=>T.isMuted||T.volume===0?r(Z,{name:"volume-mute"}):T.volume<.5?r(Z,{name:"volume-down"}):r(Z,{name:"volume-up"});return r("div",{className:`${C.controlsOverlay} ${m?"":C.hidden} `,"data-speed-boost-ignore":"true",style:{pointerEvents:"none",background:"none",justifyContent:"flex-end"},children:r("div",{className:C.bottomControls,"data-speed-boost-ignore":"true",onClick:P=>P.stopPropagation(),children:[r(Xr,{classes:{container:C.progressBarContainer,scrubbing:C.scrubbing,timeBubble:C.timeBubble,bar:C.progressBar,buffered:C.bufferedBar,watched:C.watchedBar,thumb:C.thumb},videoRef:e.videoRef,duration:T.duration,formatTime:o.formatTime,isScrubbing:T.isScrubbing,onSeek:l.handleSeek,onScrubStart:l.handleScrubStart,onScrubMove:l.handleScrubMove,onScrubEnd:l.handleScrubEnd,timeLabelRef:$,children:[T.duration>0&&n.state.currentSkipInterval&&r("div",{className:`${C.skipSegment} ${C[n.state.currentSkipInterval.skip_type]} `,style:{left:`${n.state.currentSkipInterval.start_time/T.duration*100}% `,width:`${(n.state.currentSkipInterval.end_time-n.state.currentSkipInterval.start_time)/T.duration*100}% `}}),D.map(P=>{const de=P.start_time/T.duration*100,U=(P.end_time-P.start_time)/T.duration*100;return r("div",{className:`${C.skipSegment} ${C[P.skip_type]} `,style:{left:`${de}% `,width:`${U}% `},title:P.skip_type.toUpperCase()},P.skip_id)})]}),r("div",{className:C.bottomControlsRow,children:[r("div",{className:C.leftControls,children:[r("button",{className:C.controlBtn,onClick:o.togglePlay,"aria-label":T.isPlaying?"Pause":"Play",children:T.isPlaying?r(Z,{name:"pause"}):r(Z,{name:"play"})}),r(Jr,{muted:T.isMuted,volume:T.volume,volumeIcon:g(),buttonClassName:C.controlBtn,onToggleMute:o.toggleMute,onVolumeChange:l.handleVolumeChange,onExpandedChange:P=>o.setShowVolumeSlider(P)}),r("span",{className:C.timeDisplay,ref:$,children:[o.formatTime(0)," / ",o.formatTime(T.duration)]}),T.currentSkipInterval&&!T.isAutoSkipEnabled&&r("button",{className:C.controlBtn,onClick:()=>{e.videoRef.current&&T.currentSkipInterval&&(e.videoRef.current.currentTime=T.currentSkipInterval.end_time,o.setCurrentSkipInterval(null))},children:["Skip ",T.currentSkipInterval.skip_type==="op"?"Opening":"Ending"]})]}),r("div",{className:C.rightControls,children:[r("div",{className:C.skipControls,children:h&&r("button",{className:C.nextEpisodeBtn,onClick:S,title:"Play next episode",children:"Next EP"})}),r("button",{className:`${C.controlBtn} ${l.isSubtitleActive?C.active:""}`,onClick:l.handleCCToggle,title:l.isSubtitleActive?"Disable Subtitles":"Enable Subtitles","aria-label":"Toggle Subtitles",children:r(Z,{name:"closed-captioning",size:22})}),r("button",{ref:x,className:`${C.controlBtn} ${J?C.active:""} `,onClick:()=>o.setShowSettings(!J),"aria-label":"Settings",children:r(Z,{name:"cog"})}),r("button",{className:`${C.controlBtn} ${C.theaterBtn} ${b?C.active:""} `,onClick:P=>{P.stopPropagation(),A()},title:b?"Exit Theater Mode":"Theater Mode","aria-label":b?"Exit Theater Mode":"Theater Mode",children:r(Z,{name:"tv"})}),r("button",{className:C.controlBtn,onClick:o.toggleFullscreen,"aria-label":T.isFullscreen?"Exit Fullscreen":"Fullscreen",children:T.isFullscreen?r(Z,{name:"compress"}):r(Z,{name:"expand"})})]})]})]})})};function bs(n){const{state:l,refs:m,actions:D}=n,h=o=>{m.videoRef.current&&(m.videoRef.current.volume=o,m.videoRef.current.muted=o===0)},S=o=>{!m.videoRef.current||isNaN(l.duration)||l.duration===0||(m.videoRef.current.currentTime=o*l.duration,D.sendProgressUpdate(!1,!0))},b=()=>{m.videoRef.current&&(D.setIsScrubbing(!0),D.wasPlayingBeforeScrub.current=!m.videoRef.current.paused,m.videoRef.current.pause())},A=o=>{!m.videoRef.current||!l.duration||(m.videoRef.current.currentTime=o*l.duration)},x=()=>{D.setIsScrubbing(!1),D.wasPlayingBeforeScrub.current&&m.videoRef.current?.play()},$=o=>{if(!m.videoRef.current)return;D.setActiveSubtitleTrack(o);try{if(o===null||o==="off")localStorage.setItem("playerSubtitlesEnabled","false");else{localStorage.setItem("playerSubtitlesEnabled","true");const g=l.availableSubtitles.find(P=>P.label===o||P.lang===o);g?localStorage.setItem("playerLastSubtitle",Zr(g)):localStorage.setItem("playerLastSubtitle",o)}}catch{}let J=!1;Array.from(m.videoRef.current.textTracks).forEach(g=>{const de=o!==null&&o!=="off"&&(g.language===o||g.label===o)&&!J;g.mode=de?"showing":"hidden",de&&(J=!0)})},T=l.activeSubtitleTrack!==null&&l.activeSubtitleTrack!=="off";return{handleVolumeChange:h,handleSeek:S,handleScrubStart:b,handleScrubMove:A,handleScrubEnd:x,handleSubtitleSelection:$,isSubtitleActive:T,handleCCToggle:()=>{if(!m.videoRef.current)return;if(T){$("off");return}if(l.availableSubtitles.length===0)return;let o=null;try{o=localStorage.getItem("playerLastSubtitle")}catch{}const J=Yt(l.availableSubtitles,{lastKey:o,enabled:!0});if(J<0)return;const g=l.availableSubtitles[J];$(g.label||g.lang)}}}const ys=Lr(()=>mr(()=>import("./PlayerSettings-D2Gz6FgV.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),Ss=({player:n,isAutoplayEnabled:l,onAutoplayChange:m,showNextEpisodeButton:D,onNextEpisode:h,videoSources:S,selectedSource:b,selectedLink:A,onSourceChange:x,loadingVideo:$,skipIntervals:T,animeTitle:e,episodeNumber:o,isTheaterMode:J,onTheaterModeToggle:g,anime4kEnabled:P,onAnime4kToggle:de,anime4kSupported:U,anime4kProfile:L,onAnime4kProfileChange:V,anime4kInitializing:Ae,anime4kError:Oe,videoDelayEnabled:i,onVideoDelayToggle:d,videoDelayMs:k,onVideoDelayChange:ve,onCalibrateAvSync:Be,fallbackChoice:_e,onFallbackChoiceChange:Ne,ambientSettings:Ue,onAmbientChange:oe,children:we,overlays:c,isInteractingExtra:y=!1,className:v,hideChrome:I=!1})=>{const{state:R,actions:q}=n,{showSettings:ye}=R,{setShowSettings:Y}=q,G=bs(n),Te=Ot.useRef(null),Le=Ot.useRef(null),yt=Ot.useRef(null);B(()=>{const F=W=>{Te.current&&!Te.current.contains(W.target)&&Le.current&&!Le.current.contains(W.target)&&ye&&Y(!1)};return ye&&document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[ye,Y]);const Ze=R.showControls||ye||R.isScrubbing,St=r(rn,{visible:Ze,title:e,episode:o?`Episode ${o}`:void 0,onBack:()=>window.history.back(),classes:{overlay:C.controlsOverlay,hidden:C.hidden,top:C.topControls,backBtn:C.backBtn,titleInfo:C.videoTitleInfo,title:C.animeTitle,episode:C.episodeNumber}}),H=!$&&!R.isBuffering&&R.duration>0?r(en,{isPlaying:R.isPlaying,onTogglePlay:q.togglePlay,onSkipBack:()=>q.seek(-10),onSkipForward:()=>q.seek(10)}):null,xe=r(gs,{player:n,handlers:G,visible:Ze,skipIntervals:T,showNextEpisodeButton:D,onNextEpisode:h,isTheaterMode:J,onTheaterModeToggle:g,settingsBtnRef:Le,timeDisplayRef:yt}),lt=r(Br,{fallback:null,children:r(ys,{ref:Te,isOpen:ye,onClose:()=>Y(!1),videoSources:S,currentSource:b,currentLink:A,onSourceChange:x,subtitles:R.availableSubtitles,activeSubtitleTrack:R.activeSubtitleTrack,onSubtitleChange:G.handleSubtitleSelection,subtitleSettings:{fontSize:R.subtitleFontSize,position:R.subtitlePosition,bgOpacity:R.subtitleBgOpacity,bgColor:R.subtitleBgColor,textColor:R.subtitleTextColor,edge:R.subtitleEdge,bold:R.subtitleBold},onSubtitleSettingsChange:(F,W)=>{const ke=(Ve,Ge)=>{try{localStorage.setItem(Ve,String(Ge))}catch{}};switch(F){case"fontSize":q.setSubtitleFontSize(W),ke("subtitleFontSize",W);break;case"position":q.setSubtitlePosition(W),ke("subtitlePosition",W);break;case"bgOpacity":q.setSubtitleBgOpacity(W),ke("subtitleBgOpacity",W);break;case"bgColor":q.setSubtitleBgColor(W),ke("subtitleBgColor",W);break;case"textColor":q.setSubtitleTextColor(W),ke("subtitleTextColor",W);break;case"edge":q.setSubtitleEdge(W),ke("subtitleEdge",W);break;case"bold":q.setSubtitleBold(W),ke("subtitleBold",W);break}},useNativeControls:R.useNativeControls,onNativeControlsToggle:q.setUseNativeControls,anime4kEnabled:P,onAnime4kToggle:de,anime4kSupported:U,anime4kProfile:L,onAnime4kProfileChange:V,anime4kInitializing:Ae,anime4kError:Oe,videoDelayEnabled:i,onVideoDelayToggle:d,videoDelayMs:k,onVideoDelayChange:ve,onCalibrateAvSync:Be,isAutoSkipEnabled:R.isAutoSkipEnabled,onAutoSkipChange:F=>{q.setIsAutoSkipEnabled(F);try{localStorage.setItem("autoSkipEnabled",F.toString())}catch{}},isAutoplayEnabled:l,onAutoplayChange:m,fallbackChoice:_e,onFallbackChoiceChange:Ne,isTheaterMode:J,ambientSettings:Ue,onAmbientChange:oe})}),_=ye?r("div",{"data-speed-boost-ignore":"true",onClick:F=>F.stopPropagation(),children:lt}):null;return r(tn,{player:n,topBar:St,centerControls:H,bottomBar:!$&&R.duration>0?xe:null,settingsPanel:_,overlays:c,isInteracting:y,className:v,chromeDisabled:I,children:we})},Es=({count:n=3})=>r("section",{className:ze.section,children:[r("div",{className:ze.header,children:r("button",{className:ze.headerToggle,disabled:!0,children:[r("span",{className:ze.title,children:r(_t,{width:"60px",height:"1.2rem",variant:"text"})}),r(Z,{name:"chevron-down",style:{opacity:.3}})]})}),r("div",{className:ze.list,children:Array.from({length:n}).map((l,m)=>r("div",{className:ze.item,style:{pointerEvents:"none"},children:[r("div",{className:ze.dragHandle,style:{opacity:.2},children:r(_t,{width:"16px",height:"16px",variant:"rectangular"})}),r("div",{className:ze.thumbnail,style:{overflow:"hidden",background:"transparent"},children:r(_t,{width:"100%",height:"100%",variant:"rectangular"})}),r("div",{className:ze.meta,children:[r(_t,{width:"80%",height:"1.2rem",variant:"text",className:"mb-2"}),r(_t,{width:"40%",height:"0.8rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},m))})]}),ws=({selectedProvider:n,onProviderChange:l,isAdult:m,options:D})=>{const h=D&&D.length>0?D:[],S=m===void 0?h:h.filter(b=>b.mature===m);return r("div",{className:at.providerSelectContainer,children:[r("h4",{children:"Provider"}),r("select",{className:at.providerSelect,value:n,onChange:b=>l(b.target.value),children:Ln.map(b=>{const A=S.filter(x=>(x.tier??"direct")===b);return A.length===0?null:r("optgroup",{label:Bn[b],children:A.map(x=>r("option",{value:x.value,children:x.sub?`${x.label} (${An[x.sub]})`:x.label},x.value))},b)})})]})},Ts=({videoSources:n,selectedSource:l,selectedLink:m,onSourceChange:D,onLinkChange:h})=>{const S=Array.isArray(n)?n:[];if(S.length===0)return null;const b=l?.type==="iframe"&&(l.links?.length??0)>1;return r("div",{className:at.sourceSelectionContainer,children:[r("h4",{children:"Source"}),r("div",{className:at.sourceButtons,children:S.map((A,x)=>r("button",{className:`${at.sourceButton} ${l?.sourceName===A.sourceName?at.active:""} `,onClick:()=>D(A),children:A.sourceName},`${A.sourceName}-${x}`))}),b&&r("select",{className:at.sourceSelect,"aria-label":"Fallback embed quality",value:m?.link??l.links[0]?.link??"",onChange:A=>{const x=l.links.find($=>$.link===A.target.value);x&&h(x)},children:l.links.map(A=>r("option",{value:A.link,children:A.resolutionStr},A.link))})]})},ks=Ot.memo(Ts,(n,l)=>n.selectedSource?.sourceName===l.selectedSource?.sourceName&&n.selectedLink?.link===l.selectedLink?.link&&n.videoSources===l.videoSources),Cs={low:{sd:1.5,hd:1.3,fhd:1.25},balanced:{sd:2,hd:1.5,fhd:1.25},high:{sd:2.5,hd:2,fhd:1.5},denoise:{sd:1.5,hd:1.5,fhd:1.5}},Rs={low:"ModeB",balanced:"ModeA",high:"ModeAA",denoise:"ModeC"},Ms=5,_s=15e3,Ns=`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PlayerSettings-Bns1A0RY.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-icons-DrybRNxP.js","assets/OptionListMenu-BQnYYHpM.js","assets/AvSyncCalibrator-XH4E6Sfp.js","assets/index-_iy8RyKU.js","assets/vendor-query-BBT5_sHx.js","assets/index-Ck-R0JKv.css","assets/AvSyncCalibrator-ieaRTs3u.css","assets/PlayerSettings-Bj6SsmQ2.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{u as r,g as Ot,h as B,P as Br,z as Lr,d as ue,A as f,q as K,y as Ir,T as Je,o as Dr,a as $r,c as Fr,_ as Wr,S as Mt}from"./vendor-core-DfaOB3Rn.js";import{_ as mr,S as _t,h as Or,t as Ee,z as We,J as Ur,e as Vr,l as qr,m as Qr,n as zr,o as Gr,d as Kr,u as Hr,M as $e,B as it,K as jr,f as Yr}from"./index-_iy8RyKU.js";import{u as fr,b as lr,a as jt}from"./vendor-query-BBT5_sHx.js";import{S as Xr,U as Jr,p as Yt,s as Zr,C as en,a as tn,b as rn,c as at,l as nn,u as sn,d as on,e as an,f as ln,i as cn,g as cr,h as un,j as dn,k as ur,m as dr,n as pn,o as mn,q as fn,r as hn,t as Fe,A as vn,R as gn,E as bn,v as yn,w as p,x as Sn,y as En,P as wn,z as Tn,B as kn}from"./AvSyncCalibrator-XH4E6Sfp.js";import{I as Z}from"./vendor-icons-DrybRNxP.js";import{l as Cn}from"./hls-E2REEW_P.js";import{u as Rn}from"./useIsMobile-Dvx1uJ82.js";import{s as ze,Q as Mn}from"./QueueRail-ByOPjeHY.js";import{u as _n,Q as Nn}from"./QueueOptionsButton-CGQAqTtM.js";import{u as hr}from"./useProviders-swR4Flu5.js";import{A as xn}from"./AnimeMetaDetails-BogOi_bM.js";import{S as Pn}from"./SynopsisText-B3Sa5pRv.js";import"./vendor-ui-3qrARCPr.js";const An={soft:"Softsub",hard:"Hardsub",mixed:"Mixed"},Bn={direct:"Direct",embed:"Embed",cookie:"Needs cookie"},Ln=["direct","cookie","embed"],In="_controlsOverlay_1b7ea_1",Dn="_hidden_1b7ea_21",$n="_topControls_1b7ea_27",Fn="_backBtn_1b7ea_47",Wn="_videoTitleInfo_1b7ea_67",On="_animeTitle_1b7ea_73",Un="_episodeNumber_1b7ea_81",Vn="_bottomControls_1b7ea_89",qn="_progressBarContainer_1b7ea_108",Qn="_progressBar_1b7ea_108",zn="_thumb_1b7ea_127",Gn="_scrubbing_1b7ea_142",Kn="_watchedBar_1b7ea_146",Hn="_bufferedBar_1b7ea_147",jn="_timeBubble_1b7ea_185",Yn="_skipSegment_1b7ea_219",Xn="_op_1b7ea_229",Jn="_ed_1b7ea_232",Zn="_recap_1b7ea_235",es="_bottomControlsRow_1b7ea_239",ts="_leftControls_1b7ea_247",rs="_rightControls_1b7ea_248",ns="_controlBtn_1b7ea_255",ss="_theaterBtn_1b7ea_296",os="_nextEpisodeBtn_1b7ea_300",is="_active_1b7ea_317",as="_timeDisplay_1b7ea_321",ls="_skipControls_1b7ea_329",cs="_skipBtn_1b7ea_335",us="_volumeContainer_1b7ea_376",ds="_volumeSlider_1b7ea_382",ps="_playerPageLayout_1b7ea_440",ms="_videoPlayerWrapper_1b7ea_444",fs="_playerInfoContainer_1b7ea_449",hs="_visible_1b7ea_566",vs="_shortcuts_1b7ea_584",C={controlsOverlay:In,hidden:Dn,topControls:$n,backBtn:Fn,videoTitleInfo:Wn,animeTitle:On,episodeNumber:Un,bottomControls:Vn,progressBarContainer:qn,progressBar:Qn,thumb:zn,scrubbing:Gn,watchedBar:Kn,bufferedBar:Hn,timeBubble:jn,skipSegment:Yn,op:Xn,ed:Jn,recap:Zn,bottomControlsRow:es,leftControls:ts,rightControls:rs,controlBtn:ns,theaterBtn:ss,nextEpisodeBtn:os,active:is,timeDisplay:as,skipControls:ls,skipBtn:cs,volumeContainer:us,volumeSlider:ds,playerPageLayout:ps,videoPlayerWrapper:ms,playerInfoContainer:fs,visible:hs,shortcuts:vs},gs=({player:n,handlers:l,visible:m,skipIntervals:D,showNextEpisodeButton:h,onNextEpisode:S,isTheaterMode:b,onTheaterModeToggle:A,settingsBtnRef:x,timeDisplayRef:$})=>{const{state:T,refs:e,actions:o}=n,{showSettings:J}=T,g=()=>T.isMuted||T.volume===0?r(Z,{name:"volume-mute"}):T.volume<.5?r(Z,{name:"volume-down"}):r(Z,{name:"volume-up"});return r("div",{className:`${C.controlsOverlay} ${m?"":C.hidden} `,"data-speed-boost-ignore":"true",style:{pointerEvents:"none",background:"none",justifyContent:"flex-end"},children:r("div",{className:C.bottomControls,"data-speed-boost-ignore":"true",onClick:P=>P.stopPropagation(),children:[r(Xr,{classes:{container:C.progressBarContainer,scrubbing:C.scrubbing,timeBubble:C.timeBubble,bar:C.progressBar,buffered:C.bufferedBar,watched:C.watchedBar,thumb:C.thumb},videoRef:e.videoRef,duration:T.duration,formatTime:o.formatTime,isScrubbing:T.isScrubbing,onSeek:l.handleSeek,onScrubStart:l.handleScrubStart,onScrubMove:l.handleScrubMove,onScrubEnd:l.handleScrubEnd,timeLabelRef:$,children:[T.duration>0&&n.state.currentSkipInterval&&r("div",{className:`${C.skipSegment} ${C[n.state.currentSkipInterval.skip_type]} `,style:{left:`${n.state.currentSkipInterval.start_time/T.duration*100}% `,width:`${(n.state.currentSkipInterval.end_time-n.state.currentSkipInterval.start_time)/T.duration*100}% `}}),D.map(P=>{const de=P.start_time/T.duration*100,U=(P.end_time-P.start_time)/T.duration*100;return r("div",{className:`${C.skipSegment} ${C[P.skip_type]} `,style:{left:`${de}% `,width:`${U}% `},title:P.skip_type.toUpperCase()},P.skip_id)})]}),r("div",{className:C.bottomControlsRow,children:[r("div",{className:C.leftControls,children:[r("button",{className:C.controlBtn,onClick:o.togglePlay,"aria-label":T.isPlaying?"Pause":"Play",children:T.isPlaying?r(Z,{name:"pause"}):r(Z,{name:"play"})}),r(Jr,{muted:T.isMuted,volume:T.volume,volumeIcon:g(),buttonClassName:C.controlBtn,onToggleMute:o.toggleMute,onVolumeChange:l.handleVolumeChange,onExpandedChange:P=>o.setShowVolumeSlider(P)}),r("span",{className:C.timeDisplay,ref:$,children:[o.formatTime(0)," / ",o.formatTime(T.duration)]}),T.currentSkipInterval&&!T.isAutoSkipEnabled&&r("button",{className:C.controlBtn,onClick:()=>{e.videoRef.current&&T.currentSkipInterval&&(e.videoRef.current.currentTime=T.currentSkipInterval.end_time,o.setCurrentSkipInterval(null))},children:["Skip ",T.currentSkipInterval.skip_type==="op"?"Opening":"Ending"]})]}),r("div",{className:C.rightControls,children:[r("div",{className:C.skipControls,children:h&&r("button",{className:C.nextEpisodeBtn,onClick:S,title:"Play next episode",children:"Next EP"})}),r("button",{className:`${C.controlBtn} ${l.isSubtitleActive?C.active:""}`,onClick:l.handleCCToggle,title:l.isSubtitleActive?"Disable Subtitles":"Enable Subtitles","aria-label":"Toggle Subtitles",children:r(Z,{name:"closed-captioning",size:22})}),r("button",{ref:x,className:`${C.controlBtn} ${J?C.active:""} `,onClick:()=>o.setShowSettings(!J),"aria-label":"Settings",children:r(Z,{name:"cog"})}),r("button",{className:`${C.controlBtn} ${C.theaterBtn} ${b?C.active:""} `,onClick:P=>{P.stopPropagation(),A()},title:b?"Exit Theater Mode":"Theater Mode","aria-label":b?"Exit Theater Mode":"Theater Mode",children:r(Z,{name:"tv"})}),r("button",{className:C.controlBtn,onClick:o.toggleFullscreen,"aria-label":T.isFullscreen?"Exit Fullscreen":"Fullscreen",children:T.isFullscreen?r(Z,{name:"compress"}):r(Z,{name:"expand"})})]})]})]})})};function bs(n){const{state:l,refs:m,actions:D}=n,h=o=>{m.videoRef.current&&(m.videoRef.current.volume=o,m.videoRef.current.muted=o===0)},S=o=>{!m.videoRef.current||isNaN(l.duration)||l.duration===0||(m.videoRef.current.currentTime=o*l.duration,D.sendProgressUpdate(!1,!0))},b=()=>{m.videoRef.current&&(D.setIsScrubbing(!0),D.wasPlayingBeforeScrub.current=!m.videoRef.current.paused,m.videoRef.current.pause())},A=o=>{!m.videoRef.current||!l.duration||(m.videoRef.current.currentTime=o*l.duration)},x=()=>{D.setIsScrubbing(!1),D.wasPlayingBeforeScrub.current&&m.videoRef.current?.play()},$=o=>{if(!m.videoRef.current)return;D.setActiveSubtitleTrack(o);try{if(o===null||o==="off")localStorage.setItem("playerSubtitlesEnabled","false");else{localStorage.setItem("playerSubtitlesEnabled","true");const g=l.availableSubtitles.find(P=>P.label===o||P.lang===o);g?localStorage.setItem("playerLastSubtitle",Zr(g)):localStorage.setItem("playerLastSubtitle",o)}}catch{}let J=!1;Array.from(m.videoRef.current.textTracks).forEach(g=>{const de=o!==null&&o!=="off"&&(g.language===o||g.label===o)&&!J;g.mode=de?"showing":"hidden",de&&(J=!0)})},T=l.activeSubtitleTrack!==null&&l.activeSubtitleTrack!=="off";return{handleVolumeChange:h,handleSeek:S,handleScrubStart:b,handleScrubMove:A,handleScrubEnd:x,handleSubtitleSelection:$,isSubtitleActive:T,handleCCToggle:()=>{if(!m.videoRef.current)return;if(T){$("off");return}if(l.availableSubtitles.length===0)return;let o=null;try{o=localStorage.getItem("playerLastSubtitle")}catch{}const J=Yt(l.availableSubtitles,{lastKey:o,enabled:!0});if(J<0)return;const g=l.availableSubtitles[J];$(g.label||g.lang)}}}const ys=Lr(()=>mr(()=>import("./PlayerSettings-Bns1A0RY.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),Ss=({player:n,isAutoplayEnabled:l,onAutoplayChange:m,showNextEpisodeButton:D,onNextEpisode:h,videoSources:S,selectedSource:b,selectedLink:A,onSourceChange:x,loadingVideo:$,skipIntervals:T,animeTitle:e,episodeNumber:o,isTheaterMode:J,onTheaterModeToggle:g,anime4kEnabled:P,onAnime4kToggle:de,anime4kSupported:U,anime4kProfile:L,onAnime4kProfileChange:V,anime4kInitializing:Ae,anime4kError:Oe,videoDelayEnabled:i,onVideoDelayToggle:d,videoDelayMs:k,onVideoDelayChange:ve,onCalibrateAvSync:Be,fallbackChoice:_e,onFallbackChoiceChange:Ne,ambientSettings:Ue,onAmbientChange:oe,children:we,overlays:c,isInteractingExtra:y=!1,className:v,hideChrome:I=!1})=>{const{state:R,actions:q}=n,{showSettings:ye}=R,{setShowSettings:Y}=q,G=bs(n),Te=Ot.useRef(null),Le=Ot.useRef(null),yt=Ot.useRef(null);B(()=>{const F=W=>{Te.current&&!Te.current.contains(W.target)&&Le.current&&!Le.current.contains(W.target)&&ye&&Y(!1)};return ye&&document.addEventListener("mousedown",F),()=>{document.removeEventListener("mousedown",F)}},[ye,Y]);const Ze=R.showControls||ye||R.isScrubbing,St=r(rn,{visible:Ze,title:e,episode:o?`Episode ${o}`:void 0,onBack:()=>window.history.back(),classes:{overlay:C.controlsOverlay,hidden:C.hidden,top:C.topControls,backBtn:C.backBtn,titleInfo:C.videoTitleInfo,title:C.animeTitle,episode:C.episodeNumber}}),H=!$&&!R.isBuffering&&R.duration>0?r(en,{isPlaying:R.isPlaying,onTogglePlay:q.togglePlay,onSkipBack:()=>q.seek(-10),onSkipForward:()=>q.seek(10)}):null,xe=r(gs,{player:n,handlers:G,visible:Ze,skipIntervals:T,showNextEpisodeButton:D,onNextEpisode:h,isTheaterMode:J,onTheaterModeToggle:g,settingsBtnRef:Le,timeDisplayRef:yt}),lt=r(Br,{fallback:null,children:r(ys,{ref:Te,isOpen:ye,onClose:()=>Y(!1),videoSources:S,currentSource:b,currentLink:A,onSourceChange:x,subtitles:R.availableSubtitles,activeSubtitleTrack:R.activeSubtitleTrack,onSubtitleChange:G.handleSubtitleSelection,subtitleSettings:{fontSize:R.subtitleFontSize,position:R.subtitlePosition,bgOpacity:R.subtitleBgOpacity,bgColor:R.subtitleBgColor,textColor:R.subtitleTextColor,edge:R.subtitleEdge,bold:R.subtitleBold},onSubtitleSettingsChange:(F,W)=>{const ke=(Ve,Ge)=>{try{localStorage.setItem(Ve,String(Ge))}catch{}};switch(F){case"fontSize":q.setSubtitleFontSize(W),ke("subtitleFontSize",W);break;case"position":q.setSubtitlePosition(W),ke("subtitlePosition",W);break;case"bgOpacity":q.setSubtitleBgOpacity(W),ke("subtitleBgOpacity",W);break;case"bgColor":q.setSubtitleBgColor(W),ke("subtitleBgColor",W);break;case"textColor":q.setSubtitleTextColor(W),ke("subtitleTextColor",W);break;case"edge":q.setSubtitleEdge(W),ke("subtitleEdge",W);break;case"bold":q.setSubtitleBold(W),ke("subtitleBold",W);break}},useNativeControls:R.useNativeControls,onNativeControlsToggle:q.setUseNativeControls,anime4kEnabled:P,onAnime4kToggle:de,anime4kSupported:U,anime4kProfile:L,onAnime4kProfileChange:V,anime4kInitializing:Ae,anime4kError:Oe,videoDelayEnabled:i,onVideoDelayToggle:d,videoDelayMs:k,onVideoDelayChange:ve,onCalibrateAvSync:Be,isAutoSkipEnabled:R.isAutoSkipEnabled,onAutoSkipChange:F=>{q.setIsAutoSkipEnabled(F);try{localStorage.setItem("autoSkipEnabled",F.toString())}catch{}},isAutoplayEnabled:l,onAutoplayChange:m,fallbackChoice:_e,onFallbackChoiceChange:Ne,isTheaterMode:J,ambientSettings:Ue,onAmbientChange:oe})}),_=ye?r("div",{"data-speed-boost-ignore":"true",onClick:F=>F.stopPropagation(),children:lt}):null;return r(tn,{player:n,topBar:St,centerControls:H,bottomBar:!$&&R.duration>0?xe:null,settingsPanel:_,overlays:c,isInteracting:y,className:v,chromeDisabled:I,children:we})},Es=({count:n=3})=>r("section",{className:ze.section,children:[r("div",{className:ze.header,children:r("button",{className:ze.headerToggle,disabled:!0,children:[r("span",{className:ze.title,children:r(_t,{width:"60px",height:"1.2rem",variant:"text"})}),r(Z,{name:"chevron-down",style:{opacity:.3}})]})}),r("div",{className:ze.list,children:Array.from({length:n}).map((l,m)=>r("div",{className:ze.item,style:{pointerEvents:"none"},children:[r("div",{className:ze.dragHandle,style:{opacity:.2},children:r(_t,{width:"16px",height:"16px",variant:"rectangular"})}),r("div",{className:ze.thumbnail,style:{overflow:"hidden",background:"transparent"},children:r(_t,{width:"100%",height:"100%",variant:"rectangular"})}),r("div",{className:ze.meta,children:[r(_t,{width:"80%",height:"1.2rem",variant:"text",className:"mb-2"}),r(_t,{width:"40%",height:"0.8rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},m))})]}),ws=({selectedProvider:n,onProviderChange:l,isAdult:m,options:D})=>{const h=D&&D.length>0?D:[],S=m===void 0?h:h.filter(b=>b.mature===m);return r("div",{className:at.providerSelectContainer,children:[r("h4",{children:"Provider"}),r("select",{className:at.providerSelect,value:n,onChange:b=>l(b.target.value),children:Ln.map(b=>{const A=S.filter(x=>(x.tier??"direct")===b);return A.length===0?null:r("optgroup",{label:Bn[b],children:A.map(x=>r("option",{value:x.value,children:x.sub?`${x.label} (${An[x.sub]})`:x.label},x.value))},b)})})]})},Ts=({videoSources:n,selectedSource:l,selectedLink:m,onSourceChange:D,onLinkChange:h})=>{const S=Array.isArray(n)?n:[];if(S.length===0)return null;const b=l?.type==="iframe"&&(l.links?.length??0)>1;return r("div",{className:at.sourceSelectionContainer,children:[r("h4",{children:"Source"}),r("div",{className:at.sourceButtons,children:S.map((A,x)=>r("button",{className:`${at.sourceButton} ${l?.sourceName===A.sourceName?at.active:""} `,onClick:()=>D(A),children:A.sourceName},`${A.sourceName}-${x}`))}),b&&r("select",{className:at.sourceSelect,"aria-label":"Fallback embed quality",value:m?.link??l.links[0]?.link??"",onChange:A=>{const x=l.links.find($=>$.link===A.target.value);x&&h(x)},children:l.links.map(A=>r("option",{value:A.link,children:A.resolutionStr},A.link))})]})},ks=Ot.memo(Ts,(n,l)=>n.selectedSource?.sourceName===l.selectedSource?.sourceName&&n.selectedLink?.link===l.selectedLink?.link&&n.videoSources===l.videoSources),Cs={low:{sd:1.5,hd:1.3,fhd:1.25},balanced:{sd:2,hd:1.5,fhd:1.25},high:{sd:2.5,hd:2,fhd:1.5},denoise:{sd:1.5,hd:1.5,fhd:1.5}},Rs={low:"ModeB",balanced:"ModeA",high:"ModeAA",denoise:"ModeC"},Ms=5,_s=15e3,Ns=`
|
|
3
3
|
@group(0) @binding(0) var extTex: texture_external;
|
|
4
4
|
@group(0) @binding(1) var extSamp: sampler;
|
|
5
5
|
struct VSOut {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as z,d as ne,T as te,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{S as ae,O as A,a as se,A as le,b as ie}from"./OptionListMenu-
|
|
1
|
+
import{g as z,d as ne,T as te,u as e}from"./vendor-core-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{S as ae,O as A,a as se,A as le,b as ie}from"./OptionListMenu-BQnYYHpM.js";import{u as re}from"./index-_iy8RyKU.js";import"./AvSyncCalibrator-XH4E6Sfp.js";import"./vendor-query-BBT5_sHx.js";const ce="_settingsPanel_y6z3b_1",oe="_header_y6z3b_33",de="_backBtn_y6z3b_56",me="_contentWrapper_y6z3b_76",ue="_menuContent_y6z3b_82",he="_menuItem_y6z3b_89",pe="_selected_y6z3b_114",be="_currentValue_y6z3b_134",ye="_menuNote_y6z3b_141",ge="_menuError_y6z3b_150",n={settingsPanel:ce,header:oe,backBtn:de,contentWrapper:me,menuContent:ue,menuItem:he,selected:pe,currentValue:be,menuNote:ye,menuError:ge},ve=(w,$)=>{const{isOpen:y,onClose:ke,videoSources:Ce,currentSource:C,currentLink:N,onSourceChange:P,subtitles:V,activeSubtitleTrack:g,onSubtitleChange:O,subtitleSettings:E,onSubtitleSettingsChange:T,useNativeControls:v,onNativeControlsToggle:U,anime4kEnabled:u,onAnime4kToggle:B,anime4kSupported:f,anime4kProfile:r,onAnime4kProfileChange:h,anime4kInitializing:L,anime4kError:S,videoDelayEnabled:_,onVideoDelayToggle:M,videoDelayMs:I,onVideoDelayChange:D,onCalibrateAvSync:x,isAutoSkipEnabled:d,onAutoSkipChange:W,isAutoplayEnabled:m,onAutoplayChange:G,fallbackChoice:p,onFallbackChoiceChange:j,isTheaterMode:q,ambientSettings:b,onAmbientChange:k}=w,{lowEndMode:F}=re(),[a,i]=ne("main");z.useEffect(()=>{if(!y){const t=setTimeout(()=>i("main"),300);return()=>clearTimeout(t)}},[y]);const Q=()=>e("div",{className:n.menuContent,children:[e("button",{className:n.menuItem,onClick:()=>i("quality"),children:[e("span",{children:"Quality"}),e("span",{className:n.currentValue,children:N?.resolutionStr||"Auto"})]}),e("button",{className:n.menuItem,onClick:()=>i("subtitles"),children:[e("span",{children:"Subtitles"}),e("span",{className:n.currentValue,children:g||"Off"})]}),e("button",{className:n.menuItem,onClick:()=>i("subtitle-style"),children:e("span",{children:"Subtitle Style"})}),F&&e("button",{className:`${n.menuItem} ${v?n.selected:""}`,onClick:()=>{const t=!v;U(t),localStorage.setItem("playerUseNativeControls",t.toString())},children:[e("span",{children:"Native Controls"}),v&&e(o,{name:"check",size:12})]}),f&&e("button",{className:`${n.menuItem} ${u?n.selected:""}`,onClick:()=>{B(!u)},children:[e("span",{children:"Anime4K Upscaler"}),u&&e(o,{name:"check",size:12})]}),f&&u&&e("button",{className:n.menuItem,onClick:()=>i("upscaler"),children:e("span",{children:"Upscaler Settings"})}),e("button",{className:n.menuItem,onClick:()=>i("av-sync"),children:[e("span",{children:"A/V Sync"}),e("span",{className:n.currentValue,children:_?`${I}ms`:"Off"})]}),e("button",{className:n.menuItem,onClick:()=>i("playback"),children:[e("span",{children:"Playback"}),e("span",{className:n.currentValue,children:[d?"Auto-skip On":null,m?"Autoplay On":null].filter(Boolean).join(" • ")||"Off"})]}),q&&b&&k&&e("button",{className:n.menuItem,onClick:()=>i("ambient"),children:[e("span",{children:"Ambient Light"}),e("span",{className:n.currentValue,children:b.enabled?"On":"Off"})]})]}),R=()=>{const t=C?.links.sort((s,c)=>(parseInt(c.resolutionStr)||0)-(parseInt(s.resolutionStr)||0))||[];return e("div",{className:n.menuContent,children:e(A,{classes:{item:n.menuItem,active:n.selected},options:t.map(s=>({key:s.resolutionStr,label:s.resolutionStr,selected:N?.resolutionStr===s.resolutionStr})),onSelect:s=>{const c=t.find(l=>l.resolutionStr===s);c&&P(C,c)}})})},H=()=>e("div",{className:n.menuContent,children:e(A,{classes:{item:n.menuItem,active:n.selected},options:[{key:"off",label:"Off",selected:g==="off"},...V.map(t=>({key:t.label||t.lang,label:t.label,selected:g===(t.label||t.lang)}))],onSelect:t=>O(t)})}),K=()=>e("div",{className:n.menuContent,children:e(se,{classes:{item:n.menuItem,active:n.selected},values:E,onChange:T})}),J=te(()=>{try{const s=navigator.userAgentData?.brands?.map(l=>l.brand.toLowerCase())??[];if(s.length>0)return s.some(l=>l.includes("chromium")||l.includes("chrome")||l.includes("edge")||l.includes("opera")||l.includes("brave")||l.includes("vivaldi"));const c=navigator.userAgent.toLowerCase();return c.includes("chrome")||c.includes("chromium")||c.includes("edg")}catch{return!0}},[]),X=()=>e("div",{className:n.menuContent,children:[L&&e("div",{className:n.menuNote,role:"status",children:"Preparing GPU, this can take a few seconds…"}),S&&e("div",{className:n.menuError,role:"alert",children:["Upscaler failed: ",S]}),!J&&e("div",{className:n.menuNote,children:"Upscaling performs best in Chrome-based browsers."}),e("button",{className:`${n.menuItem} ${r==="low"?n.selected:""}`,onClick:()=>h("low"),children:[e("div",{children:[e("div",{children:"Low"}),e("div",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)"},children:"Lightest, best for weaker GPUs"})]}),r==="low"&&e(o,{name:"check",size:12})]}),e("button",{className:`${n.menuItem} ${r==="balanced"?n.selected:""}`,onClick:()=>h("balanced"),children:[e("div",{children:[e("div",{children:"Balanced"}),e("div",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)"},children:"Source + display aware"})]}),r==="balanced"&&e(o,{name:"check",size:12})]}),e("button",{className:`${n.menuItem} ${r==="high"?n.selected:""}`,onClick:()=>h("high"),children:[e("div",{children:[e("div",{children:"High"}),e("div",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)"},children:"Aggressive, needs strong GPU"})]}),r==="high"&&e(o,{name:"check",size:12})]}),e("button",{className:`${n.menuItem} ${r==="denoise"?n.selected:""}`,onClick:()=>h("denoise"),children:[e("div",{children:[e("div",{children:"Denoise"}),e("div",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)"},children:"Denoise + upscale noisy, compressed sources"})]}),r==="denoise"&&e(o,{name:"check",size:12})]})]}),Y=()=>e("div",{className:n.menuContent,children:[e("button",{type:"button",className:`${n.menuItem} ${d?n.selected:""}`,onClick:()=>W(!d),"aria-pressed":d,children:[e("span",{children:"Auto-skip openings and endings"}),e("span",{className:n.currentValue,children:d?"On":"Off"})]}),e("div",{className:n.menuNote,children:"Automatically jump past opening, ending and recap segments when detected."}),e("button",{type:"button",className:`${n.menuItem} ${m?n.selected:""}`,onClick:()=>G(!m),"aria-pressed":m,children:[e("span",{children:"Autoplay next episode"}),e("span",{className:n.currentValue,children:m?"On":"Off"})]}),e("div",{className:n.menuNote,children:"Automatically start the next episode when this one ends."}),e("button",{type:"button",className:n.menuItem,onClick:()=>j(p==="ask"?"iframe":p==="iframe"?"retry":"ask"),children:[e("span",{children:"Failed direct stream"}),e("span",{className:n.currentValue,children:p==="iframe"?"Use iframe":p==="retry"?"Try provider":"Ask me"})]}),e("div",{className:n.menuNote,children:"When a direct stream fails: ask each time, go straight to the embedded player (may show ads), or automatically try another provider."})]}),Z=()=>e("div",{className:n.menuContent,children:e(le,{classes:{item:n.menuItem,active:n.selected,note:n.menuNote},enabled:_,delayMs:I,onToggle:M,onDelayChange:D,onCalibrate:x})}),ee=()=>b&&k?e("div",{className:n.menuContent,children:e(ie,{classes:{item:n.menuItem,active:n.selected,note:n.menuNote},values:b,onChange:k})}):null;return y?e(ae,{classes:{panel:n.settingsPanel,header:n.header,backBtn:n.backBtn,title:"",content:n.contentWrapper},title:a==="main"?"Settings":a==="ambient"?"Ambient Light":a.charAt(0).toUpperCase()+a.slice(1).replace("-"," "),titleTag:"h3",showBack:a!=="main",onBack:()=>i("main"),panelRef:$,onPanelClick:t=>t.stopPropagation(),children:[a==="main"&&Q(),a==="quality"&&R(),a==="subtitles"&&H(),a==="subtitle-style"&&K(),a==="upscaler"&&X(),a==="av-sync"&&Z(),a==="playback"&&Y(),a==="ambient"&&ee()]}):null},ze=z.forwardRef(ve);export{ze as default};
|
package/client/dist/assets/{QueueOptionsButton-DFny02Po.js → QueueOptionsButton-CGQAqTtM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as F}from"./vendor-query-BBT5_sHx.js";import{t as T,l as j,Z as H,$ as J,a0 as W}from"./index-
|
|
1
|
+
import{b as F}from"./vendor-query-BBT5_sHx.js";import{t as T,l as j,Z as H,$ as J,a0 as W}from"./index-_iy8RyKU.js";import{d as X,T as R,q as r,u as t,$ as Y,S as w}from"./vendor-core-DfaOB3Rn.js";import{a as ee,c as te,d as ne,b as se,o as oe,f as ae,s as ie}from"./vendor-ui-3qrARCPr.js";import{I as u}from"./vendor-icons-DrybRNxP.js";function Pe(n){return F({queryKey:["show-meta",n],queryFn:async()=>n?T.data.showMeta.query({id:n}):{},enabled:!!n,staleTime:3e4})}async function re(n){try{return await T.watchlist.queueSuggested.query({showId:n})}catch{throw new Error("Failed to resolve suggested episode")}}const ue="_trigger_1vova_6",le="_triggerBtn_1vova_11",me="_chevron_1vova_25",ce="_menu_1vova_34",de="_menuTitle_1vova_51",pe="_menuItem_1vova_60",ge="_removeItem_1vova_91",fe="_menuEmpty_1vova_99",a={trigger:ue,triggerBtn:le,chevron:me,menu:ce,menuTitle:de,menuItem:pe,removeItem:ge,menuEmpty:fe},ve=8,qe=({showId:n,showName:v,showThumbnail:h,nativeName:y,englishName:_,showType:b,className:z="",activeClassName:A="",align:D="right",onMenuOpenChange:p})=>{const{data:E=[]}=j(),P=H(),q=J(),[l,f]=X(!1),{refs:Q,floatingStyles:M,context:S}=ee({open:l,onOpenChange:e=>{e||(f(!1),p?.(!1))},placement:D==="left"?"bottom-start":"bottom-end",middleware:[oe(ve),ae({padding:8}),ie({padding:8})],whileElementsMounted:se}),x=te(S,{outsidePress:!0,escapeKey:!0,referencePress:!1}),{getReferenceProps:C,getFloatingProps:I}=ne([x]),m=R(()=>E.filter(e=>e.showId===n),[E,n]),{data:K}=F({queryKey:["suggestedEpisode",n],queryFn:()=>re(n),enabled:!!n}),{data:$,isFetching:N}=W(n,l),s=R(()=>$?.episodes||[],[$]),k=r(()=>{f(!0),p?.(!0)},[p]),c=r(()=>{f(!1),p?.(!1)},[p]),d=m.length>0,o=s.length>0,g=K?.episodeNumber,i=r(e=>{!n||e.length===0||(P.mutate({showId:n,episodeNumbers:e,showName:v,showThumbnail:h,nativeName:y,englishName:_,type:b}),c())},[n,v,h,y,_,b,P,c]),L=r(()=>{!n||m.length===0||(q.mutate({showId:n,episodeNumbers:m.map(e=>e.episodeNumber)}),c())},[n,m,q,c]),O=r(()=>{o?i([s[0]]):g&&i([String(g)])},[o,s,g,i]),U=r(()=>{o&&i(s.slice(0,3))},[o,s,i]),G=r(()=>{o&&i([...s])},[o,s,i]),B=s[0],V=s[Math.min(2,s.length-1)],Z=t("div",{className:a.trigger,ref:Q.setReference,children:t("span",{className:`${a.triggerBtn} ${z} ${d?A:""}`,role:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":l,"aria-label":d?"Queued":"Queue",...C(),onClick:e=>{e.preventDefault(),e.stopPropagation(),l?c():k()},onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),l?c():k())},children:[d?t(u,{name:"check",size:14}):t(u,{name:"plus",size:14}),d?"Queued":"Queue",t(u,{name:"chevron-down",size:10,className:a.chevron})]})});return t(w,{children:[Z,l&&Y(t("div",{ref:Q.setFloating,className:a.menu,style:M,role:"menu",...I(),onMouseDown:e=>e.stopPropagation(),onClick:e=>{e.preventDefault(),e.stopPropagation()},children:[t("div",{className:a.menuTitle,children:"Queue episodes"}),t("button",{className:a.menuItem,role:"menuitem",type:"button",disabled:!o&&!g,onClick:e=>{e.stopPropagation(),O()},children:[t(u,{name:"plus",size:11}),t("span",{children:o?`+1 — EP ${B}`:`+1 — EP ${g||"?"}`})]}),t("button",{className:a.menuItem,role:"menuitem",type:"button",disabled:!o,onClick:e=>{e.stopPropagation(),U()},children:[t(u,{name:"plus",size:11}),t("span",{children:o?`+3 — EP ${B}${s.length>1?`-${V}`:""}`:"+3"})]}),t("button",{className:a.menuItem,role:"menuitem",type:"button",disabled:!o,onClick:e=>{e.stopPropagation(),G()},children:[t(u,{name:"plus",size:11}),t("span",{children:["All Remaining",N?"":` (${Math.max(s.length,0)})`]})]}),!N&&s.length===0&&t("div",{className:a.menuEmpty,children:d?"All episodes are already queued":"No remaining unwatched episodes"}),d&&t("button",{className:`${a.menuItem} ${a.removeItem}`,role:"menuitem",type:"button",onClick:e=>{e.stopPropagation(),L()},children:[t(u,{name:"times",size:11}),t("span",{children:["Remove from Queue",m.length>0?` (${m.length})`:""]})]})]}),document.body)]})};export{qe as Q,Pe as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as s,u as n,a as Y}from"./vendor-core-DfaOB3Rn.js";import{I as P}from"./vendor-icons-DrybRNxP.js";import{d as L,f as z}from"./index-
|
|
1
|
+
import{g as s,u as n,a as Y}from"./vendor-core-DfaOB3Rn.js";import{I as P}from"./vendor-icons-DrybRNxP.js";import{d as L,f as z}from"./index-_iy8RyKU.js";const F="_section_1pwqc_1",O="_header_1pwqc_10",j="_headerToggle_1pwqc_20",G="_headerActions_1pwqc_34",J="_title_1pwqc_40",K="_badge_1pwqc_50",V="_clearBtn_1pwqc_65",W="_nextBtn_1pwqc_83",Z="_list_1pwqc_101",ee="_item_1pwqc_114",ne="_active_1pwqc_134",te="_dragging_1pwqc_142",re="_dragHandle_1pwqc_149",ce="_thumbnail_1pwqc_167",ae="_meta_1pwqc_175",oe="_name_1pwqc_182",se="_episode_1pwqc_204",ie="_iconBtn_1pwqc_210",r={section:F,header:O,headerToggle:j,headerActions:G,title:J,badge:K,clearBtn:V,nextBtn:W,list:Z,item:ee,active:ne,dragging:te,dragHandle:re,thumbnail:ce,meta:ae,name:oe,episode:se,iconBtn:ie},le=({item:c,isActive:T,index:m,onRemove:D,onTouchPointerDown:v,onTouchPointerMove:x,onTouchPointerUp:q,onTouchPointerCancel:I,shouldIgnoreClick:_,onDragStart:B,onDragEnter:f,onDragEnd:o,isDragging:w})=>{const a=Y(),{titlePreference:i}=L(),l=c[i]||c.name||"Unknown show";return n("div",{"data-queue-index":m,className:`${r.item} ${T?r.active:""} ${w?r.dragging:""}`,draggable:!0,onDragStart:B,onDragEnter:f,onDragOver:u=>u.preventDefault(),onDragEnd:o,onPointerDown:u=>v(m,u),onPointerMove:x,onPointerUp:q,onPointerCancel:I,children:[n("button",{className:r.dragHandle,type:"button","aria-label":"Drag queue item",children:n(P,{name:"bars"})}),n("img",{className:r.thumbnail,src:z(c.thumbnail||"",72,96),alt:l,loading:"lazy",decoding:"async",onError:u=>{u.currentTarget.src="/placeholder.svg"}}),n("div",{className:r.meta,children:[n("button",{className:r.name,type:"button",onClick:()=>{_()||a(`/watch/${c.showId}/${c.episodeNumber}`)},children:l}),n("div",{className:r.episode,children:["Episode ",c.episodeNumber]})]}),n("button",{className:r.iconBtn,type:"button",onClick:()=>{_()||D(c)},"aria-label":`Remove ${l} episode ${c.episodeNumber} from queue`,children:n(P,{name:"times"})})]})},he=({title:c="Queue",eyebrow:T,items:m,currentShowId:D,currentEpisode:v,onRemove:x,onReorder:q,onNextQueue:I,onClear:_,showClearAll:B=!1,defaultExpanded:f=!0})=>{const[o,w]=s.useState([]),[a,i]=s.useState(null),[l,u]=s.useState(f),b=s.useRef(null),N=s.useRef(null),d=s.useRef(null),p=s.useRef(!1),R=s.useRef(!1);s.useEffect(()=>{w(m)},[m]),s.useEffect(()=>{u(f)},[f]);const E=e=>{i(e)},$=e=>{if(a===null||a===e)return;const t=[...o],h=t[a];t.splice(a,1),t.splice(e,0,h),i(e),w(t)},k=()=>{a!==null&&q(o.map(e=>({id:e.id,showId:e.showId,episodeNumber:e.episodeNumber}))),i(null)},C=(e=!1)=>{d.current!==null&&(window.clearTimeout(d.current),d.current=null),e&&p.current&&(q(o.map(t=>({id:t.id,showId:t.showId,episodeNumber:t.episodeNumber}))),R.current=!0,window.setTimeout(()=>{R.current=!1},0)),b.current=null,N.current=null,p.current=!1,i(null)},A=(e,t)=>{if(t.pointerType==="mouse")return;const h=t.currentTarget,g=t.pointerId;b.current=t.pointerId,N.current={x:t.clientX,y:t.clientY},d.current!==null&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{p.current=!0,i(e);try{h.setPointerCapture(g)}catch{}},220)},Q=e=>{if(e.pointerType==="mouse"||b.current!==e.pointerId)return;if(!p.current&&N.current){const H=Math.abs(e.clientX-N.current.x),X=Math.abs(e.clientY-N.current.y);(H>8||X>8)&&C(!1);return}if(!p.current)return;e.preventDefault();const h=document.elementFromPoint(e.clientX,e.clientY)?.closest?.("[data-queue-index]"),g=h?Number(h.dataset.queueIndex):NaN;if(Number.isNaN(g)||a===null||g===a)return;const y=[...o],U=y[a];y.splice(a,1),y.splice(g,0,U),i(g),w(y)},S=e=>{e.pointerType!=="mouse"&&b.current===e.pointerId&&C(p.current)},M=e=>{e.pointerType!=="mouse"&&b.current===e.pointerId&&C(!1)};return o.length===0?null:n("section",{className:r.section,children:[n("div",{className:r.header,children:[n("button",{className:r.headerToggle,type:"button",onClick:()=>u(e=>!e),"aria-expanded":l,"aria-label":l?`Collapse ${c}`:`Expand ${c}`,children:[n("span",{className:r.title,children:[n("span",{className:"title-stack",children:[T&&n("div",{className:"section-eyebrow",children:T}),n("span",{children:c})]}),n("span",{className:r.badge,children:o.length})]}),l?n(P,{name:"chevron-up"}):n(P,{name:"chevron-down"})]}),B&&_&&n("div",{className:r.headerActions,children:[I&&o.length>1&&n("button",{className:r.nextBtn,type:"button",onClick:I,children:"Next"}),n("button",{className:r.clearBtn,type:"button",onClick:_,children:"Clear All"})]})]}),l&&n("div",{className:r.list,children:o.map((e,t)=>n(le,{item:e,isActive:e.showId===D&&e.episodeNumber===v,index:t,onRemove:x,onTouchPointerDown:A,onTouchPointerMove:Q,onTouchPointerUp:S,onTouchPointerCancel:M,shouldIgnoreClick:()=>R.current,onDragStart:()=>E(t),onDragEnter:()=>$(t),onDragEnd:k,isDragging:a===t},e.id))})]})};export{he as Q,r as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as h,A as F,h as y,g as se,u as e,S as R,$ as J,T as K}from"./vendor-core-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{b as Z}from"./vendor-query-BBT5_sHx.js";import{h as x,t as G,O as re}from"./index-
|
|
1
|
+
import{d as h,A as F,h as y,g as se,u as e,S as R,$ as J,T as K}from"./vendor-core-DfaOB3Rn.js";import{I as o}from"./vendor-icons-DrybRNxP.js";import{b as Z}from"./vendor-query-BBT5_sHx.js";import{h as x,t as G,O as re}from"./index-_iy8RyKU.js";import{a}from"./Asmr.module-CdWlioTY.js";import{r as i}from"./Radio.module-DGSZLpKM.js";import{p as L}from"./page.module-C1MlZzf3.js";const ee=300*1e3,le="https://cdn.listen.moe/covers/";function z(n){return n?n.startsWith("http")?n:`${le}${n}`:null}function oe(n){return n?z(n.albums[0]?.image)||z(n.artists[0]?.image)||z(n.sources[0]?.image):null}function U(n){return n?n.artists.map(s=>s.nameRomaji||s.name).join(", "):""}const ie=()=>{const n=x();return Z({...n.radio.stations.queryOptions(),staleTime:ee})},ce=n=>{const s=x();return Z({...s.radio.search.queryOptions({q:n}),enabled:n.trim().length>0,staleTime:ee})},X={song:null,lastPlayed:[],listeners:0,startTime:null},de=n=>{const[s,p]=h(X),[l,c]=h(!1),d=F(null);return y(()=>{if(p(X),c(!1),!n)return;let u=null,f=!1;try{u=new WebSocket(n)}catch{return}return u.onopen=()=>{f||c(!0)},u.onmessage=v=>{try{const m=JSON.parse(v.data);if(m.op===0){const N=m.d?.heartbeat||35e3;d.current&&window.clearInterval(d.current),d.current=window.setInterval(()=>{u&&u.readyState===WebSocket.OPEN&&u.send(JSON.stringify({op:9}))},N)}else m.op===1&&p({song:m.d?.song||null,lastPlayed:m.d?.lastPlayed||[],listeners:m.d?.listeners||0,startTime:m.d?.startTime||null})}catch{}},u.onclose=()=>{f||c(!1)},()=>{f=!0,d.current&&window.clearInterval(d.current),d.current=null,u&&u.close()}},[n]),{nowPlaying:s,connected:l}};function Y(n){if(!n)return"";const s=Math.max(0,Math.floor((Date.now()-new Date(n).getTime())/1e3)),p=Math.floor(s/60),l=s%60;return`${p}:${String(l).padStart(2,"0")}`}const me=({station:n,nowPlaying:s,connected:p,expanded:l,onStationStep:c,onExpandedChange:d,onClose:u})=>{const f=F(null),[v,m]=h(!1),[N,V]=h(!0),[S,I]=h(!1),[T,k]=h(!0),[A,E]=h(""),[b,D]=h(()=>{const t=parseFloat(localStorage.getItem("radioVolume")||"");return Number.isFinite(t)?t:1}),r=F(""),g=F(b);g.current=b,r.current||(r.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`radio-${Date.now()}-${Math.random().toString(36).slice(2)}`);const w=s.song,C=oe(w)||n.favicon||null,[B,W]=h(!1);y(()=>{W(!1)},[C]);const M=B?null:C,q=!!M,P=w?`${U(w)} — ${w.title}`:n.name;y(()=>{const t=f.current;if(t)return m(!1),t.src=n.streamUrl,t.load(),t.volume=g.current,t.play().catch(()=>m(!1)),()=>{t.removeAttribute("src")}},[n.id,n.streamUrl]),y(()=>{const t=f.current;t&&(t.volume=b)},[b]),y(()=>{if(l)return document.body.classList.add("asmr-player-open"),()=>document.body.classList.remove("asmr-player-open")},[l]),y(()=>{l&&k(!0)},[l]);const te=t=>t?Math.max(0,Math.floor((Date.now()-new Date(t).getTime())/1e3)):0,O=se.useCallback(t=>{n&&(G.discord.radioPresence.mutate({title:P,stationLabel:n.name,isPlaying:t,thumbnail:M||"",currentTime:te(s.startTime),sessionId:r.current}).catch(()=>{}),G.discord.heartbeat.mutate({sessionId:r.current}).catch(()=>{}))},[n,P,M,s.startTime]);y(()=>{O(v)},[O,v,n.id,P,l]),y(()=>{if(!v)return;const t=window.setInterval(()=>O(!0),15e3);return()=>window.clearInterval(t)},[v,O]),y(()=>{const t=r.current,$=()=>re(t),H=()=>$(),_=()=>{document.visibilityState==="hidden"&&$()};return window.addEventListener("pagehide",H),window.addEventListener("beforeunload",H),document.addEventListener("visibilitychange",_),()=>{window.removeEventListener("pagehide",H),window.removeEventListener("beforeunload",H),document.removeEventListener("visibilitychange",_),$()}},[]),y(()=>{if(!s.startTime){E("");return}E(Y(s.startTime));const t=window.setInterval(()=>E(Y(s.startTime)),1e3);return()=>window.clearInterval(t)},[s.startTime,s.song?.id]),y(()=>{if(!l)return;const t=$=>{$.key==="Escape"&&(S?I(!1):d(!1))};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[l,S,d]);const ae=()=>{const t=f.current;t&&(t.paused?(t.load(),t.play().catch(()=>{})):t.pause())},ne=e(R,{children:[e("div",{className:a.playerButtons,children:[e("button",{className:a.playerBtn,onClick:()=>c(-1),"aria-label":"Previous station",children:e(o,{name:"step-backward"})}),e("button",{className:`${a.playerBtn} ${a.playBtn}`,onClick:ae,"aria-label":v?"Pause":"Play",children:v?e(o,{name:"pause"}):e(o,{name:"play"})}),e("button",{className:a.playerBtn,onClick:()=>c(1),"aria-label":"Next station",children:e(o,{name:"step-forward"})})]}),e("div",{className:a.seekRow,children:[e("span",{className:i.liveBadge,children:[e(o,{name:"broadcast-tower",size:10})," LIVE"]}),A&&e("span",{className:a.timeLabel,children:A}),p&&s.listeners>0&&e("span",{className:a.timeLabel,children:[s.listeners," listening"]}),!p&&n.source==="listen.moe"&&e("span",{className:a.timeLabel,children:"connecting…"})]})]}),j=e(R,{children:[e("button",{className:`${a.playerBtn} ${a.playerToggle}`,onClick:()=>d(!l),"aria-label":l?"Minimize player":"Expand player",title:l?"Minimize to browse":"Expand",children:l?e(o,{name:"chevron-down"}):e(o,{name:"chevron-up"})}),e("div",{className:a.playerInfo,children:[e("p",{className:a.playerTitle,title:P,children:P}),e("p",{className:a.playerTrack,children:n.name})]}),e("div",{className:a.playerControls,children:ne}),e("div",{className:a.playerRight,children:[b===0?e(o,{name:"volume-mute",className:a.volumeIcon}):b<.5?e(o,{name:"volume-down",className:a.volumeIcon}):e(o,{name:"volume-up",className:a.volumeIcon}),e("input",{className:a.volumeBar,type:"range",min:0,max:1,step:.01,value:b,onChange:t=>{const $=parseFloat(t.target.value);D($),localStorage.setItem("radioVolume",String($))},style:{"--volume-percent":`${b*100}%`},"aria-label":"Volume"})]}),e("div",{className:a.playerActions,children:[l&&q&&e("button",{className:a.playerBtn,onClick:()=>V(t=>!t),"aria-label":N?"Hide art":"Show art",title:N?"Hide art":"Show art",children:N?e(o,{name:"eye-slash"}):e(o,{name:"image"})}),l&&s.lastPlayed.length>0&&e("button",{className:`${a.playerBtn} ${S?a.playerBtnActive:""}`,onClick:()=>I(t=>!t),"aria-label":S?"Hide history":"Show history",title:"Recently played",children:e(o,{name:"list-ol"})}),e("button",{className:a.playerBtn,onClick:u,"aria-label":"Close player",children:e(o,{name:"times"})})]})]}),Q=e("audio",{ref:f,preload:"none",onPlay:()=>m(!0),onPause:()=>m(!1)});return l?J(e(R,{children:[Q,e("div",{className:`${a.npOverlay} ${T?"":a.npOverlayControlsHidden}`,children:[e("div",{className:`${a.npStage} ${!N||!q?a.npStageBlank:""}`,onClick:()=>k(t=>!t),children:N&&q&&M&&e("div",{className:i.coverWrap,children:e("img",{src:M,alt:P,loading:"lazy",decoding:"async",draggable:!1,className:i.cover,onError:()=>W(!0)})})}),e("div",{className:`${a.playerBar} ${a.playerBarDocked} ${T?"":a.playerBarDockedHidden}`,onClick:t=>t.stopPropagation(),children:[j,S&&e(R,{children:[e("div",{className:a.npBackdrop,onClick:()=>I(!1)}),e("div",{className:a.chapterPanel,children:s.lastPlayed.map(t=>e("div",{className:a.chapterRow,children:e("span",{className:a.chapterRowLabel,title:`${U(t)} — ${t.title}`,children:[U(t)," — ",t.title]})},t.id))})]})]})]})]}),document.body):J(e(R,{children:[Q,e("div",{className:a.playerBar,children:j})]}),document.body)},Ne=()=>{y(()=>{document.title="Radio - dango"},[]);const[n,s]=h(""),[p,l]=h(""),[c,d]=h(null),[u,f]=h(!0),{data:v,isLoading:m}=ie(),{data:N,isLoading:V}=ce(p),S=K(()=>v?.stations||[],[v]),I=K(()=>N?.stations||[],[N]),T=p?I:S,{nowPlaying:k,connected:A}=de(c?.gateway),E=r=>{d(r),f(!0)},b=r=>{const g=T.length>0?T:S;if(g.length===0||!c)return;const w=g.findIndex(B=>B.id===c.id),C=g[(w<0?0:w+r+g.length)%g.length];d(C)},D=r=>{const g=c?.id===r.id,w=g&&k.song?`${U(k.song)} — ${k.song.title}`:null,C=[r.codec,r.bitrate?`${r.bitrate}k`:"",r.tags].filter(Boolean).join(" · ");return e("button",{className:`${i.stationRow} ${g?i.stationRowActive:""}`,onClick:()=>E(r),children:[r.favicon?e("img",{src:r.favicon,alt:"",className:i.stationThumb,loading:"lazy",decoding:"async",onError:B=>{B.target.style.display="none"}}):e("span",{className:i.stationThumbPlaceholder,children:e(o,{name:"broadcast-tower"})}),e("span",{className:i.stationMeta,children:[e("span",{className:i.stationName,children:r.name}),C&&e("span",{className:i.stationSub,children:C})]}),w&&e("span",{className:i.stationNowPlaying,children:w})]},r.id)};return e("div",{className:`${L.page} ${c?L.pageWithPlayer:""}`,children:[e("div",{className:L.header,children:[e("h1",{className:L.pageTitle,children:[e(o,{name:"broadcast-tower"})," Radio"]}),e("form",{className:L.searchForm,onSubmit:r=>{r.preventDefault(),l(n)},children:[e("input",{className:L.searchInput,value:n,onChange:r=>s(r.target.value),placeholder:"Search stations (anime, j-pop, k-pop…)","aria-label":"Search radio stations"}),e("button",{className:L.searchBtn,type:"submit","aria-label":"Search",children:e(o,{name:"search"})})]})]}),p?e(R,{children:[e("h2",{className:i.sectionTitle,children:["Results for “",p,"”"]}),V?e("p",{className:a.statusMsg,children:"Searching…"}):I.length===0?e("p",{className:a.statusMsg,children:"No stations found."}):e("div",{className:i.stationList,children:I.map(D)})]}):e(R,{children:[e("h2",{className:i.sectionTitle,children:"Featured"}),m?e("p",{className:a.statusMsg,children:"Loading…"}):e("div",{className:i.stationList,children:S.map(D)})]}),c&&e(me,{station:c,nowPlaying:k,connected:A,expanded:u,onStationStep:b,onExpandedChange:f,onClose:()=>d(null)})]})};export{Ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as U,d as v,h as b,T as w,u as i,S as E}from"./vendor-core-DfaOB3Rn.js";import{M as x}from"./MediaCard-
|
|
1
|
+
import{o as U,d as v,h as b,T as w,u as i,S as E}from"./vendor-core-DfaOB3Rn.js";import{M as x}from"./MediaCard-DM2d5vjg.js";import{L as F}from"./LibraryListPage-BcHi-OIb.js";import{u as _,M as z}from"./useMangaPopup-BQe7Ug-A.js";import{M as D}from"./MangaResetProgressModal-yIv7jY4h.js";import{x as G,d as O,o as Q,p as Y,u as q,y as H,z as K,A as V,M as h,m as Z,i as j,b as J,c as W}from"./useMangaLibrary-BrKhv-sI.js";import"./vendor-ui-3qrARCPr.js";import"./useIsMobile-Dvx1uJ82.js";import"./vendor-icons-DrybRNxP.js";import"./index-_iy8RyKU.js";import"./vendor-query-BBT5_sHx.js";import"./SkeletonGrid-DyG9u20F.js";import"./ErrorMessage-DAxegITP.js";import"./Watchlist.module-XGtVQr1d.js";import"./usePopup-DS9jMzp6.js";import"./ResetProgressModal-aeUUSFYc.js";const X=["All","Continue Reading",...h],R=24,y=e=>({provider:e.provider,mangaId:e.mangaId,title:e.title,altTitle:e.altTitle,cover:e.cover,contentRating:e.contentRating,readTarget:e.detailTarget,progressLabel:e.progressLabel});function ba(){const{filter:e="All"}=U(),[g,p]=v(1),[d,u]=v(null);b(()=>{document.title="Reading List - dango"},[]),b(()=>{p(1)},[e]);const r=e==="Continue Reading",n=G(r?"All":e,g,R),s=O(100),I=Q(),T=Y(),{toggle:L,bookmarkedIds:C}=q(),{popup:t,openPopup:k,scheduleClose:c,cancelClose:m,closePopup:M}=_(),f=H(),P=K(),B=V(),S=w(()=>r?(s.data?.data??[]).map(a=>{const o=a.page??0,l=a.pageCount??0;return{key:a.id,libId:a.id,provider:a.provider,mangaId:a.mangaId,title:a.title,altTitle:a.altTitle,cover:a.cover||"",status:a.status,contentRating:a.contentRating||void 0,chapterLabel:a.chapterNumber?`Ch. ${a.chapterNumber}`:void 0,progressPercent:l>0?o/l*100:0,progressLabel:a.chapterNumber&&l>0?`Ch. ${a.chapterNumber} · p. ${o}/${l}`:void 0,detailTarget:a.chapterId&&a.provider&&a.mangaId?`/manga/${a.provider}/${encodeURIComponent(a.mangaId)}/read?chapter=${encodeURIComponent(a.chapterId)}`:`/manga/${a.provider}/${encodeURIComponent(a.mangaId)}`}}):(n.data?.data??[]).map(a=>({key:a.id,libId:a.id,provider:a.provider,mangaId:a.mangaId,title:a.title,altTitle:a.altTitle,cover:a.cover||"",status:a.status,contentRating:a.contentRating||void 0,chapterLabel:a.lastChapterNumber?`Ch. ${a.lastChapterNumber}`:void 0,progressPercent:void 0,progressLabel:void 0,detailTarget:`/manga/${a.provider}/${encodeURIComponent(a.mangaId)}`})),[r,s.data,n.data]),A=r?s.data?.total??0:n.data?.total??0,$=r?s.isLoading:n.isLoading,N=r?s.error:n.error;return i(F,{headerTitle:"My Reading List",headerSubtitle:"Track and manage your manga collection",filters:X,filterBy:e,filterBasePath:"/reading-list",continueFilter:"Continue Reading",statusOptions:[...h],entries:S,total:A,isLoading:$,error:N,page:g,pageSize:R,onPageChange:p,emptyTitle:"Your reading list is looking a bit lonely",emptyFilteredText:"No titles match this filter.",emptyAllText:"Let's find something to read!",browseLabel:"Browse Manga",browseTarget:"/manga",removeListLabel:"Remove from Reading List",listNoun:"reading list",skipConfirmKey:"mangaSkipRemoveConfirmation",onBulkStatus:(a,o)=>f.mutate({ids:a,status:o}),onBulkRemove:a=>{r?B.mutate(a):P.mutate(a)},onStatusChange:(a,o)=>T.mutate({id:a,status:o}),onRemoveItem:a=>I.mutate(a),renderCard:a=>i(x,{item:{id:a.libId,title:a.title,...W({title:a.title,altTitle:a.altTitle}),thumbnail:J(a.provider,a.cover),chapterBadge:a.chapterLabel??null,isAdult:j(a)},linkTo:a.detailTarget,hoverIcon:"book",progress:a.progressPercent!==void 0&&a.progressLabel?{percent:a.progressPercent,label:a.progressLabel}:void 0,showProgress:r,display:{elements:{poster:{typeBadge:!1,chapterBadge:!0,adultBadge:!0},info:{title:!0,mobileBadges:!0,progress:!0,meta:!1}}},onRemove:r?()=>u(a):void 0,onOpenDetails:o=>k(o,y(a)),onPopupHoverIntent:o=>o?m():c(),rawThumbnail:!0}),modals:i(E,{children:[t&&t.data.provider&&i(z,{data:t.data,anchorRect:t.rect,bookmarked:C.has(Z(t.data.provider,t.data.mangaId)),onToggleBookmark:()=>L({id:t.data.mangaId,provider:t.data.provider,title:t.data.title,cover:t.data.cover,altTitle:t.data.altTitle??void 0,contentRating:t.data.contentRating}),onMouseEnter:m,onMouseLeave:c,onRequestClose:M}),i(D,{mangaId:d?d.libId:null,title:d?.title,onClose:()=>u(null)})]})})}export{ba as default};
|
package/client/dist/assets/{ResetProgressModal-DGE5sfz2.js → ResetProgressModal-aeUUSFYc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./vendor-core-DfaOB3Rn.js";import{M as r,B as n}from"./index-
|
|
1
|
+
import{u as e}from"./vendor-core-DfaOB3Rn.js";import{M as r,B as n}from"./index-_iy8RyKU.js";const p=({isOpen:t,itemName:c,progressKind:i,listLabel:s,alsoRemove:a,onAlsoRemoveChange:d,onClose:o,onConfirm:l})=>e(r,{isOpen:t,onClose:o,title:"Reset Progress",children:[e(r.Body,{children:[e("p",{children:["Are you sure you want to remove your ",i,' progress for "',c,'"?']}),e("label",{children:[e("input",{type:"checkbox",checked:a,onChange:h=>d(h.target.checked)}),"Also remove from ",s]})]}),e(r.Actions,{children:[e(n,{variant:"secondary",onClick:o,children:"No"}),e(n,{variant:"danger",onClick:l,children:"Yes"})]})]});export{p as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as R,p as me,a as ge,d as o,A as ve,g as fe,u as a}from"./vendor-core-DfaOB3Rn.js";import{I as L}from"./vendor-icons-DrybRNxP.js";import{P as ee,S as Le}from"./SkeletonGrid-CtRkgW2V.js";import{A as Ae}from"./AnimeCard-Bj5amdPt.js";import{t as be,u as ye,v as Se,L as ae,B as w,N as Ne}from"./index-NKjVUCZV.js";import{E as Ce}from"./ErrorMessage-DAxegITP.js";import{s as t}from"./Search.module-CMEai-B-.js";import"./useAnimeInfoData-nFJhxeIK.js";import"./vendor-query-BBT5_sHx.js";import"./QueueOptionsButton-DFny02Po.js";import"./vendor-ui-3qrARCPr.js";import"./MediaCard-DlN3VNy8.js";import"./useIsMobile-Dvx1uJ82.js";const Te=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Mature"}],Ee=[{value:"ALL",label:"All Seasons"},{value:"Winter",label:"Winter"},{value:"Spring",label:"Spring"},{value:"Summer",label:"Summer"},{value:"Fall",label:"Fall"}],Ie=[{value:"ALL",label:"All Countries"},{value:"JP",label:"Japan"},{value:"CN",label:"China"}],De=[{value:"POPULARITY_DESC",label:"Popularity"},{value:"TRENDING_DESC",label:"Trending"},{value:"SCORE_DESC",label:"Score"},{value:"START_DATE_DESC",label:"Newest"},{value:"START_DATE_ASC",label:"Oldest"},{value:"EPISODES_DESC",label:"Most Episodes"},{value:"FAVOURITES_DESC",label:"Favourites"}],Pe=[{value:"RELEASING",label:"Currently Airing"},{value:"FINISHED",label:"Finished"},{value:"NOT_YET_RELEASED",label:"Not Yet Released"},{value:"CANCELLED",label:"Cancelled"},{value:"HIATUS",label:"Hiatus"}];function Ve(){R(()=>{document.title="Search - dango"},[]);const[r,te]=me(),le=ge(),[h,k]=o(r.get("query")||""),[p,_]=o(parseInt(r.get("page")||"1")),[u,A]=o(r.get("type")||"ALL"),[m,b]=o(r.get("season")||"ALL"),[g,y]=o(r.get("year")||"ALL"),[B,E]=o(r.get("country")||"ALL"),[G,ne]=o(r.get("provider")||"anilist"),[Y,I]=o(r.get("sortBy")||"POPULARITY_DESC"),[U,D]=o(r.get("status")||""),[S,re]=o(!1),[se,F]=o(null);R(()=>{let e=!1;return be.data.anilistStatus.query().then(n=>{e||F(n.available)}).catch(()=>{e||F(!0)}),()=>{e=!0}},[]);const{lowEndMode:ie}=ye(),P=ve(null),{data:oe}=Se(),M=oe?.genres||[],[v,N]=o(()=>{const e={},n=r.get("genres")?.split(",").map(l=>l.trim()).filter(Boolean)||[],s=r.get("excludeGenres")?.split(",").map(l=>l.trim()).filter(Boolean)||[];return n.forEach(l=>l&&(e[l]="include")),s.forEach(l=>l&&(e[l]="exclude")),e}),$=new URLSearchParams(r);$.delete("page");const V=$.toString(),{data:f=[],isLoading:C,isError:ce,error:ue}=ae(V,p,14),{data:j}=ae(V,p+1,14),[x,de]=o(!1),T=fe.useMemo(()=>G==="anilist"&&u==="ADULT"||x?f:f.filter(e=>!(e.isAdult||e.rating==="R+"||e.rating==="Rx"||e.rating?.includes("17+"))),[f,x,G,u]);R(()=>{k(r.get("query")||""),A(r.get("type")||"ALL"),b(r.get("season")||"ALL"),y(r.get("year")||"ALL"),E(r.get("country")||"ALL"),ne(r.get("provider")||"anilist"),I(r.get("sortBy")||"POPULARITY_DESC"),D(r.get("status")||""),_(parseInt(r.get("page")||"1"));const e={},n=r.get("genres")?.split(",").map(l=>l.trim()).filter(Boolean)||[],s=r.get("excludeGenres")?.split(",").map(l=>l.trim()).filter(Boolean)||[];n.forEach(l=>l&&(e[l]="include")),s.forEach(l=>l&&(e[l]="exclude")),N(e)},[r]);const c=(e=1,n={})=>{Ne();const s=n.type??u,l=n.status??U,q=n.season??m,H=n.year??g,J=n.country??B,K=n.sort??Y,Q=n.genreState??v,pe=n.showMature??x,i=new URLSearchParams;h.trim()&&i.set("query",h.trim()),s!=="ALL"&&i.set("type",s),l&&i.set("status",l),q!=="ALL"&&i.set("season",q),H!=="ALL"&&i.set("year",H),J!=="ALL"&&i.set("country",J),K!=="POPULARITY_DESC"&&i.set("sortBy",K);const X=Object.entries(Q).filter(([,d])=>d==="include").map(([d])=>d),Z=Object.entries(Q).filter(([,d])=>d==="exclude").map(([d])=>d);X.length>0&&i.set("genres",X.join(",")),Z.length>0&&i.set("excludeGenres",Z.join(",")),s!=="ADULT"&&!pe&&i.set("adult","false"),i.set("provider","anilist"),e>1&&i.set("page",e.toString()),te(i),e!==p&&_(e)},W=e=>{if(c(e),P.current){const n=P.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:n,behavior:"smooth"})}},O=new Date().getFullYear(),he=[{value:"ALL",label:"All Years"},...Array.from({length:O-1980+1},(e,n)=>({value:String(O-n),label:String(O-n)}))],z=f.length>=14&&j&&j.length>0;return a("div",{className:"page-container",children:[a("div",{className:t.header,children:[a("h1",{className:t.pageTitle,children:"Search Anime"}),a("p",{className:t.pageSubtitle,children:"Search through thousands of titles and discover your next favorite"})]}),a("div",{className:t.filterContainer,children:[a("div",{className:t.searchBarWrapper,children:[a("div",{className:t.inputIconWrapper,children:[a(L,{name:"search",className:t.searchIcon}),a("input",{type:"text","data-virtual-keyboard":"true",className:t.searchInput,placeholder:"Search by title, character, or studio...",value:h,onInput:e=>k(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&c()})]}),a("div",{className:t.searchActions,children:[a(w,{onClick:()=>c(),className:t.searchBtn,children:"Search"}),a("button",{className:`${t.filterToggleBtn} ${S?t.active:""}`,onClick:()=>re(!S),children:[a(L,{name:"filter",size:14}),a("span",{children:"Filters"}),S?a(L,{name:"chevron-up",size:12}):a(L,{name:"chevron-down",size:12})]})]})]}),a("div",{className:`${t.advancedFilters} ${S?t.show:""}`,children:[a("div",{className:t.filterDivider}),a("div",{className:t.filterGrid,children:[a("div",{className:t.filterItem,children:[a("label",{children:"Type"}),a("select",{value:u,onChange:e=>{if(e.currentTarget.value==="ADULT"){le("/mature?provider=mal");return}A(e.currentTarget.value)},children:Te.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Status"}),a("select",{value:U,onChange:e=>D(e.currentTarget.value),children:[a("option",{value:"",children:"All Status"}),Pe.map(e=>a("option",{value:e.value,children:e.label},e.value))]})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Season"}),a("select",{value:m,onChange:e=>b(e.currentTarget.value),children:Ee.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Year"}),a("select",{value:g,onChange:e=>y(e.currentTarget.value),children:he.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:["Country",se===!1&&a("span",{style:{display:"block",fontSize:"0.75rem",color:"var(--text-muted)",fontWeight:400},children:"AniList only — ignored by fallback providers"})]}),a("select",{value:B,onChange:e=>E(e.currentTarget.value),children:Ie.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Sort By"}),a("select",{value:Y,onChange:e=>I(e.currentTarget.value),children:De.map(e=>a("option",{value:e.value,children:e.label},e.value))})]})]}),M.length>0&&a("div",{className:t.genreSection,children:[a("label",{className:t.genreLabel,children:"Genres"}),a("div",{className:t.genreContainer,children:M.map(e=>a("button",{className:`${t.genreButton} ${t[v[e]||""]}`,onClick:()=>{N(n=>{const s=n[e],l={...n};return s==="include"?l[e]="exclude":s==="exclude"?delete l[e]:l[e]="include",l})},children:e},e))})]}),a("div",{className:t.filterActions,children:[a(w,{variant:"secondary",onClick:()=>{N({}),A("ALL"),b("ALL"),y("ALL"),E("ALL"),I("POPULARITY_DESC"),D(""),de(!1),c(1,{type:"ALL",status:"",season:"ALL",year:"ALL",country:"ALL",sort:"POPULARITY_DESC",genreState:{},showMature:!1})},children:"Reset All"}),a(w,{onClick:()=>c(),className:t.applyBtn,children:"Apply Filters"})]})]})]}),ce&&a(Ce,{message:ue?.message||"Error"}),(u!=="ALL"||m!=="ALL"||g!=="ALL"||Object.keys(v).length>0)&&a("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center",marginBottom:"1.5rem"},children:[a("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),u!=="ALL"&&a("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Type: ",u,a("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),A("ALL"),c(1,{type:"ALL"})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),m!=="ALL"&&a("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Season: ",m,a("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),b("ALL"),c(1,{season:"ALL"})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),g!=="ALL"&&a("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Year: ",g,a("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),y("ALL"),c(1,{year:"ALL"})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),Object.entries(v).map(([e,n])=>a("span",{className:`badge ${n==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[n==="include"?`+ ${e}`:`- ${e}`,a("button",{onClick:s=>{s.stopPropagation(),s.preventDefault();const l={...v};delete l[e],N(l),c(1,{genreState:l})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e))]}),a("div",{className:t.resultsHeader,ref:P,children:[a("h2",{className:t.resultsTitle,children:h?`Search Results for "${h}"`:"Discover Anime"}),T.length>0&&a(ee,{page:p,canGoNext:z,onChange:W,isLoading:C})]}),a("div",{className:`${t.resultsGrid} ${ie?t.lowEnd:""}`,children:C?a(Le,{}):T.map(e=>a(Ae,{anime:e},e._id))}),!C&&T.length===0&&a("div",{className:t.noResults,children:[a(L,{name:"search",size:48,className:t.noResultsIcon}),a("h3",{children:"No results found"}),a("p",{children:"Try adjusting your search or filters to find what you're looking for."})]}),T.length>0&&a("div",{className:t.bottomPagination,children:a(ee,{page:p,canGoNext:z,onChange:W,isLoading:C,variant:"labeled"})})]})}export{Ve as default};
|
|
1
|
+
import{h as R,p as me,a as ge,d as o,A as ve,g as fe,u as a}from"./vendor-core-DfaOB3Rn.js";import{I as L}from"./vendor-icons-DrybRNxP.js";import{P as ee,S as Le}from"./SkeletonGrid-DyG9u20F.js";import{A as Ae}from"./AnimeCard-Vxac3CKU.js";import{t as be,u as ye,v as Se,L as ae,B as w,N as Ne}from"./index-_iy8RyKU.js";import{E as Ce}from"./ErrorMessage-DAxegITP.js";import{s as t}from"./Search.module-CMEai-B-.js";import"./useAnimeInfoData-CgmVQOsk.js";import"./vendor-query-BBT5_sHx.js";import"./QueueOptionsButton-CGQAqTtM.js";import"./vendor-ui-3qrARCPr.js";import"./MediaCard-DM2d5vjg.js";import"./useIsMobile-Dvx1uJ82.js";const Te=[{value:"ALL",label:"All Types"},{value:"TV",label:"TV Series"},{value:"Movie",label:"Movie"},{value:"OVA",label:"OVA"},{value:"ONA",label:"ONA"},{value:"TV_SHORT",label:"TV Short"},{value:"SPECIAL",label:"Special"},{value:"ADULT",label:"Mature"}],Ee=[{value:"ALL",label:"All Seasons"},{value:"Winter",label:"Winter"},{value:"Spring",label:"Spring"},{value:"Summer",label:"Summer"},{value:"Fall",label:"Fall"}],Ie=[{value:"ALL",label:"All Countries"},{value:"JP",label:"Japan"},{value:"CN",label:"China"}],De=[{value:"POPULARITY_DESC",label:"Popularity"},{value:"TRENDING_DESC",label:"Trending"},{value:"SCORE_DESC",label:"Score"},{value:"START_DATE_DESC",label:"Newest"},{value:"START_DATE_ASC",label:"Oldest"},{value:"EPISODES_DESC",label:"Most Episodes"},{value:"FAVOURITES_DESC",label:"Favourites"}],Pe=[{value:"RELEASING",label:"Currently Airing"},{value:"FINISHED",label:"Finished"},{value:"NOT_YET_RELEASED",label:"Not Yet Released"},{value:"CANCELLED",label:"Cancelled"},{value:"HIATUS",label:"Hiatus"}];function Ve(){R(()=>{document.title="Search - dango"},[]);const[r,te]=me(),le=ge(),[h,k]=o(r.get("query")||""),[p,_]=o(parseInt(r.get("page")||"1")),[u,A]=o(r.get("type")||"ALL"),[m,b]=o(r.get("season")||"ALL"),[g,y]=o(r.get("year")||"ALL"),[B,E]=o(r.get("country")||"ALL"),[G,ne]=o(r.get("provider")||"anilist"),[Y,I]=o(r.get("sortBy")||"POPULARITY_DESC"),[U,D]=o(r.get("status")||""),[S,re]=o(!1),[se,F]=o(null);R(()=>{let e=!1;return be.data.anilistStatus.query().then(n=>{e||F(n.available)}).catch(()=>{e||F(!0)}),()=>{e=!0}},[]);const{lowEndMode:ie}=ye(),P=ve(null),{data:oe}=Se(),M=oe?.genres||[],[v,N]=o(()=>{const e={},n=r.get("genres")?.split(",").map(l=>l.trim()).filter(Boolean)||[],s=r.get("excludeGenres")?.split(",").map(l=>l.trim()).filter(Boolean)||[];return n.forEach(l=>l&&(e[l]="include")),s.forEach(l=>l&&(e[l]="exclude")),e}),$=new URLSearchParams(r);$.delete("page");const V=$.toString(),{data:f=[],isLoading:C,isError:ce,error:ue}=ae(V,p,14),{data:j}=ae(V,p+1,14),[x,de]=o(!1),T=fe.useMemo(()=>G==="anilist"&&u==="ADULT"||x?f:f.filter(e=>!(e.isAdult||e.rating==="R+"||e.rating==="Rx"||e.rating?.includes("17+"))),[f,x,G,u]);R(()=>{k(r.get("query")||""),A(r.get("type")||"ALL"),b(r.get("season")||"ALL"),y(r.get("year")||"ALL"),E(r.get("country")||"ALL"),ne(r.get("provider")||"anilist"),I(r.get("sortBy")||"POPULARITY_DESC"),D(r.get("status")||""),_(parseInt(r.get("page")||"1"));const e={},n=r.get("genres")?.split(",").map(l=>l.trim()).filter(Boolean)||[],s=r.get("excludeGenres")?.split(",").map(l=>l.trim()).filter(Boolean)||[];n.forEach(l=>l&&(e[l]="include")),s.forEach(l=>l&&(e[l]="exclude")),N(e)},[r]);const c=(e=1,n={})=>{Ne();const s=n.type??u,l=n.status??U,q=n.season??m,H=n.year??g,J=n.country??B,K=n.sort??Y,Q=n.genreState??v,pe=n.showMature??x,i=new URLSearchParams;h.trim()&&i.set("query",h.trim()),s!=="ALL"&&i.set("type",s),l&&i.set("status",l),q!=="ALL"&&i.set("season",q),H!=="ALL"&&i.set("year",H),J!=="ALL"&&i.set("country",J),K!=="POPULARITY_DESC"&&i.set("sortBy",K);const X=Object.entries(Q).filter(([,d])=>d==="include").map(([d])=>d),Z=Object.entries(Q).filter(([,d])=>d==="exclude").map(([d])=>d);X.length>0&&i.set("genres",X.join(",")),Z.length>0&&i.set("excludeGenres",Z.join(",")),s!=="ADULT"&&!pe&&i.set("adult","false"),i.set("provider","anilist"),e>1&&i.set("page",e.toString()),te(i),e!==p&&_(e)},W=e=>{if(c(e),P.current){const n=P.current.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:n,behavior:"smooth"})}},O=new Date().getFullYear(),he=[{value:"ALL",label:"All Years"},...Array.from({length:O-1980+1},(e,n)=>({value:String(O-n),label:String(O-n)}))],z=f.length>=14&&j&&j.length>0;return a("div",{className:"page-container",children:[a("div",{className:t.header,children:[a("h1",{className:t.pageTitle,children:"Search Anime"}),a("p",{className:t.pageSubtitle,children:"Search through thousands of titles and discover your next favorite"})]}),a("div",{className:t.filterContainer,children:[a("div",{className:t.searchBarWrapper,children:[a("div",{className:t.inputIconWrapper,children:[a(L,{name:"search",className:t.searchIcon}),a("input",{type:"text","data-virtual-keyboard":"true",className:t.searchInput,placeholder:"Search by title, character, or studio...",value:h,onInput:e=>k(e.currentTarget.value),onKeyDown:e=>e.key==="Enter"&&c()})]}),a("div",{className:t.searchActions,children:[a(w,{onClick:()=>c(),className:t.searchBtn,children:"Search"}),a("button",{className:`${t.filterToggleBtn} ${S?t.active:""}`,onClick:()=>re(!S),children:[a(L,{name:"filter",size:14}),a("span",{children:"Filters"}),S?a(L,{name:"chevron-up",size:12}):a(L,{name:"chevron-down",size:12})]})]})]}),a("div",{className:`${t.advancedFilters} ${S?t.show:""}`,children:[a("div",{className:t.filterDivider}),a("div",{className:t.filterGrid,children:[a("div",{className:t.filterItem,children:[a("label",{children:"Type"}),a("select",{value:u,onChange:e=>{if(e.currentTarget.value==="ADULT"){le("/mature?provider=mal");return}A(e.currentTarget.value)},children:Te.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Status"}),a("select",{value:U,onChange:e=>D(e.currentTarget.value),children:[a("option",{value:"",children:"All Status"}),Pe.map(e=>a("option",{value:e.value,children:e.label},e.value))]})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Season"}),a("select",{value:m,onChange:e=>b(e.currentTarget.value),children:Ee.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Year"}),a("select",{value:g,onChange:e=>y(e.currentTarget.value),children:he.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:["Country",se===!1&&a("span",{style:{display:"block",fontSize:"0.75rem",color:"var(--text-muted)",fontWeight:400},children:"AniList only — ignored by fallback providers"})]}),a("select",{value:B,onChange:e=>E(e.currentTarget.value),children:Ie.map(e=>a("option",{value:e.value,children:e.label},e.value))})]}),a("div",{className:t.filterItem,children:[a("label",{children:"Sort By"}),a("select",{value:Y,onChange:e=>I(e.currentTarget.value),children:De.map(e=>a("option",{value:e.value,children:e.label},e.value))})]})]}),M.length>0&&a("div",{className:t.genreSection,children:[a("label",{className:t.genreLabel,children:"Genres"}),a("div",{className:t.genreContainer,children:M.map(e=>a("button",{className:`${t.genreButton} ${t[v[e]||""]}`,onClick:()=>{N(n=>{const s=n[e],l={...n};return s==="include"?l[e]="exclude":s==="exclude"?delete l[e]:l[e]="include",l})},children:e},e))})]}),a("div",{className:t.filterActions,children:[a(w,{variant:"secondary",onClick:()=>{N({}),A("ALL"),b("ALL"),y("ALL"),E("ALL"),I("POPULARITY_DESC"),D(""),de(!1),c(1,{type:"ALL",status:"",season:"ALL",year:"ALL",country:"ALL",sort:"POPULARITY_DESC",genreState:{},showMature:!1})},children:"Reset All"}),a(w,{onClick:()=>c(),className:t.applyBtn,children:"Apply Filters"})]})]})]}),ce&&a(Ce,{message:ue?.message||"Error"}),(u!=="ALL"||m!=="ALL"||g!=="ALL"||Object.keys(v).length>0)&&a("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center",marginBottom:"1.5rem"},children:[a("span",{style:{fontSize:"0.8rem",color:"var(--text-muted)",fontWeight:600},children:"Active Filters:"}),u!=="ALL"&&a("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Type: ",u,a("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),A("ALL"),c(1,{type:"ALL"})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),m!=="ALL"&&a("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Season: ",m,a("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),b("ALL"),c(1,{season:"ALL"})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),g!=="ALL"&&a("span",{className:"badge badge-secondary",style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:["Year: ",g,a("button",{onClick:e=>{e.stopPropagation(),e.preventDefault(),y("ALL"),c(1,{year:"ALL"})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]}),Object.entries(v).map(([e,n])=>a("span",{className:`badge ${n==="include"?"badge-primary":"badge-danger"}`,style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[n==="include"?`+ ${e}`:`- ${e}`,a("button",{onClick:s=>{s.stopPropagation(),s.preventDefault();const l={...v};delete l[e],N(l),c(1,{genreState:l})},style:{background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"✕"})]},e))]}),a("div",{className:t.resultsHeader,ref:P,children:[a("h2",{className:t.resultsTitle,children:h?`Search Results for "${h}"`:"Discover Anime"}),T.length>0&&a(ee,{page:p,canGoNext:z,onChange:W,isLoading:C})]}),a("div",{className:`${t.resultsGrid} ${ie?t.lowEnd:""}`,children:C?a(Le,{}):T.map(e=>a(Ae,{anime:e},e._id))}),!C&&T.length===0&&a("div",{className:t.noResults,children:[a(L,{name:"search",size:48,className:t.noResultsIcon}),a("h3",{children:"No results found"}),a("p",{children:"Try adjusting your search or filters to find what you're looking for."})]}),T.length>0&&a("div",{className:t.bottomPagination,children:a(ee,{page:p,canGoNext:z,onChange:W,isLoading:C,variant:"labeled"})})]})}export{Ve as default};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{d as s,A as H,h as A,u as e,q as ie,S as ke,T as Ce,p as _e,g as ce,_ as Se}from"./vendor-core-DfaOB3Rn.js";import{d as Ne,t as _,B as T,M as E,j as he,h as Te,z as de,F as te,G as Ie,T as Re,u as xe,e as Le,H as De,y as ae,A as Pe,V as Ae,I as Oe}from"./index-_iy8RyKU.js";import{u as oe}from"./vendor-query-BBT5_sHx.js";import{T as q}from"./ToggleSwitch-CN_ppEc9.js";import{I as Y}from"./vendor-icons-DrybRNxP.js";const ne={"title-preference-container":"_title-preference-container_sdqgs_1","toggle-button":"_toggle-button_sdqgs_21","toggle-label":"_toggle-label_sdqgs_51"},se=["name","nativeName","englishName"],re={name:"Default (Romaji)",nativeName:"Native",englishName:"English"},Ge=()=>{const{titlePreference:t,setTitlePreference:r,loading:i}=Ne(),[l,o]=s(re[t]),[v,b]=s(!1),h=H(null);A(()=>{i||o(re[t])},[t,i]);const n=async()=>{if(v)return;b(!0);const g=(se.indexOf(t)+1)%se.length,p=se[g],d=re[p];h.current&&(h.current.style.transform="translateX(-100%)",h.current.style.opacity="0"),setTimeout(async()=>{o(d),r(p),h.current&&(h.current.style.transition="none",h.current.style.transform="translateX(100%)",h.current.style.opacity="0",h.current.offsetWidth,h.current.style.transition="transform 0.3s ease-out, opacity 0.3s ease-out",h.current.style.transform="translateX(0)",h.current.style.opacity="1");try{await _.settings.set.mutate({key:"titlePreference",value:p})}catch(S){console.error("Error saving title preference:",S)}finally{b(!1)}},300)};return i?e("p",{children:"Loading title preference..."}):e("div",{className:ne["title-preference-container"],children:[e("h4",{children:"Anime Title Display Preference"}),e("button",{onClick:n,className:ne["toggle-button"],disabled:v,children:e("span",{ref:h,className:ne["toggle-label"],children:l})})]})},Me="_settingsHeader_14a5d_1",Ue="_pageTitle_14a5d_6",ze="_pageSubtitle_14a5d_14",Ee="_settingsLayout_14a5d_20",$e="_sidebar_14a5d_27",qe="_sidebarIndicator_14a5d_35",Fe="_sidebarItem_14a5d_50",Ke="_active_14a5d_72",je="_mainContent_14a5d_80",He="_tabContent_14a5d_85",We="_sectionCard_14a5d_103",Be="_settingItem_14a5d_127",Ve="_settingRow_14a5d_132",Qe="_controls_14a5d_145",Ye="_status_14a5d_151",m={settingsHeader:Me,pageTitle:Ue,pageSubtitle:ze,settingsLayout:Ee,sidebar:$e,sidebarIndicator:qe,sidebarItem:Fe,active:Ke,mainContent:je,tabContent:He,sectionCard:We,settingItem:Be,settingRow:Ve,controls:Qe,status:Ye},Je="_sectionCard_wt900_12",Xe="_title_wt900_22",Ze="_signIn_wt900_29",et="_userInfo_wt900_36",tt="_warning_wt900_58",at="_formGroup_wt900_65",nt="_label_wt900_69",st="_inputWrapper_wt900_79",rt="_input_wt900_79",it="_select_wt900_103",ot="_actions_wt900_140",lt="_hr_wt900_148",u={sectionCard:Je,title:Xe,signIn:Ze,userInfo:et,warning:tt,formGroup:at,label:nt,inputWrapper:st,input:rt,select:it,actions:ot,hr:lt},ct=()=>{const[t,r]=s(!0),[i,l]=s(!1),[o,v]=s(!1),[b,h]=s(null),[n,c]=s({status:"idle"}),[g,p]=s(!1),[d,S]=s(""),[y,k]=s(!1),R=H(null),[x,L]=s({show:!1,message:"",type:"info"}),D=()=>{R.current&&(window.clearInterval(R.current),R.current=null)},w=ie(f=>{v(f.authenticated),h(f.user||f.device.user||null),c(f.device),p(!!f.hasCustomClientId)},[]),C=ie(async()=>{const f=await _.auth.githubStatus.query();w(f)},[w]),P=async()=>{try{const f=await _.auth.githubPoll.query();c(f),f.status==="success"?(D(),await C(),L({show:!0,message:"GitHub authentication complete. Sync has been initialized.",type:"success"})):f.status==="error"&&(D(),L({show:!0,message:f.error||"GitHub authentication failed.",type:"error"}))}catch{D(),L({show:!0,message:"Failed to poll GitHub authentication status.",type:"error"})}},M=(f=5)=>{D(),R.current=window.setInterval(P,Math.max(f,5)*1e3)};A(()=>(C().catch(()=>{L({show:!0,message:"Failed to load GitHub sync status.",type:"error"})}).finally(()=>r(!1)),D),[C]);const N=async()=>{l(!0);try{const f=await _.auth.githubStart.mutate();c(f),M(f.verification?.interval)}catch(f){L({show:!0,message:f instanceof Error?f.message:"Failed to start GitHub authentication.",type:"error"})}finally{l(!1)}},O=async()=>{try{await _.auth.githubLogout.mutate(),v(!1),h(null),c({status:"idle"}),L({show:!0,message:"Signed out of GitHub sync.",type:"success"})}catch{L({show:!0,message:"Failed to sign out of GitHub.",type:"error"})}},U=async()=>{k(!0);try{await _.auth.saveGithubAuth.mutate({clientId:d}),S(""),await C(),L({show:!0,message:"Custom GitHub auth saved.",type:"success"})}catch{L({show:!0,message:"Failed to save override.",type:"error"})}finally{k(!1)}},K=async()=>{k(!0);try{await _.auth.saveGithubAuth.mutate({clientId:""}),S(""),await C(),L({show:!0,message:"Custom auth cleared. Using dango defaults.",type:"success"})}catch{L({show:!0,message:"Failed to clear override.",type:"error"})}finally{k(!1)}};return t?e("div",{style:{color:"var(--text-secondary)",padding:"1.5rem"},children:"Loading..."}):e("div",{className:u.sectionCard,children:[e("h3",{className:u.title,children:"GitHub Cloud Sync"}),e("p",{className:u.signIn,children:"Sync local data through a private GitHub repository named dango-sync-data."}),o&&b?e("div",{className:u.userInfo,children:[e("p",{children:["Signed in as: ",e("strong",{children:b.name||b.login})]}),e(T,{variant:"danger",onClick:O,children:"Sign Out"})]}):e("div",{className:u.signIn,children:e(T,{onClick:N,disabled:i||n.status==="pending",children:i||n.status==="pending"?"Waiting for GitHub...":"Sign in with GitHub"})}),n.status==="pending"&&n.verification&&e(ke,{children:[e("hr",{className:u.hr}),e("div",{className:u.formGroup,children:[e("label",{className:u.label,children:"Verification URL"}),e("div",{className:u.inputWrapper,children:[e("input",{className:u.input,value:n.verification.verification_uri,readOnly:!0}),e(T,{onClick:()=>{const f=n.verification?.verification_uri;f&&/^https?:\/\//i.test(f)&&window.open(f,"_blank","noopener,noreferrer")},children:"Open"})]})]}),e("div",{className:u.formGroup,children:[e("label",{className:u.label,children:"Device Code"}),e("input",{className:u.input,value:n.verification.user_code,readOnly:!0})]})]}),n.status==="error"&&e("p",{className:u.warning,children:n.error}),e("details",{style:{marginTop:"1rem",fontSize:"var(--font-size-sm)"},children:[e("summary",{style:{cursor:"pointer",color:"var(--text-secondary)"},children:["Advanced: use your own auth ",g?"(override active)":""]}),e("div",{className:u.formGroup,style:{marginTop:"0.75rem"},children:[e("label",{className:u.label,children:"Client ID (optional)"}),e("input",{className:u.input,value:d,onChange:f=>S(f.currentTarget.value),placeholder:"Your GitHub OAuth app ID"})]}),e("div",{className:u.actions,children:[e(T,{onClick:U,disabled:y,children:"Save override"}),e(T,{variant:"secondary",onClick:K,disabled:y,children:"Use dango defaults"})]})]}),e(E,{isOpen:x.show,onClose:()=>L(f=>({...f,show:!1})),width:"sm",children:[e(E.Body,{children:e("p",{children:x.message})}),e(E.Actions,{children:e(T,{onClick:()=>L(f=>({...f,show:!1})),children:"OK"})})]})]})},dt=()=>{const[t,r]=s(!0),[i,l]=s(null),[o,v]=s(!1),[b,h]=s(!1),[n,c]=s(""),[g,p]=s(""),[d,S]=s(""),[y,k]=s(!1),[R,x]=s({show:!1,message:"",type:"info"}),L=async()=>{try{const N=await _.auth.user.query();l(N?.email?N:null)}catch{l(null)}},D=async()=>{try{const[N,O]=await Promise.all([_.auth.configStatus.query(),_.auth.googleAuth.query()]);v(!!N.hasConfig),h(!!(O.hasCustomWorkerUrl||O.hasCustomClientId||O.hasClientSecret))}catch(N){console.error("Failed to fetch config status",N)}};A(()=>{(async()=>{r(!0),await Promise.all([L(),D()]);try{new URLSearchParams(window.location.search).get("google_auth")==="success"&&(await L(),window.history.replaceState(null,"",window.location.pathname))}catch{}r(!1)})();const O=U=>{U.origin===window.location.origin&&typeof U.data=="object"&&U.data!==null&&U.data.type==="GOOGLE_AUTH_SUCCESS"&&(l(U.data.user),window.location.reload())};return window.addEventListener("message",O),()=>window.removeEventListener("message",O)},[]);const w=async()=>{try{const N=await _.auth.googleLogin.mutate();if(N.authenticated){window.location.reload();return}if(N.url){if(typeof window.DangoBridge<"u"){window.location.href=N.url;return}const U=600,K=700,f=window.innerWidth/2-U/2,J=window.innerHeight/2-K/2;window.open(N.url,"GoogleAuth",`width=${U},height=${K},top=${J},left=${f}`)}else throw new Error("Auth URL not available")}catch{x({show:!0,message:"Authentication failed. Ensure server is configured correctly.",type:"error"})}},C=async()=>{try{await _.auth.logout.mutate(),l(null),x({show:!0,message:"Successfully signed out.",type:"success"}),window.location.reload()}catch(N){console.error("Sign out failed",N),x({show:!0,message:"Failed to sign out.",type:"error"})}},P=async()=>{k(!0);try{await _.auth.saveGoogleAuth.mutate({workerUrl:n,clientId:g,clientSecret:d}),c(""),p(""),S(""),await D(),x({show:!0,message:"Custom auth saved. Restart may be required.",type:"success"})}catch{x({show:!0,message:"Failed to save override.",type:"error"})}finally{k(!1)}},M=async()=>{k(!0);try{await _.auth.saveGoogleAuth.mutate({workerUrl:"",clientId:"",clientSecret:""}),c(""),p(""),S(""),await D(),x({show:!0,message:"Custom auth cleared. Using dango defaults.",type:"success"})}catch{x({show:!0,message:"Failed to clear override.",type:"error"})}finally{k(!1)}};return t?e("div",{style:{color:"var(--text-secondary)",padding:"1.5rem"},children:"Loading..."}):e("div",{className:u.sectionCard,children:[e("h3",{className:u.title,children:"Google Drive Sync"}),i?e("div",{className:u.userInfo,children:[e("p",{children:["Signed in as: ",e("strong",{children:i.name})," (",i.email,")"]}),e(T,{variant:"danger",onClick:C,children:"Sign Out"})]}):e("div",{className:u.signIn,children:[e("p",{children:"Sign in with your Google account to enable synchronization features."}),e(T,{onClick:w,disabled:!o,children:"Sign in with Google"}),!o&&e("p",{className:u.warning,children:"Google sync is not configured on the server."})]}),e("details",{style:{marginTop:"1rem",fontSize:"var(--font-size-sm)"},children:[e("summary",{style:{cursor:"pointer",color:"var(--text-secondary)"},children:["Advanced: use your own auth ",b?"(override active)":""]}),e("div",{className:u.formGroup,style:{marginTop:"0.75rem"},children:[e("label",{className:u.label,children:"Worker URL (optional)"}),e("input",{className:u.input,value:n,onChange:N=>c(N.currentTarget.value),placeholder:"https://your-worker.workers.dev"})]}),e("div",{className:u.formGroup,children:[e("label",{className:u.label,children:"Client ID (optional)"}),e("input",{className:u.input,value:g,onChange:N=>p(N.currentTarget.value),placeholder:"Your Google OAuth client ID"})]}),e("div",{className:u.formGroup,children:[e("label",{className:u.label,children:"Client Secret (optional)"}),e("input",{type:"password",className:u.input,value:d,onChange:N=>S(N.currentTarget.value),placeholder:"Your Google OAuth secret"})]}),e("div",{className:u.actions,children:[e(T,{onClick:P,disabled:y,children:"Save override"}),e(T,{variant:"secondary",onClick:M,disabled:y,children:"Use dango defaults"})]})]}),e(E,{isOpen:R.show,onClose:()=>x(N=>({...N,show:!1})),width:"sm",children:[e(E.Body,{children:e("p",{children:R.message})}),e(E.Actions,{children:e(T,{onClick:()=>x(N=>({...N,show:!1})),children:"OK"})})]})]})},ut="_sectionCard_1pqo4_1",ht="_settingItem_1pqo4_26",gt="_settingRow_1pqo4_31",mt="_modalOverlay_1pqo4_38",pt="_modal_1pqo4_38",yt="_modalActions_1pqo4_73",ft="_modalSecondary_1pqo4_79",vt="_modalPrimary_1pqo4_89",z={sectionCard:ut,settingItem:ht,settingRow:gt,modalOverlay:mt,modal:pt,modalActions:yt,modalSecondary:ft,modalPrimary:vt},wt={anime:{heading:"Watchlist Preferences",blurb:"Customize your experience when managing your watchlist and series entries.",skipKey:"skipRemoveConfirmation",ignoreKey:"ignoreAdultContent",listOnlyKey:"cwWatchlistOnly",skipLabel:"Skip confirmation when removing from watchlist",ignoreLabel:"Hide adult content from continue watching",listOnlyLabel:"Only show continue watching for shows in watchlist",listNoun:"watchlist",continueNoun:"continue watching",adultCountUrl:"/api/continue-watching/adult-count",purgeUrl:"/api/continue-watching/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue watching`,invalidateKeys:[["allContinueWatching"]]},manga:{heading:"Reading List Preferences",blurb:"Customize your experience when managing your reading list and manga entries.",skipKey:"mangaSkipRemoveConfirmation",ignoreKey:"mangaIgnoreAdultContent",listOnlyKey:"mangaCwWatchlistOnly",skipLabel:"Skip confirmation when removing from reading list",ignoreLabel:"Hide adult content from continue reading",listOnlyLabel:"Only show continue reading for manga in reading list",listNoun:"reading list",continueNoun:"continue reading",adultCountUrl:"/api/manga/continue-reading/adult-count",purgeUrl:"/api/manga/continue-reading/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue reading`,invalidateKeys:[["manga-continue-reading"]]},tv:{heading:"TV Watchlist Preferences",blurb:"Customize your experience when managing your TV watchlist and series entries.",skipKey:"tvSkipRemoveConfirmation",ignoreKey:"tvIgnoreAdultContent",listOnlyKey:"tvCwWatchlistOnly",skipLabel:"Skip confirmation when removing from TV watchlist",ignoreLabel:"Hide adult content from continue watching",listOnlyLabel:"Only show continue watching for shows in TV watchlist",listNoun:"TV watchlist",continueNoun:"continue watching",adultCountUrl:"/api/tv/continue-watching/adult-count",purgeUrl:"/api/tv/continue-watching/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue watching`,invalidateKeys:[["tv-continue-watching"]]},asmr:{heading:"Listening List Preferences",blurb:"Customize your experience when managing your listening list and work entries.",skipKey:"asmrSkipRemoveConfirmation",ignoreKey:"asmrIgnoreAdultContent",listOnlyKey:"asmrCwWatchlistOnly",skipLabel:"Skip confirmation when removing from listening list",ignoreLabel:"Hide adult content from continue listening",listOnlyLabel:"Only show continue listening for works in listening list",listNoun:"listening list",continueNoun:"continue listening",adultCountUrl:"/api/asmr/continue-listening/adult-count",purgeUrl:"/api/asmr/continue-listening/purge-adult",purgeDoneText:t=>`Removed ${t??0} entries from continue listening`,invalidateKeys:[["asmr-continue-listening"]]}},bt=(t,r)=>{if(t==null)return r;const i=String(t);return i==="true"||i==="1"?!0:i==="false"||i==="0"?!1:r},ue=(t,r,i)=>{const[l,o]=s(r),[v,b]=s(!1),h=oe();return A(()=>{(async()=>{try{const g=await _.settings.getByKey.query({key:t});o(bt(g.value,r))}catch(g){console.error("Failed to fetch setting",g)}})()},[t,r]),{value:l,setValue:o,isUpdating:v,toggle:async()=>{if(v)return;b(!0);const c=!l;o(c);try{await _.settings.set.mutate({key:t,value:c});for(const g of i)h.invalidateQueries({queryKey:g})}catch(g){console.error("Error saving setting:",g),o(!c)}finally{b(!1)}}}},kt=()=>{const{contentType:t}=he(),r=wt[t],[i,l]=s(!1),[o,v]=s(!0),[b,h]=s(!1),n=ue(r.ignoreKey,!0,r.invalidateKeys),c=ue(r.listOnlyKey,!1,r.invalidateKeys),[g,p]=s(null),[d,S]=s(!1),y=oe(),k=Te();A(()=>{v(!0),(async()=>{try{const C=await _.settings.getByKey.query({key:r.skipKey});String(C.value)==="true"||String(C.value)==="1"?l(!0):l(!1)}catch(C){console.error("Failed to fetch setting",C)}finally{v(!1)}})()},[r.skipKey]);const R=async()=>{if(b)return;h(!0);const w=!i;l(w);try{await _.settings.set.mutate({key:r.skipKey,value:w})}catch(C){console.error("Error saving setting:",C),l(!w)}finally{h(!1)}},x=async()=>{if(!n.isUpdating){if(n.value)try{let w;if(t==="anime"?w=(await _.continueWatching.adultCount.query()).count:t==="manga"?w=(await _.mangaProgress.adultCount.query()).count:t==="asmr"?w=(await _.asmrProgress.adultCount.query()).count:w=(await _.tvProgress.adultCount.query()).count,typeof w=="number"&&w>0){p(w);return}}catch(w){console.error("Failed to fetch adult count",w)}n.toggle()}},L=()=>{p(null),n.toggle()},D=async()=>{if(!d){S(!0);try{let w;t==="anime"?w=(await _.continueWatching.purgeAdult.mutate()).removed:t==="manga"?w=(await _.mangaProgress.purgeAdult.mutate()).removed:t==="asmr"?w=(await _.asmrProgress.purgeAdult.mutate()).removed:w=(await _.tvProgress.purgeAdult.mutate()).removed,de.success(r.purgeDoneText(w??0));for(const C of r.invalidateKeys)y.invalidateQueries({queryKey:C});t==="anime"&&y.invalidateQueries(k.continueWatching.pathFilter()),t==="manga"&&y.invalidateQueries(k.mangaProgress.pathFilter()),t==="asmr"&&y.invalidateQueries(k.asmrProgress.pathFilter()),t==="tv"&&y.invalidateQueries(k.tvProgress.pathFilter())}catch(w){console.error("Failed to purge adult entries",w),de.error("Failed to remove adult entries")}finally{S(!1),p(null)}n.toggle()}};return o?e("div",{children:"Loading settings..."}):e("div",{className:z.sectionCard,children:[e("h3",{children:r.heading}),e("p",{children:r.blurb}),e("div",{className:z.settingItem,children:e("div",{className:z.settingRow,children:[e("label",{htmlFor:"skip-confirmation-toggle",children:r.skipLabel}),e(q,{isChecked:i,onChange:R,id:"skip-confirmation-toggle",disabled:b})]})}),e("div",{className:z.settingItem,children:e("div",{className:z.settingRow,children:[e("label",{htmlFor:"ignore-adult-toggle",children:r.ignoreLabel}),e(q,{isChecked:n.value,onChange:x,id:"ignore-adult-toggle",disabled:n.isUpdating})]})}),e("div",{className:z.settingItem,children:e("div",{className:z.settingRow,children:[e("label",{htmlFor:"cw-watchlist-only-toggle",children:r.listOnlyLabel}),e(q,{isChecked:c.value,onChange:c.toggle,id:"cw-watchlist-only-toggle",disabled:c.isUpdating})]})}),g!==null&&e("div",{className:z.modalOverlay,onClick:()=>p(null),children:e("div",{className:z.modal,onClick:w=>w.stopPropagation(),children:[e("h4",{children:"Show adult entries?"}),e("p",{children:[g," adult ",g===1?"entry":"entries"," not in your"," ",r.listNoun," ",g===1?"is":"are"," currently hidden from"," ",r.continueNoun,". You can purge ",g===1?"it":"them"," from the database instead of showing ",g===1?"it":"them","."]}),e("div",{className:z.modalActions,children:[e("button",{type:"button",className:z.modalSecondary,onClick:L,disabled:d,children:"Show them"}),e("button",{type:"button",className:z.modalPrimary,onClick:D,disabled:d,children:d?"Purging...":`Purge ${g}`})]})]})})]})},Ct="_sectionCard_jkggs_1",_t="_statsGrid_jkggs_26",St="_statCard_jkggs_33",Nt="_statLabel_jkggs_43",Tt="_statValue_jkggs_51",It="_statMeta_jkggs_57",Rt="_statusBanner_jkggs_63",xt="_statusSuccess_jkggs_74",Lt="_statusUpdating_jkggs_80",Dt="_statusError_jkggs_86",Pt="_sha_jkggs_92",At="_settingItem_jkggs_99",Ot="_settingRow_jkggs_104",Gt="_settingTitle_jkggs_111",Mt="_settingSubtitle_jkggs_117",Ut="_actionsRow_jkggs_124",I={sectionCard:Ct,statsGrid:_t,statCard:St,statLabel:Nt,statValue:Tt,statMeta:It,statusBanner:Rt,statusSuccess:xt,statusUpdating:Lt,statusError:Dt,sha:Pt,settingItem:At,settingRow:Ot,settingTitle:Gt,settingSubtitle:Mt,actionsRow:Ut},zt=()=>{const[t,r]=s(null),[i,l]=s(!0),[o,v]=s(!1),[b,h]=s(!1),n=H(null),c=async()=>{try{const y=await _.settings.offlineDbInfo.query();return r(y),y}catch(y){console.error("Failed to fetch offline DB info:",y)}finally{l(!1)}return null};A(()=>(c(),()=>{n.current&&window.clearInterval(n.current)}),[]),A(()=>{t?.isRefreshing?n.current||(n.current=window.setInterval(async()=>{const y=await c();y&&!y.isRefreshing&&n.current&&(window.clearInterval(n.current),n.current=null)},2e3)):n.current&&(window.clearInterval(n.current),n.current=null)},[t?.isRefreshing]);const g=async()=>{if(!t||o)return;const y=!t.autoUpdateEnabled;v(!0),r({...t,autoUpdateEnabled:y});try{await _.settings.setOfflineDbAutoUpdate.mutate({enabled:y})}catch(k){console.error("Failed to update auto update setting:",k),r({...t,autoUpdateEnabled:!y})}finally{v(!1)}},p=async()=>{if(!(t?.isRefreshing||b)){h(!0);try{await _.settings.triggerOfflineDbUpdate.mutate(),r(y=>y?{...y,isRefreshing:!0,lastStatus:"updating",lastMessage:"Downloading database..."}:null)}catch(y){console.error("Failed to trigger offline DB update:",y)}finally{h(!1)}}},d=y=>{if(!y)return"Never";try{return new Date(y).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}catch{return y}},S=t?.isRefreshing||b;return e("div",{className:I.sectionCard,children:[e("h3",{children:"Offline Metadata Database"}),e("p",{children:"Local MAL to AniList ID map used for instant imports and metadata enrichment without hitting rate-limited APIs. Updates automatically every Saturday in the background."}),e("div",{className:I.statsGrid,children:[e("div",{className:I.statCard,children:[e("span",{className:I.statLabel,children:"MAL Mapped"}),e("span",{className:I.statValue,children:i?"—":(t?.totalMalMapped??0).toLocaleString()})]}),e("div",{className:I.statCard,children:[e("span",{className:I.statLabel,children:"Release"}),e("span",{className:I.statMeta,children:i?"—":t?.releaseTag??"Never"})]}),e("div",{className:I.statCard,children:[e("span",{className:I.statLabel,children:"Last Checked"}),e("span",{className:I.statMeta,children:i?"—":d(t?.lastCheckedAt??null)})]}),e("div",{className:I.statCard,children:[e("span",{className:I.statLabel,children:"Last Updated"}),e("span",{className:I.statMeta,children:i?"—":d(t?.lastUpdatedAt??null)})]})]}),t?.lastMessage&&e("div",{className:`${I.statusBanner} ${t.lastStatus==="failed"?I.statusError:t.lastStatus==="updating"?I.statusUpdating:I.statusSuccess}`,children:[e("span",{children:t.lastMessage}),t.contentSha256&&e("span",{className:I.sha,children:["sha:",t.contentSha256.slice(0,12)]})]}),e("div",{className:I.settingItem,children:e("div",{className:I.settingRow,children:[e("div",{children:[e("span",{className:I.settingTitle,children:"Weekly Automatic Updates (Saturdays)"}),e("div",{className:I.settingSubtitle,children:"Download and index new database releases in the background. Catches up on startup if the server was offline."})]}),e(q,{id:"offline-db-auto-update-toggle",isChecked:t?t.autoUpdateEnabled:!0,onChange:g,disabled:i||o})]})}),e("div",{className:I.actionsRow,children:e(T,{onClick:p,disabled:i||S,children:S?"Updating Database...":"Update Offline Database Now"})})]})},Et="_sectionCard_1g4qx_1",$t="_dangerCard_1g4qx_26",qt="_status_1g4qx_34",Ft="_warningText_1g4qx_40",Kt="_ackLabel_1g4qx_44",Q={sectionCard:Et,dangerCard:$t,status:qt,warningText:Ft,ackLabel:Kt},jt=()=>{const t=oe(),[r,i]=s(!1),[l,o]=s(!1),[v,b]=s(!1),[h,n]=s(""),c=()=>{o(!1),n(""),i(!0)},g=()=>{v||(i(!1),o(!1))},p=async()=>{if(!(!l||v)){b(!0),n("");try{const d=await fetch("/api/database/clear",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({confirm:!0})}),S=await d.json();if(!d.ok)throw new Error(S.error||"Failed to clear database");const y=S.deleted,k=S.deletedManga,R=S.deletedTv,x=S.deletedAsmr,L=Object.values(y).reduce((P,M)=>P+(M||0),0)+Object.values(k??{}).reduce((P,M)=>P+(M||0),0)+Object.values(R??{}).reduce((P,M)=>P+(M||0),0)+Object.values(x??{}).reduce((P,M)=>P+(M||0),0),D=(k?.manga_library??0)+(k?.manga_progress??0),w=(R?.tv_library??0)+(R?.tv_progress??0),C=(x?.asmr_library??0)+(x?.asmr_progress??0);n(`Library cleared — ${y.watchlist??0} watchlist entries, ${D} manga rows, ${w} TV rows, ${C} ASMR rows and ${L} total rows removed.`),t.invalidateQueries({queryKey:["watchlist"]}),t.invalidateQueries({queryKey:["allContinueWatching"]}),t.invalidateQueries({queryKey:["manga-library"]}),t.invalidateQueries({queryKey:["manga-continue-reading"]}),t.invalidateQueries({queryKey:["tv-library"]}),t.invalidateQueries({queryKey:["tv-continue-watching"]}),t.invalidateQueries({queryKey:["asmr-library"]}),t.invalidateQueries({queryKey:["asmr-continue-listening"]}),i(!1)}catch(d){n(d.message)}finally{b(!1),o(!1)}}};return e("div",{className:`${Q.sectionCard} ${Q.dangerCard}`,children:[e("h3",{children:"Danger Zone"}),e("p",{children:"Permanently delete your library (watchlist, watched episodes, queue, cached show metadata, manga reading list and reading progress, TV watchlist and watch progress, ASMR listening list and listening progress) to start fresh. Your settings, sync state and the offline metadata cache are preserved."}),e(T,{variant:"danger",onClick:c,children:"Clear Library Data"}),h&&e("p",{className:Q.status,children:h}),e(E,{isOpen:r,onClose:g,title:"Clear library data?",width:"sm",children:[e(E.Body,{children:[e("p",{className:Q.warningText,children:"This permanently deletes everything in your library. It acts on the active database (dev or prod, per server config) and cannot be undone. Settings, sync state and the offline metadata cache are kept."}),e("label",{className:Q.ackLabel,children:[e("input",{type:"checkbox",checked:l,onChange:d=>o(d.target.checked),disabled:v}),e("span",{children:"I understand this permanently deletes my library"})]})]}),e(E.Actions,{children:[e(T,{variant:"secondary",onClick:g,disabled:v,children:"Cancel"}),e(T,{variant:"danger",onClick:p,disabled:!l||v,children:v?"Clearing...":"Yes, delete everything"})]})]})]})},Ht=()=>{const[t,r]=s(""),[i,l]=s([]),[o,v]=s(null),[b,h]=s(!0),[n,c]=s({show:!1,message:"",type:"info"}),g=async()=>{try{h(!0);const S=await(await fetch("/api/auth/settings/rclone")).json();r(S.remote||""),l(S.availableRemotes||[]),v(S.activeRemote||null)}catch(d){console.error("Failed to fetch Rclone settings",d)}finally{h(!1)}};A(()=>{g()},[]);const p=async()=>{try{if((await fetch("/api/auth/settings/rclone",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({remote:t})})).ok)c({show:!0,message:"Rclone configuration saved successfully. You must restart the server for these changes to take effect.",type:"success"}),g();else throw new Error("Failed to save")}catch{c({show:!0,message:"Failed to save Rclone configuration.",type:"error"})}};return b?e("div",{style:{color:"var(--text-secondary)",padding:"1.5rem"},children:"Loading..."}):e("div",{className:u.sectionCard,children:[e("h3",{className:u.title,children:"Rclone Cloud Sync"}),e("p",{className:u.signIn,children:"Configure which Rclone remote to use for database synchronization."}),o?e("div",{className:u.userInfo,children:e("p",{children:["Current Active Remote: ",e("strong",{children:o})]})}):e("p",{className:u.warning,style:{marginBottom:"1.5rem"},children:"Rclone sync is not currently active. Ensure rclone is installed and a remote is configured."}),e("div",{className:u.formGroup,children:[e("label",{className:u.label,children:"Remote Name"}),e("div",{className:u.inputWrapper,children:e("select",{className:u.select,value:t,onChange:d=>r(d.target.value),children:[e("option",{value:"",children:"(Disabled / None)"}),i.map(d=>e("option",{value:d,children:d},d)),t&&!i.includes(t)&&e("option",{value:t,children:[t," (Manual)"]})]})}),e("p",{className:u.warning,style:{marginTop:"12px"},children:[e("strong",{children:"Note:"})," You can choose which provider is active using the selector at the top of the page."]})]}),e("div",{className:u.actions,children:e(T,{onClick:p,children:"Save Rclone Settings"})}),e(E,{isOpen:n.show,onClose:()=>c(d=>({...d,show:!1})),width:"sm",children:[e(E.Body,{children:e("p",{children:n.message})}),e(E.Actions,{children:e(T,{onClick:()=>c(d=>({...d,show:!1})),children:"OK"})})]})]})},Wt=()=>{const[t,r]=s(null),[i,l]=s(!0),o=async()=>{try{const c=await(await fetch("/api/auth/settings/sync")).json();r(c)}catch(n){console.error("Failed to fetch sync settings",n)}finally{l(!1)}};A(()=>{o()},[]);const v=async n=>{const c=n.target.value;try{const g=await fetch("/api/auth/settings/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:c})});if(g.ok){const p=await g.json();r(d=>d?{...d,activeProvider:p.activeProvider}:null),await o(),te.success(`Sync provider updated to ${c==="default"?"Default Order":c}`)}else te.error("Failed to update sync provider")}catch{te.error("Error updating sync provider")}};if(i||!t)return null;const b=[{value:"default",label:"Default (Priority Based)"}];t.authenticatedProviders.github&&b.push({value:"github",label:"GitHub"}),t.authenticatedProviders.google&&b.push({value:"google",label:"Google Drive"}),t.authenticatedProviders.rclone&&b.push({value:"rclone",label:"Rclone"}),b.push({value:"none",label:"None (Local Only)"});const h=n=>n==="none"?"Local Only (No Sync)":n==="google"?"Google Drive":n==="github"?"GitHub":n==="rclone"?"Rclone":n;return e("div",{className:m.sectionCard,children:[e("h3",{children:"Active Sync Provider"}),e("p",{children:'Choose which provider to use for synchronization. "Default" uses the first available provider you are logged into.'}),e("div",{style:{marginBottom:"1.5rem",padding:"0.75rem",background:"rgba(255, 255, 255, 0.03)",borderRadius:"var(--radius-md)",borderLeft:"4px solid var(--accent)",fontSize:"var(--font-size-sm)"},children:["Current Status:"," ",e("strong",{style:{color:"var(--accent-light)",textTransform:"capitalize"},children:h(t.actualActiveProvider)})]}),e("div",{className:m.settingRow,children:[e("label",{htmlFor:"sync-provider-select",children:"Selected Preference"}),e("select",{id:"sync-provider-select",value:t.activeProvider,onChange:v,style:{padding:"0.5rem",borderRadius:"var(--radius-md)",background:"rgba(255, 255, 255, 0.05)",color:"var(--text-primary)",border:"1px solid var(--glass-border)",fontSize:"var(--font-size-sm)",minWidth:"220px",outline:"none",cursor:"pointer"},children:b.map(n=>e("option",{value:n.value,children:n.label},n.value))})]})]})};function Bt(){return"javascript:"+encodeURIComponent(`(function(){
|
|
2
|
+
if(!/(^|\\.)discord\\.com$/.test(location.hostname)){alert('Dango: use this bookmarklet while on discord.com');return}
|
|
3
|
+
var t=null;
|
|
4
|
+
try{
|
|
5
|
+
window.webpackChunkdiscord_app.push([[Symbol()],{},function(req){
|
|
6
|
+
if(!req.c)return;
|
|
7
|
+
var ms=Object.values(req.c);
|
|
8
|
+
for(var i=0;i<ms.length;i++){var m=ms[i];
|
|
9
|
+
try{
|
|
10
|
+
if(!m.exports||m.exports===window)continue;
|
|
11
|
+
if(typeof m.exports.getToken==='function'){var x=m.exports.getToken();if(x){t=x;return}}
|
|
12
|
+
for(var k in m.exports){try{var ex=m.exports[k];if(ex&&typeof ex.getToken==='function'&&ex[Symbol.toStringTag]!=='IntlMessagesProxy'){var y=ex.getToken();if(y){t=y;return}}}catch(e1){}}
|
|
13
|
+
}catch(e2){}}
|
|
14
|
+
}]);
|
|
15
|
+
window.webpackChunkdiscord_app.pop();
|
|
16
|
+
}catch(e3){}
|
|
17
|
+
if(!t){alert('Dango: could not grab your token. Make sure you are logged in to Discord in this tab, then run the bookmarklet again.');return}
|
|
18
|
+
function copyFallback(){var a=document.createElement('textarea');a.value=t;a.style.position='fixed';a.style.opacity='0';document.body.appendChild(a);a.select();try{document.execCommand('copy')}catch(e4){}document.body.removeChild(a)}
|
|
19
|
+
var done=function(){window.close();setTimeout(function(){if(!window.closed){alert('Dango: token copied to clipboard! Could not close this tab, so just close it, go back to Dango Settings, paste the token and press Save.')}},250)};
|
|
20
|
+
if(navigator.clipboard&&navigator.clipboard.writeText){navigator.clipboard.writeText(t).then(done,function(){copyFallback();done()})}else{copyFallback();done()}
|
|
21
|
+
})()`)}const Vt=()=>{const t=Ce(Bt,[]);return e("div",{style:{marginTop:"0.9rem",paddingTop:"0.9rem",borderTop:"1px dashed var(--border-color)"},children:[e("h4",{style:{margin:"0 0 0.35rem",fontSize:"0.95rem"},children:"Grab the token automatically (bookmarklet)"}),e("p",{style:{margin:"0 0 0.6rem",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Set this up once and you never have to dig through DevTools: the bookmarklet copies your Discord token to the clipboard and closes the Discord tab — then you just paste it above and press Save."}),e("ol",{style:{margin:"0 0 0.75rem",paddingLeft:"1.25rem",fontSize:"0.85rem",color:"var(--text-secondary)",display:"grid",gap:"0.3rem"},children:[e("li",{children:["Drag the ",e("strong",{style:{color:"var(--text-primary)"},children:"Dango Token Grabber"})," ","button below onto your bookmarks bar (press ",e("kbd",{children:"Ctrl"}),"+",e("kbd",{children:"Shift"}),"+",e("kbd",{children:"B"})," ","first if the bar is hidden)."]}),e("li",{children:["Click ",e("strong",{style:{color:"var(--text-primary)"},children:"Open Discord"})," and log in (skip this if you are already logged in)."]}),e("li",{children:["On the Discord tab, click the"," ",e("strong",{style:{color:"var(--text-primary)"},children:"Dango Token Grabber"})," bookmark. The token lands in your clipboard and the tab closes on its own — come back here, paste it above and press ",e("strong",{children:"Save"}),"."]})]}),e("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[e("a",{href:t,onClick:l=>{l.preventDefault(),alert("Drag this button onto your bookmarks bar instead of clicking it, then click it while you are on discord.com.")},title:"Drag me to your bookmarks bar",draggable:!0,style:{display:"inline-flex",alignItems:"center",padding:"0.4rem 0.8rem",borderRadius:"999px",border:"1px dashed var(--accent)",background:"var(--bg-secondary)",color:"var(--text-primary)",fontSize:"0.85rem",textDecoration:"none",cursor:"grab",userSelect:"none"},children:[e(Y,{name:"bookmark",style:{marginRight:"0.45rem",color:"var(--accent)"}}),"Dango Token Grabber"]}),e("a",{className:"btn btn-secondary btn-sm",href:"https://discord.com/channels/@me",target:"_blank",rel:"noopener noreferrer",children:"Open Discord"}),e(T,{variant:"ghost",size:"sm",onClick:async()=>{try{await navigator.clipboard.writeText(t),alert('Bookmarklet code copied. Create a new bookmark on your bookmarks bar, name it "Dango Token" and paste the code as its URL.')}catch{alert(`Could not copy automatically. Right-click the "Dango Token Grabber" button and choose "Copy link address" instead, then paste that into a new bookmark's URL.`)}},children:"Copy code"})]}),e("p",{style:{margin:"0.5rem 0 0",fontSize:"0.75rem",color:"var(--text-tertiary)"},children:`"Copy code" is a fallback for browsers that won't drag bookmarklets: create any bookmark, then paste the copied code as its URL.`})]})},Qt="_sectionCard_1ag4p_1",Yt="_settingItem_1ag4p_25",Jt="_field_1ag4p_30",Xt="_input_1ag4p_43",Zt="_actions_1ag4p_63",ea="_status_1ag4p_69",F={sectionCard:Qt,settingItem:Yt,field:Jt,input:Xt,actions:Zt,status:ea},ta=()=>{const[t,r]=s(!1),[i,l]=s(""),[o,v]=s(""),[b,h]=s(!0),[n,c]=s(!1),[g,p]=s("");A(()=>{(async()=>{try{const x=await(await fetch("/api/auth/app-status")).json();r(x.hasPassword)}catch{console.error("Failed to fetch LAN auth status")}finally{h(!1)}})()},[]);const d=async()=>{if(p(""),i!==o){p("Passwords do not match");return}if(i.length<4){p("Password must be at least 4 characters");return}c(!0);try{const k=await fetch("/api/auth/app-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:i})}),R=await k.json();if(!k.ok){p(R.error||"Failed to update password");return}r(R.hasPassword),l(""),v(""),p(R.hasPassword?"Password set successfully":"Password removed")}catch{p("Network error")}finally{c(!1)}},S=async()=>{c(!0);try{const k=await fetch("/api/auth/app-setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:""})}),R=await k.json();if(!k.ok){p(R.error||"Failed to remove password");return}r(!1),l(""),v(""),p("Password removed")}catch{p("Network error")}finally{c(!1)}},y=async()=>{c(!0);try{await fetch("/api/auth/app-logout",{method:"POST"}),p("Logged out"),window.location.reload()}catch{p("Logout failed")}finally{c(!1)}};return b?e("div",{className:F.sectionCard,children:e("p",{children:"Loading..."})}):e("div",{className:F.sectionCard,children:[e("h3",{children:"LAN Lock"}),e("p",{children:"Require a password to access this instance from any device, including this one. Sessions persist across server restarts until logout or password change."}),e("div",{className:F.settingItem,children:[e("div",{className:F.field,children:[e("label",{htmlFor:"lan-password",children:"New Password"}),e("input",{id:"lan-password",type:"password",value:i,onChange:k=>l(k.target.value),placeholder:t?"Leave empty to keep current password":"Enter a password...",className:F.input})]}),e("div",{className:F.field,children:[e("label",{htmlFor:"lan-confirm-password",children:"Confirm Password"}),e("input",{id:"lan-confirm-password",type:"password",value:o,onChange:k=>v(k.target.value),placeholder:"Confirm password...",className:F.input})]}),e("div",{className:F.actions,children:[e(T,{variant:"primary",onClick:d,loading:n,disabled:n,children:t?"Update Password":"Set Password"}),t&&e(T,{variant:"danger",onClick:y,loading:n,disabled:n,children:"Logout"}),t&&e(T,{variant:"secondary",onClick:S,loading:n,disabled:n,children:"Remove Password"})]}),g&&e("p",{className:F.status,children:g})]})]})},aa=()=>{const{theme:t,setTheme:r,loading:i}=Ie();return e("div",{children:[e("h4",{style:{margin:"0 0 0.25rem",fontSize:"1rem"},children:"Palette"}),e("p",{style:{margin:"0 0 0.75rem",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Taro is the default. Pick a palette that suits you."}),e("div",{role:"radiogroup","aria-label":"Palette",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:"0.6rem"},children:Re.map(l=>{const o=t===l.id;return e("button",{role:"radio","aria-checked":o,disabled:i,onClick:()=>r(l.id),style:{display:"flex",gap:"0.6rem",alignItems:"center",textAlign:"left",padding:"0.65rem 0.75rem",borderRadius:"10px",cursor:"pointer",background:o?"var(--accent-subtle)":"var(--bg-tertiary)",border:o?"1px solid var(--accent)":"1px solid var(--border-primary)",color:"var(--text-primary)"},children:[e("span",{"aria-hidden":!0,style:{width:26,height:26,borderRadius:"50%",flex:"none",background:l.swatch,border:"1px solid rgba(0,0,0,0.35)"}}),e("span",{style:{minWidth:0},children:[e("span",{style:{display:"block",fontSize:"0.85rem",fontWeight:700},children:l.label}),e("span",{style:{display:"block",fontSize:"0.75rem",color:"var(--text-secondary)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.blurb})]})]},l.id)})})]})};function na({variant:t="info",children:r,className:i=""}){return e("div",{className:`alert alert-${t} ${i}`,children:r})}const sa={anime:"Watchlist",manga:"Reading List",tv:"TV Watchlist",asmr:"Listening List"},da=()=>{const[t,r]=_e(),{contentType:i}=he(),l=t.get("tab"),[o,v]=s(l&&["general","sync","watchlist","database"].includes(l)?l:"general"),[b,h]=s(""),n=H(null),c=H(null),g=H(new Map),[p,d]=s({top:0,height:0,left:0,width:0}),{lowEndMode:S,setLowEndMode:y}=xe(),{hasConsent:k,revoke:R}=Le(),[x,L]=s(De),[D,w]=s(!0),{data:C}=ae("discordRPCEnabled"),P=Pe(),[M,N]=s(!0),{data:O}=ae("dangoGaze"),[U,K]=s(!0),{data:f}=ae("discordRPCHideMature"),[J,X]=s(""),[W,ee]=s(null);A(()=>{_.discord.gatewayStatus.query().then(a=>{ee(a),a.masked&&a.masked!=="none"&&X(a.masked)}).catch(()=>{})},[]),A(()=>{C!==void 0&&w(C==="true"||C===!0||C===null)},[C]),A(()=>{f!==void 0&&K(f==="true"||f===!0||f===null)},[f]);const ge=a=>{w(a),P.mutate({key:"discordRPCEnabled",value:String(a)})};A(()=>{O!==void 0&&N(O!=="false"&&O!==!1)},[O]);const me=a=>{N(a),P.mutate({key:"dangoGaze",value:String(a)})},pe=a=>{K(a),P.mutate({key:"discordRPCHideMature",value:String(a)})},ye=a=>{L(a),localStorage.setItem(Ae,String(a)),window.dispatchEvent(new CustomEvent(Oe))};ce.useEffect(()=>{document.title="Settings - dango"},[]),ce.useEffect(()=>{const a=t.get("tab");a&&["general","sync","watchlist","database"].includes(a)&&v(a)},[t]);const Z=a=>{v(a),r(a==="general"?{}:{tab:a})},B=ie(()=>{const a=g.current.get(o),G=c.current;if(a&&G){const j=G.getBoundingClientRect(),$=a.getBoundingClientRect(),V=window.matchMedia("(max-width: 900px)").matches;d(V?{top:$.top-j.top,height:$.height,left:$.left-j.left,width:$.width}:{top:$.top-j.top,height:$.height,left:0,width:0})}},[o]);Se(()=>{B()},[o,B]),A(()=>{const a=()=>B();window.addEventListener("resize",a);let G=!1;return document.fonts?.ready&&document.fonts.ready.then(()=>{G||B()}),()=>{G=!0,window.removeEventListener("resize",a)}},[o,B]);const fe=()=>{h("Exporting databases...");const a=window.DangoBridge;if(a?.downloadFile){a.downloadFile("/api/backup-db","dango-backup.json"),setTimeout(()=>{h("Databases exported successfully!")},1500);return}const G=document.createElement("a");G.href="/api/backup-db",G.download="dango-backup.json",document.body.appendChild(G),G.click(),G.remove(),setTimeout(()=>{h("Databases exported successfully!")},1500)},ve=async a=>{const G=a.target.files?.[0];if(!G)return;h("Importing databases...");const j=new FormData;j.append("dbfile",G);try{const $=await fetch("/api/restore-db",{method:"POST",body:j}),V=await $.json();if($.ok){const le=Array.isArray(V.restored)?V.restored.join(", "):null;h(le?`Databases imported successfully (${le})!`:"Database imported successfully!"),setTimeout(()=>window.location.reload(),2e3)}else h(`Import failed: ${V.error}`)}catch{h("Import failed: An unexpected error occurred.")}finally{a.target.value=""}},we=()=>{n.current?.click()},be=()=>{switch(o){case"general":return e("div",{className:m.tabContent,children:e("div",{className:m.sectionCard,children:[e("h3",{children:"Appearance & Preferences"}),e("p",{children:"Configure how titles are displayed and other general preferences."}),e("div",{className:m.settingItem,children:e(Ge,{})}),e("div",{className:m.settingItem,style:{marginTop:"1.5rem"},children:e(aa,{})}),e("div",{className:m.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:m.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Low End Mode"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Disables animations and heavy visual effects for better performance on older hardware."})]}),e(q,{isChecked:S,onChange:a=>y(a.target.checked),id:"low-end-mode"})]})}),e("div",{className:m.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:m.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Dango Animations"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Lets the dango logo look around, blink and react when you pet it. Always off in Low End Mode."})]}),e(q,{isChecked:M,onChange:a=>me(a.target.checked),id:"dango-gaze"})]})}),e("div",{className:m.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:m.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Virtual Keyboard"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Shows an on-screen keyboard when text search fields are focused."})]}),e(q,{isChecked:x,onChange:a=>ye(a.target.checked),id:"virtual-keyboard-enabled"})]})}),e("div",{className:m.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:m.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Discord Rich Presence"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Show your current anime and watch progress on your Discord profile status."})]}),e(q,{isChecked:D,onChange:a=>ge(a.target.checked),id:"discord-rpc-enabled"})]})}),e("div",{style:{marginTop:"2rem"},children:e(ta,{})}),D&&e("div",{className:m.settingItem,style:{marginTop:"1rem"},children:e("div",{className:m.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Hide Mature Content"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Hide mature content (18+) from Discord Rich Presence."})]}),e(q,{isChecked:U,onChange:a=>pe(a.target.checked),id:"discord-hide-mature"})]})}),e("div",{className:m.settingItem,style:{marginTop:"1.5rem",background:"var(--bg-tertiary)",padding:"1rem",borderRadius:"8px",border:"1px solid var(--border-color)"},children:[e("div",{className:m.settingRow,children:e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Discord Mobile Presence (Gateway)"}),e("p",{style:{margin:"0.25rem 0 0.75rem",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"Paste your Discord authentication token to enable presence on mobile devices. If no token is saved, the default desktop Rich Presence is used. The token is stored locally in your configuration and never shared."})]})}),e(na,{variant:"warning",style:{marginTop:"1.25rem",paddingTop:"1.25rem"},children:[e("strong",{children:"Use at your own risk."})," This feature uses the Discord Gateway API with your user token, which violates Discord's Terms of Service. Discord may detect this usage and take action against your account, including phone number locks, temporary suspensions, or permanent bans. While the risk is generally low, it is not zero. Only use this if you understand and accept the risks."]}),e("div",{style:{marginTop:"0.75rem",display:"flex",gap:"0.5rem",alignItems:"center",flexWrap:"wrap"},children:[e("input",{type:"password",value:J,onChange:a=>X(a.target.value),placeholder:"Paste Discord token here...",style:{flex:"1 1 200px",padding:"0.5rem",borderRadius:"4px",border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontFamily:"monospace",minWidth:0}}),e(T,{variant:"primary",size:"sm",onClick:async()=>{try{const a=await _.discord.gatewaySave.mutate({token:J});ee({hasToken:!0,masked:a.masked,enabled:!0}),X(a.masked)}catch(a){alert(a instanceof Error?a.message:"Failed to save token")}},children:"Save"}),e(T,{variant:"secondary",size:"sm",onClick:async()=>{await _.discord.gatewayRemove.mutate().catch(()=>{}),X(""),ee({hasToken:!1,masked:null,enabled:!1})},children:"Remove"})]}),W&&e("p",{style:{marginTop:"0.5rem",fontSize:"0.8rem",color:W.hasToken?"green":"var(--text-secondary)"},children:["Status:"," ",W.hasToken?`Token saved (${W.masked})`:"No token saved",W.enabled?" - Gateway active":""]}),e(Vt,{})]}),k&&e("div",{className:m.settingItem,style:{marginTop:"1.5rem"},children:e("div",{className:m.settingRow,children:[e("div",{style:{minWidth:0},children:[e("h4",{style:{margin:0,fontSize:"1rem"},children:"Mature Content"}),e("p",{style:{margin:"0.25rem 0 0",fontSize:"0.85rem",color:"var(--text-secondary)"},children:"You have previously agreed to view 18+ content. Toggle this off to re-enable the blur gate and filtering."})]}),e(q,{isChecked:!0,onChange:a=>{a.target.checked||(R(),window.location.reload())},id:"mature-content-enabled"})]})})]})});case"sync":return e("div",{className:m.tabContent,children:[e(Wt,{}),e(ct,{}),e(dt,{}),e(Ht,{})]});case"watchlist":return e("div",{className:m.tabContent,children:e(kt,{})});case"database":return e("div",{className:m.tabContent,children:[e("div",{className:m.sectionCard,children:[e("h3",{children:"Database Management"}),e("p",{children:"Download a backup of all databases (anime, manga, TV and ASMR) or restore from a backup file. Legacy single-file anime (.db) backups can still be restored."}),e("div",{className:m.controls,children:[e(T,{onClick:fe,children:"Backup Database"}),e(T,{variant:"secondary",onClick:we,children:"Restore Database"})]}),e("input",{type:"file",ref:n,onChange:ve,style:{position:"absolute",width:1,height:1,opacity:0,overflow:"hidden"},accept:".json,.db,application/octet-stream"}),b&&e("p",{className:m.status,children:b})]}),e(zt,{}),e(jt,{})]});default:return null}};return e("div",{className:"page-container",children:[e("div",{className:m.settingsHeader,children:[e("h1",{className:m.pageTitle,children:"Settings"}),e("p",{className:m.pageSubtitle,children:"Manage your preferences and data synchronization"})]}),e("div",{className:m.settingsLayout,children:[e("aside",{className:m.sidebar,ref:c,children:[e("div",{className:m.sidebarIndicator,style:{top:p.top,height:p.height,left:p.left,...p.width?{width:p.width}:{}}}),e("button",{ref:a=>{a&&g.current.set("general",a)},className:`${m.sidebarItem} ${o==="general"?m.active:""}`,onClick:()=>Z("general"),children:[e(Y,{name:"cog"})," ",e("span",{children:"General"})]}),e("button",{ref:a=>{a&&g.current.set("sync",a)},className:`${m.sidebarItem} ${o==="sync"?m.active:""}`,onClick:()=>Z("sync"),children:[e(Y,{name:"cloud"})," ",e("span",{children:"Synchronization"})]}),e("button",{ref:a=>{a&&g.current.set("watchlist",a)},className:`${m.sidebarItem} ${o==="watchlist"?m.active:""}`,onClick:()=>Z("watchlist"),children:[e(Y,{name:"list"})," ",e("span",{children:sa[i]})]}),e("button",{ref:a=>{a&&g.current.set("database",a)},className:`${m.sidebarItem} ${o==="database"?m.active:""}`,onClick:()=>Z("database"),children:[e(Y,{name:"database"})," ",e("span",{children:"Database"})]})]}),e("main",{className:m.mainContent,children:e("div",{className:m.tabContent,children:be()},o)})]})]})};export{da as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as _,A as v,h as E,T as R,u as e,g as A}from"./vendor-core-DfaOB3Rn.js";import{I as P}from"./vendor-icons-DrybRNxP.js";import{u as L}from"./index-
|
|
1
|
+
import{d as _,A as v,h as E,T as R,u as e,g as A}from"./vendor-core-DfaOB3Rn.js";import{I as P}from"./vendor-icons-DrybRNxP.js";import{u as L}from"./index-_iy8RyKU.js";const x="_pagination_zelsc_1",M="_pageBtn_zelsc_7",S="_pageInfo_zelsc_38",G="_pagePicker_zelsc_48",F="_dropdown_zelsc_52",K="_flipDown_zelsc_68",T="_jumpRow_zelsc_73",W="_jumpInput_zelsc_79",q="_jumpGo_zelsc_90",J="_optionList_zelsc_105",O="_optionBtn_zelsc_113",H="_current_zelsc_132",s={pagination:x,pageBtn:M,pageInfo:S,pagePicker:G,dropdown:F,flipDown:K,jumpRow:T,jumpInput:W,jumpGo:q,optionList:J,optionBtn:O,current:H},cn=({page:t,totalPages:d,canGoNext:m,onChange:p,isLoading:f=!1,variant:g="compact"})=>{const[l,u]=_(!1),[b,h]=_(""),[k,N]=_(0),[$,z]=_(!1),w=v(null),y=v(null),j=v(null);E(()=>{if(!l)return;const n=o=>{w.current&&!w.current.contains(o.target)&&u(!1)},r=o=>{o.key==="Escape"&&u(!1)};return document.addEventListener("pointerdown",n),document.addEventListener("keydown",r),()=>{document.removeEventListener("pointerdown",n),document.removeEventListener("keydown",r)}},[l]),E(()=>{if(!l)return;N(0),z(!1);const n=requestAnimationFrame(()=>{const r=j.current?.getBoundingClientRect(),o=y.current?.getBoundingClientRect();if(!r)return;let c=0;r.right>window.innerWidth-8?c=window.innerWidth-8-r.right:r.left<8&&(c=8-r.left),N(Math.round(c)),o&&o.top<r.height+24&&z(!0)});return()=>cancelAnimationFrame(n)},[l]);const i=d,C=R(()=>{if(i!==void 0){if(i<=100)return Array.from({length:i},(o,c)=>c+1);const r=new Set([1,i]);for(let o=t-10;o<=t+10;o++)o>=1&&o<=i&&r.add(o);return[...r].sort((o,c)=>o-c)}const n=m?t+1:t;return Array.from({length:n},(r,o)=>o+1)},[i,t,m]),B=n=>{const r=i!==void 0?Math.min(Math.max(1,n),i):Math.max(1,n);u(!1),h(""),r!==t&&p(r)},D=()=>{const n=parseInt(b,10);Number.isNaN(n)||B(n)},I=f||(i!==void 0?t>=i:!m);return e("div",{className:s.pagination,ref:w,children:[e("button",{className:s.pageBtn,onClick:()=>p(t-1),disabled:t<=1||f,"aria-label":"Previous page",children:[e(P,{name:"chevron-left",size:14}),g==="labeled"&&e("span",{children:"Previous"})]}),e("div",{className:s.pagePicker,ref:y,children:[e("button",{className:s.pageBtn,onClick:()=>{h(""),u(n=>!n)},disabled:f,"aria-label":"Jump to page","aria-expanded":l,children:e("span",{className:s.pageInfo,children:["Page ",e("strong",{children:t}),i!==void 0&&` of ${i}`]})}),l&&e("div",{ref:j,className:`${s.dropdown} ${$?s.flipDown:""}`,style:k!==0?{marginLeft:k}:void 0,children:[e("div",{className:s.jumpRow,children:[e("input",{className:s.jumpInput,type:"number",inputMode:"numeric",min:1,max:i,value:b,placeholder:"Page #",onChange:n=>h(n.currentTarget.value),onKeyDown:n=>{n.key==="Enter"&&D()}}),e("button",{className:s.jumpGo,onClick:D,children:"Go"})]}),e("div",{className:s.optionList,children:C.map(n=>e("button",{className:`${s.optionBtn} ${n===t?s.current:""}`,onClick:()=>B(n),disabled:n===t,children:n},n))})]})]}),e("button",{className:s.pageBtn,onClick:()=>p(t+1),disabled:I,"aria-label":"Next page",children:[g==="labeled"&&e("span",{children:"Next"}),e(P,{name:"chevron-right",size:14})]})]})},Q="_skeletonCard_1b0hr_1",U="_poster_1b0hr_11",V="_line_1b0hr_20",X="_info_1b0hr_38",Y="_short_1b0hr_54",Z="_horizontal_1b0hr_60",nn="_vertical_1b0hr_78",en="_lowEnd_1b0hr_97",a={skeletonCard:Q,poster:U,line:V,"skeleton-wave":"_skeleton-wave_1b0hr_1",info:X,short:Y,horizontal:Z,vertical:nn,lowEnd:en},tn=({layout:t="vertical"})=>{const{lowEndMode:d}=L();return e("div",{className:`${a.skeletonCard} ${a[t]} ${d?a.lowEnd:""}`,children:[e("div",{className:a.poster}),e("div",{className:a.info,children:[e("div",{className:a.line}),e("div",{className:`${a.line} ${a.short}`})]})]})},on=({count:t=14,layout:d="vertical"})=>e("div",{className:"grid-container",children:Array.from({length:t}).map((m,p)=>e(tn,{layout:d},p))}),ln=A.memo(on);export{tn as A,cn as P,ln as S};
|