// Metro module 15372 (f15373). import _slicedToArray from "../../../_bundle/_slicedToArray"; import _asyncToGenerator from "../../../_bundle/_asyncToGenerator"; import { useRef, useEffect, useState, useCallback, useMemo } from "react"; import { View } from "react-native"; import ChannelStore from "../../../stores/ChannelStore"; import "../../../stores/DraftStore"; import "../../../stores/UploadAttachmentStore"; import { AbortCodes } from "../../../Constants"; import { UserRowModes } from "../../main_tabs_v2/native/shared_components/user_list/UserRowConstants"; import { MessageSendLocation } from "../../messages/MessageConstants"; import { jsx, jsxs } from "react/jsx-runtime"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import { SHARE_EVENT_DETAILS_LINK } from "../../guild_scheduled_events/utils/ShareEventUtils"; import { intl, t } from "../../../intl/index.native"; import { sendMessageWithEmbed } from "../../content_inventory/reactionUtils"; import ToastActionCreators from "../../toast/native/ToastActionCreators"; import useWindowDimensions_native from "../../screen/useWindowDimensions.native"; import useColorThemeBackground from "../../client_themes/native/useColorThemeBackground"; import { useClientThemesOverride } from "../../client_themes/native/ClientThemesOverrides"; import validateOptions from "../../../_bundle/validateOptions"; import ThemedGradient from "../../client_themes/native/ThemedGradient"; import { OverlayOpacity } from "../../client_themes/native/ClientThemesUtils"; import { ThemeContextProvider } from "../../../_bundle/Module3901"; import useSafeAreaInsetsKeyboardAware_native from "../../safe_area/useSafeAreaInsetsKeyboardAware.native"; import { useShareChatInputActions } from "../../share/native/useShareChatInputActions"; import ShareChatInput from "../../share/native/ShareChatInput"; import { Button } from "../../../design/components/Button/native/Button.native"; import ModalActionCreators from "../../../actions/ModalActionCreators"; import { getOrResolveChannelIdFromDestinationId } from "../../share/formatResults"; import { isNotNullish } from "../../../utils/GlobalUtils"; import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native"; import { isAndroid, isIOS } from "../../../utils/PlatformUtils"; import { Header } from "../../../_bundle/Module5150"; import { GenericHeaderTitle } from "../../main_tabs_v2/native/shared_components/HeaderShared"; import { getHeaderCloseButton } from "../../../design/components/Navigator/native/NavigatorHeader.native"; import SearchableDestinationList from "../../share/native/SearchableDestinationList"; function $mk118475($env) { return (a0) => ChannelStore.getChannel(a0); } function $mk118476($env) { return function() { let env32068 = { $parent: $env }; env32068[0] = (0, _asyncToGenerator)(function*(c32144_0) { L20: { const r15 = env32068.$parent.$parent.$parent; let env32177 = { $parent: r15 }; env32177[0] = c32144_0; const r16 = env32068.$parent[0]; const r18 = r16 != null && r16.trim().length > 0 ? `${r16} ${env32068.$parent.$parent[1]}` : env32068.$parent.$parent[1]; const r45 = r15[1]; const r46 = r15[2]; const r51 = r45(r46[31]).parse(c32144_0, r18); const r20 = env32068.$parent.$parent; const r52 = r20[3]; if (r52 == null) { const r54 = r20[2] != null && r20[7] != null; let attachmentsToUpload = void 0; if (r54) { const r19 = r45(r46[32]); const uri = r20[7]; const r21 = r15[0]; const r71 = { channelId: c32144_0.id, file: { uri, originalUri: uri, id: r21(r46[33]).v4(), platform: r21(r46[34]).UploadPlatform.REACT_NATIVE }, draftType: null }; const r81 = r15[8]; r71.draftType = r81.ChannelMessage; r19.addFile(r71); attachmentsToUpload = r15[9].getUploads(c32144_0.id, r81.ChannelMessage); r45(r46[32]).clearAll(c32144_0.id, r81.ChannelMessage); } yield r45(r46[35]).sendMessage(c32144_0.id, r51, false, { location: r15[12].ICYMI, attachmentsToUpload, onAttachmentUploadError: (a0, a1, a2) => { const r1 = env32177.$parent; (0, r1[0])(r1[2][36]).handleUploadMessageAttachmentsErrors({ file: a0, guildId: env32177[0].getGuildId(), analyticsLocations: [], code: a1, reason: a2 }); } }); break L20; } r52(c32144_0); return void 0; } }); return function(a0) { return env32068[0].apply(this, arguments); }; }; } let GravityShareFooter, ICYMIShareModal, useStyles; let env10924 = {}; const Screenshot = function Screenshot(props) { const { render, setUri } = props; const styles = useStyles(); const ref = useRef(null); useEffect(() => { setTimeout(() => { const current = ref.current; const r2 = current == null; let r7 = void 0; if (!r2) { const capture = current.capture; r7 = capture == null ? void 0 : capture.call(current).then((result) => { setUri(result); }); } return r7; }, 500); }, [setUri]); return {jsx(validateOptions, { ref, options: { fileName: "icymi_content", format: "png", quality: 1 }, children: (0, jsxs)(View, { style: styles.base, children: [, {render()} ] }) })} ; }; GravityShareFooter = function GravityShareFooter(props) { const { count, isSending, onSend } = props; const styles = useStyles(); let c21931_1 = styles; const [state, onChange] = useState(""); const insets = useSafeAreaInsetsKeyboardAware_native({ includeKeyboardHeight: true }).insets; const shareChatInputActions = useShareChatInputActions(onChange); const { textInputRef, handleSelectionChange, handleMessageFocus, handleMessageBlur, handlePressEmoji } = shareChatInputActions; const callback = useCallback(() => { onSend(state); }, [state, onSend]); const text = count <= 1 ? intl.string(t.TXNS7S) : intl.formatToPlainString(t.jWtYUm, { count }); const memo = useMemo(() => [c21931_1.footer, { paddingBottom: c21931_1.footer.paddingVertical + insets.bottom }], [styles.footer, insets.bottom]); const disabled = count === 0; return disabled ? null :