/* Metro module 16127; source: modules/guild_settings/native/GuildSettingsModalOfficialMessages.tsx; dependencies: [57, 31, 27, 4502, 1867, 9113, 6233, 4503, 482, 33, 4501, 697, 1244, 13730, 11256, 13732, 4501, 1484, 566, 9112, 5282, 5277, 4080, 14392, 1962, 8853, 4017, 6238, 13187, 673, 4573, 9221, 3826, 6858, 674, 1305, 13745, 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 GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import GuildSettingsActionCreators from '../GuildSettingsActionCreators.tsx'; /* Metro dependency 9112 */
import GuildSettingsStore from '../GuildSettingsStore.tsx'; /* Metro dependency 9113 */
import ColorBlock from '../../../components_native/common/color_picker/ColorBlock.tsx'; /* Metro dependency 13187 */
import Module13745 from '../../../by-id/module-13745.js'; /* Metro dependency 13745 */
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 ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
import * as ColorUtilsModule from '../../../external/discord_common/js/shared/utils/ColorUtils.tsx'; /* Metro dependency 673 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as NavigatorHeaderNativeModule from '../../../design/components/Navigator/native/NavigatorHeader.native.tsx'; /* Metro dependency 5282 */
import * as TableRowConstantsModule from '../../../design/components/TableRow/native/TableRowConstants.tsx'; /* Metro dependency 6233 */
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as SegmentedControlStateNativeModule from '../../../design/components/SegmentedControl/native/SegmentedControlState.native.tsx'; /* Metro dependency 8853 */
import * as SegmentedControlNativeModule from '../../../design/components/SegmentedControl/native/SegmentedControl.native.tsx'; /* Metro dependency 9221 */
import * as ThemeDarkIconModule from '../../../design/components/Icon/native/redesign/generated/ThemeDarkIcon.tsx'; /* Metro dependency 11256 */
import * as ThemeLightIconModule from '../../../design/components/Icon/native/redesign/generated/ThemeLightIcon.tsx'; /* Metro dependency 13730 */
import * as ThemeMidnightIconModule from '../../../design/components/Icon/native/redesign/generated/ThemeMidnightIcon.tsx'; /* Metro dependency 13732 */
function _fun124477(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#124477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:6, offset: 0x025b9561, size: 963 bytes, params: 8, frame: 25
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const StyleSheet = value.StyleSheet;
const env0_5 = value.View;
const TABLE_ROW_PADDING = (TableRowConstantsModule).TABLE_ROW_PADDING;
value = require(4503) /* metro dependency 4503: MessageConstants */;
const env0_9 = value.DEFAULT_GUILD_OFFICIAL_COLOR;
const env0_10 = value.GUILD_OFFICIAL_HIGHLIGHT_ALPHA;
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;
object = {};
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.container = {gap: PX_8, height: '100%'};
const object3 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.gap = PX_16;
object3.alignItems = 'center';
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.paddingHorizontal = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.marginBottom = PX_16;
object.segmentedControlContainer = object3;
object.trailingColorContainer = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center'};
object.colorBlock = {'marginHorizontal': 0, 'marginVertical': 0, 'marginRight': 8, 'minWidth': 24, 'height': 24,
'borderRadius': 3};
const object4 = {paddingHorizontal: TABLE_ROW_PADDING};
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object4.gap = PX_8;
object.chatSection = object4;
const object5 = {};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object5.paddingVertical = PX_24;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
object5.borderWidth = StyleSheet.hairlineWidth;
object.chatContainer = object5;
const object6 = {flexDirection: 'row'};
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object6.backgroundColor = BACKGROUND_BASE_LOW;
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object6.gap = PX_8;
object.chatContainerInner = object6;
object.chatContent = {flex: 1};
object.chatHeader = {'flexDirection': 'row', 'alignItems': 'baseline', 'gap': 6};
object.chatTimestamp = {marginTop: -8};
const env0_14 = Reflect.apply(createStyles, value, [object]);
value = require(4501) /* metro dependency 4501: createStyles */;
let createAnimatedThemedStyles = value.createAnimatedThemedStyles;
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
const env0_15 = Reflect.apply(createAnimatedThemedStyles, value, [{backgroundColor: BACKGROUND_BASE_LOW}]);
value = require(4501) /* metro dependency 4501: createStyles */;
createAnimatedThemedStyles = value.createAnimatedThemedStyles;
const BORDER_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_STRONG;
const env0_16 = Reflect.apply(createAnimatedThemedStyles, value, [{borderColor: BORDER_STRONG}]);
value = require(4501) /* metro dependency 4501: createStyles */;
createAnimatedThemedStyles = value.createAnimatedThemedStyles;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
const env0_17 = Reflect.apply(createAnimatedThemedStyles, value, [{color: TEXT_DEFAULT}]);
value = require(4501) /* metro dependency 4501: createStyles */;
createAnimatedThemedStyles = value.createAnimatedThemedStyles;
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
const env0_18 = Reflect.apply(createAnimatedThemedStyles, value, [{color: TEXT_MUTED}]);
object = {code: 'function GuildSettingsModalOfficialMessagesTsx1(){const{activeIndex}=this.__closure;return activeIndex.get();}'};
object = {code: 'function GuildSettingsModalOfficialMessagesTsx2(activeIndex){const{runOnJS,setCurrentThemeIndex}=this.__closure;runOnJS(setCurrentThemeIndex)(Math.round(activeIndex));}'};
(FileImportTrackerModule).fileFinishedImporting('modules/guild_settings/native/GuildSettingsModalOfficialMessages.tsx');
exports.default = GuildSettingsModalOfficialMessages;
function MessagePreview_124478({animatedStyles, selectedColor, theme}) { // fn#124478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:1772, offset: 0x025b9924, size: 777 bytes, params: 2, frame: 39
const styles = useStyles();
const value2 = ReactModule.useMemo(_fun124479, []);
const internal = (Native).internal;
const resolveSemanticColor = internal.resolveSemanticColor;
const BACKGROUND_BASE_LOWER = (Native).colors.BACKGROUND_BASE_LOWER;
const value5 = (require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */).getAccessibleGuildOfficialTextColor(selectedColor,
Reflect.apply(resolveSemanticColor, internal, [theme, BACKGROUND_BASE_LOWER]),
AccessibilityStore.desaturateUserColors ? AccessibilityStore.saturation : 1).hex();
const value6 = (Module00674)(selectedColor);
const value8 = value6.alpha(GUILD_OFFICIAL_HIGHLIGHT_ALPHA).hex();
const View2 = (ReanimatedRexport).View;
const items3 = [styles.chatContainer];
items3[1] = animatedStyles.borderStrong;
items3[2] = animatedStyles.bgBaseLow;
const items2 = [styles.chatContainerInner];
items2[1] = {backgroundColor: value8};
const Avatar = (NativeModule).Avatar;
const avatar = ;
const Text = (TextModule).Text;
const textStrong = animatedStyles.textStrong;
const intl = (IndexNativeModule).intl;
let string = intl.string;
const view = (
{Reflect.apply(string, intl, [(IndexNativeModule).t.cqpybK])}
{value2}
);
const object2 = {color: value5};
string = intl.string;
const Mi9Kbe = (IndexNativeModule).t.Mi9Kbe;
return (
{avatar}
{view}
{Reflect.apply(string, intl, [Mi9Kbe])}
);
function _fun124479() { // fn#124479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:1863, offset: 0x025b9c2d, size: 69 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = require(3826) /* metro dependency 3826: DateUtils */;
const calendarFormat = value.calendarFormat;
const Date = global.Date;
const value2 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date();
return Reflect.apply(calendarFormat, value, [date instanceof Object ? date : value2, true]);
}
}
function GuildSettingsModalOfficialMessages({guildId}) { // fn#124480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:2881, offset: 0x025b9c72, size: 1216 bytes, params: 2, frame: 35
const styles = useStyles();
const value3 = (UseNavigationNativeModule).useNavigation();
const {guild, submitting,
hasChanges} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildSettingsStore],
function() {
var object = {};
var guildSettingsStoreBinding = GuildSettingsStore;
object.guild = guildSettingsStoreBinding.getGuild();
object.submitting = guildSettingsStoreBinding.isSubmitting();
object.hasChanges = guildSettingsStoreBinding.hasChanges();
return object;
});
const hasChanges2 = hasChanges;
const r20 = guild?.officialMessageColor ?? DEFAULT_GUILD_OFFICIAL_COLOR;
const env0_4 = r20;
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
var r0;
r0 = GuildStore.getGuild(guildId)?.officialMessageColor;
r0 = r0 ?? DEFAULT_GUILD_OFFICIAL_COLOR;
return r0;
}, [guildId]);
let binding = env0_4;
let useState = binding.useState;
const value6 = Reflect.apply(useState, binding, [0]);
binding = hasChanges2;
const value7 = binding(value6, 2);
const property = value7[0];
const property2 = value7[1];
env0_4.useEffect(function() {
return _fun124484;
}, [guildId]);
env0_4.useEffect(_fun124485, [guildId, r20, value3, submitting, hasChanges]);
const value8 = env0_4.useCallback(_fun124490, [r20, value5]);
const binding5 = env0_4;
useState = binding5.useState;
const value9 = binding(Reflect.apply(useState, binding5, [0]), 2);
const property3 = value9[0];
const env0_7 = value9[1];
binding = env0_4;
let closure = _fun124492;
const value10 = binding.useCallback(closure, []);
const value11 = env0_4.useMemo(_fun124493, []);
const value12 = (SegmentedControlStateNativeModule).useSegmentedControlState({items: value11,
pageWidth: property3, defaultIndex: property});
const activeIndex = value12.activeIndex;
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = function() {
return activeIndex.get();
};
closure.__closure = {activeIndex: activeIndex};
closure.__workletHash = 4687220686460;
closure.__initData = env0_19;
const GuildSettingsModalOfficialMessagesB2 = GuildSettingsModalOfficialMessagesB;
GuildSettingsModalOfficialMessagesB2.__closure = {runOnJS: ReanimatedRexportModule.runOnJS,
setCurrentThemeIndex: property2};
GuildSettingsModalOfficialMessagesB2.__workletHash = 5332792853021;
GuildSettingsModalOfficialMessagesB2.__initData = env0_20;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, GuildSettingsModalOfficialMessagesB2]);
object = {bgBaseLow: env0_15(activeIndex), borderStrong: env0_16(activeIndex), textStrong: env0_17(activeIndex),
textMuted: env0_18(activeIndex)};
const TableRow = (TableRowNativeModule).TableRow;
const intl = (IndexNativeModule).intl;
let string = intl.string;
const tableRow = (
{((Component) => )(ColorBlock)}
}
subLabel={(ColorUtilsModule).int2hex(r20)}
/>
);
const Text = (TextModule).Text;
string = intl.string;
const VI0jGW = (IndexNativeModule).t.VI0jGW;
const items3 = [
{Reflect.apply(string, intl, [VI0jGW])}
,
];
items3[1] = (
);
const SegmentedControl = (SegmentedControlNativeModule).SegmentedControl;
items3[2] = (
);
return (
{tableRow}
{items3}
);
function _fun124483() { // fn#124483, offset: 0x025ba19d, size: 11 bytes, params: 1, frame: 1
return _fun124484;
function _fun124484() { // fn#124484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3381, offset: 0x025ba1a8, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */;
value.cancelChanges(guildId);
}
}
function _fun124485() { // fn#124485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3432, offset: 0x025ba1d5, size: 95 bytes, params: 1, frame: 16
const binding = env0_1;
const setOptions = binding.setOptions;
const submittingBinding = submitting;
const value2 = undefined;
Reflect.apply(setOptions, binding, [{headerLeft: submittingBinding ? function() {
return null;
} : value2, headerRight: submitting ? _fun124488 : hasChanges ? _fun124489 : value2}]);
return value2;
function handleSaveChanges_124486() { // fn#124486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3459, offset: 0x025ba234, size: 57 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
value = importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */;
value.saveGuild(guildId, {officialMessageColor: env1_4});
}
function _fun124488() { // fn#124488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3569, offset: 0x025ba26d, size: 45 bytes, params: 1, frame: 13
const HeaderSubmittingIndicator = (NavigatorHeaderNativeModule).HeaderSubmittingIndicator;
return ;
}
function _fun124489() { // fn#124489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3616, offset: 0x025ba29a, size: 107 bytes, params: 1, frame: 18
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
const handleSaveChanges_124486Binding = handleSaveChanges_124486;
const intl = (IndexNativeModule).intl;
return (
);
}
}
function _fun124490() { // fn#124490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3776, offset: 0x025ba305, size: 168 bytes, params: 1, frame: 20
var environment;
let value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[22]);
const openLazy = defaultImport.openLazy;
value = require(dependencyMap[24]);
value = value(dependencyMap[23], dependencyMap.paths);
const object = {};
object.color = env0_4;
object.defaultColor = env0_5;
const intl = require(dependencyMap[12]).intl;
const string = intl.string;
const XqMe3N = require(dependencyMap[12]).t.XqMe3N;
object.confirmLabel = Reflect.apply(string, intl, [XqMe3N]);
object.onSelect = onSelect_124491;
Reflect.apply(openLazy, defaultImport, [value, 'RoleColorPicker', object]);
function onSelect_124491(a0) { // fn#124491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:3927, offset: 0x025ba3ad, size: 48 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__;
(GuildSettingsActionCreators).updateGuild({officialMessageColor: a0});
}
}
function _fun124492({nativeEvent}) { // fn#124492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:4046, offset: 0x025ba3dd, size: 36 bytes, params: 2, frame: 11
env0_7(nativeEvent.layout.width);
}
function _fun124493() { // fn#124493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:4107, offset: 0x025ba401, size: 336 bytes, params: 1, frame: 21
let object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const K2sFfo = (require(1244) /* metro dependency 1244: indexNative */).t.K2sFfo;
object.label = Reflect.apply(string, intl, [K2sFfo]);
const LIGHT = ThemeTypes.LIGHT;
object.id = LIGHT;
const ThemeLightIcon = (ThemeLightIconModule).ThemeLightIcon;
object.icon = ;
object.page = null;
const items2 = [object];
object = {};
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b8Cei3);
const DARKER = ThemeTypes.DARKER;
object.id = DARKER;
const ThemeDarkIcon = (ThemeDarkIconModule).ThemeDarkIcon;
object.icon = ;
object.page = null;
items2[1] = object;
object = {};
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pQwSpQ);
const MIDNIGHT = ThemeTypes.MIDNIGHT;
object.id = MIDNIGHT;
const ThemeMidnightIcon = (ThemeMidnightIconModule).ThemeMidnightIcon;
object.icon = ;
object.page = null;
items2[2] = object;
return items2;
}
function GuildSettingsModalOfficialMessagesB(a0) { // fn#124495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16335:4650, owner: GuildSettingsModalOfficialMessages.B, offset: 0x025ba563, size: 70 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_6);
const Math = global.Math;
value(Math.round(a0));
}
}
}
global.__d(_fun124477, 16127, [57, 31, 27, 4502, 1867, 9113, 6233, 4503, 482, 33, 4501, 697, 1244, 13730, 11256,
13732, 4501, 1484, 566, 9112, 5282, 5277, 4080, 14392, 1962, 8853, 4017, 6238, 13187, 673, 4573, 9221, 3826,
6858, 674, 1305, 13745,
2]) /* metro module 16127, dependencies: [57, 31, 27, 4502, 1867, 9113, 6233, 4503, 482, 33, 4501, 697, 1244, 13730, 11256, 13732, 4501, 1484, 566, 9112, 5282, 5277, 4080, 14392, 1962, 8853, 4017, 6238, 13187, 673, 4573, 9221, 3826, 6858, 674, 1305, 13745, 2] */;