/* Metro module 6615; source: modules/guild_onboarding/native/GuildOnboardingModal.tsx; dependencies: [31, 6616, 1379, 1867, 1934, 6603, 6600, 661, 33, 1230, 6617, 5282, 6768, 5105, 6790, 6620, 566, 6606, 6717, 5280, 1244, 2] */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */ import GuildOnboardingPromptsStore from '../GuildOnboardingPromptsStore.tsx'; /* Metro dependency 6603 */ import MemberVerificationFormStore from '../../guild_member_verification/MemberVerificationFormStore.tsx'; /* Metro dependency 6616 */ import GuildOnboardingConnectionPrompt from './GuildOnboardingConnectionPrompt.tsx'; /* Metro dependency 6768 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as NavigatorNativeModule from '../../../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */ import * as GuildOnboardingConstantsModule from './GuildOnboardingConstants.tsx'; /* Metro dependency 6600 */ import * as GuildOnboardingPromptModule from './GuildOnboardingPrompt.tsx'; /* Metro dependency 6620 */ function _fun52259(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:6, offset: 0x01324130, size: 301 bytes, params: 8, frame: 19 const env0_0 = require; const headerTitle_52260 = function() { return null; }; const headerRight_52261 = function() { return null; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/native/GuildOnboardingModal.tsx'); exports.default = GuildOnboardingModal; function getScreens_52262(a0) { // fn#52262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:316, offset: 0x0132425d, size: 366 bytes, params: 2, frame: 19 const guildId = a0.guildId; const env0_1 = a0.prompts; a0.connections; const env0_2 = a0.selectOption; const env0_3 = a0.completeOnboarding; const env0_4 = a0.onFinish; const env0_5 = a0.onClose; const env0_6 = a0.landingAnimation; const env0_7 = a0.isFirstOpen; const env0_8 = a0.backShouldLeaveGuild; const env0_9 = GuildStore.getGuild(guildId); const env0_10 = MemberVerificationFormStore.getRulesPrompt(guildId); const object = {}; const PROMPT = GuildOnboardingModalStates.PROMPT; const headerTitle_52260Binding = headerTitle_52260; const headerRight_52261Binding = headerRight_52261; object[PROMPT] = {fullscreen: true, headerTitle: headerTitle_52260Binding, headerRight: headerRight_52261Binding, render: render_52263}; const CONNECTIONS = GuildOnboardingModalStates.CONNECTIONS; const object3 = {fullscreen: true, headerTitle: headerTitle_52260Binding, headerRight: headerRight_52261Binding}; object3.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton(_fun52264); object3.render = render_52265; object[CONNECTIONS] = object3; const COMPLETED = GuildOnboardingModalStates.COMPLETED; object[COMPLETED] = {fullscreen: true, headerTitle: headerTitle_52260Binding, headerRight: headerRight_52261Binding, render: render_52266}; const RULES = GuildOnboardingModalStates.RULES; object[RULES] = {fullscreen: true, headerTitle: headerTitle_52260Binding, headerRight: headerRight_52261Binding, render: render_52268}; return object; function getScreens_52262Render(a0) { // fn#52263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:609, owner: getScreens_52262.render, offset: 0x013243cb, size: 141 bytes, params: 2, frame: 18 const value = environment.__proto__; return ((Component) => )(importDefault(6617) /* metro dependency 6617: GuildOnboardingPrompts */); } function _fun52264() { // fn#52264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:932, offset: 0x01324458, size: 203 bytes, params: 1, frame: 17 var onCloseBinding; var guildIdBinding; var channel; var moduleValue; var moduleValue2; if (backShouldLeaveGuild) { guildIdBinding = guildId; onCloseBinding = onClose; value = environment.__proto__; channel = ChannelStore.getChannel(SelectedChannelStore.getLastSelectedChannelId()); if (channel == null) { moduleValue = require(1230) /* metro dependency 1230: router_utils */; moduleValue.transitionTo(Routes.ME, {navigationReplace: true}); } else if (channel.guild_id !== guildIdBinding) { moduleValue2 = require(1230) /* metro dependency 1230: router_utils */; moduleValue2.transitionTo(Routes.CHANNEL(channel.guild_id, channel.id)); } else { moduleValue = require(1230) /* metro dependency 1230: router_utils */; moduleValue.transitionTo(Routes.ME, {navigationReplace: true}); } onCloseBinding(); } else { onClose(); } } function getScreens_52262Render_52265() { // fn#52265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:1149, owner: getScreens_52262.render, offset: 0x01324523, size: 125 bytes, params: 1, frame: 19 var r5; let value = environment.__proto__; const guildIdBinding = guildId; const value3 = prompts.length === 0; if (value3) { value = require(5105) /* metro dependency 5105: GuildOnboardingUtils */; value = !value.showRulesInOnboarding(env0_9, env0_10); r5 = value; } else { r5 = value3; } return ( ); } function getScreens_52262Render_52266() { // fn#52266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:1337, owner: getScreens_52262.render, offset: 0x013245a0, size: 80 bytes, params: 1, frame: 15 var environment; const value = environment.__proto__; return ((Component) => )(importDefault(6790) /* metro dependency 6790: GuildOnboardingCompleted */); } function getScreens_52262Render_52268() { // fn#52268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:1499, owner: getScreens_52262.render, offset: 0x01324607, size: 65 bytes, params: 1, frame: 15 const RulesPrompt = (GuildOnboardingPromptModule).RulesPrompt; return ; } } function GuildOnboardingModal({guildId, onFinish, onClose, landingAnimation, isFirstOpen, backShouldLeaveGuild}) { // fn#52269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:1652, offset: 0x01324648, size: 490 bytes, params: 2, frame: 27 const landingAnimation2 = landingAnimation; const value2 = (FluxModule).useStateFromStores([GuildStore], _fun52270); const useStateFromStoresArray = FluxModule.useStateFromStoresArray; const guildOnboardingPromptsStoreBinding = GuildOnboardingPromptsStore; const value3 = Reflect.apply(useStateFromStoresArray, FluxModule, [[guildOnboardingPromptsStoreBinding], function() { return GuildOnboardingPromptsStore.getOnboardingPromptsForOnboarding(guildId); }]); const connections = FluxModule.useStateFromStores([guildOnboardingPromptsStoreBinding], function() { return GuildOnboardingPromptsStore.getConnections(guildId); }); const binding = landingAnimation2; const value4 = binding.useCallback(_fun52273, [guildId]); const value5 = binding.useCallback(_fun52274, [guildId, value3]); binding.useEffect(_fun52275, [guildId, value2]); const value6 = binding.useMemo(_fun52276, [guildId, value3, connections, value4, value5, onFinish, onClose, landingAnimation, isFirstOpen, backShouldLeaveGuild]); const r4 = isFirstOpen && connections.length > 0 ? GuildOnboardingModalStates.CONNECTIONS : GuildOnboardingModalStates.PROMPT; const Navigator = (NavigatorNativeModule).Navigator; const intl = (IndexNativeModule).intl; return ( ); function _fun52270() { // fn#52270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:1811, offset: 0x01324832, size: 97 bytes, params: 1, frame: 14 const value = environment.__proto__; const guild = GuildStore.getGuild(guildId); return guild != null && (guild.features.has(GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED) && !guild.features.has(GuildFeatures.MEMBER_VERIFICATION_MANUAL_APPROVAL)); } function _fun52273(a0, a1, a2) { // fn#52273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:2127, offset: 0x013248c9, size: 56 bytes, params: 4, frame: 18 let value = environment.__proto__; value = importDefault(6606) /* metro dependency 6606: GuildOnboardingActionCreators */; value.selectOption(guildId, a0, a1, a2); } function _fun52274() { // fn#52274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:2192, offset: 0x01324901, size: 50 bytes, params: 1, frame: 14 let value = environment.__proto__; value = importDefault(6606) /* metro dependency 6606: GuildOnboardingActionCreators */; value.completeOnboarding(guildId, env0_7); } function _fun52275() { // fn#52275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:2252, offset: 0x01324933, size: 54 bytes, params: 1, frame: 12 var value2; var defaultImport; if (env0_6) { value2 = environment.__proto__; defaultImport = importDefault(6717) /* metro dependency 6717: MemberVerificationActionCreators */; defaultImport.fetchVerificationForm(guildId); } } function _fun52276() { // fn#52276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6793:2320, offset: 0x01324969, size: 110 bytes, params: 1, frame: 12 return getScreens_52262({guildId: guildId, prompts: env0_7, connections: connections, selectOption: GuildOnboardingConstantsModule.GuildOnboardingModalStates, completeOnboarding: ConstantsModule.GuildFeatures, onFinish: onFinish, onClose: onClose, landingAnimation: landingAnimation, isFirstOpen: isFirstOpen, backShouldLeaveGuild: backShouldLeaveGuild}); } } } global.__d(_fun52259, 6615, [31, 6616, 1379, 1867, 1934, 6603, 6600, 661, 33, 1230, 6617, 5282, 6768, 5105, 6790, 6620, 566, 6606, 6717, 5280, 1244, 2]) /* metro module 6615, dependencies: [31, 6616, 1379, 1867, 1934, 6603, 6600, 661, 33, 1230, 6617, 5282, 6768, 5105, 6790, 6620, 566, 6606, 6717, 5280, 1244, 2] */;