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

111 lines
6.1 KiB
JavaScript

// Metro module 1686 (f1687).
import * as _recognizePrefixSuffix from "./recognizePrefixSuffix";
const __initData = {
code: "function pnpm_repeatTs2(){const{_nextAnimation,numberOfReps,reverse,callback,getReduceMotionForAnimation,reduceMotion}=this.__closure;const nextAnimation=typeof _nextAnimation==='function'?_nextAnimation():_nextAnimation;function repeat(animation,now){const finished=nextAnimation.onFrame(nextAnimation,now);animation.current=nextAnimation.current;if(finished){animation.reps+=1;if(nextAnimation.callback){nextAnimation.callback(true,animation.current);}if(animation.reduceMotion||numberOfReps>0&&animation.reps>=numberOfReps){return true;}const startValue=reverse?nextAnimation.current:animation.startValue;if(reverse){nextAnimation.toValue=animation.startValue;animation.startValue=startValue;}nextAnimation.onStart(nextAnimation,startValue,now,nextAnimation.previousAnimation);return false;}return false;}const repCallback=function(finished){if(callback){callback(finished);}if(!finished&&nextAnimation.callback){nextAnimation.callback(false);}};function onStart(animation,value,now,previousAnimation){animation.startValue=value;animation.reps=0;if(nextAnimation.reduceMotion===undefined){nextAnimation.reduceMotion=animation.reduceMotion;}if(animation.reduceMotion&&reverse&&(numberOfReps<=0||numberOfReps%2===0)){animation.current=animation.startValue;animation.onFrame=function(){return true;};}else{nextAnimation.onStart(nextAnimation,value,now,previousAnimation);}}return{isHigherOrder:true,onFrame:repeat,onStart:onStart,reps:0,current:nextAnimation.current,callback:repCallback,startValue:0,reduceMotion:getReduceMotionForAnimation(reduceMotion)};}"
};
const n = function n(a0) {
let c13161_0 = a0;
let numberOfReps = arguments[1];
if (numberOfReps === void 0) {
numberOfReps = 2;
}
let c13161_1 = numberOfReps;
let reverse = arguments[2];
if (reverse === void 0) {
reverse = false;
}
let c13161_2 = reverse;
const callback2 = arguments[3];
let c13161_3 = callback2;
const reduceMotion = arguments[4];
let c13161_4 = reduceMotion;
const l = function l() {
let r4 = c13161_0;
if (typeof r4 === "function") {
r4 = c13161_0();
}
let c24543_0 = r4;
return {
isHigherOrder: true,
onFrame: function repeat(a0, a1) {
const r14 = c24543_0.onFrame(c24543_0, a1);
a0.current = c24543_0.current;
if (r14) {
a0.reps = a0.reps + 1;
if (c24543_0.callback) {
c24543_0.callback(true, a0.current);
}
L13: {
if (!a0.reduceMotion) {
if (c13161_1 > 0 && a0.reps >= c13161_1) {
break L13;
}
const startValue = c13161_2 ? c24543_0.current : a0.startValue;
if (c13161_2) {
c24543_0.toValue = a0.startValue;
a0.startValue = startValue;
}
c24543_0.onStart(c24543_0, startValue, a1, c24543_0.previousAnimation);
return false;
}
}
return true;
}
return false;
},
onStart: function onStart(a0, a1, a2, a3) {
a0.startValue = a1;
a0.reps = 0;
if (c24543_0.reduceMotion === void 0) {
c24543_0.reduceMotion = a0.reduceMotion;
}
L8: {
L6: {
if (a0.reduceMotion && c13161_2) {
if (!(c13161_1 <= 0) && c13161_1 % 2 !== 0) {
break L6;
}
a0.current = a0.startValue;
a0.onFrame = () => true;
break L8;
}
}
c24543_0.onStart(c24543_0, a1, a2, a3);
}
},
reps: 0,
current: r4.current,
callback: (a0) => {
if (c13161_3) {
c13161_3(a0);
}
if (a0 ? !a0 : c24543_0.callback) {
c24543_0.callback(false);
}
},
startValue: 0,
reduceMotion: _recognizePrefixSuffix.getReduceMotionForAnimation(c13161_4)
};
};
l.__closure = {
_nextAnimation: a0,
numberOfReps,
reverse,
callback: callback2,
getReduceMotionForAnimation: _recognizePrefixSuffix.getReduceMotionForAnimation,
reduceMotion
};
l.__workletHash = 11413099333511;
l.__initData = __initData;
return _recognizePrefixSuffix.defineAnimation(a0, l);
};
n.__closure = {
defineAnimation: _recognizePrefixSuffix.defineAnimation,
getReduceMotionForAnimation: _recognizePrefixSuffix.getReduceMotionForAnimation
};
n.__workletHash = 13638828150427;
n.__initData = {
code: "function pnpm_repeatTs1(_nextAnimation,numberOfReps=2,reverse=false,callback,reduceMotion){const{defineAnimation,getReduceMotionForAnimation}=this.__closure;return defineAnimation(_nextAnimation,function(){'worklet';const nextAnimation=typeof _nextAnimation==='function'?_nextAnimation():_nextAnimation;function repeat(animation,now){const finished=nextAnimation.onFrame(nextAnimation,now);animation.current=nextAnimation.current;if(finished){animation.reps+=1;if(nextAnimation.callback){nextAnimation.callback(true,animation.current);}if(animation.reduceMotion||numberOfReps>0&&animation.reps>=numberOfReps){return true;}const startValue=reverse?nextAnimation.current:animation.startValue;if(reverse){nextAnimation.toValue=animation.startValue;animation.startValue=startValue;}nextAnimation.onStart(nextAnimation,startValue,now,nextAnimation.previousAnimation);return false;}return false;}const repCallback=function(finished){if(callback){callback(finished);}if(!finished&&nextAnimation.callback){nextAnimation.callback(false);}};function onStart(animation,value,now,previousAnimation){animation.startValue=value;animation.reps=0;if(nextAnimation.reduceMotion===undefined){nextAnimation.reduceMotion=animation.reduceMotion;}if(animation.reduceMotion&&reverse&&(numberOfReps<=0||numberOfReps%2===0)){animation.current=animation.startValue;animation.onFrame=function(){return true;};}else{nextAnimation.onStart(nextAnimation,value,now,previousAnimation);}}return{isHigherOrder:true,onFrame:repeat,onStart:onStart,reps:0,current:nextAnimation.current,callback:repCallback,startValue:0,reduceMotion:getReduceMotionForAnimation(reduceMotion)};});}"
};
export { n as withRepeat };