hyperframes 0.9.49 → 0.9.50
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/{add-PALFYN7F.js → add-MHBYQHUR.js} +6 -6
- package/dist/{agentPromptGenerator-W7YECUWC.js → agentPromptGenerator-LJHTM6QS.js} +4 -4
- package/dist/{animatedGifPrep-RGTZSKE4.js → animatedGifPrep-V5SQRWAT.js} +5 -5
- package/dist/api.js +23 -23
- package/dist/{asset-JI35ENTB.js → asset-2QF7W45V.js} +2 -2
- package/dist/{assetCataloger-A3T63E76.js → assetCataloger-HBGLL5OY.js} +4 -4
- package/dist/{audio-PWT3Y4ER.js → audio-ERHWZM2O.js} +10 -10
- package/dist/{auth-HVB4YRTT.js → auth-JNM2N5FK.js} +2 -2
- package/dist/{autoUpdate-6DLBJZZW.js → autoUpdate-2A3PNPOQ.js} +2 -2
- package/dist/{avatars-VKB5R2JP.js → avatars-UXJM3YOF.js} +9 -9
- package/dist/{backgroundChecks-XCMKJT4Z.js → backgroundChecks-FM7JOSDW.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-XYL2E7IX.js → batchRender-VKM4E7PI.js} +1 -1
- package/dist/{beats-C2HOZUAS.js → beats-BAZOHGIS.js} +7 -7
- package/dist/{benchmark-TWKPWI27.js → benchmark-AWDTJZW2.js} +7 -7
- package/dist/{billing-74IFJYAX.js → billing-M7FIGUG3.js} +5 -5
- package/dist/{browser-GG3NMOT2.js → browser-BJBAMHOZ.js} +4 -4
- package/dist/{bundleWithLocalizedFonts-HBFTQBPU.js → bundleWithLocalizedFonts-NWMD2BBQ.js} +1 -1
- package/dist/{capture-S76Z24SZ.js → capture-GKI3WNTE.js} +9 -9
- package/dist/{capture-ZGZPBEA3.js → capture-V3KIGAHK.js} +3 -3
- package/dist/{captureCompositionFrame-GX7OQSDA.js → captureCompositionFrame-C3QPXFZZ.js} +8 -8
- package/dist/{catalog-U5IHPRJZ.js → catalog-5VRQXFNE.js} +6 -6
- package/dist/{catch-up-XCQZZDVD.js → catch-up-IWRZL3T6.js} +5 -5
- package/dist/{check-ZEG6CTIC.js → check-3TTCBOR5.js} +26 -26
- package/dist/{checkAudio-SAEK5LIU.js → checkAudio-WNVIHTTH.js} +7 -7
- package/dist/{checkBrowser-UDT2ROZ3.js → checkBrowser-IQR4HWS6.js} +20 -20
- package/dist/{chunk-6RHYYH7J.js → chunk-2M7GGAXG.js} +2 -2
- package/dist/{chunk-G5NF5RYM.js → chunk-3LTJKGJQ.js} +4 -4
- package/dist/{chunk-DS3IJC74.js → chunk-4OWHB6Y4.js} +1 -1
- package/dist/{chunk-FWABCPJF.js → chunk-4Q2HYZZK.js} +1 -1
- package/dist/{chunk-2KPNFTOV.js → chunk-4QRYBCP5.js} +1 -1
- package/dist/{chunk-RWCYIF4C.js → chunk-5SIOKBKO.js} +3 -3
- package/dist/{chunk-5TJRJXFQ.js → chunk-5YF3NCZV.js} +1 -1
- package/dist/{chunk-IDX4AAHE.js → chunk-62LL7YPC.js} +2 -2
- package/dist/{chunk-67QXALQY.js → chunk-62R36CZW.js} +3 -3
- package/dist/{chunk-CPKLZATK.js → chunk-6Q7QF4UD.js} +2 -2
- package/dist/{chunk-PWMGT73E.js → chunk-747XM6QN.js} +2 -2
- package/dist/{chunk-Y4CPI5F6.js → chunk-7H6NEDNA.js} +2 -2
- package/dist/{chunk-PKIQ4ZR3.js → chunk-7W3MLVDC.js} +2 -2
- package/dist/{chunk-PNHLR7UQ.js → chunk-7YKLBEIC.js} +6 -6
- package/dist/{chunk-SJLVYPVA.js → chunk-A5LYBVBC.js} +8 -8
- package/dist/{chunk-DLRGADJX.js → chunk-ARIBOM26.js} +1 -1
- package/dist/{chunk-S6TSXBWT.js → chunk-ARREGNEF.js} +3 -3
- package/dist/{chunk-PXYO7CSG.js → chunk-AVBZSLK5.js} +4 -4
- package/dist/{chunk-AVND7IBZ.js → chunk-CB3GR7GV.js} +2 -2
- package/dist/{chunk-ESO4PNZJ.js → chunk-CGHWDZXR.js} +2 -2
- package/dist/{chunk-C4YBN5X6.js → chunk-CII7LO6I.js} +1 -1
- package/dist/{chunk-KZYOTTKM.js → chunk-CIZB4MFK.js} +1 -1
- package/dist/{chunk-6OPBJLMM.js → chunk-CX5Y3TUU.js} +1 -1
- package/dist/{chunk-2RNRAB6U.js → chunk-D3UYYHU2.js} +1 -1
- package/dist/{chunk-L4XB67KR.js → chunk-DSKX5OD2.js} +2 -2
- package/dist/{chunk-UL2P4PMR.js → chunk-DV5KH45B.js} +1 -1
- package/dist/{chunk-UETMAXZF.js → chunk-E2QJFCYC.js} +7 -2
- package/dist/{chunk-FOIT542N.js → chunk-F7Z7UDAV.js} +1 -1
- package/dist/{chunk-B2DE7LZ6.js → chunk-FLDJ5AYW.js} +2 -2
- package/dist/{chunk-JZ7MGLDY.js → chunk-G5M6MZPP.js} +1 -1
- package/dist/{chunk-ADY66LYZ.js → chunk-GOZNQ2BU.js} +5 -5
- package/dist/{chunk-LGXOIEXD.js → chunk-GVYDYPMK.js} +1 -1
- package/dist/{chunk-DNDMJYSA.js → chunk-H4LCNEA2.js} +131 -56
- package/dist/{chunk-NQW4IK5U.js → chunk-H6GW4MUA.js} +2 -2
- package/dist/{chunk-L3IF3ICK.js → chunk-HCPT6BJD.js} +1 -1
- package/dist/{chunk-6TKGMCMZ.js → chunk-I4PWEIZK.js} +1 -1
- package/dist/{chunk-IML2Z4HA.js → chunk-I7UACFVY.js} +47 -18
- package/dist/{chunk-INKZ3QC6.js → chunk-JHNICCT2.js} +11 -11
- package/dist/{chunk-CYWEBM2Q.js → chunk-KDT2WX7M.js} +1 -1
- package/dist/{chunk-SC2UNTNA.js → chunk-LRKSFIYI.js} +2 -2
- package/dist/{chunk-TCNUA5RK.js → chunk-LSL3XC2T.js} +4 -4
- package/dist/{chunk-BIFCKMA2.js → chunk-M2UX3RAP.js} +7 -7
- package/dist/{chunk-BLZS4ZNW.js → chunk-NLHR5VAJ.js} +1 -1
- package/dist/{chunk-ARKLBIF5.js → chunk-NLTJMUK6.js} +1 -1
- package/dist/{chunk-OT4X3UJO.js → chunk-NOSZSEN6.js} +1 -1
- package/dist/{chunk-GJUX6ELV.js → chunk-NYUTPQQ3.js} +10 -10
- package/dist/{chunk-2HNZSVMA.js → chunk-OHC6GZAK.js} +9 -9
- package/dist/{chunk-ISMKLYU5.js → chunk-OUABE6YT.js} +1 -1
- package/dist/{chunk-PQFUF5XD.js → chunk-PNL7SMWV.js} +2 -2
- package/dist/{chunk-IXJNKHSW.js → chunk-QARZ5SCV.js} +2 -2
- package/dist/{chunk-RAIAWYV6.js → chunk-QIKIHGPS.js} +1 -1
- package/dist/{chunk-W5LEGKUI.js → chunk-QLHNKVBG.js} +3 -3
- package/dist/{chunk-MXOWNQCI.js → chunk-R64WJS45.js} +2 -2
- package/dist/{chunk-SWNYAKJZ.js → chunk-R76QWLJI.js} +1 -1
- package/dist/{chunk-DDXHYDJW.js → chunk-RJEX3RRW.js} +1 -1
- package/dist/{chunk-6D2TEACV.js → chunk-S2Z46FMO.js} +1 -1
- package/dist/{chunk-YZFBMMY2.js → chunk-T44NTM2R.js} +1 -1
- package/dist/{chunk-XHLWZTCQ.js → chunk-T47SZ3SP.js} +5 -5
- package/dist/{chunk-2IIKGFO3.js → chunk-TMAF33SA.js} +1 -1
- package/dist/{chunk-7IQ4S5B3.js → chunk-TW6S6A2B.js} +19 -19
- package/dist/{chunk-IWZDLLVZ.js → chunk-U4CJQ4AU.js} +1 -1
- package/dist/{chunk-7SY3DERR.js → chunk-UBHBB3TB.js} +1 -1
- package/dist/{chunk-MYEVOW4Z.js → chunk-UJRRUNWQ.js} +2 -2
- package/dist/{chunk-26UWY6Y7.js → chunk-VNIVH2ZQ.js} +1 -1
- package/dist/{chunk-EPQC3FGZ.js → chunk-WFQJ6EJ6.js} +19 -4
- package/dist/{chunk-DOFY4D3Q.js → chunk-WXNVVZCC.js} +3 -3
- package/dist/{chunk-IS6FYK3E.js → chunk-XBD5NV2F.js} +1 -1
- package/dist/{chunk-UDFMNCZR.js → chunk-XP5X4TKU.js} +1 -1
- package/dist/{chunk-VC77JQWW.js → chunk-YIKOKVHE.js} +283 -182
- package/dist/{chunk-YZJSU2XH.js → chunk-YTO34UZE.js} +4 -4
- package/dist/{chunk-6LDIZ4GJ.js → chunk-YYF4HKW5.js} +1 -1
- package/dist/{chunk-23PJ2IA5.js → chunk-Z5TKOD2D.js} +1 -1
- package/dist/{chunk-IHD5UW2O.js → chunk-ZI5QVXG4.js} +1 -1
- package/dist/{chunk-2PZSUSHI.js → chunk-ZPMIIPDH.js} +3 -3
- package/dist/{chunk-D6YNLDSQ.js → chunk-ZX52DCZH.js} +2 -2
- package/dist/{clean-XXEL3ZBK.js → clean-BT36HK75.js} +12 -12
- package/dist/cli.js +62 -62
- package/dist/{cloud-XXMDGEMK.js → cloud-R2QOPFMH.js} +4 -4
- package/dist/{cloudrun-XXGMWBUO.js → cloudrun-EULFHQQL.js} +1 -1
- package/dist/{compare-JUVSFZRQ.js → compare-RUB5AIPD.js} +17 -17
- package/dist/{compiler-XTVXLGQA.js → compiler-DUG4GFRI.js} +3 -3
- package/dist/{component-KEJ34SM2.js → component-NBW4NP3J.js} +3 -3
- package/dist/{compositions-BF3NDKKG.js → compositions-FHO2G54H.js} +9 -9
- package/dist/{curve-QHLJ452Y.js → curve-2MSCLXM7.js} +9 -9
- package/dist/{cuts-VKKXIQPW.js → cuts-ND6ZL5AI.js} +10 -10
- package/dist/{delete-GEZVZPWY.js → delete-FMQCJAHX.js} +2 -2
- package/dist/{deploy-ORQ7QDRG.js → deploy-5UOYKYXF.js} +2 -2
- package/dist/{describeProject-LEBOC6CL.js → describeProject-OIK763B5.js} +5 -5
- package/dist/{destroy-ANCSST2S.js → destroy-MLAFCH6B.js} +2 -2
- package/dist/{diff-5X65JPB2.js → diff-KKJRQKFR.js} +22 -22
- package/dist/{dist-4ZDHU5RE.js → dist-2YJCNIWI.js} +2 -2
- package/dist/{dist-YX7FMBUD.js → dist-MXWEGMRB.js} +1 -1
- package/dist/{dist-BKWVQR7A.js → dist-UMYCC5T5.js} +5 -5
- package/dist/{doctor-WUL4VESK.js → doctor-5DILJANT.js} +9 -9
- package/dist/{energy-L2VWHVVA.js → energy-BLU27H7G.js} +10 -10
- package/dist/{events-3SKWRLOR.js → events-35CZGWGO.js} +2 -2
- package/dist/{events-7FFAOKAE.js → events-AXNHFZTY.js} +11 -11
- package/dist/{events-5EEASGJC.js → events-GRLM5BLQ.js} +4 -4
- package/dist/{execute-6VLBSJWW.js → execute-FRDHPWNT.js} +15 -15
- package/dist/{extract-NW3KYNN4.js → extract-ILQCKYWJ.js} +10 -10
- package/dist/{face-4S5NWVNA.js → face-S3YZLPEO.js} +10 -10
- package/dist/{feedback-3OW5JVE4.js → feedback-LTEDBBL2.js} +8 -8
- package/dist/{ffmpeg-64HDYTRA.js → ffmpeg-OJIIUEQQ.js} +5 -5
- package/dist/{figma-SN5Z2GUZ.js → figma-DXIX3JW2.js} +3 -3
- package/dist/fontLocalizeCli.js +8 -8
- package/dist/{frames-NZNNVA3R.js → frames-E7GSMQMG.js} +11 -11
- package/dist/{generate-22O776FD.js → generate-5BV3VOF5.js} +15 -15
- package/dist/{get-O6YCY5BU.js → get-LO5YZK5S.js} +2 -2
- package/dist/{gpuPolicy-26UL7BND.js → gpuPolicy-L6YX2UOM.js} +5 -5
- package/dist/{grade-compare-6JGG6AUM.js → grade-compare-45DGL4FX.js} +18 -18
- package/dist/{heifImagePrep-6ZP77OL4.js → heifImagePrep-HZWZ6RCU.js} +6 -6
- package/dist/{help-4IHXYFYU.js → help-NXUWIQZJ.js} +1 -1
- package/dist/{history-ACOL6DPJ.js → history-B2VYYYFA.js} +7 -7
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/hyperframes-slideshow.global.js +14 -14
- package/dist/{info-MVEC7EO5.js → info-6BK7QHQN.js} +11 -11
- package/dist/{init-YQRSQKD2.js → init-5NJNDMW5.js} +22 -22
- package/dist/{ink-A63OPAUS.js → ink-I2VH46VQ.js} +10 -10
- package/dist/{inspect-5FWI42ZE.js → inspect-VMCKQEOT.js} +18 -18
- package/dist/{installer-2LTM4GWP.js → installer-FI6HT2FW.js} +1 -1
- package/dist/{keyframes-4ANCPAXZ.js → keyframes-2ZZUDJD7.js} +7 -7
- package/dist/{lambda-A7UY44ZG.js → lambda-BHLB7JHL.js} +9 -9
- package/dist/{layout-7GGOEVCP.js → layout-4Y2DWTXM.js} +18 -18
- package/dist/{lint-AYAPUYJA.js → lint-QPQRY5WD.js} +8 -8
- package/dist/{lintProject-7C4U6NHF.js → lintProject-G4MXY4YA.js} +2 -2
- package/dist/{list-TGPJOBFL.js → list-SPRUZTEJ.js} +2 -2
- package/dist/{localPage-YJNVGFUR.js → localPage-TZFDEA6W.js} +4 -4
- package/dist/{login-UFEGKTWJ.js → login-JOQCOSOK.js} +4 -4
- package/dist/{look-TS4DMBJZ.js → look-3UNLVDPJ.js} +10 -10
- package/dist/{manager-RN3IP5UM.js → manager-7IV66O64.js} +6 -6
- package/dist/{measure-L2FJMFZQ.js → measure-PFOIM7OJ.js} +11 -11
- package/dist/{media-treatment-JB5W5JI4.js → media-treatment-WR2EYI6J.js} +11 -11
- package/dist/{media-use-TMR5E5WJ.js → media-use-VRMLASYM.js} +3 -3
- package/dist/{models-R5L2ZQFX.js → models-6BN6ZA2T.js} +9 -9
- package/dist/{motionShot-FXPW7WFS.js → motionShot-SX6BQ2A3.js} +11 -11
- package/dist/{normalize-audio-IWEUGFKJ.js → normalize-audio-E2EMJIJU.js} +5 -5
- package/dist/{open-YKOIAP7J.js → open-N4SZ4OC6.js} +5 -5
- package/dist/{parakeetRunner-BMBL6UGF.js → parakeetRunner-GVZ2XLDV.js} +10 -10
- package/dist/{pipeline-HRJ3VN5Z.js → pipeline-Z4RAIXQM.js} +8 -8
- package/dist/{plan-IIQ7SXWV.js → plan-NJKLH5DY.js} +11 -11
- package/dist/{play-FPIHIX3E.js → play-2P3J4O6N.js} +11 -11
- package/dist/{preflight-4AV5WOGU.js → preflight-VQ366D6O.js} +6 -6
- package/dist/{present-4K3VJUM7.js → present-HCY6XKUF.js} +12 -12
- package/dist/{preview-2NIQ2EBG.js → preview-ZE435ZVI.js} +11 -11
- package/dist/{probe-O42OCKVH.js → probe-J2KN3Y3Z.js} +10 -10
- package/dist/{producer-MTQYIIGW.js → producer-G6AH4NES.js} +1 -1
- package/dist/{projectConfig-LSJSU4UR.js → projectConfig-VPL64JBD.js} +1 -1
- package/dist/{publication-4EYVOO47.js → publication-ST3VFFWM.js} +1 -1
- package/dist/{publish-QU6NA5UG.js → publish-CMIRMUVW.js} +6 -6
- package/dist/{remove-background-55RUOFXG.js → remove-background-2HPZDKTN.js} +9 -9
- package/dist/{render-UWWZFXK5.js → render-FYWFWCL7.js} +16 -16
- package/dist/{render-IFRE426H.js → render-MG5MX45D.js} +1 -1
- package/dist/{render-WRCZGKUW.js → render-WXDAMYQU.js} +24 -24
- package/dist/{render-batch-2BWEMPAQ.js → render-batch-C3XGAQGX.js} +1 -1
- package/dist/renderSetupWorker.js +2 -2
- package/dist/{resolver-PM56BNET.js → resolver-AGMKICJW.js} +1 -1
- package/dist/{reverse-HIJSN6T6.js → reverse-XNTL6ILN.js} +1 -1
- package/dist/{screenshotCapture-F2G3ASF3.js → screenshotCapture-4FFWYCKV.js} +5 -5
- package/dist/{service-DLHBDMEI.js → service-BW7NT4R2.js} +9 -9
- package/dist/{share-GS3Z4J2Z.js → share-JJ6G2SRE.js} +12 -12
- package/dist/{sherpa-VL2QSAMK.js → sherpa-ZARNRTUF.js} +9 -9
- package/dist/{skills-LXKJRUCF.js → skills-H6QD7AIP.js} +7 -7
- package/dist/{skillsUpdateCheck-XMFKI3F2.js → skillsUpdateCheck-BBSSMBNI.js} +3 -3
- package/dist/{slideshow-ARJR22W4.js → slideshow-PC3BBO5F.js} +1 -1
- package/dist/{snapshot-6BVWACEB.js → snapshot-AIASY7ZT.js} +25 -25
- package/dist/{src-K6EIKBHK.js → src-IVCOSSDJ.js} +6 -4
- package/dist/{src-5DALALRV.js → src-RNWDJRGO.js} +7 -7
- package/dist/{start-GSVOQ7VY.js → start-CVUWN3EJ.js} +13 -13
- package/dist/{staticProjectServer-PXZAGXPM.js → staticProjectServer-XHYEFNOX.js} +8 -8
- package/dist/{status-U532HK6C.js → status-TCUB55VV.js} +5 -5
- package/dist/studio/assets/{hyperframes-player-DhaQoeHg.js → hyperframes-player-DHIxqu8A.js} +1 -1
- package/dist/studio/assets/{index-qILK-NRY.js → index-CefNftWO.js} +1 -1
- package/dist/studio/assets/{index-DPeGppVA.js → index-CuCj-ntQ.js} +117 -117
- package/dist/studio/assets/{pausedVideoDecoder-DqCJ5lI8.js → pausedVideoDecoder-Dy-s5uPt.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-BTDNUTUL.js → studio-api-HPYJHSZY.js} +5 -5
- package/dist/{studioServer-ZDIVHU5Q.js → studioServer-RIYJYGVD.js} +39 -39
- package/dist/{sync-KXUIN2XW.js → sync-ILVIJDYI.js} +10 -10
- package/dist/{telemetry-BE6NYAAP.js → telemetry-Q6X3TCN6.js} +4 -4
- package/dist/{templates-6DXDZKQT.js → templates-64NH2NZF.js} +5 -5
- package/dist/{timeline-DYU2RWSB.js → timeline-CR4YEFN4.js} +12 -12
- package/dist/{tokens-SSWEYFOF.js → tokens-NISS5JD7.js} +2 -2
- package/dist/{transcribe-EHMQS2JF.js → transcribe-AP3PUNHX.js} +8 -8
- package/dist/{transcribe-7E653TIR.js → transcribe-R7K7NSGF.js} +17 -17
- package/dist/{update-5PNT24HU.js → update-OI6DZTRT.js} +8 -8
- package/dist/{updateCheck-DS6TTOUW.js → updateCheck-7ZCJ7FNE.js} +2 -2
- package/dist/{upgrade-EHJ32IGT.js → upgrade-D6VGQSRH.js} +3 -3
- package/dist/{urlDownloader-6ZROXAQ7.js → urlDownloader-KE7AXBCY.js} +4 -4
- package/dist/{validate-OPKF4E6C.js → validate-LZBOVEFV.js} +16 -16
- package/dist/{video-BRGYDCC2.js → video-7KEKO4H2.js} +4 -4
- package/dist/{voices-CYPYVEAI.js → voices-6EOBOCEU.js} +13 -13
- package/dist/warmCheck.js +26 -26
- package/package.json +1 -1
|
@@ -105,6 +105,10 @@ import {
|
|
|
105
105
|
timeAtSourceTime,
|
|
106
106
|
volumeSegmentSampleCount
|
|
107
107
|
} from "./chunk-DQZRNGDS.js";
|
|
108
|
+
import {
|
|
109
|
+
isPrivateFileUnder,
|
|
110
|
+
isVcsOrSecretPath
|
|
111
|
+
} from "./chunk-XWK2RSD5.js";
|
|
108
112
|
import {
|
|
109
113
|
browserPathFromEnv,
|
|
110
114
|
buildChromeLaunchEnv,
|
|
@@ -116,7 +120,7 @@ import {
|
|
|
116
120
|
} from "./chunk-LEIR7IDJ.js";
|
|
117
121
|
import {
|
|
118
122
|
resolveReferencedStart
|
|
119
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-H4LCNEA2.js";
|
|
120
124
|
import {
|
|
121
125
|
isWithinProjectRoot,
|
|
122
126
|
resolveProjectRelativeSrc
|
|
@@ -837,7 +841,7 @@ async function diagnoseChromeStartup(executablePath, args, options = {}) {
|
|
|
837
841
|
const profile = mkdtempSync(join2(tmpdir2(), "hf-chrome-probe-"));
|
|
838
842
|
const timeoutMs = options.timeoutMs ?? PROBE_TIMEOUT_MS;
|
|
839
843
|
try {
|
|
840
|
-
return await new Promise((
|
|
844
|
+
return await new Promise((resolve3) => {
|
|
841
845
|
let stderr = "";
|
|
842
846
|
const child = spawn(executablePath, startupArgs(args, profile), {
|
|
843
847
|
env: buildChromeLaunchEnv(options.env),
|
|
@@ -846,14 +850,14 @@ async function diagnoseChromeStartup(executablePath, args, options = {}) {
|
|
|
846
850
|
});
|
|
847
851
|
const timer = setTimeout(() => {
|
|
848
852
|
child.kill();
|
|
849
|
-
|
|
853
|
+
resolve3(`Chrome started and kept running for ${timeoutMs} ms when launched on its own.`);
|
|
850
854
|
}, timeoutMs);
|
|
851
855
|
options.signal?.addEventListener(
|
|
852
856
|
"abort",
|
|
853
857
|
() => {
|
|
854
858
|
clearTimeout(timer);
|
|
855
859
|
child.kill();
|
|
856
|
-
|
|
860
|
+
resolve3("The startup check was cancelled.");
|
|
857
861
|
},
|
|
858
862
|
{ once: true }
|
|
859
863
|
);
|
|
@@ -862,14 +866,14 @@ async function diagnoseChromeStartup(executablePath, args, options = {}) {
|
|
|
862
866
|
});
|
|
863
867
|
child.once("error", (error) => {
|
|
864
868
|
clearTimeout(timer);
|
|
865
|
-
|
|
869
|
+
resolve3(`Chrome could not be started: ${error.message}`);
|
|
866
870
|
});
|
|
867
871
|
child.once("exit", (code, signal) => {
|
|
868
872
|
clearTimeout(timer);
|
|
869
873
|
const how = signal ? `was stopped by ${signal}` : `exited with code ${code}`;
|
|
870
874
|
const named = nameChromeExit(code, options.platform);
|
|
871
875
|
const lines = tail(stderr);
|
|
872
|
-
|
|
876
|
+
resolve3(
|
|
873
877
|
[`Chrome ${how} when launched on its own.`, named, lines && `stderr:
|
|
874
878
|
${lines}`].filter(Boolean).join("\n")
|
|
875
879
|
);
|
|
@@ -1179,7 +1183,7 @@ var BrowserLeasePool = class _BrowserLeasePool {
|
|
|
1179
1183
|
for (const entry of entries) this.requestClose(entry, false);
|
|
1180
1184
|
const settle = Promise.all(entries.map((entry) => entry.closePromise));
|
|
1181
1185
|
const bound = new Promise(
|
|
1182
|
-
(
|
|
1186
|
+
(resolve3) => setTimeout(resolve3, _BrowserLeasePool.DRAIN_FORCE_CLOSE_MS).unref()
|
|
1183
1187
|
);
|
|
1184
1188
|
this.drainPromise = Promise.race([settle, bound]).then(() => {
|
|
1185
1189
|
for (const entry of entries) if (this.entries.has(entry)) this.requestClose(entry, true);
|
|
@@ -1278,11 +1282,11 @@ var BrowserLeasePool = class _BrowserLeasePool {
|
|
|
1278
1282
|
await Promise.race([
|
|
1279
1283
|
this.options.close(result.browser).catch(() => {
|
|
1280
1284
|
}),
|
|
1281
|
-
new Promise((
|
|
1285
|
+
new Promise((resolve3) => {
|
|
1282
1286
|
entry.forceClose = () => {
|
|
1283
1287
|
entry.forceClose = void 0;
|
|
1284
1288
|
this.options.forceClose(result.browser);
|
|
1285
|
-
|
|
1289
|
+
resolve3();
|
|
1286
1290
|
};
|
|
1287
1291
|
})
|
|
1288
1292
|
]);
|
|
@@ -2113,11 +2117,11 @@ async function assertWebGpuAdapterAvailable(page, requiresWebGpu, softwareWebGpu
|
|
|
2113
2117
|
};
|
|
2114
2118
|
return await Promise.race([
|
|
2115
2119
|
probe(),
|
|
2116
|
-
new Promise((
|
|
2120
|
+
new Promise((resolve3) => {
|
|
2117
2121
|
timer = (globalThis.window?.__HF_VIRTUAL_TIME__?.originalSetTimeout ?? setTimeout)(
|
|
2118
2122
|
() => {
|
|
2119
2123
|
expired = true;
|
|
2120
|
-
|
|
2124
|
+
resolve3(false);
|
|
2121
2125
|
},
|
|
2122
2126
|
timeoutMs
|
|
2123
2127
|
);
|
|
@@ -2580,7 +2584,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
|
|
|
2580
2584
|
);
|
|
2581
2585
|
}
|
|
2582
2586
|
const frameId = ++state.nextId;
|
|
2583
|
-
const encodeResult = new Promise((
|
|
2587
|
+
const encodeResult = new Promise((resolve3, reject) => {
|
|
2584
2588
|
const timer = setTimeout(() => {
|
|
2585
2589
|
if (state.pending.delete(frameId)) {
|
|
2586
2590
|
reject(new Error(`drawElement worker encode timed out (frame ${frameId})`));
|
|
@@ -2589,7 +2593,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
|
|
|
2589
2593
|
state.pending.set(frameId, {
|
|
2590
2594
|
resolve: (b) => {
|
|
2591
2595
|
clearTimeout(timer);
|
|
2592
|
-
|
|
2596
|
+
resolve3(b);
|
|
2593
2597
|
},
|
|
2594
2598
|
reject: (e) => {
|
|
2595
2599
|
clearTimeout(timer);
|
|
@@ -2745,7 +2749,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
|
|
|
2745
2749
|
for (let i = 0; i < times.length; i++) {
|
|
2746
2750
|
const frameId = ++state.nextId;
|
|
2747
2751
|
fids.push(frameId);
|
|
2748
|
-
const p = new Promise((
|
|
2752
|
+
const p = new Promise((resolve3, reject) => {
|
|
2749
2753
|
const timer = setTimeout(() => {
|
|
2750
2754
|
if (state.pending.delete(frameId)) {
|
|
2751
2755
|
reject(new Error(`drawElement worker encode timed out (frame ${frameId})`));
|
|
@@ -2754,7 +2758,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
|
|
|
2754
2758
|
state.pending.set(frameId, {
|
|
2755
2759
|
resolve: (b) => {
|
|
2756
2760
|
clearTimeout(timer);
|
|
2757
|
-
|
|
2761
|
+
resolve3(b);
|
|
2758
2762
|
},
|
|
2759
2763
|
reject: (e) => {
|
|
2760
2764
|
clearTimeout(timer);
|
|
@@ -3881,8 +3885,8 @@ async function describePageMotionBlur(page, record2) {
|
|
|
3881
3885
|
}
|
|
3882
3886
|
async function describePageMotionBlurAtEnd(page, timeoutMs = 1500, record2) {
|
|
3883
3887
|
let timer;
|
|
3884
|
-
const stuck = new Promise((
|
|
3885
|
-
timer = setTimeout(() =>
|
|
3888
|
+
const stuck = new Promise((resolve3) => {
|
|
3889
|
+
timer = setTimeout(() => resolve3(null), timeoutMs);
|
|
3886
3890
|
});
|
|
3887
3891
|
try {
|
|
3888
3892
|
const r = await Promise.race([readPageMotionBlur(page), stuck]);
|
|
@@ -4002,8 +4006,8 @@ async function probeBeginFrameLiveness(page, timeoutMs, frameTimeTicks, interval
|
|
|
4002
4006
|
try {
|
|
4003
4007
|
return await Promise.race([
|
|
4004
4008
|
client.send("HeadlessExperimental.beginFrame", params).then(() => true).catch(() => false),
|
|
4005
|
-
new Promise((
|
|
4006
|
-
timer = setTimeout(() =>
|
|
4009
|
+
new Promise((resolve3) => {
|
|
4010
|
+
timer = setTimeout(() => resolve3(false), timeoutMs);
|
|
4007
4011
|
})
|
|
4008
4012
|
]);
|
|
4009
4013
|
} finally {
|
|
@@ -4601,9 +4605,9 @@ async function initThreeDProjectionInPage() {
|
|
|
4601
4605
|
const toDataUrl = async (url) => {
|
|
4602
4606
|
const resp = await fetch(url);
|
|
4603
4607
|
const blob = await resp.blob();
|
|
4604
|
-
return new Promise((
|
|
4608
|
+
return new Promise((resolve3, reject) => {
|
|
4605
4609
|
const r = new FileReader();
|
|
4606
|
-
r.onload = () =>
|
|
4610
|
+
r.onload = () => resolve3(String(r.result));
|
|
4607
4611
|
r.onerror = () => reject(new Error(`FileReader failed for ${url}`));
|
|
4608
4612
|
r.readAsDataURL(blob);
|
|
4609
4613
|
});
|
|
@@ -5302,12 +5306,12 @@ async function scanChunk(page, times) {
|
|
|
5302
5306
|
}, times);
|
|
5303
5307
|
}
|
|
5304
5308
|
function withinBudget(work, ms) {
|
|
5305
|
-
return new Promise((
|
|
5306
|
-
const timer = setTimeout(() =>
|
|
5309
|
+
return new Promise((resolve3, reject) => {
|
|
5310
|
+
const timer = setTimeout(() => resolve3(null), Math.max(0, ms));
|
|
5307
5311
|
work.then(
|
|
5308
5312
|
(value) => {
|
|
5309
5313
|
clearTimeout(timer);
|
|
5310
|
-
|
|
5314
|
+
resolve3(value);
|
|
5311
5315
|
},
|
|
5312
5316
|
(error) => {
|
|
5313
5317
|
clearTimeout(timer);
|
|
@@ -5487,7 +5491,16 @@ function urlInputArgs(input, {
|
|
|
5487
5491
|
);
|
|
5488
5492
|
}
|
|
5489
5493
|
const networkRetry = tool === "ffmpeg" ? ["-reconnect_on_network_error", "1"] : [];
|
|
5490
|
-
|
|
5494
|
+
const nestedOpensStayOnHttps = resolveRestrictPageNetwork() ? ["-protocol_whitelist", "https,tls,tcp"] : [];
|
|
5495
|
+
return [
|
|
5496
|
+
"-tls_verify",
|
|
5497
|
+
"1",
|
|
5498
|
+
"-ca_file",
|
|
5499
|
+
caFile,
|
|
5500
|
+
...RECONNECT_ARGS,
|
|
5501
|
+
...networkRetry,
|
|
5502
|
+
...nestedOpensStayOnHttps
|
|
5503
|
+
];
|
|
5491
5504
|
}
|
|
5492
5505
|
function redactUrlQueriesInError(error) {
|
|
5493
5506
|
if (!(error instanceof Error)) return error;
|
|
@@ -5544,8 +5557,8 @@ var ManagedChildProcess = class {
|
|
|
5544
5557
|
this.options = options;
|
|
5545
5558
|
this.now = options.now ?? Date.now;
|
|
5546
5559
|
this.startedAtMs = this.now();
|
|
5547
|
-
this.outcomePromise = new Promise((
|
|
5548
|
-
this.resolveOutcome =
|
|
5560
|
+
this.outcomePromise = new Promise((resolve3) => {
|
|
5561
|
+
this.resolveOutcome = resolve3;
|
|
5549
5562
|
});
|
|
5550
5563
|
child.stderr?.on("data", this.onStderr);
|
|
5551
5564
|
child.once("spawn", this.onSpawn);
|
|
@@ -6034,7 +6047,7 @@ function readProbeJson(filePath, signal) {
|
|
|
6034
6047
|
}
|
|
6035
6048
|
var runtimeFfprobeMajor;
|
|
6036
6049
|
function ffprobeMajor() {
|
|
6037
|
-
runtimeFfprobeMajor ??= new Promise((
|
|
6050
|
+
runtimeFfprobeMajor ??= new Promise((resolve3) => {
|
|
6038
6051
|
let out = "";
|
|
6039
6052
|
const binary = getFfprobeBinary();
|
|
6040
6053
|
const proc = spawn3(binary, ["-version"], {
|
|
@@ -6042,8 +6055,8 @@ function ffprobeMajor() {
|
|
|
6042
6055
|
windowsHide: true
|
|
6043
6056
|
});
|
|
6044
6057
|
proc.stdout.on("data", (chunk) => out += String(chunk));
|
|
6045
|
-
proc.on("error", () =>
|
|
6046
|
-
proc.on("close", () =>
|
|
6058
|
+
proc.on("error", () => resolve3(void 0));
|
|
6059
|
+
proc.on("close", () => resolve3(Number(/version n?(\d+)/.exec(out)?.[1]) || void 0));
|
|
6047
6060
|
});
|
|
6048
6061
|
return runtimeFfprobeMajor;
|
|
6049
6062
|
}
|
|
@@ -7324,9 +7337,9 @@ async function decodeDynamicCssBackgroundImages(page) {
|
|
|
7324
7337
|
const image = new Image();
|
|
7325
7338
|
image.src = url;
|
|
7326
7339
|
let timer;
|
|
7327
|
-
const expired = new Promise((
|
|
7340
|
+
const expired = new Promise((resolve3) => {
|
|
7328
7341
|
timer = (window.__HF_VIRTUAL_TIME__?.originalSetTimeout ?? setTimeout)(
|
|
7329
|
-
() =>
|
|
7342
|
+
() => resolve3("late"),
|
|
7330
7343
|
limitMs
|
|
7331
7344
|
);
|
|
7332
7345
|
});
|
|
@@ -7447,7 +7460,7 @@ function formatHttpErrorDiagnostic(input) {
|
|
|
7447
7460
|
return `[Browser:HTTP${input.status}] ${input.method} ${sanitizeDiagnosticUrl(input.url)} resource=${input.resourceType}${statusText}`;
|
|
7448
7461
|
}
|
|
7449
7462
|
var LOCKED_WARMUP_TICKS = 60;
|
|
7450
|
-
var realSleep = (ms) => new Promise((
|
|
7463
|
+
var realSleep = (ms) => new Promise((resolve3) => setTimeout(resolve3, ms));
|
|
7451
7464
|
function warmupFrameTimeTicks(state, intervalMs) {
|
|
7452
7465
|
return state.ticks * intervalMs;
|
|
7453
7466
|
}
|
|
@@ -7535,10 +7548,10 @@ async function waitForCloseWithTimeout(promise) {
|
|
|
7535
7548
|
() => void 0,
|
|
7536
7549
|
() => void 0
|
|
7537
7550
|
),
|
|
7538
|
-
new Promise((
|
|
7551
|
+
new Promise((resolve3) => {
|
|
7539
7552
|
timer = setTimeout(() => {
|
|
7540
7553
|
timedOut = true;
|
|
7541
|
-
|
|
7554
|
+
resolve3();
|
|
7542
7555
|
}, CAPTURE_SESSION_CLOSE_TIMEOUT_MS);
|
|
7543
7556
|
})
|
|
7544
7557
|
]);
|
|
@@ -8155,7 +8168,7 @@ async function pollHfReady(page, timeoutMs, intervalMs = 100) {
|
|
|
8155
8168
|
}
|
|
8156
8169
|
}
|
|
8157
8170
|
}
|
|
8158
|
-
await new Promise((
|
|
8171
|
+
await new Promise((resolve3) => setTimeout(resolve3, intervalMs));
|
|
8159
8172
|
}
|
|
8160
8173
|
const diag = await evaluateHfDiagnostic(page);
|
|
8161
8174
|
if (diag.hasSeek && diag.duration === 0) {
|
|
@@ -8343,7 +8356,7 @@ async function pollSubCompositionTimelines(page, timeoutMs, {
|
|
|
8343
8356
|
);
|
|
8344
8357
|
break;
|
|
8345
8358
|
}
|
|
8346
|
-
await new Promise((
|
|
8359
|
+
await new Promise((resolve3) => setTimeout(resolve3, intervalMs));
|
|
8347
8360
|
}
|
|
8348
8361
|
const pendingIds = ready && knownUnregisteredIds.length === 0 ? [] : await listUnregisteredTimelineIds(page);
|
|
8349
8362
|
if (ready && pendingIds.length > 0 && (getScriptLoadFailures?.() ?? []).length > 0) {
|
|
@@ -8387,7 +8400,7 @@ async function pollVideosReady(page, skipIds, timeoutMs, intervalMs = 100) {
|
|
|
8387
8400
|
const deadline = Date.now() + timeoutMs;
|
|
8388
8401
|
while (Date.now() < deadline) {
|
|
8389
8402
|
if (await check()) return true;
|
|
8390
|
-
await new Promise((
|
|
8403
|
+
await new Promise((resolve3) => setTimeout(resolve3, intervalMs));
|
|
8391
8404
|
}
|
|
8392
8405
|
return check();
|
|
8393
8406
|
}
|
|
@@ -8410,7 +8423,7 @@ async function pollImagesReady(page, timeoutMs, intervalMs = 100) {
|
|
|
8410
8423
|
const deadline = Date.now() + timeoutMs;
|
|
8411
8424
|
while (Date.now() < deadline) {
|
|
8412
8425
|
if (await check()) return true;
|
|
8413
|
-
await new Promise((
|
|
8426
|
+
await new Promise((resolve3) => setTimeout(resolve3, intervalMs));
|
|
8414
8427
|
}
|
|
8415
8428
|
return check();
|
|
8416
8429
|
}
|
|
@@ -8554,7 +8567,7 @@ async function waitForShownLateImages(session, frameIndex) {
|
|
|
8554
8567
|
throw stopped;
|
|
8555
8568
|
}
|
|
8556
8569
|
if (waiting.length === 0) return;
|
|
8557
|
-
await new Promise((
|
|
8570
|
+
await new Promise((resolve3) => setTimeout(resolve3, LATE_IMAGE_POLL_MS));
|
|
8558
8571
|
}
|
|
8559
8572
|
}
|
|
8560
8573
|
function recordBackgroundDecodeTimeouts(session, urls) {
|
|
@@ -8691,7 +8704,7 @@ async function waitForOptionalTailwindReady(page, timeoutMs) {
|
|
|
8691
8704
|
page.evaluate(
|
|
8692
8705
|
`Promise.resolve(window.__tailwindReady).then(() => true, () => false)`
|
|
8693
8706
|
),
|
|
8694
|
-
new Promise((
|
|
8707
|
+
new Promise((resolve3) => setTimeout(() => resolve3(false), timeoutMs))
|
|
8695
8708
|
]);
|
|
8696
8709
|
if (!ready) {
|
|
8697
8710
|
throw new Error(
|
|
@@ -9652,7 +9665,7 @@ function claimStaticDedupCheck(session) {
|
|
|
9652
9665
|
const pending = checks.get(key);
|
|
9653
9666
|
if (pending) return { kind: "reuse", check: pending };
|
|
9654
9667
|
let settle;
|
|
9655
|
-
checks.set(key, new Promise((
|
|
9668
|
+
checks.set(key, new Promise((resolve3) => settle = resolve3));
|
|
9656
9669
|
return { kind: "verify", settle };
|
|
9657
9670
|
}
|
|
9658
9671
|
function shareableStaticFrames(verdict) {
|
|
@@ -11827,12 +11840,12 @@ function createFrameReorderBuffer(startFrame, endFrame) {
|
|
|
11827
11840
|
let cursor = startFrame;
|
|
11828
11841
|
let aborted = null;
|
|
11829
11842
|
const pending = /* @__PURE__ */ new Map();
|
|
11830
|
-
const enqueueAt = (frame,
|
|
11843
|
+
const enqueueAt = (frame, resolve3, reject) => {
|
|
11831
11844
|
const list = pending.get(frame);
|
|
11832
11845
|
if (list === void 0) {
|
|
11833
|
-
pending.set(frame, [{ resolve:
|
|
11846
|
+
pending.set(frame, [{ resolve: resolve3, reject }]);
|
|
11834
11847
|
} else {
|
|
11835
|
-
list.push({ resolve:
|
|
11848
|
+
list.push({ resolve: resolve3, reject });
|
|
11836
11849
|
}
|
|
11837
11850
|
};
|
|
11838
11851
|
const flushAt = (frame) => {
|
|
@@ -11841,31 +11854,31 @@ function createFrameReorderBuffer(startFrame, endFrame) {
|
|
|
11841
11854
|
pending.delete(frame);
|
|
11842
11855
|
for (const waiter of list) waiter.resolve();
|
|
11843
11856
|
};
|
|
11844
|
-
const waitForFrame = (frame) => new Promise((
|
|
11857
|
+
const waitForFrame = (frame) => new Promise((resolve3, reject) => {
|
|
11845
11858
|
if (aborted) {
|
|
11846
11859
|
reject(aborted);
|
|
11847
11860
|
return;
|
|
11848
11861
|
}
|
|
11849
11862
|
if (frame === cursor) {
|
|
11850
|
-
|
|
11863
|
+
resolve3();
|
|
11851
11864
|
return;
|
|
11852
11865
|
}
|
|
11853
|
-
enqueueAt(frame,
|
|
11866
|
+
enqueueAt(frame, resolve3, reject);
|
|
11854
11867
|
});
|
|
11855
11868
|
const advanceTo = (frame) => {
|
|
11856
11869
|
cursor = frame;
|
|
11857
11870
|
flushAt(frame);
|
|
11858
11871
|
};
|
|
11859
|
-
const waitForAllDone = () => new Promise((
|
|
11872
|
+
const waitForAllDone = () => new Promise((resolve3, reject) => {
|
|
11860
11873
|
if (aborted) {
|
|
11861
11874
|
reject(aborted);
|
|
11862
11875
|
return;
|
|
11863
11876
|
}
|
|
11864
11877
|
if (cursor >= endFrame) {
|
|
11865
|
-
|
|
11878
|
+
resolve3();
|
|
11866
11879
|
return;
|
|
11867
11880
|
}
|
|
11868
|
-
enqueueAt(endFrame,
|
|
11881
|
+
enqueueAt(endFrame, resolve3, reject);
|
|
11869
11882
|
});
|
|
11870
11883
|
const abort = (err) => {
|
|
11871
11884
|
if (aborted) return;
|
|
@@ -12195,8 +12208,8 @@ function spawnFfmpegStream(outputPath, args, {
|
|
|
12195
12208
|
}
|
|
12196
12209
|
const stdin = ffmpeg.stdin;
|
|
12197
12210
|
if (stdin && !stdin.destroyed) {
|
|
12198
|
-
await new Promise((
|
|
12199
|
-
stdin.end(() =>
|
|
12211
|
+
await new Promise((resolve3) => {
|
|
12212
|
+
stdin.end(() => resolve3());
|
|
12200
12213
|
});
|
|
12201
12214
|
}
|
|
12202
12215
|
const outcome = await exitPromise;
|
|
@@ -12377,20 +12390,20 @@ function isMemberGroupHidden(groupsById, el) {
|
|
|
12377
12390
|
|
|
12378
12391
|
// ../engine/src/services/videoFrameExtractor.ts
|
|
12379
12392
|
import { copyFileSync as copyFileSync2, existsSync as existsSync10, linkSync as linkSync2, mkdirSync as mkdirSync6, rmSync as rmSync5 } from "fs";
|
|
12380
|
-
import { basename as basename2, isAbsolute, join as join13, normalize, relative, win32 } from "path";
|
|
12393
|
+
import { basename as basename2, isAbsolute as isAbsolute2, join as join13, normalize, relative as relative2, win32 } from "path";
|
|
12381
12394
|
|
|
12382
12395
|
// ../engine/src/utils/concurrencyLimit.ts
|
|
12383
12396
|
function createConcurrencyLimit(limit) {
|
|
12384
12397
|
let active = 0;
|
|
12385
12398
|
const waiting = [];
|
|
12386
|
-
const waitForSlot = (signal) => new Promise((
|
|
12399
|
+
const waitForSlot = (signal) => new Promise((resolve3) => {
|
|
12387
12400
|
const granted = () => {
|
|
12388
12401
|
signal?.removeEventListener("abort", aborted);
|
|
12389
|
-
|
|
12402
|
+
resolve3(true);
|
|
12390
12403
|
};
|
|
12391
12404
|
const aborted = () => {
|
|
12392
12405
|
waiting.splice(waiting.indexOf(granted), 1);
|
|
12393
|
-
|
|
12406
|
+
resolve3(false);
|
|
12394
12407
|
};
|
|
12395
12408
|
waiting.push(granted);
|
|
12396
12409
|
signal?.addEventListener("abort", aborted, { once: true });
|
|
@@ -12487,11 +12500,167 @@ import {
|
|
|
12487
12500
|
statSync as statSync5,
|
|
12488
12501
|
unlinkSync
|
|
12489
12502
|
} from "fs";
|
|
12490
|
-
import { createHash, randomUUID as randomUUID2 } from "crypto";
|
|
12503
|
+
import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
|
|
12491
12504
|
import dns from "dns";
|
|
12492
|
-
import { dirname as
|
|
12505
|
+
import { dirname as dirname6, extname as extname2, join as join11 } from "path";
|
|
12493
12506
|
import { Readable, Transform } from "stream";
|
|
12494
12507
|
import { pipeline } from "stream/promises";
|
|
12508
|
+
|
|
12509
|
+
// ../engine/src/utils/notMediaPayload.ts
|
|
12510
|
+
import { createHash } from "crypto";
|
|
12511
|
+
import { open as openFile } from "fs/promises";
|
|
12512
|
+
import { dirname as dirname5, isAbsolute, relative, resolve as resolve2 } from "path";
|
|
12513
|
+
var NOT_MEDIA_PAYLOAD = "NOT_MEDIA_PAYLOAD";
|
|
12514
|
+
var MAX_LISTED_FINGERPRINTS = 8;
|
|
12515
|
+
var NotMediaPayloadError = class extends Error {
|
|
12516
|
+
code = NOT_MEDIA_PAYLOAD;
|
|
12517
|
+
owner = "user";
|
|
12518
|
+
retryable = false;
|
|
12519
|
+
elementFingerprints;
|
|
12520
|
+
constructor(elementFingerprints) {
|
|
12521
|
+
const listed2 = elementFingerprints.slice(0, MAX_LISTED_FINGERPRINTS).join(",");
|
|
12522
|
+
const elided = elementFingerprints.length - MAX_LISTED_FINGERPRINTS;
|
|
12523
|
+
super(
|
|
12524
|
+
`${elementFingerprints.length} media source(s) are text documents (HTML/XML/JSON, or a playlist naming files outside its own folder), not media containers [elements=${listed2}${elided > 0 ? `,+${elided}` : ""}]. Either an unresolved nested-composition preview URL was authored as a media src, or the source answered with an error page or API error body carrying a success status.`
|
|
12525
|
+
);
|
|
12526
|
+
this.name = "NotMediaPayloadError";
|
|
12527
|
+
this.elementFingerprints = elementFingerprints;
|
|
12528
|
+
}
|
|
12529
|
+
};
|
|
12530
|
+
function fingerprintElementId(elementId) {
|
|
12531
|
+
return createHash("sha256").update(elementId).digest("hex").slice(0, 16);
|
|
12532
|
+
}
|
|
12533
|
+
var SNIFF_BYTES = 512;
|
|
12534
|
+
var DOCUMENT_OPENING_BYTES = /* @__PURE__ */ new Set([60, 123, 91]);
|
|
12535
|
+
var SKIPPABLE_LEADING_BYTES = /* @__PURE__ */ new Set([0, 9, 10, 11, 12, 13, 32]);
|
|
12536
|
+
var BYTE_ORDER_MARKS = [
|
|
12537
|
+
Buffer.from([239, 187, 191]),
|
|
12538
|
+
// UTF-8
|
|
12539
|
+
Buffer.from([255, 254]),
|
|
12540
|
+
// UTF-16 LE
|
|
12541
|
+
Buffer.from([254, 255])
|
|
12542
|
+
// UTF-16 BE
|
|
12543
|
+
];
|
|
12544
|
+
function byteOrderMarkLength(head) {
|
|
12545
|
+
for (const mark of BYTE_ORDER_MARKS) {
|
|
12546
|
+
if (head.length >= mark.length && head.subarray(0, mark.length).equals(mark)) {
|
|
12547
|
+
return mark.length;
|
|
12548
|
+
}
|
|
12549
|
+
}
|
|
12550
|
+
return 0;
|
|
12551
|
+
}
|
|
12552
|
+
async function readHead(filePath, bytes = SNIFF_BYTES) {
|
|
12553
|
+
const fh = await openFile(filePath, "r");
|
|
12554
|
+
try {
|
|
12555
|
+
const buf = Buffer.alloc(bytes);
|
|
12556
|
+
let filled = 0;
|
|
12557
|
+
while (filled < buf.length) {
|
|
12558
|
+
const { bytesRead } = await fh.read(buf, filled, buf.length - filled, filled);
|
|
12559
|
+
if (bytesRead === 0) break;
|
|
12560
|
+
filled += bytesRead;
|
|
12561
|
+
}
|
|
12562
|
+
return buf.subarray(0, filled);
|
|
12563
|
+
} finally {
|
|
12564
|
+
await fh.close().catch(() => {
|
|
12565
|
+
});
|
|
12566
|
+
}
|
|
12567
|
+
}
|
|
12568
|
+
function startsWithDocumentByte(head) {
|
|
12569
|
+
for (let index = byteOrderMarkLength(head); index < head.length; index++) {
|
|
12570
|
+
const byte = head[index];
|
|
12571
|
+
if (byte === void 0) break;
|
|
12572
|
+
if (SKIPPABLE_LEADING_BYTES.has(byte)) continue;
|
|
12573
|
+
return DOCUMENT_OPENING_BYTES.has(byte);
|
|
12574
|
+
}
|
|
12575
|
+
return false;
|
|
12576
|
+
}
|
|
12577
|
+
async function isNotMediaPayload(filePath) {
|
|
12578
|
+
try {
|
|
12579
|
+
return startsWithDocumentByte(await readHead(filePath)) || await playlistLeavesItsFolder(filePath);
|
|
12580
|
+
} catch {
|
|
12581
|
+
return false;
|
|
12582
|
+
}
|
|
12583
|
+
}
|
|
12584
|
+
async function assertMediaPayload(filePath, elementId) {
|
|
12585
|
+
if (await isNotMediaPayload(filePath)) {
|
|
12586
|
+
throw new NotMediaPayloadError([fingerprintElementId(elementId)]);
|
|
12587
|
+
}
|
|
12588
|
+
}
|
|
12589
|
+
var MAX_PLAYLIST_BYTES = 8 * 1024 * 1024;
|
|
12590
|
+
var MAX_PLAYLIST_DEPTH = 8;
|
|
12591
|
+
var HTTP_URL = /^https?:\/\//i;
|
|
12592
|
+
var OTHER_SCHEME = /^[a-z][a-z0-9+.-]+:/i;
|
|
12593
|
+
var DRIVE_PATH = /^[a-z]:[\\/]/i;
|
|
12594
|
+
function playlistEntries(text) {
|
|
12595
|
+
const body = text.replace(/^\uFEFF/, "").trimStart();
|
|
12596
|
+
if (body.startsWith("#EXTM3U")) {
|
|
12597
|
+
return body.split(/\r?\n/).flatMap((raw) => {
|
|
12598
|
+
const line = raw.trim();
|
|
12599
|
+
const uris = [...line.matchAll(/URI="([^"]*)"/gi)].map((match) => match[1]);
|
|
12600
|
+
return line && !line.startsWith("#") ? [line, ...uris] : uris;
|
|
12601
|
+
});
|
|
12602
|
+
}
|
|
12603
|
+
if (/^ffconcat\s+version/i.test(body)) {
|
|
12604
|
+
return body.split(/\r?\n/).flatMap((raw) => {
|
|
12605
|
+
const match = /^\s*file\s+(.*)$/.exec(raw);
|
|
12606
|
+
if (!match) return [];
|
|
12607
|
+
const value = match[1].trim();
|
|
12608
|
+
return [value.startsWith("'") ? value.slice(1, -1).replace(/\\(.)/g, "$1") : value];
|
|
12609
|
+
});
|
|
12610
|
+
}
|
|
12611
|
+
return void 0;
|
|
12612
|
+
}
|
|
12613
|
+
function entryLeavesFolder(entry, base, folder) {
|
|
12614
|
+
if (HTTP_URL.test(entry)) return false;
|
|
12615
|
+
if (OTHER_SCHEME.test(entry) && !DRIVE_PATH.test(entry)) return true;
|
|
12616
|
+
return [entry, safeDecode(entry)].some((path) => {
|
|
12617
|
+
if (isAbsolute(path) || DRIVE_PATH.test(path) || path.startsWith("\\")) return true;
|
|
12618
|
+
const inside = relative(folder, resolve2(base, path));
|
|
12619
|
+
return inside === ".." || inside.startsWith("../") || inside.startsWith("..\\") || isAbsolute(inside);
|
|
12620
|
+
});
|
|
12621
|
+
}
|
|
12622
|
+
function safeDecode(value) {
|
|
12623
|
+
try {
|
|
12624
|
+
return decodeURIComponent(value);
|
|
12625
|
+
} catch {
|
|
12626
|
+
return value;
|
|
12627
|
+
}
|
|
12628
|
+
}
|
|
12629
|
+
async function playlistLeavesItsFolder(filePath, placedAt = filePath) {
|
|
12630
|
+
const placed = resolve2(placedAt);
|
|
12631
|
+
return listLeaves(resolve2(filePath), placed, dirname5(placed), /* @__PURE__ */ new Set(), 0);
|
|
12632
|
+
}
|
|
12633
|
+
async function startsAsPlaylist(path) {
|
|
12634
|
+
const head = (await readHead(path)).toString("utf8").replace(/^\uFEFF/, "").trimStart();
|
|
12635
|
+
return head.startsWith("#EXTM3U") || /^ffconcat\s+version/i.test(head);
|
|
12636
|
+
}
|
|
12637
|
+
async function listLeaves(readPath, path, folder, seen, depth) {
|
|
12638
|
+
try {
|
|
12639
|
+
if (!await startsAsPlaylist(readPath)) return false;
|
|
12640
|
+
if (depth >= MAX_PLAYLIST_DEPTH) return true;
|
|
12641
|
+
if (seen.has(path)) return false;
|
|
12642
|
+
seen.add(path);
|
|
12643
|
+
const body = await readHead(readPath, MAX_PLAYLIST_BYTES + 1);
|
|
12644
|
+
if (body.length > MAX_PLAYLIST_BYTES) return true;
|
|
12645
|
+
for (const entry of playlistEntries(body.toString("utf8")) ?? []) {
|
|
12646
|
+
if (await entryLeaves(entry, dirname5(path), folder, seen, depth)) return true;
|
|
12647
|
+
}
|
|
12648
|
+
return false;
|
|
12649
|
+
} catch {
|
|
12650
|
+
return false;
|
|
12651
|
+
}
|
|
12652
|
+
}
|
|
12653
|
+
async function entryLeaves(entry, base, folder, seen, depth) {
|
|
12654
|
+
if (entryLeavesFolder(entry, base, folder)) return true;
|
|
12655
|
+
if (HTTP_URL.test(entry)) return false;
|
|
12656
|
+
for (const local of /* @__PURE__ */ new Set([entry, safeDecode(entry)])) {
|
|
12657
|
+
const nested = resolve2(base, local);
|
|
12658
|
+
if (await listLeaves(nested, nested, folder, seen, depth + 1)) return true;
|
|
12659
|
+
}
|
|
12660
|
+
return false;
|
|
12661
|
+
}
|
|
12662
|
+
|
|
12663
|
+
// ../engine/src/utils/urlDownloader.ts
|
|
12495
12664
|
var inFlightDownloads = /* @__PURE__ */ new Map();
|
|
12496
12665
|
var signalScopes = /* @__PURE__ */ new WeakMap();
|
|
12497
12666
|
var nextSignalScope = 1;
|
|
@@ -12515,7 +12684,7 @@ function safeDownloadUrlIdentity(url) {
|
|
|
12515
12684
|
} catch {
|
|
12516
12685
|
}
|
|
12517
12686
|
return {
|
|
12518
|
-
urlFingerprint:
|
|
12687
|
+
urlFingerprint: createHash2("sha256").update(canonical).digest("hex"),
|
|
12519
12688
|
host
|
|
12520
12689
|
};
|
|
12521
12690
|
}
|
|
@@ -12600,7 +12769,7 @@ function assertPublicHttpsUrl(url) {
|
|
|
12600
12769
|
}
|
|
12601
12770
|
function getFilenameFromUrl(url, validationScope) {
|
|
12602
12771
|
const physicalIdentity = validationScope === "" ? url : `${url}\0${validationScope}`;
|
|
12603
|
-
const hash =
|
|
12772
|
+
const hash = createHash2("md5").update(physicalIdentity).digest("hex").slice(0, 12);
|
|
12604
12773
|
const urlObj = new URL(url);
|
|
12605
12774
|
const ext = extname2(urlObj.pathname) || ".mp4";
|
|
12606
12775
|
return `download_${hash}${ext}`;
|
|
@@ -12651,10 +12820,10 @@ async function waitForCacheLock(signal) {
|
|
|
12651
12820
|
if (signal?.aborted) {
|
|
12652
12821
|
throw new UrlDownloadError("cancelled", false, "Download cancelled");
|
|
12653
12822
|
}
|
|
12654
|
-
await new Promise((
|
|
12823
|
+
await new Promise((resolve3, reject) => {
|
|
12655
12824
|
const timeout = setTimeout(() => {
|
|
12656
12825
|
signal?.removeEventListener("abort", onAbort);
|
|
12657
|
-
|
|
12826
|
+
resolve3();
|
|
12658
12827
|
}, CACHE_LOCK_POLL_MS);
|
|
12659
12828
|
const onAbort = () => {
|
|
12660
12829
|
clearTimeout(timeout);
|
|
@@ -13077,8 +13246,8 @@ async function fetchToPartial(url, partialPath, controller, options, onSizedBody
|
|
|
13077
13246
|
const contentEncoding = response.headers.get("content-encoding")?.trim().toLowerCase();
|
|
13078
13247
|
const expectedBytes = !contentEncoding || contentEncoding === "identity" ? declaredLength : void 0;
|
|
13079
13248
|
let receivedBytes = 0;
|
|
13080
|
-
const sha256 =
|
|
13081
|
-
const md5 =
|
|
13249
|
+
const sha256 = createHash2("sha256");
|
|
13250
|
+
const md5 = createHash2("md5");
|
|
13082
13251
|
const prefixChunks = [];
|
|
13083
13252
|
let prefixBytes = 0;
|
|
13084
13253
|
const inspector = new Transform({
|
|
@@ -13157,7 +13326,7 @@ async function fetchToPartial(url, partialPath, controller, options, onSizedBody
|
|
|
13157
13326
|
expectedBytes,
|
|
13158
13327
|
receivedBytes,
|
|
13159
13328
|
rangeDisposition,
|
|
13160
|
-
etagFingerprint: etag ?
|
|
13329
|
+
etagFingerprint: etag ? createHash2("sha256").update(etag).digest("hex") : void 0,
|
|
13161
13330
|
etagWeak: etag ? /^W\//i.test(etag) : void 0,
|
|
13162
13331
|
localSize,
|
|
13163
13332
|
localSha256
|
|
@@ -13216,7 +13385,7 @@ function emitDownloadTelemetry(options, event) {
|
|
|
13216
13385
|
}
|
|
13217
13386
|
}
|
|
13218
13387
|
async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, signal) {
|
|
13219
|
-
const attemptDir = createStagingDir(
|
|
13388
|
+
const attemptDir = createStagingDir(dirname6(localPath), ".hf-download-");
|
|
13220
13389
|
const partialPath = join11(attemptDir, "payload");
|
|
13221
13390
|
const controller = new AbortController();
|
|
13222
13391
|
let timedOut = false;
|
|
@@ -13246,6 +13415,15 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
|
|
|
13246
13415
|
throw new UrlDownloadError("cancelled", false, "Download cancelled");
|
|
13247
13416
|
}
|
|
13248
13417
|
const integrity = await fetchToPartial(url, partialPath, controller, options, extendTimeout);
|
|
13418
|
+
if (await playlistLeavesItsFolder(partialPath, localPath)) {
|
|
13419
|
+
throw new UrlDownloadError(
|
|
13420
|
+
"invalid_payload",
|
|
13421
|
+
false,
|
|
13422
|
+
"Download is a playlist naming files outside its folder",
|
|
13423
|
+
integrity.status,
|
|
13424
|
+
integrity
|
|
13425
|
+
);
|
|
13426
|
+
}
|
|
13249
13427
|
let outcome = await syncAndPublishPartial(partialPath, localPath, timeoutMs, signal);
|
|
13250
13428
|
let publishedIntegrity = integrity;
|
|
13251
13429
|
if (outcome === "race_reused") {
|
|
@@ -13369,7 +13547,7 @@ async function downloadWithRetry(url, localPath, timeoutMs, signal, onTransientR
|
|
|
13369
13547
|
}
|
|
13370
13548
|
}
|
|
13371
13549
|
async function inspectExistingFile(path) {
|
|
13372
|
-
const sha256 =
|
|
13550
|
+
const sha256 = createHash2("sha256");
|
|
13373
13551
|
const prefixChunks = [];
|
|
13374
13552
|
let prefixBytes = 0;
|
|
13375
13553
|
let localSize = 0;
|
|
@@ -13533,7 +13711,7 @@ function unwrapTemplate(html) {
|
|
|
13533
13711
|
}
|
|
13534
13712
|
|
|
13535
13713
|
// ../engine/src/utils/mediaPathSegment.ts
|
|
13536
|
-
import { createHash as
|
|
13714
|
+
import { createHash as createHash3 } from "crypto";
|
|
13537
13715
|
var PLAIN_SEGMENT = /^(?!\.{1,2}$)[^/\\:]+$/;
|
|
13538
13716
|
var GENERATED_SUFFIX = /~[0-9a-f]{12}$/;
|
|
13539
13717
|
var READABLE_MAX_BYTES = 64;
|
|
@@ -13541,7 +13719,7 @@ function mediaIdPathSegment(id) {
|
|
|
13541
13719
|
if (PLAIN_SEGMENT.test(id) && !GENERATED_SUFFIX.test(id) && survivesCaseAndUnicodeFoldingOnMacAndWindowsDisks(id))
|
|
13542
13720
|
return id;
|
|
13543
13721
|
const readable = truncateUtf8(id.replace(/[/\\:]/g, "_"), READABLE_MAX_BYTES);
|
|
13544
|
-
const digest =
|
|
13722
|
+
const digest = createHash3("sha256").update(id).digest("hex").slice(0, 12);
|
|
13545
13723
|
return `${readable}~${digest}`;
|
|
13546
13724
|
}
|
|
13547
13725
|
function survivesCaseAndUnicodeFoldingOnMacAndWindowsDisks(id) {
|
|
@@ -13559,7 +13737,7 @@ function truncateUtf8(text, maxBytes) {
|
|
|
13559
13737
|
}
|
|
13560
13738
|
|
|
13561
13739
|
// ../engine/src/services/extractionCache.ts
|
|
13562
|
-
import { createHash as
|
|
13740
|
+
import { createHash as createHash4, randomUUID as randomUUID3 } from "crypto";
|
|
13563
13741
|
import {
|
|
13564
13742
|
createReadStream as createReadStream3,
|
|
13565
13743
|
existsSync as existsSync9,
|
|
@@ -13578,7 +13756,7 @@ var SCHEMA_PREFIX = "hfcache-v10-";
|
|
|
13578
13756
|
var KEY_HEX_CHARS = 16;
|
|
13579
13757
|
async function readContentSha256(path, signal) {
|
|
13580
13758
|
try {
|
|
13581
|
-
const hash =
|
|
13759
|
+
const hash = createHash4("sha256");
|
|
13582
13760
|
for await (const chunk of createReadStream3(path, { signal })) hash.update(chunk);
|
|
13583
13761
|
return hash.digest("hex");
|
|
13584
13762
|
} catch {
|
|
@@ -13608,7 +13786,7 @@ function canonicalKeyBlob(input) {
|
|
|
13608
13786
|
return JSON.stringify(blob);
|
|
13609
13787
|
}
|
|
13610
13788
|
function computeCacheKey(input) {
|
|
13611
|
-
return
|
|
13789
|
+
return createHash4("sha256").update(canonicalKeyBlob(input)).digest("hex");
|
|
13612
13790
|
}
|
|
13613
13791
|
function cacheEntryDirName(keyHash) {
|
|
13614
13792
|
return SCHEMA_PREFIX + keyHash.slice(0, KEY_HEX_CHARS);
|
|
@@ -13909,7 +14087,7 @@ function videoExtractionSourceLabel(src, baseDir) {
|
|
|
13909
14087
|
}
|
|
13910
14088
|
}
|
|
13911
14089
|
const path = src.split(/[?#]/)[0];
|
|
13912
|
-
const lib = WINDOWS_ABSOLUTE.test(path) ? win32 : { isAbsolute, relative, basename: basename2, normalize };
|
|
14090
|
+
const lib = WINDOWS_ABSOLUTE.test(path) ? win32 : { isAbsolute: isAbsolute2, relative: relative2, basename: basename2, normalize };
|
|
13913
14091
|
const relativePath = lib.isAbsolute(path) ? lib.relative(baseDir, path) : lib.normalize(path);
|
|
13914
14092
|
const label = relativePath.startsWith("..") || lib.isAbsolute(relativePath) ? lib.basename(path) : relativePath;
|
|
13915
14093
|
return label.replace(/\\/g, "/");
|
|
@@ -16404,87 +16582,7 @@ async function queryElementStacking(page, nativeHdrIds) {
|
|
|
16404
16582
|
|
|
16405
16583
|
// ../engine/src/services/audioMixer.ts
|
|
16406
16584
|
import { closeSync as closeSync4, existsSync as existsSync12, mkdirSync as mkdirSync7, openSync as openSync4, rmSync as rmSync7, writeFileSync as writeFileSync7 } from "fs";
|
|
16407
|
-
import { join as join17, dirname as
|
|
16408
|
-
|
|
16409
|
-
// ../engine/src/utils/notMediaPayload.ts
|
|
16410
|
-
import { createHash as createHash4 } from "crypto";
|
|
16411
|
-
import { open as openFile } from "fs/promises";
|
|
16412
|
-
var NOT_MEDIA_PAYLOAD = "NOT_MEDIA_PAYLOAD";
|
|
16413
|
-
var MAX_LISTED_FINGERPRINTS = 8;
|
|
16414
|
-
var NotMediaPayloadError = class extends Error {
|
|
16415
|
-
code = NOT_MEDIA_PAYLOAD;
|
|
16416
|
-
owner = "user";
|
|
16417
|
-
retryable = false;
|
|
16418
|
-
elementFingerprints;
|
|
16419
|
-
constructor(elementFingerprints) {
|
|
16420
|
-
const listed2 = elementFingerprints.slice(0, MAX_LISTED_FINGERPRINTS).join(",");
|
|
16421
|
-
const elided = elementFingerprints.length - MAX_LISTED_FINGERPRINTS;
|
|
16422
|
-
super(
|
|
16423
|
-
`${elementFingerprints.length} media source(s) are text documents (HTML/XML/JSON), not media containers [elements=${listed2}${elided > 0 ? `,+${elided}` : ""}]. Either an unresolved nested-composition preview URL was authored as a media src, or the source answered with an error page or API error body carrying a success status.`
|
|
16424
|
-
);
|
|
16425
|
-
this.name = "NotMediaPayloadError";
|
|
16426
|
-
this.elementFingerprints = elementFingerprints;
|
|
16427
|
-
}
|
|
16428
|
-
};
|
|
16429
|
-
function fingerprintElementId(elementId) {
|
|
16430
|
-
return createHash4("sha256").update(elementId).digest("hex").slice(0, 16);
|
|
16431
|
-
}
|
|
16432
|
-
var SNIFF_BYTES = 512;
|
|
16433
|
-
var DOCUMENT_OPENING_BYTES = /* @__PURE__ */ new Set([60, 123, 91]);
|
|
16434
|
-
var SKIPPABLE_LEADING_BYTES = /* @__PURE__ */ new Set([0, 9, 10, 11, 12, 13, 32]);
|
|
16435
|
-
var BYTE_ORDER_MARKS = [
|
|
16436
|
-
Buffer.from([239, 187, 191]),
|
|
16437
|
-
// UTF-8
|
|
16438
|
-
Buffer.from([255, 254]),
|
|
16439
|
-
// UTF-16 LE
|
|
16440
|
-
Buffer.from([254, 255])
|
|
16441
|
-
// UTF-16 BE
|
|
16442
|
-
];
|
|
16443
|
-
function byteOrderMarkLength(head) {
|
|
16444
|
-
for (const mark of BYTE_ORDER_MARKS) {
|
|
16445
|
-
if (head.length >= mark.length && head.subarray(0, mark.length).equals(mark)) {
|
|
16446
|
-
return mark.length;
|
|
16447
|
-
}
|
|
16448
|
-
}
|
|
16449
|
-
return 0;
|
|
16450
|
-
}
|
|
16451
|
-
async function readHead(filePath) {
|
|
16452
|
-
const fh = await openFile(filePath, "r");
|
|
16453
|
-
try {
|
|
16454
|
-
const buf = Buffer.alloc(SNIFF_BYTES);
|
|
16455
|
-
let filled = 0;
|
|
16456
|
-
while (filled < buf.length) {
|
|
16457
|
-
const { bytesRead } = await fh.read(buf, filled, buf.length - filled, filled);
|
|
16458
|
-
if (bytesRead === 0) break;
|
|
16459
|
-
filled += bytesRead;
|
|
16460
|
-
}
|
|
16461
|
-
return buf.subarray(0, filled);
|
|
16462
|
-
} finally {
|
|
16463
|
-
await fh.close().catch(() => {
|
|
16464
|
-
});
|
|
16465
|
-
}
|
|
16466
|
-
}
|
|
16467
|
-
function startsWithDocumentByte(head) {
|
|
16468
|
-
for (let index = byteOrderMarkLength(head); index < head.length; index++) {
|
|
16469
|
-
const byte = head[index];
|
|
16470
|
-
if (byte === void 0) break;
|
|
16471
|
-
if (SKIPPABLE_LEADING_BYTES.has(byte)) continue;
|
|
16472
|
-
return DOCUMENT_OPENING_BYTES.has(byte);
|
|
16473
|
-
}
|
|
16474
|
-
return false;
|
|
16475
|
-
}
|
|
16476
|
-
async function isNotMediaPayload(filePath) {
|
|
16477
|
-
try {
|
|
16478
|
-
return startsWithDocumentByte(await readHead(filePath));
|
|
16479
|
-
} catch {
|
|
16480
|
-
return false;
|
|
16481
|
-
}
|
|
16482
|
-
}
|
|
16483
|
-
async function assertMediaPayload(filePath, elementId) {
|
|
16484
|
-
if (await isNotMediaPayload(filePath)) {
|
|
16485
|
-
throw new NotMediaPayloadError([fingerprintElementId(elementId)]);
|
|
16486
|
-
}
|
|
16487
|
-
}
|
|
16585
|
+
import { join as join17, dirname as dirname9, isAbsolute as isAbsolute3, relative as relative3 } from "path";
|
|
16488
16586
|
|
|
16489
16587
|
// ../core/dist/audioFade.js
|
|
16490
16588
|
var HF_AUDIO_FADE_IN_ATTR = "data-fade-in";
|
|
@@ -16521,7 +16619,7 @@ function clampFadesToDuration(fades, duration) {
|
|
|
16521
16619
|
// ../engine/src/services/aacEncode.ts
|
|
16522
16620
|
import { execFile as execFile3 } from "child_process";
|
|
16523
16621
|
import { readFileSync as readFileSync6, writeFileSync as writeFileSync4 } from "fs";
|
|
16524
|
-
import { dirname as
|
|
16622
|
+
import { dirname as dirname7, join as join14 } from "path";
|
|
16525
16623
|
var SAMPLE_RATE = 48e3;
|
|
16526
16624
|
var FRAME_SAMPLES = 1024;
|
|
16527
16625
|
var MIN_SEGMENT_SECONDS = 60;
|
|
@@ -16559,13 +16657,13 @@ var settsDurationSupport = /* @__PURE__ */ new Map();
|
|
|
16559
16657
|
function supportsSettsDuration(binary = getFfmpegBinary()) {
|
|
16560
16658
|
let supported = settsDurationSupport.get(binary);
|
|
16561
16659
|
if (!supported) {
|
|
16562
|
-
supported = new Promise((
|
|
16660
|
+
supported = new Promise((resolve3) => {
|
|
16563
16661
|
execFile3(
|
|
16564
16662
|
binary,
|
|
16565
16663
|
["-hide_banner", "-h", "bsf=setts"],
|
|
16566
16664
|
{ windowsHide: true },
|
|
16567
16665
|
(error, stdout) => {
|
|
16568
|
-
|
|
16666
|
+
resolve3(error !== null || stdout.includes("duration"));
|
|
16569
16667
|
}
|
|
16570
16668
|
);
|
|
16571
16669
|
});
|
|
@@ -16589,7 +16687,7 @@ async function encodeAac(input, outputPath, totalDuration, {
|
|
|
16589
16687
|
if (!await supportsSettsDuration()) {
|
|
16590
16688
|
return encodeInOnePass(input, outputPath, { signal, timeout, filter });
|
|
16591
16689
|
}
|
|
16592
|
-
const dir = createStagingDir(
|
|
16690
|
+
const dir = createStagingDir(dirname7(outputPath), ".aac-segments-");
|
|
16593
16691
|
try {
|
|
16594
16692
|
const segments = planSegments(totalDuration, count).map((segment, k) => ({
|
|
16595
16693
|
...segment,
|
|
@@ -16755,7 +16853,7 @@ function audioFailureDiagnostics(values) {
|
|
|
16755
16853
|
|
|
16756
16854
|
// ../engine/src/services/audioVolumeEnvelope.ts
|
|
16757
16855
|
import { readFileSync as readFileSync7, rmSync as rmSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
16758
|
-
import { dirname as
|
|
16856
|
+
import { dirname as dirname8, join as join15 } from "path";
|
|
16759
16857
|
|
|
16760
16858
|
// ../core/dist/runtime/mediaVolumeEnvelope.js
|
|
16761
16859
|
function normaliseEnvelope(keyframes, trackStart, baseVolume) {
|
|
@@ -16881,7 +16979,7 @@ function applyVolumeEnvelopeToWav(wavPath, keyframes, trackStart, baseVolume) {
|
|
|
16881
16979
|
const layout = parseWavLayout(buffer);
|
|
16882
16980
|
if (!layout) return false;
|
|
16883
16981
|
scaleSamples(buffer, layout, gainAt);
|
|
16884
|
-
stagingDir = createStagingDir(
|
|
16982
|
+
stagingDir = createStagingDir(dirname8(wavPath), ".hf-volume-");
|
|
16885
16983
|
const tempPath = join15(stagingDir, "audio.wav");
|
|
16886
16984
|
writeFileSync5(tempPath, buffer, { flag: "wx" });
|
|
16887
16985
|
renameWithRetry(tempPath, wavPath);
|
|
@@ -17774,8 +17872,8 @@ function buildTrackInputFilter(track, index, volumeFilter, totalDuration, padToD
|
|
|
17774
17872
|
return `${filters}${padToDuration ? `,apad,asetpts=N/SR/TB,atrim=0:${formatFilterNumber(totalDuration)}` : ""}[a${index}]`;
|
|
17775
17873
|
}
|
|
17776
17874
|
function missingSourceMessage(elementId, src, baseDir, resolvedPath) {
|
|
17777
|
-
const relativePath =
|
|
17778
|
-
const insideProject = !relativePath.startsWith("..") && !
|
|
17875
|
+
const relativePath = relative3(baseDir, resolvedPath).replace(/\\/g, "/");
|
|
17876
|
+
const insideProject = !relativePath.startsWith("..") && !isAbsolute3(relativePath);
|
|
17779
17877
|
const authored = /^([\\/]|[A-Za-z]:)/.test(src) ? "" : `src="${src}" `;
|
|
17780
17878
|
return `Source not found for audio element ${elementId}: ${authored}resolved to ${insideProject ? relativePath : "a path outside the project"}`;
|
|
17781
17879
|
}
|
|
@@ -17957,7 +18055,7 @@ var FAIL_ON_READ_ERROR_INSTEAD_OF_ENDING_THERE = ["-xerror"];
|
|
|
17957
18055
|
var SIDECAR_WARM_UP_SECONDS = 1;
|
|
17958
18056
|
async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, duration, playbackRate = 1, signal, config, audioSidecarUrl, options) {
|
|
17959
18057
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
17960
|
-
const outputDir =
|
|
18058
|
+
const outputDir = dirname9(outputPath);
|
|
17961
18059
|
if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
17962
18060
|
const normalizedPlaybackRate = normalizeRateSpec(playbackRate);
|
|
17963
18061
|
const sourceDuration = sourceTimeAt(normalizedPlaybackRate, duration);
|
|
@@ -18103,7 +18201,7 @@ function isRemoteElement(element, baseDir, compiledDir, config) {
|
|
|
18103
18201
|
}
|
|
18104
18202
|
async function generateSilence(outputPath, duration, signal, config) {
|
|
18105
18203
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
18106
|
-
const outputDir =
|
|
18204
|
+
const outputDir = dirname9(outputPath);
|
|
18107
18205
|
if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
18108
18206
|
const args = [
|
|
18109
18207
|
"-f",
|
|
@@ -18157,7 +18255,7 @@ async function mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, con
|
|
|
18157
18255
|
failures: result2.failure ? [result2.failure] : void 0
|
|
18158
18256
|
};
|
|
18159
18257
|
}
|
|
18160
|
-
const outputDir =
|
|
18258
|
+
const outputDir = dirname9(outputPath);
|
|
18161
18259
|
if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
18162
18260
|
const buildFilterComplex = (ignoreAutomation, useNormalize2) => {
|
|
18163
18261
|
const filterParts = [];
|
|
@@ -18266,7 +18364,7 @@ function groupNormalizeOptionUnsupported(stderr) {
|
|
|
18266
18364
|
}
|
|
18267
18365
|
async function mixGroupMembersFlat(memberTracks, outputPath, totalDuration, signal, config) {
|
|
18268
18366
|
const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
|
|
18269
|
-
const outputDir =
|
|
18367
|
+
const outputDir = dirname9(outputPath);
|
|
18270
18368
|
if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
|
|
18271
18369
|
const buildInputFilters = (ignoreKeyframes, padMembers) => memberTracks.map((track, i) => {
|
|
18272
18370
|
const volumeFilter = buildVolumeExpression(track, ignoreKeyframes);
|
|
@@ -18399,8 +18497,8 @@ async function mixGroupMembers(memberTracks, outputPath, totalDuration, signal,
|
|
|
18399
18497
|
if (memberTracks.length <= MAX_MIX_INPUTS) {
|
|
18400
18498
|
return mixGroupMembersFlat(memberTracks, outputPath, totalDuration, signal, config);
|
|
18401
18499
|
}
|
|
18402
|
-
mkdirSync7(
|
|
18403
|
-
const scratchDir = createStagingDir(
|
|
18500
|
+
mkdirSync7(dirname9(outputPath), { recursive: true });
|
|
18501
|
+
const scratchDir = createStagingDir(dirname9(outputPath), ".mix-batches-");
|
|
18404
18502
|
try {
|
|
18405
18503
|
const summed = await sumInSlices(memberTracks, scratchDir, totalDuration, signal, config);
|
|
18406
18504
|
if (!summed.success) return summed;
|
|
@@ -18414,8 +18512,8 @@ async function mixAudioTracks(tracks, outputPath, totalDuration, signal, config)
|
|
|
18414
18512
|
if (tracks.length <= MAX_MIX_INPUTS) {
|
|
18415
18513
|
return mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, config);
|
|
18416
18514
|
}
|
|
18417
|
-
mkdirSync7(
|
|
18418
|
-
const scratchDir = createStagingDir(
|
|
18515
|
+
mkdirSync7(dirname9(outputPath), { recursive: true });
|
|
18516
|
+
const scratchDir = createStagingDir(dirname9(outputPath), ".mix-batches-");
|
|
18419
18517
|
try {
|
|
18420
18518
|
const summed = await sumInSlices(tracks, scratchDir, totalDuration, signal, config);
|
|
18421
18519
|
if (!summed.success) {
|
|
@@ -19189,7 +19287,7 @@ function shouldVerifyWorkerGpu(workerId, config) {
|
|
|
19189
19287
|
}
|
|
19190
19288
|
function withParallelWorkerDeadline(promise, diagnostic, timeoutMs, signal) {
|
|
19191
19289
|
if (signal?.aborted) return Promise.reject(new Error("Parallel worker cancelled"));
|
|
19192
|
-
return new Promise((
|
|
19290
|
+
return new Promise((resolve3, reject) => {
|
|
19193
19291
|
let timer;
|
|
19194
19292
|
const cleanup = () => {
|
|
19195
19293
|
if (timer) clearTimeout(timer);
|
|
@@ -19214,7 +19312,7 @@ function withParallelWorkerDeadline(promise, diagnostic, timeoutMs, signal) {
|
|
|
19214
19312
|
promise.then(
|
|
19215
19313
|
(value) => {
|
|
19216
19314
|
cleanup();
|
|
19217
|
-
|
|
19315
|
+
resolve3(value);
|
|
19218
19316
|
},
|
|
19219
19317
|
(error) => {
|
|
19220
19318
|
cleanup();
|
|
@@ -19534,8 +19632,8 @@ function isPoolFatalWorkerFailure(failure, streaming) {
|
|
|
19534
19632
|
function createFirstSessionGate(verify) {
|
|
19535
19633
|
let fail;
|
|
19536
19634
|
let pass;
|
|
19537
|
-
const settled = new Promise((
|
|
19538
|
-
pass =
|
|
19635
|
+
const settled = new Promise((resolve3, reject) => {
|
|
19636
|
+
pass = resolve3;
|
|
19539
19637
|
fail = reject;
|
|
19540
19638
|
});
|
|
19541
19639
|
settled.catch(() => {
|
|
@@ -19741,9 +19839,11 @@ function readRegularFile(filePath) {
|
|
|
19741
19839
|
function resolveContainedPaths(projectDir, compiledDir, relativePath) {
|
|
19742
19840
|
const projectPath = join20(projectDir, relativePath);
|
|
19743
19841
|
if (!isWithinProjectRoot(projectDir, projectPath)) return null;
|
|
19842
|
+
if (isPrivateFileUnder(projectDir, projectPath, isVcsOrSecretPath)) return null;
|
|
19744
19843
|
if (!compiledDir) return { projectPath, compiledPath: null };
|
|
19745
19844
|
const compiledPath = join20(compiledDir, relativePath);
|
|
19746
19845
|
if (!isWithinProjectRoot(compiledDir, compiledPath)) return null;
|
|
19846
|
+
if (isPrivateFileUnder(compiledDir, compiledPath, isVcsOrSecretPath)) return null;
|
|
19747
19847
|
return { projectPath, compiledPath };
|
|
19748
19848
|
}
|
|
19749
19849
|
function createFileServer(options) {
|
|
@@ -19777,11 +19877,11 @@ function createFileServer(options) {
|
|
|
19777
19877
|
headers: { "Content-Type": contentType }
|
|
19778
19878
|
});
|
|
19779
19879
|
});
|
|
19780
|
-
return new Promise((
|
|
19880
|
+
return new Promise((resolve3) => {
|
|
19781
19881
|
const server = serve({ fetch: app.fetch, port, hostname }, (info) => {
|
|
19782
19882
|
const actualPort = info.port;
|
|
19783
19883
|
const url = `http://localhost:${actualPort}`;
|
|
19784
|
-
|
|
19884
|
+
resolve3({
|
|
19785
19885
|
url,
|
|
19786
19886
|
port: actualPort,
|
|
19787
19887
|
close: () => server.close()
|
|
@@ -20297,6 +20397,12 @@ export {
|
|
|
20297
20397
|
HF_AUDIO_GROUP_TAG,
|
|
20298
20398
|
HF_AUDIO_GROUP_ATTR,
|
|
20299
20399
|
isSelfOrAncestorHidden,
|
|
20400
|
+
NOT_MEDIA_PAYLOAD,
|
|
20401
|
+
NotMediaPayloadError,
|
|
20402
|
+
fingerprintElementId,
|
|
20403
|
+
isNotMediaPayload,
|
|
20404
|
+
assertMediaPayload,
|
|
20405
|
+
playlistLeavesItsFolder,
|
|
20300
20406
|
safeDownloadUrlIdentity,
|
|
20301
20407
|
writeUrlDownloadTelemetry,
|
|
20302
20408
|
assertPublicHttpsUrl,
|
|
@@ -20344,11 +20450,6 @@ export {
|
|
|
20344
20450
|
measureVideoShownBoxRanges,
|
|
20345
20451
|
queryVideoElementBounds,
|
|
20346
20452
|
queryElementStacking,
|
|
20347
|
-
NOT_MEDIA_PAYLOAD,
|
|
20348
|
-
NotMediaPayloadError,
|
|
20349
|
-
fingerprintElementId,
|
|
20350
|
-
isNotMediaPayload,
|
|
20351
|
-
assertMediaPayload,
|
|
20352
20453
|
aacSegmentCount,
|
|
20353
20454
|
encodeAac,
|
|
20354
20455
|
audioFailureDiagnostics,
|