Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
244 lines
7.1 KiB
TypeScript
244 lines
7.1 KiB
TypeScript
// Module ID: 4502
|
|
// Function ID: 4503
|
|
// Name: ChatInputUtils
|
|
// Dependencies: [4503, 1874, 4504, 1609, 1481, 4505, 2]
|
|
// Exports: createInputRefTracker, dismissKeyboard, getBestActiveInputForChannelId, getChatInputRef, getHighestActiveScreenIndex
|
|
|
|
// Module 4502 (ChatInputUtils)
|
|
import KeyboardTypes from "KeyboardTypes" /* 1609 */;
|
|
import KeyboardManagerUtils from "KeyboardManagerUtils" /* 1874 */;
|
|
import ScreenIndexFrozen from "ScreenIndexFrozen" /* 4503 */;
|
|
import useKeyboardType from "useKeyboardType" /* 4504 */;
|
|
import PortalKeyboardUIStore from "PortalKeyboardUIStore" /* 4505 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
function getBestActiveInput() {
|
|
let str;
|
|
if (0 !== map1.size) {
|
|
str = "voice-panel";
|
|
if (!obj.has("voice-panel")) {
|
|
str = "message-request";
|
|
if (!obj.has("message-request")) {
|
|
str = "new-message";
|
|
if (!obj.has("new-message")) {
|
|
const _Array = Array;
|
|
const found = Array.from(obj.keys()).filter((item) => {
|
|
let tmp = typeof item === "number";
|
|
if (typeof item === "number") {
|
|
tmp = !ScreenIndexFrozen.isScreenIndexFrozen(item);
|
|
}
|
|
return tmp;
|
|
});
|
|
if (0 !== found.length) {
|
|
const _Math = Math;
|
|
const items = [];
|
|
HermesBuiltin.arraySpread(found, 0);
|
|
const _Math2 = Math;
|
|
str = HermesBuiltin.apply(items, Math);
|
|
}
|
|
const arr = Array.from(obj.keys());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = undefined;
|
|
if (null != str) {
|
|
value = obj.get(str);
|
|
}
|
|
let current;
|
|
if (value != null) {
|
|
current = value.current;
|
|
}
|
|
return current;
|
|
}
|
|
const map = new Map();
|
|
const map1 = new Map();
|
|
let result = size.fileFinishedImporting("utils/native/ChatInputUtils.tsx");
|
|
|
|
export function createInputRefTracker(id, screenIndex) {
|
|
closure_0 = screenIndex;
|
|
let obj = { current: id };
|
|
return {
|
|
handleRef(current, id) {
|
|
obj.current = id;
|
|
if (null == current) {
|
|
if (null != obj) {
|
|
value = map.get(id);
|
|
if (null != value) {
|
|
value.delete(tmp16);
|
|
if (0 === value.size) {
|
|
map.delete(id);
|
|
}
|
|
map1.delete(tmp16);
|
|
}
|
|
obj = null;
|
|
}
|
|
} else if (null == obj) {
|
|
obj = { current };
|
|
value2 = map.get(id);
|
|
if (value2 == null) {
|
|
const _Map = Map;
|
|
value2 = new Map();
|
|
}
|
|
const result = value2.set(tmp2, obj);
|
|
const result1 = map.set(id, value2);
|
|
const result2 = map1.set(tmp2, obj);
|
|
const _process = process;
|
|
if ("development" === process.env.DEVELOPMENT) {
|
|
const hasItem = map1.has(tmp2);
|
|
}
|
|
} else {
|
|
obj.current = current;
|
|
}
|
|
},
|
|
register() {
|
|
if (null != obj) {
|
|
const current2 = obj.current;
|
|
value = map.get(current2);
|
|
if (null != value) {
|
|
value.delete(tmp15);
|
|
if (0 === value.size) {
|
|
obj3.delete(current2);
|
|
}
|
|
map1.delete(tmp15);
|
|
}
|
|
const current = obj.current;
|
|
value2 = obj3.get(current);
|
|
if (value2 == null) {
|
|
const _Map = Map;
|
|
value2 = new Map();
|
|
}
|
|
const result = value2.set(tmp15, tmp5);
|
|
const result1 = obj3.set(current, value2);
|
|
const result2 = map1.set(tmp15, tmp5);
|
|
const _process = process;
|
|
if ("development" === process.env.DEVELOPMENT) {
|
|
const hasItem = obj2.has(tmp15);
|
|
}
|
|
obj2 = map1;
|
|
}
|
|
},
|
|
unregister() {
|
|
if (null != obj) {
|
|
const current = obj.current;
|
|
value = map.get(current);
|
|
if (null != value) {
|
|
value.delete(tmp2);
|
|
if (0 === value.size) {
|
|
obj.delete(current);
|
|
}
|
|
map1.delete(tmp2);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
}
|
|
export const getHighestActiveScreenIndex = function getHighestActiveScreenIndex() {
|
|
let obj = arg0;
|
|
if (arg0 === undefined) {
|
|
obj = map1;
|
|
}
|
|
if (0 !== obj.size) {
|
|
if (obj.has("voice-panel")) {
|
|
return "voice-panel";
|
|
} else if (obj.has("message-request")) {
|
|
return "message-request";
|
|
} else if (obj.has("new-message")) {
|
|
return "new-message";
|
|
} else {
|
|
const _Array = Array;
|
|
const found = Array.from(obj.keys()).filter((item) => {
|
|
let tmp = typeof item === "number";
|
|
if (typeof item === "number") {
|
|
tmp = !ScreenIndexFrozen.isScreenIndexFrozen(item);
|
|
}
|
|
return tmp;
|
|
});
|
|
if (0 !== found.length) {
|
|
const _Math = Math;
|
|
const items = [];
|
|
HermesBuiltin.arraySpread(found, 0);
|
|
const _Math2 = Math;
|
|
return HermesBuiltin.apply(items, Math);
|
|
}
|
|
const arr = Array.from(obj.keys());
|
|
}
|
|
}
|
|
};
|
|
export const getChatInputRef = function getChatInputRef(id, screenIndex) {
|
|
if (null != id) {
|
|
value = map.get(id);
|
|
let current;
|
|
if (value != null) {
|
|
value2 = value.get(screenIndex);
|
|
if (value2 != null) {
|
|
current = value2.current;
|
|
}
|
|
}
|
|
return current;
|
|
}
|
|
};
|
|
export const getBestActiveInputForChannelId = function getBestActiveInputForChannelId(id) {
|
|
if (null != id) {
|
|
value = map.get(id);
|
|
if (null != value) {
|
|
let obj2 = value;
|
|
if (value === undefined) {
|
|
obj2 = map1;
|
|
}
|
|
let str;
|
|
if (0 !== obj2.size) {
|
|
str = "voice-panel";
|
|
if (!obj2.has("voice-panel")) {
|
|
str = "message-request";
|
|
if (!obj2.has("message-request")) {
|
|
str = "new-message";
|
|
if (!obj2.has("new-message")) {
|
|
const _Array = Array;
|
|
const found = Array.from(obj2.keys()).filter((item) => {
|
|
let tmp = typeof item === "number";
|
|
if (typeof item === "number") {
|
|
tmp = !ScreenIndexFrozen.isScreenIndexFrozen(item);
|
|
}
|
|
return tmp;
|
|
});
|
|
if (0 !== found.length) {
|
|
const _Math = Math;
|
|
const items = [];
|
|
HermesBuiltin.arraySpread(found, 0);
|
|
const _Math2 = Math;
|
|
str = HermesBuiltin.apply(items, Math);
|
|
}
|
|
const arr = Array.from(obj2.keys());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value2 = undefined;
|
|
if (null != str) {
|
|
value2 = value.get(str);
|
|
}
|
|
let current;
|
|
if (value2 != null) {
|
|
current = value2.current;
|
|
}
|
|
return current;
|
|
}
|
|
}
|
|
};
|
|
export { getBestActiveInput };
|
|
export const dismissKeyboard = function dismissKeyboard() {
|
|
const result = KeyboardManagerUtils.dismissGlobalKeyboard();
|
|
const obj2 = getBestActiveInput();
|
|
if (null != obj2) {
|
|
obj2.closeCustomKeyboard();
|
|
}
|
|
const keyboardType = useKeyboardType.getKeyboardType();
|
|
if (keyboardType !== KeyboardTypes.KeyboardTypes.SYSTEM) {
|
|
const obj3 = { type: tmp(1609).KeyboardTypes.SYSTEM };
|
|
tmp(1481).setKeyboardType(obj3);
|
|
const tmpResult3 = tmp(1481);
|
|
}
|
|
const tmpResult = useKeyboardType;
|
|
const result1 = PortalKeyboardUIStore.closePortalKeyboardRequest();
|
|
};
|