hyperframes 0.8.113 → 0.8.115

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.
Files changed (169) hide show
  1. package/dist/{add-ILIGSLV4.js → add-ZSLFODRZ.js} +15 -14
  2. package/dist/{animatedGifPrep-U7FMC7DB.js → animatedGifPrep-72A45YER.js} +5 -5
  3. package/dist/{asset-OFDEIAGM.js → asset-SGDOHBBN.js} +2 -2
  4. package/dist/{assetCataloger-5LCGR5XU.js → assetCataloger-Q7BCDARF.js} +2 -2
  5. package/dist/{auth-5JDDEX2M.js → auth-5JGFN7SV.js} +2 -2
  6. package/dist/{autoUpdate-JXVZVJCV.js → autoUpdate-ZVTMYO7Z.js} +2 -2
  7. package/dist/{backgroundChecks-BBWGY3V6.js → backgroundChecks-IY3G5G2D.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-QVJ7NEUH.js → batchRender-QVLLL5DN.js} +3 -3
  10. package/dist/{beats-YEYVQMX6.js → beats-66KZIB5V.js} +14 -10
  11. package/dist/{benchmark-J2V46VWI.js → benchmark-AWFKSWQH.js} +11 -11
  12. package/dist/{browser-XBWASLD2.js → browser-J54EXMCE.js} +8 -8
  13. package/dist/{bundleWithLocalizedFonts-4CVITCYK.js → bundleWithLocalizedFonts-BLLHP2TO.js} +2 -2
  14. package/dist/{capture-GLHK4ST7.js → capture-D4HRSVSK.js} +2 -2
  15. package/dist/{capture-F2Y7TIHU.js → capture-SLI2I5BS.js} +16 -11
  16. package/dist/{catalog-3QDMTDK2.js → catalog-BUMLQU7L.js} +15 -14
  17. package/dist/{check-O3RR4NWI.js → check-HEZUK62C.js} +31 -29
  18. package/dist/{checkBrowser-K36DAG4S.js → checkBrowser-RVJM6IUO.js} +30 -28
  19. package/dist/{chunk-EMZF2TPA.js → chunk-2DX6JYL2.js} +2 -2
  20. package/dist/{chunk-BOUDTDBQ.js → chunk-2GWVY66H.js} +1 -1
  21. package/dist/{chunk-P3FGUSFK.js → chunk-2H37RGJ2.js} +7 -7
  22. package/dist/{chunk-7543YIMQ.js → chunk-3J4EBX5M.js} +1 -1
  23. package/dist/{chunk-3XPZJUKM.js → chunk-3R6P5BIG.js} +2 -2
  24. package/dist/{chunk-ZZIXIOK2.js → chunk-3YTWSGBV.js} +4 -4
  25. package/dist/{chunk-HYXL3VJA.js → chunk-4HIF3LI3.js} +5 -5
  26. package/dist/{chunk-HTQR7SUZ.js → chunk-4P2TOD7N.js} +1 -1
  27. package/dist/{chunk-G2T2X6FZ.js → chunk-5MXN7WM4.js} +2 -2
  28. package/dist/{chunk-2DBYGR4N.js → chunk-5YSA3YXO.js} +14 -18
  29. package/dist/{chunk-7CGIICLA.js → chunk-6SEUZGID.js} +3 -3
  30. package/dist/{chunk-VLC7JS4K.js → chunk-74RAXWDF.js} +1 -1
  31. package/dist/{chunk-ZYSS3JED.js → chunk-AXXK3LWL.js} +1 -1
  32. package/dist/chunk-BDNCUMZM.js +2961 -0
  33. package/dist/{chunk-E52XEEAA.js → chunk-BQG33YTI.js} +1 -1
  34. package/dist/{chunk-QPR4N2D4.js → chunk-CVBWF2MD.js} +1 -1
  35. package/dist/{chunk-R4NWAW35.js → chunk-HOBR4IHC.js} +7 -7
  36. package/dist/{chunk-XZM2I47O.js → chunk-HPWPLV5J.js} +2 -2
  37. package/dist/{chunk-FCEFKWPM.js → chunk-IEE7GIVX.js} +1 -1
  38. package/dist/{chunk-L5QASNBN.js → chunk-IOJAVV6J.js} +1 -1
  39. package/dist/{chunk-DDK22K3I.js → chunk-KLZ7OCHR.js} +3 -3
  40. package/dist/{chunk-OCNCK5FQ.js → chunk-M7XTMZF5.js} +1 -1
  41. package/dist/{chunk-GDJ74GHW.js → chunk-MPB7BQT7.js} +1 -1
  42. package/dist/{chunk-VIJ35BJ6.js → chunk-ORAISNGN.js} +14 -17
  43. package/dist/{chunk-IP3XINRB.js → chunk-P6LJ4Y32.js} +23 -2944
  44. package/dist/chunk-P73WQPSB.js +93 -0
  45. package/dist/{chunk-VTP4VSRP.js → chunk-PLP4K6WZ.js} +194 -52
  46. package/dist/{chunk-LMC46FK5.js → chunk-QMFCL2ZN.js} +1 -1
  47. package/dist/{chunk-DR7QW6C5.js → chunk-QXNRRMBQ.js} +2 -2
  48. package/dist/{chunk-C6AIZOQN.js → chunk-RRPJEHHW.js} +1 -1
  49. package/dist/{chunk-FXHVADV6.js → chunk-SAO3NQPF.js} +1 -1
  50. package/dist/{chunk-3IUSKIZW.js → chunk-SC7ICSIU.js} +1 -1
  51. package/dist/{chunk-FW7K32YT.js → chunk-SK53U3PF.js} +1 -1
  52. package/dist/{chunk-XXKBPGPJ.js → chunk-SOEQWMNS.js} +2 -2
  53. package/dist/{chunk-L5SYYW2P.js → chunk-SSZYJCAL.js} +2 -2
  54. package/dist/{chunk-U4VSY56O.js → chunk-T5HXGUM3.js} +1 -1
  55. package/dist/{chunk-ENHAGQEP.js → chunk-TMCJPHPP.js} +1 -1
  56. package/dist/{chunk-XFJXFNJF.js → chunk-TWJT2RGZ.js} +27 -12
  57. package/dist/{chunk-ZMMSMDCA.js → chunk-VDASTWUM.js} +1 -1
  58. package/dist/{chunk-T3NMEYGM.js → chunk-WZYHTXZY.js} +1 -1
  59. package/dist/{chunk-IRJBTYJF.js → chunk-XJQ7TRLG.js} +1 -1
  60. package/dist/{chunk-OEA2J2TF.js → chunk-Y2Y4LBJD.js} +3 -3
  61. package/dist/{chunk-SIN32SJB.js → chunk-YNHP6OFJ.js} +2 -2
  62. package/dist/{chunk-4KGMIOMY.js → chunk-ZBQP54CD.js} +10 -7
  63. package/dist/{clean-RPB34TT6.js → clean-X6Y252ZC.js} +14 -14
  64. package/dist/cli.js +53 -52
  65. package/dist/{cloud-QECFFPKC.js → cloud-EE4GALWR.js} +4 -4
  66. package/dist/{cloudrun-BML6ZG7K.js → cloudrun-Y6A42KHE.js} +3 -3
  67. package/dist/{compare-PF6WHQ4T.js → compare-K6XJZ3OC.js} +25 -23
  68. package/dist/{compiler-ZHVIEP26.js → compiler-DYACPLUW.js} +2 -2
  69. package/dist/{component-4ENCNLED.js → component-T6IYSCFP.js} +3 -3
  70. package/dist/{compositions-5UA33RSG.js → compositions-4KUTNS5L.js} +10 -10
  71. package/dist/{delete-SARS5LIK.js → delete-C64TWAPE.js} +2 -2
  72. package/dist/{dist-OKRUIHYU.js → dist-KNGSQALD.js} +2 -2
  73. package/dist/{doctor-TSAQGYP4.js → doctor-WJXZK5QN.js} +9 -9
  74. package/dist/{events-3HUO73ZE.js → events-FVG3Y6Q4.js} +8 -8
  75. package/dist/{events-SZ5NWYWD.js → events-QRWJBSV4.js} +7 -7
  76. package/dist/{feedback-42OTOFC6.js → feedback-NQHRUOZP.js} +9 -9
  77. package/dist/{figma-RYNFCYXB.js → figma-MEX4CSIM.js} +3 -3
  78. package/dist/fontLocalizeCli.js +7 -7
  79. package/dist/{get-IRHLG5OQ.js → get-CMJIHGSA.js} +2 -2
  80. package/dist/{gpuPolicy-LRMOZXFU.js → gpuPolicy-5S4OZDME.js} +5 -5
  81. package/dist/{grade-compare-KGJP5HV7.js → grade-compare-NIDMIUGZ.js} +25 -23
  82. package/dist/{help-C5HS56RZ.js → help-G6AWAWJW.js} +1 -1
  83. package/dist/{history-DFJNDM2T.js → history-ZBOK2JQF.js} +20 -18
  84. package/dist/hyperframe-runtime.js +36 -36
  85. package/dist/hyperframe.manifest.json +1 -1
  86. package/dist/hyperframe.runtime.iife.js +36 -36
  87. package/dist/hyperframes-player.global.js +1 -1
  88. package/dist/{info-26GTDTKN.js → info-2ORQZ6I2.js} +10 -10
  89. package/dist/{init-RXA6NI73.js → init-3PSKH6UR.js} +22 -21
  90. package/dist/{inspect-2S5GAZYC.js → inspect-NR54RMEE.js} +26 -24
  91. package/dist/{installer-DGYYDGWJ.js → installer-YQUWHYBZ.js} +5 -4
  92. package/dist/{keyframes-WBMAX7XZ.js → keyframes-KT7T4AEV.js} +11 -11
  93. package/dist/{lambda-OQBFCEFA.js → lambda-3FF4V3X3.js} +4 -4
  94. package/dist/{layout-ZRU7PXBG.js → layout-RB3M37ER.js} +26 -24
  95. package/dist/{lint-ATVNZ6FG.js → lint-HR57M5YP.js} +11 -11
  96. package/dist/{list-E2GHYPCQ.js → list-YDXYHXHF.js} +2 -2
  97. package/dist/{login-LOC4KA7H.js → login-N6UNRVYW.js} +4 -4
  98. package/dist/{media-treatment-L43MVH2V.js → media-treatment-UXJOTNRO.js} +11 -11
  99. package/dist/{models-JF5OOZ5A.js → models-Z3XFMGXB.js} +6 -6
  100. package/dist/{motionShot-BJ5CLYMN.js → motionShot-KQMCXJ77.js} +15 -12
  101. package/dist/{normalize-audio-K33FKGAF.js → normalize-audio-XJQMDWRV.js} +10 -10
  102. package/dist/{pipeline-IWPF5ZMK.js → pipeline-U3OISHWV.js} +5 -5
  103. package/dist/{play-PHHXYCQI.js → play-XP77PML5.js} +20 -19
  104. package/dist/{preflight-2GH2Z4GZ.js → preflight-CANFVC4Y.js} +6 -6
  105. package/dist/{present-KBFK2YVB.js → present-MWGA3O4S.js} +15 -15
  106. package/dist/{preview-T3E5TFDC.js → preview-X5GWZ3Q6.js} +31 -24
  107. package/dist/{producer-SL66UNEP.js → producer-B2IHU7MA.js} +1 -1
  108. package/dist/{projectConfig-7AKXZNNR.js → projectConfig-2A64YU5H.js} +7 -6
  109. package/dist/{publication-B2OERUY7.js → publication-CFYBPLRS.js} +2 -2
  110. package/dist/{publish-ZGKT7KED.js → publish-WE6AS77D.js} +8 -7
  111. package/dist/{remove-background-4LRTT6YL.js → remove-background-XSDOCVN5.js} +6 -6
  112. package/dist/{render-H6RSJF2V.js → render-5TMRIC73.js} +11 -11
  113. package/dist/{render-OKNPNMFS.js → render-HVZUCLYW.js} +21 -20
  114. package/dist/{render-TGCDBKMP.js → render-QX6AKB6Y.js} +3 -3
  115. package/dist/{render-batch-WRQFW4UC.js → render-batch-QJXFVTDE.js} +3 -3
  116. package/dist/{renderCancellation-BFCQYGVV.js → renderCancellation-WSSSHRFR.js} +5 -5
  117. package/dist/{resolver-37UOGAMT.js → resolver-WTXO6WXA.js} +5 -4
  118. package/dist/{sherpa-SDVKYXCX.js → sherpa-S6ZBBEFO.js} +6 -6
  119. package/dist/skills/hyperframes/SKILL.md +4 -0
  120. package/dist/skills/hyperframes-cli/SKILL.md +8 -0
  121. package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +8 -0
  122. package/dist/skills/media-use/audio/scripts/audio.mjs +4 -1
  123. package/dist/skills/media-use/audio/scripts/audio.test.mjs +33 -0
  124. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +1 -0
  125. package/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +44 -1
  126. package/dist/{skills-O25ZTFTO.js → skills-CDRSTETB.js} +10 -10
  127. package/dist/{skillsUpdateCheck-Y2V4OMMT.js → skillsUpdateCheck-FKREJXSF.js} +3 -3
  128. package/dist/{snapshot-KGM2HZIC.js → snapshot-T4PFSXTH.js} +142 -51
  129. package/dist/{src-PLWCT745.js → src-5BZDQAVN.js} +6 -6
  130. package/dist/{src-PJJ6NISA.js → src-IZMCUYK7.js} +4 -4
  131. package/dist/{staticProjectServer-OCE7GU5S.js → staticProjectServer-VN4ARAH4.js} +14 -13
  132. package/dist/{status-LENRPQS5.js → status-OJZWJB53.js} +5 -5
  133. package/dist/studio/assets/{hyperframes-player-DzJbtQVO.js → hyperframes-player-C-9N8nk0.js} +1 -1
  134. package/dist/studio/assets/{index-n5FUn1xv.js → index-BoUM6Xqb.js} +1 -1
  135. package/dist/studio/assets/{index-DRhF3v4Z.js → index-CAvZ0AA-.js} +204 -204
  136. package/dist/studio/assets/{index-DgwDQK5G.js → index-CVuorIMv.js} +1 -1
  137. package/dist/studio/assets/index-t1LH6H5H.css +1 -0
  138. package/dist/studio/{chunk-K47E2ZJA.js → chunk-5EKWJZLM.js} +504 -17
  139. package/dist/studio/chunk-5EKWJZLM.js.map +1 -0
  140. package/dist/studio/{chunk-VWT7STY3.js → chunk-J6Q572FA.js} +2 -2
  141. package/dist/studio/{chunk-BIUXP3PG.js → chunk-TXZMMOMA.js} +43 -276
  142. package/dist/studio/chunk-TXZMMOMA.js.map +1 -0
  143. package/dist/studio/{domEditingLayers-V67MS4WP.js → domEditingLayers-D7VYFJJD.js} +3 -5
  144. package/dist/studio/index.d.ts +46 -22
  145. package/dist/studio/index.html +2 -2
  146. package/dist/studio/index.js +3899 -3487
  147. package/dist/studio/index.js.map +1 -1
  148. package/dist/studio/player.js +2 -2
  149. package/dist/studio/styles.css +1 -1
  150. package/dist/{studio-api-IEQ5BIHT.js → studio-api-CIO2NKK5.js} +9 -7
  151. package/dist/{studioServer-LXJ34MGN.js → studioServer-G5GNYWDI.js} +45 -45
  152. package/dist/{system-4KRSV2B7.js → system-PPNNGVIM.js} +5 -5
  153. package/dist/{telemetry-R3BPD6VK.js → telemetry-GMDMISOX.js} +8 -8
  154. package/dist/{timeline-N5UKVS2S.js → timeline-5LSQX4OS.js} +14 -14
  155. package/dist/{tokens-774UBF2R.js → tokens-VBXAT7CK.js} +2 -2
  156. package/dist/{transcribe-IP74EZLM.js → transcribe-GYCAIIEQ.js} +11 -11
  157. package/dist/{transcribe-3UXXEDXX.js → transcribe-VGYAWRXS.js} +6 -6
  158. package/dist/{updateCheck-EXHNAPKI.js → updateCheck-AZEREUQV.js} +2 -2
  159. package/dist/{upgrade-A4M3O2F2.js → upgrade-S63QN2LA.js} +2 -2
  160. package/dist/{urlDownloader-4KNER64L.js → urlDownloader-SM6ODN5O.js} +4 -4
  161. package/dist/usage-EC3KFUIJ.js +2139 -0
  162. package/dist/{validate-DV75GM6J.js → validate-7MNUK5MH.js} +15 -14
  163. package/dist/{video-GINAMW5I.js → video-JEOHARTC.js} +5 -5
  164. package/package.json +1 -1
  165. package/dist/studio/assets/index-DbfKVTId.css +0 -1
  166. package/dist/studio/chunk-BIUXP3PG.js.map +0 -1
  167. package/dist/studio/chunk-K47E2ZJA.js.map +0 -1
  168. /package/dist/studio/{chunk-VWT7STY3.js.map → chunk-J6Q572FA.js.map} +0 -0
  169. /package/dist/studio/{domEditingLayers-V67MS4WP.js.map → domEditingLayers-D7VYFJJD.js.map} +0 -0
