hyperframes 0.8.200 → 0.8.201
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-MFJDOJHQ.js → add-33XNCMY4.js} +14 -17
- package/dist/{animatedGifPrep-WBZ2VVP6.js → animatedGifPrep-MI7Z4OYQ.js} +8 -11
- package/dist/api.js +16 -19
- package/dist/{asset-PTAQLOR6.js → asset-RMRQN24O.js} +2 -2
- package/dist/{assetCataloger-N3UGZ2RC.js → assetCataloger-KWTQNFUU.js} +8 -11
- package/dist/{audio-CPHWRLC4.js → audio-SQDZZS6X.js} +33 -31
- package/dist/{auth-ZWOJIYK7.js → auth-PNC6K5ZD.js} +2 -2
- package/dist/{autoUpdate-DO74673A.js → autoUpdate-MBZFLUF2.js} +2 -2
- package/dist/{backgroundChecks-HOAN7YB6.js → backgroundChecks-ZMSPA6TK.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-AZFHTPSV.js → batchRender-2MMOZRMW.js} +5 -7
- package/dist/{beats-JRMM6JQQ.js → beats-GDLNPR4A.js} +32 -23
- package/dist/{benchmark-2PEQUV7H.js → benchmark-AUKB3XDF.js} +11 -13
- package/dist/{browser-2D6IHFO6.js → browser-C3AU5TST.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-ERB43NFP.js → bundleWithLocalizedFonts-G3UT65XI.js} +2 -2
- package/dist/{capture-WNC2DWF7.js → capture-EKNPCFPF.js} +15 -17
- package/dist/{capture-3ODEX55X.js → capture-XGBPNGC5.js} +2 -2
- package/dist/{captureCompositionFrame-JXXTHR7J.js → captureCompositionFrame-4HHLPTDH.js} +13 -16
- package/dist/{catalog-MHTRTKSY.js → catalog-HLDNEJX3.js} +14 -17
- package/dist/{catch-up-XNDRKMKL.js → catch-up-LRFV4LJO.js} +5 -5
- package/dist/{check-7IB355TM.js → check-XWHWGNYE.js} +39 -42
- package/dist/{checkBrowser-E3ZCTAGY.js → checkBrowser-KSOBXPJ3.js} +34 -37
- package/dist/{chunk-MMQ52NIZ.js → chunk-2BGOB2QK.js} +500 -17
- package/dist/{chunk-5ULL3P6S.js → chunk-2FA53V5S.js} +2 -2
- package/dist/{chunk-PFFR4NQV.js → chunk-3J5KO4EJ.js} +8 -10
- package/dist/{chunk-FTD5QXGF.js → chunk-47NZWTJL.js} +2 -2
- package/dist/{chunk-HXHSGDU6.js → chunk-53E45AKI.js} +60 -34
- package/dist/{chunk-TOC6E65N.js → chunk-6UFEOVR5.js} +2 -2
- package/dist/{chunk-I4VEFPZE.js → chunk-6XGO7ZKS.js} +1 -1
- package/dist/{chunk-G7RKSAKS.js → chunk-74UH2KGI.js} +28 -6
- package/dist/{chunk-7LRVGYKZ.js → chunk-7EJ7OZGC.js} +16 -3
- package/dist/{chunk-7D7V3UDI.js → chunk-7WEGIXI3.js} +2 -2
- package/dist/{chunk-NC3TVM27.js → chunk-A7YO6YSD.js} +6 -6
- package/dist/{chunk-OE7AUN6G.js → chunk-AK2MOAJY.js} +82 -34
- package/dist/{chunk-3XXSRN36.js → chunk-B67P2WP3.js} +2 -2
- package/dist/chunk-B7CYKBXQ.js +36 -0
- package/dist/{chunk-63JJFXAD.js → chunk-CD5ZU6PN.js} +6 -6
- package/dist/{chunk-IC6BO4GU.js → chunk-CV32PRH3.js} +65 -21
- package/dist/{chunk-Q5IJYX7X.js → chunk-DS3XITZ5.js} +2 -2
- package/dist/{chunk-XV7ZNBVY.js → chunk-DWULQYOQ.js} +3 -3
- package/dist/{chunk-VHBBV5DH.js → chunk-ERUINDRT.js} +62 -25
- package/dist/{chunk-FMTJ4I6I.js → chunk-FDWN4XAD.js} +1 -1
- package/dist/{chunk-57Y5X4VU.js → chunk-GC6N2LH5.js} +10 -12
- package/dist/{chunk-5CTORVUM.js → chunk-GHROWWUN.js} +32 -1
- package/dist/{chunk-ZFBET3PD.js → chunk-GKXH4C2B.js} +1 -1
- package/dist/{chunk-63S4VUOL.js → chunk-GNX3BCQP.js} +1 -1
- package/dist/{chunk-HBRPELT6.js → chunk-I4DHHX7E.js} +3 -3
- package/dist/{chunk-TDF2O2RM.js → chunk-IDRUJFT4.js} +2 -2
- package/dist/{chunk-H2X4TQVK.js → chunk-IFOZZYHK.js} +7 -7
- package/dist/{chunk-VFLBOKDI.js → chunk-IHQBTZHE.js} +3 -3
- package/dist/{chunk-KPUTRG54.js → chunk-IIH24PKY.js} +2 -2
- package/dist/{chunk-BIZPUWBG.js → chunk-ITJAHKYO.js} +1 -1
- package/dist/{chunk-6JR2XUEE.js → chunk-IXXVS2Z4.js} +1 -1
- package/dist/{chunk-QP4UWICL.js → chunk-JOI7TNCX.js} +2 -2
- package/dist/{chunk-RFQ6BIRL.js → chunk-JXLHLR26.js} +1 -1
- package/dist/{chunk-DY53XJ3P.js → chunk-K2AUGELJ.js} +1 -1
- package/dist/{chunk-733CEBPF.js → chunk-L33EDCSR.js} +5 -5
- package/dist/{chunk-7NWSVRFE.js → chunk-LVEXHBSH.js} +1 -1
- package/dist/{chunk-XOTUPVIF.js → chunk-MSGWR7WP.js} +9 -1
- package/dist/{chunk-ACH5ZR7X.js → chunk-ORMTNJBS.js} +3 -3
- package/dist/{chunk-DRTUJVLE.js → chunk-Q537KXWA.js} +153 -44
- package/dist/{chunk-7WV27W7R.js → chunk-Q6SHXSZX.js} +2 -2
- package/dist/{chunk-QDK7XCOB.js → chunk-QB4K2EWI.js} +1 -1
- package/dist/{chunk-BQA3X7TI.js → chunk-QSFWGZG6.js} +4 -6
- package/dist/{chunk-D35MPIGJ.js → chunk-QTWSMJ22.js} +15 -15
- package/dist/{chunk-4UPGPCMB.js → chunk-QXBZ6VBL.js} +1 -1
- package/dist/{chunk-FZ3R5XOH.js → chunk-QYTGUWNF.js} +1 -1
- package/dist/{chunk-JBQNDHRT.js → chunk-RVKJDAYE.js} +1 -1
- package/dist/{chunk-32V3VHMK.js → chunk-SEAHCCQ4.js} +6 -43
- package/dist/{chunk-GR2G5L2O.js → chunk-SGKG7DNX.js} +3 -3
- package/dist/{chunk-KVFSXCN6.js → chunk-SIZYTGG4.js} +1 -1
- package/dist/{chunk-3YGSZSEN.js → chunk-SZNCAINN.js} +1 -1
- package/dist/{chunk-I6A2B3IJ.js → chunk-T33GLS6C.js} +3 -3
- package/dist/{chunk-OYVVDYM6.js → chunk-TAXGZAXM.js} +10 -10
- package/dist/{chunk-FTUKOLLB.js → chunk-TOT3CLUK.js} +1 -1
- package/dist/{chunk-TTFHBTXQ.js → chunk-TYRDDIIH.js} +1 -1
- package/dist/{chunk-ML4IULLQ.js → chunk-U2EK5MFR.js} +10 -10
- package/dist/{chunk-QXPZGDTI.js → chunk-UIIGEPYY.js} +3 -3
- package/dist/{chunk-UUFY6A7I.js → chunk-UKB62QOT.js} +131 -92
- package/dist/{chunk-4VZAIVZQ.js → chunk-UOSTDTBF.js} +1 -1
- package/dist/{chunk-IW4LKYDY.js → chunk-VCVUEK65.js} +3 -3
- package/dist/{chunk-TUVNQA5B.js → chunk-VF2VMKNI.js} +3 -3
- package/dist/{chunk-QYQY5ACN.js → chunk-VKTUZP7U.js} +1 -1
- package/dist/{chunk-ISN6BAZX.js → chunk-WO3XZ6HC.js} +1 -1
- package/dist/{chunk-HN6TP4D2.js → chunk-X72DJZCM.js} +1 -1
- package/dist/{chunk-PGDWNIOK.js → chunk-XDMZY3H7.js} +57 -5
- package/dist/{chunk-BERGVZKN.js → chunk-XG365L6T.js} +1 -1
- package/dist/{chunk-GYSPF5ZT.js → chunk-XHVQIOOF.js} +19 -19
- package/dist/{chunk-OMXXJSCK.js → chunk-XONIZ5CH.js} +13 -13
- package/dist/{chunk-2LKHE32Z.js → chunk-YBJECXQJ.js} +5 -5
- package/dist/{chunk-WAG4AX5C.js → chunk-YTBE4JCX.js} +1 -1
- package/dist/{chunk-VLVQQJOX.js → chunk-ZDVJXWEG.js} +22 -3
- package/dist/chunk-ZKHXN2BV.js +3983 -0
- package/dist/{clean-BOYUTBAU.js → clean-EUKURSX2.js} +21 -24
- package/dist/cli.js +54 -54
- package/dist/{cloud-3O2MEZO4.js → cloud-LJDRNQ2N.js} +4 -4
- package/dist/{cloudrun-MCTN22O6.js → cloudrun-AXVFD6KV.js} +7 -9
- package/dist/{compare-A57RHCPB.js → compare-T3LMATAF.js} +31 -34
- package/dist/{compiler-LVNWLZCX.js → compiler-KH6DMHIJ.js} +6 -10
- package/dist/{component-MIJC3LWO.js → component-2FOHCMP2.js} +3 -3
- package/dist/{compositions-OUNZAEC3.js → compositions-REQ6ARAO.js} +13 -16
- package/dist/{delete-X6Q3S3SL.js → delete-KEPP2QAZ.js} +2 -2
- package/dist/{deploy-XXMIXGUF.js → deploy-N756FEME.js} +1 -1
- package/dist/{deterministicFonts-RMA7GDJC.js → deterministicFonts-4FULD3AS.js} +2 -2
- package/dist/{dist-2UO4RVFN.js → dist-5ULOGA6A.js} +28 -16
- package/dist/{dist-ONHJ6ZDA.js → dist-TFHABY7N.js} +2 -4
- package/dist/{doctor-ASSDEPCO.js → doctor-2SJPC4WZ.js} +14 -17
- package/dist/{dotEnv-64S3VKGH.js → dotEnv-RPHCAUBZ.js} +1 -1
- package/dist/{events-DVWSV3TQ.js → events-24ZE2PKB.js} +4 -4
- package/dist/{events-4ULC5VUK.js → events-U53QH4XZ.js} +3 -3
- package/dist/{feedback-OB3NJPNF.js → feedback-QFMLDLUN.js} +10 -12
- package/dist/{ffmpeg-JH3JXES2.js → ffmpeg-7XNWNO7M.js} +8 -11
- package/dist/{figma-GV4OGXC2.js → figma-B4JO44CV.js} +3 -3
- package/dist/fontLocalizeCli.js +11 -14
- package/dist/{get-FLMCUJGR.js → get-7CFVCINR.js} +2 -2
- package/dist/{gpuPolicy-RZ2OUY4M.js → gpuPolicy-MU7CFSAF.js} +8 -11
- package/dist/{grade-compare-O62JAOA7.js → grade-compare-Q23U2HGS.js} +32 -35
- package/dist/{help-6POZ4GNV.js → help-M67MEDV3.js} +1 -1
- package/dist/{history-72ZIF5WR.js → history-I2PZXOFL.js} +8 -8
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +65 -64
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-GGIFZ5CT.js → info-Z2MX54IE.js} +10 -12
- package/dist/{init-QYRN6HG2.js → init-SWH5KZO2.js} +29 -32
- package/dist/{inspect-KSL4YVIU.js → inspect-WBBDB3YS.js} +32 -35
- package/dist/{installer-ENQCLSJQ.js → installer-DQIHGUBJ.js} +6 -9
- package/dist/{keyframes-6PNLGKOO.js → keyframes-PSNEUS6P.js} +7 -7
- package/dist/{lambda-3RFOOJV6.js → lambda-KSZFMQ3L.js} +9 -11
- package/dist/{layout-3XFC6N3L.js → layout-AAOI7W2M.js} +32 -35
- package/dist/{lint-5XGLCTV5.js → lint-GGNVITIK.js} +9 -11
- package/dist/{lintProject-FKPKSU6M.js → lintProject-Q36Y3AHA.js} +2 -4
- package/dist/{list-B76BTLOM.js → list-OFPDL2AM.js} +2 -2
- package/dist/{login-MNXS7GEL.js → login-MZAHGGP4.js} +4 -4
- package/dist/{manager-BWU4U7DV.js → manager-F34TSFV6.js} +2 -2
- package/dist/{manager-QZZVJV7Z.js → manager-ZOFTZTRY.js} +9 -12
- package/dist/{media-treatment-J3OWRCBF.js → media-treatment-PF67GSUD.js} +66 -42
- package/dist/{models-MCDUTV54.js → models-WR7CL54R.js} +12 -15
- package/dist/{motionShot-RWEH3VWI.js → motionShot-ISLDWLIU.js} +17 -20
- package/dist/{normalize-audio-N7VRZODX.js → normalize-audio-D7AH5GFZ.js} +44 -26
- package/dist/{open-ROUFAVKD.js → open-HPVBB2CX.js} +14 -17
- package/dist/{parakeetRunner-PTVV5M44.js → parakeetRunner-P6PE4WXG.js} +13 -16
- package/dist/{pipeline-HN5KMORF.js → pipeline-XKBZG2CM.js} +9 -12
- package/dist/{play-AO7AF4Y4.js → play-QXHO47ZH.js} +23 -26
- package/dist/{preflight-ARNDDFGX.js → preflight-KZCU66ES.js} +11 -14
- package/dist/{present-FBPKUC5R.js → present-ERGC5PR4.js} +19 -22
- package/dist/{preview-35X5G426.js → preview-AGTOQIE7.js} +20 -23
- package/dist/{producer-FVGPLR5E.js → producer-4ONVM5A2.js} +1 -1
- package/dist/{projectConfig-SRUJLOHL.js → projectConfig-7T4VY6RJ.js} +8 -11
- package/dist/{publication-XH2BRL3V.js → publication-J5TS5VR3.js} +4 -6
- package/dist/{publish-RI4ZQZNT.js → publish-BSOVXRF4.js} +11 -14
- package/dist/{remove-background-J22P5JFW.js → remove-background-645NVCGL.js} +10 -13
- package/dist/{render-UXYZN6D2.js → render-55TYPJ5U.js} +7 -9
- package/dist/{render-2EZQT4IS.js → render-IAVH33YG.js} +37 -33
- package/dist/{render-IJUKJILU.js → render-R3L44QAP.js} +34 -37
- package/dist/{render-batch-X34UZ442.js → render-batch-JWWLQ7ZC.js} +7 -9
- package/dist/renderSetupWorker.js +4 -6
- package/dist/{resolver-UUEIRLMY.js → resolver-DBAFWC4F.js} +6 -8
- package/dist/{sherpa-FI4VNAFT.js → sherpa-UPWG6TKY.js} +12 -15
- package/dist/skills/hyperframes/references/runtimes.md +26 -0
- package/dist/skills/media-use/references/mixing.md +1 -1
- package/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +38 -26
- package/dist/{skills-LGKXQFW7.js → skills-ILH52UL4.js} +6 -6
- package/dist/{skillsUpdateCheck-NDPKSX3H.js → skillsUpdateCheck-ZHFDGMEL.js} +3 -3
- package/dist/{snapshot-JM6427YW.js → snapshot-WMVHIQVQ.js} +93 -60
- package/dist/{src-26NBARTO.js → src-46QTOHZE.js} +10 -13
- package/dist/{src-WEECPY6E.js → src-HPLELQRK.js} +11 -10
- package/dist/{staticProjectServer-I5WGMJOV.js → staticProjectServer-FHP2YQFV.js} +19 -22
- package/dist/{status-SCCC7A6N.js → status-LR7VXITS.js} +1 -1
- package/dist/studio/assets/{hyperframes-player-LmRUJE8q.js → hyperframes-player-BNeO6YSP.js} +1 -1
- package/dist/studio/assets/{index-BmTWk8xf.js → index-CZWE0FI8.js} +162 -162
- package/dist/studio/assets/{index-CKNiEwbW.js → index-DiNYtcMK.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-N774Q4NO.js → studio-api-5YHQ4Y2D.js} +12 -15
- package/dist/{studioServer-KZIM5UBJ.js → studioServer-P6IC76SV.js} +53 -56
- package/dist/{system-HV7PYIXE.js → system-YD4AW5ZX.js} +1 -1
- package/dist/{telemetry-JIETM7WP.js → telemetry-WZ7OGFWQ.js} +4 -4
- package/dist/{timeline-JJ6JG7GQ.js → timeline-U6S7BGMI.js} +23 -25
- package/dist/{tokens-VOIMSCGX.js → tokens-FPUYNZSV.js} +2 -2
- package/dist/{transcribe-2V23EQHD.js → transcribe-DJX4E2PE.js} +18 -21
- package/dist/{transcribe-7BDHDQVP.js → transcribe-DZHTKXI5.js} +11 -14
- package/dist/{updateCheck-7B7L3UWO.js → updateCheck-2LHWRDE7.js} +2 -2
- package/dist/{upgrade-TUA2QZTY.js → upgrade-WAQHCAUS.js} +2 -2
- package/dist/{urlDownloader-CGV6EYL7.js → urlDownloader-HZQPXQET.js} +7 -10
- package/dist/{validate-JLCXEI2U.js → validate-D6XJ7OSS.js} +26 -29
- package/dist/{video-TI3EOA2D.js → video-A4CQ4WDL.js} +8 -11
- package/dist/warmCheck.js +39 -42
- package/package.json +1 -1
- package/dist/chunk-BSQ7XANM.js +0 -210
- package/dist/chunk-PKZ7RK5N.js +0 -281
- package/dist/chunk-PW22CDII.js +0 -3901
- package/dist/chunk-X7HBSTCZ.js +0 -53
|
@@ -4,6 +4,9 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
simple
|
|
9
|
+
} from "./chunk-RXATE6FZ.js";
|
|
7
10
|
|
|
8
11
|
// ../parsers/dist/compositionContract.js
|
|
9
12
|
var COMPOSITION_CONTRACT_VERSION = 1;
|
|
@@ -287,6 +290,185 @@ function writeClipTiming(attributes, update) {
|
|
|
287
290
|
return readClipTiming(attributes);
|
|
288
291
|
}
|
|
289
292
|
|
|
293
|
+
// ../parsers/dist/mediaDuration.js
|
|
294
|
+
var COMPOSITION_ATTRIBUTES2 = Object.freeze({
|
|
295
|
+
start: "data-start",
|
|
296
|
+
duration: "data-duration",
|
|
297
|
+
trackIndex: "data-track-index",
|
|
298
|
+
derivedEnd: "data-end",
|
|
299
|
+
legacyTrack: "data-layer"
|
|
300
|
+
});
|
|
301
|
+
var CANONICAL_AUTHORED_TIMING_ATTRIBUTES2 = Object.freeze([
|
|
302
|
+
COMPOSITION_ATTRIBUTES2.start,
|
|
303
|
+
COMPOSITION_ATTRIBUTES2.duration,
|
|
304
|
+
COMPOSITION_ATTRIBUTES2.trackIndex
|
|
305
|
+
]);
|
|
306
|
+
var DERIVED_TIMING_ATTRIBUTES2 = Object.freeze([
|
|
307
|
+
COMPOSITION_ATTRIBUTES2.derivedEnd
|
|
308
|
+
]);
|
|
309
|
+
var LEGACY_TIMING_ATTRIBUTES2 = Object.freeze([
|
|
310
|
+
COMPOSITION_ATTRIBUTES2.derivedEnd,
|
|
311
|
+
COMPOSITION_ATTRIBUTES2.legacyTrack
|
|
312
|
+
]);
|
|
313
|
+
function parseNumeric2(value) {
|
|
314
|
+
if (value == null || value.trim() === "") return null;
|
|
315
|
+
const parsed = Number(value);
|
|
316
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
317
|
+
}
|
|
318
|
+
var nonNegative = (raw) => {
|
|
319
|
+
const value = parseNumeric2(raw);
|
|
320
|
+
return value !== null && value >= 0 ? value : null;
|
|
321
|
+
};
|
|
322
|
+
function readMediaOffsetSeconds(getAttr) {
|
|
323
|
+
return nonNegative(getAttr("data-playback-start")) ?? nonNegative(getAttr("data-media-start")) ?? 0;
|
|
324
|
+
}
|
|
325
|
+
var MIN_PLAYBACK_RATE = 0.1;
|
|
326
|
+
var MAX_PLAYBACK_RATE = 10;
|
|
327
|
+
function clampPlaybackRate(raw) {
|
|
328
|
+
return Number.isFinite(raw) && raw > 0 ? Math.max(MIN_PLAYBACK_RATE, Math.min(MAX_PLAYBACK_RATE, raw)) : 1;
|
|
329
|
+
}
|
|
330
|
+
function readPlaybackRate(getAttr, fallback = 1) {
|
|
331
|
+
const authored = Number.parseFloat(getAttr("data-playback-rate") ?? "");
|
|
332
|
+
return clampPlaybackRate(Number.isFinite(authored) && authored > 0 ? authored : fallback);
|
|
333
|
+
}
|
|
334
|
+
function readDataDurationSeconds(getAttr) {
|
|
335
|
+
const duration = parseNumeric2(getAttr("data-duration"));
|
|
336
|
+
return duration !== null && duration > 0 ? duration : null;
|
|
337
|
+
}
|
|
338
|
+
function readAuthoredDurationSeconds(getAttr, startSeconds) {
|
|
339
|
+
const duration = readDataDurationSeconds(getAttr);
|
|
340
|
+
if (duration !== null) return duration;
|
|
341
|
+
const end = parseNumeric2(getAttr("data-end"));
|
|
342
|
+
return end !== null ? end - startSeconds : null;
|
|
343
|
+
}
|
|
344
|
+
var DEFAULT_IMAGE_TIMELINE_DURATION_SECONDS = 3;
|
|
345
|
+
function resolveNaturalDurationSeconds(sourceDurationSeconds, mediaStartSeconds, playbackRate) {
|
|
346
|
+
if (!Number.isFinite(sourceDurationSeconds)) return null;
|
|
347
|
+
const remaining = Math.max(0, sourceDurationSeconds - mediaStartSeconds);
|
|
348
|
+
return remaining / clampPlaybackRate(playbackRate);
|
|
349
|
+
}
|
|
350
|
+
function resolveMediaDuration(input) {
|
|
351
|
+
const { tag, authoredDurationSeconds, sourceDurationSeconds, mediaStartSeconds, playbackRate } = input;
|
|
352
|
+
if (authoredDurationSeconds !== null && authoredDurationSeconds > 0) {
|
|
353
|
+
return { seconds: authoredDurationSeconds, source: "authored" };
|
|
354
|
+
}
|
|
355
|
+
if (tag === "img") {
|
|
356
|
+
return { seconds: DEFAULT_IMAGE_TIMELINE_DURATION_SECONDS, source: "default" };
|
|
357
|
+
}
|
|
358
|
+
if (sourceDurationSeconds === null) {
|
|
359
|
+
return { seconds: null, source: "pending", reason: "source duration not yet probed" };
|
|
360
|
+
}
|
|
361
|
+
const seconds = resolveNaturalDurationSeconds(
|
|
362
|
+
sourceDurationSeconds,
|
|
363
|
+
mediaStartSeconds,
|
|
364
|
+
playbackRate
|
|
365
|
+
);
|
|
366
|
+
if (seconds === null) {
|
|
367
|
+
return { seconds: null, source: "pending", reason: "source reported a non-finite duration" };
|
|
368
|
+
}
|
|
369
|
+
return { seconds, source: "media" };
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
// ../parsers/dist/assets.js
|
|
373
|
+
import { isAbsolute, relative, resolve } from "path";
|
|
374
|
+
import { posix } from "path";
|
|
375
|
+
function decodeWellFormedEscapes(path) {
|
|
376
|
+
return path.replace(/(?:%[0-9A-Fa-f]{2})+/g, (run) => {
|
|
377
|
+
try {
|
|
378
|
+
return decodeURIComponent(run);
|
|
379
|
+
} catch {
|
|
380
|
+
return run;
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function splitUrlSuffix(urlValue) {
|
|
385
|
+
const queryIdx = urlValue.indexOf("?");
|
|
386
|
+
const hashIdx = urlValue.indexOf("#");
|
|
387
|
+
if (queryIdx < 0 && hashIdx < 0) return { basePath: urlValue, suffix: "" };
|
|
388
|
+
let cutIdx = urlValue.length;
|
|
389
|
+
if (queryIdx >= 0) cutIdx = Math.min(cutIdx, queryIdx);
|
|
390
|
+
if (hashIdx >= 0) cutIdx = Math.min(cutIdx, hashIdx);
|
|
391
|
+
return { basePath: urlValue.slice(0, cutIdx), suffix: urlValue.slice(cutIdx) };
|
|
392
|
+
}
|
|
393
|
+
function decodedUrlPath(url) {
|
|
394
|
+
return decodeWellFormedEscapes(splitUrlSuffix(url).basePath);
|
|
395
|
+
}
|
|
396
|
+
function encodeUrlPath(path) {
|
|
397
|
+
return encodeURIComponent(path).replace(/%2F/g, "/").replace(/['()]/g, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
398
|
+
}
|
|
399
|
+
function decodeCssEscapes(text) {
|
|
400
|
+
return text.replaceAll("\0", "\uFFFD").replace(
|
|
401
|
+
/\\(?:([0-9a-f]{1,6})(?:\r\n|[ \t\r\n\f])?|(\r\n|[\n\r\f])|([\s\S]))/gi,
|
|
402
|
+
(_escaped, hex, lineBreak, char) => {
|
|
403
|
+
if (hex === void 0) return lineBreak === void 0 ? char : "";
|
|
404
|
+
const code = Number.parseInt(hex, 16);
|
|
405
|
+
if (code === 0 || code > 1114111 || code >= 55296 && code <= 57343) return "\uFFFD";
|
|
406
|
+
return String.fromCodePoint(code);
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
}
|
|
410
|
+
var CSS_URL_RE = /\burl\(\s*(["']?)([^)"'\s](?:[^)"']*[^)"'\s])?)\1\s*\)/g;
|
|
411
|
+
var PATH_ATTRS = ["src", "href"];
|
|
412
|
+
function isNonRelativeUrl(val) {
|
|
413
|
+
return !val || val.startsWith("http://") || val.startsWith("https://") || val.startsWith("//") || val.startsWith("data:") || val.startsWith("#") || val.startsWith("/");
|
|
414
|
+
}
|
|
415
|
+
function isPathInside(childPath, parentPath) {
|
|
416
|
+
const absChild = resolve(childPath);
|
|
417
|
+
const absParent = resolve(parentPath);
|
|
418
|
+
if (absChild === absParent) return true;
|
|
419
|
+
const rel = relative(absParent, absChild);
|
|
420
|
+
return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
|
|
421
|
+
}
|
|
422
|
+
var { join, resolve: resolve2, dirname } = posix;
|
|
423
|
+
var isAbsoluteOrSpecial = isNonRelativeUrl;
|
|
424
|
+
function needsRewrite(val) {
|
|
425
|
+
return val.startsWith("../") || val === "..";
|
|
426
|
+
}
|
|
427
|
+
function rewriteAssetPath(compSrcPath, relativePath, assetExists) {
|
|
428
|
+
if (isAbsoluteOrSpecial(relativePath)) return relativePath;
|
|
429
|
+
const compDir = dirname(compSrcPath);
|
|
430
|
+
if (!compDir || compDir === ".") return relativePath;
|
|
431
|
+
const { basePath, suffix } = splitUrlSuffix(relativePath);
|
|
432
|
+
const slashed = basePath.replace(/\\/g, "/");
|
|
433
|
+
if (!slashed || slashed.startsWith("/")) return relativePath;
|
|
434
|
+
const filePath = decodeWellFormedEscapes(slashed);
|
|
435
|
+
const sibling = resolve2("/", join(compDir, filePath)).slice(1);
|
|
436
|
+
if (!needsRewrite(filePath) && (!assetExists || !assetExists(sibling))) return relativePath;
|
|
437
|
+
return encodeUrlPath(sibling) + suffix;
|
|
438
|
+
}
|
|
439
|
+
function rewriteAssetPaths(elements, compSrcPath, getAttr, setAttr, assetExists) {
|
|
440
|
+
for (const el of elements) {
|
|
441
|
+
for (const attr of PATH_ATTRS) {
|
|
442
|
+
const val = (getAttr(el, attr) || "").trim();
|
|
443
|
+
const rewritten = rewriteAssetPath(compSrcPath, val, assetExists);
|
|
444
|
+
if (rewritten !== val) {
|
|
445
|
+
setAttr(el, attr, rewritten);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function rewriteInlineStyleAssetUrls(elements, compSrcPath, getStyle, setStyle, assetExists) {
|
|
451
|
+
const compDir = dirname(compSrcPath);
|
|
452
|
+
if (!compDir || compDir === ".") return;
|
|
453
|
+
for (const el of elements) {
|
|
454
|
+
const style = getStyle(el);
|
|
455
|
+
if (!style) continue;
|
|
456
|
+
const rewritten = rewriteCssAssetUrls(style, compSrcPath, assetExists);
|
|
457
|
+
if (rewritten !== style) {
|
|
458
|
+
setStyle(el, rewritten);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function rewriteCssAssetUrls(cssText, compSrcPath, assetExists) {
|
|
463
|
+
if (!cssText) return cssText;
|
|
464
|
+
return cssText.replace(CSS_URL_RE, (full, quote, rawUrl) => {
|
|
465
|
+
const urlValue = (rawUrl || "").trim();
|
|
466
|
+
const rewritten = rewriteAssetPath(compSrcPath, urlValue, assetExists);
|
|
467
|
+
if (rewritten === urlValue) return full;
|
|
468
|
+
return `url(${quote || ""}${rewritten}${quote || ""})`;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
|
|
290
472
|
// ../parsers/dist/subCompositionValidity.js
|
|
291
473
|
function resolveSubCompositionContent(html, document) {
|
|
292
474
|
const template = document.querySelector("template");
|
|
@@ -831,36 +1013,36 @@ function validateColorGradingContract(value) {
|
|
|
831
1013
|
}
|
|
832
1014
|
|
|
833
1015
|
// ../parsers/dist/mediaTiming.js
|
|
834
|
-
var
|
|
1016
|
+
var COMPOSITION_ATTRIBUTES3 = Object.freeze({
|
|
835
1017
|
start: "data-start",
|
|
836
1018
|
duration: "data-duration",
|
|
837
1019
|
trackIndex: "data-track-index",
|
|
838
1020
|
derivedEnd: "data-end",
|
|
839
1021
|
legacyTrack: "data-layer"
|
|
840
1022
|
});
|
|
841
|
-
var
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
1023
|
+
var CANONICAL_AUTHORED_TIMING_ATTRIBUTES3 = Object.freeze([
|
|
1024
|
+
COMPOSITION_ATTRIBUTES3.start,
|
|
1025
|
+
COMPOSITION_ATTRIBUTES3.duration,
|
|
1026
|
+
COMPOSITION_ATTRIBUTES3.trackIndex
|
|
845
1027
|
]);
|
|
846
|
-
var
|
|
847
|
-
|
|
1028
|
+
var DERIVED_TIMING_ATTRIBUTES3 = Object.freeze([
|
|
1029
|
+
COMPOSITION_ATTRIBUTES3.derivedEnd
|
|
848
1030
|
]);
|
|
849
|
-
var
|
|
850
|
-
|
|
851
|
-
|
|
1031
|
+
var LEGACY_TIMING_ATTRIBUTES3 = Object.freeze([
|
|
1032
|
+
COMPOSITION_ATTRIBUTES3.derivedEnd,
|
|
1033
|
+
COMPOSITION_ATTRIBUTES3.legacyTrack
|
|
852
1034
|
]);
|
|
853
|
-
function
|
|
1035
|
+
function parseNumeric3(value) {
|
|
854
1036
|
if (value == null || value.trim() === "") return null;
|
|
855
1037
|
const parsed = Number(value);
|
|
856
1038
|
return Number.isFinite(parsed) ? parsed : null;
|
|
857
1039
|
}
|
|
858
|
-
var
|
|
859
|
-
const value =
|
|
1040
|
+
var nonNegative2 = (raw) => {
|
|
1041
|
+
const value = parseNumeric3(raw);
|
|
860
1042
|
return value !== null && value >= 0 ? value : null;
|
|
861
1043
|
};
|
|
862
|
-
function
|
|
863
|
-
return
|
|
1044
|
+
function readMediaOffsetSeconds2(getAttr) {
|
|
1045
|
+
return nonNegative2(getAttr("data-playback-start")) ?? nonNegative2(getAttr("data-media-start")) ?? 0;
|
|
864
1046
|
}
|
|
865
1047
|
var MEDIA_START_BASIS_ATTR = "data-hf-media-start-basis";
|
|
866
1048
|
function readMediaStartBasis(value) {
|
|
@@ -884,7 +1066,7 @@ function hasLiteralNestedStart(input) {
|
|
|
884
1066
|
return !input.hasAutoStart && input.authoredStart != null && input.hostStart !== 0;
|
|
885
1067
|
}
|
|
886
1068
|
function hostInPointSeconds(host) {
|
|
887
|
-
return
|
|
1069
|
+
return readMediaOffsetSeconds2((name) => host.getAttribute(name));
|
|
888
1070
|
}
|
|
889
1071
|
function compositionOriginSeconds(hostStart, host) {
|
|
890
1072
|
return hostStart - hostInPointSeconds(host);
|
|
@@ -911,6 +1093,274 @@ function spansShareTime(aStart, aEnd, bStart, bEnd) {
|
|
|
911
1093
|
}
|
|
912
1094
|
var isInsideSpan = (time, start, end) => isBefore(start, time) && isBefore(time, end);
|
|
913
1095
|
|
|
1096
|
+
// ../parsers/dist/composition.js
|
|
1097
|
+
import * as acorn from "acorn";
|
|
1098
|
+
import * as acorn2 from "acorn";
|
|
1099
|
+
var CANVAS_DIMENSIONS = {
|
|
1100
|
+
landscape: { width: 1920, height: 1080 },
|
|
1101
|
+
portrait: { width: 1080, height: 1920 },
|
|
1102
|
+
"landscape-4k": { width: 3840, height: 2160 },
|
|
1103
|
+
"portrait-4k": { width: 2160, height: 3840 },
|
|
1104
|
+
square: { width: 1080, height: 1080 },
|
|
1105
|
+
"square-4k": { width: 2160, height: 2160 },
|
|
1106
|
+
"landscape-720p": { width: 1280, height: 720 },
|
|
1107
|
+
"portrait-720p": { width: 720, height: 1280 },
|
|
1108
|
+
"square-720p": { width: 720, height: 720 },
|
|
1109
|
+
// 480 tall at 16:9 is 853.33 wide: 854 keeps both sides even for 4:2:0 encoders.
|
|
1110
|
+
"landscape-480p": { width: 854, height: 480 },
|
|
1111
|
+
"portrait-480p": { width: 480, height: 854 },
|
|
1112
|
+
"square-480p": { width: 480, height: 480 }
|
|
1113
|
+
};
|
|
1114
|
+
var VALID_CANVAS_RESOLUTIONS = Object.keys(
|
|
1115
|
+
CANVAS_DIMENSIONS
|
|
1116
|
+
);
|
|
1117
|
+
var COMPOSITION_VARIABLE_TYPES = [
|
|
1118
|
+
"string",
|
|
1119
|
+
"number",
|
|
1120
|
+
"color",
|
|
1121
|
+
"boolean",
|
|
1122
|
+
"enum",
|
|
1123
|
+
"font",
|
|
1124
|
+
"image"
|
|
1125
|
+
];
|
|
1126
|
+
var FONT_ALIAS_MAP = {
|
|
1127
|
+
// ── Canonical bundled fonts (self-referencing) ────────────────────────
|
|
1128
|
+
inter: "inter",
|
|
1129
|
+
montserrat: "montserrat",
|
|
1130
|
+
outfit: "outfit",
|
|
1131
|
+
nunito: "nunito",
|
|
1132
|
+
oswald: "oswald",
|
|
1133
|
+
"league gothic": "league-gothic",
|
|
1134
|
+
"archivo black": "archivo-black",
|
|
1135
|
+
"space mono": "space-mono",
|
|
1136
|
+
"ibm plex mono": "ibm-plex-mono",
|
|
1137
|
+
"jetbrains mono": "jetbrains-mono",
|
|
1138
|
+
"eb garamond": "eb-garamond",
|
|
1139
|
+
"playfair display": "playfair-display",
|
|
1140
|
+
"source code pro": "source-code-pro",
|
|
1141
|
+
"noto sans jp": "noto-sans-jp",
|
|
1142
|
+
roboto: "roboto",
|
|
1143
|
+
"open sans": "open-sans",
|
|
1144
|
+
lato: "lato",
|
|
1145
|
+
poppins: "poppins",
|
|
1146
|
+
// ── Common aliases → nearest canonical ────────────────────────────────
|
|
1147
|
+
"helvetica neue": "inter",
|
|
1148
|
+
helvetica: "inter",
|
|
1149
|
+
arial: "inter",
|
|
1150
|
+
"helvetica bold": "inter",
|
|
1151
|
+
futura: "montserrat",
|
|
1152
|
+
"din alternate": "montserrat",
|
|
1153
|
+
"arial black": "montserrat",
|
|
1154
|
+
"bebas neue": "league-gothic",
|
|
1155
|
+
"courier new": "jetbrains-mono",
|
|
1156
|
+
courier: "jetbrains-mono",
|
|
1157
|
+
garamond: "eb-garamond",
|
|
1158
|
+
"noto sans japanese": "noto-sans-jp",
|
|
1159
|
+
"segoe ui": "roboto",
|
|
1160
|
+
// ── macOS sans-serif system fonts → inter ─────────────────────────────
|
|
1161
|
+
"sf pro": "inter",
|
|
1162
|
+
"sf pro display": "inter",
|
|
1163
|
+
"sf pro text": "inter",
|
|
1164
|
+
"sf pro rounded": "inter",
|
|
1165
|
+
avenir: "inter",
|
|
1166
|
+
"avenir next": "inter",
|
|
1167
|
+
"lucida grande": "inter",
|
|
1168
|
+
geneva: "inter",
|
|
1169
|
+
optima: "inter",
|
|
1170
|
+
// ── Windows sans-serif system fonts → inter ───────────────────────────
|
|
1171
|
+
verdana: "inter",
|
|
1172
|
+
tahoma: "inter",
|
|
1173
|
+
"trebuchet ms": "inter",
|
|
1174
|
+
calibri: "inter",
|
|
1175
|
+
candara: "inter",
|
|
1176
|
+
corbel: "inter",
|
|
1177
|
+
"lucida sans": "inter",
|
|
1178
|
+
"lucida sans unicode": "inter",
|
|
1179
|
+
// ── Linux sans-serif system fonts → inter ─────────────────────────────
|
|
1180
|
+
"noto sans": "inter",
|
|
1181
|
+
"dejavu sans": "inter",
|
|
1182
|
+
"liberation sans": "inter",
|
|
1183
|
+
// ── Monospace system fonts → jetbrains-mono ───────────────────────────
|
|
1184
|
+
"sf mono": "jetbrains-mono",
|
|
1185
|
+
menlo: "jetbrains-mono",
|
|
1186
|
+
monaco: "jetbrains-mono",
|
|
1187
|
+
consolas: "jetbrains-mono",
|
|
1188
|
+
"lucida console": "jetbrains-mono",
|
|
1189
|
+
"lucida sans typewriter": "jetbrains-mono",
|
|
1190
|
+
"andale mono": "jetbrains-mono",
|
|
1191
|
+
"dejavu sans mono": "jetbrains-mono",
|
|
1192
|
+
"liberation mono": "jetbrains-mono",
|
|
1193
|
+
// ── Serif system fonts → eb-garamond ──────────────────────────────────
|
|
1194
|
+
georgia: "eb-garamond",
|
|
1195
|
+
palatino: "eb-garamond",
|
|
1196
|
+
"palatino linotype": "eb-garamond",
|
|
1197
|
+
"book antiqua": "eb-garamond",
|
|
1198
|
+
cambria: "eb-garamond",
|
|
1199
|
+
times: "eb-garamond",
|
|
1200
|
+
"times new roman": "eb-garamond",
|
|
1201
|
+
"dejavu serif": "eb-garamond",
|
|
1202
|
+
"liberation serif": "eb-garamond"
|
|
1203
|
+
};
|
|
1204
|
+
var FONT_ALIAS_KEYS = new Set(Object.keys(FONT_ALIAS_MAP));
|
|
1205
|
+
var CANONICAL_FONT_DISPLAY_NAMES = {
|
|
1206
|
+
inter: "Inter",
|
|
1207
|
+
montserrat: "Montserrat",
|
|
1208
|
+
outfit: "Outfit",
|
|
1209
|
+
nunito: "Nunito",
|
|
1210
|
+
oswald: "Oswald",
|
|
1211
|
+
"league-gothic": "League Gothic",
|
|
1212
|
+
"archivo-black": "Archivo Black",
|
|
1213
|
+
"space-mono": "Space Mono",
|
|
1214
|
+
"ibm-plex-mono": "IBM Plex Mono",
|
|
1215
|
+
"jetbrains-mono": "JetBrains Mono",
|
|
1216
|
+
"eb-garamond": "EB Garamond",
|
|
1217
|
+
"playfair-display": "Playfair Display",
|
|
1218
|
+
"source-code-pro": "Source Code Pro",
|
|
1219
|
+
"noto-sans-jp": "Noto Sans JP",
|
|
1220
|
+
roboto: "Roboto",
|
|
1221
|
+
"open-sans": "Open Sans",
|
|
1222
|
+
lato: "Lato",
|
|
1223
|
+
poppins: "Poppins"
|
|
1224
|
+
};
|
|
1225
|
+
function resolveAliasDisplayName(alias) {
|
|
1226
|
+
const slug = FONT_ALIAS_MAP[alias.toLowerCase()];
|
|
1227
|
+
if (!slug) return void 0;
|
|
1228
|
+
return CANONICAL_FONT_DISPLAY_NAMES[slug];
|
|
1229
|
+
}
|
|
1230
|
+
var DEFAULT_TYPEOF = {
|
|
1231
|
+
string: "string",
|
|
1232
|
+
number: "number",
|
|
1233
|
+
color: "string",
|
|
1234
|
+
boolean: "boolean",
|
|
1235
|
+
enum: "string",
|
|
1236
|
+
font: "string",
|
|
1237
|
+
image: "string"
|
|
1238
|
+
};
|
|
1239
|
+
function isRecord2(v) {
|
|
1240
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
1241
|
+
}
|
|
1242
|
+
function isFontValue(value) {
|
|
1243
|
+
return isRecord2(value) && typeof value.name === "string" && typeof value.source === "string";
|
|
1244
|
+
}
|
|
1245
|
+
function isImageValue(value) {
|
|
1246
|
+
return isRecord2(value) && typeof value.url === "string" && (value.alt === void 0 || typeof value.alt === "string") && (value.fit === void 0 || value.fit === "cover" || value.fit === "contain" || value.fit === "fill" || value.fit === "none" || value.fit === "scale-down");
|
|
1247
|
+
}
|
|
1248
|
+
function isVariableType(t) {
|
|
1249
|
+
return typeof t === "string" && t in DEFAULT_TYPEOF;
|
|
1250
|
+
}
|
|
1251
|
+
function isCompositionVariable(v) {
|
|
1252
|
+
if (!isRecord2(v)) return false;
|
|
1253
|
+
if (typeof v.id !== "string" || typeof v.label !== "string") return false;
|
|
1254
|
+
if (!isVariableType(v.type)) return false;
|
|
1255
|
+
if (v.type === "font") return typeof v.default === "string" || isFontValue(v.default);
|
|
1256
|
+
if (v.type === "image") return typeof v.default === "string" || isImageValue(v.default);
|
|
1257
|
+
if (typeof v.default !== DEFAULT_TYPEOF[v.type]) return false;
|
|
1258
|
+
if (v.type === "enum" && !Array.isArray(v.options)) return false;
|
|
1259
|
+
return true;
|
|
1260
|
+
}
|
|
1261
|
+
function isSafeMediaUrl(url) {
|
|
1262
|
+
const normalized = url.replace(/[\u0000-\u0020]/g, "");
|
|
1263
|
+
const scheme = /^([a-z][a-z0-9+.-]*):/i.exec(normalized);
|
|
1264
|
+
if (!scheme) return true;
|
|
1265
|
+
const proto = scheme[1]?.toLowerCase();
|
|
1266
|
+
if (!proto) return false;
|
|
1267
|
+
if (proto === "https" || proto === "http" || proto === "blob") return true;
|
|
1268
|
+
if (proto === "data") return /^data:image\//i.test(normalized);
|
|
1269
|
+
return false;
|
|
1270
|
+
}
|
|
1271
|
+
var COMPOSITION_ATTRIBUTES4 = Object.freeze({
|
|
1272
|
+
start: "data-start",
|
|
1273
|
+
duration: "data-duration",
|
|
1274
|
+
trackIndex: "data-track-index",
|
|
1275
|
+
derivedEnd: "data-end",
|
|
1276
|
+
legacyTrack: "data-layer"
|
|
1277
|
+
});
|
|
1278
|
+
var CANONICAL_AUTHORED_TIMING_ATTRIBUTES4 = Object.freeze([
|
|
1279
|
+
COMPOSITION_ATTRIBUTES4.start,
|
|
1280
|
+
COMPOSITION_ATTRIBUTES4.duration,
|
|
1281
|
+
COMPOSITION_ATTRIBUTES4.trackIndex
|
|
1282
|
+
]);
|
|
1283
|
+
var DERIVED_TIMING_ATTRIBUTES4 = Object.freeze([
|
|
1284
|
+
COMPOSITION_ATTRIBUTES4.derivedEnd
|
|
1285
|
+
]);
|
|
1286
|
+
var LEGACY_TIMING_ATTRIBUTES4 = Object.freeze([
|
|
1287
|
+
COMPOSITION_ATTRIBUTES4.derivedEnd,
|
|
1288
|
+
COMPOSITION_ATTRIBUTES4.legacyTrack
|
|
1289
|
+
]);
|
|
1290
|
+
var HTML_BODY_CSS_WIDTH_FIRST_RE = /(html\s*,\s*body\s*\{[^}]*?width:\s*)(\d+)px([^}]*?height:\s*)(\d+)px/i;
|
|
1291
|
+
var HTML_BODY_CSS_HEIGHT_FIRST_RE = /(html\s*,\s*body\s*\{[^}]*?height:\s*)(\d+)px([^}]*?width:\s*)(\d+)px/i;
|
|
1292
|
+
var VIEWPORT_META_SIZE_RE = /(<meta[^>]*name=["']viewport["'][^>]*content=["']width=)(\d+)(,\s*height=)(\d+)/i;
|
|
1293
|
+
function parseProgram(script) {
|
|
1294
|
+
try {
|
|
1295
|
+
return acorn2.parse(script, { ecmaVersion: "latest", sourceType: "script" });
|
|
1296
|
+
} catch {
|
|
1297
|
+
return acorn2.parse(script, { ecmaVersion: "latest", sourceType: "module" });
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
function literalString(node) {
|
|
1301
|
+
if (node?.type === "Literal" && typeof node.value === "string") return node.value;
|
|
1302
|
+
if (node?.type === "TemplateLiteral" && node.expressions?.length === 0) {
|
|
1303
|
+
return node.quasis?.[0]?.value?.cooked;
|
|
1304
|
+
}
|
|
1305
|
+
return void 0;
|
|
1306
|
+
}
|
|
1307
|
+
function memberName(node) {
|
|
1308
|
+
if (node?.type !== "MemberExpression") return void 0;
|
|
1309
|
+
if (!node.computed && node.property?.type === "Identifier") return node.property.name;
|
|
1310
|
+
return literalString(node.property);
|
|
1311
|
+
}
|
|
1312
|
+
function lookupSelector(node, bindings) {
|
|
1313
|
+
if (node?.type === "Identifier") return bindings.get(node.name);
|
|
1314
|
+
if (node?.type !== "CallExpression" || node.callee?.type !== "MemberExpression") {
|
|
1315
|
+
return void 0;
|
|
1316
|
+
}
|
|
1317
|
+
const method = memberName(node.callee);
|
|
1318
|
+
if (method !== "getElementById" && method !== "querySelector") return void 0;
|
|
1319
|
+
const value = literalString(node.arguments?.[0]);
|
|
1320
|
+
if (!value) return void 0;
|
|
1321
|
+
return method === "getElementById" ? `#${value}` : value;
|
|
1322
|
+
}
|
|
1323
|
+
function extractMediaSrcMutations(script) {
|
|
1324
|
+
try {
|
|
1325
|
+
const ast = parseProgram(script);
|
|
1326
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
1327
|
+
simple(ast, {
|
|
1328
|
+
VariableDeclarator(node) {
|
|
1329
|
+
if (node.id?.type !== "Identifier") return;
|
|
1330
|
+
const selector = lookupSelector(node.init, bindings);
|
|
1331
|
+
if (selector) bindings.set(node.id.name, selector);
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
const mutations = [];
|
|
1335
|
+
simple(ast, {
|
|
1336
|
+
AssignmentExpression(node) {
|
|
1337
|
+
if (node.operator !== "=" || memberName(node.left) !== "src") return;
|
|
1338
|
+
const selector = lookupSelector(node.left.object, bindings);
|
|
1339
|
+
if (!selector) return;
|
|
1340
|
+
mutations.push({
|
|
1341
|
+
selector,
|
|
1342
|
+
operation: "src_assignment",
|
|
1343
|
+
raw: script.slice(node.start, node.end)
|
|
1344
|
+
});
|
|
1345
|
+
},
|
|
1346
|
+
CallExpression(node) {
|
|
1347
|
+
if (memberName(node.callee) !== "setAttribute") return;
|
|
1348
|
+
if (literalString(node.arguments?.[0])?.toLowerCase() !== "src") return;
|
|
1349
|
+
const selector = lookupSelector(node.callee.object, bindings);
|
|
1350
|
+
if (!selector) return;
|
|
1351
|
+
mutations.push({
|
|
1352
|
+
selector,
|
|
1353
|
+
operation: "set_attribute",
|
|
1354
|
+
raw: script.slice(node.start, node.end)
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1358
|
+
return mutations;
|
|
1359
|
+
} catch {
|
|
1360
|
+
return [];
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
|
|
914
1364
|
export {
|
|
915
1365
|
COMPOSITION_CONTRACT_VERSION,
|
|
916
1366
|
COMPOSITION_ATTRIBUTES,
|
|
@@ -922,6 +1372,28 @@ export {
|
|
|
922
1372
|
parseStartExpression,
|
|
923
1373
|
readClipTiming,
|
|
924
1374
|
writeClipTiming,
|
|
1375
|
+
readMediaOffsetSeconds,
|
|
1376
|
+
MIN_PLAYBACK_RATE,
|
|
1377
|
+
MAX_PLAYBACK_RATE,
|
|
1378
|
+
clampPlaybackRate,
|
|
1379
|
+
readPlaybackRate,
|
|
1380
|
+
readDataDurationSeconds,
|
|
1381
|
+
readAuthoredDurationSeconds,
|
|
1382
|
+
resolveNaturalDurationSeconds,
|
|
1383
|
+
resolveMediaDuration,
|
|
1384
|
+
decodeWellFormedEscapes,
|
|
1385
|
+
splitUrlSuffix,
|
|
1386
|
+
decodedUrlPath,
|
|
1387
|
+
encodeUrlPath,
|
|
1388
|
+
decodeCssEscapes,
|
|
1389
|
+
CSS_URL_RE,
|
|
1390
|
+
PATH_ATTRS,
|
|
1391
|
+
isNonRelativeUrl,
|
|
1392
|
+
isPathInside,
|
|
1393
|
+
rewriteAssetPath,
|
|
1394
|
+
rewriteAssetPaths,
|
|
1395
|
+
rewriteInlineStyleAssetUrls,
|
|
1396
|
+
rewriteCssAssetUrls,
|
|
925
1397
|
resolveSubCompositionContent,
|
|
926
1398
|
checkSubCompositionUsability,
|
|
927
1399
|
COLOR_GRADING_CONTRACT_VERSION,
|
|
@@ -952,5 +1424,16 @@ export {
|
|
|
952
1424
|
sameInstant,
|
|
953
1425
|
spansOverlap,
|
|
954
1426
|
spansShareTime,
|
|
955
|
-
isInsideSpan
|
|
1427
|
+
isInsideSpan,
|
|
1428
|
+
COMPOSITION_VARIABLE_TYPES,
|
|
1429
|
+
FONT_ALIAS_KEYS,
|
|
1430
|
+
resolveAliasDisplayName,
|
|
1431
|
+
isFontValue,
|
|
1432
|
+
isImageValue,
|
|
1433
|
+
isCompositionVariable,
|
|
1434
|
+
isSafeMediaUrl,
|
|
1435
|
+
HTML_BODY_CSS_WIDTH_FIRST_RE,
|
|
1436
|
+
HTML_BODY_CSS_HEIGHT_FIRST_RE,
|
|
1437
|
+
VIEWPORT_META_SIZE_RE,
|
|
1438
|
+
extractMediaSrcMutations
|
|
956
1439
|
};
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
} from "./chunk-2ST4WAFY.js";
|
|
13
13
|
import {
|
|
14
14
|
createProjectConfig
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UOSTDTBF.js";
|
|
16
16
|
import {
|
|
17
17
|
isHyperframesProject
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-74UH2KGI.js";
|
|
19
19
|
|
|
20
20
|
// src/utils/desktopApp.ts
|
|
21
21
|
import { spawn, spawnSync } from "child_process";
|
|
@@ -6,33 +6,31 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
relinkSplitHalves
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-IXXVS2Z4.js";
|
|
10
10
|
import {
|
|
11
11
|
isAllowedHtmlAttribute,
|
|
12
12
|
isSafeAttributeValue,
|
|
13
13
|
sanitizeRichTextChildren
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-74UH2KGI.js";
|
|
15
15
|
import {
|
|
16
16
|
EXCLUDED_TAGS,
|
|
17
17
|
ensureHfIds,
|
|
18
18
|
mintHfId,
|
|
19
19
|
walkCompositionDescendants
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-SEAHCCQ4.js";
|
|
21
21
|
import {
|
|
22
22
|
decodedUrlPath,
|
|
23
23
|
removeElementWithGsapCascade
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-MSGWR7WP.js";
|
|
25
25
|
import {
|
|
26
26
|
require_dist
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CV32PRH3.js";
|
|
28
28
|
import {
|
|
29
29
|
readClipTiming,
|
|
30
|
-
writeClipTiming
|
|
31
|
-
} from "./chunk-MMQ52NIZ.js";
|
|
32
|
-
import {
|
|
33
30
|
readMediaOffsetSeconds,
|
|
34
|
-
readPlaybackRate
|
|
35
|
-
|
|
31
|
+
readPlaybackRate,
|
|
32
|
+
writeClipTiming
|
|
33
|
+
} from "./chunk-2BGOB2QK.js";
|
|
36
34
|
import {
|
|
37
35
|
parseHTML
|
|
38
36
|
} from "./chunk-SDYDNHEE.js";
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
formatVariableValidationIssue,
|
|
21
21
|
validateVariables
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-74UH2KGI.js";
|
|
23
23
|
import {
|
|
24
24
|
extractCompositionMetadata
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-MSGWR7WP.js";
|
|
26
26
|
|
|
27
27
|
// src/utils/variables.ts
|
|
28
28
|
import { readFileSync } from "fs";
|