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,44 +1,55 @@
/* Metro module 7701; source: modules/client_themes/native/ClientThemesOverrides.tsx; dependencies: [31, 4501, 3963, 7702, 2] */
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 ClientThemesUtilsModule from './ClientThemesUtils.tsx'; /* Metro dependency 3963 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
function _fun61486(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:6, offset: 0x01b41d2e, size: 195 bytes, params: 8, frame: 20
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(4501) /* metro dependency 4501: createStyles */).createStyles({none: {backgroundColor: 'transparent'}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/ClientThemesOverrides.tsx');
const env0_4 = (CreateStylesModule).createStyles({none: {backgroundColor: 'transparent'}});
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/ClientThemesOverrides.tsx');
exports.useGradientBottom = useGradientBottom;
exports.useGradientTop = useGradientTop;
exports.useGradientMidpoint = useGradientMidpoint;
exports.useClientThemesOverride = function(a0) {
return importDefault(dependencyMap[3])() ? a0 ?? useStyles().none : undefined;
};
function useGradientBottom() { // fn#61487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:277, offset: 0x01b41df1, size: 93 bytes, params: 1, frame: 17
const useGradientValue = ClientThemesUtilsModule.useGradientValue;
const GradientPercentage = ClientThemesUtilsModule.GradientPercentage;
const END = GradientPercentage.END;
return ReactModule.useMemo(_fun61488, [Reflect.apply(useGradientValue, ClientThemesUtilsModule, [END])]);
function _fun61488() { // fn#61488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:363, offset: 0x01b41e4e, size: 33 bytes, params: 1, frame: 3
return env0_0 != null ? {backgroundColor: env0_0} : undefined;
}
}
function useGradientTop() { // fn#61489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:426, offset: 0x01b41e6f, size: 93 bytes, params: 1, frame: 17
const useGradientValue = ClientThemesUtilsModule.useGradientValue;
const GradientPercentage = ClientThemesUtilsModule.GradientPercentage;
const START = GradientPercentage.START;
return ReactModule.useMemo(_fun61490, [Reflect.apply(useGradientValue, ClientThemesUtilsModule, [START])]);
function _fun61490() { // fn#61490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:514, offset: 0x01b41e4e, size: 33 bytes, params: 1, frame: 3
return env0_0 != null ? {backgroundColor: env0_0} : undefined;
}
}
function useGradientMidpoint() { // fn#61491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:582, offset: 0x01b41ecc, size: 93 bytes, params: 1, frame: 17
const useGradientValue = ClientThemesUtilsModule.useGradientValue;
const GradientPercentage = ClientThemesUtilsModule.GradientPercentage;
const MID = GradientPercentage.MID;
return ReactModule.useMemo(_fun61492, [Reflect.apply(useGradientValue, ClientThemesUtilsModule, [MID])]);
function _fun61492() { // fn#61492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:668, offset: 0x01b41e4e, size: 33 bytes, params: 1, frame: 3
return env0_0 != null ? {backgroundColor: env0_0} : undefined;
}
}
}
function useGradientBottom() { // fn#61487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:277, offset: 0x01b41df1, size: 93 bytes, params: 1, frame: 17
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
const useGradientValue = clientThemesUtilsModule.useGradientValue;
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
const END = GradientPercentage.END;
return env0_3.useMemo(_fun61488, [Reflect.apply(useGradientValue, clientThemesUtilsModule, [END])]);
}
function useGradientTop() { // fn#61489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:426, offset: 0x01b41e6f, size: 93 bytes, params: 1, frame: 17
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
const useGradientValue = clientThemesUtilsModule.useGradientValue;
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
const START = GradientPercentage.START;
return env0_3.useMemo(_fun61490, [Reflect.apply(useGradientValue, clientThemesUtilsModule, [START])]);
}
function useGradientMidpoint() { // fn#61491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:582, offset: 0x01b41ecc, size: 93 bytes, params: 1, frame: 17
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
const useGradientValue = clientThemesUtilsModule.useGradientValue;
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
const MID = GradientPercentage.MID;
return env0_3.useMemo(_fun61492, [Reflect.apply(useGradientValue, clientThemesUtilsModule, [MID])]);
}
function _fun61488() { // fn#61488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:363, offset: 0x01b41e4e, size: 33 bytes, params: 1, frame: 3
return env0_0 != null ? {backgroundColor: env0_0} : undefined;
}
global.__d(_fun61486, 7701, [31, 4501, 3963, 7702,
2]) /* metro module 7701, dependencies: [31, 4501, 3963, 7702, 2] */;
@@ -1,8 +1,20 @@
/* Metro module 3963; source: modules/client_themes/native/ClientThemesUtils.tsx; dependencies: [57, 31, 1310, 3964, 1354, 697, 674, 4000, 4001, 3966, 4002, 4003, 4048, 4045, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Module00674 from '../../../by-id/module-00674.js'; /* Metro dependency 674 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
import CustomThemeMobileStore from './CustomThemeMobileStore.tsx'; /* Metro dependency 1354 */
import ClientThemesBackgroundStore from '../ClientThemesBackgroundStore.tsx'; /* Metro dependency 3964 */
import Color from '../../../utils/Color.tsx'; /* Metro dependency 4001 */
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 ClientThemesTypesModule from '../ClientThemesTypes.tsx'; /* Metro dependency 3966 */
import * as ColorUtilsModule from '../../../utils/ColorUtils.tsx'; /* Metro dependency 4000 */
import * as MobileThemesUtilsModule from './MobileThemesUtils.tsx'; /* Metro dependency 4045 */
function _fun32428(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#32428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:6, offset: 0x0101522b, size: 844 bytes, params: 8, frame: 25
var object4;
const env0_0 = require;
const closure = getClientThemesGradientColorByPercentage;
const getClientThemesGradientColorByPercentage2 = getClientThemesGradientColorByPercentage;
const closure2 = function({colors}) {
return colors.map(_fun32433);
};
@@ -14,341 +26,340 @@ function _fun32428(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
object4 = {LEVEL_9: 0.9};
object4[0.9] = 'LEVEL_9';
object4.LEVEL_85 = 0.85;
object4[0.85] = 'LEVEL_85';
object4.LEVEL_8 = 0.8;
object4[0.8] = 'LEVEL_8';
object4.LEVEL_75 = 0.75;
object4[0.75] = 'LEVEL_75';
object4.LEVEL_7 = 0.7;
object4[0.7] = 'LEVEL_7';
object4.LEVEL_6 = 0.6;
object4[0.6] = 'LEVEL_6';
object4.LEVEL_5 = 0.5;
object4[0.5] = 'LEVEL_5';
object4.LEVEL_4 = 0.4;
object4[0.4] = 'LEVEL_4';
object4.LEVEL_35 = 0.35;
object4[0.35] = 'LEVEL_35';
object4.LEVEL_3 = 0.3;
object4[0.3] = 'LEVEL_3';
object4.LEVEL_25 = 0.25;
object4[0.25] = 'LEVEL_25';
object4.LEVEL_2 = 0.2;
object4[0.2] = 'LEVEL_2';
object4.LEVEL_15 = 0.15;
object4[0.15] = 'LEVEL_15';
object4.LEVEL_1 = 0.1;
object4[0.1] = 'LEVEL_1';
const object5 = {};
const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
object5.DARK = BLACK;
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
object5.LIGHT = WHITE;
const object6 = {START: 0};
object6[0] = 'START';
object6.MID = 50;
object6[50] = 'MID';
object6.END = 100;
object6[100] = 'END';
const closure4 = colorToHex;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/ClientThemesUtils.tsx');
object = {LEVEL_9: 0.9};
object[0.9] = 'LEVEL_9';
object.LEVEL_85 = 0.85;
object[0.85] = 'LEVEL_85';
object.LEVEL_8 = 0.8;
object[0.8] = 'LEVEL_8';
object.LEVEL_75 = 0.75;
object[0.75] = 'LEVEL_75';
object.LEVEL_7 = 0.7;
object[0.7] = 'LEVEL_7';
object.LEVEL_6 = 0.6;
object[0.6] = 'LEVEL_6';
object.LEVEL_5 = 0.5;
object[0.5] = 'LEVEL_5';
object.LEVEL_4 = 0.4;
object[0.4] = 'LEVEL_4';
object.LEVEL_35 = 0.35;
object[0.35] = 'LEVEL_35';
object.LEVEL_3 = 0.3;
object[0.3] = 'LEVEL_3';
object.LEVEL_25 = 0.25;
object[0.25] = 'LEVEL_25';
object.LEVEL_2 = 0.2;
object[0.2] = 'LEVEL_2';
object.LEVEL_15 = 0.15;
object[0.15] = 'LEVEL_15';
object.LEVEL_1 = 0.1;
object[0.1] = 'LEVEL_1';
const object2 = {};
const BLACK = (Native).unsafe_rawColors.BLACK;
object2.DARK = BLACK;
const WHITE = (Native).unsafe_rawColors.WHITE;
object2.LIGHT = WHITE;
const object3 = {START: 0};
object3[0] = 'START';
object3.MID = 50;
object3[50] = 'MID';
object3.END = 100;
object3[100] = 'END';
const colorToHex2 = colorToHex;
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/ClientThemesUtils.tsx');
exports.GRADIENT_ANGLE_BREAKPOINT = 128;
exports.OverlayOpacity = object4;
exports.OverlayColors = object5;
exports.GradientPercentage = object6;
exports.colorToHex = closure4;
exports.getClientThemesGradientColorByPercentage = closure;
exports.OverlayOpacity = object;
exports.OverlayColors = object2;
exports.GradientPercentage = object3;
exports.colorToHex = colorToHex2;
exports.getClientThemesGradientColorByPercentage = getClientThemesGradientColorByPercentage2;
exports.getClientThemesGradientHexColors = closure2;
exports.getGradientThemeMetadata = getGradientThemeMetadata;
exports.getGradientValue = closure3;
exports.useGradientValue = useGradientValue;
exports.getEmbedScrollGradientBackground = getEmbedScrollGradientBackground;
exports.getEmbedBackground = getEmbedBackground;
}
function getMixWithOpacity({r, g, b}, {r, g, b}, a2) { // fn#32429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:791, offset: 0x01015577, size: 164 bytes, params: 4, frame: 25
const colorToHexBinding = colorToHex;
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
const mixColors = colorUtilsModule.mixColors;
let value = importDefault(4001) /* metro dependency 4001: Color */;
value = new value(r, g, b, a2);
const defaultImport = importDefault(4001) /* metro dependency 4001: Color */;
const value3 = 1 - a2;
const value4 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
const defaultImport2 = new defaultImport(r, g, b, value3);
return colorToHexBinding(Reflect.apply(mixColors, colorUtilsModule, [value,
defaultImport2 instanceof Object ? defaultImport2 : value4]));
}
function getClientThemesGradientColorByPercentage(a0, a1) { // fn#32430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:924, offset: 0x0101561b, size: 149 bytes, params: 3, frame: 16
const value = env0_3((importDefault(674) /* metro dependency 674 */).scale(getClientThemesGradientHexColors(a0)).domain(a0.colors.map(function(a0) {
return a0.stop;
}))(a1).rgb(), 3);
return {r: value[0], g: value[1], b: value[2]};
}
function getClientThemesGradientHexColors({colors}) { // fn#32432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1126, offset: 0x010156bb, size: 27 bytes, params: 2, frame: 11
return colors.map(function(a0) {
return importDefault(dependencyMap[5]).unsafe_rawColors[a0.token];
});
}
function getGradientColorByPercentage(a0, a1) { // fn#32435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1373, offset: 0x0101574a, size: 254 bytes, params: 3, frame: 19
const type = a0.type;
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
if (type === BACKGROUND_GRADIENT_PRESET) {
return getClientThemesGradientColorByPercentage(a0, a1);
function getMixWithOpacity({r, g, b}, {r, g, b}, a2) { // fn#32429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:791, offset: 0x01015577, size: 164 bytes, params: 4, frame: 25
const colorToHexBinding = colorToHex;
const mixColors = ColorUtilsModule.mixColors;
let value = Color;
value = new value(r, g, b, a2);
const defaultImport = Color;
const value3 = 1 - a2;
const value4 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
const defaultImport2 = new defaultImport(r, g, b, value3);
return colorToHexBinding(Reflect.apply(mixColors, ColorUtilsModule, [value,
defaultImport2 instanceof Object ? defaultImport2 : value4]));
}
const colors = a0.customThemeSettings.colors;
if (colors.length === 1) {
return (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(colors[0]);
function getClientThemesGradientColorByPercentage(a0, a1) { // fn#32430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:924, offset: 0x0101561b, size: 149 bytes, params: 3, frame: 16
const value = Module00057((importDefault(674) /* metro dependency 674 */).scale(getClientThemesGradientHexColors(a0)).domain(a0.colors.map(function(a0) {
return a0.stop;
}))(a1).rgb(), 3);
return {r: value[0], g: value[1], b: value[2]};
}
const value2 = colors.map(function(a0, a1) {
return a1 / (colors.length - 1) * 100;
});
const value3 = (importDefault(674) /* metro dependency 674 */).scale(colors);
const value = env0_3(value3.domain(value2)(a1).rgb(), 3);
return {r: value[0], g: value[1], b: value[2]};
}
function getBottomColorWithOpacity(a0, a1, a2) { // fn#32437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1733, offset: 0x0101586b, size: 76 bytes, params: 4, frame: 17
return getMixWithOpacity(getGradientColorByPercentage(a0,
getGradientAngle(a0) > env0_8 ? env0_11.END : env0_11.START), a1, a2);
}
function getTopColorWithOpacity(a0, a1, a2) { // fn#32438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1873, offset: 0x010158b7, size: 76 bytes, params: 4, frame: 17
return getMixWithOpacity(getGradientColorByPercentage(a0,
getGradientAngle(a0) > env0_8 ? env0_11.START : env0_11.END), a1, a2);
}
function calculateGradientValueWithOpacity(a0, a1, a2, a3) { // fn#32439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:2010, offset: 0x01015903, size: 512 bytes, params: 5, frame: 23
var r3;
var r0;
var isThemeDark3;
let value = a1;
const value2 = a3;
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(a2);
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
const hexToRgb = colorUtilsModule.hexToRgb;
let binding = env0_10;
const r4 = isThemeDark2 ? Reflect.apply(hexToRgb, colorUtilsModule, [binding.DARK]) : Reflect.apply(hexToRgb,
colorUtilsModule, [binding.LIGHT]);
let type = a0.type;
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
let r8 = type !== BACKGROUND_GRADIENT_PRESET ? env0_11.MID : a0.midpointPercentage ?? env0_11.MID;
r8 = value ?? r8;
type = a0.type;
const CUSTOM_BACKGROUND_GRADIENT = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
if (type === CUSTOM_BACKGROUND_GRADIENT) {
value = a0.customThemeSettings.baseMix / 100;
if (value2 != null) {
r0 = value2;
} else {
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(a2);
value = 0.2 * value;
r0 = isThemeDark3 ? 0.12 + value : 0.3 + value;
function getClientThemesGradientHexColors({colors}) { // fn#32432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1126, offset: 0x010156bb, size: 27 bytes, params: 2, frame: 11
return colors.map(function(a0) {
return importDefault(dependencyMap[5]).unsafe_rawColors[a0.token];
});
function _fun32433({token}) { // fn#32433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1192, offset: 0x010156d6, size: 45 bytes, params: 2, frame: 11
return (Native).unsafe_rawColors[token];
}
r3 = r0;
} else if (value2 != null) {
r3 = value2;
} else {
value = require(4002) /* metro dependency 4002: shared */;
value = value.isThemeDark(a2);
binding = env0_9;
r3 = value ? binding.LEVEL_2 : binding.LEVEL_4;
}
value = getGradientAngle(a0);
const START = env0_11.START;
return r8 === START ? value < env0_8 ? getBottomColorWithOpacity(a0, r4, r3) : getTopColorWithOpacity(a0, r4,
r3) : r8 === env0_11.END ? value > env0_8 ? getBottomColorWithOpacity(a0, r4, r3) : getTopColorWithOpacity(a0,
r4, r3) : getMixWithOpacity(getGradientColorByPercentage(a0, r8), r4, r3);
}
function colorToHex({red, green, blue}) { // fn#32441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:742, offset: 0x01015b21, size: 76 bytes, params: 2, frame: 15
let value = importDefault(674) /* metro dependency 674 */;
value = value.rgb(red, green, blue);
return value.hex('rgb');
}
function getGradientColorByPercentage(a0, a1) { // fn#32435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1373, offset: 0x0101574a, size: 254 bytes, params: 3, frame: 19
const type = a0.type;
const ClientThemeType = (ClientThemesTypesModule).ClientThemeType;
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
if (type === BACKGROUND_GRADIENT_PRESET) {
return getClientThemesGradientColorByPercentage(a0, a1);
}
const colors = a0.customThemeSettings.colors;
if (colors.length === 1) {
return (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(colors[0]);
}
const value2 = colors.map(function(a0, a1) {
return a1 / (colors.length - 1) * 100;
});
const value3 = (Module00674).scale(colors);
const value = Module00057(value3.domain(value2)(a1).rgb(), 3);
return {r: value[0], g: value[1], b: value[2]};
}
function getGradientThemeMetadata(a0, a1) { // fn#32442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:3241, offset: 0x01015b6d, size: 608 bytes, params: 3, frame: 33
var r10;
var r3;
var r4;
var colors;
var value7;
var indexOf;
var Math;
var min;
var items;
var value9;
var defaultImport;
var max;
var value10;
if (a0 == null) {
function getBottomColorWithOpacity(a0, a1, a2) { // fn#32437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1733, offset: 0x0101586b, size: 76 bytes, params: 4, frame: 17
return getMixWithOpacity(getGradientColorByPercentage(a0,
getGradientAngle(a0) > env0_8 ? env0_11.END : env0_11.START), a1, a2);
}
function getTopColorWithOpacity(a0, a1, a2) { // fn#32438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1873, offset: 0x010158b7, size: 76 bytes, params: 4, frame: 17
return getMixWithOpacity(getGradientColorByPercentage(a0,
getGradientAngle(a0) > env0_8 ? env0_11.START : env0_11.END), a1, a2);
}
function calculateGradientValueWithOpacity(a0, a1, a2, a3) { // fn#32439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:2010, offset: 0x01015903, size: 512 bytes, params: 5, frame: 23
var r3;
var r0;
var isThemeDark3;
let value = a1;
const value2 = a3;
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(a2);
const hexToRgb = ColorUtilsModule.hexToRgb;
let binding = env0_10;
const r4 = isThemeDark2 ? Reflect.apply(hexToRgb, ColorUtilsModule, [binding.DARK]) : Reflect.apply(hexToRgb,
ColorUtilsModule, [binding.LIGHT]);
let type = a0.type;
const ClientThemeType = (ClientThemesTypesModule).ClientThemeType;
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
let r8 = type !== BACKGROUND_GRADIENT_PRESET ? env0_11.MID : a0.midpointPercentage ?? env0_11.MID;
r8 = value ?? r8;
type = a0.type;
const CUSTOM_BACKGROUND_GRADIENT = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
if (type === CUSTOM_BACKGROUND_GRADIENT) {
value = a0.customThemeSettings.baseMix / 100;
if (value2 != null) {
r0 = value2;
} else {
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(a2);
value = 0.2 * value;
r0 = isThemeDark3 ? 0.12 + value : 0.3 + value;
}
r3 = r0;
} else if (value2 != null) {
r3 = value2;
} else {
value = require(4002) /* metro dependency 4002: shared */;
value = value.isThemeDark(a2);
binding = env0_9;
r3 = value ? binding.LEVEL_2 : binding.LEVEL_4;
}
value = getGradientAngle(a0);
const START = env0_11.START;
return r8 === START ? value < env0_8 ? getBottomColorWithOpacity(a0, r4, r3) : getTopColorWithOpacity(a0, r4,
r3) : r8 === env0_11.END ? value > env0_8 ? getBottomColorWithOpacity(a0, r4, r3) : getTopColorWithOpacity(a0,
r4, r3) : getMixWithOpacity(getGradientColorByPercentage(a0, r8), r4, r3);
}
function colorToHex({red, green, blue}) { // fn#32441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:742, offset: 0x01015b21, size: 76 bytes, params: 2, frame: 15
let value = Module00674;
value = value.rgb(red, green, blue);
return value.hex('rgb');
}
function getGradientThemeMetadata(a0, a1) { // fn#32442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:3241, offset: 0x01015b6d, size: 608 bytes, params: 3, frame: 33
var r10;
var r3;
var r4;
var colors;
var value7;
var indexOf;
var Math;
var min;
var items2;
var value9;
var defaultImport;
var max;
var value10;
if (a0 == null) {
return null;
}
if (a1 == null) {
return null;
}
var value;
const getGradientValueBinding = getGradientValue;
const START = env0_11.START;
const gradientValueBinding = getGradientValueBinding(a1, START);
const MID = env0_11.MID;
const gradientValueBinding2 = getGradientValueBinding(a1, MID);
const END = env0_11.END;
const gradientValueBinding3 = getGradientValueBinding(a1, END);
const gradientAngle = getGradientAngle(a1);
const r6 = gradientAngle > env0_8 ? gradientValueBinding : gradientValueBinding3;
const r5 = gradientAngle > env0_8 ? gradientValueBinding3 : gradientValueBinding;
let type = a1.type;
const ClientThemeType = (ClientThemesTypesModule).ClientThemeType;
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
const r11 = type === BACKGROUND_GRADIENT_PRESET ? getClientThemesGradientHexColors(a1) : a1.customThemeSettings.colors;
const property = r11[0];
const property2 = r11[r11.length - 1];
type = a1.type;
const CUSTOM_BACKGROUND_GRADIENT = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
if (type !== CUSTOM_BACKGROUND_GRADIENT) {
r3 = property2;
r4 = property;
} else {
colors = a1.customThemeSettings.colors;
value7 = colors.map(_fun32443);
value = importDefault(674) /* metro dependency 674 */;
indexOf = value7.indexOf;
Math = global.Math;
min = Math.min;
items2 = [];
value = value(colors[Reflect.apply(indexOf, value7, [apply(min, items2, Math, arraySpread(items2, value7, 0,
undefined))])]);
value = value.set('hsl.s', 0.2);
value9 = value.set('hsl.l', 0.7).hex();
defaultImport = importDefault(674) /* metro dependency 674 */;
indexOf = value7.indexOf;
Math = global.Math;
max = Math.max;
items2 = [];
arraySpread(items2, value7, 0, value);
value = defaultImport(colors[Reflect.apply(indexOf, value7, [apply(max, items2, Math, value)])]);
value = value.set('hsl.s', 0.2);
value = value.set('hsl.l', 0.9);
value = value.hex();
value10 = a0 === 'dark';
r10 = value10 ? value9 : value;
r3 = value10 ? value : value9;
r4 = r10;
}
return {theme: a0, colors: {['gradient.start']: gradientValueBinding, ['gradient.mid']: gradientValueBinding2,
['gradient.end']: gradientValueBinding3, ['gradient.top']: r6, ['gradient.bottom']: r5,
['gradient.primary']: r4, ['gradient.secondary']: r3}};
function _fun32443(a0) { // fn#32443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:3748, offset: 0x01015dcd, size: 45 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value(a0);
return value.luminance();
}
}
function useGradientValue(a0, a1) { // fn#32444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4184, offset: 0x01015dfa, size: 147 bytes, params: 3, frame: 20
const env0_0 = a0;
const env0_1 = a1;
const value2 = undefined;
return ReactModule.useMemo(_fun32445, [(importDefault(4003) /* metro dependency 4003: useColorThemeBackground */)(),
a1 == null ? value2 : a1.dark, a1 == null ? value2 : a1.light, a0,
(importDefault(4048) /* metro dependency 4048: useTheme */)()]);
function _fun32445() { // fn#32445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4265, offset: 0x01015e8d, size: 282 bytes, params: 1, frame: 20
var r5;
var r7;
var calculateGradientValueWithOpacityBinding;
var binding;
var value4;
var isThemeDark2;
var isThemeDark3;
var value5;
var binding3;
var binding4;
if (env0_2 == null) {
return null;
}
const value2 = undefined;
if ((require == null ? value2 : require.dark) != null) {
value4 = environment.__proto__;
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(Module00057);
binding = env1_9;
r5 = isThemeDark2 ? binding.LEVEL_2 : binding.LEVEL_4;
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(Module00057);
value5 = require == null;
r7 = isThemeDark3 ? value5 ? value2 : require.dark : value5 ? value2 : require.light;
calculateGradientValueWithOpacityBinding = calculateGradientValueWithOpacity;
binding = env0_2;
binding3 = env0_0;
binding4 = Module00057;
r5 = r7 ?? r5;
return calculateGradientValueWithOpacityBinding(binding, binding3, binding4, r5);
}
if ((require == null ? value2 : require.light) != null) {
value4 = environment.__proto__;
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(Module00057);
binding = env1_9;
r5 = isThemeDark2 ? binding.LEVEL_2 : binding.LEVEL_4;
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(Module00057);
value5 = require == null;
r7 = isThemeDark3 ? value5 ? value2 : require.dark : value5 ? value2 : require.light;
calculateGradientValueWithOpacityBinding = calculateGradientValueWithOpacity;
binding = env0_2;
binding3 = env0_0;
binding4 = Module00057;
r5 = r7 ?? r5;
return calculateGradientValueWithOpacityBinding(binding, binding3, binding4, r5);
}
return calculateGradientValueWithOpacity(env0_2, env0_0, Module00057);
}
}
function getEmbedScrollGradientBackground() { // fn#32446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4682, offset: 0x01015fa7, size: 83 bytes, params: 1, frame: 14
const customBackgroundGradient = (MobileThemesUtilsModule).getCustomBackgroundGradient();
const value3 = null;
const r4 = value3 != customBackgroundGradient ? customBackgroundGradient : ClientThemesBackgroundStore.gradientPreset;
const r2 = value3 != r4 ? r4 : value3;
return value3 == r2 ? value3 : getGradientValue(r2);
}
function getEmbedBackground() { // fn#32447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4884, offset: 0x01015ffa, size: 144 bytes, params: 1, frame: 15
var r3;
var moduleValue;
var isThemeDark2;
var binding;
var moduleValue2;
const hasCustomTheme2 = CustomThemeMobileStore.hasCustomTheme();
if (ClientThemesBackgroundStore.gradientPreset != null) {
moduleValue = require(4002) /* metro dependency 4002: shared */;
isThemeDark2 = moduleValue.isThemeDark(ThemeStore.theme);
binding = env0_10;
r3 = isThemeDark2 ? binding.DARK : binding.LIGHT;
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
return moduleValue2.hexWithOpacity(r3, env0_9.LEVEL_1);
}
if (hasCustomTheme2) {
moduleValue = require(4002) /* metro dependency 4002: shared */;
isThemeDark2 = moduleValue.isThemeDark(ThemeStore.theme);
binding = env0_10;
r3 = isThemeDark2 ? binding.DARK : binding.LIGHT;
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
return moduleValue2.hexWithOpacity(r3, env0_9.LEVEL_1);
}
return null;
}
if (a1 == null) {
return null;
}
var value;
const getGradientValueBinding = getGradientValue;
const START = env0_11.START;
const gradientValueBinding = getGradientValueBinding(a1, START);
const MID = env0_11.MID;
const gradientValueBinding2 = getGradientValueBinding(a1, MID);
const END = env0_11.END;
const gradientValueBinding3 = getGradientValueBinding(a1, END);
const gradientAngle = getGradientAngle(a1);
const r6 = gradientAngle > env0_8 ? gradientValueBinding : gradientValueBinding3;
const r5 = gradientAngle > env0_8 ? gradientValueBinding3 : gradientValueBinding;
let type = a1.type;
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
const r11 = type === BACKGROUND_GRADIENT_PRESET ? getClientThemesGradientHexColors(a1) : a1.customThemeSettings.colors;
const property = r11[0];
const property2 = r11[r11.length - 1];
type = a1.type;
const CUSTOM_BACKGROUND_GRADIENT = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
if (type !== CUSTOM_BACKGROUND_GRADIENT) {
r3 = property2;
r4 = property;
} else {
colors = a1.customThemeSettings.colors;
value7 = colors.map(_fun32443);
value = importDefault(674) /* metro dependency 674 */;
indexOf = value7.indexOf;
Math = global.Math;
min = Math.min;
items = [];
value = value(colors[Reflect.apply(indexOf, value7, [apply(min, items, Math, arraySpread(items, value7, 0,
undefined))])]);
value = value.set('hsl.s', 0.2);
value9 = value.set('hsl.l', 0.7).hex();
defaultImport = importDefault(674) /* metro dependency 674 */;
indexOf = value7.indexOf;
Math = global.Math;
max = Math.max;
items = [];
arraySpread(items, value7, 0, value);
value = defaultImport(colors[Reflect.apply(indexOf, value7, [apply(max, items, Math, value)])]);
value = value.set('hsl.s', 0.2);
value = value.set('hsl.l', 0.9);
value = value.hex();
value10 = a0 === 'dark';
r10 = value10 ? value9 : value;
r3 = value10 ? value : value9;
r4 = r10;
}
return {theme: a0, colors: {['gradient.start']: gradientValueBinding, ['gradient.mid']: gradientValueBinding2,
['gradient.end']: gradientValueBinding3, ['gradient.top']: r6, ['gradient.bottom']: r5,
['gradient.primary']: r4, ['gradient.secondary']: r3}};
}
function useGradientValue(a0, a1) { // fn#32444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4184, offset: 0x01015dfa, size: 147 bytes, params: 3, frame: 20
const env0_0 = a0;
const env0_1 = a1;
const value2 = undefined;
return env0_4.useMemo(_fun32445, [(importDefault(4003) /* metro dependency 4003: useColorThemeBackground */)(),
a1 == null ? value2 : a1.dark, a1 == null ? value2 : a1.light, a0,
(importDefault(4048) /* metro dependency 4048: useTheme */)()]);
}
function getEmbedScrollGradientBackground() { // fn#32446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4682, offset: 0x01015fa7, size: 83 bytes, params: 1, frame: 14
const customBackgroundGradient = (require(4045) /* metro dependency 4045: MobileThemesUtils */).getCustomBackgroundGradient();
const value3 = null;
const r4 = value3 != customBackgroundGradient ? customBackgroundGradient : ClientThemesBackgroundStore.gradientPreset;
const r2 = value3 != r4 ? r4 : value3;
return value3 == r2 ? value3 : getGradientValue(r2);
}
function getEmbedBackground() { // fn#32447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4884, offset: 0x01015ffa, size: 144 bytes, params: 1, frame: 15
var r3;
var moduleValue;
var isThemeDark2;
var binding;
var moduleValue2;
const hasCustomTheme2 = CustomThemeMobileStore.hasCustomTheme();
if (ClientThemesBackgroundStore.gradientPreset != null) {
moduleValue = require(4002) /* metro dependency 4002: shared */;
isThemeDark2 = moduleValue.isThemeDark(ThemeStore.theme);
binding = env0_10;
r3 = isThemeDark2 ? binding.DARK : binding.LIGHT;
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
return moduleValue2.hexWithOpacity(r3, env0_9.LEVEL_1);
}
if (hasCustomTheme2) {
moduleValue = require(4002) /* metro dependency 4002: shared */;
isThemeDark2 = moduleValue.isThemeDark(ThemeStore.theme);
binding = env0_10;
r3 = isThemeDark2 ? binding.DARK : binding.LIGHT;
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
return moduleValue2.hexWithOpacity(r3, env0_9.LEVEL_1);
}
return null;
}
function _fun32443(a0) { // fn#32443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:3748, offset: 0x01015dcd, size: 45 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = importDefault(674) /* metro dependency 674 */;
value = value(a0);
return value.luminance();
}
function _fun32445() { // fn#32445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4265, offset: 0x01015e8d, size: 282 bytes, params: 1, frame: 20
var r5;
var r7;
var calculateGradientValueWithOpacityBinding;
var binding;
var value4;
var isThemeDark2;
var isThemeDark3;
var value5;
var binding3;
var binding4;
if (env0_2 == null) {
return null;
}
const value2 = undefined;
if ((require == null ? value2 : require.dark) != null) {
value4 = environment.__proto__;
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
binding = env1_9;
r5 = isThemeDark2 ? binding.LEVEL_2 : binding.LEVEL_4;
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
value5 = require == null;
r7 = isThemeDark3 ? value5 ? value2 : require.dark : value5 ? value2 : require.light;
calculateGradientValueWithOpacityBinding = calculateGradientValueWithOpacity;
binding = env0_2;
binding3 = env0_0;
binding4 = env0_3;
r5 = r7 ?? r5;
return calculateGradientValueWithOpacityBinding(binding, binding3, binding4, r5);
}
if ((require == null ? value2 : require.light) != null) {
value4 = environment.__proto__;
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
binding = env1_9;
r5 = isThemeDark2 ? binding.LEVEL_2 : binding.LEVEL_4;
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
value5 = require == null;
r7 = isThemeDark3 ? value5 ? value2 : require.dark : value5 ? value2 : require.light;
calculateGradientValueWithOpacityBinding = calculateGradientValueWithOpacity;
binding = env0_2;
binding3 = env0_0;
binding4 = env0_3;
r5 = r7 ?? r5;
return calculateGradientValueWithOpacityBinding(binding, binding3, binding4, r5);
}
return calculateGradientValueWithOpacity(env0_2, env0_0, env0_3);
}
global.__d(_fun32428, 3963, [57, 31, 1310, 3964, 1354, 697, 674, 4000, 4001, 3966, 4002, 4003, 4048, 4045,
2]) /* metro module 3963, dependencies: [57, 31, 1310, 3964, 1354, 697, 674, 4000, 4001, 3966, 4002, 4003, 4048, 4045, 2] */;
@@ -1,29 +1,33 @@
/* Metro module 11515; source: modules/client_themes/native/CustomThemeMobileActionCreators.tsx; dependencies: [694, 2] */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun88166(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:6, offset: 0x01fd741b, size: 138 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/CustomThemeMobileActionCreators.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/CustomThemeMobileActionCreators.tsx');
exports.updateCustomTheme = updateCustomTheme;
exports.resetCustomTheme = resetCustomTheme;
exports.previewCustomTheme = previewCustomTheme;
exports.clearPreviewTheme = clearPreviewTheme;
function updateCustomTheme(a0, a1) { // fn#88167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:210, offset: 0x01fd74a5, size: 64 bytes, params: 3, frame: 13
(Dispatcher).dispatch({type: 'UPDATE_CUSTOM_THEME', customTheme: a0,
theme: a1});
}
function resetCustomTheme() { // fn#88168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:307, offset: 0x01fd74e5, size: 48 bytes, params: 1, frame: 13
(Dispatcher).dispatch({type: 'RESET_CUSTOM_THEME'});
}
function previewCustomTheme(a0) { // fn#88169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:380, offset: 0x01fd7515, size: 56 bytes, params: 2, frame: 13
(Dispatcher).dispatch({type: 'PREVIEW_CUSTOM_THEME',
previewCustomTheme: a0});
}
function clearPreviewTheme() { // fn#88170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:474, offset: 0x01fd754d, size: 48 bytes, params: 1, frame: 13
(Dispatcher).dispatch({type: 'CLEAR_PREVIEW_CUSTOM_THEME'});
}
}
function updateCustomTheme(a0, a1) { // fn#88167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:210, offset: 0x01fd74a5, size: 64 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'UPDATE_CUSTOM_THEME', customTheme: a0,
theme: a1});
}
function resetCustomTheme() { // fn#88168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:307, offset: 0x01fd74e5, size: 48 bytes, params: 1, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RESET_CUSTOM_THEME'});
}
function previewCustomTheme(a0) { // fn#88169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:380, offset: 0x01fd7515, size: 56 bytes, params: 2, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'PREVIEW_CUSTOM_THEME',
previewCustomTheme: a0});
}
function clearPreviewTheme() { // fn#88170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:474, offset: 0x01fd754d, size: 48 bytes, params: 1, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CLEAR_PREVIEW_CUSTOM_THEME'});
}
global.__d(_fun88166, 11515, [694, 2]) /* metro module 11515, dependencies: [694, 2] */;
@@ -1,17 +1,20 @@
/* Metro module 1354; source: modules/client_themes/native/CustomThemeMobileStore.tsx; dependencies: [6, 7, 15, 17, 18, 1311, 1348, 1313, 670, 1314, 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 SelectivelySyncedUserSettingsStore from '../../user_settings/SelectivelySyncedUserSettingsStore.tsx'; /* Metro dependency 1311 */
import UserSettingsProtoStore from '../../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as UserSettingsConstantsModule from '../../user_settings/UserSettingsConstants.tsx'; /* Metro dependency 670 */
import * as ThemeConstantsModule from '../../user_settings/ThemeConstants.tsx'; /* Metro dependency 1313 */
function _fun15541(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#15541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:6, offset: 0x00e35c82, size: 462 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_5 = importDefault(6) /* metro dependency 6 */;
const env0_6 = importDefault(7) /* metro dependency 7 */;
const env0_7 = importDefault(15) /* metro dependency 15 */;
const env0_8 = importDefault(17) /* metro dependency 17 */;
const env0_9 = importDefault(18) /* metro dependency 18 */;
const selectivelySyncedUserSettingsStore = importDefault(1311) /* metro dependency 1311: SelectivelySyncedUserSettingsStore */;
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const env0_12 = (require(1313) /* metro dependency 1313: ThemeConstants */).PROTO_THEME_MAP_MOBILE;
const env0_13 = (require(670) /* metro dependency 670: UserSettingsConstants */).UserSettingsTypes;
const closure = function() {
env0_2 = undefined;
env0_3 = undefined;
@@ -46,7 +49,7 @@ function _fun15541(global, require, importDefault, importAll, module, exports, d
env0_3 = property == null ? value2 : property.customUserThemeSettings;
return value2;
};
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
const PersistedStore = (Flux).PersistedStore;
let value = _fun15552(PersistedStore);
value.displayName = 'CustomThemeMobileStore';
value.persistKey = 'CustomThemeMobileStore';
@@ -68,109 +71,118 @@ function _fun15541(global, require, importDefault, importAll, module, exports, d
}
}
}, LOGOUT: closure});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/CustomThemeMobileStore.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/CustomThemeMobileStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_15542() { // fn#15542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:235, offset: 0x00e35e50, 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_15542() { // fn#15542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:235, offset: 0x00e35e50, 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_15542_isNativeReflectConstruct = function() {
return !!result;
})();
}
return (_isNativeReflectConstruct_15542_isNativeReflectConstruct = function() {
return !!result;
})();
}
function validate_15545() { // fn#15545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1033, offset: 0x00e35eae, size: 52 bytes, params: 1, frame: 4
return env0_2 != null && (env0_3 != null && env0_3.colors.length !== 0);
}
function getAppearanceSettings(a0) { // fn#15550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:788, offset: 0x00e35f3e, size: 55 bytes, params: 2, frame: 5
const type = a0.type;
const PRELOADED_USER_SETTINGS = UserSettingsTypes.PRELOADED_USER_SETTINGS;
return type !== PRELOADED_USER_SETTINGS ? null : a0.proto == undefined ? undefined : a0.proto.appearance;
}
function _fun15552(a0) { // fn#15552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1106, offset: 0x00e35fd5, size: 210 bytes, params: 2, frame: 16
const closure = CustomThemeMobileStore;
env0_9(closure, a0);
return env0_6(closure, [{key: 'initialize', value: value_15554}, {key: 'getState', value: value_15555},
{key: 'getCustomTheme', value: value_15556}, {key: 'getBaseTheme', value: value_15557}, {key: 'getPreviewTheme',
value: value_15558}, {key: 'getCustomThemeDisplaySettings', value: value_15559}, {key: 'hasCustomTheme',
value: function() {
return validate_15545();
}}]);
}
function CustomThemeMobileStore() { // fn#15553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1118, offset: 0x00e360a7, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_5(this, CustomThemeMobileStore);
const value3 = env1_8(CustomThemeMobileStore);
return env1_7(this, _isNativeReflectConstruct_15542() ? global.Reflect.construct(value3, arguments,
env1_8(this).constructor) : value3.apply(this, arguments));
}
function value_15554(a0) { // fn#15554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1446, offset: 0x00e36118, size: 86 bytes, params: 2, frame: 14
var theme;
var value;
var customTheme;
if (a0 != null) {
theme = a0.theme;
value = environment.__proto__;
customTheme = a0.customTheme;
function validate_15545() { // fn#15545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1033, offset: 0x00e35eae, size: 52 bytes, params: 1, frame: 4
return env0_2 != null && (env0_3 != null && env0_3.colors.length !== 0);
}
this.waitFor(UserSettingsProtoStore, SelectivelySyncedUserSettingsStore);
this.syncWith([SelectivelySyncedUserSettingsStore], handleSelectivelySyncedUserSettingsUpdate);
}
function value_15555() { // fn#15555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1598, offset: 0x00e3616e, size: 56 bytes, params: 1, frame: 11
const value2 = validate_15545();
const object2 = {};
if (value2) {
object2.theme = env1_2;
object2.customTheme = env1_3;
} else {
object2.theme = undefined;
object2.customTheme = undefined;
function getAppearanceSettings(a0) { // fn#15550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:788, offset: 0x00e35f3e, size: 55 bytes, params: 2, frame: 5
const type = a0.type;
const PRELOADED_USER_SETTINGS = UserSettingsTypes.PRELOADED_USER_SETTINGS;
return type !== PRELOADED_USER_SETTINGS ? null : a0.proto == undefined ? undefined : a0.proto.appearance;
}
return object2;
}
function value_15556() { // fn#15556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1715, offset: 0x00e361a6, size: 24 bytes, params: 1, frame: 10
if (validate_15545()) {
return env1_3;
function _fun15552(a0) { // fn#15552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1106, offset: 0x00e35fd5, size: 210 bytes, params: 2, frame: 16
const CustomThemeMobileStore2 = CustomThemeMobileStore;
Inherits(CustomThemeMobileStore2, a0);
return CreateClass(CustomThemeMobileStore2, [{key: 'initialize', value: value_15554}, {key: 'getState',
value: value_15555}, {key: 'getCustomTheme', value: value_15556}, {key: 'getBaseTheme', value: value_15557},
{key: 'getPreviewTheme', value: value_15558}, {key: 'getCustomThemeDisplaySettings', value: value_15559},
{key: 'hasCustomTheme', value: function() {
return validate_15545();
}}]);
function CustomThemeMobileStore() { // fn#15553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1118, offset: 0x00e360a7, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_5(this, CustomThemeMobileStore);
const value3 = env1_8(CustomThemeMobileStore);
return env1_7(this, _isNativeReflectConstruct_15542() ? global.Reflect.construct(value3, arguments,
env1_8(this).constructor) : value3.apply(this, arguments));
}
function value_15554(a0) { // fn#15554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1446, offset: 0x00e36118, size: 86 bytes, params: 2, frame: 14
var theme;
var value;
var customTheme;
if (a0 != null) {
theme = a0.theme;
value = environment.__proto__;
customTheme = a0.customTheme;
}
const waitFor = this.waitFor;
const userSettingsProtoStoreBinding = UserSettingsProtoStore;
const selectivelySyncedUserSettingsStoreBinding = SelectivelySyncedUserSettingsStore;
Reflect.apply(waitFor, this, [userSettingsProtoStoreBinding, selectivelySyncedUserSettingsStoreBinding]);
this.syncWith([selectivelySyncedUserSettingsStoreBinding], handleSelectivelySyncedUserSettingsUpdate);
}
function value_15555() { // fn#15555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1598, offset: 0x00e3616e, size: 56 bytes, params: 1, frame: 11
const value2 = validate_15545();
const object = {};
if (value2) {
object.theme = env1_2;
object.customTheme = env1_3;
} else {
object.theme = undefined;
object.customTheme = undefined;
}
return object;
}
function value_15556() { // fn#15556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1715, offset: 0x00e361a6, size: 24 bytes, params: 1, frame: 10
if (validate_15545()) {
return env1_3;
}
}
function value_15557() { // fn#15557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1777, offset: 0x00e361be, size: 24 bytes, params: 1, frame: 10
if (validate_15545()) {
return env1_2;
}
}
function value_15558() { // fn#15558, offset: 0x00e361d6, size: 9 bytes, params: 1, frame: 1
return env1_4;
}
function value_15559() { // fn#15559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1907, offset: 0x00e361df, size: 57 bytes, params: 1, frame: 11
const value2 = undefined;
return value2 !== env1_4 ? env1_4 : validate_15545() ? {baseTheme: env1_2, customTheme: env1_3} : value2;
}
}
}
function value_15557() { // fn#15557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1777, offset: 0x00e361be, size: 24 bytes, params: 1, frame: 10
if (validate_15545()) {
return env1_2;
}
}
function value_15559() { // fn#15559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1907, offset: 0x00e361df, size: 57 bytes, params: 1, frame: 11
const value2 = undefined;
return value2 !== env1_4 ? env1_4 : validate_15545() ? {baseTheme: env1_2, customTheme: env1_3} : value2;
}
global.__d(_fun15541, 1354, [6, 7, 15, 17, 18, 1311, 1348, 1313, 670, 1314, 566, 694,
2]) /* metro module 1354, dependencies: [6, 7, 15, 17, 18, 1311, 1348, 1313, 670, 1314, 566, 694, 2] */;
@@ -1,4 +1,11 @@
/* Metro module 4045; source: modules/client_themes/native/MobileThemesUtils.tsx; dependencies: [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566, 2] */
import CustomThemeMobileStore from './CustomThemeMobileStore.tsx'; /* Metro dependency 1354 */
import MobileVisualRefreshExperiment from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
import SavedCustomThemeStore from '../SavedCustomThemeStore.tsx'; /* Metro dependency 4046 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as MobileVisualRefreshExperimentModule from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
import * as ClientThemesConstantsModule from '../ClientThemesConstants.tsx'; /* Metro dependency 3965 */
function _fun33363(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:6, offset: 0x0102d0e7, size: 250 bytes, params: 8, frame: 22
const env0_0 = require;
const getCustomThemesName = function() {
@@ -55,42 +62,37 @@ function _fun33363(global, require, importDefault, importAll, module, exports, d
}
return r0;
};
const closure3 = useSavedCustomTheme;
const useSavedCustomTheme2 = useSavedCustomTheme;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const savedCustomThemeStore = importDefault(4046) /* metro dependency 4046: SavedCustomThemeStore */;
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
const clientThemesConstantsModule = require(3965) /* metro dependency 3965: ClientThemesConstants */;
const env0_5 = clientThemesConstantsModule.BACKGROUND_GRADIENT_PRESETS_MOBILE;
const env0_6 = clientThemesConstantsModule.LEGACY_STANDARD_BACKGROUND_THEMES;
const env0_7 = clientThemesConstantsModule.REFRESH_STANDARD_BACKGROUND_THEMES;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/MobileThemesUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/MobileThemesUtils.tsx');
exports.getCustomBackgroundGradient = closure;
exports.useCustomBackgroundGradient = closure2;
exports.getAllMobileThemes = getAllMobileThemes;
exports.useAllMobileThemes = useAllMobileThemes;
exports.useSavedCustomTheme = closure3;
}
exports.useSavedCustomTheme = useSavedCustomTheme2;
function useSavedCustomTheme() { // fn#33368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:953, offset: 0x0102d362, size: 69 bytes, params: 1, frame: 13
const savedCustomTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([SavedCustomThemeStore],
function() {
return SavedCustomThemeStore.getSavedCustomTheme();
});
const value = null;
return value != savedCustomTheme ? savedCustomTheme : value;
}
function useSavedCustomTheme() { // fn#33368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:953, offset: 0x0102d362, size: 69 bytes, params: 1, frame: 13
const savedCustomTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([SavedCustomThemeStore],
function() {
return SavedCustomThemeStore.getSavedCustomTheme();
});
const value = null;
return value != savedCustomTheme ? savedCustomTheme : value;
}
function getAllMobileThemes() { // fn#33370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1295, offset: 0x0102d3bc, size: 62 bytes, params: 1, frame: 15
const getMobileThemesArrayWithMaybeCustomThemeBinding = getMobileThemesArrayWithMaybeCustomTheme;
const customBackgroundGradient = getCustomBackgroundGradient();
return getMobileThemesArrayWithMaybeCustomThemeBinding(customBackgroundGradient,
MobileVisualRefreshExperimentModule.isMobileVisualRefreshEnabled('MobileThemesUtils'));
}
function getAllMobileThemes() { // fn#33370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1295, offset: 0x0102d3bc, size: 62 bytes, params: 1, frame: 15
const getMobileThemesArrayWithMaybeCustomThemeBinding = getMobileThemesArrayWithMaybeCustomTheme;
const customBackgroundGradient = getCustomBackgroundGradient();
const value = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
return getMobileThemesArrayWithMaybeCustomThemeBinding(customBackgroundGradient,
value.isMobileVisualRefreshEnabled('MobileThemesUtils'));
}
function useAllMobileThemes() { // fn#33371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1484, offset: 0x0102d3fa, size: 65 bytes, params: 1, frame: 15
return getMobileThemesArrayWithMaybeCustomTheme(useCustomBackgroundGradient(useSavedCustomTheme()),
(MobileVisualRefreshExperiment)('MobileThemesUtils'));
}
function useAllMobileThemes() { // fn#33371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1484, offset: 0x0102d3fa, size: 65 bytes, params: 1, frame: 15
return getMobileThemesArrayWithMaybeCustomTheme(useCustomBackgroundGradient(useSavedCustomTheme()),
(importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('MobileThemesUtils'));
}
global.__d(_fun33363, 4045, [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566,
2]) /* metro module 4045, dependencies: [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566, 2] */;
@@ -1,18 +1,31 @@
/* Metro module 7704; source: modules/client_themes/native/ThemedGradient.tsx; dependencies: [31, 27, 3964, 33, 4501, 4002, 4001, 4000, 1478, 4589, 4048, 697, 4004, 3963, 674, 1216, 632, 4006, 4047, 3966, 2] */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import ClientThemesBackgroundStore from '../ClientThemesBackgroundStore.tsx'; /* Metro dependency 3964 */
import Color from '../../../utils/Color.tsx'; /* Metro dependency 4001 */
import UseRoutedActiveGuildTheme from '../../guild_themes/native/useRoutedActiveGuildTheme.tsx'; /* Metro dependency 4006 */
import UseTheme from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
import LinearGradient from '../../../by-id/module-04589-LinearGradient.js'; /* Metro dependency 4589 */
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 UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
import * as ClientThemesUtilsModule from './ClientThemesUtils.tsx'; /* Metro dependency 3963 */
import * as ClientThemesTypesModule from '../ClientThemesTypes.tsx'; /* Metro dependency 3966 */
import * as ColorUtilsModule from '../../../utils/ColorUtils.tsx'; /* Metro dependency 4000 */
import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */
import * as GuildThemePresetsModule from '../../guild_themes/GuildThemePresets.tsx'; /* Metro dependency 4004 */
import * as UseCustomThemeDisplaySettingsModule from './useCustomThemeDisplaySettings.tsx'; /* Metro dependency 4047 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
function _fun61503(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:6, offset: 0x01b42256, size: 425 bytes, params: 8, frame: 21
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 clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
const value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({softenGradient: {flex: 1},
const env0_8 = (CreateStylesModule).createStyles({softenGradient: {flex: 1},
linearGradient: {flex: 1}, absolute: {'position': 'absolute', 'top': 0, 'bottom': 0, 'left': 0, 'right': 0}});
const env0_9 = {'x': 0.5, 'y': 0.5};
const closure = Gradient;
const Gradient2 = Gradient;
const env0_14 = RegExp('^#(?:[0-9a-fA-F]{3}){1,2}$', '');
const closure2 = function(a0) {
return a0.reduce(_fun61522, []);
@@ -26,424 +39,453 @@ function _fun61503(global, require, importDefault, importAll, module, exports, d
object.overlayColor = isThemeDark ? property.BLACK : property.WHITE;
return object;
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/ThemedGradient.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/ThemedGradient.tsx');
exports.default = _default_61526;
exports.Gradient = closure;
exports.Gradient = Gradient2;
exports.validateColors = closure2;
exports.CustomThemedGradient = CustomThemedGradient;
}
function getThemeMixColor({mixAmount = {}, mixColorOverride, theme, darkFallbackOpacity, lightFallbackOpacity}) { // fn#61504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:319, offset: 0x01b423ff, size: 206 bytes, params: 2, frame: 22
darkFallbackOpacity = darkFallbackOpacity === undefined ? 0.7 : darkFallbackOpacity;
lightFallbackOpacity = lightFallbackOpacity === undefined ? 0.8 : lightFallbackOpacity;
if (mixColorOverride != null) {
return mixColorOverride;
function getThemeMixColor({mixAmount = {}, mixColorOverride, theme, darkFallbackOpacity, lightFallbackOpacity}) { // fn#61504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:319, offset: 0x01b423ff, size: 206 bytes, params: 2, frame: 22
darkFallbackOpacity = darkFallbackOpacity === undefined ? 0.7 : darkFallbackOpacity;
lightFallbackOpacity = lightFallbackOpacity === undefined ? 0.8 : lightFallbackOpacity;
if (mixColorOverride != null) {
return mixColorOverride;
}
const isThemeDark2 = (SharedModule).isThemeDark(theme);
let r4 = isThemeDark2 ? darkFallbackOpacity : lightFallbackOpacity;
let r3 = isThemeDark2 ? mixAmount.dark : mixAmount.light;
r4 = r3 ?? r4;
r3 = isThemeDark2 ? 0 : 255;
let value = Color;
const value4 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(r3, r3, r3, r4);
return value instanceof Object ? value : value4;
}
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(theme);
let r4 = isThemeDark2 ? darkFallbackOpacity : lightFallbackOpacity;
let r3 = isThemeDark2 ? mixAmount.dark : mixAmount.light;
r4 = r3 ?? r4;
r3 = isThemeDark2 ? 0 : 255;
let value = importDefault(4001) /* metro dependency 4001: Color */;
const value4 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(r3, r3, r3, r4);
return value instanceof Object ? value : value4;
}
function getThemedMixAmount({mixAmount = {}, theme, darkFallbackAmount, lightFallbackAmount}) { // fn#61505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:578, offset: 0x01b424cd, size: 157 bytes, params: 2, frame: 16
darkFallbackAmount = darkFallbackAmount === undefined ? 0.3 : darkFallbackAmount;
lightFallbackAmount = lightFallbackAmount === undefined ? 0.2 : lightFallbackAmount;
const value = require(4002) /* metro dependency 4002: shared */;
return value.isThemeDark(theme) ? mixAmount.dark == null ? darkFallbackAmount : 1 - mixAmount.dark : mixAmount.light == null ? lightFallbackAmount : 1 - mixAmount.light;
}
function getThemedMixAmount({mixAmount = {}, theme, darkFallbackAmount, lightFallbackAmount}) { // fn#61505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:578, offset: 0x01b424cd, size: 157 bytes, params: 2, frame: 16
darkFallbackAmount = darkFallbackAmount === undefined ? 0.3 : darkFallbackAmount;
lightFallbackAmount = lightFallbackAmount === undefined ? 0.2 : lightFallbackAmount;
return SharedModule.isThemeDark(theme) ? mixAmount.dark == null ? darkFallbackAmount : 1 - mixAmount.dark : mixAmount.light == null ? lightFallbackAmount : 1 - mixAmount.light;
}
function getMixedGradientColor({color, mixAmount, mixColorOverride, theme}) { // fn#61506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:762, offset: 0x01b4256a, size: 197 bytes, params: 2, frame: 22
const themeMixColor = getThemeMixColor({mixAmount: mixAmount, mixColorOverride: mixColorOverride, theme: theme});
const themedMixAmount = getThemedMixAmount({mixAmount: mixAmount, theme: theme});
const {r, g, b} = (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(color);
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
const mixColors = colorUtilsModule.mixColors;
let value = importDefault(4001) /* metro dependency 4001: Color */;
value = new value(r, g, b, themedMixAmount);
value = Reflect.apply(mixColors, colorUtilsModule, [themeMixColor, value]);
return value.toHexString();
}
function getMixedGradientColor({color, mixAmount, mixColorOverride, theme}) { // fn#61506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:762, offset: 0x01b4256a, size: 197 bytes, params: 2, frame: 22
const themeMixColor = getThemeMixColor({mixAmount: mixAmount, mixColorOverride: mixColorOverride, theme: theme});
const themedMixAmount = getThemedMixAmount({mixAmount: mixAmount, theme: theme});
const {r, g, b} = (ColorUtilsModule).hexToRgb(color);
const mixColors = ColorUtilsModule.mixColors;
let value = Color;
value = new value(r, g, b, themedMixAmount);
value = Reflect.apply(mixColors, ColorUtilsModule, [themeMixColor, value]);
return value.toHexString();
}
function CustomThemesGradient({colors, baseMix, gradientAngle, gradientColorStops, absolute, wide, tall, mix, mixAmount = {}, mixColorOverride, componentStyles, theme}) { // fn#61507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2500, offset: 0x01b4262f, size: 541 bytes, params: 2, frame: 29
var r0;
var value;
const styles = useStyles();
const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
const value3 = ((a0) => {
var r3;
var property = a0.colors;
var env0_0 = a0.baseMix;
var mix = a0.mix;
var mixAmount = a0.mixAmount;
var env0_1 = mixAmount !== undefined ? mixAmount : {};
var env0_2 = a0.mixColorOverride;
var env0_3 = a0.theme;
r3 = mix ? property.map(_fun61509) : property;
return r3.length !== 1 ? r3 : [r3[0], r3[0]];
})({colors: colors, mix: mix, mixAmount: mixAmount, mixColorOverride: mixColorOverride, theme: theme,
baseMix: baseMix});
const value4 = gradientAngle - 90;
let Math = global.Math;
const PI = Math.PI;
const value5 = value4 * PI / 180;
Math = global.Math;
const value6 = Math.cos(value5);
Math = global.Math;
const value7 = Math.sin(value5);
const {start, end} = {start: {x: 0.6 - 0.7142857142857143 * value6, y: 0.5 - 0.7142857142857143 * value7},
end: {x: 0.6 + 0.7142857142857143 * value6, y: 0.5 + 0.7142857142857143 * value7}};
const value8 = validateColors(value3);
const value9 = ((a0) => {
var r3;
var value = a1;
var env0_0 = a0;
r3 = value !== undefined ? value : [];
return r3.length === a0.length ? r3.map(_fun61511) : a0.length === 1 ? [0, 1] : a0.map(_fun61512);
})(value8, gradientColorStops);
env0_3.useEffect(_fun61513, [value8, value3]);
if (value8.length < 2) {
r0 = null;
} else {
value = importDefault(4589) /* metro dependency 4589 */;
function CustomThemesGradient({colors, baseMix, gradientAngle, gradientColorStops, absolute, wide, tall, mix, mixAmount = {}, mixColorOverride, componentStyles, theme}) { // fn#61507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2500, offset: 0x01b4262f, size: 541 bytes, params: 2, frame: 29
var r0;
var value;
const styles = useStyles();
const {width, height} = (UseWindowDimensionsNative)();
const value3 = ((a0) => {
var r3;
var property = a0.colors;
var env0_0 = a0.baseMix;
var mix = a0.mix;
var mixAmount = a0.mixAmount;
var env0_1 = mixAmount !== undefined ? mixAmount : {};
var env0_2 = a0.mixColorOverride;
var env0_3 = a0.theme;
r3 = mix ? property.map(_fun61509) : property;
return r3.length !== 1 ? r3 : [r3[0], r3[0]];
})({colors: colors, mix: mix, mixAmount: mixAmount, mixColorOverride: mixColorOverride, theme: theme,
baseMix: baseMix});
const value4 = gradientAngle - 90;
let Math = global.Math;
const PI = Math.PI;
const value5 = value4 * PI / 180;
Math = global.Math;
const value6 = Math.cos(value5);
Math = global.Math;
const value7 = Math.sin(value5);
const {start, end} = {start: {x: 0.6 - 0.7142857142857143 * value6, y: 0.5 - 0.7142857142857143 * value7},
end: {x: 0.6 + 0.7142857142857143 * value6, y: 0.5 + 0.7142857142857143 * value7}};
const value8 = validateColors(value3);
const value9 = ((a0) => {
var r3;
var value = a1;
var env0_0 = a0;
r3 = value !== undefined ? value : [];
return r3.length === a0.length ? r3.map(_fun61511) : a0.length === 1 ? [0, 1] : a0.map(_fun61512);
})(value8, gradientColorStops);
ReactModule.useEffect(_fun61513, [value8, value3]);
if (value8.length < 2) {
r0 = null;
} else {
value = importDefault(4589) /* metro dependency 4589 */;
absolute = absolute && styles.absolute;
value = ((Component) => <Component colors={value8} locations={value9} start={start} end={end} style={[wide && ({width: width}),
tall && ({height: height}), styles.linearGradient, absolute, componentStyles]} />)(value);
r0 = value;
}
return r0;
function getGradientColorsForCustomThemesGradient({colors, baseMix, mix, mixAmount = {}, mixColorOverride, theme}) { // fn#61508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2726, owner: CustomThemesGradient.getGradientColorsForCustomThemesGradient, offset: 0x01b4284c, size: 127 bytes, params: 2, frame: 14
const r3 = mix ? colors.map(_fun61509) : colors;
return r3.length !== 1 ? r3 : [r3[0], r3[0]];
function _fun61509(a0) { // fn#61509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2874, offset: 0x01b428cb, size: 292 bytes, params: 2, frame: 23
const value2 = 1 - baseMix / 100;
const getThemeMixColorBinding = getThemeMixColor;
const binding = env0_1;
const themeBinding = theme;
let value = getThemeMixColorBinding({mixAmount: binding, mixColorOverride: mixColorOverride, theme: themeBinding,
darkFallbackOpacity: env2_10 + 0.25 * value2, lightFallbackOpacity: env2_10 + 0.2 * value2});
const themedMixAmount = getThemedMixAmount({mixAmount: binding, theme: themeBinding, darkFallbackAmount: env2_10,
lightFallbackAmount: env2_10});
const {r, g, b} = (ColorUtilsModule).hexToRgb(a0);
const mixColors = ColorUtilsModule.mixColors;
const defaultImport = Color;
const value6 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
const defaultImport2 = new defaultImport(r, g, b, themedMixAmount);
value = Reflect.apply(mixColors, ColorUtilsModule, [value,
defaultImport2 instanceof Object ? defaultImport2 : value6]);
return (ClientThemesUtilsModule).colorToHex(value);
}
}
function getGradientLocationsForCustomThemesGradient(a0) { // fn#61510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3547, owner: CustomThemesGradient.getGradientLocationsForCustomThemesGradient, offset: 0x01b429ef, size: 94 bytes, params: 2, frame: 13
const value = a1;
const env0_0 = a0;
const r3 = value !== undefined ? value : [];
return r3.length === a0.length ? r3.map(function(a0) {
return a0 / 100;
}) : a0.length === 1 ? [0, 1] : a0.map(_fun61512);
function _fun61512(a0, a1) { // fn#61512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3679, offset: 0x00d3a36f, size: 28 bytes, params: 3, frame: 2
return a1 / (env0_0.length - 1);
}
}
function _fun61513() { // fn#61513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3729, offset: 0x01b42a59, size: 129 bytes, params: 1, frame: 17
var value2;
var defaultImport;
var captureException;
var error;
var object2;
if (env0_1.length < 2) {
value2 = environment.__proto__;
defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
captureException = defaultImport.captureException;
error = new global.Error('Invalid custom theme gradient colors');
object2 = {};
object2.gradientColors = global.JSON.stringify(env0_0);
Reflect.apply(captureException, defaultImport, [error, {extra: object2}]);
}
}
}
function GradientBase({colors, locations, angle, angleCenter = env0_9, absolute, wide, tall, componentStyles}) { // fn#61514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1076, offset: 0x01b42ada, size: 227 bytes, params: 2, frame: 25
const styles = useStyles();
const {width, height} = (UseWindowDimensionsNative)();
absolute = absolute && styles.absolute;
value = ((Component) => <Component colors={value8} locations={value9} start={start} end={end} style={[wide && ({width: width}),
tall && ({height: height}), styles.linearGradient, absolute, componentStyles]} />)(value);
r0 = value;
return ((Component) => <Component colors={colors} locations={locations} angle={angle} angleCenter={angleCenter} useAngle style={[wide && ({width: width}),
tall && ({height: height}), styles.linearGradient, absolute, componentStyles]} />)(LinearGradient);
}
return r0;
}
function GradientBase({colors, locations, angle, angleCenter = env0_9, absolute, wide, tall, componentStyles}) { // fn#61514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1076, offset: 0x01b42ada, size: 227 bytes, params: 2, frame: 25
const styles = useStyles();
const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
const value = importDefault(4589) /* metro dependency 4589 */;
absolute = absolute && styles.absolute;
return ((Component) => <Component colors={colors} locations={locations} angle={angle} angleCenter={angleCenter} useAngle style={[wide && ({width: width}),
tall && ({height: height}), styles.linearGradient, absolute, componentStyles]} />)(value);
}
function Gradient({gradient, absolute, wide, tall, angleOverride, componentStyles, mix, mixAmount = {}, mixColorOverride}) { // fn#61515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1368, offset: 0x01b42bbd, size: 237 bytes, params: 2, frame: 23
const env0_3 = (UseTheme)();
return (
<GradientBase
colors={gradient.colors.map(_fun61516)}
locations={gradient.colors.map(function(a0) {
return a0.stop / 100;
})}
angle={angleOverride ?? gradient.angle}
angleCenter={gradient.angleCenter ?? env0_9}
absolute={absolute}
wide={wide}
tall={tall}
componentStyles={componentStyles}
/>
);
function _fun61516(a0) { // fn#61516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1520, offset: 0x01b42caa, size: 136 bytes, params: 2, frame: 16
var r0;
var getMixedGradientColorBinding;
var object;
if (mix) {
getMixedGradientColorBinding = getMixedGradientColor;
object = {};
object.color = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors[a0.token];
object.mixAmount = env0_1;
object.mixColorOverride = mixColorOverride;
object.theme = env0_3;
r0 = getMixedGradientColorBinding(object);
} else {
r0 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors[a0.token];
}
return r0;
}
function Gradient({gradient, absolute, wide, tall, angleOverride, componentStyles, mix, mixAmount = {}, mixColorOverride}) { // fn#61515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1368, offset: 0x01b42bbd, size: 237 bytes, params: 2, frame: 23
const env0_3 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
return (
<GradientBase
colors={gradient.colors.map(_fun61516)}
locations={gradient.colors.map(function(a0) {
return a0.stop / 100;
})}
angle={angleOverride ?? gradient.angle}
angleCenter={gradient.angleCenter ?? env0_9}
absolute={absolute}
wide={wide}
tall={tall}
componentStyles={componentStyles}
/>
);
}
function GuildThemePresetGradient({preset, absolute, wide, tall, angleOverride, componentStyles, mix, mixAmount = {}, mixColorOverride}) { // fn#61518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1876, offset: 0x01b42d44, size: 255 bytes, params: 2, frame: 23
const guildThemePresetAppearance = (require(4004) /* metro dependency 4004: GuildThemePresets */).getGuildThemePresetAppearance(preset,
(importDefault(4048) /* metro dependency 4048: useTheme */)());
return (
<GradientBase
colors={guildThemePresetAppearance.colors.map(_fun61519)}
locations={guildThemePresetAppearance.colors.map(function(a0) {
return a0.stop / 100;
})}
angle={angleOverride ?? guildThemePresetAppearance.angle}
angleCenter={env0_9}
absolute={absolute}
wide={wide}
tall={tall}
componentStyles={componentStyles}
/>
);
}
function validateColors(a0) { // fn#61521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2366, offset: 0x01b42e8f, size: 28 bytes, params: 2, frame: 13
return a0.reduce(_fun61522, []);
}
function wrapWithOverlayIfNeeded(a0, a1, a2, a3, a4) { // fn#61523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4037, offset: 0x01b42f28, size: 145 bytes, params: 6, frame: 23
var r0;
var items3;
var items2;
var object;
let value = a0;
if (a1) {
var viewBindingProps = {style: a2.absolute};
items3 = [value];
items2 = [a2.softenGradient];
object = {};
value = require(4000) /* metro dependency 4000: ColorUtils */;
object.backgroundColor = value.hexWithOpacity(a3, a4);
items2[1] = object;
items3[1] = <View style={items2} />;
value = <View {...viewBindingProps}>{items3}</View>;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function ActiveGuildThemeGradient(a0) { // fn#61525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4369, offset: 0x01b43031, size: 298 bytes, params: 2, frame: 23
var customUserThemeSettings;
var property;
var items2;
const activeGuildTheme = a0.activeGuildTheme;
const theme = a0.theme;
let value = Object.create(null);
const value2 = 0;
value.activeGuildTheme = value2;
value.theme = value2;
const value3 = copyDataProperties({}, a0, value, undefined);
if (activeGuildTheme.type === 'custom') {
customUserThemeSettings = activeGuildTheme.customUserThemeSettings;
property = customUserThemeSettings.colors[value2];
var customThemesGradientBindingProps = {...value3};
value = require(4004) /* metro dependency 4004: GuildThemePresets */;
value = value.getSingleColorGuildThemeGradientColors(property, theme);
items2 = [];
arraySpread(items2, value, value2, property);
customThemesGradientBindingProps['colors'] = items2;
customThemesGradientBindingProps['gradientColorStops'] = [];
customThemesGradientBindingProps['gradientAngle'] = customUserThemeSettings.gradientAngle ?? value2;
customThemesGradientBindingProps['baseMix'] = customUserThemeSettings.baseMix ?? (require(4004) /* metro dependency 4004: GuildThemePresets */).GUILD_THEME_DEFAULT_BASE_MIX;
customThemesGradientBindingProps['theme'] = theme;
return <CustomThemesGradient {...customThemesGradientBindingProps} />;
function GuildThemePresetGradient({preset, absolute, wide, tall, angleOverride, componentStyles, mix, mixAmount = {}, mixColorOverride}) { // fn#61518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1876, offset: 0x01b42d44, size: 255 bytes, params: 2, frame: 23
const guildThemePresetAppearance = (GuildThemePresetsModule).getGuildThemePresetAppearance(preset,
(UseTheme)());
return (
<GradientBase
colors={guildThemePresetAppearance.colors.map(_fun61519)}
locations={guildThemePresetAppearance.colors.map(function(a0) {
return a0.stop / 100;
})}
angle={angleOverride ?? guildThemePresetAppearance.angle}
angleCenter={env0_9}
absolute={absolute}
wide={wide}
tall={tall}
componentStyles={componentStyles}
/>
);
function _fun61519(a0) { // fn#61519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2071, offset: 0x01b42e43, size: 76 bytes, params: 2, frame: 13
return mix ? getMixedGradientColor({color: a0.hex, mixAmount: env0_1, mixColorOverride: mixColorOverride,
theme: ReactModule}) : a0.hex;
}
}
return <GuildThemePresetGradient {...value3} {...{['preset']: activeGuildTheme.preset}} />;
}
function _default_61526(a0) { // fn#61526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4794, offset: 0x01b4315b, size: 667 bytes, params: 2, frame: 30
var type;
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
let overlayOpacity = a0.overlayOpacity;
overlayOpacity = overlayOpacity === undefined ? 0.7 : overlayOpacity;
const gradientOverride = a0.gradientOverride;
const value = null;
const value2 = Object.create(value);
value2.overlayOpacity = 0;
value2.gradientOverride = 0;
const value3 = copyDataProperties({}, a0, value2, undefined);
const {styles, overlayColor} = useThemedGradientCommon();
const withOverlay = value3.withOverlay;
const value6 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
const useStateFromStoresModule = require(632) /* metro dependency 632: useStateFromStores */;
const useStateFromStoresObject = useStateFromStoresModule.useStateFromStoresObject;
const preset = Reflect.apply(useStateFromStoresObject, useStateFromStoresModule, [[ClientThemesBackgroundStore],
function() {
return {preset: ClientThemesBackgroundStore.gradientPreset};
}]).preset;
const value7 = (importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)();
const value8 = (require(4047) /* metro dependency 4047: useCustomThemeDisplaySettings */).useCustomThemeDisplaySettings();
const value9 = value8 !== undefined;
if (value != gradientOverride) {
if (value9) {
type = gradientOverride.type;
if (type === ClientThemeType.CUSTOM_BACKGROUND_GRADIENT) {
return wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...gradientOverride.customThemeSettings} {...{['theme']: gradientOverride.theme}} />,
withOverlay, styles, overlayColor, overlayOpacity);
function validateColors(a0) { // fn#61521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2366, offset: 0x01b42e8f, size: 28 bytes, params: 2, frame: 13
return a0.reduce(_fun61522, []);
function _fun61522(a0, a1) { // fn#61522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2379, offset: 0x01b42eab, size: 125 bytes, params: 3, frame: 15
var value;
var push;
var property;
var hex;
var error;
if (typeof a1 !== 'string') {
try {
push = a0.push;
value = environment.__proto__;
property = dependencyMap[14];
value = importDefault(property);
value = value(a1);
value = value.hex('rgb');
Reflect.apply(push, a0, [value]);
} catch (error) {
}
} else {
value = environment.__proto__;
var binding = env1_14;
if (binding.test(a1)) {
a0.push(a1);
return a0;
}
try {
push = a0.push;
} catch (error) {
return a0;
}
value = environment.__proto__;
try {
} catch (error) {
return a0;
}
try {
} catch (error) {
return a0;
}
try {
property = dependencyMap[14];
} catch (error) {
return a0;
}
try {
value = importDefault(property);
} catch (error) {
return a0;
}
try {
value = value(a1);
} catch (error) {
return a0;
}
try {
hex = value.hex;
} catch (error) {
return a0;
}
try {
value = Reflect.apply(hex, value, ['rgb']);
} catch (error) {
return a0;
}
try {
Reflect.apply(push, a0, [value]);
} catch (error) {
}
}
return a0;
}
}
function wrapWithOverlayIfNeeded(a0, a1, a2, a3, a4) { // fn#61523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4037, offset: 0x01b42f28, size: 145 bytes, params: 6, frame: 23
var r0;
var items3;
var items2;
var object2;
let value = a0;
if (a1) {
var viewBindingProps = {style: a2.absolute};
items3 = [value];
items2 = [a2.softenGradient];
object2 = {};
value = require(4000) /* metro dependency 4000: ColorUtils */;
object2.backgroundColor = value.hexWithOpacity(a3, a4);
items2[1] = object2;
items3[1] = <View style={items2} />;
value = (
<View {...viewBindingProps}>
{items3}
</View>
);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function ActiveGuildThemeGradient(a0) { // fn#61525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4369, offset: 0x01b43031, size: 298 bytes, params: 2, frame: 23
var customUserThemeSettings;
var property;
var items2;
const activeGuildTheme = a0.activeGuildTheme;
const theme = a0.theme;
let value = Object.create(null);
const value2 = 0;
value.activeGuildTheme = value2;
value.theme = value2;
const value3 = copyDataProperties({}, a0, value, undefined);
if (activeGuildTheme.type === 'custom') {
customUserThemeSettings = activeGuildTheme.customUserThemeSettings;
property = customUserThemeSettings.colors[value2];
var customThemesGradientBindingProps = {...value3};
value = require(4004) /* metro dependency 4004: GuildThemePresets */;
value = value.getSingleColorGuildThemeGradientColors(property, theme);
items2 = [];
arraySpread(items2, value, value2, property);
customThemesGradientBindingProps['colors'] = items2;
customThemesGradientBindingProps['gradientColorStops'] = [];
customThemesGradientBindingProps['gradientAngle'] = customUserThemeSettings.gradientAngle ?? value2;
customThemesGradientBindingProps['baseMix'] = customUserThemeSettings.baseMix ?? (require(4004) /* metro dependency 4004: GuildThemePresets */).GUILD_THEME_DEFAULT_BASE_MIX;
customThemesGradientBindingProps['theme'] = theme;
return <CustomThemesGradient {...customThemesGradientBindingProps} />;
}
return <GuildThemePresetGradient {...value3} {...{['preset']: activeGuildTheme.preset}} />;
}
function _default_61526(a0) { // fn#61526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4794, offset: 0x01b4315b, size: 667 bytes, params: 2, frame: 30
var type;
const ClientThemeType = (ClientThemesTypesModule).ClientThemeType;
let overlayOpacity = a0.overlayOpacity;
overlayOpacity = overlayOpacity === undefined ? 0.7 : overlayOpacity;
const gradientOverride = a0.gradientOverride;
const value = null;
const value2 = Object.create(value);
value2.overlayOpacity = 0;
value2.gradientOverride = 0;
const value3 = copyDataProperties({}, a0, value2, undefined);
const {styles, overlayColor} = useThemedGradientCommon();
const withOverlay = value3.withOverlay;
const value6 = (UseTheme)();
const useStateFromStoresObject = UseStateFromStoresModule.useStateFromStoresObject;
const preset = Reflect.apply(useStateFromStoresObject, UseStateFromStoresModule, [[ClientThemesBackgroundStore],
function() {
return {preset: ClientThemesBackgroundStore.gradientPreset};
}]).preset;
const value7 = (UseRoutedActiveGuildTheme)();
const value8 = (UseCustomThemeDisplaySettingsModule).useCustomThemeDisplaySettings();
const value9 = value8 !== undefined;
if (value != gradientOverride) {
if (value9) {
type = gradientOverride.type;
if (type === ClientThemeType.CUSTOM_BACKGROUND_GRADIENT) {
return wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...gradientOverride.customThemeSettings} {...{['theme']: gradientOverride.theme}} />,
withOverlay, styles, overlayColor, overlayOpacity);
}
type = gradientOverride.type;
if (type === ClientThemeType.BACKGROUND_GRADIENT_PRESET) {
return wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: gradientOverride}} />,
withOverlay,
styles,
overlayColor, overlayOpacity);
}
return (
value != value7
? wrapWithOverlayIfNeeded(<ActiveGuildThemeGradient {...value3} {...{['activeGuildTheme']: value7}} {...{['theme']: value6}} />,
withOverlay, styles, overlayColor, overlayOpacity)
: (
value9 && value9
? wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...value8.customTheme} {...{['theme']: value8.baseTheme}} />,
withOverlay, styles, overlayColor, overlayOpacity)
: (
value != preset
? wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: preset}} />,
withOverlay,
styles, overlayColor, overlayOpacity)
: value
)
)
);
}
type = gradientOverride.type;
if (type === ClientThemeType.BACKGROUND_GRADIENT_PRESET) {
return wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: gradientOverride}} />,
withOverlay,
return wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: gradientOverride}} />, withOverlay,
styles,
overlayColor, overlayOpacity);
}
return value != value7 ? wrapWithOverlayIfNeeded(<ActiveGuildThemeGradient {...value3} {...{['activeGuildTheme']: value7}} {...{['theme']: value6}} />,
withOverlay, styles, overlayColor,
overlayOpacity) : value9 && value9 ? wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...value8.customTheme} {...{['theme']: value8.baseTheme}} />,
withOverlay, styles, overlayColor,
overlayOpacity) : value != preset ? wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: preset}} />,
withOverlay, styles, overlayColor, overlayOpacity) : value;
}
type = gradientOverride.type;
if (type === ClientThemeType.BACKGROUND_GRADIENT_PRESET) {
return wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: gradientOverride}} />, withOverlay,
styles,
overlayColor, overlayOpacity);
}
return (
value != value7
? wrapWithOverlayIfNeeded(<ActiveGuildThemeGradient {...value3} {...{['activeGuildTheme']: value7}} {...{['theme']: value6}} />,
withOverlay, styles, overlayColor, overlayOpacity)
: (
value9 && value9
? wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...value8.customTheme} {...{['theme']: value8.baseTheme}} />,
withOverlay, styles, overlayColor, overlayOpacity)
: (
value != preset
? wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: preset}} />, withOverlay,
styles, overlayColor, overlayOpacity)
: value
)
)
);
}
return value != value7 ? wrapWithOverlayIfNeeded(<ActiveGuildThemeGradient {...value3} {...{['activeGuildTheme']: value7}} {...{['theme']: value6}} />,
withOverlay, styles, overlayColor,
overlayOpacity) : value9 && value9 ? wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...value8.customTheme} {...{['theme']: value8.baseTheme}} />,
withOverlay, styles, overlayColor,
overlayOpacity) : value != preset ? wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: preset}} />,
withOverlay, styles, overlayColor, overlayOpacity) : value;
}
function CustomThemedGradient(a0) { // fn#61528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:5890, offset: 0x01b4340c, size: 158 bytes, params: 2, frame: 23
let overlayOpacity = a0.overlayOpacity;
overlayOpacity = overlayOpacity === undefined ? 0.7 : overlayOpacity;
const customTheme = a0.customTheme;
let value = Object.create(null);
value.overlayOpacity = 0;
value.customTheme = 0;
value = copyDataProperties({}, a0, value, undefined);
const {styles, overlayColor} = useThemedGradientCommon();
return wrapWithOverlayIfNeeded(<CustomThemesGradient {...value} {...customTheme.customThemeSettings} {...{['theme']: customTheme.theme}} />,
value.withOverlay, styles, overlayColor, overlayOpacity);
}
function getGradientColorsForCustomThemesGradient({colors, baseMix, mix, mixAmount = {}, mixColorOverride, theme}) { // fn#61508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2726, owner: CustomThemesGradient.getGradientColorsForCustomThemesGradient, offset: 0x01b4284c, size: 127 bytes, params: 2, frame: 14
const r3 = mix ? colors.map(_fun61509) : colors;
return r3.length !== 1 ? r3 : [r3[0], r3[0]];
}
function getGradientLocationsForCustomThemesGradient(a0) { // fn#61510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3547, owner: CustomThemesGradient.getGradientLocationsForCustomThemesGradient, offset: 0x01b429ef, size: 94 bytes, params: 2, frame: 13
const value = a1;
const env0_0 = a0;
const r3 = value !== undefined ? value : [];
return r3.length === a0.length ? r3.map(function(a0) {
return a0 / 100;
}) : a0.length === 1 ? [0, 1] : a0.map(_fun61512);
}
function _fun61513() { // fn#61513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3729, offset: 0x01b42a59, size: 129 bytes, params: 1, frame: 17
var value2;
var defaultImport;
var captureException;
var error;
var object;
if (env0_1.length < 2) {
value2 = environment.__proto__;
defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
captureException = defaultImport.captureException;
error = new global.Error('Invalid custom theme gradient colors');
object = {};
object.gradientColors = global.JSON.stringify(env0_0);
Reflect.apply(captureException, defaultImport, [error, {extra: object}]);
function CustomThemedGradient(a0) { // fn#61528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:5890, offset: 0x01b4340c, size: 158 bytes, params: 2, frame: 23
let overlayOpacity = a0.overlayOpacity;
overlayOpacity = overlayOpacity === undefined ? 0.7 : overlayOpacity;
const customTheme = a0.customTheme;
let value = Object.create(null);
value.overlayOpacity = 0;
value.customTheme = 0;
value = copyDataProperties({}, a0, value, undefined);
const {styles, overlayColor} = useThemedGradientCommon();
return wrapWithOverlayIfNeeded(<CustomThemesGradient {...value} {...customTheme.customThemeSettings} {...{['theme']: customTheme.theme}} />,
value.withOverlay, styles, overlayColor, overlayOpacity);
}
}
function _fun61516(a0) { // fn#61516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1520, offset: 0x01b42caa, size: 136 bytes, params: 2, frame: 16
var r0;
var getMixedGradientColorBinding;
var object2;
if (mix) {
getMixedGradientColorBinding = getMixedGradientColor;
object2 = {};
object2.color = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors[a0.token];
object2.mixAmount = env0_1;
object2.mixColorOverride = mixColorOverride;
object2.theme = env0_3;
r0 = getMixedGradientColorBinding(object2);
} else {
r0 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors[a0.token];
}
return r0;
}
function _fun61519(a0) { // fn#61519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2071, offset: 0x01b42e43, size: 76 bytes, params: 2, frame: 13
return mix ? getMixedGradientColor({color: a0.hex, mixAmount: env0_1, mixColorOverride: mixColorOverride,
theme: env0_3}) : a0.hex;
}
function _fun61522(a0, a1) { // fn#61522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2379, offset: 0x01b42eab, size: 125 bytes, params: 3, frame: 15
var value;
var push;
var property;
var hex;
var error;
if (typeof a1 !== 'string') {
try {
push = a0.push;
value = environment.__proto__;
property = dependencyMap[14];
value = importDefault(property);
value = value(a1);
value = value.hex('rgb');
Reflect.apply(push, a0, [value]);
} catch (error) {
}
} else {
value = environment.__proto__;
var binding = env1_14;
if (binding.test(a1)) {
a0.push(a1);
return a0;
}
try {
push = a0.push;
} catch (error) {
return a0;
}
value = environment.__proto__;
try {
} catch (error) {
return a0;
}
try {
} catch (error) {
return a0;
}
try {
property = dependencyMap[14];
} catch (error) {
return a0;
}
try {
value = importDefault(property);
} catch (error) {
return a0;
}
try {
value = value(a1);
} catch (error) {
return a0;
}
try {
hex = value.hex;
} catch (error) {
return a0;
}
try {
value = Reflect.apply(hex, value, ['rgb']);
} catch (error) {
return a0;
}
try {
Reflect.apply(push, a0, [value]);
} catch (error) {
}
}
return a0;
}
function _fun61509(a0) { // fn#61509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2874, offset: 0x01b428cb, size: 292 bytes, params: 2, frame: 23
const value2 = 1 - baseMix / 100;
const getThemeMixColorBinding = getThemeMixColor;
const binding = env0_1;
const themeBinding = theme;
let value = getThemeMixColorBinding({mixAmount: binding, mixColorOverride: mixColorOverride, theme: themeBinding,
darkFallbackOpacity: env2_10 + 0.25 * value2, lightFallbackOpacity: env2_10 + 0.2 * value2});
const themedMixAmount = getThemedMixAmount({mixAmount: binding, theme: themeBinding, darkFallbackAmount: env2_10,
lightFallbackAmount: env2_10});
const {r, g, b} = (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(a0);
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
const mixColors = colorUtilsModule.mixColors;
const defaultImport = importDefault(4001) /* metro dependency 4001: Color */;
const value6 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
const defaultImport2 = new defaultImport(r, g, b, themedMixAmount);
value = Reflect.apply(mixColors, colorUtilsModule, [value,
defaultImport2 instanceof Object ? defaultImport2 : value6]);
return (require(3963) /* metro dependency 3963: ClientThemesUtils */).colorToHex(value);
function _fun61511(a0) { // fn#61511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3642, offset: 0x01b42a4d, size: 12 bytes, params: 2, frame: 2
return a0 / 100;
}
global.__d(_fun61503, 7704, [31, 27, 3964, 33, 4501, 4002, 4001, 4000, 1478, 4589, 4048, 697, 4004, 3963, 674, 1216,
632, 4006, 4047, 3966,
2]) /* metro module 7704, dependencies: [31, 27, 3964, 33, 4501, 4002, 4001, 4000, 1478, 4589, 4048, 697, 4004, 3963, 674, 1216, 632, 4006, 4047, 3966, 2] */;
@@ -1,29 +1,38 @@
/* Metro module 11514; source: modules/client_themes/native/chat/SharedCustomThemeActionSheet.tsx; dependencies: [57, 31, 27, 3808, 661, 1880, 33, 4501, 697, 683, 11515, 3998, 6275, 6758, 1244, 2422, 4573, 7896, 4578, 566, 3802, 7040, 6789, 1305, 3999, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import AnalyticsUtils from '../../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import SubscriptionStore from '../../../../stores/billing/SubscriptionStore.tsx'; /* Metro dependency 3808 */
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 FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as PremiumConstantsModule from '../../../premium/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 BottomSheetTitleHeaderNativeModule from '../../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
function _fun88150(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:6, offset: 0x01fd6a7e, size: 451 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(31) /* metro dependency 31 */;
let value = ReactModule;
const env0_5 = value.useEffect;
const env0_6 = value.useLayoutEffect;
const env0_7 = value.useRef;
const env0_8 = (require(27) /* metro dependency 27 */).View;
const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */;
const env0_10 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const env0_11 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
let object = {};
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const object2 = {};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const env0_14 = Reflect.apply(createStyles, value, [{contentWrapper: {'paddingHorizontal': 43.5,
'paddingVertical': 12}, centeredText: {textAlign: 'center'}, ctaContainer: {'paddingHorizontal': 15,
'flexDirection': 'column', 'display': 'flex', 'gap': 6}, nitroWheelButton: {'marginStart': -2, 'width': 20,
'height': 20}, getNitroButton: object}]);
'height': 20}, getNitroButton: object2}]);
const sharedClientThemeToThemeSettings = function(a0) {
var object;
if (a0 !== undefined) {
@@ -35,193 +44,216 @@ function _fun88150(global, require, importDefault, importAll, module, exports, d
return object;
}
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/SharedCustomThemeActionSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/chat/SharedCustomThemeActionSheet.tsx');
exports.default = _default_88158;
}
function sharedClientThemeToThemeSettings(a0) { // fn#88151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:606, offset: 0x01fd6c41, size: 74 bytes, params: 2, frame: 13
var object2;
if (a0 !== undefined) {
object2 = {};
object2.colors = a0.colors.map(function(a0) {
return '#' + a0;
});
object2.gradientColorStops = [];
object2.gradientAngle = a0.gradient_angle;
object2.baseMix = a0.base_mix;
return object2;
function sharedClientThemeToThemeSettings(a0) { // fn#88151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:606, offset: 0x01fd6c41, size: 74 bytes, params: 2, frame: 13
var object;
if (a0 !== undefined) {
object = {};
object.colors = a0.colors.map(function(a0) {
return '#' + a0;
});
object.gradientColorStops = [];
object.gradientAngle = a0.gradient_angle;
object.baseMix = a0.base_mix;
return object;
}
}
}
function PrimaryActionButton_88153({onPressApply}) { // fn#88153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:759, offset: 0x01fd6ca6, size: 345 bytes, params: 2, frame: 22
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles();
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
const premiumTypeFromSubscription = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeFromSubscription(Reflect.apply(useStateFromStores,
fluxModule, [[SubscriptionStore], function() {
return SubscriptionStore.getPremiumTypeSubscription();
}]));
const TIER_2 = PremiumTypes.TIER_2;
if (premiumTypeFromSubscription !== TIER_2) {
const ShinyButton = (require(1305) /* metro dependency 1305: native */).ShinyButton;
return (
<ShinyButton
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pj0XBN)}
onPress={function() {
var defaultImport = importDefault(dependencyMap[21]);
var object = {};
object.premiumType = PremiumTypes.TIER_2;
var SHARE_CUSTOM_CLIENT_THEME_EMBED = importDefault(dependencyMap[22]).SHARE_CUSTOM_CLIENT_THEME_EMBED;
object.analyticsLocations = [SHARE_CUSTOM_CLIENT_THEME_EMBED];
object.analyticsLocation = {};
defaultImport(object);
}}
renderIcon={renderIcon}
style={styles.getNitroButton}
/>
function PrimaryActionButton_88153({onPressApply}) { // fn#88153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:759, offset: 0x01fd6ca6, size: 345 bytes, params: 2, frame: 22
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles();
const useStateFromStores = FluxModule.useStateFromStores;
const premiumTypeFromSubscription = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeFromSubscription(Reflect.apply(useStateFromStores,
FluxModule, [[SubscriptionStore], function() {
return SubscriptionStore.getPremiumTypeSubscription();
}]));
const TIER_2 = PremiumTypes.TIER_2;
if (premiumTypeFromSubscription !== TIER_2) {
const ShinyButton = (require(1305) /* metro dependency 1305: native */).ShinyButton;
return (
<ShinyButton
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pj0XBN)}
onPress={function() {
var defaultImport = importDefault(dependencyMap[21]);
var object = {};
object.premiumType = PremiumTypes.TIER_2;
var SHARE_CUSTOM_CLIENT_THEME_EMBED = importDefault(dependencyMap[22]).SHARE_CUSTOM_CLIENT_THEME_EMBED;
object.analyticsLocations = [SHARE_CUSTOM_CLIENT_THEME_EMBED];
object.analyticsLocation = {};
defaultImport(object);
}}
renderIcon={renderIcon_88156}
style={styles.getNitroButton}
/>
);
} else {
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
return (
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1Qm822'])}
onPress={onPressApply}
variant="primary"
/>
);
}
function PrimaryActionButton_88153RenderIcon() { // fn#88156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1133, owner: PrimaryActionButton_88153.renderIcon, offset: 0x01fd6e69, size: 70 bytes, params: 1, frame: 15
const NitroWheel = (NativeModule).NitroWheel;
return <NitroWheel style={[styles.nitroWheelButton]} />;
}
}
function getBaseThemeFromSharedClientTheme(a0) { // fn#88157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1346, offset: 0x01fd6eaf, size: 53 bytes, params: 2, frame: 13
var value;
if (a0 !== undefined) {
value = require(3999) /* metro dependency 3999: ClientThemesUtils */;
return value.getBaseTheme(a0.base_theme);
}
}
function _default_88158(a0) { // fn#88158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1417, offset: 0x01fd6ee4, size: 712 bytes, params: 2, frame: 29
const sharedClientTheme = a0.message.sharedClientTheme;
const styles = useStyles();
const value2 = useRef(null);
let useState = ReactModule.useState;
const value3 = Reflect.apply(useState, ReactModule, [sharedClientThemeToThemeSettings(sharedClientTheme)]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
var env0_3 = value4[1];
useState = ReactModule.useState;
const value5 = binding2(Reflect.apply(useState, ReactModule, [getBaseThemeFromSharedClientTheme(sharedClientTheme)]), 2);
const property2 = value5[0];
const env0_5 = value5[1];
useState = ReactModule.useState;
const value6 = binding2(Reflect.apply(useState, ReactModule, [false]), 2);
const property3 = value6[0];
const env0_7 = value6[1];
const value7 = ReactModule.useRef(true);
useEffect(_fun88159, [sharedClientTheme]);
useEffect(_fun88160, [property, property2]);
useLayoutEffect(_fun88161, [property3]);
useEffect(function() {
return _fun88163;
}, [value7]);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const items2 = [
<BottomSheetTitleHeader
title={intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */)['3ej1LT'])}
/>,
];
const Text = (TextModule).Text;
items2[1] = (
<View style={styles.contentWrapper}>
<Text variant="heading-md/medium" style={styles.centeredText}>
{intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).qZMUoL)}
</Text>
</View>
);
} else {
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
return (
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1Qm822'])}
onPress={onPressApply}
variant="primary"
/>
const primaryActionButton_88153 = <PrimaryActionButton_88153 onPressApply={onPressApply} />;
const Button = (ButtonNativeModule).Button;
items2[2] = (
<View style={styles.ctaContainer}>
{primaryActionButton_88153}
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
onPress={onPress_88165}
variant="secondary"
/>
</View>
);
return (
<BottomSheet ref={value2} backdropOpacity={0}>
{items2}
</BottomSheet>
);
function _fun88159() { // fn#88159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1683, offset: 0x01fd71ac, size: 93 bytes, params: 1, frame: 15
const binding = env0_3;
const sharedClientThemeToThemeSettingsBinding = sharedClientThemeToThemeSettings;
const sharedClientThemeBinding = sharedClientTheme;
binding(sharedClientThemeToThemeSettingsBinding(sharedClientThemeBinding));
env0_5(getBaseThemeFromSharedClientTheme(sharedClientThemeBinding));
const track = AnalyticsUtils.track;
const CUSTOM_THEME_SHARE_PREVIEWED = AnalyticEvents.CUSTOM_THEME_SHARE_PREVIEWED;
Reflect.apply(track, AnalyticsUtils, [CUSTOM_THEME_SHARE_PREVIEWED, {}]);
}
function _fun88160() { // fn#88160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1826, offset: 0x01fd7209, size: 105 bytes, params: 1, frame: 16
var value4;
var moduleValue;
if (env0_2 !== undefined && ReactModule !== undefined) {
value4 = environment.__proto__;
moduleValue = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
moduleValue.previewCustomTheme({baseTheme: ReactModule, customTheme: env0_2});
(require(3998) /* metro dependency 3998: ThemeActionCreators */).refreshTheme();
}
}
function _fun88161() { // fn#88161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1950, offset: 0x01fd7272, size: 24 bytes, params: 1, frame: 2
ReactNativeModule.View.current = !env0_6;
}
function _fun88162() { // fn#88162, offset: 0x01fd728a, size: 11 bytes, params: 1, frame: 1
return _fun88163;
function _fun88163() { // fn#88163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1982, offset: 0x01fd7295, size: 76 bytes, params: 1, frame: 13
let value = environment.__proto__;
if (env1_8.current) {
value = environment.__proto__.__proto__;
value = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
value.clearPreviewTheme();
value = require(3998) /* metro dependency 3998: ThemeActionCreators */;
value.refreshTheme();
}
}
}
function onPressApply() { // fn#88164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:2428, owner: _default_88158.onPressApply, offset: 0x01fd72e1, size: 216 bytes, params: 1, frame: 20
var value5;
var moduleValue;
var updateCustomTheme;
var binding;
var binding2;
var moduleValue2;
var defaultImport;
if (env0_2 !== undefined && ReactModule !== undefined && env0_1.current !== null) {
env0_7(true);
value5 = environment.__proto__;
moduleValue = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
updateCustomTheme = moduleValue.updateCustomTheme;
binding = env0_2;
binding2 = ReactModule;
Reflect.apply(updateCustomTheme, moduleValue, [binding, binding2]);
moduleValue2 = require(7896) /* metro dependency 7896: UserSettingsActionCreators */;
moduleValue2.saveClientTheme({customUserThemeSettings: binding, theme: binding2});
(require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */).clearPreviewTheme();
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.CUSTOM_THEME_SHARE_APPLIED, {});
env0_1.current.closeActionSheet();
}
}
function _default_88158OnPress() { // fn#88165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:2760, owner: _default_88158.onPress, offset: 0x01fd73b9, size: 98 bytes, params: 1, frame: 14
var value2;
if (env0_1.current !== null) {
value2 = environment.__proto__;
(require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */).clearPreviewTheme();
(require(3998) /* metro dependency 3998: ThemeActionCreators */).refreshTheme();
env0_1.current.closeActionSheet();
}
}
}
}
function getBaseThemeFromSharedClientTheme(a0) { // fn#88157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1346, offset: 0x01fd6eaf, size: 53 bytes, params: 2, frame: 13
var value;
if (a0 !== undefined) {
value = require(3999) /* metro dependency 3999: ClientThemesUtils */;
return value.getBaseTheme(a0.base_theme);
}
}
function _default_88158(a0) { // fn#88158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1417, offset: 0x01fd6ee4, size: 712 bytes, params: 2, frame: 29
const sharedClientTheme = a0.message.sharedClientTheme;
const styles = useStyles();
const value2 = useRef(null);
const binding = env0_4;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [sharedClientThemeToThemeSettings(sharedClientTheme)]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
var env0_3 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [getBaseThemeFromSharedClientTheme(sharedClientTheme)]), 2);
const property2 = value5[0];
const env0_5 = value5[1];
useState = binding.useState;
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property3 = value6[0];
const env0_7 = value6[1];
const value7 = binding.useRef(true);
useEffect(_fun88159, [sharedClientTheme]);
useEffect(_fun88160, [property, property2]);
useLayoutEffect(_fun88161, [property3]);
useEffect(function() {
return _fun88163;
}, [value7]);
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const items2 = [<BottomSheetTitleHeader title={intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */)['3ej1LT'])} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <View style={styles.contentWrapper}><Text variant="heading-md/medium" style={styles.centeredText}>{intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).qZMUoL)}</Text></View>;
const primaryActionButton_88153 = <PrimaryActionButton_88153 onPressApply={onPressApply} />;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
items2[2] = <View style={styles.ctaContainer}>{primaryActionButton_88153}<Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])} onPress={onPress_88165} variant="secondary" /></View>;
return (
<BottomSheet ref={value2} backdropOpacity={0}>
{items2}
</BottomSheet>
);
}
function PrimaryActionButton_88153RenderIcon() { // fn#88156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1133, owner: PrimaryActionButton_88153.renderIcon, offset: 0x01fd6e69, size: 70 bytes, params: 1, frame: 15
const NitroWheel = (require(1305) /* metro dependency 1305: native */).NitroWheel;
return <NitroWheel style={[styles.nitroWheelButton]} />;
}
function _fun88159() { // fn#88159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1683, offset: 0x01fd71ac, size: 93 bytes, params: 1, frame: 15
const binding = env0_3;
const sharedClientThemeToThemeSettingsBinding = sharedClientThemeToThemeSettings;
const sharedClientThemeBinding = sharedClientTheme;
binding(sharedClientThemeToThemeSettingsBinding(sharedClientThemeBinding));
env0_5(getBaseThemeFromSharedClientTheme(sharedClientThemeBinding));
const value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = value.track;
const CUSTOM_THEME_SHARE_PREVIEWED = AnalyticEvents.CUSTOM_THEME_SHARE_PREVIEWED;
Reflect.apply(track, value, [CUSTOM_THEME_SHARE_PREVIEWED, {}]);
}
function _fun88160() { // fn#88160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1826, offset: 0x01fd7209, size: 105 bytes, params: 1, frame: 16
var value4;
var moduleValue;
if (env0_2 !== undefined && env0_4 !== undefined) {
value4 = environment.__proto__;
moduleValue = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
moduleValue.previewCustomTheme({baseTheme: env0_4, customTheme: env0_2});
(require(3998) /* metro dependency 3998: ThemeActionCreators */).refreshTheme();
}
}
function _fun88161() { // fn#88161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1950, offset: 0x01fd7272, size: 24 bytes, params: 1, frame: 2
env0_8.current = !env0_6;
}
function _fun88162() { // fn#88162, offset: 0x01fd728a, size: 11 bytes, params: 1, frame: 1
return _fun88163;
}
function onPressApply() { // fn#88164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:2428, owner: _default_88158.onPressApply, offset: 0x01fd72e1, size: 216 bytes, params: 1, frame: 20
var value5;
var moduleValue;
var updateCustomTheme;
var binding;
var binding2;
var moduleValue2;
var defaultImport;
if (env0_2 !== undefined && env0_4 !== undefined && env0_1.current !== null) {
env0_7(true);
value5 = environment.__proto__;
moduleValue = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
updateCustomTheme = moduleValue.updateCustomTheme;
binding = env0_2;
binding2 = env0_4;
Reflect.apply(updateCustomTheme, moduleValue, [binding, binding2]);
moduleValue2 = require(7896) /* metro dependency 7896: UserSettingsActionCreators */;
moduleValue2.saveClientTheme({customUserThemeSettings: binding, theme: binding2});
(require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */).clearPreviewTheme();
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.CUSTOM_THEME_SHARE_APPLIED, {});
env0_1.current.closeActionSheet();
}
}
function _default_88158OnPress() { // fn#88165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:2760, owner: _default_88158.onPress, offset: 0x01fd73b9, size: 98 bytes, params: 1, frame: 14
var value2;
if (env0_1.current !== null) {
value2 = environment.__proto__;
(require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */).clearPreviewTheme();
(require(3998) /* metro dependency 3998: ThemeActionCreators */).refreshTheme();
env0_1.current.closeActionSheet();
}
}
function _fun88163() { // fn#88163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1982, offset: 0x01fd7295, size: 76 bytes, params: 1, frame: 13
let value = environment.__proto__;
if (env1_8.current) {
value = environment.__proto__.__proto__;
value = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
value.clearPreviewTheme();
value = require(3998) /* metro dependency 3998: ThemeActionCreators */;
value.refreshTheme();
}
function _fun88152(a0) { // fn#88152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:652, offset: 0x01fd6c8b, size: 27 bytes, params: 2, frame: 11
return '#' + a0;
}
global.__d(_fun88150, 11514, [57, 31, 27, 3808, 661, 1880, 33, 4501, 697, 683, 11515, 3998, 6275, 6758, 1244, 2422,
4573, 7896, 4578, 566, 3802, 7040, 6789, 1305, 3999,
2]) /* metro module 11514, dependencies: [57, 31, 27, 3808, 661, 1880, 33, 4501, 697, 683, 11515, 3998, 6275, 6758, 1244, 2422, 4573, 7896, 4578, 566, 3802, 7040, 6789, 1305, 3999, 2] */;
@@ -1,34 +1,38 @@
/* Metro module 8439; source: modules/client_themes/native/chat/formatSharedClientThemeData.tsx; dependencies: [27, 7955, 1244, 2422, 2] */
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 */
function _fun67004(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8624:6, offset: 0x01c11f6c, size: 124 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(27) /* metro dependency 27 */).Image;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/formatSharedClientThemeData.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/chat/formatSharedClientThemeData.tsx');
exports.formatSharedClientThemeData = formatSharedClientThemeData;
}
function formatSharedClientThemeData({sharedClientTheme}, a1, a2) { // fn#67005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8624:241, offset: 0x01c11fe8, size: 319 bytes, params: 4, frame: 20
var object2;
var uri;
var value;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
if (sharedClientTheme !== undefined) {
object2 = {};
object2.colors = sharedClientTheme.colors;
object2.gradientAngle = sharedClientTheme.gradient_angle;
object2.createdBy = a2;
uri = a1.uri;
value = '';
object2.createdByAvatarUrl = uri === undefined ? value : a1.uri;
uri = Image.resolveAssetSource(importDefault(7955) /* metro dependency 7955 */).uri;
object2.nitroWheelIconUrl = uri;
object2.previewLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SKNnqq);
object2.previewHeading = intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).yl1iMm);
object2.createdByLabel = value + intl.format((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).fQPSEf,
{username: '__USERNAME__'});
return object2;
function formatSharedClientThemeData({sharedClientTheme}, a1, a2) { // fn#67005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8624:241, offset: 0x01c11fe8, size: 319 bytes, params: 4, frame: 20
var object;
var uri;
var value;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
if (sharedClientTheme !== undefined) {
object = {};
object.colors = sharedClientTheme.colors;
object.gradientAngle = sharedClientTheme.gradient_angle;
object.createdBy = a2;
uri = a1.uri;
value = '';
object.createdByAvatarUrl = uri === undefined ? value : a1.uri;
uri = Image.resolveAssetSource(importDefault(7955) /* metro dependency 7955 */).uri;
object.nitroWheelIconUrl = uri;
object.previewLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SKNnqq);
object.previewHeading = intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).yl1iMm);
object.createdByLabel = value + intl.format((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).fQPSEf,
{username: '__USERNAME__'});
return object;
}
}
}
global.__d(_fun67004, 8439, [27, 7955, 1244, 2422,
2]) /* metro module 8439, dependencies: [27, 7955, 1244, 2422, 2] */;
@@ -1,17 +1,20 @@
/* Metro module 11513; source: modules/client_themes/native/chat/previewSharedClientTheme.tsx; dependencies: [4080, 11514, 1962, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun88148(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11699:6, offset: 0x01fd69b1, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/previewSharedClientTheme.tsx');
exports.handleTapPreviewSharedClientTheme = handleTapPreviewSharedClientTheme;
}
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/chat/previewSharedClientTheme.tsx');
exports.handleTapPreviewSharedClientTheme = handleTapPreviewSharedClientTheme_88149;
function handleTapPreviewSharedClientTheme_88149({message}) { // fn#88149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11699:224, offset: 0x01fd6a18, size: 102 bytes, params: 2, frame: 17
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'custom-theme-preview', {message: message, backdropKind: 'none'}]);
}
function handleTapPreviewSharedClientTheme({message}) { // fn#88149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11699:224, offset: 0x01fd6a18, size: 102 bytes, params: 2, frame: 17
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'custom-theme-preview', {message: message, backdropKind: 'none'}]);
}
global.__d(_fun88148, 11513, [4080, 11514, 1962, 2]) /* metro module 11513, dependencies: [4080, 11514, 1962, 2] */;
@@ -1,23 +1,27 @@
/* Metro module 11516; source: modules/client_themes/native/chat/sharedClientThemeViewed.tsx; dependencies: [8742, 480, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as AnalyticsUtilsModule from '../../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as UseTrackImpressionModule from '../../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
function _fun88171(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11702:6, offset: 0x01fd757d, size: 96 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/sharedClientThemeViewed.tsx');
exports.handleSharedClientThemeViewed = handleSharedClientThemeViewed;
}
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/chat/sharedClientThemeViewed.tsx');
exports.handleSharedClientThemeViewed = handleSharedClientThemeViewed_88172;
function handleSharedClientThemeViewed_88172() { // fn#88172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11702:219, offset: 0x01fd75dd, size: 99 bytes, params: 1, frame: 16
const trackImpression = UseTrackImpressionModule.trackImpression;
const object = {};
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const VIEW = ImpressionTypes.VIEW;
object.type = VIEW;
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const CUSTOM_THEME_SHARE = ImpressionNames.CUSTOM_THEME_SHARE;
object.name = CUSTOM_THEME_SHARE;
object.properties = {};
Reflect.apply(trackImpression, UseTrackImpressionModule, [object]);
}
function handleSharedClientThemeViewed() { // fn#88172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11702:219, offset: 0x01fd75dd, size: 99 bytes, params: 1, frame: 16
const value = require(8742) /* metro dependency 8742: useTrackImpression */;
const trackImpression = value.trackImpression;
const 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 CUSTOM_THEME_SHARE = ImpressionNames.CUSTOM_THEME_SHARE;
object2.name = CUSTOM_THEME_SHARE;
object2.properties = {};
Reflect.apply(trackImpression, value, [object2]);
}
global.__d(_fun88171, 11516, [8742, 480, 2]) /* metro module 11516, dependencies: [8742, 480, 2] */;
@@ -1,45 +1,48 @@
/* Metro module 7703; source: modules/client_themes/native/useActiveTheme.tsx; dependencies: [1312, 3964, 1354, 1313, 566, 4006, 2] */
import UnsyncedUserSettingsStore from '../../user_settings/UnsyncedUserSettingsStore.tsx'; /* Metro dependency 1312 */
import CustomThemeMobileStore from './CustomThemeMobileStore.tsx'; /* Metro dependency 1354 */
import ClientThemesBackgroundStore from '../ClientThemesBackgroundStore.tsx'; /* Metro dependency 3964 */
import UseRoutedActiveGuildTheme from '../../guild_themes/native/useRoutedActiveGuildTheme.tsx'; /* Metro dependency 4006 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ThemeConstantsModule from '../../user_settings/ThemeConstants.tsx'; /* Metro dependency 1313 */
function _fun61496(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:6, offset: 0x01b41fe7, size: 206 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = useActiveThemeType;
const useActiveThemeType2 = useActiveThemeType;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const unsyncedUserSettingsStore = importDefault(1312) /* metro dependency 1312: UnsyncedUserSettingsStore */;
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
const themeConstantsModule = require(1313) /* metro dependency 1313: ThemeConstants */;
const env0_6 = themeConstantsModule.SystemThemeState;
const env0_7 = themeConstantsModule.ActiveThemeType;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useActiveTheme.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/useActiveTheme.tsx');
exports.useIsCustomThemeActive = function() {
return useActiveThemeType() === ActiveThemeType.CUSTOM;
};
exports.useIsClientThemeOrCustomThemeActive = useIsClientThemeOrCustomThemeActive;
exports.useActiveThemeType = closure;
}
exports.useActiveThemeType = useActiveThemeType2;
function useActiveThemeType() { // fn#61497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:177, offset: 0x01b420b5, size: 287 bytes, params: 1, frame: 20
const value2 = undefined;
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([CustomThemeMobileStore],
function() {
return CustomThemeMobileStore.hasCustomTheme();
});
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ClientThemesBackgroundStore],
function() {
return ClientThemesBackgroundStore.gradientPreset != null;
});
const value5 = (UseRoutedActiveGuildTheme)();
const useSystemTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([UnsyncedUserSettingsStore],
function() {
return UnsyncedUserSettingsStore.useSystemTheme;
});
const ON = SystemThemeState.ON;
return (value5 == null ? value2 : value5.type) === 'custom' ? ActiveThemeType.CUSTOM : (value5 == null ? value2 : value5.type) === 'preset' ? ActiveThemeType.CLIENT : value3 ? ActiveThemeType.CUSTOM : value4 ? ActiveThemeType.CLIENT : useSystemTheme === ON ? ActiveThemeType.SYSTEM : ActiveThemeType.DEFAULT;
}
function useActiveThemeType() { // fn#61497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:177, offset: 0x01b420b5, size: 287 bytes, params: 1, frame: 20
const value2 = undefined;
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([CustomThemeMobileStore],
function() {
return CustomThemeMobileStore.hasCustomTheme();
});
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ClientThemesBackgroundStore],
function() {
return ClientThemesBackgroundStore.gradientPreset != null;
});
const value5 = (importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)();
const useSystemTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([UnsyncedUserSettingsStore],
function() {
return UnsyncedUserSettingsStore.useSystemTheme;
});
const ON = SystemThemeState.ON;
return (value5 == null ? value2 : value5.type) === 'custom' ? ActiveThemeType.CUSTOM : (value5 == null ? value2 : value5.type) === 'preset' ? ActiveThemeType.CLIENT : value3 ? ActiveThemeType.CUSTOM : value4 ? ActiveThemeType.CLIENT : useSystemTheme === ON ? ActiveThemeType.SYSTEM : ActiveThemeType.DEFAULT;
}
function useIsClientThemeOrCustomThemeActive() { // fn#61502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:764, offset: 0x01b42228, size: 46 bytes, params: 1, frame: 11
const value2 = useActiveThemeType();
const CLIENT = ActiveThemeType.CLIENT;
return value2 === CLIENT || value2 === ActiveThemeType.CUSTOM;
}
function useIsClientThemeOrCustomThemeActive() { // fn#61502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:764, offset: 0x01b42228, size: 46 bytes, params: 1, frame: 11
const value2 = useActiveThemeType();
const CLIENT = ActiveThemeType.CLIENT;
return value2 === CLIENT || value2 === ActiveThemeType.CUSTOM;
}
global.__d(_fun61496, 7703, [1312, 3964, 1354, 1313, 566, 4006,
2]) /* metro module 7703, dependencies: [1312, 3964, 1354, 1313, 566, 4006, 2] */;
@@ -1,4 +1,10 @@
/* Metro module 4003; source: modules/client_themes/native/useColorThemeBackground.tsx; dependencies: [31, 1310, 3964, 1244, 3966, 4004, 4006, 632, 4045, 2] */
import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
import ClientThemesBackgroundStore from '../ClientThemesBackgroundStore.tsx'; /* Metro dependency 3964 */
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 ClientThemesTypesModule from '../ClientThemesTypes.tsx'; /* Metro dependency 3966 */
function _fun32944(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#32944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:6, offset: 0x01022ca0, size: 160 bytes, params: 8, frame: 19
const env0_0 = require;
const getGuildThemeName = function() {
@@ -6,83 +12,82 @@ function _fun32944(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useColorThemeBackground.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/useColorThemeBackground.tsx');
exports.default = useColorThemeBackground;
}
function useColorThemeBackground() { // fn#32946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:300, offset: 0x01022d7e, size: 192 bytes, params: 1, frame: 20
return env0_3.useMemo(_fun32949, [(importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)(),
(require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ThemeStore], function() {
return ThemeStore.theme;
})]) ?? (require(4045) /* metro dependency 4045: MobileThemesUtils */).useCustomBackgroundGradient() ?? (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ClientThemesBackgroundStore],
function() {
return ClientThemesBackgroundStore.gradientPreset;
});
}
function _fun32949() { // fn#32949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:511, offset: 0x01022e5c, size: 28 bytes, params: 1, frame: 13
return getGuildThemeBackground(env0_0, theme);
}
function getGuildThemeBackground(a0, a1) { // fn#32950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:515, offset: 0x01022e78, size: 394 bytes, params: 3, frame: 22
var environment;
var value;
var object4;
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
var colors;
var customUserThemeSettings;
var property;
var value3;
var object5;
var singleColorGuildThemeGradientColors;
var items2;
if (a0 == null) {
return null;
}
if (a0.type === 'custom') {
customUserThemeSettings = a0.customUserThemeSettings;
colors = customUserThemeSettings.colors;
value = 0;
property = colors[value];
object4 = {};
value3 = environment.__proto__.__proto__;
object4.type = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
object4.getName = getGuildThemeName;
object4.theme = a1;
object5 = {};
singleColorGuildThemeGradientColors = (require(4004) /* metro dependency 4004: GuildThemePresets */).getSingleColorGuildThemeGradientColors(property,
a1);
items2 = [];
arraySpread(items2, singleColorGuildThemeGradientColors, value, a1);
object5.colors = items2;
object5.gradientColorStops = [];
object5.gradientAngle = customUserThemeSettings.gradientAngle ?? value;
object5.baseMix = customUserThemeSettings.baseMix ?? (require(4004) /* metro dependency 4004: GuildThemePresets */).GUILD_THEME_DEFAULT_BASE_MIX;
object4.customThemeSettings = object5;
} else {
value = environment.__proto__.__proto__;
var guildThemePresetAppearance = (require(4004) /* metro dependency 4004: GuildThemePresets */).getGuildThemePresetAppearance(a0.preset,
a1);
object4 = {};
object4.type = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
object4.getName = getGuildThemeName;
object4.theme = a1;
var object6 = {};
object6.colors = guildThemePresetAppearance.colors.map(function(a0) {
return a0.hex;
function useColorThemeBackground() { // fn#32946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:300, offset: 0x01022d7e, size: 192 bytes, params: 1, frame: 20
return ReactModule.useMemo(_fun32949, [(importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)(),
(require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ThemeStore], function() {
return ThemeStore.theme;
})]) ?? (require(4045) /* metro dependency 4045: MobileThemesUtils */).useCustomBackgroundGradient() ?? (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ClientThemesBackgroundStore],
function() {
return ClientThemesBackgroundStore.gradientPreset;
});
object6.gradientAngle = guildThemePresetAppearance.angle;
object6.gradientColorStops = guildThemePresetAppearance.colors.map(function(a0) {
return a0.stop;
});
object6.baseMix = guildThemePresetAppearance.baseMix;
object4.customThemeSettings = object6;
function _fun32949() { // fn#32949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:511, offset: 0x01022e5c, size: 28 bytes, params: 1, frame: 13
return getGuildThemeBackground(env0_0, theme);
function getGuildThemeBackground(a0, a1) { // fn#32950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:515, offset: 0x01022e78, size: 394 bytes, params: 3, frame: 22
var environment;
var value;
var object;
const ClientThemeType = (ClientThemesTypesModule).ClientThemeType;
var colors;
var customUserThemeSettings;
var property;
var value3;
var object2;
var singleColorGuildThemeGradientColors;
var items2;
if (a0 == null) {
return null;
}
if (a0.type === 'custom') {
customUserThemeSettings = a0.customUserThemeSettings;
colors = customUserThemeSettings.colors;
value = 0;
property = colors[value];
object = {};
value3 = environment.__proto__.__proto__;
object.type = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
object.getName = getGuildThemeName;
object.theme = a1;
object2 = {};
singleColorGuildThemeGradientColors = (require(4004) /* metro dependency 4004: GuildThemePresets */).getSingleColorGuildThemeGradientColors(property,
a1);
items2 = [];
arraySpread(items2, singleColorGuildThemeGradientColors, value, a1);
object2.colors = items2;
object2.gradientColorStops = [];
object2.gradientAngle = customUserThemeSettings.gradientAngle ?? value;
object2.baseMix = customUserThemeSettings.baseMix ?? (require(4004) /* metro dependency 4004: GuildThemePresets */).GUILD_THEME_DEFAULT_BASE_MIX;
object.customThemeSettings = object2;
} else {
value = environment.__proto__.__proto__;
var guildThemePresetAppearance = (require(4004) /* metro dependency 4004: GuildThemePresets */).getGuildThemePresetAppearance(a0.preset,
a1);
object = {};
object.type = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
object.getName = getGuildThemeName;
object.theme = a1;
var object3 = {};
object3.colors = guildThemePresetAppearance.colors.map(function(a0) {
return a0.hex;
});
object3.gradientAngle = guildThemePresetAppearance.angle;
object3.gradientColorStops = guildThemePresetAppearance.colors.map(function(a0) {
return a0.stop;
});
object3.baseMix = guildThemePresetAppearance.baseMix;
object.customThemeSettings = object3;
}
return object;
}
}
}
return object4;
}
global.__d(_fun32944, 4003, [31, 1310, 3964, 1244, 3966, 4004, 4006, 632, 4045,
2]) /* metro module 4003, dependencies: [31, 1310, 3964, 1244, 3966, 4004, 4006, 632, 4045, 2] */;
@@ -1,42 +1,46 @@
/* Metro module 4047; source: modules/client_themes/native/useCustomThemeDisplaySettings.tsx; dependencies: [57, 1354, 566, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import CustomThemeMobileStore from './CustomThemeMobileStore.tsx'; /* Metro dependency 1354 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
function _fun33391(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:6, offset: 0x0102d9b5, size: 128 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useCustomThemeDisplaySettings.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/useCustomThemeDisplaySettings.tsx');
exports.useCustomThemeDisplaySettings = useCustomThemeDisplaySettings;
}
function useCustomThemeDisplaySettings(a0) { // fn#33392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:244, offset: 0x0102da35, size: 187 bytes, params: 2, frame: 17
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
const value = env0_2(Reflect.apply(useStateFromStoresArray, fluxModule, [[CustomThemeMobileStore], _fun33393]), 3);
const property = value[0];
const property2 = value[1];
const property3 = value[2];
if (property3 !== undefined) {
return property3;
}
if (property !== undefined) {
if (property2 !== undefined) {
return {baseTheme: property2, customTheme: property};
function useCustomThemeDisplaySettings(a0) { // fn#33392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:244, offset: 0x0102da35, size: 187 bytes, params: 2, frame: 17
const useStateFromStoresArray = FluxModule.useStateFromStoresArray;
const value = Module00057(Reflect.apply(useStateFromStoresArray, FluxModule, [[CustomThemeMobileStore], _fun33393]), 3);
const property = value[0];
const property2 = value[1];
const property3 = value[2];
if (property3 !== undefined) {
return property3;
}
if (property !== undefined) {
if (property2 !== undefined) {
return {baseTheme: property2, customTheme: property};
}
}
if (a0 != null) {
return {baseTheme: a0.base_theme, customTheme: {colors: a0.colors, gradientAngle: a0.gradient_angle,
baseMix: a0.base_mix, gradientColorStops: []}};
}
function _fun33393() { // fn#33393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:291, offset: 0x0102daf0, size: 57 bytes, params: 1, frame: 10
const value = environment.__proto__;
const customThemeMobileStoreBinding = CustomThemeMobileStore;
const items2 = [customThemeMobileStoreBinding.getCustomTheme()];
const getBaseTheme = customThemeMobileStoreBinding.getBaseTheme;
items2[1] = Reflect.apply(getBaseTheme, customThemeMobileStoreBinding, []);
const getPreviewTheme = customThemeMobileStoreBinding.getPreviewTheme;
items2[2] = Reflect.apply(getPreviewTheme, customThemeMobileStoreBinding, []);
return items2;
}
}
if (a0 != null) {
return {baseTheme: a0.base_theme, customTheme: {colors: a0.colors, gradientAngle: a0.gradient_angle,
baseMix: a0.base_mix, gradientColorStops: []}};
}
}
function _fun33393() { // fn#33393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:291, offset: 0x0102daf0, size: 57 bytes, params: 1, frame: 10
const value = environment.__proto__;
const items2 = [CustomThemeMobileStore.getCustomTheme()];
const getBaseTheme = CustomThemeMobileStore.getBaseTheme;
items2[1] = Reflect.apply(getBaseTheme, CustomThemeMobileStore, []);
const getPreviewTheme = CustomThemeMobileStore.getPreviewTheme;
items2[2] = Reflect.apply(getPreviewTheme, CustomThemeMobileStore, []);
return items2;
}
global.__d(_fun33391, 4047, [57, 1354, 566, 2]) /* metro module 4047, dependencies: [57, 1354, 566, 2] */;
@@ -1,13 +1,17 @@
/* Metro module 7702; source: modules/client_themes/native/useIsUsingClientTheme.tsx; dependencies: [7703, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as UseActiveThemeModule from './useActiveTheme.tsx'; /* Metro dependency 7703 */
function _fun61494(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7880:6, offset: 0x01b41f65, size: 94 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useIsUsingClientTheme.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/useIsUsingClientTheme.tsx');
exports.default = useIsUsingClientTheme;
function useIsUsingClientTheme() { // fn#61495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7880:190, offset: 0x01b41fc3, size: 36 bytes, params: 1, frame: 11
return (UseActiveThemeModule).useIsClientThemeOrCustomThemeActive();
}
}
function useIsUsingClientTheme() { // fn#61495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7880:190, offset: 0x01b41fc3, size: 36 bytes, params: 1, frame: 11
return (require(7703) /* metro dependency 7703: useActiveTheme */).useIsClientThemeOrCustomThemeActive();
}
global.__d(_fun61494, 7702, [7703, 2]) /* metro module 7702, dependencies: [7703, 2] */;
@@ -1,36 +1,43 @@
/* Metro module 15133; source: modules/client_themes/native/useThemedHeaderOptions.tsx; dependencies: [31, 33, 7704, 7702, 1585, 477, 4092, 2] */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import UseIsUsingClientTheme from './useIsUsingClientTheme.tsx'; /* Metro dependency 7702 */
import ThemedGradient from './ThemedGradient.tsx'; /* Metro dependency 7704 */
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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
function _fun115368(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:6, offset: 0x0245e2b1, size: 169 bytes, params: 8, frame: 18
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(33) /* metro dependency 33 */).jsx;
object = {headerBackground: undefined, contentStyle: undefined};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useThemedHeaderOptions.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/useThemedHeaderOptions.tsx');
exports.default = useThemedHeaderOptions;
}
function headerBackground() { // fn#115369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:185, offset: 0x0245e35a, size: 51 bytes, params: 1, frame: 13
return ((Component) => <Component absolute tall wide />)(importDefault(7704) /* metro dependency 7704: ThemedGradient */);
}
function useThemedHeaderOptions() { // fn#115370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:329, offset: 0x0245e38d, size: 96 bytes, params: 1, frame: 16
return env0_3.useMemo(_fun115371, [(importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().top,
(importDefault(7702) /* metro dependency 7702: useIsUsingClientTheme */)()]);
}
function _fun115371() { // fn#115371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:413, offset: 0x0245e3ed, size: 186 bytes, params: 1, frame: 15
var value3;
var moduleValue;
if (env0_0) {
value3 = 5;
moduleValue = require(dependencyMap[value3]);
if (moduleValue.isIOS()) {
return {headerBackground: headerBackground,
contentStyle: {marginTop: -top + (top > 50 ? value3 : 0) + (56 - ((require(4092) /* metro dependency 4092: DeviceUtils */).isIpadOS() ? 46 : 44))}};
}
return {headerBackground: headerBackground, contentStyle: env1_5.contentStyle};
function headerBackground() { // fn#115369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:185, offset: 0x0245e35a, size: 51 bytes, params: 1, frame: 13
return ((Component) => <Component absolute tall wide />)(ThemedGradient);
}
return env1_5;
function useThemedHeaderOptions() { // fn#115370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:329, offset: 0x0245e38d, size: 96 bytes, params: 1, frame: 16
return ReactModule.useMemo(_fun115371, [(UseSafeAreaInsetsNative)().top,
(UseIsUsingClientTheme)()]);
function _fun115371() { // fn#115371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:413, offset: 0x0245e3ed, size: 186 bytes, params: 1, frame: 15
var value3;
var moduleValue;
if (env0_0) {
value3 = 5;
moduleValue = require(dependencyMap[value3]);
if (moduleValue.isIOS()) {
return {headerBackground: headerBackground,
contentStyle: {marginTop: -top + (top > 50 ? value3 : 0) + (56 - ((require(4092) /* metro dependency 4092: DeviceUtils */).isIpadOS() ? 46 : 44))}};
}
return {headerBackground: headerBackground, contentStyle: env1_5.contentStyle};
}
return env1_5;
}
}
}
global.__d(_fun115368, 15133, [31, 33, 7704, 7702, 1585, 477, 4092,
2]) /* metro module 15133, dependencies: [31, 33, 7704, 7702, 1585, 477, 4092, 2] */;