198 lines
10 KiB
TypeScript
198 lines
10 KiB
TypeScript
/* Metro module 10944; source: modules/notifications/settings/native/NotificationSettingsPresets.tsx; dependencies: [31, 27, 33, 1244, 4867, 4073, 10945, 10629, 4501, 697, 8853, 4573, 4578, 9221, 10947, 10941, 2] */
|
|
function _fun83905(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:6, offset: 0x01f2db7a, size: 294 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_4 = value.jsx;
|
|
const env0_5 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object = {'padding': 16, 'minHeight': 82, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
|
|
'justifyContent': 'center'};
|
|
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg + 8;
|
|
const REDESIGN_INPUT_CONTROL_ACTIVE_BG = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_INPUT_CONTROL_ACTIVE_BG;
|
|
object.backgroundColor = REDESIGN_INPUT_CONTROL_ACTIVE_BG;
|
|
const env0_6 = Reflect.apply(createStyles, value, [{customContainer: object}]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/notifications/settings/native/NotificationSettingsPresets.tsx');
|
|
exports.NotificationSettingsGuildPresets = NotificationSettingsGuildPresets;
|
|
exports.NotificationSettingsChannelPresets = NotificationSettingsChannelPresets;
|
|
}
|
|
|
|
function NotificationSettingsPresets(a0) { // fn#83906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:391, offset: 0x01f2dca0, size: 1086 bytes, params: 2, frame: 29
|
|
var r0;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
var items2;
|
|
var items3;
|
|
var Button;
|
|
const env0_0 = a0;
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
let preset = a0.preset;
|
|
const Presets = (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets;
|
|
let ALL_MESSAGES = Presets.ALL_MESSAGES;
|
|
const value3 = 0;
|
|
const r8 = preset === ALL_MESSAGES ? value3 : a0.preset === (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets.MENTIONS ? 1 : a0.preset !== (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets.NOTHING ? value2 : 2;
|
|
const segmentedControlStateNativeModule = require(8853) /* metro dependency 8853: SegmentedControlStateNative */;
|
|
const useSegmentedControlState = segmentedControlStateNativeModule.useSegmentedControlState;
|
|
const object5 = {pageWidth: value3, onSetActiveIndex: onSetActiveIndex_83907};
|
|
const object6 = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
object6.label = Reflect.apply(string, intl, [t.hZrr6k]);
|
|
ALL_MESSAGES = Presets.ALL_MESSAGES;
|
|
object6.id = ALL_MESSAGES;
|
|
const CircleCheckIcon = (require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon;
|
|
object6.icon = <CircleCheckIcon />;
|
|
object6.page = null;
|
|
const items4 = [object6];
|
|
const object7 = {};
|
|
object7.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y59NJm);
|
|
const MENTIONS = Presets.MENTIONS;
|
|
object7.id = MENTIONS;
|
|
const MagicWandIcon = (require(10945) /* metro dependency 10945: MagicWandIcon */).MagicWandIcon;
|
|
object7.icon = <MagicWandIcon />;
|
|
object7.page = null;
|
|
items4[1] = object7;
|
|
const object8 = {};
|
|
object8.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['pGn/bJ']);
|
|
const NOTHING = Presets.NOTHING;
|
|
object8.id = NOTHING;
|
|
const BellSlashIcon = (require(10629) /* metro dependency 10629: BellSlashIcon */).BellSlashIcon;
|
|
object8.icon = <BellSlashIcon />;
|
|
object8.page = null;
|
|
items4[2] = object8;
|
|
object5.items = items4;
|
|
object5.defaultIndex = r8;
|
|
const value6 = Reflect.apply(useSegmentedControlState, segmentedControlStateNativeModule, [object5]);
|
|
value6.useEffect(_fun83908, [r8, value6]);
|
|
preset = a0.preset;
|
|
const CUSTOM = Presets.CUSTOM;
|
|
if (preset === CUSTOM) {
|
|
var viewBindingProps = {style: styles.customContainer};
|
|
string = intl.string;
|
|
items2 = [<Text variant="text-sm/semibold">{Reflect.apply(string, intl, [t['32yow9']])}</Text>];
|
|
string = intl.string;
|
|
items2[1] = <Text variant="text-xs/medium">{Reflect.apply(string, intl, [t.l3doVX])}</Text>;
|
|
items3 = [<View style={{'flex': 1, 'marginRight': 8}}>{items2}</View>];
|
|
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
items3[1] = <Button variant="secondary" text={Reflect.apply(string, intl,
|
|
[t['ztO+l+']])} onPress={onPress_83909} />;
|
|
r0 = <View {...viewBindingProps}>{items3}</View>;
|
|
} else {
|
|
const SegmentedControl = (require(9221) /* metro dependency 9221: SegmentedControlNative */).SegmentedControl;
|
|
r0 = <SegmentedControl variant="experimental_Large" state={value6} />;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function NotificationSettingsGuildPresets(a0) { // fn#83910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2011, offset: 0x01f2e2c0, size: 91 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
const value = require(10947) /* metro dependency 10947: notificationSettingsGuildFlagUtils */;
|
|
const useGuildPresetSettings = value.useGuildPresetSettings;
|
|
return (
|
|
<NotificationSettingsPresets
|
|
preset={Reflect.apply(useGuildPresetSettings, value, [a0.guildId]).preset}
|
|
updatePreset={updatePreset}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function NotificationSettingsChannelPresets(a0) { // fn#83912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2247, offset: 0x01f2e351, size: 91 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
const value = require(10941) /* metro dependency 10941: notficationSettingsChannelFlagUtils */;
|
|
const useChannelPresetSettings = value.useChannelPresetSettings;
|
|
return (
|
|
<NotificationSettingsPresets
|
|
preset={Reflect.apply(useChannelPresetSettings, value, [a0.channel]).preset}
|
|
updatePreset={updatePreset}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function NotificationSettingsPresetsOnSetActiveIndex(a0) { // fn#83907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:633, owner: NotificationSettingsPresets.onSetActiveIndex, offset: 0x01f2e0de, size: 372 bytes, params: 2, frame: 14
|
|
var r0;
|
|
var preset;
|
|
const Presets = (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets;
|
|
var binding;
|
|
var updatePreset;
|
|
let value = a0 === 0;
|
|
if (value) {
|
|
preset = env0_0.preset;
|
|
value = environment.__proto__;
|
|
value = preset !== Presets.ALL_MESSAGES;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
binding = env0_0;
|
|
updatePreset = binding.updatePreset;
|
|
value = environment.__proto__;
|
|
Reflect.apply(updatePreset, binding, [Presets.ALL_MESSAGES]);
|
|
}
|
|
value = a0 === 1;
|
|
if (value) {
|
|
preset = env0_0.preset;
|
|
value = environment.__proto__;
|
|
value = preset !== Presets.MENTIONS;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
binding = env0_0;
|
|
updatePreset = binding.updatePreset;
|
|
value = environment.__proto__;
|
|
Reflect.apply(updatePreset, binding, [Presets.MENTIONS]);
|
|
}
|
|
value = a0 === 2;
|
|
if (value) {
|
|
preset = env0_0.preset;
|
|
value = environment.__proto__;
|
|
value = preset !== Presets.NOTHING;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
if (r0) {
|
|
binding = env0_0;
|
|
updatePreset = binding.updatePreset;
|
|
value = environment.__proto__;
|
|
Reflect.apply(updatePreset, binding, [Presets.NOTHING]);
|
|
}
|
|
}
|
|
|
|
function _fun83908() { // fn#83908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:1303, offset: 0x01f2e252, size: 53 bytes, params: 1, frame: 12
|
|
if (!(env0_1 == null || env0_1 >= 3)) {
|
|
env0_2.setActiveIndex(env0_1);
|
|
}
|
|
}
|
|
|
|
function NotificationSettingsPresetsOnPress() { // fn#83909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:1752, owner: NotificationSettingsPresets.onPress, offset: 0x01f2e287, size: 57 bytes, params: 1, frame: 13
|
|
const binding = env0_0;
|
|
const updatePreset = binding.updatePreset;
|
|
const Presets = (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets;
|
|
const MENTIONS = Presets.MENTIONS;
|
|
Reflect.apply(updatePreset, binding, [MENTIONS]);
|
|
}
|
|
|
|
function NotificationSettingsGuildPresetsUpdatePreset(a0) { // fn#83911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2164, owner: NotificationSettingsGuildPresets.updatePreset, offset: 0x01f2e31b, size: 54 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
value = require(10947) /* metro dependency 10947: notificationSettingsGuildFlagUtils */;
|
|
return value.updateGuildPreset(env0_0.guildId, a0);
|
|
}
|
|
|
|
function NotificationSettingsChannelPresetsUpdatePreset(a0) { // fn#83913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2404, owner: NotificationSettingsChannelPresets.updatePreset, offset: 0x01f2e3ac, size: 70 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
value = require(10941) /* metro dependency 10941: notficationSettingsChannelFlagUtils */;
|
|
const updateChannelPreset = value.updateChannelPreset;
|
|
const binding = env0_0;
|
|
return Reflect.apply(updateChannelPreset, value, [binding.channel.guild_id, binding.channel.id, a0]);
|
|
}
|
|
|