@serifpersia/dango 3.7.6 → 3.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/client/dist/assets/{AnimeCard-a7KkMGQv.js → AnimeCard-B_eNHj3Q.js} +1 -1
- package/client/dist/assets/{AnimeInfo-De3gudGy.js → AnimeInfo-B4DtKpJi.js} +1 -1
- package/client/dist/assets/{AnimeInfoPage-adJHjnqz.js → AnimeInfoPage-BTJBbJx7.js} +2 -2
- package/client/dist/assets/Asmr-DB4F0zQm.js +2 -0
- package/client/dist/assets/{AsmrResetProgressModal-CZGzmnlI.js → AsmrResetProgressModal-BkO6uAVo.js} +1 -1
- package/client/dist/assets/Home-BYtjQAAm.js +1 -0
- package/client/dist/assets/Insights-kd8R5HFL.js +1 -0
- package/client/dist/assets/{LibraryListPage-CgZiYRmp.js → LibraryListPage-BXCoAwO-.js} +1 -1
- package/client/dist/assets/{ListeningList-DX_Imiie.js → ListeningList-B58inkaW.js} +1 -1
- package/client/dist/assets/Manga-B09DXrt3.js +1 -0
- package/client/dist/assets/{MangaInfoPage-D_3Rx6rr.js → MangaInfoPage-HniBD97j.js} +1 -1
- package/client/dist/assets/MangaReadPage-XTo4eB8e.js +1 -0
- package/client/dist/assets/{MangaResetProgressModal-Bd_lIuFo.js → MangaResetProgressModal-DgD2JJiz.js} +1 -1
- package/client/dist/assets/Mature--NRjmFgA.js +1 -0
- package/client/dist/assets/{MatureConsentModal-RZ_j_2BD.js → MatureConsentModal-BxCEXBbj.js} +1 -1
- package/client/dist/assets/{MediaCard-BODgA6ir.js → MediaCard-BXWAjpwt.js} +1 -1
- package/client/dist/assets/OptionListMenu-DHzVKmrw.js +1 -0
- package/client/dist/assets/Player-BopSS6Gv.js +56 -0
- package/client/dist/assets/PlayerProvider-Cj4nkG1Z.js +1 -0
- package/client/dist/assets/PlayerSettings-BEorvGw8.js +1 -0
- package/client/dist/assets/{QueueOptionsButton-C-y5QFrT.js → QueueOptionsButton-E2SuRJH_.js} +1 -1
- package/client/dist/assets/{QueueRail-DGFI6xTM.js → QueueRail-ZlyY6iwq.js} +1 -1
- package/client/dist/assets/{ReadingList-BB_fA_j0.js → ReadingList-DEOzfsq9.js} +1 -1
- package/client/dist/assets/{ResetProgressModal-DEnbScHS.js → ResetProgressModal-B4qmiw-m.js} +1 -1
- package/client/dist/assets/Search-C2mxeTuG.js +1 -0
- package/client/dist/assets/Settings-BqOAQxhe.js +21 -0
- package/client/dist/assets/Settings-D37LNfis.css +1 -0
- package/client/dist/assets/{SkeletonGrid-w6TsxWu7.js → SkeletonGrid-Od92F7If.js} +1 -1
- package/client/dist/assets/Trackers-CyWVHtOz.js +2 -0
- package/client/dist/assets/Tv-B8tWYqQt.js +4 -0
- package/client/dist/assets/TvInfo-CYh7oICz.js +1 -0
- package/client/dist/assets/TvPopup-8uQGvzWG.js +1 -0
- package/client/dist/assets/TvSearch-DMc5DzU4.js +1 -0
- package/client/dist/assets/{TvWatchlist-er5RKLmv.js → TvWatchlist-fPe4D63a.js} +1 -1
- package/client/dist/assets/VirtualKeyboard-CjOEv-Zs.js +1 -0
- package/client/dist/assets/WatchAlong-Cd_rNUGz.js +1 -0
- package/client/dist/assets/WatchAlongPanel-BKprdx-w.js +1 -0
- package/client/dist/assets/WatchAlongPanel-DbJuLqxU.css +1 -0
- package/client/dist/assets/{Watchlist-BiJ1SCAH.js → Watchlist-DMj82PtZ.js} +1 -1
- package/client/dist/assets/index-B_2ppn5P.js +178 -0
- package/client/dist/assets/index-DP9TtvZX.css +1 -0
- package/client/dist/assets/{libraryInvalidation-CVK2SYUR.js → libraryInvalidation-DeUzK6TJ.js} +1 -1
- package/client/dist/assets/playbackCompletion-_kwPgoZi.js +1 -0
- package/client/dist/assets/{useAnimeInfoData-8RI9qMzw.js → useAnimeInfoData-CH9hmj5A.js} +1 -1
- package/client/dist/assets/{useAsmr-ClAcWwjW.js → useAsmr-DQsv1SQT.js} +1 -1
- package/client/dist/assets/{useAsmrPopup-CDcDqi0C.js → useAsmrPopup-6kWviNqn.js} +1 -1
- package/client/dist/assets/{useMangaLibrary-D3Foz2m_.js → useMangaLibrary-DlU4Z9JL.js} +1 -1
- package/client/dist/assets/{useMangaPopup-kZzwoCN6.js → useMangaPopup-3MuX6uO9.js} +1 -1
- package/client/dist/assets/{useProviders-OKWPunZg.js → useProviders-Dx9rG8FY.js} +1 -1
- package/client/dist/assets/useTv-DZQzHJgO.js +1 -0
- package/client/dist/assets/useTvLibrary-DVpLBz5c.js +1 -0
- package/client/dist/assets/useWatchAlongPlayer-KZT7d2pQ.js +10 -0
- package/client/dist/index.html +2 -2
- package/package.json +2 -2
- package/server/dist/config.js +1 -1
- package/server/dist/profile-scope.js +1 -0
- package/server/dist/server.js +257 -249
- package/server/dist/shipped-defaults.js +1 -1
- package/server/package.json +2 -2
- package/client/dist/assets/Asmr-BH3j9n5n.js +0 -2
- package/client/dist/assets/Home-4lO9InFx.js +0 -1
- package/client/dist/assets/Insights-Co9pEzWb.js +0 -1
- package/client/dist/assets/Manga-tDOa59vQ.js +0 -1
- package/client/dist/assets/MangaReadPage-D0satiXp.js +0 -1
- package/client/dist/assets/Mature-DhozU6BP.js +0 -1
- package/client/dist/assets/OptionListMenu-CGazCg0C.js +0 -1
- package/client/dist/assets/Player-M3yMiFzg.js +0 -56
- package/client/dist/assets/PlayerProvider-pi0at080.js +0 -1
- package/client/dist/assets/PlayerSettings-k4bqwbns.js +0 -1
- package/client/dist/assets/Search-Dikasx2q.js +0 -1
- package/client/dist/assets/Settings-CCoAhBc0.js +0 -21
- package/client/dist/assets/Settings-DYjRBgpE.css +0 -1
- package/client/dist/assets/Trackers-CoM-8Hz9.js +0 -2
- package/client/dist/assets/Tv-BLUeZ2n8.js +0 -4
- package/client/dist/assets/TvInfo-BjFZ57fG.js +0 -1
- package/client/dist/assets/TvPopup-D6UvGI7M.js +0 -1
- package/client/dist/assets/TvSearch-BDNZjbZo.js +0 -1
- package/client/dist/assets/VirtualKeyboard-DeP7fb3P.js +0 -1
- package/client/dist/assets/index-5x1mF1nD.css +0 -1
- package/client/dist/assets/index-BP1z44Uk.js +0 -178
- package/client/dist/assets/playbackCompletion-IPHm9fp5.js +0 -1
- package/client/dist/assets/usePlaybackEnd-DmvZ__Ut.js +0 -10
- package/client/dist/assets/useTv-BgO7EV-p.js +0 -1
- package/client/dist/assets/useTvLibrary-C6rSJQi_.js +0 -1
- /package/client/dist/assets/{usePlaybackEnd-BMf_H2dw.css → useWatchAlongPlayer-BMf_H2dw.css} +0 -0
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-4lO9InFx.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/MediaCard-BODgA6ir.js","assets/vendor-icons-DrybRNxP.js","assets/vendor-ui-3qrARCPr.js","assets/useIsMobile-Dvx1uJ82.js","assets/MatureConsentModal-RZ_j_2BD.js","assets/MatureConsentModal-CqewXc0q.css","assets/MediaCard-CoyScn-7.css","assets/AnimeCard-a7KkMGQv.js","assets/useAnimeInfoData-8RI9qMzw.js","assets/QueueOptionsButton-C-y5QFrT.js","assets/QueueOptionsButton-CM15uQn8.css","assets/playbackCompletion-IPHm9fp5.js","assets/SkeletonGrid-w6TsxWu7.js","assets/SkeletonGrid-BisPI38I.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-DEnbScHS.js","assets/QueueRail-DGFI6xTM.js","assets/QueueRail-Bkh4VZls.css","assets/useMangaPopup-kZzwoCN6.js","assets/useMangaLibrary-D3Foz2m_.js","assets/libraryInvalidation-CVK2SYUR.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-Bd_lIuFo.js","assets/useProviders-OKWPunZg.js","assets/useTv-BgO7EV-p.js","assets/TvPopup-D6UvGI7M.js","assets/useTvLibrary-C6rSJQi_.js","assets/AsmrResetProgressModal-CZGzmnlI.js","assets/useAsmr-ClAcWwjW.js","assets/Home-DHAkZuDf.css","assets/Watchlist-BiJ1SCAH.js","assets/LibraryListPage.module-r6k9nyT9.js","assets/LibraryListPage-DmdjNa2U.css","assets/ActiveFilterChips-olGfwxle.js","assets/ActiveFilterChips-QjkplDN2.css","assets/Watchlist-DW7kUORr.css","assets/Settings-CCoAhBc0.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-DYjRBgpE.css","assets/Player-M3yMiFzg.js","assets/PlayerProvider-pi0at080.js","assets/PlayerProvider-N2pT5gty.css","assets/usePlaybackEnd-DmvZ__Ut.js","assets/usePlaybackEnd-BMf_H2dw.css","assets/AnimeMetaDetails-B3-A7O5H.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-D-sQfjcx.css","assets/Search-Dikasx2q.js","assets/Search.module-C_qwCdHS.js","assets/Search-DCKK3seW.css","assets/Mature-DhozU6BP.js","assets/Mature-DJmUUtlF.css","assets/Asmr-BH3j9n5n.js","assets/useAsmrPopup-CDcDqi0C.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Asmr-Do89pEHG.css","assets/Manga-tDOa59vQ.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-D_3Rx6rr.js","assets/MangaReadPage-D0satiXp.js","assets/ReadingList-BB_fA_j0.js","assets/LibraryListPage-CgZiYRmp.js","assets/TvSearch-BDNZjbZo.js","assets/TvInfo-BjFZ57fG.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-BLUeZ2n8.js","assets/OptionListMenu-CGazCg0C.js","assets/Tv-D3vXCsSC.css","assets/TvWatchlist-er5RKLmv.js","assets/ListeningList-DX_Imiie.js","assets/Trackers-CoM-8Hz9.js","assets/Trackers-CvO6aWVx.css","assets/Insights-Co9pEzWb.js","assets/Insights-D0qrep0K.css","assets/AnimeInfoPage-adJHjnqz.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-DeP7fb3P.js","assets/VirtualKeyboard-BaUll8Yv.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{N as Hn,k as U,A as W,q as Q,h as w,S as z,d as S,X as ce,x as le,T as Te,g as ft,u as o,L as Z,$ as yt,a as Kn,c as vt,e as Vn,f as zn,D as Gn,i as Yn,P as Tt,j as Jn,l as C,m as xt,z as R,n as Zn,B as Xn}from"./vendor-core-DfaOB3Rn.js";import{s as be,i as er,q as tr,u as H,a as ee,b as G,c as gt,Q as nr,d as rr}from"./vendor-query-BBT5_sHx.js";import{I as _}from"./vendor-icons-DrybRNxP.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const or="modulepreload",ir=function(e){return"/"+e},It={},j=function(t,n,r){let i=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");i=l(n.map(u=>{if(u=ir(u),u in It)return;It[u]=!0;const d=u.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${m}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":or,d||(h.as="script"),h.crossOrigin="",h.href=u,c&&h.setAttribute("nonce",c),document.head.appendChild(h),d)return new Promise((p,f)=>{h.addEventListener("load",p),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(a){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=a,window.dispatchEvent(c),!c.defaultPrevented)throw a}return i.then(a=>{for(const c of a||[])c.status==="rejected"&&s(c.reason);return t().catch(s)})};let sr={data:""},ar=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||sr},cr=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,lr=/\/\*[^]*?\*\/| +/g,Nt=/\n+/g,he=(e,t)=>{let n="",r="",i="";for(let s in e){let a=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+a+";":r+=s[1]=="f"?he(a,s):s+"{"+he(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=he(a,t?t.replace(/([^,])+/g,c=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,c):c?c+" "+l:l)):s):a!=null&&(s=s[1]=="-"?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=he.p?he.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},me={},on=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+on(e[n]);return t}return e},ur=(e,t,n,r,i)=>{let s=on(e),a=me[s]||(me[s]=(l=>{let u=0,d=11;for(;u<l.length;)d=101*d+l.charCodeAt(u++)>>>0;return"go"+d})(s));if(!me[a]){let l=s!==e?e:(u=>{let d,m,h=[{}];for(;d=cr.exec(u.replace(lr,""));)d[4]?h.shift():d[3]?(m=d[3].replace(Nt," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][d[1]]=d[2].replace(Nt," ").trim();return h[0]})(e);me[a]=he(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let c=n&&me.g;return n&&(me.g=me[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)})(me[a],t,r,c),a},dr=(e,t,n)=>e.reduce((r,i,s)=>{let a=t[s];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?"":he(c,""):c===!1?"":c}return r+i+(a??"")},"");function ze(e){let t=this||{},n=e.call?e(t.p):e;return ur(n.unshift?n.raw?dr(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,ar(t.target),t.g,t.o,t.k)}let sn,it,st;ze.bind({g:1});let ue=ze.bind({k:1});function mr(e,t,n,r){he.p=t,sn=e,it=n,st=r}function fe(e,t){let n=this||{};return function(){let r=arguments;function i(s,a){let c=Object.assign({},s),l=c.className||i.className;n.p=Object.assign({theme:it&&it()},c),n.o=/go\d/.test(l),c.className=ze.apply(n,r)+(l?" "+l:"");let u=e;return e[0]&&(u=c.as||e,delete c.as),st&&u[0]&&st(c),sn(u,c)}return i}}var hr=e=>typeof e=="function",Ke=(e,t)=>hr(e)?e(t):e,pr=(()=>{let e=0;return()=>(++e).toString()})(),an=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),fr=20,bt="default",cn=(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 cn(e,{type:e.toasts.find(a=>a.id===r.id)?1:0,toast:r});case 3:let{toastId:i}=t;return{...e,toasts:e.toasts.map(a=>a.id===i||i===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 s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(a=>({...a,pauseDuration:a.pauseDuration+s}))}}},Ue=[],ln={toasts:[],pausedAt:void 0,settings:{toastLimit:fr}},oe={},un=(e,t=bt)=>{oe[t]=cn(oe[t]||ln,e),Ue.forEach(([n,r])=>{n===t&&r(oe[t])})},dn=e=>Object.keys(oe).forEach(t=>un(e,t)),yr=e=>Object.keys(oe).find(t=>oe[t].toasts.some(n=>n.id===e)),Ge=(e=bt)=>t=>{un(t,e)},vr={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gr=(e={},t=bt)=>{let[n,r]=S(oe[t]||ln),i=W(oe[t]);w(()=>(i.current!==oe[t]&&r(oe[t]),Ue.push([t,r]),()=>{let a=Ue.findIndex(([c])=>c===t);a>-1&&Ue.splice(a,1)}),[t]);let s=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||vr[a.type],style:{...e.style,...(u=e[a.type])==null?void 0:u.style,...a.style}}});return{...n,toasts:s}},br=(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||pr()}),Re=e=>(t,n)=>{let r=br(t,e,n);return Ge(r.toasterId||yr(r.id))({type:2,toast:r}),r.id},F=(e,t)=>Re("blank")(e,t);F.error=Re("error");F.success=Re("success");F.loading=Re("loading");F.custom=Re("custom");F.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Ge(t)(n):dn(n)};F.dismissAll=e=>F.dismiss(void 0,e);F.remove=(e,t)=>{let n={type:4,toastId:e};t?Ge(t)(n):dn(n)};F.removeAll=e=>F.remove(void 0,e);F.promise=(e,t,n)=>{let r=F.loading(t.loading,{...n,...n?.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?Ke(t.success,i):void 0;return s?F.success(s,{id:r,...n,...n?.success}):F.dismiss(r),i}).catch(i=>{let s=t.error?Ke(t.error,i):void 0;s?F.error(s,{id:r,...n,...n?.error}):F.dismiss(r)}),e};var wr=1e3,_r=(e,t="default")=>{let{toasts:n,pausedAt:r}=gr(e,t),i=W(new Map).current,s=Q((m,h=wr)=>{if(i.has(m))return;let p=setTimeout(()=>{i.delete(m),a({type:4,toastId:m})},h);i.set(m,p)},[]);w(()=>{if(r)return;let m=Date.now(),h=n.map(p=>{if(p.duration===1/0)return;let f=(p.duration||0)+p.pauseDuration-(m-p.createdAt);if(f<0){p.visible&&F.dismiss(p.id);return}return setTimeout(()=>F.dismiss(p.id,t),f)});return()=>{h.forEach(p=>p&&clearTimeout(p))}},[n,r,t]);let a=Q(Ge(t),[t]),c=Q(()=>{a({type:5,time:Date.now()})},[a]),l=Q((m,h)=>{a({type:1,toast:{id:m,height:h}})},[a]),u=Q(()=>{r&&a({type:6,time:Date.now()})},[r,a]),d=Q((m,h)=>{let{reverseOrder:p=!1,gutter:f=8,defaultPosition:g}=h||{},T=n.filter(E=>(E.position||g)===(m.position||g)&&E.height),q=T.findIndex(E=>E.id===m.id),N=T.filter((E,$)=>$<q&&E.visible).length;return T.filter(E=>E.visible).slice(...p?[N+1]:[0,N]).reduce((E,$)=>E+($.height||0)+f,0)},[n]);return w(()=>{n.forEach(m=>{if(m.dismissed)s(m.id,m.removeDelay);else{let h=i.get(m.id);h&&(clearTimeout(h),i.delete(m.id))}})},[n,s]),{toasts:n,handlers:{updateHeight:l,startPause:c,endPause:u,calculateOffset:d}}},Er=ue`
|
|
3
|
-
from {
|
|
4
|
-
transform: scale(0) rotate(45deg);
|
|
5
|
-
opacity: 0;
|
|
6
|
-
}
|
|
7
|
-
to {
|
|
8
|
-
transform: scale(1) rotate(45deg);
|
|
9
|
-
opacity: 1;
|
|
10
|
-
}`,kr=ue`
|
|
11
|
-
from {
|
|
12
|
-
transform: scale(0);
|
|
13
|
-
opacity: 0;
|
|
14
|
-
}
|
|
15
|
-
to {
|
|
16
|
-
transform: scale(1);
|
|
17
|
-
opacity: 1;
|
|
18
|
-
}`,Sr=ue`
|
|
19
|
-
from {
|
|
20
|
-
transform: scale(0) rotate(90deg);
|
|
21
|
-
opacity: 0;
|
|
22
|
-
}
|
|
23
|
-
to {
|
|
24
|
-
transform: scale(1) rotate(90deg);
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}`,Pr=fe("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: ${Er} 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: ${kr} 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: ${Sr} 0.15s ease-out forwards;
|
|
56
|
-
animation-delay: 180ms;
|
|
57
|
-
transform: rotate(90deg);
|
|
58
|
-
}
|
|
59
|
-
`,Tr=ue`
|
|
60
|
-
from {
|
|
61
|
-
transform: rotate(0deg);
|
|
62
|
-
}
|
|
63
|
-
to {
|
|
64
|
-
transform: rotate(360deg);
|
|
65
|
-
}
|
|
66
|
-
`,xr=fe("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: ${Tr} 1s linear infinite;
|
|
75
|
-
`,Ir=ue`
|
|
76
|
-
from {
|
|
77
|
-
transform: scale(0) rotate(45deg);
|
|
78
|
-
opacity: 0;
|
|
79
|
-
}
|
|
80
|
-
to {
|
|
81
|
-
transform: scale(1) rotate(45deg);
|
|
82
|
-
opacity: 1;
|
|
83
|
-
}`,Nr=ue`
|
|
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
|
-
}`,Cr=fe("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: ${Ir} 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: ${Nr} 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
|
-
`,Or=fe("div")`
|
|
125
|
-
position: absolute;
|
|
126
|
-
`,Ar=fe("div")`
|
|
127
|
-
position: relative;
|
|
128
|
-
display: flex;
|
|
129
|
-
justify-content: center;
|
|
130
|
-
align-items: center;
|
|
131
|
-
min-width: 20px;
|
|
132
|
-
min-height: 20px;
|
|
133
|
-
`,Lr=ue`
|
|
134
|
-
from {
|
|
135
|
-
transform: scale(0.6);
|
|
136
|
-
opacity: 0.4;
|
|
137
|
-
}
|
|
138
|
-
to {
|
|
139
|
-
transform: scale(1);
|
|
140
|
-
opacity: 1;
|
|
141
|
-
}`,qr=fe("div")`
|
|
142
|
-
position: relative;
|
|
143
|
-
transform: scale(0.6);
|
|
144
|
-
opacity: 0.4;
|
|
145
|
-
min-width: 20px;
|
|
146
|
-
animation: ${Lr} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
147
|
-
forwards;
|
|
148
|
-
`,Rr=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?U(qr,null,t):t:n==="blank"?null:U(Ar,null,U(xr,{...r}),n!=="loading"&&U(Or,null,n==="error"?U(Pr,{...r}):U(Cr,{...r})))},jr=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
|
-
`,Dr=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
|
-
`,$r="0%{opacity:0;} 100%{opacity:1;}",Mr="0%{opacity:1;} 100%{opacity:0;}",Fr=fe("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
|
-
`,Br=fe("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
|
-
`,Wr=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=an()?[$r,Mr]:[jr(n),Dr(n)];return{animation:t?`${ue(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${ue(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Ur=Hn(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Wr(e.position||t||"top-center",e.visible):{opacity:0},s=U(Rr,{toast:e}),a=U(Br,{...e.ariaProps},Ke(e.message,e));return U(Fr,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):U(z,null,s,a))});mr(U);var Qr=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=Q(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 U("div",{ref:s,className:t,style:n},i)},Hr=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:an()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},Kr=ze`
|
|
174
|
-
z-index: 9999;
|
|
175
|
-
> * {
|
|
176
|
-
pointer-events: auto;
|
|
177
|
-
}
|
|
178
|
-
`,$e=16,Vr=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,toasterId:s,containerStyle:a,containerClassName:c})=>{let{toasts:l,handlers:u}=_r(n,s);return U("div",{"data-rht-toaster":s||"",style:{position:"fixed",zIndex:9999,top:$e,left:$e,right:$e,bottom:$e,pointerEvents:"none",...a},className:c,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(d=>{let m=d.position||t,h=u.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),p=Hr(m,h);return U(Qr,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Kr:"",style:p},d.type==="custom"?Ke(d.message,d):i?i(d):U(Ur,{toast:d,position:m}))}))},b=F;function Ye(e){const t={subscribe(n){let r=null,i=!1,s=!1,a=!1;function c(){if(r===null){a=!0;return}s||(s=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(l){var u;i||(u=n.next)===null||u===void 0||u.call(n,l)},error(l){var u;i||(i=!0,(u=n.error)===null||u===void 0||u.call(n,l),c())},complete(){var l;i||(i=!0,(l=n.complete)===null||l===void 0||l.call(n),c())}}),a&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(zr,t)}};return t}function zr(e,t){return t(e)}function Gr(e){const t=new AbortController;return new Promise((n,r)=>{let i=!1;function s(){i||(i=!0,a.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const a=e.subscribe({next(c){i=!0,n(c),s()},error(c){r(c)},complete(){t.abort(),s()}})})}function Yr(e){return t=>{let n=0,r=null;const i=[];function s(){r||(r=t.subscribe({next(c){for(const u of i){var l;(l=u.next)===null||l===void 0||l.call(u,c)}},error(c){for(const u of i){var l;(l=u.error)===null||l===void 0||l.call(u,c)}},complete(){for(const l of i){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 Ye(c=>(n++,i.push(c),s(),{unsubscribe(){n--,a();const l=i.findIndex(u=>u===c);l>-1&&i.splice(l,1)}}))}}function Jr(e){let t=e;const n=[],r=a=>{t!==void 0&&a.next(t),n.push(a)},i=a=>{n.splice(n.indexOf(a),1)},s=Ye(a=>(r(a),()=>{i(a)}));return s.next=a=>{if(t!==a){t=a;for(const c of n)c.next(a)}},s.get=()=>t,s}function Zr(e){return Ye(t=>{function n(r=0,i=e.op){const s=e.links[r];if(!s)throw new Error("No more links to execute - did you forget to add an ending link?");return s({op:i,next(a){return n(r+1,a)}})}return n().subscribe(t)})}function Ae(e){"@babel/helpers - typeof";return Ae=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},Ae(e)}function Xr(e,t){if(Ae(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ae(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eo(e){var t=Xr(e,"string");return Ae(t)=="symbol"?t:t+""}function V(e,t,n){return(t=eo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ct(Object(n),!0).forEach(function(r){V(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ct(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function pe(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function to(e){return typeof e=="function"}function no(){return Object.create(null)}const ro=typeof Symbol=="function"&&!!Symbol.asyncIterator;function oo(e){return ro&&pe(e)&&Symbol.asyncIterator in e}const io=e=>e(),mn=()=>{},Ot=e=>{Object.freeze&&Object.freeze(e)};function hn(e,t,n){var r;const i=t.join(".");return(r=n[i])!==null&&r!==void 0||(n[i]=new Proxy(mn,{get(s,a){if(!(typeof a!="string"||a==="then"))return hn(e,[...t,a],n)},apply(s,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)}),Ot(u.args),Ot(u.path),e(u)}})),n[i]}const pn=e=>hn(e,[],no()),so=e=>new Proxy(mn,{get(t,n){if(n!=="then")return e(n)}});function Le(e){"@babel/helpers - typeof";return Le=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},Le(e)}function ao(e,t){if(Le(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Le(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function co(e){var t=ao(e,"string");return Le(t)=="symbol"?t:t+""}function at(e,t,n){return(t=co(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Me(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?At(Object(n),!0).forEach(function(r){at(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var lo=class extends Error{constructor(e){super(uo(e)),Object.assign(this,e)}};function uo(e){if("message"in e)return String(e.message)}function mo(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(pe(e))return new lo(e)}}var Lt=class extends Error{constructor(e){var t,n,r;const i=mo(e.cause),s=(t=(n=e.message)!==null&&n!==void 0?n:i?.message)!==null&&t!==void 0?t:e.code;super(s,{cause:i}),at(this,"cause",void 0),at(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=i)}};function ho(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:Me(Me({},e),{},{error:n})}}return{ok:!0,result:Me(Me({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var Xe=class extends Error{constructor(){super("Unable to transform response from server")}};function po(e,t){let n;try{n=ho(e,t)}catch{throw new Xe}if(!n.ok&&(!pe(n.error.error)||typeof n.error.error.code!="number"))throw new Xe;if(n.ok&&!pe(n.result))throw new Xe;return n}function fo(e){return typeof e=="function"}async function yo(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const i=Object.keys(n.lazy).find(s=>t===s||t.startsWith(s+"."));if(!i)return null;await n.lazy[i].load(),r=n.procedures[t]}return r}async function vo(e){const{type:t,path:n}=e,r=await yo(e.router,n);if(!r||!fo(r)||r._def.type!==t&&!e.allowMethodOverride)throw new Lt({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new Lt({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}function go(e){return e instanceof Ve}function bo(e){return pe(e)&&pe(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function wo(e,t){return typeof e=="string"?e:pe(e)&&typeof e.message=="string"?e.message:t}var Ve=class Qe extends Error{constructor(t,n){var r,i;const s=n?.cause;super(t,{cause:s}),V(this,"cause",void 0),V(this,"shape",void 0),V(this,"data",void 0),V(this,"meta",void 0),this.meta=n?.meta,this.cause=s,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(i=n.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Qe.prototype)}static from(t,n={}){const r=t;return go(r)?(n.meta&&(r.meta=B(B({},r.meta),n.meta)),r):bo(r)?new Qe(r.error.message,B(B({},n),{},{result:r,cause:n.cause})):new Qe(wo(r,"Unknown error"),B(B({},n),{},{cause:r}))}};function _o(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 qt=e=>typeof e=="function";function Eo(e){if(e)return e;if(typeof window<"u"&&qt(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&qt(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function ko(...e){const t=new AbortController,n=e.length;let r=0;const i=()=>{++r===n&&t.abort()};for(const s of e)s?.aborted?i():s?.addEventListener("abort",i,{once:!0});return t.signal}function So(...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 Po(e){return{url:e.url.toString(),fetch:e.fetch,transformer:_o(e.transformer),methodOverride:e.methodOverride}}function To(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const xo={query:"GET",mutation:"POST",subscription:"PATCH"};function fn(e){return"input"in e?e.transformer.input.serialize(e.input):To(e.inputs.map(t=>e.transformer.input.serialize(t)))}const yn=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 i=fn(e);i!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(i))}`)}return r.length&&(n+="?"+r.join("&")),n},Io=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=fn(e);return t!==void 0?JSON.stringify(t):void 0},No=e=>Lo(B(B({},e),{},{contentTypeHeader:"application/json",getUrl:yn,getBody:Io}));var Co=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Oo=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 Co};async function Ao(e){var t,n;Oo(e.signal);const r=e.getUrl(e),i=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:xo[e.type],a=await(async()=>{const l=await e.headers();return Symbol.iterator in l?Object.fromEntries(l):l})(),c=B(B(B({},e.contentTypeHeader&&s!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),a);return Eo(e.fetch)(r,{method:s,signal:e.signal,body:i,headers:c})}async function Lo(e){const t={},n=await Ao(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const Rt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function jt(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function i(c){const l=[[]];let u=0;for(;;){const h=c[u];if(!h)break;const p=l[l.length-1];if(h.aborted){var d;(d=h.reject)===null||d===void 0||d.call(h,new Error("Aborted")),u++;continue}if(e.validate(p.concat(h).map(f=>f.key))){p.push(h),u++;continue}if(p.length===0){var m;(m=h.reject)===null||m===void 0||m.call(h,new Error("Input is too big for a single dispatch")),u++;continue}l.push([])}return l}function s(){const c=i(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(h,p)=>{const f=u.items[p];try{var g;const q=await Promise.resolve(h);(g=f.resolve)===null||g===void 0||g.call(f,q)}catch(q){var T;(T=f.reject)===null||T===void 0||T.call(f,q)}f.batch=null,f.reject=null,f.resolve=null}));for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,new Error("Missing result")),h.batch=null}}).catch(d=>{for(const h of u.items){var m;(m=h.reject)===null||m===void 0||m.call(h,d),h.batch=null}})}}function a(c){var l;const u={aborted:!1,key:c,batch:null,resolve:Rt,reject:Rt},d=new Promise((m,h)=>{var p;u.reject=h,u.resolve=m,(p=t)!==null&&p!==void 0||(t=[]),t.push(u)});return(l=n)!==null&&l!==void 0||(n=setTimeout(s)),d}return{load:a}}function qo(e){var t,n;const r=Po(e),i=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,s=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const a=l=>({validate(u){if(i===1/0&&s===1/0)return!0;if(u.length>s)return!1;const d=u.map(h=>h.path).join(","),m=u.map(h=>h.input);return yn(B(B({},r),{},{type:l,path:d,inputs:m,signal:null})).length<=i},async fetch(u){const d=u.map(f=>f.path).join(","),m=u.map(f=>f.input),h=ko(...u.map(f=>f.signal)),p=await No(B(B({},r),{},{path:d,inputs:m,type:l,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:u}):e.headers:{}},signal:h}));return(Array.isArray(p.json)?p.json:u.map(()=>p.json)).map(f=>({meta:p.meta,json:f}))}}),c={query:jt(a("query")),mutation:jt(a("mutation"))};return({op:l})=>Ye(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(B(B({},l),{},{signal:So(l.signal,d.signal)}));let h=!1,p;return m.then(f=>{h=!0,p=f;const g=po(f.json,r.transformer.output);if(!g.ok){u.error(Ve.from(g.error,{meta:f.meta}));return}u.next({context:f.meta,result:g.result}),u.complete()}).catch(f=>{h=!0,u.error(Ve.from(f,{meta:p?.meta}))}),()=>{h||d.abort()}})}}const vn=(e,...t)=>typeof e=="function"?e(...t):e;function Ro(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function jo(e){const t=await vn(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function Do(e,t){const n={method:"connectionParams",data:await vn(e)};return t.encode(n)}function $o(e){const{promise:t,resolve:n,reject:r}=Ro();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function Mo(e,{intervalMs:t,pongTimeoutMs:n}){let r,i;function s(){r=setTimeout(()=>{e.send("PING"),i=setTimeout(()=>{e.close()},n)},t)}function a(){clearTimeout(r),s()}function c(){clearTimeout(i),a()}e.addEventListener("open",s),e.addEventListener("message",({data:l})=>{clearTimeout(r),s(),l==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(i)})}var Fo=class ct{constructor(t){var n;if(V(this,"id",++ct.connectCount),V(this,"WebSocketPonyfill",void 0),V(this,"urlOptions",void 0),V(this,"keepAliveOpts",void 0),V(this,"encoder",void 0),V(this,"wsObservable",Jr(null)),V(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=++ct.connectCount;const t=jo(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&&Mo(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await $o(n),this.urlOptions.connectionParams&&n.send(await Do(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()}}};V(Fo,"connectCount",0);var gn=class{constructor(e){V(this,"links",void 0),V(this,"runtime",void 0),V(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return Zr({links:this.links,op:B(B({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(Yr())}async requestAsPromise(e){try{const t=this.$request(e);return(await Gr(t)).result.data}catch(t){throw Ve.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 i;(i=n.onConnectionStateChange)===null||i===void 0||i.call(n,r.result);break;case"started":var s;(s=n.onStarted)===null||s===void 0||s.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 i;(i=n.onError)===null||i===void 0||i.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const bn=Symbol.for("trpc_untypedClient"),Bo={query:"query",mutate:"mutation",subscribe:"subscription"},Wo=e=>Bo[e];function Uo(e){const t=pn(({path:n,args:r})=>{const i=[...n],s=Wo(i.pop()),a=i.join(".");return e[s](a,...r)});return so(n=>n===bn?e:t[n])}function Qo(e){return Uo(new gn(e))}function Ho(e){return e[bn]}function qe(e){"@babel/helpers - typeof";return qe=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},qe(e)}function Ko(e,t){if(qe(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Vo(e){var t=Ko(e,"string");return qe(t)=="symbol"?t:t+""}function zo(e,t,n){return(t=Vo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Dt(Object(n),!0).forEach(function(r){zo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Go(e){var t,n,r,i=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new He(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function He(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(i){return{value:i,done:r}})}return He=function(r){this.s=r,this.n=r.next},He.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var i=this.s.return;return i===void 0?Promise.resolve({value:r,done:!0}):t(i.apply(this.s,arguments))},throw:function(r){var i=this.s.return;return i===void 0?Promise.reject(r):t(i.apply(this.s,arguments))}},new He(e)}function Yo(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 Jo(e,t){if(e==null)return{};var n,r,i=Yo(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}const Zo=["cursor","direction"];function Je(e){return{path:e.path.join(".")}}function Xo(e){return e.length>=3}function ei(e){return Xo(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function wt(e,t,n){var r;const i=ei(e);let s=(r=i.args)===null||r===void 0?void 0:r.input;if(n){var a,c;s=x(x(x({},(a=(c=i.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[i.path.join("."),s,t?.trpc]}async function ti(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const i=[];var s=!1,a=!1,c;try{for(var l=Go(e),u;s=!(u=await l.next()).done;s=!1){const d=u.value;i.push(d),r.setState({data:[...i]})}}catch(d){a=!0,c=d}finally{try{s&&l.return!=null&&await l.return()}finally{if(a)throw c}}return i}function se(e){const t=io(()=>{const{input:n,type:r}=e,i=e.path.flatMap(s=>s.split("."));if(!n&&r==="any")return i.length?[i]:[];if(r==="infinite"&&pe(n)&&("direction"in n||"cursor"in n)){const{cursor:s,direction:a}=n;return[i,{input:Jo(n,Zo),type:"infinite"}]}return[i,x(x({},typeof n<"u"&&n!==be&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function wn(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function _t(e){return to(e)?e():e}function ni(e){var t;const{input:n,query:r,path:i,queryKey:s,opts:a}=e,c=n===be,l=async u=>{var d;const m=x(x({},a),{},{trpc:x(x({},a?.trpc),!(a==null||(d=a.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})});return await r(...wt(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(er(x(x({},a??{}),{},{queryKey:s,queryFn:c?be:l,initialPageParam:(t=a?.initialCursor)!==null&&t!==void 0?t:n?.cursor})),{trpc:Je({path:i})})}function ri(e){var t,n;const{mutate:r,path:i,prefix:s,opts:a,overrides:c}=e,l=_t(e.queryClient),u=wn({path:i,prefix:(t=a?.keyPrefix)!==null&&t!==void 0?t:s}),d=l.defaultMutationOptions(l.getMutationDefaults(u)),m=(n=c?.onSuccess)!==null&&n!==void 0?n:(p=>p.originalFn()),h=async p=>await r(...wt([...u,{input:p}],a));return x(x({},a),{},{mutationKey:u,mutationFn:h,onSuccess(...p){var f,g;return m({originalFn:()=>{var q,N,E;return(q=a==null||(N=a.onSuccess)===null||N===void 0?void 0:N.call(a,...p))!==null&&q!==void 0?q:d==null||(E=d.onSuccess)===null||E===void 0?void 0:E.call(d,...p)},queryClient:l,meta:(f=(g=a?.meta)!==null&&g!==void 0?g:d?.meta)!==null&&f!==void 0?f:{}})},trpc:Je({path:i})})}function oi(e){const{input:t,query:n,path:r,queryKey:i,opts:s}=e,a=_t(e.queryClient),c=t===be,l=async u=>{var d;const m=x(x({},s),{},{trpc:x(x({},s?.trpc),!(s==null||(d=s.trpc)===null||d===void 0)&&d.abortOnUnmount?{signal:u.signal}:{signal:null})}),h=u.queryKey,p=await n(...wt(h,m));return oo(p)?ti(p,a,h):p};return Object.assign(tr(x(x({},s),{},{queryKey:i,queryFn:c?be:l})),{trpc:Je({path:r})})}const ii=e=>{const{subscribe:t,path:n,queryKey:r,input:i,opts:s={}}=e,a="enabled"in s?!!s.enabled:i!==be,c=l=>t(n.join("."),i===be?void 0:i,l);return x(x({},s),{},{enabled:a,subscribe:c,queryKey:r,trpc:Je({path:n})})};function si(e){const t=e.keyPrefix,n=r=>(i,s,a)=>"router"in e?Promise.resolve(_t(e.ctx)).then(c=>vo({router:e.router,path:i,getRawInput:async()=>s,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof gn?e.client:Ho(e.client))[r](i,s,a);return pn(({args:r,path:i})=>{const s=[...i],a=s.pop(),[c,l]=r;return{"~types":void 0,pathKey:()=>se({path:s,type:"any",prefix:t}),pathFilter:()=>x(x({},c),{},{queryKey:se({path:s,type:"any",prefix:t})}),queryOptions:()=>oi({input:c,opts:l,path:s,queryClient:e.queryClient,queryKey:se({path:s,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>se({path:s,input:c,type:"query",prefix:t}),queryFilter:()=>x(x({},l),{},{queryKey:se({path:s,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>ni({input:c,opts:l,path:s,queryKey:se({path:s,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>se({path:s,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>x(x({},l),{},{queryKey:se({path:s,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var u;return ri({opts:c,path:s,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(u=e.overrides)===null||u===void 0?void 0:u.mutations})},mutationKey:()=>wn({path:s,prefix:t}),subscriptionOptions:()=>ii({opts:l,path:s,input:c,queryKey:se({path:s,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[a]()})}function ai(){const e=ce(null),t=ce(null),n=s=>{const a=Te(()=>si({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return U(e.Provider,{value:s.trpcClient},U(t.Provider,{value:a},s.children))};n.displayName="TRPCProvider";function r(){const s=le(t);if(!s)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return s}function i(){const s=le(e);if(!s)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return s}return{TRPCProvider:n,useTRPC:r,useTRPCClient:i}}const lt={lan:new Set,animepahe:new Set,jasmr:new Set};function ge(e){for(const t of[...lt[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function _n(e,t){return lt[e].add(t),()=>{lt[e].delete(t)}}const ci=(e,t)=>new Promise((n,r)=>{t?.throwIfAborted();const i=()=>{clearTimeout(s),r(t?.reason)},s=setTimeout(()=>{t?.removeEventListener("abort",i),n()},e);t?.addEventListener("abort",i,{once:!0})}),Et=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 i=n?.url??e.toString(),s=i.startsWith("/")&&!i.startsWith("//")||typeof window<"u"&&new URL(i,window.location.origin).origin===window.location.origin;if(s){let m=localStorage.getItem("animepahe_ua"),h=localStorage.getItem("animepahe_cookie");h&&m&&m!==navigator.userAgent&&(localStorage.removeItem("animepahe_cookie"),localStorage.removeItem("animepahe_ua"),h=null,m=null,b.error("Your browser changed. Verify AnimePahe again to refresh its cookie."),ge("animepahe"));const p=localStorage.getItem("jasmr_ua"),f=localStorage.getItem("jasmr_cookie");m&&r.set("x-animepahe-ua",m),h&&r.set("x-animepahe-cookie",h),p&&r.set("x-jasmr-ua",p),f&&r.set("x-jasmr-cookie",f)}new Headers(t?.headers).forEach((m,h)=>r.set(h,m));const a={...t,headers:r},c=(t?.method??n?.method??"GET").toUpperCase(),l=t?.signal??n?.signal,u=s&&(c==="GET"||c==="HEAD");let d=await fetch(e,a);for(let m=0;u&&d.status===503&&d.headers.get("x-dango-not-ready")==="1"&&m<3;m++)await d.body?.cancel(),await ci(500*2**m,l),d=await fetch(e,a);return d},li=async(e,t)=>{const n=await Et(e,t);if(!n.ok){const r=await n.text().catch(()=>"");let i={};try{i=JSON.parse(r)}catch{}const s=typeof i.error=="string"?i.error:"";throw n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="animepahe"&&ge("animepahe"),n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="jasmr"&&ge("jasmr"),n.status===401&&s==="LAN_AUTH_REQUIRED"&&ge("lan"),new Error(s||`Failed to fetch from ${e}`)}return n.json()};async function ui(e,t){const n=await Et(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&ge("lan")}catch{}return await di(n),n}async function di(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 i=r?.error;if(!i||typeof i!="object")continue;const s=i.data?.cause;(i.message==="AUTH_REQUIRED"||s?.code==="AUTH_REQUIRED")&&(s?.provider==="animepahe"||s?.provider==="jasmr")&&ge(s.provider),(i.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&ge("lan")}}catch{}}const{TRPCProvider:mi,useTRPC:A}=ai(),X=Qo({links:[qo({url:"/api/trpc",fetch:ui})]}),Ie=new Map,hi=500,pi=(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 i=`${r}-${t}-${n}`;if(Ie.has(i))return Ie.get(i);let s;if(r.startsWith("https://s4.anilist.co"))s=r,t&&(s+=`${s.includes("?")?"&":"?"}w=${t}`),n&&(s+=`${s.includes("?")?"&":"?"}h=${n}`);else if(r.includes("animepahe")){s=`/api/image-proxy?url=${encodeURIComponent(r)}`;const a=localStorage.getItem("animepahe_cookie"),c=localStorage.getItem("animepahe_ua");a&&(s+=`&cookie=${encodeURIComponent(a)}`),c&&(s+=`&ua=${encodeURIComponent(c)}`)}else if(r.startsWith("http"))s=`/api/image-proxy?url=${encodeURIComponent(r)}`,t&&(s+=`&w=${t}`),n?s+=`&h=${n}`:t||(s+="&w=300");else{const c=`${r.startsWith("mcovers")||r.startsWith("images2")?"https://aln.youtube-anime.com":"https://aln.youtube-anime.com/images"}/${r}`;s=`/api/image-proxy?url=${encodeURIComponent(c)}`,t&&(s+=`&w=${t}`),n?s+=`&h=${n}`:t||(s+="&w=300")}return Ie.size>hi&&Ie.clear(),Ie.set(i,s),s},hl=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 pl(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim():""}function fl(e){return e==null?e:e>10?Number((e/10).toFixed(1)):e}const fi=(...e)=>e.filter(Boolean).join(" ");function yi(e,t,n="..."){return e?e.length>t?e.slice(0,t)+n:e:""}const En=ce(void 0),vi=()=>{const e=le(En);if(e===void 0)throw new Error("useTitlePreference must be used within a TitlePreferenceProvider");return e},O={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"},yl=()=>{const e=A(),t=G({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1});return{...t,data:t.data}},vl=(e="TRENDING_DESC",t=10)=>gt({queryKey:[O.trendingList,e,t],queryFn:({pageParam:n=1})=>X.data.popularList.query({sort:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),gl=(e="TV",t=12)=>gt({queryKey:[O.latestReleases,e,t],queryFn:({pageParam:n=1})=>X.data.latestReleases.query({format:e,page:n,size:t}),initialPageParam:1,getNextPageParam:(n,r)=>n.length>=t?r.length+1:void 0}),bl=(e,t="TV",n=!0)=>{const r=A();return G({...r.data.seasonal.queryOptions({page:e,format:t}),enabled:n,staleTime:1e3*60*5})},gi=["query","sortBy","type","status","season","year","country","genres","excludeGenres","excludeTags","minScore","minEpisodes","adult"],wl=(e,t,n=14)=>{const r=A(),i=new URLSearchParams(e),s={page:t,limit:n};for(const a of gi){const c=i.get(a);c!==null&&(s[a]=c)}return G({...r.data.search.queryOptions(s),enabled:e!=null})},_l=()=>{const e=A();return G(e.queue.list.queryOptions())},bi=()=>{const e=A(),t=H();return ee(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?b.success("Added to queue"):b.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]})},onError:n=>{b.error(`Failed to update queue: ${n.message}`)}}))},El=()=>{const e=A(),t=H();return ee(e.queue.remove.mutationOptions({onSuccess:()=>{b.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},kl=(e,t=!0)=>G({queryKey:[O.queueRemaining,e],queryFn:()=>X.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),Sl=()=>{const e=A(),t=H();return ee(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const i=n.added??r.episodeNumbers.length;b.success(`${i} ${i===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]})},onError:n=>{b.error(`Failed to update queue: ${n.message}`)}}))},Pl=()=>{const e=A(),t=H();return ee(e.queue.removeMany.mutationOptions({onSuccess:()=>{b.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},Tl=()=>{const e=A(),t=H();return ee(e.queue.clear.mutationOptions({onSuccess:()=>{b.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{b.error(`Failed to clear queue: ${n.message}`)}}))},xl=()=>{const e=A(),t=H(),n=e.queue.list.queryOptions().queryKey;return ee(e.queue.reorder.mutationOptions({onMutate:async r=>{await t.cancelQueries({queryKey:n});const i=t.getQueryData(n);return t.setQueryData(n,s=>{if(!s)return s;const a=new Map(s.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:i}},onError:(r,i,s)=>{s?.previousQueue&&t.setQueryData(n,s.previousQueue)},onSettled:()=>{t.invalidateQueries(e.queue.pathFilter())}}))},wi=["status","showMature","query","type","season","year","genres","excludeGenres","sortBy","titlePreference"];function kt(e,t,n){const r=new URLSearchParams(e),i={page:t,limit:n};for(const s of wi){const a=r.get(s);a!==null&&(i[s]=a)}return i}const Il=(e,t="",n,r=14)=>G({queryKey:[O.watchlist,e,t,n,r],queryFn:async()=>{const i=new URLSearchParams(t);return i.set("status",e),await X.watchlist.list.query(kt(i.toString(),n,r))}}),Nl=(e="")=>gt({queryKey:[O.continueWatching,e],queryFn:async({pageParam:t=1})=>await X.watchlist.continueWatchingAll.query(kt(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)})}),Cl=(e="",t,n=14)=>G({queryKey:[O.continueWatching,e,t,n],queryFn:async()=>await X.watchlist.continueWatchingAll.query(kt(e,t,n))}),Ol=()=>{const e=A(),t=H();return ee(e.watchlist.remove.mutationOptions({onSuccess:()=>{b.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[O.watchlist]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},Al=()=>{const e=A(),t=H();return ee(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{b.success(`Status updated for ${n.updated??0} items`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[O.watchlist]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{b.error(`Failed to update statuses: ${n.message}`)}}))},Ll=()=>{const e=A(),t=H();return ee(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;b.success(`Removed ${r} ${r===1?"item":"items"} from watchlist`),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[O.watchlist]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},ql=()=>{const e=A(),t=H();return ee(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;b.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{b.error(`Failed to remove: ${n.message}`)}}))},kn=(e=!0)=>{const t=A();return G({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},Sn=(e=!0)=>{const t=A();return G({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},Pn=(e=!0)=>{const t=A();return G({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},_i=()=>{const e=A(),t=H(),n=e.discovery.status.queryOptions().queryKey;return ee(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:[O.notifications]})},onError:()=>{t.invalidateQueries({queryKey:n})}}))},Ei=()=>{const e=A(),t=H();return ee(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},ki=()=>{const e=A(),t=H();return ee(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Rl=()=>{const e=A();return G({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},jl=()=>{const e=A();return G({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},Dl=()=>G({queryKey:[O.genreCards],queryFn:()=>X.insights.genreCards.query()}),Si="_container_vk8jv_1",Pi="_bellBtn_vk8jv_7",Ti="_badge_vk8jv_56",xi="_dropdown_vk8jv_96",Ii="_dropdownHeader_vk8jv_127",Ni="_clearAllBtn_vk8jv_141",Ci="_discoveryStatusRow_vk8jv_159",Oi="_statusDot_vk8jv_170",Ai="_statusDotRunning_vk8jv_177",Li="_statusDotOk_vk8jv_182",qi="_statusDotInfo_vk8jv_186",Ri="_statusDotError_vk8jv_190",ji="_statusDotIdle_vk8jv_194",Di="_list_vk8jv_208",$i="_item_vk8jv_222",Mi="_thumbnail_vk8jv_237",Fi="_itemInfo_vk8jv_246",Bi="_itemTitle_vk8jv_251",Wi="_itemMeta_vk8jv_262",Ui="_systemItemMeta_vk8jv_272",Qi="_removeItem_vk8jv_289",Hi="_queueItem_vk8jv_319",Ki="_emptyState_vk8jv_323",Vi="_notificationDivider_vk8jv_371",v={container:Si,bellBtn:Pi,badge:Ti,dropdown:xi,dropdownHeader:Ii,clearAllBtn:Ni,discoveryStatusRow:Ci,statusDot:Oi,statusDotRunning:Ai,statusDotOk:Li,statusDotInfo:qi,statusDotError:Ri,statusDotIdle:ji,list:Di,item:$i,thumbnail:Mi,itemInfo:Fi,itemTitle:Bi,itemMeta:Wi,systemItemMeta:Ui,removeItem:Qi,queueItem:Hi,emptyState:Ki,notificationDivider:Vi},zi=({notification:e})=>{const t=Ei(),n=bi(),[r,i]=ft.useState(!1),s=d=>{d.preventDefault(),d.stopPropagation(),t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},a=()=>{t.mutate({showId:e.showId,episodeNumber:e.episodeNumber})},c=d=>{d.preventDefault(),d.stopPropagation(),i(!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(()=>i(!1),1e3)},{titlePreference:l}=vi(),u=l==="nativeName"?e.nativeName||e.name:l==="englishName"&&e.englishName||e.name;return o(Z,{to:`/watch/${e.showId}/${e.episodeNumber}`,className:v.item,onClick:a,children:[o("img",{src:pi(e.thumbnail,48,64),alt:e.name,className:v.thumbnail,loading:"lazy",decoding:"async"}),o("div",{className:v.itemInfo,children:[o("span",{className:v.itemTitle,children:u}),o("span",{className:v.itemMeta,children:["New Episode ",e.episodeNumber]})]}),o("button",{className:`${v.removeItem} ${v.queueItem}`,onClick:c,"aria-label":"Add notification to queue",children:r?o(_,{name:"check"}):o(_,{name:"plus"})}),o("button",{className:v.removeItem,onClick:s,"aria-label":"Remove notification",children:o(_,{name:"times"})})]})};function et({width:e="100%",height:t="1em",variant:n="rectangular",className:r="",style:i}){return o("div",{className:`skeleton skeleton-${n} ${r}`,style:{width:e,height:t,...i}})}const Gi=({count:e=3})=>o(z,{children:Array.from({length:e}).map((t,n)=>o("div",{className:v.item,style:{borderBottom:"1px solid var(--border-primary)",pointerEvents:"none"},children:[o("div",{className:v.thumbnail,style:{overflow:"hidden"},children:o(et,{width:"100%",height:"100%",variant:"rectangular"})}),o("div",{className:v.itemInfo,children:[o(et,{width:"80%",height:"1rem",variant:"text",style:{marginBottom:"4px"}}),o(et,{width:"40%",height:"0.7rem",variant:"rectangular",style:{borderRadius:"var(--radius-sm)"}})]})]},n))}),Yi=()=>{const{data:e=[],isLoading:t}=kn(),{data:n=[]}=Sn(),{data:r}=Pn(),i=ki(),s=H(),[a,c]=S(null);w(()=>{s.invalidateQueries({queryKey:[O.notifications]})},[s]);const l=()=>{i.mutate(void 0)},u=n.find(d=>d.id===a)??null;return o("div",{className:v.dropdown,children:[o("div",{className:v.dropdownHeader,children:[o("h4",{children:"Notifications"}),e.length>0&&o("button",{className:v.clearAllBtn,onClick:l,children:"Clear All"})]}),o("div",{className:v.discoveryStatusRow,children:r?.running?o(z,{children:[o("span",{className:`${v.statusDot} ${v.statusDotRunning}`,"aria-hidden":"true"}),o("span",{children:r.total>0?`Checking ${Math.min(r.done,r.total)}/${r.total} shows...`:"Checking for new episodes..."})]}):r?.state==="complete"?o(z,{children:[o("span",{className:`${v.statusDot} ${v.statusDotOk}`,"aria-hidden":"true"}),o("span",{children:["Discovery complete - checked ",r.total," ",r.total===1?"show":"shows"]})]}):r?.state==="empty"?o(z,{children:[o("span",{className:`${v.statusDot} ${v.statusDotInfo}`,"aria-hidden":"true"}),o("span",{children:"No shows set to Watching - nothing to check"})]}):r?.state==="error"?o(z,{children:[o("span",{className:`${v.statusDot} ${v.statusDotError}`,"aria-hidden":"true"}),o("span",{children:"Last check failed - will retry automatically"})]}):o(z,{children:[o("span",{className:`${v.statusDot} ${v.statusDotIdle}`,"aria-hidden":"true"}),o("span",{children:r?.lastRunAt?`Last checked ${Math.max(1,Math.round((Date.now()-r.lastRunAt)/1e3))}s ago`:"Auto-checks every few minutes"})]})}),o("div",{className:v.list,children:t&&n.length===0?o(Gi,{count:4}):o(z,{children:[n.map(d=>o("div",{className:v.item,children:[o("div",{className:v.thumbnail,style:{background:"transparent",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:0,boxShadow:"none"},children:o(_,{name:"info-circle",size:32,color:"#6c9fff"})}),o("div",{className:v.itemInfo,children:[o("span",{className:v.itemTitle,children:d.title}),o("button",{type:"button",className:v.systemItemMeta,onClick:()=>c(d.id),title:"View full status",children:yi(d.message,40,"…")})]}),o("button",{className:v.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(_,{name:"plus"})}),o("button",{className:v.removeItem,disabled:!0,style:{opacity:.3,cursor:"not-allowed"},"aria-hidden":"true",children:o(_,{name:"times"})})]},d.id)),n.length>0&&e.length>0&&o("div",{className:v.notificationDivider}),e.length>0?e.map(d=>o(zi,{notification:d},d.id)):!t&&n.length===0&&o("div",{className:v.emptyState,children:"No new notifications"})]})}),u&&yt(o("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.6)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:"1rem",backdropFilter:"blur(3px)"},onClick:()=>c(null),children:o("div",{style:{backgroundColor:"var(--bg-secondary)",padding:"1.5rem",borderRadius:"var(--radius-lg)",maxWidth:"420px",width:"100%",boxShadow:"var(--shadow-xl)",border:"1px solid var(--border-primary)"},onClick:d=>d.stopPropagation(),children:[o("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginBottom:"1rem"},children:[o(_,{name:"info-circle",color:"#6c9fff"}),o("span",{style:{color:"#fff",fontWeight:600,fontSize:"1rem"},children:u.title})]}),o("p",{style:{color:"var(--text-secondary)",marginBottom:"1.5rem",lineHeight:1.5},children:u.message}),o("div",{style:{display:"flex",justifyContent:"flex-end"},children:o("button",{type:"button",onClick:()=>c(null),style:{background:"var(--accent)",color:"#fff",border:"none",padding:"0.5rem 1rem",borderRadius:"var(--radius-md)",cursor:"pointer",fontWeight:600},children:"OK"})})]})}),document.body)]})},Ji=()=>{const[e,t]=S(!1),n=W(null),r=H(),i=A(),s=_i(),{data:a=[]}=kn(),{data:c=[]}=Sn(),{data:l}=Pn(),u=a.length+c.length,d=u>5?"5+":u,m=W(!1);w(()=>{const p=f=>{n.current&&!n.current.contains(f.target)&&t(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),w(()=>{const p=!!l?.running;m.current&&!p&&(r.invalidateQueries(i.notifications.pathFilter()),r.invalidateQueries(i.discovery.pathFilter())),m.current=p},[l?.running,r,i]);const h=()=>{const p=!e;t(p),p&&s.mutate()};return o("div",{className:v.container,ref:n,children:[o("button",{className:v.bellBtn,onClick:h,"aria-label":"Notifications",children:[o(_,{name:"bell"}),u>0&&o("span",{className:v.badge,children:d})]}),e&&o(Yi,{})]})},Ze=e=>{const t=A();return G({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},Tn=()=>{const e=A(),t=H();return ee(e.settings.set.mutationOptions({onSuccess:()=>{b.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:[O.settings]})},onError:n=>{b.error(`Failed to update setting: ${n.message}`)}}))},xn=ce(void 0),Zi=()=>{const e=le(xn);if(e===void 0)throw new Error("useLowEndMode must be used within a LowEndModeProvider");return e},ie={x:-2.8,y:-2,w:48.6,h:14},ut=15,Pe={w:13.6,h:10.2},ae=[{x:0,y:.5},{x:ut,y:-.9},{x:ut*2,y:.3}],$t={x:Pe.w/2,y:Pe.h/2-.5},tt={y:Pe.h/2,x1:-2,x2:ut*2+Pe.w+1.4},Mt=(e,t,n,r=0)=>{if(n.width<=0)return-1;const i=n.width/ie.w,s=(e-n.left)/i+ie.x,a=(t-n.top)/i+ie.y;for(let c=0;c<ae.length;c++){const l=s-ae[c].x,u=a-ae[c].y;if(l>=-r&&l<=Pe.w+r&&u>=-r&&u<=Pe.h+r)return c}return-1},Ft=7.5,Bt=e=>Math.max(-1,Math.min(1,e)),Xi=(e,t,n,r)=>{const i=n.width/ie.w,s=(e-n.left)/i+ie.x-r.x-$t.x,a=(t-n.top)/i+ie.y-r.y-$t.y;return{x:Bt(s/Ft),y:Bt(a/Ft)}},es=["normal","squint"],ts={normal:.72,squint:.28},Wt=(e=Math.random(),t)=>{let n=0;for(const r of es)if(n+=ts[r],e<n)return r===t?r==="normal"?"squint":"normal":r;return"normal"},ns="pet",rs="sleep",os=6e3,is=420,ss=.5,Ut=3e3,as=3e3,cs=ae.map((e,t)=>t*260),nt={from:ae.length-2,to:ae.length-1,after:400},Qt="data-dango-face",rt="data-dango-hover",ot="data-dango-cheer",Ht="data-dango-nudge",ls=()=>document.querySelectorAll("svg[data-dango-gaze-origin]"),Fe=()=>document.querySelectorAll("[data-dango-face-slot]"),us=e=>e.querySelectorAll("[data-dango-eye]"),ds=()=>document.querySelectorAll("[data-dango-eye]"),In=()=>{const{data:e}=Ze("dangoGaze"),{lowEndMode:t}=Zi();return e!=="false"&&!t},ms=()=>{const e=In();w(()=>{if(!e||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;const t=ae.map(()=>"normal");let n=-1,r=-1,i=!1,s=-1,a=0,c=0,l=0,u=0,d=0;const m=[],h=(y,I)=>{const k=window.setTimeout(()=>{m.splice(m.indexOf(k),1),y()},I);m.push(k)},p=(y,I,k)=>{Fe().forEach(D=>{Number(D.getAttribute("data-dango-face-slot"))===y&&(k?D.setAttribute(I,""):D.removeAttribute(I))})},f=y=>Fe().forEach(I=>I.removeAttribute(y)),g=(y,I,k)=>{f(I),requestAnimationFrame(()=>{p(y,I,!0),h(()=>f(I),k)})},T=()=>{Fe().forEach(y=>{const I=Number(y.getAttribute("data-dango-face-slot"));y.setAttribute(Qt,r===I?ns:t[I]),n===I?y.setAttribute(rt,""):y.removeAttribute(rt)})},q=y=>{y!==r&&(r>=0&&p(r,ot,!1),r=y,y>=0&&p(y,ot,!0))},N=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{q(-1),T()},is)},E=()=>{window.clearTimeout(d),q(-1)},$=()=>{i=!1,cs.forEach((y,I)=>{h(()=>{t[I]=Wt(),I===nt.from&&h(()=>g(nt.to,Ht,520),nt.after),T()},y)})},de=()=>{i=!0,t.fill(rs),E(),T()},Y=()=>{window.clearTimeout(u),u=window.setTimeout(de,os)},we=()=>{i||(s=(s+1)%t.length,t[s]=Wt(Math.random(),t[s]),T()),h(we,Ut+Math.random()*as)},te=()=>{const y=Array.from(ls(),J=>[J,J.getBoundingClientRect()]);y.forEach(([J,De])=>{us(J).forEach(ke=>{const{x:ne,y:ve}=Xi(c,l,De,ae[Number(ke.getAttribute("data-dango-eye"))]);ke.style.setProperty("--dango-gaze-x",ne.toFixed(3)),ke.style.setProperty("--dango-gaze-y",ve.toFixed(3))})});const I=y.find(([,J])=>c>=J.left&&c<=J.right&&l>=J.top&&l<=J.bottom)?.[1]??null,k=n,D=r,Ee=I?Mt(c,l,I):-1,xe=Ee>=0?Ee:I?Mt(c,l,I,ss):-1;n=Ee,xe>=0?(q(xe),N()):E(),(k!==n||D!==r)&&T(),i&&$(),Y()},_e=y=>{c=y.clientX,l=y.clientY,!a&&(a=requestAnimationFrame(()=>{a=0,te()}))},ye=y=>{y.relatedTarget||(n=-1,E(),T(),Y())};return T(),Y(),h(we,Ut),window.addEventListener("pointermove",_e,{passive:!0}),window.addEventListener("pointerout",ye),()=>{cancelAnimationFrame(a),window.clearTimeout(u),window.clearTimeout(d),m.forEach(window.clearTimeout),window.removeEventListener("pointermove",_e),window.removeEventListener("pointerout",ye),ds().forEach(y=>{y.style.removeProperty("--dango-gaze-x"),y.style.removeProperty("--dango-gaze-y")}),Fe().forEach(y=>{y.setAttribute(Qt,"normal"),y.removeAttribute(rt),y.removeAttribute(ot),y.removeAttribute(Ht)})}},[e])},Nn=ce(void 0),$l=()=>{const e=le(Nn);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Ml=[{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"}],hs={iris:{fill:"#897cff",stroke:"#5646db"},mochi:{fill:"#e3e1ee",stroke:"#b3b1c6"},sakura:{fill:"#e1afef",stroke:"#a978a9"}},ps="_logo_t3il2_1",fs="_skewer_t3il2_8",ys="_gaze_t3il2_15",vs="_face_t3il2_20",gs="_faceNormal_t3il2_25",bs="_facePet_t3il2_26",ws="_faceSquint_t3il2_27",_s="_faceSleep_t3il2_28",Es="_line_t3il2_36",ks="_sway_t3il2_44",Ss="_weight_t3il2_58",Ps="_shift_t3il2_73",Ts="_rock_t3il2_87",xs="_glance_t3il2_105",Is="_blinkDouble_t3il2_129 _blink_t3il2_124",Ns="_blinkSlow_t3il2_153 _blink_t3il2_124",Cs="_bump_t3il2_172",Os="_heart_t3il2_189",M={logo:ps,skewer:fs,gaze:ys,face:vs,faceNormal:gs,facePet:bs,faceSquint:ws,faceSleep:_s,line:Es,sway:ks,weight:Ss,shift:Ps,rock:Ts,glance:xs,blinkDouble:Is,blinkSlow:Ns,bump:Cs,heart:Os},Kt="var(--logo-ink)",As="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",Ls="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",qs="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",Rs={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"},Cn=[{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}],Ne=(e,t)=>e+Math.random()*(t-e),js=Cn.map(()=>({blinkDelay:-Ne(0,9),blinkDuration:Ne(3.4,8.6),motionDelay:-Ne(0,9),motionDuration:Ne(5.5,11),glanceDelay:-Ne(0,11)})),Ds={double:M.blinkDouble,slow:M.blinkSlow},$s={weight:M.weight,shift:M.shift,rock:M.rock},Ms={normal:M.faceNormal,pet:M.facePet,squint:M.faceSquint,sleep:M.faceSleep},Fs=["normal","pet","squint","sleep"],Bs=[{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"}],St=({className:e})=>{const t=In();return o("svg",{viewBox:`${ie.x} ${ie.y} ${ie.w} ${ie.h}`,className:e?`${M.logo} ${e}`:M.logo,role:"img","aria-label":"dango","data-dango-gaze-origin":"",children:o("g",{className:t?M.sway:void 0,children:[o("path",{className:M.skewer,d:`M ${tt.x1},${tt.y} H ${tt.x2}`}),Cn.map((n,r)=>{const{x:i,y:s}=ae[r],a=js[r],{fill:c,stroke:l}=hs[n.hue],u=o("g",{"data-dango-eye":r,className:M.gaze,style:{"--gaze-dur":`${(.12+n.lag*.18).toFixed(3)}s`},children:Fs.map(d=>o("g",{className:`${M.face} ${Ms[d]}`,children:o("g",{className:t&&d==="normal"?Ds[n.blink]:void 0,style:t&&d==="normal"?{animationDelay:`${a.blinkDelay}s`,animationDuration:`${a.blinkDuration}s`}:void 0,children:d==="normal"?o(z,{children:[o("path",{fill:Kt,d:Ls}),o("path",{fill:Kt,d:qs})]}):o("path",{className:M.line,d:Rs[d]})})},d))});return o("g",{transform:`translate(${i} ${s})`,children:o("g",{"data-dango-face-slot":r,"data-dango-face":"normal",className:t?$s[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:As}),o("g",{className:M.bump,children:[t&&n.glances?o("g",{className:M.glance,style:{animationDelay:`${a.glanceDelay}s`},children:u}):u,t&&o("g",{children:Bs.map(d=>o("text",{className:M.heart,x:d.x,y:d.y,fill:"var(--color-danger)",style:{"--drift":d.drift,animationDelay:`${d.delay}s`},children:"♥"},d.x))})]})]})},n.hue)})]})})},On=ce(void 0),Pt=()=>{const e=le(On);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},An=ce(void 0),Ln=()=>{const e=le(An);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},dt="virtual-keyboard:hide",Vt="virtual-keyboard:enabled-change",qn="virtual_keyboard_enabled",Ws=!1;function zt(){const e=localStorage.getItem(qn);return e===null?Ws:e==="true"}const Gt=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function Us(){window.dispatchEvent(new CustomEvent(dt))}function Qs(){const[e,t]=S(!1),[n,r]=S(zt),i=W(null);return w(()=>{const s=d=>{n&&Gt(d.target)&&(i.current=d.target,t(!0))},a=d=>{d.target===i.current&&window.setTimeout(()=>{if(Gt(document.activeElement)){i.current=document.activeElement,t(!0);return}i.current=null,t(!1)},0)},c=()=>{i.current=null,t(!1)},l=d=>{if(d.key!==qn)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=zt();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",a),window.addEventListener(dt,c),window.addEventListener("storage",l),window.addEventListener(Vt,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",a),window.removeEventListener(dt,c),window.removeEventListener("storage",l),window.removeEventListener(Vt,u)}},[n]),{activeInputRef:i,isVisible:n&&e,hide:()=>t(!1)}}const Hs="_header_q6huj_1",Ks="_hidden_q6huj_21",Vs="_scrolled_q6huj_25",zs="_logo_q6huj_31",Gs="_headerInner_q6huj_44",Ys="_leftSection_q6huj_54",Js="_desktopNav_q6huj_60",Zs="_navLink_q6huj_67",Xs="_navLinkActive_q6huj_83",ea="_rightSection_q6huj_102",ta="_searchWrapper_q6huj_108",na="_searchInput_q6huj_114",ra="_searchButton_q6huj_144",oa="_searchIcon_q6huj_168",ia="_profileBtn_q6huj_178",sa="_profileImg_q6huj_211",aa="_hamburgerBtn_q6huj_217",ca="_mobileSearchBar_q6huj_244",la="_mobileSearchBarHidden_q6huj_271",ua="_mobileSearchInner_q6huj_288",da="_mobileSearchIcon_q6huj_304",ma="_mobileSearchInput_q6huj_311",P={header:Hs,hidden:Ks,scrolled:Vs,logo:zs,headerInner:Gs,leftSection:Ys,desktopNav:Js,navLink:Zs,navLinkActive:Xs,rightSection:ea,searchWrapper:ta,searchInput:na,searchButton:ra,searchIcon:oa,profileBtn:ia,profileImg:sa,hamburgerBtn:aa,mobileSearchBar:ca,mobileSearchBarHidden:la,mobileSearchInner:ua,mobileSearchIcon:da,mobileSearchInput:ma},ha=async()=>{let e;try{e=await X.auth.syncSettings.query()}catch{return null}const t=e.actualActiveProvider;if(t==="github")try{const n=await X.auth.githubStatus.query();if(n.authenticated&&n.user)return{name:n.user.name||n.user.login,picture:n.user.avatarUrl??void 0,provider:"github"}}catch{}if(t==="google")try{const n=await X.auth.user.query();if(n)return{name:n.name,picture:n.picture,email:n.email,provider:"google"}}catch{}return null},pa=()=>{const{toggleSidebar:e}=Pt(),{contentType:t}=Ln(),[n,r]=S(""),[i,s]=S(!0),[a,c]=S(!1),[l,u]=S(!0),[d,m]=S(!1),h=Kn(),p=vt(),f=W(null),g=W(!1),T=W(null),q=W(null),N=W(null),E=W(null),$=W(!1),{data:de}=G({queryKey:[O.syncProfile],queryFn:ha,staleTime:3e4});w(()=>{const k=window.visualViewport;if(!k)return;const D=()=>{E.current?.style.setProperty("--vv-top",`${k.offsetTop}px`)};return D(),k.addEventListener("scroll",D),k.addEventListener("resize",D),()=>{k.removeEventListener("scroll",D),k.removeEventListener("resize",D)}},[]),w(()=>{const k=()=>{f.current&&(window.clearTimeout(f.current),f.current=null)},D=()=>{k(),!(window.scrollY<=10)&&(f.current=window.setTimeout(()=>{$.current||s(!1)},2500))},Ee=()=>{g.current||(g.current=!0,T.current=requestAnimationFrame(()=>{g.current=!1,T.current=null;const ne=window.scrollY<=10;u(ve=>ve===ne?ve:ne),s(ve=>ve||!0),D()}))},xe=ne=>{(ne.metaKey||ne.ctrlKey)&&ne.key==="k"?(ne.preventDefault(),Y.current?.focus({preventScroll:!0})):ne.key==="Escape"&&document.activeElement===Y.current&&Y.current?.blur()},J=E.current,De=()=>{$.current=!0},ke=()=>{$.current=!1,D()};return window.addEventListener("scroll",Ee,{passive:!0}),window.addEventListener("keydown",xe),J?.addEventListener("pointerenter",De),J?.addEventListener("pointerleave",ke),()=>{window.removeEventListener("scroll",Ee),window.removeEventListener("keydown",xe),J?.removeEventListener("pointerenter",De),J?.removeEventListener("pointerleave",ke),k(),T.current!==null&&(cancelAnimationFrame(T.current),T.current=null),g.current=!1}},[a]);const Y=ft.useRef(null),we=()=>window.innerWidth<=1024,te=()=>{we()?(m(!0),setTimeout(()=>N.current?.focus({preventScroll:!0}),50)):document.activeElement===Y.current&&n.trim()?I():Y.current?.focus({preventScroll:!0})},_e=k=>{q.current?.contains(k.relatedTarget)||m(!1)},ye=t==="manga"?"Search manga...":t==="tv"?"Search TV & movies...":t==="asmr"?"Search ASMR...":"Search anime...",y=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"},I=k=>{Us();const D=n.trim();D&&h(t==="manga"?`/manga?q=${encodeURIComponent(D)}`:t==="tv"?`/tv-search?q=${encodeURIComponent(D)}`:t==="asmr"?`/asmr?q=${encodeURIComponent(D)}`:`/search?query=${encodeURIComponent(D)}`)};return o(z,{children:o("header",{ref:E,className:`${P.header} ${i?"":P.hidden} ${l?"":P.scrolled}`,children:[o("div",{className:P.headerInner,children:[o("div",{className:P.leftSection,children:[o("button",{className:P.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(_,{name:"bars"})}),o(Z,{to:"/",className:P.logo,"aria-label":"Ani-Web Home",children:o(St,{})}),o("nav",{className:P.desktopNav,children:[o(Z,{to:"/",className:`${P.navLink} ${p.pathname==="/"?P.navLinkActive:""}`,children:"Home"}),o(Z,{to:y.to,className:`${P.navLink} ${p.pathname.startsWith(y.to)?P.navLinkActive:""}`,children:y.label}),t==="anime"&&o(Z,{to:"/insights",className:`${P.navLink} ${p.pathname==="/insights"?P.navLinkActive:""}`,children:"Insights"}),o(Z,{to:"/settings",className:`${P.navLink} ${p.pathname.startsWith("/settings")?P.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:P.rightSection,children:[o("div",{className:P.searchWrapper,children:[o("input",{ref:Y,type:"text","data-virtual-keyboard":"true",className:P.searchInput,placeholder:ye,value:n,onChange:k=>r(k.currentTarget.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:k=>{k.key==="Enter"&&I()}}),o("button",{type:"button",className:P.searchButton,"aria-label":"Search",onMouseDown:k=>k.preventDefault(),onClick:te,children:o(_,{name:"search",className:P.searchIcon})})]}),o(Ji,{}),o(Z,{to:"/settings?tab=sync",className:P.profileBtn,"aria-label":"Sync settings",children:de?.picture?o("img",{src:de.picture,alt:de.name,className:P.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):de?.provider==="github"?o(_,{name:"github"}):o(_,{name:"cloud"})})]})]}),d&&o("div",{className:`${P.mobileSearchBar} ${i?"":P.mobileSearchBarHidden}`,ref:q,onBlur:_e,children:o("div",{className:P.mobileSearchInner,children:[o(_,{name:"search",className:P.mobileSearchIcon}),o("input",{ref:N,type:"text","data-virtual-keyboard":"true",className:P.mobileSearchInput,placeholder:ye,value:n,onChange:k=>r(k.currentTarget.value),onKeyDown:k=>{k.key==="Enter"?(I(),m(!1)):k.key==="Escape"&&m(!1)}})]})})]})})},mt="agreedToViewMature";function ht(){try{return localStorage.getItem(mt)==="true"}catch{return!1}}const Oe=new Set;function Rn(e){for(const t of Oe)t(e)}function Be(){Rn(ht())}function Yt(e){try{e?localStorage.setItem(mt,"true"):localStorage.removeItem(mt)}catch{}Rn(e)}function fa(){const[e,t]=S(ht);w(()=>(Oe.add(t),Oe.size===1&&(window.addEventListener("storage",Be),window.addEventListener("focus",Be)),t(ht()),()=>{Oe.delete(t),Oe.size===0&&(window.removeEventListener("storage",Be),window.removeEventListener("focus",Be))}),[]);const n=Q(()=>Yt(!0),[]),r=Q(()=>Yt(!1),[]);return{hasConsent:e,grant:n,revoke:r}}const ya="_sidebar_153jc_1",va="_open_153jc_20",ga="_sidebarHeader_153jc_25",ba="_closeBtn_153jc_33",wa="_logo_153jc_57",_a="_navSection_153jc_69",Ea="_navLink_153jc_75",ka="_active_153jc_108",Sa="_overlay_153jc_118",Pa="_versionInfo_153jc_138",re={sidebar:ya,open:va,sidebarHeader:ga,closeBtn:ba,logo:wa,navSection:_a,navLink:Ea,active:ka,overlay:Sa,versionInfo:Pa},Ta="3.7.6",jn={version:Ta},xa=()=>{const{isOpen:e,setIsOpen:t}=Pt(),{contentType:n}=Ln(),{hasConsent:r}=fa(),i=()=>{t(!1)},s=n==="manga",a=n==="tv",c=n==="asmr",l=[{to:"/",icon:o(_,{name:"home"}),label:"Home"},s?{to:"/manga",icon:o(_,{name:"book"}),label:"Manga"}:a?{to:"/tv-search",icon:o(_,{name:"tv"}),label:"TV and Movies"}:c?{to:"/asmr",icon:o(_,{name:"headphones"}),label:"ASMR"}:{to:"/search",icon:o(_,{name:"search"}),label:"Search"},s?{to:"/reading-list",icon:o(_,{name:"bookmark"}),label:"Reading List"}:a?{to:"/tv-watchlist",icon:o(_,{name:"clock"}),label:"TV Watchlist"}:c?{to:"/listening-list",icon:o(_,{name:"history"}),label:"Listening List"}:{to:"/watchlist",icon:o(_,{name:"clock"}),label:"Watchlist"},...n==="anime"?[{to:"/insights",icon:o(_,{name:"chart-pie"}),label:"Insights"}]:[],{to:"/trackers",icon:o(_,{name:"sync-alt"}),label:"Trackers"},...r?[{to:"/mature",icon:o(_,{name:"pepper-hot"}),label:"Mature"}]:[],{to:"/settings",icon:o(_,{name:"cog"}),label:"Settings"}];return o(z,{children:[o("aside",{className:`${re.sidebar} ${e?re.open:""} sidebar`,children:[o("div",{className:re.sidebarHeader,children:[o("button",{className:re.closeBtn,onClick:()=>t(!1),"aria-label":"Close menu",children:"×"}),o(Z,{to:"/",className:re.logo,onClick:i,children:o(St,{})})]}),o("nav",{className:re.navSection,children:l.map(u=>o(Vn,{to:u.to,className:({isActive:d})=>`${re.navLink} ${d?re.active:""}`,onClick:i,end:u.to==="/",children:[u.icon,o("span",{children:u.label})]},u.to))}),o("div",{className:re.versionInfo,children:["v",jn.version]})]}),e&&o("div",{className:re.overlay,onClick:()=>t(!1),"aria-label":"Close sidebar"})]})},Ia="_footer_1c905_1",Na="_footerInner_1c905_15",Ca="_brandSection_1c905_27",Oa="_logoRow_1c905_39",Aa="_logoText_1c905_45",La="_brandMeta_1c905_51",qa="_brandTagline_1c905_60",Ra="_statusPill_1c905_67",ja="_statusDot_1c905_80",Da="_linksGrid_1c905_88",$a="_linkColumn_1c905_96",Ma="_columnTitle_1c905_102",Fa="_bottomBar_1c905_126",Ba="_copyright_1c905_136",Wa="_brand_1c905_27",Ua="_heartIcon_1c905_152",Qa="_backToTop_1c905_157",L={footer:Ia,footerInner:Na,brandSection:Ca,logoRow:Oa,logoText:Aa,brandMeta:La,brandTagline:qa,statusPill:Ra,statusDot:ja,linksGrid:Da,linkColumn:$a,columnTitle:Ma,bottomBar:Fa,copyright:Ba,brand:Wa,heartIcon:Ua,backToTop:Qa},Ha=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:L.footer,children:[o("div",{className:L.footerInner,children:[o("div",{className:L.brandSection,children:[o("div",{className:L.logoRow,children:o(St,{className:L.logoText})}),o("div",{className:L.brandMeta,children:[o("div",{className:L.statusPill,children:[o("span",{className:L.statusDot}),o("span",{children:["v",jn.version]})]}),o("p",{className:L.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:L.linksGrid,children:[o("div",{className:L.linkColumn,children:[o("h4",{className:L.columnTitle,children:"Navigation"}),o(Z,{to:"/",children:"Home"}),o(Z,{to:"/watchlist",children:"Watchlist"}),o(Z,{to:"/settings",children:"Settings"})]}),o("div",{className:L.linkColumn,children:[o("h4",{className:L.columnTitle,children:"Features"}),o(Z,{to:"/search",children:"Search Anime"}),o(Z,{to:"/trackers",children:"Trackers"}),o(Z,{to:"/insights",children:"Insights"})]}),o("div",{className:L.linkColumn,children:[o("h4",{className:L.columnTitle,children:"Community"}),o("a",{href:"https://discord.gg/6yT3VwTqz9",target:"_blank",rel:"noopener noreferrer",children:[o(_,{name:"discord",style:{marginRight:"6px"}})," Discord"]}),o("a",{href:"https://github.com/serifpersia/dango",target:"_blank",rel:"noopener noreferrer",children:[o(_,{name:"github",style:{marginRight:"6px"}})," GitHub"]})]}),o("div",{className:L.linkColumn,children:[o("h4",{className:L.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:L.bottomBar,children:[o("p",{className:L.copyright,children:["© ",e," ",o("span",{className:L.brand,children:"dango"})," • Crafted with"," ",o(_,{name:"heart",className:L.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:L.backToTop,onClick:t,"aria-label":"Back to top",children:[o(_,{name:"chevron-up",size:14}),o("span",{children:"Top"})]})]})]})};function Dn(e){return JSON.stringify({0:e??{}})}function $n(e){return`/api/trpc/${e}?batch=1`}function pt(e,t){const n=Dn(t),r=$n(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 Fl(e,t){const n=await fetch($n(e),{method:"POST",headers:{"Content-Type":"application/json"},body:Dn(t),keepalive:!0});if(!n.ok)throw new Error(`tRPC request failed (HTTP ${n.status})`)}function Bl(e){e&&(pt("discord.clear",{sessionId:e}),pt("discord.heartbeat",{sessionId:e,bye:!0}))}function Ka(){const e=vt(),{data:t}=Ze("discordRPCEnabled"),n=W("");n.current||(n.current=typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():`tab-${Date.now()}-${Math.random().toString(36).slice(2)}`),w(()=>{if(t===!1||t==="false")return;const r=n.current,i=()=>X.discord.heartbeat.mutate({sessionId:r}).catch(()=>{});i();const s=setInterval(i,15e3),a=()=>{pt("discord.heartbeat",{sessionId:r,bye:!0})};return window.addEventListener("pagehide",a),()=>{clearInterval(s),window.removeEventListener("pagehide",a)}},[t]),w(()=>{if(t===!1||t==="false")return;const r=e.pathname;if(r.startsWith("/watch/")||r.startsWith("/player/"))return;let i="home";r.startsWith("/search")||r.startsWith("/mature")?i="search":r.startsWith("/watchlist")?i="watchlist":r.startsWith("/anime/")?i="anime":r.startsWith("/insights")?i="insights":r.startsWith("/settings")?i="settings":r.startsWith("/trackers")?i="trackers":r.startsWith("/asmr")?i="asmr":r.startsWith("/manga")?i="manga":r.startsWith("/tv")&&(i="tv"),X.discord.pageStatus.mutate({page:i}).catch(()=>{})},[e.pathname,t])}function Mn(e,t){const[n,r]=S(()=>{try{const s=localStorage.getItem(e);if(s===null)return t;if(typeof t=="string")return s;try{return JSON.parse(s)}catch{return s}}catch{return t}});w(()=>{const s=a=>{if(a.key===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",s),()=>window.removeEventListener("storage",s)},[e,t]);const i=Q(s=>{r(a=>{const c=typeof s=="function"?s(a):s;try{typeof c=="string"?localStorage.setItem(e,c):localStorage.setItem(e,JSON.stringify(c))}catch{}return c})},[e]);return[n,i]}const Fn=ce(void 0),Va=()=>{const e=le(Fn);if(!e)throw new Error("useAnimePaheCookie must be used within an AnimePaheCookieProvider");return e},za="_overlay_1juub_1",Ga="_fadeIn_1juub_1",Ya="_content_1juub_11",Ja="_modalIn_1juub_1",Za="_sm_1juub_29",Xa="_md_1juub_33",ec="_lg_1juub_37",tc="_title_1juub_41",nc="_body_1juub_48",rc="_footer_1juub_52",Se={overlay:za,fadeIn:Ga,content:Ya,modalIn:Ja,sm:Za,md:Xa,lg:ec,title:tc,body:nc,footer:rc};function Bn({children:e}){return o("h2",{className:Se.title,children:e})}function Wn({children:e}){return o("div",{className:Se.body,children:e})}function Un({children:e}){return o("div",{className:Se.footer,children:e})}function je({isOpen:e,onClose:t,title:n,children:r,footer:i,width:s="md"}){const a=W(null),[c,l]=S(document.body);return w(()=>{if(!e)return;const u=()=>l(document.fullscreenElement??document.body);return u(),document.addEventListener("fullscreenchange",u),()=>document.removeEventListener("fullscreenchange",u)},[e]),w(()=>{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?yt(o("div",{role:"presentation",onMouseDown:u=>u.stopPropagation(),children:[o("div",{className:Se.overlay,onClick:()=>t?.(),"aria-hidden":"true"}),o("div",{ref:a,className:`${Se.content} ${Se[s]}`,role:"dialog","aria-modal":"true","aria-label":n,tabIndex:-1,children:[n&&o(Bn,{children:n}),o(Wn,{children:r}),i&&o(Un,{children:i})]})]}),c):null}je.Header=Bn;je.Body=Wn;je.Actions=Un;const oc="_container_e96gf_1",ic="_field_e96gf_9",sc="_textarea_e96gf_20",ac="_input_e96gf_40",cc="_button_e96gf_58",lc="_secondaryButton_e96gf_78",uc="_actions_e96gf_95",dc="_hint_e96gf_104",mc="_link_e96gf_117",K={container:oc,field:ic,textarea:sc,input:ac,button:cc,secondaryButton:lc,actions:uc,hint:dc,link:mc},hc="https://github.com/serifpersia/dango/releases/latest/download/dango-extension.zip",pc=e=>{try{return JSON.parse(e.detail)}catch{return null}},fc=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=S(1),[s,a]=S(navigator.userAgent),[c,l]=S(""),[u,d]=S(!1),m=W(null),h=navigator.userAgent,p=/android/i.test(h),f=/firefox|fxios/i.test(h)&&!p,g=!f&&!p&&/chrome|chromium|edg|brave/i.test(h),T=f||g;w(()=>{e&&(i(1),a(navigator.userAgent),l(""),d(!1))},[e]),w(()=>()=>{m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null)},[]);const q=()=>{window.open("https://animepahe.pw","_blank","noopener,noreferrer"),i(2)},N=()=>{if(u)return;d(!0);const $=`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`,de=window.setTimeout(()=>{d(!1),m.current&&(window.removeEventListener("dango:pahe-cookie",m.current),m.current=null),b.error("Helper not detected - install it via about:debugging first.")},3e3),Y=we=>{const te=pc(we);if(!(!te||te.requestId!==$))if(window.clearTimeout(de),window.removeEventListener("dango:pahe-cookie",Y),m.current=null,d(!1),te?.ok&&te.cookie)l(te.cookie),b.success("Cookie extracted from helper!");else if(te?.error==="NO_COOKIE"){const _e=te.debug?.stores?.length??0,ye=te.debug?.names??[];b.error(`Helper found no cf_clearance (checked ${_e} stores, saw: ${ye.join(", ")||"none"}) - solve the challenge on the AnimePahe tab first.`)}else b.error("Helper request failed - try again.")};m.current=Y,window.addEventListener("dango:pahe-cookie",Y),window.dispatchEvent(new CustomEvent("dango:get-pahe-cookie",{detail:{requestId:$}}))},E=()=>{const $=c.trim();if(!$){b.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_ua",s),localStorage.setItem("animepahe_cookie",$),b.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{b.error("Failed to save cookie")}};return o(je,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:K.container,children:r===1?o(z,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:K.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:K.textarea})]}),o("div",{className:K.actions,children:[o("button",{className:K.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:K.button,onClick:q,children:"Start Verification (Opens AnimePahe)"})]})]}):o(z,{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."]}),T&&o("div",{className:K.hint,children:[o("strong",{children:"Dango helper (one-time setup):"})," ",f?o(z,{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(z,{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:hc,target:"_blank",rel:"noreferrer",className:K.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:K.actions,children:o("button",{className:K.button,onClick:N,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:K.field,children:[o("label",{children:"cf_clearance cookie value:"}),o("input",{type:"text",value:c,onChange:$=>l($.currentTarget.value),placeholder:"e.g. xxxxxxxx.xxxxxxxx.xxxxxxx-xxxxxxx",className:K.input})]}),o("div",{className:K.actions,children:[o("button",{className:K.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:K.secondaryButton,onClick:()=>i(1),children:"Back"}),o("button",{className:K.button,onClick:E,children:"Submit"})]})]})})})};function yc(){const[e,t]=S(!1);return w(()=>{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 vc="_screen_1pca0_1",gc="_icon_1pca0_14",bc="_title_1pca0_20",wc="_text_1pca0_24",_c="_button_1pca0_29",Ce={screen:vc,icon:gc,title:bc,text:wc,button:_c};async function Ec(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 kc extends zn{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n),Ec(t,n)}render(){return this.state.hasError?o("div",{className:Ce.screen,children:[o(_,{name:"exclamation-triangle",className:Ce.icon}),o("h1",{className:Ce.title,children:"Something went wrong"}),o("p",{className:Ce.text,children:"The application encountered an unexpected error."}),o("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},className:Ce.button,children:[o(_,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Qn=ce(void 0),Sc=()=>{const e=le(Qn);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Pc=({children:e})=>{const[t,n]=S(!1),r=Q(()=>n(!0),[]),i=Q(()=>n(!1),[]);return w(()=>_n("lan",r),[r]),o(Qn.Provider,{value:{isOpen:t,openModal:r,closeModal:i},children:e})},Tc="_container_88bss_1",xc="_field_88bss_8",Ic="_input_88bss_19",Nc="_actions_88bss_37",We={container:Tc,field:xc,input:Ic,actions:Nc},Jt=Gn(({variant:e="primary",size:t="md",loading:n,children:r,className:i="",disabled:s,...a},c)=>{const l=fi("btn",`btn-${e}`,t!=="md"&&`btn-${t}`,n&&"btn-loading",i);return o("button",{className:l,disabled:s||n,ref:c,...a,children:n?o("span",{className:"btn-spinner"}):r})}),Cc=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=S(""),[s,a]=S(!1);ft.useEffect(()=>{e&&i("")},[e]);const c=async()=>{if(!r){b.error("Please enter your password");return}a(!0);try{const l=await Et("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})}),u=await l.json().catch(()=>({}));if(!l.ok){b.error(u.error||"Login failed");return}b.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{b.error("Network error")}finally{a(!1)}};return o(je,{isOpen:e,onClose:t,title:"LAN Authentication Required",children:o("div",{className:We.container,children:[o("p",{children:"This instance is protected. Enter the password to access from this device."}),o("div",{className:We.field,children:[o("label",{htmlFor:"lan-password",children:"Password"}),o("input",{id:"lan-password",type:"password",value:r,onChange:l=>i(l.currentTarget.value),placeholder:"Enter password...",className:We.input,onKeyDown:l=>l.key==="Enter"&&c()})]}),o("div",{className:We.actions,children:[o(Jt,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o(Jt,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},Oc="_notice_1d75r_1",Ac={notice:Oc},Lc=2600,qc=1e4,Rc={anilist:"Updating AniList…",mal:"Updating MyAnimeList…"};function jc({enabled:e=!0}){const[t,n]=S(!1),[r,i]=S("mal"),[s,a]=S(document.fullscreenElement);return w(()=>{const c=()=>a(document.fullscreenElement);return document.addEventListener("fullscreenchange",c),()=>document.removeEventListener("fullscreenchange",c)},[]),w(()=>{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 h=p=>{let f;try{f=JSON.parse(p.data)}catch{return}const g=f.provider;g!=="anilist"&&g!=="mal"||(f.updating===!0?(clearTimeout(l.get(g)),d.size===0&&Date.now()-m>=qc&&(m=Date.now(),i(g),n(!0),clearTimeout(u),u=setTimeout(()=>n(!1),Lc)),d.add(g)):f.updating===!1&&(clearTimeout(l.get(g)),l.set(g,setTimeout(()=>d.delete(g),1500))))};return c.addEventListener("tracker-activity",h),()=>{c.removeEventListener("tracker-activity",h),c.close(),clearTimeout(u);for(const p of l.values())clearTimeout(p);n(!1)}},[e]),!e||!t?null:yt(o("div",{className:Ac.notice,role:"status","aria-live":"polite","aria-atomic":"true",children:[o(_,{name:r==="anilist"?"anilist":"myanimelist",size:15}),o("span",{children:Rc[r]})]}),s||document.body)}const Dc=R(()=>j(()=>import("./Home-4lO9InFx.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]))),$c=R(()=>j(()=>import("./Watchlist-BiJ1SCAH.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]))),Mc=R(()=>j(()=>import("./Settings-CCoAhBc0.js"),__vite__mapDeps([40,1,2,41,42,4,43]))),Zt=R(()=>j(()=>import("./Player-M3yMiFzg.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]))),Fc=R(()=>j(()=>import("./Search-Dikasx2q.js"),__vite__mapDeps([54,1,4,3,5,6,7,8,9,10,11,2,12,13,14,15,16,17,18,37,38,55,56]))),Bc=R(()=>j(()=>import("./Mature-DhozU6BP.js"),__vite__mapDeps([57,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,27,55,56,58]))),Xt=R(()=>j(()=>import("./Asmr-BH3j9n5n.js"),__vite__mapDeps([59,1,4,2,41,42,7,8,3,5,6,9,32,24,60,25,45,46,61,62,63]))),Wc=R(()=>j(()=>import("./Manga-tDOa59vQ.js"),__vite__mapDeps([64,1,4,41,42,7,8,17,18,3,5,6,9,22,23,2,24,25,27,65,66,61,62]))),Uc=R(()=>j(()=>import("./MangaInfoPage-D_3Rx6rr.js"),__vite__mapDeps([67,1,4,17,18,23,2,24,65,66,61,62]))),Qc=R(()=>j(()=>import("./MangaReadPage-D0satiXp.js"),__vite__mapDeps([68,1,17,4,18,2,23,24,65,66,61,62]))),Hc=R(()=>j(()=>import("./ReadingList-BB_fA_j0.js"),__vite__mapDeps([69,1,3,4,5,6,7,8,9,70,15,16,17,18,35,36,22,23,2,24,25,26,19]))),en=R(()=>j(()=>import("./TvSearch-BDNZjbZo.js"),__vite__mapDeps([71,1,4,3,5,6,7,8,9,28,29,30,2,24,15,16,17,18,55,56]))),Kc=R(()=>j(()=>import("./TvInfo-BjFZ57fG.js"),__vite__mapDeps([72,1,4,30,2,24,73]))),Vc=R(()=>j(()=>import("./Tv-BLUeZ2n8.js"),__vite__mapDeps([74,1,45,4,46,2,47,14,48,75,7,8,27,30,24,6,51,52,76]))),zc=R(()=>j(()=>import("./TvWatchlist-er5RKLmv.js"),__vite__mapDeps([77,1,3,4,5,6,7,8,9,70,15,16,17,18,35,36,19,29,30,2,24]))),Gc=R(()=>j(()=>import("./ListeningList-DX_Imiie.js"),__vite__mapDeps([78,1,3,4,5,6,7,8,9,70,15,16,17,18,35,36,60,32,2,24,25,31,19]))),Yc=R(()=>j(()=>import("./Trackers-CoM-8Hz9.js"),__vite__mapDeps([79,1,2,4,80]))),Jc=R(()=>j(()=>import("./Insights-Co9pEzWb.js"),__vite__mapDeps([81,1,2,4,82]))),Zc=R(()=>j(()=>import("./AnimeInfoPage-adJHjnqz.js"),__vite__mapDeps([83,1,2,4]))),Xc=R(()=>j(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([84,1]))),el=R(()=>j(()=>import("./VirtualKeyboard-DeP7fb3P.js"),__vite__mapDeps([85,1,86])));function tl(){ms();const{isOpen:e,closeModal:t,onSuccess:n}=Va(),{isOpen:r,setIsOpen:i}=Pt(),{isOpen:s,openModal:a,closeModal:c}=Sc(),l=vt(),u=Yn(),d=W(new Map),m=W(l.pathname),h=Qs();Ka();const[p,f]=S(!1);w(()=>{const N=new AbortController;return li("/api/auth/app-status",{signal:N.signal}).then(E=>{E.hasPassword&&!E.isAuthenticated&&(f(!0),a())}).catch(()=>{N.signal.aborted||b.error("Could not check server access. The server may still be starting; reload to retry.")}),()=>N.abort()},[a]);const[g,T]=Mn("lan_auth_notice_shown","false"),q=W(!1);return w(()=>{if(g==="true"||q.current)return;q.current=!0,T("true");const N=setTimeout(()=>{b("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(N)},[g,T]),w(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),w(()=>{const N=l.key,E=d.current;if(u==="POP"){const $=E.get(N)??0;window.scrollTo({top:$,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{E.set(N,window.scrollY)}},[l.key,l.pathname,u]),w(()=>{const N=E=>{r&&E.key==="Escape"&&i(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",N),()=>{window.removeEventListener("keydown",N),document.body.classList.remove("sidebar-open")}},[r,i]),o("div",{className:"app-container",children:[o(fc,{isOpen:e,onClose:t,onSuccess:n}),o(Cc,{isOpen:s,onClose:p?()=>{}:c,onSuccess:()=>{f(!1),c()}}),o(Vr,{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"}}}}),o(jc,{enabled:!p&&!s}),o(pa,{}),o(xa,{}),o("main",{className:"main-content",children:o(kc,{children:o(Tt,{fallback:o(yc,{}),children:o(Jn,{children:[o(C,{path:"/",element:o(Dc,{})}),o(C,{path:"/watchlist/:filter?",element:o($c,{})}),o(C,{path:"/reading-list/:filter?",element:o(Hc,{})}),o(C,{path:"/search",element:o(Fc,{})}),o(C,{path:"/mature",element:o(Bc,{})}),o(C,{path:"/asmr",element:o(Xt,{})}),o(C,{path:"/asmr/:rj",element:o(Xt,{})}),o(C,{path:"/manga",element:o(Wc,{})}),o(C,{path:"/manga/:provider/:id",element:o(Uc,{})}),o(C,{path:"/manga/:provider/:id/read",element:o(Qc,{})}),o(C,{path:"/tv",element:o(en,{})}),o(C,{path:"/tv/:id",element:o(Kc,{})}),o(C,{path:"/tv/:id/watch",element:o(Vc,{})}),o(C,{path:"/tv-search",element:o(en,{})}),o(C,{path:"/tv-watchlist/:filter?",element:o(zc,{})}),o(C,{path:"/listening-list/:filter?",element:o(Gc,{})}),o(C,{path:"/settings",element:o(Mc,{})}),o(C,{path:"/trackers",element:o(Yc,{})}),o(C,{path:"/mal",element:o(xt,{to:"/trackers",replace:!0})}),o(C,{path:"/insights",element:o(Jc,{})}),o(C,{path:"/anime/:id",element:o(Zc,{})}),o(C,{path:"/watch/:id",element:o(Zt,{})}),o(C,{path:"/watch/:id/:episodeNumber",element:o(Zt,{})}),o(C,{path:"/player/:id/:episodeNumber?",element:o(Xc,{})}),o(C,{path:"*",element:o(xt,{to:"/",replace:!0})})]})})})}),o(Ha,{}),h.isVisible&&o(Tt,{fallback:null,children:o(el,{activeInputRef:h.activeInputRef,isVisible:h.isVisible,onClose:h.hide})})]})}function nl(){return o(Pc,{children:o(tl,{})})}const rl=({children:e})=>{const[t,n]=S(!1),r=Q(()=>{n(s=>!s)},[]),i=Te(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(On.Provider,{value:i,children:e})},ol=({children:e})=>{const[t,n]=Mn("dango_content_type","anime"),r=Te(()=>({contentType:t,setContentType:n}),[t,n]);return o(An.Provider,{value:r,children:e})},il=({children:e})=>{const[t,n]=S("englishName"),[r,i]=S(!0);w(()=>{(async()=>{try{const c=await X.settings.getByKey.query({key:"titlePreference"});c.value&&n(c.value)}catch(c){console.error("Error fetching title preference in context:",c)}finally{i(!1)}})()},[]);const s=Te(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(En.Provider,{value:s,children:e})},sl=({children:e})=>{const{data:t,isLoading:n}=Ze("lowEndMode"),r=Tn(),i=H(),[s,a]=S(!1);w(()=>{const u=i.getDefaultOptions();i.setDefaultOptions({...u,queries:{...u.queries,gcTime:s?900*1e3:1800*1e3}})},[s,i]),w(()=>{t!==void 0&&a(t==="true"||t===!0)},[t]),w(()=>{s?document.body.classList.add("low-end"):document.body.classList.remove("low-end")},[s]);const c=Q(u=>{a(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=Te(()=>({lowEndMode:s,setLowEndMode:c,loading:n}),[s,c,n]);return o(xn.Provider,{value:l,children:e})},al=["iris","mochi","sakura"];function tn(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const cl=({children:e})=>{const{data:t,isLoading:n}=Ze("theme"),r=Tn(),[i,s]=S("iris");w(()=>{typeof t=="string"&&al.includes(t)&&s(t)},[t]),w(()=>{tn(i)},[i]);const a=Q(l=>{l!==i&&(s(l),tn(l),r.mutate({key:"theme",value:l}))},[r,i]),c=Te(()=>({theme:i,setTheme:a,loading:n}),[i,a,n]);return o(Nn.Provider,{value:c,children:e})},ll=({children:e})=>{const[t,n]=S(!1),[r,i]=S(void 0),s=Q(c=>{i(()=>c),n(!0)},[]),a=Q(()=>{n(!1),i(void 0)},[]);return w(()=>_n("animepahe",()=>s()),[s]),o(Fn.Provider,{value:{isOpen:t,openModal:s,closeModal:a,onSuccess:r},children:e})};try{window.history.scrollRestoration="manual"}catch{}const nn=new nr({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),rn=document.getElementById("root");rn&&Zn(o(Xn,{children:o(mi,{trpcClient:X,queryClient:nn,children:o(rr,{client:nn,children:o(ll,{children:o(rl,{children:o(ol,{children:o(il,{children:o(sl,{children:o(cl,{children:o(nl,{})})})})})})})})})}),rn);export{Dl as $,b as A,Jt as B,Ze as C,Tn as D,Ll as E,ql as F,Al as G,Et as H,F as I,li as J,$l as K,zt as L,je as M,Vt as N,fl as O,K as P,fc as Q,wl as R,et as S,Ml as T,Us as U,qn as V,Bl as W,_n as X,Fl as Y,Pt as Z,j as _,Mn as a,yc as a0,Sl as a1,Pl as a2,kl as a3,vl as b,gl as c,vi as d,fa as e,pi as f,hl as g,yi as h,A as i,bl as j,Ln as k,Ol as l,_l as m,El as n,Tl as o,xl as p,O as q,Rl as r,pl as s,X as t,Zi as u,Nl as v,yl as w,jl as x,Cl as y,Il as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a=.8;const e="autoplayEnabled",E=(s,t)=>t>0&&s>=t*.8;const o=(s,t)=>t>0&&Number.isFinite(t)&&s>=t-.25,c=s=>s>5,l=()=>{try{return localStorage.getItem(e)==="true"}catch{return!1}},n=s=>{try{localStorage.setItem(e,String(s))}catch{}};export{a as C,o as a,c as h,E as i,l,n as s};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{u as t,A as S,q as B,h as j,d as k,T as X,$ as nt}from"./vendor-core-DfaOB3Rn.js";import{M as Fe,B as V,S as ee,i as st,Y as $e,q as G,W as at,t as ot,g as it}from"./index-BP1z44Uk.js";import{I as K}from"./vendor-icons-DrybRNxP.js";import{S as Ie,a as ct,f as Re,m as lt,h as dt,d as ut,s as Y,k as pt,u as ft,n as ae}from"./PlayerProvider-pi0at080.js";import{u as ht}from"./vendor-query-BBT5_sHx.js";import{a as mt}from"./playbackCompletion-IPHm9fp5.js";const bt="_controls_pcbjf_1",gt="_titleContainer_pcbjf_9",yt="_scheduleInfo_pcbjf_15",_t="_status_pcbjf_23",vt="_nextEpisode_pcbjf_35",St="_watchlistBtn_pcbjf_45",wt="_inList_pcbjf_72",Ct="_queueBtn_pcbjf_83",kt="_queueActive_pcbjf_95",xt="_modeToggleBtn_pcbjf_101",Tt="_modeToggleActive_pcbjf_108",Nt="_markWatchedBtn_pcbjf_129",Lt="_markWatchedDone_pcbjf_143",Bt="_streamPanel_pcbjf_154",Et="_desktopEpisodeActions_pcbjf_168",At="_sourceLoader_pcbjf_174",Pt="_episodeActions_pcbjf_187",$t="_mobileEpisodeActions_pcbjf_201",It="_episodeNavBtn_pcbjf_205",Mt="_primary_pcbjf_235",jt="_secondary_pcbjf_245",Ft="_episodePickerBtn_pcbjf_249",Rt="_queueCountdown_pcbjf_253",Dt="_speedBoostBadge_pcbjf_268",Ot="_videoContainer_pcbjf_299",Ht="_loadingOverlay_pcbjf_312",qt="_loadingDots_pcbjf_326",Wt="_dot_pcbjf_331",zt="_bounce_pcbjf_1",Vt="_bufferingOverlay_pcbjf_348",Kt="_bufferingSpinner_pcbjf_357",Ut="_spin_pcbjf_444",Qt="_videoIframe_pcbjf_366",Gt="_videoElementHidden_pcbjf_389",Yt="_upscalerCanvas_pcbjf_394",Xt="_upscalerActive_pcbjf_407",Jt="_upscalerStatusBadge_pcbjf_411",Zt="_subtitleOverlay_pcbjf_426",er="_spinner_pcbjf_444",tr="_errorOverlay_pcbjf_505",rr="_retryButton_pcbjf_515",nr="_detailsToggleBtn_pcbjf_528",sr="_descriptionSection_pcbjf_551",ar="_synopsisFlat_pcbjf_559",or="_fullscreenActive_pcbjf_593",ir="_errorSubtext_pcbjf_636",qn={controls:bt,titleContainer:gt,scheduleInfo:yt,status:_t,nextEpisode:vt,watchlistBtn:St,inList:wt,queueBtn:Ct,queueActive:kt,modeToggleBtn:xt,modeToggleActive:Tt,markWatchedBtn:Nt,markWatchedDone:Lt,streamPanel:Bt,desktopEpisodeActions:Et,sourceLoader:At,episodeActions:Pt,mobileEpisodeActions:$t,episodeNavBtn:It,primary:Mt,secondary:jt,episodePickerBtn:Ft,queueCountdown:Rt,speedBoostBadge:Dt,videoContainer:Ot,loadingOverlay:Ht,loadingDots:qt,dot:Wt,bounce:zt,bufferingOverlay:Vt,bufferingSpinner:Kt,spin:Ut,videoIframe:Qt,videoElementHidden:Gt,upscalerCanvas:Yt,upscalerActive:Xt,upscalerStatusBadge:Jt,subtitleOverlay:Zt,spinner:er,errorOverlay:tr,retryButton:rr,detailsToggleBtn:nr,descriptionSection:sr,synopsisFlat:ar,fullscreenActive:or,errorSubtext:ir},cr="_playerPageLayout_13s1u_1",lr="_noSidebar_13s1u_15",dr="_episodeSidebar_13s1u_19",ur="_playerMain_13s1u_32",pr="_videoPlayerWrapper_13s1u_40",fr="_playerInfoHeader_13s1u_56",hr="_playerAnimeCard_13s1u_62",mr="_playerInfoContainer_13s1u_74",br="_infoColumns_13s1u_86",gr="_videoTitleSection_13s1u_114",yr="_theaterMode_13s1u_288",Wn={playerPageLayout:cr,noSidebar:lr,episodeSidebar:dr,playerMain:ur,videoPlayerWrapper:pr,playerInfoHeader:fr,playerAnimeCard:hr,playerInfoContainer:mr,infoColumns:br,videoTitleSection:gr,theaterMode:yr},_r={fontSize:"subtitleFontSize",position:"subtitlePosition",bgOpacity:"subtitleBgOpacity",bgColor:"subtitleBgColor",textColor:"subtitleTextColor",edge:"subtitleEdge",bold:"subtitleBold"},q={fontSize:1.8,position:0,bgOpacity:.5,bgColor:"#000000",textColor:"#ffffff",edge:"shadow",bold:!1},de=(e,n,s)=>Math.max(n,Math.min(s,e)),ue=e=>typeof e=="string"&&/^#[0-9a-fA-F]{6}$/.test(e),oe=(e,n,s,i)=>{try{const r=localStorage.getItem(e);if(r===null)return n;const o=parseFloat(r);return Number.isFinite(o)?de(o,s,i):n}catch{return n}};function vr(){let e=q.edge,n=q.bgColor,s=q.textColor,i=q.bold;try{const r=localStorage.getItem("subtitleEdge");(r==="shadow"||r==="outline"||r==="none")&&(e=r);const o=localStorage.getItem("subtitleBgColor");ue(o)&&(n=o);const c=localStorage.getItem("subtitleTextColor");ue(c)&&(s=c);const u=localStorage.getItem("subtitleBold");u!==null&&(i=u==="true")}catch{}return{fontSize:oe("subtitleFontSize",q.fontSize,.5,10),position:oe("subtitlePosition",q.position,0,100),bgOpacity:oe("subtitleBgOpacity",q.bgOpacity,0,1),bgColor:n,textColor:s,edge:e,bold:i}}function De(e,n){const s=`rgba(0, 0, 0, ${de(n,0,1)})`;if(!ue(e))return s;const i=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return`rgba(${i}, ${r}, ${o}, ${de(n,0,1)})`}function Oe(e,n){return e==="none"?n<=0?"0 1px 3px rgba(0, 0, 0, 0.9)":"none":e==="outline"?["-1px 0 0 black","1px 0 0 black","0 -1px 0 black","0 1px 0 black","-1px -1px 0 black","1px -1px 0 black","-1px 1px 0 black","1px 1px 0 black","0 0 6px rgba(0, 0, 0, 0.9)"].join(", "):"0 0 4px black, 0 1px 2px rgba(0, 0, 0, 0.8)"}function zn(e){return`
|
|
2
|
-
video::cue {
|
|
3
|
-
font-size: ${e.fontSize}rem !important;
|
|
4
|
-
color: ${e.textColor} !important;
|
|
5
|
-
background-color: ${De(e.bgColor,e.bgOpacity)} !important;
|
|
6
|
-
font-weight: ${e.bold?"bold":"normal"} !important;
|
|
7
|
-
text-shadow: ${Oe(e.edge,e.bgOpacity)} !important;
|
|
8
|
-
}
|
|
9
|
-
`}function Vn(e){return[`font-size: ${e.fontSize}rem`,`color: ${e.textColor}`,`background-color: ${De(e.bgColor,e.bgOpacity)}`,`font-weight: ${e.bold?"700":"400"}`,`text-shadow: ${Oe(e.edge,e.bgOpacity)}`,"padding: 0.2em 0.5em","border-radius: 0.25em","text-align: center","position: absolute","left: 50%","transform: translateX(-50%)","max-width: 92%","white-space: pre-wrap","overflow-wrap: break-word","line-height: 1.4"].join(`;
|
|
10
|
-
`)+";"}const Sr=new Set(["b","i","u","strong","em"]);function Kn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/<(\/?)([a-zA-Z]+)>/g,(s,i,r)=>Sr.has(r.toLowerCase())?`<${i}${r.toLowerCase()}>`:s)}function Un(e){return e.replace(/<[^>]*>/g,"")}const Qn=["#ffffff","#ffff00","#7CFC00","#00e5ff","#ff9ff3","#ffa502"],Gn=["#000000","#1e272e","#2f3542","#3d0c02","#0c3d2e","#ffffff"];function Yn(e,n){const s=Number.isFinite(e)?e*16:q.fontSize*16;return!Number.isFinite(n)||n<=0?s/16:Math.min(s,Math.max(13,n*.07))/16}function Xn(e){const n=Math.abs(e/1e3).toFixed(1);return e>0?`+${n}s`:e<0?`-${n}s`:"0.0s"}function Jn(e,n){const s=e.clientWidth||0,i=e.clientHeight||0,r=e.videoWidth>0&&e.videoHeight>0?e.videoWidth/e.videoHeight:0;let o=i;r>0&&s>0&&i>0&&(o=s/i>r?i:s/r);const c=Math.max(0,(i-o)/2),u=Math.max(0,Math.min(100,Number(n)||0))/100*o;return c+u}const Zn=({isOpen:e,onClose:n,title:s,heading:i,message:r,children:o})=>t(Fe,{isOpen:e,onClose:n,title:s,width:"sm",children:t("div",{style:{padding:"1rem",textAlign:"center"},children:[t(K,{name:"check-circle",size:48,style:{color:"var(--accent-lighter)",marginBottom:"0.5rem"}}),t("p",{style:{fontSize:"1.1rem",fontWeight:600},children:i}),t("p",{style:{color:"var(--text-secondary)"},children:r}),o&&t("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center",flexWrap:"wrap"},children:o})]})}),es=({isOpen:e,onClose:n,title:s,message:i,resumeLabel:r="Resume",restartLabel:o="Start Over",onResume:c,onRestart:u})=>t(Fe,{isOpen:e,onClose:n,title:s,width:"sm",children:t("div",{style:{padding:"1rem",textAlign:"center"},children:[t("p",{children:i}),t("div",{style:{marginTop:"1rem",display:"flex",gap:"10px",justifyContent:"center"},children:[t(V,{variant:"secondary",onClick:u,children:o}),t(V,{onClick:c,children:r})]})]})}),wr="_centerControls_bxt8c_1",Cr="_centerSkipBtn_bxt8c_15",kr="_centerPlayPause_bxt8c_37",te={centerControls:wr,centerSkipBtn:Cr,centerPlayPause:kr},ts=()=>t("div",{className:te.centerControls,onClick:e=>e.stopPropagation(),children:[t(Ie,{seconds:-10,className:te.centerSkipBtn}),t(ct,{className:te.centerPlayPause,"data-speed-boost-ignore":"true"}),t(Ie,{seconds:10,className:te.centerSkipBtn})]}),rs=({visible:e,title:n,episode:s,onBack:i,classes:r})=>t("div",{className:`${r.overlay} ${e?"":r.hidden} `,"data-speed-boost-ignore":"true",style:{pointerEvents:"none",background:"none"},children:t("div",{className:r.top,onClick:o=>o.stopPropagation(),children:[t("button",{className:r.backBtn,onClick:o=>{o.stopPropagation(),i()},title:"Back","aria-label":"Back",children:t(K,{name:"chevron-left"})}),t("div",{className:r.titleInfo,children:[t("span",{className:r.title,children:n}),s&&t("span",{className:r.episode,children:s})]})]})});function xr(e){return e instanceof Element&&!!e.closest('button, input, select, textarea, a, [role="button"], [role="slider"], [data-player-ui="true"]')}function ns({engine:e,topBar:n,centerControls:s,bottomBar:i,settingsPanel:r,overlays:o,isInteracting:c=!1,nativeControls:u=!1,chromeDisabled:a=!1,className:l,onStageClick:g,children:C}){const y=Re(e),E=lt(),p=S(void 0),d=S(void 0),N=S(0),f=S(c);f.current=c;const w=B(()=>{clearTimeout(p.current),p.current=void 0},[]),h=B(()=>{w();const x=e.getState();!x.isPlaying||x.isScrubbing||f.current||u||(p.current=setTimeout(()=>{const P=e.getState();f.current||P.isScrubbing||!P.isPlaying||e.setShowControls(!1)},E?5e3:3e3))},[e,E,u,w]),L=B(()=>{e.setShowControls(!0),h()},[e,h]);dt(e,L,!u&&!a),j(()=>(c||y.isScrubbing||!y.isPlaying?(e.setShowControls(!0),w()):h(),w),[e,c,y.isPlaying,y.isScrubbing,y.showControls,w,h]),j(()=>()=>{clearTimeout(d.current)},[]);const A=x=>{if(xr(x.target)||u||a)return;g?.();const P=Date.now();if(P-N.current<280){clearTimeout(d.current),d.current=void 0,N.current=0,e.toggleFullscreen();return}N.current=P,clearTimeout(d.current),d.current=setTimeout(()=>{d.current=void 0,e.setShowControls(!e.getState().showControls),h()},280)},F=y.showControls||y.isScrubbing||c||!y.isPlaying;return t(ut,{engine:e,children:t("div",{ref:e.containerRef,"data-player-root":"true",className:`${Y.shell} ${y.isFullscreen?Y.shellFullscreen:""} ${l??""}`,style:{cursor:!F&&y.isFullscreen?"none":"default"},onContextMenu:x=>x.preventDefault(),onPointerMove:x=>{x.pointerType==="mouse"&&L()},onFocusIn:L,onMouseLeave:()=>{window.matchMedia?.("(hover: hover) and (pointer: fine)").matches&&e.getState().isPlaying&&!f.current&&e.setShowControls(!1)},children:[t("div",{className:Y.stage,onClick:A,children:C}),o,(y.error||y.playBlocked)&&t("div",{className:Y.engineStatus,"data-player-ui":"true",children:t(pt,{})}),!a&&!u&&t("div",{className:Y.uiLayer,children:[t("div",{"data-player-ui":"true",children:n}),F&&s&&t("div",{"data-player-ui":"true",children:s}),t("div",{"data-player-ui":"true",children:i}),r&&t("div",{"data-player-ui":"true",children:r})]})]})})}const Tr=e=>(e.language??e.lang??"").toLowerCase(),Nr=e=>(e.label??"").toLowerCase(),Lr=e=>`${e.language??e.lang??""}|||${e.label??""}`,Br=e=>Tr(e).startsWith("en")||Nr(e).includes("english");function ss(e,n){if(e.length===0||n?.enabled===!1)return-1;const s=n?.lastKey??null;if(s){const r=e.findIndex(o=>Lr(o)===s);if(r>=0)return r}const i=e.findIndex(Br);return i>=0?i:0}const Er="_statusArea_1xccu_1",Ar="_toggleBtn_1xccu_20",Pr="_shortcuts_1xccu_46",$r="_shortcutGroup_1xccu_56",Ir="_shortcut_1xccu_46",Mr="_key_1xccu_70",jr="_label_1xccu_91",_={statusArea:Er,toggleBtn:Ar,shortcuts:Pr,shortcutGroup:$r,shortcut:Ir,key:Mr,label:jr},as=({showTheater:e=!0})=>{const[n,s]=k(!1);return t("div",{className:_.statusArea,children:[t("button",{type:"button",className:_.toggleBtn,onClick:()=>s(i=>!i),"aria-expanded":n,"aria-controls":"player-shortcuts",children:[t(K,{name:"keyboard",size:14}),t("span",{children:"Keyboard Shortcuts"}),n?t(K,{name:"chevron-up",size:12}):t(K,{name:"chevron-down",size:12})]}),n&&t("div",{id:"player-shortcuts",className:_.shortcuts,children:[t("div",{className:_.shortcutGroup,children:[t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"↑"}),t("span",{className:_.key,children:"↓"}),t("span",{className:_.label,children:"Volume"})]}),t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"←"}),t("span",{className:_.key,children:"→"}),t("span",{className:_.label,children:"Seek"})]})]}),t("div",{className:_.shortcutGroup,children:[t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"Space"}),t("span",{className:_.label,children:"Play/Pause"})]}),t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"F"}),t("span",{className:_.label,children:"Fullscreen"})]}),t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"M"}),t("span",{className:_.label,children:"Mute"})]}),e&&t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"T"}),t("span",{className:_.label,children:"Theater"})]}),t("div",{className:_.shortcut,children:[t("span",{className:_.key,children:"N"}),t("span",{className:_.label,children:"Next"})]})]})]})]})},Fr="_episodeListContainer_9tyin_1",Rr="_drawerContainer_9tyin_9",Dr="_episodeListHeader_9tyin_14",Or="_drawerHeader_9tyin_20",Hr="_episodeListTitle_9tyin_29",qr="_rangeSelector_9tyin_41",Wr="_rangeButton_9tyin_47",zr="_active_9tyin_70",Vr="_episodeList_9tyin_1",Kr="_drawerList_9tyin_89",Ur="_episodeItem_9tyin_118",Qr="_watched_9tyin_145",Gr="_episodeThumb_9tyin_167",Yr="_episodeText_9tyin_176",Xr="_episodeLabel_9tyin_184",Jr="_episodeSub_9tyin_189",v={episodeListContainer:Fr,drawerContainer:Rr,episodeListHeader:Dr,drawerHeader:Or,episodeListTitle:Hr,rangeSelector:qr,rangeButton:Wr,active:zr,episodeList:Vr,drawerList:Kr,episodeItem:Ur,watched:Qr,episodeThumb:Gr,episodeText:Yr,episodeLabel:Xr,episodeSub:Jr},Zr=({episodes:e,currentEpisode:n,watchedEpisodes:s=[],onEpisodeClick:i,variant:r="sidebar",title:o="Episodes",header:c})=>{const[u,a]=k(0),l=S(null),g=X(()=>e.map(p=>typeof p=="string"?{id:p,label:`Episode ${p}`}:p),[e]),C=X(()=>new Set(s),[s]);j(()=>{const p=l.current;if(!p)return;let d=p.parentElement;for(;d;){const w=window.getComputedStyle(d);if((w.overflowY==="auto"||w.overflowY==="scroll")&&d.scrollHeight>d.clientHeight)break;d=d.parentElement}if(!d)return;const N=d.getBoundingClientRect(),f=p.getBoundingClientRect();d.scrollTop+=f.top+f.height/2-(N.top+d.clientHeight/2)},[n,u]);const y=X(()=>{if(g.length<=100)return[];const p=[];for(let d=0;d<g.length;d+=100){const N=d+1,f=Math.min(d+100,g.length);p.push(`${N}-${f}`)}return p},[g]),E=X(()=>{if(y.length===0)return g;const p=y[u];if(!p)return g;const[d,N]=p.split("-"),f=parseInt(d,10),w=parseInt(N,10);return g.slice(f-1,w)},[g,y,u]);return t("div",{className:`${v.episodeListContainer} ${r==="drawer"?v.drawerContainer:""}`,children:[t("div",{className:`${v.episodeListHeader} ${r==="drawer"?v.drawerHeader:""}`,children:[c,t("h3",{className:v.episodeListTitle,children:o}),y.length>0&&t("div",{className:v.rangeSelector,children:y.map((p,d)=>t("button",{className:`${v.rangeButton} ${u===d?v.active:""}`,onClick:()=>a(d),children:p},p))})]}),t("div",{className:`${v.episodeList} ${r==="drawer"?v.drawerList:""}`,children:E.map(p=>{const d=p.id===n,N=C.has(p.id)||p.watched===!0;return t("div",{ref:d?l:void 0,className:`${v.episodeItem} ${N?v.watched:""} ${d?v.active:""}`,onClick:()=>i(p.id),children:[p.thumbnail&&t("img",{src:p.thumbnail,alt:"",loading:"lazy",decoding:"async",className:v.episodeThumb}),t("span",{className:v.episodeText,children:[t("span",{className:v.episodeLabel,children:p.label??`Episode ${p.id}`}),p.sublabel&&t("span",{className:v.episodeSub,children:p.sublabel})]})]},p.id)})})]})},os=({variant:e="sidebar",count:n=12})=>t("div",{className:`${v.episodeListContainer} ${e==="drawer"?v.drawerContainer:""}`,children:[t("div",{className:`${v.episodeListHeader} ${e==="drawer"?v.drawerHeader:""}`,children:[t("h3",{className:v.episodeListTitle,children:"Episodes"}),t("div",{className:v.rangeSelector,children:[t(ee,{width:"60px",height:"28px",variant:"rectangular"}),t(ee,{width:"60px",height:"28px",variant:"rectangular"}),t(ee,{width:"60px",height:"28px",variant:"rectangular"})]})]}),t("div",{className:`${v.episodeList} ${e==="drawer"?v.drawerList:""}`,children:Array.from({length:n}).map((s,i)=>t("div",{className:v.episodeItem,style:{border:"none",background:"transparent"},children:t(ee,{width:"120px",height:"1.2rem",variant:"text"})},i))})]}),en="_shell_cys6s_1",tn="_overlay_cys6s_10",rn="_drawer_cys6s_21",nn="_handle_cys6s_56",sn="_header_cys6s_64",an="_headerCopy_cys6s_73",on="_kicker_cys6s_79",cn="_title_cys6s_87",ln="_closeBtn_cys6s_94",dn="_body_cys6s_116",H={shell:en,overlay:tn,drawer:rn,handle:nn,header:sn,headerCopy:an,kicker:on,title:cn,closeBtn:ln,body:dn};function is({isOpen:e,onClose:n,episodes:s,currentEpisode:i,watchedEpisodes:r=[],onEpisodeClick:o,title:c,header:u}){return j(()=>{if(!e)return;const a=g=>{g.key==="Escape"&&n()},l=document.body.style.overflow;return document.body.style.overflow="hidden",document.addEventListener("keydown",a),()=>{document.body.style.overflow=l,document.removeEventListener("keydown",a)}},[e,n]),e?nt(t("div",{className:H.shell,role:"dialog","aria-modal":"true","aria-label":"Episode picker",children:[t("button",{className:H.overlay,type:"button",onClick:n,"aria-label":"Close episodes"}),t("aside",{className:H.drawer,children:[t("div",{className:H.handle}),t("div",{className:H.header,children:[t("div",{className:H.headerCopy,children:[t("span",{className:H.kicker,children:"Episode picker"}),t("h3",{className:H.title,children:"Choose an episode"})]}),t("button",{className:H.closeBtn,type:"button",onClick:n,"aria-label":"Close",children:t(K,{name:"times"})})]}),t("div",{className:H.body,children:t(Zr,{episodes:s,currentEpisode:i,watchedEpisodes:r,onEpisodeClick:o,variant:"drawer",title:c,header:u})})]})]}),document.body):null}const un="_sourceSelectionContainer_1am19_1",pn="_providerSelectContainer_1am19_14",fn="_providerSelect_1am19_14",hn="_sourceSelect_1am19_1",mn="_sourceButtons_1am19_70",bn="_sourceButton_1am19_70",gn="_active_1am19_95",cs={sourceSelectionContainer:un,providerSelectContainer:pn,providerSelect:fn,sourceSelect:hn,sourceButtons:mn,sourceButton:bn,active:gn},ls=({skipIntervals:e,showId:n,episodeNumber:s,episodeCount:i,sourceType:r,showMeta:o})=>{const c=ht(),u=st(),{engine:a,mediaRef:l}=ft({volumeKey:"playerVolume",mutedKey:"playerMuted"}),{isPlaying:g,isMuted:C,volume:y,duration:E,isScrubbing:p,isBuffering:d,isFullscreen:N,isSpeedBoostActive:f,showControls:w}=Re(a),h=a.containerRef,L=S(null),A=S(0),F=S(Math.random().toString(36).substring(2)),x=a.setShowControls,[P,O]=k(localStorage.getItem("autoSkipEnabled")==="true"),[ne,W]=k(null),[T]=k(vr),[J,fe]=k(T.fontSize),[He,he]=k(T.position),[qe,me]=k(T.bgOpacity),[We,be]=k(T.bgColor),[ze,ge]=k(T.textColor),[Ve,ye]=k(T.edge),[Ke,_e]=k(T.bold),ve=B((b,I)=>{if({fontSize:m=>typeof m!="number"?!1:(fe(m),!0),position:m=>typeof m!="number"?!1:(he(m),!0),bgOpacity:m=>typeof m!="number"?!1:(me(m),!0),bgColor:m=>typeof m!="string"?!1:(be(m),!0),textColor:m=>typeof m!="string"?!1:(ge(m),!0),edge:m=>m!=="shadow"&&m!=="outline"&&m!=="none"?!1:(ye(m),!0),bold:m=>typeof m!="boolean"?!1:(_e(m),!0)}[b](I))try{localStorage.setItem(_r[b],String(I))}catch{}},[]),[Ue,Qe]=k([]),[Ge,Ye]=k(null),[Xe,Je]=k(!1),[Ze,et]=k(!1),[tt,Se]=k(()=>{try{return localStorage.getItem("playerUseNativeControls")==="true"}catch{return!1}}),U=S(!1),se=S(-1),Z=B(()=>{const b=l.current;return!n||!s||!o?.name?null:{showId:n,episodeNumber:s,episodeCount:i,currentTime:a.getTimeline().currentTime,duration:a.getState().duration,showName:o.name,showThumbnail:o.thumbnail,nativeName:o.names?.native,englishName:o.names?.english,genres:Array.isArray(o.genres)?o.genres.map(I=>typeof I=="string"?I:I?.name).filter(Boolean):void 0,popularityScore:o.score,type:o.type,isPlaying:b?!b.paused:r==="iframe",sessionId:F.current,isAdult:o.isAdult}},[a,l,n,s,i,o,r]),$=B((b=!1,I=!1)=>{if(U.current)return!1;const R=Z();if(!R)return!1;const m=l.current;if(!m&&!b&&r!=="iframe"||r!=="iframe"&&R.duration<=0)return!1;const D=a.getTimeline().currentTime;if(!I){if(D===0)return!1;const Q=m?Math.abs(D-se.current):0;if(!b&&m&&D!==m.duration&&Q<5)return!1}return R.currentTime=D,se.current=D,b?(async()=>{try{await $e("progress.updateProgress",R),c.invalidateQueries({queryKey:[G.videoSources,n,s]}),c.invalidateQueries({queryKey:[G.continueWatching]}),c.invalidateQueries({queryKey:[G.thisWeekSchedule]}),c.invalidateQueries(u.continueWatching.pathFilter())}catch(Q){console.error("Failed to update progress:",Q)}})():$e("progress.updateProgress",R).catch(Q=>console.error("Failed to update progress:",Q)),!0},[a,Z,r,c,n,s,u.continueWatching,l]);j(()=>{const b=()=>{U.current||$(!0)};window.addEventListener("beforeunload",b),window.addEventListener("pagehide",b);const I=()=>{document.visibilityState==="hidden"&&b()};document.addEventListener("visibilitychange",I);const R=L;return()=>{window.removeEventListener("beforeunload",b),window.removeEventListener("pagehide",b),document.removeEventListener("visibilitychange",I),U.current||$(!0),R.current&&clearTimeout(R.current)}},[$]);const we=B(()=>a.setShowControls(!0),[a]),Ce=a.toggleFullscreen,ke=B(()=>{a.togglePlay(),x(!0)},[a,x]),xe=B(()=>{a.toggleMute(),x(!0)},[a,x]),Te=B(b=>{a.seekRelative(b),L.current&&clearTimeout(L.current),L.current=setTimeout(()=>$(!1,!0),1500),x(!0)},[a,$,x]),Ne=B(()=>{U.current=!1,$(!1,!0)},[$]),Le=B(()=>{x(!0),$(!1,!0)},[$,x]);j(()=>{U.current=!1,se.current=-1,A.current=0,F.current=Math.random().toString(36).substring(2),a.reset()},[a,n,s]);const Be=a.reset;j(()=>{const b=F.current;return()=>{at(b)}},[a,n,s]),j(()=>{if(r!=="iframe")return;$(!1,!0);const b=setInterval(()=>{$(!1,!0)},6e4);return()=>clearInterval(b)},[r,$]);const Ee=B(()=>{const b=l.current;if(!b)return;const I=b.currentTime||0,R=Date.now();R-A.current>6e4&&$()&&(A.current=R);const m=e.find(D=>I>=D.start_time&&I<D.end_time)||null;W(D=>D?.skip_id!==m?.skip_id?m:D),P&&m&&!b.paused&&(b.currentTime=m.end_time,W(null))},[l,e,P,$]),Ae=B(()=>{const b=Z();b&&(b.currentTime=b.duration,ot.progress.updateProgress.mutate(b).then(()=>{c.invalidateQueries({queryKey:[G.videoSources,n,s]}),c.invalidateQueries({queryKey:[G.continueWatching]})}).catch(I=>console.error("Failed to send final progress:",I)))},[Z,c,n,s]),Pe=B(()=>{U.current=!0,Ae()},[Ae]),rt=X(()=>({togglePlay:ke,seek:Te,toggleMute:xe,toggleFullscreen:Ce,onPlay:Ne,onPause:Le,formatTime:it,onTimeUpdate:Ee,onEnded:Pe,setShowControls:x,setIsAutoSkipEnabled:O,setCurrentSkipInterval:W,setSubtitleFontSize:fe,setSubtitlePosition:he,setSubtitleBgOpacity:me,setSubtitleBgColor:be,setSubtitleTextColor:ge,setSubtitleEdge:ye,setSubtitleBold:_e,setSubtitleStyle:ve,setAvailableSubtitles:Qe,setActiveSubtitleTrack:Ye,setShowSettings:Je,setShowVolumeSlider:et,flashControls:we,sendProgressUpdate:$,setUseNativeControls:Se,resetMediaState:Be}),[ke,Te,xe,Ce,Ne,Le,Ee,Pe,$,Se,Be,we,ve,x]);return{engine:a,refs:{videoRef:l,playerContainerRef:h},state:{isPlaying:g,isMuted:C,volume:y,isFullscreen:N,duration:E,showControls:w,isScrubbing:p,isAutoSkipEnabled:P,currentSkipInterval:ne,subtitleFontSize:J,subtitlePosition:He,subtitleBgOpacity:qe,subtitleBgColor:We,subtitleTextColor:ze,subtitleEdge:Ve,subtitleBold:Ke,availableSubtitles:Ue,activeSubtitleTrack:Ge,showSettings:Xe,showVolumeSlider:Ze,isBuffering:d,isSpeedBoostActive:f,useNativeControls:tt},actions:rt}};function yn(){try{return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}catch{return!1}}function ds(e,n){const{refs:s,actions:i}=e,r=S(n);r.current=n;const o=S(!1),c=S(!1),u=a=>{try{if(a)return a.matches}catch{}try{return window.innerWidth>window.innerHeight}catch{return!1}};j(()=>{if(!yn())return;let a=null;const l=()=>{const g=s.playerContainerRef.current;if(u(a)){if(!r.current||!g||ae(s.videoRef.current)||c.current)return;o.current=!0,i.toggleFullscreen()}else c.current=!1,o.current&&(o.current=!1,ae(s.videoRef.current)&&i.toggleFullscreen())};try{a=window.matchMedia("(orientation: landscape)"),a.addEventListener?a.addEventListener("change",l):a.addListener(l)}catch{}return l(),()=>{try{a&&(a.removeEventListener?a.removeEventListener("change",l):a.removeListener(l))}catch{}}},[i,s.playerContainerRef,s.videoRef,n]),j(()=>{const a=()=>{if(!ae(s.videoRef.current)){o.current=!1;try{window.matchMedia("(orientation: landscape)").matches&&(c.current=!0)}catch{c.current=!0}}};return document.addEventListener("fullscreenchange",a),document.addEventListener("webkitfullscreenchange",a),()=>{document.removeEventListener("fullscreenchange",a),document.removeEventListener("webkitfullscreenchange",a)}},[s.videoRef])}const _n=e=>Math.max(8,Math.min(40,Math.ceil(e/16.7)+4));function us({videoRef:e,canvasRef:n,delayMs:s,enabled:i}){const r=S(s);r.current=s;const o=S([]),c=S(-1),u=S(-1),a=S(!1),l=S(0),g=S(null);j(()=>{const C=f=>{if(f)try{f.close()}catch{}},y=()=>{for(const f of o.current)C(f.bitmap);o.current=[]};if(!i){y(),c.current=-1,u.current=-1,a.current=!1,l.current=0;return}let E=!1;const p=()=>{g.current!==null&&(cancelAnimationFrame(g.current),g.current=null)},d=()=>{E||(p(),g.current=requestAnimationFrame(()=>{N()}))};async function N(){if(E)return;const f=e.current,w=n.current;if(!f||!w||f.videoWidth===0){d();return}if(f.paused||f.ended||document.hidden||f.readyState<HTMLMediaElement.HAVE_CURRENT_DATA){d();return}const h=f.getVideoPlaybackQuality().totalVideoFrames;if(h===c.current){d();return}(f.seeking||u.current>=0&&Math.abs(f.currentTime-u.current)>.5)&&(y(),a.current=!1,l.current=0,c.current=-1),u.current=f.currentTime,(w.width!==f.videoWidth||w.height!==f.videoHeight)&&(w.width=f.videoWidth,w.height=f.videoHeight);const L=Math.max(0,r.current||0);L>l.current&&(a.current=!1);try{const A=await createImageBitmap(f);if(E){C(A);return}c.current=h;const F=performance.now(),x=w.getContext("2d"),P=T=>{x&&x.drawImage(T,0,0,w.width,w.height)};if(L<=0){y(),a.current=!1,l.current=0,P(A),C(A),d();return}const O=o.current;O.push({bitmap:A,capture:F});const ne=_n(L);for(;O.length>ne;)C(O.shift()?.bitmap);let W=-1;for(let T=O.length-1;T>=0;T--)if(F-O[T].capture>=L){W=T;break}if(W!==-1){for(let J=0;J<W;J++)C(O.shift()?.bitmap);const T=O.shift();T?(P(T.bitmap),C(T.bitmap),a.current=!0,l.current=L):P(A)}else if(!a.current)P(A);else{const T=O.shift();T?(P(T.bitmap),C(T.bitmap)):P(A)}}catch{}d()}return d(),()=>{E=!0,p();for(const f of o.current)try{f.bitmap.close()}catch{}o.current=[]}},[i,e,n])}const Me=(e,n)=>{try{localStorage.setItem("playerVideoDelayMs",String(e)),localStorage.setItem("playerVideoDelayEnabled",String(n))}catch{}},je=e=>{try{localStorage.setItem("playerVideoDelayEnabled",String(e))}catch{}};function ps(e,n){const[s,i]=k(()=>{try{const h=Number(localStorage.getItem("playerVideoDelayMs"));if(Number.isFinite(h)&&h>=0&&h<=500)return Math.round(h)}catch{}return 180}),[r,o]=k(()=>{try{return localStorage.getItem("playerVideoDelayEnabled")==="true"}catch{return!1}}),[c,u]=k(!1),[a,l]=k(!1),g=S(null),C=S(null),y=h=>{const L=Math.max(0,Math.min(500,Math.round(h)));i(L);try{localStorage.setItem("playerVideoDelayMs",String(L))}catch{}},E=h=>{o(h),je(h)},p=B(()=>{l(!1),u(!1)},[]);return{videoDelayMs:s,videoDelayEnabled:r,setDelayEnabled:E,handleVideoDelayChange:y,isCalibrating:c,testClipActive:a,stopCalibration:p,openAvSyncCalibrator:()=>{g.current={enabled:r,ms:s},o(!0),je(!0),n?.(),u(!0)},cancelAvSyncCalibrator:()=>{const h=g.current;g.current=null,h&&(i(h.ms),o(h.enabled),Me(h.ms,h.enabled)),l(!1),u(!1)},applyAvSyncCalibrator:()=>{g.current=null,o(!0),Me(s,!0),l(!1),u(!1)},toggleTestClip:()=>{if(a){l(!1);return}const h=e.current;h&&!isNaN(h.currentTime)&&(C.current=h.currentTime),l(!0)},calibReturnRef:C,effectiveVideoDelayMs:r?s:0}}function fs(){const[e,n]=k(()=>{try{return localStorage.getItem("playerTheaterMode")==="true"}catch{return!1}});j(()=>{try{e?document.body.classList.add("theater-mode"):document.body.classList.remove("theater-mode")}catch(r){console.error(r)}return()=>{try{document.body.classList.remove("theater-mode")}catch(r){console.error(r)}}},[e]);const s=B(()=>{n(r=>{const o=!r;try{localStorage.setItem("playerTheaterMode",o.toString())}catch{}return o})},[]),i=B(r=>{if(e&&r.target===r.currentTarget){n(!1);try{localStorage.setItem("playerTheaterMode","false")}catch{}}},[e]);return{isTheaterMode:e,toggleTheaterMode:s,handleLayoutClick:i}}const z={enabled:!0,blur:60,saturation:150,brightness:70,opacity:60};function vn(){try{const e=localStorage.getItem("playerAmbientLight");if(!e)return z;const n=JSON.parse(e),s=(i,r,o,c)=>{const u=Number(i);return Number.isFinite(u)?Math.max(o,Math.min(c,u)):r};return{enabled:n.enabled??z.enabled,blur:s(n.blur,z.blur,0,120),saturation:s(n.saturation,z.saturation,0,200),brightness:s(n.brightness,z.brightness,20,120),opacity:s(n.opacity,z.opacity,10,100)}}catch{return z}}function hs(){const[e,n]=k(vn),s=B(i=>{n(r=>{const o={...r,...i};try{localStorage.setItem("playerAmbientLight",JSON.stringify(o))}catch{}return o})},[]);return{settings:e,update:s}}const Sn="_theaterAmbient_x9t0o_1",wn={theaterAmbient:Sn},ie=160,ce=90,Cn=120,ms=({videoRef:e,active:n,settings:s,className:i})=>{const r=S(null);return j(()=>{if(!n)return;const o=r.current,c=e.current;if(!o||!c)return;const u=o.getContext("2d",{alpha:!1});if(!u)return;let a=0,l=0,g=!1;const C=()=>{if(!(c.readyState<2||!c.videoWidth))try{const d=c.videoWidth,N=c.videoHeight,f=ie/ce,w=d/N;let h=d,L=N,A=0,F=0;w>f?(h=N*f,A=(d-h)/2):(L=d/f,F=(N-L)/2),u.drawImage(c,A,F,h,L,0,0,ie,ce)}catch{}},y=d=>{g||c.paused||(a=requestAnimationFrame(y),!(d-l<Cn)&&(l=d,C()))},E=()=>{g||(cancelAnimationFrame(a),l=0,a=requestAnimationFrame(y))},p=()=>cancelAnimationFrame(a);return c.addEventListener("play",E),c.addEventListener("pause",p),c.addEventListener("seeked",C),c.addEventListener("loadeddata",C),a=requestAnimationFrame(y),()=>{g=!0,cancelAnimationFrame(a),c.removeEventListener("play",E),c.removeEventListener("pause",p),c.removeEventListener("seeked",C),c.removeEventListener("loadeddata",C)}},[n,e]),n?t("canvas",{ref:r,width:ie,height:ce,"aria-hidden":"true",className:i??wn.theaterAmbient,style:{filter:`blur(${s.blur}px) saturate(${s.saturation}%) brightness(${s.brightness}%)`,opacity:s.opacity/100}}):null},kn="_row_1fq55_1",xn="_rowHeader_1fq55_9",Tn="_rowLabel_1fq55_17",Nn="_rowValue_1fq55_28",Ln="_slider_1fq55_36",Bn="_swatches_1fq55_99",En="_swatch_1fq55_99",An="_swatchPicked_1fq55_114",Pn="_colorInput_1fq55_120",$n="_segmented_1fq55_131",M={row:kn,rowHeader:xn,rowLabel:Tn,rowValue:Nn,slider:Ln,swatches:Bn,swatch:En,swatchPicked:An,colorInput:Pn,segmented:$n},In=({label:e,display:n,min:s,max:i,step:r,value:o,percent:c,onChange:u,onCommit:a})=>t("div",{className:M.row,children:[t("div",{className:M.rowHeader,children:[t("span",{className:M.rowLabel,children:e}),t("span",{className:M.rowValue,children:n})]}),t("input",{type:"range",className:M.slider,min:s,max:i,step:r,value:o,"aria-label":e,"data-speed-boost-ignore":"true",onInput:l=>u(Number(l.target.value)),onMouseDown:l=>l.stopPropagation(),onPointerDown:l=>l.stopPropagation(),onTouchStart:l=>l.stopPropagation(),onPointerUp:a,onPointerCancel:a,onTouchEnd:a,onKeyUp:a,onBlur:a,style:{"--slider-percent":`${c}%`}})]}),bs=({label:e,colors:n,value:s,onChange:i})=>t("div",{className:M.row,children:[t("div",{className:M.rowHeader,children:t("span",{className:M.rowLabel,children:e})}),t("div",{className:M.swatches,children:[n.map(r=>t("button",{type:"button","aria-label":`${e} ${r}`,"aria-pressed":s.toLowerCase()===r.toLowerCase(),onClick:()=>i(r),className:`${M.swatch} ${s.toLowerCase()===r.toLowerCase()?M.swatchPicked:""}`,style:{backgroundColor:r}},r)),t("input",{type:"color","aria-label":`Custom ${e.toLowerCase()}`,className:M.colorInput,value:s,"data-speed-boost-ignore":"true",onInput:r=>i(r.target.value),onMouseDown:r=>r.stopPropagation(),onPointerDown:r=>r.stopPropagation(),onTouchStart:r=>r.stopPropagation()})]})]});function gs({label:e,options:n,value:s,onChange:i}){return t("div",{className:M.row,children:[t("div",{className:M.rowHeader,children:t("span",{className:M.rowLabel,children:e})}),t("div",{className:M.segmented,role:"group","aria-label":e,children:n.map(r=>t("button",{type:"button","aria-pressed":s===r,onClick:()=>i(r),children:[t("span",{children:r}),s===r&&t(K,{name:"check",size:10})]},r))})]})}const re=10,pe=500,le=e=>Math.max(0,Math.min(pe,Math.round(e))),ys=({isOpen:e,ms:n,onChange:s,onApply:i,onClose:r,testClipActive:o,onTestClip:c})=>e?t("div",{role:"dialog","aria-label":"Calibrate audio video sync","data-speed-boost-ignore":"true",onClick:u=>u.stopPropagation(),style:{position:"absolute",right:8,bottom:112,width:"min(260px, calc(100% - 16px))",maxHeight:"calc(100% - 124px)",overflowY:"auto",overflowX:"hidden",zIndex:60,display:"flex",flexDirection:"column",alignItems:"center",gap:8,padding:12,borderRadius:"var(--radius-lg)",border:"1px solid var(--glass-border)",background:"rgba(18, 18, 22, 0.95)",boxShadow:"var(--glass-shadow)",backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",boxSizing:"border-box"},children:[t("div",{style:{fontSize:"0.8rem",fontWeight:800,color:"var(--text-primary)"},children:"A/V sync"}),t("div",{children:t(V,{size:"sm",variant:"secondary",onClick:c,children:o?"Back to video":"Preview test clip"})}),t("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6,flexWrap:"wrap"},children:[t(V,{size:"sm",onClick:()=>s(le(n-re)),"aria-label":"Decrease delay by 10 milliseconds",children:["− ",re,"ms"]}),t("div",{style:{fontSize:"1.1rem",fontWeight:800,minWidth:64,textAlign:"center"},children:[n,"ms"]}),t(V,{size:"sm",onClick:()=>s(le(n+re)),"aria-label":"Increase delay by 10 milliseconds",children:["+ ",re,"ms"]})]}),t(In,{label:"Video delay",display:`${n}ms`,min:0,max:pe,step:5,value:n,percent:n/pe*100,onChange:u=>s(le(u))}),t("div",{style:{display:"flex",gap:8,justifyContent:"center",flexWrap:"wrap"},children:[t(V,{size:"sm",variant:"secondary",onClick:r,children:"Cancel"}),t(V,{size:"sm",onClick:i,children:["Apply ",n,"ms"]})]})]}):null;function _s({videoRef:e,sourceType:n,resetKey:s,onEnd:i}){const r=S(!1),o=S(i);o.current=i,j(()=>{r.current=!1},[s]);const c=B(()=>{const a=e.current?.duration;!a||!Number.isFinite(a)||console.info(`[playback] duration ${a.toFixed(2)}s`)},[e]);return{checkEnd:B((a=!1)=>{const l=e.current;!l||n==="iframe"||r.current||!a&&!mt(l.currentTime,l.duration)||(r.current=!0,console.info(`[playback] end reached at ${l.currentTime.toFixed(2)}s / ${l.duration.toFixed(2)}s`),o.current())},[n,e]),logDuration:c}}export{ms as A,Gn as B,ts as C,q as D,os as E,z as F,In as M,ns as P,es as R,bs as S,Qn as T,rs as a,cs as b,zn as c,Vn as d,Jn as e,Yn as f,Un as g,ps as h,us as i,fs as j,_s as k,ds as l,hs as m,Wn as n,Zn as o,ss as p,Zr as q,Kn as r,Lr as s,qn as t,ls as u,ys as v,as as w,is as x,Xn as y,gs as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as l,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-BODgA6ir.js";import{T as g}from"./TvPopup-D6UvGI7M.js";import{c as m,i as f}from"./useTvLibrary-C6rSJQi_.js";import{b as i}from"./vendor-query-BBT5_sHx.js";import{i as p}from"./index-BP1z44Uk.js";const _=l(({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})})}),u=1e3*60*5,b=e=>{const a=p(),{query:s,type:n,genre:t,year:r,sort_by:y,page:c}=e;return i({...a.tv.search.queryOptions({q:s?.trim()||"",type:n||"multi",genre:t||"",year:r&&r!=="ALL"?r:"",sortBy:y||"popularity.desc",page:c||1}),staleTime:u,retry:1})},A=(e="all",a="week",s=1,n=!0)=>{const t=p(),r=i({...t.tv.trending.queryOptions({mediaType:e,timeWindow:a,page:s}),enabled:n,staleTime:u,retry:1});return{...r,data:r.data}};export{_ as T,b as a,A as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{T as p}from"./vendor-core-DfaOB3Rn.js";import{b as v,u as i,a as n}from"./vendor-query-BBT5_sHx.js";import{i as a,A as o,q as y,t as g}from"./index-BP1z44Uk.js";import{i as u}from"./libraryInvalidation-CVK2SYUR.js";const l=t=>String(t).toLowerCase()==="movie"?"movie":"tv",h=(t,e)=>`${l(t)}:${e}`,Q=(t,e)=>{const r=l(t);return`/tv/${e}?type=${r}`},$=(t,e,r,s)=>{const c=new URLSearchParams;return c.set("type",l(t)),r!==void 0&&c.set("s",String(r)),s!==void 0&&c.set("e",String(s)),`/tv/${e}/watch?${c.toString()}`},O=t=>t.adult===!0||t.adult===1,R={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"},f={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"},A=["Watching","Completed","On-Hold","Dropped","Planned"],T=(t,e)=>h(t,e),E=(t="All",e=1,r=24)=>{const s=a();return v(s.tvLibrary.list.queryOptions({status:t,page:e,limit:r}))},b=()=>{const t=a();return v({...t.tvLibrary.ids.queryOptions(),staleTime:1e3*60})},k=t=>{const e=a();return v({...e.tvLibrary.check.queryOptions({id:t||""}),enabled:!!t,staleTime:1e3*60})},M=(t=24)=>{const e=a();return v(e.tvProgress.continueWatching.queryOptions({limit:t}))},B=t=>{const e=a();return v({...e.tvProgress.getByMedia.queryOptions({mediaId:t||""}),enabled:!!t})},I=(t,e,r)=>{const s=a();return v({...s.tvProgress.latest.queryOptions({mediaId:t||"",season:e,episode:r}),enabled:!!t,staleTime:0})},F=()=>{const t=a(),e=i();return n({mutationFn:async r=>{const{silent:s,...c}=r;return g.tvLibrary.add.mutate(c)},onSuccess:(r,s)=>{s.silent||o.success("Added to TV watchlist"),e.invalidateQueries({queryKey:[y.tvLibrary]}),e.invalidateQueries(t.tvLibrary.pathFilter())},onError:r=>{o.error(`Failed to add: ${r.message}`)}})},S=()=>{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}`)}}))},w=()=>{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}`)}}))},D=()=>{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())}}))},W=()=>{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}`)}}))},V=()=>{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}`)}}))},_=()=>{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}`)}}))},U=()=>{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}`)}}))},H=()=>{const t=F(),e=S(),{data:r}=b(),s=p(()=>new Set(r?.ids||[]),[r]);return{toggle:d=>{const m=T(d.mediaType,d.tmdbId);s.has(m)?e.mutate(m):t.mutate({...d,poster:d.poster||""})},bookmarkedIds:s,pending:t.isPending||e.isPending}};export{f as M,R as T,S as a,W as b,Q as c,h as d,k as e,H as f,D as g,w as h,O as i,F as j,I as k,B as l,E as m,l as n,V as o,_ as p,U as q,A as r,$ as t,M as u};
|
/package/client/dist/assets/{usePlaybackEnd-BMf_H2dw.css → useWatchAlongPlayer-BMf_H2dw.css}
RENAMED
|
File without changes
|