hyperframes 0.8.98 → 0.8.100

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 (159) hide show
  1. package/dist/{add-QAX64UD5.js → add-YOGFHV5P.js} +18 -17
  2. package/dist/{animatedGifPrep-5KUI3AAL.js → animatedGifPrep-RZVYVAXD.js} +8 -7
  3. package/dist/{asset-6PAUWV7A.js → asset-RVTEKOMS.js} +2 -2
  4. package/dist/{assetCataloger-FUXNMJYE.js → assetCataloger-BQREHRS2.js} +4 -3
  5. package/dist/{auth-RURB6JL2.js → auth-3ZGHKXTY.js} +2 -2
  6. package/dist/{autoUpdate-ZX5GPKIG.js → autoUpdate-DHDVAKLG.js} +2 -2
  7. package/dist/{backgroundChecks-GZ3LYLFZ.js → backgroundChecks-TJZXWBCQ.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-2BIKSPOP.js → batchRender-AQN5PRXM.js} +5 -4
  10. package/dist/{beats-FMDUDET7.js → beats-PZEJBKPX.js} +12 -11
  11. package/dist/{benchmark-5NXPAFTK.js → benchmark-XTNKYDB3.js} +14 -13
  12. package/dist/{browser-W5IZK2LF.js → browser-33R5MU5T.js} +11 -10
  13. package/dist/{bundleWithLocalizedFonts-QYS67RJT.js → bundleWithLocalizedFonts-JKJKZR2S.js} +2 -2
  14. package/dist/{capture-Z47X2EG6.js → capture-5BCJWVC7.js} +2 -2
  15. package/dist/{capture-HOXFOHCG.js → capture-QYLHIYKJ.js} +9 -8
  16. package/dist/{catalog-TEUY2DP3.js → catalog-QCJADIDT.js} +19 -18
  17. package/dist/{check-6KE5ZV6K.js → check-V5AIEMEJ.js} +34 -32
  18. package/dist/{checkBrowser-F6MKBAL3.js → checkBrowser-LI4OCQCC.js} +33 -31
  19. package/dist/{chunk-45WXLLUL.js → chunk-32Y3HRS3.js} +2 -2
  20. package/dist/{chunk-DHLZLPIA.js → chunk-3ME4RRT4.js} +8 -8
  21. package/dist/{chunk-M7Y4BQAC.js → chunk-4WAMN4IF.js} +1 -1
  22. package/dist/chunk-4Z5O7BTD.js +114 -0
  23. package/dist/{chunk-H5ZRB3SN.js → chunk-6CN2QLB5.js} +3 -3
  24. package/dist/{chunk-6SXRFLBV.js → chunk-6F6EEQNB.js} +5 -12
  25. package/dist/{chunk-MRQEWIM3.js → chunk-7PJG4Z2H.js} +8 -8
  26. package/dist/{chunk-OIT6L7OY.js → chunk-AZQLJHAO.js} +1 -1
  27. package/dist/{chunk-A7GG3RLG.js → chunk-EBY3SP4T.js} +4 -4
  28. package/dist/chunk-FOKUJKBN.js +3420 -0
  29. package/dist/{chunk-EA5GAMEY.js → chunk-GMECXFAN.js} +1 -1
  30. package/dist/{chunk-QVGB3PQ2.js → chunk-GOI4GCUB.js} +1 -1
  31. package/dist/{chunk-ULER6XBR.js → chunk-HFFR7TN7.js} +1 -1
  32. package/dist/{chunk-6D7WQM6D.js → chunk-HGJZKJRO.js} +1 -1
  33. package/dist/{chunk-J7QMXLNY.js → chunk-HUHJYNST.js} +1 -1
  34. package/dist/{chunk-4CMGNIJD.js → chunk-I6M4GXMC.js} +1 -1
  35. package/dist/{chunk-QPN3GV5R.js → chunk-I77CAR4W.js} +2 -2
  36. package/dist/{chunk-UH4PYJXV.js → chunk-IGV5J5ZW.js} +1 -1
  37. package/dist/{chunk-WPP2NJVF.js → chunk-IH6NEFVL.js} +3 -3
  38. package/dist/{chunk-UPGW6TTK.js → chunk-IQ4UCWV7.js} +1 -1
  39. package/dist/{chunk-6RC6OPDF.js → chunk-JUJ2XONM.js} +9 -9
  40. package/dist/{chunk-VSVNEDUL.js → chunk-JXXE3SWC.js} +10 -10
  41. package/dist/{chunk-7JABNLBL.js → chunk-L5FZ5SFX.js} +5 -5
  42. package/dist/{chunk-B7E6IWMM.js → chunk-LBPAJ5EJ.js} +1 -1
  43. package/dist/{chunk-KF4BPO7K.js → chunk-M4KS6MJN.js} +4 -4
  44. package/dist/{chunk-IOM5EJZB.js → chunk-MCABWC2G.js} +2 -2
  45. package/dist/{chunk-E6ABDLBN.js → chunk-O5TBFZ7X.js} +3 -3
  46. package/dist/chunk-OFQWTKPW.js +117 -0
  47. package/dist/{chunk-P7CAZ6YA.js → chunk-OKQLXBQQ.js} +3 -3
  48. package/dist/{chunk-G7REKKB7.js → chunk-P5GP2XJX.js} +1 -1
  49. package/dist/{chunk-WY7DTUVY.js → chunk-PB2OX2JY.js} +1 -1
  50. package/dist/{chunk-A67QXF4W.js → chunk-PDRHNLKE.js} +3 -3
  51. package/dist/{chunk-NY4NHA3Y.js → chunk-PUB5XZYL.js} +1 -1
  52. package/dist/{chunk-6P7TUF6Z.js → chunk-R5RF3LGS.js} +1 -1
  53. package/dist/{chunk-XMNWWURD.js → chunk-RDMAU7AJ.js} +14 -0
  54. package/dist/{chunk-RRJU47XY.js → chunk-T2HQSEIH.js} +1 -1
  55. package/dist/{chunk-TXY724ZK.js → chunk-TEXPOC5V.js} +2 -2
  56. package/dist/{chunk-YVGQM466.js → chunk-TH4APNRP.js} +6 -4
  57. package/dist/{chunk-WFO4PSIZ.js → chunk-TLYU5625.js} +9 -0
  58. package/dist/{chunk-YM2WZIJ7.js → chunk-TMLEIURT.js} +1 -1
  59. package/dist/{chunk-EJQTOUPG.js → chunk-TYA65W4U.js} +4 -4
  60. package/dist/{chunk-XKHIUGY3.js → chunk-USWOTTSP.js} +1 -1
  61. package/dist/{chunk-KVA65K7M.js → chunk-UVUAU3CH.js} +2 -2
  62. package/dist/{chunk-NBQ7RWSG.js → chunk-VBTX4DPW.js} +3 -3
  63. package/dist/{chunk-H7EMX7GA.js → chunk-VW5OMJNG.js} +3 -3
  64. package/dist/{chunk-UBSAIOMW.js → chunk-XL2CUGEG.js} +105 -92
  65. package/dist/{chunk-5BJFUD4T.js → chunk-XZSH5GS7.js} +4 -4
  66. package/dist/{chunk-CLW66MZ7.js → chunk-Y2CZEJPK.js} +2 -2
  67. package/dist/{chunk-N4H5U5BT.js → chunk-YZMYYF2X.js} +2 -2
  68. package/dist/{chunk-U3ZB2Z53.js → chunk-ZN2VS7HX.js} +2 -2
  69. package/dist/{clean-GB5Z4WEM.js → clean-S5HLSHKF.js} +18 -16
  70. package/dist/cli.js +50 -50
  71. package/dist/{cloud-TEEFEBH2.js → cloud-YVFKYAPL.js} +4 -4
  72. package/dist/{cloudrun-6OB4LUGS.js → cloudrun-ISE6GSUO.js} +6 -5
  73. package/dist/{compare-DVPSR4DL.js → compare-ADNK57U4.js} +28 -26
  74. package/dist/{compiler-CYMKVOVA.js → compiler-QMEZK6CU.js} +4 -3
  75. package/dist/{component-U2INC5IT.js → component-PEY7SIFS.js} +3 -3
  76. package/dist/{compositions-74IQZR7R.js → compositions-45NJDJ4D.js} +13 -12
  77. package/dist/{delete-HEYUHORS.js → delete-5JV2P3JW.js} +5 -3
  78. package/dist/{deterministicFonts-RMJFQXDW.js → deterministicFonts-XS3PGWH5.js} +2 -2
  79. package/dist/{dist-HJFL4ZN5.js → dist-E44WU6LH.js} +1 -1
  80. package/dist/{dist-XAD3AJS3.js → dist-R24TLUYO.js} +13 -11
  81. package/dist/{doctor-ULRZSIUT.js → doctor-EPDFEGGY.js} +12 -11
  82. package/dist/{events-DMSH3WM4.js → events-G6FHOEJQ.js} +10 -9
  83. package/dist/{events-LESQE4GC.js → events-JIGBMB22.js} +11 -10
  84. package/dist/{feedback-2XHCU2ZK.js → feedback-Y7DL2O2L.js} +12 -11
  85. package/dist/{figma-BERLUHLI.js → figma-4RJX4QL5.js} +3 -3
  86. package/dist/fontLocalizeCli.js +11 -10
  87. package/dist/{get-4YBNEMTP.js → get-2VZICXM2.js} +5 -3
  88. package/dist/{gpuPolicy-HKUPBZJK.js → gpuPolicy-BQFPO7UA.js} +8 -7
  89. package/dist/{grade-compare-EPUP4JHB.js → grade-compare-UIR2Q6GF.js} +28 -26
  90. package/dist/{gsapParser-IQS5TBGJ.js → gsapParser-EZGJSSV5.js} +46 -11
  91. package/dist/{gsapParserAcorn-OYHIHFF5.js → gsapParserAcorn-SZANFUAQ.js} +3 -1
  92. package/dist/{help-7RREVPSW.js → help-LTA4R652.js} +1 -1
  93. package/dist/{history-DRM6E3K7.js → history-RJIZMB4C.js} +18 -16
  94. package/dist/hyperframe-runtime.js +1 -1
  95. package/dist/hyperframe.manifest.json +1 -1
  96. package/dist/hyperframe.runtime.iife.js +1 -1
  97. package/dist/hyperframes-player.global.js +1 -1
  98. package/dist/{info-T46MLAIJ.js → info-Q74CT24F.js} +13 -12
  99. package/dist/{init-XUENGFUL.js → init-ZPLWAASI.js} +23 -22
  100. package/dist/{inspect-UJ6VQ4AQ.js → inspect-ALYVRN2U.js} +29 -27
  101. package/dist/{installer-3EXYDXIP.js → installer-UZSVMUKT.js} +7 -6
  102. package/dist/{keyframes-W3CGZVFU.js → keyframes-7KIXRNZL.js} +23 -13
  103. package/dist/{lambda-AORIF7O3.js → lambda-U4WIJQCJ.js} +7 -6
  104. package/dist/{layout-ZWO2PFYM.js → layout-RGO5RRS3.js} +29 -27
  105. package/dist/{lint-363LQDQQ.js → lint-HF4ZT3Q2.js} +14 -13
  106. package/dist/{lintProject-ESEUOGXF.js → lintProject-4P4C6AN2.js} +1 -1
  107. package/dist/{list-4UY5CXXR.js → list-YFOSCQPU.js} +5 -3
  108. package/dist/{login-GQEPZV6R.js → login-6DWXT7KZ.js} +4 -4
  109. package/dist/{media-treatment-ALANZWB6.js → media-treatment-5G6F4AV6.js} +14 -13
  110. package/dist/{models-QKXFAS6W.js → models-LXUIU5DC.js} +9 -8
  111. package/dist/{motionShot-BMDELKKS.js → motionShot-XRSPP3G6.js} +12 -11
  112. package/dist/{normalize-audio-IUMGNRZP.js → normalize-audio-5SDICUXG.js} +12 -11
  113. package/dist/{pipeline-HB3B54ID.js → pipeline-OFFKTFXS.js} +8 -7
  114. package/dist/{play-BPMDBZ4B.js → play-64NBPQZX.js} +24 -22
  115. package/dist/{preflight-A5GAQUXY.js → preflight-TVCVP5P2.js} +9 -8
  116. package/dist/{present-TVA7OFEX.js → present-P65ZUVJ4.js} +19 -17
  117. package/dist/{preview-YPBQWOBV.js → preview-VHRLBZ6E.js} +20 -19
  118. package/dist/{producer-JX3R2SJD.js → producer-LGG3TOUI.js} +1 -1
  119. package/dist/{projectConfig-D72ZCV4U.js → projectConfig-V53SEFIS.js} +9 -8
  120. package/dist/{publication-NXK5YHOQ.js → publication-7RKKPKLM.js} +6 -5
  121. package/dist/{publish-5OD66ODR.js → publish-TRRFCEMQ.js} +11 -10
  122. package/dist/{remove-background-LBVJV7OI.js → remove-background-HJFT46Z5.js} +9 -8
  123. package/dist/{render-3P4RQGWW.js → render-3T3GAQRD.js} +16 -14
  124. package/dist/{render-WV3L66CZ.js → render-H6NZB4R5.js} +24 -23
  125. package/dist/{render-ZI2B2XFE.js → render-TPZ5FXHS.js} +5 -4
  126. package/dist/{render-batch-S3H4HVUJ.js → render-batch-4ZF5C2LN.js} +5 -4
  127. package/dist/{renderCancellation-O6XHCGN6.js → renderCancellation-4PYGAN5D.js} +8 -7
  128. package/dist/renderSetupWorker.js +1 -1
  129. package/dist/{resolver-Y3I7ADOB.js → resolver-4JRJPC6S.js} +7 -6
  130. package/dist/{sherpa-NIP27UXM.js → sherpa-MNCWRFD4.js} +11 -9
  131. package/dist/{skills-QIN53D3I.js → skills-REGO6WJ3.js} +13 -12
  132. package/dist/{skillsUpdateCheck-2QDUGU26.js → skillsUpdateCheck-7CKNNDEI.js} +3 -3
  133. package/dist/{snapshot-U4QNSCIR.js → snapshot-QGXDXDFW.js} +29 -27
  134. package/dist/{src-BH62F364.js → src-QF6RYX76.js} +10 -9
  135. package/dist/{src-3CKPQCXW.js → src-QX5PPANW.js} +7 -6
  136. package/dist/{staticProjectServer-2XMNYJTA.js → staticProjectServer-TEVGFDXU.js} +18 -16
  137. package/dist/{status-RP5AM4YY.js → status-C3IDZFDG.js} +8 -7
  138. package/dist/studio/assets/{hyperframes-player-C6muFtfk.js → hyperframes-player-fWt87gyh.js} +1 -1
  139. package/dist/studio/assets/{index-B6vU39NM.js → index-D34Oy5DN.js} +1 -1
  140. package/dist/studio/assets/{index-itc1XziP.js → index-D6TjRAvz.js} +171 -171
  141. package/dist/studio/assets/{index-BxnoLgxG.js → index-DofdzdxJ.js} +1 -1
  142. package/dist/studio/index.html +1 -1
  143. package/dist/studio/index.js +718 -438
  144. package/dist/studio/index.js.map +1 -1
  145. package/dist/{studio-api-OGPSLKV7.js → studio-api-VNIEVFVL.js} +12 -10
  146. package/dist/{studioServer-ZJ22K33M.js → studioServer-QRHT7WQE.js} +48 -44
  147. package/dist/{system-SHCBJHHU.js → system-OAB2LYBV.js} +8 -7
  148. package/dist/{telemetry-GK7XOOXI.js → telemetry-O6OTMDXT.js} +11 -10
  149. package/dist/{timeline-46FRT64J.js → timeline-GKK57X67.js} +18 -16
  150. package/dist/{tokens-HJ2LB2GR.js → tokens-2YYS3Y5M.js} +2 -2
  151. package/dist/{transcribe-S75EUMVN.js → transcribe-5V3UCT5O.js} +14 -13
  152. package/dist/{transcribe-IK5WYH4B.js → transcribe-AL3E5MBZ.js} +9 -8
  153. package/dist/{updateCheck-PLFHDWQS.js → updateCheck-Y6FACNPT.js} +2 -2
  154. package/dist/{upgrade-2VUYCOJA.js → upgrade-E2P6HGXJ.js} +2 -2
  155. package/dist/{urlDownloader-EMO4Y44J.js → urlDownloader-U3TNOPD5.js} +7 -6
  156. package/dist/{validate-G5S2R6QT.js → validate-PGI3PX6W.js} +17 -16
  157. package/dist/{video-5WCMLASZ.js → video-KAHL76HG.js} +8 -7
  158. package/package.json +1 -1
  159. package/dist/chunk-M5YNZQXZ.js +0 -3528
