birdclaw 0.10.0 → 0.11.0

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 (52) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +6 -2
  3. package/dist/cli/birdclaw.js +3267 -2991
  4. package/dist/client/assets/{SavedTimelineView-4QYaZ4CU.js → SavedTimelineView-CFgHR6di.js} +1 -1
  5. package/dist/client/assets/{TimelineRouteFrame-DJdUR7DX.js → TimelineRouteFrame-DcipwBqo.js} +1 -1
  6. package/dist/client/assets/{blocks-C84MpzHq.js → blocks-GWWj1dXr.js} +1 -1
  7. package/dist/client/assets/blocks-qrevFiNI.js +2 -0
  8. package/dist/client/assets/{bookmarks-Gy6MvAc9.js → bookmarks-BMf6Ytua.js} +1 -1
  9. package/dist/client/assets/{discuss-DKC6H1fN.js → discuss-BeFPn8mN.js} +2 -2
  10. package/dist/client/assets/{discuss-C0CUMn6v.js → discuss-ZvGdSAmA.js} +1 -1
  11. package/dist/client/assets/dms-CMp6bAR_.js +1 -0
  12. package/dist/client/assets/{dms-Q1a1kZ_P.js → dms-DBexFtGg.js} +2 -2
  13. package/dist/client/assets/{inbox-C9zFrQ76.js → inbox-CeGwsGo_.js} +1 -1
  14. package/dist/client/assets/{inbox-DjlVjj3K.js → inbox-DvSRkOiH.js} +2 -2
  15. package/dist/client/assets/{index-B8hO98gL.js → index-Bz8aYylW.js} +3 -3
  16. package/dist/client/assets/{likes-BXANVRCj.js → likes-BaljrAHC.js} +1 -1
  17. package/dist/client/assets/{links-6tWeHun_.js → links-CbC-fX7T.js} +2 -2
  18. package/dist/client/assets/{links-D3Ut-aUB.js → links-DMGuDd-B.js} +1 -1
  19. package/dist/client/assets/{mentions-BKO40XiK.js → mentions-TFNyR9F4.js} +1 -1
  20. package/dist/client/assets/{network-map-DUpppygD.js → network-map-1fXIqI3Y.js} +1 -1
  21. package/dist/client/assets/{network-map-2EPsbMIT.js → network-map-CKiXfloJ.js} +2 -2
  22. package/dist/client/assets/{routes-ARIEjgq-.js → routes-P7NzOusD.js} +1 -1
  23. package/dist/client/assets/{today-DNAg-wnA.js → today-DOUIqDPa.js} +2 -2
  24. package/dist/client/assets/{today-Q3xFx4cl.js → today-Dq8qoGhX.js} +1 -1
  25. package/dist/client/assets/{useTimelineRouteData-DYhYLZY4.js → useTimelineRouteData-2v9TVG9L.js} +1 -1
  26. package/dist/server/assets/{SavedTimelineView-Ern3q7LW.js → SavedTimelineView-lVz_ZZnh.js} +1 -1
  27. package/dist/server/assets/{TimelineRouteFrame-CYD-qMuy.js → TimelineRouteFrame-Dj1TeYrD.js} +1 -1
  28. package/dist/server/assets/{_tanstack-start-manifest_v-CHtuH75x.js → _tanstack-start-manifest_v-DQT-Q-zz.js} +28 -28
  29. package/dist/server/assets/{blocks-VXmcBqKD.js → blocks-BSvPOa_E.js} +2 -2
  30. package/dist/server/assets/{blocks-DWZAKPAX.js → blocks-Cv7I4iVs.js} +2 -2
  31. package/dist/server/assets/{bookmarks-DVCjWQPu.js → bookmarks-BcFpV8qD.js} +1 -1
  32. package/dist/server/assets/{discuss-4b2z14mT.js → discuss-BuLhalye.js} +2 -2
  33. package/dist/server/assets/{discuss-CJ_vThu8.js → discuss-D1q_L77A.js} +2 -2
  34. package/dist/server/assets/{dms-DbJk33XB.js → dms-C-s5l0cs.js} +3 -3
  35. package/dist/server/assets/{dms-Cr5heLhm.js → dms-OtbAd5nR.js} +2 -2
  36. package/dist/server/assets/{inbox-D607zrwZ.js → inbox-Wf8xGIjq.js} +2 -2
  37. package/dist/server/assets/{inbox-BJzEE8Aa.js → inbox-wLir608r.js} +1 -1
  38. package/dist/server/assets/{likes-C3EpsPbF.js → likes-BfFIyEbU.js} +1 -1
  39. package/dist/server/assets/{links-BU_FRxcz.js → links-BWt4ORY4.js} +2 -2
  40. package/dist/server/assets/{links-Dz-6bmkg.js → links-_ePW92kI.js} +2 -2
  41. package/dist/server/assets/{mentions-BHd6N_OL.js → mentions-oO4uv0Ju.js} +1 -1
  42. package/dist/server/assets/{router-BMfpBcBM.js → router-DY-ahyjD.js} +14588 -14521
  43. package/dist/server/assets/{routes-Cyokiwx1.js → routes-CYJ-dTi6.js} +1 -1
  44. package/dist/server/assets/start-CHdfdlfD.js +4 -0
  45. package/dist/server/assets/{today-CRa6Y-Tg.js → today-BLDqhLvT.js} +2 -2
  46. package/dist/server/assets/{today-CScZDxQx.js → today-D8zExFWH.js} +2 -2
  47. package/dist/server/server.js +4 -4
  48. package/package.json +89 -91
  49. package/dist/client/assets/blocks-BpjvGwYq.js +0 -2
  50. package/dist/client/assets/dms-DWA5tvJS.js +0 -1
  51. package/dist/server/assets/start-P4i55asu.js +0 -4
  52. package/dist/server/assets/{useTimelineRouteData-BWxx9yQl.js → useTimelineRouteData-wthflgOe.js} +1 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Rn as n}from"./schemas-CMQMhQXI.js";import{a as r,i,n as a,o,r as s,t as c}from"./useTimelineRouteData-DYhYLZY4.js";import{t as l}from"./SyncNowButton-DDYT2jQT.js";var u=e(t(),1),d=n(),f={liked:`Likes`,bookmarked:`Bookmarks`};function p({filter:e,title:t,loadingLabel:n,searchPlaceholder:p}){let[m,h]=(0,u.useState)(``),{meta:g,items:_,loading:v,error:y,retry:b,refreshLocalView:x,replyToTweet:S,hasMore:C,loadingMore:w,loadMore:T}=c({resource:`home`,search:m,errorFallback:`${f[e]} unavailable`,likedOnly:e===`liked`,bookmarkedOnly:e===`bookmarked`}),E=(0,u.useMemo)(()=>g?`${String(_.length)} visible · ${g.transport.statusText}`:_.length>0?`${String(_.length)} visible`:n,[_.length,n,g]),D=e===`liked`?`likes`:`bookmarks`;return(0,d.jsx)(s,{header:(0,d.jsx)(a,{title:f[e],subtitles:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{children:t}),(0,d.jsx)(i,{children:E})]}),action:(0,d.jsx)(l,{accounts:g?.accounts,kind:D,label:e===`liked`?`Sync likes`:`Sync bookmarks`,onSynced:x}),controls:(0,d.jsx)(r,{onChange:h,placeholder:p,value:m})}),loading:v,loadingLabel:n,loadingDetail:`Reading local ${f[e].toLowerCase()}`,error:y,errorTitle:`Could not load ${f[e].toLowerCase()}`,onRetry:b,empty:_.length===0,emptyLabel:`Nothing saved here yet`,emptyDetail:`Sync this collection or broaden the search.`,hasMore:C,loadingMore:w,onLoadMore:T,children:_.map(e=>(0,d.jsx)(o,{item:e,onReply:S,showReplyControls:!1},e.id))})}export{p as t};
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Rn as n}from"./schemas-CMQMhQXI.js";import{a as r,i,n as a,o,r as s,t as c}from"./useTimelineRouteData-2v9TVG9L.js";import{t as l}from"./SyncNowButton-DDYT2jQT.js";var u=e(t(),1),d=n(),f={liked:`Likes`,bookmarked:`Bookmarks`};function p({filter:e,title:t,loadingLabel:n,searchPlaceholder:p}){let[m,h]=(0,u.useState)(``),{meta:g,items:_,loading:v,error:y,retry:b,refreshLocalView:x,replyToTweet:S,hasMore:C,loadingMore:w,loadMore:T}=c({resource:`home`,search:m,errorFallback:`${f[e]} unavailable`,likedOnly:e===`liked`,bookmarkedOnly:e===`bookmarked`}),E=(0,u.useMemo)(()=>g?`${String(_.length)} visible · ${g.transport.statusText}`:_.length>0?`${String(_.length)} visible`:n,[_.length,n,g]),D=e===`liked`?`likes`:`bookmarks`;return(0,d.jsx)(s,{header:(0,d.jsx)(a,{title:f[e],subtitles:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i,{children:t}),(0,d.jsx)(i,{children:E})]}),action:(0,d.jsx)(l,{accounts:g?.accounts,kind:D,label:e===`liked`?`Sync likes`:`Sync bookmarks`,onSynced:x}),controls:(0,d.jsx)(r,{onChange:h,placeholder:p,value:m})}),loading:v,loadingLabel:n,loadingDetail:`Reading local ${f[e].toLowerCase()}`,error:y,errorTitle:`Could not load ${f[e].toLowerCase()}`,onRetry:b,empty:_.length===0,emptyLabel:`Nothing saved here yet`,emptyDetail:`Sync this collection or broaden the search.`,hasMore:C,loadingMore:w,onLoadMore:T,children:_.map(e=>(0,d.jsx)(o,{item:e,onReply:S,showReplyControls:!1},e.id))})}export{p as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Dn as n,M as r,Mn as i,On as a,Rn as o,kn as s}from"./schemas-CMQMhQXI.js";import{a as c,i as l,n as u,o as d,r as f,t as p}from"./useTimelineRouteData-DYhYLZY4.js";import{t as m}from"./SyncNowButton-DDYT2jQT.js";var h=e(t(),1),g=o(),_=[{value:`all`,label:`All`},{value:`unreplied`,label:`Unreplied`},{value:`replied`,label:`Replied`}];function v({title:e,resource:t,initialReplyFilter:o,searchPlaceholder:v,syncKind:y,syncLabel:b,loadingLabel:x,loadingDetail:S,errorTitle:C,errorFallback:w,emptyLabel:T,emptyDetail:E,subtitle:D}){let[O,k]=(0,h.useState)(o),[A,j]=(0,h.useState)(``),{meta:M,items:N,loading:P,error:F,replyError:I,retry:L,refreshLocalView:R,replyToTweet:z,hasMore:B,loadingMore:V,loadMore:H}=p({resource:t,replyFilter:O,search:A,errorFallback:w});return(0,g.jsx)(f,{header:(0,g.jsx)(u,{title:e,subtitles:(0,g.jsx)(l,{children:(0,h.useMemo)(()=>D(M),[M,D])}),action:(0,g.jsx)(m,{accounts:M?.accounts,allowAutoSync:!0,autoSyncBlocked:P,kind:y,label:b,onSynced:R,showAccountPicker:!0}),controls:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c,{onChange:j,placeholder:v,value:A}),(0,g.jsx)(`div`,{className:s,children:_.map(e=>{let t=O===e.value;return(0,g.jsx)(`button`,{type:`button`,"aria-pressed":t,className:r(n,t&&`text-[var(--ink)] font-bold`),onClick:()=>k(e.value),children:(0,g.jsxs)(`span`,{className:`relative inline-flex flex-col items-center justify-center py-1`,children:[e.label,t?(0,g.jsx)(`span`,{className:a}):null]})},e.value)})})]})}),notice:I?(0,g.jsx)(`p`,{className:r(i,`px-4 py-2 text-red-500`),children:I}):null,loading:P,loadingLabel:x,loadingDetail:S,error:F,errorTitle:C,onRetry:L,empty:N.length===0,emptyLabel:T,emptyDetail:E,hasMore:B,loadingMore:V,onLoadMore:H,children:N.map(e=>(0,g.jsx)(d,{item:e,onReply:z},e.id))})}export{v as t};
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Dn as n,M as r,Mn as i,On as a,Rn as o,kn as s}from"./schemas-CMQMhQXI.js";import{a as c,i as l,n as u,o as d,r as f,t as p}from"./useTimelineRouteData-2v9TVG9L.js";import{t as m}from"./SyncNowButton-DDYT2jQT.js";var h=e(t(),1),g=o(),_=[{value:`all`,label:`All`},{value:`unreplied`,label:`Unreplied`},{value:`replied`,label:`Replied`}];function v({title:e,resource:t,initialReplyFilter:o,searchPlaceholder:v,syncKind:y,syncLabel:b,loadingLabel:x,loadingDetail:S,errorTitle:C,errorFallback:w,emptyLabel:T,emptyDetail:E,subtitle:D}){let[O,k]=(0,h.useState)(o),[A,j]=(0,h.useState)(``),{meta:M,items:N,loading:P,error:F,replyError:I,retry:L,refreshLocalView:R,replyToTweet:z,hasMore:B,loadingMore:V,loadMore:H}=p({resource:t,replyFilter:O,search:A,errorFallback:w});return(0,g.jsx)(f,{header:(0,g.jsx)(u,{title:e,subtitles:(0,g.jsx)(l,{children:(0,h.useMemo)(()=>D(M),[M,D])}),action:(0,g.jsx)(m,{accounts:M?.accounts,allowAutoSync:!0,autoSyncBlocked:P,kind:y,label:b,onSynced:R,showAccountPicker:!0}),controls:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c,{onChange:j,placeholder:v,value:A}),(0,g.jsx)(`div`,{className:s,children:_.map(e=>{let t=O===e.value;return(0,g.jsx)(`button`,{type:`button`,"aria-pressed":t,className:r(n,t&&`text-[var(--ink)] font-bold`),onClick:()=>k(e.value),children:(0,g.jsxs)(`span`,{className:`relative inline-flex flex-col items-center justify-center py-1`,children:[e.label,t?(0,g.jsx)(`span`,{className:a}):null]})},e.value)})})]})}),notice:I?(0,g.jsx)(`p`,{className:r(i,`px-4 py-2 text-red-500`),children:I}):null,loading:P,loadingLabel:x,loadingDetail:S,error:F,errorTitle:C,onRetry:L,empty:N.length===0,emptyLabel:T,emptyDetail:E,hasMore:B,loadingMore:V,onLoadMore:H,children:N.map(e=>(0,g.jsx)(d,{item:e,onReply:z},e.id))})}export{v as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{An as n,C as r,Ft as i,Gt as a,Kt as ee,M as o,Mn as te,N as s,Rn as c,S as l,Tn as u,Ut as d,Wt as f,Xt as p,cn as m,dt as h,jn as ne,pn as re,ut as g}from"./schemas-CMQMhQXI.js";import{A as _,a as v,b as y,n as b,r as ie,s as x,u as ae}from"./query-client-CA-do_IS.js";import{t as S}from"./useQuery-CL_NXLnc.js";import{r as C,t as w}from"./AvatarChip-DsHj3LT7.js";import{t as T}from"./route-search-CmZT7pGD.js";import{t as E}from"./useDebouncedValue-BJLRInUq.js";import{t as D}from"./blocks-BpjvGwYq.js";var O=e(t()),k=c();function A(){let e=D.useSearch(),t=D.useNavigate();return(0,k.jsx)(j,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function j({searchState:e,onSearchChange:t}={}){let c=y(),[D,A]=(0,O.useState)(()=>T({})),j=e??D,M=(e,n)=>t?t(e,n):A(e),N=j.account,P=j.q,[F,I]=(0,O.useState)(!1),[L,R]=(0,O.useState)(``),[z,B]=(0,O.useState)(``),V=S({queryKey:b.status,queryFn:({signal:e})=>v({signal:e})}),H=V.data??null,U=E(P,180),W=N.trim().length>0,G=!!H,K=S({queryKey:[...b.blocks,{accountId:N,search:U}],enabled:W,queryFn:async({signal:e})=>{let t=new URLSearchParams({account:N,limit:`12`});return U.trim()&&t.set(`search`,U.trim()),ie(`/api/blocks?${t.toString()}`,{signal:e},ae,`Blocklist request failed`)},placeholderData:_,staleTime:5*6e4}),q=K.data?.items??[],J=K.data?.matches??[],Y=S({queryKey:[...b.blockSync,N],enabled:W,retry:!1,queryFn:async()=>{let e=await x({kind:`syncBlocks`,accountId:N});if(e.ok===!1||e.transport?.ok===!1)throw Error(e.transport?.output??`Block sync failed`);return await c.invalidateQueries({queryKey:b.blocks}),e},staleTime:5*6e4}),X=Y.isFetching,Z=V.error??K.error??Y.error??null,Q=z||(Z instanceof Error?Z.message:Z?`Unable to load blocklist`:``);(0,O.useEffect)(()=>{H?.accounts.length&&(H.accounts.some(e=>e.id===N)||M({...j,account:H.accounts[0]?.id??`acct_primary`},{replace:!0}))},[N,H]),(0,O.useEffect)(()=>{let e=Y.data;!e||e.transport?.output?.includes(`disabled`)||R(e.transport?.output??`Synced ${String(e.syncedCount??0)} remote blocks`)},[Y.data]);let oe=(0,O.useMemo)(()=>H?X?`Syncing remote blocklist · ${H.transport.statusText}`:`${String(q.length)} blocked profiles · ${H.transport.statusText}`:q.length>0?`${String(q.length)} blocked profiles · loading transport...`:`Loading local blocklist...`,[X,q.length,H]);async function $(e,t){let n=t.trim();if(n){I(!0),B(``),R(``);try{let t=await x({kind:e,accountId:N,query:n});if(t.ok===!1||t.transport?.ok===!1){B(t.transport?.output??`Blocklist action failed`);return}R(`${e===`blockProfile`?`Blocked`:`Unblocked`} @${t.profile?.handle??n.replace(/^@/,``)} · ${t.transport?.output??`local`}`),await c.invalidateQueries({queryKey:b.blocks})}catch(e){B(e instanceof Error?e.message:`Blocklist action failed`)}finally{I(!1)}}}return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`header`,{className:d,children:[(0,k.jsx)(`div`,{className:f,children:(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,k.jsx)(`h1`,{className:ee,children:`Blocks`}),(0,k.jsx)(`h2`,{className:o(a,`text-[14px]`),children:`Maintain a clean blocklist locally.`}),(0,k.jsx)(`p`,{className:a,children:oe})]})}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,k.jsx)(`select`,{className:o(re,ne),disabled:!G,onChange:e=>M({...j,account:e.target.value}),value:N,children:H?.accounts.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.handle},e.id))}),(0,k.jsx)(`input`,{className:o(n,`flex-1 min-w-[200px]`),disabled:!W,onChange:e=>M({...j,q:e.target.value},{replace:!0}),placeholder:`Handle, name, bio, or Twitter URL`,value:P}),(0,k.jsx)(`button`,{className:p,disabled:!W||F||!P.trim(),onClick:()=>void $(`blockProfile`,P),type:`button`,children:F?`Working...`:`Block`})]})]}),L?(0,k.jsx)(`p`,{className:u,children:L}):null,Q?(0,k.jsx)(`p`,{className:h,children:Q}):null,J.length>0?(0,k.jsxs)(`section`,{className:`flex flex-col`,children:[(0,k.jsx)(`h2`,{className:`px-4 pt-3 pb-1 text-[13px] font-semibold uppercase tracking-wide text-[var(--ink-soft)]`,children:`Search matches`}),J.map(e=>(0,k.jsxs)(`article`,{className:r,children:[(0,k.jsx)(w,{avatarUrl:e.profile.avatarUrl,hue:e.profile.avatarHue,name:e.profile.displayName,profileId:e.profile.id}),(0,k.jsxs)(`div`,{className:l,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,k.jsx)(`strong`,{className:`truncate text-[15px] text-[var(--ink)]`,children:e.profile.displayName}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[13px] text-[var(--ink-soft)]`,children:[(0,k.jsxs)(`span`,{children:[`@`,e.profile.handle]}),(0,k.jsx)(`span`,{className:i}),(0,k.jsxs)(`span`,{children:[C(e.profile.followersCount),` `,`followers`]})]})]}),(0,k.jsx)(`button`,{className:e.isBlocked?m:s,onClick:()=>void $(e.isBlocked?`unblockProfile`:`blockProfile`,e.profile.id),type:`button`,children:e.isBlocked?`Unblock`:`Block`})]}),(0,k.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:e.profile.bio})]})]},e.profile.id))]}):null,(0,k.jsxs)(`section`,{className:`flex flex-col`,children:[q.length===0&&J.length===0?(0,k.jsx)(`div`,{className:g,children:`No blocks in this account.`}):null,q.map(e=>(0,k.jsxs)(`article`,{className:r,children:[(0,k.jsx)(w,{avatarUrl:e.profile.avatarUrl,hue:e.profile.avatarHue,name:e.profile.displayName,profileId:e.profile.id}),(0,k.jsxs)(`div`,{className:l,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,k.jsx)(`strong`,{className:`truncate text-[15px] text-[var(--ink)]`,children:e.profile.displayName}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[13px] text-[var(--ink-soft)]`,children:[(0,k.jsxs)(`span`,{children:[`@`,e.profile.handle]}),(0,k.jsx)(`span`,{className:i}),(0,k.jsx)(`span`,{children:e.accountHandle}),(0,k.jsx)(`span`,{className:i}),(0,k.jsxs)(`span`,{children:[C(e.profile.followersCount),` `,`followers`]})]})]}),(0,k.jsx)(`button`,{className:m,onClick:()=>void $(`unblockProfile`,e.profile.id),type:`button`,children:`Unblock`})]}),e.profile.bio?(0,k.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:e.profile.bio}):null,(0,k.jsxs)(`p`,{className:te,children:[`Blocked `,new Date(e.blockedAt).toLocaleString(),` ·`,` `,e.source]})]})]},e.accountId+e.profile.id))]})]})}export{j as BlocksRouteView,A as component};
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{An as n,C as r,Ft as i,Gt as a,Kt as ee,M as o,Mn as te,N as s,Rn as c,S as l,Tn as u,Ut as d,Wt as f,Xt as p,cn as m,dt as h,jn as ne,pn as re,ut as g}from"./schemas-CMQMhQXI.js";import{A as _,a as v,b as y,n as b,r as ie,s as x,u as ae}from"./query-client-CA-do_IS.js";import{t as S}from"./useQuery-CL_NXLnc.js";import{r as C,t as w}from"./AvatarChip-DsHj3LT7.js";import{t as T}from"./useDebouncedValue-BJLRInUq.js";import{t as E}from"./route-search-CmZT7pGD.js";import{t as D}from"./blocks-qrevFiNI.js";var O=e(t()),k=c();function A(){let e=D.useSearch(),t=D.useNavigate();return(0,k.jsx)(j,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function j({searchState:e,onSearchChange:t}={}){let c=y(),[D,A]=(0,O.useState)(()=>E({})),j=e??D,M=(e,n)=>t?t(e,n):A(e),N=j.account,P=j.q,[F,I]=(0,O.useState)(!1),[L,R]=(0,O.useState)(``),[z,B]=(0,O.useState)(``),V=S({queryKey:b.status,queryFn:({signal:e})=>v({signal:e})}),H=V.data??null,U=T(P,180),W=N.trim().length>0,G=!!H,K=S({queryKey:[...b.blocks,{accountId:N,search:U}],enabled:W,queryFn:async({signal:e})=>{let t=new URLSearchParams({account:N,limit:`12`});return U.trim()&&t.set(`search`,U.trim()),ie(`/api/blocks?${t.toString()}`,{signal:e},ae,`Blocklist request failed`)},placeholderData:_,staleTime:5*6e4}),q=K.data?.items??[],J=K.data?.matches??[],Y=S({queryKey:[...b.blockSync,N],enabled:W,retry:!1,queryFn:async()=>{let e=await x({kind:`syncBlocks`,accountId:N});if(e.ok===!1||e.transport?.ok===!1)throw Error(e.transport?.output??`Block sync failed`);return await c.invalidateQueries({queryKey:b.blocks}),e},staleTime:5*6e4}),X=Y.isFetching,Z=V.error??K.error??Y.error??null,Q=z||(Z instanceof Error?Z.message:Z?`Unable to load blocklist`:``);(0,O.useEffect)(()=>{H?.accounts.length&&(H.accounts.some(e=>e.id===N)||M({...j,account:H.accounts[0]?.id??`acct_primary`},{replace:!0}))},[N,H]),(0,O.useEffect)(()=>{let e=Y.data;!e||e.transport?.output?.includes(`disabled`)||R(e.transport?.output??`Synced ${String(e.syncedCount??0)} remote blocks`)},[Y.data]);let oe=(0,O.useMemo)(()=>H?X?`Syncing remote blocklist · ${H.transport.statusText}`:`${String(q.length)} blocked profiles · ${H.transport.statusText}`:q.length>0?`${String(q.length)} blocked profiles · loading transport...`:`Loading local blocklist...`,[X,q.length,H]);async function $(e,t){let n=t.trim();if(n){I(!0),B(``),R(``);try{let t=await x({kind:e,accountId:N,query:n});if(t.ok===!1||t.transport?.ok===!1){B(t.transport?.output??`Blocklist action failed`);return}R(`${e===`blockProfile`?`Blocked`:`Unblocked`} @${t.profile?.handle??n.replace(/^@/,``)} · ${t.transport?.output??`local`}`),await c.invalidateQueries({queryKey:b.blocks})}catch(e){B(e instanceof Error?e.message:`Blocklist action failed`)}finally{I(!1)}}}return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`header`,{className:d,children:[(0,k.jsx)(`div`,{className:f,children:(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,k.jsx)(`h1`,{className:ee,children:`Blocks`}),(0,k.jsx)(`h2`,{className:o(a,`text-[14px]`),children:`Maintain a clean blocklist locally.`}),(0,k.jsx)(`p`,{className:a,children:oe})]})}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,k.jsx)(`select`,{className:o(re,ne),disabled:!G,onChange:e=>M({...j,account:e.target.value}),value:N,children:H?.accounts.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.handle},e.id))}),(0,k.jsx)(`input`,{className:o(n,`flex-1 min-w-[200px]`),disabled:!W,onChange:e=>M({...j,q:e.target.value},{replace:!0}),placeholder:`Handle, name, bio, or Twitter URL`,value:P}),(0,k.jsx)(`button`,{className:p,disabled:!W||F||!P.trim(),onClick:()=>void $(`blockProfile`,P),type:`button`,children:F?`Working...`:`Block`})]})]}),L?(0,k.jsx)(`p`,{className:u,children:L}):null,Q?(0,k.jsx)(`p`,{className:h,children:Q}):null,J.length>0?(0,k.jsxs)(`section`,{className:`flex flex-col`,children:[(0,k.jsx)(`h2`,{className:`px-4 pt-3 pb-1 text-[13px] font-semibold uppercase tracking-wide text-[var(--ink-soft)]`,children:`Search matches`}),J.map(e=>(0,k.jsxs)(`article`,{className:r,children:[(0,k.jsx)(w,{avatarUrl:e.profile.avatarUrl,hue:e.profile.avatarHue,name:e.profile.displayName,profileId:e.profile.id}),(0,k.jsxs)(`div`,{className:l,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,k.jsx)(`strong`,{className:`truncate text-[15px] text-[var(--ink)]`,children:e.profile.displayName}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[13px] text-[var(--ink-soft)]`,children:[(0,k.jsxs)(`span`,{children:[`@`,e.profile.handle]}),(0,k.jsx)(`span`,{className:i}),(0,k.jsxs)(`span`,{children:[C(e.profile.followersCount),` `,`followers`]})]})]}),(0,k.jsx)(`button`,{className:e.isBlocked?m:s,onClick:()=>void $(e.isBlocked?`unblockProfile`:`blockProfile`,e.profile.id),type:`button`,children:e.isBlocked?`Unblock`:`Block`})]}),(0,k.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:e.profile.bio})]})]},e.profile.id))]}):null,(0,k.jsxs)(`section`,{className:`flex flex-col`,children:[q.length===0&&J.length===0?(0,k.jsx)(`div`,{className:g,children:`No blocks in this account.`}):null,q.map(e=>(0,k.jsxs)(`article`,{className:r,children:[(0,k.jsx)(w,{avatarUrl:e.profile.avatarUrl,hue:e.profile.avatarHue,name:e.profile.displayName,profileId:e.profile.id}),(0,k.jsxs)(`div`,{className:l,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,k.jsx)(`strong`,{className:`truncate text-[15px] text-[var(--ink)]`,children:e.profile.displayName}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-[13px] text-[var(--ink-soft)]`,children:[(0,k.jsxs)(`span`,{children:[`@`,e.profile.handle]}),(0,k.jsx)(`span`,{className:i}),(0,k.jsx)(`span`,{children:e.accountHandle}),(0,k.jsx)(`span`,{className:i}),(0,k.jsxs)(`span`,{children:[C(e.profile.followersCount),` `,`followers`]})]})]}),(0,k.jsx)(`button`,{className:m,onClick:()=>void $(`unblockProfile`,e.profile.id),type:`button`,children:`Unblock`})]}),e.profile.bio?(0,k.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:e.profile.bio}):null,(0,k.jsxs)(`p`,{className:te,children:[`Blocked `,new Date(e.blockedAt).toLocaleString(),` ·`,` `,e.source]})]})]},e.accountId+e.profile.id))]})]})}export{j as BlocksRouteView,A as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/blocks-GWWj1dXr.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/AvatarChip-DsHj3LT7.js","assets/useDebouncedValue-BJLRInUq.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
2
+ import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as r}from"./schemas-CMQMhQXI.js";import"./query-client-CA-do_IS.js";import"./AvatarChip-DsHj3LT7.js";import{n as i,t as a}from"./preload-helper-MpqUbZCn.js";import"./useDebouncedValue-BJLRInUq.js";import{t as o}from"./route-search-CmZT7pGD.js";r(),e(),i();var s=t(`/blocks`)({component:n(()=>a(()=>import(`./blocks-GWWj1dXr.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),`component`),validateSearch:o});export{s as t};
@@ -1 +1 @@
1
- import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./SavedTimelineView-4QYaZ4CU.js";var n=e();function r(){return(0,n.jsx)(t,{eyebrow:`bookmarks`,filter:`bookmarked`,loadingLabel:`Loading bookmarks...`,searchPlaceholder:`Search bookmarks`,title:`Saved threads, receipts, and future rabbit holes.`})}export{r as component};
1
+ import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./SavedTimelineView-CFgHR6di.js";var n=e();function r(){return(0,n.jsx)(t,{eyebrow:`bookmarks`,filter:`bookmarked`,loadingLabel:`Loading bookmarks...`,searchPlaceholder:`Search bookmarks`,title:`Saved threads, receipts, and future rabbit holes.`})}export{r as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/discuss-C0CUMn6v.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/chevron-down-e-c5H12y.js","assets/createLucideIcon-CMLcIxOz.js","assets/circle-check-BCK_qvXt.js","assets/client-stream-contracts-CNz2FSrQ.js","assets/AvatarChip-DsHj3LT7.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js","assets/refresh-cw-IUfM9D_1.js","assets/search-C_LqodNa.js","assets/sparkles-Gx_BHkDX.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
2
- import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as r}from"./schemas-CMQMhQXI.js";import"./client-stream-contracts-CNz2FSrQ.js";import{n as i}from"./route-search-CmZT7pGD.js";import{n as a,t as o}from"./preload-helper-MpqUbZCn.js";r(),e(),a();var s=t(`/discuss`)({component:n(()=>o(()=>import(`./discuss-C0CUMn6v.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),`component`),validateSearch:i});export{s as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/discuss-ZvGdSAmA.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/chevron-down-e-c5H12y.js","assets/createLucideIcon-CMLcIxOz.js","assets/circle-check-BCK_qvXt.js","assets/client-stream-contracts-CNz2FSrQ.js","assets/AvatarChip-DsHj3LT7.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js","assets/refresh-cw-IUfM9D_1.js","assets/search-C_LqodNa.js","assets/sparkles-Gx_BHkDX.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
2
+ import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as r}from"./schemas-CMQMhQXI.js";import"./client-stream-contracts-CNz2FSrQ.js";import{n as i,t as a}from"./preload-helper-MpqUbZCn.js";import{n as o}from"./route-search-CmZT7pGD.js";r(),e(),i();var s=t(`/discuss`)({component:n(()=>a(()=>import(`./discuss-ZvGdSAmA.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14])),`component`),validateSearch:o});export{s as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{An as n,Gt as r,Ht as i,Kt as a,M as o,Rn as s,Ut as c,Wt as l,Xt as u,an as d,cn as f,dt as p,on as m,pn as h,sn as g}from"./schemas-CMQMhQXI.js";import{t as _}from"./chevron-down-e-c5H12y.js";import{t as v}from"./circle-check-BCK_qvXt.js";import{a as y,i as b,o as x,s as S,t as C}from"./client-stream-contracts-CNz2FSrQ.js";import{t as w}from"./refresh-cw-IUfM9D_1.js";import{t as T}from"./search-C_LqodNa.js";import{t as E}from"./sparkles-Gx_BHkDX.js";import{n as D}from"./route-search-CmZT7pGD.js";import{t as O}from"./discuss-DKC6H1fN.js";var k=e(t()),A=s(),j=[{value:`search`,label:`Live search`},{value:`all`,label:`All local`},{value:`home`,label:`Home`},{value:`mentions`,label:`Mentions`},{value:`authored`,label:`Authored`},{value:`likes`,label:`Likes`},{value:`bookmarks`,label:`Bookmarks`}],M=[{value:`auto`,label:`Auto`},{value:`bird`,label:`Bird`},{value:`xurl`,label:`xurl`},{value:`local`,label:`Local`}],N=2e4,P=200;function F(){return Error(`Discussion connection closed before completion. Retry to continue.`)}function I(e){return e instanceof Error?e.message:`Discussion failed`}function L(e,t){let n=new URL(`/api/search-discussion`,window.location.origin);return n.searchParams.set(`query`,e),n.searchParams.set(`source`,t.source),n.searchParams.set(`mode`,t.mode),n.searchParams.set(`includeDms`,String(t.includeDms)),n.searchParams.set(`limit`,String(N)),n.searchParams.set(`maxPages`,String(P)),t.question.trim()&&n.searchParams.set(`question`,t.question.trim()),t.refresh&&n.searchParams.set(`refresh`,`true`),n}function R({label:e,value:t,options:n,onChange:r}){return(0,A.jsxs)(`label`,{className:`relative min-w-0`,children:[(0,A.jsx)(`span`,{className:`pointer-events-none absolute left-3 top-1.5 z-10 text-[11px] font-semibold uppercase tracking-[0.08em] text-[var(--ink-soft)]`,children:e}),(0,A.jsx)(`select`,{"aria-label":e,className:o(h,`h-[54px] rounded-2xl bg-[var(--bg)] pb-1 pl-3 pr-9 pt-5 font-semibold text-[var(--ink)]`),value:t,onChange:e=>r(e.currentTarget.value),children:n.map(e=>(0,A.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,A.jsx)(_,{"aria-hidden":`true`,className:`pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-[var(--ink-soft)]`,strokeWidth:2})]})}function z(e){if(!e)return`Live keyword search with local memory.`;let t=e.counts;return[e.liveSearch?e.liveSearch.ok?`${e.liveSearch.source} ${String(e.liveSearch.count)} fetched`:`${e.liveSearch.source} failed`:`local`,`${String(t.search)} search`,`${String(t.home+t.mentions+t.authored)} timeline`,`${String(t.likes+t.bookmarks)} saved`,e.includeDms?`${String(t.dms)} DMs`:null].filter(Boolean).join(` · `)}function B(e,t,n,r,i){let[a,o]=(0,k.useState)(``),[s,c]=(0,k.useState)(null),[l,u]=(0,k.useState)(null),d=(0,k.useCallback)(()=>{o(``),c(null),u(null)},[]),{error:f,loading:p,run:m}=y({schema:b,request:(0,k.useCallback)((a,o)=>{let s=e.trim();return fetch(L(s,{source:t,mode:n,includeDms:r,question:i,refresh:o}),{signal:a})},[r,n,e,i,t]),onStart:d,onEvent:(0,k.useCallback)(e=>{if(e.type===`start`)c(e.context);else if(e.type===`delta`)o(t=>t+e.delta);else if(e.type===`done`)u(e.result),c(e.result.context),o(e.result.markdown);else if(e.type===`error`)throw Error(e.error)},[]),isTerminal:C,errorLabel:`Discussion request failed`,emptyBodyMessage:`Discussion request failed: empty response body`,prematureEofError:F,formatError:I});return{context:s,error:f,loading:p,markdown:a,result:l,run:(0,k.useCallback)((t=!1)=>{e.trim()&&m(t)},[e,m])}}function V(){let e=O.useSearch(),t=O.useNavigate();return(0,A.jsx)(H,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function H({searchState:e,onSearchChange:t}={}){let[s,h]=(0,k.useState)(()=>D({})),_=e??s,y=(e,n)=>t?t(e,n):h(e),{q:b,question:C,source:O,mode:N,includeDms:P}=_,[F,I]=(0,k.useState)(``),L=(0,k.useRef)(!1),{context:V,error:H,loading:U,markdown:W,result:G,run:K}=B(F,O,N,P,C),q=(0,k.useMemo)(()=>z(G?.context??V),[V,G]);function J(e){e.preventDefault();let t=b.trim();t&&(L.current=!0,I(t),t===F&&(L.current=!1,K(!1)))}return(0,k.useEffect)(()=>{!F||!L.current||(L.current=!1,K(!1))},[K,F]),(0,A.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,A.jsxs)(`header`,{className:c,children:[(0,A.jsxs)(`div`,{className:l,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:a,children:`Discuss`}),(0,A.jsx)(`p`,{className:r,children:q})]}),(0,A.jsx)(`div`,{className:i,children:(0,A.jsxs)(`button`,{type:`button`,className:f,onClick:()=>K(!0),disabled:U||!F,children:[(0,A.jsx)(w,{className:o(`size-4`,U&&`animate-spin`),"aria-hidden":`true`}),`Refresh`]})})]}),(0,A.jsxs)(`form`,{className:`grid gap-2 px-4 pb-3 md:grid-cols-[minmax(220px,1fr)_minmax(180px,0.8fr)_auto]`,onSubmit:J,children:[(0,A.jsxs)(`label`,{className:g,children:[(0,A.jsx)(T,{className:d,strokeWidth:2}),(0,A.jsx)(`input`,{className:m,placeholder:`Keywords`,value:b,onChange:e=>y({..._,q:e.currentTarget.value},{replace:!0})})]}),(0,A.jsx)(`input`,{className:n,placeholder:`Optional question`,value:C,onChange:e=>y({..._,question:e.currentTarget.value},{replace:!0})}),(0,A.jsxs)(`button`,{type:`submit`,className:u,disabled:U||!b.trim(),children:[(0,A.jsx)(E,{className:`size-4`,"aria-hidden":`true`}),`Discuss`]}),(0,A.jsxs)(`div`,{className:`grid gap-2 md:col-span-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,A.jsx)(R,{label:`Source`,options:j,value:O,onChange:e=>y({..._,source:e})}),(0,A.jsx)(R,{label:`Mode`,options:M,value:N,onChange:e=>y({..._,mode:e})}),(0,A.jsxs)(`label`,{className:`inline-flex h-[54px] items-center gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:P,onChange:e=>y({..._,includeDms:e.currentTarget.checked})}),`DMs`]})]})]})]}),H?(0,A.jsx)(`div`,{className:p,children:H}):null,(0,A.jsx)(`div`,{className:`border-b border-[var(--line)] px-4 py-2 text-[13px] text-[var(--ink-soft)]`,children:(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[U?(0,A.jsx)(S,{className:`size-4 animate-spin`,"aria-hidden":`true`}):W?(0,A.jsx)(v,{className:`size-4`,"aria-hidden":`true`}):(0,A.jsx)(E,{className:`size-4`,"aria-hidden":`true`}),U?`Searching and streaming`:G?`${G.cached?`Cached`:`Ready`} · ${G.context.query}`:`Ready`]})}),W?(0,A.jsx)(x,{context:G?.context??V,markdown:W}):(0,A.jsx)(`div`,{className:`px-4 py-5 text-[14px] text-[var(--ink-soft)]`,children:U?`Waiting for the first tokens...`:`Search to begin.`})]})}export{H as DiscussRouteView,V as component};
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{An as n,Gt as r,Ht as i,Kt as a,M as o,Rn as s,Ut as c,Wt as l,Xt as u,an as d,cn as f,dt as p,on as m,pn as h,sn as g}from"./schemas-CMQMhQXI.js";import{t as _}from"./chevron-down-e-c5H12y.js";import{t as v}from"./circle-check-BCK_qvXt.js";import{a as y,i as b,o as x,s as S,t as C}from"./client-stream-contracts-CNz2FSrQ.js";import{t as w}from"./refresh-cw-IUfM9D_1.js";import{t as T}from"./search-C_LqodNa.js";import{t as E}from"./sparkles-Gx_BHkDX.js";import{n as D}from"./route-search-CmZT7pGD.js";import{t as O}from"./discuss-BeFPn8mN.js";var k=e(t()),A=s(),j=[{value:`search`,label:`Live search`},{value:`all`,label:`All local`},{value:`home`,label:`Home`},{value:`mentions`,label:`Mentions`},{value:`authored`,label:`Authored`},{value:`likes`,label:`Likes`},{value:`bookmarks`,label:`Bookmarks`}],M=[{value:`auto`,label:`Auto`},{value:`bird`,label:`Bird`},{value:`xurl`,label:`xurl`},{value:`local`,label:`Local`}],N=2e4,P=200;function F(){return Error(`Discussion connection closed before completion. Retry to continue.`)}function I(e){return e instanceof Error?e.message:`Discussion failed`}function L(e,t){let n=new URL(`/api/search-discussion`,window.location.origin);return n.searchParams.set(`query`,e),n.searchParams.set(`source`,t.source),n.searchParams.set(`mode`,t.mode),n.searchParams.set(`includeDms`,String(t.includeDms)),n.searchParams.set(`limit`,String(N)),n.searchParams.set(`maxPages`,String(P)),t.question.trim()&&n.searchParams.set(`question`,t.question.trim()),t.refresh&&n.searchParams.set(`refresh`,`true`),n}function R({label:e,value:t,options:n,onChange:r}){return(0,A.jsxs)(`label`,{className:`relative min-w-0`,children:[(0,A.jsx)(`span`,{className:`pointer-events-none absolute left-3 top-1.5 z-10 text-[11px] font-semibold uppercase tracking-[0.08em] text-[var(--ink-soft)]`,children:e}),(0,A.jsx)(`select`,{"aria-label":e,className:o(h,`h-[54px] rounded-2xl bg-[var(--bg)] pb-1 pl-3 pr-9 pt-5 font-semibold text-[var(--ink)]`),value:t,onChange:e=>r(e.currentTarget.value),children:n.map(e=>(0,A.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,A.jsx)(_,{"aria-hidden":`true`,className:`pointer-events-none absolute right-3 top-1/2 size-4 -translate-y-1/2 text-[var(--ink-soft)]`,strokeWidth:2})]})}function z(e){if(!e)return`Live keyword search with local memory.`;let t=e.counts;return[e.liveSearch?e.liveSearch.ok?`${e.liveSearch.source} ${String(e.liveSearch.count)} fetched`:`${e.liveSearch.source} failed`:`local`,`${String(t.search)} search`,`${String(t.home+t.mentions+t.authored)} timeline`,`${String(t.likes+t.bookmarks)} saved`,e.includeDms?`${String(t.dms)} DMs`:null].filter(Boolean).join(` · `)}function B(e,t,n,r,i){let[a,o]=(0,k.useState)(``),[s,c]=(0,k.useState)(null),[l,u]=(0,k.useState)(null),d=(0,k.useCallback)(()=>{o(``),c(null),u(null)},[]),{error:f,loading:p,run:m}=y({schema:b,request:(0,k.useCallback)((a,o)=>{let s=e.trim();return fetch(L(s,{source:t,mode:n,includeDms:r,question:i,refresh:o}),{signal:a})},[r,n,e,i,t]),onStart:d,onEvent:(0,k.useCallback)(e=>{if(e.type===`start`)c(e.context);else if(e.type===`delta`)o(t=>t+e.delta);else if(e.type===`done`)u(e.result),c(e.result.context),o(e.result.markdown);else if(e.type===`error`)throw Error(e.error)},[]),isTerminal:C,errorLabel:`Discussion request failed`,emptyBodyMessage:`Discussion request failed: empty response body`,prematureEofError:F,formatError:I});return{context:s,error:f,loading:p,markdown:a,result:l,run:(0,k.useCallback)((t=!1)=>{e.trim()&&m(t)},[e,m])}}function V(){let e=O.useSearch(),t=O.useNavigate();return(0,A.jsx)(H,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function H({searchState:e,onSearchChange:t}={}){let[s,h]=(0,k.useState)(()=>D({})),_=e??s,y=(e,n)=>t?t(e,n):h(e),{q:b,question:C,source:O,mode:N,includeDms:P}=_,[F,I]=(0,k.useState)(``),L=(0,k.useRef)(!1),{context:V,error:H,loading:U,markdown:W,result:G,run:K}=B(F,O,N,P,C),q=(0,k.useMemo)(()=>z(G?.context??V),[V,G]);function J(e){e.preventDefault();let t=b.trim();t&&(L.current=!0,I(t),t===F&&(L.current=!1,K(!1)))}return(0,k.useEffect)(()=>{!F||!L.current||(L.current=!1,K(!1))},[K,F]),(0,A.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,A.jsxs)(`header`,{className:c,children:[(0,A.jsxs)(`div`,{className:l,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h1`,{className:a,children:`Discuss`}),(0,A.jsx)(`p`,{className:r,children:q})]}),(0,A.jsx)(`div`,{className:i,children:(0,A.jsxs)(`button`,{type:`button`,className:f,onClick:()=>K(!0),disabled:U||!F,children:[(0,A.jsx)(w,{className:o(`size-4`,U&&`animate-spin`),"aria-hidden":`true`}),`Refresh`]})})]}),(0,A.jsxs)(`form`,{className:`grid gap-2 px-4 pb-3 md:grid-cols-[minmax(220px,1fr)_minmax(180px,0.8fr)_auto]`,onSubmit:J,children:[(0,A.jsxs)(`label`,{className:g,children:[(0,A.jsx)(T,{className:d,strokeWidth:2}),(0,A.jsx)(`input`,{className:m,placeholder:`Keywords`,value:b,onChange:e=>y({..._,q:e.currentTarget.value},{replace:!0})})]}),(0,A.jsx)(`input`,{className:n,placeholder:`Optional question`,value:C,onChange:e=>y({..._,question:e.currentTarget.value},{replace:!0})}),(0,A.jsxs)(`button`,{type:`submit`,className:u,disabled:U||!b.trim(),children:[(0,A.jsx)(E,{className:`size-4`,"aria-hidden":`true`}),`Discuss`]}),(0,A.jsxs)(`div`,{className:`grid gap-2 md:col-span-3 md:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]`,children:[(0,A.jsx)(R,{label:`Source`,options:j,value:O,onChange:e=>y({..._,source:e})}),(0,A.jsx)(R,{label:`Mode`,options:M,value:N,onChange:e=>y({..._,mode:e})}),(0,A.jsxs)(`label`,{className:`inline-flex h-[54px] items-center gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:P,onChange:e=>y({..._,includeDms:e.currentTarget.checked})}),`DMs`]})]})]})]}),H?(0,A.jsx)(`div`,{className:p,children:H}):null,(0,A.jsx)(`div`,{className:`border-b border-[var(--line)] px-4 py-2 text-[13px] text-[var(--ink-soft)]`,children:(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[U?(0,A.jsx)(S,{className:`size-4 animate-spin`,"aria-hidden":`true`}):W?(0,A.jsx)(v,{className:`size-4`,"aria-hidden":`true`}):(0,A.jsx)(E,{className:`size-4`,"aria-hidden":`true`}),U?`Searching and streaming`:G?`${G.cached?`Cached`:`Ready`} · ${G.context.query}`:`Ready`]})}),W?(0,A.jsx)(x,{context:G?.context??V,markdown:W}):(0,A.jsx)(`div`,{className:`px-4 py-5 text-[14px] text-[var(--ink-soft)]`,children:U?`Waiting for the first tokens...`:`Search to begin.`})]})}export{H as DiscussRouteView,V as component};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Dn as n,Gt as r,Kt as i,M as a,Mn as o,On as s,Rn as c,Ut as l,Wt as u,an as d,dn as f,fn as p,kn as ee,on as te,sn as ne}from"./schemas-CMQMhQXI.js";import{t as re}from"./search-C_LqodNa.js";import{A as ie,a as ae,b as m,d as h,n as g,r as _,s as v}from"./query-client-CA-do_IS.js";import{t as y}from"./useQuery-CL_NXLnc.js";import{i as b,r as oe}from"./account-selection-h7m9xmzU.js";import{n as se,r as ce,t as le}from"./FeedState-DhMv4zXD.js";import{t as ue}from"./useDebouncedValue-BJLRInUq.js";import{r as x}from"./route-search-CmZT7pGD.js";import{n as de,t as S}from"./dms-DBexFtGg.js";import{t as C}from"./SyncNowButton-DDYT2jQT.js";var w=e(t()),T=c(),E=[{value:`all`,label:`All`},{value:`unreplied`,label:`Unreplied`},{value:`replied`,label:`Replied`}],fe=[{value:`recent`,label:`Newest`},{value:`followers`,label:`Followers`}],pe=[{value:`all`,label:`All`},{value:`accepted`,label:`Accepted`},{value:`requests`,label:`Requests`}],D=`flex h-[46px] shrink-0 items-center gap-2 rounded-md border border-[var(--line)] bg-[var(--bg)] px-3 py-0 text-[14px] text-[var(--ink)] outline-none transition-colors duration-150 focus-within:border-[var(--accent)] focus-within:shadow-[0_0_0_1px_var(--accent)]`;function O(){let e=S.useSearch(),t=S.useNavigate();return(0,T.jsx)(k,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function k({searchState:e,onSearchChange:t}={}){let c=m(),[S,O]=(0,w.useState)(()=>x({})),k=e??S,A=(e,n)=>t?t(e,n):O(e),j=k.inbox,M=k.reply,N=k.minFollowers,P=k.minInfluence,F=k.sort,I=k.q,L=k.conversation||void 0,[R,z]=(0,w.useState)(``),B=y({queryKey:g.status,queryFn:({signal:e})=>ae({signal:e})}).data??null,V=oe(B?.accounts),H=ue(I,180),U=[...g.dms,{inboxFilter:j,replyFilter:M,minFollowers:N,minInfluenceScore:P,sort:F,search:H,selectedAccountId:V??null,selectedConversationId:L??null}],W=y({queryKey:U,queryFn:({signal:e})=>{let t=new URL(`/api/query`,window.location.origin);return t.searchParams.set(`resource`,`dms`),t.searchParams.set(`inbox`,j),t.searchParams.set(`replyFilter`,M),t.searchParams.set(`sort`,F),N.trim()&&t.searchParams.set(`minFollowers`,N.trim()),P.trim()&&t.searchParams.set(`minInfluenceScore`,P.trim()),V&&j!==`requests`&&t.searchParams.set(`account`,V),L&&t.searchParams.set(`conversationId`,L),H.trim()&&t.searchParams.set(`search`,H.trim()),_(t,{signal:e},h,`Direct messages unavailable`)},placeholderData:ie,staleTime:5*6e4}),G=W.data,K=G?.resource===`dms`?G:null,q=K?.items??[],me=K?.selectedConversation?.messages??[],J=K?.selectedConversation?.conversation.id;(0,w.useEffect)(()=>{if(!W.data)return;let e=J??q[0]?.id,t=L&&q.some(e=>e.id===L)?L:e;t&&t!==L&&A({...k,conversation:t},{replace:!0})},[W.data,q,J]);let Y=q.find(e=>e.id===L)??null,he=!!(!W.isError&&L&&J&&L!==J),X=(0,w.useMemo)(()=>B?`${String(B.stats.dms)} conversations cached locally`:`Loading direct messages...`,[B]),Z=b({mutationFn:({conversationId:e,text:t})=>v({kind:`replyDm`,conversationId:e,text:t}),onMutate:async({conversationId:e,text:t})=>{await c.cancelQueries({queryKey:U});let n=c.getQueryData(U);if(!n||n.resource!==`dms`||!Y)return{previous:n};let r=new Date().toISOString(),i=B?.accounts.find(e=>e.id===Y.accountId),a=(i?.handle??Y.accountHandle).replace(/^@/,``),o={id:`optimistic-${r}`,conversationId:e,text:t,createdAt:r,direction:`outbound`,isReplied:!0,mediaCount:0,sender:{id:`local-${Y.accountId}`,handle:a,displayName:i?.name??a,bio:``,followersCount:0,avatarHue:18,createdAt:r}};return c.setQueryData(U,{...n,items:n.items.map(n=>n.id===e?{...n,lastMessageAt:r,lastMessagePreview:t,needsReply:!1,unreadCount:0}:n),selectedConversation:n.selectedConversation?{...n.selectedConversation,messages:[...n.selectedConversation.messages,o]}:n.selectedConversation}),{previous:n}},onError:(e,t,n)=>{n?.previous&&c.setQueryData(U,n.previous)},onSettled:()=>Promise.all([c.invalidateQueries({queryKey:g.dms}),c.invalidateQueries({queryKey:g.status})])});async function ge(e){let t=R.trim();if(!(!t||!Y)){z(``);try{await Z.mutateAsync({conversationId:e,text:t}),A({...k,conversation:e})}catch{z(t)}}}function _e(){Promise.all([c.invalidateQueries({queryKey:g.dms}),c.invalidateQueries({queryKey:g.status})])}let ve=W.isPending,Q=W.error?W.error instanceof Error?W.error.message:`Messages unavailable`:null,$=Z.error?Z.error instanceof Error?Z.error.message:`Reply failed`:null;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`header`,{className:l,children:[(0,T.jsxs)(`div`,{className:u,children:[(0,T.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,T.jsx)(`h1`,{className:i,children:`Messages`}),(0,T.jsx)(`p`,{className:r,children:X})]}),(0,T.jsx)(C,{accounts:B?.accounts,kind:`dms`,label:`Sync DMs`,onSynced:_e,syncOptions:{inbox:j,limit:j===`requests`?200:50,maxPages:j===`requests`?3:1}})]}),(0,T.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,T.jsx)(`div`,{className:p,"aria-label":`DM inbox`,children:pe.map(e=>(0,T.jsx)(`button`,{"aria-pressed":j===e.value,className:a(f,j===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>A({...k,inbox:e.value}),type:`button`,children:e.label},e.value))}),(0,T.jsxs)(`label`,{className:a(ne,`flex-1 min-w-[200px]`),children:[(0,T.jsx)(re,{className:d,strokeWidth:2}),(0,T.jsx)(`input`,{className:te,onChange:e=>A({...k,q:e.target.value},{replace:!0}),placeholder:`Search DMs`,value:I})]}),(0,T.jsxs)(`label`,{className:a(D,`w-[156px]`),children:[(0,T.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-[var(--ink-soft)]`,children:`Followers`}),(0,T.jsx)(`input`,{className:`min-w-0 flex-1 border-0 bg-transparent text-right text-[14px] text-[var(--ink)] outline-none placeholder:text-[var(--ink-soft)]`,inputMode:`numeric`,onChange:e=>A({...k,minFollowers:e.target.value},{replace:!0}),placeholder:`Any`,value:N})]}),(0,T.jsxs)(`label`,{className:a(D,`w-[132px]`),children:[(0,T.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-[var(--ink-soft)]`,children:`Score`}),(0,T.jsx)(`input`,{className:`min-w-0 flex-1 border-0 bg-transparent text-right text-[14px] text-[var(--ink)] outline-none placeholder:text-[var(--ink-soft)]`,inputMode:`numeric`,onChange:e=>A({...k,minInfluence:e.target.value},{replace:!0}),placeholder:`Any`,value:P})]}),(0,T.jsx)(`div`,{className:p,children:fe.map(e=>(0,T.jsx)(`button`,{className:a(f,e.value===F&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>A({...k,sort:e.value}),type:`button`,children:e.label},e.value))})]}),(0,T.jsx)(`div`,{className:ee,"aria-label":`DM reply filter`,children:E.map(e=>{let t=M===e.value;return(0,T.jsx)(`button`,{type:`button`,"aria-pressed":t,className:a(n,t&&`text-[var(--ink)] font-bold`),onClick:()=>A({...k,reply:e.value}),children:(0,T.jsxs)(`span`,{className:`relative inline-flex flex-col items-center justify-center py-1`,children:[e.value,t?(0,T.jsx)(`span`,{className:s}):null]})},e.value)})})]}),$?(0,T.jsx)(`p`,{className:a(o,`px-4 py-2 text-red-500`),children:$}):null,ve&&q.length===0||he?(0,T.jsx)(ce,{detail:`Reading local conversations and reply state`,label:`Loading messages`}):Q?(0,T.jsx)(se,{action:(0,T.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:()=>void W.refetch(),type:`button`,children:`Retry`}),message:Q,title:`Could not load messages`}):q.length===0?(0,T.jsx)(le,{detail:`Sync DMs or broaden the filters to find a conversation.`,label:`No conversations in this view`}):(0,T.jsx)(de,{conversations:q,onReplyDraftChange:z,onReplySend:ge,onSelectConversation:e=>A({...k,conversation:e}),replyDraft:R,selectedConversation:Y,selectedMessages:me})]})}export{k as DmsRouteView,O as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dms-DWA5tvJS.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/search-C_LqodNa.js","assets/createLucideIcon-CMLcIxOz.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/account-selection-h7m9xmzU.js","assets/FeedState-DhMv4zXD.js","assets/route-search-CmZT7pGD.js","assets/SyncNowButton-DDYT2jQT.js","assets/refresh-cw-IUfM9D_1.js","assets/useDebouncedValue-BJLRInUq.js"])))=>i.map(i=>d[i]);
2
- import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{$ as r,A as i,B as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,Jt as p,K as m,L as h,M as g,Mn as _,P as v,Q as y,R as b,Rn as x,U as S,V as C,W as w,X as T,Xt as E,Yt as D,Z as O,et as k,j as A,k as j,nt as M,q as N,qt as P,tt as F}from"./schemas-CMQMhQXI.js";import{t as I}from"./circle-check-BCK_qvXt.js";import{t as L}from"./circle-DiJUdlek.js";import"./query-client-CA-do_IS.js";import"./account-selection-h7m9xmzU.js";import{r as R,t as z}from"./AvatarChip-DsHj3LT7.js";import{o as B}from"./FeedState-DhMv4zXD.js";import{t as V}from"./SmartTimestamp-CXaNLqN7.js";import{r as H}from"./route-search-CmZT7pGD.js";import{n as U,t as W}from"./preload-helper-MpqUbZCn.js";import"./SyncNowButton-DDYT2jQT.js";import"./useDebouncedValue-BJLRInUq.js";e();var G=x();function K({message:e}){let t=e.direction===`outbound`;return(0,G.jsxs)(`div`,{className:g(f,t&&`self-end items-end`),children:[(0,G.jsx)(`div`,{className:g(w,t?m:l),children:e.text}),(0,G.jsxs)(`div`,{className:N,children:[(0,G.jsx)(`span`,{children:e.sender.displayName}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(V,{value:e.createdAt})]})]})}function q({conversations:e,selectedConversation:t,selectedMessages:n,onSelectConversation:l,replyDraft:f,onReplyDraftChange:m,onReplySend:x}){let w=t?.participant??null,N=t?t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`:null;return(0,G.jsxs)(`section`,{"aria-label":`DM workspace`,className:O,children:[(0,G.jsxs)(`aside`,{className:d,children:[e.length===0?(0,G.jsx)(B,{detail:`Sync DMs to populate this lane.`,label:`No conversations`}):null,e.map(e=>(0,G.jsxs)(`button`,{className:g(a,e.id===t?.id&&`bg-[var(--bg-active)]`),onClick:()=>l(e.id),type:`button`,children:[(0,G.jsx)(z,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,G.jsxs)(`div`,{className:c,children:[(0,G.jsxs)(`div`,{className:b,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:C,children:e.participant.displayName}),(0,G.jsxs)(`span`,{className:h,children:[`@`,e.participant.handle]})]}),(0,G.jsx)(V,{className:S,value:e.lastMessageAt})]}),(0,G.jsx)(`p`,{className:u,children:e.lastMessagePreview}),(0,G.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:g(p,e.needsReply?P:D),"aria-label":e.needsReply?`Reply open`:`We replied`,children:[e.needsReply?(0,G.jsx)(L,{className:`size-3`,strokeWidth:2.2}):(0,G.jsx)(I,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]}),e.isMessageRequest?(0,G.jsx)(`span`,{className:g(p,P),children:`request`}):null,(0,G.jsxs)(`span`,{className:g(p,D),children:[R(e.participant.followersCount),` `,`followers`]})]})]})]},e.id))]}),(0,G.jsx)(`div`,{className:y,children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:r,children:[(0,G.jsxs)(`div`,{className:M,children:[(0,G.jsx)(z,{avatarUrl:w?.avatarUrl,hue:w?.avatarHue??18,name:w?.displayName??`Unknown`,profileId:w?.id??void 0}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:k,children:t.participant.displayName}),(0,G.jsx)(`div`,{className:F,children:N&&t?(0,G.jsxs)(G.Fragment,{children:[N,` · last message`,` `,(0,G.jsx)(V,{value:t.lastMessageAt})]}):`No conversation selected`})]})]}),(0,G.jsx)(`button`,{className:E,onClick:()=>x(t.id),type:`button`,children:`Reply`})]}),w?.bio||w?.followersCount?(0,G.jsxs)(`div`,{className:`border-b border-[var(--line)] px-4 py-3`,children:[w?.bio?(0,G.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:w.bio}):null,(0,G.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-1 text-[13px]`,children:[(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Followers`}),(0,G.jsx)(`dd`,{className:A,children:R(w?.followersCount??0)})]}),(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Influence`}),(0,G.jsxs)(`dd`,{className:A,children:[t.influenceScore,` ·`,` `,t.influenceLabel]})]}),(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Reply state`}),(0,G.jsx)(`dd`,{className:A,children:t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`})]}),(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Account`}),(0,G.jsx)(`dd`,{className:A,children:t.accountHandle})]})]})]}):null,(0,G.jsx)(`div`,{className:T,children:n.map(e=>(0,G.jsx)(K,{message:e},e.id))}),(0,G.jsxs)(`div`,{className:v,children:[(0,G.jsx)(`textarea`,{className:o,onChange:e=>m(e.target.value),placeholder:`Reply to @${t.participant.handle}`,rows:3,value:f}),(0,G.jsxs)(`div`,{className:s,children:[(0,G.jsx)(`span`,{className:_,children:t.needsReply?`Reply open`:`We replied`}),(0,G.jsx)(`button`,{className:E,disabled:!f.trim(),onClick:()=>x(t.id),type:`button`,children:`Send reply`})]})]})]}):(0,G.jsx)(B,{detail:`Pick a conversation to read the thread.`,label:`No DM selected`})})]})}U();var J=t(`/dms`)({component:n(()=>W(()=>import(`./dms-DWA5tvJS.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),`component`),validateSearch:H});export{q as n,J as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dms-CMp6bAR_.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/search-C_LqodNa.js","assets/createLucideIcon-CMLcIxOz.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/account-selection-h7m9xmzU.js","assets/FeedState-DhMv4zXD.js","assets/useDebouncedValue-BJLRInUq.js","assets/route-search-CmZT7pGD.js","assets/SyncNowButton-DDYT2jQT.js","assets/refresh-cw-IUfM9D_1.js"])))=>i.map(i=>d[i]);
2
+ import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{n as t,t as n}from"./lazyRouteComponent-CLLbUvMd.js";import{$ as r,A as i,B as a,D as o,E as s,F as c,G as l,H as u,I as d,J as f,Jt as p,K as m,L as h,M as g,Mn as _,P as v,Q as y,R as b,Rn as x,U as S,V as C,W as w,X as T,Xt as E,Yt as D,Z as O,et as k,j as A,k as j,nt as M,q as N,qt as P,tt as F}from"./schemas-CMQMhQXI.js";import{t as I}from"./circle-check-BCK_qvXt.js";import{t as L}from"./circle-DiJUdlek.js";import"./query-client-CA-do_IS.js";import"./account-selection-h7m9xmzU.js";import{r as R,t as z}from"./AvatarChip-DsHj3LT7.js";import{o as B}from"./FeedState-DhMv4zXD.js";import{n as V,t as H}from"./preload-helper-MpqUbZCn.js";import"./useDebouncedValue-BJLRInUq.js";import{r as U}from"./route-search-CmZT7pGD.js";import{t as W}from"./SmartTimestamp-CXaNLqN7.js";import"./SyncNowButton-DDYT2jQT.js";e();var G=x();function K({message:e}){let t=e.direction===`outbound`;return(0,G.jsxs)(`div`,{className:g(f,t&&`self-end items-end`),children:[(0,G.jsx)(`div`,{className:g(w,t?m:l),children:e.text}),(0,G.jsxs)(`div`,{className:N,children:[(0,G.jsx)(`span`,{children:e.sender.displayName}),(0,G.jsx)(`span`,{children:`·`}),(0,G.jsx)(W,{value:e.createdAt})]})]})}function q({conversations:e,selectedConversation:t,selectedMessages:n,onSelectConversation:l,replyDraft:f,onReplyDraftChange:m,onReplySend:x}){let w=t?.participant??null,N=t?t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`:null;return(0,G.jsxs)(`section`,{"aria-label":`DM workspace`,className:O,children:[(0,G.jsxs)(`aside`,{className:d,children:[e.length===0?(0,G.jsx)(B,{detail:`Sync DMs to populate this lane.`,label:`No conversations`}):null,e.map(e=>(0,G.jsxs)(`button`,{className:g(a,e.id===t?.id&&`bg-[var(--bg-active)]`),onClick:()=>l(e.id),type:`button`,children:[(0,G.jsx)(z,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,G.jsxs)(`div`,{className:c,children:[(0,G.jsxs)(`div`,{className:b,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,G.jsx)(`span`,{className:C,children:e.participant.displayName}),(0,G.jsxs)(`span`,{className:h,children:[`@`,e.participant.handle]})]}),(0,G.jsx)(W,{className:S,value:e.lastMessageAt})]}),(0,G.jsx)(`p`,{className:u,children:e.lastMessagePreview}),(0,G.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{className:g(p,e.needsReply?P:D),"aria-label":e.needsReply?`Reply open`:`We replied`,children:[e.needsReply?(0,G.jsx)(L,{className:`size-3`,strokeWidth:2.2}):(0,G.jsx)(I,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]}),e.isMessageRequest?(0,G.jsx)(`span`,{className:g(p,P),children:`request`}):null,(0,G.jsxs)(`span`,{className:g(p,D),children:[R(e.participant.followersCount),` `,`followers`]})]})]})]},e.id))]}),(0,G.jsx)(`div`,{className:y,children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:r,children:[(0,G.jsxs)(`div`,{className:M,children:[(0,G.jsx)(z,{avatarUrl:w?.avatarUrl,hue:w?.avatarHue??18,name:w?.displayName??`Unknown`,profileId:w?.id??void 0}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`div`,{className:k,children:t.participant.displayName}),(0,G.jsx)(`div`,{className:F,children:N&&t?(0,G.jsxs)(G.Fragment,{children:[N,` · last message`,` `,(0,G.jsx)(W,{value:t.lastMessageAt})]}):`No conversation selected`})]})]}),(0,G.jsx)(`button`,{className:E,onClick:()=>x(t.id),type:`button`,children:`Reply`})]}),w?.bio||w?.followersCount?(0,G.jsxs)(`div`,{className:`border-b border-[var(--line)] px-4 py-3`,children:[w?.bio?(0,G.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:w.bio}):null,(0,G.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-1 text-[13px]`,children:[(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Followers`}),(0,G.jsx)(`dd`,{className:A,children:R(w?.followersCount??0)})]}),(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Influence`}),(0,G.jsxs)(`dd`,{className:A,children:[t.influenceScore,` ·`,` `,t.influenceLabel]})]}),(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Reply state`}),(0,G.jsx)(`dd`,{className:A,children:t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`})]}),(0,G.jsxs)(`div`,{className:j,children:[(0,G.jsx)(`dt`,{className:i,children:`Account`}),(0,G.jsx)(`dd`,{className:A,children:t.accountHandle})]})]})]}):null,(0,G.jsx)(`div`,{className:T,children:n.map(e=>(0,G.jsx)(K,{message:e},e.id))}),(0,G.jsxs)(`div`,{className:v,children:[(0,G.jsx)(`textarea`,{className:o,onChange:e=>m(e.target.value),placeholder:`Reply to @${t.participant.handle}`,rows:3,value:f}),(0,G.jsxs)(`div`,{className:s,children:[(0,G.jsx)(`span`,{className:_,children:t.needsReply?`Reply open`:`We replied`}),(0,G.jsx)(`button`,{className:E,disabled:!f.trim(),onClick:()=>x(t.id),type:`button`,children:`Send reply`})]})]})]}):(0,G.jsx)(B,{detail:`Pick a conversation to read the thread.`,label:`No DM selected`})})]})}V();var J=t(`/dms`)({component:n(()=>H(()=>import(`./dms-CMp6bAR_.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13])),`component`),validateSearch:U});export{q as n,J as t};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{An as n,Dn as r,Gt as i,Kt as a,M as o,Mn as s,On as c,Rn as l,Ut as u,Wt as d,Xt as f,cn as p,ht as m,jn as h,kn as g,ut as _}from"./schemas-CMQMhQXI.js";import{t as v}from"./sparkles-Gx_BHkDX.js";import{A as y,a as b,b as ee,f as x,n as S,r as C,s as w}from"./query-client-CA-do_IS.js";import{t as T}from"./useQuery-CL_NXLnc.js";import{i as E,r as D}from"./account-selection-h7m9xmzU.js";import{i as O}from"./route-search-CmZT7pGD.js";import{n as k,t as A}from"./inbox-DjlVjj3K.js";var j=e(t()),M=l(),N=[{value:`mixed`,label:`Mixed`},{value:`mentions`,label:`Mentions`},{value:`dms`,label:`DMs`}];function P(){let e=A.useSearch(),t=A.useNavigate();return(0,M.jsx)(F,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function F({searchState:e,onSearchChange:t}={}){let l=ee(),[A,P]=(0,j.useState)(()=>O({})),F=e??A,I=(e,n)=>t?t(e,n):P(e),{kind:L,minScore:R,hideLowSignal:z}=F,[B,V]=(0,j.useState)(null),[H,U]=(0,j.useState)(``),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(null),J=T({queryKey:S.status,queryFn:({signal:e})=>b({signal:e})}).data??null,Y=D(J?.accounts),X=T({queryKey:[...S.inbox,{hideLowSignal:z,kind:L,minScore:R,selectedAccountId:Y??null}],queryFn:async({signal:e})=>{let t=new URL(`/api/inbox`,window.location.origin);return t.searchParams.set(`kind`,L),t.searchParams.set(`minScore`,R),Y&&t.searchParams.set(`account`,Y),z&&t.searchParams.set(`hideLowSignal`,`1`),C(t,{signal:e},x,`Inbox request failed`)},placeholderData:y,staleTime:5*6e4}),Z=X.data?.items??[],Q=X.data?.stats??null,$=E({mutationFn:()=>w({kind:`scoreInbox`,scoreKind:L,account:Y,limit:8}),onSuccess:()=>l.invalidateQueries({queryKey:S.inbox})}),te=(0,j.useMemo)(()=>!J||!Q?`Ranking unreplied mentions and DMs...`:`${String(Q.total)} in queue · ${String(Q.openai)} OpenAI scored · ${J.transport.statusText}`,[J,Q]);async function ne(){await $.mutateAsync()}async function re(e){if(H.trim()){G(!0),q(null);try{await w(e.entityKind===`dm`?{kind:`replyDm`,conversationId:e.entityId,text:H}:{kind:`replyTweet`,accountId:e.accountId,tweetId:e.entityId,text:H}),U(``),V(null),await l.invalidateQueries({queryKey:S.inbox})}catch(e){q(e instanceof Error?e.message:`Reply failed`)}finally{G(!1)}}}return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`header`,{className:u,children:[(0,M.jsxs)(`div`,{className:d,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,M.jsx)(`h1`,{className:a,children:`Inbox`}),(0,M.jsx)(`p`,{className:i,children:te})]}),(0,M.jsxs)(`button`,{className:f,disabled:$.isPending,onClick:()=>void ne(),type:`button`,children:[(0,M.jsx)(v,{className:`size-4`,strokeWidth:2.2}),$.isPending?`Scoring...`:`Score with OpenAI`]})]}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,M.jsx)(`input`,{className:o(n,h),inputMode:`numeric`,onChange:e=>I({...F,minScore:e.target.value},{replace:!0}),placeholder:`Min AI score`,value:R}),(0,M.jsx)(`button`,{className:p,onClick:()=>I({...F,hideLowSignal:!z}),type:`button`,"aria-pressed":z,children:z?`Hide low-signal`:`Show all`})]}),(0,M.jsx)(`div`,{className:g,children:N.map(e=>{let t=L===e.value;return(0,M.jsx)(`button`,{type:`button`,"aria-pressed":t,className:o(r,t&&`text-[var(--ink)] font-bold`),onClick:()=>I({...F,kind:e.value}),children:(0,M.jsxs)(`span`,{className:`relative inline-flex flex-col items-center justify-center py-1`,children:[e.value,t?(0,M.jsx)(`span`,{className:c}):null]})},e.value)})})]}),K?(0,M.jsx)(`p`,{className:o(s,`px-4 py-2 text-red-500`),children:K}):null,(0,M.jsxs)(`section`,{className:m,children:[Z.length===0?(0,M.jsx)(`div`,{className:_,children:`Inbox clear.`}):null,Z.map(e=>(0,M.jsx)(k,{isReplying:B===e.id,item:e,onReplyChange:U,onReplySend:()=>void re(e),onReplyToggle:()=>{if(q(null),B===e.id){V(null),U(``);return}V(e.id),U(``)},replyDraft:B===e.id?H:``},e.id))]}),W?(0,M.jsx)(`p`,{className:o(s,`px-4 py-2`),children:`Sending reply...`}):null]})}export{F as InboxRouteView,P as component};
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{An as n,Dn as r,Gt as i,Kt as a,M as o,Mn as s,On as c,Rn as l,Ut as u,Wt as d,Xt as f,cn as p,ht as m,jn as h,kn as g,ut as _}from"./schemas-CMQMhQXI.js";import{t as v}from"./sparkles-Gx_BHkDX.js";import{A as y,a as b,b as ee,f as x,n as S,r as C,s as w}from"./query-client-CA-do_IS.js";import{t as T}from"./useQuery-CL_NXLnc.js";import{i as E,r as D}from"./account-selection-h7m9xmzU.js";import{i as O}from"./route-search-CmZT7pGD.js";import{n as k,t as A}from"./inbox-DvSRkOiH.js";var j=e(t()),M=l(),N=[{value:`mixed`,label:`Mixed`},{value:`mentions`,label:`Mentions`},{value:`dms`,label:`DMs`}];function P(){let e=A.useSearch(),t=A.useNavigate();return(0,M.jsx)(F,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function F({searchState:e,onSearchChange:t}={}){let l=ee(),[A,P]=(0,j.useState)(()=>O({})),F=e??A,I=(e,n)=>t?t(e,n):P(e),{kind:L,minScore:R,hideLowSignal:z}=F,[B,V]=(0,j.useState)(null),[H,U]=(0,j.useState)(``),[W,G]=(0,j.useState)(!1),[K,q]=(0,j.useState)(null),J=T({queryKey:S.status,queryFn:({signal:e})=>b({signal:e})}).data??null,Y=D(J?.accounts),X=T({queryKey:[...S.inbox,{hideLowSignal:z,kind:L,minScore:R,selectedAccountId:Y??null}],queryFn:async({signal:e})=>{let t=new URL(`/api/inbox`,window.location.origin);return t.searchParams.set(`kind`,L),t.searchParams.set(`minScore`,R),Y&&t.searchParams.set(`account`,Y),z&&t.searchParams.set(`hideLowSignal`,`1`),C(t,{signal:e},x,`Inbox request failed`)},placeholderData:y,staleTime:5*6e4}),Z=X.data?.items??[],Q=X.data?.stats??null,$=E({mutationFn:()=>w({kind:`scoreInbox`,scoreKind:L,account:Y,limit:8}),onSuccess:()=>l.invalidateQueries({queryKey:S.inbox})}),te=(0,j.useMemo)(()=>!J||!Q?`Ranking unreplied mentions and DMs...`:`${String(Q.total)} in queue · ${String(Q.openai)} OpenAI scored · ${J.transport.statusText}`,[J,Q]);async function ne(){await $.mutateAsync()}async function re(e){if(H.trim()){G(!0),q(null);try{await w(e.entityKind===`dm`?{kind:`replyDm`,conversationId:e.entityId,text:H}:{kind:`replyTweet`,accountId:e.accountId,tweetId:e.entityId,text:H}),U(``),V(null),await l.invalidateQueries({queryKey:S.inbox})}catch(e){q(e instanceof Error?e.message:`Reply failed`)}finally{G(!1)}}}return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`header`,{className:u,children:[(0,M.jsxs)(`div`,{className:d,children:[(0,M.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,M.jsx)(`h1`,{className:a,children:`Inbox`}),(0,M.jsx)(`p`,{className:i,children:te})]}),(0,M.jsxs)(`button`,{className:f,disabled:$.isPending,onClick:()=>void ne(),type:`button`,children:[(0,M.jsx)(v,{className:`size-4`,strokeWidth:2.2}),$.isPending?`Scoring...`:`Score with OpenAI`]})]}),(0,M.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,M.jsx)(`input`,{className:o(n,h),inputMode:`numeric`,onChange:e=>I({...F,minScore:e.target.value},{replace:!0}),placeholder:`Min AI score`,value:R}),(0,M.jsx)(`button`,{className:p,onClick:()=>I({...F,hideLowSignal:!z}),type:`button`,"aria-pressed":z,children:z?`Hide low-signal`:`Show all`})]}),(0,M.jsx)(`div`,{className:g,children:N.map(e=>{let t=L===e.value;return(0,M.jsx)(`button`,{type:`button`,"aria-pressed":t,className:o(r,t&&`text-[var(--ink)] font-bold`),onClick:()=>I({...F,kind:e.value}),children:(0,M.jsxs)(`span`,{className:`relative inline-flex flex-col items-center justify-center py-1`,children:[e.value,t?(0,M.jsx)(`span`,{className:c}):null]})},e.value)})})]}),K?(0,M.jsx)(`p`,{className:o(s,`px-4 py-2 text-red-500`),children:K}):null,(0,M.jsxs)(`section`,{className:m,children:[Z.length===0?(0,M.jsx)(`div`,{className:_,children:`Inbox clear.`}):null,Z.map(e=>(0,M.jsx)(k,{isReplying:B===e.id,item:e,onReplyChange:U,onReplySend:()=>void re(e),onReplyToggle:()=>{if(q(null),B===e.id){V(null),U(``);return}V(e.id),U(``)},replyDraft:B===e.id?H:``},e.id))]}),W?(0,M.jsx)(`p`,{className:o(s,`px-4 py-2`),children:`Sending reply...`}):null]})}export{F as InboxRouteView,P as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/inbox-C9zFrQ76.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/sparkles-Gx_BHkDX.js","assets/createLucideIcon-CMLcIxOz.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/account-selection-h7m9xmzU.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
2
- import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{i as t,n,t as r}from"./lazyRouteComponent-CLLbUvMd.js";import{D as i,Dt as a,E as o,Et as s,Ft as c,Jt as l,M as u,Mn as d,O as f,Ot as p,Rn as m,St as h,Xt as g,Yt as _,_t as v,bt as y,cn as b,qt as x,vt as S,xt as C,yt as w}from"./schemas-CMQMhQXI.js";import{t as T}from"./circle-check-BCK_qvXt.js";import{t as E}from"./circle-DiJUdlek.js";import{t as D}from"./external-link-CfdTAkvn.js";import{t as O}from"./message-circle-79LZr2oN.js";import"./query-client-CA-do_IS.js";import"./account-selection-h7m9xmzU.js";import{r as k,t as A}from"./AvatarChip-DsHj3LT7.js";import{t as j}from"./SmartTimestamp-CXaNLqN7.js";import{i as M}from"./route-search-CmZT7pGD.js";import{n as N,t as P}from"./preload-helper-MpqUbZCn.js";e();var F=m();function I({item:e,isReplying:n,replyDraft:r,onReplyChange:m,onReplyToggle:M,onReplySend:N}){return(0,F.jsxs)(`article`,{className:u(S,`items-start`),children:[(0,F.jsx)(A,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,F.jsxs)(`div`,{className:v,children:[(0,F.jsxs)(`header`,{className:C,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:h,children:e.participant.displayName}),(0,F.jsxs)(`span`,{className:y,children:[`@`,e.participant.handle]})]}),(0,F.jsx)(`span`,{className:w,children:`·`}),(0,F.jsx)(j,{className:a,value:e.createdAt}),(0,F.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:u(l,_),children:e.entityKind}),(0,F.jsxs)(`span`,{className:u(l,x),children:[`score `,e.score]})]})]}),(0,F.jsx)(`h3`,{className:`text-[15px] font-bold text-[var(--ink)]`,children:e.title}),(0,F.jsx)(`p`,{className:s,children:e.text}),(0,F.jsxs)(`div`,{className:p,children:[(0,F.jsx)(`strong`,{className:`text-[var(--ink)]`,children:e.summary}),(0,F.jsx)(`p`,{children:e.reasoning})]}),(0,F.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`span`,{children:e.source}),(0,F.jsx)(`span`,{className:c}),(0,F.jsxs)(`span`,{children:[`influence `,k(e.influenceScore)]}),(0,F.jsx)(`span`,{className:c}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.needsReply?(0,F.jsx)(E,{className:`size-3`,strokeWidth:2.2}):(0,F.jsx)(T,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`button`,{className:b,onClick:M,type:`button`,children:[(0,F.jsx)(O,{className:`size-4`,strokeWidth:2}),n?`Close reply`:`Reply`]}),(0,F.jsxs)(t,{className:u(b,`gap-1.5`),to:e.entityKind===`dm`?`/dms`:`/mentions`,children:[(0,F.jsx)(D,{className:`size-4`,strokeWidth:2}),`Open`]})]})]}),n?(0,F.jsxs)(`div`,{className:f,children:[(0,F.jsx)(`textarea`,{className:i,onChange:e=>m(e.target.value),placeholder:e.entityKind===`dm`?`Reply to @${e.participant.handle}`:`Reply to mention from @${e.participant.handle}`,rows:4,value:r}),(0,F.jsxs)(`div`,{className:o,children:[(0,F.jsx)(`span`,{className:d,children:`Send from inbox`}),(0,F.jsx)(`button`,{className:g,disabled:!r.trim(),onClick:N,type:`button`,children:`Send`})]})]}):null]})]})}N();var L=n(`/inbox`)({component:r(()=>P(()=>import(`./inbox-C9zFrQ76.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:M});export{I as n,L as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/inbox-CeGwsGo_.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/sparkles-Gx_BHkDX.js","assets/createLucideIcon-CMLcIxOz.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/account-selection-h7m9xmzU.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
2
+ import"./rolldown-runtime-B-9mzPXz.js";import{t as e}from"./react-BwGzW7mM.js";import{i as t,n,t as r}from"./lazyRouteComponent-CLLbUvMd.js";import{D as i,Dt as a,E as o,Et as s,Ft as c,Jt as l,M as u,Mn as d,O as f,Ot as p,Rn as m,St as h,Xt as g,Yt as _,_t as v,bt as y,cn as b,qt as x,vt as S,xt as C,yt as w}from"./schemas-CMQMhQXI.js";import{t as T}from"./circle-check-BCK_qvXt.js";import{t as E}from"./circle-DiJUdlek.js";import{t as D}from"./external-link-CfdTAkvn.js";import{t as O}from"./message-circle-79LZr2oN.js";import"./query-client-CA-do_IS.js";import"./account-selection-h7m9xmzU.js";import{r as k,t as A}from"./AvatarChip-DsHj3LT7.js";import{n as j,t as M}from"./preload-helper-MpqUbZCn.js";import{i as N}from"./route-search-CmZT7pGD.js";import{t as P}from"./SmartTimestamp-CXaNLqN7.js";e();var F=m();function I({item:e,isReplying:n,replyDraft:r,onReplyChange:m,onReplyToggle:j,onReplySend:M}){return(0,F.jsxs)(`article`,{className:u(S,`items-start`),children:[(0,F.jsx)(A,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,F.jsxs)(`div`,{className:v,children:[(0,F.jsxs)(`header`,{className:C,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:h,children:e.participant.displayName}),(0,F.jsxs)(`span`,{className:y,children:[`@`,e.participant.handle]})]}),(0,F.jsx)(`span`,{className:w,children:`·`}),(0,F.jsx)(P,{className:a,value:e.createdAt}),(0,F.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:u(l,_),children:e.entityKind}),(0,F.jsxs)(`span`,{className:u(l,x),children:[`score `,e.score]})]})]}),(0,F.jsx)(`h3`,{className:`text-[15px] font-bold text-[var(--ink)]`,children:e.title}),(0,F.jsx)(`p`,{className:s,children:e.text}),(0,F.jsxs)(`div`,{className:p,children:[(0,F.jsx)(`strong`,{className:`text-[var(--ink)]`,children:e.summary}),(0,F.jsx)(`p`,{children:e.reasoning})]}),(0,F.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsx)(`span`,{children:e.source}),(0,F.jsx)(`span`,{className:c}),(0,F.jsxs)(`span`,{children:[`influence `,k(e.influenceScore)]}),(0,F.jsx)(`span`,{className:c}),(0,F.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.needsReply?(0,F.jsx)(E,{className:`size-3`,strokeWidth:2.2}):(0,F.jsx)(T,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsxs)(`button`,{className:b,onClick:j,type:`button`,children:[(0,F.jsx)(O,{className:`size-4`,strokeWidth:2}),n?`Close reply`:`Reply`]}),(0,F.jsxs)(t,{className:u(b,`gap-1.5`),to:e.entityKind===`dm`?`/dms`:`/mentions`,children:[(0,F.jsx)(D,{className:`size-4`,strokeWidth:2}),`Open`]})]})]}),n?(0,F.jsxs)(`div`,{className:f,children:[(0,F.jsx)(`textarea`,{className:i,onChange:e=>m(e.target.value),placeholder:e.entityKind===`dm`?`Reply to @${e.participant.handle}`:`Reply to mention from @${e.participant.handle}`,rows:4,value:r}),(0,F.jsxs)(`div`,{className:o,children:[(0,F.jsx)(`span`,{className:d,children:`Send from inbox`}),(0,F.jsx)(`button`,{className:g,disabled:!r.trim(),onClick:M,type:`button`,children:`Send`})]})]}):null]})]})}j();var L=n(`/inbox`)({component:r(()=>M(()=>import(`./inbox-CeGwsGo_.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`),validateSearch:N});export{I as n,L as t};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/rate-limits-DyRTb_U4.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/createLucideIcon-CMLcIxOz.js","assets/gauge-DP2ku9zz.js","assets/refresh-cw-IUfM9D_1.js","assets/triangle-alert-DJPCW6jQ.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/mentions-BKO40XiK.js","assets/TimelineRouteFrame-DJdUR7DX.js","assets/useTimelineRouteData-DYhYLZY4.js","assets/circle-check-BCK_qvXt.js","assets/circle-DiJUdlek.js","assets/external-link-CfdTAkvn.js","assets/heart-D-ERjZPN.js","assets/message-circle-79LZr2oN.js","assets/repeat-2-CQ0lek01.js","assets/search-C_LqodNa.js","assets/user-search-DL5_6EZd.js","assets/account-selection-h7m9xmzU.js","assets/AvatarChip-DsHj3LT7.js","assets/FeedState-DhMv4zXD.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js","assets/useDebouncedValue-BJLRInUq.js","assets/TweetRichText-D-amgcEl.js","assets/SyncNowButton-DDYT2jQT.js","assets/likes-BXANVRCj.js","assets/SavedTimelineView-4QYaZ4CU.js","assets/data-sources-CqxgDfE3.js","assets/database-Dl3XWRaa.js","assets/bookmarks-Gy6MvAc9.js","assets/routes-ARIEjgq-.js"])))=>i.map(i=>d[i]);
2
- import{r as e,t}from"./rolldown-runtime-B-9mzPXz.js";import{t as n}from"./react-BwGzW7mM.js";import{t as r}from"./react-dom-DEMAB80t.js";import{A as i,B as a,C as o,D as s,E as c,F as l,G as u,H as d,I as f,K as p,L as m,M as h,N as g,O as _,P as v,R as y,S as b,T as x,U as S,V as C,W as ee,a as te,b as ne,c as w,d as re,f as ie,g as ae,h as E,i as oe,j as se,k as ce,l as D,m as O,n as le,o as k,p as ue,q as de,r as fe,s as A,t as pe,u as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./lazyRouteComponent-CLLbUvMd.js";import{Bt as be,Cn as xe,Lt as Se,M as Ce,Nt as we,Pt as Te,Rn as Ee,Rt as De,Sn as Oe,Vt as ke,_n as Ae,bn as je,gn as Me,hn as Ne,mn as Pe,vn as Fe,w as Ie,wn as Le,xn as Re,yn as ze,zt as Be}from"./schemas-CMQMhQXI.js";import{t as Ve}from"./createLucideIcon-CMLcIxOz.js";import{t as He}from"./chevron-down-e-c5H12y.js";import{t as Ue}from"./database-Dl3XWRaa.js";import{h as We,t as Ge}from"./network-map-2EPsbMIT.js";import{t as Ke}from"./gauge-DP2ku9zz.js";import{t as qe}from"./heart-D-ERjZPN.js";import{t as Je}from"./user-search-DL5_6EZd.js";import{a as Ye,n as Xe,t as Ze}from"./query-client-CA-do_IS.js";import{t as Qe}from"./useQuery-CL_NXLnc.js";import{n as $e,r as et}from"./account-selection-h7m9xmzU.js";import{t as tt}from"./AvatarChip-DsHj3LT7.js";import{c as nt}from"./FeedState-DhMv4zXD.js";import{n as rt,t as it}from"./preload-helper-MpqUbZCn.js";import{t as at}from"./today-DNAg-wnA.js";import{t as ot}from"./profile-analyze-B5Rr41WP.js";import{t as st}from"./links-6tWeHun_.js";import{t as ct}from"./inbox-DjlVjj3K.js";import{t as lt}from"./dms-Q1a1kZ_P.js";import{t as ut}from"./discuss-DKC6H1fN.js";import{t as dt}from"./blocks-BpjvGwYq.js";import{t as ft}from"./profiles._handle-DdZ9wAT-.js";var pt=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&E(x,t.startTime-e)}}var S=!1,C=-1,ee=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<ee)}function w(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&E(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(w)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=w,re=function(){ae.postMessage(null)}}else re=function(){_(w,0)};function E(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,E(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),mt=t(((e,t)=>{t.exports=pt()})),ht=t((e=>{var t=mt(),i=n(),a=r();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function E(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},k=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=k[ue],k[ue]=null,ue--)}function A(e,t){ue++,k[ue]=e.current,e.current=t}var pe=de(null),me=de(null),he=de(null),ge=de(null);function _e(e,t){switch(A(he,t),A(me,e),A(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(pe),A(pe,e)}function ve(){fe(pe),fe(me),fe(he)}function ye(e){e.memoizedState!==null&&A(ge,e);var t=pe.current,n=Ud(t,e.type);t!==n&&(A(me,e),A(pe,n))}function be(e){me.current===e&&(fe(pe),fe(me)),ge.current===e&&(fe(ge),$f._currentValue=le)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-P7NzOusD.js","assets/schemas-CMQMhQXI.js","assets/rolldown-runtime-B-9mzPXz.js","assets/TimelineRouteFrame-DcipwBqo.js","assets/react-BwGzW7mM.js","assets/useTimelineRouteData-2v9TVG9L.js","assets/createLucideIcon-CMLcIxOz.js","assets/circle-check-BCK_qvXt.js","assets/circle-DiJUdlek.js","assets/external-link-CfdTAkvn.js","assets/heart-D-ERjZPN.js","assets/message-circle-79LZr2oN.js","assets/repeat-2-CQ0lek01.js","assets/search-C_LqodNa.js","assets/user-search-DL5_6EZd.js","assets/query-client-CA-do_IS.js","assets/useQuery-CL_NXLnc.js","assets/account-selection-h7m9xmzU.js","assets/AvatarChip-DsHj3LT7.js","assets/FeedState-DhMv4zXD.js","assets/useDebouncedValue-BJLRInUq.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js","assets/TweetRichText-D-amgcEl.js","assets/SyncNowButton-DDYT2jQT.js","assets/refresh-cw-IUfM9D_1.js","assets/bookmarks-BMf6Ytua.js","assets/SavedTimelineView-CFgHR6di.js","assets/data-sources-CqxgDfE3.js","assets/database-Dl3XWRaa.js","assets/triangle-alert-DJPCW6jQ.js","assets/likes-BaljrAHC.js","assets/mentions-TFNyR9F4.js","assets/rate-limits-DyRTb_U4.js","assets/gauge-DP2ku9zz.js"])))=>i.map(i=>d[i]);
2
+ import{r as e,t}from"./rolldown-runtime-B-9mzPXz.js";import{t as n}from"./react-BwGzW7mM.js";import{t as r}from"./react-dom-DEMAB80t.js";import{A as i,B as a,C as o,D as s,E as c,F as l,G as u,H as d,I as f,K as p,L as m,M as h,N as g,O as _,P as v,R as y,S as b,T as x,U as S,V as C,W as ee,a as te,b as ne,c as w,d as re,f as ie,g as ae,h as E,i as oe,j as se,k as ce,l as D,m as O,n as le,o as k,p as ue,q as de,r as fe,s as A,t as pe,u as me,v as he,w as ge,x as _e,y as ve,z as ye}from"./lazyRouteComponent-CLLbUvMd.js";import{Bt as be,Cn as xe,Lt as Se,M as Ce,Nt as we,Pt as Te,Rn as Ee,Rt as De,Sn as Oe,Vt as ke,_n as Ae,bn as je,gn as Me,hn as Ne,mn as Pe,vn as Fe,w as Ie,wn as Le,xn as Re,yn as ze,zt as Be}from"./schemas-CMQMhQXI.js";import{t as Ve}from"./createLucideIcon-CMLcIxOz.js";import{t as He}from"./chevron-down-e-c5H12y.js";import{t as Ue}from"./database-Dl3XWRaa.js";import{h as We,t as Ge}from"./network-map-CKiXfloJ.js";import{t as Ke}from"./gauge-DP2ku9zz.js";import{t as qe}from"./heart-D-ERjZPN.js";import{t as Je}from"./user-search-DL5_6EZd.js";import{a as Ye,n as Xe,t as Ze}from"./query-client-CA-do_IS.js";import{t as Qe}from"./useQuery-CL_NXLnc.js";import{n as $e,r as et}from"./account-selection-h7m9xmzU.js";import{t as tt}from"./AvatarChip-DsHj3LT7.js";import{c as nt}from"./FeedState-DhMv4zXD.js";import{n as rt,t as it}from"./preload-helper-MpqUbZCn.js";import{t as at}from"./blocks-qrevFiNI.js";import{t as ot}from"./discuss-BeFPn8mN.js";import{t as st}from"./dms-DBexFtGg.js";import{t as ct}from"./inbox-DvSRkOiH.js";import{t as lt}from"./links-CbC-fX7T.js";import{t as ut}from"./profile-analyze-B5Rr41WP.js";import{t as dt}from"./today-DOUIqDPa.js";import{t as ft}from"./profiles._handle-DdZ9wAT-.js";var pt=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&E(x,t.startTime-e)}}var S=!1,C=-1,ee=5,te=-1;function ne(){return g?!0:!(e.unstable_now()-te<ee)}function w(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&E(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(w)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=w,re=function(){ae.postMessage(null)}}else re=function(){_(w,0)};function E(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,E(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),mt=t(((e,t)=>{t.exports=pt()})),ht=t((e=>{var t=mt(),i=n(),a=r();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),w=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function E(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var oe=Symbol.for(`react.client.reference`);function se(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?se(e.type)||`Memo`:t;case w:t=e._payload,e=e._init;try{return se(e(t))}catch{}}return null}var ce=Array.isArray,D=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},k=[],ue=-1;function de(e){return{current:e}}function fe(e){0>ue||(e.current=k[ue],k[ue]=null,ue--)}function A(e,t){ue++,k[ue]=e.current,e.current=t}var pe=de(null),me=de(null),he=de(null),ge=de(null);function _e(e,t){switch(A(he,t),A(me,e),A(pe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(pe),A(pe,e)}function ve(){fe(pe),fe(me),fe(he)}function ye(e){e.memoizedState!==null&&A(ge,e);var t=pe.current,n=Ud(t,e.type);t!==n&&(A(me,e),A(pe,n))}function be(e){me.current===e&&(fe(pe),fe(me)),ge.current===e&&(fe(ge),$f._currentValue=le)}var xe,Se;function Ce(e){if(xe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);xe=t&&t[1]||``,Se=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+xe+e+Se}var we=!1;function Te(e,t){if(!e||we)return``;we=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
@@ -28,4 +28,4 @@ Error generating stack: `+e.message+`
28
28
  root.dataset.theme = resolved;
29
29
  root.style.colorScheme = resolved;
30
30
  })();
31
- `;function Vc({children:e}){let[t,n]=(0,V.useState)(`system`),[r,i]=(0,V.useState)(`light`),[a,o]=(0,V.useState)(!1);(0,V.useEffect)(()=>{let e=zc();n(e),i(Rc(e)),W(e),o(!0)},[]),(0,V.useEffect)(()=>{if(!a||(W(t),i(Rc(t)),window.localStorage.setItem(Fc,t),t!==`system`||typeof window.matchMedia!=`function`))return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let t=e.matches?`dark`:`light`;i(t),document.documentElement.dataset.theme=t,document.documentElement.style.colorScheme=t};return typeof e.addEventListener==`function`?e.addEventListener(`change`,n):e.addListener?.(n),()=>{typeof e.removeEventListener==`function`?e.removeEventListener(`change`,n):e.removeListener?.(n)}},[a,t]);let s=(0,V.useMemo)(()=>({isReady:a,theme:t,resolvedTheme:r,setTheme:n}),[a,r,t]);return(0,H.jsx)(Ic.Provider,{value:s,children:e})}function Hc(){let e=(0,V.useContext)(Ic);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}var Uc=r(),Wc=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,Gc=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches??!1,Kc=e=>{e.classList.remove(`theme-transition`),e.style.removeProperty(`--theme-switch-x`),e.style.removeProperty(`--theme-switch-y`),e.querySelectorAll(`[data-theme-transition-target]`).forEach(e=>e.removeAttribute(`data-theme-transition-target`))};function qc({nextTheme:e,currentTheme:t,setTheme:n,context:r}){if(t===e)return;if(typeof document>`u`){n(e);return}let i=document.documentElement,a=typeof document.startViewTransition==`function`?document.startViewTransition.bind(document):void 0,o=!!a&&!Gc(),s=()=>{(0,Uc.flushSync)(()=>{n(e)})};if(!o){s(),Kc(i);return}let c=.5,l=.5;if(r?.pointerClientX!==void 0&&r.pointerClientY!==void 0&&typeof window<`u`)c=Wc(r.pointerClientX/window.innerWidth),l=Wc(r.pointerClientY/window.innerHeight);else if(r?.element&&typeof window<`u`){let e=r.element.getBoundingClientRect();e.width>0&&e.height>0&&(c=Wc((e.left+e.width/2)/window.innerWidth),l=Wc((e.top+e.height/2)/window.innerHeight))}i.style.setProperty(`--theme-switch-x`,`${c*100}%`),i.style.setProperty(`--theme-switch-y`,`${l*100}%`),i.classList.add(`theme-transition`),r?.element?.setAttribute(`data-theme-transition-target`,``);try{let e=a?.(()=>{s()});if(!e?.finished){Kc(i);return}e.finished.catch(()=>void 0).finally(()=>Kc(i))}catch{Kc(i),s()}}var Jc=[{key:`system`,icon:Dc,label:`System default`},{key:`light`,icon:Ac,label:`Light theme`},{key:`dark`,icon:Oc,label:`Dark theme`}];function Yc(e){return Jc.findIndex(t=>t.key===e)}function Xc({compact:e=!1}){let{isReady:t,theme:n,setTheme:r}=Hc(),i=Math.max(Yc(n),0),a=Jc[i],o=Jc[(i+1)%Jc.length],s=a.icon;return(0,H.jsx)(`div`,{className:Ce(`theme-toggle-shell flex justify-center`,e?`shrink-0`:`px-1 py-1 min-[1100px]:justify-start min-[1100px]:px-2`),title:`${a.label}; click for ${o.label}`,children:(0,H.jsx)(`button`,{type:`button`,className:Ce(`theme-toggle-button inline-flex items-center justify-center rounded-full border bg-transparent text-[var(--ink-soft)] transition-[background,border-color,color,transform,box-shadow] duration-150 hover:border-[color:color-mix(in_srgb,var(--accent)_38%,var(--line))] hover:bg-[var(--bg-hover)] hover:text-[var(--ink)] active:scale-95 disabled:cursor-default disabled:opacity-55 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:color-mix(in_srgb,var(--accent)_54%,transparent)]`,e?`size-8 border-transparent`:`size-11 border-[var(--line)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--line)_44%,transparent)]`),onClick:e=>{let t={element:e.currentTarget,pointerClientX:e.clientX,pointerClientY:e.clientY};qc({nextTheme:o.key,currentTheme:n,setTheme:r,context:t})},"aria-label":`Theme: ${a.label}. Switch to ${o.label}.`,"data-testid":`theme-toggle`,disabled:!t,children:(0,H.jsx)(s,{className:Ce(`theme-toggle-icon`,e?`size-[17px]`:`size-[19px]`),strokeWidth:2,"aria-hidden":`true`})})})}var Zc=[{to:`/inbox`,label:`Inbox`,icon:Cc},{to:`/today`,label:`Today`,icon:bc},{to:`/discuss`,label:`Discuss`,icon:Ec},{to:`/profile-analyze`,label:`Analyse`,icon:Je},{to:`/network-map`,label:`Map`,icon:We},{to:`/data-sources`,label:`Sources`,icon:Ue},{to:`/`,label:`Home`,icon:Sc},{to:`/mentions`,label:`Mentions`,icon:vc},{to:`/likes`,label:`Likes`,icon:qe},{to:`/bookmarks`,label:`Bookmarks`,icon:yc},{to:`/links`,label:`Links`,icon:wc},{to:`/rate-limits`,label:`Rate Limits`,icon:Ke},{to:`/dms`,label:`DMs`,icon:Tc},{to:`/blocks`,label:`Blocks`,icon:kc}];function Qc({compact:e=!1}){let t=uc({select:e=>e.location.pathname});return(0,H.jsxs)(`aside`,{className:e?xe:Oe,children:[(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsxs)(oe,{to:`/`,className:Pe,children:[(0,H.jsx)(`span`,{className:Ae,children:(0,H.jsx)(nt,{className:`size-10`})}),(0,H.jsxs)(`span`,{className:e?Me:Ne,children:[(0,H.jsx)(`span`,{className:ze,children:`birdclaw`}),(0,H.jsx)(`span`,{className:Fe,children:`Fast search for your archive.`})]})]}),(0,H.jsx)(`nav`,{className:Re,"aria-label":`Primary`,children:Zc.map(n=>{let r=t===n.to,i=n.icon;return(0,H.jsxs)(oe,{to:n.to,"aria-label":n.label,className:Ce(e?De:Se,r&&`nav-link-active font-bold`),children:[(0,H.jsx)(i,{className:Be,size:22,strokeWidth:r?2.4:1.8,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:e?ke:be,children:n.label})]},n.to)})})]}),(0,H.jsx)(`div`,{className:je,children:(0,H.jsx)(Pc,{action:(0,H.jsx)(Xc,{compact:!0})})})]})}var $c=`/assets/styles-CjeA43Ci.css`,el=fe({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`birdclaw`}],links:[{rel:`stylesheet`,href:$c}]}),notFoundComponent:tl,shellComponent:nl});function tl(){return(0,H.jsx)(`main`,{className:we,children:(0,H.jsx)(`div`,{className:`px-4 py-10 text-[var(--ink-soft)]`,children:`Not Found`})})}function nl({children:e}){let t=uc({select:e=>e.location.pathname}),n=t.startsWith(`/dms`)||t.startsWith(`/network-map`);return(0,H.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(hc,{}),(0,H.jsx)(`script`,{suppressHydrationWarning:!0,children:Bc})]}),(0,H.jsxs)(`body`,{className:Ie,children:[(0,H.jsx)(Ze,{children:(0,H.jsx)(Vc,{children:(0,H.jsxs)(`div`,{className:Le,children:[(0,H.jsx)(Qc,{compact:n}),(0,H.jsx)(`main`,{className:n?Te:we,children:e})]})})}),(0,H.jsx)(gc,{})]})]})}rt();var rl=le(`/rate-limits`)({component:pe(()=>it(()=>import(`./rate-limits-DyRTb_U4.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),`component`)});rt();var il=le(`/mentions`)({component:pe(()=>it(()=>import(`./mentions-BKO40XiK.js`),__vite__mapDeps([10,3,1,11,2,12,4,13,14,15,16,17,18,19,20,8,9,21,22,23,24,25,26,27,28,6])),`component`)});rt();var al=le(`/likes`)({component:pe(()=>it(()=>import(`./likes-BXANVRCj.js`),__vite__mapDeps([29,3,1,30,2,12,4,13,14,15,16,17,18,19,20,8,9,21,22,23,24,25,26,27,28,6])),`component`)});rt();var ol=le(`/data-sources`)({component:pe(()=>it(()=>import(`./data-sources-CqxgDfE3.js`),__vite__mapDeps([31,1,2,3,4,13,32,6,7,8,9])),`component`)});rt();var sl=le(`/bookmarks`)({component:pe(()=>it(()=>import(`./bookmarks-Gy6MvAc9.js`),__vite__mapDeps([33,3,1,30,2,12,4,13,14,15,16,17,18,19,20,8,9,21,22,23,24,25,26,27,28,6])),`component`)});rt();var cl=le(`/`)({component:pe(()=>it(()=>import(`./routes-ARIEjgq-.js`),__vite__mapDeps([34,3,1,11,2,12,4,13,14,15,16,17,18,19,20,8,9,21,22,23,24,25,26,27,28,6])),`component`)}),G=at.update({id:`/today`,path:`/today`,getParentRoute:()=>el}),ll=rl.update({id:`/rate-limits`,path:`/rate-limits`,getParentRoute:()=>el}),ul=ot.update({id:`/profile-analyze`,path:`/profile-analyze`,getParentRoute:()=>el}),dl=Ge.update({id:`/network-map`,path:`/network-map`,getParentRoute:()=>el}),fl=il.update({id:`/mentions`,path:`/mentions`,getParentRoute:()=>el}),pl=st.update({id:`/links`,path:`/links`,getParentRoute:()=>el}),ml=al.update({id:`/likes`,path:`/likes`,getParentRoute:()=>el}),hl=ct.update({id:`/inbox`,path:`/inbox`,getParentRoute:()=>el}),gl=lt.update({id:`/dms`,path:`/dms`,getParentRoute:()=>el}),_l=ut.update({id:`/discuss`,path:`/discuss`,getParentRoute:()=>el}),vl=ol.update({id:`/data-sources`,path:`/data-sources`,getParentRoute:()=>el}),yl=sl.update({id:`/bookmarks`,path:`/bookmarks`,getParentRoute:()=>el}),bl=dt.update({id:`/blocks`,path:`/blocks`,getParentRoute:()=>el}),xl={IndexRoute:cl.update({id:`/`,path:`/`,getParentRoute:()=>el}),BlocksRoute:bl,BookmarksRoute:yl,DataSourcesRoute:vl,DiscussRoute:_l,DmsRoute:gl,InboxRoute:hl,LikesRoute:ml,LinksRoute:pl,MentionsRoute:fl,NetworkMapRoute:dl,ProfileAnalyzeRoute:ul,RateLimitsRoute:ll,TodayRoute:G,ProfilesHandleRoute:ft.update({id:`/profiles/$handle`,path:`/profiles/$handle`,getParentRoute:()=>el})},Sl=el._addFileChildren(xl);function Cl(){return oc({routeTree:Sl,scrollRestoration:!0,defaultPreload:`intent`,defaultPreloadStaleTime:6e4})}async function wl(){let e=await Cl(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(_s),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await bs(e),e}var Tl=wl;async function El(){let e=await Tl();return window.$_TSR?.h(),e}var Dl;function Ol(){return Dl||=El(),(0,H.jsx)(Ss,{promise:Dl,children:e=>(0,H.jsx)(lc,{router:e})})}var kl=gt();(0,V.startTransition)(()=>{(0,kl.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(Ol,{})}))});
31
+ `;function Vc({children:e}){let[t,n]=(0,V.useState)(`system`),[r,i]=(0,V.useState)(`light`),[a,o]=(0,V.useState)(!1);(0,V.useEffect)(()=>{let e=zc();n(e),i(Rc(e)),W(e),o(!0)},[]),(0,V.useEffect)(()=>{if(!a||(W(t),i(Rc(t)),window.localStorage.setItem(Fc,t),t!==`system`||typeof window.matchMedia!=`function`))return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let t=e.matches?`dark`:`light`;i(t),document.documentElement.dataset.theme=t,document.documentElement.style.colorScheme=t};return typeof e.addEventListener==`function`?e.addEventListener(`change`,n):e.addListener?.(n),()=>{typeof e.removeEventListener==`function`?e.removeEventListener(`change`,n):e.removeListener?.(n)}},[a,t]);let s=(0,V.useMemo)(()=>({isReady:a,theme:t,resolvedTheme:r,setTheme:n}),[a,r,t]);return(0,H.jsx)(Ic.Provider,{value:s,children:e})}function Hc(){let e=(0,V.useContext)(Ic);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}var Uc=r(),Wc=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,Gc=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches??!1,Kc=e=>{e.classList.remove(`theme-transition`),e.style.removeProperty(`--theme-switch-x`),e.style.removeProperty(`--theme-switch-y`),e.querySelectorAll(`[data-theme-transition-target]`).forEach(e=>e.removeAttribute(`data-theme-transition-target`))};function qc({nextTheme:e,currentTheme:t,setTheme:n,context:r}){if(t===e)return;if(typeof document>`u`){n(e);return}let i=document.documentElement,a=typeof document.startViewTransition==`function`?document.startViewTransition.bind(document):void 0,o=!!a&&!Gc(),s=()=>{(0,Uc.flushSync)(()=>{n(e)})};if(!o){s(),Kc(i);return}let c=.5,l=.5;if(r?.pointerClientX!==void 0&&r.pointerClientY!==void 0&&typeof window<`u`)c=Wc(r.pointerClientX/window.innerWidth),l=Wc(r.pointerClientY/window.innerHeight);else if(r?.element&&typeof window<`u`){let e=r.element.getBoundingClientRect();e.width>0&&e.height>0&&(c=Wc((e.left+e.width/2)/window.innerWidth),l=Wc((e.top+e.height/2)/window.innerHeight))}i.style.setProperty(`--theme-switch-x`,`${c*100}%`),i.style.setProperty(`--theme-switch-y`,`${l*100}%`),i.classList.add(`theme-transition`),r?.element?.setAttribute(`data-theme-transition-target`,``);try{let e=a?.(()=>{s()});if(!e?.finished){Kc(i);return}e.finished.catch(()=>void 0).finally(()=>Kc(i))}catch{Kc(i),s()}}var Jc=[{key:`system`,icon:Dc,label:`System default`},{key:`light`,icon:Ac,label:`Light theme`},{key:`dark`,icon:Oc,label:`Dark theme`}];function Yc(e){return Jc.findIndex(t=>t.key===e)}function Xc({compact:e=!1}){let{isReady:t,theme:n,setTheme:r}=Hc(),i=Math.max(Yc(n),0),a=Jc[i],o=Jc[(i+1)%Jc.length],s=a.icon;return(0,H.jsx)(`div`,{className:Ce(`theme-toggle-shell flex justify-center`,e?`shrink-0`:`px-1 py-1 min-[1100px]:justify-start min-[1100px]:px-2`),title:`${a.label}; click for ${o.label}`,children:(0,H.jsx)(`button`,{type:`button`,className:Ce(`theme-toggle-button inline-flex items-center justify-center rounded-full border bg-transparent text-[var(--ink-soft)] transition-[background,border-color,color,transform,box-shadow] duration-150 hover:border-[color:color-mix(in_srgb,var(--accent)_38%,var(--line))] hover:bg-[var(--bg-hover)] hover:text-[var(--ink)] active:scale-95 disabled:cursor-default disabled:opacity-55 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:color-mix(in_srgb,var(--accent)_54%,transparent)]`,e?`size-8 border-transparent`:`size-11 border-[var(--line)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--line)_44%,transparent)]`),onClick:e=>{let t={element:e.currentTarget,pointerClientX:e.clientX,pointerClientY:e.clientY};qc({nextTheme:o.key,currentTheme:n,setTheme:r,context:t})},"aria-label":`Theme: ${a.label}. Switch to ${o.label}.`,"data-testid":`theme-toggle`,disabled:!t,children:(0,H.jsx)(s,{className:Ce(`theme-toggle-icon`,e?`size-[17px]`:`size-[19px]`),strokeWidth:2,"aria-hidden":`true`})})})}var Zc=[{to:`/inbox`,label:`Inbox`,icon:Cc},{to:`/today`,label:`Today`,icon:bc},{to:`/discuss`,label:`Discuss`,icon:Ec},{to:`/profile-analyze`,label:`Analyse`,icon:Je},{to:`/network-map`,label:`Map`,icon:We},{to:`/data-sources`,label:`Sources`,icon:Ue},{to:`/`,label:`Home`,icon:Sc},{to:`/mentions`,label:`Mentions`,icon:vc},{to:`/likes`,label:`Likes`,icon:qe},{to:`/bookmarks`,label:`Bookmarks`,icon:yc},{to:`/links`,label:`Links`,icon:wc},{to:`/rate-limits`,label:`Rate Limits`,icon:Ke},{to:`/dms`,label:`DMs`,icon:Tc},{to:`/blocks`,label:`Blocks`,icon:kc}];function Qc({compact:e=!1}){let t=uc({select:e=>e.location.pathname});return(0,H.jsxs)(`aside`,{className:e?xe:Oe,children:[(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsxs)(oe,{to:`/`,className:Pe,children:[(0,H.jsx)(`span`,{className:Ae,children:(0,H.jsx)(nt,{className:`size-10`})}),(0,H.jsxs)(`span`,{className:e?Me:Ne,children:[(0,H.jsx)(`span`,{className:ze,children:`birdclaw`}),(0,H.jsx)(`span`,{className:Fe,children:`Fast search for your archive.`})]})]}),(0,H.jsx)(`nav`,{className:Re,"aria-label":`Primary`,children:Zc.map(n=>{let r=t===n.to,i=n.icon;return(0,H.jsxs)(oe,{to:n.to,"aria-label":n.label,className:Ce(e?De:Se,r&&`nav-link-active font-bold`),children:[(0,H.jsx)(i,{className:Be,size:22,strokeWidth:r?2.4:1.8,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:e?ke:be,children:n.label})]},n.to)})})]}),(0,H.jsx)(`div`,{className:je,children:(0,H.jsx)(Pc,{action:(0,H.jsx)(Xc,{compact:!0})})})]})}var $c=`/assets/styles-CjeA43Ci.css`,el=fe({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`birdclaw`}],links:[{rel:`stylesheet`,href:$c}]}),notFoundComponent:tl,shellComponent:nl});function tl(){return(0,H.jsx)(`main`,{className:we,children:(0,H.jsx)(`div`,{className:`px-4 py-10 text-[var(--ink-soft)]`,children:`Not Found`})})}function nl({children:e}){let t=uc({select:e=>e.location.pathname}),n=t.startsWith(`/dms`)||t.startsWith(`/network-map`);return(0,H.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(hc,{}),(0,H.jsx)(`script`,{suppressHydrationWarning:!0,children:Bc})]}),(0,H.jsxs)(`body`,{className:Ie,children:[(0,H.jsx)(Ze,{children:(0,H.jsx)(Vc,{children:(0,H.jsxs)(`div`,{className:Le,children:[(0,H.jsx)(Qc,{compact:n}),(0,H.jsx)(`main`,{className:n?Te:we,children:e})]})})}),(0,H.jsx)(gc,{})]})]})}rt();var rl=le(`/`)({component:pe(()=>it(()=>import(`./routes-P7NzOusD.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])),`component`)});rt();var il=le(`/bookmarks`)({component:pe(()=>it(()=>import(`./bookmarks-BMf6Ytua.js`),__vite__mapDeps([26,1,2,27,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])),`component`)});rt();var al=le(`/data-sources`)({component:pe(()=>it(()=>import(`./data-sources-CqxgDfE3.js`),__vite__mapDeps([28,2,4,1,6,7,29,25,30,15,16])),`component`)});rt();var ol=le(`/likes`)({component:pe(()=>it(()=>import(`./likes-BaljrAHC.js`),__vite__mapDeps([31,1,2,27,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])),`component`)});rt();var sl=le(`/mentions`)({component:pe(()=>it(()=>import(`./mentions-TFNyR9F4.js`),__vite__mapDeps([32,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])),`component`)});rt();var cl=le(`/rate-limits`)({component:pe(()=>it(()=>import(`./rate-limits-DyRTb_U4.js`),__vite__mapDeps([33,2,4,1,6,34,25,30,15,16])),`component`)}),G={IndexRoute:rl.update({id:`/`,path:`/`,getParentRoute:()=>el}),BlocksRoute:at.update({id:`/blocks`,path:`/blocks`,getParentRoute:()=>el}),BookmarksRoute:il.update({id:`/bookmarks`,path:`/bookmarks`,getParentRoute:()=>el}),DataSourcesRoute:al.update({id:`/data-sources`,path:`/data-sources`,getParentRoute:()=>el}),DiscussRoute:ot.update({id:`/discuss`,path:`/discuss`,getParentRoute:()=>el}),DmsRoute:st.update({id:`/dms`,path:`/dms`,getParentRoute:()=>el}),InboxRoute:ct.update({id:`/inbox`,path:`/inbox`,getParentRoute:()=>el}),LikesRoute:ol.update({id:`/likes`,path:`/likes`,getParentRoute:()=>el}),LinksRoute:lt.update({id:`/links`,path:`/links`,getParentRoute:()=>el}),MentionsRoute:sl.update({id:`/mentions`,path:`/mentions`,getParentRoute:()=>el}),NetworkMapRoute:Ge.update({id:`/network-map`,path:`/network-map`,getParentRoute:()=>el}),ProfileAnalyzeRoute:ut.update({id:`/profile-analyze`,path:`/profile-analyze`,getParentRoute:()=>el}),RateLimitsRoute:cl.update({id:`/rate-limits`,path:`/rate-limits`,getParentRoute:()=>el}),TodayRoute:dt.update({id:`/today`,path:`/today`,getParentRoute:()=>el}),ProfilesHandleRoute:ft.update({id:`/profiles/$handle`,path:`/profiles/$handle`,getParentRoute:()=>el})},ll=el._addFileChildren(G);function ul(){return oc({routeTree:ll,scrollRestoration:!0,defaultPreload:`intent`,defaultPreloadStaleTime:6e4})}async function dl(){let e=await ul(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(_s),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await bs(e),e}var fl=dl;async function pl(){let e=await fl();return window.$_TSR?.h(),e}var ml;function hl(){return ml||=pl(),(0,H.jsx)(Ss,{promise:ml,children:e=>(0,H.jsx)(lc,{router:e})})}var gl=gt();(0,V.startTransition)(()=>{(0,gl.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(hl,{})}))});
@@ -1 +1 @@
1
- import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./SavedTimelineView-4QYaZ4CU.js";var n=e();function r(){return(0,n.jsx)(t,{eyebrow:`liked posts`,filter:`liked`,loadingLabel:`Loading liked posts...`,searchPlaceholder:`Search likes`,title:`Things worth keeping in the orbit.`})}export{r as component};
1
+ import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./SavedTimelineView-CFgHR6di.js";var n=e();function r(){return(0,n.jsx)(t,{eyebrow:`liked posts`,filter:`liked`,loadingLabel:`Loading liked posts...`,searchPlaceholder:`Search likes`,title:`Things worth keeping in the orbit.`})}export{r as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/links-D3Ut-aUB.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/createLucideIcon-CMLcIxOz.js","assets/chevron-down-e-c5H12y.js","assets/external-link-CfdTAkvn.js","assets/message-circle-79LZr2oN.js","assets/repeat-2-CQ0lek01.js","assets/search-C_LqodNa.js","assets/users-DI3w8Mol.js","assets/AvatarChip-DsHj3LT7.js","assets/FeedState-DhMv4zXD.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js","assets/route-search-CmZT7pGD.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{n,t as r}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as i}from"./schemas-CMQMhQXI.js";import{b as a,n as o,p as s,r as c}from"./query-client-CA-do_IS.js";import{t as l}from"./useQuery-CL_NXLnc.js";import{r as u}from"./AvatarChip-DsHj3LT7.js";import"./FeedState-DhMv4zXD.js";import"./ProfilePreview-CaaMHV2N.js";import"./SmartTimestamp-CXaNLqN7.js";import{t as d}from"./profile-hydration-client-DoFW3yKH.js";import{a as f}from"./route-search-CmZT7pGD.js";import{n as p,t as m}from"./preload-helper-MpqUbZCn.js";var h=e(t(),1);i();var g=1200,_=5*6e4,v=[{value:`today`,label:`Today`},{value:`week`,label:`Week`},{value:`month`,label:`Month`},{value:`year`,label:`Year`},{value:`all`,label:`All`}];function y(e){return e.title?.trim()||e.displayUrl}function b(e){return e.description?.trim()||e.displayUrl.split(`?`)[0]||e.displayUrl}function x(e,t,n,r){return[...o.linkInsights,{kind:e,range:t,sort:n,source:r}]}function S(e,t,n,r){let i=new URL(`/api/link-insights`,window.location.origin);return i.searchParams.set(`kind`,e),i.searchParams.set(`range`,t),i.searchParams.set(`sort`,n),i.searchParams.set(`source`,r),i.searchParams.set(`limit`,`30`),i.searchParams.set(`commentsLimit`,`30`),i}async function C(e,t,n,r,i){return c(S(e,t,n,r),{signal:i},s,`Link insights unavailable`)}function w(e,t){return e.sourceUrl||e.contentTweetUrl||t.url}function T(e){return e.commentText||e.sharedContentText||e.rawText||`Shared without comment`}function E(e,t){return!!(e&&t&&e.id===t.id)}function D(e){return e.find(e=>e.thumbnailUrl||e.url)??null}function O(e){try{let t=new URL(e),n=t.hostname.toLowerCase().replace(/^www\./,``);if(n===`youtu.be`)return t.pathname.split(`/`).filter(Boolean)[0]??null;if(!n.endsWith(`youtube.com`))return null;if(t.pathname===`/watch`)return t.searchParams.get(`v`);let r=t.pathname.split(`/`).filter(Boolean);return r[0]===`embed`||r[0]===`shorts`||r[0]===`live`?r[1]??null:null}catch{return null}}function k(e){let t=O(e);return!t||!/^[\w-]{6,}$/.test(t)?null:`https://i.ytimg.com/vi/${encodeURIComponent(t)}/hqdefault.jpg`}function A(e){return e.commentCount??e.mentions.filter(e=>e.hasComment).length}function j(e){return e.pureShareCount??e.mentions.filter(e=>e.isPureShare||!e.hasComment).length}function M(e){return/^id\d+$/i.test(e.handle)&&e.displayName===e.handle&&e.id===`profile_user_${e.handle.slice(2)}`}function N(e){return!e?.handle||M(e)?!1:!e.avatarUrl||e.followersCount===0}function P(e){let t=new Set;for(let n of e?.items??[])for(let e of[n.topSharer,...n.sharers,...n.mentions.flatMap(e=>[e.sharedBy,e.contentAuthor,e.participant])])if(!(!e||!N(e))&&(t.add(e.handle.replace(/^@/,``)),t.size>=30))return[...t];return[...t]}function F(e,t){let n=a(),{kind:r,range:i,source:s,sort:c,q:f}=e,p=l({queryKey:x(r,i,c,s),queryFn:({signal:e})=>C(r,i,c,s,e),staleTime:_}),m=p.data??null;return(0,h.useEffect)(()=>{if(!m)return;let e=r===`links`?`videos`:`links`,t=window.setTimeout(()=>{n.prefetchQuery({queryKey:x(e,i,c,s),queryFn:({signal:t})=>C(e,i,c,s,t),staleTime:_})},250);return()=>window.clearTimeout(t)},[m,r,n,i,c,s]),(0,h.useEffect)(()=>{let e=P(m);if(e.length===0)return;let t=!0,r=null,i=()=>{d(n,e,{limit:30}).then(e=>{t&&e.fetchedResults.some(e=>e.status===`hit`)&&n.invalidateQueries({queryKey:o.linkInsights})}).catch(e=>{t&&console.warn(`Profile hydration failed`,e)})},a=window.setTimeout(()=>{`requestIdleCallback`in window?r=window.requestIdleCallback(i,{timeout:2500}):i()},g);return()=>{t=!1,window.clearTimeout(a),r!==null&&`cancelIdleCallback`in window&&window.cancelIdleCallback(r)}},[m,n]),{kind:r,setKind:n=>t({...e,kind:n}),range:i,setRange:n=>t({...e,range:n}),source:s,setSource:n=>t({...e,source:n}),sort:c,setSort:n=>t({...e,sort:n}),search:f,setSearch:n=>t({...e,q:n},{replace:!0}),items:(0,h.useMemo)(()=>{let e=f.trim().toLowerCase();return(m?.items??[]).filter(t=>!e||[t.title,t.description,t.displayUrl,t.host,t.topSharer?.handle,...t.mentions.map(e=>e.commentText)].filter(Boolean).some(t=>String(t).toLowerCase().includes(e)))},[m?.items,f]),subtitle:(0,h.useMemo)(()=>{if(!m)return`Loading link memory...`;let e=r===`videos`?`video URLs`:`URLs`;return`${u(m.stats.occurrences)} ${e} across ${u(m.stats.groups)} groups`},[m,r]),loading:p.isPending,error:p.error?p.error instanceof Error?p.error.message:`Link insights unavailable`:null,retry:p.refetch}}p();var I=n(`/links`)({component:r(()=>m(()=>import(`./links-D3Ut-aUB.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),`component`),validateSearch:f});export{b as a,T as c,v as d,k as f,E as i,w as l,F as n,y as o,A as r,D as s,I as t,j as u};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/links-DMGuDd-B.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/schemas-CMQMhQXI.js","assets/createLucideIcon-CMLcIxOz.js","assets/chevron-down-e-c5H12y.js","assets/external-link-CfdTAkvn.js","assets/message-circle-79LZr2oN.js","assets/repeat-2-CQ0lek01.js","assets/search-C_LqodNa.js","assets/users-DI3w8Mol.js","assets/AvatarChip-DsHj3LT7.js","assets/FeedState-DhMv4zXD.js","assets/route-search-CmZT7pGD.js","assets/ProfilePreview-CaaMHV2N.js","assets/SmartTimestamp-CXaNLqN7.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{n,t as r}from"./lazyRouteComponent-CLLbUvMd.js";import{Rn as i}from"./schemas-CMQMhQXI.js";import{b as a,n as o,p as s,r as c}from"./query-client-CA-do_IS.js";import{t as l}from"./useQuery-CL_NXLnc.js";import{r as u}from"./AvatarChip-DsHj3LT7.js";import"./FeedState-DhMv4zXD.js";import{n as d,t as f}from"./preload-helper-MpqUbZCn.js";import{a as p}from"./route-search-CmZT7pGD.js";import"./ProfilePreview-CaaMHV2N.js";import"./SmartTimestamp-CXaNLqN7.js";import{t as m}from"./profile-hydration-client-DoFW3yKH.js";var h=e(t(),1);i();var g=1200,_=5*6e4,v=[{value:`today`,label:`Today`},{value:`week`,label:`Week`},{value:`month`,label:`Month`},{value:`year`,label:`Year`},{value:`all`,label:`All`}];function y(e){return e.title?.trim()||e.displayUrl}function b(e){return e.description?.trim()||e.displayUrl.split(`?`)[0]||e.displayUrl}function x(e,t,n,r){return[...o.linkInsights,{kind:e,range:t,sort:n,source:r}]}function S(e,t,n,r){let i=new URL(`/api/link-insights`,window.location.origin);return i.searchParams.set(`kind`,e),i.searchParams.set(`range`,t),i.searchParams.set(`sort`,n),i.searchParams.set(`source`,r),i.searchParams.set(`limit`,`30`),i.searchParams.set(`commentsLimit`,`30`),i}async function C(e,t,n,r,i){return c(S(e,t,n,r),{signal:i},s,`Link insights unavailable`)}function w(e,t){return e.sourceUrl||e.contentTweetUrl||t.url}function T(e){return e.commentText||e.sharedContentText||e.rawText||`Shared without comment`}function E(e,t){return!!(e&&t&&e.id===t.id)}function D(e){return e.find(e=>e.thumbnailUrl||e.url)??null}function O(e){try{let t=new URL(e),n=t.hostname.toLowerCase().replace(/^www\./,``);if(n===`youtu.be`)return t.pathname.split(`/`).filter(Boolean)[0]??null;if(!n.endsWith(`youtube.com`))return null;if(t.pathname===`/watch`)return t.searchParams.get(`v`);let r=t.pathname.split(`/`).filter(Boolean);return r[0]===`embed`||r[0]===`shorts`||r[0]===`live`?r[1]??null:null}catch{return null}}function k(e){let t=O(e);return!t||!/^[\w-]{6,}$/.test(t)?null:`https://i.ytimg.com/vi/${encodeURIComponent(t)}/hqdefault.jpg`}function A(e){return e.commentCount??e.mentions.filter(e=>e.hasComment).length}function j(e){return e.pureShareCount??e.mentions.filter(e=>e.isPureShare||!e.hasComment).length}function M(e){return/^id\d+$/i.test(e.handle)&&e.displayName===e.handle&&e.id===`profile_user_${e.handle.slice(2)}`}function N(e){return!e?.handle||M(e)?!1:!e.avatarUrl||e.followersCount===0}function P(e){let t=new Set;for(let n of e?.items??[])for(let e of[n.topSharer,...n.sharers,...n.mentions.flatMap(e=>[e.sharedBy,e.contentAuthor,e.participant])])if(!(!e||!N(e))&&(t.add(e.handle.replace(/^@/,``)),t.size>=30))return[...t];return[...t]}function F(e,t){let n=a(),{kind:r,range:i,source:s,sort:c,q:d}=e,f=l({queryKey:x(r,i,c,s),queryFn:({signal:e})=>C(r,i,c,s,e),staleTime:_}),p=f.data??null;return(0,h.useEffect)(()=>{if(!p)return;let e=r===`links`?`videos`:`links`,t=window.setTimeout(()=>{n.prefetchQuery({queryKey:x(e,i,c,s),queryFn:({signal:t})=>C(e,i,c,s,t),staleTime:_})},250);return()=>window.clearTimeout(t)},[p,r,n,i,c,s]),(0,h.useEffect)(()=>{let e=P(p);if(e.length===0)return;let t=!0,r=null,i=()=>{m(n,e,{limit:30}).then(e=>{t&&e.fetchedResults.some(e=>e.status===`hit`)&&n.invalidateQueries({queryKey:o.linkInsights})}).catch(e=>{t&&console.warn(`Profile hydration failed`,e)})},a=window.setTimeout(()=>{`requestIdleCallback`in window?r=window.requestIdleCallback(i,{timeout:2500}):i()},g);return()=>{t=!1,window.clearTimeout(a),r!==null&&`cancelIdleCallback`in window&&window.cancelIdleCallback(r)}},[p,n]),{kind:r,setKind:n=>t({...e,kind:n}),range:i,setRange:n=>t({...e,range:n}),source:s,setSource:n=>t({...e,source:n}),sort:c,setSort:n=>t({...e,sort:n}),search:d,setSearch:n=>t({...e,q:n},{replace:!0}),items:(0,h.useMemo)(()=>{let e=d.trim().toLowerCase();return(p?.items??[]).filter(t=>!e||[t.title,t.description,t.displayUrl,t.host,t.topSharer?.handle,...t.mentions.map(e=>e.commentText)].filter(Boolean).some(t=>String(t).toLowerCase().includes(e)))},[p?.items,d]),subtitle:(0,h.useMemo)(()=>{if(!p)return`Loading link memory...`;let e=r===`videos`?`video URLs`:`URLs`;return`${u(p.stats.occurrences)} ${e} across ${u(p.stats.groups)} groups`},[p,r]),loading:f.isPending,error:f.error?f.error instanceof Error?f.error.message:`Link insights unavailable`:null,retry:f.refetch}}d();var I=n(`/links`)({component:r(()=>f(()=>import(`./links-DMGuDd-B.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15])),`component`),validateSearch:p});export{b as a,T as c,v as d,k as f,E as i,w as l,F as n,y as o,A as r,D as s,I as t,j as u};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Gt as n,Kt as r,M as i,Rn as a,Ut as o,Wt as s,an as c,cn as l,dn as u,fn as d,on as f,sn as p}from"./schemas-CMQMhQXI.js";import{t as m}from"./createLucideIcon-CMLcIxOz.js";import{t as h}from"./chevron-down-e-c5H12y.js";import{t as g}from"./external-link-CfdTAkvn.js";import{t as _}from"./message-circle-79LZr2oN.js";import{t as v}from"./repeat-2-CQ0lek01.js";import{t as y}from"./search-C_LqodNa.js";import{t as b}from"./users-DI3w8Mol.js";import{r as x,t as S}from"./AvatarChip-DsHj3LT7.js";import{i as C,n as w,r as T,t as E}from"./FeedState-DhMv4zXD.js";import{t as D}from"./ProfilePreview-CaaMHV2N.js";import{t as O}from"./SmartTimestamp-CXaNLqN7.js";import{a as k}from"./route-search-CmZT7pGD.js";import{a as A,c as j,d as M,f as N,i as P,l as F,n as I,o as L,r as R,s as z,t as B,u as V}from"./links-6tWeHun_.js";var H=m(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),U=m(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),W=e(t()),G=a();function K({profile:e,className:t}){return e?(0,G.jsx)(D,{profile:e,children:(0,G.jsxs)(`span`,{className:i(`font-bold text-[var(--ink)] hover:underline`,t),children:[`@`,e.handle]})}):(0,G.jsx)(`span`,{className:i(`text-[var(--ink-soft)]`,t),children:`unknown`})}function q({item:e}){let t=e.sharers??[],n=(t.length>0?t:e.topSharer?[e.topSharer]:[]).slice(0,5),r=Math.max(0,e.uniqueSharers-n.length);return n.length===0?(0,G.jsx)(`span`,{children:`top unknown`}):(0,G.jsxs)(`div`,{className:`group/sharers relative z-10 inline-flex items-center gap-1 hover:z-50 focus-within:z-50`,children:[(0,G.jsx)(`div`,{className:`flex -space-x-2`,children:n.slice(0,4).map(e=>(0,G.jsx)(`a`,{"aria-label":`Open @${e.handle}`,className:`inline-flex rounded-full bg-[var(--bg)] ring-2 ring-[var(--bg)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(S,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`})},e.id))}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:`top`}),(0,G.jsxs)(`a`,{className:`font-medium text-[var(--ink-soft)] hover:underline`,href:`https://x.com/${n[0]?.handle??``}`,rel:`noreferrer`,target:`_blank`,children:[`@`,n[0]?.handle]})]}),r>0?(0,G.jsxs)(`span`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`+`,x(r)]}):null,(0,G.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-[calc(100%+8px)] z-[80] grid w-[280px] translate-y-1 gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg-elevated)] p-3 opacity-0 shadow-[0_8px_28px_var(--shadow-strong)] transition-all duration-150 group-hover/sharers:pointer-events-auto group-hover/sharers:translate-y-0 group-hover/sharers:opacity-100 group-focus-within/sharers:pointer-events-auto group-focus-within/sharers:translate-y-0 group-focus-within/sharers:opacity-100`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-bold text-[var(--ink)]`,children:[(0,G.jsx)(b,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[x(e.uniqueSharers),` sharers`]})]}),(0,G.jsx)(`div`,{className:`grid gap-2`,children:n.map(e=>(0,G.jsxs)(`a`,{className:`flex min-w-0 items-center gap-2 rounded-xl p-1 transition-colors hover:bg-[var(--bg-hover)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(S,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block truncate text-[14px] font-bold text-[var(--ink)]`,children:e.displayName}),(0,G.jsxs)(`span`,{className:`block truncate text-[13px] text-[var(--ink-soft)]`,children:[`@`,e.handle,` /`,` `,x(e.followersCount),` followers`]})]})]},e.id))})]})]})}function J({item:e,mention:t}){return(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 text-[13px]`,children:[t.sourceUrl?{href:t.sourceUrl,label:t.sourceKind===`dm`?`Open DM`:`Open tweet`}:null,t.contentTweetUrl?{href:t.contentTweetUrl,label:`Open source tweet`}:null,{href:e.url,label:`Open link`}].filter(Boolean).map(e=>(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-[var(--accent)] hover:underline`,href:e.href,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:e.label}),(0,G.jsx)(g,{className:`size-3.5`})]},`${e.label}:${e.href}`))})}function Y({item:e,mention:t}){let n=z(t.media),r=F(t,e),i=t.contentAuthor&&!P(t.sharedBy,t.contentAuthor)?t.contentAuthor:null;return(0,G.jsxs)(`article`,{className:`grid gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(K,{profile:t.sharedBy}),(0,G.jsx)(`span`,{children:t.sourceLabel??t.sourceKind}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(`a`,{className:`hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(O,{value:t.createdAt})})]}),(0,G.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,children:j(t)}),i?(0,G.jsxs)(`div`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`source by `,(0,G.jsx)(K,{profile:i})]}):null,n?(0,G.jsx)(`a`,{className:`block max-w-[220px] overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)]`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(`img`,{alt:n.altText||`Mention media`,className:`aspect-video h-auto w-full object-cover`,src:n.thumbnailUrl||n.url})}):null,(0,G.jsx)(J,{item:e,mention:t})]})}function X({item:e,mentions:t}){let n=t.map(e=>e.sharedBy).filter(Boolean).slice(0,6),r=t.find(e=>e.sourceUrl)?.sourceUrl;return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:(0,G.jsx)(v,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`text-[14px] font-bold text-[var(--ink)]`,children:[x(V(e)),` shares without comment`]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[n.map(e=>(0,G.jsx)(K,{profile:e},e.id)),V(e)>n.length?(0,G.jsxs)(`span`,{children:[`+`,x(V(e)-n.length),` `,`more`]}):null]})]})]}),r?(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-[13px] font-semibold text-[var(--accent)] hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:`Open first source`}),(0,G.jsx)(g,{className:`size-3.5`})]}):null]})}function Z({item:e}){let[t,n]=(0,W.useState)(!1),[r,a]=(0,W.useState)(3),o=e.mentions.filter(e=>e.hasComment),s=e.mentions.filter(e=>e.isPureShare||!e.hasComment),c=R(e),u=V(e),d=c+u,f=o.slice(0,r),p=Math.max(0,o.length-r),m=Math.max(0,c-f.length);return d===0?null:(0,G.jsxs)(`div`,{className:`mt-2 grid gap-2 border-t border-[var(--line)] pt-2`,children:[(0,G.jsxs)(`button`,{className:`inline-flex w-fit items-center gap-1 rounded-full border-0 bg-transparent px-2 py-1 text-[13px] font-bold text-[var(--accent)] transition-colors hover:bg-[var(--accent-soft)]`,onClick:()=>n(e=>!e),type:`button`,children:[(0,G.jsx)(_,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,x(c),` `,`comments`,u>0?` / ${x(u)} shares`:``]}),t?(0,G.jsx)(H,{className:`size-4`}):(0,G.jsx)(h,{className:`size-4`})]}),t?(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[f.map(t=>(0,G.jsx)(Y,{item:e,mention:t},t.id)),p>0?(0,G.jsxs)(`button`,{className:i(l,`w-fit`),onClick:()=>a(e=>e+6),type:`button`,children:[`Show`,` `,x(Math.min(6,p)),` `,`more`]}):null,m>0&&p===0?(0,G.jsxs)(`div`,{className:`rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2 text-[13px] text-[var(--ink-soft)]`,children:[x(m),` more mentions in archive. Narrow the range or raise the API limit to inspect them.`]}):null,u>0?(0,G.jsx)(X,{item:e,mentions:s}):null]}):null]})}function Q({item:e}){if(e.kind!==`videos`)return null;let t=z(e.mentions.flatMap(e=>e.media)),n=t?.thumbnailUrl||t?.url||N(e.url);return(0,G.jsxs)(`a`,{className:`mt-2 flex max-w-md items-center gap-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] transition-colors hover:bg-[var(--bg-active)]`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsxs)(`div`,{className:`relative grid aspect-video w-36 shrink-0 place-items-center overflow-hidden bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:[n?(0,G.jsx)(`img`,{alt:t?.altText||L(e),className:`h-full w-full object-cover transition-transform duration-150 hover:scale-105`,src:n}):(0,G.jsx)(U,{className:`size-6`}),(0,G.jsx)(`div`,{className:`absolute inset-0 grid place-items-center bg-black/20`,children:(0,G.jsx)(`span`,{className:`grid size-9 place-items-center rounded-full bg-black/70 text-white shadow-[0_4px_18px_rgba(0,0,0,0.35)]`,children:(0,G.jsx)(U,{className:`ml-0.5 size-4 fill-current`})})})]}),(0,G.jsxs)(`div`,{className:`min-w-0 py-2 pr-3`,children:[(0,G.jsx)(`div`,{className:`truncate text-[13px] font-bold text-[var(--ink)]`,children:L(e)}),(0,G.jsx)(`div`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:e.displayUrl})]})]})}function ee({index:e,item:t}){return(0,G.jsxs)(`article`,{className:`flex flex-col gap-2 border-b border-[var(--line)] px-4 py-3 transition-colors duration-150 hover:bg-[var(--bg-hover)]`,"data-perf":`link-insight-row`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[14px] font-bold text-[var(--ink-soft)]`,children:e+1}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`a`,{className:`block break-words text-[15px] font-bold text-[var(--ink)] [overflow-wrap:anywhere] hover:underline`,href:t.url,rel:`noreferrer`,target:`_blank`,children:L(t)}),(0,G.jsx)(`p`,{className:`mt-0.5 truncate text-[13px] text-[var(--ink-soft)]`,children:A(t)}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:t.host}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[x(t.shareCount),` shares`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[x(t.uniqueSharers),` sharers`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[x(R(t)),` comments`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(q,{item:t}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(O,{value:t.lastSeenAt})]}),(0,G.jsx)(Q,{item:t})]})]}),(0,G.jsx)(Z,{item:t})]})}function te(){let e=B.useSearch(),t=B.useNavigate();return(0,G.jsx)($,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function $({searchState:e,onSearchChange:t}={}){let[a,l]=(0,W.useState)(()=>k({})),{kind:m,setKind:h,range:g,setRange:_,source:v,setSource:b,sort:x,setSort:S,search:D,setSearch:O,items:A,subtitle:j,loading:N,error:P,retry:F}=I(e??a,(e,n)=>t?t(e,n):l(e));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:o,children:[(0,G.jsx)(`div`,{className:s,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`h1`,{className:r,children:`Links`}),(0,G.jsx)(`p`,{className:n,children:j})]})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,G.jsxs)(`label`,{className:i(p,`min-w-[180px] flex-1`),children:[(0,G.jsx)(y,{className:c,strokeWidth:2}),(0,G.jsx)(`input`,{className:f,onChange:e=>O(e.target.value),placeholder:`Search links`,value:D})]}),(0,G.jsx)(`div`,{className:d,children:[`links`,`videos`].map(e=>(0,G.jsx)(`button`,{className:i(u,m===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>h(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:d,children:M.map(e=>(0,G.jsx)(`button`,{className:i(u,g===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>_(e.value),type:`button`,children:e.label},e.value))}),(0,G.jsx)(`div`,{className:d,children:[`all`,`tweet`,`dm`].map(e=>(0,G.jsx)(`button`,{className:i(u,v===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>b(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:d,children:[`rank`,`recent`,`comments`].map(e=>(0,G.jsx)(`button`,{className:i(u,x===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>S(e),type:`button`,children:e},e))})]})]}),(0,G.jsxs)(`section`,{className:`flex flex-col`,children:[N?(0,G.jsx)(T,{detail:`Ranking URLs and collecting local discussion`,label:`Loading links`,children:(0,G.jsx)(C,{})}):P?(0,G.jsx)(w,{action:(0,G.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:()=>void F(),type:`button`,children:`Retry`}),message:P,title:`Could not load links`}):A.length===0?(0,G.jsx)(E,{detail:`Try a different range, source, or search term.`,label:`No links in this window`}):null,A.map((e,t)=>(0,G.jsx)(ee,{index:t,item:e},`${m}:${g}:${v}:${e.id}`))]})]})}export{$ as LinksRouteView,te as component};
1
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Gt as n,Kt as r,M as i,Rn as a,Ut as o,Wt as s,an as c,cn as l,dn as u,fn as d,on as f,sn as p}from"./schemas-CMQMhQXI.js";import{t as m}from"./createLucideIcon-CMLcIxOz.js";import{t as h}from"./chevron-down-e-c5H12y.js";import{t as g}from"./external-link-CfdTAkvn.js";import{t as _}from"./message-circle-79LZr2oN.js";import{t as v}from"./repeat-2-CQ0lek01.js";import{t as y}from"./search-C_LqodNa.js";import{t as b}from"./users-DI3w8Mol.js";import{r as x,t as S}from"./AvatarChip-DsHj3LT7.js";import{i as C,n as w,r as T,t as E}from"./FeedState-DhMv4zXD.js";import{a as D}from"./route-search-CmZT7pGD.js";import{t as O}from"./ProfilePreview-CaaMHV2N.js";import{t as k}from"./SmartTimestamp-CXaNLqN7.js";import{a as A,c as j,d as M,f as N,i as P,l as F,n as I,o as L,r as R,s as z,t as B,u as V}from"./links-CbC-fX7T.js";var H=m(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),U=m(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),W=e(t()),G=a();function K({profile:e,className:t}){return e?(0,G.jsx)(O,{profile:e,children:(0,G.jsxs)(`span`,{className:i(`font-bold text-[var(--ink)] hover:underline`,t),children:[`@`,e.handle]})}):(0,G.jsx)(`span`,{className:i(`text-[var(--ink-soft)]`,t),children:`unknown`})}function q({item:e}){let t=e.sharers??[],n=(t.length>0?t:e.topSharer?[e.topSharer]:[]).slice(0,5),r=Math.max(0,e.uniqueSharers-n.length);return n.length===0?(0,G.jsx)(`span`,{children:`top unknown`}):(0,G.jsxs)(`div`,{className:`group/sharers relative z-10 inline-flex items-center gap-1 hover:z-50 focus-within:z-50`,children:[(0,G.jsx)(`div`,{className:`flex -space-x-2`,children:n.slice(0,4).map(e=>(0,G.jsx)(`a`,{"aria-label":`Open @${e.handle}`,className:`inline-flex rounded-full bg-[var(--bg)] ring-2 ring-[var(--bg)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(S,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`})},e.id))}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:`top`}),(0,G.jsxs)(`a`,{className:`font-medium text-[var(--ink-soft)] hover:underline`,href:`https://x.com/${n[0]?.handle??``}`,rel:`noreferrer`,target:`_blank`,children:[`@`,n[0]?.handle]})]}),r>0?(0,G.jsxs)(`span`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`+`,x(r)]}):null,(0,G.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-[calc(100%+8px)] z-[80] grid w-[280px] translate-y-1 gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg-elevated)] p-3 opacity-0 shadow-[0_8px_28px_var(--shadow-strong)] transition-all duration-150 group-hover/sharers:pointer-events-auto group-hover/sharers:translate-y-0 group-hover/sharers:opacity-100 group-focus-within/sharers:pointer-events-auto group-focus-within/sharers:translate-y-0 group-focus-within/sharers:opacity-100`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-bold text-[var(--ink)]`,children:[(0,G.jsx)(b,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[x(e.uniqueSharers),` sharers`]})]}),(0,G.jsx)(`div`,{className:`grid gap-2`,children:n.map(e=>(0,G.jsxs)(`a`,{className:`flex min-w-0 items-center gap-2 rounded-xl p-1 transition-colors hover:bg-[var(--bg-hover)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(S,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block truncate text-[14px] font-bold text-[var(--ink)]`,children:e.displayName}),(0,G.jsxs)(`span`,{className:`block truncate text-[13px] text-[var(--ink-soft)]`,children:[`@`,e.handle,` /`,` `,x(e.followersCount),` followers`]})]})]},e.id))})]})]})}function J({item:e,mention:t}){return(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 text-[13px]`,children:[t.sourceUrl?{href:t.sourceUrl,label:t.sourceKind===`dm`?`Open DM`:`Open tweet`}:null,t.contentTweetUrl?{href:t.contentTweetUrl,label:`Open source tweet`}:null,{href:e.url,label:`Open link`}].filter(Boolean).map(e=>(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-[var(--accent)] hover:underline`,href:e.href,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:e.label}),(0,G.jsx)(g,{className:`size-3.5`})]},`${e.label}:${e.href}`))})}function Y({item:e,mention:t}){let n=z(t.media),r=F(t,e),i=t.contentAuthor&&!P(t.sharedBy,t.contentAuthor)?t.contentAuthor:null;return(0,G.jsxs)(`article`,{className:`grid gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(K,{profile:t.sharedBy}),(0,G.jsx)(`span`,{children:t.sourceLabel??t.sourceKind}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(`a`,{className:`hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(k,{value:t.createdAt})})]}),(0,G.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,children:j(t)}),i?(0,G.jsxs)(`div`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`source by `,(0,G.jsx)(K,{profile:i})]}):null,n?(0,G.jsx)(`a`,{className:`block max-w-[220px] overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)]`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(`img`,{alt:n.altText||`Mention media`,className:`aspect-video h-auto w-full object-cover`,src:n.thumbnailUrl||n.url})}):null,(0,G.jsx)(J,{item:e,mention:t})]})}function X({item:e,mentions:t}){let n=t.map(e=>e.sharedBy).filter(Boolean).slice(0,6),r=t.find(e=>e.sourceUrl)?.sourceUrl;return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:(0,G.jsx)(v,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`text-[14px] font-bold text-[var(--ink)]`,children:[x(V(e)),` shares without comment`]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[n.map(e=>(0,G.jsx)(K,{profile:e},e.id)),V(e)>n.length?(0,G.jsxs)(`span`,{children:[`+`,x(V(e)-n.length),` `,`more`]}):null]})]})]}),r?(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-[13px] font-semibold text-[var(--accent)] hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:`Open first source`}),(0,G.jsx)(g,{className:`size-3.5`})]}):null]})}function Z({item:e}){let[t,n]=(0,W.useState)(!1),[r,a]=(0,W.useState)(3),o=e.mentions.filter(e=>e.hasComment),s=e.mentions.filter(e=>e.isPureShare||!e.hasComment),c=R(e),u=V(e),d=c+u,f=o.slice(0,r),p=Math.max(0,o.length-r),m=Math.max(0,c-f.length);return d===0?null:(0,G.jsxs)(`div`,{className:`mt-2 grid gap-2 border-t border-[var(--line)] pt-2`,children:[(0,G.jsxs)(`button`,{className:`inline-flex w-fit items-center gap-1 rounded-full border-0 bg-transparent px-2 py-1 text-[13px] font-bold text-[var(--accent)] transition-colors hover:bg-[var(--accent-soft)]`,onClick:()=>n(e=>!e),type:`button`,children:[(0,G.jsx)(_,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,x(c),` `,`comments`,u>0?` / ${x(u)} shares`:``]}),t?(0,G.jsx)(H,{className:`size-4`}):(0,G.jsx)(h,{className:`size-4`})]}),t?(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[f.map(t=>(0,G.jsx)(Y,{item:e,mention:t},t.id)),p>0?(0,G.jsxs)(`button`,{className:i(l,`w-fit`),onClick:()=>a(e=>e+6),type:`button`,children:[`Show`,` `,x(Math.min(6,p)),` `,`more`]}):null,m>0&&p===0?(0,G.jsxs)(`div`,{className:`rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2 text-[13px] text-[var(--ink-soft)]`,children:[x(m),` more mentions in archive. Narrow the range or raise the API limit to inspect them.`]}):null,u>0?(0,G.jsx)(X,{item:e,mentions:s}):null]}):null]})}function Q({item:e}){if(e.kind!==`videos`)return null;let t=z(e.mentions.flatMap(e=>e.media)),n=t?.thumbnailUrl||t?.url||N(e.url);return(0,G.jsxs)(`a`,{className:`mt-2 flex max-w-md items-center gap-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] transition-colors hover:bg-[var(--bg-active)]`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsxs)(`div`,{className:`relative grid aspect-video w-36 shrink-0 place-items-center overflow-hidden bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:[n?(0,G.jsx)(`img`,{alt:t?.altText||L(e),className:`h-full w-full object-cover transition-transform duration-150 hover:scale-105`,src:n}):(0,G.jsx)(U,{className:`size-6`}),(0,G.jsx)(`div`,{className:`absolute inset-0 grid place-items-center bg-black/20`,children:(0,G.jsx)(`span`,{className:`grid size-9 place-items-center rounded-full bg-black/70 text-white shadow-[0_4px_18px_rgba(0,0,0,0.35)]`,children:(0,G.jsx)(U,{className:`ml-0.5 size-4 fill-current`})})})]}),(0,G.jsxs)(`div`,{className:`min-w-0 py-2 pr-3`,children:[(0,G.jsx)(`div`,{className:`truncate text-[13px] font-bold text-[var(--ink)]`,children:L(e)}),(0,G.jsx)(`div`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:e.displayUrl})]})]})}function ee({index:e,item:t}){return(0,G.jsxs)(`article`,{className:`flex flex-col gap-2 border-b border-[var(--line)] px-4 py-3 transition-colors duration-150 hover:bg-[var(--bg-hover)]`,"data-perf":`link-insight-row`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[14px] font-bold text-[var(--ink-soft)]`,children:e+1}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`a`,{className:`block break-words text-[15px] font-bold text-[var(--ink)] [overflow-wrap:anywhere] hover:underline`,href:t.url,rel:`noreferrer`,target:`_blank`,children:L(t)}),(0,G.jsx)(`p`,{className:`mt-0.5 truncate text-[13px] text-[var(--ink-soft)]`,children:A(t)}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:t.host}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[x(t.shareCount),` shares`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[x(t.uniqueSharers),` sharers`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[x(R(t)),` comments`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(q,{item:t}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(k,{value:t.lastSeenAt})]}),(0,G.jsx)(Q,{item:t})]})]}),(0,G.jsx)(Z,{item:t})]})}function te(){let e=B.useSearch(),t=B.useNavigate();return(0,G.jsx)($,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function $({searchState:e,onSearchChange:t}={}){let[a,l]=(0,W.useState)(()=>D({})),{kind:m,setKind:h,range:g,setRange:_,source:v,setSource:b,sort:x,setSort:S,search:O,setSearch:k,items:A,subtitle:j,loading:N,error:P,retry:F}=I(e??a,(e,n)=>t?t(e,n):l(e));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:o,children:[(0,G.jsx)(`div`,{className:s,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`h1`,{className:r,children:`Links`}),(0,G.jsx)(`p`,{className:n,children:j})]})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,G.jsxs)(`label`,{className:i(p,`min-w-[180px] flex-1`),children:[(0,G.jsx)(y,{className:c,strokeWidth:2}),(0,G.jsx)(`input`,{className:f,onChange:e=>k(e.target.value),placeholder:`Search links`,value:O})]}),(0,G.jsx)(`div`,{className:d,children:[`links`,`videos`].map(e=>(0,G.jsx)(`button`,{className:i(u,m===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>h(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:d,children:M.map(e=>(0,G.jsx)(`button`,{className:i(u,g===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>_(e.value),type:`button`,children:e.label},e.value))}),(0,G.jsx)(`div`,{className:d,children:[`all`,`tweet`,`dm`].map(e=>(0,G.jsx)(`button`,{className:i(u,v===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>b(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:d,children:[`rank`,`recent`,`comments`].map(e=>(0,G.jsx)(`button`,{className:i(u,x===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>S(e),type:`button`,children:e},e))})]})]}),(0,G.jsxs)(`section`,{className:`flex flex-col`,children:[N?(0,G.jsx)(T,{detail:`Ranking URLs and collecting local discussion`,label:`Loading links`,children:(0,G.jsx)(C,{})}):P?(0,G.jsx)(w,{action:(0,G.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:()=>void F(),type:`button`,children:`Retry`}),message:P,title:`Could not load links`}):A.length===0?(0,G.jsx)(E,{detail:`Try a different range, source, or search term.`,label:`No links in this window`}):null,A.map((e,t)=>(0,G.jsx)(ee,{index:t,item:e},`${m}:${g}:${v}:${e.id}`))]})]})}export{$ as LinksRouteView,te as component};
@@ -1 +1 @@
1
- import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./TimelineRouteFrame-DJdUR7DX.js";var n=e();function r(e){return e?`${String(e.stats.mentions)} mention/reply items in local store`:`Loading mentions...`}function i(){return(0,n.jsx)(t,{emptyDetail:`Try All, search less narrowly, or sync mentions.`,emptyLabel:`No mentions in this view`,errorFallback:`Mentions unavailable`,errorTitle:`Could not load mentions`,initialReplyFilter:`unreplied`,loadingDetail:`Checking local mentions and reply context`,loadingLabel:`Loading mentions`,resource:`mentions`,searchPlaceholder:`Search mentions`,subtitle:r,syncKind:`mentions`,syncLabel:`Sync mentions`,title:`Mentions`})}export{i as component};
1
+ import{Rn as e}from"./schemas-CMQMhQXI.js";import{t}from"./TimelineRouteFrame-DcipwBqo.js";var n=e();function r(e){return e?`${String(e.stats.mentions)} mention/reply items in local store`:`Loading mentions...`}function i(){return(0,n.jsx)(t,{emptyDetail:`Try All, search less narrowly, or sync mentions.`,emptyLabel:`No mentions in this view`,errorFallback:`Mentions unavailable`,errorTitle:`Could not load mentions`,initialReplyFilter:`unreplied`,loadingDetail:`Checking local mentions and reply context`,loadingLabel:`Loading mentions`,resource:`mentions`,searchPlaceholder:`Search mentions`,subtitle:r,syncKind:`mentions`,syncLabel:`Sync mentions`,title:`Mentions`})}export{i as component};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mapbox-DfIoNJn2.js","assets/rolldown-runtime-B-9mzPXz.js","assets/react-BwGzW7mM.js","assets/react-dom-DEMAB80t.js","assets/preload-helper-MpqUbZCn.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Gt as n,Ht as r,Kt as i,M as a,Rn as o,Tn as s,Ut as c,Wt as l,an as u,cn as d,dn as f,dt as p,fn as m,on as h,sn as g}from"./schemas-CMQMhQXI.js";import{t as _}from"./createLucideIcon-CMLcIxOz.js";import{a as v,c as y,d as b,f as x,h as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M}from"./network-map-2EPsbMIT.js";import{t as N}from"./refresh-cw-IUfM9D_1.js";import{t as P}from"./search-C_LqodNa.js";import{t as F}from"./users-DI3w8Mol.js";import{o as I}from"./route-search-CmZT7pGD.js";import{n as L,t as R}from"./preload-helper-MpqUbZCn.js";var z=_(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),B=_(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),V=e(t()),H=o();L();function U({icon:e,label:t,value:n}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-b border-[var(--line)] px-4 py-3 sm:border-r`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,H.jsx)(e,{className:`size-4`,strokeWidth:1.8}),(0,H.jsx)(`span`,{children:t})]}),(0,H.jsx)(`div`,{className:`truncate text-[24px] font-bold tracking-tight text-[var(--ink)]`,children:w(n)})]})}function W(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let e=!1;return R(()=>import(`./mapbox-DfIoNJn2.js`).then(n=>{e||t(n)}),__vite__mapDeps([0,1,2,3,4])).catch(t=>{e||r(t instanceof Error?t.message:`Map failed`)}),()=>{e=!0}},[]),{module:e,error:n}}function G({feature:e,size:t=36,className:n,style:r}){let i=v(e),[o,s]=(0,V.useState)(null),c=i&&o!==i;return(0,H.jsx)(`div`,{className:a(`relative grid shrink-0 place-items-center overflow-hidden rounded-full bg-[var(--accent-soft)] text-[12px] font-bold text-[var(--accent)] ring-2 ring-white`,n),style:{width:t,height:t,...r},children:c?(0,H.jsx)(`img`,{src:i,alt:``,className:`h-full w-full object-cover`,loading:`lazy`,onError:()=>s(i)}):(0,H.jsx)(`span`,{children:C(e)})})}function K({feature:e}){let t=T(e.properties.relationship);return(0,H.jsxs)(`button`,{type:`button`,className:`group relative grid size-11 place-items-center rounded-full border-0 bg-transparent p-0 transition-transform hover:z-10 hover:scale-110`,"aria-label":`Open @${e.properties.handle}`,title:`@${e.properties.handle}`,children:[(0,H.jsx)(`span`,{className:`absolute inset-0 rounded-full opacity-90 shadow-[0_10px_28px_rgba(15,20,25,0.28)]`,style:{backgroundColor:t}}),(0,H.jsx)(G,{feature:e,size:34,className:`relative ring-[3px]`})]})}function q({count:e,features:t,stats:n}){let r=Math.min(82,Math.max(52,44+Math.log2(e)*7)),i=r>=72?30:25;return(0,H.jsxs)(`button`,{type:`button`,className:`group relative rounded-full border-0 bg-transparent p-0 transition-transform hover:z-10 hover:scale-105`,"aria-label":`${w(e)} located profiles`,title:`${w(e)} profiles`,style:{width:r,height:r},children:[(0,H.jsx)(`span`,{className:`absolute inset-0 rounded-full opacity-95 shadow-[0_18px_42px_rgba(15,20,25,0.32)]`,style:{background:A(n)}}),(0,H.jsx)(`span`,{className:`absolute inset-[4px] rounded-full bg-white/88 backdrop-blur-sm`}),(0,H.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:t.slice(0,4).map((e,t)=>(0,H.jsx)(G,{feature:e,size:i,className:`absolute`,style:{transform:`translate(${[-10,10,-7,8][t]??0}px, ${[-9,-8,11,10][t]??0}px)`}},e.properties.profileId))}),(0,H.jsx)(`span`,{className:`absolute -right-1 -top-1 min-w-7 rounded-full bg-[#0f1419] px-1.5 py-0.5 text-center text-[11px] font-bold leading-5 text-white ring-2 ring-white`,children:e>99?`99+`:w(e)})]})}function J({data:e,onViewportChange:t}){let{module:n,error:r}=W(),i=(0,V.useRef)(null),[a,o]=(0,V.useState)(k),[c,l]=(0,V.useState)(null),u=(0,V.useMemo)(()=>D(e.features),[e]),d=(0,V.useMemo)(()=>u.getClusters(a.bounds,Math.max(0,Math.floor(a.zoom))),[u,a]);(0,V.useEffect)(()=>{l(null)},[e]);let f=(0,V.useCallback)(e=>{let n=O(e.target);n&&(o(n),t(n))},[t]);if(!e.config.mapboxToken)return(0,H.jsx)(Y,{data:e});if(r)return(0,H.jsxs)(`div`,{className:s,children:[(0,H.jsx)(B,{className:`mr-2 inline size-4`,strokeWidth:1.8}),r]});if(!n)return(0,H.jsx)(`div`,{className:s,children:`Loading map...`});let{default:p,Marker:m,NavigationControl:h,Popup:g}=n;return(0,H.jsx)(`div`,{className:`min-h-[520px] flex-1 overflow-hidden bg-[var(--bg-active)] min-[1180px]:min-h-0`,children:(0,H.jsxs)(p,{ref:i,initialViewState:{longitude:9,latitude:24,zoom:1.2},mapStyle:document.documentElement.dataset.theme===`dark`?`mapbox://styles/mapbox/dark-v11`:`mapbox://styles/mapbox/light-v11`,mapboxAccessToken:e.config.mapboxToken,onClick:()=>l(null),onLoad:f,onMoveEnd:f,projection:`mercator`,style:{width:`100%`,height:`100%`},children:[(0,H.jsx)(h,{position:`top-right`,showCompass:!1}),d.map(t=>{let[n,r]=t.geometry.coordinates;if(x(t)){let n=t.geometry.coordinates,r=u.getLeaves(t.properties.cluster_id,48).map(t=>e.features[t.properties.featureIndex]).filter(e=>!!e).sort(y),[o,s]=b(r,n);return(0,H.jsx)(m,{longitude:o,latitude:s,anchor:`center`,onClick:e=>{e.originalEvent?.stopPropagation();let n=Math.min(u.getClusterExpansionZoom(t.properties.cluster_id),12);i.current?.flyTo?.({center:[o,s],zoom:Math.max(a.zoom+.85,n-.6),duration:520}),l({kind:`cluster`,coordinates:[o,s],count:t.properties.point_count,features:r,stats:t.properties})},children:(0,H.jsx)(q,{count:t.properties.point_count,features:r,stats:t.properties})},`cluster-${String(t.properties.cluster_id)}`)}let o=e.features[t.properties.featureIndex];return o?(0,H.jsx)(m,{longitude:n,latitude:r,anchor:`center`,onClick:e=>{e.originalEvent?.stopPropagation(),l({kind:`profile`,feature:o})},children:(0,H.jsx)(K,{feature:o})},o.properties.profileId):null}),c?(0,H.jsx)(g,{longitude:c.kind===`profile`?c.feature.geometry.coordinates[0]:c.coordinates[0],latitude:c.kind===`profile`?c.feature.geometry.coordinates[1]:c.coordinates[1],closeButton:!1,offset:12,onClose:()=>l(null),children:c.kind===`profile`?(0,H.jsx)(X,{feature:c.feature}):(0,H.jsx)(Z,{count:c.count,features:c.features,stats:c.stats})}):null]})})}function Y({data:e}){let t=e.features.slice(0,1500).map(e=>{let[t,n]=e.geometry.coordinates;return{feature:e,x:(t+180)/360*1e3,y:(90-n)/180*500}});return(0,H.jsx)(`div`,{className:`border-b border-[var(--line)] bg-[var(--bg-active)] px-4 py-4`,children:(0,H.jsxs)(`svg`,{viewBox:`0 0 1000 500`,className:`h-auto w-full rounded-md border border-[var(--line)] bg-[var(--bg)]`,role:`img`,"aria-label":`Network map`,children:[(0,H.jsx)(`defs`,{children:(0,H.jsx)(`pattern`,{id:`map-grid`,width:`100`,height:`100`,patternUnits:`userSpaceOnUse`,children:(0,H.jsx)(`path`,{d:`M 100 0 L 0 0 0 100`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.08`,strokeWidth:`1`})})}),(0,H.jsx)(`rect`,{width:`1000`,height:`500`,fill:`url(#map-grid)`}),(0,H.jsx)(`path`,{d:`M60 205 C145 155 210 145 280 178 C352 212 424 186 495 194 C594 206 665 157 746 178 C836 201 907 227 952 282`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.18`,strokeWidth:`36`,strokeLinecap:`round`}),t.map(({feature:e,x:t,y:n})=>(0,H.jsx)(`circle`,{cx:t,cy:n,r:e.properties.relationship===`mutual`?4.5:3.5,fill:e.properties.relationship===`mutual`?`#22c55e`:e.properties.relationship===`following`?`#f59e0b`:`#1d9bf0`,opacity:`0.86`},e.properties.profileId))]})})}function X({feature:e}){return(0,H.jsxs)(`div`,{className:`flex max-w-[280px] gap-3 text-[13px] text-[#0f1419]`,children:[(0,H.jsx)(G,{feature:e,size:48,className:`ring-[#d9e2ea]`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`truncate font-bold`,children:e.properties.name}),(0,H.jsxs)(`div`,{className:`truncate text-[#536471]`,children:[`@`,e.properties.handle]}),(0,H.jsx)(`div`,{className:`mt-1 line-clamp-2`,children:e.properties.location}),e.properties.resolvedLocation?(0,H.jsx)(`div`,{className:`truncate text-[#536471]`,children:e.properties.resolvedLocation}):null]})]})}function Z({count:e,features:t,stats:n}){return(0,H.jsxs)(`div`,{className:`w-[290px] text-[13px] text-[#0f1419]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`font-bold`,children:[w(e),` profiles here`]}),(0,H.jsxs)(`div`,{className:`text-[#536471]`,children:[w(n.mutual),` mutual ·`,` `,w(n.following),` following ·`,` `,w(n.followers),` followers`]})]}),(0,H.jsx)(`div`,{className:`size-11 shrink-0 rounded-full ring-2 ring-[#d9e2ea]`,style:{background:A(n)}})]}),(0,H.jsx)(`div`,{className:`mt-3 flex -space-x-2`,children:t.slice(0,6).map(e=>(0,H.jsx)(G,{feature:e,size:36,className:`ring-[#ffffff]`},e.properties.profileId))}),(0,H.jsx)(`div`,{className:`mt-3 divide-y divide-[#eff3f4]`,children:t.slice(0,5).map(e=>(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 py-2`,children:[(0,H.jsx)(G,{feature:e,size:28,className:`ring-[#ffffff]`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`truncate font-semibold`,children:e.properties.name}),(0,H.jsxs)(`div`,{className:`truncate text-[#536471]`,children:[`@`,e.properties.handle]})]}),(0,H.jsx)(`div`,{className:`size-2 rounded-full`,style:{backgroundColor:T(e.properties.relationship)}})]},e.properties.profileId))})]})}function Q({feature:e}){return(0,H.jsxs)(`a`,{className:`flex min-w-0 gap-3 border-b border-[var(--line)] px-4 py-3 transition-colors hover:bg-[var(--bg-hover)]`,href:`/profiles/${encodeURIComponent(e.properties.handle)}`,children:[(0,H.jsx)(G,{feature:e,size:40,className:`ring-[var(--bg)]`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate font-bold text-[var(--ink)]`,children:e.properties.name}),(0,H.jsxs)(`span`,{className:`truncate text-[var(--ink-soft)]`,children:[`@`,e.properties.handle]})]}),(0,H.jsxs)(`div`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:[e.properties.location,e.properties.resolvedLocation?` -> ${e.properties.resolvedLocation}`:``]}),(0,H.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2 text-[12px] text-[var(--ink-soft)]`,children:[(0,H.jsx)(`span`,{children:M(e.properties.relationship)}),(0,H.jsxs)(`span`,{children:[w(e.properties.followersCount),` followers`]})]})]})]})}function ee({features:e,search:t,onSearchChange:n,totalVisible:r,zoom:i}){return(0,H.jsxs)(`aside`,{className:`flex min-h-[420px] min-w-0 flex-col border-t border-[var(--line)] bg-[var(--bg)] min-[1180px]:h-full min-[1180px]:border-t-0 min-[1180px]:border-l`,children:[(0,H.jsxs)(`header`,{className:`sticky top-0 z-10 border-b border-[var(--line)] bg-[color:color-mix(in_srgb,var(--bg)_88%,transparent)] px-4 py-3 backdrop-blur`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`truncate text-[16px] font-bold text-[var(--ink)]`,children:`Who's In View`}),(0,H.jsxs)(`p`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:[w(r),` in this map view · zoom`,` `,i.toFixed(1)]})]}),(0,H.jsx)(`div`,{className:`rounded-full border border-[var(--line)] px-2 py-1 text-[12px] font-semibold text-[var(--ink-soft)]`,children:w(e.length)})]}),(0,H.jsxs)(`label`,{className:a(g,`mt-3 h-10`),children:[(0,H.jsx)(P,{className:u,strokeWidth:2}),(0,H.jsx)(`input`,{className:h,onChange:e=>n(e.target.value),placeholder:`Search visible people`,value:t})]})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.length>0?e.map(e=>(0,H.jsx)(Q,{feature:e},e.properties.profileId)):(0,H.jsx)(`div`,{className:s,children:t.trim()?`No visible profiles match that search.`:`Pan or zoom the map to see profiles in this area.`})})]})}function te(){let e=j.useSearch(),t=j.useNavigate();return(0,H.jsx)($,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function $({searchState:e,onSearchChange:t}={}){let[o,u]=(0,V.useState)(()=>I({})),{type:h,setType:g,viewport:_,setViewport:v,visibleSearch:y,setVisibleSearch:b,data:x,loading:C,error:T,refresh:D,visibleFeatures:O,filteredVisibleFeatures:k,mapTypes:A}=E(e??o,(e,n)=>t?t(e,n):u(e));return(0,H.jsxs)(`section`,{className:`flex min-h-screen flex-col min-[1180px]:h-screen min-[1180px]:min-h-0 min-[1180px]:overflow-hidden`,children:[(0,H.jsxs)(`header`,{className:c,children:[(0,H.jsxs)(`div`,{className:l,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:i,children:`Network Map`}),(0,H.jsx)(`div`,{className:n,children:x?`${w(x.meta.locatedProfiles)} located · ${w(x.meta.meaningfulProfiles)} with usable locations`:`Loading network geography...`})]}),(0,H.jsx)(`div`,{className:r,children:(0,H.jsxs)(`button`,{className:d,type:`button`,onClick:()=>D(),disabled:C,children:[(0,H.jsx)(N,{className:a(`size-4`,C&&`animate-spin`)}),`Refresh`]})})]}),(0,H.jsx)(`div`,{className:`border-t border-[var(--line)] px-4 py-3`,children:(0,H.jsx)(`div`,{className:m,children:A.map(e=>(0,H.jsx)(`button`,{type:`button`,className:a(f,h===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>g(e.value),children:e.label},e.value))})})]}),T?(0,H.jsx)(`div`,{className:p,children:T}):null,x?(0,H.jsxs)(`div`,{className:`grid min-h-[620px] flex-1 grid-cols-1 min-[1180px]:min-h-0 min-[1180px]:grid-cols-[minmax(0,1fr)_390px] min-[1180px]:overflow-hidden min-[1500px]:grid-cols-[minmax(0,1fr)_430px]`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col`,children:[(0,H.jsxs)(`div`,{className:`grid sm:grid-cols-4`,children:[(0,H.jsx)(U,{icon:F,label:`Profiles`,value:x.meta.totalProfiles}),(0,H.jsx)(U,{icon:z,label:`Locations`,value:x.meta.meaningfulProfiles}),(0,H.jsx)(U,{icon:S,label:`Located`,value:x.meta.locatedProfiles}),(0,H.jsx)(U,{icon:N,label:`Geocoded`,value:x.meta.geocodedThisRun})]}),!x.meta.opencageConfigured&&x.meta.missingGeocodes>0?(0,H.jsx)(`div`,{className:s,children:`OpenCage key missing; showing cached and coordinate locations only.`}):null,x.meta.mapboxTokenConfigured?null:(0,H.jsx)(`div`,{className:s,children:`Mapbox token missing; showing the lightweight map.`}),(0,H.jsx)(J,{data:x,onViewportChange:v})]}),(0,H.jsx)(ee,{features:k,onSearchChange:b,search:y,totalVisible:O.length,zoom:_.zoom})]}):C?(0,H.jsx)(`div`,{className:s,children:`Loading map...`}):null]})}export{$ as NetworkMapRouteView,te as component};
2
+ import{r as e}from"./rolldown-runtime-B-9mzPXz.js";import{t}from"./react-BwGzW7mM.js";import{Gt as n,Ht as r,Kt as i,M as a,Rn as o,Tn as s,Ut as c,Wt as l,an as u,cn as d,dn as f,dt as p,fn as m,on as h,sn as g}from"./schemas-CMQMhQXI.js";import{t as _}from"./createLucideIcon-CMLcIxOz.js";import{a as v,c as y,d as b,f as x,h as S,i as C,l as w,m as T,n as E,o as D,p as O,r as k,s as A,t as j,u as M}from"./network-map-CKiXfloJ.js";import{t as N}from"./refresh-cw-IUfM9D_1.js";import{t as P}from"./search-C_LqodNa.js";import{t as F}from"./users-DI3w8Mol.js";import{n as I,t as L}from"./preload-helper-MpqUbZCn.js";import{o as R}from"./route-search-CmZT7pGD.js";var z=_(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),B=_(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),V=e(t()),H=o();I();function U({icon:e,label:t,value:n}){return(0,H.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-b border-[var(--line)] px-4 py-3 sm:border-r`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)]`,children:[(0,H.jsx)(e,{className:`size-4`,strokeWidth:1.8}),(0,H.jsx)(`span`,{children:t})]}),(0,H.jsx)(`div`,{className:`truncate text-[24px] font-bold tracking-tight text-[var(--ink)]`,children:w(n)})]})}function W(){let[e,t]=(0,V.useState)(null),[n,r]=(0,V.useState)(null);return(0,V.useEffect)(()=>{let e=!1;return L(()=>import(`./mapbox-DfIoNJn2.js`).then(n=>{e||t(n)}),__vite__mapDeps([0,1,2,3,4])).catch(t=>{e||r(t instanceof Error?t.message:`Map failed`)}),()=>{e=!0}},[]),{module:e,error:n}}function G({feature:e,size:t=36,className:n,style:r}){let i=v(e),[o,s]=(0,V.useState)(null),c=i&&o!==i;return(0,H.jsx)(`div`,{className:a(`relative grid shrink-0 place-items-center overflow-hidden rounded-full bg-[var(--accent-soft)] text-[12px] font-bold text-[var(--accent)] ring-2 ring-white`,n),style:{width:t,height:t,...r},children:c?(0,H.jsx)(`img`,{src:i,alt:``,className:`h-full w-full object-cover`,loading:`lazy`,onError:()=>s(i)}):(0,H.jsx)(`span`,{children:C(e)})})}function K({feature:e}){let t=T(e.properties.relationship);return(0,H.jsxs)(`button`,{type:`button`,className:`group relative grid size-11 place-items-center rounded-full border-0 bg-transparent p-0 transition-transform hover:z-10 hover:scale-110`,"aria-label":`Open @${e.properties.handle}`,title:`@${e.properties.handle}`,children:[(0,H.jsx)(`span`,{className:`absolute inset-0 rounded-full opacity-90 shadow-[0_10px_28px_rgba(15,20,25,0.28)]`,style:{backgroundColor:t}}),(0,H.jsx)(G,{feature:e,size:34,className:`relative ring-[3px]`})]})}function q({count:e,features:t,stats:n}){let r=Math.min(82,Math.max(52,44+Math.log2(e)*7)),i=r>=72?30:25;return(0,H.jsxs)(`button`,{type:`button`,className:`group relative rounded-full border-0 bg-transparent p-0 transition-transform hover:z-10 hover:scale-105`,"aria-label":`${w(e)} located profiles`,title:`${w(e)} profiles`,style:{width:r,height:r},children:[(0,H.jsx)(`span`,{className:`absolute inset-0 rounded-full opacity-95 shadow-[0_18px_42px_rgba(15,20,25,0.32)]`,style:{background:A(n)}}),(0,H.jsx)(`span`,{className:`absolute inset-[4px] rounded-full bg-white/88 backdrop-blur-sm`}),(0,H.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center`,children:t.slice(0,4).map((e,t)=>(0,H.jsx)(G,{feature:e,size:i,className:`absolute`,style:{transform:`translate(${[-10,10,-7,8][t]??0}px, ${[-9,-8,11,10][t]??0}px)`}},e.properties.profileId))}),(0,H.jsx)(`span`,{className:`absolute -right-1 -top-1 min-w-7 rounded-full bg-[#0f1419] px-1.5 py-0.5 text-center text-[11px] font-bold leading-5 text-white ring-2 ring-white`,children:e>99?`99+`:w(e)})]})}function J({data:e,onViewportChange:t}){let{module:n,error:r}=W(),i=(0,V.useRef)(null),[a,o]=(0,V.useState)(k),[c,l]=(0,V.useState)(null),u=(0,V.useMemo)(()=>D(e.features),[e]),d=(0,V.useMemo)(()=>u.getClusters(a.bounds,Math.max(0,Math.floor(a.zoom))),[u,a]);(0,V.useEffect)(()=>{l(null)},[e]);let f=(0,V.useCallback)(e=>{let n=O(e.target);n&&(o(n),t(n))},[t]);if(!e.config.mapboxToken)return(0,H.jsx)(Y,{data:e});if(r)return(0,H.jsxs)(`div`,{className:s,children:[(0,H.jsx)(B,{className:`mr-2 inline size-4`,strokeWidth:1.8}),r]});if(!n)return(0,H.jsx)(`div`,{className:s,children:`Loading map...`});let{default:p,Marker:m,NavigationControl:h,Popup:g}=n;return(0,H.jsx)(`div`,{className:`min-h-[520px] flex-1 overflow-hidden bg-[var(--bg-active)] min-[1180px]:min-h-0`,children:(0,H.jsxs)(p,{ref:i,initialViewState:{longitude:9,latitude:24,zoom:1.2},mapStyle:document.documentElement.dataset.theme===`dark`?`mapbox://styles/mapbox/dark-v11`:`mapbox://styles/mapbox/light-v11`,mapboxAccessToken:e.config.mapboxToken,onClick:()=>l(null),onLoad:f,onMoveEnd:f,projection:`mercator`,style:{width:`100%`,height:`100%`},children:[(0,H.jsx)(h,{position:`top-right`,showCompass:!1}),d.map(t=>{let[n,r]=t.geometry.coordinates;if(x(t)){let n=t.geometry.coordinates,r=u.getLeaves(t.properties.cluster_id,48).map(t=>e.features[t.properties.featureIndex]).filter(e=>!!e).sort(y),[o,s]=b(r,n);return(0,H.jsx)(m,{longitude:o,latitude:s,anchor:`center`,onClick:e=>{e.originalEvent?.stopPropagation();let n=Math.min(u.getClusterExpansionZoom(t.properties.cluster_id),12);i.current?.flyTo?.({center:[o,s],zoom:Math.max(a.zoom+.85,n-.6),duration:520}),l({kind:`cluster`,coordinates:[o,s],count:t.properties.point_count,features:r,stats:t.properties})},children:(0,H.jsx)(q,{count:t.properties.point_count,features:r,stats:t.properties})},`cluster-${String(t.properties.cluster_id)}`)}let o=e.features[t.properties.featureIndex];return o?(0,H.jsx)(m,{longitude:n,latitude:r,anchor:`center`,onClick:e=>{e.originalEvent?.stopPropagation(),l({kind:`profile`,feature:o})},children:(0,H.jsx)(K,{feature:o})},o.properties.profileId):null}),c?(0,H.jsx)(g,{longitude:c.kind===`profile`?c.feature.geometry.coordinates[0]:c.coordinates[0],latitude:c.kind===`profile`?c.feature.geometry.coordinates[1]:c.coordinates[1],closeButton:!1,offset:12,onClose:()=>l(null),children:c.kind===`profile`?(0,H.jsx)(X,{feature:c.feature}):(0,H.jsx)(Z,{count:c.count,features:c.features,stats:c.stats})}):null]})})}function Y({data:e}){let t=e.features.slice(0,1500).map(e=>{let[t,n]=e.geometry.coordinates;return{feature:e,x:(t+180)/360*1e3,y:(90-n)/180*500}});return(0,H.jsx)(`div`,{className:`border-b border-[var(--line)] bg-[var(--bg-active)] px-4 py-4`,children:(0,H.jsxs)(`svg`,{viewBox:`0 0 1000 500`,className:`h-auto w-full rounded-md border border-[var(--line)] bg-[var(--bg)]`,role:`img`,"aria-label":`Network map`,children:[(0,H.jsx)(`defs`,{children:(0,H.jsx)(`pattern`,{id:`map-grid`,width:`100`,height:`100`,patternUnits:`userSpaceOnUse`,children:(0,H.jsx)(`path`,{d:`M 100 0 L 0 0 0 100`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.08`,strokeWidth:`1`})})}),(0,H.jsx)(`rect`,{width:`1000`,height:`500`,fill:`url(#map-grid)`}),(0,H.jsx)(`path`,{d:`M60 205 C145 155 210 145 280 178 C352 212 424 186 495 194 C594 206 665 157 746 178 C836 201 907 227 952 282`,fill:`none`,stroke:`currentColor`,strokeOpacity:`0.18`,strokeWidth:`36`,strokeLinecap:`round`}),t.map(({feature:e,x:t,y:n})=>(0,H.jsx)(`circle`,{cx:t,cy:n,r:e.properties.relationship===`mutual`?4.5:3.5,fill:e.properties.relationship===`mutual`?`#22c55e`:e.properties.relationship===`following`?`#f59e0b`:`#1d9bf0`,opacity:`0.86`},e.properties.profileId))]})})}function X({feature:e}){return(0,H.jsxs)(`div`,{className:`flex max-w-[280px] gap-3 text-[13px] text-[#0f1419]`,children:[(0,H.jsx)(G,{feature:e,size:48,className:`ring-[#d9e2ea]`}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:`truncate font-bold`,children:e.properties.name}),(0,H.jsxs)(`div`,{className:`truncate text-[#536471]`,children:[`@`,e.properties.handle]}),(0,H.jsx)(`div`,{className:`mt-1 line-clamp-2`,children:e.properties.location}),e.properties.resolvedLocation?(0,H.jsx)(`div`,{className:`truncate text-[#536471]`,children:e.properties.resolvedLocation}):null]})]})}function Z({count:e,features:t,stats:n}){return(0,H.jsxs)(`div`,{className:`w-[290px] text-[13px] text-[#0f1419]`,children:[(0,H.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsxs)(`div`,{className:`font-bold`,children:[w(e),` profiles here`]}),(0,H.jsxs)(`div`,{className:`text-[#536471]`,children:[w(n.mutual),` mutual ·`,` `,w(n.following),` following ·`,` `,w(n.followers),` followers`]})]}),(0,H.jsx)(`div`,{className:`size-11 shrink-0 rounded-full ring-2 ring-[#d9e2ea]`,style:{background:A(n)}})]}),(0,H.jsx)(`div`,{className:`mt-3 flex -space-x-2`,children:t.slice(0,6).map(e=>(0,H.jsx)(G,{feature:e,size:36,className:`ring-[#ffffff]`},e.properties.profileId))}),(0,H.jsx)(`div`,{className:`mt-3 divide-y divide-[#eff3f4]`,children:t.slice(0,5).map(e=>(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 py-2`,children:[(0,H.jsx)(G,{feature:e,size:28,className:`ring-[#ffffff]`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsx)(`div`,{className:`truncate font-semibold`,children:e.properties.name}),(0,H.jsxs)(`div`,{className:`truncate text-[#536471]`,children:[`@`,e.properties.handle]})]}),(0,H.jsx)(`div`,{className:`size-2 rounded-full`,style:{backgroundColor:T(e.properties.relationship)}})]},e.properties.profileId))})]})}function Q({feature:e}){return(0,H.jsxs)(`a`,{className:`flex min-w-0 gap-3 border-b border-[var(--line)] px-4 py-3 transition-colors hover:bg-[var(--bg-hover)]`,href:`/profiles/${encodeURIComponent(e.properties.handle)}`,children:[(0,H.jsx)(G,{feature:e,size:40,className:`ring-[var(--bg)]`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:`truncate font-bold text-[var(--ink)]`,children:e.properties.name}),(0,H.jsxs)(`span`,{className:`truncate text-[var(--ink-soft)]`,children:[`@`,e.properties.handle]})]}),(0,H.jsxs)(`div`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:[e.properties.location,e.properties.resolvedLocation?` -> ${e.properties.resolvedLocation}`:``]}),(0,H.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2 text-[12px] text-[var(--ink-soft)]`,children:[(0,H.jsx)(`span`,{children:M(e.properties.relationship)}),(0,H.jsxs)(`span`,{children:[w(e.properties.followersCount),` followers`]})]})]})]})}function ee({features:e,search:t,onSearchChange:n,totalVisible:r,zoom:i}){return(0,H.jsxs)(`aside`,{className:`flex min-h-[420px] min-w-0 flex-col border-t border-[var(--line)] bg-[var(--bg)] min-[1180px]:h-full min-[1180px]:border-t-0 min-[1180px]:border-l`,children:[(0,H.jsxs)(`header`,{className:`sticky top-0 z-10 border-b border-[var(--line)] bg-[color:color-mix(in_srgb,var(--bg)_88%,transparent)] px-4 py-3 backdrop-blur`,children:[(0,H.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`h2`,{className:`truncate text-[16px] font-bold text-[var(--ink)]`,children:`Who's In View`}),(0,H.jsxs)(`p`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:[w(r),` in this map view · zoom`,` `,i.toFixed(1)]})]}),(0,H.jsx)(`div`,{className:`rounded-full border border-[var(--line)] px-2 py-1 text-[12px] font-semibold text-[var(--ink-soft)]`,children:w(e.length)})]}),(0,H.jsxs)(`label`,{className:a(g,`mt-3 h-10`),children:[(0,H.jsx)(P,{className:u,strokeWidth:2}),(0,H.jsx)(`input`,{className:h,onChange:e=>n(e.target.value),placeholder:`Search visible people`,value:t})]})]}),(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.length>0?e.map(e=>(0,H.jsx)(Q,{feature:e},e.properties.profileId)):(0,H.jsx)(`div`,{className:s,children:t.trim()?`No visible profiles match that search.`:`Pan or zoom the map to see profiles in this area.`})})]})}function te(){let e=j.useSearch(),t=j.useNavigate();return(0,H.jsx)($,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function $({searchState:e,onSearchChange:t}={}){let[o,u]=(0,V.useState)(()=>R({})),{type:h,setType:g,viewport:_,setViewport:v,visibleSearch:y,setVisibleSearch:b,data:x,loading:C,error:T,refresh:D,visibleFeatures:O,filteredVisibleFeatures:k,mapTypes:A}=E(e??o,(e,n)=>t?t(e,n):u(e));return(0,H.jsxs)(`section`,{className:`flex min-h-screen flex-col min-[1180px]:h-screen min-[1180px]:min-h-0 min-[1180px]:overflow-hidden`,children:[(0,H.jsxs)(`header`,{className:c,children:[(0,H.jsxs)(`div`,{className:l,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`h1`,{className:i,children:`Network Map`}),(0,H.jsx)(`div`,{className:n,children:x?`${w(x.meta.locatedProfiles)} located · ${w(x.meta.meaningfulProfiles)} with usable locations`:`Loading network geography...`})]}),(0,H.jsx)(`div`,{className:r,children:(0,H.jsxs)(`button`,{className:d,type:`button`,onClick:()=>D(),disabled:C,children:[(0,H.jsx)(N,{className:a(`size-4`,C&&`animate-spin`)}),`Refresh`]})})]}),(0,H.jsx)(`div`,{className:`border-t border-[var(--line)] px-4 py-3`,children:(0,H.jsx)(`div`,{className:m,children:A.map(e=>(0,H.jsx)(`button`,{type:`button`,className:a(f,h===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>g(e.value),children:e.label},e.value))})})]}),T?(0,H.jsx)(`div`,{className:p,children:T}):null,x?(0,H.jsxs)(`div`,{className:`grid min-h-[620px] flex-1 grid-cols-1 min-[1180px]:min-h-0 min-[1180px]:grid-cols-[minmax(0,1fr)_390px] min-[1180px]:overflow-hidden min-[1500px]:grid-cols-[minmax(0,1fr)_430px]`,children:[(0,H.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-col`,children:[(0,H.jsxs)(`div`,{className:`grid sm:grid-cols-4`,children:[(0,H.jsx)(U,{icon:F,label:`Profiles`,value:x.meta.totalProfiles}),(0,H.jsx)(U,{icon:z,label:`Locations`,value:x.meta.meaningfulProfiles}),(0,H.jsx)(U,{icon:S,label:`Located`,value:x.meta.locatedProfiles}),(0,H.jsx)(U,{icon:N,label:`Geocoded`,value:x.meta.geocodedThisRun})]}),!x.meta.opencageConfigured&&x.meta.missingGeocodes>0?(0,H.jsx)(`div`,{className:s,children:`OpenCage key missing; showing cached and coordinate locations only.`}):null,x.meta.mapboxTokenConfigured?null:(0,H.jsx)(`div`,{className:s,children:`Mapbox token missing; showing the lightweight map.`}),(0,H.jsx)(J,{data:x,onViewportChange:v})]}),(0,H.jsx)(ee,{features:k,onSearchChange:b,search:y,totalVisible:O.length,zoom:_.zoom})]}):C?(0,H.jsx)(`div`,{className:s,children:`Loading map...`}):null]})}export{$ as NetworkMapRouteView,te as component};