183 lines
10 KiB
TypeScript
183 lines
10 KiB
TypeScript
/* Metro module 7534; source: modules/premium/native/PremiumPlanWhatYouLoseActionSheet.tsx; dependencies: [31, 27, 1880, 33, 4501, 697, 5475, 4573, 3802, 6771, 7535, 44, 7540, 1244, 7541, 7542, 7543, 7544, 4080, 6275, 7046, 4578, 7294, 2] */
|
|
function _fun60614(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:6, offset: 0x01708183, size: 511 bytes, params: 8, frame: 26
|
|
var object2;
|
|
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 env0_5 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
|
let 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 = {body: {'paddingTop': 24, 'paddingHorizontal': 24}};
|
|
let MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object2.title = {marginBottom: 8, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object2.subtitle = {marginBottom: 16, color: MOBILE_TEXT_HEADING_PRIMARY};
|
|
const object3 = {'marginBottom': 16, 'borderRadius': null, 'display': 'flex', 'flexDirection': 'column',
|
|
'justifyContent': 'center', 'alignItems': 'center', 'backgroundColor': null, 'padding': 16};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object3.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object2.item = object3;
|
|
object2.itemLabel = {marginTop: 8};
|
|
object2.footer = {paddingHorizontal: 16};
|
|
object2.button = {marginBottom: 8};
|
|
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
|
|
object2.keepText = {'textAlign': 'center', 'paddingVertical': 8, color: TEXT_SUBTLE};
|
|
const env0_8 = Reflect.apply(createStyles, value, [object2]);
|
|
object2 = {DOWNGRADE: 0};
|
|
object2[0] = 'DOWNGRADE';
|
|
object2.CANCEL = 1;
|
|
object2[1] = 'CANCEL';
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/PremiumPlanWhatYouLoseActionSheet.tsx');
|
|
exports.default = _default_60616;
|
|
exports.WhatYouLoseMode = object2;
|
|
}
|
|
|
|
function WhatYouLoseItem({imageSource, text}) { // fn#60615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:762, offset: 0x01708382, size: 157 bytes, params: 2, frame: 21
|
|
const styles = useStyles();
|
|
const value2 = ((Component) => <Component source={imageSource} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<View style={styles.item}>
|
|
{value2}
|
|
<Text variant="text-md/medium" style={styles.itemLabel}>
|
|
{text}
|
|
</Text>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _default_60616({mode, onContinue, subscription}) { // fn#60616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:1021, offset: 0x0170841f, size: 1037 bytes, params: 2, frame: 34
|
|
var r16;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
var Qk34Ik;
|
|
var object;
|
|
var jh5mUz;
|
|
var object2;
|
|
const styles = useStyles();
|
|
const premiumTypeFromSubscription = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeFromSubscription(subscription);
|
|
const env0_3 = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
|
|
const value3 = (require(7535) /* metro dependency 7535: WhatYouLoseProfileTier1 */).useWhatYouLoseProfileTier1Source();
|
|
(importDefault(44) /* metro dependency 44 */)(premiumTypeFromSubscription != null, 'Expected premium type');
|
|
const value4 = env0_3.useMemo(_fun60618, [premiumTypeFromSubscription, value3]);
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const items3 = [((Component) => <Component premiumType={premiumTypeFromSubscription} />)(importDefault(7046) /* metro dependency 7046: PremiumPlanActionSheetHeader */)];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
let CANCEL = env0_10.CANCEL;
|
|
const items2 = [<Text variant="heading-xl/extrabold" style={styles.title}>{mode === CANCEL ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PWq8TL) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7VcWW0'])}</Text>];
|
|
CANCEL = env0_10.CANCEL;
|
|
if (mode === CANCEL) {
|
|
format = intl.format;
|
|
jh5mUz = (require(1244) /* metro dependency 1244: indexNative */).t.jh5mUz;
|
|
object2 = {};
|
|
object2.subscriptionName = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeDisplayName(premiumTypeFromSubscription,
|
|
|
|
true);
|
|
r16 = Reflect.apply(format, intl, [jh5mUz, object2]);
|
|
} else {
|
|
format = intl.format;
|
|
Qk34Ik = (require(1244) /* metro dependency 1244: indexNative */).t.Qk34Ik;
|
|
object = {};
|
|
object.subscriptionName = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeDisplayName(premiumTypeFromSubscription,
|
|
|
|
true);
|
|
r16 = Reflect.apply(format, intl, [Qk34Ik, object]);
|
|
}
|
|
items2[1] = <Text variant="text-md/medium" style={styles.subtitle}>{r16}</Text>;
|
|
items2[2] = value4.map(_fun60619);
|
|
items3[1] = <View style={styles.body}>{items2}</View>;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items3[2] = <View style={styles.footer}><View style={styles.button}><Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3PatSz'])} grow onPress={function() {
|
|
var property = require(dependencyMap[22]).STEP_ANALYTICS_NAMES;
|
|
property = property[require(dependencyMap[22]).CancellationFlowSteps.WHAT_YOU_LOSE];
|
|
onContinue(property);
|
|
_default_60616OnClose();
|
|
}} /></View><Text variant="text-sm/medium" style={styles.keepText} onPress={onPress_60621}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rzVN6j)}</Text></View>;
|
|
return (
|
|
<BottomSheet>
|
|
{items3}
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function _fun60618() { // fn#60618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:1252, offset: 0x01708851, size: 733 bytes, params: 1, frame: 22
|
|
var object2;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var format;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var property;
|
|
var items4;
|
|
var items2;
|
|
var items3;
|
|
const binding = env0_2;
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
if (TIER_0 === binding) {
|
|
object2 = {};
|
|
object2.imageSource = importDefault(7540) /* metro dependency 7540 */;
|
|
object2.text = intl.format(t['0hUHi6'], {});
|
|
items3 = [object2];
|
|
object2 = {imageSource: importDefault(7541) /* metro dependency 7541 */};
|
|
object2.text = intl.format(t.wFWO6D, {});
|
|
items3[1] = object2;
|
|
return items3;
|
|
}
|
|
const TIER_1 = PremiumTypes.TIER_1;
|
|
if (TIER_1 === binding) {
|
|
items2 = [{imageSource: env0_4, text: intl.format(t.xCaYwE, {})}];
|
|
object2 = {};
|
|
object2.imageSource = importDefault(7542) /* metro dependency 7542 */;
|
|
object2.text = intl.format(t.wK04T1, {});
|
|
items2[1] = object2;
|
|
object2 = {imageSource: importDefault(7543) /* metro dependency 7543 */};
|
|
object2.text = intl.format(t.K4Hv69, {});
|
|
items2[2] = object2;
|
|
return items2;
|
|
}
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
if (TIER_2 === binding) {
|
|
object2 = {};
|
|
object2.imageSource = importDefault(7544) /* metro dependency 7544 */;
|
|
format = intl.format;
|
|
property = t['gpqr+n'];
|
|
object2.text = Reflect.apply(format, intl, [property, {}]);
|
|
items4 = [object2];
|
|
object2 = {imageSource: importDefault(7543) /* metro dependency 7543 */};
|
|
object2.text = intl.format(t.wRxEDW, {});
|
|
items4[1] = object2;
|
|
object2 = {imageSource: importDefault(7542) /* metro dependency 7542 */};
|
|
format = intl.format;
|
|
property = t['4WZ7T2'];
|
|
object2.text = Reflect.apply(format, intl, [property, {}]);
|
|
items4[2] = object2;
|
|
return items4;
|
|
}
|
|
return [];
|
|
}
|
|
|
|
function _fun60619(a0, a1) { // fn#60619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:2528, offset: 0x01708b2e, size: 37 bytes, params: 3, frame: 15
|
|
return <WhatYouLoseItem {...a0} key={a1} />;
|
|
}
|
|
|
|
function _default_60616OnPress_60621() { // fn#60621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7712:2926, owner: _default_60616.onPress, offset: 0x01708ba1, size: 121 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__;
|
|
value = require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */;
|
|
const trackPremiumSubscriptionCancellationFlowStep = value.trackPremiumSubscriptionCancellationFlowStep;
|
|
const object2 = {};
|
|
object2.subscription = subscription;
|
|
object2.analyticsLocations = analyticsLocations;
|
|
const STEP_ANALYTICS_NAMES = (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).STEP_ANALYTICS_NAMES;
|
|
const CancellationFlowSteps = (require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).CancellationFlowSteps;
|
|
const WHAT_YOU_LOSE = CancellationFlowSteps.WHAT_YOU_LOSE;
|
|
object2.fromStep = STEP_ANALYTICS_NAMES[WHAT_YOU_LOSE];
|
|
object2.toStep = null;
|
|
Reflect.apply(trackPremiumSubscriptionCancellationFlowStep, value, [object2]);
|
|
_default_60616OnClose();
|
|
}
|
|
|