import{a as c,b as p,c as g}from"./chunk-XEHBQAFR.mjs";var d={};p(d,{default:()=>m});var t,m,u=c(()=>{"use strict";t=function(){var s=[{defaultValue:null,kind:"LocalArgument",name:"profileId"}],a=[{kind:"Variable",name:"profileId",variableName:"profileId"}],e={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"totalCount",storageKey:null},o={alias:null,args:null,kind:"ScalarField",name:"count",storageKey:null},r={alias:null,args:null,kind:"ScalarField",name:"markedUnread",storageKey:null},i={alias:null,args:null,concreteType:"MessageConnection",kind:"LinkedField",name:"allMessages",plural:!1,selections:[{alias:null,args:null,concreteType:"MessageEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"Message",kind:"LinkedField",name:"node",plural:!1,selections:[e,{alias:null,args:null,kind:"ScalarField",name:"isRead",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null};return{fragment:{argumentDefinitions:s,kind:"Fragment",metadata:null,name:"useMessageCountUpdateSubscription",selections:[{alias:null,args:a,concreteType:"ChatRoomOnMessagesCountUpdate",kind:"LinkedField",name:"chatRoomOnMessagesCountUpdate",plural:!1,selections:[{alias:null,args:null,concreteType:"Profile",kind:"LinkedField",name:"profile",plural:!1,selections:[e,{alias:null,args:null,concreteType:"ChatRoomConnection",kind:"LinkedField",name:"chatRooms",plural:!1,selections:[l,{alias:null,args:null,concreteType:"ChatRoomEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"node",plural:!1,selections:[e,{alias:null,args:null,concreteType:"UnreadMessageCount",kind:"LinkedField",name:"unreadMessages",plural:!1,selections:[o,r],storageKey:null},i],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Subscription",abstractKey:null},kind:"Request",operation:{argumentDefinitions:s,kind:"Operation",name:"useMessageCountUpdateSubscription",selections:[{alias:null,args:a,concreteType:"ChatRoomOnMessagesCountUpdate",kind:"LinkedField",name:"chatRoomOnMessagesCountUpdate",plural:!1,selections:[{alias:null,args:null,concreteType:"Profile",kind:"LinkedField",name:"profile",plural:!1,selections:[e,{alias:null,args:null,concreteType:"ChatRoomConnection",kind:"LinkedField",name:"chatRooms",plural:!1,selections:[l,{alias:null,args:null,concreteType:"ChatRoomEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"ChatRoom",kind:"LinkedField",name:"node",plural:!1,selections:[e,{alias:null,args:null,concreteType:"UnreadMessageCount",kind:"LinkedField",name:"unreadMessages",plural:!1,selections:[o,r,e],storageKey:null},i],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{cacheID:"ee87a4300f113870813418b0a818d031",id:null,metadata:{},name:"useMessageCountUpdateSubscription",operationKind:"subscription",text:`subscription useMessageCountUpdateSubscription(
  $profileId: ID!
) {
  chatRoomOnMessagesCountUpdate(profileId: $profileId) {
    profile {
      id
      chatRooms {
        totalCount
        edges {
          node {
            id
            unreadMessages {
              count
              markedUnread
              id
            }
            allMessages {
              edges {
                node {
                  id
                  isRead
                }
              }
            }
          }
        }
      }
    }
  }
}
`}}}();t.hash="57b09f90d1cdf7f57abc3956378d6b27";m=t});import{useMemo as f}from"react";import{useCurrentProfile as y}from"@baseapp-frontend/authentication";import{useSubscription as k}from"react-relay";var n,C=(n!==void 0||(n=(u(),g(d)),n.hash&&n.hash!=="57b09f90d1cdf7f57abc3956378d6b27"&&console.error("The definition of 'useMessageCountUpdateSubscription' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data.")),n),R=function(){var a=y(),e=a.currentProfile,l=f(function(){return{subscription:C,onError:console.error,variables:{profileId:e?.id}}},[e?.id]);return k(l)};export{R as a};
//# sourceMappingURL=chunk-6DWLCF33.mjs.map