@@ -11,13 +11,13 @@ import {
11
11
  isTextElement,
12
12
  keyframesToGsapAnimations,
13
13
  serializeGsapAnimations
14
- } from "./chunk-WFO4PSIZ.js";
14
+ } from "./chunk-TLYU5625.js";
15
15
  import {
16
16
  isMediaElement as isMediaElement2,
17
17
  parseStrictFiniteTimingNumber,
18
18
  resolveNaturalMediaTimelineDuration,
19
19
  resolveTimedImageDurationSeconds
20
- } from "./chunk-M5YNZQXZ.js";
20
+ } from "./chunk-FOKUJKBN.js";
21
21
  import {
22
22
  COMPOSITION_ATTRIBUTES,
23
23
  parseStartExpression
@@ -14,22 +14,24 @@ import {
14
14
  injectDurations,
15
15
  injectTagsAtHeadStart,
16
16
  insertBeforeCloseTag,
17
- isSafePath,
18
17
  parseHTMLContent,
19
18
  parseHostVariableValues,
20
19
  queryByAttr,
21
20
  readDeclaredDefaults,
22
- resolveWithinProject,
23
21
  shouldClampResolvedMediaDuration,
24
22
  stripEmbeddedRuntimeScripts,
25
23
  warnUnknownEnumValues
26
- } from "./chunk-M5YNZQXZ.js";
24
+ } from "./chunk-FOKUJKBN.js";
27
25
  import {
28
26
  cssVariableName
29
27
  } from "./chunk-VC76R6W2.js";