@@ -0,0 +1,93 @@
1
+ import { createRequire as __hf_createRequire } from "node:module";
2
+ import { fileURLToPath as __hf_fileURLToPath } from "node:url";
3
+ import { dirname as __hf_dirname } from "node:path";
4
+ var require = __hf_createRequire(import.meta.url);
5
+ var __filename = __hf_fileURLToPath(import.meta.url);
6
+ var __dirname = __hf_dirname(__filename);
7
+ import {
8
+ resolveCaptureBrowserGpuMode
9
+ } from "./chunk-WZYHTXZY.js";
10
+ import {
11
+ requestCliExit
12
+ } from "./chunk-PBN6GBJE.js";
13
+
14
+ // src/browser/launch.ts
15
+ var browsers = /* @__PURE__ */ new Set();
16
+ var pending = /* @__PURE__ */ new Map();
17
+ var CLOSE_GRACE_MS = 1e3;
18
+ var listening = false;
19
+ var shutdown;
20
+ function stopForSignal(signal) {
21
+ if (shutdown) return;
22
+ shutdown = closeManagedBrowsers();
23
+ void shutdown.then(
24
+ () => requestCliExit(signal === "SIGINT" ? 130 : 143),
25
+ (error) => {
26
+ console.error("Browser shutdown failed:", error);
27
+ requestCliExit(1);
28
+ }
29
+ );
30
+ }
31
+ function ownSignals() {
32
+ if (listening) return;
33
+ listening = true;
34
+ process.on("SIGINT", () => stopForSignal("SIGINT"));
35
+ process.on("SIGTERM", () => stopForSignal("SIGTERM"));
36
+ }
37
+ async function resolveManagedGpuMode(requestedMode, chromePath) {
38
+ ownSignals();
39
+ return resolveCaptureBrowserGpuMode(requestedMode, chromePath);
40
+ }
41
+ async function launchManagedBrowser(puppeteer, options) {
42
+ if (shutdown) throw new Error("The CLI is stopping; no browser can start.");
43
+ ownSignals();
44
+ const abort = new AbortController();
45
+ const signal = options.signal ? AbortSignal.any([options.signal, abort.signal]) : abort.signal;
46
+ const launch = puppeteer.launch({
47
+ ...options,
48
+ signal,
49
+ handleSIGINT: false,
50
+ handleSIGTERM: false
51
+ });
52
+ pending.set(launch, abort);
53
+ try {
54
+ const browser = await launch;
55
+ const child = browser.process();
56
+ if (!child) throw new Error("A launched browser has no owned process.");
57
+ browsers.add(browser);
58
+ child.once("exit", () => browsers.delete(browser));
59
+ return browser;
60
+ } finally {
61
+ pending.delete(launch);
62
+ }
63
+ }
64
+ async function closeManagedBrowsers() {
65
+ for (const abort of pending.values()) abort.abort();
66
+ await Promise.allSettled(pending.keys());
67
+ await Promise.all([...browsers].map(closeBrowser));
68
+ }
69
+ async function closeBrowser(browser) {
70
+ const child = browser.process();
71
+ if (!child) throw new Error("A managed browser lost its owned process.");
72
+ if (child.exitCode !== null || child.signalCode !== null) return;
73
+ const exited = new Promise((resolve) => child.once("exit", () => resolve()));
74
+ let timer;
75
+ const grace = new Promise((resolve) => {
76
+ timer = setTimeout(resolve, CLOSE_GRACE_MS);
77
+ });
78
+ try {
79
+ await Promise.race([
80
+ browser.close().catch((error) => console.warn("Browser close failed:", error)),
81
+ grace
82
+ ]);
83
+ if (child.exitCode === null && child.signalCode === null) child.kill("SIGKILL");
84
+ await exited;
85
+ } finally {
86
+ clearTimeout(timer);
87
+ }
88
+ }
89
+
90
+ export {
91
+ resolveManagedGpuMode,
92
+ launchManagedBrowser
93
+ };
@@ -12,13 +12,15 @@ import {
12
12
  parseSourceDocument,
13
13
  patchElementInHtml,
14
14
  probeElementInSource,
15
+ probeElementsInSource,
15
16
  relinkSplitHalves,
16
17
  relinkSplitHalvesInHtml,
17
18
  removeElementFromHtml,
19
+ removeElementsFromHtml,
18
20
  splitElementInHtml,
19
21
  unwrapElementsFromHtml,
20
22
  wrapElementsInHtml
21
- } from "./chunk-XFJXFNJF.js";
23
+ } from "./chunk-TWJT2RGZ.js";
22
24
  import {
23
25
  atomicTempPath,
24
26
  createFileAtomically,
@@ -31,7 +33,7 @@ import {
31
33
  measureAudio,
32
34
  requiredFfmpeg,
33
35
  resolveLocalAudioPath
34
- } from "./chunk-GDJ74GHW.js";
36
+ } from "./chunk-MPB7BQT7.js";
35
37
  import {
36
38
  PROXY_PARAMS_VERSION,
37
39
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -57,7 +59,7 @@ import {
57
59
  shouldPrewarmProxy,
58
60
  waitForProxy,
59
61
  walkDir
60
- } from "./chunk-LMC46FK5.js";
62
+ } from "./chunk-QMFCL2ZN.js";
61
63
  import {
62
64
  findTimelineScript,
63
65
  parseGsapScriptAcorn
@@ -76,7 +78,7 @@ import {
76
78
  formatRenderOutputTimestamp,
77
79
  parseFps,
78
80
  sameInstant
79
- } from "./chunk-FCEFKWPM.js";
81
+ } from "./chunk-IEE7GIVX.js";
80
82
  import {
81
83
  MagicString,
82
84
  VALID_CANVAS_RESOLUTIONS,
@@ -85,7 +87,7 @@ import {
85
87
  import {
86
88
  addScenePartsManifest,
87
89
  ensureHfIds
88
- } from "./chunk-OCNCK5FQ.js";
90
+ } from "./chunk-M7XTMZF5.js";
89
91
  import {
90
92
  findStartTags,
91
93
  injectScriptsIntoHtml,
@@ -95,7 +97,7 @@ import {
95
97
  resolveRateSpec,
96
98
  sourceTimeAt,
97
99
  stripEmbeddedRuntimeScripts
98
- } from "./chunk-C6AIZOQN.js";
100
+ } from "./chunk-RRPJEHHW.js";
99
101
  import {
100
102
  ProjectRootMissingError,
101
103
  folderGone,
@@ -213,7 +215,7 @@ function stampFileHfIds(filePath) {
213
215
  }
214
216
  }
215
217
 
216
- // ../studio-server/dist/chunk-EPL4YKGI.js
218
+ // ../studio-server/dist/chunk-E3HLZKPI.js
217
219
  import { randomUUID as randomUUID6 } from "crypto";
218
220
  import { mkdir as mkdir2, readdir as readdir3, rm as rm3, rmdir, writeFile } from "fs/promises";
219
221
  import {
@@ -1015,6 +1017,7 @@ function ignoresCase(dir) {
1015
1017
  return self !== void 0 && other?.ino === self.ino && other.dev === self.dev;
1016
1018
  }
1017
1019
  var blocks = (removed, added) => added.startsWith(`${removed}/`) || removed.startsWith(`${added}/`);
1020
+ var MAX_TIMER_MS = 2 ** 31 - 1;
1018
1021
  var takesWrite = (window2, at) => window2.idleMs === void 0 || at - (window2.lastWriteAt ?? at) <= window2.idleMs;
1019
1022
  function chainBackFrom(byAfter, hash) {
1020
1023
  const chain = /* @__PURE__ */ new Map();
@@ -1170,7 +1173,7 @@ var Engine = class {
1170
1173
  this.windows.push({ id, who, label, startedAt, lastWriteAt, idleMs, changes: /* @__PURE__ */ new Map() });
1171
1174
  }
1172
1175
  async firstOpen() {
1173
- const sweptAt = Date.now();
1176
+ const sweptAt = this.now();
1174
1177
  for (const file of listProjectFiles(this.dir)) {
1175
1178
  const hash = await this.storeIfPresent(file.path);
1176
1179
  if (this.whereFolder() !== "here") throw this.replaced();
@@ -1202,7 +1205,7 @@ var Engine = class {
1202
1205
  */
1203
1206
  async sweep() {
1204
1207
  if (this.whereFolder() !== "here") return;
1205
- const sweptAt = Date.now();
1208
+ const sweptAt = this.now();
1206
1209
  const changedAt = (file) => Math.min(sweptAt, Math.max(file.mtimeMs, file.ctimeMs));
1207
1210
  const seen = listProjectFiles(this.dir);
1208
1211
  const heard = new Map(this.overwritten);
@@ -1477,7 +1480,7 @@ var Engine = class {
1477
1480
  await this.settle();
1478
1481
  const window2 = { ...this.newGroup(who, label), idleMs };
1479
1482
  this.windows.push(window2);
1480
- this.touch(window2, Date.now());
1483
+ this.touch(window2, this.now());
1481
1484
  const close = () => this.queue(() => this.sweepAndEnd(window2));
1482
1485
  return { id: window2.id, startedAt: window2.startedAt, close };
1483
1486
  });
@@ -1485,11 +1488,19 @@ var Engine = class {
1485
1488
  /** A window with no write for its idleMs ends, so a close that never comes cannot hold every later write. */
1486
1489
  touch(window2, at) {
1487
1490
  window2.lastWriteAt = Math.max(window2.lastWriteAt ?? at, at);
1491
+ this.endWhenIdle(window2, window2.idleMs);
1492
+ }
1493
+ endWhenIdle(window2, delay) {
1488
1494
  clearTimeout(window2.idleTimer);
1489
- if (window2.idleMs === void 0 || !Number.isFinite(window2.idleMs)) return;
1495
+ if (window2.idleMs === void 0 || !Number.isFinite(window2.idleMs) || delay === void 0)
1496
+ return;
1490
1497
  window2.idleTimer = setTimeout(
1491
- () => this.background(() => this.sweepAndEnd(window2)),
1492
- window2.idleMs
1498
+ () => {
1499
+ const left = window2.idleMs - (this.now() - (window2.lastWriteAt ?? this.now()));
1500
+ if (left > 0) this.endWhenIdle(window2, left);
1501
+ else this.background(() => this.sweepAndEnd(window2));
1502
+ },
1503
+ Math.min(delay, MAX_TIMER_MS)
1493
1504
  );
1494
1505
  window2.idleTimer.unref?.();
1495
1506
  }
@@ -1799,7 +1810,7 @@ function historyCache(open2) {
1799
1810
  };
1800
1811
  }
1801
1812
 
1802
- // ../studio-server/dist/chunk-W2SBTCO2.js
1813
+ // ../studio-server/dist/chunk-IMG2GSY6.js
1803
1814
  function getElementScreenshotClip(selector, selectorIndex) {
1804
1815
  let matches;
1805
1816
  try {
@@ -1812,6 +1823,16 @@ function getElementScreenshotClip(selector, selectorIndex) {
1812
1823
  const safeIndex = Math.max(0, Math.min(matches.length - 1, Math.floor(selectorIndex ?? 0)));
1813
1824
  const el = matches[safeIndex] ?? null;
1814
1825
  if (!(el instanceof HTMLElement)) return void 0;
1826
+ const page = window;
1827
+ const faded = page.__hfThumbnailFaded ??= [];
1828
+ for (let node = el; node.parentElement; node = node.parentElement) {
1829
+ for (const sibling of Array.from(node.parentElement.children)) {
1830
+ const style = sibling.style;
1831
+ if (sibling === node || !style) continue;
1832
+ faded.push([style, style.getPropertyValue("opacity"), style.getPropertyPriority("opacity")]);
1833
+ style.setProperty("opacity", "0", "important");
1834
+ }
1835
+ }
1815
1836
  const rect = el.getBoundingClientRect();
1816
1837
  if (rect.width < 4 || rect.height < 4) return void 0;
1817
1838
  const pad = 8;
@@ -1826,6 +1847,14 @@ function getElementScreenshotClip(selector, selectorIndex) {
1826
1847
  height: Math.max(1, Math.min(rect.height + pad * 2, maxHeight))
1827
1848
  };
1828
1849
  }
1850
+ function clearElementScreenshotIsolation() {
1851
+ const page = window;
1852
+ for (const [style, value, priority] of (page.__hfThumbnailFaded ?? []).reverse()) {
1853
+ if (value) style.setProperty("opacity", value, priority);
1854
+ else style.removeProperty("opacity");
1855
+ }
1856
+ page.__hfThumbnailFaded = [];
1857
+ }
1829
1858
 
1830
1859
  // ../studio-server/dist/chunk-WK3ZL3SN.js
1831
1860
  import { resolve as resolve4 } from "path";
@@ -2101,7 +2130,8 @@ import {
2101
2130
  statSync as statSync32,
2102
2131
  fstatSync as fstatSync2,
2103
2132
  renameSync as renameSync22,
2104
- readdirSync as readdirSync22
2133
+ readdirSync as readdirSync22,
2134
+ realpathSync as realpathSync2
2105
2135
  } from "fs";
2106
2136
  import { resolve as resolve22, dirname as dirname32, join as join52 } from "path";
2107
2137
  import { spawn } from "child_process";
@@ -5121,14 +5151,15 @@ import {
5121
5151
  writeFileSync as writeFileSync42
5122
5152
  } from "fs";
5123
5153
  import { join as join11 } from "path";
5124
- import { createHash as createHash32, randomUUID as randomUUID22 } from "crypto";
5154
+ import { createHash as createHash42, randomUUID as randomUUID22 } from "crypto";
5125
5155
  import { readFileSync as readFileSync8 } from "fs";
5156
+ import { createHash as createHash32 } from "crypto";
5126
5157
  import { existsSync as existsSync7, readFileSync as readFileSync10, statSync as statSync7 } from "fs";
5127
5158
  import { join as join12, resolve as resolve52 } from "path";
5128
5159
  import { execFile } from "child_process";
5129
5160
  import { existsSync as existsSync8, readFileSync as readFileSync11, statSync as statSync8 } from "fs";
5130
5161
  import { dirname as dirname52, join as join13, relative as relative4, sep as sep22 } from "path";
5131
- import { createHash as createHash42, randomBytes } from "crypto";
5162
+ import { createHash as createHash5, randomBytes } from "crypto";
5132
5163
  import { existsSync as existsSync9 } from "fs";
5133
5164
  import { existsSync as existsSync10, readFileSync as readFileSync12, statSync as statSync9 } from "fs";
5134
5165
  import { join as join14, resolve as resolve6 } from "path";
@@ -5141,7 +5172,7 @@ import { basename as basename22, dirname as dirname6, extname as extname2, join
5141
5172
  import { existsSync as existsSync12, readFileSync as readFileSync13 } from "fs";
5142
5173
  import { homedir as homedir2 } from "os";
5143
5174
  import { join as join16 } from "path";
5144
- import { createHash as createHash5 } from "crypto";
5175
+ import { createHash as createHash6 } from "crypto";
5145
5176
  import { readFileSync as readFileSync14, readdirSync as readdirSync5, rmSync as rmSync5 } from "fs";
5146
5177
  import { join as join17 } from "path";
5147
5178
  async function filterCompositionFiles(projectDir, files) {
@@ -6103,18 +6134,83 @@ function readableText(file) {
6103
6134
  throw error;
6104
6135
  }
6105
6136
  }
6106
- function updateReferences(projectDir, oldPath, newPath) {
6137
+ var escapeRegExp = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
6138
+ var SEPARATOR = String.raw`\\{0,2}[\\/]`;
6139
+ var REFERENCE_START = String.raw`(?<![\w./\\+-])`;
6140
+ var FILE_END = String.raw`(?![\w-]|\.\w)`;
6141
+ function referencePattern(oldPath, isDirectory) {
6142
+ const name = oldPath.split("/").map(escapeRegExp).join(SEPARATOR);
6143
+ const end = isDirectory ? `(?=${SEPARATOR})` : FILE_END;
6144
+ return new RegExp(
6145
+ String.raw`${REFERENCE_START}(?<lead>(?:\.{1,2}${SEPARATOR}|${SEPARATOR}){0,4})${name}${end}`,
6146
+ "g"
6147
+ );
6148
+ }
6149
+ function referenceRewriter(oldPath, newPath, isDirectory, existing = []) {
6150
+ const pattern = referencePattern(oldPath, isDirectory);
6151
+ const around = /* @__PURE__ */ new Map();
6152
+ const afterLengths = /* @__PURE__ */ new Set();
6153
+ let window2 = 0;
6154
+ for (const path of existing) {
6155
+ if (path.length <= oldPath.length) continue;
6156
+ for (const start of occurrences(path, oldPath)) {
6157
+ const [before, after] = [path.slice(0, start), path.slice(start + oldPath.length)];
6158
+ const befores = around.get(after) ?? around.set(after, /* @__PURE__ */ new Map()).get(after);
6159
+ (befores.get(before.length) ?? befores.set(before.length, /* @__PURE__ */ new Set()).get(before.length)).add(
6160
+ before
6161
+ );
6162
+ afterLengths.add(after.length);
6163
+ window2 = Math.max(window2, path.length * 3);
6164
+ }
6165
+ }
6166
+ const normalized = (text2) => text2.replace(/\\{0,2}[\\/]/g, "/");
6167
+ return (text2) => text2.replace(pattern, (...args) => {
6168
+ const [match, offset] = [args[0], args.at(-3)];
6169
+ const { lead } = args.at(-1);
6170
+ const at = offset + lead.length;
6171
+ const head = normalized(text2.slice(Math.max(0, at - window2), at));
6172
+ const tail = normalized(text2.slice(offset + match.length, offset + match.length + window2));
6173
+ const inLonger = [...afterLengths].some((after) => {
6174
+ const befores = tail.length >= after && around.get(tail.slice(0, after));
6175
+ return befores && [...befores].some(
6176
+ ([length, set]) => head.length >= length && set.has(head.slice(head.length - length))
6177
+ );
6178
+ });
6179
+ return inLonger ? match : `${lead}${newPath}`;
6180
+ });
6181
+ }
6182
+ function occurrences(text2, part) {
6183
+ const at = [];
6184
+ for (let i = text2.indexOf(part); i >= 0; i = text2.indexOf(part, i + 1)) at.push(i);
6185
+ return at;
6186
+ }
6187
+ function projectPaths(root, dir = root, prefix = "", ancestors = /* @__PURE__ */ new Set()) {
6188
+ return readableEntries(dir).flatMap((entry) => {
6189
+ const [path, full2] = [`${prefix}${entry.name}`, join52(dir, entry.name)];
6190
+ const real = entry.name === "node_modules" ? null : directoryReal(entry, full2);
6191
+ if (real === null || ancestors.has(real) || !isSafePath(root, full2)) return [path];
6192
+ return [path, ...projectPaths(root, full2, `${path}/`, /* @__PURE__ */ new Set([...ancestors, real]))];
6193
+ });
6194
+ }
6195
+ function directoryReal(entry, full2) {
6196
+ try {
6197
+ return entry.isDirectory() || entry.isSymbolicLink() && statSync32(full2).isDirectory() ? realpathSync2(full2) : null;
6198
+ } catch {
6199
+ return null;
6200
+ }
6201
+ }
6202
+ function updateReferences(projectDir, oldPath, newPath, isDirectory) {
6107
6203
  const textFiles = walkFiles(
6108
6204
  projectDir,
6109
6205
  (name) => /\.(html|css|js|jsx|ts|tsx|json|mjs|cjs|md|mdx)$/i.test(name)
6110
6206
  );
6207
+ const rewrite = referenceRewriter(oldPath, newPath, isDirectory, projectPaths(projectDir));
6111
6208
  let updatedCount = 0;
6112
6209
  for (const file of textFiles) {
6113
6210
  if (!isSafePath(projectDir, file)) continue;
6114
6211
  const content = readableText(file);
6115
6212
  if (content === null) continue;
6116
- if (!content.includes(oldPath)) continue;
6117
- const updated = content.split(oldPath).join(newPath);
6213
+ const updated = rewrite(content);
6118
6214
  if (updated !== content) {
6119
6215
  replaceFileAtomically(file, updated, statSync32(file).mode);
6120
6216
  updatedCount++;
@@ -6388,7 +6484,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
6388
6484
  let block = extractGsapScriptBlock(html);
6389
6485
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
6390
6486
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
6391
- const { GSAP_CDN } = await import("./dist-OKRUIHYU.js");
6487
+ const { GSAP_CDN } = await import("./dist-KNGSQALD.js");
6392
6488
  const bootstrap = [
6393
6489
  `<script src="${GSAP_CDN}"></script>`,
6394
6490
  "<script>",
@@ -6436,7 +6532,9 @@ async function applyGsapMutations(c, res, mutations) {
6436
6532
  } catch (error) {
6437
6533
  return c.json({ error: error instanceof Error ? error.message : String(error) }, 400);
6438
6534
  }
6535
+ const mutationChanges = [];
6439
6536
  for (const mutation of mutations) {
6537
+ const previousScript = block.scriptText;
6440
6538
  const result = await executeGsapMutation(mutation, block, respond, writer);
6441
6539
  if (result instanceof Response) return result;
6442
6540
  let newScript = typeof result === "string" ? result : result.script;
@@ -6446,6 +6544,7 @@ async function applyGsapMutations(c, res, mutations) {
6446
6544
  if (HOLD_SYNC_MUTATION_TYPES.has(mutation.type)) {
6447
6545
  newScript = writer === "acorn" ? syncPositionHoldsBeforeKeyframes(newScript) : (await loadGsapParser()).syncPositionHoldsBeforeKeyframes(newScript);
6448
6546
  }
6547
+ mutationChanges.push(newScript !== previousScript);
6449
6548
  block.scriptText = newScript;
6450
6549
  }
6451
6550
  const changed = block.scriptText !== initialScript;
@@ -6470,6 +6569,7 @@ async function applyGsapMutations(c, res, mutations) {
6470
6569
  ok: true,
6471
6570
  changed,
6472
6571
  mutated: changed,
6572
+ mutationChanges,
6473
6573
  parsed: parseGsapScriptAcorn(block.scriptText),
6474
6574
  before: beforeHtml,
6475
6575
  after: newHtml,
@@ -7529,11 +7629,14 @@ function registerFileRoutes(api, adapter) {
7529
7629
  return c.json({ error: "targets required" }, 400);
7530
7630
  }
7531
7631
  const originalContent = readFileSync32(ctx.absPath, "utf-8");
7532
- let next = originalContent;
7533
- for (const target of targets) {
7534
- next = removeElementFromHtml(next, target);
7535
- }
7536
- return writeIfChanged(c, ctx.project.dir, ctx.filePath, ctx.absPath, originalContent, next);
7632
+ return writeIfChanged(
7633
+ c,
7634
+ ctx.project.dir,
7635
+ ctx.filePath,
7636
+ ctx.absPath,
7637
+ originalContent,
7638
+ removeElementsFromHtml(originalContent, targets)
7639
+ );
7537
7640
  });
7538
7641
  api.post("/projects/:id/file-mutations/split-batch", async (c) => {
7539
7642
  const body = await c.req.json().catch(() => null);
@@ -7937,6 +8040,19 @@ function registerFileRoutes(api, adapter) {
7937
8040
  const exists = probeElementInSource(content, parsed.target);
7938
8041
  return c.json({ exists });
7939
8042
  });
8043
+ api.post("/projects/:id/file-mutations/probe-elements/*", async (c) => {
8044
+ const ctx = await resolveFileMutationContext(c, adapter, "probe-elements");
8045
+ if ("error" in ctx) return ctx.error;
8046
+ const body = await c.req.json().catch(() => null);
8047
+ if (!Array.isArray(body?.targets)) return c.json({ error: "targets required" }, 400);
8048
+ let content;
8049
+ try {
8050
+ content = readFileSync32(ctx.absPath, "utf-8");
8051
+ } catch {
8052
+ return c.json({ exists: body.targets.map(() => false) });
8053
+ }
8054
+ return c.json({ exists: probeElementsInSource(content, body.targets) });
8055
+ });
7940
8056
  api.patch("/projects/:id/files/*", async (c) => {
7941
8057
  const res = await resolveProjectFile(c, adapter, { mustExist: true });
7942
8058
  if ("error" in res) return res.error;
@@ -7951,9 +8067,10 @@ function registerFileRoutes(api, adapter) {
7951
8067
  if (existsSync3(newAbs)) {
7952
8068
  return c.json({ error: "already exists" }, 409);
7953
8069
  }
8070
+ const isDirectory = statSync32(res.absPath, { throwIfNoEntry: false })?.isDirectory() ?? false;
7954
8071
  ensureDir(res.project.dir, newAbs);
7955
8072
  renameSync22(res.absPath, newAbs);
7956
- const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath);
8073
+ const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath, isDirectory);
7957
8074
  return c.json({ ok: true, path: body.newPath, updatedReferences: updatedFiles });
7958
8075
  });
7959
8076
  api.post("/projects/:id/duplicate-file", async (c) => {
@@ -8019,17 +8136,18 @@ function registerFileRoutes(api, adapter) {
8019
8136
  });
8020
8137
  if ("error" in res) return res.error;
8021
8138
  const html = readFileSync32(res.absPath, "utf-8");
8139
+ const etag = `${fileContentVersion(html).slice(0, -1)}:gsap-animations:v1"`;
8140
+ const headers = { ETag: etag, "Cache-Control": "no-cache" };
8141
+ if (c.req.header("If-None-Match") === etag) return new Response(null, { status: 304, headers });
8022
8142
  const block = extractGsapScriptBlock(html);
8023
8143
  if (!block) {
8024
- return c.json({
8025
- animations: [],
8026
- timelineVar: "tl",
8027
- preamble: "",
8028
- postamble: ""
8029
- });
8144
+ return c.json(
8145
+ { animations: [], timelineVar: "tl", preamble: "", postamble: "" },
8146
+ 200,
8147
+ headers
8148
+ );
8030
8149
  }
8031
- const parsed = parseGsapScriptAcorn(block.scriptText);
8032
- return c.json(parsed);
8150
+ return c.json(parseGsapScriptAcorn(block.scriptText), 200, headers);
8033
8151
  });
8034
8152
  api.get("/projects/:id/gsap-mutation-capabilities", async (c) => {
8035
8153
  const project = await adapter.resolveProject(c.req.param("id"));
@@ -8179,6 +8297,9 @@ function tagRootCompositionFile(bodyHtml, compPath) {
8179
8297
  if (bodyHtml.slice(match.index, tagEnd).includes("data-composition-file")) return bodyHtml;
8180
8298
  return bodyHtml.slice(0, tagEnd) + ` data-composition-file="${compPath}"` + bodyHtml.slice(tagEnd);
8181
8299
  }
8300
+ function rootHeadContent(rootHtml) {
8301
+ return rootHtml.match(/<head[^>]*>([\s\S]*?)<\/head>/i)?.[1] ?? "";
8302
+ }
8182
8303
  function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, rawOverride) {
8183
8304
  const compFile = join62(projectDir, compPath);
8184
8305
  if (!existsSync42(compFile)) return null;
@@ -8214,11 +8335,7 @@ function buildSubCompositionHtml(projectDir, compPath, runtimeUrl, baseHref, raw
8214
8335
  rewrittenContent = tagRootCompositionFile(rewrittenContent, compPath);
8215
8336
  const indexPath = join62(projectDir, "index.html");
8216
8337
  let headContent = "";
8217
- if (existsSync42(indexPath)) {
8218
- const indexHtml = readFileSync42(indexPath, "utf-8");
8219
- const headMatch = indexHtml.match(/<head[^>]*>([\s\S]*?)<\/head>/i);
8220
- headContent = headMatch?.[1] ?? "";
8221
- }
8338
+ if (existsSync42(indexPath)) headContent = rootHeadContent(readFileSync42(indexPath, "utf-8"));
8222
8339
  if (baseHref && !hasBaseElement(headContent)) {
8223
8340
  headContent = `<base href="${baseHref}">
8224
8341
  ${headContent}`;
@@ -9357,25 +9474,49 @@ function closureOf(read, compPath) {
9357
9474
  return closure;
9358
9475
  }
9359
9476
  var inputSignatures = /* @__PURE__ */ new Map();
9477
+ var rootMemos = /* @__PURE__ */ new Map();
9478
+ var sha1 = (text2) => createHash32("sha1").update(text2).digest("hex");
9479
+ function rootHashes(read) {
9480
+ const source = read(ROOT_COMPOSITION) ?? "";
9481
+ return { root: sha1(source), head: sha1(rootHeadContent(source)) };
9482
+ }
9360
9483
  function compositionInputSignature(projectDir, compPath, projectSignature) {
9361
9484
  const key = `${projectDir}\0${compPath}`;
9362
9485
  const known = inputSignatures.get(key);
9363
9486
  if (known?.projectSignature === projectSignature) return known.inputSignature;
9364
9487
  const read = projectReader(projectDir);
9365
- const inputs = closureOf(read, normalizeSource(compPath) ?? compPath).add(ROOT_COMPOSITION);
9366
- const siblings = [...closureOf(read, ROOT_COMPOSITION)].filter((path) => !inputs.has(path));
9367
- const inputSignature = createProjectSignature(projectDir, new Set(siblings));
9488
+ const comp = normalizeSource(compPath) ?? compPath;
9489
+ const inputs = closureOf(read, comp).add(ROOT_COMPOSITION);
9490
+ const excluded = new Set(
9491
+ [...closureOf(read, ROOT_COMPOSITION)].filter((path) => !inputs.has(path))
9492
+ );
9493
+ let inputSignature;
9494
+ if (comp === ROOT_COMPOSITION) {
9495
+ inputSignature = createProjectSignature(projectDir, excluded);
9496
+ } else {
9497
+ const hashes = rootHashes(read);
9498
+ if (!rootMemos.has(projectDir)) rootMemos.set(projectDir, { ...hashes, affected: null });
9499
+ inputSignature = `${createProjectSignature(projectDir, excluded.add(ROOT_COMPOSITION))}:${hashes.head}`;
9500
+ }
9368
9501
  inputSignatures.set(key, { projectSignature, inputSignature });
9369
9502
  return inputSignature;
9370
9503
  }
9371
9504
  function compositionsAffectedBy(projectDir, changedPath) {
9372
9505
  const changed = changedPath.replace(/\\/g, "/");
9373
9506
  const read = projectReader(projectDir);
9507
+ if (changed === ROOT_COMPOSITION) {
9508
+ const now = rootHashes(read);
9509
+ const memo = rootMemos.get(projectDir);
9510
+ if (memo?.root === now.root) return memo.affected;
9511
+ const affected = memo?.head === now.head ? [ROOT_COMPOSITION] : null;
9512
+ rootMemos.set(projectDir, { ...now, affected });
9513
+ return affected;
9514
+ }
9374
9515
  const mounted = closureOf(read, ROOT_COMPOSITION);
9375
- if (changed === ROOT_COMPOSITION || !mounted.has(changed)) return null;
9516
+ if (!mounted.has(changed)) return null;
9376
9517
  return [...mounted].filter((path) => closureOf(read, path).has(changed));
9377
9518
  }
9378
- var THUMBNAIL_CACHE_VERSION = "v4";
9519
+ var THUMBNAIL_CACHE_VERSION = "v5";
9379
9520
  var THUMBNAIL_MAX_OUTPUT_WIDTH = 240;
9380
9521
  var THUMBNAIL_MAX_OUTPUT_HEIGHT = 135;
9381
9522
  var THUMBNAIL_CACHE_MAX_BYTES = 512 * 1024 * 1024;
@@ -9448,7 +9589,7 @@ function readFileOnce(file) {
9448
9589
  function manifestKey(file) {
9449
9590
  const manifest = readFileOnce(file);
9450
9591
  if (typeof manifest === "string") return { key: "", mtimeMs: -Infinity };
9451
- const hash = createHash32("sha1").update(manifest.data).digest("hex").slice(0, 16);
9592
+ const hash = createHash42("sha1").update(manifest.data).digest("hex").slice(0, 16);
9452
9593
  return { key: `_${hash}`, mtimeMs: Math.round(manifest.mtimeMs) };
9453
9594
  }
9454
9595
  function registerThumbnailRoutes(api, adapter) {
@@ -9485,7 +9626,7 @@ function registerThumbnailRoutes(api, adapter) {
9485
9626
  let sourceKey = "";
9486
9627
  if (source !== "missing") {
9487
9628
  const html = source.data.toString("utf-8");
9488
- sourceKey = `_${createHash32("sha1").update(html).digest("hex").slice(0, 16)}`;
9629
+ sourceKey = `_${createHash42("sha1").update(html).digest("hex").slice(0, 16)}`;
9489
9630
  sourceMtime = Math.round(source.mtimeMs);
9490
9631
  if (!vpWidth) {
9491
9632
  const wMatch = html.match(/data-width=["'](\d+)["']/);
@@ -9501,9 +9642,9 @@ function registerThumbnailRoutes(api, adapter) {
9501
9642
  const previewPath = compPath === "index.html" ? `${projectUrl}/preview` : `${projectUrl}/preview/comp/${compPath.split("/").map(encodeURIComponent).join("/")}`;
9502
9643
  const previewUrl = `${previewPath}?${PREVIEW_CAPTURE_PARAM}=1`;
9503
9644
  const cacheDir = join11(project.dir, ".thumbnails");
9504
- const selectorKey = selector ? `_${selector.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 80)}_${selectorIndex ?? 0}` : "";
9645
+ const selectorKey = selector ? `_${createHash42("sha1").update(selector).digest("hex").slice(0, 16)}_${selectorIndex ?? 0}` : "";
9505
9646
  const urlVersionKey = urlVersion ? `_${urlVersion.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 32)}` : "";
9506
- const inputSignatureKey = `_${createHash32("sha1").update(inputSignature).digest("hex").slice(0, 16)}`;
9647
+ const inputSignatureKey = `_${createHash42("sha1").update(inputSignature).digest("hex").slice(0, 16)}`;
9507
9648
  const outputScale = outputMode === "source" ? 1 : Math.min(1, THUMBNAIL_MAX_OUTPUT_WIDTH / compW, THUMBNAIL_MAX_OUTPUT_HEIGHT / compH);
9508
9649
  const outputWidth = Math.max(1, Math.round(compW * outputScale));
9509
9650
  const outputHeight = Math.max(1, Math.round(compH * outputScale));
@@ -9631,7 +9772,7 @@ function freezeExtractArgs(src, mediaTime, output) {
9631
9772
  var randomStillToken = () => randomBytes(4).toString("hex");
9632
9773
  function freezeStillFileName(clipId, playhead, token = randomStillToken()) {
9633
9774
  const stem = clipId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 48) || "clip";
9634
- const idHash = createHash42("sha256").update(clipId).digest("hex").slice(0, 10);
9775
+ const idHash = createHash5("sha256").update(clipId).digest("hex").slice(0, 10);
9635
9776
  return `${stem}-${idHash}-${Math.round(playhead * 1e3)}-${token}.png`;
9636
9777
  }
9637
9778
  function readFreezeSource(html, target, playhead) {
@@ -10790,7 +10931,7 @@ function numericAttribute(element, name) {
10790
10931
  }
10791
10932
  function createPreviewDocumentStore(projectDir, salt) {
10792
10933
  const dir = join17(projectDir, ".hyperframes", "preview");
10793
- const fileFor = (key) => join17(dir, `${createHash5("sha256").update(`${salt}
10934
+ const fileFor = (key) => join17(dir, `${createHash6("sha256").update(`${salt}
10794
10935
  ${key}`).digest("hex").slice(0, 32)}.html`);
10795
10936
  return {
10796
10937
  read(key) {
@@ -10899,6 +11040,7 @@ export {
10899
11040
  openProjectHistory,
10900
11041
  historyCache,
10901
11042
  getElementScreenshotClip,
11043
+ clearElementScreenshotIsolation,
10902
11044
  injectMediaCodecMapIntoHtml,
10903
11045
  STUDIO_MOTION_PATH,
10904
11046
  createStudioMotionRenderBodyScript,
@@ -8,7 +8,7 @@ import {
8
8
  firstFrameColourArgs,
9
9
  hdrToSdrToneMapFilter,
10
10
  parseFirstFrameColour
11
- } from "./chunk-FCEFKWPM.js";
11
+ } from "./chunk-IEE7GIVX.js";
12
12
  import {
13
13
  mkdirWithinProject,
14
14
  realProjectRoot,
@@ -8,14 +8,14 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemFile,
10
10
  validRegistryItem
11
- } from "./chunk-IP3XINRB.js";
11
+ } from "./chunk-BDNCUMZM.js";
12
12
  import {
13
13
  publishRegistryFile,
14
14
  registryTargetPath
15
15
  } from "./chunk-GMECXFAN.js";
16
16
  import {
17
17
  validateVariables
18
- } from "./chunk-FCEFKWPM.js";
18
+ } from "./chunk-IEE7GIVX.js";
19
19
  import {
20
20
  realProjectRoot
21
21
  } from "./chunk-OFQWTKPW.js";