/* Metro module 12287; source: components_native/premium/EntitlementGiftGroupCard.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 4234, 1226, 8450, 3807, 4279, 661, 1880, 33, 4501, 697, 8451, 4573, 1244, 4578, 6829, 8467, 1305, 6780, 8708, 6818, 12288, 12289, 10519, 10521, 10522, 10520, 10523, 10524, 10525, 10526, 10527, 10530, 10533, 10534, 12290, 3868, 566, 8457, 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 AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import SubscriptionPlanStore from '../../stores/billing/SubscriptionPlanStore.tsx'; /* Metro dependency 3807 */ import ApplicationStore from '../../modules/applications/ApplicationStore.tsx'; /* Metro dependency 4234 */ import SKUStore from '../../stores/game_store/SKUStore.tsx'; /* Metro dependency 4279 */ import GiftCodeStore from '../../stores/GiftCodeStore.tsx'; /* Metro dependency 8450 */ import GiftCodeActionCreators from '../../actions/GiftCodeActionCreators.tsx'; /* Metro dependency 8451 */ import GiftCodeRow from './GiftCodeRow.tsx'; /* Metro dependency 12290 */ 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 ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as PremiumConstantsModule from '../../modules/premium/PremiumConstants.tsx'; /* Metro dependency 1880 */ import * as NativeModule from '../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as CreateStylesModule from '../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ 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 */ function _fun93864(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:6, offset: 0x020c76a7, size: 1064 bytes, params: 8, frame: 33 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const Fonts = (ConstantsModule).Fonts; const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles; object = {giftGroupCard: {'overflow': 'hidden', 'marginTop': 8}}; const object2 = {borderWidth: 1}; const CARD_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BORDER_DEFAULT; object2.borderColor = CARD_BORDER_DEFAULT; object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md; const TABLEROW_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TABLEROW_BACKGROUND_DEFAULT; object2.backgroundColor = TABLEROW_BACKGROUND_DEFAULT; object.giftGroupCardRefresh = object2; const object3 = {'fontSize': 16, 'lineHeight': 20}; const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD; object3.fontFamily = PRIMARY_SEMIBOLD; const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY; object3.color = MOBILE_TEXT_HEADING_PRIMARY; object.title = object3; const ICON_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE; object.arrow = {color: ICON_SUBTLE}; object.subtitle = {'fontSize': 14, 'lineHeight': 18}; object.titleContainer = {'marginLeft': 8, 'flex': 1}; object.groupCardHeader = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between', 'padding': 16}; let BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object.groupCardHeaderLegacy = {backgroundColor: BACKGROUND_SURFACE_HIGH}; object.rowArrow = {'height': 8, 'width': 12, 'marginRight': 8}; const object6 = {}; object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs; object.giftIcon = object6; object.generateGiftRow = {'padding': 8, 'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between'}; BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object.generateGiftRowLegacy = {backgroundColor: BACKGROUND_SURFACE_HIGH}; object.generateGiftRowText = {flexShrink: 1}; object.generateGiftButton = {marginLeft: 12}; object.loading = {marginTop: 8}; object.generateButtonContainer = {'flexGrow': 1, 'flexShrink': 0}; const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST; object.groupCardHeaderOpen = {backgroundColor: BACKGROUND_BASE_LOWEST}; const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED; object.groupCardHeaderOpenRefresh = {backgroundColor: BACKGROUND_MOD_MUTED}; object.subtitleContainer = {'flexDirection': 'row', 'alignItems': 'center', 'gap': 4}; object.socialLayerSubtitleContainer = {marginTop: 2}; const env0_21 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]); const Component = value.Component; value = _fun93868(Component); const ThemeContext = (NativeModule).ThemeContext; value.contextType = ThemeContext; value = Flux.connectStores([AuthenticationStore, SKUStore, ApplicationStore, GiftCodeStore, SubscriptionPlanStore], _fun93879)(value); (FileImportTrackerModule).fileFinishedImporting('components_native/premium/EntitlementGiftGroupCard.tsx'); exports.default = value; function _isNativeReflectConstruct_93865() { // fn#93865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:416, offset: 0x020c7acf, 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_93865_isNativeReflectConstruct = function() { return !!result; })(); } function _fun93868(a0) { // fn#93868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:1968, offset: 0x020c7b31, size: 203 bytes, params: 2, frame: 16 const EntitlementGiftGroupCard2 = EntitlementGiftGroupCard; Inherits(EntitlementGiftGroupCard2, a0); return CreateClass(EntitlementGiftGroupCard2, [{key: 'componentDidMount', value: function() { var Date = global.Date; this._mountedAt = Date.now(); }}, {key: 'renderGenerateGiftCodeRow', value: value_93873}, {key: 'renderHeader', value: value_93874}, {key: 'getCardHeaderThumbnail', value: value_93875}, {key: 'renderCardHeader', value: value_93876}, {key: 'render', value: value_93877}]); function EntitlementGiftGroupCard(a0) { // fn#93869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:1980, offset: 0x020c7bfc, size: 181 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, EntitlementGiftGroupCard); const items2 = []; arraySpread(items2, value, 0, items2); value = env1_6(EntitlementGiftGroupCard); binding = env1_5; if (_isNativeReflectConstruct_93865()) { Reflect = global.Reflect; value = Reflect.construct(value, items2, env1_6(this).constructor); r0 = value; } else { value = value.apply(this, items2); r0 = value; } value = binding(this, r0); value._mountedAt = null; value.state = {isOpen: false}; value.handleToggleOpen = handleToggleOpen; value.handleGenerateGiftCode = handleGenerateGiftCode; return value; function handleToggleOpen() { // fn#93870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:2295, owner: EntitlementGiftGroupCard.handleToggleOpen, offset: 0x020c7cb1, size: 138 bytes, params: 1, frame: 16 var value6; let binding = env0_0; const {skuId, subscriptionPlanId, loadedAt} = binding.props; const value2 = !binding.state.isOpen; let r1 = loadedAt != null && env0_0._mountedAt != null; r1 = !r1 ? !value2 : r1; if (!r1) { value6 = environment.__proto__.__proto__; (importDefault(8451) /* metro dependency 8451: GiftCodeActionCreators */).fetchUserGiftCodesForSKU(skuId, subscriptionPlanId); } binding = env0_0; binding.setState({isOpen: value2}); } function handleGenerateGiftCode() { // fn#93871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:2499, owner: EntitlementGiftGroupCard.handleGenerateGiftCode, offset: 0x020c7d3b, size: 69 bytes, params: 1, frame: 16 const {skuId, subscriptionPlanId, giftStyle} = env0_0.props; const value = environment.__proto__.__proto__; (GiftCodeActionCreators).createGiftCode(skuId, subscriptionPlanId, giftStyle); } } function value_93873() { // fn#93873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:2774, offset: 0x020c7d9e, size: 349 bytes, params: 1, frame: 26 const value2 = env1_21(this.context); const isRefreshEnabled = this.props.isRefreshEnabled; const items2 = [value2.generateGiftRow]; items2[1] = isRefreshEnabled ? null : value2.generateGiftRowLegacy; const Text = (TextModule).Text; const generateGiftRowText = value2.generateGiftRowText; const intl = (IndexNativeModule).intl; const text = ( {intl.string((IndexNativeModule).t.lELyPj)} ); const generateButtonContainer = value2.generateButtonContainer; const generateGiftButton = value2.generateGiftButton; const Button = (ButtonNativeModule).Button; return ( {text}