decord/source/modules/parent_tools/native/ParentalConsentWarningManager.tsx

135 lines
4.2 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 16540
// Function ID: 16541
2026-07-29 08:29:29 +00:00
// Name: maybePresentModal
2026-08-08 06:10:11 +00:00
// Dependencies: [3994, 6996, 14112, 6997, 676, 14113, 4271, 16541, 1988, 5261, 16543, 2]
2026-07-20 16:05:17 +00:00
2026-08-08 06:10:11 +00:00
// Module 16540 (maybePresentModal)
2026-07-29 08:29:29 +00:00
import setContent from "setContent";
import freshTeenActivityWithMap from "freshTeenActivityWithMap";
import initialize from "initialize";
2026-07-23 10:11:24 +00:00
import items from "items";
import { AppStates } from "ME";
2026-07-29 08:29:29 +00:00
import "initialize";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function maybePresentModal(daysRemaining) {
daysRemaining = undefined;
if (daysRemaining != null) {
daysRemaining = daysRemaining.daysRemaining;
2026-07-20 16:05:17 +00:00
}
let hasItem;
2026-07-29 08:29:29 +00:00
if (daysRemaining != null) {
const surfaces = daysRemaining.surfaces;
if (surfaces != null) {
2026-08-08 06:10:11 +00:00
hasItem = surfaces.includes(require(14113) /* frozen */.ParentalConsentWarningSurface.MODAL);
2026-07-20 16:05:17 +00:00
}
}
let tmp5 = true === hasItem && null != daysRemaining;
if (tmp5) {
tmp5 = daysRemaining >= 0;
}
if (tmp5) {
2026-07-29 08:29:29 +00:00
tmp5 = !initialize.hasShownModalToday();
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
const _Object = Object;
2026-07-29 08:29:29 +00:00
const values = Object.values(linkedUsers.getLinkedUsers());
tmp5 = !values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
tmp5 = !open.isOpen();
}
if (tmp5) {
2026-07-29 08:29:29 +00:00
const obj = { daysRemaining: null };
obj[0] = daysRemaining;
2026-08-08 06:10:11 +00:00
importDefault(4271).openLazy(require(1988) /* asyncRequireImpl */(16541, dependencyMap.paths), "ParentalConsentWarningModal", obj);
const obj2 = importDefault(4271);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
({ UserLinkStatus: error, UserLinkType: metroImportAll } = items);
let prototype = function ParentalConsentWarningManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS(warning) {
callback2(warning.warning);
},
POST_CONNECTION_OPEN() {
const values = Object.values(linkedUsers.getLinkedUsers());
let closure_3 = values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
2026-08-08 06:10:11 +00:00
callback(16543).maybeFetchWarning();
2026-07-29 08:29:29 +00:00
if (!initialize.shouldFetchToday()) {
callback2(initialize.getWarning());
}
},
APP_STATE_UPDATE(state) {
if (state.state === constants.ACTIVE) {
2026-08-08 06:10:11 +00:00
callback(16543).maybeFetchWarning();
2026-07-29 08:29:29 +00:00
if (!initialize.shouldFetchToday()) {
callback2(obj2.getWarning());
}
2026-08-08 06:10:11 +00:00
const obj = callback(16543);
2026-07-29 08:29:29 +00:00
obj2 = initialize;
}
},
CURRENT_USER_UPDATE(user) {
user = user.user;
if (undefined !== user.linked_users) {
const linked_users = user.linked_users;
const someResult = linked_users.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
let closure_3 = someResult;
if (tmp) {
if (someResult) {
const warning = initialize.getWarning();
let hasItem;
if (warning != null) {
const surfaces = warning.surfaces;
if (surfaces != null) {
2026-08-08 06:10:11 +00:00
hasItem = surfaces.includes(callback(14113).ParentalConsentWarningSurface.BANNER);
2026-07-29 08:29:29 +00:00
}
}
if (true === hasItem) {
2026-08-08 06:10:11 +00:00
callback(16543).forceFetchWarning();
const obj2 = callback(16543);
2026-07-29 08:29:29 +00:00
}
} else {
2026-08-08 06:10:11 +00:00
callback(16543).forceFetchWarning();
const obj = callback(16543);
2026-07-29 08:29:29 +00:00
}
}
tmp = undefined !== closure_3 && closure_3 !== someResult;
}
},
LOGOUT() {
let c3;
2026-08-08 06:10:11 +00:00
callback(16543).resetFetchState();
2026-07-29 08:29:29 +00:00
}
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
prototype = new prototype();
const result = require("initialize").fileFinishedImporting("modules/parent_tools/native/ParentalConsentWarningManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;