159 lines
9.3 KiB
TypeScript
159 lines
9.3 KiB
TypeScript
/* Metro module 15811; source: modules/premium/promotions/PromotionsManager.tsx; dependencies: [5, 6, 7, 15, 17, 18, 1878, 1880, 661, 482, 3802, 7260, 7289, 4860, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
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 UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import AutomaticLifecycleManager from '../../../lib/AutomaticLifecycleManager.tsx'; /* Metro dependency 4860 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as ConstantsModule2 from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as PromotionsActionCreatorsModule from './PromotionsActionCreators.tsx'; /* Metro dependency 7289 */
|
|
|
|
function _fun121506(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:6, offset: 0x02549a94, size: 328 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = AutomaticLifecycleManager;
|
|
value = _fun121510(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/PromotionsManager.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_121507() { // fn#121507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:246, offset: 0x02549bdc, size: 98 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_121507_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun121510(a0) { // fn#121510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:445, offset: 0x02549c3e, size: 196 bytes, params: 2, frame: 16
|
|
const PromotionsManager2 = PromotionsManager;
|
|
Inherits(PromotionsManager2, a0);
|
|
const env0_0 = Module00005(_fun121515);
|
|
return CreateClass(PromotionsManager2, [{key: 'onPostConnectionOpen', value: value_121516},
|
|
{key: 'onSubscriptionUpdated', value: value_121517}, {key: 'onMobilePurchaseSuccess', value: value_121518},
|
|
{key: 'onOfferUpdated', value: value_121519}, {key: 'onVCRedeemed', value: value_121520}]);
|
|
function PromotionsManager(a0) { // fn#121511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:457, offset: 0x02549d02, size: 334 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_4;
|
|
binding(this, PromotionsManager);
|
|
let object = [];
|
|
arraySpread(object, value, 0, object);
|
|
value = env1_7(PromotionsManager);
|
|
binding = env1_6;
|
|
if (_isNativeReflectConstruct_121507()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, object, env1_7(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, object);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
object = {};
|
|
object.POST_CONNECTION_OPEN = value.onPostConnectionOpen.bind(value);
|
|
object.EXPERIMENTS_FETCH_SUCCESS = value.onPostConnectionOpen.bind(value);
|
|
object.BILLING_SUBSCRIPTION_UPDATE_SUCCESS = value.onSubscriptionUpdated.bind(value);
|
|
object.IAP_PURCHASE_PRODUCT_SUCCESS = value.onMobilePurchaseSuccess.bind(value);
|
|
object.GPLAY_PURCHASE_VERIFIED = value.onMobilePurchaseSuccess.bind(value);
|
|
object.BILLING_USER_OFFER_ACKNOWLEDGED_SUCCESS = value.onOfferUpdated.bind(value);
|
|
object.BILLING_USER_TRIAL_OFFER_ACKNOWLEDGED_SUCCESS = value.onOfferUpdated.bind(value);
|
|
object.VIRTUAL_CURRENCY_REDEEM_SUCCESS = value.onVCRedeemed.bind(value);
|
|
value.actions = object;
|
|
value.maybeFetchBogoPromotion = env1_3(_fun121513);
|
|
return value;
|
|
function* _fun121513() { // fn#121513, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1224, offset: 0x02549e5b, size: 119 bytes, params: 1, frame: 16
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
var currentUser = env3_9.getCurrentUser();
|
|
var value4 = env3_1(env3_2[10]);
|
|
var isPremiumExactly = value4.isPremiumExactly;
|
|
var TIER_2 = env3_10.TIER_2;
|
|
if (Reflect.apply(isPremiumExactly, value4, [currentUser, TIER_2])) {
|
|
return undefined;
|
|
}
|
|
value = env3_0(env3_2[11]);
|
|
yield value.maybeFetchActiveBogoPromotion();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function* _fun121515() { // fn#121515, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1445, offset: 0x02549edd, size: 74 bytes, params: 1, frame: 13
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
env2_0(env2_2[12]).maybeFetchActivePromotions();
|
|
yield this.maybeFetchBogoPromotion();
|
|
}
|
|
}
|
|
|
|
function value_121516() { // fn#121516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1535, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
function value_121517({subscription}) { // fn#121517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1636, offset: 0x02549f27, size: 70 bytes, params: 2, frame: 11
|
|
const type = subscription.type;
|
|
const value = environment.__proto__;
|
|
const PREMIUM = SubscriptionTypes.PREMIUM;
|
|
if (type === PREMIUM) {
|
|
(require(7289) /* metro dependency 7289: PromotionsActionCreators */).maybeFetchActivePromotions(false);
|
|
}
|
|
}
|
|
|
|
function value_121518() { // fn#121518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1762, offset: 0x02549f6d, size: 40 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(PromotionsActionCreatorsModule).maybeFetchActivePromotions(false);
|
|
}
|
|
|
|
function value_121519() { // fn#121519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1843, offset: 0x02549f6d, size: 40 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
(PromotionsActionCreatorsModule).maybeFetchActivePromotions(false);
|
|
}
|
|
|
|
function value_121520({entitlements}) { // fn#121520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16019:1922, offset: 0x02549f95, size: 74 bytes, params: 2, frame: 11
|
|
var environment;
|
|
var value;
|
|
if (entitlements.some(function({type}) {
|
|
return type === EntitlementTypes.FRACTIONAL_REDEMPTION;
|
|
})) {
|
|
value = environment.__proto__;
|
|
value = require(7289) /* metro dependency 7289: PromotionsActionCreators */;
|
|
value.maybeFetchActivePromotions(false);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun121506, 15811, [5, 6, 7, 15, 17, 18, 1878, 1880, 661, 482, 3802, 7260, 7289, 4860,
|
|
2]) /* metro module 15811, dependencies: [5, 6, 7, 15, 17, 18, 1878, 1880, 661, 482, 3802, 7260, 7289, 4860, 2] */;
|