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

125 lines
4.7 KiB
JavaScript

// Metro module 1752 (f1753).
import * as _Module1631 from "./Module1631";
import * as _Module1617 from "./Module1617";
function $mk70125() {
return (a0, a1) => a0 + a1.__workletHash.toString();
}
const isAnimated = function isAnimated(a0) {
return Array.isArray(a0) ? a0.some(isAnimated) : (typeof a0 === "object" ? a0 !== null : typeof a0 === "object") && (a0.onFrame !== void 0 || Object.values(a0).some(isAnimated));
};
isAnimated.__closure = {};
isAnimated.__workletHash = 4296700641760;
isAnimated.__initData = {
code: "function isAnimated_Pnpm_utilsTs1(prop){const isAnimated_Pnpm_utilsTs1=this._recur;if(Array.isArray(prop)){return prop.some(isAnimated_Pnpm_utilsTs1);}else if(typeof prop==='object'&&prop!==null){if(prop.onFrame!==undefined){return true;}else{return Object.values(prop).some(isAnimated_Pnpm_utilsTs1);}}return false;}"
};
export function shallowEqual(a0, a1) {
const r9 = Object.keys(a0);
if (r9.length !== Object.keys(a1).length) {
return false;
}
const length = r9.length;
let r0 = 0;
if (0 < length) {
do {
const r17 = a0[r9[r0]];
const r19 = a1[r9[r0]];
const r1 = r0;
if (r17 !== r19) {
return false;
}
r0 = r1 + 1;
} while (r0 < r9.length);
}
return true;
}
shallowEqual.__closure = {};
shallowEqual.__workletHash = 6945711106539;
shallowEqual.__initData = {
code: "function shallowEqual_Pnpm_utilsTs2(a,b){const aKeys=Object.keys(a);const bKeys=Object.keys(b);if(aKeys.length!==bKeys.length){return false;}for(let i=0;i<aKeys.length;i++){if(a[aKeys[i]]!==b[aKeys[i]]){return false;}}return true;}"
};
export function validateAnimatedStyles(a0) {
if (typeof a0 !== "object") {
throw new _Module1617.ReanimatedError(`\`useAnimatedStyle\` has to return an object, found ${typeof a0} instead.`);
}
if (Array.isArray(a0)) {
throw new _Module1617.ReanimatedError("`useAnimatedStyle` has to return an object and cannot return static styles combined with dynamic ones. Please do merging where a component receives props.");
}
}
validateAnimatedStyles.__closure = {};
validateAnimatedStyles.__workletHash = 9250446401049;
validateAnimatedStyles.__initData = {
code: "function validateAnimatedStyles_Pnpm_utilsTs3(styles){if(typeof styles!=='object'){throw new ReanimatedError(\"`useAnimatedStyle` has to return an object, found \"+typeof styles+\" instead.\");}else if(Array.isArray(styles)){throw new ReanimatedError('`useAnimatedStyle` has to return an object and cannot return static styles combined with dynamic ones. Please do merging where a component receives props.');}}"
};
export function buildWorkletsHash(a0) {
return Object.values(a0).reduce($mk70125(), "");
}
export function buildDependencies(a0, a1) {
const r6 = Object.values(a1).filter((item) => item !== void 0);
let r11 = r6;
if (a0) {
a0.push(Object.values(r6).reduce($mk70125(), ""));
r11 = a0;
}
return r11;
}
export function areDependenciesEqual(a0, a1) {
let r52;
const r10 = typeof Object.is === "function" ? Object.is : function is(a0, a1) {
return a0 === a1 && (a0 !== 0 || 1 / a0 === 1 / a1) || Number.isNaN(a0) && Number.isNaN(a1);
};
let r21 = false;
if (a0) {
r21 = false;
if (a1) {
const length2 = a1.length;
const length = a0.length;
r21 = false;
if (length2 === length) {
const length3 = a1.length;
let r0 = 0;
const r7 = 0 < length3;
r21 = true;
if (r7) {
do {
const r16 = a0[r0];
const r24 = a1[r0];
const r25 = r10(r16, r24);
const r1 = r0;
if (!r25) {
const isWorkletFunction = _Module1631.isWorkletFunction(r16);
r21 = false;
if (!isWorkletFunction) {
break;
}
const isWorkletFunction2 = _Module1631.isWorkletFunction(r24);
r21 = false;
if (!isWorkletFunction2) {
break;
}
let c13202_0 = r16;
let c13202_1 = r24;
const __workletHash = r16.__workletHash;
const __workletHash2 = r24.__workletHash;
let r36 = false;
if (__workletHash === __workletHash2) {
const r40 = Object.keys(r16.__closure);
r36 = r40.length === Object.keys(r24.__closure).length && r40.every((item) => item in c13202_1.__closure && c13202_0.__closure[item] === c13202_1.__closure[item]);
}
r21 = false;
if (!r36) {
break;
}
}
const r50 = r1 + 1;
r52 = r50 < a1.length;
r0 = r50;
r21 = true;
} while (r52);
}
}
}
}
return r21;
}
export { isAnimated };