@vfrey/vfrey 0.0.1 → 1.0.0-beta.1
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/LICENSE +33 -0
- package/README.md +78 -3
- package/accounts.example.json +61 -0
- package/accounts.first-run.json +41 -0
- package/bin/vfrey.mjs +36 -0
- package/integration-tools/README.md +43 -0
- package/integration-tools/image/pillow.md +32 -0
- package/integration-tools/image/playwright.md +33 -0
- package/integration-tools/image/resvg.md +36 -0
- package/integration-tools/image/satori.md +36 -0
- package/integration-tools/image/sharp.md +38 -0
- package/integration-tools/video/blender.md +34 -0
- package/integration-tools/video/ffmpeg.md +41 -0
- package/integration-tools/video/manim.md +37 -0
- package/integration-tools/video/motion-canvas.md +37 -0
- package/integration-tools/video/remotion.md +50 -0
- package/integration-tools/video/revideo.md +32 -0
- package/package.json +74 -6
- package/skills/vfrey-orchestrator/SKILL.md +15 -0
- package/skills/vfrey-orchestrator/channel-video/SKILL.md +41 -0
- package/skills/vfrey-product/SKILL.md +63 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/cook-one.svg +14 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/cook-two.svg +22 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/framey/index.html +70 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/cook-one.svg +14 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/cook-two.svg +22 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/remotion/index.tsx +49 -0
- package/skills/vfrey-product/examples/concurrency-vs-parallelism/script.json +15 -0
- package/skills/vfrey-product/examples/octopus-facts/index.html +60 -0
- package/skills/vfrey-product/examples/octopus-facts/octopus.svg +8 -0
- package/skills/vfrey-product/examples/octopus-facts/script.json +14 -0
- package/skills/vfrey-product/push/SKILL.md +15 -0
- package/skills/vfrey-product/scenes/NOTICE +5 -0
- package/skills/vfrey-product/scenes/blocks.md +57 -0
- package/skills/vfrey-product/scenes/craft.md +118 -0
- package/skills/vfrey-product/scenes/motion.md +88 -0
- package/src/analytics/dashboard.ts +109 -0
- package/src/analytics/index.ts +260 -0
- package/src/api/client.ts +361 -0
- package/src/api/cloud-files.ts +197 -0
- package/src/api/cloud-runs.ts +75 -0
- package/src/api/cloud.ts +413 -0
- package/src/api/commands.ts +330 -0
- package/src/api/config.ts +34 -0
- package/src/api/creators.ts +463 -0
- package/src/api/credentials.ts +152 -0
- package/src/api/mail.ts +333 -0
- package/src/api/topics.ts +207 -0
- package/src/api/types.ts +273 -0
- package/src/cli.ts +468 -0
- package/src/cloud/bundle.ts +70 -0
- package/src/cloud/cloudrun-executor.ts +237 -0
- package/src/cloud/executor.ts +281 -0
- package/src/cloud/gcs-sign.ts +76 -0
- package/src/cloud/job.ts +106 -0
- package/src/cloud/remote-job.ts +67 -0
- package/src/cloud/render-job.ts +191 -0
- package/src/config.ts +309 -0
- package/src/dashboard-link.ts +180 -0
- package/src/dashboard-start.ts +103 -0
- package/src/desk/channel.ts +64 -0
- package/src/desk/cli.ts +216 -0
- package/src/desk/creators-route.ts +129 -0
- package/src/desk/fonts/JetBrainsMono-OFL.txt +93 -0
- package/src/desk/fonts/google-sans-flex-latin.woff2 +0 -0
- package/src/desk/fonts/jetbrains-mono-medium.woff2 +0 -0
- package/src/desk/http.ts +460 -0
- package/src/desk/mail-route.ts +103 -0
- package/src/desk/overlay.ts +112 -0
- package/src/desk/preview.ts +422 -0
- package/src/desk/screens.ts +149 -0
- package/src/desk/secrets.ts +143 -0
- package/src/desk/series.ts +127 -0
- package/src/desk/state.ts +77 -0
- package/src/desk/studio-route.ts +119 -0
- package/src/desk/tick-runner.ts +66 -0
- package/src/desk/tick.ts +56 -0
- package/src/desk/topics-route.ts +41 -0
- package/src/desk/ui/app.css +505 -0
- package/src/desk/ui/app.js +185 -0
- package/src/desk/ui/apple-icon.png +0 -0
- package/src/desk/ui/components.js +79 -0
- package/src/desk/ui/core.js +156 -0
- package/src/desk/ui/favicon.ico +0 -0
- package/src/desk/ui/icon.svg +1 -0
- package/src/desk/ui/icons.js +49 -0
- package/src/desk/ui/index.html +41 -0
- package/src/desk/ui/metrics-math.d.ts +22 -0
- package/src/desk/ui/metrics-math.js +135 -0
- package/src/desk/ui/theme.js +5 -0
- package/src/desk/ui/views-creators.js +209 -0
- package/src/desk/ui/views-keys.js +114 -0
- package/src/desk/ui/views-mail.js +188 -0
- package/src/desk/ui/views-misc.js +123 -0
- package/src/desk/ui/views-review.js +119 -0
- package/src/desk/ui/views-runs.js +350 -0
- package/src/desk/ui/views-screens.js +163 -0
- package/src/desk/ui/views-series.js +318 -0
- package/src/desk/ui/views-topics.js +87 -0
- package/src/desk/verbs.ts +361 -0
- package/src/doctor.ts +212 -0
- package/src/drain.ts +14 -0
- package/src/engage/index.ts +217 -0
- package/src/generate/index.ts +110 -0
- package/src/generate/script.ts +152 -0
- package/src/generate/title.ts +78 -0
- package/src/help.ts +252 -0
- package/src/home.ts +45 -0
- package/src/llm/client.ts +177 -0
- package/src/log.ts +7 -0
- package/src/oauth/tokens.ts +189 -0
- package/src/oauth/vault.ts +72 -0
- package/src/pipeline/review.ts +642 -0
- package/src/pipeline/run.ts +443 -0
- package/src/pipeline/series-guard.ts +26 -0
- package/src/pipeline/source-fetch.ts +69 -0
- package/src/pipeline/stages.ts +728 -0
- package/src/pipeline/topics-source.ts +90 -0
- package/src/product/commands.ts +296 -0
- package/src/product/config-file.ts +38 -0
- package/src/product/engine-choice.ts +89 -0
- package/src/product/engines.ts +103 -0
- package/src/product/insights.ts +50 -0
- package/src/product/keys.ts +67 -0
- package/src/product/paths.ts +18 -0
- package/src/product/probes.ts +88 -0
- package/src/product/push-flow.ts +90 -0
- package/src/product/render-video.ts +21 -0
- package/src/product/short.ts +62 -0
- package/src/product/update.ts +32 -0
- package/src/project/canonical.ts +14 -0
- package/src/project/commands.ts +177 -0
- package/src/project/dashboard-status.ts +28 -0
- package/src/project/discover.ts +19 -0
- package/src/project/index-file.ts +73 -0
- package/src/project/marker.ts +92 -0
- package/src/project/migrate.ts +201 -0
- package/src/project/names.ts +27 -0
- package/src/project/notice.ts +16 -0
- package/src/project/open.ts +88 -0
- package/src/project/scaffold.ts +112 -0
- package/src/project/templates.ts +42 -0
- package/src/project/videos.ts +64 -0
- package/src/publish/facebook.ts +91 -0
- package/src/publish/index.ts +12 -0
- package/src/publish/instagram.ts +97 -0
- package/src/publish/rate.ts +62 -0
- package/src/publish/session.ts +242 -0
- package/src/publish/tiktok.ts +202 -0
- package/src/publish/youtube.ts +177 -0
- package/src/queue/desk-ops.ts +1170 -0
- package/src/queue/seal.ts +3 -0
- package/src/queue/store.ts +1006 -0
- package/src/remotion/AiLabel.tsx +26 -0
- package/src/remotion/Root.tsx +73 -0
- package/src/remotion/defaults.ts +26 -0
- package/src/remotion/films/claude/ClaudeFilm.tsx +1014 -0
- package/src/remotion/films/engine/EngineMark.tsx +17 -0
- package/src/remotion/films/rea/ReaShort.tsx +552 -0
- package/src/remotion/films/rea/drawings.tsx +907 -0
- package/src/remotion/films/rea/timing.ts +144 -0
- package/src/remotion/index.ts +4 -0
- package/src/remotion/templates/EditorialSplit.tsx +39 -0
- package/src/remotion/templates/KineticType.tsx +39 -0
- package/src/remotion/templates/SignalBoard.tsx +50 -0
- package/src/remotion/timing.ts +22 -0
- package/src/render/chrome.ts +78 -0
- package/src/render/engine-mark.ts +29 -0
- package/src/render/framey-template.ts +130 -0
- package/src/render/html-engine.ts +149 -0
- package/src/render/node-crypto-stub.ts +11 -0
- package/src/render/probe.ts +29 -0
- package/src/render/props.ts +17 -0
- package/src/render/vertical-short.ts +35 -0
- package/src/render/webpack.ts +33 -0
- package/src/render/worker.ts +65 -0
- package/src/scene/assets/fonts/TitanOne-OFL.txt +94 -0
- package/src/scene/assets/fonts/titan-one.woff2 +0 -0
- package/src/scene/assets/gsap/LICENSE.txt +8 -0
- package/src/scene/assets/gsap/gsap.min.js +11 -0
- package/src/scene/audio.ts +54 -0
- package/src/scene/blocks/LICENSE +190 -0
- package/src/scene/blocks/NOTICE +5 -0
- package/src/scene/blocks/bar-chart-race/bar-chart-race.html +585 -0
- package/src/scene/blocks/beat-freeze-cut/beat-freeze-cut.html +874 -0
- package/src/scene/blocks/camcorder-hud/camcorder-hud.html +164 -0
- package/src/scene/blocks/camera-dolly-zoom/camera-dolly-zoom.html +355 -0
- package/src/scene/blocks/code-diff/code-diff.html +817 -0
- package/src/scene/blocks/code-snippet-apple-terminal-pro/code-snippet-apple-terminal-pro.html +248 -0
- package/src/scene/blocks/code-typing/code-typing.html +764 -0
- package/src/scene/blocks/data-chart/data-chart.html +452 -0
- package/src/scene/blocks/flowchart-vertical/flowchart-vertical.html +454 -0
- package/src/scene/blocks/hw-scribble-transition/hw-scribble-transition.html +153 -0
- package/src/scene/blocks/index.json +824 -0
- package/src/scene/blocks/lt-accent-underline/lt-accent-underline.html +107 -0
- package/src/scene/blocks/lt-bold-block/lt-bold-block.html +109 -0
- package/src/scene/blocks/lt-clean-bar/lt-clean-bar.html +112 -0
- package/src/scene/blocks/lt-dark-card/lt-dark-card.html +111 -0
- package/src/scene/blocks/lt-kicker-name/lt-kicker-name.html +114 -0
- package/src/scene/blocks/lt-mask-reveal/lt-mask-reveal.html +120 -0
- package/src/scene/blocks/lt-neon-border/lt-neon-border.html +391 -0
- package/src/scene/blocks/lt-stack-bars/lt-stack-bars.html +109 -0
- package/src/scene/blocks/macos-notification/macos-notification.html +194 -0
- package/src/scene/blocks/mk-background/mk-background.html +236 -0
- package/src/scene/blocks/mk-callout-highlight/mk-callout-highlight.html +183 -0
- package/src/scene/blocks/mk-clone-wall-transition/mk-clone-wall-transition.html +226 -0
- package/src/scene/blocks/mk-line-graph/mk-line-graph.html +293 -0
- package/src/scene/blocks/mk-progress-stat/mk-progress-stat.html +186 -0
- package/src/scene/blocks/mk-specs-list/mk-specs-list.html +223 -0
- package/src/scene/blocks/news-ticker/news-ticker.html +409 -0
- package/src/scene/blocks/organic-light-leak-overlay/organic-light-leak-overlay.html +126 -0
- package/src/scene/blocks/oscilloscope-trace/oscilloscope-trace.html +519 -0
- package/src/scene/blocks/snow/snow.html +205 -0
- package/src/scene/blocks/split-flap-board/split-flap-board.html +347 -0
- package/src/scene/blocks/spotify-card/spotify-card.html +294 -0
- package/src/scene/blocks/starfield/starfield.html +188 -0
- package/src/scene/blocks/thread-message-stack/thread-message-stack.html +239 -0
- package/src/scene/blocks/week-in-merges/week-in-merges.html +470 -0
- package/src/scene/blocks/x-post/x-post.html +437 -0
- package/src/scene/blocks/yt-comment-card/yt-comment-card.html +319 -0
- package/src/scene/blocks/yt-lcd-background/yt-lcd-background.html +307 -0
- package/src/scene/blocks/yt-prism-title/yt-prism-title.html +205 -0
- package/src/scene/blocks.ts +229 -0
- package/src/scene/command.ts +272 -0
- package/src/scene/figure.ts +181 -0
- package/src/scene/glyphs.ts +107 -0
- package/src/scene/init.ts +86 -0
- package/src/scene/inspect/css-tree.d.ts +6 -0
- package/src/scene/inspect/page-scripts.ts +272 -0
- package/src/scene/inspect/report.ts +405 -0
- package/src/scene/inspect/run.ts +200 -0
- package/src/scene/inspect/source.ts +236 -0
- package/src/scene/label.ts +131 -0
- package/src/scene/net-guard.ts +74 -0
- package/src/scene/render.ts +292 -0
- package/src/scene/runtime/browser.ts +199 -0
- package/src/scene/runtime/core.ts +181 -0
- package/src/scene/runtime/react.tsx +115 -0
- package/src/scene/runtime/transitions.ts +133 -0
- package/src/scene/sanitize.ts +181 -0
- package/src/scene/scene.ts +152 -0
- package/src/scene/studio-command.ts +48 -0
- package/src/scene/studio-skin.ts +59 -0
- package/src/scene/studio.ts +337 -0
- package/src/scene/supply.ts +111 -0
- package/src/scene/timing.ts +288 -0
- package/src/scene/transitions/LICENSE +190 -0
- package/src/scene/transitions/NOTICE +5 -0
- package/src/scene/transitions/SOURCE.json +24 -0
- package/src/scene/transitions/transitions.global.js +38 -0
- package/src/scene/transitions.ts +26 -0
- package/src/service/all-projects.ts +153 -0
- package/src/service/commands.ts +256 -0
- package/src/service/due.ts +82 -0
- package/src/service/lock.ts +101 -0
- package/src/service/log-file.ts +56 -0
- package/src/service/state.ts +41 -0
- package/src/service/units.ts +90 -0
- package/src/service/worker.ts +51 -0
- package/src/skill-agents.ts +74 -0
- package/src/skill-install.ts +334 -0
- package/src/sync-write.ts +21 -0
- package/src/tick-report.ts +205 -0
- package/src/tts.ts +124 -0
- package/vendor/@vfrey/contracts/dist/account.d.ts +97 -0
- package/vendor/@vfrey/contracts/dist/account.js +27 -0
- package/vendor/@vfrey/contracts/dist/checks.d.ts +8 -0
- package/vendor/@vfrey/contracts/dist/checks.js +1 -0
- package/vendor/@vfrey/contracts/dist/credentials/crypto.d.ts +4 -0
- package/vendor/@vfrey/contracts/dist/credentials/crypto.js +38 -0
- package/vendor/@vfrey/contracts/dist/domain/advice-persona.d.ts +10 -0
- package/vendor/@vfrey/contracts/dist/domain/advice-persona.js +24 -0
- package/vendor/@vfrey/contracts/dist/domain/backoff.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/backoff.js +27 -0
- package/vendor/@vfrey/contracts/dist/domain/cadence.d.ts +29 -0
- package/vendor/@vfrey/contracts/dist/domain/cadence.js +95 -0
- package/vendor/@vfrey/contracts/dist/domain/creators.d.ts +146 -0
- package/vendor/@vfrey/contracts/dist/domain/creators.js +2 -0
- package/vendor/@vfrey/contracts/dist/domain/disclosure.d.ts +127 -0
- package/vendor/@vfrey/contracts/dist/domain/disclosure.js +250 -0
- package/vendor/@vfrey/contracts/dist/domain/errors.d.ts +34 -0
- package/vendor/@vfrey/contracts/dist/domain/errors.js +68 -0
- package/vendor/@vfrey/contracts/dist/domain/redact.d.ts +1 -0
- package/vendor/@vfrey/contracts/dist/domain/redact.js +21 -0
- package/vendor/@vfrey/contracts/dist/domain/revenue.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/revenue.js +16 -0
- package/vendor/@vfrey/contracts/dist/domain/safety.d.ts +20 -0
- package/vendor/@vfrey/contracts/dist/domain/safety.js +61 -0
- package/vendor/@vfrey/contracts/dist/domain/similarity.d.ts +13 -0
- package/vendor/@vfrey/contracts/dist/domain/similarity.js +100 -0
- package/vendor/@vfrey/contracts/dist/domain/templates.d.ts +18 -0
- package/vendor/@vfrey/contracts/dist/domain/templates.js +67 -0
- package/vendor/@vfrey/contracts/dist/domain/tiktok-chunks.d.ts +19 -0
- package/vendor/@vfrey/contracts/dist/domain/tiktok-chunks.js +52 -0
- package/vendor/@vfrey/contracts/dist/domain/topics.d.ts +78 -0
- package/vendor/@vfrey/contracts/dist/domain/topics.js +4 -0
- package/vendor/@vfrey/contracts/dist/domain/types.d.ts +216 -0
- package/vendor/@vfrey/contracts/dist/domain/types.js +1 -0
- package/vendor/@vfrey/contracts/dist/domain/variation.d.ts +57 -0
- package/vendor/@vfrey/contracts/dist/domain/variation.js +278 -0
- package/vendor/@vfrey/contracts/dist/events.d.ts +20 -0
- package/vendor/@vfrey/contracts/dist/events.js +1 -0
- package/vendor/@vfrey/contracts/dist/http.d.ts +11 -0
- package/vendor/@vfrey/contracts/dist/http.js +37 -0
- package/vendor/@vfrey/contracts/dist/index.d.ts +22 -0
- package/vendor/@vfrey/contracts/dist/index.js +22 -0
- package/vendor/@vfrey/contracts/dist/log.d.ts +2 -0
- package/vendor/@vfrey/contracts/dist/log.js +10 -0
- package/vendor/@vfrey/contracts/dist/mail.d.ts +55 -0
- package/vendor/@vfrey/contracts/dist/mail.js +1 -0
- package/vendor/@vfrey/contracts/package.json +18 -0
- package/vendor/@vfrey/ingest/dist/index.d.ts +41 -0
- package/vendor/@vfrey/ingest/dist/index.js +221 -0
- package/vendor/@vfrey/ingest/dist/parse.d.ts +5 -0
- package/vendor/@vfrey/ingest/dist/parse.js +165 -0
- package/vendor/@vfrey/ingest/package.json +21 -0
- package/vendor/framey/LICENSE +190 -0
- package/vendor/framey/NOTICE +15 -0
- package/vendor/framey/SOURCE.json +24 -0
- package/vendor/framey/STUDIO-SOURCE.json +9 -0
- package/vendor/framey/bin/framey-localize-fonts.mjs +12 -0
- package/vendor/framey/bin/framey.mjs +16 -0
- package/vendor/framey/dist/add-VMJD5KBS.js +75 -0
- package/vendor/framey/dist/animatedGifPrep-QPKGJ6PM.js +43 -0
- package/vendor/framey/dist/api.d.ts +211 -0
- package/vendor/framey/dist/api.js +76 -0
- package/vendor/framey/dist/appHistory-WW56FZTT.js +31 -0
- package/vendor/framey/dist/asset-WQKGOELE.js +26 -0
- package/vendor/framey/dist/audio-RSJWVWRA.js +1936 -0
- package/vendor/framey/dist/batchRender-3HPICDCT.js +366 -0
- package/vendor/framey/dist/beats-HL2BDUZI.js +273 -0
- package/vendor/framey/dist/benchmark-RWCWHI5Z.js +230 -0
- package/vendor/framey/dist/browser-ECYET3Q2.js +206 -0
- package/vendor/framey/dist/bundleWithLocalizedFonts-ALYBQEQT.js +52 -0
- package/vendor/framey/dist/captureCompositionFrame-4DA6SEH2.js +94 -0
- package/vendor/framey/dist/catalog-5JVDEUWK.js +979 -0
- package/vendor/framey/dist/catch-up-NEBCL5NO.js +106 -0
- package/vendor/framey/dist/check-F5N544ML.js +111 -0
- package/vendor/framey/dist/checkBrowser-LZ66CMJG.js +110 -0
- package/vendor/framey/dist/chunk-2K7Z2HVP.js +372 -0
- package/vendor/framey/dist/chunk-2UZQHDM7.js +323 -0
- package/vendor/framey/dist/chunk-2X4PQEYM.js +34 -0
- package/vendor/framey/dist/chunk-3422KMTD.js +168 -0
- package/vendor/framey/dist/chunk-3FYD4YEK.js +72 -0
- package/vendor/framey/dist/chunk-3GXQPCJC.js +682 -0
- package/vendor/framey/dist/chunk-3LM6YPBR.js +179 -0
- package/vendor/framey/dist/chunk-442JNXRM.js +20 -0
- package/vendor/framey/dist/chunk-4BNN5FGX.js +182 -0
- package/vendor/framey/dist/chunk-4P7NX5BM.js +11532 -0
- package/vendor/framey/dist/chunk-4UMPIPCQ.js +88 -0
- package/vendor/framey/dist/chunk-4YYJOFKS.js +28 -0
- package/vendor/framey/dist/chunk-54HJ63Q2.js +29 -0
- package/vendor/framey/dist/chunk-5ETJX6WM.js +89 -0
- package/vendor/framey/dist/chunk-5SG54JRS.js +68 -0
- package/vendor/framey/dist/chunk-634HSJ3J.js +58 -0
- package/vendor/framey/dist/chunk-66LREXGS.js +48 -0
- package/vendor/framey/dist/chunk-6BEFEWFB.js +25 -0
- package/vendor/framey/dist/chunk-6BNTGNGD.js +286 -0
- package/vendor/framey/dist/chunk-6DDPOHMK.js +140 -0
- package/vendor/framey/dist/chunk-6GV5XSOR.js +214 -0
- package/vendor/framey/dist/chunk-6JR2XUEE.js +127 -0
- package/vendor/framey/dist/chunk-73QVATIM.js +362 -0
- package/vendor/framey/dist/chunk-7FMUTGOH.js +279 -0
- package/vendor/framey/dist/chunk-7JQFJ6JJ.js +291 -0
- package/vendor/framey/dist/chunk-AHPGAESX.js +113 -0
- package/vendor/framey/dist/chunk-AHX34EFP.js +15 -0
- package/vendor/framey/dist/chunk-AJ5CSAEZ.js +487 -0
- package/vendor/framey/dist/chunk-B7RJV74O.js +5047 -0
- package/vendor/framey/dist/chunk-BL4U6U52.js +254 -0
- package/vendor/framey/dist/chunk-BSQ7XANM.js +210 -0
- package/vendor/framey/dist/chunk-BZ56MTDX.js +6 -0
- package/vendor/framey/dist/chunk-C5BO7PMT.js +282 -0
- package/vendor/framey/dist/chunk-CFUCHO4T.js +358 -0
- package/vendor/framey/dist/chunk-CZGHFATT.js +31 -0
- package/vendor/framey/dist/chunk-DLA44CMS.js +5649 -0
- package/vendor/framey/dist/chunk-DPVXBVLL.js +31292 -0
- package/vendor/framey/dist/chunk-DQBY7FRR.js +397 -0
- package/vendor/framey/dist/chunk-EAMLBAHA.js +154 -0
- package/vendor/framey/dist/chunk-EOVYQ3IG.js +143 -0
- package/vendor/framey/dist/chunk-EVMY7IPL.js +612 -0
- package/vendor/framey/dist/chunk-FG4BBFZI.js +122 -0
- package/vendor/framey/dist/chunk-FI4I7CME.js +56 -0
- package/vendor/framey/dist/chunk-FLREUEHW.js +2081 -0
- package/vendor/framey/dist/chunk-FUFP7A7S.js +1126 -0
- package/vendor/framey/dist/chunk-FV3PIKGH.js +56 -0
- package/vendor/framey/dist/chunk-FXMKHHPO.js +123 -0
- package/vendor/framey/dist/chunk-GGZAM5VH.js +1187 -0
- package/vendor/framey/dist/chunk-GKZEVJIB.js +39 -0
- package/vendor/framey/dist/chunk-GMECXFAN.js +57 -0
- package/vendor/framey/dist/chunk-GNEFDLFB.js +621 -0
- package/vendor/framey/dist/chunk-GPMLSOEG.js +19274 -0
- package/vendor/framey/dist/chunk-GPYVT5EE.js +59 -0
- package/vendor/framey/dist/chunk-H6IEMZEV.js +40 -0
- package/vendor/framey/dist/chunk-HEFQCIXR.js +170 -0
- package/vendor/framey/dist/chunk-HFQ4CWHA.js +118 -0
- package/vendor/framey/dist/chunk-HPDTCOKE.js +304 -0
- package/vendor/framey/dist/chunk-HTUHQKDB.js +548 -0
- package/vendor/framey/dist/chunk-HU2SPFNG.js +103 -0
- package/vendor/framey/dist/chunk-HVW7ABXD.js +19 -0
- package/vendor/framey/dist/chunk-IG7NDKXO.js +26 -0
- package/vendor/framey/dist/chunk-II3J3WXK.js +246 -0
- package/vendor/framey/dist/chunk-IR35BCLK.js +13 -0
- package/vendor/framey/dist/chunk-ISN5GRYI.js +20 -0
- package/vendor/framey/dist/chunk-IUONB55J.js +669 -0
- package/vendor/framey/dist/chunk-IVSUQR2B.js +161 -0
- package/vendor/framey/dist/chunk-IXU6PQSW.js +259 -0
- package/vendor/framey/dist/chunk-IZCW2NKT.js +29 -0
- package/vendor/framey/dist/chunk-JGXJU5PF.js +68 -0
- package/vendor/framey/dist/chunk-JHOCK3DG.js +27 -0
- package/vendor/framey/dist/chunk-JVBRJMOP.js +121 -0
- package/vendor/framey/dist/chunk-K4MJX7SR.js +17 -0
- package/vendor/framey/dist/chunk-K4WKGXRC.js +18 -0
- package/vendor/framey/dist/chunk-KGPLIH7B.js +127 -0
- package/vendor/framey/dist/chunk-KLIKCX6Q.js +63 -0
- package/vendor/framey/dist/chunk-KXTKKBOC.js +61 -0
- package/vendor/framey/dist/chunk-KZI44OPA.js +185 -0
- package/vendor/framey/dist/chunk-LEKZNRKI.js +45 -0
- package/vendor/framey/dist/chunk-LFGJWOVA.js +61 -0
- package/vendor/framey/dist/chunk-LLMSX6V6.js +17 -0
- package/vendor/framey/dist/chunk-LTGTN2TH.js +195 -0
- package/vendor/framey/dist/chunk-M2WBOQ2Q.js +54 -0
- package/vendor/framey/dist/chunk-MI5FTLYK.js +399 -0
- package/vendor/framey/dist/chunk-MLQP2QUF.js +1809 -0
- package/vendor/framey/dist/chunk-MMQ52NIZ.js +956 -0
- package/vendor/framey/dist/chunk-ND46XKK3.js +742 -0
- package/vendor/framey/dist/chunk-NYEXNSHM.js +504 -0
- package/vendor/framey/dist/chunk-O4YRB27L.js +57 -0
- package/vendor/framey/dist/chunk-O7BGSQ5F.js +92 -0
- package/vendor/framey/dist/chunk-OFQWTKPW.js +117 -0
- package/vendor/framey/dist/chunk-P5ZBLXJ6.js +91 -0
- package/vendor/framey/dist/chunk-P6LJ4Y32.js +4662 -0
- package/vendor/framey/dist/chunk-PKZ7RK5N.js +281 -0
- package/vendor/framey/dist/chunk-PURHAXFL.js +15 -0
- package/vendor/framey/dist/chunk-Q5X2B5WT.js +29 -0
- package/vendor/framey/dist/chunk-QAMKOG67.js +248 -0
- package/vendor/framey/dist/chunk-R6YBK4XX.js +514 -0
- package/vendor/framey/dist/chunk-RGLQURIX.js +2997 -0
- package/vendor/framey/dist/chunk-RNV3DM4S.js +3573 -0
- package/vendor/framey/dist/chunk-ROEW726S.js +4638 -0
- package/vendor/framey/dist/chunk-RQVDTPGD.js +6 -0
- package/vendor/framey/dist/chunk-RVZHGOGR.js +26 -0
- package/vendor/framey/dist/chunk-RXATE6FZ.js +385 -0
- package/vendor/framey/dist/chunk-S3S4TGEH.js +424 -0
- package/vendor/framey/dist/chunk-SDYDNHEE.js +11202 -0
- package/vendor/framey/dist/chunk-SSWBU67I.js +173 -0
- package/vendor/framey/dist/chunk-ST35C4K6.js +28 -0
- package/vendor/framey/dist/chunk-SZNTYTIV.js +990 -0
- package/vendor/framey/dist/chunk-T2EUWCJE.js +29 -0
- package/vendor/framey/dist/chunk-T6AGUTZJ.js +444 -0
- package/vendor/framey/dist/chunk-THJALHFJ.js +11131 -0
- package/vendor/framey/dist/chunk-TIQB63MX.js +18128 -0
- package/vendor/framey/dist/chunk-U242RTCT.js +134 -0
- package/vendor/framey/dist/chunk-UJZREAV6.js +3901 -0
- package/vendor/framey/dist/chunk-UMD3V7CU.js +264 -0
- package/vendor/framey/dist/chunk-UOFAE5RF.js +42 -0
- package/vendor/framey/dist/chunk-UTEIUGAZ.js +29 -0
- package/vendor/framey/dist/chunk-VAS6HQX3.js +138 -0
- package/vendor/framey/dist/chunk-VC76R6W2.js +27 -0
- package/vendor/framey/dist/chunk-VFZ7W5W7.js +226 -0
- package/vendor/framey/dist/chunk-VHNLZAE2.js +348 -0
- package/vendor/framey/dist/chunk-VMC4WSH5.js +278 -0
- package/vendor/framey/dist/chunk-VORQIH64.js +108 -0
- package/vendor/framey/dist/chunk-VTXFRIHO.js +186 -0
- package/vendor/framey/dist/chunk-W2LGJSEN.js +182 -0
- package/vendor/framey/dist/chunk-WKBM7NDG.js +32 -0
- package/vendor/framey/dist/chunk-WMQNIQDJ.js +2057 -0
- package/vendor/framey/dist/chunk-WN4XZC5F.js +504 -0
- package/vendor/framey/dist/chunk-WQ6ZXHFQ.js +133 -0
- package/vendor/framey/dist/chunk-X7HBSTCZ.js +53 -0
- package/vendor/framey/dist/chunk-X7MTZ4T2.js +6 -0
- package/vendor/framey/dist/chunk-XPTOJZJF.js +308 -0
- package/vendor/framey/dist/chunk-XT6MXC7A.js +6 -0
- package/vendor/framey/dist/chunk-XT7X6QCP.js +6 -0
- package/vendor/framey/dist/chunk-XTMDWNEC.js +2820 -0
- package/vendor/framey/dist/chunk-XUHOIDKG.js +6 -0
- package/vendor/framey/dist/chunk-XX7LTW5Y.js +138 -0
- package/vendor/framey/dist/chunk-Y3YGTZEG.js +382 -0
- package/vendor/framey/dist/chunk-Y5SBSGN7.js +346 -0
- package/vendor/framey/dist/chunk-YCMVI4MZ.js +625 -0
- package/vendor/framey/dist/chunk-YOR4CTCE.js +261 -0
- package/vendor/framey/dist/chunk-YPRBGITP.js +2748 -0
- package/vendor/framey/dist/chunk-ZKDMAOFU.js +32 -0
- package/vendor/framey/dist/chunk-ZW6DURPF.js +1318 -0
- package/vendor/framey/dist/clean-ZJOGDKDM.js +336 -0
- package/vendor/framey/dist/cli.js +439 -0
- package/vendor/framey/dist/cloudrun-HGJ3B6ZV.js +767 -0
- package/vendor/framey/dist/commands/contrast-audit.browser.js +643 -0
- package/vendor/framey/dist/commands/layout-audit.browser.js +2914 -0
- package/vendor/framey/dist/commands/motion-sample.browser.js +74 -0
- package/vendor/framey/dist/commands/motion-signature.browser.js +475 -0
- package/vendor/framey/dist/compare-W7UY3BAZ.js +463 -0
- package/vendor/framey/dist/compiler-TM3W6GYF.js +136 -0
- package/vendor/framey/dist/component-QF5VGYMU.js +176 -0
- package/vendor/framey/dist/compositions-XT3PMNDF.js +238 -0
- package/vendor/framey/dist/contactSheet-7W6GYHBQ.js +24 -0
- package/vendor/framey/dist/deploy-6FJPWKF2.js +299 -0
- package/vendor/framey/dist/destroy-HE2RIPKZ.js +57 -0
- package/vendor/framey/dist/deterministicFonts-RADD3BSX.js +50 -0
- package/vendor/framey/dist/dist-4S2FGGVY.js +422 -0
- package/vendor/framey/dist/dist-BE4B2EZE.js +32 -0
- package/vendor/framey/dist/dist-EWXJGN63.js +129 -0
- package/vendor/framey/dist/docs-VKIRFEEX.js +131 -0
- package/vendor/framey/dist/doctor-2UNJ2G7U.js +74 -0
- package/vendor/framey/dist/dom-37K6YOH4.js +14 -0
- package/vendor/framey/dist/dotEnv-7PZQTVIM.js +54 -0
- package/vendor/framey/dist/events-ACY3P2PA.js +76 -0
- package/vendor/framey/dist/events-IHB3B2MK.js +69 -0
- package/vendor/framey/dist/ffmpeg-DR5LGGSK.js +63 -0
- package/vendor/framey/dist/figma-BODVUPHB.js +63 -0
- package/vendor/framey/dist/fontData.generated-NXAOI4GH.js +13 -0
- package/vendor/framey/dist/fontLocalizeCli.js +142 -0
- package/vendor/framey/dist/gpuPolicy-XLEXORZY.js +49 -0
- package/vendor/framey/dist/grade-compare-GAXFQ74C.js +661 -0
- package/vendor/framey/dist/gsapParser-IEUSLYDJ.js +2885 -0
- package/vendor/framey/dist/gsapParserAcorn-LZJKCFQI.js +30 -0
- package/vendor/framey/dist/help-VCB5X2HS.js +184 -0
- package/vendor/framey/dist/history-ENGZEVFT.js +471 -0
- package/vendor/framey/dist/hyperframe.manifest.json +22 -0
- package/vendor/framey/dist/hyperframe.runtime.iife.js +1132 -0
- package/vendor/framey/dist/hyperframes-player.global.js +478 -0
- package/vendor/framey/dist/hyperframes-slideshow.global.js +148 -0
- package/vendor/framey/dist/info-WPCJHBMU.js +182 -0
- package/vendor/framey/dist/init-G4WGLYGD.js +1176 -0
- package/vendor/framey/dist/inspect-5IQ6CNEQ.js +106 -0
- package/vendor/framey/dist/installer-ML4HWUV7.js +40 -0
- package/vendor/framey/dist/keyframes-Q6XJO7VW.js +2755 -0
- package/vendor/framey/dist/lambda-A7JC74JF.js +468 -0
- package/vendor/framey/dist/layout-YET6XNXA.js +95 -0
- package/vendor/framey/dist/lint-I7FZN2VJ.js +162 -0
- package/vendor/framey/dist/lintProject-PDB3UN72.js +30 -0
- package/vendor/framey/dist/manager-CD6LJ7ZN.js +45 -0
- package/vendor/framey/dist/manager-WA4F2GST.js +67 -0
- package/vendor/framey/dist/media-treatment-BXYS4WVA.js +1030 -0
- package/vendor/framey/dist/media-use-LWH3MANK.js +113 -0
- package/vendor/framey/dist/models-K363FYM4.js +195 -0
- package/vendor/framey/dist/motionShot-GPAVWXLH.js +640 -0
- package/vendor/framey/dist/normalize-FASIPBUM.js +24 -0
- package/vendor/framey/dist/normalize-audio-VDWYRHN6.js +268 -0
- package/vendor/framey/dist/open-E3TB6P6J.js +128 -0
- package/vendor/framey/dist/parakeetRunner-UP34UOI2.js +58 -0
- package/vendor/framey/dist/pipeline-VXIUYEBU.js +64 -0
- package/vendor/framey/dist/play-BUTDQ4DV.js +353 -0
- package/vendor/framey/dist/policies-OLDYGFK5.js +309 -0
- package/vendor/framey/dist/preflight-2KZ2GWAZ.js +55 -0
- package/vendor/framey/dist/present-GXYSM7NX.js +353 -0
- package/vendor/framey/dist/preview-EKZ33JOJ.js +1910 -0
- package/vendor/framey/dist/producer-SKU5EV3J.js +13 -0
- package/vendor/framey/dist/progress-ZWB4Z4ET.js +76 -0
- package/vendor/framey/dist/projectConfig-3MZAYVTS.js +60 -0
- package/vendor/framey/dist/publication-DTKWNF74.js +33 -0
- package/vendor/framey/dist/remove-background-OY5L7XN2.js +265 -0
- package/vendor/framey/dist/render-CDV4GDFX.js +187 -0
- package/vendor/framey/dist/render-YE5YAMOD.js +2620 -0
- package/vendor/framey/dist/render-batch-ZAMFPCLL.js +274 -0
- package/vendor/framey/dist/renderSetupWorker.js +120 -0
- package/vendor/framey/dist/resolver-D5BIPSEW.js +42 -0
- package/vendor/framey/dist/runtimeVersion.js +18 -0
- package/vendor/framey/dist/sam-WFZXI4F7.js +23 -0
- package/vendor/framey/dist/shaderTransitionWorker.js +44 -0
- package/vendor/framey/dist/sherpa-RQWLV7I3.js +79 -0
- package/vendor/framey/dist/sherpaWorker.js +84 -0
- package/vendor/framey/dist/sites-AMOVABTK.js +54 -0
- package/vendor/framey/dist/skill-ZHVLH7KX.js +15 -0
- package/vendor/framey/dist/slideshow-SJGK4RQS.js +24 -0
- package/vendor/framey/dist/snapshot-TUXL6LBQ.js +1515 -0
- package/vendor/framey/dist/src-JHQGB2S6.js +215 -0
- package/vendor/framey/dist/src-Z5PGEMXB.js +532 -0
- package/vendor/framey/dist/state-B6H3WHCF.js +28 -0
- package/vendor/framey/dist/staticProjectServer-DFVZOUGI.js +63 -0
- package/vendor/framey/dist/studio/assets/hyperframes-player-DLaKjw0L.js +478 -0
- package/vendor/framey/dist/studio/assets/index-BX3KHhGX.js +71 -0
- package/vendor/framey/dist/studio/assets/index-CYbvOVp-.css +1 -0
- package/vendor/framey/dist/studio/assets/index-Dp3QEUGL.js +402 -0
- package/vendor/framey/dist/studio/assets/index-qrTAXbqc.js +531 -0
- package/vendor/framey/dist/studio/favicon.svg +14 -0
- package/vendor/framey/dist/studio/icons/timeline/audio.svg +7 -0
- package/vendor/framey/dist/studio/icons/timeline/captions.svg +5 -0
- package/vendor/framey/dist/studio/icons/timeline/composition.svg +12 -0
- package/vendor/framey/dist/studio/icons/timeline/image.svg +18 -0
- package/vendor/framey/dist/studio/icons/timeline/music.svg +10 -0
- package/vendor/framey/dist/studio/icons/timeline/text.svg +3 -0
- package/vendor/framey/dist/studio/index.html +23 -0
- package/vendor/framey/dist/studio-api-2NECGRMB.js +179 -0
- package/vendor/framey/dist/studioSelectionClient-IUUPKUHZ.js +25 -0
- package/vendor/framey/dist/studioServer-N2OPUMOQ.js +1569 -0
- package/vendor/framey/dist/synthesize-PKTB5ATG.js +183 -0
- package/vendor/framey/dist/system-7F3UEHQT.js +27 -0
- package/vendor/framey/dist/telemetry-DQGPEKM6.js +145 -0
- package/vendor/framey/dist/telemetry-UN55N6U6.js +77 -0
- package/vendor/framey/dist/timeline-LHUUMK63.js +1295 -0
- package/vendor/framey/dist/tokens-OLECWDFK.js +92 -0
- package/vendor/framey/dist/transcribe-O7HQKMIV.js +331 -0
- package/vendor/framey/dist/transcribe-UJESPBT5.js +76 -0
- package/vendor/framey/dist/tts-YCCQHZD4.js +234 -0
- package/vendor/framey/dist/urlDownloader-H2LXLG4U.js +48 -0
- package/vendor/framey/dist/usage-HG4WMM7A.js +2167 -0
- package/vendor/framey/dist/validate-F2XMN6EV.js +87 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/GSAP-LICENSE.txt +8 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/CustomEase.min.js +11 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/MotionPathPlugin.min.js +11 -0
- package/vendor/framey/dist/vendor/npm/gsap@3.15.0/dist/gsap.min.js +11 -0
- package/vendor/framey/dist/warmCheck.js +220 -0
- package/vendor/framey/dist/warmCheckClient.js +139 -0
- package/vendor/framey/dist/workspaceBuildCheck-XYD2YTFW.js +133 -0
- package/vendor/framey-player/LICENSE +190 -0
- package/vendor/framey-player/NOTICE +16 -0
- package/vendor/framey-player/SOURCE.json +6 -0
- package/vendor/framey-player/hyperframes-player.global.js +478 -0
- package/vendor/framey.pin +1 -0
- package/bin/index.js +0 -3
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
"use strict";var HyperframesPlayer=(()=>{var ze=Object.defineProperty;var ri=Object.getOwnPropertyDescriptor;var oi=Object.getOwnPropertyNames;var ai=Object.prototype.hasOwnProperty;var si=(t,e)=>{for(var n in e)ze(t,n,{get:e[n],enumerable:!0})},ui=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oi(e))!ai.call(t,r)&&r!==n&&ze(t,r,{get:()=>e[r],enumerable:!(i=ri(e,r))||i.enumerable});return t};var li=t=>ui(ze({},"__esModule",{value:!0}),t);var no={};si(no,{HyperframesPlayer:()=>Ge,SPEED_PRESETS:()=>ct,formatSpeed:()=>U,formatTime:()=>Le});var Pt=t=>t!==null&&Number.isFinite(t)&&t>0;function Se(t){let e=t.clipEndsSeconds.filter(i=>i===null).length;if(Pt(t.authoredDurationSeconds))return{seconds:t.authoredDurationSeconds,source:"authored",pendingClips:e};let n=t.clipEndsSeconds.filter(Pt);return n.length>0?{seconds:Math.max(...n),source:"derived",pendingClips:e}:{seconds:null,source:"unresolved",pendingClips:e,reason:e>0?"every clip's length is still pending":"no authored duration and no clip with a length"}}var di="http://www.w3.org/1999/xhtml";function Nt(t){return t!=null&&t.nodeType===1}function qe(t){return Nt(t)&&t.namespaceURI===di}function je(t,e){return qe(t)&&t.localName===e}function ci(t){return je(t,"video")}function mi(t){return je(t,"audio")}function I(t){return ci(t)||mi(t)}function Ye(t){return je(t,"img")}function Ee(t){if(t==null||t.trim()==="")return null;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:null}function Te(t=document){let e=t.querySelector('[data-composition-id][data-root="true"]');return qe(e)?e:t.querySelector("[data-composition-id]")}var W=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),uo=Object.freeze([W.start,W.duration,W.trackIndex]),lo=Object.freeze([W.derivedEnd]),co=Object.freeze([W.derivedEnd,W.legacyTrack]);function Xe(t){if(t==null||t.trim()==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}var Lt=t=>{let e=Xe(t);return e!==null&&e>=0?e:null};function Ot(t){return Lt(t("data-playback-start"))??Lt(t("data-media-start"))??0}var Q=.1,ee=10;function Ke(t){return Number.isFinite(t)&&t>0?Math.max(Q,Math.min(ee,t)):1}function Ft(t,e=1){let n=Number.parseFloat(t("data-playback-rate")??"");return Ke(Number.isFinite(n)&&n>0?n:e)}function Je(t){let e=Xe(t("data-duration"));return e!==null&&e>0?e:null}function Vt(t,e){let n=Je(t);if(n!==null)return n;let i=Xe(t("data-end"));return i!==null?i-e:null}var pi=3;function Ze(t,e,n){return Number.isFinite(t)?Math.max(0,t-e)/Ke(n):null}function Qe(t){let{tag:e,authoredDurationSeconds:n,sourceDurationSeconds:i,mediaStartSeconds:r,playbackRate:o}=t;if(n!==null&&n>0)return{seconds:n,source:"authored"};if(e==="img")return{seconds:pi,source:"default"};if(i===null)return{seconds:null,source:"pending",reason:"source duration not yet probed"};let a=Ze(i,r,o);return a===null?{seconds:null,source:"pending",reason:"source reported a non-finite duration"}:{seconds:a,source:"media"}}var Ht="data-fx-chain",po=Ht.slice(5);var te=(t="frequency",e="Frequency",n=1e3,i=20,r=2e4)=>({kind:"number",key:t,label:e,unit:"Hz",min:i,max:r,step:1,default:n,scale:"log",automatable:!0}),et=(t=.707,e="Bandwidth: higher is narrower.")=>({kind:"number",key:"q",label:"Q",unit:"",min:.1,max:20,step:.01,default:t,scale:"log",automatable:!0,hint:e}),Re=(t=-40,e=40,n=0)=>({kind:"number",key:"gain",label:"Gain",unit:"dB",min:t,max:e,step:.1,default:n,automatable:!0}),Ut={kind:"enum",key:"poles",label:"Slope",options:[{value:"1",label:"6 dB/oct"},{value:"2",label:"12 dB/oct"}],default:"2",hint:"Two poles is the usual biquad; one pole is gentler."},Wt=[{id:"gain",label:"Gain",group:"dynamics",description:"Raise or lower the whole signal. Automate it to duck under something else.",params:[Re(-60,12,0)],web:"gain-node"},{id:"peaking",label:"Peaking EQ",group:"filter",description:"Boost or cut a band, leaving everything either side alone.",params:[te("frequency","Frequency",1e3),Re(-40,40,0),et(1)],web:"biquad-peaking"},{id:"lowshelf",label:"Low Shelf",group:"filter",description:"Lift or drop everything below the corner frequency.",params:[te("frequency","Frequency",200,20,2e3),Re(-40,40,0)],web:"biquad-lowshelf"},{id:"highshelf",label:"High Shelf",group:"filter",description:"Lift or drop everything above the corner frequency.",params:[te("frequency","Frequency",4e3,500,2e4),Re(-40,40,0)],web:"biquad-highshelf"},{id:"highpass",label:"High-pass",group:"filter",description:"Remove low frequencies: the usual fix for rumble on a voice.",params:[te("frequency","Cutoff",300,20,2e4),et(.707),Ut],web:"biquad-highpass"},{id:"lowpass",label:"Low-pass",group:"filter",description:"Remove high frequencies, which darkens or muffles a track.",params:[te("frequency","Cutoff",8e3,100,2e4),et(.707),Ut],web:"biquad-lowpass"},{id:"compressor",label:"Compressor",group:"dynamics",description:"Pull loud parts down so the quiet ones can come up.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-60,max:0,step:.5,default:-24,hint:"Level above which the compressor starts working."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:4},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:2e3,step:.1,default:20,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:250,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83,hint:"1 is a hard corner; higher eases into it."},{kind:"number",key:"makeup",label:"Makeup",unit:"dB",min:0,max:36,step:.1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1,hint:"Below 1 blends the dry signal back in."}],web:"worklet-compressor"},{id:"limiter",label:"Limiter",group:"dynamics",description:"Peak limiter that follows the signal's level. It has no lookahead, so a fast peak or an inter-sample peak can pass the ceiling; use the true-peak limiter for a delivery limit.",params:[{kind:"number",key:"limit",label:"Ceiling",unit:"dB",min:-24,max:0,step:.1,default:-1},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.1,max:80,step:.1,default:5},{kind:"number",key:"release",label:"Release",unit:"ms",min:1,max:8e3,step:1,default:50,scale:"log"},{kind:"number",key:"level_out",label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0}],web:"worklet-limiter"},{id:"truepeak",label:"True-peak limiter",group:"dynamics",description:"Lookahead limiter that holds a 4x estimate of the inter-sample peak at a dBTP ceiling; full-band noise can land up to about 1.7 dB above it. Adds lookahead plus about 0.3 ms of latency.",params:[{kind:"number",key:"ceiling",label:"Ceiling",unit:"dBTP",min:-24,max:0,step:.1,default:-1,hint:"Target true peak, measured on a 4x oversampled signal. Dense full-band sound can end up to about 1.7 dB above it."},{kind:"number",key:"lookahead",label:"Lookahead",unit:"ms",min:.5,max:10,step:.1,default:3,hint:"How far ahead the gain starts falling. Longer is smoother and adds the same latency."},{kind:"number",key:"release",label:"Release",unit:"ms",min:10,max:2e3,step:1,default:80,scale:"log"}],web:"worklet-truepeak"},{id:"gate",label:"Noise Gate",group:"dynamics",description:"Silence the track when it drops below the threshold.",params:[{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-80,max:0,step:.5,default:-35},{kind:"number",key:"range",label:"Range",unit:"dB",min:-80,max:0,step:.5,default:-24,hint:"How far down the gate pulls when closed."},{kind:"number",key:"ratio",label:"Ratio",unit:":1",min:1,max:20,step:.1,default:10},{kind:"number",key:"attack",label:"Attack",unit:"ms",min:.01,max:9e3,step:.1,default:1,scale:"log"},{kind:"number",key:"release",label:"Release",unit:"ms",min:.01,max:9e3,step:1,default:100,scale:"log"},{kind:"number",key:"knee",label:"Knee",unit:"",min:1,max:8,step:.01,default:2.83}],web:"worklet-gate"},{id:"saturate",label:"Saturation",group:"nonlinear",description:"Soft-clip the waveform for warmth or outright distortion.",params:[{kind:"enum",key:"type",label:"Curve",options:[{value:"tanh",label:"Tanh"},{value:"atan",label:"Arctan"},{value:"cubic",label:"Cubic"},{value:"exp",label:"Exponential"},{value:"alg",label:"Algebraic"},{value:"quintic",label:"Quintic"},{value:"sin",label:"Sine"},{value:"erf",label:"Error function"},{value:"hard",label:"Hard clip"}],default:"tanh"},{kind:"number",key:"threshold",label:"Threshold",unit:"dB",min:-40,max:0,step:.1,default:-6},{kind:"number",key:"output",automatable:!0,label:"Output",unit:"dB",min:-24,max:24,step:.1,default:0},{kind:"number",key:"oversample",label:"Oversample",unit:"x",min:1,max:8,step:1,default:4,hint:"Higher costs more but keeps aliasing down."}],web:"waveshaper"},{id:"bitcrush",label:"Bitcrush",group:"nonlinear",description:"Drop bit depth and sample rate for a lo-fi, digital sound.",params:[{kind:"number",key:"bits",label:"Bit depth",unit:"bit",min:1,max:32,step:.1,default:8},{kind:"number",key:"samples",label:"Sample hold",unit:"x",min:1,max:250,step:1,default:1,hint:"Repeats each sample N times, a crude downsample."},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-bitcrush"},{id:"pitchshift",label:"Pitch shift",group:"time",description:"Shifts pitch up or down without changing playback speed. Adds ~50 ms of latency.",params:[{kind:"number",key:"semitones",label:"Semitones",unit:"st",min:-12,max:12,step:1,default:0},{kind:"number",key:"mix",label:"Mix",unit:"",min:0,max:1,step:.01,default:1}],web:"worklet-pitchshift"},{id:"delay",label:"Delay",group:"time",description:"Repeating echoes behind the dry signal.",params:[{kind:"number",key:"time",automatable:!0,label:"Time",unit:"ms",min:1,max:5e3,step:1,default:250,scale:"log"},{kind:"number",key:"feedback",automatable:!0,label:"Feedback",unit:"",min:.01,max:.95,step:.01,default:.35},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.4}],web:"delay-feedback"},{id:"chorus",label:"Chorus",group:"time",description:"Detuned copies of the signal for width and thickness.",params:[{kind:"number",key:"delay",automatable:!0,label:"Delay",unit:"ms",min:1,max:100,step:.1,default:7},{kind:"number",key:"depth",automatable:!0,label:"Depth",unit:"ms",min:0,max:10,step:.01,default:2},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.01,max:10,step:.01,default:1},{kind:"number",key:"mix",automatable:!0,label:"Mix",unit:"",min:0,max:1,step:.01,default:.5}],web:"chorus-lfo"},{id:"phaser",label:"Phaser",group:"time",description:"Sweeping notches moving through the spectrum.",params:[{kind:"number",key:"in_gain",automatable:!0,label:"Input",unit:"",min:0,max:1,step:.01,default:.4},{kind:"number",key:"out_gain",automatable:!0,label:"Output",unit:"",min:0,max:2,step:.01,default:.74},{kind:"number",key:"delay",label:"Delay",unit:"ms",min:.1,max:5,step:.1,default:3},{kind:"number",key:"decay",label:"Decay",unit:"",min:0,max:.99,step:.01,default:.4},{kind:"number",key:"speed",automatable:!0,label:"Rate",unit:"Hz",min:.1,max:2,step:.01,default:.5},{kind:"enum",key:"type",label:"Waveform",options:[{value:"0",label:"Triangular"},{value:"1",label:"Sinusoidal"}],default:"0"}],web:"allpass-phaser"},{id:"reverb",label:"Reverb",group:"time",description:"Room tail. Both ends convolve the same generated impulse, so preview matches render.",params:[{kind:"number",key:"size",label:"Room size",unit:"",min:.05,max:1,step:.01,default:.7},{kind:"number",key:"damping",label:"Damping",unit:"",min:0,max:1,step:.01,default:.5,hint:"Higher rolls the top off the tail faster."},{kind:"number",key:"wet",automatable:!0,label:"Wet",unit:"",min:0,max:1,step:.01,default:.35},{kind:"number",key:"dry",automatable:!0,label:"Dry",unit:"",min:0,max:1,step:.01,default:.7}],web:"convolver"}],fo=new Map(Wt.map(t=>[t.id,t]));var ho=Wt.map(t=>t.id);function fi(t){return 10**(t/20)}var $t=fi(12);var nt="data-automation",To=nt.slice(5),tt=1,bi=512,D=class extends Error{constructor(e){super(e),this.name="AudioAutomationError"}},we="volume",xe="rate";function Gt(t){if(t===we)return{kind:"volume"};if(t===xe)return{kind:"rate"};let e=t.split(".");if(e.length===3&&e[0]==="fx"&&e[1]===gi){let r=e[2];return r?{kind:"preset",presetId:r}:null}if(e.length!==3||e[0]!=="fx")return null;let[,n,i]=e;return!n||!i?null:{kind:"fx",nodeId:n,param:i}}var gi="preset";var _i={min:0,max:$t,step:.01,unit:"",label:"Volume",scale:"linear",default:1};var yi={min:Q,max:ee,step:.05,unit:"x",label:"Speed",scale:"log",default:1};function ne(t){if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"&&t.trim()!==""){let e=Number(t);return Number.isFinite(e)?e:null}return null}function vi(t){let e=ne(t);return e===null||e===0?0:Math.min(1,Math.max(-1,e))}function zt(t,e){let n=ne(t),i=ne(e);if(n===null||i===null)return null;let r=s=>Math.min(.999,Math.max(.001,s)),o=r(n),a=r(i);return Math.abs(o-a)<1e-6?null:{x:o,y:a}}function Ai(t){let e=vi(t?.curve),n=zt(t?.viaX,t?.viaY);return{...e?{curve:e}:{},...n?{viaX:n.x,viaY:n.y}:{}}}function Si(t,e){let n=ne(t?.t),i=ne(t?.v);if(n===null||i===null)return null;let r=e?Math.min(e.max,Math.max(e.min,i)):i;return{t:Math.max(0,n),v:r,...Ai(t)}}function Ei(t,e){let n=t.map(r=>Si(r,e)).filter(r=>r!==null).sort((r,o)=>r.t-o.t),i=[];for(let r of n)i.length>0&&i[i.length-1].t===r.t?i[i.length-1]=r:i.push(r);return i.slice(0,bi)}function Ti(t){let e=[];for(let n of t.lanes){if(!Gt(n.target))continue;let i=n.target===we?_i:n.target===xe?yi:null,r=Ei(n.points??[],i);r.length>0&&e.push({target:n.target,points:r})}return{version:tt,lanes:e}}function qt(t){let e;try{e=JSON.parse(t)}catch(r){throw new D(`Automation is not valid JSON: ${r.message}`)}if(typeof e!="object"||e===null)throw new D("Automation must be a JSON object.");let n=e;if(n.version!==tt)throw new D(`Unsupported automation version: ${String(n.version)}`);if(!Array.isArray(n.lanes))throw new D("Automation is missing a `lanes` array.");let i=n.lanes.map((r,o)=>{if(typeof r!="object"||r===null)throw new D(`Lane ${o} is not an object.`);let a=r;if(typeof a.target!="string"||!Gt(a.target))throw new D(`Lane ${o} has an unreadable target: ${String(a.target)}`);if(!Array.isArray(a.points))throw new D(`Lane ${o} is missing a \`points\` array.`);return{target:a.target,points:a.points}});return Ti({version:tt,lanes:i})}function Ri(t,e){return e?Math.pow(t,Math.pow(2,2*e)):t}function wi(t,e){let n=t-.5,i=e-.5,r=.999,o=1e6,a=n>0?n/(r-t):n<0?-n/(t-(1-r)):0,s=i>0?i/(r-e):i<0?-i/(e-(1-r)):0,u=Math.min(o,Math.max(1,a,s));return{cx:t+n/u,cy:e+i/u,w:u}}function xi(t,e,n){let{cx:i,cy:r,w:o}=wi(e,n),a=2-2*o,s=t*a-1+2*o*i,u=-t*a-2*o*i,c=ki(s,u,t),m=1-c,b=m*m+2*o*c*m+c*c;return b>0?(2*o*r*c*m+c*c)/b:t}function ki(t,e,n){if(Math.abs(t)<1e-12)return Math.abs(e)<1e-12?n:-n/e;let i=Math.sqrt(Math.max(0,e*e-4*t*n)),r=(-e+i)/(2*t),o=(-e-i)/(2*t),a=s=>s>=-1e-9&&s<=1+1e-9;return a(r)?Math.min(1,Math.max(0,r)):a(o)?Math.min(1,Math.max(0,o)):n}function Mi(t,e){let n=zt(e.viaX,e.viaY);return n?xi(Math.min(1,Math.max(0,t)),n.x,n.y):Ri(t,e.curve)}function Ii(t,e,n,i){return i==="log"&&t>0&&e>0?Math.exp(Math.log(t)+(Math.log(e)-Math.log(t))*n):t+(e-t)*n}function ke(t,e,n="linear"){let i=t.points;if(i.length===0)return 0;let r=i[0];if(e<=r.t)return r.v;let o=i[i.length-1];if(e>=o.t)return o.v;let a=0,s=i.length-1;for(;s-a>1;){let b=a+s>>1;i[b].t<=e?a=b:s=b}let u=i[a],c=i[s],m=c.t-u.t;return m<=0?c.v:Ii(u.v,c.v,Mi((e-u.t)/m,u),n)}var Me=new Map,Di=64;function jt(t,e=we){let n=`${e}\0${t}`,i=Me.get(n);if(i!==void 0)return i;let r=null;try{r=qt(t).lanes.find(o=>o.target===e)??null}catch{r=null}return Me.size>Di&&Me.clear(),Me.set(n,r),r}var Yt=48,Xt=new WeakMap;function Ci(t){let e=t.points,n=e[0].v,i=e[e.length-1].v,r=[0],o=[0],a=u=>{let c=r[r.length-1];if(u<=c)return;let m=ke(t,c,"log");r.push(u),o.push(o[o.length-1]+(m+ke(t,u,"log"))/2*(u-c))},s=Math.max(0,e[0].t);a(s);for(let u=1;u<e.length;u+=1){let c=e[u-1].t,m=e[u].t;if(!(m<=0))for(let b=1;b<=Yt;b+=1)a(Math.max(c,0)+(m-c)*b/Yt)}return{ts:Float64Array.from(r),ss:Float64Array.from(o),firstRate:n,lastRate:i}}function Pi(t){let e=Xt.get(t);return e||(e=Ci(t),Xt.set(t,e)),e}function Ni(t){return typeof t!="number"&&t.points.length>0}function Li(t,e,n){let i=0,r=t.length-1;for(;r-i>1;){let o=i+r>>1;t[o]<=n?i=o:r=o}return e[i]+(e[r]-e[i])*(n-t[i])/(t[r]-t[i])}function it(t,e){if(typeof t=="number")return e/t;if(!Ni(t))return e;let{ts:n,ss:i,firstRate:r,lastRate:o}=Pi(t),a=n.length-1;return e<=0?e/r:e>=i[a]?n[a]+(e-i[a])/o:Li(i,n,e)}function Oi(t){return t?jt(t,xe):null}function Kt(t,e){return Oi(t)??e}var Do=[{id:"montage",label:"Montage",points:[[0,.9],[.15,.3],[.5,2.5],[.85,.3],[1,.9]]},{id:"hero",label:"Hero",points:[[0,1],[.25,1.6],[.5,.25],[.75,1.6],[1,1]]},{id:"bullet",label:"Bullet",points:[[0,3],[.4,3],[.5,.15],[.6,3],[1,3]]},{id:"jump-cut",label:"Jump cut",points:[[0,.5],[.24,.5],[.26,3],[.5,3],[.52,.5],[.74,.5],[.76,3],[1,3]]},{id:"flash-in",label:"Flash in",points:[[0,.3],[.6,.6],[1,5]]},{id:"flash-out",label:"Flash out",points:[[0,5],[.4,.6],[1,.3]]},{id:"ramp-in",label:"Ramp in",points:[[0,.5],[1,1]]},{id:"ramp-out",label:"Ramp out",points:[[0,1],[1,.5]]},{id:"slowmo-middle",label:"Slow-mo middle",points:[[0,1],[1/3,.35],[2/3,.35],[1,1]]}];var y=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),Po=Object.freeze([y.start,y.duration,y.trackIndex]),No=Object.freeze([y.derivedEnd]),Lo=Object.freeze([y.derivedEnd,y.legacyTrack]);function C(t){if(t==null||t.trim()==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}var Qt=/^[A-Za-z0-9_.:-]+$/;function en(t,e){let n=t.charCodeAt(e);return n>=48&&n<=57}function Jt(t,e){let n=e;for(;n>=0&&en(t,n);)n--;return n}function Fi(t,e){let n=e;for(;n>=0&&(t[n]??"").trim()==="";)n--;return n}function Vi(t){let e=t.length-1;if(!en(t,e))return null;let n=Jt(t,e);return t[n]==="."&&(n=Jt(t,n-1)),n+1}function Ui(t){let e=Vi(t);if(e==null)return null;let n=Fi(t,e-1),i=t[n];if(i!=="+"&&i!=="-")return null;let r=t.slice(0,n).trim();if(!Qt.test(r))return null;let o=Number(t.slice(e));return Number.isFinite(o)?{refId:r,operator:i,magnitude:o}:null}function ie(t){let e=(t??"").trim();if(!e)return null;let n=C(e);if(n!=null)return{kind:"absolute",value:n};if(Qt.test(e))return{kind:"reference",refId:e,offset:0};let i=Ui(e);return i?{kind:"reference",refId:i.refId,offset:i.operator==="-"?-i.magnitude:i.magnitude}:null}function w(t,e,n,i){t.push({code:e,attribute:n,value:i})}function Hi(t,e,n,i){if(e==null||e.trim()==="")return n.defaultStart===void 0?0:n.defaultStart;if(!t)return w(i,"invalid-start",y.start,e),null;if(t.kind==="absolute")return Math.max(0,t.value);let r=n.resolveReferenceEnd?.(t.refId);return r==null||!Number.isFinite(r)?(w(i,"unresolved-start-reference",y.start,e),null):Math.max(0,r+t.offset)}var Wi=1e-9;function $i(t,e){return Math.abs(t-e)<=Wi}function Bi(t,e,n){let i=C(t);if(i==null){w(n,"deprecated-end",y.derivedEnd,t),w(n,"invalid-end",y.derivedEnd,t);return}if(e==null){w(n,"deprecated-end",y.derivedEnd,t);return}$i(i,e)||(w(n,"deprecated-end",y.derivedEnd,t),w(n,"conflicting-end",y.derivedEnd,t))}function Gi(t,e,n){let i=C(t);return i==null||i<0?(w(n,"invalid-duration",y.duration,t),{duration:null,end:null,durationSource:"invalid"}):{duration:i,end:e==null?null:e+i,durationSource:"duration"}}function zi(t,e,n){w(n,"deprecated-end",y.derivedEnd,t);let i=C(t);return i==null?(w(n,"invalid-end",y.derivedEnd,t),{duration:null,end:null,durationSource:"invalid"}):e==null?{duration:null,end:i,durationSource:"legacy-end"}:i<e?(w(n,"end-before-start",y.derivedEnd,t),{duration:null,end:null,durationSource:"invalid"}):{duration:i-e,end:i,durationSource:"legacy-end"}}function qi(t,e,n){let i=t.getAttribute(y.duration),r=t.getAttribute(y.derivedEnd);if(i==null)return r==null?{duration:null,end:null,durationSource:"missing"}:zi(r,e,n);let o=Gi(i,e,n);return r!=null&&Bi(r,o.end,n),o}function Zt(t,e,n,i){let r=C(t);return r==null||!Number.isInteger(r)?(w(i,"invalid-track-index",e,t),{trackIndex:0,trackSource:"invalid"}):{trackIndex:r,trackSource:n}}function ji(t,e){let n=t.getAttribute(y.trackIndex),i=t.getAttribute(y.legacyTrack);if(n==null&&i==null)return{trackIndex:0,trackSource:"default"};if(n==null&&i!=null)return w(e,"deprecated-layer",y.legacyTrack,i),Zt(i,y.legacyTrack,"legacy-layer",e);let r=Zt(n??"",y.trackIndex,"track-index",e);if(i==null)return r;w(e,"deprecated-layer",y.legacyTrack,i);let o=C(i);return o!=null&&o!==r.trackIndex&&w(e,"conflicting-layer",y.legacyTrack,i),r}function rt(t,e={}){let n=[],i=t.getAttribute(y.start),r=ie(i),o=Hi(r,i,e,n),a=qi(t,o,n),s=ji(t,n);return{startExpression:r,start:o,...a,...s,diagnostics:n}}function P(t){return C(t)}function re(t){return Ft(e=>t.getAttribute(e),I(t)?t.defaultPlaybackRate:1)}function ot(t){return Kt(t.getAttribute("data-automation"),re(t))}function Ie(t){return Ot(e=>t.getAttribute(e))}function $(t,e){return Yi(e,Ie(t),ot(t))}function at(t){let e=Qe({tag:"video",authoredDurationSeconds:Je(n=>t.getAttribute(n)),sourceDurationSeconds:Number.isFinite(t.duration)?t.duration:null,mediaStartSeconds:Ie(t),playbackRate:re(t)});return e.source==="media"?$(t,t.duration):e.seconds}function De(t,e=0){return!Ye(t)||!t.hasAttribute("data-start")&&!t.hasAttribute("data-track-index")?null:Qe({tag:"img",authoredDurationSeconds:Vt(n=>t.getAttribute(n),e),sourceDurationSeconds:null,mediaStartSeconds:0,playbackRate:1}).seconds}function Yi(t,e,n){return typeof n=="number"?Ze(t,e,n):Number.isFinite(t)?it(n,Math.max(0,t-e)):null}function tn(){return globalThis}function B(t,e){if(typeof window>"u")return;let n=tn(),i=n.__hf?.onSwallowed;if(i)try{i({label:t,error:e})}catch(r){}(n.__hfDebug||n.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${t} swallowed:`,e)}var Xi=t=>t.paused?.()===!0?(t.startTime?.()??0)+(t.totalDuration?.()??0)/Math.abs(t.timeScale?.()||1):0;function oe(t){try{if(typeof t?.duration!="function")return null;let e=t.getChildren?.(!1,!1,!0),n=Array.isArray(e)?e:[],i=Math.max(Number(t.duration()),...n.map(Xi));return Number.isFinite(i)?i:null}catch(e){return B("runtime.timelineDuration",e),null}}var nn="data-hf-authored-duration",rn="data-hf-authored-end";function ae(t){if(t==null||typeof t=="string"&&t.trim()==="")return null;let e=typeof t=="number"?t:Number(t);return Number.isFinite(e)?e:null}function Ce(t){let e=ae(t.start);if(e==null)return null;let n=Math.max(0,e),i=ae(t.duration),r=ae(t.authoredDuration),o=i!=null&&i>0?i:r!=null&&r>0?r:null;if(o!=null)return{start:n,duration:o,end:n+o};let a=ae(t.end),s=ae(t.authoredEnd),u=a!=null&&a>n?a:s!=null&&s>n?s:null;return{start:n,duration:u==null?null:u-n,end:u}}var G=Object.freeze({start:"data-start",duration:"data-duration",trackIndex:"data-track-index",derivedEnd:"data-end",legacyTrack:"data-layer"}),Ko=Object.freeze([G.start,G.duration,G.trackIndex]),Jo=Object.freeze([G.derivedEnd]),Zo=Object.freeze([G.derivedEnd,G.legacyTrack]);function Ki(t){if(t==null||t.trim()==="")return null;let e=Number(t);return Number.isFinite(e)?e:null}var on=t=>{let e=Ki(t);return e!==null&&e>=0?e:null};function Ji(t){return on(t("data-playback-start"))??on(t("data-media-start"))??0}var an="data-hf-media-start-basis";function sn(t){return t?.trim().toLowerCase()==="global"?"global":"local"}function Zi(t){return sn(t.basis)==="global"?t.authoredStart:t.hostStart+t.authoredStart}function un(t){return dn(t)?Zi({authoredStart:t.authoredStart,hostStart:t.hostStart,basis:t.basis}):t.ordinaryStart()}function ln(t){return dn(t)&&sn(t.basis)==="global"}function dn(t){return!t.hasAutoStart&&t.authoredStart!=null&&t.hostStart!==0}function st(t){return Ji(e=>t.getAttribute(e))}function cn(t,e){return t-st(e)}function V(t){let e=t.timelineRegistry??{},n=t.includeAuthoredTimingAttrs??!1,i=t.documentRef??document,r=new WeakMap,o=new WeakMap,a=new Set,s=l=>(l.hasAttribute("data-composition-id")?l.parentElement:l)?.closest("[data-composition-id]")??null,u=(l,f)=>{let _=s(f);if(_){for(let k of _.querySelectorAll(`[id="${l}"]`))if(s(k)===_)return k}let R=i.getElementById(l);return R||(Array.from(i.querySelectorAll("[data-composition-id]")).find(k=>k.getAttribute("data-composition-id")===l)??null)},c=(l,f)=>n?l.getAttribute(f):null,m=l=>Ce({start:0,duration:l.getAttribute("data-duration"),authoredDuration:c(l,"data-hf-authored-duration")})?.duration??Ce({start:T(l,0),end:l.getAttribute("data-end"),authoredEnd:c(l,"data-hf-authored-end")})?.duration??null,b=l=>l!=null&&Number.isFinite(l)&&l>0?l:null,v=l=>{let f=l.getAttribute("data-composition-id");return f?b(oe(e[f])):null},g=l=>{let f=o.get(l);if(f!==void 0)return f;let _=m(l)??b(I(l)?$(l,l.duration):null)??b(De(l))??v(l);return o.set(l,_),_},A=l=>l.hasAttribute("data-composition-src")||l.hasAttribute("data-composition-id")||l.hasAttribute("data-composition-file"),h=l=>{let f=l.parentElement;return!f||!l.hasAttribute("data-composition-id")||ie(l.getAttribute("data-start"))?null:A(f)?f:null},E=(l,f)=>cn(T(l,f),h(l)??l),M=(l,f)=>{let _=l.hasAttribute("data-composition-id")?l.parentElement?.closest("[data-composition-id]"):l.closest("[data-composition-id]");return _?E(_,f):0},N=(l,f)=>{let _=ie(l.getAttribute("data-start"));if(!_){let Z=h(l);return Z?T(Z,f):f}if(_.kind==="absolute")return M(l,f)+Math.max(0,_.value);let R=u(_.refId,l);if(!R)return f;let k=T(R,0),_e=g(R)??0,ye=Math.min(0,M(l,0));return Math.max(ye,k+_e+_.offset)},T=(l,f)=>{let _=r.get(l);if(_!==void 0)return _??f;if(a.has(l))return f;a.add(l);try{let R=N(l,f);return r.set(l,R),R}finally{a.delete(l)}},L=l=>{let f=l.closest("[data-composition-id]");return{authoredStart:P(l.getAttribute("data-start")),hostStart:f?E(f,0):0,hasAutoStart:l.hasAttribute("data-hf-auto-start"),basis:l.getAttribute(an)}};return{resolveStartForElement:(l,f=0)=>T(l,Math.max(0,f)),resolveDurationForElement:l=>g(l),resolveMediaStartForElement:l=>{let f=L(l);return un({...f,ordinaryStart:()=>T(l,f.hostStart)})},resolveHostStartForElement:l=>M(l,0),resolveHostSlotsForElement:l=>{let f=[];for(let _=l.parentElement;_;_=_.parentElement){if(!A(_)||h(_)||st(_)<=0)continue;let R=T(_,0),k=m(_);f.push({start:R,end:k?R+k:1/0})}return f},isRootGlobalMediaStartForElement:l=>I(l)&&ln(L(l))}}function mn(){return{capturedTimeline:null,isPlaying:!1,currentTime:0,deterministicAdapters:[],canonicalFps:30,bridgeMuted:!1,bridgeVolume:1,mediaOutputMuted:!1,nativeMediaSyncDisabled:!1,webAudioMediaDisabled:!1,mediaAutoplayBlockedPosted:!1,mediaForceSyncNextTick:!1,playbackRate:1,bridgeLastPostedFrame:-1,bridgeLastPostedAt:0,bridgeLastPostedPlaying:!1,bridgeLastPostedMuted:!1,bridgeMaxPostIntervalMs:80,controlBridgeHandler:null,beforeUnloadHandler:null,injectedCompStyles:[],injectedCompScripts:[],injectedCompLinks:[],cachedTimedMediaEls:[],cachedMediaClips:[],cachedVideoClips:[],cachedMediaTimelineDurationSeconds:0,tornDown:!1,transportClock:null,transportRafId:null}}var pn=7200,ut=1/60,se=t=>t!==null&&t>ut?t:null;function Qi(t){return{width:Ee(t.getAttribute("data-width")),height:Ee(t.getAttribute("data-height"))}}function er(t,e){let n=[];for(let i of t.querySelectorAll("video[data-start], audio[data-start]")){let r=e.mediaStart(i);if(!Number.isFinite(r))continue;let o=e.mediaDuration(i);o==null||o<=ut||n.push(Math.max(0,r)+o)}return se(Se({authoredDurationSeconds:null,clipEndsSeconds:n}).seconds)}function tr(t,e){let n=[];for(let r of t.querySelectorAll("[data-composition-id][data-start]")){if(r.parentElement?.closest("[data-composition-id]")!==t)continue;let o=e.resolveStartForElement(r,0),a=e.resolveDurationForElement(r);!Number.isFinite(o)||a==null||a<=0||n.push(Math.max(0,o)+a)}let i=P(t.getAttribute("data-duration"));return se(Se({authoredDurationSeconds:null,clipEndsSeconds:[i,...n]}).seconds)}var nr=t=>t.hasAttribute("data-composition-id")||t.hasAttribute("data-composition-src");function ir(t,e,{unregisteredLottie:n}){let i=[];for(let o of t.querySelectorAll("[data-start]")){let a=e.resolveStartForElement(o,0);if(!Number.isFinite(a))continue;let s=e.resolveDurationForElement(o);s!=null?i.push(Math.max(0,a)+s):(I(o)||nr(o))&&i.push(null)}(n||t.querySelector("[data-lottie-src]"))&&i.push(null);let r=Se({authoredDurationSeconds:null,clipEndsSeconds:i});return r.pendingClips>0?{...r,seconds:null,source:"unresolved",reason:"a clip's length is pending"}:r}function rr(t){if(t.declared!==null&&Number.isFinite(t.declared)&&t.declared>0)return t.declared;let e=se(t.timeline()),n=Math.max(0,...t.floors().map(u=>u??0)),i=Number.isFinite(t.fallback)&&t.fallback>ut?t.fallback:0,r=Math.max(n,i),a=e!==null&&e>=pn&&se(r)!==null?null:e,s;return a!==null?s=Math.max(a,r):se(n)!==null?s=r:i>0?s=i:s=t.derived(),s>0?s:0}function fn(t){let e=Te(t);if(!e)return null;let n=V({timelineRegistry:{},includeAuthoredTimingAttrs:!0,documentRef:t}),i=rr({declared:P(e.getAttribute("data-duration")),timeline:()=>null,floors:()=>[er(t,{mediaStart:n.resolveMediaStartForElement,mediaDuration:at}),tr(e,n)],fallback:0,derived:()=>ir(e,n,{unregisteredLottie:!1}).seconds??0});return{...Qi(e),fps:mn().canonicalFps,durationSeconds:i}}var Pe="hyperframes-studio-preview";var hn="data-hf-upcoming";var bn="__hfPreviewErrors";var gn="data-hf-autostamped";function _n(t){return t.hasRuntime||t.runtimeInjected?!1:!!(t.hasNestedCompositions||t.hasTimelines&&t.attempts>=5)}function z(t){return typeof t=="object"&&t!==null}function yn(t){return z(t)&&typeof t.getDuration=="function"}function vn(t){return z(t)&&typeof t.duration=="function"&&typeof t.time=="function"&&typeof t.seek=="function"&&typeof t.play=="function"&&typeof t.pause=="function"}var q="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.8.196/dist/hyperframe.runtime.iife.js";function ue(t){if(t===null)return null;let e=Number.parseInt(t,10);return Number.isFinite(e)&&e>0?e:null}function or(t){let e=t?.querySelector("[data-composition-id][data-width][data-height]")??t?.querySelector("[data-width][data-height]");if(!e)return null;let n=ue(e.getAttribute("data-width")),i=ue(e.getAttribute("data-height"));return n!==null&&i!==null?{width:n,height:i}:null}function ar(t){return Array.isArray(t)?t.find(e=>typeof e=="string"&&e.trim()!==""&&e!=="[object Event]")??null:null}var Ne=class{constructor(e,n){this._iframe=e;this._callbacks=n}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;_runtimeScript=null;_failure=null;get failed(){return this._failure!==null&&this._failure.document===this._iframe.contentDocument}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._failure=null,this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;let n=null;try{n=this._poll(e)}catch(i){i instanceof DOMException&&i.name==="SecurityError"||(n={kind:"error",message:i instanceof Error?i.message:String(i)})}n??=this._deadlineOutcome(e),n&&(this.stop(),n.kind==="error"?(this._failure={document:this._iframe.contentDocument},this._callbacks.onError(n.message)):this._callbacks.onReady(n.result))},200)}_deadlineOutcome(e){return e<40||this._callbacks.hostOwnsDeadline?.()?null:{kind:"error",message:"Composition timeline not found after 8s"}}_poll(e){let n=this._iframe.contentWindow;if(!n)return null;let i=ar(Reflect.get(n,bn));if(i!==null)return{kind:"error",message:i};let r=this._iframe.contentDocument,o=Reflect.get(n,"__timelines"),a=this.hasRuntimeBridge(n);if(_n({hasRuntime:a,hasTimelines:z(o)&&Object.keys(o).length>0,hasNestedCompositions:!!r?.querySelector("[data-composition-src]"),runtimeInjected:this._runtimeInjected,attempts:e}))return this._injectRuntime(),null;if(this._runtimeInjected&&!a)return null;let s=this._resolveReadyResult(n,r);return s?{kind:"ready",result:s}:null}_resolveReadyResult(e,n){let i=this._resolvePlaybackDurationAdapter(e)??{kind:"document",getDuration:()=>0},r=i.getDuration();if(!Number.isFinite(r)||r<=0){if(i.kind==="direct-timeline")return null;r=n?fn(n)?.durationSeconds??0:0}return r<=0?null:{duration:r,adapter:{...i,getDuration:()=>r},compositionSize:or(n)}}stop(){this._runtimeScript&&(this._runtimeScript.onerror=null,this._runtimeScript=null),this.failed||(this._failure=null),this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return z(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let n=e.createElement("script");n.src=this._callbacks.resolveRuntimeUrl?.()??q,this._runtimeScript=n,n.onerror=()=>{this._runtimeScript!==n||this._iframe.contentDocument!==e||(this.stop(),this._failure={document:e},this._callbacks.onError("Framey runtime failed to load from "+n.src))},(e.head||e.documentElement).appendChild(n),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let n=Reflect.get(e,"__timelines");if(!z(n))return null;let i=Object.keys(n);if(i.length===0)return null;let r=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=r&&r in n?r:i[i.length-1],a=n[o];return vn(a)?a:null}_resolvePlaybackDurationAdapter(e){let n=Reflect.get(e,"__player");if(yn(n))return{kind:"runtime",getDuration:()=>n.getDuration()};let i=this._resolveDirectTimelineAdapterFromWindow(e);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}};var An=`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
position: relative;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
background: #000;
|
|
7
|
+
contain: layout style;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* The only in-flow child: with no height set, the player takes the composition's shape. */
|
|
11
|
+
.hfp-sizer {
|
|
12
|
+
aspect-ratio: 16 / 9;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.hfp-container {
|
|
16
|
+
position: absolute;
|
|
17
|
+
inset: 0;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
.hfp-iframe {
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 50%;
|
|
26
|
+
left: 50%;
|
|
27
|
+
border: none;
|
|
28
|
+
pointer-events: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Opt-in: an interactive composition (e.g. a live slideshow/app with playable
|
|
32
|
+
media or controls): let pointer events reach the iframe content. */
|
|
33
|
+
:host([interactive]) .hfp-container,
|
|
34
|
+
:host([interactive]) .hfp-iframe {
|
|
35
|
+
pointer-events: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.hfp-video {
|
|
39
|
+
position: absolute;
|
|
40
|
+
inset: 0;
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
43
|
+
object-fit: contain;
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.hfp-poster {
|
|
48
|
+
position: absolute;
|
|
49
|
+
inset: 0;
|
|
50
|
+
object-fit: contain;
|
|
51
|
+
z-index: 1;
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.hfp-shader-loader {
|
|
56
|
+
position: absolute;
|
|
57
|
+
inset: 0;
|
|
58
|
+
z-index: 20;
|
|
59
|
+
display: grid;
|
|
60
|
+
place-items: center;
|
|
61
|
+
visibility: hidden;
|
|
62
|
+
opacity: 0;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
background: #030504;
|
|
65
|
+
color: #f4f7fb;
|
|
66
|
+
cursor: default;
|
|
67
|
+
user-select: none;
|
|
68
|
+
-webkit-user-select: none;
|
|
69
|
+
transition: opacity 420ms ease-out, visibility 420ms ease-out;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.hfp-shader-loader.hfp-visible,
|
|
73
|
+
.hfp-shader-loader.hfp-hiding {
|
|
74
|
+
visibility: visible;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.hfp-shader-loader.hfp-visible {
|
|
78
|
+
opacity: 1;
|
|
79
|
+
pointer-events: auto;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.hfp-shader-loader.hfp-hiding {
|
|
83
|
+
opacity: 0;
|
|
84
|
+
pointer-events: none;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.hfp-shader-loader-panel {
|
|
88
|
+
display: grid;
|
|
89
|
+
grid-template-rows: 86px 40px 26px 12px 44px;
|
|
90
|
+
justify-items: center;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: 8px;
|
|
93
|
+
width: min(620px, 82%);
|
|
94
|
+
text-align: center;
|
|
95
|
+
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.hfp-shader-loader-mark {
|
|
99
|
+
width: 86px;
|
|
100
|
+
height: 86px;
|
|
101
|
+
display: grid;
|
|
102
|
+
place-items: center;
|
|
103
|
+
overflow: visible;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.hfp-shader-loader-mark svg {
|
|
107
|
+
display: block;
|
|
108
|
+
overflow: visible;
|
|
109
|
+
filter: drop-shadow(0 0 5px rgba(79, 219, 94, 0.16));
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.hfp-shader-loader-title {
|
|
114
|
+
width: 100%;
|
|
115
|
+
height: 40px;
|
|
116
|
+
overflow: hidden;
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
text-overflow: ellipsis;
|
|
119
|
+
font-size: 26px;
|
|
120
|
+
line-height: 40px;
|
|
121
|
+
font-weight: 700;
|
|
122
|
+
letter-spacing: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.hfp-shader-loader-title-text {
|
|
126
|
+
color: transparent;
|
|
127
|
+
background: linear-gradient(
|
|
128
|
+
90deg,
|
|
129
|
+
rgba(244, 247, 251, 0.84) 0%,
|
|
130
|
+
#ffffff 42%,
|
|
131
|
+
#80efe4 52%,
|
|
132
|
+
#ffffff 62%,
|
|
133
|
+
rgba(244, 247, 251, 0.84) 100%
|
|
134
|
+
);
|
|
135
|
+
background-size: 220% 100%;
|
|
136
|
+
-webkit-background-clip: text;
|
|
137
|
+
background-clip: text;
|
|
138
|
+
animation: hfp-shader-loader-sheen 1.9s linear infinite;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.hfp-shader-loader:not(.hfp-visible):not(.hfp-hiding) .hfp-shader-loader-title-text {
|
|
142
|
+
animation-play-state: paused;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.hfp-shader-loader-detail {
|
|
146
|
+
width: 100%;
|
|
147
|
+
height: 26px;
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
white-space: nowrap;
|
|
150
|
+
text-overflow: ellipsis;
|
|
151
|
+
color: rgba(244, 247, 251, 0.62);
|
|
152
|
+
font-size: 15px;
|
|
153
|
+
line-height: 26px;
|
|
154
|
+
font-weight: 500;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.hfp-shader-loader-track {
|
|
158
|
+
width: min(360px, 100%);
|
|
159
|
+
height: 8px;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
border-radius: 999px;
|
|
162
|
+
background: rgba(255, 255, 255, 0.1);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.hfp-shader-loader-fill {
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
border-radius: inherit;
|
|
169
|
+
background: linear-gradient(90deg, #06e3fa, #4fdb5e);
|
|
170
|
+
transform: scaleX(0);
|
|
171
|
+
transform-origin: left center;
|
|
172
|
+
transition: transform 160ms ease;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.hfp-shader-loader-progress {
|
|
176
|
+
width: min(420px, 100%);
|
|
177
|
+
height: 44px;
|
|
178
|
+
display: grid;
|
|
179
|
+
grid-template-rows: repeat(2, 22px);
|
|
180
|
+
color: rgba(244, 247, 251, 0.48);
|
|
181
|
+
font: 600 13px/22px "IBM Plex Mono", "SF Mono", "Fira Code", "Courier New", monospace;
|
|
182
|
+
font-variant-numeric: tabular-nums;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.hfp-shader-loader-row {
|
|
186
|
+
display: grid;
|
|
187
|
+
grid-template-columns: minmax(0, 1fr) 74px;
|
|
188
|
+
align-items: center;
|
|
189
|
+
column-gap: 20px;
|
|
190
|
+
width: 100%;
|
|
191
|
+
white-space: nowrap;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.hfp-shader-loader-label {
|
|
195
|
+
min-width: 0;
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
text-align: left;
|
|
198
|
+
text-overflow: ellipsis;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.hfp-shader-loader-value {
|
|
202
|
+
text-align: right;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
@keyframes hfp-shader-loader-sheen {
|
|
206
|
+
from {
|
|
207
|
+
background-position: 140% 0;
|
|
208
|
+
}
|
|
209
|
+
to {
|
|
210
|
+
background-position: -140% 0;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* \u2500\u2500 Theming via CSS custom properties \u2500\u2500
|
|
215
|
+
*
|
|
216
|
+
* Override from outside the shadow DOM:
|
|
217
|
+
* hyperframes-player {
|
|
218
|
+
* --hfp-controls-bg: linear-gradient(transparent, rgba(0,0,0,0.9));
|
|
219
|
+
* --hfp-accent: #ff6b6b;
|
|
220
|
+
* --hfp-font: "Inter", sans-serif;
|
|
221
|
+
* }
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
.hfp-controls {
|
|
225
|
+
position: absolute;
|
|
226
|
+
bottom: 0;
|
|
227
|
+
left: 0;
|
|
228
|
+
right: 0;
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
gap: var(--hfp-controls-gap, 12px);
|
|
232
|
+
padding: var(--hfp-controls-padding, 8px 16px);
|
|
233
|
+
background: var(--hfp-controls-bg, linear-gradient(transparent, rgba(0, 0, 0, 0.7)));
|
|
234
|
+
color: var(--hfp-color, #fff);
|
|
235
|
+
font-family: var(--hfp-font, system-ui, -apple-system, sans-serif);
|
|
236
|
+
font-size: var(--hfp-font-size, 13px);
|
|
237
|
+
z-index: 10;
|
|
238
|
+
pointer-events: auto;
|
|
239
|
+
opacity: 1;
|
|
240
|
+
transition: opacity 0.3s ease;
|
|
241
|
+
user-select: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.hfp-controls.hfp-hidden {
|
|
245
|
+
opacity: 0;
|
|
246
|
+
pointer-events: none;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.hfp-play-btn {
|
|
250
|
+
position: relative;
|
|
251
|
+
background: none;
|
|
252
|
+
border: none;
|
|
253
|
+
color: var(--hfp-color, #fff);
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
padding: 8px;
|
|
256
|
+
display: flex;
|
|
257
|
+
align-items: center;
|
|
258
|
+
justify-content: center;
|
|
259
|
+
width: 40px;
|
|
260
|
+
height: 40px;
|
|
261
|
+
flex-shrink: 0;
|
|
262
|
+
z-index: 10;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.hfp-play-btn:hover {
|
|
266
|
+
opacity: 0.8;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/* Stacked play/pause glyphs that crossfade-morph on toggle (rotate + scale). */
|
|
270
|
+
.hfp-play-btn .hfp-ico {
|
|
271
|
+
position: absolute;
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
justify-content: center;
|
|
275
|
+
transition:
|
|
276
|
+
opacity 200ms ease,
|
|
277
|
+
transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
278
|
+
}
|
|
279
|
+
.hfp-play-btn .hfp-ico-play {
|
|
280
|
+
opacity: 1;
|
|
281
|
+
transform: rotate(0) scale(1);
|
|
282
|
+
}
|
|
283
|
+
.hfp-play-btn .hfp-ico-pause {
|
|
284
|
+
opacity: 0;
|
|
285
|
+
transform: rotate(-90deg) scale(0.4);
|
|
286
|
+
}
|
|
287
|
+
.hfp-play-btn.hfp-playing .hfp-ico-play {
|
|
288
|
+
opacity: 0;
|
|
289
|
+
transform: rotate(90deg) scale(0.4);
|
|
290
|
+
}
|
|
291
|
+
.hfp-play-btn.hfp-playing .hfp-ico-pause {
|
|
292
|
+
opacity: 1;
|
|
293
|
+
transform: rotate(0) scale(1);
|
|
294
|
+
}
|
|
295
|
+
@media (prefers-reduced-motion: reduce) {
|
|
296
|
+
.hfp-play-btn .hfp-ico {
|
|
297
|
+
transition-duration: 0ms;
|
|
298
|
+
transform: none;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.hfp-play-btn svg,
|
|
303
|
+
.hfp-play-btn svg * {
|
|
304
|
+
pointer-events: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.hfp-scrubber {
|
|
308
|
+
flex: 1;
|
|
309
|
+
min-width: 0;
|
|
310
|
+
height: var(--hfp-scrubber-height, 4px);
|
|
311
|
+
background: var(--hfp-scrubber-bg, rgba(255, 255, 255, 0.3));
|
|
312
|
+
border-radius: var(--hfp-scrubber-radius, 2px);
|
|
313
|
+
cursor: pointer;
|
|
314
|
+
position: relative;
|
|
315
|
+
overflow: hidden;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.hfp-scrubber:hover {
|
|
319
|
+
height: var(--hfp-scrubber-height-hover, 6px);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.hfp-progress {
|
|
323
|
+
position: absolute;
|
|
324
|
+
top: 0;
|
|
325
|
+
left: 0;
|
|
326
|
+
height: 100%;
|
|
327
|
+
background: var(--hfp-accent, #fff);
|
|
328
|
+
pointer-events: none;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.hfp-time {
|
|
332
|
+
flex-shrink: 0;
|
|
333
|
+
font-variant-numeric: tabular-nums;
|
|
334
|
+
opacity: 0.9;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.hfp-speed-wrap {
|
|
338
|
+
position: relative;
|
|
339
|
+
flex-shrink: 0;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.hfp-speed-btn {
|
|
343
|
+
background: var(--hfp-speed-btn-bg, rgba(255, 255, 255, 0.15));
|
|
344
|
+
border: none;
|
|
345
|
+
border-radius: var(--hfp-speed-btn-radius, 4px);
|
|
346
|
+
color: var(--hfp-color, #fff);
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
font-family: var(--hfp-font, system-ui, -apple-system, sans-serif);
|
|
349
|
+
font-size: 12px;
|
|
350
|
+
font-variant-numeric: tabular-nums;
|
|
351
|
+
font-weight: 600;
|
|
352
|
+
padding: 4px 8px;
|
|
353
|
+
min-width: 40px;
|
|
354
|
+
text-align: center;
|
|
355
|
+
transition: background 0.15s ease;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.hfp-speed-btn:hover {
|
|
359
|
+
background: var(--hfp-speed-btn-bg-hover, rgba(255, 255, 255, 0.3));
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.hfp-speed-menu {
|
|
363
|
+
position: absolute;
|
|
364
|
+
bottom: calc(100% + 8px);
|
|
365
|
+
right: 0;
|
|
366
|
+
background: var(--hfp-menu-bg, rgba(20, 20, 20, 0.95));
|
|
367
|
+
backdrop-filter: blur(12px);
|
|
368
|
+
-webkit-backdrop-filter: blur(12px);
|
|
369
|
+
border: 1px solid var(--hfp-menu-border, rgba(255, 255, 255, 0.1));
|
|
370
|
+
border-radius: var(--hfp-menu-radius, 8px);
|
|
371
|
+
padding: 4px;
|
|
372
|
+
display: flex;
|
|
373
|
+
flex-direction: column;
|
|
374
|
+
gap: 2px;
|
|
375
|
+
min-width: 80px;
|
|
376
|
+
opacity: 0;
|
|
377
|
+
visibility: hidden;
|
|
378
|
+
transform: translateY(4px);
|
|
379
|
+
transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
|
|
380
|
+
box-shadow: var(--hfp-menu-shadow, 0 8px 24px rgba(0, 0, 0, 0.4));
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.hfp-speed-menu.hfp-open {
|
|
384
|
+
opacity: 1;
|
|
385
|
+
visibility: visible;
|
|
386
|
+
transform: translateY(0);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.hfp-speed-option {
|
|
390
|
+
background: none;
|
|
391
|
+
border: none;
|
|
392
|
+
border-radius: 4px;
|
|
393
|
+
color: var(--hfp-menu-color, rgba(255, 255, 255, 0.7));
|
|
394
|
+
cursor: pointer;
|
|
395
|
+
font-family: var(--hfp-font, system-ui, -apple-system, sans-serif);
|
|
396
|
+
font-size: 13px;
|
|
397
|
+
font-variant-numeric: tabular-nums;
|
|
398
|
+
padding: 6px 12px;
|
|
399
|
+
text-align: left;
|
|
400
|
+
transition: background 0.1s ease, color 0.1s ease;
|
|
401
|
+
white-space: nowrap;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.hfp-speed-option:hover {
|
|
405
|
+
background: var(--hfp-menu-hover-bg, rgba(255, 255, 255, 0.1));
|
|
406
|
+
color: var(--hfp-color, #fff);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.hfp-speed-option.hfp-active {
|
|
410
|
+
color: var(--hfp-accent, #fff);
|
|
411
|
+
font-weight: 600;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.hfp-volume-wrap {
|
|
415
|
+
position: relative;
|
|
416
|
+
flex-shrink: 0;
|
|
417
|
+
display: flex;
|
|
418
|
+
align-items: center;
|
|
419
|
+
gap: 0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.hfp-mute-btn {
|
|
423
|
+
background: none;
|
|
424
|
+
border: none;
|
|
425
|
+
color: var(--hfp-color, #fff);
|
|
426
|
+
cursor: pointer;
|
|
427
|
+
padding: 4px;
|
|
428
|
+
display: flex;
|
|
429
|
+
align-items: center;
|
|
430
|
+
justify-content: center;
|
|
431
|
+
width: 32px;
|
|
432
|
+
height: 32px;
|
|
433
|
+
flex-shrink: 0;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.hfp-mute-btn:hover {
|
|
437
|
+
opacity: 0.8;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.hfp-mute-btn svg,
|
|
441
|
+
.hfp-mute-btn svg * {
|
|
442
|
+
pointer-events: none;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
.hfp-volume-slider-wrap {
|
|
446
|
+
width: 0;
|
|
447
|
+
overflow: hidden;
|
|
448
|
+
transition: width 0.2s ease;
|
|
449
|
+
display: flex;
|
|
450
|
+
align-items: center;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.hfp-volume-wrap:hover .hfp-volume-slider-wrap {
|
|
454
|
+
width: 64px;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.hfp-volume-slider {
|
|
458
|
+
width: 56px;
|
|
459
|
+
height: var(--hfp-scrubber-height, 4px);
|
|
460
|
+
background: var(--hfp-scrubber-bg, rgba(255, 255, 255, 0.3));
|
|
461
|
+
border-radius: var(--hfp-scrubber-radius, 2px);
|
|
462
|
+
cursor: pointer;
|
|
463
|
+
position: relative;
|
|
464
|
+
overflow: hidden;
|
|
465
|
+
margin-left: 4px;
|
|
466
|
+
margin-right: 4px;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.hfp-volume-fill {
|
|
470
|
+
position: absolute;
|
|
471
|
+
top: 0;
|
|
472
|
+
left: 0;
|
|
473
|
+
height: 100%;
|
|
474
|
+
background: var(--hfp-accent, #fff);
|
|
475
|
+
pointer-events: none;
|
|
476
|
+
}
|
|
477
|
+
`,Sn='<svg width="24" height="24" viewBox="46 21 54 56" fill="currentColor"><path d="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z"/></svg>',En='<svg width="24" height="24" viewBox="0 0 18 18" fill="currentColor"><rect x="3" y="2" width="4" height="14"/><rect x="11" y="2" width="4" height="14"/></svg>',lt='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/><path d="M14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/></svg>',dt='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>',Tn='<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M3 9v6h4l5 5V4L7 9H3z"/><path d="M16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z" opacity="0.3"/><line x1="18" y1="7" x2="14" y2="17" stroke="currentColor" stroke-width="2"/></svg>';var ct=[.25,.5,1,1.5,2,4];function U(t){return Number.isInteger(t)?`${t}x`:`${t}x`}function Le(t){if(!Number.isFinite(t)||t<0)return"0:00";let e=Math.floor(t),n=Math.floor(e/60),i=e%60;return`${n}:${i.toString().padStart(2,"0")}`}function Rn(t,e,n={}){let i=n.speedPresets??ct,r=document.createElement("div");r.className="hfp-controls",r.addEventListener("click",d=>{d.stopPropagation()});let o=document.createElement("button");o.className="hfp-play-btn",o.type="button",o.innerHTML=`<span class="hfp-ico hfp-ico-play">${Sn}</span><span class="hfp-ico hfp-ico-pause">${En}</span>`,o.setAttribute("aria-label","Play");let a=document.createElement("div");a.className="hfp-scrubber";let s=document.createElement("div");s.className="hfp-progress",s.style.width="0%",a.appendChild(s);let u=document.createElement("span");u.className="hfp-time",u.textContent="0:00 / 0:00";let c=document.createElement("div");c.className="hfp-speed-wrap";let m=document.createElement("button");m.className="hfp-speed-btn",m.type="button",m.textContent="1x",m.setAttribute("aria-label","Playback speed: 1x");let b=document.createElement("div");b.className="hfp-speed-menu",b.setAttribute("role","menu");for(let d of i){let p=document.createElement("button");p.className="hfp-speed-option",p.type="button",p.setAttribute("role","menuitem"),p.dataset.speed=String(d),p.textContent=U(d),d===1&&p.classList.add("hfp-active"),b.appendChild(p)}c.appendChild(b),c.appendChild(m);let v=document.createElement("div");v.className="hfp-volume-wrap";let g=document.createElement("button");g.className="hfp-mute-btn",g.type="button",g.innerHTML=lt,g.setAttribute("aria-label","Mute");let A=document.createElement("div");A.className="hfp-volume-slider-wrap";let h=document.createElement("div");h.className="hfp-volume-slider",h.setAttribute("role","slider"),h.setAttribute("aria-label","Volume"),h.setAttribute("aria-valuemin","0"),h.setAttribute("aria-valuemax","100"),h.setAttribute("aria-valuenow","100"),h.tabIndex=0;let E=document.createElement("div");E.className="hfp-volume-fill",E.style.width="100%",h.appendChild(E),A.appendChild(h),v.appendChild(A),v.appendChild(g),n.audioLocked&&(v.style.display="none"),r.appendChild(o),r.appendChild(a),r.appendChild(u),r.appendChild(v),r.appendChild(c),t.appendChild(r);let M=!1,N=!1,T=1,L=null,K=i.indexOf(1);K===-1&&(K=0);let J=(d,p)=>d?Tn:p===0?dt:p<.5?dt:lt;o.addEventListener("click",d=>{d.stopPropagation(),M?e.onPause():e.onPlay()}),g.addEventListener("click",d=>{d.stopPropagation(),e.onMuteToggle()});let F=!1,l=d=>{let p=h.getBoundingClientRect(),S=Math.max(0,Math.min(1,(d-p.left)/p.width));T=S,E.style.width=`${S*100}%`,h.setAttribute("aria-valuenow",String(Math.round(S*100))),N&&S>0&&e.onMuteToggle(),g.innerHTML=J(N,S),e.onVolumeChange(S)};h.addEventListener("mousedown",d=>{d.stopPropagation(),F=!0,l(d.clientX)});let f=d=>{F&&l(d.clientX)},_=()=>{F=!1};document.addEventListener("mousemove",f),document.addEventListener("mouseup",_),h.addEventListener("touchstart",d=>{F=!0;let p=d.touches[0];p&&l(p.clientX)},{passive:!0});let R=d=>{if(F){let p=d.touches[0];p&&l(p.clientX)}},k=()=>{F=!1};document.addEventListener("touchmove",R,{passive:!0}),document.addEventListener("touchend",k);let _e=.05;h.addEventListener("keydown",d=>{let p=T;if(d.key==="ArrowRight"||d.key==="ArrowUp")p=Math.min(1,T+_e);else if(d.key==="ArrowLeft"||d.key==="ArrowDown")p=Math.max(0,T-_e);else return;d.preventDefault(),d.stopPropagation(),T=p,E.style.width=`${p*100}%`,h.setAttribute("aria-valuenow",String(Math.round(p*100))),N&&p>0&&e.onMuteToggle(),g.innerHTML=J(N,p),e.onVolumeChange(p)});let ye=d=>{for(let p of b.querySelectorAll(".hfp-speed-option"))p.classList.toggle("hfp-active",p.dataset.speed===String(d))};m.addEventListener("click",d=>{d.stopPropagation();let p=b.classList.toggle("hfp-open");m.setAttribute("aria-expanded",String(p))}),b.addEventListener("click",d=>{d.stopPropagation();let p=d.target.closest(".hfp-speed-option");if(!p)return;let S=parseFloat(p.dataset.speed);K=i.indexOf(S),m.textContent=U(S),m.setAttribute("aria-label",`Playback speed: ${U(S)}`),ye(S),b.classList.remove("hfp-open"),m.setAttribute("aria-expanded","false"),e.onSpeedChange(S)});let Z=()=>{b.classList.remove("hfp-open"),m.setAttribute("aria-expanded","false")};document.addEventListener("click",Z);let ve=d=>{let p=a.getBoundingClientRect(),S=Math.max(0,Math.min(1,(d-p.left)/p.width));e.onSeek(S)},O=!1;a.addEventListener("mousedown",d=>{d.stopPropagation(),O=!0,e.onScrubStart?.(),ve(d.clientX)});let wt=d=>{O&&ve(d.clientX)},xt=()=>{O&&(O=!1,e.onScrubEnd?.())};document.addEventListener("mousemove",wt),document.addEventListener("mouseup",xt),a.addEventListener("touchstart",d=>{O=!0,e.onScrubStart?.();let p=d.touches[0];p&&ve(p.clientX)},{passive:!0});let kt=d=>{if(O){let p=d.touches[0];p&&ve(p.clientX)}},Mt=()=>{O&&(O=!1,e.onScrubEnd?.())};document.addEventListener("touchmove",kt,{passive:!0}),document.addEventListener("touchend",Mt);let It=()=>{L&&clearTimeout(L),L=setTimeout(()=>{M&&r.classList.add("hfp-hidden")},3e3)},Ae=t instanceof ShadowRoot?t.host:t,Dt=()=>{r.classList.remove("hfp-hidden"),It()},Ct=()=>{M&&r.classList.add("hfp-hidden")};return Ae.addEventListener("mousemove",Dt),Ae.addEventListener("mouseleave",Ct),{updateTime(d,p){let S=p>0?Math.min(d,p):d,ii=p>0?S/p*100:0;s.style.width=`${ii}%`,u.textContent=`${Le(S)} / ${Le(p)}`},updatePlaying(d){M=d,o.classList.toggle("hfp-playing",d),o.setAttribute("aria-label",d?"Pause":"Play"),d?It():r.classList.remove("hfp-hidden")},updateSpeed(d){let p=i.indexOf(d);p!==-1&&(K=p),m.textContent=U(d),m.setAttribute("aria-label",`Playback speed: ${U(d)}`),ye(d)},updateMuted(d){N=d,g.innerHTML=J(d,T),g.setAttribute("aria-label",d?"Unmute":"Mute")},updateVolume(d){T=d,E.style.width=`${d*100}%`,h.setAttribute("aria-valuenow",String(Math.round(d*100))),g.innerHTML=J(N,d)},setVolumeControlsHidden(d){v.style.display=d?"none":""},show(){r.style.display=""},hide(){r.style.display="none"},destroy(){document.removeEventListener("mousemove",wt),document.removeEventListener("mouseup",xt),document.removeEventListener("touchmove",kt),document.removeEventListener("touchend",Mt),document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",R),document.removeEventListener("touchend",k),document.removeEventListener("click",Z),Ae.removeEventListener("mousemove",Dt),Ae.removeEventListener("mouseleave",Ct),L&&clearTimeout(L),r.remove()}}}function wn(t,e,n,i,r,o=!1){let a=i?i.split(",").map(Number).filter(c=>!isNaN(c)&&c>0):void 0,s={...a?{speedPresets:a}:{},audioLocked:o},u=Rn(t,r,s);return u.updateMuted(e),u.updateVolume(n),u}function mt(t,e,n){return e?(n||(n=document.createElement("img"),n.className="hfp-poster",t.appendChild(n)),n.src=e,n):(n?.remove(),null)}function xn(t){return t.composedPath().some(e=>e instanceof HTMLElement&&e.classList.contains("hfp-controls"))}var Oe=null;function kn(t,e){if(typeof CSSStyleSheet<"u")try{Oe||(Oe=new CSSStyleSheet,Oe.replaceSync(e)),t.adoptedStyleSheets=[Oe];return}catch{}let n=document.createElement("style");n.textContent=e,t.appendChild(n)}function Mn(){let t=document.createElement("div");t.className="hfp-container";let e=document.createElement("iframe");return e.className="hfp-iframe",e.sandbox.add("allow-scripts","allow-same-origin"),e.allow="autoplay; fullscreen",e.referrerPolicy="no-referrer",e.title="Framey Composition",t.appendChild(e),{container:t,iframe:e}}function In(t,e,n,i){let r=t.offsetWidth,o=t.offsetHeight;if(r===0||o===0)return!1;let a=Math.min(r/n,o/i);return e.style.width=`${n}px`,e.style.height=`${i}px`,e.style.transform=`translate(-50%, -50%) scale(${a})`,!0}function sr(t,e,n){if(n.end<=0)return!1;let i=n.shown<n.end&&e>0?e+.001:0;return t+i>=n.end}var Fe=class{constructor(e){this._callbacks=e}_callbacks;_raf=null;_lastUpdateMs=0;_tick=null;start(e,n,i,r,o){this.stop();let a=null,s=0,u=0,c=()=>{if(r()){this._raf=null;return}let m;try{m=e.time()}catch{this._raf=null;return}let b=i(),v=o();v.end>0&&(m=Math.min(m,v.end));let g=a===null?0:m-a;g!==0&&(u=Math.min(g,s),s=g),a=m;let A=sr(m,u,v);A&&(m=v.shown);let h=performance.now();if((h-this._lastUpdateMs>100||A)&&(this._lastUpdateMs=h,this._callbacks.onTimeUpdate(m,b)),A){if(this._callbacks.getLoop()){this._callbacks.restart();return}try{e.pause(),v.shown<v.end&&e.seek(v.shown,!1)}catch{}this._callbacks.onPaused(),this._raf=null;return}this._raf=requestAnimationFrame(c)};this._tick=c,this._raf=requestAnimationFrame(c)}poll(){this._raf===null||!this._tick||(cancelAnimationFrame(this._raf),this._tick())}stop(){this._raf!==null&&(cancelAnimationFrame(this._raf),this._raf=null)}get isRunning(){return this._raf!==null}};function Dn(t){let e=Array.from(t.querySelectorAll("[data-composition-id]"));if(e.length===0)return t.body?[t.body]:[];let n=[];for(let i of e)lr(i)||n.push(i);return ur(t),n}function ur(t){let e=t.body;if(!e||typeof console>"u"||typeof console.warn!="function")return;let n=e.querySelectorAll("audio[data-start], video[data-start]");if(n.length===0)return;let i=[];for(let r of n)r.closest("[data-composition-id]")||i.push(r);i.length!==0&&console.warn(`[hyperframes-player] selectMediaObserverTargets: composition hosts are present, but ${i.length} body-level timed media element(s) sit outside every [data-composition-id] subtree and will not be observed. Move them inside a composition host or the parent-frame proxy will never adopt them.`,i)}function lr(t){let e=t.parentElement;for(;e;){if(e.hasAttribute("data-composition-id"))return!0;e=e.parentElement}return!1}var Cn=t=>4*Number.EPSILON*Math.max(1,Math.abs(t));function le(t,e){return!Number.isFinite(t)||!Number.isFinite(e)?t===e:Math.abs(t-e)<=Cn(Math.max(Math.abs(t),Math.abs(e)))}var Pn=(t,e)=>t>=e||le(t,e),Ve=(t,e,n)=>Pn(t,e)&&t<n&&!le(t,n),dr=1e-6,pt=(t,e,n,i)=>Ve(t,e,n)||Pn(t,e)&&i>0&&n>=i-dr;var cr="data-fade-in",mr="data-fade-out",ts=cr.slice(5),ns=mr.slice(5),pr=Object.freeze({fadeIn:0,fadeOut:0});var Nn=':not([muted]):is(:not([data-has-audio]),[data-has-audio="true"])',rs=`audio[data-start], video[data-start]${Nn}`;var de="data-hf-clip-hidden";var hr=`[data-start]:not(video, audio, img, [${hn}], [${gn}])`,Ts=`${hr}[${de}]`,Rs=`meta[name="${Pe}"]`;var ws=`[${de}][${de}]`,xs=`[${de}][style*="visibility: hidden"]`;var du=1/16;var gr=["backdrop-filter","clip-path","filter","mask","mask-border-source","mask-image","perspective","rotate","scale","transform","translate","-webkit-mask-image"],hu=new Set([...gr,"contain","isolation","mask-border","mix-blend-mode","opacity"]);function _r(t){return Number.isFinite(t)&&t>0?t:30}function yr(t){return Number.isFinite(t)&&t>0?t:0}function Ln(t,e){let n=_r(e),i=yr(t),r=i*n,o=Math.round(r);return Math.abs(r-o)<=.001?o/n:i}function On(t,e,n){return{start:Ln(t,n),end:Number.isFinite(e)?Ln(e,n):e}}var vr=["seconds-time","rational-fps","seek-keep-playing","composition-manifest-v1","runtime-data","play-range"];function Ar(t,e){let n=Math.abs(t),i=Math.abs(e);for(;i!==0;){let r=n%i;n=i,i=r}return n||1}function Sr(t){let e=Number.isFinite(t)&&t>0?t:30,n=Number.isInteger(e)?1:1e6,i=Math.round(e*n),r=Ar(i,n);return{numerator:i/r,denominator:n/r}}function Fn(t,e,n){return Math.max(t,(Math.ceil(e*n-1e-6)-1)/n)}function Er(t){if(typeof t!="object"||t===null)return null;let e=t;return!Number.isFinite(e.numerator)||!Number.isFinite(e.denominator)||(e.numerator??0)<=0||(e.denominator??0)<=0?null:Number(e.numerator)/Number(e.denominator)}function ft(t){return{protocolVersion:1,capabilities:vr,fps:Sr(t)}}function Vn(t){let e=t.offsetWidth,n=t.getBoundingClientRect().width;return e>0&&n>0?n/e:null}function Tr(t){return Array.isArray(t)&&t.every(e=>typeof e=="string")}function Un(t,e=30){if(typeof t!="object"||t===null)return{status:"legacy",fps:e};let n=t;if(n.protocolVersion===void 0)return{status:"legacy",fps:e};if(n.protocolVersion!==1)return{status:"unsupported",code:"unsupported_protocol_version",receivedVersion:n.protocolVersion};let i=Er(n.fps);return i===null||!Tr(n.capabilities)?{status:"unsupported",code:"invalid_protocol_metadata",receivedVersion:n.protocolVersion}:{status:"supported",fps:i,metadata:n}}function Rr(t,e){let n=t.tagName.toLowerCase();if(n==="script"||n==="style"||n==="link"||n==="meta")return null;let r=n==="video"||n==="audio"?e.resolver.resolveMediaStartForElement(t):e.resolver.resolveStartForElement(t,0),o=e.resolver.resolveDurationForElement(t),a=t.getAttribute("data-composition-id");if(a){let s=e.timelineRegistry[a],u=oe(s);!(t.hasAttribute("data-duration")||t.hasAttribute("data-end")||t.hasAttribute(nn)||t.hasAttribute(rn))&&(o==null||o<=0)&&u!=null&&u>0&&(o=u)}return{start:r,end:o!=null&&o>0?r+o:Number.POSITIVE_INFINITY}}function Hn(t,e){let n=Rr(t,e);if(!n)return!1;let i=e.exportRenderSeek?On(n.start,n.end,e.canonicalFps):n;return pt(e.currentTime,i.start,i.end,e.compositionDuration)}var j="first-frame",wr=3;function ce(t){let e=t.ownerDocument?.defaultView;return e&&t instanceof e.Element?!0:t instanceof Element}function x(t){if(!ce(t)||t.tagName!=="AUDIO"&&t.tagName!=="VIDEO")return!1;let e=t.ownerDocument?.defaultView;return e&&t instanceof e.HTMLMediaElement?!0:t instanceof HTMLMediaElement}function xr(t){return t.hasAttribute("data-start")||t.hasAttribute("data-track-index")}function kr(t,e,n){let i=t;for(;i;){if(xr(i)&&!Hn(i,{currentTime:0,compositionDuration:Number.POSITIVE_INFINITY,canonicalFps:30,exportRenderSeek:!1,timelineRegistry:n,resolver:e}))return!1;i=i.parentElement}return!0}function Wn(t,e,n,i){return e==="all"?!0:kr(t,n,i)}function Ue(t,{scope:e="all"}={}){let n=t.defaultView,i=V({documentRef:t,timelineRegistry:n?.__timelines,includeAuthoredTimingAttrs:!0}),r=t.querySelector(`meta[name="${Pe}"]`)!==null,o=Array.from(t.querySelectorAll("video, audio")).filter(x).filter(u=>Wn(u,r&&u.preload!=="auto"?j:e,i,n?.__timelines??{})).filter(u=>u.readyState<wr),a=Array.from(t.querySelectorAll("img")).filter(u=>Wn(u,u.getAttribute("loading")?.toLowerCase()==="lazy"?j:e,i,n?.__timelines??{})).filter(u=>!u.complete),s=t.fonts?.status==="loading";return{pendingMedia:o,pendingImages:a,fontsLoading:s}}function Mr(t,{pendingMedia:e,pendingImages:n,fontsLoading:i},r){let o=e.map(u=>new Promise(c=>{if(u.error){c();return}let m=()=>{u.removeEventListener("canplay",m),u.removeEventListener("error",m),r.removeEventListener("abort",m),c()};u.addEventListener("canplay",m),u.addEventListener("error",m),r.addEventListener("abort",m,{once:!0})})),a=n.map(u=>u.decode?u.decode().catch(()=>{}):Promise.resolve()),s=i&&t.fonts?t.fonts.ready.then(()=>{}):Promise.resolve();return Promise.all([...o,...a,s]).then(()=>{})}function Ir(t,e,{scope:n="all"}={}){let i=Ue(t,{scope:n});return i.pendingMedia.length===0&&i.pendingImages.length===0&&!i.fontsLoading?null:Mr(t,i,e)}var Dr=50;function Cr(t,e){let n=t.defaultView;return!n||n.__renderReady||!n.__hf?null:new Promise(i=>{let r,o=()=>{r!==void 0&&clearTimeout(r),e.removeEventListener("abort",o),i()};if(e.aborted){o();return}e.addEventListener("abort",o,{once:!0});let a=()=>{if(n.__renderReady){o();return}r=setTimeout(a,Dr)};a()})}var Pr=50,Nr=1.5,Lr=2,Or=1500;function ht(t,e){return new Promise(n=>{if(e.aborted){n(-1);return}let i=0,r=()=>{t.cancelAnimationFrame?.(i),n(-1)};e.addEventListener("abort",r,{once:!0}),i=t.requestAnimationFrame(o=>{e.removeEventListener("abort",r),n(o)})})}function Fr(t,e){let n=t.defaultView;return n?(async()=>{let i=await ht(n,e);if(e.aborted)return;let r=await ht(n,e),o=r-i,a=0;for(;!e.aborted&&a<Lr;){if(r-i>=Or)return;let s=await ht(n,e);if(e.aborted)return;let u=s-r;o=Math.min(o,u),a=u<Pr||u<=o*Nr?a+1:0,r=s}})():null}var Vr=8e3;function Ur(t,e,n={}){let i=n.inputs??[(c,m)=>Ir(c,m,{scope:n.scope}),Cr,Fr],r=new AbortController,o=i.map(c=>c(t,r.signal)).filter(c=>c!==null);if(o.length===0){e({timedOut:!1});return}let a=n.timeoutMs??Vr,s,u=new Promise(c=>{s=setTimeout(()=>c("timed-out"),a)});Promise.race([Promise.all(o).then(()=>"done"),u]).then(c=>{clearTimeout(s),r.abort(),e({timedOut:c==="timed-out"})})}function $n(t,e,n={}){Ur(t,e,{...n,scope:j})}var Hr=.05,Wr=2,He=class{_entries=[];_mediaObserver;_playbackErrorPosted=!1;_audioOwner="runtime";_urlAudioEntry=null;_urlAudioSrc=null;_dispatchEvent;_getMuted;_getVolume;_getPlaybackRate;_getCurrentTime;_isPaused;constructor(e){this._dispatchEvent=e.dispatchEvent,this._getMuted=e.getMuted,this._getVolume=e.getVolume,this._getPlaybackRate=e.getPlaybackRate,this._getCurrentTime=e.getCurrentTime,this._isPaused=e.isPaused}get audioOwner(){return this._audioOwner}get entries(){return this._entries}resetForIframeLoad(){this._playbackErrorPosted=!1;let e=this._audioOwner==="parent";this._audioOwner="runtime",this.pauseAll();for(let n of this._entries)n!==this._urlAudioEntry&&(n.el.src="");this._entries=this._urlAudioEntry?[this._urlAudioEntry]:[],this._urlAudioSrc&&!this._urlAudioEntry&&(this._urlAudioEntry=this._createEntry(this._urlAudioSrc,"audio",0,1/0)),this.teardownObserver(),e&&this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"runtime",reason:"iframe-reload"}}))}destroy(){this.teardownObserver();for(let e of this._entries)e.el.pause(),e.el.src="";this._entries=[],this._urlAudioEntry=null,this._urlAudioSrc=null,this._audioOwner="runtime",this._playbackErrorPosted=!1}updateMuted(e){for(let n of this._entries)n.el.muted=e}updateVolume(e){for(let n of this._entries)n.el.volume=e}updatePlaybackRate(e){for(let n of this._entries)n.el.playbackRate=e}_playEntry(e){e.el.src&&e.el.play().catch(n=>this._reportPlaybackError(n))}_playEntryIfActive(e){this._refreshEntryBounds(e),this._inWindow(e,this._getCurrentTime())&&this._playEntry(e)}_refreshEntryBounds(e){if(!e.source?.isConnected)return;let n=rt(e.source);e.start=n.start??0,e.duration=n.duration!=null&&n.duration>0?n.duration:Number.POSITIVE_INFINITY}_inWindow(e,n){return Ve(n,e.start,e.start+e.duration)}_gateEntryPlayback(e,n){return this._inWindow(e,n)?(this._audioOwner==="parent"&&!this._isPaused()&&e.el.paused&&this._playEntry(e),!0):(e.el.paused||e.el.pause(),e.driftSamples=0,!1)}playAll(){for(let e of this._entries)this._playEntryIfActive(e)}pauseAll(){for(let e of this._entries)e.el.pause()}stopAdoptedMedia(){for(let e of this._entries)e.source&&e.el.pause()}seekAll(e){for(let n of this._entries)this._refreshEntryBounds(n),this._inWindow(n,e)&&(n.el.currentTime=e-n.start)}scrubAll(e){for(let n of this._entries)this._refreshEntryBounds(n),this._inWindow(n,e)?(n.el.currentTime=e-n.start,this._playEntry(n)):n.el.paused||n.el.pause()}mirrorTime(e,n){let i=n?.force===!0;for(let r of this._entries){if(this._refreshEntryBounds(r),!this._gateEntryPlayback(r,e))continue;let o=e-r.start;Math.abs(r.el.currentTime-o)>Hr?(r.driftSamples+=1,(i||r.driftSamples>=Wr)&&(r.el.currentTime=o,r.driftSamples=0)):r.driftSamples=0}}promoteToParentProxy(e,n){if(this._audioOwner==="parent")return;if(this._audioOwner="parent",e)for(let r of e.querySelectorAll("video, audio"))x(r)&&(r.muted=!0);for(let r of[...this._entries])this._repointToSource(r);let i=this._getCurrentTime();n?n(i,{force:!0}):this.mirrorTime(i,{force:!0}),this._isPaused()||this.playAll(),this._dispatchEvent(new CustomEvent("audioownershipchange",{detail:{owner:"parent",reason:"autoplay-blocked"}}))}setupFromIframe(e){let n=e.querySelectorAll("audio[data-start], video[data-start]");for(let i of n)x(i)&&this._adoptIframeMedia(i);this._observeDynamicMedia(e)}setupFromUrl(e){if(this._urlAudioSrc===e&&this._urlAudioEntry)return;this.teardownUrlAudio();let n=this._createEntry(e,"audio",0,1/0);this._urlAudioEntry=n,this._urlAudioSrc=e,n&&this._audioOwner==="parent"&&!this._isPaused()&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this.playAll())}teardownUrlAudio(){let e=this._urlAudioEntry;if(this._urlAudioEntry=null,this._urlAudioSrc=null,!e)return;e.el.pause(),e.el.src="";let n=this._entries.indexOf(e);n!==-1&&this._entries.splice(n,1)}teardownObserver(){this._mediaObserver?.disconnect(),this._mediaObserver=void 0}_reportPlaybackError(e){this._playbackErrorPosted||(this._playbackErrorPosted=!0,this._dispatchEvent(new CustomEvent("playbackerror",{detail:{source:"parent-proxy",error:e}})))}_createEntry(e,n,i,r,o){if(this._urlTaken(e))return null;let a=n==="video"?document.createElement("video"):new Audio;a.preload="auto",a.src=e,a.load(),a.muted=this._getMuted(),a.volume=this._getVolume();let s=this._getPlaybackRate();s!==1&&(a.playbackRate=s);let u={el:a,start:i,duration:r,driftSamples:0,source:o};return this._entries.push(u),u}_resolveIframeMediaSrc(e){let n=e.getAttribute("src")||e.querySelector("source")?.getAttribute("src");return n?new URL(n,e.ownerDocument.baseURI).href:null}_adoptIframeMedia(e){if(e.preload==="metadata"||e.preload==="none")return;let n=this._resolveIframeMediaSrc(e);if(!n)return;let i=rt(e),r=i.start??0,o=i.duration??Number.POSITIVE_INFINITY,a=e.tagName==="VIDEO"?"video":"audio",s=this._createEntry(n,a,r,o,e);s&&this._audioOwner==="parent"&&(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(s))}_followIframeMediaSrc(e){let n=this._entries.find(i=>i.source===e);if(!n)return this._adoptIframeMedia(e);this._audioOwner!=="parent"||!this._repointToSource(n)||(this.mirrorTime(this._getCurrentTime(),{force:!0}),this._isPaused()||this._playEntryIfActive(n))}_urlTaken(e,n){return this._entries.some(i=>i===n||i.source&&!i.source.isConnected?!1:(i.source&&this._resolveIframeMediaSrc(i.source)||i.el.src)===e)}_repointToSource(e){let n=e.source?this._resolveIframeMediaSrc(e.source):null;return!n||e.el.src===n?!1:this._urlTaken(n,e)?(this._removeEntry(e),!1):(e.el.src=n,e.el.load(),!0)}_detachIframeMedia(e){let n=this._entries.find(i=>i.source===e);n&&this._removeEntry(n)}_removeEntry(e){e.el.pause(),e.el.src="",this._entries.splice(this._entries.indexOf(e),1)}_observeDynamicMedia(e){if(this.teardownObserver(),typeof MutationObserver>"u"||!e.body)return;let n=new MutationObserver(o=>{for(let a of o){if(a.type==="attributes"&&a.attributeName==="src"){let s=a.target;x(s)&&s.matches("audio[data-start], video[data-start]")&&this._followIframeMediaSrc(s);continue}if(a.type==="attributes"&&a.attributeName==="preload"){let s=a.target;x(s)&&s.matches("audio[data-start], video[data-start]")&&(s.preload==="auto"?this._adoptIframeMedia(s):this._detachIframeMedia(s));continue}for(let s of a.addedNodes){if(!ce(s))continue;let u=[];x(s)&&s.matches("audio[data-start], video[data-start]")&&u.push(s);let c=s.querySelectorAll("audio[data-start], video[data-start]");for(let m of c)x(m)&&u.push(m);for(let m of u)this._adoptIframeMedia(m)}for(let s of a.removedNodes){if(!ce(s))continue;let u=[];x(s)&&s.matches("audio[data-start], video[data-start]")&&u.push(s);let c=s.querySelectorAll("audio[data-start], video[data-start]");for(let m of c)x(m)&&u.push(m);for(let m of u)this._detachIframeMedia(m)}}}),i={childList:!0,subtree:!0,attributes:!0,attributeFilter:["preload","src"]},r=Dn(e);for(let o of r)n.observe(o,i);this._mediaObserver=n}};function bt(t,e,n){if(t===null&&e===null)return{range:null,clamped:!1};let i=t??0,r=e!==null&&n>0&&e>n,o=r?n:e,a=o??(n>0?n:1/0);return!(i>=0)||!(a>i)?{range:null,clamped:!0}:{range:{start:i,end:o},clamped:r}}function me(t,e,n){let i=t.end??e;return i<e?Fn(t.start,i,n):i}function gt(t,e,n,i){return t<e.start||t>=me(e,n,i)}var $r=100;function Br(t,e){return typeof t.currentTime=="number"&&Number.isFinite(t.currentTime)?t.currentTime:(t.frame??0)/e}function Bn(t,e,n){return n<=0?!1:t.ended===!0?!0:t.ended===!1&&!t.isPlaying?!1:e>=n}function Gr(t,e,n,i,r,o){let{duration:a}=n;if(!r){let s=Bn(t,e,a);return{start:0,shownAtEnd:a,atEnd:s,stopRuntime:!1,entering:!1}}if(t.ownsRange){let s=i&&t.ended===!0&&!t.isPlaying;return{start:r.start,shownAtEnd:e,atEnd:s,stopRuntime:!1,entering:!1}}return zr(t,e,n,i,r,o)}function zr(t,e,n,i,r,o){let a=r.end??n.duration,s=n.enteringRange===!0&&(e<r.start||e>=a);return{start:r.start,shownAtEnd:me(r,n.duration,o),atEnd:i&&!s&&Bn(t,e,a),stopRuntime:t.isPlaying,entering:s}}function Gn(t,e,n,i){let r=Br(t,e),o=!n.paused,a=o||t.isPlaying,s=i.getPlayRange?.(),u=Gr(t,r,n,a,s,e),{atEnd:c,start:m}=u,b=n.duration>0?Math.min(r,n.duration):r,v=c?u.shownAtEnd:b,g=!t.isPlaying,A=c&&a;if(A&&i.getLoop())return i.media.audioOwner==="parent"&&i.media.pauseAll(),i.seek(m),i.play(),{...n,currentTime:m,paused:!1,enteringRange:!0};let h={...n,currentTime:v,paused:g,enteringRange:u.entering};i.media.audioOwner==="parent"&&(o&&g?i.media.pauseAll():!o&&!g&&i.media.playAll(),i.media.mirrorTime(v));let E=performance.now(),M=g!==n.paused;return(E-n.lastUpdateMs>$r||M)&&(h.lastUpdateMs=E,i.updateControlsTime(v,n.duration),i.updateControlsPlaying(!g),i.dispatchEvent(new CustomEvent("timeupdate",{detail:{currentTime:v}}))),A&&(u.stopRuntime&&i.seek(v),i.media.audioOwner==="parent"&&i.media.pauseAll(),h.paused=!0,i.updateControlsPlaying(!1),i.dispatchEvent(new Event("ended"))),h}function qr(t){return Array.isArray(t)?t.filter(e=>typeof e=="object"&&e!==null&&typeof e.id=="string"&&typeof e.start=="number"&&typeof e.duration=="number"):[]}function zn(t,e,n){if(t.source!==e)return;let i=t.data;if(!i||i.source!=="hf-preview")return;let r=Un(i);if(r.status==="unsupported"){n.dispatchEvent(new CustomEvent("runtimeprotocolerror",{detail:{code:r.code,receivedVersion:r.receivedVersion}}));return}n.setRuntimeFps?.(r.fps);let o=r.status==="supported"&&r.metadata.capabilities.includes("play-range");if(n.setRuntimeOwnsPlayRange?.(o),i.type==="shader-transition-state"){let a=i.state&&typeof i.state=="object"?i.state:{};n.shaderLoader.update(a,n.getShaderLoadingMode()),n.dispatchEvent(new CustomEvent("shadertransitionstate",{detail:{compositionId:i.compositionId,state:a}}));return}if(i.type==="ready"){n.onRuntimeReady();return}if(i.type==="assets-ready"){n.onRuntimeAssetsReady?.(i.timedOut===!0);return}if(i.type==="runtime-data-error"){n.onRuntimeDataError?.(i.channel,i.requestId,i.message);return}if(i.type==="runtime-data-applied"){n.onRuntimeDataApplied?.(i.channel,i.requestId);return}if(i.type==="state"){n.setPlaybackState(Gn({frame:i.frame??0,currentTime:i.currentTime,ended:typeof i.ended=="boolean"?i.ended:void 0,isPlaying:!!i.isPlaying,ownsRange:o},r.fps,n.getPlaybackState(),n));return}if(i.type==="media-autoplay-blocked"){if(n.shouldPromoteMediaAutoplayFallback?.()===!1)return;let a=null;try{a=n.getIframeDoc()}catch{}n.media.promoteToParentProxy(a,(s,u)=>n.media.mirrorTime(s,u)),n.sendControl("set-media-output-muted",{muted:!0});return}if(i.type==="timeline"&&i.durationInFrames>0){let a=Number(i.durationSeconds),s=Number(i.durationInFrames),u=Number.isFinite(a)&&a>0?a:s/r.fps;if(Number.isFinite(i.compositionWidth)&&i.compositionWidth>0&&Number.isFinite(i.compositionHeight)&&i.compositionHeight>0&&n.setCompositionSize(i.compositionWidth,i.compositionHeight),Number.isFinite(u)&&u>0){let c=n.getPlaybackState();n.setPlaybackState({...c,duration:u}),n.updateControlsTime(c.currentTime,u),n.onRuntimeTimelineReady(u,typeof i.assetsReady=="boolean"?i.assetsReady:void 0)}n.setScenes(qr(i.scenes));return}i.type==="stage-size"&&Number.isFinite(i.width)&&i.width>0&&Number.isFinite(i.height)&&i.height>0&&n.setCompositionSize(i.width,i.height)}function jr(t,e){return t.includes(e)?!0:/hyperframe\.runtime\.iife\.js|__hyperframes\s*=/.test(t)}var Yr=new Set([">"," "," ",`
|
|
478
|
+
`,"\r","\f"]);function _t(t,e){let n=t.toLowerCase(),i=`<${e}`,r=0;for(;r<n.length;){let o=n.indexOf(i,r);if(o<0)return null;let a=n[o+i.length];if(Yr.has(a)){let s=n.indexOf(">",o+i.length);return s<0?null:{index:o,end:s+1}}r=o+i.length}return null}function qn(t,e){if(!t||jr(t,e))return t;let n=`<script src="${e}"></script>`,i=_t(t,"head");if(i)return t.slice(0,i.end)+n+t.slice(i.end);let r=_t(t,"body");if(r)return t.slice(0,r.index)+n+t.slice(r.index);let o=_t(t,"html");return o?t.slice(0,o.end)+n+t.slice(o.end):n+t}var H="shader-capture-scale",Y="shader-loading",We="runtime-src",jn="__hf_shader_capture_scale",Yn="__hf_shader_loading",X=["Preparing scene transitions","Sampling outgoing scene motion","Sampling incoming scene motion","Caching transition frames","Finalizing transition preview"];function yt(t){if(t===null)return null;let e=Number(t);return!Number.isFinite(e)||e<=0?null:String(Math.min(1,Math.max(.25,e)))}function Xr(t){if(t===null||t.trim()==="")return"composition";let e=t.trim().toLowerCase();return e==="none"||e==="false"||e==="0"||e==="off"?"none":e==="player"||e==="true"||e==="1"||e==="on"?"player":"composition"}function Xn(t,e){return t.filter(n=>n!==""&&n.split("=")[0]!==e)}function Kr(t,e,n){let i=t.indexOf("#"),r=i>=0?t.slice(0,i):t,o=i>=0?t.slice(i):"",a=r.indexOf("?"),s=a>=0?r.slice(0,a):r,u=a>=0?r.slice(a+1):"",c=Xn(u.split("&"),jn);c=Xn(c,Yn),e!==null&&c.push(`${jn}=${encodeURIComponent(e)}`),n!=="composition"&&c.push(`${Yn}=${encodeURIComponent(n)}`);let m=c.join("&");return`${s}${m?`?${m}`:""}${o}`}function Jr(t,e,n){if(e===null&&n==="composition")return t;let i=[];e!==null&&i.push(`window.__HF_SHADER_CAPTURE_SCALE=${JSON.stringify(e)};`),n!=="composition"&&i.push(`window.__HF_SHADER_LOADING=${JSON.stringify(n)};`);let r=`<script data-hyperframes-player-shader-options>${i.join("")}</script>`;return/<head\b[^>]*>/i.test(t)?t.replace(/<head\b[^>]*>/i,o=>`${o}${r}`):/<html\b[^>]*>/i.test(t)?t.replace(/<html\b[^>]*>/i,o=>`${o}${r}`):`${r}${t}`}function pe(t){return Xr(t.getAttribute(Y))}function Kn(t){return Number(yt(t.getAttribute(H))??"1")}function Jn(t,e){return Kr(e,yt(t.getAttribute(H)),pe(t))}function fe(t,e){return qn(Jr(e,yt(t.getAttribute(H)),pe(t)),vt(t))}function vt(t){let e=t.getAttribute(We)?.trim();if(!e)return q;try{let n=new URL(e,document.baseURI),i=n.protocol==="http:"||n.protocol==="https:",r=n.hostname==="127.0.0.1"||n.hostname==="localhost"||n.hostname==="[::1]";return i&&(r||n.origin===location.origin)?n.href:q}catch{return q}}function Zn(){let t=document.createElement("div");t.className="hfp-shader-loader",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-label","Preparing scene transitions"),t.setAttribute("data-hyperframes-ignore",""),t.draggable=!1;let e=g=>{g.preventDefault(),g.stopPropagation()};for(let g of["selectstart","dragstart","pointerdown","mousedown","click","dblclick","contextmenu","touchstart"])t.addEventListener(g,e,{capture:!0});let n=document.createElement("div");n.className="hfp-shader-loader-panel",n.draggable=!1;let i=document.createElement("div");i.className="hfp-shader-loader-mark",i.draggable=!1,i.innerHTML=['<svg width="78" height="78" viewBox="0 0 100 100" fill="none" aria-hidden="true" draggable="false">','<path d="M10.1851 57.8021L33.1145 73.8313C36.2202 75.9978 41.5173 73.5433 42.4816 69.4984L51.7611 30.4271C52.7253 26.3822 48.5802 23.9277 44.4602 26.0942L13.917 42.1235C6.96677 45.7676 4.97564 54.1579 10.1851 57.8021Z" fill="url(#hfp-shader-loader-grad-left)"/>','<path d="M87.5129 57.5141L56.9696 73.5433C52.8371 75.7098 48.7046 73.2553 49.6688 69.2104L58.9483 30.1391C59.9125 26.0942 65.2097 23.6397 68.3154 25.8062L91.2447 41.8354C96.4668 45.4796 94.4631 53.8699 87.5129 57.5141Z" fill="url(#hfp-shader-loader-grad-right)"/>',"<defs>",'<linearGradient id="hfp-shader-loader-grad-left" x1="48.5676" y1="25" x2="44.7804" y2="71.9384" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>",'<linearGradient id="hfp-shader-loader-grad-right" x1="54.8282" y1="73.8392" x2="72.0989" y2="32.8932" gradientUnits="userSpaceOnUse">','<stop stop-color="#06E3FA"/>','<stop offset="1" stop-color="#4FDB5E"/>',"</linearGradient>","</defs>","</svg>"].join("");let r=document.createElement("div");r.className="hfp-shader-loader-title";let o=document.createElement("span");o.className="hfp-shader-loader-title-text",o.textContent=X[0]||"Preparing scene transitions",r.appendChild(o);let a=document.createElement("div");a.className="hfp-shader-loader-detail",a.textContent="Rendering animated scene samples for shader transitions.";let s=document.createElement("div");s.className="hfp-shader-loader-track",s.setAttribute("aria-hidden","true");let u=document.createElement("div");u.className="hfp-shader-loader-fill",s.appendChild(u);let c=document.createElement("div");c.className="hfp-shader-loader-progress";let m=g=>{let A=document.createElement("div");A.className="hfp-shader-loader-row";let h=document.createElement("span");h.className="hfp-shader-loader-label",h.textContent=g;let E=document.createElement("span");return E.className="hfp-shader-loader-value",A.appendChild(h),A.appendChild(E),c.appendChild(A),{row:A,label:h,value:E}},b=m("transition"),v=m("transition frame");return n.appendChild(i),n.appendChild(r),n.appendChild(a),n.appendChild(s),n.appendChild(c),t.appendChild(n),{root:t,fill:u,title:o,detail:a,transitionValue:b.value,transitionRow:b.row,frameLabel:v.label,frameValue:v.value,frameRow:v.row}}var Zr=420;function $e(t,e,n){e.textContent=n,t.style.visibility=n?"visible":"hidden"}var Be=class{_el;_hideTimeout=null;_hiddenCallbacks=[];_drawingAssets=!1;constructor(e){this._el=e}show(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-hiding"),this._el.root.classList.add("hfp-visible")}hide(){if(this._el.root.classList.contains("hfp-hiding")){this._hideTimeout||this._scheduleCleanup();return}this._el.root.classList.contains("hfp-visible")&&(this._el.root.classList.add("hfp-hiding"),this._el.root.classList.remove("hfp-visible"),this._scheduleCleanup())}whenHidden(e){let n=this._el.root.classList;n.contains("hfp-visible")||n.contains("hfp-hiding")?this._hiddenCallbacks.push(e):e()}_flushHidden(){let e=this._hiddenCallbacks;this._hiddenCallbacks=[];for(let n of e)n()}reset(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._el.root.classList.remove("hfp-visible","hfp-hiding"),this._drawingAssets=!1,this._flushHidden(),this._el.fill.style.transform="scaleX(0)",$e(this._el.transitionRow,this._el.transitionValue,""),$e(this._el.frameRow,this._el.frameValue,"")}update(e,n){let i=n==="player"&&e.loading&&!e.ready;if(this._drawingAssets&&!i)return;if(n!=="player"){this.reset();return}if(e.ready||!e.loading){this.hide();return}this._el.root.setAttribute("aria-label","Preparing scene transitions"),this._drawingAssets=!1;let r=typeof e.progress=="number"&&Number.isFinite(e.progress)?e.progress:0,o=typeof e.total=="number"&&Number.isFinite(e.total)?e.total:0,a=o>0?Math.min(1,Math.max(0,r/o)):0,s=Math.min(X.length-1,Math.floor(a*X.length));this._el.title.textContent=X[s]||"Preparing scene transitions",this._el.detail.textContent=e.phase==="cached"?"Loading cached transition frames before playback.":e.phase==="finalizing"?"Uploading transition textures for smooth playback.":"Rendering animated scene samples for shader transitions.",this._el.fill.style.transform=`scaleX(${a})`;let u=e.currentTransition!==void 0&&e.transitionTotal!==void 0?`${e.currentTransition}/${e.transitionTotal}`:o>0?`${r}/${o}`:"",c=e.transitionFrame!==void 0&&e.transitionFrames!==void 0?`${e.transitionFrame}/${e.transitionFrames}`:"";this._el.frameLabel.textContent=e.phase==="cached"?"cached transition frames":e.phase==="finalizing"?"finalizing transition frames":"rendering transition frames",$e(this._el.transitionRow,this._el.transitionValue,u),$e(this._el.frameRow,this._el.frameValue,c),this._el.root.setAttribute("aria-valuenow",String(Math.round(a*100))),this.show()}showAssetsLoading(){this.reset(),this._el.title.textContent="Loading assets",this._el.detail.textContent="Waiting for images, video and fonts to finish loading.",this._el.root.setAttribute("aria-label","Loading assets"),this._drawingAssets=!0,this.show()}hideAssetsLoading(){this._drawingAssets&&this.hide()}get hideTimeout(){return this._hideTimeout}destroy(){this._hideTimeout&&(clearTimeout(this._hideTimeout),this._hideTimeout=null),this._hiddenCallbacks=[]}_scheduleCleanup(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideTimeout=setTimeout(()=>{this._el.root.classList.remove("hfp-hiding"),this._hideTimeout=null,this._flushHidden()},Zr)}};function Qn(t){return t?.trim().toLowerCase().startsWith("video/")??!1}function ei(t){let e=document.createElement("video");e.className="hfp-video",e.playsInline=!0,e.preload="metadata";let n=new AbortController,{signal:i}=n;return e.addEventListener("loadedmetadata",()=>t.onMetadata(e),{signal:i}),e.addEventListener("durationchange",()=>t.onDurationChange(e),{signal:i}),e.addEventListener("resize",()=>t.onResize(e),{signal:i}),e.addEventListener("play",()=>t.onPlay(e),{signal:i}),e.addEventListener("pause",()=>t.onPause(e),{signal:i}),e.addEventListener("timeupdate",()=>t.onTimeUpdate(),{signal:i}),e.addEventListener("error",()=>t.onError(e.error?.message||"Video failed to load",e.error?.code??null),{signal:i}),{video:e,adapter:{duration:()=>e.duration,time:()=>e.currentTime,seek:o=>{e.currentTime=o},play:()=>e.play().catch(o=>{i.aborted||t.onPlayRejected(o)}),pause:()=>e.pause(),timeScale:o=>{e.defaultPlaybackRate=o,e.playbackRate=o}},destroy:()=>{n.abort(),e.pause(),e.removeAttribute("src"),e.load(),e.remove()}}}var Qr=.1,eo=5,At="sandbox-origin",ti=1e4,St=8e3,Et="assets-loading",he="assets-loading-ui",Tt="low-power-idle",ni="disable-click-to-play",be="range-start",ge="range-end",to=150;function Rt(t){return!Number.isFinite(t)||t<=0?1:Math.max(Qr,Math.min(eo,t))}var Ge=class extends HTMLElement{static get observedAttributes(){return["src","srcdoc","width","height","controls","muted","audio-locked","volume","poster","playback-rate","audio-src","type",At,We,H,Y,he,Tt,be,ge]}shadow;container;sizer=document.createElement("div");iframe;posterEl=null;controlsApi=null;resizeObserver;shaderLoader;probe;_ready=!1;_readyDocument=null;_connected=!1;_assetsReady=!1;_painted=!1;_pendingPlay=!1;_assetsGeneration=0;_assetsLoadingShowTimer=null;_currentTime=0;_duration=0;_paused=!0;_scrubbing=!1;_lastUpdateMs=0;_volume=1;_compositionWidth=1920;_compositionHeight=1080;_rescaleWarned=!1;_directTimelineAdapter=null;_directTimelineClock;_parentTickRaf=null;_media;_scenes=[];_runtimeFps=30;_runtimeBridgeReady=!1;_runtimeAssetsReadyGeneration=-1;_runtimeData=new Map;_runtimeDataRequestId=0;_pendingRuntimeData=new Map;_afterUpdate=null;_videoSource=null;_runtimeOwnsPlayRange=!1;_enteringRange=!1;_rangeClampReported="";constructor(){super(),this.shadow=this.attachShadow({mode:"open"}),kn(this.shadow,An),{container:this.container,iframe:this.iframe}=Mn(),this.sizer.className="hfp-sizer",this.shadow.appendChild(this.sizer),this.shadow.appendChild(this.container);let e=Zn();this.shadow.appendChild(e.root),this.shaderLoader=new Be(e),this._media=new He({dispatchEvent:n=>this._emit(n),getMuted:()=>this.muted,getVolume:()=>this._volume,getPlaybackRate:()=>this.playbackRate,getCurrentTime:()=>this._currentTime,isPaused:()=>this._paused}),this._directTimelineClock=new Fe({onTimeUpdate:(n,i)=>{this._currentTime=n,this.controlsApi?.updateTime(n,i),this._emit(new CustomEvent("timeupdate",{detail:{currentTime:n}}))},getLoop:()=>this.loop,restart:()=>{this.seek(this._playRange()?.start??0),this.play()},onPaused:()=>{this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this._emit(new Event("ended"))},onEnded:()=>this.loop}),this.probe=new Ne(this.iframe,{resolveRuntimeUrl:()=>vt(this),hostOwnsDeadline:()=>this.hasAttribute("no-load-timeout"),onReady:n=>this._onProbeReady(n),onError:n=>this._emit(new CustomEvent("error",{detail:{message:n}}))}),this.addEventListener("click",n=>{this.disableClickToPlay||xn(n)||(this._paused?this.play():this.pause())}),this.resizeObserver=new ResizeObserver(()=>this._rescale()),this._onMessage=this._onMessage.bind(this),this._onIframeLoad=this._onIframeLoad.bind(this),this.iframe.addEventListener("load",this._onIframeLoad)}connectedCallback(){this._connected=!0,this._applySandboxOriginPolicy(),this.resizeObserver.observe(this),window.addEventListener("message",this._onMessage),this.hasAttribute("controls")&&this._setupControls(),this.hasAttribute("poster")&&(this.posterEl=mt(this.shadow,this.getAttribute("poster"),this.posterEl)),this.hasAttribute("audio-src")&&this._media.setupFromUrl(this.getAttribute("audio-src")),this.hasAttribute("srcdoc")&&(this.iframe.srcdoc=fe(this,this.getAttribute("srcdoc"))),this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")),!this.hasAttribute("audio-locked")&&this._isLockedHostEnvironment()&&this._applyAudioLock(!0)}disconnectedCallback(){this._connected=!1,this._teardownVideo(),this._sendControl("pause"),this._stopIframeMedia(),this.resizeObserver.disconnect(),window.removeEventListener("message",this._onMessage),this.probe.stop(),this._directTimelineClock.stop(),this._stopParentTickClock(),this._directTimelineAdapter=null,this.shaderLoader.destroy(),this._media.destroy(),this.controlsApi?.destroy(),this.controlsApi=null,this._paused=!0,this._pendingPlay=!1,this._abandonComposition("Player disconnected before runtime data was applied")}attributeChangedCallback(e,n,i){switch(e){case"src":if(!this.isConnected)break;i&&this._navigateSrc(i);break;case"type":{let r=this.getAttribute("src");if(!this.isConnected||r===null||!!this._videoSource===this._wantsVideo())break;this._navigateSrc(r);break}case"srcdoc":if(!this.isConnected)break;if(this._pendingPlay=!1,this._abandonComposition("Composition navigated before runtime data was applied"),i!==null)this._pauseForVideoSwitch(),this._teardownVideo(),this.iframe.srcdoc=fe(this,i);else{this.iframe.removeAttribute("srcdoc");let r=this.getAttribute("src");r!==null&&this._wantsVideo()&&this._navigateSrc(r)}break;case At:this._applySandboxOriginPolicy(this.isConnected&&n!==i);break;case"width":this._setCompositionSize(ue(i)??1920,this._compositionHeight);break;case"height":this._setCompositionSize(this._compositionWidth,ue(i)??1080);break;case"controls":i!==null?this._setupControls():(this.controlsApi?.destroy(),this.controlsApi=null);break;case"poster":this.posterEl=mt(this.shadow,i,this.posterEl);break;case"playback-rate":{let r=Rt(parseFloat(i||"1"));this._media.updatePlaybackRate(r),this._sendControl("set-playback-rate",{playbackRate:r}),this._directTimelineAdapter?.timeScale?.(r),this.controlsApi?.updateSpeed(r),this._emit(new Event("ratechange"));break}case"muted":this._handleMutedChange(i);break;case"audio-locked":this._applyAudioLock(i!==null);break;case"volume":{let r=Math.max(0,Math.min(1,parseFloat(i||"1")));this._volume=r,this._syncVideoAudio(),this._media.updateVolume(r),this._sendControl("set-volume",{volume:r}),this.controlsApi?.updateVolume(r),this._emit(new Event("volumechange"));break}case"audio-src":i?this._media.setupFromUrl(i):this._media.teardownUrlAudio();break;case he:i==="none"&&this.shaderLoader.hideAssetsLoading();break;case Tt:this._sendControl("set-idle-heartbeat",{slow:i!==null});break;case be:case ge:this._applyPlayRange(!0);break;case H:case Y:case We:if(!this.isConnected)break;this._reloadShaderOptions();break}}_applySandboxOriginPolicy(e=!1){this.hasAttribute(At)?this.iframe.sandbox.remove("allow-same-origin"):this.iframe.sandbox.add("allow-same-origin"),e&&this._reloadForSandboxOriginPolicy()}_reloadForSandboxOriginPolicy(){if(this._videoSource)return;this._abandonComposition("Sandbox policy changed before runtime data was applied");let e=this.getAttribute("srcdoc");if(e!==null){this.iframe.srcdoc=fe(this,e);return}let n=this.getAttribute("src");n===null?this.iframe.src="about:blank":this._loadSrc(n)}get iframeElement(){return this.iframe}get scenes(){return this._scenes}play(){this._play(!0)}_play(e){if(this._ready&&!this._assetsReady){this._pendingPlay=!0;return}this._pendingPlay=!1,this.posterEl?.remove(),this.posterEl=null;let n=this._ready?this._playRange():null;n?gt(this._currentTime,n,this._duration,this._runtimeFps)&&(this.seek(n.start),this._enteringRange=!0):this._duration>0&&this._currentTime>=this._duration&&this.seek(0),this._paused=!1;let i=this._tryDirectTimelinePlay(),r=!1;this._sendDisplayScale(),i||(this._sendControl("play"),this._ready&&!this._directTimelineAdapter?this._startParentTickClock():this._ready||(this._pendingPlay=!0,r=!0)),this._media.audioOwner==="parent"&&this._media.playAll(),this.controlsApi?.updatePlaying(!0),!r&&e&&this._emit(new Event("play")),i&&this._directTimelineAdapter&&this._directTimelineClock.start(this._directTimelineAdapter,()=>this._currentTime,()=>this._duration,()=>this._paused,()=>this._clockStop())}pause(){this._pendingPlay=!1,this._tryDirectTimelinePause()?this._showPausedVideoTime():this._sendControl("pause"),this._directTimelineClock.stop(),this._stopParentTickClock(),this._media.audioOwner==="parent"&&this._media.pauseAll(),this._paused=!0,this.controlsApi?.updatePlaying(!1),this._emit(new Event("pause"))}stopMedia(){this._sendControl("stop-media"),this._stopIframeMedia(),this._media.stopAdoptedMedia()}seek(e){this._pendingPlay=!1,!this._trySyncSeek(e)&&!this._tryDirectTimelineSeek(e)&&this._sendControl("seek",{timeSeconds:e,frame:Math.round(e*this._runtimeFps)}),this._directTimelineClock.stop(),this._stopParentTickClock(),this._currentTime=e,this._media.audioOwner==="parent"&&(this._scrubbing?this._media.scrubAll(e):(this._media.pauseAll(),this._media.seekAll(e))),this._paused=!0,this.controlsApi?.updatePlaying(!1),this.controlsApi?.updateTime(this._currentTime,this._duration)}setColorGrading(e,n){this._sendControl("set-color-grading",{target:e,grading:n})}clearColorGrading(e){this._sendControl("set-color-grading",{target:e,grading:null})}setColorGradingCompare(e,n){this._sendControl("set-color-grading-compare",{target:e,compare:n})}clearColorGradingCompare(e){this._sendControl("set-color-grading-compare",{target:e,compare:{enabled:!1}})}setRuntimeData(e,n){if(!/^[a-z][a-z0-9-]{0,63}$/.test(e))throw new Error(`Invalid Framey runtime-data channel: ${e}`);if(typeof structuredClone!="function")throw new Error("Framey runtime data requires structuredClone support; refusing an unverified payload");let i=structuredClone(n);this._runtimeData.set(e,i),this._deliverRuntimeData(e,i)}clearRuntimeData(e){if(!/^[a-z][a-z0-9-]{0,63}$/.test(e))throw new Error(`Invalid Framey runtime-data channel: ${e}`);this._runtimeData.delete(e),this._deliverRuntimeDataClear(e)}get currentTime(){return this._currentTime}set currentTime(e){this.seek(e)}get duration(){return this._duration}get compositionWidth(){return this._compositionWidth}get compositionHeight(){return this._compositionHeight}get paused(){return this._paused}get ready(){return this._ready}get assetsReady(){return this._assetsReady}get painted(){return this._painted}get playbackRate(){return Rt(parseFloat(this.getAttribute("playback-rate")||"1"))}set playbackRate(e){this.setAttribute("playback-rate",String(Rt(e)))}get shaderCaptureScale(){return Kn(this)}set shaderCaptureScale(e){this.setAttribute(H,String(e))}get shaderLoading(){return pe(this)}set shaderLoading(e){e==="composition"?this.removeAttribute(Y):this.setAttribute(Y,e)}get assetsLoadingUi(){return this.getAttribute(he)==="none"?"none":"player"}set assetsLoadingUi(e){e==="none"?this.setAttribute(he,"none"):this.removeAttribute(he)}get muted(){return this.hasAttribute("muted")}set muted(e){e?this.setAttribute("muted",""):this.removeAttribute("muted")}get audioLocked(){return this.hasAttribute("audio-locked")}set audioLocked(e){e?this.setAttribute("audio-locked",""):this.removeAttribute("audio-locked")}_isLockedHostEnvironment(){if(typeof navigator>"u")return!1;let e=navigator.userAgent||"";return/\bClaude\/\d/.test(e)&&/\bElectron\b/.test(e)}_isAudioLocked(){return this.hasAttribute("audio-locked")||this._isLockedHostEnvironment()}_isSlideshowPlayer(){return this.closest("hyperframes-slideshow")!==null}_handleMutedChange(e){if(e===null&&this._isAudioLocked()){this.setAttribute("muted","");return}this._media.updateMuted(e!==null),this._syncVideoAudio(),this._setIframeMediaMuted(e!==null),this._sendControl("set-muted",{muted:e!==null}),this.controlsApi?.updateMuted(e!==null),this._emit(new Event("volumechange"))}_applyAudioLock(e){e&&(this.muted=!0),this.controlsApi?.setVolumeControlsHidden(e)}get volume(){return this._volume}set volume(e){this.setAttribute("volume",String(Math.max(0,Math.min(1,e))))}get disableClickToPlay(){return this.hasAttribute(ni)}set disableClickToPlay(e){this.toggleAttribute(ni,e)}get loop(){return this.hasAttribute("loop")}set loop(e){e?this.setAttribute("loop",""):this.removeAttribute("loop")}get rangeStart(){return this._readSeconds(be)}set rangeStart(e){this._writeSeconds(be,e)}get rangeEnd(){return this._readSeconds(ge)}set rangeEnd(e){this._writeSeconds(ge,e)}_readSeconds(e){let n=this.getAttribute(e);return n===null?null:Number(n)}_writeSeconds(e,n){n==null?this.removeAttribute(e):this.setAttribute(e,String(n))}_hasPlayRange(){return this.hasAttribute(be)||this.hasAttribute(ge)}_playRange(){return bt(this.rangeStart,this.rangeEnd,this._duration).range}_sendPlayRange(e){let n=e?.end??null;this._sendControl("set-play-range",{startSeconds:e?.start??null,endSeconds:n})}_applyPlayRange(e){let{range:n,clamped:i}=bt(this.rangeStart,this.rangeEnd,this._duration);this._sendPlayRange(n),this._ready&&(this._reportRangeClamp(n,i),n&&e&&!this._pendingPlay&&this._moveIntoPlayRange(n))}_reportRangeClamp(e,n){let i=n?`${this.rangeStart},${this.rangeEnd},${this._duration}`:"";if(i===this._rangeClampReported||(this._rangeClampReported=i,!n))return;let r={rangeStart:e?.start??null,rangeEnd:e?.end??null};this._emit(new CustomEvent("rangeclamped",{detail:{...r,duration:this._duration}}))}_moveIntoPlayRange(e){gt(this._currentTime,e,this._duration,this._runtimeFps)&&(this._paused?this.seek(e.start):this._jumpWhilePlaying(e.start))}_jumpWhilePlaying(e){this._directTimelineAdapter?(this._directTimelineAdapter.seek(e,!1),this._currentTime=e):this._runtimeOwnsPlayRange||(this.seek(e),this._enteringRange=!0,this._play(!1))}_clockStop(){let e=this._playRange(),n=e?.end??this._duration;if(!e)return{end:n,shown:n};let i=me(e,this._duration,this._runtimeFps);return{end:n,shown:i<n?(i+n)/2:i}}_sendControl(e,n={}){try{let i=this.iframe.contentWindow;return i?(i.postMessage({...n,source:"hf-parent",type:"control",action:e,...ft(this._runtimeFps)},"*"),!0):((e==="set-runtime-data"||e==="clear-runtime-data")&&this._rejectRuntimeDataDelivery(n.channel,n.requestId,"Composition iframe is unavailable"),!1)}catch(i){return(e==="set-runtime-data"||e==="clear-runtime-data")&&this._rejectRuntimeDataDelivery(n.channel,n.requestId,i instanceof Error?i.message:String(i)),!1}}_deliverRuntimeData(e,n){if(!this.isConnected||!this._runtimeBridgeReady)return;let i=this._beginRuntimeDataDelivery(e);this._trySetRuntimeDataDirect(e,n,i)||this._sendControl("set-runtime-data",{channel:e,payload:n,requestId:i})}_deliverRuntimeDataClear(e){if(!this.isConnected||!this._runtimeBridgeReady)return;let n=this._beginRuntimeDataDelivery(e);this._tryClearRuntimeDataDirect(e,n)||this._sendControl("clear-runtime-data",{channel:e,requestId:n})}_trySetRuntimeDataDirect(e,n,i){try{let r=this.iframe.contentWindow?.__hyperframes;return typeof r?.setRuntimeData!="function"?!1:(r.setRuntimeData(e,n,i),!0)}catch{return!1}}_tryClearRuntimeDataDirect(e,n){try{let i=this.iframe.contentWindow?.__hyperframes;return typeof i?.clearRuntimeData!="function"?!1:(i.clearRuntimeData(e,n),!0)}catch{return!1}}_replayRuntimeData(){for(let[e,n]of this._runtimeData)this._deliverRuntimeData(e,n)}_beginRuntimeDataDelivery(e){let n=this._pendingRuntimeData.get(e);n&&window.clearTimeout(n.timeoutId),this._runtimeDataRequestId+=1;let i=this._runtimeDataRequestId,r=window.setTimeout(()=>{this._rejectRuntimeDataDelivery(e,i,`Runtime data delivery timed out after ${ti}ms`)},ti);return this._pendingRuntimeData.set(e,{requestId:i,timeoutId:r}),i}_resolveRuntimeDataDelivery(e,n){let i=this._takeRuntimeDataDelivery(e,n);i&&this._emit(new CustomEvent("runtimedataapplied",{detail:{channel:e,requestId:i.requestId}}))}_rejectRuntimeDataDelivery(e,n,i){let r=this._takeRuntimeDataDelivery(e,n);r&&this._emit(new CustomEvent("runtimedataerror",{detail:{channel:e,requestId:r.requestId,message:typeof i=="string"?i:String(i)}}))}_takeRuntimeDataDelivery(e,n){if(typeof e!="string"||typeof n!="number"||!Number.isSafeInteger(n))return null;let i=this._pendingRuntimeData.get(e);return!i||i.requestId!==n?null:(window.clearTimeout(i.timeoutId),this._pendingRuntimeData.delete(e),i)}_rejectAllRuntimeDataDeliveries(e){for(let[n,i]of[...this._pendingRuntimeData])this._rejectRuntimeDataDelivery(n,i.requestId,e)}_getSameOriginIframeDocument(){try{return this.iframe.contentDocument}catch{return null}}_setIframeMediaMuted(e){let n=this._getSameOriginIframeDocument();if(n)for(let i of n.querySelectorAll("video, audio"))x(i)&&(i.muted=e||i.defaultMuted)}_stopIframeMedia(){let e=this._getSameOriginIframeDocument();if(e)for(let n of e.querySelectorAll("video, audio"))x(n)&&n.pause()}_replayBridgeState(){this._sendControl("set-muted",{muted:this.muted}),this._sendControl("set-volume",{volume:this._volume}),this._sendControl("set-playback-rate",{playbackRate:this.playbackRate}),this._sendControl("set-native-media-sync-disabled",{disabled:this._isSlideshowPlayer()}),this._sendControl("set-web-audio-media-disabled",{disabled:this._isSlideshowPlayer()}),this._sendControl("set-idle-heartbeat",{slow:this.hasAttribute(Tt)}),this._sendDisplayScale()}_sendDisplayScale(){let e=Vn(this.iframe);e&&this._sendControl("set-display-scale",{scale:e})}_reloadShaderOptions(){if(!this._videoSource){if(this._abandonComposition("Shader options changed before runtime data was applied"),this.hasAttribute("srcdoc")){this.iframe.srcdoc=fe(this,this.getAttribute("srcdoc")||"");return}this.hasAttribute("src")&&this._loadSrc(this.getAttribute("src")||"")}}_navigateSrc(e){this._pendingPlay=!1,this._pauseForVideoSwitch(),this._abandonComposition("Composition navigated before runtime data was applied"),this._loadSrc(e)}_wantsVideo(){return Qn(this.getAttribute("type"))&&!this.hasAttribute("srcdoc")}_pauseForVideoSwitch(){!this._videoSource&&!this._wantsVideo()||(this._paused=!0,this.controlsApi?.updatePlaying(!1))}_loadSrc(e){if(this._wantsVideo()){this._loadVideo(e);return}this._teardownVideo(),this.iframe.src=Jn(this,e)}_loadVideo(e){this._videoSource||(this._videoSource=ei({onMetadata:r=>this._applyThenEmit(()=>this._onVideoReady(r)),onDurationChange:r=>this._applyTimelineDuration(r.duration),onResize:r=>this._applyVideoSize(r),onPlay:r=>{!r.paused&&this._paused&&this.play()},onPause:r=>{r.paused&&!r.ended&&!this._paused&&this.pause()},onTimeUpdate:()=>{document.hidden&&this._playRange()&&this._directTimelineClock.poll()},onError:(r,o)=>{this._paused||this.pause(),this._emit(new CustomEvent("error",{detail:{message:r,code:o}}))},onPlayRejected:r=>this._onVideoPlayRejected(r)}),this.container.appendChild(this._videoSource.video),this.iframe.hidden=!0,this.iframe.src="about:blank"),this.probe.stop();let{video:n,adapter:i}=this._videoSource;this._directTimelineAdapter=i,this._currentTime=0,this._duration=0,this.controlsApi?.updateTime(0,0),this._syncVideoAudio(),i.timeScale?.(this.playbackRate),n.src=e}_teardownVideo(){this._videoSource&&(this._videoSource.destroy(),this._videoSource=null,this.iframe.hidden=!1)}_syncVideoAudio(){this._videoSource&&(this._videoSource.video.muted=this.muted,this._videoSource.video.volume=this._volume)}_onVideoReady(e){this._applyTimelineDuration(e.duration),this._applyVideoSize(e),this._ready=!0,this._dispatchReady(),this._waitForAssetsReady(null),this._afterEvents(()=>{this.hasAttribute("autoplay")&&this._paused&&this.play()})}_applyTimelineDuration(e){!Number.isFinite(e)||e<=0||(this._setDuration(e),this.controlsApi?.updateTime(this._currentTime,e))}_applyVideoSize(e){e.videoWidth>0&&e.videoHeight>0&&this._setCompositionSize(e.videoWidth,e.videoHeight)}_onVideoPlayRejected(e){e instanceof DOMException&&e.name==="NotAllowedError"&&(this._paused||this.pause(),this._emit(new CustomEvent("playbackerror",{detail:{source:"video",error:e}})))}_trySyncSeek(e){if(this._videoSource)return!1;try{let i=this.iframe.contentWindow?.__player;return typeof i?.seek!="function"?!1:(i.seek.call(i,e),!0)}catch{return!1}}_withDirectTimeline(e){let n=this._videoSource?null:this.probe.resolveDirectTimelineAdapter(),i=n||this._directTimelineAdapter;if(!i)return!1;try{return e(i),n&&n!==this._directTimelineAdapter&&this._applyTimelineDuration(n.duration()),this._directTimelineAdapter=i,!0}catch{return!1}}_tryDirectTimelineSeek(e){return this._withDirectTimeline(n=>{n.seek(e,!1),n.pause()})}_tryDirectTimelinePlay(){return this._withDirectTimeline(e=>{e.play()})}_tryDirectTimelinePause(){return this._withDirectTimeline(e=>{e.pause()})}_showPausedVideoTime(){this._videoSource&&(this._currentTime=this._videoSource.video.currentTime,this.controlsApi?.updateTime(this._currentTime,this._duration),this._emit(new CustomEvent("timeupdate",{detail:{currentTime:this._currentTime}})))}_startParentTickClock(){this._stopParentTickClock();let e=()=>{if(this._paused){this._parentTickRaf=null;return}this._sendControl("tick"),this._parentTickRaf=requestAnimationFrame(e)};this._parentTickRaf=requestAnimationFrame(e)}_stopParentTickClock(){this._parentTickRaf!==null&&(cancelAnimationFrame(this._parentTickRaf),this._parentTickRaf=null)}_onMessage(e){this._videoSource||this.probe.failed||this._applyThenEmit(()=>this._handleRuntimeMessage(e))}_handleRuntimeMessage(e){zn(e,this.iframe.contentWindow,{getPlaybackState:()=>({currentTime:this._currentTime,duration:this._duration,paused:this._paused,lastUpdateMs:this._lastUpdateMs,enteringRange:this._enteringRange}),setPlaybackState:({currentTime:n,duration:i,paused:r,lastUpdateMs:o,enteringRange:a})=>{this._enteringRange=a===!0,this._currentTime=n,this._setDuration(i),this._paused=r,this._lastUpdateMs=o},getShaderLoadingMode:()=>pe(this),shaderLoader:this.shaderLoader,setCompositionSize:(n,i)=>this._setCompositionSize(n,i),sendControl:(n,i)=>this._sendControl(n,i),getIframeDoc:()=>this.iframe.contentDocument,onRuntimeReady:()=>{this._runtimeBridgeReady=!0,this._replayBridgeState(),this._hasPlayRange()&&this._sendPlayRange(this._playRange()),this._replayRuntimeData()},onRuntimeAssetsReady:()=>{this._runtimeAssetsReadyGeneration===this._assetsGeneration&&this._settleAssetsReady(this._assetsGeneration)},onRuntimeDataApplied:(n,i)=>this._resolveRuntimeDataDelivery(n,i),onRuntimeDataError:(n,i,r)=>this._rejectRuntimeDataDelivery(n,i,r),onRuntimeTimelineReady:(n,i)=>this._onRuntimeTimelineReady(n,i),setRuntimeFps:n=>{this._runtimeFps=n},setRuntimeOwnsPlayRange:n=>{this._runtimeOwnsPlayRange=n},shouldPromoteMediaAutoplayFallback:()=>!this._isSlideshowPlayer(),setScenes:n=>{this._scenes=n,this._emit(new CustomEvent("scenes",{detail:{scenes:n}}))},updateControlsTime:(n,i)=>this.controlsApi?.updateTime(n,i),updateControlsPlaying:n=>this.controlsApi?.updatePlaying(n),dispatchEvent:n=>this._emit(n),seek:n=>this.seek(n),play:()=>this.play(),getLoop:()=>this.loop,getPlayRange:()=>this._playRange(),media:this._media})}_onRuntimeTimelineReady(e,n){if(this._ready)return;this.probe.stop(),this._setDuration(e),this._directTimelineAdapter=null,this._ready=!0,this.controlsApi?.updateTime(this._currentTime,e),this._dispatchReady();let i=this._getSameOriginIframeDocument();i&&this._media.setupFromIframe(i),this._replayBridgeState(),this._setIframeMediaMuted(this.muted),this._waitForAssetsReady(i,n),this._playWhenWanted()}_onProbeReady(e){this._applyThenEmit(()=>this._applyProbeResult(e))}_applyProbeResult({duration:e,adapter:n,compositionSize:i}){this._setDuration(e),this._directTimelineAdapter=n.kind==="direct-timeline"?n.timeline:null,i&&this._setCompositionSize(i.width,i.height),this._ready=!0,this.controlsApi?.updateTime(0,e),this._dispatchReady();let r=this._getSameOriginIframeDocument();r&&this._media.setupFromIframe(r),this._setIframeMediaMuted(this.muted),this._waitForAssetsReady(r),this._playWhenWanted()}_waitForAssetsReady(e,n){this._clearAssetsLoadingShowTimer(),this._assetsReady=!1,this._painted=!1;let i=++this._assetsGeneration;if(!e){n===!1?(this._runtimeAssetsReadyGeneration=i,this._startAssetsLoadingOverlayTimer(i),setTimeout(()=>this._settleAssetsReady(i),St)):this._settleAssetsReady(i);return}$n(e,({timedOut:r})=>{i===this._assetsGeneration&&(r&&this._warnStuckAssets(e),this._settleAssetsReady(i))},{timeoutMs:St}),this._assetsReady||this._startAssetsLoadingOverlayTimer(i)}_startAssetsLoadingOverlayTimer(e){this._assetsLoadingShowTimer=setTimeout(()=>{this._assetsLoadingShowTimer=null,!(e!==this._assetsGeneration||this._assetsReady)&&(this.setAttribute(Et,""),this.assetsLoadingUi!=="none"&&this.shaderLoader.showAssetsLoading())},to)}_hasPendingFirstFrameAssets(e){let{pendingMedia:n,pendingImages:i,fontsLoading:r}=Ue(e,{scope:j});return n.length>0||i.length>0||r}_warnStuckAssets(e){let{pendingMedia:n,pendingImages:i,fontsLoading:r}=Ue(e,{scope:j}),o=e.defaultView;console.warn(`[hyperframes-player] assets-loading timed out after ${St}ms, playing anyway`,{stuckMedia:n.map(a=>a.currentSrc||a.getAttribute("src")||`<${a.tagName.toLowerCase()}>`),stuckImages:i.map(a=>a.currentSrc||a.getAttribute("src")||"<img>"),fontsLoading:r,computeReady:o?.__renderReady===!0,documentHidden:e.hidden===!0})}_settleAssetsReady(e){e!==this._assetsGeneration||this._assetsReady||(this._clearAssetsLoadingShowTimer(),this._assetsReady=!0,this.removeAttribute(Et),this.shaderLoader.hideAssetsLoading(),this._emit(new Event("assetsready")),this.shaderLoader.whenHidden(()=>{e===this._assetsGeneration&&(this._painted=!0,this._emit(new Event("painted")))}),this._afterEvents(()=>{this._pendingPlay&&this.play()}))}_abandonComposition(e){this.probe.stop(),this._ready=!1,this._readyDocument=null,this._invalidateAssetsWait(),this._releaseDocument(),this._runtimeBridgeReady=!1,this._rejectAllRuntimeDataDeliveries(e)}_releaseDocument(){this._runtimeOwnsPlayRange=!1,this._enteringRange=!1,this._directTimelineAdapter=null,this._directTimelineClock.stop(),this._stopParentTickClock(),this.shaderLoader.reset(),this._media.resetForIframeLoad()}_invalidateAssetsWait(){this._clearAssetsLoadingShowTimer(),this._assetsReady=!1,this._painted=!1,this._assetsGeneration++,this.removeAttribute(Et),this.shaderLoader.hide()}_clearAssetsLoadingShowTimer(){this._assetsLoadingShowTimer!==null&&(clearTimeout(this._assetsLoadingShowTimer),this._assetsLoadingShowTimer=null)}_dispatchReady(){this._readyDocument=this._getSameOriginIframeDocument();let e={duration:this._duration,compositionWidth:this._compositionWidth,compositionHeight:this._compositionHeight};this._emit(new CustomEvent("ready",{detail:e})),this._rescale(),this._rangeClampReported="",this._hasPlayRange()&&this._applyPlayRange(!0)}_setDuration(e){e!==this._duration&&(this._duration=e,this._ready&&(this._emit(new CustomEvent("durationchange",{detail:{duration:e}})),this._hasPlayRange()&&this._applyPlayRange(!1)))}_setCompositionSize(e,n){let i=e!==this._compositionWidth||n!==this._compositionHeight;if(this._compositionWidth=e,this._compositionHeight=n,this.sizer.style.aspectRatio=`${e} / ${n}`,this._rescale(),!i)return;let r={compositionWidth:e,compositionHeight:n};this._emit(new CustomEvent("resize",{detail:r}))}_applyThenEmit(e){if(this._afterUpdate){e();return}let n=[];this._afterUpdate=n;let i=[],r=o=>{try{o()}catch(a){i.push(a)}};r(e);for(let o of n)r(o);if(this._afterUpdate=null,i.length>0)throw i[0]}_afterEvents(e){this._afterUpdate?this._afterUpdate.push(e):e()}_playWhenWanted(){this._afterEvents(()=>{(this.hasAttribute("autoplay")||this._pendingPlay)&&this.play()})}_emit(e){this._afterEvents(()=>this.dispatchEvent(e))}_rescale(){let e=In(this,this.iframe,this._compositionWidth,this._compositionHeight);e&&this._sendDisplayScale(),!e&&this._ready&&!this._rescaleWarned&&(this._rescaleWarned=!0,console.warn("[hyperframes-player] rescale no-op after ready: zero-size player element",{src:this.getAttribute("src"),offsetWidth:this.offsetWidth,offsetHeight:this.offsetHeight,compositionWidth:this._compositionWidth,compositionHeight:this._compositionHeight}))}_onIframeLoad(){if(!this._connected||this._videoSource)return;let e=this._getSameOriginIframeDocument();if(this._ready&&e===this._readyDocument){e&&this._hasPendingFirstFrameAssets(e)&&this._waitForAssetsReady(e);return}this._ready=!1,this._invalidateAssetsWait(),this._releaseDocument(),this.probe.start()}_setupControls(){this.controlsApi||(this.controlsApi=wn(this.shadow,this.muted,this._volume,this.getAttribute("speed-presets"),{onPlay:()=>this.play(),onPause:()=>this.pause(),onSeek:e=>this.seek(e*this._duration),onScrubStart:()=>{this._scrubbing=!0},onScrubEnd:()=>{this._scrubbing=!1,this.seek(this._currentTime)},onSpeedChange:e=>{this.playbackRate=e},onMuteToggle:()=>{this.muted=!this.muted},onVolumeChange:e=>{this.volume=e}},this._isAudioLocked()))}get _audioOwner(){return this._media.audioOwner}get _parentMedia(){return this._media.entries}_mirrorParentMediaTime(e,n){this._media.mirrorTime(e,n)}_promoteToParentProxy(){let e=null;try{e=this.iframe.contentDocument}catch{}this._media.promoteToParentProxy(e,(n,i)=>this._mirrorParentMediaTime(n,i)),this._sendControl("set-media-output-muted",{muted:!0})}_observeDynamicMedia(e){this._media.setupFromIframe(e)}};customElements.get("hyperframes-player")||customElements.define("hyperframes-player",Ge);return li(no);})();
|