Files
discord-decomp/sources/modules/collectibles/CollectiblesPurchaseStore.tsx
T
2026-07-28 01:06:53 +03:00

192 lines
9.1 KiB
TypeScript

/* Metro module 5145; source: modules/collectibles/CollectiblesPurchaseStore.tsx; dependencies: [6, 7, 15, 17, 18, 22, 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 Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun45393(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:6, offset: 0x0118dda1, size: 393 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const Map = global.Map;
let map = new Map();
const Store = (Flux).Store;
_fun45397(Store).displayName = 'CollectiblesPurchaseStore';
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */, {COLLECTIBLES_PURCHASES_FETCH: function() {
env0_9 = true;
env0_11 = undefined;
}, COLLECTIBLES_PURCHASES_FETCH_SUCCESS: COLLECTIBLES_PURCHASES_FETCH_SUCCESS,
COLLECTIBLES_PURCHASES_FETCH_FAILURE: COLLECTIBLES_PURCHASES_FETCH_FAILURE, COLLECTIBLES_CLAIM: function(a0) {
env0_10 = a0.skuId;
env0_12 = undefined;
}, COLLECTIBLES_CLAIM_SUCCESS: COLLECTIBLES_CLAIM_SUCCESS, COLLECTIBLES_CLAIM_FAILURE: function(a0) {
var error = a0.error;
env0_10 = a0.skuId;
env0_12 = error;
}, LOGOUT: LOGOUT_45417});
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/CollectiblesPurchaseStore.tsx');
exports.default = map;
function _isNativeReflectConstruct_45394() { // fn#45394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:148, offset: 0x0118df2a, 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_45394_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun45397(a0) { // fn#45397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:398, offset: 0x0118df88, size: 231 bytes, params: 2, frame: 16
const CollectiblesPurchaseStore2 = CollectiblesPurchaseStore;
Inherits(CollectiblesPurchaseStore2, a0);
return CreateClass(CollectiblesPurchaseStore2, [{key: 'isFetching', get: get_45399}, {key: 'isClaiming', get: get_45400},
{key: 'purchases', get: get_45401}, {key: 'fetchError', get: get_45402}, {key: 'claimError', get: get_45403},
{key: 'hasPreviouslyFetched', get: get_45404}, {key: 'getPurchase', value: value_45405}, {key: 'getPurchases',
value: function(a0) {
return a0.map(_fun45407).filter(_fun45408);
}}]);
function CollectiblesPurchaseStore() { // fn#45398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:410, offset: 0x0118e06f, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, CollectiblesPurchaseStore);
const value3 = env1_5(CollectiblesPurchaseStore);
return env1_4(this, _isNativeReflectConstruct_45394() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function get_45399() { // fn#45399, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
return env1_9;
}
function get_45400() { // fn#45400, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1
return env1_10;
}
function get_45401() { // fn#45401, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
return env1_8;
}
function get_45402() { // fn#45402, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1
return env1_11;
}
function get_45403() { // fn#45403, offset: 0x00e2f9de, size: 9 bytes, params: 1, frame: 1
return env1_12;
}
function get_45404() { // fn#45404, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1
return env1_13;
}
function value_45405(a0) { // fn#45405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1027, offset: 0x0118e0e0, size: 33 bytes, params: 2, frame: 12
var r0;
let value = undefined;
if (a0 != null) {
value = environment.__proto__;
value = env1_8.get(a0);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function value_45406(a0) { // fn#45406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1098, offset: 0x0118e101, size: 37 bytes, params: 2, frame: 12
return a0.map(_fun45407).filter(function(a0) {
return a0 != null;
});
function _fun45407(a0) { // fn#45407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1124, offset: 0x0118e126, size: 22 bytes, params: 2, frame: 11
return env2_8.get(a0);
}
}
}
function COLLECTIBLES_PURCHASES_FETCH_SUCCESS(a0) { // fn#45410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1328, offset: 0x0118e14d, size: 186 bytes, params: 2, frame: 17
var moduleValue;
var isEqual;
var value2;
var items2;
var Map;
var map;
var value3;
if (a0.purchases.length !== 0) {
moduleValue = require(22) /* metro dependency 22 */;
isEqual = moduleValue.isEqual;
value2 = env0_8.values();
items2 = [];
arraySpread(items2, value2, 0, 0);
if (!Reflect.apply(isEqual, moduleValue, [items2, a0.purchases])) {
Map = global.Map;
value3 = a0.purchases.map(function(a0) {
return [a0.skuId, a0];
});
map = new Map();
}
}
}
function COLLECTIBLES_PURCHASES_FETCH_FAILURE({error}) { // fn#45412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1509, offset: 0x0118e207, size: 39 bytes, params: 2, frame: 3
}
function COLLECTIBLES_CLAIM_SUCCESS(a0) { // fn#45414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1612, offset: 0x0118e245, size: 193 bytes, params: 2, frame: 17
var moduleValue;
var isEqual;
var value2;
var items2;
var Map;
var map;
var value3;
if (a0.purchases != null) {
if (a0.purchases.length !== 0) {
moduleValue = require(22) /* metro dependency 22 */;
isEqual = moduleValue.isEqual;
value2 = env0_8.values();
items2 = [];
arraySpread(items2, value2, 0, 0);
if (!Reflect.apply(isEqual, moduleValue, [items2, a0.purchases])) {
Map = global.Map;
value3 = a0.purchases.map(function(a0) {
return [a0.skuId, a0];
});
map = new Map();
}
}
}
}
function LOGOUT_45417() { // fn#45417, offset: 0x0118e322, size: 37 bytes, params: 1, frame: 4
}
}
function _fun45408(a0) { // fn#45408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5323:1146, offset: 0x00d0b2f0, size: 11 bytes, params: 2, frame: 2
return a0 != null;
}
global.__d(_fun45393, 5145, [6, 7, 15, 17, 18, 22, 566, 694,
2]) /* metro module 5145, dependencies: [6, 7, 15, 17, 18, 22, 566, 694, 2] */;