@serifpersia/dango 3.8.3 → 3.8.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/client/dist/assets/{AnimeCard-Dc6uPr1B.js → AnimeCard-CkomfiIw.js} +1 -1
- package/client/dist/assets/{AnimeInfo-BkT4v_EB.js → AnimeInfo-CtBg9n1W.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-CvGOUt7G.js → AnimeInfoPage-DYic1q9k.js} +2 -2
- package/client/dist/assets/{Asmr-CaO_2wxo.js → Asmr-VRahW3BN.js} +2 -2
- package/client/dist/assets/AsmrPopup-Du6eR09X.js +1 -0
- package/client/dist/assets/AsmrResetProgressModal-CBz6OxDc.js +1 -0
- package/client/dist/assets/Home-BQK51s69.js +1 -0
- package/client/dist/assets/Home-grKghNM9.css +1 -0
- package/client/dist/assets/Insights-2Ei1ZfVV.js +1 -0
- package/client/dist/assets/Insights-DEicrokg.css +1 -0
- package/client/dist/assets/{LibraryListPage-0IybQgPU.js → LibraryListPage-BJ7o8MNw.js} +1 -1
- package/client/dist/assets/ListeningList-C_hDyuFM.js +1 -0
- package/client/dist/assets/{Manga-B4p5dXe8.js → Manga-4XqXRRq7.js} +1 -1
- package/client/dist/assets/{MangaInfoPage-DR2_2eve.js → MangaInfoPage-BSj5R5c3.js} +1 -1
- package/client/dist/assets/{MangaReadPage-CC72GY9L.js → MangaReadPage-BpJNfRcn.js} +1 -1
- package/client/dist/assets/{MangaResetProgressModal-ojbIsaI7.js → MangaResetProgressModal-B1DyEkSk.js} +1 -1
- package/client/dist/assets/{Mature-C1PCMe3g.js → Mature-eyCcjCLK.js} +1 -1
- package/client/dist/assets/{MatureConsentModal-BTJloHUV.js → MatureConsentModal-J7mF0tSH.js} +1 -1
- package/client/dist/assets/MediaCard-CJ-18Ma8.css +1 -0
- package/client/dist/assets/MediaCard-Wp1bAPsS.js +1 -0
- package/client/dist/assets/{OptionListMenu-CFBJv5e-.js → OptionListMenu-oRSmXUYN.js} +1 -1
- package/client/dist/assets/Player-1LfYnRyR.css +1 -0
- package/client/dist/assets/Player-D3cSsrYy.js +56 -0
- package/client/dist/assets/{PlayerProvider-DjIXyFBk.js → PlayerProvider-WO2tWEb1.js} +1 -1
- package/client/dist/assets/PlayerSettings-CbGkvNJq.css +1 -0
- package/client/dist/assets/{PlayerSettings-B37kxh6A.js → PlayerSettings-CfTMIrw1.js} +1 -1
- package/client/dist/assets/{QueueOptionsButton-D0LpFAJe.js → QueueOptionsButton-BeAS9Ufo.js} +1 -1
- package/client/dist/assets/QueueRail-BrVL0OWm.js +1 -0
- package/client/dist/assets/QueueRail-CcHdXRmS.css +1 -0
- package/client/dist/assets/{ReadingList-B6pULeSS.js → ReadingList-BWT_0y7B.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-Dq6yudb6.js → ResetProgressModal-D9Hi4yvU.js} +1 -1
- package/client/dist/assets/{Search-B2C2_KM4.js → Search-Ma_U--_p.js} +1 -1
- package/client/dist/assets/Settings-B57LhIVH.css +1 -0
- package/client/dist/assets/Settings-BWXmAzt8.js +21 -0
- package/client/dist/assets/{SkeletonGrid-TIfa7-R8.js → SkeletonGrid-Bi4N7XcX.js} +1 -1
- package/client/dist/assets/Trackers-BC636V59.css +1 -0
- package/client/dist/assets/Trackers-CyZCgKDv.js +2 -0
- package/client/dist/assets/{Tv-BNc7ujCX.js → Tv-3U6AQcKB.js} +1 -1
- package/client/dist/assets/{TvInfo-k9u9Pxa3.js → TvInfo-C6k13aZL.js} +1 -1
- package/client/dist/assets/{TvPopup-e7OkKs6q.js → TvPopup-CSFfDhV6.js} +1 -1
- package/client/dist/assets/{TvSearch-BP-0VIrE.js → TvSearch-BlrNDENc.js} +1 -1
- package/client/dist/assets/{TvWatchlist-Yv8Qc4lj.js → TvWatchlist-l6N6tOjK.js} +1 -1
- package/client/dist/assets/VirtualKeyboard-CG5L_RyF.js +1 -0
- package/client/dist/assets/VirtualKeyboard-CejCi3pJ.css +1 -0
- package/client/dist/assets/{WatchAlong-Dt5_kNJg.js → WatchAlong-KYPcweoT.js} +1 -1
- package/client/dist/assets/{WatchAlongPanel-DTjl8tog.js → WatchAlongPanel-CdJRfBiU.js} +1 -1
- package/client/dist/assets/{Watchlist-BvbY9oBd.js → Watchlist-Bwh35S5A.js} +1 -1
- package/client/dist/assets/index-BKQMKYFa.css +1 -0
- package/client/dist/assets/index-fS4AGBy2.js +178 -0
- package/client/dist/assets/{libraryInvalidation-BirscVrS.js → libraryInvalidation-C4kz8swK.js} +1 -1
- package/client/dist/assets/{playbackCompletion-C8izYMOL.js → playbackCompletion-Dfy-xXLg.js} +1 -1
- package/client/dist/assets/{useAnimeInfoData-C60IXLN5.js → useAnimeInfoData-D7YFegdk.js} +1 -1
- package/client/dist/assets/useAsmrPopup-BBmHrx9v.js +1 -0
- package/client/dist/assets/{useMangaLibrary-ClgxldD8.js → useMangaLibrary-4UsX_okY.js} +1 -1
- package/client/dist/assets/{useMangaPopup-D4ItPSfW.js → useMangaPopup-DrrvSchc.js} +1 -1
- package/client/dist/assets/{useProviders-DVv7j4AK.js → useProviders-SXQCnsGW.js} +1 -1
- package/client/dist/assets/{useTv-BUu6RG6F.js → useTv-EwO7nOqH.js} +1 -1
- package/client/dist/assets/{useTvLibrary-DnKiDhxZ.js → useTvLibrary-D6KqZu5s.js} +1 -1
- package/client/dist/assets/useWatchAlongPlayer-CJebxcje.css +1 -0
- package/client/dist/assets/useWatchAlongPlayer-DC-nsje5.js +10 -0
- package/client/dist/index.html +2 -2
- package/package.json +2 -2
- package/server/dist/server.js +144 -144
- package/server/package.json +1 -1
- package/client/dist/assets/AsmrResetProgressModal-h35ZX9OW.js +0 -1
- package/client/dist/assets/Home-CHKpLQLZ.js +0 -1
- package/client/dist/assets/Home-DINyLUCh.css +0 -1
- package/client/dist/assets/Insights-CA_1302g.js +0 -1
- package/client/dist/assets/Insights-D0qrep0K.css +0 -1
- package/client/dist/assets/ListeningList-Cn1z8o3k.js +0 -1
- package/client/dist/assets/MediaCard-CoyScn-7.css +0 -1
- package/client/dist/assets/MediaCard-wcV5T3yJ.js +0 -1
- package/client/dist/assets/Player-D-sQfjcx.css +0 -1
- package/client/dist/assets/Player-MJJ6fHc4.js +0 -56
- package/client/dist/assets/PlayerSettings-BXGe3F5k.css +0 -1
- package/client/dist/assets/QueueRail-Bkh4VZls.css +0 -1
- package/client/dist/assets/QueueRail-D4qxAKBU.js +0 -1
- package/client/dist/assets/Settings-D37LNfis.css +0 -1
- package/client/dist/assets/Settings-DQHfH5Ba.js +0 -21
- package/client/dist/assets/Trackers-ChrW-D2i.js +0 -2
- package/client/dist/assets/Trackers-CvO6aWVx.css +0 -1
- package/client/dist/assets/VirtualKeyboard-BaUll8Yv.css +0 -1
- package/client/dist/assets/VirtualKeyboard-Cqj3Id2l.js +0 -1
- package/client/dist/assets/index-BR99iwWT.js +0 -178
- package/client/dist/assets/index-CoCvEAx6.css +0 -1
- package/client/dist/assets/useAsmr-yVlXiVJj.js +0 -1
- package/client/dist/assets/useAsmrPopup-Do0bqxew.js +0 -1
- package/client/dist/assets/useWatchAlongPlayer-1fbftVwT.css +0 -1
- package/client/dist/assets/useWatchAlongPlayer-hjLY2hHu.js +0 -10
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-BQK51s69.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/MediaCard-Wp1bAPsS.js","assets/vendor-icons-DrybRNxP.js","assets/vendor-ui-3qrARCPr.js","assets/useIsMobile-Dvx1uJ82.js","assets/MatureConsentModal-J7mF0tSH.js","assets/MatureConsentModal-CqewXc0q.css","assets/MediaCard-CJ-18Ma8.css","assets/AnimeCard-CkomfiIw.js","assets/useAnimeInfoData-D7YFegdk.js","assets/QueueOptionsButton-BeAS9Ufo.js","assets/QueueOptionsButton-CM15uQn8.css","assets/playbackCompletion-Dfy-xXLg.js","assets/SkeletonGrid-Bi4N7XcX.js","assets/SkeletonGrid-BisPI38I.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-D9Hi4yvU.js","assets/QueueRail-BrVL0OWm.js","assets/QueueRail-CcHdXRmS.css","assets/useMangaPopup-DrrvSchc.js","assets/useMangaLibrary-4UsX_okY.js","assets/libraryInvalidation-C4kz8swK.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-B1DyEkSk.js","assets/useProviders-SXQCnsGW.js","assets/useTv-EwO7nOqH.js","assets/TvPopup-CSFfDhV6.js","assets/useTvLibrary-D6KqZu5s.js","assets/AsmrResetProgressModal-CBz6OxDc.js","assets/AsmrPopup-Du6eR09X.js","assets/Home-grKghNM9.css","assets/Watchlist-Bwh35S5A.js","assets/LibraryListPage.module-r6k9nyT9.js","assets/LibraryListPage-DmdjNa2U.css","assets/ActiveFilterChips-olGfwxle.js","assets/ActiveFilterChips-QjkplDN2.css","assets/Watchlist-DW7kUORr.css","assets/Settings-BWXmAzt8.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-B57LhIVH.css","assets/Player-D3cSsrYy.js","assets/PlayerProvider-WO2tWEb1.js","assets/PlayerProvider-ZeplRma-.css","assets/useWatchAlongPlayer-DC-nsje5.js","assets/useWatchAlongPlayer-CJebxcje.css","assets/AnimeMetaDetails-B3-A7O5H.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/WatchAlongPanel-CdJRfBiU.js","assets/WatchAlongPanel-DWb8lSzW.css","assets/Player-1LfYnRyR.css","assets/WatchAlong-KYPcweoT.js","assets/Search-Ma_U--_p.js","assets/Search.module-C_qwCdHS.js","assets/Search-DCKK3seW.css","assets/Mature-eyCcjCLK.js","assets/Mature-DJmUUtlF.css","assets/Asmr-VRahW3BN.js","assets/useAsmrPopup-BBmHrx9v.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Asmr-Do89pEHG.css","assets/Manga-4XqXRRq7.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-BSj5R5c3.js","assets/MangaReadPage-BpJNfRcn.js","assets/ReadingList-BWT_0y7B.js","assets/LibraryListPage-BJ7o8MNw.js","assets/TvSearch-BlrNDENc.js","assets/TvInfo-C6k13aZL.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-3U6AQcKB.js","assets/OptionListMenu-oRSmXUYN.js","assets/Tv-D3vXCsSC.css","assets/TvWatchlist-l6N6tOjK.js","assets/ListeningList-C_hDyuFM.js","assets/Trackers-CyZCgKDv.js","assets/Trackers-BC636V59.css","assets/Insights-2Ei1ZfVV.js","assets/Insights-DEicrokg.css","assets/AnimeInfoPage-DYic1q9k.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-CG5L_RyF.js","assets/VirtualKeyboard-CejCi3pJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{N as kr,k as ee,A as j,q as V,h as _,S as ue,d as v,X as ye,x as ge,T as Oe,$ as Cn,u as o,g as At,L as ce,a as xn,c as at,e as Tr,f as Pr,D as Ir,i as Nr,P as Gt,j as Cr,l as R,m as Jt,z as W,n as xr,B as Or}from"./vendor-core-DfaOB3Rn.js";import{s as Ie,i as Ar,q as Lr,u as ne,a as le,b as te,c as Lt,Q as Dr,d as Rr}from"./vendor-query-BBT5_sHx.js";import{I as x}from"./vendor-icons-DrybRNxP.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const $r="modulepreload",qr=function(e){return"/"+e},Yt={},K=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");s=l(n.map(u=>{if(u=qr(u),u in Yt)return;Yt[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const p=document.createElement("link");if(p.rel=d?"stylesheet":$r,d||(p.as="script"),p.crossOrigin="",p.href=u,c&&p.setAttribute("nonce",c),document.head.appendChild(p),d)return new Promise((h,f)=>{p.addEventListener("load",h),p.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function i(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return s.then(a=>{for(const c of a||[])c.status==="rejected"&&i(c.reason);return t().catch(i)})};let Mr={data:""},jr=e=>{if(typeof window=="object"){let t=(e?e.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return t.nonce=window.__nonce__,t.parentNode||(e||document.head).appendChild(t),t.firstChild}return e||Mr},Br=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Fr=/\/\*[^]*?\*\/| +/g,Zt=/\n+/g,Se=(e,t)=>{let n="",r="",s="";for(let i in e){let a=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+a+";":r+=i[1]=="f"?Se(a,i):i+"{"+Se(a,i[1]=="k"?"":t)+"}":typeof a=="object"?r+=Se(a,t?t.replace(/([^,])+/g,c=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):i):a!=null&&(i=i[1]=="-"?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=Se.p?Se.p(i,a):i+":"+a+";")}return n+(t&&s?t+"{"+s+"}":s)+r},Ee={},On=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+On(e[n]);return t}return e},Wr=(e,t,n,r,s)=>{let i=On(e),a=Ee[i]||(Ee[i]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(i));if(!Ee[a]){let l=i!==e?e:(u=>{let d,m,p=[{}];for(;d=Br.exec(u.replace(Fr,""));)d[4]?p.shift():d[3]?(m=d[3].replace(Zt," ").trim(),p.unshift(p[0][m]=p[0][m]||{})):p[0][d[1]]=d[2].replace(Zt," ").trim();return p[0]})(e);Ee[a]=Se(s?{["@keyframes "+a]:l}:l,n?"":"."+a)}let c=n&&Ee.g;return n&&(Ee.g=Ee[a]),((l,u,d,m)=>{m?u.data=u.data.replace(m,l):u.data.indexOf(l)===-1&&(u.data=d?l+u.data:u.data+l)})(Ee[a],t,r,c),a},Kr=(e,t,n)=>e.reduce((r,s,i)=>{let a=t[i];if(a&&a.call){let c=a(n),l=c&&c.props&&c.props.className||/^go/.test(c)&&c;a=l?"."+l:c&&typeof c=="object"?c.props?"":Se(c,""):c===!1?"":c}return r+s+(a??"")},"");function ct(e){let t=this||{},n=e.call?e(t.p):e;return Wr(n.unshift?n.raw?Kr(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,jr(t.target),t.g,t.o,t.k)}let An,_t,Et;ct.bind({g:1});let we=ct.bind({k:1});function Hr(e,t,n,r){Se.p=t,An=e,_t=n,Et=r}function Te(e,t){let n=this||{};return function(){let r=arguments;function s(i,a){let c=Object.assign({},i),l=c.className||s.className;n.p=Object.assign({theme:_t&&_t()},c),n.o=/go\d/.test(l),c.className=ct.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),Et&&u[0]&&Et(c),An(u,c)}return s}}var Ur=e=>typeof e=="function",rt=(e,t)=>Ur(e)?e(t):e,Qr=(()=>{let e=0;return()=>(++e).toString()})(),Ln=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),Vr=20,Dt="default",Dn=(e,t)=>{let{toastLimit:n}=e.settings;switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,n)};case 1:return{...e,toasts:e.toasts.map(a=>a.id===t.toast.id?{...a,...t.toast}:a)};case 2:let{toast:r}=t;return Dn(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(a=>a.id===s||s===void 0?{...a,dismissed:!0,visible:!1}:a)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(a=>a.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+i}))}}},et=[],Rn={toasts:[],pausedAt:void 0,settings:{toastLimit:Vr}},he={},$n=(e,t=Dt)=>{he[t]=Dn(he[t]||Rn,e),et.forEach(([n,r])=>{n===t&&r(he[t])})},qn=e=>Object.keys(he).forEach(t=>$n(e,t)),zr=e=>Object.keys(he).find(t=>he[t].toasts.some(n=>n.id===e)),lt=(e=Dt)=>t=>{$n(t,e)},Gr={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},Jr=(e={},t=Dt)=>{let[n,r]=v(he[t]||Rn),s=j(he[t]);_(()=>(s.current!==he[t]&&r(he[t]),et.push([t,r]),()=>{let a=et.findIndex(([c])=>c===t);a>-1&&et.splice(a,1)}),[t]);let i=n.toasts.map(a=>{var c,l,u;return{...e,...e[a.type],...a,removeDelay:a.removeDelay||((c=e[a.type])==null?void 0:c.removeDelay)||e?.removeDelay,duration:a.duration||((l=e[a.type])==null?void 0:l.duration)||e?.duration||Gr[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...n,toasts:i}},Yr=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:n?.id||Qr()}),Ke=e=>(t,n)=>{let r=Yr(t,e,n);return lt(r.toasterId||zr(r.id))({type:2,toast:r}),r.id},J=(e,t)=>Ke("blank")(e,t);J.error=Ke("error");J.success=Ke("success");J.loading=Ke("loading");J.custom=Ke("custom");J.dismiss=(e,t)=>{let n={type:3,toastId:e};t?lt(t)(n):qn(n)};J.dismissAll=e=>J.dismiss(void 0,e);J.remove=(e,t)=>{let n={type:4,toastId:e};t?lt(t)(n):qn(n)};J.removeAll=e=>J.remove(void 0,e);J.promise=(e,t,n)=>{let r=J.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let i=t.success?rt(t.success,s):void 0;return i?J.success(i,{id:r,...n,...n?.success}):J.dismiss(r),s}).catch(s=>{let i=t.error?rt(t.error,s):void 0;i?J.error(i,{id:r,...n,...n?.error}):J.dismiss(r)}),e};var Zr=1e3,Xr=(e,t="default")=>{let{toasts:n,pausedAt:r}=Jr(e,t),s=j(new Map).current,i=V((m,p=Zr)=>{if(s.has(m))return;let h=setTimeout(()=>{s.delete(m),a({type:4,toastId:m})},p);s.set(m,h)},[]);_(()=>{if(r)return;let m=Date.now(),p=n.map(h=>{if(h.duration===1/0)return;let f=(h.duration||0)+h.pauseDuration-(m-h.createdAt);if(f<0){h.visible&&J.dismiss(h.id);return}return setTimeout(()=>J.dismiss(h.id,t),f)});return()=>{p.forEach(h=>h&&clearTimeout(h))}},[n,r,t]);let a=V(lt(t),[t]),c=V(()=>{a({type:5,time:Date.now()})},[a]),l=V((m,p)=>{a({type:1,toast:{id:m,height:p}})},[a]),u=V(()=>{r&&a({type:6,time:Date.now()})},[r,a]),d=V((m,p)=>{let{reverseOrder:h=!1,gutter:f=8,defaultPosition:E}=p||{},O=n.filter(b=>(b.position||E)===(m.position||E)&&b.height),T=O.findIndex(b=>b.id===m.id),w=O.filter((b,I)=>I<T&&b.visible).length;return O.filter(b=>b.visible).slice(...h?[w+1]:[0,w]).reduce((b,I)=>b+(I.height||0)+f,0)},[n]);return _(()=>{n.forEach(m=>{if(m.dismissed)i(m.id,m.removeDelay);else{let p=s.get(m.id);p&&(clearTimeout(p),s.delete(m.id))}})},[n,i]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},eo=we`
|
|
3
|
+
from {
|
|
4
|
+
transform: scale(0) rotate(45deg);
|
|
5
|
+
opacity: 0;
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
transform: scale(1) rotate(45deg);
|
|
9
|
+
opacity: 1;
|
|
10
|
+
}`,to=we`
|
|
11
|
+
from {
|
|
12
|
+
transform: scale(0);
|
|
13
|
+
opacity: 0;
|
|
14
|
+
}
|
|
15
|
+
to {
|
|
16
|
+
transform: scale(1);
|
|
17
|
+
opacity: 1;
|
|
18
|
+
}`,no=we`
|
|
19
|
+
from {
|
|
20
|
+
transform: scale(0) rotate(90deg);
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
to {
|
|
24
|
+
transform: scale(1) rotate(90deg);
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}`,ro=Te("div")`
|
|
27
|
+
width: 20px;
|
|
28
|
+
opacity: 0;
|
|
29
|
+
height: 20px;
|
|
30
|
+
border-radius: 10px;
|
|
31
|
+
background: ${e=>e.primary||"#ff4b4b"};
|
|
32
|
+
position: relative;
|
|
33
|
+
transform: rotate(45deg);
|
|
34
|
+
|
|
35
|
+
animation: ${eo} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
36
|
+
forwards;
|
|
37
|
+
animation-delay: 100ms;
|
|
38
|
+
|
|
39
|
+
&:after,
|
|
40
|
+
&:before {
|
|
41
|
+
content: '';
|
|
42
|
+
animation: ${to} 0.15s ease-out forwards;
|
|
43
|
+
animation-delay: 150ms;
|
|
44
|
+
position: absolute;
|
|
45
|
+
border-radius: 3px;
|
|
46
|
+
opacity: 0;
|
|
47
|
+
background: ${e=>e.secondary||"#fff"};
|
|
48
|
+
bottom: 9px;
|
|
49
|
+
left: 4px;
|
|
50
|
+
height: 2px;
|
|
51
|
+
width: 12px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:before {
|
|
55
|
+
animation: ${no} 0.15s ease-out forwards;
|
|
56
|
+
animation-delay: 180ms;
|
|
57
|
+
transform: rotate(90deg);
|
|
58
|
+
}
|
|
59
|
+
`,oo=we`
|
|
60
|
+
from {
|
|
61
|
+
transform: rotate(0deg);
|
|
62
|
+
}
|
|
63
|
+
to {
|
|
64
|
+
transform: rotate(360deg);
|
|
65
|
+
}
|
|
66
|
+
`,so=Te("div")`
|
|
67
|
+
width: 12px;
|
|
68
|
+
height: 12px;
|
|
69
|
+
box-sizing: border-box;
|
|
70
|
+
border: 2px solid;
|
|
71
|
+
border-radius: 100%;
|
|
72
|
+
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
73
|
+
border-right-color: ${e=>e.primary||"#616161"};
|
|
74
|
+
animation: ${oo} 1s linear infinite;
|
|
75
|
+
`,io=we`
|
|
76
|
+
from {
|
|
77
|
+
transform: scale(0) rotate(45deg);
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
to {
|
|
81
|
+
transform: scale(1) rotate(45deg);
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}`,ao=we`
|
|
84
|
+
0% {
|
|
85
|
+
height: 0;
|
|
86
|
+
width: 0;
|
|
87
|
+
opacity: 0;
|
|
88
|
+
}
|
|
89
|
+
40% {
|
|
90
|
+
height: 0;
|
|
91
|
+
width: 6px;
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
100% {
|
|
95
|
+
opacity: 1;
|
|
96
|
+
height: 10px;
|
|
97
|
+
}`,co=Te("div")`
|
|
98
|
+
width: 20px;
|
|
99
|
+
opacity: 0;
|
|
100
|
+
height: 20px;
|
|
101
|
+
border-radius: 10px;
|
|
102
|
+
background: ${e=>e.primary||"#61d345"};
|
|
103
|
+
position: relative;
|
|
104
|
+
transform: rotate(45deg);
|
|
105
|
+
|
|
106
|
+
animation: ${io} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
107
|
+
forwards;
|
|
108
|
+
animation-delay: 100ms;
|
|
109
|
+
&:after {
|
|
110
|
+
content: '';
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
animation: ${ao} 0.2s ease-out forwards;
|
|
113
|
+
opacity: 0;
|
|
114
|
+
animation-delay: 200ms;
|
|
115
|
+
position: absolute;
|
|
116
|
+
border-right: 2px solid;
|
|
117
|
+
border-bottom: 2px solid;
|
|
118
|
+
border-color: ${e=>e.secondary||"#fff"};
|
|
119
|
+
bottom: 6px;
|
|
120
|
+
left: 6px;
|
|
121
|
+
height: 10px;
|
|
122
|
+
width: 6px;
|
|
123
|
+
}
|
|
124
|
+
`,lo=Te("div")`
|
|
125
|
+
position: absolute;
|
|
126
|
+
`,uo=Te("div")`
|
|
127
|
+
position: relative;
|
|
128
|
+
display: flex;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
align-items: center;
|
|
131
|
+
min-width: 20px;
|
|
132
|
+
min-height: 20px;
|
|
133
|
+
`,mo=we`
|
|
134
|
+
from {
|
|
135
|
+
transform: scale(0.6);
|
|
136
|
+
opacity: 0.4;
|
|
137
|
+
}
|
|
138
|
+
to {
|
|
139
|
+
transform: scale(1);
|
|
140
|
+
opacity: 1;
|
|
141
|
+
}`,po=Te("div")`
|
|
142
|
+
position: relative;
|
|
143
|
+
transform: scale(0.6);
|
|
144
|
+
opacity: 0.4;
|
|
145
|
+
min-width: 20px;
|
|
146
|
+
animation: ${mo} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
147
|
+
forwards;
|
|
148
|
+
`,ho=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?ee(po,null,t):t:n==="blank"?null:ee(uo,null,ee(so,{...r}),n!=="loading"&&ee(lo,null,n==="error"?ee(ro,{...r}):ee(co,{...r})))},fo=e=>`
|
|
149
|
+
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
150
|
+
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
151
|
+
`,yo=e=>`
|
|
152
|
+
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
153
|
+
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
154
|
+
`,go="0%{opacity:0;} 100%{opacity:1;}",vo="0%{opacity:1;} 100%{opacity:0;}",bo=Te("div")`
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
background: #fff;
|
|
158
|
+
color: #363636;
|
|
159
|
+
line-height: 1.3;
|
|
160
|
+
will-change: transform;
|
|
161
|
+
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
162
|
+
max-width: 350px;
|
|
163
|
+
pointer-events: auto;
|
|
164
|
+
padding: 8px 10px;
|
|
165
|
+
border-radius: 8px;
|
|
166
|
+
`,wo=Te("div")`
|
|
167
|
+
display: flex;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
margin: 4px 10px;
|
|
170
|
+
color: inherit;
|
|
171
|
+
flex: 1 1 auto;
|
|
172
|
+
white-space: pre-line;
|
|
173
|
+
`,_o=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=Ln()?[go,vo]:[fo(n),yo(n)];return{animation:t?`${we(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${we(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Eo=kr(({toast:e,position:t,style:n,children:r})=>{let s=e.height?_o(e.position||t||"top-center",e.visible):{opacity:0},i=ee(ho,{toast:e}),a=ee(wo,{...e.ariaProps},rt(e.message,e));return ee(bo,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:i,message:a}):ee(ue,null,i,a))});Hr(ee);var So=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let i=V(a=>{if(a){let c=()=>{let l=a.getBoundingClientRect().height;r(e,l)};c(),new MutationObserver(c).observe(a,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return ee("div",{ref:i,className:t,style:n},s)},ko=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},s=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ln()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},To=ct`
|
|
174
|
+
z-index: 9999;
|
|
175
|
+
> * {
|
|
176
|
+
pointer-events: auto;
|
|
177
|
+
}
|
|
178
|
+
`,Ve=16,Mn=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:i,containerStyle:a,containerClassName:c})=>{let{toasts:l,handlers:u}=Xr(n,i);return ee("div",{"data-rht-toaster":i||"",style:{position:"fixed",zIndex:9999,top:Ve,left:Ve,right:Ve,bottom:Ve,pointerEvents:"none",...a},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,p=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),h=ko(m,p);return ee(So,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?To:"",style:h},d.type==="custom"?rt(d.message,d):s?s(d):ee(Eo,{toast:d,position:m}))}))},C=J;function ut(e){const t={subscribe(n){let r=null,s=!1,i=!1,a=!1;function c(){if(r===null){a=!0;return}i||(i=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;s||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;s||(s=!0,(u=n.error)===null||u===void 0||u.call(n,l),c())},complete(){var l;s||(s=!0,(l=n.complete)===null||l===void 0||l.call(n),c())}}),a&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(Po,t)}};return t}function Po(e,t){return t(e)}function Io(e){const t=new AbortController;return new Promise((n,r)=>{let s=!1;function i(){s||(s=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const a=e.subscribe({next(c){s=!0,n(c),i()},error(c){r(c)},complete(){t.abort(),i()}})})}function No(e){return t=>{let n=0,r=null;const s=[];function i(){r||(r=t.subscribe({next(c){for(const u of s){var l;(l=u.next)===null||l===void 0||l.call(u,c)}},error(c){for(const u of s){var l;(l=u.error)===null||l===void 0||l.call(u,c)}},complete(){for(const l of s){var c;(c=l.complete)===null||c===void 0||c.call(l)}}}))}function a(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return ut(c=>(n++,s.push(c),i(),{unsubscribe(){n--,a();const l=s.findIndex(u=>u===c);l>-1&&s.splice(l,1)}}))}}function Co(e){let t=e;const n=[],r=a=>{t!==void 0&&a.next(t),n.push(a)},s=a=>{n.splice(n.indexOf(a),1)},i=ut(a=>(r(a),()=>{s(a)}));return i.next=a=>{if(t!==a){t=a;for(const c of n)c.next(a)}},i.get=()=>t,i}function xo(e){return ut(t=>{function n(r=0,s=e.op){const i=e.links[r];if(!i)throw new Error("No more links to execute - did you forget to add an ending link?");return i({op:s,next(a){return n(r+1,a)}})}return n().subscribe(t)})}function Be(e){"@babel/helpers - typeof";return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(e)}function Oo(e,t){if(Be(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Be(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ao(e){var t=Oo(e,"string");return Be(t)=="symbol"?t:t+""}function oe(e,t,n){return(t=Ao(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Xt(Object(n),!0).forEach(function(r){oe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ke(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function Lo(e){return typeof e=="function"}function Do(){return Object.create(null)}const Ro=typeof Symbol=="function"&&!!Symbol.asyncIterator;function $o(e){return Ro&&ke(e)&&Symbol.asyncIterator in e}const qo=e=>e(),jn=()=>{},en=e=>{Object.freeze&&Object.freeze(e)};function Bn(e,t,n){var r;const s=t.join(".");return(r=n[s])!==null&&r!==void 0||(n[s]=new Proxy(jn,{get(i,a){if(!(typeof a!="string"||a==="then"))return Bn(e,[...t,a],n)},apply(i,a,c){const l=t[t.length-1];if(l==="valueOf"||l==="toString"||l==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let u={args:c,path:t};return l==="call"?u={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:l==="apply"&&(u={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),en(u.args),en(u.path),e(u)}})),n[s]}const Fn=e=>Bn(e,[],Do()),Mo=e=>new Proxy(jn,{get(t,n){if(n!=="then")return e(n)}});function Fe(e){"@babel/helpers - typeof";return Fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(e)}function jo(e,t){if(Fe(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bo(e){var t=jo(e,"string");return Fe(t)=="symbol"?t:t+""}function St(e,t,n){return(t=Bo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(n),!0).forEach(function(r){St(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var Fo=class extends Error{constructor(e){super(Wo(e)),Object.assign(this,e)}};function Wo(e){if("message"in e)return String(e.message)}function Ko(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(ke(e))return new Fo(e)}}var nn=class extends Error{constructor(e){var t,n,r;const s=Ko(e.cause),i=(t=(n=e.message)!==null&&n!==void 0?n:s?.message)!==null&&t!==void 0?t:e.code;super(i,{cause:s}),St(this,"cause",void 0),St(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=s)}};function Ho(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:ze(ze({},e),{},{error:n})}}return{ok:!0,result:ze(ze({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var ft=class extends Error{constructor(){super("Unable to transform response from server")}};function Uo(e,t){let n;try{n=Ho(e,t)}catch{throw new ft}if(!n.ok&&(!ke(n.error.error)||typeof n.error.error.code!="number"))throw new ft;if(n.ok&&!ke(n.result))throw new ft;return n}function Qo(e){return typeof e=="function"}async function Vo(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const s=Object.keys(n.lazy).find(i=>t===i||t.startsWith(i+"."));if(!s)return null;await n.lazy[s].load(),r=n.procedures[t]}return r}async function zo(e){const{type:t,path:n}=e,r=await Vo(e.router,n);if(!r||!Qo(r)||r._def.type!==t&&!e.allowMethodOverride)throw new nn({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new nn({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function Go(e){return e instanceof ot}function Jo(e){return ke(e)&&ke(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function Yo(e,t){return typeof e=="string"?e:ke(e)&&typeof e.message=="string"?e.message:t}var ot=class tt extends Error{constructor(t,n){var r,s;const i=n?.cause;super(t,{cause:i}),oe(this,"cause",void 0),oe(this,"shape",void 0),oe(this,"data",void 0),oe(this,"meta",void 0),this.meta=n?.meta,this.cause=i,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,tt.prototype)}static from(t,n={}){const r=t;return Go(r)?(n.meta&&(r.meta=Y(Y({},r.meta),n.meta)),r):Jo(r)?new tt(r.error.message,Y(Y({},n),{},{result:r,cause:n.cause})):new tt(Yo(r,"Unknown error"),Y(Y({},n),{},{cause:r}))}};function Zo(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const rn=e=>typeof e=="function";function Xo(e){if(e)return e;if(typeof window<"u"&&rn(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&rn(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function es(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const i of e)i?.aborted?s():i?.addEventListener("abort",s,{once:!0});return t.signal}function ts(...e){const t=new AbortController;for(const n of e)n?.aborted?t.abort():n?.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function ns(e){return{url:e.url.toString(),fetch:e.fetch,transformer:Zo(e.transformer),methodOverride:e.methodOverride}}function rs(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const os={query:"GET",mutation:"POST",subscription:"PATCH"};function Wn(e){return"input"in e?e.transformer.input.serialize(e.input):rs(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Kn=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=Wn(e);s!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(n+="?"+r.join("&")),n},ss=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=Wn(e);return t!==void 0?JSON.stringify(t):void 0},is=e=>us(Y(Y({},e),{},{contentTypeHeader:"application/json",getUrl:Kn,getBody:ss}));var as=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const cs=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new as};async function ls(e){var t,n;cs(e.signal);const r=e.getUrl(e),s=e.getBody(e),i=(t=e.methodOverride)!==null&&t!==void 0?t:os[e.type],a=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=Y(Y(Y({},e.contentTypeHeader&&i!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),a);return Xo(e.fetch)(r,{method:i,signal:e.signal,body:s,headers:c})}async function us(e){const t={},n=await ls(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const on=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function sn(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function s(c){const l=[[]];let u=0;for(;;){const p=c[u];if(!p)break;const h=l[l.length-1];if(p.aborted){var d;(d=p.reject)===null||d===void 0||d.call(p,new Error("Aborted")),u++;continue}if(e.validate(h.concat(p).map(f=>f.key))){h.push(p),u++;continue}if(h.length===0){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function i(){const c=s(t);r();for(const l of c){if(!l.length)continue;const u={items:l};for(const d of l)d.batch=u;e.fetch(u.items.map(d=>d.key)).then(async d=>{await Promise.all(d.map(async(p,h)=>{const f=u.items[h];try{var E;const T=await Promise.resolve(p);(E=f.resolve)===null||E===void 0||E.call(f,T)}catch(T){var O;(O=f.reject)===null||O===void 0||O.call(f,T)}f.batch=null,f.reject=null,f.resolve=null}));for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,new Error("Missing result")),p.batch=null}}).catch(d=>{for(const p of u.items){var m;(m=p.reject)===null||m===void 0||m.call(p,d),p.batch=null}})}}function a(c){var l;const u={aborted:!1,key:c,batch:null,resolve:on,reject:on},d=new Promise((m,p)=>{var h;u.reject=p,u.resolve=m,(h=t)!==null&&h!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(i)),d}return{load:a}}function ds(e){var t,n;const r=ns(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,i=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const a=l=>({validate(u){if(s===1/0&&i===1/0)return!0;if(u.length>i)return!1;const d=u.map(p=>p.path).join(","),m=u.map(p=>p.input);return Kn(Y(Y({},r),{},{type:l,path:d,inputs:m,signal:null})).length<=s},async fetch(u){const d=u.map(f=>f.path).join(","),m=u.map(f=>f.input),p=es(...u.map(f=>f.signal)),h=await is(Y(Y({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:p}));return(Array.isArray(h.json)?h.json:u.map(()=>h.json)).map(f=>({meta:h.meta,json:f}))}}),c={query:sn(a("query")),mutation:sn(a("mutation"))};return({op:l})=>ut(u=>{if(l.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const d=new AbortController,m=c[l.type].load(Y(Y({},l),{},{signal:ts(l.signal,d.signal)}));let p=!1,h;return m.then(f=>{p=!0,h=f;const E=Uo(f.json,r.transformer.output);if(!E.ok){u.error(ot.from(E.error,{meta:f.meta}));return}u.next({context:f.meta,result:E.result}),u.complete()}).catch(f=>{p=!0,u.error(ot.from(f,{meta:h?.meta}))}),()=>{p||d.abort()}})}}const Hn=(e,...t)=>typeof e=="function"?e(...t):e;function ms(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function ps(e){const t=await Hn(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function hs(e,t){const n={method:"connectionParams",data:await Hn(e)};return t.encode(n)}function fs(e){const{promise:t,resolve:n,reject:r}=ms();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function ys(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function i(){r=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function a(){clearTimeout(r),i()}function c(){clearTimeout(s),a()}e.addEventListener("open",i),e.addEventListener("message",({data:l})=>{clearTimeout(r),i(),l==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(s)})}var gs=class kt{constructor(t){var n;if(oe(this,"id",++kt.connectCount),oe(this,"WebSocketPonyfill",void 0),oe(this,"urlOptions",void 0),oe(this,"keepAliveOpts",void 0),oe(this,"encoder",void 0),oe(this,"wsObservable",Co(null)),oe(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++kt.connectCount;const t=ps(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&ys(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await fs(n),this.urlOptions.connectionParams&&n.send(await hs(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};oe(gs,"connectCount",0);var Un=class{constructor(e){oe(this,"links",void 0),oe(this,"runtime",void 0),oe(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return xo({links:this.links,op:Y(Y({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(No())}async requestAsPromise(e){try{const t=this.$request(e);return(await Io(t)).result.data}catch(t){throw ot.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var s;(s=n.onConnectionStateChange)===null||s===void 0||s.call(n,r.result);break;case"started":var i;(i=n.onStarted)===null||i===void 0||i.call(n,{context:r.context});break;case"stopped":var a;(a=n.onStopped)===null||a===void 0||a.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var s;(s=n.onError)===null||s===void 0||s.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const Qn=Symbol.for("trpc_untypedClient"),vs={query:"query",mutate:"mutation",subscribe:"subscription"},bs=e=>vs[e];function ws(e){const t=Fn(({path:n,args:r})=>{const s=[...n],i=bs(s.pop()),a=s.join(".");return e[i](a,...r)});return Mo(n=>n===Qn?e:t[n])}function _s(e){return ws(new Un(e))}function Es(e){return e[Qn]}function We(e){"@babel/helpers - typeof";return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(e)}function Ss(e,t){if(We(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(We(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ks(e){var t=Ss(e,"string");return We(t)=="symbol"?t:t+""}function Ts(e,t,n){return(t=ks(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function an(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?an(Object(n),!0).forEach(function(r){Ts(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ps(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new nt(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function nt(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return nt=function(r){this.s=r,this.n=r.next},nt.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new nt(e)}function Is(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function Ns(e,t){if(e==null)return{};var n,r,s=Is(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const Cs=["cursor","direction"];function dt(e){return{path:e.path.join(".")}}function xs(e){return e.length>=3}function Os(e){return xs(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function Rt(e,t,n){var r;const s=Os(e);let i=(r=s.args)===null||r===void 0?void 0:r.input;if(n){var a,c;i=D(D(D({},(a=(c=s.args)===null||c===void 0?void 0:c.input)!==null&&a!==void 0?a:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.path.join("."),i,t?.trpc]}async function As(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const s=[];var i=!1,a=!1,c;try{for(var l=Ps(e),u;i=!(u=await l.next()).done;i=!1){const d=u.value;s.push(d),r.setState({data:[...s]})}}catch(d){a=!0,c=d}finally{try{i&&l.return!=null&&await l.return()}finally{if(a)throw c}}return s}function ve(e){const t=qo(()=>{const{input:n,type:r}=e,s=e.path.flatMap(i=>i.split("."));if(!n&&r==="any")return s.length?[s]:[];if(r==="infinite"&&ke(n)&&("direction"in n||"cursor"in n)){const{cursor:i,direction:a}=n;return[s,{input:Ns(n,Cs),type:"infinite"}]}return[s,D(D({},typeof n<"u"&&n!==Ie&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function Vn(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function $t(e){return Lo(e)?e():e}function Ls(e){var t;const{input:n,query:r,path:s,queryKey:i,opts:a}=e,c=n===Ie,l=async u=>{var d;const m=D(D({},a),{},{trpc:D(D({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...Rt(i,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(Ar(D(D({},a??{}),{},{queryKey:i,queryFn:c?Ie:l,initialPageParam:(t=a?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:dt({path:s})})}function Ds(e){var t,n;const{mutate:r,path:s,prefix:i,opts:a,overrides:c}=e,l=$t(e.queryClient),u=Vn({path:s,prefix:(t=a?.keyPrefix)!==null&&t!==void 0?t:i}),d=l.defaultMutationOptions(l.getMutationDefaults(u)),m=(n=c?.onSuccess)!==null&&n!==void 0?n:(h=>h.originalFn()),p=async h=>await r(...Rt([...u,{input:h}],a));return D(D({},a),{},{mutationKey:u,mutationFn:p,onSuccess(...h){var f,E;return m({originalFn:()=>{var T,w,b;return(T=a==null||(w=a.onSuccess)===null||w===void 0?void 0:w.call(a,...h))!==null&&T!==void 0?T:d==null||(b=d.onSuccess)===null||b===void 0?void 0:b.call(d,...h)},queryClient:l,meta:(f=(E=a?.meta)!==null&&E!==void 0?E:d?.meta)!==null&&f!==void 0?f:{}})},trpc:dt({path:s})})}function Rs(e){const{input:t,query:n,path:r,queryKey:s,opts:i}=e,a=$t(e.queryClient),c=t===Ie,l=async u=>{var d;const m=D(D({},i),{},{trpc:D(D({},i?.trpc),!(i==null||(d=i.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),p=u.queryKey,h=await n(...Rt(p,m));return $o(h)?As(h,a,p):h};return Object.assign(Lr(D(D({},i),{},{queryKey:s,queryFn:c?Ie:l})),{trpc:dt({path:r})})}const $s=e=>{const{subscribe:t,path:n,queryKey:r,input:s,opts:i={}}=e,a="enabled"in i?!!i.enabled:s!==Ie,c=l=>t(n.join("."),s===Ie?void 0:s,l);return D(D({},i),{},{enabled:a,subscribe:c,queryKey:r,trpc:dt({path:n})})};function qs(e){const t=e.keyPrefix,n=r=>(s,i,a)=>"router"in e?Promise.resolve($t(e.ctx)).then(c=>zo({router:e.router,path:s,getRawInput:async()=>i,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof Un?e.client:Es(e.client))[r](s,i,a);return Fn(({args:r,path:s})=>{const i=[...s],a=i.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>ve({path:i,type:"any",prefix:t}),pathFilter:()=>D(D({},c),{},{queryKey:ve({path:i,type:"any",prefix:t})}),queryOptions:()=>Rs({input:c,opts:l,path:i,queryClient:e.queryClient,queryKey:ve({path:i,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>ve({path:i,input:c,type:"query",prefix:t}),queryFilter:()=>D(D({},l),{},{queryKey:ve({path:i,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>Ls({input:c,opts:l,path:i,queryKey:ve({path:i,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>ve({path:i,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>D(D({},l),{},{queryKey:ve({path:i,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return Ds({opts:c,path:i,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(u=e.overrides)===null||u===void 0?void 0:u.mutations})},mutationKey:()=>Vn({path:i,prefix:t}),subscriptionOptions:()=>$s({opts:l,path:i,input:c,queryKey:ve({path:i,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[a]()})}function Ms(){const e=ye(null),t=ye(null),n=i=>{const a=Oe(()=>qs({client:i.trpcClient,queryClient:i.queryClient,keyPrefix:i.keyPrefix}),[i.trpcClient,i.queryClient,i.keyPrefix]);return ee(e.Provider,{value:i.trpcClient},ee(t.Provider,{value:a},i.children))};n.displayName="TRPCProvider";function r(){const i=ge(t);if(!i)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return i}function s(){const i=ge(e);if(!i)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return i}return{TRPCProvider:n,useTRPC:r,useTRPCClient:s}}const Tt={lan:new Set,animepahe:new Set,jasmr:new Set};function Pe(e){for(const t of[...Tt[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function zn(e,t){return Tt[e].add(t),()=>{Tt[e].delete(t)}}let st="default";function Gn(){return st}function js(e){st=e}const Bs=new Set(["playerVideoDelayMs","playerVideoDelayEnabled","anime4kEnabled"]);function Ge(e){return st==="default"||Bs.has(e)?e:`dango:profile:${st}:${e}`}const X={keyFor:Ge,getItem:e=>localStorage.getItem(Ge(e)),setItem:(e,t)=>localStorage.setItem(Ge(e),t),removeItem:e=>localStorage.removeItem(Ge(e))};function Fs(){localStorage.setItem("dango:profile-session-change",`${Date.now()}-${Math.random()}`),window.location.assign("/")}const Ws=(e,t)=>new Promise((n,r)=>{t?.throwIfAborted();const s=()=>{clearTimeout(i),r(t?.reason)},i=setTimeout(()=>{t?.removeEventListener("abort",s),n()},e);t?.addEventListener("abort",s,{once:!0})}),qt=async(e,t)=>{const n=e instanceof Request?e:void 0,r=new Headers(n?.headers);(!t?.body||!(t.body instanceof FormData))&&r.set("Content-Type","application/json");const s=n?.url??e.toString(),i=s.startsWith("/")&&!s.startsWith("//")||typeof window<"u"&&new URL(s,window.location.origin).origin===window.location.origin;if(i){!s.includes("/api/profiles/status")&&!s.includes("/api/profiles/login")&&!s.includes("/api/auth/app-")&&r.set("x-dango-profile-id",Gn());let m=X.getItem("animepahe_ua"),p=X.getItem("animepahe_cookie");p&&m&&m!==navigator.userAgent&&(X.removeItem("animepahe_cookie"),X.removeItem("animepahe_ua"),p=null,m=null,C.error("Your browser changed. Verify AnimePahe again to refresh its cookie."),Pe("animepahe"));const h=X.getItem("jasmr_ua"),f=X.getItem("jasmr_cookie");m&&r.set("x-animepahe-ua",m),p&&r.set("x-animepahe-cookie",p),h&&r.set("x-jasmr-ua",h),f&&r.set("x-jasmr-cookie",f)}new Headers(t?.headers).forEach((m,p)=>r.set(p,m));const a={...t,headers:r},c=(t?.method??n?.method??"GET").toUpperCase(),l=t?.signal??n?.signal,u=i&&(c==="GET"||c==="HEAD");let d=await fetch(e,a);i&&d.status===409&&(await d.clone().json().catch(()=>null))?.error==="PROFILE_CHANGED"&&window.location.reload(),i&&d.status===401&&!s.includes("/api/profiles/")&&(await d.clone().json().catch(()=>null))?.error==="PROFILE_AUTH_REQUIRED"&&window.dispatchEvent(new Event("dango:profile-auth-required"));for(let m=0;u&&d.status===503&&d.headers.get("x-dango-not-ready")==="1"&&m<3;m++)await d.body?.cancel(),await Ws(500*2**m,l),d=await fetch(e,a);return d},Me=async(e,t)=>{const n=await qt(e,t);if(!n.ok){const r=await n.text().catch(()=>"");let s={};try{s=JSON.parse(r)}catch{}const i=typeof s.error=="string"?s.error:"";throw n.status===403&&i==="AUTH_REQUIRED"&&s.provider==="animepahe"&&Pe("animepahe"),n.status===403&&i==="AUTH_REQUIRED"&&s.provider==="jasmr"&&Pe("jasmr"),n.status===401&&i==="LAN_AUTH_REQUIRED"&&Pe("lan"),new Error(i||`Failed to fetch from ${e}`)}return n.json()};async function Ks(e,t){const n=await qt(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&Pe("lan")}catch{}return await Hs(n),n}async function Hs(e){try{if(!e.headers.get("content-type")?.includes("json"))return;const t=await e.clone().json(),n=Array.isArray(t)?t:[t];for(const r of n){const s=r?.error;if(!s||typeof s!="object")continue;const i=s.data?.cause;(s.message==="AUTH_REQUIRED"||i?.code==="AUTH_REQUIRED")&&(i?.provider==="animepahe"||i?.provider==="jasmr")&&Pe(i.provider),(s.message==="LAN_AUTH_REQUIRED"||i?.code==="LAN_AUTH_REQUIRED")&&Pe("lan")}}catch{}}const{TRPCProvider:Us,useTRPC:$}=Ms(),de=_s({links:[ds({url:"/api/trpc",fetch:Ks})]}),Qs="_overlay_1juub_1",Vs="_fadeIn_1juub_1",zs="_content_1juub_11",Gs="_modalIn_1juub_1",Js="_sm_1juub_29",Ys="_md_1juub_33",Zs="_lg_1juub_37",Xs="_title_1juub_41",ei="_body_1juub_48",ti="_footer_1juub_52",Ce={overlay:Qs,fadeIn:Vs,content:zs,modalIn:Gs,sm:Js,md:Ys,lg:Zs,title:Xs,body:ei,footer:ti};function Jn({children:e}){return o("h2",{className:Ce.title,children:e})}function Yn({children:e}){return o("div",{className:Ce.body,children:e})}function Zn({children:e}){return o("div",{className:Ce.footer,children:e})}function Ae({isOpen:e,onClose:t,title:n,children:r,footer:s,width:i="md"}){const a=j(null),[c,l]=v(document.body);return _(()=>{if(!e)return;const u=()=>l(document.fullscreenElement??document.body);return u(),document.addEventListener("fullscreenchange",u),()=>document.removeEventListener("fullscreenchange",u)},[e]),_(()=>{if(!e)return;const u=m=>{m.key==="Escape"&&t?.()};document.addEventListener("keydown",u);const d=document.body.style.overflow;return document.body.style.overflow="hidden",a.current?.focus(),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=d}},[e,t]),e?Cn(o("div",{role:"presentation",onMouseDown:u=>u.stopPropagation(),children:[o("div",{className:Ce.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:a,className:`${Ce.content} ${Ce[i]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(Jn,{children:n}),o(Yn,{children:r}),s&&o(Zn,{children:s})]})]}),c):null}Ae.Header=Jn;Ae.Body=Yn;Ae.Actions=Zn;const De=new Map,ni=500,Xn=(e,t,n)=>{if(!e||e.trim()==="")return"/placeholder.svg";if(e.includes("/api/image-proxy")){let a=e;if(t&&!a.includes("w=")){const c=a.includes("?")?"&":"?";a+=`${c}w=${t}`}if(n&&!a.includes("h=")){const c=a.includes("?")?"&":"?";a+=`${c}h=${n}`}return a}let r=e;r.includes("aln.youtube-anime.com")&&(r=r.replace(/https?:\/\/allanime\.day\/aln\.youtube-anime\.com/,"https://aln.youtube-anime.com"),r.includes("/images/mcovers")&&(r=r.replace("/images/mcovers","/mcovers")),r.includes("/images/images2")&&(r=r.replace("/images/images2","/images2"))),r.includes("allanime.day/s4.anilist.co")&&(r=r.replace(/https?:\/\/allanime\.day\/s4\.anilist\.co/,"https://s4.anilist.co")),r.includes("wp.youtube-anime.com/s4.anilist.co")&&(r=r.replace(/https?:\/\/wp\.youtube-anime\.com\/s4\.anilist\.co/,"https://s4.anilist.co"));const s=`${r}-${t}-${n}`;if(De.has(s))return De.get(s);let i;if(r.startsWith("https://s4.anilist.co"))i=r,t&&(i+=`${i.includes("?")?"&":"?"}w=${t}`),n&&(i+=`${i.includes("?")?"&":"?"}h=${n}`);else if(r.includes("animepahe")){i=`/api/image-proxy?url=${encodeURIComponent(r)}`;const a=X.getItem("animepahe_cookie"),c=X.getItem("animepahe_ua");a&&(i+=`&cookie=${encodeURIComponent(a)}`),c&&(i+=`&ua=${encodeURIComponent(c)}`)}else if(r.startsWith("http"))i=`/api/image-proxy?url=${encodeURIComponent(r)}`,t&&(i+=`&w=${t}`),n?i+=`&h=${n}`:t||(i+="&w=300");else{const c=`${r.startsWith("mcovers")||r.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${r}`;i=`/api/image-proxy?url=${encodeURIComponent(c)}`,t&&(i+=`&w=${t}`),n?i+=`&h=${n}`:t||(i+="&w=300")}return De.size>ni&&De.clear(),De.set(s,i),i},Au=e=>{if(isNaN(e)||e<=0)return"00:00";const t=new Date(e*1e3).toISOString().slice(11,19);return parseInt(t.slice(0,2),10)>0?t:t.slice(3)};function Lu(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim():""}function Du(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const ri=(...e)=>e.filter(Boolean).join(" ");function oi(e,t,n="..."){return e?e.length>t?e.slice(0,t)+n:e:""}const er=ye(void 0),tr=()=>{const e=ge(er);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},M={watchlist:"watchlist",continueWatching:"allContinueWatching",queueRemaining:"queue-remaining",suggestedEpisode:"suggestedEpisode",trendingList:"trendingList",latestReleases:"latestReleases",thisWeekSchedule:"thisWeekSchedule",schedule:"schedule",genreCards:"genreCards",queue:"queue",playerData:"player-data",showData:"show-data",showMeta:"show-meta",videoSources:"video-sources",tvSources:"tv-sources",tvLibrary:"tv-library",tvContinueWatching:"tv-continue-watching",tvProgress:"tv-progress",mangaLibrary:"manga-library",mangaContinueReading:"manga-continue-reading",mangaProgress:"manga-progress",mangaBrowse:"mangaBrowse",mangaBrowseInfinite:"mangaBrowseInfinite",mangaDetail:"mangaDetail",mangaPages:"mangaPages",asmrLibrary:"asmr-library",asmrContinueListening:"asmr-continue-listening",asmrProgress:"asmr-progress",asmrBrowse:"asmrBrowse",asmrWork:"asmrWork",trackerStatus:"trackerStatus",anilistClientId:"anilistClientId",malClientConfig:"malClientConfig",notifications:"notifications",settings:"settings",insights:"insights",insightsRecommendations:"insights-recommendations",providers:"providers",syncProfile:"sync-profile"},Ru=()=>{const e=$(),t=te({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1});return{...t,data:t.data}},$u=(e="TRENDING_DESC",t=10)=>Lt({queryKey:[M.trendingList,e,t],queryFn:({pageParam:n=1})=>de.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),qu=(e="TV",t=12)=>Lt({queryKey:[M.latestReleases,e,t],queryFn:({pageParam:n=1})=>de.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),Mu=(e,t="TV",n=!0)=>{const r=$();return te({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},si=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],ju=(e,t,n=14)=>{const r=$(),s=new URLSearchParams(e),i={page:t,limit:n};for(const a of si){const c=s.get(a);c!==null&&(i[a]=c)}return te({...r.data.search.queryOptions(i),enabled:e!=null})},Bu=()=>{const e=$();return te(e.queue.list.queryOptions())},ii=()=>{const e=$(),t=ne();return le(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?C.success("Added to queue"):C.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[M.queueRemaining]})},onError:n=>{C.error(`Failed to update queue: ${n.message}`)}}))},Fu=()=>{const e=$(),t=ne();return le(e.queue.remove.mutationOptions({onSuccess:()=>{C.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[M.queueRemaining]}),t.invalidateQueries({queryKey:[M.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},Wu=(e,t=!0)=>te({queryKey:[M.queueRemaining,e],queryFn:()=>de.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Ku=()=>{const e=$(),t=ne();return le(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const s=n.added??r.episodeNumbers.length;C.success(`${s} ${s===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[M.queueRemaining]})},onError:n=>{C.error(`Failed to update queue: ${n.message}`)}}))},Hu=()=>{const e=$(),t=ne();return le(e.queue.removeMany.mutationOptions({onSuccess:()=>{C.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[M.queueRemaining]}),t.invalidateQueries({queryKey:[M.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},Uu=()=>{const e=$(),t=ne();return le(e.queue.clear.mutationOptions({onSuccess:()=>{C.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[M.queueRemaining]}),t.invalidateQueries({queryKey:[M.continueWatching]})},onError:n=>{C.error(`Failed to clear queue: ${n.message}`)}}))},Qu=()=>{const e=$(),t=ne(),n=e.queue.list.queryOptions().queryKey;return le(e.queue.reorder.mutationOptions({onMutate:async r=>{await t.cancelQueries({queryKey:n});const s=t.getQueryData(n);return t.setQueryData(n,i=>{if(!i)return i;const a=new Map(i.map(c=>[c.id,c]));return r.map((c,l)=>{const u=a.get(c.id??-1);return u?{...u,queue_order:l}:void 0}).filter(c=>!!c)}),{previousQueue:s}},onError:(r,s,i)=>{i?.previousQueue&&t.setQueryData(n,i.previousQueue)},onSettled:()=>{t.invalidateQueries(e.queue.pathFilter())}}))},ai=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function Mt(e,t,n){const r=new URLSearchParams(e),s={page:t,limit:n};for(const i of ai){const a=r.get(i);a!==null&&(s[i]=a)}return s}const Vu=(e,t="",n,r=14)=>te({queryKey:[M.watchlist,e,t,n,r],queryFn:async()=>{const s=new URLSearchParams(t);return s.set("status",e),await de.watchlist.list.query(Mt(s.toString(),n,r))}}),zu=(e="")=>Lt({queryKey:[M.continueWatching,e],queryFn:async({pageParam:t=1})=>await de.watchlist.continueWatchingAll.query(Mt(e,t,14)),initialPageParam:1,getNextPageParam:t=>{if(!(t.data.length===0||t.page*t.limit>=t.total))return t.page+1},select:t=>({...t,pages:t.pages.flatMap(n=>n.data)})}),Gu=(e="",t,n=14)=>te({queryKey:[M.continueWatching,e,t,n],queryFn:async()=>await de.watchlist.continueWatchingAll.query(Mt(e,t,n))}),Ju=()=>{const e=$(),t=ne();return le(e.watchlist.remove.mutationOptions({onSuccess:()=>{C.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[M.watchlist]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},Yu=()=>{const e=$(),t=ne();return le(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{C.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[M.watchlist]}),t.invalidateQueries({queryKey:[M.continueWatching]})},onError:n=>{C.error(`Failed to update statuses: ${n.message}`)}}))},Zu=()=>{const e=$(),t=ne();return le(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;C.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[M.watchlist]}),t.invalidateQueries({queryKey:[M.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},Xu=()=>{const e=$(),t=ne();return le(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;C.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:[M.continueWatching]})},onError:n=>{C.error(`Failed to remove: ${n.message}`)}}))},nr=(e=!0)=>{const t=$();return te({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},rr=(e=!0)=>{const t=$();return te({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},or=(e=!0)=>{const t=$();return te({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},ci=()=>{const e=$(),t=ne(),n=e.discovery.status.queryOptions().queryKey;return le(e.discovery.refresh.mutationOptions({onSuccess:r=>{t.setQueryData(n,{running:r.running,state:r.state,total:r.total,done:r.done,lastRunAt:r.lastRunAt}),t.invalidateQueries(e.notifications.pathFilter()),t.invalidateQueries({queryKey:[M.notifications]})},onError:()=>{t.invalidateQueries({queryKey:n})}}))},li=()=>{const e=$(),t=ne();return le(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},ui=()=>{const e=$(),t=ne();return le(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},ed=()=>{const e=$();return te({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},td=()=>{const e=$();return te({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},nd=()=>te({queryKey:[M.genreCards],queryFn:()=>de.insights.genreCards.query()}),di="_container_1l2rp_1",mi="_bellBtn_1l2rp_7",pi="_badge_1l2rp_56",hi="_dropdown_1l2rp_84",fi="_dropdownHeader_1l2rp_115",yi="_headerSubtitle_1l2rp_123",gi="_headerActions_1l2rp_130",vi="_closeBtn_1l2rp_136",bi="_sectionHeading_1l2rp_149",wi="_clearAllBtn_1l2rp_165",_i="_discoveryStatusRow_1l2rp_183",Ei="_statusDot_1l2rp_194",Si="_statusDotRunning_1l2rp_201",ki="_statusDotOk_1l2rp_206",Ti="_statusDotError_1l2rp_214",Pi="_statusDotIdle_1l2rp_218",Ii="_list_1l2rp_232",Ni="_item_1l2rp_246",Ci="_itemTitleLink_1l2rp_257",xi="_systemItemMeta_1l2rp_264",Oi="_removeItem_1l2rp_265",Ai="_modalButton_1l2rp_267",Li="_systemItem_1l2rp_264",Di="_systemIcon_1l2rp_280",Ri="_thumbnail_1l2rp_291",$i="_itemInfo_1l2rp_300",qi="_itemTitle_1l2rp_257",Mi="_itemMeta_1l2rp_316",ji="_queueItem_1l2rp_381",Bi="_fullMessage_1l2rp_395",Fi="_emptyState_1l2rp_401",Wi="_emptyIcon_1l2rp_419",k={container:di,bellBtn:mi,badge:pi,dropdown:hi,dropdownHeader:fi,headerSubtitle:yi,headerActions:gi,closeBtn:vi,sectionHeading:bi,clearAllBtn:wi,discoveryStatusRow:_i,statusDot:Ei,statusDotRunning:Si,statusDotOk:ki,statusDotError:Ti,statusDotIdle:Pi,list:Ii,item:Ni,itemTitleLink:Ci,systemItemMeta:xi,removeItem:Oi,modalButton:Ai,systemItem:Li,systemIcon:Di,thumbnail:Ri,itemInfo:$i,itemTitle:qi,itemMeta:Mi,queueItem:ji,fullMessage:Bi,emptyState:Fi,emptyIcon:Wi},Ki=({notification:e})=>{const t=li(),n=ii(),[r,s]=At.useState(!1),i=u=>{u.preventDefault(),u.stopPropagation(),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},a=u=>{u.preventDefault(),u.stopPropagation(),s(!0),n.mutate({showId:e.showId,episodeNumber:e.episodeNumber,showName:e.name,showThumbnail:e.thumbnail,nativeName:e.nativeName,englishName:e.englishName}),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),window.setTimeout(()=>s(!1),1e3)},{titlePreference:c}=tr(),l=c==="nativeName"?e.nativeName||e.name:c==="englishName"&&e.englishName||e.name;return o("div",{className:k.item,children:[o("img",{src:Xn(e.thumbnail,48,64),alt:e.name,className:k.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:k.itemInfo,children:[o(ce,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:k.itemTitleLink,onClick:()=>t.mutate({showId:e.showId,episodeNumber:e.episodeNumber}),children:o("span",{className:k.itemTitle,children:l})}),o("span",{className:k.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${k.removeItem} ${k.queueItem}`,onClick:a,"aria-label":"Add notification to queue",children:r?o(x,{name:"check"}):o(x,{name:"plus"})}),o("button",{className:k.removeItem,onClick:i,"aria-label":"Remove notification",children:o(x,{name:"times"})})]})};function yt({width:e="100%",height:t="1em",variant:n="rectangular",className:r="",style:s}){return o("div",{className:`skeleton skeleton-${n} ${r}`,style:{width:e,height:t,...s}})}const Hi=({count:e=3})=>o(ue,{children:Array.from({length:e}).map((t,n)=>o("div",{className:k.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:k.thumbnail,style:{overflow:"hidden"},children:o(yt,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:k.itemInfo,children:[o(yt,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(yt,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),Ui=({onClose:e})=>{const{data:t=[],isLoading:n}=nr(),{data:r=[]}=rr(),{data:s}=or(),i=ui(),a=ne(),[c,l]=v(null),u=j(null);_(()=>{u.current?.focus();const h=f=>{f.key==="Escape"&&e()};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e]),_(()=>{a.invalidateQueries({queryKey:[M.notifications]})},[a]);const d=r.find(h=>h.id===c)??null,m=t.length+r.length,p=s?.running?s.total>0?`Checking ${Math.min(s.done,s.total)}/${s.total} shows...`:"Checking for new episodes...":s?.state==="complete"?`Discovery complete · checked ${s.total} ${s.total===1?"show":"shows"}`:s?.state==="empty"?"No shows set to Watching":s?.state==="error"?"Last check failed · will retry automatically":s?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-s.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes";return o("div",{id:"notification-panel",ref:u,className:k.dropdown,role:"dialog","aria-label":"Notifications",tabIndex:-1,children:[o("div",{className:k.dropdownHeader,children:[o("div",{children:[o("h4",{children:"Notifications"}),o("span",{className:k.headerSubtitle,children:[m," updates"]})]}),o("div",{className:k.headerActions,children:[t.length>0&&o("button",{className:k.clearAllBtn,onClick:()=>i.mutate(void 0),children:"Clear all"}),o("button",{type:"button",className:k.closeBtn,onClick:e,"aria-label":"Close notifications",children:o(x,{name:"times"})})]})]}),o("div",{className:k.discoveryStatusRow,children:[o("span",{className:`${k.statusDot} ${s?.running?k.statusDotRunning:s?.state==="complete"?k.statusDotOk:s?.state==="error"?k.statusDotError:k.statusDotIdle}`,"aria-hidden":"true"}),o("span",{children:p})]}),o("div",{className:k.list,children:n&&m===0?o(Hi,{count:4}):o(ue,{children:[r.length>0&&o("section",{"aria-labelledby":"system-notifications-heading",children:[o("h5",{id:"system-notifications-heading",className:k.sectionHeading,children:"App updates"}),r.map(h=>o("div",{className:`${k.item} ${k.systemItem}`,children:[o("div",{className:k.systemIcon,children:o(x,{name:"info-circle",size:20})}),o("div",{className:k.itemInfo,children:[o("span",{className:k.itemTitle,children:h.title}),o("button",{type:"button",className:k.systemItemMeta,onClick:()=>l(h.id),title:"View full message",children:[oi(h.message,72,"…")," ",o("span",{children:"Read more"})]})]})]},h.id))]}),t.length>0&&o("section",{"aria-labelledby":"new-episodes-heading",children:[o("h5",{id:"new-episodes-heading",className:k.sectionHeading,children:"New episodes"}),t.map(h=>o(Ki,{notification:h},h.id))]}),!n&&m===0&&o("div",{className:k.emptyState,children:[o("span",{className:k.emptyIcon,children:o(x,{name:"bell",size:22})}),o("strong",{children:"You’re all caught up"}),o("span",{children:"New episode alerts and app updates will show up here."})]})]})}),o(Ae,{isOpen:!!d,onClose:()=>l(null),title:d?.title,width:"sm",footer:o("button",{type:"button",className:k.modalButton,onClick:()=>l(null),children:"OK"}),children:d&&o("p",{className:k.fullMessage,children:d.message})})]})},Qi="notification-panel",Vi=()=>{const[e,t]=v(!1),n=j(null),r=ne(),s=$(),i=ci(),{data:a=[]}=nr(),{data:c=[]}=rr(),{data:l}=or(),u=a.length+c.length,d=u>5?"5+":u,m=j(!1);_(()=>{const h=f=>{n.current&&!n.current.contains(f.target)&&t(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),_(()=>{const h=!!l?.running;m.current&&!h&&(r.invalidateQueries(s.notifications.pathFilter()),r.invalidateQueries(s.discovery.pathFilter())),m.current=h},[l?.running,r,s]);const p=()=>{const h=!e;t(h),h&&i.mutate()};return o("div",{className:k.container,ref:n,children:[o("button",{className:k.bellBtn,onClick:p,"aria-haspopup":"dialog","aria-expanded":e,"aria-controls":Qi,"aria-label":"Notifications",children:[o(x,{name:"bell"}),u>0&&o("span",{className:k.badge,"aria-hidden":"true",children:d})]}),e&&o(Ui,{onClose:()=>t(!1)})]})},mt=e=>{const t=$();return te({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},sr=()=>{const e=$(),t=ne();return le(e.settings.set.mutationOptions({onSuccess:()=>{C.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:[M.settings]})},onError:n=>{C.error(`Failed to update setting: ${n.message}`)}}))},ir=ye(void 0),zi=()=>{const e=ge(ir);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},fe={x:-2.8,y:-2,w:48.6,h:14},Pt=15,xe={w:13.6,h:10.2},be=[{x:0,y:.5},{x:Pt,y:-.9},{x:Pt*2,y:.3}],cn={x:xe.w/2,y:xe.h/2-.5},gt={y:xe.h/2,x1:-2,x2:Pt*2+xe.w+1.4},ln=(e,t,n,r=0)=>{if(n.width<=0)return-1;const s=n.width/fe.w,i=(e-n.left)/s+fe.x,a=(t-n.top)/s+fe.y;for(let c=0;c<be.length;c++){const l=i-be[c].x,u=a-be[c].y;if(l>=-r&&l<=xe.w+r&&u>=-r&&u<=xe.h+r)return c}return-1},un=7.5,dn=e=>Math.max(-1,Math.min(1,e)),Gi=(e,t,n,r)=>{const s=n.width/fe.w,i=(e-n.left)/s+fe.x-r.x-cn.x,a=(t-n.top)/s+fe.y-r.y-cn.y;return{x:dn(i/un),y:dn(a/un)}},Ji=["normal","squint"],Yi={normal:.72,squint:.28},mn=(e=Math.random(),t)=>{let n=0;for(const r of Ji)if(n+=Yi[r],e<n)return r===t?r==="normal"?"squint":"normal":r;return"normal"},Zi="pet",Xi="sleep",ea=6e3,ta=420,na=.5,pn=3e3,ra=3e3,oa=be.map((e,t)=>t*260),vt={from:be.length-2,to:be.length-1,after:400},hn="data-dango-face",bt="data-dango-hover",wt="data-dango-cheer",fn="data-dango-nudge",sa=()=>document.querySelectorAll("svg[data-dango-gaze-origin]"),Je=()=>document.querySelectorAll("[data-dango-face-slot]"),ia=e=>e.querySelectorAll("[data-dango-eye]"),aa=()=>document.querySelectorAll("[data-dango-eye]"),ar=()=>{const{data:e}=mt("dangoGaze"),{lowEndMode:t}=zi();return e!=="false"&&!t},ca=()=>{const e=ar();_(()=>{if(!e||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const t=be.map(()=>"normal");let n=-1,r=-1,s=!1,i=-1,a=0,c=0,l=0,u=0,d=0;const m=[],p=(y,N)=>{const z=window.setTimeout(()=>{m.splice(m.indexOf(z),1),y()},N);m.push(z)},h=(y,N,z)=>{Je().forEach(se=>{Number(se.getAttribute("data-dango-face-slot"))===y&&(z?se.setAttribute(N,""):se.removeAttribute(N))})},f=y=>Je().forEach(N=>N.removeAttribute(y)),E=(y,N,z)=>{f(N),requestAnimationFrame(()=>{h(y,N,!0),p(()=>f(N),z)})},O=()=>{Je().forEach(y=>{const N=Number(y.getAttribute("data-dango-face-slot"));y.setAttribute(hn,r===N?Zi:t[N]),n===N?y.setAttribute(bt,""):y.removeAttribute(bt)})},T=y=>{y!==r&&(r>=0&&h(r,wt,!1),r=y,y>=0&&h(y,wt,!0))},w=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{T(-1),O()},ta)},b=()=>{window.clearTimeout(d),T(-1)},I=()=>{s=!1,oa.forEach((y,N)=>{p(()=>{t[N]=mn(),N===vt.from&&p(()=>E(vt.to,fn,520),vt.after),O()},y)})},Z=()=>{s=!0,t.fill(Xi),b(),O()},L=()=>{window.clearTimeout(u),u=window.setTimeout(Z,ea)},Q=()=>{s||(i=(i+1)%t.length,t[i]=mn(Math.random(),t[i]),O()),p(Q,pn+Math.random()*ra)},P=()=>{const y=Array.from(sa(),A=>[A,A.getBoundingClientRect()]);y.forEach(([A,me])=>{ia(A).forEach(Le=>{const{x:pt,y:He}=Gi(c,l,me,be[Number(Le.getAttribute("data-dango-eye"))]);Le.style.setProperty("--dango-gaze-x",pt.toFixed(3)),Le.style.setProperty("--dango-gaze-y",He.toFixed(3))})});const N=y.find(([,A])=>c>=A.left&&c<=A.right&&l>=A.top&&l<=A.bottom)?.[1]??null,z=n,se=r,U=N?ln(c,l,N):-1,F=U>=0?U:N?ln(c,l,N,na):-1;n=U,F>=0?(T(F),w()):b(),(z!==n||se!==r)&&O(),s&&I(),L()},q=y=>{c=y.clientX,l=y.clientY,!a&&(a=requestAnimationFrame(()=>{a=0,P()}))},H=y=>{y.relatedTarget||(n=-1,b(),O(),L())};return O(),L(),p(Q,pn),window.addEventListener("pointermove",q,{passive:!0}),window.addEventListener("pointerout",H),()=>{cancelAnimationFrame(a),window.clearTimeout(u),window.clearTimeout(d),m.forEach(window.clearTimeout),window.removeEventListener("pointermove",q),window.removeEventListener("pointerout",H),aa().forEach(y=>{y.style.removeProperty("--dango-gaze-x"),y.style.removeProperty("--dango-gaze-y")}),Je().forEach(y=>{y.setAttribute(hn,"normal"),y.removeAttribute(bt),y.removeAttribute(wt),y.removeAttribute(fn)})}},[e])},cr=ye(void 0),rd=()=>{const e=ge(cr);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},od=[{id:"iris",label:"Taro (default)",blurb:"Deep purple",swatch:"#7d6df0"},{id:"sakura",label:"Sakura",blurb:"Soft pink",swatch:"#e0b0e0"},{id:"mochi",label:"Mochi",blurb:"Monochrome pearl",swatch:"#f0f0f0"}],la={iris:{fill:"#897cff",stroke:"#5646db"},mochi:{fill:"#e3e1ee",stroke:"#b3b1c6"},sakura:{fill:"#e1afef",stroke:"#a978a9"}},ua="_logo_t3il2_1",da="_skewer_t3il2_8",ma="_gaze_t3il2_15",pa="_face_t3il2_20",ha="_faceNormal_t3il2_25",fa="_facePet_t3il2_26",ya="_faceSquint_t3il2_27",ga="_faceSleep_t3il2_28",va="_line_t3il2_36",ba="_sway_t3il2_44",wa="_weight_t3il2_58",_a="_shift_t3il2_73",Ea="_rock_t3il2_87",Sa="_glance_t3il2_105",ka="_blinkDouble_t3il2_129 _blink_t3il2_124",Ta="_blinkSlow_t3il2_153 _blink_t3il2_124",Pa="_bump_t3il2_172",Ia="_heart_t3il2_189",G={logo:ua,skewer:da,gaze:ma,face:pa,faceNormal:ha,facePet:fa,faceSquint:ya,faceSleep:ga,line:va,sway:ba,weight:wa,shift:_a,rock:Ea,glance:Sa,blinkDouble:ka,blinkSlow:Ta,bump:Pa,heart:Ia},yn="var(--logo-ink)",Na="m 7,0 c -3.9372984,0 -7.10030437,2.4883888 -7,6 0.13572675,4.751733 5.0802847,4.156395 7,4.156395 1.2538994,0 6.530451,0.392468 6.584946,-4.168088 C 13.622023,2.8853946 10.937298,0 7,0 Z",Ca="m 4.9623825,3.416 c -0.5858889,0 -0.6520292,2.3368563 -0.024765,2.3368563 0.6604959,0 0.6704653,-2.3368563 0.024765,-2.3368563 z",xa="M 8.588001,3.416 C 8.0021121,3.416 7.9359718,5.7528563 8.563236,5.7528563 9.2237319,5.7528563 9.2337013,3.416 8.588001,3.416 Z",Oa={pet:"M 4.85,5.15 Q 5.285,4.0 5.72,5.15 M 8.25,5.15 Q 8.618,4.0 8.99,5.15",squint:"M 4.82,3.9 L 5.6,4.62 L 4.82,5.34 M 9.08,3.9 L 8.3,4.62 L 9.08,5.34",sleep:"M 4.9,4.72 Q 5.285,5.28 5.67,4.72 M 8.25,4.72 Q 8.618,5.28 9.0,4.72"},lr=[{lag:.8,hue:"iris",blink:"double",motion:"weight",glances:!1},{lag:1.4,hue:"sakura",blink:"slow",motion:"shift",glances:!1},{lag:1,hue:"mochi",blink:"slow",motion:"rock",glances:!0}],Re=(e,t)=>e+Math.random()*(t-e),Aa=lr.map(()=>({blinkDelay:-Re(0,9),blinkDuration:Re(3.4,8.6),motionDelay:-Re(0,9),motionDuration:Re(5.5,11),glanceDelay:-Re(0,11)})),La={double:G.blinkDouble,slow:G.blinkSlow},Da={weight:G.weight,shift:G.shift,rock:G.rock},Ra={normal:G.faceNormal,pet:G.facePet,squint:G.faceSquint,sleep:G.faceSleep},$a=["normal","pet","squint","sleep"],qa=[{x:7,y:4.2,delay:0,drift:"0px"},{x:9.6,y:6.4,delay:-.3,drift:"-0.9px"},{x:4.6,y:6.1,delay:-.6,drift:"0.8px"},{x:8.2,y:3.4,delay:-.9,drift:"-0.4px"}],jt=({className:e})=>{const t=ar();return o("svg",{viewBox:`${fe.x} ${fe.y} ${fe.w} ${fe.h}`,className:e?`${G.logo} ${e}`:G.logo,role:"img","aria-label":"dango","data-dango-gaze-origin":"",children:o("g",{className:t?G.sway:void 0,children:[o("path",{className:G.skewer,d:`M ${gt.x1},${gt.y} H ${gt.x2}`}),lr.map((n,r)=>{const{x:s,y:i}=be[r],a=Aa[r],{fill:c,stroke:l}=la[n.hue],u=o("g",{"data-dango-eye":r,className:G.gaze,style:{"--gaze-dur":`${(.12+n.lag*.18).toFixed(3)}s`},children:$a.map(d=>o("g",{className:`${G.face} ${Ra[d]}`,children:o("g",{className:t&&d==="normal"?La[n.blink]:void 0,style:t&&d==="normal"?{animationDelay:`${a.blinkDelay}s`,animationDuration:`${a.blinkDuration}s`}:void 0,children:d==="normal"?o(ue,{children:[o("path",{fill:yn,d:Ca}),o("path",{fill:yn,d:xa})]}):o("path",{className:G.line,d:Oa[d]})})},d))});return o("g",{transform:`translate(${s} ${i})`,children:o("g",{"data-dango-face-slot":r,"data-dango-face":"normal",className:t?Da[n.motion]:void 0,style:t?{animationDelay:`${a.motionDelay}s`,animationDuration:`${a.motionDuration}s`}:void 0,children:[o("path",{fill:c,stroke:l,strokeWidth:"0.9",strokeLinejoin:"round",paintOrder:"stroke fill",d:Na}),o("g",{className:G.bump,children:[t&&n.glances?o("g",{className:G.glance,style:{animationDelay:`${a.glanceDelay}s`},children:u}):u,t&&o("g",{children:qa.map(d=>o("text",{className:G.heart,x:d.x,y:d.y,fill:"var(--color-danger)",style:{"--drift":d.drift,animationDelay:`${d.delay}s`},children:"♥"},d.x))})]})]})},n.hue)})]})})},ur=ye(void 0),Bt=()=>{const e=ge(ur);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},dr=ye(void 0),mr=()=>{const e=ge(dr);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},It="virtual-keyboard:hide",gn="virtual-keyboard:enabled-change",pr="virtual_keyboard_enabled",Ma=!1;function vn(){const e=X.getItem(pr);return e===null?Ma:e==="true"}const bn=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function ja(){window.dispatchEvent(new CustomEvent(It))}function Ba(){const[e,t]=v(!1),[n,r]=v(vn),s=j(null);return _(()=>{const i=d=>{n&&bn(d.target)&&(s.current=d.target,t(!0))},a=d=>{d.target===s.current&&window.setTimeout(()=>{if(bn(document.activeElement)){s.current=document.activeElement,t(!0);return}s.current=null,t(!1)},0)},c=()=>{s.current=null,t(!1)},l=d=>{if(d.key!==pr)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=vn();r(d),d||c()};return document.addEventListener("focusin",i),document.addEventListener("focusout",a),window.addEventListener(It,c),window.addEventListener("storage",l),window.addEventListener(gn,u),()=>{document.removeEventListener("focusin",i),document.removeEventListener("focusout",a),window.removeEventListener(It,c),window.removeEventListener("storage",l),window.removeEventListener(gn,u)}},[n]),{activeInputRef:s,isVisible:n&&e,hide:()=>t(!1)}}const Fa={queryKey:[M.syncProfile],queryFn:()=>Me("/api/profiles/current"),staleTime:3e4};function hr({image:e,name:t}){const[n,r]=v(!1);return _(()=>r(!1),[e]),e&&!n?o("img",{src:e,alt:t,referrerPolicy:"no-referrer",onError:()=>r(!0),style:{width:"100%",height:"100%",maxWidth:72,maxHeight:72,aspectRatio:"1",objectFit:"cover",borderRadius:"50%"}}):o("svg",{viewBox:"0 0 24 24",role:"img","aria-label":t,style:{width:"100%",height:"100%",maxWidth:72,maxHeight:72,aspectRatio:"1"},fill:"currentColor",children:[o("circle",{cx:"12",cy:"8",r:"4"}),o("path",{d:"M4 21v-2a8 8 0 0 1 16 0v2z"})]})}const Wa="_header_17c46_1",Ka="_hidden_17c46_22",Ha="_scrolled_17c46_26",Ua="_logo_17c46_38",Qa="_headerInner_17c46_54",Va="_leftSection_17c46_64",za="_desktopNav_17c46_70",Ga="_navLink_17c46_77",Ja="_navLinkActive_17c46_94",Ya="_rightSection_17c46_113",Za="_searchWrapper_17c46_119",Xa="_searchIconButton_17c46_146",ec="_searchIcon_17c46_146",tc="_searchInput_17c46_173",nc="_searchKbd_17c46_206",rc="_searchKbdHidden_17c46_224",oc="_searchButton_17c46_229",sc="_profileBtn_17c46_239",ic="_profileAvatar_17c46_274",ac="_profileName_17c46_281",cc="_hamburgerBtn_17c46_290",lc="_searchDropdown_17c46_323",uc="_searchDropdownNoBar_17c46_355",dc="_searchDropdownHeader_17c46_363",mc="_searchDropdownQuery_17c46_371",pc="_searchDropdownSeeAll_17c46_377",hc="_searchDropdownList_17c46_394",fc="_searchDropdownItem_17c46_408",yc="_searchDropdownThumb_17c46_426",gc="_searchDropdownItemInfo_17c46_435",vc="_searchDropdownItemTitle_17c46_442",bc="_searchDropdownItemMeta_17c46_451",wc="_mobileSearchBar_17c46_489",_c="_searchIconMobile_17c46_560",Ec="_mobileSearchBarHidden_17c46_587",Sc="_mobileSearchInner_17c46_604",kc="_mobileSearchIcon_17c46_620",Tc="_mobileSearchInput_17c46_627",S={header:Wa,hidden:Ka,scrolled:Ha,logo:Ua,headerInner:Qa,leftSection:Va,desktopNav:za,navLink:Ga,navLinkActive:Ja,rightSection:Ya,searchWrapper:Za,searchIconButton:Xa,searchIcon:ec,searchInput:tc,searchKbd:nc,searchKbdHidden:rc,searchButton:oc,profileBtn:sc,profileAvatar:ic,profileName:ac,hamburgerBtn:cc,searchDropdown:lc,searchDropdownNoBar:uc,searchDropdownHeader:dc,searchDropdownQuery:mc,searchDropdownSeeAll:pc,searchDropdownList:hc,searchDropdownItem:fc,searchDropdownThumb:yc,searchDropdownItemInfo:gc,searchDropdownItemTitle:vc,searchDropdownItemMeta:bc,mobileSearchBar:wc,searchIconMobile:_c,mobileSearchBarHidden:Ec,mobileSearchInner:Sc,mobileSearchIcon:kc,mobileSearchInput:Tc},Pc=()=>{const{toggleSidebar:e}=Bt(),{contentType:t}=mr(),n=$(),{titlePreference:r}=tr(),[s,i]=v(""),[a,c]=v(""),[l,u]=v(!0),[d,m]=v(!1),[p,h]=v(!0),[f,E]=v(!1),[O,T]=v(!1),w=xn(),b=at(),I=j(null),Z=j(!1),L=j(null),Q=j(null),P=j(null),q=j(null),H=j(!1),y=j(null),N=j(null),{data:z}=te(Fa),se=t==="anime",{data:U}=te({...n.data.search.queryOptions({query:a,page:1,limit:6}),enabled:se&&a.length>=2});_(()=>{const g=window.visualViewport;if(!g)return;const ie=()=>{q.current?.style.setProperty("--vv-top",`${g.offsetTop}px`)};return ie(),g.addEventListener("scroll",ie),g.addEventListener("resize",ie),()=>{g.removeEventListener("scroll",ie),g.removeEventListener("resize",ie)}},[]),_(()=>{const g=()=>{I.current&&(window.clearTimeout(I.current),I.current=null)},ie=()=>{g(),!(window.scrollY<=10||d)&&(I.current=window.setTimeout(()=>{H.current||u(!1)},2500))},Ht=()=>{Z.current||(Z.current=!0,L.current=requestAnimationFrame(()=>{Z.current=!1,L.current=null;const ae=window.scrollY<=10;h(_e=>_e===ae?_e:ae),u(_e=>_e||!0),ie()}))},Ut=ae=>{const _e=ae.target,Sr=_e instanceof HTMLElement&&!!_e.closest('input, textarea, select, button, a, [role="button"], [contenteditable="true"]'),zt=()=>{g(),u(!0),window.innerWidth<=1024?(E(!0),setTimeout(()=>P.current?.focus({preventScroll:!0}),50)):setTimeout(()=>F.current?.focus({preventScroll:!0}),10)};ae.key.toLowerCase()==="s"&&!ae.metaKey&&!ae.ctrlKey&&!ae.altKey&&!Sr||(ae.metaKey||ae.ctrlKey)&&ae.key==="k"?(ae.preventDefault(),zt()):ae.key==="Escape"&&document.activeElement===F.current&&F.current?.blur()},Qe=q.current,Qt=()=>{H.current=!0},Vt=()=>{H.current=!1,ie()};return window.addEventListener("scroll",Ht,{passive:!0}),window.addEventListener("keydown",Ut),Qe?.addEventListener("pointerenter",Qt),Qe?.addEventListener("pointerleave",Vt),()=>{window.removeEventListener("scroll",Ht),window.removeEventListener("keydown",Ut),Qe?.removeEventListener("pointerenter",Qt),Qe?.removeEventListener("pointerleave",Vt),g(),L.current!==null&&(cancelAnimationFrame(L.current),L.current=null),Z.current=!1}},[d]);const F=At.useRef(null);_(()=>{if(y.current&&window.clearTimeout(y.current),!s.trim()||s.trim().length<2){c(""),T(!1);return}return y.current=window.setTimeout(()=>{c(s.trim()),d&&se&&T(!0)},500),()=>{y.current&&window.clearTimeout(y.current)}},[s,d,se]);const A=V(()=>{T(!1)},[]);_(()=>{T(!1),E(!1)},[b.pathname,b.search]);const me=()=>window.innerWidth<=1024,Le=()=>{u(!0),me()?(E(!0),setTimeout(()=>P.current?.focus({preventScroll:!0}),50)):F.current?.focus({preventScroll:!0})},pt=g=>{Q.current?.contains(g.relatedTarget)||E(!1)},He=t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",ht=t==="manga"?{to:"/reading-list",label:"Reading List"}:t==="tv"?{to:"/tv-watchlist",label:"TV Watchlist"}:t==="asmr"?{to:"/listening-list",label:"Listening List"}:{to:"/watchlist",label:"Watchlist"},Ue=g=>{ja();const ie=s.trim();ie&&(A(),F.current?.blur(),m(!1),w(t==="manga"?`/manga?q=${encodeURIComponent(ie)}`:t==="tv"?`/tv-search?q=${encodeURIComponent(ie)}`:t==="asmr"?`/asmr?q=${encodeURIComponent(ie)}`:`/search?query=${encodeURIComponent(ie)}`))};return o(ue,{children:o("header",{ref:q,className:`${S.header} ${l?"":S.hidden} ${p?"":S.scrolled}`,children:[o("div",{className:S.headerInner,children:[o("div",{className:S.leftSection,children:[o("button",{className:S.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(x,{name:"bars"})}),o(ce,{to:"/",className:S.logo,"aria-label":"Ani-Web Home",children:o(jt,{})}),o("nav",{className:S.desktopNav,children:[o(ce,{to:"/",className:`${S.navLink} ${b.pathname==="/"?S.navLinkActive:""}`,children:"Home"}),o(ce,{to:ht.to,className:`${S.navLink} ${b.pathname.startsWith(ht.to)?S.navLinkActive:""}`,children:ht.label}),t==="anime"&&o(ce,{to:"/insights",className:`${S.navLink} ${b.pathname==="/insights"?S.navLinkActive:""}`,children:"Insights"}),o(ce,{to:"/settings",className:`${S.navLink} ${b.pathname.startsWith("/settings")?S.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:S.rightSection,children:[o("div",{className:S.searchWrapper,ref:N,onClick:()=>F.current?.focus(),children:[o("button",{type:"button",className:S.searchIconButton,"aria-label":"Search",onMouseDown:g=>g.preventDefault(),onClick:g=>{g.stopPropagation(),Ue()},children:o(x,{name:"search",className:S.searchIcon})}),o("input",{ref:F,type:"text","data-virtual-keyboard":"true",className:S.searchInput,placeholder:He,value:s,onChange:g=>i(g.currentTarget.value),onFocus:()=>{m(!0),u(!0),a.length>=2&&se&&T(!0)},onBlur:g=>{m(!1),N.current?.contains(g.relatedTarget)||A()},onKeyDown:g=>{g.key==="Enter"?Ue():g.key==="Escape"&&(A(),F.current?.blur())}}),o("span",{className:`${S.searchKbd} ${s||d?S.searchKbdHidden:""}`,"aria-hidden":"true",children:"Ctrl K"}),o("button",{type:"button",className:S.searchButton,"aria-label":"Search",onMouseDown:g=>g.preventDefault(),onClick:g=>{g.stopPropagation(),Le()},children:o(x,{name:"search",className:S.searchIconMobile})}),O&&U&&U.length>0&&o("div",{className:`${S.searchDropdown} ${f?"":S.searchDropdownNoBar}`,onMouseDown:g=>g.preventDefault(),onClick:g=>g.stopPropagation(),children:[o("div",{className:S.searchDropdownHeader,children:[o("span",{className:S.searchDropdownQuery,children:["Results for “",a,"”"]}),o("button",{className:S.searchDropdownSeeAll,onClick:()=>{A(),E(!1),m(!1),Ue()},children:"See all"})]}),o("div",{className:S.searchDropdownList,children:U.map(g=>o("button",{className:S.searchDropdownItem,onClick:()=>{A(),E(!1),m(!1),i(""),F.current?.blur(),w(`/anime/${g.id}`)},children:[g.thumbnail&&o("img",{src:Xn(g.thumbnail,48,64),alt:g.name,className:S.searchDropdownThumb,loading:"lazy",decoding:"async"}),o("div",{className:S.searchDropdownItemInfo,children:[o("span",{className:S.searchDropdownItemTitle,children:r==="nativeName"?g.nativeName||g.name:r==="englishName"&&g.englishName||g.name}),g.year&&o("span",{className:S.searchDropdownItemMeta,children:g.year})]})]},g.id))})]})]}),o(Vi,{}),o(ce,{to:"/settings",className:S.profileBtn,"aria-label":`${z?.name??"Profile"} — profile settings`,title:`${z?.name??"Profile"}${z?.owner?" (owner)":""} — profile settings`,children:[o("span",{className:S.profileAvatar,"aria-hidden":"true",children:o(hr,{image:z?.image,name:z?.name??"Profile"})}),o("span",{className:S.profileName,children:z?.name??"Profile"})]})]})]}),f&&o("div",{className:`${S.mobileSearchBar} ${l?"":S.mobileSearchBarHidden}`,ref:Q,onBlur:pt,children:o("div",{className:S.mobileSearchInner,children:[o(x,{name:"search",className:S.mobileSearchIcon}),o("input",{ref:P,type:"text","data-virtual-keyboard":"true",className:S.mobileSearchInput,placeholder:He,value:s,onChange:g=>i(g.currentTarget.value),onFocus:()=>{m(!0),u(!0)},onBlur:()=>m(!1),onKeyDown:g=>{g.key==="Enter"?(Ue(),E(!1),m(!1)):g.key==="Escape"&&(E(!1),m(!1))}})]})})]})})},Nt="agreedToViewMature";function Ct(){try{return X.getItem(Nt)==="true"}catch{return!1}}const qe=new Set;function fr(e){for(const t of qe)t(e)}function Ye(){fr(Ct())}function wn(e){try{e?X.setItem(Nt,"true"):X.removeItem(Nt)}catch{}fr(e)}function Ic(){const[e,t]=v(Ct);_(()=>(qe.add(t),qe.size===1&&(window.addEventListener("storage",Ye),window.addEventListener("focus",Ye)),t(Ct()),()=>{qe.delete(t),qe.size===0&&(window.removeEventListener("storage",Ye),window.removeEventListener("focus",Ye))}),[]);const n=V(()=>wn(!0),[]),r=V(()=>wn(!1),[]);return{hasConsent:e,grant:n,revoke:r}}const Nc="_sidebar_153jc_1",Cc="_open_153jc_20",xc="_sidebarHeader_153jc_25",Oc="_closeBtn_153jc_33",Ac="_logo_153jc_57",Lc="_navSection_153jc_69",Dc="_navLink_153jc_75",Rc="_active_153jc_108",$c="_overlay_153jc_118",qc="_versionInfo_153jc_138",pe={sidebar:Nc,open:Cc,sidebarHeader:xc,closeBtn:Oc,logo:Ac,navSection:Lc,navLink:Dc,active:Rc,overlay:$c,versionInfo:qc},Mc="3.8.5",yr={version:Mc},jc=()=>{const{isOpen:e,setIsOpen:t}=Bt(),{contentType:n}=mr(),{hasConsent:r}=Ic(),s=()=>{t(!1)},i=n==="manga",a=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(x,{name:"home"}),label:"Home"},i?{to:"/manga",icon:o(x,{name:"book"}),label:"Manga"}:a?{to:"/tv-search",icon:o(x,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(x,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(x,{name:"search"}),label:"Search"},i?{to:"/reading-list",icon:o(x,{name:"bookmark"}),label:"Reading List"}:a?{to:"/tv-watchlist",icon:o(x,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(x,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(x,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(x,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(x,{name:"sync-alt"}),label:"Trackers"},...n==="anime"||a?[{to:"/watch-along",icon:o(x,{name:"play"}),label:"Watch along"}]:[],...r?[{to:"/mature",icon:o(x,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(x,{name:"cog"}),label:"Settings"}];return o(ue,{children:[o("aside",{className:`${pe.sidebar} ${e?pe.open:""} sidebar`,children:[o("div",{className:pe.sidebarHeader,children:[o("button",{className:pe.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(ce,{to:"/",className:pe.logo,onClick:s,children:o(jt,{})})]}),o("nav",{className:pe.navSection,children:l.map(u=>o(Tr,{to:u.to,className:({isActive:d})=>`${pe.navLink} ${d?pe.active:""}`,onClick:s,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:pe.versionInfo,children:["v",yr.version]})]}),e&&o("div",{className:pe.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},Bc="_footer_1c905_1",Fc="_footerInner_1c905_15",Wc="_brandSection_1c905_27",Kc="_logoRow_1c905_39",Hc="_logoText_1c905_45",Uc="_brandMeta_1c905_51",Qc="_brandTagline_1c905_60",Vc="_statusPill_1c905_67",zc="_statusDot_1c905_80",Gc="_linksGrid_1c905_88",Jc="_linkColumn_1c905_96",Yc="_columnTitle_1c905_102",Zc="_bottomBar_1c905_126",Xc="_copyright_1c905_136",el="_brand_1c905_27",tl="_heartIcon_1c905_152",nl="_backToTop_1c905_157",B={footer:Bc,footerInner:Fc,brandSection:Wc,logoRow:Kc,logoText:Hc,brandMeta:Uc,brandTagline:Qc,statusPill:Vc,statusDot:zc,linksGrid:Gc,linkColumn:Jc,columnTitle:Yc,bottomBar:Zc,copyright:Xc,brand:el,heartIcon:tl,backToTop:nl},rl=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:B.footer,children:[o("div",{className:B.footerInner,children:[o("div",{className:B.brandSection,children:[o("div",{className:B.logoRow,children:o(jt,{className:B.logoText})}),o("div",{className:B.brandMeta,children:[o("div",{className:B.statusPill,children:[o("span",{className:B.statusDot}),o("span",{children:["v",yr.version]})]}),o("p",{className:B.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:B.linksGrid,children:[o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Navigation"}),o(ce,{to:"/",children:"Home"}),o(ce,{to:"/watchlist",children:"Watchlist"}),o(ce,{to:"/settings",children:"Settings"})]}),o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Features"}),o(ce,{to:"/search",children:"Search Anime"}),o(ce,{to:"/trackers",children:"Trackers"}),o(ce,{to:"/insights",children:"Insights"})]}),o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/6yT3VwTqz9",target:"_blank",rel:"noopener noreferrer",children:[o(x,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(x,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:B.linkColumn,children:[o("h4",{className:B.columnTitle,children:"Project"}),o("a",{href:"https://github.com/serifpersia/dango/releases",target:"_blank",rel:"noopener noreferrer",children:"Releases"}),o("a",{href:"https://github.com/serifpersia/dango/issues",target:"_blank",rel:"noopener noreferrer",children:"Feedback"})]})]})]}),o("div",{className:B.bottomBar,children:[o("p",{className:B.copyright,children:["© ",e," ",o("span",{className:B.brand,children:"dango"})," • Crafted with"," ",o(x,{name:"heart",className:B.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:B.backToTop,onClick:t,"aria-label":"Back to top",children:[o(x,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})};function gr(e){return JSON.stringify({0:e??{}})}function vr(e){return`/api/trpc/${e}?batch=1&_profile=${encodeURIComponent(Gn())}`}function xt(e,t){const n=gr(t),r=vr(e);try{if(navigator.sendBeacon){navigator.sendBeacon(r,new Blob([n],{type:"application/json"}));return}}catch{}fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}async function sd(e,t){const n=await fetch(vr(e),{method:"POST",headers:{"Content-Type":"application/json"},body:gr(t),keepalive:!0});if(!n.ok)throw new Error(`tRPC request failed (HTTP ${n.status})`)}function id(e){e&&(xt("discord.clear",{sessionId:e}),xt("discord.heartbeat",{sessionId:e,bye:!0}))}function ol(){const e=at(),{data:t}=mt("discordRPCEnabled"),n=j("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),_(()=>{if(t===!1||t==="false")return;const r=n.current,s=()=>de.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});s();const i=setInterval(s,15e3),a=()=>{xt("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",a),()=>{clearInterval(i),window.removeEventListener("pagehide",a)}},[t]),_(()=>{if(t===!1||t==="false")return;const r=e.pathname;if(r.startsWith("/watch/")||r.startsWith("/player/"))return;let s="home";r.startsWith("/search")||r.startsWith("/mature")?s="search":r.startsWith("/watchlist")?s="watchlist":r.startsWith("/anime/")?s="anime":r.startsWith("/insights")?s="insights":r.startsWith("/settings")?s="settings":r.startsWith("/trackers")?s="trackers":r.startsWith("/asmr")?s="asmr":r.startsWith("/manga")?s="manga":r.startsWith("/tv")&&(s="tv"),de.discord.pageStatus.mutate({page:s}).catch(()=>{})},[e.pathname,t])}function Ft(e,t){const[n,r]=v(()=>{try{const i=X.getItem(e);if(i===null)return t;if(typeof t=="string")return i;try{return JSON.parse(i)}catch{return i}}catch{return t}});_(()=>{const i=a=>{if(a.key===X.keyFor(e))try{if(a.newValue===null){r(t);return}if(typeof t=="string"){r(a.newValue);return}try{r(JSON.parse(a.newValue))}catch{r(a.newValue)}}catch{}};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[e,t]);const s=V(i=>{r(a=>{const c=typeof i=="function"?i(a):i;try{typeof c=="string"?X.setItem(e,c):X.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[n,s]}const br=ye(void 0),sl=()=>{const e=ge(br);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},il="_container_e96gf_1",al="_field_e96gf_9",cl="_textarea_e96gf_20",ll="_input_e96gf_40",ul="_button_e96gf_58",dl="_secondaryButton_e96gf_78",ml="_actions_e96gf_95",pl="_hint_e96gf_104",hl="_link_e96gf_117",re={container:il,field:al,textarea:cl,input:ll,button:ul,secondaryButton:dl,actions:ml,hint:pl,link:hl},fl="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",yl=e=>{try{return JSON.parse(e.detail)}catch{return null}},gl=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,s]=v(1),[i,a]=v(navigator.userAgent),[c,l]=v(""),[u,d]=v(!1),m=j(null),p=navigator.userAgent,h=/android/i.test(p),f=/firefox|fxios/i.test(p)&&!h,E=!f&&!h&&/chrome|chromium|edg|brave/i.test(p),O=f||E;_(()=>{e&&(s(1),a(navigator.userAgent),l(""),d(!1))},[e]),_(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const T=()=>{window.open("https://animepahe.pw","_blank","noopener,noreferrer"),s(2)},w=()=>{if(u)return;d(!0);const I=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,Z=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),C.error("Helper not detected - install it via about:debugging first.")},3e3),L=Q=>{const P=yl(Q);if(!(!P||P.requestId!==I))if(window.clearTimeout(Z),window.removeEventListener("dango:pahe-cookie",L),m.current=null,d(!1),P?.ok&&P.cookie)l(P.cookie),C.success("Cookie extracted from helper!");else if(P?.error==="NO_COOKIE"){const q=P.debug?.stores?.length??0,H=P.debug?.names??[];C.error(`Helper found no cf_clearance (checked ${q} stores, saw: ${H.join(", ")||"none"}) - solve the challenge on the AnimePahe tab first.`)}else C.error("Helper request failed - try again.")};m.current=L,window.addEventListener("dango:pahe-cookie",L),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie",{detail:{requestId:I}}))},b=()=>{const I=c.trim();if(!I){C.error("Please enter the cf_clearance cookie");return}try{X.setItem("animepahe_ua",i),X.setItem("animepahe_cookie",I),C.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{C.error("Failed to save cookie")}};return o(Ae,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:re.container,children:r===1?o(ue,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:re.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:i,readOnly:!0,rows:3,className:re.textarea})]}),o("div",{className:re.actions,children:[o("button",{className:re.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:re.button,onClick:T,children:"Start Verification (Opens AnimePahe)"})]})]}):o(ue,{children:[o("p",{children:["1. Solve the challenge on the ",o("strong",{children:"AnimePahe tab"})," (keep that tab open).",o("br",{}),"2. Copy the ",o("strong",{children:"cf_clearance"})," cookie value using one of these:",o("br",{}),o("br",{}),o("strong",{children:"Chrome / Edge — DevTools:"})," press ",o("code",{children:"F12"})," →"," ",o("strong",{children:"Application"})," → ",o("strong",{children:"Cookies"})," →"," ",o("code",{children:"https://animepahe.pw"}),". Find ",o("strong",{children:"cf_clearance"}),", double-click its ",o("strong",{children:"Value"})," to select it, then copy.",o("br",{}),o("br",{}),o("strong",{children:"Firefox — Storage Inspector:"})," press ",o("code",{children:"F12"})," →"," ",o("strong",{children:"Storage"})," → ",o("strong",{children:"Cookies"})," →"," ",o("code",{children:"https://animepahe.pw"}),". Find ",o("strong",{children:"cf_clearance"}),", right-click the value → ",o("strong",{children:"Copy Value"}),".",o("br",{}),o("br",{}),o("strong",{children:"Either browser — extension:"})," open"," ",o("strong",{children:"Cookie Manager"})," while on the AnimePahe tab, find"," ",o("strong",{children:"cf_clearance"}),", and copy its value (or use the extension's export).",o("br",{}),o("br",{}),"3. Paste it below. Copy ",o("strong",{children:"only the value"})," — remove any"," ",o("code",{children:"cf_clearance="})," prefix or quotes if they were included."]}),O&&o("div",{className:re.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",f?o(ue,{children:["type ",o("code",{children:"about:debugging"})," in the address bar →"," ",o("strong",{children:"This Firefox"})," → ",o("strong",{children:"Load Temporary Add-on"})," ","→ open the ",o("code",{children:"dango-extension/firefox"})," folder and pick"," ",o("code",{children:"manifest.json"}),". (Temporary helpers unload when Firefox closes - repeat after a restart.)"]}):o(ue,{children:["type ",o("code",{children:"chrome://extensions"})," in the address bar → enable"," ",o("strong",{children:"Developer mode"})," → ",o("strong",{children:"Load unpacked"})," → open the ",o("code",{children:"dango-extension/chrome"})," folder. (Unpacked helpers show a developer-mode notice - expected.)"]})," ","Use this link to download the extension and extract it:"," ",o("a",{href:fl,target:"_blank",rel:"noreferrer",className:re.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:re.actions,children:o("button",{className:re.button,onClick:w,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:re.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:I=>l(I.currentTarget.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:re.input})]}),o("div",{className:re.actions,children:[o("button",{className:re.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:re.secondaryButton,onClick:()=>s(1),children:"Back"}),o("button",{className:re.button,onClick:b,children:"Submit"})]})]})})})};function _n(){const[e,t]=v(!1);return _(()=>{const n=window.setTimeout(()=>t(!0),120);return()=>window.clearTimeout(n)},[]),e?o("div",{className:"top-progress-bar",role:"progressbar","aria-label":"Loading"}):null}const vl="_screen_1pca0_1",bl="_icon_1pca0_14",wl="_title_1pca0_20",_l="_text_1pca0_24",El="_button_1pca0_29",$e={screen:vl,icon:bl,title:wl,text:_l,button:El};async function Sl(e,t){const n={message:e.message,stack:e.stack,componentStack:t.componentStack,url:typeof window<"u"?window.location.href:"",timestamp:new Date().toISOString()},r=JSON.stringify(n);try{if(navigator.sendBeacon){navigator.sendBeacon("/api/internal/client-error",new Blob([r],{type:"application/json"}));return}}catch{}fetch("/api/internal/client-error",{method:"POST",headers:{"Content-Type":"application/json"},body:r,keepalive:!0}).catch(()=>{})}class kl extends Pr{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),Sl(t,n)}render(){return this.state.hasError?o("div",{className:$e.screen,children:[o(x,{name:"exclamation-triangle",className:$e.icon}),o("h1",{className:$e.title,children:"Something went wrong"}),o("p",{className:$e.text,children:"The application encountered an unexpected error."}),o("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},className:$e.button,children:[o(x,{name:"home"}),"Go back Home"]})]}):this.props.children}}const wr=ye(void 0),Tl=()=>{const e=ge(wr);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Pl=({children:e})=>{const[t,n]=v(!1),r=V(()=>n(!0),[]),s=V(()=>n(!1),[]);return _(()=>zn("lan",r),[r]),o(wr.Provider,{value:{isOpen:t,openModal:r,closeModal:s},children:e})},Il="_container_88bss_1",Nl="_field_88bss_8",Cl="_input_88bss_19",xl="_actions_88bss_37",Ze={container:Il,field:Nl,input:Cl,actions:xl},it=Ir(({variant:e="primary",size:t="md",loading:n,children:r,className:s="",disabled:i,...a},c)=>{const l=ri("btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",s);return o("button",{className:l,disabled:i||n,ref:c,...a,children:n?o("span",{className:"btn-spinner"}):r})}),_r=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,s]=v(""),[i,a]=v(!1);At.useEffect(()=>{e&&s("")},[e]);const c=async()=>{if(!r){C.error("Please enter your password");return}a(!0);try{const l=await qt("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})}),u=await l.json().catch(()=>({}));if(!l.ok){C.error(u.error||"Login failed");return}C.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{C.error("Network error")}finally{a(!1)}};return o(Ae,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:Ze.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:Ze.field,children:[o("label",{htmlFor:"lan-password",children:"Password"}),o("input",{id:"lan-password",type:"password",value:r,onChange:l=>s(l.currentTarget.value),placeholder:"Enter password...",className:Ze.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:Ze.actions,children:[o(it,{variant:"secondary",onClick:t,disabled:i,children:"Cancel"}),o(it,{variant:"primary",onClick:c,loading:i,children:"Unlock"})]})]})})},Ol="_notice_1d75r_1",Al={notice:Ol},Ll=2600,Dl=1e4,Rl={anilist:"Updating AniList…",mal:"Updating MyAnimeList…"};function $l({enabled:e=!0}){const[t,n]=v(!1),[r,s]=v("mal"),[i,a]=v(document.fullscreenElement);return _(()=>{const c=()=>a(document.fullscreenElement);return document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)},[]),_(()=>{if(!e||typeof EventSource>"u")return;const c=new EventSource("/api/tracker/activity"),l=new Map;let u;const d=new Set;let m=-1/0;const p=h=>{let f;try{f=JSON.parse(h.data)}catch{return}const E=f.provider;E!=="anilist"&&E!=="mal"||(f.updating===!0?(clearTimeout(l.get(E)),d.size===0&&Date.now()-m>=Dl&&(m=Date.now(),s(E),n(!0),clearTimeout(u),u=setTimeout(()=>n(!1),Ll)),d.add(E)):f.updating===!1&&(clearTimeout(l.get(E)),l.set(E,setTimeout(()=>d.delete(E),1500))))};return c.addEventListener("tracker-activity",p),()=>{c.removeEventListener("tracker-activity",p),c.close(),clearTimeout(u);for(const h of l.values())clearTimeout(h);n(!1)}},[e]),!e||!t?null:Cn(o("div",{className:Al.notice,role:"status","aria-live":"polite","aria-atomic":"true",children:[o(x,{name:r==="anilist"?"anilist":"myanimelist",size:15}),o("span",{children:Rl[r]})]}),i||document.body)}const ql=W(()=>K(()=>import("./Home-BQK51s69.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Ml=W(()=>K(()=>import("./Watchlist-Bwh35S5A.js"),__vite__mapDeps([34,1,2,4,10,11,12,5,13,3,6,7,8,9,14,15,16,17,18,35,36,37,38,39]))),jl=W(()=>K(()=>import("./Settings-BWXmAzt8.js"),__vite__mapDeps([40,1,2,4,41,42,7,8,43]))),En=W(()=>K(()=>import("./Player-D3cSsrYy.js"),__vite__mapDeps([44,1,45,4,46,2,47,14,48,7,8,6,20,21,12,5,13,27,49,50,51,52,53,54,55]))),Bl=W(()=>K(()=>import("./WatchAlong-KYPcweoT.js"),__vite__mapDeps([56,1,53,54,2,4]))),Fl=W(()=>K(()=>import("./Search-Ma_U--_p.js"),__vite__mapDeps([57,1,4,3,5,6,7,8,9,10,11,2,12,13,14,15,16,17,18,37,38,58,59]))),Wl=W(()=>K(()=>import("./Mature-eyCcjCLK.js"),__vite__mapDeps([60,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,27,58,59,61]))),Sn=W(()=>K(()=>import("./Asmr-VRahW3BN.js"),__vite__mapDeps([62,1,4,2,41,42,7,8,3,5,6,9,32,24,63,25,45,46,64,65,66]))),Kl=W(()=>K(()=>import("./Manga-4XqXRRq7.js"),__vite__mapDeps([67,1,4,41,42,7,8,17,18,3,5,6,9,22,23,2,24,25,27,68,69,64,65]))),Hl=W(()=>K(()=>import("./MangaInfoPage-BSj5R5c3.js"),__vite__mapDeps([70,1,4,17,18,23,2,24,68,69,64,65]))),Ul=W(()=>K(()=>import("./MangaReadPage-BpJNfRcn.js"),__vite__mapDeps([71,1,17,4,18,2,23,24,68,69,64,65]))),Ql=W(()=>K(()=>import("./ReadingList-BWT_0y7B.js"),__vite__mapDeps([72,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,22,23,2,24,25,26,19]))),kn=W(()=>K(()=>import("./TvSearch-BlrNDENc.js"),__vite__mapDeps([74,1,4,3,5,6,7,8,9,28,29,30,2,24,15,16,17,18,58,59]))),Vl=W(()=>K(()=>import("./TvInfo-C6k13aZL.js"),__vite__mapDeps([75,1,4,30,2,24,76]))),zl=W(()=>K(()=>import("./Tv-3U6AQcKB.js"),__vite__mapDeps([77,1,45,4,46,2,47,14,48,78,7,8,27,30,24,6,51,52,53,54,79]))),Gl=W(()=>K(()=>import("./TvWatchlist-l6N6tOjK.js"),__vite__mapDeps([80,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,19,29,30,2,24]))),Jl=W(()=>K(()=>import("./ListeningList-C_hDyuFM.js"),__vite__mapDeps([81,1,3,4,5,6,7,8,9,73,15,16,17,18,35,36,32,2,24,63,25,31,19]))),Yl=W(()=>K(()=>import("./Trackers-CyZCgKDv.js"),__vite__mapDeps([82,1,2,4,83]))),Zl=W(()=>K(()=>import("./Insights-2Ei1ZfVV.js"),__vite__mapDeps([84,1,2,4,85]))),Xl=W(()=>K(()=>import("./AnimeInfoPage-DYic1q9k.js"),__vite__mapDeps([86,1,2,4]))),eu=W(()=>K(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([87,1]))),tu=W(()=>K(()=>import("./VirtualKeyboard-CG5L_RyF.js"),__vite__mapDeps([88,1,2,4,89])));function nu(){ca();const{isOpen:e,closeModal:t,onSuccess:n}=sl(),{isOpen:r,setIsOpen:s}=Bt(),{isOpen:i,openModal:a,closeModal:c}=Tl(),l=at(),u=Nr(),d=j(new Map),m=j(l.pathname),p=j(l.key),h=j(null),[f,E]=v(!1),O=Ba();ol();const[T,w]=v(!1);_(()=>{const L=new AbortController;return Me("/api/auth/app-status",{signal:L.signal}).then(Q=>{Q.hasPassword&&!Q.isAuthenticated&&(w(!0),a())}).catch(()=>{L.signal.aborted||C.error("Could not check server access. The server may still be starting; reload to retry.")}),()=>L.abort()},[a]);const[b,I]=Ft("lan_auth_notice_shown","false"),Z=j(!1);return _(()=>{if(b==="true"||Z.current)return;Z.current=!0,I("true");const L=setTimeout(()=>{C("Optional LAN lock is available. Set a password in Settings to protect access from other devices on your network.",{duration:1e4,icon:"🔒"})},3e3);return()=>clearTimeout(L)},[b,I]),_(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),_(()=>{const L=l.key,Q=d.current;if(u==="POP"){const P=Q.get(L)??0;window.scrollTo({top:P,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{Q.set(L,window.scrollY)}},[l.key,l.pathname,u]),_(()=>{const L=()=>{E(!0),h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{E(!1),h.current=null},1e4)},Q=q=>{if(q.defaultPrevented||q.button!==0||q.metaKey||q.ctrlKey||q.shiftKey||q.altKey)return;const H=q.target;if(!(H instanceof Element))return;const y=H.closest("a[href]");if(!y||y.hasAttribute("download")||y.getAttribute("target")==="_blank")return;const N=new URL(y.href,window.location.href);N.origin===window.location.origin&&`${N.pathname}${N.search}${N.hash}`!=`${window.location.pathname}${window.location.search}${window.location.hash}`&&L()},P=()=>L();return document.addEventListener("click",Q,!0),window.addEventListener("popstate",P),()=>{document.removeEventListener("click",Q,!0),window.removeEventListener("popstate",P),h.current!==null&&(window.clearTimeout(h.current),h.current=null)}},[]),_(()=>{p.current!==l.key&&(p.current=l.key,f&&(h.current!==null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>{E(!1),h.current=null},500)))},[l.key,f]),_(()=>{const L=Q=>{r&&Q.key==="Escape"&&s(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L),document.body.classList.remove("sidebar-open")}},[r,s]),o("div",{className:"app-container",children:[o(gl,{isOpen:e,onClose:t,onSuccess:n}),o(_r,{isOpen:i,onClose:T?()=>{}:c,onSuccess:()=>{w(!1),c()}}),o(Mn,{position:"top-center",toastOptions:{style:{background:"var(--bg-elevated)",color:"var(--text-primary)",border:"1px solid var(--border-primary)"},success:{style:{background:"var(--accent)",color:"var(--accent-text)"},iconTheme:{primary:"var(--accent-text)",secondary:"var(--accent)"}},error:{style:{background:"rgba(153, 42, 42, 0.95)",color:"#fff"}}}}),f&&o(_n,{}),o($l,{enabled:!T&&!i}),o(Pc,{}),o(jc,{}),o("main",{className:"main-content",children:o(kl,{children:o(Gt,{fallback:o(_n,{}),children:o(Cr,{children:[o(R,{path:"/",element:o(ql,{})}),o(R,{path:"/watchlist/:filter?",element:o(Ml,{})}),o(R,{path:"/reading-list/:filter?",element:o(Ql,{})}),o(R,{path:"/search",element:o(Fl,{})}),o(R,{path:"/mature",element:o(Wl,{})}),o(R,{path:"/asmr",element:o(Sn,{})}),o(R,{path:"/asmr/:rj",element:o(Sn,{})}),o(R,{path:"/manga",element:o(Kl,{})}),o(R,{path:"/manga/:provider/:id",element:o(Hl,{})}),o(R,{path:"/manga/:provider/:id/read",element:o(Ul,{})}),o(R,{path:"/tv",element:o(kn,{})}),o(R,{path:"/tv/:id",element:o(Vl,{})}),o(R,{path:"/tv/:id/watch",element:o(zl,{})}),o(R,{path:"/tv-search",element:o(kn,{})}),o(R,{path:"/tv-watchlist/:filter?",element:o(Gl,{})}),o(R,{path:"/listening-list/:filter?",element:o(Jl,{})}),o(R,{path:"/settings",element:o(jl,{})}),o(R,{path:"/trackers",element:o(Yl,{})}),o(R,{path:"/mal",element:o(Jt,{to:"/trackers",replace:!0})}),o(R,{path:"/insights",element:o(Zl,{})}),o(R,{path:"/anime/:id",element:o(Xl,{})}),o(R,{path:"/watch/:id",element:o(En,{})}),o(R,{path:"/watch-along",element:o(Bl,{})}),o(R,{path:"/watch/:id/:episodeNumber",element:o(En,{})}),o(R,{path:"/player/:id/:episodeNumber?",element:o(eu,{})}),o(R,{path:"*",element:o(Jt,{to:"/",replace:!0})})]})})})}),o(rl,{}),O.isVisible&&o(Gt,{fallback:null,children:o(tu,{activeInputRef:O.activeInputRef,isVisible:O.isVisible,onClose:O.hide})})]})}function ru(){return o(Pl,{children:o(nu,{})})}const ou=({children:e})=>{const[t,n]=v(!1),r=V(()=>{n(i=>!i)},[]),s=Oe(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(ur.Provider,{value:s,children:e})},su=({children:e})=>{const[t,n]=Ft("dango_content_type","anime"),r=Oe(()=>({contentType:t,setContentType:n}),[t,n]);return o(dr.Provider,{value:r,children:e})},iu=({children:e})=>{const[t,n]=v("englishName"),[r,s]=v(!0);_(()=>{(async()=>{try{const c=await de.settings.getByKey.query({key:"titlePreference"});c.value&&n(c.value)}catch(c){console.error("Error fetching title preference in context:",c)}finally{s(!1)}})()},[]);const i=Oe(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(er.Provider,{value:i,children:e})},au=({children:e})=>{const{data:t,isLoading:n}=mt("lowEndMode"),r=sr(),s=ne(),[i,a]=v(!1);_(()=>{const u=s.getDefaultOptions();s.setDefaultOptions({...u,queries:{...u.queries,gcTime:i?900*1e3:1800*1e3}})},[i,s]),_(()=>{t!==void 0&&a(t==="true"||t===!0)},[t]),_(()=>{i?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[i]);const c=V(u=>{a(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=Oe(()=>({lowEndMode:i,setLowEndMode:c,loading:n}),[i,c,n]);return o(ir.Provider,{value:l,children:e})},cu=["iris","mochi","sakura"];function Tn(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const lu=({children:e})=>{const{data:t,isLoading:n}=mt("theme"),r=sr(),[s,i]=v("iris");_(()=>{typeof t=="string"&&cu.includes(t)&&i(t)},[t]),_(()=>{Tn(s)},[s]);const a=V(l=>{l!==s&&(i(l),Tn(l),r.mutate({key:"theme",value:l}))},[r,s]),c=Oe(()=>({theme:s,setTheme:a,loading:n}),[s,a,n]);return o(cr.Provider,{value:c,children:e})},uu=({children:e})=>{const[t,n]=v(!1),[r,s]=v(void 0),i=V(c=>{s(()=>c),n(!0)},[]),a=V(()=>{n(!1),s(void 0)},[]);return _(()=>zn("animepahe",()=>i()),[i]),o(br.Provider,{value:{isOpen:t,openModal:i,closeModal:a,onSuccess:r},children:e})},du="_gate_rmllo_1",mu="_panel_rmllo_10",pu="_form_rmllo_18",hu="_field_rmllo_31",fu="_avatarRow_rmllo_48",yu="_uploadButton_rmllo_60",gu="_fileInput_rmllo_89",vu="_profileList_rmllo_102",bu="_smallAvatar_rmllo_115",wu="_profileName_rmllo_120",Ne={gate:du,panel:mu,form:pu,field:hu,avatarRow:fu,uploadButton:yu,fileInput:gu,profileList:vu,smallAvatar:bu,profileName:wu};function _u({children:e}){const[t,n]=v(!1),[r,s]=v(!1),[i,a]=v([]),[c,l]=v(""),[u,d]=v(""),[m,p]=v(""),[h,f]=v(!1),[E,O]=v(0);if(_(()=>{let w=!1;return p(""),(async()=>{const I=await Me("/api/auth/app-status");if(w)return;if(I.hasPassword&&!I.isAuthenticated){s(!0);return}const Z=await Me("/api/profiles/status");w||(Z.current?(js(Z.current.id),n(!0)):(a(Z.profiles),l(Z.profiles[0]?.id??"")))})().catch(I=>{w||p(I.message)}),()=>{w=!0}},[E]),_(()=>{const w=I=>{I.key==="dango:profile-session-change"&&window.location.reload()},b=()=>{n(!1),O(I=>I+1)};return window.addEventListener("storage",w),window.addEventListener("dango:profile-auth-required",b),()=>{window.removeEventListener("storage",w),window.removeEventListener("dango:profile-auth-required",b)}},[]),t)return e;const T=i.find(w=>w.id===c);return o("div",{className:Ne.gate,children:[o(Mn,{}),o(_r,{isOpen:r,onClose:()=>{},onSuccess:()=>{s(!1),O(w=>w+1)}}),o("section",{className:Ne.panel,children:[o("h1",{children:i.length?"Choose your profile":"Connecting to Dango…"}),T&&o(ue,{children:[o("div",{className:Ne.avatarRow,children:o(hr,{image:T.avatar??T.cloudAvatar,name:T.name})}),o("form",{className:Ne.form,onSubmit:async w=>{w.preventDefault(),f(!0),p("");try{await Me("/api/profiles/login",{method:"POST",body:JSON.stringify({id:c,password:u})}),Fs()}catch(b){p(b.message),f(!1)}},children:[o("label",{className:Ne.field,children:["Profile",o("select",{value:c,onChange:w=>{l(w.currentTarget.value),d(""),p("")},children:i.map(w=>o("option",{value:w.id,children:[w.name,w.owner?" (owner)":""]},w.id))})]}),T.protected&&o("label",{className:Ne.field,children:["Password",o("input",{type:"password",autoComplete:"current-password",required:!0,maxLength:256,value:u,onChange:w=>d(w.currentTarget.value)})]}),o(it,{type:"submit",loading:h,children:"Continue"})]})]}),m&&o(ue,{children:[o("p",{role:"alert",children:m}),o(it,{variant:"secondary",onClick:()=>O(w=>w+1),children:"Retry"})]})]})]})}const Er=ye(null);function ad(){const e=ge(Er);if(!e)throw new Error("WatchAlongProvider is missing");return e}const Eu=/^[0-9a-f-]{36}$/,Su=/^[0-9a-f]{64}$/;function cd(e,t){return(e.kind??"anime")===(t.kind??"anime")&&e.season===t.season&&e.showId===t.showId&&e.episode===t.episode&&e.provider===t.provider&&e.mode===t.mode&&e.source===t.source}function ld(e,t){return e.position+(e.playing?Math.max(0,t-e.updatedAt)/1e3*e.rate:0)}const Wt=e=>String(e).toLowerCase()==="movie"?"movie":"tv",ud=(e,t)=>`${Wt(e)}:${t}`,dd=(e,t)=>{const n=Wt(e);return`/tv/${t}?type=${n}`},ku=(e,t,n,r)=>{const s=new URLSearchParams;return s.set("type",Wt(e)),n!==void 0&&s.set("s",String(n)),r!==void 0&&s.set("e",String(r)),`/tv/${t}/watch?${s.toString()}`},md=e=>e.adult===!0||e.adult===1,pd={10759:"Action & Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",10762:"Kids",9648:"Mystery",10765:"Sci-Fi & Fantasy",37:"Western"},hd={28:"Action",12:"Adventure",16:"Animation",35:"Comedy",80:"Crime",99:"Documentary",18:"Drama",10751:"Family",14:"Fantasy",36:"History",27:"Horror",9648:"Mystery",10749:"Romance",878:"Sci-Fi",53:"Thriller",10752:"War",37:"Western"},Ot="dango-watch-along",Kt="dango-watch-along-host";function Pn(e){if(!e||typeof e!="object")return null;const t=e;if(typeof t.id!="string"||typeof t.token!="string"||typeof t.guestToken!="string")return null;const n=je(`${t.id}.${t.guestToken}`,""),r=je(`${t.id}.${t.token}`,"");return{...n,token:r.token,host:t.host===!0}}function Tu(){try{return Pn(JSON.parse(sessionStorage.getItem(Ot)||"null"))??Pn(JSON.parse(localStorage.getItem(Kt)||"null"))}catch{return null}}function Pu(e){try{e?sessionStorage.setItem(Ot,JSON.stringify(e)):sessionStorage.removeItem(Ot),e?.host&&localStorage.setItem(Kt,JSON.stringify(e))}catch{}}function Xe(){try{localStorage.removeItem(Kt)}catch{}}function Iu(e){return e.kind==="tv"||e.kind==="movie"?ku(e.kind,e.showId,e.kind==="tv"?e.season:void 0,e.kind==="tv"?Number(e.episode):void 0):`/watch/${encodeURIComponent(e.showId)}/${encodeURIComponent(e.episode)}`}function je(e,t){let n=e.trim().replace(/^#/,"");if(n.includes("://")){const a=new URL(n);if(a.origin!==new URL(t).origin||!["/join","/watch-along"].includes(a.pathname))throw new Error("Use an invite from this dango watch-along service.");n=a.hash.slice(1)}const[r,s,i]=n.split(".");if(!Eu.test(r||"")||!Su.test(s||"")||i!==void 0)throw new Error("Paste a complete watch-along invite link or room code.");return{id:r,token:s,guestToken:s,host:!1}}function Nu({children:e}){const t=xn(),n=at(),[r,s]=Ft("watchAlongName",""),[i,a]=v(Tu),[c,l]=v(null),[u,d]=v(!1),[m,p]=v(""),[h,f]=v(""),[E,O]=v({offset:0,latency:0}),T=j(null),{data:w}=te({queryKey:["watch-along-config"],queryFn:()=>de.settings.watchAlong.query()}),b=w?.workerUrl.replace(/\/$/,"")||"";_(()=>{Pu(i)},[i]);const I=V(P=>{T.current?.readyState===WebSocket.OPEN&&T.current.send(JSON.stringify(P))},[]);_(()=>{if(!u)return;const P=setTimeout(()=>I({type:"name",name:r}),250);return()=>clearTimeout(P)},[u,h,r,I]);const Z=V(()=>{i?.host&&I({type:"end"}),T.current?.close(1e3,"Left room"),Xe(),a(null),l(null),d(!1),p("")},[I,i]),L=async P=>{if(!b)throw new Error("Watch along is unavailable. Check your server configuration.");const q=await fetch(`${b}/rooms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P),signal:AbortSignal.timeout(15e3)}),H=await q.json();if(!q.ok)throw new Error(H.error||"Could not create room");const y=je(`${H.id}.${H.guestToken}`,b),N=je(`${H.id}.${H.hostToken}`,b);p(""),l(null),a({...y,token:N.token,host:!0})},Q=P=>{if(!b)throw new Error("Watch along is unavailable. Check your server configuration.");const q=je(P,b);Xe(),p(""),l(null),a(q)};return _(()=>{if(!i||!b)return;let P=!1,q=0,H,y,N=Date.now();const z=async()=>{if(P)return;try{const F=await fetch(`${b}/rooms/${i.id}`,{headers:{Authorization:`Bearer ${i.token}`},signal:AbortSignal.timeout(1e4)});if(P)return;if(!F.ok){const A=await F.json();if([403,404,409].includes(F.status)){p(A.error||"Unable to join room"),Xe(),a(null),l(null);return}throw new Error(A.error||"Room service unavailable")}}catch{if(P)return;p("Cannot reach the room service. Retrying…"),H=setTimeout(z,Math.min(15e3,1e3*2**Math.min(q++,4)));return}const se=new URL(`${b}/rooms/${i.id}/ws`);se.protocol=se.protocol==="https:"?"wss:":"ws:";const U=new WebSocket(se,["dango-watch-along",i.token]);T.current=U,U.onopen=()=>{N=Date.now()},U.onmessage=F=>{if(!(P||T.current!==U)){N=Date.now();try{const A=JSON.parse(F.data);if(A.type==="joined"){if(A.host!==i.host){U.close(4003,"Invalid role");return}q=0,d(!0),p(""),f(A.id),U.send(JSON.stringify({type:"ping",sentAt:Date.now()}))}else if(A.type==="state")l(me=>me&&me.revision>A.state.revision?me:A.state);else if(A.type==="pong"){const me=Date.now()-A.sentAt;O({offset:A.serverTime-(A.sentAt+me/2),latency:me/2})}else A.type==="error"&&p(A.error)}catch{p("Invalid response from the room service.")}}},U.onclose=F=>{if(!(P||T.current!==U)){if(clearInterval(y),d(!1),[4003,4004,4009].includes(F.code)){p(F.reason||"Room closed"),F.code!==4009&&Xe(),a(null),l(null);return}p("Connection lost. Reconnecting…"),H=setTimeout(z,Math.min(15e3,1e3*2**Math.min(q++,4)))}},U.onerror=()=>U.close(),y=setInterval(()=>{Date.now()-N>25e3?U.close():U.readyState===WebSocket.OPEN&&U.send(JSON.stringify({type:"ping",sentAt:Date.now()}))},1e4)};return z(),()=>{P=!0,clearTimeout(H),clearInterval(y),T.current?.close(1e3,"Leaving connection"),T.current=null,d(!1)}},[i,b]),_(()=>{if(!i||i.host||!c)return;const P=Iu(c.selection);`${n.pathname}${n.search}`!==P&&t(P,{replace:!0})},[i,c,n.pathname,n.search,t]),o(Er.Provider,{value:{workerUrl:b,displayName:r,setDisplayName:s,session:i,room:c,connected:u,error:m,selfId:h,clock:E,create:L,join:Q,leave:Z,send:I},children:e})}try{window.history.scrollRestoration="manual"}catch{}const In=new Dr({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),Nn=document.getElementById("root");Nn&&xr(o(_u,{children:o(Or,{children:o(Us,{trpcClient:de,queryClient:In,children:o(Rr,{client:In,children:o(uu,{children:o(ou,{children:o(su,{children:o(iu,{children:o(au,{children:o(lu,{children:o(Nu,{children:o(ru,{})})})})})})})})})})})}),Nn);export{yt as $,Ru as A,it as B,td as C,Gu as D,Vu as E,C as F,mt as G,sr as H,Zu as I,Xu as J,Yu as K,Ae as L,hd as M,Fa as N,Me as O,Ne as P,hr as Q,Fs as R,qt as S,pd as T,J as U,rd as V,od as W,vn as X,pr as Y,gn as Z,K as _,Ft as a,Du as a0,re as a1,ad as a2,gl as a3,ju as a4,ja as a5,id as a6,zn as a7,Wt as a8,ud as a9,sd as aa,cd as ab,ld as ac,Bt as ad,nd as ae,_n as af,Ku as ag,Hu as ah,Wu as ai,$u as b,qu as c,tr as d,Ic as e,Xn as f,Au as g,ku as h,md as i,dd as j,oi as k,$ as l,Mu as m,mr as n,Ju as o,X as p,M as q,Bu as r,Lu as s,de as t,zi as u,Fu as v,Uu as w,Qu as x,ed as y,zu as z};
|
package/client/dist/assets/{libraryInvalidation-BirscVrS.js → libraryInvalidation-C4kz8swK.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as r}from"./index-
|
|
1
|
+
import{q as r}from"./index-fS4AGBy2.js";const s={tv:{library:r.tvLibrary,continue:r.tvContinueWatching,progress:r.tvProgress},manga:{library:r.mangaLibrary,continue:r.mangaContinueReading,progress:r.mangaProgress},asmr:{library:r.asmrLibrary,continue:r.asmrContinueListening,progress:r.asmrProgress}};function t(a,e,n=!1){const i=s[e];n&&a.invalidateQueries({queryKey:[i.progress]}),a.invalidateQueries({queryKey:[i.library]}),a.invalidateQueries({queryKey:[i.continue]})}export{t as i};
|
package/client/dist/assets/{playbackCompletion-C8izYMOL.js → playbackCompletion-Dfy-xXLg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e}from"./index-
|
|
1
|
+
import{p as e}from"./index-fS4AGBy2.js";const o=.8,r=5,a="autoplayEnabled",E=(s,t)=>t>0&&s>=t*o,c=.25,l=(s,t)=>t>0&&Number.isFinite(t)&&s>=t-c,p=s=>s>r,m=()=>{try{return e.getItem(a)==="true"}catch{return!1}},b=s=>{try{e.setItem(a,String(s))}catch{}};export{o as C,l as a,p as h,E as i,m as l,b as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as g}from"./vendor-core-DfaOB3Rn.js";import{u as p,b as q,a as M}from"./vendor-query-BBT5_sHx.js";import{l as v,F as h,q as Q,t as y}from"./index-
|
|
1
|
+
import{q as g}from"./vendor-core-DfaOB3Rn.js";import{u as p,b as q,a as M}from"./vendor-query-BBT5_sHx.js";import{l as v,F as h,q as Q,t as y}from"./index-fS4AGBy2.js";import{u as A}from"./QueueOptionsButton-BeAS9Ufo.js";function k(t){const s=p(),c=v(),{data:i,isLoading:w,error:u}=A(t),n=c.watchlist.check.queryOptions({showId:t??""}).queryKey,{data:d}=q({...c.watchlist.check.queryOptions({showId:t??""}),enabled:!!t}),r=d?.inWatchlist??!1,{mutateAsync:l}=M({mutationFn:async({wasIn:e,meta:a})=>{if(!t)throw new Error("Missing showId");if(e)await y.watchlist.remove.mutate({id:t});else{const o=a?.names,m=a?.name||o?.romaji;if(!m)throw new Error("Missing show name");await y.watchlist.add.mutate({id:t,name:m,thumbnail:a?.thumbnail,nativeName:o?.native,englishName:o?.english,type:a?.type,isAdult:a?.isAdult})}return!e},onMutate:async({wasIn:e})=>{await s.cancelQueries({queryKey:n}),s.setQueryData(n,a=>({...a,inWatchlist:!e,status:a?.status??""}))},onError:e=>{s.invalidateQueries({queryKey:n}),h.error(e instanceof Error?e.message:"Failed to update watchlist")},onSuccess:e=>{h.success(e?"Added to watchlist":"Removed from watchlist"),s.invalidateQueries({queryKey:[Q.watchlist]})}}),f=g(async()=>{!t||!i||await l({wasIn:r,meta:i})},[t,i,r,l]);return{showMeta:i,inWatchlist:r,loadingMeta:w,error:u?u.message:null,toggleWatchlist:f}}export{k as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as o}from"./usePopup-DS9jMzp6.js";const s=()=>o();export{s as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u,c as f,u as c,a as g}from"./vendor-query-BBT5_sHx.js";import{q as v,t as b,l as o,F as s}from"./index-
|
|
1
|
+
import{b as u,c as f,u as c,a as g}from"./vendor-query-BBT5_sHx.js";import{q as v,t as b,l as o,F as s}from"./index-fS4AGBy2.js";import{T as L}from"./vendor-core-DfaOB3Rn.js";import{i as l}from"./libraryInvalidation-C4kz8swK.js";const q=300*1e3,h={mangadex:"https://mangadex.org/",mangapill:"https://www.mangapill.com/"},F=(e,a)=>`/api/proxy?url=${encodeURIComponent(a)}&referer=${encodeURIComponent(h[e])}`,B=(e,a)=>a&&(e==="mangapill"||e==="mangadex"?F(e,a):a),N=(e,a=!0)=>{const{provider:t,query:r,page:i,sort:n,status:m,type:p,rating:y,mature:d}=e;return u({queryKey:[v.mangaBrowse,t,r,i,n,m,p,y,d],queryFn:()=>b.manga.search.query({provider:t,q:r.trim()||void 0,page:i,sort:n||void 0,status:m||void 0,type:p||void 0,rating:y||void 0,mature:d?"1":void 0}),staleTime:q,enabled:a})},I=(e,a=14)=>{const{provider:t,query:r,sort:i,status:n,type:m,rating:p,mature:y}=e;return f({queryKey:[v.mangaBrowseInfinite,t,r,i,n,m,p,y,a],queryFn:({pageParam:d=1})=>b.manga.search.query({provider:t,q:r.trim()||void 0,page:d,limit:a,sort:i||void 0,status:n||void 0,type:m||void 0,rating:p||void 0,mature:y?"1":void 0}),initialPageParam:1,getNextPageParam:(d,M)=>d.hasNext?M.length+1:void 0,staleTime:q,enabled:!0})},Q=(e,a,t="safe",r=!1)=>u({queryKey:[v.mangaDetail,e,a,t,r],queryFn:()=>b.manga.info.query({provider:e||"",id:a||"",rating:t,mature:r?"1":void 0}),enabled:!!e&&!!a,staleTime:q}),A=(e,a,t)=>u({queryKey:[v.mangaPages,e,a],queryFn:()=>b.manga.pages.query({provider:e||"",id:a||""}),enabled:!!e&&!!a,staleTime:1800*1e3}),w=()=>{const e=o(),a=u({...e.manga.trending.queryOptions(),staleTime:600*1e3,retry:1});return{...a,data:a.data}},x=e=>e.contentRating==="erotica"||e.contentRating==="pornographic"||e.type==="doujinshi";function _(e,a){const t=e.titles??{};return a==="englishName"?t.en||e.title:a==="nativeName"&&(t.native||t.romaji||e.altTitle)||e.title}function D(e){return{englishName:e.titles?.en??e.title,nativeName:e.titles?.native??e.titles?.romaji??e.altTitle??void 0}}const P=/^anilist:ch:(\d+)$/;function K(e){if(!e)return null;const a=P.exec(e.trim());if(!a)return null;const t=Number.parseInt(a[1],10);return Number.isFinite(t)?t:null}function U(e,a){const t=String(a),r=e.find(i=>(i.number??"").trim()===t);return r||(e.find(i=>{const n=Number.parseFloat((i.number??"").trim());return Number.isFinite(n)&&n===a})??null)}const j=["Reading","Completed","On-Hold","Dropped","Planned"],S=(e,a)=>`${e.toLowerCase()}:${a}`,H=(e="All",a=1,t=24)=>{const r=o();return u(r.mangaLibrary.list.queryOptions({status:e,page:a,limit:t}))},R=()=>{const e=o();return u({...e.mangaLibrary.ids.queryOptions(),staleTime:1e3*60})},V=e=>{const a=o();return u({...a.mangaLibrary.check.queryOptions({id:e??""}),enabled:!!e,staleTime:1e3*60})},Y=e=>{const a=o();return u({...a.mangaLibrary.entry.queryOptions({id:e??""}),enabled:!!e,staleTime:1e3*60})},z=()=>{const e=o(),a=c();return g(e.mangaLibrary.link.mutationOptions({onSuccess:t=>{s.success(t?.progressMigrated?"Linked - chapter progress carried over":"Linked to AniList entry"),a.invalidateQueries(e.mangaLibrary.pathFilter()),l(a,"manga")},onError:t=>{s.error(`Failed to link: ${t.message}`)}}))},G=(e=24)=>{const a=o();return u(a.mangaProgress.continueReading.queryOptions({limit:e}))},J=e=>{const a=o();return u({...a.mangaProgress.byManga.queryOptions({mangaId:e??""}),enabled:!!e})},k=()=>{const e=o(),a=c();return g(e.mangaLibrary.add.mutationOptions({onSuccess:(t,r)=>{r.silent||s.success("Bookmarked"),a.invalidateQueries(e.mangaLibrary.pathFilter()),a.invalidateQueries({queryKey:[v.mangaLibrary]})},onError:t=>{s.error(`Failed to bookmark: ${t.message}`)}}))},C=()=>{const e=o(),a=c();return g(e.mangaLibrary.remove.mutationOptions({onSuccess:()=>{s.success("Bookmark removed"),a.invalidateQueries(e.mangaLibrary.pathFilter()),l(a,"manga")},onError:t=>{s.error(`Failed to remove: ${t.message}`)}}))},W=()=>{const e=o(),a=c();return g(e.mangaLibrary.setStatus.mutationOptions({onSuccess:()=>{s.success("Status updated"),a.invalidateQueries(e.mangaLibrary.pathFilter()),l(a,"manga")},onError:t=>{s.error(`Failed to update status: ${t.message}`)}}))},X=()=>{const e=o(),a=c();return g(e.mangaProgress.save.mutationOptions({onSuccess:()=>{l(a,"manga",!0),a.invalidateQueries(e.mangaProgress.pathFilter())}}))},Z=()=>{const e=o(),a=c();return g(e.mangaProgress.remove.mutationOptions({onSuccess:()=>{s.success("Progress reset"),l(a,"manga",!0),a.invalidateQueries(e.mangaProgress.pathFilter())},onError:t=>{s.error(`Failed to reset progress: ${t.message}`)}}))},ee=()=>{const e=o(),a=c();return g(e.mangaLibrary.batchStatus.mutationOptions({onSuccess:t=>{s.success(`Status updated for ${t.updated??0} items`),a.invalidateQueries(e.mangaLibrary.pathFilter()),l(a,"manga")},onError:t=>{s.error(`Failed to update statuses: ${t.message}`)}}))},ae=()=>{const e=o(),a=c();return g(e.mangaLibrary.removeMany.mutationOptions({onSuccess:t=>{const r=t.removed??0;s.success(`Removed ${r} ${r===1?"item":"items"} from reading list`),a.invalidateQueries(e.mangaLibrary.pathFilter()),l(a,"manga")},onError:t=>{s.error(`Failed to remove: ${t.message}`)}}))},te=()=>{const e=o(),a=c();return g(e.mangaProgress.removeMany.mutationOptions({onSuccess:t=>{const r=t.removed??0;s.success(`Reset progress for ${r} ${r===1?"item":"items"}`),l(a,"manga",!0),a.invalidateQueries(e.mangaProgress.pathFilter())},onError:t=>{s.error(`Failed to reset progress: ${t.message}`)}}))},re=()=>{const e=k(),a=C(),{data:t}=R(),r=L(()=>new Set(t?.ids||[]),[t]);return{toggle:n=>{const m=S(n.provider,n.id);r.has(m)?a.mutate(m):e.mutate({provider:n.provider,mangaId:n.id,title:n.title,cover:n.cover,altTitle:n.altTitle,contentRating:n.contentRating})},bookmarkedIds:r,pending:e.isPending||a.isPending}};export{te as A,Z as B,j as M,I as a,B as b,D as c,G as d,w as e,N as f,Y as g,k as h,x as i,z as j,Q as k,V as l,S as m,J as n,C as o,W as p,K as q,_ as r,U as s,A as t,re as u,F as v,X as w,H as x,ee as y,ae as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as k}from"./vendor-core-DfaOB3Rn.js";import{k as T,r as d}from"./useMangaLibrary-
|
|
1
|
+
import{u as k}from"./vendor-core-DfaOB3Rn.js";import{k as T,r as d}from"./useMangaLibrary-4UsX_okY.js";import{d as y}from"./index-fS4AGBy2.js";import{a as h}from"./MediaCard-Wp1bAPsS.js";import{u as M}from"./usePopup-DS9jMzp6.js";const B=({data:e,anchorRect:i,bookmarked:l,onToggleBookmark:n,onMouseEnter:p,onMouseLeave:c,onRequestClose:m})=>{const{data:o,isLoading:u}=T(e.provider,e.mangaId,e.rating||"safe",e.mature||!1),{titlePreference:g}=y(),s=o?.chapters.length??0,a=d({title:e.title,altTitle:o?.altTitle??e.altTitle},g),t=[],r=[o?.status,o?.type].filter(Boolean).join(" · ");r&&t.push({icon:"book",label:r}),s>0&&t.push({label:`${s} chapter${s===1?"":"s"}`}),e.progressLabel&&t.push({icon:"bookmark",label:e.progressLabel});const b=Array.isArray(o?.genres)?o.genres.filter(Boolean).slice(0,4).map(f=>f):[];return k(h,{anchorRect:i,title:a,subtitle:o?.altTitle&&o.altTitle!==a?`Also known as: ${o.altTitle}`:void 0,loading:u,meta:t,genres:b,synopsis:o?.description?o.description:"No synopsis available.",primaryAction:{to:e.readTarget,label:"Read now",icon:"book"},secondaryAction:{to:`/manga/${e.provider}/${encodeURIComponent(e.mangaId)}`,label:"Read more"},bookmarked:l,bookmarkLabel:"Bookmark",onToggleBookmark:n,onMouseEnter:p,onMouseLeave:c,onRequestClose:m})},I=()=>M();export{B as M,I as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as o}from"./vendor-core-DfaOB3Rn.js";import{b as a}from"./vendor-query-BBT5_sHx.js";import{q as i,O as n}from"./index-
|
|
1
|
+
import{T as o}from"./vendor-core-DfaOB3Rn.js";import{b as a}from"./vendor-query-BBT5_sHx.js";import{q as i,O as n}from"./index-fS4AGBy2.js";const l=300*1e3,c=()=>{const e=a({queryKey:[i.providers],queryFn:()=>n("/api/providers"),staleTime:l,retry:1}),r=Array.isArray(e.data)?e.data:null,s=o(()=>r&&r.length>0?r.filter(t=>t.loaded):[],[r]);return{...e,options:s,isFallback:!r||r.length===0}};export{c as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as c,u as o,S as d}from"./vendor-core-DfaOB3Rn.js";import{I as v}from"./vendor-icons-DrybRNxP.js";import{M as T}from"./MediaCard-
|
|
1
|
+
import{N as c,u as o,S as d}from"./vendor-core-DfaOB3Rn.js";import{I as v}from"./vendor-icons-DrybRNxP.js";import{M as T}from"./MediaCard-Wp1bAPsS.js";import{T as g}from"./TvPopup-CSFfDhV6.js";import{j as m,i as f,l as i}from"./index-fS4AGBy2.js";import{b as u}from"./vendor-query-BBT5_sHx.js";const P=c(({item:e})=>{const a=e.type==="tv"||e.type==="tvSeries"||e.type==="tvMiniSeries",s=m(e.type,e.id);return o(T,{item:{id:String(e.id),title:e.title,thumbnail:e.image,typeBadge:a?"TV":"Movie",isAdult:f(e)},linkTo:s,hoverIcon:"info",showInfoButton:!0,metaRow:o(d,{children:[e.year&&o("span",{style:{opacity:.75},children:e.year}),e.vote_average!=null&&o("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[o(v,{name:"star",size:10}),Number(e.vote_average).toFixed(1)]})]}),renderPopup:(n,t)=>o(g,{item:e,anchorRect:n,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onRequestClose:t.close})})}),p=1e3*60*5,_=e=>{const a=i(),{query:s,type:n,genre:t,year:r,sort_by:l,page:y}=e;return u({...a.tv.search.queryOptions({q:s?.trim()||"",type:n||"multi",genre:t||"",year:r&&r!=="ALL"?r:"",sortBy:l||"popularity.desc",page:y||1}),staleTime:p,retry:1})},b=(e="all",a="week",s=1,n=!0)=>{const t=i(),r=u({...t.tv.trending.queryOptions({mediaType:e,timeWindow:a,page:s}),enabled:n,staleTime:p,retry:1});return{...r,data:r.data}};export{P as T,_ as a,b as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{T as p}from"./vendor-core-DfaOB3Rn.js";import{b as c,u as i,a as n}from"./vendor-query-BBT5_sHx.js";import{l as a,F as o,q as m,t as y,a9 as g}from"./index-
|
|
1
|
+
import{T as p}from"./vendor-core-DfaOB3Rn.js";import{b as c,u as i,a as n}from"./vendor-query-BBT5_sHx.js";import{l as a,F as o,q as m,t as y,a9 as g}from"./index-fS4AGBy2.js";import{i as u}from"./libraryInvalidation-C4kz8swK.js";const q=["Watching","Completed","On-Hold","Dropped","Planned"],b=(t,e)=>g(t,e),C=(t="All",e=1,r=24)=>{const s=a();return c(s.tvLibrary.list.queryOptions({status:t,page:e,limit:r}))},T=()=>{const t=a();return c({...t.tvLibrary.ids.queryOptions(),staleTime:1e3*60})},O=t=>{const e=a();return c({...e.tvLibrary.check.queryOptions({id:t||""}),enabled:!!t,staleTime:1e3*60})},k=(t=24)=>{const e=a();return c(e.tvProgress.continueWatching.queryOptions({limit:t}))},$=t=>{const e=a();return c({...e.tvProgress.getByMedia.queryOptions({mediaId:t||""}),enabled:!!t})},f=(t,e,r)=>{const s=a();return c({...s.tvProgress.latest.queryOptions({mediaId:t||"",season:e,episode:r}),enabled:!!t,staleTime:0})},h=()=>{const t=a(),e=i();return n({mutationFn:async r=>{const{silent:s,...d}=r;return y.tvLibrary.add.mutate(d)},onSuccess:(r,s)=>{s.silent||o.success("Added to TV watchlist"),e.invalidateQueries({queryKey:[m.tvLibrary]}),e.invalidateQueries(t.tvLibrary.pathFilter())},onError:r=>{o.error(`Failed to add: ${r.message}`)}})},F=()=>{const t=a(),e=i();return n(t.tvLibrary.remove.mutationOptions({onSuccess:()=>{o.success("Removed from TV watchlist"),u(e,"tv"),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{o.error(`Failed to remove: ${r.message}`)}}))},R=()=>{const t=a(),e=i();return n(t.tvLibrary.setStatus.mutationOptions({onSuccess:()=>{o.success("Status updated"),u(e,"tv"),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{o.error(`Failed to update status: ${r.message}`)}}))},B=()=>{const t=a(),e=i();return n(t.tvProgress.save.mutationOptions({onSuccess:()=>{u(e,"tv",!0),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())}}))},E=()=>{const t=a(),e=i();return n(t.tvProgress.remove.mutationOptions({onSuccess:()=>{o.success("Progress reset"),u(e,"tv",!0),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{o.error(`Failed to reset progress: ${r.message}`)}}))},I=()=>{const t=a(),e=i();return n(t.tvLibrary.batchStatus.mutationOptions({onSuccess:r=>{o.success(`Status updated for ${r.updated??0} items`),u(e,"tv"),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{o.error(`Failed to update statuses: ${r.message}`)}}))},A=()=>{const t=a(),e=i();return n(t.tvLibrary.removeMany.mutationOptions({onSuccess:r=>{const s=r.removed??0;o.success(`Removed ${s} ${s===1?"item":"items"} from TV watchlist`),u(e,"tv"),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{o.error(`Failed to remove: ${r.message}`)}}))},w=()=>{const t=a(),e=i();return n(t.tvProgress.removeMany.mutationOptions({onSuccess:r=>{const s=r.removed??0;o.success(`Reset progress for ${s} ${s===1?"item":"items"}`),u(e,"tv",!0),e.invalidateQueries(t.tvLibrary.pathFilter()),e.invalidateQueries(t.tvProgress.pathFilter())},onError:r=>{o.error(`Failed to reset progress: ${r.message}`)}}))},M=()=>{const t=h(),e=F(),{data:r}=T(),s=p(()=>new Set(r?.ids||[]),[r]);return{toggle:v=>{const l=b(v.mediaType,v.tmdbId);s.has(l)?e.mutate(l):t.mutate({...v,poster:v.poster||""})},bookmarkedIds:s,pending:t.isPending||e.isPending}};export{q as T,F as a,E as b,O as c,M as d,B as e,R as f,h as g,f as h,$ as i,C as j,I as k,A as l,w as m,k as u};
|