// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
// @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{qi as t}from"./lucide-icons-BdRF0moN.js";import{t as n}from"./dist-DQ82bf9M.js";import{t as r}from"./useQuery-rCAlChE8.js";import{c as i}from"./blobbi-CLChx8JU.js";import{f as a,g as o,h as s,v as c}from"./blobbi-shop-items-gin9pdH4.js";var l=e(t(),1),u=30,d=360*60;function f(e){let{nostr:t}=n(),f=(0,l.useMemo)(()=>{if(e)return i(e.event.pubkey,e.d)},[e]),p=(0,l.useMemo)(()=>o(e),[e]),m=r({queryKey:[`blobbi-interactions`,f,p.valid?p.checkpoint.processed_until:0,p.valid?p.checkpoint.last_event_id:``],queryFn:async({signal:n})=>{if(!f)return[];let r=Math.floor(Date.now()/1e3)-d,i=p.valid?Math.max(p.checkpoint.processed_until,r):r,o={kinds:[a],"#a":[f],limit:u,since:i},l=await t.query([o],{signal:n}),m=e.event.pubkey,h=[];for(let e of c(l)){if(e.pubkey===m)continue;let t=s(e);t&&h.push(t)}if(p.valid){let e=p.checkpoint.last_event_id;return h.filter(t=>t.event.id!==e)}return h},enabled:!!f,staleTime:6e4,gcTime:300*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!0});return{interactions:m.data??[],isLoading:m.isLoading,isError:m.isError}}export{f as t};
// @license-end
