/* Metro module 5097; source: actions/ReadStateActionCreators.tsx; dependencies: [5071, 1383, 1379, 5098, 1878, 661, 694, 21, 2] */ import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */ import ChannelStore from '../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import UserStore from '../stores/UserStore.tsx'; /* Metro dependency 1878 */ import ActiveJoinedThreadsStore from '../modules/threads/ActiveJoinedThreadsStore.tsx'; /* Metro dependency 5071 */ import GuildCategoryStore from '../stores/GuildCategoryStore.tsx'; /* Metro dependency 5098 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */ import * as ChannelRecordModule from '../records/ChannelRecord.tsx'; /* Metro dependency 1383 */ function _fun44475(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:6, offset: 0x01171b97, size: 337 bytes, params: 8, frame: 21 const _arrayLikeToArray_44478 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const ack2 = ack; const ackCategory2 = ackCategory; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('actions/ReadStateActionCreators.tsx'); exports.ack = ack2; exports.ackCategory = ackCategory2; exports.ackChannel = ackChannel; exports.bulkAck = function(a0, a1) { importDefault(dependencyMap[6]).dispatch({type: 'BULK_ACK', channels: a0, context: CURRENT_APP_CONTEXT, onFinished: a1}); }; exports.localAck = localAck; exports.enableAutomaticAck = enableAutomaticAck; exports.disableAutomaticAck = disableAutomaticAck; exports.ackGuildFeature = ackGuildFeature; exports.ackUserFeature = ackUserFeature; exports.clearOldestUnreadMessageId = clearOldestUnreadMessageId_44491; function _createForOfIteratorHelperLoose_44476(a0, a1) { // fn#44476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:197, offset: 0x01171ce8, size: 370 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun44477; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_44478(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_44478(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_44478(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun44477; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun44477() { // fn#44477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:768, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function ack(a0, a1) { // fn#44479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:1107, offset: 0x01171e5a, size: 104 bytes, params: 3, frame: 16 const value = a2; const value2 = a3; (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CHANNEL_ACK', channelId: a0, messageId: a4, immediate: value !== undefined ? value : false, force: value2 !== undefined ? value2 : false, context: CURRENT_APP_CONTEXT, location: a1}); } function ackCategory(a0, a1) { // fn#44480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:1241, offset: 0x01171ec2, size: 221 bytes, params: 3, frame: 22 var r6; var r5; var r2; var guild_id; var guildCategoryStoreBinding; var getCategories; var value4; var property; var filter; var value5; var map; var value6; var forEach; var value7; var value8; var done; var ackBinding; var value9; var value10; let value = a2; const value2 = a3; reducibleJoin2: while (true) { if (value !== undefined) { r6 = value; break reducibleJoin2; } value = false; r6 = value; break reducibleJoin2; } reducibleJoin4: while (true) { if (value2 !== undefined) { r5 = value2; break reducibleJoin4; } value = false; r5 = value; break reducibleJoin4; } var env0_1; const channel = ChannelStore.getChannel(a0); reducibleJoin9: while (true) { if (channel == null) { break reducibleJoin9; } guild_id = channel.guild_id; if (guild_id == null) { break reducibleJoin9; } guildCategoryStoreBinding = GuildCategoryStore; getCategories = guildCategoryStoreBinding.getCategories; guild_id = channel.guild_id; value4 = Reflect.apply(getCategories, guildCategoryStoreBinding, [guild_id]); if (value4[a0] == null) { break reducibleJoin9; } property = value4[a0]; filter = property.filter; value5 = Reflect.apply(filter, property, [function({channel}) { return isReadableType(channel.type); }]); map = value5.map; value6 = Reflect.apply(map, value5, [_fun44482]); env0_1 = value6; forEach = value5.forEach; Reflect.apply(forEach, value5, [_fun44483]); value7 = _createForOfIteratorHelperLoose_44476(value6); value8 = value7(); done = value8.done; if (done) { break reducibleJoin9; } r2 = value8; reducibleLoop8: while (true) { ackBinding = ack; value9 = r2.value; ackBinding(value9, a1, r6, r5); value10 = value7(); done = value10.done; if (done) { break reducibleJoin9; } r2 = value10; continue reducibleLoop8; } } function _fun44483({channel}) { // fn#44483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:1466, offset: 0x01171fbc, size: 101 bytes, params: 2, frame: 18 var propertyName; var binding; let guild_id = channel.guild_id; guild_id = guild_id ?? env0_0.guild_id; const value = environment.__proto__; const activeJoinedThreadsStoreBinding = ActiveJoinedThreadsStore; const getActiveJoinedThreadsForParent = activeJoinedThreadsStoreBinding.getActiveJoinedThreadsForParent; for (propertyName in Reflect.apply(getActiveJoinedThreadsForParent, activeJoinedThreadsStoreBinding, [guild_id, channel.id])) { binding = env0_1; binding.push(propertyName); } } } function ackChannel(a0, a1) { // fn#44484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:1803, offset: 0x01172021, size: 156 bytes, params: 3, frame: 22 var ackBinding; var id; var fromTimestamp; var Date; let value = a0.isCategory(); if (value) { ackCategory(a0.id, a1, true, true); } else { value = a0.isForumLikeChannel(); ackBinding = ack; id = a0.id; if (value) { value = importDefault(21) /* metro dependency 21: SnowflakeUtils */; fromTimestamp = value.fromTimestamp; Date = global.Date; value = Reflect.apply(fromTimestamp, value, [Date.now()]); ackBinding(id, a1, true, true, value); } else { ackBinding(id, a1, true, true); } } } function localAck(a0) { // fn#44486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:2079, offset: 0x01172104, size: 54 bytes, params: 2, frame: 13 (Dispatcher).dispatch({type: 'CHANNEL_LOCAL_ACK', channelId: a0}); } function enableAutomaticAck(a0, a1) { // fn#44487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:2180, offset: 0x0117213a, size: 62 bytes, params: 3, frame: 13 (Dispatcher).dispatch({type: 'ENABLE_AUTOMATIC_ACK', channelId: a0, windowId: a1}); } function disableAutomaticAck(a0, a1) { // fn#44488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:2308, offset: 0x01172178, size: 62 bytes, params: 3, frame: 13 (Dispatcher).dispatch({type: 'DISABLE_AUTOMATIC_ACK', channelId: a0, windowId: a1}); } function ackGuildFeature(a0, a1, a2) { // fn#44489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:2434, offset: 0x011721b6, size: 77 bytes, params: 4, frame: 13 (Dispatcher).dispatch({type: 'GUILD_FEATURE_ACK', id: a0, ackType: a1, ackedId: a2, local: false}); } function ackUserFeature(a0, a1) { // fn#44490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:2564, offset: 0x01172203, size: 103 bytes, params: 3, frame: 14 const currentUser = UserStore.getCurrentUser(); const value3 = undefined; if ((currentUser == null ? value3 : currentUser.id) != null) { (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'USER_NON_CHANNEL_ACK', ackType: a0, ackedId: a1, local: false}); } return value3; } function clearOldestUnreadMessageId_44491(a0) { // fn#44491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:2757, offset: 0x0117226a, size: 56 bytes, params: 2, frame: 13 (Dispatcher).dispatch({type: 'CLEAR_OLDEST_UNREAD_MESSAGE', channelId: a0}); } } function _fun44482({channel}) { // fn#44482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5275:1433, offset: 0x00ef0e66, size: 15 bytes, params: 2, frame: 1 return channel.id; } global.__d(_fun44475, 5097, [5071, 1383, 1379, 5098, 1878, 661, 694, 21, 2]) /* metro module 5097, dependencies: [5071, 1383, 1379, 5098, 1878, 661, 694, 21, 2] */;