@remotion/lambda-client 4.0.507 → 4.0.509
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +702 -103
- package/dist/esm/index.mjs +702 -103
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -61010,7 +61010,7 @@ If this is not correct, provide an override value by setting a number
|
|
|
61010
61010
|
to input.params.ContentLength in bytes.
|
|
61011
61011
|
`);
|
|
61012
61012
|
}
|
|
61013
|
-
this.uploadedParts.sort((
|
|
61013
|
+
this.uploadedParts.sort((a2, b2) => a2.PartNumber - b2.PartNumber);
|
|
61014
61014
|
const uploadCompleteParams = {
|
|
61015
61015
|
...this.params,
|
|
61016
61016
|
Body: undefined,
|
|
@@ -69857,6 +69857,498 @@ var import_client_sts = __toESM(require_dist_cjs81(), 1);
|
|
|
69857
69857
|
|
|
69858
69858
|
// ../serverless-client/dist/esm/index.mjs
|
|
69859
69859
|
var tty = __toESM(require("tty"));
|
|
69860
|
+
var NEWTON_ITERATIONS = 4;
|
|
69861
|
+
var NEWTON_MIN_SLOPE = 0.001;
|
|
69862
|
+
var SUBDIVISION_PRECISION = 0.0000001;
|
|
69863
|
+
var SUBDIVISION_MAX_ITERATIONS = 10;
|
|
69864
|
+
var kSplineTableSize = 11;
|
|
69865
|
+
var kSampleStepSize = 1 / (kSplineTableSize - 1);
|
|
69866
|
+
var float32ArraySupported = typeof Float32Array === "function";
|
|
69867
|
+
function a(aA1, aA2) {
|
|
69868
|
+
return 1 - 3 * aA2 + 3 * aA1;
|
|
69869
|
+
}
|
|
69870
|
+
function b(aA1, aA2) {
|
|
69871
|
+
return 3 * aA2 - 6 * aA1;
|
|
69872
|
+
}
|
|
69873
|
+
function c(aA1) {
|
|
69874
|
+
return 3 * aA1;
|
|
69875
|
+
}
|
|
69876
|
+
function calcBezier(aT, aA1, aA2) {
|
|
69877
|
+
return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
|
|
69878
|
+
}
|
|
69879
|
+
function getSlope(aT, aA1, aA2) {
|
|
69880
|
+
return 3 * a(aA1, aA2) * aT * aT + 2 * b(aA1, aA2) * aT + c(aA1);
|
|
69881
|
+
}
|
|
69882
|
+
function binarySubdivide({
|
|
69883
|
+
aX,
|
|
69884
|
+
_aA,
|
|
69885
|
+
_aB,
|
|
69886
|
+
mX1,
|
|
69887
|
+
mX2
|
|
69888
|
+
}) {
|
|
69889
|
+
let currentX;
|
|
69890
|
+
let currentT;
|
|
69891
|
+
let i = 0;
|
|
69892
|
+
let aA = _aA;
|
|
69893
|
+
let aB = _aB;
|
|
69894
|
+
do {
|
|
69895
|
+
currentT = aA + (aB - aA) / 2;
|
|
69896
|
+
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
69897
|
+
if (currentX > 0) {
|
|
69898
|
+
aB = currentT;
|
|
69899
|
+
} else {
|
|
69900
|
+
aA = currentT;
|
|
69901
|
+
}
|
|
69902
|
+
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
|
69903
|
+
return currentT;
|
|
69904
|
+
}
|
|
69905
|
+
function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
|
|
69906
|
+
let aGuessT = _aGuessT;
|
|
69907
|
+
for (let i = 0;i < NEWTON_ITERATIONS; ++i) {
|
|
69908
|
+
const currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
69909
|
+
if (currentSlope === 0) {
|
|
69910
|
+
return aGuessT;
|
|
69911
|
+
}
|
|
69912
|
+
const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
69913
|
+
aGuessT -= currentX / currentSlope;
|
|
69914
|
+
}
|
|
69915
|
+
return aGuessT;
|
|
69916
|
+
}
|
|
69917
|
+
function bezier(mX1, mY1, mX2, mY2) {
|
|
69918
|
+
if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
|
|
69919
|
+
throw new Error("bezier x values must be in [0, 1] range");
|
|
69920
|
+
}
|
|
69921
|
+
const sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
|
69922
|
+
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
69923
|
+
for (let i = 0;i < kSplineTableSize; ++i) {
|
|
69924
|
+
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
69925
|
+
}
|
|
69926
|
+
}
|
|
69927
|
+
function getTForX(aX) {
|
|
69928
|
+
let intervalStart = 0;
|
|
69929
|
+
let currentSample = 1;
|
|
69930
|
+
const lastSample = kSplineTableSize - 1;
|
|
69931
|
+
for (;currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
69932
|
+
intervalStart += kSampleStepSize;
|
|
69933
|
+
}
|
|
69934
|
+
--currentSample;
|
|
69935
|
+
const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
69936
|
+
const guessForT = intervalStart + dist * kSampleStepSize;
|
|
69937
|
+
const initialSlope = getSlope(guessForT, mX1, mX2);
|
|
69938
|
+
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
69939
|
+
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
69940
|
+
}
|
|
69941
|
+
if (initialSlope === 0) {
|
|
69942
|
+
return guessForT;
|
|
69943
|
+
}
|
|
69944
|
+
return binarySubdivide({
|
|
69945
|
+
aX,
|
|
69946
|
+
_aA: intervalStart,
|
|
69947
|
+
_aB: intervalStart + kSampleStepSize,
|
|
69948
|
+
mX1,
|
|
69949
|
+
mX2
|
|
69950
|
+
});
|
|
69951
|
+
}
|
|
69952
|
+
return function(x) {
|
|
69953
|
+
const clampedX = Math.min(1, Math.max(0, x));
|
|
69954
|
+
if (mX1 === mY1 && mX2 === mY2) {
|
|
69955
|
+
return clampedX;
|
|
69956
|
+
}
|
|
69957
|
+
if (clampedX === 0) {
|
|
69958
|
+
return 0;
|
|
69959
|
+
}
|
|
69960
|
+
if (clampedX === 1) {
|
|
69961
|
+
return 1;
|
|
69962
|
+
}
|
|
69963
|
+
return calcBezier(getTForX(clampedX), mY1, mY2);
|
|
69964
|
+
};
|
|
69965
|
+
}
|
|
69966
|
+
var validateFrame = ({
|
|
69967
|
+
allowFloats,
|
|
69968
|
+
durationInFrames,
|
|
69969
|
+
frame
|
|
69970
|
+
}) => {
|
|
69971
|
+
if (typeof frame === "undefined") {
|
|
69972
|
+
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
69973
|
+
}
|
|
69974
|
+
if (typeof frame !== "number") {
|
|
69975
|
+
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
69976
|
+
}
|
|
69977
|
+
if (!Number.isFinite(frame)) {
|
|
69978
|
+
throw new RangeError(`Frame ${frame} is not finite`);
|
|
69979
|
+
}
|
|
69980
|
+
if (frame % 1 !== 0 && !allowFloats) {
|
|
69981
|
+
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
69982
|
+
}
|
|
69983
|
+
if (frame < 0 && frame < -durationInFrames) {
|
|
69984
|
+
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
|
|
69985
|
+
}
|
|
69986
|
+
if (frame > durationInFrames - 1) {
|
|
69987
|
+
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
69988
|
+
}
|
|
69989
|
+
};
|
|
69990
|
+
function validateFps(fps, location, isGif) {
|
|
69991
|
+
if (typeof fps !== "number") {
|
|
69992
|
+
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
69993
|
+
}
|
|
69994
|
+
if (!Number.isFinite(fps)) {
|
|
69995
|
+
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
69996
|
+
}
|
|
69997
|
+
if (isNaN(fps)) {
|
|
69998
|
+
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
69999
|
+
}
|
|
70000
|
+
if (fps <= 0) {
|
|
70001
|
+
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
70002
|
+
}
|
|
70003
|
+
if (isGif && fps > 50) {
|
|
70004
|
+
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
70005
|
+
}
|
|
70006
|
+
}
|
|
70007
|
+
var validateSpringDuration = (dur) => {
|
|
70008
|
+
if (typeof dur === "undefined") {
|
|
70009
|
+
return;
|
|
70010
|
+
}
|
|
70011
|
+
if (typeof dur !== "number") {
|
|
70012
|
+
throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof dur}"`);
|
|
70013
|
+
}
|
|
70014
|
+
if (Number.isNaN(dur)) {
|
|
70015
|
+
throw new TypeError('A "duration" of a spring is NaN, which it must not be');
|
|
70016
|
+
}
|
|
70017
|
+
if (!Number.isFinite(dur)) {
|
|
70018
|
+
throw new TypeError('A "duration" of a spring must be finite, but is ' + dur);
|
|
70019
|
+
}
|
|
70020
|
+
if (dur <= 0) {
|
|
70021
|
+
throw new TypeError('A "duration" of a spring must be positive, but is ' + dur);
|
|
70022
|
+
}
|
|
70023
|
+
};
|
|
70024
|
+
var defaultSpringConfig = {
|
|
70025
|
+
damping: 10,
|
|
70026
|
+
mass: 1,
|
|
70027
|
+
stiffness: 100,
|
|
70028
|
+
overshootClamping: false
|
|
70029
|
+
};
|
|
70030
|
+
var advanceCache = {};
|
|
70031
|
+
function advance({
|
|
70032
|
+
animation,
|
|
70033
|
+
now,
|
|
70034
|
+
config
|
|
70035
|
+
}) {
|
|
70036
|
+
const { toValue, lastTimestamp, current, velocity } = animation;
|
|
70037
|
+
const deltaTime = Math.min(now - lastTimestamp, 64);
|
|
70038
|
+
if (config.damping <= 0) {
|
|
70039
|
+
throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");
|
|
70040
|
+
}
|
|
70041
|
+
const c2 = config.damping;
|
|
70042
|
+
const m = config.mass;
|
|
70043
|
+
const k = config.stiffness;
|
|
70044
|
+
const cacheKey = [
|
|
70045
|
+
toValue,
|
|
70046
|
+
lastTimestamp,
|
|
70047
|
+
current,
|
|
70048
|
+
velocity,
|
|
70049
|
+
c2,
|
|
70050
|
+
m,
|
|
70051
|
+
k,
|
|
70052
|
+
now
|
|
70053
|
+
].join("-");
|
|
70054
|
+
if (advanceCache[cacheKey]) {
|
|
70055
|
+
return advanceCache[cacheKey];
|
|
70056
|
+
}
|
|
70057
|
+
const v0 = -velocity;
|
|
70058
|
+
const x0 = toValue - current;
|
|
70059
|
+
const zeta = c2 / (2 * Math.sqrt(k * m));
|
|
70060
|
+
const omega0 = Math.sqrt(k / m);
|
|
70061
|
+
const omega1 = omega0 * Math.sqrt(1 - zeta ** 2);
|
|
70062
|
+
const t = deltaTime / 1000;
|
|
70063
|
+
const sin1 = Math.sin(omega1 * t);
|
|
70064
|
+
const cos1 = Math.cos(omega1 * t);
|
|
70065
|
+
const underDampedEnvelope = Math.exp(-zeta * omega0 * t);
|
|
70066
|
+
const underDampedFrag1 = underDampedEnvelope * (sin1 * ((v0 + zeta * omega0 * x0) / omega1) + x0 * cos1);
|
|
70067
|
+
const underDampedPosition = toValue - underDampedFrag1;
|
|
70068
|
+
const underDampedVelocity = zeta * omega0 * underDampedFrag1 - underDampedEnvelope * (cos1 * (v0 + zeta * omega0 * x0) - omega1 * x0 * sin1);
|
|
70069
|
+
const criticallyDampedEnvelope = Math.exp(-omega0 * t);
|
|
70070
|
+
const criticallyDampedPosition = toValue - criticallyDampedEnvelope * (x0 + (v0 + omega0 * x0) * t);
|
|
70071
|
+
const criticallyDampedVelocity = criticallyDampedEnvelope * (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0);
|
|
70072
|
+
const animationNode = {
|
|
70073
|
+
toValue,
|
|
70074
|
+
prevPosition: current,
|
|
70075
|
+
lastTimestamp: now,
|
|
70076
|
+
current: zeta < 1 ? underDampedPosition : criticallyDampedPosition,
|
|
70077
|
+
velocity: zeta < 1 ? underDampedVelocity : criticallyDampedVelocity
|
|
70078
|
+
};
|
|
70079
|
+
advanceCache[cacheKey] = animationNode;
|
|
70080
|
+
return animationNode;
|
|
70081
|
+
}
|
|
70082
|
+
var calculationCache = {};
|
|
70083
|
+
function springCalculation({
|
|
70084
|
+
frame,
|
|
70085
|
+
fps,
|
|
70086
|
+
config = {}
|
|
70087
|
+
}) {
|
|
70088
|
+
const from = 0;
|
|
70089
|
+
const to = 1;
|
|
70090
|
+
const cacheKey = [
|
|
70091
|
+
frame,
|
|
70092
|
+
fps,
|
|
70093
|
+
config.damping,
|
|
70094
|
+
config.mass,
|
|
70095
|
+
config.overshootClamping,
|
|
70096
|
+
config.stiffness
|
|
70097
|
+
].join("-");
|
|
70098
|
+
if (calculationCache[cacheKey]) {
|
|
70099
|
+
return calculationCache[cacheKey];
|
|
70100
|
+
}
|
|
70101
|
+
let animation = {
|
|
70102
|
+
lastTimestamp: 0,
|
|
70103
|
+
current: from,
|
|
70104
|
+
toValue: to,
|
|
70105
|
+
velocity: 0,
|
|
70106
|
+
prevPosition: 0
|
|
70107
|
+
};
|
|
70108
|
+
const frameClamped = Math.max(0, frame);
|
|
70109
|
+
const unevenRest = frameClamped % 1;
|
|
70110
|
+
for (let f = 0;f <= Math.floor(frameClamped); f++) {
|
|
70111
|
+
if (f === Math.floor(frameClamped)) {
|
|
70112
|
+
f += unevenRest;
|
|
70113
|
+
}
|
|
70114
|
+
const time = f / fps * 1000;
|
|
70115
|
+
animation = advance({
|
|
70116
|
+
animation,
|
|
70117
|
+
now: time,
|
|
70118
|
+
config: {
|
|
70119
|
+
...defaultSpringConfig,
|
|
70120
|
+
...config
|
|
70121
|
+
}
|
|
70122
|
+
});
|
|
70123
|
+
}
|
|
70124
|
+
calculationCache[cacheKey] = animation;
|
|
70125
|
+
return animation;
|
|
70126
|
+
}
|
|
70127
|
+
var cache = new Map;
|
|
70128
|
+
function measureSpring({
|
|
70129
|
+
fps,
|
|
70130
|
+
config = {},
|
|
70131
|
+
threshold = 0.005
|
|
70132
|
+
}) {
|
|
70133
|
+
if (typeof threshold !== "number") {
|
|
70134
|
+
throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
|
|
70135
|
+
}
|
|
70136
|
+
if (threshold === 0) {
|
|
70137
|
+
return Infinity;
|
|
70138
|
+
}
|
|
70139
|
+
if (threshold === 1) {
|
|
70140
|
+
return 0;
|
|
70141
|
+
}
|
|
70142
|
+
if (isNaN(threshold)) {
|
|
70143
|
+
throw new TypeError("Threshold is NaN");
|
|
70144
|
+
}
|
|
70145
|
+
if (!Number.isFinite(threshold)) {
|
|
70146
|
+
throw new TypeError("Threshold is not finite");
|
|
70147
|
+
}
|
|
70148
|
+
if (threshold < 0) {
|
|
70149
|
+
throw new TypeError("Threshold is below 0");
|
|
70150
|
+
}
|
|
70151
|
+
const cacheKey = [
|
|
70152
|
+
fps,
|
|
70153
|
+
config.damping,
|
|
70154
|
+
config.mass,
|
|
70155
|
+
config.overshootClamping,
|
|
70156
|
+
config.stiffness,
|
|
70157
|
+
threshold
|
|
70158
|
+
].join("-");
|
|
70159
|
+
if (cache.has(cacheKey)) {
|
|
70160
|
+
return cache.get(cacheKey);
|
|
70161
|
+
}
|
|
70162
|
+
validateFps(fps, "to the measureSpring() function", false);
|
|
70163
|
+
let frame = 0;
|
|
70164
|
+
let finishedFrame = 0;
|
|
70165
|
+
const calc = () => {
|
|
70166
|
+
return springCalculation({
|
|
70167
|
+
fps,
|
|
70168
|
+
frame,
|
|
70169
|
+
config
|
|
70170
|
+
});
|
|
70171
|
+
};
|
|
70172
|
+
let animation = calc();
|
|
70173
|
+
const calcDifference = () => {
|
|
70174
|
+
return Math.abs(animation.current - animation.toValue);
|
|
70175
|
+
};
|
|
70176
|
+
let difference = calcDifference();
|
|
70177
|
+
while (difference >= threshold) {
|
|
70178
|
+
frame++;
|
|
70179
|
+
animation = calc();
|
|
70180
|
+
difference = calcDifference();
|
|
70181
|
+
}
|
|
70182
|
+
finishedFrame = frame;
|
|
70183
|
+
for (let i = 0;i < 20; i++) {
|
|
70184
|
+
frame++;
|
|
70185
|
+
animation = calc();
|
|
70186
|
+
difference = calcDifference();
|
|
70187
|
+
if (difference >= threshold) {
|
|
70188
|
+
i = 0;
|
|
70189
|
+
finishedFrame = frame + 1;
|
|
70190
|
+
}
|
|
70191
|
+
}
|
|
70192
|
+
cache.set(cacheKey, finishedFrame);
|
|
70193
|
+
return finishedFrame;
|
|
70194
|
+
}
|
|
70195
|
+
function spring({
|
|
70196
|
+
frame: passedFrame,
|
|
70197
|
+
fps,
|
|
70198
|
+
config = {},
|
|
70199
|
+
from = 0,
|
|
70200
|
+
to = 1,
|
|
70201
|
+
durationInFrames: passedDurationInFrames,
|
|
70202
|
+
durationRestThreshold,
|
|
70203
|
+
delay = 0,
|
|
70204
|
+
reverse = false
|
|
70205
|
+
}) {
|
|
70206
|
+
validateSpringDuration(passedDurationInFrames);
|
|
70207
|
+
validateFrame({
|
|
70208
|
+
frame: passedFrame,
|
|
70209
|
+
durationInFrames: Infinity,
|
|
70210
|
+
allowFloats: true
|
|
70211
|
+
});
|
|
70212
|
+
validateFps(fps, "to spring()", false);
|
|
70213
|
+
const needsToCalculateNaturalDuration = reverse || typeof passedDurationInFrames !== "undefined";
|
|
70214
|
+
const naturalDuration = needsToCalculateNaturalDuration ? measureSpring({
|
|
70215
|
+
fps,
|
|
70216
|
+
config,
|
|
70217
|
+
threshold: durationRestThreshold
|
|
70218
|
+
}) : undefined;
|
|
70219
|
+
const naturalDurationGetter = needsToCalculateNaturalDuration ? {
|
|
70220
|
+
get: () => naturalDuration
|
|
70221
|
+
} : {
|
|
70222
|
+
get: () => {
|
|
70223
|
+
throw new Error("did not calculate natural duration, this is an error with Remotion. Please report");
|
|
70224
|
+
}
|
|
70225
|
+
};
|
|
70226
|
+
const reverseProcessed = reverse ? (passedDurationInFrames ?? naturalDurationGetter.get()) - passedFrame : passedFrame;
|
|
70227
|
+
const delayProcessed = reverseProcessed + (reverse ? delay : -delay);
|
|
70228
|
+
const durationProcessed = passedDurationInFrames === undefined ? delayProcessed : delayProcessed / (passedDurationInFrames / naturalDurationGetter.get());
|
|
70229
|
+
if (passedDurationInFrames && delayProcessed > passedDurationInFrames) {
|
|
70230
|
+
return to;
|
|
70231
|
+
}
|
|
70232
|
+
const spr = springCalculation({
|
|
70233
|
+
fps,
|
|
70234
|
+
frame: durationProcessed,
|
|
70235
|
+
config
|
|
70236
|
+
});
|
|
70237
|
+
const inner = config.overshootClamping ? to >= from ? Math.min(spr.current, to) : Math.max(spr.current, to) : spr.current;
|
|
70238
|
+
const interpolated = from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);
|
|
70239
|
+
return interpolated;
|
|
70240
|
+
}
|
|
70241
|
+
var clampUnit = (t) => Math.min(1, Math.max(0, t));
|
|
70242
|
+
var springEasingDurationInFrames = 30;
|
|
70243
|
+
|
|
70244
|
+
class Easing {
|
|
70245
|
+
static step0(n) {
|
|
70246
|
+
return n > 0 ? 1 : 0;
|
|
70247
|
+
}
|
|
70248
|
+
static step1(n) {
|
|
70249
|
+
return n >= 1 ? 1 : 0;
|
|
70250
|
+
}
|
|
70251
|
+
static linear(t) {
|
|
70252
|
+
return t;
|
|
70253
|
+
}
|
|
70254
|
+
static ease(t) {
|
|
70255
|
+
return Easing.bezier(0.42, 0, 1, 1)(t);
|
|
70256
|
+
}
|
|
70257
|
+
static quad(t) {
|
|
70258
|
+
return t * t;
|
|
70259
|
+
}
|
|
70260
|
+
static cubic(t) {
|
|
70261
|
+
return t * t * t;
|
|
70262
|
+
}
|
|
70263
|
+
static poly(n) {
|
|
70264
|
+
return (t) => t ** n;
|
|
70265
|
+
}
|
|
70266
|
+
static sin(t) {
|
|
70267
|
+
return 1 - Math.cos(t * Math.PI / 2);
|
|
70268
|
+
}
|
|
70269
|
+
static circle(t) {
|
|
70270
|
+
const u = clampUnit(t);
|
|
70271
|
+
return 1 - Math.sqrt(1 - u * u);
|
|
70272
|
+
}
|
|
70273
|
+
static exp(t) {
|
|
70274
|
+
return 2 ** (10 * (t - 1));
|
|
70275
|
+
}
|
|
70276
|
+
static elastic(bounciness = 1) {
|
|
70277
|
+
const p = bounciness * Math.PI;
|
|
70278
|
+
return (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
|
|
70279
|
+
}
|
|
70280
|
+
static back(s = 1.70158) {
|
|
70281
|
+
return (t) => t * t * ((s + 1) * t - s);
|
|
70282
|
+
}
|
|
70283
|
+
static spring({
|
|
70284
|
+
allowTail = false,
|
|
70285
|
+
durationRestThreshold,
|
|
70286
|
+
...config
|
|
70287
|
+
} = {}) {
|
|
70288
|
+
const easing = (t) => {
|
|
70289
|
+
if (t <= 0) {
|
|
70290
|
+
return 0;
|
|
70291
|
+
}
|
|
70292
|
+
if (!allowTail && t >= 1) {
|
|
70293
|
+
return 1;
|
|
70294
|
+
}
|
|
70295
|
+
if (allowTail) {
|
|
70296
|
+
return spring({
|
|
70297
|
+
fps: springEasingDurationInFrames,
|
|
70298
|
+
frame: t * measureSpring({
|
|
70299
|
+
fps: springEasingDurationInFrames,
|
|
70300
|
+
config,
|
|
70301
|
+
threshold: durationRestThreshold
|
|
70302
|
+
}),
|
|
70303
|
+
config
|
|
70304
|
+
});
|
|
70305
|
+
}
|
|
70306
|
+
return spring({
|
|
70307
|
+
fps: springEasingDurationInFrames,
|
|
70308
|
+
frame: t * springEasingDurationInFrames,
|
|
70309
|
+
config,
|
|
70310
|
+
durationInFrames: springEasingDurationInFrames,
|
|
70311
|
+
durationRestThreshold
|
|
70312
|
+
});
|
|
70313
|
+
};
|
|
70314
|
+
return Object.assign(easing, {
|
|
70315
|
+
remotionShouldExtendRight: allowTail
|
|
70316
|
+
});
|
|
70317
|
+
}
|
|
70318
|
+
static bounce(t) {
|
|
70319
|
+
const u = clampUnit(t);
|
|
70320
|
+
if (u < 1 / 2.75) {
|
|
70321
|
+
return 7.5625 * u * u;
|
|
70322
|
+
}
|
|
70323
|
+
if (u < 2 / 2.75) {
|
|
70324
|
+
const t2_ = u - 1.5 / 2.75;
|
|
70325
|
+
return 7.5625 * t2_ * t2_ + 0.75;
|
|
70326
|
+
}
|
|
70327
|
+
if (u < 2.5 / 2.75) {
|
|
70328
|
+
const t2_ = u - 2.25 / 2.75;
|
|
70329
|
+
return 7.5625 * t2_ * t2_ + 0.9375;
|
|
70330
|
+
}
|
|
70331
|
+
const t2 = u - 2.625 / 2.75;
|
|
70332
|
+
return 7.5625 * t2 * t2 + 0.984375;
|
|
70333
|
+
}
|
|
70334
|
+
static bezier(x1, y1, x2, y2) {
|
|
70335
|
+
return bezier(x1, y1, x2, y2);
|
|
70336
|
+
}
|
|
70337
|
+
static in(easing) {
|
|
70338
|
+
return easing;
|
|
70339
|
+
}
|
|
70340
|
+
static out(easing) {
|
|
70341
|
+
return (t) => 1 - easing(1 - t);
|
|
70342
|
+
}
|
|
70343
|
+
static inOut(easing) {
|
|
70344
|
+
return (t) => {
|
|
70345
|
+
if (t < 0.5) {
|
|
70346
|
+
return easing(t * 2) / 2;
|
|
70347
|
+
}
|
|
70348
|
+
return 1 - easing((1 - t) * 2) / 2;
|
|
70349
|
+
};
|
|
70350
|
+
}
|
|
70351
|
+
}
|
|
69860
70352
|
var normalizeNumber = (value) => {
|
|
69861
70353
|
return Math.round(value * 1e6) / 1e6;
|
|
69862
70354
|
};
|
|
@@ -69927,10 +70419,13 @@ var transformOriginCenter = { value: 50, unit: "%" };
|
|
|
69927
70419
|
var stringifyNumber = (value) => {
|
|
69928
70420
|
return String(normalizeNumber(value));
|
|
69929
70421
|
};
|
|
70422
|
+
|
|
70423
|
+
class UnsupportedStringInterpolationValueError extends TypeError {
|
|
70424
|
+
}
|
|
69930
70425
|
var parseStringInterpolationComponent = (component, value) => {
|
|
69931
70426
|
const match = cssNumberRegex.exec(component);
|
|
69932
70427
|
if (match === null) {
|
|
69933
|
-
throw new
|
|
70428
|
+
throw new UnsupportedStringInterpolationValueError(`Cannot interpolate "${value}" because "${component}" is not a supported scale, translate, or rotate value`);
|
|
69934
70429
|
}
|
|
69935
70430
|
const unit = match[2] ?? null;
|
|
69936
70431
|
const numberValue = Number(match[1]);
|
|
@@ -70047,9 +70542,45 @@ var parseTransformOriginValue = (output, parts) => {
|
|
|
70047
70542
|
});
|
|
70048
70543
|
return {
|
|
70049
70544
|
kind: "translate",
|
|
70050
|
-
values: [x.value, y.value, z.value],
|
|
70051
|
-
units: [x.unit, y.unit, z.unit],
|
|
70052
|
-
dimensions: parts[2] === undefined ? 2 : 3
|
|
70545
|
+
values: [x.value, y.value, z.value, 0],
|
|
70546
|
+
units: [x.unit, y.unit, z.unit, null],
|
|
70547
|
+
dimensions: parts[2] === undefined ? 2 : 3,
|
|
70548
|
+
axisRotation: false
|
|
70549
|
+
};
|
|
70550
|
+
};
|
|
70551
|
+
var parseAxisRotationValue = (output) => {
|
|
70552
|
+
const parts = output.trim().split(/\s+/);
|
|
70553
|
+
const keywordAxis = parts.length === 2 ? parts[0].toLowerCase() : null;
|
|
70554
|
+
if (keywordAxis === "x" || keywordAxis === "y" || keywordAxis === "z") {
|
|
70555
|
+
const keywordAngle = parseStringInterpolationComponent(parts[1], output);
|
|
70556
|
+
if (keywordAngle.kind !== "rotate") {
|
|
70557
|
+
return null;
|
|
70558
|
+
}
|
|
70559
|
+
return {
|
|
70560
|
+
kind: "rotate",
|
|
70561
|
+
values: keywordAxis === "x" ? [1, 0, 0, keywordAngle.value] : keywordAxis === "y" ? [0, 1, 0, keywordAngle.value] : [0, 0, 1, keywordAngle.value],
|
|
70562
|
+
units: [null, null, null, keywordAngle.unit],
|
|
70563
|
+
dimensions: 4,
|
|
70564
|
+
axisRotation: true
|
|
70565
|
+
};
|
|
70566
|
+
}
|
|
70567
|
+
if (parts.length !== 4) {
|
|
70568
|
+
return null;
|
|
70569
|
+
}
|
|
70570
|
+
const axis = parts.slice(0, 3).map(Number);
|
|
70571
|
+
if (!axis.every(Number.isFinite)) {
|
|
70572
|
+
return null;
|
|
70573
|
+
}
|
|
70574
|
+
const vectorAngle = parseStringInterpolationComponent(parts[3], output);
|
|
70575
|
+
if (vectorAngle.kind !== "rotate") {
|
|
70576
|
+
return null;
|
|
70577
|
+
}
|
|
70578
|
+
return {
|
|
70579
|
+
kind: "rotate",
|
|
70580
|
+
values: [axis[0], axis[1], axis[2], vectorAngle.value],
|
|
70581
|
+
units: [null, null, null, vectorAngle.unit],
|
|
70582
|
+
dimensions: 4,
|
|
70583
|
+
axisRotation: true
|
|
70053
70584
|
};
|
|
70054
70585
|
};
|
|
70055
70586
|
var parseStringInterpolationValue = (output) => {
|
|
@@ -70059,11 +70590,16 @@ var parseStringInterpolationValue = (output) => {
|
|
|
70059
70590
|
}
|
|
70060
70591
|
return {
|
|
70061
70592
|
kind: "scale",
|
|
70062
|
-
values: [output, output, 1],
|
|
70063
|
-
units: [null, null, null],
|
|
70064
|
-
dimensions: 1
|
|
70593
|
+
values: [output, output, 1, 0],
|
|
70594
|
+
units: [null, null, null, null],
|
|
70595
|
+
dimensions: 1,
|
|
70596
|
+
axisRotation: false
|
|
70065
70597
|
};
|
|
70066
70598
|
}
|
|
70599
|
+
const axisRotation = parseAxisRotationValue(output);
|
|
70600
|
+
if (axisRotation !== null) {
|
|
70601
|
+
return axisRotation;
|
|
70602
|
+
}
|
|
70067
70603
|
const parts = output.trim().split(/\s+/);
|
|
70068
70604
|
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
70069
70605
|
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
@@ -70084,24 +70620,35 @@ var parseStringInterpolationValue = (output) => {
|
|
|
70084
70620
|
const z = parsed[2]?.value ?? 1;
|
|
70085
70621
|
return {
|
|
70086
70622
|
kind,
|
|
70087
|
-
values: [x, y, z],
|
|
70088
|
-
units: [null, null, null],
|
|
70089
|
-
dimensions: parsed.length
|
|
70623
|
+
values: [x, y, z, 0],
|
|
70624
|
+
units: [null, null, null, null],
|
|
70625
|
+
dimensions: parsed.length,
|
|
70626
|
+
axisRotation: false
|
|
70090
70627
|
};
|
|
70091
70628
|
}
|
|
70092
70629
|
return {
|
|
70093
70630
|
kind,
|
|
70094
|
-
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
70095
|
-
units: [
|
|
70096
|
-
|
|
70631
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0, 0],
|
|
70632
|
+
units: [
|
|
70633
|
+
parsed[0].unit,
|
|
70634
|
+
parsed[1]?.unit ?? null,
|
|
70635
|
+
parsed[2]?.unit ?? null,
|
|
70636
|
+
null
|
|
70637
|
+
],
|
|
70638
|
+
dimensions: parsed.length,
|
|
70639
|
+
axisRotation: false
|
|
70097
70640
|
};
|
|
70098
70641
|
};
|
|
70099
70642
|
var serializeStringInterpolationValue = ({
|
|
70100
70643
|
kind,
|
|
70101
70644
|
values,
|
|
70102
70645
|
units,
|
|
70103
|
-
dimensions
|
|
70646
|
+
dimensions,
|
|
70647
|
+
axisRotation
|
|
70104
70648
|
}) => {
|
|
70649
|
+
if (axisRotation) {
|
|
70650
|
+
return `${stringifyNumber(values[0])} ${stringifyNumber(values[1])} ${stringifyNumber(values[2])} ${stringifyNumber(values[3])}${units[3]}`;
|
|
70651
|
+
}
|
|
70105
70652
|
if (kind === "scale") {
|
|
70106
70653
|
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
70107
70654
|
}
|
|
@@ -70269,7 +70816,26 @@ var interpolateString = ({
|
|
|
70269
70816
|
outputRange,
|
|
70270
70817
|
options
|
|
70271
70818
|
}) => {
|
|
70272
|
-
const
|
|
70819
|
+
const initiallyParsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
70820
|
+
const hasAxisRotation = initiallyParsedOutputRange.some((parsed) => parsed.axisRotation);
|
|
70821
|
+
const parsedOutputRange = hasAxisRotation ? initiallyParsedOutputRange.map((parsed) => {
|
|
70822
|
+
if (parsed.kind !== "rotate") {
|
|
70823
|
+
return parsed;
|
|
70824
|
+
}
|
|
70825
|
+
if (parsed.axisRotation) {
|
|
70826
|
+
return parsed;
|
|
70827
|
+
}
|
|
70828
|
+
if (parsed.dimensions !== 1) {
|
|
70829
|
+
throw new TypeError("Cannot interpolate a multi-angle rotate value with an axis rotation");
|
|
70830
|
+
}
|
|
70831
|
+
return {
|
|
70832
|
+
kind: "rotate",
|
|
70833
|
+
values: [0, 0, 1, parsed.values[0]],
|
|
70834
|
+
units: [null, null, null, parsed.units[0]],
|
|
70835
|
+
dimensions: 4,
|
|
70836
|
+
axisRotation: true
|
|
70837
|
+
};
|
|
70838
|
+
}) : initiallyParsedOutputRange;
|
|
70273
70839
|
const kind = parsedOutputRange[0]?.kind;
|
|
70274
70840
|
if (kind === undefined) {
|
|
70275
70841
|
throw new Error("outputRange must have at least 1 element");
|
|
@@ -70281,12 +70847,16 @@ var interpolateString = ({
|
|
|
70281
70847
|
}
|
|
70282
70848
|
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
70283
70849
|
const units = [
|
|
70850
|
+
null,
|
|
70284
70851
|
null,
|
|
70285
70852
|
null,
|
|
70286
70853
|
null
|
|
70287
70854
|
];
|
|
70288
70855
|
if (kind !== "scale") {
|
|
70289
70856
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
70857
|
+
if (hasAxisRotation && axis < 3) {
|
|
70858
|
+
continue;
|
|
70859
|
+
}
|
|
70290
70860
|
for (const parsed of parsedOutputRange) {
|
|
70291
70861
|
const unit = parsed.units[axis];
|
|
70292
70862
|
if (unit === null) {
|
|
@@ -70305,7 +70875,7 @@ var interpolateString = ({
|
|
|
70305
70875
|
}
|
|
70306
70876
|
}
|
|
70307
70877
|
}
|
|
70308
|
-
const values = [0, 0, 0];
|
|
70878
|
+
const values = [0, 0, 0, 0];
|
|
70309
70879
|
for (let axis = 0;axis < dimensions; axis++) {
|
|
70310
70880
|
values[axis] = interpolateNumber({
|
|
70311
70881
|
input,
|
|
@@ -70318,9 +70888,56 @@ var interpolateString = ({
|
|
|
70318
70888
|
kind,
|
|
70319
70889
|
values,
|
|
70320
70890
|
units,
|
|
70321
|
-
dimensions
|
|
70891
|
+
dimensions,
|
|
70892
|
+
axisRotation: hasAxisRotation
|
|
70322
70893
|
});
|
|
70323
70894
|
};
|
|
70895
|
+
var interpolateDiscreteString = ({
|
|
70896
|
+
input,
|
|
70897
|
+
inputRange,
|
|
70898
|
+
outputRange,
|
|
70899
|
+
options
|
|
70900
|
+
}) => {
|
|
70901
|
+
if (inputRange.length === 1) {
|
|
70902
|
+
return outputRange[0];
|
|
70903
|
+
}
|
|
70904
|
+
for (let segmentIndex = 0;segmentIndex < inputRange.length - 1; segmentIndex++) {
|
|
70905
|
+
if (resolveEasingForSegment({
|
|
70906
|
+
easing: options?.easing,
|
|
70907
|
+
segmentIndex
|
|
70908
|
+
}) !== Easing.step1) {
|
|
70909
|
+
throw new TypeError("Non-numeric strings can only be interpolated using Easing.step1");
|
|
70910
|
+
}
|
|
70911
|
+
}
|
|
70912
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
70913
|
+
const inputMin = inputRange[0];
|
|
70914
|
+
const inputMax = inputRange[inputRange.length - 1];
|
|
70915
|
+
let resolvedInput = posterizedInput;
|
|
70916
|
+
if (resolvedInput < inputMin) {
|
|
70917
|
+
if (options?.extrapolateLeft === "identity") {
|
|
70918
|
+
throw new TypeError('extrapolateLeft: "identity" is not supported for non-numeric strings');
|
|
70919
|
+
}
|
|
70920
|
+
if (options?.extrapolateLeft === "wrap") {
|
|
70921
|
+
const wrapRange = inputMax - inputMin;
|
|
70922
|
+
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
70923
|
+
} else {
|
|
70924
|
+
return outputRange[0];
|
|
70925
|
+
}
|
|
70926
|
+
}
|
|
70927
|
+
if (resolvedInput > inputMax) {
|
|
70928
|
+
if (options?.extrapolateRight === "identity") {
|
|
70929
|
+
throw new TypeError('extrapolateRight: "identity" is not supported for non-numeric strings');
|
|
70930
|
+
}
|
|
70931
|
+
if (options?.extrapolateRight === "wrap") {
|
|
70932
|
+
const wrapRange = inputMax - inputMin;
|
|
70933
|
+
resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
|
|
70934
|
+
} else {
|
|
70935
|
+
return outputRange[outputRange.length - 1];
|
|
70936
|
+
}
|
|
70937
|
+
}
|
|
70938
|
+
const range = findRange(resolvedInput, inputRange);
|
|
70939
|
+
return resolvedInput >= inputRange[range + 1] ? outputRange[range + 1] : outputRange[range];
|
|
70940
|
+
};
|
|
70324
70941
|
var validateTupleOutputRange = (outputRange) => {
|
|
70325
70942
|
const dimensions = outputRange[0]?.length;
|
|
70326
70943
|
if (dimensions === undefined) {
|
|
@@ -70435,7 +71052,30 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
70435
71052
|
if (!outputRange.every((output) => typeof output === "string" || typeof output === "number")) {
|
|
70436
71053
|
throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
|
|
70437
71054
|
}
|
|
70438
|
-
|
|
71055
|
+
try {
|
|
71056
|
+
return interpolateString({ input, inputRange, outputRange, options });
|
|
71057
|
+
} catch (error) {
|
|
71058
|
+
if (!outputRange.every((output) => typeof output === "string")) {
|
|
71059
|
+
throw error;
|
|
71060
|
+
}
|
|
71061
|
+
const hasNonNumericString = outputRange.some((output) => {
|
|
71062
|
+
try {
|
|
71063
|
+
parseStringInterpolationValue(output);
|
|
71064
|
+
return false;
|
|
71065
|
+
} catch (parseError) {
|
|
71066
|
+
return parseError instanceof UnsupportedStringInterpolationValueError;
|
|
71067
|
+
}
|
|
71068
|
+
});
|
|
71069
|
+
if (!hasNonNumericString) {
|
|
71070
|
+
throw error;
|
|
71071
|
+
}
|
|
71072
|
+
return interpolateDiscreteString({
|
|
71073
|
+
input,
|
|
71074
|
+
inputRange,
|
|
71075
|
+
outputRange,
|
|
71076
|
+
options
|
|
71077
|
+
});
|
|
71078
|
+
}
|
|
70439
71079
|
}
|
|
70440
71080
|
if (outputRange.every((output) => Array.isArray(output))) {
|
|
70441
71081
|
return interpolateTuple({ input, inputRange, outputRange, options });
|
|
@@ -70446,8 +71086,8 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
70446
71086
|
checkInfiniteRange("outputRange", outputRange);
|
|
70447
71087
|
return interpolateNumber({ input, inputRange, outputRange, options });
|
|
70448
71088
|
}
|
|
70449
|
-
function mulberry32(
|
|
70450
|
-
let t =
|
|
71089
|
+
function mulberry32(a2) {
|
|
71090
|
+
let t = a2 + 1831565813;
|
|
70451
71091
|
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
70452
71092
|
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
70453
71093
|
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
@@ -70936,8 +71576,8 @@ function hslToRgb(h, s, l) {
|
|
|
70936
71576
|
const p = 2 * l - q;
|
|
70937
71577
|
const r = hue2rgb(p, q, h + 1 / 3);
|
|
70938
71578
|
const g = hue2rgb(p, q, h);
|
|
70939
|
-
const
|
|
70940
|
-
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(
|
|
71579
|
+
const b2 = hue2rgb(p, q, h - 1 / 3);
|
|
71580
|
+
return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b2 * 255) << 8;
|
|
70941
71581
|
}
|
|
70942
71582
|
function parse255(str) {
|
|
70943
71583
|
const int = Number.parseInt(str, 10);
|
|
@@ -71001,25 +71641,25 @@ function parseModernAlpha(str) {
|
|
|
71001
71641
|
}
|
|
71002
71642
|
return Math.max(0, Math.min(1, Number.parseFloat(str)));
|
|
71003
71643
|
}
|
|
71004
|
-
function linearToSrgb(
|
|
71005
|
-
if (
|
|
71006
|
-
return 12.92 *
|
|
71007
|
-
return 1.055 *
|
|
71644
|
+
function linearToSrgb(c2) {
|
|
71645
|
+
if (c2 <= 0.0031308)
|
|
71646
|
+
return 12.92 * c2;
|
|
71647
|
+
return 1.055 * c2 ** (1 / 2.4) - 0.055;
|
|
71008
71648
|
}
|
|
71009
71649
|
function clamp01(v) {
|
|
71010
71650
|
return Math.max(0, Math.min(1, v));
|
|
71011
71651
|
}
|
|
71012
|
-
function rgbFloatToInt(r, g,
|
|
71652
|
+
function rgbFloatToInt(r, g, b2, alpha) {
|
|
71013
71653
|
const ri = Math.round(clamp01(r) * 255);
|
|
71014
71654
|
const gi = Math.round(clamp01(g) * 255);
|
|
71015
|
-
const bi = Math.round(clamp01(
|
|
71655
|
+
const bi = Math.round(clamp01(b2) * 255);
|
|
71016
71656
|
const ai = Math.round(clamp01(alpha) * 255);
|
|
71017
71657
|
return (ri << 24 | gi << 16 | bi << 8 | ai) >>> 0;
|
|
71018
71658
|
}
|
|
71019
|
-
function oklabToSrgb(L,
|
|
71020
|
-
const l_ = L + 0.3963377774 *
|
|
71021
|
-
const m_ = L - 0.1055613458 *
|
|
71022
|
-
const s_ = L - 0.0894841775 *
|
|
71659
|
+
function oklabToSrgb(L, a2, b2) {
|
|
71660
|
+
const l_ = L + 0.3963377774 * a2 + 0.2158037573 * b2;
|
|
71661
|
+
const m_ = L - 0.1055613458 * a2 - 0.0638541728 * b2;
|
|
71662
|
+
const s_ = L - 0.0894841775 * a2 - 1.291485548 * b2;
|
|
71023
71663
|
const l = l_ * l_ * l_;
|
|
71024
71664
|
const m = m_ * m_ * m_;
|
|
71025
71665
|
const s = s_ * s_ * s_;
|
|
@@ -71028,15 +71668,15 @@ function oklabToSrgb(L, a, b) {
|
|
|
71028
71668
|
const bLin = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
|
|
71029
71669
|
return [linearToSrgb(rLin), linearToSrgb(gLin), linearToSrgb(bLin)];
|
|
71030
71670
|
}
|
|
71031
|
-
function labToSrgb(L,
|
|
71671
|
+
function labToSrgb(L, a2, b2) {
|
|
71032
71672
|
const epsilon = 216 / 24389;
|
|
71033
71673
|
const kappa = 24389 / 27;
|
|
71034
71674
|
const Xn = 0.95047;
|
|
71035
71675
|
const Yn = 1;
|
|
71036
71676
|
const Zn = 1.08883;
|
|
71037
71677
|
const fy = (L + 16) / 116;
|
|
71038
|
-
const fx =
|
|
71039
|
-
const fz = fy -
|
|
71678
|
+
const fx = a2 / 500 + fy;
|
|
71679
|
+
const fz = fy - b2 / 200;
|
|
71040
71680
|
const fx3 = fx * fx * fx;
|
|
71041
71681
|
const fz3 = fz * fz * fz;
|
|
71042
71682
|
const xr = fx3 > epsilon ? fx3 : (116 * fx - 16) / kappa;
|
|
@@ -71268,27 +71908,27 @@ function normalizeColor(color) {
|
|
|
71268
71908
|
const H = parseHueAngle(match[3]);
|
|
71269
71909
|
const alpha = parseModernAlpha(match[4]);
|
|
71270
71910
|
const hRad = H * Math.PI / 180;
|
|
71271
|
-
const [r, g,
|
|
71272
|
-
return rgbFloatToInt(r, g,
|
|
71911
|
+
const [r, g, b2] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
|
|
71912
|
+
return rgbFloatToInt(r, g, b2, alpha);
|
|
71273
71913
|
}
|
|
71274
71914
|
}
|
|
71275
71915
|
if (matchers.oklab) {
|
|
71276
71916
|
if (match = matchers.oklab.exec(color)) {
|
|
71277
71917
|
const L = parseModernComponent(match[1], 1);
|
|
71278
|
-
const
|
|
71279
|
-
const
|
|
71918
|
+
const a2 = parseModernComponent(match[2], 0.4);
|
|
71919
|
+
const b2 = parseModernComponent(match[3], 0.4);
|
|
71280
71920
|
const alpha = parseModernAlpha(match[4]);
|
|
71281
|
-
const [r, g, bl] = oklabToSrgb(L,
|
|
71921
|
+
const [r, g, bl] = oklabToSrgb(L, a2, b2);
|
|
71282
71922
|
return rgbFloatToInt(r, g, bl, alpha);
|
|
71283
71923
|
}
|
|
71284
71924
|
}
|
|
71285
71925
|
if (matchers.lab) {
|
|
71286
71926
|
if (match = matchers.lab.exec(color)) {
|
|
71287
71927
|
const L = parseModernComponent(match[1], 100);
|
|
71288
|
-
const
|
|
71289
|
-
const
|
|
71928
|
+
const a2 = parseModernComponent(match[2], 125);
|
|
71929
|
+
const b2 = parseModernComponent(match[3], 125);
|
|
71290
71930
|
const alpha = parseModernAlpha(match[4]);
|
|
71291
|
-
const [r, g, bl] = labToSrgb(L,
|
|
71931
|
+
const [r, g, bl] = labToSrgb(L, a2, b2);
|
|
71292
71932
|
return rgbFloatToInt(r, g, bl, alpha);
|
|
71293
71933
|
}
|
|
71294
71934
|
}
|
|
@@ -71367,30 +72007,6 @@ var serializeScaleValue = ([x, y, z]) => {
|
|
|
71367
72007
|
return `${normalizedX} ${normalizedY} ${normalizedZ}`;
|
|
71368
72008
|
};
|
|
71369
72009
|
var ENABLE_V5_BREAKING_CHANGES = false;
|
|
71370
|
-
var validateFrame = ({
|
|
71371
|
-
allowFloats,
|
|
71372
|
-
durationInFrames,
|
|
71373
|
-
frame
|
|
71374
|
-
}) => {
|
|
71375
|
-
if (typeof frame === "undefined") {
|
|
71376
|
-
throw new TypeError(`Argument missing for parameter "frame"`);
|
|
71377
|
-
}
|
|
71378
|
-
if (typeof frame !== "number") {
|
|
71379
|
-
throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
|
|
71380
|
-
}
|
|
71381
|
-
if (!Number.isFinite(frame)) {
|
|
71382
|
-
throw new RangeError(`Frame ${frame} is not finite`);
|
|
71383
|
-
}
|
|
71384
|
-
if (frame % 1 !== 0 && !allowFloats) {
|
|
71385
|
-
throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
|
|
71386
|
-
}
|
|
71387
|
-
if (frame < 0 && frame < -durationInFrames) {
|
|
71388
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
|
|
71389
|
-
}
|
|
71390
|
-
if (frame > durationInFrames - 1) {
|
|
71391
|
-
throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
|
|
71392
|
-
}
|
|
71393
|
-
};
|
|
71394
72010
|
var validCodecs = [
|
|
71395
72011
|
"h264",
|
|
71396
72012
|
"h265",
|
|
@@ -71462,23 +72078,6 @@ function validateDurationInFrames(durationInFrames, options) {
|
|
|
71462
72078
|
throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
|
|
71463
72079
|
}
|
|
71464
72080
|
}
|
|
71465
|
-
function validateFps(fps, location, isGif) {
|
|
71466
|
-
if (typeof fps !== "number") {
|
|
71467
|
-
throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
|
|
71468
|
-
}
|
|
71469
|
-
if (!Number.isFinite(fps)) {
|
|
71470
|
-
throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
|
|
71471
|
-
}
|
|
71472
|
-
if (isNaN(fps)) {
|
|
71473
|
-
throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
|
|
71474
|
-
}
|
|
71475
|
-
if (fps <= 0) {
|
|
71476
|
-
throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
|
|
71477
|
-
}
|
|
71478
|
-
if (isGif && fps > 50) {
|
|
71479
|
-
throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
|
|
71480
|
-
}
|
|
71481
|
-
}
|
|
71482
72081
|
var getExpectedMediaFrameUncorrected = ({
|
|
71483
72082
|
frame,
|
|
71484
72083
|
playbackRate,
|
|
@@ -71599,7 +72198,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
71599
72198
|
}
|
|
71600
72199
|
}
|
|
71601
72200
|
};
|
|
71602
|
-
var VERSION = "4.0.
|
|
72201
|
+
var VERSION = "4.0.509";
|
|
71603
72202
|
var isColorSupported = () => {
|
|
71604
72203
|
const env = process.env || {};
|
|
71605
72204
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -71768,17 +72367,17 @@ var Log = {
|
|
|
71768
72367
|
return [
|
|
71769
72368
|
options.indent ? INDENT_TOKEN : null,
|
|
71770
72369
|
options.tag ? verboseTag(options.tag) : null
|
|
71771
|
-
].filter(truthy2).concat(args.map((
|
|
72370
|
+
].filter(truthy2).concat(args.map((a2) => {
|
|
71772
72371
|
if (logLevel === "warn") {
|
|
71773
|
-
return chalk.yellow(
|
|
72372
|
+
return chalk.yellow(a2);
|
|
71774
72373
|
}
|
|
71775
72374
|
if (logLevel === "error") {
|
|
71776
|
-
return chalk.red(
|
|
72375
|
+
return chalk.red(a2);
|
|
71777
72376
|
}
|
|
71778
72377
|
if (logLevel === "verbose" || logLevel === "trace") {
|
|
71779
|
-
return chalk.gray(
|
|
72378
|
+
return chalk.gray(a2);
|
|
71780
72379
|
}
|
|
71781
|
-
return
|
|
72380
|
+
return a2;
|
|
71782
72381
|
}));
|
|
71783
72382
|
},
|
|
71784
72383
|
trace: (options, ...args) => {
|
|
@@ -72066,7 +72665,7 @@ var calculateBillingDuration = ({
|
|
|
72066
72665
|
functionsInvoked,
|
|
72067
72666
|
elapsedTimeOfUnfinishedChunks
|
|
72068
72667
|
}) => {
|
|
72069
|
-
const completedChunksDuration = timings.map((p) => Math.max(0, p.rendered - p.start) + OVERHEAD_TIME_PER_LAMBDA).reduce((
|
|
72668
|
+
const completedChunksDuration = timings.map((p) => Math.max(0, p.rendered - p.start) + OVERHEAD_TIME_PER_LAMBDA).reduce((a2, b2) => a2 + b2, 0);
|
|
72070
72669
|
const unfinished = Math.max(0, functionsInvoked - timings.length);
|
|
72071
72670
|
return completedChunksDuration + unfinished * elapsedTimeOfUnfinishedChunks;
|
|
72072
72671
|
};
|
|
@@ -72113,7 +72712,7 @@ var calculateChunkTimes = ({
|
|
|
72113
72712
|
const parsedTimings = timings;
|
|
72114
72713
|
const absoluteTime = getAbsoluteTime(parsedTimings);
|
|
72115
72714
|
if (type === "combined-time-for-cost-calculation") {
|
|
72116
|
-
const totalEncodingTimings = parsedTimings.map((p) => Math.max(0, p.rendered - p.start)).reduce((
|
|
72715
|
+
const totalEncodingTimings = parsedTimings.map((p) => Math.max(0, p.rendered - p.start)).reduce((a2, b2) => a2 + b2, 0);
|
|
72117
72716
|
return totalEncodingTimings + absoluteTime;
|
|
72118
72717
|
}
|
|
72119
72718
|
if (type === "absolute-time") {
|
|
@@ -72143,7 +72742,7 @@ var internalGetOrCreateBucket = async (params) => {
|
|
|
72143
72742
|
requestHandler: params.requestHandler
|
|
72144
72743
|
});
|
|
72145
72744
|
if (remotionBuckets.length > 1) {
|
|
72146
|
-
throw new Error(`You have multiple buckets (${remotionBuckets.map((
|
|
72745
|
+
throw new Error(`You have multiple buckets (${remotionBuckets.map((b2) => b2.name)}) in your S3 region (${params.region}) starting with "${params.providerSpecifics.getBucketPrefix()}". Please see https://remotion.dev/docs/lambda/multiple-buckets.`);
|
|
72147
72746
|
}
|
|
72148
72747
|
const { enableFolderExpiry, region } = params;
|
|
72149
72748
|
if (remotionBuckets.length === 1) {
|
|
@@ -72232,7 +72831,7 @@ var getNeedsToUpload = ({
|
|
|
72232
72831
|
}) => {
|
|
72233
72832
|
const MARGIN = 5000 + MAX_WEBHOOK_CUSTOM_DATA_SIZE;
|
|
72234
72833
|
const MAX_INLINE_PAYLOAD_SIZE = (type === "still" ? providerSpecifics.getMaxStillInlinePayloadSize() : providerSpecifics.getMaxNonInlinePayloadSizePerFunction()) - MARGIN;
|
|
72235
|
-
const sizesAlreadyUsed = sizes.reduce((
|
|
72834
|
+
const sizesAlreadyUsed = sizes.reduce((a2, b2) => a2 + b2);
|
|
72236
72835
|
if (sizesAlreadyUsed > MAX_INLINE_PAYLOAD_SIZE) {
|
|
72237
72836
|
console.warn(`Warning: The props are over ${Math.round(MAX_INLINE_PAYLOAD_SIZE / 1000)}KB (${Math.ceil(sizesAlreadyUsed / 1024)}KB) in size. Uploading them to ${providerSpecifics.serverStorageProductName()} to circumvent AWS Lambda payload size, which may lead to slowdown.`);
|
|
72238
72837
|
return true;
|
|
@@ -73116,7 +73715,7 @@ var getOverallProgress = ({
|
|
|
73116
73715
|
Boolean(invokedLambda),
|
|
73117
73716
|
Boolean(visitedServeUrl),
|
|
73118
73717
|
Boolean(gotComposition)
|
|
73119
|
-
].reduce((
|
|
73718
|
+
].reduce((a2, b2) => Number(a2) + Number(b2), 0) / 3;
|
|
73120
73719
|
return evaluationProgress * weights.evaluating + encoding * weights.encoding + invoking * weights.invoking + frames * weights.frames + combining * weights.combining;
|
|
73121
73720
|
};
|
|
73122
73721
|
var MAX_MISSING_CHUNKS = 5;
|
|
@@ -73414,7 +74013,7 @@ var getProgress = async ({
|
|
|
73414
74013
|
const allChunks = (overallProgress.chunks ?? []).length / chunkMultiplier === (renderMetadata.totalChunks ?? Infinity);
|
|
73415
74014
|
const frameCount = NoReactAPIs.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length;
|
|
73416
74015
|
const missingChunks = new Array(renderMetadata.totalChunks).fill(true).map((_, i) => i).filter((index) => {
|
|
73417
|
-
return typeof (overallProgress.chunks ?? []).find((
|
|
74016
|
+
return typeof (overallProgress.chunks ?? []).find((c2) => c2 === index) === "undefined";
|
|
73418
74017
|
});
|
|
73419
74018
|
const isBeyondTimeoutAndMissingChunks = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 && missingChunks && missingChunks.length > 0;
|
|
73420
74019
|
const isBeyondTimeoutAndHasStitchTimeout = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
|
|
@@ -75240,11 +75839,11 @@ var getRemotionBuckets = async ({
|
|
|
75240
75839
|
if (!Buckets) {
|
|
75241
75840
|
return [];
|
|
75242
75841
|
}
|
|
75243
|
-
const remotionBuckets = Buckets.filter((
|
|
75842
|
+
const remotionBuckets = Buckets.filter((b2) => {
|
|
75244
75843
|
if (forceBucketName) {
|
|
75245
|
-
return
|
|
75844
|
+
return b2.Name === forceBucketName;
|
|
75246
75845
|
}
|
|
75247
|
-
return
|
|
75846
|
+
return b2.Name?.startsWith(REMOTION_BUCKET_PREFIX);
|
|
75248
75847
|
});
|
|
75249
75848
|
const locations = await Promise.all(remotionBuckets.map(async (bucket) => {
|
|
75250
75849
|
const { region: parsedRegion } = parseBucketName(bucket.Name);
|
|
@@ -75274,7 +75873,7 @@ var getRemotionBuckets = async ({
|
|
|
75274
75873
|
name: bucket.Name,
|
|
75275
75874
|
region: locations[i]
|
|
75276
75875
|
};
|
|
75277
|
-
}).filter((
|
|
75876
|
+
}).filter((b2) => b2.region);
|
|
75278
75877
|
return bucketsWithLocation.filter((bucket) => {
|
|
75279
75878
|
return bucket.region === region;
|
|
75280
75879
|
});
|
|
@@ -76033,8 +76632,8 @@ var internalDeleteRender = async (input) => {
|
|
|
76033
76632
|
});
|
|
76034
76633
|
let totalSize = 0;
|
|
76035
76634
|
while (files.length > 0) {
|
|
76036
|
-
totalSize += files.reduce((
|
|
76037
|
-
return
|
|
76635
|
+
totalSize += files.reduce((a2, b2) => {
|
|
76636
|
+
return a2 + (b2.Size ?? 0);
|
|
76038
76637
|
}, 0);
|
|
76039
76638
|
await cleanItems({
|
|
76040
76639
|
list: files.map((f) => f.Key),
|