Files
2026-07-28 01:06:53 +03:00

195 lines
11 KiB
TypeScript

/* Metro module 9664; source: modules/guild/native/GuildIconUploader.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 1310, 33, 4501, 697, 4002, 9665, 9666, 4573, 1244, 9667, 9668, 5278, 3868, 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 ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
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 NativeModule from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
function _fun75758(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:6, offset: 0x01db8545, size: 661 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles;
object = {container: {'width': 82, 'height': 82, 'marginTop': 4}};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object.guildPlaceholder = {backgroundColor: BACKGROUND_SURFACE_HIGH};
object.guildIcon = {'width': 82, 'height': 82, 'borderRadius': 41};
object.iconWrapperBorder = {'position': 'absolute', 'top': -8, 'right': -8, 'width': 40, 'height': 40,
'borderRadius': 20, 'justifyContent': 'center', 'alignItems': 'center'};
const object3 = {'width': 32, 'height': 32, 'borderRadius': null, 'justifyContent': 'center',
'alignItems': 'center'};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
object3.backgroundColor = INTERACTIVE_TEXT_ACTIVE;
object.filledIconWrapper = object3;
const object4 = {'position': 'absolute', 'top': -4, 'right': -4, 'width': 32, 'height': 32, 'borderRadius': null,
'backgroundColor': null, 'justifyContent': 'center', 'alignItems': 'center'};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object4.backgroundColor = BACKGROUND_BRAND;
object.emptyIconWrapper = object4;
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object.emptyGuildIcon = {'borderWidth': 2, 'borderStyle': 'dashed', 'justifyContent': 'center',
'alignItems': 'center', borderColor: INTERACTIVE_TEXT_DEFAULT};
object.emptyGuildIconText = {'textAlign': 'center', 'lineHeight': 16, 'paddingTop': 4};
object.uploadIcon = {'height': 16, 'width': 16};
const env0_13 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]);
const PureComponent = value.PureComponent;
value = _fun75762(PureComponent);
const ThemeContext = (NativeModule).ThemeContext;
value.contextType = ThemeContext;
(FileImportTrackerModule).fileFinishedImporting('modules/guild/native/GuildIconUploader.tsx');
exports.default = value;
function _isNativeReflectConstruct_75759() { // fn#75759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:224, offset: 0x01db87da, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_75759_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun75762(a0) { // fn#75762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:1385, offset: 0x01db883c, size: 124 bytes, params: 2, frame: 16
const GuildIconUploader2 = GuildIconUploader;
Inherits(GuildIconUploader2, a0);
return CreateClass(GuildIconUploader2, [{key: 'renderIcon', value: value_75764}, {key: 'renderUpload',
value: value_75765}, {key: 'render', value: value_75766}]);
function GuildIconUploader() { // fn#75763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:1397, offset: 0x00e2f839, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, GuildIconUploader);
const value3 = env1_6(GuildIconUploader);
return env1_5(this, _isNativeReflectConstruct_75759() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_75764() { // fn#75764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:1700, offset: 0x01db88b8, size: 379 bytes, params: 1, frame: 25
var r0;
var object2;
var moduleValue;
var items2;
var Text;
var intl;
let value = environment.__proto__;
const value2 = env1_13(this.context);
const icon = this.props.icon;
if (icon != null) {
r0 = <Image style={[value2.guildIcon, value2.guildPlaceholder]} source={{uri: icon}} />;
} else {
var viewProps = {style: [value2.guildIcon, value2.emptyGuildIcon]};
moduleValue = require(4002) /* metro dependency 4002: shared */;
items2 = [
<Image
source={moduleValue.isThemeDark(ThemeStore.theme) ? importDefault(9665) /* metro dependency 9665 */ : importDefault(9666) /* metro dependency 9666 */}
/>,
];
Text = (require(4573) /* metro dependency 4573: Text */).Text;
var textProps = {'style': null, 'variant': 'text-xs/bold', 'color': 'text-default',
style: value2.emptyGuildIconText};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
value = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3UB9ad']);
items2[1] = (
<Text {...textProps}>
{value.toUpperCase()}
</Text>
);
value = (
<View {...viewProps}>
{items2}
</View>
);
r0 = value;
}
return r0;
}
function value_75765() { // fn#75765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:2128, offset: 0x01db8a33, size: 253 bytes, params: 1, frame: 23
var r0;
var object;
const value2 = env1_13(this.context);
const {icon, iconBackgroundColor} = this.props;
if (icon != null) {
object = {};
object.style = [value2.iconWrapperBorder, {backgroundColor: iconBackgroundColor}];
object.children = (
<View style={value2.filledIconWrapper}>
<Image
style={[value2.uploadIcon, {tintColor: iconBackgroundColor}]}
source={importDefault(9667) /* metro dependency 9667 */}
/>
</View>
);
r0 = object;
} else {
object = {};
object.style = value2.emptyIconWrapper;
object.children = <Image source={importDefault(9668) /* metro dependency 9668 */} />;
r0 = object;
}
return <View {...r0} />;
}
function value_75766() { // fn#75766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9850:2467, offset: 0x01db8b30, size: 323 bytes, params: 1, frame: 24
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value = environment.__proto__;
const value2 = env1_13(this.context);
const {style, onPress, icon} = this.props;
const PressableOpacity = (PressablesModule).PressableOpacity;
const r5 = icon != null ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.VATxfe) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['MsUY/S']);
const items3 = [value2.container, style];
const items2 = [
<View style={value2.guildIcon}>
{this.renderIcon()}
</View>,
];
items2[1] = this.renderUpload();
return (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={r5}
onPress={onPress}
>
<View style={items3}>
{items2}
</View>
</PressableOpacity>
);
}
}
}
global.__d(_fun75758, 9664, [6, 7, 15, 17, 18, 31, 27, 1310, 33, 4501, 697, 4002, 9665, 9666, 4573, 1244, 9667,
9668, 5278, 3868,
2]) /* metro module 9664, dependencies: [6, 7, 15, 17, 18, 31, 27, 1310, 33, 4501, 697, 4002, 9665, 9666, 4573, 1244, 9667, 9668, 5278, 3868, 2] */;