hyperframes 0.8.82 → 0.8.84
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/backgroundChecksWorker.js +1 -1
- package/dist/cli.js +4860 -4438
- package/dist/fontLocalizeCli.js +304 -217
- package/dist/hyperframe-runtime.js +81 -56
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +81 -56
- package/dist/hyperframes-player.global.js +2 -2
- package/dist/studio/assets/{hyperframes-player-zGIbZhLJ.js → hyperframes-player-Dd74fv7B.js} +3 -3
- package/dist/studio/assets/{index-DStmfnpZ.js → index-D9dmtDap.js} +1 -1
- package/dist/studio/assets/{index-BiLCTunu.js → index-DFcIBFM8.js} +1 -1
- package/dist/studio/assets/{index-DSazIt7R.js → index-gjbSm-vt.js} +193 -193
- package/dist/studio/{chunk-I7XNAIOF.js → chunk-3IOCVWB6.js} +6 -97
- package/dist/studio/chunk-3IOCVWB6.js.map +1 -0
- package/dist/studio/chunk-62DDWOSH.js +189 -0
- package/dist/studio/chunk-62DDWOSH.js.map +1 -0
- package/dist/studio/chunk-7VDQIGOU.js +1871 -0
- package/dist/studio/chunk-7VDQIGOU.js.map +1 -0
- package/dist/studio/chunk-QZ6HNNFG.js +934 -0
- package/dist/studio/chunk-QZ6HNNFG.js.map +1 -0
- package/dist/studio/chunk-S65AQH6M.js +101 -0
- package/dist/studio/chunk-S65AQH6M.js.map +1 -0
- package/dist/studio/{domEditingLayers-MHFDKAQ7.js → domEditingLayers-ZOOMN7CQ.js} +3 -2
- package/dist/studio/index.d.ts +669 -330
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +20512 -23172
- package/dist/studio/index.js.map +1 -1
- package/dist/studio/player.d.ts +30 -0
- package/dist/studio/player.js +10 -0
- package/dist/studio/player.js.map +1 -0
- package/dist/studio/ui.d.ts +294 -0
- package/dist/studio/ui.js +66 -0
- package/dist/studio/ui.js.map +1 -0
- package/package.json +1 -1
- package/dist/studio/chunk-I7XNAIOF.js.map +0 -1
- /package/dist/studio/{domEditingLayers-MHFDKAQ7.js.map → domEditingLayers-ZOOMN7CQ.js.map} +0 -0
package/dist/fontLocalizeCli.js
CHANGED
|
@@ -3433,10 +3433,10 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
3433
3433
|
function uniqueSort(nodes) {
|
|
3434
3434
|
nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
|
|
3435
3435
|
nodes.sort((a, b) => {
|
|
3436
|
-
const
|
|
3437
|
-
if (
|
|
3436
|
+
const relative12 = compareDocumentPosition(a, b);
|
|
3437
|
+
if (relative12 & DocumentPosition.PRECEDING) {
|
|
3438
3438
|
return -1;
|
|
3439
|
-
} else if (
|
|
3439
|
+
} else if (relative12 & DocumentPosition.FOLLOWING) {
|
|
3440
3440
|
return 1;
|
|
3441
3441
|
}
|
|
3442
3442
|
return 0;
|
|
@@ -16993,7 +16993,7 @@ var require_util = __commonJS({
|
|
|
16993
16993
|
}
|
|
16994
16994
|
path = url.path;
|
|
16995
16995
|
}
|
|
16996
|
-
var
|
|
16996
|
+
var isAbsolute8 = exports.isAbsolute(path);
|
|
16997
16997
|
var parts = path.split(/\/+/);
|
|
16998
16998
|
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
16999
16999
|
part = parts[i];
|
|
@@ -17013,7 +17013,7 @@ var require_util = __commonJS({
|
|
|
17013
17013
|
}
|
|
17014
17014
|
path = parts.join("/");
|
|
17015
17015
|
if (path === "") {
|
|
17016
|
-
path =
|
|
17016
|
+
path = isAbsolute8 ? "/" : ".";
|
|
17017
17017
|
}
|
|
17018
17018
|
if (url) {
|
|
17019
17019
|
url.path = path;
|
|
@@ -17058,7 +17058,7 @@ var require_util = __commonJS({
|
|
|
17058
17058
|
exports.isAbsolute = function(aPath) {
|
|
17059
17059
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
17060
17060
|
};
|
|
17061
|
-
function
|
|
17061
|
+
function relative12(aRoot, aPath) {
|
|
17062
17062
|
if (aRoot === "") {
|
|
17063
17063
|
aRoot = ".";
|
|
17064
17064
|
}
|
|
@@ -17077,7 +17077,7 @@ var require_util = __commonJS({
|
|
|
17077
17077
|
}
|
|
17078
17078
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
17079
17079
|
}
|
|
17080
|
-
exports.relative =
|
|
17080
|
+
exports.relative = relative12;
|
|
17081
17081
|
var supportsNullProto = (function() {
|
|
17082
17082
|
var obj = /* @__PURE__ */ Object.create(null);
|
|
17083
17083
|
return !("__proto__" in obj);
|
|
@@ -48198,10 +48198,10 @@ var init_acorn = __esm({
|
|
|
48198
48198
|
state.raise("Invalid group");
|
|
48199
48199
|
}
|
|
48200
48200
|
var trackDisjunction = this.options.ecmaVersion >= 16;
|
|
48201
|
-
var
|
|
48202
|
-
if (
|
|
48201
|
+
var known2 = state.groupNames[state.lastStringValue];
|
|
48202
|
+
if (known2) {
|
|
48203
48203
|
if (trackDisjunction) {
|
|
48204
|
-
for (var i = 0, list =
|
|
48204
|
+
for (var i = 0, list = known2; i < list.length; i += 1) {
|
|
48205
48205
|
var altID = list[i];
|
|
48206
48206
|
if (!altID.separatedFrom(state.branchID)) {
|
|
48207
48207
|
state.raise("Duplicate capture group name");
|
|
@@ -48212,7 +48212,7 @@ var init_acorn = __esm({
|
|
|
48212
48212
|
}
|
|
48213
48213
|
}
|
|
48214
48214
|
if (trackDisjunction) {
|
|
48215
|
-
(
|
|
48215
|
+
(known2 || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
|
|
48216
48216
|
} else {
|
|
48217
48217
|
state.groupNames[state.lastStringValue] = true;
|
|
48218
48218
|
}
|
|
@@ -54106,6 +54106,36 @@ var init_colorGrading = __esm({
|
|
|
54106
54106
|
}
|
|
54107
54107
|
});
|
|
54108
54108
|
|
|
54109
|
+
// ../core/dist/hdrToneMap.js
|
|
54110
|
+
function known(value) {
|
|
54111
|
+
return value && value !== "unknown" && value !== "reserved" ? value : void 0;
|
|
54112
|
+
}
|
|
54113
|
+
function hdrToSdrToneMapFilter(probed, firstFrame) {
|
|
54114
|
+
const fill = (key2, fallback) => known(firstFrame[key2]) ? void 0 : known(probed[key2]) ?? fallback;
|
|
54115
|
+
const tags = [
|
|
54116
|
+
["colorspace", fill("colorSpace", "bt2020nc")],
|
|
54117
|
+
["color_primaries", fill("colorPrimaries", "bt2020")],
|
|
54118
|
+
["color_trc", fill("colorTransfer")]
|
|
54119
|
+
].filter(([, value]) => value);
|
|
54120
|
+
const setTags = tags.length ? `setparams=${tags.map((tag) => tag.join("=")).join(":")},` : "";
|
|
54121
|
+
return `${setTags}zscale=t=linear:npl=100,tonemap=hable:desat=0,zscale=p=bt709:t=bt709:m=bt709:r=tv`;
|
|
54122
|
+
}
|
|
54123
|
+
function firstFrameColourArgs(videoPath) {
|
|
54124
|
+
return [
|
|
54125
|
+
...["-hide_banner", "-nostats", "-i", videoPath, "-map", "0:v:0", "-frames:v", "1"],
|
|
54126
|
+
...["-vf", "showinfo", "-f", "null", "-"]
|
|
54127
|
+
];
|
|
54128
|
+
}
|
|
54129
|
+
function parseFirstFrameColour(stderr) {
|
|
54130
|
+
const tags = / color_space:(\S+) color_primaries:(\S+) color_trc:(\S+)/.exec(stderr);
|
|
54131
|
+
return tags ? { colorSpace: tags[1], colorPrimaries: tags[2], colorTransfer: tags[3] } : {};
|
|
54132
|
+
}
|
|
54133
|
+
var init_hdrToneMap = __esm({
|
|
54134
|
+
"../core/dist/hdrToneMap.js"() {
|
|
54135
|
+
"use strict";
|
|
54136
|
+
}
|
|
54137
|
+
});
|
|
54138
|
+
|
|
54109
54139
|
// ../core/dist/inline-scripts/hyperframesRuntime.engine.js
|
|
54110
54140
|
import { buildSync } from "esbuild";
|
|
54111
54141
|
import { existsSync } from "fs";
|
|
@@ -54264,8 +54294,8 @@ var init_telemetryRedaction = __esm({
|
|
|
54264
54294
|
});
|
|
54265
54295
|
|
|
54266
54296
|
// ../core/dist/safePath.js
|
|
54267
|
-
import { resolve as resolve3, sep, join as join2, dirname as dirname3, basename } from "path";
|
|
54268
|
-
import { lstatSync, realpathSync } from "fs";
|
|
54297
|
+
import { resolve as resolve3, sep, join as join2, dirname as dirname3, basename, relative, isAbsolute } from "path";
|
|
54298
|
+
import { lstatSync, mkdirSync, realpathSync, statSync } from "fs";
|
|
54269
54299
|
var init_safePath = __esm({
|
|
54270
54300
|
"../core/dist/safePath.js"() {
|
|
54271
54301
|
"use strict";
|
|
@@ -55394,6 +55424,7 @@ var init_dist2 = __esm({
|
|
|
55394
55424
|
init_gif();
|
|
55395
55425
|
init_colorGrading();
|
|
55396
55426
|
init_colorLuts();
|
|
55427
|
+
init_hdrToneMap();
|
|
55397
55428
|
init_hyperframe();
|
|
55398
55429
|
init_runtimeContract();
|
|
55399
55430
|
init_runtime_inline();
|
|
@@ -56672,16 +56703,16 @@ async function launchBrowser(fingerprint) {
|
|
|
56672
56703
|
`[BrowserManager] Browser launched (${browserVersion}, ${captureMode}, gl=${gpuFlags.join(" ") || "default"}, headlessShell=${!!fingerprint.executablePath}, platform=${process.platform})`
|
|
56673
56704
|
);
|
|
56674
56705
|
if (captureMode === "beginframe") {
|
|
56675
|
-
const
|
|
56706
|
+
const probe = await probeBeginFrameSupport(browser).catch((error) => ({
|
|
56676
56707
|
supported: true,
|
|
56677
56708
|
detail: `probe harness error ignored: ${error instanceof Error ? error.message : String(error)}`,
|
|
56678
56709
|
durationMs: 0
|
|
56679
56710
|
}));
|
|
56680
|
-
if (!
|
|
56711
|
+
if (!probe.supported) {
|
|
56681
56712
|
await closeBrowserAfterFailedProbe(browser);
|
|
56682
56713
|
browser = void 0;
|
|
56683
56714
|
console.warn(
|
|
56684
|
-
`[BrowserManager] HeadlessExperimental.beginFrame probe failed after ${
|
|
56715
|
+
`[BrowserManager] HeadlessExperimental.beginFrame probe failed after ${probe.durationMs}ms: ${probe.detail}; falling back to screenshot mode.`
|
|
56685
56716
|
);
|
|
56686
56717
|
captureMode = "screenshot";
|
|
56687
56718
|
browser = await ppt.launch({
|
|
@@ -57917,9 +57948,9 @@ async function beginFrameCapture(page, options, frameTimeTicks, interval) {
|
|
|
57917
57948
|
buffer = Buffer.from(result.screenshotData, "base64");
|
|
57918
57949
|
lastFrameCache.set(page, buffer);
|
|
57919
57950
|
} else {
|
|
57920
|
-
const
|
|
57921
|
-
if (
|
|
57922
|
-
buffer =
|
|
57951
|
+
const cached = lastFrameCache.get(page);
|
|
57952
|
+
if (cached) {
|
|
57953
|
+
buffer = cached;
|
|
57923
57954
|
} else {
|
|
57924
57955
|
const fallback = await sendBeginFrame(client, {
|
|
57925
57956
|
frameTimeTicks: frameTimeTicks + 1e-3,
|
|
@@ -59868,27 +59899,31 @@ var init_ffmpegBinaries = __esm({
|
|
|
59868
59899
|
import { execFile } from "child_process";
|
|
59869
59900
|
import { promisify } from "util";
|
|
59870
59901
|
function isPsnrFilterAvailable() {
|
|
59871
|
-
|
|
59872
|
-
|
|
59902
|
+
return isFfmpegFilterAvailable("psnr");
|
|
59903
|
+
}
|
|
59904
|
+
async function isFfmpegFilterAvailable(name) {
|
|
59905
|
+
if (cachedFilterList === null) cachedFilterList = listFilters();
|
|
59906
|
+
const stdout = await cachedFilterList;
|
|
59907
|
+
return stdout !== null && new RegExp(`(^|\\s)${name}(\\s|$)`, "m").test(stdout);
|
|
59873
59908
|
}
|
|
59874
|
-
async function
|
|
59909
|
+
async function listFilters() {
|
|
59875
59910
|
const execFileP = promisify(execFile);
|
|
59876
59911
|
try {
|
|
59877
59912
|
const { stdout } = await execFileP(getFfmpegBinary(), ["-hide_banner", "-filters"], {
|
|
59878
59913
|
maxBuffer: 4 * 1024 * 1024,
|
|
59879
59914
|
timeout: 5e3
|
|
59880
59915
|
});
|
|
59881
|
-
return
|
|
59916
|
+
return stdout;
|
|
59882
59917
|
} catch {
|
|
59883
|
-
return
|
|
59918
|
+
return null;
|
|
59884
59919
|
}
|
|
59885
59920
|
}
|
|
59886
|
-
var
|
|
59921
|
+
var cachedFilterList;
|
|
59887
59922
|
var init_psnrFilterAvailability = __esm({
|
|
59888
59923
|
"../engine/src/utils/psnrFilterAvailability.ts"() {
|
|
59889
59924
|
"use strict";
|
|
59890
59925
|
init_ffmpegBinaries();
|
|
59891
|
-
|
|
59926
|
+
cachedFilterList = null;
|
|
59892
59927
|
}
|
|
59893
59928
|
});
|
|
59894
59929
|
|
|
@@ -60227,7 +60262,7 @@ var init_captureFailure = __esm({
|
|
|
60227
60262
|
});
|
|
60228
60263
|
|
|
60229
60264
|
// ../engine/src/services/frameCapture.ts
|
|
60230
|
-
import { existsSync as existsSync5, mkdirSync, writeFileSync } from "fs";
|
|
60265
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync2, writeFileSync } from "fs";
|
|
60231
60266
|
import { join as join6 } from "path";
|
|
60232
60267
|
function isDrawElementVerificationError(err) {
|
|
60233
60268
|
let e = err;
|
|
@@ -60668,7 +60703,7 @@ async function completeDeferredDrawElementInit(session) {
|
|
|
60668
60703
|
session.deInitDeferred = false;
|
|
60669
60704
|
}
|
|
60670
60705
|
async function createCaptureSession(serverUrl, outputDir, options, onBeforeCapture = null, config) {
|
|
60671
|
-
if (!existsSync5(outputDir))
|
|
60706
|
+
if (!existsSync5(outputDir)) mkdirSync2(outputDir, { recursive: true });
|
|
60672
60707
|
const headlessShell = resolveHeadlessShellPath(config);
|
|
60673
60708
|
const isLinux = process.platform === "linux";
|
|
60674
60709
|
const forceScreenshot = config?.forceScreenshot ?? DEFAULT_CONFIG.forceScreenshot;
|
|
@@ -61479,7 +61514,7 @@ async function initializeSession(session) {
|
|
|
61479
61514
|
async function captureFrameErrorDiagnostics(session, frameIndex, time, error) {
|
|
61480
61515
|
try {
|
|
61481
61516
|
const diagnosticsDir = join6(session.outputDir, "diagnostics");
|
|
61482
|
-
if (!existsSync5(diagnosticsDir))
|
|
61517
|
+
if (!existsSync5(diagnosticsDir)) mkdirSync2(diagnosticsDir, { recursive: true });
|
|
61483
61518
|
const base2 = join6(diagnosticsDir, `frame-error-${frameIndex}`);
|
|
61484
61519
|
await session.page.screenshot({ path: `${base2}.png`, type: "png", fullPage: true });
|
|
61485
61520
|
const html = await session.page.content();
|
|
@@ -62586,7 +62621,7 @@ async function closeCaptureSession(session) {
|
|
|
62586
62621
|
}
|
|
62587
62622
|
function prepareCaptureSessionForReuse(session, outputDir, onBeforeCapture) {
|
|
62588
62623
|
if (!existsSync5(outputDir)) {
|
|
62589
|
-
|
|
62624
|
+
mkdirSync2(outputDir, { recursive: true });
|
|
62590
62625
|
}
|
|
62591
62626
|
session.outputDir = outputDir;
|
|
62592
62627
|
session.onBeforeCapture = onBeforeCapture;
|
|
@@ -63420,7 +63455,7 @@ var init_runFfmpeg = __esm({
|
|
|
63420
63455
|
|
|
63421
63456
|
// ../engine/src/utils/ffprobe.ts
|
|
63422
63457
|
import { spawn as spawn3 } from "child_process";
|
|
63423
|
-
import { createReadStream, readFileSync as readFileSync2, statSync } from "fs";
|
|
63458
|
+
import { createReadStream, readFileSync as readFileSync2, statSync as statSync2 } from "fs";
|
|
63424
63459
|
import { StringDecoder } from "string_decoder";
|
|
63425
63460
|
import { basename as basename2 } from "path";
|
|
63426
63461
|
function redactFfprobeInput(stderr, filePath) {
|
|
@@ -63545,7 +63580,7 @@ function isPngImageProbe(output) {
|
|
|
63545
63580
|
}
|
|
63546
63581
|
function mediaFileIdentity(filePath) {
|
|
63547
63582
|
try {
|
|
63548
|
-
const stat =
|
|
63583
|
+
const stat = statSync2(filePath, { bigint: true });
|
|
63549
63584
|
return [stat.dev, stat.ino, stat.size, stat.mtimeNs, stat.ctimeNs].join(":");
|
|
63550
63585
|
} catch {
|
|
63551
63586
|
return null;
|
|
@@ -63558,13 +63593,13 @@ async function probeMediaOutput(filePath, signal) {
|
|
|
63558
63593
|
mediaProbeOutputSignalCaches.set(signal, cache2);
|
|
63559
63594
|
}
|
|
63560
63595
|
const identity = mediaFileIdentity(filePath);
|
|
63561
|
-
const
|
|
63562
|
-
if (identity !== null &&
|
|
63596
|
+
const cached = cache2.get(filePath);
|
|
63597
|
+
if (identity !== null && cached?.identity === identity) {
|
|
63563
63598
|
if (!signal) {
|
|
63564
63599
|
cache2.delete(filePath);
|
|
63565
|
-
cache2.set(filePath,
|
|
63600
|
+
cache2.set(filePath, cached);
|
|
63566
63601
|
}
|
|
63567
|
-
return
|
|
63602
|
+
return cached.promise;
|
|
63568
63603
|
}
|
|
63569
63604
|
const promise = runFfprobe(
|
|
63570
63605
|
filePath,
|
|
@@ -63600,7 +63635,7 @@ async function readFileRange(filePath, start, length, signal) {
|
|
|
63600
63635
|
async function hasCompletePngStructure(filePath, signal) {
|
|
63601
63636
|
try {
|
|
63602
63637
|
signal?.throwIfAborted();
|
|
63603
|
-
const fileSize =
|
|
63638
|
+
const fileSize = statSync2(filePath).size;
|
|
63604
63639
|
const signature = await readFileRange(filePath, 0, 8, signal);
|
|
63605
63640
|
signal?.throwIfAborted();
|
|
63606
63641
|
if (signature.length !== 8 || !signature.equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]))) {
|
|
@@ -63731,8 +63766,8 @@ function parseFrameRate(frameRateStr) {
|
|
|
63731
63766
|
return rounded > 0 ? rounded : 0.01;
|
|
63732
63767
|
}
|
|
63733
63768
|
async function extractMediaMetadata(filePath) {
|
|
63734
|
-
const
|
|
63735
|
-
if (
|
|
63769
|
+
const cached = videoMetadataCache.get(filePath);
|
|
63770
|
+
if (cached) return cached;
|
|
63736
63771
|
const probePromise = (async () => {
|
|
63737
63772
|
let stillImageMetaMemo;
|
|
63738
63773
|
const stillImage = () => {
|
|
@@ -63841,8 +63876,8 @@ async function extractFinalVideoFrameTimestamp(filePath, metadata, signal) {
|
|
|
63841
63876
|
probeCache = finalVideoFrameTimestampSignalCaches.get(signal) ?? /* @__PURE__ */ new Map();
|
|
63842
63877
|
finalVideoFrameTimestampSignalCaches.set(signal, probeCache);
|
|
63843
63878
|
}
|
|
63844
|
-
const
|
|
63845
|
-
if (
|
|
63879
|
+
const cached = probeCache.get(cacheKey);
|
|
63880
|
+
if (cached) return cached;
|
|
63846
63881
|
const probePromise = (async () => {
|
|
63847
63882
|
if (!(videoDurationSeconds > 0) || !Number.isFinite(videoDurationSeconds)) {
|
|
63848
63883
|
throw new Error(
|
|
@@ -63852,7 +63887,7 @@ async function extractFinalVideoFrameTimestamp(filePath, metadata, signal) {
|
|
|
63852
63887
|
const streamEnd = videoStreamStartSeconds + videoDurationSeconds;
|
|
63853
63888
|
const intervalStart = Math.max(videoStreamStartSeconds, streamEnd - 1);
|
|
63854
63889
|
const parseFinalTimestamp = (stdout) => stdout.split("\n").map((line) => line.trim().split(",")[0]?.trim() ?? "").filter((value) => value.length > 0).map((value) => Number(value)).filter((timestamp2) => Number.isFinite(timestamp2)).at(-1);
|
|
63855
|
-
const
|
|
63890
|
+
const probe = async (readInterval) => {
|
|
63856
63891
|
const args = [
|
|
63857
63892
|
"-select_streams",
|
|
63858
63893
|
"v:0",
|
|
@@ -63868,7 +63903,7 @@ async function extractFinalVideoFrameTimestamp(filePath, metadata, signal) {
|
|
|
63868
63903
|
});
|
|
63869
63904
|
return parseFinalTimestamp(stdout);
|
|
63870
63905
|
};
|
|
63871
|
-
const timestamp = await
|
|
63906
|
+
const timestamp = await probe(`${intervalStart}%${streamEnd}`) ?? await probe(
|
|
63872
63907
|
/* full scan */
|
|
63873
63908
|
);
|
|
63874
63909
|
if (timestamp === void 0) {
|
|
@@ -63885,8 +63920,8 @@ async function extractFinalVideoFrameTimestamp(filePath, metadata, signal) {
|
|
|
63885
63920
|
return probePromise;
|
|
63886
63921
|
}
|
|
63887
63922
|
async function extractAudioMetadata(filePath, options) {
|
|
63888
|
-
const
|
|
63889
|
-
if (
|
|
63923
|
+
const cached = options?.signal ? void 0 : audioMetadataCache.get(filePath);
|
|
63924
|
+
if (cached) return cached;
|
|
63890
63925
|
const probePromise = (async () => {
|
|
63891
63926
|
const output = await probeMediaOutput(filePath, options?.signal);
|
|
63892
63927
|
const audioStream = output.streams.find((s) => s.codec_type === "audio");
|
|
@@ -63943,8 +63978,8 @@ async function analyzeKeyframeIntervals(filePath, metadata) {
|
|
|
63943
63978
|
filePath,
|
|
63944
63979
|
metadata
|
|
63945
63980
|
);
|
|
63946
|
-
const
|
|
63947
|
-
if (
|
|
63981
|
+
const cached = keyframeCache.get(cacheKey);
|
|
63982
|
+
if (cached) return cached;
|
|
63948
63983
|
const promise = analyzeKeyframeIntervalsUncached(
|
|
63949
63984
|
filePath,
|
|
63950
63985
|
videoStreamStartSeconds,
|
|
@@ -64136,12 +64171,12 @@ import {
|
|
|
64136
64171
|
copyFileSync,
|
|
64137
64172
|
existsSync as existsSync6,
|
|
64138
64173
|
ftruncateSync,
|
|
64139
|
-
mkdirSync as
|
|
64174
|
+
mkdirSync as mkdirSync3,
|
|
64140
64175
|
mkdtempSync,
|
|
64141
64176
|
openSync,
|
|
64142
64177
|
readFileSync as readFileSync4,
|
|
64143
64178
|
readdirSync as readdirSync2,
|
|
64144
|
-
statSync as
|
|
64179
|
+
statSync as statSync3,
|
|
64145
64180
|
writeFileSync as writeFileSync2,
|
|
64146
64181
|
writeSync
|
|
64147
64182
|
} from "fs";
|
|
@@ -64384,7 +64419,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
|
|
|
64384
64419
|
async function encodeFramesFromDir(framesDir, framePattern, outputPath, options, signal, config) {
|
|
64385
64420
|
const startTime = Date.now();
|
|
64386
64421
|
const outputDir = dirname5(outputPath);
|
|
64387
|
-
if (!existsSync6(outputDir))
|
|
64422
|
+
if (!existsSync6(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
64388
64423
|
const files = readdirSync2(framesDir).filter((f) => f.match(/\.(jpg|jpeg|png)$/i));
|
|
64389
64424
|
const frameCount = files.length;
|
|
64390
64425
|
if (frameCount === 0) {
|
|
@@ -64431,7 +64466,7 @@ async function encodeFramesFromDir(framesDir, framePattern, outputPath, options,
|
|
|
64431
64466
|
failureReason: isExternalFfmpegInterruption(result) ? "external_interruption" : void 0
|
|
64432
64467
|
};
|
|
64433
64468
|
}
|
|
64434
|
-
const fileSize = existsSync6(outputPath) ?
|
|
64469
|
+
const fileSize = existsSync6(outputPath) ? statSync3(outputPath).size : 0;
|
|
64435
64470
|
return {
|
|
64436
64471
|
success: true,
|
|
64437
64472
|
outputPath,
|
|
@@ -64458,7 +64493,7 @@ async function concatVideoFiles(inputPaths, outputPath, signal, config) {
|
|
|
64458
64493
|
if (firstInput === void 0) {
|
|
64459
64494
|
return { success: false, error: "concatVideoFiles: no inputs", externalInterruption: false };
|
|
64460
64495
|
}
|
|
64461
|
-
|
|
64496
|
+
mkdirSync3(dirname5(outputPath), { recursive: true });
|
|
64462
64497
|
const listPath = writeConcatList(dirname5(firstInput), inputPaths);
|
|
64463
64498
|
const encodeTimeout = config?.ffmpegEncodeTimeout ?? DEFAULT_CONFIG.ffmpegEncodeTimeout;
|
|
64464
64499
|
const result = await runFfmpeg(buildConcatArgs(listPath, outputPath), {
|
|
@@ -64491,7 +64526,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
64491
64526
|
}
|
|
64492
64527
|
const chunkSize = Math.max(30, Math.floor(chunkSizeFrames));
|
|
64493
64528
|
const chunkCount = Math.ceil(files.length / chunkSize);
|
|
64494
|
-
|
|
64529
|
+
mkdirSync3(dirname5(outputPath), { recursive: true });
|
|
64495
64530
|
const chunkDir = mkdtempSync(join8(dirname5(outputPath), "chunk-encode-"));
|
|
64496
64531
|
const chunkPaths = [];
|
|
64497
64532
|
for (let i = 0; i < chunkCount; i++) {
|
|
@@ -64558,7 +64593,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
64558
64593
|
failureReason: concatResult.externalInterruption ? "external_interruption" : void 0
|
|
64559
64594
|
};
|
|
64560
64595
|
}
|
|
64561
|
-
const fileSize = existsSync6(outputPath) ?
|
|
64596
|
+
const fileSize = existsSync6(outputPath) ? statSync3(outputPath).size : 0;
|
|
64562
64597
|
return {
|
|
64563
64598
|
success: true,
|
|
64564
64599
|
outputPath,
|
|
@@ -64569,7 +64604,7 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
|
|
|
64569
64604
|
}
|
|
64570
64605
|
async function muxVideoWithAudio(videoPath, audioPath, outputPath, signal, config, fps) {
|
|
64571
64606
|
const outputDir = dirname5(outputPath);
|
|
64572
|
-
if (!existsSync6(outputDir))
|
|
64607
|
+
if (!existsSync6(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
64573
64608
|
const isWebm = outputPath.endsWith(".webm");
|
|
64574
64609
|
const isMov = outputPath.endsWith(".mov");
|
|
64575
64610
|
const shouldCopyAudio = isWebm ? false : await shouldCopyAacSidecar(audioPath, config);
|
|
@@ -64636,7 +64671,7 @@ async function packageHls(videoPath, audioPath, outputDir, options) {
|
|
|
64636
64671
|
if (outputDir.includes("%")) {
|
|
64637
64672
|
throw new Error(`[chunkEncoder] packageHls outputDir must not contain "%": ${outputDir}`);
|
|
64638
64673
|
}
|
|
64639
|
-
if (!existsSync6(outputDir))
|
|
64674
|
+
if (!existsSync6(outputDir)) mkdirSync3(outputDir, { recursive: true });
|
|
64640
64675
|
const hasAudio = audioPath !== null;
|
|
64641
64676
|
const args = hasAudio ? ["-i", videoPath, "-i", audioPath, "-map", "0:v:0", "-map", "1:a:0"] : ["-i", videoPath, "-map", "0:v:0"];
|
|
64642
64677
|
args.push(
|
|
@@ -64819,7 +64854,7 @@ var init_jpegInput = __esm({
|
|
|
64819
64854
|
// ../engine/src/services/streamingEncoder.ts
|
|
64820
64855
|
import { spawn as spawn4 } from "child_process";
|
|
64821
64856
|
import { once } from "events";
|
|
64822
|
-
import { existsSync as existsSync7, mkdirSync as
|
|
64857
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync4, statSync as statSync4 } from "fs";
|
|
64823
64858
|
import { dirname as dirname6 } from "path";
|
|
64824
64859
|
function createFrameReorderBuffer(startFrame, endFrame) {
|
|
64825
64860
|
let cursor = startFrame;
|
|
@@ -65053,7 +65088,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
|
|
|
65053
65088
|
}
|
|
65054
65089
|
async function spawnStreamingEncoder(outputPath, options, signal, config) {
|
|
65055
65090
|
const outputDir = dirname6(outputPath);
|
|
65056
|
-
if (!existsSync7(outputDir))
|
|
65091
|
+
if (!existsSync7(outputDir)) mkdirSync4(outputDir, { recursive: true });
|
|
65057
65092
|
let gpuEncoder = null;
|
|
65058
65093
|
if (options.useGpu) {
|
|
65059
65094
|
gpuEncoder = await getCachedGpuEncoder();
|
|
@@ -65173,7 +65208,7 @@ FFmpeg stopped after ${streamingTimeout} ms without consuming a frame.` : "";
|
|
|
65173
65208
|
}) ? "external_interruption" : void 0
|
|
65174
65209
|
};
|
|
65175
65210
|
}
|
|
65176
|
-
const fileSize = existsSync7(outputPath) ?
|
|
65211
|
+
const fileSize = existsSync7(outputPath) ? statSync4(outputPath).size : 0;
|
|
65177
65212
|
return { success: true, durationMs, fileSize };
|
|
65178
65213
|
},
|
|
65179
65214
|
getExitStatus: () => exitStatus,
|
|
@@ -65215,7 +65250,7 @@ var init_streamingEncoder = __esm({
|
|
|
65215
65250
|
|
|
65216
65251
|
// ../parsers/dist/assetResolution.js
|
|
65217
65252
|
import { existsSync as existsSync8 } from "fs";
|
|
65218
|
-
import { isAbsolute, join as join9, posix as posix2, relative, resolve as resolve5, sep as sep2 } from "path";
|
|
65253
|
+
import { isAbsolute as isAbsolute2, join as join9, posix as posix2, relative as relative2, resolve as resolve5, sep as sep2 } from "path";
|
|
65219
65254
|
function decodeUrlPathVariants2(path) {
|
|
65220
65255
|
const variants = [path];
|
|
65221
65256
|
try {
|
|
@@ -65234,7 +65269,7 @@ function isUnresolvedAssetPlaceholder(rawSrc) {
|
|
|
65234
65269
|
function cleanAssetUrl(url) {
|
|
65235
65270
|
return url.trim().split(/[?#]/, 1)[0] ?? "";
|
|
65236
65271
|
}
|
|
65237
|
-
function isWithinProjectRoot(projectDir, candidate, pathModule = { resolve: resolve5, relative, isAbsolute }) {
|
|
65272
|
+
function isWithinProjectRoot(projectDir, candidate, pathModule = { resolve: resolve5, relative: relative2, isAbsolute: isAbsolute2 }) {
|
|
65238
65273
|
const projectRoot = pathModule.resolve(projectDir);
|
|
65239
65274
|
const relativePath = pathModule.relative(projectRoot, candidate);
|
|
65240
65275
|
return relativePath === "" || !relativePath.startsWith("..") && !pathModule.isAbsolute(relativePath);
|
|
@@ -65249,7 +65284,7 @@ function reanchoredCandidates(variant, baseDir, compiledDir) {
|
|
|
65249
65284
|
}
|
|
65250
65285
|
function resolveProjectRelativeSrc(src, baseDir, compiledDir) {
|
|
65251
65286
|
const cleanSrc = cleanAssetUrl(src);
|
|
65252
|
-
if (
|
|
65287
|
+
if (isAbsolute2(cleanSrc) && existsSync8(cleanSrc)) return cleanSrc;
|
|
65253
65288
|
const candidates = /* @__PURE__ */ new Set();
|
|
65254
65289
|
for (const variant of decodeUrlPathVariants2(cleanSrc)) {
|
|
65255
65290
|
for (const candidate of reanchoredCandidates(variant, baseDir, compiledDir)) {
|
|
@@ -65271,8 +65306,8 @@ function findReferenceTargetEl(doc, refId) {
|
|
|
65271
65306
|
return doc.getElementById(refId) ?? doc.querySelector(`[data-composition-id="${refId}"]`);
|
|
65272
65307
|
}
|
|
65273
65308
|
function resolveReferencedStart(doc, el, startCache, visiting) {
|
|
65274
|
-
const
|
|
65275
|
-
if (
|
|
65309
|
+
const cached = startCache.get(el);
|
|
65310
|
+
if (cached !== void 0) return cached;
|
|
65276
65311
|
if (visiting.has(el)) return 0;
|
|
65277
65312
|
visiting.add(el);
|
|
65278
65313
|
try {
|
|
@@ -65341,13 +65376,13 @@ import {
|
|
|
65341
65376
|
fsyncSync,
|
|
65342
65377
|
linkSync,
|
|
65343
65378
|
mkdtempSync as mkdtempSync2,
|
|
65344
|
-
mkdirSync as
|
|
65379
|
+
mkdirSync as mkdirSync5,
|
|
65345
65380
|
lstatSync as lstatSync2,
|
|
65346
65381
|
openSync as openSync2,
|
|
65347
65382
|
readdirSync as readdirSync3,
|
|
65348
65383
|
rmdirSync,
|
|
65349
65384
|
rmSync,
|
|
65350
|
-
statSync as
|
|
65385
|
+
statSync as statSync5,
|
|
65351
65386
|
unlinkSync
|
|
65352
65387
|
} from "fs";
|
|
65353
65388
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -65520,7 +65555,7 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
|
|
|
65520
65555
|
}
|
|
65521
65556
|
let createdLock = false;
|
|
65522
65557
|
try {
|
|
65523
|
-
|
|
65558
|
+
mkdirSync5(lockPath);
|
|
65524
65559
|
createdLock = true;
|
|
65525
65560
|
} catch (error) {
|
|
65526
65561
|
if (error.code !== "EEXIST") throw error;
|
|
@@ -65528,7 +65563,7 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
|
|
|
65528
65563
|
if (createdLock) {
|
|
65529
65564
|
const owner = `${CACHE_LOCK_OWNER_PREFIX}${randomUUID()}`;
|
|
65530
65565
|
try {
|
|
65531
|
-
|
|
65566
|
+
mkdirSync5(join10(lockPath, owner));
|
|
65532
65567
|
const entries2 = readdirSync3(lockPath);
|
|
65533
65568
|
if (entries2.length === 1 && entries2[0] === owner) {
|
|
65534
65569
|
return () => releaseOwnedCachePathLock(lockPath, owner);
|
|
@@ -65561,7 +65596,7 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
|
|
|
65561
65596
|
}
|
|
65562
65597
|
const reclaimPath = join10(lockPath, CACHE_LOCK_RECLAIM_NAME);
|
|
65563
65598
|
try {
|
|
65564
|
-
|
|
65599
|
+
mkdirSync5(reclaimPath);
|
|
65565
65600
|
} catch (error) {
|
|
65566
65601
|
const code = error.code;
|
|
65567
65602
|
if (code === "EEXIST" || code === "ENOENT") continue;
|
|
@@ -65898,7 +65933,7 @@ async function fetchToPartial(url, partialPath, controller, options) {
|
|
|
65898
65933
|
const readableStream = Readable.fromWeb(response.body);
|
|
65899
65934
|
const fileStream = createWriteStream(partialPath, { flags: "wx" });
|
|
65900
65935
|
await pipeline(readableStream, inspector, fileStream, { signal: controller.signal });
|
|
65901
|
-
const localSize =
|
|
65936
|
+
const localSize = statSync5(partialPath).size;
|
|
65902
65937
|
const sha256Bytes = sha256.digest();
|
|
65903
65938
|
const localSha256 = sha256Bytes.toString("hex");
|
|
65904
65939
|
const md5Base64 = md5.digest("base64");
|
|
@@ -66231,7 +66266,7 @@ async function downloadToTemp(url, destDir, timeoutMs = 3e5, signal, onTransient
|
|
|
66231
66266
|
return inFlight;
|
|
66232
66267
|
}
|
|
66233
66268
|
if (!existsSync9(destDir)) {
|
|
66234
|
-
|
|
66269
|
+
mkdirSync5(destDir, { recursive: true });
|
|
66235
66270
|
}
|
|
66236
66271
|
const filename = getFilenameFromUrl(url, validationScope);
|
|
66237
66272
|
const localPath = join10(destDir, filename);
|
|
@@ -66377,11 +66412,12 @@ var init_scriptRuns = __esm({
|
|
|
66377
66412
|
});
|
|
66378
66413
|
|
|
66379
66414
|
// ../core/dist/sceneParts.js
|
|
66380
|
-
var SCENE_PART_ATTR, SCENE_NO_SWAP_ATTR;
|
|
66415
|
+
var SCENE_PART_ATTR, SCENE_PARTS_META, SCENE_NO_SWAP_ATTR;
|
|
66381
66416
|
var init_sceneParts = __esm({
|
|
66382
66417
|
"../core/dist/sceneParts.js"() {
|
|
66383
66418
|
"use strict";
|
|
66384
66419
|
SCENE_PART_ATTR = "data-hf-scene";
|
|
66420
|
+
SCENE_PARTS_META = "hf-scene-parts";
|
|
66385
66421
|
SCENE_NO_SWAP_ATTR = "data-hf-scene-no-swap";
|
|
66386
66422
|
}
|
|
66387
66423
|
});
|
|
@@ -67292,8 +67328,33 @@ ${source.replace(/<\/(script)/gi, "<\\/$1")}
|
|
|
67292
67328
|
console.error(__hfErrorLabel, __hfCompId, _err);
|
|
67293
67329
|
}
|
|
67294
67330
|
};
|
|
67331
|
+
// What the script started on the global gsap timeline, by any route, for a scene swap to revert.
|
|
67332
|
+
// Only a page with a scene manifest can swap; elsewhere the first script stores null and none records.
|
|
67333
|
+
var __hfRecordAnimations = function(run) {
|
|
67334
|
+
if (window.__hfSceneAnimations === undefined) {
|
|
67335
|
+
window.__hfSceneAnimations = window.document.querySelector(${jsonScriptLiteral(`meta[name="${SCENE_PARTS_META}"]`)})
|
|
67336
|
+
? {}
|
|
67337
|
+
: null;
|
|
67338
|
+
}
|
|
67339
|
+
var byComp = window.__hfSceneAnimations;
|
|
67340
|
+
var globalTimeline = __hfBaseGsap && __hfBaseGsap.globalTimeline;
|
|
67341
|
+
if (!byComp || !globalTimeline || !__hfTimelineCompId) return run();
|
|
67342
|
+
var before = globalTimeline.getChildren(false);
|
|
67343
|
+
// A set completes as it is made and would leave the timeline before the diff below.
|
|
67344
|
+
var autoRemove = globalTimeline.autoRemoveChildren;
|
|
67345
|
+
globalTimeline.autoRemoveChildren = false;
|
|
67346
|
+
run();
|
|
67347
|
+
globalTimeline.autoRemoveChildren = autoRemove;
|
|
67348
|
+
var recorded = (byComp[__hfTimelineCompId] = byComp[__hfTimelineCompId] || []);
|
|
67349
|
+
globalTimeline.getChildren(false).forEach(function(animation) {
|
|
67350
|
+
if (before.indexOf(animation) >= 0) return;
|
|
67351
|
+
recorded.push(animation);
|
|
67352
|
+
// Dropped as the timeline drops a finished tween (it keeps a paused one); moved back, a tween re-adds itself.
|
|
67353
|
+
if (autoRemove && !animation.getChildren && animation.totalProgress() === 1) globalTimeline.remove(animation);
|
|
67354
|
+
});
|
|
67355
|
+
};
|
|
67295
67356
|
__hfFindRoot();
|
|
67296
|
-
__hfRun
|
|
67357
|
+
__hfRecordAnimations(__hfRun);
|
|
67297
67358
|
})();`;
|
|
67298
67359
|
}
|
|
67299
67360
|
function wrapInlineScriptWithErrorBoundary(source, errorLabel) {
|
|
@@ -67309,6 +67370,7 @@ var AUTHORED_ROOT_ID_ATTR, INNER_ROOT_ATTR, GLOBAL_AT_RULES, SCOPED_HYPERFRAMES_
|
|
|
67309
67370
|
var init_compositionScoping = __esm({
|
|
67310
67371
|
"../core/dist/compiler/compositionScoping.js"() {
|
|
67311
67372
|
"use strict";
|
|
67373
|
+
init_sceneParts();
|
|
67312
67374
|
AUTHORED_ROOT_ID_ATTR = "data-hf-authored-id";
|
|
67313
67375
|
INNER_ROOT_ATTR = "data-hf-inner-root";
|
|
67314
67376
|
GLOBAL_AT_RULES = /* @__PURE__ */ new Set(["keyframes", "-webkit-keyframes", "font-face"]);
|
|
@@ -70971,9 +71033,9 @@ function resolveCompositionDuration(input) {
|
|
|
70971
71033
|
if (isPositiveFinite(input.authoredDurationSeconds)) {
|
|
70972
71034
|
return { seconds: input.authoredDurationSeconds, source: "authored", pendingClips };
|
|
70973
71035
|
}
|
|
70974
|
-
const
|
|
70975
|
-
if (
|
|
70976
|
-
return { seconds: Math.max(...
|
|
71036
|
+
const known2 = input.clipEndsSeconds.filter(isPositiveFinite);
|
|
71037
|
+
if (known2.length > 0) {
|
|
71038
|
+
return { seconds: Math.max(...known2), source: "derived", pendingClips };
|
|
70977
71039
|
}
|
|
70978
71040
|
return {
|
|
70979
71041
|
seconds: null,
|
|
@@ -74320,8 +74382,8 @@ function findAudioGroupCarveAttrFindings(ctx) {
|
|
|
74320
74382
|
return findings;
|
|
74321
74383
|
}
|
|
74322
74384
|
function callsFor(script) {
|
|
74323
|
-
const
|
|
74324
|
-
if (
|
|
74385
|
+
const cached = callIndexes.get(script);
|
|
74386
|
+
if (cached) return cached;
|
|
74325
74387
|
const calls = [];
|
|
74326
74388
|
try {
|
|
74327
74389
|
const ast = parse7(script.content, {
|
|
@@ -74721,8 +74783,8 @@ function synthesizeWindowRaw(timelineVar, anim) {
|
|
|
74721
74783
|
return `${timelineVar}.${anim.method}("${anim.targetSelector}", { ${entries2.join(", ")} }, ${pos})`;
|
|
74722
74784
|
}
|
|
74723
74785
|
async function cachedExtractGsapWindows(scriptContent) {
|
|
74724
|
-
const
|
|
74725
|
-
if (
|
|
74786
|
+
const cached = gsapWindowsCache.get(scriptContent);
|
|
74787
|
+
if (cached) return cached;
|
|
74726
74788
|
const windows = await extractGsapWindows(scriptContent);
|
|
74727
74789
|
gsapWindowsCache.set(scriptContent, windows);
|
|
74728
74790
|
return windows;
|
|
@@ -79690,18 +79752,18 @@ import { createHash as createHash3, randomUUID as randomUUID2 } from "crypto";
|
|
|
79690
79752
|
import {
|
|
79691
79753
|
existsSync as existsSync10,
|
|
79692
79754
|
lstatSync as lstatSync3,
|
|
79693
|
-
mkdirSync as
|
|
79755
|
+
mkdirSync as mkdirSync6,
|
|
79694
79756
|
readdirSync as readdirSync5,
|
|
79695
79757
|
renameSync,
|
|
79696
79758
|
rmSync as rmSync2,
|
|
79697
|
-
statSync as
|
|
79759
|
+
statSync as statSync6,
|
|
79698
79760
|
utimesSync,
|
|
79699
79761
|
writeFileSync as writeFileSync3
|
|
79700
79762
|
} from "fs";
|
|
79701
79763
|
import { join as join12 } from "path";
|
|
79702
79764
|
function readKeyStat(videoPath) {
|
|
79703
79765
|
try {
|
|
79704
|
-
const stat =
|
|
79766
|
+
const stat = statSync6(videoPath);
|
|
79705
79767
|
return { mtimeMs: Math.floor(stat.mtimeMs), size: stat.size };
|
|
79706
79768
|
} catch {
|
|
79707
79769
|
return null;
|
|
@@ -79834,7 +79896,7 @@ function removeDir(path) {
|
|
|
79834
79896
|
}
|
|
79835
79897
|
function collectGcEntry(dir, name, now, minAgeMs, stats) {
|
|
79836
79898
|
try {
|
|
79837
|
-
const dirStat =
|
|
79899
|
+
const dirStat = statSync6(dir);
|
|
79838
79900
|
if (isPartialChild(name) && now - dirStat.mtimeMs >= minAgeMs) {
|
|
79839
79901
|
removeDir(dir);
|
|
79840
79902
|
stats.agedPartialsRemoved += 1;
|
|
@@ -79842,7 +79904,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats) {
|
|
|
79842
79904
|
}
|
|
79843
79905
|
let lastUseMs = dirStat.mtimeMs;
|
|
79844
79906
|
try {
|
|
79845
|
-
lastUseMs =
|
|
79907
|
+
lastUseMs = statSync6(join12(dir, COMPLETE_SENTINEL)).mtimeMs;
|
|
79846
79908
|
} catch {
|
|
79847
79909
|
}
|
|
79848
79910
|
return { dir, size: directorySizeBytes(dir), lastUseMs, ageMs: now - lastUseMs };
|
|
@@ -79852,7 +79914,7 @@ function collectGcEntry(dir, name, now, minAgeMs, stats) {
|
|
|
79852
79914
|
}
|
|
79853
79915
|
function gcSweepDue(rootDir, maxAgeMs) {
|
|
79854
79916
|
try {
|
|
79855
|
-
return Date.now() -
|
|
79917
|
+
return Date.now() - statSync6(join12(rootDir, GC_MARKER)).mtimeMs > maxAgeMs;
|
|
79856
79918
|
} catch {
|
|
79857
79919
|
return true;
|
|
79858
79920
|
}
|
|
@@ -79921,7 +79983,7 @@ var init_extractionCache = __esm({
|
|
|
79921
79983
|
});
|
|
79922
79984
|
|
|
79923
79985
|
// ../engine/src/services/videoFrameExtractor.ts
|
|
79924
|
-
import { copyFileSync as copyFileSync2, existsSync as existsSync11, linkSync as linkSync2, mkdirSync as
|
|
79986
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync11, linkSync as linkSync2, mkdirSync as mkdirSync7, rmSync as rmSync3 } from "fs";
|
|
79925
79987
|
import { join as join13 } from "path";
|
|
79926
79988
|
function isVideoFrameFormat(value) {
|
|
79927
79989
|
return typeof value === "string" && VIDEO_FRAME_FORMATS.includes(value);
|
|
@@ -79964,6 +80026,19 @@ function extractionFrameCountForDuration(durationSeconds, fps, isVFR) {
|
|
|
79964
80026
|
const frames = Number(frameCount);
|
|
79965
80027
|
return Math.max(1, Number.isSafeInteger(frames) ? frames : Number.MAX_SAFE_INTEGER);
|
|
79966
80028
|
}
|
|
80029
|
+
async function toneMapsWithZscale() {
|
|
80030
|
+
return process.platform !== "darwin" || isFfmpegFilterAvailable("zscale");
|
|
80031
|
+
}
|
|
80032
|
+
async function hdrToSdrTransformKey() {
|
|
80033
|
+
if (await toneMapsWithZscale()) return HDR_TO_SDR_ZSCALE_TRANSFORM_KEY;
|
|
80034
|
+
if (!warnedMissingZscale) {
|
|
80035
|
+
warnedMissingZscale = true;
|
|
80036
|
+
process.stderr.write(
|
|
80037
|
+
"[hyperframes:render] WARNING: this ffmpeg has no zscale filter, so forced-SDR HDR footage is tone-mapped by Chrome instead of the hable curve used on Linux and in Studio, and renders darker. Install an ffmpeg built with libzimg to match.\n"
|
|
80038
|
+
);
|
|
80039
|
+
}
|
|
80040
|
+
return HDR_TO_SDR_VIDEOTOOLBOX_TRANSFORM_KEY;
|
|
80041
|
+
}
|
|
79967
80042
|
function sdrToHdrTransformKey(transfer) {
|
|
79968
80043
|
return `sdr2hdr-${transfer}`;
|
|
79969
80044
|
}
|
|
@@ -80262,6 +80337,10 @@ function parseImageElements(html) {
|
|
|
80262
80337
|
}
|
|
80263
80338
|
return images;
|
|
80264
80339
|
}
|
|
80340
|
+
async function readFirstFrameColour(videoPath, signal) {
|
|
80341
|
+
const result = await runFfmpeg(firstFrameColourArgs(videoPath), { signal });
|
|
80342
|
+
return parseFirstFrameColour(result.stderr);
|
|
80343
|
+
}
|
|
80265
80344
|
function chromeGuessForUntaggedMatrix(metadata) {
|
|
80266
80345
|
const matrix = metadata.colorSpace?.colorSpace;
|
|
80267
80346
|
if (matrix && matrix !== "unknown") return [];
|
|
@@ -80284,7 +80363,7 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
|
|
|
80284
80363
|
const fps = fpsToNumber(normalizedFps);
|
|
80285
80364
|
const ffmpegFps = fpsToFfmpegArg(normalizedFps);
|
|
80286
80365
|
const videoOutputDir = outputDirOverride ?? join13(outputDir, videoId);
|
|
80287
|
-
if (!existsSync11(videoOutputDir))
|
|
80366
|
+
if (!existsSync11(videoOutputDir)) mkdirSync7(videoOutputDir, { recursive: true });
|
|
80288
80367
|
let metadata;
|
|
80289
80368
|
try {
|
|
80290
80369
|
metadata = await extractMediaMetadata(videoPath);
|
|
@@ -80313,9 +80392,11 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
|
|
|
80313
80392
|
const outputPattern = join13(videoOutputDir, framePattern);
|
|
80314
80393
|
const isHdr = isHdrColorSpace(metadata.colorSpace);
|
|
80315
80394
|
const isMacOS = process.platform === "darwin";
|
|
80395
|
+
const toneMappedToSdr = options.toneMapHdrToSdr === true && isHdr && await toneMapsWithZscale();
|
|
80396
|
+
const decodeWithVideoToolbox = isHdr && isMacOS && !toneMappedToSdr;
|
|
80316
80397
|
const sampleCfrAtOutputFps = !options.finalFrameOnly && !metadata.isVFR;
|
|
80317
80398
|
const args = [];
|
|
80318
|
-
if (
|
|
80399
|
+
if (decodeWithVideoToolbox) {
|
|
80319
80400
|
args.push("-hwaccel", "videotoolbox");
|
|
80320
80401
|
}
|
|
80321
80402
|
if (codecMayHaveAlpha(metadata.videoCodec)) {
|
|
@@ -80328,7 +80409,7 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
|
|
|
80328
80409
|
args.push("-ss", String(startTime), "-i", videoPath, "-t", String(duration));
|
|
80329
80410
|
}
|
|
80330
80411
|
const vfFilters = [];
|
|
80331
|
-
if (
|
|
80412
|
+
if (decodeWithVideoToolbox) {
|
|
80332
80413
|
vfFilters.push("format=nv12");
|
|
80333
80414
|
}
|
|
80334
80415
|
if (sampleCfrAtOutputFps) {
|
|
@@ -80341,11 +80422,15 @@ async function extractVideoFramesRange(videoPath, videoId, startTime, duration,
|
|
|
80341
80422
|
if (options.sdrToHdrTransfer) {
|
|
80342
80423
|
vfFilters.push(SDR_TO_HDR_COLORSPACE_FILTER);
|
|
80343
80424
|
}
|
|
80344
|
-
if (
|
|
80345
|
-
|
|
80425
|
+
if (toneMappedToSdr) {
|
|
80426
|
+
const frameColour = await readFirstFrameColour(videoPath, signal);
|
|
80427
|
+
vfFilters.push(hdrToSdrToneMapFilter(metadata.colorSpace ?? {}, frameColour));
|
|
80346
80428
|
}
|
|
80347
|
-
if (!isHdr && !options.sdrToHdrTransfer) {
|
|
80348
|
-
vfFilters.push(
|
|
80429
|
+
if (toneMappedToSdr || !isHdr && !options.sdrToHdrTransfer) {
|
|
80430
|
+
vfFilters.push(
|
|
80431
|
+
...isHdr ? [] : chromeGuessForUntaggedMatrix(metadata),
|
|
80432
|
+
SDR_CANVAS_PASSTHROUGH_FILTER
|
|
80433
|
+
);
|
|
80349
80434
|
if (format === "jpg") vfFilters.push(SDR_JPEG_AS_BT601_FULL_RANGE_FILTER);
|
|
80350
80435
|
}
|
|
80351
80436
|
const encodeArgs = ["-q:v", format === "jpg" ? String(Math.ceil((100 - quality) / 3)) : "0"];
|
|
@@ -80679,7 +80764,7 @@ function supersetGroupingKey(work, fps) {
|
|
|
80679
80764
|
String(fps),
|
|
80680
80765
|
work.format,
|
|
80681
80766
|
work.sdrToHdrTransfer ?? "",
|
|
80682
|
-
work.
|
|
80767
|
+
work.hdrToSdrTransformKey ?? "",
|
|
80683
80768
|
work.finalFrameOnly ? "final" : "range"
|
|
80684
80769
|
].join("\0");
|
|
80685
80770
|
}
|
|
@@ -80761,7 +80846,7 @@ function planSupersetGroups(misses, fps) {
|
|
|
80761
80846
|
function sliceSupersetMember(member, superset, outputDir, fps, configuredFps) {
|
|
80762
80847
|
const { work } = member.miss;
|
|
80763
80848
|
rmSync3(outputDir, { recursive: true, force: true });
|
|
80764
|
-
|
|
80849
|
+
mkdirSync7(outputDir, { recursive: true });
|
|
80765
80850
|
const requestedFrames = extractionFrameCountForDuration(
|
|
80766
80851
|
work.videoDuration,
|
|
80767
80852
|
configuredFps,
|
|
@@ -80822,7 +80907,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
80822
80907
|
}
|
|
80823
80908
|
if (isHttpUrl(videoPath)) {
|
|
80824
80909
|
const downloadDir = join13(options.outputDir, "_downloads");
|
|
80825
|
-
|
|
80910
|
+
mkdirSync7(downloadDir, { recursive: true });
|
|
80826
80911
|
videoPath = await downloadToTemp(
|
|
80827
80912
|
videoPath,
|
|
80828
80913
|
downloadDir,
|
|
@@ -80962,7 +81047,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
80962
81047
|
let cacheRootDir;
|
|
80963
81048
|
if (configuredCacheRootDir) {
|
|
80964
81049
|
try {
|
|
80965
|
-
|
|
81050
|
+
mkdirSync7(configuredCacheRootDir, { recursive: true });
|
|
80966
81051
|
cacheRootDir = configuredCacheRootDir;
|
|
80967
81052
|
} catch {
|
|
80968
81053
|
process.stderr.write(
|
|
@@ -80985,7 +81070,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
80985
81070
|
...options,
|
|
80986
81071
|
format: work.format,
|
|
80987
81072
|
sdrToHdrTransfer: work.sdrToHdrTransfer,
|
|
80988
|
-
toneMapHdrToSdr: work.
|
|
81073
|
+
toneMapHdrToSdr: work.hdrToSdrTransformKey !== void 0,
|
|
80989
81074
|
finalFrameOnly: work.finalFrameOnly
|
|
80990
81075
|
};
|
|
80991
81076
|
}
|
|
@@ -81005,7 +81090,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
81005
81090
|
if (!keyInput) return { work };
|
|
81006
81091
|
const transformParts = [
|
|
81007
81092
|
work.sdrToHdrTransfer ? sdrToHdrTransformKey(work.sdrToHdrTransfer) : void 0,
|
|
81008
|
-
work.
|
|
81093
|
+
work.hdrToSdrTransformKey,
|
|
81009
81094
|
work.finalFrameOnly ? "final-frame" : void 0
|
|
81010
81095
|
].filter((part) => part !== void 0);
|
|
81011
81096
|
const transform = transformParts.length > 0 ? transformParts.join("+") : void 0;
|
|
@@ -81056,7 +81141,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
81056
81141
|
}
|
|
81057
81142
|
const partialDir = partialCacheEntryDir(cacheTarget.entry);
|
|
81058
81143
|
rmSync3(partialDir, { recursive: true, force: true });
|
|
81059
|
-
|
|
81144
|
+
mkdirSync7(partialDir, { recursive: true });
|
|
81060
81145
|
const attempted = await runVideoExtractionWithRetry(
|
|
81061
81146
|
() => extractVideoFramesRange(
|
|
81062
81147
|
work.videoPath,
|
|
@@ -81074,7 +81159,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
81074
81159
|
onRetry: () => {
|
|
81075
81160
|
recordTransientRetries(1);
|
|
81076
81161
|
rmSync3(partialDir, { recursive: true, force: true });
|
|
81077
|
-
|
|
81162
|
+
mkdirSync7(partialDir, { recursive: true });
|
|
81078
81163
|
}
|
|
81079
81164
|
}
|
|
81080
81165
|
);
|
|
@@ -81180,9 +81265,9 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
81180
81265
|
if (keyInput) keyInput.mediaStart = extractionMediaStart;
|
|
81181
81266
|
const format = resolveFrameFormat(metadata, options.format);
|
|
81182
81267
|
const sdrToHdrTransfer = sdrToHdrTransfers[index];
|
|
81183
|
-
const
|
|
81268
|
+
const hdrToSdrTransform = options.toneMapHdrToSdr === true && isHdrColorSpace(metadata.colorSpace) ? await hdrToSdrTransformKey() : void 0;
|
|
81184
81269
|
const finalFrameOnly = window3.finalFrameOnly === true;
|
|
81185
|
-
const dedupeKey = `${videoPath}\0${extractionMediaStart}\0${videoDuration}\0${fpsKey}\0${format}\0${sdrToHdrTransfer ?? ""}\0${
|
|
81270
|
+
const dedupeKey = `${videoPath}\0${extractionMediaStart}\0${videoDuration}\0${fpsKey}\0${format}\0${sdrToHdrTransfer ?? ""}\0${hdrToSdrTransform ?? ""}\0${finalFrameOnly ? "final" : "range"}`;
|
|
81186
81271
|
return {
|
|
81187
81272
|
work: {
|
|
81188
81273
|
video,
|
|
@@ -81194,7 +81279,7 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
|
|
|
81194
81279
|
finalFrameOnly,
|
|
81195
81280
|
format,
|
|
81196
81281
|
sdrToHdrTransfer,
|
|
81197
|
-
|
|
81282
|
+
hdrToSdrTransformKey: hdrToSdrTransform,
|
|
81198
81283
|
dedupeKey
|
|
81199
81284
|
}
|
|
81200
81285
|
};
|
|
@@ -81337,7 +81422,7 @@ function createFrameLookupTable(videos, extracted, fps) {
|
|
|
81337
81422
|
}
|
|
81338
81423
|
return table;
|
|
81339
81424
|
}
|
|
81340
|
-
var VIDEO_FRAME_FORMATS, EXTRACT_CACHE_MIN_AGE_MS, GC_STALENESS_MS, SDR_TO_HDR_COLORSPACE_FILTER,
|
|
81425
|
+
var VIDEO_FRAME_FORMATS, EXTRACT_CACHE_MIN_AGE_MS, GC_STALENESS_MS, SDR_TO_HDR_COLORSPACE_FILTER, HDR_TO_SDR_ZSCALE_TRANSFORM_KEY, HDR_TO_SDR_VIDEOTOOLBOX_TRANSFORM_KEY, SDR_CANVAS_PASSTHROUGH_FILTER, SDR_JPEG_AS_BT601_FULL_RANGE_FILTER, warnedMissingZscale, VideoSourceExtractionError, CHROME_BT601_UNTAGGED_CODECS, NUT_RAW_PIXEL_FORMATS, TRANSIENT_FFMPEG_SPAWN_CODES, FINAL_FRAME_LOGICAL_DURATION_SECONDS, ALPHA_CAPABLE_CODECS, FrameLookupTable;
|
|
81341
81426
|
var init_videoFrameExtractor = __esm({
|
|
81342
81427
|
"../engine/src/services/videoFrameExtractor.ts"() {
|
|
81343
81428
|
"use strict";
|
|
@@ -81350,6 +81435,7 @@ var init_videoFrameExtractor = __esm({
|
|
|
81350
81435
|
init_hdr();
|
|
81351
81436
|
init_urlDownloader();
|
|
81352
81437
|
init_runFfmpeg();
|
|
81438
|
+
init_psnrFilterAvailability();
|
|
81353
81439
|
init_config();
|
|
81354
81440
|
init_htmlTemplate();
|
|
81355
81441
|
init_extractionCache();
|
|
@@ -81358,10 +81444,11 @@ var init_videoFrameExtractor = __esm({
|
|
|
81358
81444
|
EXTRACT_CACHE_MIN_AGE_MS = 60 * 60 * 1e3;
|
|
81359
81445
|
GC_STALENESS_MS = 24 * 60 * 60 * 1e3;
|
|
81360
81446
|
SDR_TO_HDR_COLORSPACE_FILTER = "colorspace=all=bt2020:iall=bt709:range=tv";
|
|
81361
|
-
|
|
81362
|
-
|
|
81447
|
+
HDR_TO_SDR_ZSCALE_TRANSFORM_KEY = "hdr2sdr-hable-srgb";
|
|
81448
|
+
HDR_TO_SDR_VIDEOTOOLBOX_TRANSFORM_KEY = "hdr2sdr-videotoolbox-hdr";
|
|
81363
81449
|
SDR_CANVAS_PASSTHROUGH_FILTER = "setparams=color_primaries=bt709:color_trc=iec61966-2-1";
|
|
81364
81450
|
SDR_JPEG_AS_BT601_FULL_RANGE_FILTER = "scale=flags=neighbor,format=gbrp,scale=out_color_matrix=bt601:out_range=pc:flags=neighbor,format=yuv420p";
|
|
81451
|
+
warnedMissingZscale = false;
|
|
81365
81452
|
VideoSourceExtractionError = class extends Error {
|
|
81366
81453
|
constructor(kind, retryable, message, diagnostic = message) {
|
|
81367
81454
|
super(message);
|
|
@@ -81580,10 +81667,10 @@ function createFrameSourceCache(entryLimit, bytesLimit, frameSrcResolver) {
|
|
|
81580
81667
|
async function get(framePath) {
|
|
81581
81668
|
const servedSrc = frameSrcResolver?.(framePath);
|
|
81582
81669
|
if (servedSrc) return servedSrc;
|
|
81583
|
-
const
|
|
81584
|
-
if (
|
|
81585
|
-
remember(framePath,
|
|
81586
|
-
return
|
|
81670
|
+
const cached = cache2.get(framePath);
|
|
81671
|
+
if (cached) {
|
|
81672
|
+
remember(framePath, cached);
|
|
81673
|
+
return cached;
|
|
81587
81674
|
}
|
|
81588
81675
|
const existing = inFlight.get(framePath);
|
|
81589
81676
|
if (existing) {
|
|
@@ -82604,8 +82691,8 @@ var init_audioFxRender = __esm({
|
|
|
82604
82691
|
});
|
|
82605
82692
|
|
|
82606
82693
|
// ../engine/src/services/audioMixer.ts
|
|
82607
|
-
import { closeSync as closeSync3, existsSync as existsSync13, mkdirSync as
|
|
82608
|
-
import { join as join16, dirname as dirname10, isAbsolute as
|
|
82694
|
+
import { closeSync as closeSync3, existsSync as existsSync13, mkdirSync as mkdirSync8, mkdtempSync as mkdtempSync5, openSync as openSync3, rmSync as rmSync6, writeFileSync as writeFileSync6 } from "fs";
|
|
82695
|
+
import { join as join16, dirname as dirname10, isAbsolute as isAbsolute3, relative as relative3 } from "path";
|
|
82609
82696
|
function memberGroupKey(el) {
|
|
82610
82697
|
return el.getAttribute(AUDIO_GROUP_RENDER_ID_ATTR) ?? el.getAttribute(HF_AUDIO_GROUP_ATTR);
|
|
82611
82698
|
}
|
|
@@ -82787,8 +82874,8 @@ function buildTrackInputFilter(track, index, volumeFilter, totalDuration) {
|
|
|
82787
82874
|
return `[${index}:a]atrim=0:${formatFilterNumber(trimDuration)},${volumeFilter}${buildFadeFilters(track)},adelay=${delayMs}|${delayMs},apad,asetpts=N/SR/TB,atrim=0:${formatFilterNumber(totalDuration)}[a${index}]`;
|
|
82788
82875
|
}
|
|
82789
82876
|
function missingSourceMessage(elementId, src, baseDir, resolvedPath) {
|
|
82790
|
-
const relativePath =
|
|
82791
|
-
const insideProject = !relativePath.startsWith("..") && !
|
|
82877
|
+
const relativePath = relative3(baseDir, resolvedPath).replace(/\\/g, "/");
|
|
82878
|
+
const insideProject = !relativePath.startsWith("..") && !isAbsolute3(relativePath);
|
|
82792
82879
|
const authored = /^([\\/]|[A-Za-z]:)/.test(src) ? "" : `src="${src}" `;
|
|
82793
82880
|
return `Source not found for audio element ${elementId}: ${authored}resolved to ${insideProject ? relativePath : "a path outside the project"}`;
|
|
82794
82881
|
}
|
|
@@ -82963,7 +83050,7 @@ function parseAudioElements(html) {
|
|
|
82963
83050
|
async function extractAudioFromVideo(videoPath, outputPath, options, signal, config) {
|
|
82964
83051
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
82965
83052
|
const outputDir = dirname10(outputPath);
|
|
82966
|
-
if (!existsSync13(outputDir))
|
|
83053
|
+
if (!existsSync13(outputDir)) mkdirSync8(outputDir, { recursive: true });
|
|
82967
83054
|
const playbackRate = normalizeRateSpec(options?.playbackRate);
|
|
82968
83055
|
const args = [];
|
|
82969
83056
|
if (options?.startTime !== void 0) args.push("-ss", String(options.startTime));
|
|
@@ -83009,7 +83096,7 @@ async function extractAudioFromVideo(videoPath, outputPath, options, signal, con
|
|
|
83009
83096
|
async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, playbackRate = 1, signal, config) {
|
|
83010
83097
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
83011
83098
|
const outputDir = dirname10(outputPath);
|
|
83012
|
-
if (!existsSync13(outputDir))
|
|
83099
|
+
if (!existsSync13(outputDir)) mkdirSync8(outputDir, { recursive: true });
|
|
83013
83100
|
const normalizedPlaybackRate = normalizeRateSpec(playbackRate);
|
|
83014
83101
|
const outputArgs = await preparedAudioOutputArgs(srcPath, normalizedPlaybackRate, duration);
|
|
83015
83102
|
const args = [
|
|
@@ -83056,7 +83143,7 @@ async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, play
|
|
|
83056
83143
|
async function generateSilence(outputPath, duration, signal, config) {
|
|
83057
83144
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
83058
83145
|
const outputDir = dirname10(outputPath);
|
|
83059
|
-
if (!existsSync13(outputDir))
|
|
83146
|
+
if (!existsSync13(outputDir)) mkdirSync8(outputDir, { recursive: true });
|
|
83060
83147
|
const args = [
|
|
83061
83148
|
"-f",
|
|
83062
83149
|
"lavfi",
|
|
@@ -83110,7 +83197,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
|
|
|
83110
83197
|
};
|
|
83111
83198
|
}
|
|
83112
83199
|
const outputDir = dirname10(outputPath);
|
|
83113
|
-
if (!existsSync13(outputDir))
|
|
83200
|
+
if (!existsSync13(outputDir)) mkdirSync8(outputDir, { recursive: true });
|
|
83114
83201
|
const buildFilterComplex = (ignoreAutomation) => {
|
|
83115
83202
|
const filterParts = [];
|
|
83116
83203
|
tracks.forEach((track, i) => {
|
|
@@ -83214,7 +83301,7 @@ function groupNormalizeOptionUnsupported(stderr) {
|
|
|
83214
83301
|
async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal, config) {
|
|
83215
83302
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
83216
83303
|
const outputDir = dirname10(outputPath);
|
|
83217
|
-
if (!existsSync13(outputDir))
|
|
83304
|
+
if (!existsSync13(outputDir)) mkdirSync8(outputDir, { recursive: true });
|
|
83218
83305
|
const buildInputFilters = (ignoreKeyframes) => memberTracks.map((track, i) => {
|
|
83219
83306
|
const volumeFilter = buildVolumeExpression(track, ignoreKeyframes);
|
|
83220
83307
|
return buildTrackInputFilter(track, i, volumeFilter, totalDuration);
|
|
@@ -83301,7 +83388,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
|
|
|
83301
83388
|
const failures = [];
|
|
83302
83389
|
const groupTracks = /* @__PURE__ */ new Map();
|
|
83303
83390
|
const groupMeta = /* @__PURE__ */ new Map();
|
|
83304
|
-
if (!existsSync13(workDir))
|
|
83391
|
+
if (!existsSync13(workDir)) mkdirSync8(workDir, { recursive: true });
|
|
83305
83392
|
const internalController = new AbortController();
|
|
83306
83393
|
const effectiveSignal = internalController.signal;
|
|
83307
83394
|
if (signal) {
|
|
@@ -83802,7 +83889,7 @@ var init_readWebGlVendorInfoFromCanvas = __esm({
|
|
|
83802
83889
|
|
|
83803
83890
|
// ../engine/src/services/parallelCoordinator.ts
|
|
83804
83891
|
import { cpus, freemem } from "os";
|
|
83805
|
-
import { existsSync as existsSync14, mkdirSync as
|
|
83892
|
+
import { existsSync as existsSync14, mkdirSync as mkdirSync9, readdirSync as readdirSync6 } from "fs";
|
|
83806
83893
|
import { copyFile, readFile as readFile2, rename } from "fs/promises";
|
|
83807
83894
|
import { join as join18 } from "path";
|
|
83808
83895
|
import { getHeapStatistics } from "v8";
|
|
@@ -84155,7 +84242,7 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
|
|
|
84155
84242
|
async function executeWorkerTask(task, serverUrl, captureOptions, createBeforeCaptureHook, signal, onFrameCaptured, onFrameBuffer, config, parallel, onFailure, onWorkerPhase) {
|
|
84156
84243
|
const startTime = Date.now();
|
|
84157
84244
|
let framesCaptured = 0;
|
|
84158
|
-
if (!existsSync14(task.outputDir))
|
|
84245
|
+
if (!existsSync14(task.outputDir)) mkdirSync9(task.outputDir, { recursive: true });
|
|
84159
84246
|
let session = null;
|
|
84160
84247
|
let perf;
|
|
84161
84248
|
const needsSeparateBrowsers = shouldDisableBrowserPoolForParallelWorker({
|
|
@@ -84374,7 +84461,7 @@ async function executeParallelCapture(serverUrl, workDir, tasks, captureOptions,
|
|
|
84374
84461
|
return results;
|
|
84375
84462
|
}
|
|
84376
84463
|
async function mergeWorkerFrames(workDir, tasks, outputDir) {
|
|
84377
|
-
if (!existsSync14(outputDir))
|
|
84464
|
+
if (!existsSync14(outputDir)) mkdirSync9(outputDir, { recursive: true });
|
|
84378
84465
|
let totalFrames = 0;
|
|
84379
84466
|
const sortedTasks = [...tasks].sort((a, b) => a.startFrame - b.startFrame);
|
|
84380
84467
|
for (const task of sortedTasks) {
|
|
@@ -84429,7 +84516,7 @@ var init_parallelCoordinator = __esm({
|
|
|
84429
84516
|
// ../engine/src/services/fileServer.ts
|
|
84430
84517
|
import { Hono } from "hono";
|
|
84431
84518
|
import { serve } from "@hono/node-server";
|
|
84432
|
-
import { readFileSync as readFileSync7, openSync as openSync4, fstatSync, closeSync as closeSync4, statSync as
|
|
84519
|
+
import { readFileSync as readFileSync7, openSync as openSync4, fstatSync, closeSync as closeSync4, statSync as statSync7, constants as constants2 } from "fs";
|
|
84433
84520
|
import { join as join19, extname as extname3 } from "path";
|
|
84434
84521
|
function readRegularFile(filePath) {
|
|
84435
84522
|
let fd;
|
|
@@ -84438,7 +84525,7 @@ function readRegularFile(filePath) {
|
|
|
84438
84525
|
} catch (error) {
|
|
84439
84526
|
if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
|
|
84440
84527
|
return null;
|
|
84441
|
-
if (!
|
|
84528
|
+
if (!statSync7(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
84442
84529
|
throw error;
|
|
84443
84530
|
}
|
|
84444
84531
|
try {
|
|
@@ -89011,7 +89098,7 @@ __export(fontCompression_exports, {
|
|
|
89011
89098
|
import { createHash as createHash8 } from "crypto";
|
|
89012
89099
|
import {
|
|
89013
89100
|
existsSync as existsSync23,
|
|
89014
|
-
mkdirSync as
|
|
89101
|
+
mkdirSync as mkdirSync14,
|
|
89015
89102
|
mkdtempSync as mkdtempSync8,
|
|
89016
89103
|
readFileSync as readFileSync11,
|
|
89017
89104
|
renameSync as renameSync5,
|
|
@@ -89037,8 +89124,8 @@ function cachedCompressionPath(input, originalFormat, cacheDir) {
|
|
|
89037
89124
|
function readCachedCompression(path) {
|
|
89038
89125
|
try {
|
|
89039
89126
|
if (!existsSync23(path)) return null;
|
|
89040
|
-
const
|
|
89041
|
-
return
|
|
89127
|
+
const cached = readFileSync11(path);
|
|
89128
|
+
return cached.length > 0 ? cached : null;
|
|
89042
89129
|
} catch {
|
|
89043
89130
|
return null;
|
|
89044
89131
|
}
|
|
@@ -89046,7 +89133,7 @@ function readCachedCompression(path) {
|
|
|
89046
89133
|
function cacheCompression(path, compressed) {
|
|
89047
89134
|
let tempDir;
|
|
89048
89135
|
try {
|
|
89049
|
-
|
|
89136
|
+
mkdirSync14(dirname14(path), { recursive: true });
|
|
89050
89137
|
tempDir = mkdtempSync8(join32(dirname14(path), ".compression-"));
|
|
89051
89138
|
const tmpPath = join32(tempDir, "font.woff2");
|
|
89052
89139
|
writeFileSync9(tmpPath, compressed, { flag: "wx", mode: 420 });
|
|
@@ -89072,8 +89159,8 @@ async function fontToDataUri(input, originalFormat, options = {}) {
|
|
|
89072
89159
|
originalFormat,
|
|
89073
89160
|
options.cacheDir ?? defaultCacheDir()
|
|
89074
89161
|
);
|
|
89075
|
-
const
|
|
89076
|
-
if (
|
|
89162
|
+
const cached = readCachedCompression(cachePath);
|
|
89163
|
+
if (cached) return `data:font/woff2;base64,${cached.toString("base64")}`;
|
|
89077
89164
|
const compressed = await (options.compressImpl ?? compressToWoff2)(input);
|
|
89078
89165
|
cacheCompression(cachePath, compressed);
|
|
89079
89166
|
return `data:font/woff2;base64,${compressed.toString("base64")}`;
|
|
@@ -89105,12 +89192,12 @@ init_dist();
|
|
|
89105
89192
|
init_src();
|
|
89106
89193
|
import {
|
|
89107
89194
|
existsSync as existsSync33,
|
|
89108
|
-
mkdirSync as
|
|
89195
|
+
mkdirSync as mkdirSync20,
|
|
89109
89196
|
mkdtempSync as mkdtempSync11,
|
|
89110
89197
|
readFileSync as readFileSync16,
|
|
89111
89198
|
readdirSync as readdirSync12,
|
|
89112
89199
|
rmSync as rmSync15,
|
|
89113
|
-
statSync as
|
|
89200
|
+
statSync as statSync13,
|
|
89114
89201
|
writeFileSync as writeFileSync12,
|
|
89115
89202
|
copyFileSync as copyFileSync6,
|
|
89116
89203
|
appendFileSync
|
|
@@ -89129,7 +89216,7 @@ import { serve as serve2 } from "@hono/node-server";
|
|
|
89129
89216
|
import {
|
|
89130
89217
|
existsSync as existsSync17,
|
|
89131
89218
|
realpathSync as realpathSync2,
|
|
89132
|
-
statSync as
|
|
89219
|
+
statSync as statSync8,
|
|
89133
89220
|
createReadStream as createReadStream3,
|
|
89134
89221
|
openSync as openSync5,
|
|
89135
89222
|
fstatSync as fstatSync2,
|
|
@@ -89720,7 +89807,7 @@ function openRegularFile(filePath) {
|
|
|
89720
89807
|
} catch (error) {
|
|
89721
89808
|
if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
|
|
89722
89809
|
return null;
|
|
89723
|
-
if (!
|
|
89810
|
+
if (!statSync8(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
89724
89811
|
throw error;
|
|
89725
89812
|
}
|
|
89726
89813
|
let accepted = false;
|
|
@@ -89897,12 +89984,12 @@ import {
|
|
|
89897
89984
|
copyFileSync as copyFileSync3,
|
|
89898
89985
|
cpSync,
|
|
89899
89986
|
existsSync as existsSync18,
|
|
89900
|
-
mkdirSync as
|
|
89987
|
+
mkdirSync as mkdirSync10,
|
|
89901
89988
|
rmSync as rmSync7,
|
|
89902
89989
|
symlinkSync,
|
|
89903
89990
|
writeFileSync as writeFileSync7
|
|
89904
89991
|
} from "fs";
|
|
89905
|
-
import { basename as basename4, dirname as dirname12, isAbsolute as
|
|
89992
|
+
import { basename as basename4, dirname as dirname12, isAbsolute as isAbsolute4, join as join23, relative as relative4, resolve as resolve8 } from "path";
|
|
89906
89993
|
|
|
89907
89994
|
// ../producer/src/utils/paths.ts
|
|
89908
89995
|
import {
|
|
@@ -89983,11 +90070,11 @@ function resolveDeviceScaleFactor(input) {
|
|
|
89983
90070
|
}
|
|
89984
90071
|
function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
89985
90072
|
const compileDir = join23(workDir, "compiled");
|
|
89986
|
-
|
|
90073
|
+
mkdirSync10(compileDir, { recursive: true });
|
|
89987
90074
|
writeFileSync7(join23(compileDir, "index.html"), compiled.html, "utf-8");
|
|
89988
90075
|
for (const [srcPath, html] of compiled.subCompositions) {
|
|
89989
90076
|
const outPath = join23(compileDir, srcPath);
|
|
89990
|
-
|
|
90077
|
+
mkdirSync10(dirname12(outPath), { recursive: true });
|
|
89991
90078
|
writeFileSync7(outPath, html, "utf-8");
|
|
89992
90079
|
}
|
|
89993
90080
|
for (const [relativePath, absolutePath] of compiled.externalAssets) {
|
|
@@ -89996,7 +90083,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
|
89996
90083
|
console.warn(`[Render] Skipping external asset with unsafe path: ${relativePath}`);
|
|
89997
90084
|
continue;
|
|
89998
90085
|
}
|
|
89999
|
-
|
|
90086
|
+
mkdirSync10(dirname12(outPath), { recursive: true });
|
|
90000
90087
|
copyFileSync3(absolutePath, outPath);
|
|
90001
90088
|
}
|
|
90002
90089
|
if (includeSummary) {
|
|
@@ -90084,12 +90171,12 @@ var materializePathModule = {
|
|
|
90084
90171
|
join: join23,
|
|
90085
90172
|
dirname: dirname12,
|
|
90086
90173
|
basename: basename4,
|
|
90087
|
-
relative:
|
|
90088
|
-
isAbsolute:
|
|
90174
|
+
relative: relative4,
|
|
90175
|
+
isAbsolute: isAbsolute4
|
|
90089
90176
|
};
|
|
90090
90177
|
var materializeFileSystem = {
|
|
90091
90178
|
existsSync: existsSync18,
|
|
90092
|
-
mkdirSync:
|
|
90179
|
+
mkdirSync: mkdirSync10,
|
|
90093
90180
|
symlinkSync,
|
|
90094
90181
|
cpSync,
|
|
90095
90182
|
rmSync: rmSync7
|
|
@@ -90745,7 +90832,7 @@ function replanAfterFailure(plan2, failure) {
|
|
|
90745
90832
|
|
|
90746
90833
|
// ../producer/src/services/render/stages/captureSegmentedStage.ts
|
|
90747
90834
|
init_src();
|
|
90748
|
-
import { existsSync as existsSync20, mkdirSync as
|
|
90835
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync12, rmSync as rmSync10, statSync as statSync9 } from "fs";
|
|
90749
90836
|
import { join as join28 } from "path";
|
|
90750
90837
|
|
|
90751
90838
|
// ../producer/src/services/render/captureStageError.ts
|
|
@@ -91335,7 +91422,7 @@ import {
|
|
|
91335
91422
|
closeSync as closeSync8,
|
|
91336
91423
|
constants as constants4,
|
|
91337
91424
|
fstatSync as fstatSync4,
|
|
91338
|
-
mkdirSync as
|
|
91425
|
+
mkdirSync as mkdirSync11,
|
|
91339
91426
|
mkdtempSync as mkdtempSync7,
|
|
91340
91427
|
openSync as openSync7,
|
|
91341
91428
|
readFileSync as readFileSync9,
|
|
@@ -91547,7 +91634,7 @@ async function extractHdrVideoFrames(args) {
|
|
|
91547
91634
|
const extractMediaMetadataImpl = args.extractMediaMetadataImpl ?? extractMediaMetadata;
|
|
91548
91635
|
const resolveFinalFrameExtractionWindowImpl = args.resolveFinalFrameExtractionWindowImpl ?? resolveFinalFrameExtractionWindow;
|
|
91549
91636
|
const out = /* @__PURE__ */ new Map();
|
|
91550
|
-
|
|
91637
|
+
mkdirSync11(framesDir, { recursive: true });
|
|
91551
91638
|
const plannedVideos = [];
|
|
91552
91639
|
const extractionWindows = /* @__PURE__ */ new Map();
|
|
91553
91640
|
for (const [videoId, srcPath] of prep.hdrVideoSrcPaths) {
|
|
@@ -91585,7 +91672,7 @@ async function extractHdrVideoFrames(args) {
|
|
|
91585
91672
|
const video = composition.videos.find((v) => v.id === videoId);
|
|
91586
91673
|
const window3 = extractionWindows.get(videoId);
|
|
91587
91674
|
if (!video || !window3) continue;
|
|
91588
|
-
|
|
91675
|
+
mkdirSync11(framesDir, { recursive: true });
|
|
91589
91676
|
const frameDir = mkdtempSync7(join26(framesDir, `hdr_${tempDirSafePrefix(videoId)}-`));
|
|
91590
91677
|
createdFrameDirs.add(frameDir);
|
|
91591
91678
|
const dims = prep.hdrExtractionDims.get(videoId) ?? { width, height };
|
|
@@ -92869,7 +92956,7 @@ async function captureSegment(ctx, segment) {
|
|
|
92869
92956
|
path: segmentPath,
|
|
92870
92957
|
// Recorded so resume can prove the file on disk is the one that
|
|
92871
92958
|
// finished; absent only in unit tests, whose fake encoder writes none.
|
|
92872
|
-
bytes: existsSync20(segmentPath) ?
|
|
92959
|
+
bytes: existsSync20(segmentPath) ? statSync9(segmentPath).size : 0
|
|
92873
92960
|
});
|
|
92874
92961
|
return encodeResult.durationMs;
|
|
92875
92962
|
} finally {
|
|
@@ -93050,7 +93137,7 @@ async function runCaptureSegmentedStage(input) {
|
|
|
93050
93137
|
const deps = { ...DEFAULT_DEPS, ...input.deps };
|
|
93051
93138
|
const segments = planSegments(input.totalFrames, input.segmentFrames);
|
|
93052
93139
|
const segmentDir = input.segmentDir ?? join28(input.workDir, "segments");
|
|
93053
|
-
|
|
93140
|
+
mkdirSync12(segmentDir, { recursive: true });
|
|
93054
93141
|
const skip = input.completedSegments ?? /* @__PURE__ */ new Set();
|
|
93055
93142
|
const pending = segments.filter((s) => !skip.has(s.index));
|
|
93056
93143
|
for (const index of skip) log.info("[Render] segment skipped (resume)", { index });
|
|
@@ -93122,7 +93209,7 @@ async function runCaptureSegmentedStage(input) {
|
|
|
93122
93209
|
|
|
93123
93210
|
// ../producer/src/services/render/segmentManifest.ts
|
|
93124
93211
|
import { createHash as createHash6 } from "crypto";
|
|
93125
|
-
import { existsSync as existsSync21, mkdirSync as
|
|
93212
|
+
import { existsSync as existsSync21, mkdirSync as mkdirSync13, readFileSync as readFileSync10, renameSync as renameSync4, statSync as statSync10, writeFileSync as writeFileSync8 } from "fs";
|
|
93126
93213
|
import { join as join29 } from "path";
|
|
93127
93214
|
var MANIFEST_FILENAME = "segments.json";
|
|
93128
93215
|
function computeSegmentPlanHash(input) {
|
|
@@ -93174,14 +93261,14 @@ function readSegmentManifest(segmentDir) {
|
|
|
93174
93261
|
}
|
|
93175
93262
|
}
|
|
93176
93263
|
function writeSegmentManifest(segmentDir, manifest) {
|
|
93177
|
-
|
|
93264
|
+
mkdirSync13(segmentDir, { recursive: true });
|
|
93178
93265
|
const tmp = join29(segmentDir, `${MANIFEST_FILENAME}.${process.pid}.tmp`);
|
|
93179
93266
|
writeFileSync8(tmp, JSON.stringify(manifest, null, 2), "utf-8");
|
|
93180
93267
|
renameSync4(tmp, join29(segmentDir, MANIFEST_FILENAME));
|
|
93181
93268
|
}
|
|
93182
|
-
async function probeSegmentFrameCount(path,
|
|
93269
|
+
async function probeSegmentFrameCount(path, probe) {
|
|
93183
93270
|
try {
|
|
93184
|
-
const meta = await
|
|
93271
|
+
const meta = await probe(path);
|
|
93185
93272
|
if (!Number.isFinite(meta.videoStreamDurationSeconds) || !Number.isFinite(meta.fps))
|
|
93186
93273
|
return null;
|
|
93187
93274
|
if (meta.fps <= 0) return null;
|
|
@@ -93195,7 +93282,7 @@ async function validateCompletedSegments(manifest, expectedHash, probeFrames) {
|
|
|
93195
93282
|
if (manifest.planHash !== expectedHash) return ok;
|
|
93196
93283
|
for (const entry of manifest.completed) {
|
|
93197
93284
|
if (!existsSync21(entry.path)) continue;
|
|
93198
|
-
const size =
|
|
93285
|
+
const size = statSync10(entry.path).size;
|
|
93199
93286
|
if (size <= 0 || size !== entry.bytes) continue;
|
|
93200
93287
|
const frames = await probeFrames(entry.path);
|
|
93201
93288
|
if (frames !== entry.endFrame - entry.startFrame) continue;
|
|
@@ -93989,8 +94076,8 @@ init_compiler();
|
|
|
93989
94076
|
init_subCompositionValidity();
|
|
93990
94077
|
init_assetResolution();
|
|
93991
94078
|
import { createHash as createHash11 } from "crypto";
|
|
93992
|
-
import { createReadStream as createReadStream4, existsSync as existsSync27, mkdirSync as
|
|
93993
|
-
import { join as join35, dirname as dirname16, resolve as resolve12, basename as basename6, relative as
|
|
94079
|
+
import { createReadStream as createReadStream4, existsSync as existsSync27, mkdirSync as mkdirSync17, readFileSync as readFileSync14 } from "fs";
|
|
94080
|
+
import { join as join35, dirname as dirname16, resolve as resolve12, basename as basename6, relative as relative5 } from "path";
|
|
93994
94081
|
|
|
93995
94082
|
// ../producer/src/services/renderMediaCollector.ts
|
|
93996
94083
|
init_esm10();
|
|
@@ -94093,7 +94180,7 @@ init_src();
|
|
|
94093
94180
|
|
|
94094
94181
|
// ../producer/src/services/deterministicFonts.ts
|
|
94095
94182
|
import { createHash as createHash9 } from "crypto";
|
|
94096
|
-
import { existsSync as existsSync24, mkdirSync as
|
|
94183
|
+
import { existsSync as existsSync24, mkdirSync as mkdirSync15, mkdtempSync as mkdtempSync9, readFileSync as readFileSync12, writeFileSync as writeFileSync10 } from "fs";
|
|
94097
94184
|
import { homedir as homedir5, tmpdir as tmpdir6 } from "os";
|
|
94098
94185
|
import { join as join33 } from "path";
|
|
94099
94186
|
|
|
@@ -95026,12 +95113,12 @@ function fontCacheDir(slug) {
|
|
|
95026
95113
|
const dir = join33(resolveFontCacheRoot(), slug);
|
|
95027
95114
|
if (!existsSync24(dir)) {
|
|
95028
95115
|
try {
|
|
95029
|
-
|
|
95116
|
+
mkdirSync15(dir, { recursive: true });
|
|
95030
95117
|
} catch {
|
|
95031
95118
|
const firstFallback = ephemeralFontCacheRoot === void 0;
|
|
95032
95119
|
ephemeralFontCacheRoot ??= mkdtempSync9(join33(tmpdir6(), "hyperframes-fonts-"));
|
|
95033
95120
|
const fallback = join33(ephemeralFontCacheRoot, slug);
|
|
95034
|
-
|
|
95121
|
+
mkdirSync15(fallback, { recursive: true });
|
|
95035
95122
|
if (firstFallback) {
|
|
95036
95123
|
defaultLogger.warn(
|
|
95037
95124
|
`Font cache directory is unwritable (${dir}). Using temporary fallback \u2014 fonts will re-download each run. Fix with: chmod 755 ${resolveFontCacheRoot()}`
|
|
@@ -95531,13 +95618,13 @@ import { createHash as createHash10 } from "crypto";
|
|
|
95531
95618
|
import {
|
|
95532
95619
|
copyFileSync as copyFileSync4,
|
|
95533
95620
|
existsSync as existsSync25,
|
|
95534
|
-
mkdirSync as
|
|
95621
|
+
mkdirSync as mkdirSync16,
|
|
95535
95622
|
readFileSync as readFileSync13,
|
|
95536
95623
|
renameSync as renameSync6,
|
|
95537
95624
|
rmSync as rmSync12,
|
|
95538
|
-
statSync as
|
|
95625
|
+
statSync as statSync11
|
|
95539
95626
|
} from "fs";
|
|
95540
|
-
import { dirname as dirname15, isAbsolute as
|
|
95627
|
+
import { dirname as dirname15, isAbsolute as isAbsolute5, join as join34, resolve as resolve11 } from "path";
|
|
95541
95628
|
var PREPARED_GIF_SUBDIR = "_animated_gif";
|
|
95542
95629
|
var CACHE_SCHEMA = "hfgif-v1";
|
|
95543
95630
|
function splitUrlSuffix(src) {
|
|
@@ -95576,14 +95663,14 @@ function resolveGifSourcePath(src, options) {
|
|
|
95576
95663
|
if (isHttpUrl(trimmed)) return null;
|
|
95577
95664
|
const projectRelative = basePath.startsWith("/") ? basePath.slice(1) : basePath;
|
|
95578
95665
|
const candidates = [
|
|
95579
|
-
|
|
95666
|
+
isAbsolute5(basePath) ? basePath : resolve11(options.projectDir, projectRelative),
|
|
95580
95667
|
resolve11(options.downloadDir, normalizedBase)
|
|
95581
95668
|
];
|
|
95582
95669
|
return candidates.find((candidate) => existsSync25(candidate)) ?? null;
|
|
95583
95670
|
}
|
|
95584
95671
|
function isUsableFile(path) {
|
|
95585
95672
|
try {
|
|
95586
|
-
const stat =
|
|
95673
|
+
const stat = statSync11(path);
|
|
95587
95674
|
return stat.isFile() && stat.size > 0;
|
|
95588
95675
|
} catch {
|
|
95589
95676
|
return false;
|
|
@@ -95691,10 +95778,10 @@ async function runAnimatedGifTranscode(request) {
|
|
|
95691
95778
|
}
|
|
95692
95779
|
async function ensurePreparedWebm(input) {
|
|
95693
95780
|
if (!existsSync25(dirname15(input.cachePath))) {
|
|
95694
|
-
|
|
95781
|
+
mkdirSync16(dirname15(input.cachePath), { recursive: true });
|
|
95695
95782
|
}
|
|
95696
95783
|
if (!existsSync25(dirname15(input.outputPath))) {
|
|
95697
|
-
|
|
95784
|
+
mkdirSync16(dirname15(input.outputPath), { recursive: true });
|
|
95698
95785
|
}
|
|
95699
95786
|
if (!isUsableFile(input.cachePath)) {
|
|
95700
95787
|
const tmpPath = `${input.cachePath}.tmp-${process.pid}-${Date.now()}`;
|
|
@@ -96124,7 +96211,7 @@ function studioPositionSeekReapplyRuntime() {
|
|
|
96124
96211
|
}
|
|
96125
96212
|
|
|
96126
96213
|
// ../core/dist/generated/position-edits-render-inline.js
|
|
96127
|
-
var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,
|
|
96214
|
+
var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,E=(e,t)=>L.test(e)&&L.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,V=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${E(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${E(r,t)} ${E(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},G=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},b=new WeakMap;function B(e,t){let o=b.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(w)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,G(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=V(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),b.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),b.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var $="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,M=new WeakMap,H=new WeakMap;function F(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[$]),s=n=>{D.add(n);try{Object.defineProperty(n,$,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=M.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),M.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},v=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(v())return;let h=120,A=t.setInterval(()=>{if(v()){t.clearInterval(A);return}h-=1,h<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),F(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
|
|
96128
96215
|
function getPositionEditsRenderScript() {
|
|
96129
96216
|
return POSITION_EDITS_RENDER_IIFE;
|
|
96130
96217
|
}
|
|
@@ -96459,7 +96546,7 @@ function detectShaderTransitionUsage(html) {
|
|
|
96459
96546
|
async function resolveMediaDuration2(src, mediaStart, playbackRate, baseDir, downloadDir, tagName19, elementIdentity, log) {
|
|
96460
96547
|
let filePath = src;
|
|
96461
96548
|
if (isHttpUrl(src)) {
|
|
96462
|
-
if (!existsSync27(downloadDir))
|
|
96549
|
+
if (!existsSync27(downloadDir)) mkdirSync17(downloadDir, { recursive: true });
|
|
96463
96550
|
try {
|
|
96464
96551
|
filePath = await downloadToTemp(src, downloadDir, void 0, void 0, void 0, {
|
|
96465
96552
|
onTelemetry: logRemoteDownloadTelemetry
|
|
@@ -97046,7 +97133,7 @@ var REMOTE_SOURCE_TAG_RE = /<source\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+)["
|
|
|
97046
97133
|
var REMOTE_IMG_TAG_RE = /<img\b[^>]*?(?<![\w-])src\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
|
|
97047
97134
|
async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLabel, extraRewrite) {
|
|
97048
97135
|
if (urlSet.size === 0) return { html, remoteMediaAssets: /* @__PURE__ */ new Map() };
|
|
97049
|
-
if (!existsSync27(remoteDir))
|
|
97136
|
+
if (!existsSync27(remoteDir)) mkdirSync17(remoteDir, { recursive: true });
|
|
97050
97137
|
const urlToLocal = /* @__PURE__ */ new Map();
|
|
97051
97138
|
await Promise.all(
|
|
97052
97139
|
[...urlSet].map(async (url) => {
|
|
@@ -97358,7 +97445,7 @@ function rewriteUnresolvableGsapToCdn(html, projectDir) {
|
|
|
97358
97445
|
}
|
|
97359
97446
|
function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
|
|
97360
97447
|
if (!isPathInside3(htmlPath, projectDir)) return html;
|
|
97361
|
-
const entryPath =
|
|
97448
|
+
const entryPath = relative5(projectDir, htmlPath).replace(/\\/g, "/");
|
|
97362
97449
|
if (!entryPath.includes("/")) return html;
|
|
97363
97450
|
const { document: document2 } = parseHTML(html);
|
|
97364
97451
|
const assetExists = (path) => existsSync27(resolve12(projectDir, path));
|
|
@@ -97619,8 +97706,8 @@ async function discoverAudioVolumeAutomationFromTimeline(page, audioIds, composi
|
|
|
97619
97706
|
const volumeDescriptor = typeof HTMLMediaElement === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, "volume");
|
|
97620
97707
|
const nativeVolumeGet = volumeDescriptor?.get;
|
|
97621
97708
|
const nativeVolumeSet = volumeDescriptor?.set;
|
|
97622
|
-
const withUnclampedVolume2 = (el,
|
|
97623
|
-
if (!nativeVolumeGet || !nativeVolumeSet) return
|
|
97709
|
+
const withUnclampedVolume2 = (el, probe) => {
|
|
97710
|
+
if (!nativeVolumeGet || !nativeVolumeSet) return probe();
|
|
97624
97711
|
let authored = Number(nativeVolumeGet.call(el));
|
|
97625
97712
|
Object.defineProperty(el, "volume", {
|
|
97626
97713
|
configurable: true,
|
|
@@ -97631,7 +97718,7 @@ async function discoverAudioVolumeAutomationFromTimeline(page, audioIds, composi
|
|
|
97631
97718
|
}
|
|
97632
97719
|
});
|
|
97633
97720
|
try {
|
|
97634
|
-
return
|
|
97721
|
+
return probe();
|
|
97635
97722
|
} finally {
|
|
97636
97723
|
delete el.volume;
|
|
97637
97724
|
nativeVolumeSet.call(el, Math.max(0, Math.min(1, authored)));
|
|
@@ -99376,7 +99463,7 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
|
|
|
99376
99463
|
// ../producer/src/services/render/stages/captureHdrStage.ts
|
|
99377
99464
|
init_src();
|
|
99378
99465
|
init_dist2();
|
|
99379
|
-
import { existsSync as existsSync31, mkdirSync as
|
|
99466
|
+
import { existsSync as existsSync31, mkdirSync as mkdirSync18 } from "fs";
|
|
99380
99467
|
import { join as join44 } from "path";
|
|
99381
99468
|
|
|
99382
99469
|
// ../producer/src/services/hdrImageTransferCache.ts
|
|
@@ -100170,7 +100257,7 @@ async function runCaptureHdrStage(input) {
|
|
|
100170
100257
|
const debugDumpEnabled = process.env.KEEP_TEMP === "1";
|
|
100171
100258
|
const debugDumpDir = debugDumpEnabled ? join44(framesDir, "debug-composite") : null;
|
|
100172
100259
|
if (debugDumpDir && !existsSync31(debugDumpDir)) {
|
|
100173
|
-
|
|
100260
|
+
mkdirSync18(debugDumpDir, { recursive: true });
|
|
100174
100261
|
}
|
|
100175
100262
|
const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
|
|
100176
100263
|
const hdrTargetTransfer = compositeTransfer === "srgb" ? void 0 : compositeTransfer;
|
|
@@ -100323,11 +100410,11 @@ init_dist2();
|
|
|
100323
100410
|
import {
|
|
100324
100411
|
copyFileSync as copyFileSync5,
|
|
100325
100412
|
existsSync as existsSync32,
|
|
100326
|
-
mkdirSync as
|
|
100413
|
+
mkdirSync as mkdirSync19,
|
|
100327
100414
|
readdirSync as readdirSync11,
|
|
100328
100415
|
readFileSync as readFileSync15,
|
|
100329
100416
|
rmSync as rmSync13,
|
|
100330
|
-
statSync as
|
|
100417
|
+
statSync as statSync12,
|
|
100331
100418
|
writeFileSync as writeFileSync11
|
|
100332
100419
|
} from "fs";
|
|
100333
100420
|
import { dirname as dirname18, join as join46 } from "path";
|
|
@@ -100440,7 +100527,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
|
|
|
100440
100527
|
const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
|
|
100441
100528
|
if (failure) return failure;
|
|
100442
100529
|
}
|
|
100443
|
-
const fileSize = existsSync32(outputPath) ?
|
|
100530
|
+
const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
|
|
100444
100531
|
return {
|
|
100445
100532
|
success: true,
|
|
100446
100533
|
outputPath,
|
|
@@ -100478,7 +100565,7 @@ async function runEncodeStage(input) {
|
|
|
100478
100565
|
const stage5Start = Date.now();
|
|
100479
100566
|
if (isPngSequence) {
|
|
100480
100567
|
updateJobStatus(job, "encoding", "Writing PNG sequence", 75, onProgress);
|
|
100481
|
-
if (!existsSync32(outputPath))
|
|
100568
|
+
if (!existsSync32(outputPath)) mkdirSync19(outputPath, { recursive: true });
|
|
100482
100569
|
const captured = readdirSync11(framesDir).filter((name) => name.endsWith(".png")).sort();
|
|
100483
100570
|
if (captured.length === 0) {
|
|
100484
100571
|
throw new Error(
|
|
@@ -101083,7 +101170,7 @@ function sampleDirectoryBytes(dir) {
|
|
|
101083
101170
|
for (const name of entries2) {
|
|
101084
101171
|
const full2 = join48(current2, name);
|
|
101085
101172
|
try {
|
|
101086
|
-
const st =
|
|
101173
|
+
const st = statSync13(full2);
|
|
101087
101174
|
if (st.isDirectory()) {
|
|
101088
101175
|
stack.push(full2);
|
|
101089
101176
|
} else if (st.isFile()) {
|
|
@@ -101231,7 +101318,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
|
|
|
101231
101318
|
let rangeStart = null;
|
|
101232
101319
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
101233
101320
|
const framePath = join48(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
101234
|
-
const missing = !existsSync33(framePath) ||
|
|
101321
|
+
const missing = !existsSync33(framePath) || statSync13(framePath).size <= 8;
|
|
101235
101322
|
if (missing && rangeStart === null) {
|
|
101236
101323
|
rangeStart = frameIndex;
|
|
101237
101324
|
} else if (!missing && rangeStart !== null) {
|
|
@@ -101875,9 +101962,9 @@ function isRetryableEncoderDeath(err) {
|
|
|
101875
101962
|
const match = ENCODER_DEATH_FRAME_RE.exec(err.message);
|
|
101876
101963
|
return match !== null && Number(match[1]) >= 2;
|
|
101877
101964
|
}
|
|
101878
|
-
async function closeOrphanedProbeForRetry(
|
|
101965
|
+
async function closeOrphanedProbeForRetry(probe, closer, log, retryContext) {
|
|
101879
101966
|
try {
|
|
101880
|
-
await closer(
|
|
101967
|
+
await closer(probe);
|
|
101881
101968
|
} catch (closeErr) {
|
|
101882
101969
|
log.warn(`[Render] probe close before ${retryContext} retry failed; continuing with retry`, {
|
|
101883
101970
|
error: closeErr instanceof Error ? closeErr.message : String(closeErr)
|
|
@@ -101958,7 +102045,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
|
|
|
101958
102045
|
const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve13(process.env.PRODUCER_RENDERS_DIR, "..") : resolve13(moduleDir, "../..");
|
|
101959
102046
|
const debugDir = join48(producerRoot, ".debug");
|
|
101960
102047
|
const outputDir = dirname20(outputPath);
|
|
101961
|
-
if (!existsSync33(outputDir))
|
|
102048
|
+
if (!existsSync33(outputDir)) mkdirSync20(outputDir, { recursive: true });
|
|
101962
102049
|
const workDir = job.config.debug ? join48(debugDir, job.id) : mkdtempSync11(resolveRenderWorkDirPrefix(outputPath, job.id));
|
|
101963
102050
|
const pipelineStart = Date.now();
|
|
101964
102051
|
const baseLog = job.config.logger ?? defaultLogger;
|
|
@@ -102090,7 +102177,7 @@ async function executeRenderPipeline(input) {
|
|
|
102090
102177
|
job.startedAt = /* @__PURE__ */ new Date();
|
|
102091
102178
|
assertNotAborted();
|
|
102092
102179
|
assertConfiguredFfmpegBinariesExist();
|
|
102093
|
-
if (!existsSync33(workDir))
|
|
102180
|
+
if (!existsSync33(workDir)) mkdirSync20(workDir, { recursive: true });
|
|
102094
102181
|
if (job.config.debug) {
|
|
102095
102182
|
log.info("[Render] Debug artifacts enabled", { workDir, logPath });
|
|
102096
102183
|
}
|
|
@@ -102428,7 +102515,7 @@ async function executeRenderPipeline(input) {
|
|
|
102428
102515
|
throw new Error("File server failed to initialize before frame capture");
|
|
102429
102516
|
}
|
|
102430
102517
|
const framesDir = join48(workDir, "captured-frames");
|
|
102431
|
-
if (!existsSync33(framesDir))
|
|
102518
|
+
if (!existsSync33(framesDir)) mkdirSync20(framesDir, { recursive: true });
|
|
102432
102519
|
updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress);
|
|
102433
102520
|
const resolvedBrowserGpuMode = await resolveBrowserGpuMode(cfg.browserGpuMode, {
|
|
102434
102521
|
chromePath: resolveHeadlessShellPath(cfg),
|
|
@@ -103419,7 +103506,7 @@ async function executeRenderPipeline(input) {
|
|
|
103419
103506
|
"drawElement capture failed; retrying with a fresh screenshot session"
|
|
103420
103507
|
);
|
|
103421
103508
|
rmSync15(framesDir, { recursive: true, force: true });
|
|
103422
|
-
|
|
103509
|
+
mkdirSync20(framesDir, { recursive: true });
|
|
103423
103510
|
resetCaptureAttemptProgress(job);
|
|
103424
103511
|
dedupPerfs.length = 0;
|
|
103425
103512
|
cfg.useDrawElement = false;
|
|
@@ -103967,8 +104054,8 @@ init_src();
|
|
|
103967
104054
|
// ../producer/src/server.ts
|
|
103968
104055
|
import {
|
|
103969
104056
|
existsSync as existsSync36,
|
|
103970
|
-
mkdirSync as
|
|
103971
|
-
statSync as
|
|
104057
|
+
mkdirSync as mkdirSync21,
|
|
104058
|
+
statSync as statSync15,
|
|
103972
104059
|
mkdtempSync as mkdtempSync12,
|
|
103973
104060
|
writeFileSync as writeFileSync13,
|
|
103974
104061
|
rmSync as rmSync16,
|
|
@@ -103987,13 +104074,13 @@ init_dist3();
|
|
|
103987
104074
|
import {
|
|
103988
104075
|
existsSync as existsSync34,
|
|
103989
104076
|
readFileSync as readFileSync17,
|
|
103990
|
-
statSync as
|
|
104077
|
+
statSync as statSync14,
|
|
103991
104078
|
openSync as openSync8,
|
|
103992
104079
|
fstatSync as fstatSync5,
|
|
103993
104080
|
closeSync as closeSync9,
|
|
103994
104081
|
constants as constants5
|
|
103995
104082
|
} from "fs";
|
|
103996
|
-
import { resolve as resolve14, join as join49, relative as
|
|
104083
|
+
import { resolve as resolve14, join as join49, relative as relative6, isAbsolute as isAbsolute6, sep as sep4 } from "path";
|
|
103997
104084
|
function isStringRecord(value) {
|
|
103998
104085
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
103999
104086
|
return false;
|
|
@@ -104026,7 +104113,7 @@ function readEntryHtml(filePath) {
|
|
|
104026
104113
|
} catch (error) {
|
|
104027
104114
|
if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
|
|
104028
104115
|
return null;
|
|
104029
|
-
if (!
|
|
104116
|
+
if (!statSync14(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
104030
104117
|
throw error;
|
|
104031
104118
|
}
|
|
104032
104119
|
try {
|
|
@@ -104038,7 +104125,7 @@ function readEntryHtml(filePath) {
|
|
|
104038
104125
|
}
|
|
104039
104126
|
function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
104040
104127
|
const absProjectDir = resolve14(projectDir);
|
|
104041
|
-
if (!existsSync34(absProjectDir) || !
|
|
104128
|
+
if (!existsSync34(absProjectDir) || !statSync14(absProjectDir).isDirectory()) {
|
|
104042
104129
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
104043
104130
|
}
|
|
104044
104131
|
const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
|
|
@@ -104046,8 +104133,8 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
|
104046
104133
|
);
|
|
104047
104134
|
for (const entryFile of entryCandidates) {
|
|
104048
104135
|
const absoluteEntryPath = resolve14(absProjectDir, entryFile);
|
|
104049
|
-
const entryRelativePath =
|
|
104050
|
-
if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep4}`) ||
|
|
104136
|
+
const entryRelativePath = relative6(absProjectDir, absoluteEntryPath);
|
|
104137
|
+
if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep4}`) || isAbsolute6(entryRelativePath)) {
|
|
104051
104138
|
return { error: `Entry file must stay inside project directory: ${entryFile}` };
|
|
104052
104139
|
}
|
|
104053
104140
|
const html = readEntryHtml(absoluteEntryPath);
|
|
@@ -104317,7 +104404,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
|
|
|
104317
104404
|
const { input, cleanupProjectDir } = prepared;
|
|
104318
104405
|
const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
|
|
104319
104406
|
const outputDir = dirname22(absoluteOutputPath);
|
|
104320
|
-
if (!existsSync36(outputDir))
|
|
104407
|
+
if (!existsSync36(outputDir)) mkdirSync21(outputDir, { recursive: true });
|
|
104321
104408
|
return { input, cleanupProjectDir, absoluteOutputPath };
|
|
104322
104409
|
}
|
|
104323
104410
|
function validateRenderOverrides(body) {
|
|
@@ -104355,7 +104442,7 @@ function prepareProjectDirectory(projectDir, options) {
|
|
|
104355
104442
|
const candidate = nonEmptyString2(projectDir);
|
|
104356
104443
|
if (!candidate) return null;
|
|
104357
104444
|
const absProjectDir = resolve15(candidate);
|
|
104358
|
-
if (!existsSync36(absProjectDir) || !
|
|
104445
|
+
if (!existsSync36(absProjectDir) || !statSync15(absProjectDir).isDirectory()) {
|
|
104359
104446
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
104360
104447
|
}
|
|
104361
104448
|
const entry = options.entryFile || "index.html";
|
|
@@ -104451,7 +104538,7 @@ function cleanupTempDir(dir, log) {
|
|
|
104451
104538
|
}
|
|
104452
104539
|
}
|
|
104453
104540
|
function outputFileSize(path) {
|
|
104454
|
-
return existsSync36(path) ?
|
|
104541
|
+
return existsSync36(path) ? statSync15(path).size : 0;
|
|
104455
104542
|
}
|
|
104456
104543
|
function createBlockingProgressReporter(log, requestId) {
|
|
104457
104544
|
let lastLoggedPct = -10;
|
|
@@ -104751,7 +104838,7 @@ function createRenderHandlers(options = {}) {
|
|
|
104751
104838
|
store.delete(token);
|
|
104752
104839
|
return c.json({ success: false, error: "Output artifact file missing" }, 404);
|
|
104753
104840
|
}
|
|
104754
|
-
const stats =
|
|
104841
|
+
const stats = statSync15(artifact.path);
|
|
104755
104842
|
return new Response(createReadStream5(artifact.path), {
|
|
104756
104843
|
headers: {
|
|
104757
104844
|
"content-type": "video/mp4",
|
|
@@ -104835,12 +104922,12 @@ init_src();
|
|
|
104835
104922
|
// ../producer/src/services/distributed/plan.ts
|
|
104836
104923
|
init_dist2();
|
|
104837
104924
|
init_src();
|
|
104838
|
-
import { cpSync as cpSync2, existsSync as existsSync39, mkdirSync as
|
|
104839
|
-
import { join as join55, relative as
|
|
104925
|
+
import { cpSync as cpSync2, existsSync as existsSync39, mkdirSync as mkdirSync23, renameSync as renameSync8, rmSync as rmSync17, writeFileSync as writeFileSync15 } from "fs";
|
|
104926
|
+
import { join as join55, relative as relative9, sep as sep5 } from "path";
|
|
104840
104927
|
|
|
104841
104928
|
// ../producer/src/services/render/stages/freezePlan.ts
|
|
104842
|
-
import { existsSync as existsSync37, mkdirSync as
|
|
104843
|
-
import { join as join52, relative as
|
|
104929
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync22, readFileSync as readFileSync18, readdirSync as readdirSync13, writeFileSync as writeFileSync14 } from "fs";
|
|
104930
|
+
import { join as join52, relative as relative7, resolve as resolve16 } from "path";
|
|
104844
104931
|
|
|
104845
104932
|
// ../producer/src/services/distributed/planProtocol.ts
|
|
104846
104933
|
var PLAN_SCHEMA_VERSION = 1;
|
|
@@ -104892,7 +104979,7 @@ var execFile4 = promisify5(execFileCallback);
|
|
|
104892
104979
|
// ../producer/src/services/distributed/planSize.ts
|
|
104893
104980
|
import { createHash as createHash13 } from "crypto";
|
|
104894
104981
|
import { lstatSync as lstatSync5, readdirSync as readdirSync14 } from "fs";
|
|
104895
|
-
import { extname as extname7, join as join54, relative as
|
|
104982
|
+
import { extname as extname7, join as join54, relative as relative8 } from "path";
|
|
104896
104983
|
var PLAN_ROOT_CATEGORY = {
|
|
104897
104984
|
compiled: "compiled",
|
|
104898
104985
|
[PLAN_AUDIO_RELATIVE_PATH]: "audio",
|
|
@@ -104916,7 +105003,7 @@ import {
|
|
|
104916
105003
|
copyFileSync as copyFileSync8,
|
|
104917
105004
|
existsSync as existsSync41,
|
|
104918
105005
|
lstatSync as lstatSync6,
|
|
104919
|
-
mkdirSync as
|
|
105006
|
+
mkdirSync as mkdirSync25,
|
|
104920
105007
|
mkdtempSync as mkdtempSync14,
|
|
104921
105008
|
openSync as openSync9,
|
|
104922
105009
|
readFileSync as readFileSync20,
|
|
@@ -104924,23 +105011,23 @@ import {
|
|
|
104924
105011
|
readdirSync as readdirSync15,
|
|
104925
105012
|
renameSync as renameSync10,
|
|
104926
105013
|
rmSync as rmSync19,
|
|
104927
|
-
statSync as
|
|
105014
|
+
statSync as statSync17,
|
|
104928
105015
|
writeFileSync as writeFileSync17
|
|
104929
105016
|
} from "fs";
|
|
104930
105017
|
import { createHash as createHash14 } from "crypto";
|
|
104931
105018
|
import { tmpdir as tmpdir9 } from "os";
|
|
104932
|
-
import { dirname as dirname25, isAbsolute as
|
|
105019
|
+
import { dirname as dirname25, isAbsolute as isAbsolute7, join as join58, relative as relative10, resolve as resolve17, sep as sep6 } from "path";
|
|
104933
105020
|
|
|
104934
105021
|
// ../producer/src/services/distributed/planV2Publisher.ts
|
|
104935
105022
|
import {
|
|
104936
105023
|
copyFileSync as copyFileSync7,
|
|
104937
105024
|
existsSync as existsSync40,
|
|
104938
105025
|
linkSync as linkSync3,
|
|
104939
|
-
mkdirSync as
|
|
105026
|
+
mkdirSync as mkdirSync24,
|
|
104940
105027
|
mkdtempSync as mkdtempSync13,
|
|
104941
105028
|
renameSync as renameSync9,
|
|
104942
105029
|
rmSync as rmSync18,
|
|
104943
|
-
statSync as
|
|
105030
|
+
statSync as statSync16,
|
|
104944
105031
|
writeFileSync as writeFileSync16
|
|
104945
105032
|
} from "fs";
|
|
104946
105033
|
import { dirname as dirname24, join as join57 } from "path";
|
|
@@ -104959,12 +105046,12 @@ init_dist2();
|
|
|
104959
105046
|
import {
|
|
104960
105047
|
cpSync as cpSync3,
|
|
104961
105048
|
existsSync as existsSync42,
|
|
104962
|
-
mkdirSync as
|
|
105049
|
+
mkdirSync as mkdirSync26,
|
|
104963
105050
|
mkdtempSync as mkdtempSync15,
|
|
104964
105051
|
readFileSync as readFileSync21,
|
|
104965
105052
|
readdirSync as readdirSync16,
|
|
104966
105053
|
rmSync as rmSync20,
|
|
104967
|
-
statSync as
|
|
105054
|
+
statSync as statSync18,
|
|
104968
105055
|
writeFileSync as writeFileSync18
|
|
104969
105056
|
} from "fs";
|
|
104970
105057
|
import { dirname as dirname26, join as join59 } from "path";
|
|
@@ -104972,14 +105059,14 @@ import { dirname as dirname26, join as join59 } from "path";
|
|
|
104972
105059
|
// ../producer/src/services/distributed/renderChunk.ts
|
|
104973
105060
|
init_src();
|
|
104974
105061
|
import { randomBytes } from "crypto";
|
|
104975
|
-
import { existsSync as existsSync43, mkdirSync as
|
|
105062
|
+
import { existsSync as existsSync43, mkdirSync as mkdirSync27, readFileSync as readFileSync22, readdirSync as readdirSync17, rmSync as rmSync21, writeFileSync as writeFileSync19 } from "fs";
|
|
104976
105063
|
import { extname as extname8, join as join60 } from "path";
|
|
104977
105064
|
init_src();
|
|
104978
105065
|
|
|
104979
105066
|
// ../producer/src/services/distributed/projectHash.ts
|
|
104980
105067
|
import { readdirSync as readdirSync18, readFileSync as readFileSync23 } from "fs";
|
|
104981
105068
|
import { createHash as createHash15 } from "crypto";
|
|
104982
|
-
import { join as join62, relative as
|
|
105069
|
+
import { join as join62, relative as relative11 } from "path";
|
|
104983
105070
|
|
|
104984
105071
|
// src/fontLocalize.ts
|
|
104985
105072
|
function safeVersion(version2) {
|
|
@@ -105020,8 +105107,8 @@ async function runFontLocalize(io, localize) {
|
|
|
105020
105107
|
}
|
|
105021
105108
|
|
|
105022
105109
|
// src/version.ts
|
|
105023
|
-
var VERSION = true ? "0.8.
|
|
105024
|
-
var PRODUCER_VERSION = true ? "0.8.
|
|
105110
|
+
var VERSION = true ? "0.8.84" : "0.0.0-dev";
|
|
105111
|
+
var PRODUCER_VERSION = true ? "0.8.84" : "0.0.0-dev";
|
|
105025
105112
|
|
|
105026
105113
|
// src/fontLocalizeCli.ts
|
|
105027
105114
|
async function readStdin() {
|