Files
discord-decomp/sources/utils/web/KeyboardLayoutMapUtils.tsx
2026-07-28 01:06:53 +03:00

1768 lines
73 KiB
TypeScript

/* Metro module 12480; source: utils/web/KeyboardLayoutMapUtils.tsx; dependencies: [15, 17, 18, 57, 5, 6, 7, 691, 5047, 3, 477, 12479, 587, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
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 Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import DeveloperOptionsStore from '../../stores/DeveloperOptionsStore.tsx'; /* Metro dependency 691 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as StorageModule from '../../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
import * as KeyboardConstantsModule from '../../external/discord_common/js/shared/constants/KeyboardConstants.tsx'; /* Metro dependency 5047 */
function _fun94933(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#94933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6, offset: 0x0212cf00, size: 807 bytes, params: 8, frame: 28
var codes;
const env0_0 = require;
const normalizeKey = function(a0) {
var r0;
var value = a0;
if (value == null) {
r0 = value;
} else {
value = value.toLocaleLowerCase();
r0 = value;
}
return r0;
};
const syncKeyboardLayoutMap = function() {
return _syncKeyboardLayoutMap.apply(this, arguments);
};
const normalizeKeyMap2 = normalizeKeyMap;
const getNormalizedEvent = function(a0) {
var object = {keyCode: a0.keyCode};
object.key = a0.key != null ? normalizeKey(a0.key) : undefined;
object.code = a0.code;
return object;
};
const initializeKeyboardMapper2 = initializeKeyboardMapper;
const getKeyboardMapper2 = getKeyboardMapper;
const reverseLookupCodeFromKey2 = reverseLookupCodeFromKey;
const getExactKeyboardEventMatchFromAny2 = getExactKeyboardEventMatchFromAny;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = KeyboardConstantsModule;
const LinuxKeyToCode = value.LinuxKeyToCode;
const MacosKeyToCode = value.MacosKeyToCode;
const WindowsKeyToCode = value.WindowsKeyToCode;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('KeyboardLayoutMapUtils');
if (!Reflect.apply((require(477) /* metro dependency 477: PlatformUtils */).isLinux, value, [])) {
value = require(477) /* metro dependency 477: PlatformUtils */;
if (!value.isMac()) {
value = require(477) /* metro dependency 477: PlatformUtils */;
if (!value.isWindows()) {
codes = (importDefault(12479) /* metro dependency 12479 */).codes;
}
}
}
const Set = global.Set;
const set = new Set([192, 220, 222, 223, 229]);
Object = global.Object;
const value3 = Object.freeze({'KeyA': 'a', 'KeyB': 'b', 'KeyC': 'c', 'KeyD': 'd', 'KeyE': 'e', 'KeyF': 'f',
'KeyG': 'g', 'KeyH': 'h', 'KeyI': 'i', 'KeyJ': 'j', 'KeyK': 'k', 'KeyL': 'l', 'KeyM': 'm', 'KeyN': 'n',
'KeyO': 'o', 'KeyP': 'p', 'KeyQ': 'q', 'KeyR': 'r', 'KeyS': 's', 'KeyT': 't', 'KeyU': 'u', 'KeyV': 'v',
'KeyW': 'w', 'KeyX': 'x', 'KeyY': 'y', 'KeyZ': 'z', 'Digit0': '0', 'Digit1': '1', 'Digit2': '2', 'Digit3': '3',
'Digit4': '4', 'Digit5': '5', 'Digit6': '6', 'Digit7': '7', 'Digit8': '8', 'Digit9': '9', 'Backquote': '`',
'Backslash': '\\', 'Quote': "'", 'Slash': '/', 'Comma': ',', 'Period': '.', 'Semicolon': ';', 'Equal': '=',
'Minus': '-', 'BracketLeft': '[', 'BracketRight': ']', 'IntlBackslash': '§'});
const value6 = new _fun94957()();
const env0_16 = _fun94992(_fun94968());
(FileImportTrackerModule).fileFinishedImporting('utils/web/KeyboardLayoutMapUtils.tsx');
exports.BACKTICK_CODES = set;
exports.DefaultKeyboardLayout = value3;
exports.normalizeKeyMap = normalizeKeyMap2;
exports.initializeKeyboardMapper = initializeKeyboardMapper2;
exports.__DEV_overrideLayoutMapKey = __DEV_overrideLayoutMapKey;
exports.getKeyboardMapper = getKeyboardMapper2;
exports.resetKeyboardMapper = function() {
return _resetKeyboardMapper.apply(this, arguments);
};
exports.getLayoutMap = getLayoutMap;
exports.reverseLookupCodeFromKey = reverseLookupCodeFromKey2;
exports.getExactKeyboardEventMatchFromAny = getExactKeyboardEventMatchFromAny2;
exports.getKeyboardEventShapeFromAny = getKeyboardEventShapeFromAny;
exports.getKeyboardEventShapeFromKey = getKeyboardEventShapeFromKey;
exports.getKeyboardEventShapeFromKeycode = getKeyboardEventShapeFromKeycode;
function _isNativeReflectConstruct_94934() { // fn#94934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:248, offset: 0x0212d227, 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_94934_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _syncKeyboardLayoutMap() { // fn#94939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:1902, offset: 0x0212d2a1, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun94941).apply(this, arguments);
function* _fun94941() { // fn#94941, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:1969, offset: 0x0212d2de, size: 187 bytes, params: 1, frame: 15
var value3;
var binding;
var Object;
var fromEntries;
var entries;
var prototype;
var error;
var value6;
var binding2;
var value8;
if (false) {
return undefined;
}
let navigator = global.navigator;
let keyboard = navigator.keyboard;
let getLayoutMap = keyboard?.getLayoutMap;
if (getLayoutMap == null) {
return false;
}
try {
navigator = global.navigator;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
keyboard = navigator.keyboard;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
getLayoutMap = keyboard.getLayoutMap;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
value = Reflect.apply(getLayoutMap, keyboard, []);
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
yield value;
try {
value = undefined;
value3 = false;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
if (value3) {
return value;
}
try {
binding = env2_13;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
Object = global.Object;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
fromEntries = Object.fromEntries;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
entries = value.entries;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
value = Reflect.apply(entries, value, []);
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
value = Reflect.apply(fromEntries, Object, [value]);
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
prototype = binding.prototype;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
value = new binding(value);
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
value = value instanceof Object ? value : undefined;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
try {
env2_14 = value;
} catch (error) {
value = environment.__proto__.__proto__;
binding = env2_13;
prototype = binding.prototype;
value6 = Object.create(prototype, {constructor: {value: binding}});
binding2 = new binding();
value8 = binding2 instanceof Object ? binding2 : value6;
env2_14 = value8;
return false;
}
return true;
}
}
function getKeyboardLayoutMap() { // fn#94942, offset: 0x00fceaa4, size: 9 bytes, params: 1, frame: 1
return env0_14;
}
function normalizeKeyMap(a0) { // fn#94943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:2243, offset: 0x0212d399, size: 205 bytes, params: 2, frame: 25
var r2;
var property;
var value5;
var property2;
var value6;
var has;
var add;
var binding;
var error;
var HermesInternal;
var concat;
var value7;
const Set = global.Set;
const set = new Set();
const object = {};
const Object = global.Object;
const value2 = Object.entries(a0);
let length = value2.length;
const value3 = 0;
if (value3 < length) {
r2 = value3;
reducibleLoop1: while (true) {
property = value2[r2];
value5 = Module00057(property, 2);
property = value5[value3];
property2 = value5[1];
value6 = normalizeKey(property);
has = set.has;
reducibleJoin6: while (true) {
reducibleJoin4: while (true) {
if (Reflect.apply(has, set, [value6])) {
if (object[value6] == null) {
break reducibleJoin4;
}
if (object[value6] !== property2) {
binding = env0_10;
error = binding.error;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(error, binding, ['Seperate keyCode mappings found for: ' + value6]);
break reducibleJoin6;
}
break reducibleJoin4;
}
break reducibleJoin4;
}
add = set.add;
Reflect.apply(add, set, [value6]);
object[value6] = property2;
break reducibleJoin6;
}
value7 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value2.length;
if (value7 < length) {
r2 = value7;
continue reducibleLoop1;
}
break reducibleLoop1;
}
}
return object;
}
function initializeKeyboardMapper() { // fn#94945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9064, offset: 0x0212d4a8, size: 66 bytes, params: 1, frame: 12
var Promise;
var value2;
var promise;
if (env0_18 == null) {
Promise = global.Promise;
value2 = _fun94946();
promise = new Promise();
}
return env0_18;
function _fun94946() { // fn#94946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9131, offset: 0x0212d4ea, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_6(_fun94948);
return _fun94950;
function* _fun94948(a0) { // fn#94948, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9151, offset: 0x0212d519, size: 113 bytes, params: 2, frame: 16
var environment;
if (true) {
value = environment.__proto__.__proto__.__proto__;
yield env3_21();
if (false) {
return undefined;
}
var value6 = new env3_16(env3_11);
global.document.addEventListener('keydown', _fun94949);
a0();
}
function _fun94949(a0) { // fn#94949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9242, offset: 0x0212d58a, size: 81 bytes, params: 2, frame: 15
var value;
var binding;
var value2;
var error;
try {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_17;
value2 = binding == null;
if (!value2) {
binding.addEvent(a0);
}
} catch (error) {
binding = env4_10;
binding.error('KeyboardMapper - Error adding event', {event: a0, error: error});
}
}
}
function _fun94950() { // fn#94950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9375, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
function getKeyboardMapper() { // fn#94951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9425, offset: 0x0212d5db, size: 33 bytes, params: 1, frame: 11
var r0;
const value2 = null;
if (value2 == env0_17) {
initializeKeyboardMapper();
r0 = value2;
} else {
r0 = env0_17;
}
return r0;
}
function _resetKeyboardMapper() { // fn#94952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9505, offset: 0x0212d5fc, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun94954).apply(this, arguments);
function* _fun94954() { // fn#94954, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9568, offset: 0x0212d639, size: 63 bytes, params: 1, frame: 12
if (true) {
value = environment.__proto__.__proto__;
yield env2_21();
if (false) {
return undefined;
}
value = env2_27();
if (value != null) {
value.reset();
}
}
}
}
function reverseLookupCodeFromKey(a0) { // fn#94955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9683, offset: 0x0212d678, size: 79 bytes, params: 2, frame: 14
var keyboardMapper;
const value = undefined;
const r5 = a0 != null ? normalizeKey(a0) : value;
if (r5 != null) {
keyboardMapper = getKeyboardMapper();
return (keyboardMapper == null ? value : keyboardMapper.findCodeFromKeyboardLayoutMap(r5)) ?? value;
}
return value;
}
function getExactKeyboardEventMatchFromAny(a0) { // fn#94956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:9870, offset: 0x0212d6c7, size: 95 bytes, params: 2, frame: 18
var r1;
var r0;
var keyboardMapper;
const getNormalizedEventBinding = getNormalizedEvent;
const value2 = undefined;
const normalizedEventBinding = getNormalizedEventBinding(a0);
const key = normalizedEventBinding.key;
const value4 = null;
if (value4 != key) {
keyboardMapper = getKeyboardMapper();
r1 = value4 == keyboardMapper ? value2 : keyboardMapper.findExactKeyboardEventMatch(normalizedEventBinding.key,
normalizedEventBinding.code, normalizedEventBinding.keyCode);
r0 = value4 != r1 ? r1 : value4;
} else {
r0 = value4;
}
return r0;
}
function _fun94957() { // fn#94957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:1188, offset: 0x0212d726, size: 234 bytes, params: 1, frame: 15
return CreateClass(DiscordKeyboardLayoutMap, [{key: 'get', value: function(a0) {
return this.map.get(a0);
}}, {key: 'has', value: function(a0) {
return this.map.has(a0);
}}, {key: 'keys', value: function() {
return this.map.keys();
}}, {key: 'values', value: function() {
return this.map.values();
}}, {key: 'entries', value: function() {
return this.map.entries();
}}, {key: 'forEach', value: function(a0, a1) {
return this.map.forEach(a0, a1);
}}, {key: 'size', get: function() {
return this.map.size;
}}, {key: '_set', value: function(a0, a1) {
this.map.set(a0, a1);
}}]);
function DiscordKeyboardLayoutMap() { // fn#94958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:1209, offset: 0x0212d810, size: 111 bytes, params: 1, frame: 15
var environment;
let value = a0;
const r5 = value !== undefined ? value : env1_12;
value = environment.__proto__;
env1_7(this, DiscordKeyboardLayoutMap);
const Map = global.Map;
const Object = global.Object;
let map = Object.entries(r5).map;
value = Reflect.apply(map, value, [function(a0) {
var r0;
var r2;
var r4;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
var r1 = value2 ? value : item;
if (value2) {
r0 = item2;
r2 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r2 = value;
r4 = value3;
} else {
r0 = item3;
r2 = item;
r4 = value3;
}
}
if (!r4) {
r0.return();
}
var items = [r1];
items[1] = normalizeKey(r2);
return items;
}]);
let value2 = Object.create(Map.prototype, {constructor: {value: Map}});
map = new Map(value);
this.map = map instanceof Object ? map : value2;
}
}
function _fun94968() { // fn#94968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:2643, offset: 0x0212d987, size: 492 bytes, params: 1, frame: 15
return CreateClass(BaseKeyboardMapper, [{key: '_setCachedKeyCodeMapEntries', value: function() {
this._cachedKeyCodeMapEntries = global.Object.entries(this.keyCodeMap).map(_fun94971);
this._cachedAllEvents = this._cachedKeyCodeMapEntries.flatMap(_fun94972);
}}, {key: '_setCachedKeyMapEntries', value: function() {
var Object = global.Object;
this._cachedKeyMapEntries = Object.entries(this.keyMap);
}}, {key: '_setCachedKeyLayoutMapEntries', value: function() {
var Array = global.Array;
this._cachedKeyLayoutMapEntries = Array.from(this.getLayoutMap().entries());
}}, {key: 'cachedKeyCodeMapEntries', get: function() {
if (this._cachedKeyCodeMapEntries.length === 0) {
this._setCachedKeyCodeMapEntries();
}
return this._cachedKeyCodeMapEntries;
}}, {key: 'cachedKeyMapEntries', get: function() {
if (this._cachedKeyMapEntries.length === 0) {
this._setCachedKeyMapEntries();
}
return this._cachedKeyMapEntries;
}}, {key: 'cachedKeyLayoutMapEntries', get: function() {
if (this._cachedKeyLayoutMapEntries.length === 0) {
this._setCachedKeyLayoutMapEntries();
}
return this._cachedKeyLayoutMapEntries;
}}, {key: 'cachedAllEvents', get: function() {
if (this._cachedAllEvents.length === 0) {
this._setCachedKeyCodeMapEntries();
}
return this._cachedAllEvents;
}}, {key: 'getKeyCodeMapItem', value: function(a0) {
if (this.keyCodeMap[a0] == null) {
this.keyCodeMap[a0] = [];
}
return this.keyCodeMap[a0];
}}, {key: '_buildKeyCodeMapFromKeyMap', value: value_94980}, {key: '_initializeInternalLayoutMap',
value: value_94981}, {key: '_hasExactMatch', value: function(a0) {
var env0_0 = a0;
if (a0.keyCode == null) {
return false;
}
var property = this.keyCodeMap;
property = property[a0.keyCode];
return property != null && property.some(_fun94983);
}}, {key: 'addEvent', value: value_94984}, {key: 'updateCaches', value: function() {
this._setCachedKeyCodeMapEntries();
this._setCachedKeyMapEntries();
this._setCachedKeyLayoutMapEntries();
}}, {key: 'reset', value: function() {
this._internalKeyLayoutMap = null;
var normalizeKeyMapBinding = normalizeKeyMap;
var object = {};
copyDataProperties(object, this._defaultKeyMap, normalizeKeyMapBinding);
this.keyMap = normalizeKeyMapBinding(object);
this._initializeInternalLayoutMap();
this.keyCodeMap = this._buildKeyCodeMapFromKeyMap();
this.updateCaches();
this.save();
}}, {key: 'save', value: value_94987}, {key: 'getLayoutMap', value: value_94988}, {key: 'getKeyCode',
value: function(a0) {
return this.keyMap[a0];
}}, {key: 'findCodeFromKeyboardLayoutMap', value: value_94990}]);
function BaseKeyboardMapper() { // fn#94969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:2664, offset: 0x0212db73, size: 219 bytes, params: 1, frame: 17
var object;
var normalizeKeyMapBinding;
let value = a0;
const r5 = value !== undefined ? value : {};
value = environment.__proto__;
env1_7(this, BaseKeyboardMapper);
const value3 = null;
this._internalKeyLayoutMap = value3;
this._cachedKeyCodeMapEntries = [];
this._cachedKeyMapEntries = [];
this._cachedKeyLayoutMapEntries = [];
this._cachedAllEvents = [];
this._defaultKeyMap = r5;
const Storage = (StorageModule).Storage;
const value4 = Storage.get(env1_15);
const value5 = value3 != value4;
let r1 = value5 ? value4 : value3;
if (value3 == r1) {
normalizeKeyMapBinding = normalizeKeyMap;
object = {};
copyDataProperties(object, r5, value5);
r1 = normalizeKeyMapBinding(object);
}
this.keyMap = r1;
this._initializeInternalLayoutMap();
this.keyCodeMap = this._buildKeyCodeMapFromKeyMap();
this.updateCaches();
this.save();
}
function value_94970() { // fn#94970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:3199, offset: 0x0212dc4e, size: 87 bytes, params: 1, frame: 13
const Object = global.Object;
let value = Object.entries(this.keyCodeMap);
this._cachedKeyCodeMapEntries = value.map(function(a0) {
var r0;
var r1;
var r4;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
var r2 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r4 = value3;
} else {
r0 = item3;
r1 = item;
r4 = value3;
}
}
if (!r4) {
r0.return();
}
return [(0, global.Number)(r2), r1];
});
const _cachedKeyCodeMapEntries = this._cachedKeyCodeMapEntries;
this._cachedAllEvents = _cachedKeyCodeMapEntries.flatMap(function(a0) {
var r0;
var r1;
var r2;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
if (value2) {
r0 = value;
r1 = item2;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = value;
r1 = item3;
r2 = value3;
} else {
r0 = item;
r1 = item3;
r2 = value3;
}
}
if (!r2) {
r1.return();
}
return r0;
});
}
function value_94980() { // fn#94980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:4389, offset: 0x0212de20, size: 154 bytes, params: 1, frame: 25
var r2;
var r1;
var property;
var value4;
var property2;
var property3;
var property4;
var push;
var object;
var value5;
const object2 = {};
const Object = global.Object;
const value = Object.entries(this.keyMap);
let length = value.length;
const value2 = 0;
if (value2 < length) {
r2 = value2;
while (true) {
property = value[r2];
value4 = env1_5(property, 2);
property = value4[value2];
property2 = value4[1];
property3 = object2[property2];
r1 = property3 ?? [];
object2[property2] = r1;
property4 = object2[property2];
push = property4.push;
object = {keyCode: property2, key: property};
object.code = this.findCodeFromKeyboardLayoutMap(property, true);
Reflect.apply(push, property4, [object]);
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value.length;
if (value5 < length) {
r2 = value5;
continue;
}
break;
}
}
return object2;
}
function value_94981() { // fn#94981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:4652, offset: 0x0212deba, size: 88 bytes, params: 1, frame: 15
let value = environment.__proto__;
value = getKeyboardLayoutMap();
const Map = global.Map;
const Array = global.Array;
value = Array.from(value.entries());
const value2 = Object.create(Map.prototype, {constructor: {value: Map}});
const map = new Map(value);
this._internalKeyLayoutMap = map instanceof Object ? map : value2;
this._setCachedKeyLayoutMapEntries();
}
function value_94982(a0) { // fn#94982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:4819, offset: 0x0212df12, size: 71 bytes, params: 2, frame: 12
const env0_0 = a0;
if (a0.keyCode == null) {
return false;
}
const property = this.keyCodeMap[a0.keyCode];
return property != null && property.some(_fun94983);
function _fun94983(a0) { // fn#94983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:4916, offset: 0x0212df59, size: 70 bytes, params: 2, frame: 5
return a0.key === env0_0.key && a0.code === env0_0.code && a0.keyCode === env0_0.keyCode;
}
}
function value_94984(a0) { // fn#94984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:4999, offset: 0x0212df9f, size: 361 bytes, params: 2, frame: 25
var property;
var keyCode;
var binding;
var keyCodeMap;
const normalizedEvent = getNormalizedEvent(a0);
let _internalKeyLayoutMap = this._internalKeyLayoutMap;
if (_internalKeyLayoutMap == null) {
this._initializeInternalLayoutMap();
}
if (!this._hasExactMatch(normalizedEvent)) {
if (normalizedEvent.key != null && normalizedEvent.key !== 'dead') {
if (this.keyMap[normalizedEvent.key] == null) {
this.keyMap[normalizedEvent.key] = normalizedEvent.keyCode;
} else if (this.keyMap[normalizedEvent.key] !== normalizedEvent.keyCode && DeveloperOptionsStore.logKeyboardMismatches) {
binding = env1_10;
binding.error('KeyboardMapper - Key code mismatch for key ' + normalizedEvent.key + ': ' + this.keyMap[normalizedEvent.key] + ' !== ' + normalizedEvent.keyCode);
}
keyCodeMap = this.keyCodeMap;
keyCode = normalizedEvent.keyCode;
property = this.keyCodeMap[normalizedEvent.keyCode];
keyCodeMap[keyCode] = property ?? [];
keyCodeMap = this.keyCodeMap;
keyCode = normalizedEvent.keyCode;
property = keyCodeMap[keyCode];
property.push(normalizedEvent);
_internalKeyLayoutMap = this._internalKeyLayoutMap;
if (_internalKeyLayoutMap != null) {
_internalKeyLayoutMap.set(normalizedEvent.code, normalizedEvent.key);
}
this.updateCaches();
}
}
}
function value_94987() { // fn#94987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:5962, offset: 0x0212e18b, size: 57 bytes, params: 1, frame: 14
const keyMap = this.keyMap;
const Storage = (StorageModule).Storage;
Storage.set(env1_15, keyMap);
}
function value_94988() { // fn#94988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6070, offset: 0x0212e1c4, size: 38 bytes, params: 1, frame: 10
var r0;
var value;
if (this._internalKeyLayoutMap == null) {
value = environment.__proto__;
value = getKeyboardLayoutMap();
r0 = value;
} else {
r0 = this._internalKeyLayoutMap;
}
return r0;
}
function value_94990(a0) { // fn#94990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6276, offset: 0x0212e1fc, size: 133 bytes, params: 2, frame: 16
var environment;
var r4;
var Array;
var from;
var value5;
var keyboardLayoutMap;
const value = a0;
const value2 = a1;
const value3 = undefined;
const r3 = value2 !== value3 ? value2 : false;
if (r3) {
Array = global.Array;
from = Array.from;
value5 = environment.__proto__;
keyboardLayoutMap = getKeyboardLayoutMap();
r4 = Reflect.apply(from, Array, [keyboardLayoutMap.entries()]);
} else {
r4 = this.cachedKeyLayoutMapEntries;
}
const env0_0 = normalizeKey(value);
const value9 = r4.find(_fun94991);
return (value9 == null ? value3 : value9[0]) ?? value;
function _fun94991(a0) { // fn#94991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6425, offset: 0x010181f2, size: 68 bytes, params: 2, frame: 6
var r0;
var r1;
var r2;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
if (value2) {
r0 = item2;
r1 = value;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r2 = value3;
} else {
r0 = item3;
r1 = item;
r2 = value3;
}
}
if (!r2) {
r0.return();
}
return r1 === env0_0;
}
}
}
function _fun94992(a0) { // fn#94992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6483, offset: 0x0212e281, size: 203 bytes, params: 2, frame: 16
const KeyboardMapper2 = KeyboardMapper;
Inherits(KeyboardMapper2, a0);
return CreateClass(KeyboardMapper2, [{key: 'getKeyString', value: function(a0, a1) {
var r2;
var env0_0 = this;
var env0_1 = a0;
var env0_2 = a1;
var value = this.getKeyCodeMapItem(a0);
if (value.length !== 0) {
r2 = value;
} else {
value = this.cachedKeyMapEntries.filter(_fun94995);
value = value.map(_fun94996);
r2 = value;
}
return r2.find(_fun94997)?.key;
}}, {key: 'findExactKeyboardEventMatch', value: value_94998}, {key: 'getWeightedPossibleKeyStringMatches',
value: function(a0, a1, a2) {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
return this.cachedAllEvents.filter(_fun95002).sort(_fun95003);
}}, {key: 'findKeyboardEventByKey', value: value_95005}, {key: 'findKeyboardEventByKeyCode', value: value_95007},
{key: 'getDefaultKeyboardEventShape', value: value_95009}]);
function KeyboardMapper() { // fn#94993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6495, offset: 0x0212e34c, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_7(this, KeyboardMapper);
const value3 = env1_3(KeyboardMapper);
return env1_2(this, _isNativeReflectConstruct_94934() ? global.Reflect.construct(value3, arguments,
env1_3(this).constructor) : value3.apply(this, arguments));
}
function value_94994(a0, a1) { // fn#94994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6785, offset: 0x0212e3bd, size: 121 bytes, params: 3, frame: 13
var r2;
const env0_1 = a0;
const env0_2 = a1;
let value = this.getKeyCodeMapItem(a0);
if (value.length !== 0) {
r2 = value;
} else {
value = this.cachedKeyMapEntries.filter(function(a0) {
var r0;
var r1;
var r2;
var item3;
var value3;
var iterator = a0[Symbol.iterator]();
var iterator2 = iterator.next;
var item2 = Reflect.apply(iterator2, iterator, []);
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
if (value2) {
r0 = value;
r1 = item2;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = value;
r1 = item3;
r2 = value3;
} else {
r0 = item;
r1 = item3;
r2 = value3;
}
}
if (!r2) {
r1.return();
}
return r0 == r0;
});
value = value.map(_fun94996);
r2 = value;
}
return r2.find(_fun94997)?.key;
function _fun94996(a0) { // fn#94996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6911, offset: 0x0212e473, size: 114 bytes, params: 2, frame: 15
var r0;
var r1;
var r2;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r4 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r2 = value3;
} else {
r0 = item3;
r1 = item;
r2 = value3;
}
}
if (!r2) {
r0.return();
}
const object = {key: r4, keyCode: r1};
object.code = require ?? env0_0.findCodeFromKeyboardLayoutMap(r4);
return object;
}
function _fun94997(a0) { // fn#94997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7013, offset: 0x0212e4e5, size: 57 bytes, params: 2, frame: 6
const value2 = a0.keyCode === env0_1;
return require == null ? value2 : value2 && a0.code === require;
}
}
function value_94998(a0, a1, a2) { // fn#94998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7128, offset: 0x0212e51e, size: 142 bytes, params: 4, frame: 17
let value = a1;
const env0_1 = a2;
const r5 = value ?? this.findCodeFromKeyboardLayoutMap(normalizeKey(a0));
if (a2 == null) {
if (a2 == null) {
return undefined;
}
if (r5 != null) {
return this.cachedAllEvents.find(_fun95000);
}
} else {
var property = this.keyCodeMap[a2];
if (property == null) {
if (a2 == null) {
return undefined;
}
if (r5 != null) {
return this.cachedAllEvents.find(_fun95000);
}
return undefined;
}
value = property.find(_fun94999);
if (value != null) {
return value;
}
if (a2 == null) {
return undefined;
}
if (r5 != null) {
return this.cachedAllEvents.find(_fun95000);
}
}
function _fun94999(a0) { // fn#94999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7280, offset: 0x0212e5ac, size: 51 bytes, params: 2, frame: 12
let value = environment.__proto__.__proto__;
value = normalizeKey(a0.key);
value = value === PossibleConstructorReturn;
return value && a0.code === require;
}
function _fun95000({key, keyCode, code}) { // fn#95000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7396, offset: 0x0212e5df, size: 74 bytes, params: 2, frame: 13
let value = environment.__proto__.__proto__;
value = normalizeKey(key);
value = value === PossibleConstructorReturn;
return keyCode === importDefault && value && code === require;
}
}
function value_95001(a0, a1, a2) { // fn#95001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7528, offset: 0x0212e629, size: 69 bytes, params: 4, frame: 12
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return this.cachedAllEvents.filter(_fun95002).sort(function(a0, a1) {
var closure = _fun95004;
return closure(a1) - closure(a0);
});
function _fun95002(a0) { // fn#95002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7580, offset: 0x0212e66e, size: 103 bytes, params: 2, frame: 15
let value = environment.__proto__.__proto__;
const normalizeKeyBinding = normalizeKey;
value = normalizeKeyBinding(a0.key);
value = value === normalizeKeyBinding(env0_0);
let r0 = importDefault == null || a0.keyCode === importDefault;
r0 = r0 && value && (require == null || a0.code === require);
return r0;
}
function _fun95003(a0, a1) { // fn#95003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7699, offset: 0x0212e6d5, size: 33 bytes, params: 3, frame: 12
const calculateScore_950042 = calculateScore_95004;
return calculateScore_950042(a1) - calculateScore_950042(a0);
function calculateScore_95004(a0) { // fn#95004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7726, offset: 0x0212e6f6, size: 143 bytes, params: 2, frame: 15
const value = environment.__proto__.__proto__.__proto__;
const normalizeKeyBinding = normalizeKey;
const r5 = normalizeKeyBinding(a0.key) !== normalizeKeyBinding(env1_0) ? 0 : 0.5;
const r2 = require != null && a0.code === require ? r5 + 0.3 : r5;
return importDefault != null && a0.keyCode === importDefault ? r2 + 0.2 : r2;
}
}
}
function value_95005(a0, a1, a2) { // fn#95005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:7944, offset: 0x0212e785, size: 138 bytes, params: 4, frame: 20
let value = a1;
const r6 = value ?? this.findCodeFromKeyboardLayoutMap(normalizeKey(a0));
if (a2 != null) {
var property = this.keyCodeMap[a2];
if (property == null) {
value = this.getWeightedPossibleKeyStringMatches(a0, r6, a2);
value = env1_5(value, 1);
return value[0];
}
value = property.find(_fun95006);
if (value != null) {
return value;
}
}
value = this.getWeightedPossibleKeyStringMatches(a0, r6, a2);
value = env1_5(value, 1);
return value[0];
function _fun95006(a0) { // fn#95006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:8096, offset: 0x0212e80f, size: 51 bytes, params: 2, frame: 12
let value = environment.__proto__.__proto__;
value = normalizeKey(a0.key);
value = value === env0_1;
return value && a0.code === require;
}
}
function value_95007(a0, a1) { // fn#95007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:8271, offset: 0x0212e842, size: 155 bytes, params: 3, frame: 18
var r1;
const env0_0 = a0;
const env0_1 = a1;
let value = this.getKeyString(a0, a1);
if (value == null && a1 != null) {
value = this.getLayoutMap();
value = value.get(a1);
r1 = value;
} else {
r1 = value;
}
if (r1 == null) {
value = this.getKeyCodeMapItem(a0);
value = value.find(_fun95008);
r1 = value?.key;
}
return r1 == null ? this.getDefaultKeyboardEventShape(undefined, a0, a1) : this.findKeyboardEventByKey(r1, a1, a0);
function _fun95008(a0) { // fn#95008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:8420, offset: 0x0212e8dd, size: 57 bytes, params: 2, frame: 6
const value2 = a0.keyCode === env0_0;
return require == null ? value2 : value2 && a0.code === require;
}
}
function value_95009(a0, a1, a2) { // fn#95009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:8633, offset: 0x0212e916, size: 205 bytes, params: 4, frame: 18
var environment;
var r9;
var value5;
var property;
var value6;
var getNormalizedEventBinding;
var object;
var value7;
const value = a2;
const env0_0 = a1;
const value2 = undefined;
const r5 = a0 != null ? normalizeKey(a0) : value2;
if (r5 != null) {
property = this.keyMap[r5];
if (property == null) {
return value2;
}
value7 = environment.__proto__;
getNormalizedEventBinding = getNormalizedEvent;
object = {keyCode: property, key: r5};
object.code = value ?? this.findCodeFromKeyboardLayoutMap(r5);
return getNormalizedEventBinding(object);
}
if (a1 != null) {
value5 = this.cachedKeyMapEntries.find(_fun95010);
r9 = value5 == null ? value2 : value5[0];
if (r9 == null) {
return value2;
}
value6 = environment.__proto__;
getNormalizedEventBinding = getNormalizedEvent;
object = {keyCode: a1, key: r9};
object.code = value ?? this.findCodeFromKeyboardLayoutMap(r9);
return getNormalizedEventBinding(object);
}
return value2;
function _fun95010(a0) { // fn#95010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:8895, offset: 0x010181f2, size: 68 bytes, params: 2, frame: 6
var r0;
var r1;
var r2;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
if (value2) {
r0 = item2;
r1 = value;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r2 = value3;
} else {
r0 = item3;
r1 = item;
r2 = value3;
}
}
if (!r2) {
r0.return();
}
return r1 === require;
}
}
}
function __DEV_overrideLayoutMapKey(a0, a1) { // fn#95011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:10312, offset: 0x0212e9e3, size: 67 bytes, params: 3, frame: 14
let binding = env0_14;
binding._set(a0, a1);
binding = env0_17;
if (binding != null) {
binding._initializeInternalLayoutMap();
}
binding = env0_17;
if (binding != null) {
binding.updateCaches();
}
}
function getLayoutMap() { // fn#95013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:10610, offset: 0x0212ea26, size: 70 bytes, params: 1, frame: 13
var keyboardMapper;
const value = a0;
const value2 = undefined;
let r0 = value !== value2 ? value : false;
if (r0) {
r0 = getKeyboardLayoutMap();
} else {
keyboardMapper = getKeyboardMapper();
r0 = keyboardMapper == null ? value2 : keyboardMapper.getLayoutMap();
r0 = r0 ?? getKeyboardLayoutMap();
}
return r0;
}
function getKeyboardEventShapeFromAny(a0) { // fn#95014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:10924, offset: 0x0212ea6c, size: 133 bytes, params: 2, frame: 18
var keyCode;
var findKeyboardEventByKeyCode;
var value;
const exactKeyboardEventMatchFromAny = getExactKeyboardEventMatchFromAny(a0);
if (exactKeyboardEventMatchFromAny != null) {
return exactKeyboardEventMatchFromAny;
}
const keyboardMapper = getKeyboardMapper();
if (keyboardMapper == null) {
return null;
}
if (getNormalizedEvent(a0).key == null) {
keyCode = value.keyCode;
if (keyCode == null) {
return null;
}
findKeyboardEventByKeyCode = keyboardMapper.findKeyboardEventByKeyCode;
keyCode = value.keyCode;
value = Reflect.apply(findKeyboardEventByKeyCode, keyboardMapper, [keyCode, value.code]);
} else {
var keyboardEventByKey = keyboardMapper.findKeyboardEventByKey(value.key, value.code, value.keyCode);
if (keyboardEventByKey != null) {
return keyboardEventByKey;
}
if (value.keyCode == null) {
return null;
}
value = keyboardMapper.findKeyboardEventByKeyCode(value.keyCode, value.code);
}
return value ?? null;
}
function getKeyboardEventShapeFromKey(a0) { // fn#95015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:11334, offset: 0x0212eaf1, size: 264 bytes, params: 2, frame: 23
var keyboardMapperBinding;
var value9;
var getDefaultKeyboardEventShape;
var value10;
var value11;
var value12;
var KeyboardEvent;
var prototype;
var keyboardEvent;
var value14;
var getNormalizedEventBinding;
var object;
var keyCode;
var key;
var code;
var error;
let value = undefined;
const value2 = null;
const r1 = value2 != a0 ? normalizeKey(a0) : value;
if (value2 == r1) {
return value2;
}
const value6 = reverseLookupCodeFromKey(r1);
const keyboardMapper = getKeyboardMapper();
let r5 = value2 == keyboardMapper ? value : keyboardMapper.findKeyboardEventByKey(r1, value6);
const r12 = value2 != r5 ? r5 : value2;
if (value2 != r12) {
return r12;
}
try {
getKeyboardMapperBinding = getKeyboardMapper;
} catch (error) {
return value2;
}
try {
keyboardMapperBinding = getKeyboardMapperBinding();
} catch (error) {
return value2;
}
try {
value9 = value2 == keyboardMapperBinding;
} catch (error) {
return value2;
}
if (value9) {
r5 = value;
} else {
try {
getDefaultKeyboardEventShape = keyboardMapperBinding.getDefaultKeyboardEventShape;
} catch (error) {
return value2;
}
try {
value10 = Reflect.apply(getDefaultKeyboardEventShape, keyboardMapperBinding, [r1, value, value6]);
} catch (error) {
return value2;
}
r5 = value10;
}
try {
value11 = value2 != r5;
} catch (error) {
return value2;
}
r5 = !value11 ? value2 : r5;
try {
value12 = value2 == r5;
} catch (error) {
return value2;
}
if (value12) {
return value2;
}
try {
KeyboardEvent = global.KeyboardEvent;
} catch (error) {
return value2;
}
try {
prototype = KeyboardEvent.prototype;
} catch (error) {
return value2;
}
try {
} catch (error) {
return value2;
}
try {
keyboardEvent = new KeyboardEvent('keydown');
} catch (error) {
return value2;
}
try {
value14 = keyboardEvent instanceof Object ? keyboardEvent : undefined;
} catch (error) {
return value2;
}
try {
getNormalizedEventBinding = getNormalizedEvent;
} catch (error) {
return value2;
}
try {
object = {};
} catch (error) {
return value2;
}
try {
keyCode = value14.keyCode;
} catch (error) {
return value2;
}
try {
object.keyCode = keyCode;
} catch (error) {
return value2;
}
try {
key = value14.key;
} catch (error) {
return value2;
}
try {
object.key = key;
} catch (error) {
return value2;
}
try {
code = value14.code;
} catch (error) {
return value2;
}
try {
object.code = code;
} catch (error) {
return value2;
}
try {
value = getNormalizedEventBinding(object);
} catch (error) {
return value2;
}
return value;
}
function getKeyboardEventShapeFromKeycode(a0) { // fn#95016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:11878, offset: 0x0212ebf9, size: 210 bytes, params: 2, frame: 20
var keyboardMapperBinding;
var value6;
var getDefaultKeyboardEventShape;
var value7;
var value8;
var value9;
var KeyboardEvent;
var prototype;
var keyboardEvent;
var value11;
var getNormalizedEventBinding;
var object;
var keyCode;
var key;
var code;
var error;
let value = undefined;
const keyboardMapper = getKeyboardMapper();
const value4 = null;
let r5 = value4 == keyboardMapper ? value : keyboardMapper.findKeyboardEventByKeyCode(a0);
const r0 = value4 != r5 ? r5 : value4;
if (value4 != r0) {
return r0;
}
try {
getKeyboardMapperBinding = getKeyboardMapper;
} catch (error) {
return value4;
}
try {
keyboardMapperBinding = getKeyboardMapperBinding();
} catch (error) {
return value4;
}
try {
value6 = value4 == keyboardMapperBinding;
} catch (error) {
return value4;
}
if (value6) {
r5 = value;
} else {
try {
getDefaultKeyboardEventShape = keyboardMapperBinding.getDefaultKeyboardEventShape;
} catch (error) {
return value4;
}
try {
value7 = Reflect.apply(getDefaultKeyboardEventShape, keyboardMapperBinding, [value, a0]);
} catch (error) {
return value4;
}
r5 = value7;
}
try {
value8 = value4 != r5;
} catch (error) {
return value4;
}
r5 = !value8 ? value4 : r5;
try {
value9 = value4 == r5;
} catch (error) {
return value4;
}
if (value9) {
return value4;
}
try {
KeyboardEvent = global.KeyboardEvent;
} catch (error) {
return value4;
}
try {
prototype = KeyboardEvent.prototype;
} catch (error) {
return value4;
}
try {
} catch (error) {
return value4;
}
try {
keyboardEvent = new KeyboardEvent('keydown');
} catch (error) {
return value4;
}
try {
value11 = keyboardEvent instanceof Object ? keyboardEvent : undefined;
} catch (error) {
return value4;
}
try {
getNormalizedEventBinding = getNormalizedEvent;
} catch (error) {
return value4;
}
try {
object = {};
} catch (error) {
return value4;
}
try {
keyCode = value11.keyCode;
} catch (error) {
return value4;
}
try {
object.keyCode = keyCode;
} catch (error) {
return value4;
}
try {
key = value11.key;
} catch (error) {
return value4;
}
try {
object.key = key;
} catch (error) {
return value4;
}
try {
code = value11.code;
} catch (error) {
return value4;
}
try {
object.code = code;
} catch (error) {
return value4;
}
try {
value = getNormalizedEventBinding(object);
} catch (error) {
return value4;
}
return value;
}
}
function _fun94971(a0) { // fn#94971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:3277, offset: 0x0212dca5, size: 90 bytes, params: 2, frame: 16
var r0;
var r1;
var r4;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r2 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value;
r4 = value3;
} else {
r0 = item3;
r1 = item;
r4 = value3;
}
}
if (!r4) {
r0.return();
}
const Number = global.Number;
return [Number(r2), r1];
}
function _fun94972(a0) { // fn#94972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:3363, offset: 0x010997bf, size: 57 bytes, params: 2, frame: 6
var r0;
var r1;
var r2;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
if (value2) {
r0 = value;
r1 = item2;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = value;
r1 = item3;
r2 = value3;
} else {
r0 = item;
r1 = item3;
r2 = value3;
}
}
if (!r2) {
r1.return();
}
return r0;
}
function _fun94995(a0) { // fn#94995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12670:6890, offset: 0x0212e436, size: 61 bytes, params: 2, frame: 6
var r0;
var r1;
var r2;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
if (value2) {
r0 = value;
r1 = item2;
r2 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = value;
r1 = item3;
r2 = value3;
} else {
r0 = item;
r1 = item3;
r2 = value3;
}
}
if (!r2) {
r1.return();
}
return r0 == r0;
}
global.__d(_fun94933, 12480, [15, 17, 18, 57, 5, 6, 7, 691, 5047, 3, 477, 12479, 587,
2]) /* metro module 12480, dependencies: [15, 17, 18, 57, 5, 6, 7, 691, 5047, 3, 477, 12479, 587, 2] */;