decord/source/stores/web/WindowStore.tsx

211 lines
6.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 13386
// Function ID: 13387
2026-07-29 08:29:29 +00:00
// Name: map
2026-08-25 06:04:03 +00:00
// Dependencies: [38, 589, 5447, 709, 698, 2009, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 13386 (map)
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */;
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-08-25 06:04:03 +00:00
import getWindowId from "getWindowId" /* 5447 */;
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
let c3 = null;
const map = new Map();
let set = new Set();
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class WindowStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = WindowStore.prototype;
prototype["isFocused"] = function isFocused() {
let mainWindowId = arg0;
if (arg0 === undefined) {
2026-08-24 06:08:38 +00:00
let obj = getWindowId;
2026-07-29 08:29:29 +00:00
mainWindowId = obj.getMainWindowId();
}
let value = map.get(mainWindowId);
2026-07-20 16:05:17 +00:00
if (null == value) {
2026-07-29 08:29:29 +00:00
const hasItem = set.has(mainWindowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
2026-07-20 16:05:17 +00:00
value = obj;
}
2026-07-29 08:29:29 +00:00
return value.focused;
};
prototype["isAppFocused"] = function isAppFocused() {
return null != this.getFocusedWindowId();
};
prototype["isVisible"] = function isVisible() {
let mainWindowId = arg0;
if (arg0 === undefined) {
2026-08-24 06:08:38 +00:00
let obj = getWindowId;
2026-07-29 08:29:29 +00:00
mainWindowId = obj.getMainWindowId();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
return value.visible;
};
prototype["getFocusedWindowId"] = function getFocusedWindowId() {
2026-08-24 06:08:38 +00:00
c0 = null;
2026-07-29 08:29:29 +00:00
const item = map.forEach((focused) => {
if (focused.focused) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
});
return c0;
};
prototype["getLastFocusedWindowId"] = function getLastFocusedWindowId() {
return c3;
};
prototype["isElementFullScreen"] = function isElementFullScreen() {
let mainWindowId = arg0;
if (arg0 === undefined) {
2026-08-24 06:08:38 +00:00
let obj = getWindowId;
2026-07-29 08:29:29 +00:00
mainWindowId = obj.getMainWindowId();
}
let value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
return value.isElementFullscreen;
};
prototype["windowSize"] = function windowSize() {
let mainWindowId = arg0;
if (arg0 === undefined) {
2026-08-24 06:08:38 +00:00
let obj = getWindowId;
2026-07-29 08:29:29 +00:00
mainWindowId = obj.getMainWindowId();
}
let value = map.get(mainWindowId);
if (null == value) {
const hasItem = set.has(mainWindowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
return value.windowSize;
};
WindowStore.displayName = "WindowStore";
2026-08-24 06:08:38 +00:00
const windowStore = new WindowStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
WINDOW_INIT: function handleWindowInit(isElementFullscreen) {
2026-08-24 06:08:38 +00:00
_modDef38(!map.has(isElementFullscreen.windowId), "Window initialized multiple times");
2026-07-20 16:05:17 +00:00
const focused = isElementFullscreen.focused;
2026-07-23 10:11:24 +00:00
obj = { windowSize: obj, isElementFullscreen: isElementFullscreen.isElementFullscreen, focused, visible: isElementFullscreen.visible };
2026-07-20 16:05:17 +00:00
obj = { width: isElementFullscreen.width, height: isElementFullscreen.height };
const result = map.set(isElementFullscreen.windowId, obj);
if (focused) {
const windowId = isElementFullscreen.windowId;
}
return true;
},
WINDOW_FULLSCREEN_CHANGE: function handleWindowFullscreenChange(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
let obj = map;
let value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
let flag = value.isElementFullscreen !== windowId.isElementFullscreen;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(value);
obj.isElementFullscreen = windowId.isElementFullscreen;
const result = obj.set(windowId.windowId, obj);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
WINDOW_FOCUS: function handleWindowFocus(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
let obj = map;
let value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
let flag = value.focused !== windowId.focused;
2026-07-20 16:05:17 +00:00
if (flag) {
if (windowId.focused) {
windowId = windowId.windowId;
}
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(value);
obj.focused = windowId.focused;
const result = obj.set(windowId.windowId, obj);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
},
WINDOW_RESIZED: function handleWindowResize(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
let obj = map;
let value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
let flag = value.windowSize.width !== windowId.width || value.windowSize.height !== windowId.height;
2026-07-20 16:05:17 +00:00
if (flag) {
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(value);
({ width: obj4[0], height: obj4[1] } = windowId);
obj.windowSize = { width: null, height: null };
const result = obj.set(windowId.windowId, obj);
2026-07-20 16:05:17 +00:00
flag = true;
2026-08-24 06:08:38 +00:00
obj1 = { width: null, height: null };
2026-07-20 16:05:17 +00:00
}
return flag;
},
WINDOW_UNLOAD: function handleWindowUnload(windowId) {
set.add(windowId.windowId);
map.delete(windowId.windowId);
2026-07-29 08:29:29 +00:00
if (c3 === windowId.windowId) {
c3 = null;
2026-07-20 16:05:17 +00:00
}
return true;
},
WINDOW_VISIBILITY_CHANGE: function handleWindowVisibilityChange(windowId) {
2026-07-29 08:29:29 +00:00
windowId = windowId.windowId;
let obj = map;
let value = map.get(windowId);
if (null == value) {
const hasItem = set.has(windowId);
obj = { isElementFullscreen: false, focused: false, windowSize: null, visible: false };
obj[2] = { width: 0, height: 0 };
value = obj;
}
let flag = value.visible !== windowId.visible;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(value);
obj.visible = windowId.visible;
const result = obj.set(windowId.windowId, obj);
2026-07-20 16:05:17 +00:00
flag = true;
}
return flag;
}
});
2026-07-29 08:29:29 +00:00
require("expandEventProperties").then((addExtraAnalyticsDecorator) => {
2026-07-20 16:05:17 +00:00
const result = addExtraAnalyticsDecorator.addExtraAnalyticsDecorator(() => {
});
});
2026-07-23 10:11:24 +00:00
let result = set.fileFinishedImporting("stores/web/WindowStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default windowStore;