Files
2026-07-28 01:06:53 +03:00

106 lines
5.8 KiB
TypeScript

/* Metro module 5087; source: modules/spoiler_channels/SpoilerChannelUtils.tsx; dependencies: [1379, 5088, 566, 2] */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import ChannelSpoilerAgreeStore from './ChannelSpoilerAgreeStore.tsx'; /* Metro dependency 5088 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
function _fun44168(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:6, offset: 0x011699fc, size: 187 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const isChannelSpoilerGated2 = isChannelSpoilerGated;
(FileImportTrackerModule).fileFinishedImporting('modules/spoiler_channels/SpoilerChannelUtils.tsx');
exports.useGetSpoilerGatingChannelId = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore], _fun44172, [a0]);
};
exports.isChannelSpoilerGated = isChannelSpoilerGated2;
exports.useIsChannelSpoilerGated = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore], _fun44174, [a0]);
};
exports.useShouldShowSpoilerGateForChannelId = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([ChannelStore, ChannelSpoilerAgreeStore], _fun44176, [a0]);
};
exports.shouldShowSpoilerGateForChannelId = function(a0) {
if (a0 == null) {
return false;
}
return isChannelSpoilerGated(ChannelStore.getChannel(a0));
};
function getSpoilerGatingChannelId(a0) { // fn#44169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:142, offset: 0x01169ab7, size: 153 bytes, params: 2, frame: 14
var id;
var didAgree;
let value = a1;
const value2 = a2;
const r4 = value !== undefined ? value : ChannelSpoilerAgreeStore;
const r5 = value2 !== undefined ? value2 : ChannelStore;
value = null;
if (value != a0) {
if (a0.isSpoilerChannel()) {
didAgree = r4.didAgree;
id = a0.id;
id = Reflect.apply(didAgree, r4, [id]) ? value : a0.id;
return id;
}
if (value == a0.parent_id) {
return value;
}
var channel = r5.getChannel(a0.parent_id);
if (value == channel) {
return value;
}
if (channel.isSpoilerChannel()) {
if (r4.didAgree(channel.id)) {
return value;
}
return channel.id;
}
}
return value;
}
function isChannelSpoilerGated(a0) { // fn#44170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:394, offset: 0x01169b50, size: 55 bytes, params: 2, frame: 15
let value = a1;
const value2 = a2;
value = getSpoilerGatingChannelId(a0, value !== undefined ? value : ChannelSpoilerAgreeStore,
value2 !== undefined ? value2 : ChannelStore);
return value != null;
}
function useGetSpoilerGatingChannelId(a0) { // fn#44171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:559, offset: 0x01169b87, size: 81 bytes, params: 2, frame: 17
const env0_0 = a0;
return (FluxModule).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore],
_fun44172, [a0]);
function _fun44172() { // fn#44172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:641, offset: 0x01169bd8, size: 33 bytes, params: 1, frame: 15
return getSpoilerGatingChannelId(env0_0, ChannelSpoilerAgreeStore, ChannelStore);
}
}
function useIsChannelSpoilerGated(a0) { // fn#44173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:758, offset: 0x01169bf9, size: 81 bytes, params: 2, frame: 17
const env0_0 = a0;
return (FluxModule).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore],
_fun44174, [a0]);
function _fun44174() { // fn#44174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:836, offset: 0x01169c4a, size: 33 bytes, params: 1, frame: 15
return isChannelSpoilerGated(env0_0, ChannelSpoilerAgreeStore, ChannelStore);
}
}
function useShouldShowSpoilerGateForChannelId(a0) { // fn#44175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:915, offset: 0x01169c6b, size: 81 bytes, params: 2, frame: 17
const env0_0 = a0;
return (FluxModule).useStateFromStores([ChannelStore, ChannelSpoilerAgreeStore],
_fun44176, [a0]);
function _fun44176() { // fn#44176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:1005, offset: 0x01169cbc, size: 43 bytes, params: 1, frame: 15
const channelStoreBinding = ChannelStore;
return isChannelSpoilerGated(channelStoreBinding.getChannel(env0_0), ChannelSpoilerAgreeStore, channelStoreBinding);
}
}
}
global.__d(_fun44168, 5087, [1379, 5088, 566, 2]) /* metro module 5087, dependencies: [1379, 5088, 566, 2] */;