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,21 @@
// Metro module 11312 (f11313).
const r9 = {
POPULAR: 0,
0: "POPULAR",
ALPHABETICAL: 1,
1: "ALPHABETICAL"
};
export { r9 as CommandListSortOrder };
export const APP_LAUNCHER_ELEMENT_CLASSNAME = "app-launcher-element";
export const APP_LAUNCHER_WEB_MODAL_KEY = "app-launcher-modal";
export const APP_LAUNCHER_ENTRYPOINT_CLASSNAME = "app-launcher-entrypoint";
export const APP_LAUNCHER_APP_DM_ENTRYPOINT_CLASSNAME = "app-launcher-app-dm-entrypoint";
export const APP_LAUNCHER_APP_DETAILS_MORE_MENU_CLASSNAME = "app-launcher-app-details-more-menu";
export const APP_LAUNCHER_PROFILE_FRIEND_ACTIVITY_ENTRY = "app-launcher-profile-friend-activity-entry";
export const APP_LAUNCHER_WIDTH = 500;
export const APP_LAUNCHER_MAX_HEIGHT = 680;
export const APP_LAUNCHER_HEIGHT = "min(100vh, 680px)";
export const APP_LAUNCHER_SIZE_CSS_VARS = {
"--custom-app-launcher-width": "500px",
"--custom-app-launcher-height": "min(100vh, 680px)"
};
@@ -0,0 +1,46 @@
// Metro module 11293 (f11294).
import Durations from "../../utils/Durations";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c7662_0 = 10 * Durations.Millis.MINUTE;
let c7662_1 = {
lastUsedCommandId: null,
lastUsedTimeMs: null
};
class AppLauncherLastUsedCommandStore extends Module589.PersistedStore {
static displayName = "AppLauncherLastUsedCommandStore";
static persistKey = "AppLauncherLastUsedCommandStore";
initialize(a0) {
if (a0 != null) {
c7662_1.lastUsedCommandId = a0.lastUsedCommandId;
c7662_1.lastUsedTimeMs = a0.lastUsedTimeMs;
}
}
getState() {
return c7662_1;
}
getLastUsedCommandId() {
const r5 = Date.now();
const r1 = c7662_1.lastUsedTimeMs == null;
let r10 = null;
if (!r1) {
const r11 = c7662_1.lastUsedCommandId == null;
r10 = null;
if (!r11) {
if (r5 > c7662_1.lastUsedTimeMs + c7662_0) {
c7662_1.lastUsedCommandId = null;
c7662_1.lastUsedTimeMs = null;
}
r10 = c7662_1.lastUsedCommandId;
}
}
return r10;
}
}
const appLauncherLastUsedCommandStore = new AppLauncherLastUsedCommandStore(Dispatcher, {
APPLICATION_COMMAND_USED: function handleApplicationCommandUsed(a0) {
c7662_1.lastUsedCommandId = a0.command.id;
c7662_1.lastUsedTimeMs = Date.now();
}
});
export default appLauncherLastUsedCommandStore;
+97
View File
@@ -0,0 +1,97 @@
// Metro module 8016 (f8017).
import { AppLauncherCloseReason, AppLauncherEntrypoint } from "./AppLauncherTypes";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c5075_2;
const handleDismissWithDismissed = function handleDismissWithDismissed() {
let DISMISSED = AppLauncherCloseReason.DISMISSED;
if (DISMISSED === void 0) {
DISMISSED = AppLauncherCloseReason.DISMISSED;
}
c5075_2.show = false;
c5075_2.entrypoint = AppLauncherEntrypoint.NONE;
c5075_2.closeReason = DISMISSED;
c5075_2.initialState = void 0;
c5075_2.activeChannelId = null;
};
const handleSetActiveCommand = function handleSetActiveCommand() {
let COMMAND = AppLauncherCloseReason.COMMAND;
if (COMMAND === void 0) {
COMMAND = AppLauncherCloseReason.DISMISSED;
}
c5075_2.show = false;
c5075_2.entrypoint = AppLauncherEntrypoint.NONE;
c5075_2.closeReason = COMMAND;
c5075_2.initialState = void 0;
c5075_2.activeChannelId = null;
};
c5075_2 = {
show: false,
entrypoint: AppLauncherEntrypoint.NONE,
lastShownEntrypoint: AppLauncherEntrypoint.NONE,
activeViewType: null,
activeChannelId: null,
closeReason: AppLauncherCloseReason.DISMISSED,
initialState: void 0
};
class AppLauncherStore extends Module589.Store {
static displayName = "AppLauncherStore";
initialize() {}
shouldShowPopup() {
return c5075_2.show && c5075_2.entrypoint === AppLauncherEntrypoint.TEXT;
}
shouldShowModal() {
return c5075_2.show && c5075_2.entrypoint === AppLauncherEntrypoint.VOICE;
}
entrypoint() {
return c5075_2.entrypoint;
}
lastShownEntrypoint() {
return c5075_2.lastShownEntrypoint;
}
activeViewType() {
return c5075_2.activeViewType;
}
activeChannelId() {
let activeChannelId2 = c5075_2.activeChannelId;
if (activeChannelId2 == null) {
activeChannelId2 = null;
}
return activeChannelId2;
}
closeReason() {
return c5075_2.closeReason;
}
initialState() {
return c5075_2.initialState;
}
}
const appLauncherStore = new AppLauncherStore(Dispatcher, {
APP_LAUNCHER_SHOW: function handleShow({ entrypoint: entrypoint2, activeViewType: activeViewType2, initialState: initialState2, activeChannelId: activeChannelId2 }) {
c5075_2.show = true;
c5075_2.entrypoint = entrypoint2;
c5075_2.lastShownEntrypoint = entrypoint2;
c5075_2.closeReason = AppLauncherCloseReason.DISMISSED;
c5075_2.activeViewType = activeViewType2;
c5075_2.activeChannelId = activeChannelId2;
c5075_2.initialState = initialState2;
return true;
},
APP_LAUNCHER_DISMISS: function handleDismiss({ closeReason: closeReason2 }) {
if (closeReason2 === void 0) {
closeReason2 = AppLauncherCloseReason.DISMISSED;
}
c5075_2.show = false;
c5075_2.entrypoint = AppLauncherEntrypoint.NONE;
c5075_2.closeReason = closeReason2;
c5075_2.initialState = void 0;
c5075_2.activeChannelId = null;
return true;
},
CONNECTION_OPEN: handleDismissWithDismissed,
LOGOUT: handleDismissWithDismissed,
CHANNEL_SELECT: handleDismissWithDismissed,
APPLICATION_COMMAND_SET_ACTIVE_COMMAND: handleSetActiveCommand,
APP_LAUNCHER_SET_ACTIVE_COMMAND: handleSetActiveCommand
});
export default appLauncherStore;
+43
View File
@@ -0,0 +1,43 @@
// Metro module 8017 (f8018).
const r12 = {
NONE: "NONE",
TEXT: "TEXT",
VOICE: "VOICE"
};
const r16 = {
HOME_EMPTY: "home_empty",
SEARCH_EMPTY: "search_empty",
HOME_NO_PERMISSIONS: "home_no_permissions",
COMMAND_NO_PERMISSIONS: "command_no_permissions",
COMMAND_NOT_FOUND: "command_not_found"
};
const r22 = {
DISMISSED: 0,
0: "DISMISSED",
COMMAND: 1,
1: "COMMAND",
ACTIVITY: 2,
2: "ACTIVITY"
};
const r28 = {
OPEN_APP_DM: "open_app_dm",
USE_APP_COMMAND: "use_app_command"
};
export { r12 as AppLauncherEntrypoint };
export const AppLauncherSectionName = {
SEARCH: "search",
RECENT: "recent",
INSTALLED: "installed",
ACTIVITIES: "activities",
RECENT_APPS: "recent_apps",
RECENT_COMMANDS: "recent_commands",
NEW_TO_APPS: "new_to_apps",
APPS_IN_THIS_SERVER: "apps_in_this_server"
};
export const AppLauncherLocations = {
HOME: "home",
APP_DETAIL: "app_detail"
};
export { r16 as AppLauncherEmptyStateType };
export { r22 as AppLauncherCloseReason };
export { r28 as EntryPointCommandButtonActions };
@@ -0,0 +1,114 @@
// Metro module 11292 (f11293).
import { useEffect, useMemo } from "react";
import AuthorizedAppsStore, { FetchState } from "../../oauth2/AuthorizedAppsStore";
import UserStore from "../../../stores/UserStore";
import AppLauncherLastUsedCommandStore from "../AppLauncherLastUsedCommandStore";
import { WATCH_YOUTUBE_PROD_APP_ID } from "../../activities/Constants";
import { BuiltInSectionId, DISCOVERY_COMMANDS_QUERY_LIMIT } from "../../application_commands/ApplicationCommandConstants";
import { ApplicationCommandType } from "../../../flow/Server";
import { useDiscovery } from "../../application_commands/ApplicationCommandQueryApi";
import { useStateFromStores, useStateFromStoresArray } from "../../../_bundle/Module589";
import AuthorizedAppsActionCreators from "../../oauth2/AuthorizedAppsActionCreators";
import { OAuth2Scopes } from "../../../_bundle/Module8174";
import { useSortApplicationsViaFrecency } from "../../applications/ApplicationFrecencyHooks";
import isApplicationAgeRestricted from "../../applications/utils/isApplicationAgeRestricted";
import { isEmbeddedApp } from "../utils/AppLauncherUtils";
import { queryForPrimaryAppCommand } from "../../application_commands/getPrimaryAppCommand";
let filters, options;
const useFrecentApps = function useFrecentApps({ sectionDescriptors, context, onlyActivityApps, includeAuthorizedAppsAndFetch }) {
let c18717_4, memo, sortApplicationsViaFrecency, stateFromStores2;
c18717_4 = void 0;
memo = void 0;
sortApplicationsViaFrecency = void 0;
stateFromStores2 = void 0;
const stateFromStores = useStateFromStores([AuthorizedAppsStore], () => AuthorizedAppsStore.getFetchState());
useEffect(() => {
let r1 = includeAuthorizedAppsAndFetch;
if (includeAuthorizedAppsAndFetch) {
r1 = stateFromStores === FetchState.NOT_FETCHED;
}
if (r1) {
AuthorizedAppsActionCreators.fetch();
}
}, [includeAuthorizedAppsAndFetch, stateFromStores]);
const stateFromStoresArray = useStateFromStoresArray([AuthorizedAppsStore], () => includeAuthorizedAppsAndFetch ? AuthorizedAppsStore.getNewestTokens().filter((item) => item.scopes.includes(OAuth2Scopes.APPLICATIONS_COMMANDS)) : []);
const r31 = sectionDescriptors.filter((sectionDescriptor) => sectionDescriptor.id !== BuiltInSectionId.FRECENCY && sectionDescriptor.id !== BuiltInSectionId.BUILT_IN);
const r1 = context.type === "contextless";
c18717_4 = r1;
memo = useMemo(() => {
const r1 = [];
if (c18717_4) {
r1.push(WATCH_YOUTUBE_PROD_APP_ID);
}
return r1;
}, [r1]);
sortApplicationsViaFrecency = useSortApplicationsViaFrecency(r31, stateFromStoresArray);
stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser()?.nsfwAllowed);
return useMemo(() => {
const hideAgeRestricted = function hideAgeRestricted(a0) {
return !(stateFromStores2 === false && isApplicationAgeRestricted(a0.id));
};
return onlyActivityApps ? sortApplicationsViaFrecency.filter((item) => item.application != null && isEmbeddedApp(item.application) && queryForPrimaryAppCommand(context, item.id) != null).filter((item) => !memo.includes(item.id)).filter(hideAgeRestricted) : sortApplicationsViaFrecency.filter((item) => !memo.includes(item.id)).filter(hideAgeRestricted);
}, [onlyActivityApps, sortApplicationsViaFrecency, context, memo, stateFromStores2]);
};
filters = {
commandTypes: [ApplicationCommandType.CHAT, ApplicationCommandType.PRIMARY_ENTRY_POINT]
};
options = {
placeholderCount: 0,
limit: DISCOVERY_COMMANDS_QUERY_LIMIT,
includeFrecency: true
};
export default function useAppLauncherFrecentCommandsAndApps({ context: context2, onlyActivityApps: onlyActivityApps2 }) {
let stateFromStores3;
stateFromStores3 = void 0;
const discovery = useDiscovery({
context: context2,
filters,
options,
allowFetch: true
});
const { commands, commandsByActiveSection, sectionDescriptors, filterSection, loading } = discovery;
useEffect(() => {
filterSection(BuiltInSectionId.FRECENCY);
}, [filterSection]);
stateFromStores3 = useStateFromStores([AppLauncherLastUsedCommandStore], () => AppLauncherLastUsedCommandStore.getLastUsedCommandId());
return {
loading,
frecencyCommands: useMemo(() => {
if (onlyActivityApps2) {
return [];
}
let r7 = commandsByActiveSection[0]?.data;
if (r7 == null) {
r7 = [];
}
const r14 = commands.find((command) => command.id === stateFromStores3);
return r14 != null ? [r14, ...r7.filter((item) => item.id !== stateFromStores3)] : r7;
}, [commands, commandsByActiveSection, stateFromStores3, onlyActivityApps2]),
frecentApps: useFrecentApps({
sectionDescriptors,
context: context2,
onlyActivityApps: onlyActivityApps2,
includeAuthorizedAppsAndFetch: true
}),
sectionDescriptors
};
};
export function useAppLauncherFrecentApps({ context: context2, onlyActivityApps: onlyActivityApps3, allowCommandFetch, includeAuthorizedAppsAndFetch: includeAuthorizedAppsAndFetch2 }) {
const discovery = useDiscovery({
context: context2,
filters,
options,
allowFetch: allowCommandFetch
});
return {
loading: discovery.loading,
frecentApps: useFrecentApps({
sectionDescriptors: discovery.sectionDescriptors,
context: context2,
onlyActivityApps: onlyActivityApps3,
includeAuthorizedAppsAndFetch: includeAuthorizedAppsAndFetch2
})
};
}
@@ -0,0 +1,55 @@
// Metro module 11296 (f11297).
import { useMemo } from "react";
import { useGuildIndexState } from "../../application_commands/ApplicationCommandIndexStore";
import UserStore from "../../../stores/UserStore";
import { DISCOVERY_COMMANDS_QUERY_LIMIT } from "../../application_commands/ApplicationCommandConstants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useDiscovery } from "../../application_commands/ApplicationCommandQueryApi";
import { ApplicationCommandType } from "../../../flow/Server";
import { BUILT_IN_SECTIONS } from "../../application_commands/ApplicationCommandBuiltIns";
import { useSortApplicationsViaFrecency } from "../../applications/ApplicationFrecencyHooks";
import Module12 from "../../../_bundle/Module12";
import isApplicationAgeRestricted from "../../applications/utils/isApplicationAgeRestricted";
export default function useAppsInThisServer({ context }) {
let commandsByActiveSection, memo, sortApplicationsViaFrecency;
commandsByActiveSection = void 0;
memo = void 0;
sortApplicationsViaFrecency = void 0;
const guildIndexState = useGuildIndexState((context.type === "channel" ? context.channel : void 0)?.guild_id, true);
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser()?.nsfwAllowed);
const discovery = useDiscovery({
context,
filters: {
commandTypes: [ApplicationCommandType.CHAT, ApplicationCommandType.PRIMARY_ENTRY_POINT]
},
options: {
placeholderCount: 0,
limit: DISCOVERY_COMMANDS_QUERY_LIMIT,
includeFrecency: true
},
allowFetch: true
});
commandsByActiveSection = discovery.commandsByActiveSection;
const loading = discovery.loading;
memo = useMemo(() => commandsByActiveSection.reduce((acc, item) => {
const section = item.section;
if (item.data.length > 0) {
acc.add(section.id);
}
return acc;
}, new Set()), [commandsByActiveSection]);
sortApplicationsViaFrecency = useSortApplicationsViaFrecency(useMemo(() => {
const r6 = Object;
let r9 = guildIndexState.result?.sections;
if (r9 == null) {
r9 = {};
}
return r6.values(r9).map((item) => item.descriptor).filter((item) => !(item.id in BUILT_IN_SECTIONS) && memo.has(item.id));
}, [guildIndexState.result?.sections, memo]));
return {
appsInThisServer: useMemo(() => Module12.compact(sortApplicationsViaFrecency.map((item) => item.application)).filter((item) => !(stateFromStores === false && isApplicationAgeRestricted(item.id))).map((item) => ({
application: item
})), [stateFromStores, sortApplicationsViaFrecency]),
isLoading: guildIndexState.fetchState.fetching || loading
};
};
@@ -0,0 +1,5 @@
// Metro module 11262 (f11263).
import { DeveloperMode } from "../../user_settings/UserSettings";
export function useClickOnHomeActivityOpensAppDetails() {
return DeveloperMode.useSetting();
}
@@ -0,0 +1,21 @@
// Metro module 11206 (f11207).
import { useMemo } from "react";
import GuildStore from "../../../stores/GuildStore";
export function getCommandContext(a0) {
return a0.type === "contextless" ? {
channel: void 0,
guild: void 0
} : {
channel: a0.channel,
guild: GuildStore.getGuild(a0.channel.guild_id)
};
}
export function useCommandContext(a0) {
return useMemo(() => a0.type === "contextless" ? {
channel: void 0,
guild: void 0
} : {
channel: a0.channel,
guild: GuildStore.getGuild(a0.channel.guild_id)
}, [a0]);
}
@@ -0,0 +1,14 @@
// Metro module 11319 (f11320).
import { useState, useLayoutEffect } from "react";
import { ActivityAction } from "../../activities/utils/useActivityShelfItem";
export function useDelayedSwapToActivityActionLeave(a0) {
const [state, setState] = useState(a0);
useLayoutEffect(() => {
if (a0 === ActivityAction.LEAVE) {
let c27018_0 = setTimeout(() => setState(a0), 100);
return () => clearTimeout(c27018_0);
}
setState(a0);
}, [a0]);
return state;
}
@@ -0,0 +1,18 @@
// Metro module 11325 (f11326).
import { useMemo } from "react";
import ApplicationCommandFrecencyStore from "../../application_commands/ApplicationCommandFrecencyStore";
import { useCommandContext } from "./useCommandContext";
import { useTopCommands } from "../../application_commands/ApplicationCommandFrecencyHooks";
export default function useFilterAndSortToOnlyFrecentCommands({ context, commands, limit = commands.length }) {
const length = limit;
const commandContext = useCommandContext(context);
const topCommands = useTopCommands(commandContext);
const memo = useMemo(() => commands.reduce((acc, command) => {
acc[command.id] = command;
return acc;
}, {}), [commands]);
return useMemo(() => topCommands.map((topCommand) => memo[topCommand]).filter((item) => item != null).sort((a, b) => {
const scoreWithoutLoadingLatest = ApplicationCommandFrecencyStore.getScoreWithoutLoadingLatest(commandContext, a);
return ApplicationCommandFrecencyStore.getScoreWithoutLoadingLatest(commandContext, b) - scoreWithoutLoadingLatest;
}).slice(0, length), [topCommands, memo, commandContext, length]);
};
@@ -0,0 +1,46 @@
// Metro module 11320 (f11321).
import ApplicationRecord from "../../../records/ApplicationRecord";
import PermissionStore from "../../../stores/PermissionStore";
import { Permissions } from "../../../_bundle/Module505";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useEmbeddedActivityLaunchability, EmbeddedActivityLaunchability } from "../../activities/utils/getEmbeddedActivityLaunchability";
import { ActivityAction } from "../../activities/utils/useActivityShelfItem";
import { isActivitiesInTextEnabled } from "../../activities/ActivitiesInTextUtils";
import getPlatform from "../../activities/utils/getPlatform";
import { getOS } from "../../../utils/PlatformUtils";
import { intl, t } from "../../../intl/index.native";
export default function useIsPrimaryEntryPointDisabled({ context, application, activityAction }) {
let disabled, reason;
const channel = context.type === "channel" ? context.channel : void 0;
const stateFromStores = useStateFromStores([PermissionStore], () => PermissionStore.can(Permissions.USE_EMBEDDED_ACTIVITIES, channel));
const embeddedActivityLaunchability = useEmbeddedActivityLaunchability(channel?.id);
const r0 = ActivityAction.LEAVE !== activityAction ? ActivityAction.START === activityAction ? channel == null ? false : (channel == null ? void 0 : channel.isGuildVoice()) ? embeddedActivityLaunchability !== EmbeddedActivityLaunchability.CAN_LAUNCH ? true : false : isActivitiesInTextEnabled(channel) ? false : true : ActivityAction.JOIN === activityAction ? (channel == null ? void 0 : channel.isGuildVoice()) ? !stateFromStores : isActivitiesInTextEnabled(channel) ? false : true : false : false;
L32: {
const LEAVE = ActivityAction.LEAVE;
disabled = r0;
reason = void 0;
if (activityAction !== LEAVE) {
const r67 = application instanceof ApplicationRecord ? application.embeddedActivityConfig : application.embedded_activity_config;
const platform2 = getPlatform(getOS());
if (r67 != null && !r67.supported_platforms.includes(platform2)) {
reason = intl.string(t.z2YTgJ);
disabled = false;
break L32;
}
const r87 = channel == null ? void 0 : channel.isThread();
disabled = r0;
reason = void 0;
if (r87) {
reason = intl.string(t.ddSR3v);
disabled = true;
}
}
}
if (disabled && reason == null) {
reason = intl.string(t.f41E1g);
}
return {
disabled,
reason
};
};
@@ -0,0 +1,85 @@
// Metro module 11311 (f11312).
import { useState, useMemo, useEffect, useLayoutEffect } from "react";
import { CommandListSortOrder } from "../AppLauncherConstants";
import { getApplication } from "../../global_discovery_apps/ApplicationDirectoryActionCreators";
import Durations from "../../../utils/Durations";
export default function useSortedSectionCommands({ sectionId, commandsByActiveSection }) {
let canSort;
canSort = void 0;
const [sortOrder, setState] = useState(CommandListSortOrder.ALPHABETICAL);
const memo = useMemo(() => {
let r7 = commandsByActiveSection.find((item) => item.section.id === sectionId)?.data;
if (r7 == null) {
r7 = [];
}
return r7;
}, [commandsByActiveSection, sectionId]);
const memo2 = useMemo(() => {
let r11;
if (memo.length <= 1) {
return {
popularSortedCommands: memo,
canSort: false
};
}
let c30390_0 = false;
const r7 = memo.map((item, index) => {
c30390_0 = c30390_0 || item.global_popularity_rank != null;
return {
command: item,
alphabeticalSortIndex: index
};
});
if (c30390_0) {
r7.sort((a, b) => {
const global_popularity_rank = a.command.global_popularity_rank;
const global_popularity_rank2 = b.command.global_popularity_rank;
if (global_popularity_rank != null && global_popularity_rank2 != null) {
if (global_popularity_rank !== global_popularity_rank2) {
return global_popularity_rank - global_popularity_rank2;
}
} else {
if (global_popularity_rank != null) {
return -1;
}
if (global_popularity_rank2 != null) {
return 1;
}
}
return a.alphabeticalSortIndex - b.alphabeticalSortIndex;
});
r11 = {
popularSortedCommands: r7.map((item) => item.command),
canSort: true
};
} else {
r11 = {
popularSortedCommands: memo,
canSort: false
};
}
return r11;
}, [memo]);
let popularSortedCommands = memo2.popularSortedCommands;
canSort = memo2.canSort;
useEffect(() => {
getApplication(sectionId, {
dontRefetchMs: Durations.Millis.DAY
});
}, [sectionId]);
useLayoutEffect(() => {
if (canSort) {
setState(CommandListSortOrder.POPULAR);
}
}, [canSort]);
if (CommandListSortOrder.POPULAR !== sortOrder) {
CommandListSortOrder.ALPHABETICAL;
popularSortedCommands = memo;
}
return {
sortOrder,
setSortOrder: setState,
commands: popularSortedCommands,
canSort
};
};
@@ -0,0 +1,63 @@
// Metro module 15590 (f15591).
import { useRef, useMemo, useState } from "react";
import { AppLauncherRouteName } from "./AppLauncherNativeConstants";
import { useSharedValue } from "../../reanimated/ReanimatedRexport";
import { AppLauncherKeyboardCloseReason } from "./AppLauncherContext";
import { AppLauncherEntrypoint } from "../AppLauncherTypes";
import { useDefaultAppLauncherWidth } from "./hooks/useDefaultAppLauncherWidth";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import AppLauncherNavigator from "./AppLauncherNavigator";
import { getAppDMApplication } from "../../app_dms/getAppDMApplication";
import ActionSheetContext from "../../action_sheet/native/ActionSheetContext";
const AppLauncherActionSheet = function AppLauncherActionSheet(props) {
const { chatInputRef, channel } = props;
const ref = useRef(null);
const sharedValue2 = useSharedValue(-1);
const sharedValue = useSharedValue(0);
const ref3 = useRef(void 0);
const ref2 = useRef(AppLauncherKeyboardCloseReason.DISMISSED);
const TEXT = AppLauncherEntrypoint.TEXT;
const defaultAppLauncherWidth = useDefaultAppLauncherWidth(TEXT);
return <BottomSheet ref={ref} animatedIndex={sharedValue2} scrollable startExpanded>
<AppLauncherNavigator bottomSheetIndex={sharedValue2} bottomSheetPosition={sharedValue} bottomSheetExpandReasonRef={ref3} context={useMemo(() => ({
channel,
type: "channel"
}), [channel])} chatInputRef={useRef({
getApplicationCommandManager: () => {
const current = chatInputRef.current;
return current == null ? void 0 : current.getApplicationCommandManager();
},
closeCustomKeyboard: () => {
const current = ref.current;
if (current != null) {
current.closeActionSheet();
}
},
openCustomKeyboard: () => {
const current = ref.current;
if (current != null) {
current.expandActionSheet();
}
}
})} entrypoint={TEXT} keyboardCloseReasonRef={ref2} width={defaultAppLauncherWidth} overrideParams={{
initialRouteName: AppLauncherRouteName.HOME,
initialSearchQuery: getAppDMApplication(channel)?.name
}} />
</BottomSheet>;
};
export function useAppLauncherActionSheet(a0) {
const [state, setState] = useState(false);
return {
appLauncherActionSheet: useMemo(() => state ? <ActionSheetContext.Provider value={{
transitionState: "visible",
close: () => {},
onLeave: () => {
setState(false);
},
registerDismissHandler: () => {}
}}>
<AppLauncherActionSheet {...a0} />
</ActionSheetContext.Provider> : null, [state, a0]),
setAppLauncherActionSheetEnabled: setState
};
}
@@ -0,0 +1,18 @@
// Metro module 11404 (f11405).
import { View } from "react-native";
import useKeyboardType from "../../keyboard/native/useKeyboardType";
import { KeyboardTypes } from "../../keyboard/native/KeyboardTypes";
import { PlusLargeIcon } from "../../../design/components/Icon/native/redesign/generated/PlusLargeIcon";
import { AppsIcon } from "../../../design/components/Icon/native/redesign/generated/AppsIcon";
export function AppLauncherButtonIcon(props) {
const { style, ...props2 } = props;
return <View style={{
overflow: "hidden"
}}>
{useKeyboardType() === KeyboardTypes.APP_LAUNCHER ? <PlusLargeIcon {...props2} style={[style, {
transform: [{
rotate: "45deg"
}]
}]} /> : <AppsIcon style={style} {...props2} />}
</View>;
}
@@ -0,0 +1,105 @@
// Metro module 10924 (f10925).
import { createContext, useRef, useContext, useMemo } from "react";
import { useSharedValue } from "../../reanimated/ReanimatedRexport";
import { AppLauncherEntrypoint } from "../AppLauncherTypes";
import { useDefaultAppLauncherWidth } from "./hooks/useDefaultAppLauncherWidth";
function $mk85922($env) {
return () => {
if ($env[0]) {
return void 0;
}
throw new Error("use useRequiredAppLauncherContext and provide a ChatInputRef");
};
}
function $mk85923($env) {
return () => {
if ($env[0]) {
return void 0;
}
throw new Error("use useRequiredAppLauncherContext and provide a ChatInputRef");
};
}
function $mk85924($env) {
return () => {
if ($env[0]) {
return void 0;
}
throw new Error("use useRequiredAppLauncherContext and provide a ChatInputRef");
};
}
let c7356_3 = {
DISMISSED: 0,
0: "DISMISSED",
COMMAND: 1,
1: "COMMAND",
ACTIVITY: 2,
2: "ACTIVITY",
BACK: 3,
3: "BACK",
OAUTH_MODAL: 4,
4: "OAUTH_MODAL"
};
const r25 = {
GESTURE: 0,
0: "GESTURE",
KEYBOARD: 1,
1: "KEYBOARD",
APP_VIEW: 2,
2: "APP_VIEW",
COMMAND_VIEW: 3,
3: "COMMAND_VIEW",
OTHER: 4,
4: "OTHER"
};
const context = createContext(void 0);
export { c7356_3 as AppLauncherKeyboardCloseReason };
export { r25 as AppLauncherBottomSheetExpandReason };
export { context as AppLauncherContext };
export function useAppLauncherChatInputRefDummy(a0) {
let env18369;
const r3 = env18369 = {};
env18369[0] = a0.noop;
return useRef({
getApplicationCommandManager: $mk85922(r3),
openCustomKeyboard: $mk85923(r3),
closeCustomKeyboard: $mk85924(r3)
});
}
export function useRequiredAppLauncherContext() {
const context2 = useContext(context);
if (context2 == null) {
throw new Error("AppLauncherContext not found, must be used within AppLauncherNavigator");
}
return context2;
}
export function useAppLauncherContext() {
let env18371;
const ref = useRef(c7356_3.DISMISSED);
const ref2 = useRef(void 0);
const sharedValue = useSharedValue(-1);
const sharedValue2 = useSharedValue(0);
const TEXT = AppLauncherEntrypoint.TEXT;
const defaultAppLauncherWidth = useDefaultAppLauncherWidth(TEXT);
const r31 = env18371 = {};
env18371[0] = false;
const ref3 = useRef({
getApplicationCommandManager: $mk85922(r31),
openCustomKeyboard: $mk85923(r31),
closeCustomKeyboard: $mk85924(r31)
});
const memo = useMemo(() => ({
keyboardCloseReasonRef: ref,
bottomSheetIndex: sharedValue,
bottomSheetPosition: sharedValue2,
bottomSheetExpandReasonRef: ref2,
chatInputRef: ref3,
width: defaultAppLauncherWidth,
entrypoint: TEXT,
onActivityItemSelected: void 0
}), [defaultAppLauncherWidth, TEXT, ref3, sharedValue, sharedValue2]);
let r44 = useContext(context);
if (r44 == null) {
r44 = memo;
}
return r44;
}
@@ -0,0 +1,196 @@
// Metro module 11208 (f11209).
import { memo, useRef, useCallback, useEffect, useLayoutEffect } from "react";
import { View } from "react-native";
import { AnalyticEvents } from "../../../Constants";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import { KEYBOARD_ANIMATION_CONFIG } from "../../keyboard/native/PortalKeyboardConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { useDefaultAppLauncherWidth } from "./hooks/useDefaultAppLauncherWidth";
import { AppLauncherKeyboardCloseReason, AppLauncherBottomSheetExpandReason } from "./AppLauncherContext";
import useKeyboardActionSheetHeight from "../../action_sheet/native/useKeyboardActionSheetHeight";
import { useIsScreenReaderEnabled } from "../../a11y/native/useIsScreenReaderEnabled.native";
import useAppLauncherOnboardingContent from "./onboarding/hooks/useAppLauncherOnboardingContent";
import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport";
import { useSharedValue, useAnimatedReaction } from "../../reanimated/ReanimatedRexport";
import completeAppLauncherOnboarding from "./onboarding/utils/completeAppLauncherOnboarding";
import { TransitionStates } from "../../../design/components/TransitionGroup/TransitionGroup";
import { BottomSheetBackdrop, ANIMATION_SOURCE } from "../../../_bundle/Module5245";
import AppLauncherOnboardingLayer from "./onboarding/banner/AppLauncherOnboardingLayer";
import { isAndroid } from "../../../utils/PlatformUtils";
import { trackWithMetadata } from "../../app_analytics/AppAnalyticsUtils";
import { isMetaQuest } from "../../device/MetaQuestUtils.android";
import { setKeyboardType } from "../../keyboard/native/KeyboardUIStore.native";
import { KeyboardTypes } from "../../keyboard/native/KeyboardTypes";
import { setAccessibilityFocus } from "../../a11y/native/setAccessibilityFocus.android";
import PortalKeyboardBottomSheet from "../../keyboard/native/PortalKeyboardBottomSheet";
import { AppLauncherEntrypoint } from "../AppLauncherTypes";
import AppLauncherNavigator from "./AppLauncherNavigator";
const useStyles = createStyles({
onboardingRoundingView: {
borderTopLeftRadius: Module712.radii.sm,
borderTopRightRadius: Module712.radii.sm
},
onboardingHeader: {
borderWidth: 2,
borderBottomWidth: 0,
borderColor: Module712.colors.BACKGROUND_BRAND,
borderBottomColor: "transparent",
borderTopLeftRadius: Module712.radii.sm,
borderTopRightRadius: Module712.radii.sm
},
onboardingNavigatorContent: {
borderWidth: 2,
borderColor: Module712.colors.BACKGROUND_BRAND,
borderTopLeftRadius: Module712.radii.sm,
borderTopRightRadius: Module712.radii.sm
}
});
const ref = null;
const __initData = {
code: "function AppLauncherKeyboardTsx1(){const{bottomSheetIndex}=this.__closure;return bottomSheetIndex.get();}"
};
const __initData2 = {
code: "function AppLauncherKeyboardTsx2(i,prev){const{runOnJS,handleOnboardingParamChange,showOnboarding}=this.__closure;if(i===prev)return;runOnJS(handleOnboardingParamChange)(i,showOnboarding);}"
};
const r77 = memo(function AppLauncherKeyboard(props) {
let callback;
const { context, chatInputRef, onClose, transitionState, entrypoint } = props;
callback = void 0;
const defaultAppLauncherWidth = useDefaultAppLauncherWidth(entrypoint);
const ref2 = useRef(AppLauncherKeyboardCloseReason.DISMISSED);
const ref3 = useRef(void 0);
const styles = useStyles();
const keyboardActionSheetHeight = useKeyboardActionSheetHeight();
const { maximum, minimum } = keyboardActionSheetHeight;
const ref4 = useRef(Date.now());
const ref5 = useRef(false);
let forceMaxHeight = useIsScreenReaderEnabled();
const isScreenReaderEnabled = forceMaxHeight;
const visibleContent = useAppLauncherOnboardingContent({
channelId: context.channel.id
}).visibleContent;
let showOnboarding = visibleContent != null;
let c18623_11 = showOnboarding;
const sharedValue = useSharedValue(-1);
const sharedValue2 = useSharedValue(0);
const ref6 = useRef(null);
const callback2 = useCallback(() => {
if (ref6 != null) {
const current = ref6.current;
if (current != null) {
current.expandActionSheet();
}
}
}, [ref6]);
callback = useCallback((a0, a1) => {
if (a1 ? a0 === 1 : a1) {
completeAppLauncherOnboarding(ContentDismissActionType.TAKE_ACTION);
}
}, []);
useEffect(() => {
callback(sharedValue.get(), c18623_11);
}, [showOnboarding, sharedValue, callback]);
const O = () => sharedValue.get();
O.__closure = {
bottomSheetIndex: sharedValue
};
O.__workletHash = 15587451723262;
O.__initData = __initData;
const _ = function _(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(callback)(a0, c18623_11);
}
};
_.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
handleOnboardingParamChange: callback,
showOnboarding
};
_.__workletHash = 14003176039781;
_.__initData = __initData2;
useAnimatedReaction(O, _);
useLayoutEffect(() => {
if (transitionState === TransitionStates.YEETED) {
completeAppLauncherOnboarding(ContentDismissActionType.USER_DISMISS);
}
}, [transitionState]);
const callback3 = useCallback((a0) => <>
{[<BottomSheetBackdrop {...a0} pressBehavior="collapse" />, c18623_11 && <AppLauncherOnboardingLayer context={context} visibleContent={visibleContent} bottomOffset={isAndroid() ? 0 : minimum} />]}
</>, [visibleContent, context, minimum, showOnboarding]);
const callback4 = useCallback((a0, a1, a2) => {
if (a0 !== 1 && a1 === 1) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_EXPANDED, {
reason: a2 === ANIMATION_SOURCE.KEYBOARD ? AppLauncherBottomSheetExpandReason.KEYBOARD : a2 === ANIMATION_SOURCE.GESTURE ? AppLauncherBottomSheetExpandReason.GESTURE : a2 !== ANIMATION_SOURCE.USER ? AppLauncherBottomSheetExpandReason.OTHER : ref3.current
});
ref3.current = void 0;
}
}, [ref3]);
const callback5 = useCallback(() => {
if (!ref5.current) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_CLOSED, {
time_spent: Date.now() - ref4.current,
reason: ref2.current
});
}
ref5.current = true;
completeAppLauncherOnboarding(ContentDismissActionType.USER_DISMISS);
if (onClose != null) {
onClose();
}
if (isMetaQuest()) {
const current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
}
if (isScreenReaderEnabled) {
setKeyboardType({
type: KeyboardTypes.SYSTEM
});
if (ref?.current != null) {
setAccessibilityFocus({
ref
});
ref = null;
}
}
}, [chatInputRef, isScreenReaderEnabled, ref2, onClose]);
if (!isScreenReaderEnabled) {
forceMaxHeight = isMetaQuest();
}
const props2 = {
ref: ref6,
animationConfigs: KEYBOARD_ANIMATION_CONFIG,
animatedIndex: sharedValue,
animatedPosition: sharedValue2,
chatInputRef,
forceMaxHeight,
enablePanDownToClose: isMetaQuest(),
onAnimate: callback4,
onClose: callback5,
transitionState,
backdropComponent: callback3,
disableHeaderRoundingAnimation: showOnboarding ? showOnboarding : entrypoint === AppLauncherEntrypoint.VOICE,
roundingViewStyle: showOnboarding ? styles.onboardingRoundingView : showOnboarding,
headerStyle: showOnboarding ? styles.onboardingHeader : showOnboarding,
isAppsKeyboard: true,
rendersHandle: entrypoint !== AppLauncherEntrypoint.VOICE,
width: defaultAppLauncherWidth,
children: null
};
if (showOnboarding) {
showOnboarding = styles.onboardingNavigatorContent;
}
props2.children = <View style={{
position: "relative",
height: maximum
}}>
<AppLauncherNavigator bottomSheetExpandReasonRef={ref3} bottomSheetIndex={sharedValue} bottomSheetPosition={sharedValue2} context={context} chatInputRef={chatInputRef} contentStyle={showOnboarding} entrypoint={entrypoint} expandBottomSheet={callback2} keyboardCloseReasonRef={ref2} width={defaultAppLauncherWidth} />
</View>;
return <PortalKeyboardBottomSheet {...props2} />;
});
export default r77;
export function setAppLauncherA11yFocusReturnRef(a0) {
ref = a0;
}
@@ -0,0 +1,32 @@
// Metro module 1479 (f1480).
import { useNativeStackNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
import Module712 from "../../../_bundle/Module712";
import Module1575 from "../../../_bundle/Module1575";
const r15 = {
HOME: "home",
APPLICATION_VIEW: "application_view",
COMMAND_VIEW: "command_view",
APP_LIST_VIEW: "app_list_view"
};
const r20 = {
NONE: 0,
0: "NONE",
FIRST_REQUIRED_OPTION: 1,
1: "FIRST_REQUIRED_OPTION",
OPTIONAL_OPTION_ADDED: 2,
2: "OPTIONAL_OPTION_ADDED"
};
const PX_16 = Module712.space.PX_16;
const MOBILE_KEYBOARD_PANEL_BACKGROUND = Module712.colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
export { Module1575 as APP_LAUNCHER_BUILT_IN_SECTION_ICON };
export { r15 as AppLauncherRouteName };
export function useAppLauncherNavigation() {
return useNativeStackNavigation();
}
export { r20 as AppLauncherOptionAutoFocusType };
export { PX_16 as DEFAULT_CONTENT_PADDING };
export { MOBILE_KEYBOARD_PANEL_BACKGROUND as SCREEN_BACKGROUND_COLOR };
export const FLASH_LIST_ITEM_IMPRESSION_VIEWABILITY_CONFIG = {
itemVisiblePercentThreshold: 50,
minimumViewTime: 1000
};
@@ -0,0 +1,264 @@
// Metro module 11225 (f11226).
import { useEffect } from "react";
import ChannelStore from "../../../stores/ChannelStore";
import UserStore from "../../../stores/UserStore";
import { APP_LAUNCHER_BUILT_IN_SECTION_ICON, AppLauncherRouteName } from "./AppLauncherNativeConstants";
import { AnalyticEvents } from "../../../Constants";
import { BuiltInSectionId } from "../../application_commands/ApplicationCommandConstants";
import { trackWithMetadata } from "../../app_analytics/AppAnalyticsUtils";
import { ApplicationCommandTriggerSections, CommandOrigin } from "../../application_commands/ApplicationCommandTypes";
import { SectionItemType } from "./screens/home/FrecencySection";
import { trackCommandSelected, getCommandTriggerSection } from "../../application_commands/ApplicationCommandUtils";
import { ApplicationCommandType, ApplicationCommandOptionType } from "../../../flow/Server";
import { setAppLauncherActiveCommand } from "../../application_commands/ApplicationCommandActionCreators";
import Module1855 from "../../../_bundle/Module1855";
import { isRealApplication } from "../utils/AppLauncherUtils";
import AvatarUtils from "../../../utils/AvatarUtils";
import { useAppLauncherContext } from "./AppLauncherContext";
import { useAnalyticsContext } from "../../../hooks/analytics";
import { useActivityAction, useOnActivityItemSelected } from "../../activities/utils/useActivityShelfItem";
import { useGetOrFetchApplication } from "../../applications/useGetOrFetchApplications";
import EmbeddedActivitiesNativeManager from "../../activities/native/EmbeddedActivitiesNativeManager";
import { triggerHapticFeedback, HapticFeedbackTypes } from "../../haptics/HapticUtils.native";
export function handleApplicationSelected({ location: location3, application, navigation, context, sectionName: sectionName2, installOnDemand, query, searchResultsPosition, navigates = true, entrypoint: entrypoint3 }) {
const APPLICATION_COMMAND_SECTION_SELECTED = AnalyticEvents.APPLICATION_COMMAND_SECTION_SELECTED;
const section = application.id === BuiltInSectionId.BUILT_IN ? ApplicationCommandTriggerSections.BUILT_IN : ApplicationCommandTriggerSections.APP;
let id = application.id;
if (id == null) {
id = null;
}
trackWithMetadata(APPLICATION_COMMAND_SECTION_SELECTED, {
location: location3,
section,
application_id: id,
section_name: sectionName2,
query,
search_results_position: searchResultsPosition,
source: entrypoint3
});
if (navigates) {
navigation.navigate(AppLauncherRouteName.APPLICATION_VIEW, {
application,
context,
installOnDemand,
sectionName: sectionName2,
entrypoint: entrypoint3
});
}
}
export function handleViewAllSelected({ location: location3, navigation, context, sectionName: sectionName2, sectionOverallPosition, applications, sectionItemType, commands, sectionDescriptors, title, promotedApplicationIds }) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_SECTION_VIEW_MORE, {
section_name: sectionName2,
num: sectionItemType === SectionItemType.APPS ? applications.length : commands.length
});
navigation.navigate(AppLauncherRouteName.APP_LIST_VIEW, {
analyticsLocation: location3,
context,
sectionName: sectionName2,
sectionOverallPosition,
applications,
sectionItemType,
commands,
sectionDescriptors,
title,
promotedApplicationIds
});
}
export function handleApplicationCommandSelected({ location: location3, context, command, section, sectionDescriptors, query, navigation, installOnDemand, sectionName: sectionName2, searchResultsPosition, entrypoint: entrypoint3, onCommandExecuted }) {
trackCommandSelected({
command,
location: location3,
triggerSection: getCommandTriggerSection(section),
queryLength: query.length,
sectionName: sectionName2,
query,
searchResultsPosition,
source: entrypoint3
});
if (command.type === ApplicationCommandType.PRIMARY_ENTRY_POINT) {
navigation.navigate(AppLauncherRouteName.APPLICATION_VIEW, {
application: section.application,
context,
installOnDemand,
sectionName: sectionName2,
entrypoint: entrypoint3
});
} else {
const id = section.id;
const FRECENCY = BuiltInSectionId.FRECENCY;
let section2 = section;
if (id === FRECENCY) {
const r40 = sectionDescriptors.find((sectionDescriptor) => sectionDescriptor.id === command.applicationId);
section2 = r40 ?? section;
}
if (context.type !== "channel") {
return void 0;
}
setAppLauncherActiveCommand(context.channel.id, command);
navigation.navigate(AppLauncherRouteName.COMMAND_VIEW, {
command,
section: section2,
context,
installOnDemand,
sectionName: sectionName2,
analyticsLocation: location3,
onCommandExecuted
});
}
}
export function getInitialOptionValues({ option, prefilledValues, guildId, roles }) {
let c18633_1;
c18633_1 = void 0;
const r13 = prefilledValues == null ? void 0 : prefilledValues.find((prefilledValue) => prefilledValue.name === option.name && prefilledValue.type === option.type);
c18633_1 = r13;
const type2 = option.type;
if (ApplicationCommandOptionType.BOOLEAN === type2) {
return r13 != null ? [{
type: "text",
text: String(Boolean(r13.value))
}] : [{
type: "text",
text: "false"
}];
}
if (ApplicationCommandOptionType.STRING !== type2 && ApplicationCommandOptionType.INTEGER !== type2 && ApplicationCommandOptionType.NUMBER !== type2) {
if (ApplicationCommandOptionType.CHANNEL === type2) {
return r13 != null && ChannelStore.getChannel(String(r13.value)) != null ? [{
type: "channelMention",
channelId: String(r13.value)
}] : [{
type: "text",
text: ""
}];
}
if (ApplicationCommandOptionType.USER === type2) {
return r13 != null && UserStore.getUser(String(r13.value)) != null ? [{
type: "userMention",
userId: String(r13.value)
}] : [{
type: "text",
text: ""
}];
}
if (ApplicationCommandOptionType.ROLE === type2) {
return r13 != null && (typeof r13.value === "string" && r13.value in roles) ? [{
type: "roleMention",
roleId: r13.value
}] : [{
type: "text",
text: ""
}];
}
if (ApplicationCommandOptionType.MENTIONABLE === type2) {
if (r13 != null) {
if (r13.value === guildId) {
return [{
type: "textMention",
text: "@everyone"
}];
}
if (typeof r13.value === "string" && r13.value in roles) {
return [{
type: "roleMention",
roleId: r13.value
}];
}
if (UserStore.getUser(String(r13.value)) != null) {
return [{
type: "userMention",
userId: String(r13.value)
}];
}
}
return [{
type: "text",
text: ""
}];
}
return [{
type: "text",
text: ""
}];
}
if (r13 != null) {
if (option.choices == null) {
return [{
type: "text",
text: String(r13.value)
}];
}
if (option.choices.some((choice) => choice.value === c18633_1.value)) {
return [{
type: "text",
text: option.choices.find((choice) => choice.value === c18633_1.value).displayName
}];
}
}
return [{
type: "text",
text: ""
}];
}
export function getAppLauncherIconSource(a0) {
return a0 == null ? Module1855 : isRealApplication(a0) ? AvatarUtils.getApplicationIconSource({
id: a0.id,
icon: a0.icon,
bot: a0.bot,
botIconFirst: false
}) : AvatarUtils.makeSource(APP_LAUNCHER_BUILT_IN_SECTION_ICON);
}
export function useLogAppLauncherEmptyStateView(a0, a1) {
const type = a0;
const entrypoint = useAppLauncherContext().entrypoint;
useEffect(() => {
if (type != null) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_EMPTY_STATE_ENCOUNTERED, {
type,
source: entrypoint
});
}
}, [a0, a1, entrypoint]);
}
export function useHandleActivityItemSelected({ applicationId, context, sectionName, onActivityItemSelected, location: location2, entrypoint: entrypoint2, launchingComponentId, fetchesApplication = true }) {
const analyticsContext = useAnalyticsContext();
const activityAction = useActivityAction({
context,
applicationId,
fetchesApplication
});
const getOrFetchApplication = useGetOrFetchApplication(applicationId, fetchesApplication);
const entrypointParams = useAppLauncherContext().entrypointParams;
const onActivityItemSelected2 = useOnActivityItemSelected({
application: getOrFetchApplication,
context,
embeddedActivitiesManager: EmbeddedActivitiesNativeManager,
locationObject: analyticsContext.location,
onActivityItemSelectedProp: ({ applicationId }) => {
if (onActivityItemSelected != null) {
onActivityItemSelected({
applicationId
});
}
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_ACTIVITY_ITEM_SELECTED, {
location: location2,
application_id: applicationId,
section_name: sectionName,
action: activityAction,
source: entrypoint2
});
},
launchingComponentId,
commandOrigin: CommandOrigin.APPLICATION_LAUNCHER,
sectionName,
source: entrypoint2,
fetchesApplication,
customId: entrypointParams?.customId,
referrerId: entrypointParams?.referrerId
});
return {
handleActivityItemSelected: function handleActivityItemSelected() {
triggerHapticFeedback(HapticFeedbackTypes.IMPACT_MEDIUM);
onActivityItemSelected2();
}
};
}
@@ -0,0 +1,99 @@
// Metro module 11255 (f11256).
import _objectWithoutProperties from "../../../_bundle/_objectWithoutProperties";
import { memo, useLayoutEffect } from "react";
import { AppLauncherRouteName } from "./AppLauncherNativeConstants";
import { AnalyticEvents } from "../../../Constants";
import { createNativeStackNavigator } from "../../../_bundle/Module9109";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../app_analytics/AnalyticsLocation";
import { useKeyboardContextForType } from "../../keyboard/native/useKeyboardType";
import { KeyboardTypes } from "../../keyboard/native/KeyboardTypes";
import { useAccessibilityNativeStackOptions } from "../../../design/components/Navigator/native/Navigator.native";
import { trackWithMetadata } from "../../app_analytics/AppAnalyticsUtils";
import { NavigationContainer } from "../../../_bundle/Module1481";
import AppLauncherHomeScreen from "./screens/home/AppLauncherHomeScreen";
import AppLauncherApplicationViewScreen from "./screens/application_view/AppLauncherApplicationViewScreen";
import AppLauncherCommandViewScreen from "./screens/command_view/AppLauncherCommandViewScreen";
import AppLauncherViewAllScreen from "./screens/app_list_view/AppLauncherViewAllScreen";
import { AppLauncherContext } from "./AppLauncherContext";
import { HermesBuiltin } from "../../../_hermes/prelude";
const _excluded = ["initialRouteName"];
const nativeStackNavigator = createNativeStackNavigator();
const useStyles = createStyles({
navigator: {
backgroundColor: Module712.colors.MOBILE_KEYBOARD_PANEL_BACKGROUND,
paddingTop: 16,
overflow: "visible",
flex: 1
}
});
const r44 = memo(function AppLauncherNavigator(props) {
const { bottomSheetExpandReasonRef, bottomSheetIndex, bottomSheetPosition, context, chatInputRef, contentStyle, entrypoint, expandBottomSheet, keyboardCloseReasonRef, onActivityItemSelected, width } = props;
let overrideParams = props.overrideParams;
const analyticsLocations = useAnalyticsLocations(AnalyticsLocation.APP_LAUNCHER).analyticsLocations;
const styles = useStyles();
const keyboardContextForType = useKeyboardContextForType(KeyboardTypes.APP_LAUNCHER);
if (overrideParams == null) {
overrideParams = keyboardContextForType;
}
const accessibilityNativeStackOptions = useAccessibilityNativeStackOptions();
const initialRouteName = overrideParams.initialRouteName;
let r27 = _objectWithoutProperties(overrideParams, _excluded);
useLayoutEffect(() => {
trackWithMetadata(AnalyticEvents.APPLICATION_COMMAND_TOP_OF_FUNNEL, {
location: "app_launcher",
source: entrypoint
});
}, [entrypoint]);
const Navigator = nativeStackNavigator.Navigator;
const screenOptions = {
contentStyle: [styles.navigator, contentStyle],
headerShown: false,
fullScreenGestureEnabled: true,
...accessibilityNativeStackOptions
};
const children = [<nativeStackNavigator.Screen name={AppLauncherRouteName.HOME} component={AppLauncherHomeScreen} initialParams={{
context,
initialSearchQuery: overrideParams.initialRouteName === AppLauncherRouteName.HOME ? overrideParams.initialSearchQuery : void 0
}} />, <nativeStackNavigator.Screen name={AppLauncherRouteName.APPLICATION_VIEW} component={AppLauncherApplicationViewScreen} initialParams={{
context,
...initialRouteName !== AppLauncherRouteName.APPLICATION_VIEW ? {} : r27,
expandBottomSheet
}} />, <nativeStackNavigator.Screen name={AppLauncherRouteName.COMMAND_VIEW} component={AppLauncherCommandViewScreen} initialParams={{
context: context.type === "channel" ? context : void 0,
...overrideParams.initialRouteName !== AppLauncherRouteName.COMMAND_VIEW ? {} : r27,
expandBottomSheet
}} />, ,];
const Screen = nativeStackNavigator.Screen;
const initialParams = {
context
};
if (overrideParams.initialRouteName !== AppLauncherRouteName.APP_LIST_VIEW) {
r27 = {};
}
HermesBuiltin.copyDataProperties(initialParams, r27);
children[3] = <Screen name={AppLauncherRouteName.APP_LIST_VIEW} component={AppLauncherViewAllScreen} initialParams={initialParams} />;
return <AppLauncherContext.Provider value={{
bottomSheetExpandReasonRef,
bottomSheetIndex,
bottomSheetPosition,
chatInputRef,
entrypoint,
entrypointParams: "customId" in overrideParams || "referrerId" in overrideParams ? {
customId: overrideParams.customId,
referrerId: overrideParams.referrerId
} : null,
keyboardCloseReasonRef,
onActivityItemSelected,
width
}}>
<NavigationContainer independent>
<AnalyticsLocationProvider value={analyticsLocations}>
<Navigator initialRouteName={initialRouteName} screenOptions={screenOptions}>{children}</Navigator>
</AnalyticsLocationProvider>
</NavigationContainer>
</AppLauncherContext.Provider>;
});
export default r44;
@@ -0,0 +1,12 @@
// Metro module 11305 (f11306).
import { useNavigation } from "../../../../_bundle/Module1481";
import { IconButton } from "../../../../design/components/Button/native/IconButton.native";
import Module5148 from "../../../../_bundle/Module5148";
import Module5176 from "../../../../_bundle/Module5176";
import { intl, t } from "../../../../intl/index.native";
export default function AppLauncherBackButton(props) {
const onPress = props.onPress;
const canGoBack = useNavigation().canGoBack();
return <IconButton size="sm" variant="secondary-overlay" icon={canGoBack ? Module5148 : Module5176} onPress={onPress} accessibilityLabel={intl.string(canGoBack ? t["13/7kX"] : t.cpT0Cq)} maxFontSizeMultiplier={1.5} />;
};
export const BACK_BUTTON_SIZE = 32;
@@ -0,0 +1,23 @@
// Metro module 11275 (f11276).
import { forwardRef, useMemo, useContext } from "react";
import { ScrollView } from "react-native";
import { GestureDetector, Gesture } from "../../../../_bundle/Module5273";
import { ControlsGestureScrollLock } from "../../../voice_panel/native/controls/utils/createUseAnimatedScrollLock";
import { useAppLauncherContext } from "../AppLauncherContext";
import { AppLauncherEntrypoint } from "../../AppLauncherTypes";
import { AnimatedFlashList, BottomSheetFlashList } from "../../../../_bundle/noop_6676";
const r22 = forwardRef(function(a0, a1) {
const entrypoint = useAppLauncherContext().entrypoint;
const simultaneousHandlers = a0.simultaneousHandlers;
const memo = useMemo(() => simultaneousHandlers == null ? ScrollView : forwardRef(function(a0, a1) {
return <GestureDetector gesture={useMemo(() => Gesture.Native().simultaneousWithExternalGesture(simultaneousHandlers), [])}>
<ScrollView ref={a1} {...a0} />
</GestureDetector>;
}), [simultaneousHandlers]);
return entrypoint === AppLauncherEntrypoint.VOICE ? <AnimatedFlashList renderScrollComponent={memo} ListHeaderComponent={a0.ListHeaderComponent} onScroll={a0.animatedOnScroll} contentContainerStyle={a0.contentContainerStyle} scrollIndicatorInsets={a0.scrollIndicatorInsets} renderItem={a0.renderItem} getItemType={a0.getItemType} data={a0.data} automaticallyAdjustsScrollIndicatorInsets={a0.automaticallyAdjustsScrollIndicatorInsets} keyboardDismissMode={a0.keyboardDismissMode} keyboardShouldPersistTaps={a0.keyboardShouldPersistTaps} showsVerticalScrollIndicator={a0.showsVerticalScrollIndicator} onViewableItemsChanged={a0.onViewableItemsChanged} viewabilityConfigCallbackPairs={a0.viewabilityConfigCallbackPairs} animatedProps={a0.animatedProps} overScrollMode="never" ref={a1} /> : <BottomSheetFlashList ListHeaderComponent={a0.ListHeaderComponent} onScroll={a0.onScroll} contentContainerStyle={a0.contentContainerStyle} scrollIndicatorInsets={a0.scrollIndicatorInsets} renderItem={a0.renderItem} getItemType={a0.getItemType} data={a0.data} preserveScrollMomentum={a0.preserveScrollMomentum} automaticallyAdjustsScrollIndicatorInsets={a0.automaticallyAdjustsScrollIndicatorInsets} keyboardDismissMode={a0.keyboardDismissMode} keyboardShouldPersistTaps={a0.keyboardShouldPersistTaps} showsVerticalScrollIndicator={a0.showsVerticalScrollIndicator} lockableScrollableContentOffsetY={a0.lockableScrollableContentOffsetY} bottomViewabilityInsetRef={a0.bottomViewabilityInsetRef} onViewableItemsChanged={a0.onViewableItemsChanged} viewabilityConfigCallbackPairs={a0.viewabilityConfigCallbackPairs} ref={a1} />;
});
r22.displayName = "AppLauncherFlashList";
export default r22;
export function useAppLauncherFlashListProps(a0) {
return useContext(ControlsGestureScrollLock)(a0);
}
@@ -0,0 +1,45 @@
// Metro module 11344 (f11345).
import { forwardRef } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import AppLauncherFlashList, { useAppLauncherFlashListProps } from "./AppLauncherFlashList";
import { EmptyState } from "../../../../design/void/native";
import Module11345 from "../../../../_bundle/Module11345";
import { intl, t } from "../../../../intl/index.native";
import { SearchField } from "../../../../design/components/TextField/native/SearchField.native";
const useStyles = createStyles({
searchBarContainer: {
marginBottom: 16
},
emptyState: {
backgroundColor: "transparent",
justifyContent: "flex-start"
},
emptyStateImage: {
flex: 0
}
});
const r31 = forwardRef(function(a0, a1) {
const bottom = useSafeAreaInsets_native().bottom;
const appLauncherFlashListProps = useAppLauncherFlashListProps();
let scrollerRef = appLauncherFlashListProps.scrollerRef;
if (scrollerRef == null) {
scrollerRef = a1;
}
return <AppLauncherFlashList contentContainerStyle={[{
paddingBottom: bottom
}, a0.contentContainerStyle]} scrollIndicatorInsets={{
bottom
}} ref={scrollerRef} {...a0} animatedOnScroll={appLauncherFlashListProps.onScroll} simultaneousHandlers={appLauncherFlashListProps.gestureRef} animatedProps={appLauncherFlashListProps.animatedProps} />;
});
export { r31 as AppLauncherList };
export function AppLauncherListEmptyState() {
const styles = useStyles();
return <EmptyState style={styles.emptyState} imageStyle={styles.emptyStateImage} lightSource={Module11345} darkSource={Module11345} title={intl.string(t.vYocDz)} body={intl.string(t.V6nAfF)} />;
}
export function AppLauncherListSearchBar(props) {
return <View style={useStyles().searchBarContainer}>
<SearchField size="md" {...props} />
</View>;
}
@@ -0,0 +1,20 @@
// Metro module 11356 (f11357).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
const useStyles = createStyles({
iconWrapper: {
justifyContent: "center",
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
borderRadius: Module712.radii.round
}
});
export default function AppLauncherOptionIcon(props) {
const { wrapperStyle, wrapperSize = 32, icon } = props;
return <View style={[useStyles().iconWrapper, wrapperStyle, {
height: wrapperSize,
width: wrapperSize
}]}>{icon}</View>;
};
export { useStyles as useAppLauncherOptionIconStyles };
@@ -0,0 +1,23 @@
// Metro module 11353 (f11354).
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useAnimationDelayedAutoFocus } from "../hooks/useAnimationDelayedAutoFocus";
import { FormRow } from "../../../../design/void/Form/native/index";
import { Text } from "../../../../design/components/Text/native/Text";
import { Icon, IconSizes } from "../../../../design/void/native";
import Module5229 from "../../../../_bundle/Module5229";
const useStyles = createStyles({
formRow: {
flexDirection: "row",
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.lg,
alignItems: "center",
flex: 1
}
});
export default function AppLauncherSelectOptionFormRow(props) {
const { style, option, selected, selectedItemName, unselectedSubLabel, autoFocus, ...props2 } = props;
const styles = useStyles();
useAnimationDelayedAutoFocus(autoFocus, props2.onPress);
return <FormRow start end style={[styles.formRow, style]} label={<Text variant={selected ? "text-sm/medium" : "text-md/medium"} color={selected ? "interactive-text-default" : "text-default"} lineClamp={1}>{option.displayName}</Text>} subLabel={selected ? () => <Text variant="text-md/medium" color="text-default" lineClamp={1}>{selectedItemName}</Text> : unselectedSubLabel != null ? () => <Text variant="text-sm/normal" color="text-muted" lineClamp={1}>{unselectedSubLabel}</Text> : null} trailing={<Icon source={Module5229} size={IconSizes.SMALL_20} />} {...props2} />;
};
@@ -0,0 +1,72 @@
// Metro module 11278 (f11279).
import { useState, useCallback } from "react";
import { useCommandContext } from "../../hooks/useCommandContext";
import { executeAppLauncherCommand } from "../../utils/AppLauncherUtils";
import { parseOptionValuesForSend } from "../../../chat_input/native/ApplicationCommandOptionValueParser";
import { CommandOrigin } from "../../../application_commands/ApplicationCommandTypes";
import { TableRowArrow } from "../../../../design/components/TableRow/native/TableRowArrow.native";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../intl/index.native";
import { SendMessageIcon } from "../../../../design/components/Icon/native/redesign/generated/SendMessageIcon";
export default function CommandRowIcon(props) {
const { command, context, beforeExecuteCommand, onExecuteCommand, tryExecuteCommand, sectionName } = props;
let options = command.options;
if (options == null) {
options = [];
}
const r21 = options.length > 0;
const [disabled, setState] = useState(false);
const commandContext = useCommandContext(context);
const callback = useCallback(async () => {
let c27013_2;
let c27013_3 = 0;
try {
setState(true);
if (beforeExecuteCommand != null) {
beforeExecuteCommand();
}
c27013_3 = 1;
await executeAppLauncherCommand({
command,
optionValues: parseOptionValuesForSend(commandContext.channel, command, {}),
context: commandContext,
sectionName,
commandOrigin: CommandOrigin.APP_LAUNCHER_APPLICATION_VIEW
});
if (onExecuteCommand != null) {
onExecuteCommand();
}
c27013_3 = 0;
(0, setState)(false);
} catch ($e) {
const r34 = $e;
let r7 = r34;
c27013_2 = r34;
if (c27013_3 !== 0) {
while (true) {
try {
const r82 = c27013_2;
c27013_3 = 0;
(0, setState)(false);
throw r82;
} catch (r79) {
r7 = r79;
c27013_2 = r79;
if (c27013_3 === 0) {
break;
}
}
}
}
throw r7;
}
}, [onExecuteCommand, command, commandContext, beforeExecuteCommand, sectionName]);
const callback2 = useCallback(() => {
if (tryExecuteCommand != null) {
tryExecuteCommand(callback);
} else {
callback();
}
}, [tryExecuteCommand, callback]);
return r21 ? <TableRowArrow /> : <Button size="sm" text={intl.string(t.TXNS7S)} onPress={callback2} icon={<SendMessageIcon size="sm" />} iconPosition="end" grow={false} variant="tertiary" disabled={disabled} />;
};
@@ -0,0 +1,26 @@
// Metro module 11230 (f11231).
import { View } from "react-native";
import Module712 from "../../../../_bundle/Module712";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import FastImage from "../../../../components_native/common/FastImage";
const sm = Module712.radii.sm;
const useStyles = createStyles((a0, a1) => ({
appIcon: {
width: a0,
height: a0,
borderRadius: a1
},
entityWrapper: {
padding: 1,
backgroundColor: Module712.colors.BORDER_SUBTLE,
overflow: "hidden",
borderRadius: a1 + 1
}
}));
export default function EntityBorderAppIcon(props) {
const { iconSource, wrapperStyle, iconStyle, iconSize = 32, iconBorderRadius = sm } = props;
const styles = useStyles(iconSize, iconBorderRadius);
return <View style={[styles.entityWrapper, wrapperStyle]}>
<FastImage style={[styles.appIcon, iconStyle]} source={iconSource} />
</View>;
};
@@ -0,0 +1,142 @@
// Metro module 11281 (f11282).
import { useState, useEffect, useMemo } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import usePrevious from "../../../../hooks/usePrevious";
import ReanimatedRexport, { useSharedValue, useDerivedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
function $mk107925($env) {
return (a0, a1) => {
const r4 = $env;
return a0({
isLastRow: !!r4[1] && a1 === r4[0].length - 1
});
};
}
const useStyles = createStyles({
animatedListContainer: {
overflow: "hidden"
},
expandCTALabelContainer: {
alignItems: "center"
}
});
const __initData = {
code: "function ExpandableListTsx1(){const{expanded,collapsedListHeight,remainingListHeight}=this.__closure;if(expanded&&collapsedListHeight.get()!==0&&remainingListHeight.get()!==0){return collapsedListHeight.get()+remainingListHeight.get();}return collapsedListHeight.get();}"
};
const __initData2 = {
code: "function ExpandableListTsx2(){const{collapsedListHeight,withTiming,containerHeight,timingStandard}=this.__closure;if(collapsedListHeight.get()!==0){return{height:withTiming(containerHeight.get(),timingStandard)};}else{return{};}}"
};
export default function ExpandableList(props) {
let c18709_8, sharedValue, sharedValue2, derivedValue;
const { items, onExpand, onExpandCTAPress, expandedOverride } = props;
let showsExpandCTAOverride = props.showsExpandCTAOverride;
const { disableExpanding, title } = props;
c18709_8 = void 0;
sharedValue = void 0;
sharedValue2 = void 0;
derivedValue = void 0;
const styles = useStyles();
const [state, setState] = useState(expandedOverride == null ? false : expandedOverride);
let r36 = usePrevious(state);
if (r36 == null) {
r36 = state;
}
const state2 = r36;
useEffect(() => {
if (state2 !== state && state && onExpand != null) {
onExpand();
}
}, [state, onExpand, state2]);
useEffect(() => {
if (expandedOverride !== void 0) {
setState(expandedOverride);
}
}, [expandedOverride]);
const r48 = Math.min(4, items.length);
c18709_8 = r48;
if (showsExpandCTAOverride == null) {
showsExpandCTAOverride = items.length > r48;
}
sharedValue = useSharedValue(0);
sharedValue2 = useSharedValue(0);
const C = function C() {
return state && (sharedValue.get() !== 0 && sharedValue2.get() !== 0) ? sharedValue.get() + sharedValue2.get() : sharedValue.get();
};
C.__closure = {
expanded: state,
collapsedListHeight: sharedValue,
remainingListHeight: sharedValue2
};
C.__workletHash = 17033418452229;
C.__initData = __initData;
derivedValue = useDerivedValue(C);
const memo2 = useMemo(() => items.slice(0, c18709_8), [items, r48]);
const memo = useMemo(() => items.slice(c18709_8, items.length), [items, r48]);
const A = function A() {
return sharedValue.get() !== 0 ? {
height: _timing.withTiming(derivedValue.get(), _timingPresets.timingStandard)
} : {};
};
A.__closure = {
collapsedListHeight: sharedValue,
withTiming: _timing.withTiming,
containerHeight: derivedValue,
timingStandard: _timingPresets.timingStandard
};
A.__workletHash = 2086836441465;
A.__initData = __initData2;
const animatedStyle = useAnimatedStyle(A);
const r3 = showsExpandCTAOverride ? !showsExpandCTAOverride : !state;
let env18710;
const r97 = env18710 = {};
env18710[0] = memo2;
env18710[1] = r3;
const r102 = [<View onLayout={function onLayout(event) {
sharedValue.set(event.nativeEvent.layout.height);
}}>
{memo2.map($mk107925(r97))}
</View>, ,];
let r104 = memo.length > 0;
if (r104) {
const importantForAccessibility = state ? void 0 : "no-hide-descendants";
let env18711;
const r109 = !showsExpandCTAOverride;
const r110 = env18711 = {};
env18711[0] = memo;
env18711[1] = r109;
r104 = <View onLayout={function onLayout(event) {
sharedValue2.set(event.nativeEvent.layout.height);
}} accessibilityElementsHidden={!state} importantForAccessibility={importantForAccessibility}>
{memo.map($mk107925(r110))}
</View>;
}
r102[1] = r104;
const r115 = [<ReanimatedRexport.View style={[styles.animatedListContainer, animatedStyle]}>{r102}</ReanimatedRexport.View>, ,];
if (showsExpandCTAOverride) {
showsExpandCTAOverride = <View>
<TableRow accessibilityLabel={state ? intl.string(t.nPGLFQ) : title != null ? intl.formatToPlainString(t["bj/2kV"], {
title
}) : void 0} label={<View style={styles.expandCTALabelContainer}>
<Text color="text-brand" variant="text-md/semibold">
{state ? intl.string(t.nPGLFQ) : intl.format(t.gVw57p, {})}
</Text>
</View>} onPress={function onPress() {
const expanded = disableExpanding !== true && !state;
setState(expanded);
if (onExpandCTAPress != null) {
onExpandCTAPress({
expanded
});
}
}} end />
</View>;
}
r115[1] = showsExpandCTAOverride;
return <>{r115}</>;
};
export const COLLAPSED_LIST_ITEM_MAX = 4;
@@ -0,0 +1,36 @@
// Metro module 11263 (f11264).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { usePlaceholderWidth } from "../hooks/usePlaceholderSize";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
const useStyles = createStyles({
loadingAppIcon: {
width: 32,
height: 32,
borderRadius: Module712.radii.sm,
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
},
loadingTextPlaceholder: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
height: 16,
marginBottom: 4,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start"
},
loadingTextPlaceholderSmall: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
height: 16,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start"
}
});
export default function PlaceholderAppRow(props) {
const { isFirstRow = false, isLastRow = false } = props;
const styles = useStyles();
return <TableRow icon={<View style={styles.loadingAppIcon} />} label={<View style={[styles.loadingTextPlaceholder, {
width: `${usePlaceholderWidth(10, 50)}%`
}]} />} subLabel={<View style={[styles.loadingTextPlaceholderSmall, {
width: `${usePlaceholderWidth(30, 90)}%`
}]} />} subLabelLineClamp={1} start={isFirstRow} end={isLastRow} onPress={() => {}} />;
};
@@ -0,0 +1,12 @@
// Metro module 11266 (f11267).
import AvatarUtils from "../../../../utils/AvatarUtils";
import { BaseAppRow } from "../screens/home/AppLauncherHomeScreen";
export default function RecommendationAppRow(props) {
const { application, onPress, isFirstRow = false, isLastRow = false, showsPromoted = false } = props;
return <BaseAppRow application={application} iconSource={AvatarUtils.getApplicationIconSource({
id: application.id,
icon: application.icon,
bot: application.bot,
botIconFirst: true
})} onPress={onPress} isFirstRow={isFirstRow} isLastRow={isLastRow} showsPromoted={showsPromoted} />;
};
@@ -0,0 +1,29 @@
// Metro module 11359 (f11360).
import { getName } from "../../../../utils/NicknameUtils";
import { Text } from "../../../../design/components/Text/native/Text";
export default function UsernameText(props) {
const { user, guildId, variant = "text-md/medium", color = "text-default" } = props;
const props2 = {
variant,
color
};
const name = getName(guildId, null, user);
const r24 = name != null && name !== user.toString();
const r39 = user.hasUniqueUsername() ? user.toString() : <>
{[user.toString(), <Text {...props2} color="text-muted">
#
{user.discriminator}
</Text>]}
</>;
return <Text {...props2}>
{r24 ? <>
{name}
{" "}
<Text {...props2} color="text-muted">
(
{r39}
)
</Text>
</> : r39}
</Text>;
};
@@ -0,0 +1,22 @@
// Metro module 11267 (f11268).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles({
expandCTALabelContainer: {
alignItems: "center"
}
});
export default function ViewAllRow(props) {
const { onPress, title } = props;
const styles = useStyles();
return <TableRow accessibilityLabel={title != null ? intl.formatToPlainString(t["bj/2kV"], {
title
}) : void 0} label={<View style={styles.expandCTALabelContainer}>
<Text color="text-brand" variant="text-md/semibold">
{intl.format(t.gVw57p, {})}
</Text>
</View>} onPress={onPress} end />;
};
@@ -0,0 +1,15 @@
// Metro module 11346 (f11347).
import { useRef, useEffect } from "react";
import { useAwaitAnimationCompletion } from "./useAwaitAnimationComplete";
export function useAnimationDelayedAutoFocus(a0, a1) {
const awaitAnimationCompletion = useAwaitAnimationCompletion();
const ref = useRef(false);
useEffect(() => {
if (a0 && !ref.current) {
awaitAnimationCompletion(() => {
a1();
});
}
ref.current = true;
}, [a0, a1, awaitAnimationCompletion]);
}
@@ -0,0 +1,13 @@
// Metro module 11339 (f11340).
import { createContext, useMemo, useContext } from "react";
const context = createContext(null);
export function AwaitAnimationContext(props) {
const { children, handleQueuedCallback } = props;
return <context.Provider value={useMemo(() => ({
handleQueuedCallback
}), [handleQueuedCallback])}>{children}</context.Provider>;
}
export function useAwaitAnimationCompletion() {
const context2 = useContext(context);
return context2 == null ? (a0) => a0() : context2.handleQueuedCallback;
}
@@ -0,0 +1,57 @@
// Metro module 11271 (f11272).
import { useContext, useRef, useMemo } from "react";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import { AppLauncherContext } from "../AppLauncherContext";
import useKeyboardActionSheetHeight from "../../../action_sheet/native/useKeyboardActionSheetHeight";
import Module12 from "../../../../_bundle/Module12";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useAnimatedReaction } from "../../../reanimated/ReanimatedRexport";
const __initData = {
code: "function useBottomSheetFlashListBottomViewabilityInsetTsx1(){const{bottomSheetPosition}=this.__closure;var _bottomSheetPosition$,_bottomSheetPosition;return(_bottomSheetPosition$=(_bottomSheetPosition=bottomSheetPosition)===null||_bottomSheetPosition===void 0?void 0:_bottomSheetPosition.get())!==null&&_bottomSheetPosition$!==void 0?_bottomSheetPosition$:0;}"
};
const __initData2 = {
code: "function useBottomSheetFlashListBottomViewabilityInsetTsx2(sheetPosition){const{distanceBetweenExpandedScreenTopAndSheetTop,runOnJS,handleBottomViewabilityInsetDebounced}=this.__closure;const bottomViewabilityInset=sheetPosition-distanceBetweenExpandedScreenTopAndSheetTop;runOnJS(handleBottomViewabilityInsetDebounced)(bottomViewabilityInset);}"
};
export function useBottomSheetFlashListBottomViewabilityInset() {
const windowDimensions_native = useWindowDimensions_native();
const bottomSheetPosition = useContext(AppLauncherContext)?.bottomSheetPosition;
const maximum = useKeyboardActionSheetHeight().maximum;
const ref = useRef(null);
const distanceBetweenExpandedScreenTopAndSheetTop = windowDimensions_native.height - maximum;
let c18699_2 = distanceBetweenExpandedScreenTopAndSheetTop;
const ref2 = useRef(9999);
const memo = useMemo(() => Module12.debounce(function(a0) {
ref2.current = a0;
const current = ref.current;
if (current != null) {
current.updateViewableItems();
}
}, 200), []);
const u = () => {
let r6 = bottomSheetPosition == null ? void 0 : bottomSheetPosition.get();
if (r6 == null) {
r6 = 0;
}
return r6;
};
u.__closure = {
bottomSheetPosition
};
u.__workletHash = 3750973667946;
u.__initData = __initData;
const r40 = function(a0) {
_ReanimatedRexport.runOnJS(memo)(a0 - c18699_2);
};
r40.__closure = {
distanceBetweenExpandedScreenTopAndSheetTop,
runOnJS: _ReanimatedRexport.runOnJS,
handleBottomViewabilityInsetDebounced: memo
};
r40.__workletHash = 6025307858098;
r40.__initData = __initData2;
useAnimatedReaction(u, r40);
return {
flashListRef: ref,
bottomVisibilityInsetRef: ref2
};
}
@@ -0,0 +1,8 @@
// Metro module 10925 (f10926).
import { ACTION_SHEET_MAX_WIDTH } from "../../../action_sheet/native/ActionSheetConstants";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import { AppLauncherEntrypoint } from "../../AppLauncherTypes";
export function useDefaultAppLauncherWidth(a0) {
const width = useWindowDimensions_native().width;
return a0 !== AppLauncherEntrypoint.TEXT ? Math.min(width, ACTION_SHEET_MAX_WIDTH) : width;
}
@@ -0,0 +1,18 @@
// Metro module 11336 (f11337).
import { useRef, useCallback } from "react";
export default function useLatch(a0) {
let c18756_0 = a0;
const ref = useRef(false);
return {
setLatch: useCallback((a0) => {
ref.current = a0;
return a0;
}, []),
tryCallback: useCallback(() => {
if (ref.current) {
ref.current = false;
c18756_0();
}
}, [a0])
};
};
@@ -0,0 +1,16 @@
// Metro module 11302 (f11303).
import { useState, useEffect } from "react";
import { useAppLauncherNavigation } from "../AppLauncherNativeConstants";
import { useRoute } from "../../../../_bundle/Module1481";
export default function useNavigationTransitionEnded() {
const [state, setState] = useState(false);
const appLauncherNavigation = useAppLauncherNavigation();
const route = useRoute();
useEffect(() => appLauncherNavigation.addListener("transitionEnd", () => {
const state = appLauncherNavigation.getState();
if (state.routes[state.index].key === route.key) {
setState(true);
}
}), [appLauncherNavigation, route, setState]);
return state;
};
@@ -0,0 +1,8 @@
// Metro module 11228 (f11229).
import { useMemo } from "react";
export function usePlaceholderWidth(a0, a1) {
return useMemo(() => {
const r4 = Math.random();
return r4 * (a1 - a0) + a0;
}, [a0, a1]);
}
@@ -0,0 +1,33 @@
// Metro module 11274 (f11275).
import { useRef, useCallback } from "react";
import { useAppLauncherContext } from "../AppLauncherContext";
import { useFocusEffect } from "../../../../_bundle/Module1481";
import { trackImpression } from "../../../app_analytics/useTrackImpression";
import { ImpressionTypes, ImpressionNames } from "../../../../_bundle/Module503";
export function useTrackAppLauncherItemImpressionOnFirstView() {
const entrypoint = useAppLauncherContext().entrypoint;
const ref = useRef(new Set());
useFocusEffect(useCallback(() => {
ref.current.clear();
}, []));
return {
trackAppLauncherItemImpressionOnFirstView: useCallback(({ itemKey, sectionName, sectionPosition, sectionOverallPosition, applicationId, commandId, applicationFlags }) => {
if (!ref.current.has(itemKey)) {
ref.current.add(itemKey);
trackImpression({
type: ImpressionTypes.VIEW,
name: ImpressionNames.APP_LAUNCHER_ITEM,
properties: {
source: entrypoint,
section_name: sectionName,
section_position: sectionPosition,
section_overall_position: sectionOverallPosition,
application_id: applicationId,
command_id: commandId,
application_flags: applicationFlags
}
});
}
}, [entrypoint])
};
}
@@ -0,0 +1,81 @@
// Metro module 11285 (f11286).
import Module8531, { Path, Defs, LinearGradient, Stop } from "../../../../_bundle/Module8531";
export default function SvgComponent(props) {
return <Module8531 width={113} height={124} fill="none" {...props}>
<Path fill="#FFE636" d="M8.626 71.393c-1.634-1.035-2.708-2.776-2.989-4.706l-.467-3.294c0-.14-.14-.282-.327-.282-.14 0-.28.141-.327.282l-.467 3.294c-.28 1.93-1.4 3.624-2.989 4.706l-.42.282c-.093.047-.14.188-.14.282 0 .142.047.236.14.283l.42.282c1.635 1.035 2.71 2.776 2.99 4.706l.466 3.293c0 .142.14.283.327.283.14 0 .28-.141.327-.283l.467-3.293c.28-1.93 1.401-3.624 2.99-4.706l.42-.282c.093-.047.14-.188.14-.283 0-.14-.047-.235-.14-.282l-.42-.282z" />
<Path fill="#CFCFDA" d="M7.6 109.225c-1.168 2.306-.234 5.129 2.1 6.305a4.78 4.78 0 002.103.518c1.728 0 3.362-.941 4.156-2.588a193.59 193.59 0 013.41-6.541l-7.893-5.035c-1.261 2.212-2.522 4.659-3.877 7.341zm10.507-16.987l6.82 6.446a36.207 36.207 0 015.65-5.364l-5.184-7.858c-2.849 2.117-5.23 4.329-7.332 6.776h.046zm-6.117 8.752l7.892 5.035c1.448-2.494 2.85-4.658 4.437-6.54L17.5 93.037c-1.961 2.4-3.736 4.988-5.464 7.952h-.047zm26.9-18.398c-1.26-2.259-4.156-3.059-6.351-1.741-2.289 1.317-4.344 2.635-6.212 4l5.184 7.858a60.462 60.462 0 015.698-3.67c2.242-1.271 2.99-4.189 1.728-6.4l-.046-.047z" />
<Path fill="#9B9BBA" d="M25.44 85.462l5.184 7.858c.28-.188.56-.423.841-.611l-5.184-7.859c-.28.189-.56.424-.84.612zm-7.986 7.528l6.819 6.447c.233-.282.42-.517.654-.8l-6.819-6.446c-.234.282-.467.517-.654.8zm-5.978 8.894l7.893 5.035c.186-.329.326-.612.513-.894l-7.893-5.035c-.187.283-.327.612-.513.894z" />
<Path fill="#6990FF" d="M10.261 121.506c4.23 0 7.66-3.455 7.66-7.717s-3.43-7.717-7.66-7.717-7.66 3.455-7.66 7.717 3.43 7.717 7.66 7.717z" />
<Path fill="#CFCFDA" d="M88.164 74.545l4.764 8.188c2.709-1.835 5.278-4.188 7.426-7.152l-7.706-5.365a20.703 20.703 0 01-4.484 4.33zm-16.067 5.553a4.678 4.678 0 00-3.97 5.317 4.683 4.683 0 004.624 4.046h.654c2.429-.329 4.998-.8 7.52-1.458l-1.495-9.364c-2.195.659-4.67 1.13-7.333 1.506v-.047zm8.361-1.835l1.494 9.41c3.457-.988 6.913-2.352 10.088-4.329l-4.763-8.187c-1.962 1.27-4.25 2.306-6.866 3.106h.047zm22.278-20.752c-2.475-.658-5.044.8-5.745 3.341-.887 3.294-2.102 6.117-3.736 8.517l7.659 5.365c2.102-3.106 3.877-6.87 5.091-11.482a4.753 4.753 0 00-3.316-5.788l.047.047z" />
<Path fill="#9B9BBA" d="M79.477 78.545l1.494 9.364c.327-.094.654-.188 1.028-.282l-1.495-9.411-.98.282-.047.047zm7.846-3.435l4.764 8.187c.28-.188.56-.376.887-.564l-4.764-8.188-.84.565h-.047zm5.324-4.894l7.707 5.364c.186-.282.42-.564.607-.847l-7.66-5.364c-.187.282-.42.565-.607.847h-.047z" />
<Path fill="#6990FF" d="M102.034 69.84c4.231 0 7.66-3.455 7.66-7.717s-3.429-7.717-7.66-7.717c-4.23 0-7.659 3.455-7.659 7.717s3.43 7.717 7.659 7.717z" />
<Path fill="url(#a)" d="M79.897 102.119c0 5.976-4.764 11.247-11.116 11.247h-28.77c-7.472 0-12.796-7.247-10.648-14.446L33.8 84.144c1.588-5.317 6.445-8.94 11.956-8.94h17.327c5.511 0 10.369 3.623 11.957 8.94l3.876 12.94.467 1.6v.189c.187.47.327.94.374 1.411.093.612.14 1.224.14 1.788v.047z" />
<Path fill="#898989" d="M79.336 98.684l-4.67 2.636c-.187.094-.374.141-.514.094-.233 0-.467-.189-.56-.424-.234-.376-.094-.894.327-1.13l4.997-2.822.467 1.6-.047.046zm.56 3.436l-4.25 2.399c-.187.094-.373.142-.56.094-.234 0-.467-.188-.56-.423-.234-.376-.094-.894.326-1.129l4.904-2.777c.094.612.14 1.224.14 1.789v.047z" />
<Path fill="#6990FF" d="M43.654 69.746l.42 10.21 9.715-.423-.42-10.21-9.715.423zm11.302-.518l.467 10.258 9.668-.423-.42-10.258-9.715.423zm-20.97.942l.14 3.575c.187 3.718 3.27 6.541 6.96 6.4h1.4c0-.047-.42-10.305-.42-10.305l-8.08.376v-.047zm32.32-1.413l.42 10.258h1.401c3.69-.235 6.539-3.34 6.352-7.058l-.14-3.576-8.08.376h.047z" />
<Path fill="#3D6BF2" d="M42.02 69.793l.467 10.258 1.587-.094-.42-10.211-1.635.047zm11.348-.471l.42 10.211 1.635-.047-.467-10.258-1.588.094zm11.303-.517l.42 10.258 1.635-.094-.42-10.211-1.635.047z" />
<Path fill="url(#b)" d="M86.996 53.747c-.748-8.517-6.772-11.575-9.948-13.316a25.756 25.756 0 01-1.635-.941c3.222-1.647 7.66-4.47 9.06-8.047 1.075-2.776.841-6.494-4.203-10.823a16.517 16.517 0 00-1.12-.8c-3.13-1.835-7.567-1.552-8.734 4.094a118.554 118.554 0 00-1.495 9.6c-.14-.236-.28-.518-.42-.753-3.41-6.4-8.92-11.858-19.336-11.011-10.181.8-15.179 8.281-17.327 15.716-.094.33-.187.659-.28.941-.84-2.917-2.055-6.634-3.41-10.07-2.148-5.364-6.492-4.893-9.294-2.493-.373.329-.7.658-.98.988-4.25 5.176-3.83 8.846-2.29 11.434 2.43 4.047 9.342 6.117 12.47 6.917-3.362 3.247-7.332 7.952-6.631 15.058.84 8.328 8.126 14.398 16.346 13.74l35.87-3.623c8.126-.989 14.057-8.33 13.31-16.564l.047-.047z" />
<Path fill="#FFAED7" d="M15.585 38.219c2.475 4.047 9.387 6.117 12.517 6.917l-9.248-19.34c-.373.33-.7.66-.98.989-4.25 5.176-3.83 8.846-2.29 11.434zm57.772 2.259c2.943-1.318 9.388-4.565 11.116-9.035 1.074-2.776.84-6.494-4.203-10.823-.374-.282-.748-.564-1.121-.8l-5.745 20.658h-.047z" />
<Path fill="#000" d="M49.446 18.926c.7 0 1.308-.611 1.308-1.317 0-.565.233-13.74-8.968-16.987-8.967-3.153-22.09 6.682-22.651 7.105-.607.47-.7 1.318-.28 1.93.467.611 1.307.706 1.915.282.14-.094 12.516-9.364 20.129-6.729 7.332 2.588 7.146 14.21 7.146 14.352 0 .753.56 1.364 1.307 1.412h.094v-.048z" />
<Path fill="#6990FF" d="M43.262 24.238l12.98-1.144a2.207 2.207 0 001.996-2.396l-.252-2.906a2.2 2.2 0 00-2.378-2.01l-12.98 1.144a2.207 2.207 0 00-1.996 2.396l.252 2.906a2.2 2.2 0 002.378 2.01zM18.9 18.174c4.928 0 8.921-4.024 8.921-8.988 0-4.964-3.994-8.988-8.92-8.988-4.927 0-8.92 4.024-8.92 8.988 0 4.964 3.993 8.988 8.92 8.988z" />
<Path fill="#698FFF" d="M25.44 54.688c1.774-.188 3.502 2.259 3.83 5.459.326 3.2-.888 5.928-2.663 6.117l-6.118.611L19.321 55.3l6.119-.612z" />
<Path fill="#8CA9FF" d="M20.398 66.965c1.796-.181 2.995-2.927 2.678-6.133-.318-3.207-2.032-5.66-3.829-5.48-1.796.181-2.995 2.927-2.677 6.134.317 3.206 2.031 5.66 3.828 5.479z" />
<Path fill="#698FFF" d="M82.185 49.7c-1.821.141-3.082 2.824-2.849 6.07.234 3.247 1.869 5.694 3.69 5.553l6.165-.47-.84-11.623-6.166.47z" />
<Path fill="#8CA9FF" d="M89.287 60.717c1.8-.136 3.065-2.852 2.826-6.065-.24-3.214-1.894-5.708-3.695-5.572-1.8.137-3.065 2.852-2.826 6.066.24 3.213 1.894 5.707 3.695 5.571z" />
<Path fill="#000" d="M51.734 47.677c-.093-.941 3.27-1.27 3.363-.33.093.942-.84 1.553-1.541 1.6-.7.047-1.728-.329-1.822-1.27z" />
<Path fill="#FF78B9" d="M58.086 52.053c.14 3.435-1.448 6.306-3.736 6.494-2.242.188-4.297-2.306-4.764-5.694l8.5-.8z" />
<Path fill="#000" d="M63.247 42.597c1.074-1.495 1.318-3.164.545-3.727-.773-.564-2.27.19-3.344 1.685-1.074 1.495-1.318 3.163-.545 3.727.773.564 2.27-.19 3.344-1.685zM46.4 45.502c.647-.708.078-2.294-1.27-3.543-1.349-1.25-2.965-1.688-3.611-.98-.646.708-.077 2.294 1.271 3.543 1.348 1.249 2.965 1.688 3.61.98z" />
<Path fill="#FFAED7" d="M42.627 52.806a.747.747 0 00.513-.235c.327-.283.374-.847.047-1.177l-3.27-3.623c-.28-.33-.84-.376-1.167-.047-.327.282-.373.847-.047 1.176l3.27 3.624a.92.92 0 00.654.282zm-3.457.329a.748.748 0 00.514-.235c.327-.282.374-.847.047-1.176L36.46 48.1c-.28-.329-.84-.376-1.167-.047-.327.283-.374.847-.047 1.177l3.27 3.623c.186.188.42.282.653.282zm-3.456.33a.748.748 0 00.514-.236c.327-.282.374-.847.047-1.176l-3.27-3.623c-.28-.33-.84-.377-1.167-.047-.327.282-.374.847-.047 1.176l3.27 3.623c.186.188.42.283.653.283zm29.19-2.871c.28 0 .514-.14.654-.376l2.569-4.188c.234-.377.093-.894-.28-1.13-.374-.235-.888-.093-1.121.283l-2.569 4.188c-.233.376-.093.894.28 1.13.14.093.327.14.467.14v-.047zm3.456-.329c.28 0 .514-.141.654-.377l2.569-4.187c.234-.377.093-.894-.28-1.13-.374-.235-.888-.094-1.121.283l-2.569 4.188c-.233.376-.093.894.28 1.129.14.094.327.141.468.141v-.047zm3.41-.329c.28 0 .513-.142.653-.377l2.569-4.188c.233-.376.093-.894-.28-1.129-.374-.235-.888-.094-1.121.282l-2.569 4.188c-.233.377-.093.894.28 1.13.14.094.327.14.467.14v-.046z" />
<Path fill="url(#c)" d="M88.257 54.83l13.03 11.293 3.036 2.635c.374.33.841.612 1.308.847.84.33 1.681.423 2.522.235 2.615-.565 4.437-3.011 4.343-5.694 0-.329 0-.611-.093-.94-.187-1.13-.888-2.071-1.868-2.636l-3.643-2.117-15.086-8.705a17.593 17.593 0 01-3.596 5.082h.047z" />
<Path fill="#433D84" d="M75.647 61.135c10.446 0 18.915-8.532 18.915-19.057 0-10.526-8.469-19.058-18.915-19.058-10.447 0-18.916 8.532-18.916 19.058 0 10.524 8.47 19.057 18.916 19.057z" opacity={0.4} />
<Path fill="url(#d)" d="M75.647 61.135c10.446 0 18.915-8.532 18.915-19.057 0-10.526-8.469-19.058-18.915-19.058-10.447 0-18.916 8.532-18.916 19.058 0 10.524 8.47 19.057 18.916 19.057z" />
<Path fill="url(#e)" d="M77.14 27.02c-8.22-.847-15.599 5.27-16.44 13.552-.84 8.282 5.232 15.716 13.452 16.563 8.22.847 15.599-5.27 16.44-13.551.84-8.282-5.231-15.717-13.451-16.564zm.374-3.905C87.883 24.15 95.495 33.514 94.468 43.96c-1.028 10.446-10.322 18.116-20.69 17.08-10.368-1.034-17.981-10.398-16.954-20.844 1.028-10.447 10.322-18.117 20.69-17.081z" />
<Path fill="url(#f)" d="M71.863 34.078h-.887c-1.962 0-4.344 1.412-4.904 4.517l-.094 1.036c0 3.058 2.056 7.01 8.734 12.422 7.613-3.953 10.415-7.435 10.976-10.446l.093-1.035c0-3.2-2.008-5.035-3.923-5.412a36.61 36.61 0 01-.887-.14c-2.242-.236-3.41.564-4.764 1.787-1.075-1.506-2.055-2.494-4.297-2.729" />
<Path fill="#6990FF" d="M100.26 68.099c2.012 0 3.643-1.643 3.643-3.67s-1.631-3.67-3.643-3.67c-2.012 0-3.643 1.643-3.643 3.67s1.631 3.67 3.643 3.67z" />
<Path fill="url(#g)" d="M90.873 26.408c-1.635-1.035-2.71-2.776-2.99-4.705l-.467-3.294c0-.141-.14-.282-.326-.282-.14 0-.28.14-.328.282l-.466 3.294c-.28 1.929-1.402 3.623-2.99 4.705l-.42.282c-.093.047-.14.189-.14.283 0 .141.047.235.14.282l.42.282c1.635 1.036 2.71 2.777 2.99 4.706l.466 3.294c0 .14.14.282.328.282.14 0 .28-.141.326-.282l.467-3.294c.28-1.93 1.402-3.623 2.99-4.706l.42-.282c.093-.047.14-.188.14-.282 0-.141-.047-.235-.14-.282l-.42-.283z" />
<Path fill="#6990FF" d="M46.504 123.953H34.92c-5.137 0-5.09-3.341-3.83-5.6.981-1.788 1.448-2.823 3.036-4.752.374-.471.887-1.035 1.448-1.647l.14-.141c2.989-3.247 7.239-5.506 11.069-.424 1.354 1.835 3.783 5.459 4.483 7.388.607 1.6 0 5.223-4.763 5.223v-.047z" />
<Path fill="#3D6BF2" d="M35.528 111.907c2.335-.141 4.95.847 6.445 5.082.14.471.234.8.374 1.082.327 1.035.514 1.6.84 3.294.187.941.094 1.835-.233 2.588h-1.588c.467-.565.607-1.365.467-2.306-.28-1.599-.467-2.117-.794-3.105-.093-.283-.233-.659-.373-1.082-1.168-3.341-3.176-4.659-6.165-3.953l-.42.094 1.447-1.647v-.047z" />
<Path fill="#6990FF" d="M62.383 123.953h11.583c5.137 0 5.09-3.341 3.876-5.6-.98-1.788-1.448-2.823-3.036-4.752-.373-.471-.887-1.035-1.447-1.647l-.14-.141c-2.99-3.247-7.24-5.506-11.07-.424-1.354 1.835-3.783 5.459-4.483 7.388-.607 1.6 0 5.223 4.764 5.223l-.047-.047z" />
<Path fill="#3D6BF2" d="M74.806 113.601l-.42-.094c-2.99-.706-4.998.612-6.165 3.953-.14.423-.234.799-.374 1.082-.327.988-.514 1.506-.794 3.105-.187.941 0 1.741.42 2.306h-1.587c-.327-.753-.42-1.647-.234-2.588.327-1.694.514-2.259.84-3.294.094-.282.234-.659.374-1.082 1.495-4.235 4.11-5.223 6.446-5.082l1.447 1.694h.047z" />
<Defs>
<LinearGradient id="a" x1={54.35} x2={54.35} y1={76.145} y2={113.601} gradientUnits="userSpaceOnUse">
<Stop offset={0.2} stopColor="#E8E8E8" />
<Stop offset={0.6} stopColor="#E6E6E7" />
<Stop offset={0.7} stopColor="#DFE1E6" />
<Stop offset={0.8} stopColor="#D3D8E4" />
<Stop offset={0.9} stopColor="#C2CBE1" />
<Stop offset={1} stopColor="#ABB9DD" />
</LinearGradient>
<LinearGradient id="b" x1={48.605} x2={55.288} y1={22.456} y2={74.486} gradientUnits="userSpaceOnUse">
<Stop offset={0.2} stopColor="#E8E8E8" />
<Stop offset={0.6} stopColor="#E6E6E7" />
<Stop offset={0.7} stopColor="#DFE1E6" />
<Stop offset={0.8} stopColor="#D3D8E4" />
<Stop offset={0.9} stopColor="#C2CBE1" />
<Stop offset={1} stopColor="#ABB9DD" />
</LinearGradient>
<LinearGradient id="c" x1={111.499} x2={89.676} y1={67.431} y2={52.544} gradientUnits="userSpaceOnUse">
<Stop offset={0.2} stopColor="#EB459F" />
<Stop offset={0.4} stopColor="#E73E9B" />
<Stop offset={0.7} stopColor="#DD2B90" />
<Stop offset={1} stopColor="#D11583" />
</LinearGradient>
<LinearGradient id="d" x1={90.254} x2={60.843} y1={29.892} y2={53.785} gradientUnits="userSpaceOnUse">
<Stop stopColor="#433D84" stopOpacity={0.2} />
<Stop offset={0.5} stopColor="#433D84" stopOpacity={0.8} />
<Stop offset={0.8} stopColor="#433D84" />
</LinearGradient>
<LinearGradient id="e" x1={70.532} x2={80.882} y1={60.302} y2={23.632} gradientUnits="userSpaceOnUse">
<Stop stopColor="#EB459F" />
<Stop offset={1} stopColor="#FF78B9" />
</LinearGradient>
<LinearGradient id="f" x1={72.64} x2={77.637} y1={51.339} y2={33.837} gradientUnits="userSpaceOnUse">
<Stop stopColor="#EB459F" />
<Stop offset={1} stopColor="#FF78B9" />
</LinearGradient>
<LinearGradient id="g" x1={84.614} x2={90.428} y1={31.866} y2={20.373} gradientUnits="userSpaceOnUse">
<Stop stopColor="#29CC7A" />
<Stop offset={0.5} stopColor="#57F287" />
</LinearGradient>
</Defs>
</Module8531>;
};
@@ -0,0 +1,46 @@
// Metro module 11238 (f11239).
import Module8531, { Path, Defs, LinearGradient, Stop } from "../../../../_bundle/Module8531";
export default function SvgComponent(props) {
return <Module8531 fill="none" {...props}>
<Path fill="#88898E" d="m36.45 13.982-16.079 2.562a2.17 2.17 0 0 0-1.185.609l-5.742 5.733a.593.593 0 0 0 .305.993 9.329 9.329 0 0 1 4.62 2.795 7.664 7.664 0 0 1 2.09 6.734L36.45 13.982ZM49.174 26.714 46.62 42.785a2.17 2.17 0 0 1-.609 1.193l-5.741 5.734a.593.593 0 0 1-.993-.297 9.265 9.265 0 0 0-2.787-4.62 7.647 7.647 0 0 0-6.742-2.09l19.426-15.991Z" />
<Path fill="#727378" d="m23.009 33.47 6.676 6.675-2.265 2.265a.448.448 0 0 1-.635 0l-6.047-6.047a.448.448 0 0 1 0-.634l2.265-2.265.006.005Z" />
<Path fill="#5A65E8" d="m20.459 33.416 4.644 4.645 4.653 4.652M18.746 29.95v-.225a4.324 4.324 0 0 0-1.338-2.338l-.056-.048-.048-.048a4.228 4.228 0 0 0-2.33-1.338 1.186 1.186 0 0 0-.232 0v.049a7.207 7.207 0 0 0-2.49 6.454h.04a7.207 7.207 0 0 0 6.454-2.49v-.017Z" />
<Path fill="#A4A5AB" d="M61.986 2.666C58.6 25.448 29.748 42.704 29.748 42.704l-4.645-4.652-4.652-4.653S37.707 4.572 60.489 1.17a1.321 1.321 0 0 1 1.497 1.497Z" />
<Path fill="#5A65E8" d="M33.207 44.418c.078-.007.155-.007.232 0 .902.18 1.72.65 2.33 1.337l.049.049.056.048a4.324 4.324 0 0 1 1.337 2.338v.224h-.048a7.207 7.207 0 0 1-6.454 2.49 7.207 7.207 0 0 1 2.49-6.454l.008-.032ZM25.576 43.442a.505.505 0 0 0 0-.705l-1.874-1.874-1.401-1.401-1.874-1.874a.497.497 0 0 0-.705 0c-1.28 1.25-5.525 5.806-4.668 10.53 4.716.849 9.249-3.395 10.522-4.676Z" />
<Path fill="#5A65E8" fillRule="evenodd" d="M47.052 17.857a1.78 1.78 0 0 1-.368-.512l-.288-.585-.585-.288a1.82 1.82 0 0 1-.513-.369 1.882 1.882 0 0 1-.368-2.154l.28-.584-.144-.64a1.898 1.898 0 0 1 1.425-2.267l.633-.144.409-.512a1.898 1.898 0 0 1 2.658-.297l.505.409h.656a1.89 1.89 0 0 1 1.89 1.89v.648l.408.512a1.898 1.898 0 0 1-.296 2.66l-.512.408-.145.632a1.897 1.897 0 0 1-2.266 1.425l-.64-.144-.585.28a1.89 1.89 0 0 1-2.154-.368Z" clipRule="evenodd" />
<Path fill="#F2F3F5" fillRule="evenodd" d="M51.352 11.107a.697.697 0 0 1 .697.697v.8c0 .157.054.31.152.433l.513.648a.69.69 0 0 1-.112.977l-.641.52a.689.689 0 0 0-.248.385l-.184.8a.689.689 0 0 1-.801.521l-.801-.176a.69.69 0 0 0-.456.048l-.745.36a.704.704 0 0 1-.929-.328l-.36-.745a.657.657 0 0 0-.32-.32l-.745-.36a.713.713 0 0 1-.329-.937l.36-.737a.69.69 0 0 0 .049-.456l-.176-.8a.688.688 0 0 1 .52-.802l.8-.184a.737.737 0 0 0 .385-.248l.513-.64a.705.705 0 0 1 .984-.113l.65.513a.697.697 0 0 0 .432.152l.792-.008Z" clipRule="evenodd" />
<Path fill="#F2F3F5" d="m36.45 13.982-16.079 2.562a2.17 2.17 0 0 0-1.185.609l-5.742 5.733a.593.593 0 0 0 .305.993 9.329 9.329 0 0 1 4.62 2.795 7.664 7.664 0 0 1 2.09 6.734L36.45 13.982ZM49.174 26.714 46.62 42.785a2.17 2.17 0 0 1-.609 1.193l-5.741 5.734a.593.593 0 0 1-.993-.297 9.265 9.265 0 0 0-2.787-4.62 7.647 7.647 0 0 0-6.742-2.09l19.426-15.991Z" />
<Path fill="#5A65E9" d="m23.009 33.47 6.676 6.675-2.265 2.265a.448.448 0 0 1-.635 0l-6.047-6.047a.448.448 0 0 1 0-.634l2.265-2.265.006.005Z" />
<Path fill="#5A65E8" d="m20.459 33.416 4.644 4.645 4.653 4.652" />
<Path fill="url(#a)" d="M18.746 29.95v-.225a4.324 4.324 0 0 0-1.338-2.338l-.056-.048-.048-.048a4.228 4.228 0 0 0-2.33-1.338 1.186 1.186 0 0 0-.232 0v.049a7.207 7.207 0 0 0-2.49 6.454h.04a7.207 7.207 0 0 0 6.454-2.49v-.017Z" />
<Path fill="#D298FF" d="M61.986 2.666C58.6 25.448 29.748 42.704 29.748 42.704l-4.645-4.652-4.652-4.653S37.707 4.572 60.489 1.17a1.321 1.321 0 0 1 1.497 1.497Z" />
<Path fill="url(#b)" d="M33.207 44.418c.078-.007.155-.007.232 0 .902.18 1.72.65 2.33 1.337l.049.049.056.048a4.324 4.324 0 0 1 1.337 2.338v.224h-.048a7.207 7.207 0 0 1-6.454 2.49 7.207 7.207 0 0 1 2.49-6.454l.008-.032Z" />
<Path fill="url(#c)" d="M25.576 43.442a.505.505 0 0 0 0-.705l-1.874-1.874-1.401-1.401-1.874-1.874a.497.497 0 0 0-.705 0c-1.28 1.25-5.525 5.806-4.668 10.53 4.716.849 9.249-3.395 10.522-4.676Z" />
<Path fill="#5A65E8" fillRule="evenodd" d="M47.052 17.857a1.78 1.78 0 0 1-.368-.512l-.288-.585-.585-.288a1.82 1.82 0 0 1-.513-.369 1.882 1.882 0 0 1-.368-2.154l.28-.584-.144-.64a1.898 1.898 0 0 1 1.425-2.267l.633-.144.409-.512a1.898 1.898 0 0 1 2.658-.297l.505.409h.656a1.89 1.89 0 0 1 1.89 1.89v.648l.408.512a1.898 1.898 0 0 1-.296 2.66l-.512.408-.145.632a1.897 1.897 0 0 1-2.266 1.425l-.64-.144-.585.28a1.89 1.89 0 0 1-2.154-.368Z" clipRule="evenodd" />
<Path fill="#F2F3F5" fillRule="evenodd" d="M51.352 11.107a.697.697 0 0 1 .697.697v.8c0 .157.054.31.152.433l.513.648a.69.69 0 0 1-.112.977l-.641.52a.689.689 0 0 0-.248.385l-.184.8a.689.689 0 0 1-.801.521l-.801-.176a.69.69 0 0 0-.456.048l-.745.36a.704.704 0 0 1-.929-.328l-.36-.745a.657.657 0 0 0-.32-.32l-.745-.36a.713.713 0 0 1-.329-.937l.36-.737a.69.69 0 0 0 .049-.456l-.176-.8a.688.688 0 0 1 .52-.802l.8-.184a.737.737 0 0 0 .385-.248l.513-.64a.705.705 0 0 1 .984-.113l.65.513a.697.697 0 0 0 .432.152l.792-.008Z" clipRule="evenodd" />
<Path fill="#84EE91" d="m53.681 48.805-3.617 2.963a1.874 1.874 0 0 0-.263 2.637l2.963 3.618c.656.8 1.837.918 2.637.262l3.618-2.963c.8-.656.918-1.836.262-2.637l-2.963-3.618a1.874 1.874 0 0 0-2.637-.262Z" />
<Path fill="#EF913C" fillRule="evenodd" d="M26.76 1.89A1.874 1.874 0 0 0 23.999.224l-4.34 2.322a1.866 1.866 0 0 0-.144 3.203l4.3 2.827a1.874 1.874 0 0 0 2.89-1.561l.057-5.125Z" clipRule="evenodd" />
<Path fill="#98AFFF" fillRule="evenodd" d="M12.22 52.298a1.025 1.025 0 0 0-1.362-1.361l-1.121.52a1.666 1.666 0 0 1-1.41 0l-1.129-.52a1.025 1.025 0 0 0-1.353 1.36l.52 1.122a1.73 1.73 0 0 1 0 1.41l-.52 1.12a1.025 1.025 0 0 0 1.353 1.362l1.13-.52a1.73 1.73 0 0 1 1.409 0l1.121.52a1.025 1.025 0 0 0 1.361-1.362l-.52-1.12a1.666 1.666 0 0 1 0-1.41l.52-1.121Z" clipRule="evenodd" />
<Path fill="#fff" fillRule="evenodd" d="M3.531 60.354a.545.545 0 0 0-.729-.729l-.608.28a.986.986 0 0 1-.801 0l-.609-.28a.545.545 0 0 0-.728.729l.28.608a.985.985 0 0 1 0 .801l-.28.609a.545.545 0 0 0 .728.728l.609-.28a.986.986 0 0 1 .8 0l.61.28a.545.545 0 0 0 .728-.728l-.28-.609a.92.92 0 0 1 0-.8l.28-.61Z" clipRule="evenodd" />
<Defs>
<LinearGradient id="a" x1={12.115} x2={18.746} y1={29.237} y2={29.237} gradientUnits="userSpaceOnUse">
<Stop offset={0.07} stopColor="#F9E172" />
<Stop offset={0.27} stopColor="#F7D067" />
<Stop offset={0.67} stopColor="#F1A549" />
<Stop offset={0.83} stopColor="#EF913C" />
</LinearGradient>
<LinearGradient id="b" x1={30.613} x2={37.243} y1={47.733} y2={47.733} gradientUnits="userSpaceOnUse">
<Stop offset={0.07} stopColor="#F9E172" />
<Stop offset={0.27} stopColor="#F7D067" />
<Stop offset={0.67} stopColor="#F1A549" />
<Stop offset={0.83} stopColor="#EF913C" />
</LinearGradient>
<LinearGradient id="c" x1={14.934} x2={25.72} y1={42.833} y2={42.833} gradientUnits="userSpaceOnUse">
<Stop offset={0.07} stopColor="#F9E172" />
<Stop offset={0.27} stopColor="#F7D067" />
<Stop offset={0.67} stopColor="#F1A549" />
<Stop offset={0.83} stopColor="#EF913C" />
</LinearGradient>
</Defs>
</Module8531>;
};
@@ -0,0 +1,13 @@
// Metro module 11272 (f11273).
import Dispatcher from "../../../../Dispatcher";
export function setLastSeenTimeMs() {
Dispatcher.dispatch({
type: "APP_LAUNCHER_ONBOARDING_SET_LAST_SEEN_TIME_MS"
});
}
export function setTriggeredOnboardingContentMetadata(a0) {
Dispatcher.dispatch({
type: "APP_LAUNCHER_ONBOARDING_SET_TRIGGERED_ONBOARDING_CONTENT_METADATA",
triggeredOnboardingContentMetadata: a0
});
}
@@ -0,0 +1,120 @@
// Metro module 11402 (f11403).
import { StyleSheet, View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { SMALL_BUTTON_HEIGHT, SMALL_BUTTON_PADDING } from "../../../../design/components/Button/native/ButtonConstants.native";
import Module712 from "../../../../_bundle/Module712";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useGradientBottom } from "../../../client_themes/native/ClientThemesOverrides";
import useAppLauncherOnboardingContent from "./hooks/useAppLauncherOnboardingContent";
import ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import LottieAnimationView from "../../../../components_native/common/LottieAnimationView";
import * as _Module11403 from "../../../../_bundle/Module11403";
import * as _Module11236 from "../../../../_bundle/Module11236";
let EnteringAnimation, ExitingAnimation;
const useStyles = createStyles(() => {
const width = SMALL_BUTTON_HEIGHT + SMALL_BUTTON_PADDING + 2;
return {
fakeButton: {
zIndex: 3,
borderWidth: 1.5,
borderColor: Module712.colors.BACKGROUND_BRAND,
borderRadius: Module712.radii.round,
alignItems: "center",
justifyContent: "center",
width,
height: width,
marginLeft: 4
},
glowMask: {
zIndex: 1,
position: "absolute",
borderRadius: Module712.radii.round,
top: 0,
left: 0,
width,
height: width,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
marginLeft: 4
},
glowLottie: {
width: "150%",
height: "150%",
position: "absolute",
top: "-25%",
left: "-25%",
zIndex: 0,
opacity: 0.8
},
trinketsLottie: {
zIndex: 4,
position: "absolute",
pointerEvents: "none",
width: "175%",
height: "175%",
top: "-43%",
left: "-38%"
},
glowAnimation: {
pointerEvents: "none"
}
};
});
const EnteringAnimation2 = function EnteringAnimation() {
return {
initialValues: {
opacity: 0
},
animations: {
opacity: _timing.withTiming(1, _timingPresets.timingStandard)
}
};
};
EnteringAnimation2.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
EnteringAnimation2.__workletHash = 2327377243473;
EnteringAnimation2.__initData = {
code: "function EnteringAnimation_AppLauncherOnboardingChatInputButtonAnimationTsx1(){const{withTiming,timingStandard}=this.__closure;const initialValues={opacity:0};const animations={opacity:withTiming(1,timingStandard)};return{initialValues:initialValues,animations:animations};}"
};
EnteringAnimation = EnteringAnimation2;
const ExitingAnimation2 = function ExitingAnimation() {
return {
initialValues: {
opacity: 1
},
animations: {
opacity: _timing.withTiming(0, _timingPresets.timingStandard)
}
};
};
ExitingAnimation2.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
ExitingAnimation2.__workletHash = 1065249287738;
ExitingAnimation2.__initData = {
code: "function ExitingAnimation_AppLauncherOnboardingChatInputButtonAnimationTsx2(){const{withTiming,timingStandard}=this.__closure;const initialValues={opacity:1};const animations={opacity:withTiming(0,timingStandard)};return{initialValues:initialValues,animations:animations};}"
};
ExitingAnimation = ExitingAnimation2;
export const APP_LAUNCHER_ONBOARDING_CHAT_INPUT_BUTTON_ANIMATION_DURATION_MS = 7000;
export function AppLauncherOnboardingChatInputButtonAnimation(props) {
const channelId = props.channelId;
const styles = useStyles();
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const gradientBottom = useGradientBottom();
useAppLauncherOnboardingContent({
channelId
});
return <>
<ReanimatedRexport.View entering={EnteringAnimation} exiting={ExitingAnimation} style={[StyleSheet.absoluteFill, styles.glowAnimation]} collapsable={false}>
<LottieAnimationView collapsable={false} style={styles.glowLottie} source={_Module11403} autoPlay={!stateFromStores} />
<View collapsable={false} style={[styles.glowMask, gradientBottom]} />
<View collapsable={false} style={styles.fakeButton} />
</ReanimatedRexport.View>
<LottieAnimationView collapsable={false} style={styles.trinketsLottie} source={_Module11236} autoPlay={!stateFromStores} />
</>;
}
@@ -0,0 +1,15 @@
// Metro module 11223 (f11224).
import { useActivityApplications } from "../hooks/useActivityApplications";
import ApplicationsImage from "./ApplicationsImage";
import BannerBase from "./BannerBase";
import { intl, t } from "../../../../../intl/index.native";
export default function ActivitiesBanner(props) {
const [firstApplication, secondApplication] = useActivityApplications({
guildId: props.context.channel.guild_id,
fetchesShelf: false
});
const image = <ApplicationsImage firstApplication={firstApplication} secondApplication={secondApplication} />;
return firstApplication == null ? null : secondApplication == null ? null : <BannerBase image={image} text={intl.formatToPlainString(t.zHMWuV, {
activityName: firstApplication.name
})} />;
};
@@ -0,0 +1,56 @@
// Metro module 11289 (f11290).
import { useEffect } from "react";
import { View } from "react-native";
import { DEFAULT_CONTENT_PADDING } from "../../AppLauncherNativeConstants";
import { ContentDismissActionType } from "../../../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { AppsIcon } from "../../../../../design/components/Icon/native/redesign/generated/AppsIcon";
import { Coachmark } from "../../../../../design/components/Coachmark/native/Coachmark.native";
import { intl, t } from "../../../../../intl/index.native";
const useStyles = createStyles({
appsIcon: {
height: 40,
width: 40,
backgroundColor: Module712.colors.BACKGROUND_BRAND,
borderRadius: Module712.radii.round,
alignItems: "center",
justifyContent: "center"
},
appsIconImage: {
height: 24,
width: 24,
tintColor: Module712.unsafe_rawColors.WHITE
}
});
export default function GlobalSearchCoachmark(props) {
const { markAsDismissed, visible, windowDimensions } = props;
const styles = useStyles();
const width = windowDimensions.width - 2 * DEFAULT_CONTENT_PADDING;
useEffect(() => () => {
if (visible) {
markAsDismissed({
actionType: ContentDismissActionType.USER_DISMISS
});
}
}, [markAsDismissed, visible]);
return visible ? <Coachmark renderImgComponent={function appsIcon() {
return <View style={styles.appsIcon}>
<AppsIcon style={styles.appsIconImage} color={Module712.colors.INTERACTIVE_TEXT_ACTIVE} />
</View>;
}} title={intl.string(t.bCPN5y)} description={intl.string(t["0TBExc"])} onDismiss={() => {
markAsDismissed({
actionType: ContentDismissActionType.TAKE_ACTION
});
}} targetMeasurements={{
x: 0,
y: -40,
width,
height: 40
}} surfaceMeasurements={{
x: -140,
y: -40,
width,
height: windowDimensions.height
}} position="bottom" /> : null;
};
@@ -0,0 +1,18 @@
// Metro module 11222 (f11223).
import { DismissibleContent } from "../../../../../_bundle/Module1358";
import ActivitiesBanner from "./ActivitiesBanner";
import AppsBanner from "./AppsBanner";
import BotsBanner from "./BotsBanner";
export default function AppLauncherOnboardingBanner(props) {
const { context, visibleContent } = props;
if (DismissibleContent.APP_LAUNCHER_ONBOARDING_ACTIVITIES_BANNER === visibleContent) {
return <ActivitiesBanner context={context} />;
}
if (DismissibleContent.APP_LAUNCHER_ONBOARDING_APPS_BANNER === visibleContent) {
return <AppsBanner />;
}
if (DismissibleContent.APP_LAUNCHER_ONBOARDING_BOTS_BANNER === visibleContent) {
return <BotsBanner context={context} />;
}
return null;
};
@@ -0,0 +1,27 @@
// Metro module 11221 (f11222).
import { memo } from "react";
import { View } from "react-native";
import { useBestActiveChatInputContainerHeight } from "../../../../chat_input/native/useChatBottomManagerUIStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import AppLauncherOnboardingBanner from "./AppLauncherOnboardingBanner";
const useStyles = createStyles({
container: {
opacity: 1,
width: "100%",
position: "absolute",
left: 0,
top: 0,
backgroundColor: Module712.colors.BACKGROUND_SCRIM
}
});
const r36 = memo(function({ context, visibleContent, bottomOffset }) {
const styles = useStyles();
const bestActiveChatInputContainerHeight = useBestActiveChatInputContainerHeight();
return visibleContent != null ? <View style={[styles.container, {
bottom: bestActiveChatInputContainerHeight + bottomOffset
}]}>
<AppLauncherOnboardingBanner context={context} visibleContent={visibleContent} />
</View> : null;
});
export default r36;
@@ -0,0 +1,45 @@
// Metro module 11224 (f11225).
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { getAppLauncherIconSource } from "../../AppLauncherNativeUtils";
import FastImage from "../../../../../components_native/common/FastImage";
const useStyles = createStyles({
appIconContainer: {
backgroundColor: Module712.colors.BACKGROUND_BRAND,
borderRadius: Module712.radii.sm + 3,
position: "absolute",
padding: 3
},
appIconLeftContainer: {
transform: [{
rotate: "-10deg"
}]
},
appIconRightContainer: {
left: Module712.space.PX_32,
transform: [{
rotate: "15deg"
}]
},
appIcon: {
borderRadius: Module712.radii.sm,
width: 36,
height: 36
}
});
export default function ApplicationsImage(props) {
const { firstApplication, secondApplication } = props;
const styles = useStyles();
const source = firstApplication != null ? getAppLauncherIconSource(firstApplication) : null;
const source2 = secondApplication != null ? getAppLauncherIconSource(secondApplication) : null;
return <>
<View style={[styles.appIconContainer, styles.appIconLeftContainer]}>
{source2 != null && <FastImage style={styles.appIcon} source={source2} />}
</View>
<View style={[styles.appIconContainer, styles.appIconRightContainer]}>
{source != null && <FastImage style={styles.appIcon} source={source} />}
</View>
</>;
};
export const APP_ICON_SIZE = 36;
@@ -0,0 +1,22 @@
// Metro module 11237 (f11238).
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import OnboardingAppsRocket from "../../images/OnboardingAppsRocket";
import BannerBase from "./BannerBase";
import { intl, t } from "../../../../../intl/index.native";
const useStyles = createStyles({
rocketIconContainer: {
position: "absolute",
top: -20
},
rocketIcon: {
width: 90,
height: 90
}
});
export default function AppsBaner() {
const styles = useStyles();
return <BannerBase image={<View style={styles.rocketIconContainer}>
<OnboardingAppsRocket style={styles.rocketIcon} />
</View>} text={intl.string(t.sjRwMJ)} />;
};
@@ -0,0 +1,131 @@
// Metro module 11235 (f11236).
import { useState } from "react";
import { View } from "react-native";
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import Module712 from "../../../../../_bundle/Module712";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import { APP_ICON_SIZE } from "./ApplicationsImage";
import * as _ReanimatedRexport from "../../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../../reanimated/ReanimatedRexport";
import useWindowDimensions_native from "../../../../screen/useWindowDimensions.native";
import { hexOpacityToRgba } from "../../../../../utils/ColorUtils";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import * as _spring from "../../../../../design/animation/reanimated/spring/spring";
import Module4611 from "../../../../../_bundle/Module4611";
import LottieAnimationView from "../../../../../components_native/common/LottieAnimationView";
import * as _Module11236 from "../../../../../_bundle/Module11236";
import { Text } from "../../../../../design/components/Text/native/Text";
const PX_12 = Module712.space.PX_12;
const SPRING_CONFIG = {
mass: 1,
stiffness: 100,
damping: 15
};
const useStyles = createStyles({
banner: {
backgroundColor: Module712.colors.BACKGROUND_BRAND,
position: "absolute",
borderRadius: Module712.radii.lg,
paddingHorizontal: Module712.space.PX_16,
paddingVertical: PX_12,
flexDirection: "row",
minHeight: APP_ICON_SIZE + 2 * PX_12 + 4,
bottom: Module712.space.PX_16,
left: Module712.space.PX_16
},
bannerGradientColor: {
backgroundColor: "#7eaaff"
},
bannerBackgroundGradient: {
position: "absolute",
top: 0,
left: 0,
borderRadius: Module712.radii.lg
},
imageContainer: {
width: 72
},
trinketsLottie: {
width: 175,
height: 175,
position: "absolute",
top: -38,
left: -27,
zIndex: 1,
pointerEvents: "none"
},
bannerTextContainer: {
alignItems: "center",
justifyContent: "center",
marginLeft: Module712.space.PX_12,
flexShrink: 1
},
bannerText: {
width: "100%"
}
});
const __initData = {
code: "function BannerBaseTsx1(){const{bannerMeasured,withDelay,withSpring,SPRING_CONFIG}=this.__closure;return{opacity:bannerMeasured.get()?withDelay(150,withSpring(1,SPRING_CONFIG)):0,transform:[{translateY:bannerMeasured.get()?withDelay(150,withSpring(0,SPRING_CONFIG)):30}]};}"
};
export default function BannerBase(props) {
const { image, text } = props;
const styles = useStyles();
let opacity = 0;
const [height, setState] = useState(0);
const sharedValue = useSharedValue(false);
const width = useWindowDimensions_native().width - 2 * Module712.space.PX_16;
const backgroundColor = styles.bannerGradientColor.backgroundColor;
const colors = [hexOpacityToRgba(backgroundColor, 0.2), hexOpacityToRgba(backgroundColor, 0)];
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const _ = function _() {
return {
opacity: sharedValue.get() ? _ReanimatedRexport.withDelay(150, _spring.withSpring(1, SPRING_CONFIG)) : 0,
transform: [{
translateY: sharedValue.get() ? _ReanimatedRexport.withDelay(150, _spring.withSpring(0, SPRING_CONFIG)) : 30
}]
};
};
_.__closure = {
bannerMeasured: sharedValue,
withDelay: _ReanimatedRexport.withDelay,
withSpring: _spring.withSpring,
SPRING_CONFIG
};
_.__workletHash = 5314641176204;
_.__initData = __initData;
const animatedStyle = useAnimatedStyle(_);
const style = [styles.banner, , ,];
if (height > 0) {
opacity = 1;
}
style[1] = {
opacity,
width
};
style[2] = animatedStyle;
return <ReanimatedRexport.View style={style} onLayout={function onLayout(event) {
const height = event.nativeEvent.layout?.height;
if (height > 0) {
setState(height);
sharedValue.set(true);
}
}}>
<Module4611 start={{
x: 0,
y: 0
}} end={{
x: 0,
y: 1
}} colors={colors} style={[styles.bannerBackgroundGradient, {
height,
width
}]} />
<View style={styles.imageContainer}>
<LottieAnimationView style={styles.trinketsLottie} source={_Module11236} autoPlay={!stateFromStores} />
{image}
</View>
<View style={styles.bannerTextContainer}>
<Text variant="text-md/semibold" color="text-overlay-light" style={styles.bannerText}>{text}</Text>
</View>
</ReanimatedRexport.View>;
};
@@ -0,0 +1,16 @@
// Metro module 11239 (f11240).
import { useBannerBots } from "../hooks/useBannerBots";
import ApplicationsImage from "./ApplicationsImage";
import BannerBase from "./BannerBase";
import { intl, t } from "../../../../../intl/index.native";
export default function BotsBanner(props) {
const bannerBots = useBannerBots({
context: props.context
});
const { firstBotApplication, secondBotApplication } = bannerBots;
const image = <ApplicationsImage firstApplication={firstBotApplication} secondApplication={secondBotApplication} />;
return firstBotApplication == null ? null : secondBotApplication == null ? null : <BannerBase image={image} text={intl.formatToPlainString(t["9SN0xw"], {
firstApplicationName: firstBotApplication.name,
secondApplicationName: secondBotApplication.name
})} />;
};
@@ -0,0 +1,17 @@
// Metro module 11212 (f11213).
import { useEffect } from "react";
import useActivityShelfItems from "../../../../activities/useActivityShelfItems";
import { fetchShelf } from "../../../../activities/EmbeddedActivitiesActionCreators";
export function useActivityApplications({ guildId, fetchesShelf }) {
const r14 = useActivityShelfItems({
guildId
}).map((item) => item.application);
useEffect(() => {
if (fetchesShelf) {
fetchShelf({
guildId
});
}
}, [fetchesShelf, guildId]);
return r14;
}
@@ -0,0 +1,59 @@
// Metro module 11211 (f11212).
import _slicedToArray from "../../../../../_bundle/_slicedToArray";
import ApplicationFrecencyStore from "../../../../applications/ApplicationFrecencyStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import { DismissibleContentGroupName } from "../../../../dismissible_content/DismissibleContentConstants";
import { useIsDismissibleContentDismissed_UNSAFE } from "../../../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import { useActivityApplications } from "./useActivityApplications";
import useCanShowAppLauncherOnboarding from "./useCanShowAppLauncherOnboarding";
import { useSelectedDismissibleContent } from "../../../../dismissible_content/hooks/useSelectedDismissibleContent";
export default function useAppLauncherOnboardingContent({ channelId }) {
const r6 = [];
const hasUsedActivities = (function useHasUsedActivities({ channel }) {
let r29 = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.APP_LAUNCHER_ONBOARDING_ACTIVITIES_BANNER);
const isDismissibleContentDismissed_UNSAFE = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.APP_LAUNCHER_ONBOARDING_APPS_BANNER);
const stateFromStores = useStateFromStores([ApplicationFrecencyStore], () => ApplicationFrecencyStore.getApplicationFrecencyWithoutLoadingLatest());
const guild_id = channel?.guild_id;
if (r29) {
r29 = isDismissibleContentDismissed_UNSAFE;
}
const activityApplications = useActivityApplications({
guildId: guild_id,
fetchesShelf: !r29
});
let hasUsedActivities = false;
for (const item of activityApplications) {
if (stateFromStores.getEntry(item.id) == null) {
continue;
}
hasUsedActivities = true;
break;
}
return {
hasUsedActivities
};
})({
channel: useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId))
}).hasUsedActivities;
const canShowAppLauncherOnboarding = useCanShowAppLauncherOnboarding({
channelId
});
const { canShowBotsBanner, canShowAppsOrActivitiesBanner } = canShowAppLauncherOnboarding;
if (canShowBotsBanner) {
r6.push(DismissibleContent.APP_LAUNCHER_ONBOARDING_BOTS_BANNER);
}
if (canShowAppsOrActivitiesBanner) {
if (hasUsedActivities) {
r6.push(DismissibleContent.APP_LAUNCHER_ONBOARDING_ACTIVITIES_BANNER);
} else {
r6.push(DismissibleContent.APP_LAUNCHER_ONBOARDING_APPS_BANNER);
}
}
const r49 = _slicedToArray(useSelectedDismissibleContent(r6, DismissibleContentGroupName.APP_LAUNCHER_ONBOARDING), 2);
return {
visibleContent: r49[0],
markAsDismissed: r49[1]
};
};
@@ -0,0 +1,113 @@
// Metro module 11240 (f11241).
import { useMemo } from "react";
import GuildStore from "../../../../../stores/GuildStore";
import AppLauncherOnboardingStore from "../stores/AppLauncherOnboardingStore";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import { useTopCommands } from "../../../../application_commands/ApplicationCommandFrecencyHooks";
import { useApplicationsInContext, useApplicationCommandsInContext } from "../../../utils/AppLauncherSearchUtils";
import { useActivityApplications } from "./useActivityApplications";
export function useBannerBots({ context: context2 }) {
let c18650_0;
c18650_0 = void 0;
let secondBotApplication = void 0;
const r10 = (function useAppsMap({ context: context2 }) {
const apps = useApplicationsInContext({
context: context2,
onlyWithCommands: true,
includeBuiltIn: false,
includeEmbeddedApps: false,
includeNonEmbeddedApps: true
}).apps;
return useMemo(() => {
const map = new Map();
for (const app of apps) {
map.set(app.id, app);
}
return map;
}, [apps]);
})({
context: context2
});
const apps2 = useApplicationsInContext({
context: context2,
onlyWithCommands: true,
includeBuiltIn: false,
includeEmbeddedApps: false,
includeNonEmbeddedApps: true
}).apps;
const r40 = (function useCommandsMap({ context: context2 }) {
const commands = useApplicationCommandsInContext({
context: context2,
includeBuiltIn: false
}).commands;
return useMemo(() => {
const map = new Map();
for (const command of commands) {
map.set(command.id, command);
}
return map;
}, [commands]);
})({
context: context2
});
const r42 = (function useFrecencyCommandIds({ context }) {
return useTopCommands({
channel: context.channel,
guild: useStateFromStores([GuildStore], () => GuildStore.getGuild(context.channel?.guild_id))
});
})({
context: context2
});
const activityApplications = useActivityApplications({
guildId: context2.channel?.guild_id,
fetchesShelf: true
});
const stateFromStores = useStateFromStores([AppLauncherOnboardingStore], () => AppLauncherOnboardingStore.getRecentApplicationCommandMetadata());
const r56 = stateFromStores != null ? r10.get(stateFromStores.applicationId) : null;
let firstBotApplication = r56;
c18650_0 = r56;
for (const item of r42) {
const r67 = r40.get(item);
if (r67 == null) {
continue;
}
const r72 = r10.get(r67.applicationId);
if (r72 == null) {
continue;
}
if (firstBotApplication == null) {
firstBotApplication = r72;
c18650_0 = r72;
continue;
}
if (r72.id === firstBotApplication?.id) {
continue;
}
secondBotApplication = r72;
break;
}
if (firstBotApplication == null) {
if (apps2.length > 0) {
const r88 = apps2[0];
firstBotApplication = r88;
c18650_0 = r88;
}
if (apps2.length > 1) {
secondBotApplication = apps2[1];
}
} else if (secondBotApplication == null) {
secondBotApplication = apps2.find((item) => item.id !== c18650_0?.id);
}
if (firstBotApplication == null) {
const r93 = activityApplications[0];
firstBotApplication = r93;
c18650_0 = r93;
secondBotApplication = activityApplications[1];
} else if (secondBotApplication == null) {
secondBotApplication = activityApplications[0];
}
return {
firstBotApplication,
secondBotApplication
};
}
@@ -0,0 +1,96 @@
// Metro module 11217 (f11218).
import ChannelStore from "../../../../../stores/ChannelStore";
import GuildMemberCountStore from "../../../../../stores/GuildMemberCountStore";
import UserStore from "../../../../../stores/UserStore";
import AppLauncherOnboardingPersistedStore from "../stores/AppLauncherOnboardingPersistedStore";
import AppLauncherOnboardingStore from "../stores/AppLauncherOnboardingStore";
import { BuiltInSectionId } from "../../../../application_commands/ApplicationCommandConstants";
import Durations from "../../../../../utils/Durations";
import { useStateFromStores, useStateFromStoresObject } from "../../../../../_bundle/Module589";
import SnowflakeUtils from "../../../../../utils/SnowflakeUtils";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
import { useSelectedDismissibleContent } from "../../../../dismissible_content/hooks/useSelectedDismissibleContent";
import { useIsDismissibleContentDismissed_UNSAFE } from "../../../../dismissible_content/DismissibleContentUnsafeUtils";
let c7596_10 = 5 * Durations.Millis.SECOND;
let c7596_11 = 5 * Durations.Millis.SECOND;
let c7596_12 = 14 * Durations.Millis.DAY;
const HOUR = Durations.Millis.HOUR;
const DAY = Durations.Millis.DAY;
export default function useCanShowAppLauncherOnboarding({ channelId }) {
const r19 = Date.now();
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
const guild_id2 = stateFromStores?.guild_id;
const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
let r39 = stateFromStores2?.createdAt != null && Date.now() < SnowflakeUtils.extractTimestamp(stateFromStores2.id) + c7596_12;
const guild_id = guild_id2;
const stateFromStores3 = useStateFromStores([GuildMemberCountStore], () => GuildMemberCountStore.getMemberCount(guild_id));
const r6 = stateFromStores3 != null && stateFromStores3 < 200;
const stateFromStores4 = useStateFromStores([AppLauncherOnboardingPersistedStore], () => AppLauncherOnboardingPersistedStore.getLastSeenTimeMs());
const r66 = stateFromStores4 != null && r19 < stateFromStores4 + HOUR;
const r69 = [];
if (!r66) {
r69.push(DismissibleContent.APP_LAUNCHER_GLOBAL_SEARCH_ONBOARDING);
}
const [r83] = useSelectedDismissibleContent(r69);
const APP_LAUNCHER_GLOBAL_SEARCH_ONBOARDING = DismissibleContent.APP_LAUNCHER_GLOBAL_SEARCH_ONBOARDING;
const stateFromStoresObject = useStateFromStoresObject([AppLauncherOnboardingStore], () => ({
recentMessageMetadata: AppLauncherOnboardingStore.getRecentMessageMetadata(),
recentApplicationCommandMetadata: AppLauncherOnboardingStore.getRecentApplicationCommandMetadata()
}));
const { recentMessageMetadata, recentApplicationCommandMetadata } = stateFromStoresObject;
const stateFromStores5 = useStateFromStores([AppLauncherOnboardingPersistedStore], () => AppLauncherOnboardingPersistedStore.getTriggeredOnboardingContentMetadata());
const r4 = recentMessageMetadata != null && r19 < recentMessageMetadata.timeMs + c7596_10 && recentMessageMetadata?.channelId === channelId;
const r104 = recentApplicationCommandMetadata != null && r19 < recentApplicationCommandMetadata.timeMs + c7596_11 && recentApplicationCommandMetadata?.channelId === channelId;
const applicationId = recentApplicationCommandMetadata?.applicationId;
const BUILT_IN = BuiltInSectionId.BUILT_IN;
const isDismissibleContentDismissed_UNSAFE = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.APP_LAUNCHER_ONBOARDING_BOTS_BANNER);
let r127 = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.APP_LAUNCHER_ONBOARDING_APPS_BANNER);
const isDismissibleContentDismissed_UNSAFE2 = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.APP_LAUNCHER_ONBOARDING_ACTIVITIES_BANNER);
const r136 = stateFromStores5 != null && stateFromStores5.channelId === channelId && stateFromStores5.timeMs + DAY > r19;
const r141 = {
canShowOnboarding: false,
canShowBotsBanner: false,
canShowAppsOrActivitiesBanner: false,
willShowGlobalSearchOnboarding: false,
fromTriggeredOnboarding: false
};
if (stateFromStores != null) {
if (!((r104 ? applicationId === BUILT_IN : !r104) || isDismissibleContentDismissed_UNSAFE || r66)) {
r141.canShowOnboarding = true;
r141.canShowBotsBanner = true;
}
if (!r39) {
r39 = !r4;
}
if (!r39) {
r39 = !r6;
}
if (!r39) {
r39 = r66;
}
if (!r39) {
if (r127) {
r127 = isDismissibleContentDismissed_UNSAFE2;
}
r39 = r127;
}
if (!r39) {
r141.canShowOnboarding = true;
r141.canShowAppsOrActivitiesBanner = true;
}
if (r83 === APP_LAUNCHER_GLOBAL_SEARCH_ONBOARDING) {
r141.willShowGlobalSearchOnboarding = true;
r141.canShowOnboarding = true;
}
const canShowOnboarding = r141.canShowOnboarding;
if (canShowOnboarding ? !canShowOnboarding : r136) {
r141.canShowOnboarding = true;
r141.canShowBotsBanner = stateFromStores5.canShowBotsBanner;
r141.canShowAppsOrActivitiesBanner = stateFromStores5.canShowAppsOrActivitiesBanner;
r141.willShowGlobalSearchOnboarding = stateFromStores5.willShowGlobalSearchOnboarding;
r141.fromTriggeredOnboarding = true;
}
}
return r141;
};
export { c7596_10 as RECENT_MESSAGE_MS };
@@ -0,0 +1,78 @@
// Metro module 11218 (f11219).
import Module589 from "../../../../../_bundle/Module589";
import Dispatcher from "../../../../../Dispatcher";
let c7597_0 = {
canShowBotsBanner: false,
canShowAppsOrActivitiesBanner: false,
willShowGlobalSearchOnboarding: false,
timeMs: 0,
channelId: "0"
};
let c7597_1 = {
lastSeenTimeMs: null,
triggeredOnboardingContentMetadata: c7597_0
};
class AppLauncherOnboardingPersistedStore extends Module589.PersistedStore {
static displayName = "AppLauncherOnboardingPersistedStore";
static persistKey = "AppLauncherOnboardingPersistedStore";
static migrations = [(a0) => {
let lastSeenTimeMs = a0?.lastSeenTimeMs;
if (lastSeenTimeMs == null) {
lastSeenTimeMs = null;
}
let canShowBotsBanner = a0 == null ? void 0 : a0.triggeredOnboardingContentMetadata?.canShowBotsBanner;
if (canShowBotsBanner == null) {
canShowBotsBanner = c7597_0.canShowBotsBanner;
}
let canShowAppsOrActivitiesBanner = a0 == null ? void 0 : a0.triggeredOnboardingContentMetadata?.canShowAppsOrActivitiesBanner;
if (canShowAppsOrActivitiesBanner == null) {
canShowAppsOrActivitiesBanner = c7597_0.canShowAppsOrActivitiesBanner;
}
let willShowGlobalSearchOnboarding = a0 == null ? void 0 : a0.triggeredOnboardingContentMetadata?.willShowGlobalSearchOnboarding;
if (willShowGlobalSearchOnboarding == null) {
willShowGlobalSearchOnboarding = c7597_0.willShowGlobalSearchOnboarding;
}
let timeMs = a0 == null ? void 0 : a0.triggeredOnboardingContentMetadata?.timeMs;
if (timeMs == null) {
timeMs = c7597_0.timeMs;
}
let channelId = a0 == null ? void 0 : a0.triggeredOnboardingContentMetadata?.channelId;
if (channelId == null) {
channelId = c7597_0.channelId;
}
return {
lastSeenTimeMs,
triggeredOnboardingContentMetadata: {
canShowBotsBanner,
canShowAppsOrActivitiesBanner,
willShowGlobalSearchOnboarding,
timeMs,
channelId
}
};
}];
initialize(a0) {
if (a0 != null) {
c7597_1.lastSeenTimeMs = a0.lastSeenTimeMs;
c7597_1.triggeredOnboardingContentMetadata = a0.triggeredOnboardingContentMetadata;
}
}
getState() {
return c7597_1;
}
getLastSeenTimeMs() {
return c7597_1.lastSeenTimeMs;
}
getTriggeredOnboardingContentMetadata() {
return c7597_1.triggeredOnboardingContentMetadata;
}
}
const appLauncherOnboardingPersistedStore = new AppLauncherOnboardingPersistedStore(Dispatcher, {
APP_LAUNCHER_ONBOARDING_SET_LAST_SEEN_TIME_MS: function handleSetLastSeenTimeMs() {
c7597_1.lastSeenTimeMs = Date.now();
},
APP_LAUNCHER_ONBOARDING_SET_TRIGGERED_ONBOARDING_CONTENT_METADATA: function handleSetTriggeredOnboardingContentMetadata(a0) {
c7597_1.triggeredOnboardingContentMetadata = a0.triggeredOnboardingContentMetadata;
}
});
export default appLauncherOnboardingPersistedStore;
@@ -0,0 +1,47 @@
// Metro module 11219 (f11220).
import UserStore from "../../../../../stores/UserStore";
import SnowflakeUtils from "../../../../../utils/SnowflakeUtils";
import { RECENT_MESSAGE_MS } from "../hooks/useCanShowAppLauncherOnboarding";
import { CommandOrigin } from "../../../../application_commands/ApplicationCommandTypes";
import Module589 from "../../../../../_bundle/Module589";
import Dispatcher from "../../../../../Dispatcher";
let c7598_3, c7598_4;
class AppLauncherOnboardingStore extends Module589.Store {
static displayName = "AppLauncherOnboardingStore";
initialize() {
this.waitFor(UserStore);
}
getRecentMessageMetadata() {
return c7598_3;
}
getRecentApplicationCommandMetadata() {
return c7598_4;
}
}
const appLauncherOnboardingStore = new AppLauncherOnboardingStore(Dispatcher, {
APPLICATION_COMMAND_USED: function handleApplicationCommandUsed(a0) {
const { command, context } = a0;
if (a0.commandOrigin !== CommandOrigin.APPLICATION_LAUNCHER && context.channel != null) {
c7598_4 = {
timeMs: Date.now(),
applicationId: command.applicationId,
guildId: context.guild?.id,
channelId: context.channel.id
};
}
},
MESSAGE_CREATE: function handleMessageCreate({ channelId, guildId, message }) {
const currentUser = UserStore.getCurrentUser();
if (currentUser != null && currentUser.id != null && message.author != null && currentUser.id === message.author.id) {
const timeMs = SnowflakeUtils.extractTimestamp(message.id);
if (!(Date.now() > timeMs + RECENT_MESSAGE_MS)) {
c7598_3 = {
timeMs,
guildId,
channelId
};
}
}
}
});
export default appLauncherOnboardingStore;
@@ -0,0 +1,14 @@
// Metro module 11220 (f11221).
import { UNSAFE_markDismissibleContentAsDismissed } from "../../../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
export default function completeAppLauncherOnboarding(a0) {
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.APP_LAUNCHER_ONBOARDING_ACTIVITIES_BANNER, {
dismissAction: a0
});
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.APP_LAUNCHER_ONBOARDING_BOTS_BANNER, {
dismissAction: a0
});
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.APP_LAUNCHER_ONBOARDING_APPS_BANNER, {
dismissAction: a0
});
};
@@ -0,0 +1,206 @@
// Metro module 11340 (f11341).
import { View } from "react-native";
import { AppLauncherOptionAutoFocusType } from "../AppLauncherNativeConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { ApplicationCommandOptionType } from "../../../../flow/Server";
import AppLauncherChoicesOption from "./choices/AppLauncherChoicesOption";
import AppLauncherAutocompleteOption from "./autocomplete/AppLauncherAutocompleteOption";
import AppLauncherTextInputOption from "./text_input/AppLauncherTextInputOption";
import AppLauncherAttachmentOption from "./attachment/AppLauncherAttachmentOption";
import AppLauncherBooleanOption from "./boolean/AppLauncherBooleanOption";
import AppLauncherMentionableOption from "./mentionable/AppLauncherMentionableOption";
import { MentionableItemTypes } from "./mentionable/AppLauncherMentionableListActionSheet";
import AutocompleteUtils from "../../../../utils/native/AutocompleteUtils";
import AppLauncherRoleOption from "./role/AppLauncherRoleOption";
import AppLauncherUserOption from "./user/AppLauncherUserOption";
import AppLauncherChannelOption from "./channel/AppLauncherChannelOption";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { CircleXIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleXIcon";
const useStyles = createStyles({
dismissableOptionWrapper: {
flexDirection: "row",
alignItems: "center"
},
optionViewContainer: {
flex: 1
},
dismissButton: {
marginLeft: 8,
marginRight: -4,
padding: 4,
borderRadius: Module712.radii.round
},
option: {
flex: 1
}
});
export default function AppLauncherCommandOption(props) {
let r80, r185, styles;
let option, onStartEditing, onEndEditing2, onOptionValueChange, onPress2, onDismiss;
L39: {
option = props.option;
onStartEditing = props.onStartEditing;
onEndEditing2 = props.onEndEditing;
onOptionValueChange = props.onOptionValueChange;
onPress2 = props.onPress;
const onPressAttachmentOption = props.onPressAttachmentOption;
onDismiss = props.onDismiss;
const { onFocus, channel, autoFocusType, command, optionValues, hasError } = props;
styles = useStyles();
const type = option.type;
if (ApplicationCommandOptionType.STRING !== type && ApplicationCommandOptionType.INTEGER !== type && ApplicationCommandOptionType.NUMBER !== type) {
if (ApplicationCommandOptionType.ATTACHMENT === type) {
r80 = <AppLauncherAttachmentOption key={option.name} style={styles.option} option={option} onSelectAttachment={(event) => {
onEndEditing2(option);
onOptionValueChange(option, event != null ? [{
type: "text",
text: event
}] : []);
}} channel={channel} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} hasError={hasError} onPress={onPressAttachmentOption} />;
break L39;
}
if (ApplicationCommandOptionType.BOOLEAN === type) {
const r143 = optionValues.current[option.name];
r80 = <AppLauncherBooleanOption key={option.name} style={styles.option} option={option} initialValue={r143 == null ? void 0 : r143[0]} onPress={(event) => {
onPress2();
onEndEditing2(option);
onOptionValueChange(option, [{
type: "text",
text: event.toString()
}]);
}} hasError={hasError} />;
break L39;
}
if (ApplicationCommandOptionType.MENTIONABLE === type) {
const r125 = optionValues.current[option.name];
r80 = <AppLauncherMentionableOption option={option} initialValue={r125 == null ? void 0 : r125[0]} onMentionablePress={({ mentionable }) => {
if (mentionable != null) {
const type = mentionable.type;
if (MentionableItemTypes.USER === type) {
onOptionValueChange(option, [{
type: "userMention",
userId: mentionable.result.user.id
}]);
} else if (MentionableItemTypes.ROLE === type) {
onOptionValueChange(option, [{
type: "roleMention",
roleId: mentionable.result.id
}]);
} else if (MentionableItemTypes.GLOBAL === type) {
const result = mentionable.result;
if (result.text === AutocompleteUtils.MENTION_EVERYONE().text) {
onOptionValueChange(option, [{
type: "textMention",
text: "@everyone"
}]);
} else {
onOptionValueChange(option, [{
type: "text",
text: result.text
}]);
}
}
} else {
onOptionValueChange(option, []);
}
}} onActionSheetDismiss={() => onEndEditing2(option)} channel={channel} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} hasError={hasError} onPress={onPress2} />;
break L39;
}
if (ApplicationCommandOptionType.ROLE === type) {
const r107 = optionValues.current[option.name];
r80 = <AppLauncherRoleOption key={option.name} style={styles.option} option={option} initialValue={r107 == null ? void 0 : r107[0]} onRolePress={({ role }) => {
onOptionValueChange(option, role == null ? [] : [{
type: "roleMention",
roleId: role.id
}]);
}} onActionSheetDismiss={() => {
onEndEditing2(option);
}} channel={channel} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} hasError={hasError} onPress={onPress2} />;
break L39;
}
if (ApplicationCommandOptionType.USER === type) {
const r88 = optionValues.current[option.name];
r80 = <AppLauncherUserOption key={option.name} style={styles.option} option={option} initialValue={r88 == null ? void 0 : r88[0]} onUserPress={({ user }) => {
let r8;
if (user == null) {
r8 = [];
} else {
let userId = user;
if (typeof userId !== "string") {
userId = user.id;
}
r8 = [{
type: "userMention",
userId
}];
}
onOptionValueChange(option, r8);
}} onActionSheetDismiss={() => onEndEditing2(option)} channel={channel} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} hasError={hasError} onPress={onPress2} />;
break L39;
}
if (ApplicationCommandOptionType.CHANNEL === type) {
const r70 = optionValues.current[option.name];
r80 = <AppLauncherChannelOption key={option.name} style={styles.option} option={option} initialValue={r70 == null ? void 0 : r70[0]} onChannelPress={({ channel }) => {
onOptionValueChange(option, channel != null ? [{
type: "channelMention",
channelId: channel.id
}] : []);
}} onActionSheetDismiss={() => {
onEndEditing2(option);
}} channel={channel} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} hasError={hasError} onPress={onPress2} />;
break L39;
}
return null;
}
if (option.choices != null) {
const r212 = optionValues.current[option.name];
r185 = <AppLauncherChoicesOption key={option.name} style={styles.option} option={option} initialValue={r212 == null ? void 0 : r212[0]} onSelect={(event) => {
onEndEditing2(option);
let text = event?.displayName;
if (text == null) {
text = "";
}
onOptionValueChange(option, [{
type: "text",
text
}]);
}} onOpenChoicesSheet={() => {
onPress2();
onStartEditing(option);
}} onDismissChoicesSheet={() => onEndEditing2(option)} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} hasError={hasError} />;
} else if (option.autocomplete) {
const r193 = optionValues.current[option.name];
r185 = <AppLauncherAutocompleteOption key={option.name} style={styles.option} channel={channel} option={option} activeCommand={command} optionValues={optionValues} initialValue={r193 == null ? void 0 : r193[0]} autoFocus={autoFocusType === AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED} onSelect={(event) => {
onEndEditing2(option);
let text = event?.displayName;
if (text == null) {
text = "";
}
onOptionValueChange(option, [{
type: "text",
text
}]);
}} onOpenAutocompleteSheet={() => {
onPress2();
onStartEditing(option);
}} onDismissAutocompleteSheet={() => onEndEditing2(option)} hasError={hasError} />;
} else {
const r174 = optionValues.current[option.name];
r185 = <AppLauncherTextInputOption key={option.name} style={styles.option} option={option} guildId={channel.guild_id} initialValue={r174 == null ? void 0 : r174[0]} onEndEditing={() => onEndEditing2(option)} onChangeText={(a0) => {
onStartEditing(option);
onOptionValueChange(option, [{
type: "text",
text: a0
}]);
}} onFocus={onFocus} autoFocus={[AppLauncherOptionAutoFocusType.FIRST_REQUIRED_OPTION, AppLauncherOptionAutoFocusType.OPTIONAL_OPTION_ADDED].includes(autoFocusType)} hasError={hasError} onPressIn={onPress2} />;
}
r80 = r185;
}
return onDismiss != null ? <View style={styles.dismissableOptionWrapper}>
<View style={styles.optionViewContainer}>{r80}</View>
<PressableOpacity style={styles.dismissButton} onPress={() => onDismiss(option)}>
<CircleXIcon size="md" />
</PressableOpacity>
</View> : r80;
};
@@ -0,0 +1,48 @@
// Metro module 11343 (f11344).
import { View } from "react-native";
import { DEFAULT_CONTENT_PADDING } from "../AppLauncherNativeConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { ActionSheetCloseButton } from "../../../../design/components/Sheet/native/ActionSheetCloseButton.native";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { Spacer } from "../../../../design/void/native";
const useStyles = createStyles({
actionSheetBackground: {
backgroundColor: Module712.colors.MOBILE_KEYBOARD_PANEL_BACKGROUND
},
titleContainer: {
backgroundColor: "transparent"
},
titleWrapper: {
alignItems: "center"
},
subtitleWrapper: {
paddingHorizontal: 12,
textAlign: "center"
},
contentContainer: {
paddingHorizontal: DEFAULT_CONTENT_PADDING,
paddingTop: DEFAULT_CONTENT_PADDING,
flex: 1
}
});
export function AppLauncherCommandOptionActionSheet(props) {
const { option, children, contentContainerStyles, scrollable = true, startExpanded = true, ...props2 } = props;
let c18763_0 = props2;
const styles = useStyles();
return <BottomSheet key={option.name} {...props2} backgroundStyles={styles.actionSheetBackground} scrollable={scrollable} startExpanded={startExpanded} header={<BottomSheetTitleHeader titleContainerStyle={styles.titleContainer} titleWrapperStyle={styles.titleWrapper} subtitleStyle={styles.subtitleWrapper} leading={<View style={{
alignSelf: "flex-start"
}}>
<ActionSheetCloseButton onPress={() => {
ActionSheetActionCreators.hideActionSheet();
const onDismiss = c18763_0.onDismiss;
if (onDismiss != null) {
onDismiss.call(c18763_0);
}
}} />
</View>} title={option.displayName} subtitle={option.displayDescription} trailing={<Spacer size={24} />} />}>
<View style={[styles.contentContainer, contentContainerStyles]}>{children}</View>
</BottomSheet>;
}
@@ -0,0 +1,65 @@
// Metro module 11352 (f11353).
import { useEffect, useRef } from "react";
import { View } from "react-native";
import { DraftType } from "../../../../../stores/DraftStore";
import UploadAttachmentStore from "../../../../../stores/UploadAttachmentStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import AttachmentPreview from "../../../../media/native/AttachmentPreview";
import { FileIcon } from "../../../../../design/components/Icon/native/redesign/generated/FileIcon";
import { ApplicationCommandOptionType } from "../../../../../flow/Server";
import { useFileTypesFormattedString } from "../../../../interactions/FileTypeFiltering";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import UploadAttachmentActionCreators from "../../../../../actions/UploadAttachmentActionCreators";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import { intl, t } from "../../../../../intl/index.native";
import { UploadPlatform } from "../../../../../lib/uploader/Upload";
import { ImageFileIcon } from "../../../../../design/components/Icon/native/redesign/generated/ImageFileIcon";
let useStyles;
const AttachmentPreviewAppLauncher = function AttachmentPreviewAppLauncher(props) {
const { uri, isImage, isVideo } = props;
const styles = useStyles();
const selectedImage = styles.selectedImage;
return <AttachmentPreview uri={uri} isImage={isImage} isVideo={isVideo} width={selectedImage.width} height={selectedImage.height} style={styles.selectedImage} defaultPreview={<FileIcon size="sm" />} />;
};
useStyles = createStyles({
imageIconWrapper: {
justifyContent: "center",
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
width: 32,
height: 32,
borderRadius: Module712.radii.lg
},
selectedImage: {
width: 32,
height: 32,
borderRadius: Module712.radii.sm
}
});
export default function AppLauncherAttachmentOption(props) {
let ref;
const { option, channel, style, autoFocus, hasError, onPress, onSelectAttachment } = props;
ref = void 0;
const styles = useStyles();
const fileTypesFormattedString = useFileTypesFormattedString(option.type === ApplicationCommandOptionType.ATTACHMENT ? option.fileTypes : void 0);
const stateFromStores = useStateFromStores([UploadAttachmentStore], () => UploadAttachmentStore.getUpload(channel.id, option.name, DraftType.ApplicationLauncherCommand));
useEffect(() => () => UploadAttachmentActionCreators.remove(channel.id, option.name, DraftType.ApplicationLauncherCommand), [channel.id, option.name]);
ref = useRef(onSelectAttachment);
useEffect(() => {
ref.current = onSelectAttachment;
});
useEffect(() => {
if (stateFromStores?.filename != null) {
const current = ref.current;
if (current != null) {
current.call(ref, stateFromStores.filename);
}
}
}, [stateFromStores?.filename]);
return <AppLauncherSelectOptionFormRow style={style} hasError={hasError} option={option} selected={stateFromStores != null} selectedItemName={stateFromStores != null ? stateFromStores.filename : void 0} unselectedSubLabel={fileTypesFormattedString != null ? intl.format(t.NRRxmz, {
types: fileTypesFormattedString
}) : void 0} leading={stateFromStores != null && stateFromStores.item.platform === UploadPlatform.REACT_NATIVE ? <AttachmentPreviewAppLauncher uri={stateFromStores.item.uri} isImage={stateFromStores.isImage} isVideo={stateFromStores.isVideo} /> : <View style={styles.imageIconWrapper}>
<ImageFileIcon size="sm" color="interactive-text-default" />
</View>} onPress={onPress} autoFocus={autoFocus} />;
};
@@ -0,0 +1,175 @@
// Metro module 11348 (f11349).
import { useMemo, useState, useRef, useEffect, useCallback } from "react";
import { View } from "react-native";
import ApplicationCommandAutocompleteStore from "../../../../application_commands/ApplicationCommandAutocompleteStore";
import GuildStore from "../../../../../stores/GuildStore";
import { AutoCompleteResultTypes } from "../../../../../Constants";
import { AUTOCOMPLETE_OPTION_DEBOUNCE_TIME } from "../../../../application_commands/ApplicationCommandConstants";
import Module12 from "../../../../../_bundle/Module12";
import executeCommand from "../../../../application_commands/executeCommand";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStoresObject } from "../../../../../_bundle/defaultAreStatesEqual";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import { AppLauncherListSearchBar, AppLauncherListEmptyState, AppLauncherList } from "../../base_components/AppLauncherList";
import { intl, t } from "../../../../../intl/index.native";
import Module38 from "../../../../../_bundle/Module38";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
import { match } from "../../../../../_bundle/Module4389";
import { Text } from "../../../../../design/components/Text/native/Text";
import { EmptyState } from "../../../../../design/void/native";
import Module11345 from "../../../../../_bundle/Module11345";
let c7706_11, useStyles, AutocompleteFailedEmptyState;
const Item = function Item({ item, index, choices, onChoiceSelect }) {
let styles, memo;
styles = void 0;
memo = void 0;
const ListItem2 = function ListItem(props) {
return <TableRow label={props.label} onPress={props.onPress} start={index === 0} end={index === choices.length - 1} />;
};
Module38(item.type === AutoCompleteResultTypes.CHOICE || item.type === AutoCompleteResultTypes.CHOICE_LOADING || item.type === AutoCompleteResultTypes.LABEL, "Invalid autocomplete result type");
styles = useStyles();
memo = useMemo(() => 100 * Math.random() + 50, []);
return match(item).with({
type: AutoCompleteResultTypes.CHOICE
}, (a0) => {
return <ListItem2 label={<Text lineClamp={1} variant="text-md/normal" color="mobile-text-heading-primary">{a0.choice.displayName}</Text>} onPress={() => {
if (onChoiceSelect != null) {
onChoiceSelect(a0.choice);
}
ActionSheetActionCreators.hideActionSheet();
}} />;
}).with({
type: AutoCompleteResultTypes.LABEL
}, (a0) => {
return <ListItem2 label={<Text lineClamp={1} variant="text-md/normal" color="mobile-text-heading-primary">
"
{a0.label}
"
</Text>} onPress={() => {
if (onChoiceSelect != null) {
onChoiceSelect({
name: a0.label,
value: a0.label,
displayName: a0.label
});
}
ActionSheetActionCreators.hideActionSheet();
}} />;
}).with({
type: AutoCompleteResultTypes.CHOICE_LOADING
}, () => <ListItem2 label={<View style={styles.commandChoiceLoadingContainer}>
<View style={[styles.commandChoiceLoadingItem, {
width: memo
}]} />
</View>} />).exhaustive();
};
AutocompleteFailedEmptyState = function AutocompleteFailedEmptyState() {
return <EmptyState style={useStyles().emptyState} lightSource={Module11345} darkSource={Module11345} title={intl.string(t.rTAbPn)} />;
};
c7706_11 = Module12.debounce(executeCommand, AUTOCOMPLETE_OPTION_DEBOUNCE_TIME, {
leading: true,
trailing: true
});
useStyles = createStyles({
commandChoiceLoadingContainer: {
flex: 1,
justifyContent: "center"
},
commandChoiceLoadingItem: {
backgroundColor: Module712.colors.BACKGROUND_MOD_MUTED,
height: 16,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start"
},
emptyState: {
backgroundColor: "transparent"
}
});
export default function AppLauncherAutocompleteActionSheet(props) {
let autocompleteResults, lastErrored, memo2;
const { option, initChoice, onChoiceSelect: onChoiceSelect2, onDismissAutocompleteSheet, channel, activeCommand, optionValues } = props;
autocompleteResults = void 0;
lastErrored = void 0;
memo2 = void 0;
let r6 = initChoice?.name;
if (r6 == null) {
r6 = "";
}
const [state, onChange] = useState(r6);
const ref = useRef(null);
const stateFromStoresObject = useStateFromStoresObject([ApplicationCommandAutocompleteStore], () => ({
autocompleteResults: ApplicationCommandAutocompleteStore.getAutocompleteChoices(channel.id, option.name, state),
lastErrored: ApplicationCommandAutocompleteStore.getLastErrored(channel.id)
}), [channel.id, option.name, state]);
autocompleteResults = stateFromStoresObject.autocompleteResults;
let lastErrored2 = stateFromStoresObject.lastErrored;
lastErrored = lastErrored2;
memo2 = useMemo(() => {
const r2 = [];
if (state !== "") {
r2.push({
type: AutoCompleteResultTypes.LABEL,
label: state
});
}
if (autocompleteResults == null && !lastErrored) {
r2.push.apply(r2, [...new Array(4).fill({
type: AutoCompleteResultTypes.CHOICE_LOADING
})]);
} else if (autocompleteResults != null) {
r2.push.apply(r2, [...autocompleteResults.map((autocompleteResult) => ({
type: AutoCompleteResultTypes.CHOICE,
choice: autocompleteResult
}))]);
}
return r2;
}, [state, autocompleteResults, lastErrored]);
let r44 = memo2.length === 0 && !lastErrored;
useEffect(() => {
c7706_11({
command: activeCommand,
optionValues,
context: {
channel,
guild: GuildStore.getGuild(channel.guild_id),
autocomplete: {
name: option.name,
query: state
}
}
});
const current = ref.current;
if (current != null) {
current.scrollToOffset({
offset: 0,
animated: false
});
}
}, [channel, option.name, activeCommand, optionValues, state]);
const callback = useCallback((a0) => <Item item={a0.item} index={a0.index} onChoiceSelect={onChoiceSelect2} choices={memo2} />, [onChoiceSelect2, memo2]);
const callback2 = useCallback(() => {
if (state !== "") {
if (onChoiceSelect2 != null) {
onChoiceSelect2({
name: state,
value: state,
displayName: state
});
}
ActionSheetActionCreators.hideActionSheet();
}
}, [onChoiceSelect2, state]);
const r78 = [<AppLauncherListSearchBar placeholder={intl.string(t.Wuie9L)} onChange={onChange} autoFocus returnKeyType="done" onSubmitEditing={callback2} />, , , ,];
if (r44) {
r44 = <AppLauncherListEmptyState />;
}
r78[1] = r44;
r78[2] = <AppLauncherList ref={ref} keyExtractor={(item, index) => `${item.type === AutoCompleteResultTypes.CHOICE ? item.choice.name : "placeholder"}_${index}`} data={memo2} renderItem={callback} scrollEnabled />;
if (lastErrored) {
lastErrored2 = <AutocompleteFailedEmptyState />;
}
r78[3] = lastErrored2;
return <AppLauncherCommandOptionActionSheet option={option} onDismiss={onDismissAutocompleteSheet}>{r78}</AppLauncherCommandOptionActionSheet>;
};
@@ -0,0 +1,79 @@
// Metro module 11347 (f11348).
import { useState } from "react";
import { Fonts } from "../../../../../Constants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { dismissGlobalKeyboard } from "../../../../../utils/native/KeyboardManagerUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { useAnimationDelayedAutoFocus } from "../../hooks/useAnimationDelayedAutoFocus";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { Text } from "../../../../../design/components/Text/native/Text";
const useStyles = createStyles({
container: {
width: "100%",
backgroundColor: Module712.colors.INPUT_BACKGROUND_DEFAULT,
borderRadius: Module712.radii.lg,
padding: 12,
borderWidth: 2,
borderColor: "transparent",
flexDirection: "row",
alignItems: "center"
},
hasError: {
borderColor: Module712.colors.BORDER_FEEDBACK_CRITICAL,
padding: 12
},
inputText: {
fontSize: 16,
alignSelf: "center",
fontFamily: Fonts.PRIMARY_MEDIUM,
color: Module712.colors.TEXT_DEFAULT
}
});
export default function AppLauncherAutocompleteOption(props) {
let state, setState;
const { style, option, onSelect, onOpenAutocompleteSheet, onDismissAutocompleteSheet, channel, activeCommand, optionValues, initialValue, autoFocus } = props;
let hasError = props.hasError;
state = void 0;
setState = void 0;
const onPress = function onPress() {
if (onOpenAutocompleteSheet != null) {
onOpenAutocompleteSheet();
}
dismissGlobalKeyboard();
ActionSheetActionCreators.openLazy(import("./AppLauncherAutocompleteActionSheet"), "AppLauncherAutocompleteActionSheet", {
option,
initChoice: state,
onChoiceSelect: (a0) => {
setState(a0);
onSelect(a0);
},
channel,
activeCommand,
onDismissAutocompleteSheet,
optionValues: optionValues.current
});
};
[state, setState] = useState(() => {
if (initialValue != null && initialValue.type === "text" && initialValue.text !== "") {
return {
displayName: initialValue.text,
name: initialValue.text,
value: initialValue.text
};
}
});
const styles = useStyles();
useAnimationDelayedAutoFocus(autoFocus, onPress);
const style2 = [styles.container, , ,];
if (hasError) {
hasError = styles.hasError;
}
style2[1] = hasError;
style2[2] = style;
return <PressableOpacity onPress={onPress} style={style2}>
<Text variant="text-md/normal" style={styles.inputText}>
{state != null ? state.displayName : " "}
</Text>
</PressableOpacity>;
};
@@ -0,0 +1,26 @@
// Metro module 11354 (f11355).
import { useState } from "react";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { FormCheckboxRow } from "../../../../../design/void/Form/native/index";
const useStyles = createStyles({
container: {
flexDirection: "row",
width: "100%",
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.lg,
alignItems: "center"
}
});
export default function AppLauncherBooleanOption(props) {
let state, setState;
const { style, option, initialValue, onPress: onPress2, hasError } = props;
state = void 0;
setState = void 0;
const styles = useStyles();
[state, setState] = useState(() => initialValue != null && initialValue.type === "text" && initialValue.text === "true");
return <FormCheckboxRow start end style={[styles.container, style]} hasError={hasError} label={option.displayName} selected={state} onPress={() => {
setState(!state);
onPress2(!state);
}} />;
};
@@ -0,0 +1,81 @@
// Metro module 11365 (f11366).
import { useState, useRef, useEffect } from "react";
import GuildStore from "../../../../../stores/GuildStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { TextIcon } from "../../../../../design/components/Icon/native/redesign/generated/TextIcon";
import { getChannelIconComponentWithGuild } from "../../../../../utils/native/ChannelUtils";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import AutocompleteUtils from "../../../../../utils/AutocompleteUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import { AppLauncherListSearchBar, AppLauncherListEmptyState, AppLauncherList } from "../../base_components/AppLauncherList";
import useChannelName from "../../../../channel/useChannelName";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
import { Text } from "../../../../../design/components/Text/native/Text";
let c7722_8, useStyles, ChannelListItem;
const ChannelIcon = function ChannelIcon(props) {
const { channel: channel2, size = "sm", wrapperSize = 32 } = props;
const styles = useStyles();
let TextIcon2 = TextIcon;
if (channel2 != null) {
let r23 = getChannelIconComponentWithGuild(channel2, GuildStore.getGuild(channel2.getGuildId()));
if (r23 == null) {
r23 = TextIcon;
}
TextIcon2 = r23;
}
return <AppLauncherOptionIcon icon={<TextIcon2 size={size} color="interactive-text-default" />} wrapperStyle={styles.channelIconWrapper} wrapperSize={wrapperSize} />;
};
ChannelListItem = function ChannelListItem(props) {
const { channel: channel2, index, totalCount } = props;
return <TableRow key={channel2.id} onPress={props.onPress} label={<Text lineClamp={1} variant="text-md/semibold" color="mobile-text-heading-primary">
{useChannelName(channel2)}
</Text>} icon={<ChannelIcon channel={channel2} />} start={index === 0} end={index === totalCount - 1} />;
};
c7722_8 = "AppLauncherChannelListActionSheet";
useStyles = createStyles({
channelIconWrapper: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
}
});
export default function AppLauncherChannelListActionSheet(props) {
const { onChannelPress, onActionSheetDismiss, channel, option } = props;
const [state, setState] = useState("");
const ref = useRef(null);
const [state2, setState2] = useState([]);
const length = state2.length;
useEffect(() => {
setState2(AutocompleteUtils.queryApplicationCommandChannelResults({
query: state,
channel,
channelTypes: option.channelTypes,
limit: null,
allowSnowflake: true
}).channels);
}, [state, channel, option]);
return <AppLauncherCommandOptionActionSheet onDismiss={onActionSheetDismiss} option={option}>
<AppLauncherListSearchBar onChange={function onChange(event) {
setState(event.toLowerCase());
const current = ref.current;
if (current != null) {
current.scrollToOffset({
offset: 0,
animated: false
});
}
}} />
{length === 0 ? <AppLauncherListEmptyState /> : <AppLauncherList ref={ref} data={state2} renderItem={function renderItem(info) {
const item = info.item;
return <ChannelListItem channel={item} index={info.index} totalCount={state2.length} onPress={() => {
onChannelPress({
channel: item
});
ActionSheetActionCreators.hideActionSheet(c7722_8);
onActionSheetDismiss();
}} />;
}} />}
</AppLauncherCommandOptionActionSheet>;
};
export const APP_LAUNCHER_CHANNEL_LIST_ACTION_SHEET_KEY = "AppLauncherChannelListActionSheet";
export { ChannelIcon };
@@ -0,0 +1,42 @@
// Metro module 11364 (f11365).
import { useState, useEffect } from "react";
import ChannelStore from "../../../../../stores/ChannelStore";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import useChannelName from "../../../../channel/useChannelName";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import { ChannelIcon, APP_LAUNCHER_CHANNEL_LIST_ACTION_SHEET_KEY } from "./AppLauncherChannelListActionSheet";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
export default function AppLauncherChannelOption(props) {
let state, setState, stateFromStores;
const { style, option, initialValue, onChannelPress: onChannelPress2, onActionSheetDismiss, channel, autoFocus, hasError, onPress: onPress2 } = props;
state = void 0;
setState = void 0;
stateFromStores = void 0;
[state, setState] = useState(() => initialValue != null ? initialValue.type === "channelMention" ? initialValue.channelId : null : null);
stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(state), [state]);
useEffect(() => {
if (state != null && stateFromStores == null) {
setState(null);
onChannelPress2({
channel: null
});
}
}, [onChannelPress2, state, stateFromStores]);
const channelName = useChannelName(stateFromStores);
return <AppLauncherSelectOptionFormRow style={style} option={option} hasError={hasError} selected={stateFromStores != null} selectedItemName={stateFromStores != null ? channelName : void 0} leading={<ChannelIcon channel={stateFromStores} />} onPress={function onPress() {
if (onPress2 != null) {
onPress2();
}
ActionSheetActionCreators.openLazy(import("./AppLauncherChannelListActionSheet"), APP_LAUNCHER_CHANNEL_LIST_ACTION_SHEET_KEY, {
option,
channel,
onChannelPress: ({ channel: channel2 }) => {
setState(channel2?.id);
onChannelPress2({
channel: channel2
});
},
onActionSheetDismiss
});
}} autoFocus={autoFocus} />;
};
@@ -0,0 +1,101 @@
// Metro module 11342 (f11343).
import { useState, useCallback } from "react";
import { View } from "react-native";
import { DEFAULT_CONTENT_PADDING } from "../../AppLauncherNativeConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { BottomSheetFlashList, FlashList } from "../../../../../_bundle/noop_6676";
import useSafeAreaInsets_native from "../../../../safe_area/useSafeAreaInsets.native";
import { isIOS } from "../../../../../utils/PlatformUtils";
import AutocompleteUtils from "../../../../../utils/AutocompleteUtils";
import { FormRadioRow, FormDivider } from "../../../../../design/void/Form/native/index";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import useIsWindowLarge from "../../../../screen/native/useIsWindowLarge";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import { AppLauncherListSearchBar, AppLauncherListEmptyState } from "../../base_components/AppLauncherList";
let useStyles;
const FlashListWrapper = function FlashListWrapper(props) {
const { scrollable, ...props2 } = props;
return scrollable ? <BottomSheetFlashList preserveScrollMomentum {...props2} /> : <FlashList scrollEnabled={false} {...props2} />;
};
useStyles = createStyles({
listItemContainer: {
overflow: "hidden"
},
listItem: {
backgroundColor: Module712.colors.CARD_BACKGROUND_DEFAULT
},
firstItem: {
borderTopLeftRadius: Module712.radii.xl,
borderTopRightRadius: Module712.radii.xl
},
lastItem: {
borderBottomLeftRadius: Module712.radii.xl,
borderBottomRightRadius: Module712.radii.xl
},
divider: {
backgroundColor: Module712.colors.BORDER_SUBTLE,
marginLeft: 16
}
});
export default function AppLauncherChoicesActionSheet(props) {
let state, setState, state2, setState2;
const { option, initChoiceIndex, onChoiceSelect, onDismiss } = props;
state = void 0;
setState = void 0;
state2 = void 0;
setState2 = void 0;
const styles = useStyles();
const bottom = useSafeAreaInsets_native().bottom;
const paddingBottom = isIOS() ? bottom : bottom + DEFAULT_CONTENT_PADDING;
[state, setState] = useState(() => {
let choices = option.choices;
if (choices == null) {
choices = [];
}
return choices.map((a0, index) => ({
choice: a0,
originalIndex: index
}));
});
[state2, setState2] = useState(initChoiceIndex);
const callback = useCallback((a0) => {
let choices = option.choices;
if (choices == null) {
choices = [];
}
setState(AutocompleteUtils.queryChoice({
query: a0,
choices,
limit: null
}));
}, [option.choices]);
const callback2 = useCallback(({ item, index }) => {
let r11 = state != null && index === state.length - 1;
const originalIndex = item.originalIndex;
const style = [styles.listItemContainer, index === 0 && styles.firstItem, ,];
if (r11) {
r11 = styles.lastItem;
}
const selected = state2 === originalIndex;
style[2] = r11;
return <View style={style}>
<FormRadioRow style={[styles.listItem]} label={item.choice.displayName} align="right" selected={selected} onPress={() => {
setState2(item.originalIndex);
onChoiceSelect(item.choice, item.originalIndex);
ActionSheetActionCreators.hideActionSheet();
}} />
</View>;
}, [onChoiceSelect, state2, styles, state]);
const callback3 = useCallback(() => <FormDivider style={styles.divider} />, [styles.divider]);
const isWindowLarge = useIsWindowLarge();
const startExpanded = option.choices != null && option.choices?.length >= (isWindowLarge ? 10 : 5);
return <AppLauncherCommandOptionActionSheet option={option} startExpanded={startExpanded} onDismiss={onDismiss} scrollable={startExpanded}>
{startExpanded && <AppLauncherListSearchBar onChange={callback} />}
{state.length === 0 ? <AppLauncherListEmptyState /> : <FlashListWrapper scrollable={startExpanded} contentContainerStyle={{
paddingBottom
}} scrollIndicatorInsets={{
bottom: paddingBottom
}} keyExtractor={(item) => `${item.choice.name}_${item.originalIndex}`} data={state} renderItem={callback2} ItemSeparatorComponent={callback3} accessibilityRole="radiogroup" />}
</AppLauncherCommandOptionActionSheet>;
};
@@ -0,0 +1,54 @@
// Metro module 11341 (f11342).
import { useState, useCallback } from "react";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { dismissGlobalKeyboard } from "../../../../../utils/native/KeyboardManagerUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { useAnimationDelayedAutoFocus } from "../../hooks/useAnimationDelayedAutoFocus";
import { FormRow, FormArrow } from "../../../../../design/void/Form/native/index";
import { Text } from "../../../../../design/components/Text/native/Text";
const useStyles = createStyles({
container: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.lg,
alignItems: "center",
padding: 12
}
});
export default function AppLauncherChoicesOption(props) {
let state, setState;
const { style, option, initialValue, onSelect, onOpenChoicesSheet, onDismissChoicesSheet, autoFocus, hasError } = props;
state = void 0;
setState = void 0;
const styles = useStyles();
[state, setState] = useState(() => {
if (initialValue != null && initialValue.type === "text") {
const choices = option.choices;
const choice = choices == null ? void 0 : choices.find((choice) => choice.displayName === initialValue.text);
if (choice != null) {
return {
choice,
index: option.choices.indexOf(choice)
};
}
}
});
const callback = useCallback(() => {
onOpenChoicesSheet();
dismissGlobalKeyboard();
ActionSheetActionCreators.openLazy(import("./AppLauncherChoicesActionSheet"), "AppLauncherChoicesActionSheet", {
option,
initChoiceIndex: state?.index,
onChoiceSelect: (a0, a1) => {
setState({
choice: a0,
index: a1
});
onSelect(a0);
},
onDismiss: onDismissChoicesSheet
});
}, [onDismissChoicesSheet, onOpenChoicesSheet, onSelect, option, state?.index]);
useAnimationDelayedAutoFocus(autoFocus, callback);
return <FormRow start end style={[styles.container, style]} hasError={hasError} label={<Text variant={state == null ? "text-md/medium" : "text-sm/medium"} color={state == null ? "text-default" : "interactive-text-default"} lineClamp={1}>{option.displayName}</Text>} subLabel={state != null ? <Text variant="text-md/medium" color="text-default" lineClamp={1}>{state.choice.displayName}</Text> : null} trailing={<FormArrow />} onPress={callback} />;
};
@@ -0,0 +1,99 @@
// Metro module 11357 (f11358).
import { useState, useRef, useEffect } from "react";
import { RelationshipTypes } from "../../../../../Constants";
import { getApplicationCommandOptionQueryOptions } from "../../../../application_commands/ApplicationCommandUtils";
import AutocompleteUtils from "../../../../../utils/AutocompleteUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import { AppLauncherListSearchBar, AppLauncherListEmptyState, AppLauncherList } from "../../base_components/AppLauncherList";
import UserRow from "../../../../main_tabs_v2/native/shared_components/user_list/UserRow";
import { Text } from "../../../../../design/components/Text/native/Text";
import { getUserTag } from "../../../../../utils/UserUtils";
import { RoleRow, RoleIcon } from "../role/AppLauncherRoleListActionSheet";
import AutocompleteUtils2 from "../../../../../utils/native/AutocompleteUtils";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import { UserCircleIcon } from "../../../../../design/components/Icon/native/redesign/generated/UserCircleIcon";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
let c7714_8 = "AppLauncherMentionableListActionSheet";
let c7714_9 = {
USER: "user",
ROLE: "role",
GLOBAL: "global"
};
export default function AppLauncherMentionableListActionSheet(props) {
const { onMentionablePress, onActionSheetDismiss, channel, option } = props;
const [state, setState] = useState("");
const ref = useRef(null);
const [state2, setState2] = useState([]);
const guild_id = channel.guild_id;
const length = state2.length;
useEffect(() => {
const applicationCommandOptionQueryOptions = getApplicationCommandOptionQueryOptions(option);
const r27 = AutocompleteUtils.queryMentionResults({
query: state,
channel,
canMentionEveryone: applicationCommandOptionQueryOptions.canMentionEveryone,
canMentionHere: applicationCommandOptionQueryOptions.canMentionHere,
canMentionUsers: applicationCommandOptionQueryOptions.canMentionUsers,
canMentionRoles: applicationCommandOptionQueryOptions.canMentionRoles,
includeAllGuildUsers: applicationCommandOptionQueryOptions.canMentionAnyGuildUser,
includeNonMentionableRoles: applicationCommandOptionQueryOptions.canMentionNonMentionableRoles,
request: true,
limit: 10,
allowSnowflake: true
});
setState2([...r27.users.map((user) => ({
type: c7714_9.USER,
result: user
})), ...r27.roles.map((role) => ({
type: c7714_9.ROLE,
result: role
})), ...r27.globals.map((global) => ({
type: c7714_9.GLOBAL,
result: global
}))]);
}, [state, option, channel]);
return <AppLauncherCommandOptionActionSheet option={option} onDismiss={onActionSheetDismiss}>
<AppLauncherListSearchBar onChange={function onChange(event) {
setState(event.toLowerCase());
const current = ref.current;
if (current != null) {
current.scrollToOffset({
offset: 0,
animated: false
});
}
}} />
{length === 0 ? <AppLauncherListEmptyState /> : <AppLauncherList ref={ref} data={state2} renderItem={function renderItem({ item, index }) {
const props = {
onPress: () => {
onMentionablePress({
mentionable: item
});
ActionSheetActionCreators.hideActionSheet(c7714_8);
onActionSheetDismiss();
},
start: index === 0,
end: index === state2.length - 1
};
const type = item.type;
if (c7714_9.USER === type) {
const result3 = item.result;
const user = result3.user;
return <UserRow key={user.id} type={RelationshipTypes.NONE} user={user} nickname={result3.nick} guildId={guild_id} subLabel={<Text color="text-subtle" variant="text-xs/normal">
{getUserTag(user)}
</Text>} {...props} />;
}
if (c7714_9.ROLE === type) {
const result2 = item.result;
return <RoleRow key={result2.id} guildRole={result2} guildId={guild_id} {...props} />;
}
if (c7714_9.GLOBAL === type) {
const result = item.result;
return <TableRow key={result.text} label={<Text lineClamp={1} variant="text-md/semibold" color="mobile-text-heading-primary">{result.text}</Text>} icon={result.text === AutocompleteUtils2.MENTION_EVERYONE().text ? <RoleIcon /> : <AppLauncherOptionIcon icon={<UserCircleIcon size="sm" color="interactive-text-default" />} />} {...props} />;
}
}} />}
</AppLauncherCommandOptionActionSheet>;
};
export const APP_LAUNCHER_MENTIONABLE_LIST_ACTION_SHEET_KEY = "AppLauncherMentionableListActionSheet";
export { c7714_9 as MentionableItemTypes };
@@ -0,0 +1,122 @@
// Metro module 11355 (f11356).
import { useState, useEffect, useMemo } from "react";
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import GuildRoleStore from "../../../../../stores/GuildRoleStore";
import UserStore from "../../../../../stores/UserStore";
import { StatusTypes } from "../../../../../_bundle/Module505";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import { UserCircleIcon } from "../../../../../design/components/Icon/native/redesign/generated/UserCircleIcon";
import { MentionableItemTypes, APP_LAUNCHER_MENTIONABLE_LIST_ACTION_SHEET_KEY } from "./AppLauncherMentionableListActionSheet";
import { Avatar, AvatarSizes } from "../../../../../design/void/native";
import { RoleIcon } from "../role/AppLauncherRoleListActionSheet";
import UsernameText from "../../base_components/UsernameText";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
let useStyles;
const MentionableIcon = function MentionableIcon(props) {
const { mentionable, guildId } = props;
const styles = useStyles();
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const r28 = <AppLauncherOptionIcon icon={<UserCircleIcon size="sm" color="interactive-text-default" />} wrapperStyle={styles.iconWrapper} />;
if (mentionable == null) {
return r28;
}
const type = mentionable.type;
if (MentionableItemTypes.USER === type) {
return <Avatar user={mentionable.result.user} guildId={guildId} animate={!stateFromStores} size={AvatarSizes.REFRESH_MEDIUM_32} />;
}
if (MentionableItemTypes.ROLE === type) {
return <RoleIcon role={mentionable.result} />;
}
MentionableItemTypes.GLOBAL;
return r28;
};
useStyles = createStyles({
iconWrapper: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
}
});
export default function AppLauncherMentionableOption(props) {
let state, setState;
const { style, option, initialValue, onMentionablePress: onMentionablePress2, onActionSheetDismiss, channel, autoFocus, hasError, onPress: onPress2 } = props;
state = void 0;
setState = void 0;
const guild_id = channel.guild_id;
[state, setState] = useState(() => {
if (initialValue != null) {
if (initialValue.type === "roleMention") {
const role = GuildRoleStore.getRole(guild_id, initialValue.roleId);
if (role != null) {
return {
type: MentionableItemTypes.ROLE,
result: role
};
}
} else if (initialValue.type === "userMention") {
const user = UserStore.getUser(initialValue.userId);
if (user != null) {
return {
type: MentionableItemTypes.USER,
result: {
user,
score: 0,
status: StatusTypes.UNKNOWN,
nick: ""
}
};
}
} else if (initialValue.type === "textMention") {
return {
type: MentionableItemTypes.GLOBAL,
result: {
text: initialValue.text,
test: initialValue.text,
description: ""
}
};
}
}
return null;
});
useEffect(() => {
if (initialValue != null && state == null) {
onMentionablePress2({
mentionable: null
});
}
}, [onMentionablePress2, option.name, initialValue, state]);
const memo = useMemo(() => {
if (state == null) {
return null;
}
const type = state.type;
if (MentionableItemTypes.USER === type) {
return <UsernameText guildId={guild_id} user={state.result.user} />;
}
if (MentionableItemTypes.ROLE === type) {
return state.result.name;
}
if (MentionableItemTypes.GLOBAL === type) {
return state.result.text;
}
}, [state, guild_id]);
return <AppLauncherSelectOptionFormRow style={style} option={option} hasError={hasError} selected={state != null} selectedItemName={state != null ? memo : void 0} leading={<MentionableIcon mentionable={state} guildId={guild_id} />} onPress={function onPress() {
if (onPress2 != null) {
onPress2();
}
ActionSheetActionCreators.openLazy(import("./AppLauncherMentionableListActionSheet"), APP_LAUNCHER_MENTIONABLE_LIST_ACTION_SHEET_KEY, {
option,
channel,
onMentionablePress: ({ mentionable }) => {
setState(mentionable);
onMentionablePress2({
mentionable
});
},
onActionSheetDismiss
});
}} autoFocus={autoFocus} />;
};
@@ -0,0 +1,75 @@
// Metro module 11358 (f11359).
import { useEffect, useState, useRef, useMemo } from "react";
import GuildRoleMemberCountStore from "../../../../guild_settings/GuildRoleMemberCountStore";
import { isEveryoneRole } from "../../../../../records/GuildRoleRecord";
import GuildRoleStore from "../../../../../stores/GuildRoleStore";
import { DEFAULT_ROLE_COLOR_HEX } from "../../../../../Constants";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import { ShieldUserIcon } from "../../../../../design/components/Icon/native/redesign/generated/ShieldUserIcon";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import { fetchMemberCounts } from "../../../../guild_settings/GuildRoleMemberActionCreators";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
import { Text } from "../../../../../design/components/Text/native/Text";
import { GroupIcon } from "../../../../../design/components/Icon/native/redesign/generated/GroupIcon";
import fuzzysearch from "../../../../../_bundle/fuzzysearch";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import { AppLauncherListSearchBar, AppLauncherListEmptyState, AppLauncherList } from "../../base_components/AppLauncherList";
let c7715_12, RoleRow;
const RoleIcon = function RoleIcon(props) {
const role = props.role;
return <AppLauncherOptionIcon icon={<ShieldUserIcon size="sm" color={role != null ? "white" : "interactive-text-default"} />} wrapperStyle={role != null ? {
backgroundColor: role.colorString != null ? role.colorString : DEFAULT_ROLE_COLOR_HEX
} : {}} />;
};
RoleRow = function RoleRow(props) {
const { guildRole, guildId, ...props2 } = props;
const stateFromStores2 = useStateFromStores([GuildRoleMemberCountStore], () => {
const roleMemberCount = GuildRoleMemberCountStore.getRoleMemberCount(guildId);
return roleMemberCount == null ? void 0 : roleMemberCount[guildRole.id];
});
const isEveryoneRole2 = isEveryoneRole(guildRole);
useEffect(() => {
fetchMemberCounts(guildId);
}, [guildId]);
return <TableRow key={guildRole.id} label={<Text lineClamp={1} variant="text-md/semibold" color="mobile-text-heading-primary">{guildRole.name}</Text>} icon={<RoleIcon role={guildRole} />} trailing={isEveryoneRole2 ? null : stateFromStores2 == null ? null : <Text variant="text-sm/normal" color="text-muted">
<GroupIcon size="xxs" color="text-muted" />
{" "}
{stateFromStores2}
</Text>} {...props2} />;
};
c7715_12 = "AppLauncherRoleListActionSheet";
export default function AppLauncherRoleListActionSheet(props) {
let memo;
const { onRolePress, onActionSheetDismiss, channel, option } = props;
memo = void 0;
const guild_id = channel.guild_id;
const [state, setState] = useState("");
const ref = useRef(null);
const stateFromStores = useStateFromStores([GuildRoleStore], () => GuildRoleStore.getSortedRoles(guild_id));
memo = useMemo(() => stateFromStores.filter((stateFromStore) => state === stateFromStore.id || fuzzysearch(state.trim(), stateFromStore.name.toLowerCase())), [stateFromStores, state]);
return <AppLauncherCommandOptionActionSheet option={option} onDismiss={onActionSheetDismiss}>
<AppLauncherListSearchBar onChange={function onChange(event) {
setState(event.toLowerCase());
const current = ref.current;
if (current != null) {
current.scrollToOffset({
offset: 0,
animated: false
});
}
}} />
{memo.length === 0 ? <AppLauncherListEmptyState /> : <AppLauncherList ref={ref} data={memo} renderItem={function renderItem({ item, index }) {
return <RoleRow guildId={guild_id} guildRole={item} onPress={() => {
onRolePress({
role: item
});
ActionSheetActionCreators.hideActionSheet(c7715_12);
onActionSheetDismiss();
}} start={index === 0} end={index === memo.length - 1} />;
}} />}
</AppLauncherCommandOptionActionSheet>;
};
export const APP_LAUNCHER_ROLE_LIST_ACTION_SHEET_KEY = "AppLauncherRoleListActionSheet";
export { RoleIcon };
export { RoleRow };
@@ -0,0 +1,44 @@
// Metro module 11360 (f11361).
import { useState, useEffect } from "react";
import GuildRoleStore from "../../../../../stores/GuildRoleStore";
import { useStateFromStores } from "../../../../../_bundle/defaultAreStatesEqual";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { APP_LAUNCHER_ROLE_LIST_ACTION_SHEET_KEY, RoleIcon } from "./AppLauncherRoleListActionSheet";
export default function AppLauncherRoleOption(props) {
let state, setState, stateFromStores;
const { style, option, initialValue, onRolePress: onRolePress2, onActionSheetDismiss, channel, autoFocus, hasError, onPress: onPress2 } = props;
state = void 0;
setState = void 0;
stateFromStores = void 0;
const guild_id = channel.guild_id;
[state, setState] = useState(() => initialValue != null ? initialValue.type === "roleMention" ? initialValue.roleId : null : null);
stateFromStores = useStateFromStores([GuildRoleStore], () => {
if (state != null) {
return guild_id != null ? GuildRoleStore.getRole(guild_id, state) : void 0;
}
});
useEffect(() => {
if (state != null && stateFromStores == null) {
onRolePress2({
role: null
});
}
}, [onRolePress2, option.name, stateFromStores, state]);
return <AppLauncherSelectOptionFormRow style={style} option={option} hasError={hasError} selected={stateFromStores != null} selectedItemName={stateFromStores != null ? stateFromStores.name : void 0} onPress={function onPress() {
if (onPress2 != null) {
onPress2();
}
ActionSheetActionCreators.openLazy(import("./AppLauncherRoleListActionSheet"), APP_LAUNCHER_ROLE_LIST_ACTION_SHEET_KEY, {
option,
channel,
onRolePress: ({ role }) => {
setState(role.id);
onRolePress2({
role
});
},
onActionSheetDismiss
});
}} leading={<RoleIcon role={stateFromStores} />} autoFocus={autoFocus} />;
};
@@ -0,0 +1,157 @@
// Metro module 11349 (f11350).
import { useState, useRef, useCallback, useEffect } from "react";
import { View } from "react-native";
import { EmojiIntention } from "../../../../emojis/EmojiConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useAppLauncherContext } from "../../AppLauncherContext";
import { ApplicationCommandOptionType } from "../../../../../flow/Server";
import { maybeFetchTopEmojisByGuild } from "../../../../emojis/top_emojis/TopEmojisUtils";
import { useAnimationDelayedAutoFocus } from "../../hooks/useAnimationDelayedAutoFocus";
import { AppLauncherEntrypoint } from "../../../AppLauncherTypes";
import { TextInput } from "../../../../../design/void/native";
import BottomSheetTextInput from "../../../../action_sheet/native/components/BottomSheetTextInput";
import { isAndroid } from "../../../../../utils/PlatformUtils";
import ChatInputExpressionButton from "../../../../chat_input/native/accessories/ChatInputExpressionButton";
import { dismissGlobalKeyboard } from "../../../../../utils/native/KeyboardManagerUtils";
import { openEmojiPickerActionSheet } from "../../../../emoji_picker/native/openEmojiPickerActionSheet";
const useStyles = createStyles({
container: {
width: "100%",
backgroundColor: Module712.colors.INPUT_BACKGROUND_DEFAULT,
borderRadius: Module712.radii.lg,
padding: 14,
borderWidth: 2,
borderColor: "transparent",
flexDirection: "row",
alignItems: "center"
},
hasError: {
borderColor: Module712.colors.BORDER_FEEDBACK_CRITICAL
},
stringOptionInput: {
maxHeight: 100,
flex: 1,
padding: 0,
paddingTop: 0
},
expressionButton: {
marginVertical: -8,
marginRight: -8
}
});
export default function AppLauncherTextInputOption(props) {
let state, setState, ref, ref2, c18768_7, callback, callback2, callback3;
const { option, onChangeText, onFocus, onEndEditing, guildId, style, autoFocus, initialValue } = props;
let hasError = props.hasError;
const onPressIn = props.onPressIn;
state = void 0;
setState = void 0;
ref = void 0;
ref2 = void 0;
c18768_7 = void 0;
callback = void 0;
callback2 = void 0;
callback3 = void 0;
const styles = useStyles();
[state, setState] = useState(() => initialValue != null ? initialValue.type === "text" ? initialValue.text : "" : "");
const entrypoint = useAppLauncherContext().entrypoint;
ref = useRef({
start: 0,
end: 0
});
ref2 = useRef(null);
let r45 = option.type === ApplicationCommandOptionType.STRING;
c18768_7 = r45;
callback = useCallback((a0) => {
setState(a0);
onChangeText(a0);
}, [onChangeText]);
callback2 = useCallback((a0) => {
let length;
const r7 = state.substring(0, ref.current.start);
let end = ref.current.end;
if (end == null) {
end = ref.current.start;
}
const r10 = state.substring(end);
ref.current.start;
if (a0.id == null && a0.surrogates != null) {
callback(r7 + a0.surrogates + r10);
length = (r7 + a0.surrogates).length;
} else {
const r11 = a0.uniqueName != null && a0.uniqueName !== "" ? a0.uniqueName : a0.name;
callback(r7 + `:${r11}: ` + r10);
length = (r7 + `:${r11}: `).length;
}
ref.current = {
start: length,
end: length
};
const current = ref2.current;
if (current != null) {
current.focus();
}
}, [callback, state]);
callback3 = useCallback(() => {
const current = ref2.current;
if (current != null) {
current.focus();
}
}, []);
useEffect(() => {
if (c18768_7) {
maybeFetchTopEmojisByGuild(guildId);
}
}, [guildId, r45]);
useAnimationDelayedAutoFocus(autoFocus, () => {
const current = ref2.current;
if (current != null) {
current.focus();
}
});
const Component = entrypoint === AppLauncherEntrypoint.VOICE ? TextInput : BottomSheetTextInput;
const style2 = [styles.container, , ,];
if (hasError) {
hasError = styles.hasError;
}
style2[1] = hasError;
style2[2] = style;
const r81 = {
ref: ref2,
autoFocus: false,
value: state,
style: styles.stringOptionInput,
maxLength: option.type === ApplicationCommandOptionType.STRING ? option.maxLength : void 0,
autoComplete: "off",
onChangeText: callback,
onSelectionChange: (a0) => {
ref.current = a0.nativeEvent.selection;
},
onFocus,
onEndEditing,
textAlignVertical: "center",
returnKeyType: "done",
multiline: true,
keyboardType: null,
onPressIn: null
};
r81.keyboardType = option.type !== ApplicationCommandOptionType.INTEGER ? option.type === ApplicationCommandOptionType.NUMBER ? isAndroid() ? "numeric" : "numbers-and-punctuation" : "default" : isAndroid() ? "numeric" : "numbers-and-punctuation";
r81.onPressIn = onPressIn;
const r106 = [<Component {...r81} />, ,];
if (r45) {
r45 = <ChatInputExpressionButton style={styles.expressionButton} onPress={() => {
dismissGlobalKeyboard();
openEmojiPickerActionSheet({
pickerIntention: EmojiIntention.CHAT,
autoFocus: false,
startExpanded: false,
onPressEmoji: callback2,
guildId,
onClose: callback3
});
}} />;
}
r106[1] = r45;
return <View style={style2}>{r106}</View>;
};
@@ -0,0 +1,57 @@
// Metro module 11362 (f11363).
import { useCallback } from "react";
import { DEFAULT_CONTENT_PADDING } from "../../AppLauncherNativeConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { isSnowflake } from "../../../../application_commands/ApplicationCommandUtils";
import { EmptyState } from "../../../../../design/void/native";
import Module11345 from "../../../../../_bundle/Module11345";
import { intl, t } from "../../../../../intl/index.native";
import { AppLauncherCommandOptionActionSheet } from "../AppLauncherCommandOptionActionSheet";
import PrivateChannelUserList from "../../../../main_tabs_v2/native/shared_components/user_list/PrivateChannelUserList";
import GuildChannelUserList from "../../../../main_tabs_v2/native/shared_components/user_list/GuildChannelUserList";
import { AppLauncherList } from "../../base_components/AppLauncherList";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
let c7719_5, useStyles;
const EmptyStateWithSnowflakeQuery = function EmptyStateWithSnowflakeQuery(props) {
const { query, onPressRow: onPressRow2 } = props;
return <AppLauncherList contentContainerStyle={useStyles().emptyState} data={[query]} renderItem={(info) => <TableRow label={info.item} start end onPress={onPressRow2} />} keyboardShouldPersistTaps="always" keyboardDismissMode="on-drag" />;
};
c7719_5 = "AppLauncherUserListActionSheet";
useStyles = createStyles({
emptyState: {
paddingHorizontal: DEFAULT_CONTENT_PADDING,
paddingTop: DEFAULT_CONTENT_PADDING,
flex: 1
}
});
export default function AppLauncherUserListActionSheet(props) {
let callback2;
const { onUserPress, onActionSheetDismiss, channel, option } = props;
callback2 = void 0;
const { guild_id, id } = channel;
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet(c7719_5);
onActionSheetDismiss();
}, [onActionSheetDismiss]);
callback2 = useCallback((a0) => {
onUserPress({
user: a0.user
});
callback();
}, [callback, onUserPress]);
const callback3 = useCallback((a0) => {
const user = a0;
return isSnowflake(a0) ? <EmptyStateWithSnowflakeQuery query={a0} onPressRow={() => callback2({
user
})} /> : <EmptyState style={{
paddingTop: 80
}} lightSource={Module11345} darkSource={Module11345} title={intl.string(t.vYocDz)} body={intl.string(t.V6nAfF)} />;
}, [callback2]);
return <AppLauncherCommandOptionActionSheet onDismiss={onActionSheetDismiss} option={option} contentContainerStyles={{
paddingHorizontal: 0
}}>
{channel.isPrivate() ? <PrivateChannelUserList channelId={id} disableStickySections hideTitle headerShown={false} inActionSheet onUserPress={callback2} opensUserProfileOnUserPress={false} /> : <GuildChannelUserList channelId={id} guildId={guild_id} searchable searchableEmptyState={callback3} headerShown={false} opensUserProfileOnUserPress={false} onUserPress={callback2} inActionSheet disableThemedGradient />}
</AppLauncherCommandOptionActionSheet>;
};
export const APP_LAUNCHER_USER_LIST_ACTION_SHEET_KEY = "AppLauncherUserListActionSheet";
@@ -0,0 +1,55 @@
// Metro module 11361 (f11362).
import { useState } from "react";
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import AppLauncherSelectOptionFormRow from "../../base_components/AppLauncherSelectOptionFormRow";
import { dismissGlobalKeyboard } from "../../../../../utils/native/KeyboardManagerUtils";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { APP_LAUNCHER_USER_LIST_ACTION_SHEET_KEY } from "./AppLauncherUserListActionSheet";
import { Avatar, AvatarSizes } from "../../../../../design/void/native";
import AppLauncherOptionIcon from "../../base_components/AppLauncherOptionIcon";
import { UserCircleIcon } from "../../../../../design/components/Icon/native/redesign/generated/UserCircleIcon";
import UsernameText from "../../base_components/UsernameText";
import { Text } from "../../../../../design/components/Text/native/Text";
const useStyles = createStyles({
iconWrapper: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
}
});
export default function AppLauncherUserOption(props) {
let setState, setState2;
const { style, option, initialValue, onUserPress: onUserPress2, onActionSheetDismiss, channel, autoFocus, hasError, onPress: onPress2 } = props;
setState = void 0;
setState2 = void 0;
const styles = useStyles();
const guild_id = channel.guild_id;
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
let state;
[state, setState] = useState(() => initialValue != null ? initialValue.type === "userMention" ? initialValue.userId : null : null);
let user;
[user, setState2] = useState(null);
return <AppLauncherSelectOptionFormRow style={style} option={option} hasError={hasError} selected={user != null || state != null} onPress={function onPress() {
if (onPress2 != null) {
onPress2();
}
dismissGlobalKeyboard();
ActionSheetActionCreators.openLazy(import("./AppLauncherUserListActionSheet"), APP_LAUNCHER_USER_LIST_ACTION_SHEET_KEY, {
option,
channel,
onUserPress: ({ user }) => {
if (typeof user === "string") {
setState(user);
} else {
setState(user.id);
setState2(user);
}
onUserPress2({
user
});
},
onActionSheetDismiss
});
}} leading={user != null ? <Avatar user={user} guildId={guild_id} animate={!stateFromStores} size={AvatarSizes.REFRESH_MEDIUM_32} /> : <AppLauncherOptionIcon icon={<UserCircleIcon size="sm" color="interactive-text-default" />} wrapperStyle={styles.iconWrapper} />} selectedItemName={user != null ? <UsernameText guildId={guild_id} user={user} /> : state != null ? <Text variant="text-md/medium" color="text-default">{state}</Text> : null} autoFocus={autoFocus} />;
};
@@ -0,0 +1,200 @@
// Metro module 11369 (f11370).
import { useCallback, useMemo } from "react";
import { View } from "react-native";
import { DEFAULT_CONTENT_PADDING, FLASH_LIST_ITEM_IMPRESSION_VIEWABILITY_CONFIG } from "../../AppLauncherNativeConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { BACK_BUTTON_SIZE } from "../../base_components/AppLauncherBackButton";
import useSafeAreaInsets_native from "../../../../safe_area/useSafeAreaInsets.native";
import { useRequiredAppLauncherContext, AppLauncherKeyboardCloseReason } from "../../AppLauncherContext";
import { handleApplicationSelected, handleApplicationCommandSelected, getAppLauncherIconSource } from "../../AppLauncherNativeUtils";
import { ApplicationCommandTriggerLocations } from "../../../../application_commands/ApplicationCommandTypes";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { intl, t } from "../../../../../intl/index.native";
import { ArrowLargeLeftIcon } from "../../../../../design/components/Icon/native/redesign/generated/ArrowLargeLeftIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { Spacer } from "../../../../../design/void/native";
import RecommendationAppRow from "../../base_components/RecommendationAppRow";
import EntityBorderAppIcon from "../../base_components/EntityBorderAppIcon";
import { CommandRow } from "../application_view/app/AppDetailContent";
import { useBottomSheetFlashListBottomViewabilityInset } from "../../hooks/useBottomSheetFlashListBottomViewabilityInset";
import { useTrackAppLauncherItemImpressionOnFirstView } from "../../hooks/useTrackAppLauncherItemImpressionOnFirstView";
import AppLauncherFlashList, { useAppLauncherFlashListProps } from "../../base_components/AppLauncherFlashList";
import { SectionItemType } from "../home/FrecencySection";
import { AppLauncherEntrypoint } from "../../../AppLauncherTypes";
const scrollIndicatorInsets = {
bottom: 4
};
const useStyles = createStyles({
container: {
height: "100%",
backgroundColor: Module712.colors.MOBILE_KEYBOARD_PANEL_BACKGROUND,
flex: 1,
flexDirection: "column",
paddingBottom: 12
},
header: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
height: 24,
backgroundColor: Module712.colors.MOBILE_KEYBOARD_PANEL_BACKGROUND,
paddingHorizontal: DEFAULT_CONTENT_PADDING,
marginBottom: 12
},
list: {
paddingHorizontal: DEFAULT_CONTENT_PADDING,
paddingBottom: Module712.space.PX_4
},
backButton: {
width: BACK_BUTTON_SIZE,
height: BACK_BUTTON_SIZE,
alignItems: "center",
justifyContent: "center"
}
});
export default function AppLauncherViewAllScreen(props) {
let r114;
let callback2, callback3, callback4, trackAppLauncherItemImpressionOnFirstView;
const params = props.route.params;
const { context, analyticsLocation, sectionItemType } = params;
let sectionName2 = params.sectionName;
const { sectionOverallPosition, applications, commands, sectionDescriptors, title, promotedApplicationIds } = params;
const navigation = props.navigation;
callback2 = void 0;
callback3 = void 0;
callback4 = void 0;
trackAppLauncherItemImpressionOnFirstView = void 0;
if (sectionName2 == null) {
sectionName2 = "frecency_view_all";
}
const sectionName = sectionName2;
const styles = useStyles();
const paddingBottom = useSafeAreaInsets_native().bottom + DEFAULT_CONTENT_PADDING;
const requiredAppLauncherContext = useRequiredAppLauncherContext();
const { chatInputRef, keyboardCloseReasonRef, entrypoint } = requiredAppLauncherContext;
const callback = useCallback(() => {
if (navigation.canGoBack()) {
navigation.pop();
} else {
keyboardCloseReasonRef.current = AppLauncherKeyboardCloseReason.BACK;
const current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
}
}, [chatInputRef, keyboardCloseReasonRef, navigation]);
callback2 = useCallback(({ application, sectionName: sectionName2 }) => {
let location2 = analyticsLocation;
if (analyticsLocation == null) {
location2 = ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW_FRECENCT;
}
handleApplicationSelected({
location: location2,
application,
navigation,
context,
sectionName: sectionName2,
entrypoint
});
}, [analyticsLocation, context, entrypoint, navigation]);
callback3 = useCallback((a0, a1, a2) => {
let location2 = analyticsLocation;
if (analyticsLocation == null) {
location2 = ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW_FRECENCT;
}
handleApplicationCommandSelected({
location: location2,
context,
command: a0,
section: a1,
sectionDescriptors,
query: "",
navigation,
sectionName: a2,
entrypoint
});
}, [analyticsLocation, context, entrypoint, navigation, sectionDescriptors]);
const memo = useMemo(() => <View style={styles.header}>
<PressableOpacity style={styles.backButton} accessibilityLabel={intl.string(t["13/7kX"])} accessibilityRole="button" onPress={callback}>
<ArrowLargeLeftIcon color={Module712.colors.INTERACTIVE_TEXT_DEFAULT} />
</PressableOpacity>
<Text lineClamp={1} variant="heading-lg/bold" color="mobile-text-heading-primary">{title}</Text>
<Spacer size={BACK_BUTTON_SIZE} />
</View>, [callback, styles.backButton, styles.header, title]);
const callback5 = useCallback(({ item, index }) => <RecommendationAppRow key={item.id} application={item} onPress={() => callback2({
application: item,
sectionName
})} isFirstRow={index === 0} isLastRow={applications != null && index === applications.length - 1} showsPromoted={promotedApplicationIds == null ? void 0 : promotedApplicationIds.has(item.id)} />, [applications, promotedApplicationIds, callback2, sectionName]);
callback4 = useCallback(() => {
const current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
keyboardCloseReasonRef.current = AppLauncherKeyboardCloseReason.COMMAND;
}, [chatInputRef, keyboardCloseReasonRef]);
const callback6 = useCallback(({ item: item2, index }) => {
let c27038_1;
c27038_1 = void 0;
const section = sectionDescriptors == null ? void 0 : sectionDescriptors.find((sectionDescriptor) => sectionDescriptor.id === item2.applicationId);
c27038_1 = section;
const appLauncherIconSource = getAppLauncherIconSource(section?.application);
const r26 = commands.length - 1;
if (section == null) {
return null;
}
return <CommandRow command={item2} onPressCommand={() => callback3(item2, c27038_1, sectionName)} onExecuteCommand={callback4} isFirstRow={index === 0} isLastRow={index === r26} context={context} section={section} location={ApplicationCommandTriggerLocations.APP_LAUNCHER_FRECENTS_VIEW_ALL} sectionName={sectionName} icon={appLauncherIconSource != null && <EntityBorderAppIcon iconSource={appLauncherIconSource} iconSize={36} />} />;
}, [sectionDescriptors, context, commands.length, callback4, sectionName, callback3]);
const bottomSheetFlashListBottomViewabilityInset = useBottomSheetFlashListBottomViewabilityInset();
let flashListRef = bottomSheetFlashListBottomViewabilityInset.flashListRef;
const bottomVisibilityInsetRef = bottomSheetFlashListBottomViewabilityInset.bottomVisibilityInsetRef;
trackAppLauncherItemImpressionOnFirstView = useTrackAppLauncherItemImpressionOnFirstView().trackAppLauncherItemImpressionOnFirstView;
const appLauncherFlashListProps = useAppLauncherFlashListProps();
const memo2 = useMemo(() => ({
...styles.list,
paddingBottom
}), [paddingBottom, styles.list]);
const memo3 = useMemo(() => [{
viewabilityConfig: FLASH_LIST_ITEM_IMPRESSION_VIEWABILITY_CONFIG,
onViewableItemsChanged: (a0) => {
a0.viewableItems.forEach((viewableItem) => {
const item3 = viewableItem.item;
trackAppLauncherItemImpressionOnFirstView({
itemKey: `applicationId:${item3.id}`,
sectionName,
sectionPosition: viewableItem.index,
sectionOverallPosition,
applicationId: item3.id
});
});
}
}], [sectionName, sectionOverallPosition, trackAppLauncherItemImpressionOnFirstView]);
const memo4 = useMemo(() => [{
viewabilityConfig: FLASH_LIST_ITEM_IMPRESSION_VIEWABILITY_CONFIG,
onViewableItemsChanged: (a0) => {
a0.viewableItems.forEach((viewableItem) => {
const item3 = viewableItem.item;
trackAppLauncherItemImpressionOnFirstView({
itemKey: `commandId:${item3.id}`,
sectionName,
sectionPosition: viewableItem.index,
sectionOverallPosition,
applicationId: item3.applicationId,
commandId: item3.id
});
});
}
}], [sectionName, sectionOverallPosition, trackAppLauncherItemImpressionOnFirstView]);
if (sectionItemType === SectionItemType.APPS) {
if (entrypoint === AppLauncherEntrypoint.VOICE) {
flashListRef = appLauncherFlashListProps.scrollerRef;
}
r114 = <AppLauncherFlashList preserveScrollMomentum contentContainerStyle={memo2} scrollIndicatorInsets={scrollIndicatorInsets} keyExtractor={(item) => item.id} data={applications} renderItem={callback5} accessibilityRole="radiogroup" ref={flashListRef} bottomViewabilityInsetRef={bottomVisibilityInsetRef} viewabilityConfigCallbackPairs={memo3} animatedOnScroll={appLauncherFlashListProps.onScroll} simultaneousHandlers={appLauncherFlashListProps.gestureRef} animatedProps={appLauncherFlashListProps.animatedProps} />;
} else {
r114 = <AppLauncherFlashList preserveScrollMomentum contentContainerStyle={memo2} scrollIndicatorInsets={scrollIndicatorInsets} keyExtractor={(item) => item.id} data={commands} renderItem={callback6} accessibilityRole="radiogroup" ref={entrypoint === AppLauncherEntrypoint.VOICE ? appLauncherFlashListProps.scrollerRef : flashListRef} bottomViewabilityInsetRef={bottomVisibilityInsetRef} viewabilityConfigCallbackPairs={memo4} animatedOnScroll={appLauncherFlashListProps.onScroll} simultaneousHandlers={appLauncherFlashListProps.gestureRef} animatedProps={appLauncherFlashListProps.animatedProps} />;
}
return <View style={styles.container}>
{memo}
{r114}
</View>;
};
@@ -0,0 +1,106 @@
// Metro module 11301 (f11302).
import { useCallback, useEffect } from "react";
import { ActivityIndicator, View } from "react-native";
import ApplicationCommandIndexStore from "../../../../application_commands/ApplicationCommandIndexStore";
import { AppLauncherRouteName, SCREEN_BACKGROUND_COLOR } from "../../AppLauncherNativeConstants";
import { BuiltInSectionId } from "../../../../application_commands/ApplicationCommandConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import { useRequiredAppLauncherContext, AppLauncherBottomSheetExpandReason, AppLauncherKeyboardCloseReason } from "../../AppLauncherContext";
import useNavigationTransitionEnded from "../../hooks/useNavigationTransitionEnded";
import * as _AppLauncherUtils from "../../../utils/AppLauncherUtils";
import { KeyboardTypes } from "../../../../keyboard/native/KeyboardTypes";
import AppDetailContent from "./app/AppDetailContent";
import { useGetOrFetchApplication } from "../../../../applications/useGetOrFetchApplications";
import { useSharedValue } from "../../../../reanimated/ReanimatedRexport";
import { EXPANDED_HEADER_HEIGHT } from "./Header";
let useStyles;
const AppLauncherApplicationViewScreenInner = function AppLauncherApplicationViewScreenInner(props) {
const { context: context2, application, lockableScrollableContentOffsetY } = props;
let initiallyExpanded = props.initiallyExpanded;
const { installOnDemand: installOnDemand2, sectionName, onPressBack: onPressBack3, onActivityItemSelected, entrypoint, expandBottomSheet, onCommandExecuted } = props;
const requiredAppLauncherContext = useRequiredAppLauncherContext();
const { bottomSheetExpandReasonRef, chatInputRef } = requiredAppLauncherContext;
const navigationTransitionEnded = useNavigationTransitionEnded();
let c18723_4 = navigationTransitionEnded;
if (initiallyExpanded == null) {
initiallyExpanded = _AppLauncherUtils.isEmbeddedApp(application);
}
const isEmbeddedApp = initiallyExpanded;
const callback = useCallback(() => {
chatInputRef.current.openCustomKeyboard({
type: KeyboardTypes.APP_LAUNCHER,
context: {
initialRouteName: AppLauncherRouteName.APPLICATION_VIEW,
application
}
});
}, [application, chatInputRef]);
useEffect(() => {
let r3 = isEmbeddedApp;
if (isEmbeddedApp) {
r3 = c18723_4;
}
if (r3) {
bottomSheetExpandReasonRef.current = AppLauncherBottomSheetExpandReason.APP_VIEW;
if (expandBottomSheet != null) {
expandBottomSheet();
}
}
}, [navigationTransitionEnded, isEmbeddedApp, expandBottomSheet, bottomSheetExpandReasonRef]);
return <AppDetailContent application={application} context={context2} lockableScrollableContentOffsetY={lockableScrollableContentOffsetY} installOnDemand={installOnDemand2} sectionName={sectionName} onPressBack={onPressBack3} onActivityItemSelected={onActivityItemSelected} entrypoint={entrypoint} onCommandExecuted={onCommandExecuted} onAauth2Cancel={callback} />;
};
useStyles = createStyles({
container: {
backgroundColor: SCREEN_BACKGROUND_COLOR,
flex: 1
}
});
export default function AppLauncherApplicationViewScreen(props) {
let FAKE_BUILT_IN_APP;
const params = props.route.params;
const { application: application2, applicationId: applicationId2, onPressBack: onPressBack2, context, initiallyExpanded, installOnDemand, sectionName, expandBottomSheet: expandBottomSheet2, onCommandExecuted } = params;
const navigation = props.navigation;
const requiredAppLauncherContext = useRequiredAppLauncherContext();
const { chatInputRef: chatInputRef2, entrypoint, onActivityItemSelected, keyboardCloseReasonRef } = requiredAppLauncherContext;
const styles = useStyles();
let r34 = application2?.id;
if (r34 == null) {
r34 = applicationId2;
}
const applicationId = r34;
const getOrFetchApplication = useGetOrFetchApplication(applicationId !== BuiltInSectionId.BUILT_IN ? applicationId : null);
if (applicationId === BuiltInSectionId.BUILT_IN) {
FAKE_BUILT_IN_APP = _AppLauncherUtils.FAKE_BUILT_IN_APP;
} else {
FAKE_BUILT_IN_APP = getOrFetchApplication;
if (FAKE_BUILT_IN_APP == null) {
FAKE_BUILT_IN_APP = application2;
}
}
const sharedValue = useSharedValue(0);
useEffect(() => {
if (applicationId != null && context.type === "channel" && installOnDemand) {
ApplicationCommandIndexStore.queryInstallOnDemandApp(applicationId, context.channel.id);
}
}, [applicationId, context, installOnDemand]);
return <View style={styles.container}>
{FAKE_BUILT_IN_APP != null ? <AppLauncherApplicationViewScreenInner context={context} application={FAKE_BUILT_IN_APP} lockableScrollableContentOffsetY={sharedValue} initiallyExpanded={initiallyExpanded} installOnDemand={installOnDemand} sectionName={sectionName} onPressBack={function onPressBack() {
if (onPressBack2 != null) {
onPressBack2();
}
if (navigation.canGoBack()) {
navigation.pop();
} else {
keyboardCloseReasonRef.current = AppLauncherKeyboardCloseReason.BACK;
const current = chatInputRef2.current;
if (current != null) {
current.closeCustomKeyboard();
}
}
}} onActivityItemSelected={onActivityItemSelected} entrypoint={entrypoint} expandBottomSheet={expandBottomSheet2} onCommandExecuted={onCommandExecuted} /> : <View style={{
paddingTop: EXPANDED_HEADER_HEIGHT
}}>
<ActivityIndicator />
</View>}
</View>;
};
@@ -0,0 +1,214 @@
// Metro module 11304 (f11305).
import { View } from "react-native";
import UserStore from "../../../../../stores/UserStore";
import AppLauncherStore from "../../../AppLauncherStore";
import * as _AppLauncherNativeConstants from "../../AppLauncherNativeConstants";
import { AnalyticEvents, ApplicationFlags } from "../../../../../Constants";
import Module712 from "../../../../../_bundle/Module712";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import * as _ReanimatedRexport from "../../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle } from "../../../../reanimated/ReanimatedRexport";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import { getAppLauncherIconSource } from "../../AppLauncherNativeUtils";
import { useToken } from "../../../../../design/tokens/native/useToken";
import useAvatarColor from "../../../../avatar/useAvatarColor";
import EntityBorderAppIcon from "../../base_components/EntityBorderAppIcon";
import { getSectionName, isRealApplication, getInstallAppProps } from "../../../utils/AppLauncherUtils";
import * as _ApplicationFlagUtils from "../../../../applications/utils/ApplicationFlagUtils";
import AppLauncherBackButton from "../../base_components/AppLauncherBackButton";
import { Heading } from "../../../../../design/components/Text/native/Text";
import { Spacer } from "../../../../../design/void/native";
import { IconButton } from "../../../../../design/components/Button/native/IconButton.native";
import Module4134 from "../../../../../_bundle/Module4134";
import AnalyticsUtils from "../../../../../utils/AnalyticsUtils";
import { copy } from "../../../../../utils/ClipboardUtils.native";
import { getActivityLaunchURL, getApplicationInstallURL } from "../../../../applications/getApplicationInstallURL";
import { presentLinkCopied } from "../../../../toast/native/ToastUtils";
import { intl, t } from "../../../../../intl/index.native";
import AppDetailsOverflowMenu from "./app/AppDetailsOverflowMenu";
const { DEFAULT_CONTENT_PADDING, SCREEN_BACKGROUND_COLOR } = _AppLauncherNativeConstants;
const xl = Module712.radii.xl;
const HEADER_SCROLL_RANGE = 105;
const useStyles = createStyles({
headerContainer: {
position: "absolute",
top: -16,
left: 0,
right: 0,
minHeight: 161
},
expandedHeaderBanner: {
height: 105
},
appIconMask: {
position: "absolute",
padding: 4,
bottom: -40,
left: 16,
backgroundColor: SCREEN_BACKGROUND_COLOR,
borderRadius: Module712.radii.xl + 4
},
collapsedHeaderBanner: {
height: 56,
justifyContent: "space-between",
alignItems: "center",
position: "absolute",
top: 0,
left: 0,
right: 0,
flexDirection: "row",
paddingHorizontal: DEFAULT_CONTENT_PADDING,
paddingTop: 16,
paddingBottom: Module712.space.PX_12
},
collapsedHeaderBannerOverlay: {
backgroundColor: "black",
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0
},
loadingIcon: {
height: 72,
width: 72,
borderRadius: xl,
backgroundColor: Module712.colors.BACKGROUND_MOD_MUTED
},
actionsWrapper: {
flexDirection: "row",
display: "flex",
gap: Module712.space.PX_16,
position: "absolute",
right: Module712.space.PX_12,
top: Module712.space.PX_12,
alignItems: "center",
justifyContent: "center"
}
});
const __initData = {
code: "function HeaderTsx1(){const{interpolate,scrollOffsetY,HEADER_SCROLL_RANGE}=this.__closure;return{transform:[{translateY:interpolate(scrollOffsetY.get(),[0,HEADER_SCROLL_RANGE],[0,-HEADER_SCROLL_RANGE],'clamp')}]};}"
};
const __initData2 = {
code: "function HeaderTsx2(){const{interpolate,scrollOffsetY,HEADER_SCROLL_RANGE}=this.__closure;return{transform:[{translateY:interpolate(scrollOffsetY.get(),[0,HEADER_SCROLL_RANGE],[0,HEADER_SCROLL_RANGE],'clamp')}]};}"
};
const __initData3 = {
code: "function HeaderTsx3(){const{interpolate,scrollOffsetY,HEADER_SCROLL_RANGE}=this.__closure;return{transform:[{translateY:interpolate(scrollOffsetY.get(),[HEADER_SCROLL_RANGE*0.5,HEADER_SCROLL_RANGE],[16,0],'clamp')}],opacity:interpolate(scrollOffsetY.get(),[HEADER_SCROLL_RANGE*0.5,HEADER_SCROLL_RANGE],[0,1],'clamp')};}"
};
const __initData4 = {
code: "function HeaderTsx4(){const{interpolate,scrollOffsetY,HEADER_SCROLL_RANGE}=this.__closure;return{opacity:interpolate(scrollOffsetY.get(),[HEADER_SCROLL_RANGE*0.5,HEADER_SCROLL_RANGE],[0,0.5],'clamp')};}"
};
export default function Header(props) {
let hasApplicationFlag, currentUser;
const { application, onPressBack, scrollOffsetY: scrollOffsetY4, onAddAppMenuClick } = props;
hasApplicationFlag = void 0;
currentUser = void 0;
const stateFromStores = useStateFromStores([AppLauncherStore], () => AppLauncherStore.entrypoint());
const styles = useStyles();
const iconSource = application != null ? getAppLauncherIconSource(application) : null;
let r43 = useToken(Module712.colors.BACKGROUND_BASE_LOW);
let r46 = iconSource;
if (typeof r46 !== "number") {
r46 = iconSource?.uri;
}
if (r43 == null) {
r43 = "";
}
const avatarColor = useAvatarColor(r46, r43);
const r52 = iconSource != null ? <EntityBorderAppIcon iconSource={iconSource} iconBorderRadius={xl} iconSize={72} /> : <View style={styles.loadingIcon} />;
let scrollOffsetY2;
let scrollOffsetY3;
const scrollOffsetY = scrollOffsetY4;
const r63 = () => ({
transform: [{
translateY: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, HEADER_SCROLL_RANGE], [0, -105], "clamp")
}]
});
r63.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
HEADER_SCROLL_RANGE
};
r63.__workletHash = 2572905048492;
r63.__initData = __initData;
const animatedStyle3 = useAnimatedStyle(r63);
scrollOffsetY2 = scrollOffsetY;
const r74 = () => ({
transform: [{
translateY: _ReanimatedRexport.interpolate(scrollOffsetY2.get(), [0, HEADER_SCROLL_RANGE], [0, HEADER_SCROLL_RANGE], "clamp")
}]
});
r74.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
HEADER_SCROLL_RANGE
};
r74.__workletHash = 8190094903650;
r74.__initData = __initData2;
const animatedStyle4 = useAnimatedStyle(r74);
const r83 = () => ({
transform: [{
translateY: _ReanimatedRexport.interpolate(scrollOffsetY2.get(), [52.5, HEADER_SCROLL_RANGE], [16, 0], "clamp")
}],
opacity: _ReanimatedRexport.interpolate(scrollOffsetY2.get(), [52.5, HEADER_SCROLL_RANGE], [0, 1], "clamp")
});
r83.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
HEADER_SCROLL_RANGE
};
r83.__workletHash = 14190901941859;
r83.__initData = __initData3;
const animatedStyle = useAnimatedStyle(r83);
scrollOffsetY3 = scrollOffsetY;
const r94 = () => ({
opacity: _ReanimatedRexport.interpolate(scrollOffsetY3.get(), [52.5, HEADER_SCROLL_RANGE], [0, 0.5], "clamp")
});
r94.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
HEADER_SCROLL_RANGE
};
r94.__workletHash = 9589752719246;
r94.__initData = __initData4;
const animatedStyle2 = useAnimatedStyle(r94);
const r24 = application != null ? getSectionName(application) : "";
hasApplicationFlag = application != null && "flags" in application && _ApplicationFlagUtils.hasApplicationFlag(application, ApplicationFlags.EMBEDDED);
currentUser = UserStore.getCurrentUser();
return <ReanimatedRexport.View style={[styles.headerContainer, animatedStyle3]} pointerEvents="box-none">
<View style={[styles.expandedHeaderBanner, {
backgroundColor: avatarColor
}]} pointerEvents="none">
<View style={styles.appIconMask}>{r52}</View>
</View>
<ReanimatedRexport.View style={[styles.collapsedHeaderBanner, {
backgroundColor: avatarColor
}, animatedStyle4]} pointerEvents="box-none">
<ReanimatedRexport.View style={[styles.collapsedHeaderBannerOverlay, animatedStyle2]} pointerEvents="none" />
<AppLauncherBackButton onPress={onPressBack} />
<ReanimatedRexport.View style={animatedStyle} pointerEvents="none">
<Heading variant="heading-lg/bold" color="text-overlay-light">{r24}</Heading>
</ReanimatedRexport.View>
<Spacer size={32} pointerEvents="none" />
</ReanimatedRexport.View>
{application != null ? isRealApplication(application) ? <View style={styles.actionsWrapper}>
<IconButton size="sm" variant="secondary-overlay" icon={Module4134} onPress={() => {
AnalyticsUtils.track(AnalyticEvents.APP_LAUNCHER_APPLICATION_LINK_COPIED, {
application_id: application.id,
source: stateFromStores
});
copy(hasApplicationFlag ? getActivityLaunchURL({
applicationId: application.id,
referrerId: currentUser?.id
}) : getApplicationInstallURL({
id: application.id,
...getInstallAppProps(application)
}));
presentLinkCopied();
}} accessibilityLabel={intl.string(t.XWDihq)} maxFontSizeMultiplier={1.5} />
<AppDetailsOverflowMenu application={application} onAddAppMenuClick={onAddAppMenuClick} />
</View> : null : null}
</ReanimatedRexport.View>;
};
export const SHEET_HANDLE_CONTAINER_HEIGHT = 16;
export const EXPANDED_HEADER_HEIGHT = 161;
@@ -0,0 +1,384 @@
// Metro module 11317 (f11318).
import _slicedToArray from "../../../../../../_bundle/_slicedToArray";
import { useId, useCallback, useMemo, useState, useRef } from "react";
import { View } from "react-native";
import DeveloperActivityShelfStore from "../../../../../activities/DeveloperActivityShelfStore";
import ApplicationRecord from "../../../../../../records/ApplicationRecord";
import { AnalyticEvents } from "../../../../../../Constants";
import { jsxs, jsx } from "react/jsx-runtime";
import Module712 from "../../../../../../_bundle/Module712";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { useRequiredAppLauncherContext, AppLauncherKeyboardCloseReason } from "../../../AppLauncherContext";
import useLaunchingActivityButtonState from "../../../../utils/useLaunchingActivityButtonState";
import { ActivityAction, useActivityAction } from "../../../../../activities/utils/useActivityShelfItem";
import { useHandleActivityItemSelected } from "../../../AppLauncherNativeUtils";
import { ApplicationCommandTriggerLocations } from "../../../../../application_commands/ApplicationCommandTypes";
import { formatPrimaryEntryPointCommandName, isRealApplication, isEmbeddedApp } from "../../../../utils/AppLauncherUtils";
import { intl, t } from "../../../../../../intl/index.native";
import AnalyticsUtils from "../../../../../../utils/AnalyticsUtils";
import { EntryPointCommandButtonActions, AppLauncherEntrypoint } from "../../../../AppLauncherTypes";
import { Button } from "../../../../../../design/components/Button/native/Button.native";
import ChannelActionCreators from "../../../../../../actions/ChannelActionCreators";
import handleUsePrimaryEntryPointAppCommand from "../../../../../activities/handleUsePrimaryEntryPointAppCommand";
import { useGetPrimaryAppCommand } from "../../../../../application_commands/getPrimaryAppCommand";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../../../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../../../../app_analytics/AnalyticsLocation";
import { useIsScreenLandscape } from "../../../../../screen/useIsScreenLandscape.native";
import { useStateFromStoresObject } from "../../../../../../_bundle/Module589";
import { TableRowDivider } from "../../../../../../design/components/TableRow/native/TableRowDivider.native";
import { TableSwitchRow } from "../../../../../../design/components/TableRow/native/TableSwitchRow.native";
import { toggleUseActivityUrlOverride, setActivityUrlOverride } from "../../../../../activities/DeveloperActivityShelfActionCreators";
import { TextInput } from "../../../../../../design/components/TextInput/native/TextInput.native";
import { useGetOrFetchApplication } from "../../../../../applications/useGetOrFetchApplications";
import { useDelayedSwapToActivityActionLeave } from "../../../../hooks/useDelayedSwapToActivityActionLeave";
import useIsPrimaryEntryPointDisabled from "../../../../hooks/useIsPrimaryEntryPointDisabled";
import useShowTryItOutButtonInAppLauncher from "../../../../../app_dms/useShowTryItOutButtonInAppLauncher";
import { HelpMessage, HelpMessageTypes } from "../../../../../../design/void/native";
import HeroMedia from "./HeroMedia";
import DetailsHeader from "../app/DetailsHeader";
import { GroupIcon } from "../../../../../../design/components/Icon/native/redesign/generated/GroupIcon";
import getItemSubtitleForMaxPlayers, { getItemSubtitleForMaxPlayersShort } from "../../../../../activities/utils/getItemSubtitleForMaxPlayers";
let PrimaryEntryPointButton, TryItOutButton, PX_12, useStyles;
let env7678 = {};
const Tag = function Tag({ tagName, icon, accessibilityLabel }) {
const styles = useStyles();
return (0, jsxs)(View, {
style: styles.tag,
accessible: true,
accessibilityLabel,
children: [icon, (0, jsx)(Text, {
variant: "text-sm/normal",
style: styles.tagText,
children: tagName
})]
});
};
PrimaryEntryPointButton = function PrimaryEntryPointButton({ applicationId, context, sectionName, primaryEntryPointCommand, disabled, onActivityItemSelected, entrypoint, activityAction }) {
let variant;
let handleActivityItemSelected;
handleActivityItemSelected = void 0;
const id = useId();
const requiredAppLauncherContext = useRequiredAppLauncherContext();
const { chatInputRef, keyboardCloseReasonRef } = requiredAppLauncherContext;
const callback = useCallback(() => {
keyboardCloseReasonRef.current = AppLauncherKeyboardCloseReason.ACTIVITY;
const current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
}, [chatInputRef, keyboardCloseReasonRef]);
const submitting = useLaunchingActivityButtonState({
applicationId,
context,
launchingComponentId: id,
onSubmissionComplete: activityAction !== ActivityAction.LEAVE ? callback : void 0
}).submitting;
handleActivityItemSelected = useHandleActivityItemSelected({
applicationId,
context,
sectionName,
onActivityItemSelected,
location: ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW,
entrypoint,
launchingComponentId: id
}).handleActivityItemSelected;
let text = useMemo(() => formatPrimaryEntryPointCommandName(primaryEntryPointCommand.displayName), [primaryEntryPointCommand.displayName]);
if (text == null) {
text = intl.string(t.zKX8Nu);
}
if (activityAction === ActivityAction.JOIN) {
text = intl.string(t.d9PsMj);
variant = "active";
} else {
const LEAVE = ActivityAction.LEAVE;
variant = "primary";
if (activityAction === LEAVE) {
text = intl.string(t["Hi1/aQ"]);
variant = "destructive";
}
}
const callback2 = useCallback(() => {
AnalyticsUtils.track(AnalyticEvents.APP_DETAIL_PAGE_ENTRY_POINT_COMMAND_BUTTON_CLICKED, {
application_id: applicationId,
button_action: EntryPointCommandButtonActions.USE_APP_COMMAND
});
handleActivityItemSelected();
if (activityAction === ActivityAction.LEAVE) {
callback();
}
}, [handleActivityItemSelected, activityAction, callback, applicationId]);
return context.type === "channel" ? (0, jsx)(Button, {
size: "lg",
loading: submitting,
variant,
text,
disabled,
onPress: callback2
}) : null;
};
TryItOutButton = function TryItOutButton(props) {
let env18737 = {
$parent: env7678
};
const botUserId = props.botUserId;
env18737[0] = botUserId;
const applicationId2 = props.applicationId;
env18737[1] = applicationId2;
const analyticsLocations = props.analyticsLocations;
env18737[2] = analyticsLocations;
const context = props.context;
env18737[3] = void 0;
env18737[4] = void 0;
const r15 = _slicedToArray(useState(false), 2);
const loading = r15[0];
env18737[3] = r15[1];
env18737[4] = useRef(null);
const callback2 = useCallback(async () => {
let c27017_0, c27017_1, c27017_2;
let c27017_3 = 0;
const r14 = env18737;
L12: {
try {
let env30391;
c27017_1 = r14;
const r33 = env30391 = {
$parent: r14
};
c27017_0 = r33;
env30391[0] = void 0;
AnalyticsUtils.track(AnalyticEvents.APP_DETAIL_PAGE_ENTRY_POINT_COMMAND_BUTTON_CLICKED, {
application_id: env18737[1],
button_action: EntryPointCommandButtonActions.OPEN_APP_DM
});
env18737[4].current = setTimeout(() => {
(0, env18737[3])(true);
}, 250);
c27017_3 = 1;
env30391[0] = await ChannelActionCreators.openPrivateChannel({
recipientIds: env18737[0]
});
await handleUsePrimaryEntryPointAppCommand({
targetApplicationId: env18737[1],
channelId: env30391[0],
analyticsLocations: env18737[2]
});
c27017_3 = 0;
clearTimeout(env18737[4].current);
(0, env18737[3])(false);
} catch ($e) {
const r31 = $e;
let r7 = r31;
c27017_2 = r31;
if (c27017_3 !== 0) {
while (true) {
try {
c27017_3 = 0;
clearTimeout(env18737[4].current);
(0, env18737[3])(false);
break L12;
} catch (r118) {
r7 = r118;
c27017_2 = r118;
if (c27017_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
}, [botUserId, applicationId2, analyticsLocations]);
return <Button size="lg" loading={loading} variant={context.type === "channel" ? "secondary" : "primary"} text={intl.string(t.AUM8hY)} onPress={callback2} />;
};
const PX_122 = Module712.space.PX_12;
PX_12 = PX_122;
useStyles = createStyles({
container: {
flex: 1
},
cardContainer: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.lg,
overflow: "hidden",
gap: Module712.space.PX_16,
paddingBottom: PX_122
},
activityHeroDetailsLandscape: {
flexDirection: "row"
},
heroMediaContainerLandscape: {
width: "65%"
},
detailsContainerLandscape: {
width: "35%"
},
details: {
marginTop: 16,
paddingHorizontal: PX_122,
rowGap: 4
},
tagList: {
display: "flex",
flexDirection: "row",
flexWrap: "wrap",
marginTop: Module712.space.PX_8,
columnGap: 4,
rowGap: 6
},
tag: {
display: "flex",
flexDirection: "row",
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
borderRadius: Module712.radii.round,
paddingHorizontal: 12,
paddingVertical: 4
},
tagText: {
top: -1
},
tagIcon: {
marginRight: 4
},
buttonContainer: {
paddingTop: 16
},
activityUrlOverrideInputContainer: {
marginTop: -4
},
primaryEntryPointButtonDisabledCTA: {
marginTop: Module712.space.PX_12,
color: Module712.colors.TEXT_MUTED,
textAlign: "center"
},
tryItOutButtonContainerStyle: {
marginTop: 8
}
});
export default function ActivityDetailContent(props) {
let r147, r148;
const { application, context, sectionName, onActivityItemSelected, entrypoint, hasCommands } = props;
const styles = useStyles();
const width = useRequiredAppLauncherContext().width;
const getPrimaryAppCommand2 = useGetPrimaryAppCommand(context, application.id);
const analyticsLocations = useAnalyticsLocations(AnalyticsLocation.APP_DETAIL).analyticsLocations;
const isScreenLandscape = useIsScreenLandscape();
let r19 = entrypoint !== AppLauncherEntrypoint.VOICE && isScreenLandscape;
const stateFromStoresObject = useStateFromStoresObject([DeveloperActivityShelfStore], () => ({
isDeveloperOfThisApp: DeveloperActivityShelfStore.inDevModeForApplication(application.id),
activityUrlOverride: DeveloperActivityShelfStore.getActivityUrlOverride(),
useActivityUrlOverride: DeveloperActivityShelfStore.getUseActivityUrlOverride()
}));
let isDeveloperOfThisApp = stateFromStoresObject.isDeveloperOfThisApp;
let activityUrlOverride = stateFromStoresObject.activityUrlOverride;
const useActivityUrlOverride = stateFromStoresObject.useActivityUrlOverride;
if (isRealApplication(application)) {
let r25 = application instanceof ApplicationRecord ? application.maxParticipants : application.max_participants;
if (r25 == null) {
r25 = 0;
}
let r16 = null;
if (isDeveloperOfThisApp) {
const marginTop = PX_12;
const style = {
marginTop,
marginBottom: useActivityUrlOverride ? 0 : -marginTop
};
const r90 = [<TableRowDivider />, <TableSwitchRow label={intl.string(t["3TSGuD"])} value={useActivityUrlOverride} onValueChange={toggleUseActivityUrlOverride} end />, ,];
let r105 = null;
if (useActivityUrlOverride) {
if (activityUrlOverride == null) {
activityUrlOverride = void 0;
}
r105 = <View style={styles.activityUrlOverrideInputContainer}>
<TextInput placeholder="e.g. http://192.168.1.1:3000" value={activityUrlOverride} onChange={setActivityUrlOverride} />
</View>;
}
r90[2] = r105;
r16 = <View style={style}>{r90}</View>;
}
const bot = useGetOrFetchApplication(application.id)?.bot;
const delayedSwapToActivityActionLeave = useDelayedSwapToActivityActionLeave(useActivityAction({
context,
applicationId: application.id
}));
const isPrimaryEntryPointDisabled = useIsPrimaryEntryPointDisabled({
context,
application,
activityAction: delayedSwapToActivityActionLeave
});
const { disabled, reason } = isPrimaryEntryPointDisabled;
const showTryItOutButtonInAppLauncher = useShowTryItOutButtonInAppLauncher({
context,
application,
botUserId: bot?.id
});
if (getPrimaryAppCommand2 != null) {
r148 = <View style={styles.buttonContainer}>
<>
{[<PrimaryEntryPointButton applicationId={application.id} context={context} sectionName={sectionName} primaryEntryPointCommand={getPrimaryAppCommand2} disabled={disabled} onActivityItemSelected={onActivityItemSelected} entrypoint={entrypoint} activityAction={delayedSwapToActivityActionLeave} />, showTryItOutButtonInAppLauncher ? bot?.id != null ? <View style={styles.tryItOutButtonContainerStyle}>
<TryItOutButton botUserId={bot.id} applicationId={application.id} analyticsLocations={analyticsLocations} context={context} />
</View> : null : null]}
</>
{reason != null && <Text variant="text-sm/normal" style={styles.primaryEntryPointButtonDisabledCTA}>{reason}</Text>}
</View>;
r147 = void 0;
} else {
if (isDeveloperOfThisApp) {
isDeveloperOfThisApp = !hasCommands;
}
if (isDeveloperOfThisApp) {
isDeveloperOfThisApp = isEmbeddedApp(application);
}
r147 = void 0;
r148 = void 0;
if (isDeveloperOfThisApp) {
r147 = <View style={styles.buttonContainer}>
<HelpMessage messageType={HelpMessageTypes.WARNING}>
{intl.format(t["s/3hjE"], {})}
</HelpMessage>
</View>;
r148 = void 0;
}
}
const style2 = r19 ? styles.activityHeroDetailsLandscape : r19;
const r226 = [<View style={r19 ? styles.heroMediaContainerLandscape : r19}>
<HeroMedia applicationId={application.id} width={r19 ? 65 * width / 100 : width} />
</View>, ,];
const style3 = [styles.details, ,];
if (r19) {
r19 = styles.detailsContainerLandscape;
}
style3[1] = r19;
const r234 = [<DetailsHeader application={application} />, , , , ,];
const r244 = {
icon: <GroupIcon style={styles.tagIcon} size="xs" />,
tagName: getItemSubtitleForMaxPlayersShort(r25 == null ? 0 : r25),
accessibilityLabel: null
};
if (r25 == null) {
r25 = 0;
}
r244.accessibilityLabel = getItemSubtitleForMaxPlayers(r25);
const r255 = [<Tag key="participants" {...r244} />, ,];
const tags = application.tags;
r255[1] = tags == null ? void 0 : tags.map((tag) => <Tag key={tag} tagName={tag} accessibilityLabel={intl.formatToPlainString(t.tXXD6v, {
tagName: tag
})} />);
r234[1] = <View style={styles.tagList}>{r255}</View>;
r234[2] = r148;
r234[3] = r147;
r234[4] = r16;
r226[1] = <View style={style3}>{r234}</View>;
return <AnalyticsLocationProvider value={analyticsLocations}>
<View style={[styles.container]}>
<View style={styles.cardContainer}>
<View style={style2}>{r226}</View>
</View>
</View>
</AnalyticsLocationProvider>;
}
throw new Error("ActivityDetailContent was passed the Built-in App, which is not supported.");
};
@@ -0,0 +1,89 @@
// Metro module 11257 (f11258).
import AccessibilityStore from "../../../../../a11y/AccessibilityStore";
import { DEFAULT_CONTENT_PADDING } from "../../../AppLauncherNativeConstants";
import { ACTION_SHEET_MAX_WIDTH } from "../../../../../action_sheet/native/ActionSheetConstants";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import { useDefaultAppLauncherWidth } from "../../../hooks/useDefaultAppLauncherWidth";
import useEmbeddedActivityBackground from "../../../../../activities/utils/useEmbeddedActivityBackground";
import { useStateFromStores } from "../../../../../../_bundle/Module589";
import { useGetOrFetchApplication } from "../../../../../applications/useGetOrFetchApplications";
import getPreviewVideoAssetUrl from "../../../../../activities/utils/getPreviewVideoAssetUrl";
import Video from "../../../../../../components_native/common/Video";
import { t, intl } from "../../../../../../intl/index.native";
const useStyles = createStyles({
mediaBackground: {
backgroundColor: "black"
}
});
export default function HeroMedia(props) {
let src;
const { applicationId, containerHeight, width } = props;
const styles = useStyles();
const width2 = ({
width
}).width;
const defaultAppLauncherWidth = useDefaultAppLauncherWidth();
let r28 = width2;
if (r28 == null) {
r28 = Math.min(width2 == null ? defaultAppLauncherWidth : width2, ACTION_SHEET_MAX_WIDTH);
}
const size = r28 - 2 * DEFAULT_CONTENT_PADDING;
const height = Math.floor(9 * size / 16);
const embeddedActivityBackground = useEmbeddedActivityBackground({
applicationId,
size,
names: ["embedded_cover"]
});
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion, []);
const getOrFetchApplication = useGetOrFetchApplication(applicationId);
const embeddedActivityConfig = getOrFetchApplication?.embeddedActivityConfig;
const videoURI = embeddedActivityConfig?.activity_preview_video_asset_id != null ? getPreviewVideoAssetUrl(applicationId, embeddedActivityConfig.activity_preview_video_asset_id) : null;
const r62 = videoURI == null;
let r63 = null;
if (!r62) {
r63 = null;
if (videoURI !== "") {
if (videoURI != null && videoURI !== "") {
src = {
videoURI
};
} else {
let url = embeddedActivityBackground.url;
if (url == null) {
url = "";
}
src = {
uri: url
};
}
const r80 = t["Af+EQD"];
let applicationName = getOrFetchApplication?.name;
if (applicationName == null) {
applicationName = "";
}
r63 = <Video muted paused={stateFromStores} src={src} height={height} width={size} poster={embeddedActivityBackground.url} resizeMode="cover" accessibilityLabel={intl.formatToPlainString(r80, {
applicationName
})} style={[styles.mediaBackground, {
maxHeight: height
}, containerHeight != null && {
transform: [{
translateY: (containerHeight - height) / 2
}]
}]} videoStyle={styles.mediaBackground} postponeRender={false} />;
}
}
return r63;
};
export function useHeroMediaDimensions(r4 = {}) {
const width = r4.width;
const defaultAppLauncherWidth = useDefaultAppLauncherWidth();
let r17 = width;
if (r17 == null) {
r17 = Math.min(width == null ? defaultAppLauncherWidth : width, ACTION_SHEET_MAX_WIDTH);
}
const width2 = r17 - 2 * DEFAULT_CONTENT_PADDING;
return {
width: width2,
height: Math.floor(9 * width2 / 16)
};
}
@@ -0,0 +1,378 @@
// Metro module 11303 (f11304).
import { useMemo, useEffect, useCallback } from "react";
import { View } from "react-native";
import { useUserIndexState, useContextIndexState } from "../../../../../application_commands/ApplicationCommandIndexStore";
import { DEFAULT_CONTENT_PADDING, useAppLauncherNavigation } from "../../../AppLauncherNativeConstants";
import { AnalyticEvents } from "../../../../../../Constants";
import { DISCOVERY_COMMANDS_QUERY_LIMIT } from "../../../../../application_commands/ApplicationCommandConstants";
import { jsx, jsxs } from "react/jsx-runtime";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Header, { EXPANDED_HEADER_HEIGHT, SHEET_HANDLE_CONTAINER_HEIGHT } from "../Header";
import Module712 from "../../../../../../_bundle/Module712";
import { usePlaceholderWidth } from "../../../hooks/usePlaceholderSize";
import { TableRow } from "../../../../../../design/components/TableRow/native/TableRow.native";
import { useAppLauncherContext, useRequiredAppLauncherContext, AppLauncherKeyboardCloseReason } from "../../../AppLauncherContext";
import CommandRowButton from "../../../base_components/CommandRowButton";
import { trackCommandSelected, getCommandTriggerSection } from "../../../../../application_commands/ApplicationCommandUtils";
import { installApplicationOnDemandIfNeeded } from "../../../../../applications/installApplicationOnDemandIfNeeded.native";
import useSafeAreaInsets_native from "../../../../../safe_area/useSafeAreaInsets.native";
import { useDiscovery } from "../../../../../application_commands/ApplicationCommandQueryApi";
import { ApplicationCommandType } from "../../../../../../flow/Server";
import useSortedSectionCommands from "../../../../hooks/useSortedSectionCommands";
import * as _AppLauncherUtils from "../../../../utils/AppLauncherUtils";
import { isEmbeddedApp, isApplicationMonetizedWithIAP } from "../../../../utils/AppLauncherUtils";
import { ApplicationCommandTriggerLocations } from "../../../../../application_commands/ApplicationCommandTypes";
import { handleApplicationCommandSelected } from "../../../AppLauncherNativeUtils";
import { isAndroid } from "../../../../../../utils/PlatformUtils";
import { BillIcon } from "../../../../../../design/components/Icon/native/redesign/generated/BillIcon";
import { Text, Heading } from "../../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../../intl/index.native";
import { ShopIcon } from "../../../../../../design/components/Icon/native/redesign/generated/ShopIcon";
import AppLauncherFlashList, { useAppLauncherFlashListProps } from "../../../base_components/AppLauncherFlashList";
import ActivityDetailContent from "../activity/ActivityDetailContent";
import DetailsHeader from "./DetailsHeader";
import { Spacer } from "../../../../../../design/void/native";
import FrecencyCommandsSection from "./FrecencyCommandsSection";
import CommandListSortButton from "./sort/CommandListSortButton";
import ActionSheetActionCreators from "../../../../../action_sheet/native/ActionSheetActionCreators";
import { trackWithMetadata } from "../../../../../app_analytics/AppAnalyticsUtils";
import { installApplication } from "../../../../../../utils/native/ApplicationUtils";
let CommandRow, useStyles, c7669_17, c7669_18;
let env7669 = {};
const PlaceholderCommandRow = function PlaceholderCommandRow(props) {
const { isFirstRow = false, isLastRow = false } = props;
const styles = useStyles();
return <TableRow label={<View style={[styles.loadingTextPlaceholder, {
width: `${usePlaceholderWidth(10, 50)}%`
}]} />} subLabel={<View style={[styles.loadingTextPlaceholderSmall, {
width: `${usePlaceholderWidth(30, 90)}%`
}]} />} subLabelLineClamp={1} start={isFirstRow} end={isLastRow} />;
};
CommandRow = function CommandRow(props) {
let env18726 = {
$parent: env7669
};
const command = props.command;
env18726[0] = command;
env18726[1] = props.onPressCommand;
const { isFirstRow, isLastRow, context: context2 } = props;
env18726[2] = context2;
const onExecuteCommand = props.onExecuteCommand;
env18726[3] = props.section;
env18726[4] = props.location;
const { installOnDemand: installOnDemand2, sectionName: sectionName2 } = props;
env18726[5] = sectionName2;
const icon = props.icon;
env18726[6] = void 0;
env18726[6] = useAppLauncherContext().entrypoint;
(0, useUserIndexState)(true, true);
(0, useContextIndexState)(context2, true, true);
const props2 = {
start: isFirstRow,
end: isLastRow,
label: command.displayName,
labelLineClamp: 1,
subLabel: command.displayDescription,
subLabelLineClamp: 1,
icon,
onPress: () => (0, env18726[1])(env18726[0], env18726[3], env18726[4]),
trailing: null
};
let tryExecuteCommand = void 0;
if (installOnDemand2) {
let c18727_0 = async (c30389_0) => {
let c31621_0 = c30389_0;
let channel = void 0;
const r32 = env18726[0];
const r34 = env18726[2];
if (r34.type === "channel") {
channel = r34.channel;
}
if ((await installApplicationOnDemandIfNeeded({
applicationId: r32.applicationId,
channel,
commandIntegrationTypes: r32.integration_types,
appLauncherContext: {
entrypoint: env18726[6],
location: env18726[4],
sectionName: env18726[5]
}
})).isAuthorized) {
(0, c31621_0)();
}
};
tryExecuteCommand = function() {
return c18727_0.apply(this, arguments);
};
}
props2.trailing = <CommandRowButton command={command} context={context2} beforeExecuteCommand={() => trackCommandSelected({
command: env18726[0],
location: env18726[4],
triggerSection: getCommandTriggerSection(env18726[3]),
sectionName: env18726[5]
})} onExecuteCommand={onExecuteCommand} tryExecuteCommand={tryExecuteCommand} sectionName={sectionName2} />;
return <TableRow {...props2} />;
};
const DEFAULT_CONTENT_PADDING2 = DEFAULT_CONTENT_PADDING;
useStyles = createStyles({
headerSpacer: {
height: EXPANDED_HEADER_HEIGHT - SHEET_HANDLE_CONTAINER_HEIGHT
},
list: {
paddingHorizontal: DEFAULT_CONTENT_PADDING2
},
commandsHeaderContainer: {
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
marginBottom: 8
},
commandsHeaderTextContainer: {
alignItems: "center",
flexDirection: "row",
gap: 8
},
viewContainerStyle: {
borderRadius: Module712.radii.lg
},
mainContainerStyle: {
backgroundColor: Module712.colors.CARD_BACKGROUND_DEFAULT,
paddingHorizontal: 12,
paddingVertical: 16
},
monetizationDisclosureTextStyle: {
marginLeft: Module712.space.PX_4
},
monetizationDisclosureContainerStyle: {
flexDirection: "row",
alignItems: "center",
marginBottom: Module712.space.PX_24,
gap: Module712.space.PX_16
},
monetizationDisclosureStyle: {
flexDirection: "row",
alignItems: "center"
},
loadingTextPlaceholder: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
height: 16,
marginBottom: 4,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start"
},
loadingTextPlaceholderSmall: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
height: 16,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start"
},
noCommandsTextContainer: {
alignItems: "center"
}
});
c7669_17 = {
PLACEHOLDER: 0,
0: "PLACEHOLDER",
COMMAND: 1,
1: "COMMAND"
};
c7669_18 = new Array(6).fill({
type: c7669_17.PLACEHOLDER
});
export default function AppDetailContent(props) {
let navigation, callback, callback2, section, paddingBottom;
const { context, application, lockableScrollableContentOffsetY, onPressBack, installOnDemand, sectionName, onActivityItemSelected, entrypoint, onCommandExecuted, onAauth2Cancel } = props;
navigation = void 0;
callback = void 0;
callback2 = void 0;
section = void 0;
paddingBottom = void 0;
const styles = useStyles();
let c18728_7 = styles;
const bottom = useSafeAreaInsets_native().bottom;
const requiredAppLauncherContext = useRequiredAppLauncherContext();
const { chatInputRef, keyboardCloseReasonRef } = requiredAppLauncherContext;
const discovery = useDiscovery({
context,
filters: {
commandTypes: [ApplicationCommandType.CHAT]
},
options: {
placeholderCount: 0,
limit: DISCOVERY_COMMANDS_QUERY_LIMIT,
includeFrecency: true,
allowApplicationState: installOnDemand,
installOnDemand,
applicationId: application.id
},
allowFetch: true
});
const { filterSection, commandsByActiveSection, sectionDescriptors, loading } = discovery;
const sortedSectionCommands = useSortedSectionCommands({
sectionId: application.id,
commandsByActiveSection
});
const { sortOrder, setSortOrder, commands } = sortedSectionCommands;
let canSort = sortedSectionCommands.canSort;
const result = (0, useUserIndexState)(true, true).result;
const r5 = (result == null ? void 0 : result.sections[application.id]) == null;
const r3 = loading ? !loading : commands.length === 0;
const showsAddCTA = r3 && r5 && !isEmbeddedApp(application);
const memo = useMemo(() => context.type !== "channel" ? [] : loading ? c7669_18 : commands.map((a0) => ({
type: c7669_17.COMMAND,
command: a0
})), [loading, commands, context.type]);
useEffect(() => {
filterSection(application.id);
}, [application.id, filterSection]);
navigation = (0, useAppLauncherNavigation)();
callback = useCallback(function(a0, a1, location2 = ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW) {
handleApplicationCommandSelected({
location: location2,
context,
command: a0,
section: a1,
sectionDescriptors,
query: "",
navigation,
installOnDemand,
sectionName,
entrypoint,
onCommandExecuted
});
}, [context, entrypoint, installOnDemand, navigation, onCommandExecuted, sectionDescriptors, sectionName]);
callback2 = useCallback(() => {
const current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
keyboardCloseReasonRef.current = AppLauncherKeyboardCloseReason.COMMAND;
if (onCommandExecuted != null) {
onCommandExecuted();
}
}, [chatInputRef, keyboardCloseReasonRef, onCommandExecuted]);
section = sectionDescriptors.find((sectionDescriptor) => sectionDescriptor.id === application.id);
const callback3 = useCallback(({ item, index }) => {
const type = item.type;
if (c7669_17.PLACEHOLDER === type) {
return (0, jsx)(PlaceholderCommandRow, {
isFirstRow: index === 0,
isLastRow: index === c7669_18.length - 1
});
}
if (c7669_17.COMMAND === type) {
return (0, jsx)(CommandRow, {
command: item.command,
onPressCommand: callback,
isFirstRow: index === 0,
isLastRow: index === commands.length - 1,
context,
onExecuteCommand: callback2,
section,
location: ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW,
installOnDemand,
sectionName
});
}
return null;
}, [callback, commands.length, context, callback2, section, installOnDemand, sectionName]);
paddingBottom = bottom + DEFAULT_CONTENT_PADDING;
const memo2 = useMemo(() => {
const r4 = isAndroid() && isApplicationMonetizedWithIAP(application);
const isApplicationAdSupported = _AppLauncherUtils.isApplicationAdSupported(application);
let r28 = null;
if (isApplicationAdSupported) {
r28 = <View style={c18728_7.monetizationDisclosureStyle}>
<BillIcon size="sm" color="icon-muted" />
<Text style={c18728_7.monetizationDisclosureTextStyle} variant="text-xs/normal" color="text-subtle" lineClamp={1}>
{intl.string(t["5khEk8"])}
</Text>
</View>;
}
let r46 = null;
if (r4) {
r46 = <View style={c18728_7.monetizationDisclosureStyle}>
<ShopIcon size="sm" color="icon-muted" />
<Text style={c18728_7.monetizationDisclosureTextStyle} variant="text-xs/normal" color="text-subtle" lineClamp={1}>
{intl.string(t["8z5B2U"])}
</Text>
</View>;
}
return r4 ? (0, jsxs)(View, {
style: c18728_7.monetizationDisclosureContainerStyle,
children: [r46, r28]
}) : isApplicationAdSupported ? (0, jsxs)(View, {
style: c18728_7.monetizationDisclosureContainerStyle,
children: [r46, r28]
}) : null;
}, [application, styles.monetizationDisclosureContainerStyle, styles.monetizationDisclosureStyle, styles.monetizationDisclosureTextStyle]);
const memo3 = useMemo(() => ({
...c18728_7.list,
paddingBottom
}), [paddingBottom, styles.list]);
const memo4 = useMemo(() => ({
bottom: paddingBottom
}), [paddingBottom]);
const appLauncherFlashListProps = useAppLauncherFlashListProps();
const r137 = [<View style={styles.headerSpacer} />, isEmbeddedApp(application) ? <ActivityDetailContent application={application} context={context} sectionName={sectionName} onActivityItemSelected={onActivityItemSelected} entrypoint={entrypoint} hasCommands={commands.length > 0} /> : <DetailsHeader application={application} viewContainerStyle={styles.viewContainerStyle} mainContainerStyle={styles.mainContainerStyle} />, <Spacer size={memo2 == null ? 24 : Module712.space.PX_16} />, memo2, commands.length > 1 && !loading && context.type === "channel" && <FrecencyCommandsSection context={context} allCommands={commands} onPressCommand={callback} section={section} onExecuteCommand={callback2} installOnDemand={installOnDemand} sectionName={sectionName} />, r3 ? isEmbeddedApp(application) ? null : <View style={styles.noCommandsTextContainer}>
<Text variant="text-sm/normal" color="text-default">
{intl.string(t["w8+YDM"])}
</Text>
</View> : null, ,];
let r191 = null;
if (!r3) {
const type = context.type;
r191 = null;
if (type === "channel") {
const r213 = [<View style={styles.commandsHeaderTextContainer}>
<Heading variant="text-md/medium" color="text-default">
{intl.string(t.GOXqks)}
</Heading>
</View>, ,];
if (canSort) {
canSort = <CommandListSortButton sortOrder={sortOrder} onSortOptionPress={function onSortOptionPress(event) {
setSortOrder(event);
}} />;
}
r213[1] = canSort;
r191 = <View style={styles.commandsHeaderContainer}>{r213}</View>;
}
}
r137[6] = r191;
return <>
<AppLauncherFlashList key={loading ? "loading" : void 0} ListHeaderComponent={<>{r137}</>} contentContainerStyle={memo3} scrollIndicatorInsets={memo4} renderItem={callback3} data={memo} preserveScrollMomentum lockableScrollableContentOffsetY={lockableScrollableContentOffsetY} automaticallyAdjustsScrollIndicatorInsets={false} keyboardDismissMode="none" animatedOnScroll={appLauncherFlashListProps.onScroll} ref={appLauncherFlashListProps.scrollerRef} simultaneousHandlers={appLauncherFlashListProps.gestureRef} animatedProps={appLauncherFlashListProps.animatedProps} />
<Header application={application} onPressBack={onPressBack} scrollOffsetY={lockableScrollableContentOffsetY} showsAddCTA={showsAddCTA} onAddAppMenuClick={function onAddAppMenuClick({ installAppProps }) {
ActionSheetActionCreators.hideActionSheet();
keyboardCloseReasonRef.current = AppLauncherKeyboardCloseReason.OAUTH_MODAL;
const current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
const r29 = {
location: ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW_MORE_MENU,
application_id: application.id,
section_name: sectionName,
source: entrypoint
};
let c27016_0 = r29;
if (installAppProps.customInstallUrl == null) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_OAUTH2_AUTHORIZE_OPENED, r29);
}
installApplication({
...installAppProps,
source: "app_launcher_app_details",
oauth2Callback: ({ canceled, location: location2 }) => {
if (canceled) {
if (onAauth2Cancel != null) {
onAauth2Cancel();
}
} else if (location2 != null) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_OAUTH2_AUTHORIZE_SUCCEEDED, c27016_0);
}
}
});
}} />
</>;
};
export const BETWEEN_SECTIONS_MARGIN = 24;
export { CommandRow };
@@ -0,0 +1,43 @@
// Metro module 11307 (f11308).
import { getInstallAppProps } from "../../../../utils/AppLauncherUtils";
import { canInstallApplication } from "../../../../../applications/utils/ApplicationInstallUtils";
import { intl, t } from "../../../../../../intl/index.native";
import { CirclePlusIcon } from "../../../../../../design/components/Icon/native/redesign/generated/CirclePlusIcon";
import { DeveloperMode } from "../../../../../user_settings/UserSettings";
import { copy } from "../../../../../../utils/ClipboardUtils.native";
import { presentIdCopied } from "../../../../../toast/native/ToastUtils";
import { IdIcon } from "../../../../../../design/components/Icon/native/redesign/generated/IdIcon";
import { ContextMenu } from "../../../../../../design/components/ContextMenu/native/ContextMenu.native";
import { IconButton } from "../../../../../../design/components/Button/native/IconButton.native";
import Module8964 from "../../../../../../_bundle/Module8964";
export default function AppDetailsOverflowMenu(props) {
const { application, onAddAppMenuClick } = props;
const installAppProps = getInstallAppProps(application);
const r19 = canInstallApplication(installAppProps) && onAddAppMenuClick != null;
const items = [];
if (r19) {
items.push({
label: intl.string(t.NgXl3C),
action: () => onAddAppMenuClick({
installAppProps
}),
IconComponent: CirclePlusIcon
});
}
if (DeveloperMode.getSetting()) {
items.push({
label: intl.string(t["+NP/b2"]),
action: () => {
copy(application.id);
presentIdCopied();
},
IconComponent: IdIcon
});
}
return items.length !== 0 ? <ContextMenu items={items}>
{(a0) => {
const { ref, ...rest } = a0;
return <IconButton ref={a0.ref} size="sm" variant="secondary-overlay" icon={Module8964} {...rest} accessibilityLabel={intl.string(t.PdRCRg)} maxFontSizeMultiplier={1.5} />;
}}
</ContextMenu> : null;
};
@@ -0,0 +1,284 @@
// Metro module 9006 (f9007).
import * as Module19 from "react";
import { useRef, useState, useMemo, useEffect } from "react";
import { Pressable, StyleSheet, View } from "react-native";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import * as _ReanimatedRexport from "../../../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../../../reanimated/ReanimatedRexport";
import * as _AppLauncherUtils from "../../../../utils/AppLauncherUtils";
import { getSectionName, getSectionDescription } from "../../../../utils/AppLauncherUtils";
import { parseBioReactWithCachedAST } from "../../../../../markup/BioMarkupUtils";
import { useIsScreenLandscape } from "../../../../../screen/useIsScreenLandscape.native";
import usePrevious from "../../../../../../hooks/usePrevious";
import useRefValue from "../../../../../../hooks/useRefValue";
import { Heading, Text } from "../../../../../../design/components/Text/native/Text";
import * as _index_native from "../../../../../../intl/index.native";
import { intl } from "../../../../../../intl/index.native";
import { withTiming } from "../../../../../../design/animation/reanimated/timing/timing";
import { timingStandard } from "../../../../../../design/animation/reanimated/timing/timingPresets";
import Module5165 from "../../../../../../_bundle/Module5165";
import Module4611 from "../../../../../../_bundle/Module4611";
import { HorizontalGradient } from "../../../../../../ConstantsIOS";
const _excluded = ["black", "transparent"];
const useStyles = createStyles({
animatedViewContainer: {
overflow: "hidden"
},
container: {
position: "relative",
width: "100%"
},
measuringContainer: {
width: "100%",
position: "absolute"
},
descriptionContainer: {
marginTop: 8
},
viewMoreCTA: {
position: "absolute",
right: 0,
bottom: 0,
pointerEvents: "none"
},
maskFill: {
flex: 1,
backgroundColor: "black"
},
maskLastLine: {
flexDirection: "row"
},
maskFade: {
width: 32
},
collapseDescriptionCTA: {
marginTop: 4
},
nameContainer: {
display: "flex",
flexDirection: "row",
gap: Module712.space.PX_4,
overflow: "hidden"
},
nameText: {
flexShrink: 1
},
partnerLabelWrapper: {
justifyContent: "center",
paddingVertical: 2,
paddingHorizontal: Module712.space.PX_8,
backgroundColor: Module712.colors.INTERACTIVE_BACKGROUND_ACTIVE,
borderRadius: Module712.radii.lg
}
});
const __initData = {
code: "function DetailsHeaderTsx1(){const{height}=this.__closure;return{height:height.get()};}"
};
const __initData2 = {
code: "function DetailsHeaderTsx2(){const{runOnJS,setShouldLineClamp}=this.__closure;runOnJS(setShouldLineClamp)(true);}"
};
const r65 = Module19.memo(function DetailsHeader(props) {
let maskElement;
let sharedValue, sectionDescription, state3, setState3, state4, setState4, ref3, ref4, setState5, state5, setState6, isScreenLandscape, c16917_18;
const { application, viewContainerStyle, mainContainerStyle, hideName } = props;
sharedValue = void 0;
sectionDescription = void 0;
state3 = void 0;
setState3 = void 0;
state4 = void 0;
setState4 = void 0;
ref3 = void 0;
ref4 = void 0;
setState5 = void 0;
state5 = void 0;
setState6 = void 0;
isScreenLandscape = void 0;
c16917_18 = void 0;
const styles = useStyles();
const isPartnerApplication = _AppLauncherUtils.isPartnerApplication(application);
const ref = useRef(null);
const [state, setState] = useState(false);
const [state2, setState2] = useState(false);
const ref2 = useRef(true);
const sharedValue2 = useSharedValue(null);
const r63 = function t() {
return {
height: sharedValue2.get()
};
};
r63.__closure = {
height: sharedValue2
};
r63.__workletHash = 23826674246;
r63.__initData = __initData;
const animatedStyle = useAnimatedStyle(r63);
sharedValue = sharedValue2;
const sectionName = getSectionName(application);
sectionDescription = getSectionDescription(application);
let r73 = sectionDescription != null && sectionDescription.trim().length > 0;
let width;
[width, setState3] = useState(null);
state3 = width;
let height;
[height, setState4] = useState(null);
state4 = height;
ref3 = useRef(0);
ref4 = useRef(0);
let state6;
[state6, setState5] = useState(false);
[state5, setState6] = useState(false);
const memo = useMemo(() => sectionDescription != null ? parseBioReactWithCachedAST(sectionDescription) : null, [sectionDescription]);
isScreenLandscape = useIsScreenLandscape();
const previous = usePrevious(isScreenLandscape);
c16917_18 = previous;
useEffect(() => {
if (isScreenLandscape !== c16917_18) {
setState6(false);
ref4.current = 0;
ref3.current = 0;
}
}, [isScreenLandscape, previous]);
const refValue = useRefValue(ref);
const r31 = state ? !state2 : state;
const props2 = {
style: [styles.container, mainContainerStyle],
onLayout: function onLayout(a0) {
if (!state5) {
ref3.current = a0.nativeEvent.layout.height;
sharedValue.set(ref3.current);
if (ref4.current > 0 && ref3.current > 0) {
setState6(true);
}
}
},
children: null
};
const children = [<View style={styles.nameContainer}>
{hideName ? !hideName : <Heading style={styles.nameText} variant="heading-lg/bold" color="text-default" lineClamp={1}>{sectionName}</Heading>}
{isPartnerApplication ? <View style={styles.partnerLabelWrapper}>
<Text variant="text-xs/medium" color="text-default">
{intl.string(_index_native.t.LO4f0P)}
</Text>
</View> : null}
</View>, ,];
let r151 = r73;
if (r73) {
const style2 = hideName ? !hideName : styles.descriptionContainer;
const props3 = {
style: null
};
const absoluteFill = StyleSheet.absoluteFill;
if (r31) {
props3.style = styles.maskFill;
const r167 = [<View {...props3} />, ,];
const style = [styles.maskLastLine, ,];
if (state4 == null) {
height = 0;
}
style[1] = {
height
};
const r173 = [<View style={styles.maskFill} />, <Module4611 start={HorizontalGradient.START} end={HorizontalGradient.END} colors={_excluded} style={styles.maskFade} />, ,];
if (state3 == null) {
width = 0;
}
r173[2] = <View style={{
width
}} />;
r167[1] = <View style={style}>{r173}</View>;
maskElement = <View style={absoluteFill}>{r167}</View>;
} else {
props3.style = [absoluteFill, styles.maskFill];
maskElement = <View {...props3} />;
}
r151 = <Pressable style={style2} onPress={function onPress() {
if (state) {
ref2.current = false;
if (state2) {
const current = ref3.current;
const r49 = function t() {
_ReanimatedRexport.runOnJS(setState5)(true);
};
r49.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
setShouldLineClamp: setState5
};
r49.__workletHash = 6050776164847;
r49.__initData = __initData2;
sharedValue.set(withTiming(current, timingStandard, "respect-motion-settings", r49));
} else {
setState5(false);
sharedValue.set(withTiming(ref4.current, timingStandard));
}
setState2(!state2);
}
}} accessibilityRole="button">
<Module5165 maskElement={maskElement}>
<Text variant="text-sm/medium" color="text-default" lineClamp={state6 ? 3 : refValue == null ? 3 : void 0}>{memo}</Text>
</Module5165>
{r31 ? <View style={styles.viewMoreCTA}>
<Text onLayout={(event) => {
if (state3 == null) {
setState3(event.nativeEvent.layout.width);
}
}} variant="text-sm/medium" color="text-brand">
{"… "}
{intl.string(_index_native.t["OBCR+p"])}
</Text>
</View> : null}
{state ? state2 ? <Text variant="text-sm/medium" color="text-brand" style={styles.collapseDescriptionCTA}>
{intl.string(_index_native.t.D5xGUK)}
</Text> : null : null}
</Pressable>;
}
children[1] = r151;
props2.children = children;
const r238 = [<ReanimatedRexport.View style={[styles.animatedViewContainer, animatedStyle, viewContainerStyle]}>
<View {...props2} />
</ReanimatedRexport.View>, ,];
let r239 = !state5;
if (!state5) {
const props4 = {
style: [mainContainerStyle, styles.measuringContainer, {
opacity: 0,
pointerEvents: "none"
}],
onLayout: function onLayout(a0) {
ref4.current = a0.nativeEvent.layout.height;
if (ref4.current > 0 && ref3.current > 0) {
setState6(true);
}
},
children: null
};
const children2 = [hideName ? !hideName : <Heading variant="heading-lg/bold" color="text-default">{sectionName}</Heading>, ,];
if (r73) {
r73 = <View style={hideName ? !hideName : styles.descriptionContainer}>
<Text variant="text-sm/medium" color="text-default" onTextLayout={function onTextLayout(event) {
const lines = event.nativeEvent.lines;
const length = lines.length;
if (state4 == null && lines[0] != null) {
setState4(lines[0].height);
}
if (ref.current == null) {
ref.current = length;
}
if (length > 3) {
setState5(true);
setState(true);
}
}}>{memo}</Text>
<Text variant="text-sm/medium" color="text-brand" style={styles.collapseDescriptionCTA}>
{intl.string(_index_native.t.D5xGUK)}
</Text>
</View>;
}
children2[1] = r73;
props4.children = children2;
r239 = <View {...props4} />;
}
r238[1] = r239;
return <>{r238}</>;
});
export default r65;
@@ -0,0 +1,50 @@
// Metro module 11324 (f11325).
import { useEffect } from "react";
import { View } from "react-native";
import { AnalyticEvents } from "../../../../../../Constants";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import { BETWEEN_SECTIONS_MARGIN, CommandRow } from "./AppDetailContent";
import useFilterAndSortToOnlyFrecentCommands from "../../../../hooks/useFilterAndSortToOnlyFrecentCommands";
import { trackWithMetadata } from "../../../../../app_analytics/AppAnalyticsUtils";
import { AppLauncherLocations } from "../../../../AppLauncherTypes";
import { Heading } from "../../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../../intl/index.native";
import { ApplicationCommandTriggerLocations } from "../../../../../application_commands/ApplicationCommandTypes";
const useStyles = createStyles({
container: {
marginBottom: BETWEEN_SECTIONS_MARGIN
},
header: {
flexDirection: "row",
alignItems: "center",
gap: 4,
marginBottom: 8
}
});
export default function FrecencyCommandsSection(props) {
const { context, allCommands, onPressCommand, section, onExecuteCommand, installOnDemand, sectionName } = props;
const styles = useStyles();
const filterAndSortToOnlyFrecentCommands = useFilterAndSortToOnlyFrecentCommands({
context,
commands: allCommands,
limit: 5
});
let c18743_6 = filterAndSortToOnlyFrecentCommands;
useEffect(() => {
if (c18743_6.length !== 0) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_FRECENTS_SEEN, {
num: c18743_6.length,
section_name: sectionName,
location: AppLauncherLocations.APP_DETAIL
});
}
}, [filterAndSortToOnlyFrecentCommands.length, sectionName]);
return filterAndSortToOnlyFrecentCommands.length !== 0 ? <View style={styles.container}>
<View style={styles.header}>
<Heading variant="text-md/medium" color="text-default">
{intl.string(t.acSE0h)}
</Heading>
</View>
{filterAndSortToOnlyFrecentCommands.map((filterAndSortToOnlyFrecentCommand, index) => <CommandRow key={filterAndSortToOnlyFrecentCommand.id} command={filterAndSortToOnlyFrecentCommand} onPressCommand={onPressCommand} isFirstRow={index === 0} isLastRow={index === c18743_6.length - 1} context={context} onExecuteCommand={onExecuteCommand} installOnDemand={installOnDemand} section={section} location={ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW_FRECENCT} sectionName={sectionName} />)}
</View> : null;
};
@@ -0,0 +1,26 @@
// Metro module 11327 (f11328).
import { CommandListSortOrder } from "../../../../../AppLauncherConstants";
import { intl, t } from "../../../../../../../intl/index.native";
import { BottomSheet } from "../../../../../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { ArrowsUpDownIcon } from "../../../../../../../design/components/Icon/native/redesign/generated/ArrowsUpDownIcon";
import Module712 from "../../../../../../../_bundle/Module712";
import { TableRadioGroup } from "../../../../../../../design/components/TableRow/native/TableRadioGroup.native";
import { TableRadioRow } from "../../../../../../../design/components/TableRow/native/TableRadioRow.native";
export default function CommandListSortActionSheet(props) {
const { onClose, sortOrder, onSortOptionPress } = props;
return <BottomSheet startExpanded header={<BottomSheetTitleHeader leading={<ArrowsUpDownIcon size="sm" color={Module712.colors.TEXT_DEFAULT} />} title={intl.string(t.yeYaHf)} />}>
<TableRadioGroup hasIcons={false} value={sortOrder} onChange={function onChange(event) {
onSortOptionPress(event);
onClose();
}}>
{[{
label: intl.string(t.SzxiqK),
value: CommandListSortOrder.POPULAR
}, {
label: intl.string(t.m8xsti),
value: CommandListSortOrder.ALPHABETICAL
}].map(({ label, value }) => <TableRadioRow key={value} label={label} value={value} />)}
</TableRadioGroup>
</BottomSheet>;
};
@@ -0,0 +1,45 @@
// Metro module 11326 (f11327).
import { View } from "react-native";
import { CommandListSortOrder } from "../../../../../AppLauncherConstants";
import { ANDROID_FOREGROUND_RIPPLE } from "../../../../../../../design/void/Form/native/FormConstants";
import { createStyles } from "../../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../../_bundle/Module712";
import { intl, t } from "../../../../../../../intl/index.native";
import { PressableOpacity } from "../../../../../../../design/void/Pressables/native/Pressables";
import ActionSheetActionCreators from "../../../../../../action_sheet/native/ActionSheetActionCreators";
import { Text } from "../../../../../../../design/components/Text/native/Text";
import { ChevronSmallDownIcon } from "../../../../../../../design/components/Icon/native/redesign/generated/ChevronSmallDownIcon";
const useStyles = createStyles({
container: {
overflow: "hidden",
borderRadius: Module712.radii.xxl
},
button: {
gap: 4,
flexDirection: "row",
alignItems: "center",
paddingHorizontal: 12,
paddingVertical: 4,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL
}
});
export default function CommandListSortButton(props) {
const { sortOrder, onSortOptionPress } = props;
const styles = useStyles();
return <PressableOpacity accessibilityRole="button" androidRippleConfig={ANDROID_FOREGROUND_RIPPLE} activeOpacity={0.8} style={styles.container} onPress={function onPress() {
ActionSheetActionCreators.openLazy(import("./CommandListSortActionSheet"), "CommandListSortActionSheet", {
sortOrder,
onSortOptionPress,
onClose: () => {
ActionSheetActionCreators.hideActionSheet("CommandListSortActionSheet");
}
});
}}>
<View style={styles.button}>
<Text variant="text-sm/medium" color="text-default">
{CommandListSortOrder.POPULAR === sortOrder ? intl.string(t.SzxiqK) : CommandListSortOrder.ALPHABETICAL === sortOrder ? intl.string(t.m8xsti) : void 0}
</Text>
<ChevronSmallDownIcon size="xs" color={Module712.colors.TEXT_DEFAULT} />
</View>
</PressableOpacity>;
};
@@ -0,0 +1,152 @@
// Metro module 11331 (f11332).
import { useMemo } from "react";
import { View } from "react-native";
import { DEFAULT_CONTENT_PADDING, SCREEN_BACKGROUND_COLOR } from "../../AppLauncherNativeConstants";
import AppLauncherBackButton, { BACK_BUTTON_SIZE } from "../../base_components/AppLauncherBackButton";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { getAppLauncherIconSource } from "../../AppLauncherNativeUtils";
import * as _ReanimatedRexport from "../../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle } from "../../../../reanimated/ReanimatedRexport";
import { useToken } from "../../../../../design/tokens/native/useToken";
import useAvatarColor from "../../../../avatar/useAvatarColor";
import FastImage from "../../../../../components_native/common/FastImage";
import { Text } from "../../../../../design/components/Text/native/Text";
import { Spacer } from "../../../../../design/void/native";
const r37 = BACK_BUTTON_SIZE + 2 * DEFAULT_CONTENT_PADDING + 36 + 4;
const TOTAL_SCROLL_RANGE = r37 - 56;
const useStyles = createStyles({
headerContainer: {
alignItems: "center",
flexDirection: "row",
justifyContent: "space-between",
position: "absolute",
top: -16,
left: 0,
right: 0,
padding: DEFAULT_CONTENT_PADDING
},
loadingHeaderContainer: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
appIconMask: {
position: "absolute",
padding: 4,
bottom: -36,
left: "50%",
backgroundColor: SCREEN_BACKGROUND_COLOR,
borderRadius: Module712.radii.xl + 4
},
appIcon: {
width: 72,
height: 72,
borderRadius: Module712.radii.xl
},
loadingIcon: {
backgroundColor: Module712.colors.BACKGROUND_MOD_MUTED
},
appSmallName: {
textAlign: "center",
pointerEvents: "none",
flexGrow: 1,
marginHorizontal: 8
},
icon: {
transform: [{
rotate: "180deg"
}]
},
headerBannerOverlay: {
backgroundColor: "black",
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0
}
});
const __initData = {
code: "function AppLauncherCommandViewHeaderTsx1(){const{interpolate,scrollOffsetY,TOTAL_SCROLL_RANGE}=this.__closure;return{opacity:interpolate(scrollOffsetY.get(),[0,TOTAL_SCROLL_RANGE],[0,1],'clamp'),transform:[{translateY:interpolate(scrollOffsetY.get(),[0,TOTAL_SCROLL_RANGE],[12,0],'clamp')}]};}"
};
const __initData2 = {
code: "function AppLauncherCommandViewHeaderTsx2(){const{APP_ICON_SIZE,APP_ICON_BORDER_WIDTH,DEFAULT_CONTENT_PADDING,interpolate,scrollOffsetY,TOTAL_SCROLL_RANGE}=this.__closure;return{transform:[{translateX:-APP_ICON_SIZE/2-APP_ICON_BORDER_WIDTH+DEFAULT_CONTENT_PADDING},{translateY:interpolate(scrollOffsetY.get(),[0,TOTAL_SCROLL_RANGE],[0,-APP_ICON_SIZE/2],'clamp')},{scale:interpolate(scrollOffsetY.get(),[0,TOTAL_SCROLL_RANGE],[1,0],'clamp')}],opacity:interpolate(scrollOffsetY.get(),[0,TOTAL_SCROLL_RANGE],[1,0],'clamp')};}"
};
const __initData3 = {
code: "function AppLauncherCommandViewHeaderTsx3(){const{interpolate,scrollOffsetY,TOTAL_SCROLL_RANGE}=this.__closure;return{opacity:interpolate(scrollOffsetY.get(),[0,TOTAL_SCROLL_RANGE],[0,0.5],'clamp')};}"
};
export const COLLAPSED_HEADER_HEIGHT = 56;
export const EXPANDED_HEADER_TOTAL_CONSUMED_SPACE_IN_PARENT = r37 + -16;
export { useStyles };
export function AppLauncherCommandViewHeader(props) {
const { command, onPressBack, scrollOffsetY, section } = props;
const styles = useStyles();
const memo = useMemo(() => getAppLauncherIconSource(section?.application), [section]);
const A = () => ({
opacity: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, TOTAL_SCROLL_RANGE], [0, 1], "clamp"),
transform: [{
translateY: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, TOTAL_SCROLL_RANGE], [12, 0], "clamp")
}]
});
A.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
TOTAL_SCROLL_RANGE
};
A.__workletHash = 15596175827193;
A.__initData = __initData;
const animatedStyle = useAnimatedStyle(A);
const E = () => ({
transform: [{
translateX: -40 + DEFAULT_CONTENT_PADDING
}, {
translateY: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, TOTAL_SCROLL_RANGE], [0, -36], "clamp")
}, {
scale: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, TOTAL_SCROLL_RANGE], [1, 0], "clamp")
}],
opacity: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, TOTAL_SCROLL_RANGE], [1, 0], "clamp")
});
E.__closure = {
APP_ICON_SIZE: 72,
APP_ICON_BORDER_WIDTH: 4,
DEFAULT_CONTENT_PADDING,
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
TOTAL_SCROLL_RANGE
};
E.__workletHash = 13563524587234;
E.__initData = __initData2;
const animatedStyle3 = useAnimatedStyle(E);
const N = () => ({
opacity: _ReanimatedRexport.interpolate(scrollOffsetY.get(), [0, TOTAL_SCROLL_RANGE], [0, 0.5], "clamp")
});
N.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollOffsetY,
TOTAL_SCROLL_RANGE
};
N.__workletHash = 2637023147700;
N.__initData = __initData3;
const animatedStyle2 = useAnimatedStyle(N);
let r62 = useToken(Module712.colors.BACKGROUND_BASE_LOW);
let r65 = memo;
if (typeof r65 !== "number") {
r65 = memo?.uri;
}
if (r62 == null) {
r62 = "";
}
const avatarColor = useAvatarColor(r65, r62);
return <View style={[styles.headerContainer, command == null ? styles.loadingHeaderContainer : {
backgroundColor: avatarColor
}]}>
<ReanimatedRexport.View style={[styles.headerBannerOverlay, animatedStyle2]} />
<AppLauncherBackButton onPress={onPressBack} />
<Text lineClamp={1} animated style={[styles.appSmallName, animatedStyle]} variant="heading-lg/bold" color="text-overlay-light">
{command?.displayName}
</Text>
<Spacer size={32} />
<ReanimatedRexport.View style={[styles.appIconMask, animatedStyle3]}>
{memo != null ? <FastImage style={styles.appIcon} source={memo} /> : <View style={[styles.appIcon, styles.loadingIcon]} />}
</ReanimatedRexport.View>
</View>;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,81 @@
// Metro module 11337 (f11338).
import { View } from "react-native";
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import { ApplicationCommandOptionType } from "../../../../../flow/Server";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import ReanimatedRexport, { ReduceMotion, FadeOut, FadeInUp, LayoutAnimationConfig } from "../../../../reanimated/ReanimatedRexport";
import { useOptionEnteringAnimation, ExitingAnimation, LayoutAnimation } from "./hooks/useOptionAnimations";
import { AwaitAnimationContext } from "../../hooks/useAwaitAnimationComplete";
import { Text } from "../../../../../design/components/Text/native/Text";
import AppLauncherCommandOption from "../../options/AppLauncherCommandOption";
import { Icon, IconSizes } from "../../../../../design/void/native";
import Module9651 from "../../../../../_bundle/Module9651";
let c7696_7 = new Set([ApplicationCommandOptionType.STRING, ApplicationCommandOptionType.INTEGER, ApplicationCommandOptionType.ATTACHMENT, ApplicationCommandOptionType.BOOLEAN, ApplicationCommandOptionType.MENTIONABLE, ApplicationCommandOptionType.USER, ApplicationCommandOptionType.ROLE, ApplicationCommandOptionType.CHANNEL, ApplicationCommandOptionType.NUMBER]);
const useStyles = createStyles({
optionDescription: {
marginTop: 4
},
optionErrorContainer: {
flexDirection: "row",
alignItems: "center",
marginTop: 4
},
optionErrorIcon: {
marginRight: 4,
tintColor: Module712.colors.ICON_FEEDBACK_CRITICAL,
alignItems: "center"
},
labelText: {
marginBottom: 8
}
});
let c7696_9 = [ApplicationCommandOptionType.STRING, ApplicationCommandOptionType.INTEGER, ApplicationCommandOptionType.NUMBER];
export default function CommandOptionView(props) {
const { style, option, autoFocusType, onDismiss, editedOptions, onOptionViewLayout, onStartEditing, onEndEditing, onOptionValueChange, onPressOption, onPressAttachmentOption: onPressAttachmentOption2, channel, optionValidationResults, setFocusedOption, command, optionValues, isPreSelectedOption } = props;
const styles = useStyles();
const r47 = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion) ? ReduceMotion.Always : ReduceMotion.Never;
const optionEnteringAnimation = useOptionEnteringAnimation();
const EnteringAnimation = optionEnteringAnimation.EnteringAnimation;
let registerAnimationCompleteCallback = optionEnteringAnimation.registerAnimationCompleteCallback;
if (c7696_7.has(option.type)) {
const skipEntering = option.required || isPreSelectedOption;
if (skipEntering) {
registerAnimationCompleteCallback = (a0) => a0();
}
const exiting = FadeOut.reduceMotion(r47);
const entering = FadeInUp.withInitialValues({
transform: [{
translateY: -10
}]
}).reduceMotion(r47);
let hasError = editedOptions.has(option.name) && optionValidationResults[option.name]?.error != null;
const r77 = c7696_9.includes(option.type);
const props2 = {
collapsable: false,
entering: EnteringAnimation,
exiting: ExitingAnimation,
layout: LayoutAnimation,
onLayout: (a0) => {
onOptionViewLayout(a0, option);
},
children: null
};
const r106 = [r77 && <Text style={styles.labelText} variant="text-sm/semibold" color="text-subtle">{option.displayName}</Text>, <AppLauncherCommandOption option={option} onStartEditing={onStartEditing} onEndEditing={onEndEditing} onDismiss={onDismiss} onOptionValueChange={onOptionValueChange} onFocus={() => setFocusedOption(option)} onPress={() => onPressOption(option)} onPressAttachmentOption={() => onPressAttachmentOption2(option)} channel={channel} autoFocusType={autoFocusType} command={command} optionValues={optionValues} hasError={hasError} />, <Text style={styles.optionDescription} variant="text-xs/medium" color="text-muted">{option.displayDescription}</Text>, ,];
if (hasError) {
hasError = <ReanimatedRexport.View collapsable={false} entering={entering} exiting={exiting} style={styles.optionErrorContainer}>
<Icon style={styles.optionErrorIcon} source={Module9651} size={IconSizes.REFRESH_SMALL_16} />
<Text variant="text-xs/medium" color="text-feedback-critical">{optionValidationResults[option.name].error}</Text>
</ReanimatedRexport.View>;
}
r106[3] = hasError;
props2.children = <View collapsable={false} style={style}>{r106}</View>;
return <LayoutAnimationConfig skipEntering={skipEntering}>
<AwaitAnimationContext handleQueuedCallback={registerAnimationCompleteCallback}>
<ReanimatedRexport.View {...props2} />
</AwaitAnimationContext>
</LayoutAnimationConfig>;
}
return null;
};
@@ -0,0 +1,48 @@
// Metro module 11366 (f11367).
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { TableRow } from "../../../../../design/components/TableRow/native/TableRow.native";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
let useStyles;
const OptionList = function OptionList(props) {
const { options, onSelectOption, style } = props;
const styles = useStyles();
return <View style={[styles.container, style]} collapsable={false}>
{options.map((option, index) => {
return <TableRow key={option.name} onPress={() => onSelectOption(option)} start={false} end={index === options.length - 1} label={option.displayName} subLabel={option.displayDescription} trailing={<PressableOpacity accessibilityRole="button" style={styles.addButton} onPress={() => onSelectOption(option)}>
<Text variant="text-sm/semibold" style={styles.addButtonText}>
{intl.string(t.OYkgVk)}
</Text>
</PressableOpacity>} />;
})}
</View>;
};
useStyles = createStyles({
container: {
overflow: "hidden",
borderWidth: 1,
borderColor: Module712.colors.BORDER_SUBTLE,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.lg,
...Module712.shadows.SHADOW_BORDER
},
addButton: {
borderRadius: Module712.radii.round,
minWidth: 48,
height: 32,
justifyContent: "center",
alignItems: "center",
paddingHorizontal: 12,
backgroundColor: Module712.colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND
},
addButtonText: {
color: Module712.colors.REDESIGN_BUTTON_TERTIARY_TEXT
}
});
export default function OptionalCommandOptionList(props) {
const { options: options2, onSelectOption: onSelectOption2, style } = props;
return options2.length > 0 ? <OptionList style={style} options={options2} onSelectOption={onSelectOption2} /> : null;
};
@@ -0,0 +1,113 @@
// Metro module 11338 (f11339).
import _slicedToArray from "../../../../../../_bundle/_slicedToArray";
import { useRef, useCallback, useState } from "react";
import * as _timing from "../../../../../../design/animation/reanimated/timing/timing";
import * as _ReanimatedRexport from "../../../../../reanimated/ReanimatedRexport";
import { useSharedValue } from "../../../../../reanimated/ReanimatedRexport";
let __initData;
const duration = 300;
export function LayoutAnimation(a0) {
return {
initialValues: {
originY: a0.currentOriginY
},
animations: {
originY: _timing.withTiming(a0.targetOriginY, {
duration
})
}
};
}
LayoutAnimation.__closure = {
withTiming: _timing.withTiming,
OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION: 300
};
LayoutAnimation.__workletHash = 16804895997501;
LayoutAnimation.__initData = {
code: "function LayoutAnimation_useOptionAnimationsTsx1(values){const{withTiming,OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION}=this.__closure;const animations={originY:withTiming(values.targetOriginY,{duration:OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION})};const initialValues={originY:values.currentOriginY};return{initialValues:initialValues,animations:animations};}"
};
export function ExitingAnimation(a0) {
const r8 = Math.min(a0.currentOriginX - a0.windowWidth, -a0.windowWidth);
return {
initialValues: {
originX: a0.currentOriginX,
opacity: 1
},
animations: {
opacity: _timing.withTiming(0, {
duration
}),
originX: _timing.withTiming(r8, {
duration
})
}
};
}
ExitingAnimation.__closure = {
withTiming: _timing.withTiming,
OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION: 300
};
ExitingAnimation.__workletHash = 8977480282966;
ExitingAnimation.__initData = {
code: "function ExitingAnimation_useOptionAnimationsTsx2(values){const{withTiming,OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION}=this.__closure;const offScreenX=Math.min(values.currentOriginX-values.windowWidth,-values.windowWidth);const animations={opacity:withTiming(0,{duration:OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION}),originX:withTiming(offScreenX,{duration:OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION})};const initialValues={originX:values.currentOriginX,opacity:1};return{initialValues:initialValues,animations:animations};}"
};
__initData = {
code: "function useOptionAnimationsTsx3(){const{withTiming,Easing,OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION,withDelay,runOnJS,handleMountAnimationComplete}=this.__closure;const scaleAnimation=withTiming(1,{duration:250,easing:Easing.bezier(0.25,1.75,0.25,1.25)});const opacityAnimation=withTiming(1,{duration:200});const layoutShiftDelay=OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION-100;return{animations:{opacity:withDelay(layoutShiftDelay,opacityAnimation),transform:[{scale:withDelay(layoutShiftDelay,scaleAnimation)}]},initialValues:{opacity:0,transform:[{scale:0.92}]},callback:function(){runOnJS(handleMountAnimationComplete)();}};}"
};
export const OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION = 300;
export function useOptionEnteringAnimation() {
const sharedValue = useSharedValue(false);
const ref = useRef([]);
const callback2 = useCallback(() => {
sharedValue.set(true);
ref.current.forEach((item) => item());
ref.current.splice(0, ref.current.length);
}, [sharedValue]);
return {
EnteringAnimation: _slicedToArray(useState(() => {
const n = function n() {
const r22 = _timing.withTiming(1, {
duration: 250,
easing: _ReanimatedRexport.Easing.bezier(0.25, 1.75, 0.25, 1.25)
});
return {
animations: {
opacity: _ReanimatedRexport.withDelay(200, _timing.withTiming(1, {
duration: 200
})),
transform: [{
scale: _ReanimatedRexport.withDelay(200, r22)
}]
},
initialValues: {
opacity: 0,
transform: [{
scale: 0.92
}]
},
callback: () => {
_ReanimatedRexport.runOnJS(callback2)();
}
};
};
n.__closure = {
withTiming: _timing.withTiming,
Easing: _ReanimatedRexport.Easing,
OPTION_ENTRY_EXIT_LAYOUT_SHIFT_DURATION: duration,
withDelay: _ReanimatedRexport.withDelay,
runOnJS: _ReanimatedRexport.runOnJS,
handleMountAnimationComplete: callback2
};
n.__workletHash = 1048348699475;
n.__initData = __initData;
return n;
}), 1)[0],
registerAnimationCompleteCallback: function registerAnimationCompleteCallback(a0) {
if (sharedValue.get()) {
a0();
} else {
ref.current.push(a0);
}
}
};
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,28 @@
// Metro module 11261 (f11262).
const r9 = {
PLACEHOLDER: 0,
0: "PLACEHOLDER",
SECTION_HEADER: 1,
1: "SECTION_HEADER",
APP: 2,
2: "APP",
SHELF_ITEM: 3,
3: "SHELF_ITEM",
SHELF_ITEM_TUPLE: 4,
4: "SHELF_ITEM_TUPLE",
DIVIDER_ITEM: 5,
5: "DIVIDER_ITEM",
RECOMMENDATION_SECTION_HEADER: 6,
6: "RECOMMENDATION_SECTION_HEADER",
RECOMMENDATION_BANNER_CARD: 7,
7: "RECOMMENDATION_BANNER_CARD",
RECOMMENDATION_APP: 8,
8: "RECOMMENDATION_APP",
RECOMMENDATION_TUPLE: 9,
9: "RECOMMENDATION_TUPLE",
VIEW_ALL: 10,
10: "VIEW_ALL",
LEARN_MORE: 11,
11: "LEARN_MORE"
};
export { r9 as AppLauncherHomeListItemType };
@@ -0,0 +1,32 @@
// Metro module 11284 (f11285).
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { useLogAppLauncherEmptyStateView } from "../../AppLauncherNativeUtils";
import { AppLauncherEmptyStateType } from "../../../AppLauncherTypes";
import HomeEmptyState from "../../images/HomeEmptyState";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
const useStyles = createStyles({
container: {
padding: 16,
gap: 16,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderRadius: Module712.radii.lg,
alignItems: "center",
justifyContent: "center"
},
textContainer: {
textAlign: "center"
}
});
export default function EmptyState() {
const styles = useStyles();
useLogAppLauncherEmptyStateView(AppLauncherEmptyStateType.HOME_EMPTY);
return <View style={styles.container}>
<HomeEmptyState />
<Text style={styles.textContainer} variant="text-md/semibold" color="text-default">
{intl.string(t["V7+xhH"])}
</Text>
</View>;
};
@@ -0,0 +1,316 @@
// Metro module 11226 (f11227).
import { useId, useCallback, useState, useEffect, useMemo } from "react";
import { ScrollView, View } from "react-native";
import EmbeddedActivitiesStore from "../../../../activities/EmbeddedActivitiesStore";
import FrecencySectionStore, { FrecencySectionSelection } from "./FrecencySectionStore";
import { AnalyticEvents } from "../../../../../Constants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { isEmbeddedApp, FAKE_BUILT_IN_APP, getSectionName, formatPrimaryEntryPointCommandName } from "../../../utils/AppLauncherUtils";
import { isNotNullish } from "../../../../../utils/GlobalUtils";
import useGetOrFetchApplications from "../../../../applications/useGetOrFetchApplications";
import MobileVisualRefreshExperiment from "../../../../themes/experiments/MobileVisualRefreshExperiment";
import { usePlaceholderWidth } from "../../hooks/usePlaceholderSize";
import { useAppLauncherContext } from "../../AppLauncherContext";
import { useStateFromStoresArray, useStateFromStores } from "../../../../../_bundle/Module589";
import { AppLauncherSectionName, AppLauncherEntrypoint, AppLauncherLocations } from "../../../AppLauncherTypes";
import { trackWithMetadata } from "../../../../app_analytics/AppAnalyticsUtils";
import ReanimatedRexport, { useAnimatedStyle } from "../../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../../design/animation/reanimated/timing/timing";
import { intl, t } from "../../../../../intl/index.native";
import { CheckmarkSmallBoldIcon } from "../../../../../design/components/Icon/native/redesign/generated/CheckmarkSmallBoldIcon";
import { setFrecencySectionSelection } from "./FrecencySectionStoreActionCreators";
import { useHandleActivityItemSelected, getAppLauncherIconSource } from "../../AppLauncherNativeUtils";
import { ApplicationCommandType } from "../../../../../flow/Server";
import { PressableScale } from "../../../../../design/components/experimental/native";
import EntityBorderAppIcon from "../../base_components/EntityBorderAppIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { ContextMenu } from "../../../../../design/components/ContextMenu/native/ContextMenu.native";
import { ChevronSmallDownIcon } from "../../../../../design/components/Icon/native/redesign/generated/ChevronSmallDownIcon";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import { useActivityAction, ActivityAction } from "../../../../activities/utils/useActivityShelfItem";
import { ApplicationCommandTriggerLocations } from "../../../../application_commands/ApplicationCommandTypes";
import FastImage from "../../../../../components_native/common/FastImage";
import { SubmittingOverlay } from "./SubmittingOverlay";
let useStyles, c7605_15, __initData, FrecentActivityOneClickCTA, FrecentApp;
const Placeholder = function Placeholder() {
const r17 = MobileVisualRefreshExperiment("AppLauncherRecents-native");
const styles2 = useStyles();
return <View style={[styles2.commandContainer, r17 ? !r17 : styles2.rowShadow]}>
<View style={styles2.loadingCommandIcon} />
<View>
<View style={[styles2.loadingTextPlaceholder, {
width: usePlaceholderWidth(20, 90)
}]} />
<View style={[styles2.loadingTextPlaceholderSmall, {
width: usePlaceholderWidth(20, 70)
}]} />
</View>
</View>;
};
FrecentActivityOneClickCTA = function FrecentActivityOneClickCTA(props) {
let handleActivityItemSelected;
const { context, app } = props;
handleActivityItemSelected = void 0;
const appLauncherContext = useAppLauncherContext();
const { entrypoint, onActivityItemSelected } = appLauncherContext;
const id = useId();
let [disabled, r32] = useStateFromStoresArray([EmbeddedActivitiesStore], () => [EmbeddedActivitiesStore.isLaunchingActivity(), EmbeddedActivitiesStore.getLaunchState(app.applicationId, context.type === "channel" ? context.channel.id : void 0)]);
const activityAction = useActivityAction({
context,
applicationId: app.applicationId
});
const submitting = r32 != null && r32.isLaunching && r32.componentId === id;
handleActivityItemSelected = useHandleActivityItemSelected({
applicationId: app.applicationId,
context,
sectionName: AppLauncherSectionName.RECENT_APPS,
onActivityItemSelected,
location: ApplicationCommandTriggerLocations.APP_LAUNCHER_HOME,
entrypoint,
launchingComponentId: id,
fetchesApplication: false
}).handleActivityItemSelected;
const callback = useCallback(() => {
handleActivityItemSelected();
}, [handleActivityItemSelected]);
if (!disabled) {
disabled = activityAction === ActivityAction.LEAVE;
}
return <FrecentApp app={app} disabled={disabled} submitting={submitting} onAppSelected={callback} />;
};
FrecentApp = function FrecentApp(props) {
const { app: app2, disabled, submitting = false, onAppSelected } = props;
const styles2 = useStyles();
if (app2.section == null) {
return null;
}
const appLauncherIconSource = getAppLauncherIconSource(app2.section.application);
return <PressableOpacity key={app2.applicationId} style={disabled ? styles2.appContainerDisabled : styles2.appContainer} disabled={disabled} accessible accessibilityLabel={app2.section.application?.name} accessibilityRole="button" onPress={() => {
if (onAppSelected != null && app2.section.application != null) {
onAppSelected({
application: app2.section.application,
sectionName: AppLauncherSectionName.RECENT_APPS
});
}
}}>
{appLauncherIconSource != null && <FastImage style={styles2.appIcon} source={appLauncherIconSource} />}
<SubmittingOverlay submitting={submitting} style={styles2.submittingOverlay} />
</PressableOpacity>;
};
useStyles = createStyles({
container: {
marginBottom: Module712.space.PX_16
},
headerContainer: {
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center"
},
header: {
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_4
},
scrollView: {
marginTop: 8,
overflow: "visible"
},
scrollViewContentContainer: {
gap: Module712.space.PX_8
},
contextMenuIcon: {
height: 16,
width: 16
},
appContainer: {
backgroundColor: Module712.colors.BACKGROUND_APP_LAUNCHER_ROW_DEFAULT,
borderRadius: Module712.radii.lg,
...Module712.shadows.SHADOW_LOW
},
appContainerDisabled: {
backgroundColor: Module712.colors.BACKGROUND_APP_LAUNCHER_ROW_DEFAULT,
borderRadius: Module712.radii.lg,
opacity: 0.4,
...Module712.shadows.SHADOW_LOW
},
commandContainer: {
backgroundColor: Module712.colors.BACKGROUND_APP_LAUNCHER_ROW_DEFAULT,
borderRadius: Module712.radii.md,
paddingLeft: Module712.space.PX_12,
paddingRight: Module712.space.PX_16,
paddingVertical: Module712.space.PX_12,
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
gap: Module712.space.PX_8
},
rowShadow: {
...Module712.shadows.SHADOW_LOW
},
appIcon: {
width: 60,
height: 60,
borderRadius: Module712.radii.lg
},
loadingCommandIcon: {
width: 36,
height: 36,
borderRadius: Module712.radii.sm,
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE
},
loadingTextPlaceholder: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
height: 16,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start",
marginBottom: Module712.space.PX_4
},
loadingTextPlaceholderSmall: {
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
height: 16,
borderRadius: Module712.radii.lg,
alignSelf: "flex-start"
},
submittingOverlay: {
position: "absolute",
top: 0,
left: 0,
width: 60,
height: 60,
borderRadius: Module712.radii.lg
}
});
c7605_15 = {
APPS: 0,
0: "APPS",
COMMANDS: 1,
1: "COMMANDS"
};
__initData = {
code: "function FrecencySectionTsx1(){const{withTiming,isRecentsMenuOpen}=this.__closure;return{transform:[{rotate:withTiming(isRecentsMenuOpen?'-180deg':'0deg')}]};}"
};
export default function FrecencySection(props) {
let state2, setState2, c18638_14, animatedStyle, APPS;
const { context: context2, sectionDescriptors, commands, loading, apps, onAppSelected: onAppSelected2, onCommandSelected, onViewAllSelected } = props;
state2 = void 0;
setState2 = void 0;
c18638_14 = void 0;
animatedStyle = void 0;
APPS = void 0;
let c18638_8 = MobileVisualRefreshExperiment("AppLauncherRecents-native");
const styles = useStyles();
const entrypoint = useAppLauncherContext().entrypoint;
const [state, setState] = useState(false);
const stateFromStores = useStateFromStores([FrecencySectionStore], () => FrecencySectionStore.getSelection());
const stateFromStores2 = useStateFromStores([EmbeddedActivitiesStore], () => EmbeddedActivitiesStore.isLaunchingActivity());
const r57 = commands.length > 0 && stateFromStores === FrecencySectionSelection.COMMANDS ? c7605_15.COMMANDS : c7605_15.APPS;
let memo, c18639_1;
[state2, setState2] = useState(r57);
const r67 = entrypoint === AppLauncherEntrypoint.VOICE;
c18638_14 = r67;
useEffect(() => {
let r4 = loading;
if (!loading) {
r4 = commands.length === 0 && apps.length === 0;
}
if (!r4) {
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_FRECENTS_SEEN, {
num: state2 === c7605_15.APPS ? apps.length : commands.length,
section_name: state2 === c7605_15.APPS ? AppLauncherSectionName.RECENT_APPS : AppLauncherSectionName.RECENT_COMMANDS,
location: AppLauncherLocations.HOME
});
}
}, [commands.length, apps.length, loading, state2]);
memo = useMemo(() => apps.slice(0, 8), [apps]);
c18639_1 = r67;
useGetOrFetchApplications(useMemo(() => memo.map((item) => item.section == null ? null : item.section.application != null ? isEmbeddedApp(item.section.application) ? c18639_1 ? item.section.application.id : null : null : null).filter(isNotNullish), [memo, r67]));
const V = () => ({
transform: [{
rotate: _timing.withTiming(state ? "-180deg" : "0deg")
}]
});
V.__closure = {
withTiming: _timing.withTiming,
isRecentsMenuOpen: state
};
V.__workletHash = 4528534448308;
V.__initData = __initData;
animatedStyle = useAnimatedStyle(V);
if (commands.length === 0 && apps.length === 0) {
return null;
}
const items = [{
label: intl.string(t.XRBNsN),
IconComponent: state2 === c7605_15.COMMANDS ? CheckmarkSmallBoldIcon : void 0,
action: () => {
setState2(c7605_15.COMMANDS);
setFrecencySectionSelection(FrecencySectionSelection.COMMANDS);
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_FRECENTS_TOGGLED, {
num: commands.length,
section_name: AppLauncherSectionName.RECENT_COMMANDS
});
}
}, {
label: intl.string(t.TCAk0p),
IconComponent: state2 === c7605_15.APPS ? CheckmarkSmallBoldIcon : void 0,
action: () => {
setState2(c7605_15.APPS);
setFrecencySectionSelection(FrecencySectionSelection.APPS);
trackWithMetadata(AnalyticEvents.APP_LAUNCHER_FRECENTS_TOGGLED, {
num: apps.length,
section_name: AppLauncherSectionName.RECENT_APPS
});
}
}];
const r140 = commands.slice(0, 8).map((item) => {
let c26973_1;
const r17 = sectionDescriptors.find((sectionDescriptor) => sectionDescriptor.id === item.applicationId);
c26973_1 = r17;
const appLauncherIconSource = getAppLauncherIconSource(r17?.application);
if (r17 == null) {
return null;
}
let application = r17.application;
if (application == null) {
application = FAKE_BUILT_IN_APP;
}
const sectionName = getSectionName(application);
const r16 = item.type === ApplicationCommandType.PRIMARY_ENTRY_POINT ? formatPrimaryEntryPointCommandName(item.displayName) : item.displayName;
const style = [styles.commandContainer, ,];
style[1] = c18638_8 ? !c18638_8 : styles.rowShadow;
return <PressableScale key={item.id} style={style} accessible accessibilityLabel={`${r16} ${sectionName}`} accessibilityRole="button" onPress={() => onCommandSelected(item, c26973_1)}>
{appLauncherIconSource != null && <EntityBorderAppIcon iconSize={36} iconSource={appLauncherIconSource} />}
<View>
<Text variant="text-sm/semibold" color="mobile-text-heading-primary">{r16}</Text>
<Text variant="text-xs/normal" color="text-subtle">{sectionName}</Text>
</View>
</PressableScale>;
}).filter(isNotNullish);
const r148 = memo.map((item) => item.section == null ? null : item.section.application != null && (isEmbeddedApp(item.section.application) && c18638_14) ? <FrecentActivityOneClickCTA key={item.applicationId} context={context2} app={item} /> : <FrecentApp key={item.applicationId} app={item} onAppSelected={onAppSelected2} />).filter(isNotNullish);
APPS = commands.length === 0 && apps.length > 0 ? c7605_15.APPS : commands.length > 0 ? apps.length === 0 ? c7605_15.COMMANDS : state2 : state2;
let r155 = APPS === c7605_15.COMMANDS ? r140 : r148;
const r198 = [<View style={styles.headerContainer}>
<ContextMenu enabled={commands.length > 0 && apps.length > 0} items={items} triggerOnTap onOpen={() => setState(true)} onClose={() => setState(false)}>
{({ ref, ...rest }) => <View style={styles.header} {...rest} ref={ref}>
<Text accessibilityRole="header" variant="text-lg/bold" color="mobile-text-heading-primary">
{intl.string(t.acSE0h)}
</Text>
{commands.length > 0 ? apps.length > 0 ? <ReanimatedRexport.View style={animatedStyle}>
<ChevronSmallDownIcon color="interactive-text-default" style={styles.contextMenuIcon} />
</ReanimatedRexport.View> : null : null}
</View>}
</ContextMenu>
<PressableOpacity disabled={APPS === c7605_15.APPS && stateFromStores2} onPress={() => onViewAllSelected(APPS)} accessibilityRole="button">
<Text variant="text-sm/medium" color="text-brand">
{intl.string(t["/qG8v7"])}
</Text>
</PressableOpacity>
</View>, ,];
if (loading) {
r155 = [1, 2, 3, 4, 5].map((item, index) => <Placeholder key={index} />);
}
r198[1] = <ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollViewContentContainer} horizontal showsHorizontalScrollIndicator={false}>{r155}</ScrollView>;
return <View style={styles.container}>{r198}</View>;
};
export { c7605_15 as SectionItemType };
@@ -0,0 +1,35 @@
// Metro module 11227 (f11228).
import Module589 from "../../../../../_bundle/Module589";
import Dispatcher from "../../../../../Dispatcher";
let c7606_0 = {
APPS: "apps",
COMMANDS: "commands"
};
let c7606_1 = {
selection: null
};
class FrecencySectionStore extends Module589.PersistedStore {
static displayName = "FrecencySectionStore";
static persistKey = "FrecencySectionStore";
initialize(a0) {
if (a0 != null) {
c7606_1 = a0;
}
}
getState() {
return c7606_1;
}
getSelection() {
return c7606_1.selection != null ? c7606_1.selection : c7606_0.COMMANDS;
}
}
const frecencySectionStore = new FrecencySectionStore(Dispatcher, {
FRECENCY_SECTION_SET_SELECTION: function handleSetSelection(a0) {
c7606_1 = {
...c7606_1,
selection: a0.selection
};
}
});
export default frecencySectionStore;
export { c7606_0 as FrecencySectionSelection };
@@ -0,0 +1,8 @@
// Metro module 11229 (f11230).
import Dispatcher from "../../../../../Dispatcher";
export function setFrecencySectionSelection(a0) {
Dispatcher.dispatch({
type: "FRECENCY_SECTION_SET_SELECTION",
selection: a0
});
}
@@ -0,0 +1,106 @@
// Metro module 11283 (f11284).
import { ScrollView, View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { AppLauncherHomeListItemType } from "./AppLauncherHomeTypes";
import { isNotNullish } from "../../../../../utils/GlobalUtils";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
import { PressableOpacity } from "../../../../../design/void/Pressables/native/Pressables";
import MobileVisualRefreshExperiment from "../../../../themes/experiments/MobileVisualRefreshExperiment";
import { getAppLauncherIconSource } from "../../AppLauncherNativeUtils";
import { PressableScale } from "../../../../../design/components/experimental/native";
import { AppLauncherSectionName } from "../../../AppLauncherTypes";
import EntityBorderAppIcon from "../../base_components/EntityBorderAppIcon";
let useStyles;
const AppInThisServer = function AppInThisServer(props) {
const { appItem, onAppSelected } = props;
const r12 = MobileVisualRefreshExperiment("AppLauncherInThisServer-native");
const styles = useStyles();
const application = appItem.application;
const appLauncherIconSource = getAppLauncherIconSource(application);
return <PressableScale key={application.id} accessible accessibilityLabel={application.name} accessibilityRole="button" onPress={() => {
if (onAppSelected != null && application != null) {
onAppSelected({
application,
sectionName: AppLauncherSectionName.APPS_IN_THIS_SERVER
});
}
}} style={[styles.appCardContainer, r12 ? !r12 : styles.rowShadow]}>
{appLauncherIconSource != null ? <EntityBorderAppIcon iconSource={appLauncherIconSource} wrapperStyle={styles.iconContainer} iconSize={36} /> : null}
<Text variant="text-md/semibold" color="mobile-text-heading-primary" lineClamp={1}>{application.name}</Text>
</PressableScale>;
};
useStyles = createStyles({
container: {
marginBottom: 16
},
headerContainer: {
justifyContent: "center"
},
viewAll: {
position: "absolute",
right: 0
},
scrollView: {
marginTop: 8,
overflow: "visible"
},
scrollViewContentContainer: {
gap: 8
},
appCardContainer: {
backgroundColor: Module712.colors.BACKGROUND_APP_LAUNCHER_ROW_DEFAULT,
borderRadius: Module712.radii.lg,
paddingLeft: 12,
paddingRight: 12,
paddingVertical: 12,
flexDirection: "row",
justifyContent: "center",
alignItems: "center"
},
rowShadow: {
...Module712.shadows.SHADOW_LOW
},
iconContainer: {
marginEnd: 12,
justifyContent: "space-around"
}
});
export default function InThisServerSection(props) {
let c18714_2, c18714_4;
const { items, onAppSelected: onAppSelected2, onViewAllSelected } = props;
c18714_2 = void 0;
c18714_4 = void 0;
const styles = useStyles();
const r25 = [];
let c18714_3 = r25;
if (items.length === 0) {
return null;
}
items.forEach((item) => {
if (item.type === AppLauncherHomeListItemType.RECOMMENDATION_APP) {
c18714_3.push(item);
}
if (item.type === AppLauncherHomeListItemType.VIEW_ALL) {
c18714_2 = item;
}
});
const r12 = r25.slice(0, 8).map((item) => <AppInThisServer key={item.application.id} appItem={item} onAppSelected={onAppSelected2} />).filter(isNotNullish);
const r38 = c18714_2;
c18714_4 = r38 == null ? void 0 : r38.applications.map((application) => application);
return <View style={styles.container}>
<View style={styles.headerContainer}>
<Text variant="text-lg/bold" color="mobile-text-heading-primary">
{intl.string(t.oJyzCu)}
</Text>
{c18714_2 != null && <PressableOpacity style={styles.viewAll} onPress={() => c18714_4 != null && onViewAllSelected()} accessibilityRole="button">
<Text variant="text-sm/medium" color="text-brand">
{intl.string(t["/qG8v7"])}
</Text>
</PressableOpacity>}
</View>
<ScrollView style={styles.scrollView} contentContainerStyle={styles.scrollViewContentContainer} horizontal showsHorizontalScrollIndicator={false}>{r12}</ScrollView>
</View>;
};
export const IN_THIS_SERVER_ITEM_MAX = 8;
@@ -0,0 +1,64 @@
// Metro module 11268 (f11269).
import { useCallback } from "react";
import { View } from "react-native";
import { HelpdeskArticles } from "../../../../../Constants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import Linking from "../../../../../lib/native/Linking";
import HelpdeskUtils from "../../../../../utils/HelpdeskUtils";
import { intl, t } from "../../../../../intl/index.native";
import TrackSectionHeader from "./TrackSectionHeader";
import { AppLauncherSectionName } from "../../../AppLauncherTypes";
import { Text } from "../../../../../design/components/Text/native/Text";
import { PressableHighlight } from "../../../../../design/void/Pressables/native/Pressables";
const useStyles = createStyles({
container: {
marginTop: Module712.space.PX_32,
borderRadius: Module712.radii.lg,
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_MOD_MUTED,
paddingHorizontal: Module712.space.PX_64
},
body: {
textAlign: "center"
},
divider: {
height: Module712.space.PX_16
},
linkButton: {
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT,
paddingVertical: 12,
paddingHorizontal: 16,
minHeight: 48,
justifyContent: "center",
alignItems: "center",
...Module712.shadows.SHADOW_LOW
}
});
export default function LearnMoreAboutAppsSection(props) {
const visible = props.visible;
const styles = useStyles();
const callback = useCallback(() => {
Linking.openURL(HelpdeskUtils.getAppsSupportURL(HelpdeskArticles.APPS_LEARN_MORE));
}, []);
const sectionTitle = intl.string(t["kw8/Ec"]);
const sectionBody = intl.string(t.GZoV1O);
return <TrackSectionHeader sectionName={AppLauncherSectionName.NEW_TO_APPS} numItems={1} numVisibleItems={1} viewed={visible}>
<View style={styles.container}>
<View style={styles.divider} />
<Text accessibilityRole="header" variant="heading-lg/bold" color="mobile-text-heading-primary">{sectionTitle}</Text>
<Text variant="text-xs/normal" color="text-default" style={styles.body}>{sectionBody}</Text>
<View style={styles.divider} />
<PressableHighlight style={styles.linkButton} onPress={callback} accessibilityRole="link" accessibilityLabel={intl.formatToPlainString(t.xx5Sug, {
sectionTitle,
sectionBody
})}>
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{intl.string(t.Ye51oT)}
</Text>
</PressableHighlight>
<View style={styles.divider} />
</View>
</TrackSectionHeader>;
};
@@ -0,0 +1,43 @@
// Metro module 11286 (f11287).
import { Image as Image2, View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import { isThemeLight } from "../../../../../design/shared";
import useTheme from "../../../../../hooks/useTheme";
import Module11287 from "../../../../../_bundle/Module11287";
import Module11288 from "../../../../../_bundle/Module11288";
import { useLogAppLauncherEmptyStateView } from "../../AppLauncherNativeUtils";
import { AppLauncherEmptyStateType } from "../../../AppLauncherTypes";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
const useStyles = createStyles({
container: {
paddingVertical: 16,
paddingHorizontal: 24,
gap: 12,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.lg,
alignItems: "center",
justifyContent: "flex-start",
display: "flex",
flexDirection: "row"
},
textContainer: {
flexShrink: 1
},
image: {
width: 64,
height: 64
}
});
export default function EmptyState() {
const styles = useStyles();
const source = isThemeLight(useTheme()) ? Module11287 : Module11288;
useLogAppLauncherEmptyStateView(AppLauncherEmptyStateType.HOME_NO_PERMISSIONS);
return <View style={styles.container}>
<Image2 style={styles.image} resizeMode="contain" source={source} />
<Text style={styles.textContainer} variant="text-sm/medium" color="text-muted">
{intl.string(t.uDnXXj)}
</Text>
</View>;
};
Loaded 100 of 33051 files, more files were not shown because too many files have changed in this diff. Show more