213 lines
8.2 KiB
TypeScript
213 lines
8.2 KiB
TypeScript
/* Metro module 6842; source: modules/guild_role_subscriptions/useHasRoleSubscriptionInGuild.tsx; dependencies: [1226, 1945, 1938, 1867, 661, 566, 2] */
|
|
function _fun53862(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7020:6, offset: 0x01357eaa, size: 215 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_53865 = 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 closure = computeHasRoleSubscriptionsInGuild;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).GuildFeatures;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_role_subscriptions/useHasRoleSubscriptionInGuild.tsx');
|
|
exports.default = useHasRoleSubscriptionInGuild;
|
|
exports.computeHasRoleSubscriptionsInGuild = closure;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_53863(a0, a1) { // fn#53863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7020:165, offset: 0x01357f81, 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 _fun53864;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_53865(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_53865(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_53865(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun53864;
|
|
}
|
|
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 computeHasRoleSubscriptionsInGuild(a0, a1) { // fn#53866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7020:1075, offset: 0x013580f3, size: 294 bytes, params: 3, frame: 19
|
|
var r7;
|
|
var subscription_listing_id;
|
|
var value4;
|
|
var done;
|
|
var value5;
|
|
var property;
|
|
var tags;
|
|
var value6;
|
|
let value = a2;
|
|
const value2 = a3;
|
|
const value3 = undefined;
|
|
const r0 = value !== value3 ? value : a0 == null ? null : GuildMemberStore.getMember(a0,
|
|
AuthenticationStore.getId());
|
|
const iterator = (value2 !== value3 ? value2 : [GuildStore])[Symbol.iterator]();
|
|
let item2 = iterator.next();
|
|
const item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
value = item2 === value3;
|
|
let r2 = value ? value3 : item;
|
|
if (!value) {
|
|
item2.return();
|
|
}
|
|
value = r2.getGuild(a0);
|
|
if (value != null) {
|
|
if (r0 == null) {
|
|
return false;
|
|
}
|
|
var features = value.features;
|
|
var has = features.has;
|
|
var ROLE_SUBSCRIPTIONS_ENABLED = GuildFeatures.ROLE_SUBSCRIPTIONS_ENABLED;
|
|
if (Reflect.apply(has, features, [ROLE_SUBSCRIPTIONS_ENABLED])) {
|
|
value = _createForOfIteratorHelperLoose_53863(r0.roles);
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r2 = value4;
|
|
while (true) {
|
|
value5 = r2.value;
|
|
if (a1 == null) {
|
|
r7 = value3;
|
|
} else {
|
|
property = a1[value5];
|
|
r7 = property;
|
|
}
|
|
if (r7 == null) {
|
|
subscription_listing_id = value3;
|
|
continue;
|
|
}
|
|
tags = r7.tags;
|
|
if (tags == null) {
|
|
subscription_listing_id = value3;
|
|
continue;
|
|
}
|
|
subscription_listing_id = tags.subscription_listing_id;
|
|
if (subscription_listing_id != null) {
|
|
break;
|
|
}
|
|
value6 = value();
|
|
done = value6.done;
|
|
if (done) {
|
|
return false;
|
|
}
|
|
r2 = value6;
|
|
continue;
|
|
}
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function useHasRoleSubscriptionInGuild(a0) { // fn#53867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7020:1577, offset: 0x01358219, size: 134 bytes, params: 2, frame: 21
|
|
const env0_0 = a0;
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore, GuildRoleStore], _fun53869,
|
|
[a0, (require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore, GuildMemberStore],
|
|
_fun53868)]);
|
|
}
|
|
|
|
function _fun53868() { // fn#53868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7020:1660, offset: 0x0135829f, size: 55 bytes, params: 1, frame: 15
|
|
const value2 = null;
|
|
return value2 == env0_0 ? value2 : GuildMemberStore.getMember(env0_0, AuthenticationStore.getId());
|
|
}
|
|
|
|
function _fun53869() { // fn#53869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7020:1746, offset: 0x013582d6, size: 77 bytes, params: 1, frame: 20
|
|
const computeHasRoleSubscriptionsInGuildBinding = computeHasRoleSubscriptionsInGuild;
|
|
const binding = env0_0;
|
|
return computeHasRoleSubscriptionsInGuildBinding(binding,
|
|
binding != null ? GuildRoleStore.getRolesSnapshot(env0_0) : undefined, env0_1, [GuildStore]);
|
|
}
|
|
|