hyperframes 0.8.66 → 0.8.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.8.66" : "0.0.0-dev";
53
+ VERSION = true ? "0.8.67" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -369,10 +369,10 @@ function findSubCommandIndex(rawArgs, argsDef) {
369
369
  }
370
370
  function _isValueFlag(flag, argsDef) {
371
371
  const name = flag.replace(/^-{1,2}/, "");
372
- const normalized2 = camelCase(name);
372
+ const normalized3 = camelCase(name);
373
373
  for (const [key2, def] of Object.entries(argsDef)) {
374
374
  if (def.type !== "string" && def.type !== "enum") continue;
375
- if (normalized2 === camelCase(key2)) return true;
375
+ if (normalized3 === camelCase(key2)) return true;
376
376
  if ((Array.isArray(def.alias) ? def.alias : def.alias ? [def.alias] : []).includes(name)) return true;
377
377
  }
378
378
  return false;
@@ -628,10 +628,10 @@ function resolveSlideshow(manifest, scenes) {
628
628
  return { resolved: { slides, sequences }, errors };
629
629
  }
630
630
  function isSceneLikeCompositionId(compositionId) {
631
- const normalized2 = compositionId.trim().toLowerCase();
632
- if (!normalized2 || normalized2 === "main") return false;
633
- if (normalized2.includes("caption")) return false;
634
- if (normalized2.includes("ambient")) return false;
631
+ const normalized3 = compositionId.trim().toLowerCase();
632
+ if (!normalized3 || normalized3 === "main") return false;
633
+ if (normalized3.includes("caption")) return false;
634
+ if (normalized3.includes("ambient")) return false;
635
635
  return true;
636
636
  }
637
637
  var SLIDESHOW_MANIFEST_VERSION, SLIDESHOW_ISLAND_TYPE;
@@ -4923,7 +4923,7 @@ var require_util = __commonJS({
4923
4923
  exports.isAbsolute = function(aPath) {
4924
4924
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
4925
4925
  };
4926
- function relative38(aRoot, aPath) {
4926
+ function relative39(aRoot, aPath) {
4927
4927
  if (aRoot === "") {
4928
4928
  aRoot = ".";
4929
4929
  }
@@ -4942,7 +4942,7 @@ var require_util = __commonJS({
4942
4942
  }
4943
4943
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
4944
4944
  }
4945
- exports.relative = relative38;
4945
+ exports.relative = relative39;
4946
4946
  var supportsNullProto = (function() {
4947
4947
  var obj = /* @__PURE__ */ Object.create(null);
4948
4948
  return !("__proto__" in obj);
@@ -15818,9 +15818,9 @@ var require_printer = __commonJS({
15818
15818
  }
15819
15819
  case "ForStatement": {
15820
15820
  var init = path.call(print2, "init");
15821
- var sep18 = init.length > 1 ? ";\n" : "; ";
15821
+ var sep19 = init.length > 1 ? ";\n" : "; ";
15822
15822
  var forParen = "for (";
15823
- var indented = (0, lines_1.fromString)(sep18).join([init, path.call(print2, "test"), path.call(print2, "update")]).indentTail(forParen.length);
15823
+ var indented = (0, lines_1.fromString)(sep19).join([init, path.call(print2, "test"), path.call(print2, "update")]).indentTail(forParen.length);
15824
15824
  var head = (0, lines_1.concat)([forParen, indented, ")"]);
15825
15825
  var clause = adjustClause(path.call(print2, "body"), options);
15826
15826
  parts.push(head);
@@ -41407,10 +41407,10 @@ function compareDocumentPosition(nodeA, nodeB) {
41407
41407
  function uniqueSort(nodes) {
41408
41408
  nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
41409
41409
  nodes.sort((a, b2) => {
41410
- const relative38 = compareDocumentPosition(a, b2);
41411
- if (relative38 & DocumentPosition.PRECEDING) {
41410
+ const relative39 = compareDocumentPosition(a, b2);
41411
+ if (relative39 & DocumentPosition.PRECEDING) {
41412
41412
  return -1;
41413
- } else if (relative38 & DocumentPosition.FOLLOWING) {
41413
+ } else if (relative39 & DocumentPosition.FOLLOWING) {
41414
41414
  return 1;
41415
41415
  }
41416
41416
  return 0;
@@ -47625,12 +47625,12 @@ var require_CSSValueExpression = __commonJS({
47625
47625
  return false;
47626
47626
  }
47627
47627
  };
47628
- CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep18) {
47629
- var endIdx = this._findMatchedIdx(token, idx, sep18), text2;
47628
+ CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep19) {
47629
+ var endIdx = this._findMatchedIdx(token, idx, sep19), text2;
47630
47630
  if (endIdx === -1) {
47631
47631
  return false;
47632
47632
  } else {
47633
- text2 = token.substring(idx, endIdx + sep18.length);
47633
+ text2 = token.substring(idx, endIdx + sep19.length);
47634
47634
  return {
47635
47635
  idx: endIdx,
47636
47636
  text: text2
@@ -47670,15 +47670,15 @@ var require_CSSValueExpression = __commonJS({
47670
47670
  if (!isLegal) {
47671
47671
  return false;
47672
47672
  } else {
47673
- var sep18 = "/";
47674
- return this._parseJSString(token, idx, sep18);
47673
+ var sep19 = "/";
47674
+ return this._parseJSString(token, idx, sep19);
47675
47675
  }
47676
47676
  };
47677
- CSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep18) {
47677
+ CSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep19) {
47678
47678
  var startIdx = idx, endIdx;
47679
47679
  var NOT_FOUND = -1;
47680
47680
  while (true) {
47681
- endIdx = token.indexOf(sep18, startIdx + 1);
47681
+ endIdx = token.indexOf(sep19, startIdx + 1);
47682
47682
  if (endIdx === -1) {
47683
47683
  endIdx = NOT_FOUND;
47684
47684
  break;
@@ -50620,8 +50620,8 @@ var init_esm10 = __esm({
50620
50620
  });
50621
50621
 
50622
50622
  // ../../node_modules/.bun/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
50623
- function encodeInteger(builder, num3, relative38) {
50624
- let delta = num3 - relative38;
50623
+ function encodeInteger(builder, num3, relative39) {
50624
+ let delta = num3 - relative39;
50625
50625
  delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
50626
50626
  do {
50627
50627
  let clamped = delta & 31;
@@ -53850,14 +53850,14 @@ function parseReferenceOffset(value) {
53850
53850
  return { refId, operator, magnitude };
53851
53851
  }
53852
53852
  function parseStartExpression(raw) {
53853
- const normalized2 = (raw ?? "").trim();
53854
- if (!normalized2) return null;
53855
- const absolute = parseNumeric(normalized2);
53853
+ const normalized3 = (raw ?? "").trim();
53854
+ if (!normalized3) return null;
53855
+ const absolute = parseNumeric(normalized3);
53856
53856
  if (absolute != null) return { kind: "absolute", value: absolute };
53857
- if (REFERENCE_ID_PATTERN.test(normalized2)) {
53858
- return { kind: "reference", refId: normalized2, offset: 0 };
53857
+ if (REFERENCE_ID_PATTERN.test(normalized3)) {
53858
+ return { kind: "reference", refId: normalized3, offset: 0 };
53859
53859
  }
53860
- const reference = parseReferenceOffset(normalized2);
53860
+ const reference = parseReferenceOffset(normalized3);
53861
53861
  if (!reference) return null;
53862
53862
  return {
53863
53863
  kind: "reference",
@@ -55840,14 +55840,14 @@ function parseReferenceOffset2(value) {
55840
55840
  return { refId, operator, magnitude };
55841
55841
  }
55842
55842
  function parseStartExpression2(raw) {
55843
- const normalized2 = (raw ?? "").trim();
55844
- if (!normalized2) return null;
55845
- const absolute = parseNumeric2(normalized2);
55843
+ const normalized3 = (raw ?? "").trim();
55844
+ if (!normalized3) return null;
55845
+ const absolute = parseNumeric2(normalized3);
55846
55846
  if (absolute != null) return { kind: "absolute", value: absolute };
55847
- if (REFERENCE_ID_PATTERN2.test(normalized2)) {
55848
- return { kind: "reference", refId: normalized2, offset: 0 };
55847
+ if (REFERENCE_ID_PATTERN2.test(normalized3)) {
55848
+ return { kind: "reference", refId: normalized3, offset: 0 };
55849
55849
  }
55850
- const reference = parseReferenceOffset2(normalized2);
55850
+ const reference = parseReferenceOffset2(normalized3);
55851
55851
  if (!reference) return null;
55852
55852
  return {
55853
55853
  kind: "reference",
@@ -56108,8 +56108,8 @@ function cssString(value) {
56108
56108
  return value.replace(/[\\'\r\n\f]/g, (char) => `\\${char.codePointAt(0)?.toString(16)} `);
56109
56109
  }
56110
56110
  function sourceAttribute(src, composition = false) {
56111
- const normalized2 = Array.from(src).filter((char) => char.charCodeAt(0) > 32).join("");
56112
- if (!isSafeAttributeValue("src", normalized2) || composition && /^data:/i.test(normalized2)) {
56111
+ const normalized3 = Array.from(src).filter((char) => char.charCodeAt(0) > 32).join("");
56112
+ if (!isSafeAttributeValue("src", normalized3) || composition && /^data:/i.test(normalized3)) {
56113
56113
  throw new Error("Unsafe media or composition source URL");
56114
56114
  }
56115
56115
  return escapeHtmlAttributeValue(src);
@@ -58443,8 +58443,8 @@ function rewriteAssetPath(compSrcPath, relativePath, assetExists) {
58443
58443
  return assetExists(sibling2) ? sibling2 + suffix : relativePath;
58444
58444
  }
58445
58445
  const resolved2 = join(compDir, relativePath);
58446
- const normalized2 = resolve2("/", resolved2).slice(1);
58447
- return normalized2;
58446
+ const normalized3 = resolve2("/", resolved2).slice(1);
58447
+ return normalized3;
58448
58448
  }
58449
58449
  function rewriteAssetPaths(elements, compSrcPath, getAttr2, setAttr2, assetExists) {
58450
58450
  for (const el of elements) {
@@ -60068,10 +60068,10 @@ function hasHfColorGradingSecondaryValues(secondaries) {
60068
60068
  return secondaries.some((secondary) => secondary.enabled && Object.values(secondary.correction).some((value) => Math.abs(value) > 1e-4));
60069
60069
  }
60070
60070
  function serializeHfColorGrading(grading) {
60071
- const normalized2 = normalizeHfColorGrading(grading);
60072
- if (!normalized2)
60071
+ const normalized3 = normalizeHfColorGrading(grading);
60072
+ if (!normalized3)
60073
60073
  return "";
60074
- const { enabled: _enabled, wheels, curves, hueCurves, secondaries, palette, ...serializable } = normalized2;
60074
+ const { enabled: _enabled, wheels, curves, hueCurves, secondaries, palette, ...serializable } = normalized3;
60075
60075
  return JSON.stringify({
60076
60076
  ...serializable,
60077
60077
  ...hasWheelGrade(wheels) ? { wheels } : {},
@@ -62158,8 +62158,8 @@ function computeBidiLevels(str) {
62158
62158
  }
62159
62159
  return levels;
62160
62160
  }
62161
- function computeSegmentLevels(normalized2, segStarts) {
62162
- const bidiLevels = computeBidiLevels(normalized2);
62161
+ function computeSegmentLevels(normalized3, segStarts) {
62162
+ const bidiLevels = computeBidiLevels(normalized3);
62163
62163
  if (bidiLevels === null)
62164
62164
  return null;
62165
62165
  const segLevels = new Int8Array(segStarts.length);
@@ -62183,14 +62183,14 @@ function getWhiteSpaceProfile(whiteSpace) {
62183
62183
  function normalizeWhitespaceNormal(text2) {
62184
62184
  if (!needsWhitespaceNormalizationRe.test(text2))
62185
62185
  return text2;
62186
- let normalized2 = text2.replace(collapsibleWhitespaceRunRe, " ");
62187
- if (normalized2.charCodeAt(0) === 32) {
62188
- normalized2 = normalized2.slice(1);
62186
+ let normalized3 = text2.replace(collapsibleWhitespaceRunRe, " ");
62187
+ if (normalized3.charCodeAt(0) === 32) {
62188
+ normalized3 = normalized3.slice(1);
62189
62189
  }
62190
- if (normalized2.length > 0 && normalized2.charCodeAt(normalized2.length - 1) === 32) {
62191
- normalized2 = normalized2.slice(0, -1);
62190
+ if (normalized3.length > 0 && normalized3.charCodeAt(normalized3.length - 1) === 32) {
62191
+ normalized3 = normalized3.slice(0, -1);
62192
62192
  }
62193
- return normalized2;
62193
+ return normalized3;
62194
62194
  }
62195
62195
  function normalizeWhitespacePreWrap(text2) {
62196
62196
  if (!/[\r\f]/.test(text2))
@@ -62772,7 +62772,7 @@ function carryTrailingForwardStickyAcrossCJKBoundary(segmentation) {
62772
62772
  starts
62773
62773
  };
62774
62774
  }
62775
- function buildMergedSegmentation(normalized2, profile, whiteSpaceProfile) {
62775
+ function buildMergedSegmentation(normalized3, profile, whiteSpaceProfile) {
62776
62776
  const wordSegmenter = getSharedWordSegmenter();
62777
62777
  let mergedLen = 0;
62778
62778
  const mergedTexts = [];
@@ -62787,7 +62787,7 @@ function buildMergedSegmentation(normalized2, profile, whiteSpaceProfile) {
62787
62787
  const mergedEndsWithClosingQuote = [];
62788
62788
  const mergedEndsWithMyanmarMedialGlue = [];
62789
62789
  const mergedHasArabicNoSpacePunctuation = [];
62790
- for (const s of wordSegmenter.segment(normalized2)) {
62790
+ for (const s of wordSegmenter.segment(normalized3)) {
62791
62791
  for (const piece of splitSegmentByBreakKind(s.segment, s.isWordLike ?? false, s.index, whiteSpaceProfile)) {
62792
62792
  let appendPieceToPrevious2 = function() {
62793
62793
  if (mergedSingleCharRunChars[prevIndex] !== null) {
@@ -63011,10 +63011,10 @@ function mergeKeepAllTextSegments(segmentation) {
63011
63011
  }
63012
63012
  function analyzeText(text2, profile, whiteSpace = "normal", wordBreak = "normal") {
63013
63013
  const whiteSpaceProfile = getWhiteSpaceProfile(whiteSpace);
63014
- const normalized2 = whiteSpaceProfile.mode === "pre-wrap" ? normalizeWhitespacePreWrap(text2) : normalizeWhitespaceNormal(text2);
63015
- if (normalized2.length === 0) {
63014
+ const normalized3 = whiteSpaceProfile.mode === "pre-wrap" ? normalizeWhitespacePreWrap(text2) : normalizeWhitespaceNormal(text2);
63015
+ if (normalized3.length === 0) {
63016
63016
  return {
63017
- normalized: normalized2,
63017
+ normalized: normalized3,
63018
63018
  chunks: [],
63019
63019
  len: 0,
63020
63020
  texts: [],
@@ -63023,9 +63023,9 @@ function analyzeText(text2, profile, whiteSpace = "normal", wordBreak = "normal"
63023
63023
  starts: []
63024
63024
  };
63025
63025
  }
63026
- const segmentation = wordBreak === "keep-all" ? mergeKeepAllTextSegments(buildMergedSegmentation(normalized2, profile, whiteSpaceProfile)) : buildMergedSegmentation(normalized2, profile, whiteSpaceProfile);
63026
+ const segmentation = wordBreak === "keep-all" ? mergeKeepAllTextSegments(buildMergedSegmentation(normalized3, profile, whiteSpaceProfile)) : buildMergedSegmentation(normalized3, profile, whiteSpaceProfile);
63027
63027
  return {
63028
- normalized: normalized2,
63028
+ normalized: normalized3,
63029
63029
  chunks: compileAnalysisChunks(segmentation, whiteSpaceProfile),
63030
63030
  ...segmentation
63031
63031
  };
@@ -66418,8 +66418,8 @@ function resolveExtractCacheDir(env = process.env) {
66418
66418
  if (raw === void 0) {
66419
66419
  return { dir: defaultExtractCacheDir(), disabled: false, source: "default" };
66420
66420
  }
66421
- const normalized2 = raw.trim().toLowerCase();
66422
- if (EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized2)) {
66421
+ const normalized3 = raw.trim().toLowerCase();
66422
+ if (EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized3)) {
66423
66423
  return { dir: void 0, disabled: true, source: "env", rawValue: raw };
66424
66424
  }
66425
66425
  return { dir: raw, disabled: false, source: "env", rawValue: raw };
@@ -70406,8 +70406,8 @@ function candidateFileName(candidate) {
70406
70406
  return candidate.split(/[\\/]/).at(-1)?.toLowerCase() ?? candidate.toLowerCase();
70407
70407
  }
70408
70408
  function chooseBestPathCandidate(name, candidates) {
70409
- const normalized2 = candidates.map((candidate) => candidate.trim()).filter(Boolean);
70410
- return normalized2.find((candidate) => candidateFileName(candidate) === `${name}.exe`) ?? normalized2.find((candidate) => candidateFileName(candidate) === name) ?? normalized2.find((candidate) => !candidateFileName(candidate).match(/\.(cmd|bat)$/i)) ?? normalized2[0];
70409
+ const normalized3 = candidates.map((candidate) => candidate.trim()).filter(Boolean);
70410
+ return normalized3.find((candidate) => candidateFileName(candidate) === `${name}.exe`) ?? normalized3.find((candidate) => candidateFileName(candidate) === name) ?? normalized3.find((candidate) => !candidateFileName(candidate).match(/\.(cmd|bat)$/i)) ?? normalized3[0];
70411
70411
  }
70412
70412
  function isExecutablePathCandidate(candidate) {
70413
70413
  if (process.platform === "win32") return existsSync4(candidate);
@@ -70759,8 +70759,8 @@ function matchesAny(message, patterns) {
70759
70759
  return patterns.some((pattern) => pattern.test(message));
70760
70760
  }
70761
70761
  function hasIoOperationFailure(message) {
70762
- const normalized2 = message.toLowerCase();
70763
- return normalized2.split(/[\r\n]/).some(
70762
+ const normalized3 = message.toLowerCase();
70763
+ return normalized3.split(/[\r\n]/).some(
70764
70764
  (line3) => IO_OPERATION_TOKENS.some((operation) => {
70765
70765
  const operationIndex = line3.indexOf(operation);
70766
70766
  if (operationIndex < 0) return false;
@@ -75853,8 +75853,8 @@ function resolveLocalAssetCandidates(projectDir, url) {
75853
75853
  addCandidate(candidates, resolved2);
75854
75854
  continue;
75855
75855
  }
75856
- const normalized2 = posix2.normalize(projectRelative.replace(/\\/g, "/"));
75857
- const clamped = normalized2.replace(/^(\.\.\/)+/, "");
75856
+ const normalized3 = posix2.normalize(projectRelative.replace(/\\/g, "/"));
75857
+ const clamped = normalized3.replace(/^(\.\.\/)+/, "");
75858
75858
  if (clamped && !clamped.startsWith("..")) {
75859
75859
  addCandidate(candidates, resolve6(projectRoot, clamped));
75860
75860
  }
@@ -76430,15 +76430,15 @@ function looksLikeRemoteErrorDocument(prefix) {
76430
76430
  }
76431
76431
  function normalizeCallerSha256(value) {
76432
76432
  if (value === void 0) return void 0;
76433
- const normalized2 = value.trim().toLowerCase();
76434
- if (!/^[a-f0-9]{64}$/.test(normalized2)) {
76433
+ const normalized3 = value.trim().toLowerCase();
76434
+ if (!/^[a-f0-9]{64}$/.test(normalized3)) {
76435
76435
  throw new UrlDownloadError(
76436
76436
  "hash_mismatch",
76437
76437
  false,
76438
76438
  "Caller-provided SHA-256 checksum is malformed"
76439
76439
  );
76440
76440
  }
76441
- return normalized2;
76441
+ return normalized3;
76442
76442
  }
76443
76443
  function expectedResponseSha256(response, callerSha256) {
76444
76444
  if (callerSha256) return { value: callerSha256, encoding: "hex", source: "caller" };
@@ -77164,13 +77164,13 @@ function isCompositionVariable2(v2) {
77164
77164
  return true;
77165
77165
  }
77166
77166
  function isSafeMediaUrl(url) {
77167
- const normalized2 = url.replace(/[\u0000-\u0020]/g, "");
77168
- const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(normalized2);
77167
+ const normalized3 = url.replace(/[\u0000-\u0020]/g, "");
77168
+ const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(normalized3);
77169
77169
  if (!scheme) return true;
77170
77170
  const proto = scheme[1]?.toLowerCase();
77171
77171
  if (!proto) return false;
77172
77172
  if (proto === "https" || proto === "http" || proto === "blob") return true;
77173
- if (proto === "data") return /^data:image\//i.test(normalized2);
77173
+ if (proto === "data") return /^data:image\//i.test(normalized3);
77174
77174
  return false;
77175
77175
  }
77176
77176
  var CANVAS_DIMENSIONS2, VALID_CANVAS_RESOLUTIONS2, COMPOSITION_VARIABLE_TYPES2, FONT_ALIAS_MAP2, FONT_ALIAS_KEYS2, CANONICAL_FONT_DISPLAY_NAMES2, DEFAULT_TYPEOF2, COMPOSITION_ATTRIBUTES4, CANONICAL_AUTHORED_TIMING_ATTRIBUTES4, DERIVED_TIMING_ATTRIBUTES4, LEGACY_TIMING_ATTRIBUTES4;
@@ -84036,14 +84036,64 @@ function hasCaptionStyles(styles) {
84036
84036
  return styles.some((s) => /\.caption[-_]?(?:group|word)/i.test(s.content));
84037
84037
  }
84038
84038
  function truncateSnippet(value, maxLength = 220) {
84039
- const normalized2 = value.replace(/\s+/g, " ").trim();
84040
- if (!normalized2) return void 0;
84041
- if (normalized2.length <= maxLength) return normalized2;
84042
- return `${normalized2.slice(0, maxLength - 3)}...`;
84039
+ const normalized22 = value.replace(/\s+/g, " ").trim();
84040
+ if (!normalized22) return void 0;
84041
+ if (normalized22.length <= maxLength) return normalized22;
84042
+ return `${normalized22.slice(0, maxLength - 3)}...`;
84043
84043
  }
84044
84044
  function mediaSrcTagRe(tagAlternation) {
84045
84045
  return new RegExp(`<(${tagAlternation})\\b[^>]*\\ssrc\\s*=\\s*["']([^"']+)["'][^>]*>`, "gi");
84046
84046
  }
84047
+ function normalized(source) {
84048
+ let text2 = "";
84049
+ const offsets = [];
84050
+ for (let i = 0; i < source.length; i++) {
84051
+ const char = source[i];
84052
+ if (/\s/.test(char)) {
84053
+ if (text2.endsWith(" ")) continue;
84054
+ text2 += " ";
84055
+ } else text2 += char;
84056
+ offsets.push(i);
84057
+ }
84058
+ return { text: text2, offsets };
84059
+ }
84060
+ function createSourceLocator(source) {
84061
+ const tags = parseHtmlStructure(source).tags;
84062
+ const searchable = source.split("");
84063
+ const parser = new Parser3({
84064
+ oncomment() {
84065
+ searchable.fill("\0", parser.startIndex, parser.endIndex + 1);
84066
+ }
84067
+ });
84068
+ parser.write(source);
84069
+ parser.end();
84070
+ const normalizedSource = normalized(searchable.join(""));
84071
+ const at4 = (offset3) => {
84072
+ const before3 = source.slice(0, offset3);
84073
+ return {
84074
+ line: before3.split(/\r\n|\r|\n/).length,
84075
+ column: offset3 - Math.max(before3.lastIndexOf("\n"), before3.lastIndexOf("\r"))
84076
+ };
84077
+ };
84078
+ return (finding) => {
84079
+ if (finding.line !== void 0) return { line: finding.line, column: finding.column };
84080
+ if (finding.snippet) {
84081
+ const offset3 = snippetOffset(normalizedSource, finding.snippet);
84082
+ return offset3 === void 0 ? {} : at4(offset3);
84083
+ }
84084
+ const id = finding.elementId ?? /^#([\w-]+)$/.exec(finding.selector ?? "")?.[1];
84085
+ if (!id) return {};
84086
+ const matches2 = tags.filter((tag) => readDecodedAttr(tag.raw, "id") === id);
84087
+ return matches2.length === 1 ? at4(matches2[0].index) : {};
84088
+ };
84089
+ }
84090
+ function snippetOffset(source, snippet) {
84091
+ const needle = snippet.replace(/\s+/g, " ").trim().replace(/\.\.\.$/, "");
84092
+ if (!needle) return void 0;
84093
+ const index = source.text.indexOf(needle);
84094
+ if (index < 0 || source.text.indexOf(needle, index + 1) >= 0) return void 0;
84095
+ return source.offsets[index];
84096
+ }
84047
84097
  function buildLintContext(html, options = {}) {
84048
84098
  const rawSource = html || "";
84049
84099
  let source = stripHtmlComments(rawSource);
@@ -84422,18 +84472,18 @@ function classNamesFromAttr(classAttr) {
84422
84472
  return classAttr.split(/\s+/).filter(Boolean);
84423
84473
  }
84424
84474
  function selectorTargetsManagedMedia(selector, mediaIndex) {
84425
- const normalized2 = selector.trim();
84426
- if (!normalized2) return false;
84427
- if (mediaIndex.hasVideo && /\bvideo\b/i.test(normalized2)) return true;
84428
- if (mediaIndex.hasAudio && /\baudio\b/i.test(normalized2)) return true;
84475
+ const normalized22 = selector.trim();
84476
+ if (!normalized22) return false;
84477
+ if (mediaIndex.hasVideo && /\bvideo\b/i.test(normalized22)) return true;
84478
+ if (mediaIndex.hasAudio && /\baudio\b/i.test(normalized22)) return true;
84429
84479
  for (const mediaId of mediaIndex.ids) {
84430
84480
  const escapedId = escapeRegExp4(mediaId);
84431
- if (new RegExp(`#${escapedId}(?![\\w-])`).test(normalized2) || normalized2.includes(`[id="${mediaId}"]`) || normalized2.includes(`[id='${mediaId}']`)) {
84481
+ if (new RegExp(`#${escapedId}(?![\\w-])`).test(normalized22) || normalized22.includes(`[id="${mediaId}"]`) || normalized22.includes(`[id='${mediaId}']`)) {
84432
84482
  return true;
84433
84483
  }
84434
84484
  }
84435
84485
  for (const className of mediaIndex.classes) {
84436
- if (new RegExp(`\\.${escapeRegExp4(className)}(?![\\w-])`).test(normalized2)) {
84486
+ if (new RegExp(`\\.${escapeRegExp4(className)}(?![\\w-])`).test(normalized22)) {
84437
84487
  return true;
84438
84488
  }
84439
84489
  }
@@ -84751,8 +84801,8 @@ function readTagTiming(rawTag) {
84751
84801
  }
84752
84802
  function countPhysicalLines(source) {
84753
84803
  if (source.length === 0) return 0;
84754
- const normalized2 = source.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
84755
- const withoutFinalNewline = normalized2.endsWith("\n") ? normalized2.slice(0, -1) : normalized2;
84804
+ const normalized22 = source.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
84805
+ const withoutFinalNewline = normalized22.endsWith("\n") ? normalized22.slice(0, -1) : normalized22;
84756
84806
  return withoutFinalNewline.split("\n").length;
84757
84807
  }
84758
84808
  function countStructuralLines(source) {
@@ -84765,8 +84815,8 @@ function isCaptionCue(tag) {
84765
84815
  }
84766
84816
  function isRegistrySourceFile(filePath) {
84767
84817
  if (!filePath) return false;
84768
- const normalized2 = filePath.replace(/\\/g, "/");
84769
- return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(normalized2);
84818
+ const normalized22 = filePath.replace(/\\/g, "/");
84819
+ return /(?:^|\/)registry\/blocks\/([^/]+)\/\1\.html$/i.test(normalized22);
84770
84820
  }
84771
84821
  function isRegistryInstalledFile(rawSource) {
84772
84822
  return /^\s*<!--\s*hyperframes-registry-item:[^>]*-->/i.test(rawSource.slice(0, 512));
@@ -84999,8 +85049,8 @@ function zeroValue(value) {
84999
85049
  return Number(value.trim()) === 0;
85000
85050
  }
85001
85051
  function isGsapColorProperty(property) {
85002
- const normalized2 = property.toLowerCase();
85003
- return !normalized2.startsWith("--") && (normalized2.endsWith("color") || normalized2 === "fill" || normalized2 === "stroke");
85052
+ const normalized22 = property.toLowerCase();
85053
+ return !normalized22.startsWith("--") && (normalized22.endsWith("color") || normalized22 === "fill" || normalized22 === "stroke");
85004
85054
  }
85005
85055
  function collectStaticCssVariableDefinitions(tags, styles) {
85006
85056
  const definitions = /* @__PURE__ */ new Set();
@@ -85127,10 +85177,10 @@ function styleHasHiddenInitialState(style) {
85127
85177
  function styleHasOpaqueBackground(style) {
85128
85178
  const background = readStyleProperty(style, "background") || readStyleProperty(style, "background-color");
85129
85179
  if (!background) return false;
85130
- const normalized2 = background.toLowerCase().replace(/\s+/g, "");
85131
- if (normalized2 === "transparent" || normalized2 === "none") return false;
85132
- if (/rgba?\([^)]*,0(?:\.0+)?\)$/.test(normalized2)) return false;
85133
- if (/hsla?\([^)]*,0(?:\.0+)?\)$/.test(normalized2)) return false;
85180
+ const normalized22 = background.toLowerCase().replace(/\s+/g, "");
85181
+ if (normalized22 === "transparent" || normalized22 === "none") return false;
85182
+ if (/rgba?\([^)]*,0(?:\.0+)?\)$/.test(normalized22)) return false;
85183
+ if (/hsla?\([^)]*,0(?:\.0+)?\)$/.test(normalized22)) return false;
85134
85184
  return true;
85135
85185
  }
85136
85186
  function styleLooksFullFrameOverlay(style) {
@@ -85498,9 +85548,9 @@ function elementLevelTokens(tokens, tagsByToken) {
85498
85548
  return expanded;
85499
85549
  }
85500
85550
  function isMultiComponentDasharray(value) {
85501
- const normalized2 = value.replace(/!important\s*$/i, "").trim();
85502
- if (!normalized2 || /^none$/i.test(normalized2)) return false;
85503
- return normalized2.split(/[\s,]+/).filter(Boolean).length >= 2;
85551
+ const normalized22 = value.replace(/!important\s*$/i, "").trim();
85552
+ if (!normalized22 || /^none$/i.test(normalized22)) return false;
85553
+ return normalized22.split(/[\s,]+/).filter(Boolean).length >= 2;
85504
85554
  }
85505
85555
  function gsapDasharrayValueLooksMultiComponent(valueSource) {
85506
85556
  const literal2 = valueSource.trim().match(/^(["'`])([\s\S]*)\1$/)?.[2];
@@ -85909,7 +85959,15 @@ function collectFindings(produced, seen, filePath, into) {
85909
85959
  async function lintHyperframeHtml(html, options = {}) {
85910
85960
  const startedAt = performance.now();
85911
85961
  const ctx = buildLintContext(html, options);
85912
- const { findings, timings } = await runRules(ctx, options.filePath);
85962
+ const { findings: rawFindings, timings } = await runRules(ctx, options.filePath);
85963
+ const locate = createSourceLocator(html);
85964
+ const findings = rawFindings.map((finding) => {
85965
+ if (finding.snippet && options.externalStyles?.some(
85966
+ (style) => style.content.replace(/\s+/g, " ").includes(finding.snippet.replace(/\.\.\.$/, ""))
85967
+ ))
85968
+ return finding;
85969
+ return { ...finding, ...locate(finding) };
85970
+ });
85913
85971
  const errorCount = findings.filter((f) => f.severity === "error").length;
85914
85972
  const warningCount = findings.filter((f) => f.severity === "warning").length;
85915
85973
  const infoCount = findings.filter((f) => f.severity === "info").length;
@@ -86643,6 +86701,7 @@ var init_dist4 = __esm({
86643
86701
  "../lint/dist/index.js"() {
86644
86702
  "use strict";
86645
86703
  init_esm6();
86704
+ init_esm6();
86646
86705
  import_postcss_selector_parser = __toESM(require_dist(), 1);
86647
86706
  init_dist2();
86648
86707
  init_colorGradingContract();
@@ -91222,9 +91281,9 @@ function parityFontFamilies(html) {
91222
91281
  const families = /* @__PURE__ */ new Set();
91223
91282
  for (const match of html.matchAll(/font-family\s*:\s*([^;}]+)/gi)) {
91224
91283
  for (const family of match[1].split(",")) {
91225
- const normalized2 = family.trim().replace(/^['"]|['"]$/g, "");
91226
- if (normalized2.startsWith("Parity"))
91227
- families.add(normalized2);
91284
+ const normalized3 = family.trim().replace(/^['"]|['"]$/g, "");
91285
+ if (normalized3.startsWith("Parity"))
91286
+ families.add(normalized3);
91228
91287
  }
91229
91288
  }
91230
91289
  return [...families].sort();
@@ -105058,49 +105117,49 @@ var require_fast_uri = __commonJS({
105058
105117
  schemelessOptions.skipEscape = true;
105059
105118
  return serialize(resolved2, schemelessOptions);
105060
105119
  }
105061
- function resolveComponent(base2, relative38, options, skipNormalization) {
105120
+ function resolveComponent(base2, relative39, options, skipNormalization) {
105062
105121
  const target = {};
105063
105122
  if (!skipNormalization) {
105064
105123
  base2 = parse10(serialize(base2, options), options);
105065
- relative38 = parse10(serialize(relative38, options), options);
105124
+ relative39 = parse10(serialize(relative39, options), options);
105066
105125
  }
105067
105126
  options = options || {};
105068
- if (!options.tolerant && relative38.scheme) {
105069
- target.scheme = relative38.scheme;
105070
- target.userinfo = relative38.userinfo;
105071
- target.host = relative38.host;
105072
- target.port = relative38.port;
105073
- target.path = removeDotSegments(relative38.path || "");
105074
- target.query = relative38.query;
105127
+ if (!options.tolerant && relative39.scheme) {
105128
+ target.scheme = relative39.scheme;
105129
+ target.userinfo = relative39.userinfo;
105130
+ target.host = relative39.host;
105131
+ target.port = relative39.port;
105132
+ target.path = removeDotSegments(relative39.path || "");
105133
+ target.query = relative39.query;
105075
105134
  } else {
105076
- if (relative38.userinfo !== void 0 || relative38.host !== void 0 || relative38.port !== void 0) {
105077
- target.userinfo = relative38.userinfo;
105078
- target.host = relative38.host;
105079
- target.port = relative38.port;
105080
- target.path = removeDotSegments(relative38.path || "");
105081
- target.query = relative38.query;
105135
+ if (relative39.userinfo !== void 0 || relative39.host !== void 0 || relative39.port !== void 0) {
105136
+ target.userinfo = relative39.userinfo;
105137
+ target.host = relative39.host;
105138
+ target.port = relative39.port;
105139
+ target.path = removeDotSegments(relative39.path || "");
105140
+ target.query = relative39.query;
105082
105141
  } else {
105083
- if (!relative38.path) {
105142
+ if (!relative39.path) {
105084
105143
  target.path = base2.path;
105085
- if (relative38.query !== void 0) {
105086
- target.query = relative38.query;
105144
+ if (relative39.query !== void 0) {
105145
+ target.query = relative39.query;
105087
105146
  } else {
105088
105147
  target.query = base2.query;
105089
105148
  }
105090
105149
  } else {
105091
- if (relative38.path[0] === "/") {
105092
- target.path = removeDotSegments(relative38.path);
105150
+ if (relative39.path[0] === "/") {
105151
+ target.path = removeDotSegments(relative39.path);
105093
105152
  } else {
105094
105153
  if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
105095
- target.path = "/" + relative38.path;
105154
+ target.path = "/" + relative39.path;
105096
105155
  } else if (!base2.path) {
105097
- target.path = relative38.path;
105156
+ target.path = relative39.path;
105098
105157
  } else {
105099
- target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative38.path;
105158
+ target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative39.path;
105100
105159
  }
105101
105160
  target.path = removeDotSegments(target.path);
105102
105161
  }
105103
- target.query = relative38.query;
105162
+ target.query = relative39.query;
105104
105163
  }
105105
105164
  target.userinfo = base2.userinfo;
105106
105165
  target.host = base2.host;
@@ -105108,7 +105167,7 @@ var require_fast_uri = __commonJS({
105108
105167
  }
105109
105168
  target.scheme = base2.scheme;
105110
105169
  }
105111
- target.fragment = relative38.fragment;
105170
+ target.fragment = relative39.fragment;
105112
105171
  return target;
105113
105172
  }
105114
105173
  function equal(uriA, uriB, options) {
@@ -105300,8 +105359,8 @@ var require_fast_uri = __commonJS({
105300
105359
  }
105301
105360
  function normalizeComparableURI(uri, opts) {
105302
105361
  if (typeof uri === "string") {
105303
- const { normalized: normalized2, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
105304
- return malformedAuthorityOrPort ? void 0 : normalized2;
105362
+ const { normalized: normalized3, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
105363
+ return malformedAuthorityOrPort ? void 0 : normalized3;
105305
105364
  }
105306
105365
  if (typeof uri === "object") {
105307
105366
  return serialize(uri, opts);
@@ -110942,8 +111001,8 @@ function inferPreGrouped(words) {
110942
111001
  function joinTokens(left, right) {
110943
111002
  const a = left.at(-1) ?? "";
110944
111003
  const b2 = right[0] ?? "";
110945
- const sep18 = CJK_CHAR.test(a) || CJK_CHAR.test(b2) ? "" : " ";
110946
- return `${left}${sep18}${right}`;
111004
+ const sep19 = CJK_CHAR.test(a) || CJK_CHAR.test(b2) ? "" : " ";
111005
+ return `${left}${sep19}${right}`;
110947
111006
  }
110948
111007
  function wordsToCues(words, opts = {}) {
110949
111008
  const preGrouped = opts.preGrouped ?? inferPreGrouped(words);
@@ -111267,12 +111326,12 @@ function normalizePath(path) {
111267
111326
  return path.replaceAll("\\", "/");
111268
111327
  }
111269
111328
  function isWorkspaceLink(realEntry) {
111270
- const normalized2 = normalizePath(realEntry);
111271
- return normalized2.includes("/packages/cli/");
111329
+ const normalized3 = normalizePath(realEntry);
111330
+ return normalized3.includes("/packages/cli/");
111272
111331
  }
111273
111332
  function isEphemeralExec(realEntry) {
111274
- const normalized2 = normalizePath(realEntry);
111275
- return normalized2.includes("/_npx/") || normalized2.includes("/.npm/_npx/") || posix3.basename(posix3.dirname(normalized2)).startsWith("bunx-");
111333
+ const normalized3 = normalizePath(realEntry);
111334
+ return normalized3.includes("/_npx/") || normalized3.includes("/.npm/_npx/") || posix3.basename(posix3.dirname(normalized3)).startsWith("bunx-");
111276
111335
  }
111277
111336
  function isHomebrewInstall(realEntry) {
111278
111337
  return normalizePath(realEntry).includes("/Cellar/hyperframes/");
@@ -112844,7 +112903,7 @@ function formatLintFindings({ results, totalErrors, totalWarnings, totalInfos },
112844
112903
  const format = (finding) => {
112845
112904
  if (!verbose && finding.severity === "info") return;
112846
112905
  const prefix = finding.severity === "error" ? c.error("\u2717") : finding.severity === "warning" ? c.warn("\u26A0") : c.dim("\u2139");
112847
- const fileLabel = multiFile ? c.dim(`[${file}] `) : "";
112906
+ const fileLabel = findingFileLabel(file, finding, multiFile);
112848
112907
  const loc = showElementId && finding.elementId ? ` ${c.accent(`[${finding.elementId}]`)}` : "";
112849
112908
  lines.push(` ${prefix} ${fileLabel}${c.bold(finding.code)}${loc}: ${finding.message}`);
112850
112909
  if (finding.fixHint) lines.push(` ${c.dim(`Fix: ${finding.fixHint}`)}`);
@@ -112877,6 +112936,11 @@ function formatLintStartupMessage(lintResult, mode) {
112877
112936
  const hint2 = mode.pointer === "studio" ? "see the Lint badge in Studio, or run `hyperframes lint` for full output" : "run with --lint-verbose for full output";
112878
112937
  return [` Lint: ${counts} \u2014 ${hint2}.`];
112879
112938
  }
112939
+ function findingFileLabel(file, finding, multiFile) {
112940
+ if (finding.line === void 0) return multiFile ? c.dim(`[${file}] `) : "";
112941
+ const column = finding.column === void 0 ? "" : `:${finding.column}`;
112942
+ return c.dim(`[${finding.file ?? file}:${finding.line}${column}] `);
112943
+ }
112880
112944
  var init_lintFormat = __esm({
112881
112945
  "src/utils/lintFormat.ts"() {
112882
112946
  "use strict";
@@ -113522,7 +113586,7 @@ import { dirname as dirname15, join as join35, resolve as resolve17 } from "path
113522
113586
  function defaultStateHome() {
113523
113587
  return process.env.XDG_STATE_HOME || join35(homedir8(), ".local", "state");
113524
113588
  }
113525
- function normalized(path) {
113589
+ function normalized2(path) {
113526
113590
  const resolved2 = resolve17(path).replace(/\\/g, "/");
113527
113591
  return process.platform === "win32" ? resolved2.toLowerCase() : resolved2;
113528
113592
  }
@@ -113530,7 +113594,7 @@ function sessionDirectory(stateHome = defaultStateHome()) {
113530
113594
  return join35(stateHome, "hyperframes", "previews");
113531
113595
  }
113532
113596
  function previewSessionPath(projectDir, stateHome = defaultStateHome()) {
113533
- const key2 = createHash7("sha256").update(normalized(projectDir)).digest("hex").slice(0, 16);
113597
+ const key2 = createHash7("sha256").update(normalized2(projectDir)).digest("hex").slice(0, 16);
113534
113598
  return join35(sessionDirectory(stateHome), `${key2}.json`);
113535
113599
  }
113536
113600
  function previewLogPath(projectDir, stateHome = defaultStateHome()) {
@@ -113553,7 +113617,7 @@ function readPreviewSession(projectDir, stateHome = defaultStateHome()) {
113553
113617
  if (!existsSync32(path)) return null;
113554
113618
  try {
113555
113619
  const parsed = JSON.parse(readFileSync23(path, "utf8"));
113556
- if (!Number.isInteger(parsed.pid) || parsed.pid <= 0 || normalized(parsed.projectDir) !== normalized(projectDir)) {
113620
+ if (!Number.isInteger(parsed.pid) || parsed.pid <= 0 || normalized2(parsed.projectDir) !== normalized2(projectDir)) {
113557
113621
  throw new Error("invalid preview session");
113558
113622
  }
113559
113623
  return parsed;
@@ -113588,7 +113652,7 @@ function removePreviewSession(projectDir, stateHome = defaultStateHome()) {
113588
113652
  }
113589
113653
  function matchingServer(servers, projectDir, browserGpuMode) {
113590
113654
  return servers.find(
113591
- (server) => normalized(server.projectDir) === normalized(projectDir) && (browserGpuMode === void 0 || server.browserGpuMode === browserGpuMode)
113655
+ (server) => normalized2(server.projectDir) === normalized2(projectDir) && (browserGpuMode === void 0 || server.browserGpuMode === browserGpuMode)
113592
113656
  ) ?? null;
113593
113657
  }
113594
113658
  function matchingServerAtPort(servers, projectDir, port) {
@@ -113598,9 +113662,9 @@ function matchingServerAtPort(servers, projectDir, port) {
113598
113662
  );
113599
113663
  }
113600
113664
  function sameProjectPorts(servers, projectDir) {
113601
- const project = normalized(projectDir);
113665
+ const project = normalized2(projectDir);
113602
113666
  return new Set(
113603
- servers.filter((server) => normalized(server.projectDir) === project).map((server) => server.port)
113667
+ servers.filter((server) => normalized2(server.projectDir) === project).map((server) => server.port)
113604
113668
  );
113605
113669
  }
113606
113670
  async function stopProcess(pid) {
@@ -117577,8 +117641,8 @@ function upsertProp(ms, objNode, key2, value) {
117577
117641
  if (existing) {
117578
117642
  ms.overwrite(existing.value.start, existing.value.end, valueToCode(value));
117579
117643
  } else {
117580
- const sep18 = objNode.properties.length > 0 ? ", " : "";
117581
- ms.appendLeft(objNode.end - 1, `${sep18}${safeKey(key2)}: ${valueToCode(value)}`);
117644
+ const sep19 = objNode.properties.length > 0 ? ", " : "";
117645
+ ms.appendLeft(objNode.end - 1, `${sep19}${safeKey(key2)}: ${valueToCode(value)}`);
117582
117646
  }
117583
117647
  }
117584
117648
  function isEditableVarKey(key2) {
@@ -118084,8 +118148,8 @@ function ensureKeyframesNode(script, animationId) {
118084
118148
  if (!target) return null;
118085
118149
  const kfProp = findPropertyNode22(target.call.varsArg, "keyframes");
118086
118150
  if (kfProp?.value?.type === "ArrayExpression") {
118087
- const normalized2 = convertArrayKeyframesToObject(script, target);
118088
- if (normalized2 !== script) return locateWithKeyframes(normalized2, animationId);
118151
+ const normalized3 = convertArrayKeyframesToObject(script, target);
118152
+ if (normalized3 !== script) return locateWithKeyframes(normalized3, animationId);
118089
118153
  return null;
118090
118154
  }
118091
118155
  const converted = convertFlatTweenToKeyframes(script, target);
@@ -118145,8 +118209,8 @@ function insertNewKeyframe(ms, kfNode, percentage, pctKey, valueCode) {
118145
118209
  if (insertBeforeProp) {
118146
118210
  ms.appendLeft(insertBeforeProp.start, `${JSON.stringify(pctKey)}: ${valueCode}, `);
118147
118211
  } else {
118148
- const sep18 = allProps.length > 0 ? ", " : "";
118149
- ms.appendLeft(kfNode.end - 1, `${sep18}${JSON.stringify(pctKey)}: ${valueCode}`);
118212
+ const sep19 = allProps.length > 0 ? ", " : "";
118213
+ ms.appendLeft(kfNode.end - 1, `${sep19}${JSON.stringify(pctKey)}: ${valueCode}`);
118150
118214
  }
118151
118215
  }
118152
118216
  function collapseKeyframesToFlat(ms, varsNode, source, remainingRecord) {
@@ -118590,8 +118654,8 @@ function enableArcPath(ms, call, animation, config) {
118590
118654
  const k2 = propKeyName22(p2);
118591
118655
  return k2 !== "x" && k2 !== "y";
118592
118656
  });
118593
- const sep18 = survivesRemoval ? ", " : "";
118594
- ms.appendRight(vars.start + 1, ` motionPath: ${motionPathCode}${sep18}`);
118657
+ const sep19 = survivesRemoval ? ", " : "";
118658
+ ms.appendRight(vars.start + 1, ` motionPath: ${motionPathCode}${sep19}`);
118595
118659
  stripXYFromKeyframes(ms, findPropertyNode22(call.varsArg, "keyframes"));
118596
118660
  removePropsByKey(ms, call.varsArg, /* @__PURE__ */ new Set(["x", "y"]));
118597
118661
  return true;
@@ -119332,17 +119396,17 @@ function getSystemProfilerIndex() {
119332
119396
  const filePath = typeface.path;
119333
119397
  if (typeof filePath !== "string" || !FONT_EXT_RE.test(filePath))
119334
119398
  continue;
119335
- const normalized2 = normalizeName(family);
119399
+ const normalized3 = normalizeName(family);
119336
119400
  const ext = filePath.match(FONT_EXT_RE)?.[1] ?? "ttf";
119337
119401
  const entry = {
119338
- family: normalized2,
119402
+ family: normalized3,
119339
119403
  path: filePath,
119340
119404
  format: extensionToFormat(ext),
119341
119405
  isRegular: isRegularWeight(filePath)
119342
119406
  };
119343
- const list = profilerCache.get(normalized2) ?? [];
119407
+ const list = profilerCache.get(normalized3) ?? [];
119344
119408
  list.push(entry);
119345
- profilerCache.set(normalized2, list);
119409
+ profilerCache.set(normalized3, list);
119346
119410
  }
119347
119411
  }
119348
119412
  } catch {
@@ -119378,25 +119442,25 @@ function locateViaFcMatch(targetFamily) {
119378
119442
  }
119379
119443
  }
119380
119444
  function locateSystemFont(family) {
119381
- const normalized2 = normalizeName(family);
119382
- if (!normalized2)
119445
+ const normalized3 = normalizeName(family);
119446
+ if (!normalized3)
119383
119447
  return null;
119384
- const cached3 = cache2.get(normalized2);
119448
+ const cached3 = cache2.get(normalized3);
119385
119449
  if (cached3 !== void 0)
119386
119450
  return cached3;
119387
119451
  let result = null;
119388
- result = locateViaSystemProfiler(normalized2);
119452
+ result = locateViaSystemProfiler(normalized3);
119389
119453
  if (!result) {
119390
- result = locateViaFcMatch(normalized2);
119454
+ result = locateViaFcMatch(normalized3);
119391
119455
  }
119392
119456
  if (!result) {
119393
119457
  const allCandidates = [];
119394
119458
  for (const dir of fontDirectories()) {
119395
- allCandidates.push(...collectCandidatesFromDir(dir, normalized2));
119459
+ allCandidates.push(...collectCandidatesFromDir(dir, normalized3));
119396
119460
  }
119397
119461
  result = pickBestCandidate(allCandidates);
119398
119462
  }
119399
- cache2.set(normalized2, result);
119463
+ cache2.set(normalized3, result);
119400
119464
  return result;
119401
119465
  }
119402
119466
  function inferWeightAndStyle(fileName) {
@@ -119409,12 +119473,12 @@ function inferWeightAndStyle(fileName) {
119409
119473
  return { weight: "400", style };
119410
119474
  }
119411
119475
  function locateSystemFontVariants(family) {
119412
- const normalized2 = normalizeName(family);
119413
- if (!normalized2)
119476
+ const normalized3 = normalizeName(family);
119477
+ if (!normalized3)
119414
119478
  return [];
119415
119479
  const variants = [];
119416
119480
  const profilerIndex = getSystemProfilerIndex();
119417
- const profilerEntries = profilerIndex.get(normalized2);
119481
+ const profilerEntries = profilerIndex.get(normalized3);
119418
119482
  if (profilerEntries && profilerEntries.length > 0) {
119419
119483
  for (const e2 of profilerEntries) {
119420
119484
  if (!isRegularFile(e2.path) || !isPathBounded(e2.path))
@@ -119427,7 +119491,7 @@ function locateSystemFontVariants(family) {
119427
119491
  }
119428
119492
  const allCandidates = [];
119429
119493
  for (const dir of fontDirectories()) {
119430
- allCandidates.push(...collectCandidatesFromDir(dir, normalized2));
119494
+ allCandidates.push(...collectCandidatesFromDir(dir, normalized3));
119431
119495
  }
119432
119496
  for (const c3 of allCandidates) {
119433
119497
  const { weight, style } = inferWeightAndStyle(c3.path);
@@ -125346,20 +125410,20 @@ ${rewrittenContent}
125346
125410
  </html>`;
125347
125411
  }
125348
125412
  function persistHfIdsIfNeeded(filePath, html) {
125349
- const normalized2 = ensureHfIds(html);
125413
+ const normalized3 = ensureHfIds(html);
125350
125414
  const idsBefore = (html.match(/\bdata-hf-id=/g) ?? []).length;
125351
- const idsAfter = (normalized2.match(/\bdata-hf-id=/g) ?? []).length;
125415
+ const idsAfter = (normalized3.match(/\bdata-hf-id=/g) ?? []).length;
125352
125416
  if (idsAfter > idsBefore) {
125353
125417
  try {
125354
125418
  const current2 = readFileSync72(filePath, "utf-8");
125355
125419
  if (current2 === html) {
125356
- replaceFileAtomically(filePath, normalized2, statSync42(filePath).mode);
125420
+ replaceFileAtomically(filePath, normalized3, statSync42(filePath).mode);
125357
125421
  }
125358
125422
  } catch (err) {
125359
125423
  console.warn("[hyperframes] persistHfIdsIfNeeded: failed to write ids to disk:", err);
125360
125424
  }
125361
125425
  }
125362
- return normalized2;
125426
+ return normalized3;
125363
125427
  }
125364
125428
  function openNoFollow(filePath, flags) {
125365
125429
  const noFollow = constants4.O_NOFOLLOW ?? 0;
@@ -125380,16 +125444,16 @@ function stampFileHfIds(filePath) {
125380
125444
  try {
125381
125445
  if (!fstatSync22(fd).isFile()) return null;
125382
125446
  const html = readFileSync72(fd, "utf-8");
125383
- const normalized2 = ensureHfIds(html);
125447
+ const normalized3 = ensureHfIds(html);
125384
125448
  const idsBefore = (html.match(/\bdata-hf-id=/g) ?? []).length;
125385
- const idsAfter = (normalized2.match(/\bdata-hf-id=/g) ?? []).length;
125449
+ const idsAfter = (normalized3.match(/\bdata-hf-id=/g) ?? []).length;
125386
125450
  if (writable && idsAfter > idsBefore) {
125387
125451
  const mode = fstatSync22(fd).mode;
125388
125452
  closeSync22(fd);
125389
125453
  fd = null;
125390
- replaceFileAtomically(filePath, normalized2, mode);
125454
+ replaceFileAtomically(filePath, normalized3, mode);
125391
125455
  }
125392
- return normalized2;
125456
+ return normalized3;
125393
125457
  } catch (err) {
125394
125458
  console.warn("[hyperframes] stampFileHfIds: failed to stamp ids:", err);
125395
125459
  return null;
@@ -127286,22 +127350,79 @@ var init_dist9 = __esm({
127286
127350
  });
127287
127351
 
127288
127352
  // src/server/fileWatcher.ts
127289
- import { watch } from "fs";
127290
- import { join as join40 } from "path";
127353
+ import { lstatSync as lstatSync8, readdirSync as readdirSync18, watch } from "fs";
127354
+ import { join as join40, relative as relative13, sep as sep10 } from "path";
127291
127355
  function shouldWatchProjectFile(filename) {
127292
127356
  if (!filename) return false;
127293
127357
  const parts = filename.split(/[\\/]+/);
127294
127358
  return !parts.some((part) => WATCHER_EXCLUDED_DIRS.has(part));
127295
127359
  }
127360
+ function isDirectory(path) {
127361
+ try {
127362
+ return lstatSync8(path).isDirectory();
127363
+ } catch {
127364
+ return false;
127365
+ }
127366
+ }
127367
+ function watchProjectTree(projectDir, onChange) {
127368
+ if (process.platform !== "linux") {
127369
+ const tree = watch(projectDir, { recursive: true }, (_event, filename) => {
127370
+ if (filename) onChange(filename.toString());
127371
+ });
127372
+ tree.on("error", () => tree.close());
127373
+ return () => tree.close();
127374
+ }
127375
+ const directories = /* @__PURE__ */ new Map();
127376
+ const unwatch = (dir) => {
127377
+ for (const [watched, watcher] of directories) {
127378
+ if (watched === dir || watched.startsWith(dir + sep10)) {
127379
+ watcher.close();
127380
+ directories.delete(watched);
127381
+ }
127382
+ }
127383
+ };
127384
+ const watchDirectory = (dir) => {
127385
+ if (directories.has(dir)) return;
127386
+ let watcher;
127387
+ try {
127388
+ watcher = watch(dir, { persistent: true }, (event, name) => {
127389
+ if (!name) return;
127390
+ const path = join40(dir, name.toString());
127391
+ onChange(relative13(projectDir, path));
127392
+ if (event !== "rename") return;
127393
+ if (isDirectory(path)) descend(path);
127394
+ else unwatch(path);
127395
+ });
127396
+ } catch (error) {
127397
+ if (dir === projectDir) throw error;
127398
+ return;
127399
+ }
127400
+ watcher.on("error", () => unwatch(dir));
127401
+ directories.set(dir, watcher);
127402
+ let entries2 = [];
127403
+ try {
127404
+ entries2 = readdirSync18(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join40(dir, entry.name));
127405
+ } catch {
127406
+ }
127407
+ for (const child of entries2) descend(child);
127408
+ };
127409
+ const descend = (dir) => {
127410
+ const rel = relative13(projectDir, dir);
127411
+ if (shouldWatchProjectFile(rel) || rel === ".hyperframes") watchDirectory(dir);
127412
+ };
127413
+ watchDirectory(projectDir);
127414
+ return () => {
127415
+ for (const watcher of directories.values()) watcher.close();
127416
+ directories.clear();
127417
+ };
127418
+ }
127296
127419
  function createProjectWatcher(projectDir) {
127297
127420
  const listeners = /* @__PURE__ */ new Set();
127298
127421
  const pendingPaths = /* @__PURE__ */ new Set();
127299
127422
  let debounceTimer = null;
127300
- let watcher = null;
127423
+ let closeTree = null;
127301
127424
  try {
127302
- watcher = watch(projectDir, { recursive: true }, (_event, filename) => {
127303
- if (!filename) return;
127304
- const relativePath = filename.toString();
127425
+ closeTree = watchProjectTree(projectDir, (relativePath) => {
127305
127426
  if (!shouldWatchProjectFile(relativePath) && !affectsProjectSignature(projectDir, join40(projectDir, relativePath))) {
127306
127427
  return;
127307
127428
  }
@@ -127318,10 +127439,6 @@ function createProjectWatcher(projectDir) {
127318
127439
  }
127319
127440
  }, DEBOUNCE_MS);
127320
127441
  });
127321
- watcher.on("error", () => {
127322
- watcher?.close();
127323
- watcher = null;
127324
- });
127325
127442
  } catch {
127326
127443
  }
127327
127444
  return {
@@ -127334,7 +127451,7 @@ function createProjectWatcher(projectDir) {
127334
127451
  close() {
127335
127452
  if (debounceTimer) clearTimeout(debounceTimer);
127336
127453
  pendingPaths.clear();
127337
- watcher?.close();
127454
+ closeTree?.();
127338
127455
  listeners.clear();
127339
127456
  }
127340
127457
  };
@@ -127784,7 +127901,7 @@ import {
127784
127901
  existsSync as existsSync40,
127785
127902
  mkdirSync as mkdirSync17,
127786
127903
  readFileSync as readFileSync27,
127787
- readdirSync as readdirSync18,
127904
+ readdirSync as readdirSync19,
127788
127905
  rmSync as rmSync14,
127789
127906
  statSync as statSync17,
127790
127907
  utimesSync as utimesSync3,
@@ -128013,7 +128130,7 @@ function findFromPuppeteerCache() {
128013
128130
  if (!executable) return void 0;
128014
128131
  let versions;
128015
128132
  try {
128016
- versions = [...readdirSync18(PUPPETEER_CACHE_DIR)].sort(compareVersionDirsDescending);
128133
+ versions = [...readdirSync19(PUPPETEER_CACHE_DIR)].sort(compareVersionDirsDescending);
128017
128134
  } catch {
128018
128135
  return void 0;
128019
128136
  }
@@ -128791,7 +128908,7 @@ var init_compositionFps = __esm({
128791
128908
 
128792
128909
  // src/utils/renderArgs.ts
128793
128910
  import { readFileSync as readFileSync29 } from "fs";
128794
- import { resolve as resolve26, sep as sep10 } from "path";
128911
+ import { resolve as resolve26, sep as sep11 } from "path";
128795
128912
  function parseBrowserTimeoutMsArg(raw) {
128796
128913
  if (raw == null) return { ok: true, value: void 0 };
128797
128914
  const parsed = Number(raw);
@@ -128861,7 +128978,7 @@ function parseCompositionEntryArg(raw, projectDir, stat) {
128861
128978
  if (!trimmed) return { ok: true, value: void 0 };
128862
128979
  const absProjectDir = resolve26(projectDir);
128863
128980
  const entryPath = resolve26(absProjectDir, trimmed);
128864
- if (entryPath !== absProjectDir && !entryPath.startsWith(absProjectDir + sep10)) {
128981
+ if (entryPath !== absProjectDir && !entryPath.startsWith(absProjectDir + sep11)) {
128865
128982
  return { ok: false, error: { kind: "outside-project", entryFile: trimmed } };
128866
128983
  }
128867
128984
  let entryStat;
@@ -129442,11 +129559,11 @@ import {
129442
129559
  } from "fs";
129443
129560
  import { promisify as promisify6 } from "util";
129444
129561
  import { Readable as Readable3 } from "stream";
129445
- import { join as join44, extname as extname10, resolve as resolve28, sep as sep11 } from "path";
129562
+ import { join as join44, extname as extname10, resolve as resolve28, sep as sep12 } from "path";
129446
129563
  function isPathInside2(child, parent, options = {}) {
129447
129564
  const { resolveSymlinks = false, pathModule } = options;
129448
129565
  const resolveFn = pathModule?.resolve ?? resolve28;
129449
- const separator = pathModule?.sep ?? sep11;
129566
+ const separator = pathModule?.sep ?? sep12;
129450
129567
  const resolvedChild = resolveFn(child);
129451
129568
  const resolvedParent = resolveFn(parent);
129452
129569
  const normalizedChild = resolveSymlinks && existsSync44(resolvedChild) ? realpathSync9.native(resolvedChild) : resolvedChild;
@@ -130163,7 +130280,7 @@ import {
130163
130280
  symlinkSync as symlinkSync2,
130164
130281
  writeFileSync as writeFileSync16
130165
130282
  } from "fs";
130166
- import { basename as basename11, dirname as dirname20, isAbsolute as isAbsolute11, join as join46, relative as relative13, resolve as resolve29 } from "path";
130283
+ import { basename as basename11, dirname as dirname20, isAbsolute as isAbsolute11, join as join46, relative as relative14, resolve as resolve29 } from "path";
130167
130284
  function resolveBrowserMediaEnd(start, end, duration) {
130168
130285
  return Number.isFinite(duration) && duration > 0 ? start + duration : end;
130169
130286
  }
@@ -130381,7 +130498,7 @@ var init_shared = __esm({
130381
130498
  join: join46,
130382
130499
  dirname: dirname20,
130383
130500
  basename: basename11,
130384
- relative: relative13,
130501
+ relative: relative14,
130385
130502
  isAbsolute: isAbsolute11
130386
130503
  };
130387
130504
  materializeFileSystem = {
@@ -130607,7 +130724,7 @@ import {
130607
130724
  mkdtempSync as mkdtempSync9,
130608
130725
  openSync as openSync10,
130609
130726
  readSync as readSync3,
130610
- readdirSync as readdirSync19,
130727
+ readdirSync as readdirSync20,
130611
130728
  renameSync as renameSync10,
130612
130729
  rmSync as rmSync16
130613
130730
  } from "fs";
@@ -130655,7 +130772,7 @@ function assertReadableNonEmptyFile(path) {
130655
130772
  function collectDirectoryFiles(root) {
130656
130773
  const files = [];
130657
130774
  const visit = (directory) => {
130658
- for (const entry of readdirSync19(directory, { withFileTypes: true })) {
130775
+ for (const entry of readdirSync20(directory, { withFileTypes: true })) {
130659
130776
  const path = join47(directory, entry.name);
130660
130777
  if (entry.isDirectory()) visit(path);
130661
130778
  else if (entry.isFile()) files.push(path);
@@ -137957,8 +138074,8 @@ function extractExistingFontFaces(html) {
137957
138074
  if (semicolon2 < 0) break;
137958
138075
  const end = html.indexOf("}", semicolon2 + 1);
137959
138076
  if (end < 0) break;
137960
- const normalized2 = normalizeFamilyName(html.slice(valueStart, semicolon2));
137961
- if (normalized2) families.add(normalized2);
138077
+ const normalized3 = normalizeFamilyName(html.slice(valueStart, semicolon2));
138078
+ if (normalized3) families.add(normalized3);
137962
138079
  opening.lastIndex = end + 1;
137963
138080
  }
137964
138081
  return families;
@@ -137971,10 +138088,10 @@ function extractRequestedFontFamilies(html) {
137971
138088
  declaration,
137972
138089
  customProperties
137973
138090
  )) {
137974
- const normalized2 = originalCase.toLowerCase();
137975
- if (!normalized2 || GENERIC_FAMILIES2.has(normalized2)) continue;
137976
- if (normalized2.startsWith("var(")) continue;
137977
- if (!requested.has(normalized2)) requested.set(normalized2, originalCase);
138091
+ const normalized3 = originalCase.toLowerCase();
138092
+ if (!normalized3 || GENERIC_FAMILIES2.has(normalized3)) continue;
138093
+ if (normalized3.startsWith("var(")) continue;
138094
+ if (!requested.has(normalized3)) requested.set(normalized3, originalCase);
137978
138095
  }
137979
138096
  }
137980
138097
  return requested;
@@ -138757,11 +138874,11 @@ function hasGifExtension(src) {
138757
138874
  function readLoopOverride(el) {
138758
138875
  const raw = el.getAttribute("data-loop");
138759
138876
  if (raw == null) return null;
138760
- const normalized2 = raw.trim().toLowerCase();
138761
- if (normalized2 === "" || normalized2 === "true" || normalized2 === "1" || normalized2 === "yes") {
138877
+ const normalized3 = raw.trim().toLowerCase();
138878
+ if (normalized3 === "" || normalized3 === "true" || normalized3 === "1" || normalized3 === "yes") {
138762
138879
  return true;
138763
138880
  }
138764
- if (normalized2 === "false" || normalized2 === "0" || normalized2 === "no") {
138881
+ if (normalized3 === "false" || normalized3 === "0" || normalized3 === "no") {
138765
138882
  return false;
138766
138883
  }
138767
138884
  return null;
@@ -139241,7 +139358,7 @@ var init_assetMediaType = __esm({
139241
139358
  // ../producer/src/services/htmlCompiler.ts
139242
139359
  import { createHash as createHash17 } from "crypto";
139243
139360
  import { createReadStream as createReadStream5, existsSync as existsSync54, mkdirSync as mkdirSync26, readFileSync as readFileSync37 } from "fs";
139244
- import { join as join58, dirname as dirname25, resolve as resolve33, basename as basename13, relative as relative14 } from "path";
139361
+ import { join as join58, dirname as dirname25, resolve as resolve33, basename as basename13, relative as relative15 } from "path";
139245
139362
  function logRemoteDownloadTelemetry(event) {
139246
139363
  defaultLogger.info("[Compiler] Remote asset download integrity", { ...event });
139247
139364
  }
@@ -140227,7 +140344,7 @@ function rewriteUnresolvableGsapToCdn(html, projectDir) {
140227
140344
  }
140228
140345
  function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
140229
140346
  if (!isPathInside3(htmlPath, projectDir)) return html;
140230
- const entryPath = relative14(projectDir, htmlPath).replace(/\\/g, "/");
140347
+ const entryPath = relative15(projectDir, htmlPath).replace(/\\/g, "/");
140231
140348
  if (!entryPath.includes("/")) return html;
140232
140349
  const { document: document2 } = parseHTML(html);
140233
140350
  const assetExists = (path) => existsSync54(resolve33(projectDir, path));
@@ -142086,7 +142203,7 @@ var init_audioStage = __esm({
142086
142203
  });
142087
142204
 
142088
142205
  // ../producer/src/services/render/stages/captureStage.ts
142089
- import { existsSync as existsSync56, readdirSync as readdirSync20, statfsSync as statfsSync3 } from "fs";
142206
+ import { existsSync as existsSync56, readdirSync as readdirSync21, statfsSync as statfsSync3 } from "fs";
142090
142207
  import { join as join64 } from "path";
142091
142208
  function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
142092
142209
  return workerCount > 1;
@@ -142138,14 +142255,14 @@ function assertDiskCaptureHeadroom(framesDir, totalFrames, captureOptions, freeD
142138
142255
  function measureCaptureFrameBytes(workDir, framesDir) {
142139
142256
  let total = sampleDirectoryBytes(framesDir);
142140
142257
  if (!existsSync56(workDir)) return total;
142141
- for (const attempt of readdirSync20(workDir)) {
142258
+ for (const attempt of readdirSync21(workDir)) {
142142
142259
  if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
142143
142260
  total += sampleDirectoryBytes(join64(workDir, attempt));
142144
142261
  continue;
142145
142262
  }
142146
142263
  if (!/^capture-attempt-\d+$/.test(attempt)) continue;
142147
142264
  const attemptDir = join64(workDir, attempt);
142148
- for (const name of readdirSync20(attemptDir)) {
142265
+ for (const name of readdirSync21(attemptDir)) {
142149
142266
  if (/^worker-\d+$/.test(name)) total += sampleDirectoryBytes(join64(attemptDir, name));
142150
142267
  }
142151
142268
  }
@@ -143466,7 +143583,7 @@ var init_gifEncodeArgs = __esm({
143466
143583
  });
143467
143584
 
143468
143585
  // ../producer/src/services/render/stages/encodeStage.ts
143469
- import { copyFileSync as copyFileSync5, existsSync as existsSync59, mkdirSync as mkdirSync28, readdirSync as readdirSync21, rmSync as rmSync21, statSync as statSync24 } from "fs";
143586
+ import { copyFileSync as copyFileSync5, existsSync as existsSync59, mkdirSync as mkdirSync28, readdirSync as readdirSync23, rmSync as rmSync21, statSync as statSync24 } from "fs";
143470
143587
  import { dirname as dirname27, join as join70 } from "path";
143471
143588
  function resolveGifLoop(loop) {
143472
143589
  const resolved2 = loop ?? 0;
@@ -143477,7 +143594,7 @@ function resolveGifLoop(loop) {
143477
143594
  }
143478
143595
  async function encodeGifFromDir(framesDir, framePattern, outputPath, input2) {
143479
143596
  const startTime = Date.now();
143480
- const files = readdirSync21(framesDir).filter((file) => file.match(/\.(jpg|jpeg|png)$/i));
143597
+ const files = readdirSync23(framesDir).filter((file) => file.match(/\.(jpg|jpeg|png)$/i));
143481
143598
  const frameCount = files.length;
143482
143599
  if (frameCount === 0) {
143483
143600
  return {
@@ -143568,7 +143685,7 @@ async function runEncodeStage(input2) {
143568
143685
  if (isPngSequence) {
143569
143686
  updateJobStatus(job, "encoding", "Writing PNG sequence", 75, onProgress);
143570
143687
  if (!existsSync59(outputPath)) mkdirSync28(outputPath, { recursive: true });
143571
- const captured = readdirSync21(framesDir).filter((name) => name.endsWith(".png")).sort();
143688
+ const captured = readdirSync23(framesDir).filter((name) => name.endsWith(".png")).sort();
143572
143689
  if (captured.length === 0) {
143573
143690
  throw new Error(
143574
143691
  `[Render] png-sequence output requested but no PNGs were captured to ${framesDir}`
@@ -144192,7 +144309,7 @@ import {
144192
144309
  mkdirSync as mkdirSync29,
144193
144310
  mkdtempSync as mkdtempSync14,
144194
144311
  readFileSync as readFileSync38,
144195
- readdirSync as readdirSync23,
144312
+ readdirSync as readdirSync24,
144196
144313
  rmSync as rmSync24,
144197
144314
  statSync as statSync25,
144198
144315
  writeFileSync as writeFileSync20,
@@ -144212,7 +144329,7 @@ function sampleDirectoryBytes(dir) {
144212
144329
  if (!current2) continue;
144213
144330
  let entries2 = [];
144214
144331
  try {
144215
- entries2 = readdirSync23(current2);
144332
+ entries2 = readdirSync24(current2);
144216
144333
  } catch {
144217
144334
  continue;
144218
144335
  }
@@ -147422,7 +147539,7 @@ import {
147422
147539
  closeSync as closeSync13,
147423
147540
  constants as constants7
147424
147541
  } from "fs";
147425
- import { resolve as resolve35, join as join74, relative as relative15, isAbsolute as isAbsolute13, sep as sep12 } from "path";
147542
+ import { resolve as resolve35, join as join74, relative as relative16, isAbsolute as isAbsolute13, sep as sep13 } from "path";
147426
147543
  function isStringRecord2(value) {
147427
147544
  if (!value || typeof value !== "object" || Array.isArray(value)) {
147428
147545
  return false;
@@ -147475,8 +147592,8 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
147475
147592
  );
147476
147593
  for (const entryFile of entryCandidates) {
147477
147594
  const absoluteEntryPath = resolve35(absProjectDir, entryFile);
147478
- const entryRelativePath = relative15(absProjectDir, absoluteEntryPath);
147479
- if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep12}`) || isAbsolute13(entryRelativePath)) {
147595
+ const entryRelativePath = relative16(absProjectDir, absoluteEntryPath);
147596
+ if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep13}`) || isAbsolute13(entryRelativePath)) {
147480
147597
  return { error: `Entry file must stay inside project directory: ${entryFile}` };
147481
147598
  }
147482
147599
  const html = readEntryHtml(absoluteEntryPath);
@@ -147788,11 +147905,11 @@ function validateOutputResolutionOverride(body) {
147788
147905
  if (typeof body.outputResolution !== "string") {
147789
147906
  return 'outputResolution must be a string preset (e.g. "4k", "landscape-4k")';
147790
147907
  }
147791
- const normalized2 = normalizeResolutionFlag(body.outputResolution);
147792
- if (body.outputResolution.trim().length > 0 && normalized2 === void 0) {
147908
+ const normalized3 = normalizeResolutionFlag(body.outputResolution);
147909
+ if (body.outputResolution.trim().length > 0 && normalized3 === void 0) {
147793
147910
  return `Invalid outputResolution "${body.outputResolution}". Must be one of: landscape, portrait, landscape-4k, portrait-4k, square, square-4k (aliases: 1080p, 4k, \u2026).`;
147794
147911
  }
147795
- if (normalized2 !== void 0 && (body.format === "webm" || body.format === "mov")) {
147912
+ if (normalized3 !== void 0 && (body.format === "webm" || body.format === "mov")) {
147796
147913
  return `outputResolution is not supported with format "${body.format}" \u2014 the alpha (webm/mov) capture path can't supersample. Use format "mp4", or omit outputResolution to render at the composition's native dimensions.`;
147797
147914
  }
147798
147915
  return void 0;
@@ -148471,8 +148588,8 @@ var init_planHash = __esm({
148471
148588
  });
148472
148589
 
148473
148590
  // ../producer/src/services/render/stages/freezePlan.ts
148474
- import { existsSync as existsSync65, mkdirSync as mkdirSync31, readFileSync as readFileSync40, readdirSync as readdirSync24, writeFileSync as writeFileSync23 } from "fs";
148475
- import { join as join77, relative as relative16, resolve as resolve37 } from "path";
148591
+ import { existsSync as existsSync65, mkdirSync as mkdirSync31, readFileSync as readFileSync40, readdirSync as readdirSync25, writeFileSync as writeFileSync23 } from "fs";
148592
+ import { join as join77, relative as relative17, resolve as resolve37 } from "path";
148476
148593
  function stripUndefined(value) {
148477
148594
  if (Array.isArray(value)) return value.map(stripUndefined);
148478
148595
  if (value !== null && typeof value === "object") {
@@ -148491,14 +148608,14 @@ function listPlanFiles(planDir) {
148491
148608
  const results = [];
148492
148609
  const rootResolved = resolve37(planDir);
148493
148610
  function walk2(dir) {
148494
- const entries2 = readdirSync24(dir, { withFileTypes: true });
148611
+ const entries2 = readdirSync25(dir, { withFileTypes: true });
148495
148612
  for (const entry of entries2) {
148496
148613
  const full2 = join77(dir, entry.name);
148497
148614
  if (entry.isDirectory()) {
148498
148615
  walk2(full2);
148499
148616
  } else if (entry.isFile()) {
148500
148617
  results.push({
148501
- planRelativePath: relative16(rootResolved, full2).split(/[\\/]+/).join("/"),
148618
+ planRelativePath: relative17(rootResolved, full2).split(/[\\/]+/).join("/"),
148502
148619
  absolutePath: full2
148503
148620
  });
148504
148621
  }
@@ -148911,8 +149028,8 @@ var init_shared2 = __esm({
148911
149028
 
148912
149029
  // ../producer/src/services/distributed/planSize.ts
148913
149030
  import { createHash as createHash19 } from "crypto";
148914
- import { lstatSync as lstatSync8, readdirSync as readdirSync25 } from "fs";
148915
- import { extname as extname13, join as join79, relative as relative17 } from "path";
149031
+ import { lstatSync as lstatSync9, readdirSync as readdirSync26 } from "fs";
149032
+ import { extname as extname13, join as join79, relative as relative18 } from "path";
148916
149033
  function hashComponent(value) {
148917
149034
  return createHash19("sha256").update(value).digest("hex").slice(0, 12);
148918
149035
  }
@@ -148969,13 +149086,13 @@ function addCategoryBytes(result, category, filePath, sizeBytes) {
148969
149086
  function recordFile(result, components, rootDir, rootKind, filePath) {
148970
149087
  let sizeBytes;
148971
149088
  try {
148972
- const stat = lstatSync8(filePath);
149089
+ const stat = lstatSync9(filePath);
148973
149090
  if (!stat.isFile()) return;
148974
149091
  sizeBytes = stat.size;
148975
149092
  } catch {
148976
149093
  return;
148977
149094
  }
148978
- const rel = relative17(rootDir, filePath);
149095
+ const rel = relative18(rootDir, filePath);
148979
149096
  const segments = rel.split(/[\\/]+/).filter(Boolean);
148980
149097
  const classified = classifyFile(segments, rootKind);
148981
149098
  result.totalBytes += sizeBytes;
@@ -148993,7 +149110,7 @@ function recordFile(result, components, rootDir, rootKind, filePath) {
148993
149110
  function walkRegularFiles(dir, visit) {
148994
149111
  let entries2;
148995
149112
  try {
148996
- entries2 = readdirSync25(dir, { withFileTypes: true });
149113
+ entries2 = readdirSync26(dir, { withFileTypes: true });
148997
149114
  } catch {
148998
149115
  return;
148999
149116
  }
@@ -149052,7 +149169,7 @@ var init_planSize = __esm({
149052
149169
 
149053
149170
  // ../producer/src/services/distributed/plan.ts
149054
149171
  import { cpSync as cpSync3, existsSync as existsSync67, mkdirSync as mkdirSync33, renameSync as renameSync15, rmSync as rmSync26, writeFileSync as writeFileSync24 } from "fs";
149055
- import { join as join80, relative as relative18, sep as sep13 } from "path";
149172
+ import { join as join80, relative as relative19, sep as sep14 } from "path";
149056
149173
  function applyDistributedAudioWarningPolicy(job, audioError, audioFailures = [], log2 = defaultLogger) {
149057
149174
  const failureOwner = audioFailures.length === 0 ? void 0 : audioFailures.some((failure) => failure.owner === "system") ? "system" : "user";
149058
149175
  const retryable = audioFailures.length === 0 ? void 0 : audioFailures.every((failure) => failure.retryable);
@@ -149292,9 +149409,9 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
149292
149409
  recursive: true,
149293
149410
  dereference: true,
149294
149411
  filter: (src) => {
149295
- const rel = relative18(projectDir, src);
149412
+ const rel = relative19(projectDir, src);
149296
149413
  if (rel === "" || rel.startsWith("..")) return true;
149297
- const firstSegment = rel.split(sep13, 1)[0];
149414
+ const firstSegment = rel.split(sep14, 1)[0];
149298
149415
  return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
149299
149416
  }
149300
149417
  });
@@ -149760,13 +149877,13 @@ import {
149760
149877
  closeSync as closeSync14,
149761
149878
  copyFileSync as copyFileSync8,
149762
149879
  existsSync as existsSync69,
149763
- lstatSync as lstatSync9,
149880
+ lstatSync as lstatSync10,
149764
149881
  mkdirSync as mkdirSync35,
149765
149882
  mkdtempSync as mkdtempSync17,
149766
149883
  openSync as openSync13,
149767
149884
  readFileSync as readFileSync43,
149768
149885
  readSync as readSync5,
149769
- readdirSync as readdirSync26,
149886
+ readdirSync as readdirSync27,
149770
149887
  renameSync as renameSync17,
149771
149888
  rmSync as rmSync28,
149772
149889
  statSync as statSync29,
@@ -149774,7 +149891,7 @@ import {
149774
149891
  } from "fs";
149775
149892
  import { createHash as createHash20 } from "crypto";
149776
149893
  import { tmpdir as tmpdir11 } from "os";
149777
- import { dirname as dirname35, isAbsolute as isAbsolute14, join as join84, relative as relative19, resolve as resolve38, sep as sep14 } from "path";
149894
+ import { dirname as dirname35, isAbsolute as isAbsolute14, join as join84, relative as relative20, resolve as resolve38, sep as sep15 } from "path";
149778
149895
  function isRecord8(value) {
149779
149896
  return value !== null && typeof value === "object" && !Array.isArray(value);
149780
149897
  }
@@ -149795,8 +149912,8 @@ function readJsonFile(path, label2) {
149795
149912
  }
149796
149913
  }
149797
149914
  function assertSafeRelativePath(path) {
149798
- const normalized2 = path.split(/[\\/]+/);
149799
- if (path.length === 0 || isAbsolute14(path) || normalized2.some((part) => part === "" || part === "." || part === "..")) {
149915
+ const normalized3 = path.split(/[\\/]+/);
149916
+ if (path.length === 0 || isAbsolute14(path) || normalized3.some((part) => part === "" || part === "." || part === "..")) {
149800
149917
  throw new PlanV2IntegrityError(`unsafe artifact path: ${JSON.stringify(path)}`);
149801
149918
  }
149802
149919
  }
@@ -149804,13 +149921,13 @@ function listFiles(root) {
149804
149921
  const files = [];
149805
149922
  const rootResolved = resolve38(root);
149806
149923
  function walk2(dir) {
149807
- for (const entry of readdirSync26(dir, { withFileTypes: true })) {
149924
+ for (const entry of readdirSync27(dir, { withFileTypes: true })) {
149808
149925
  const absolutePath = join84(dir, entry.name);
149809
149926
  if (entry.isDirectory()) {
149810
149927
  walk2(absolutePath);
149811
149928
  } else if (entry.isFile()) {
149812
149929
  files.push({
149813
- path: relative19(rootResolved, absolutePath).split(sep14).join("/"),
149930
+ path: relative20(rootResolved, absolutePath).split(sep15).join("/"),
149814
149931
  absolutePath
149815
149932
  });
149816
149933
  } else {
@@ -149839,7 +149956,7 @@ function sha256File(path) {
149839
149956
  return hash2.digest("hex");
149840
149957
  }
149841
149958
  function assertValidExtractionCacheCompleteSentinel(path) {
149842
- const sentinel = lstatSync9(path);
149959
+ const sentinel = lstatSync10(path);
149843
149960
  if (!sentinel.isFile() || sentinel.size !== 0) {
149844
149961
  throw new PlanV2IntegrityError(
149845
149962
  `${EXTRACTION_CACHE_COMPLETE_SENTINEL} must be a zero-byte regular file`
@@ -149849,10 +149966,10 @@ function assertValidExtractionCacheCompleteSentinel(path) {
149849
149966
  function validateExtractionCacheCompleteSentinels(executionPlanDir) {
149850
149967
  const videoRoot = join84(executionPlanDir, "video-frames");
149851
149968
  if (!existsSync69(videoRoot)) return;
149852
- for (const videoEntry of readdirSync26(videoRoot, { withFileTypes: true })) {
149969
+ for (const videoEntry of readdirSync27(videoRoot, { withFileTypes: true })) {
149853
149970
  if (!videoEntry.isDirectory()) continue;
149854
149971
  const videoDir = join84(videoRoot, videoEntry.name);
149855
- if (readdirSync26(videoDir).includes(EXTRACTION_CACHE_COMPLETE_SENTINEL)) {
149972
+ if (readdirSync27(videoDir).includes(EXTRACTION_CACHE_COMPLETE_SENTINEL)) {
149856
149973
  const sentinelPath = join84(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
149857
149974
  assertValidExtractionCacheCompleteSentinel(sentinelPath);
149858
149975
  }
@@ -149865,7 +149982,7 @@ function isExtractionCacheCompleteSentinelPath(path) {
149865
149982
  function resolveExtractedVideoOutputDir(planDir, videoId) {
149866
149983
  const videoRoot = resolve38(planDir, "video-frames");
149867
149984
  const outputDir = resolve38(videoRoot, videoId);
149868
- if (outputDir === videoRoot || !outputDir.startsWith(`${videoRoot}${sep14}`)) {
149985
+ if (outputDir === videoRoot || !outputDir.startsWith(`${videoRoot}${sep15}`)) {
149869
149986
  throw new PlanV2IntegrityError(`unsafe extracted video id: ${JSON.stringify(videoId)}`);
149870
149987
  }
149871
149988
  return outputDir;
@@ -149889,7 +150006,7 @@ function artifactTargets(path, videoDependencies) {
149889
150006
  function listVideoFramePaths(executionPlanDir, videos) {
149890
150007
  return videos.extracted.map((video) => {
149891
150008
  const outputDir = resolveExtractedVideoOutputDir(executionPlanDir, video.videoId);
149892
- const frameNames = readdirSync26(outputDir).sort();
150009
+ const frameNames = readdirSync27(outputDir).sort();
149893
150010
  const framePaths = /* @__PURE__ */ new Map();
149894
150011
  for (const frameName of frameNames) {
149895
150012
  if (frameName === EXTRACTION_CACHE_COMPLETE_SENTINEL) {
@@ -149982,7 +150099,7 @@ function buildVideoChunkDependencies(executionPlanDir, dimensions) {
149982
150099
  for (let frame = chunk.startFrame; frame < chunk.endFrame; frame++) {
149983
150100
  const globalTime = frame * fpsDen / fpsNum;
149984
150101
  for (const payload of table.getActiveFramePayloads(globalTime).values()) {
149985
- const path = relative19(resolve38(executionPlanDir), payload.framePath).split(sep14).join("/");
150102
+ const path = relative20(resolve38(executionPlanDir), payload.framePath).split(sep15).join("/");
149986
150103
  assertSafeRelativePath(path);
149987
150104
  const indexes = mutable.get(path) ?? /* @__PURE__ */ new Set();
149988
150105
  indexes.add(chunk.index);
@@ -150429,7 +150546,7 @@ import {
150429
150546
  mkdirSync as mkdirSync36,
150430
150547
  mkdtempSync as mkdtempSync18,
150431
150548
  readFileSync as readFileSync44,
150432
- readdirSync as readdirSync27,
150549
+ readdirSync as readdirSync28,
150433
150550
  rmSync as rmSync29,
150434
150551
  statSync as statSync30,
150435
150552
  writeFileSync as writeFileSync27
@@ -150639,7 +150756,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
150639
150756
  `[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
150640
150757
  );
150641
150758
  }
150642
- const frames = readdirSync27(chunkDir).filter((name) => name.endsWith(".png")).sort();
150759
+ const frames = readdirSync28(chunkDir).filter((name) => name.endsWith(".png")).sort();
150643
150760
  if (frames.length === 0) {
150644
150761
  throw new Error(`[assemble] png-sequence chunk has no frames: ${chunkDir}`);
150645
150762
  }
@@ -150659,7 +150776,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
150659
150776
  cpSync4(audioPath, sidecar);
150660
150777
  }
150661
150778
  let fileSize = 0;
150662
- for (const name of readdirSync27(outputPath)) {
150779
+ for (const name of readdirSync28(outputPath)) {
150663
150780
  try {
150664
150781
  fileSize += statSync30(join85(outputPath, name)).size;
150665
150782
  } catch {
@@ -150688,7 +150805,7 @@ var init_assemble = __esm({
150688
150805
 
150689
150806
  // ../producer/src/services/distributed/renderChunk.ts
150690
150807
  import { randomBytes } from "crypto";
150691
- import { existsSync as existsSync71, mkdirSync as mkdirSync37, readFileSync as readFileSync45, readdirSync as readdirSync28, rmSync as rmSync30, writeFileSync as writeFileSync28 } from "fs";
150808
+ import { existsSync as existsSync71, mkdirSync as mkdirSync37, readFileSync as readFileSync45, readdirSync as readdirSync29, rmSync as rmSync30, writeFileSync as writeFileSync28 } from "fs";
150692
150809
  import { extname as extname14, join as join86 } from "path";
150693
150810
  function validatePlanVideosForChunk(value) {
150694
150811
  try {
@@ -150764,7 +150881,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
150764
150881
  );
150765
150882
  }
150766
150883
  const ext = (extname14(v2.framePattern) || ".jpg").toLowerCase();
150767
- const frames = readdirSync28(outputDir).filter((name) => name.toLowerCase().endsWith(ext)).sort((left, right) => {
150884
+ const frames = readdirSync29(outputDir).filter((name) => name.toLowerCase().endsWith(ext)).sort((left, right) => {
150768
150885
  const leftNumber = frameNumberFromFileName(left);
150769
150886
  const rightNumber = frameNumberFromFileName(right);
150770
150887
  if (leftNumber === null || rightNumber === null) return left.localeCompare(right);
@@ -150799,7 +150916,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
150799
150916
  }
150800
150917
  function hashChunkOutput(outputPath, kind) {
150801
150918
  if (kind === "file") return sha256Hex(readFileSync45(outputPath));
150802
- const entries2 = readdirSync28(outputPath).filter((name) => /\.(png|jpg|jpeg)$/i.test(name)).sort();
150919
+ const entries2 = readdirSync29(outputPath).filter((name) => /\.(png|jpg|jpeg)$/i.test(name)).sort();
150803
150920
  const lines = entries2.map(
150804
150921
  (name) => `${name}\0${sha256Hex(readFileSync45(join86(outputPath, name)))}`
150805
150922
  );
@@ -151328,9 +151445,9 @@ var init_planV2Execution = __esm({
151328
151445
  });
151329
151446
 
151330
151447
  // ../producer/src/services/distributed/projectHash.ts
151331
- import { readdirSync as readdirSync29, readFileSync as readFileSync46 } from "fs";
151448
+ import { readdirSync as readdirSync30, readFileSync as readFileSync46 } from "fs";
151332
151449
  import { createHash as createHash21 } from "crypto";
151333
- import { join as join88, relative as relative20 } from "path";
151450
+ import { join as join88, relative as relative21 } from "path";
151334
151451
  var init_projectHash = __esm({
151335
151452
  "../producer/src/services/distributed/projectHash.ts"() {
151336
151453
  "use strict";
@@ -151467,7 +151584,7 @@ import { randomUUID as randomUUID12 } from "crypto";
151467
151584
  import {
151468
151585
  existsSync as existsSync73,
151469
151586
  mkdirSync as mkdirSync38,
151470
- readdirSync as readdirSync30,
151587
+ readdirSync as readdirSync31,
151471
151588
  readFileSync as readFileSync47,
151472
151589
  renameSync as renameSync18,
151473
151590
  rmSync as rmSync33,
@@ -151541,7 +151658,7 @@ function sweepStaleStaging(dir) {
151541
151658
  const prefix = `${basename14(dir)}.tmp-`;
151542
151659
  const parent = dirname37(dir);
151543
151660
  if (!existsSync73(parent)) return;
151544
- for (const entry of readdirSync30(parent)) {
151661
+ for (const entry of readdirSync31(parent)) {
151545
151662
  if (!entry.startsWith(prefix)) continue;
151546
151663
  const pid = /^(\d+)(?:-|$)/.exec(entry.slice(prefix.length))?.[1];
151547
151664
  if (pid === void 0 || isProcessAlive(Number(pid))) continue;
@@ -152952,7 +153069,7 @@ __export(preview_exports, {
152952
153069
  waitForStudioChildClose: () => waitForStudioChildClose
152953
153070
  });
152954
153071
  import { spawn as spawn16 } from "child_process";
152955
- import { existsSync as existsSync76, lstatSync as lstatSync10, mkdirSync as mkdirSync40, readlinkSync, symlinkSync as symlinkSync3, unlinkSync as unlinkSync7 } from "fs";
153072
+ import { existsSync as existsSync76, lstatSync as lstatSync11, mkdirSync as mkdirSync40, readlinkSync, symlinkSync as symlinkSync3, unlinkSync as unlinkSync7 } from "fs";
152956
153073
  import { resolve as resolve40, dirname as dirname38, basename as basename16, join as join93 } from "path";
152957
153074
  import { fileURLToPath as fileURLToPath9 } from "url";
152958
153075
  import { createRequire as createRequire4 } from "module";
@@ -153468,7 +153585,7 @@ function linkProjectIntoStudioData(dir, projectsDir, projectName) {
153468
153585
  if (dir !== symlinkPath) {
153469
153586
  if (existsSync76(symlinkPath)) {
153470
153587
  try {
153471
- const stat = lstatSync10(symlinkPath);
153588
+ const stat = lstatSync11(symlinkPath);
153472
153589
  if (stat.isSymbolicLink() && resolve40(readlinkSync(symlinkPath)) !== resolve40(dir)) {
153473
153590
  unlinkSync7(symlinkPath);
153474
153591
  }
@@ -154247,7 +154364,7 @@ import {
154247
154364
  cpSync as cpSync5,
154248
154365
  writeFileSync as writeFileSync31,
154249
154366
  readFileSync as readFileSync49,
154250
- readdirSync as readdirSync31
154367
+ readdirSync as readdirSync33
154251
154368
  } from "fs";
154252
154369
  import { resolve as resolve41, basename as basename17, join as join94, dirname as dirname39 } from "path";
154253
154370
  import { fileURLToPath as fileURLToPath10 } from "url";
@@ -154364,8 +154481,8 @@ function getSharedTemplateDir() {
154364
154481
  return resolveAssetDir(["..", "templates", "_shared"], ["templates", "_shared"]);
154365
154482
  }
154366
154483
  function toPackageName(projectName) {
154367
- const normalized2 = basename17(projectName).trim().toLowerCase().replace(/^[._]+/, "").replace(/[^a-z0-9._~-]+/g, "-").replace(/-+/g, "-").replace(/^[-.]+|[-.]+$/g, "");
154368
- return normalized2 || "hyperframes-project";
154484
+ const normalized3 = basename17(projectName).trim().toLowerCase().replace(/^[._]+/, "").replace(/[^a-z0-9._~-]+/g, "-").replace(/-+/g, "-").replace(/^[-.]+|[-.]+$/g, "");
154485
+ return normalized3 || "hyperframes-project";
154369
154486
  }
154370
154487
  function getHyperframesPackageSpecifier() {
154371
154488
  return VERSION === "0.0.0-dev" ? "hyperframes" : `hyperframes@${VERSION}`;
@@ -154403,7 +154520,7 @@ function listHtmlFiles(dir) {
154403
154520
  const files = [];
154404
154521
  const ignoredDirs = /* @__PURE__ */ new Set([".git", "dist", "node_modules"]);
154405
154522
  function walk2(currentDir) {
154406
- for (const entry of readdirSync31(currentDir, { withFileTypes: true })) {
154523
+ for (const entry of readdirSync33(currentDir, { withFileTypes: true })) {
154407
154524
  const entryPath = join94(currentDir, entry.name);
154408
154525
  if (entry.isDirectory()) {
154409
154526
  if (!ignoredDirs.has(entry.name)) walk2(entryPath);
@@ -154449,7 +154566,7 @@ function writeTailwindSupport(destDir) {
154449
154566
  }
154450
154567
  }
154451
154568
  function patchVideoSrc(dir, videoFilename, durationSeconds) {
154452
- const htmlFiles = readdirSync31(dir, { withFileTypes: true, recursive: true }).filter((e2) => e2.isFile() && e2.name.endsWith(".html")).map((e2) => join94(e2.parentPath, e2.name));
154569
+ const htmlFiles = readdirSync33(dir, { withFileTypes: true, recursive: true }).filter((e2) => e2.isFile() && e2.name.endsWith(".html")).map((e2) => join94(e2.parentPath, e2.name));
154453
154570
  for (const file of htmlFiles) {
154454
154571
  let content = readFileSync49(file, "utf-8");
154455
154572
  if (videoFilename) {
@@ -154634,7 +154751,7 @@ async function scaffoldProject(destDir, name, templateId, localVideoName, durati
154634
154751
  writeDefaultPackageJson(destDir, name);
154635
154752
  const sharedDir = getSharedTemplateDir();
154636
154753
  if (existsSync77(sharedDir)) {
154637
- for (const entry of readdirSync31(sharedDir, { withFileTypes: true })) {
154754
+ for (const entry of readdirSync33(sharedDir, { withFileTypes: true })) {
154638
154755
  const src = join94(sharedDir, entry.name);
154639
154756
  const dest = resolve41(destDir, entry.name);
154640
154757
  if (entry.isFile() || entry.isSymbolicLink()) {
@@ -154849,7 +154966,7 @@ var init_init = __esm({
154849
154966
  const templateId2 = resolveScaffoldTemplateId(exampleFlag, Boolean(videoFlag || audioFlag));
154850
154967
  const name2 = args.name ?? "my-video";
154851
154968
  const destDir2 = resolve41(name2);
154852
- if (existsSync77(destDir2) && readdirSync31(destDir2).length > 0) {
154969
+ if (existsSync77(destDir2) && readdirSync33(destDir2).length > 0) {
154853
154970
  console.error(c.error(`Directory already exists and is not empty: ${name2}`));
154854
154971
  failCommand();
154855
154972
  }
@@ -154930,7 +155047,7 @@ var init_init = __esm({
154930
155047
  await patchTranscript(destDir2, transcriptFile2);
154931
155048
  }
154932
155049
  console.log(c.success(`Created ${c.accent(name2 + "/")}`));
154933
- for (const f of readdirSync31(destDir2).filter((f2) => !f2.startsWith("."))) {
155050
+ for (const f of readdirSync33(destDir2).filter((f2) => !f2.startsWith("."))) {
154934
155051
  console.log(` ${c.accent(f)}`);
154935
155052
  }
154936
155053
  if (!skipSkills) {
@@ -154990,7 +155107,7 @@ var init_init = __esm({
154990
155107
  name = nameResult;
154991
155108
  }
154992
155109
  const destDir = resolve41(name);
154993
- if (existsSync77(destDir) && readdirSync31(destDir).length > 0) {
155110
+ if (existsSync77(destDir) && readdirSync33(destDir).length > 0) {
154994
155111
  const overwrite = await ue({
154995
155112
  message: `Directory ${c.accent(name)} already exists and is not empty. Overwrite?`,
154996
155113
  initialValue: false
@@ -155122,7 +155239,7 @@ ${c.dim("Use --example blank for offline use.")}`
155122
155239
  if (existsSync77(transcriptFile)) {
155123
155240
  await patchTranscript(destDir, transcriptFile);
155124
155241
  }
155125
- const files = readdirSync31(destDir);
155242
+ const files = readdirSync33(destDir);
155126
155243
  Se(files.map((f) => c.accent(f)).join("\n"), c.success(`Created ${name}/`));
155127
155244
  if (!skipSkills) {
155128
155245
  await keepSkillsCurrent(destDir);
@@ -155197,7 +155314,7 @@ __export(add_exports, {
155197
155314
  runAdd: () => runAdd
155198
155315
  });
155199
155316
  import { existsSync as existsSync78 } from "fs";
155200
- import { resolve as resolve43, relative as relative21 } from "path";
155317
+ import { resolve as resolve43, relative as relative23 } from "path";
155201
155318
  function remapTarget(item, originalTarget, paths) {
155202
155319
  if (item.type === "hyperframes:block") {
155203
155320
  const blocksDir = paths.blocks.replace(/\/+$/, "");
@@ -155470,11 +155587,11 @@ var init_add = __esm({
155470
155587
  console.log(`${c.success("\u2713")} Added ${c.accent(result.name)} (${result.type})`);
155471
155588
  for (const file of result.preserved) {
155472
155589
  console.log(
155473
- ` ${c.warn("kept")} ${relative21(projectDir, file) || file} \u2014 you have edited this; --force to overwrite`
155590
+ ` ${c.warn("kept")} ${relative23(projectDir, file) || file} \u2014 you have edited this; --force to overwrite`
155474
155591
  );
155475
155592
  }
155476
155593
  for (const file of result.written) {
155477
- console.log(` ${c.dim(relative21(projectDir, file))}`);
155594
+ console.log(` ${c.dim(relative23(projectDir, file))}`);
155478
155595
  }
155479
155596
  if (result.variablesApplied.length > 0) {
155480
155597
  console.log(` ${c.dim(`variables applied: ${result.variablesApplied.join(", ")}`)}`);
@@ -155762,9 +155879,9 @@ function normalize(text2) {
155762
155879
  }
155763
155880
  return out.toLowerCase().normalize("NFD").replace(new RegExp("\\p{Mn}", "gu"), "");
155764
155881
  }
155765
- function preTokenize(normalized2) {
155882
+ function preTokenize(normalized3) {
155766
155883
  const words = [];
155767
- for (const chunk of normalized2.split(/\s+/)) {
155884
+ for (const chunk of normalized3.split(/\s+/)) {
155768
155885
  if (!chunk) continue;
155769
155886
  let current2 = "";
155770
155887
  for (const char of chunk) {
@@ -158677,8 +158794,8 @@ var init_projectLink = __esm({
158677
158794
  });
158678
158795
 
158679
158796
  // src/utils/publishProject.ts
158680
- import { basename as basename18, dirname as dirname44, join as join100, posix as posix4, relative as relative23, resolve as resolve49 } from "path";
158681
- import { existsSync as existsSync87, readdirSync as readdirSync33, readFileSync as readFileSync57, statSync as statSync33 } from "fs";
158797
+ import { basename as basename18, dirname as dirname44, join as join100, posix as posix4, relative as relative24, resolve as resolve49 } from "path";
158798
+ import { existsSync as existsSync87, readdirSync as readdirSync34, readFileSync as readFileSync57, statSync as statSync33 } from "fs";
158682
158799
  import AdmZip from "adm-zip";
158683
158800
  import ignore2 from "ignore";
158684
158801
  function isRecord9(value) {
@@ -158847,10 +158964,10 @@ function createProjectIgnore(rootDir) {
158847
158964
  return matcher;
158848
158965
  }
158849
158966
  function collectProjectFiles(rootDir, currentDir, paths, matcher) {
158850
- for (const entry of readdirSync33(currentDir, { withFileTypes: true })) {
158967
+ for (const entry of readdirSync34(currentDir, { withFileTypes: true })) {
158851
158968
  if (shouldIgnoreSegment(entry.name)) continue;
158852
158969
  const absolutePath = join100(currentDir, entry.name);
158853
- const relativePath = relative23(rootDir, absolutePath).replaceAll("\\", "/");
158970
+ const relativePath = relative24(rootDir, absolutePath).replaceAll("\\", "/");
158854
158971
  if (!relativePath) continue;
158855
158972
  if (entry.isDirectory()) {
158856
158973
  if (matcher.ignores(`${relativePath}/`)) continue;
@@ -158865,7 +158982,7 @@ function collectProjectFiles(rootDir, currentDir, paths, matcher) {
158865
158982
  function addExternalAsset(ctx, absPath) {
158866
158983
  const existing = ctx.externalMap.get(absPath);
158867
158984
  if (existing) return existing;
158868
- const rel = relative23(ctx.absProjectDir, absPath).replaceAll("\\", "/");
158985
+ const rel = relative24(ctx.absProjectDir, absPath).replaceAll("\\", "/");
158869
158986
  const stripped = rel.replace(/^(?:\.\.\/)+/, "");
158870
158987
  let archivePath = `${EXT_ASSETS_PREFIX}/${stripped}`;
158871
158988
  if (ctx.usedArchivePaths.has(archivePath)) {
@@ -159277,7 +159394,7 @@ __export(publish_exports, {
159277
159394
  examples: () => examples8,
159278
159395
  parseUpdateTarget: () => parseUpdateTarget
159279
159396
  });
159280
- import { join as join101, posix as posix5, relative as relative24, resolve as resolve51 } from "path";
159397
+ import { join as join101, posix as posix5, relative as relative25, resolve as resolve51 } from "path";
159281
159398
  import { existsSync as existsSync89 } from "fs";
159282
159399
  function parseUpdateTarget(value) {
159283
159400
  const trimmed = value.trim();
@@ -159494,7 +159611,7 @@ var init_publish = __esm({
159494
159611
  const file = writeTeamProject(dir, { projectId: published.projectId, spaceId });
159495
159612
  console.log();
159496
159613
  console.log(
159497
- ` ${c.dim(`Wrote ${relative24(dir, file) || file} \u2014 commit it so your team publishes to this link.`)}`
159614
+ ` ${c.dim(`Wrote ${relative25(dir, file) || file} \u2014 commit it so your team publishes to this link.`)}`
159498
159615
  );
159499
159616
  } catch {
159500
159617
  }
@@ -159539,7 +159656,7 @@ var init_publish = __esm({
159539
159656
 
159540
159657
  // src/utils/catalogUsage.ts
159541
159658
  import { readFileSync as readFileSync58 } from "fs";
159542
- import { isAbsolute as isAbsolute15, relative as relative25, resolve as resolve52 } from "path";
159659
+ import { isAbsolute as isAbsolute15, relative as relative26, resolve as resolve52 } from "path";
159543
159660
  function reachableCompositions(projectDir, entryPath) {
159544
159661
  const seen = /* @__PURE__ */ new Set();
159545
159662
  const queue = [resolve52(entryPath)];
@@ -159563,7 +159680,7 @@ function reachableCompositions(projectDir, entryPath) {
159563
159680
  function isReached(projectDir, target, reachable) {
159564
159681
  if (isAbsolute15(target)) return false;
159565
159682
  const abs = resolve52(projectDir, target);
159566
- if (relative25(projectDir, abs).startsWith("..")) return false;
159683
+ if (relative26(projectDir, abs).startsWith("..")) return false;
159567
159684
  return reachable.has(abs);
159568
159685
  }
159569
159686
  function reportableNames(names) {
@@ -159768,8 +159885,8 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
159768
159885
  }
159769
159886
  if (typeof args["frames-cache-dir"] === "string" && args["frames-cache-dir"].trim() !== "") {
159770
159887
  const raw = args["frames-cache-dir"].trim();
159771
- const normalized2 = raw.toLowerCase();
159772
- const isDisableAlias = EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized2);
159888
+ const normalized3 = raw.toLowerCase();
159889
+ const isDisableAlias = EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized3);
159773
159890
  environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve53(raw);
159774
159891
  }
159775
159892
  if (args["max-concurrent-renders"] != null) {
@@ -160178,7 +160295,7 @@ __export(batchRender_exports, {
160178
160295
  runBatchRender: () => runBatchRender
160179
160296
  });
160180
160297
  import { mkdirSync as mkdirSync46, readFileSync as readFileSync61, writeFileSync as writeFileSync35 } from "fs";
160181
- import { dirname as dirname47, join as join104, resolve as resolve55, sep as sep15 } from "path";
160298
+ import { dirname as dirname47, join as join104, resolve as resolve55, sep as sep16 } from "path";
160182
160299
  function isRecord10(value) {
160183
160300
  return value !== null && typeof value === "object" && !Array.isArray(value);
160184
160301
  }
@@ -160235,7 +160352,7 @@ function resolveOutputTemplate(template, row, index) {
160235
160352
  );
160236
160353
  }
160237
160354
  function isSameOrChildPath(path, parent) {
160238
- return path === parent || path.startsWith(parent.endsWith(sep15) ? parent : parent + sep15);
160355
+ return path === parent || path.startsWith(parent.endsWith(sep16) ? parent : parent + sep16);
160239
160356
  }
160240
160357
  function commonOutputDirectory(outputPaths) {
160241
160358
  const firstPath = outputPaths[0];
@@ -161284,7 +161401,7 @@ __export(render_exports, {
161284
161401
  resolveBrowserGpuForCli: () => resolveBrowserGpuForCli,
161285
161402
  runRenderLint: () => runRenderLint
161286
161403
  });
161287
- import { mkdtempSync as mkdtempSync20, readdirSync as readdirSync34, readFileSync as readFileSync64, statSync as statSync35, writeFileSync as writeFileSync36, rmSync as rmSync34 } from "fs";
161404
+ import { mkdtempSync as mkdtempSync20, readdirSync as readdirSync35, readFileSync as readFileSync64, statSync as statSync35, writeFileSync as writeFileSync36, rmSync as rmSync34 } from "fs";
161288
161405
  import { freemem as freemem5, tmpdir as tmpdir13 } from "os";
161289
161406
  import { resolve as resolve56, dirname as dirname48, join as join105, basename as basename20 } from "path";
161290
161407
  import { execFileSync as execFileSync12, spawn as spawn18 } from "child_process";
@@ -162125,7 +162242,7 @@ function readOutputFootprint(outputPath) {
162125
162242
  const stat = statSync35(outputPath);
162126
162243
  if (!stat.isDirectory()) return { fileSize: formatBytes(stat.size), isDirectory: false };
162127
162244
  let total = 0;
162128
- for (const entry of readdirSync34(outputPath, { withFileTypes: true })) {
162245
+ for (const entry of readdirSync35(outputPath, { withFileTypes: true })) {
162129
162246
  if (!entry.isFile()) continue;
162130
162247
  try {
162131
162248
  total += statSync35(join105(outputPath, entry.name)).size;
@@ -162140,11 +162257,11 @@ function readOutputFootprint(outputPath) {
162140
162257
  function printRenderComplete(input2) {
162141
162258
  if (input2.quiet) return;
162142
162259
  const { outputPath, elapsedMs, perf } = input2;
162143
- const { fileSize, isDirectory } = readOutputFootprint(outputPath);
162260
+ const { fileSize, isDirectory: isDirectory2 } = readOutputFootprint(outputPath);
162144
162261
  const detail = formatRenderSummaryDetail({
162145
162262
  elapsedMs,
162146
162263
  outputDurationSeconds: perf?.compositionDurationSeconds,
162147
- isDirectory,
162264
+ isDirectory: isDirectory2,
162148
162265
  frameCount: perf?.totalFrames,
162149
162266
  playlistDirectory: input2.format === "hls"
162150
162267
  });
@@ -162788,7 +162905,7 @@ __export(staticProjectServer_exports, {
162788
162905
  });
162789
162906
  import { createServer as createServer2 } from "http";
162790
162907
  import { createReadStream as createReadStream8, existsSync as existsSync90, statSync as statSync36 } from "fs";
162791
- import { isAbsolute as isAbsolute16, relative as relative26, resolve as resolve57 } from "path";
162908
+ import { isAbsolute as isAbsolute16, relative as relative27, resolve as resolve57 } from "path";
162792
162909
  function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
162793
162910
  const size = statSync36(filePath).size;
162794
162911
  const headers = {
@@ -162890,7 +163007,7 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
162890
163007
  const requestPath = decodeURIComponent(pathOnly).replace(/^\//, "");
162891
163008
  for (const root of roots) {
162892
163009
  const filePath = resolve57(root, requestPath);
162893
- const rel = relative26(root, filePath);
163010
+ const rel = relative27(root, filePath);
162894
163011
  if (rel.startsWith("..") || isAbsolute16(rel)) continue;
162895
163012
  if (existsSync90(filePath)) {
162896
163013
  if (proxyRequest) {
@@ -163161,8 +163278,8 @@ function formatOverflow(overflow) {
163161
163278
  }).join(", ");
163162
163279
  }
163163
163280
  function quoteText(text2) {
163164
- const normalized2 = text2.replace(/\s+/g, " ").trim();
163165
- const truncated = normalized2.length > 80 ? `${normalized2.slice(0, 77)}...` : normalized2;
163281
+ const normalized3 = text2.replace(/\s+/g, " ").trim();
163282
+ const truncated = normalized3.length > 80 ? `${normalized3.slice(0, 77)}...` : normalized3;
163166
163283
  return `"${truncated}"`;
163167
163284
  }
163168
163285
  function formatNumber(value) {
@@ -163394,7 +163511,7 @@ var init_motionAudit = __esm({
163394
163511
  });
163395
163512
 
163396
163513
  // src/utils/motionSpec.ts
163397
- import { existsSync as existsSync91, readFileSync as readFileSync66, readdirSync as readdirSync35 } from "fs";
163514
+ import { existsSync as existsSync91, readFileSync as readFileSync66, readdirSync as readdirSync36 } from "fs";
163398
163515
  import { basename as basename21, join as join107 } from "path";
163399
163516
  function isObject2(value) {
163400
163517
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -163438,7 +163555,7 @@ function parseMotionSpec(raw) {
163438
163555
  }
163439
163556
  function findMotionSpec(projectDir) {
163440
163557
  if (!existsSync91(projectDir)) return null;
163441
- const entries2 = readdirSync35(projectDir);
163558
+ const entries2 = readdirSync36(projectDir);
163442
163559
  const sidecars = entries2.filter((name) => name.endsWith(".motion.json")).sort();
163443
163560
  if (!sidecars[0]) return null;
163444
163561
  if (sidecars.length === 1) return join107(projectDir, sidecars[0]);
@@ -165550,7 +165667,7 @@ var init_checkBrowser = __esm({
165550
165667
 
165551
165668
  // src/utils/checkPipeline.ts
165552
165669
  import { mkdirSync as mkdirSync50, writeFileSync as writeFileSync39 } from "fs";
165553
- import { join as join111, relative as relative27 } from "path";
165670
+ import { join as join111, relative as relative28 } from "path";
165554
165671
  function selectContrastTimes(grid) {
165555
165672
  if (grid.length <= 5) return [...grid];
165556
165673
  return Array.from({ length: 5 }, (_, index) => {
@@ -166234,7 +166351,7 @@ async function runCheckPipeline(project, options, dependencies = DEFAULT_DEPENDE
166234
166351
  "motion_spec_invalid",
166235
166352
  "error",
166236
166353
  motion.message,
166237
- relative27(project.dir, motion.path) || "index.motion.json"
166354
+ relative28(project.dir, motion.path) || "index.motion.json"
166238
166355
  )
166239
166356
  ] : [];
166240
166357
  let browser;
@@ -167366,7 +167483,7 @@ __export(normalize_audio_exports, {
167366
167483
  });
167367
167484
  import { execFile as execFile9 } from "child_process";
167368
167485
  import { existsSync as existsSync97, readFileSync as readFileSync71, renameSync as renameSync19, writeFileSync as writeFileSync41 } from "fs";
167369
- import { isAbsolute as isAbsolute17, relative as relative28, resolve as resolve60 } from "path";
167486
+ import { isAbsolute as isAbsolute17, relative as relative29, resolve as resolve60 } from "path";
167370
167487
  import { promisify as promisify8 } from "util";
167371
167488
  function authoredNumber(raw, fallback, attribute2, id, strictlyPositive = false) {
167372
167489
  if (raw === void 0) return fallback;
@@ -167534,7 +167651,7 @@ function resolveLocalAudioPath(projectDir, src) {
167534
167651
  }
167535
167652
  const root = resolve60(projectDir);
167536
167653
  const file = resolve60(root, decoded);
167537
- const rel = relative28(root, file);
167654
+ const rel = relative29(root, file);
167538
167655
  if (!rel || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
167539
167656
  throw new Error(`Audio source must be a local project file: ${src}`);
167540
167657
  }
@@ -167651,7 +167768,7 @@ function requiredFfmpeg() {
167651
167768
  function existingAudioFile(projectDir, tag) {
167652
167769
  const file = resolveLocalAudioPath(projectDir, tag.src);
167653
167770
  if (!existsSync97(file)) {
167654
- throw new Error(`Audio #${tag.id} file was not found: ${relative28(projectDir, file)}`);
167771
+ throw new Error(`Audio #${tag.id} file was not found: ${relative29(projectDir, file)}`);
167655
167772
  }
167656
167773
  return file;
167657
167774
  }
@@ -167710,7 +167827,7 @@ function printHumanResult(result) {
167710
167827
  `Set #${result.targetId} data-volume ${result.previousVolume.toFixed(3)} \u2192 ${result.volume.toFixed(6)} (${result.changeDb >= 0 ? "+" : ""}${result.changeDb.toFixed(1)} dB).`
167711
167828
  );
167712
167829
  console.log(
167713
- result.wrote ? c.success(`Updated ${relative28(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
167830
+ result.wrote ? c.success(`Updated ${relative29(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
167714
167831
  );
167715
167832
  }
167716
167833
  var execFileAsync4, FFMPEG_TIMEOUT_MS, DEFAULT_TOLERANCE_LU, examples14, normalize_audio_default;
@@ -170388,7 +170505,7 @@ __export(keyframes_exports, {
170388
170505
  surfaceComposition: () => surfaceComposition
170389
170506
  });
170390
170507
  import { existsSync as existsSync98, readFileSync as readFileSync73, statSync as statSync38 } from "fs";
170391
- import { resolve as resolve62, dirname as dirname54, basename as basename23, join as join115, relative as relative29, sep as sep16 } from "path";
170508
+ import { resolve as resolve62, dirname as dirname54, basename as basename23, join as join115, relative as relative30, sep as sep17 } from "path";
170392
170509
  function queryIncludingTemplates(html, selector) {
170393
170510
  const doc = new DOMParser().parseFromString(html, "text/html");
170394
170511
  const roots = [doc];
@@ -170592,8 +170709,8 @@ function addAnimationShorthandNames(body, knownNames, out) {
170592
170709
  while (animationMatch = animationRe.exec(body)) {
170593
170710
  for (const raw of animationMatch[1].split(",")) {
170594
170711
  for (const token of raw.trim().split(/\s+/)) {
170595
- const normalized2 = stripQuotes(token);
170596
- if (knownNames.has(normalized2)) out.add(normalized2);
170712
+ const normalized3 = stripQuotes(token);
170713
+ if (knownNames.has(normalized3)) out.add(normalized3);
170597
170714
  }
170598
170715
  }
170599
170716
  }
@@ -170883,7 +171000,7 @@ function resolveScope(args) {
170883
171000
  comps = [surfaceComposition(readFileSync73(entryPath, "utf-8"), basename23(entryPath), entryPath)];
170884
171001
  projectName = basename23(entryPath);
170885
171002
  projectDir = findProjectRoot(entryPath);
170886
- entryFile = relative29(projectDir, entryPath).split(sep16).join("/");
171003
+ entryFile = relative30(projectDir, entryPath).split(sep17).join("/");
170887
171004
  } else {
170888
171005
  const project = resolveProject(raw);
170889
171006
  comps = collectCompositions(project.indexPath);
@@ -171047,8 +171164,8 @@ function createKeyframesCommand(options = {}) {
171047
171164
  }
171048
171165
  function normalizeRuntime(runtime, fallback) {
171049
171166
  if (typeof runtime !== "string") return fallback;
171050
- const normalized2 = runtime.toLowerCase();
171051
- return normalized2 === "gsap" || normalized2 === "css" || normalized2 === "anime" || normalized2 === "all" ? normalized2 : fallback;
171167
+ const normalized3 = runtime.toLowerCase();
171168
+ return normalized3 === "gsap" || normalized3 === "css" || normalized3 === "anime" || normalized3 === "all" ? normalized3 : fallback;
171052
171169
  }
171053
171170
  function filterCompositionsByRuntime(comps, runtime) {
171054
171171
  return comps.map((cmp) => ({
@@ -171101,7 +171218,7 @@ __export(info_exports, {
171101
171218
  examples: () => examples17,
171102
171219
  orientation: () => orientation
171103
171220
  });
171104
- import { readFileSync as readFileSync74, readdirSync as readdirSync36, statSync as statSync39 } from "fs";
171221
+ import { readFileSync as readFileSync74, readdirSync as readdirSync37, statSync as statSync39 } from "fs";
171105
171222
  import { join as join116 } from "path";
171106
171223
  function orientation(width, height) {
171107
171224
  if (width > height) return "landscape";
@@ -171115,7 +171232,7 @@ function durationFromHtml(html, fallback) {
171115
171232
  }
171116
171233
  function totalSize(dir) {
171117
171234
  let total = 0;
171118
- for (const entry of readdirSync36(dir, { withFileTypes: true })) {
171235
+ for (const entry of readdirSync37(dir, { withFileTypes: true })) {
171119
171236
  const path = join116(dir, entry.name);
171120
171237
  if (entry.isDirectory()) {
171121
171238
  total += totalSize(path);
@@ -171394,7 +171511,7 @@ var init_clipFacts = __esm({
171394
171511
 
171395
171512
  // src/timeline/describeProject.ts
171396
171513
  import { readFileSync as readFileSync76, realpathSync as realpathSync10, statSync as statSync40 } from "fs";
171397
- import { basename as basename24, dirname as dirname56, isAbsolute as isAbsolute18, relative as relative30, resolve as resolve64, sep as sep17 } from "path";
171514
+ import { basename as basename24, dirname as dirname56, isAbsolute as isAbsolute18, relative as relative31, resolve as resolve64, sep as sep18 } from "path";
171398
171515
  function toNode2(el) {
171399
171516
  const attrs2 = {};
171400
171517
  for (const { name, value } of Array.from(el.attributes)) attrs2[name] = value;
@@ -171550,7 +171667,7 @@ async function readSubComposition(src, parent, origin) {
171550
171667
  const authored = resolve64(parent.dir, src);
171551
171668
  const file = realFileInside(parent.projectDir, authored);
171552
171669
  if (!file) return [];
171553
- const relativeFile = relative30(parent.projectDir, authored).split(sep17).join("/");
171670
+ const relativeFile = relative31(parent.projectDir, authored).split(sep18).join("/");
171554
171671
  const source = parent.sourceOverrides.get(relativeFile) ?? readFileSync76(file, "utf-8");
171555
171672
  const doc = new DOMParser().parseFromString(source, "text/html");
171556
171673
  const template = doc.querySelector("template");
@@ -171562,7 +171679,7 @@ async function readSubComposition(src, parent, origin) {
171562
171679
  startCache: /* @__PURE__ */ new Map(),
171563
171680
  projectDir: parent.projectDir,
171564
171681
  origin,
171565
- file: relative30(parent.projectDir, authored).split(sep17).join("/"),
171682
+ file: relative31(parent.projectDir, authored).split(sep18).join("/"),
171566
171683
  withProbeSlot: parent.withProbeSlot,
171567
171684
  measure: parent.measure,
171568
171685
  sourceOverrides: parent.sourceOverrides
@@ -171575,8 +171692,8 @@ async function readSubComposition(src, parent, origin) {
171575
171692
  function realFileInside(projectDir, path) {
171576
171693
  try {
171577
171694
  const real = realpathSync10(path);
171578
- const inside = relative30(realpathSync10(projectDir), real);
171579
- if (inside === ".." || inside.startsWith(`..${sep17}`) || isAbsolute18(inside)) return null;
171695
+ const inside = relative31(realpathSync10(projectDir), real);
171696
+ if (inside === ".." || inside.startsWith(`..${sep18}`) || isAbsolute18(inside)) return null;
171580
171697
  return statSync40(real).isFile() ? real : null;
171581
171698
  } catch {
171582
171699
  return null;
@@ -171781,9 +171898,9 @@ function parseTimeExpression(expression, context) {
171781
171898
  const frames = /^(-?\d+(?:\.\d+)?)f$/.exec(raw);
171782
171899
  if (frames) return { ok: true, seconds: Number(frames[1]) / context.fps };
171783
171900
  const absolute = /^\d+(?:\.\d+)?$/.test(raw);
171784
- const relative38 = /^[+-]\d+(?:\.\d+)?$/.test(raw);
171901
+ const relative39 = /^[+-]\d+(?:\.\d+)?$/.test(raw);
171785
171902
  if (absolute) return { ok: true, seconds: Number(raw) };
171786
- if (relative38) return { ok: true, seconds: context.row.start + Number(raw) };
171903
+ if (relative39) return { ok: true, seconds: context.row.start + Number(raw) };
171787
171904
  const anchor = /^(after|before|start-of|end-of):(.+)$/.exec(raw);
171788
171905
  if (!anchor) return { ok: false, reason: `invalid time expression: ${expression}` };
171789
171906
  const row = context.resolveAnchor(anchor[2]);
@@ -173423,8 +173540,8 @@ function failWith(message, json) {
173423
173540
  }
173424
173541
  function parseExportFormat(value, json) {
173425
173542
  if (!value) return void 0;
173426
- const normalized2 = value.toLowerCase();
173427
- if (normalized2 === "srt" || normalized2 === "vtt") return normalized2;
173543
+ const normalized3 = value.toLowerCase();
173544
+ if (normalized3 === "srt" || normalized3 === "vtt") return normalized3;
173428
173545
  failWith(`Unsupported caption export format: ${value}. Use srt or vtt.`, json);
173429
173546
  }
173430
173547
  function exitNoWords(json) {
@@ -173860,7 +173977,7 @@ __export(synthesize_exports, {
173860
173977
  synthesize: () => synthesize
173861
173978
  });
173862
173979
  import { execFileSync as execFileSync15 } from "child_process";
173863
- import { existsSync as existsSync106, mkdirSync as mkdirSync55, readdirSync as readdirSync37, unlinkSync as unlinkSync9 } from "fs";
173980
+ import { existsSync as existsSync106, mkdirSync as mkdirSync55, readdirSync as readdirSync38, unlinkSync as unlinkSync9 } from "fs";
173864
173981
  import { join as join124, dirname as dirname58, basename as basename26 } from "path";
173865
173982
  import { homedir as homedir23 } from "os";
173866
173983
  function ensureSynthScript() {
@@ -173869,7 +173986,7 @@ function ensureSynthScript() {
173869
173986
  writeNewFileSync(SCRIPT_PATH, SYNTH_SCRIPT);
173870
173987
  const currentName = basename26(SCRIPT_PATH);
173871
173988
  try {
173872
- for (const entry of readdirSync37(SCRIPT_DIR)) {
173989
+ for (const entry of readdirSync38(SCRIPT_DIR)) {
173873
173990
  if (entry !== currentName && /^synth(-v\d+)?\.py$/.test(entry)) {
173874
173991
  try {
173875
173992
  unlinkSync9(join124(SCRIPT_DIR, entry));
@@ -174766,7 +174883,7 @@ __export(upgrade_exports, {
174766
174883
  upgradeProjectPins: () => upgradeProjectPins
174767
174884
  });
174768
174885
  import { execFileSync as execFileSync17 } from "child_process";
174769
- import { existsSync as existsSync110, readFileSync as readFileSync84, writeFileSync as writeFileSync46, renameSync as renameSync20, readdirSync as readdirSync38 } from "fs";
174886
+ import { existsSync as existsSync110, readFileSync as readFileSync84, writeFileSync as writeFileSync46, renameSync as renameSync20, readdirSync as readdirSync39 } from "fs";
174770
174887
  import { resolve as resolve70 } from "path";
174771
174888
  async function confirmUpgrade() {
174772
174889
  const shouldUpgrade = await ue({ message: "Upgrade now?" });
@@ -174834,7 +174951,7 @@ async function upgradeProjectPins(dir, opts) {
174834
174951
  const { latest } = await checkForUpdate(true);
174835
174952
  if (!isSafeVersion(latest)) return { changed: false, from: [], to: latest, path: pkgPath };
174836
174953
  const rewrite = rewriteProjectPinnedScripts(scripts, latest);
174837
- const wrapperRewrites = readdirSync38(dir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".sh")).map((entry) => {
174954
+ const wrapperRewrites = readdirSync39(dir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".sh")).map((entry) => {
174838
174955
  const path = resolve70(dir, entry.name);
174839
174956
  return { path, rewrite: rewritePinnedHyperframesText(readFileSync84(path, "utf-8"), latest) };
174840
174957
  });
@@ -175582,11 +175699,11 @@ function publishCaptureFileSync(path, data2, options) {
175582
175699
  }
175583
175700
  }
175584
175701
  function writeCaptureFileSync(path, data2, options) {
175585
- const normalized2 = typeof options === "string" ? { encoding: options } : options;
175586
- if (normalized2?.flag === void 0 || normalized2.flag === "w") {
175587
- return publishCaptureFileSync(path, data2, normalized2);
175702
+ const normalized3 = typeof options === "string" ? { encoding: options } : options;
175703
+ if (normalized3?.flag === void 0 || normalized3.flag === "w") {
175704
+ return publishCaptureFileSync(path, data2, normalized3);
175588
175705
  }
175589
- writeFileSync47(path, data2, { ...normalized2, mode: 384 });
175706
+ writeFileSync47(path, data2, { ...normalized3, mode: 384 });
175590
175707
  }
175591
175708
  var init_captureFile = __esm({
175592
175709
  "src/capture/captureFile.ts"() {
@@ -175604,7 +175721,7 @@ __export(contactSheet_exports, {
175604
175721
  createSvgContactSheet: () => createSvgContactSheet
175605
175722
  });
175606
175723
  import sharp from "sharp";
175607
- import { readdirSync as readdirSync39, readFileSync as readFileSync85, unlinkSync as unlinkSync10, existsSync as existsSync111 } from "fs";
175724
+ import { readdirSync as readdirSync40, readFileSync as readFileSync85, unlinkSync as unlinkSync10, existsSync as existsSync111 } from "fs";
175608
175725
  import { join as join127, extname as extname19, basename as basename28, dirname as dirname62 } from "path";
175609
175726
  async function createContactSheet(imagePaths, outputPath, opts = {}) {
175610
175727
  const {
@@ -175689,7 +175806,7 @@ async function createContactSheetPages(imagePaths, outputBasePath, opts = {}, la
175689
175806
  }
175690
175807
  async function createScrollContactSheet(screenshotsDir, outputPath, budget = {}) {
175691
175808
  if (!existsSync111(screenshotsDir)) return [];
175692
- const scrollFiles = readdirSync39(screenshotsDir).filter((f) => f.startsWith("scroll-") && f.endsWith(".png")).sort();
175809
+ const scrollFiles = readdirSync40(screenshotsDir).filter((f) => f.startsWith("scroll-") && f.endsWith(".png")).sort();
175693
175810
  if (scrollFiles.length === 0) return [];
175694
175811
  const paths = scrollFiles.map((f) => join127(screenshotsDir, f));
175695
175812
  const labels = scrollFiles.map((f) => {
@@ -175706,7 +175823,7 @@ async function createScrollContactSheet(screenshotsDir, outputPath, budget = {})
175706
175823
  }
175707
175824
  async function createSnapshotContactSheet(snapshotsDir, outputPath, budget = {}) {
175708
175825
  if (!existsSync111(snapshotsDir)) return [];
175709
- const snapshotFiles = readdirSync39(snapshotsDir).filter((f) => f.startsWith("frame-") && f.endsWith(".png")).sort();
175826
+ const snapshotFiles = readdirSync40(snapshotsDir).filter((f) => f.startsWith("frame-") && f.endsWith(".png")).sort();
175710
175827
  if (snapshotFiles.length === 0) return [];
175711
175828
  const paths = snapshotFiles.map((f) => join127(snapshotsDir, f));
175712
175829
  const labels = snapshotFiles.map((f) => {
@@ -175724,7 +175841,7 @@ async function createSnapshotContactSheet(snapshotsDir, outputPath, budget = {})
175724
175841
  async function createAssetContactSheet(assetsDir, outputPath, budget = {}) {
175725
175842
  if (!existsSync111(assetsDir)) return [];
175726
175843
  const imageExts = /* @__PURE__ */ new Set([".png", ".jpg", ".jpeg", ".webp"]);
175727
- const assetFiles = readdirSync39(assetsDir).filter((f) => imageExts.has(extname19(f).toLowerCase()) && !f.includes("contact-sheet")).sort();
175844
+ const assetFiles = readdirSync40(assetsDir).filter((f) => imageExts.has(extname19(f).toLowerCase()) && !f.includes("contact-sheet")).sort();
175728
175845
  if (assetFiles.length === 0) return [];
175729
175846
  const paths = assetFiles.map((f) => join127(assetsDir, f));
175730
175847
  return createContactSheetPages(paths, outputPath, {
@@ -175743,7 +175860,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
175743
175860
  const seen = /* @__PURE__ */ new Set();
175744
175861
  const svgPaths = [];
175745
175862
  for (const dir of dirsToScan) {
175746
- for (const f of readdirSync39(dir).filter((f2) => f2.endsWith(".svg")).sort()) {
175863
+ for (const f of readdirSync40(dir).filter((f2) => f2.endsWith(".svg")).sort()) {
175747
175864
  if (!seen.has(f)) {
175748
175865
  seen.add(f);
175749
175866
  svgPaths.push(join127(dir, f));
@@ -175820,7 +175937,7 @@ __export(snapshot_exports, {
175820
175937
  });
175821
175938
  import { existsSync as existsSync112, mkdtempSync as mkdtempSync25, readFileSync as readFileSync86, mkdirSync as mkdirSync56, rmSync as rmSync38, writeFileSync as writeFileSync48 } from "fs";
175822
175939
  import { tmpdir as tmpdir16 } from "os";
175823
- import { resolve as resolve72, join as join128, relative as relative31, isAbsolute as isAbsolute19, basename as basename29, posix as posix6 } from "path";
175940
+ import { resolve as resolve72, join as join128, relative as relative33, isAbsolute as isAbsolute19, basename as basename29, posix as posix6 } from "path";
175824
175941
  function orbitStageSource() {
175825
175942
  return `function(cam) {
175826
175943
  var root = document.querySelector("[data-composition-id]")
@@ -175989,8 +176106,8 @@ async function captureSnapshots(projectDir, opts) {
175989
176106
  const snapshotDir = opts.outputDir ?? join128(projectDir, "snapshots");
175990
176107
  mkdirSync56(snapshotDir, { recursive: true });
175991
176108
  try {
175992
- const { readdirSync: readdirSync46 } = await import("fs");
175993
- for (const file of readdirSync46(snapshotDir)) {
176109
+ const { readdirSync: readdirSync47 } = await import("fs");
176110
+ for (const file of readdirSync47(snapshotDir)) {
175994
176111
  if (/\.(png|jpg|jpeg)$/i.test(file)) {
175995
176112
  rmSync38(join128(snapshotDir, file), { force: true });
175996
176113
  }
@@ -176081,7 +176198,7 @@ async function captureSnapshots(projectDir, opts) {
176081
176198
  const url = new URL(v2.src);
176082
176199
  const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
176083
176200
  const candidate = resolve72(projectDir, decodedPath);
176084
- const rel2 = relative31(projectDir, candidate);
176201
+ const rel2 = relative33(projectDir, candidate);
176085
176202
  if (!rel2.startsWith("..") && !isAbsolute19(rel2) && existsSync112(candidate)) {
176086
176203
  ffmpegInput = candidate;
176087
176204
  inputIsLocal = true;
@@ -176168,7 +176285,7 @@ async function captureSnapshots(projectDir, opts) {
176168
176285
  });
176169
176286
  }
176170
176287
  }
176171
- const rel = relative31(projectDir, framePath);
176288
+ const rel = relative33(projectDir, framePath);
176172
176289
  savedPaths.push(rel.startsWith("..") || isAbsolute19(rel) ? framePath : rel);
176173
176290
  }
176174
176291
  } finally {
@@ -176464,7 +176581,7 @@ var init_sourceMutation = __esm({
176464
176581
  });
176465
176582
 
176466
176583
  // src/utils/pathArgs.ts
176467
- import { isAbsolute as isAbsolute20, relative as relative33, resolve as resolve73 } from "path";
176584
+ import { isAbsolute as isAbsolute20, relative as relative34, resolve as resolve73 } from "path";
176468
176585
  function readOptionalString(value) {
176469
176586
  if (typeof value !== "string") return void 0;
176470
176587
  const trimmed = value.trim();
@@ -176474,7 +176591,7 @@ function resolveFromBase(baseDir, input2) {
176474
176591
  return isAbsolute20(input2) ? input2 : resolve73(baseDir, input2);
176475
176592
  }
176476
176593
  function displayPathFromBase(baseDir, filePath) {
176477
- const rel = relative33(baseDir, filePath);
176594
+ const rel = relative34(baseDir, filePath);
176478
176595
  if (rel && !rel.startsWith("..") && !isAbsolute20(rel)) return rel;
176479
176596
  return filePath;
176480
176597
  }
@@ -176769,7 +176886,7 @@ __export(media_treatment_exports, {
176769
176886
  resolveMediaTreatmentSource: () => resolveMediaTreatmentSource
176770
176887
  });
176771
176888
  import { existsSync as existsSync113, readFileSync as readFileSync87, writeFileSync as writeFileSync49 } from "fs";
176772
- import { join as join129, relative as relative34, resolve as resolve74 } from "path";
176889
+ import { join as join129, relative as relative35, resolve as resolve74 } from "path";
176773
176890
  function getMediaTreatmentCapabilityOverview() {
176774
176891
  const capabilities = getHfColorGradingCapabilities();
176775
176892
  const family = (id, label2, description) => ({
@@ -177069,9 +177186,9 @@ function serializeGradingPatch(before3, patch) {
177069
177186
  if (containsColorGradingVariableRef(grading)) {
177070
177187
  return typeof grading === "string" ? grading.trim() : JSON.stringify(grading);
177071
177188
  }
177072
- const normalized2 = normalizeHfColorGrading(grading);
177073
- if (!normalized2) throw new Error("--grading must be valid HyperFrames color-grading JSON");
177074
- return hasHfColorGradingAuthoredValues(normalized2) ? serializeHfColorGrading(normalized2) : null;
177189
+ const normalized3 = normalizeHfColorGrading(grading);
177190
+ if (!normalized3) throw new Error("--grading must be valid HyperFrames color-grading JSON");
177191
+ return hasHfColorGradingAuthoredValues(normalized3) ? serializeHfColorGrading(normalized3) : null;
177075
177192
  }
177076
177193
  function queryIncludingTemplates2(root, selector) {
177077
177194
  const matches2 = Array.from(root.querySelectorAll(selector));
@@ -177217,7 +177334,7 @@ function analyzeTarget(args) {
177217
177334
  selectorIndex
177218
177335
  );
177219
177336
  const source = mediaSourceForElement(element);
177220
- const compositionFile = relative34(project.dir, filePath).split("\\").join("/");
177337
+ const compositionFile = relative35(project.dir, filePath).split("\\").join("/");
177221
177338
  const mediaPath = resolveMediaTreatmentSource(project.dir, compositionFile, source);
177222
177339
  return {
177223
177340
  ok: true,
@@ -177253,7 +177370,7 @@ function prepareMutation2(args) {
177253
177370
  payload: {
177254
177371
  ok: true,
177255
177372
  action,
177256
- file: relative34(project.dir, filePath) || "index.html",
177373
+ file: relative35(project.dir, filePath) || "index.html",
177257
177374
  selector,
177258
177375
  selectorIndex: selectorIndex ?? 0,
177259
177376
  tag: result.tag,
@@ -177460,8 +177577,8 @@ function validateCell(label2, grading) {
177460
177577
  }
177461
177578
  function warnInactiveGradingCells(cells) {
177462
177579
  for (const cell of cells) {
177463
- const normalized2 = normalizeHfColorGrading(cell.grading);
177464
- if (!isHfColorGradingActive(normalized2)) {
177580
+ const normalized3 = normalizeHfColorGrading(cell.grading);
177581
+ if (!isHfColorGradingActive(normalized3)) {
177465
177582
  console.error(
177466
177583
  c.warn(`Warning: grading for "${cell.label}" is inactive/no-op \u2014 it will render ungraded`)
177467
177584
  );
@@ -177487,11 +177604,11 @@ function buildGradeCompareSuccessPayload(sheet, cells, capResult) {
177487
177604
  return { ok: true, sheet, cells, truncated: true, total: capResult.total };
177488
177605
  }
177489
177606
  function serializedGradingForCell(cell) {
177490
- const normalized2 = normalizeHfColorGrading(cell.grading);
177491
- if (!normalized2) {
177607
+ const normalized3 = normalizeHfColorGrading(cell.grading);
177608
+ if (!normalized3) {
177492
177609
  throw new Error(`Invalid color grading for cell "${cell.label}"`);
177493
177610
  }
177494
- return serializeHfColorGrading(normalized2);
177611
+ return serializeHfColorGrading(normalized3);
177495
177612
  }
177496
177613
  function lutSrcFromGrading(grading) {
177497
177614
  if (!isRecord15(grading) || !hasOwn2(grading, "lut")) return null;
@@ -178939,11 +179056,11 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks,
178939
179056
  }
178940
179057
  const toDownload = [];
178941
179058
  for (const { url, isPoster } of imageUrls) {
178942
- const normalized2 = normalizeUrl(url);
178943
- if (downloadedUrls.has(normalized2)) continue;
178944
- downloadedUrls.add(normalized2);
178945
- const catalog = catalogedAssets?.find((a) => normalizeUrl(a.url) === normalized2);
178946
- toDownload.push({ url, isPoster, normalized: normalized2, catalog });
179059
+ const normalized3 = normalizeUrl(url);
179060
+ if (downloadedUrls.has(normalized3)) continue;
179061
+ downloadedUrls.add(normalized3);
179062
+ const catalog = catalogedAssets?.find((a) => normalizeUrl(a.url) === normalized3);
179063
+ toDownload.push({ url, isPoster, normalized: normalized3, catalog });
178947
179064
  }
178948
179065
  const BATCH_SIZE = 5;
178949
179066
  let imgIdx = 0;
@@ -180150,7 +180267,7 @@ var agentPromptGenerator_exports = {};
180150
180267
  __export(agentPromptGenerator_exports, {
180151
180268
  generateAgentPrompt: () => generateAgentPrompt
180152
180269
  });
180153
- import { readdirSync as readdirSync40, existsSync as existsSync117 } from "fs";
180270
+ import { readdirSync as readdirSync41, existsSync as existsSync117 } from "fs";
180154
180271
  import { join as join136 } from "path";
180155
180272
  function inferColorRole(hex) {
180156
180273
  const r = parseInt(hex.slice(1, 3), 16) / 255;
@@ -180186,7 +180303,7 @@ function buildPrompt(outputDir, url, tokens, hasScreenshot, hasLottie, hasShader
180186
180303
  const baseName = baseFile.replace(/\.jpg$/, "");
180187
180304
  const escapedBase = baseName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
180188
180305
  const paginatedRe = new RegExp(`^${escapedBase}(?:-(\\d+))?\\.jpg$`);
180189
- const all = readdirSync40(fullDir).filter((f) => paginatedRe.test(f)).map((f) => ({ name: f, page: parseInt(f.match(paginatedRe)?.[1] ?? "0", 10) })).sort((a, b2) => a.page - b2.page).map((entry) => entry.name);
180306
+ const all = readdirSync41(fullDir).filter((f) => paginatedRe.test(f)).map((f) => ({ name: f, page: parseInt(f.match(paginatedRe)?.[1] ?? "0", 10) })).sort((a, b2) => a.page - b2.page).map((entry) => entry.name);
180190
180307
  if (all.length === 0) return [];
180191
180308
  if (all.length === 1) {
180192
180309
  return [`| \`${dir}/${all[0]}\` | ${label2} |`];
@@ -180564,7 +180681,7 @@ var init_navigationPhase = __esm({
180564
180681
  // src/capture/contentExtractor.ts
180565
180682
  import {
180566
180683
  existsSync as existsSync119,
180567
- readdirSync as readdirSync41,
180684
+ readdirSync as readdirSync43,
180568
180685
  statSync as statSync44,
180569
180686
  readFileSync as readFileSync91,
180570
180687
  openSync as openSync14,
@@ -180852,7 +180969,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
180852
180969
  return response.text?.trim() || "";
180853
180970
  };
180854
180971
  }
180855
- const imageFiles = readdirSync41(join140(outputDir, "assets")).filter(
180972
+ const imageFiles = readdirSync43(join140(outputDir, "assets")).filter(
180856
180973
  (f) => /\.(png|jpg|jpeg|webp|gif)$/i.test(f)
180857
180974
  );
180858
180975
  const BATCH_SIZE = 20;
@@ -180920,12 +181037,12 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
180920
181037
  );
180921
181038
  const svgFiles = [];
180922
181039
  const assetsDir = join140(outputDir, "assets");
180923
- for (const f of readdirSync41(assetsDir)) {
181040
+ for (const f of readdirSync43(assetsDir)) {
180924
181041
  if (/\.svg$/i.test(f)) svgFiles.push({ file: f, relPath: f });
180925
181042
  }
180926
181043
  const svgsSubdir = join140(assetsDir, "svgs");
180927
181044
  if (existsSync119(svgsSubdir)) {
180928
- for (const f of readdirSync41(svgsSubdir)) {
181045
+ for (const f of readdirSync43(svgsSubdir)) {
180929
181046
  if (/\.svg$/i.test(f)) svgFiles.push({ file: f, relPath: `svgs/${f}` });
180930
181047
  }
180931
181048
  }
@@ -181034,7 +181151,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
181034
181151
  const fontLines = [];
181035
181152
  const assetsPath = join140(outputDir, "assets");
181036
181153
  try {
181037
- for (const file of readdirSync41(assetsPath)) {
181154
+ for (const file of readdirSync43(assetsPath)) {
181038
181155
  if (file === "svgs" || file === "fonts" || file === "lottie" || file === "videos") continue;
181039
181156
  const filePath = join140(assetsPath, file);
181040
181157
  const stat = statSync44(filePath);
@@ -181066,7 +181183,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
181066
181183
  }
181067
181184
  try {
181068
181185
  const svgsPath = join140(assetsPath, "svgs");
181069
- for (const file of readdirSync41(svgsPath)) {
181186
+ for (const file of readdirSync43(svgsPath)) {
181070
181187
  if (!file.endsWith(".svg")) continue;
181071
181188
  const svgMatch = tokens.svgs.find(
181072
181189
  (s) => s.label && file.includes(
@@ -181085,7 +181202,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
181085
181202
  }
181086
181203
  try {
181087
181204
  const fontsPath = join140(assetsPath, "fonts");
181088
- for (const file of readdirSync41(fontsPath)) {
181205
+ for (const file of readdirSync43(fontsPath)) {
181089
181206
  fontLines.push(`fonts/${file} \u2014 font file`);
181090
181207
  }
181091
181208
  } catch {
@@ -181284,7 +181401,7 @@ async function extractHtml(page, opts = {}) {
181284
181401
  (_match, pre, urls, post) => {
181285
181402
  const fixed = urls.replace(/&amp;/g, "&").replace(
181286
181403
  /(^|,\s*)(\/[^\s,]+)/g,
181287
- (_m, sep18, path) => sep18 + pageOrigin + path
181404
+ (_m, sep19, path) => sep19 + pageOrigin + path
181288
181405
  );
181289
181406
  return pre + fixed + post;
181290
181407
  }
@@ -182368,7 +182485,7 @@ var init_lottiePreviewRequests = __esm({
182368
182485
  });
182369
182486
 
182370
182487
  // src/capture/mediaCapture.ts
182371
- import { mkdirSync as mkdirSync63, readdirSync as readdirSync43, readFileSync as readFileSync93, statSync as statSync45 } from "fs";
182488
+ import { mkdirSync as mkdirSync63, readdirSync as readdirSync44, readFileSync as readFileSync93, statSync as statSync45 } from "fs";
182372
182489
  import { join as join141, extname as extname25 } from "path";
182373
182490
  function liveRemainingMs(budget, fallbackMs) {
182374
182491
  return budget.remainingMs?.() ?? fallbackMs;
@@ -182419,7 +182536,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
182419
182536
  const manifest = [];
182420
182537
  const previewDir = join141(lottieDir, "previews");
182421
182538
  mkdirSync63(previewDir, { recursive: true });
182422
- for (const file of readdirSync43(lottieDir)) {
182539
+ for (const file of readdirSync44(lottieDir)) {
182423
182540
  if (!file.endsWith(".json")) continue;
182424
182541
  if (liveRemainingMs(budget, 1) <= 0) break;
182425
182542
  try {
@@ -183570,7 +183687,7 @@ var init_coreExtractionPhase = __esm({
183570
183687
  });
183571
183688
 
183572
183689
  // src/capture/fontMetadataExtractor.ts
183573
- import { readdirSync as readdirSync44, readFileSync as readFileSync94, existsSync as existsSync120 } from "fs";
183690
+ import { readdirSync as readdirSync45, readFileSync as readFileSync94, existsSync as existsSync120 } from "fs";
183574
183691
  import { join as join145 } from "path";
183575
183692
  import * as fontkit from "fontkit";
183576
183693
  function isFontCollection(value) {
@@ -183580,7 +183697,7 @@ function extractFontMetadata(fontsDir, outputPath) {
183580
183697
  const files = [];
183581
183698
  const unidentified = [];
183582
183699
  if (existsSync120(fontsDir)) {
183583
- const fontFiles = readdirSync44(fontsDir).filter((f) => /\.(woff2?|ttf|otf)$/i.test(f));
183700
+ const fontFiles = readdirSync45(fontsDir).filter((f) => /\.(woff2?|ttf|otf)$/i.test(f));
183584
183701
  for (const filename of fontFiles) {
183585
183702
  const fullPath = join145(fontsDir, filename);
183586
183703
  const meta = readSingleFont(fullPath, filename);
@@ -184720,7 +184837,7 @@ __export(state_exports, {
184720
184837
  stateFilePath: () => stateFilePath,
184721
184838
  writeStackOutputs: () => writeStackOutputs
184722
184839
  });
184723
- import { existsSync as existsSync123, mkdirSync as mkdirSync67, readdirSync as readdirSync45, readFileSync as readFileSync95, rmSync as rmSync41, writeFileSync as writeFileSync51 } from "fs";
184840
+ import { existsSync as existsSync123, mkdirSync as mkdirSync67, readdirSync as readdirSync46, readFileSync as readFileSync95, rmSync as rmSync41, writeFileSync as writeFileSync51 } from "fs";
184724
184841
  import { dirname as dirname65, join as join148 } from "path";
184725
184842
  function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
184726
184843
  return join148(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
@@ -184747,7 +184864,7 @@ function deleteStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd())
184747
184864
  function listStackNames(cwd = process.cwd()) {
184748
184865
  const dir = join148(cwd, STATE_DIR_NAME);
184749
184866
  if (!existsSync123(dir)) return [];
184750
- return readdirSync45(dir).filter((f) => f.startsWith(STATE_FILE_PREFIX) && f.endsWith(".json")).map((f) => f.slice(STATE_FILE_PREFIX.length, -".json".length));
184867
+ return readdirSync46(dir).filter((f) => f.startsWith(STATE_FILE_PREFIX) && f.endsWith(".json")).map((f) => f.slice(STATE_FILE_PREFIX.length, -".json".length));
184751
184868
  }
184752
184869
  function requireStack(stackName, cwd = process.cwd()) {
184753
184870
  const stack = readStackOutputs(stackName, cwd);
@@ -187164,7 +187281,7 @@ var init_poll = __esm({
187164
187281
  import {
187165
187282
  chmodSync as chmodSync2,
187166
187283
  createWriteStream as createWriteStream4,
187167
- lstatSync as lstatSync11,
187284
+ lstatSync as lstatSync12,
187168
187285
  mkdirSync as mkdirSync69,
187169
187286
  mkdtempSync as mkdtempSync28,
187170
187287
  readlinkSync as readlinkSync2,
@@ -187224,7 +187341,7 @@ async function downloadToFile(url, destPath, options = {}) {
187224
187341
  function resolveDownloadDestination(destPath) {
187225
187342
  let destination = resolve82(destPath);
187226
187343
  for (let hops = 0; hops < 40; hops++) {
187227
- if (!lstatSync11(destination, { throwIfNoEntry: false })?.isSymbolicLink()) return destination;
187344
+ if (!lstatSync12(destination, { throwIfNoEntry: false })?.isSymbolicLink()) return destination;
187228
187345
  destination = resolve82(dirname67(destination), readlinkSync2(destination));
187229
187346
  }
187230
187347
  throw new Error(`Too many symbolic links in download destination: ${destPath}`);
@@ -187744,7 +187861,7 @@ __export(render_exports3, {
187744
187861
  validateDryRunSource: () => validateDryRunSource,
187745
187862
  validateResolutionFormatCombo: () => validateResolutionFormatCombo
187746
187863
  });
187747
- import { isAbsolute as isAbsolute21, relative as relative35, resolve as resolvePath4 } from "path";
187864
+ import { isAbsolute as isAbsolute21, relative as relative36, resolve as resolvePath4 } from "path";
187748
187865
  import { existsSync as existsSync130 } from "fs";
187749
187866
  function parsePollIntervalMs(raw) {
187750
187867
  const n3 = parseNumericFlag(raw, { flag: "--poll-interval", min: 1 });
@@ -187870,7 +187987,7 @@ function prepareLocalArchive(source, composition, asJson) {
187870
187987
  }
187871
187988
  try {
187872
187989
  const fileMap = buildPublishFileMap(project.dir);
187873
- const entryPath = relative35(
187990
+ const entryPath = relative36(
187874
187991
  project.dir,
187875
187992
  resolvePath4(project.dir, composition ?? "index.html")
187876
187993
  ).replaceAll("\\", "/");
@@ -190696,7 +190813,7 @@ __export(asset_exports, {
190696
190813
  runAssetImportMany: () => runAssetImportMany
190697
190814
  });
190698
190815
  import { existsSync as existsSync133 } from "fs";
190699
- import { join as join159, relative as relative36 } from "path";
190816
+ import { join as join159, relative as relative37 } from "path";
190700
190817
  function gatherAssetRefs(positionals) {
190701
190818
  return positionals.flatMap((r) => /^https?:/i.test(r.trim()) ? [r] : r.split(",")).map((r) => r.trim()).filter((r) => r.length > 0);
190702
190819
  }
@@ -190738,7 +190855,7 @@ async function freezeAndRecord(fileKey2, nodeId, url, ext, opts, version2, deps,
190738
190855
  const record2 = {
190739
190856
  id,
190740
190857
  type: "image",
190741
- path: relative36(deps.projectDir, destAbs),
190858
+ path: relative37(deps.projectDir, destAbs),
190742
190859
  source: `figma:${fileKey2}/${nodeId}`,
190743
190860
  ...description !== void 0 && { description },
190744
190861
  ...entity !== void 0 && { entity },
@@ -190982,7 +191099,7 @@ __export(component_exports, {
190982
191099
  runComponentImport: () => runComponentImport
190983
191100
  });
190984
191101
  import { existsSync as existsSync134, mkdirSync as mkdirSync74, writeFileSync as writeFileSync59 } from "fs";
190985
- import { join as join161, relative as relative37 } from "path";
191102
+ import { join as join161, relative as relative38 } from "path";
190986
191103
  function escapeAttr2(value) {
190987
191104
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
190988
191105
  }
@@ -191032,7 +191149,7 @@ async function runComponentImport(refInput, deps) {
191032
191149
  );
191033
191150
  return {
191034
191151
  name,
191035
- htmlPath: relative37(deps.projectDir, htmlFile),
191152
+ htmlPath: relative38(deps.projectDir, htmlFile),
191036
191153
  unresolved: bindings.unresolved,
191037
191154
  rasterized: mapped.rasterize,
191038
191155
  failedRasterize
@@ -191052,7 +191169,7 @@ async function rasterizeFallback(mapped, fileKey2, componentDir, deps) {
191052
191169
  continue;
191053
191170
  }
191054
191171
  frozenAssets.push(asset.record.path);
191055
- const srcRel = relative37(componentDir, join161(deps.projectDir, asset.record.path)).replaceAll(
191172
+ const srcRel = relative38(componentDir, join161(deps.projectDir, asset.record.path)).replaceAll(
191056
191173
  "\\",
191057
191174
  "/"
191058
191175
  );