1import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{c as t,l as n,r,s as i,t as a}from"./vendor-motion-DW0UKKg8.js";import{c as o}from"./vendor-react-BhDKfpxm.js";import{a as s,c,d as l,i as u}from"./vendor-query-DQ4Shq_9.js";import{t as d}from"./client-QE6En609.js";import{n as f,u as p}from"./mascotToast-DQ_Qahoa.js";import{t as m}from"./createLucideIcon-Cs2jVN1f.js";import{a as h,c as g,l as _,u as v}from"./useAuthorFollow-Ds3kf6DW.js";import{t as y}from"./book-open-Ci9rytdf.js";import{c as b,g as x,v as S,y as C}from"./useBooklistsData-DxEudWzV.js";import{i as w,o as T}from"./ContextMenu-BXBORi70.js";import{t as ee}from"./external-link-BgDSP4Ud.js";import{t as te}from"./search-Q9kpUaFb.js";import{t as E}from"./sparkles-ChB_csck.js";import{t as D}from"./trash-2-BSyaAoLd.js";import{t as O}from"./trophy-DSs45eoP.js";import{t as ne}from"./x-BRuS3CoU.js";import{a as re}from"./useSettings-DhwLmfFM.js";import{t as k}from"./notify-xuBBbY36.js";import{r as A,t as j}from"./notify-C7wpzrSc.js";import{t as ie}from"./useAuth-BcGNlKWP.js";import{a as M,i as ae,n as oe,r as N,t as se}from"./Transition-ChNe0tiw.js";import{t as ce}from"./Checkbox-DxTEzEiI.js";import{t as P}from"./DiscordIcon-BO40BYAc.js";import{i as le,r as F,t as I}from"./discord-Da4fOklk.js";var L=m(`bookmark-plus`,[[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M15 10H9`,key:`o6yqo3`}],[`path`,{d:`M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z`,key:`oz39mx`}]]),R=m(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),z=m(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),B=m(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),V=e(l(),1),H=e(n(),1),U=t();function W({icon:e,animation:t=`scale`,trigger:n=`hover`,duration:i=.3,className:o,isHovered:s,isActive:c,...l}){let u=a(),[d,f]=(0,H.useState)(!1),p=s===void 0?d:s,m={scale:{initial:{scale:1},animate:{scale:1.2}},rotate:{initial:{rotate:0},animate:{rotate:90}},spin:{initial:{rotate:0},animate:{rotate:360}},shake:{initial:{x:0},animate:{x:[0,-1.5,1.5,-1.5,1.5,0]}},pulse:{initial:{scale:1},animate:{scale:[1,1.1,1]}},bounce:{initial:{y:0},animate:{y:[0,-4,0]}},flyUp:{initial:{y:0,opacity:1},animate:{y:[0,-20,20,0],opacity:[1,0,0,1]}}}[t];return(0,H.useEffect)(()=>{n===`visible`&&u.start(`animate`)},[n,u]),(0,H.useEffect)(()=>{s!==void 0&&(s?u.start(`animate`):u.start(`initial`))},[s,u]),(0,H.useEffect)(()=>{c&&u.start(`animate`).then(()=>{u.start(`initial`)})},[c,u]),(0,U.jsx)(r.div,{className:`inline-flex items-center justify-center leading-none ${o||``}`,onMouseEnter:()=>{n===`hover`&&s===void 0&&f(!0)},onMouseLeave:()=>{n===`hover`&&s===void 0&&f(!1)},onClick:()=>{n===`click`&&u.start(`animate`).then(()=>u.start(`initial`))},initial:`initial`,animate:n===`hover`?p?`animate`:`initial`:n===`visible`?`animate`:u,variants:m,transition:t===`spin`?{duration:1,ease:`linear`,repeat:1/0}:t===`pulse`?{duration:i,ease:`easeInOut`,repeat:p?1/0:0,repeatType:`reverse`}:t===`shake`||t===`bounce`?{duration:.5,ease:`easeInOut`}:t===`flyUp`?{duration:.6,times:[0,.4,.41,1],ease:`easeInOut`}:M.stiff,children:(0,U.jsx)(e,{...l,className:`w-full h-full`})})}function ue({viewerFlags:e,variant:t=`card`,className:n=``}){let r=e?.includes(`followed`)??!1,i=e?.includes(`unread`)??!1;if(!r&&!i)return null;let a=t===`detail`?`h-6 w-6`:`h-[22px] w-[22px]`,o=t===`detail`?`h-6 min-w-10 text-[9px]`:`h-[22px] min-w-8 text-[8px]`,s=t===`detail`?`h-3.5 w-3.5`:`h-3 w-3`;return(0,U.jsxs)(`div`,{className:`flex items-center gap-1 ${n}`,children:[i&&(0,U.jsx)(`div`,{className:`relative z-10 flex items-center justify-center rounded-full bg-[#23a55a] px-1.5 font-black tracking-[0.08em] text-white shadow-xs animate-in fade-in zoom-in duration-300 ${o}`,title:`该å¸åææ°çæ´æ°`,children:`NEW`}),r&&(0,U.jsx)(`div`,{className:`relative z-0 flex items-center justify-center rounded-full bg-(--od-accent) text-white shadow-xs animate-in fade-in zoom-in duration-300 delay-75 ${a}`,title:`ä½ å·²å
³æ³¨æ¤å¸å`,children:(0,U.jsx)(_,{className:`${s} fill-current`})})]})}function de(e){let t=e.tournament_info_list||[],n=new Set;return t.filter(e=>{let t=String(e.booklist_id||``).trim();return!t||n.has(t)?!1:(n.add(t),!0)})}function fe({thread:e,variant:t,onNavigate:n}){let r=o(),i=de(e);if(!(e.is_tournament||i.length>0))return null;let a=(e,t)=>{t.stopPropagation();let i=String(e.booklist_id||``).trim();
1i&&(n?.(),r(`/tournaments/${i}`))};if(t===`icon`){let e=i[0];return(0,U.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-(--od-accent)`,"aria-label":`åèµå¸å`,title:e?`åèµå¸åï¼${e.booklist_name}`:`åèµå¸å`,children:(0,U.jsx)(O,{className:`h-3 w-3`})})}if(t===`inline`){let e=i[0];return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full text-(--od-accent)`,title:e?`åèµå¸åï¼${e.booklist_name}`:`åèµå¸å`,children:[(0,U.jsx)(O,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:`åèµ`})]})}return i.length===0?(0,U.jsxs)(`section`,{className:`mb-6`,children:[(0,U.jsxs)(`h3`,{className:`mb-3 inline-flex items-center gap-2 text-sm font-semibold text-(--od-text-primary)`,children:[(0,U.jsx)(O,{className:`h-4 w-4 text-(--od-accent)`}),`æå±èµäº`]}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:(0,U.jsx)(`span`,{className:`od-pill-chip text-(--od-accent)`,children:`åèµå¸å`})})]}):(0,U.jsxs)(`section`,{className:`mb-6`,children:[(0,U.jsxs)(`h3`,{className:`mb-3 inline-flex items-center gap-2 text-sm font-semibold text-(--od-text-primary)`,children:[(0,U.jsx)(O,{className:`h-4 w-4 text-(--od-accent)`}),`æå±èµäº`]}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:i.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:t=>a(e,t),className:`od-pill-chip text-(--od-accent) hover:text-(--od-accent-hover)`,title:`æ¥çèµäºï¼${e.booklist_name}`,children:e.booklist_name},String(e.booklist_id)))})]})}function pe({isOpen:e,threadId:t,threadTitle:n,onClose:r}){return(0,V.createPortal)((0,U.jsx)(se,{show:e,className:`fixed inset-0 z-[3000] flex items-center justify-center p-4`,children:(0,U.jsx)(me,{threadId:t,threadTitle:n,onClose:r,query:b({markThreadId:t,enabled:e&&/^\d+$/.test(t)}),isOpen:e},t)}),document.body)}function me({isOpen:e,threadId:t,threadTitle:n,onClose:a,query:o}){let s=c(),l=(0,H.useId)(),d=i(),f=oe(),p=(0,H.useMemo)(()=>new Set((o.data?.results||[]).filter(e=>e.is_marked).map(e=>e.id)),[o.data]),[m,h]=(0,H.useState)(p),[_,v]=(0,H.useState)(o.isSuccess?p:null),[y,b]=(0,H.useState)(``),C=o.data?.results||[];(0,H.useEffect)(()=>{_||!o.isSuccess||(v(p),h(p))},[_,p,o.isSuccess]),(0,H.useEffect)(()=>{if(!e||!d)return;let t=e=>{e.key===`Escape`&&(e.preventDefault(),a())};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,d,a]);let w=(0,H.useMemo)(()=>!/^\d+$/.test(t)||!o.isSuccess||!_?!1:m.size!==_.size||[...m].some(e=>!_.has(e))||m.size>0&&y.trim().length>0,[y,_,o.isSuccess,m,t]),T=u({mutationFn:()=>S.syncItems({thread_id:t,scope_booklist_ids:C.map(e=>e.id),target_booklist_ids:[...m],comment:y.trim()||void 0}),onSuccess:e=>{let t=e.added_to_booklist_ids?.length||0,n=e.removed_from_booklist_ids?.length||0,r=[t>0?`å å
¥ ${t} 个书å`:null,n>0?`ç§»åº ${n} 个书å`:null].filter(Boolean);A(r.length>0?r.join(`ï¼`):`书åå
å®¹å·²æ´æ°`),x(s,{booklistIds:[...e.added_to_booklist_ids||[],...e.removed_from_booklist_ids||[],...e.unchanged_booklist_ids||[]],includeItems:!0}),a()},onError:e=>{j(k(e,`æ·»å å°ä¹¦å失败`))}});return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{onClick:a,className:`fixed inset-0 bg-black/60 backdrop-blur-xs`,"aria-hidden":`true`}),(0,U.jsxs)(r.div,{initial:f?!1:`hidden`,animate:`visible`,exit:`hidden`,variants:f?{hidden:{opacity:0},visible:{opacity:1}}:ae,transition:{...N.panel,duration:f?0:N.panel.duration},role:`dialog`,"aria-modal":`true`,"aria-labelledby":l,className:`od-floating-panel-solid relative z-10 w-full max-w-lg rounded-xl border border-(--od-border) p-0 shadow-2xl`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between border-b border-(--od-border) px-5 py-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h2`,{id:l,className:`text-base font-bold text-(--od-text-primary)`,children:`å¿«æ·æ¶èå°ä¹¦å`}),n&&(0,U.jsx)(`p`,{className:`mt-1 truncate text-xs text-(--od-text-tertiary)`,children:n})]}),(0,U.jsx)(`button`,{type:`button`,onClick:a,className:`rounded p-1 text-(--od-text-tertiary) transition-colors hover:bg-(--od-bg-secondary) hover:text-(--od-text-primary)`,children:(0,U.jsx)(ne,{className:`h-4 w-4`})})]}),(0,U.jsxs)(`div`,{className:`space-y-4 p-5`,children:[/^\d+$/.test(t)?o.isLoading?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-(--od-text-secondary)`,children:[(0,U.jsx)(g,{className:`h-4 w-4 animate-spin`}),`æ£å¨å è½½ä½ ç书å...`]}):o.isError?(0,U.jsxs)(`div`,{className:`space-y-3 text-sm text-(--od-error)`,children:[(0,U.jsx)(`p`,{children:k(o.error,`å 载书å失败`)}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>o.refetch(),className:`rounded-lg border border-(--od-border) px-3 py-2 text-(--od-text-secondary) hover:bg-(--od-bg-secondary)`,children:`éæ°å è½½`})]}):C.length===0?(0,U.jsx)(`p`,{className:`text-sm text-(--od-text-secondary)`,children:`ä½ è¿æ²¡æå建书åï¼å
å»ä¹¦å页æ°å»ºä¸ä¸ªå§ã`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`max-h-56 space-y-2 overflow-y-auto pr-1 scrollbar-thin`,children:C.map(e=>{let t=m.has(e.id);return(0,U.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-lg border px-3 py-2.5 transition-all duration-200 ${t?`border-(--od-accent) bg-(--od-accent)/10 shadow-xs`:`border-(--od-border) hover:border-(--od-border-strong) hover:bg-(--od-surface-hover)`}`,children:[(0,U.jsx)(ce,{checked:t,"aria-label":e.title,onChange:()=>{h(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}}),(0,U.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`span`,{className:`block truncate text-sm font-medium text-(--od-text-primary)`,children:e.title}),(0,U.jsxs)(`span`,{className:`mt-0.5 block text-xs text-(--od-text-tertiary)`,children:[e.item_count,` å¸å · `,e.collection_count,` `,`æ¶è`]})]})]},e.id)})}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-(--od-text-secondary)`,children:`æ¨èè¯ï¼å¯éï¼`}),(0,U.jsx)(`textarea`,{value:y,onChange:e=>b(e.target.value),placeholder:`å¡«ååä¼åºç¨å°ææå¾éç书å...`,className:`w-full min-h-[80px] rounded-lg border border-(--od-border) bg-(--od-surface-input) p-3 text-sm text-(--od-text-primary) outline-hidden focu
1s:border-(--od-accent) transition-colors`})]})]}):(0,U.jsx)(`p`,{className:`text-sm text-(--od-error)`,children:`å½åå¸å ID æ æï¼ææ¶æ æ³å å
¥ä¹¦åã`}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-(--od-border) pt-4`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:a,className:`rounded-lg px-3 py-2 text-sm text-(--od-text-secondary) transition-colors hover:bg-(--od-bg-secondary) hover:text-(--od-text-primary)`,children:`åæ¶`}),(0,U.jsxs)(`button`,{type:`button`,disabled:!w||T.isPending,onClick:()=>{T.mutate()},className:`inline-flex items-center gap-2 rounded-lg bg-(--od-accent) px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-(--od-accent-hover) disabled:opacity-60`,children:[T.isPending?(0,U.jsx)(g,{className:`h-4 w-4 animate-spin`}):(0,U.jsx)(L,{className:`h-4 w-4`}),`ä¿å书å`]})]})]})]})]}):null}function G({content:e,children:t,position:n=`top`,delay:r=300}){let[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(null);return(0,U.jsxs)(`div`,{className:`relative inline-block`,onMouseEnter:()=>{s(window.setTimeout(()=>{a(!0)},r))},onMouseLeave:()=>{o&&clearTimeout(o),a(!1)},children:[t,i&&(0,U.jsxs)(`div`,{className:`absolute z-50 whitespace-nowrap rounded-md bg-[#1e1f22] px-3 py-2 text-xs text-[#f2f3f5] shadow-lg animate-in fade-in duration-200 ${{top:`bottom-full left-1/2 -translate-x-1/2 mb-2`,bottom:`top-full left-1/2 -translate-x-1/2 mt-2`,left:`right-full top-1/2 -translate-y-1/2 mr-2`,right:`left-full top-1/2 -translate-y-1/2 ml-2`}[n]}`,children:[e,(0,U.jsx)(`div`,{className:`absolute h-0 w-0 border-4 ${{top:`top-full left-1/2 -translate-x-1/2 border-t-[#1e1f22] border-l-transparent border-r-transparent border-b-transparent`,bottom:`bottom-full left-1/2 -translate-x-1/2 border-b-[#1e1f22] border-l-transparent border-r-transparent border-t-transparent`,left:`left-full top-1/2 -translate-y-1/2 border-l-[#1e1f22] border-t-transparent border-b-transparent border-r-transparent`,right:`right-full top-1/2 -translate-y-1/2 border-r-[#1e1f22] border-t-transparent border-b-transparent border-l-transparent`}[n]}`})]})]})}function K(e){le({...e,onFallback:e.onFallback||(({webUrl:e})=>{f({id:`discord-deeplink-fallback`,emotion:`confused`,eyebrow:`App Link Fallback`,title:`æ¢ç«¯ä¼¼ä¹æªååº`,message:`ä½ ç设å¤ä¼¼ä¹ä¸æ¯æè¿ç§æ¹å¼ãæ¯å¦ç¨ Web æå¼ï¼`,actionLabel:`ç¨ Web æå¼`,onAction:()=>{window.open(e,`_blank`,`noopener,noreferrer`)},cancelLabel:`åæ¶`,duration:8e3})})})}function he({threadId:e,channelId:t,guildId:n,size:r=`md`,variant:i=`default`,alwaysVisible:a=!1,className:o,externalUrlOverride:s}){let[c,l]=(0,H.useState)(!1),u=re(),d=s||F({guildId:n,channelId:t,threadId:e}),f=s?null:I({guildId:n,channelId:t,threadId:e}),p=u===`app`&&f?f:d,m=s?`æå¼ Discord 龿¥`:u===`app`?`ç¨ Discord App æå¼`:`å¨ Discord ç½é¡µç«¯æå¼`,h=u===`web`||s?`_blank`:void 0,g=h?`noopener noreferrer`:void 0,_=e=>{e.stopPropagation(),u===`app`&&f&&(e.preventDefault(),K({appUrl:f,webUrl:d,openMode:u}))},v={sm:{button:`p-1.5`,icon:`h-3.5 w-3.5`},md:{button:`p-2`,icon:`h-4 w-4`}};if(i===`glass`)return(0,U.jsx)(G,{content:m,position:`left`,children:(0,U.jsx)(`a`,{href:p,target:h,rel:g,onClick:_,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:`flex h-8 w-8 items-center justify-center rounded-full bg-black/40 text-white backdrop-blur-md transition-colors hover:bg-black/60 ${o||``}`,"aria-label":m,children:(0,U.jsx)(W,{icon:P,className:`h-4 w-4`,animation:`shake`,isHovered:c})})});let y=v[r],b=i===`white`?`text-white/80 hover:text-white hover:bg-white/10`:`text-(--od-text-tertiary) hover:text-(--od-text-primary) hover:bg-(--od-bg-tertiary)`,x=a?`opacity-100 translate-y-0`:`md:opacity-0 md:translate-y-1 md:group-hover:opacity-100 md:group-hover:translate-y-0`;return(0,U.jsx)(`div`,{className:`flex items-center ${o||``}`,children:(0,U.jsx)(G,{content:m,position:`left`,children:(0,U.jsx)(`a`,{href:p,target:h,rel:g,onClick:_,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),className:`flex items-center justify-center rounded-md transition-all duration-200 ${y.button} ${b} ${x}`,"aria-label":m,children:(0,U.jsx)(W,{icon:P,className:y.icon,animation:`shake`,isHovered:c})})})})}function q(e,t){return(e.viewer_flags??[]).includes(t)}var J={getFollowsRaw:async(e={},t)=>(await d.get(`/follows/`,{signal:t,params:{limit:e.limit,offset:e.offset,active_flag:e.active_flag??void 0,channel_ids:e.channel_ids||void 0},paramsSerializer:{indexes:null}})).data,getUnreadCount:async e=>(await d.get(`/follows/unread-count`,{signal:e})).data,markAllViewed:async()=>{await d.post(`/follows/mark-viewed`)},getFollows:async(e={})=>{let[t,n]=await Promise.all([J.getFollowsRaw(e),J.getUnreadCount()]);return{results:t.threads,total:t.total,unread_count:n.unread_count??0}},followThread:async e=>{await d.post(`/follows/${e}`)},unfollowThread:async e=>{await d.delete(`/follows/${e}`)}};function ge(e={},{enabled:t=!0}={}){return s({queryKey:h.list(e),queryFn:({signal:t})=>J.getFollowsRaw(e,t),staleTime:60*1e3,enabled:t})}function _e({enabled:e=!0}={}){return s({queryKey:h.unreadCount(),queryFn:({signal:e})=>J.getUnreadCount(e),staleTime:60*1e3,refetchInterval:30*1e3,refetchOnWindowFocus:!0,enabled:e})}function ve(e={},{enabled:t=!0,listEnabled:n=!0}={}){let r=ge(e,{enabled:t&&n}),i=_e({enabled:t});return{data:{results:r.data?.threads??[],total:r.data?.total??0,unread_count:i.data?.unread_count??0},isLoading:r.isLoading||i.isLoading,isError:r.isError||i.isError,isFetching:r.isFetching||i.isFetching,error:r.error??i.error,refetch:async()=>Promise.all([r.refetch(),i.refetch()])}}function Y(){let e=c();return u({mutationFn:J.unfollowThread,onSuccess:(t,n)=>
1{e.setQueryData(h.state(n),!1),Promise.all([e.invalidateQueries({queryKey:h.all}),e.invalidateQueries({queryKey:[`search`]}),e.invalidateQueries({queryKey:[`discovery`]}),e.invalidateQueries({queryKey:[`authors`]}),e.invalidateQueries({queryKey:[`booklists`]}),e.invalidateQueries({queryKey:[`notifications`]})]),A(`å·²åæ¶å ³æ³¨è¿ä¸ªå¸å`)},onError:e=>{j(k(e,`åæ¶å ³æ³¨å¤±è´¥ï¼è¯·ç¨ååè¯`))}})}function ye(){let e=c();return u({mutationFn:async({threadId:e,followed:t})=>(t?await J.unfollowThread(e):await J.followThread(e),{threadId:e,followed:!t}),onMutate:({threadId:t,followed:n})=>{let r=h.state(t),i=e.getQueryData(r);return e.setQueryData(r,!n),{previousFollowed:i}},onSuccess:({followed:t})=>{Promise.all([e.invalidateQueries({queryKey:h.all}),e.invalidateQueries({queryKey:[`search`]}),e.invalidateQueries({queryKey:[`discovery`]}),e.invalidateQueries({queryKey:[`authors`]}),e.invalidateQueries({queryKey:[`booklists`]}),e.invalidateQueries({queryKey:[`notifications`]})]),A(t?`å·²å ³æ³¨è¿ä¸ªä½å`:`å·²åæ¶å ³æ³¨è¿ä¸ªä½å`)},onError:(t,{threadId:n,followed:r},i)=>{e.setQueryData(h.state(n),i?.previousFollowed??r),j(k(t,r?`åæ¶å ³æ³¨å¤±è´¥ï¼è¯·ç¨ååè¯`:`å ³æ³¨å¤±è´¥ï¼è¯·ç¨ååè¯`))}})}function X(e){let t=e.startsWith(`/`)?e:`/${e}`;return typeof window>`u`?t:`${window.location.origin}${t}`}function Z(e,t,n){let r=X(n);return[`å享${t}ï¼ã${e.title}ã`,e.description?.trim()?`ç®ä»ï¼${e.description.trim()}`:null,`æ¶å½ ${e.item_count} 个å¸å · ${e.collection_count} 次æ¶è · ${e.view_count} 次æµè§`,e.is_public?`å ¬å¼ä¹¦å`:`ç§æä¹¦å`,r].filter(Boolean).join(` 2`)}function be(e){return Z(e,`书å`,`/booklists/${e.id}`)}function xe(e){return Z(e,`èµäº`,`/tournaments/${e.id}`)}function Se({userId:e,authorName:t,stats:n}){let r=X(`/u/${e}`);return[`å享ä½è ï¼${t}`,`åå¸ ${n.thread_count} 个å¸å · æ¶è· ${n.reaction_count} 个ç¹èµ · ${n.reply_count} æ¡åå¤`,r].join(` 3`)}function Q(e){if(typeof document>`u`)return!1;let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,`true`),t.style.position=`fixed`,t.style.left=`-9999px`,t.style.top=`0`,document.body.appendChild(t),t.select();try{return document.execCommand(`copy`)}finally{document.body.removeChild(t)}}async function $(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{return Q(e)}return Q(e)}function Ce({thread:e,onAddToBooklist:t,onFindSimilar:n,onAISimilar:r,onApplyBanner:i,managementActions:a}){let{isAuthenticated:o}=ie(),s=c(),l=ye(),u=q(e,`followed`),d=s.getQueryData(h.state(e.thread_id))??u,f=async()=>{await $(`${window.location.origin}/threads/${e.thread_id}`)?p.success(`å·²å¤å¶ä½å龿¥`):p.error(`å¤å¶ä½å龿¥å¤±è´¥`)};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(w,{icon:(0,U.jsx)(y,{className:`h-4 w-4`}),onClick:t,children:`å å ¥ä¹¦å`}),(0,U.jsx)(w,{icon:d?(0,U.jsx)(v,{className:`h-4 w-4`}):(0,U.jsx)(_,{className:`h-4 w-4`}),disabled:!o||l.isPending,onClick:()=>l.mutate({threadId:e.thread_id,followed:d}),children:o?l.isPending?`æ´æ°å ³æ³¨ä¸â¦`:d?`åæ¶å ³æ³¨ä½å`:`å ³æ³¨ä½å`:`ç»å½åå ³æ³¨ä½å`}),i&&(0,U.jsx)(w,{icon:(0,U.jsx)(z,{className:`h-4 w-4`}),onClick:i,children:`ç³è¯· Banner`}),(0,U.jsx)(T,{}),(0,U.jsx)(w,{icon:(0,U.jsx)(C,{className:`h-4 w-4`}),onClick:()=>void f(),children:`å¤å¶ä½å龿¥`}),(0,U.jsx)(w,{icon:(0,U.jsx)(ee,{className:`h-4 w-4`}),onClick:()=>{window.open(`/threads/${e.thread_id}`,`_blank`,`noopener,noreferrer`)},children:`卿°æ ç¾é¡µæå¼`}),(n||r)&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{}),n&&(0,U.jsx)(w,{icon:(0,U.jsx)(te,{className:`h-4 w-4`}),onClick:n,children:`æ¾ç¸ä¼¼ä½å`}),r&&(0,U.jsx)(w,{icon:(0,U.jsx)(E,{className:`h-4 w-4`}),onClick:r,children:`AI æ¢ç´¢ç¸ä¼¼`})]}),a&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(T,{}),(0,U.jsx)(w,{icon:(0,U.jsx)(B,{className:`h-4 w-4`}),onClick:a.onEdit,children:`ç¼è¾ä¹¦å夿³¨`}),(0,U.jsx)(w,{variant:`danger`,disabled:a.removePending,icon:(0,U.jsx)(D,{className:`h-4 w-4`}),onClick:a.onRemove,children:a.removePending?`ç§»é¤ä¸â¦`:`ä»ä¹¦åç§»é¤`})]})]})}export{$ as a,q as c,pe as d,fe as f,R as g,B as h,xe as i,he as l,W as m,Se as n,ve as o,ue as p,be as r,Y as s,Ce as t,K as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.