@serifpersia/dango 3.7.3 → 3.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +10 -6
  2. package/client/dist/assets/{AnimeCard-BVufFeLC.js → AnimeCard-BxhPLWBG.js} +1 -1
  3. package/client/dist/assets/{AnimeInfo-Dihook4h.js → AnimeInfo-DcpKPBLS.js} +1 -1
  4. package/client/dist/assets/{AnimeInfoPage-K0ErjilQ.js → AnimeInfoPage-jKNSPHbX.js} +2 -2
  5. package/client/dist/assets/{Asmr-CP7vVwsh.js → Asmr-DlKBykO-.js} +2 -2
  6. package/client/dist/assets/Asmr-Do89pEHG.css +1 -0
  7. package/client/dist/assets/{AsmrResetProgressModal-cYO4Sr2k.js → AsmrResetProgressModal-DPHPLqPo.js} +1 -1
  8. package/client/dist/assets/{Home-BYuAVKgx.js → Home-D7-FNOmo.js} +1 -1
  9. package/client/dist/assets/{Insights-Bx01GySp.js → Insights-C9HufjGJ.js} +1 -1
  10. package/client/dist/assets/{LibraryListPage-BnrEDG8j.js → LibraryListPage-BT_xDjEq.js} +1 -1
  11. package/client/dist/assets/{ListeningList-kRSLAo3B.js → ListeningList-DL1rdCRi.js} +1 -1
  12. package/client/dist/assets/{Manga-COhyMd3K.js → Manga-BfFRq7eK.js} +1 -1
  13. package/client/dist/assets/{MangaInfoPage-LTEvl_nL.js → MangaInfoPage-wBJjn2FL.js} +1 -1
  14. package/client/dist/assets/{MangaReadPage-sEwzyBQ7.js → MangaReadPage-BAgsRqxt.js} +1 -1
  15. package/client/dist/assets/{MangaResetProgressModal-CbMR36Zu.js → MangaResetProgressModal-Br5zqZ-U.js} +1 -1
  16. package/client/dist/assets/{Mature-CMvs_-gf.js → Mature-MO7ZwJVT.js} +1 -1
  17. package/client/dist/assets/{MatureConsentModal-BnB-RHYQ.js → MatureConsentModal-Beq4JL0b.js} +1 -1
  18. package/client/dist/assets/{MediaCard-B0PJStxp.css → MediaCard-CoyScn-7.css} +1 -1
  19. package/client/dist/assets/MediaCard-lz7FdOe_.js +1 -0
  20. package/client/dist/assets/{OptionListMenu-onM2KK2X.js → OptionListMenu-BSUcso28.js} +1 -1
  21. package/client/dist/assets/Player-CnLC-x2S.js +56 -0
  22. package/client/dist/assets/{PlayerSettings-BfSv-hut.js → PlayerSettings-kqYmlLDl.js} +1 -1
  23. package/client/dist/assets/{QueueOptionsButton-B4Re8F3V.js → QueueOptionsButton-B8xuoYlH.js} +1 -1
  24. package/client/dist/assets/{QueueRail-Dkx_M6ng.js → QueueRail-D1FmM-GR.js} +1 -1
  25. package/client/dist/assets/{ReadingList-C--ZvTe2.js → ReadingList-D8ZiOnWi.js} +1 -1
  26. package/client/dist/assets/{ResetProgressModal-BuESoxbY.js → ResetProgressModal-0PvvM2XJ.js} +1 -1
  27. package/client/dist/assets/{Search-CEErwr88.js → Search-D1T-PrGX.js} +1 -1
  28. package/client/dist/assets/Settings-DALBQcFc.js +21 -0
  29. package/client/dist/assets/Settings-DYjRBgpE.css +1 -0
  30. package/client/dist/assets/{SkeletonGrid-QWMGLCGp.js → SkeletonGrid-pA-dcLBM.js} +1 -1
  31. package/client/dist/assets/Trackers-CvO6aWVx.css +1 -0
  32. package/client/dist/assets/Trackers-D68sJf1y.js +2 -0
  33. package/client/dist/assets/{Tv-C6F9655r.js → Tv-DO-WeaMv.js} +1 -1
  34. package/client/dist/assets/{TvInfo-BajXP7JJ.js → TvInfo-CpPIymn8.js} +1 -1
  35. package/client/dist/assets/{TvPopup-DZtX79Ol.js → TvPopup-BwGJ1Tjg.js} +1 -1
  36. package/client/dist/assets/{TvSearch-DcWcxRb1.js → TvSearch-D9SrfJjK.js} +1 -1
  37. package/client/dist/assets/{TvWatchlist-Cf_25dKi.js → TvWatchlist-25tpA8ln.js} +1 -1
  38. package/client/dist/assets/{Watchlist-DBmU8PNR.js → Watchlist-mlZQTcqR.js} +1 -1
  39. package/client/dist/assets/{hls-Bi-DS5KL.js → hls-qvAoYTJt.js} +1 -1
  40. package/client/dist/assets/index-DlcgJVM6.js +178 -0
  41. package/client/dist/assets/{index-B7katXv0.css → index-ZssheiHa.css} +1 -1
  42. package/client/dist/assets/{libraryInvalidation-DI-v-DQ1.js → libraryInvalidation-DdnIPcOQ.js} +1 -1
  43. package/client/dist/assets/{useAnimeInfoData-DpUA78Mv.js → useAnimeInfoData-tcGkDs2b.js} +1 -1
  44. package/client/dist/assets/{useAsmr-BwyYDnlP.js → useAsmr-B-FYJW2L.js} +1 -1
  45. package/client/dist/assets/{useAsmrPopup-BrrEaBlV.js → useAsmrPopup-Ct9jC6X6.js} +1 -1
  46. package/client/dist/assets/{useMangaLibrary-BAUaug-u.js → useMangaLibrary-BacTdrw2.js} +1 -1
  47. package/client/dist/assets/{useMangaPopup-3Lx5tEub.js → useMangaPopup-B_wRaMyP.js} +1 -1
  48. package/client/dist/assets/usePlaybackEnd-DLFOYx3Q.css +1 -0
  49. package/client/dist/assets/{usePlaybackEnd-CuDnNZ8o.js → usePlaybackEnd-DuEfjKb8.js} +2 -2
  50. package/client/dist/assets/{useProviders-CKqOSX5-.js → useProviders-D0XOHCsj.js} +1 -1
  51. package/client/dist/assets/{useTv-CZB47zUF.js → useTv-IidbSQU4.js} +1 -1
  52. package/client/dist/assets/{useTvLibrary-BGz7Unv_.js → useTvLibrary-DiCSdUOj.js} +1 -1
  53. package/client/dist/index.html +2 -2
  54. package/package.json +2 -2
  55. package/server/dist/server.js +251 -246
  56. package/server/dist/shipped-defaults.js +1 -1
  57. package/server/package.json +1 -1
  58. package/client/dist/assets/Asmr-Dl1EZqaI.css +0 -1
  59. package/client/dist/assets/MediaCard-hWGCEHWx.js +0 -1
  60. package/client/dist/assets/Player-2YKevlG4.js +0 -56
  61. package/client/dist/assets/Settings-BEHII_8K.css +0 -1
  62. package/client/dist/assets/Settings-C-QEEujv.js +0 -21
  63. package/client/dist/assets/Trackers-1i4Hd5D3.js +0 -2
  64. package/client/dist/assets/Trackers-D5XBOCDp.css +0 -1
  65. package/client/dist/assets/index-DB81Su4I.js +0 -178
  66. package/client/dist/assets/usePlaybackEnd-BtUHM1mW.css +0 -1
