/* Metro module 6734; source: modules/guild_onboarding/usePromptHelpText.tsx; dependencies: [1379, 1938, 3784, 3793, 1878, 661, 1244, 566, 4805, 2] */ function _fun53137(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:6, offset: 0x0133e95d, size: 220 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */; const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */; const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const env0_7 = (require(661) /* metro dependency 661: Constants */).Permissions; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_onboarding/usePromptHelpText.tsx'); exports.default = usePromptHelpText; exports.useCustomizeCommunityPromptHelpText = useCustomizeCommunityPromptHelpText; } function formatRoleString(a0, a1, a2) { // fn#53138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:168, offset: 0x0133ea39, size: 186 bytes, params: 4, frame: 20 var r2; var r0; var intl; var format; var t; var object2; var Math; var max; let length = a0.length; if (length === 0) { r0 = ''; } else { intl = (require(1244) /* metro dependency 1244: indexNative */).intl; format = intl.format; t = (require(1244) /* metro dependency 1244: indexNative */).t; r2 = a2 ? t.cJZxWf : t.Kj5GIT; object2 = {}; length = a0.length; object2.count = length; Math = global.Math; max = Math.max; length = a0.length; object2.extraCount = Reflect.apply(max, Math, [length - 2, 0]); object2.role1 = a0[0]; object2.role2 = a0[1]; object2.itemHook = a1; r0 = Reflect.apply(format, intl, [r2, object2]); } return r0; } function usePromptHelpText({guild, prompt, selectedRoleIds, selectedChannelIds, itemHook}) { // fn#53139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:455, offset: 0x0133eaf3, size: 534 bytes, params: 2, frame: 28 var r2; var r7; var r1; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var value8; var format; var Rj841R; var Math; var max; let value = undefined; const id = guild == null ? value : guild.id; const fluxModule = require(566) /* metro dependency 566: flux */; let useStateFromStoresArray = fluxModule.useStateFromStoresArray; const value3 = Reflect.apply(useStateFromStoresArray, fluxModule, [[GuildRoleStore], _fun53140, [id, selectedRoleIds]]); const moduleValue2 = fluxModule; useStateFromStoresArray = moduleValue2.useStateFromStoresArray; object = [ChannelStore]; object[1] = UserStore; object[2] = RelationshipStore; object[3] = PermissionStore; const value4 = Reflect.apply(useStateFromStoresArray, moduleValue2, [object, _fun53141]); const value5 = value3.map(function({name}) { return '@' + name; }); if (prompt == null) { r2 = intl.string(t.JshhEl); } else if (prompt.singleSelect) { r2 = ''; } else { r2 = intl.string(t.JshhEl); } let length = value4.length; if (length !== 0) { length = value4.length; value8 = ''; if (length > 0) { length = value4.length; if (length === 0) { r7 = value8; } else { format = intl.format; Rj841R = t.Rj841R; object = {}; length = value4.length; object.count = length; Math = global.Math; max = Math.max; length = value4.length; object.extraCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; r7 = Reflect.apply(format, intl, [Rj841R, object]); } length = value5.length; r1 = length > 0 ? formatRoleString(value5, itemHook, true) : value8; r2 = r7; } else { r1 = value8; } } else { length = value5.length; if (length > 0) { value = formatRoleString(value5, itemHook); r1 = ''; r2 = value; } else { length = value4.length; value8 = ''; if (length > 0) { length = value4.length; if (length === 0) { r7 = value8; } else { format = intl.format; Rj841R = t.Rj841R; object = {}; length = value4.length; object.count = length; Math = global.Math; max = Math.max; length = value4.length; object.extraCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; r7 = Reflect.apply(format, intl, [Rj841R, object]); } length = value5.length; r1 = length > 0 ? formatRoleString(value5, itemHook, true) : value8; r2 = r7; } else { r1 = value8; } } } return {helpText: r2, helpTextAdditional: r1}; } function useCustomizeCommunityPromptHelpText({guild, prompt, selectedRoleIds, selectedChannelIds, itemHook}) { // fn#53146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:1320, offset: 0x0133ee19, size: 840 bytes, params: 2, frame: 26 var r1; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var format; var WewRHM; var Math; var max; var ZKywGU; var vdtNYa; const id = guild?.id; const fluxModule = require(566) /* metro dependency 566: flux */; let useStateFromStoresArray = fluxModule.useStateFromStoresArray; const value3 = Reflect.apply(useStateFromStoresArray, fluxModule, [[GuildRoleStore], _fun53147, [id, selectedRoleIds]]); const moduleValue2 = fluxModule; useStateFromStoresArray = moduleValue2.useStateFromStoresArray; object = [ChannelStore]; object[1] = UserStore; object[2] = RelationshipStore; object[3] = PermissionStore; const value4 = Reflect.apply(useStateFromStoresArray, moduleValue2, [object, _fun53148]); const value5 = value3.map(function({name}) { return '@' + name; }); if (prompt == null) { r1 = intl.string(t.JshhEl); } else if (prompt.singleSelect) { r1 = ''; } else { r1 = intl.string(t.JshhEl); } let length = value4.length; if (length !== 0) { length = value4.length; if (length > 0) { length = value5.length; if (length === 0) { format = intl.format; ZKywGU = t.ZKywGU; object = {}; length = value4.length; object.count = length; Math = global.Math; max = Math.max; length = value4.length; object.extraCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; r1 = Reflect.apply(format, intl, [ZKywGU, object]); } else { length = value4.length; if (length > 0 && value5.length > 0) { format = intl.format; WewRHM = t.WewRHM; object = {}; length = value4.length; object.channelCount = length; Math = global.Math; max = Math.max; length = value4.length; object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; length = value5.length; object.roleCount = length; Math = global.Math; max = Math.max; length = value5.length; object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]); object.role1 = value5[0]; object.role2 = value5[1]; r1 = Reflect.apply(format, intl, [WewRHM, object]); } } } else { length = value4.length; if (length > 0 && value5.length > 0) { format = intl.format; WewRHM = t.WewRHM; object = {}; length = value4.length; object.channelCount = length; Math = global.Math; max = Math.max; length = value4.length; object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; length = value5.length; object.roleCount = length; Math = global.Math; max = Math.max; length = value5.length; object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]); object.role1 = value5[0]; object.role2 = value5[1]; r1 = Reflect.apply(format, intl, [WewRHM, object]); } } } else { length = value5.length; if (length > 0) { format = intl.format; vdtNYa = t.vdtNYa; object = {}; length = value5.length; object.count = length; Math = global.Math; max = Math.max; length = value5.length; object.extraCount = Reflect.apply(max, Math, [length - 2, 0]); object.role1 = value5[0]; object.role2 = value5[1]; object.itemHook = itemHook; r1 = Reflect.apply(format, intl, [vdtNYa, object]); } else { length = value4.length; if (length > 0) { length = value5.length; if (length === 0) { format = intl.format; ZKywGU = t.ZKywGU; object = {}; length = value4.length; object.count = length; Math = global.Math; max = Math.max; length = value4.length; object.extraCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; r1 = Reflect.apply(format, intl, [ZKywGU, object]); } else { length = value4.length; if (length > 0 && value5.length > 0) { format = intl.format; WewRHM = t.WewRHM; object = {}; length = value4.length; object.channelCount = length; Math = global.Math; max = Math.max; length = value4.length; object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; length = value5.length; object.roleCount = length; Math = global.Math; max = Math.max; length = value5.length; object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]); object.role1 = value5[0]; object.role2 = value5[1]; r1 = Reflect.apply(format, intl, [WewRHM, object]); } } } else { length = value4.length; if (length > 0 && value5.length > 0) { format = intl.format; WewRHM = t.WewRHM; object = {}; length = value4.length; object.channelCount = length; Math = global.Math; max = Math.max; length = value4.length; object.extraChannelCount = Reflect.apply(max, Math, [length - 2, 0]); object.channel1 = value4[0]; object.channel2 = value4[1]; object.itemHook = itemHook; length = value5.length; object.roleCount = length; Math = global.Math; max = Math.max; length = value5.length; object.extraRoleCount = Reflect.apply(max, Math, [length - 2, 0]); object.role1 = value5[0]; object.role2 = value5[1]; r1 = Reflect.apply(format, intl, [WewRHM, object]); } } } } return {helpText: r1, helpTextAdditional: ''}; } function _fun53140() { // fn#53140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:617, offset: 0x0133ed09, size: 48 bytes, params: 1, frame: 14 return id != null ? GuildRoleStore.getManyRoles(id, selectedRoleIds) : []; } function _fun53141() { // fn#53141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:705, offset: 0x0133ed39, size: 74 bytes, params: 1, frame: 12 const Array = global.Array; let value = Array.from(selectedChannelIds); value = value.map(function(a0) { return ChannelStore.getChannel(a0); }); value = value.filter(_fun53143); return value.map(function(a0) { return require(dependencyMap[8]).computeChannelName(a0, UserStore, RelationshipStore, true); }); } function _fun53148() { // fn#53148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:1588, offset: 0x0133f161, size: 74 bytes, params: 1, frame: 12 const Array = global.Array; let value = Array.from(selectedChannelIds); value = value.map(function(a0) { return ChannelStore.getChannel(a0); }); value = value.filter(_fun53150); return value.map(function(a0) { return require(dependencyMap[8]).computeChannelName(a0, UserStore, RelationshipStore, true); }); } function _fun53143(a0) { // fn#53143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6912:757, offset: 0x0133ed99, size: 43 bytes, params: 2, frame: 14 var r0; let value = a0 != null; if (value) { value = environment.__proto__.__proto__; value = PermissionStore.can(Permissions.VIEW_CHANNEL, a0); r0 = value; } else { r0 = value; } return r0; }