Files
discord-decomp/_bundle/getNativeComponentAttributes.js
T
2026-11-01 12:12:55 +02:00

327 lines
11 KiB
JavaScript

// Metro module 67 (f68).
import * as _Module68 from "./Module68";
import * as _Module26 from "./Module26";
import * as _nullthrows from "./nullthrows";
import * as _matricesDiffer from "./matricesDiffer";
import * as _pointsDiffer from "./pointsDiffer";
import * as _sizesDiffer from "./sizesDiffer";
import * as _insetsDiffer from "./insetsDiffer";
import * as _processColor from "./processColor";
import * as _processColorArray from "./processColorArray";
import * as _resolveAssetSource from "./resolveAssetSource";
import processBoxShadow from "./processBoxShadow";
import * as _processFilter from "./processFilter";
import * as _processBackgroundImage from "./processBackgroundImage";
import * as _processBackgroundPosition from "./processBackgroundPosition";
import * as _processBackgroundRepeat from "./processBackgroundRepeat";
import * as _processBackgroundSize from "./processBackgroundSize";
const merge = function merge(a0, a1) {
if (a1) {
if (a0) {
for (const key in a1) {
if (a1.hasOwnProperty(key)) {
const r15 = a1[key];
const hasOwnProperty = a0.hasOwnProperty(key);
let r18 = r15;
if (hasOwnProperty) {
const r14 = a0[key];
r18 = (typeof r15 === "object" ? typeof r14 === "object" : typeof r15 === "object") ? merge(r14, r15) : r15;
}
a0[key] = r18;
}
}
return a0;
}
return a1;
}
return a0;
};
export default function getNativeComponentAttributes(a0) {
let r77, r78, default2, process;
const viewManagerConfig2 = _Module68.default.getViewManagerConfig(a0);
if (viewManagerConfig2 == null) {
return null;
}
let baseModuleName = viewManagerConfig2.baseModuleName;
let bubblingEventTypes = viewManagerConfig2.bubblingEventTypes;
let directEventTypes = viewManagerConfig2.directEventTypes;
const NativeProps = viewManagerConfig2.NativeProps;
if (bubblingEventTypes == null) {
bubblingEventTypes = {};
}
if (directEventTypes == null) {
directEventTypes = {};
}
let r11 = directEventTypes;
let r12 = NativeProps;
let r40 = bubblingEventTypes;
let r24 = r12;
let directEventTypes3 = r11;
let bubblingEventTypes3 = r40;
while (baseModuleName) {
const viewManagerConfig = _Module68.default.getViewManagerConfig(baseModuleName);
const r27 = r12;
const r26 = r11;
const r25 = r40;
let r21 = r27;
let r20 = r26;
let r48 = r25;
let r49 = null;
if (viewManagerConfig) {
const r23 = {
...viewManagerConfig.bubblingEventTypes,
...r25
};
const r53 = {
...viewManagerConfig.directEventTypes,
...r26
};
const r60 = {
...viewManagerConfig.NativeProps,
...r27
};
r49 = viewManagerConfig.baseModuleName;
r21 = r60;
r20 = r53;
r48 = r23;
}
r12 = r21;
r11 = r20;
r40 = r48;
baseModuleName = r49;
r24 = r12;
directEventTypes3 = r11;
bubblingEventTypes3 = r40;
}
const validAttributes = {};
for (const key in r24) {
L21: {
r77 = key;
r78 = r24[r77];
if (r78 === "CATransform3D") {
default2 = _matricesDiffer.default;
} else {
if (r78 !== "CGPoint" && r78 !== "Point") {
if (r78 === "CGSize") {
default2 = _sizesDiffer.default;
break L21;
}
if (r78 !== "UIEdgeInsets") {
default2 = null;
if (r78 !== "EdgeInsets") {
break L21;
}
}
default2 = _insetsDiffer.default;
break L21;
}
default2 = _pointsDiffer.default;
}
}
L31: {
process = null;
switch (r78) {
case "CGColor":
case "UIColor":
case "Color":
process = _processColor.default;
break L31;
case "CGColorArray":
case "UIColorArray":
case "ColorArray":
process = _processColorArray.default;
break L31;
case "CGImage":
case "UIImage":
case "RCTImageSource":
case "ImageSource":
process = _resolveAssetSource.default;
break L31;
case "BoxShadowArray":
case "BoxShadow":
process = processBoxShadow;
break L31;
case "FilterArray":
case "Filter":
process = _processFilter.default;
break L31;
case "BackgroundImage":
process = _processBackgroundImage.default;
break L31;
case "BackgroundPosition":
process = _processBackgroundPosition.default;
break L31;
case "BackgroundRepeat":
process = _processBackgroundRepeat.default;
break L31;
case "BackgroundSize":
process = _processBackgroundSize.default;
break L31;
default:
}
}
validAttributes[r77] = default2 == null ? process == null || {
process
} : process == null ? {
diff: default2
} : {
diff: default2,
process
};
}
validAttributes.style = _Module26.default;
Object.assign(viewManagerConfig2, {
uiViewClassName: a0,
validAttributes,
bubblingEventTypes: bubblingEventTypes3,
directEventTypes: directEventTypes3
});
const constants = _Module68.default.getConstants();
if (!constants.ViewManagerNames && !constants.LazyViewManagersEnabled) {
const bubblingEventTypes2 = viewManagerConfig2.bubblingEventTypes;
const genericBubblingEventTypes = constants.genericBubblingEventTypes;
let bubblingEventTypes4 = bubblingEventTypes2;
if (genericBubblingEventTypes) {
bubblingEventTypes4 = genericBubblingEventTypes;
if (bubblingEventTypes2) {
bubblingEventTypes4 = bubblingEventTypes2;
for (const key2 in genericBubblingEventTypes) {
bubblingEventTypes4 = bubblingEventTypes2;
if (genericBubblingEventTypes.hasOwnProperty(key2)) {
const r163 = genericBubblingEventTypes[key2];
const hasOwnProperty2 = bubblingEventTypes2.hasOwnProperty(key2);
let r166 = r163;
if (hasOwnProperty2) {
const r167 = bubblingEventTypes2[key2];
const r5 = typeof r163 === "object" ? typeof r167 === "object" : typeof r163 === "object";
r166 = r163;
if (r5) {
let r168 = r167;
if (r163) {
r168 = r163;
if (r167) {
r168 = r167;
for (const key3 in r163) {
r168 = r167;
if (r163.hasOwnProperty(key3)) {
const r32 = r163[key3];
const hasOwnProperty = r167.hasOwnProperty(key3);
let r176 = r32;
if (hasOwnProperty) {
const r31 = r167[key3];
r176 = (typeof r32 === "object" ? typeof r31 === "object" : typeof r32 === "object") ? merge(r31, r32) : r32;
}
r167[key3] = r176;
}
}
r168 = r167;
}
}
r166 = r168;
}
}
bubblingEventTypes2[key2] = r166;
}
}
bubblingEventTypes4 = bubblingEventTypes2;
}
}
viewManagerConfig2.bubblingEventTypes = bubblingEventTypes4;
const directEventTypes2 = viewManagerConfig2.directEventTypes;
const genericDirectEventTypes = constants.genericDirectEventTypes;
let directEventTypes4 = directEventTypes2;
if (genericDirectEventTypes) {
directEventTypes4 = genericDirectEventTypes;
if (directEventTypes2) {
directEventTypes4 = directEventTypes2;
for (const key4 in genericDirectEventTypes) {
directEventTypes4 = directEventTypes2;
const r188 = key4;
if (genericDirectEventTypes.hasOwnProperty(r188)) {
const r191 = genericDirectEventTypes[r188];
const hasOwnProperty3 = directEventTypes2.hasOwnProperty(r188);
let r194 = r191;
if (hasOwnProperty3) {
const r195 = directEventTypes2[r188];
const r196 = typeof r191 === "object" ? typeof r195 === "object" : typeof r191 === "object";
r194 = r191;
if (r196) {
let r197 = r195;
if (r191) {
r197 = r191;
if (r195) {
r197 = r195;
for (const key5 in r191) {
r197 = r195;
const r203 = key5;
if (r191.hasOwnProperty(r203)) {
const r206 = r191[r203];
const hasOwnProperty4 = r195.hasOwnProperty(r203);
let r209 = r206;
if (hasOwnProperty4) {
const r210 = r195[r203];
r209 = (typeof r206 === "object" ? typeof r210 === "object" : typeof r206 === "object") ? merge(r210, r206) : r206;
}
r195[r203] = r209;
}
}
r197 = r195;
}
}
r194 = r197;
}
}
directEventTypes2[r188] = r194;
}
}
directEventTypes4 = directEventTypes2;
}
}
viewManagerConfig2.directEventTypes = directEventTypes4;
} else {
const r220 = _nullthrows(_Module68.default.getDefaultEventTypes)();
if (r220 && viewManagerConfig2) {
for (const key6 in r220) {
const r227 = key6;
if (r220.hasOwnProperty(r227)) {
const r230 = r220[r227];
const hasOwnProperty5 = viewManagerConfig2.hasOwnProperty(r227);
let r233 = r230;
if (hasOwnProperty5) {
const r234 = viewManagerConfig2[r227];
const r235 = typeof r230 === "object" ? typeof r234 === "object" : typeof r230 === "object";
r233 = r230;
if (r235) {
let r236 = r234;
if (r230) {
r236 = r230;
if (r234) {
r236 = r234;
for (const key7 in r230) {
r236 = r234;
const r242 = key7;
if (r230.hasOwnProperty(r242)) {
const r245 = r230[r242];
const hasOwnProperty6 = r234.hasOwnProperty(r242);
let r248 = r245;
if (hasOwnProperty6) {
const r249 = r234[r242];
r248 = (typeof r245 === "object" ? typeof r249 === "object" : typeof r245 === "object") ? merge(r249, r245) : r245;
}
r234[r242] = r248;
}
}
r236 = r234;
}
}
r233 = r236;
}
}
viewManagerConfig2[r227] = r233;
}
}
}
}
return viewManagerConfig2;
};