/* Metro module 11435; source: modules/connections/native/ConnectionsRoleMessageBadgeActionSheet.tsx; dependencies: [57, 31, 27, 1885, 1226, 1945, 1938, 1867, 11436, 5044, 661, 33, 4501, 697, 1244, 5043, 4064, 4573, 4048, 22, 3860, 4915, 11367, 8706, 1305, 1423, 4002, 44, 6771, 6789, 566, 683, 4863, 6593, 6275, 6812, 4578, 4080, 11370, 8743, 2] */ import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserRecord from '../../../records/UserRecord.tsx'; /* Metro dependency 1885 */ import GuildRoleStore from '../../../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */ import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */ import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */ import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */ import Platforms from '../../../lib/Platforms.tsx'; /* Metro dependency 4915 */ import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */ import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */ import ShowUserProfileActionSheet from '../../user_profile/native/showUserProfileActionSheet.tsx'; /* Metro dependency 8743 */ import GuildRoleConnectionEligibilityStore from '../GuildRoleConnectionEligibilityStore.tsx'; /* Metro dependency 11436 */ 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 UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */ 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 ConnectionsUtilsModule from '../ConnectionsUtils.tsx'; /* Metro dependency 5043 */ import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 5044 */ import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */ import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */ import * as GuildRoleConnectionsModalActionCreatorsModule from './GuildRoleConnectionsModalActionCreators.tsx'; /* Metro dependency 11370 */ function _fun87515(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11621:6, offset: 0x01fc1553, size: 743 bytes, params: 8, frame: 26 const env0_0 = require; const PopoutChecks2 = PopoutChecks; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactNativeModule; const env0_5 = value.ActivityIndicator; const env0_6 = value.View; value = require(661) /* metro dependency 661: Constants */; const env0_14 = value.AnalyticEvents; const env0_15 = value.EMPTY_STRING_SNOWFLAKE_ID; value = require(33) /* metro dependency 33 */; const env0_16 = value.jsx; const env0_17 = value.jsxs; const env0_18 = value.Fragment; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object = {container: {'flexDirection': 'column', 'alignItems': 'center', 'padding': 16}}; const object2 = {'width': '100%', 'flexDirection': 'row', 'alignItems': 'center', 'paddingBottom': 16, 'borderBottomWidth': 1}; let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE; object2.borderBottomColor = BORDER_SUBTLE; const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24; object2.marginBottom = PX_24; object.header = object2; object.verifiedContainer = {'marginRight': 8, 'height': 24, 'width': 24}; object.headerTextContainer = {'flexShrink': 1, 'flexDirection': 'column'}; object.verifiedCheck = {'position': 'absolute', 'left': 0, 'top': 0}; object.loadingSpinner = {marginVertical: 40}; object.popoutCheck = {'flexDirection': 'row', 'alignItems': 'center', 'marginTop': 8, 'marginLeft': 32, 'paddingRight': 20}; const TEXT_FEEDBACK_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_POSITIVE; object.popoutCheckIcon = {marginRight: 8, tintColor: TEXT_FEEDBACK_POSITIVE}; object.popoutChecksGroup = {'width': '100%', 'marginBottom': 24}; BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE; object.popoutChecksGroupBottomMargin = {'paddingBottom': 12, 'borderBottomWidth': 1, 'borderBottomColor': null, 'marginBottom': 12, borderBottomColor: BORDER_SUBTLE}; object.popoutCheckGroupName = {'flexDirection': 'row', 'alignItems': 'center'}; object.popoutCheckGroupPlatformIcon = {marginRight: 8}; object.button = {marginBottom: 8}; object.botTag = {marginLeft: 4}; const env0_19 = Reflect.apply(createStyles, value, [object]); (FileImportTrackerModule).fileFinishedImporting('modules/connections/native/ConnectionsRoleMessageBadgeActionSheet.tsx'); exports.default = ConnectionsRoleMessageBadgeActionSheet; exports.PopoutChecks = PopoutChecks2; function PopoutCheck({connectionType, connectionMetadataField, operator, value, description}) { // fn#87516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11621:1324, offset: 0x01fc183a, size: 513 bytes, params: 2, frame: 24 var r9; var r0; var moduleValue; var object; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var format; var property; var Math; var max; const styles = useStyles(); if (description != null) { if (OperatorTypes.LESS_THAN === operator) { format = intl.format; property = (require(1244) /* metro dependency 1244: indexNative */).t['2p7dA3']; object = {description: description}; Math = global.Math; max = Math.max; value = global.Number(value); object.count = Reflect.apply(max, Math, [0, value - 1]); value = Reflect.apply(format, intl, [property, object]); r9 = value; } else if (OperatorTypes.GREATER_THAN !== operator) { r9 = description; } else { format = intl.format; property = (require(1244) /* metro dependency 1244: indexNative */).t['2p7dA3']; object = {description: description}; Math = global.Math; max = Math.max; value = global.Number(value); object.count = Reflect.apply(max, Math, [0, value + 1]); value = Reflect.apply(format, intl, [property, object]); r9 = value; } } else { moduleValue = require(5043) /* metro dependency 5043: ConnectionsUtils */; value = moduleValue.getConnectionsCheckText({connectionType: connectionType, connectionMetadataField: connectionMetadataField, operator: operator, value: value}); r9 = value; } if (r9 == null) { r0 = null; } else { var viewBindingProps = {style: styles.popoutCheck}; const CheckmarkLargeIcon = (require(4064) /* metro dependency 4064: CheckmarkLargeIcon */).CheckmarkLargeIcon; value = ; value = ( {value} {((Text) => {r9})((require(4573) /* metro dependency 4573: Text */).Text)} ); r0 = value; } return r0; } function PopoutChecks({eligibilityStates, guildId}) { // fn#87517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11621:2021, offset: 0x01fc1a3b, size: 227 bytes, params: 2, frame: 18 const env0_1 = useStyles(); const env0_2 = (UseTheme)(); const value2 = (importDefault(22) /* metro dependency 22 */).groupBy(eligibilityStates, function(a0) { var connection_type = a0.connection_type; var value = ''; return value + connection_type + (a0.application_id != null ? ':' + a0.application_id : value); }); const Object = global.Object; const value3 = Object.keys(value2); const env0_4 = value3.length - 1; const useToken = UseTokenModule.useToken; const GREEN_330 = (Native).unsafe_rawColors.GREEN_330; const env0_5 = Reflect.apply(useToken, UseTokenModule, [GREEN_330]); return ( <> {value3.map(_fun87519)} ); function _fun87519(a0, a1) { // fn#87519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11621:2315, offset: 0x01fc1b1e, size: 884 bytes, params: 3, frame: 37 var r23; var r13; var userRecord2; var Icon; var moduleValue; var makeSource; var isThemeDark2; var icon; const property = Module00057[a0]; const value2 = property.filter(function(a0) { return a0.operator != null; }); const value3 = property.find(function(a0) { return a0.application != null; }); const value5 = undefined; const value6 = (Platforms).get(a0); const value7 = null; const application = value7 == value3 ? value5 : value3.application; if (value7 != (value7 == application ? value5 : application.bot)) { userRecord2 = new UserRecord(application.bot); } else { r23 = value7; } const officialApplicationIds = (ConnectionsUtilsModule).officialApplicationIds; const includes = officialApplicationIds.includes; const id = value7 == application ? value5 : application.id; const r11 = ( Reflect.apply(includes, officialApplicationIds, [value7 != id ? id : '']) ? ((Component) => )(importDefault(11367) /* metro dependency 11367: OfficialConnectionIcon */) : ( value7 != r23 ? ((Component) => )(importDefault(8706) /* metro dependency 8706: BotTag */) : value5 ) ); const items4 = [styles.popoutChecksGroup]; items4[1] = a1 < env0_4 ? styles.popoutChecksGroupBottomMargin : value7; if (value7 != value6) { Icon = (require(1305) /* metro dependency 1305: native */).Icon; var iconProps = {style: styles.popoutCheckGroupPlatformIcon}; moduleValue = require(1423) /* metro dependency 1423: AvatarUtils */; makeSource = moduleValue.makeSource; isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_2); icon = value6.icon; iconProps.source = Reflect.apply(makeSource, moduleValue, [isThemeDark2 ? icon.darkPNG : icon.lightPNG]); iconProps.disableColor = true; iconProps.size = (require(1305) /* metro dependency 1305: native */).Icon.Sizes.MEDIUM; r13 = ; } else { r13 = value7; } const items2 = [r13]; items2[1] = ( value7 != r23 ? ((Avatar) => )((require(1305) /* metro dependency 1305: native */).Avatar) : value7 ); const Text = (TextModule).Text; const name = value7 == value6 ? value5 : value6.name; items2[2] = ( {value7 != name ? name : value7 == application ? value5 : application.name} ); items2[3] = r11; const items3 = [ {items2} , ]; items3[1] = value2.map(_fun87522); return ( {items3} ); function _fun87522({connection_type, connection_metadata_field, operator, value, description}) { // fn#87522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11621:3313, offset: 0x01fc1e92, size: 212 bytes, params: 2, frame: 28 (Module00044)(connection_metadata_field != null, 'connectionMetadataField is null'); (Module00044)(operator != null, 'operator is null'); (Module00044)(value != null, 'value is null'); return ( ); } } } function ConnectionsRoleMessageBadgeActionSheet({userId, roleId, channelId, guildId}) { // fn#87523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11621:3763, offset: 0x01fc1f66, size: 1622 bytes, params: 2, frame: 42 var r18; var r16; var r11; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var jsxRuntimeEnv0_18Binding; var items4; const Button = (ButtonNativeModule).Button; var object; var object2; const guildId2 = guildId; const styles = useStyles(); const defaultImport = UseAnalyticsLocations; const CONNECTIONS_ROLE_POPOUT = (AnalyticsLocation).CONNECTIONS_ROLE_POPOUT; const analyticsLocations = defaultImport(CONNECTIONS_ROLE_POPOUT).analyticsLocations; const analyticsLocations2 = analyticsLocations; const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() { return GuildStore.getGuild(guildId); }); const id = (require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore], function() { return AuthenticationStore.getId(); }); const member = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], function() { return GuildMemberStore.getMember(guildId, id); }); const guildRoleConnectionEligibility = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildRoleConnectionEligibilityStore], function() { return GuildRoleConnectionEligibilityStore.getGuildRoleConnectionEligibility(roleId); }); let binding = analyticsLocations2; const [property, env0_9] = guildId2(binding.useState(guildRoleConnectionEligibility == null), 2); const r19 = member == null ? undefined : member.roles.includes(roleId); binding = analyticsLocations2; binding.useEffect(_fun87528, [userId, roleId, channelId, guildId]); binding.useEffect(_fun87529, [guildId, roleId, property, guildRoleConnectionEligibility]); const r17 = guildRoleConnectionEligibility == null ? undefined : guildRoleConnectionEligibility.flat().some(function(a0) { return a0.application_id === undefined; }); const value9 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildRoleStore], _fun87532); const r29 = guildRoleConnectionEligibility == null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.jDym4E) : guildRoleConnectionEligibility.length !== 1 ? guildRoleConnectionEligibility.length === 1 ? intl.format((require(1244) /* metro dependency 1244: indexNative */).t['0eBj3x'], {}) : intl.format((require(1244) /* metro dependency 1244: indexNative */).t.D7uftB, {}) : guildRoleConnectionEligibility[0].length === 1 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.jDym4E) : guildRoleConnectionEligibility.length === 1 ? intl.format((require(1244) /* metro dependency 1244: indexNative */).t['0eBj3x'], {}) : intl.format((require(1244) /* metro dependency 1244: indexNative */).t.D7uftB, {}); const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider; const BottomSheet = (BottomSheetNativeModule).BottomSheet; const view = ( {((Component) => )(importDefault(6812) /* metro dependency 6812: VerifiedRoleIcon */)} ); const Text = (TextModule).Text; const view2 = ( {view} {value9?.name} {r29} ); if (guildRoleConnectionEligibility == null) { r11 = ; } else if (guildRoleConnectionEligibility.flat() != null) { jsxRuntimeEnv0_18Binding = jsxRuntimeEnv0_18; items4 = [ , ]; if (r19) { r18 = null; } else { r18 = (