Files
discord-decomp/sources/lib/guild/GuildThreadSubscriptions.tsx
T
2026-07-27 16:20:00 +03:00

249 lines
8.5 KiB
TypeScript

/* Metro module 6891; source: lib/guild/GuildThreadSubscriptions.tsx; dependencies: [6, 7, 1393, 2] */
function _fun54722(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7069:6, offset: 0x0136ca80, size: 150 bytes, params: 8, frame: 18
const _arrayLikeToArray_54725 = 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 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 */;
let value = _fun54726();
(require(2) /* metro dependency 2 */).fileFinishedImporting('lib/guild/GuildThreadSubscriptions.tsx');
exports.default = value;
}
function _createForOfIteratorHelperLoose_54723(a0, a1) { // fn#54723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7069:120, offset: 0x0136cb16, 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 _fun54724;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54725(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_54725(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54725(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54724;
}
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 _fun54726() { // fn#54726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7069:1036, offset: 0x0136cc88, size: 193 bytes, params: 1, frame: 15
return env0_3(GuildThreadSubscriptions, [{key: 'reset', value: function() {
this._subscriptions = {};
}}, {key: 'get', value: function(a0) {
return this._get(a0).keys();
}}, {key: 'getSubscribedThreadIds', value: value_54730}, {key: '_get', value: value_54731}, {key: 'clear',
value: function(a0) {
if (a0 in this._subscriptions) {
delete this._subscriptions[a0];
this._onChange(a0, []);
}
}}, {key: 'subscribe', value: value_54733}, {key: 'unsubscribe', value: function(a0, a1) {
var r0;
var property;
var value;
if (a0 in this._subscriptions) {
property = this._subscriptions[a0];
value = property.has(a1);
if (value) {
property.del(a1);
this._onChange(a0, property.keys());
r0 = true;
} else {
r0 = !!value;
}
return r0;
}
return false;
}}]);
}
function value_54730() { // fn#54730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7069:1319, offset: 0x0136cd65, size: 136 bytes, params: 1, frame: 21
var r8;
var r2;
var propertyName;
var propertyName2;
var _createForOfIteratorHelperLoose_54723Binding;
var _subscriptions2;
var property;
var keys;
var value3;
var value4;
var done;
var value5;
var add;
var value6;
const Set = global.Set;
const set = new Set();
const properties = Object.keys(this._subscriptions);
const properties2 = 0;
const properties3 = properties.length;
if (properties !== undefined) {
r8 = properties2;
reducibleLoop1: while (true) {
propertyName = properties[r8];
propertyName2 = r8 + 1;
if (propertyName === undefined) {
break reducibleLoop1;
}
_createForOfIteratorHelperLoose_54723Binding = _createForOfIteratorHelperLoose_54723;
_subscriptions2 = this._subscriptions;
property = _subscriptions2[propertyName];
keys = property.keys;
value3 = _createForOfIteratorHelperLoose_54723Binding(Reflect.apply(keys, property, []));
value4 = value3();
done = value4.done;
if (done) {
r8 = propertyName2;
continue reducibleLoop1;
}
r2 = value4;
reducibleLoop3: while (true) {
value5 = r2.value;
add = set.add;
Reflect.apply(add, set, [value5]);
value6 = value3();
done = value6.done;
if (done) {
r8 = propertyName2;
continue reducibleLoop1;
}
r2 = value6;
continue reducibleLoop3;
}
continue reducibleLoop1;
}
}
return set;
}
function value_54731(a0) { // fn#54731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7069:1520, offset: 0x0136cded, size: 83 bytes, params: 2, frame: 12
var r0;
var value;
const property = this._subscriptions[a0];
if (property != null) {
r0 = property;
} else {
value = environment.__proto__;
value = importDefault(1393) /* metro dependency 1393 */;
value = new value({'max': 3, 'updateAgeOnGet': true});
r0 = value;
}
return r0;
}
function value_54733(a0, a1, a2) { // fn#54733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7069:1757, offset: 0x0136ce71, size: 181 bytes, params: 4, frame: 17
var r0;
var set;
var Date;
let value = this._get(a0);
if (value.has(a1)) {
set = value.set;
Date = global.Date;
Reflect.apply(set, value, [a1, Date.now()]);
value = false;
r0 = value;
} else {
r0 = a2 != null && value.has(a2);
if (r0) {
set = value.set;
Date = global.Date;
Reflect.apply(set, value, [a2, Date.now()]);
}
set = value.set;
Date = global.Date;
Reflect.apply(set, value, [a1, Date.now()]);
this._subscriptions[a0] = value;
this._onChange(a0, value.keys());
value = true;
r0 = value;
}
return r0;
}