// Module ID: 9601 // Function ID: 9602 // Name: FramesStore // Dependencies: [9602, 9596, 1085, 9603, 504, 573, 2] // Module 9601 (FramesStore) import initializeDefault from "initialize" /* 504 */; import DispatcherDefault from "Dispatcher" /* 573 */; import Constants from "Constants" /* 1085 */; import ActivityPanelConstants from "ActivityPanelConstants" /* 9596 */; import getURLForApplicationDefault from "getURLForApplication" /* 9603 */; import FramesConstants from "FramesConstants" /* 9602 */; import size from "module_2" /* 2 */; ({ FrameIntent: c2, FrameLayoutModes: c3, getChannelIdForSurface: closure_4, getFrameIntentForSurface: hasOwnProperty, isLaunched: metroRequire, makeFrameId: closure_7 } = FramesConstants); const ActivityPanelModes = ActivityPanelConstants.ActivityPanelModes; const NOOP_TRUE = Constants.NOOP_TRUE; const map = new Map(); let frameId = null; const Store = initializeDefault.Store; class FramesStoreClass extends Store { } const prototype = FramesStoreClass.prototype; prototype["getFrame"] = function getFrame(frameId) { if (null != frameId) { return map.get(frameId); } }; prototype["getMainFrame"] = function getMainFrame() { let tmp = null; if (null != frameId) { value = map.get(frameId); if (value == null) { value = null; } tmp = value; } return tmp; }; prototype["getAllFrames"] = function getAllFrames() { return Array.from(map.values()); }; prototype["getFrameByIframeId"] = function getFrameByIframeId(iframeId) { const values = map.values(); for (const item10009 of values) { let tmp2 = item10009; if (timestampProducer(item10009)) { if (tmp2.data.iframeId === arg0) { obj.return(); return item10009; } } continue; } }; prototype["getFrameBySurface"] = function getFrameBySurface(arg0, arg1) { return map.get(React5(arg0, arg1)); }; prototype["getFramesForSurface"] = function getFramesForSurface(arg0) { closure_0 = arg0; return Array.from(map.values()).filter((applicationId) => React5(applicationId.applicationId, closure_0) === applicationId.id); }; prototype["getFramesForChannel"] = function getFramesForChannel(id) { closure_0 = id; return Array.from(map.values()).filter((surface) => React4(surface.surface) === closure_0); }; FramesStoreClass.displayName = "FramesStore"; const framesStoreClass = new FramesStoreClass(DispatcherDefault, { FRAME_LAUNCH_START: function handleFrameLaunchStart(applicationId) { ({ frameId, surface } = applicationId); const tmp = hasOwnProperty(surface); const result = map.set(frameId, { id: frameId, applicationId: applicationId.applicationId, intent: tmp, surface, state: "loading", data: null }); }, FRAME_LAUNCH: function handleFrameLaunch(arg0) { ({ frameId, hostWindowKey } = arg0); ({ proxyTicket, customId, referrerId } = arg0); value = map.get(frameId); if (null != value) { const tmp8 = getURLForApplicationDefault(value.applicationId); if (null == tmp8) { obj.delete(frameId); if (frameId === frameId) { frameId = null; } } else { const obj2 = {}; const merged = Object.assign(value); obj2.state = "launched"; const obj3 = { url: tmp8, connectedSince: null, layoutMode: null, activityPanelMode: null, proxyTicket: null, proxyTicketRefreshing: false, orientationLock: null, pipOrientationLock: null, prefersPictureInPictureOnNavigateAway: false, iframeId: null, hostWindowKey: null, customId: null, referrerId: null }; const _Date = Date; obj3.connectedSince = Date.now(); obj3.layoutMode = constants2.FOCUSED; obj3.activityPanelMode = ActivityPanelModes.PANEL; obj3.proxyTicket = proxyTicket; if (hostWindowKey == null) { hostWindowKey = null; } obj3.hostWindowKey = hostWindowKey; obj3.customId = customId; obj3.referrerId = referrerId; obj2.data = obj3; const result = obj.set(frameId, obj2); } } }, FRAME_LAUNCH_FAIL: function handleFrameLaunchFail(frameId) { frameId = frameId.frameId; map.delete(frameId); if (frameId === frameId) { frameId = null; } }, FRAME_STOP: function handleFrameStop(frameId) { frameId = frameId.frameId; map.delete(frameId); if (frameId === frameId) { frameId = null; } }, FRAME_CLEAR_MAIN_SLOT: function handleFrameClearMainSlot(frameId) { if (frameId !== frameId.frameId) { return false; } else { frameId = null; } }, FRAME_PROMOTE: function handleFramePromote(frameId) { frameId = frameId.frameId; if (null == map.get(frameId)) { return false; } }, FRAME_UPDATE_LAYOUT_MODE: function handleFrameUpdateLayoutMode(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.layoutMode = tmp; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; }, FRAME_SET_PANEL_MODE: function handleSetPanelMode(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.activityPanelMode = tmp; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; }, FRAME_SET_ORIENTATION_LOCK_STATE: function handleOrientationLockState(arg0) { ({ frameId, lockState, pictureInPictureLockState } = arg0); let flag = false; if (null != frameId) { value = map.get(frameId); let tmp4 = timestampProducer(value); if (tmp4) { let flag2 = tmp(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const data = value.data; const obj3 = {}; const merged1 = Object.assign(data); if (lockState == null) { lockState = null; } obj3.orientationLock = lockState; if (undefined === pictureInPictureLockState) { pictureInPictureLockState = data.pipOrientationLock; } obj3.pipOrientationLock = pictureInPictureLockState; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp4 = flag2; } flag = tmp4; obj = map; } return flag; }, FRAME_SET_PREFERS_PICTURE_IN_PICTURE_ON_NAVIGATE_AWAY: function handleSetPrefersPictureInPictureOnNavigateAway(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.prefersPictureInPictureOnNavigateAway = tmp; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; }, FRAME_SET_PROXY_TICKET_REFRESHING: function handleSetProxyTicketRefreshing(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.proxyTicketRefreshing = tmp; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; }, FRAME_UPDATE_PROXY_TICKET: function handleUpdateProxyTicket(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.proxyTicket = tmp; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; }, FRAME_IFRAME_MOUNT: function handleFrameIframeMount(arg0) { ({ frameId, iframeId } = arg0); let flag = false; if (null != frameId) { value = map.get(frameId); let tmp4 = timestampProducer(value); if (tmp4) { let flag2 = tmp(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const data = value.data; const obj3 = {}; const merged1 = Object.assign(data); obj3.iframeId = iframeId; obj3.prefersPictureInPictureOnNavigateAway = data.iframeId === iframeId && data.prefersPictureInPictureOnNavigateAway; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp4 = flag2; } flag = tmp4; obj = map; } return flag; }, FRAME_IFRAME_UNMOUNT: function handleFrameIframeUnmount(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp4 = timestampProducer(value); if (tmp4) { let flag2 = value.data.iframeId === tmp; if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.iframeId = null; obj3.prefersPictureInPictureOnNavigateAway = false; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp4 = flag2; } flag = tmp4; obj = map; } return flag; }, FRAME_HOST_WINDOW_MOUNT: function handleFrameHostWindowMount(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.hostWindowKey = tmp; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; }, FRAME_HOST_WINDOW_UNMOUNT: function handleFrameHostWindowUnmount(frameId) { frameId = frameId.frameId; let flag = false; if (null != frameId) { value = map.get(frameId); let tmp4 = timestampProducer(value); if (tmp4) { let flag2 = value.data.hostWindowKey === tmp; if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.hostWindowKey = null; obj2.data = obj3; const result = obj.set(frameId, obj2); flag2 = true; } tmp4 = flag2; } flag = tmp4; obj = map; } return flag; }, CHANNEL_SELECT: function handleChannelSelect() { let flag = false; if (null != frameId) { value = map.get(tmp); let tmp5 = timestampProducer(value); if (tmp5) { let flag2 = tmp2(value.data); if (flag2) { const obj2 = {}; const merged = Object.assign(value); const obj3 = {}; const merged1 = Object.assign(value.data); obj3.layoutMode = constants2.PIP; obj2.data = obj3; const result = obj.set(tmp, obj2); flag2 = true; } tmp5 = flag2; } flag = tmp5; obj = map; } return flag; } }); let result = size.fileFinishedImporting("modules/frames/FramesStore.tsx"); export default framesStoreClass;