decord/source/modules/parent_tools/native/ParentalConsentWarningManager.tsx
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

132 lines
4.7 KiB
TypeScript

// Module ID: 17546
// Function ID: 17547
// Name: ParentalConsentWarningManager
// Dependencies: [4297, 7611, 14922, 7612, 1074, 14923, 4574, 17547, 1896, 7192, 17549, 2]
// Module 17546 (ParentalConsentWarningManager)
import asyncRequireImpl from "asyncRequireImpl" /* 1896 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4574 */;
import ParentalConsentWarningTypes from "ParentalConsentWarningTypes" /* 14923 */;
import ParentalConsentWarningActionCreators from "ParentalConsentWarningActionCreators" /* 17549 */;
import ActionSheetStore from "ActionSheetStore" /* 4297 */;
import FamilyCenterStore from "FamilyCenterStore" /* 7611 */;
import ParentalConsentWarningStore from "ParentalConsentWarningStore" /* 14922 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7192 */;
require = fn;
function maybePresentModal(daysRemaining) {
daysRemaining = undefined;
if (daysRemaining != null) {
daysRemaining = daysRemaining.daysRemaining;
}
let hasItem;
if (daysRemaining != null) {
const surfaces = daysRemaining.surfaces;
if (surfaces != null) {
hasItem = surfaces.includes(ParentalConsentWarningTypes.ParentalConsentWarningSurface.MODAL);
}
}
let tmp5 = true === hasItem && null != daysRemaining;
if (tmp5) {
tmp5 = daysRemaining >= 0;
}
if (tmp5) {
tmp5 = !ParentalConsentWarningStore.hasShownModalToday();
}
if (tmp5) {
const _Object = Object;
const values = Object.values(FamilyCenterStore.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;
});
}
if (tmp5) {
tmp5 = !ActionSheetStore.isOpen();
}
if (tmp5) {
const obj = { daysRemaining };
ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(17547, dependencyMap.paths), "ParentalConsentWarningModal", obj);
}
}
const FamilyCenterConstants = fn(7612);
({ UserLinkStatus: closure_7, UserLinkType: closure_8 } = FamilyCenterConstants);
const AppStates = fn(1074).AppStates;
const prototype = function ParentalConsentWarningManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS(warning) {
maybePresentModal(warning.warning);
},
POST_CONNECTION_OPEN() {
const values = Object.values(linkedUsers.getLinkedUsers());
c3 = values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
ParentalConsentWarningActionCreators.maybeFetchWarning();
if (!ParentalConsentWarningStore.shouldFetchToday()) {
maybePresentModal(ParentalConsentWarningStore.getWarning());
}
},
APP_STATE_UPDATE(state) {
if (state.state === constants.ACTIVE) {
ParentalConsentWarningActionCreators.maybeFetchWarning();
if (!ParentalConsentWarningStore.shouldFetchToday()) {
maybePresentModal(obj2.getWarning());
}
obj2 = ParentalConsentWarningStore;
}
},
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;
});
c3 = someResult;
if (tmp) {
if (someResult) {
const warning = ParentalConsentWarningStore.getWarning();
let hasItem;
if (warning != null) {
const surfaces = warning.surfaces;
if (surfaces != null) {
hasItem = surfaces.includes(ParentalConsentWarningTypes.ParentalConsentWarningSurface.BANNER);
}
}
if (true === hasItem) {
ParentalConsentWarningActionCreators.forceFetchWarning();
}
} else {
ParentalConsentWarningActionCreators.forceFetchWarning();
}
}
tmp = undefined !== c3 && c3 !== someResult;
}
},
LOGOUT() {
c3 = undefined;
ParentalConsentWarningActionCreators.resetFetchState();
}
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
}
const prototype1 = new prototype();
const size = fn(2);
const result = size.fileFinishedImporting("modules/parent_tools/native/ParentalConsentWarningManager.tsx");
export default prototype1;