1import{f as v,r as f}from"./vendor-wagmi-CRHMQcRy.js";import{cf as m,cg as p,ch as y,$ as g}from"./index-CjDX1y09.js";import{d as x}from"./useNavigateToDirectCastsConversation--fX2rKm8.js";import{u as D}from"./DirectCastUtils-Csf6YDsT.js";import{u as w}from"./useRemoveDirectCastConversationFromInbox-m7Ycxkfy.js";const M=()=>{const n=v();return f.useCallback(({conversation:o})=>{n.setQueryData(m({conversationId:o.conversationId}),{result:{conversation:o}})},[n])},F=()=>{const n=p(),o=M(),i=D(),r=w(),d=y(),{apiClient:c}=g();return f.useCallback(({currentUser:t,conversationId:e,counterParties:u})=>{const s=n({conversationId:e});if(s){r({fid:t.fid,conversationId:e,category:s.viewerContext?.category}),i({fid:t.fid,category:s.viewerContext?.category,conversation:{...s,viewerContext:{...s.viewerContext}}});return}const C=u[0];o({conversation:{conversationId:e,adminFids:[],removedFids:[],participants:[...u,t],lastReadTime:0,selfLastReadTime:0,lastMessage:void 0,pinnedMessages:[],hasPinnedMessages:!1,isGroup:!1,isCollectionTokenGated:!1,unreadCount:0,name:void 0,muted:!1,hasMention:!1,groupPreferences:void 0,activeParticipantsCount:0,description:void 0,photoUrl:void 0,messageTTLDays:x,createdAt:Date.now(),viewerContext:{access:"admin",archived:!1,manuallyMarkedUnread:!1,category:"default",lastReadAt:0,muted:!1,pinned:!1,unreadCount:0,unreadMentionsCount:0,unreadReactionMessage:void 0,counterParty:C,tag:void 0}}}),i({fid:t.fid,category:"default",conversation:{conversationId:e,adminFids:[],name:void 0,description:void 0,photoUrl:void 0,lastReadTime:0,createdAt:Date.now(),isGroup:!1,viewerContext:{manuallyMarkedUnread:!1,category:"default",lastReadAt:0,muted:!1,pinned:!1,unreadCount:0,unreadMentionsCount:0,unreadReactionMessage:void 0,counterParty:C,tag:void 0}}}),c.getDirectCastConversation({conversationId:e}).then(({data:l})=>{const a=l?.result?.conversation;a&&(d({updates:{...a,conversationId:e,viewerContext:{category:a.viewerContext?.category}}}),r({fid:t.fid,conversationId:e,category:"default"}),i({fid:t.fid,category:a.viewerContext?.category,conversation:{...a,viewerContext:{...a.viewerContext}}}))}).catch(()=>{})},[o,n,i,r,c,d])};export{F as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.