28
+ import {
29
+ isSafePath,
30
+ resolveWithinProject
31
+ } from "./chunk-OFQWTKPW.js";
30
32
  import {
31
33
  lintHyperframeHtml
32
- } from "./chunk-KVA65K7M.js";
34
+ } from "./chunk-UVUAU3CH.js";
33
35
  import {
34
36
  CSS_URL_RE,
35
37
  checkSubCompositionUsability,
@@ -2325,6 +2325,11 @@ function resolveTargetSelector(node, ancestors, scope, bindings) {
2325
2325
  }
2326
2326
  return null;
2327
2327
  }
2328
+ function hasUnresolvedArrayPart(node, ancestors, scope, bindings) {
2329
+ return node?.type === "ArrayExpression" && node.elements.some(
2330
+ (el) => !resolveTargetSelector(el, ancestors, scope, bindings) || hasUnresolvedArrayPart(el, ancestors, scope, bindings)
2331
+ );
2332
+ }
2328
2333
  function describeProxyTarget(targetNode, varsNode, scope) {
2329
2334
  const objNode = targetNode?.type === "ObjectExpression" ? targetNode : targetNode?.type === "Identifier" ? resolveConstNode(targetNode, scope) : void 0;
2330
2335
  if (objNode?.type !== "ObjectExpression") return null;
@@ -2512,12 +2517,14 @@ function findAllTweenCalls(ast, ref, scope, targetBindings) {
2512
2517
  const method = callee.property.name;
2513
2518
  const args = node.arguments;
2514
2519
  const selectorValue = args.length >= 1 ? resolveTargetSelector(args[0], nodeAncestors, scope, targetBindings) ?? "__unresolved__" : "__unresolved__";
2520
+ const partial = hasUnresolvedArrayPart(args[0], nodeAncestors, scope, targetBindings) ? { selectorPartial: true } : {};
2515
2521
  if (method === "fromTo" && args.length >= 3) {
2516
2522
  results.push({
2517
2523
  node,
2518
2524
  ancestors: nodeAncestors,
2519
2525
  method: "fromTo",
2520
2526
  selector: selectorValue,
2527
+ ...partial,
2521
2528
  fromArg: args[1],
2522
2529
  varsArg: args[2],
2523
2530
  positionArg: args[3]
@@ -2528,6 +2535,7 @@ function findAllTweenCalls(ast, ref, scope, targetBindings) {
2528
2535
  ancestors: nodeAncestors,
2529
2536
  method,
2530
2537
  selector: selectorValue,
2538
+ ...partial,
2531
2539
  varsArg: args[1],
2532
2540
  positionArg: args[2],
2533
2541
  ...isGlobalSet ? { global: true } : {}
@@ -2865,6 +2873,7 @@ function tweenCallToAnimation(call, scope, source, identifierBindings) {
2865
2873
  if (hasUnresolvedKeyframes) anim.hasUnresolvedKeyframes = true;
2866
2874
  if (durationUnresolved) anim.durationUnresolved = true;
2867
2875
  if (selector === "__unresolved__") anim.hasUnresolvedSelector = true;
2876
+ if (call.selectorPartial) anim.hasPartialSelector = true;
2868
2877
  if (provenance) anim.provenance = provenance;
2869
2878
  return anim;
2870
2879
  }
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  setHostHandlesSigint
9
- } from "./chunk-H7EMX7GA.js";
9
+ } from "./chunk-VW5OMJNG.js";
10
10
  import {
11
11
  processAncestorSnapshot,
12
12
  processIdentity,
@@ -8,17 +8,17 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemFile,
10
10
  validRegistryItem
11
- } from "./chunk-H5ZRB3SN.js";
11
+ } from "./chunk-6CN2QLB5.js";
12
12
  import {
13
13
  publishRegistryFile,
14
14
  registryTargetPath
15
- } from "./chunk-EA5GAMEY.js";
15
+ } from "./chunk-GMECXFAN.js";
16
16
  import {
17
17
  validateVariables
18
- } from "./chunk-TXY724ZK.js";
18
+ } from "./chunk-TEXPOC5V.js";
19
19
  import {
20
20
  realProjectRoot
21
- } from "./chunk-M5YNZQXZ.js";
21
+ } from "./chunk-OFQWTKPW.js";
22
22
  import {
23
23
  isCompositionVariable
24
24
  } from "./chunk-HBBJFK6I.js";
