{"version":3,"file":"ChannelNavigation.mjs","names":[],"sources":["../../../../src/components/ChannelList/ChannelNavigation.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React from 'react';\nimport type { SearchControllerState } from 'stream-chat';\n\nimport { ChannelListHeader as DefaultChannelListHeader } from './ChannelListHeader';\nimport { ChannelLists } from './ChannelLists';\nimport { NotificationList as DefaultNotificationList } from '../Notifications';\nimport { Search as DefaultSearch } from '../Search';\nimport { useChatContext, useComponentContext } from '../../context';\nimport {\n  ThemeScopeProvider,\n  useIsInThemeScope,\n  useThemeScopeClassName,\n} from '../../context/ThemeScopeContext';\nimport { useImageFlagEmojisOnWindowsClass } from '../Channel/hooks/useChannelContainerClasses';\nimport { useStateStore } from '../../store';\n\nconst searchControllerStateSelector = (state: SearchControllerState) => ({\n  isActive: state.isActive,\n});\n\n/**\n * Channel navigation region: `ChannelListHeader`, `Search` (the bar always, results while active),\n * `ChannelLists` while search is inactive, and the channel-list `NotificationList`. All but\n * `ChannelLists` are `ComponentContext` slots.\n *\n * Outside `ChatView` the root applies the `str-chat <theme>` scope itself; inside one it inherits\n * `ChatView`'s, since a nested scope would reset overridden design tokens. `customClasses.chat` and\n * `customClasses.channelList` replace the `str-chat` and `str-chat__channel-list` classes.\n */\nexport const ChannelNavigation = () => {\n  const {\n    ChannelListHeader = DefaultChannelListHeader,\n    NotificationList = DefaultNotificationList,\n    Search = DefaultSearch,\n  } = useComponentContext();\n  const { customClasses, searchController } = useChatContext();\n  const isInThemeScope = useIsInThemeScope();\n  const themeScopeClassName = useThemeScopeClassName();\n  const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();\n  const { isActive } = useStateStore(\n    searchController.state,\n    searchControllerStateSelector,\n  );\n\n  return (\n    <div\n      className={clsx(\n        !isInThemeScope && themeScopeClassName,\n        customClasses?.channelList ?? 'str-chat__channel-list',\n        windowsEmojiClass,\n      )}\n    >\n      <ThemeScopeProvider>\n        <ChannelListHeader />\n        <Search />\n        {!isActive && <ChannelLists />}\n        <NotificationList panel='channel-list' />\n      </ThemeScopeProvider>\n    </div>\n  );\n};\n"],"mappings":";;;;;;;;;;;;;AAiBA,IAAM,iCAAiC,WAAkC,EACvE,UAAU,MAAM,SAClB;;;;;;;;;;AAWA,IAAa,0BAA0B;CACrC,MAAM,EACJ,mBAAA,sBAAoB,mBACpB,kBAAA,qBAAmB,kBACnB,QAAA,WAAS,WACP,oBAAoB;CACxB,MAAM,EAAE,eAAe,qBAAqB,eAAe;CAC3D,MAAM,iBAAiB,kBAAkB;CACzC,MAAM,sBAAsB,uBAAuB;CACnD,MAAM,oBAAoB,iCAAiC;CAC3D,MAAM,EAAE,aAAa,cACnB,iBAAiB,OACjB,6BACF;CAEA,OACE,oBAAC,OAAD;EACE,WAAW,KACT,CAAC,kBAAkB,qBACnB,eAAe,eAAe,0BAC9B,iBACF;YAEA,qBAAC,oBAAD,EAAA,UAAA;GACE,oBAAC,qBAAD,CAAoB,CAAA;GACpB,oBAAC,UAAD,CAAS,CAAA;GACR,CAAC,YAAY,oBAAC,cAAD,CAAe,CAAA;GAC7B,oBAAC,oBAAD,EAAkB,OAAM,eAAgB,CAAA;EACtB,EAAA,CAAA;CACjB,CAAA;AAET"}