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

170 lines
9.4 KiB
JavaScript

// Metro module 1687 (f1688).
import * as _Module1610 from "./Module1610";
import * as _recognizePrefixSuffix from "./recognizePrefixSuffix";
const __initData = {
code: "function pnpm_sequenceTs2(){const{getReduceMotionForAnimation,reduceMotion}=this.__closure;return{onStart:function(animation,value){return animation.current=value;},onFrame:function(){return true;},current:0,animationIndex:0,reduceMotion:getReduceMotionForAnimation(reduceMotion)};}"
};
const __initData2 = {
code: "function pnpm_sequenceTs3(){const{_animations,getReduceMotionForAnimation,reduceMotion}=this.__closure;const animations=_animations.map(function(a){const result=typeof a==='function'?a():a;result.finished=false;return result;});function findNextNonReducedMotionAnimationIndex(index){while(index<animations.length-1&&animations[index].reduceMotion){index++;}return index;}const callback=function(finished){if(finished){return;}animations.forEach(function(animation){if(typeof animation.callback==='function'&&!animation.finished){animation.callback(finished);}});};function sequence(animation,now){const currentAnim=animations[animation.animationIndex];const finished=currentAnim.onFrame(currentAnim,now);animation.current=currentAnim.current;if(finished){if(currentAnim.callback){currentAnim.callback(true);}currentAnim.finished=true;animation.animationIndex=findNextNonReducedMotionAnimationIndex(animation.animationIndex+1);if(animation.animationIndex<animations.length){const nextAnim=animations[animation.animationIndex];nextAnim.onStart(nextAnim,currentAnim.current,now,currentAnim);return false;}return true;}return false;}function onStart(animation,value,now,previousAnimation){animations.forEach(function(anim){if(anim.reduceMotion===undefined){anim.reduceMotion=animation.reduceMotion;}});animation.animationIndex=findNextNonReducedMotionAnimationIndex(0);if(previousAnimation===undefined){previousAnimation=animations[animations.length-1];}const currentAnimation=animations[animation.animationIndex];currentAnimation.onStart(currentAnimation,value,now,previousAnimation);}return{isHigherOrder:true,onFrame:sequence,onStart:onStart,animationIndex:0,current:animations[0].current,callback:callback,reduceMotion:getReduceMotionForAnimation(reduceMotion)};}"
};
export function withSequence(a0, ..._animations) {
let r17, r26;
let c24544_1;
let c24544_0 = _animations;
c24544_1 = void 0;
let reduceMotion = void 0;
if (a0) {
if (typeof a0 === "string") {
c24544_1 = a0;
r17 = a0;
} else {
_animations.unshift(a0);
r17 = void 0;
}
reduceMotion = r17;
}
if (_animations.length === 0) {
_Module1610.logger.warn("No animation was provided for the sequence");
const c = function c() {
return {
onStart: (a0, a1) => {
a0.current = a1;
return a1;
},
onFrame: () => true,
current: 0,
animationIndex: 0,
reduceMotion: _recognizePrefixSuffix.getReduceMotionForAnimation(c24544_1)
};
};
c.__closure = {
getReduceMotionForAnimation: _recognizePrefixSuffix.getReduceMotionForAnimation,
reduceMotion
};
c.__workletHash = 3306563388298;
c.__initData = __initData;
r26 = _recognizePrefixSuffix.defineAnimation(0, c);
} else {
const r20 = _animations[0];
const r21 = function() {
let c28939_0;
const r6 = c24544_0.map((item) => {
const r1 = typeof item === "function" ? item() : item;
r1.finished = false;
return r1;
});
c28939_0 = r6;
return {
isHigherOrder: true,
onFrame: function sequence(a0, a1) {
let reduceMotion2;
const r7 = c28939_0[a0.animationIndex];
const r19 = r7.onFrame(r7, a1);
a0.current = r7.current;
if (r19) {
if (r7.callback) {
r7.callback(true);
}
r7.finished = true;
const r12 = a0.animationIndex + 1;
const r0 = c28939_0.length - 1;
let animationIndex = r12;
if (r12 < r0) {
const reduceMotion = c28939_0[r12].reduceMotion;
let r10 = r12;
animationIndex = r10;
if (reduceMotion) {
do {
const r30 = r10 + 1;
const r2 = c28939_0.length - 1;
animationIndex = r30;
if (!(r30 < r2)) {
break;
}
reduceMotion2 = c28939_0[r30].reduceMotion;
r10 = r30;
animationIndex = r10;
} while (reduceMotion2);
}
}
a0.animationIndex = animationIndex;
if (a0.animationIndex < c28939_0.length) {
const r38 = c28939_0[a0.animationIndex];
r38.onStart(r38, r7.current, a1, r7);
return false;
}
return true;
}
return false;
},
onStart: function onStart(a0, a1, a2, a3) {
let reduceMotion2;
c28939_0.forEach((item) => {
if (item.reduceMotion === void 0) {
item.reduceMotion = a0.reduceMotion;
}
});
const r0 = c28939_0.length - 1;
let animationIndex = 0;
if (0 < r0) {
const reduceMotion = c28939_0[0].reduceMotion;
let r21 = 0;
animationIndex = 0;
if (reduceMotion) {
do {
const r22 = r21 + 1;
const r4 = c28939_0.length - 1;
animationIndex = r22;
if (!(r22 < r4)) {
break;
}
reduceMotion2 = c28939_0[r22].reduceMotion;
r21 = r22;
animationIndex = r21;
} while (reduceMotion2);
}
}
let r27 = a3;
a0.animationIndex = animationIndex;
if (a3 === void 0) {
r27 = c28939_0[c28939_0.length - 1];
}
const r31 = c28939_0[a0.animationIndex];
r31.onStart(r31, a1, a2, r27);
},
animationIndex: 0,
current: r6[0].current,
callback: (a0) => {
if (!a0) {
c28939_0.forEach((item) => {
const callback2 = item.callback;
if (!(typeof callback2 === "function" ? item.finished : typeof callback2 !== "function")) {
item.callback(a0);
}
});
}
},
reduceMotion: _recognizePrefixSuffix.getReduceMotionForAnimation(c24544_1)
};
};
r21.__closure = {
_animations,
getReduceMotionForAnimation: _recognizePrefixSuffix.getReduceMotionForAnimation,
reduceMotion
};
r21.__workletHash = 13427604040510;
r21.__initData = __initData2;
r26 = _recognizePrefixSuffix.defineAnimation(r20, r21);
}
return r26;
}
withSequence.__closure = {
logger: _Module1610.logger,
defineAnimation: _recognizePrefixSuffix.defineAnimation,
getReduceMotionForAnimation: _recognizePrefixSuffix.getReduceMotionForAnimation
};
withSequence.__workletHash = 4184395270838;
withSequence.__initData = {
code: "function withSequence_Pnpm_sequenceTs1(_reduceMotionOrFirstAnimation,..._animations){const{logger,defineAnimation,getReduceMotionForAnimation}=this.__closure;let reduceMotion;if(_reduceMotionOrFirstAnimation){if(typeof _reduceMotionOrFirstAnimation==='string'){reduceMotion=_reduceMotionOrFirstAnimation;}else{_animations.unshift(_reduceMotionOrFirstAnimation);}}if(_animations.length===0){logger.warn('No animation was provided for the sequence');return defineAnimation(0,function(){'worklet';return{onStart:function(animation,value){return animation.current=value;},onFrame:function(){return true;},current:0,animationIndex:0,reduceMotion:getReduceMotionForAnimation(reduceMotion)};});}return defineAnimation(_animations[0],function(){'worklet';const animations=_animations.map(function(a){const result=typeof a==='function'?a():a;result.finished=false;return result;});function findNextNonReducedMotionAnimationIndex(index){while(index<animations.length-1&&animations[index].reduceMotion){index++;}return index;}const callback=function(finished){if(finished){return;}animations.forEach(function(animation){if(typeof animation.callback==='function'&&!animation.finished){animation.callback(finished);}});};function sequence(animation,now){const currentAnim=animations[animation.animationIndex];const finished=currentAnim.onFrame(currentAnim,now);animation.current=currentAnim.current;if(finished){if(currentAnim.callback){currentAnim.callback(true);}currentAnim.finished=true;animation.animationIndex=findNextNonReducedMotionAnimationIndex(animation.animationIndex+1);if(animation.animationIndex<animations.length){const nextAnim=animations[animation.animationIndex];nextAnim.onStart(nextAnim,currentAnim.current,now,currentAnim);return false;}return true;}return false;}function onStart(animation,value,now,previousAnimation){animations.forEach(function(anim){if(anim.reduceMotion===undefined){anim.reduceMotion=animation.reduceMotion;}});animation.animationIndex=findNextNonReducedMotionAnimationIndex(0);if(previousAnimation===undefined){previousAnimation=animations[animations.length-1];}const currentAnimation=animations[animation.animationIndex];currentAnimation.onStart(currentAnimation,value,now,previousAnimation);}return{isHigherOrder:true,onFrame:sequence,onStart:onStart,animationIndex:0,current:animations[0].current,callback:callback,reduceMotion:getReduceMotionForAnimation(reduceMotion)};});}"
};