@@ -8,7 +8,7 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemManifest,
10
10
  fetchRegistryManifest
11
- } from "./chunk-H5ZRB3SN.js";
11
+ } from "./chunk-6CN2QLB5.js";
12
12
 
13
13
  // src/registry/resolver.ts
14
14
  function defaultWarn(message) {
@@ -7256,11 +7256,11 @@ function deriveDurationFromClips(tags, rootTag) {
7256
7256
  return resolveCompositionDuration({ authoredDurationSeconds: null, clipEndsSeconds: clipEnds });
7257
7257
  }
7258
7258
  async function loadParseGsapScript() {
7259
- const mod = await import("./gsapParserAcorn-OYHIHFF5.js");
7259
+ const mod = await import("./gsapParserAcorn-SZANFUAQ.js");
7260
7260
  return mod.parseGsapScriptAcorn;
7261
7261
  }
7262
7262
  async function loadGsapScriptMotionPathFirstUseIndex() {
7263
- const mod = await import("./gsapParserAcorn-OYHIHFF5.js");
7263
+ const mod = await import("./gsapParserAcorn-SZANFUAQ.js");
7264
7264
  return mod.gsapScriptMotionPathFirstUseIndex;
7265
7265
  }
7266
7266
  var SCENE_BOUNDARY_EPSILON_SECONDS = 0.05;
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType,
9
9
  injectMediaCodecMapIntoHtml
10
- } from "./chunk-UBSAIOMW.js";
10
+ } from "./chunk-XL2CUGEG.js";
11
11
  import {
12
12
  PROXY_VARIANT_CONFIG,
13
13
  ProxyCapacityError,
@@ -18,10 +18,10 @@ import {
18
18
  recordProxyRequest,
19
19
  resolveProxy,
20
20
  resolveProxyVariantRequest
21
- } from "./chunk-E6ABDLBN.js";
21
+ } from "./chunk-O5TBFZ7X.js";
22
22
  import {
23
23
  resolveAutoProxy
24
- } from "./chunk-J7QMXLNY.js";
24
+ } from "./chunk-HUHJYNST.js";
25
25
 
26
26
  // src/utils/staticProjectServer.ts
27
27
  import { createServer } from "http";
