Files
discord-decomp/sources/stores/DeveloperOptionsStore.tsx
T
2026-07-28 01:06:53 +03:00

321 lines
19 KiB
TypeScript

/* Metro module 691; source: stores/DeveloperOptionsStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 561, 672, 507, 692, 693, 587, 1216, 566, 694, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Backoff from '../external/discord_common/js/packages/backoff/Backoff.tsx'; /* Metro dependency 561 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as HTTPUtilsModule from '../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
import * as StorageModule from '../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
function _fun8402(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#8402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:6, offset: 0x00d3fc63, size: 583 bytes, params: 8, frame: 26
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_10 = '' + global.location.protocol + '//' + global.location.host + '/__development/source_maps';
let value = Backoff;
let Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const SECOND = Millis.SECOND;
const value2 = 5 * SECOND;
Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const MINUTE = Millis.MINUTE;
value = new value(value2, 1 * MINUTE, true);
object = {set: set_8411};
copyDataProperties({}, {'trace': false, 'canary': false, 'logGatewayEvents': false, 'logOverlayEvents': false,
'logAnalyticsEvents': false, 'sourceMapsEnabled': false, 'axeEnabled': false, 'cssDebuggingEnabled': false,
'layoutDebuggingEnabled': false, 'bugReporterEnabled': true, 'idleStatusIndicatorEnabled': false,
'onlyShowPreviewAppCollections': false, 'disableAppCollectionsCache': false,
'isStreamInfoOverlayEnabled': false, 'preventPopoutClose': false, 'logKeyboardMismatches': false,
'alertStartupMetrics': false, 'logQuestEvents': false}, true);
const env0_19 = [];
const Store = (Flux).Store;
_fun8412(Store).displayName = 'DeveloperOptionsStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {LOGOUT: LOGOUT,
CONNECTION_OPEN: CONNECTION_OPEN, DEVELOPER_OPTIONS_UPDATE_SETTINGS: function({settings}) {
setOptions(settings);
}, DEVELOPER_OPTIONS_SET_ROUTING_KEY: function({tags}) {
setRoutingKeyTags(tags);
}});
(FileImportTrackerModule).fileFinishedImporting('stores/DeveloperOptionsStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_8403() { // fn#8403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:168, offset: 0x00d3feaa, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_8403_isNativeReflectConstruct = function() {
return !!result;
})();
}
function setOptions(a0) { // fn#8406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:1559, offset: 0x00d3ff08, size: 114 bytes, params: 2, frame: 14
var object3;
const object = {};
copyDataProperties(object, env0_16, undefined);
copyDataProperties(object, object3, undefined);
copyDataProperties(object, a0, undefined);
object3 = object;
const binding = env0_14;
binding.set(object.sourceMapsEnabled);
const Storage = (StorageModule).Storage;
Storage.set(env0_15, object3);
}
function setRoutingKeyTags(a0) { // fn#8407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:1654, offset: 0x00d3ff7a, size: 59 bytes, params: 2, frame: 14
env0_19 = a0;
const Storage = (StorageModule).Storage;
Storage.set(env0_18, env0_19);
}
function y() { // fn#8408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:521, offset: 0x00d3ffb5, size: 125 bytes, params: 1, frame: 18
const HTTP = (HTTPUtilsModule).HTTP;
const put = HTTP.put;
const object = {url: env0_10};
const object2 = {};
object2.Authorization = (importAll(692) /* metro dependency 692: TokenManager */).getToken();
object.headers = object2;
object.oldFormErrors = true;
object.rejectWithError = true;
Reflect.apply(put, HTTP, [object]).then(_fun8409, _fun8410);
function _fun8409(a0) { // fn#8409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:637, offset: 0x00d40032, size: 253 bytes, params: 2, frame: 16
var value;
var setTimeout;
if (a0.status === 401) {
value = environment.__proto__;
value = require(693) /* metro dependency 693: DeveloperOptionsActionCreators */;
value.setDeveloperOptionSettings({sourceMapsEnabled: false});
} else if (a0.status === 403) {
value = environment.__proto__;
value = require(693) /* metro dependency 693: DeveloperOptionsActionCreators */;
value.setDeveloperOptionSettings({sourceMapsEnabled: false});
} else if (a0.status !== 200) {
setTimeout = global.setTimeout;
value = environment.__proto__;
env1_11 = setTimeout(y, env1_12.fail());
} else {
value = environment.__proto__;
env1_12.succeed();
env1_11 = global.setTimeout(y,
a0.body.sourceMapCookieTTLSeconds * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND * 0.75);
}
}
function _fun8410() { // fn#8410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:873, offset: 0x00d4012f, size: 43 bytes, params: 1, frame: 14
env1_11 = global.setTimeout(y, env1_12.fail());
}
}
function set_8411(a0) { // fn#8411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:912, offset: 0x00d4015a, size: 174 bytes, params: 2, frame: 19
var HTTP;
var del;
var object;
var object2;
if (a0 !== (env0_11 != null)) {
if (a0) {
env0_11 = global.setTimeout(y, 0);
} else {
global.clearTimeout(env0_11);
HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
del = HTTP.del;
object = {url: env0_10};
object2 = {};
object2.Authorization = (importAll(692) /* metro dependency 692: TokenManager */).getToken();
object.headers = object2;
object.oldFormErrors = true;
object.rejectWithError = true;
Reflect.apply(del, HTTP, [object]);
}
}
}
function _fun8412(a0) { // fn#8412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:1720, offset: 0x00d40208, size: 561 bytes, params: 2, frame: 16
const DeveloperOptionsStore2 = DeveloperOptionsStore;
Inherits(DeveloperOptionsStore2, a0);
return CreateClass(DeveloperOptionsStore2, [{key: 'initialize', value: value_8414}, {key: 'isTracingRequests',
get: get_8415}, {key: 'isForcedCanary', get: get_8416}, {key: 'isLoggingGatewayEvents', get: get_8417},
{key: 'isLoggingOverlayEvents', get: get_8418}, {key: 'isLoggingAnalyticsEvents', get: get_8419},
{key: 'isAxeEnabled', get: get_8420}, {key: 'cssDebuggingEnabled', get: get_8421},
{key: 'layoutDebuggingEnabled', get: get_8422}, {key: 'sourceMapsEnabled', get: get_8423},
{key: 'isBugReporterEnabled', get: get_8424}, {key: 'isIdleStatusIndicatorEnabled', get: get_8425},
{key: 'onlyShowPreviewAppCollections', get: get_8426}, {key: 'disableAppCollectionsCache', get: get_8427},
{key: 'isStreamInfoOverlayEnabled', get: get_8428}, {key: 'preventPopoutClose', get: get_8429},
{key: 'logKeyboardMismatches', get: get_8430}, {key: 'alertStartupMetrics', get: get_8431},
{key: 'isLoggingQuestEvents', get: get_8432}, {key: 'getDebugOptionsHeaderValue', value: value_8433},
{key: 'routingKeyTags', get: get_8436}, {key: 'getRoutingKeyHeaderValue', value: value_8437}]);
function DeveloperOptionsStore() { // fn#8413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:1732, offset: 0x00d40439, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_4(this, DeveloperOptionsStore);
const value3 = env1_7(DeveloperOptionsStore);
return env1_6(this, _isNativeReflectConstruct_8403() ? global.Reflect.construct(value3, arguments,
env1_7(this).constructor) : value3.apply(this, arguments));
}
function value_8414() { // fn#8414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2055, offset: 0x00d404aa, size: 125 bytes, params: 1, frame: 16
var object;
const Storage = (StorageModule).Storage;
const value2 = Storage.get(env1_15);
if (value2 != null) {
object = {};
copyDataProperties(object, value2, copyDataProperties(object, env1_16, undefined));
}
if (Storage.get(env1_18) == null) {
}
}
function get_8415() { // fn#8415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2208, offset: 0x00d40527, size: 15 bytes, params: 1, frame: 1
return env1_17.trace;
}
function get_8416() { // fn#8416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2262, offset: 0x00d40536, size: 15 bytes, params: 1, frame: 1
return env1_17.canary;
}
function get_8417() { // fn#8417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2325, offset: 0x00d40545, size: 15 bytes, params: 1, frame: 1
return env1_17.logGatewayEvents;
}
function get_8418() { // fn#8418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2398, offset: 0x00d40554, size: 15 bytes, params: 1, frame: 1
return env1_17.logOverlayEvents;
}
function get_8419() { // fn#8419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2473, offset: 0x00d40563, size: 15 bytes, params: 1, frame: 1
return env1_17.logAnalyticsEvents;
}
function get_8420() { // fn#8420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2538, offset: 0x00d40572, size: 15 bytes, params: 1, frame: 1
return env1_17.axeEnabled;
}
function get_8421() { // fn#8421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2602, offset: 0x00d40581, size: 15 bytes, params: 1, frame: 1
return env1_17.cssDebuggingEnabled;
}
function get_8422() { // fn#8422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2678, offset: 0x00d40590, size: 15 bytes, params: 1, frame: 1
return env1_17.layoutDebuggingEnabled;
}
function get_8423() { // fn#8423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2752, offset: 0x00d4059f, size: 15 bytes, params: 1, frame: 1
return env1_17.sourceMapsEnabled;
}
function get_8424() { // fn#8424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2824, offset: 0x00d405ae, size: 15 bytes, params: 1, frame: 1
return env1_17.bugReporterEnabled;
}
function get_8425() { // fn#8425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2905, offset: 0x00d405bd, size: 15 bytes, params: 1, frame: 1
return env1_17.idleStatusIndicatorEnabled;
}
function get_8426() { // fn#8426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:2995, offset: 0x00d405cc, size: 15 bytes, params: 1, frame: 1
return env1_17.onlyShowPreviewAppCollections;
}
function get_8427() { // fn#8427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3085, offset: 0x00d405db, size: 15 bytes, params: 1, frame: 1
return env1_17.disableAppCollectionsCache;
}
function get_8428() { // fn#8428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3172, offset: 0x00d405ea, size: 15 bytes, params: 1, frame: 1
return env1_17.isStreamInfoOverlayEnabled;
}
function get_8429() { // fn#8429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3251, offset: 0x00d405f9, size: 15 bytes, params: 1, frame: 1
return env1_17.preventPopoutClose;
}
function get_8430() { // fn#8430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3325, offset: 0x00d40608, size: 15 bytes, params: 1, frame: 1
return env1_17.logKeyboardMismatches;
}
function get_8431() { // fn#8431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3400, offset: 0x00d40617, size: 15 bytes, params: 1, frame: 1
return env1_17.alertStartupMetrics;
}
function get_8432() { // fn#8432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3474, offset: 0x00d40626, size: 15 bytes, params: 1, frame: 1
return env1_17.logQuestEvents;
}
function value_8433() { // fn#8433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3551, offset: 0x00d40635, size: 93 bytes, params: 1, frame: 14
var environment;
let Object = global.Object;
const keys = Object.keys;
let value = environment.__proto__;
Reflect.apply(keys, Object, [env1_17]).map(_fun8434);
Object = global.Object;
value = Object.keys(env1_17);
value = value.filter(_fun8435);
return value.join(',');
function _fun8434(a0) { // fn#8434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3609, offset: 0x00d40692, size: 16 bytes, params: 2, frame: 2
return env2_17[a0];
}
function _fun8435(a0) { // fn#8435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3649, offset: 0x00d40692, size: 16 bytes, params: 2, frame: 2
return env2_17[a0];
}
}
function get_8436() { // fn#8436, offset: 0x00d406a2, size: 9 bytes, params: 1, frame: 1
return env1_19;
}
function value_8437() { // fn#8437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3757, offset: 0x00d406ab, size: 40 bytes, params: 1, frame: 12
const value = environment.__proto__;
return env1_19.length === 0 ? null : env1_19.join(',');
}
}
function LOGOUT(a0) { // fn#8438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3918, offset: 0x00d406d3, size: 33 bytes, params: 2, frame: 12
setOptions(env0_16);
setRoutingKeyTags([]);
}
function CONNECTION_OPEN(a0) { // fn#8439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:818:3996, offset: 0x00d406f4, size: 153 bytes, params: 2, frame: 14
var binding;
const user = a0.user;
let r5 = user.flags ?? 0;
let STAFF = UserFlags.STAFF;
const value2 = r5 & STAFF;
STAFF = UserFlags.STAFF;
const value3 = value2 === STAFF;
r5 = value3 || a0.user.personal_connection_id != null;
if (value3) {
binding = env0_14;
binding.set(env0_17.sourceMapsEnabled);
}
value = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
const setTags = value.setTags;
const object = {};
object.isStaff = r5.toString();
Reflect.apply(setTags, value, [object]);
}
}
global.__d(_fun8402, 691, [6, 7, 15, 17, 18, 661, 561, 672, 507, 692, 693, 587, 1216, 566, 694,
2]) /* metro module 691, dependencies: [6, 7, 15, 17, 18, 661, 561, 672, 507, 692, 693, 587, 1216, 566, 694, 2] */;