@@ -1,2 +0,0 @@
1
- import{d as t,h as Ke,g as De,A as Fe,q as $e,u as e,S as m}from"./vendor-core-DfaOB3Rn.js";import{u as Oe,b as Re,a as x}from"./vendor-query-BBT5_sHx.js";import{A as i,q as r,t as h,Z as tn,k as sn,H as Ue,B as ce}from"./index-DB81Su4I.js";import{I as c}from"./vendor-icons-DrybRNxP.js";function rn(){const O=Oe(),[Z,v]=t(!1);return Ke(()=>{const s=new URLSearchParams(window.location.search),_=s.get("anilist");if(_){const p=s.get("user"),f=s.get("reason");window.history.replaceState(null,"",window.location.pathname),_==="success"?(i.success(p?`Connected to AniList as ${decodeURIComponent(p)}`:"Connected to AniList"),O.invalidateQueries({queryKey:[r.trackerStatus]})):i.error(f?decodeURIComponent(f):"AniList authentication failed");return}const P=new URLSearchParams(window.location.hash.substring(1)),b=P.get("access_token"),L=s.get("code");if(!b&&!L){const p=P.get("error");p&&(i.error(`AniList error: ${p}`),window.history.replaceState(null,"",window.location.pathname));return}const y=window.location.origin+window.location.pathname;window.history.replaceState(null,"",window.location.pathname),v(!0),i("Connecting to AniList..."),h.tracker.anilistAuth.mutate(b?{token:b}:{code:L,redirectUri:y}).then(async p=>{const f=p.user;i.success(`Connected to AniList as ${f?.name??"AniList user"}`),O.invalidateQueries({queryKey:[r.trackerStatus]})}).catch(p=>{i.error(p instanceof Error?p.message:"Failed to authenticate with AniList")}).finally(()=>{v(!1)})},[O]),Z}const ln="_header_j1lbh_1",cn="_fadeIn_j1lbh_1",on="_pageTitle_j1lbh_6",dn="_pageSubtitle_j1lbh_14",mn="_importCard_j1lbh_20",pn="_slideUpIn_j1lbh_1",un="_cardHeader_j1lbh_37",hn="_uploadArea_j1lbh_55",gn="_fileInputWrapper_j1lbh_59",yn="_fileInput_j1lbh_59",bn="_fileDisplay_j1lbh_87",_n="_fileIcon_j1lbh_95",fn="_fileName_j1lbh_100",Nn="_browseButton_j1lbh_109",kn="_optionsArea_j1lbh_120",vn="_checkboxLabel_j1lbh_128",wn="_checkbox_j1lbh_128",In="_checkboxCustom_j1lbh_141",xn="_optionText_j1lbh_169",Ln="_optionTitle_j1lbh_175",Cn="_optionDesc_j1lbh_181",Mn="_actions_j1lbh_187",Sn="_importBtn_j1lbh_195",Tn="_cancelBtn_j1lbh_201",An="_statusMessage_j1lbh_215",jn="_success_j1lbh_225",Pn="_error_j1lbh_231",En="_progressSection_j1lbh_237",Bn="_progressBar_j1lbh_242",Dn="_progressFill_j1lbh_250",Fn="_progressInfo_j1lbh_257",$n="_progressCount_j1lbh_264",Rn="_progressTitle_j1lbh_271",Un="_sourceBadge_j1lbh_289",qn="_anilist_j1lbh_301",Kn="_kitsu_j1lbh_307",On="_offline_j1lbh_313",Qn="_skipped_j1lbh_319",Gn="_cardTitleRow_j1lbh_324",Hn="_anilistIcon_j1lbh_334",Wn="_malIcon_j1lbh_340",Xn="_badgeOnline_j1lbh_346",zn="_badgeOffline_j1lbh_358",Jn="_connectedProfile_j1lbh_370",Yn="_avatar_j1lbh_379",Zn="_connectedInfo_j1lbh_386",Vn="_connectedName_j1lbh_394",ea="_connectedHint_j1lbh_400",na="_loginPrompt_j1lbh_405",aa="_loginSection_j1lbh_413",ta="_fieldLabel_j1lbh_419",sa="_helpText_j1lbh_438",ia="_loginText_j1lbh_455",ra="_primaryBtn_j1lbh_464",la="_secondaryBtn_j1lbh_465",ca="_syncBtn_j1lbh_466",oa="_divider_j1lbh_518",da="_actionSection_j1lbh_524",ma="_inputGroup_j1lbh_538",pa="_input_j1lbh_538",ua="_syncSummary_j1lbh_559",ha="_syncErrors_j1lbh_565",ga="_spin_j1lbh_569",ya="_radioGroup_j1lbh_598",ba="_radioLabel_j1lbh_604",_a="_syncHint_j1lbh_642",fa="_importLoading_j1lbh_649",n={header:ln,fadeIn:cn,pageTitle:on,pageSubtitle:dn,importCard:mn,slideUpIn:pn,cardHeader:un,uploadArea:hn,fileInputWrapper:gn,fileInput:yn,fileDisplay:bn,fileIcon:_n,fileName:fn,browseButton:Nn,optionsArea:kn,checkboxLabel:vn,checkbox:wn,checkboxCustom:In,optionText:xn,optionTitle:Ln,optionDesc:Cn,actions:Mn,importBtn:Sn,cancelBtn:Tn,statusMessage:An,success:jn,error:Pn,progressSection:En,progressBar:Bn,progressFill:Dn,progressInfo:Fn,progressCount:$n,progressTitle:Rn,sourceBadge:Un,anilist:qn,kitsu:Kn,offline:On,skipped:Qn,cardTitleRow:Gn,anilistIcon:Hn,malIcon:Wn,badgeOnline:Xn,badgeOffline:zn,connectedProfile:Jn,avatar:Yn,connectedInfo:Zn,connectedName:Vn,connectedHint:ea,loginPrompt:na,loginSection:aa,fieldLabel:ta,helpText:sa,loginText:ia,primaryBtn:ra,secondaryBtn:la,syncBtn:ca,divider:oa,actionSection:da,inputGroup:ma,input:pa,syncSummary:ua,syncErrors:ha,spin:ga,radioGroup:ya,radioLabel:ba,syncHint:_a,importLoading:fa},oe="tracker_anilist_client_id",qe="49887".trim(),Ia=()=>{const{setIsOpen:O}=tn(),{contentType:Z}=sn(),v=Z==="manga",s=Oe();De.useEffect(()=>{document.title="Trackers - dango"},[]);const[_,P]=t(""),[b,L]=t("username"),[y,p]=t(null),[f,de]=t(""),[C,me]=t(!1),Qe=rn(),{data:pe,isLoading:ue}=Re({queryKey:[r.trackerStatus],queryFn:async()=>await h.tracker.status.query()}),{data:M}=Re({queryKey:[r.anilistClientId],queryFn:async()=>(await h.settings.getByKey.query({key:oe})).value||""}),he=Fe(!1);De.useEffect(()=>{he.current||M!==void 0&&(M&&de(M),he.current=!0)},[M]);const w=pe?.anilist?.connected??!1;Ke(()=>{w&&L("sync")},[w]);const Q=pe?.anilist?.user??null,V=!!qe,Ge=(M||"").trim(),He=async()=>{const a=f.trim(),l=a||qe;if(!l){i.error("Enter your AniList client ID first");return}const k=async(j,ie)=>{await h.settings.set.mutate({key:j,value:ie})};try{a?a!==M&&await k(oe,a):V&&Ge&&await k(oe,""),s.invalidateQueries({queryKey:[r.anilistClientId]})}catch(j){i.error(j.message);return}const o=window.location.origin+window.location.pathname,U=encodeURIComponent(o);window.location.href=`https://anilist.co/api/v2/oauth/authorize?client_id=${encodeURIComponent(l)}&response_type=token&state=${U}`},ge=x({mutationFn:async()=>h.tracker.anilistDisconnect.mutate(),onSuccess:()=>{s.invalidateQueries({queryKey:[r.trackerStatus]}),i.success("Disconnected from AniList")},onError:a=>i.error(a.message)}),G=x({mutationFn:async()=>(await h.tracker.sync.mutate({provider:"anilist"})).summary,onSuccess:a=>{s.invalidateQueries({queryKey:[r.watchlist]}),s.invalidateQueries({queryKey:[r.continueWatching]}),p(a),i.success(`Sync complete - pushed ${a.pushed}, pulled ${a.pulled}, merged ${a.merged}, unchanged ${a.unchanged}`,{duration:6e3})},onError:a=>i.error(a.message)}),[E,ye]=t(""),[H,be]=t("sync"),[ee,_e]=t("two-way"),[d,We]=t(null),W=x({mutationFn:async()=>(await h.tracker.mangaSync.mutate({direction:ee})).summary,onSuccess:a=>{s.invalidateQueries({queryKey:[r.mangaLibrary]}),s.invalidateQueries({queryKey:[r.mangaContinueReading]}),We(a);const l=(a.warnings?.length??0)>0?`, ${a.warnings.length} warning(s)`:"";i.success(`Manga sync complete - pushed ${a.pushed}, pulled ${a.pulled}, merged ${a.merged}, unchanged ${a.unchanged}${l}`,{duration:6e3})},onError:a=>i.error(a.message)}),S=x({mutationFn:async()=>{if(!E.trim())throw new Error("Please enter a username");return(await h.tracker.mangaImport.mutate({username:E.trim(),erase:C})).count},onSuccess:a=>{s.invalidateQueries({queryKey:[r.mangaLibrary]}),s.invalidateQueries({queryKey:[r.mangaContinueReading]}),i.success(`Imported ${a} manga entries from AniList`),ye("")},onError:a=>i.error(a.message)}),[B,fe]=t(""),[X,Ne]=t("username"),[ne,ke]=t(null),[z,ve]=t(!1),[we,ae]=t(""),[Ie,Xe]=t(""),N=x({mutationFn:async()=>{if(!B.trim())throw new Error("Please enter a MAL username");const a=await h.tracker.mangaMalImport.mutate({username:B.trim(),erase:C});return{imported:a.imported??0,skipped:a.skipped??0}},onSuccess:({imported:a,skipped:l})=>{s.invalidateQueries({queryKey:[r.mangaLibrary]}),s.invalidateQueries({queryKey:[r.mangaContinueReading]}),i.success(`Imported ${a} manga entries from MAL${l>0?`, skipped ${l}`:""}`),fe("")},onError:a=>i.error(a.message)}),ze=$e(async()=>{const a=document.getElementById("malMangaFile");if(!a.files||a.files.length===0){ae("Please select a file first.");return}ve(!0),ae(""),ke(null);try{const l=new FormData;l.append("xmlfile",a.files[0]),l.append("erase",String(C));const k=await Ue("/api/import/mal-xml-manga",{method:"POST",body:l}),o=await k.json().catch(()=>({}));if(!k.ok)throw new Error(o.error||"Import failed");ke({imported:o.imported??0,skipped:o.skipped??0}),s.invalidateQueries({queryKey:[r.mangaLibrary]}),s.invalidateQueries({queryKey:[r.mangaContinueReading]})}catch(l){ae(l.message)}finally{ve(!1)}},[C,s]),T=x({mutationFn:async()=>{if(!_.trim())throw new Error("Please enter a username");return(await h.tracker.anilistImport.mutate({username:_.trim(),erase:I})).count},onSuccess:a=>{s.invalidateQueries({queryKey:[r.watchlist]}),s.invalidateQueries({queryKey:[r.continueWatching]}),i.success(`Imported ${a} anime entries from AniList`),P("")},onError:a=>i.error(a.message)}),[D,xe]=t(""),g=x({mutationFn:async a=>{if(!D.trim())throw new Error("Please enter a MAL username");return(await h.tracker.malImport.mutate({username:D.trim(),erase:a.erase,useOfflineDb:a.useOfflineDb,skipFallback:a.skipFallback})).count},onSuccess:a=>{s.invalidateQueries({queryKey:[r.watchlist]}),s.invalidateQueries({queryKey:[r.continueWatching]}),i.success(`Imported ${a} anime entries from MAL`),xe("")},onError:a=>i.error(a.message)}),[I,Le]=t(!1),[F,Je]=t(!0),[$,Ye]=t(!1),[Ce,Me]=t(""),[A,Se]=t(!1),[u,Te]=t(null),[te,Ae]=t(null),[je,J]=t(""),se=Fe(null),Ze=a=>{a.currentTarget.files&&a.currentTarget.files.length>0?Me(a.currentTarget.files[0].name):Me("")},Ve=$e(async()=>{const a=document.getElementById("malFile");if(!a.files||a.files.length===0){J("Please select a file first.");return}const l=a.files[0];Se(!0),Te(null),Ae(null),J("");const k=new AbortController;se.current=k;try{const o=new FormData;o.append("xmlfile",l),o.append("erase",String(I)),o.append("useOfflineDb",String(F)),o.append("skipFallback",String($));const U=await Ue("/api/import/mal-xml",{method:"POST",body:o,signal:k.signal});if(!U.ok){const le=await U.text();let q="Failed to import";try{q=JSON.parse(le).error||q}catch{}throw new Error(q)}const j=U.body?.getReader();if(!j)throw new Error("No response stream");const ie=new TextDecoder;let re="",Y="";for(;;){const{done:le,value:q}=await j.read();if(le)break;re+=ie.decode(q,{stream:!0});const Ee=re.split(`
2
- `);re=Ee.pop()||"";for(const K of Ee)if(K.startsWith("event: "))Y=K.slice(7).trim();else if(K.startsWith("data: ")){const an=K.slice(6);try{const Be=JSON.parse(an);Y==="progress"?Te(Be):Y==="complete"&&Ae(Be)}catch{}}else K===""&&(Y="")}s.invalidateQueries({queryKey:[r.watchlist]})}catch(o){o instanceof DOMException&&o.name==="AbortError"?J("Import cancelled."):J(o.message)}finally{Se(!1),se.current=null}},[I,F,$,s]),en=()=>{se.current?.abort(),h.settings.malImportCancel.mutate().catch(()=>{})},nn=u?Math.round(u.current/u.total*100):0,[R,Pe]=t("username");return e("div",{className:"page-container",children:[e("div",{className:n.header,children:[e("h1",{className:n.pageTitle,children:"Trackers"}),e("p",{className:n.pageSubtitle,children:"Import & sync your anime watchlists and manga reading lists with tracking services"})]}),e("div",{style:{marginBottom:"16px",padding:"10px 14px",borderRadius:"8px",fontSize:"0.85rem",background:"color-mix(in srgb, var(--color-warning) 8%, transparent)",border:"1px solid color-mix(in srgb, var(--color-warning) 25%, transparent)",color:"var(--text-secondary)"},children:"⚠ Syncing writes directly to your AniList entries, and dango may not always handle anime/manga lists correctly - always keep a backup of your lists before syncing."}),!v&&e(m,{children:e("div",{className:n.importCard,children:[e("div",{className:n.cardHeader,children:e("div",{className:n.cardTitleRow,children:[e(c,{name:"anilist",className:n.anilistIcon}),e("h3",{children:"AniList"}),ue?null:w?e("span",{className:n.badgeOnline,children:"Connected"}):e("span",{className:n.badgeOffline,children:"Not connected"})]})}),w&&Q?e("div",{className:n.connectedProfile,children:[Q.avatar&&e("img",{src:Q.avatar,alt:"Avatar",className:n.avatar,loading:"lazy",decoding:"async"}),e("div",{className:n.connectedInfo,children:[e("span",{className:n.connectedName,children:Q.name}),e("span",{className:n.connectedHint,children:"2-way sync is ready"})]}),e("button",{className:n.secondaryBtn,onClick:()=>ge.mutate(),disabled:ge.isPending,children:[e(c,{name:"sign-out-alt"})," Disconnect"]})]}):e("div",{className:n.loginSection,children:[e("p",{className:n.loginText,children:["Log in with AniList to enable bidirectional progress & status synchronization.",Qe&&e("span",{style:{marginLeft:8,color:"var(--accent)"},children:"Finishing login…"})]}),e("div",{className:n.fieldLabel,children:["AniList client ID - defaults to Dango's app"," ",e("a",{href:"https://anilist.co/settings/developer",target:"_blank",rel:"noopener noreferrer",children:["create your own app ",e(c,{name:"external-link-alt",size:9})]})]}),e("div",{className:n.inputGroup,children:[e("input",{type:"text",placeholder:"Client ID",value:f,onChange:a=>de(a.currentTarget.value),className:n.input}),e("button",{className:n.primaryBtn,onClick:He,disabled:!(f.trim()||V),children:[e(c,{name:"external-link-alt"})," Connect"]})]}),e("p",{className:n.helpText,children:V?e(m,{children:["By default uses Dango's client. To use your own AniList app: create it at"," ",e("a",{href:"https://anilist.co/settings/developer",target:"_blank",rel:"noopener noreferrer",children:"anilist.co/settings/developer"}),", set its ",e("strong",{children:"Redirect URL"})," to"," ",e("code",{children:`${window.location.origin}/api/tracker/anilist/callback`}),", then paste only the ",e("strong",{children:"Client ID"})," above (leave empty to use Dango's)."]}):e(m,{children:["No shipped client in this build - create your own app at"," ",e("a",{href:"https://anilist.co/settings/developer",target:"_blank",rel:"noopener noreferrer",children:"anilist.co/settings/developer"}),", set ",e("strong",{children:"Redirect URL"})," to"," ",e("code",{children:`${window.location.origin}/api/tracker/anilist/callback`}),", then paste the ",e("strong",{children:"Client ID"})," above."]})})]}),w&&e(m,{children:[e("hr",{className:n.divider}),e("div",{className:n.radioGroup,children:[e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"anilistMode",value:"username",checked:b==="username",onChange:()=>L("username")}),e("span",{children:"Quick Import"})]}),e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"anilistMode",value:"sync",checked:b==="sync",onChange:()=>L("sync")}),e("span",{children:"Two-way Sync"})]})]}),b==="username"?e("div",{className:n.inputGroup,children:e("input",{type:"text",placeholder:"Enter AniList username",value:_,onChange:a=>P(a.currentTarget.value),className:n.input,disabled:T.isPending,onKeyDown:a=>{a.key==="Enter"&&_.trim()&&T.mutate()}})}):e("p",{className:n.syncHint,children:"Merges progress non-destructively: pushes shows and episodes you watched on dango to AniList, and pulls anything you updated on AniList into dango."}),b==="username"&&e("div",{className:n.optionsArea,children:e("label",{className:n.checkboxLabel,children:[e("input",{type:"checkbox",checked:I,onChange:a=>Le(a.currentTarget.checked),className:n.checkbox,disabled:T.isPending}),e("span",{className:n.checkboxCustom}),e("div",{className:n.optionText,children:[e("span",{className:n.optionTitle,children:"Erase current watchlist"}),e("span",{className:n.optionDesc,children:"Delete existing watchlist before importing."})]})]})}),b==="username"?e("button",{className:n.syncBtn,onClick:()=>T.mutate(),disabled:!_.trim()||T.isPending,children:[e(c,{name:"download"}),T.isPending?"Importing...":"Start Import"]}):e(m,{children:[e("button",{className:n.syncBtn,onClick:()=>G.mutate(),disabled:G.isPending,children:[e(c,{name:"sync-alt",className:G.isPending?n.spin:""}),G.isPending?"Syncing...":"Start Sync"]}),y&&e("div",{className:n.syncSummary,children:["Pushed: ",y.pushed," · Pulled: ",y.pulled," · Merged:"," ",y.merged," · Unchanged: ",y.unchanged,y.errors.length>0&&e("span",{className:n.syncErrors,children:[" ","· ",y.errors.length," error",y.errors.length>1?"s":""]})]})]}),e("p",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)",marginTop:"8px"},children:["AniList ",e("code",{children:"Rewatching (REPEATING)"})," is not tracked - entries with this status are ignored."]})]})]})}),v&&e(m,{children:e("div",{className:n.importCard,children:[e("div",{className:n.cardHeader,children:e("div",{className:n.cardTitleRow,children:[e(c,{name:"anilist",className:n.anilistIcon}),e("h3",{children:"AniList Manga"}),ue?null:w?e("span",{className:n.badgeOnline,children:"Connected"}):e("span",{className:n.badgeOffline,children:"Not connected"})]})}),w?e(m,{children:[e("div",{className:n.radioGroup,children:[e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"mangaMode",value:"username",checked:H==="username",onChange:()=>be("username")}),e("span",{children:"Quick Import"})]}),e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"mangaMode",value:"sync",checked:H==="sync",onChange:()=>be("sync")}),e("span",{children:"Two-way Sync"})]})]}),H==="username"?e(m,{children:[e("div",{className:n.inputGroup,children:e("input",{type:"text",placeholder:"Enter AniList username",value:E,onChange:a=>ye(a.currentTarget.value),className:n.input,disabled:S.isPending,onKeyDown:a=>{a.key==="Enter"&&E.trim()&&S.mutate()}})}),e("div",{className:n.optionsArea,children:e("label",{className:n.checkboxLabel,children:[e("input",{type:"checkbox",checked:C,onChange:a=>me(a.currentTarget.checked),className:n.checkbox,disabled:S.isPending}),e("span",{className:n.checkboxCustom}),e("div",{className:n.optionText,children:[e("span",{className:n.optionTitle,children:"Replace AniList-linked manga"}),e("span",{className:n.optionDesc,children:"Clears previously imported (anilist:) entries before importing. Your provider bookmarks are never touched."})]})]})})]}):e(m,{children:[e("p",{className:n.syncHint,children:"Merges chapter progress non-destructively: pushes manga and chapters you read on dango to AniList, and pulls anything you updated on AniList into dango. Local titles are linked only on exact title matches, and bookmarks with no chapters read are never pushed."}),e("div",{className:n.radioGroup,children:[e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"mangaDirection",value:"two-way",checked:ee==="two-way",onChange:()=>_e("two-way")}),e("span",{children:"Two-way"})]}),e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"mangaDirection",value:"pull-only",checked:ee==="pull-only",onChange:()=>_e("pull-only")}),e("span",{children:"Pull only (never writes to AniList)"})]})]})]}),H==="username"?e("button",{className:n.syncBtn,onClick:()=>S.mutate(),disabled:!E.trim()||S.isPending,children:[e(c,{name:"download"}),S.isPending?"Importing...":"Start Import"]}):e(m,{children:[e("button",{className:n.syncBtn,onClick:()=>W.mutate(),disabled:W.isPending,children:[e(c,{name:"sync-alt",className:W.isPending?n.spin:""}),W.isPending?"Syncing...":"Start Manga Sync"]}),d&&e(m,{children:[e("div",{className:n.syncSummary,children:["Pushed: ",d.pushed," · Pulled: ",d.pulled," · Merged: ",d.merged," · Unchanged:"," ",d.unchanged,(d.skipped??0)>0&&e("span",{children:[" · Skipped: ",d.skipped]}),d.errors.length>0&&e("span",{className:n.syncErrors,children:[" ","· ",d.errors.length," error",d.errors.length>1?"s":""]})]}),(d.warnings?.length??0)>0&&e("div",{className:n.syncErrors,style:{marginTop:"8px"},children:[(d.warnings??[]).slice(0,5).map((a,l)=>e("div",{children:["⚠ ",a]},l)),(d.warnings?.length??0)>5&&e("div",{children:["+",(d.warnings?.length??0)-5," more warning(s)"]})]})]})]}),e("p",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)",marginTop:"8px"},children:["AniList ",e("code",{children:"Rereading (REPEATING)"})," is not tracked - entries with this status are ignored."]})]}):e("p",{className:n.loginText,children:"Connect your AniList account above to sync your manga reading list."})]})}),!v&&e(m,{children:e("div",{className:n.importCard,children:[e("div",{className:n.cardHeader,children:e("div",{className:n.cardTitleRow,children:[e(c,{name:"myanimelist",className:n.malIcon}),e("h3",{children:"MyAnimeList"})]})}),e("div",{className:n.radioGroup,children:[e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"malMode",value:"username",checked:R==="username",onChange:()=>Pe("username")}),e("span",{children:"Username"})]}),e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"malMode",value:"xml",checked:R==="xml",onChange:()=>Pe("xml")}),e("span",{children:"XML File"})]})]}),R==="username"?e(m,{children:[e("div",{className:n.inputGroup,children:e("input",{type:"text",placeholder:"Enter MAL username",value:D,onChange:a=>xe(a.currentTarget.value),className:n.input,disabled:g.isPending,onKeyDown:a=>{a.key==="Enter"&&D.trim()&&g.mutate({erase:I,useOfflineDb:F,skipFallback:$})}})}),g.isPending&&e("div",{className:n.importLoading,children:[e(c,{name:"sync-alt",className:n.spin}),e("span",{children:"Importing from MAL..."})]})]}):e("div",{className:n.uploadArea,children:e("div",{className:n.fileInputWrapper,children:[e("input",{type:"file",id:"malFile",accept:".xml,application/xml",className:n.fileInput,onChange:Ze,disabled:A}),e("div",{className:n.fileDisplay,children:[e(c,{name:"file-alt",className:n.fileIcon}),e("span",{className:n.fileName,children:Ce||"Choose XML file..."})]}),e("label",{htmlFor:"malFile",className:n.browseButton,children:"Browse"})]})}),e("div",{className:n.optionsArea,children:[e("label",{className:n.checkboxLabel,children:[e("input",{type:"checkbox",checked:I,onChange:a=>Le(a.currentTarget.checked),className:n.checkbox,disabled:A||g.isPending}),e("span",{className:n.checkboxCustom}),e("div",{className:n.optionText,children:[e("span",{className:n.optionTitle,children:"Erase current watchlist"}),e("span",{className:n.optionDesc,children:"Delete existing watchlist before importing."})]})]}),e("label",{className:n.checkboxLabel,children:[e("input",{type:"checkbox",checked:F,onChange:a=>Je(a.currentTarget.checked),className:n.checkbox,disabled:A||g.isPending}),e("span",{className:n.checkboxCustom}),e("div",{className:n.optionText,children:[e("span",{className:n.optionTitle,children:"Use offline database (fast)"}),e("span",{className:n.optionDesc,children:"Match by MAL ID locally first - instant and avoids AniList rate limits."})]})]}),e("label",{className:n.checkboxLabel,children:[e("input",{type:"checkbox",checked:$,onChange:a=>Ye(a.currentTarget.checked),className:n.checkbox,disabled:A||g.isPending}),e("span",{className:n.checkboxCustom}),e("div",{className:n.optionText,children:[e("span",{className:n.optionTitle,children:"Skip online fallback"}),e("span",{className:n.optionDesc,children:"Only import offline matches. Unmatched titles are skipped without API calls."})]})]})]}),R==="username"?e("button",{className:n.syncBtn,onClick:()=>g.mutate({erase:I,useOfflineDb:F,skipFallback:$}),disabled:!D.trim()||g.isPending,children:[e(c,{name:"download"}),g.isPending?"Importing...":"Start Import"]}):e("div",{className:n.actions,children:A?e(ce,{onClick:en,className:n.cancelBtn,children:"Cancel Import"}):e(ce,{onClick:Ve,className:n.importBtn,disabled:!Ce,children:[e(c,{name:"upload"})," Start Import"]})}),R==="username"&&g.isError&&e("div",{className:`${n.statusMessage} ${n.error}`,children:g.error.message}),A&&u&&e("div",{className:n.progressSection,children:[e("div",{className:n.progressBar,children:e("div",{className:n.progressFill,style:{width:`${nn}%`}})}),e("div",{className:n.progressInfo,children:[e("span",{className:n.progressCount,children:[u.current," / ",u.total]}),e("span",{className:n.progressTitle,children:u.found?e(m,{children:[u.matchedTitle,e("span",{className:`${n.sourceBadge} ${n[u.source||"anilist"]}`,children:u.source==="kitsu"?"Kitsu":u.source==="offline"?"Offline DB":"AniList"})]}):e("span",{className:n.skipped,children:["Skipped: ",u.title]})})]})]}),te&&e("div",{className:`${n.statusMessage} ${n.success}`,children:["Import complete! Imported: ",te.imported,", Skipped: ",te.skipped,"."]}),je&&e("div",{className:`${n.statusMessage} ${n.error}`,children:je})]})}),v&&e("div",{className:n.importCard,children:[e("div",{className:n.cardHeader,children:e("div",{className:n.cardTitleRow,children:[e(c,{name:"myanimelist",className:n.malIcon}),e("h3",{children:"MyAnimeList Manga"})]})}),e("div",{className:n.radioGroup,children:[e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"malMangaMode",value:"username",checked:X==="username",onChange:()=>Ne("username")}),e("span",{children:"Username"})]}),e("label",{className:n.radioLabel,children:[e("input",{type:"radio",name:"malMangaMode",value:"xml",checked:X==="xml",onChange:()=>Ne("xml")}),e("span",{children:"XML File"})]})]}),X==="username"?e("div",{className:n.inputGroup,children:e("input",{type:"text",placeholder:"Enter MAL username",value:B,onChange:a=>fe(a.currentTarget.value),className:n.input,disabled:N.isPending,onKeyDown:a=>{a.key==="Enter"&&B.trim()&&N.mutate()}})}):e("div",{className:n.uploadArea,children:e("div",{className:n.fileInputWrapper,children:[e("input",{type:"file",id:"malMangaFile",accept:".xml,application/xml",className:n.fileInput,onChange:a=>Xe(a.currentTarget.files?.[0]?.name??""),disabled:z}),e("div",{className:n.fileDisplay,children:[e(c,{name:"file-alt",className:n.fileIcon}),e("span",{className:n.fileName,children:Ie||"Choose XML file..."})]}),e("label",{htmlFor:"malMangaFile",className:n.browseButton,children:"Browse"})]})}),e("div",{className:n.optionsArea,children:e("label",{className:n.checkboxLabel,children:[e("input",{type:"checkbox",checked:C,onChange:a=>me(a.currentTarget.checked),className:n.checkbox,disabled:N.isPending||z}),e("span",{className:n.checkboxCustom}),e("div",{className:n.optionText,children:[e("span",{className:n.optionTitle,children:"Replace AniList-linked manga"}),e("span",{className:n.optionDesc,children:"Clears previously imported (anilist:) entries before importing. Your provider bookmarks are never touched."})]})]})}),X==="username"?e("button",{className:n.syncBtn,onClick:()=>N.mutate(),disabled:!B.trim()||N.isPending,children:[e(c,{name:"download"}),N.isPending?"Importing...":"Start Import"]}):e("div",{className:n.actions,children:e(ce,{onClick:ze,className:n.importBtn,disabled:z||!Ie,children:[e(c,{name:"upload"})," ",z?"Importing...":"Start Import"]})}),N.isError&&e("div",{className:`${n.statusMessage} ${n.error}`,children:N.error.message}),we&&e("div",{className:`${n.statusMessage} ${n.error}`,children:we}),ne&&e("div",{className:`${n.statusMessage} ${n.success}`,children:["Import complete! Imported: ",ne.imported,", Skipped:"," ",ne.skipped,"."]}),e("p",{style:{fontSize:"0.75rem",color:"var(--text-tertiary)",marginTop:"8px"},children:"MAL manga is matched to AniList by MAL ID with a title fallback. Unmatched titles are skipped. Imports land as AniList-linked entries alongside your provider bookmarks."})]})]})};export{Ia as default};
@@ -1 +0,0 @@
1
- ._header_j1lbh_1{margin-bottom:var(--space-8);animation:_fadeIn_j1lbh_1 .8s var(--ease-smooth)}._pageTitle_j1lbh_6{font-size:var(--font-size-xl);font-weight:800;color:var(--text-primary);margin:0 0 var(--space-2);letter-spacing:-.02em}._pageSubtitle_j1lbh_14{color:var(--text-tertiary);font-size:var(--font-size-sm);margin:0}._importCard_j1lbh_20{background:var(--glass-bg);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);border:1px solid var(--glass-border);padding:var(--space-8);border-radius:var(--radius-xl);box-shadow:var(--glass-shadow);max-width:600px;margin:0 auto;animation:_slideUpIn_j1lbh_1 .8s var(--ease-smooth)}._importCard_j1lbh_20+._importCard_j1lbh_20{margin-top:var(--space-6)}._cardHeader_j1lbh_37{margin-bottom:var(--space-6)}._cardHeader_j1lbh_37 h3{margin:0 0 var(--space-2);font-size:var(--font-size-lg);font-weight:700;color:var(--text-primary)}._cardHeader_j1lbh_37 p{color:var(--text-secondary);font-size:var(--font-size-sm);margin:0;line-height:1.6}._uploadArea_j1lbh_55{margin-bottom:var(--space-6)}._fileInputWrapper_j1lbh_59{position:relative;display:flex;align-items:center;gap:var(--space-4);background:var(--bg-tertiary);border:1px dashed var(--border-secondary);border-radius:var(--radius-lg);padding:var(--space-4);transition:all var(--transition-fast)}._fileInputWrapper_j1lbh_59:hover{border-color:var(--accent);background:var(--bg-elevated)}._fileInput_j1lbh_59{position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer;z-index:2}._fileDisplay_j1lbh_87{flex:1;display:flex;align-items:center;gap:var(--space-3);overflow:hidden}._fileIcon_j1lbh_95{color:var(--text-tertiary);font-size:1.5rem}._fileName_j1lbh_100{color:var(--text-primary);font-size:var(--font-size-sm);font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._browseButton_j1lbh_109{background:#ffffff0d;border:1px solid var(--border-primary);color:var(--text-secondary);padding:var(--space-2) var(--space-4);border-radius:var(--radius-md);font-size:var(--font-size-sm);font-weight:600;pointer-events:none}._optionsArea_j1lbh_120{margin-bottom:var(--space-6);padding:var(--space-4);background:color-mix(in srgb,var(--color-warning) 5%,transparent);border:1px solid color-mix(in srgb,var(--color-warning) 10%,transparent);border-radius:var(--radius-lg)}._checkboxLabel_j1lbh_128{display:flex;align-items:flex-start;gap:var(--space-3);cursor:pointer;position:relative}._checkbox_j1lbh_128{opacity:0;position:absolute}._checkboxCustom_j1lbh_141{width:20px;height:20px;border:2px solid var(--border-secondary);border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0;margin-top:2px;transition:all var(--transition-fast)}._checkbox_j1lbh_128:checked+._checkboxCustom_j1lbh_141{background:var(--color-warning);border-color:var(--color-warning)}._checkbox_j1lbh_128:checked+._checkboxCustom_j1lbh_141:after{content:"";width:5px;height:10px;border:solid var(--color-warning-text);border-width:0 2px 2px 0;transform:rotate(45deg);margin-bottom:2px}._optionText_j1lbh_169{display:flex;flex-direction:column;gap:4px}._optionTitle_j1lbh_175{color:var(--color-warning);font-weight:600;font-size:var(--font-size-sm)}._optionDesc_j1lbh_181{color:var(--text-tertiary);font-size:.8rem;line-height:1.4}._actions_j1lbh_187{display:flex;justify-content:flex-end;gap:var(--space-3);border-top:1px solid var(--border-primary);padding-top:var(--space-6)}._importBtn_j1lbh_195{display:flex;align-items:center;gap:var(--space-2)}._cancelBtn_j1lbh_201{display:flex;align-items:center;gap:var(--space-2);background:color-mix(in srgb,var(--color-danger) 15%,transparent);border-color:color-mix(in srgb,var(--color-danger) 30%,transparent);color:var(--color-danger)}._cancelBtn_j1lbh_201:hover{background:color-mix(in srgb,var(--color-danger) 25%,transparent);border-color:color-mix(in srgb,var(--color-danger) 50%,transparent)}._statusMessage_j1lbh_215{margin-top:var(--space-6);padding:var(--space-4);border-radius:var(--radius-md);font-size:var(--font-size-sm);font-weight:500;text-align:center;animation:_fadeIn_j1lbh_1 .3s ease}._statusMessage_j1lbh_215._success_j1lbh_225{background:color-mix(in srgb,var(--color-success) 10%,transparent);color:var(--color-success);border:1px solid color-mix(in srgb,var(--color-success) 20%,transparent)}._statusMessage_j1lbh_215._error_j1lbh_231{background:color-mix(in srgb,var(--color-danger) 10%,transparent);color:var(--color-danger);border:1px solid color-mix(in srgb,var(--color-danger) 20%,transparent)}._progressSection_j1lbh_237{margin-top:var(--space-6);animation:_fadeIn_j1lbh_1 .3s ease}._progressBar_j1lbh_242{height:6px;background:var(--bg-tertiary);border-radius:3px;overflow:hidden;margin-bottom:var(--space-3)}._progressFill_j1lbh_250{height:100%;background:linear-gradient(90deg,#6366f1,#8b5cf6);border-radius:3px;transition:width .3s ease}._progressInfo_j1lbh_257{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3)}._progressCount_j1lbh_264{font-size:var(--font-size-sm);color:var(--text-tertiary);font-weight:500;white-space:nowrap}._progressTitle_j1lbh_271{display:flex;align-items:center;gap:var(--space-2);font-size:var(--font-size-sm);color:var(--text-primary);font-weight:500;text-align:right;overflow:hidden}._progressTitle_j1lbh_271>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:300px}._sourceBadge_j1lbh_289{display:inline-flex;align-items:center;padding:2px 8px;border-radius:10px;font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;flex-shrink:0}._sourceBadge_j1lbh_289._anilist_j1lbh_301{background:#6366f126;color:#818cf8;border:1px solid rgba(99,102,241,.3)}._sourceBadge_j1lbh_289._kitsu_j1lbh_307{background:#ec489926;color:#f472b6;border:1px solid rgba(236,72,153,.3)}._sourceBadge_j1lbh_289._offline_j1lbh_313{background:#22c55e26;color:#4ade80;border:1px solid rgba(34,197,94,.3)}._skipped_j1lbh_319{color:var(--text-tertiary);font-style:italic}._cardTitleRow_j1lbh_324{display:flex;align-items:center;gap:var(--space-3)}._cardTitleRow_j1lbh_324 h3{margin:0}._anilistIcon_j1lbh_334{font-size:1.5rem;color:#818cf8;flex-shrink:0}._malIcon_j1lbh_340{font-size:1.5rem;color:#2e51a2;flex-shrink:0}._badgeOnline_j1lbh_346{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;padding:3px 10px;border-radius:var(--radius-full);background:color-mix(in srgb,var(--color-success) 12%,transparent);color:var(--color-success);border:1px solid color-mix(in srgb,var(--color-success) 25%,transparent)}._badgeOffline_j1lbh_358{font-size:.7rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;padding:3px 10px;border-radius:var(--radius-full);background:var(--bg-tertiary);color:var(--text-tertiary);border:1px solid var(--border-primary)}._connectedProfile_j1lbh_370{display:flex;align-items:center;gap:var(--space-4);padding:var(--space-4);background:var(--bg-tertiary);border-radius:var(--radius-lg)}._avatar_j1lbh_379{width:48px;height:48px;border-radius:50%;flex-shrink:0}._connectedInfo_j1lbh_386{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}._connectedName_j1lbh_394{color:var(--text-primary);font-weight:700;font-size:var(--font-size-sm)}._connectedHint_j1lbh_400{color:var(--color-success);font-size:.8rem}._loginPrompt_j1lbh_405{display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}._loginSection_j1lbh_413{display:flex;flex-direction:column;gap:var(--space-3)}._fieldLabel_j1lbh_419{font-size:var(--font-size-sm);font-weight:600;color:var(--text-primary)}._fieldLabel_j1lbh_419 a{color:var(--accent);text-decoration:none;display:inline-flex;align-items:center;gap:4px;margin-left:6px}._fieldLabel_j1lbh_419 a:hover{text-decoration:underline}._helpText_j1lbh_438{margin:0;font-size:.8rem;color:var(--text-tertiary);line-height:1.6}._helpText_j1lbh_438 code{background:var(--bg-tertiary);border:1px solid var(--border-primary);border-radius:4px;padding:1px 6px;font-size:.75rem;color:var(--text-secondary);word-break:break-all}._loginText_j1lbh_455{color:var(--text-secondary);font-size:var(--font-size-sm);margin:0;line-height:1.6;flex:1;min-width:220px}._primaryBtn_j1lbh_464,._secondaryBtn_j1lbh_465,._syncBtn_j1lbh_466{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-2);padding:var(--space-2-5) var(--space-4);border-radius:var(--radius-md);font-weight:600;font-size:var(--font-size-sm);cursor:pointer;border:1px solid transparent;transition:all var(--transition-fast);flex-shrink:0}._primaryBtn_j1lbh_464{background:var(--accent);color:var(--accent-text)}._primaryBtn_j1lbh_464:hover{filter:brightness(1.1)}._secondaryBtn_j1lbh_465{background:#ffffff0d;border-color:var(--border-primary);color:var(--text-primary)}._secondaryBtn_j1lbh_465:hover:not(:disabled){background:var(--bg-elevated);border-color:var(--border-secondary)}._syncBtn_j1lbh_466{background:linear-gradient(135deg,#6366f1,#8b5cf6);color:#fff;padding:var(--space-3) var(--space-6)}._syncBtn_j1lbh_466:hover:not(:disabled){filter:brightness(1.1)}._primaryBtn_j1lbh_464:disabled,._secondaryBtn_j1lbh_465:disabled,._syncBtn_j1lbh_466:disabled{opacity:.5;cursor:not-allowed}._divider_j1lbh_518{border:0;border-top:1px solid var(--border-primary);margin:var(--space-6) 0}._actionSection_j1lbh_524 h4{margin:0 0 var(--space-1);color:var(--text-primary);font-size:var(--font-size-sm);font-weight:700}._actionSection_j1lbh_524 p{color:var(--text-secondary);font-size:var(--font-size-sm);margin:0 0 var(--space-4);line-height:1.6}._inputGroup_j1lbh_538{display:flex;gap:var(--space-2)}._input_j1lbh_538{flex:1;min-width:0;padding:var(--space-2-5) var(--space-3);border-radius:var(--radius-md);border:1px solid var(--border-primary);background:var(--bg-tertiary);color:var(--text-primary);font-size:var(--font-size-sm)}._input_j1lbh_538:focus{outline:none;border-color:var(--accent)}._syncSummary_j1lbh_559{margin-top:var(--space-3);font-size:.8rem;color:var(--text-tertiary)}._syncErrors_j1lbh_565{color:var(--color-danger)}._spin_j1lbh_569{animation:_spin_j1lbh_569 1s linear infinite}@keyframes _spin_j1lbh_569{to{transform:rotate(360deg)}}@keyframes _fadeIn_j1lbh_1{0%{opacity:0}to{opacity:1}}@keyframes _slideUpIn_j1lbh_1{0%{opacity:0;transform:translateY(30px)}to{opacity:1;transform:translateY(0)}}._radioGroup_j1lbh_598{display:flex;gap:var(--space-4);margin-bottom:var(--space-4)}._radioLabel_j1lbh_604{display:flex;align-items:center;gap:var(--space-2);font-size:var(--font-size-sm);color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none}._radioLabel_j1lbh_604 input[type=radio]{appearance:none;-webkit-appearance:none;width:16px;height:16px;border:2px solid var(--border-secondary);border-radius:50%;background:transparent;cursor:pointer;position:relative;flex-shrink:0}._radioLabel_j1lbh_604 input[type=radio]:checked{border-color:var(--accent)}._radioLabel_j1lbh_604 input[type=radio]:checked:after{content:"";position:absolute;top:3px;left:3px;width:6px;height:6px;border-radius:50%;background:var(--accent)}._syncHint_j1lbh_642{color:var(--text-secondary);font-size:var(--font-size-sm);margin:0 0 var(--space-4);line-height:1.6}._importLoading_j1lbh_649{display:flex;align-items:center;gap:var(--space-2);font-size:var(--font-size-sm);color:var(--text-secondary);margin-top:var(--space-3)}@media(max-width:600px){._importCard_j1lbh_20{padding:var(--space-6)}._fileInputWrapper_j1lbh_59{flex-direction:column;align-items:stretch;text-align:center}._fileDisplay_j1lbh_87{flex-direction:column}._browseButton_j1lbh_109{text-align:center}}
@@ -1,178 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Home-BYuAVKgx.js","assets/vendor-core-DfaOB3Rn.js","assets/vendor-query-BBT5_sHx.js","assets/MediaCard-hWGCEHWx.js","assets/vendor-icons-DrybRNxP.js","assets/vendor-ui-3qrARCPr.js","assets/useIsMobile-Dvx1uJ82.js","assets/MatureConsentModal-BnB-RHYQ.js","assets/MatureConsentModal-CqewXc0q.css","assets/MediaCard-B0PJStxp.css","assets/AnimeCard-BVufFeLC.js","assets/useAnimeInfoData-DpUA78Mv.js","assets/QueueOptionsButton-B4Re8F3V.js","assets/QueueOptionsButton-CM15uQn8.css","assets/playbackCompletion-IPHm9fp5.js","assets/SkeletonGrid-QWMGLCGp.js","assets/SkeletonGrid-BisPI38I.css","assets/ErrorMessage-DAxegITP.js","assets/ErrorMessage-CXoRbrLN.css","assets/ResetProgressModal-BuESoxbY.js","assets/QueueRail-Dkx_M6ng.js","assets/QueueRail-Bkh4VZls.css","assets/useMangaPopup-3Lx5tEub.js","assets/useMangaLibrary-BAUaug-u.js","assets/libraryInvalidation-DI-v-DQ1.js","assets/usePopup-DS9jMzp6.js","assets/MangaResetProgressModal-CbMR36Zu.js","assets/useProviders-CKqOSX5-.js","assets/useTv-CZB47zUF.js","assets/TvPopup-DZtX79Ol.js","assets/useTvLibrary-BGz7Unv_.js","assets/AsmrResetProgressModal-cYO4Sr2k.js","assets/useAsmr-BwyYDnlP.js","assets/Home-C5eTe3jP.css","assets/Watchlist-DBmU8PNR.js","assets/LibraryListPage.module-r6k9nyT9.js","assets/LibraryListPage-DmdjNa2U.css","assets/ActiveFilterChips-olGfwxle.js","assets/ActiveFilterChips-QjkplDN2.css","assets/Watchlist-DW7kUORr.css","assets/Settings-C-QEEujv.js","assets/ToggleSwitch-CN_ppEc9.js","assets/ToggleSwitch-BPil0d_k.css","assets/Settings-BEHII_8K.css","assets/Player-2YKevlG4.js","assets/usePlaybackEnd-CuDnNZ8o.js","assets/usePlaybackEnd-BtUHM1mW.css","assets/hls-Bi-DS5KL.js","assets/AnimeMetaDetails-D8WIiO4b.js","assets/AnimeMetaDetails-BwNQnRCd.css","assets/SynopsisText-B3Sa5pRv.js","assets/SynopsisText-CYv2W3yR.css","assets/Player-D-sQfjcx.css","assets/Search-CEErwr88.js","assets/Search.module-C_qwCdHS.js","assets/Search-DCKK3seW.css","assets/Mature-CMvs_-gf.js","assets/Mature-DJmUUtlF.css","assets/Asmr-CP7vVwsh.js","assets/useAsmrPopup-BrrEaBlV.js","assets/page.module-C1MlZzf3.js","assets/page-DRvjODkg.css","assets/Asmr-Dl1EZqaI.css","assets/Manga-COhyMd3K.js","assets/Manga.module-depGEacJ.js","assets/Manga-CqAceKxR.css","assets/MangaInfoPage-LTEvl_nL.js","assets/MangaReadPage-sEwzyBQ7.js","assets/ReadingList-C--ZvTe2.js","assets/LibraryListPage-BnrEDG8j.js","assets/TvSearch-DcWcxRb1.js","assets/TvInfo-BajXP7JJ.js","assets/TvInfo-Bu36xJyO.css","assets/Tv-C6F9655r.js","assets/OptionListMenu-onM2KK2X.js","assets/Tv-D3vXCsSC.css","assets/TvWatchlist-Cf_25dKi.js","assets/ListeningList-kRSLAo3B.js","assets/Trackers-1i4Hd5D3.js","assets/Trackers-D5XBOCDp.css","assets/Insights-Bx01GySp.js","assets/Insights-D0qrep0K.css","assets/AnimeInfoPage-K0ErjilQ.js","assets/PlayerRedirect-fv2tzEUu.js","assets/VirtualKeyboard-DeP7fb3P.js","assets/VirtualKeyboard-BaUll8Yv.css"])))=>i.map(i=>d[i]);
2
- import{N as Un,k as Q,A as W,q as K,h as w,S as z,d as E,X as ce,x as le,T as xe,g as ft,u as o,L as Z,$ as rn,a as Hn,c as yt,e as Vn,f as zn,D as Gn,i as Yn,P as Pt,j as Jn,l as N,m as xt,z as R,n as Zn,B as Xn}from"./vendor-core-DfaOB3Rn.js";import{s as ge,i as er,q as tr,u as U,a as ee,b as G,c as vt,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},Tt={},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 Tt)return;Tt[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,It=/\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(It," ").trim(),h.unshift(h[0][m]=h[0][m]||{})):h[0][d[1]]=d[2].replace(It," ").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",He=(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,gt="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}))}}},Qe=[],ln={toasts:[],pausedAt:void 0,settings:{toastLimit:fr}},oe={},un=(e,t=gt)=>{oe[t]=cn(oe[t]||ln,e),Qe.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=gt)=>t=>{un(t,e)},vr={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},gr=(e={},t=gt)=>{let[n,r]=E(oe[t]||ln),i=W(oe[t]);w(()=>(i.current!==oe[t]&&r(oe[t]),Qe.push([t,r]),()=>{let a=Qe.findIndex(([c])=>c===t);a>-1&&Qe.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?He(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?He(t.error,i):void 0;s?F.error(s,{id:r,...n,...n?.error}):F.dismiss(r)}),e};var _r=1e3,wr=(e,t="default")=>{let{toasts:n,pausedAt:r}=gr(e,t),i=W(new Map).current,s=K((m,h=_r)=>{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=K(Ge(t),[t]),c=K(()=>{a({type:5,time:Date.now()})},[a]),l=K((m,h)=>{a({type:1,toast:{id:m,height:h}})},[a]),u=K(()=>{r&&a({type:6,time:Date.now()})},[r,a]),d=K((m,h)=>{let{reverseOrder:p=!1,gutter:f=8,defaultPosition:T}=h||{},P=n.filter(k=>(k.position||T)===(m.position||T)&&k.height),L=P.findIndex(k=>k.id===m.id),A=P.filter((k,$)=>$<L&&k.visible).length;return P.filter(k=>k.visible).slice(...p?[A+1]:[0,A]).reduce((k,$)=>k+($.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}}},kr=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
- }`,Er=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: ${kr} 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: ${Er} 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
- `,xr=ue`
60
- from {
61
- transform: rotate(0deg);
62
- }
63
- to {
64
- transform: rotate(360deg);
65
- }
66
- `,Tr=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: ${xr} 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
- }`,Or=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
- `,Cr=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
- `,qr=ue`
134
- from {
135
- transform: scale(0.6);
136
- opacity: 0.4;
137
- }
138
- to {
139
- transform: scale(1);
140
- opacity: 1;
141
- }`,Lr=fe("div")`
142
- position: relative;
143
- transform: scale(0.6);
144
- opacity: 0.4;
145
- min-width: 20px;
146
- animation: ${qr} 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"?Q(Lr,null,t):t:n==="blank"?null:Q(Ar,null,Q(Tr,{...r}),n!=="loading"&&Q(Cr,null,n==="error"?Q(Pr,{...r}):Q(Or,{...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)`}},Qr=Un(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Wr(e.position||t||"top-center",e.visible):{opacity:0},s=Q(Rr,{toast:e}),a=Q(Br,{...e.ariaProps},He(e.message,e));return Q(Fr,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):Q(z,null,s,a))});mr(Q);var Kr=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=K(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 Q("div",{ref:s,className:t,style:n},i)},Ur=(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}},Hr=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}=wr(n,s);return Q("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=Ur(m,h);return Q(Kr,{id:d.id,key:d.id,onHeightUpdate:u.updateHeight,className:d.visible?Hr:"",style:p},d.type==="custom"?He(d.message,d):i?i(d):Q(Qr,{toast:d,position:m}))}))},g=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 Nt(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?Nt(Object(n),!0).forEach(function(r){V(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nt(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 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 ao(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 co(e){var t=ao(e,"string");return qe(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 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 Me(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){at(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}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 At=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 At({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new At({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 _o(e,t){return typeof e=="string"?e:pe(e)&&typeof e.message=="string"?e.message:t}var Ve=class Ke 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,Ke.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 Ke(r.error.message,B(B({},n),{},{result:r,cause:n.cause})):new Ke(_o(r,"Unknown error"),B(B({},n),{},{cause:r}))}};function wo(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 ko(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 Eo(...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:wo(e.transformer),methodOverride:e.methodOverride}}function xo(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const To={query:"GET",mutation:"POST",subscription:"PATCH"};function fn(e){return"input"in e?e.transformer.input.serialize(e.input):xo(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=>qo(B(B({},e),{},{contentTypeHeader:"application/json",getUrl:yn,getBody:Io}));var Oo=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const Co=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 Oo};async function Ao(e){var t,n;Co(e.signal);const r=e.getUrl(e),i=e.getBody(e),s=(t=e.methodOverride)!==null&&t!==void 0?t:To[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 ko(e.fetch)(r,{method:s,signal:e.signal,body:i,headers:c})}async function qo(e){const t={},n=await Ao(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const Lt=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Rt(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 T;const L=await Promise.resolve(h);(T=f.resolve)===null||T===void 0||T.call(f,L)}catch(L){var P;(P=f.reject)===null||P===void 0||P.call(f,L)}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:Lt,reject:Lt},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 Lo(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=Eo(...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:Rt(a("query")),mutation:Rt(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 T=po(f.json,r.transformer.output);if(!T.ok){u.error(Ve.from(T.error,{meta:f.meta}));return}u.next({context:f.meta,result:T.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 Qo(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 Ko(e){return Qo(new gn(e))}function Uo(e){return e[bn]}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 Ho(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 Vo(e){var t=Ho(e,"string");return Le(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 jt(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?jt(Object(n),!0).forEach(function(r){zo(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(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 Ue(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Ue(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 Ue=function(r){this.s=r,this.n=r.next},Ue.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 Ue(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 bt(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!==ge&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function _n(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===ge,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(...bt(s,m,{direction:u.direction,pageParam:u.pageParam}))};return Object.assign(er(x(x({},a??{}),{},{queryKey:s,queryFn:c?ge: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=_n({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(...bt([...u,{input:p}],a));return x(x({},a),{},{mutationKey:u,mutationFn:h,onSuccess(...p){var f,T;return m({originalFn:()=>{var L,A,k;return(L=a==null||(A=a.onSuccess)===null||A===void 0?void 0:A.call(a,...p))!==null&&L!==void 0?L:d==null||(k=d.onSuccess)===null||k===void 0?void 0:k.call(d,...p)},queryClient:l,meta:(f=(T=a?.meta)!==null&&T!==void 0?T: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===ge,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(...bt(h,m));return oo(p)?ti(p,a,h):p};return Object.assign(tr(x(x({},s),{},{queryKey:i,queryFn:c?ge: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!==ge,c=l=>t(n.join("."),i===ge?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:Uo(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:()=>_n({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=xe(()=>si({client:s.trpcClient,queryClient:s.queryClient,keyPrefix:s.keyPrefix}),[s.trpcClient,s.queryClient,s.keyPrefix]);return Q(e.Provider,{value:s.trpcClient},Q(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 Ee(e){for(const t of[...lt[e]])try{t()}catch(n){console.error(`auth-bus listener failed (${e}):`,n)}}function wn(e,t){return lt[e].add(t),()=>{lt[e].delete(t)}}const ci=e=>new Promise(t=>setTimeout(t,e)),wt=async(e,t)=>{const n={};(!t?.body||!(t.body instanceof FormData))&&(n["Content-Type"]="application/json");const r=typeof e=="string"?e:e.toString();if(r.startsWith("/")||typeof window<"u"&&r.startsWith(window.location.origin)){const a=localStorage.getItem("animepahe_ua"),c=localStorage.getItem("animepahe_cookie"),l=localStorage.getItem("jasmr_ua"),u=localStorage.getItem("jasmr_cookie");a&&(n["x-animepahe-ua"]=a),c&&(n["x-animepahe-cookie"]=c),l&&(n["x-jasmr-ua"]=l),u&&(n["x-jasmr-cookie"]=u)}let s=await fetch(e,{...t,headers:{...n,...t?.headers}});for(let a=0;s.status===503&&a<8;a++)await ci(Math.min(500*2**a,4e3)),s=await fetch(e,{...t,headers:{...n,...t?.headers}});return s},li=async(e,t)=>{const n=await wt(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"&&Ee("animepahe"),n.status===403&&s==="AUTH_REQUIRED"&&i.provider==="jasmr"&&Ee("jasmr"),n.status===401&&s==="LAN_AUTH_REQUIRED"&&Ee("lan"),new Error(s||`Failed to fetch from ${e}`)}return n.json()};async function ui(e,t){const n=await wt(e,t);if(n.status===401)try{(await n.clone().json())?.error==="LAN_AUTH_REQUIRED"&&Ee("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")&&Ee(s.provider),(i.message==="LAN_AUTH_REQUIRED"||s?.code==="LAN_AUTH_REQUIRED")&&Ee("lan")}}catch{}}const{TRPCProvider:mi,useTRPC:C}=ai(),X=Ko({links:[Lo({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},sl=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 al(e){return e?e.replace(/<[^>]*>?/gm,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").trim():""}function cl(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 kn=ce(void 0),vi=()=>{const e=le(kn);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",notifications:"notifications",settings:"settings",insights:"insights",insightsRecommendations:"insights-recommendations",providers:"providers",syncProfile:"sync-profile"},ll=()=>{const e=C(),t=G({...e.data.spotlight.queryOptions(),staleTime:1e3*60*5,retry:1});return{...t,data:t.data}},ul=(e="TRENDING_DESC",t=10)=>vt({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}),dl=(e="TV",t=12)=>vt({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}),ml=(e,t="TV",n=!0)=>{const r=C();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"],hl=(e,t,n=14)=>{const r=C(),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})},pl=()=>{const e=C();return G(e.queue.list.queryOptions())},bi=()=>{const e=C(),t=U();return ee(e.queue.add.mutationOptions({onSuccess:n=>{n.queued?g.success("Added to queue"):g.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]})},onError:n=>{g.error(`Failed to update queue: ${n.message}`)}}))},fl=()=>{const e=C(),t=U();return ee(e.queue.remove.mutationOptions({onSuccess:()=>{g.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},yl=(e,t=!0)=>G({queryKey:[O.queueRemaining,e],queryFn:()=>X.watchlist.queueRemaining.query({showId:e}),enabled:!!e&&t,staleTime:1e3*60}),vl=()=>{const e=C(),t=U();return ee(e.queue.addBatch.mutationOptions({onSuccess:(n,r)=>{const i=n.added??r.episodeNumbers.length;g.success(`${i} ${i===1?"episode":"episodes"} added to queue`),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]})},onError:n=>{g.error(`Failed to update queue: ${n.message}`)}}))},gl=()=>{const e=C(),t=U();return ee(e.queue.removeMany.mutationOptions({onSuccess:()=>{g.success("Removed from queue"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},bl=()=>{const e=C(),t=U();return ee(e.queue.clear.mutationOptions({onSuccess:()=>{g.success("Queue cleared"),t.invalidateQueries(e.queue.pathFilter()),t.invalidateQueries({queryKey:[O.queueRemaining]}),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{g.error(`Failed to clear queue: ${n.message}`)}}))},_l=()=>{const e=C(),t=U(),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())}}))},_i=["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 _i){const a=r.get(s);a!==null&&(i[s]=a)}return i}const wl=(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))}}),kl=(e="")=>vt({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)})}),El=(e="",t,n=14)=>G({queryKey:[O.continueWatching,e,t,n],queryFn:async()=>await X.watchlist.continueWatchingAll.query(kt(e,t,n))}),Sl=()=>{const e=C(),t=U();return ee(e.watchlist.remove.mutationOptions({onSuccess:()=>{g.success("Removed from watchlist"),t.invalidateQueries(e.watchlist.pathFilter()),t.invalidateQueries({queryKey:[O.watchlist]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},Pl=()=>{const e=C(),t=U();return ee(e.watchlist.batchStatus.mutationOptions({onSuccess:n=>{g.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=>{g.error(`Failed to update statuses: ${n.message}`)}}))},xl=()=>{const e=C(),t=U();return ee(e.watchlist.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;g.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=>{g.error(`Failed to remove: ${n.message}`)}}))},Tl=()=>{const e=C(),t=U();return ee(e.continueWatching.removeMany.mutationOptions({onSuccess:n=>{const r=n.removed??0;g.success(`Removed ${r} ${r===1?"item":"items"} from continue watching`),t.invalidateQueries(e.continueWatching.pathFilter()),t.invalidateQueries({queryKey:[O.continueWatching]})},onError:n=>{g.error(`Failed to remove: ${n.message}`)}}))},En=(e=!0)=>{const t=C();return G({...t.notifications.list.queryOptions(),enabled:e,refetchInterval:3e4})},Sn=(e=!0)=>{const t=C();return G({...t.data.systemNotifications.queryOptions(),enabled:e,refetchInterval:3e4})},Pn=(e=!0)=>{const t=C();return G({...t.discovery.status.queryOptions(),enabled:e,refetchInterval:n=>n.state.data?.running?2e3:!1})},wi=()=>{const e=C(),t=U(),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})}}))},ki=()=>{const e=C(),t=U();return ee(e.notifications.dismiss.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Ei=()=>{const e=C(),t=U();return ee(e.notifications.clearAll.mutationOptions({onSuccess:()=>{t.invalidateQueries(e.notifications.pathFilter())}}))},Il=()=>{const e=C();return G({...e.continueWatching.thisWeek.queryOptions(),staleTime:1e3*60*5})},Nl=()=>{const e=C();return G({...e.data.genresAndTags.queryOptions(),staleTime:1e3*60*60})},Ol=()=>G({queryKey:[O.genreCards],queryFn:()=>X.insights.genreCards.query()}),Si="_container_vk8jv_1",Pi="_bellBtn_vk8jv_7",xi="_badge_vk8jv_56",Ti="_dropdown_vk8jv_96",Ii="_dropdownHeader_vk8jv_127",Ni="_clearAllBtn_vk8jv_141",Oi="_discoveryStatusRow_vk8jv_159",Ci="_statusDot_vk8jv_170",Ai="_statusDotRunning_vk8jv_177",qi="_statusDotOk_vk8jv_182",Li="_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",Qi="_systemItemMeta_vk8jv_272",Ki="_removeItem_vk8jv_289",Ui="_queueItem_vk8jv_319",Hi="_emptyState_vk8jv_323",Vi="_notificationDivider_vk8jv_371",v={container:Si,bellBtn:Pi,badge:xi,dropdown:Ti,dropdownHeader:Ii,clearAllBtn:Ni,discoveryStatusRow:Oi,statusDot:Ci,statusDotRunning:Ai,statusDotOk:qi,statusDotInfo:Li,statusDotError:Ri,statusDotIdle:ji,list:Di,item:$i,thumbnail:Mi,itemInfo:Fi,itemTitle:Bi,itemMeta:Wi,systemItemMeta:Qi,removeItem:Ki,queueItem:Ui,emptyState:Hi,notificationDivider:Vi},zi=({notification:e})=>{const t=ki(),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}=En(),{data:n=[]}=Sn(),{data:r}=Pn(),i=Ei(),s=U(),[a,c]=E(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&&rn(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]=E(!1),n=W(null),r=U(),i=C(),s=wi(),{data:a=[]}=En(),{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=C();return G({...t.settings.getByKey.queryOptions({key:e}),select:n=>n.value})},xn=()=>{const e=C(),t=U();return ee(e.settings.set.mutationOptions({onSuccess:()=>{g.success("Setting updated!"),t.invalidateQueries(e.settings.pathFilter()),t.invalidateQueries({queryKey:[O.settings]})},onError:n=>{g.error(`Failed to update setting: ${n.message}`)}}))},Tn=ce(void 0),Zi=()=>{const e=le(Tn);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}],Dt={x:Pe.w/2,y:Pe.h/2-.5},tt={y:Pe.h/2,x1:-2,x2:ut*2+Pe.w+1.4},$t=(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},Mt=7.5,Ft=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-Dt.x,a=(t-n.top)/i+ie.y-r.y-Dt.y;return{x:Ft(s/Mt),y:Ft(a/Mt)}},es=["normal","squint"],ts={normal:.72,squint:.28},Bt=(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,Wt=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",Kt="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 b=window.setTimeout(()=>{m.splice(m.indexOf(b),1),y()},I);m.push(b)},p=(y,I,b)=>{Fe().forEach(D=>{Number(D.getAttribute("data-dango-face-slot"))===y&&(b?D.setAttribute(I,""):D.removeAttribute(I))})},f=y=>Fe().forEach(I=>I.removeAttribute(y)),T=(y,I,b)=>{f(I),requestAnimationFrame(()=>{p(y,I,!0),h(()=>f(I),b)})},P=()=>{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)})},L=y=>{y!==r&&(r>=0&&p(r,ot,!1),r=y,y>=0&&p(y,ot,!0))},A=()=>{window.clearTimeout(d),d=window.setTimeout(()=>{L(-1),P()},is)},k=()=>{window.clearTimeout(d),L(-1)},$=()=>{i=!1,cs.forEach((y,I)=>{h(()=>{t[I]=Bt(),I===nt.from&&h(()=>T(nt.to,Kt,520),nt.after),P()},y)})},de=()=>{i=!0,t.fill(rs),k(),P()},Y=()=>{window.clearTimeout(u),u=window.setTimeout(de,os)},be=()=>{i||(s=(s+1)%t.length,t[s]=Bt(Math.random(),t[s]),P()),h(be,Wt+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,b=n,D=r,we=I?$t(c,l,I):-1,Te=we>=0?we:I?$t(c,l,I,ss):-1;n=we,Te>=0?(L(Te),A()):k(),(b!==n||D!==r)&&P(),i&&$(),Y()},_e=y=>{c=y.clientX,l=y.clientY,!a&&(a=requestAnimationFrame(()=>{a=0,te()}))},ye=y=>{y.relatedTarget||(n=-1,k(),P(),Y())};return P(),Y(),h(be,Wt),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(Kt)})}},[e])},Nn=ce(void 0),Cl=()=>{const e=le(Nn);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},Al=[{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",_s="_faceSquint_t3il2_27",ws="_faceSleep_t3il2_28",ks="_line_t3il2_36",Es="_sway_t3il2_44",Ss="_weight_t3il2_58",Ps="_shift_t3il2_73",xs="_rock_t3il2_87",Ts="_glance_t3il2_105",Is="_blinkDouble_t3il2_129 _blink_t3il2_124",Ns="_blinkSlow_t3il2_153 _blink_t3il2_124",Os="_bump_t3il2_172",Cs="_heart_t3il2_189",M={logo:ps,skewer:fs,gaze:ys,face:vs,faceNormal:gs,facePet:bs,faceSquint:_s,faceSleep:ws,line:ks,sway:Es,weight:Ss,shift:Ps,rock:xs,glance:Ts,blinkDouble:Is,blinkSlow:Ns,bump:Os,heart:Cs},Ut="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",qs="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",Ls="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"},On=[{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=On.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"}],Et=({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}`}),On.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:Ut,d:qs}),o("path",{fill:Ut,d:Ls})]}):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)})]})})},Cn=ce(void 0),St=()=>{const e=le(Cn);if(e===void 0)throw new Error("useSidebar must be used within a SidebarProvider");return e},An=ce(void 0),qn=()=>{const e=le(An);if(e===void 0)throw new Error("useContentType must be used within a ContentTypeProvider");return e},dt="virtual-keyboard:hide",Ht="virtual-keyboard:enabled-change",Ln="virtual_keyboard_enabled",Ws=!1;function Vt(){const e=localStorage.getItem(Ln);return e===null?Ws:e==="true"}const zt=e=>e instanceof HTMLInputElement&&e.type==="text"&&!e.disabled&&!e.readOnly;function Qs(){window.dispatchEvent(new CustomEvent(dt))}function Ks(){const[e,t]=E(!1),[n,r]=E(Vt),i=W(null);return w(()=>{const s=d=>{n&&zt(d.target)&&(i.current=d.target,t(!0))},a=d=>{d.target===i.current&&window.setTimeout(()=>{if(zt(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!==Ln)return;const m=d.newValue==="true";r(m),m||c()},u=()=>{const d=Vt();r(d),d||c()};return document.addEventListener("focusin",s),document.addEventListener("focusout",a),window.addEventListener(dt,c),window.addEventListener("storage",l),window.addEventListener(Ht,u),()=>{document.removeEventListener("focusin",s),document.removeEventListener("focusout",a),window.removeEventListener(dt,c),window.removeEventListener("storage",l),window.removeEventListener(Ht,u)}},[n]),{activeInputRef:i,isVisible:n&&e,hide:()=>t(!1)}}const Us="_header_q6huj_1",Hs="_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",S={header:Us,hidden:Hs,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}=St(),{contentType:t}=qn(),[n,r]=E(""),[i,s]=E(!0),[a,c]=E(!1),[l,u]=E(!0),[d,m]=E(!1),h=Hn(),p=yt(),f=W(null),T=W(!1),P=W(null),L=W(null),A=W(null),k=W(null),$=W(!1),{data:de}=G({queryKey:[O.syncProfile],queryFn:ha,staleTime:3e4});w(()=>{const b=window.visualViewport;if(!b)return;const D=()=>{k.current?.style.setProperty("--vv-top",`${b.offsetTop}px`)};return D(),b.addEventListener("scroll",D),b.addEventListener("resize",D),()=>{b.removeEventListener("scroll",D),b.removeEventListener("resize",D)}},[]),w(()=>{const b=()=>{f.current&&(window.clearTimeout(f.current),f.current=null)},D=()=>{b(),!(window.scrollY<=10)&&(f.current=window.setTimeout(()=>{$.current||s(!1)},2500))},we=()=>{T.current||(T.current=!0,P.current=requestAnimationFrame(()=>{T.current=!1,P.current=null;const ne=window.scrollY<=10;u(ve=>ve===ne?ve:ne),s(ve=>ve||!0),D()}))},Te=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=k.current,De=()=>{$.current=!0},ke=()=>{$.current=!1,D()};return window.addEventListener("scroll",we,{passive:!0}),window.addEventListener("keydown",Te),J?.addEventListener("pointerenter",De),J?.addEventListener("pointerleave",ke),()=>{window.removeEventListener("scroll",we),window.removeEventListener("keydown",Te),J?.removeEventListener("pointerenter",De),J?.removeEventListener("pointerleave",ke),b(),P.current!==null&&(cancelAnimationFrame(P.current),P.current=null),T.current=!1}},[a]);const Y=ft.useRef(null),be=()=>window.innerWidth<=1024,te=()=>{be()?(m(!0),setTimeout(()=>A.current?.focus({preventScroll:!0}),50)):document.activeElement===Y.current&&n.trim()?I():Y.current?.focus({preventScroll:!0})},_e=b=>{L.current?.contains(b.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=b=>{Qs();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:k,className:`${S.header} ${i?"":S.hidden} ${l?"":S.scrolled}`,children:[o("div",{className:S.headerInner,children:[o("div",{className:S.leftSection,children:[o("button",{className:S.hamburgerBtn,onClick:e,"aria-label":"Menu",children:o(_,{name:"bars"})}),o(Z,{to:"/",className:S.logo,"aria-label":"Ani-Web Home",children:o(Et,{})}),o("nav",{className:S.desktopNav,children:[o(Z,{to:"/",className:`${S.navLink} ${p.pathname==="/"?S.navLinkActive:""}`,children:"Home"}),o(Z,{to:y.to,className:`${S.navLink} ${p.pathname.startsWith(y.to)?S.navLinkActive:""}`,children:y.label}),t==="anime"&&o(Z,{to:"/insights",className:`${S.navLink} ${p.pathname==="/insights"?S.navLinkActive:""}`,children:"Insights"}),o(Z,{to:"/settings",className:`${S.navLink} ${p.pathname.startsWith("/settings")?S.navLinkActive:""}`,children:"Settings"})]})]}),o("div",{className:S.rightSection,children:[o("div",{className:S.searchWrapper,children:[o("input",{ref:Y,type:"text","data-virtual-keyboard":"true",className:S.searchInput,placeholder:ye,value:n,onChange:b=>r(b.currentTarget.value),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:b=>{b.key==="Enter"&&I()}}),o("button",{type:"button",className:S.searchButton,"aria-label":"Search",onMouseDown:b=>b.preventDefault(),onClick:te,children:o(_,{name:"search",className:S.searchIcon})})]}),o(Ji,{}),o(Z,{to:"/settings?tab=sync",className:S.profileBtn,"aria-label":"Sync settings",children:de?.picture?o("img",{src:de.picture,alt:de.name,className:S.profileImg,referrerPolicy:"no-referrer",decoding:"async"}):de?.provider==="github"?o(_,{name:"github"}):o(_,{name:"cloud"})})]})]}),d&&o("div",{className:`${S.mobileSearchBar} ${i?"":S.mobileSearchBarHidden}`,ref:L,onBlur:_e,children:o("div",{className:S.mobileSearchInner,children:[o(_,{name:"search",className:S.mobileSearchIcon}),o("input",{ref:A,type:"text","data-virtual-keyboard":"true",className:S.mobileSearchInput,placeholder:ye,value:n,onChange:b=>r(b.currentTarget.value),onKeyDown:b=>{b.key==="Enter"?(I(),m(!1)):b.key==="Escape"&&m(!1)}})]})})]})})},mt="agreedToViewMature";function ht(){try{return localStorage.getItem(mt)==="true"}catch{return!1}}const Ce=new Set;function Rn(e){for(const t of Ce)t(e)}function Be(){Rn(ht())}function Gt(e){try{e?localStorage.setItem(mt,"true"):localStorage.removeItem(mt)}catch{}Rn(e)}function fa(){const[e,t]=E(ht);w(()=>(Ce.add(t),Ce.size===1&&(window.addEventListener("storage",Be),window.addEventListener("focus",Be)),t(ht()),()=>{Ce.delete(t),Ce.size===0&&(window.removeEventListener("storage",Be),window.removeEventListener("focus",Be))}),[]);const n=K(()=>Gt(!0),[]),r=K(()=>Gt(!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",_a="_logo_153jc_57",wa="_navSection_153jc_69",ka="_navLink_153jc_75",Ea="_active_153jc_108",Sa="_overlay_153jc_118",Pa="_versionInfo_153jc_138",re={sidebar:ya,open:va,sidebarHeader:ga,closeBtn:ba,logo:_a,navSection:wa,navLink:ka,active:Ea,overlay:Sa,versionInfo:Pa},xa="3.7.3",jn={version:xa},Ta=()=>{const{isOpen:e,setIsOpen:t}=St(),{contentType:n}=qn(),{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(Et,{})})]}),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",Oa="_brandSection_1c905_27",Ca="_logoRow_1c905_39",Aa="_logoText_1c905_45",qa="_brandMeta_1c905_51",La="_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",Qa="_heartIcon_1c905_152",Ka="_backToTop_1c905_157",q={footer:Ia,footerInner:Na,brandSection:Oa,logoRow:Ca,logoText:Aa,brandMeta:qa,brandTagline:La,statusPill:Ra,statusDot:ja,linksGrid:Da,linkColumn:$a,columnTitle:Ma,bottomBar:Fa,copyright:Ba,brand:Wa,heartIcon:Qa,backToTop:Ka},Ua=()=>{const e=new Date().getFullYear(),t=()=>{window.scrollTo({top:0,behavior:"smooth"})};return o("footer",{className:q.footer,children:[o("div",{className:q.footerInner,children:[o("div",{className:q.brandSection,children:[o("div",{className:q.logoRow,children:o(Et,{className:q.logoText})}),o("div",{className:q.brandMeta,children:[o("div",{className:q.statusPill,children:[o("span",{className:q.statusDot}),o("span",{children:["v",jn.version]})]}),o("p",{className:q.brandTagline,children:"Fast, local anime streaming."})]})]}),o("div",{className:q.linksGrid,children:[o("div",{className:q.linkColumn,children:[o("h4",{className:q.columnTitle,children:"Navigation"}),o(Z,{to:"/",children:"Home"}),o(Z,{to:"/watchlist",children:"Watchlist"}),o(Z,{to:"/settings",children:"Settings"})]}),o("div",{className:q.linkColumn,children:[o("h4",{className:q.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:q.linkColumn,children:[o("h4",{className:q.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:q.linkColumn,children:[o("h4",{className:q.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:q.bottomBar,children:[o("p",{className:q.copyright,children:["© ",e," ",o("span",{className:q.brand,children:"dango"})," • Crafted with"," ",o(_,{name:"heart",className:q.heartIcon})," by"," ",o("a",{href:"https://github.com/serifpersia",target:"_blank",rel:"noopener noreferrer",children:"serifpersia"})]}),o("button",{className:q.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 ql(e,t){await fetch($n(e),{method:"POST",headers:{"Content-Type":"application/json"},body:Dn(t),keepalive:!0})}function Ll(e){e&&(pt("discord.clear",{sessionId:e}),pt("discord.heartbeat",{sessionId:e,bye:!0}))}function Ha(){const e=yt(),{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]=E(()=>{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=K(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 Qn({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]=E(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?rn(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(Qn,{children:i})]})]}),c):null}je.Header=Bn;je.Body=Wn;je.Actions=Qn;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",H={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]=E(1),[s,a]=E(navigator.userAgent),[c,l]=E(""),[u,d]=E(!1),m=W(null),h=navigator.userAgent,p=/android/i.test(h),f=/firefox|fxios/i.test(h)&&!p,T=!f&&!p&&/chrome|chromium|edg|brave/i.test(h),P=f||T;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 L=()=>{localStorage.setItem("animepahe_ua",s),window.open("https://animepahe.pw","_blank","noopener,noreferrer"),i(2)},A=()=>{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),g.error("Helper not detected - install it via about:debugging first.")},3e3),Y=be=>{const te=pc(be);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),g.success("Cookie extracted from helper!");else if(te?.error==="NO_COOKIE"){const _e=te.debug?.stores?.length??0,ye=te.debug?.names??[];g.error(`Helper found no cf_clearance (checked ${_e} stores, saw: ${ye.join(", ")||"none"}) - solve the challenge on the AnimePahe tab first.`)}else g.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:$}}))},k=()=>{const $=c.trim();if(!$){g.error("Please enter the cf_clearance cookie");return}try{localStorage.setItem("animepahe_cookie",$),g.success("Cookie updated successfully! Reloading…"),n?.(),t(),window.setTimeout(()=>window.location.reload(),1e3)}catch{g.error("Failed to save cookie")}};return o(je,{isOpen:e,onClose:t,title:"AnimePahe Verification Required",children:o("div",{className:H.container,children:r===1?o(z,{children:[o("p",{children:"AnimePahe requires a manual verification to bypass Cloudflare/DDoS-Guard protection."}),o("div",{className:H.field,children:[o("label",{children:"Your User-Agent (will be used for requests):"}),o("textarea",{value:s,readOnly:!0,rows:3,className:H.textarea})]}),o("div",{className:H.actions,children:[o("button",{className:H.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:H.button,onClick:L,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."]}),P&&o("div",{className:H.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:H.link,children:"dango-extension.zip"}),". Then click Extract below and the field fills itself.",o("div",{className:H.actions,children:o("button",{className:H.button,onClick:A,disabled:u,type:"button",children:u?"Extracting…":"Extract cookie from helper"})})]}),o("div",{className:H.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:H.input})]}),o("div",{className:H.actions,children:[o("button",{className:H.secondaryButton,onClick:t,children:"Cancel"}),o("button",{className:H.secondaryButton,onClick:()=>i(1),children:"Back"}),o("button",{className:H.button,onClick:k,children:"Submit"})]})]})})})};function yc(){const[e,t]=E(!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",_c="_text_1pca0_24",wc="_button_1pca0_29",Oe={screen:vc,icon:gc,title:bc,text:_c,button:wc};class kc extends zn{state={hasError:!1};static getDerivedStateFromError(t){return{hasError:!0}}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.hasError?o("div",{className:Oe.screen,children:[o(_,{name:"exclamation-triangle",className:Oe.icon}),o("h1",{className:Oe.title,children:"Something went wrong"}),o("p",{className:Oe.text,children:"The application encountered an unexpected error."}),o("button",{onClick:()=>{this.setState({hasError:!1}),window.location.href="/"},className:Oe.button,children:[o(_,{name:"home"}),"Go back Home"]})]}):this.props.children}}const Kn=ce(void 0),Ec=()=>{const e=le(Kn);if(!e)throw new Error("useLanAuth must be used within a LanAuthProvider");return e},Sc=({children:e})=>{const[t,n]=E(!1),r=K(()=>n(!0),[]),i=K(()=>n(!1),[]);return w(()=>wn("lan",r),[r]),o(Kn.Provider,{value:{isOpen:t,openModal:r,closeModal:i},children:e})},Pc="_container_88bss_1",xc="_field_88bss_8",Tc="_input_88bss_19",Ic="_actions_88bss_37",We={container:Pc,field:xc,input:Tc,actions:Ic},Yt=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})}),Nc=({isOpen:e,onClose:t,onSuccess:n})=>{const[r,i]=E(""),[s,a]=E(!1);ft.useEffect(()=>{e&&i("")},[e]);const c=async()=>{if(!r){g.error("Please enter your password");return}a(!0);try{const l=await wt("/api/auth/app-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:r})}),u=await l.json().catch(()=>({}));if(!l.ok){g.error(u.error||"Login failed");return}g.success("Authenticated successfully"),n(),t(),window.location.reload()}catch{g.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(Yt,{variant:"secondary",onClick:t,disabled:s,children:"Cancel"}),o(Yt,{variant:"primary",onClick:c,loading:s,children:"Unlock"})]})]})})},Oc=R(()=>j(()=>import("./Home-BYuAVKgx.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]))),Cc=R(()=>j(()=>import("./Watchlist-DBmU8PNR.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]))),Ac=R(()=>j(()=>import("./Settings-C-QEEujv.js"),__vite__mapDeps([40,1,2,41,42,4,43]))),Jt=R(()=>j(()=>import("./Player-2YKevlG4.js"),__vite__mapDeps([44,1,2,45,4,14,46,7,8,6,20,21,12,5,13,27,47,48,49,50,51,52]))),qc=R(()=>j(()=>import("./Search-CEErwr88.js"),__vite__mapDeps([53,1,4,3,5,6,7,8,9,10,11,2,12,13,14,15,16,17,18,37,38,54,55]))),Lc=R(()=>j(()=>import("./Mature-CMvs_-gf.js"),__vite__mapDeps([56,1,2,4,3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,27,54,55,57]))),Zt=R(()=>j(()=>import("./Asmr-CP7vVwsh.js"),__vite__mapDeps([58,1,4,2,41,42,7,8,3,5,6,9,32,24,59,25,47,60,61,62]))),Rc=R(()=>j(()=>import("./Manga-COhyMd3K.js"),__vite__mapDeps([63,1,4,41,42,7,8,17,18,3,5,6,9,22,23,2,24,25,27,64,65,60,61]))),jc=R(()=>j(()=>import("./MangaInfoPage-LTEvl_nL.js"),__vite__mapDeps([66,1,4,17,18,23,2,24,64,65,60,61]))),Dc=R(()=>j(()=>import("./MangaReadPage-sEwzyBQ7.js"),__vite__mapDeps([67,1,17,4,18,2,23,24,64,65,60,61]))),$c=R(()=>j(()=>import("./ReadingList-C--ZvTe2.js"),__vite__mapDeps([68,1,3,4,5,6,7,8,9,69,15,16,17,18,35,36,22,23,2,24,25,26,19]))),Xt=R(()=>j(()=>import("./TvSearch-DcWcxRb1.js"),__vite__mapDeps([70,1,4,3,5,6,7,8,9,28,29,30,2,24,15,16,17,18,54,55]))),Mc=R(()=>j(()=>import("./TvInfo-BajXP7JJ.js"),__vite__mapDeps([71,1,4,30,2,24,72]))),Fc=R(()=>j(()=>import("./Tv-C6F9655r.js"),__vite__mapDeps([73,1,2,4,45,14,46,74,7,8,27,30,24,47,6,50,51,75]))),Bc=R(()=>j(()=>import("./TvWatchlist-Cf_25dKi.js"),__vite__mapDeps([76,1,3,4,5,6,7,8,9,69,15,16,17,18,35,36,19,29,30,2,24]))),Wc=R(()=>j(()=>import("./ListeningList-kRSLAo3B.js"),__vite__mapDeps([77,1,3,4,5,6,7,8,9,69,15,16,17,18,35,36,59,32,2,24,25,31,19]))),Qc=R(()=>j(()=>import("./Trackers-1i4Hd5D3.js"),__vite__mapDeps([78,1,2,4,79]))),Kc=R(()=>j(()=>import("./Insights-Bx01GySp.js"),__vite__mapDeps([80,1,2,4,81]))),Uc=R(()=>j(()=>import("./AnimeInfoPage-K0ErjilQ.js"),__vite__mapDeps([82,1,2,4]))),Hc=R(()=>j(()=>import("./PlayerRedirect-fv2tzEUu.js"),__vite__mapDeps([83,1]))),Vc=R(()=>j(()=>import("./VirtualKeyboard-DeP7fb3P.js"),__vite__mapDeps([84,1,85])));function zc(){ms();const{isOpen:e,closeModal:t,onSuccess:n}=Va(),{isOpen:r,setIsOpen:i}=St(),{isOpen:s,openModal:a,closeModal:c}=Ec(),l=yt(),u=Yn(),d=W(new Map),m=W(l.pathname),h=Ks();Ha();const[p,f]=E(!1);w(()=>{li("/api/auth/app-status").then(A=>{A.hasPassword&&!A.isAuthenticated&&(f(!0),a())}).catch(()=>{})},[a]);const[T,P]=Mn("lan_auth_notice_shown","false"),L=W(!1);return w(()=>{if(T==="true"||L.current)return;L.current=!0,P("true");const A=setTimeout(()=>{g("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(A)},[T,P]),w(()=>{try{window.history.scrollRestoration="manual"}catch{}},[]),w(()=>{const A=l.key,k=d.current;if(u==="POP"){const $=k.get(A)??0;window.scrollTo({top:$,behavior:"instant"})}else l.pathname!==m.current&&window.scrollTo({top:0,behavior:"instant"});return m.current=l.pathname,()=>{k.set(A,window.scrollY)}},[l.key,l.pathname,u]),w(()=>{const A=k=>{r&&k.key==="Escape"&&i(!1)};return r?document.body.classList.add("sidebar-open"):document.body.classList.remove("sidebar-open"),window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A),document.body.classList.remove("sidebar-open")}},[r,i]),o("div",{className:"app-container",children:[o(fc,{isOpen:e,onClose:t,onSuccess:n}),o(Nc,{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(pa,{}),o(Ta,{}),o("main",{className:"main-content",children:o(kc,{children:o(Pt,{fallback:o(yc,{}),children:o(Jn,{children:[o(N,{path:"/",element:o(Oc,{})}),o(N,{path:"/watchlist/:filter?",element:o(Cc,{})}),o(N,{path:"/reading-list/:filter?",element:o($c,{})}),o(N,{path:"/search",element:o(qc,{})}),o(N,{path:"/mature",element:o(Lc,{})}),o(N,{path:"/asmr",element:o(Zt,{})}),o(N,{path:"/asmr/:rj",element:o(Zt,{})}),o(N,{path:"/manga",element:o(Rc,{})}),o(N,{path:"/manga/:provider/:id",element:o(jc,{})}),o(N,{path:"/manga/:provider/:id/read",element:o(Dc,{})}),o(N,{path:"/tv",element:o(Xt,{})}),o(N,{path:"/tv/:id",element:o(Mc,{})}),o(N,{path:"/tv/:id/watch",element:o(Fc,{})}),o(N,{path:"/tv-search",element:o(Xt,{})}),o(N,{path:"/tv-watchlist/:filter?",element:o(Bc,{})}),o(N,{path:"/listening-list/:filter?",element:o(Wc,{})}),o(N,{path:"/settings",element:o(Ac,{})}),o(N,{path:"/trackers",element:o(Qc,{})}),o(N,{path:"/mal",element:o(xt,{to:"/trackers",replace:!0})}),o(N,{path:"/insights",element:o(Kc,{})}),o(N,{path:"/anime/:id",element:o(Uc,{})}),o(N,{path:"/watch/:id",element:o(Jt,{})}),o(N,{path:"/watch/:id/:episodeNumber",element:o(Jt,{})}),o(N,{path:"/player/:id/:episodeNumber?",element:o(Hc,{})}),o(N,{path:"*",element:o(xt,{to:"/",replace:!0})})]})})})}),o(Ua,{}),h.isVisible&&o(Pt,{fallback:null,children:o(Vc,{activeInputRef:h.activeInputRef,isVisible:h.isVisible,onClose:h.hide})})]})}function Gc(){return o(Sc,{children:o(zc,{})})}const Yc=({children:e})=>{const[t,n]=E(!1),r=K(()=>{n(s=>!s)},[]),i=xe(()=>({isOpen:t,setIsOpen:n,toggleSidebar:r}),[t,r]);return o(Cn.Provider,{value:i,children:e})},Jc=({children:e})=>{const[t,n]=Mn("dango_content_type","anime"),r=xe(()=>({contentType:t,setContentType:n}),[t,n]);return o(An.Provider,{value:r,children:e})},Zc=({children:e})=>{const[t,n]=E("englishName"),[r,i]=E(!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=xe(()=>({titlePreference:t,setTitlePreference:n,loading:r}),[t,r]);return o(kn.Provider,{value:s,children:e})},Xc=({children:e})=>{const{data:t,isLoading:n}=Ze("lowEndMode"),r=xn(),i=U(),[s,a]=E(!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=K(u=>{a(u),r.mutate({key:"lowEndMode",value:String(u)})},[r]),l=xe(()=>({lowEndMode:s,setLowEndMode:c,loading:n}),[s,c,n]);return o(Tn.Provider,{value:l,children:e})},el=["iris","mochi","sakura"];function en(e){e==="iris"?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",e)}const tl=({children:e})=>{const{data:t,isLoading:n}=Ze("theme"),r=xn(),[i,s]=E("iris");w(()=>{typeof t=="string"&&el.includes(t)&&s(t)},[t]),w(()=>{en(i)},[i]);const a=K(l=>{l!==i&&(s(l),en(l),r.mutate({key:"theme",value:l}))},[r,i]),c=xe(()=>({theme:i,setTheme:a,loading:n}),[i,a,n]);return o(Nn.Provider,{value:c,children:e})},nl=({children:e})=>{const[t,n]=E(!1),[r,i]=E(void 0),s=K(c=>{i(()=>c),n(!0)},[]),a=K(()=>{n(!1),i(void 0)},[]);return w(()=>wn("animepahe",()=>s()),[s]),o(Fn.Provider,{value:{isOpen:t,openModal:s,closeModal:a,onSuccess:r},children:e})};try{window.history.scrollRestoration="manual"}catch{}const tn=new nr({defaultOptions:{queries:{staleTime:1e3*60*5,gcTime:1800*1e3,refetchOnWindowFocus:!1,refetchIntervalInBackground:!1,retry:1}}}),nn=document.getElementById("root");nn&&Zn(o(Xn,{children:o(mi,{trpcClient:X,queryClient:tn,children:o(rr,{client:tn,children:o(nl,{children:o(Yc,{children:o(Jc,{children:o(Zc,{children:o(Xc,{children:o(tl,{children:o(Gc,{})})})})})})})})})}),nn);export{Ol as $,g as A,Yt as B,Ze as C,xn as D,xl as E,Tl as F,Pl as G,wt as H,F as I,li as J,Cl as K,Vt as L,je as M,Ht as N,cl as O,H as P,fc as Q,hl as R,et as S,Al as T,Qs as U,Ln as V,Ll as W,wn as X,ql as Y,St as Z,j as _,Mn as a,yc as a0,vl as a1,gl as a2,yl as a3,ul as b,dl as c,vi as d,fa as e,pi as f,sl as g,yi as h,C as i,ml as j,qn as k,Sl as l,pl as m,fl as n,bl as o,_l as p,O as q,Il as r,al as s,X as t,Zi as u,kl as v,ll as w,Nl as x,El as y,wl as z};