@@ -22,7 +22,7 @@ import {
22
22
  renderFrameIdForRenderId,
23
23
  resolveAuthoredTimingWindow,
24
24
  toFps
25
- } from "./chunk-TXY724ZK.js";
25
+ } from "./chunk-TEXPOC5V.js";
26
26
  import {
27
27
  AUDIO_GROUP_RENDER_ID_ATTR,
28
28
  COLOR_GRADING_SOURCE_HIDDEN_ATTR,
@@ -51,7 +51,7 @@ import {
51
51
  shiftRateLane,
52
52
  sourceTimeAt,
53
53
  timeAtSourceTime
54
- } from "./chunk-M5YNZQXZ.js";
54
+ } from "./chunk-FOKUJKBN.js";
55
55
  import {
56
56
  chromeMajorCeiling,
57
57
  exceedsChromeCeiling
@@ -59,7 +59,7 @@ import {
59
59
  import {
60
60
  isWithinProjectRoot,
61
61
  resolveProjectRelativeSrc
62
- } from "./chunk-KVA65K7M.js";
62
+ } from "./chunk-UVUAU3CH.js";
63
63
  import {
64
64
  FFMPEG_PATH_ENV,
65
65
  FFPROBE_PATH_ENV,
@@ -15,7 +15,11 @@ import {
15
15
  splitElementInHtml,
16
16
  unwrapElementsFromHtml,
17
17
  wrapElementsInHtml
18
- } from "./chunk-KF4BPO7K.js";
18
+ } from "./chunk-M4KS6MJN.js";
19
+ import {
20
+ createFileAtomically,
21
+ replaceFileAtomically
22
+ } from "./chunk-4Z5O7BTD.js";
19
23
  import {
20
24
  PROXY_PARAMS_VERSION,
21
25
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -41,10 +45,11 @@ import {
41
45
  shouldPrewarmProxy,
42
46
  waitForProxy,
43
47
  walkDir
44
- } from "./chunk-E6ABDLBN.js";
48
+ } from "./chunk-O5TBFZ7X.js";
45
49
  import {
50
+ findTimelineScript,
46
51
  parseGsapScriptAcorn
47
- } from "./chunk-XMNWWURD.js";
52
+ } from "./chunk-RDMAU7AJ.js";
48
53
  import {
49
54
  STUDIO_MANUAL_EDITS_PATH
50
55
  } from "./chunk-KC5XXX3X.js";
@@ -59,35 +64,37 @@ import {
59
64
  formatRenderOutputTimestamp,
60
65
  parseFps,
61
66
  sameInstant
62
- } from "./chunk-TXY724ZK.js";
67
+ } from "./chunk-TEXPOC5V.js";
63
68
  import {
64
69
  MagicString,
65
70
  VALID_CANVAS_RESOLUTIONS,
66
71
  unrollComputedTimeline
67
- } from "./chunk-WFO4PSIZ.js";
72
+ } from "./chunk-TLYU5625.js";
68
73
  import {
69
74
  addScenePartsManifest,
70
75
  ensureHfIds
71
- } from "./chunk-YVGQM466.js";
76
+ } from "./chunk-TH4APNRP.js";
72
77
  import {
73
- ProjectRootMissingError,
74
78
  findStartTags,
75
- folderGone,
76
79
  injectScriptsIntoHtml,
77
80
  injectTagsAtHeadStart,
78
81
  insertBeforeCloseTag,
79
82
  isFullHtmlDocument,
83
+ stripEmbeddedRuntimeScripts
84
+ } from "./chunk-FOKUJKBN.js";
85
+ import {
86
+ ProjectRootMissingError,
87
+ folderGone,
80
88
  isProjectRootMissing,
81
89
  isSafePath,
82
90
  mkdirWithinProject,
83
91
  realpath,
84
- resolveWithinProject,
85
- stripEmbeddedRuntimeScripts
86
- } from "./chunk-M5YNZQXZ.js";
92
+ resolveWithinProject
93
+ } from "./chunk-OFQWTKPW.js";
87
94
  import {
88
95
  isWithinProjectRoot,
89
96
  readProjectFile
90
- } from "./chunk-KVA65K7M.js";
97
+ } from "./chunk-UVUAU3CH.js";
91
98
  import {
92
99
  FFPROBE_PATH_ENV,
93
100
  findFfBinary
@@ -107,25 +114,7 @@ import {
107
114
  simple
108
115
  } from "./chunk-2PSPARWP.js";
109
116
 
110
- // ../studio-server/dist/chunk-PMXUKOC3.js
111
- import * as fs from "fs";
112
- import { randomUUID } from "crypto";
113
- function replaceFileAtomically(filePath, content, mode, operations = fs) {
114
- const tempPath = `${filePath}.${process.pid}.${randomUUID()}.tmp`;
115
- try {
116
- operations.writeFileSync(tempPath, content, { encoding: "utf-8", mode });
117
- operations.chmodSync(tempPath, mode);
118
- operations.renameSync(tempPath, filePath);
119
- } catch (error) {
120
- try {
121
- operations.unlinkSync(tempPath);
122
- } catch {
123
- }
124
- throw error;
125
- }
126
- }
127
-
128
- // ../studio-server/dist/chunk-WUHW3MWG.js
117
+ // ../studio-server/dist/chunk-7ON477WG.js
129
118
  import { createHash } from "crypto";
130
119
  import { closeSync, constants, fstatSync, openSync, readFileSync, writeFileSync } from "fs";
131
120
  import { dirname, join } from "path";
@@ -209,7 +198,7 @@ function stampFileHfIds(filePath) {
209
198
  }
210
199
  }
211
200
 
212
- // ../studio-server/dist/chunk-EQULRR3G.js
201
+ // ../studio-server/dist/chunk-ZZCG4HGG.js
213
202
  import { randomUUID as randomUUID6 } from "crypto";
214
203
  import { mkdir as mkdir2, readdir as readdir3, rm as rm3, rmdir, writeFile } from "fs/promises";
