388 lines
16 KiB
TypeScript
388 lines
16 KiB
TypeScript
/* Metro module 5109; source: stores/AuthorizedAppsStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 1379, 5110, 4814, 1360, 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 Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import ChannelStore from './ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import MessageStore from './MessageStore.tsx'; /* Metro dependency 4814 */
|
|
import ConnectedAppsStore from './ConnectedAppsStore.tsx'; /* Metro dependency 5110 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun44635(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:6, offset: 0x01175ccc, size: 555 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_44641 = 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});
|
|
object = {NOT_FETCHED: 'NOT_FETCHED', FETCHING: 'FETCHING', FETCHED: 'FETCHED'};
|
|
let Map = global.Map;
|
|
let map = new Map();
|
|
const env0_13 = [];
|
|
const env0_14 = [];
|
|
const env0_15 = object.NOT_FETCHED;
|
|
Map = global.Map;
|
|
map = new Map();
|
|
const Store = (Flux).Store;
|
|
_fun44645(Store).displayName = 'AuthorizedAppsStore';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{USER_AUTHORIZED_APPS_REQUEST: USER_AUTHORIZED_APPS_REQUEST,
|
|
USER_AUTHORIZED_APPS_REQUEST_FAILED: USER_AUTHORIZED_APPS_REQUEST_FAILED,
|
|
USER_AUTHORIZED_APPS_UPDATE: USER_AUTHORIZED_APPS_UPDATE_44656, OAUTH2_TOKEN_CREATE: OAUTH2_TOKEN_CREATE_44657,
|
|
OAUTH2_TOKEN_DELETE: OAUTH2_TOKEN_DELETE, LOGOUT: LOGOUT_44659});
|
|
(FileImportTrackerModule).fileFinishedImporting('stores/AuthorizedAppsStore.tsx');
|
|
exports.default = map;
|
|
exports.FetchState = object;
|
|
function _isNativeReflectConstruct_44636() { // fn#44636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:190, offset: 0x01175ef7, 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_44636_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_44639(a0, a1) { // fn#44639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:383, offset: 0x01175f55, 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 _fun44640;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_44641(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_44641(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_44641(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun44640;
|
|
}
|
|
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 _fun44640() { // fn#44640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:954, 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 recomputeFromAppTokens() { // fn#44642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:1445, offset: 0x011760c7, size: 58 bytes, params: 1, frame: 14
|
|
const value2 = env0_12.values();
|
|
const items2 = [];
|
|
arraySpread(items2, value2, 0, items2);
|
|
env0_14 = items2.filter(function(a0) {
|
|
return a0.application.parent_id == null;
|
|
});
|
|
}
|
|
|
|
function updateFetchStates(a0, a1) { // fn#44644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:1548, offset: 0x01176117, size: 130 bytes, params: 3, frame: 17
|
|
var r3;
|
|
var value2;
|
|
var value3;
|
|
var done;
|
|
var value4;
|
|
var binding;
|
|
var set;
|
|
var value5;
|
|
if (a1 == null) {
|
|
env0_15 = a0;
|
|
env0_16.clear();
|
|
env0_17 += 1;
|
|
} else {
|
|
value2 = _createForOfIteratorHelperLoose_44639(a1);
|
|
value3 = value2();
|
|
done = value3.done;
|
|
if (!done) {
|
|
r3 = value3;
|
|
reducibleLoop2: while (true) {
|
|
value4 = r3.value;
|
|
binding = env0_16;
|
|
set = binding.set;
|
|
Reflect.apply(set, binding, [value4, a0]);
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
break reducibleLoop2;
|
|
}
|
|
r3 = value5;
|
|
continue reducibleLoop2;
|
|
}
|
|
}
|
|
env0_17 += 1;
|
|
}
|
|
}
|
|
|
|
function _fun44645(a0) { // fn#44645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:1715, offset: 0x01176199, size: 208 bytes, params: 2, frame: 16
|
|
const AuthorizedAppsStore2 = AuthorizedAppsStore;
|
|
Inherits(AuthorizedAppsStore2, a0);
|
|
return CreateClass(AuthorizedAppsStore2, [{key: 'initialize', value: function() {
|
|
this.waitFor(ChannelStore, ConnectedAppsStore, MessageStore);
|
|
}}, {key: 'getNewestTokenForApplication', value: value_44648}, {key: 'getNewestTokens', value: value_44649},
|
|
{key: 'getNewestTokensForNonChildrenApplications', value: value_44650}, {key: 'getFetchState',
|
|
value: function() {
|
|
return NOT_FETCHED;
|
|
}}, {key: 'getFetchStateForApplication', value: value_44652}, {key: 'getApplicationFetchStateVersion',
|
|
value: value_44653}]);
|
|
function AuthorizedAppsStore() { // fn#44646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:1727, offset: 0x01176269, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, AuthorizedAppsStore);
|
|
const value3 = env1_5(AuthorizedAppsStore);
|
|
return env1_4(this, _isNativeReflectConstruct_44636() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_44648(a0) { // fn#44648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:2115, offset: 0x011762da, size: 48 bytes, params: 2, frame: 13
|
|
var r0;
|
|
var value2;
|
|
var value3;
|
|
const value = null;
|
|
if (value == a0) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
value3 = env1_12.get(a0);
|
|
r0 = value != value3 ? value3 : value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function value_44649() { // fn#44649, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1
|
|
return env1_13;
|
|
}
|
|
|
|
function value_44650() { // fn#44650, offset: 0x00df0f5a, size: 9 bytes, params: 1, frame: 1
|
|
return env1_14;
|
|
}
|
|
|
|
function value_44652(a0) { // fn#44652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:2399, offset: 0x0117630a, size: 74 bytes, params: 2, frame: 12
|
|
const FETCHING = env1_11.FETCHING;
|
|
return NOT_FETCHED === FETCHING || NOT_FETCHED === env1_11.FETCHED ? NOT_FETCHED : env1_16.get(a0) ?? NOT_FETCHED;
|
|
}
|
|
|
|
function value_44653() { // fn#44653, offset: 0x00e07553, size: 9 bytes, params: 1, frame: 1
|
|
return env1_17;
|
|
}
|
|
|
|
}
|
|
|
|
function USER_AUTHORIZED_APPS_REQUEST(a0) { // fn#44654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:2654, offset: 0x01176354, size: 89 bytes, params: 2, frame: 13
|
|
if (a0.request.type === 'full') {
|
|
updateFetchStates(env0_11.FETCHING);
|
|
} else {
|
|
updateFetchStates(env0_11.FETCHING, a0.request.applicationIds);
|
|
}
|
|
}
|
|
|
|
function USER_AUTHORIZED_APPS_REQUEST_FAILED(a0) { // fn#44655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:2844, offset: 0x011763ad, size: 89 bytes, params: 2, frame: 13
|
|
if (a0.request.type === 'full') {
|
|
updateFetchStates(env0_11.FETCHED);
|
|
} else {
|
|
updateFetchStates(env0_11.FETCHED, a0.request.applicationIds);
|
|
}
|
|
}
|
|
|
|
function USER_AUTHORIZED_APPS_UPDATE_44656(a0) { // fn#44656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:3030, offset: 0x01176406, size: 294 bytes, params: 2, frame: 25
|
|
var r7;
|
|
var Object;
|
|
var keys;
|
|
var tokens;
|
|
var entries;
|
|
var value2;
|
|
var length;
|
|
var value3;
|
|
var property;
|
|
var value4;
|
|
var property2;
|
|
var binding;
|
|
var value5;
|
|
var Map;
|
|
var value6;
|
|
var value7;
|
|
var map;
|
|
const isFullFetch = a0.isFullFetch;
|
|
const updateFetchStatesBinding = updateFetchStates;
|
|
const FETCHED = env0_11.FETCHED;
|
|
if (isFullFetch) {
|
|
updateFetchStatesBinding(FETCHED);
|
|
Map = global.Map;
|
|
Object = global.Object;
|
|
value6 = Object.entries(a0.tokens);
|
|
value7 = value6.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isObjectEntryNotNullish);
|
|
map = new Map();
|
|
recomputeFromAppTokens();
|
|
} else {
|
|
Object = global.Object;
|
|
keys = Object.keys;
|
|
tokens = a0.tokens;
|
|
updateFetchStatesBinding(FETCHED, Reflect.apply(keys, Object, [tokens]));
|
|
Object = global.Object;
|
|
entries = Object.entries;
|
|
tokens = a0.tokens;
|
|
value2 = Reflect.apply(entries, Object, [tokens]);
|
|
length = value2.length;
|
|
value3 = 0;
|
|
if (value3 < length) {
|
|
r7 = value3;
|
|
while (true) {
|
|
property = value2[r7];
|
|
value4 = Module00057(property, 2);
|
|
property = value4[value3];
|
|
property2 = value4[1];
|
|
if (property2 == null) {
|
|
binding = env0_12;
|
|
binding.delete(property);
|
|
} else {
|
|
binding = env0_12;
|
|
binding.set(property, property2);
|
|
}
|
|
value5 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
|
|
length = value2.length;
|
|
if (value5 < length) {
|
|
r7 = value5;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
recomputeFromAppTokens();
|
|
}
|
|
}
|
|
|
|
function OAUTH2_TOKEN_CREATE_44657({id, application, scopes}) { // fn#44657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:3440, offset: 0x0117652c, size: 69 bytes, params: 2, frame: 17
|
|
const binding = env0_12;
|
|
binding.set(application.id, {id: id, application: application, scopes: scopes});
|
|
recomputeFromAppTokens();
|
|
}
|
|
|
|
function OAUTH2_TOKEN_DELETE({id, applicationId}) { // fn#44658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:3592, offset: 0x01176571, size: 85 bytes, params: 2, frame: 13
|
|
const value2 = env0_12.get(applicationId);
|
|
if (value2 == null) {
|
|
return false;
|
|
}
|
|
if (value2.id !== id) {
|
|
return false;
|
|
}
|
|
env0_12.delete(value2.application.id);
|
|
recomputeFromAppTokens();
|
|
}
|
|
|
|
function LOGOUT_44659() { // fn#44659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5287:3754, offset: 0x011765c6, size: 98 bytes, params: 1, frame: 10
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
env0_13 = [];
|
|
env0_14 = [];
|
|
env0_15 = env0_11.NOT_FETCHED;
|
|
env0_16.clear();
|
|
env0_17 += 1;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun44635, 5109, [6, 7, 15, 17, 18, 57, 1379, 5110, 4814, 1360, 566, 694,
|
|
2]) /* metro module 5109, dependencies: [6, 7, 15, 17, 18, 57, 1379, 5110, 4814, 1360, 566, 694, 2] */;
|