decord/alpha/source/modules/hotspot/HotspotStore.tsx

103 lines
3.1 KiB
TypeScript
Raw Normal View History

// Module ID: 6821
// Function ID: 6822
// Name: hotspot/HotspotStore
// Dependencies: [1081, 504, 5639, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 6821 (hotspot/HotspotStore)
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import ConferenceModeConstants from "ConferenceModeConstants" /* 1081 */;
import ProcessArgs2 from "ProcessArgs" /* 5639 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const CONFERENCE_MODE_ENABLED = ConferenceModeConstants.CONFERENCE_MODE_ENABLED;
2026-07-23 10:11:24 +00:00
let set = new Set();
let hotspotOverrides = {};
2026-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class HotspotStore extends PersistedStore {
}
const prototype = HotspotStore.prototype;
prototype["initialize"] = function initialize(hiddenHotspots) {
if (null != hiddenHotspots) {
const _Array = Array;
if (Array.isArray(hiddenHotspots.hiddenHotspots)) {
const _Set = Set;
2026-08-24 06:08:38 +00:00
set = new Set(hiddenHotspots.hiddenHotspots);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (null != hiddenHotspots.hotspotOverrides) {
hotspotOverrides = hiddenHotspots.hotspotOverrides;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
};
prototype["hasHotspot"] = function hasHotspot(LIVE_STAGE_NOTIFICATION_BADGE) {
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
let tmp = !flag;
if (!flag) {
tmp = hotspotOverrides[LIVE_STAGE_NOTIFICATION_BADGE];
2026-07-29 08:29:29 +00:00
}
let tmp3 = !CONFERENCE_MODE_ENABLED;
if (!CONFERENCE_MODE_ENABLED) {
const ProcessArgs = ProcessArgs2.ProcessArgs;
2026-07-29 08:29:29 +00:00
const isDisallowPopupsSetResult = ProcessArgs.isDisallowPopupsSet();
let tmp7 = !isDisallowPopupsSetResult;
if (!isDisallowPopupsSetResult) {
if (!tmp) {
tmp = !set.has(LIVE_STAGE_NOTIFICATION_BADGE);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp7 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp7;
}
return tmp3;
};
prototype["hasHiddenHotspot"] = function hasHiddenHotspot(HUB_LINK_CHANNEL_NOTICE) {
return set.has(HUB_LINK_CHANNEL_NOTICE);
2026-07-29 08:29:29 +00:00
};
prototype["getHotspotOverride"] = function getHotspotOverride(arg0) {
return hotspotOverrides[arg0];
2026-07-29 08:29:29 +00:00
};
prototype["getState"] = function getState() {
return { hiddenHotspots: set, hotspotOverrides };
2026-07-29 08:29:29 +00:00
};
HotspotStore.displayName = "HotspotStore";
HotspotStore.persistKey = "hotspots";
const items = [
2026-07-20 16:05:17 +00:00
(arg0) => {
2026-07-29 08:29:29 +00:00
let hiddenHotspots = arg0;
if (arg0 == null) {
hiddenHotspots = [];
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return { hiddenHotspots, hotspotOverrides: {} };
2026-07-20 16:05:17 +00:00
}
];
2026-07-29 08:29:29 +00:00
HotspotStore.migrations = items;
const hotspotStore = new HotspotStore(DispatcherDefault, {
2026-07-20 16:05:17 +00:00
OVERLAY_INITIALIZE: function handleOverlayInitialize(hiddenHotspots) {
2026-08-24 06:08:38 +00:00
set = new Set(hiddenHotspots.hiddenHotspots);
2026-07-20 16:05:17 +00:00
},
HOTSPOT_HIDE: function handleHotspotHide(location) {
const _location = location.location;
if (set.has(_location)) {
return false;
} else {
set.add(_location);
}
},
HOTSPOT_OVERRIDE_SET: function handleSetHotspotOverride(location) {
hotspotOverrides[location.location] = location.enabled;
2026-07-20 16:05:17 +00:00
},
HOTSPOT_OVERRIDE_CLEAR: function handleClearHotspotOverride(arg0) {
if (null == hotspotOverrides[arg0.location]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
});
const result = size.fileFinishedImporting("modules/hotspot/HotspotStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default hotspotStore;