{"version":3,"file":"react-bindings.mjs","names":[],"sources":["../../src/bindings/react/hooks/useCreateFeedsClient.ts","../../src/bindings/react/contexts/StreamFeedsContext.tsx","../../src/bindings/react/hooks/client-state-hooks/useClientConnectedUser.ts","../../src/bindings/react/hooks/client-state-hooks/useWsConnectionState.ts","../../src/bindings/react/contexts/StreamFeedContext.tsx","../../src/bindings/react/hooks/internal/useStableCallback.ts","../../src/bindings/react/hooks/feed-state-hooks/useFeedActivities.ts","../../src/bindings/react/hooks/feed-state-hooks/useComments.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts","../../src/bindings/react/hooks/feed-state-hooks/useFollowers.ts","../../src/bindings/react/hooks/feed-state-hooks/useFollowing.ts","../../src/bindings/react/hooks/feed-state-hooks/useFeedMetadata.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnFollows.ts","../../src/bindings/react/hooks/feed-state-hooks/useNotificationStatus.ts","../../src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts","../../src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts","../../src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts","../../src/bindings/react/contexts/StreamActivityWithStateUpdatesContext.tsx","../../src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnFollowings.ts","../../src/bindings/react/hooks/feed-state-hooks/useMembers.ts","../../src/bindings/react/contexts/StreamSearchResultsContext.tsx","../../src/bindings/react/hooks/search-state-hooks/useSearchResult.ts","../../src/bindings/react/contexts/StreamSearchContext.tsx","../../src/bindings/react/hooks/search-state-hooks/useSearchQuery.ts","../../src/bindings/react/hooks/search-state-hooks/useSearchSources.ts","../../src/bindings/react/wrappers/StreamFeeds.tsx","../../src/bindings/react/wrappers/StreamFeed.tsx","../../src/bindings/react/wrappers/StreamActivityWithStateUpdates.tsx","../../src/bindings/react/wrappers/StreamSearch.tsx","../../src/bindings/react/wrappers/StreamSearchResults.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { FeedsClient } from '../../../feeds-client';\nimport type { TokenOrProvider } from '../../../types';\nimport type { CreateGuestResponse, UserRequest } from '../../../gen/models';\nimport type { FeedsClientOptions } from '../../../common/types';\n\n/**\n * A React hook to create, connect and return an instance of `FeedsClient`.\n */\nexport const useCreateFeedsClient = ({\n  apiKey,\n  tokenOrProvider,\n  userData: userDataOrAnonymous,\n  options,\n}: {\n  apiKey: string;\n  tokenOrProvider?: TokenOrProvider | 'guest';\n  userData: UserRequest | 'anonymous';\n  options?: FeedsClientOptions;\n}) => {\n  const userData =\n    userDataOrAnonymous === 'anonymous' ? undefined : userDataOrAnonymous;\n\n  if (userDataOrAnonymous !== 'anonymous' && !tokenOrProvider) {\n    throw new Error(\n      'Token provider can only be omitted when connecting anonymous user. If you want to connect as a guest, provide \"guest\" instead of a token provider.',\n    );\n  }\n\n  const [client, setClient] = useState<FeedsClient | null>(null);\n  const [error, setError] = useState<Error | null>(null);\n  const [cachedUserData, setCachedUserData] = useState(userData);\n\n  const [cachedOptions] = useState(options);\n\n  if (error) {\n    throw error;\n  }\n\n  if (userData?.id !== cachedUserData?.id) {\n    setCachedUserData(userData);\n  }\n\n  useEffect(() => {\n    const _client = new FeedsClient(apiKey, cachedOptions);\n\n    let connectionPromise: Promise<void | CreateGuestResponse>;\n    if (!cachedUserData) {\n      connectionPromise = _client.connectAnonymous();\n    } else if (tokenOrProvider === 'guest') {\n      connectionPromise = _client.connectGuest({\n        user: cachedUserData,\n      });\n    } else {\n      connectionPromise = _client.connectUser(cachedUserData, tokenOrProvider!);\n    }\n\n    connectionPromise = connectionPromise\n      .then(() => {\n        setError(null);\n      })\n      .catch((err) => {\n        setError(err);\n      });\n\n    setClient(_client);\n\n    return () => {\n      setClient(null);\n      connectionPromise\n        .then(() => {\n          setError(null);\n          return _client.disconnectUser();\n        })\n        .catch((err) => {\n          setError(err);\n        });\n    };\n  }, [apiKey, cachedUserData, cachedOptions, tokenOrProvider]);\n\n  return client;\n};\n","import { createContext, useContext } from 'react';\n\nimport type { FeedsClient } from '../../../feeds-client';\n\nexport const StreamFeedsContext = createContext<FeedsClient | undefined>(undefined);\n\n/**\n * The props for the StreamFeedsProvider component.\n */\nexport type StreamFeedsContextProps = {\n  /**\n   * The client instance to provide to the component tree.\n   */\n  client: FeedsClient;\n};\n\n/**\n * Hook to access the nearest FeedsClient instance.\n */\nexport const useFeedsClient = () => {\n  return useContext(StreamFeedsContext);\n};\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\nimport type { FeedsClientState } from '../../../../feeds-client';\n\n/**\n * A React hook that returns the currently connected user on a `FeedsClient` instance and null otherwise.\n */\nexport const useClientConnectedUser = () => {\n  const client = useFeedsClient();\n\n  const { user } = useStateStore(client?.state, selector) ?? {};\n\n  return user;\n};\n\nconst selector = (nextState: FeedsClientState) => ({\n  user: nextState.connected_user,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\nimport type { FeedsClientState } from '../../../../feeds-client';\n\n/**\n * A React hook that returns the websocket connection state of `FeedsClient`.\n */\nexport const useWsConnectionState = () => {\n  const client = useFeedsClient();\n\n  const { is_healthy } = useStateStore(client?.state, selector) ?? {}\n\n  return { is_healthy };\n};\n\nconst selector = (nextState: FeedsClientState) => ({\n  is_healthy: nextState.is_ws_connection_healthy,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { Feed } from '../../../feed';\n\nexport const StreamFeedContext = createContext<Feed | undefined>(undefined);\n\n/**\n * The props for the StreamFeedProvider component.\n */\nexport type StreamFeedContextProps = {\n  feed: Feed;\n};\n\n/**\n * Hook to access the nearest Feed instance.\n */\nexport const useFeedContext = () => {\n  return useContext(StreamFeedContext);\n};\n","import { useCallback, useRef } from 'react';\n\nexport type StableCallback<A extends unknown[], R> = (...args: A) => R;\n\n/**\n * A utility hook implementing a stable callback. It takes in an unstable method that\n * is supposed to be invoked somewhere deeper in the DOM tree without making it\n * change its reference every time the parent component rerenders. It will also return\n * the value of the callback if it does return one.\n * A common use-case would be having a function whose invocation depends on state\n * somewhere high up in the DOM tree and wanting to use the same function deeper\n * down, for example in a leaf node and simply using useCallback results in\n * cascading dependency hell. If we wrap it in useStableCallback, we would be able\n * to:\n * - Use the same function as a dependency of another hook (since it is stable)\n * - Still invoke it and get the latest state\n *\n * **Caveats:**\n * - Never wrap a function that is supposed to return a React.ReactElement in\n *   useStableCallback, since React will not know that the DOM needs to be updated\n *   whenever the callback value changes (for example, renderItem from FlatList must\n *   never be wrapped in this hook)\n * - Always prefer using a standard useCallback/stable function wherever possible\n *   (the purpose of useStableCallback is to bridge the gap between top level contexts\n *   and cascading rereders in downstream components - **not** as an escape hatch)\n * @param callback - the callback we want to stabilize\n */\nexport const useStableCallback = <A extends unknown[], R>(\n  callback: StableCallback<A, R>,\n): StableCallback<A, R> => {\n  const ref = useRef(callback);\n  ref.current = callback;\n\n  return useCallback<StableCallback<A, R>>((...args) => {\n    return ref.current(...args);\n  }, []);\n};\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useStableCallback } from '../internal';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive object containing the current activities,\n * loading state and whether there is a next page to paginate to or not.\n */\nexport const useFeedActivities = (feedFromProps?: Feed) => {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  const data = useStateStore(feed?.state, selector);\n\n  const loadNextPage = useStableCallback(async () => {\n    if (!feed || !data?.has_next_page || data?.is_loading) {\n      return;\n    }\n\n    await feed.getNextPage();\n  });\n\n  return useMemo(() => ({ ...data, loadNextPage }), [data, loadNextPage]);\n};\n\nconst selector = ({\n  is_loading_activities,\n  next,\n  activities = [],\n}: FeedState) => ({\n  is_loading: is_loading_activities,\n  has_next_page: typeof next !== 'undefined',\n  activities,\n});\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage, isCommentResponse } from '../../../../utils';\nimport type { ActivityResponse, CommentResponse } from '../../../../gen/models';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { CommentParent } from '../../../../types';\n\ntype UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {\n  comments: NonNullable<\n    FeedState['comments_by_entity_id'][T['id']]\n  >['comments'];\n  comments_pagination: NonNullable<\n    FeedState['comments_by_entity_id'][T['id']]\n  >['pagination'];\n  has_next_page: boolean;\n  is_loading_next_page: boolean;\n  loadNextPage: (\n    request?: T extends CommentResponse\n      ? Parameters<Feed['loadNextPageCommentReplies']>[1]\n      : Parameters<Feed['loadNextPageActivityComments']>[1],\n  ) => Promise<void>;\n};\n\n/**\n * @deprecated Use `useActivityComments` instead.\n * @param\n */\nexport function useComments<T extends CommentParent>(_: {\n  feed: Feed;\n  parent: T;\n}): UseCommentsReturnType<T>;\nexport function useComments<T extends CommentParent>(_: {\n  feed?: Feed;\n  parent: T;\n}): UseCommentsReturnType<T> | undefined;\nexport function useComments<T extends CommentParent>({\n  feed: feedFromProps,\n  parent,\n}: {\n  feed?: Feed;\n  /**\n   * The parent (activity or comment) for which to fetch comments.\n   */\n  parent: T;\n}) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  const selector = useCallback(\n    (state: FeedState) => ({\n      comments: state.comments_by_entity_id?.[parent.id]?.comments,\n      comments_pagination: state.comments_by_entity_id?.[parent.id]?.pagination,\n    }),\n    [parent.id],\n  );\n\n  const data = useStateStore(feed?.state, selector);\n\n  const loadNextPage = useMemo<\n    UseCommentsReturnType<T>['loadNextPage'] | undefined\n  >(() => {\n    if (!feed) return undefined;\n\n    return (request) => {\n      if (isCommentResponse(parent)) {\n        return feed.loadNextPageCommentReplies(parent, request);\n      } else {\n        return feed.loadNextPageActivityComments(parent, request);\n      }\n    };\n  }, [feed, parent]);\n\n  return useMemo(() => {\n    if (!data) {\n      return undefined;\n    }\n\n    return {\n      ...data,\n      has_next_page: checkHasAnotherPage(\n        data.comments,\n        data.comments_pagination?.next,\n      ),\n      is_loading_next_page:\n        data?.comments_pagination?.loading_next_page ?? false,\n      loadNextPage,\n    };\n  }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { FeedOwnCapability } from '../../../../gen/models';\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\n\nconst stableEmptyArray: readonly FeedOwnCapability[] = [];\n\nconst selector = (currentState: FeedState) => {\n  return {\n    feedOwnCapabilities: currentState.own_capabilities ?? stableEmptyArray,\n  };\n};\n\nexport const useOwnCapabilities = (feedFromProps?: Feed | string) => {\n  const client = useFeedsClient();\n  const feedFromContext = useFeedContext();\n  let feed = feedFromProps ?? feedFromContext;\n  if (typeof feed === 'string') {\n    const [groupId, id] = feed.split(':');\n    feed = groupId && id ? client?.feed(groupId, id) : undefined;\n  }\n\n  const { feedOwnCapabilities = stableEmptyArray } =\n    useStateStore(feed?.state, selector) ?? {};\n\n  return feedOwnCapabilities;\n};\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport { checkHasAnotherPage } from '../../../../utils';\n\nconst selector = ({\n  follower_count,\n  followers,\n  followers_pagination,\n}: FeedState) => ({\n  follower_count,\n  followers,\n  followers_pagination,\n});\n\ntype UseFollowersReturnType = ReturnType<typeof selector> & {\n  is_loading_next_page: boolean;\n  has_next_page: boolean;\n  loadNextPage: (\n    ...options: Parameters<Feed['loadNextPageFollowers']>\n  ) => Promise<void>;\n};\n\nexport function useFollowers(feed: Feed): UseFollowersReturnType;\nexport function useFollowers(feed?: Feed): UseFollowersReturnType | undefined;\nexport function useFollowers(feedFromProps?: Feed) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  const data = useStateStore(feed?.state, selector);\n\n  const loadNextPage = useCallback(\n    (...options: Parameters<Feed['loadNextPageFollowers']>) =>\n      feed?.loadNextPageFollowers(...options),\n    [feed],\n  );\n\n  return useMemo(() => {\n    if (!data) {\n      return undefined;\n    }\n\n    return {\n      ...data,\n      is_loading_next_page:\n        data.followers_pagination?.loading_next_page ?? false,\n      has_next_page: checkHasAnotherPage(\n        data.followers,\n        data.followers_pagination?.next,\n      ),\n      loadNextPage,\n    };\n  }, [data, loadNextPage]);\n}\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage } from '../../../../utils';\nimport type { Feed, FeedState } from '../../../../feed';\n\nconst selector = ({\n  following_count,\n  following,\n  following_pagination,\n}: FeedState) => ({\n  following_count,\n  following,\n  following_pagination,\n});\n\ntype UseFollowingReturnType = ReturnType<typeof selector> & {\n  is_loading_next_page: boolean;\n  has_next_page: boolean;\n  loadNextPage: (\n    ...options: Parameters<Feed['loadNextPageFollowers']>\n  ) => Promise<void>;\n};\n\nexport function useFollowing(feed: Feed): UseFollowingReturnType;\nexport function useFollowing(feed?: Feed): UseFollowingReturnType | undefined;\nexport function useFollowing(feedFromProps?: Feed) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  const data = useStateStore(feed?.state, selector);\n\n  const loadNextPage = useCallback(\n    (...options: Parameters<Feed['loadNextPageFollowing']>) =>\n      feed?.loadNextPageFollowing(...options),\n    [feed],\n  );\n\n  return useMemo(() => {\n    if (!data) {\n      return undefined;\n    }\n\n    return {\n      ...data,\n      is_loading_next_page:\n        data.following_pagination?.loading_next_page ?? false,\n      has_next_page: checkHasAnotherPage(\n        data.following,\n        data.following_pagination?.next,\n      ),\n      loadNextPage,\n    };\n  }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive object containing some often used\n * metadata for a feed.\n */\nexport const useFeedMetadata = (feedFromProps?: Feed) => {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({\n  follower_count = 0,\n  following_count = 0,\n  created_by,\n  created_at,\n  updated_at,\n}: FeedState) => ({\n  created_by,\n  follower_count,\n  following_count,\n  created_at,\n  updated_at,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive array of feeds that the current user\n * owns and are following the respective feed that we are observing.\n */\nexport const useOwnFollows = (feedFromProps?: Feed) => {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({ own_follows }: FeedState) => ({\n  own_follows,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { NotificationStatusResponse } from '../../../../gen/models';\n\nconst selector = ({ notification_status }: FeedState) =>\n  ({\n    unread: notification_status?.unread ?? 0,\n    unseen: notification_status?.unseen ?? 0,\n    last_read_at: notification_status?.last_read_at,\n    last_seen_at: notification_status?.last_seen_at,\n    read_activities: notification_status?.read_activities,\n    seen_activities: notification_status?.seen_activities,\n  }) satisfies NotificationStatusResponse;\n\ntype UseNotificationStatusReturnType = ReturnType<typeof selector>;\n\nexport function useNotificationStatus(\n  feed: Feed,\n): UseNotificationStatusReturnType;\nexport function useNotificationStatus(\n  feed?: Feed,\n): UseNotificationStatusReturnType | undefined;\nexport function useNotificationStatus(feedFromProps?: Feed) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  return useStateStore(feed?.state, selector);\n}\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useStableCallback } from '../internal';\nimport type { Feed, FeedState } from '../../../../feed';\n\nconst selector = ({\n  is_loading_activities,\n  next,\n  aggregated_activities = [],\n}: FeedState) => ({\n  is_loading: is_loading_activities,\n  has_next_page: typeof next !== 'undefined',\n  aggregated_activities,\n});\n\ntype UseAggregatedActivitiesReturnType = ReturnType<typeof selector> & {\n  loadNextPage: () => Promise<void>;\n};\n\n/**\n * A React hook that returns a reactive object containing the current aggregated activities,\n * loading state and whether there is a next page to paginate to or not.\n */\nexport function useAggregatedActivities(\n  feedFromProps: Feed,\n): UseAggregatedActivitiesReturnType;\nexport function useAggregatedActivities(\n  feedFromProps?: Feed,\n): UseAggregatedActivitiesReturnType | undefined;\nexport function useAggregatedActivities(feedFromProps?: Feed) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  const data = useStateStore(feed?.state, selector);\n\n  const loadNextPage = useStableCallback(async () => {\n    if (!feed || !data?.has_next_page || data?.is_loading) {\n      return;\n    }\n\n    await feed.getNextPage();\n  });\n\n  return useMemo(\n    () => (data ? { ...data, loadNextPage } : undefined),\n    [data, loadNextPage],\n  );\n}\n","import type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\n/**\n * @deprecated use aggregatedActivity.is_read instead\n * @returns\n */\nexport const useIsAggregatedActivityRead = ({\n  feed: _,\n  aggregatedActivity,\n}: {\n  feed?: Feed;\n  aggregatedActivity: AggregatedActivityResponse;\n}) => {\n  return aggregatedActivity.is_read;\n};\n","import type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\n/**\n * @deprecated use aggregatedActivity.is_seen instead\n * @returns\n */\nexport const useIsAggregatedActivitySeen = ({\n  feed: _,\n  aggregatedActivity,\n}: {\n  feed?: Feed;\n  aggregatedActivity: AggregatedActivityResponse;\n}) => {\n  return aggregatedActivity.is_seen;\n};\n","import { createContext, useContext } from 'react';\n\nimport type { ActivityWithStateUpdates } from '../../../activity-with-state-updates/activity-with-state-updates';\n\nexport const StreamActivityWithStateUpdatesContext = createContext<ActivityWithStateUpdates | undefined>(undefined);\n\n/**\n * The props for the StreamActivityWithStateUpdatesProvider component.\n */\nexport type StreamActivityWithStateUpdatesContextProps = {\n  activityWithStateUpdates: ActivityWithStateUpdates;\n};\n\n/**\n * Hook to access the nearest ActivityWithStateUpdates instance.\n */\nexport const useActivityWithStateUpdatesContext = () => {\n  return useContext(StreamActivityWithStateUpdatesContext);\n};\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport type { StateStore } from '@stream-io/state-store';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage } from '../../../../utils';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { ActivityState, ActivityWithStateUpdates } from '../../../../activity-with-state-updates/activity-with-state-updates';\nimport type { ActivityResponse, CommentResponse } from '../../../../gen/models';\nimport { useActivityWithStateUpdatesContext } from '../../contexts/StreamActivityWithStateUpdatesContext';\n\nconst canLoadComments = (\n  feedOrActivity: Feed | ActivityResponse | ActivityWithStateUpdates,\n): feedOrActivity is ActivityWithStateUpdates | Feed => {\n  return (\n    'loadNextPageCommentReplies' in feedOrActivity &&\n    'loadNextPageActivityComments' in feedOrActivity\n  );\n};\n\ntype UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {\n  comments: NonNullable<\n    FeedState['comments_by_entity_id'][T['id']]\n  >['comments'];\n  comments_pagination: NonNullable<\n    FeedState['comments_by_entity_id'][T['id']]\n  >['pagination'];\n  has_next_page: boolean;\n  is_loading_next_page: boolean;\n  loadNextPage: (\n    request?: T extends CommentResponse\n      ? Parameters<Feed['loadNextPageCommentReplies']>[1]\n      : Parameters<Feed['loadNextPageActivityComments']>[1],\n  ) => Promise<void>;\n};\n\nexport function useActivityComments({\n  feed: feedFromProps,\n  parentComment,\n  activity: activityFromProps,\n}: {\n  feed?: Feed;\n  parentComment?: CommentResponse;\n  activity?: ActivityResponse | ActivityWithStateUpdates;\n} = {}) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n  const activityFromContext = useActivityWithStateUpdatesContext();\n  const activity = activityFromProps ?? activityFromContext;\n  const feedOrActivity = (activity && canLoadComments(activity)) ? activity : feed;\n\n  if (!feedOrActivity) {\n    throw new Error('Feed or activity is required');\n  }\n\n  if (!canLoadComments(feedOrActivity)) {\n    throw new Error('Feed or activity does not support loading comments');\n  }\n\n  if (!(activity || parentComment)) {\n    throw new Error('Activity or parent comment is required');\n  }\n\n  const entityId = parentComment?.id ?? activity?.id ?? '';\n  const selector = useCallback(\n    (state: FeedState | ActivityState) => ({\n      comments: state.comments_by_entity_id?.[entityId]?.comments,\n      comments_pagination: state.comments_by_entity_id?.[entityId]?.pagination,\n    }),\n    [entityId],\n  );\n\n  const data = useStateStore(\n    feedOrActivity.state as StateStore<FeedState | ActivityState>,\n    selector,\n  );\n\n  const loadNextPage = useCallback<\n    UseCommentsReturnType<ActivityResponse | CommentResponse>['loadNextPage']\n  >(\n    (request) => {\n      if (parentComment) {\n        return feedOrActivity.loadNextPageCommentReplies(\n          parentComment,\n          request,\n        );\n      } else {\n        if (activity && canLoadComments(activity)) {\n          return activity.loadNextPageActivityComments(request);\n        } else if (feed) {\n          return feed.loadNextPageActivityComments(activity?.id ?? '', request);\n        } else {\n          throw new Error('Activity or feed is required');\n        }\n      }\n    },\n    [feedOrActivity, feed, parentComment, activity],\n  );\n\n  return useMemo(() => {\n    return {\n      ...data,\n      has_next_page: checkHasAnotherPage(\n        data.comments,\n        data.comments_pagination?.next,\n      ),\n      is_loading_next_page:\n        data?.comments_pagination?.loading_next_page ?? false,\n      loadNextPage,\n    };\n  }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive array of feeds that the feeds's owner is following and is owned by the current user.\n */\nexport const useOwnFollowings = (feedFromProps?: Feed) => {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({ own_followings }: FeedState) => ({\n  own_followings,\n});\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport { checkHasAnotherPage } from '../../../../utils';\n\nconst selector = ({\n  member_count,\n  members,\n  member_pagination,\n}: FeedState) => ({\n  member_count,\n  members,\n  member_pagination,\n});\n\ntype UseMembersReturnType = ReturnType<typeof selector> & {\n  is_loading_next_page: boolean;\n  has_next_page: boolean;\n  loadNextPage: (\n    ...options: Parameters<Feed['loadNextPageMembers']>\n  ) => Promise<void>;\n};\n\nexport function useMembers(feed: Feed): UseMembersReturnType;\nexport function useMembers(feed?: Feed): UseMembersReturnType | undefined;\nexport function useMembers(feedFromProps?: Feed) {\n  const feedFromContext = useFeedContext();\n  const feed = feedFromProps ?? feedFromContext;\n\n  const data = useStateStore(feed?.state, selector);\n\n  const loadNextPage = useCallback(\n    (...options: Parameters<Feed['loadNextPageMembers']>) =>\n      feed?.loadNextPageMembers(...options),\n    [feed],\n  );\n\n  return useMemo(() => {\n    if (!data) {\n      return undefined;\n    }\n\n    return {\n      ...data,\n      is_loading_next_page:\n        data.member_pagination?.loading_next_page ?? false,\n      has_next_page: checkHasAnotherPage(\n        data.members,\n        data.member_pagination?.next,\n      ),\n      loadNextPage,\n    };\n  }, [data, loadNextPage]);\n}\n","import { createContext, useContext } from 'react';\n\nimport type { SearchSource } from '../../../common/search';\n\nexport const StreamSearchResultsContext = createContext<\n  SearchSource | undefined\n>(undefined);\n\n/**\n * The props for the StreamSearchResultsProvider component.\n */\nexport type StreamSearchResultsContextProps = {\n  source: SearchSource;\n};\n\n/**\n * Hook to access the nearest SearchSource instance.\n */\nexport const useSearchResultsContext = () => {\n  return useContext(StreamSearchResultsContext);\n};\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useSearchResultsContext } from '../../contexts/StreamSearchResultsContext';\nimport { useStableCallback } from '../internal';\nimport type { SearchSourceState } from '../../../../common/types';\nimport type { SearchSource } from '../../../../common/search';\n\nexport const useSearchResult = (sourceFromProps?: SearchSource) => {\n  const sourceFromContext = useSearchResultsContext();\n  const source = sourceFromProps ?? sourceFromContext;\n\n  const { items, error, isLoading, hasNext } =\n    useStateStore(source?.state, selector) ?? {};\n\n  const loadMore = useStableCallback(async () => {\n    if (hasNext) {\n      source?.search();\n    }\n  });\n\n  return useMemo(\n    () => ({ items, error, isLoading, hasNext, loadMore }),\n    [error, hasNext, isLoading, items, loadMore],\n  );\n};\n\nconst selector = ({\n  items,\n  isLoading,\n  hasNext,\n  lastQueryError,\n}: SearchSourceState) => ({\n  items,\n  isLoading,\n  hasNext,\n  error: lastQueryError,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { SearchController } from '../../../common/search';\n\nexport const StreamSearchContext = createContext<SearchController | undefined>(undefined);\n\n/**\n * The props for the StreamSearchProvider component.\n */\nexport type StreamSearchContextProps = {\n  searchController: SearchController;\n};\n\n/**\n * Hook to access the nearest SearchController instance.\n */\nexport const useSearchContext = () => {\n  return useContext(StreamSearchContext);\n};\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport type {\n  SearchController,\n  SearchControllerState,\n} from '../../../../common/search';\nimport { useSearchContext } from '../../contexts/StreamSearchContext';\n\nexport const useSearchQuery = (controllerFromProps?: SearchController) => {\n  const controllerFromState = useSearchContext();\n  const controller = controllerFromProps ?? controllerFromState;\n\n  return useStateStore(controller?.state, selector);\n};\n\nconst selector = ({ searchQuery }: SearchControllerState) => ({\n  searchQuery,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useSearchContext } from '../../contexts/StreamSearchContext';\nimport type { SearchController, SearchControllerState } from '../../../../common/search';\n\nexport const useSearchSources = (controllerFromProps?: SearchController) => {\n  const controllerFromState = useSearchContext();\n  const controller = controllerFromProps ?? controllerFromState;\n\n  return useStateStore(controller?.state, selector);\n};\n\nconst selector = ({ sources }: SearchControllerState) => ({\n  sources,\n});\n","import type { PropsWithChildren } from 'react';\nimport { StreamFeedsContext } from '../contexts/StreamFeedsContext';\nimport type { StreamFeedsContextProps } from '../contexts/StreamFeedsContext';\n\nexport const StreamFeeds = ({ client, children }: PropsWithChildren<StreamFeedsContextProps>) => {\n  return (\n    <StreamFeedsContext.Provider value={client}>\n      {children}\n    </StreamFeedsContext.Provider>\n  );\n};\n\nStreamFeeds.displayName = 'StreamFeeds';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamFeedContext } from '../contexts/StreamFeedContext';\nimport type { Feed } from '../../../feed';\n\n/**\n * The props for the StreamFeed component. It accepts a `Feed` instance.\n */\nexport type StreamFeedProps = {\n  feed: Feed;\n};\n\nexport const StreamFeed = ({\n  feed,\n  children,\n}: PropsWithChildren<StreamFeedProps>) => {\n  return (\n    <StreamFeedContext.Provider value={feed}>\n      {children}\n    </StreamFeedContext.Provider>\n  );\n};\n\nStreamFeed.displayName = 'StreamFeed';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamActivityWithStateUpdatesContext } from '../contexts/StreamActivityWithStateUpdatesContext';\nimport type { ActivityWithStateUpdates } from '../../../activity-with-state-updates/activity-with-state-updates';\n\n/**\n * The props for the StreamActivityWithStateUpdates component. It accepts an `ActivityWithStateUpdates` instance.\n */\nexport type StreamActivityWithStateUpdatesProps = {\n  activityWithStateUpdates: ActivityWithStateUpdates;\n};\n\nexport const StreamActivityWithStateUpdates = ({\n  activityWithStateUpdates,\n  children,\n}: PropsWithChildren<StreamActivityWithStateUpdatesProps>) => {\n  return (\n    <StreamActivityWithStateUpdatesContext.Provider value={activityWithStateUpdates}>\n      {children}\n    </StreamActivityWithStateUpdatesContext.Provider>\n  );\n};\n\nStreamActivityWithStateUpdates.displayName = 'StreamActivityWithStateUpdates';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamSearchContext } from '../contexts/StreamSearchContext';\nimport type { SearchController } from '../../../common/search';\n\n/**\n * The props for the StreamSearch component. It accepts a `SearchController` instance.\n */\nexport type StreamSearchProps = {\n  searchController: SearchController | undefined;\n};\n\nexport const StreamSearch = ({\n  searchController,\n  children,\n}: PropsWithChildren<StreamSearchProps>) => {\n  return (\n    <StreamSearchContext.Provider value={searchController}>\n      {children}\n    </StreamSearchContext.Provider>\n  );\n};\n\nStreamSearch.displayName = 'StreamSearch';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamSearchResultsContext } from '../contexts/StreamSearchResultsContext';\nimport type { SearchSource } from '../../../common/search';\n\n/**\n * The props for the StreamSearchResults component. It accepts a `SearchSource` instance.\n */\nexport type StreamSearchResultsProps = {\n  source: SearchSource;\n};\n\nexport const StreamSearchResults = ({\n  source,\n  children,\n}: PropsWithChildren<StreamSearchResultsProps>) => {\n  return (\n    <StreamSearchResultsContext.Provider value={source}>\n      {children}\n    </StreamSearchResultsContext.Provider>\n  );\n};\n\nStreamSearchResults.displayName = 'StreamSearchResults';\n"],"mappings":";;;;;;;;;AAUA,IAAa,wBAAwB,EACnC,QACA,iBACA,UAAU,qBACV,cAMI;CACJ,MAAM,WACJ,wBAAwB,cAAc,KAAA,IAAY;AAEpD,KAAI,wBAAwB,eAAe,CAAC,gBAC1C,OAAM,IAAI,MACR,uJACD;CAGH,MAAM,CAAC,QAAQ,aAAa,SAA6B,KAAK;CAC9D,MAAM,CAAC,OAAO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