This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,28 +1,33 @@
/* Metro module 10390; source: modules/premium/promotions/MarketingComponentHooks.tsx; dependencies: [4502, 4048, 566, 3866, 2] */
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun80481(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10576:6, offset: 0x01e7d6c9, size: 118 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/MarketingComponentHooks.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/MarketingComponentHooks.tsx');
exports.useThemeAndReducedMotionAwareAssetUrl = useThemeAndReducedMotionAwareAssetUrl;
}
function useThemeAndReducedMotionAwareAssetUrl(a0, a1) { // fn#80482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10576:234, offset: 0x01e7d73f, size: 173 bytes, params: 3, frame: 17
var r0;
var value;
const value2 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const value3 = null;
if (value3 == a0) {
r0 = value3;
} else {
value = require(3866) /* metro dependency 3866: themes */;
r0 = value.isThemeDark(value2) || a1 ? useReducedMotion ? a0.darkStaticUrl : a0.darkUrl : useReducedMotion ? a0.lightStaticUrl : a0.lightUrl;
function useThemeAndReducedMotionAwareAssetUrl(a0, a1) { // fn#80482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10576:234, offset: 0x01e7d73f, size: 173 bytes, params: 3, frame: 17
var r0;
var value;
const value2 = (UseTheme)();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const value3 = null;
if (value3 == a0) {
r0 = value3;
} else {
value = require(3866) /* metro dependency 3866: themes */;
r0 = value.isThemeDark(value2) || a1 ? useReducedMotion ? a0.darkStaticUrl : a0.darkUrl : useReducedMotion ? a0.lightStaticUrl : a0.lightUrl;
}
return r0;
}
return r0;
}
global.__d(_fun80481, 10390, [4502, 4048, 566, 3866,
2]) /* metro module 10390, dependencies: [4502, 4048, 566, 3866, 2] */;
@@ -1,93 +1,99 @@
/* Metro module 7264; source: modules/premium/promotions/MarketingComponentRecord.tsx; dependencies: [6, 7, 15, 17, 18, 1886, 7265, 1316, 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 Record from '../../../lib/Record.tsx'; /* Metro dependency 1886 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module01316Module from '../../../by-id/module-01316.js'; /* Metro dependency 1316 */
import * as Premium_marketing_component_propertiesModule from '../../../external/discord_common/js/packages/protos/discord_protos/premium_marketing/v1/premium_marketing_component_properties.tsx'; /* Metro dependency 7265 */
function _fun58397(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:6, offset: 0x016c6c63, size: 202 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
let value = importDefault(1886) /* metro dependency 1886: Record */;
let value = Record;
value = _fun58401(value);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/MarketingComponentRecord.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/MarketingComponentRecord.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_58398() { // fn#58398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:148, offset: 0x016c6d2d, 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) {
function _isNativeReflectConstruct_58398() { // fn#58398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:148, offset: 0x016c6d2d, 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_58398_isNativeReflectConstruct = function() {
return !!result;
})();
}
return (_isNativeReflectConstruct_58398_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun58401(a0) { // fn#58401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:347, offset: 0x016c6d8b, size: 71 bytes, params: 2, frame: 16
const closure = MarketingComponentRecord;
env0_6(closure, a0);
return env0_3(closure, null, [{key: 'createFromServer', value: value_58403}]);
}
function _fun58401(a0) { // fn#58401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:347, offset: 0x016c6d8b, size: 71 bytes, params: 2, frame: 16
const MarketingComponentRecord2 = MarketingComponentRecord;
Inherits(MarketingComponentRecord2, a0);
return CreateClass(MarketingComponentRecord2, null, [{key: 'createFromServer', value: value_58403}]);
function MarketingComponentRecord({id, componentType, properties, promotionId}) { // fn#58402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:359, offset: 0x016c6dd2, size: 158 bytes, params: 2, frame: 20
let value = environment.__proto__;
env1_2(this, MarketingComponentRecord);
const value3 = env1_5(MarketingComponentRecord);
value = env1_4(this, _isNativeReflectConstruct_58398() ? global.Reflect.construct(value3, [],
env1_5(this).constructor) : value3.apply(this, undefined));
value.id = id;
value.componentType = componentType;
value.properties = properties;
value.promotionId = promotionId;
return value;
}
function MarketingComponentRecord({id, componentType, properties, promotionId}) { // fn#58402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:359, offset: 0x016c6dd2, size: 158 bytes, params: 2, frame: 20
let value = environment.__proto__;
env1_2(this, MarketingComponentRecord);
const value3 = env1_5(MarketingComponentRecord);
value = env1_4(this, _isNativeReflectConstruct_58398() ? global.Reflect.construct(value3, [],
env1_5(this).constructor) : value3.apply(this, undefined));
value.id = id;
value.componentType = componentType;
value.properties = properties;
value.promotionId = promotionId;
return value;
}
function value_58403({id, component_type, properties, promotion_id}) { // fn#58403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:805, offset: 0x016c6e70, size: 214 bytes, params: 2, frame: 20
var environment;
const TextDecoder = global.TextDecoder;
let textDecoder = new TextDecoder('utf-8', {ignoreBOM: true});
object = {id: id, componentType: component_type};
textDecoder = environment.__proto__;
const PremiumMarketingComponentProperties = (Premium_marketing_component_propertiesModule).PremiumMarketingComponentProperties;
const fromBinary = PremiumMarketingComponentProperties.fromBinary;
textDecoder = require(1316) /* metro dependency 1316 */;
textDecoder = textDecoder.base64decode(properties);
object.properties = Reflect.apply(fromBinary, PremiumMarketingComponentProperties, [textDecoder,
{readUnknownField: true, readerFactory: readerFactory_58404}]);
object.promotionId = promotion_id;
textDecoder = Object.create(MarketingComponentRecord.prototype, {constructor: {value: MarketingComponentRecord}});
const marketingComponentRecord = new MarketingComponentRecord(object);
return marketingComponentRecord instanceof Object ? marketingComponentRecord : textDecoder;
function value_58403ReaderFactory(a0) { // fn#58404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:1075, owner: value_58403.readerFactory, offset: 0x016c6f46, size: 63 bytes, params: 2, frame: 13
let value = environment.__proto__.__proto__;
const BinaryReader = (Module01316Module).BinaryReader;
const binding = env0_0;
value = Object.create(BinaryReader.prototype, {constructor: {value: BinaryReader}});
const binaryReader = new BinaryReader(a0, binding);
return binaryReader instanceof Object ? binaryReader : value;
}
function value_58403({id, component_type, properties, promotion_id}) { // fn#58403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:805, offset: 0x016c6e70, size: 214 bytes, params: 2, frame: 20
var object2;
var environment;
const TextDecoder = global.TextDecoder;
let textDecoder = new TextDecoder('utf-8', {ignoreBOM: true});
object2 = {id: id, componentType: component_type};
textDecoder = environment.__proto__;
const PremiumMarketingComponentProperties = (require(7265) /* metro dependency 7265: premium_marketing_component_properties */).PremiumMarketingComponentProperties;
const fromBinary = PremiumMarketingComponentProperties.fromBinary;
textDecoder = require(1316) /* metro dependency 1316 */;
textDecoder = textDecoder.base64decode(properties);
object2.properties = Reflect.apply(fromBinary, PremiumMarketingComponentProperties, [textDecoder,
{readUnknownField: true, readerFactory: readerFactory_58404}]);
object2.promotionId = promotion_id;
textDecoder = Object.create(MarketingComponentRecord.prototype, {constructor: {value: MarketingComponentRecord}});
const marketingComponentRecord = new MarketingComponentRecord(object2);
return marketingComponentRecord instanceof Object ? marketingComponentRecord : textDecoder;
}
}
}
function value_58403ReaderFactory(a0) { // fn#58404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7442:1075, owner: value_58403.readerFactory, offset: 0x016c6f46, size: 63 bytes, params: 2, frame: 13
let value = environment.__proto__.__proto__;
const BinaryReader = (require(1316) /* metro dependency 1316 */).BinaryReader;
const binding = env0_0;
value = Object.create(BinaryReader.prototype, {constructor: {value: BinaryReader}});
const binaryReader = new BinaryReader(a0, binding);
return binaryReader instanceof Object ? binaryReader : value;
}
global.__d(_fun58397, 7264, [6, 7, 15, 17, 18, 1886, 7265, 1316,
2]) /* metro module 7264, dependencies: [6, 7, 15, 17, 18, 1886, 7265, 1316, 2] */;
@@ -1,73 +1,76 @@
/* Metro module 12169; source: modules/premium/promotions/PromotionStringUtils.tsx; dependencies: [3807, 1880, 566, 3802, 5137, 1244, 1948, 2] */
import SubscriptionPlanStore from '../../../stores/billing/SubscriptionPlanStore.tsx'; /* Metro dependency 3807 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
function _fun93266(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:6, offset: 0x020ad048, size: 163 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */;
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_4 = premiumConstantsModule.PremiumSubscriptionSKUs;
const env0_5 = premiumConstantsModule.SubscriptionPlans;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionStringUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/PromotionStringUtils.tsx');
exports.useFormatStringWithCommonPremiumParams = useFormatStringWithCommonPremiumParams;
exports.getHelpArticleLinkProps = getHelpArticleLinkProps;
}
function useFormatStringWithCommonPremiumParams(a0) { // fn#93267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:292, offset: 0x020ad0eb, size: 211 bytes, params: 2, frame: 17
var r0;
var property;
var defaultImport;
var getDefaultPrice;
var PREMIUM_MONTH_TIER_2;
var value5;
var moduleValue2;
var formatPrice;
var amount;
var currency;
var value6;
var error;
const value = '...';
const moduleValue = require(dependencyMap[2]);
const useStateFromStores = moduleValue.useStateFromStores;
if (a0.indexOf('{price}') === -1) {
r0 = value;
} else if (Reflect.apply(useStateFromStores, moduleValue, [[SubscriptionPlanStore], function() {
return SubscriptionPlanStore.isLoadedForSKU(PremiumSubscriptionSKUs.TIER_2);
}])) {
try {
property = dependencyMap[3];
defaultImport = importDefault(property);
getDefaultPrice = defaultImport.getDefaultPrice;
PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
value5 = Reflect.apply(getDefaultPrice, defaultImport, [PREMIUM_MONTH_TIER_2]);
property = dependencyMap[4];
moduleValue2 = require(property);
formatPrice = moduleValue2.formatPrice;
amount = value5.amount;
currency = value5.currency;
value6 = Reflect.apply(formatPrice, moduleValue2, [amount, currency]);
r0 = value6;
} catch (error) {
function useFormatStringWithCommonPremiumParams(a0) { // fn#93267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:292, offset: 0x020ad0eb, size: 211 bytes, params: 2, frame: 17
var r0;
var property;
var defaultImport;
var getDefaultPrice;
var PREMIUM_MONTH_TIER_2;
var value5;
var moduleValue2;
var formatPrice;
var amount;
var currency;
var value6;
var error;
const value = '...';
const moduleValue = require(dependencyMap[2]);
const useStateFromStores = moduleValue.useStateFromStores;
if (a0.indexOf('{price}') === -1) {
r0 = value;
} else if (Reflect.apply(useStateFromStores, moduleValue, [[SubscriptionPlanStore], function() {
return SubscriptionPlanStore.isLoadedForSKU(PremiumSubscriptionSKUs.TIER_2);
}])) {
try {
property = dependencyMap[3];
defaultImport = importDefault(property);
getDefaultPrice = defaultImport.getDefaultPrice;
PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
value5 = Reflect.apply(getDefaultPrice, defaultImport, [PREMIUM_MONTH_TIER_2]);
property = dependencyMap[4];
moduleValue2 = require(property);
formatPrice = moduleValue2.formatPrice;
amount = value5.amount;
currency = value5.currency;
value6 = Reflect.apply(formatPrice, moduleValue2, [amount, currency]);
r0 = value6;
} catch (error) {
r0 = value;
}
} else {
r0 = value;
}
} else {
r0 = value;
return a0.replace(RegExp('\\{price\\}', 'g'), r0);
}
return a0.replace(RegExp('\\{price\\}', 'g'), r0);
}
function getHelpArticleLinkProps(a0, a1) { // fn#93269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:625, offset: 0x020ad1dc, size: 209 bytes, params: 3, frame: 17
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const value = a1;
const value2 = undefined;
const r5 = (a0 == null ? value2 : a0.id) == null || a0.id === '' ? value : a0.id;
if (r5 === '') {
return null;
function getHelpArticleLinkProps(a0, a1) { // fn#93269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12355:625, offset: 0x020ad1dc, size: 209 bytes, params: 3, frame: 17
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const value = a1;
const value2 = undefined;
const r5 = (a0 == null ? value2 : a0.id) == null || a0.id === '' ? value : a0.id;
if (r5 === '') {
return null;
}
const r2 = (a0 == null ? value2 : a0.linkText) == null ? intl.string(t['sBp+u0']) : a0.linkText !== '' ? a0.linkText : intl.string(t['sBp+u0']);
const object = {};
object.url = (importDefault(1948) /* metro dependency 1948: HelpdeskUtils */).getArticleURL(r5);
object.linkText = r2;
return object;
}
const r2 = (a0 == null ? value2 : a0.linkText) == null ? intl.string(t['sBp+u0']) : a0.linkText !== '' ? a0.linkText : intl.string(t['sBp+u0']);
const object2 = {};
object2.url = (importDefault(1948) /* metro dependency 1948: HelpdeskUtils */).getArticleURL(r5);
object2.linkText = r2;
return object2;
}
global.__d(_fun93266, 12169, [3807, 1880, 566, 3802, 5137, 1244, 1948,
2]) /* metro module 12169, dependencies: [3807, 1880, 566, 3802, 5137, 1244, 1948, 2] */;
@@ -1,4 +1,16 @@
/* Metro module 7286; source: modules/premium/promotions/PromotionUtils.tsx; dependencies: [5, 1348, 7262, 3808, 7064, 7261, 1880, 661, 4237, 4002, 507, 477, 683, 1391, 1365, 21, 1367, 7263, 3802, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import UserSettingsProtoStore from '../../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import SubscriptionStore from '../../../stores/billing/SubscriptionStore.tsx'; /* Metro dependency 3808 */
import UserOfferStore from '../../../stores/billing/UserOfferStore.tsx'; /* Metro dependency 7064 */
import PromotionsStore from './PromotionsStore.tsx'; /* Metro dependency 7261 */
import PromotionRecord from '../../../records/PromotionRecord.tsx'; /* Metro dependency 7262 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */
import * as ConstantsModule from '../../activities/Constants.tsx'; /* Metro dependency 4237 */
function _fun58765(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:6, offset: 0x016d65f5, size: 475 bytes, params: 8, frame: 24
let env0_0 = require;
const _arrayLikeToArray_58768 = function(a0, a1) {
@@ -49,31 +61,25 @@ function _fun58765(global, require, importDefault, importAll, module, exports, d
object.promotion = PromotionRecord.createFromServer(a0.promotion);
return object;
};
const closure2 = getNextUnseenOutboundPromotionId;
const getNextUnseenOutboundPromotionId2 = getNextUnseenOutboundPromotionId;
const closure3 = function({partnerId}) {
return partnerId === require(dependencyMap[17]).LOGITECH_PARTNER_ID;
};
const closure4 = shouldShowOutboundPromotionOnPlatform;
const shouldShowOutboundPromotionOnPlatform2 = shouldShowOutboundPromotionOnPlatform;
const closure5 = function({promotionType}) {
return promotionType === require(dependencyMap[17]).PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const promotionRecord = importDefault(7262) /* metro dependency 7262: PromotionRecord */;
const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */;
const userOfferStore = importDefault(7064) /* metro dependency 7064: UserOfferStore */;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
let value = require(1880) /* metro dependency 1880: PremiumConstants */;
let value = PremiumConstantsModule;
const env0_9 = value.PremiumTypes;
const env0_10 = value.PromotionFlags;
value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.AnalyticEvents;
const env0_12 = value.Endpoints;
const env0_13 = value.Platforms;
(require(4237) /* metro dependency 4237: Constants */).ActivityPlatform;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionUtils.tsx');
(ConstantsModule).ActivityPlatform;
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/PromotionUtils.tsx');
exports.getPromotionImageURL = getPromotionImageURL;
exports.claimedOutboundPromotionCodeFromServer = closure;
exports.claimOutboundPromotion = function() {
@@ -95,10 +101,10 @@ function _fun58765(global, require, importDefault, importAll, module, exports, d
}
return r0;
};
exports.getNextUnseenOutboundPromotionId = closure2;
exports.getNextUnseenOutboundPromotionId = getNextUnseenOutboundPromotionId2;
exports.shouldShowOutboundPromotionNotice = shouldShowOutboundPromotionNotice;
exports.isLogitechPromotion = closure3;
exports.shouldShowOutboundPromotionOnPlatform = closure4;
exports.shouldShowOutboundPromotionOnPlatform = shouldShowOutboundPromotionOnPlatform2;
exports.isTrialUserEligibleToSeeOutboundPromotion = function(a0, a1) {
return a1[a0.id] != null || a0.isRedeemableByTrialUsers();
};
@@ -112,270 +118,281 @@ function _fun58765(global, require, importDefault, importAll, module, exports, d
};
exports.isRecurringPromotion = closure5;
exports.isRecurring3PRewardsLocked = isRecurring3PRewardsLocked;
}
function _createForOfIteratorHelperLoose_58766(a0, a1) { // fn#58766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:291, offset: 0x016d67d0, 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)) {
function _createForOfIteratorHelperLoose_58766(a0, a1) { // fn#58766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:291, offset: 0x016d67d0, 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);
}
return _fun58767;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_58768(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') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun58767;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_58768(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
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_58768(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_58768(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun58767;
}
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 _fun58767() { // fn#58767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:862, 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 _claimOutboundPromotion() { // fn#58770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1354, offset: 0x016d6984, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun58772).apply(this, arguments);
async function _fun58772({promotionId, promotionTitle, partnerId, analyticsLocations}) { // fn#58772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1423, offset: 0x016d69c6, size: 312 bytes, params: 2, frame: 24
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const HTTP = binding(env2_2[10]).HTTP;
const post = HTTP.post;
const object = {};
object.url = env2_12.CLAIM_OUTBOUND_PROMOTION_CODE(promotionId);
object.rejectWithError = false;
await Reflect.apply(post, HTTP, [object]);
if (false) {
return undefined;
}
const body = undefined.body;
const isIOS2 = env2_0(env2_2[11]).isIOS();
binding = env2_13;
const r14 = isIOS2 ? binding.IOS : binding.ANDROID;
const value7 = env2_1(env2_2[12]);
const track = value7.track;
const OUTBOUND_PROMOTION_CLAIMED = env2_11.OUTBOUND_PROMOTION_CLAIMED;
Reflect.apply(track, value7, [OUTBOUND_PROMOTION_CLAIMED, {platform: r14, status: undefined.status,
location_stack: analyticsLocations, promotion_id: promotionId, name: promotionTitle ?? null,
partner: partnerId ?? null}]);
return env2_16(body);
}
}
function getNextUnseenOutboundPromotionId() { // fn#58773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1862, offset: 0x016d6afe, size: 264 bytes, params: 1, frame: 18
var lastDismissedObjectId;
var property;
const outboundPromotions = PromotionsStore.outboundPromotions;
let value2 = outboundPromotions.filter(_fun58774);
const userContent = UserSettingsProtoStore.settings.userContent;
const value3 = null;
let value4 = undefined;
if (value3 == userContent) {
lastDismissedObjectId = value4;
} else {
property = userContent.recurringDismissibleContentStates[(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.THIRD_PARTY_OUTBOUND_PROMO_NAGBAR];
lastDismissedObjectId = value3 == property ? value4 : property.lastDismissedObjectId;
}
const r5 = value3 == lastDismissedObjectId ? value2 : value2.filter(_fun58775);
const premiumTypeSubscription = SubscriptionStore.getPremiumTypeSubscription();
const r4 = value3 == premiumTypeSubscription || !premiumTypeSubscription.hasActiveTrial ? UserOfferStore.hasAnyUnexpiredOffer() ? r5.filter(function(a0) {
return a0.isRedeemableByTrialUsers();
}) : r5 : r5.filter(_fun58776);
return r4.length === 0 ? value3 : r4.sort(function(a0, a1) {
var Date = global.Date;
var value2 = new Date(a0.startDate);
Date = global.Date;
var value4 = new Date(a1.startDate);
value2 = 1;
return value2 < value4 ? -1 : value2;
})[0].id;
function _fun58774(a0) { // fn#58774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1978, offset: 0x016d6c06, size: 99 bytes, params: 2, frame: 15
var r0;
var moduleValue;
const id = a0.id;
let value = id !== consumedInboundPromotionId;
if (value) {
value = environment.__proto__;
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
value = !moduleValue.hasFlag(a0.flags, PromotionFlags.SUPPRESS_NOTIFICATION);
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = !isLogitechPromotion(a0);
r0 = value;
}
return r0;
}
function _fun58775({id}) { // fn#58775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2269, offset: 0x016d6c69, size: 61 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = Reflect.apply((importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare, value, [id,
lastDismissedObjectId]);
return value === 1;
}
}
function shouldShowOutboundPromotionOnPlatform(a0) { // fn#58779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2632, offset: 0x016d6d3d, size: 70 bytes, params: 2, frame: 13
const isIOS2 = (PlatformUtilsModule).isIOS();
return isIOS2 ? !a0.hasFlag(PromotionFlags.IS_BLOCKED_IOS) : !isIOS2;
}
function getPromotionImageURL(a0, a1) { // fn#58781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2958, offset: 0x016d6db7, size: 204 bytes, params: 3, frame: 25
let value = SharedModule;
value = value.isThemeDark(a1);
const r7 = value ? 'logo-dark' : 'logo-light';
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
return CDN_HOST != null ? 'https://' + CDN_HOST + '/promotions/' + a0 + '/' + r7 + '?size=256' : '' + global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + '/promotions/' + a0 + '/' + r7 + '?size=256';
}
function shouldShowOutboundPromotionNotice() { // fn#58784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:3814, offset: 0x016d6ee1, size: 97 bytes, params: 1, frame: 18
var r0;
var value;
const nextUnseenOutboundPromotionId = getNextUnseenOutboundPromotionId();
const value3 = nextUnseenOutboundPromotionId != null;
if (value3) {
value = require(1367) /* metro dependency 1367: DismissibleContentUtils */;
value = !value.isTimeRecurringSnowflakeBoundDismissibleContentDismissed((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.THIRD_PARTY_OUTBOUND_PROMO_NAGBAR,
nextUnseenOutboundPromotionId, {cooldownDurationMs: 259200000});
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function getClaimedOutboundPromotionCodeMap(a0) { // fn#58786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4392, offset: 0x016d6f66, size: 73 bytes, params: 2, frame: 14
var r2;
var value3;
var code;
var promotion;
var id;
var value4;
const object = {};
const value = _createForOfIteratorHelperLoose_58766(a0);
const value2 = value();
let done = value2.done;
if (!done) {
for (r2 = value2; true; r2 = value4) {
value3 = r2.value;
code = value3.code;
promotion = value3.promotion;
id = promotion.id;
object[id] = code;
value4 = value();
done = value4.done;
if (done) {
break;
}
}
r5 = r6;
}
} else {
r5 = value;
return object;
}
if (r5) {
if (r5) {
}
return _fun58767;
}
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 _claimOutboundPromotion() { // fn#58770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1354, offset: 0x016d6984, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun58772).apply(this, arguments);
}
function getNextUnseenOutboundPromotionId() { // fn#58773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1862, offset: 0x016d6afe, size: 264 bytes, params: 1, frame: 18
var lastDismissedObjectId;
var property;
const outboundPromotions = PromotionsStore.outboundPromotions;
const env0_0 = PromotionsStore.consumedInboundPromotionId;
let value2 = outboundPromotions.filter(_fun58774);
const userContent = UserSettingsProtoStore.settings.userContent;
const value3 = null;
let value4 = undefined;
if (value3 == userContent) {
lastDismissedObjectId = value4;
} else {
property = userContent.recurringDismissibleContentStates[(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.THIRD_PARTY_OUTBOUND_PROMO_NAGBAR];
lastDismissedObjectId = value3 == property ? value4 : property.lastDismissedObjectId;
}
const r5 = value3 == lastDismissedObjectId ? value2 : value2.filter(_fun58775);
const premiumTypeSubscription = SubscriptionStore.getPremiumTypeSubscription();
const r4 = value3 == premiumTypeSubscription || !premiumTypeSubscription.hasActiveTrial ? UserOfferStore.hasAnyUnexpiredOffer() ? r5.filter(function(a0) {
return a0.isRedeemableByTrialUsers();
}) : r5 : r5.filter(_fun58776);
return r4.length === 0 ? value3 : r4.sort(function(a0, a1) {
var Date = global.Date;
var value2 = new Date(a0.startDate);
Date = global.Date;
var value4 = new Date(a1.startDate);
value2 = 1;
return value2 < value4 ? -1 : value2;
})[0].id;
}
function shouldShowOutboundPromotionOnPlatform(a0) { // fn#58779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2632, offset: 0x016d6d3d, size: 70 bytes, params: 2, frame: 13
const isIOS2 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS();
return isIOS2 ? !a0.hasFlag(PromotionFlags.IS_BLOCKED_IOS) : !isIOS2;
}
function getPromotionImageURL(a0, a1) { // fn#58781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2958, offset: 0x016d6db7, size: 204 bytes, params: 3, frame: 25
let value = require(4002) /* metro dependency 4002: shared */;
value = value.isThemeDark(a1);
const r7 = value ? 'logo-dark' : 'logo-light';
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const CDN_HOST = GLOBAL_ENV.CDN_HOST;
return CDN_HOST != null ? 'https://' + CDN_HOST + '/promotions/' + a0 + '/' + r7 + '?size=256' : '' + global.location.protocol + global.window.GLOBAL_ENV.API_ENDPOINT + '/promotions/' + a0 + '/' + r7 + '?size=256';
}
function shouldShowOutboundPromotionNotice() { // fn#58784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:3814, offset: 0x016d6ee1, size: 97 bytes, params: 1, frame: 18
var r0;
var value;
const nextUnseenOutboundPromotionId = getNextUnseenOutboundPromotionId();
const value3 = nextUnseenOutboundPromotionId != null;
if (value3) {
value = require(1367) /* metro dependency 1367: DismissibleContentUtils */;
value = !value.isTimeRecurringSnowflakeBoundDismissibleContentDismissed((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.THIRD_PARTY_OUTBOUND_PROMO_NAGBAR,
nextUnseenOutboundPromotionId, {cooldownDurationMs: 259200000});
r0 = value;
} else {
r0 = value3;
}
return r0;
}
function getClaimedOutboundPromotionCodeMap(a0) { // fn#58786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4392, offset: 0x016d6f66, size: 73 bytes, params: 2, frame: 14
var r2;
var value3;
var code;
var promotion;
var id;
var value4;
const object2 = {};
const value = _createForOfIteratorHelperLoose_58766(a0);
const value2 = value();
let done = value2.done;
if (!done) {
for (r2 = value2; true; r2 = value4) {
value3 = r2.value;
code = value3.code;
promotion = value3.promotion;
id = promotion.id;
object2[id] = code;
value4 = value();
done = value4.done;
if (done) {
break;
function getClaimedEndedOutboundPromotions(a0, a1) { // fn#58787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4597, offset: 0x016d6faf, size: 72 bytes, params: 3, frame: 14
const Set = global.Set;
const set = new Set(a1.map(function(a0) {
return a0.id;
}));
return a0.filter(_fun58789);
function _fun58789({promotion}) { // fn#58789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4698, offset: 0x016d6ff7, size: 93 bytes, params: 2, frame: 12
var r0;
const binding = env0_0;
let value = binding.has(promotion.id);
if (value) {
r0 = !value;
} else {
value = environment.__proto__;
value = !isRecurringPromotion(promotion);
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = !isLogitechPromotion(promotion);
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = shouldShowOutboundPromotionOnPlatform(promotion);
r0 = value;
}
return r0;
}
}
return object2;
}
function getClaimedEndedOutboundPromotions(a0, a1) { // fn#58787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4597, offset: 0x016d6faf, size: 72 bytes, params: 3, frame: 14
const Set = global.Set;
const set = new Set(a1.map(function(a0) {
return a0.id;
}));
return a0.filter(_fun58789);
}
}
function isRecurring3PRewardsLocked(a0) { // fn#58790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4899, offset: 0x016d7054, size: 80 bytes, params: 2, frame: 15
var r0;
var defaultImport;
let value = a0 == null;
if (value) {
r0 = value;
} else {
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
value = defaultImport.isPremiumExactly(a0, PremiumTypes.TIER_2);
value = value === false;
r0 = value;
function isRecurring3PRewardsLocked(a0) { // fn#58790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4899, offset: 0x016d7054, size: 80 bytes, params: 2, frame: 15
var r0;
var defaultImport;
let value = a0 == null;
if (value) {
r0 = value;
} else {
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
value = defaultImport.isPremiumExactly(a0, PremiumTypes.TIER_2);
value = value === false;
r0 = value;
}
r0 = !r0 ? a0.isFractionalPremiumWithNoStandardSub() : r0;
return r0;
}
r0 = !r0 ? a0.isFractionalPremiumWithNoStandardSub() : r0;
return r0;
}
async function _fun58772({promotionId, promotionTitle, partnerId, analyticsLocations}) { // fn#58772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1423, offset: 0x016d69c6, size: 312 bytes, params: 2, frame: 24
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const HTTP = binding(env2_2[10]).HTTP;
const post = HTTP.post;
const object2 = {};
object2.url = env2_12.CLAIM_OUTBOUND_PROMOTION_CODE(promotionId);
object2.rejectWithError = false;
await Reflect.apply(post, HTTP, [object2]);
if (false) {
return undefined;
}
const body = undefined.body;
const isIOS2 = env2_0(env2_2[11]).isIOS();
binding = env2_13;
const r14 = isIOS2 ? binding.IOS : binding.ANDROID;
const value7 = env2_1(env2_2[12]);
const track = value7.track;
const OUTBOUND_PROMOTION_CLAIMED = env2_11.OUTBOUND_PROMOTION_CLAIMED;
Reflect.apply(track, value7, [OUTBOUND_PROMOTION_CLAIMED, {platform: r14, status: undefined.status,
location_stack: analyticsLocations, promotion_id: promotionId, name: promotionTitle ?? null,
partner: partnerId ?? null}]);
return env2_16(body);
}
function _fun58774(a0) { // fn#58774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:1978, offset: 0x016d6c06, size: 99 bytes, params: 2, frame: 15
var r0;
var moduleValue;
const id = a0.id;
let value = id !== consumedInboundPromotionId;
if (value) {
value = environment.__proto__;
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
value = !moduleValue.hasFlag(a0.flags, PromotionFlags.SUPPRESS_NOTIFICATION);
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = !isLogitechPromotion(a0);
r0 = value;
}
return r0;
}
function _fun58775({id}) { // fn#58775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2269, offset: 0x016d6c69, size: 61 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = Reflect.apply((importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare, value, [id,
lastDismissedObjectId]);
return value === 1;
}
function _fun58776(a0) { // fn#58776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:2416, offset: 0x016d6ca6, size: 15 bytes, params: 2, frame: 9
return a0.isRedeemableByTrialUsers();
}
function _fun58789({promotion}) { // fn#58789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4698, offset: 0x016d6ff7, size: 93 bytes, params: 2, frame: 12
var r0;
const binding = env0_0;
let value = binding.has(promotion.id);
if (value) {
r0 = !value;
} else {
value = environment.__proto__;
value = !isRecurringPromotion(promotion);
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = !isLogitechPromotion(promotion);
r0 = value;
}
if (r0) {
value = environment.__proto__;
value = shouldShowOutboundPromotionOnPlatform(promotion);
r0 = value;
}
return r0;
function _fun58788(a0) { // fn#58788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7464:4666, offset: 0x00e46f8c, size: 10 bytes, params: 2, frame: 1
return a0.id;
}
global.__d(_fun58765, 7286, [5, 1348, 7262, 3808, 7064, 7261, 1880, 661, 4237, 4002, 507, 477, 683, 1391, 1365, 21,
1367, 7263, 3802,
2]) /* metro module 7286, dependencies: [5, 1348, 7262, 3808, 7064, 7261, 1880, 661, 4237, 4002, 507, 477, 683, 1391, 1365, 21, 1367, 7263, 3802, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,16 +1,25 @@
/* Metro module 7285; source: modules/premium/promotions/PromotionsHooks.tsx; dependencies: [31, 1878, 7064, 7261, 1880, 566, 7286, 7287, 7288, 3802, 694, 7289, 2] */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import PremiumUtils from '../../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
import UserOfferStore from '../../../stores/billing/UserOfferStore.tsx'; /* Metro dependency 7064 */
import PromotionsStore from './PromotionsStore.tsx'; /* Metro dependency 7261 */
import PromotionsActionCreators from './PromotionsActionCreators.tsx'; /* Metro dependency 7289 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as PremiumConstantsModule from '../PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as PromotionUtilsModule from './PromotionUtils.tsx'; /* Metro dependency 7286 */
import * as PremiumSubscriptionTrialUtilModule from '../PremiumSubscriptionTrialUtil.tsx'; /* Metro dependency 7287 */
import * as ReverseTrialUtilsNativeModule from '../ReverseTrialUtils.native.tsx'; /* Metro dependency 7288 */
function _fun58735(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:6, offset: 0x016d5cc1, size: 228 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = useEligibleActiveOutboundPromotions;
const useEligibleActiveOutboundPromotions2 = useEligibleActiveOutboundPromotions;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const userOfferStore = importDefault(7064) /* metro dependency 7064: UserOfferStore */;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const env0_7 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsHooks.tsx');
exports.useEligibleActiveOutboundPromotions = closure;
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/PromotionsHooks.tsx');
exports.useEligibleActiveOutboundPromotions = useEligibleActiveOutboundPromotions2;
exports.useOutboundPromotions = useOutboundPromotions;
exports.useUnseenOutboundPromotions = useUnseenOutboundPromotions;
exports.useBogoPromotion = function() {
@@ -18,238 +27,240 @@ function _fun58735(global, require, importDefault, importAll, module, exports, d
object.promotion = require(dependencyMap[5]).useStateFromStores([PromotionsStore], _fun58764);
return object;
};
}
function useEligibleActiveOutboundPromotions(a0, a1, a2, a3) { // fn#58736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:159, offset: 0x016d5da5, size: 179 bytes, params: 5, frame: 23
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return a3.useMemo(_fun58739,
[(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore], function() {
return PromotionsStore.outboundPromotions;
}), (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore], function() {
return PromotionsStore.consumedInboundPromotionId;
}), a2, a0, a1, a3]);
}
function useOutboundPromotions() { // fn#58741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:754, offset: 0x016d5f45, size: 564 bytes, params: 1, frame: 26
var r4;
const lastFetchedActivePromotions = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
function() {
return PromotionsStore.lastFetchedActivePromotions;
});
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value2 = (require(7287) /* metro dependency 7287: PremiumSubscriptionTrialUtil */).useHasActiveTrial();
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserOfferStore], function() {
return UserOfferStore.hasAnyUnexpiredOffer();
});
const value4 = (require(7288) /* metro dependency 7288: ReverseTrialUtilsNative */).useIsInReverseTrial();
const defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
const isPremiumExactly = defaultImport.isPremiumExactly;
const TIER_2 = PremiumTypes.TIER_2;
const isPremiumExactly2 = Reflect.apply(isPremiumExactly, defaultImport, [currentUser, TIER_2]);
const isPremium2 = defaultImport.isPremium(currentUser);
let r5 = isPremium2 ? isPremiumExactly2 : !isPremium2;
const claimedOutboundPromotionCodes = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
function() {
return PromotionsStore.claimedOutboundPromotionCodes;
});
const env0_3 = claimedOutboundPromotionCodes;
const claimedOutboundPromotionCodesLoaded = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
function() {
return PromotionsStore.claimedOutboundPromotionCodesLoaded;
});
env0_3.useEffect(_fun58747, [lastFetchedActivePromotions, value4]);
env0_3.useEffect(_fun58749, [lastFetchedActivePromotions, r5, value4]);
env0_3.useEffect(_fun58751, []);
const value6 = env0_3.useMemo(_fun58753, [claimedOutboundPromotionCodes]);
const value7 = useEligibleActiveOutboundPromotions(value2, value3, value4, value6);
const value = env0_3.useMemo(_fun58754, [value7, claimedOutboundPromotionCodes]);
if (claimedOutboundPromotionCodesLoaded) {
r5 = r5 ? lastFetchedActivePromotions != null : !r5;
r5 = !r5 ? value4 : r5;
r4 = r5;
} else {
r4 = claimedOutboundPromotionCodesLoaded;
}
return {promotionsLoaded: r4, activeOutboundPromotions: value7, claimedEndedOutboundPromotions: value,
claimedOutboundPromotionCodeMap: value6};
}
function useUnseenOutboundPromotions() { // fn#58757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2111, offset: 0x016d6428, size: 208 bytes, params: 1, frame: 23
const fluxModule = require(566) /* metro dependency 566: flux */;
let useStateFromStores = fluxModule.useStateFromStores;
const lastSeenOutboundPromotionStartDate = Reflect.apply(useStateFromStores, fluxModule, [[PromotionsStore],
function() {
return PromotionsStore.lastSeenOutboundPromotionStartDate;
}]);
const value2 = (require(7287) /* metro dependency 7287: PremiumSubscriptionTrialUtil */).useHasActiveTrial();
const moduleValue3 = fluxModule;
useStateFromStores = moduleValue3.useStateFromStores;
const value5 = useEligibleActiveOutboundPromotions(value2, Reflect.apply(useStateFromStores, moduleValue3,
[[UserOfferStore], function() {
return UserOfferStore.hasAnyUnexpiredOffer();
}]), (require(7288) /* metro dependency 7288: ReverseTrialUtilsNative */).useIsInReverseTrial(), {});
const binding = env0_3;
const useMemo = binding.useMemo;
return Reflect.apply(useMemo, binding, [_fun58760, [value5, lastSeenOutboundPromotionStartDate]]).filter(_fun58762);
}
function useBogoPromotion() { // fn#58763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2569, offset: 0x016d65a6, size: 64 bytes, params: 1, frame: 14
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
return {promotion: Reflect.apply(useStateFromStores, fluxModule, [[PromotionsStore], function() {
return PromotionsStore.bogoPromotion;
}])};
}
function _fun58739() { // fn#58739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:370, offset: 0x016d5e76, size: 26 bytes, params: 1, frame: 11
return env0_4.filter(_fun58740);
}
function _fun58747() { // fn#58747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1276, offset: 0x016d61cd, size: 70 bytes, params: 1, frame: 11
var environment;
var value;
if (lastFetchedActivePromotions != null || env0_1) {
value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.wait(_fun58748);
}
}
function _fun58749() { // fn#58749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1376, offset: 0x016d6238, size: 45 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun58750);
}
function _fun58751() { // fn#58751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1478, offset: 0x016d62ad, size: 45 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun58752);
}
function _fun58753() { // fn#58753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1575, offset: 0x016d62ff, size: 45 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (require(7286) /* metro dependency 7286: PromotionUtils */).getClaimedOutboundPromotionCodeMap(claimedOutboundPromotionCodes);
}
function _fun58754() { // fn#58754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1691, offset: 0x016d632c, size: 77 bytes, params: 1, frame: 14
const Set = global.Set;
const set = new Set(env0_4.map(function(a0) {
return a0.id;
}));
return claimedOutboundPromotionCodes.filter(_fun58756);
}
function _fun58760() { // fn#58760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2412, offset: 0x016d6507, size: 42 bytes, params: 1, frame: 12
return lastSeenOutboundPromotionStartDate == null ? env0_1 : env0_1.filter(function({startDate}) {
var Date = global.Date;
var value2 = new Date(startDate);
startDate = global.Date;
var lastSeenOutboundPromotionStartDateBinding = lastSeenOutboundPromotionStartDate;
var value4 = Object.create(startDate.prototype, {constructor: {value: startDate}});
var value5 = new startDate(lastSeenOutboundPromotionStartDateBinding);
return value2 > (value5 instanceof Object ? value5 : value4);
});
}
function _fun58762(a0) { // fn#58762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2495, offset: 0x016d657d, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (require(7286) /* metro dependency 7286: PromotionUtils */).shouldShowOutboundPromotionOnPlatform(a0);
}
function _fun58740(a0) { // fn#58740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:384, offset: 0x016d5e90, size: 181 bytes, params: 2, frame: 20
var r4;
var r3;
var r2;
var r1;
var r0;
var value3;
var shouldShowOutboundPromotionOnPlatform2;
var isLogitechPromotion2;
const id = a0.id;
const value = environment.__proto__;
const value2 = id !== consumedInboundPromotionId;
if (value2) {
value3 = environment.__proto__.__proto__;
shouldShowOutboundPromotionOnPlatform2 = (require(7286) /* metro dependency 7286: PromotionUtils */).shouldShowOutboundPromotionOnPlatform(a0);
if (shouldShowOutboundPromotionOnPlatform2) {
if (importDefault) {
r2 = !importDefault;
} else {
isLogitechPromotion2 = (require(7286) /* metro dependency 7286: PromotionUtils */).isLogitechPromotion(a0);
if (isLogitechPromotion2) {
r3 = !isLogitechPromotion2;
function useEligibleActiveOutboundPromotions(a0, a1, a2, a3) { // fn#58736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:159, offset: 0x016d5da5, size: 179 bytes, params: 5, frame: 23
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return a3.useMemo(_fun58739,
[(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore], function() {
return PromotionsStore.outboundPromotions;
}), (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore], function() {
return PromotionsStore.consumedInboundPromotionId;
}), a2, a0, a1, a3]);
function _fun58739() { // fn#58739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:370, offset: 0x016d5e76, size: 26 bytes, params: 1, frame: 11
return env0_4.filter(_fun58740);
function _fun58740(a0) { // fn#58740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:384, offset: 0x016d5e90, size: 181 bytes, params: 2, frame: 20
var r4;
var r3;
var r2;
var r1;
var r0;
var value3;
var shouldShowOutboundPromotionOnPlatform2;
var isLogitechPromotion2;
const id = a0.id;
const value = environment.__proto__;
const value2 = id !== consumedInboundPromotionId;
if (value2) {
value3 = environment.__proto__.__proto__;
shouldShowOutboundPromotionOnPlatform2 = (require(7286) /* metro dependency 7286: PromotionUtils */).shouldShowOutboundPromotionOnPlatform(a0);
if (shouldShowOutboundPromotionOnPlatform2) {
if (importDefault) {
r2 = !importDefault;
} else {
isLogitechPromotion2 = (require(7286) /* metro dependency 7286: PromotionUtils */).isLogitechPromotion(a0);
if (isLogitechPromotion2) {
r3 = !isLogitechPromotion2;
} else {
r4 = !env1_0 && !require;
r4 = !r4 ? (require(7286) /* metro dependency 7286: PromotionUtils */).isTrialUserEligibleToSeeOutboundPromotion(a0,
importAll) : r4;
r3 = r4;
}
r2 = r3;
}
r1 = r2;
} else {
r1 = !!shouldShowOutboundPromotionOnPlatform2;
}
r0 = r1;
} else {
r4 = !env1_0 && !require;
r4 = !r4 ? (require(7286) /* metro dependency 7286: PromotionUtils */).isTrialUserEligibleToSeeOutboundPromotion(a0,
importAll) : r4;
r3 = r4;
r0 = value2;
}
r2 = r3;
return r0;
}
r1 = r2;
} else {
r1 = !!shouldShowOutboundPromotionOnPlatform2;
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function _fun58748() { // fn#58748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1310, offset: 0x016d6213, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
return (importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */).markOutboundPromotionsSeen();
}
function _fun58750() { // fn#58750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1396, offset: 0x016d6265, size: 72 bytes, params: 1, frame: 12
let value = environment.__proto__;
if (env1_2 && (lastFetchedActivePromotions == null || env1_1)) {
value = environment.__proto__.__proto__;
value = importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */;
value.fetchActivePromotions();
}
}
function _fun58752() { // fn#58752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1498, offset: 0x016d62da, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
(importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */).fetchClaimedOutboundPromotionCodes();
}
function _fun58756({promotion}) { // fn#58756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1749, offset: 0x016d6379, size: 175 bytes, params: 2, frame: 14
var r0;
const binding = env0_0;
let value = binding.has(promotion.id);
if (value) {
r0 = !value;
} else {
value = environment.__proto__.__proto__;
value = require(7286) /* metro dependency 7286: PromotionUtils */;
value = value.isRecurringPromotion({promotionType: promotion.promotionType});
value = value === false;
r0 = value;
function useOutboundPromotions() { // fn#58741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:754, offset: 0x016d5f45, size: 564 bytes, params: 1, frame: 26
var r4;
const lastFetchedActivePromotions = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
function() {
return PromotionsStore.lastFetchedActivePromotions;
});
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value2 = (PremiumSubscriptionTrialUtilModule).useHasActiveTrial();
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserOfferStore], function() {
return UserOfferStore.hasAnyUnexpiredOffer();
});
const value4 = (ReverseTrialUtilsNativeModule).useIsInReverseTrial();
const defaultImport = PremiumUtils;
const isPremiumExactly = defaultImport.isPremiumExactly;
const TIER_2 = PremiumTypes.TIER_2;
const isPremiumExactly2 = Reflect.apply(isPremiumExactly, defaultImport, [currentUser, TIER_2]);
const isPremium2 = defaultImport.isPremium(currentUser);
let r5 = isPremium2 ? isPremiumExactly2 : !isPremium2;
const claimedOutboundPromotionCodes = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
function() {
return PromotionsStore.claimedOutboundPromotionCodes;
});
const claimedOutboundPromotionCodes2 = claimedOutboundPromotionCodes;
const claimedOutboundPromotionCodesLoaded = (require(566) /* metro dependency 566: flux */).useStateFromStores([PromotionsStore],
function() {
return PromotionsStore.claimedOutboundPromotionCodesLoaded;
});
claimedOutboundPromotionCodes2.useEffect(_fun58747, [lastFetchedActivePromotions, value4]);
claimedOutboundPromotionCodes2.useEffect(_fun58749, [lastFetchedActivePromotions, r5, value4]);
claimedOutboundPromotionCodes2.useEffect(_fun58751, []);
const value6 = claimedOutboundPromotionCodes2.useMemo(_fun58753, [claimedOutboundPromotionCodes]);
const value7 = useEligibleActiveOutboundPromotions(value2, value3, value4, value6);
const value = claimedOutboundPromotionCodes2.useMemo(_fun58754, [value7, claimedOutboundPromotionCodes]);
if (claimedOutboundPromotionCodesLoaded) {
r5 = r5 ? lastFetchedActivePromotions != null : !r5;
r5 = !r5 ? value4 : r5;
r4 = r5;
} else {
r4 = claimedOutboundPromotionCodesLoaded;
}
return {promotionsLoaded: r4, activeOutboundPromotions: value7, claimedEndedOutboundPromotions: value,
claimedOutboundPromotionCodeMap: value6};
function _fun58747() { // fn#58747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1276, offset: 0x016d61cd, size: 70 bytes, params: 1, frame: 11
var environment;
var value;
if (lastFetchedActivePromotions != null || env0_1) {
value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.wait(_fun58748);
}
function _fun58748() { // fn#58748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1310, offset: 0x016d6213, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
return (PromotionsActionCreators).markOutboundPromotionsSeen();
}
}
function _fun58749() { // fn#58749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1376, offset: 0x016d6238, size: 45 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(Dispatcher).wait(_fun58750);
function _fun58750() { // fn#58750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1396, offset: 0x016d6265, size: 72 bytes, params: 1, frame: 12
let value = environment.__proto__;
if (env1_2 && (lastFetchedActivePromotions == null || env1_1)) {
value = environment.__proto__.__proto__;
value = importDefault(7289) /* metro dependency 7289: PromotionsActionCreators */;
value.fetchActivePromotions();
}
}
}
function _fun58751() { // fn#58751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1478, offset: 0x016d62ad, size: 45 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(Dispatcher).wait(_fun58752);
function _fun58752() { // fn#58752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1498, offset: 0x016d62da, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
(PromotionsActionCreators).fetchClaimedOutboundPromotionCodes();
}
}
function _fun58753() { // fn#58753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1575, offset: 0x016d62ff, size: 45 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (PromotionUtilsModule).getClaimedOutboundPromotionCodeMap(claimedOutboundPromotionCodes);
}
function _fun58754() { // fn#58754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1691, offset: 0x016d632c, size: 77 bytes, params: 1, frame: 14
const Set = global.Set;
const set = new Set(env0_4.map(function(a0) {
return a0.id;
}));
return claimedOutboundPromotionCodes.filter(_fun58756);
function _fun58756({promotion}) { // fn#58756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:1749, offset: 0x016d6379, size: 175 bytes, params: 2, frame: 14
var r0;
const binding = env0_0;
let value = binding.has(promotion.id);
if (value) {
r0 = !value;
} else {
value = environment.__proto__.__proto__;
value = require(7286) /* metro dependency 7286: PromotionUtils */;
value = value.isRecurringPromotion({promotionType: promotion.promotionType});
value = value === false;
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(7286) /* metro dependency 7286: PromotionUtils */;
value = !value.isLogitechPromotion(promotion);
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(7286) /* metro dependency 7286: PromotionUtils */;
value = value.shouldShowOutboundPromotionOnPlatform(promotion);
r0 = value;
}
return r0;
}
}
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(7286) /* metro dependency 7286: PromotionUtils */;
value = !value.isLogitechPromotion(promotion);
r0 = value;
function useUnseenOutboundPromotions() { // fn#58757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2111, offset: 0x016d6428, size: 208 bytes, params: 1, frame: 23
let useStateFromStores = FluxModule.useStateFromStores;
const lastSeenOutboundPromotionStartDate = Reflect.apply(useStateFromStores, FluxModule, [[PromotionsStore],
function() {
return PromotionsStore.lastSeenOutboundPromotionStartDate;
}]);
const value2 = (PremiumSubscriptionTrialUtilModule).useHasActiveTrial();
useStateFromStores = FluxModule.useStateFromStores;
const value5 = useEligibleActiveOutboundPromotions(value2, Reflect.apply(useStateFromStores, FluxModule,
[[UserOfferStore], function() {
return UserOfferStore.hasAnyUnexpiredOffer();
}]), (require(7288) /* metro dependency 7288: ReverseTrialUtilsNative */).useIsInReverseTrial(), {});
const useMemo = ReactModule.useMemo;
return Reflect.apply(useMemo, ReactModule, [_fun58760, [value5, lastSeenOutboundPromotionStartDate]]).filter(_fun58762);
function _fun58760() { // fn#58760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2412, offset: 0x016d6507, size: 42 bytes, params: 1, frame: 12
return lastSeenOutboundPromotionStartDate == null ? env0_1 : env0_1.filter(function({startDate}) {
var Date = global.Date;
var value2 = new Date(startDate);
startDate = global.Date;
var lastSeenOutboundPromotionStartDateBinding = lastSeenOutboundPromotionStartDate;
var value4 = Object.create(startDate.prototype, {constructor: {value: startDate}});
var value5 = new startDate(lastSeenOutboundPromotionStartDateBinding);
return value2 > (value5 instanceof Object ? value5 : value4);
});
}
function _fun58762(a0) { // fn#58762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2495, offset: 0x016d657d, size: 41 bytes, params: 2, frame: 11
const value = environment.__proto__;
return (PromotionUtilsModule).shouldShowOutboundPromotionOnPlatform(a0);
}
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(7286) /* metro dependency 7286: PromotionUtils */;
value = value.shouldShowOutboundPromotionOnPlatform(promotion);
r0 = value;
function useBogoPromotion() { // fn#58763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2569, offset: 0x016d65a6, size: 64 bytes, params: 1, frame: 14
const useStateFromStores = FluxModule.useStateFromStores;
return {promotion: Reflect.apply(useStateFromStores, FluxModule, [[PromotionsStore], function() {
return PromotionsStore.bogoPromotion;
}])};
function _fun58764() { // fn#58764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7463:2646, offset: 0x016d65e6, size: 15 bytes, params: 1, frame: 1
return PromotionsStore.bogoPromotion;
}
}
return r0;
}
global.__d(_fun58735, 7285, [31, 1878, 7064, 7261, 1880, 566, 7286, 7287, 7288, 3802, 694, 7289,
2]) /* metro module 7285, dependencies: [31, 1878, 7064, 7261, 1880, 566, 7286, 7287, 7288, 3802, 694, 7289, 2] */;
@@ -1,144 +1,158 @@
/* 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});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(7) /* metro dependency 7 */;
const env0_6 = importDefault(15) /* metro dependency 15 */;
const env0_7 = importDefault(17) /* metro dependency 17 */;
const env0_8 = importDefault(18) /* metro dependency 18 */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_10 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
const env0_11 = (require(661) /* metro dependency 661: Constants */).EntitlementTypes;
const env0_12 = (require(482) /* metro dependency 482: Constants */).SubscriptionTypes;
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
let value = AutomaticLifecycleManager;
value = _fun121510(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsManager.tsx');
(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 closure = PromotionsManager;
env0_8(closure, a0);
const binding = env0_5;
const env0_0 = env0_3(_fun121515);
return binding(closure, [{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* _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_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__;
(require(7289) /* metro dependency 7289: PromotionsActionCreators */).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);
}
}
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;
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) {
}
value = env3_0(env3_2[11]);
yield value.maybeFetchActiveBogoPromotion();
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] */;
@@ -1,7 +1,19 @@
/* Metro module 7261; source: modules/premium/promotions/PromotionsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1348, 7262, 7264, 7263, 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 UserSettingsProtoStore from '../../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import PromotionRecord from '../../../records/PromotionRecord.tsx'; /* Metro dependency 7262 */
import MarketingComponentRecord from './MarketingComponentRecord.tsx'; /* Metro dependency 7264 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from './constants.tsx'; /* Metro dependency 7263 */
function _fun58330(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6, offset: 0x016c5417, size: 625 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = createEmptyPromotionsByType;
const createEmptyPromotionsByType2 = createEmptyPromotionsByType;
const initializeFromUserSettings_58336 = function() {
var r3;
var property = UserSettingsProtoStore.settings.userContent;
@@ -13,21 +25,13 @@ function _fun58330(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const promotionRecord = importDefault(7262) /* metro dependency 7262: PromotionRecord */;
const marketingComponentRecord = importDefault(7264) /* metro dependency 7264: MarketingComponentRecord */;
const env0_10 = {'hasFetchedConsumedInboundPromotionId': false, 'consumedInboundPromotionId': null,
'lastSeenOutboundPromotionStartDate': null};
let env0_16 = closure();
let env0_16 = createEmptyPromotionsByType2();
let Map = global.Map;
let map = new Map();
let env0_19 = [];
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
const PersistedStore = (Flux).PersistedStore;
map = _fun58337(PersistedStore);
map.displayName = 'PromotionsStore';
map.persistKey = 'PromotionsPersistedStore';
@@ -76,325 +80,382 @@ function _fun58330(global, require, importDefault, importAll, module, exports, d
env0_20 = true;
}, CLAIMED_OUTBOUND_PROMOTION_CODE_ADD: CLAIMED_OUTBOUND_PROMOTION_CODE_ADD, LOGOUT: LOGOUT_58382,
PREMIUM_MARKETING_PREVIEW: PREMIUM_MARKETING_PREVIEW});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/PromotionsStore.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/PromotionsStore.tsx');
exports.default = map;
}
function _isNativeReflectConstruct_58331() { // fn#58331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:178, offset: 0x016c5688, 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_58331_isNativeReflectConstruct = function() {
return !!result;
})();
}
function createEmptyPromotionsByType() { // fn#58334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:491, offset: 0x016c56e6, size: 244 bytes, params: 1, frame: 15
const {THIRD_PARTY, BOGO, THIRD_PARTY_DIRECT_FULFILLMENT, MARKETING_MOMENT, THIRD_PARTY_INBOUND,
THIRD_PARTY_OUTBOUND, GIFT_PROMOTION,
THIRD_PARTY_OUTBOUND_RECURRING} = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
return {[THIRD_PARTY]: {}, [BOGO]: {}, [THIRD_PARTY_DIRECT_FULFILLMENT]: {}, [MARKETING_MOMENT]: {},
[THIRD_PARTY_INBOUND]: {}, [THIRD_PARTY_OUTBOUND]: {}, [GIFT_PROMOTION]: {},
[THIRD_PARTY_OUTBOUND_RECURRING]: {}};
}
function getLatestActiveOutboundPromotionStartDate() { // fn#58335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1008, offset: 0x016c57da, size: 161 bytes, params: 1, frame: 17
var r4;
var r5;
var r7;
var r3;
var property;
var value5;
var startDate;
var value6;
var value7;
const Object = global.Object;
const values = Object.values;
const binding = env0_16;
const value = undefined;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
const value2 = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]);
let length = value2.length;
const value3 = 0;
const value4 = null;
if (value3 < length) {
r4 = value4;
r5 = value3;
while (true) {
property = value2[r5];
value5 = value4 == r4;
if (value5) {
r7 = value5;
} else {
value6 = property.startDate > r4;
r7 = value6;
}
if (!r7) {
continue;
}
startDate = property.startDate;
r4 = startDate;
value7 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
length = value2.length;
if (value7 < length) {
r5 = value7;
continue;
}
r3 = r4;
break;
function _isNativeReflectConstruct_58331() { // fn#58331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:178, offset: 0x016c5688, 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) {
}
} else {
r3 = value4;
return (_isNativeReflectConstruct_58331_isNativeReflectConstruct = function() {
return !!result;
})();
}
const r1 = value4 == r3 ? value : r3.toISOString();
return value4 != r1 ? r1 : value4;
}
function _fun58337(a0) { // fn#58337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1448, offset: 0x016c58c1, size: 617 bytes, params: 2, frame: 16
const closure = PromotionsStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: value_58339}, {key: 'outboundPromotions', get: get_58340},
{key: 'outboundRecurringPromotions', get: get_58341}, {key: 'lastSeenOutboundPromotionStartDate',
get: get_58342}, {key: 'lastDismissedOutboundPromotionStartDate', get: get_58343},
{key: 'lastFetchedActivePromotions', get: get_58344}, {key: 'isFetchingActivePromotions', get: get_58345},
{key: 'hasFetchedConsumedInboundPromotionId', get: get_58346}, {key: 'consumedInboundPromotionId',
get: get_58347}, {key: 'bogoPromotion', get: get_58348}, {key: 'isFetchingActiveBogoPromotion', get: get_58349},
{key: 'lastFetchedActiveBogoPromotion', get: get_58350}, {key: 'promotionsByType', get: get_58351},
{key: 'getPromotionByTypeAndId', value: value_58352}, {key: 'getPromotionByTypeAndKey', value: value_58353},
{key: 'getState', value: value_58355}, {key: 'getMarketingComponentByType', value: value_58356},
{key: 'getPromotionsByPartner', value: value_58357}, {key: 'getGiftPromotion', value: value_58360},
{key: 'getGiftPromotionRewardSkuIds', value: function() {
var r0;
r0 = this.getGiftPromotion()?.rewardSkuIds;
r0 = r0 ?? [];
return r0;
}}, {key: 'getMarketingMomentPromotion', value: value_58362}, {key: 'getMarketingMomentRewardSkuIds',
value: function() {
var r0;
r0 = this.getMarketingMomentPromotion()?.rewardSkuIds;
r0 = r0 ?? [];
return r0;
}}, {key: 'claimedOutboundPromotionCodes', get: get_58364}, {key: 'claimedOutboundPromotionCodesLoaded',
get: get_58365}]);
}
function ACTIVE_PROMOTIONS_FETCH_SUCCESS({promotions, consumedInboundPromotionId}) { // fn#58367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4393, offset: 0x016c5eab, size: 143 bytes, params: 2, frame: 15
env0_16 = createEmptyPromotionsByType();
const Map = global.Map;
const map = new Map();
promotions.forEach(_fun58368);
const Date = global.Date;
env0_15 = Date.now();
if (!env0_10.hasFetchedConsumedInboundPromotionId) {
env0_10.hasFetchedConsumedInboundPromotionId = true;
env0_10.consumedInboundPromotionId = consumedInboundPromotionId;
function createEmptyPromotionsByType() { // fn#58334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:491, offset: 0x016c56e6, size: 244 bytes, params: 1, frame: 15
const {THIRD_PARTY, BOGO, THIRD_PARTY_DIRECT_FULFILLMENT, MARKETING_MOMENT, THIRD_PARTY_INBOUND,
THIRD_PARTY_OUTBOUND, GIFT_PROMOTION,
THIRD_PARTY_OUTBOUND_RECURRING} = (ConstantsModule).PromotionTypes;
return {[THIRD_PARTY]: {}, [BOGO]: {}, [THIRD_PARTY_DIRECT_FULFILLMENT]: {}, [MARKETING_MOMENT]: {},
[THIRD_PARTY_INBOUND]: {}, [THIRD_PARTY_OUTBOUND]: {}, [GIFT_PROMOTION]: {},
[THIRD_PARTY_OUTBOUND_RECURRING]: {}};
}
}
function OUTBOUND_PROMOTION_NOTICE_DISMISS() { // fn#58376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:5567, offset: 0x016c60b7, size: 98 bytes, params: 1, frame: 15
const Object = global.Object;
const values = Object.values;
const binding = env0_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
if (Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).length === 0) {
return false;
function getLatestActiveOutboundPromotionStartDate() { // fn#58335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1008, offset: 0x016c57da, size: 161 bytes, params: 1, frame: 17
var r4;
var r5;
var r7;
var r3;
var property;
var value5;
var startDate;
var value6;
var value7;
const Object = global.Object;
const values = Object.values;
const binding = env0_16;
const value = undefined;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
const value2 = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]);
let length = value2.length;
const value3 = 0;
const value4 = null;
if (value3 < length) {
r4 = value4;
r5 = value3;
while (true) {
property = value2[r5];
value5 = value4 == r4;
if (value5) {
r7 = value5;
} else {
value6 = property.startDate > r4;
r7 = value6;
}
if (!r7) {
continue;
}
startDate = property.startDate;
r4 = startDate;
value7 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
length = value2.length;
if (value7 < length) {
r5 = value7;
continue;
}
r3 = r4;
break;
}
} else {
r3 = value4;
}
const r1 = value4 == r3 ? value : r3.toISOString();
return value4 != r1 ? r1 : value4;
}
if (getLatestActiveOutboundPromotionStartDate() == null) {
function _fun58337(a0) { // fn#58337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1448, offset: 0x016c58c1, size: 617 bytes, params: 2, frame: 16
const PromotionsStore2 = PromotionsStore;
Inherits(PromotionsStore2, a0);
return CreateClass(PromotionsStore2, [{key: 'initialize', value: value_58339}, {key: 'outboundPromotions',
get: get_58340}, {key: 'outboundRecurringPromotions', get: get_58341},
{key: 'lastSeenOutboundPromotionStartDate', get: get_58342}, {key: 'lastDismissedOutboundPromotionStartDate',
get: get_58343}, {key: 'lastFetchedActivePromotions', get: get_58344}, {key: 'isFetchingActivePromotions',
get: get_58345}, {key: 'hasFetchedConsumedInboundPromotionId', get: get_58346},
{key: 'consumedInboundPromotionId', get: get_58347}, {key: 'bogoPromotion', get: get_58348},
{key: 'isFetchingActiveBogoPromotion', get: get_58349}, {key: 'lastFetchedActiveBogoPromotion', get: get_58350},
{key: 'promotionsByType', get: get_58351}, {key: 'getPromotionByTypeAndId', value: value_58352},
{key: 'getPromotionByTypeAndKey', value: value_58353}, {key: 'getState', value: value_58355},
{key: 'getMarketingComponentByType', value: value_58356}, {key: 'getPromotionsByPartner', value: value_58357},
{key: 'getGiftPromotion', value: value_58360}, {key: 'getGiftPromotionRewardSkuIds', value: function() {
var r0;
r0 = this.getGiftPromotion()?.rewardSkuIds;
r0 = r0 ?? [];
return r0;
}}, {key: 'getMarketingMomentPromotion', value: value_58362}, {key: 'getMarketingMomentRewardSkuIds',
value: function() {
var r0;
r0 = this.getMarketingMomentPromotion()?.rewardSkuIds;
r0 = r0 ?? [];
return r0;
}}, {key: 'claimedOutboundPromotionCodes', get: get_58364}, {key: 'claimedOutboundPromotionCodesLoaded',
get: get_58365}]);
function PromotionsStore() { // fn#58338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1460, offset: 0x0123c182, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, PromotionsStore);
const value3 = env1_5(PromotionsStore);
return env1_4(this, _isNativeReflectConstruct_58331() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function value_58339(a0) { // fn#58339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1753, offset: 0x016c5b2a, size: 69 bytes, params: 2, frame: 14
var value;
if (a0 != null) {
value = environment.__proto__;
env1_10 = a0;
}
this.waitFor(UserSettingsProtoStore);
this.syncWith([UserSettingsProtoStore], initializeFromUserSettings_58336);
}
function get_58340() { // fn#58340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1874, offset: 0x016c5b6f, size: 65 bytes, params: 1, frame: 14
const Object = global.Object;
const values = Object.values;
const binding = env1_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
return Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]);
}
function get_58341() { // fn#58341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1995, offset: 0x016c5bb0, size: 65 bytes, params: 1, frame: 14
const Object = global.Object;
const values = Object.values;
const binding = env1_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
return Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND_RECURRING]]);
}
function get_58342() { // fn#58342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2133, offset: 0x016c5bf1, size: 15 bytes, params: 1, frame: 1
return env1_10.lastSeenOutboundPromotionStartDate;
}
function get_58343() { // fn#58343, offset: 0x00e07553, size: 9 bytes, params: 1, frame: 1
return env1_17;
}
function get_58344() { // fn#58344, offset: 0x00df0e8b, size: 9 bytes, params: 1, frame: 1
return env1_15;
}
function get_58345() { // fn#58345, offset: 0x00df0f5a, size: 9 bytes, params: 1, frame: 1
return env1_14;
}
function get_58346() { // fn#58346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2432, offset: 0x016c5c00, size: 15 bytes, params: 1, frame: 1
return env1_10.hasFetchedConsumedInboundPromotionId;
}
function get_58347() { // fn#58347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2529, offset: 0x016c5c0f, size: 15 bytes, params: 1, frame: 1
return env1_10.consumedInboundPromotionId;
}
function get_58348() { // fn#58348, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1
return env1_11;
}
function get_58349() { // fn#58349, offset: 0x00e2f9de, size: 9 bytes, params: 1, frame: 1
return env1_12;
}
function get_58350() { // fn#58350, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1
return env1_13;
}
function get_58351() { // fn#58351, offset: 0x00df0e94, size: 9 bytes, params: 1, frame: 1
return env1_16;
}
function value_58352(a0, a1) { // fn#58352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2839, offset: 0x016c5c1e, size: 34 bytes, params: 3, frame: 3
const value = environment.__proto__;
return env1_16[a0]?.[a1];
}
function value_58353(a0, a1) { // fn#58353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2933, offset: 0x016c5c40, size: 59 bytes, params: 3, frame: 13
var environment;
const env0_0 = a1;
const Object = global.Object;
const values = Object.values;
const value = environment.__proto__;
return Reflect.apply(values, Object, [env1_16[a0]]).find(function({promotionKey}) {
return promotionKey === require;
});
}
function value_58355() { // fn#58355, offset: 0x00fbd9ec, size: 9 bytes, params: 1, frame: 1
return env1_10;
}
function value_58356(a0) { // fn#58356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3091, offset: 0x016c5c91, size: 34 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = env1_18.get(a0);
const value2 = null;
return value2 != value ? value : value2;
}
function value_58357(a0) { // fn#58357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3180, offset: 0x016c5cb3, size: 165 bytes, params: 2, frame: 20
var environment;
const env0_0 = a0;
const object = {};
let Object = global.Object;
let values = Object.values;
const value = environment.__proto__;
let binding = env1_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
object.oneTime = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).filter(_fun58358);
Object = global.Object;
values = Object.values;
binding = env1_16;
const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
object.recurring = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND_RECURRING]]).filter(_fun58359);
return object;
function _fun58358({partnerId}) { // fn#58358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3277, offset: 0x016c5d58, size: 22 bytes, params: 2, frame: 2
return partnerId === env0_0;
}
function _fun58359({partnerId}) { // fn#58359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3388, offset: 0x016c5d58, size: 22 bytes, params: 2, frame: 2
return partnerId === env0_0;
}
}
function value_58360() { // fn#58360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3442, offset: 0x016c5d6e, size: 86 bytes, params: 1, frame: 13
let value = environment.__proto__;
const binding = env1_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const GIFT_PROMOTION = PromotionTypes.GIFT_PROMOTION;
const property = binding[GIFT_PROMOTION];
const Object = global.Object;
value = Object.keys(property);
return value.length === 0 ? null : property[value[0]];
}
function value_58362() { // fn#58362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3734, offset: 0x016c5dec, size: 132 bytes, params: 1, frame: 13
let value = environment.__proto__;
const binding = env1_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const MARKETING_MOMENT = PromotionTypes.MARKETING_MOMENT;
let property = binding[MARKETING_MOMENT];
const Object = global.Object;
value = Object.keys(property);
if (value.length === 0) {
return null;
}
property = property[value[0]];
const endDate = property.endDate;
const Date = global.Date;
let date = new Date();
date = null;
return endDate < date ? date : property;
}
function get_58364() { // fn#58364, offset: 0x00d406a2, size: 9 bytes, params: 1, frame: 1
return env1_19;
}
function get_58365() { // fn#58365, offset: 0x00e4253a, size: 9 bytes, params: 1, frame: 1
return env1_20;
}
}
}
function OUTBOUND_PROMOTIONS_SEEN() { // fn#58377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:5791, offset: 0x016c6119, size: 108 bytes, params: 1, frame: 15
const Object = global.Object;
const values = Object.values;
const binding = env0_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
if (Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).length === 0) {
return false;
function ACTIVE_PROMOTIONS_FETCH_SUCCESS({promotions, consumedInboundPromotionId}) { // fn#58367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4393, offset: 0x016c5eab, size: 143 bytes, params: 2, frame: 15
env0_16 = createEmptyPromotionsByType();
const Map = global.Map;
const map = new Map();
promotions.forEach(_fun58368);
const Date = global.Date;
env0_15 = Date.now();
if (!env0_10.hasFetchedConsumedInboundPromotionId) {
env0_10.hasFetchedConsumedInboundPromotionId = true;
env0_10.consumedInboundPromotionId = consumedInboundPromotionId;
}
function _fun58368(a0) { // fn#58368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4535, offset: 0x016c5f3a, size: 77 bytes, params: 2, frame: 12
env1_16[a0.promotion_type][a0.id] = PromotionRecord.createFromServer(a0);
const marketing_components = a0.marketing_components;
if (marketing_components != null) {
marketing_components.forEach(_fun58369);
}
function _fun58369(a0) { // fn#58369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4642, offset: 0x016c5f87, size: 46 bytes, params: 2, frame: 15
const binding = env2_18;
const set = binding.set;
const component_type = a0.component_type;
const marketingComponentRecordBinding = MarketingComponentRecord;
Reflect.apply(set, binding, [component_type, marketingComponentRecordBinding.createFromServer(a0)]);
}
}
}
const latestActiveOutboundPromotionStartDate = getLatestActiveOutboundPromotionStartDate();
if (latestActiveOutboundPromotionStartDate != null) {
env0_10.lastSeenOutboundPromotionStartDate = latestActiveOutboundPromotionStartDate;
function OUTBOUND_PROMOTION_NOTICE_DISMISS() { // fn#58376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:5567, offset: 0x016c60b7, size: 98 bytes, params: 1, frame: 15
const Object = global.Object;
const values = Object.values;
const binding = env0_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
if (Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).length === 0) {
return false;
}
if (getLatestActiveOutboundPromotionStartDate() == null) {
}
}
}
function CLAIMED_OUTBOUND_PROMOTION_CODE_ADD({claimedOutboundPromotionCode}) { // fn#58380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6317, offset: 0x016c61b4, size: 82 bytes, params: 2, frame: 15
const binding = env0_19;
if (binding.some(function(a0) {
return a0.promotion.id === claimedOutboundPromotionCode.promotion.id;
})) {
return false;
function OUTBOUND_PROMOTIONS_SEEN() { // fn#58377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:5791, offset: 0x016c6119, size: 108 bytes, params: 1, frame: 15
const Object = global.Object;
const values = Object.values;
const binding = env0_16;
const PromotionTypes = (ConstantsModule).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
if (Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).length === 0) {
return false;
}
const latestActiveOutboundPromotionStartDate = getLatestActiveOutboundPromotionStartDate();
if (latestActiveOutboundPromotionStartDate != null) {
env0_10.lastSeenOutboundPromotionStartDate = latestActiveOutboundPromotionStartDate;
}
}
const binding2 = env0_19;
const items2 = [];
const value2 = arraySpread(items2, binding2, 0, binding);
items2[value2] = claimedOutboundPromotionCode;
value2 + 1;
}
function LOGOUT_58382() { // fn#58382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6478, offset: 0x016c622c, size: 87 bytes, params: 1, frame: 12
env0_10 = {'hasFetchedConsumedInboundPromotionId': false, 'consumedInboundPromotionId': null,
'lastSeenOutboundPromotionStartDate': null};
env0_16 = createEmptyPromotionsByType();
env0_18.clear();
env0_19 = [];
}
function PREMIUM_MARKETING_PREVIEW({data}) { // fn#58383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6728, offset: 0x016c6283, size: 51 bytes, params: 2, frame: 13
const fromServer = MarketingComponentRecord.createFromServer(data);
const binding = env0_18;
binding.set(fromServer.componentType, fromServer);
}
function value_58339(a0) { // fn#58339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1753, offset: 0x016c5b2a, size: 69 bytes, params: 2, frame: 14
var value;
if (a0 != null) {
value = environment.__proto__;
env1_10 = a0;
function CLAIMED_OUTBOUND_PROMOTION_CODE_ADD({claimedOutboundPromotionCode}) { // fn#58380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6317, offset: 0x016c61b4, size: 82 bytes, params: 2, frame: 15
const binding = env0_19;
if (binding.some(function(a0) {
return a0.promotion.id === claimedOutboundPromotionCode.promotion.id;
})) {
return false;
}
const binding2 = env0_19;
const items2 = [];
const value2 = arraySpread(items2, binding2, 0, binding);
items2[value2] = claimedOutboundPromotionCode;
value2 + 1;
}
this.waitFor(UserSettingsProtoStore);
this.syncWith([UserSettingsProtoStore], initializeFromUserSettings_58336);
}
function get_58340() { // fn#58340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1874, offset: 0x016c5b6f, size: 65 bytes, params: 1, frame: 14
const Object = global.Object;
const values = Object.values;
const binding = env1_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
return Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]);
}
function get_58341() { // fn#58341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:1995, offset: 0x016c5bb0, size: 65 bytes, params: 1, frame: 14
const Object = global.Object;
const values = Object.values;
const binding = env1_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
return Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND_RECURRING]]);
}
function get_58342() { // fn#58342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2133, offset: 0x016c5bf1, size: 15 bytes, params: 1, frame: 1
return env1_10.lastSeenOutboundPromotionStartDate;
}
function get_58346() { // fn#58346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2432, offset: 0x016c5c00, size: 15 bytes, params: 1, frame: 1
return env1_10.hasFetchedConsumedInboundPromotionId;
}
function get_58347() { // fn#58347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2529, offset: 0x016c5c0f, size: 15 bytes, params: 1, frame: 1
return env1_10.consumedInboundPromotionId;
}
function value_58352(a0, a1) { // fn#58352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2839, offset: 0x016c5c1e, size: 34 bytes, params: 3, frame: 3
const value = environment.__proto__;
return env1_16[a0]?.[a1];
}
function value_58353(a0, a1) { // fn#58353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:2933, offset: 0x016c5c40, size: 59 bytes, params: 3, frame: 13
var environment;
const env0_0 = a1;
const Object = global.Object;
const values = Object.values;
const value = environment.__proto__;
return Reflect.apply(values, Object, [env1_16[a0]]).find(function({promotionKey}) {
return promotionKey === require;
});
}
function value_58356(a0) { // fn#58356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3091, offset: 0x016c5c91, size: 34 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = env1_18.get(a0);
const value2 = null;
return value2 != value ? value : value2;
}
function value_58357(a0) { // fn#58357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3180, offset: 0x016c5cb3, size: 165 bytes, params: 2, frame: 20
var environment;
const env0_0 = a0;
const object2 = {};
let Object = global.Object;
let values = Object.values;
const value = environment.__proto__;
let binding = env1_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const THIRD_PARTY_OUTBOUND = PromotionTypes.THIRD_PARTY_OUTBOUND;
object2.oneTime = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND]]).filter(_fun58358);
Object = global.Object;
values = Object.values;
binding = env1_16;
const THIRD_PARTY_OUTBOUND_RECURRING = PromotionTypes.THIRD_PARTY_OUTBOUND_RECURRING;
object2.recurring = Reflect.apply(values, Object, [binding[THIRD_PARTY_OUTBOUND_RECURRING]]).filter(_fun58359);
return object2;
}
function value_58360() { // fn#58360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3442, offset: 0x016c5d6e, size: 86 bytes, params: 1, frame: 13
let value = environment.__proto__;
const binding = env1_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const GIFT_PROMOTION = PromotionTypes.GIFT_PROMOTION;
const property = binding[GIFT_PROMOTION];
const Object = global.Object;
value = Object.keys(property);
return value.length === 0 ? null : property[value[0]];
}
function value_58362() { // fn#58362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3734, offset: 0x016c5dec, size: 132 bytes, params: 1, frame: 13
let value = environment.__proto__;
const binding = env1_16;
const PromotionTypes = (require(7263) /* metro dependency 7263: constants */).PromotionTypes;
const MARKETING_MOMENT = PromotionTypes.MARKETING_MOMENT;
let property = binding[MARKETING_MOMENT];
const Object = global.Object;
value = Object.keys(property);
if (value.length === 0) {
return null;
function LOGOUT_58382() { // fn#58382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6478, offset: 0x016c622c, size: 87 bytes, params: 1, frame: 12
env0_10 = {'hasFetchedConsumedInboundPromotionId': false, 'consumedInboundPromotionId': null,
'lastSeenOutboundPromotionStartDate': null};
env0_16 = createEmptyPromotionsByType();
env0_18.clear();
env0_19 = [];
}
property = property[value[0]];
const endDate = property.endDate;
const Date = global.Date;
let date = new Date();
date = null;
return endDate < date ? date : property;
}
function _fun58368(a0) { // fn#58368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4535, offset: 0x016c5f3a, size: 77 bytes, params: 2, frame: 12
env1_16[a0.promotion_type][a0.id] = PromotionRecord.createFromServer(a0);
const marketing_components = a0.marketing_components;
if (marketing_components != null) {
marketing_components.forEach(_fun58369);
function PREMIUM_MARKETING_PREVIEW({data}) { // fn#58383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:6728, offset: 0x016c6283, size: 51 bytes, params: 2, frame: 13
const fromServer = MarketingComponentRecord.createFromServer(data);
const binding = env0_18;
binding.set(fromServer.componentType, fromServer);
}
}
function _fun58358({partnerId}) { // fn#58358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:3277, offset: 0x016c5d58, size: 22 bytes, params: 2, frame: 2
return partnerId === env0_0;
}
function _fun58369(a0) { // fn#58369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7439:4642, offset: 0x016c5f87, size: 46 bytes, params: 2, frame: 15
const binding = env2_18;
binding.set(a0.component_type, MarketingComponentRecord.createFromServer(a0));
}
global.__d(_fun58330, 7261, [6, 7, 15, 17, 18, 1348, 7262, 7264, 7263, 566, 694,
2]) /* metro module 7261, dependencies: [6, 7, 15, 17, 18, 1348, 7262, 7264, 7263, 566, 694, 2] */;
@@ -1,26 +1,28 @@
/* Metro module 7263; source: modules/premium/promotions/constants.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun58396(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7441:6, offset: 0x016c6ae9, size: 378 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const object = {THIRD_PARTY: 0};
object[0] = 'THIRD_PARTY';
object.BOGO = 1;
object[1] = 'BOGO';
object.THIRD_PARTY_DIRECT_FULFILLMENT = 2;
object[2] = 'THIRD_PARTY_DIRECT_FULFILLMENT';
object.THIRD_PARTY_INBOUND = 3;
object[3] = 'THIRD_PARTY_INBOUND';
object.THIRD_PARTY_OUTBOUND = 4;
object[4] = 'THIRD_PARTY_OUTBOUND';
object.MARKETING_MOMENT = 5;
object[5] = 'MARKETING_MOMENT';
object.GIFT_PROMOTION = 6;
object[6] = 'GIFT_PROMOTION';
object.THIRD_PARTY_OUTBOUND_RECURRING = 7;
object[7] = 'THIRD_PARTY_OUTBOUND_RECURRING';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/constants.tsx');
const object2 = {THIRD_PARTY: 0};
object2[0] = 'THIRD_PARTY';
object2.BOGO = 1;
object2[1] = 'BOGO';
object2.THIRD_PARTY_DIRECT_FULFILLMENT = 2;
object2[2] = 'THIRD_PARTY_DIRECT_FULFILLMENT';
object2.THIRD_PARTY_INBOUND = 3;
object2[3] = 'THIRD_PARTY_INBOUND';
object2.THIRD_PARTY_OUTBOUND = 4;
object2[4] = 'THIRD_PARTY_OUTBOUND';
object2.MARKETING_MOMENT = 5;
object2[5] = 'MARKETING_MOMENT';
object2.GIFT_PROMOTION = 6;
object2[6] = 'GIFT_PROMOTION';
object2.THIRD_PARTY_OUTBOUND_RECURRING = 7;
object2[7] = 'THIRD_PARTY_OUTBOUND_RECURRING';
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/constants.tsx');
exports.CountryListMode = {BLOCKLIST: 'blocklist', ALLOWLIST: 'allowlist'};
exports.PromotionTypes = object;
exports.PromotionTypes = object2;
exports.RECURRING_PARTNERS = {steelseries: {'id': 'steelseries', 'label': 'SteelSeries'},
kontrolfreek: {'id': 'kontrolfreek', 'label': 'KontrolFreek'}, logitech: {'id': 'logitech',
'label': 'Logitech'}};
@@ -31,3 +33,4 @@ function _fun58396(global, require, importDefault, importAll, module, exports, d
exports.YOUTUBE_PARTNER_ID = 'youtube';
}
global.__d(_fun58396, 7263, [2]) /* metro module 7263, dependencies: [2] */;
@@ -1,109 +1,155 @@
/* Metro module 15282; source: modules/premium/promotions/native/BogoPromotionActionSheet.tsx; dependencies: [31, 27, 4502, 1880, 661, 1376, 33, 4501, 697, 6771, 566, 7040, 6275, 5475, 4573, 1244, 6766, 1948, 4578, 7954, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import HelpdeskUtils from '../../../../utils/HelpdeskUtils.tsx'; /* Metro dependency 1948 */
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import FastImage from '../../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */
import UseAnalyticsLocations from '../../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import OpenPremiumPlanSelectionActionSheet from '../../native/openPremiumPlanSelectionActionSheet.tsx'; /* Metro dependency 7040 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as DismissibleContentConstantsModule from '../../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
import * as PremiumConstantsModule from '../../PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as BottomSheetNativeModule from '../../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as TextWithIOSLinkWorkaroundModule from '../../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
import * as NitroWheelIconModule from '../../../../design/components/Icon/native/redesign/generated/NitroWheelIcon.tsx'; /* Metro dependency 7954 */
function _fun116900(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:6, offset: 0x0249a932, size: 581 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
let value = require(661) /* metro dependency 661: Constants */;
let value = ConstantsModule;
const env0_7 = value.AnalyticsSections;
const env0_8 = value.AnalyticsObjects;
const env0_9 = value.AnalyticsPages;
const env0_10 = value.AnalyticsObjectTypes;
const env0_11 = value.HelpdeskArticles;
const env0_12 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
value = require(33) /* metro dependency 33 */;
const env0_13 = value.jsx;
const env0_14 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {};
const object4 = {'dipslay': 'flex', 'flexDirection': 'column', 'justifyContent': 'center', 'alignItems': 'center'};
object = {};
const object2 = {'dipslay': 'flex', 'flexDirection': 'column', 'justifyContent': 'center', 'alignItems': 'center'};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.padding = PX_16;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.padding = PX_16;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object4.marginBottom = PX_24;
object3.container = object4;
object2.marginBottom = PX_24;
object.container = object2;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.buttonContainer = {'marginTop': null, 'width': 335, 'height': 48, marginTop: PX_24};
object3.header = {'marginBottom': 12, 'textAlign': 'center'};
object3.subheader = {textAlign: 'center'};
const object6 = {'alignSelf': 'center', 'paddingBottom': null, 'height': 213, 'width': 335, 'borderRadius': null,
object.buttonContainer = {'marginTop': null, 'width': 335, 'height': 48, marginTop: PX_24};
object.header = {'marginBottom': 12, 'textAlign': 'center'};
object.subheader = {textAlign: 'center'};
const object5 = {'alignSelf': 'center', 'paddingBottom': null, 'height': 213, 'width': 335, 'borderRadius': null,
'marginBottom': 12};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.paddingBottom = PX_16;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.image = object6;
object3.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
const env0_15 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/native/BogoPromotionActionSheet.tsx');
object5.paddingBottom = PX_16;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.image = object5;
object.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
const env0_15 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/native/BogoPromotionActionSheet.tsx');
exports.default = BogoPromotionActionSheet;
}
function BogoPromotionActionSheet({markAsDismissed}) { // fn#116901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:969, offset: 0x0249ab77, size: 784 bytes, params: 2, frame: 33
const styles = useStyles();
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const binding = env0_3;
const value2 = binding.useCallback(_fun116903, [analyticsLocations, markAsDismissed]);
const value3 = binding.useCallback(function() {
markAsDismissed(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed]);
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const items7 = [styles.container];
const items2 = [((Component) => <Component source={{uri: 'https://cdn.discordapp.com/assets/content/a59aed2e0e61a955dc3e0f4f6f7ab295e39f89a93c4f01e4bd84ed7fb418ec63.png'}} style={styles.image} />)(importDefault(5475) /* metro dependency 5475: FastImage */)];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const items3 = [styles.header];
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = <Text style={items3} color="mobile-text-heading-primary" variant="heading-xl/bold">{Reflect.apply(string,
intl, [(require(1244) /* metro dependency 1244: indexNative */).t['6Jjfk8']])}</Text>;
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
const items4 = [styles.subheader];
const format = intl.format;
const y7lJK6 = (require(1244) /* metro dependency 1244: indexNative */).t.y7lJK6;
const defaultImport2 = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
const getArticleURL = defaultImport2.getArticleURL;
const SUMMER_BOGO_2025 = HelpdeskArticles.SUMMER_BOGO_2025;
items2[2] = <TextWithIOSLinkWorkaround style={items4} color="text-subtle" variant="text-md/medium">{Reflect.apply(format,
intl, [y7lJK6, {helpCenterLink: Reflect.apply(getArticleURL, defaultImport2,
[SUMMER_BOGO_2025])}])}</TextWithIOSLinkWorkaround>;
const items5 = [styles.buttonContainer];
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
const J61px0 = (require(1244) /* metro dependency 1244: indexNative */).t.J61px0;
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
const items6 = [styles.nitroWheelIcon];
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
items2[3] = <View style={items5}><Button text={Reflect.apply(string, intl,
[J61px0])} size="lg" onPress={value2} icon={<NitroWheelIcon style={items6} color={WHITE} size="custom" />} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} /></View>;
return (
<BottomSheet onDismiss={value3}>
<View style={items7}>
{items2}
function BogoPromotionActionSheet({markAsDismissed}) { // fn#116901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:969, offset: 0x0249ab77, size: 784 bytes, params: 2, frame: 33
const styles = useStyles();
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const value2 = ReactModule.useCallback(_fun116903, [analyticsLocations, markAsDismissed]);
const value3 = ReactModule.useCallback(function() {
markAsDismissed(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed]);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const items7 = [styles.container];
const items2 = [
((Component) => <Component source={{uri: 'https://cdn.discordapp.com/assets/content/a59aed2e0e61a955dc3e0f4f6f7ab295e39f89a93c4f01e4bd84ed7fb418ec63.png'}} style={styles.image} />)(FastImage),
];
const Text = (TextModule).Text;
const items3 = [styles.header];
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = (
<Text
style={items3}
color="mobile-text-heading-primary"
variant="heading-xl/bold"
>
{Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t['6Jjfk8']])}
</Text>
);
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
const items4 = [styles.subheader];
const format = intl.format;
const y7lJK6 = (require(1244) /* metro dependency 1244: indexNative */).t.y7lJK6;
const defaultImport2 = HelpdeskUtils;
const getArticleURL = defaultImport2.getArticleURL;
const SUMMER_BOGO_2025 = HelpdeskArticles.SUMMER_BOGO_2025;
items2[2] = (
<TextWithIOSLinkWorkaround
style={items4}
color="text-subtle"
variant="text-md/medium"
>
{Reflect.apply(format, intl, [y7lJK6, {helpCenterLink: Reflect.apply(getArticleURL, defaultImport2,
[SUMMER_BOGO_2025])}])}
</TextWithIOSLinkWorkaround>
);
const items5 = [styles.buttonContainer];
const Button = (ButtonNativeModule).Button;
string = intl.string;
const J61px0 = (require(1244) /* metro dependency 1244: indexNative */).t.J61px0;
const NitroWheelIcon = (NitroWheelIconModule).NitroWheelIcon;
const items6 = [styles.nitroWheelIcon];
const WHITE = (Native).unsafe_rawColors.WHITE;
items2[3] = (
<View style={items5}>
<Button
text={Reflect.apply(string, intl, [J61px0])}
size="lg"
onPress={value2}
icon={<NitroWheelIcon
style={items6}
color={WHITE}
size="custom"
/>}
iconPosition="start"
variant="experimental_premium-primary"
shiny={!useReducedMotion}
/>
</View>
</BottomSheet>
);
}
);
return (
<BottomSheet onDismiss={value3}>
<View style={items7}>
{items2}
</View>
</BottomSheet>
);
function _fun116903() { // fn#116903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:1142, offset: 0x0249ae87, size: 147 bytes, params: 1, frame: 15
const markAsDismissedBinding = markAsDismissed;
const PRIMARY = ContentDismissActionType.PRIMARY;
markAsDismissedBinding(PRIMARY);
const defaultImport = OpenPremiumPlanSelectionActionSheet;
const BOGO_PROMOTION_ACTION_SHEET = AnalyticsPages.BOGO_PROMOTION_ACTION_SHEET;
const FOOTER = AnalyticsSections.FOOTER;
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
const BUY = AnalyticsObjectTypes.BUY;
const TIER_2 = PremiumTypes.TIER_2;
defaultImport({analyticsLocation: {page: BOGO_PROMOTION_ACTION_SHEET, section: FOOTER, object: BUTTON_CTA,
objectType: BUY}, analyticsLocations: analyticsLocations, premiumType: TIER_2});
}
}
function _fun116903() { // fn#116903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15479:1142, offset: 0x0249ae87, size: 147 bytes, params: 1, frame: 15
const markAsDismissedBinding = markAsDismissed;
const PRIMARY = ContentDismissActionType.PRIMARY;
markAsDismissedBinding(PRIMARY);
const defaultImport = importDefault(7040) /* metro dependency 7040: openPremiumPlanSelectionActionSheet */;
const BOGO_PROMOTION_ACTION_SHEET = AnalyticsPages.BOGO_PROMOTION_ACTION_SHEET;
const FOOTER = AnalyticsSections.FOOTER;
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
const BUY = AnalyticsObjectTypes.BUY;
const TIER_2 = PremiumTypes.TIER_2;
defaultImport({analyticsLocation: {page: BOGO_PROMOTION_ACTION_SHEET, section: FOOTER, object: BUTTON_CTA,
objectType: BUY}, analyticsLocations: analyticsLocations, premiumType: TIER_2});
}
global.__d(_fun116900, 15282, [31, 27, 4502, 1880, 661, 1376, 33, 4501, 697, 6771, 566, 7040, 6275, 5475, 4573,
1244, 6766, 1948, 4578, 7954,
2]) /* metro module 15282, dependencies: [31, 27, 4502, 1880, 661, 1376, 33, 4501, 697, 6771, 566, 7040, 6275, 5475, 4573, 1244, 6766, 1948, 4578, 7954, 2] */;
@@ -1,92 +1,120 @@
/* Metro module 7586; source: modules/premium/promotions/native/MarketingPageBannerTile.tsx; dependencies: [31, 27, 4502, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 4573, 6766, 3853, 4578, 7954, 2] */
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import UseTrackImpression from '../../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as AnalyticsUtilsModule from '../../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as TextWithIOSLinkWorkaroundModule from '../../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
import * as MarketingComponentTypeModule from '../../../../external/discord_common/js/shared/shared-constants/MarketingComponentType.tsx'; /* Metro dependency 7583 */
import * as PromotionStringUtilsModule from '../PromotionStringUtils.tsx'; /* Metro dependency 12169 */
function _fun60847(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:6, offset: 0x017116bb, size: 516 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
ReactModule;
let value = ReactNativeModule;
const env0_3 = value.Image;
const env0_4 = value.View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object2.container = {width: '100%'};
const object5 = {'display': 'flex', 'width': '100%', 'flexDirection': 'column', 'justifyContent': 'flex-start'};
object = {};
object.container = {width: '100%'};
const object3 = {'display': 'flex', 'width': '100%', 'flexDirection': 'column', 'justifyContent': 'flex-start'};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object5.padding = PX_16;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.padding = PX_16;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const BACKGROUND_SECONDARY_ALT = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SECONDARY_ALT;
object5.backgroundColor = BACKGROUND_SECONDARY_ALT;
object5.overflow = 'hidden';
object2.card = object5;
const object6 = {'width': '100%', 'maxWidth': 317, 'height': 144};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object3.backgroundColor = BACKGROUND_SECONDARY_ALT;
object3.overflow = 'hidden';
object.card = object3;
const object4 = {'width': '100%', 'maxWidth': 317, 'height': 144};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.marginBottom = PX_16;
object4.marginBottom = PX_16;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.padding = PX_8;
object6.alignSelf = 'center';
object2.image = object6;
object4.padding = PX_8;
object4.alignSelf = 'center';
object.image = object4;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object2.bodyText = {marginTop: PX_4};
object.bodyText = {marginTop: PX_4};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.ctaButton = {marginTop: PX_16};
object2.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
const env0_8 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/native/MarketingPageBannerTile.tsx');
object.ctaButton = {marginTop: PX_16};
object.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
const env0_8 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/native/MarketingPageBannerTile.tsx');
exports.default = _default_60848;
}
function _default_60848({style, cardStyle, componentId, bannerFields, analyticsPage, onPaymentSuccess, onPaymentDismiss}) { // fn#60848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:730, offset: 0x017118bf, size: 988 bytes, params: 2, frame: 33
var object2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const buttonActionHandler = (require(7587) /* metro dependency 7587: PremiumMarketingButtonActions */).getButtonActionHandler({buttonAction: bannerFields.button?.buttonAction,
analyticsLocations: (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations,
analyticsPage: analyticsPage, onPaymentSuccess: onPaymentSuccess, onPaymentDismiss: onPaymentDismiss});
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
object2 = {};
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object2.type = VIEW;
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const PREMIUM_MARKETING_COMPONENT = ImpressionNames.PREMIUM_MARKETING_COMPONENT;
object2.name = PREMIUM_MARKETING_COMPONENT;
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
const MARKETING_PAGE_BANNER = MarketingComponentType.MARKETING_PAGE_BANNER;
object2.properties = {component_type: MARKETING_PAGE_BANNER, component_id: componentId};
defaultImport(object2);
const value4 = (require(12169) /* metro dependency 12169: PromotionStringUtils */).useFormatStringWithCommonPremiumParams(bannerFields.body);
const helpArticleLinkProps = (require(12169) /* metro dependency 12169: PromotionStringUtils */).getHelpArticleLinkProps(bannerFields.helpArticle,
bannerFields.helpArticleId);
const items4 = [styles.container, style];
const items2 = [styles.card, cardStyle];
const items3 = [bannerFields.assetUrl !== '' && <Image source={{uri: bannerFields.assetUrl}} style={styles.image} resizeMode="contain" />];
items3[1] = <Text color="mobile-text-heading-primary" variant="text-lg/bold">{bannerFields.header}</Text>;
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
items3[2] = <TextWithIOSLinkWorkaround color="mobile-text-heading-primary" variant="text-sm/medium" style={styles.bodyText}>{value4}{' '}{helpArticleLinkProps != null && <Text color="text-link" variant="text-sm/medium" accessibilityRole="link" onPress={onPress_60850}>{helpArticleLinkProps.linkText}</Text>}</TextWithIOSLinkWorkaround>;
items3[3] = bannerFields.button != null && <View style={styles.ctaButton}>{((Button) => <Button text={bannerFields.button.copy} size="lg" onPress={buttonActionHandler} icon={((NitroWheelIcon) => <NitroWheelIcon style={[styles.nitroWheelIcon]} color={(importDefault(697) /* metro dependency 697: native */).colors.WHITE} size="custom" />)((require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon)} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button)}</View>;
return (
<View style={items4}>
<View style={items2}>
{items3}
function _default_60848({style, cardStyle, componentId, bannerFields, analyticsPage, onPaymentSuccess, onPaymentDismiss}) { // fn#60848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:730, offset: 0x017118bf, size: 988 bytes, params: 2, frame: 33
const Text = (TextModule).Text;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const buttonActionHandler = (require(7587) /* metro dependency 7587: PremiumMarketingButtonActions */).getButtonActionHandler({buttonAction: bannerFields.button?.buttonAction,
analyticsLocations: (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations,
analyticsPage: analyticsPage, onPaymentSuccess: onPaymentSuccess, onPaymentDismiss: onPaymentDismiss});
const defaultImport = UseTrackImpression;
object = {};
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object.type = VIEW;
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const PREMIUM_MARKETING_COMPONENT = ImpressionNames.PREMIUM_MARKETING_COMPONENT;
object.name = PREMIUM_MARKETING_COMPONENT;
const MarketingComponentType = (MarketingComponentTypeModule).MarketingComponentType;
const MARKETING_PAGE_BANNER = MarketingComponentType.MARKETING_PAGE_BANNER;
object.properties = {component_type: MARKETING_PAGE_BANNER, component_id: componentId};
defaultImport(object);
const value4 = (PromotionStringUtilsModule).useFormatStringWithCommonPremiumParams(bannerFields.body);
const helpArticleLinkProps = (PromotionStringUtilsModule).getHelpArticleLinkProps(bannerFields.helpArticle,
bannerFields.helpArticleId);
const items4 = [styles.container, style];
const items2 = [styles.card, cardStyle];
const items3 = [
bannerFields.assetUrl !== '' && <Image source={{uri: bannerFields.assetUrl}} style={styles.image} resizeMode="contain" />,
];
items3[1] = (
<Text color="mobile-text-heading-primary" variant="text-lg/bold">
{bannerFields.header}
</Text>
);
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
items3[2] = (
<TextWithIOSLinkWorkaround
color="mobile-text-heading-primary"
variant="text-sm/medium"
style={styles.bodyText}
>
{value4}
{' '}
{helpArticleLinkProps != null && <Text color="text-link" variant="text-sm/medium" accessibilityRole="link" onPress={onPress_60850}>{helpArticleLinkProps.linkText}</Text>}
</TextWithIOSLinkWorkaround>
);
items3[3] = bannerFields.button != null && <View style={styles.ctaButton}>{((Button) => <Button text={bannerFields.button.copy} size="lg" onPress={buttonActionHandler} icon={((NitroWheelIcon) => <NitroWheelIcon style={[styles.nitroWheelIcon]} color={(importDefault(697) /* metro dependency 697: native */).colors.WHITE} size="custom" />)((require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon)} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} />)((require(4578) /* metro dependency 4578: ButtonNative */).Button)}</View>;
return (
<View style={items4}>
<View style={items2}>
{items3}
</View>
</View>
</View>
);
}
);
function _default_60848OnPress() { // fn#60850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:1923, owner: _default_60848.onPress, offset: 0x01711c9b, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
return value.openURL(env0_0.url);
}
}
function _default_60848OnPress() { // fn#60850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7764:1923, owner: _default_60848.onPress, offset: 0x01711c9b, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
return value.openURL(env0_0.url);
}
global.__d(_fun60847, 7586, [31, 27, 4502, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 4573, 6766, 3853,
4578, 7954,
2]) /* metro module 7586, dependencies: [31, 27, 4502, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 4573, 6766, 3853, 4578, 7954, 2] */;
@@ -1,138 +1,197 @@
/* Metro module 15285; source: modules/premium/promotions/native/PremiumMarketingMomentActionSheet.tsx; dependencies: [31, 27, 4502, 661, 1376, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 6275, 4651, 9543, 5475, 4573, 6766, 3853, 4578, 1244, 7954, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import UseTrackImpression from '../../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as AnalyticsUtilsModule from '../../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as DismissibleContentConstantsModule from '../../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as UploadUtilsModule from '../../../../utils/UploadUtils.tsx'; /* Metro dependency 4651 */
import * as BottomSheetNativeModule from '../../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as TextWithIOSLinkWorkaroundModule from '../../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
import * as MarketingComponentTypeModule from '../../../../external/discord_common/js/shared/shared-constants/MarketingComponentType.tsx'; /* Metro dependency 7583 */
import * as NitroWheelIconModule from '../../../../design/components/Icon/native/redesign/generated/NitroWheelIcon.tsx'; /* Metro dependency 7954 */
import * as PromotionStringUtilsModule from '../PromotionStringUtils.tsx'; /* Metro dependency 12169 */
function _fun116920(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:6, offset: 0x0249b75e, size: 538 bytes, params: 8, frame: 23
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).AnalyticsPages;
const env0_7 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
let value = require(33) /* metro dependency 33 */;
let value = JsxRuntimeModule;
const env0_8 = value.jsx;
const env0_9 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {};
const object4 = {'display': 'flex', 'flexDirection': 'column', 'alignItems': 'center', 'paddingVertical': 12,
object = {};
const object2 = {'display': 'flex', 'flexDirection': 'column', 'alignItems': 'center', 'paddingVertical': 12,
'paddingHorizontal': 20};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.container = object4;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object.container = object2;
let PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.buttonContainer = {'marginTop': null, 'width': 335, 'height': 48, marginTop: PX_24};
object.buttonContainer = {'marginTop': null, 'width': 335, 'height': 48, marginTop: PX_24};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.header = {marginBottom: PX_8, textAlign: 'center'};
object3.body = {textAlign: 'center'};
const object5 = {'height': 188, 'width': 335};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object.header = {marginBottom: PX_8, textAlign: 'center'};
object.body = {textAlign: 'center'};
const object6 = {'height': 188, 'width': 335};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.marginBottom = PX_24;
object3.image = object5;
const object8 = {};
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object6.marginBottom = PX_24;
object.image = object6;
const object7 = {};
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object8.marginBottom = PX_24;
object3.video = object8;
object3.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
const env0_10 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/promotions/native/PremiumMarketingMomentActionSheet.tsx');
object7.marginBottom = PX_24;
object.video = object7;
object.nitroWheelIcon = {'bottom': -1, 'width': 22, 'height': 16};
const env0_10 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/premium/promotions/native/PremiumMarketingMomentActionSheet.tsx');
exports.default = PremiumMarketingMomentActionSheet;
}
function PremiumMarketingMomentActionSheet({markAsDismissed, bottomSheetData, componentId}) { // fn#116921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:863, offset: 0x0249b978, size: 1211 bytes, params: 2, frame: 34
var object5;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var r8;
var r15;
var Video;
var object2;
var intl;
const env0_3 = undefined;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
let value3 = env0_3.useCallback(function() {
var markAsDismissedBinding = markAsDismissed;
var value3 = undefined;
markAsDismissedBinding(ContentDismissActionType.PRIMARY);
var moduleValue = require(dependencyMap[10]);
var getButtonActionHandler = moduleValue.getButtonActionHandler;
var button = bottomSheetData.button;
Reflect.apply(getButtonActionHandler, moduleValue,
[{buttonAction: button == null ? value3 : button.buttonAction,
analyticsLocations: analyticsLocations,
analyticsPage: AnalyticsPages.PREMIUM_MARKETING_MOMENT_ACTION_SHEET}])();
return value3;
}, [bottomSheetData.button?.buttonAction, markAsDismissed,
(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations]);
const value4 = env0_3.useCallback(function() {
markAsDismissed(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed]);
const defaultImport = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
object5 = {};
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
const HALFSHEET = ImpressionTypes.HALFSHEET;
object5.type = HALFSHEET;
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const PREMIUM_MARKETING_COMPONENT = ImpressionNames.PREMIUM_MARKETING_COMPONENT;
object5.name = PREMIUM_MARKETING_COMPONENT;
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
const MOBILE_BOTTOM_SHEET = MarketingComponentType.MOBILE_BOTTOM_SHEET;
object5.properties = {component_type: MOBILE_BOTTOM_SHEET, component_id: componentId,
dismissible_content: bottomSheetData.dismissibleContent};
defaultImport(object5);
const helpArticleLinkProps = (require(12169) /* metro dependency 12169: PromotionStringUtils */).getHelpArticleLinkProps(bottomSheetData.helpArticle,
bottomSheetData.helpArticleId);
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const items3 = [styles.container];
const uploadUtilsModule = require(4651) /* metro dependency 4651: UploadUtils */;
const getFile = uploadUtilsModule.getFile;
const object3 = {};
let assetUrl = bottomSheetData.assetUrl;
object3.uri = assetUrl;
if (Reflect.apply(getFile, uploadUtilsModule, [object3]).isVideo) {
Video = importDefault(9543) /* metro dependency 9543: Video */;
object2 = {};
assetUrl = bottomSheetData.assetUrl;
object2.videoURI = assetUrl;
assetUrl = bottomSheetData.assetUrl;
object2.uri = assetUrl;
r8 = <Video src={object2} style={styles.video} muted height={188} width={335} paused={useReducedMotion} resizeMode="contain" />;
} else {
r8 = ((Component) => <Component source={{uri: bottomSheetData.assetUrl}} style={styles.image} resizeMode="contain" />)(importDefault(5475) /* metro dependency 5475: FastImage */);
}
const items2 = [r8];
items2[1] = <Text style={[styles.header]} color="mobile-text-heading-primary" variant="heading-lg/extrabold">{bottomSheetData.header}</Text>;
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
items2[2] = <TextWithIOSLinkWorkaround style={[styles.body]} color="text-default" variant="text-sm/normal">{bottomSheetData.body}{' '}{helpArticleLinkProps != null && <Text color="text-link" variant="text-sm/normal" accessibilityRole="link" onPress={onPress_116925}>{helpArticleLinkProps.linkText}</Text>}</TextWithIOSLinkWorkaround>;
const items6 = [styles.buttonContainer];
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const copy = bottomSheetData.button?.copy;
if (copy != null) {
r15 = copy;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r15 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.J61px0);
}
const NitroWheelIcon = (require(7954) /* metro dependency 7954: NitroWheelIcon */).NitroWheelIcon;
const items7 = [styles.nitroWheelIcon];
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
items2[3] = <View style={items6}><Button text={r15} size="lg" onPress={value3} icon={<NitroWheelIcon style={items7} color={WHITE} size="custom" />} iconPosition="start" variant="experimental_premium-primary" shiny={!useReducedMotion} /></View>;
return (
<BottomSheet onDismiss={value4}>
<View style={items3}>
{items2}
function PremiumMarketingMomentActionSheet({markAsDismissed, bottomSheetData, componentId}) { // fn#116921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:863, offset: 0x0249b978, size: 1211 bytes, params: 2, frame: 34
var object6;
const Text = (TextModule).Text;
var r8;
var r15;
var Video;
var object;
var intl;
const env0_3 = undefined;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
let value3 = env0_3.useCallback(function() {
var markAsDismissedBinding = markAsDismissed;
var value3 = undefined;
markAsDismissedBinding(ContentDismissActionType.PRIMARY);
var moduleValue = require(dependencyMap[10]);
var getButtonActionHandler = moduleValue.getButtonActionHandler;
var button = bottomSheetData.button;
Reflect.apply(getButtonActionHandler, moduleValue,
[{buttonAction: button == null ? value3 : button.buttonAction,
analyticsLocations: analyticsLocations,
analyticsPage: AnalyticsPages.PREMIUM_MARKETING_MOMENT_ACTION_SHEET}])();
return value3;
}, [bottomSheetData.button?.buttonAction, markAsDismissed,
(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations]);
const value4 = env0_3.useCallback(function() {
markAsDismissed(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed]);
const defaultImport = UseTrackImpression;
object6 = {};
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const HALFSHEET = ImpressionTypes.HALFSHEET;
object6.type = HALFSHEET;
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const PREMIUM_MARKETING_COMPONENT = ImpressionNames.PREMIUM_MARKETING_COMPONENT;
object6.name = PREMIUM_MARKETING_COMPONENT;
const MarketingComponentType = (MarketingComponentTypeModule).MarketingComponentType;
const MOBILE_BOTTOM_SHEET = MarketingComponentType.MOBILE_BOTTOM_SHEET;
object6.properties = {component_type: MOBILE_BOTTOM_SHEET, component_id: componentId,
dismissible_content: bottomSheetData.dismissibleContent};
defaultImport(object6);
const helpArticleLinkProps = (PromotionStringUtilsModule).getHelpArticleLinkProps(bottomSheetData.helpArticle,
bottomSheetData.helpArticleId);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const items3 = [styles.container];
const getFile = UploadUtilsModule.getFile;
const object4 = {};
let assetUrl = bottomSheetData.assetUrl;
object4.uri = assetUrl;
if (Reflect.apply(getFile, UploadUtilsModule, [object4]).isVideo) {
Video = importDefault(9543) /* metro dependency 9543: Video */;
object = {};
assetUrl = bottomSheetData.assetUrl;
object.videoURI = assetUrl;
assetUrl = bottomSheetData.assetUrl;
object.uri = assetUrl;
r8 = (
<Video
src={object}
style={styles.video}
muted
height={188}
width={335}
paused={useReducedMotion}
resizeMode="contain"
/>
);
} else {
r8 = ((Component) => <Component source={{uri: bottomSheetData.assetUrl}} style={styles.image} resizeMode="contain" />)(importDefault(5475) /* metro dependency 5475: FastImage */);
}
const items2 = [r8];
items2[1] = (
<Text
style={[styles.header]}
color="mobile-text-heading-primary"
variant="heading-lg/extrabold"
>
{bottomSheetData.header}
</Text>
);
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
items2[2] = (
<TextWithIOSLinkWorkaround
style={[styles.body]}
color="text-default"
variant="text-sm/normal"
>
{bottomSheetData.body}
{' '}
{helpArticleLinkProps != null && <Text color="text-link" variant="text-sm/normal" accessibilityRole="link" onPress={onPress_116925}>{helpArticleLinkProps.linkText}</Text>}
</TextWithIOSLinkWorkaround>
);
const items6 = [styles.buttonContainer];
const Button = (ButtonNativeModule).Button;
const copy = bottomSheetData.button?.copy;
if (copy != null) {
r15 = copy;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r15 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.J61px0);
}
const NitroWheelIcon = (NitroWheelIconModule).NitroWheelIcon;
const items7 = [styles.nitroWheelIcon];
const WHITE = (Native).unsafe_rawColors.WHITE;
items2[3] = (
<View style={items6}>
<Button
text={r15}
size="lg"
onPress={value3}
icon={<NitroWheelIcon
style={items7}
color={WHITE}
size="custom"
/>}
iconPosition="start"
variant="experimental_premium-primary"
shiny={!useReducedMotion}
/>
</View>
</BottomSheet>
);
}
);
return (
<BottomSheet onDismiss={value4}>
<View style={items3}>
{items2}
</View>
</BottomSheet>
);
function PremiumMarketingMomentActionSheetOnPress() { // fn#116925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:2360, owner: PremiumMarketingMomentActionSheet.onPress, offset: 0x0249bead, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
return value.openURL(env0_3.url);
}
}
function PremiumMarketingMomentActionSheetOnPress() { // fn#116925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15482:2360, owner: PremiumMarketingMomentActionSheet.onPress, offset: 0x0249bead, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(3853) /* metro dependency 3853: Linking */;
return value.openURL(env0_3.url);
}
global.__d(_fun116920, 15285, [31, 27, 4502, 661, 1376, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169,
6275, 4651, 9543, 5475, 4573, 6766, 3853, 4578, 1244, 7954,
2]) /* metro module 15285, dependencies: [31, 27, 4502, 661, 1376, 33, 4501, 697, 566, 6771, 7587, 8742, 480, 7583, 12169, 6275, 4651, 9543, 5475, 4573, 6766, 3853, 4578, 1244, 7954, 2] */;