/* Metro module 10204; source: modules/oauth2/native/SuccessResult.tsx; dependencies: [31, 27, 1379, 3784, 1934, 661, 1483, 33, 4501, 697, 7717, 1244, 5080, 6947, 683, 566, 4080, 4015, 1583, 6618, 10205, 4573, 4578, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import Module10205 from '../../../by-id/module-10205.js'; /* Metro dependency 10205 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as AppLauncherNativeConstantsModule from '../../app_launcher/native/AppLauncherNativeConstants.tsx'; /* Metro dependency 1483 */
import * as ChatInputUtilsModule from '../../../utils/native/ChatInputUtils.tsx'; /* Metro dependency 4015 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
import * as DeviceOrientationModule from '../../device/native/DeviceOrientation.tsx'; /* Metro dependency 7717 */
function _fun79334(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:6, offset: 0x01e4e507, size: 519 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_4 = value.Image;
const env0_5 = value.View;
const env0_6 = value.ScrollView;
value = require(661) /* metro dependency 661: Constants */;
const env0_10 = value.AnalyticEvents;
const env0_11 = value.Permissions;
value = require(33) /* metro dependency 33 */;
const env0_13 = value.jsx;
const env0_14 = value.jsxs;
const env0_15 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER;
object.container = {flex: 1, backgroundColor: BACKGROUND_BASE_LOWER};
object.scrollView = {flex: 1};
const BACKGROUND_BASE_LOW = (Native).colors.BACKGROUND_BASE_LOW;
object.scrollViewContentContainer = {'height': '100%', 'backgroundColor': null, 'alignItems': 'center',
'justifyContent': 'center', backgroundColor: BACKGROUND_BASE_LOW};
object.inner = {'flexDirection': 'column', 'alignItems': 'center', 'justifyContent': 'center',
'paddingHorizontal': 16};
object.text = {'marginTop': 24, 'paddingHorizontal': 40, 'textAlign': 'center'};
object.footer = {'flexDirection': 'column', 'justifyContent': 'space-between', 'padding': 16, 'gap': 16};
object.footerLandscape = {'flexDirection': 'row-reverse', 'padding': 16};
object.footerPortrait = {'flexDirection': 'column', 'padding': 16};
const env0_16 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/oauth2/native/SuccessResult.tsx');
exports.default = SuccessResultModal;
function SuccessResultModal({guild, application}) { // fn#79335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:981, offset: 0x01e4e70e, size: 1253 bytes, params: 2, frame: 39
const Text = (TextModule).Text;
const Button = (ButtonNativeModule).Button;
let env0_3 = undefined;
const styles = useStyles();
const useStore = DeviceOrientationModule.useStore;
const orientation = Reflect.apply(useStore, DeviceOrientationModule, []).orientation;
let binding = env0_3;
const value3 = binding.useMemo(_fun79336, [application, guild]);
const value5 = binding.useCallback(_fun79337, [guild, application?.id]);
const channelId = (require(566) /* metro dependency 566: flux */).useStateFromStores([SelectedChannelStore],
function() {
return SelectedChannelStore.getChannelId();
});
env0_3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
binding = env0_3;
const value6 = binding.useCallback(_fun79340, [application, channelId]);
const value7 = binding.useCallback(function() {
var value2 = undefined;
importDefault(dependencyMap[12]).pop();
var defaultImport2 = importDefault(dependencyMap[14]);
var track = defaultImport2.track;
var OAUTH2_AUTHORIZE_SUCCESS_CLOSE_CLICKED = AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_CLOSE_CLICKED;
Reflect.apply(track, defaultImport2, [OAUTH2_AUTHORIZE_SUCCESS_CLOSE_CLICKED,
{application_id: application == null ? value2 : application.id}]);
return value2;
}, [application?.id]);
env0_3.useEffect(function() {
var value2 = undefined;
var defaultImport = importDefault(dependencyMap[14]);
var track = defaultImport.track;
var OAUTH2_AUTHORIZE_SUCCESS_VIEWED = AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_VIEWED;
Reflect.apply(track, defaultImport, [OAUTH2_AUTHORIZE_SUCCESS_VIEWED,
{application_id: application == null ? value2 : application.id}]);
return value2;
}, [application?.id]);
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
var permissionStoreBinding = PermissionStore;
var SEND_MESSAGES = Permissions.SEND_MESSAGES;
return permissionStoreBinding.can(SEND_MESSAGES, channel);
});
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
const items2 = [
,
];
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items2[1] = (
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.se5gLj)}
);
items2[2] = (
value3 != null
? (
{value3}
)
: null
);
const scrollView = (
{items2}
);
const items3 = [styles.footer];
const OrientationType = DeviceOrientationModule.OrientationType;
const LANDSCAPE = OrientationType.LANDSCAPE;
items3[1] = orientation === LANDSCAPE ? styles.footerLandscape : styles.footerPortrait;
return (
{scrollView}
<>
{
guild != null
? (
)
: null
}
{
channelId != null && value8
? (
)
: null
}
>
);
function _fun79336() { // fn#79336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1091, offset: 0x01e4ebf3, size: 304 bytes, params: 1, frame: 20
var name;
var r1;
var r0;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var value2;
var format;
var object;
var value4;
var value5;
var IlF6IY;
var value;
if (application != null) {
if (guild != null) {
value4 = environment.__proto__;
value5 = undefined;
format = intl.format;
IlF6IY = t.IlF6IY;
object = {};
name = application == null ? value5 : application.name;
object.installedApplicationName = name;
name = guild == null ? value5 : guild.name;
object.guildName = name;
r1 = Reflect.apply(format, intl, [IlF6IY, object]);
} else {
value2 = environment.__proto__;
r1 = intl.format(t.vTVC5T, {installedApplicationName: application?.name});
}
r0 = r1;
} else {
value = environment.__proto__;
value = intl.string(t['Dp+rgP']);
r0 = value;
}
return r0;
}
function _fun79337() { // fn#79337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1389, offset: 0x01e4ed23, size: 216 bytes, params: 1, frame: 18
var value3;
var moduleValue;
var transitionToGuild;
var defaultImport2;
var track;
var OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED;
var object;
const guildBinding = guild;
const value2 = undefined;
let id = guildBinding == null ? value2 : guild.id;
if (id != null) {
value3 = environment.__proto__;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
moduleValue = require(6947) /* metro dependency 6947: transitionToGuildNative */;
transitionToGuild = moduleValue.transitionToGuild;
id = guild == null ? value2 : guild.id;
Reflect.apply(transitionToGuild, moduleValue, [id]);
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport2.track;
OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED = AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED;
object = {};
id = application == null ? value2 : application.id;
object.application_id = id;
id = guild == null ? value2 : guild.id;
object.guild_id = id;
Reflect.apply(track, defaultImport2, [OAUTH2_AUTHORIZE_SUCCESS_GO_TO_GUILD_CLICKED, object]);
}
return value2;
}
function _fun79340() { // fn#79340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1776, offset: 0x01e4ee28, size: 165 bytes, params: 1, frame: 15
var defaultImport3;
(ModalActionCreators).pop();
(ActionSheetActionCreators).hideActionSheet();
if (channelId != null && application != null) {
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport3.track(AnalyticEvents.OAUTH2_AUTHORIZE_SUCCESS_OPEN_APP_CLICKED,
{application_id: application.id});
global.setImmediate(_fun79341);
}
function _fun79341() { // fn#79341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10390:1938, offset: 0x01e4eecd, size: 124 bytes, params: 1, frame: 16
var openCustomKeyboard;
var object;
const bestActiveInput = (ChatInputUtilsModule).getBestActiveInput();
if (bestActiveInput != null) {
openCustomKeyboard = bestActiveInput.openCustomKeyboard;
object = {};
object.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.APP_LAUNCHER;
value = environment.__proto__;
object.context = {initialRouteName: AppLauncherRouteName.APPLICATION_VIEW, application: application};
Reflect.apply(openCustomKeyboard, bestActiveInput, [object]);
}
}
}
}
}
global.__d(_fun79334, 10204, [31, 27, 1379, 3784, 1934, 661, 1483, 33, 4501, 697, 7717, 1244, 5080, 6947, 683, 566,
4080, 4015, 1583, 6618, 10205, 4573, 4578,
2]) /* metro module 10204, dependencies: [31, 27, 1379, 3784, 1934, 661, 1483, 33, 4501, 697, 7717, 1244, 5080, 6947, 683, 566, 4080, 4015, 1583, 6618, 10205, 4573, 4578, 2] */;