269 lines
10 KiB
TypeScript
269 lines
10 KiB
TypeScript
/* Metro module 3830; source: modules/user_settings/UserSettingsOverridesStore.tsx; dependencies: [6, 7, 15, 17, 18, 1348, 566, 587, 694, 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});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
|
let env0_8 = {};
|
|
let env0_9 = {};
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: 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 = {};
|
|
}});
|
|
(require(2) /* metro dependency 2 */).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 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 object2 = {};
|
|
let textAndImages = settings.textAndImages;
|
|
const value = undefined;
|
|
object2.gifAutoPlay = textAndImages == null || textAndImages.gifAutoPlay == null ? value : textAndImages.gifAutoPlay.value;
|
|
textAndImages = settings.textAndImages;
|
|
object2.animateEmoji = textAndImages == null || textAndImages.animateEmoji == null ? value : textAndImages.animateEmoji.value;
|
|
textAndImages = settings.textAndImages;
|
|
object2.animateStickers = textAndImages == null || textAndImages.animateStickers == null ? value : textAndImages.animateStickers.value;
|
|
return object2;
|
|
}
|
|
|
|
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 closure = UserSettingsOverridesStore;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'initialize', value: value_31348}, {key: 'getState', value: value_31349},
|
|
{key: 'getAppliedOverrideReasonKey', value: value_31350}, {key: 'getOverride', value: value_31351}]);
|
|
}
|
|
|
|
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 object2 = {};
|
|
copyDataProperties(object2, settings, copyDataProperties(object2, 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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
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_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;
|
|
}
|
|
|