/* Metro module 15203; source: modules/integration_settings/native/IntegrationsSettingsWebhooksOverview.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 1878, 15204, 661, 33, 4501, 697, 1484, 1423, 6238, 1305, 1244, 21, 3995, 566, 1948, 4573, 15206, 6231, 7972, 4572, 5462, 3868, 15205, 2] */ import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import WebhooksStore from '../../../stores/WebhooksStore.tsx'; /* Metro dependency 15204 */ 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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */ import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */ import * as NativeModule2 from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */ import * as NavScrimAndroidModule from '../../../design/components/Navigator/native/NavScrim.android.tsx'; /* Metro dependency 5462 */ import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */ import * as NativeModule3 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */ function _fun116252(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:6, offset: 0x02482d6f, size: 590 bytes, params: 8, frame: 23 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; (ReactNativeModule).Platform; const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles; object = {}; const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER; object.form = {backgroundColor: BACKGROUND_BASE_LOWER, paddingTop: 16}; object.hint = {'paddingHorizontal': 16, 'marginBottom': 16}; const TABLE_ROW_PADDING = (Native).modules.mobile.TABLE_ROW_PADDING; object.row = {padding: TABLE_ROW_PADDING}; const env0_20 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]); const PureComponent = value.PureComponent; value = _fun116262(PureComponent); const ThemeContext = (NativeModule2).ThemeContext; value.contextType = ThemeContext; const env0_22 = []; (FileImportTrackerModule).fileFinishedImporting('modules/integration_settings/native/IntegrationsSettingsWebhooksOverview.tsx'); exports.default = ConnectedWebhooksOverview; function _isNativeReflectConstruct_116253() { // fn#116253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:367, offset: 0x02482fbd, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_116253_isNativeReflectConstruct = function() { return !!result; })(); } function WebhookItem({avatar, channel, guildId, name, token, user, webhookId, webhookType}) { // fn#116256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:786, offset: 0x0248301f, size: 517 bytes, params: 2, frame: 27 var object4; var r5; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var formatToPlainString; var property; var object; var object3; var value; const value3 = env0_8.useCallback(_fun116257, [webhookId, webhookType, avatar, channel, guildId, name, token, (UseNavigationNativeModule).useNavigation()]); const value4 = env0_8.useMemo(function() { return require(dependencyMap[16]).makeSource(require(dependencyMap[16]).getUserAvatarURL({id: webhookId, avatar: avatar, discriminator: NON_USER_BOT_DISCRIMINATOR})); }, [webhookId, avatar]); const TableRow = (TableRowNativeModule).TableRow; object4 = {}; const Avatar = (NativeModule).Avatar; object4.icon = ; object4.arrow = true; object4.label = name; if (user != null) { formatToPlainString = intl.formatToPlainString; property = (require(1244) /* metro dependency 1244: indexNative */).t['7EcUbr']; object3 = {}; value = importDefault(21) /* metro dependency 21: SnowflakeUtils */; object3.timestamp = value.extractTimestamp(webhookId); value = importDefault(3995) /* metro dependency 3995: UserUtils */; object3.user = value.getUserTag(user); value = Reflect.apply(formatToPlainString, intl, [property, object3]); r5 = value; } else { formatToPlainString = intl.formatToPlainString; property = (require(1244) /* metro dependency 1244: indexNative */).t['7mv59O']; object = {}; value = importDefault(21) /* metro dependency 21: SnowflakeUtils */; object.timestamp = value.extractTimestamp(webhookId); value = Reflect.apply(formatToPlainString, intl, [property, object]); r5 = value; } object4.subLabel = r5; object4.onPress = value3; return ; function _fun116257() { // fn#116257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:935, offset: 0x02483224, size: 97 bytes, params: 1, frame: 15 const push = Inherits.push; const EDIT_WEBHOOK = ChannelSettingsSections.EDIT_WEBHOOK; Reflect.apply(push, Inherits, [EDIT_WEBHOOK, {webhookId: webhookId, webhookType: webhookType, avatar: avatar, name: name, channel: channel, guildId: guildId, token: token}]); } } function ConnectedWebhookItem(a0) { // fn#116259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:1492, offset: 0x024832de, size: 190 bytes, params: 2, frame: 21 const env0_0 = a0.channelId; let user = a0.user; const value = Object.create(null); value.channelId = 0; value.user = 0; const value2 = copyDataProperties({}, a0, value, undefined); user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() { return UserStore.getUser(user?.id); }); return ( ); } function _fun116262(a0) { // fn#116262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:1734, offset: 0x024833cb, size: 126 bytes, params: 2, frame: 16 const WebhooksOverview2 = WebhooksOverview; Inherits(WebhooksOverview2, a0); return CreateClass(WebhooksOverview2, [{key: 'getHelpText', value: value_116264}, {key: 'renderWebhooks', value: value_116265}, {key: 'render', value: value_116268}]); function WebhooksOverview() { // fn#116263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:1746, offset: 0x011717ca, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_3(this, WebhooksOverview); const value3 = env1_6(WebhooksOverview); return env1_5(this, _isNativeReflectConstruct_116253() ? global.Reflect.construct(value3, arguments, env1_6(this).constructor) : value3.apply(this, arguments)); } function value_116264() { // fn#116264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:2045, offset: 0x02483449, size: 243 bytes, params: 1, frame: 19 var r0; const intl = (IndexNativeModule).intl; var format; const t = (IndexNativeModule).t; var property; var defaultImport; var defaultImport2; const webhookType = this.props.webhookType; const value = environment.__proto__; const CHANNEL_FOLLOWER = WebhookTypes.CHANNEL_FOLLOWER; if (webhookType === CHANNEL_FOLLOWER) { format = intl.format; property = t['5u+aV1']; defaultImport2 = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */; r0 = Reflect.apply(format, intl, [property, {helpdeskArticle: defaultImport2.getArticleURL(HelpdeskArticles.CHANNEL_FOLLOWING)}]); } else { format = intl.format; property = t['3hX7G+']; defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */; r0 = Reflect.apply(format, intl, [property, {articleURL: defaultImport.getArticleURL(HelpdeskArticles.WEBHOOKS_INTRODUCTION)}]); } return r0; } function value_116265() { // fn#116265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:2346, offset: 0x0248353c, size: 511 bytes, params: 1, frame: 26 var environment; var r9; var r0; var value2; var value3; var jsxRuntimeEnv1_18Binding; var value4; var items2; var EmptyState; var CHANNEL_FOLLOWER; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const {webhooks, webhookType} = this.props; const r6 = webhookType == null ? webhooks : webhooks.filter(function({type}) { return type === webhookType; }); let value = this.getHelpText(); if (r6.length === 0) { value3 = environment.__proto__; jsxRuntimeEnv1_18Binding = jsxRuntimeEnv1_18; value4 = undefined; const Text = (require(4573) /* metro dependency 4573: Text */).Text; value = ( {value} ); items2 = [value]; EmptyState = (require(1305) /* metro dependency 1305: native */).EmptyState; var emptyStateProps = {Illustration: (require(15206) /* metro dependency 15206: WebhookEmpty */).WebhookEmpty}; CHANNEL_FOLLOWER = WebhookTypes.CHANNEL_FOLLOWER; r9 = webhookType === CHANNEL_FOLLOWER ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dkHRkE) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4JAVI+']); emptyStateProps.title = r9; CHANNEL_FOLLOWER = WebhookTypes.CHANNEL_FOLLOWER; r9 = webhookType === CHANNEL_FOLLOWER ? value4 : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Gg3fUf); emptyStateProps.body = r9; items2[1] = ; value = ( <> {items2} ); r0 = value; } else { value2 = environment.__proto__; const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup; value = ( {r6.map(_fun116267)} ); r0 = value; } return r0; function _fun116267({id, type, avatar, name, user, token, guild_id, channel_id}) { // fn#116267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:2889, offset: 0x0248373b, size: 119 bytes, params: 2, frame: 23 const value = environment.__proto__.__proto__; return ( ); } } function value_116268() { // fn#116268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:3109, offset: 0x024837b2, size: 253 bytes, params: 1, frame: 26 const value2 = env1_20(this.context); const jsxRuntimeEnv1_18Binding = jsxRuntimeEnv1_18; const Form = (NativeModule3).Form; const form = value2.form; const contentContainerStyle = this.props.contentContainerStyle; const Stack = (StackNativeModule).Stack; const PX_24 = (Native).space.PX_24; const form2 = (
{this.renderWebhooks()}
); const NavScrim = (NavScrimAndroidModule).NavScrim; return ( <> {form2} ); } } function ConnectedWebhooksOverview({channelId, guildId, contentContainerStyle, webhookType}) { // fn#116269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:3596, offset: 0x024838af, size: 325 bytes, params: 2, frame: 23 const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() { return ChannelStore.getChannel(channelId); }); const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() { var r0; var guildStoreBinding = GuildStore; var getGuild = guildStoreBinding.getGuild; r0 = channel?.guild_id; r0 = r0 ?? guildId; return Reflect.apply(getGuild, guildStoreBinding, [r0]); }); const r13 = guild?.id ?? guildId; const r12 = channel?.id ?? channelId; const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([WebhooksStore], _fun116272); env0_8.useEffect(_fun116273, [r13, r12]); return ( guild != null ? ((Component) => )(env0_21) : null ); function _fun116272() { // fn#116272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:3979, offset: 0x02483a2b, size: 95 bytes, params: 1, frame: 14 return ClassCallCheck == null ? ClassCallCheck != null ? WebhooksStore.getWebhooksForGuild(ClassCallCheck) : env1_22 : CreateClass != null ? WebhooksStore.getWebhooksForChannel(ClassCallCheck, CreateClass) : ClassCallCheck != null ? WebhooksStore.getWebhooksForGuild(ClassCallCheck) : env1_22; } function _fun116273() { // fn#116273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15400:4086, offset: 0x02483a8a, size: 120 bytes, params: 1, frame: 13 var value2; var value3; var defaultImport2; if (ClassCallCheck == null) { if (ClassCallCheck != null) { value2 = environment.__proto__; (importDefault(15205) /* metro dependency 15205: WebhooksActionCreators */).fetchForGuild(ClassCallCheck); } } else if (CreateClass != null) { value3 = environment.__proto__; defaultImport2 = importDefault(15205) /* metro dependency 15205: WebhooksActionCreators */; defaultImport2.fetchForChannel(ClassCallCheck, CreateClass); } else if (ClassCallCheck != null) { value2 = environment.__proto__; (importDefault(15205) /* metro dependency 15205: WebhooksActionCreators */).fetchForGuild(ClassCallCheck); } } } } global.__d(_fun116252, 15203, [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 1878, 15204, 661, 33, 4501, 697, 1484, 1423, 6238, 1305, 1244, 21, 3995, 566, 1948, 4573, 15206, 6231, 7972, 4572, 5462, 3868, 15205, 2]) /* metro module 15203, dependencies: [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 1878, 15204, 661, 33, 4501, 697, 1484, 1423, 6238, 1305, 1244, 21, 3995, 566, 1948, 4573, 15206, 6231, 7972, 4572, 5462, 3868, 15205, 2] */;