decord/source/modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx
2026-08-15 05:55:55 +00:00

120 lines
5.8 KiB
TypeScript

// Module ID: 14185
// Function ID: 14186
// Name: getGoreContentSettingOrDefault
// Dependencies: [1306, 14182, 5025, 5023, 2]
// Exports: isSetAndNotDefault, resolveExplicitContentSettingWithDefaultsForTeen, updateExplicitContentSetting, updateGoreContentSetting
// Module 14185 (getGoreContentSettingOrDefault)
function getGoreContentSettingOrDefault(arg0) {
let goreContentFriendDm;
let goreContentNonFriendDm;
const ParentalControlledGoreContent = require(14182) /* result */.ParentalControlledGoreContent;
let controlledSetting = ParentalControlledGoreContent.getControlledSetting(arg0);
if (controlledSetting == null) {
controlledSetting = {};
}
({ goreContentNonFriendDm, goreContentFriendDm } = controlledSetting);
if (!tmp3) {
let tmpResult = tmp(5025);
goreContentNonFriendDm = tmpResult.resolveGoreSettingWithDefaultsForTeen({ isDm: true });
}
const obj = { goreContentNonFriendDm, goreContentFriendDm: null, goreContentGuilds: null };
tmp3 = null != goreContentNonFriendDm && goreContentNonFriendDm !== require(1306) /* create */.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
if (!tmp4) {
tmpResult = tmp(5025);
goreContentFriendDm = tmpResult.resolveGoreSettingWithDefaultsForTeen({ isDm: true, isFriend: true });
}
obj[1] = goreContentFriendDm;
obj[2] = require(1306) /* create */.ExplicitContentRedaction.BLUR;
return obj;
}
function getExplicitContentSettingOrDefault(teenId) {
let isFriend;
let setting;
const ParentalControlledExplicitContent = require(14182) /* result */.ParentalControlledExplicitContent;
const controlledSetting = ParentalControlledExplicitContent.getControlledSetting(teenId);
let obj = { teenId, setting: null };
let prop;
if (controlledSetting != null) {
prop = controlledSetting.explicitContentNonFriendDm;
}
obj[1] = prop;
({ setting, isFriend, teenId } = obj);
if (isFriend === undefined) {
isFriend = false;
}
if (tmp5) {
obj = { explicitContentNonFriendDm: null, explicitContentFriendDm: null, explicitContentGuilds: null };
obj[0] = setting;
let prop1;
if (controlledSetting != null) {
prop1 = controlledSetting.explicitContentFriendDm;
}
if (!tmp10) {
const ParentalControlledLegacyExplicitContent2 = tmp(14182).ParentalControlledLegacyExplicitContent;
const controlledSetting1 = ParentalControlledLegacyExplicitContent2.getControlledSetting(teenId);
prop1 = tmp(5023).TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting1];
}
obj[1] = prop1;
obj[2] = tmp(1306).ExplicitContentRedaction.BLUR;
return obj;
} else {
const ParentalControlledLegacyExplicitContent = tmp(14182).ParentalControlledLegacyExplicitContent;
const controlledSetting2 = ParentalControlledLegacyExplicitContent.getControlledSetting(teenId);
let TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM = tmp(5023);
if (isFriend) {
TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM = TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM;
let tmp7 = TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting2];
} else {
tmp7 = TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_NON_FRIEND_DM[controlledSetting2];
}
}
}
let result = require("resolveGoreSettingWithDefaults").fileFinishedImporting("modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx");
export const isSetAndNotDefault = function isSetAndNotDefault(goreContentFriendDm) {
let tmp = null != goreContentFriendDm;
if (tmp) {
tmp = goreContentFriendDm !== require(1306) /* create */.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
}
return tmp;
};
export { getGoreContentSettingOrDefault };
export const updateGoreContentSetting = function updateGoreContentSetting(selectedTeenId) {
const ParentalControlledGoreContent = require(14182) /* result */.ParentalControlledGoreContent;
const merged = Object.assign(getGoreContentSettingOrDefault(selectedTeenId));
const merged1 = Object.assign(arg1);
const result = ParentalControlledGoreContent.updateControlledSetting(selectedTeenId, {});
};
export const resolveExplicitContentSettingWithDefaultsForTeen = function resolveExplicitContentSettingWithDefaultsForTeen(teenId) {
let isFriend;
let setting;
({ setting, isFriend } = teenId);
if (isFriend === undefined) {
isFriend = false;
}
let tmp = null != setting;
if (tmp) {
tmp = setting !== require(1306) /* create */.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
}
if (tmp) {
return setting;
} else {
const ParentalControlledLegacyExplicitContent = require(14182) /* result */.ParentalControlledLegacyExplicitContent;
const controlledSetting = ParentalControlledLegacyExplicitContent.getControlledSetting(teenId.teenId);
const tmp7 = require(5023) /* resolveExplicitContentSettingWithDefaults */;
if (isFriend) {
let tmp8 = tmp7.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting];
} else {
tmp8 = tmp7.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_NON_FRIEND_DM[controlledSetting];
}
return tmp8;
}
};
export { getExplicitContentSettingOrDefault };
export const updateExplicitContentSetting = function updateExplicitContentSetting(selectedTeenId) {
const ParentalControlledExplicitContent = require(14182) /* result */.ParentalControlledExplicitContent;
const merged = Object.assign(getExplicitContentSettingOrDefault(selectedTeenId));
const merged1 = Object.assign(arg1);
const result = ParentalControlledExplicitContent.updateControlledSetting(selectedTeenId, {});
};