hyperframes 0.8.28 → 0.8.30

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.
@@ -17022,7 +17022,7 @@ var require_util = __commonJS({
17022
17022
  return path;
17023
17023
  }
17024
17024
  exports.normalize = normalize;
17025
- function join57(aRoot, aPath) {
17025
+ function join58(aRoot, aPath) {
17026
17026
  if (aRoot === "") {
17027
17027
  aRoot = ".";
17028
17028
  }
@@ -17054,7 +17054,7 @@ var require_util = __commonJS({
17054
17054
  }
17055
17055
  return joined;
17056
17056
  }
17057
- exports.join = join57;
17057
+ exports.join = join58;
17058
17058
  exports.isAbsolute = function(aPath) {
17059
17059
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
17060
17060
  };
@@ -17227,7 +17227,7 @@ var require_util = __commonJS({
17227
17227
  parsed.path = parsed.path.substring(0, index + 1);
17228
17228
  }
17229
17229
  }
17230
- sourceURL = join57(urlGenerate(parsed), sourceURL);
17230
+ sourceURL = join58(urlGenerate(parsed), sourceURL);
17231
17231
  }
17232
17232
  return normalize(sourceURL);
17233
17233
  }
@@ -50766,17 +50766,87 @@ function setAttr(tag, attr, value) {
50766
50766
  }
50767
50767
  function maskInertRegions(html) {
50768
50768
  const stash = [];
50769
- const masked = html.replace(INERT_REGION_RE, (region) => {
50769
+ const parts = [];
50770
+ const opening = /<!--|<script\b|<style\b/gi;
50771
+ const closings = /* @__PURE__ */ new Map([
50772
+ ["<!--", /--!?>/g],
50773
+ ["<script", /<\/script\s*>/gi],
50774
+ ["<style", /<\/style\s*>/gi]
50775
+ ]);
50776
+ let cursor = 0;
50777
+ let match;
50778
+ while ((match = opening.exec(html)) !== null) {
50779
+ const kind = match[0].toLowerCase();
50780
+ const closing = closings.get(kind);
50781
+ if (!closing)
50782
+ continue;
50783
+ closing.lastIndex = opening.lastIndex;
50784
+ const end = closing.exec(html) ? closing.lastIndex : -1;
50785
+ if (end < 0) {
50786
+ closings.delete(kind);
50787
+ continue;
50788
+ }
50770
50789
  const token = `\0HFMASK${stash.length}\0`;
50771
- stash.push(region);
50772
- return token;
50773
- });
50790
+ parts.push(html.slice(cursor, match.index), token);
50791
+ stash.push(html.slice(match.index, end));
50792
+ cursor = end;
50793
+ opening.lastIndex = cursor;
50794
+ }
50795
+ parts.push(html.slice(cursor));
50796
+ const masked = parts.join("");
50774
50797
  const restore = (s) => (
50775
50798
  // oxlint-disable-next-line no-control-regex -- NUL cannot appear in HTML, which is what makes it a safe mask delimiter
50776
50799
  s.replace(/\u0000HFMASK(\d+)\u0000/g, (_, i) => stash[Number(i)] ?? "")
50777
50800
  );
50778
50801
  return { masked, restore };
50779
50802
  }
50803
+ function* iterateOpeningTags(html, prefix) {
50804
+ let match;
50805
+ while ((match = prefix.exec(html)) !== null) {
50806
+ const closing = html.indexOf(">", prefix.lastIndex);
50807
+ if (closing < 0)
50808
+ break;
50809
+ const end = closing + 1;
50810
+ yield { tag: html.slice(match.index, end), index: match.index, end };
50811
+ prefix.lastIndex = end;
50812
+ }
50813
+ }
50814
+ function replaceOpeningTags(html, prefix, replace3) {
50815
+ const parts = [];
50816
+ let cursor = 0;
50817
+ for (const { tag, index, end } of iterateOpeningTags(html, prefix)) {
50818
+ parts.push(html.slice(cursor, index), replace3(tag));
50819
+ cursor = end;
50820
+ }
50821
+ parts.push(html.slice(cursor));
50822
+ return parts.join("");
50823
+ }
50824
+ function replaceIdTags(html, id, replace3) {
50825
+ const idPattern = new RegExp(`id=["']${escapeRegex2(id)}["']`, "gi");
50826
+ const lastClosing = html.lastIndexOf(">");
50827
+ const parts = [];
50828
+ let cursor = 0;
50829
+ let candidate = idPattern.exec(html);
50830
+ for (const { index, end } of iterateOpeningTags(html, /</g)) {
50831
+ if (index < cursor)
50832
+ continue;
50833
+ let targetEnd = -1;
50834
+ while (candidate && candidate.index < end) {
50835
+ const candidateEnd = candidate.index + candidate[0].length;
50836
+ if (candidate.index > index && candidateEnd <= lastClosing)
50837
+ targetEnd = candidateEnd;
50838
+ idPattern.lastIndex = candidate.index + 1;
50839
+ candidate = idPattern.exec(html);
50840
+ }
50841
+ if (targetEnd < 0)
50842
+ continue;
50843
+ const closing = html.indexOf(">", targetEnd) + 1;
50844
+ parts.push(html.slice(cursor, index), replace3(html.slice(index, closing)));
50845
+ cursor = closing;
50846
+ }
50847
+ parts.push(html.slice(cursor));
50848
+ return parts.join("");
50849
+ }
50780
50850
  function compileTag(tag, isVideo, generateId) {
50781
50851
  let result = tag;
50782
50852
  let unresolved = null;
@@ -50824,23 +50894,23 @@ function compileTimingAttrs(html) {
50824
50894
  let nextAudioId = 0;
50825
50895
  const { masked, restore } = maskInertRegions(html);
50826
50896
  html = masked;
50827
- html = html.replace(/<video[^>]*>/gi, (match) => {
50897
+ html = replaceOpeningTags(html, /<video/gi, (match) => {
50828
50898
  const { tag, unresolved: u } = compileTag(match, true, () => nextVideoId++);
50829
50899
  if (u)
50830
50900
  unresolved.push(u);
50831
50901
  return tag;
50832
50902
  });
50833
- html = html.replace(/<audio[^>]*>/gi, (match) => {
50903
+ html = replaceOpeningTags(html, /<audio/gi, (match) => {
50834
50904
  const { tag, unresolved: u } = compileTag(match, false, () => nextAudioId++);
50835
50905
  if (u)
50836
50906
  unresolved.push(u);
50837
50907
  return tag;
50838
50908
  });
50839
- html.replace(/<(?:div|section)[^>]*>/gi, (match) => {
50909
+ for (const { tag: match } of iterateOpeningTags(html, /<(?:div|section)/gi)) {
50840
50910
  if (!hasAttr(match, "data-start"))
50841
- return match;
50911
+ continue;
50842
50912
  if (hasAttr(match, "data-end") || hasAttr(match, "data-duration"))
50843
- return match;
50913
+ continue;
50844
50914
  const id = getAttr(match, "id");
50845
50915
  const compositionSrc = getAttr(match, "data-composition-src");
50846
50916
  if (id) {
@@ -50854,14 +50924,12 @@ function compileTimingAttrs(html) {
50854
50924
  compositionSrc: compositionSrc ?? void 0
50855
50925
  });
50856
50926
  }
50857
- return match;
50858
- });
50927
+ }
50859
50928
  return { html: restore(html), unresolved };
50860
50929
  }
50861
50930
  function injectDurations(html, resolutions) {
50862
50931
  for (const { id, duration } of resolutions) {
50863
- const idPattern = new RegExp(`(<[^>]*id=["']${escapeRegex2(id)}["'][^>]*>)`, "gi");
50864
- html = html.replace(idPattern, (tag) => {
50932
+ html = replaceIdTags(html, id, (tag) => {
50865
50933
  let result = tag;
50866
50934
  if (parseStrictFiniteTimingNumber(getAttr(result, "data-duration")) == null) {
50867
50935
  result = setAttr(result, "data-duration", String(duration));
@@ -50883,10 +50951,7 @@ function escapeRegex2(str) {
50883
50951
  function extractResolvedMedia(html) {
50884
50952
  const resolved = [];
50885
50953
  html = maskInertRegions(html).masked;
50886
- const mediaRegex = /<(?:video|audio)[^>]*>/gi;
50887
- let match;
50888
- while ((match = mediaRegex.exec(html)) !== null) {
50889
- const tag = match[0];
50954
+ for (const { tag } of iterateOpeningTags(html, /<(?:video|audio)/gi)) {
50890
50955
  const id = getAttr(tag, "id");
50891
50956
  const durationStr = getAttr(tag, "data-duration");
50892
50957
  if (!id || durationStr === null)
@@ -50912,8 +50977,7 @@ function extractResolvedMedia(html) {
50912
50977
  }
50913
50978
  function clampDurations(html, clamps) {
50914
50979
  for (const { id, duration } of clamps) {
50915
- const idPattern = new RegExp(`(<[^>]*id=["']${escapeRegex2(id)}["'][^>]*>)`, "gi");
50916
- html = html.replace(idPattern, (tag) => {
50980
+ html = replaceIdTags(html, id, (tag) => {
50917
50981
  tag = tag.replace(/data-duration=["'][^"']*["']/, `data-duration="${duration}"`);
50918
50982
  const start = parseNumeric(getAttr(tag, "data-start"));
50919
50983
  if (start != null) {
@@ -50924,14 +50988,13 @@ function clampDurations(html, clamps) {
50924
50988
  }
50925
50989
  return html;
50926
50990
  }
50927
- var MEDIA_DURATION_CLAMP_EPSILON_SECONDS, INERT_REGION_RE;
50991
+ var MEDIA_DURATION_CLAMP_EPSILON_SECONDS;
50928
50992
  var init_timingCompiler = __esm({
50929
50993
  "../core/dist/compiler/timingCompiler.js"() {
50930
50994
  "use strict";
50931
50995
  init_compositionContract();
50932
50996
  init_playbackRate();
50933
50997
  MEDIA_DURATION_CLAMP_EPSILON_SECONDS = 0.05;
50934
- INERT_REGION_RE = /<!--[\s\S]*?-->|<script\b[\s\S]*?<\/script\s*>|<style\b[\s\S]*?<\/style\s*>/gi;
50935
50998
  }
50936
50999
  });
50937
51000
 
@@ -61171,7 +61234,15 @@ var init_renderProvenance = __esm({
61171
61234
  });
61172
61235
 
61173
61236
  // ../engine/src/services/chunkEncoder.ts
61174
- import { copyFileSync, existsSync as existsSync6, mkdirSync as mkdirSync2, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
61237
+ import {
61238
+ copyFileSync,
61239
+ existsSync as existsSync6,
61240
+ mkdirSync as mkdirSync2,
61241
+ mkdtempSync,
61242
+ readdirSync as readdirSync2,
61243
+ statSync as statSync2,
61244
+ writeFileSync as writeFileSync2
61245
+ } from "fs";
61175
61246
  import { join as join7, dirname as dirname4, extname } from "path";
61176
61247
  function appendEncodeTimeoutMessage(error, timedOut, timeoutMs) {
61177
61248
  if (!timedOut) return error;
@@ -61483,8 +61554,8 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
61483
61554
  }
61484
61555
  const chunkSize = Math.max(30, Math.floor(chunkSizeFrames));
61485
61556
  const chunkCount = Math.ceil(files.length / chunkSize);
61486
- const chunkDir = join7(dirname4(outputPath), "chunk-encode");
61487
- if (!existsSync6(chunkDir)) mkdirSync2(chunkDir, { recursive: true });
61557
+ mkdirSync2(dirname4(outputPath), { recursive: true });
61558
+ const chunkDir = mkdtempSync(join7(dirname4(outputPath), "chunk-encode-"));
61488
61559
  const chunkPaths = [];
61489
61560
  for (let i = 0; i < chunkCount; i++) {
61490
61561
  if (signal?.aborted) {
@@ -62144,7 +62215,7 @@ import {
62144
62215
  existsSync as existsSync8,
62145
62216
  fsyncSync,
62146
62217
  linkSync,
62147
- mkdtempSync,
62218
+ mkdtempSync as mkdtempSync2,
62148
62219
  mkdirSync as mkdirSync4,
62149
62220
  lstatSync as lstatSync2,
62150
62221
  openSync,
@@ -62793,7 +62864,7 @@ function emitDownloadTelemetry(options, event) {
62793
62864
  }
62794
62865
  }
62795
62866
  async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, signal) {
62796
- const attemptDir = mkdtempSync(join8(dirname6(localPath), ".hf-download-"));
62867
+ const attemptDir = mkdtempSync2(join8(dirname6(localPath), ".hf-download-"));
62797
62868
  const partialPath = join8(attemptDir, "payload");
62798
62869
  const controller = new AbortController();
62799
62870
  let timedOut = false;
@@ -77068,8 +77139,8 @@ var init_wavChunks = __esm({
77068
77139
  });
77069
77140
 
77070
77141
  // ../engine/src/services/audioVolumeEnvelope.ts
77071
- import { readFileSync as readFileSync3, renameSync as renameSync2, writeFileSync as writeFileSync4 } from "fs";
77072
- import { randomBytes } from "crypto";
77142
+ import { mkdtempSync as mkdtempSync3, readFileSync as readFileSync3, renameSync as renameSync2, rmSync as rmSync4, writeFileSync as writeFileSync4 } from "fs";
77143
+ import { dirname as dirname7, join as join12 } from "path";
77073
77144
  function readFmtChunk(buffer, body) {
77074
77145
  const format = buffer.readUInt16LE(body);
77075
77146
  const bits = buffer.readUInt16LE(body + 14);
@@ -77135,17 +77206,26 @@ function scaleSamples(buffer, layout2, gainAt) {
77135
77206
  function applyVolumeEnvelopeToWav(wavPath, keyframes, trackStart, baseVolume) {
77136
77207
  const gainAt = createEnvelopeWalker(keyframes, trackStart, baseVolume);
77137
77208
  if (!gainAt) return false;
77209
+ let stagingDir;
77138
77210
  try {
77139
77211
  const buffer = readFileSync3(wavPath);
77140
77212
  const layout2 = parseWavLayout(buffer);
77141
77213
  if (!layout2) return false;
77142
77214
  scaleSamples(buffer, layout2, gainAt);
77143
- const tempPath = `${wavPath}.${randomBytes(6).toString("hex")}.tmp`;
77144
- writeFileSync4(tempPath, buffer);
77215
+ stagingDir = mkdtempSync3(join12(dirname7(wavPath), ".hf-volume-"));
77216
+ const tempPath = join12(stagingDir, "audio.wav");
77217
+ writeFileSync4(tempPath, buffer, { flag: "wx" });
77145
77218
  renameSync2(tempPath, wavPath);
77146
77219
  return true;
77147
77220
  } catch {
77148
77221
  return false;
77222
+ } finally {
77223
+ if (stagingDir) {
77224
+ try {
77225
+ rmSync4(stagingDir, { recursive: true, force: true });
77226
+ } catch {
77227
+ }
77228
+ }
77149
77229
  }
77150
77230
  }
77151
77231
  var PCM_FORMAT, FLOAT_FORMAT;
@@ -77234,9 +77314,9 @@ var init_audio_fx_runtime_inline = __esm({
77234
77314
  });
77235
77315
 
77236
77316
  // ../engine/src/services/audioFxRender.ts
77237
- import { existsSync as existsSync11, mkdtempSync as mkdtempSync2, readFileSync as readFileSync4, rmSync as rmSync4, writeFileSync as writeFileSync5 } from "fs";
77317
+ import { existsSync as existsSync11, mkdtempSync as mkdtempSync4, readFileSync as readFileSync4, rmSync as rmSync5, writeFileSync as writeFileSync5 } from "fs";
77238
77318
  import { tmpdir as tmpdir2 } from "os";
77239
- import { join as join12 } from "path";
77319
+ import { join as join13 } from "path";
77240
77320
  import { pathToFileURL } from "url";
77241
77321
  function readWavChunks(buf) {
77242
77322
  const head = { format: 1, channels: 1, sampleRate: 48e3, bits: 16 };
@@ -77349,7 +77429,7 @@ async function applyAudioFxChain(inputWav, chain, outputWav, options) {
77349
77429
  const { samples, sampleRate, channels, float } = readWav(inputWav);
77350
77430
  const planes = deinterleave(samples, channels);
77351
77431
  if ((planes[0]?.length ?? 0) === 0) return { path: inputWav, envelopeBaked: false };
77352
- const hostDir = mkdtempSync2(join12(tmpdir2(), "hf-fx-host-"));
77432
+ const hostDir = mkdtempSync4(join13(tmpdir2(), "hf-fx-host-"));
77353
77433
  let lease = null;
77354
77434
  try {
77355
77435
  if (options.signal?.aborted) {
@@ -77358,7 +77438,7 @@ async function applyAudioFxChain(inputWav, chain, outputWav, options) {
77358
77438
  lease = await acquireBrowser(["--no-sandbox", "--autoplay-policy=no-user-gesture-required"]);
77359
77439
  const page = await lease.browser.newPage();
77360
77440
  try {
77361
- const hostPage = join12(hostDir, "audio-fx.html");
77441
+ const hostPage = join13(hostDir, "audio-fx.html");
77362
77442
  writeFileSync5(hostPage, "<!doctype html><meta charset=utf-8><title>audio fx</title>");
77363
77443
  await page.goto(pathToFileURL(hostPage).href, { waitUntil: "domcontentloaded" });
77364
77444
  await page.addScriptTag({ content: getAudioFxRuntimeScript() });
@@ -77386,7 +77466,7 @@ async function applyAudioFxChain(inputWav, chain, outputWav, options) {
77386
77466
  `Audio FX failed for track ${options.trackId}: ${err.message}`
77387
77467
  );
77388
77468
  } finally {
77389
- rmSync4(hostDir, { recursive: true, force: true });
77469
+ rmSync5(hostDir, { recursive: true, force: true });
77390
77470
  await lease?.release().catch(() => void 0);
77391
77471
  }
77392
77472
  }
@@ -77494,8 +77574,8 @@ var init_audioFxRender = __esm({
77494
77574
  });
77495
77575
 
77496
77576
  // ../engine/src/services/audioMixer.ts
77497
- import { closeSync as closeSync2, existsSync as existsSync12, mkdirSync as mkdirSync7, mkdtempSync as mkdtempSync3, openSync as openSync2, rmSync as rmSync5, writeFileSync as writeFileSync6 } from "fs";
77498
- import { join as join13, dirname as dirname7 } from "path";
77577
+ import { closeSync as closeSync2, existsSync as existsSync12, mkdirSync as mkdirSync7, mkdtempSync as mkdtempSync5, openSync as openSync2, rmSync as rmSync6, writeFileSync as writeFileSync6 } from "fs";
77578
+ import { join as join14, dirname as dirname8 } from "path";
77499
77579
  function memberGroupKey(el) {
77500
77580
  return el.getAttribute(AUDIO_GROUP_RENDER_ID_ATTR) ?? el.getAttribute(HF_AUDIO_GROUP_ATTR);
77501
77581
  }
@@ -77798,7 +77878,7 @@ function parseAudioElements(html) {
77798
77878
  }
77799
77879
  async function extractAudioFromVideo(videoPath, outputPath, options, signal, config) {
77800
77880
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
77801
- const outputDir = dirname7(outputPath);
77881
+ const outputDir = dirname8(outputPath);
77802
77882
  if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
77803
77883
  const playbackRate = normalizePlaybackRate(options?.playbackRate ?? 1);
77804
77884
  const args = [];
@@ -77842,7 +77922,7 @@ async function extractAudioFromVideo(videoPath, outputPath, options, signal, con
77842
77922
  }
77843
77923
  async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, playbackRate = 1, signal, config) {
77844
77924
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
77845
- const outputDir = dirname7(outputPath);
77925
+ const outputDir = dirname8(outputPath);
77846
77926
  if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
77847
77927
  const normalizedPlaybackRate = normalizePlaybackRate(playbackRate);
77848
77928
  const outputArgs = await preparedAudioOutputArgs(srcPath, normalizedPlaybackRate);
@@ -77889,7 +77969,7 @@ async function prepareAudioTrack(srcPath, outputPath, mediaStart, duration, play
77889
77969
  }
77890
77970
  async function generateSilence(outputPath, duration, signal, config) {
77891
77971
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
77892
- const outputDir = dirname7(outputPath);
77972
+ const outputDir = dirname8(outputPath);
77893
77973
  if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
77894
77974
  const args = [
77895
77975
  "-f",
@@ -77943,7 +78023,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
77943
78023
  failures: result2.failure ? [result2.failure] : void 0
77944
78024
  };
77945
78025
  }
77946
- const outputDir = dirname7(outputPath);
78026
+ const outputDir = dirname8(outputPath);
77947
78027
  if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
77948
78028
  const buildFilterComplex = (ignoreAutomation) => {
77949
78029
  const filterParts = [];
@@ -77964,8 +78044,8 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
77964
78044
  const runMix = async (ignoreAutomation) => {
77965
78045
  const inputs = [];
77966
78046
  tracks.forEach((track) => inputs.push("-i", track.srcPath));
77967
- const scriptDir = mkdtempSync3(join13(outputDir, ".filter-complex-"));
77968
- const scriptPath = join13(scriptDir, "graph.txt");
78047
+ const scriptDir = mkdtempSync5(join14(outputDir, ".filter-complex-"));
78048
+ const scriptPath = join14(scriptDir, "graph.txt");
77969
78049
  const fd = openSync2(scriptPath, "wx", 384);
77970
78050
  try {
77971
78051
  writeFileSync6(fd, buildFilterComplex(ignoreAutomation));
@@ -77996,7 +78076,7 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
77996
78076
  currentArgs[currentArgs.indexOf("-filter_complex_script")] = "-/filter_complex";
77997
78077
  return await runFfmpeg(currentArgs, { signal, timeout: ffmpegProcessTimeout });
77998
78078
  } finally {
77999
- rmSync5(scriptDir, { recursive: true, force: true });
78079
+ rmSync6(scriptDir, { recursive: true, force: true });
78000
78080
  }
78001
78081
  };
78002
78082
  let result = await runMix(false);
@@ -78051,7 +78131,7 @@ function groupNormalizeOptionUnsupported(stderr) {
78051
78131
  }
78052
78132
  async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal, config) {
78053
78133
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
78054
- const outputDir = dirname7(outputPath);
78134
+ const outputDir = dirname8(outputPath);
78055
78135
  if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
78056
78136
  const buildInputFilters = (ignoreKeyframes) => memberTracks.map((track, i) => {
78057
78137
  const delayMs = Math.round(track.start * 1e3);
@@ -78071,8 +78151,8 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
78071
78151
  `${mixInputs}amix=inputs=${memberTracks.length}:duration=longest:dropout_transition=0[mixed];[mixed]volume=${formatFilterNumber(memberTracks.length)}[out]`
78072
78152
  );
78073
78153
  const filterComplex = [...inputFilters, mixFilter].join(";");
78074
- const scriptDir = mkdtempSync3(join13(outputDir, ".group-filter-complex-"));
78075
- const scriptPath = join13(scriptDir, "graph.txt");
78154
+ const scriptDir = mkdtempSync5(join14(outputDir, ".group-filter-complex-"));
78155
+ const scriptPath = join14(scriptDir, "graph.txt");
78076
78156
  const fd = openSync2(scriptPath, "wx", 384);
78077
78157
  try {
78078
78158
  writeFileSync6(fd, filterComplex);
@@ -78112,7 +78192,7 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
78112
78192
  currentArgs[currentArgs.indexOf("-filter_complex_script")] = "-/filter_complex";
78113
78193
  return await runFfmpeg(currentArgs, { signal, timeout: ffmpegProcessTimeout });
78114
78194
  } finally {
78115
- rmSync5(scriptDir, { recursive: true, force: true });
78195
+ rmSync6(scriptDir, { recursive: true, force: true });
78116
78196
  }
78117
78197
  };
78118
78198
  let useNormalize = true;
@@ -78222,7 +78302,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78222
78302
  }
78223
78303
  let audioSrcPath = srcPath;
78224
78304
  if (element.type === "video") {
78225
- const extractedPath = join13(workDir, `${element.id}-extracted.wav`);
78305
+ const extractedPath = join14(workDir, `${element.id}-extracted.wav`);
78226
78306
  const extractResult = await extractAudioFromVideo(
78227
78307
  srcPath,
78228
78308
  extractedPath,
@@ -78249,7 +78329,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78249
78329
  }
78250
78330
  audioSrcPath = extractedPath;
78251
78331
  } else {
78252
- const trimmedPath = join13(workDir, `${element.id}-trimmed.wav`);
78332
+ const trimmedPath = join14(workDir, `${element.id}-trimmed.wav`);
78253
78333
  const prepResult = await prepareAudioTrack(
78254
78334
  srcPath,
78255
78335
  trimmedPath,
@@ -78293,7 +78373,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78293
78373
  const fxResult = await applyAudioFxChain(
78294
78374
  audioSrcPath,
78295
78375
  chain,
78296
- join13(workDir, `${element.id}-fx.wav`),
78376
+ join14(workDir, `${element.id}-fx.wav`),
78297
78377
  {
78298
78378
  trackId: element.id,
78299
78379
  signal: effectiveSignal,
@@ -78355,14 +78435,14 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78355
78435
  ).catch((err) => {
78356
78436
  internalController.abort();
78357
78437
  try {
78358
- rmSync5(workDir, { recursive: true, force: true });
78438
+ rmSync6(workDir, { recursive: true, force: true });
78359
78439
  } catch {
78360
78440
  }
78361
78441
  throw err;
78362
78442
  });
78363
78443
  const bail = () => {
78364
78444
  try {
78365
- rmSync5(workDir, { recursive: true, force: true });
78445
+ rmSync6(workDir, { recursive: true, force: true });
78366
78446
  } catch {
78367
78447
  }
78368
78448
  return {
@@ -78384,7 +78464,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78384
78464
  const meta = groupMeta.get(groupId);
78385
78465
  if (!meta) continue;
78386
78466
  const pathId = safePathSegment(groupId, groupIndex);
78387
- const groupWavPath = join13(workDir, `group-${pathId}.wav`);
78467
+ const groupWavPath = join14(workDir, `group-${pathId}.wav`);
78388
78468
  try {
78389
78469
  const subMix = await mixGroupMembers(
78390
78470
  memberTracks,
@@ -78420,7 +78500,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78420
78500
  const fxResult = await applyAudioFxChain(
78421
78501
  groupSrcPath,
78422
78502
  chain,
78423
- join13(workDir, `group-${pathId}-fx.wav`),
78503
+ join14(workDir, `group-${pathId}-fx.wav`),
78424
78504
  {
78425
78505
  trackId: groupId,
78426
78506
  signal: effectiveSignal,
@@ -78469,7 +78549,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
78469
78549
  if (failures.length > 0) return bail();
78470
78550
  const mixResult = await mixAudioTracks(tracks, outputPath, totalDuration, signal, config);
78471
78551
  try {
78472
- rmSync5(workDir, { recursive: true, force: true });
78552
+ rmSync6(workDir, { recursive: true, force: true });
78473
78553
  } catch {
78474
78554
  }
78475
78555
  const degradedNote = groupsDegradedAutomation.length > 0 ? `Volume automation exceeded this ffmpeg build's expression limits in group(s) ${groupsDegradedAutomation.join(", ")}; rendered at base volume` : void 0;
@@ -78518,14 +78598,14 @@ var init_audioMixer = __esm({
78518
78598
  import { execFile as execFile2 } from "child_process";
78519
78599
  import { mkdtemp, rm, writeFile } from "fs/promises";
78520
78600
  import { tmpdir as tmpdir3 } from "os";
78521
- import { join as join14 } from "path";
78601
+ import { join as join15 } from "path";
78522
78602
  import { promisify as promisify2 } from "util";
78523
78603
  async function psnrDb(a, b) {
78524
78604
  const execFileP = promisify2(execFile2);
78525
- const dir = await mkdtemp(join14(tmpdir3(), "hf-de-verify-"));
78605
+ const dir = await mkdtemp(join15(tmpdir3(), "hf-de-verify-"));
78526
78606
  try {
78527
- const pa = join14(dir, "a.jpg");
78528
- const pb = join14(dir, "b.jpg");
78607
+ const pa = join15(dir, "a.jpg");
78608
+ const pb = join15(dir, "b.jpg");
78529
78609
  await Promise.all([writeFile(pa, a), writeFile(pb, b)]);
78530
78610
  const { stderr } = await execFileP(
78531
78611
  getFfmpegBinary(),
@@ -78636,7 +78716,7 @@ var init_readWebGlVendorInfoFromCanvas = __esm({
78636
78716
  import { cpus, freemem } from "os";
78637
78717
  import { existsSync as existsSync13, mkdirSync as mkdirSync8, readdirSync as readdirSync6 } from "fs";
78638
78718
  import { copyFile, readFile, rename } from "fs/promises";
78639
- import { join as join15 } from "path";
78719
+ import { join as join16 } from "path";
78640
78720
  import { getHeapStatistics } from "v8";
78641
78721
  function defaultSafeMaxWorkers() {
78642
78722
  return Math.max(6, Math.min(16, Math.floor(cpus().length / 8)));
@@ -78765,7 +78845,7 @@ function distributeFrames(totalFrames, workerCount, workDir, rangeStart = 0) {
78765
78845
  workerId: i,
78766
78846
  startFrame,
78767
78847
  endFrame,
78768
- outputDir: join15(workDir, `worker-${i}`),
78848
+ outputDir: join16(workDir, `worker-${i}`),
78769
78849
  outputFrameOffset: rangeStart
78770
78850
  });
78771
78851
  }
@@ -78779,7 +78859,7 @@ function distributeFramesInterleaved(totalFrames, workerCount, workDir, rangeSta
78779
78859
  startFrame: rangeStart + i,
78780
78860
  endFrame: rangeStart + totalFrames,
78781
78861
  frameStride: workerCount,
78782
- outputDir: join15(workDir, `worker-${i}`),
78862
+ outputDir: join16(workDir, `worker-${i}`),
78783
78863
  outputFrameOffset: rangeStart
78784
78864
  });
78785
78865
  }
@@ -78937,7 +79017,7 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
78937
79017
  for (const idx of selectVerifySampleIndicesForTask(truths.keys(), task)) {
78938
79018
  const truth = truths.get(idx);
78939
79019
  if (!truth) continue;
78940
- const framePath = join15(task.outputDir, `frame_${String(idx - offset2).padStart(6, "0")}.${ext}`);
79020
+ const framePath = join16(task.outputDir, `frame_${String(idx - offset2).padStart(6, "0")}.${ext}`);
78941
79021
  const db = await psnrForDiskSample(framePath, truth, task.workerId, idx);
78942
79022
  if (db === null) continue;
78943
79023
  assertDiskSampleAboveFloor(db, verifyMinDb, idx, task.workerId);
@@ -79103,8 +79183,8 @@ async function mergeWorkerFrames(workDir, tasks, outputDir) {
79103
79183
  }
79104
79184
  const files = readdirSync6(task.outputDir).filter((f) => f.startsWith("frame_") && (f.endsWith(".jpg") || f.endsWith(".png"))).sort();
79105
79185
  const copyTasks = files.map(async (file) => {
79106
- const sourcePath = join15(task.outputDir, file);
79107
- const targetPath = join15(outputDir, file);
79186
+ const sourcePath = join16(task.outputDir, file);
79187
+ const targetPath = join16(outputDir, file);
79108
79188
  try {
79109
79189
  await rename(sourcePath, targetPath);
79110
79190
  } catch {
@@ -79149,8 +79229,25 @@ var init_parallelCoordinator = __esm({
79149
79229
  // ../engine/src/services/fileServer.ts
79150
79230
  import { Hono } from "hono";
79151
79231
  import { serve } from "@hono/node-server";
79152
- import { readFileSync as readFileSync5, existsSync as existsSync14, statSync as statSync6 } from "fs";
79153
- import { join as join16, extname as extname3 } from "path";
79232
+ import { readFileSync as readFileSync5, openSync as openSync3, fstatSync, closeSync as closeSync3, statSync as statSync6, constants as constants2 } from "fs";
79233
+ import { join as join17, extname as extname3 } from "path";
79234
+ function readRegularFile(filePath) {
79235
+ let fd;
79236
+ try {
79237
+ fd = openSync3(filePath, constants2.O_RDONLY | constants2.O_NONBLOCK);
79238
+ } catch (error) {
79239
+ if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
79240
+ return null;
79241
+ if (!statSync6(filePath, { throwIfNoEntry: false })?.isFile()) return null;
79242
+ throw error;
79243
+ }
79244
+ try {
79245
+ if (!fstatSync(fd).isFile()) return null;
79246
+ return readFileSync5(fd);
79247
+ } finally {
79248
+ closeSync3(fd);
79249
+ }
79250
+ }
79154
79251
  function createFileServer(options) {
79155
79252
  const { projectDir, compiledDir, port = 0, stripEmbeddedRuntime = true } = options;
79156
79253
  const headScripts = options.headScripts ?? [];
@@ -79160,22 +79257,16 @@ function createFileServer(options) {
79160
79257
  let requestPath = c.req.path;
79161
79258
  if (requestPath === "/") requestPath = "/index.html";
79162
79259
  const relativePath = requestPath.replace(/^\//, "");
79163
- const compiledPath = compiledDir ? join16(compiledDir, relativePath) : null;
79164
- const hasCompiledFile = Boolean(
79165
- compiledPath && existsSync14(compiledPath) && statSync6(compiledPath).isFile()
79166
- );
79167
- const filePath = hasCompiledFile ? compiledPath : join16(projectDir, relativePath);
79168
- if (!existsSync14(filePath) || !statSync6(filePath).isFile()) {
79169
- return c.text("Not found", 404);
79170
- }
79171
- const ext = extname3(filePath).toLowerCase();
79260
+ const compiledPath = compiledDir ? join17(compiledDir, relativePath) : null;
79261
+ const content = (compiledPath ? readRegularFile(compiledPath) : null) ?? readRegularFile(join17(projectDir, relativePath));
79262
+ if (content === null) return c.text("Not found", 404);
79263
+ const ext = extname3(relativePath).toLowerCase();
79172
79264
  const contentType = MIME_TYPES[ext] || "application/octet-stream";
79173
79265
  if (ext === ".html") {
79174
- const rawHtml = readFileSync5(filePath, "utf-8");
79266
+ const rawHtml = content.toString("utf-8");
79175
79267
  const html = relativePath === "index.html" ? injectScriptsIntoHtml(rawHtml, headScripts, bodyScripts, stripEmbeddedRuntime) : rawHtml;
79176
79268
  return c.text(html, 200, { "Content-Type": contentType });
79177
79269
  }
79178
- const content = readFileSync5(filePath);
79179
79270
  return new Response(content, {
79180
79271
  status: 200,
79181
79272
  headers: { "Content-Type": contentType }
@@ -79730,15 +79821,13 @@ function normalizeObjectFit(value) {
79730
79821
  }
79731
79822
  function parseTransformMatrix(css) {
79732
79823
  if (!css || css === "none") return null;
79733
- const match2d = css.match(
79734
- /^matrix\(\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,]+),\s*([^,)]+)\s*\)$/
79735
- );
79824
+ const match2d = css.match(/^matrix\(([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,)]+)\)$/);
79736
79825
  if (match2d) {
79737
79826
  const values = match2d.slice(1, 7).map(Number);
79738
79827
  if (!values.every(Number.isFinite)) return null;
79739
79828
  return values;
79740
79829
  }
79741
- const match3d = css.match(/^matrix3d\(\s*([^)]+)\)$/);
79830
+ const match3d = css.match(/^matrix3d\(([^)]+)\)$/);
79742
79831
  if (match3d) {
79743
79832
  const raw = match3d[1];
79744
79833
  if (!raw) return null;
@@ -80621,8 +80710,8 @@ var init_shaderTransitions = __esm({
80621
80710
  });
80622
80711
 
80623
80712
  // ../engine/src/services/hdrCapture.ts
80624
- import { existsSync as existsSync15, readdirSync as readdirSync7 } from "fs";
80625
- import { join as join17 } from "path";
80713
+ import { existsSync as existsSync14, readdirSync as readdirSync7 } from "fs";
80714
+ import { join as join18 } from "path";
80626
80715
  import { homedir as homedir2 } from "os";
80627
80716
  function linearToPQ(L) {
80628
80717
  const Lp = Math.max(0, L * SDR_NITS / PQ_MAX_NITS);
@@ -80738,12 +80827,12 @@ function float16ToPqRgb(rawBuffer, bytesPerRow, width, height) {
80738
80827
  return output;
80739
80828
  }
80740
80829
  function resolveHeadedChromePath() {
80741
- const baseDir = join17(homedir2(), ".cache", "puppeteer", "chrome");
80742
- if (!existsSync15(baseDir)) return void 0;
80830
+ const baseDir = join18(homedir2(), ".cache", "puppeteer", "chrome");
80831
+ if (!existsSync14(baseDir)) return void 0;
80743
80832
  const versions = readdirSync7(baseDir).sort().reverse();
80744
80833
  for (const version2 of versions) {
80745
80834
  const candidates = [
80746
- join17(
80835
+ join18(
80747
80836
  baseDir,
80748
80837
  version2,
80749
80838
  "chrome-mac-arm64",
@@ -80752,7 +80841,7 @@ function resolveHeadedChromePath() {
80752
80841
  "MacOS",
80753
80842
  "Google Chrome for Testing"
80754
80843
  ),
80755
- join17(
80844
+ join18(
80756
80845
  baseDir,
80757
80846
  version2,
80758
80847
  "chrome-mac-x64",
@@ -80761,11 +80850,11 @@ function resolveHeadedChromePath() {
80761
80850
  "MacOS",
80762
80851
  "Google Chrome for Testing"
80763
80852
  ),
80764
- join17(baseDir, version2, "chrome-linux64", "chrome"),
80765
- join17(baseDir, version2, "chrome-win64", "chrome.exe")
80853
+ join18(baseDir, version2, "chrome-linux64", "chrome"),
80854
+ join18(baseDir, version2, "chrome-win64", "chrome.exe")
80766
80855
  ];
80767
80856
  for (const binary of candidates) {
80768
- if (existsSync15(binary)) return binary;
80857
+ if (existsSync14(binary)) return binary;
80769
80858
  }
80770
80859
  }
80771
80860
  return void 0;
@@ -84240,16 +84329,16 @@ __export(fontCompression_exports, {
84240
84329
  });
84241
84330
  import { createHash as createHash6 } from "crypto";
84242
84331
  import {
84243
- existsSync as existsSync21,
84332
+ existsSync as existsSync20,
84244
84333
  mkdirSync as mkdirSync10,
84245
- mkdtempSync as mkdtempSync5,
84334
+ mkdtempSync as mkdtempSync7,
84246
84335
  readFileSync as readFileSync7,
84247
84336
  renameSync as renameSync4,
84248
- rmSync as rmSync8,
84337
+ rmSync as rmSync9,
84249
84338
  writeFileSync as writeFileSync8
84250
84339
  } from "fs";
84251
84340
  import { homedir as homedir4, tmpdir as tmpdir4 } from "os";
84252
- import { dirname as dirname11, join as join24 } from "path";
84341
+ import { dirname as dirname12, join as join25 } from "path";
84253
84342
  async function compressToWoff2(input) {
84254
84343
  return Buffer.from(await compress(input));
84255
84344
  }
@@ -84257,16 +84346,16 @@ function rawMimeType(format) {
84257
84346
  return RAW_MIME_TYPES[format] ?? "font/ttf";
84258
84347
  }
84259
84348
  function defaultCacheDir() {
84260
- const root = process.env.HYPERFRAMES_FONT_CACHE_DIR ?? (process.env.AWS_LAMBDA_FUNCTION_NAME ? join24(tmpdir4(), "hyperframes", "fonts") : join24(homedir4(), ".cache", "hyperframes", "fonts"));
84261
- return join24(root, "local-compression-v1");
84349
+ const root = process.env.HYPERFRAMES_FONT_CACHE_DIR ?? (process.env.AWS_LAMBDA_FUNCTION_NAME ? join25(tmpdir4(), "hyperframes", "fonts") : join25(homedir4(), ".cache", "hyperframes", "fonts"));
84350
+ return join25(root, "local-compression-v1");
84262
84351
  }
84263
84352
  function cachedCompressionPath(input, originalFormat, cacheDir) {
84264
84353
  const digest = createHash6("sha256").update("hyperframes-local-font-compression-v1\0").update(originalFormat).update("\0").update(input).digest("hex");
84265
- return join24(cacheDir, `${digest}.woff2`);
84354
+ return join25(cacheDir, `${digest}.woff2`);
84266
84355
  }
84267
84356
  function readCachedCompression(path) {
84268
84357
  try {
84269
- if (!existsSync21(path)) return null;
84358
+ if (!existsSync20(path)) return null;
84270
84359
  const cached2 = readFileSync7(path);
84271
84360
  return cached2.length > 0 ? cached2 : null;
84272
84361
  } catch {
@@ -84276,15 +84365,15 @@ function readCachedCompression(path) {
84276
84365
  function cacheCompression(path, compressed) {
84277
84366
  let tempDir;
84278
84367
  try {
84279
- mkdirSync10(dirname11(path), { recursive: true });
84280
- tempDir = mkdtempSync5(join24(dirname11(path), ".compression-"));
84281
- const tmpPath = join24(tempDir, "font.woff2");
84368
+ mkdirSync10(dirname12(path), { recursive: true });
84369
+ tempDir = mkdtempSync7(join25(dirname12(path), ".compression-"));
84370
+ const tmpPath = join25(tempDir, "font.woff2");
84282
84371
  writeFileSync8(tmpPath, compressed, { flag: "wx", mode: 420 });
84283
84372
  renameSync4(tmpPath, path);
84284
84373
  } catch {
84285
84374
  } finally {
84286
84375
  try {
84287
- if (tempDir) rmSync8(tempDir, { recursive: true, force: true });
84376
+ if (tempDir) rmSync9(tempDir, { recursive: true, force: true });
84288
84377
  } catch {
84289
84378
  }
84290
84379
  }
@@ -84332,19 +84421,19 @@ init_esm10();
84332
84421
  init_dist2();
84333
84422
  init_src();
84334
84423
  import {
84335
- existsSync as existsSync30,
84424
+ existsSync as existsSync29,
84336
84425
  mkdirSync as mkdirSync17,
84337
- mkdtempSync as mkdtempSync9,
84426
+ mkdtempSync as mkdtempSync11,
84338
84427
  readFileSync as readFileSync12,
84339
84428
  readdirSync as readdirSync11,
84340
- rmSync as rmSync13,
84429
+ rmSync as rmSync14,
84341
84430
  statSync as statSync10,
84342
84431
  writeFileSync as writeFileSync10,
84343
84432
  copyFileSync as copyFileSync6,
84344
84433
  appendFileSync
84345
84434
  } from "fs";
84346
84435
  import { tmpdir as tmpdir7 } from "os";
84347
- import { join as join42, dirname as dirname17, resolve as resolve13 } from "path";
84436
+ import { join as join43, dirname as dirname18, resolve as resolve13 } from "path";
84348
84437
  import { totalmem as totalmem3 } from "os";
84349
84438
  import { randomUUID as randomUUID3 } from "crypto";
84350
84439
  import { fileURLToPath as fileURLToPath5 } from "url";
@@ -84354,17 +84443,27 @@ init_compiler();
84354
84443
  init_dist2();
84355
84444
  import { Hono as Hono2 } from "hono";
84356
84445
  import { serve as serve2 } from "@hono/node-server";
84357
- import { existsSync as existsSync17, realpathSync as realpathSync2, statSync as statSync7, createReadStream as createReadStream3 } from "fs";
84358
- import { readFile as readFile2 } from "fs/promises";
84446
+ import {
84447
+ existsSync as existsSync16,
84448
+ realpathSync as realpathSync2,
84449
+ statSync as statSync7,
84450
+ createReadStream as createReadStream3,
84451
+ openSync as openSync4,
84452
+ fstatSync as fstatSync2,
84453
+ closeSync as closeSync4,
84454
+ constants as constants3,
84455
+ readFile as readFile2
84456
+ } from "fs";
84457
+ import { promisify as promisify3 } from "util";
84359
84458
  import { Readable as Readable2 } from "stream";
84360
- import { join as join18, extname as extname4, resolve as resolve7, sep as sep3 } from "path";
84459
+ import { join as join19, extname as extname4, resolve as resolve7, sep as sep3 } from "path";
84361
84460
 
84362
84461
  // ../producer/src/services/hyperframeRuntimeLoader.ts
84363
84462
  import { createHash as createHash4 } from "crypto";
84364
- import { existsSync as existsSync16, readFileSync as readFileSync6 } from "fs";
84365
- import { dirname as dirname8, resolve as resolve6 } from "path";
84463
+ import { existsSync as existsSync15, readFileSync as readFileSync6 } from "fs";
84464
+ import { dirname as dirname9, resolve as resolve6 } from "path";
84366
84465
  import { fileURLToPath as fileURLToPath2 } from "url";
84367
- var PRODUCER_DIR = dirname8(fileURLToPath2(import.meta.url));
84466
+ var PRODUCER_DIR = dirname9(fileURLToPath2(import.meta.url));
84368
84467
  var SIBLING_MANIFEST_PATH = resolve6(PRODUCER_DIR, "hyperframe.manifest.json");
84369
84468
  var MODULE_RELATIVE_MANIFEST_PATH = resolve6(
84370
84469
  PRODUCER_DIR,
@@ -84382,7 +84481,7 @@ function resolveHyperframeManifestPath() {
84382
84481
  if (envOverride) {
84383
84482
  return envOverride;
84384
84483
  }
84385
- const found = MANIFEST_CANDIDATES.find((candidate) => existsSync16(candidate));
84484
+ const found = MANIFEST_CANDIDATES.find((candidate) => existsSync15(candidate));
84386
84485
  return found ?? MODULE_RELATIVE_MANIFEST_PATH;
84387
84486
  }
84388
84487
  function triedManifestPaths() {
@@ -84393,7 +84492,7 @@ function getVerifiedHyperframeRuntimeSource() {
84393
84492
  }
84394
84493
  function resolveVerifiedHyperframeRuntime() {
84395
84494
  const manifestPath = resolveHyperframeManifestPath();
84396
- if (!existsSync16(manifestPath)) {
84495
+ if (!existsSync15(manifestPath)) {
84397
84496
  const tried = triedManifestPaths().join(", ");
84398
84497
  throw new Error(
84399
84498
  `[HyperframeRuntimeLoader] Missing manifest. Tried: ${tried}. Searched from cwd=${process.cwd()}. Build core runtime artifacts before rendering.`
@@ -84407,8 +84506,8 @@ function resolveVerifiedHyperframeRuntime() {
84407
84506
  `[HyperframeRuntimeLoader] Invalid manifest at ${manifestPath}; missing iife artifact or sha256.`
84408
84507
  );
84409
84508
  }
84410
- const runtimePath = resolve6(dirname8(manifestPath), runtimeFileName);
84411
- if (!existsSync16(runtimePath)) {
84509
+ const runtimePath = resolve6(dirname9(manifestPath), runtimeFileName);
84510
+ if (!existsSync15(runtimePath)) {
84412
84511
  throw new Error(`[HyperframeRuntimeLoader] Missing runtime artifact at ${runtimePath}.`);
84413
84512
  }
84414
84513
  const runtimeSource = readFileSync6(runtimePath, "utf8");
@@ -84473,14 +84572,15 @@ function createConsoleLogger(level = "info") {
84473
84572
  var defaultLogger = createConsoleLogger("info");
84474
84573
 
84475
84574
  // ../producer/src/services/fileServer.ts
84575
+ var readFileAsync = promisify3(readFile2);
84476
84576
  function isPathInside2(child, parent, options = {}) {
84477
84577
  const { resolveSymlinks = false, pathModule } = options;
84478
84578
  const resolveFn = pathModule?.resolve ?? resolve7;
84479
84579
  const separator = pathModule?.sep ?? sep3;
84480
84580
  const resolvedChild = resolveFn(child);
84481
84581
  const resolvedParent = resolveFn(parent);
84482
- const normalizedChild = resolveSymlinks && existsSync17(resolvedChild) ? realpathSync2.native(resolvedChild) : resolvedChild;
84483
- const normalizedParent = resolveSymlinks && existsSync17(resolvedParent) ? realpathSync2.native(resolvedParent) : resolvedParent;
84582
+ const normalizedChild = resolveSymlinks && existsSync16(resolvedChild) ? realpathSync2.native(resolvedChild) : resolvedChild;
84583
+ const normalizedParent = resolveSymlinks && existsSync16(resolvedParent) ? realpathSync2.native(resolvedParent) : resolvedParent;
84484
84584
  if (normalizedChild === normalizedParent) return true;
84485
84585
  const parentWithSep = normalizedParent.endsWith(separator) ? normalizedParent : normalizedParent + separator;
84486
84586
  return normalizedChild.startsWith(parentWithSep);
@@ -84930,6 +85030,26 @@ function closeFileServerSafely(fileServer, label, log = defaultLogger) {
84930
85030
  });
84931
85031
  }
84932
85032
  }
85033
+ function openRegularFile(filePath) {
85034
+ let fd;
85035
+ try {
85036
+ fd = openSync4(filePath, constants3.O_RDONLY | constants3.O_NONBLOCK);
85037
+ } catch (error) {
85038
+ if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
85039
+ return null;
85040
+ if (!statSync7(filePath, { throwIfNoEntry: false })?.isFile()) return null;
85041
+ throw error;
85042
+ }
85043
+ let accepted = false;
85044
+ try {
85045
+ const stat = fstatSync2(fd);
85046
+ if (!stat.isFile()) return null;
85047
+ accepted = true;
85048
+ return { fd, stat, filePath };
85049
+ } finally {
85050
+ if (!accepted) closeSync4(fd);
85051
+ }
85052
+ }
84933
85053
  function createFileServer2(options) {
84934
85054
  const { projectDir, compiledDir, port = 0, stripEmbeddedRuntime = true } = options;
84935
85055
  const preHeadScripts = [
@@ -84950,76 +85070,73 @@ function createFileServer2(options) {
84950
85070
  return seg;
84951
85071
  }
84952
85072
  }).join("/");
84953
- let filePath = null;
84954
- if (compiledDir) {
84955
- const candidate = join18(compiledDir, relativePath);
84956
- if (existsSync17(candidate) && isPathInside2(candidate, compiledDir) && statSync7(candidate).isFile()) {
84957
- filePath = candidate;
84958
- }
84959
- }
84960
- if (!filePath) {
84961
- const candidate = join18(projectDir, relativePath);
84962
- if (existsSync17(candidate) && isPathInside2(candidate, projectDir) && statSync7(candidate).isFile()) {
84963
- filePath = candidate;
84964
- }
85073
+ let file = null;
85074
+ for (const root of compiledDir ? [compiledDir, projectDir] : [projectDir]) {
85075
+ const candidate = join19(root, relativePath);
85076
+ if (isPathInside2(candidate, root)) file = openRegularFile(candidate);
85077
+ if (file) break;
84965
85078
  }
84966
- if (!filePath) {
85079
+ if (!file) {
84967
85080
  if (!/favicon\.ico$/i.test(requestPath)) {
84968
85081
  console.warn(`[FileServer] 404 Not Found: ${requestPath}`);
84969
85082
  }
84970
85083
  return c.text("Not found", 404);
84971
85084
  }
84972
- const ext = extname4(filePath).toLowerCase();
84973
- const contentType = MIME_TYPES2[ext] || "application/octet-stream";
84974
- if (ext === ".html") {
84975
- const rawHtml = await readFile2(filePath, "utf-8");
84976
- const isIndex = relativePath === "index.html";
84977
- let html = rawHtml;
84978
- if (preHeadScripts.length > 0) {
84979
- html = injectScriptsAtHeadStart(html, preHeadScripts);
85085
+ const { fd, stat, filePath } = file;
85086
+ let streamOwnsFd = false;
85087
+ try {
85088
+ const ext = extname4(filePath).toLowerCase();
85089
+ const contentType = MIME_TYPES2[ext] || "application/octet-stream";
85090
+ if (ext === ".html") {
85091
+ const rawHtml = await readFileAsync(fd, "utf-8");
85092
+ const isIndex = relativePath === "index.html";
85093
+ let html = rawHtml;
85094
+ if (preHeadScripts.length > 0) {
85095
+ html = injectScriptsAtHeadStart(html, preHeadScripts);
85096
+ }
85097
+ html = isIndex ? injectScriptsIntoHtml(html, headScripts, bodyScripts, stripEmbeddedRuntime) : html;
85098
+ return c.text(html, 200, { "Content-Type": contentType });
85099
+ }
85100
+ const totalSize = stat.size;
85101
+ const rangeHeader = c.req.header("range");
85102
+ const rangeRequest = parseRangeHeader(rangeHeader, totalSize);
85103
+ if (rangeRequest.kind === "unsatisfiable") {
85104
+ return new Response(null, {
85105
+ status: 416,
85106
+ headers: {
85107
+ "Content-Type": contentType,
85108
+ "Content-Range": `bytes */${totalSize}`,
85109
+ "Accept-Ranges": "bytes"
85110
+ }
85111
+ });
84980
85112
  }
84981
- html = isIndex ? injectScriptsIntoHtml(html, headScripts, bodyScripts, stripEmbeddedRuntime) : html;
84982
- return c.text(html, 200, { "Content-Type": contentType });
84983
- }
84984
- const stat = statSync7(filePath);
84985
- const totalSize = stat.size;
84986
- const rangeHeader = c.req.header("range");
84987
- const rangeRequest = parseRangeHeader(rangeHeader, totalSize);
84988
- if (rangeRequest.kind === "unsatisfiable") {
84989
- return new Response(null, {
84990
- status: 416,
84991
- headers: {
84992
- "Content-Type": contentType,
84993
- "Content-Range": `bytes */${totalSize}`,
84994
- "Accept-Ranges": "bytes"
84995
- }
84996
- });
84997
- }
84998
- if (rangeRequest.kind === "satisfiable") {
84999
- const { start, end } = rangeRequest;
85000
- const length = end - start + 1;
85001
- const stream2 = createReadStream3(filePath, { start, end });
85002
- const webStream2 = Readable2.toWeb(stream2);
85003
- return new Response(webStream2, {
85004
- status: 206,
85113
+ const range = rangeRequest.kind === "satisfiable" ? rangeRequest : null;
85114
+ const responseOptions = {
85115
+ status: range ? 206 : 200,
85005
85116
  headers: {
85006
85117
  "Content-Type": contentType,
85007
- "Content-Length": String(length),
85008
- "Content-Range": `bytes ${start}-${end}/${totalSize}`,
85009
- "Accept-Ranges": "bytes"
85118
+ "Content-Length": String(range ? range.end - range.start + 1 : totalSize),
85119
+ "Accept-Ranges": "bytes",
85120
+ ...range ? { "Content-Range": `bytes ${range.start}-${range.end}/${totalSize}` } : {}
85010
85121
  }
85122
+ };
85123
+ if (c.req.method === "HEAD") return new Response(null, responseOptions);
85124
+ const stream = createReadStream3(filePath, {
85125
+ fd,
85126
+ autoClose: true,
85127
+ ...range ? { start: range.start, end: range.end } : {}
85011
85128
  });
85012
- }
85013
- const stream = createReadStream3(filePath);
85014
- const webStream = Readable2.toWeb(stream);
85015
- return new Response(webStream, {
85016
- status: 200,
85017
- headers: {
85018
- "Content-Type": contentType,
85019
- "Content-Length": String(totalSize),
85020
- "Accept-Ranges": "bytes"
85129
+ streamOwnsFd = true;
85130
+ try {
85131
+ const webStream = Readable2.toWeb(stream);
85132
+ return new Response(webStream, responseOptions);
85133
+ } catch (error) {
85134
+ stream.destroy();
85135
+ throw error;
85021
85136
  }
85022
- });
85137
+ } finally {
85138
+ if (!streamOwnsFd) closeSync4(fd);
85139
+ }
85023
85140
  });
85024
85141
  return new Promise((resolve18) => {
85025
85142
  const connections = /* @__PURE__ */ new Set();
@@ -85057,18 +85174,18 @@ init_dist2();
85057
85174
  import {
85058
85175
  copyFileSync as copyFileSync3,
85059
85176
  cpSync,
85060
- existsSync as existsSync18,
85177
+ existsSync as existsSync17,
85061
85178
  mkdirSync as mkdirSync9,
85062
- rmSync as rmSync6,
85179
+ rmSync as rmSync7,
85063
85180
  symlinkSync,
85064
85181
  writeFileSync as writeFileSync7
85065
85182
  } from "fs";
85066
- import { basename as basename4, dirname as dirname9, isAbsolute as isAbsolute2, join as join20, relative, resolve as resolve8 } from "path";
85183
+ import { basename as basename4, dirname as dirname10, isAbsolute as isAbsolute2, join as join21, relative, resolve as resolve8 } from "path";
85067
85184
 
85068
85185
  // ../producer/src/utils/paths.ts
85069
85186
  import {
85070
85187
  basename as basename3,
85071
- join as join19,
85188
+ join as join20,
85072
85189
  resolve as nodeResolve,
85073
85190
  relative as nodeRelative,
85074
85191
  isAbsolute as nodeIsAbsolute
@@ -85106,7 +85223,7 @@ function formatExportFrameName(index, ext) {
85106
85223
  function resolveRenderPaths(projectDir, outputPath, rendersDir = DEFAULT_RENDERS_DIR) {
85107
85224
  const absoluteProjectDir = nodeResolve(projectDir);
85108
85225
  const projectName = basename3(absoluteProjectDir);
85109
- const resolvedOutputPath = outputPath ?? join19(rendersDir, `${projectName}.mp4`);
85226
+ const resolvedOutputPath = outputPath ?? join20(rendersDir, `${projectName}.mp4`);
85110
85227
  const absoluteOutputPath = nodeResolve(resolvedOutputPath);
85111
85228
  return { absoluteProjectDir, absoluteOutputPath };
85112
85229
  }
@@ -85143,21 +85260,21 @@ function resolveDeviceScaleFactor(input) {
85143
85260
  return target.width / input.compositionWidth;
85144
85261
  }
85145
85262
  function writeCompiledArtifacts(compiled, workDir, includeSummary) {
85146
- const compileDir = join20(workDir, "compiled");
85263
+ const compileDir = join21(workDir, "compiled");
85147
85264
  mkdirSync9(compileDir, { recursive: true });
85148
- writeFileSync7(join20(compileDir, "index.html"), compiled.html, "utf-8");
85265
+ writeFileSync7(join21(compileDir, "index.html"), compiled.html, "utf-8");
85149
85266
  for (const [srcPath, html] of compiled.subCompositions) {
85150
- const outPath = join20(compileDir, srcPath);
85151
- mkdirSync9(dirname9(outPath), { recursive: true });
85267
+ const outPath = join21(compileDir, srcPath);
85268
+ mkdirSync9(dirname10(outPath), { recursive: true });
85152
85269
  writeFileSync7(outPath, html, "utf-8");
85153
85270
  }
85154
85271
  for (const [relativePath, absolutePath] of compiled.externalAssets) {
85155
- const outPath = resolve8(join20(compileDir, relativePath));
85272
+ const outPath = resolve8(join21(compileDir, relativePath));
85156
85273
  if (!isPathInside3(outPath, compileDir)) {
85157
85274
  console.warn(`[Render] Skipping external asset with unsafe path: ${relativePath}`);
85158
85275
  continue;
85159
85276
  }
85160
- mkdirSync9(dirname9(outPath), { recursive: true });
85277
+ mkdirSync9(dirname10(outPath), { recursive: true });
85161
85278
  copyFileSync3(absolutePath, outPath);
85162
85279
  }
85163
85280
  if (includeSummary) {
@@ -85183,7 +85300,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
85183
85300
  renderModeHints: compiled.renderModeHints,
85184
85301
  hasShaderTransitions: compiled.hasShaderTransitions
85185
85302
  };
85186
- writeFileSync7(join20(compileDir, "summary.json"), JSON.stringify(summary, null, 2), "utf-8");
85303
+ writeFileSync7(join21(compileDir, "summary.json"), JSON.stringify(summary, null, 2), "utf-8");
85187
85304
  }
85188
85305
  }
85189
85306
  function applyRenderModeHints(alreadyForced, compiled, log = defaultLogger) {
@@ -85210,18 +85327,18 @@ function updateJobStatus(job, status, stage, progress, onProgress) {
85210
85327
  }
85211
85328
  var materializePathModule = {
85212
85329
  resolve: resolve8,
85213
- join: join20,
85214
- dirname: dirname9,
85330
+ join: join21,
85331
+ dirname: dirname10,
85215
85332
  basename: basename4,
85216
85333
  relative,
85217
85334
  isAbsolute: isAbsolute2
85218
85335
  };
85219
85336
  var materializeFileSystem = {
85220
- existsSync: existsSync18,
85337
+ existsSync: existsSync17,
85221
85338
  mkdirSync: mkdirSync9,
85222
85339
  symlinkSync,
85223
85340
  cpSync,
85224
- rmSync: rmSync6
85341
+ rmSync: rmSync7
85225
85342
  };
85226
85343
  function createMemorySampler(intervalMs = 250) {
85227
85344
  let peakRss = 0;
@@ -85487,26 +85604,26 @@ var RenderExecutionContext = class {
85487
85604
 
85488
85605
  // ../producer/src/services/render/artifactTransaction.ts
85489
85606
  import {
85490
- closeSync as closeSync3,
85491
- existsSync as existsSync19,
85492
- fstatSync,
85493
- mkdtempSync as mkdtempSync4,
85494
- openSync as openSync3,
85607
+ closeSync as closeSync5,
85608
+ existsSync as existsSync18,
85609
+ fstatSync as fstatSync3,
85610
+ mkdtempSync as mkdtempSync6,
85611
+ openSync as openSync5,
85495
85612
  readSync,
85496
85613
  readdirSync as readdirSync8,
85497
85614
  renameSync as renameSync3,
85498
- rmSync as rmSync7
85615
+ rmSync as rmSync8
85499
85616
  } from "fs";
85500
- import { basename as basename5, dirname as dirname10, extname as extname5, join as join21, resolve as resolve9 } from "path";
85617
+ import { basename as basename5, dirname as dirname11, extname as extname5, join as join22, resolve as resolve9 } from "path";
85501
85618
 
85502
85619
  // ../producer/src/utils/ffprobe.ts
85503
85620
  init_src();
85504
85621
 
85505
85622
  // ../producer/src/services/render/artifactTransaction.ts
85506
85623
  var defaultFileSystem = {
85507
- existsSync: existsSync19,
85624
+ existsSync: existsSync18,
85508
85625
  renameSync: renameSync3,
85509
- rmSync: rmSync7
85626
+ rmSync: rmSync8
85510
85627
  };
85511
85628
  async function defaultArtifactDurationProbe(path) {
85512
85629
  const meta = await extractMediaMetadata(path);
@@ -85516,28 +85633,28 @@ async function defaultArtifactDurationProbe(path) {
85516
85633
  };
85517
85634
  }
85518
85635
  function createSiblingTransactionDirectory(destination) {
85519
- const parent = dirname10(destination);
85636
+ const parent = dirname11(destination);
85520
85637
  const extension = extname5(destination);
85521
85638
  const stem = extension ? basename5(destination, extension) : basename5(destination);
85522
- return mkdtempSync4(join21(parent, `.${stem}.hf-transaction-`));
85639
+ return mkdtempSync6(join22(parent, `.${stem}.hf-transaction-`));
85523
85640
  }
85524
85641
  function assertReadableNonEmptyFile(path) {
85525
- const fd = openSync3(path, "r");
85642
+ const fd = openSync5(path, "r");
85526
85643
  try {
85527
- const stat = fstatSync(fd);
85644
+ const stat = fstatSync3(fd);
85528
85645
  if (!stat.isFile() || stat.size <= 0) {
85529
85646
  throw new Error(`Render artifact is not a non-empty file: ${path}`);
85530
85647
  }
85531
85648
  readSync(fd, Buffer.allocUnsafe(1), 0, 1, 0);
85532
85649
  } finally {
85533
- closeSync3(fd);
85650
+ closeSync5(fd);
85534
85651
  }
85535
85652
  }
85536
85653
  function collectDirectoryFiles(root) {
85537
85654
  const files = [];
85538
85655
  const visit = (directory) => {
85539
85656
  for (const entry of readdirSync8(directory, { withFileTypes: true })) {
85540
- const path = join21(directory, entry.name);
85657
+ const path = join22(directory, entry.name);
85541
85658
  if (entry.isDirectory()) visit(path);
85542
85659
  else if (entry.isFile()) files.push(path);
85543
85660
  }
@@ -85580,8 +85697,8 @@ var ArtifactTransaction = class {
85580
85697
  this.fileSystem = fileSystem;
85581
85698
  this.destinationPath = resolve9(destinationPath);
85582
85699
  this.transactionDirectory = createSiblingTransactionDirectory(this.destinationPath);
85583
- this.stagingPath = join21(this.transactionDirectory, basename5(this.destinationPath));
85584
- this.backupPath = join21(this.transactionDirectory, "backup");
85700
+ this.stagingPath = join22(this.transactionDirectory, basename5(this.destinationPath));
85701
+ this.backupPath = join22(this.transactionDirectory, "backup");
85585
85702
  this.durationProbe = durationProbe;
85586
85703
  }
85587
85704
  kind;
@@ -86146,7 +86263,7 @@ function resolveVideoCaptureBeyondViewport(videoCount) {
86146
86263
  // ../producer/src/services/render/captureCost.ts
86147
86264
  init_dist2();
86148
86265
  init_src();
86149
- import { join as join22 } from "path";
86266
+ import { join as join23 } from "path";
86150
86267
  var CAPTURE_CALIBRATION_TARGET_MS = 600;
86151
86268
  var MAX_MEASURED_CAPTURE_COST_MULTIPLIER = 8;
86152
86269
  var CAPTURE_CALIBRATION_PROTOCOL_TIMEOUT_MS = 3e4;
@@ -86382,7 +86499,7 @@ async function runCaptureCalibration(input) {
86382
86499
  });
86383
86500
  let calibration;
86384
86501
  try {
86385
- calibration = await runOneCalibration(join22(workDir, "capture-calibration"), calibrationCfg);
86502
+ calibration = await runOneCalibration(join23(workDir, "capture-calibration"), calibrationCfg);
86386
86503
  } catch (error) {
86387
86504
  const shouldFallback = !forceScreenshot && shouldFallbackToScreenshotAfterCalibrationError(error);
86388
86505
  if (!shouldFallback) {
@@ -86415,7 +86532,7 @@ async function runCaptureCalibration(input) {
86415
86532
  const screenshotCfg = createCaptureCalibrationConfig({ ...cfg, forceScreenshot: true });
86416
86533
  try {
86417
86534
  calibration = await runOneCalibration(
86418
- join22(workDir, "capture-calibration-screenshot"),
86535
+ join23(workDir, "capture-calibration-screenshot"),
86419
86536
  screenshotCfg
86420
86537
  );
86421
86538
  } catch (fallbackError) {
@@ -86838,7 +86955,7 @@ function countAuthoredTimedClips(html) {
86838
86955
 
86839
86956
  // ../producer/src/services/render/stages/compileStage.ts
86840
86957
  init_dist2();
86841
- import { join as join28 } from "path";
86958
+ import { join as join29 } from "path";
86842
86959
 
86843
86960
  // ../producer/src/services/htmlCompiler.ts
86844
86961
  init_esm10();
@@ -86847,8 +86964,8 @@ init_audioGain();
86847
86964
  init_compiler();
86848
86965
  init_subCompositionValidity();
86849
86966
  init_assetResolution();
86850
- import { createReadStream as createReadStream4, existsSync as existsSync25, mkdirSync as mkdirSync13, readFileSync as readFileSync10 } from "fs";
86851
- import { join as join27, dirname as dirname13, resolve as resolve12, basename as basename6, relative as relative2 } from "path";
86967
+ import { createReadStream as createReadStream4, existsSync as existsSync24, mkdirSync as mkdirSync13, readFileSync as readFileSync10 } from "fs";
86968
+ import { join as join28, dirname as dirname14, resolve as resolve12, basename as basename6, relative as relative2 } from "path";
86852
86969
 
86853
86970
  // ../producer/src/services/renderMediaCollector.ts
86854
86971
  init_esm10();
@@ -86934,18 +87051,18 @@ init_src();
86934
87051
 
86935
87052
  // ../producer/src/services/deterministicFonts.ts
86936
87053
  import { createHash as createHash7 } from "crypto";
86937
- import { existsSync as existsSync22, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync6, readFileSync as readFileSync8, writeFileSync as writeFileSync9 } from "fs";
87054
+ import { existsSync as existsSync21, mkdirSync as mkdirSync11, mkdtempSync as mkdtempSync8, readFileSync as readFileSync8, writeFileSync as writeFileSync9 } from "fs";
86938
87055
  import { homedir as homedir5, tmpdir as tmpdir5 } from "os";
86939
- import { join as join25 } from "path";
87056
+ import { join as join26 } from "path";
86940
87057
 
86941
87058
  // ../core/dist/fonts/aliases.js
86942
87059
  init_dist();
86943
87060
 
86944
87061
  // ../core/dist/fonts/systemFontLocator.js
86945
87062
  import { execFileSync as execFileSync2 } from "child_process";
86946
- import { existsSync as existsSync20, lstatSync as lstatSync4, readdirSync as readdirSync9, realpathSync as realpathSync3 } from "fs";
87063
+ import { existsSync as existsSync19, lstatSync as lstatSync4, readdirSync as readdirSync9, realpathSync as realpathSync3 } from "fs";
86947
87064
  import { homedir as homedir3, platform as platform2 } from "os";
86948
- import { join as join23, resolve as resolve10 } from "path";
87065
+ import { join as join24, resolve as resolve10 } from "path";
86949
87066
  var SYSTEM_FONT_SIZE_LIMIT = 5 * 1024 * 1024;
86950
87067
  var PROFILER_TIMEOUT_MS = 5e3;
86951
87068
  var FONT_EXT_RE = /\.(otf|ttf|ttc|woff2?)$/i;
@@ -86977,7 +87094,7 @@ var allowedDirsCache = null;
86977
87094
  function getAllowedFontDirs() {
86978
87095
  if (allowedDirsCache)
86979
87096
  return allowedDirsCache;
86980
- allowedDirsCache = fontDirectories().filter((d) => existsSync20(d)).map((d) => {
87097
+ allowedDirsCache = fontDirectories().filter((d) => existsSync19(d)).map((d) => {
86981
87098
  try {
86982
87099
  return realpathSync3(d);
86983
87100
  } catch {
@@ -87042,7 +87159,7 @@ function fontDirectories() {
87042
87159
  const home = homedir3();
87043
87160
  if (platform2() === "darwin") {
87044
87161
  return [
87045
- join23(home, "Library", "Fonts"),
87162
+ join24(home, "Library", "Fonts"),
87046
87163
  "/Library/Fonts",
87047
87164
  "/System/Library/Fonts",
87048
87165
  "/System/Library/Fonts/Supplemental"
@@ -87050,24 +87167,24 @@ function fontDirectories() {
87050
87167
  }
87051
87168
  if (platform2() === "win32") {
87052
87169
  return [
87053
- join23(process.env.WINDIR || "C:\\Windows", "Fonts"),
87054
- join23(process.env.LOCALAPPDATA || join23(homedir3(), "AppData", "Local"), "Microsoft", "Windows", "Fonts")
87170
+ join24(process.env.WINDIR || "C:\\Windows", "Fonts"),
87171
+ join24(process.env.LOCALAPPDATA || join24(homedir3(), "AppData", "Local"), "Microsoft", "Windows", "Fonts")
87055
87172
  ];
87056
87173
  }
87057
87174
  return [
87058
- join23(home, ".fonts"),
87059
- join23(home, ".local", "share", "fonts"),
87175
+ join24(home, ".fonts"),
87176
+ join24(home, ".local", "share", "fonts"),
87060
87177
  "/usr/local/share/fonts",
87061
87178
  "/usr/share/fonts"
87062
87179
  ];
87063
87180
  }
87064
87181
  function collectFontFileEntries(dir, depth = 0) {
87065
- if (!existsSync20(dir) || depth > 2)
87182
+ if (!existsSync19(dir) || depth > 2)
87066
87183
  return [];
87067
87184
  const entries2 = [];
87068
87185
  try {
87069
87186
  for (const entry of readdirSync9(dir, { withFileTypes: true })) {
87070
- const fullPath = join23(dir, entry.name);
87187
+ const fullPath = join24(dir, entry.name);
87071
87188
  if (entry.isDirectory()) {
87072
87189
  entries2.push(...collectFontFileEntries(fullPath, depth + 1));
87073
87190
  continue;
@@ -87517,13 +87634,23 @@ function fontDataUri(packageName, weight, style = "normal") {
87517
87634
  }
87518
87635
  function extractExistingFontFaces(html) {
87519
87636
  const families = /* @__PURE__ */ new Set();
87520
- const fontFaceRegex = /@font-face\s*\{[\s\S]*?font-family\s*:\s*([^;]+);[\s\S]*?\}/gi;
87521
- for (const match of html.matchAll(fontFaceRegex)) {
87522
- const raw = match[1] || "";
87523
- const normalized = normalizeFamilyName(raw);
87524
- if (normalized) {
87525
- families.add(normalized);
87526
- }
87637
+ const opening = /@font-face\s*\{/gi;
87638
+ const family = /font-family\s*:/gi;
87639
+ while (opening.exec(html)) {
87640
+ family.lastIndex = opening.lastIndex;
87641
+ let declaration = family.exec(html);
87642
+ while (declaration && html[family.lastIndex] === ";") {
87643
+ declaration = family.exec(html);
87644
+ }
87645
+ if (!declaration) break;
87646
+ const valueStart = family.lastIndex;
87647
+ const semicolon = html.indexOf(";", valueStart);
87648
+ if (semicolon < 0) break;
87649
+ const end = html.indexOf("}", semicolon + 1);
87650
+ if (end < 0) break;
87651
+ const normalized = normalizeFamilyName(html.slice(valueStart, semicolon));
87652
+ if (normalized) families.add(normalized);
87653
+ opening.lastIndex = end + 1;
87527
87654
  }
87528
87655
  return families;
87529
87656
  }
@@ -87730,10 +87857,10 @@ function resolveFontCacheRoot() {
87730
87857
  return process.env.HYPERFRAMES_FONT_CACHE_DIR;
87731
87858
  }
87732
87859
  if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
87733
- lambdaFontCacheRoot ??= mkdtempSync6(join25(tmpdir5(), "hyperframes-fonts-"));
87860
+ lambdaFontCacheRoot ??= mkdtempSync8(join26(tmpdir5(), "hyperframes-fonts-"));
87734
87861
  return lambdaFontCacheRoot;
87735
87862
  }
87736
- return join25(homedir5(), ".cache", "hyperframes", "fonts");
87863
+ return join26(homedir5(), ".cache", "hyperframes", "fonts");
87737
87864
  }
87738
87865
  var WOFF2_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";
87739
87866
  function fontSlug(familyName) {
@@ -87741,14 +87868,14 @@ function fontSlug(familyName) {
87741
87868
  }
87742
87869
  var ephemeralFontCacheRoot;
87743
87870
  function fontCacheDir(slug) {
87744
- const dir = join25(resolveFontCacheRoot(), slug);
87745
- if (!existsSync22(dir)) {
87871
+ const dir = join26(resolveFontCacheRoot(), slug);
87872
+ if (!existsSync21(dir)) {
87746
87873
  try {
87747
87874
  mkdirSync11(dir, { recursive: true });
87748
87875
  } catch {
87749
87876
  const firstFallback = ephemeralFontCacheRoot === void 0;
87750
- ephemeralFontCacheRoot ??= mkdtempSync6(join25(tmpdir5(), "hyperframes-fonts-"));
87751
- const fallback = join25(ephemeralFontCacheRoot, slug);
87877
+ ephemeralFontCacheRoot ??= mkdtempSync8(join26(tmpdir5(), "hyperframes-fonts-"));
87878
+ const fallback = join26(ephemeralFontCacheRoot, slug);
87752
87879
  mkdirSync11(fallback, { recursive: true });
87753
87880
  if (firstFallback) {
87754
87881
  defaultLogger.warn(
@@ -87764,7 +87891,7 @@ function subsetToken(woff2Url) {
87764
87891
  return createHash7("sha1").update(woff2Url).digest("hex").slice(0, 12);
87765
87892
  }
87766
87893
  function cachedWoff2Path(slug, weight, style, subset) {
87767
- return join25(fontCacheDir(slug), `${weight}-${style}-${subset}.woff2`);
87894
+ return join26(fontCacheDir(slug), `${weight}-${style}-${subset}.woff2`);
87768
87895
  }
87769
87896
  var FONT_FETCH_FAILED = "FONT_FETCH_FAILED";
87770
87897
  var FONT_FETCH_UNAVAILABLE = "FONT_FETCH_UNAVAILABLE";
@@ -88165,14 +88292,14 @@ init_src();
88165
88292
  import { createHash as createHash8 } from "crypto";
88166
88293
  import {
88167
88294
  copyFileSync as copyFileSync4,
88168
- existsSync as existsSync23,
88295
+ existsSync as existsSync22,
88169
88296
  mkdirSync as mkdirSync12,
88170
88297
  readFileSync as readFileSync9,
88171
88298
  renameSync as renameSync5,
88172
- rmSync as rmSync9,
88299
+ rmSync as rmSync10,
88173
88300
  statSync as statSync8
88174
88301
  } from "fs";
88175
- import { dirname as dirname12, isAbsolute as isAbsolute3, join as join26, resolve as resolve11 } from "path";
88302
+ import { dirname as dirname13, isAbsolute as isAbsolute3, join as join27, resolve as resolve11 } from "path";
88176
88303
  var PREPARED_GIF_SUBDIR = "_animated_gif";
88177
88304
  var CACHE_SCHEMA = "hfgif-v1";
88178
88305
  function splitUrlSuffix(src) {
@@ -88207,14 +88334,14 @@ function resolveGifSourcePath(src, options) {
88207
88334
  const { basePath } = splitUrlSuffix(trimmed);
88208
88335
  const normalizedBase = normalizeRelPath(basePath);
88209
88336
  const mapped = options.sourceAssets?.get(trimmed) ?? options.sourceAssets?.get(basePath) ?? options.sourceAssets?.get(normalizedBase);
88210
- if (mapped && existsSync23(mapped)) return mapped;
88337
+ if (mapped && existsSync22(mapped)) return mapped;
88211
88338
  if (isHttpUrl(trimmed)) return null;
88212
88339
  const projectRelative = basePath.startsWith("/") ? basePath.slice(1) : basePath;
88213
88340
  const candidates = [
88214
88341
  isAbsolute3(basePath) ? basePath : resolve11(options.projectDir, projectRelative),
88215
88342
  resolve11(options.downloadDir, normalizedBase)
88216
88343
  ];
88217
- return candidates.find((candidate) => existsSync23(candidate)) ?? null;
88344
+ return candidates.find((candidate) => existsSync22(candidate)) ?? null;
88218
88345
  }
88219
88346
  function isUsableFile(path) {
88220
88347
  try {
@@ -88325,11 +88452,11 @@ async function runAnimatedGifTranscode(request) {
88325
88452
  throw result.error ?? new Error(`Animated GIF transcode failed (${result.exitCode}): ${result.stderr.slice(-500)}`);
88326
88453
  }
88327
88454
  async function ensurePreparedWebm(input) {
88328
- if (!existsSync23(dirname12(input.cachePath))) {
88329
- mkdirSync12(dirname12(input.cachePath), { recursive: true });
88455
+ if (!existsSync22(dirname13(input.cachePath))) {
88456
+ mkdirSync12(dirname13(input.cachePath), { recursive: true });
88330
88457
  }
88331
- if (!existsSync23(dirname12(input.outputPath))) {
88332
- mkdirSync12(dirname12(input.outputPath), { recursive: true });
88458
+ if (!existsSync22(dirname13(input.outputPath))) {
88459
+ mkdirSync12(dirname13(input.outputPath), { recursive: true });
88333
88460
  }
88334
88461
  if (!isUsableFile(input.cachePath)) {
88335
88462
  const tmpPath = `${input.cachePath}.tmp-${process.pid}-${Date.now()}`;
@@ -88353,10 +88480,10 @@ async function ensurePreparedWebm(input) {
88353
88480
  if (!isUsableFile(input.cachePath)) {
88354
88481
  renameSync5(tmpPath, input.cachePath);
88355
88482
  } else {
88356
- rmSync9(tmpPath, { force: true });
88483
+ rmSync10(tmpPath, { force: true });
88357
88484
  }
88358
88485
  } catch (error) {
88359
- rmSync9(tmpPath, { force: true });
88486
+ rmSync10(tmpPath, { force: true });
88360
88487
  throw error;
88361
88488
  }
88362
88489
  }
@@ -88412,7 +88539,7 @@ function replaceImageWithVideo(input) {
88412
88539
  return video;
88413
88540
  }
88414
88541
  async function prepareAnimatedGifInputs(html, options) {
88415
- const outputDir = options.outputDir ?? join26(options.downloadDir, PREPARED_GIF_SUBDIR);
88542
+ const outputDir = options.outputDir ?? join27(options.downloadDir, PREPARED_GIF_SUBDIR);
88416
88543
  const outputSrcPrefix = normalizeRelPath(options.outputSrcPrefix ?? PREPARED_GIF_SUBDIR);
88417
88544
  const cacheDir = options.cacheDir ?? outputDir;
88418
88545
  const { document: document2 } = parseHTML(html);
@@ -88434,8 +88561,8 @@ async function prepareAnimatedGifInputs(html, options) {
88434
88561
  const { loopIterations, padSeconds } = resolvePreparedPlayback(metadata, loop, windowSeconds);
88435
88562
  const hash2 = computePreparedGifHash(bytes, loopIterations, padSeconds);
88436
88563
  const filename = `${CACHE_SCHEMA}-${hash2.slice(0, 24)}.webm`;
88437
- const cachePath = join26(cacheDir, filename);
88438
- const outputPath = join26(outputDir, filename);
88564
+ const cachePath = join27(cacheDir, filename);
88565
+ const outputPath = join27(outputDir, filename);
88439
88566
  const outputSrc = `${outputSrcPrefix}/${filename}`;
88440
88567
  await ensurePreparedWebm({
88441
88568
  sourcePath,
@@ -88766,7 +88893,7 @@ function getPositionEditsRenderScript() {
88766
88893
 
88767
88894
  // ../producer/src/services/assetMediaType.ts
88768
88895
  init_src();
88769
- import { existsSync as existsSync24 } from "fs";
88896
+ import { existsSync as existsSync23 } from "fs";
88770
88897
 
88771
88898
  // ../producer/src/utils/semaphore.ts
88772
88899
  var Semaphore = class {
@@ -88881,7 +89008,7 @@ async function preflightCompositionAssetMediaTypes(input) {
88881
89008
  input.projectDir,
88882
89009
  input.compiledDir
88883
89010
  );
88884
- if (!existsSync24(resolvedPath)) continue;
89011
+ if (!existsSync23(resolvedPath)) continue;
88885
89012
  byPath.set(resolvedPath, [...byPath.get(resolvedPath) ?? [], reference]);
88886
89013
  }
88887
89014
  const mismatches = [];
@@ -88962,7 +89089,7 @@ function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */
88962
89089
  if (isUnresolvedAssetPlaceholder(srcPath)) continue;
88963
89090
  const filePath = resolve12(projectDir, srcPath);
88964
89091
  if (visited.has(filePath)) continue;
88965
- if (!existsSync25(filePath)) {
89092
+ if (!existsSync24(filePath)) {
88966
89093
  problems.push({ srcPath, detail: "the file does not exist" });
88967
89094
  continue;
88968
89095
  }
@@ -89096,7 +89223,7 @@ function detectShaderTransitionUsage(html) {
89096
89223
  async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, downloadDir, tagName19, elementIdentity, log) {
89097
89224
  let filePath = src;
89098
89225
  if (isHttpUrl(src)) {
89099
- if (!existsSync25(downloadDir)) mkdirSync13(downloadDir, { recursive: true });
89226
+ if (!existsSync24(downloadDir)) mkdirSync13(downloadDir, { recursive: true });
89100
89227
  try {
89101
89228
  filePath = await downloadToTemp(src, downloadDir, void 0, void 0, void 0, {
89102
89229
  onTelemetry: logRemoteDownloadTelemetry
@@ -89105,9 +89232,9 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, down
89105
89232
  return { duration: null, resolvedPath: src };
89106
89233
  }
89107
89234
  } else if (!filePath.startsWith("/")) {
89108
- filePath = join27(baseDir, filePath);
89235
+ filePath = join28(baseDir, filePath);
89109
89236
  }
89110
- if (!existsSync25(filePath)) {
89237
+ if (!existsSync24(filePath)) {
89111
89238
  return { duration: null, resolvedPath: filePath };
89112
89239
  }
89113
89240
  const withSrcContext = (error) => {
@@ -89240,7 +89367,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
89240
89367
  if (visited.has(filePath)) {
89241
89368
  continue;
89242
89369
  }
89243
- if (!existsSync25(filePath)) {
89370
+ if (!existsSync24(filePath)) {
89244
89371
  continue;
89245
89372
  }
89246
89373
  const rawSubHtml = readFileSync10(filePath, "utf-8");
@@ -89252,7 +89379,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
89252
89379
  workItems.map(async (item) => {
89253
89380
  const { html: compiledSub } = await compileHtmlFile(
89254
89381
  item.rawSubHtml,
89255
- dirname13(item.filePath),
89382
+ dirname14(item.filePath),
89256
89383
  downloadDir
89257
89384
  );
89258
89385
  const nested = await parseSubCompositions(
@@ -89432,7 +89559,7 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
89432
89559
  let compHtml = subCompositions.get(srcPath) || null;
89433
89560
  if (!compHtml) {
89434
89561
  const filePath = resolve12(projectDir, srcPath);
89435
- if (existsSync25(filePath)) {
89562
+ if (existsSync24(filePath)) {
89436
89563
  compHtml = readFileSync10(filePath, "utf-8");
89437
89564
  }
89438
89565
  }
@@ -89441,7 +89568,7 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
89441
89568
  parseHtml: (htmlStr) => parseHTML(htmlStr).document,
89442
89569
  // Mirrors the preview bundler: a sub-composition's SIBLING assets resolve
89443
89570
  // against its own directory, project-root refs stay as authored.
89444
- assetExists: (path) => existsSync25(resolve12(projectDir, path)),
89571
+ assetExists: (path) => existsSync24(resolve12(projectDir, path)),
89445
89572
  scriptErrorLabel: "[Compiler] Composition script failed",
89446
89573
  // Preserve the authored root wrapper as a child of the host, matching
89447
89574
  // the preview bundler's shape (htmlBundler.ts's prepareFlattenedInnerRoot,
@@ -89604,7 +89731,7 @@ function collectExternalAssets(html, projectDir) {
89604
89731
  if (isPathInside3(absPath, absProjectDir)) {
89605
89732
  return null;
89606
89733
  }
89607
- if (!existsSync25(absPath)) return null;
89734
+ if (!existsSync24(absPath)) return null;
89608
89735
  const safeKey = toExternalAssetKey(absPath);
89609
89736
  externalAssets.set(safeKey, absPath);
89610
89737
  return safeKey;
@@ -89654,7 +89781,7 @@ var REMOTE_SOURCE_TAG_RE = /<source\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+)["
89654
89781
  var REMOTE_IMG_TAG_RE = /<img\b[^>]*?(?<![\w-])src\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
89655
89782
  async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLabel, extraRewrite) {
89656
89783
  if (urlSet.size === 0) return { html, remoteMediaAssets: /* @__PURE__ */ new Map() };
89657
- if (!existsSync25(remoteDir)) mkdirSync13(remoteDir, { recursive: true });
89784
+ if (!existsSync24(remoteDir)) mkdirSync13(remoteDir, { recursive: true });
89658
89785
  const urlToLocal = /* @__PURE__ */ new Map();
89659
89786
  await Promise.all(
89660
89787
  [...urlSet].map(async (url) => {
@@ -89701,7 +89828,7 @@ async function localizeRemoteMediaSources(html, downloadDir) {
89701
89828
  return downloadAndRewriteUrls(
89702
89829
  urlSet,
89703
89830
  html,
89704
- join27(downloadDir, REMOTE_MEDIA_SUBDIR),
89831
+ join28(downloadDir, REMOTE_MEDIA_SUBDIR),
89705
89832
  "Remote media download failed",
89706
89833
  "Localized remote media source(s)"
89707
89834
  );
@@ -89716,7 +89843,7 @@ async function localizeRemoteImageSources(html, downloadDir) {
89716
89843
  return downloadAndRewriteUrls(
89717
89844
  urlSet,
89718
89845
  html,
89719
- join27(downloadDir, REMOTE_MEDIA_SUBDIR),
89846
+ join28(downloadDir, REMOTE_MEDIA_SUBDIR),
89720
89847
  "Remote image download failed",
89721
89848
  "Localized remote image source(s)"
89722
89849
  );
@@ -89732,7 +89859,7 @@ async function localizeRemoteBackgroundImages(html, downloadDir) {
89732
89859
  return downloadAndRewriteUrls(
89733
89860
  urlSet,
89734
89861
  html,
89735
- join27(downloadDir, REMOTE_MEDIA_SUBDIR),
89862
+ join28(downloadDir, REMOTE_MEDIA_SUBDIR),
89736
89863
  "Remote background-image download failed",
89737
89864
  "Localized remote background-image(s)",
89738
89865
  // Quoted url('..')/url("..") are rewritten by downloadAndRewriteUrls' default
@@ -89867,7 +89994,7 @@ async function localizeRemoteFontFaces(html, downloadDir) {
89867
89994
  return downloadAndRewriteUrls(
89868
89995
  urlSet,
89869
89996
  processed,
89870
- join27(downloadDir, REMOTE_MEDIA_SUBDIR),
89997
+ join28(downloadDir, REMOTE_MEDIA_SUBDIR),
89871
89998
  "Remote font download failed",
89872
89999
  "Localized remote font face(s)",
89873
90000
  (h, url, relPath) => h.replaceAll(`url(${url})`, `url("${relPath}")`)
@@ -89956,7 +90083,7 @@ function rewriteUnresolvableGsapToCdn(html, projectDir) {
89956
90083
  (full, prefix, src, file, suffix) => {
89957
90084
  if (/^https?:\/\//i.test(src)) return full;
89958
90085
  const absPath = resolve12(projectDir, src);
89959
- if (existsSync25(absPath)) return full;
90086
+ if (existsSync24(absPath)) return full;
89960
90087
  defaultLogger.info(
89961
90088
  `[Compiler] Rewriting missing gsap script to CDN: ${src} \u2192 ${GSAP_CDN_BASE}${file}`
89962
90089
  );
@@ -89969,7 +90096,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
89969
90096
  const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
89970
90097
  if (!entryPath.includes("/")) return html;
89971
90098
  const { document: document2 } = parseHTML(html);
89972
- const assetExists = (path) => existsSync25(resolve12(projectDir, path));
90099
+ const assetExists = (path) => existsSync24(resolve12(projectDir, path));
89973
90100
  rewriteAssetPaths(
89974
90101
  document2.querySelectorAll("[src], [href]"),
89975
90102
  entryPath,
@@ -90481,13 +90608,13 @@ async function runCompileStage(input) {
90481
90608
  abortSignal
90482
90609
  } = input;
90483
90610
  const compileStart = Date.now();
90484
- const compiled = await compileForRender(projectDir, htmlPath, join28(workDir, "downloads"), {
90611
+ const compiled = await compileForRender(projectDir, htmlPath, join29(workDir, "downloads"), {
90485
90612
  log,
90486
90613
  failClosedFontFetch: failClosedFontFetch === true,
90487
90614
  allowSystemFontCapture,
90488
90615
  abortSignal,
90489
90616
  variables: input.variables,
90490
- animatedGifCacheDir: cfg.extractCacheDir ? join28(cfg.extractCacheDir, "animated-gif") : void 0,
90617
+ animatedGifCacheDir: cfg.extractCacheDir ? join29(cfg.extractCacheDir, "animated-gif") : void 0,
90491
90618
  ffmpegProcessTimeout: cfg.ffmpegProcessTimeout
90492
90619
  });
90493
90620
  assertNotAborted();
@@ -90549,7 +90676,7 @@ async function runCompileStage(input) {
90549
90676
  };
90550
90677
  await preflightCompositionAssetMediaTypes({
90551
90678
  projectDir,
90552
- compiledDir: join28(workDir, "compiled"),
90679
+ compiledDir: join29(workDir, "compiled"),
90553
90680
  composition,
90554
90681
  signal: abortSignal
90555
90682
  });
@@ -90597,7 +90724,7 @@ async function runCompileStage(input) {
90597
90724
  init_esm10();
90598
90725
  init_src();
90599
90726
  init_dist2();
90600
- import { join as join29 } from "path";
90727
+ import { join as join30 } from "path";
90601
90728
 
90602
90729
  // ../producer/src/services/render/stages/probeFailures.ts
90603
90730
  var NETWORK_FAILURE_PATTERN = /404|ERR_NAME_NOT_RESOLVED|ERR_CONNECTION_REFUSED|net::ERR_/i;
@@ -90703,7 +90830,7 @@ async function runProbeStage(input) {
90703
90830
  });
90704
90831
  fileServer = await createFileServer2({
90705
90832
  projectDir,
90706
- compiledDir: join29(workDir, "compiled"),
90833
+ compiledDir: join30(workDir, "compiled"),
90707
90834
  port: 0,
90708
90835
  preHeadScripts: [VIRTUAL_TIME_SHIM],
90709
90836
  fps: job.config.fps
@@ -90725,7 +90852,7 @@ async function runProbeStage(input) {
90725
90852
  log.info("Creating capture session...", { attempt, maxAttempts: PROBE_MAX_ATTEMPTS });
90726
90853
  probeSession = await createCaptureSession(
90727
90854
  fileServer.url,
90728
- join29(workDir, "probe"),
90855
+ join30(workDir, "probe"),
90729
90856
  captureOpts,
90730
90857
  null,
90731
90858
  probeCfg
@@ -90810,7 +90937,7 @@ async function runProbeStage(input) {
90810
90937
  });
90811
90938
  probeSession = await createCaptureSession(
90812
90939
  fileServer.url,
90813
- join29(workDir, "probe-screenshot"),
90940
+ join30(workDir, "probe-screenshot"),
90814
90941
  captureOpts,
90815
90942
  null,
90816
90943
  { ...probeCfg, forceScreenshot: true }
@@ -90846,7 +90973,7 @@ async function runProbeStage(input) {
90846
90973
  compiled,
90847
90974
  resolutions,
90848
90975
  projectDir,
90849
- join29(workDir, "downloads")
90976
+ join30(workDir, "downloads")
90850
90977
  );
90851
90978
  assertNotAborted();
90852
90979
  composition.videos = compiled.videos;
@@ -91025,7 +91152,7 @@ async function runProbeStage(input) {
91025
91152
  try {
91026
91153
  await preflightCompositionAssetMediaTypes({
91027
91154
  projectDir,
91028
- compiledDir: join29(workDir, "compiled"),
91155
+ compiledDir: join30(workDir, "compiled"),
91029
91156
  composition,
91030
91157
  signal: abortSignal
91031
91158
  });
@@ -91152,8 +91279,8 @@ function validateRenderDuration(input) {
91152
91279
 
91153
91280
  // ../producer/src/services/render/stages/extractVideosStage.ts
91154
91281
  init_src();
91155
- import { existsSync as existsSync26 } from "fs";
91156
- import { join as join30 } from "path";
91282
+ import { existsSync as existsSync25 } from "fs";
91283
+ import { join as join31 } from "path";
91157
91284
 
91158
91285
  // ../producer/src/services/render/extractionFailureMetadata.ts
91159
91286
  function stringOrEmpty(value) {
@@ -91382,7 +91509,7 @@ async function runExtractVideosStage(input) {
91382
91509
  const probeFailures = await Promise.all(
91383
91510
  composition.videos.map(async (v) => {
91384
91511
  const videoPath = resolveProjectRelativeSrc(v.src, projectDir, compiledDir);
91385
- if (!existsSync26(videoPath)) return null;
91512
+ if (!existsSync25(videoPath)) return null;
91386
91513
  try {
91387
91514
  const attempted = extractionPolicy.maxTransientRetries === 0 ? { result: await extractMediaMetadata(videoPath), retries: 0 } : await runVideoExtractionWithRetry(() => extractMediaMetadata(videoPath), {
91388
91515
  signal: abortSignal,
@@ -91420,7 +91547,7 @@ async function runExtractVideosStage(input) {
91420
91547
  const probed = await Promise.all(
91421
91548
  composition.images.map(async (img) => {
91422
91549
  const imgPath = resolveProjectRelativeSrc(img.src, projectDir, compiledDir);
91423
- if (!existsSync26(imgPath)) return null;
91550
+ if (!existsSync25(imgPath)) return null;
91424
91551
  const colorSpace = await probeColorSpaceSafely(imgPath, log);
91425
91552
  if (isHdrColorSpace(colorSpace)) {
91426
91553
  nativeHdrImageIds.add(img.id);
@@ -91449,7 +91576,7 @@ async function runExtractVideosStage(input) {
91449
91576
  // because short boundary counts can differ by one frame.
91450
91577
  {
91451
91578
  fps: job.config.fps,
91452
- outputDir: join30(compiledDir, "__hyperframes_video_frames"),
91579
+ outputDir: join31(compiledDir, "__hyperframes_video_frames"),
91453
91580
  format: job.config.videoFrameFormat ?? "auto",
91454
91581
  timelineEnd: composition.duration,
91455
91582
  maxTransientRetries: extractionPolicy.maxTransientRetries,
@@ -91514,7 +91641,7 @@ function appendAutoDetectedVideoAudio(composition, extracted) {
91514
91641
 
91515
91642
  // ../producer/src/services/render/stages/audioStage.ts
91516
91643
  init_src();
91517
- import { join as join31 } from "path";
91644
+ import { join as join32 } from "path";
91518
91645
  async function runAudioStage(input) {
91519
91646
  const {
91520
91647
  projectDir,
@@ -91529,7 +91656,7 @@ async function runAudioStage(input) {
91529
91656
  log
91530
91657
  } = input;
91531
91658
  const stage3Start = Date.now();
91532
- const audioOutputPath = join31(workDir, MIXED_AUDIO_FILENAME);
91659
+ const audioOutputPath = join32(workDir, MIXED_AUDIO_FILENAME);
91533
91660
  let hasAudio = false;
91534
91661
  let audioError;
91535
91662
  let audioFailures;
@@ -91539,7 +91666,7 @@ async function runAudioStage(input) {
91539
91666
  audioResult = await processCompositionAudio(
91540
91667
  audios,
91541
91668
  projectDir,
91542
- join31(workDir, "audio-work"),
91669
+ join32(workDir, "audio-work"),
91543
91670
  audioOutputPath,
91544
91671
  duration,
91545
91672
  abortSignal,
@@ -91807,15 +91934,15 @@ async function runCaptureStage(input) {
91807
91934
  init_src();
91808
91935
  import { mkdtemp as mkdtemp2, writeFile as writeFile2 } from "fs/promises";
91809
91936
  import { tmpdir as tmpdir6 } from "os";
91810
- import { join as join34 } from "path";
91937
+ import { join as join35 } from "path";
91811
91938
 
91812
91939
  // ../producer/src/services/render/stages/captureHdrFrameShared.ts
91813
91940
  init_src();
91814
91941
 
91815
91942
  // ../producer/src/services/hdrCompositor.ts
91816
91943
  init_src();
91817
- import { readSync as readSync2, closeSync as closeSync4 } from "fs";
91818
- import { join as join32 } from "path";
91944
+ import { readSync as readSync2, closeSync as closeSync6 } from "fs";
91945
+ import { join as join33 } from "path";
91819
91946
  function countNonZeroAlpha(rgba) {
91820
91947
  let n = 0;
91821
91948
  for (let p = 3; p < rgba.length; p += 4) {
@@ -91854,7 +91981,7 @@ function cropRgb48le(src, srcW, srcH, cropX, cropY, cropW, cropH) {
91854
91981
  }
91855
91982
  function closeHdrVideoFrameSource(source, log) {
91856
91983
  try {
91857
- closeSync4(source.fd);
91984
+ closeSync6(source.fd);
91858
91985
  } catch (err) {
91859
91986
  log?.warn("Failed to close HDR raw frame file", {
91860
91987
  rawPath: source.rawPath,
@@ -92221,7 +92348,7 @@ async function compositeHdrFrame(ctx, canvas, time, fullStacking, elementFilter,
92221
92348
  if (shouldLog && debugDumpDir) {
92222
92349
  const after2 = countNonZeroRgb48(canvas);
92223
92350
  const dumpName = `frame_${String(debugFrameIndex).padStart(4, "0")}_layer_${String(layerIdx).padStart(2, "0")}_dom.png`;
92224
- const dumpPath = join32(debugDumpDir, dumpName);
92351
+ const dumpPath = join33(debugDumpDir, dumpName);
92225
92352
  writeFileExclusiveSync(dumpPath, domPng);
92226
92353
  log.info("[diag] dom layer blit", {
92227
92354
  frame: debugFrameIndex,
@@ -92259,18 +92386,18 @@ async function compositeHdrFrame(ctx, canvas, time, fullStacking, elementFilter,
92259
92386
  init_src();
92260
92387
  init_dist2();
92261
92388
  import {
92262
- closeSync as closeSync5,
92263
- constants as constants2,
92264
- fstatSync as fstatSync2,
92389
+ closeSync as closeSync7,
92390
+ constants as constants4,
92391
+ fstatSync as fstatSync4,
92265
92392
  mkdirSync as mkdirSync14,
92266
- mkdtempSync as mkdtempSync7,
92267
- openSync as openSync4,
92393
+ mkdtempSync as mkdtempSync9,
92394
+ openSync as openSync6,
92268
92395
  readFileSync as readFileSync11,
92269
- rmSync as rmSync10,
92396
+ rmSync as rmSync11,
92270
92397
  statfsSync as statfsSync2
92271
92398
  } from "fs";
92272
- import { join as join33 } from "path";
92273
- var NO_FOLLOW_FLAG = constants2.O_NOFOLLOW ?? 0;
92399
+ import { join as join34 } from "path";
92400
+ var NO_FOLLOW_FLAG = constants4.O_NOFOLLOW ?? 0;
92274
92401
  function tempDirSafePrefix(id) {
92275
92402
  const safe = id.replace(/[^A-Za-z0-9_.-]/g, "_").slice(0, 80);
92276
92403
  return safe || "video";
@@ -92420,7 +92547,7 @@ function resolveHdrExtractionWindow(video, compositionDuration, metadata) {
92420
92547
  function cleanupHdrFrameDirectory(frameDir, rawPath, log) {
92421
92548
  if (process.env.KEEP_TEMP === "1") return;
92422
92549
  try {
92423
- rmSync10(frameDir, { recursive: true, force: true });
92550
+ rmSync11(frameDir, { recursive: true, force: true });
92424
92551
  } catch (err) {
92425
92552
  log?.warn("Failed to clean up HDR raw frame directory", {
92426
92553
  frameDir,
@@ -92513,10 +92640,10 @@ async function extractHdrVideoFrames(args) {
92513
92640
  const window3 = extractionWindows.get(videoId);
92514
92641
  if (!video || !window3) continue;
92515
92642
  mkdirSync14(framesDir, { recursive: true });
92516
- const frameDir = mkdtempSync7(join33(framesDir, `hdr_${tempDirSafePrefix(videoId)}-`));
92643
+ const frameDir = mkdtempSync9(join34(framesDir, `hdr_${tempDirSafePrefix(videoId)}-`));
92517
92644
  createdFrameDirs.add(frameDir);
92518
92645
  const dims = prep.hdrExtractionDims.get(videoId) ?? { width, height };
92519
- const rawPath = join33(frameDir, "frames.rgb48le");
92646
+ const rawPath = join34(frameDir, "frames.rgb48le");
92520
92647
  const extractionStart = String(window3.extractionMediaStart ?? window3.mediaStart);
92521
92648
  const ffmpegArgs = [];
92522
92649
  if (window3.finalFrameOnly) {
@@ -92558,10 +92685,10 @@ async function extractHdrVideoFrames(args) {
92558
92685
  });
92559
92686
  }
92560
92687
  const frameSize = dims.width * dims.height * 6;
92561
- const fd = openSync4(rawPath, constants2.O_RDONLY | NO_FOLLOW_FLAG);
92688
+ const fd = openSync6(rawPath, constants4.O_RDONLY | NO_FOLLOW_FLAG);
92562
92689
  let handedOff = false;
92563
92690
  try {
92564
- const frameCount = Math.floor(fstatSync2(fd).size / frameSize);
92691
+ const frameCount = Math.floor(fstatSync4(fd).size / frameSize);
92565
92692
  if (frameCount < 1) {
92566
92693
  hdrDiagnostics.videoExtractionFailures += 1;
92567
92694
  throw new Error(
@@ -92581,7 +92708,7 @@ async function extractHdrVideoFrames(args) {
92581
92708
  });
92582
92709
  handedOff = true;
92583
92710
  } finally {
92584
- if (!handedOff) closeSync5(fd);
92711
+ if (!handedOff) closeSync7(fd);
92585
92712
  }
92586
92713
  }
92587
92714
  return { sources: out, estimatedBytes, releaseReservation };
@@ -92981,11 +93108,11 @@ function createDrainFrameGuard(args) {
92981
93108
  return buf;
92982
93109
  }
92983
93110
  if (db < verifyMinDb) {
92984
- const dumpDir = await mkdtemp2(join34(tmpdir6(), "hf-de-verify-fail-")).catch(() => null);
93111
+ const dumpDir = await mkdtemp2(join35(tmpdir6(), "hf-de-verify-fail-")).catch(() => null);
92985
93112
  if (dumpDir) {
92986
93113
  await Promise.all([
92987
- writeFile2(join34(dumpDir, `frame-${idx}-de.jpg`), buf),
92988
- writeFile2(join34(dumpDir, `frame-${idx}-truth.jpg`), truth)
93114
+ writeFile2(join35(dumpDir, `frame-${idx}-de.jpg`), buf),
93115
+ writeFile2(join35(dumpDir, `frame-${idx}-truth.jpg`), truth)
92989
93116
  ]).catch(() => {
92990
93117
  });
92991
93118
  }
@@ -93379,8 +93506,8 @@ async function runCaptureStreamingStage(input) {
93379
93506
  // ../producer/src/services/render/stages/captureHdrStage.ts
93380
93507
  init_src();
93381
93508
  init_dist2();
93382
- import { existsSync as existsSync28, mkdirSync as mkdirSync15 } from "fs";
93383
- import { join as join38 } from "path";
93509
+ import { existsSync as existsSync27, mkdirSync as mkdirSync15 } from "fs";
93510
+ import { join as join39 } from "path";
93384
93511
 
93385
93512
  // ../producer/src/services/hdrImageTransferCache.ts
93386
93513
  init_src();
@@ -93444,7 +93571,7 @@ function createHdrImageTransferCache(options = {}) {
93444
93571
 
93445
93572
  // ../producer/src/services/render/stages/captureHdrSequentialLoop.ts
93446
93573
  init_src();
93447
- import { join as join35 } from "path";
93574
+ import { join as join36 } from "path";
93448
93575
  async function runSequentialLayeredFrameLoop(input) {
93449
93576
  const {
93450
93577
  job,
@@ -93565,7 +93692,7 @@ async function runSequentialLayeredFrameLoop(input) {
93565
93692
  );
93566
93693
  if (debugDumpEnabled && debugDumpDir && i % 30 === 0) {
93567
93694
  writeFileExclusiveSync(
93568
- join35(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
93695
+ join36(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
93569
93696
  normalCanvas
93570
93697
  );
93571
93698
  }
@@ -93600,14 +93727,14 @@ async function runSequentialLayeredFrameLoop(input) {
93600
93727
 
93601
93728
  // ../producer/src/services/render/stages/captureHdrHybridLoop.ts
93602
93729
  init_src();
93603
- import { join as join37 } from "path";
93730
+ import { join as join38 } from "path";
93604
93731
 
93605
93732
  // ../producer/src/services/shaderTransitionWorkerPool.ts
93606
93733
  import { Worker as Worker2 } from "worker_threads";
93607
93734
  import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL2 } from "url";
93608
- import { dirname as dirname14, join as join36 } from "path";
93735
+ import { dirname as dirname15, join as join37 } from "path";
93609
93736
  import { createRequire as createRequire2 } from "module";
93610
- import { existsSync as existsSync27 } from "fs";
93737
+ import { existsSync as existsSync26 } from "fs";
93611
93738
  import { cpus as cpus3 } from "os";
93612
93739
  function resolveWorkerEntry(explicit) {
93613
93740
  if (explicit && explicit.length > 0) {
@@ -93618,10 +93745,10 @@ function resolveWorkerEntry(explicit) {
93618
93745
  const isTs = override.endsWith(".ts");
93619
93746
  return { path: override, isTs };
93620
93747
  }
93621
- const moduleDir = dirname14(fileURLToPath4(import.meta.url));
93622
- const jsPath = join36(moduleDir, "shaderTransitionWorker.js");
93623
- if (existsSync27(jsPath)) return { path: jsPath, isTs: false };
93624
- const tsPath = join36(moduleDir, "shaderTransitionWorker.ts");
93748
+ const moduleDir = dirname15(fileURLToPath4(import.meta.url));
93749
+ const jsPath = join37(moduleDir, "shaderTransitionWorker.js");
93750
+ if (existsSync26(jsPath)) return { path: jsPath, isTs: false };
93751
+ const tsPath = join37(moduleDir, "shaderTransitionWorker.ts");
93625
93752
  return { path: tsPath, isTs: true };
93626
93753
  }
93627
93754
  function buildExecArgv(entryIsTs) {
@@ -93991,7 +94118,7 @@ async function runHybridLayeredFrameLoop(input) {
93991
94118
  );
93992
94119
  if (debugDumpEnabled && debugDumpDir && i % 30 === 0) {
93993
94120
  writeFileExclusiveSync(
93994
- join37(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
94121
+ join38(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
93995
94122
  canvas
93996
94123
  );
93997
94124
  }
@@ -94177,8 +94304,8 @@ async function runCaptureHdrStage(input) {
94177
94304
  if (hdrVideoFrameSources.has(v.id)) hdrVideoEndTimes.set(v.id, v.end);
94178
94305
  }
94179
94306
  const debugDumpEnabled = process.env.KEEP_TEMP === "1";
94180
- const debugDumpDir = debugDumpEnabled ? join38(framesDir, "debug-composite") : null;
94181
- if (debugDumpDir && !existsSync28(debugDumpDir)) {
94307
+ const debugDumpDir = debugDumpEnabled ? join39(framesDir, "debug-composite") : null;
94308
+ if (debugDumpDir && !existsSync27(debugDumpDir)) {
94182
94309
  mkdirSync15(debugDumpDir, { recursive: true });
94183
94310
  }
94184
94311
  const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
@@ -94328,11 +94455,11 @@ async function runCaptureHdrStage(input) {
94328
94455
 
94329
94456
  // ../producer/src/services/render/stages/encodeStage.ts
94330
94457
  init_src();
94331
- import { copyFileSync as copyFileSync5, existsSync as existsSync29, mkdirSync as mkdirSync16, readdirSync as readdirSync10, rmSync as rmSync11, statSync as statSync9 } from "fs";
94332
- import { dirname as dirname15, join as join40 } from "path";
94458
+ import { copyFileSync as copyFileSync5, existsSync as existsSync28, mkdirSync as mkdirSync16, readdirSync as readdirSync10, rmSync as rmSync12, statSync as statSync9 } from "fs";
94459
+ import { dirname as dirname16, join as join41 } from "path";
94333
94460
 
94334
94461
  // ../producer/src/services/render/stages/gifEncodeArgs.ts
94335
- import { join as join39 } from "path";
94462
+ import { join as join40 } from "path";
94336
94463
  function fpsToFfmpegArg2(fps) {
94337
94464
  return fps.den === 1 ? String(fps.num) : `${fps.num}/${fps.den}`;
94338
94465
  }
@@ -94344,7 +94471,7 @@ function buildGifPalettegenArgs(input) {
94344
94471
  "-framerate",
94345
94472
  fpsArg,
94346
94473
  "-i",
94347
- join39(input.framesDir, input.framePattern),
94474
+ join40(input.framesDir, input.framePattern),
94348
94475
  "-vf",
94349
94476
  `fps=${fpsArg},palettegen=stats_mode=diff${transparency}`,
94350
94477
  input.palettePath
@@ -94358,7 +94485,7 @@ function buildGifPaletteuseArgs(input) {
94358
94485
  "-framerate",
94359
94486
  fpsArg,
94360
94487
  "-i",
94361
- join39(input.framesDir, input.framePattern),
94488
+ join40(input.framesDir, input.framePattern),
94362
94489
  "-i",
94363
94490
  input.palettePath,
94364
94491
  "-lavfi",
@@ -94431,7 +94558,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
94431
94558
  failureReason: gifResult.failureReason
94432
94559
  };
94433
94560
  }
94434
- const fileSize = existsSync29(outputPath) ? statSync9(outputPath).size : 0;
94561
+ const fileSize = existsSync28(outputPath) ? statSync9(outputPath).size : 0;
94435
94562
  return {
94436
94563
  success: true,
94437
94564
  outputPath,
@@ -94440,7 +94567,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
94440
94567
  fileSize
94441
94568
  };
94442
94569
  } finally {
94443
- rmSync11(input.palettePath, { force: true });
94570
+ rmSync12(input.palettePath, { force: true });
94444
94571
  }
94445
94572
  }
94446
94573
  async function runEncodeStage(input) {
@@ -94469,7 +94596,7 @@ async function runEncodeStage(input) {
94469
94596
  const stage5Start = Date.now();
94470
94597
  if (isPngSequence) {
94471
94598
  updateJobStatus(job, "encoding", "Writing PNG sequence", 75, onProgress);
94472
- if (!existsSync29(outputPath)) mkdirSync16(outputPath, { recursive: true });
94599
+ if (!existsSync28(outputPath)) mkdirSync16(outputPath, { recursive: true });
94473
94600
  const captured = readdirSync10(framesDir).filter((name) => name.endsWith(".png")).sort();
94474
94601
  if (captured.length === 0) {
94475
94602
  throw new Error(
@@ -94477,11 +94604,11 @@ async function runEncodeStage(input) {
94477
94604
  );
94478
94605
  }
94479
94606
  captured.forEach((name, i) => {
94480
- const dst = join40(outputPath, formatExportFrameName(i, "png"));
94481
- copyFileSync5(join40(framesDir, name), dst);
94607
+ const dst = join41(outputPath, formatExportFrameName(i, "png"));
94608
+ copyFileSync5(join41(framesDir, name), dst);
94482
94609
  });
94483
- if (hasAudio && audioOutputPath && existsSync29(audioOutputPath)) {
94484
- copyFileSync5(audioOutputPath, join40(outputPath, MIXED_AUDIO_FILENAME));
94610
+ if (hasAudio && audioOutputPath && existsSync28(audioOutputPath)) {
94611
+ copyFileSync5(audioOutputPath, join41(outputPath, MIXED_AUDIO_FILENAME));
94485
94612
  log.info(
94486
94613
  `[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
94487
94614
  );
@@ -94500,7 +94627,7 @@ async function runEncodeStage(input) {
94500
94627
  const encodeResult2 = await encodeGifFromDir(framesDir, framePattern2, outputPath, {
94501
94628
  fps: job.config.fps,
94502
94629
  loop,
94503
- palettePath: join40(dirname15(videoOnlyPath), "gif-palette.png"),
94630
+ palettePath: join41(dirname16(videoOnlyPath), "gif-palette.png"),
94504
94631
  preserveAlpha: needsAlpha,
94505
94632
  signal: abortSignal,
94506
94633
  timeout: engineCfg.ffmpegEncodeTimeout
@@ -94566,8 +94693,8 @@ import { extname as extname6 } from "path";
94566
94693
  init_src();
94567
94694
  init_dist2();
94568
94695
  import { spawn as spawn5 } from "child_process";
94569
- import { mkdtempSync as mkdtempSync8, renameSync as renameSync6, rmSync as rmSync12 } from "fs";
94570
- import { dirname as dirname16, join as join41 } from "path";
94696
+ import { mkdtempSync as mkdtempSync10, renameSync as renameSync6, rmSync as rmSync13 } from "fs";
94697
+ import { dirname as dirname17, join as join42 } from "path";
94571
94698
  var AUDIO_DURATION_TOLERANCE_SECONDS = 1e-3;
94572
94699
  var AAC_DELIVERY_TRUE_PEAK_DBFS = -1;
94573
94700
  var MAX_TRUE_PEAK_CORRECTION_PASSES = 3;
@@ -94734,7 +94861,7 @@ async function padOrTrimAudioToVideoFrameCount(input) {
94734
94861
  error: `audioPadTrim: failed to materialize ${plan2.operation}: ${err instanceof Error ? err.message : String(err)}`
94735
94862
  };
94736
94863
  } finally {
94737
- for (const path of plan2.cleanupPaths) rmSync12(path, { force: true });
94864
+ for (const path of plan2.cleanupPaths) rmSync13(path, { force: true });
94738
94865
  }
94739
94866
  if (probeTruePeak) {
94740
94867
  const correction = await enforceAacTruePeak({
@@ -94767,8 +94894,8 @@ async function padOrTrimAudioToVideoFrameCount(input) {
94767
94894
  async function enforceAacTruePeak(input) {
94768
94895
  let scratchDir;
94769
94896
  try {
94770
- scratchDir = mkdtempSync8(join41(dirname16(input.audioPath), ".true-peak-"));
94771
- const correctedPath = join41(scratchDir, "audio.m4a");
94897
+ scratchDir = mkdtempSync10(join42(dirname17(input.audioPath), ".true-peak-"));
94898
+ const correctedPath = join42(scratchDir, "audio.m4a");
94772
94899
  let attenuationDb = 0;
94773
94900
  let measuredPath = input.audioPath;
94774
94901
  for (let pass = 0; pass <= MAX_TRUE_PEAK_CORRECTION_PASSES; pass += 1) {
@@ -94815,7 +94942,7 @@ async function enforceAacTruePeak(input) {
94815
94942
  )}`
94816
94943
  };
94817
94944
  } finally {
94818
- if (scratchDir) rmSync12(scratchDir, { recursive: true, force: true });
94945
+ if (scratchDir) rmSync13(scratchDir, { recursive: true, force: true });
94819
94946
  }
94820
94947
  }
94821
94948
  function failResult(outputPath, target, source, error) {
@@ -95021,7 +95148,7 @@ function sampleDirectoryBytes(dir) {
95021
95148
  continue;
95022
95149
  }
95023
95150
  for (const name of entries2) {
95024
- const full = join42(current2, name);
95151
+ const full = join43(current2, name);
95025
95152
  try {
95026
95153
  const st = statSync10(full);
95027
95154
  if (st.isDirectory()) {
@@ -95170,8 +95297,8 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
95170
95297
  const ranges = [];
95171
95298
  let rangeStart = null;
95172
95299
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
95173
- const framePath = join42(framesDir, formatCaptureFrameName(frameIndex, frameExt));
95174
- const missing = !existsSync30(framePath) || statSync10(framePath).size <= 8;
95300
+ const framePath = join43(framesDir, formatCaptureFrameName(frameIndex, frameExt));
95301
+ const missing = !existsSync29(framePath) || statSync10(framePath).size <= 8;
95175
95302
  if (missing && rangeStart === null) {
95176
95303
  rangeStart = frameIndex;
95177
95304
  } else if (!missing && rangeStart !== null) {
@@ -95193,7 +95320,7 @@ function buildMissingFrameRetryBatches(ranges, maxWorkers, workDir, attempt, ran
95193
95320
  workerId,
95194
95321
  startFrame: rangeStart + range.startFrame,
95195
95322
  endFrame: rangeStart + range.endFrame,
95196
- outputDir: join42(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`),
95323
+ outputDir: join43(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`),
95197
95324
  outputFrameOffset: rangeStart
95198
95325
  }));
95199
95326
  batches.push(batch);
@@ -95216,8 +95343,8 @@ function getNextRetryWorkerCount(currentWorkers) {
95216
95343
  return Math.max(1, Math.floor(currentWorkers / 2));
95217
95344
  }
95218
95345
  function resolveRenderWorkDirPrefix(outputPath, jobId, platform3 = process.platform, systemTempDir = tmpdir7()) {
95219
- if (platform3 === "win32") return join42(systemTempDir, "hf-render-");
95220
- return join42(dirname17(outputPath), `work-${jobId}-`);
95346
+ if (platform3 === "win32") return join43(systemTempDir, "hf-render-");
95347
+ return join43(dirname18(outputPath), `work-${jobId}-`);
95221
95348
  }
95222
95349
  var MAX_TRANSIENT_CAPTURE_RETRIES = 1;
95223
95350
  function captureAttemptMadeProgress(attemptTargetFrameCount, remainingFrameCount) {
@@ -95246,8 +95373,8 @@ The composition is too large for the available memory. To reduce memory pressure
95246
95373
  function countCapturedFrames(totalFrames, framesDir, frameExt) {
95247
95374
  let captured = 0;
95248
95375
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
95249
- const framePath = join42(framesDir, formatCaptureFrameName(frameIndex, frameExt));
95250
- if (existsSync30(framePath)) captured++;
95376
+ const framePath = join43(framesDir, formatCaptureFrameName(frameIndex, frameExt));
95377
+ if (existsSync29(framePath)) captured++;
95251
95378
  }
95252
95379
  return captured;
95253
95380
  }
@@ -95271,7 +95398,7 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
95271
95398
  reason: attempt === 0 ? "initial" : pendingTransientRetry ? "transient-retry" : "retry"
95272
95399
  });
95273
95400
  pendingTransientRetry = false;
95274
- const attemptWorkDir = join42(options.workDir, `capture-attempt-${attempt}`);
95401
+ const attemptWorkDir = join43(options.workDir, `capture-attempt-${attempt}`);
95275
95402
  const batches = missingRanges ? buildMissingFrameRetryBatches(
95276
95403
  missingRanges,
95277
95404
  currentWorkers,
@@ -95608,15 +95735,15 @@ function deVerifyFallbackTelemetry(err) {
95608
95735
  };
95609
95736
  }
95610
95737
  async function executeRenderJob(job, projectDir, outputPath, progressSink, abortSignal) {
95611
- const moduleDir = dirname17(fileURLToPath5(import.meta.url));
95738
+ const moduleDir = dirname18(fileURLToPath5(import.meta.url));
95612
95739
  const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve13(process.env.PRODUCER_RENDERS_DIR, "..") : resolve13(moduleDir, "../..");
95613
- const debugDir = join42(producerRoot, ".debug");
95614
- const outputDir = dirname17(outputPath);
95615
- if (!existsSync30(outputDir)) mkdirSync17(outputDir, { recursive: true });
95616
- const workDir = job.config.debug ? join42(debugDir, job.id) : mkdtempSync9(resolveRenderWorkDirPrefix(outputPath, job.id));
95740
+ const debugDir = join43(producerRoot, ".debug");
95741
+ const outputDir = dirname18(outputPath);
95742
+ if (!existsSync29(outputDir)) mkdirSync17(outputDir, { recursive: true });
95743
+ const workDir = job.config.debug ? join43(debugDir, job.id) : mkdtempSync11(resolveRenderWorkDirPrefix(outputPath, job.id));
95617
95744
  const pipelineStart = Date.now();
95618
95745
  const baseLog = job.config.logger ?? defaultLogger;
95619
- const logPath = job.config.debug ? join42(workDir, "render.log") : null;
95746
+ const logPath = job.config.debug ? join43(workDir, "render.log") : null;
95620
95747
  const execution = new RenderExecutionContext({
95621
95748
  request: { renderJobId: job.id, projectDir, outputPath },
95622
95749
  logger: logPath ? createRenderFileLogger(logPath, baseLog) : baseLog,
@@ -95630,7 +95757,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
95630
95757
  log.info("KEEP_TEMP=1 \u2014 leaving workDir on disk for inspection", { workDir });
95631
95758
  return;
95632
95759
  }
95633
- rmSync13(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
95760
+ rmSync14(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
95634
95761
  });
95635
95762
  try {
95636
95763
  await executeRenderPipeline({
@@ -95664,7 +95791,7 @@ async function executeRenderPipeline(input) {
95664
95791
  imageDecodeFailures: 0
95665
95792
  };
95666
95793
  let hdrPerf;
95667
- const perfOutputPath = join42(workDir, "perf-summary.json");
95794
+ const perfOutputPath = join43(workDir, "perf-summary.json");
95668
95795
  const cfg = { ...job.config.producerConfig ?? resolveConfig() };
95669
95796
  const observability = new RenderObservabilityRecorder({
95670
95797
  pipelineStartMs: pipelineStart,
@@ -95727,7 +95854,7 @@ async function executeRenderPipeline(input) {
95727
95854
  job.startedAt = /* @__PURE__ */ new Date();
95728
95855
  assertNotAborted();
95729
95856
  assertConfiguredFfmpegBinariesExist();
95730
- if (!existsSync30(workDir)) mkdirSync17(workDir, { recursive: true });
95857
+ if (!existsSync29(workDir)) mkdirSync17(workDir, { recursive: true });
95731
95858
  if (job.config.debug) {
95732
95859
  log.info("[Render] Debug artifacts enabled", { workDir, logPath });
95733
95860
  }
@@ -95756,16 +95883,16 @@ async function executeRenderPipeline(input) {
95756
95883
  requestedWorkers: job.config.workers ?? "auto"
95757
95884
  });
95758
95885
  const entryFile = job.config.entryFile || "index.html";
95759
- let htmlPath = join42(projectDir, entryFile);
95760
- if (!existsSync30(htmlPath)) {
95886
+ let htmlPath = join43(projectDir, entryFile);
95887
+ if (!existsSync29(htmlPath)) {
95761
95888
  throw new Error(`Entry file not found: ${htmlPath}`);
95762
95889
  }
95763
95890
  assertNotAborted();
95764
95891
  const rawEntry = readFileSync12(htmlPath, "utf-8");
95765
95892
  if (entryFile !== "index.html" && rawEntry.trimStart().startsWith("<template")) {
95766
- const wrapperPath = join42(workDir, "standalone-entry.html");
95767
- const projectIndexPath = join42(projectDir, "index.html");
95768
- if (!existsSync30(projectIndexPath)) {
95893
+ const wrapperPath = join43(workDir, "standalone-entry.html");
95894
+ const projectIndexPath = join43(projectDir, "index.html");
95895
+ if (!existsSync29(projectIndexPath)) {
95769
95896
  throw new Error(
95770
95897
  `Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
95771
95898
  );
@@ -95919,7 +96046,7 @@ async function executeRenderPipeline(input) {
95919
96046
  beginFrameStalled: probeResult.beginFrameStalled
95920
96047
  });
95921
96048
  updateJobStatus(job, "preprocessing", "Extracting video frames", 10, onProgress);
95922
- const compiledDir = join42(workDir, "compiled");
96049
+ const compiledDir = join43(workDir, "compiled");
95923
96050
  const extractResult = await observeRenderStage(
95924
96051
  observability,
95925
96052
  "video_extract",
@@ -96039,7 +96166,7 @@ async function executeRenderPipeline(input) {
96039
96166
  try {
96040
96167
  fileServer = await createFileServer2({
96041
96168
  projectDir,
96042
- compiledDir: join42(workDir, "compiled"),
96169
+ compiledDir: join43(workDir, "compiled"),
96043
96170
  port: 0,
96044
96171
  preHeadScripts: [VIRTUAL_TIME_SHIM],
96045
96172
  fps: job.config.fps
@@ -96057,8 +96184,8 @@ async function executeRenderPipeline(input) {
96057
96184
  if (!activeFileServer) {
96058
96185
  throw new Error("File server failed to initialize before frame capture");
96059
96186
  }
96060
- const framesDir = join42(workDir, "captured-frames");
96061
- if (!existsSync30(framesDir)) mkdirSync17(framesDir, { recursive: true });
96187
+ const framesDir = join43(workDir, "captured-frames");
96188
+ if (!existsSync29(framesDir)) mkdirSync17(framesDir, { recursive: true });
96062
96189
  const resolvedBrowserGpuMode = await resolveBrowserGpuMode(cfg.browserGpuMode, {
96063
96190
  chromePath: resolveHeadlessShellPath(cfg),
96064
96191
  browserTimeout: cfg.browserTimeout
@@ -96382,7 +96509,7 @@ async function executeRenderPipeline(input) {
96382
96509
  gif: ".gif"
96383
96510
  };
96384
96511
  const videoExt = FORMAT_EXT[outputFormat] ?? ".mp4";
96385
- const videoOnlyPath = join42(workDir, `video-only${videoExt}`);
96512
+ const videoOnlyPath = join43(workDir, `video-only${videoExt}`);
96386
96513
  const usePageSideCompositingForTransitions = (cfg.enablePageSideCompositing || isGif) && compiled.hasShaderTransitions && !hasHdrContent && outputSupportsPageSideShaderCompositing(outputFormat);
96387
96514
  if (usePageSideCompositingForTransitions) {
96388
96515
  activeFileServer.addPreHeadScript(HF_PAGE_SIDE_COMPOSITING_STUB);
@@ -96790,7 +96917,7 @@ async function executeRenderPipeline(input) {
96790
96917
  "capture_disk",
96791
96918
  "drawElement self-verify failed; retrying with forceScreenshot"
96792
96919
  );
96793
- rmSync13(framesDir, { recursive: true, force: true });
96920
+ rmSync14(framesDir, { recursive: true, force: true });
96794
96921
  mkdirSync17(framesDir, { recursive: true });
96795
96922
  resetCaptureAttemptProgress(job);
96796
96923
  dedupPerfs.length = 0;
@@ -96909,7 +97036,7 @@ async function executeRenderPipeline(input) {
96909
97036
  } : void 0
96910
97037
  );
96911
97038
  const totalElapsed = Date.now() - pipelineStart;
96912
- const tmpPeakBytes = existsSync30(workDir) ? sampleDirectoryBytes(workDir) : 0;
97039
+ const tmpPeakBytes = existsSync29(workDir) ? sampleDirectoryBytes(workDir) : 0;
96913
97040
  recordTransientRetryObservability();
96914
97041
  observability.checkpoint("pipeline", "artifact validated", { totalElapsedMs: totalElapsed });
96915
97042
  const observabilitySummary = observability.summary({
@@ -96974,8 +97101,8 @@ async function executeRenderPipeline(input) {
96974
97101
  }
96975
97102
  }
96976
97103
  if (job.config.debug) {
96977
- if (!isPngSequence && existsSync30(stagedOutputPath)) {
96978
- const debugOutput = join42(workDir, `output${videoExt}`);
97104
+ if (!isPngSequence && existsSync29(stagedOutputPath)) {
97105
+ const debugOutput = join43(workDir, `output${videoExt}`);
96979
97106
  copyFileSync6(stagedOutputPath, debugOutput);
96980
97107
  }
96981
97108
  }
@@ -97310,15 +97437,15 @@ init_src();
97310
97437
 
97311
97438
  // ../producer/src/server.ts
97312
97439
  import {
97313
- existsSync as existsSync33,
97440
+ existsSync as existsSync32,
97314
97441
  mkdirSync as mkdirSync18,
97315
97442
  statSync as statSync12,
97316
- mkdtempSync as mkdtempSync10,
97443
+ mkdtempSync as mkdtempSync12,
97317
97444
  writeFileSync as writeFileSync11,
97318
- rmSync as rmSync14,
97445
+ rmSync as rmSync15,
97319
97446
  createReadStream as createReadStream5
97320
97447
  } from "fs";
97321
- import { resolve as resolve15, dirname as dirname19, join as join45 } from "path";
97448
+ import { resolve as resolve15, dirname as dirname20, join as join46 } from "path";
97322
97449
  import { tmpdir as tmpdir8 } from "os";
97323
97450
  import { parseArgs } from "util";
97324
97451
  import crypto from "crypto";
@@ -97328,8 +97455,8 @@ import { serve as serve3 } from "@hono/node-server";
97328
97455
 
97329
97456
  // ../producer/src/services/hyperframeLint.ts
97330
97457
  init_dist3();
97331
- import { existsSync as existsSync31, readFileSync as readFileSync13, statSync as statSync11 } from "fs";
97332
- import { resolve as resolve14, join as join43 } from "path";
97458
+ import { existsSync as existsSync30, readFileSync as readFileSync13, statSync as statSync11 } from "fs";
97459
+ import { resolve as resolve14, join as join44 } from "path";
97333
97460
  function isStringRecord(value) {
97334
97461
  if (!value || typeof value !== "object" || Array.isArray(value)) {
97335
97462
  return false;
@@ -97357,7 +97484,7 @@ function pickEntryFile(files, preferredEntryFile) {
97357
97484
  }
97358
97485
  function readProjectEntryFile(projectDir, preferredEntryFile) {
97359
97486
  const absProjectDir = resolve14(projectDir);
97360
- if (!existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
97487
+ if (!existsSync30(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
97361
97488
  return { error: `Project directory not found: ${absProjectDir}` };
97362
97489
  }
97363
97490
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -97368,7 +97495,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
97368
97495
  if (!absoluteEntryPath.startsWith(absProjectDir)) {
97369
97496
  return { error: `Entry file must stay inside project directory: ${entryFile}` };
97370
97497
  }
97371
- if (existsSync31(absoluteEntryPath) && statSync11(absoluteEntryPath).isFile()) {
97498
+ if (existsSync30(absoluteEntryPath) && statSync11(absoluteEntryPath).isFile()) {
97372
97499
  return {
97373
97500
  entryFile,
97374
97501
  html: readFileSync13(absoluteEntryPath, "utf-8"),
@@ -97377,7 +97504,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
97377
97504
  }
97378
97505
  }
97379
97506
  return {
97380
- error: `No HTML entry file found in project directory: ${join43(absProjectDir, preferredEntryFile || "index.html")}`
97507
+ error: `No HTML entry file found in project directory: ${join44(absProjectDir, preferredEntryFile || "index.html")}`
97381
97508
  };
97382
97509
  }
97383
97510
  function prepareHyperframeLintBody(body) {
@@ -97420,8 +97547,8 @@ async function runHyperframeLint(prepared) {
97420
97547
  // ../producer/src/services/healthWorker.ts
97421
97548
  import { Worker as Worker3 } from "worker_threads";
97422
97549
  import { fileURLToPath as fileURLToPath6 } from "url";
97423
- import { dirname as dirname18, join as join44 } from "path";
97424
- import { existsSync as existsSync32 } from "fs";
97550
+ import { dirname as dirname19, join as join45 } from "path";
97551
+ import { existsSync as existsSync31 } from "fs";
97425
97552
  var DEFAULT_HEALTH_PORT = 9848;
97426
97553
  async function startHealthWorker(options = {}) {
97427
97554
  const log = options.logger ?? defaultLogger2();
@@ -97495,10 +97622,10 @@ function defaultLogger2() {
97495
97622
  };
97496
97623
  }
97497
97624
  function resolveWorkerEntry2() {
97498
- const here = dirname18(fileURLToPath6(import.meta.url));
97499
- const candidates = [join44(here, "healthWorkerThread.js"), join44(here, "healthWorkerThread.ts")];
97625
+ const here = dirname19(fileURLToPath6(import.meta.url));
97626
+ const candidates = [join45(here, "healthWorkerThread.js"), join45(here, "healthWorkerThread.ts")];
97500
97627
  for (const candidate of candidates) {
97501
- if (existsSync32(candidate)) return candidate;
97628
+ if (existsSync31(candidate)) return candidate;
97502
97629
  }
97503
97630
  return void 0;
97504
97631
  }
@@ -97633,8 +97760,8 @@ function buildRenderJobConfig(input, outputPath, log) {
97633
97760
  function resolvePreparedRenderOutput(prepared, rendersDir, log) {
97634
97761
  const { input, cleanupProjectDir } = prepared;
97635
97762
  const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
97636
- const outputDir = dirname19(absoluteOutputPath);
97637
- if (!existsSync33(outputDir)) mkdirSync18(outputDir, { recursive: true });
97763
+ const outputDir = dirname20(absoluteOutputPath);
97764
+ if (!existsSync32(outputDir)) mkdirSync18(outputDir, { recursive: true });
97638
97765
  return { input, cleanupProjectDir, absoluteOutputPath };
97639
97766
  }
97640
97767
  function validateRenderOverrides(body) {
@@ -97672,11 +97799,11 @@ function prepareProjectDirectory(projectDir, options) {
97672
97799
  const candidate = nonEmptyString2(projectDir);
97673
97800
  if (!candidate) return null;
97674
97801
  const absProjectDir = resolve15(candidate);
97675
- if (!existsSync33(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
97802
+ if (!existsSync32(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
97676
97803
  return { error: `Project directory not found: ${absProjectDir}` };
97677
97804
  }
97678
97805
  const entry = options.entryFile || "index.html";
97679
- if (!existsSync33(resolve15(absProjectDir, entry))) {
97806
+ if (!existsSync32(resolve15(absProjectDir, entry))) {
97680
97807
  return { error: `Entry file "${entry}" not found in project directory: ${absProjectDir}` };
97681
97808
  }
97682
97809
  return { prepared: { input: { projectDir: absProjectDir, ...options } } };
@@ -97701,8 +97828,8 @@ async function resolveInlineRenderHtml(body) {
97701
97828
  }
97702
97829
  function materializeInlineProject(html, options) {
97703
97830
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir8();
97704
- const tempProjectDir = mkdtempSync10(join45(tempRoot, "producer-project-"));
97705
- writeFileSync11(join45(tempProjectDir, "index.html"), html, "utf-8");
97831
+ const tempProjectDir = mkdtempSync12(join46(tempRoot, "producer-project-"));
97832
+ writeFileSync11(join46(tempProjectDir, "index.html"), html, "utf-8");
97706
97833
  return {
97707
97834
  prepared: {
97708
97835
  input: { projectDir: tempProjectDir, ...options },
@@ -97759,7 +97886,7 @@ function createArtifactStore(ttlMs) {
97759
97886
  function cleanupTempDir(dir, log) {
97760
97887
  if (!dir) return;
97761
97888
  try {
97762
- rmSync14(dir, { recursive: true, force: true });
97889
+ rmSync15(dir, { recursive: true, force: true });
97763
97890
  } catch (error) {
97764
97891
  log.warn("Failed to cleanup temp project dir", {
97765
97892
  cleanupProjectDir: dir,
@@ -97768,7 +97895,7 @@ function cleanupTempDir(dir, log) {
97768
97895
  }
97769
97896
  }
97770
97897
  function outputFileSize(path) {
97771
- return existsSync33(path) ? statSync12(path).size : 0;
97898
+ return existsSync32(path) ? statSync12(path).size : 0;
97772
97899
  }
97773
97900
  function createBlockingProgressReporter(log, requestId) {
97774
97901
  let lastLoggedPct = -10;
@@ -98064,7 +98191,7 @@ function createRenderHandlers(options = {}) {
98064
98191
  if (!artifact) {
98065
98192
  return c.json({ success: false, error: "Output artifact not found or expired" }, 404);
98066
98193
  }
98067
- if (!existsSync33(artifact.path)) {
98194
+ if (!existsSync32(artifact.path)) {
98068
98195
  store.delete(token);
98069
98196
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
98070
98197
  }
@@ -98152,12 +98279,12 @@ init_src();
98152
98279
  // ../producer/src/services/distributed/plan.ts
98153
98280
  init_dist2();
98154
98281
  init_src();
98155
- import { cpSync as cpSync2, existsSync as existsSync36, mkdirSync as mkdirSync20, renameSync as renameSync7, rmSync as rmSync15, writeFileSync as writeFileSync13 } from "fs";
98156
- import { join as join49, relative as relative5, sep as sep4 } from "path";
98282
+ import { cpSync as cpSync2, existsSync as existsSync35, mkdirSync as mkdirSync20, renameSync as renameSync7, rmSync as rmSync16, writeFileSync as writeFileSync13 } from "fs";
98283
+ import { join as join50, relative as relative5, sep as sep4 } from "path";
98157
98284
 
98158
98285
  // ../producer/src/services/render/stages/freezePlan.ts
98159
- import { existsSync as existsSync34, mkdirSync as mkdirSync19, readFileSync as readFileSync14, readdirSync as readdirSync12, writeFileSync as writeFileSync12 } from "fs";
98160
- import { join as join46, relative as relative3, resolve as resolve16 } from "path";
98286
+ import { existsSync as existsSync33, mkdirSync as mkdirSync19, readFileSync as readFileSync14, readdirSync as readdirSync12, writeFileSync as writeFileSync12 } from "fs";
98287
+ import { join as join47, relative as relative3, resolve as resolve16 } from "path";
98161
98288
 
98162
98289
  // ../producer/src/services/distributed/planProtocol.ts
98163
98290
  var PLAN_SCHEMA_VERSION = 1;
@@ -98199,17 +98326,17 @@ var FIELD_DELIMITER = Buffer.from([0]);
98199
98326
  // ../producer/src/services/distributed/shared.ts
98200
98327
  init_src();
98201
98328
  import { execFile as execFileCallback } from "child_process";
98202
- import { dirname as dirname20, join as join47 } from "path";
98203
- import { existsSync as existsSync35, readFileSync as readFileSync15 } from "fs";
98329
+ import { dirname as dirname21, join as join48 } from "path";
98330
+ import { existsSync as existsSync34, readFileSync as readFileSync15 } from "fs";
98204
98331
  import { fileURLToPath as fileURLToPath7 } from "url";
98205
- import { promisify as promisify3 } from "util";
98332
+ import { promisify as promisify4 } from "util";
98206
98333
  var PLAN_AUDIO_RELATIVE_PATH = MIXED_AUDIO_FILENAME;
98207
- var execFile3 = promisify3(execFileCallback);
98334
+ var execFile3 = promisify4(execFileCallback);
98208
98335
 
98209
98336
  // ../producer/src/services/distributed/planSize.ts
98210
98337
  import { createHash as createHash10 } from "crypto";
98211
98338
  import { lstatSync as lstatSync5, readdirSync as readdirSync13 } from "fs";
98212
- import { extname as extname7, join as join48, relative as relative4 } from "path";
98339
+ import { extname as extname7, join as join49, relative as relative4 } from "path";
98213
98340
  var PLAN_ROOT_CATEGORY = {
98214
98341
  compiled: "compiled",
98215
98342
  [PLAN_AUDIO_RELATIVE_PATH]: "audio",
@@ -98221,81 +98348,81 @@ var PLAN_ROOT_CATEGORY = {
98221
98348
  var PLAN_DIR_SIZE_LIMIT_BYTES = 2 * 1024 * 1024 * 1024;
98222
98349
  var FREEZE_OWNED_PLAN_FILES = [
98223
98350
  "plan.json",
98224
- join49("meta", "composition.json"),
98225
- join49("meta", "encoder.json"),
98226
- join49("meta", "chunks.json")
98351
+ join50("meta", "composition.json"),
98352
+ join50("meta", "encoder.json"),
98353
+ join50("meta", "chunks.json")
98227
98354
  ];
98228
98355
 
98229
98356
  // ../producer/src/services/distributed/planV2.ts
98230
98357
  init_src();
98231
98358
  import {
98232
- closeSync as closeSync6,
98359
+ closeSync as closeSync8,
98233
98360
  copyFileSync as copyFileSync8,
98234
- existsSync as existsSync38,
98361
+ existsSync as existsSync37,
98235
98362
  lstatSync as lstatSync6,
98236
98363
  mkdirSync as mkdirSync22,
98237
- mkdtempSync as mkdtempSync12,
98238
- openSync as openSync5,
98364
+ mkdtempSync as mkdtempSync14,
98365
+ openSync as openSync7,
98239
98366
  readFileSync as readFileSync16,
98240
98367
  readSync as readSync3,
98241
98368
  readdirSync as readdirSync14,
98242
98369
  renameSync as renameSync9,
98243
- rmSync as rmSync17,
98370
+ rmSync as rmSync18,
98244
98371
  statSync as statSync14,
98245
98372
  writeFileSync as writeFileSync15
98246
98373
  } from "fs";
98247
98374
  import { createHash as createHash11 } from "crypto";
98248
98375
  import { tmpdir as tmpdir9 } from "os";
98249
- import { dirname as dirname22, isAbsolute as isAbsolute4, join as join52, relative as relative6, resolve as resolve17, sep as sep5 } from "path";
98376
+ import { dirname as dirname23, isAbsolute as isAbsolute4, join as join53, relative as relative6, resolve as resolve17, sep as sep5 } from "path";
98250
98377
 
98251
98378
  // ../producer/src/services/distributed/planV2Publisher.ts
98252
98379
  import {
98253
98380
  copyFileSync as copyFileSync7,
98254
- existsSync as existsSync37,
98381
+ existsSync as existsSync36,
98255
98382
  linkSync as linkSync3,
98256
98383
  mkdirSync as mkdirSync21,
98257
- mkdtempSync as mkdtempSync11,
98384
+ mkdtempSync as mkdtempSync13,
98258
98385
  renameSync as renameSync8,
98259
- rmSync as rmSync16,
98386
+ rmSync as rmSync17,
98260
98387
  statSync as statSync13,
98261
98388
  writeFileSync as writeFileSync14
98262
98389
  } from "fs";
98263
- import { dirname as dirname21, join as join51 } from "path";
98390
+ import { dirname as dirname22, join as join52 } from "path";
98264
98391
 
98265
98392
  // ../producer/src/services/distributed/planV2Layout.ts
98266
- import { join as join50 } from "path";
98393
+ import { join as join51 } from "path";
98267
98394
 
98268
98395
  // ../producer/src/services/distributed/planV2Execution.ts
98269
- import { mkdtempSync as mkdtempSync13, rmSync as rmSync20 } from "fs";
98396
+ import { mkdtempSync as mkdtempSync15, rmSync as rmSync21 } from "fs";
98270
98397
  import { tmpdir as tmpdir10 } from "os";
98271
- import { join as join55 } from "path";
98398
+ import { join as join56 } from "path";
98272
98399
 
98273
98400
  // ../producer/src/services/distributed/assemble.ts
98274
98401
  init_src();
98275
98402
  init_dist2();
98276
98403
  import {
98277
98404
  cpSync as cpSync3,
98278
- existsSync as existsSync39,
98405
+ existsSync as existsSync38,
98279
98406
  mkdirSync as mkdirSync23,
98280
98407
  readFileSync as readFileSync17,
98281
98408
  readdirSync as readdirSync15,
98282
- rmSync as rmSync18,
98409
+ rmSync as rmSync19,
98283
98410
  statSync as statSync15,
98284
98411
  writeFileSync as writeFileSync16
98285
98412
  } from "fs";
98286
- import { dirname as dirname23, join as join53 } from "path";
98413
+ import { dirname as dirname24, join as join54 } from "path";
98287
98414
 
98288
98415
  // ../producer/src/services/distributed/renderChunk.ts
98289
98416
  init_src();
98290
- import { randomBytes as randomBytes2 } from "crypto";
98291
- import { existsSync as existsSync40, mkdirSync as mkdirSync24, readFileSync as readFileSync18, readdirSync as readdirSync16, rmSync as rmSync19, writeFileSync as writeFileSync17 } from "fs";
98292
- import { extname as extname8, join as join54 } from "path";
98417
+ import { randomBytes } from "crypto";
98418
+ import { existsSync as existsSync39, mkdirSync as mkdirSync24, readFileSync as readFileSync18, readdirSync as readdirSync16, rmSync as rmSync20, writeFileSync as writeFileSync17 } from "fs";
98419
+ import { extname as extname8, join as join55 } from "path";
98293
98420
  init_src();
98294
98421
 
98295
98422
  // ../producer/src/services/distributed/projectHash.ts
98296
98423
  import { readdirSync as readdirSync17, readFileSync as readFileSync19 } from "fs";
98297
98424
  import { createHash as createHash12 } from "crypto";
98298
- import { join as join56, relative as relative7 } from "path";
98425
+ import { join as join57, relative as relative7 } from "path";
98299
98426
 
98300
98427
  // src/fontLocalize.ts
98301
98428
  function safeVersion(version2) {
@@ -98336,8 +98463,8 @@ async function runFontLocalize(io, localize) {
98336
98463
  }
98337
98464
 
98338
98465
  // src/version.ts
98339
- var VERSION = true ? "0.8.28" : "0.0.0-dev";
98340
- var PRODUCER_VERSION = true ? "0.8.28" : "0.0.0-dev";
98466
+ var VERSION = true ? "0.8.30" : "0.0.0-dev";
98467
+ var PRODUCER_VERSION = true ? "0.8.30" : "0.0.0-dev";
98341
98468
 
98342
98469
  // src/fontLocalizeCli.ts
98343
98470
  async function readStdin() {