@remotion/lambda-client 4.0.471 → 4.0.473
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 +446 -37
- package/dist/esm/index.mjs +446 -37
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -69857,6 +69857,123 @@ 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 normalizeNumber = (value) => {
|
|
69861
|
+
return Math.round(value * 1e6) / 1e6;
|
|
69862
|
+
};
|
|
69863
|
+
var angleUnits = new Set(["deg", "rad", "grad", "turn"]);
|
|
69864
|
+
var lengthUnits = new Set([
|
|
69865
|
+
"%",
|
|
69866
|
+
"cap",
|
|
69867
|
+
"ch",
|
|
69868
|
+
"cm",
|
|
69869
|
+
"cqb",
|
|
69870
|
+
"cqh",
|
|
69871
|
+
"cqi",
|
|
69872
|
+
"cqmax",
|
|
69873
|
+
"cqmin",
|
|
69874
|
+
"cqw",
|
|
69875
|
+
"dvh",
|
|
69876
|
+
"dvw",
|
|
69877
|
+
"em",
|
|
69878
|
+
"ex",
|
|
69879
|
+
"ic",
|
|
69880
|
+
"in",
|
|
69881
|
+
"lh",
|
|
69882
|
+
"lvh",
|
|
69883
|
+
"lvw",
|
|
69884
|
+
"mm",
|
|
69885
|
+
"pc",
|
|
69886
|
+
"pt",
|
|
69887
|
+
"px",
|
|
69888
|
+
"q",
|
|
69889
|
+
"rem",
|
|
69890
|
+
"rlh",
|
|
69891
|
+
"svh",
|
|
69892
|
+
"svw",
|
|
69893
|
+
"vb",
|
|
69894
|
+
"vh",
|
|
69895
|
+
"vi",
|
|
69896
|
+
"vmax",
|
|
69897
|
+
"vmin",
|
|
69898
|
+
"vw"
|
|
69899
|
+
]);
|
|
69900
|
+
var cssNumberRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/;
|
|
69901
|
+
var stringifyNumber = (value) => {
|
|
69902
|
+
return String(normalizeNumber(value));
|
|
69903
|
+
};
|
|
69904
|
+
var parseStringInterpolationComponent = (component, value) => {
|
|
69905
|
+
const match = cssNumberRegex.exec(component);
|
|
69906
|
+
if (match === null) {
|
|
69907
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported scale, translate, or rotate value`);
|
|
69908
|
+
}
|
|
69909
|
+
const unit = match[2] ?? null;
|
|
69910
|
+
const numberValue = Number(match[1]);
|
|
69911
|
+
if (!Number.isFinite(numberValue)) {
|
|
69912
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not finite`);
|
|
69913
|
+
}
|
|
69914
|
+
if (unit === null) {
|
|
69915
|
+
return { kind: "scale", value: numberValue, unit: null };
|
|
69916
|
+
}
|
|
69917
|
+
if (angleUnits.has(unit)) {
|
|
69918
|
+
return { kind: "rotate", value: numberValue, unit };
|
|
69919
|
+
}
|
|
69920
|
+
if (lengthUnits.has(unit)) {
|
|
69921
|
+
return { kind: "translate", value: numberValue, unit };
|
|
69922
|
+
}
|
|
69923
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${unit}" is not a supported translate or rotate unit`);
|
|
69924
|
+
};
|
|
69925
|
+
var parseStringInterpolationValue = (output) => {
|
|
69926
|
+
if (typeof output === "number") {
|
|
69927
|
+
if (!Number.isFinite(output)) {
|
|
69928
|
+
throw new Error(`outputRange must contain only finite numbers, but got [${output}]`);
|
|
69929
|
+
}
|
|
69930
|
+
return {
|
|
69931
|
+
kind: "scale",
|
|
69932
|
+
values: [output, output, 1],
|
|
69933
|
+
units: [null, null, null],
|
|
69934
|
+
dimensions: 1
|
|
69935
|
+
};
|
|
69936
|
+
}
|
|
69937
|
+
const parts = output.trim().split(/\s+/);
|
|
69938
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
69939
|
+
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
69940
|
+
}
|
|
69941
|
+
const parsed = parts.map((part) => parseStringInterpolationComponent(part, output));
|
|
69942
|
+
const [{ kind }] = parsed;
|
|
69943
|
+
for (const part of parsed) {
|
|
69944
|
+
if (part.kind !== kind) {
|
|
69945
|
+
throw new TypeError(`Cannot interpolate "${output}" because it mixes ${kind} and ${part.kind} values`);
|
|
69946
|
+
}
|
|
69947
|
+
}
|
|
69948
|
+
if (kind === "scale") {
|
|
69949
|
+
const x = parsed[0].value;
|
|
69950
|
+
const y = parsed[1]?.value ?? x;
|
|
69951
|
+
const z = parsed[2]?.value ?? 1;
|
|
69952
|
+
return {
|
|
69953
|
+
kind,
|
|
69954
|
+
values: [x, y, z],
|
|
69955
|
+
units: [null, null, null],
|
|
69956
|
+
dimensions: parsed.length
|
|
69957
|
+
};
|
|
69958
|
+
}
|
|
69959
|
+
return {
|
|
69960
|
+
kind,
|
|
69961
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
69962
|
+
units: [parsed[0].unit, parsed[1]?.unit ?? null, parsed[2]?.unit ?? null],
|
|
69963
|
+
dimensions: parsed.length
|
|
69964
|
+
};
|
|
69965
|
+
};
|
|
69966
|
+
var serializeStringInterpolationValue = ({
|
|
69967
|
+
kind,
|
|
69968
|
+
values,
|
|
69969
|
+
units,
|
|
69970
|
+
dimensions
|
|
69971
|
+
}) => {
|
|
69972
|
+
if (kind === "scale") {
|
|
69973
|
+
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
69974
|
+
}
|
|
69975
|
+
return values.slice(0, dimensions).map((value, index) => `${stringifyNumber(value)}${units[index]}`).join(" ");
|
|
69976
|
+
};
|
|
69860
69977
|
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
69861
69978
|
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
69862
69979
|
let result = input;
|
|
@@ -69901,6 +70018,130 @@ function findRange(input, inputRange) {
|
|
|
69901
70018
|
}
|
|
69902
70019
|
return i - 1;
|
|
69903
70020
|
}
|
|
70021
|
+
var defaultEasing = (num) => num;
|
|
70022
|
+
var interpolateNumber = ({
|
|
70023
|
+
input,
|
|
70024
|
+
inputRange,
|
|
70025
|
+
outputRange,
|
|
70026
|
+
options
|
|
70027
|
+
}) => {
|
|
70028
|
+
if (inputRange.length === 1) {
|
|
70029
|
+
return outputRange[0];
|
|
70030
|
+
}
|
|
70031
|
+
const easingOption = options?.easing;
|
|
70032
|
+
const resolveEasingForSegment = (segmentIndex) => {
|
|
70033
|
+
if (easingOption === undefined) {
|
|
70034
|
+
return defaultEasing;
|
|
70035
|
+
}
|
|
70036
|
+
if (typeof easingOption === "function") {
|
|
70037
|
+
return easingOption;
|
|
70038
|
+
}
|
|
70039
|
+
return easingOption[segmentIndex];
|
|
70040
|
+
};
|
|
70041
|
+
let extrapolateLeft = "extend";
|
|
70042
|
+
if (options?.extrapolateLeft !== undefined) {
|
|
70043
|
+
extrapolateLeft = options.extrapolateLeft;
|
|
70044
|
+
}
|
|
70045
|
+
let extrapolateRight = "extend";
|
|
70046
|
+
if (options?.extrapolateRight !== undefined) {
|
|
70047
|
+
extrapolateRight = options.extrapolateRight;
|
|
70048
|
+
}
|
|
70049
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
70050
|
+
const range = findRange(posterizedInput, inputRange);
|
|
70051
|
+
return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
70052
|
+
easing: resolveEasingForSegment(range),
|
|
70053
|
+
extrapolateLeft,
|
|
70054
|
+
extrapolateRight
|
|
70055
|
+
});
|
|
70056
|
+
};
|
|
70057
|
+
var interpolateString = ({
|
|
70058
|
+
input,
|
|
70059
|
+
inputRange,
|
|
70060
|
+
outputRange,
|
|
70061
|
+
options
|
|
70062
|
+
}) => {
|
|
70063
|
+
const parsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
70064
|
+
const kind = parsedOutputRange[0]?.kind;
|
|
70065
|
+
if (kind === undefined) {
|
|
70066
|
+
throw new Error("outputRange must have at least 1 element");
|
|
70067
|
+
}
|
|
70068
|
+
for (const parsed of parsedOutputRange) {
|
|
70069
|
+
if (parsed.kind !== kind) {
|
|
70070
|
+
throw new TypeError(`Cannot interpolate ${kind} values with ${parsed.kind} values`);
|
|
70071
|
+
}
|
|
70072
|
+
}
|
|
70073
|
+
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
70074
|
+
const units = [
|
|
70075
|
+
null,
|
|
70076
|
+
null,
|
|
70077
|
+
null
|
|
70078
|
+
];
|
|
70079
|
+
if (kind !== "scale") {
|
|
70080
|
+
for (let axis = 0;axis < dimensions; axis++) {
|
|
70081
|
+
for (const parsed of parsedOutputRange) {
|
|
70082
|
+
const unit = parsed.units[axis];
|
|
70083
|
+
if (unit === null) {
|
|
70084
|
+
continue;
|
|
70085
|
+
}
|
|
70086
|
+
if (units[axis] === null) {
|
|
70087
|
+
units[axis] = unit;
|
|
70088
|
+
continue;
|
|
70089
|
+
}
|
|
70090
|
+
if (units[axis] !== unit) {
|
|
70091
|
+
throw new TypeError(`Cannot interpolate ${kind} values with different units on axis ${axis + 1}: ${units[axis]} and ${unit}`);
|
|
70092
|
+
}
|
|
70093
|
+
}
|
|
70094
|
+
if (units[axis] === null) {
|
|
70095
|
+
throw new TypeError(`Cannot interpolate ${kind} values because axis ${axis + 1} has no unit`);
|
|
70096
|
+
}
|
|
70097
|
+
}
|
|
70098
|
+
}
|
|
70099
|
+
return serializeStringInterpolationValue({
|
|
70100
|
+
kind,
|
|
70101
|
+
values: [0, 0, 0].map((_, axis) => interpolateNumber({
|
|
70102
|
+
input,
|
|
70103
|
+
inputRange,
|
|
70104
|
+
outputRange: parsedOutputRange.map((parsed) => parsed.values[axis]),
|
|
70105
|
+
options
|
|
70106
|
+
})),
|
|
70107
|
+
units,
|
|
70108
|
+
dimensions
|
|
70109
|
+
});
|
|
70110
|
+
};
|
|
70111
|
+
var validateTupleOutputRange = (outputRange) => {
|
|
70112
|
+
const dimensions = outputRange[0]?.length;
|
|
70113
|
+
if (dimensions === undefined) {
|
|
70114
|
+
throw new Error("outputRange must have at least 1 element");
|
|
70115
|
+
}
|
|
70116
|
+
if (dimensions === 0) {
|
|
70117
|
+
throw new TypeError("outputRange tuples must contain at least 1 number");
|
|
70118
|
+
}
|
|
70119
|
+
for (const output of outputRange) {
|
|
70120
|
+
if (output.length !== dimensions) {
|
|
70121
|
+
throw new TypeError(`outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}`);
|
|
70122
|
+
}
|
|
70123
|
+
for (const value of output) {
|
|
70124
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
70125
|
+
throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${output.join(",")}]`);
|
|
70126
|
+
}
|
|
70127
|
+
}
|
|
70128
|
+
}
|
|
70129
|
+
return dimensions;
|
|
70130
|
+
};
|
|
70131
|
+
var interpolateTuple = ({
|
|
70132
|
+
input,
|
|
70133
|
+
inputRange,
|
|
70134
|
+
outputRange,
|
|
70135
|
+
options
|
|
70136
|
+
}) => {
|
|
70137
|
+
const dimensions = validateTupleOutputRange(outputRange);
|
|
70138
|
+
return new Array(dimensions).fill(true).map((_, axis) => interpolateNumber({
|
|
70139
|
+
input,
|
|
70140
|
+
inputRange,
|
|
70141
|
+
outputRange: outputRange.map((output) => output[axis]),
|
|
70142
|
+
options
|
|
70143
|
+
}));
|
|
70144
|
+
};
|
|
69904
70145
|
function checkValidInputRange(arr) {
|
|
69905
70146
|
for (let i = 1;i < arr.length; ++i) {
|
|
69906
70147
|
if (!(arr[i] > arr[i - 1])) {
|
|
@@ -69960,42 +70201,30 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
69960
70201
|
throw new Error("inputRange (" + inputRange.length + ") and outputRange (" + outputRange.length + ") must have the same length");
|
|
69961
70202
|
}
|
|
69962
70203
|
checkInfiniteRange("inputRange", inputRange);
|
|
69963
|
-
checkInfiniteRange("outputRange", outputRange);
|
|
69964
70204
|
checkValidInputRange(inputRange);
|
|
69965
70205
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
69966
70206
|
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
69967
|
-
const easingOption = options?.easing;
|
|
69968
|
-
const defaultEasing = (num) => num;
|
|
69969
|
-
const resolveEasingForSegment = (segmentIndex) => {
|
|
69970
|
-
if (easingOption === undefined) {
|
|
69971
|
-
return defaultEasing;
|
|
69972
|
-
}
|
|
69973
|
-
if (typeof easingOption === "function") {
|
|
69974
|
-
return easingOption;
|
|
69975
|
-
}
|
|
69976
|
-
return easingOption[segmentIndex];
|
|
69977
|
-
};
|
|
69978
|
-
let extrapolateLeft = "extend";
|
|
69979
|
-
if (options?.extrapolateLeft !== undefined) {
|
|
69980
|
-
extrapolateLeft = options.extrapolateLeft;
|
|
69981
|
-
}
|
|
69982
|
-
let extrapolateRight = "extend";
|
|
69983
|
-
if (options?.extrapolateRight !== undefined) {
|
|
69984
|
-
extrapolateRight = options.extrapolateRight;
|
|
69985
|
-
}
|
|
69986
70207
|
if (typeof input !== "number") {
|
|
69987
70208
|
throw new TypeError("Cannot interpolate an input which is not a number");
|
|
69988
70209
|
}
|
|
69989
|
-
if (
|
|
69990
|
-
|
|
70210
|
+
if (!Array.isArray(outputRange)) {
|
|
70211
|
+
throw new Error("outputRange must contain only numbers");
|
|
69991
70212
|
}
|
|
69992
|
-
const
|
|
69993
|
-
|
|
69994
|
-
|
|
69995
|
-
|
|
69996
|
-
|
|
69997
|
-
|
|
69998
|
-
}
|
|
70213
|
+
const hasStringOutput = outputRange.some((output) => typeof output === "string");
|
|
70214
|
+
if (hasStringOutput) {
|
|
70215
|
+
if (!outputRange.every((output) => typeof output === "string" || typeof output === "number")) {
|
|
70216
|
+
throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
|
|
70217
|
+
}
|
|
70218
|
+
return interpolateString({ input, inputRange, outputRange, options });
|
|
70219
|
+
}
|
|
70220
|
+
if (outputRange.every((output) => Array.isArray(output))) {
|
|
70221
|
+
return interpolateTuple({ input, inputRange, outputRange, options });
|
|
70222
|
+
}
|
|
70223
|
+
if (!outputRange.every((output) => typeof output === "number")) {
|
|
70224
|
+
throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");
|
|
70225
|
+
}
|
|
70226
|
+
checkInfiniteRange("outputRange", outputRange);
|
|
70227
|
+
return interpolateNumber({ input, inputRange, outputRange, options });
|
|
69999
70228
|
}
|
|
70000
70229
|
function mulberry32(a) {
|
|
70001
70230
|
let t = a + 1831565813;
|
|
@@ -70578,6 +70807,45 @@ var proResProfileOptions = [
|
|
|
70578
70807
|
"light",
|
|
70579
70808
|
"proxy"
|
|
70580
70809
|
];
|
|
70810
|
+
var defaultScaleValue = [1, 1, 1];
|
|
70811
|
+
var parseScaleString = (value) => {
|
|
70812
|
+
const parts = value.trim().split(/\s+/);
|
|
70813
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
70814
|
+
return null;
|
|
70815
|
+
}
|
|
70816
|
+
const parsed = parts.map((part) => Number(part));
|
|
70817
|
+
if (!parsed.every((part) => Number.isFinite(part))) {
|
|
70818
|
+
return null;
|
|
70819
|
+
}
|
|
70820
|
+
const x = parsed[0];
|
|
70821
|
+
const y = parsed[1] ?? x;
|
|
70822
|
+
const z = parsed[2] ?? 1;
|
|
70823
|
+
return [x, y, z];
|
|
70824
|
+
};
|
|
70825
|
+
var parseValidScaleValue = (value) => {
|
|
70826
|
+
if (typeof value === "number") {
|
|
70827
|
+
return Number.isFinite(value) ? [value, value, 1] : null;
|
|
70828
|
+
}
|
|
70829
|
+
if (typeof value === "string") {
|
|
70830
|
+
return parseScaleString(value);
|
|
70831
|
+
}
|
|
70832
|
+
return null;
|
|
70833
|
+
};
|
|
70834
|
+
var parseScaleValue = (value) => {
|
|
70835
|
+
return parseValidScaleValue(value) ?? defaultScaleValue;
|
|
70836
|
+
};
|
|
70837
|
+
var serializeScaleValue = ([x, y, z]) => {
|
|
70838
|
+
const normalizedX = normalizeNumber(x);
|
|
70839
|
+
const normalizedY = normalizeNumber(y);
|
|
70840
|
+
const normalizedZ = normalizeNumber(z);
|
|
70841
|
+
if (normalizedX === normalizedY && normalizedZ === 1) {
|
|
70842
|
+
return normalizedX;
|
|
70843
|
+
}
|
|
70844
|
+
if (normalizedZ === 1) {
|
|
70845
|
+
return `${normalizedX} ${normalizedY}`;
|
|
70846
|
+
}
|
|
70847
|
+
return `${normalizedX} ${normalizedY} ${normalizedZ}`;
|
|
70848
|
+
};
|
|
70581
70849
|
var sequenceVisualStyleSchema = {
|
|
70582
70850
|
"style.translate": {
|
|
70583
70851
|
type: "translate",
|
|
@@ -70586,15 +70854,14 @@ var sequenceVisualStyleSchema = {
|
|
|
70586
70854
|
description: "Offset"
|
|
70587
70855
|
},
|
|
70588
70856
|
"style.scale": {
|
|
70589
|
-
type: "
|
|
70590
|
-
min: 0.05,
|
|
70857
|
+
type: "scale",
|
|
70591
70858
|
max: 100,
|
|
70592
70859
|
step: 0.01,
|
|
70593
70860
|
default: 1,
|
|
70594
70861
|
description: "Scale"
|
|
70595
70862
|
},
|
|
70596
70863
|
"style.rotate": {
|
|
70597
|
-
type: "rotation",
|
|
70864
|
+
type: "rotation-css",
|
|
70598
70865
|
step: 1,
|
|
70599
70866
|
default: "0deg",
|
|
70600
70867
|
description: "Rotation"
|
|
@@ -70605,7 +70872,8 @@ var sequenceVisualStyleSchema = {
|
|
|
70605
70872
|
max: 1,
|
|
70606
70873
|
step: 0.01,
|
|
70607
70874
|
default: 1,
|
|
70608
|
-
description: "Opacity"
|
|
70875
|
+
description: "Opacity",
|
|
70876
|
+
hiddenFromList: false
|
|
70609
70877
|
}
|
|
70610
70878
|
};
|
|
70611
70879
|
var sequencePremountSchema = {
|
|
@@ -70614,10 +70882,15 @@ var sequencePremountSchema = {
|
|
|
70614
70882
|
default: 0,
|
|
70615
70883
|
description: "Premount For",
|
|
70616
70884
|
min: 0,
|
|
70617
|
-
step: 1
|
|
70885
|
+
step: 1,
|
|
70886
|
+
hiddenFromList: false
|
|
70618
70887
|
},
|
|
70619
70888
|
postmountFor: {
|
|
70620
|
-
type: "
|
|
70889
|
+
type: "number",
|
|
70890
|
+
default: 0,
|
|
70891
|
+
min: 0,
|
|
70892
|
+
step: 1,
|
|
70893
|
+
hiddenFromList: true
|
|
70621
70894
|
},
|
|
70622
70895
|
styleWhilePremounted: {
|
|
70623
70896
|
type: "hidden"
|
|
@@ -70635,8 +70908,23 @@ var hiddenField = {
|
|
|
70635
70908
|
default: false,
|
|
70636
70909
|
description: "Hidden"
|
|
70637
70910
|
};
|
|
70911
|
+
var durationInFramesField = {
|
|
70912
|
+
type: "number",
|
|
70913
|
+
default: undefined,
|
|
70914
|
+
min: 1,
|
|
70915
|
+
step: 1,
|
|
70916
|
+
hiddenFromList: true
|
|
70917
|
+
};
|
|
70918
|
+
var fromField = {
|
|
70919
|
+
type: "number",
|
|
70920
|
+
default: 0,
|
|
70921
|
+
step: 1,
|
|
70922
|
+
hiddenFromList: true
|
|
70923
|
+
};
|
|
70638
70924
|
var sequenceSchema = {
|
|
70639
70925
|
hidden: hiddenField,
|
|
70926
|
+
from: fromField,
|
|
70927
|
+
durationInFrames: durationInFramesField,
|
|
70640
70928
|
layout: {
|
|
70641
70929
|
type: "enum",
|
|
70642
70930
|
default: "absolute-fill",
|
|
@@ -70647,6 +70935,11 @@ var sequenceSchema = {
|
|
|
70647
70935
|
}
|
|
70648
70936
|
}
|
|
70649
70937
|
};
|
|
70938
|
+
var sequenceSchemaWithoutFrom = {
|
|
70939
|
+
hidden: hiddenField,
|
|
70940
|
+
durationInFrames: durationInFramesField,
|
|
70941
|
+
layout: sequenceSchema.layout
|
|
70942
|
+
};
|
|
70650
70943
|
var sequenceSchemaDefaultLayoutNone = {
|
|
70651
70944
|
...sequenceSchema,
|
|
70652
70945
|
layout: {
|
|
@@ -70818,7 +71111,9 @@ var NoReactInternals = {
|
|
|
70818
71111
|
validateCodec,
|
|
70819
71112
|
proResProfileOptions,
|
|
70820
71113
|
findPropsToDelete,
|
|
70821
|
-
sequenceSchema
|
|
71114
|
+
sequenceSchema,
|
|
71115
|
+
parseScaleValue,
|
|
71116
|
+
serializeScaleValue
|
|
70822
71117
|
};
|
|
70823
71118
|
var COMMAND_NOT_FOUND = "Command not found";
|
|
70824
71119
|
var expiryDays = {
|
|
@@ -70884,7 +71179,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
70884
71179
|
}
|
|
70885
71180
|
}
|
|
70886
71181
|
};
|
|
70887
|
-
var VERSION = "4.0.
|
|
71182
|
+
var VERSION = "4.0.473";
|
|
70888
71183
|
var isColorSupported = () => {
|
|
70889
71184
|
const env = process.env || {};
|
|
70890
71185
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -72244,6 +72539,50 @@ var getExpectedOutName = ({
|
|
|
72244
72539
|
}
|
|
72245
72540
|
throw new TypeError("no type passed");
|
|
72246
72541
|
};
|
|
72542
|
+
var findOutputFileInBucket = async ({
|
|
72543
|
+
region,
|
|
72544
|
+
renderMetadata,
|
|
72545
|
+
bucketName,
|
|
72546
|
+
customCredentials,
|
|
72547
|
+
currentRegion,
|
|
72548
|
+
providerSpecifics,
|
|
72549
|
+
forcePathStyle,
|
|
72550
|
+
requestHandler
|
|
72551
|
+
}) => {
|
|
72552
|
+
const { renderBucketName, key } = getExpectedOutName({
|
|
72553
|
+
renderMetadata,
|
|
72554
|
+
bucketName,
|
|
72555
|
+
customCredentials,
|
|
72556
|
+
bucketNamePrefix: providerSpecifics.getBucketPrefix()
|
|
72557
|
+
});
|
|
72558
|
+
try {
|
|
72559
|
+
const metadata = await providerSpecifics.headFile({
|
|
72560
|
+
bucketName: renderBucketName,
|
|
72561
|
+
key,
|
|
72562
|
+
region,
|
|
72563
|
+
customCredentials,
|
|
72564
|
+
forcePathStyle,
|
|
72565
|
+
requestHandler
|
|
72566
|
+
});
|
|
72567
|
+
return {
|
|
72568
|
+
url: providerSpecifics.getOutputUrl({
|
|
72569
|
+
renderMetadata,
|
|
72570
|
+
bucketName,
|
|
72571
|
+
customCredentials,
|
|
72572
|
+
currentRegion
|
|
72573
|
+
}).url,
|
|
72574
|
+
sizeInBytes: metadata.ContentLength ?? null
|
|
72575
|
+
};
|
|
72576
|
+
} catch (err) {
|
|
72577
|
+
if (err.name === "NotFound") {
|
|
72578
|
+
return null;
|
|
72579
|
+
}
|
|
72580
|
+
if (err.message === "UnknownError" || err.$metadata?.httpStatusCode === 403) {
|
|
72581
|
+
throw new Error(`Unable to access item "${key}" from bucket "${renderBucketName}" ${customCredentials?.endpoint ? `(S3 Endpoint = ${customCredentials?.endpoint})` : ""} - got a 403 error when heading the file. Check your credentials and permissions. The Lambda role must have permission for both "s3:GetObject" and "s3:ListBucket" actions.`, { cause: err });
|
|
72582
|
+
}
|
|
72583
|
+
throw err;
|
|
72584
|
+
}
|
|
72585
|
+
};
|
|
72247
72586
|
var display = (accrued) => {
|
|
72248
72587
|
if (accrued < 0.001) {
|
|
72249
72588
|
return "<$0.001";
|
|
@@ -72649,6 +72988,76 @@ var getProgress = async ({
|
|
|
72649
72988
|
});
|
|
72650
72989
|
const isBeyondTimeoutAndMissingChunks = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 && missingChunks && missingChunks.length > 0;
|
|
72651
72990
|
const isBeyondTimeoutAndHasStitchTimeout = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
|
|
72991
|
+
const shouldCheckForCompletedOutput = allChunks && (isBeyondTimeoutAndHasStitchTimeout || overallProgress.combinedFrames >= frameCount && overallProgress.timeToCombine !== null);
|
|
72992
|
+
if (shouldCheckForCompletedOutput) {
|
|
72993
|
+
const outputFile = await findOutputFileInBucket({
|
|
72994
|
+
bucketName,
|
|
72995
|
+
customCredentials,
|
|
72996
|
+
renderMetadata,
|
|
72997
|
+
region,
|
|
72998
|
+
currentRegion: region,
|
|
72999
|
+
providerSpecifics,
|
|
73000
|
+
forcePathStyle,
|
|
73001
|
+
requestHandler
|
|
73002
|
+
});
|
|
73003
|
+
if (outputFile) {
|
|
73004
|
+
const outData = getExpectedOutName({
|
|
73005
|
+
renderMetadata,
|
|
73006
|
+
bucketName,
|
|
73007
|
+
customCredentials,
|
|
73008
|
+
bucketNamePrefix: providerSpecifics.getBucketPrefix()
|
|
73009
|
+
});
|
|
73010
|
+
const now = Date.now();
|
|
73011
|
+
const timeToFinishChunks = calculateChunkTimes({
|
|
73012
|
+
type: "absolute-time",
|
|
73013
|
+
timings: overallProgress.timings
|
|
73014
|
+
});
|
|
73015
|
+
return {
|
|
73016
|
+
framesRendered: frameCount,
|
|
73017
|
+
bucket: bucketName,
|
|
73018
|
+
renderSize: outputFile.sizeInBytes ?? 0,
|
|
73019
|
+
chunks: renderMetadata.totalChunks,
|
|
73020
|
+
cleanup: {
|
|
73021
|
+
doneIn: null,
|
|
73022
|
+
filesDeleted: 0,
|
|
73023
|
+
minFilesToDelete: 0
|
|
73024
|
+
},
|
|
73025
|
+
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar) : formatCostsInfo(0),
|
|
73026
|
+
currentTime: now,
|
|
73027
|
+
done: true,
|
|
73028
|
+
encodingStatus: {
|
|
73029
|
+
framesEncoded: frameCount,
|
|
73030
|
+
combinedFrames: frameCount,
|
|
73031
|
+
timeToCombine: overallProgress.timeToCombine
|
|
73032
|
+
},
|
|
73033
|
+
errors: errorExplanations,
|
|
73034
|
+
fatalErrorEncountered: false,
|
|
73035
|
+
lambdasInvoked: renderMetadata.totalChunks,
|
|
73036
|
+
outputFile: outputFile.url,
|
|
73037
|
+
renderId,
|
|
73038
|
+
timeToFinish: now - renderMetadata.startedDate,
|
|
73039
|
+
timeToFinishChunks,
|
|
73040
|
+
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
73041
|
+
overallProgress: 1,
|
|
73042
|
+
retriesInfo: overallProgress.retries ?? [],
|
|
73043
|
+
outKey: outData.key,
|
|
73044
|
+
outBucket: outData.renderBucketName,
|
|
73045
|
+
mostExpensiveFrameRanges: null,
|
|
73046
|
+
timeToEncode: overallProgress.timeToEncode,
|
|
73047
|
+
outputSizeInBytes: outputFile.sizeInBytes ?? 0,
|
|
73048
|
+
type: "success",
|
|
73049
|
+
estimatedBillingDurationInMilliseconds: priceFromBucket?.estimatedBillingDurationInMilliseconds ?? null,
|
|
73050
|
+
timeToCombine: overallProgress.timeToCombine,
|
|
73051
|
+
combinedFrames: frameCount,
|
|
73052
|
+
renderMetadata,
|
|
73053
|
+
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
73054
|
+
compositionValidated: overallProgress.compositionValidated,
|
|
73055
|
+
functionLaunched: overallProgress.functionLaunched,
|
|
73056
|
+
serveUrlOpened: overallProgress.serveUrlOpened,
|
|
73057
|
+
artifacts: overallProgress.receivedArtifact
|
|
73058
|
+
};
|
|
73059
|
+
}
|
|
73060
|
+
}
|
|
72652
73061
|
const allErrors = [
|
|
72653
73062
|
isBeyondTimeoutAndMissingChunks || isBeyondTimeoutAndHasStitchTimeout ? makeTimeoutError({
|
|
72654
73063
|
timeoutInMilliseconds,
|
package/dist/esm/index.mjs
CHANGED
|
@@ -69200,6 +69200,123 @@ var import_client_sts = __toESM(require_dist_cjs81(), 1);
|
|
|
69200
69200
|
|
|
69201
69201
|
// ../serverless-client/dist/esm/index.mjs
|
|
69202
69202
|
import * as tty from "tty";
|
|
69203
|
+
var normalizeNumber = (value) => {
|
|
69204
|
+
return Math.round(value * 1e6) / 1e6;
|
|
69205
|
+
};
|
|
69206
|
+
var angleUnits = new Set(["deg", "rad", "grad", "turn"]);
|
|
69207
|
+
var lengthUnits = new Set([
|
|
69208
|
+
"%",
|
|
69209
|
+
"cap",
|
|
69210
|
+
"ch",
|
|
69211
|
+
"cm",
|
|
69212
|
+
"cqb",
|
|
69213
|
+
"cqh",
|
|
69214
|
+
"cqi",
|
|
69215
|
+
"cqmax",
|
|
69216
|
+
"cqmin",
|
|
69217
|
+
"cqw",
|
|
69218
|
+
"dvh",
|
|
69219
|
+
"dvw",
|
|
69220
|
+
"em",
|
|
69221
|
+
"ex",
|
|
69222
|
+
"ic",
|
|
69223
|
+
"in",
|
|
69224
|
+
"lh",
|
|
69225
|
+
"lvh",
|
|
69226
|
+
"lvw",
|
|
69227
|
+
"mm",
|
|
69228
|
+
"pc",
|
|
69229
|
+
"pt",
|
|
69230
|
+
"px",
|
|
69231
|
+
"q",
|
|
69232
|
+
"rem",
|
|
69233
|
+
"rlh",
|
|
69234
|
+
"svh",
|
|
69235
|
+
"svw",
|
|
69236
|
+
"vb",
|
|
69237
|
+
"vh",
|
|
69238
|
+
"vi",
|
|
69239
|
+
"vmax",
|
|
69240
|
+
"vmin",
|
|
69241
|
+
"vw"
|
|
69242
|
+
]);
|
|
69243
|
+
var cssNumberRegex = /^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/;
|
|
69244
|
+
var stringifyNumber = (value) => {
|
|
69245
|
+
return String(normalizeNumber(value));
|
|
69246
|
+
};
|
|
69247
|
+
var parseStringInterpolationComponent = (component, value) => {
|
|
69248
|
+
const match = cssNumberRegex.exec(component);
|
|
69249
|
+
if (match === null) {
|
|
69250
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported scale, translate, or rotate value`);
|
|
69251
|
+
}
|
|
69252
|
+
const unit = match[2] ?? null;
|
|
69253
|
+
const numberValue = Number(match[1]);
|
|
69254
|
+
if (!Number.isFinite(numberValue)) {
|
|
69255
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not finite`);
|
|
69256
|
+
}
|
|
69257
|
+
if (unit === null) {
|
|
69258
|
+
return { kind: "scale", value: numberValue, unit: null };
|
|
69259
|
+
}
|
|
69260
|
+
if (angleUnits.has(unit)) {
|
|
69261
|
+
return { kind: "rotate", value: numberValue, unit };
|
|
69262
|
+
}
|
|
69263
|
+
if (lengthUnits.has(unit)) {
|
|
69264
|
+
return { kind: "translate", value: numberValue, unit };
|
|
69265
|
+
}
|
|
69266
|
+
throw new TypeError(`Cannot interpolate "${value}" because "${unit}" is not a supported translate or rotate unit`);
|
|
69267
|
+
};
|
|
69268
|
+
var parseStringInterpolationValue = (output) => {
|
|
69269
|
+
if (typeof output === "number") {
|
|
69270
|
+
if (!Number.isFinite(output)) {
|
|
69271
|
+
throw new Error(`outputRange must contain only finite numbers, but got [${output}]`);
|
|
69272
|
+
}
|
|
69273
|
+
return {
|
|
69274
|
+
kind: "scale",
|
|
69275
|
+
values: [output, output, 1],
|
|
69276
|
+
units: [null, null, null],
|
|
69277
|
+
dimensions: 1
|
|
69278
|
+
};
|
|
69279
|
+
}
|
|
69280
|
+
const parts = output.trim().split(/\s+/);
|
|
69281
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
69282
|
+
throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${output}"`);
|
|
69283
|
+
}
|
|
69284
|
+
const parsed = parts.map((part) => parseStringInterpolationComponent(part, output));
|
|
69285
|
+
const [{ kind }] = parsed;
|
|
69286
|
+
for (const part of parsed) {
|
|
69287
|
+
if (part.kind !== kind) {
|
|
69288
|
+
throw new TypeError(`Cannot interpolate "${output}" because it mixes ${kind} and ${part.kind} values`);
|
|
69289
|
+
}
|
|
69290
|
+
}
|
|
69291
|
+
if (kind === "scale") {
|
|
69292
|
+
const x = parsed[0].value;
|
|
69293
|
+
const y = parsed[1]?.value ?? x;
|
|
69294
|
+
const z = parsed[2]?.value ?? 1;
|
|
69295
|
+
return {
|
|
69296
|
+
kind,
|
|
69297
|
+
values: [x, y, z],
|
|
69298
|
+
units: [null, null, null],
|
|
69299
|
+
dimensions: parsed.length
|
|
69300
|
+
};
|
|
69301
|
+
}
|
|
69302
|
+
return {
|
|
69303
|
+
kind,
|
|
69304
|
+
values: [parsed[0].value, parsed[1]?.value ?? 0, parsed[2]?.value ?? 0],
|
|
69305
|
+
units: [parsed[0].unit, parsed[1]?.unit ?? null, parsed[2]?.unit ?? null],
|
|
69306
|
+
dimensions: parsed.length
|
|
69307
|
+
};
|
|
69308
|
+
};
|
|
69309
|
+
var serializeStringInterpolationValue = ({
|
|
69310
|
+
kind,
|
|
69311
|
+
values,
|
|
69312
|
+
units,
|
|
69313
|
+
dimensions
|
|
69314
|
+
}) => {
|
|
69315
|
+
if (kind === "scale") {
|
|
69316
|
+
return values.slice(0, dimensions).map((value) => stringifyNumber(value)).join(" ");
|
|
69317
|
+
}
|
|
69318
|
+
return values.slice(0, dimensions).map((value, index) => `${stringifyNumber(value)}${units[index]}`).join(" ");
|
|
69319
|
+
};
|
|
69203
69320
|
function interpolateFunction(input, inputRange, outputRange, options) {
|
|
69204
69321
|
const { extrapolateLeft, extrapolateRight, easing } = options;
|
|
69205
69322
|
let result = input;
|
|
@@ -69244,6 +69361,130 @@ function findRange(input, inputRange) {
|
|
|
69244
69361
|
}
|
|
69245
69362
|
return i - 1;
|
|
69246
69363
|
}
|
|
69364
|
+
var defaultEasing = (num) => num;
|
|
69365
|
+
var interpolateNumber = ({
|
|
69366
|
+
input,
|
|
69367
|
+
inputRange,
|
|
69368
|
+
outputRange,
|
|
69369
|
+
options
|
|
69370
|
+
}) => {
|
|
69371
|
+
if (inputRange.length === 1) {
|
|
69372
|
+
return outputRange[0];
|
|
69373
|
+
}
|
|
69374
|
+
const easingOption = options?.easing;
|
|
69375
|
+
const resolveEasingForSegment = (segmentIndex) => {
|
|
69376
|
+
if (easingOption === undefined) {
|
|
69377
|
+
return defaultEasing;
|
|
69378
|
+
}
|
|
69379
|
+
if (typeof easingOption === "function") {
|
|
69380
|
+
return easingOption;
|
|
69381
|
+
}
|
|
69382
|
+
return easingOption[segmentIndex];
|
|
69383
|
+
};
|
|
69384
|
+
let extrapolateLeft = "extend";
|
|
69385
|
+
if (options?.extrapolateLeft !== undefined) {
|
|
69386
|
+
extrapolateLeft = options.extrapolateLeft;
|
|
69387
|
+
}
|
|
69388
|
+
let extrapolateRight = "extend";
|
|
69389
|
+
if (options?.extrapolateRight !== undefined) {
|
|
69390
|
+
extrapolateRight = options.extrapolateRight;
|
|
69391
|
+
}
|
|
69392
|
+
const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
|
|
69393
|
+
const range = findRange(posterizedInput, inputRange);
|
|
69394
|
+
return interpolateFunction(posterizedInput, [inputRange[range], inputRange[range + 1]], [outputRange[range], outputRange[range + 1]], {
|
|
69395
|
+
easing: resolveEasingForSegment(range),
|
|
69396
|
+
extrapolateLeft,
|
|
69397
|
+
extrapolateRight
|
|
69398
|
+
});
|
|
69399
|
+
};
|
|
69400
|
+
var interpolateString = ({
|
|
69401
|
+
input,
|
|
69402
|
+
inputRange,
|
|
69403
|
+
outputRange,
|
|
69404
|
+
options
|
|
69405
|
+
}) => {
|
|
69406
|
+
const parsedOutputRange = outputRange.map(parseStringInterpolationValue);
|
|
69407
|
+
const kind = parsedOutputRange[0]?.kind;
|
|
69408
|
+
if (kind === undefined) {
|
|
69409
|
+
throw new Error("outputRange must have at least 1 element");
|
|
69410
|
+
}
|
|
69411
|
+
for (const parsed of parsedOutputRange) {
|
|
69412
|
+
if (parsed.kind !== kind) {
|
|
69413
|
+
throw new TypeError(`Cannot interpolate ${kind} values with ${parsed.kind} values`);
|
|
69414
|
+
}
|
|
69415
|
+
}
|
|
69416
|
+
const dimensions = Math.max(...parsedOutputRange.map((parsed) => parsed.dimensions));
|
|
69417
|
+
const units = [
|
|
69418
|
+
null,
|
|
69419
|
+
null,
|
|
69420
|
+
null
|
|
69421
|
+
];
|
|
69422
|
+
if (kind !== "scale") {
|
|
69423
|
+
for (let axis = 0;axis < dimensions; axis++) {
|
|
69424
|
+
for (const parsed of parsedOutputRange) {
|
|
69425
|
+
const unit = parsed.units[axis];
|
|
69426
|
+
if (unit === null) {
|
|
69427
|
+
continue;
|
|
69428
|
+
}
|
|
69429
|
+
if (units[axis] === null) {
|
|
69430
|
+
units[axis] = unit;
|
|
69431
|
+
continue;
|
|
69432
|
+
}
|
|
69433
|
+
if (units[axis] !== unit) {
|
|
69434
|
+
throw new TypeError(`Cannot interpolate ${kind} values with different units on axis ${axis + 1}: ${units[axis]} and ${unit}`);
|
|
69435
|
+
}
|
|
69436
|
+
}
|
|
69437
|
+
if (units[axis] === null) {
|
|
69438
|
+
throw new TypeError(`Cannot interpolate ${kind} values because axis ${axis + 1} has no unit`);
|
|
69439
|
+
}
|
|
69440
|
+
}
|
|
69441
|
+
}
|
|
69442
|
+
return serializeStringInterpolationValue({
|
|
69443
|
+
kind,
|
|
69444
|
+
values: [0, 0, 0].map((_, axis) => interpolateNumber({
|
|
69445
|
+
input,
|
|
69446
|
+
inputRange,
|
|
69447
|
+
outputRange: parsedOutputRange.map((parsed) => parsed.values[axis]),
|
|
69448
|
+
options
|
|
69449
|
+
})),
|
|
69450
|
+
units,
|
|
69451
|
+
dimensions
|
|
69452
|
+
});
|
|
69453
|
+
};
|
|
69454
|
+
var validateTupleOutputRange = (outputRange) => {
|
|
69455
|
+
const dimensions = outputRange[0]?.length;
|
|
69456
|
+
if (dimensions === undefined) {
|
|
69457
|
+
throw new Error("outputRange must have at least 1 element");
|
|
69458
|
+
}
|
|
69459
|
+
if (dimensions === 0) {
|
|
69460
|
+
throw new TypeError("outputRange tuples must contain at least 1 number");
|
|
69461
|
+
}
|
|
69462
|
+
for (const output of outputRange) {
|
|
69463
|
+
if (output.length !== dimensions) {
|
|
69464
|
+
throw new TypeError(`outputRange tuples must all have the same length, but got ${dimensions} and ${output.length}`);
|
|
69465
|
+
}
|
|
69466
|
+
for (const value of output) {
|
|
69467
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
69468
|
+
throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${output.join(",")}]`);
|
|
69469
|
+
}
|
|
69470
|
+
}
|
|
69471
|
+
}
|
|
69472
|
+
return dimensions;
|
|
69473
|
+
};
|
|
69474
|
+
var interpolateTuple = ({
|
|
69475
|
+
input,
|
|
69476
|
+
inputRange,
|
|
69477
|
+
outputRange,
|
|
69478
|
+
options
|
|
69479
|
+
}) => {
|
|
69480
|
+
const dimensions = validateTupleOutputRange(outputRange);
|
|
69481
|
+
return new Array(dimensions).fill(true).map((_, axis) => interpolateNumber({
|
|
69482
|
+
input,
|
|
69483
|
+
inputRange,
|
|
69484
|
+
outputRange: outputRange.map((output) => output[axis]),
|
|
69485
|
+
options
|
|
69486
|
+
}));
|
|
69487
|
+
};
|
|
69247
69488
|
function checkValidInputRange(arr) {
|
|
69248
69489
|
for (let i = 1;i < arr.length; ++i) {
|
|
69249
69490
|
if (!(arr[i] > arr[i - 1])) {
|
|
@@ -69303,42 +69544,30 @@ function interpolate(input, inputRange, outputRange, options) {
|
|
|
69303
69544
|
throw new Error("inputRange (" + inputRange.length + ") and outputRange (" + outputRange.length + ") must have the same length");
|
|
69304
69545
|
}
|
|
69305
69546
|
checkInfiniteRange("inputRange", inputRange);
|
|
69306
|
-
checkInfiniteRange("outputRange", outputRange);
|
|
69307
69547
|
checkValidInputRange(inputRange);
|
|
69308
69548
|
assertValidInterpolateEasingOption(options?.easing, inputRange.length);
|
|
69309
69549
|
assertValidInterpolatePosterizeOption(options?.posterize);
|
|
69310
|
-
const easingOption = options?.easing;
|
|
69311
|
-
const defaultEasing = (num) => num;
|
|
69312
|
-
const resolveEasingForSegment = (segmentIndex) => {
|
|
69313
|
-
if (easingOption === undefined) {
|
|
69314
|
-
return defaultEasing;
|
|
69315
|
-
}
|
|
69316
|
-
if (typeof easingOption === "function") {
|
|
69317
|
-
return easingOption;
|
|
69318
|
-
}
|
|
69319
|
-
return easingOption[segmentIndex];
|
|
69320
|
-
};
|
|
69321
|
-
let extrapolateLeft = "extend";
|
|
69322
|
-
if (options?.extrapolateLeft !== undefined) {
|
|
69323
|
-
extrapolateLeft = options.extrapolateLeft;
|
|
69324
|
-
}
|
|
69325
|
-
let extrapolateRight = "extend";
|
|
69326
|
-
if (options?.extrapolateRight !== undefined) {
|
|
69327
|
-
extrapolateRight = options.extrapolateRight;
|
|
69328
|
-
}
|
|
69329
69550
|
if (typeof input !== "number") {
|
|
69330
69551
|
throw new TypeError("Cannot interpolate an input which is not a number");
|
|
69331
69552
|
}
|
|
69332
|
-
if (
|
|
69333
|
-
|
|
69553
|
+
if (!Array.isArray(outputRange)) {
|
|
69554
|
+
throw new Error("outputRange must contain only numbers");
|
|
69334
69555
|
}
|
|
69335
|
-
const
|
|
69336
|
-
|
|
69337
|
-
|
|
69338
|
-
|
|
69339
|
-
|
|
69340
|
-
|
|
69341
|
-
}
|
|
69556
|
+
const hasStringOutput = outputRange.some((output) => typeof output === "string");
|
|
69557
|
+
if (hasStringOutput) {
|
|
69558
|
+
if (!outputRange.every((output) => typeof output === "string" || typeof output === "number")) {
|
|
69559
|
+
throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
|
|
69560
|
+
}
|
|
69561
|
+
return interpolateString({ input, inputRange, outputRange, options });
|
|
69562
|
+
}
|
|
69563
|
+
if (outputRange.every((output) => Array.isArray(output))) {
|
|
69564
|
+
return interpolateTuple({ input, inputRange, outputRange, options });
|
|
69565
|
+
}
|
|
69566
|
+
if (!outputRange.every((output) => typeof output === "number")) {
|
|
69567
|
+
throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");
|
|
69568
|
+
}
|
|
69569
|
+
checkInfiniteRange("outputRange", outputRange);
|
|
69570
|
+
return interpolateNumber({ input, inputRange, outputRange, options });
|
|
69342
69571
|
}
|
|
69343
69572
|
function mulberry32(a) {
|
|
69344
69573
|
let t = a + 1831565813;
|
|
@@ -69921,6 +70150,45 @@ var proResProfileOptions = [
|
|
|
69921
70150
|
"light",
|
|
69922
70151
|
"proxy"
|
|
69923
70152
|
];
|
|
70153
|
+
var defaultScaleValue = [1, 1, 1];
|
|
70154
|
+
var parseScaleString = (value) => {
|
|
70155
|
+
const parts = value.trim().split(/\s+/);
|
|
70156
|
+
if (parts.length < 1 || parts.length > 3 || parts[0] === "") {
|
|
70157
|
+
return null;
|
|
70158
|
+
}
|
|
70159
|
+
const parsed = parts.map((part) => Number(part));
|
|
70160
|
+
if (!parsed.every((part) => Number.isFinite(part))) {
|
|
70161
|
+
return null;
|
|
70162
|
+
}
|
|
70163
|
+
const x = parsed[0];
|
|
70164
|
+
const y = parsed[1] ?? x;
|
|
70165
|
+
const z = parsed[2] ?? 1;
|
|
70166
|
+
return [x, y, z];
|
|
70167
|
+
};
|
|
70168
|
+
var parseValidScaleValue = (value) => {
|
|
70169
|
+
if (typeof value === "number") {
|
|
70170
|
+
return Number.isFinite(value) ? [value, value, 1] : null;
|
|
70171
|
+
}
|
|
70172
|
+
if (typeof value === "string") {
|
|
70173
|
+
return parseScaleString(value);
|
|
70174
|
+
}
|
|
70175
|
+
return null;
|
|
70176
|
+
};
|
|
70177
|
+
var parseScaleValue = (value) => {
|
|
70178
|
+
return parseValidScaleValue(value) ?? defaultScaleValue;
|
|
70179
|
+
};
|
|
70180
|
+
var serializeScaleValue = ([x, y, z]) => {
|
|
70181
|
+
const normalizedX = normalizeNumber(x);
|
|
70182
|
+
const normalizedY = normalizeNumber(y);
|
|
70183
|
+
const normalizedZ = normalizeNumber(z);
|
|
70184
|
+
if (normalizedX === normalizedY && normalizedZ === 1) {
|
|
70185
|
+
return normalizedX;
|
|
70186
|
+
}
|
|
70187
|
+
if (normalizedZ === 1) {
|
|
70188
|
+
return `${normalizedX} ${normalizedY}`;
|
|
70189
|
+
}
|
|
70190
|
+
return `${normalizedX} ${normalizedY} ${normalizedZ}`;
|
|
70191
|
+
};
|
|
69924
70192
|
var sequenceVisualStyleSchema = {
|
|
69925
70193
|
"style.translate": {
|
|
69926
70194
|
type: "translate",
|
|
@@ -69929,15 +70197,14 @@ var sequenceVisualStyleSchema = {
|
|
|
69929
70197
|
description: "Offset"
|
|
69930
70198
|
},
|
|
69931
70199
|
"style.scale": {
|
|
69932
|
-
type: "
|
|
69933
|
-
min: 0.05,
|
|
70200
|
+
type: "scale",
|
|
69934
70201
|
max: 100,
|
|
69935
70202
|
step: 0.01,
|
|
69936
70203
|
default: 1,
|
|
69937
70204
|
description: "Scale"
|
|
69938
70205
|
},
|
|
69939
70206
|
"style.rotate": {
|
|
69940
|
-
type: "rotation",
|
|
70207
|
+
type: "rotation-css",
|
|
69941
70208
|
step: 1,
|
|
69942
70209
|
default: "0deg",
|
|
69943
70210
|
description: "Rotation"
|
|
@@ -69948,7 +70215,8 @@ var sequenceVisualStyleSchema = {
|
|
|
69948
70215
|
max: 1,
|
|
69949
70216
|
step: 0.01,
|
|
69950
70217
|
default: 1,
|
|
69951
|
-
description: "Opacity"
|
|
70218
|
+
description: "Opacity",
|
|
70219
|
+
hiddenFromList: false
|
|
69952
70220
|
}
|
|
69953
70221
|
};
|
|
69954
70222
|
var sequencePremountSchema = {
|
|
@@ -69957,10 +70225,15 @@ var sequencePremountSchema = {
|
|
|
69957
70225
|
default: 0,
|
|
69958
70226
|
description: "Premount For",
|
|
69959
70227
|
min: 0,
|
|
69960
|
-
step: 1
|
|
70228
|
+
step: 1,
|
|
70229
|
+
hiddenFromList: false
|
|
69961
70230
|
},
|
|
69962
70231
|
postmountFor: {
|
|
69963
|
-
type: "
|
|
70232
|
+
type: "number",
|
|
70233
|
+
default: 0,
|
|
70234
|
+
min: 0,
|
|
70235
|
+
step: 1,
|
|
70236
|
+
hiddenFromList: true
|
|
69964
70237
|
},
|
|
69965
70238
|
styleWhilePremounted: {
|
|
69966
70239
|
type: "hidden"
|
|
@@ -69978,8 +70251,23 @@ var hiddenField = {
|
|
|
69978
70251
|
default: false,
|
|
69979
70252
|
description: "Hidden"
|
|
69980
70253
|
};
|
|
70254
|
+
var durationInFramesField = {
|
|
70255
|
+
type: "number",
|
|
70256
|
+
default: undefined,
|
|
70257
|
+
min: 1,
|
|
70258
|
+
step: 1,
|
|
70259
|
+
hiddenFromList: true
|
|
70260
|
+
};
|
|
70261
|
+
var fromField = {
|
|
70262
|
+
type: "number",
|
|
70263
|
+
default: 0,
|
|
70264
|
+
step: 1,
|
|
70265
|
+
hiddenFromList: true
|
|
70266
|
+
};
|
|
69981
70267
|
var sequenceSchema = {
|
|
69982
70268
|
hidden: hiddenField,
|
|
70269
|
+
from: fromField,
|
|
70270
|
+
durationInFrames: durationInFramesField,
|
|
69983
70271
|
layout: {
|
|
69984
70272
|
type: "enum",
|
|
69985
70273
|
default: "absolute-fill",
|
|
@@ -69990,6 +70278,11 @@ var sequenceSchema = {
|
|
|
69990
70278
|
}
|
|
69991
70279
|
}
|
|
69992
70280
|
};
|
|
70281
|
+
var sequenceSchemaWithoutFrom = {
|
|
70282
|
+
hidden: hiddenField,
|
|
70283
|
+
durationInFrames: durationInFramesField,
|
|
70284
|
+
layout: sequenceSchema.layout
|
|
70285
|
+
};
|
|
69993
70286
|
var sequenceSchemaDefaultLayoutNone = {
|
|
69994
70287
|
...sequenceSchema,
|
|
69995
70288
|
layout: {
|
|
@@ -70161,7 +70454,9 @@ var NoReactInternals = {
|
|
|
70161
70454
|
validateCodec,
|
|
70162
70455
|
proResProfileOptions,
|
|
70163
70456
|
findPropsToDelete,
|
|
70164
|
-
sequenceSchema
|
|
70457
|
+
sequenceSchema,
|
|
70458
|
+
parseScaleValue,
|
|
70459
|
+
serializeScaleValue
|
|
70165
70460
|
};
|
|
70166
70461
|
var COMMAND_NOT_FOUND = "Command not found";
|
|
70167
70462
|
var expiryDays = {
|
|
@@ -70227,7 +70522,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
|
|
|
70227
70522
|
}
|
|
70228
70523
|
}
|
|
70229
70524
|
};
|
|
70230
|
-
var VERSION = "4.0.
|
|
70525
|
+
var VERSION = "4.0.473";
|
|
70231
70526
|
var isColorSupported = () => {
|
|
70232
70527
|
const env = process.env || {};
|
|
70233
70528
|
const isForceDisabled = "NO_COLOR" in env;
|
|
@@ -71587,6 +71882,50 @@ var getExpectedOutName = ({
|
|
|
71587
71882
|
}
|
|
71588
71883
|
throw new TypeError("no type passed");
|
|
71589
71884
|
};
|
|
71885
|
+
var findOutputFileInBucket = async ({
|
|
71886
|
+
region,
|
|
71887
|
+
renderMetadata,
|
|
71888
|
+
bucketName,
|
|
71889
|
+
customCredentials,
|
|
71890
|
+
currentRegion,
|
|
71891
|
+
providerSpecifics,
|
|
71892
|
+
forcePathStyle,
|
|
71893
|
+
requestHandler
|
|
71894
|
+
}) => {
|
|
71895
|
+
const { renderBucketName, key } = getExpectedOutName({
|
|
71896
|
+
renderMetadata,
|
|
71897
|
+
bucketName,
|
|
71898
|
+
customCredentials,
|
|
71899
|
+
bucketNamePrefix: providerSpecifics.getBucketPrefix()
|
|
71900
|
+
});
|
|
71901
|
+
try {
|
|
71902
|
+
const metadata = await providerSpecifics.headFile({
|
|
71903
|
+
bucketName: renderBucketName,
|
|
71904
|
+
key,
|
|
71905
|
+
region,
|
|
71906
|
+
customCredentials,
|
|
71907
|
+
forcePathStyle,
|
|
71908
|
+
requestHandler
|
|
71909
|
+
});
|
|
71910
|
+
return {
|
|
71911
|
+
url: providerSpecifics.getOutputUrl({
|
|
71912
|
+
renderMetadata,
|
|
71913
|
+
bucketName,
|
|
71914
|
+
customCredentials,
|
|
71915
|
+
currentRegion
|
|
71916
|
+
}).url,
|
|
71917
|
+
sizeInBytes: metadata.ContentLength ?? null
|
|
71918
|
+
};
|
|
71919
|
+
} catch (err) {
|
|
71920
|
+
if (err.name === "NotFound") {
|
|
71921
|
+
return null;
|
|
71922
|
+
}
|
|
71923
|
+
if (err.message === "UnknownError" || err.$metadata?.httpStatusCode === 403) {
|
|
71924
|
+
throw new Error(`Unable to access item "${key}" from bucket "${renderBucketName}" ${customCredentials?.endpoint ? `(S3 Endpoint = ${customCredentials?.endpoint})` : ""} - got a 403 error when heading the file. Check your credentials and permissions. The Lambda role must have permission for both "s3:GetObject" and "s3:ListBucket" actions.`, { cause: err });
|
|
71925
|
+
}
|
|
71926
|
+
throw err;
|
|
71927
|
+
}
|
|
71928
|
+
};
|
|
71590
71929
|
var display = (accrued) => {
|
|
71591
71930
|
if (accrued < 0.001) {
|
|
71592
71931
|
return "<$0.001";
|
|
@@ -71992,6 +72331,76 @@ var getProgress = async ({
|
|
|
71992
72331
|
});
|
|
71993
72332
|
const isBeyondTimeoutAndMissingChunks = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 && missingChunks && missingChunks.length > 0;
|
|
71994
72333
|
const isBeyondTimeoutAndHasStitchTimeout = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
|
|
72334
|
+
const shouldCheckForCompletedOutput = allChunks && (isBeyondTimeoutAndHasStitchTimeout || overallProgress.combinedFrames >= frameCount && overallProgress.timeToCombine !== null);
|
|
72335
|
+
if (shouldCheckForCompletedOutput) {
|
|
72336
|
+
const outputFile = await findOutputFileInBucket({
|
|
72337
|
+
bucketName,
|
|
72338
|
+
customCredentials,
|
|
72339
|
+
renderMetadata,
|
|
72340
|
+
region,
|
|
72341
|
+
currentRegion: region,
|
|
72342
|
+
providerSpecifics,
|
|
72343
|
+
forcePathStyle,
|
|
72344
|
+
requestHandler
|
|
72345
|
+
});
|
|
72346
|
+
if (outputFile) {
|
|
72347
|
+
const outData = getExpectedOutName({
|
|
72348
|
+
renderMetadata,
|
|
72349
|
+
bucketName,
|
|
72350
|
+
customCredentials,
|
|
72351
|
+
bucketNamePrefix: providerSpecifics.getBucketPrefix()
|
|
72352
|
+
});
|
|
72353
|
+
const now = Date.now();
|
|
72354
|
+
const timeToFinishChunks = calculateChunkTimes({
|
|
72355
|
+
type: "absolute-time",
|
|
72356
|
+
timings: overallProgress.timings
|
|
72357
|
+
});
|
|
72358
|
+
return {
|
|
72359
|
+
framesRendered: frameCount,
|
|
72360
|
+
bucket: bucketName,
|
|
72361
|
+
renderSize: outputFile.sizeInBytes ?? 0,
|
|
72362
|
+
chunks: renderMetadata.totalChunks,
|
|
72363
|
+
cleanup: {
|
|
72364
|
+
doneIn: null,
|
|
72365
|
+
filesDeleted: 0,
|
|
72366
|
+
minFilesToDelete: 0
|
|
72367
|
+
},
|
|
72368
|
+
costs: priceFromBucket ? formatCostsInfo(priceFromBucket.accruedSoFar) : formatCostsInfo(0),
|
|
72369
|
+
currentTime: now,
|
|
72370
|
+
done: true,
|
|
72371
|
+
encodingStatus: {
|
|
72372
|
+
framesEncoded: frameCount,
|
|
72373
|
+
combinedFrames: frameCount,
|
|
72374
|
+
timeToCombine: overallProgress.timeToCombine
|
|
72375
|
+
},
|
|
72376
|
+
errors: errorExplanations,
|
|
72377
|
+
fatalErrorEncountered: false,
|
|
72378
|
+
lambdasInvoked: renderMetadata.totalChunks,
|
|
72379
|
+
outputFile: outputFile.url,
|
|
72380
|
+
renderId,
|
|
72381
|
+
timeToFinish: now - renderMetadata.startedDate,
|
|
72382
|
+
timeToFinishChunks,
|
|
72383
|
+
timeToRenderFrames: overallProgress.timeToRenderFrames,
|
|
72384
|
+
overallProgress: 1,
|
|
72385
|
+
retriesInfo: overallProgress.retries ?? [],
|
|
72386
|
+
outKey: outData.key,
|
|
72387
|
+
outBucket: outData.renderBucketName,
|
|
72388
|
+
mostExpensiveFrameRanges: null,
|
|
72389
|
+
timeToEncode: overallProgress.timeToEncode,
|
|
72390
|
+
outputSizeInBytes: outputFile.sizeInBytes ?? 0,
|
|
72391
|
+
type: "success",
|
|
72392
|
+
estimatedBillingDurationInMilliseconds: priceFromBucket?.estimatedBillingDurationInMilliseconds ?? null,
|
|
72393
|
+
timeToCombine: overallProgress.timeToCombine,
|
|
72394
|
+
combinedFrames: frameCount,
|
|
72395
|
+
renderMetadata,
|
|
72396
|
+
timeoutTimestamp: overallProgress.timeoutTimestamp,
|
|
72397
|
+
compositionValidated: overallProgress.compositionValidated,
|
|
72398
|
+
functionLaunched: overallProgress.functionLaunched,
|
|
72399
|
+
serveUrlOpened: overallProgress.serveUrlOpened,
|
|
72400
|
+
artifacts: overallProgress.receivedArtifact
|
|
72401
|
+
};
|
|
72402
|
+
}
|
|
72403
|
+
}
|
|
71995
72404
|
const allErrors = [
|
|
71996
72405
|
isBeyondTimeoutAndMissingChunks || isBeyondTimeoutAndHasStitchTimeout ? makeTimeoutError({
|
|
71997
72406
|
timeoutInMilliseconds,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"url": "https://github.com/remotion-dev/remotion/tree/main/packages/lambda-client"
|
|
4
4
|
},
|
|
5
5
|
"name": "@remotion/lambda-client",
|
|
6
|
-
"version": "4.0.
|
|
6
|
+
"version": "4.0.473",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"formatting": "oxfmt src --check",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@aws-sdk/lib-storage": "3.986.0",
|
|
27
27
|
"mime-types": "2.1.34",
|
|
28
28
|
"@aws-sdk/credential-provider-ini": "3.972.5",
|
|
29
|
-
"@remotion/serverless-client": "4.0.
|
|
29
|
+
"@remotion/serverless-client": "4.0.473",
|
|
30
30
|
"@types/express": "5.0.1",
|
|
31
31
|
"express": "4.21.0",
|
|
32
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
32
|
+
"@remotion/eslint-config-internal": "4.0.473",
|
|
33
33
|
"eslint": "9.19.0",
|
|
34
34
|
"next": "16.2.6",
|
|
35
35
|
"@types/mime-types": "2.1.1",
|