decord/source/modules/routing/native/RouteManagerUtils.tsx

430 lines
16 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11048
// Function ID: 11049
2026-07-29 08:29:29 +00:00
// Name: voiceRouteRewriter
2026-08-25 06:04:03 +00:00
// Dependencies: [109, 9895, 1395, 1391, 4206, 1982, 1981, 676, 9896, 3, 4220, 11049, 5236, 1222, 11054, 4611, 4615, 5338, 10856, 4234, 709, 4609, 4311, 11055, 2]
2026-07-29 08:29:29 +00:00
// Exports: cleanupRouteManager, extractParamsFromVoiceModalRoute, initializeRouteManagerIfNeeded, popVoiceRoute, transitionToVoiceRoute
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 11048 (voiceRouteRewriter)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import transitionTo from "transitionTo" /* 1222 */;
2026-08-25 06:04:03 +00:00
import GuildThemeSourcePreference from "GuildThemeSourcePreference" /* 4311 */;
import _modDef4609 from "module_4609" /* 4609 */;
import _modDef4611 from "module_4611" /* 4611 */;
import _modDef5236 from "module_5236" /* 5236 */;
import showTooManyUserGuildsAlertDefault from "showTooManyUserGuildsAlert" /* 5338 */;
import MemoryRouter from "MemoryRouter" /* 11049 */;
import saveLastRoute from "saveLastRoute" /* 11054 */;
import initializeDefault from "initialize" /* 11055 */;
2026-08-24 06:08:38 +00:00
import closure_4 from "_objectWithoutProperties" /* 109 */;
2026-08-25 06:04:03 +00:00
import { setVoiceChatDrawerState } from "VoiceChatDrawerState" /* 9895 */;
2026-08-24 06:08:38 +00:00
import { isGuildSelectableChannelType as closure_6 } from "createChannelRecord" /* 1395 */;
import closure_7 from "ensureGuildLoaded" /* 1391 */;
2026-08-25 06:04:03 +00:00
import closure_8 from "initialize" /* 4206 */;
import closure_9 from "comparator" /* 1982 */;
import closure_10 from "handleConnectionOpen" /* 1981 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import { VoiceChatDrawerState } from "BOX_MODE_ACTIONSHEET_WIDTH" /* 9896 */;
import { RouteParam, RouteParam as RouteParam2, RouteParam as RouteParam3, RouteParam as RouteParam4 } from "RouteParam" /* 4220 */;
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
function voiceRouteRewriter(pathname) {
let obj = { match: null, location: null };
({ state, pathname } = pathname);
2026-08-24 06:08:38 +00:00
obj1 = MemoryRouter;
2026-07-29 08:29:29 +00:00
obj = { path: items, strict: false, exact: false };
obj[0] = obj1.matchPath(pathname, obj);
obj[1] = pathname;
2026-07-20 16:05:17 +00:00
const tmp = extractParams(obj);
({ channelId, guildId } = tmp);
const tmp2 = callback(tmp, closure_3);
const channel = store.getChannel(channelId);
let tmp4 = null;
if (null != channelId) {
tmp4 = null;
if (null != guildId) {
let type;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type = channel.type;
}
if (type === ChannelTypes.GUILD_VOICE) {
obj = {};
const merged = Object.assign(tmp2);
2026-07-29 08:29:29 +00:00
obj.channelId = channelId;
obj.guildId = guildId;
2026-07-20 16:05:17 +00:00
tmp4 = obj;
} else {
let type1;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type1 = channel.type;
}
tmp4 = null;
}
}
}
if (null != tmp4) {
2026-07-29 08:29:29 +00:00
if (closure_15 != null) {
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj5.log("voiceRouteRewriter: has voiceChannelParams = " + JSON.stringify(tmp4));
2026-07-20 16:05:17 +00:00
}
const _HermesInternal2 = HermesInternal;
2026-08-24 06:08:38 +00:00
const combined = "" + closure_8.lastNonVoiceRoute + Routes.VOICE_CHAT_CHANNEL_PARTIAL(tmp4.guildId, tmp4.channelId, tmp4.messageId);
2026-07-29 08:29:29 +00:00
let tmp17 = null;
if (combined !== pathname.pathname) {
if (obj5 != null) {
2026-07-20 16:05:17 +00:00
const _HermesInternal3 = HermesInternal;
2026-07-29 08:29:29 +00:00
obj5.log("voiceRouteRewriter: rewriting route: " + pathname.pathname + " -> " + combined);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1 = { path: null, state: null };
obj1[0] = combined;
obj1[1] = state;
tmp17 = obj1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp17;
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}
function saveLastRouteListener(pathname) {
2026-08-24 06:08:38 +00:00
saveLastRoute.saveLastRoute(pathname.pathname);
2026-07-20 16:05:17 +00:00
}
function saveLastNonVoiceRouteListener(pathname) {
2026-08-24 06:08:38 +00:00
let obj = MemoryRouter;
2026-07-29 08:29:29 +00:00
obj = { path: items, strict: false, exact: false };
const matchPathResult = obj.matchPath(pathname.pathname, obj);
2026-07-20 16:05:17 +00:00
let channelId;
2026-07-29 08:29:29 +00:00
if (matchPathResult != null) {
channelId = matchPathResult.params.channelId;
2026-07-20 16:05:17 +00:00
}
const channel = store.getChannel(channelId);
let type;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type = channel.type;
}
2026-07-29 08:29:29 +00:00
let tmp9 = null;
2026-07-20 16:05:17 +00:00
if (type !== ChannelTypes.GUILD_VOICE) {
let type1;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
type1 = channel.type;
}
2026-07-29 08:29:29 +00:00
tmp9 = null;
if (type1 !== tmp8.GUILD_STAGE_VOICE) {
obj = { match: null, location: null };
obj[0] = matchPathResult;
obj[1] = pathname;
tmp9 = extractParams(obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (null != tmp9) {
2026-08-24 06:08:38 +00:00
const result = saveLastRoute.saveLastNonVoiceRoute(Routes.CHANNEL(tmp9.guildId, tmp9.channelId));
const tmpResult = saveLastRoute;
2026-07-20 16:05:17 +00:00
}
}
function updateSelectedChannelListener(location) {
2026-08-25 06:04:03 +00:00
let obj = channel2(11049);
2026-07-29 08:29:29 +00:00
obj = { path: items, strict: false, exact: false };
const matchPathResult = obj.matchPath(location.pathname, obj);
let params;
if (matchPathResult != null) {
params = matchPathResult.params;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (params == null) {
params = {};
}
obj = {};
({ voiceChannelId, voiceGuildId, voiceMessageId } = params);
const merged = Object.assign(extractParams({ match: matchPathResult, location }));
obj.voiceChannelId = voiceChannelId;
obj.voiceGuildId = voiceGuildId;
obj.voiceMessageId = voiceMessageId;
({ guildId, channelId, messageId, jumpType, voiceChannelId: voiceChannelId2, voiceGuildId: voiceGuildId2, voiceMessageId: voiceMessageId2 } = obj);
if (null == voiceChannelId2) {
if (null == voiceGuildId2) {
if (closure_15 != null) {
2026-07-20 16:05:17 +00:00
const _JSON5 = JSON;
const json = JSON.stringify(location);
const _JSON6 = JSON;
2026-07-29 08:29:29 +00:00
const obj2 = { guildId: null, channelId: null, messageId: null, jumpType: null, voiceChannelId: null, voiceGuildId: null, voiceMessageId: null };
obj2[0] = guildId;
obj2[1] = channelId;
obj2[2] = messageId;
obj2[3] = jumpType;
obj2[4] = voiceChannelId2;
obj2[5] = voiceGuildId2;
obj2[6] = voiceMessageId2;
2026-07-20 16:05:17 +00:00
const _HermesInternal3 = HermesInternal;
2026-07-29 08:29:29 +00:00
obj19.verbose("UpdateSelectedChannelListener -> no voice route present in " + json + " " + JSON.stringify(obj2) + " ");
2026-07-20 16:05:17 +00:00
}
const channel = store.getChannel(store2.getLastSelectedChannelId());
2026-07-29 08:29:29 +00:00
let isGuildVoiceResult;
if (channel != null) {
isGuildVoiceResult = channel.isGuildVoice();
}
if (!isGuildVoiceResult) {
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
isGuildVoiceResult = isGuildStageVoiceResult;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isGuildVoiceResult) {
2026-08-25 06:04:03 +00:00
let tmpResult = tmp(4615);
_modDef4611.popWithKey(tmpResult.getVoiceChannelKey(channel.id));
const obj21 = _modDef4611;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const guild = showTooManyUserGuildsAlertDefault.selectGuild(guildId);
2026-07-29 08:29:29 +00:00
obj19 = closure_15;
2026-08-24 06:08:38 +00:00
const obj23 = showTooManyUserGuildsAlertDefault;
2026-07-29 08:29:29 +00:00
const obj3 = { guildId: null, channelId: null, messageId: null, jumpType: null, skipMessageFetch: null };
obj3[0] = guildId;
obj3[1] = channelId;
obj3[2] = messageId;
obj3[3] = jumpType;
obj3[4] = tmp5;
2026-08-25 06:04:03 +00:00
const channel1 = _modDef5236.selectChannel(obj3);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
channel2 = store.getChannel(voiceChannelId2);
2026-07-20 16:05:17 +00:00
let type;
2026-07-29 08:29:29 +00:00
if (channel2 != null) {
2026-07-20 16:05:17 +00:00
type = channel2.type;
}
if (type !== ChannelTypes.GUILD_VOICE) {
let type1;
2026-07-29 08:29:29 +00:00
if (channel2 != null) {
2026-07-20 16:05:17 +00:00
type1 = channel2.type;
}
2026-07-29 08:29:29 +00:00
if (type1 !== tmp7.GUILD_STAGE_VOICE) {
if (closure_15 != null) {
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (channel2 != null) {
2026-07-20 16:05:17 +00:00
id = channel2.id;
}
const _JSON = JSON;
const _JSON2 = JSON;
2026-07-29 08:29:29 +00:00
const obj4 = { guildId: null, channelId: null, messageId: null, jumpType: null, voiceChannelId: null, voiceGuildId: null, voiceMessageId: null };
obj4[0] = guildId;
obj4[1] = channelId;
obj4[2] = messageId;
obj4[3] = jumpType;
obj4[4] = voiceChannelId2;
obj4[5] = voiceGuildId2;
obj4[6] = voiceMessageId2;
2026-07-20 16:05:17 +00:00
const json1 = JSON.stringify(location);
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj26.log("UpdateSelectedChannelListener -> !!!VERY BAD!!! channel.id " + id + " (voiceChannelId " + voiceChannelId2 + ") is not a voice channel! and yet RouteUtils thinks it is! " + json1 + " " + JSON.stringify(obj4) + " ");
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj26 = closure_15;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (closure_15 != null) {
2026-07-20 16:05:17 +00:00
const _JSON3 = JSON;
const json2 = JSON.stringify(location);
const _JSON4 = JSON;
2026-07-29 08:29:29 +00:00
const obj5 = { guildId: null, channelId: null, messageId: null, jumpType: null, voiceChannelId: null, voiceGuildId: null, voiceMessageId: null };
obj5[0] = guildId;
obj5[1] = channelId;
obj5[2] = messageId;
obj5[3] = jumpType;
obj5[4] = voiceChannelId2;
obj5[5] = voiceGuildId2;
obj5[6] = voiceMessageId2;
2026-07-20 16:05:17 +00:00
const _HermesInternal2 = HermesInternal;
2026-07-29 08:29:29 +00:00
obj8.verbose("UpdateSelectedChannelListener -> voice route present! " + json2 + " " + JSON.stringify(obj5) + " ");
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmpResult = tmp(10856);
2026-07-29 08:29:29 +00:00
if (!tmpResult.isVoicePanelEnabled(channel2)) {
2026-08-24 06:08:38 +00:00
const guild1 = showTooManyUserGuildsAlertDefault.selectGuild(voiceGuildId2);
const obj10 = showTooManyUserGuildsAlertDefault;
2026-07-29 08:29:29 +00:00
const obj6 = { guildId: null, channelId: null, messageId: null, jumpType: null };
obj6[0] = voiceGuildId2;
obj6[1] = voiceChannelId2;
obj6[2] = voiceMessageId2;
obj6[3] = jumpType;
2026-08-25 06:04:03 +00:00
const channel3 = _modDef5236.selectChannel(obj6);
const obj11 = _modDef5236;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj1 = { match: matchPathResult, location };
2026-07-29 08:29:29 +00:00
obj8 = closure_15;
2026-08-25 06:04:03 +00:00
const tmpResult1 = channel2(4234);
2026-07-29 08:29:29 +00:00
if (!tmpResult1.isModalOpen(tmpResult2.getVoiceChannelKey(channel2.id))) {
2026-08-25 06:04:03 +00:00
const obj15 = _modDef4611;
obj15.popAboveKey(tmp(4615).getVoiceChannelKey(channel2.id));
const tmpResult3 = tmp(4615);
2026-08-24 06:08:38 +00:00
dispatcherDefault.wait(() => {
channel2(closure_1_2[16]).openGuildVoiceModal(channel2);
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
const obj17 = dispatcherDefault;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmpResult2 = channel2(4615);
2026-07-29 08:29:29 +00:00
if (tmp21) {
2026-07-20 16:05:17 +00:00
setVoiceChatDrawerState(channel2.id, VoiceChatDrawerState.OPEN);
2026-07-29 08:29:29 +00:00
if (tmp25) {
2026-08-25 06:04:03 +00:00
const obj18 = _modDef4609;
2026-07-29 08:29:29 +00:00
const result = obj18.jumpToVoiceChannelMessage(voiceGuildId2, voiceChannelId2, voiceMessageId2, jumpType);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp25 = null != voiceGuildId2 && null != voiceChannelId2 && null != voiceMessageId2;
2026-07-20 16:05:17 +00:00
}
}
function extractParams(arg0) {
({ match, location: _location } = arg0);
if (null == match) {
2026-07-29 08:29:29 +00:00
let obj = { guildId: null, channelId: null, messageId: null, jumpType: null, skipMessageFetch: false };
obj[0] = closure_11;
2026-08-24 06:08:38 +00:00
obj[3] = GuildThemeSourcePreference.JumpType.ANIMATED;
2026-07-20 16:05:17 +00:00
return obj;
} else {
const params = match.params;
({ guildId, channelId } = params);
2026-08-24 06:08:38 +00:00
if (_location.jumpType === GuildThemeSourcePreference.JumpType.INSTANT) {
2026-08-25 06:04:03 +00:00
let ANIMATED = tmp5(4311).JumpType.INSTANT;
2026-07-20 16:05:17 +00:00
} else {
2026-08-25 06:04:03 +00:00
ANIMATED = tmp5(4311).JumpType.ANIMATED;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
let tmp5Result = tmp5(4220);
2026-07-29 08:29:29 +00:00
if (!tmp5Result.isValidGuildId(guildId)) {
2026-07-20 16:05:17 +00:00
guildId = closure_11;
}
2026-07-29 08:29:29 +00:00
obj = { guildId: null, channelId: null, messageId: null, jumpType: null, skipMessageFetch: null };
obj[0] = guildId;
2026-08-25 06:04:03 +00:00
tmp5Result = tmp5(4220);
2026-07-29 08:29:29 +00:00
let tmp = null;
if (tmp5Result.isValidChannelId(channelId)) {
tmp = channelId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = tmp;
obj[2] = params.messageId;
obj[3] = ANIMATED;
obj[4] = _location.skipMessageFetch;
2026-07-20 16:05:17 +00:00
return obj;
}
}
function logRouteChange(pathname) {
2026-08-24 06:08:38 +00:00
logger.log("Navigated to: " + pathname.pathname);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let closure_3 = ["channelId", "guildId"];
2026-07-29 08:29:29 +00:00
({ ME: unpackModuleId, Routes } = ME);
2026-07-23 10:11:24 +00:00
const ChannelTypes = ME.ChannelTypes;
2026-08-24 06:08:38 +00:00
let closure_15 = new timestampDefault("RouteUtils");
2026-07-23 10:11:24 +00:00
let c16 = false;
2026-08-24 06:08:38 +00:00
const tmp3 = new timestampDefault("RouteUtils");
2026-07-20 16:05:17 +00:00
const CHANNELResult = Routes.CHANNEL(RouteParam.guildId(), RouteParam2.channelId({ optional: true }), ":messageId?");
const guildIdResult = RouteParam.guildId();
const items = ["" + CHANNELResult + Routes.VOICE_CHAT_CHANNEL_PARTIAL(RouteParam3.guildId({ name: "voiceGuildId" }), RouteParam4.channelId({ name: "voiceChannelId" }), ":voiceMessageId?"), CHANNELResult];
const guildIdResult1 = RouteParam3.guildId({ name: "voiceGuildId" });
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/routing/native/RouteManagerUtils.tsx");
2026-07-20 16:05:17 +00:00
export const MAIN_DRAWER_ROUTES = CHANNELResult;
2026-07-29 08:29:29 +00:00
export const extractParamsFromVoiceModalRoute = function extractParamsFromVoiceModalRoute(location) {
2026-08-24 06:08:38 +00:00
let obj = MemoryRouter;
2026-07-29 08:29:29 +00:00
obj = { path: items, strict: false, exact: false };
const matchPathResult = obj.matchPath(location.pathname, obj);
let params;
if (matchPathResult != null) {
params = matchPathResult.params;
}
if (params == null) {
params = {};
}
obj = {};
({ voiceChannelId, voiceGuildId, voiceMessageId } = params);
const merged = Object.assign(extractParams({ match: matchPathResult, location }));
obj.voiceChannelId = voiceChannelId;
obj.voiceGuildId = voiceGuildId;
obj.voiceMessageId = voiceMessageId;
return obj;
};
2026-07-20 16:05:17 +00:00
export const popVoiceRoute = function popVoiceRoute(guildId) {
2026-08-24 06:08:38 +00:00
const lastNonVoiceRoute = closure_8.lastNonVoiceRoute;
logger.log("popVoiceRoute: last non-voice route is " + lastNonVoiceRoute);
2026-08-25 06:04:03 +00:00
let obj = _modDef5236;
2026-07-29 08:29:29 +00:00
obj = { guildId, channelId: null };
const channel = store.getChannel(store2.getLastSelectedChannelId());
let type;
if (channel != null) {
type = channel.type;
}
if (null != type) {
let type1;
if (channel != null) {
type1 = channel.type;
}
if (closure_6(type1)) {
let id = channel.id;
}
obj[1] = id;
const channel1 = obj.selectChannel(obj);
2026-08-24 06:08:38 +00:00
transitionTo.transitionTo(lastNonVoiceRoute);
2026-07-29 08:29:29 +00:00
}
id = store2.getMostRecentSelectedTextChannelId(guildId);
if (id == null) {
defaultChannel = defaultChannel.getDefaultChannel(guildId);
id = undefined;
if (defaultChannel != null) {
id = defaultChannel.id;
}
}
2026-07-20 16:05:17 +00:00
};
export const transitionToVoiceRoute = function transitionToVoiceRoute(arg0, arg1) {
2026-08-24 06:08:38 +00:00
const defaultRoute = closure_8.defaultRoute;
let obj = MemoryRouter;
2026-07-29 08:29:29 +00:00
obj = { path: items, strict: false, exact: false };
const matchPathResult = obj.matchPath(defaultRoute, obj);
2026-07-20 16:05:17 +00:00
let params;
2026-07-29 08:29:29 +00:00
if (matchPathResult != null) {
params = matchPathResult.params;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (params == null) {
2026-07-20 16:05:17 +00:00
params = {};
}
const voiceChannelId = params.voiceChannelId;
2026-08-24 06:08:38 +00:00
logger.log("transitionToVoiceRoute(<" + arg0 + ">, <" + arg1 + ">), current route " + defaultRoute + " has voiceChannelId " + voiceChannelId);
2026-07-20 16:05:17 +00:00
if (voiceChannelId !== arg1) {
2026-08-24 06:08:38 +00:00
transitionTo.transitionToGuild(arg0, arg1);
const tmpResult = transitionTo;
2026-07-20 16:05:17 +00:00
} else {
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
logger.log("transitionToVoiceRoute -> " + voiceChannelId + " === " + arg1 + ". staying where we are");
2026-07-20 16:05:17 +00:00
}
};
export { voiceRouteRewriter };
export { saveLastRouteListener };
export { saveLastNonVoiceRouteListener };
export { updateSelectedChannelListener };
export { extractParams };
export const initializeRouteManagerIfNeeded = function initializeRouteManagerIfNeeded() {
2026-07-23 10:11:24 +00:00
if (!c16) {
2026-08-24 06:08:38 +00:00
initializeDefault.addRouteRewriter(voiceRouteRewriter);
const obj = initializeDefault;
const result = initializeDefault.addRouteChangeListener(saveLastRouteListener);
const obj2 = initializeDefault;
const result1 = initializeDefault.addRouteChangeListener(saveLastNonVoiceRouteListener);
const obj3 = initializeDefault;
const result2 = initializeDefault.addRouteChangeListener(updateSelectedChannelListener);
const obj4 = initializeDefault;
const result3 = initializeDefault.addRouteChangeListener(logRouteChange);
const obj5 = initializeDefault;
initializeDefault.initialize();
2026-07-23 10:11:24 +00:00
c16 = true;
2026-08-24 06:08:38 +00:00
const obj6 = initializeDefault;
2026-07-20 16:05:17 +00:00
}
};
export const cleanupRouteManager = function cleanupRouteManager() {
2026-07-23 10:11:24 +00:00
if (c16) {
2026-08-24 06:08:38 +00:00
initializeDefault.removeRouteRewriter(voiceRouteRewriter);
const obj = initializeDefault;
const result = initializeDefault.removeRouteChangeListener(saveLastRouteListener);
const obj2 = initializeDefault;
const result1 = initializeDefault.removeRouteChangeListener(saveLastNonVoiceRouteListener);
const obj3 = initializeDefault;
const result2 = initializeDefault.removeRouteChangeListener(updateSelectedChannelListener);
const obj4 = initializeDefault;
const result3 = initializeDefault.removeRouteChangeListener(logRouteChange);
const obj5 = initializeDefault;
initializeDefault.cleanup();
2026-07-23 10:11:24 +00:00
c16 = false;
2026-08-24 06:08:38 +00:00
const obj6 = initializeDefault;
2026-07-20 16:05:17 +00:00
}
};