decord/beta/source/modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx
2026-10-12 16:32:48 +00:00

114 lines
3.4 KiB
TypeScript

// Module ID: 18287
// Function ID: 18288
// Name: useChannelsAllowedToUnlink
// Dependencies: [4748, 4750, 10290, 558, 576, 504, 2]
// Exports: getChannelsAllowedToUnlink
// Module 18287 (useChannelsAllowedToUnlink)
import GuildChannelStore2 from "GuildChannelStore" /* 4748 */;
import PermissionStore from "PermissionStore" /* 4750 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
const require = globalThis.__r;
const GuildChannelStore = GuildChannelStore2;
let _require;
const f134173 = (channel) => channel.channel;
let closure_3 = GuildChannelStore2.GUILD_SELECTABLE_CHANNELS_KEY;
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useChannelsAllowedToUnlink(arg0) {
let first;
let tmp7;
_require = arg0;
const tmp2 = dependencyMap;
let obj = require("react");
const cResult = obj.c(3);
const tmp = _require;
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
let items = [PermissionStore, GuildChannelStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
const fn = function s() {
const obj = GuildChannelStore;
if (GuildChannelStore !== undefined) {
if (PermissionStore !== undefined) {
let items;
closure_0 = tmp2;
if (null == closure_0) {
items = [];
} else {
const arr = obj.getChannels(closure_0)[closure_3];
const found = arr.filter((channel) => {
const obj = closure_2_0(closure_2_1[2]);
return obj.canUnlinkLobbyChannel(channel.channel, closure_0);
});
items = found.map(f134173);
}
return items;
}
}
};
cResult[1] = arg0;
cResult[2] = fn;
tmp7 = fn;
} else {
tmp7 = cResult[2];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStoresArray(first, tmp7);
}) : (function useChannelsAllowedToUnlink(arg0) {
_require = arg0;
let obj = require("get initialized");
let items = [PermissionStore, GuildChannelStore];
return obj.useStateFromStoresArray(items, () => {
let obj = GuildChannelStore;
if (GuildChannelStore !== undefined) {
if (PermissionStore !== undefined) {
let items;
closure_0 = tmp2;
if (null == closure_0) {
items = [];
} else {
const arr = obj.getChannels(closure_0)[closure_3];
const found = arr.filter((channel) => {
const obj = closure_2_0(closure_2_1[2]);
return obj.canUnlinkLobbyChannel(channel.channel, closure_0);
});
items = found.map(f134173);
}
return items;
}
}
});
});
function getChannelsAllowedToUnlink(arg0) {
let items;
let obj = arg1;
if (arg1 === undefined) {
obj = GuildChannelStore;
}
let tmp = arg2;
if (arg2 === undefined) {
tmp = PermissionStore;
}
let closure_0 = tmp;
if (null == arg0) {
items = [];
} else {
const arr = obj.getChannels(arg0)[closure_3];
const found = arr.filter((channel) => {
const obj = closure_2_0(closure_2_1[2]);
return obj.canUnlinkLobbyChannel(channel.channel, closure_0);
});
items = found.map(f134173);
}
return items;
}
const result = size.fileFinishedImporting("modules/lobbies/hooks/useChannelsAllowedToUnlink.tsx");
export { getChannelsAllowedToUnlink };
export const useChannelsAllowedToUnlink = tmp2;