215
204
  import {
@@ -224,11 +213,11 @@ import {
224
213
  } from "fs";
225
214
  import { homedir } from "os";
226
215
  import { dirname as dirname4, isAbsolute as isAbsolute2, join as join5, relative as relative2, resolve as resolve3, sep as sep2 } from "path";
227
- import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
216
+ import { createHash as createHash2, randomUUID } from "crypto";
228
217
  import { createHash as createHash22 } from "crypto";
229
218
  import { lstatSync, readFileSync as readFileSync2, readdirSync } from "fs";
230
219
  import { extname, isAbsolute, relative, resolve, sep } from "path";
231
- import { createHash as createHash3, randomUUID as randomUUID22 } from "crypto";
220
+ import { createHash as createHash3, randomUUID as randomUUID2 } from "crypto";
232
221
  import { constants as constants2, createReadStream, renameSync } from "fs";
233
222
  import { copyFile, mkdir, readdir, readFile, rename, rm, stat } from "fs/promises";
234
223
  import { dirname as dirname2, join as join2 } from "path";
@@ -264,7 +253,7 @@ function settledFileTag(stat22, now = Date.now()) {
264
253
  }
265
254
  function createWriteToken(requestToken) {
266
255
  const token = requestToken?.trim();
267
- return token && token.length <= 200 ? token : randomUUID2();
256
+ return token && token.length <= 200 ? token : randomUUID();
268
257
  }
269
258
  function onFileOverwritten(listener) {
270
259
  overwriteListeners.add(listener);
@@ -493,7 +482,7 @@ async function hashFile(path) {
493
482
  }
494
483
  async function cloneOrCopy(from, to, beforeReplace) {
495
484
  await mkdir(dirname2(to), { recursive: true });
496
- const temp = `${to}.${randomUUID22()}.tmp`;
485
+ const temp = `${to}.${randomUUID2()}.tmp`;
497
486
  try {
498
487
  await copyFile(from, temp, constants2.COPYFILE_FICLONE);
499
488
  beforeReplace?.();
@@ -516,7 +505,7 @@ async function openBlobStore(dir) {
516
505
  let total = [...sizes.values()].reduce((sum, size) => sum + size, 0);
517
506
  return {
518
507
  async put(absPath) {
519
- const temp = join2(dir, `incoming-${randomUUID22()}`);
508
+ const temp = join2(dir, `incoming-${randomUUID2()}`);
520
509
  await mkdir(dir, { recursive: true });
521
510
  await copyFile(absPath, temp, constants2.COPYFILE_FICLONE);
522
511
  const hash = await hashFile(temp);
@@ -2076,8 +2065,6 @@ import {
2076
2065
  openSync as openSync3,
2077
2066
  readFileSync as readFileSync32,
2078
2067
  readlinkSync,
2079
- writeFileSync as writeFileSync4,
2080
- writeSync as writeSync2,
2081
2068
  unlinkSync as unlinkSync2,
2082
2069
  rmSync as rmSync3,
2083
2070
  statSync as statSync32,
@@ -2089,7 +2076,7 @@ import { resolve as resolve22, dirname as dirname32, join as join52 } from "path
2089
2076
  import { spawn } from "child_process";
2090
2077
  import {
2091
2078
  existsSync as existsSync4,
2092
- writeFileSync as writeFileSync5,
2079
+ writeFileSync as writeFileSync4,
2093
2080
  mkdirSync as mkdirSync5,
2094
2081
  lstatSync as lstatSync3,
2095
2082
  mkdtempSync,
@@ -2679,6 +2666,11 @@ function resolveTargetSelector(node, ancestors, scope, bindings) {
2679
2666
  }
2680
2667
  return null;
2681
2668
  }
2669
+ function hasUnresolvedArrayPart(node, ancestors, scope, bindings) {
2670
+ return node?.type === "ArrayExpression" && node.elements.some(
2671
+ (el) => !resolveTargetSelector(el, ancestors, scope, bindings) || hasUnresolvedArrayPart(el, ancestors, scope, bindings)
2672
+ );
2673
+ }
2682
2674
  function describeProxyTarget(targetNode, varsNode, scope) {
2683
2675
  const objNode = targetNode?.type === "ObjectExpression" ? targetNode : targetNode?.type === "Identifier" ? resolveConstNode(targetNode, scope) : void 0;
2684
2676
  if (objNode?.type !== "ObjectExpression") return null;
@@ -2863,12 +2855,14 @@ function findAllTweenCalls(ast, ref, scope, targetBindings) {
2863
2855
  const method = callee.property.name;
2864
2856
  const args = node.arguments;
2865
2857
  const selectorValue = args.length >= 1 ? resolveTargetSelector(args[0], nodeAncestors, scope, targetBindings) ?? "__unresolved__" : "__unresolved__";
2858
+ const partial = hasUnresolvedArrayPart(args[0], nodeAncestors, scope, targetBindings) ? { selectorPartial: true } : {};
2866
2859
  if (method === "fromTo" && args.length >= 3) {
2867
2860
  results.push({
2868
2861
  node,
2869
2862
  ancestors: nodeAncestors,
2870
2863
  method: "fromTo",
2871
2864
  selector: selectorValue,
2865
+ ...partial,
2872
2866
  fromArg: args[1],
2873
2867
  varsArg: args[2],
2874
2868
  positionArg: args[3]
@@ -2879,6 +2873,7 @@ function findAllTweenCalls(ast, ref, scope, targetBindings) {
2879
2873
  ancestors: nodeAncestors,
2880
2874
  method,
2881
2875
  selector: selectorValue,
2876
+ ...partial,
2882
2877
  varsArg: args[1],
2883
2878
  positionArg: args[2],
2884
2879
  ...isGlobalSet ? { global: true } : {}
@@ -3216,6 +3211,7 @@ function tweenCallToAnimation(call, scope, source, identifierBindings) {
3216
3211
  if (hasUnresolvedKeyframes) anim.hasUnresolvedKeyframes = true;
3217
3212
  if (durationUnresolved) anim.durationUnresolved = true;
3218
3213
  if (selector === "__unresolved__") anim.hasUnresolvedSelector = true;
3214
+ if (call.selectorPartial) anim.hasPartialSelector = true;
3219
3215
  if (provenance) anim.provenance = provenance;
3220
3216
  return anim;
3221
3217
  }
@@ -3381,6 +3377,33 @@ function parseGsapScriptAcornForWrite(script) {
3381
3377
  return null;
3382
3378
  }
3383
3379
  }
3380
+ function clipTweenMatcher(clipSelectors, root) {
3381
+ const own = typeof clipSelectors === "string" ? [clipSelectors] : clipSelectors;
3382
+ const clips = root ? own.flatMap((selector) => queryAll(root, selector)) : [];
3383
+ return ({ targetSelector, hasPartialSelector }) => {
3384
+ if (hasPartialSelector) return false;
3385
+ if (own.includes(targetSelector)) return true;
3386
+ if (!root || clips.length === 0) return false;
3387
+ const targets = queryAll(root, targetSelector);
3388
+ return targets.length > 0 && targets.every((target) => {
3389
+ const owner = target.closest("[data-start]");
3390
+ return clips.includes(target) || owner !== null && clips.includes(owner);
3391
+ });
3392
+ };
3393
+ }
3394
+ function clipQueryRoot(script) {
3395
+ return script.closest("template") ?? script.ownerDocument;
3396
+ }
3397
+ function hasExplicitTime(animation) {
3398
+ return typeof animation.position === "number" && !animation.implicitPosition;
3399
+ }
3400
+ function queryAll(root, selector) {
3401
+ try {
3402
+ return Array.from(root.querySelectorAll(selector));
3403
+ } catch {
3404
+ return [];
3405
+ }
3406
+ }
3384
3407
  function valueToCode(value) {
3385
3408
  if (typeof value === "string" && value.startsWith("__raw:")) return value.slice(6);
3386
3409
  if (typeof value === "string") return JSON.stringify(value);
@@ -3619,14 +3642,14 @@ function overwritePosition(ms, call, position) {
3619
3642
  ms.appendLeft(call.node.end - 1, `, ${valueToCode(position)}`);
3620
3643
  }
3621
3644
  }
3622
- function shiftPositionsInScript(script, targetSelector, delta) {
3645
+ function shiftPositionsInScript(script, targetSelector, delta, root) {
3623
3646
  const parsed = parseGsapScriptAcornForWrite(script);
3624
3647
  if (!parsed) return script;
3648
+ const carries = clipTweenMatcher(targetSelector, root);
3625
3649
  const ms = new MagicString(script);
3626
3650
  let changed = false;
3627
3651
  for (const entry of parsed.located) {
3628
- if (entry.animation.targetSelector !== targetSelector) continue;
3629
- if (typeof entry.animation.position !== "number") continue;
3652
+ if (!carries(entry.animation) || !hasExplicitTime(entry.animation)) continue;
3630
3653
  overwritePosition(ms, entry.call, shiftedPosition(entry.animation.position, delta));
3631
3654
  changed = true;
3632
3655
  }
@@ -3635,21 +3658,23 @@ function shiftPositionsInScript(script, targetSelector, delta) {
3635
3658
  function shiftedPosition(position, delta) {
3636
3659
  return Math.max(0, Math.round((position + delta) * 1e3) / 1e3);
3637
3660
  }
3638
- function scalePositionsInScript(script, targetSelector, oldStart, oldDuration, newStart, newDuration) {
3661
+ function scalePositionsInScript(script, targetSelector, oldStart, oldDuration, newStart, newDuration, root) {
3639
3662
  if (oldDuration <= 0 || newDuration <= 0) return script;
3640
3663
  const ratio = newDuration / oldDuration;
3641
3664
  const parsed = parseGsapScriptAcornForWrite(script);
3642
3665
  if (!parsed) return script;
3666
+ const carries = clipTweenMatcher(targetSelector, root);
3643
3667
  const ms = new MagicString(script);
3644
3668
  let changed = false;
3645
3669
  for (const entry of parsed.located) {
3646
- if (entry.animation.targetSelector !== targetSelector) continue;
3647
- if (typeof entry.animation.position !== "number") continue;
3648
- const newPos = Math.max(
3649
- 0,
3650
- Math.round((newStart + (entry.animation.position - oldStart) * ratio) * 1e3) / 1e3
3651
- );
3652
- overwritePosition(ms, entry.call, newPos);
3670
+ if (!carries(entry.animation) || typeof entry.animation.position !== "number") continue;
3671
+ if (hasExplicitTime(entry.animation)) {
3672
+ const newPos = Math.max(
3673
+ 0,
3674
+ Math.round((newStart + (entry.animation.position - oldStart) * ratio) * 1e3) / 1e3
3675
+ );
3676
+ overwritePosition(ms, entry.call, newPos);
3677
+ }
3653
3678
  if (typeof entry.animation.duration === "number" && entry.animation.duration > 0) {
3654
3679
  const newDur = Math.max(1e-3, Math.round(entry.animation.duration * ratio * 1e3) / 1e3);
3655
3680
  upsertProp(ms, entry.call.varsArg, "duration", newDur);
@@ -5058,10 +5083,10 @@ import {
5058
5083
  rmSync as rmSync42,
5059
5084
  statSync as statSync6,
5060
5085
  unlinkSync as unlinkSync4,
5061
- writeFileSync as writeFileSync52
5086
+ writeFileSync as writeFileSync42
5062
5087
  } from "fs";
5063
5088
  import { join as join11 } from "path";
5064
- import { createHash as createHash32, randomUUID as randomUUID23 } from "crypto";
5089
+ import { createHash as createHash32, randomUUID as randomUUID22 } from "crypto";
5065
5090
  import { readFileSync as readFileSync8 } from "fs";
5066
5091
  import { existsSync as existsSync7, readFileSync as readFileSync10, statSync as statSync7 } from "fs";
5067
5092
  import { join as join12, resolve as resolve52 } from "path";
@@ -5250,7 +5275,7 @@ function writeWaveformCache(cachePath, peaks) {
5250
5275
  const stagingDir = mkdtempSync(join23(cacheDir, ".waveform-"));
5251
5276
  try {
5252
5277
  const stagingPath = join23(stagingDir, "peaks.json");
5253
- writeFileSync5(stagingPath, JSON.stringify(peaks), { flag: "wx" });
5278
+ writeFileSync4(stagingPath, JSON.stringify(peaks), { flag: "wx" });
5254
5279
  renameSync3(stagingPath, cachePath);
5255
5280
  } finally {
5256
5281
  try {
@@ -5730,7 +5755,7 @@ function requestSubPath(url, route) {
5730
5755
  return decodeURIComponent(segments.slice(start + routeSegments.length).join("/"));
5731
5756
  }
5732
5757
  async function loadGsapParser() {
5733
- return import("./gsapParser-IQS5TBGJ.js");
5758
+ return import("./gsapParser-EZGJSSV5.js");
5734
5759
  }
5735
5760
  function isDanglingSymlinkInProject(projectDir, lexicalPath) {
5736
5761
  if (!isSafePath(projectDir, dirname32(lexicalPath))) return false;
@@ -6017,20 +6042,17 @@ function extractGsapScriptBlock(html) {
6017
6042
  (tmpl) => Array.from(tmpl.querySelectorAll("script:not([src])"))
6018
6043
  )
6019
6044
  ];
6020
- for (const script of scripts) {
6021
- const content = script.textContent || "";
6022
- if (content.includes("gsap.timeline") || content.includes(".set(") || content.includes(".to(")) {
6023
- return {
6024
- scriptText: content,
6025
- document: document2,
6026
- replaceScript(newText) {
6027
- script.textContent = newText;
6028
- return document2.toString();
6029
- }
6030
- };
6045
+ const script = findTimelineScript(scripts);
6046
+ if (!script) return null;
6047
+ return {
6048
+ scriptText: script.textContent || "",
6049
+ document: document2,
6050
+ root: clipQueryRoot(script),
6051
+ replaceScript(newText) {
6052
+ script.textContent = newText;
6053
+ return document2.toString();
6031
6054
  }
6032
- }
6033
- return null;
6055
+ };
6034
6056
  }
6035
6057
  function stripGsapAnimationsForSelector(html, selector) {
6036
6058
  const block = extractGsapScriptBlock(html);
@@ -6278,7 +6300,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
6278
6300
  let block = extractGsapScriptBlock(html);
6279
6301
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
6280
6302
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
6281
- const { GSAP_CDN } = await import("./dist-XAD3AJS3.js");
6303
+ const { GSAP_CDN } = await import("./dist-R24TLUYO.js");
6282
6304
  const bootstrap = [
6283
6305
  `<script src="${GSAP_CDN}"></script>`,
6284
6306
  "<script>",
@@ -6647,13 +6669,13 @@ function executeGsapMutationAcorn(body, block, respond) {
6647
6669
  case "shift-positions": {
6648
6670
  const { targetSelector, delta } = body;
6649
6671
  if (!targetSelector || !Number.isFinite(delta) || delta === 0) return block.scriptText;
6650
- return shiftPositionsInScript(block.scriptText, targetSelector, delta);
6672
+ return shiftPositionsInScript(block.scriptText, targetSelector, delta, block.root);
6651
6673
  }
6652
6674
  case "shift-positions-batch": {
6653
6675
  let script = block.scriptText;
6654
6676
  for (const s of body.shifts) {
6655
6677
  if (!s.targetSelector || !Number.isFinite(s.delta) || s.delta === 0) continue;
6656
- script = shiftPositionsInScript(script, s.targetSelector, s.delta);
6678
+ script = shiftPositionsInScript(script, s.targetSelector, s.delta, block.root);
6657
6679
  }
6658
6680
  return script;
6659
6681
  }
@@ -6668,7 +6690,8 @@ function executeGsapMutationAcorn(body, block, respond) {
6668
6690
  oldStart,
6669
6691
  oldDuration,
6670
6692
  newStart,
6671
- newDuration
6693
+ newDuration,
6694
+ block.root
6672
6695
  );
6673
6696
  }
6674
6697
  default:
@@ -6979,14 +7002,14 @@ async function executeGsapMutationRecast(body, block, respond) {
6979
7002
  const { targetSelector, delta } = body;
6980
7003
  if (!targetSelector || !Number.isFinite(delta) || delta === 0) return block.scriptText;
6981
7004
  const { shiftPositionsInScript: shiftPositionsInScript2 } = parser;
6982
- return shiftPositionsInScript2(block.scriptText, targetSelector, delta);
7005
+ return shiftPositionsInScript2(block.scriptText, targetSelector, delta, block.root);
6983
7006
  }
6984
7007
  case "shift-positions-batch": {
6985
7008
  const { shiftPositionsInScript: shiftPositionsInScript2 } = parser;
6986
7009
  let script = block.scriptText;
6987
7010
  for (const s of body.shifts) {
6988
7011
  if (!s.targetSelector || !Number.isFinite(s.delta) || s.delta === 0) continue;
6989
- script = shiftPositionsInScript2(script, s.targetSelector, s.delta);
7012
+ script = shiftPositionsInScript2(script, s.targetSelector, s.delta, block.root);
6990
7013
  }
6991
7014
  return script;
6992
7015
  }
@@ -7002,7 +7025,8 @@ async function executeGsapMutationRecast(body, block, respond) {
7002
7025
  oldStart,
7003
7026
  oldDuration,
7004
7027
  newStart,
7005
- newDuration
7028
+ newDuration,
7029
+ block.root
7006
7030
  );
7007
7031
  }
7008
7032
  default:
@@ -7123,12 +7147,7 @@ async function processUploadedFiles(formData, targetDir, projectDir) {
7123
7147
  let written = false;
7124
7148
  while (n < MAX_COPY_INDEX && isSafePath(projectDir, finalPath)) {
7125
7149
  try {
7126
- const fd = openSync3(finalPath, "wx");
7127
- try {
7128
- writeFileSync4(fd, buffer);
7129
- } finally {
7130
- closeSync3(fd);
7131
- }
7150
+ createFileAtomically(finalPath, buffer);
7132
7151
  written = true;
7133
7152
  break;
7134
7153
  } catch (error) {
@@ -7222,9 +7241,8 @@ function registerFileRoutes(api, adapter) {
7222
7241
  let overwrote;
7223
7242
  if (createOnly) {
7224
7243
  ensureDir(res.project.dir, res.absPath);
7225
- let fd;
7226
7244
  try {
7227
- fd = openSync3(res.absPath, "wx");
7245
+ createFileAtomically(res.absPath, body);
7228
7246
  } catch (error) {
7229
7247
  if (!error || typeof error !== "object" || !("code" in error) || error.code !== "EEXIST") {
7230
7248
  throw error;
@@ -7240,11 +7258,6 @@ function registerFileRoutes(api, adapter) {
7240
7258
  409
7241
7259
  );
7242
7260
  }
7243
- try {
7244
- writeSync2(fd, body, 0, body.length, 0);
7245
- } finally {
7246
- closeSync3(fd);
7247
- }
7248
7261
  } else {
7249
7262
  let fd;
7250
7263
  try {
@@ -7306,7 +7319,7 @@ function registerFileRoutes(api, adapter) {
7306
7319
  ensureDir(res.project.dir, res.absPath);
7307
7320
  const body = Buffer.from(await c.req.arrayBuffer());
7308
7321
  try {
7309
- writeFileSync4(res.absPath, body, { flag: "wx" });
7322
+ createFileAtomically(res.absPath, body);
7310
7323
  } catch (error) {
7311
7324
  if (!error || typeof error !== "object" || !("code" in error) || error.code !== "EEXIST") {
7312
7325
  throw error;
@@ -7867,7 +7880,7 @@ function registerFileRoutes(api, adapter) {
7867
7880
  }
7868
7881
  ensureDir(project.dir, destAbs);
7869
7882
  try {
7870
- writeFileSync4(destAbs, readFileSync32(srcAbs), { flag: "wx" });
7883
+ createFileAtomically(destAbs, readFileSync32(srcAbs));
7871
7884
  } catch (error) {
7872
7885
  if (!error || typeof error !== "object" || !("code" in error) || error.code !== "EEXIST") {
7873
7886
  throw error;
@@ -9309,9 +9322,9 @@ function pruneThumbnailCache(cacheDir, protectedPaths, now = Date.now()) {
9309
9322
  }
9310
9323
  }
9311
9324
  function writeThumbnailAtomically(path, buffer) {
9312
- const temporaryPath = `${path}.${process.pid}.${randomUUID23()}.tmp`;
9325
+ const temporaryPath = `${path}.${process.pid}.${randomUUID22()}.tmp`;
9313
9326
  try {
9314
- writeFileSync52(temporaryPath, buffer, { flag: "wx" });
9327
+ writeFileSync42(temporaryPath, buffer, { flag: "wx" });
9315
9328
  renameSync32(temporaryPath, path);
9316
9329
  } finally {
9317
9330
  rmSync42(temporaryPath, { force: true });