563 lines
31 KiB
TypeScript
563 lines
31 KiB
TypeScript
/* Metro module 7901; source: components_native/premium/PremiumUpsellAlert.tsx; dependencies: [57, 6, 7, 15, 17, 18, 31, 27, 1312, 1878, 661, 7902, 1880, 33, 4501, 697, 4573, 3868, 7062, 1244, 3802, 7883, 7884, 4048, 4002, 7929, 7930, 7931, 7932, 7875, 7933, 7934, 7935, 7936, 566, 6808, 7896, 7882, 1478, 6771, 6789, 4594, 683, 7937, 4136, 4596, 1305, 5475, 7938, 7939, 7886, 2] */
|
|
function _fun63274(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:6, offset: 0x01b78912, size: 913 bytes, params: 8, frame: 26
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = PremiumUpsellItem;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
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 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_10 = value2.View;
|
|
const env0_11 = value2.Image;
|
|
const unsyncedUserSettingsStore = importDefault(1312) /* metro dependency 1312: UnsyncedUserSettingsStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_14 = constantsModule.AnalyticEvents;
|
|
const env0_15 = constantsModule.UpsellTypes;
|
|
const env0_16 = (require(7902) /* metro dependency 7902: AppIconConstants */).getIcons;
|
|
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_17 = premiumConstantsModule.PremiumSubscriptionSKUs;
|
|
const env0_18 = premiumConstantsModule.PremiumTypes;
|
|
const value5 = require(33) /* metro dependency 33 */;
|
|
const env0_19 = value5.jsx;
|
|
const env0_20 = value5.jsxs;
|
|
const env0_21 = value5.Fragment;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles;
|
|
object2 = {};
|
|
object2.carousel = {alignItems: 'center'};
|
|
object2.upsellContainer = {alignItems: 'center'};
|
|
object2.premiumUpsellContainer = {'alignItems': 'center', 'paddingHorizontal': 8};
|
|
object2.nitroWheel = {'width': 32, 'height': 32, 'marginVertical': -8};
|
|
object2.upsellImage = {'height': 80, 'width': 120};
|
|
object2.upsellTitle = {'marginBottom': 8, 'textAlign': 'center'};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.premiumUpsellTitle = {marginVertical: PX_8, textAlign: 'center'};
|
|
object2.upsellDescription = {textAlign: 'center'};
|
|
object2.premiumUpsellDescription = {textAlign: 'center'};
|
|
object2.pageIndicatorStyle = {marginTop: 16};
|
|
object2.largerUpsellImage = {'height': 154, 'width': 226};
|
|
object2.customProfileUpsellImage = {'width': 240, 'height': 194};
|
|
object2.loadingIndicator = {height: 170};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object2.customAppIconUpsellLightImage = {borderColor: BACKGROUND_BASE_LOWEST, borderWidth: 2};
|
|
const object3 = {'height': 80, 'width': 80};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object2.customAppIconsUpsellImage = object3;
|
|
const env0_22 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [object2]);
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun63291(PureComponent);
|
|
const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
value.defaultProps = {isInitial: false};
|
|
const closure2 = PremiumUpsellAlert;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/PremiumUpsellAlert.tsx');
|
|
exports.default = closure2;
|
|
exports.PremiumUpsellItem = closure;
|
|
exports.PremiumUpsellAlert = closure2;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_63275() { // fn#63275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:380, offset: 0x01b78ca3, 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_63275_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function PremiumUpsellItem({upsellItem, alertWidth, imageStyle, style}) { // fn#63278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:2141, offset: 0x01b78d01, size: 307 bytes, params: 2, frame: 26
|
|
const value2 = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22);
|
|
const image = upsellItem.image;
|
|
const title = upsellItem.title;
|
|
const description = upsellItem.description;
|
|
const items2 = [value2.premiumUpsellContainer];
|
|
items2[1] = {width: alertWidth};
|
|
items2[2] = style;
|
|
const items3 = [<Image style={[value2.upsellImage, imageStyle]} source={image} resizeMode="contain" />];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items3[1] = <Text style={value2.premiumUpsellTitle} variant="heading-xl/extrabold" color="mobile-text-heading-primary" accessibilityRole="header">{title}</Text>;
|
|
items3[2] = <Text style={value2.premiumUpsellDescription} variant="text-md/medium">{description}</Text>;
|
|
return (
|
|
<View style={items2}>
|
|
{items3}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function GlobalEmojiUpsell({alertWidth, useTier0Description}) { // fn#63279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:2672, offset: 0x01b78e34, size: 588 bytes, params: 2, frame: 23
|
|
var r5;
|
|
var kWBwlJ;
|
|
var moduleValue2;
|
|
var moduleValue3;
|
|
var moduleValue4;
|
|
const value3 = (require(7062) /* metro dependency 7062: usePremiumTrialOfferNative */).usePremiumTrialOffer();
|
|
const sku_id = value3 == null || value3.subscription_trial == null ? undefined : value3.subscription_trial.sku_id;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let format = intl.format;
|
|
let property = (require(1244) /* metro dependency 1244: indexNative */).t['KEn+LY'];
|
|
const value4 = Reflect.apply(format, intl, [property, {}]);
|
|
if (sku_id != null) {
|
|
if (PremiumSubscriptionSKUs.TIER_0 === sku_id) {
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['1P7x8p'];
|
|
moduleValue4 = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r5 = Reflect.apply(format, intl, [property,
|
|
{planName: moduleValue4.getPremiumTypeDisplayName(PremiumTypes.TIER_0)}]);
|
|
} else if (PremiumSubscriptionSKUs.TIER_2 !== sku_id) {
|
|
r5 = value4;
|
|
} else {
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['1P7x8p'];
|
|
moduleValue3 = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r5 = Reflect.apply(format, intl, [property,
|
|
{planName: moduleValue3.getPremiumTypeDisplayName(PremiumTypes.TIER_2)}]);
|
|
}
|
|
} else if (useTier0Description) {
|
|
format = intl.format;
|
|
kWBwlJ = (require(1244) /* metro dependency 1244: indexNative */).t.kWBwlJ;
|
|
moduleValue2 = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r5 = Reflect.apply(format, intl, [kWBwlJ,
|
|
{planName: moduleValue2.getPremiumTypeDisplayName(PremiumTypes.TIER_0)}]);
|
|
} else {
|
|
r5 = value4;
|
|
}
|
|
const object = {};
|
|
object.image = importDefault(7883) /* metro dependency 7883 */;
|
|
const string = intl.string;
|
|
const UNtcBV = (require(1244) /* metro dependency 1244: indexNative */).t.UNtcBV;
|
|
object.title = Reflect.apply(string, intl, [UNtcBV]);
|
|
object.description = r5;
|
|
return <PremiumUpsellItem alertWidth={alertWidth} upsellItem={object} />;
|
|
}
|
|
|
|
function AnimatedEmojiUpsell({alertWidth, useTier0Description}) { // fn#63280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:3379, offset: 0x01b79080, size: 248 bytes, params: 2, frame: 23
|
|
var r5;
|
|
var property;
|
|
var moduleValue;
|
|
const object = {};
|
|
object.image = importDefault(7884) /* metro dependency 7884 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const F6rmyq = t.F6rmyq;
|
|
object.title = Reflect.apply(string, intl, [F6rmyq]);
|
|
const format = intl.format;
|
|
if (useTier0Description) {
|
|
property = t['1a36ee'];
|
|
moduleValue = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r5 = Reflect.apply(format, intl, [property,
|
|
{planName: moduleValue.getPremiumTypeDisplayName(PremiumTypes.TIER_0)}]);
|
|
} else {
|
|
r5 = Reflect.apply(format, intl, [t.JxTzzb, {}]);
|
|
}
|
|
object.description = r5;
|
|
return <PremiumUpsellItem alertWidth={alertWidth} upsellItem={object} />;
|
|
}
|
|
|
|
function PremiumGuildIdentityUpsell({alertWidth}) { // fn#63281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:3719, offset: 0x01b79178, size: 286 bytes, params: 2, frame: 20
|
|
const value2 = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22);
|
|
const value3 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const largerUpsellImage = value2.largerUpsellImage;
|
|
const object = {};
|
|
object.image = (require(4002) /* metro dependency 4002: shared */).isThemeDark(value3) ? importDefault(7929) /* metro dependency 7929 */ : importDefault(7930) /* metro dependency 7930 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const OVN9la = (require(1244) /* metro dependency 1244: indexNative */).t.OVN9la;
|
|
object.title = Reflect.apply(string, intl, [OVN9la]);
|
|
object.description = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.j0dyAG);
|
|
return (
|
|
<PremiumUpsellItem
|
|
alertWidth={alertWidth}
|
|
imageStyle={largerUpsellImage}
|
|
upsellItem={object}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function CustomProfilesUpsell({alertWidth}) { // fn#63282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:4065, offset: 0x01b79296, size: 214 bytes, params: 2, frame: 20
|
|
const customProfileUpsellImage = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22).customProfileUpsellImage;
|
|
const object = {};
|
|
object.image = importDefault(7931) /* metro dependency 7931 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rTY76D);
|
|
object.description = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['2LCxoj']);
|
|
return (
|
|
<PremiumUpsellItem
|
|
alertWidth={alertWidth}
|
|
imageStyle={customProfileUpsellImage}
|
|
upsellItem={object}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function CustomAppIconsUpsell({alertWidth, imageSource}) { // fn#63283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:4369, offset: 0x01b7936c, size: 320 bytes, params: 2, frame: 20
|
|
const value3 = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22);
|
|
const iconSource = getIcons().filter(function(a0) {
|
|
return a0.isPremium;
|
|
})[0].iconSource;
|
|
const isThemeLight2 = (require(4002) /* metro dependency 4002: shared */).isThemeLight((importDefault(4048) /* metro dependency 4048: useTheme */)());
|
|
const items2 = [value3.customAppIconsUpsellImage];
|
|
items2[1] = isThemeLight2 ? value3.customAppIconUpsellLightImage : undefined;
|
|
const object = {};
|
|
object.image = imageSource ?? iconSource;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
object.title = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t['1B1Cyn']]);
|
|
string = intl.string;
|
|
const VL5TYT = (require(1244) /* metro dependency 1244: indexNative */).t.VL5TYT;
|
|
object.description = Reflect.apply(string, intl, [VL5TYT]);
|
|
return (
|
|
<PremiumUpsellItem
|
|
alertWidth={alertWidth}
|
|
imageStyle={items2}
|
|
upsellItem={object}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function GlobalStickerUpsell({alertWidth, useTier0Description}) { // fn#63285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:4825, offset: 0x01b794b7, size: 252 bytes, params: 2, frame: 23
|
|
var r5;
|
|
var property;
|
|
var moduleValue;
|
|
const object = {};
|
|
object.image = importDefault(7932) /* metro dependency 7932 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
object.title = Reflect.apply(string, intl, [t.jn2mBl]);
|
|
const format = intl.format;
|
|
if (useTier0Description) {
|
|
property = t['8C+FZk'];
|
|
moduleValue = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
r5 = Reflect.apply(format, intl, [property,
|
|
{planName: moduleValue.getPremiumTypeDisplayName(PremiumTypes.TIER_0)}]);
|
|
} else {
|
|
r5 = Reflect.apply(format, intl, [t['0qJYHK'], {}]);
|
|
}
|
|
object.description = r5;
|
|
return <PremiumUpsellItem alertWidth={alertWidth} upsellItem={object} />;
|
|
}
|
|
|
|
function LongerMessageUpsell({alertWidth}) { // fn#63286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:5168, offset: 0x01b795b3, size: 310 bytes, params: 2, frame: 21
|
|
const value2 = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22);
|
|
const value3 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const value4 = (importDefault(7875) /* metro dependency 7875: useMessageMaxLength */)();
|
|
const largerUpsellImage = value2.largerUpsellImage;
|
|
const object = {};
|
|
object.image = (require(4002) /* metro dependency 4002: shared */).isThemeDark(value3) ? importDefault(7933) /* metro dependency 7933 */ : importDefault(7934) /* metro dependency 7934 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8cjmTj']);
|
|
object.description = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.moN9wh,
|
|
{maxLength: value4});
|
|
return (
|
|
<PremiumUpsellItem
|
|
alertWidth={alertWidth}
|
|
imageStyle={largerUpsellImage}
|
|
upsellItem={object}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function GuildCapUpsell({alertWidth}) { // fn#63287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:5550, offset: 0x01b796e9, size: 289 bytes, params: 2, frame: 20
|
|
const value2 = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22);
|
|
const value3 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
|
const largerUpsellImage = value2.largerUpsellImage;
|
|
const object = {};
|
|
object.image = (require(4002) /* metro dependency 4002: shared */).isThemeDark(value3) ? importDefault(7935) /* metro dependency 7935 */ : importDefault(7936) /* metro dependency 7936 */;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.title = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['CoNXB+']);
|
|
object.description = intl.format((require(1244) /* metro dependency 1244: indexNative */).t.mkXb2F, {});
|
|
return (
|
|
<PremiumUpsellItem
|
|
alertWidth={alertWidth}
|
|
imageStyle={largerUpsellImage}
|
|
upsellItem={object}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function UploadUpsell({item, alertWidth}) { // fn#63288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:5890, offset: 0x01b7980a, size: 351 bytes, params: 2, frame: 27
|
|
var r5;
|
|
var TableSwitchRow;
|
|
var object3;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const dataSavingMode = (require(566) /* metro dependency 566: flux */).useStateFromStores([UnsyncedUserSettingsStore],
|
|
function() {
|
|
return UnsyncedUserSettingsStore.dataSavingMode;
|
|
});
|
|
let binding = env0_9;
|
|
const property = env0_3(binding.useState(!dataSavingMode), 1)[0];
|
|
const jsxRuntimeEnv0_21Binding = jsxRuntimeEnv0_21;
|
|
binding = env0_23;
|
|
const UPLOAD = UpsellTypes.UPLOAD;
|
|
const binding2 = ((Component) => <Component isInitial upsellItem={item} alertWidth={alertWidth} key={UPLOAD} />)(binding);
|
|
if (property) {
|
|
TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
|
|
r5 = <TableSwitchRow start end label={intl.string(t.ix8XIj)} subLabel={intl.string(t['wC0+Ph'])} value={dataSavingMode} onValueChange={onValueChange_63290} />;
|
|
} else {
|
|
r5 = null;
|
|
}
|
|
return (
|
|
<>
|
|
{binding2}
|
|
{r5}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function _fun63291(a0) { // fn#63291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:1380, offset: 0x01b799a8, size: 68 bytes, params: 2, frame: 15
|
|
const closure = UpsellItem;
|
|
env0_8(closure, a0);
|
|
return env0_5(closure, [{key: 'render', value: value_63293}]);
|
|
}
|
|
|
|
function PremiumUpsellAlert({initialUpsellKey, analyticsLocation, analyticsLocations, analyticsProperties, onClose, imageSource}) { // fn#63294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:6433, offset: 0x01b79b19, size: 615 bytes, params: 2, frame: 27
|
|
var object2;
|
|
const env0_3 = (require(4501) /* metro dependency 4501: createStyles */).useLegacyClassComponentStyles(env0_22);
|
|
const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
|
|
const Math = global.Math;
|
|
const min = Math.min;
|
|
const Math2 = global.Math;
|
|
const env0_4 = Reflect.apply(min, Math, [0.9 * Math2.min(width, height), 500]) - 32;
|
|
const env0_5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const env0_6 = generateUpsellItems(initialUpsellKey);
|
|
let defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
|
|
const PREMIUM_UPSELL_ALERT = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_UPSELL_ALERT;
|
|
analyticsLocations = defaultImport(analyticsLocations, PREMIUM_UPSELL_ALERT).analyticsLocations;
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
|
|
var defaultImport = importDefault(dependencyMap[42]);
|
|
var OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
|
|
defaultImport.track(OPEN_MODAL, {type: 'Nitro Upsell', location: analyticsLocation});
|
|
});
|
|
const {useTier0UpsellContent, getNitroText,
|
|
onViewAllPerks} = (require(7882) /* metro dependency 7882: PremiumUpsellUtils */).usePremiumUpsellConfig(initialUpsellKey,
|
|
analyticsLocations, analyticsLocation);
|
|
object2 = {analyticsLocation: analyticsLocation, analyticsProperties: analyticsProperties,
|
|
useTier0UpsellContent: useTier0UpsellContent};
|
|
const env0_9 = object2;
|
|
const env0_10 = env0_9.useRef(object2);
|
|
env0_9.useEffect(_fun63300);
|
|
env0_9.useEffect(_fun63301, [analyticsLocations]);
|
|
const alert = importDefault(4596) /* metro dependency 4596: Alert */;
|
|
object2 = {};
|
|
const ButtonColors = (require(1305) /* metro dependency 1305: native */).ButtonColors;
|
|
const GREEN = ButtonColors.GREEN;
|
|
object2.confirmColor = GREEN;
|
|
object2.confirmText = getNitroText;
|
|
object2.renderConfirmIcon = renderConfirmIcon;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object2.cancelText = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq);
|
|
object2.onClose = onClose;
|
|
object2.onConfirm = onViewAllPerks;
|
|
return ((Component) => <Component {...object2}>{_fun63303()}</Component>)(alert);
|
|
}
|
|
|
|
function UploadUpsellOnValueChange(a0) { // fn#63290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:6268, owner: UploadUpsell.onValueChange, offset: 0x01b79978, size: 48 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(7896) /* metro dependency 7896: UserSettingsActionCreators */).updatedUnsyncedSettings({dataSavingMode: a0});
|
|
}
|
|
|
|
function value_63293() { // fn#63293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:1656, offset: 0x01b799ec, size: 301 bytes, params: 1, frame: 25
|
|
const value2 = env1_22(this.context);
|
|
const {upsellItem, alertWidth, isInitial} = this.props;
|
|
const image = upsellItem.image;
|
|
const activeTitle = upsellItem.activeTitle;
|
|
const passiveTitle = upsellItem.passiveTitle;
|
|
const description = upsellItem.description;
|
|
const items3 = [value2.upsellContainer];
|
|
items3[1] = {width: alertWidth};
|
|
const items2 = [<Image style={value2.upsellImage} source={image} resizeMode="contain" />];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2[1] = <Text style={value2.upsellTitle} variant="text-md/medium" color="mobile-text-heading-primary">{isInitial ? activeTitle : passiveTitle}</Text>;
|
|
items2[2] = <Text style={value2.upsellDescription} variant="text-sm/medium">{description}</Text>;
|
|
return (
|
|
<View style={items3}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function getUploadAlertDescription() { // fn#63295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:7151, owner: PremiumUpsellAlert.getUploadAlertDescription, offset: 0x01b79d80, size: 331 bytes, params: 1, frame: 22
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var object2;
|
|
var getMaxFileSizeForPremiumType;
|
|
var formatToPlainString;
|
|
var Z7Xb7H;
|
|
var getPremiumTypeDisplayName;
|
|
var TIER_0;
|
|
var value;
|
|
if (useTier0UpsellContent) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
Z7Xb7H = t.Z7Xb7H;
|
|
object2 = {};
|
|
value = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
getPremiumTypeDisplayName = value.getPremiumTypeDisplayName;
|
|
TIER_0 = PremiumTypes.TIER_0;
|
|
object2.premiumPlan = Reflect.apply(getPremiumTypeDisplayName, value, [TIER_0]);
|
|
value = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
getMaxFileSizeForPremiumType = value.getMaxFileSizeForPremiumType;
|
|
TIER_0 = PremiumTypes.TIER_0;
|
|
object2.premiumMaxSize = Reflect.apply(getMaxFileSizeForPremiumType, value, [TIER_0]);
|
|
return Reflect.apply(formatToPlainString, intl, [Z7Xb7H, object2]);
|
|
}
|
|
value = (require(7937) /* metro dependency 7937: PremiumFeatureUtils */).getUserMaxFileSize(currentUser);
|
|
const BYTE_IN_KB = (require(4136) /* metro dependency 4136: FileSizeUtils */).BYTE_IN_KB;
|
|
value /= BYTE_IN_KB;
|
|
const format = intl.format;
|
|
const DUT5IC = t.DUT5IC;
|
|
object2 = {};
|
|
object2.maxUploadStandard = (require(4136) /* metro dependency 4136: FileSizeUtils */).formatSize(value,
|
|
{useKibibytes: true});
|
|
value = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
getMaxFileSizeForPremiumType = value.getMaxFileSizeForPremiumType;
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
object2.maxUploadPremium = Reflect.apply(getMaxFileSizeForPremiumType, value, [TIER_2]);
|
|
return Reflect.apply(format, intl, [DUT5IC, object2]);
|
|
}
|
|
|
|
function generateUpsellItems(a0) { // fn#63297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:6722, owner: PremiumUpsellAlert.generateUpsellItems, offset: 0x01b79edd, size: 62 bytes, params: 2, frame: 12
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
value = require(7882) /* metro dependency 7882: PremiumUpsellUtils */;
|
|
value = value.getUpsellItems();
|
|
return value.sort(_fun63298);
|
|
}
|
|
|
|
function _fun63300() { // fn#63300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:7625, offset: 0x01b79f80, size: 21 bytes, params: 1, frame: 2
|
|
env0_10.current = env0_9;
|
|
}
|
|
|
|
function _fun63301() { // fn#63301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:7658, offset: 0x01b79f95, size: 139 bytes, params: 1, frame: 19
|
|
const {analyticsLocation, analyticsProperties, useTier0UpsellContent} = env0_10.current;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const PREMIUM_UPSELL_VIEWED = AnalyticEvents.PREMIUM_UPSELL_VIEWED;
|
|
const object2 = {};
|
|
copyDataProperties(object2, analyticsProperties, analyticsLocation);
|
|
object2['location'] = analyticsLocation;
|
|
object2['location_stack'] = analyticsLocations;
|
|
object2['sku_id'] = useTier0UpsellContent ? PremiumSubscriptionSKUs.TIER_0 : PremiumSubscriptionSKUs.TIER_2;
|
|
Reflect.apply(track, defaultImport, [PREMIUM_UPSELL_VIEWED, object2]);
|
|
}
|
|
|
|
function renderConfirmIcon() { // fn#63302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:7945, owner: PremiumUpsellAlert.renderConfirmIcon, offset: 0x01b7a020, size: 158 bytes, params: 1, frame: 17
|
|
const value3 = ((Component) => <Component source={importDefault(7938) /* metro dependency 7938 */} style={env0_3.nitroWheel} resizeMode="contain" />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
const initialUpsellKeyBinding = initialUpsellKey;
|
|
const GLOBAL_EMOJI = UpsellTypes.GLOBAL_EMOJI;
|
|
if (GLOBAL_EMOJI === initialUpsellKeyBinding) {
|
|
return value3;
|
|
}
|
|
const ANIMATED_EMOJI = UpsellTypes.ANIMATED_EMOJI;
|
|
if (ANIMATED_EMOJI === initialUpsellKeyBinding) {
|
|
return value3;
|
|
}
|
|
const CUSTOM_PROFILES = UpsellTypes.CUSTOM_PROFILES;
|
|
if (CUSTOM_PROFILES === initialUpsellKeyBinding) {
|
|
return value3;
|
|
}
|
|
const PREMIUM_GUILD_PROFILE = UpsellTypes.PREMIUM_GUILD_PROFILE;
|
|
if (PREMIUM_GUILD_PROFILE === initialUpsellKeyBinding) {
|
|
return value3;
|
|
}
|
|
const APP_ICONS = UpsellTypes.APP_ICONS;
|
|
if (APP_ICONS === initialUpsellKeyBinding) {
|
|
return value3;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function _fun63303() { // fn#63303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:8266, offset: 0x01b7a0be, size: 695 bytes, params: 1, frame: 22
|
|
var object;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const Carousel = importDefault(7939) /* metro dependency 7939: Carousel */;
|
|
const binding = env0_3;
|
|
const carousel = <Carousel style={binding.carousel} width={env0_4} pageIndicatorStyle={binding.pageIndicatorStyle}>{env0_6.map(_fun63304)}</Carousel>;
|
|
const initialUpsellKeyBinding = initialUpsellKey;
|
|
const GLOBAL_EMOJI = UpsellTypes.GLOBAL_EMOJI;
|
|
if (GLOBAL_EMOJI === initialUpsellKeyBinding) {
|
|
return <GlobalEmojiUpsell alertWidth={env0_4} useTier0Description={useTier0UpsellContent} />;
|
|
}
|
|
const ANIMATED_EMOJI = UpsellTypes.ANIMATED_EMOJI;
|
|
if (ANIMATED_EMOJI === initialUpsellKeyBinding) {
|
|
return <AnimatedEmojiUpsell alertWidth={env0_4} useTier0Description={useTier0UpsellContent} />;
|
|
}
|
|
const GLOBAL_STICKER = UpsellTypes.GLOBAL_STICKER;
|
|
if (GLOBAL_STICKER === initialUpsellKeyBinding) {
|
|
return <GlobalStickerUpsell alertWidth={env0_4} useTier0Description={useTier0UpsellContent} />;
|
|
}
|
|
const CUSTOM_PROFILES = UpsellTypes.CUSTOM_PROFILES;
|
|
if (CUSTOM_PROFILES === initialUpsellKeyBinding) {
|
|
return <CustomProfilesUpsell alertWidth={env0_4} />;
|
|
}
|
|
const APP_ICONS = UpsellTypes.APP_ICONS;
|
|
if (APP_ICONS === initialUpsellKeyBinding) {
|
|
return <CustomAppIconsUpsell alertWidth={env0_4} imageSource={imageSource} />;
|
|
}
|
|
const PREMIUM_GUILD_PROFILE = UpsellTypes.PREMIUM_GUILD_PROFILE;
|
|
if (PREMIUM_GUILD_PROFILE === initialUpsellKeyBinding) {
|
|
return <PremiumGuildIdentityUpsell alertWidth={env0_4} />;
|
|
}
|
|
const LONGER_MESSAGE = UpsellTypes.LONGER_MESSAGE;
|
|
if (LONGER_MESSAGE === initialUpsellKeyBinding) {
|
|
return <LongerMessageUpsell alertWidth={env0_4} />;
|
|
}
|
|
const GUILD_CAP = UpsellTypes.GUILD_CAP;
|
|
if (GUILD_CAP === initialUpsellKeyBinding) {
|
|
return <GuildCapUpsell alertWidth={env0_4} />;
|
|
}
|
|
const UPLOAD = UpsellTypes.UPLOAD;
|
|
if (UPLOAD === initialUpsellKeyBinding) {
|
|
object = {};
|
|
object.key = UpsellTypes.UPLOAD;
|
|
object.image = importDefault(7886) /* metro dependency 7886 */;
|
|
object.activeTitle = intl.string(t['1EOZqw']);
|
|
object.passiveTitle = intl.string(t.tB51W4);
|
|
object.description = getUploadAlertDescription();
|
|
return <UploadUpsell item={object} alertWidth={env0_4} />;
|
|
}
|
|
return carousel;
|
|
}
|
|
|
|
function _fun63298({key}) { // fn#63298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:6793, offset: 0x01b79f1b, size: 30 bytes, params: 2, frame: 3
|
|
return key !== env0_0 ? 1 : -1;
|
|
}
|
|
|
|
function _fun63304(a0) { // fn#63304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8079:8376, offset: 0x01b7a375, size: 67 bytes, params: 2, frame: 17
|
|
return ((Component) => <Component isInitial={initialUpsellKey === a0.key} upsellItem={a0} alertWidth={env1_4} key={a0.key} />)(env2_23);
|
|
}
|
|
|