Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
184 lines
6.9 KiB
TypeScript
184 lines
6.9 KiB
TypeScript
// Module ID: 7365
|
|
// Function ID: 7366
|
|
// Name: usePromptHelpText
|
|
// Dependencies: [2041, 2099, 4395, 4405, 1372, 1074, 1115, 504, 4909, 2]
|
|
// Exports: default, useCustomizeCommunityPromptHelpText
|
|
|
|
// Module 7365 (usePromptHelpText)
|
|
import ChannelStore from "ChannelStore" /* 2041 */;
|
|
import GuildRoleStore from "GuildRoleStore" /* 2099 */;
|
|
import PermissionStore from "PermissionStore" /* 4395 */;
|
|
import RelationshipStore from "RelationshipStore" /* 4405 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
const require = fn;
|
|
const Permissions = fn(1074).Permissions;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/guild_onboarding/usePromptHelpText.tsx");
|
|
|
|
export default function usePromptHelpText(arg0) {
|
|
({ guild, prompt: _prompt, selectedRoleIds } = arg0);
|
|
({ selectedChannelIds: dependencyMap, itemHook } = arg0);
|
|
let id;
|
|
if (guild != null) {
|
|
id = guild.id;
|
|
}
|
|
const items = [GuildRoleStore];
|
|
const items1 = [id, selectedRoleIds];
|
|
const stateFromStoresArray = selectedRoleIds(504).useStateFromStoresArray(items, () => {
|
|
if (null != id) {
|
|
let manyRoles = GuildRoleStore.getManyRoles(tmp, selectedRoleIds);
|
|
} else {
|
|
manyRoles = [];
|
|
}
|
|
return manyRoles;
|
|
}, items1);
|
|
const obj = selectedRoleIds(504);
|
|
const items2 = [id, UserStore, RelationshipStore, PermissionStore];
|
|
const stateFromStoresArray1 = selectedRoleIds(504).useStateFromStoresArray(items2, () => {
|
|
const mapped = Array.from(dependencyMap).map((item) => channel.getChannel(item));
|
|
const found = mapped.filter((item) => {
|
|
let canResult = null != item;
|
|
if (canResult) {
|
|
canResult = closure_1_4.can(constants.VIEW_CHANNEL, item);
|
|
}
|
|
return canResult;
|
|
});
|
|
return found.map((item) => selectedRoleIds(closure_1_1[8]).computeChannelName(item, closure_1_6, closure_1_5, true));
|
|
});
|
|
let mapped = stateFromStoresArray.map((name) => "@" + name.name);
|
|
let singleSelect;
|
|
if (_prompt != null) {
|
|
singleSelect = _prompt.singleSelect;
|
|
}
|
|
let str = "";
|
|
if (!singleSelect) {
|
|
const intl = tmp2(1115).intl;
|
|
str = intl.string(tmp2(1115).t.JshhEl);
|
|
}
|
|
if (0 === stateFromStoresArray1.length) {
|
|
if (mapped.length > 0) {
|
|
let str6 = "";
|
|
if (0 !== mapped.length) {
|
|
const intl4 = tmp2(1115).intl;
|
|
const obj3 = { count: mapped.length, extraCount: null, role1: null, role2: null, itemHook: null };
|
|
const _Math3 = Math;
|
|
obj3.extraCount = Math.max(mapped.length - 2, 0);
|
|
[obj6.role1, obj6.role2] = mapped;
|
|
obj3.itemHook = itemHook;
|
|
str6 = intl4.format(tmp2(1115).t.Kj5GIT, obj3);
|
|
}
|
|
str = str6;
|
|
let str2 = "";
|
|
}
|
|
const obj10 = { helpText: str, helpTextAdditional: str2 };
|
|
return obj10;
|
|
}
|
|
str2 = "";
|
|
if (stateFromStoresArray1.length > 0) {
|
|
let str3 = "";
|
|
if (0 !== stateFromStoresArray1.length) {
|
|
const intl2 = tmp2(1115).intl;
|
|
const obj11 = { count: stateFromStoresArray1.length, extraCount: null, channel1: null, channel2: null, itemHook: null };
|
|
const _Math = Math;
|
|
obj11.extraCount = Math.max(stateFromStoresArray1.length - 2, 0);
|
|
[obj4.channel1, obj4.channel2] = stateFromStoresArray1;
|
|
obj11.itemHook = itemHook;
|
|
str3 = intl2.format(tmp2(1115).t.Rj841R, obj11);
|
|
}
|
|
let str4 = "";
|
|
if (mapped.length > 0) {
|
|
let str5 = "";
|
|
if (0 !== mapped.length) {
|
|
const intl3 = tmp2(1115).intl;
|
|
const obj12 = { count: mapped.length, extraCount: null, role1: null, role2: null, itemHook: null };
|
|
const _Math2 = Math;
|
|
obj12.extraCount = Math.max(mapped.length - 2, 0);
|
|
[obj5.role1, obj5.role2] = mapped;
|
|
obj12.itemHook = itemHook;
|
|
str5 = intl3.format(tmp2(1115).t.cJZxWf, obj12);
|
|
}
|
|
str4 = str5;
|
|
}
|
|
str2 = str4;
|
|
str = str3;
|
|
}
|
|
};
|
|
export const useCustomizeCommunityPromptHelpText = function useCustomizeCommunityPromptHelpText(arg0) {
|
|
({ guild, prompt: _prompt, selectedRoleIds } = arg0);
|
|
({ selectedChannelIds: dependencyMap, itemHook } = arg0);
|
|
let id;
|
|
if (guild != null) {
|
|
id = guild.id;
|
|
}
|
|
const items = [GuildRoleStore];
|
|
const items1 = [id, selectedRoleIds];
|
|
const stateFromStoresArray = selectedRoleIds(504).useStateFromStoresArray(items, () => {
|
|
if (null != id) {
|
|
let manyRoles = GuildRoleStore.getManyRoles(tmp, selectedRoleIds);
|
|
} else {
|
|
manyRoles = [];
|
|
}
|
|
return manyRoles;
|
|
}, items1);
|
|
const obj = selectedRoleIds(504);
|
|
const items2 = [id, UserStore, RelationshipStore, PermissionStore];
|
|
const stateFromStoresArray1 = selectedRoleIds(504).useStateFromStoresArray(items2, () => {
|
|
const mapped = Array.from(dependencyMap).map((item) => channel.getChannel(item));
|
|
const found = mapped.filter((item) => {
|
|
let canResult = null != item;
|
|
if (canResult) {
|
|
canResult = closure_1_4.can(constants.VIEW_CHANNEL, item);
|
|
}
|
|
return canResult;
|
|
});
|
|
return found.map((item) => selectedRoleIds(closure_1_1[8]).computeChannelName(item, closure_1_6, closure_1_5, true));
|
|
});
|
|
let mapped = stateFromStoresArray.map((name) => "@" + name.name);
|
|
let singleSelect;
|
|
if (_prompt != null) {
|
|
singleSelect = _prompt.singleSelect;
|
|
}
|
|
let str = "";
|
|
if (!singleSelect) {
|
|
const intl = tmp2(1115).intl;
|
|
str = intl.string(tmp2(1115).t.JshhEl);
|
|
}
|
|
if (0 === stateFromStoresArray1.length) {
|
|
if (mapped.length > 0) {
|
|
const intl4 = tmp2(1115).intl;
|
|
const obj6 = { count: mapped.length, extraCount: null, role1: null, role2: null, itemHook: null };
|
|
const _Math4 = Math;
|
|
obj6.extraCount = Math.max(mapped.length - 2, 0);
|
|
[obj5.role1, obj5.role2] = mapped;
|
|
obj6.itemHook = itemHook;
|
|
str = intl4.format(tmp2(1115).t.vdtNYa, obj6);
|
|
}
|
|
const obj10 = { helpText: str, helpTextAdditional: "" };
|
|
return obj10;
|
|
}
|
|
if (stateFromStoresArray1.length > 0) {
|
|
if (0 === mapped.length) {
|
|
const intl3 = tmp2(1115).intl;
|
|
const obj11 = { count: stateFromStoresArray1.length, extraCount: null, channel1: null, channel2: null, itemHook: null };
|
|
const _Math3 = Math;
|
|
obj11.extraCount = Math.max(stateFromStoresArray1.length - 2, 0);
|
|
[obj4.channel1, obj4.channel2] = stateFromStoresArray1;
|
|
obj11.itemHook = itemHook;
|
|
str = intl3.format(tmp2(1115).t.ZKywGU, obj11);
|
|
}
|
|
}
|
|
if (tmp5) {
|
|
const intl2 = tmp2(1115).intl;
|
|
const obj12 = { channelCount: stateFromStoresArray1.length, extraChannelCount: null, channel1: null, channel2: null, itemHook: null, roleCount: null, extraRoleCount: null, role1: null, role2: null };
|
|
const _Math = Math;
|
|
obj12.extraChannelCount = Math.max(stateFromStoresArray1.length - 2, 0);
|
|
[obj3.channel1, obj3.channel2] = stateFromStoresArray1;
|
|
obj12.itemHook = itemHook;
|
|
obj12.roleCount = mapped.length;
|
|
const _Math2 = Math;
|
|
obj12.extraRoleCount = Math.max(mapped.length - 2, 0);
|
|
[obj3.role1, obj3.role2] = mapped;
|
|
str = intl2.format(tmp2(1115).t.WewRHM, obj12);
|
|
}
|
|
};
|