/* Metro module 14631; source: modules/premium/powerups/native/GuildPowerupsLevelCard.tsx; dependencies: [31, 27, 8259, 661, 14632, 33, 4501, 697, 4589, 7958, 14633, 14634, 4573, 1244, 2256, 14635, 14636, 14637, 14660, 14644, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import GuildPowerupsMessages from '../GuildPowerups.messages.js'; /* Metro dependency 2256 */
import LinearGradient from '../../../../by-id/module-04589-LinearGradient.js'; /* Metro dependency 4589 */
import UseGuildPowerupColorConfig from './hooks/useGuildPowerupColorConfig.tsx'; /* Metro dependency 14633 */
import UsePowerupActiveStatus from '../hooks/usePowerupActiveStatus.tsx'; /* Metro dependency 14635 */
import UseGuildPowerupOnShowMore from './hooks/useGuildPowerupOnShowMore.tsx'; /* Metro dependency 14637 */
import GuildPowerupsCard from './GuildPowerupsCard.tsx'; /* Metro dependency 14660 */
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 IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as BoostGemIconModule from '../../../../design/components/Icon/native/redesign/generated/BoostGemIcon.tsx'; /* Metro dependency 7958 */
import * as GuildPowerupsConstantsModule from '../constants/GuildPowerupsConstants.tsx'; /* Metro dependency 8259 */
import * as GuildBoostingMarketingConstantsModule from '../../../guild_boosting/GuildBoostingMarketingConstants.tsx'; /* Metro dependency 14632 */
import * as GuildBoostingMarketingUtilsModule from '../../../guild_boosting/native/GuildBoostingMarketingUtils.tsx'; /* Metro dependency 14634 */
import * as UseCalculatePowerupCardStatusModule from '../utils/useCalculatePowerupCardStatus.tsx'; /* Metro dependency 14636 */
import * as GuildPowerupsCardFooterModule from './GuildPowerupsCardFooter.tsx'; /* Metro dependency 14644 */
function _fun110585(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:6, offset: 0x0237e1fe, size: 1002 bytes, params: 8, frame: 25
const env0_0 = require;
const GuildPowerupLevelBody2 = GuildPowerupLevelBody;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = GuildPowerupsConstantsModule;
const env0_5 = value.LevelCardPosition;
const env0_6 = value.PowerupActiveStatusType;
value = require(661) /* metro dependency 661: Constants */;
const env0_7 = value.BoostedGuildTiers;
const env0_8 = value.HorizontalGradient;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
object.cardContainer = {flex: 1};
object.card = {'padding': 0, 'overflow': 'hidden', 'flex': 1};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object.progressContainer = {marginVertical: PX_24, position: 'relative'};
let BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
object.progress = {height: 6, backgroundColor: BACKGROUND_MOD_SUBTLE};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.progressStart = {marginStart: PX_16};
const object6 = {};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.marginEnd = PX_16;
object6.borderTopEndRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object6.borderBottomEndRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.progressEnd = object6;
const object7 = {'backgroundColor': null, 'width': 28, 'height': 28, 'start': null, 'top': -11};
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
object7.backgroundColor = CARD_BACKGROUND_DEFAULT;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object7.start = PX_16 - 2;
object.boostContainerBackground = object7;
const object8 = {'padding': null, 'borderRadius': null, 'position': 'absolute', 'width': 24, 'height': 24,
'top': -9, 'start': null, 'alignItems': 'center', 'justifyContent': 'center'};
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object8.padding = PX_4;
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object8.start = PX_16;
BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
object8.backgroundColor = BACKGROUND_MOD_SUBTLE;
object.boostContainer = object8;
const GUILD_BOOSTING_PINK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GUILD_BOOSTING_PINK;
object.boostContainerActive = {backgroundColor: GUILD_BOOSTING_PINK};
BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
object.boostContainerInactive = {backgroundColor: BACKGROUND_MOD_SUBTLE};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.contentContainer = {'padding': null, 'paddingTop': 0, 'flex': 1, padding: PX_16};
const object10 = {flexDirection: 'column'};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object10.marginTop = PX_16;
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object10.gap = PX_8;
object.perkRowContainer = object10;
object.perkRow = {'flexDirection': 'row', 'alignItems': 'center'};
object.perkRowStyle = {'flexDirection': 'row', 'alignItems': 'center'};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.perkText = {marginStart: PX_8};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.footerContainer = {marginTop: 'auto', paddingTop: PX_16};
const env0_12 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/premium/powerups/native/GuildPowerupsLevelCard.tsx');
exports.default = GuildPowerupsLevelCard;
exports.GuildPowerupLevelBody = GuildPowerupLevelBody2;
function GuildLevelPowerupHeader({active, nextActive, position}) { // fn#110586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:1616, offset: 0x0237e5e8, size: 519 bytes, params: 2, frame: 23
var r7;
var boostContainerInactive;
var backgroundColor;
var items3;
var boostContainerActive;
const styles = useStyles();
if (active) {
if (nextActive !== false) {
boostContainerActive = styles.boostContainerActive;
backgroundColor = boostContainerActive.backgroundColor;
items3 = [backgroundColor];
boostContainerActive = styles.boostContainerActive;
backgroundColor = boostContainerActive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
} else if (active) {
if (nextActive === false) {
backgroundColor = styles.boostContainerActive.backgroundColor;
items3 = [backgroundColor];
backgroundColor = styles.boostContainerInactive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
} else {
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3 = [backgroundColor];
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
}
} else {
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3 = [backgroundColor];
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
}
} else if (active) {
if (nextActive === false) {
backgroundColor = styles.boostContainerActive.backgroundColor;
items3 = [backgroundColor];
backgroundColor = styles.boostContainerInactive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
} else {
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3 = [backgroundColor];
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
}
} else {
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3 = [backgroundColor];
boostContainerInactive = styles.boostContainerInactive;
backgroundColor = boostContainerInactive.backgroundColor;
items3[1] = backgroundColor;
r7 = items3;
}
const defaultImport = LinearGradient;
const object = {};
let START = HorizontalGradient.START;
object.start = START;
let END = HorizontalGradient.END;
object.end = END;
object.colors = r7;
START = LevelCardPosition.START;
END = LevelCardPosition.END;
object.style = [styles.progress, position === START && styles.progressStart, position === END && styles.progressEnd];
const items2 = [
((Component) => )(defaultImport),
];
items2[1] = ;
const items4 = [styles.boostContainer];
items4[1] = active && styles.boostContainerActive;
const BoostGemIcon = (BoostGemIconModule).BoostGemIcon;
const WHITE = (Native).colors.WHITE;
items2[2] = (
);
return (
{items2}
);
}
function GuildPowerupLevelBody({isActive, index}) { // fn#110587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:2324, offset: 0x0237e7ef, size: 296 bytes, params: 2, frame: 25
const styles = useStyles();
const {textColor,
iconColor} = (UseGuildPowerupColorConfig)(isActive);
const value3 = iconColor.useMemo(_fun110588, [index, iconColor, textColor, styles]);
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
return (
{value3}
{intl.string((GuildPowerupsMessages).nIj3LZ)}
);
function _fun110588() { // fn#110588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:2442, offset: 0x0237e917, size: 113 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
const property = TIER_CARDS[index];
if (property == null) {
return [];
}
const tier = property.tier;
const TIER_3 = BoostedGuildTiers.TIER_3;
return (tier === TIER_3 ? property.perks.slice(0, -1) : property.perks)?.map(_fun110589);
function _fun110589(a0, a1) { // fn#110589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:2559, offset: 0x0237e988, size: 233 bytes, params: 3, frame: 24
const iconForPerk = (GuildBoostingMarketingUtilsModule).getIconForPerk(a0.perkIcon);
const stylesBinding = styles;
const perkRowStyle = stylesBinding.perkRowStyle;
const iconForPerk2 = ((Component) => )(iconForPerk);
const Text = (TextModule).Text;
return (
{iconForPerk2}
{a0.getCopy()}
);
}
}
}
function GuildPowerupsLevelCard({guildId, powerup, nextPowerup, index, isScrollingRef}) { // fn#110590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:3089, offset: 0x0237ea71, size: 583 bytes, params: 2, frame: 30
const styles = useStyles();
const value3 = (UsePowerupActiveStatus)(guildId, powerup);
const value4 = (UsePowerupActiveStatus)(guildId, nextPowerup);
const value5 = (UseCalculatePowerupCardStatusModule).useCalculatePowerupCardStatus(powerup,
value3, false);
let type = value3.type;
let INACTIVE = PowerupActiveStatusType.INACTIVE;
const value6 = type !== INACTIVE;
type = value4.type;
INACTIVE = PowerupActiveStatusType.INACTIVE;
const value7 = type !== INACTIVE;
const value8 = (UseGuildPowerupOnShowMore)(guildId, powerup);
const r7 = index === 0 ? LevelCardPosition.START : nextPowerup == null ? LevelCardPosition.END : LevelCardPosition.MIDDLE;
const value9 = ReactModule.useCallback(_fun110591, [isScrollingRef, value8]);
const guildLevelPowerupHeader = (
);
const Text = (TextModule).Text;
const items2 = [
{powerup.title}
,
];
items2[1] = ;
const GuildPowerupsCardFooter = (GuildPowerupsCardFooterModule).GuildPowerupsCardFooter;
items2[2] = (
);
return (
{guildLevelPowerupHeader}
{items2}
);
function _fun110591() { // fn#110591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14828:3396, offset: 0x0237ecb8, size: 29 bytes, params: 1, frame: 9
if (!isScrollingRef.current) {
env0_1();
}
}
}
}
global.__d(_fun110585, 14631, [31, 27, 8259, 661, 14632, 33, 4501, 697, 4589, 7958, 14633, 14634, 4573, 1244, 2256,
14635, 14636, 14637, 14660, 14644,
2]) /* metro module 14631, dependencies: [31, 27, 8259, 661, 14632, 33, 4501, 697, 4589, 7958, 14633, 14634, 4573, 1244, 2256, 14635, 14636, 14637, 14660, 14644, 2] */;