This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,247 @@
// Metro module 9127 (f9128).
import { createElement } from "react";
import { View } from "react-native";
import ActiveThreadsStore from "../../../threads/ActiveThreadsStore";
import { THREADED_CHANNEL_TYPES } from "../../../../records/ChannelRecord";
import ChannelStore from "../../../../stores/ChannelStore";
import VoiceStateStore from "../../../../stores/VoiceStateStore";
import { setIsChannelDetailsSearchActive } from "../sidebar/details/stores/ChannelDetailsStore";
import { ChannelTypes, ChannelTypesSets, ComponentActions } from "../../../../Constants";
import { SearchEntrypointAnalyticsLocations } from "../../../search/native/tracking/TrackingConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { PhoneCallIcon } from "../../../../design/components/Icon/native/redesign/generated/PhoneCallIcon";
import Module712 from "../../../../_bundle/Module712";
import { PhoneHangUpIcon } from "../../../../design/components/Icon/native/redesign/generated/PhoneHangUpIcon";
import useIsNsfwGated from "../../../age_gate/useIsNsfwGated";
import { useCanSearchForumPosts, useHasForumSearchQuery } from "../../../forums/ForumHooks";
import useIsWindowSmall from "../../../screen/native/useIsWindowSmall";
import { useStateFromStores, useStateFromStoresObject } from "../../../../_bundle/Module589";
import { useCanJoinThreadVoice } from "../../../threads/ThreadHooks";
import Module12 from "../../../../_bundle/Module12";
import useHandleJoinThreadVoice from "../../../threads/native/useHandleJoinThreadVoice";
import { useConversationsHeaderButton } from "../../../conversations/components/native/useConversationsHeaderButton";
import { openChannelCallModal } from "../../../../utils/native/PrivateChannelCallUtils";
import { intl, t } from "../../../../intl/index.native";
import Module10051 from "../../../../_bundle/Module10051";
import { MagnifyingGlassIcon } from "../../../../design/components/Icon/native/redesign/generated/MagnifyingGlassIcon";
import GuildDirectorySearchModalActionCreators from "../../../directory_channels/native/components/GuildDirectorySearchModalActionCreators";
import ForumActionCreators from "../../../forums/ForumActionCreators";
import { isIOS } from "../../../../utils/PlatformUtils";
import { getChatInputRef } from "../../../../utils/native/ChatInputUtils";
import { getChannelDetailsSearchContext } from "../../../search/native/hooks/useSearchContext";
import Tracking from "../../../search/native/tracking/Tracking";
import { isSwipeToMemberListEnabled } from "../sidebar/member_list/SwipeToMemberListUtils";
import { ComponentDispatch } from "../../../../utils/ComponentDispatchUtils";
import { getRootNavigationRef } from "../../RootNavigationRef.native";
import Module10122 from "../../../../_bundle/Module10122";
import { ThreadIcon } from "../../../../design/components/Icon/native/redesign/generated/ThreadIcon";
import showThreadBrowserModal from "../../../threads/native/showThreadBrowserModal";
import { ConversationCoachmark } from "../../../conversations/components/native/ConversationCoachmark";
import IconActionButton from "../shared_components/IconActionButton";
import { useShouldHideChannelContent } from "../../../age_gate/AgeGateUtils";
import { ForumChannelCloseSearchButton } from "../../../forums/native/ForumChannelSearch";
import PrivateChannelButtons from "./header/PrivateChannelButtons";
let useStyles, EndCallButton, ChannelActionButtons, WrappedChannelNavButtons;
const JoinCallButton = function JoinCallButton() {
return <PhoneCallIcon size="sm" color={Module712.unsafe_rawColors.GREEN_360} />;
};
EndCallButton = function EndCallButton() {
return <PhoneHangUpIcon size="sm" color={Module712.unsafe_rawColors.RED_400} />;
};
ChannelActionButtons = function ChannelActionButtons(props) {
let c16979_2, conversationsHeaderButton;
const { channel, screenIndex } = props;
c16979_2 = void 0;
conversationsHeaderButton = void 0;
const styles = useStyles();
const isNsfwGated = useIsNsfwGated(channel);
const canSearchForumPosts = useCanSearchForumPosts(channel);
let r31 = useIsWindowSmall();
const stateFromStores = useStateFromStores([ActiveThreadsStore], () => ActiveThreadsStore.hasThreadsForChannel(channel.guild_id, channel.id));
const r35 = [];
c16979_2 = r35;
const canJoinThreadVoice = useCanJoinThreadVoice(channel);
const stateFromStores2 = useStateFromStores([VoiceStateStore], () => VoiceStateStore.isInChannel(channel.id));
const stateFromStores3 = useStateFromStores([VoiceStateStore], () => !Module12.isEmpty(VoiceStateStore.getVoiceStatesForChannel(channel.id)));
let onPress2 = useHandleJoinThreadVoice(channel);
conversationsHeaderButton = useConversationsHeaderButton(channel);
if (channel.isVocalThread() && canJoinThreadVoice && stateFromStores3) {
const IconComponent = stateFromStores2 ? EndCallButton : JoinCallButton;
if (!stateFromStores2) {
onPress2 = () => openChannelCallModal(channel);
}
r35.push({
source: null,
IconComponent,
onPress: onPress2,
accessibilityLabel: stateFromStores2 ? intl.string(t["4ry6yi"]) : intl.string(t.My50nf)
});
}
L23: {
const type = channel.type;
if (ChannelTypes.GUILD_DIRECTORY === type) {
r35.push({
source: Module10051,
IconComponent: MagnifyingGlassIcon,
onPress: () => {
GuildDirectorySearchModalActionCreators.open({
channel
});
},
accessibilityLabel: intl.string(t["5h0QOP"])
});
} else {
if (ChannelTypes.GUILD_FORUM !== type && ChannelTypes.GUILD_MEDIA !== type) {
if (conversationsHeaderButton != null) {
r35.push(conversationsHeaderButton);
}
r35.push({
source: Module10051,
IconComponent: MagnifyingGlassIcon,
onPress: () => {
setIsChannelDetailsSearchActive(channel.id, true, "initial");
if (isIOS()) {
const chatInputRef = getChatInputRef(channel.id, screenIndex);
if (chatInputRef != null) {
chatInputRef.blur();
}
}
L9: {
const isThread = channel.isThread();
Tracking.trackSearchOpened({
searchContext: getChannelDetailsSearchContext(channel.id, channel.getGuildId(), isThread),
searchLocation: SearchEntrypointAnalyticsLocations.CHANNEL_HEADER
});
if (!isSwipeToMemberListEnabled()) {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null && rootNavigationRef.isReady()) {
rootNavigationRef.navigate("sidebar", {
channelId: channel.id,
search: true,
source: "channel-header-search"
});
break L9;
}
return void 0;
}
ComponentDispatch.dispatch(ComponentActions.SHOW_CHANNEL_DETAILS, {
source: "channel-header-search",
channelId: channel.id,
screenIndex
});
}
},
accessibilityLabel: intl.string(t["5h0QOP"])
});
break L23;
}
if (canSearchForumPosts) {
r35.push({
source: Module10051,
IconComponent: MagnifyingGlassIcon,
onPress: () => {
ForumActionCreators.updateForumSearchQuery(channel.id, "");
},
accessibilityLabel: intl.string(t["5h0QOP"])
});
}
}
}
if (r31) {
r31 = r35.length !== 0;
}
if (!r31) {
let r136 = THREADED_CHANNEL_TYPES.has(channel.type);
const r137 = (r136 ? !r136 : stateFromStores) && !ChannelTypesSets.GUILD_THREADS_ONLY.has(channel.type);
if (r136) {
r136 = !isNsfwGated;
}
if (r136) {
r136 = !channel.isForumLikeChannel();
}
if (r136) {
r136 = r137;
}
r31 = !r136;
}
if (!r31) {
r35.unshift({
source: Module10122,
IconComponent: ThreadIcon,
onPress: () => showThreadBrowserModal(channel),
accessibilityLabel: intl.string(t.B2panI)
});
}
return <View style={styles.actionWrapper}>
{r35.map((item, index) => {
const isLast = index === c16979_2.length - 1;
return item === conversationsHeaderButton ? <ConversationCoachmark key={item.accessibilityLabel} isLast={isLast}>
{(c30029_0) => <IconActionButton noMargin {...item} onPress={(event) => {
c30029_0();
const onPress2 = item.onPress;
if (onPress2 != null) {
onPress2.call(item, event);
}
}} />}
</ConversationCoachmark> : createElement(IconActionButton, {
noMargin: isLast,
...item,
key: item.accessibilityLabel
});
})}
</View>;
};
WrappedChannelNavButtons = function WrappedChannelNavButtons(props) {
const { channelId, screenIndex: screenIndex2, showCreateThread } = props;
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
const shouldHideChannelContent = useShouldHideChannelContent(stateFromStores);
return stateFromStores == null ? null : shouldHideChannelContent ? null : showCreateThread ? null : <ChannelActionButtons channel={stateFromStores} screenIndex={screenIndex2} />;
};
useStyles = createStyles({
actionWrapper: {
flexShrink: 0,
flexDirection: "row",
alignItems: "center"
}
});
export default function ChannelActions(props) {
let children2, props2;
let channelId2;
L7: {
channelId2 = props.channelId;
const { screenIndex: screenIndex2, containerStyle, showCreateThread } = props;
const stateFromStoresObject = useStateFromStoresObject([ChannelStore], () => {
const channel2 = ChannelStore.getChannel(channelId2);
let isMultiUserDM = channel2 == null ? void 0 : channel2.isMultiUserDM();
if (isMultiUserDM == null) {
isMultiUserDM = false;
}
const channel3 = ChannelStore.getChannel(channelId2);
let isDM = channel3 == null ? void 0 : channel3.isDM();
if (isDM == null) {
isDM = false;
}
return {
isMultiUserDM,
isDM
};
});
const { isMultiUserDM, isDM } = stateFromStoresObject;
const hasForumSearchQuery = useHasForumSearchQuery(channelId2);
props2 = {
style: containerStyle,
children: null
};
if (hasForumSearchQuery) {
children2 = <ForumChannelCloseSearchButton channelId={channelId2} />;
} else {
if (!isDM && !isMultiUserDM) {
children2 = <WrappedChannelNavButtons channelId={channelId2} screenIndex={screenIndex2} showCreateThread={showCreateThread} />;
break L7;
}
children2 = <PrivateChannelButtons channelId={channelId2} screenIndex={screenIndex2} />;
}
}
props2.children = children2;
return <View {...props2} />;
};
@@ -0,0 +1,6 @@
// Metro module 11735 (f11736).
import { isAnimatedAndroidKeyboard } from "../../../keyboard/native/AnimatedKeyboardExperiment";
import ChannelSafeAreaBottomNoop from "./ChannelSafeAreaBottomNoop";
import ChannelSafeAreaBottomAnimated_android from "./ChannelSafeAreaBottomAnimated.android";
const r16 = isAnimatedAndroidKeyboard() ? ChannelSafeAreaBottomNoop : ChannelSafeAreaBottomAnimated_android;
export default r16;
@@ -0,0 +1,27 @@
// Metro module 11737 (f11738).
import { memo } from "react";
import { StyleSheet, View } from "react-native";
import useChannelSafeAreaHeightSharedValue_android from "./useChannelSafeAreaHeightSharedValue.android";
import useChannelSafeAreaBottomStyles from "./useChannelSafeAreaBottomStyles";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
const __initData = {
code: "function ChannelSafeAreaBottomAnimatedAndroidTsx1(){const{heightSharedValue}=this.__closure;return{height:heightSharedValue.get()};}"
};
const r25 = memo(function ChannelSafeAreaBottom(props) {
const channelId = props.channelId;
const channelSafeAreaHeightSharedValue_android = useChannelSafeAreaHeightSharedValue_android();
let c19104_0 = channelSafeAreaHeightSharedValue_android;
const styles = useChannelSafeAreaBottomStyles(channelId);
const n = () => ({
height: c19104_0.get()
});
n.__closure = {
heightSharedValue: channelSafeAreaHeightSharedValue_android
};
n.__workletHash = 6491350126069;
n.__initData = __initData;
return <ReanimatedRexport.View style={useAnimatedStyle(n)}>
<View style={[StyleSheet.absoluteFill, styles]} />
</ReanimatedRexport.View>;
});
export default r25;
@@ -0,0 +1,7 @@
// Metro module 11736 (f11737).
import { memo } from "react";
import { View } from "react-native";
const r22 = memo(function ChannelSafeAreaNoop() {
return <View />;
});
export default r22;
@@ -0,0 +1,251 @@
// Metro module 15402 (f15403).
import * as Module19 from "react";
import { useMemo, useCallback, useRef } from "react";
import { View, StyleSheet } from "react-native";
import { HEADER_CORNER_RADIUS, MIN_HEADER_HEIGHT, MIDNIGHT_BORDER_WIDTH } from "../shared_components/MainTabsV2Constants";
import { EMPTY_STRING_SNOWFLAKE_ID, ME, ThemeTypes } from "../../../../Constants";
import { StaticChannelRoute } from "../../../channel/ChannelConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useNavigation } from "../../../../_bundle/Module1481";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useGradientTop } from "../../../client_themes/native/ClientThemesOverrides";
import { ServerIcon } from "../../../../design/components/Icon/native/redesign/generated/ServerIcon";
import { intl, t } from "../../../../intl/index.native";
import { navigateToRootTab } from "../../helpers/NavigationRouteUtils.native";
import { ContextMenu } from "../../../../design/components/ContextMenu/native/ContextMenu.native";
import { PressableNavigatorBackIcon } from "../shared_components/navigator/PressableNavigatorBackIcon";
import { LayerScope } from "../../../../design/components/Layers/native/LayerScope.native";
import ChannelHeader from "./header/ChannelHeader";
import ChannelActions from "./ChannelActions";
import { useIsSwipeToMemberListEnabled } from "../sidebar/member_list/SwipeToMemberListUtils";
import useChannelRoleSubscriptionStatus from "../../../guild_role_subscriptions/useChannelRoleSubscriptionStatus";
import { useCanSeeOnboardingHome } from "../../../guild_onboarding_home/OnboardingHomeUtils";
import useTheme from "../../../../hooks/useTheme";
import { useMobileVisualRefreshConfig } from "../../../themes/experiments/MobileVisualRefreshExperiment";
import { useOrientation, OrientationType } from "../../../device/native/DeviceOrientation";
import { useIsForumChannelSearchActive } from "../../../forums/native/hooks/useIsForumChannelSearchActive";
import useChatLayout from "../../../chat/native/useChatLayout";
import { EmptyState } from "../../../../design/void/native";
import ThemedGradient from "../../../client_themes/native/ThemedGradient";
import GuildRoleSubscriptionsOverview from "../../../guild_role_subscriptions/native/overview_tab/GuildRoleSubscriptionsOverview";
import GuildOnboardingHomePage from "../../../guild_onboarding_home/native/GuildOnboardingHomePage";
import StandaloneMembersView from "../../../guild_settings/native/StandaloneMembersView";
import { CreateThreadView } from "../../../threads/native/components/thread_creation/CreateThreadView";
import ChatView from "../../../chat/native/ChatView";
import SwipeForMemberListWrapper from "./SwipeForMemberListWrapper";
let useStyles;
const Header = function Header(props) {
let callback;
const { channelId, screenIndex, guildId, isNavigationScreen, frame, isMIDNIGHTTheme, isChatInputFloating, showCreateThread, isBackEnabled } = props;
callback = void 0;
const navigation = useNavigation();
const styles = useStyles();
const top = useSafeAreaInsets_native().top;
const gradientTop = useGradientTop();
const memo = useMemo(() => [styles.headerWrapper, gradientTop, frame != null ? styles.headerWithFadingFrame : void 0, frame != null ? styles.splitDivider : void 0, frame != null ? styles.splitDividerTop : void 0, frame != null ? isMIDNIGHTTheme ? isChatInputFloating ? void 0 : styles.headerWithFadingFrameMidnight : void 0 : void 0, frame != null ? {
marginTop: top,
minHeight: MIN_HEADER_HEIGHT
} : {
paddingTop: top,
minHeight: top + MIN_HEADER_HEIGHT
}], [styles.headerWrapper, styles.headerWithFadingFrame, styles.splitDivider, styles.splitDividerTop, styles.headerWithFadingFrameMidnight, gradientTop, frame, isMIDNIGHTTheme, isChatInputFloating, top]);
callback = useCallback(() => {
if (isNavigationScreen) {
navigation.goBack();
}
}, [navigation, isNavigationScreen]);
const memo2 = useMemo(() => guildId != null && guildId !== ME, [guildId]);
const items = [{
IconComponent: ServerIcon,
label: intl.string(t.WYj55Y),
action: () => {
navigateToRootTab({
screen: "guilds",
guildId,
channelId,
resetRoot: false,
drawerOpen: false
});
}
}];
let r71 = memo2 ? <ContextMenu triggerOnLongPress align="below" items={items}>
{(a0) => {
const { ref, ...rest } = a0;
return <PressableNavigatorBackIcon ref={a0.ref} {...rest} onPress={callback} />;
}}
</ContextMenu> : <PressableNavigatorBackIcon onPress={callback} />;
const r88 = [frame != null ? isMIDNIGHTTheme ? isChatInputFloating ? null : <View style={[styles.midnightFrameCover, {
height: top + HEADER_CORNER_RADIUS
}]} /> : null : null, , ,];
const r94 = [<View style={styles.headerBottomBorder} />, ,];
if (!isBackEnabled) {
r71 = <View style={styles.spacer} />;
}
r94[1] = <LayerScope>
{r71}
<ChannelHeader channelId={channelId} isNavigationScreen={isNavigationScreen} screenIndex={screenIndex} showCreateThread={showCreateThread} />
<ChannelActions containerStyle={styles.actions} channelId={channelId} screenIndex={screenIndex} showCreateThread={showCreateThread} />
</LayerScope>;
r88[1] = <View style={memo}>{r94}</View>;
r88[2] = frame;
return <>{r88}</>;
};
useStyles = createStyles({
container: {
flex: 1
},
midnightContainerBorder: {
borderLeftWidth: MIDNIGHT_BORDER_WIDTH,
borderLeftColor: Module712.colors.APP_FRAME_BORDER,
borderTopWidth: MIDNIGHT_BORDER_WIDTH,
borderTopColor: "transparent"
},
contentContainer: {
flex: 1,
backgroundColor: Module712.colors.STANDALONE_CHANNEL_CONTENT_BACKGROUND
},
midnightContentContainerBorder: {
borderLeftWidth: MIDNIGHT_BORDER_WIDTH,
borderLeftColor: Module712.colors.APP_FRAME_BORDER
},
containerEmpty: {
backgroundColor: Module712.colors.STANDALONE_CHANNEL_CONTENT_BACKGROUND
},
headerWrapper: {
zIndex: 1,
backgroundColor: Module712.colors.STANDALONE_CHANNEL_CONTENT_BACKGROUND,
flexDirection: "row",
alignItems: "center",
flexShrink: 0
},
headerBottomBorder: {
...StyleSheet.absoluteFillObject,
top: void 0,
height: 1,
backgroundColor: Module712.colors.STANDALONE_CHANNEL_HEADER_BORDER
},
headerWithFadingFrame: {
borderTopLeftRadius: Module712.modules.mobile.CHANNEL_DRAWER_CORNER_RADIUS
},
splitDivider: {
borderLeftWidth: Module712.modules.mobile.CHANNEL_DRAWER_DIVIDER_WIDTH,
borderLeftColor: Module712.colors.APP_FRAME_BORDER
},
splitDividerTop: {
borderTopWidth: Module712.modules.mobile.CHANNEL_DRAWER_DIVIDER_WIDTH,
borderTopColor: Module712.colors.APP_FRAME_BORDER
},
headerWithFadingFrameMidnight: {
borderLeftColor: Module712.colors.APP_FRAME_BORDER,
borderTopColor: Module712.colors.APP_FRAME_BORDER,
borderLeftWidth: MIDNIGHT_BORDER_WIDTH,
borderTopWidth: MIDNIGHT_BORDER_WIDTH
},
midnightFrameCover: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
position: "absolute",
left: -MIDNIGHT_BORDER_WIDTH,
top: 0,
width: MIDNIGHT_BORDER_WIDTH
},
actions: {
marginRight: Module712.space.PX_16
},
spacer: {
width: Module712.space.PX_16
}
});
const r132 = Module19.memo(function StandaloneChannelScreen(props) {
let c21966_6;
const { guildId: guildId2, channelId: channelId2, isNavigationScreen: isNavigationScreen2, frame: frame2, showCreateThread, screenIndex } = props;
c21966_6 = void 0;
const styles2 = useStyles();
const navigation2 = useNavigation();
const isSwipeToMemberListEnabled = useIsSwipeToMemberListEnabled();
const needSubscriptionToAccess = useChannelRoleSubscriptionStatus(channelId2).needSubscriptionToAccess;
let r42 = guildId2;
if (r42 == null) {
r42 = EMPTY_STRING_SNOWFLAKE_ID;
}
const canSeeOnboardingHome = useCanSeeOnboardingHome(r42);
const ref = useRef(null);
const isMIDNIGHTTheme2 = useTheme() === ThemeTypes.MIDNIGHT;
let c21966_3 = isMIDNIGHTTheme2;
const chatInputFloating = useMobileVisualRefreshConfig({
location: "StandaloneChannelScreen"
}).chatInputFloating;
const orientation = useOrientation();
const memo = useMemo(() => {
let r2, r10;
L5: {
r2 = [styles2.container, ,];
const r1 = frame2 != null;
r10 = void 0;
if (!r1) {
r10 = void 0;
if (c21966_3) {
if (chatInputFloating) {
const PORTRAIT = OrientationType.PORTRAIT;
r10 = void 0;
if (orientation !== PORTRAIT) {
break L5;
}
}
r10 = styles2.midnightContainerBorder;
}
}
}
r2[1] = r10;
return r2;
}, [frame2, isMIDNIGHTTheme2, chatInputFloating, orientation, styles2.container, styles2.midnightContainerBorder]);
const memo2 = useMemo(() => [styles2.contentContainer, frame2 != null ? styles2.splitDivider : void 0, frame2 != null ? c21966_3 ? chatInputFloating ? void 0 : styles2.midnightContentContainerBorder : void 0 : void 0], [frame2, isMIDNIGHTTheme2, chatInputFloating, styles2.contentContainer, styles2.splitDivider, styles2.midnightContentContainerBorder]);
const isForumChannelSearchActive = useIsForumChannelSearchActive(channelId2);
const isChatLockedOpen = useChatLayout().isChatLockedOpen;
const isBackEnabled = (isChatLockedOpen ? isNavigationScreen2 : !isChatLockedOpen) && !isForumChannelSearchActive;
c21966_6 = isBackEnabled;
if (channelId2 != null && guildId2 != null) {
const r81 = <Header channelId={channelId2} frame={frame2} guildId={guildId2} isNavigationScreen={isNavigationScreen2} screenIndex={screenIndex} isMIDNIGHTTheme={isMIDNIGHTTheme2} isChatInputFloating={chatInputFloating} showCreateThread={showCreateThread} isBackEnabled={isBackEnabled} />;
if (channelId2 !== StaticChannelRoute.ROLE_SUBSCRIPTIONS && !needSubscriptionToAccess) {
if (channelId2 === StaticChannelRoute.GUILD_HOME) {
return <View style={memo}>
{r81}
<View style={memo2}>
{canSeeOnboardingHome ? <GuildOnboardingHomePage guildId={guildId2} /> : null}
</View>
</View>;
}
if (channelId2 === StaticChannelRoute.MEMBER_SAFETY) {
return <StandaloneMembersView guildId={guildId2} />;
}
if (showCreateThread) {
return <View style={memo2}>
{r81}
<CreateThreadView channelId={channelId2} screenIndex={screenIndex} />
</View>;
}
const r94 = <>
{r81}
<View style={memo2}>
<ChatView guildId={guildId2} channelId={channelId2} chatInputRef={ref} screenIndex={screenIndex} />
</View>
</>;
return isSwipeToMemberListEnabled ? <SwipeForMemberListWrapper style={memo} channelId={channelId2} screenIndex={screenIndex} isBackEnabled={isBackEnabled}>{r94}</SwipeForMemberListWrapper> : <View style={memo} accessible={false} onAccessibilityEscape={() => {
if (c21966_6) {
navigation2.goBack();
}
}}>{r94}</View>;
}
return <View style={memo}>
{r81}
<View style={memo2}>
<ThemedGradient absolute />
<GuildRoleSubscriptionsOverview guildId={guildId2} gatedChannelId={needSubscriptionToAccess ? channelId2 : void 0} />
</View>
</View>;
}
return <View style={[memo, styles2.containerEmpty]}>
<EmptyState title={intl.string(t.ai6Lbr)} body={intl.string(t["LTr+x9"])} />
</View>;
});
export default r132;
@@ -0,0 +1,390 @@
// Metro module 15459 (f15460).
import { createContext, useState, useEffect, useCallback, useMemo, useContext } from "react";
import { StyleSheet, View } from "react-native";
import { getIsChannelDetailsSearchActive, setIsChannelDetailsSearchActive } from "../sidebar/details/stores/ChannelDetailsStore";
import { MIDNIGHT_BORDER_WIDTH } from "../shared_components/MainTabsV2Constants";
import { AnalyticEvents, ComponentActions, ThemeTypes } from "../../../../Constants";
import Logger from "../../../debug/Logger";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import MainTabsNavigatorPanelContext, { MainTabsChannelScreenStackContext } from "../panels/MainTabsNavigatorPanelContext";
import useChatLayout, { getChatLayout } from "../../../chat/native/useChatLayout";
import ReanimatedRexport, { useDerivedValue, useAnimatedReaction, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { useUnmountEffect } from "../../../../hooks/useMountEffect";
import useTheme from "../../../../hooks/useTheme";
import { runAfterInteractions } from "../../../../utils/native/RunAfterInteractionsUtils";
import { dismissKeyboard } from "../../../../utils/native/ChatInputUtils";
import useChatWidth from "../../../chat/native/useChatWidth";
import { ComponentDispatch } from "../../../../utils/ComponentDispatchUtils";
import useMainTabsPanelsGesture from "../panels/useMainTabsPanelsGesture";
import { useDerivedStateFromSharedValue } from "../../../reanimated/native/useStateFromSharedValue";
import RouteManager from "../../../routing/RouteManager";
import { getRootNavigationRef } from "../../RootNavigationRef.native";
import { coerceChannelRoute, coerceGuildsRoute } from "../../helpers/NavigationRouteUtils.native";
import useBackPressHandler from "../../../routing/native/useBackPressHandler";
import { useNavigation } from "../../../../_bundle/Module1481";
import { useMainTabsChannelScreenStyles } from "../panels/useMainTabsChannelScreenStyles";
import { GestureDetector } from "../../../../_bundle/Module5273";
import { MainTabsContentScrim } from "../panels/MainTabsContentScrim";
import ThemedGradient from "../../../client_themes/native/ThemedGradient";
import { LayerScope } from "../../../../design/components/Layers/native/LayerScope.native";
import ChannelDetails from "../sidebar/details/ChannelDetails";
let c10995_15 = new Logger("SwipeForMemberListWrapper");
const context = createContext(void 0);
const useStyles = createStyles({
memberListPreview: {
flex: 1,
justifyContent: "center",
alignItems: "flex-start",
overflow: "hidden",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
content: {
...StyleSheet.absoluteFillObject,
overflow: "hidden"
},
memberListContainer: {
flex: 1,
overflow: "hidden",
backgroundColor: Module712.colors.MODAL_BACKGROUND
},
midnightBorder: {
borderLeftColor: Module712.colors.BORDER_STRONG,
borderLeftWidth: MIDNIGHT_BORDER_WIDTH
},
midnightRightOverflow: {
right: -MIDNIGHT_BORDER_WIDTH
}
});
const __initData = {
code: "function SwipeForMemberListWrapperTsx1(){const{shownPixels}=this.__closure;return shownPixels.get()>0;}"
};
const __initData2 = {
code: "function SwipeForMemberListWrapperTsx2(isVisible,wasVisible){const{mainDisallowGesture,stackDisallowGesture,panelDisallowGesture}=this.__closure;var _stackDisallowGesture;if(isVisible===wasVisible)return;mainDisallowGesture.set(isVisible);(_stackDisallowGesture=stackDisallowGesture)===null||_stackDisallowGesture===void 0||_stackDisallowGesture.set(isVisible);if(!isVisible){panelDisallowGesture.set(false);}}"
};
const __initData3 = {
code: "function SwipeForMemberListWrapperTsx3(){const{isChatLockedOpen,mainTranslateX,stackTranslateX}=this.__closure;return!isChatLockedOpen&&mainTranslateX.get()>0||stackTranslateX!=null&&stackTranslateX.get()>0;}"
};
const __initData4 = {
code: "function SwipeForMemberListWrapperTsx4(isInactive,wasInactive){const{panelDisallowGesture}=this.__closure;if(isInactive===wasInactive)return;panelDisallowGesture.set(isInactive);}"
};
const __initData5 = {
code: "function SwipeForMemberListWrapperTsx5(){const{maxWidth,translateX}=this.__closure;return maxWidth-translateX.get();}"
};
const __initData6 = {
code: "function SwipeForMemberListWrapperTsx6(){const{theme,ThemeTypes,isChatBesideChannelList,translateX,MIDNIGHT_BORDER_WIDTH}=this.__closure;if(theme!==ThemeTypes.MIDNIGHT||isChatBesideChannelList)return translateX.get();return translateX.get()-MIDNIGHT_BORDER_WIDTH;}"
};
const __initData7 = {
code: "function SwipeForMemberListWrapperTsx7(){const{shownPixels,PEEK_PIXEL_THRESHOLD}=this.__closure;const exceedsPeekThreshold=shownPixels.get()>PEEK_PIXEL_THRESHOLD*2;return{display:exceedsPeekThreshold?'none':'flex',opacity:exceedsPeekThreshold?0:1-shownPixels.get()/PEEK_PIXEL_THRESHOLD};}"
};
export default ({ channelId, screenIndex, isBackEnabled, children, style }) => {
let c22025_6, panelGestureContext, translateX, movePanel, maxWidth, derivedValue, derivedStateFromSharedValue, callback, callback2, navigation;
let channelId2, screenIndex2, isDragging, derivedStateFromSharedValue2;
let gesture, derivedValue2, gesture2, disallowGesture, translateX2, gesture3, disallowGesture2, translateX3, disallowGesture3, isChatLockedOpen;
c22025_6 = void 0;
panelGestureContext = void 0;
translateX = void 0;
movePanel = void 0;
maxWidth = void 0;
derivedValue = void 0;
derivedStateFromSharedValue = void 0;
callback = void 0;
callback2 = void 0;
navigation = void 0;
const styles = useStyles();
const theme = useTheme();
let c22025_3 = theme;
const isChatBesideChannelList = useChatLayout().isChatBesideChannelList;
const [channelId3, setState] = useState(channelId);
useEffect(() => {
let c28029_0 = runAfterInteractions(() => {
setState(channelId);
}, 200);
return () => {
c28029_0.cancel();
};
}, [channelId]);
const callback3 = useCallback(() => {
dismissKeyboard();
}, []);
const chatWidth = useChatWidth(screenIndex);
c22025_6 = chatWidth;
const memo = useMemo(() => c22025_3 === ThemeTypes.MIDNIGHT ? c22025_6 + MIDNIGHT_BORDER_WIDTH : c22025_6, [theme, chatWidth]);
const mainTabsPanelsGesture = useMainTabsPanelsGesture({
canDrag: true,
onDragStart: callback3,
onPreMovement: useCallback((a0) => {
if (!a0) {
setIsChannelDetailsSearchActive(channelId, false, "initial");
ComponentDispatch.dispatch(ComponentActions.CHANNEL_DETAILS_HIDDEN, {
channelId,
screenIndex
});
}
}, [channelId, screenIndex]),
startShown: false,
cancelOnSwipeRightFromStart: true,
openWidth: memo
});
const gesture4 = mainTabsPanelsGesture.gesture;
panelGestureContext = mainTabsPanelsGesture.panelGestureContext;
const isDragging2 = mainTabsPanelsGesture.isDragging;
translateX = mainTabsPanelsGesture.translateX;
movePanel = mainTabsPanelsGesture.movePanel;
maxWidth = mainTabsPanelsGesture.maxWidth;
const X = () => maxWidth - translateX.get();
X.__closure = {
maxWidth,
translateX
};
X.__workletHash = 10842481670591;
X.__initData = __initData5;
derivedValue = useDerivedValue(X);
derivedStateFromSharedValue = useDerivedStateFromSharedValue(derivedValue, (a0) => a0 > 0);
useEffect(() => {
if (derivedStateFromSharedValue) {
ComponentDispatch.dispatch(ComponentActions.CHANNEL_DETAILS_SHOWN, {
channelId,
screenIndex
});
}
}, [derivedStateFromSharedValue, channelId, screenIndex]);
const te = function te() {
return c22025_3 === ThemeTypes.MIDNIGHT && !isChatBesideChannelList ? translateX.get() - MIDNIGHT_BORDER_WIDTH : translateX.get();
};
te.__closure = {
theme,
ThemeTypes,
isChatBesideChannelList,
translateX,
MIDNIGHT_BORDER_WIDTH
};
te.__workletHash = 5498466465211;
te.__initData = __initData6;
const derivedValue3 = useDerivedValue(te);
callback = useCallback((a0) => {
if (a0.channelId === channelId && a0.screenIndex === screenIndex) {
dismissKeyboard();
if (a0.search === true) {
setIsChannelDetailsSearchActive(a0.channelId, true, "initial");
}
movePanel(true, false, 0, true);
}
}, [channelId, screenIndex, movePanel]);
callback2 = useCallback(() => {
movePanel(false, false, 0, true);
}, [movePanel]);
useEffect(() => {
let c28030_0 = RouteManager.addRouteChangeListener(() => {
callback2();
});
return () => {
c28030_0();
};
}, [callback2]);
useEffect(() => {
ComponentDispatch.subscribe(ComponentActions.SHOW_CHANNEL_DETAILS, callback);
ComponentDispatch.subscribe(ComponentActions.HIDE_CHANNEL_DETAILS, callback2);
return () => {
ComponentDispatch.unsubscribe(ComponentActions.SHOW_CHANNEL_DETAILS, callback);
ComponentDispatch.unsubscribe(ComponentActions.HIDE_CHANNEL_DETAILS, callback2);
};
}, [callback, callback2]);
const callback4 = useCallback(() => {
let r46;
if (derivedValue.get() <= 0) {
c10995_15.verbose("handleBackPress", "shownPixels <= 0", {
shownPixels: derivedValue.get()
});
return false;
}
const rootNavigationRef = getRootNavigationRef();
const currentRoute = rootNavigationRef == null ? void 0 : rootNavigationRef.getCurrentRoute();
const isChatLockedOpen2 = getChatLayout().isChatLockedOpen;
let route = coerceChannelRoute(currentRoute);
if (route == null && isChatLockedOpen2) {
route = coerceGuildsRoute(currentRoute);
}
c10995_15.verbose("handleBackPress", {
route,
channelId,
currentRoute,
isChatLockedOpen: isChatLockedOpen2,
routeParams: route?.params
});
if (route == null) {
c10995_15.verbose("handleBackPress", "route is null", {
currentRoute,
isChatLockedOpen: isChatLockedOpen2
});
r46 = false;
} else if (route.params?.channelId !== channelId) {
c10995_15.verbose("handleBackPress", "route channelId mismatch", {
routeChannelId: route.params?.channelId,
expectedChannelId: channelId
});
r46 = false;
} else if (getIsChannelDetailsSearchActive(channelId)) {
c10995_15.verbose("handleBackPress", "cancelling search before closing panel");
setIsChannelDetailsSearchActive(channelId, false, "initial");
r46 = true;
} else {
callback2();
r46 = true;
}
return r46;
}, [derivedValue, callback2, channelId]);
useBackPressHandler(callback4, derivedStateFromSharedValue);
useEffect(() => {
callback2();
}, [channelId, screenIndex, callback2]);
navigation = useNavigation();
channelId2 = channelId;
screenIndex2 = screenIndex;
isDragging = isDragging2;
derivedStateFromSharedValue2 = derivedStateFromSharedValue;
useEffect(() => {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.MEMBER_LIST_SWIPE_TOGGLED, {
channel_id: channelId2,
screen_index: String(screenIndex2),
member_list_open: derivedStateFromSharedValue2
});
}, [channelId, screenIndex, derivedStateFromSharedValue]);
useEffect(() => {
let r1 = derivedStateFromSharedValue2;
if (derivedStateFromSharedValue2) {
r1 = isDragging.get();
}
if (r1) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.MEMBER_LIST_SWIPE_PEEK, {
channel_id: channelId2,
screen_index: String(screenIndex2)
});
}
}, [derivedStateFromSharedValue, channelId, screenIndex, isDragging]);
gesture = gesture4;
derivedValue2 = derivedValue;
gesture2 = void 0;
disallowGesture = void 0;
translateX2 = void 0;
gesture3 = void 0;
disallowGesture2 = void 0;
translateX3 = void 0;
disallowGesture3 = void 0;
isChatLockedOpen = void 0;
const context2 = useContext(MainTabsNavigatorPanelContext);
gesture2 = context2.gesture;
disallowGesture = context2.disallowGesture;
translateX2 = context2.translateX;
let r143 = useContext(MainTabsChannelScreenStackContext);
if (r143 == null) {
r143 = {};
}
gesture3 = r143.gesture;
disallowGesture2 = r143.disallowGesture;
translateX3 = r143.translateX;
disallowGesture3 = panelGestureContext.disallowGesture;
isChatLockedOpen = useChatLayout().isChatLockedOpen;
const memo2 = useMemo(() => gesture3 == null ? gesture.simultaneousWithExternalGesture(gesture2) : gesture.simultaneousWithExternalGesture(gesture2, gesture3), [gesture, gesture2, gesture3]);
const c = function c() {
return derivedValue2.get() > 0;
};
c.__closure = {
shownPixels: derivedValue
};
c.__workletHash = 15116046915956;
c.__initData = __initData;
const r159 = function(a0, a1) {
if (a0 !== a1) {
disallowGesture.set(a0);
if (disallowGesture2 != null) {
disallowGesture2.set(a0);
}
if (!a0) {
disallowGesture3.set(false);
}
}
};
r159.__closure = {
mainDisallowGesture: disallowGesture,
stackDisallowGesture: disallowGesture2,
panelDisallowGesture: disallowGesture3
};
r159.__workletHash = 13681610289748;
r159.__initData = __initData2;
useAnimatedReaction(c, r159);
const h = function h() {
return (isChatLockedOpen ? !isChatLockedOpen : translateX2.get() > 0) || translateX3 != null && translateX3.get() > 0;
};
h.__closure = {
isChatLockedOpen,
mainTranslateX: translateX2,
stackTranslateX: translateX3
};
h.__workletHash = 11938850302839;
h.__initData = __initData3;
const u = function u(a0, a1) {
if (a0 !== a1) {
disallowGesture3.set(a0);
}
};
u.__closure = {
panelDisallowGesture: disallowGesture3
};
u.__workletHash = 3362957347102;
u.__initData = __initData4;
useAnimatedReaction(h, u);
useUnmountEffect(() => {
disallowGesture3.set(false);
disallowGesture.set(false);
if (disallowGesture2 != null) {
disallowGesture2.set(false);
}
});
const memo3 = useMemo(() => ({
...panelGestureContext,
channelId,
screenIndex,
isPanelActive: derivedStateFromSharedValue
}), [panelGestureContext, channelId, screenIndex, derivedStateFromSharedValue]);
const styles2 = useMainTabsChannelScreenStyles(isDragging, derivedValue3, maxWidth);
const le = function le() {
const r3 = derivedValue.get() > 300;
return {
display: r3 ? "none" : "flex",
opacity: r3 ? 0 : 1 - derivedValue.get() / 150
};
};
le.__closure = {
shownPixels: derivedValue,
PEEK_PIXEL_THRESHOLD: 150
};
le.__workletHash = 9468759128012;
le.__initData = __initData7;
const animatedStyle = useAnimatedStyle(le);
return <context.Provider value={memo3}>
<GestureDetector gesture={memo2}>
<View style={style} onAccessibilityEscape={() => {
if (isBackEnabled) {
navigation.goBack();
}
}}>
<View style={styles.content} accessibilityElementsHidden={!!derivedStateFromSharedValue || void 0} importantForAccessibility={derivedStateFromSharedValue ? "no-hide-descendants" : void 0}>
{children}
<MainTabsContentScrim translateX={derivedValue3} maxWidth={maxWidth} />
</View>
<ReanimatedRexport.View style={[styles2, styles.memberListContainer, theme === ThemeTypes.MIDNIGHT ? styles.midnightBorder : void 0, isChatBesideChannelList ? void 0 : theme === ThemeTypes.MIDNIGHT ? styles.midnightRightOverflow : void 0]} accessibilityElementsHidden={derivedStateFromSharedValue ? void 0 : !derivedStateFromSharedValue} importantForAccessibility={derivedStateFromSharedValue ? void 0 : "no-hide-descendants"}>
<ThemedGradient absolute withOverlay overlayOpacity={0.5} />
<LayerScope>
<ChannelDetails isShowing={derivedStateFromSharedValue} channelId={channelId3} isSearchLocked={false} onBackPress={callback4} componentWidth={chatWidth} onChannelDeleted={callback2} />
</LayerScope>
<ReanimatedRexport.View style={[StyleSheet.absoluteFill, animatedStyle]}>
<View style={styles.memberListPreview} />
</ReanimatedRexport.View>
</ReanimatedRexport.View>
</View>
</GestureDetector>
</context.Provider>;
};
export { context as SwipeForMemberListContext };
@@ -0,0 +1,47 @@
// Metro module 10136 (f10137).
import ChannelStore from "../../../../../stores/ChannelStore";
import { ComponentActions } from "../../../../../Constants";
import { StaticChannelRoute } from "../../../../channel/ChannelConstants";
import { isIOS } from "../../../../../utils/PlatformUtils";
import { getChatInputRef } from "../../../../../utils/native/ChatInputUtils";
import { isSwipeToMemberListEnabled } from "../../sidebar/member_list/SwipeToMemberListUtils";
import { ComponentDispatch } from "../../../../../utils/ComponentDispatchUtils";
import { getRootNavigationRef } from "../../../RootNavigationRef.native";
import { useStateFromStores } from "../../../../../_bundle/defaultAreStatesEqual";
import { useIsChannelContentGated } from "../../../../age_gate/AgeGateUtils";
import GuildRoleSubscriptionsChannelHeader from "../../../../guild_role_subscriptions/native/overview_tab/GuildRoleSubscriptionsChannelHeader";
import HomeChannelHeader from "./HomeChannelHeader";
import PrivateChannelHeader from "./PrivateChannelHeader";
import ForumChannelHeader from "./ForumChannelHeader";
import { intl, t } from "../../../../../intl/index.native";
import GuildChannelHeader from "./GuildChannelHeader";
export default function ChannelHeader(props) {
const { channelId, screenIndex, isNavigationScreen, pressable = true, isGuildMemberCountVisible = true, showCreateThread = false } = props;
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
const isChannelContentGated = useIsChannelContentGated(stateFromStores);
const pressable2 = isChannelContentGated ? !isChannelContentGated : pressable;
return channelId === StaticChannelRoute.ROLE_SUBSCRIPTIONS ? <GuildRoleSubscriptionsChannelHeader /> : channelId === StaticChannelRoute.GUILD_HOME ? <HomeChannelHeader /> : (stateFromStores == null ? void 0 : stateFromStores.isPrivate()) ? <PrivateChannelHeader channelId={channelId} pressable={pressable2} screenIndex={screenIndex} /> : (stateFromStores == null ? void 0 : stateFromStores.isForumLikeChannel()) ? <ForumChannelHeader channelId={channelId} guildId={stateFromStores?.guild_id} pressable={pressable2} isGuildMemberCountVisible={isGuildMemberCountVisible} isNavigationScreen={isNavigationScreen} screenIndex={screenIndex} searchPlaceholder={stateFromStores.isForumChannel() ? void 0 : intl.string(t["L9fR+P"])} /> : <GuildChannelHeader channelId={channelId} guildId={stateFromStores?.guild_id} pressable={pressable2} isGuildMemberCountVisible={isGuildMemberCountVisible} isNavigationScreen={isNavigationScreen} screenIndex={screenIndex} showCreateThread={showCreateThread} />;
};
export function navigateToChannelDetails(a0, a1, a2) {
if (isIOS()) {
const chatInputRef = getChatInputRef(a0, a1);
if (chatInputRef != null) {
chatInputRef.blur();
}
}
if (isSwipeToMemberListEnabled()) {
ComponentDispatch.dispatch(ComponentActions.SHOW_CHANNEL_DETAILS, {
source: a2,
channelId: a0,
screenIndex: a1
});
} else {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef == null ? void 0 : rootNavigationRef.isReady()) {
rootNavigationRef.navigate("sidebar", {
channelId: a0,
source: a2
});
}
}
}
@@ -0,0 +1,191 @@
// Metro module 10144 (f10145).
import { useState, useCallback, useMemo } from "react";
import { View } from "react-native";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { getMinHeaderHeight } from "../../shared_components/MainTabsV2Constants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import MobileVisualRefreshExperiment from "../../../../themes/experiments/MobileVisualRefreshExperiment";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { isAndroid } from "../../../../../utils/PlatformUtils";
import UsernameWithEffects from "../../../../display_name_styles/native/UsernameWithEffects";
import { Text } from "../../../../../design/components/Text/native/Text";
import { Icon, AvatarSizes, Avatar } from "../../../../../design/void/native";
import Module10145 from "../../../../../_bundle/Module10145";
import GroupDMAvatar from "../../../../group_dm/native/GroupDMAvatar";
import { useToken } from "../../../../../design/tokens/native/useToken";
import { getChannelIconWithGuild, getChannelIconComponent } from "../../../../../utils/native/ChannelUtils";
import GuildActionSheetMemberCount from "../../../../guild_action_sheet/native/components/GuildActionSheetMemberCount";
import { intl, t } from "../../../../../intl/index.native";
import { computeChannelName } from "../../../../channel/useChannelName";
let useStyles, ChannelTitle, GroupDMIcon, UserAvatar, ChannelIconRaw, MemberCountText, ParentChannelSubTitle, EmptyIcon;
const TitleWrapper = function TitleWrapper(props) {
const { children, onPress, headerAccessibilityLabel, titleContentHeight } = props;
const styles = useStyles(MobileVisualRefreshExperiment("ChannelHeaderShared"));
const [androidRippleConfig, setState] = useState(void 0);
const callback = useCallback((a0) => {
setState({
borderless: true,
radius: a0.nativeEvent.layout.width
});
}, []);
const memo = useMemo(() => {
if (titleContentHeight != null) {
const top = Math.max(0, (getMinHeaderHeight("ChannelHeaderShared") - titleContentHeight) / 2);
return {
top,
bottom: top
};
}
}, [titleContentHeight]);
return onPress == null ? <View style={styles.wrapper} accessibilityRole="header">{children}</View> : <PressableOpacity onLayout={isAndroid() ? callback : void 0} onPress={onPress} androidRippleConfig={androidRippleConfig} accessibilityRole="header" accessibilityLabel={headerAccessibilityLabel} hitSlop={memo} style={styles.wrapper}>{children}</PressableOpacity>;
};
ChannelTitle = function ChannelTitle(props) {
const { title, accessibleTitle, subtitle, disableArrow = false, userId, guildId, icon } = props;
const r21 = MobileVisualRefreshExperiment("ChannelTitle");
const styles = useStyles(r21);
return <View style={styles.channelContent}>
<View style={styles.nameWithArrow}>
{r21 ? icon ?? null : null}
{userId != null ? <UsernameWithEffects userId={userId} guildId={guildId} userName={title} variant={r21 ? "redesign/heading-18/semibold" : "heading-lg/bold"} defaultColor="mobile-text-heading-primary" lineClamp={1} style={styles.channelName} accessibilityLabel={accessibleTitle} accessibilityRole="header" maxFontSizeMultiplier={2} /> : <Text variant={r21 ? "redesign/heading-18/semibold" : "heading-lg/bold"} color="mobile-text-heading-primary" lineClamp={1} style={styles.channelName} accessibilityLabel={accessibleTitle} accessibilityRole="header" maxFontSizeMultiplier={2}>{title}</Text>}
{disableArrow ? !disableArrow : <Icon source={Module10145} size={Icon.Sizes.REFRESH_SMALL_16} style={styles.arrowIcon} />}
</View>
{subtitle != null && <View style={styles.subTitleContainer}>{subtitle}</View>}
</View>;
};
GroupDMIcon = function GroupDMIcon(props) {
return <GroupDMAvatar size={AvatarSizes.REFRESH_MEDIUM_32} channel={props.channel} style={useStyles(MobileVisualRefreshExperiment("ChannelHeaderShared")).channelIcon} />;
};
UserAvatar = function UserAvatar(props) {
const { user, status, isMobileOnline, isVROnline } = props;
const styles = useStyles(MobileVisualRefreshExperiment("ChannelHeaderShared"));
return <Avatar user={user} avatarDecoration={user.avatarDecoration} guildId={void 0} size={AvatarSizes.REFRESH_MEDIUM_32} status={user.isSystemUser() ? null : status} isMobileOnline={isMobileOnline} isVROnline={isVROnline} style={styles.channelIcon} autoStatusCutout />;
};
ChannelIconRaw = function ChannelIconRaw(props) {
const { icon, IconComponent } = props;
const r7 = MobileVisualRefreshExperiment("ChannelHeaderShared");
const token = useToken(Module712.modules.mobile.CHANNEL_HEADER_ICON_SIZE);
const styles = useStyles(r7);
return IconComponent != null ? <IconComponent size={token} color={r7 ? "icon-strong" : "text-strong"} style={r7 ? {
marginEnd: 4
} : void 0} /> : <Icon size={Icon.Sizes.SMALL_20} source={icon} color={styles.guildChannelIcon.tintColor} />;
};
MemberCountText = function MemberCountText(props) {
const presenceCount = props.presenceCount;
let memberCount = props.memberCount;
const { withSeparator, leadingAccessoryWidth } = props;
const r19 = MobileVisualRefreshExperiment("ChannelHeaderShared");
const type = presenceCount === 0 ? memberCount !== null ? "total" : "online" : "online";
if (type === "online") {
memberCount = presenceCount;
}
if (memberCount == null) {
memberCount = void 0;
}
return <>
{[<GuildActionSheetMemberCount type={type} count={memberCount} color={r19 ? "text-subtle" : "text-muted"} dotContainerWidth={r19 ? leadingAccessoryWidth : void 0} />, withSeparator ? <Text variant={r19 ? "text-sm/normal" : "text-xs/medium"} color="text-subtle">•</Text> : null]}
</>;
};
ParentChannelSubTitle = function ParentChannelSubTitle(props) {
const channel = props.channel;
const r11 = MobileVisualRefreshExperiment("ChannelHeaderShared");
const styles = useStyles(r11);
return <Text lineClamp={1} accessibilityLabel={intl.formatToPlainString(t.BjYvHO, {
channelName: computeChannelName(channel, UserStore, RelationshipStore)
})} maxFontSizeMultiplier={2} variant={r11 ? "text-sm/medium" : "text-xs/medium"} color={r11 ? "text-subtle" : "text-muted"} style={styles.parentChannelName}>
{computeChannelName(channel, UserStore, RelationshipStore)}
</Text>;
};
EmptyIcon = function EmptyIcon() {
return <View style={useStyles(MobileVisualRefreshExperiment("ChannelHeaderShared")).channelIconWrapper} />;
};
useStyles = createStyles((a0) => ({
wrapper: {
flex: 1,
alignItems: "center",
flexShrink: 1,
flexDirection: "row",
paddingEnd: 8
},
channelContent: {
flex: 1,
flexShrink: 1,
justifyContent: "center",
marginTop: a0 ? 4 : void 0
},
nameWithArrow: {
flexDirection: "row",
alignItems: "center",
flexShrink: 1
},
channelName: {
flexShrink: 1,
...a0 ? {} : {
fontSize: 18,
lineHeight: 24
}
},
arrowIcon: {
tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT,
flexShrink: 0,
flexGrow: 0,
marginTop: 2,
marginLeft: 2
},
channelIcon: {
marginRight: 12,
flexShrink: 0
},
channelIconWrapper: {
width: 32,
height: 32,
justifyContent: "center",
alignItems: "center"
},
guildChannelIcon: {
tintColor: Module712.colors.TEXT_STRONG
},
subTitleContainer: {
flexDirection: "row",
alignItems: "center",
gap: 4,
marginBottom: 4
},
parentChannelName: {
lineHeight: 16,
flexShrink: 1
}
}));
export function renderTitleWrapper(a0, a1, a2, a3) {
return <TitleWrapper onPress={a1} headerAccessibilityLabel={a2} titleContentHeight={a3}>
{a0}
</TitleWrapper>;
}
export function renderChannelTitle(a0, r2 = {}) {
const { accessibleTitle, subtitle, disableArrow } = r2;
return <ChannelTitle title={a0} accessibleTitle={accessibleTitle} subtitle={subtitle} disableArrow={disableArrow !== void 0 && disableArrow} userId={r2.userId} guildId={r2.guildId} icon={r2.icon} />;
}
export function renderGroupDMIcon(a0) {
return <GroupDMIcon channel={a0} />;
}
export function renderUserAvatar(a0, a1, a2, a3) {
return <UserAvatar user={a0} status={a1} isMobileOnline={a2} isVROnline={a3} />;
}
export function renderChannelIconRaw(a0, a1) {
return <ChannelIconRaw icon={a0} IconComponent={a1} />;
}
export function renderChannelIcon(a0, a1) {
return <ChannelIconRaw icon={getChannelIconWithGuild(a0, a1)} IconComponent={getChannelIconComponent(a0, {
isRulesChannel: a1?.rulesChannelId === a0.id
})} />;
}
export function renderMemberCountText(a0, a1, withSeparator = false) {
return a0 == null ? a1 == null ? null : <MemberCountText presenceCount={a0} memberCount={a1} withSeparator={withSeparator} leadingAccessoryWidth={arguments[3]} /> : <MemberCountText presenceCount={a0} memberCount={a1} withSeparator={withSeparator} leadingAccessoryWidth={arguments[3]} />;
}
export function renderParentChannelSubTitle(a0) {
return <ParentChannelSubTitle channel={a0} />;
}
export function renderEmptyIcon() {
return <EmptyIcon />;
}
@@ -0,0 +1,25 @@
// Metro module 10147 (f10148).
import { memo } from "react";
import { View } from "react-native";
import { MIN_HEADER_HEIGHT } from "../../shared_components/MainTabsV2Constants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import { useIsForumChannelSearchActive } from "../../../../forums/native/hooks/useIsForumChannelSearchActive";
import { ForumChannelSearchInput } from "../../../../forums/native/ForumChannelSearch";
import GuildChannelHeader from "./GuildChannelHeader";
const useStyles = createStyles({
search: {
flex: 1,
flexShrink: 1,
flexDirection: "row",
alignItems: "center",
paddingStart: 4,
height: MIN_HEADER_HEIGHT
}
});
const r32 = memo(function({ channelId, screenIndex, guildId, pressable, isGuildMemberCountVisible, isNavigationScreen, searchPlaceholder }) {
const styles = useStyles();
return useIsForumChannelSearchActive(channelId) ? <View style={styles.search}>
<ForumChannelSearchInput channelId={channelId} guildId={guildId} placeholder={searchPlaceholder} />
</View> : <GuildChannelHeader channelId={channelId} guildId={guildId} pressable={pressable} isGuildMemberCountVisible={isGuildMemberCountVisible} isNavigationScreen={isNavigationScreen} screenIndex={screenIndex} />;
});
export default r32;
@@ -0,0 +1,198 @@
// Metro module 10149 (f10150).
import { useEffect, useMemo, memo, useRef, useCallback } from "react";
import { View } from "react-native";
import ChannelMemberCountStore from "../../../../channel/ChannelMemberCountStore";
import GatewayConnectionStore from "../../../../gateway/GatewayConnectionStore";
import { THREAD_CHANNEL_TYPES } from "../../../../../records/ChannelRecord";
import ChannelMemberStore from "../../../../../stores/ChannelMemberStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildMemberCountStore from "../../../../../stores/GuildMemberCountStore";
import GuildStore from "../../../../../stores/GuildStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { ChannelTypes, HelpdeskArticles, StatusTypes } from "../../../../../Constants";
import { ContentDismissActionType } from "../../../../dismissible_content/DismissibleContentConstants";
import { useToken } from "../../../../../design/tokens/native/useToken";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStoresObject, useStateFromStores } from "../../../../../_bundle/Module589";
import { renderMemberCountText, renderChannelIcon, renderParentChannelSubTitle, renderChannelTitle, renderTitleWrapper } from "./ChannelHeaderShared";
import { ICON_SIZE } from "../../../../../design/components/Icon/IconSize";
import * as _AgeGateUtils from "../../../../age_gate/native/AgeGateUtils";
import { intl, t } from "../../../../../intl/index.native";
import { computeChannelName } from "../../../../channel/useChannelName";
import { useShouldChannelShowLoadingIndicator, ChannelHeaderLoadingIndicator } from "../../../../chat/native/ChatLoadingIndicator";
import { useSelectedDismissibleContent } from "../../../../dismissible_content/hooks/useSelectedDismissibleContent";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { getChannelIconWithGuild } from "../../../../../utils/native/ChannelUtils";
import { useCoachmark } from "../../../../../design/components/Coachmark/native/useCoachmark.native";
import MobileVisualRefreshExperiment from "../../../../themes/experiments/MobileVisualRefreshExperiment";
import useGetThreadDraftSettings from "../../../../threads/useGetThreadDraftSettings";
import { navigateToChannelDetails } from "./ChannelHeader";
let computeVisibleChannelName, ChannelLinkedLobbyCoachmark;
const GuildChannelMemberCount = function GuildChannelMemberCount({ channel, withSeparator = false }) {
const token = useToken(Module712.modules.mobile.CHANNEL_HEADER_ICON_SIZE);
const stateFromStoresObject = useStateFromStoresObject([ChannelMemberStore, ChannelMemberCountStore], () => {
const groups = ChannelMemberStore.getProps(channel.guild_id, channel.id).groups;
let r30 = false;
let r31 = false;
let r33 = 0;
let online = 0;
for (const item of groups) {
if (item.count !== 0 && item.id !== StatusTypes.UNKNOWN) {
r30 = true;
const r45 = r33;
r33 = r45 + item.count;
if (item.id === StatusTypes.OFFLINE) {
r31 = true;
} else {
online = online + item.count;
}
}
}
return r30 ? {
total: r31 ? r33 : null,
online
} : ChannelMemberCountStore.getMemberCount(channel.id);
});
const { online, total } = stateFromStoresObject;
useEffect(() => {
ChannelMemberCountStore.requestCount(channel.guild_id, channel.id);
}, [channel.guild_id, channel.id]);
if (!(total != null && total > 500) && !(online != null && online > 500)) {
return renderMemberCountText(online, total, withSeparator, ICON_SIZE[token]);
}
};
computeVisibleChannelName = function computeVisibleChannelName({ channel: channel3, guildId: guildId3, showCreateThread: showCreateThread2, isConnected }) {
return _AgeGateUtils.shouldNSFWGateGuild(guildId3) ? intl.string(t.HbPHt1) : showCreateThread2 ? intl.string(t["4WNcpu"]) : channel3 == null ? isConnected ? intl.string(t.ai6Lbr) : intl.string(t.ZTNur7) : computeChannelName(channel3, UserStore, RelationshipStore);
};
ChannelLinkedLobbyCoachmark = function ChannelLinkedLobbyCoachmark({ iconRef, guild, channel: channel2 }) {
const [r22, r23] = useSelectedDismissibleContent([DismissibleContent.CHANNEL_LINKED_LOBBY_EDUCATION_TOOLTIP], void 0, true);
let c17730_2 = r23;
const visible = r22 === DismissibleContent.CHANNEL_LINKED_LOBBY_EDUCATION_TOOLTIP;
useCoachmark(iconRef, useMemo(() => ({
title: intl.string(t.YIVr4B),
description: intl.format(t.w8VWRT, {
helpdeskArticle: HelpdeskUtils.getArticleURL(HelpdeskArticles.LINKED_LOBBIES)
}),
visible: channel2?.linkedLobby != null && visible,
position: "bottom",
offsetY: 15,
onDismiss: () => c17730_2(ContentDismissActionType.USER_DISMISS),
imgSource: channel2 != null ? getChannelIconWithGuild(channel2, guild) : void 0
}), [channel2, guild, r23, visible]));
return null;
};
const r57 = memo(function GuildChannelHeader(props) {
let c17731_5;
const { channelId, screenIndex, guildId } = props;
let pressable = props.pressable;
const { isGuildMemberCountVisible, showCreateThread } = props;
c17731_5 = void 0;
const r12 = MobileVisualRefreshExperiment("GuildChannelHeader");
const ref = useRef(null);
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
const stateFromStores3 = useStateFromStores([GatewayConnectionStore], () => GatewayConnectionStore.isConnected());
c17731_5 = useGetThreadDraftSettings(channelId);
const stateFromStores4 = useStateFromStores([ChannelStore], () => {
let r10;
L10: {
if (stateFromStores != null && !showCreateThread) {
const r2 = stateFromStores != null;
r10 = void 0;
if (!r2) {
break L10;
}
const r11 = stateFromStores.parent_id != null;
r10 = void 0;
if (!r11) {
break L10;
}
const r13 = THREAD_CHANNEL_TYPES.has(stateFromStores.type);
r10 = void 0;
if (!r13) {
break L10;
}
r10 = ChannelStore.getChannel(stateFromStores.parent_id);
} else {
r10 = ChannelStore.getChannel(c17731_5?.parentChannelId);
}
}
return r10;
});
if (pressable) {
pressable = stateFromStores != null;
}
if (pressable) {
pressable = !showCreateThread;
}
const stateFromStores2 = useStateFromStores([GuildStore], () => GuildStore.getGuild(guildId));
const r68 = stateFromStores == null ? null : showCreateThread ? null : renderChannelIcon(stateFromStores, stateFromStores2);
const disableArrow = !pressable;
const r72 = !isGuildMemberCountVisible;
const icon = r12 ? r68 : null;
const guildId2 = guildId;
const channelName = computeVisibleChannelName({
channel: stateFromStores,
guildId,
showCreateThread,
isConnected: useStateFromStores([GatewayConnectionStore], () => GatewayConnectionStore.isConnected())
});
const shouldNSFWGateGuild = _AgeGateUtils.shouldNSFWGateGuild(guildId);
const r86 = shouldNSFWGateGuild ? !shouldNSFWGateGuild : showCreateThread ? showCreateThread : stateFromStores == null ? void 0 : stateFromStores.isThread();
const accessibleTitle = intl.formatToPlainString(r86 ? t["OkzL+Q"] : t.UbNmGc, {
channelName
});
const r97 = r86 ? stateFromStores4 != null ? renderParentChannelSubTitle(stateFromStores4) : void 0 : void 0;
let r107 = useStateFromStores([GuildMemberCountStore], () => GuildMemberCountStore.getMemberCount(guildId2));
if (r107 == null) {
r107 = 0;
}
const r108 = (isGuildMemberCountVisible ? r107 < 500 : !r72) && stateFromStores != null && !stateFromStores.isThread() && ![ChannelTypes.GUILD_DIRECTORY, ChannelTypes.GUILD_FORUM].includes(stateFromStores.type) && !showCreateThread;
const shouldChannelShowLoadingIndicator = useShouldChannelShowLoadingIndicator(stateFromStores?.id);
const r125 = stateFromStores == null ? void 0 : stateFromStores.isForumLikeChannel();
let r127 = r125 ? !r125 : shouldChannelShowLoadingIndicator;
const r147 = renderChannelTitle(channelName, {
accessibleTitle,
subtitle: r127 ? <ChannelHeaderLoadingIndicator /> : <>
{r108 ? <GuildChannelMemberCount channel={stateFromStores} withSeparator={r97 != null} /> : r108}
{stateFromStores4 != null && r97}
</>,
disableArrow,
guildId,
icon
});
if (!r127) {
r127 = r108;
}
if (!r127) {
r127 = r97 != null;
}
const callback = useCallback(() => {
navigateToChannelDetails(channelId, screenIndex, "guild-channel-header-title");
}, [channelId, screenIndex]);
const r180 = <>
{r12 ? stateFromStores2 != null ? stateFromStores?.linkedLobby != null ? <View ref={ref}>
<ChannelLinkedLobbyCoachmark iconRef={ref} guild={stateFromStores2} channel={stateFromStores} />
</View> : null : null : <View ref={ref} style={{
marginRight: 8
}}>
{r68}
{stateFromStores2 != null ? stateFromStores?.linkedLobby != null ? <ChannelLinkedLobbyCoachmark iconRef={ref} guild={stateFromStores2} channel={stateFromStores} /> : null : null}
</View>}
{r147}
</>;
const r182 = stateFromStores != null ? `${computeVisibleChannelName({
channel: stateFromStores,
guildId,
showCreateThread,
isConnected: stateFromStores3
})}, ${intl.string(t.x87QCk)}` : void 0;
if (pressable) {
return <>
{renderTitleWrapper(r180, callback, r182, r127 ? 44 : 24)}
</>;
}
return r180;
});
export default r57;
@@ -0,0 +1,26 @@
// Metro module 10139 (f10140).
import { memo } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { Icon } from "../../../../../design/void/native";
import Module10140 from "../../../../../_bundle/Module10140";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
const useStyles = createStyles({
container: {
flex: 1,
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_8
}
});
const r34 = memo(function HomeChannelHeader() {
return <View style={useStyles().container}>
<Icon source={Module10140} size={Icon.Sizes.MEDIUM} disableColor />
<Text variant="heading-lg/extrabold" color="interactive-text-active">
{intl.string(t.Ym2Ri6)}
</Text>
</View>;
});
export default r34;
@@ -0,0 +1,228 @@
// Metro module 10128 (f10129).
import * as Module19 from "react";
import { useMemo, useCallback } from "react";
import { View } from "react-native";
import ChannelRTCStore, { NO_PARTICIPANTS } from "../../../../calls/ChannelRTCStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import VoiceStateStore from "../../../../../stores/VoiceStateStore";
import { setIsChannelDetailsSearchActive } from "../../sidebar/details/stores/ChannelDetailsStore";
import { AnalyticEvents, AnalyticsSections, ChannelTypes } from "../../../../../Constants";
import { ParticipantTypes } from "../../../../calls/CallConstants";
import { CHANGELOG_URL } from "../../../../changelog/ChangelogConstants";
import { SearchEntrypointAnalyticsLocations } from "../../../../search/native/tracking/TrackingConstants";
import { AVATAR_SIZE_MAP, AvatarSizes, CutoutDirection, CutoutableAvatarImage } from "../../../../../design/void/native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import MobileVisualRefreshExperiment from "../../../../themes/experiments/MobileVisualRefreshExperiment";
import { useStateFromStores, useStateFromStoresObject } from "../../../../../_bundle/Module589";
import { useInappropriateConversationSafetyToolsWarningForChannel } from "../../../../self_mod/inappropriate_conversation/hooks/useInappropriateConversationSafetyToolsWarningForChannel";
import { useIsCallActiveNullable } from "../../../../calls/mobile/useIsCallActive";
import useAppDMChatInputState from "../../../../app_dms/useAppDMChatInputState";
import getPrivateChannelCall from "../../../../calls/native/getPrivateChannelCall";
import { confirmStartCall } from "../../../../voice_calls/native/ConfirmStartCall";
import { navigateToChannelDetails } from "./ChannelHeader";
import { getChannelDetailsSearchContext } from "../../../../search/native/hooks/useSearchContext";
import Tracking from "../../../../search/native/tracking/Tracking";
import AppAnalyticsUtils from "../../../../app_analytics/AppAnalyticsUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { intl, t } from "../../../../../intl/index.native";
import { MagnifyingGlassIcon } from "../../../../../design/components/Icon/native/redesign/generated/MagnifyingGlassIcon";
import { SafetyToolsButton } from "../../../../self_mod/inappropriate_conversation/native/SafetyToolsButton";
import isChangelogChannel from "../../../../changelog/utils/isChangelogChannel";
import Linking from "../../../../../lib/native/Linking";
import AnalyticsUtils from "../../../../../utils/AnalyticsUtils";
import { WindowLaunchIcon } from "../../../../../design/components/Icon/native/redesign/generated/WindowLaunchIcon";
import { SettingsIcon } from "../../../../../design/components/Icon/native/redesign/generated/SettingsIcon";
import { openChannelCallModal } from "../../../../../utils/native/PrivateChannelCallUtils";
import { VoiceNormalIcon } from "../../../../../design/components/Icon/native/redesign/generated/VoiceNormalIcon";
import { PhoneHangUpIcon } from "../../../../../design/components/Icon/native/redesign/generated/PhoneHangUpIcon";
import { PhoneCallIcon } from "../../../../../design/components/Icon/native/redesign/generated/PhoneCallIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { VideoIcon } from "../../../../../design/components/Icon/native/redesign/generated/VideoIcon";
const width = AVATAR_SIZE_MAP[AvatarSizes.XSMALL];
const cutout = {
direction: CutoutDirection.RIGHT,
radius: width / 2 + 3,
inset: -6
};
const useStyles = createStyles((a0) => ({
privateChannelButtonsWrapper: {
flexDirection: "row",
gap: 12,
paddingEnd: 1
},
button: {
backgroundColor: a0 ? void 0 : Module712.colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND,
borderRadius: Module712.modules.button.BORDER_RADIUS,
minHeight: Module712.space.PX_32,
minWidth: Module712.space.PX_32,
padding: Module712.space.PX_4,
justifyContent: "center",
flexDirection: "row",
alignItems: "center"
},
disabledButton: {
opacity: 0.6
},
overflowBadge: {
backgroundColor: Module712.colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND,
borderRadius: Module712.radii.round,
width,
height: width,
justifyContent: "center",
alignItems: "center",
marginLeft: -6
}
}));
const r76 = Module19.memo(function PrivateChannelButtons(props) {
let r211;
let recipientId, inappropriateConversationSafetyToolsWarningForChannel, c17719_6, callParticipants, visibleParticipants, totalParticipantCount, c17719_10, application, callback, callback2, callback3;
const { channelId, screenIndex } = props;
recipientId = void 0;
inappropriateConversationSafetyToolsWarningForChannel = void 0;
c17719_6 = void 0;
callParticipants = void 0;
visibleParticipants = void 0;
totalParticipantCount = void 0;
c17719_10 = void 0;
application = void 0;
callback = void 0;
callback2 = void 0;
callback3 = void 0;
const styles = useStyles(MobileVisualRefreshExperiment("PrivateChannelButtons"));
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
recipientId = stateFromStores == null ? void 0 : stateFromStores.getRecipientId();
const stateFromStores2 = useStateFromStores([VoiceStateStore], () => stateFromStores != null && VoiceStateStore.isInChannel(stateFromStores.id), [stateFromStores]);
inappropriateConversationSafetyToolsWarningForChannel = useInappropriateConversationSafetyToolsWarningForChannel(channelId);
const r52 = inappropriateConversationSafetyToolsWarningForChannel != null && recipientId != null;
c17719_6 = r52;
const stateFromStores3 = useStateFromStores([RelationshipStore, UserStore], () => stateFromStores?.type === ChannelTypes.DM && recipientId != null && (RelationshipStore.isBlocked(recipientId) || UserStore.getUser(recipientId)?.isProvisional === true));
const isCallActiveNullable = useIsCallActiveNullable(stateFromStores?.id);
callParticipants = useStateFromStoresObject([ChannelRTCStore], () => ({
callParticipants: (stateFromStores == null ? void 0 : stateFromStores.isMultiUserDM()) === true ? ChannelRTCStore.getParticipants(stateFromStores.id) : NO_PARTICIPANTS,
participantsVersion: (stateFromStores == null ? void 0 : stateFromStores.isMultiUserDM()) === true ? ChannelRTCStore.getParticipantsVersion(stateFromStores.id) : -1
})).callParticipants;
const memo = useMemo(() => {
const r7 = callParticipants.filter((callParticipant) => callParticipant.type === ParticipantTypes.USER);
return {
visibleParticipants: r7.slice(0, 5),
totalParticipantCount: r7.length
};
}, [callParticipants]);
visibleParticipants = memo.visibleParticipants;
totalParticipantCount = memo.totalParticipantCount;
const r19 = stateFromStores == null ? void 0 : stateFromStores.isMultiUserDM();
const r23 = r19 && callParticipants.length > 0;
c17719_10 = r23;
const appDMChatInputState = useAppDMChatInputState({
context: {
type: "channel",
channel: stateFromStores
}
});
application = appDMChatInputState.application;
const isAppDM = appDMChatInputState.isAppDM;
callback = useCallback(function(r6 = false) {
if (stateFromStores != null && stateFromStores.isPrivate()) {
const privateChannelCall = getPrivateChannelCall(stateFromStores, r6);
if (privateChannelCall.inCall) {
privateChannelCall.onPress();
} else {
confirmStartCall(privateChannelCall.onPress);
}
}
}, [stateFromStores]);
callback2 = useCallback(() => {
callback(false);
}, [callback]);
const callback4 = useCallback(() => {
callback(true);
}, [callback]);
callback3 = useCallback(() => {
navigateToChannelDetails(channelId, screenIndex, "private-channel-search-button");
setIsChannelDetailsSearchActive(channelId, true, "action");
if (stateFromStores != null) {
Tracking.trackSearchOpened({
searchContext: getChannelDetailsSearchContext(channelId, stateFromStores.getGuildId(), stateFromStores.isThread()),
searchLocation: SearchEntrypointAnalyticsLocations.INDIVIDUAL_DM
});
}
}, [stateFromStores, channelId, screenIndex]);
const callback5 = useCallback(() => {
if (recipientId != null && stateFromStores != null && application != null) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.SETTINGS_PANE_VIEWED, {
settings_type: "user",
destination_pane: AnalyticsSections.SETTINGS_APP_DMS_MENU,
source_page: "app_dm_settings",
application_id: application.id
});
ActionSheetActionCreators.openLazy(import("../../../../app_dms/native/AppDMOptionsBottomSheet"), "AppDMOptionsBottomSheet", {
userId: recipientId,
channel: stateFromStores,
application
});
}
}, [recipientId, stateFromStores, application]);
const r106 = [r52, styles.button, callback3, channelId, recipientId, inappropriateConversationSafetyToolsWarningForChannel?.id, ,];
const type = inappropriateConversationSafetyToolsWarningForChannel?.type;
const r111 = () => c17719_6 ? <SafetyToolsButton channelId={channelId} recipientId={recipientId} warningId={inappropriateConversationSafetyToolsWarningForChannel.id} warningType={inappropriateConversationSafetyToolsWarningForChannel.type} /> : <PressableOpacity style={styles.button} onPress={callback3} accessibilityLabel={intl.string(t["5h0QOP"])} accessibilityRole="button">
<MagnifyingGlassIcon size="sm" />
</PressableOpacity>;
r106[6] = type;
const memo2 = useMemo(r111, r106);
if (isChangelogChannel(channelId)) {
r211 = <PressableOpacity style={styles.button} onPress={function onPress() {
Linking.openURL(CHANGELOG_URL);
AnalyticsUtils.track(AnalyticEvents.CHANGE_LOG_CTA_CLICKED, {
cta_type: "channel_header",
target: CHANGELOG_URL
});
}} accessibilityLabel={intl.string(t["+KSnWX"])}>
<WindowLaunchIcon size="sm" />
</PressableOpacity>;
} else if (isAppDM) {
r211 = application == null ? null : <View style={styles.privateChannelButtonsWrapper}>
<PressableOpacity style={styles.button} onPress={callback3} accessibilityLabel={intl.string(t["5h0QOP"])} accessibilityRole="button">
<MagnifyingGlassIcon size="sm" />
</PressableOpacity>
<PressableOpacity style={styles.button} onPress={callback5} accessibilityLabel={intl.string(t.oCqlGG)} accessibilityRole="button">
<SettingsIcon size="sm" />
</PressableOpacity>
</View>;
} else {
const accessibilityLabel = r23 ? intl.string(t["0D/6Rz"]) : stateFromStores2 ? intl.string(t["4ry6yi"]) : intl.string(t.focH1t);
const style = [styles.button, {
borderWidth: r23 ? 1 : void 0,
borderColor: r23 ? stateFromStores2 ? Module712.unsafe_rawColors.GREEN_360 : Module712.unsafe_rawColors.BRAND_400 : void 0
}, stateFromStores3 ? styles.disabledButton : null];
r211 = <View style={styles.privateChannelButtonsWrapper}>
<PressableOpacity accessibilityLabel={accessibilityLabel} accessibilityRole="button" style={style} onPress={() => {
if (c17719_10 && stateFromStores != null) {
openChannelCallModal(stateFromStores);
} else {
callback2();
}
}} disabled={stateFromStores3}>
{r23 ? <VoiceNormalIcon size="sm" color={stateFromStores2 ? Module712.unsafe_rawColors.GREEN_360 : Module712.unsafe_rawColors.BRAND_400} /> : stateFromStores2 ? <PhoneHangUpIcon size="sm" color={Module712.unsafe_rawColors.RED_400} /> : <PhoneCallIcon size="sm" color={isCallActiveNullable ? Module712.unsafe_rawColors.GREEN_360 : void 0} />}
{visibleParticipants.map((visibleParticipant, index) => <CutoutableAvatarImage key={visibleParticipant.id} style={{
marginLeft: index === 0 ? Module712.space.PX_4 : -6
}} user={visibleParticipant.user} guildId={void 0} size={AvatarSizes.XSMALL} cutout={index === visibleParticipants.length - 1 ? totalParticipantCount > 5 ? cutout : void 0 : cutout} />)}
{totalParticipantCount > 5 && <View style={styles.overflowBadge}>
<Text variant="text-xxs/semibold" color="button-outline-primary-text">
+
{totalParticipantCount - 5}
</Text>
</View>}
</PressableOpacity>
{r19 ? null : stateFromStores2 ? null : <PressableOpacity style={[styles.button, stateFromStores3 ? styles.disabledButton : null]} onPress={callback4} disabled={stateFromStores3} accessibilityLabel={intl.string(t.oCqlGG)} accessibilityRole="button">
<VideoIcon size="sm" />
</PressableOpacity>}
{memo2}
</View>;
}
return r211;
});
export default r76;
@@ -0,0 +1,94 @@
// Metro module 10141 (f10142).
import { memo, useCallback } from "react";
import ChannelStore from "../../../../../stores/ChannelStore";
import PresenceStore from "../../../../../stores/PresenceStore";
import RelationshipStore from "../../../../../stores/RelationshipStore";
import UserStore from "../../../../../stores/UserStore";
import { ChannelTypes, StatusTypes } from "../../../../../Constants";
import { AVATAR_SIZE_MAP, AvatarSizes } from "../../../../../design/void/native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStores, useStateFromStoresObject } from "../../../../../_bundle/Module589";
import { navigateToChannelDetails } from "./ChannelHeader";
import { computeChannelName } from "../../../../channel/useChannelName";
import { intl, t } from "../../../../../intl/index.native";
import ActivityStatus from "../../../../activity_status/native/ActivityStatus";
import { useShouldChannelShowLoadingIndicator, ChannelHeaderLoadingIndicator } from "../../../../chat/native/ChatLoadingIndicator";
import { humanizeStatus } from "../../../../../utils/UserUtils";
import { renderMemberCountText, renderUserAvatar, renderGroupDMIcon, renderEmptyIcon, renderChannelTitle, renderTitleWrapper } from "./ChannelHeaderShared";
import { HermesBuiltin } from "../../../../../_hermes/prelude";
let c6756_13, useStyles;
const GroupDmMemberCount = function GroupDmMemberCount({ channel }) {
return renderMemberCountText(useStateFromStores([UserStore, PresenceStore], () => {
const recipients = channel.recipients;
const r6 = [,];
const r1 = HermesBuiltin.arraySpread(r6, recipients, 0);
let r14 = UserStore.getCurrentUser()?.id;
if (r14 == null) {
r14 = "0";
}
r6[r1] = r14;
return r6.reduce((acc, item) => {
const status = PresenceStore.getStatus(item);
return acc + (status !== StatusTypes.INVISIBLE ? status !== StatusTypes.OFFLINE ? status !== StatusTypes.UNKNOWN ? 1 : 0 : 0 : 0);
}, 0);
}), channel.recipients.length);
};
c6756_13 = AVATAR_SIZE_MAP[AvatarSizes.REFRESH_MEDIUM_32];
useStyles = createStyles({
activityStatusText: {
color: Module712.colors.TEXT_MUTED
}
});
const r53 = memo(function PrivateChannelHeader(props) {
let stateFromStores2;
const { channelId, screenIndex, pressable } = props;
stateFromStores2 = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
stateFromStores2 = useStateFromStores([UserStore], () => stateFromStores?.type === ChannelTypes.DM ? UserStore.getUser(stateFromStores.getRecipientId()) : void 0);
const stateFromStoresObject = useStateFromStoresObject([PresenceStore], () => ({
isMobileOnline: stateFromStores2 != null && PresenceStore.isMobileOnline(stateFromStores2.id),
isVROnline: stateFromStores2 != null && PresenceStore.isVROnline(stateFromStores2.id),
status: stateFromStores2 != null ? PresenceStore.getStatus(stateFromStores2.id) : StatusTypes.UNKNOWN
}));
const { isMobileOnline, isVROnline, status } = stateFromStoresObject;
const callback = useCallback(() => {
navigateToChannelDetails(channelId, screenIndex, "private-channel-header-title");
}, [channelId, screenIndex]);
const channelName = stateFromStores != null ? computeChannelName(stateFromStores, UserStore, RelationshipStore) : intl.string(t.ai6Lbr);
let subtitle = stateFromStores2 != null ? <ActivityStatus userId={stateFromStores2.id} guildId={stateFromStores?.guild_id} textStyle={styles.activityStatusText} /> : null;
const shouldChannelShowLoadingIndicator = useShouldChannelShowLoadingIndicator(channelId);
const r76 = stateFromStores != null && stateFromStores.isMultiUserDM();
if (shouldChannelShowLoadingIndicator) {
subtitle = <ChannelHeaderLoadingIndicator />;
} else if (r76) {
subtitle = <GroupDmMemberCount channel={stateFromStores} />;
}
const accessibleTitle = intl.formatToPlainString(t.UbNmGc, {
channelName
});
const r96 = stateFromStores2 == null ? null : stateFromStores2.isSystemUser() ? null : humanizeStatus(status, {
isMobile: isMobileOnline,
isVR: isVROnline
});
const r111 = intl.string(t.x87QCk);
const r117 = r96 != null ? `${accessibleTitle}, ${r96}, ${r111}` : `${accessibleTitle}, ${r111}`;
const r152 = <>
{stateFromStores2 != null ? renderUserAvatar(stateFromStores2, status, isMobileOnline, isVROnline) : (stateFromStores == null ? void 0 : stateFromStores.isGroupDM()) ? renderGroupDMIcon(stateFromStores) : renderEmptyIcon()}
{renderChannelTitle(channelName, {
accessibleTitle,
subtitle,
disableArrow: !pressable,
userId: stateFromStores2?.id,
guildId: stateFromStores?.guild_id
})}
</>;
if (pressable) {
return <>
{renderTitleWrapper(r152, callback, r117, subtitle != null ? 44 : c6756_13)}
</>;
}
return r152;
});
export default r53;
@@ -0,0 +1,127 @@
// Metro module 10425 (f10426).
import { useMemo } from "react";
import GatewayConnectionStore from "../../../gateway/GatewayConnectionStore";
import LurkingStore from "../../../lurker_mode/LurkingStore";
import ChannelStore from "../../../../stores/ChannelStore";
import MediaEngineStore from "../../../../stores/MediaEngineStore";
import RTCConnectionStore from "../../../../stores/RTCConnectionStore";
import { InputModes } from "../../../../Constants";
import { StaticChannelRoute } from "../../../channel/ChannelConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useCreateThreadViewProps from "../../../threads/native/useCreateThreadViewProps";
import useChannelRoleSubscriptionStatus from "../../../guild_role_subscriptions/useChannelRoleSubscriptionStatus";
import useKeyboardType from "../../../keyboard/native/useKeyboardType";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
import { KeyboardTypes } from "../../../keyboard/native/KeyboardTypes";
import { isAndroid } from "../../../../utils/PlatformUtils";
import { resolveRefreshToken, useMobileVisualRefreshConfig } from "../../../themes/experiments/MobileVisualRefreshExperiment";
import { useToken } from "../../../../design/tokens/native/useToken";
import { useGradientBottom } from "../../../client_themes/native/ClientThemesOverrides";
let c6979_11 = {
LURKER: "lurker",
VOICE: "voice",
CHAT: "chat",
DIRECTORY: "directory",
EXPRESSION_PICKER: "expression",
MEDIA: "media",
APPS: "apps",
NONE: "none"
};
const useStyles = createStyles((a0) => ({
lurker: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER
},
chat: {
backgroundColor: a0
},
voice: {
backgroundColor: a0
},
expressionPickerBackground: {
backgroundColor: Module712.colors.MOBILE_KEYBOARD_GAP_BACKGROUND
}
}));
export default function useChannelSafeAreaBottomStyles(a0) {
const styles = useStyles(useToken(resolveRefreshToken(Module712.modules.mobile.CHANNEL_SAFE_AREA_BOTTOM_BACKGROUND, useMobileVisualRefreshConfig({
location: "useChannelSafeAreaBottomStyles"
}).chatInputFloating)));
const gradientBottom = useGradientBottom();
let c17949_1 = useCreateThreadViewProps(a0) != null;
const needSubscriptionToAccess = useChannelRoleSubscriptionStatus(a0).needSubscriptionToAccess;
let c17949_3 = useKeyboardType();
const stateFromStores = useStateFromStores([GatewayConnectionStore, ChannelStore, LurkingStore, MediaEngineStore, RTCConnectionStore], () => {
let r24, VOICE;
const channel = ChannelStore.getChannel(a0);
const r11 = channel == null ? void 0 : channel.getGuildId();
L47: {
if (a0 !== StaticChannelRoute.GUILD_HOME && (a0 !== StaticChannelRoute.ROLE_SUBSCRIPTIONS && !needSubscriptionToAccess)) {
if (GatewayConnectionStore.isConnected()) {
L44: {
if (MediaEngineStore.getMode() === InputModes.PUSH_TO_TALK && RTCConnectionStore.getChannelId() != null) {
VOICE = c6979_11.VOICE;
} else if (c17949_3 === KeyboardTypes.EXPRESSION && isAndroid()) {
VOICE = c6979_11.EXPRESSION_PICKER;
} else if (c17949_3 === KeyboardTypes.MEDIA && isAndroid()) {
VOICE = c6979_11.MEDIA;
} else if (c17949_3 === KeyboardTypes.APP_LAUNCHER && isAndroid()) {
VOICE = c6979_11.APPS;
} else if ((channel == null ? void 0 : channel.isDirectory()) === true) {
VOICE = c6979_11.DIRECTORY;
} else {
if (r11 != null && LurkingStore.isLurking(r11)) {
VOICE = c6979_11.LURKER;
break L44;
}
if ((channel == null ? void 0 : channel.isForumLikeChannel()) === true && !c17949_1) {
VOICE = c6979_11.CHAT;
break L44;
}
VOICE = a0 != null ? c6979_11.CHAT : c6979_11.NONE;
}
}
r24 = VOICE;
break L47;
}
if (a0 == null) {
r24 = c6979_11.NONE;
break L47;
}
r24 = c6979_11.CHAT;
} else {
r24 = c6979_11.NONE;
}
}
return r24;
});
return useMemo(() => {
let r14;
if (stateFromStores !== c6979_11.NONE && stateFromStores !== c6979_11.DIRECTORY) {
L14: {
if (stateFromStores !== c6979_11.EXPRESSION_PICKER && (stateFromStores !== c6979_11.MEDIA && stateFromStores !== c6979_11.APPS)) {
if (stateFromStores === c6979_11.CHAT) {
r14 = {
...styles.chat,
...gradientBottom
};
break L14;
}
if (stateFromStores === c6979_11.VOICE) {
r14 = {
...styles.voice,
...gradientBottom
};
break L14;
}
r14 = {
...styles[stateFromStores],
...gradientBottom
};
} else {
r14 = styles.expressionPickerBackground;
}
}
return r14;
}
}, [styles, gradientBottom, stateFromStores]);
};
@@ -0,0 +1,59 @@
// Metro module 10421 (f10422).
import useSafeAreaInsetsSharedValue_native from "../../../safe_area/useSafeAreaInsetsSharedValue.native";
import useSafeAreaBottomKeyboardInfoController from "./useSafeAreaBottomKeyboardInfoController";
import { useKeyboardTypeSharedValue, useKeyboardWillOpenSharedValue } from "../../../keyboard/native/useKeyboardType";
import useCustomKeyboardHeight from "../../../keyboard/native/useCustomKeyboardHeight";
import { useToken } from "../../../../design/tokens/native/useToken";
import Module712 from "../../../../_bundle/Module712";
import { useMobileVisualRefreshConfig } from "../../../themes/experiments/MobileVisualRefreshExperiment";
import { useDerivedValue } from "../../../reanimated/ReanimatedRexport";
import * as _KeyboardTypes from "../../../keyboard/native/KeyboardTypes";
const __initData = {
code: "function useChannelSafeAreaHeightSharedValueAndroidTsx1(){const{chatInputFloating,chatInputSpaceBottom,keyboardOpenOrOpening,keyboardWillOpenSharedValue,keyboardOpenedHeight,insets,keyboardTypeSharedValue,KeyboardTypes,customKeyboardHeight}=this.__closure;function resolveBottom(bottom){return chatInputFloating?Math.max(bottom,chatInputSpaceBottom):bottom;}if(keyboardOpenOrOpening.get()||keyboardWillOpenSharedValue.get()){const systemKeyboardHeight=keyboardOpenedHeight.get();if(systemKeyboardHeight<=0){return resolveBottom(insets.get().bottom);}return systemKeyboardHeight;}if(keyboardTypeSharedValue.get()===KeyboardTypes.SYSTEM){return resolveBottom(insets.get().bottom);}return customKeyboardHeight;}"
};
export default function useChannelSafeAreaHeightSharedValue() {
const safeAreaInsetsSharedValue_native = useSafeAreaInsetsSharedValue_native();
let c17943_0 = safeAreaInsetsSharedValue_native;
const safeAreaBottomKeyboardInfoController = useSafeAreaBottomKeyboardInfoController();
const { keyboardOpenOrOpening, keyboardOpenedHeight } = safeAreaBottomKeyboardInfoController;
const keyboardTypeSharedValue = useKeyboardTypeSharedValue();
const keyboardWillOpenSharedValue = useKeyboardWillOpenSharedValue();
const customKeyboardHeight = useCustomKeyboardHeight();
let c17943_5 = customKeyboardHeight;
const token = useToken(Module712.modules.mobile.CHAT_INPUT_FLOATING_OFFSET_MINIMUM);
const chatInputFloating = useMobileVisualRefreshConfig({
location: "ChatInput"
}).chatInputFloating;
const r44 = function() {
let r22;
if (!keyboardOpenOrOpening.get() && !keyboardWillOpenSharedValue.get()) {
if (keyboardTypeSharedValue.get() === _KeyboardTypes.KeyboardTypes.SYSTEM) {
const bottom = c17943_0.get().bottom;
r22 = chatInputFloating ? Math.max(bottom, token) : bottom;
} else {
r22 = c17943_5;
}
return r22;
}
let r32 = keyboardOpenedHeight.get();
if (r32 <= 0) {
const bottom2 = c17943_0.get().bottom;
r32 = chatInputFloating ? Math.max(bottom2, token) : bottom2;
}
return r32;
};
r44.__closure = {
chatInputFloating,
chatInputSpaceBottom: token,
keyboardOpenOrOpening,
keyboardWillOpenSharedValue,
keyboardOpenedHeight,
insets: safeAreaInsetsSharedValue_native,
keyboardTypeSharedValue,
KeyboardTypes: _KeyboardTypes.KeyboardTypes,
customKeyboardHeight
};
r44.__workletHash = 12051290156095;
r44.__initData = __initData;
return useDerivedValue(r44);
};
@@ -0,0 +1,169 @@
// Metro module 10424 (f10425).
import { useEffect } from "react";
import * as _MetaQuestUtils_android from "../../../device/MetaQuestUtils.android";
import * as _PlatformUtils from "../../../../utils/PlatformUtils";
import Module1593 from "../../../../_bundle/Module1593";
import { APP_ENTRY_KEYS } from "../../../window/native/AppEntryKey";
import { useAppEntryKey } from "../../../window/native/AppEntryKeyContext";
import { KeyboardController, KeyboardEvents, useKeyboardHandler } from "../../../../_bundle/Module1595";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useSharedValue } from "../../../reanimated/ReanimatedRexport";
import KeyboardStateDebugging from "../../../keyboard/KeyboardStateDebugging";
function $mk84621($env) {
return (a0) => {
let r1 = a0 !== $env[0];
if (r1) {
const r7 = $env.$parent;
r1 = (0, r7[1])(r7[2][3]).getImeInsets(false, a0) > 0;
}
return r1;
};
}
let env6978 = {};
const isMetaQuest = _MetaQuestUtils_android.isMetaQuest();
const c6978_4 = isMetaQuest;
const c6978_5 = {
code: "function useSafeAreaBottomKeyboardInfoControllerTsx1(e){const{runOnJS,KeyboardStateDebugging,IS_SYSTEM_KEYBOARD_EXTERNAL,keyboardOverlapsCurrentAppEntry,keyboardOpenedHeight}=this.__closure;runOnJS(KeyboardStateDebugging.keyboardControllerWorkletEvent)('onStart',e.height);if(IS_SYSTEM_KEYBOARD_EXTERNAL)return;if(e.height>0&&keyboardOverlapsCurrentAppEntry.get()){keyboardOpenedHeight.set(e.height);}}"
};
const c6978_6 = {
code: "function useSafeAreaBottomKeyboardInfoControllerTsx2(e){const{runOnJS,KeyboardStateDebugging,IS_SYSTEM_KEYBOARD_EXTERNAL,keyboardOverlapsCurrentAppEntry,keyboardOpenedHeight}=this.__closure;runOnJS(KeyboardStateDebugging.keyboardControllerWorkletEvent)('onEnd',e.height);if(IS_SYSTEM_KEYBOARD_EXTERNAL)return;if(e.height>0&&keyboardOverlapsCurrentAppEntry.get()){keyboardOpenedHeight.set(e.height);}}"
};
export default function useSafeAreaBottomKeyboardInfoController() {
const appEntryKey = useAppEntryKey();
let r23 = 0;
if (!c6978_4) {
let r28 = KeyboardController.state()?.height;
if (r28 == null) {
r28 = 0;
}
r23 = r28;
}
let r29 = r23 !== 0;
if (r29) {
let env17947;
const r30 = env17947 = {
$parent: env6978
};
env17947[0] = appEntryKey;
const isAndroid = _PlatformUtils.isAndroid();
let r5 = !isAndroid;
if (isAndroid) {
let r40 = Module1593.getImeInsets(false, appEntryKey) > 0;
if (!r40) {
const r46 = APP_ENTRY_KEYS.some($mk84621(r30));
r40 = r46 ? !r46 : null;
}
r5 = r40;
}
r29 = r5 === true;
}
const sharedValue = useSharedValue(r29 ? r23 : 0);
const sharedValue2 = useSharedValue(r29);
const sharedValue3 = useSharedValue(r29);
useEffect(() => {
let c26671_0, c26671_1, c26671_2, c26671_3, c26671_4;
const handleKeyboardShow2 = function handleKeyboardShow(a0) {
if (!(a0 <= 0)) {
let env30219;
const r6 = env30219 = {
$parent: env6978
};
env30219[0] = appEntryKey;
const isAndroid = _PlatformUtils.isAndroid();
let r3 = !isAndroid;
if (isAndroid) {
let r21 = Module1593.getImeInsets(false, appEntryKey) > 0;
if (!r21) {
const r27 = APP_ENTRY_KEYS.some($mk84621(r6));
r21 = r27 ? !r27 : null;
}
r3 = r21;
}
if (r3 != null) {
sharedValue3.set(r3);
}
if (r3 !== false) {
if (r3 === true) {
sharedValue2.set(true);
sharedValue.set(a0);
}
} else {
sharedValue2.set(false);
}
}
};
if (c6978_4) {
return void 0;
}
c26671_0 = false;
c26671_1 = KeyboardEvents.addListener("keyboardWillShow", (a0) => {
KeyboardStateDebugging.keyboardControllerKeyboardWillShow(a0.height);
c26671_0 = true;
handleKeyboardShow2(a0.height);
});
c26671_2 = KeyboardEvents.addListener("keyboardDidShow", (a0) => {
KeyboardStateDebugging.keyboardControllerKeyboardDidShow(a0.height);
c26671_0 = false;
handleKeyboardShow2(a0.height);
});
c26671_3 = KeyboardEvents.addListener("keyboardWillHide", () => {
KeyboardStateDebugging.keyboardControllerKeyboardWillHide();
if (sharedValue3.get() && !c26671_0) {
sharedValue2.set(false);
}
});
c26671_4 = KeyboardEvents.addListener("keyboardDidHide", () => {
KeyboardStateDebugging.keyboardControllerKeyboardDidHide();
if (sharedValue3.get()) {
c26671_0 = false;
sharedValue2.set(false);
}
});
return () => {
c26671_1.remove();
c26671_2.remove();
c26671_3.remove();
c26671_4.remove();
};
}, [appEntryKey, sharedValue2, sharedValue, sharedValue3]);
const onStart = function(a0) {
_ReanimatedRexport.runOnJS(KeyboardStateDebugging.keyboardControllerWorkletEvent)("onStart", a0.height);
if (!c6978_4 && a0.height > 0 && sharedValue3.get()) {
sharedValue.set(a0.height);
}
};
onStart.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
KeyboardStateDebugging,
IS_SYSTEM_KEYBOARD_EXTERNAL: c6978_4,
keyboardOverlapsCurrentAppEntry: sharedValue3,
keyboardOpenedHeight: sharedValue
};
onStart.__workletHash = 11726427166555;
onStart.__initData = c6978_5;
const l = function l(a0) {
_ReanimatedRexport.runOnJS(KeyboardStateDebugging.keyboardControllerWorkletEvent)("onEnd", a0.height);
if (!c6978_4 && a0.height > 0 && sharedValue3.get()) {
sharedValue.set(a0.height);
}
};
l.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
KeyboardStateDebugging,
IS_SYSTEM_KEYBOARD_EXTERNAL: c6978_4,
keyboardOverlapsCurrentAppEntry: sharedValue3,
keyboardOpenedHeight: sharedValue
};
l.__workletHash = 15110866363831;
l.__initData = c6978_6;
useKeyboardHandler({
onStart,
onEnd: l
}, []);
return {
keyboardOpenOrOpening: sharedValue2,
keyboardOpenedHeight: sharedValue,
keyboardOverlapsCurrentAppEntry: sharedValue3
};
};
export { isMetaQuest as IS_SYSTEM_KEYBOARD_EXTERNAL };