/* 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] */ 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 var object2; 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(27) /* metro dependency 27 */; const StyleSheet = value.StyleSheet; const env0_5 = value.View; const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; const guildSettingsStore = importDefault(9113) /* metro dependency 9113: GuildSettingsStore */; const TABLE_ROW_PADDING = (require(6233) /* metro dependency 6233: TableRowConstants */).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; const env0_11 = (require(482) /* metro dependency 482: Constants */).ThemeTypes; 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; object2 = {}; let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object2.container = {gap: PX_8, height: '100%'}; const object7 = {}; let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object7.gap = PX_16; object7.alignItems = 'center'; PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object7.paddingHorizontal = PX_16; PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object7.marginBottom = PX_16; object2.segmentedControlContainer = object7; object2.trailingColorContainer = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center'}; object2.colorBlock = {'marginHorizontal': 0, 'marginVertical': 0, 'marginRight': 8, 'minWidth': 24, 'height': 24, 'borderRadius': 3}; const object8 = {paddingHorizontal: TABLE_ROW_PADDING}; PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object8.gap = PX_8; object2.chatSection = object8; const object9 = {}; const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24; object9.paddingVertical = PX_24; object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl; object9.borderWidth = StyleSheet.hairlineWidth; object2.chatContainer = object9; const object10 = {flexDirection: 'row'}; let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object10.backgroundColor = BACKGROUND_BASE_LOW; PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object10.gap = PX_8; object2.chatContainerInner = object10; object2.chatContent = {flex: 1}; object2.chatHeader = {'flexDirection': 'row', 'alignItems': 'baseline', 'gap': 6}; object2.chatTimestamp = {marginTop: -8}; const env0_14 = Reflect.apply(createStyles, value, [object2]); 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}]); object2 = {code: 'function GuildSettingsModalOfficialMessagesTsx1(){const{activeIndex}=this.__closure;return activeIndex.get();}'}; object2 = {code: 'function GuildSettingsModalOfficialMessagesTsx2(activeIndex){const{runOnJS,setCurrentThemeIndex}=this.__closure;runOnJS(setCurrentThemeIndex)(Math.round(activeIndex));}'}; (require(2) /* metro dependency 2 */).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 = env0_4.useMemo(_fun124479, []); const internal = (importDefault(697) /* metro dependency 697: native */).internal; const resolveSemanticColor = internal.resolveSemanticColor; const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: 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 = (importDefault(674) /* metro dependency 674 */)(selectedColor); const value8 = value6.alpha(GUILD_OFFICIAL_HIGHLIGHT_ALPHA).hex(); const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View; const items3 = [styles.chatContainer]; items3[1] = animatedStyles.borderStrong; items3[2] = animatedStyles.bgBaseLow; const items2 = [styles.chatContainerInner]; items2[1] = {backgroundColor: value8}; const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar; const avatar = ; const Text = (require(4573) /* metro dependency 4573: Text */).Text; const textStrong = animatedStyles.textStrong; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; let string = intl.string; const view = {Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.cqpybK])}{value2}; const object = {color: value5}; string = intl.string; const Mi9Kbe = (require(1244) /* metro dependency 1244: indexNative */).t.Mi9Kbe; return ( {avatar} {view} {Reflect.apply(string, intl, [Mi9Kbe])} ); } 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 var object2; const styles = useStyles(); const value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation(); const {guild, submitting, hasChanges} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildSettingsStore], function() { var object = {}; object.guild = GuildSettingsStore.getGuild(); object.submitting = GuildSettingsStore.isSubmitting(); object.hasChanges = GuildSettingsStore.hasChanges(); return object; }); const env0_3 = 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 = env0_3; 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 = (require(8853) /* metro dependency 8853: SegmentedControlStateNative */).useSegmentedControlState({items: value11, pageWidth: property3, defaultIndex: property}); const activeIndex = value12.activeIndex; const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */; const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction; closure = function() { return activeIndex.get(); }; closure.__closure = {activeIndex: activeIndex}; closure.__workletHash = 4687220686460; closure.__initData = env0_19; const closure2 = GuildSettingsModalOfficialMessagesB; closure2.__closure = {runOnJS: reanimatedRexportModule.runOnJS, setCurrentThemeIndex: property2}; closure2.__workletHash = 5332792853021; closure2.__initData = env0_20; Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]); object2 = {bgBaseLow: env0_15(activeIndex), borderStrong: env0_16(activeIndex), textStrong: env0_17(activeIndex), textMuted: env0_18(activeIndex)}; const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; let string = intl.string; const tableRow = {((Component) => )(importDefault(13187) /* metro dependency 13187: ColorBlock */)}} subLabel={(require(673) /* metro dependency 673: ColorUtils */).int2hex(r20)} />; const Text = (require(4573) /* metro dependency 4573: Text */).Text; string = intl.string; const VI0jGW = (require(1244) /* metro dependency 1244: indexNative */).t.VI0jGW; const items3 = [{Reflect.apply(string, intl, [VI0jGW])}]; items3[1] = ; const SegmentedControl = (require(9221) /* metro dependency 9221: SegmentedControlNative */).SegmentedControl; items3[2] = ; return ( {tableRow} {items3} ); } 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 _fun124483() { // fn#124483, offset: 0x025ba19d, size: 11 bytes, params: 1, frame: 1 return _fun124484; } 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 _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 object2 = {}; object2.color = env0_4; object2.defaultColor = env0_5; const intl = require(dependencyMap[12]).intl; const string = intl.string; const XqMe3N = require(dependencyMap[12]).t.XqMe3N; object2.confirmLabel = Reflect.apply(string, intl, [XqMe3N]); object2.onSelect = onSelect_124491; Reflect.apply(openLazy, defaultImport, [value, 'RoleColorPicker', object2]); } 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 object2 = {}; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const string = intl.string; const K2sFfo = (require(1244) /* metro dependency 1244: indexNative */).t.K2sFfo; object2.label = Reflect.apply(string, intl, [K2sFfo]); const LIGHT = ThemeTypes.LIGHT; object2.id = LIGHT; const ThemeLightIcon = (require(13730) /* metro dependency 13730: ThemeLightIcon */).ThemeLightIcon; object2.icon = ; object2.page = null; const items2 = [object2]; object2 = {}; object2.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b8Cei3); const DARKER = ThemeTypes.DARKER; object2.id = DARKER; const ThemeDarkIcon = (require(11256) /* metro dependency 11256: ThemeDarkIcon */).ThemeDarkIcon; object2.icon = ; object2.page = null; items2[1] = object2; object2 = {}; object2.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pQwSpQ); const MIDNIGHT = ThemeTypes.MIDNIGHT; object2.id = MIDNIGHT; const ThemeMidnightIcon = (require(13732) /* metro dependency 13732: ThemeMidnightIcon */).ThemeMidnightIcon; object2.icon = ; object2.page = null; items2[2] = object2; 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)); } 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 handleSaveChanges() { // 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 = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).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 = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton; const handleSaveChangesBinding = handleSaveChanges; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; return ( ); } 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__; (importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */).updateGuild({officialMessageColor: a0}); }