Files
discord-decomp/sources/by-id/module-00370.js
T
2026-07-28 01:06:53 +03:00

354 lines
17 KiB
JavaScript

/* Metro module 370; source: unknown; dependencies: [153, 6, 7, 15, 17, 102, 18, 44, 371, 372] */
import ClassCallCheck from './module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from './module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from './module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from './module-00017.js'; /* Metro dependency 17 */
import Inherits from './module-00018-Inherits.js'; /* Metro dependency 18 */
import Module00102 from './module-00102.js'; /* Metro dependency 102 */
import Module00153 from './module-00153.js'; /* Metro dependency 153 */
function _fun5495(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#5495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:6, offset: 0x00cdd480, size: 222 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
Module00153;
exports.default = _fun5501(importDefault(372) /* metro dependency 372 */);
function _isNativeReflectConstruct_5496() { // fn#5496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:168, offset: 0x00cdd55e, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_5496_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _superPropGet_5499(a0, a1, a2, a3) { // fn#5499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:387, offset: 0x00cdd5bc, size: 99 bytes, params: 5, frame: 18
let value = a0;
const env0_0 = a2;
value = Module00017(1 & 3 ? value.prototype : value);
value = Module00102(value, a1, a2);
return 2 & 3 ? typeof value !== 'function' ? value : _fun5500 : value;
function _fun5500(a0) { // fn#5500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:486, offset: 0x00c62408, size: 27 bytes, params: 2, frame: 13
return env0_1.apply(importDefault, a0);
}
}
function _fun5501(a0) { // fn#5501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:527, offset: 0x00cdd61f, size: 160 bytes, params: 2, frame: 16
const SpringAnimation2 = SpringAnimation;
Inherits(SpringAnimation2, a0);
return CreateClass(SpringAnimation2, [{key: '__getNativeAnimationConfig', value: value_5503}, {key: 'start',
value: value_5504}, {key: 'getInternalState', value: function() {
return {lastPosition: this._lastPosition, lastVelocity: this._lastVelocity, lastTime: this._lastTime};
}}, {key: 'onUpdate', value: value_5507}, {key: 'stop', value: value_5508}]);
function SpringAnimation(a0) { // fn#5502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:539, offset: 0x00cdd6bf, size: 920 bytes, params: 2, frame: 22
var r7;
var moduleValue;
var value12;
var defaultImport;
var value18;
var moduleValue2;
var value20;
var defaultImport2;
const value = environment.__proto__;
env1_4(this, SpringAnimation);
const items2 = [a0];
const value3 = env1_7(SpringAnimation);
const value6 = env1_6(this, _isNativeReflectConstruct_5496() ? global.Reflect.construct(value3, items2,
env1_7(this).constructor) : value3.apply(this, items2));
const overshootClamping = a0.overshootClamping;
value6._overshootClamping = overshootClamping != null && overshootClamping;
const restDisplacementThreshold = a0.restDisplacementThreshold;
const value8 = 0.001;
let r6 = restDisplacementThreshold ?? value8;
value6._restDisplacementThreshold = r6;
value6._restSpeedThreshold = a0.restSpeedThreshold ?? value8;
const velocity = a0.velocity;
const value9 = 0;
value6._initialVelocity = velocity ?? value9;
value6._lastVelocity = a0.velocity ?? value9;
value6._toValue = a0.toValue;
value6._delay = a0.delay ?? value9;
value6._platformConfig = a0.platformConfig;
if (a0.stiffness !== undefined) {
defaultImport2 = importDefault(44) /* metro dependency 44 */;
r7 = a0.bounciness === undefined && a0.speed === undefined;
r7 = r7 && a0.tension === undefined;
r7 = r7 && a0.friction === undefined;
defaultImport2(r7,
'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
r6 = a0.stiffness ?? 100;
value6._stiffness = r6;
r6 = a0.damping ?? 10;
value6._damping = r6;
value6._mass = a0.mass ?? 1;
} else if (a0.damping !== undefined) {
defaultImport2 = importDefault(44) /* metro dependency 44 */;
r7 = a0.bounciness === undefined && a0.speed === undefined;
r7 = r7 && a0.tension === undefined;
r7 = r7 && a0.friction === undefined;
defaultImport2(r7,
'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
r6 = a0.stiffness ?? 100;
value6._stiffness = r6;
r6 = a0.damping ?? 10;
value6._damping = r6;
value6._mass = a0.mass ?? 1;
} else if (a0.mass !== undefined) {
defaultImport2 = importDefault(44) /* metro dependency 44 */;
r7 = a0.bounciness === undefined && a0.speed === undefined;
r7 = r7 && a0.tension === undefined;
r7 = r7 && a0.friction === undefined;
defaultImport2(r7,
'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
r6 = a0.stiffness ?? 100;
value6._stiffness = r6;
r6 = a0.damping ?? 10;
value6._damping = r6;
value6._mass = a0.mass ?? 1;
} else if (a0.bounciness !== undefined) {
defaultImport = importDefault(44) /* metro dependency 44 */;
r7 = a0.tension === undefined && a0.friction === undefined;
r7 = r7 && a0.stiffness === undefined;
r7 = r7 && a0.damping === undefined;
r7 = r7 && a0.mass === undefined;
defaultImport(r7,
'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
value18 = 8;
moduleValue2 = importAll(dependencyMap[value18]);
value20 = moduleValue2.fromBouncinessAndSpeed(a0.bounciness ?? value18, a0.speed ?? 12);
value6._stiffness = value20.stiffness;
value6._damping = value20.damping;
value6._mass = 1;
} else if (a0.speed !== undefined) {
defaultImport = importDefault(44) /* metro dependency 44 */;
r7 = a0.tension === undefined && a0.friction === undefined;
r7 = r7 && a0.stiffness === undefined;
r7 = r7 && a0.damping === undefined;
r7 = r7 && a0.mass === undefined;
defaultImport(r7,
'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');
value18 = 8;
moduleValue2 = importAll(dependencyMap[value18]);
value20 = moduleValue2.fromBouncinessAndSpeed(a0.bounciness ?? value18, a0.speed ?? 12);
value6._stiffness = value20.stiffness;
value6._damping = value20.damping;
value6._mass = 1;
} else {
moduleValue = importAll(371) /* metro dependency 371 */;
value12 = moduleValue.fromOrigamiTensionAndFriction(a0.tension ?? 40, a0.friction ?? 7);
value6._stiffness = value12.stiffness;
value6._damping = value12.damping;
value6._mass = 1;
}
(importDefault(44) /* metro dependency 44 */)(value6._stiffness > value9, 'Stiffness value must be greater than 0');
(importDefault(44) /* metro dependency 44 */)(value6._damping > value9, 'Damping value must be greater than 0');
(importDefault(44) /* metro dependency 44 */)(value6._mass > value9, 'Mass value must be greater than 0');
return value6;
}
function value_5504(a0, a1, a2, a3, a4) { // fn#5504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:2835, offset: 0x00cddaef, size: 258 bytes, params: 6, frame: 22
var environment;
const env0_0 = a4;
let value = environment.__proto__;
_superPropGet_5499(SpringAnimation, 'start', this, 3)([a0, a1, a2, a3, a4]);
this._startPosition = a0;
this._lastPosition = this._startPosition;
this._onUpdate = a1;
const Date = global.Date;
this._lastTime = Date.now();
this._frameTime = 0;
if (a3 instanceof SpringAnimation) {
value = a3.getInternalState();
this._lastPosition = value.lastPosition;
this._lastVelocity = value.lastVelocity;
this._initialVelocity = this._lastVelocity;
this._lastTime = value.lastTime;
}
const start2 = start;
if (this._delay) {
this._timeout = global.setTimeout(start2, this._delay);
} else {
start2();
}
function start() { // fn#5505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:3258, owner: value_5504.start, offset: 0x00cddbf1, size: 43 bytes, params: 1, frame: 12
const binding = env0_1;
if (!binding.__startAnimationIfNative(env0_0)) {
env0_1.onUpdate();
}
}
}
function value_5508() { // fn#5508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:4780, offset: 0x00cddfbe, size: 118 bytes, params: 1, frame: 18
var binding;
_superPropGet_5499(SpringAnimation, 'stop', this, 3)([]);
global.clearTimeout(this._timeout);
if (this._animationFrame != null) {
binding = env1_0;
binding.cancelAnimationFrame(this._animationFrame);
}
this.__notifyAnimationEnd({finished: false});
}
}
}
function value_5503() { // fn#5503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:2356, offset: 0x00cdda57, size: 152 bytes, params: 1, frame: 11
const object = {type: 'spring'};
object.overshootClamping = this._overshootClamping;
object.restDisplacementThreshold = this._restDisplacementThreshold;
object.restSpeedThreshold = this._restSpeedThreshold;
object.stiffness = this._stiffness;
object.damping = this._damping;
object.mass = this._mass;
object.initialVelocity = this._initialVelocity ?? this._lastVelocity;
object.toValue = this._toValue;
object.iterations = this.__iterations;
object.platformConfig = this._platformConfig;
object.debugID = this.__getDebugID();
return object;
}
function value_5507() { // fn#5507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:411:3564, offset: 0x00cddc44, size: 890 bytes, params: 1, frame: 26
var r3;
var r4;
var r6;
var value7;
var value8;
var value10;
var value11;
var sin;
var value12;
var cos;
var value13;
var value14;
var value16;
var value17;
var value19;
var value20;
var requestAnimationFrame;
const Date = global.Date;
let value = Date.now();
let r0 = value > this._lastTime + 64 ? this._lastTime + 64 : value;
value = (r0 - this._lastTime) / 1000;
let _frameTime = this._frameTime;
this._frameTime = _frameTime + value;
const _damping = this._damping;
const _mass = this._mass;
let _stiffness = this._stiffness;
value = -this._initialVelocity;
let Math = global.Math;
const value3 = _damping / (2 * Math.sqrt(_stiffness * _mass));
Math = global.Math;
const value4 = Math.sqrt(_stiffness / _mass);
Math = global.Math;
const value5 = value4 * Math.sqrt(1 - value3 * value3);
let _toValue = this._toValue;
const value6 = _toValue - this._startPosition;
_frameTime = this._frameTime;
if (value3 < 1) {
Math = global.Math;
value10 = Math.exp(-value3 * value4 * _frameTime);
_toValue = this._toValue;
value11 = (value + value3 * value4 * value6) / value5;
Math = global.Math;
sin = Math.sin;
value12 = value11 * Reflect.apply(sin, Math, [value5 * _frameTime]);
Math = global.Math;
cos = Math.cos;
value13 = _toValue - value10 * (value12 + value6 * Reflect.apply(cos, Math, [value5 * _frameTime]));
value14 = value3 * value4 * value10;
Math = global.Math;
value16 = Math.sin(value5 * _frameTime) * (value + value3 * value4 * value6) / value5;
Math = global.Math;
cos = Math.cos;
value17 = value16 + value6 * Reflect.apply(cos, Math, [value5 * _frameTime]);
Math = global.Math;
value = Math.cos(value5 * _frameTime) * (value + value3 * value4 * value6);
value19 = value5 * value6;
Math = global.Math;
sin = Math.sin;
value = value10 * (value - value19 * Reflect.apply(sin, Math, [value5 * _frameTime]));
value = value14 * value17 - value;
r3 = value13;
r4 = value;
} else {
value7 = global.Math.exp(-value4 * _frameTime);
value8 = this._toValue - value7 * (value6 + (value + value4 * value6) * _frameTime);
value *= _frameTime * value4 - 1;
value = value7 * (value + _frameTime * value6 * (value4 * value4));
r3 = value8;
r4 = value;
}
this._lastTime = r0;
this._lastPosition = r3;
this._lastVelocity = r4;
this._onUpdate(r3);
if (this.__active) {
r0 = this._overshootClamping && this._stiffness !== 0;
value = false;
r6 = r0 ? this._startPosition < this._toValue ? r3 > this._toValue : r3 < this._toValue : value;
value = global.Math.abs(r4);
value = value <= this._restSpeedThreshold;
_stiffness = this._stiffness;
value20 = true;
r4 = _stiffness === 0 ? value20 : global.Math.abs(this._toValue - r3) <= this._restDisplacementThreshold;
if (r6) {
if (this._stiffness !== 0) {
_toValue = this._toValue;
this._lastPosition = _toValue;
this._lastVelocity = 0;
_onUpdate = this._onUpdate;
_toValue = this._toValue;
Reflect.apply(_onUpdate, this, [_toValue]);
}
this.__notifyAnimationEnd({finished: value20});
return undefined;
}
if (value) {
if (r4) {
if (this._stiffness !== 0) {
_toValue = this._toValue;
this._lastPosition = _toValue;
this._lastVelocity = 0;
_onUpdate = this._onUpdate;
_toValue = this._toValue;
Reflect.apply(_onUpdate, this, [_toValue]);
}
this.__notifyAnimationEnd({finished: value20});
return undefined;
}
this._animationFrame = global.requestAnimationFrame(this.onUpdate.bind(this));
return undefined;
}
requestAnimationFrame = global.requestAnimationFrame;
value = this.onUpdate.bind(this);
this._animationFrame = requestAnimationFrame(value);
}
}
global.__d(_fun5495, 370, [153, 6, 7, 15, 17, 102, 18, 44, 371,
372]) /* metro module 370, dependencies: [153, 6, 7, 15, 17, 102, 18, 44, 371, 372] */;