296 lines
13 KiB
TypeScript
296 lines
13 KiB
TypeScript
/* Metro module 3830; source: modules/user_settings/UserSettingsOverridesStore.tsx; dependencies: [6, 7, 15, 17, 18, 1348, 566, 587, 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 Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserSettingsProtoStore from './UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun31337(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#31337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:6, offset: 0x00ff5d5b, size: 400 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_31343 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const updateExistingSettings = function() {
|
|
env0_9 = getExistingSettings();
|
|
return false;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let env0_8 = {};
|
|
let env0_9 = {};
|
|
const PersistedStore = (Flux).PersistedStore;
|
|
let value = _fun31346(PersistedStore);
|
|
value.displayName = 'UserSettingsOverridesStore';
|
|
value.persistKey = 'UserSettingsOverridesStore';
|
|
value.migrations = [function() {
|
|
var r0;
|
|
var Storage = require(dependencyMap[7]).Storage;
|
|
r0 = Storage.get('UserSettingsStoreOverrides') ?? ({});
|
|
Storage.remove('UserSettingsStoreOverrides');
|
|
return r0;
|
|
}];
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{USER_SETTINGS_PROTO_UPDATE: USER_SETTINGS_PROTO_UPDATE_31353,
|
|
USER_SETTINGS_OVERRIDE_APPLY: USER_SETTINGS_OVERRIDE_APPLY,
|
|
USER_SETTINGS_OVERRIDE_CLEAR: USER_SETTINGS_OVERRIDE_CLEAR, LOGOUT: function() {
|
|
env0_8 = {};
|
|
}, LOGIN_SUCCESS: function() {
|
|
env0_8 = {};
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_settings/UserSettingsOverridesStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_31338() { // fn#31338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:160, offset: 0x00ff5eeb, 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_31338_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_31341(a0, a1) { // fn#31341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:353, offset: 0x00ff5f49, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun31342;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_31343(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_31343(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_31343(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun31342;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun31342() { // fn#31342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:924, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function getExistingSettings() { // fn#31344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:1277, offset: 0x00ff60bb, size: 139 bytes, params: 1, frame: 7
|
|
const settings = UserSettingsProtoStore.settings;
|
|
const object = {};
|
|
let textAndImages = settings.textAndImages;
|
|
const value = undefined;
|
|
object.gifAutoPlay = textAndImages == null || textAndImages.gifAutoPlay == null ? value : textAndImages.gifAutoPlay.value;
|
|
textAndImages = settings.textAndImages;
|
|
object.animateEmoji = textAndImages == null || textAndImages.animateEmoji == null ? value : textAndImages.animateEmoji.value;
|
|
textAndImages = settings.textAndImages;
|
|
object.animateStickers = textAndImages == null || textAndImages.animateStickers == null ? value : textAndImages.animateStickers.value;
|
|
return object;
|
|
}
|
|
|
|
function _fun31346(a0) { // fn#31346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:1657, offset: 0x00ff615b, size: 137 bytes, params: 2, frame: 16
|
|
const UserSettingsOverridesStore2 = UserSettingsOverridesStore;
|
|
Inherits(UserSettingsOverridesStore2, a0);
|
|
return CreateClass(UserSettingsOverridesStore2, [{key: 'initialize', value: value_31348}, {key: 'getState',
|
|
value: value_31349}, {key: 'getAppliedOverrideReasonKey', value: value_31350}, {key: 'getOverride',
|
|
value: value_31351}]);
|
|
function UserSettingsOverridesStore() { // fn#31347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:1669, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, UserSettingsOverridesStore);
|
|
const value3 = env1_5(UserSettingsOverridesStore);
|
|
return env1_4(this, _isNativeReflectConstruct_31338() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_31348(a0) { // fn#31348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:2017, offset: 0x00ff61e4, size: 53 bytes, params: 2, frame: 14
|
|
const r1 = a0 ?? ({});
|
|
value = environment.__proto__;
|
|
this.syncWith([UserSettingsProtoStore], updateExistingSettings);
|
|
}
|
|
|
|
function value_31349() { // fn#31349, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_8;
|
|
}
|
|
|
|
function value_31350(a0) { // fn#31350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:2173, offset: 0x00ff6219, size: 33 bytes, params: 2, frame: 3
|
|
const value = environment.__proto__;
|
|
return env1_8[a0]?.reasonKey;
|
|
}
|
|
|
|
function value_31351(a0) { // fn#31351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:2259, offset: 0x00ff623a, size: 16 bytes, params: 2, frame: 2
|
|
return env1_8[a0];
|
|
}
|
|
|
|
}
|
|
|
|
function USER_SETTINGS_PROTO_UPDATE_31353() { // fn#31353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:2603, offset: 0x00ff62a5, size: 73 bytes, params: 1, frame: 20
|
|
var r1;
|
|
var r5;
|
|
var r0;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var value4;
|
|
const existingSettings = getExistingSettings();
|
|
const value3 = false;
|
|
const properties = Object.keys(existingSettings);
|
|
const properties2 = 0;
|
|
const properties3 = properties.length;
|
|
if (properties === undefined) {
|
|
r0 = value3;
|
|
} else {
|
|
r1 = value3;
|
|
r5 = properties2;
|
|
while (true) {
|
|
propertyName = properties[r5];
|
|
propertyName2 = r5 + 1;
|
|
if (propertyName === undefined) {
|
|
r0 = r1;
|
|
break;
|
|
}
|
|
property = existingSettings[propertyName];
|
|
if (property === env0_9[propertyName]) {
|
|
r5 = propertyName2;
|
|
continue;
|
|
}
|
|
delete env0_8[propertyName];
|
|
value4 = true;
|
|
r1 = value4;
|
|
r5 = propertyName2;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function USER_SETTINGS_OVERRIDE_APPLY({settings}) { // fn#31354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:2772, offset: 0x00ff62ee, size: 43 bytes, params: 2, frame: 13
|
|
const object = {};
|
|
copyDataProperties(object, settings, copyDataProperties(object, env0_8, undefined));
|
|
}
|
|
|
|
function USER_SETTINGS_OVERRIDE_CLEAR({settings}) { // fn#31355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3969:2867, offset: 0x00ff6319, size: 65 bytes, params: 2, frame: 14
|
|
var r2;
|
|
var value4;
|
|
var value5;
|
|
const value2 = _createForOfIteratorHelperLoose_31341(settings);
|
|
const value3 = value2();
|
|
let done = value3.done;
|
|
if (!done) {
|
|
for (r2 = value3; true; r2 = value5) {
|
|
value4 = r2.value;
|
|
delete env0_8[value4];
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun31337, 3830, [6, 7, 15, 17, 18, 1348, 566, 587, 694,
|
|
2]) /* metro module 3830, dependencies: [6, 7, 15, 17, 18, 1348, 566, 587, 694, 2] */;
|