72 lines
3.6 KiB
TypeScript
72 lines
3.6 KiB
TypeScript
/* Metro module 14628; source: modules/premium/powerups/hooks/useGuildPowerupsWarningConfig.tsx; dependencies: [31, 12346, 8254, 566, 1244, 2256, 2] */
|
|
function _fun110570(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14825:6, offset: 0x0237da44, size: 137 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const appliedGuildBoostStore = importDefault(12346) /* metro dependency 12346: AppliedGuildBoostStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/powerups/hooks/useGuildPowerupsWarningConfig.tsx');
|
|
exports.default = useGuildPowerupsWarningConfig;
|
|
}
|
|
|
|
function useGuildPowerupsWarningConfig(a0, a1) { // fn#110571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14825:224, offset: 0x0237dacd, size: 181 bytes, params: 3, frame: 19
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const spent = (importDefault(8254) /* metro dependency 8254: useGuildPowerupsBoostCount */)(a0).spent;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AppliedGuildBoostStore],
|
|
_fun110572, [a0]);
|
|
const binding = env0_3;
|
|
const useMemo = binding.useMemo;
|
|
return binding.useMemo(_fun110575, [spent - Reflect.apply(useMemo, binding, [_fun110573, [value2]]), a1]);
|
|
}
|
|
|
|
function _fun110572() { // fn#110572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14825:325, offset: 0x0237db82, size: 27 bytes, params: 1, frame: 11
|
|
return AppliedGuildBoostStore.getAppliedGuildBoostsForGuild(env0_0);
|
|
}
|
|
|
|
function _fun110573() { // fn#110573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14825:385, offset: 0x0237db9d, size: 87 bytes, params: 1, frame: 14
|
|
var length;
|
|
var value;
|
|
const value2 = undefined;
|
|
if (env0_2 == null) {
|
|
length = value2;
|
|
} else if (env0_2.filter == null) {
|
|
length = value2;
|
|
} else {
|
|
value = env0_2.filter(function(a0) {
|
|
return !a0.ended && a0.endsAt == null;
|
|
});
|
|
length = value == null ? value2 : value.length;
|
|
}
|
|
return length ?? 0;
|
|
}
|
|
|
|
function _fun110575() { // fn#110575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14825:535, offset: 0x0237dc11, size: 200 bytes, params: 1, frame: 20
|
|
var r0;
|
|
var object3;
|
|
var value2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var formatToPlainString;
|
|
var iAaAiG;
|
|
var object4;
|
|
var binding;
|
|
if (env0_3 <= 0) {
|
|
r0 = {'shouldShow': false, 'title': '', 'description': '', 'requiredBoostCount': 0};
|
|
} else {
|
|
object3 = {shouldShow: true};
|
|
value2 = environment.__proto__;
|
|
object3.title = intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).n5hQhc);
|
|
formatToPlainString = intl.formatToPlainString;
|
|
iAaAiG = (importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).iAaAiG;
|
|
object4 = {};
|
|
binding = env0_3;
|
|
object4.boostCount = binding;
|
|
object4.perksString = require.join(', ');
|
|
object3.description = Reflect.apply(formatToPlainString, intl, [iAaAiG, object4]);
|
|
object3.requiredBoostCount = binding;
|
|
r0 = object3;
|
|
}
|
|
return r0;
|
|
}
|
|
|