@omerdlw/base-framework 3.4.0 → 3.4.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/README.md +56 -72
- package/dist/ambient/index.js +10 -10
- package/dist/ambient/server/index.js +3 -3
- package/dist/ambient/server/index.js.map +1 -1
- package/dist/ambient/worker/index.js +7 -4
- package/dist/ambient/worker/index.js.map +1 -1
- package/dist/background/index.js +9 -9
- package/dist/chunk-2E6OASVV.js +17 -0
- package/dist/{chunk-AZ2ZDFNP.js.map → chunk-2E6OASVV.js.map} +1 -1
- package/dist/{chunk-ESD5EQ5H.js → chunk-3JLG24KI.js} +11 -22
- package/dist/chunk-3JLG24KI.js.map +1 -0
- package/dist/{chunk-CRKJAACG.js → chunk-4QQ3QVY7.js} +10 -10
- package/dist/{chunk-CRKJAACG.js.map → chunk-4QQ3QVY7.js.map} +1 -1
- package/dist/{chunk-7VU2OAJB.js → chunk-6LWCTP2Y.js} +21 -37
- package/dist/chunk-6LWCTP2Y.js.map +1 -0
- package/dist/{chunk-YZS2B6YE.js → chunk-7A47AXKI.js} +9 -11
- package/dist/chunk-7A47AXKI.js.map +1 -0
- package/dist/{chunk-LKYW4LH6.js → chunk-BLWJZHRL.js} +36 -43
- package/dist/chunk-BLWJZHRL.js.map +1 -0
- package/dist/{chunk-ZXRE2KZO.js → chunk-C3SEBNF5.js} +11 -15
- package/dist/chunk-C3SEBNF5.js.map +1 -0
- package/dist/{chunk-KOYTJW5E.js → chunk-DC4XZPDK.js} +7 -7
- package/dist/chunk-DC4XZPDK.js.map +1 -0
- package/dist/{chunk-HFR6YROB.js → chunk-DGVRHX3C.js} +1160 -1171
- package/dist/chunk-DGVRHX3C.js.map +1 -0
- package/dist/{chunk-VNSMNGWP.js → chunk-DMQKXBWO.js} +5 -5
- package/dist/{chunk-VNSMNGWP.js.map → chunk-DMQKXBWO.js.map} +1 -1
- package/dist/{chunk-67MOKJFZ.js → chunk-E2QQJZYY.js} +16 -16
- package/dist/chunk-E2QQJZYY.js.map +1 -0
- package/dist/{chunk-WZ5T2NXH.js → chunk-EBNZXYLT.js} +17 -15
- package/dist/chunk-EBNZXYLT.js.map +1 -0
- package/dist/{chunk-IH3STE7W.js → chunk-ED32WLAD.js} +1168 -1215
- package/dist/chunk-ED32WLAD.js.map +1 -0
- package/dist/{chunk-RGC2VFQO.js → chunk-FLYL76ZT.js} +6 -6
- package/dist/{chunk-RGC2VFQO.js.map → chunk-FLYL76ZT.js.map} +1 -1
- package/dist/{chunk-UQLTP3XB.js → chunk-GTJMM32W.js} +144 -144
- package/dist/chunk-GTJMM32W.js.map +1 -0
- package/dist/{chunk-FFJWJ4OB.js → chunk-HPJWMBUS.js} +12333 -12368
- package/dist/chunk-HPJWMBUS.js.map +1 -0
- package/dist/{chunk-TAWTGCWJ.js → chunk-ICFPSAJZ.js} +7 -8
- package/dist/chunk-ICFPSAJZ.js.map +1 -0
- package/dist/{chunk-WQTMOUCA.js → chunk-JWUKAZ3A.js} +45 -67
- package/dist/chunk-JWUKAZ3A.js.map +1 -0
- package/dist/{chunk-QRXDXAQI.js → chunk-KN4KOTC7.js} +161 -165
- package/dist/chunk-KN4KOTC7.js.map +1 -0
- package/dist/{chunk-QGPRTUED.js → chunk-KRHH3UQ6.js} +34 -37
- package/dist/chunk-KRHH3UQ6.js.map +1 -0
- package/dist/{chunk-R4K6VAOK.js → chunk-M36DFIJ6.js} +11 -18
- package/dist/chunk-M36DFIJ6.js.map +1 -0
- package/dist/{chunk-UDJ7ARCH.js → chunk-S2ZOLTTS.js} +3 -3
- package/dist/{chunk-UDJ7ARCH.js.map → chunk-S2ZOLTTS.js.map} +1 -1
- package/dist/{chunk-D222OCTV.js → chunk-S67HGKJ2.js} +49 -55
- package/dist/chunk-S67HGKJ2.js.map +1 -0
- package/dist/chunk-ST7QOM4O.js +29 -0
- package/dist/chunk-ST7QOM4O.js.map +1 -0
- package/dist/{chunk-RDYYP36I.js → chunk-TMKA5ZHO.js} +7 -6
- package/dist/chunk-TMKA5ZHO.js.map +1 -0
- package/dist/{chunk-XGAYTDSI.js → chunk-UWX7GCNX.js} +23 -26
- package/dist/chunk-UWX7GCNX.js.map +1 -0
- package/dist/{chunk-6IP6YFQX.js → chunk-VMR7ZKIF.js} +21 -31
- package/dist/chunk-VMR7ZKIF.js.map +1 -0
- package/dist/{chunk-BMFHS3GV.js → chunk-YHWA7FXX.js} +22 -12
- package/dist/chunk-YHWA7FXX.js.map +1 -0
- package/dist/{chunk-GKAJ4EM2.js → chunk-ZQI4ZCVU.js} +83 -83
- package/dist/chunk-ZQI4ZCVU.js.map +1 -0
- package/dist/context-menu/index.js +16 -15
- package/dist/controls/index.js +7 -6
- package/dist/core/error/boundary.d.ts.map +1 -1
- package/dist/core/error/constants.d.ts +9 -0
- package/dist/core/error/constants.d.ts.map +1 -1
- package/dist/core/error/index.d.ts +2 -3
- package/dist/core/error/index.d.ts.map +1 -1
- package/dist/core/error/listener.d.ts.map +1 -1
- package/dist/core/error/reporter.d.ts +7 -6
- package/dist/core/error/reporter.d.ts.map +1 -1
- package/dist/core/error/utils.d.ts.map +1 -1
- package/dist/core/kernel/constants.d.ts +1 -1
- package/dist/core/kernel/constants.d.ts.map +1 -1
- package/dist/core/kernel/{compose.d.ts → host/compose.d.ts} +0 -4
- package/dist/core/kernel/host/compose.d.ts.map +1 -0
- package/dist/core/kernel/{installed.d.ts → host/installed.d.ts} +1 -1
- package/dist/core/kernel/host/installed.d.ts.map +1 -0
- package/dist/core/kernel/{module.d.ts → host/module.d.ts} +2 -5
- package/dist/core/kernel/host/module.d.ts.map +1 -0
- package/dist/core/kernel/{adapters.d.ts → host/registration.d.ts} +2 -2
- package/dist/core/kernel/host/registration.d.ts.map +1 -0
- package/dist/core/kernel/index.d.ts +12 -12
- package/dist/core/kernel/index.d.ts.map +1 -1
- package/dist/core/kernel/{page-controller.d.ts → page.d.ts} +2 -2
- package/dist/core/kernel/page.d.ts.map +1 -0
- package/dist/core/kernel/{handlers.d.ts → registry/apply.d.ts} +2 -2
- package/dist/core/kernel/registry/apply.d.ts.map +1 -0
- package/dist/core/kernel/{hooks.d.ts → registry/hooks.d.ts} +1 -1
- package/dist/core/kernel/registry/hooks.d.ts.map +1 -0
- package/dist/core/kernel/{operations.d.ts → registry/operations.d.ts} +2 -2
- package/dist/core/kernel/registry/operations.d.ts.map +1 -0
- package/dist/core/kernel/{provider.d.ts → registry/provider.d.ts} +2 -2
- package/dist/core/kernel/registry/provider.d.ts.map +1 -0
- package/dist/core/kernel/{operations-records.d.ts → registry/records.d.ts} +2 -2
- package/dist/core/kernel/registry/records.d.ts.map +1 -0
- package/dist/core/kernel/registry/registration.d.ts +13 -0
- package/dist/core/kernel/registry/registration.d.ts.map +1 -0
- package/dist/core/kernel/{schema.d.ts → registry/schema.d.ts} +1 -1
- package/dist/core/kernel/registry/schema.d.ts.map +1 -0
- package/dist/core/kernel/{store-snapshots.d.ts → registry/snapshots.d.ts} +3 -3
- package/dist/core/kernel/registry/snapshots.d.ts.map +1 -0
- package/dist/core/kernel/{stabilize.d.ts → registry/stabilize.d.ts} +1 -1
- package/dist/core/kernel/registry/stabilize.d.ts.map +1 -0
- package/dist/core/kernel/{store.d.ts → registry/store.d.ts} +2 -2
- package/dist/core/kernel/registry/store.d.ts.map +1 -0
- package/dist/core/kernel/{store-subscriptions.d.ts → registry/subscriptions.d.ts} +2 -6
- package/dist/core/kernel/registry/subscriptions.d.ts.map +1 -0
- package/dist/core/kernel/{runtime.d.ts → registry/transaction.d.ts} +2 -2
- package/dist/core/kernel/registry/transaction.d.ts.map +1 -0
- package/dist/core/kernel/{types-modules.d.ts → types/modules.d.ts} +4 -4
- package/dist/core/kernel/types/modules.d.ts.map +1 -0
- package/dist/core/kernel/{types-page.d.ts → types/page.d.ts} +3 -3
- package/dist/core/kernel/types/page.d.ts.map +1 -0
- package/dist/core/kernel/{types.d.ts → types/registry.d.ts} +4 -4
- package/dist/core/kernel/types/registry.d.ts.map +1 -0
- package/dist/core/kernel/{types-store.d.ts → types/store.d.ts} +3 -3
- package/dist/core/kernel/types/store.d.ts.map +1 -0
- package/dist/core/kernel/utils.d.ts +1 -1
- package/dist/core/kernel/utils.d.ts.map +1 -1
- package/dist/core/navigation/{navigator-holds.d.ts → holds.d.ts} +2 -1
- package/dist/core/navigation/holds.d.ts.map +1 -0
- package/dist/core/navigation/navigator.d.ts.map +1 -1
- package/dist/core/navigation/{navigator-patience.d.ts → patience.d.ts} +1 -1
- package/dist/core/navigation/patience.d.ts.map +1 -0
- package/dist/core/navigation/{navigator-payload.d.ts → payload.d.ts} +2 -1
- package/dist/core/navigation/payload.d.ts.map +1 -0
- package/dist/core/navigation/{navigator-prefetch.d.ts → prefetch.d.ts} +2 -1
- package/dist/core/navigation/prefetch.d.ts.map +1 -0
- package/dist/core/navigation/settings.d.ts.map +1 -1
- package/dist/core/navigation/state.d.ts.map +1 -1
- package/dist/core/navigation/utils.d.ts +3 -0
- package/dist/core/navigation/utils.d.ts.map +1 -1
- package/dist/core/provider/index.d.ts +1 -1
- package/dist/core/provider/index.d.ts.map +1 -1
- package/dist/dock/index.js +15 -14
- package/dist/error/index.js +7 -7
- package/dist/events/index.js +24 -20
- package/dist/events/index.js.map +1 -1
- package/dist/foundation/events/index.d.ts.map +1 -1
- package/dist/foundation/recipes/recipe.d.ts.map +1 -1
- package/dist/foundation/result/index.d.ts.map +1 -1
- package/dist/foundation/utils/collections.d.ts +11 -0
- package/dist/foundation/utils/collections.d.ts.map +1 -0
- package/dist/foundation/utils/dom.d.ts.map +1 -1
- package/dist/foundation/utils/report.d.ts.map +1 -1
- package/dist/foundation/utils/scheduler.d.ts.map +1 -1
- package/dist/foundation/utils/store.d.ts.map +1 -1
- package/dist/foundation/utils/string.d.ts.map +1 -1
- package/dist/foundation/utils/tempo.d.ts.map +1 -1
- package/dist/foundation/utils/timing.d.ts.map +1 -1
- package/dist/foundation/utils/user-message.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -3
- package/dist/index.js +25 -24
- package/dist/kernel/index.js +4 -4
- package/dist/loading/index.js +8 -8
- package/dist/media/index.js +5 -5
- package/dist/modal/index.js +155 -166
- package/dist/modal/index.js.map +1 -1
- package/dist/modules/ambient/{analyze.d.ts → analysis/analyze.d.ts} +3 -3
- package/dist/modules/ambient/analysis/analyze.d.ts.map +1 -0
- package/dist/modules/ambient/{analyze-bounds.d.ts → analysis/bounds.d.ts} +2 -2
- package/dist/modules/ambient/analysis/bounds.d.ts.map +1 -0
- package/dist/modules/ambient/{analyze-clusters.d.ts → analysis/clusters.d.ts} +3 -3
- package/dist/modules/ambient/analysis/clusters.d.ts.map +1 -0
- package/dist/modules/ambient/{analyze-ground.d.ts → analysis/ground.d.ts} +3 -3
- package/dist/modules/ambient/analysis/ground.d.ts.map +1 -0
- package/dist/modules/ambient/{analyze-measures.d.ts → analysis/measures.d.ts} +2 -2
- package/dist/modules/ambient/analysis/measures.d.ts.map +1 -0
- package/dist/modules/ambient/{oklab.d.ts → analysis/oklab.d.ts} +1 -3
- package/dist/modules/ambient/analysis/oklab.d.ts.map +1 -0
- package/dist/modules/ambient/analysis/quantize.d.ts.map +1 -0
- package/dist/modules/ambient/{analyze-swatches.d.ts → analysis/swatches.d.ts} +3 -3
- package/dist/modules/ambient/analysis/swatches.d.ts.map +1 -0
- package/dist/modules/ambient/hooks.d.ts +0 -1
- package/dist/modules/ambient/hooks.d.ts.map +1 -1
- package/dist/modules/ambient/index.d.ts +2 -2
- package/dist/modules/ambient/index.d.ts.map +1 -1
- package/dist/modules/ambient/module.d.ts +0 -3
- package/dist/modules/ambient/module.d.ts.map +1 -1
- package/dist/modules/ambient/pipeline.d.ts +6 -5
- package/dist/modules/ambient/pipeline.d.ts.map +1 -1
- package/dist/modules/ambient/server/index.d.ts +2 -2
- package/dist/modules/ambient/server/index.d.ts.map +1 -1
- package/dist/modules/ambient/settings.d.ts +0 -2
- package/dist/modules/ambient/settings.d.ts.map +1 -1
- package/dist/modules/ambient/worker/index.d.ts.map +1 -1
- package/dist/modules/background/constants.d.ts +3 -1
- package/dist/modules/background/constants.d.ts.map +1 -1
- package/dist/modules/background/context.d.ts +1 -1
- package/dist/modules/background/context.d.ts.map +1 -1
- package/dist/modules/background/hooks.d.ts +929 -0
- package/dist/modules/background/hooks.d.ts.map +1 -1
- package/dist/modules/background/index.d.ts +6 -6
- package/dist/modules/background/index.d.ts.map +1 -1
- package/dist/modules/background/module.d.ts +1 -1
- package/dist/modules/background/module.d.ts.map +1 -1
- package/dist/modules/background/{hooks/use-native-video-model.d.ts → native-video.d.ts} +4 -8
- package/dist/modules/background/native-video.d.ts.map +1 -0
- package/dist/modules/background/overlay.d.ts.map +1 -0
- package/dist/modules/background/playback.d.ts.map +1 -0
- package/dist/modules/background/{model/state.d.ts → state.d.ts} +11 -1
- package/dist/modules/background/state.d.ts.map +1 -0
- package/dist/modules/background/{model/visual.d.ts → visual.d.ts} +43 -6
- package/dist/modules/background/visual.d.ts.map +1 -0
- package/dist/modules/background/youtube/audio.d.ts.map +1 -0
- package/dist/modules/background/youtube/iframe.d.ts +92 -0
- package/dist/modules/background/youtube/iframe.d.ts.map +1 -0
- package/dist/modules/background/youtube/{lib/parse.d.ts → parse.d.ts} +1 -1
- package/dist/modules/background/youtube/parse.d.ts.map +1 -0
- package/dist/modules/background/youtube/{components/player.d.ts → player.d.ts} +1 -1
- package/dist/modules/background/youtube/player.d.ts.map +1 -0
- package/dist/modules/background/youtube/{lib/timing.d.ts → timing.d.ts} +0 -2
- package/dist/modules/background/youtube/timing.d.ts.map +1 -0
- package/dist/modules/background/youtube/use-iframe-player.d.ts +37 -0
- package/dist/modules/background/youtube/use-iframe-player.d.ts.map +1 -0
- package/dist/modules/background/youtube/{hooks/use-youtube-background-player-model.d.ts → use-player.d.ts} +2 -2
- package/dist/modules/background/youtube/use-player.d.ts.map +1 -0
- package/dist/modules/background/youtube/{hooks/use-youtube-video-sync.d.ts → use-video-sync.d.ts} +8 -4
- package/dist/modules/background/youtube/use-video-sync.d.ts.map +1 -0
- package/dist/modules/background/youtube/{lib/video-events.d.ts → video-events.d.ts} +8 -8
- package/dist/modules/background/youtube/video-events.d.ts.map +1 -0
- package/dist/modules/context-menu/dom.d.ts.map +1 -1
- package/dist/modules/context-menu/items.d.ts.map +1 -1
- package/dist/modules/context-menu/overlay.d.ts +3 -10
- package/dist/modules/context-menu/overlay.d.ts.map +1 -1
- package/dist/modules/context-menu/resolver.d.ts.map +1 -1
- package/dist/modules/controls/overlay.d.ts +0 -10
- package/dist/modules/controls/overlay.d.ts.map +1 -1
- package/dist/modules/dock/{lib → card}/banner.d.ts +3 -16
- package/dist/modules/dock/card/banner.d.ts.map +1 -0
- package/dist/modules/dock/{components/card-item.d.ts → card/card.d.ts} +5 -2
- package/dist/modules/dock/card/card.d.ts.map +1 -0
- package/dist/modules/dock/card/compact.d.ts.map +1 -0
- package/dist/modules/dock/{components/item-content.d.ts → card/content.d.ts} +1 -1
- package/dist/modules/dock/card/content.d.ts.map +1 -0
- package/dist/modules/dock/card/header.d.ts +8 -0
- package/dist/modules/dock/card/header.d.ts.map +1 -0
- package/dist/modules/dock/{components → card}/icon.d.ts +1 -1
- package/dist/modules/dock/card/icon.d.ts.map +1 -0
- package/dist/modules/dock/{lib/card-item.d.ts → card/model.d.ts} +20 -2
- package/dist/modules/dock/card/model.d.ts.map +1 -0
- package/dist/modules/dock/{hooks/use-card-item-model.d.ts → card/use-card.d.ts} +6 -5
- package/dist/modules/dock/{hooks/use-card-item-model.d.ts.map → card/use-card.d.ts.map} +1 -1
- package/dist/modules/dock/commands/command-bar.d.ts.map +1 -0
- package/dist/modules/dock/{runtime/commands.d.ts → commands/registry.d.ts} +1 -1
- package/dist/modules/dock/commands/registry.d.ts.map +1 -0
- package/dist/modules/dock/constants.d.ts +4 -7
- package/dist/modules/dock/constants.d.ts.map +1 -1
- package/dist/modules/dock/context.d.ts +1 -1
- package/dist/modules/dock/context.d.ts.map +1 -1
- package/dist/modules/dock/hooks.d.ts +47 -0
- package/dist/modules/dock/hooks.d.ts.map +1 -0
- package/dist/modules/dock/{hud.d.ts → hud/hud.d.ts} +14 -7
- package/dist/modules/dock/hud/hud.d.ts.map +1 -0
- package/dist/modules/dock/{model/hud-definition.d.ts → hud/model.d.ts} +7 -1
- package/dist/modules/dock/hud/model.d.ts.map +1 -0
- package/dist/modules/dock/{components/hud-view.d.ts → hud/view.d.ts} +1 -1
- package/dist/modules/dock/hud/view.d.ts.map +1 -0
- package/dist/modules/dock/index.d.ts +22 -22
- package/dist/modules/dock/index.d.ts.map +1 -1
- package/dist/modules/dock/items/attention.d.ts +43 -0
- package/dist/modules/dock/items/attention.d.ts.map +1 -0
- package/dist/modules/dock/{runtime/model/items.d.ts → items/build.d.ts} +2 -2
- package/dist/modules/dock/items/build.d.ts.map +1 -0
- package/dist/modules/dock/{runtime → items}/display.d.ts +2 -5
- package/dist/modules/dock/items/display.d.ts.map +1 -0
- package/dist/modules/dock/items/operations.d.ts +22 -0
- package/dist/modules/dock/items/operations.d.ts.map +1 -0
- package/dist/modules/dock/{runtime → items}/pipeline.d.ts +1 -1
- package/dist/modules/dock/items/pipeline.d.ts.map +1 -0
- package/dist/modules/dock/{components/media-action.d.ts → media/controls.d.ts} +5 -2
- package/dist/modules/dock/media/controls.d.ts.map +1 -0
- package/dist/modules/dock/{lib/media.d.ts → media/model.d.ts} +1 -3
- package/dist/modules/dock/media/model.d.ts.map +1 -0
- package/dist/modules/dock/{components/media-scrubber.d.ts → media/scrubber.d.ts} +1 -1
- package/dist/modules/dock/media/scrubber.d.ts.map +1 -0
- package/dist/modules/dock/{hooks/use-media-controls-model.d.ts → media/use-controls.d.ts} +8 -8
- package/dist/modules/dock/media/use-controls.d.ts.map +1 -0
- package/dist/modules/dock/module.d.ts.map +1 -1
- package/dist/modules/dock/motion.d.ts +3 -4
- package/dist/modules/dock/motion.d.ts.map +1 -1
- package/dist/modules/dock/provider.d.ts.map +1 -1
- package/dist/modules/dock/routing/breadcrumbs-card.d.ts.map +1 -0
- package/dist/modules/dock/routing/{model/continuity.d.ts → continuity-state.d.ts} +2 -2
- package/dist/modules/dock/routing/continuity-state.d.ts.map +1 -0
- package/dist/modules/dock/routing/continuity.d.ts +8 -8
- package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
- package/dist/modules/dock/routing/navigation.d.ts +0 -10
- package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
- package/dist/modules/dock/routing/paths.d.ts.map +1 -0
- package/dist/modules/dock/routing/{model/policy.d.ts → policy.d.ts} +1 -1
- package/dist/modules/dock/routing/policy.d.ts.map +1 -0
- package/dist/modules/dock/routing/{hooks/use-route-prefetch.d.ts → prefetch.d.ts} +3 -3
- package/dist/modules/dock/routing/prefetch.d.ts.map +1 -0
- package/dist/modules/dock/routing/route-bridge.d.ts +8 -0
- package/dist/modules/dock/routing/route-bridge.d.ts.map +1 -0
- package/dist/modules/dock/routing/{model/topology.d.ts → topology.d.ts} +1 -1
- package/dist/modules/dock/routing/topology.d.ts.map +1 -0
- package/dist/modules/dock/{runtime/model → stack}/cards.d.ts +8 -5
- package/dist/modules/dock/stack/cards.d.ts.map +1 -0
- package/dist/modules/dock/stack/dock.d.ts.map +1 -0
- package/dist/modules/dock/stack/focus.d.ts +22 -0
- package/dist/modules/dock/stack/focus.d.ts.map +1 -0
- package/dist/modules/dock/{model → stack}/layout.d.ts +8 -2
- package/dist/modules/dock/stack/layout.d.ts.map +1 -0
- package/dist/modules/dock/{runtime/dock.d.ts → stack/use-dock-model.d.ts} +2 -1
- package/dist/modules/dock/stack/use-dock-model.d.ts.map +1 -0
- package/dist/modules/dock/{runtime/hooks → stack}/use-dock.d.ts +9 -9
- package/dist/modules/dock/stack/use-dock.d.ts.map +1 -0
- package/dist/modules/dock/stack/use-height.d.ts +12 -0
- package/dist/modules/dock/stack/use-height.d.ts.map +1 -0
- package/dist/modules/dock/{components/status-actions.d.ts → status/actions.d.ts} +1 -1
- package/dist/modules/dock/status/actions.d.ts.map +1 -0
- package/dist/modules/dock/status/events.d.ts +4 -4
- package/dist/modules/dock/status/events.d.ts.map +1 -1
- package/dist/modules/dock/status/hooks.d.ts.map +1 -1
- package/dist/modules/dock/status/model.d.ts +34 -4
- package/dist/modules/dock/status/model.d.ts.map +1 -1
- package/dist/modules/dock/surface/{model/builder.d.ts → builder.d.ts} +13 -7
- package/dist/modules/dock/surface/builder.d.ts.map +1 -0
- package/dist/modules/dock/{components/surface/item-content.d.ts → surface/content.d.ts} +2 -2
- package/dist/modules/dock/surface/content.d.ts.map +1 -0
- package/dist/modules/dock/surface/context.d.ts +12 -3
- package/dist/modules/dock/surface/context.d.ts.map +1 -1
- package/dist/modules/dock/surface/controls.d.ts +26 -0
- package/dist/modules/dock/surface/controls.d.ts.map +1 -0
- package/dist/modules/dock/surface/definition.d.ts.map +1 -1
- package/dist/modules/dock/{components/surface → surface}/extensions-bar.d.ts +1 -1
- package/dist/modules/dock/surface/extensions-bar.d.ts.map +1 -0
- package/dist/modules/dock/{components/surface/action.d.ts → surface/extensions.d.ts} +4 -2
- package/dist/modules/dock/surface/extensions.d.ts.map +1 -0
- package/dist/modules/dock/{components/surface → surface}/header-button.d.ts +3 -3
- package/dist/modules/dock/surface/header-button.d.ts.map +1 -0
- package/dist/modules/dock/surface/helpers.d.ts +13 -1
- package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
- package/dist/modules/dock/surface/{model/normalize.d.ts → normalize.d.ts} +1 -1
- package/dist/modules/dock/surface/normalize.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/choreography.d.ts +28 -2
- package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -1
- package/dist/modules/dock/surface/runtime/flows.d.ts +1 -1
- package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -1
- package/dist/modules/dock/surface/{machine.d.ts → runtime/machine.d.ts} +1 -1
- package/dist/modules/dock/surface/runtime/machine.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/open.d.ts +1 -2
- package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -1
- package/dist/modules/dock/surface/{model → runtime}/records.d.ts +1 -1
- package/dist/modules/dock/surface/runtime/records.d.ts.map +1 -0
- package/dist/modules/dock/surface/{stack.d.ts → runtime/stack.d.ts} +10 -10
- package/dist/modules/dock/surface/runtime/stack.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/steps.d.ts +1 -1
- package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -1
- package/dist/modules/dock/surface/{model/transition-state.d.ts → runtime/transition.d.ts} +1 -1
- package/dist/modules/dock/surface/runtime/transition.d.ts.map +1 -0
- package/dist/modules/dock/surface/runtime/url.d.ts.map +1 -0
- package/dist/modules/dock/surface/{hooks/use-surface-shell-model.d.ts → shell.d.ts} +9 -3
- package/dist/modules/dock/surface/shell.d.ts.map +1 -0
- package/dist/modules/dock/surface/{hooks/use-surface-flow.d.ts → use-flow.d.ts} +2 -2
- package/dist/modules/dock/surface/use-flow.d.ts.map +1 -0
- package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
- package/dist/modules/dock/{lib/styles.d.ts → theme.d.ts} +8 -4
- package/dist/modules/dock/theme.d.ts.map +1 -0
- package/dist/modules/dock/types/card.d.ts +12 -3
- package/dist/modules/dock/types/card.d.ts.map +1 -1
- package/dist/modules/dock/types/index.d.ts +1 -1
- package/dist/modules/dock/types/index.d.ts.map +1 -1
- package/dist/modules/dock/types/surface.d.ts +2 -2
- package/dist/modules/dock/types/surface.d.ts.map +1 -1
- package/dist/modules/dock/{lib/helpers.d.ts → utils.d.ts} +10 -3
- package/dist/modules/dock/utils.d.ts.map +1 -0
- package/dist/modules/index.js +23 -22
- package/dist/modules/loading/hooks.d.ts +2 -1
- package/dist/modules/loading/hooks.d.ts.map +1 -1
- package/dist/modules/loading/state.d.ts.map +1 -1
- package/dist/modules/media/hooks.d.ts.map +1 -1
- package/dist/modules/media/playback.d.ts.map +1 -1
- package/dist/modules/modal/constants.d.ts +3 -1
- package/dist/modules/modal/constants.d.ts.map +1 -1
- package/dist/modules/modal/{components/modal-container.d.ts → container.d.ts} +2 -2
- package/dist/modules/modal/container.d.ts.map +1 -0
- package/dist/modules/modal/context.d.ts +5 -1
- package/dist/modules/modal/context.d.ts.map +1 -1
- package/dist/modules/modal/dom.d.ts.map +1 -0
- package/dist/modules/modal/hooks.d.ts +3 -2
- package/dist/modules/modal/hooks.d.ts.map +1 -1
- package/dist/modules/modal/index.d.ts +7 -7
- package/dist/modules/modal/index.d.ts.map +1 -1
- package/dist/modules/modal/{model/layout.d.ts → layout.d.ts} +1 -1
- package/dist/modules/modal/layout.d.ts.map +1 -0
- package/dist/modules/modal/module.d.ts +1 -1
- package/dist/modules/modal/module.d.ts.map +1 -1
- package/dist/modules/modal/overlay.d.ts.map +1 -0
- package/dist/modules/modal/state.d.ts +52 -0
- package/dist/modules/modal/state.d.ts.map +1 -0
- package/dist/modules/navigation/hooks.d.ts.map +1 -1
- package/dist/modules/notification/hooks.d.ts.map +1 -1
- package/dist/modules/notification/overlay.d.ts +0 -1
- package/dist/modules/notification/overlay.d.ts.map +1 -1
- package/dist/navigation/index.js +33 -41
- package/dist/navigation/index.js.map +1 -1
- package/dist/notification/index.js +8 -7
- package/dist/overlay-YMLS3SAQ.js +14 -0
- package/dist/{overlay-7QLGWHCH.js.map → overlay-YMLS3SAQ.js.map} +1 -1
- package/dist/provider/index.js +12 -11
- package/dist/react/hooks/index.d.ts +3 -1
- package/dist/react/hooks/index.d.ts.map +1 -1
- package/dist/react/hooks/use-client-value.d.ts +15 -0
- package/dist/react/hooks/use-client-value.d.ts.map +1 -0
- package/dist/react/hooks/use-controllable-state.d.ts +8 -1
- package/dist/react/hooks/use-controllable-state.d.ts.map +1 -1
- package/dist/react/hooks/use-fullscreen-state.d.ts +0 -2
- package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -1
- package/dist/react/hooks/use-global-event.d.ts +7 -1
- package/dist/react/hooks/use-global-event.d.ts.map +1 -1
- package/dist/react/hooks/use-hotkey.d.ts +9 -1
- package/dist/react/hooks/use-hotkey.d.ts.map +1 -1
- package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -1
- package/dist/react/hooks/use-store.d.ts +3 -0
- package/dist/react/hooks/use-store.d.ts.map +1 -1
- package/dist/react/theme/index.d.ts.map +1 -1
- package/dist/react/ui/components/avatar.d.ts +4 -0
- package/dist/react/ui/components/avatar.d.ts.map +1 -1
- package/dist/react/ui/components/carousel.d.ts +22 -1
- package/dist/react/ui/components/carousel.d.ts.map +1 -1
- package/dist/react/ui/components/image.d.ts.map +1 -1
- package/dist/react/ui/components/indicator.d.ts +18 -8
- package/dist/react/ui/components/indicator.d.ts.map +1 -1
- package/dist/react/ui/components/segmented.d.ts.map +1 -1
- package/dist/react/ui/components/{select-parts.d.ts → select/options.d.ts} +2 -2
- package/dist/react/ui/components/{select-parts.d.ts.map → select/options.d.ts.map} +1 -1
- package/dist/react/ui/components/{select.d.ts → select/select.d.ts} +1 -1
- package/dist/react/ui/components/select/select.d.ts.map +1 -0
- package/dist/react/ui/components/{tooltip-group.d.ts → tooltip/group.d.ts} +3 -2
- package/dist/react/ui/components/tooltip/group.d.ts.map +1 -0
- package/dist/react/ui/components/{tooltip-placement.d.ts → tooltip/placement.d.ts} +2 -3
- package/dist/react/ui/components/tooltip/placement.d.ts.map +1 -0
- package/dist/react/ui/components/{tooltip-slot.d.ts → tooltip/slot.d.ts} +1 -1
- package/dist/react/ui/components/tooltip/slot.d.ts.map +1 -0
- package/dist/react/ui/components/{tooltip.d.ts → tooltip/tooltip.d.ts} +2 -2
- package/dist/react/ui/components/tooltip/tooltip.d.ts.map +1 -0
- package/dist/react/ui/index.d.ts +5 -4
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/react/ui/provider.d.ts.map +1 -1
- package/dist/react/ui/types.d.ts +131 -3
- package/dist/react/ui/types.d.ts.map +1 -1
- package/dist/recipes/index.js +5 -6
- package/dist/recipes/index.js.map +1 -1
- package/dist/result/index.js +12 -15
- package/dist/result/index.js.map +1 -1
- package/dist/theme/index.js +2 -2
- package/dist/ui/index.js +849 -858
- package/dist/ui/index.js.map +1 -1
- package/dist/utils/index.js +31 -34
- package/dist/utils/index.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/architecture-and-rules.md +35 -24
- package/docs/modules/README.md +15 -15
- package/docs/modules/ambient.md +23 -23
- package/docs/modules/background.md +23 -18
- package/docs/modules/dock.md +24 -20
- package/docs/modules/error-boundary.md +1 -2
- package/docs/modules/kernel.md +28 -30
- package/docs/modules/modal.md +16 -15
- package/docs/modules/navigation.md +14 -14
- package/docs/testing.md +1 -1
- package/package.json +1 -2
- package/dist/chunk-67MOKJFZ.js.map +0 -1
- package/dist/chunk-6IP6YFQX.js.map +0 -1
- package/dist/chunk-7VU2OAJB.js.map +0 -1
- package/dist/chunk-AZ2ZDFNP.js +0 -17
- package/dist/chunk-BMFHS3GV.js.map +0 -1
- package/dist/chunk-D222OCTV.js.map +0 -1
- package/dist/chunk-ESD5EQ5H.js.map +0 -1
- package/dist/chunk-FFJWJ4OB.js.map +0 -1
- package/dist/chunk-GKAJ4EM2.js.map +0 -1
- package/dist/chunk-HFR6YROB.js.map +0 -1
- package/dist/chunk-IH3STE7W.js.map +0 -1
- package/dist/chunk-KOYTJW5E.js.map +0 -1
- package/dist/chunk-LKYW4LH6.js.map +0 -1
- package/dist/chunk-QGPRTUED.js.map +0 -1
- package/dist/chunk-QRXDXAQI.js.map +0 -1
- package/dist/chunk-R4K6VAOK.js.map +0 -1
- package/dist/chunk-RDYYP36I.js.map +0 -1
- package/dist/chunk-TAWTGCWJ.js.map +0 -1
- package/dist/chunk-UQLTP3XB.js.map +0 -1
- package/dist/chunk-WQTMOUCA.js.map +0 -1
- package/dist/chunk-WZ5T2NXH.js.map +0 -1
- package/dist/chunk-XGAYTDSI.js.map +0 -1
- package/dist/chunk-YZS2B6YE.js.map +0 -1
- package/dist/chunk-ZXRE2KZO.js.map +0 -1
- package/dist/core/error/theme.d.ts +0 -10
- package/dist/core/error/theme.d.ts.map +0 -1
- package/dist/core/kernel/adapters.d.ts.map +0 -1
- package/dist/core/kernel/compose.d.ts.map +0 -1
- package/dist/core/kernel/handlers.d.ts.map +0 -1
- package/dist/core/kernel/hooks.d.ts.map +0 -1
- package/dist/core/kernel/installed.d.ts.map +0 -1
- package/dist/core/kernel/module.d.ts.map +0 -1
- package/dist/core/kernel/operations-records.d.ts.map +0 -1
- package/dist/core/kernel/operations-resolve.d.ts +0 -5
- package/dist/core/kernel/operations-resolve.d.ts.map +0 -1
- package/dist/core/kernel/operations.d.ts.map +0 -1
- package/dist/core/kernel/page-controller.d.ts.map +0 -1
- package/dist/core/kernel/provider.d.ts.map +0 -1
- package/dist/core/kernel/runtime.d.ts.map +0 -1
- package/dist/core/kernel/schema.d.ts.map +0 -1
- package/dist/core/kernel/stabilize.d.ts.map +0 -1
- package/dist/core/kernel/store-batch.d.ts +0 -17
- package/dist/core/kernel/store-batch.d.ts.map +0 -1
- package/dist/core/kernel/store-entries.d.ts +0 -6
- package/dist/core/kernel/store-entries.d.ts.map +0 -1
- package/dist/core/kernel/store-handles.d.ts +0 -4
- package/dist/core/kernel/store-handles.d.ts.map +0 -1
- package/dist/core/kernel/store-registration.d.ts +0 -14
- package/dist/core/kernel/store-registration.d.ts.map +0 -1
- package/dist/core/kernel/store-snapshots.d.ts.map +0 -1
- package/dist/core/kernel/store-subscriptions.d.ts.map +0 -1
- package/dist/core/kernel/store.d.ts.map +0 -1
- package/dist/core/kernel/types-modules.d.ts.map +0 -1
- package/dist/core/kernel/types-page.d.ts.map +0 -1
- package/dist/core/kernel/types-store.d.ts.map +0 -1
- package/dist/core/kernel/types.d.ts.map +0 -1
- package/dist/core/navigation/navigator-defaults.d.ts +0 -4
- package/dist/core/navigation/navigator-defaults.d.ts.map +0 -1
- package/dist/core/navigation/navigator-holds.d.ts.map +0 -1
- package/dist/core/navigation/navigator-patience.d.ts.map +0 -1
- package/dist/core/navigation/navigator-payload.d.ts.map +0 -1
- package/dist/core/navigation/navigator-prefetch.d.ts.map +0 -1
- package/dist/modules/ambient/analyze-bounds.d.ts.map +0 -1
- package/dist/modules/ambient/analyze-clusters.d.ts.map +0 -1
- package/dist/modules/ambient/analyze-ground.d.ts.map +0 -1
- package/dist/modules/ambient/analyze-measures.d.ts.map +0 -1
- package/dist/modules/ambient/analyze-swatches.d.ts.map +0 -1
- package/dist/modules/ambient/analyze.d.ts.map +0 -1
- package/dist/modules/ambient/oklab.d.ts.map +0 -1
- package/dist/modules/ambient/quantize.d.ts.map +0 -1
- package/dist/modules/background/components/background-gradients.d.ts +0 -8
- package/dist/modules/background/components/background-gradients.d.ts.map +0 -1
- package/dist/modules/background/components/edge-gradient.d.ts +0 -9
- package/dist/modules/background/components/edge-gradient.d.ts.map +0 -1
- package/dist/modules/background/components/native-video.d.ts +0 -4
- package/dist/modules/background/components/native-video.d.ts.map +0 -1
- package/dist/modules/background/components/noise-overlay.d.ts +0 -11
- package/dist/modules/background/components/noise-overlay.d.ts.map +0 -1
- package/dist/modules/background/components/overlay.d.ts.map +0 -1
- package/dist/modules/background/components/solid-overlay.d.ts +0 -10
- package/dist/modules/background/components/solid-overlay.d.ts.map +0 -1
- package/dist/modules/background/hooks/use-background-media-source.d.ts +0 -4
- package/dist/modules/background/hooks/use-background-media-source.d.ts.map +0 -1
- package/dist/modules/background/hooks/use-background-motion-model.d.ts +0 -15
- package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +0 -1
- package/dist/modules/background/hooks/use-background-overlay-model.d.ts +0 -929
- package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +0 -1
- package/dist/modules/background/hooks/use-native-video-model.d.ts.map +0 -1
- package/dist/modules/background/lib/theme.d.ts +0 -4
- package/dist/modules/background/lib/theme.d.ts.map +0 -1
- package/dist/modules/background/model/override.d.ts +0 -14
- package/dist/modules/background/model/override.d.ts.map +0 -1
- package/dist/modules/background/model/playback.d.ts.map +0 -1
- package/dist/modules/background/model/state.d.ts.map +0 -1
- package/dist/modules/background/model/video-frame.d.ts +0 -31
- package/dist/modules/background/model/video-frame.d.ts.map +0 -1
- package/dist/modules/background/model/visual.d.ts.map +0 -1
- package/dist/modules/background/youtube/components/player.d.ts.map +0 -1
- package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +0 -1
- package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +0 -20
- package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +0 -1
- package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +0 -8
- package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +0 -1
- package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/audio.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/iframe-engine.d.ts +0 -29
- package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +0 -47
- package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/iframe.d.ts +0 -47
- package/dist/modules/background/youtube/lib/iframe.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/parse.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/timing.d.ts.map +0 -1
- package/dist/modules/background/youtube/lib/video-events.d.ts.map +0 -1
- package/dist/modules/dock/components/badge.d.ts +0 -5
- package/dist/modules/dock/components/badge.d.ts.map +0 -1
- package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +0 -1
- package/dist/modules/dock/components/card-banner.d.ts +0 -4
- package/dist/modules/dock/components/card-banner.d.ts.map +0 -1
- package/dist/modules/dock/components/card-header.d.ts +0 -4
- package/dist/modules/dock/components/card-header.d.ts.map +0 -1
- package/dist/modules/dock/components/card-item.d.ts.map +0 -1
- package/dist/modules/dock/components/command-bar.d.ts.map +0 -1
- package/dist/modules/dock/components/compact.d.ts.map +0 -1
- package/dist/modules/dock/components/description.d.ts +0 -4
- package/dist/modules/dock/components/description.d.ts.map +0 -1
- package/dist/modules/dock/components/dock.d.ts.map +0 -1
- package/dist/modules/dock/components/hud-view.d.ts.map +0 -1
- package/dist/modules/dock/components/icon.d.ts.map +0 -1
- package/dist/modules/dock/components/item-content.d.ts.map +0 -1
- package/dist/modules/dock/components/media-action.d.ts.map +0 -1
- package/dist/modules/dock/components/media-controls.d.ts +0 -4
- package/dist/modules/dock/components/media-controls.d.ts.map +0 -1
- package/dist/modules/dock/components/media-scrubber.d.ts.map +0 -1
- package/dist/modules/dock/components/status-actions.d.ts.map +0 -1
- package/dist/modules/dock/components/surface/action.d.ts.map +0 -1
- package/dist/modules/dock/components/surface/controls.d.ts +0 -12
- package/dist/modules/dock/components/surface/controls.d.ts.map +0 -1
- package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +0 -1
- package/dist/modules/dock/components/surface/header-button.d.ts.map +0 -1
- package/dist/modules/dock/components/surface/item-content.d.ts.map +0 -1
- package/dist/modules/dock/components/surface/shell.d.ts +0 -3
- package/dist/modules/dock/components/surface/shell.d.ts.map +0 -1
- package/dist/modules/dock/components/title.d.ts +0 -4
- package/dist/modules/dock/components/title.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-action-slot.d.ts +0 -6
- package/dist/modules/dock/hooks/use-action-slot.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-badge.d.ts +0 -4
- package/dist/modules/dock/hooks/use-badge.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-card-banner-model.d.ts +0 -18
- package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-card-header-model.d.ts +0 -7
- package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-command-bar-model.d.ts +0 -12
- package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-banner.d.ts +0 -11
- package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-config.d.ts +0 -19
- package/dist/modules/dock/hooks/use-dock-config.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +0 -7
- package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +0 -7
- package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +0 -6
- package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +0 -11
- package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-registration.d.ts +0 -8
- package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +0 -2
- package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-theme.d.ts +0 -6
- package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-dock-viewport.d.ts +0 -6
- package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-element-height.d.ts +0 -3
- package/dist/modules/dock/hooks/use-element-height.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-hud-registry.d.ts +0 -16
- package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-hud-view-model.d.ts +0 -9
- package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +0 -27
- package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-pending-skeleton.d.ts +0 -7
- package/dist/modules/dock/hooks/use-pending-skeleton.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +0 -12
- package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +0 -1
- package/dist/modules/dock/hooks/use-surface-return.d.ts +0 -8
- package/dist/modules/dock/hooks/use-surface-return.d.ts.map +0 -1
- package/dist/modules/dock/hud.d.ts.map +0 -1
- package/dist/modules/dock/lib/banner.d.ts.map +0 -1
- package/dist/modules/dock/lib/card-item.d.ts.map +0 -1
- package/dist/modules/dock/lib/card.d.ts +0 -20
- package/dist/modules/dock/lib/card.d.ts.map +0 -1
- package/dist/modules/dock/lib/command-bar.d.ts +0 -8
- package/dist/modules/dock/lib/command-bar.d.ts.map +0 -1
- package/dist/modules/dock/lib/dom.d.ts +0 -7
- package/dist/modules/dock/lib/dom.d.ts.map +0 -1
- package/dist/modules/dock/lib/element-helpers.d.ts +0 -8
- package/dist/modules/dock/lib/element-helpers.d.ts.map +0 -1
- package/dist/modules/dock/lib/helpers.d.ts.map +0 -1
- package/dist/modules/dock/lib/media.d.ts.map +0 -1
- package/dist/modules/dock/lib/styles.d.ts.map +0 -1
- package/dist/modules/dock/model/hud-definition.d.ts.map +0 -1
- package/dist/modules/dock/model/hud.d.ts +0 -10
- package/dist/modules/dock/model/hud.d.ts.map +0 -1
- package/dist/modules/dock/model/layout.d.ts.map +0 -1
- package/dist/modules/dock/model/page-entry.d.ts +0 -11
- package/dist/modules/dock/model/page-entry.d.ts.map +0 -1
- package/dist/modules/dock/model/page-surface.d.ts +0 -4
- package/dist/modules/dock/model/page-surface.d.ts.map +0 -1
- package/dist/modules/dock/model/paths.d.ts.map +0 -1
- package/dist/modules/dock/model/state.d.ts +0 -28
- package/dist/modules/dock/model/state.d.ts.map +0 -1
- package/dist/modules/dock/model/surface-return.d.ts +0 -14
- package/dist/modules/dock/model/surface-return.d.ts.map +0 -1
- package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +0 -1
- package/dist/modules/dock/routing/lib/restore.d.ts +0 -7
- package/dist/modules/dock/routing/lib/restore.d.ts.map +0 -1
- package/dist/modules/dock/routing/model/continuity.d.ts.map +0 -1
- package/dist/modules/dock/routing/model/policy.d.ts.map +0 -1
- package/dist/modules/dock/routing/model/topology.d.ts.map +0 -1
- package/dist/modules/dock/runtime/commands.d.ts.map +0 -1
- package/dist/modules/dock/runtime/display.d.ts.map +0 -1
- package/dist/modules/dock/runtime/dock.d.ts.map +0 -1
- package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +0 -10
- package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +0 -1
- package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +0 -10
- package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +0 -1
- package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +0 -14
- package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +0 -1
- package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +0 -7
- package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +0 -1
- package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +0 -1
- package/dist/modules/dock/runtime/model/attention.d.ts +0 -25
- package/dist/modules/dock/runtime/model/attention.d.ts.map +0 -1
- package/dist/modules/dock/runtime/model/cards.d.ts.map +0 -1
- package/dist/modules/dock/runtime/model/items.d.ts.map +0 -1
- package/dist/modules/dock/runtime/model/layout.d.ts +0 -10
- package/dist/modules/dock/runtime/model/layout.d.ts.map +0 -1
- package/dist/modules/dock/runtime/pipeline.d.ts.map +0 -1
- package/dist/modules/dock/runtime/provider-actions.d.ts +0 -38
- package/dist/modules/dock/runtime/provider-actions.d.ts.map +0 -1
- package/dist/modules/dock/status/action-options.d.ts +0 -35
- package/dist/modules/dock/status/action-options.d.ts.map +0 -1
- package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +0 -5
- package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +0 -1
- package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +0 -7
- package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +0 -1
- package/dist/modules/dock/surface/constants.d.ts +0 -5
- package/dist/modules/dock/surface/constants.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +0 -15
- package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +0 -7
- package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +0 -14
- package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +0 -13
- package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +0 -1
- package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +0 -1
- package/dist/modules/dock/surface/lib/drag.d.ts +0 -9
- package/dist/modules/dock/surface/lib/drag.d.ts.map +0 -1
- package/dist/modules/dock/surface/lib/target.d.ts +0 -8
- package/dist/modules/dock/surface/lib/target.d.ts.map +0 -1
- package/dist/modules/dock/surface/machine.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/builder.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/normalize.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/open.d.ts +0 -26
- package/dist/modules/dock/surface/model/open.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/records.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/steps.d.ts +0 -9
- package/dist/modules/dock/surface/model/steps.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/transition-state.d.ts.map +0 -1
- package/dist/modules/dock/surface/model/url.d.ts.map +0 -1
- package/dist/modules/dock/surface/runtime/context.d.ts +0 -29
- package/dist/modules/dock/surface/runtime/context.d.ts.map +0 -1
- package/dist/modules/dock/surface/runtime/release.d.ts +0 -9
- package/dist/modules/dock/surface/runtime/release.d.ts.map +0 -1
- package/dist/modules/dock/surface/stack.d.ts.map +0 -1
- package/dist/modules/dock/types/compact.d.ts +0 -13
- package/dist/modules/dock/types/compact.d.ts.map +0 -1
- package/dist/modules/modal/components/close-button.d.ts +0 -6
- package/dist/modules/modal/components/close-button.d.ts.map +0 -1
- package/dist/modules/modal/components/modal-container.d.ts.map +0 -1
- package/dist/modules/modal/components/modal-layer-switcher.d.ts +0 -9
- package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +0 -1
- package/dist/modules/modal/components/modal-layer.d.ts +0 -17
- package/dist/modules/modal/components/modal-layer.d.ts.map +0 -1
- package/dist/modules/modal/components/overlay.d.ts.map +0 -1
- package/dist/modules/modal/components/resolve-header.d.ts +0 -10
- package/dist/modules/modal/components/resolve-header.d.ts.map +0 -1
- package/dist/modules/modal/components/slot-row.d.ts +0 -12
- package/dist/modules/modal/components/slot-row.d.ts.map +0 -1
- package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +0 -3
- package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +0 -1
- package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +0 -12
- package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +0 -1
- package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +0 -3
- package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +0 -1
- package/dist/modules/modal/lib/dom.d.ts.map +0 -1
- package/dist/modules/modal/lib/theme.d.ts +0 -4
- package/dist/modules/modal/lib/theme.d.ts.map +0 -1
- package/dist/modules/modal/model/entry.d.ts +0 -18
- package/dist/modules/modal/model/entry.d.ts.map +0 -1
- package/dist/modules/modal/model/header.d.ts +0 -16
- package/dist/modules/modal/model/header.d.ts.map +0 -1
- package/dist/modules/modal/model/identity.d.ts +0 -13
- package/dist/modules/modal/model/identity.d.ts.map +0 -1
- package/dist/modules/modal/model/layout.d.ts.map +0 -1
- package/dist/modules/modal/model/state.d.ts +0 -10
- package/dist/modules/modal/model/state.d.ts.map +0 -1
- package/dist/overlay-7QLGWHCH.js +0 -13
- package/dist/react/hooks/types.d.ts +0 -25
- package/dist/react/hooks/types.d.ts.map +0 -1
- package/dist/react/ui/components/select.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip-group.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip-placement.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip-slot.d.ts.map +0 -1
- package/dist/react/ui/components/tooltip.d.ts.map +0 -1
- package/dist/react/ui/types-controls.d.ts +0 -133
- package/dist/react/ui/types-controls.d.ts.map +0 -1
- package/dist/react/ui/utils.d.ts +0 -65
- package/dist/react/ui/utils.d.ts.map +0 -1
- package/docs/proposals/navigation.md +0 -210
- /package/dist/modules/ambient/{quantize.d.ts → analysis/quantize.d.ts} +0 -0
- /package/dist/modules/background/{components/overlay.d.ts → overlay.d.ts} +0 -0
- /package/dist/modules/background/{model/playback.d.ts → playback.d.ts} +0 -0
- /package/dist/modules/background/youtube/{lib/audio.d.ts → audio.d.ts} +0 -0
- /package/dist/modules/dock/{components → card}/compact.d.ts +0 -0
- /package/dist/modules/dock/{components → commands}/command-bar.d.ts +0 -0
- /package/dist/modules/dock/{components → routing}/breadcrumbs-card.d.ts +0 -0
- /package/dist/modules/dock/{model → routing}/paths.d.ts +0 -0
- /package/dist/modules/dock/{components → stack}/dock.d.ts +0 -0
- /package/dist/modules/dock/surface/{model → runtime}/url.d.ts +0 -0
- /package/dist/modules/modal/{lib/dom.d.ts → dom.d.ts} +0 -0
- /package/dist/modules/modal/{components/overlay.d.ts → overlay.d.ts} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useOptionalMediaActions } from './chunk-
|
|
2
|
-
import { defineModule, useRegistryValue, useModuleRegistration } from './chunk-
|
|
3
|
-
import { useStore, useRequiredContext } from './chunk-
|
|
4
|
-
import { Spinner } from './chunk-
|
|
5
|
-
import { cn } from './chunk-
|
|
6
|
-
import { defineThemeSpec, useTheme, useMotionTokens, useModuleMotion } from './chunk-
|
|
7
|
-
import { createStore, cssEasing, report } from './chunk-
|
|
1
|
+
import { useOptionalMediaActions } from './chunk-C3SEBNF5.js';
|
|
2
|
+
import { defineModule, useRegistryValue, useModuleRegistration } from './chunk-ED32WLAD.js';
|
|
3
|
+
import { useStore, useRequiredContext } from './chunk-JWUKAZ3A.js';
|
|
4
|
+
import { Spinner } from './chunk-6LWCTP2Y.js';
|
|
5
|
+
import { cn } from './chunk-ICFPSAJZ.js';
|
|
6
|
+
import { defineThemeSpec, useTheme, useMotionTokens, useModuleMotion } from './chunk-3JLG24KI.js';
|
|
7
|
+
import { createStore, cssEasing, report } from './chunk-S67HGKJ2.js';
|
|
8
8
|
import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
|
|
9
|
-
import { retime } from './chunk-
|
|
9
|
+
import { retime } from './chunk-YHWA7FXX.js';
|
|
10
10
|
import { c } from 'react/compiler-runtime';
|
|
11
11
|
import { motion, AnimatePresence } from 'motion/react';
|
|
12
12
|
import { useState, useLayoutEffect, useEffect, use, useRef, useCallback } from 'react';
|
|
@@ -19,67 +19,82 @@ var BACKGROUND_REGISTRY_KEY = "page-background";
|
|
|
19
19
|
var BACKGROUND_MEDIA_ID = "background";
|
|
20
20
|
var DEFAULT_AUDIBLE_VOLUME = 0.8;
|
|
21
21
|
var PROXY_UNMUTE_VOLUME = 0.7;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
22
|
+
|
|
23
|
+
// src/modules/background/playback.ts
|
|
24
|
+
function applyVideoPlaybackState({
|
|
25
|
+
isPlaying,
|
|
26
|
+
playbackRate,
|
|
27
|
+
setVideoPlaying,
|
|
28
|
+
videoElement
|
|
29
|
+
}) {
|
|
30
|
+
if (!videoElement) return;
|
|
31
|
+
const numericPlaybackRate = Number(playbackRate);
|
|
32
|
+
const resolvedPlaybackRate = Number.isFinite(numericPlaybackRate) && numericPlaybackRate > 0 ? numericPlaybackRate : 1;
|
|
33
|
+
try {
|
|
34
|
+
if (videoElement.playbackRate !== resolvedPlaybackRate) {
|
|
35
|
+
videoElement.playbackRate = resolvedPlaybackRate;
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (!isPlaying) {
|
|
41
|
+
if (!videoElement.paused) videoElement.pause();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (videoElement.readyState === 0) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const playPromise = videoElement.play();
|
|
48
|
+
if (!playPromise || typeof playPromise.then !== "function") return;
|
|
49
|
+
playPromise.then(() => setVideoPlaying(true)).catch((error) => {
|
|
50
|
+
if (error?.name === "AbortError" || videoElement.readyState < 2) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (error?.name === "NotAllowedError") {
|
|
54
|
+
videoElement.muted = true;
|
|
55
|
+
videoElement.play().then(() => setVideoPlaying(true)).catch(() => {
|
|
50
56
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
setVideoPlaying(false);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function triggerVideoPlaybackDirect(videoElement, nextPlaying, configuredMuted) {
|
|
63
|
+
if (!videoElement) return;
|
|
64
|
+
if (nextPlaying) {
|
|
65
|
+
videoElement.muted = configuredMuted;
|
|
66
|
+
if (!configuredMuted && videoElement.volume === 0) {
|
|
67
|
+
videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
|
|
68
|
+
}
|
|
69
|
+
videoElement.play().catch((err) => {
|
|
70
|
+
if (err?.name === "NotAllowedError") {
|
|
71
|
+
videoElement.muted = true;
|
|
72
|
+
videoElement.play().catch(() => {
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
});
|
|
61
76
|
} else {
|
|
62
|
-
|
|
63
|
-
t1 = $[7];
|
|
77
|
+
videoElement.pause();
|
|
64
78
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
$[8] = media;
|
|
72
|
-
$[9] = t2;
|
|
73
|
-
$[10] = t3;
|
|
74
|
-
} else {
|
|
75
|
-
t2 = $[9];
|
|
76
|
-
t3 = $[10];
|
|
79
|
+
}
|
|
80
|
+
function syncVideoMutedDirect(videoElement, nextMuted) {
|
|
81
|
+
if (!videoElement) return;
|
|
82
|
+
videoElement.muted = nextMuted;
|
|
83
|
+
if (!nextMuted && videoElement.volume === 0) {
|
|
84
|
+
videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
|
|
77
85
|
}
|
|
78
|
-
|
|
86
|
+
}
|
|
87
|
+
function syncVideoLoopDirect(videoElement, nextLoop) {
|
|
88
|
+
if (!videoElement) return;
|
|
89
|
+
videoElement.loop = nextLoop;
|
|
90
|
+
}
|
|
91
|
+
function isElementPlaying(element, fallback) {
|
|
92
|
+
return element ? !element.paused && !element.ended : Boolean(fallback);
|
|
79
93
|
}
|
|
80
94
|
|
|
81
|
-
// src/modules/background/youtube/
|
|
95
|
+
// src/modules/background/youtube/parse.ts
|
|
82
96
|
var YOUTUBE_ID_PATTERN = /^[a-zA-Z0-9_-]{11}$/;
|
|
97
|
+
var YOUTUBE_HOST_PATH = /^(?:www\.|m\.|music\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)\//i;
|
|
83
98
|
function parseYouTubeTimeParam(value) {
|
|
84
99
|
if (value === void 0 || value === null || value === "") return 0;
|
|
85
100
|
if (typeof value === "number") {
|
|
@@ -99,7 +114,6 @@ function parseYouTubeTimeParam(value) {
|
|
|
99
114
|
}
|
|
100
115
|
return 0;
|
|
101
116
|
}
|
|
102
|
-
var YOUTUBE_HOST_PATH = /^(?:www\.|m\.|music\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)\//i;
|
|
103
117
|
function toUrl(input, {
|
|
104
118
|
youtubeOnly = false
|
|
105
119
|
} = {}) {
|
|
@@ -249,7 +263,7 @@ function createYouTubeVideoElementProxy(controller) {
|
|
|
249
263
|
return proxyVideo;
|
|
250
264
|
}
|
|
251
265
|
|
|
252
|
-
// src/modules/background/
|
|
266
|
+
// src/modules/background/state.ts
|
|
253
267
|
var DEFAULT_BACKGROUND = Object.freeze({
|
|
254
268
|
animation: null,
|
|
255
269
|
className: "",
|
|
@@ -386,8 +400,6 @@ function computeBackgroundState(background) {
|
|
|
386
400
|
youtubeVideoId
|
|
387
401
|
};
|
|
388
402
|
}
|
|
389
|
-
|
|
390
|
-
// src/modules/background/model/override.ts
|
|
391
403
|
function mergeOverridePatch(currentPatch, nextPatch) {
|
|
392
404
|
return {
|
|
393
405
|
...currentPatch || {},
|
|
@@ -414,78 +426,6 @@ function applyOverrideUpdate(prev, inputs, updater) {
|
|
|
414
426
|
pathname: currentPath
|
|
415
427
|
};
|
|
416
428
|
}
|
|
417
|
-
|
|
418
|
-
// src/modules/background/model/playback.ts
|
|
419
|
-
function applyVideoPlaybackState({
|
|
420
|
-
isPlaying,
|
|
421
|
-
playbackRate,
|
|
422
|
-
setVideoPlaying,
|
|
423
|
-
videoElement
|
|
424
|
-
}) {
|
|
425
|
-
if (!videoElement) return;
|
|
426
|
-
const numericPlaybackRate = Number(playbackRate);
|
|
427
|
-
const resolvedPlaybackRate = Number.isFinite(numericPlaybackRate) && numericPlaybackRate > 0 ? numericPlaybackRate : 1;
|
|
428
|
-
try {
|
|
429
|
-
if (videoElement.playbackRate !== resolvedPlaybackRate) {
|
|
430
|
-
videoElement.playbackRate = resolvedPlaybackRate;
|
|
431
|
-
}
|
|
432
|
-
} catch {
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
if (!isPlaying) {
|
|
436
|
-
if (!videoElement.paused) videoElement.pause();
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
if (videoElement.readyState === 0) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
const playPromise = videoElement.play();
|
|
443
|
-
if (!playPromise || typeof playPromise.then !== "function") return;
|
|
444
|
-
playPromise.then(() => setVideoPlaying(true)).catch((error) => {
|
|
445
|
-
if (error?.name === "AbortError" || videoElement.readyState < 2) {
|
|
446
|
-
return;
|
|
447
|
-
}
|
|
448
|
-
if (error?.name === "NotAllowedError") {
|
|
449
|
-
videoElement.muted = true;
|
|
450
|
-
videoElement.play().then(() => setVideoPlaying(true)).catch(() => {
|
|
451
|
-
});
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
setVideoPlaying(false);
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
function triggerVideoPlaybackDirect(videoElement, nextPlaying, configuredMuted) {
|
|
458
|
-
if (!videoElement) return;
|
|
459
|
-
if (nextPlaying) {
|
|
460
|
-
videoElement.muted = configuredMuted;
|
|
461
|
-
if (!configuredMuted && videoElement.volume === 0) {
|
|
462
|
-
videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
|
|
463
|
-
}
|
|
464
|
-
videoElement.play().catch((err) => {
|
|
465
|
-
if (err?.name === "NotAllowedError") {
|
|
466
|
-
videoElement.muted = true;
|
|
467
|
-
videoElement.play().catch(() => {
|
|
468
|
-
});
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
} else {
|
|
472
|
-
videoElement.pause();
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
function syncVideoMutedDirect(videoElement, nextMuted) {
|
|
476
|
-
if (!videoElement) return;
|
|
477
|
-
videoElement.muted = nextMuted;
|
|
478
|
-
if (!nextMuted && videoElement.volume === 0) {
|
|
479
|
-
videoElement.volume = DEFAULT_AUDIBLE_VOLUME;
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
function syncVideoLoopDirect(videoElement, nextLoop) {
|
|
483
|
-
if (!videoElement) return;
|
|
484
|
-
videoElement.loop = nextLoop;
|
|
485
|
-
}
|
|
486
|
-
function isElementPlaying(element, fallback) {
|
|
487
|
-
return element ? !element.paused && !element.ended : Boolean(fallback);
|
|
488
|
-
}
|
|
489
429
|
var BackgroundContext = getOrCreateGlobalContext("BackgroundContext", null);
|
|
490
430
|
function createBackground(initial) {
|
|
491
431
|
let inputs = initial;
|
|
@@ -690,50 +630,102 @@ function BackgroundProvider(t0) {
|
|
|
690
630
|
}
|
|
691
631
|
return t8;
|
|
692
632
|
}
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
function useBackgroundRegistration(config, options) {
|
|
697
|
-
useModuleRegistration("background", config, options);
|
|
698
|
-
}
|
|
699
|
-
function useBackgroundState() {
|
|
633
|
+
function useBackgroundMediaSource(state, actions) {
|
|
634
|
+
const $ = c(11);
|
|
635
|
+
const media = useOptionalMediaActions();
|
|
700
636
|
const {
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
return useRequiredContext(BackgroundContext, "useBackgroundActions", "BackgroundProvider").actions;
|
|
707
|
-
}
|
|
708
|
-
function useBackground(config, options) {
|
|
709
|
-
const $ = c(3);
|
|
710
|
-
useBackgroundRegistration(config, options);
|
|
711
|
-
const actions = useBackgroundActions();
|
|
712
|
-
const state = useBackgroundState();
|
|
637
|
+
isPlaying,
|
|
638
|
+
isVideo,
|
|
639
|
+
videoElement
|
|
640
|
+
} = state;
|
|
641
|
+
const isLoop = Boolean(state.videoOptions?.loop);
|
|
713
642
|
let t0;
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
643
|
+
let t1;
|
|
644
|
+
if ($[0] !== actions || $[1] !== isLoop || $[2] !== isPlaying || $[3] !== isVideo || $[4] !== media || $[5] !== videoElement) {
|
|
645
|
+
t0 = () => {
|
|
646
|
+
if (!isVideo) {
|
|
647
|
+
media.removeSource(BACKGROUND_MEDIA_ID);
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
media.upsertSource({
|
|
651
|
+
controls: {
|
|
652
|
+
setMuted: actions.setVideoMuted,
|
|
653
|
+
toggle: actions.toggleVideo,
|
|
654
|
+
toggleLoop: actions.toggleLoop
|
|
655
|
+
},
|
|
656
|
+
element: videoElement ?? null,
|
|
657
|
+
id: BACKGROUND_MEDIA_ID,
|
|
658
|
+
isPlaying,
|
|
659
|
+
kind: "video",
|
|
660
|
+
loop: isLoop
|
|
661
|
+
});
|
|
718
662
|
};
|
|
663
|
+
t1 = [actions, isLoop, isPlaying, isVideo, media, videoElement];
|
|
719
664
|
$[0] = actions;
|
|
720
|
-
$[1] =
|
|
721
|
-
$[2] =
|
|
665
|
+
$[1] = isLoop;
|
|
666
|
+
$[2] = isPlaying;
|
|
667
|
+
$[3] = isVideo;
|
|
668
|
+
$[4] = media;
|
|
669
|
+
$[5] = videoElement;
|
|
670
|
+
$[6] = t0;
|
|
671
|
+
$[7] = t1;
|
|
722
672
|
} else {
|
|
723
|
-
t0 = $[
|
|
673
|
+
t0 = $[6];
|
|
674
|
+
t1 = $[7];
|
|
724
675
|
}
|
|
725
|
-
|
|
676
|
+
useEffect(t0, t1);
|
|
677
|
+
let t2;
|
|
678
|
+
let t3;
|
|
679
|
+
if ($[8] !== media) {
|
|
680
|
+
t2 = () => () => media.removeSource(BACKGROUND_MEDIA_ID);
|
|
681
|
+
t3 = [media];
|
|
682
|
+
$[8] = media;
|
|
683
|
+
$[9] = t2;
|
|
684
|
+
$[10] = t3;
|
|
685
|
+
} else {
|
|
686
|
+
t2 = $[9];
|
|
687
|
+
t3 = $[10];
|
|
688
|
+
}
|
|
689
|
+
useEffect(t2, t3);
|
|
726
690
|
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
691
|
+
|
|
692
|
+
// src/modules/background/motion.ts
|
|
693
|
+
function useBackgroundMotion() {
|
|
694
|
+
return useModuleMotion(backgroundTheme);
|
|
730
695
|
}
|
|
731
|
-
function
|
|
732
|
-
|
|
733
|
-
|
|
696
|
+
function getBackgroundMotionConfig(motion2, animation) {
|
|
697
|
+
return {
|
|
698
|
+
animate: animation?.animate ?? motion2.animate,
|
|
699
|
+
exit: animation?.exit ?? motion2.exit,
|
|
700
|
+
exitDurationFactor: Number(animation?.exitDurationFactor),
|
|
701
|
+
initial: animation?.initial ?? motion2.initial,
|
|
702
|
+
transition: animation?.transition ?? motion2.transition
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
function getBackgroundExitTransition(motion2, config) {
|
|
706
|
+
const own = config.exit.transition;
|
|
707
|
+
const fallback = motion2.exit.transition;
|
|
708
|
+
const factor = Number.isFinite(config.exitDurationFactor) ? Math.max(0, config.exitDurationFactor) : motion2.exitDurationFactor;
|
|
709
|
+
return {
|
|
710
|
+
...config.transition,
|
|
711
|
+
delay: 0,
|
|
712
|
+
duration: own?.duration ?? (config.transition.duration ?? motion2.transition.duration ?? 0) * factor,
|
|
713
|
+
ease: own?.ease ?? fallback?.ease
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
function toCssDuration(seconds, fallback = 0) {
|
|
717
|
+
const value = Number(seconds);
|
|
718
|
+
return `${Math.max(0, Number.isFinite(value) ? value : fallback) * 1e3}ms`;
|
|
719
|
+
}
|
|
720
|
+
function toCssDelay(seconds) {
|
|
721
|
+
const value = Number(seconds);
|
|
722
|
+
return `${Math.max(0, Number.isFinite(value) ? value : 0) * 1e3}ms`;
|
|
723
|
+
}
|
|
724
|
+
function toCssEasing(easing) {
|
|
725
|
+
return cssEasing(easing);
|
|
734
726
|
}
|
|
735
727
|
|
|
736
|
-
// src/modules/background/
|
|
728
|
+
// src/modules/background/visual.ts
|
|
737
729
|
var objectFit = (value) => ({
|
|
738
730
|
objectFit: value
|
|
739
731
|
});
|
|
@@ -759,6 +751,11 @@ var BG_TOKEN_TO_OBJECT_STYLE = Object.freeze({
|
|
|
759
751
|
var OBJECT_FITS = Object.freeze(["contain", "cover", "fill", "none", "scale-down"]);
|
|
760
752
|
var DEFAULT_COLOR = "currentColor";
|
|
761
753
|
var WIDTH_CLASS = /^(w-|max-w-|min-w-)/;
|
|
754
|
+
var FADE_PERCENT_PER_STRENGTH = 7.5;
|
|
755
|
+
var MIN_FADE_PERCENT = 12;
|
|
756
|
+
var MAX_FADE_PERCENT = 48;
|
|
757
|
+
var WIDTH_FADE_PERCENT = 20;
|
|
758
|
+
var OPACITY_PER_STRENGTH = 0.22;
|
|
762
759
|
function resolveVideoClassNames(...inputs) {
|
|
763
760
|
const tokens = inputs.flatMap((input) => typeof input === "string" ? input.replace(/,/g, " ").split(/\s+/) : []).filter(Boolean);
|
|
764
761
|
return {
|
|
@@ -803,18 +800,17 @@ function getVisualStyle(currentStyle = {}) {
|
|
|
803
800
|
rightGradient: Number(rightGradient) || 0
|
|
804
801
|
};
|
|
805
802
|
}
|
|
803
|
+
var fadePercentFor = (strength) => Math.min(MAX_FADE_PERCENT, Math.max(MIN_FADE_PERCENT, strength * FADE_PERCENT_PER_STRENGTH));
|
|
804
|
+
var opacityFor = (strength) => strength > 0 ? Math.min(1, strength * OPACITY_PER_STRENGTH) : 0;
|
|
806
805
|
function resolveGradientSettings({
|
|
807
806
|
fadeEdges = null,
|
|
808
807
|
hasWidth = false,
|
|
809
808
|
leftGradient = 0,
|
|
810
809
|
rightGradient = 0
|
|
811
810
|
}) {
|
|
812
|
-
|
|
813
|
-
let
|
|
814
|
-
|
|
815
|
-
else if (hasWidth && fadeEdges !== false) leftPercent = 20;
|
|
816
|
-
if (rightGradient > 0) rightPercent = Math.min(48, Math.max(12, rightGradient * 7.5));
|
|
817
|
-
else if (hasWidth && fadeEdges !== false) rightPercent = 20;
|
|
811
|
+
const widthFade = hasWidth && fadeEdges !== false ? WIDTH_FADE_PERCENT : 0;
|
|
812
|
+
let leftPercent = leftGradient > 0 ? fadePercentFor(leftGradient) : widthFade;
|
|
813
|
+
let rightPercent = rightGradient > 0 ? fadePercentFor(rightGradient) : widthFade;
|
|
818
814
|
if (typeof fadeEdges === "number") {
|
|
819
815
|
leftPercent = fadeEdges;
|
|
820
816
|
rightPercent = fadeEdges;
|
|
@@ -834,13 +830,11 @@ function resolveGradientSettings({
|
|
|
834
830
|
leftPercent = 0;
|
|
835
831
|
rightPercent = 0;
|
|
836
832
|
}
|
|
837
|
-
const leftOpacity = leftGradient > 0 ? Math.min(1, leftGradient * 0.22) : 0;
|
|
838
|
-
const rightOpacity = rightGradient > 0 ? Math.min(1, rightGradient * 0.22) : 0;
|
|
839
833
|
return {
|
|
840
834
|
enabled: leftPercent > 0 || rightPercent > 0,
|
|
841
|
-
leftOpacity,
|
|
835
|
+
leftOpacity: opacityFor(leftGradient),
|
|
842
836
|
leftPercent,
|
|
843
|
-
rightOpacity,
|
|
837
|
+
rightOpacity: opacityFor(rightGradient),
|
|
844
838
|
rightPercent
|
|
845
839
|
};
|
|
846
840
|
}
|
|
@@ -899,8 +893,6 @@ function resolveCssWidth(rawWidth) {
|
|
|
899
893
|
}
|
|
900
894
|
return typeof rawWidth === "number" ? `${rawWidth}px` : String(rawWidth);
|
|
901
895
|
}
|
|
902
|
-
|
|
903
|
-
// src/modules/background/model/video-frame.ts
|
|
904
896
|
function resolveVideoFrame({
|
|
905
897
|
baseStyle,
|
|
906
898
|
className,
|
|
@@ -959,99 +951,47 @@ function resolveVideoFrame({
|
|
|
959
951
|
};
|
|
960
952
|
}
|
|
961
953
|
|
|
962
|
-
// src/modules/background/
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
function getBackgroundMotionConfig(motion2, animation) {
|
|
967
|
-
return {
|
|
968
|
-
animate: animation?.animate ?? motion2.animate,
|
|
969
|
-
exit: animation?.exit ?? motion2.exit,
|
|
970
|
-
exitDurationFactor: Number(animation?.exitDurationFactor),
|
|
971
|
-
initial: animation?.initial ?? motion2.initial,
|
|
972
|
-
transition: animation?.transition ?? motion2.transition
|
|
973
|
-
};
|
|
974
|
-
}
|
|
975
|
-
function getBackgroundExitTransition(motion2, config) {
|
|
976
|
-
const own = config.exit.transition;
|
|
977
|
-
const fallback = motion2.exit.transition;
|
|
978
|
-
const factor = Number.isFinite(config.exitDurationFactor) ? Math.max(0, config.exitDurationFactor) : motion2.exitDurationFactor;
|
|
979
|
-
return {
|
|
980
|
-
...config.transition,
|
|
981
|
-
delay: 0,
|
|
982
|
-
duration: own?.duration ?? (config.transition.duration ?? motion2.transition.duration ?? 0) * factor,
|
|
983
|
-
ease: own?.ease ?? fallback?.ease
|
|
984
|
-
};
|
|
985
|
-
}
|
|
986
|
-
function toCssDuration(seconds, fallback = 0) {
|
|
987
|
-
const value = Number(seconds);
|
|
988
|
-
return `${Math.max(0, Number.isFinite(value) ? value : fallback) * 1e3}ms`;
|
|
954
|
+
// src/modules/background/hooks.ts
|
|
955
|
+
var NOOP_BACKGROUND_STORE = createStore(DEFAULT_BACKGROUND_COMPUTED);
|
|
956
|
+
function useBackgroundRegistration(config, options) {
|
|
957
|
+
useModuleRegistration("background", config, options);
|
|
989
958
|
}
|
|
990
|
-
function
|
|
991
|
-
const
|
|
992
|
-
|
|
959
|
+
function useBackgroundState() {
|
|
960
|
+
const {
|
|
961
|
+
store
|
|
962
|
+
} = useRequiredContext(BackgroundContext, "useBackgroundState", "BackgroundProvider");
|
|
963
|
+
return useStore(store);
|
|
993
964
|
}
|
|
994
|
-
function
|
|
995
|
-
return
|
|
965
|
+
function useBackgroundActions() {
|
|
966
|
+
return useRequiredContext(BackgroundContext, "useBackgroundActions", "BackgroundProvider").actions;
|
|
996
967
|
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
const
|
|
1001
|
-
const
|
|
1002
|
-
const {
|
|
1003
|
-
reduced,
|
|
1004
|
-
still,
|
|
1005
|
-
tempo
|
|
1006
|
-
} = useMotionTokens();
|
|
1007
|
-
let motionConfig;
|
|
1008
|
-
let overlayTransitionStyle;
|
|
968
|
+
function useBackground(config, options) {
|
|
969
|
+
const $ = c(3);
|
|
970
|
+
useBackgroundRegistration(config, options);
|
|
971
|
+
const actions = useBackgroundActions();
|
|
972
|
+
const state = useBackgroundState();
|
|
1009
973
|
let t0;
|
|
1010
|
-
if ($[0] !==
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
tempo
|
|
1015
|
-
}));
|
|
1016
|
-
overlayTransitionStyle = {
|
|
1017
|
-
transitionDelay: toCssDelay(motionConfig.transition.delay),
|
|
1018
|
-
transitionDuration: toCssDuration(motionConfig.transition.duration, backgroundMotion.transition.duration),
|
|
1019
|
-
transitionProperty: "opacity",
|
|
1020
|
-
transitionTimingFunction: toCssEasing(motionConfig.transition.ease)
|
|
1021
|
-
};
|
|
1022
|
-
t0 = getBackgroundExitTransition(backgroundMotion, motionConfig);
|
|
1023
|
-
$[0] = animation;
|
|
1024
|
-
$[1] = backgroundMotion;
|
|
1025
|
-
$[2] = reduced;
|
|
1026
|
-
$[3] = still;
|
|
1027
|
-
$[4] = tempo;
|
|
1028
|
-
$[5] = motionConfig;
|
|
1029
|
-
$[6] = overlayTransitionStyle;
|
|
1030
|
-
$[7] = t0;
|
|
1031
|
-
} else {
|
|
1032
|
-
motionConfig = $[5];
|
|
1033
|
-
overlayTransitionStyle = $[6];
|
|
1034
|
-
t0 = $[7];
|
|
1035
|
-
}
|
|
1036
|
-
const exitTransition = t0;
|
|
1037
|
-
let t1;
|
|
1038
|
-
if ($[8] !== exitTransition || $[9] !== motionConfig || $[10] !== overlayTransitionStyle) {
|
|
1039
|
-
t1 = {
|
|
1040
|
-
exitTransition,
|
|
1041
|
-
motionConfig,
|
|
1042
|
-
overlayTransitionStyle
|
|
974
|
+
if ($[0] !== actions || $[1] !== state) {
|
|
975
|
+
t0 = {
|
|
976
|
+
...state,
|
|
977
|
+
...actions
|
|
1043
978
|
};
|
|
1044
|
-
$[
|
|
1045
|
-
$[
|
|
1046
|
-
$[
|
|
1047
|
-
$[11] = t1;
|
|
979
|
+
$[0] = actions;
|
|
980
|
+
$[1] = state;
|
|
981
|
+
$[2] = t0;
|
|
1048
982
|
} else {
|
|
1049
|
-
|
|
983
|
+
t0 = $[2];
|
|
1050
984
|
}
|
|
1051
|
-
return
|
|
985
|
+
return t0;
|
|
986
|
+
}
|
|
987
|
+
function useOptionalBackgroundState(selector, isEqual) {
|
|
988
|
+
const ctx = use(BackgroundContext);
|
|
989
|
+
return useStore(ctx?.store ?? NOOP_BACKGROUND_STORE, selector, isEqual);
|
|
990
|
+
}
|
|
991
|
+
function useOptionalBackgroundActions() {
|
|
992
|
+
const ctx = use(BackgroundContext);
|
|
993
|
+
return ctx?.actions ?? INERT_BACKGROUND_ACTIONS;
|
|
1052
994
|
}
|
|
1053
|
-
|
|
1054
|
-
// src/modules/background/hooks/use-background-overlay-model.ts
|
|
1055
995
|
function resolveBackgroundKey({
|
|
1056
996
|
image,
|
|
1057
997
|
isVideo,
|
|
@@ -1289,88 +1229,79 @@ function useBackgroundOverlayModel() {
|
|
|
1289
1229
|
}
|
|
1290
1230
|
return t3;
|
|
1291
1231
|
}
|
|
1232
|
+
function useBackgroundMotionModel(animation) {
|
|
1233
|
+
const $ = c(12);
|
|
1234
|
+
const backgroundMotion = useBackgroundMotion();
|
|
1235
|
+
const {
|
|
1236
|
+
reduced,
|
|
1237
|
+
still,
|
|
1238
|
+
tempo
|
|
1239
|
+
} = useMotionTokens();
|
|
1240
|
+
let motionConfig;
|
|
1241
|
+
let overlayTransitionStyle;
|
|
1242
|
+
let t0;
|
|
1243
|
+
if ($[0] !== animation || $[1] !== backgroundMotion || $[2] !== reduced || $[3] !== still || $[4] !== tempo) {
|
|
1244
|
+
motionConfig = getBackgroundMotionConfig(backgroundMotion, retime(animation, {
|
|
1245
|
+
reduced,
|
|
1246
|
+
still,
|
|
1247
|
+
tempo
|
|
1248
|
+
}));
|
|
1249
|
+
overlayTransitionStyle = {
|
|
1250
|
+
transitionDelay: toCssDelay(motionConfig.transition.delay),
|
|
1251
|
+
transitionDuration: toCssDuration(motionConfig.transition.duration, backgroundMotion.transition.duration),
|
|
1252
|
+
transitionProperty: "opacity",
|
|
1253
|
+
transitionTimingFunction: toCssEasing(motionConfig.transition.ease)
|
|
1254
|
+
};
|
|
1255
|
+
t0 = getBackgroundExitTransition(backgroundMotion, motionConfig);
|
|
1256
|
+
$[0] = animation;
|
|
1257
|
+
$[1] = backgroundMotion;
|
|
1258
|
+
$[2] = reduced;
|
|
1259
|
+
$[3] = still;
|
|
1260
|
+
$[4] = tempo;
|
|
1261
|
+
$[5] = motionConfig;
|
|
1262
|
+
$[6] = overlayTransitionStyle;
|
|
1263
|
+
$[7] = t0;
|
|
1264
|
+
} else {
|
|
1265
|
+
motionConfig = $[5];
|
|
1266
|
+
overlayTransitionStyle = $[6];
|
|
1267
|
+
t0 = $[7];
|
|
1268
|
+
}
|
|
1269
|
+
const exitTransition = t0;
|
|
1270
|
+
let t1;
|
|
1271
|
+
if ($[8] !== exitTransition || $[9] !== motionConfig || $[10] !== overlayTransitionStyle) {
|
|
1272
|
+
t1 = {
|
|
1273
|
+
exitTransition,
|
|
1274
|
+
motionConfig,
|
|
1275
|
+
overlayTransitionStyle
|
|
1276
|
+
};
|
|
1277
|
+
$[8] = exitTransition;
|
|
1278
|
+
$[9] = motionConfig;
|
|
1279
|
+
$[10] = overlayTransitionStyle;
|
|
1280
|
+
$[11] = t1;
|
|
1281
|
+
} else {
|
|
1282
|
+
t1 = $[11];
|
|
1283
|
+
}
|
|
1284
|
+
return t1;
|
|
1285
|
+
}
|
|
1292
1286
|
|
|
1293
|
-
// src/modules/background/youtube/
|
|
1294
|
-
var
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
const handler = () => {
|
|
1306
|
-
unlock();
|
|
1307
|
-
window.removeEventListener("pointerdown", handler);
|
|
1308
|
-
window.removeEventListener("keydown", handler);
|
|
1309
|
-
};
|
|
1310
|
-
window.addEventListener("pointerdown", handler, {
|
|
1311
|
-
once: true
|
|
1312
|
-
});
|
|
1313
|
-
window.addEventListener("keydown", handler, {
|
|
1314
|
-
once: true
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
function resolveCompanionVolume(volume) {
|
|
1318
|
-
const numeric = Number(volume);
|
|
1319
|
-
return Math.max(0, Math.min(1, Number.isFinite(numeric) ? numeric : 1));
|
|
1320
|
-
}
|
|
1321
|
-
function syncCompanionAudioElements({
|
|
1322
|
-
audio,
|
|
1323
|
-
forceSeek,
|
|
1324
|
-
seekClock,
|
|
1325
|
-
video
|
|
1326
|
-
}) {
|
|
1327
|
-
if (!video || !audio) return;
|
|
1328
|
-
try {
|
|
1329
|
-
const targetRate = Number(video.playbackRate) || 1;
|
|
1330
|
-
if (audio.playbackRate !== targetRate) audio.playbackRate = targetRate;
|
|
1331
|
-
if (audio.readyState < AUDIO_MIN_READY_STATE || !Number.isFinite(audio.duration) || audio.duration <= 0) {
|
|
1332
|
-
return;
|
|
1333
|
-
}
|
|
1334
|
-
const volume = resolveCompanionVolume(video.volume);
|
|
1335
|
-
if (Math.abs(audio.volume - volume) > AUDIO_VOLUME_EPSILON) {
|
|
1336
|
-
audio.volume = volume;
|
|
1337
|
-
}
|
|
1338
|
-
const isSilent = Boolean(video.muted) || volume === 0;
|
|
1339
|
-
if (audio.muted !== isSilent) audio.muted = isSilent;
|
|
1340
|
-
if (video.paused || video.ended || video.seeking) {
|
|
1341
|
-
if (!audio.paused) audio.pause();
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
const now = performance.now();
|
|
1345
|
-
const drift = Math.abs(audio.currentTime - video.currentTime);
|
|
1346
|
-
const maxDrift = isSilent ? AUDIO_DRIFT_LIMIT_SILENT : AUDIO_DRIFT_LIMIT;
|
|
1347
|
-
if (forceSeek || drift > maxDrift && now - seekClock.current > AUDIO_SEEK_COOLDOWN_MS) {
|
|
1348
|
-
seekClock.current = now;
|
|
1349
|
-
audio.currentTime = video.currentTime;
|
|
1350
|
-
}
|
|
1351
|
-
if (audio.paused) audio.play().catch(() => {
|
|
1352
|
-
});
|
|
1353
|
-
} catch {
|
|
1354
|
-
}
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
// src/modules/background/youtube/lib/timing.ts
|
|
1358
|
-
function scheduleRetryTimer(timerIds, callback, delay) {
|
|
1359
|
-
const timerId = window.setTimeout(() => {
|
|
1360
|
-
timerIds.delete(timerId);
|
|
1361
|
-
try {
|
|
1362
|
-
callback();
|
|
1363
|
-
} catch {
|
|
1364
|
-
}
|
|
1365
|
-
}, delay);
|
|
1366
|
-
timerIds.add(timerId);
|
|
1287
|
+
// src/modules/background/youtube/timing.ts
|
|
1288
|
+
var IFRAME_MIN_END_MARGIN = 0.4;
|
|
1289
|
+
function scheduleRetryTimer(timerIds, callback, delay) {
|
|
1290
|
+
const timerId = window.setTimeout(() => {
|
|
1291
|
+
timerIds.delete(timerId);
|
|
1292
|
+
try {
|
|
1293
|
+
callback();
|
|
1294
|
+
} catch (error) {
|
|
1295
|
+
report("Background playback retry", error, "warn");
|
|
1296
|
+
}
|
|
1297
|
+
}, delay);
|
|
1298
|
+
timerIds.add(timerId);
|
|
1367
1299
|
}
|
|
1368
1300
|
function resolveEffectiveEnd(endTime, corp, duration) {
|
|
1369
1301
|
if (endTime > 0) return endTime;
|
|
1370
1302
|
if (corp > 0 && duration > 0) return duration - corp;
|
|
1371
1303
|
return 0;
|
|
1372
1304
|
}
|
|
1373
|
-
var IFRAME_MIN_END_MARGIN = 0.4;
|
|
1374
1305
|
function resolveIframeSafetyEnd(endTime, corp, duration) {
|
|
1375
1306
|
if (endTime > 0) return endTime;
|
|
1376
1307
|
if (duration > 0) return duration - Math.max(corp, IFRAME_MIN_END_MARGIN);
|
|
@@ -1384,213 +1315,303 @@ function isWithinCorp(currentTime, duration, corp) {
|
|
|
1384
1315
|
if (!duration) return false;
|
|
1385
1316
|
return corp > 0 && currentTime >= duration - corp;
|
|
1386
1317
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
var HAVE_CURRENT_DATA = 2;
|
|
1390
|
-
var ERROR_RESUME_RETRY_DELAY_MS = 150;
|
|
1391
|
-
var LOAD_RETRY_DELAY_MS = 200;
|
|
1392
|
-
var AUDIO_RETRY_DELAY_MS = 200;
|
|
1393
|
-
var MAX_VIDEO_LOAD_RETRIES = 1;
|
|
1394
|
-
var MAX_AUDIO_LOAD_RETRIES = 1;
|
|
1395
|
-
function playWithMutedFallback({
|
|
1396
|
-
forceSeek,
|
|
1397
|
-
live,
|
|
1398
|
-
setVideoPlaying,
|
|
1399
|
-
syncCompanionAudio,
|
|
1400
|
-
unlockAudio,
|
|
1401
|
-
video,
|
|
1402
|
-
videoRef
|
|
1403
|
-
}) {
|
|
1404
|
-
const onPlayed = () => {
|
|
1405
|
-
setVideoPlaying(true);
|
|
1406
|
-
syncCompanionAudio(forceSeek);
|
|
1407
|
-
};
|
|
1408
|
-
video.play().then(onPlayed).catch((error) => {
|
|
1409
|
-
if (error?.name !== "NotAllowedError") return;
|
|
1410
|
-
video.muted = true;
|
|
1411
|
-
video.play().then(() => {
|
|
1412
|
-
onPlayed();
|
|
1413
|
-
if (!unlockAudio) return;
|
|
1414
|
-
unlockAudioOnGesture(() => {
|
|
1415
|
-
const current = videoRef.current;
|
|
1416
|
-
if (!live.current.isMuted && current) {
|
|
1417
|
-
setElementMuted(current, false);
|
|
1418
|
-
}
|
|
1419
|
-
});
|
|
1420
|
-
}).catch(() => {
|
|
1421
|
-
});
|
|
1422
|
-
});
|
|
1423
|
-
}
|
|
1424
|
-
function endVideoPlayback(ctx) {
|
|
1318
|
+
function NativeVideo(t0) {
|
|
1319
|
+
const $ = c(22);
|
|
1425
1320
|
const {
|
|
1426
|
-
|
|
1427
|
-
|
|
1321
|
+
corp,
|
|
1322
|
+
isLoop,
|
|
1323
|
+
isMuted,
|
|
1324
|
+
isPlaying,
|
|
1325
|
+
playbackRate,
|
|
1326
|
+
setVideoElement,
|
|
1428
1327
|
setVideoPlaying,
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
if (
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1328
|
+
shouldAutoPlay,
|
|
1329
|
+
src,
|
|
1330
|
+
style,
|
|
1331
|
+
className
|
|
1332
|
+
} = t0;
|
|
1333
|
+
let t1;
|
|
1334
|
+
if ($[0] !== className || $[1] !== corp || $[2] !== isLoop || $[3] !== isMuted || $[4] !== isPlaying || $[5] !== playbackRate || $[6] !== setVideoElement || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay || $[9] !== src || $[10] !== style) {
|
|
1335
|
+
t1 = {
|
|
1336
|
+
corp,
|
|
1337
|
+
isLoop,
|
|
1338
|
+
isMuted,
|
|
1339
|
+
isPlaying,
|
|
1340
|
+
playbackRate,
|
|
1341
|
+
setVideoElement,
|
|
1342
|
+
setVideoPlaying,
|
|
1343
|
+
shouldAutoPlay,
|
|
1344
|
+
src,
|
|
1345
|
+
style,
|
|
1346
|
+
className
|
|
1347
|
+
};
|
|
1348
|
+
$[0] = className;
|
|
1349
|
+
$[1] = corp;
|
|
1350
|
+
$[2] = isLoop;
|
|
1351
|
+
$[3] = isMuted;
|
|
1352
|
+
$[4] = isPlaying;
|
|
1353
|
+
$[5] = playbackRate;
|
|
1354
|
+
$[6] = setVideoElement;
|
|
1355
|
+
$[7] = setVideoPlaying;
|
|
1356
|
+
$[8] = shouldAutoPlay;
|
|
1357
|
+
$[9] = src;
|
|
1358
|
+
$[10] = style;
|
|
1359
|
+
$[11] = t1;
|
|
1360
|
+
} else {
|
|
1361
|
+
t1 = $[11];
|
|
1447
1362
|
}
|
|
1448
|
-
video.pause();
|
|
1449
|
-
if (audio && !audio.paused) audio.pause();
|
|
1450
|
-
setVideoPlaying(false);
|
|
1451
|
-
}
|
|
1452
|
-
function handleCompanionAudioError(ctx) {
|
|
1453
1363
|
const {
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1364
|
+
videoRef,
|
|
1365
|
+
handleEnded,
|
|
1366
|
+
handleTimeUpdate,
|
|
1367
|
+
handleLoadedData
|
|
1368
|
+
} = useNativeVideoModel(t1);
|
|
1369
|
+
let t2;
|
|
1370
|
+
if ($[12] !== className || $[13] !== handleEnded || $[14] !== handleLoadedData || $[15] !== handleTimeUpdate || $[16] !== isLoop || $[17] !== isMuted || $[18] !== src || $[19] !== style || $[20] !== videoRef) {
|
|
1371
|
+
t2 = /* @__PURE__ */ jsx("video", { ref: videoRef, src, className, preload: "auto", muted: isMuted, loop: isLoop, playsInline: true, style, onTimeUpdate: handleTimeUpdate, onEnded: handleEnded, onLoadedData: handleLoadedData });
|
|
1372
|
+
$[12] = className;
|
|
1373
|
+
$[13] = handleEnded;
|
|
1374
|
+
$[14] = handleLoadedData;
|
|
1375
|
+
$[15] = handleTimeUpdate;
|
|
1376
|
+
$[16] = isLoop;
|
|
1377
|
+
$[17] = isMuted;
|
|
1378
|
+
$[18] = src;
|
|
1379
|
+
$[19] = style;
|
|
1380
|
+
$[20] = videoRef;
|
|
1381
|
+
$[21] = t2;
|
|
1382
|
+
} else {
|
|
1383
|
+
t2 = $[21];
|
|
1474
1384
|
}
|
|
1385
|
+
return t2;
|
|
1475
1386
|
}
|
|
1476
|
-
function
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
ctx.setIsFrameReady(true);
|
|
1481
|
-
ctx.setIsBuffering(false);
|
|
1387
|
+
function pauseQuietly(video) {
|
|
1388
|
+
try {
|
|
1389
|
+
video?.pause();
|
|
1390
|
+
} catch {
|
|
1482
1391
|
}
|
|
1483
|
-
|
|
1392
|
+
}
|
|
1393
|
+
function useNativeVideoModel(t0) {
|
|
1394
|
+
const $ = c(27);
|
|
1484
1395
|
const {
|
|
1485
1396
|
corp,
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1397
|
+
isMuted,
|
|
1398
|
+
isPlaying,
|
|
1399
|
+
playbackRate,
|
|
1400
|
+
setVideoElement,
|
|
1401
|
+
setVideoPlaying,
|
|
1402
|
+
shouldAutoPlay,
|
|
1403
|
+
src
|
|
1404
|
+
} = t0;
|
|
1405
|
+
const videoRef = useRef(null);
|
|
1406
|
+
let t1;
|
|
1407
|
+
if ($[0] !== setVideoPlaying) {
|
|
1408
|
+
t1 = () => {
|
|
1409
|
+
const video = videoRef.current;
|
|
1410
|
+
if (!video) {
|
|
1411
|
+
return;
|
|
1412
|
+
}
|
|
1413
|
+
if (video.loop) {
|
|
1414
|
+
video.currentTime = 0;
|
|
1415
|
+
video.play().catch(_temp);
|
|
1416
|
+
return;
|
|
1417
|
+
}
|
|
1418
|
+
video.pause();
|
|
1419
|
+
setVideoPlaying(false);
|
|
1420
|
+
};
|
|
1421
|
+
$[0] = setVideoPlaying;
|
|
1422
|
+
$[1] = t1;
|
|
1423
|
+
} else {
|
|
1424
|
+
t1 = $[1];
|
|
1497
1425
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
ctx.setIsBuffering(false);
|
|
1513
|
-
if (video && !video.seeking && !video.ended && !ctx.live.current.isPlaying) {
|
|
1514
|
-
ctx.setVideoPlaying(false);
|
|
1426
|
+
const handleEnded = t1;
|
|
1427
|
+
let t2;
|
|
1428
|
+
if ($[2] !== corp || $[3] !== handleEnded) {
|
|
1429
|
+
t2 = () => {
|
|
1430
|
+
const video_0 = videoRef.current;
|
|
1431
|
+
if (video_0 && isWithinCorp(video_0.currentTime, video_0.duration, corp)) {
|
|
1432
|
+
handleEnded();
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
$[2] = corp;
|
|
1436
|
+
$[3] = handleEnded;
|
|
1437
|
+
$[4] = t2;
|
|
1438
|
+
} else {
|
|
1439
|
+
t2 = $[4];
|
|
1515
1440
|
}
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1441
|
+
const handleTimeUpdate = t2;
|
|
1442
|
+
let t3;
|
|
1443
|
+
if ($[5] !== isMuted || $[6] !== playbackRate || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay) {
|
|
1444
|
+
t3 = () => {
|
|
1445
|
+
const video_1 = videoRef.current;
|
|
1446
|
+
if (!video_1) {
|
|
1447
|
+
return;
|
|
1448
|
+
}
|
|
1449
|
+
video_1.playbackRate = playbackRate;
|
|
1450
|
+
if (!shouldAutoPlay) {
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
if (isMuted) {
|
|
1454
|
+
video_1.muted = true;
|
|
1455
|
+
}
|
|
1456
|
+
video_1.play().then(() => setVideoPlaying(true)).catch((error_0) => {
|
|
1457
|
+
report("Background autoplay", error_0, "warn");
|
|
1458
|
+
setVideoPlaying(false);
|
|
1459
|
+
});
|
|
1460
|
+
};
|
|
1461
|
+
$[5] = isMuted;
|
|
1462
|
+
$[6] = playbackRate;
|
|
1463
|
+
$[7] = setVideoPlaying;
|
|
1464
|
+
$[8] = shouldAutoPlay;
|
|
1465
|
+
$[9] = t3;
|
|
1466
|
+
} else {
|
|
1467
|
+
t3 = $[9];
|
|
1526
1468
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1469
|
+
const handleLoadedData = t3;
|
|
1470
|
+
let t4;
|
|
1471
|
+
if ($[10] !== setVideoElement) {
|
|
1472
|
+
t4 = () => {
|
|
1473
|
+
const video_2 = videoRef.current;
|
|
1474
|
+
setVideoElement(video_2);
|
|
1475
|
+
return () => {
|
|
1476
|
+
pauseQuietly(video_2);
|
|
1477
|
+
};
|
|
1478
|
+
};
|
|
1479
|
+
$[10] = setVideoElement;
|
|
1480
|
+
$[11] = t4;
|
|
1481
|
+
} else {
|
|
1482
|
+
t4 = $[11];
|
|
1534
1483
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
} else if (video.paused) {
|
|
1544
|
-
setElementMuted(video, Boolean(ctx.live.current.isMuted));
|
|
1545
|
-
ctx.playWithFallback(video, false, true);
|
|
1484
|
+
let t5;
|
|
1485
|
+
if ($[12] !== setVideoElement || $[13] !== src) {
|
|
1486
|
+
t5 = [src, setVideoElement];
|
|
1487
|
+
$[12] = setVideoElement;
|
|
1488
|
+
$[13] = src;
|
|
1489
|
+
$[14] = t5;
|
|
1490
|
+
} else {
|
|
1491
|
+
t5 = $[14];
|
|
1546
1492
|
}
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
if (
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1493
|
+
useEffect(t4, t5);
|
|
1494
|
+
let t6;
|
|
1495
|
+
let t7;
|
|
1496
|
+
if ($[15] !== setVideoElement) {
|
|
1497
|
+
t6 = () => () => setVideoElement(null);
|
|
1498
|
+
t7 = [setVideoElement];
|
|
1499
|
+
$[15] = setVideoElement;
|
|
1500
|
+
$[16] = t6;
|
|
1501
|
+
$[17] = t7;
|
|
1502
|
+
} else {
|
|
1503
|
+
t6 = $[16];
|
|
1504
|
+
t7 = $[17];
|
|
1555
1505
|
}
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
if (
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1506
|
+
useEffect(t6, t7);
|
|
1507
|
+
let t8;
|
|
1508
|
+
let t9;
|
|
1509
|
+
if ($[18] !== isPlaying || $[19] !== playbackRate || $[20] !== setVideoPlaying) {
|
|
1510
|
+
t8 = () => {
|
|
1511
|
+
applyVideoPlaybackState({
|
|
1512
|
+
isPlaying,
|
|
1513
|
+
playbackRate,
|
|
1514
|
+
setVideoPlaying,
|
|
1515
|
+
videoElement: videoRef.current
|
|
1516
|
+
});
|
|
1517
|
+
};
|
|
1518
|
+
t9 = [isPlaying, playbackRate, setVideoPlaying];
|
|
1519
|
+
$[18] = isPlaying;
|
|
1520
|
+
$[19] = playbackRate;
|
|
1521
|
+
$[20] = setVideoPlaying;
|
|
1522
|
+
$[21] = t8;
|
|
1523
|
+
$[22] = t9;
|
|
1524
|
+
} else {
|
|
1525
|
+
t8 = $[21];
|
|
1526
|
+
t9 = $[22];
|
|
1565
1527
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1528
|
+
useEffect(t8, t9);
|
|
1529
|
+
let t10;
|
|
1530
|
+
if ($[23] !== handleEnded || $[24] !== handleLoadedData || $[25] !== handleTimeUpdate) {
|
|
1531
|
+
t10 = {
|
|
1532
|
+
videoRef,
|
|
1533
|
+
handleEnded,
|
|
1534
|
+
handleTimeUpdate,
|
|
1535
|
+
handleLoadedData
|
|
1536
|
+
};
|
|
1537
|
+
$[23] = handleEnded;
|
|
1538
|
+
$[24] = handleLoadedData;
|
|
1539
|
+
$[25] = handleTimeUpdate;
|
|
1540
|
+
$[26] = t10;
|
|
1541
|
+
} else {
|
|
1542
|
+
t10 = $[26];
|
|
1571
1543
|
}
|
|
1544
|
+
return t10;
|
|
1572
1545
|
}
|
|
1573
|
-
function
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
if (
|
|
1587
|
-
|
|
1588
|
-
|
|
1546
|
+
function _temp(error) {
|
|
1547
|
+
return report("Background loop play", error, "warn");
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
// src/modules/background/youtube/audio.ts
|
|
1551
|
+
var AUDIO_SEEK_COOLDOWN_MS = 1500;
|
|
1552
|
+
var AUDIO_DRIFT_LIMIT = 0.35;
|
|
1553
|
+
var AUDIO_DRIFT_LIMIT_SILENT = 0.5;
|
|
1554
|
+
var AUDIO_VOLUME_EPSILON = 5e-3;
|
|
1555
|
+
var AUDIO_MIN_READY_STATE = 2;
|
|
1556
|
+
var AUDIO_SYNC_EVENTS = ["play", "playing", "pause", "waiting", "volumechange", "ratechange"];
|
|
1557
|
+
function setElementMuted(video, muted) {
|
|
1558
|
+
video.muted = muted;
|
|
1559
|
+
if (!muted && video.volume === 0) video.volume = DEFAULT_AUDIBLE_VOLUME;
|
|
1560
|
+
}
|
|
1561
|
+
function unlockAudioOnGesture(unlock) {
|
|
1562
|
+
const handler = () => {
|
|
1563
|
+
unlock();
|
|
1564
|
+
window.removeEventListener("pointerdown", handler);
|
|
1565
|
+
window.removeEventListener("keydown", handler);
|
|
1566
|
+
};
|
|
1567
|
+
window.addEventListener("pointerdown", handler, {
|
|
1568
|
+
once: true
|
|
1569
|
+
});
|
|
1570
|
+
window.addEventListener("keydown", handler, {
|
|
1571
|
+
once: true
|
|
1572
|
+
});
|
|
1573
|
+
}
|
|
1574
|
+
function resolveCompanionVolume(volume) {
|
|
1575
|
+
const numeric = Number(volume);
|
|
1576
|
+
return Math.max(0, Math.min(1, Number.isFinite(numeric) ? numeric : 1));
|
|
1577
|
+
}
|
|
1578
|
+
function syncCompanionAudioElements({
|
|
1579
|
+
audio,
|
|
1580
|
+
forceSeek,
|
|
1581
|
+
seekClock,
|
|
1582
|
+
video
|
|
1583
|
+
}) {
|
|
1584
|
+
if (!video || !audio) return;
|
|
1585
|
+
try {
|
|
1586
|
+
const targetRate = Number(video.playbackRate) || 1;
|
|
1587
|
+
if (audio.playbackRate !== targetRate) audio.playbackRate = targetRate;
|
|
1588
|
+
if (audio.readyState < AUDIO_MIN_READY_STATE || !Number.isFinite(audio.duration) || audio.duration <= 0) {
|
|
1589
|
+
return;
|
|
1590
|
+
}
|
|
1591
|
+
const volume = resolveCompanionVolume(video.volume);
|
|
1592
|
+
if (Math.abs(audio.volume - volume) > AUDIO_VOLUME_EPSILON) {
|
|
1593
|
+
audio.volume = volume;
|
|
1594
|
+
}
|
|
1595
|
+
const isSilent = Boolean(video.muted) || volume === 0;
|
|
1596
|
+
if (audio.muted !== isSilent) audio.muted = isSilent;
|
|
1597
|
+
if (video.paused || video.ended || video.seeking) {
|
|
1598
|
+
if (!audio.paused) audio.pause();
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1601
|
+
const now = performance.now();
|
|
1602
|
+
const drift = Math.abs(audio.currentTime - video.currentTime);
|
|
1603
|
+
const maxDrift = isSilent ? AUDIO_DRIFT_LIMIT_SILENT : AUDIO_DRIFT_LIMIT;
|
|
1604
|
+
if (forceSeek || drift > maxDrift && now - seekClock.current > AUDIO_SEEK_COOLDOWN_MS) {
|
|
1605
|
+
seekClock.current = now;
|
|
1606
|
+
audio.currentTime = video.currentTime;
|
|
1607
|
+
}
|
|
1608
|
+
if (audio.paused) audio.play().catch(() => {
|
|
1609
|
+
});
|
|
1610
|
+
} catch {
|
|
1589
1611
|
}
|
|
1590
|
-
ctx.setUseIframeFallback(true);
|
|
1591
1612
|
}
|
|
1592
1613
|
|
|
1593
|
-
// src/modules/background/youtube/
|
|
1614
|
+
// src/modules/background/youtube/iframe.ts
|
|
1594
1615
|
var PLAYER_STATE = {
|
|
1595
1616
|
ENDED: 0,
|
|
1596
1617
|
PLAYING: 1,
|
|
@@ -1624,125 +1645,6 @@ function setHighQuality(player) {
|
|
|
1624
1645
|
player?.setPlaybackQualityRange?.("hd1080", "hd1080");
|
|
1625
1646
|
player?.setPlaybackQuality?.("hd1080");
|
|
1626
1647
|
}
|
|
1627
|
-
|
|
1628
|
-
// src/modules/background/youtube/lib/iframe-engine.ts
|
|
1629
|
-
function createIframeEngine({
|
|
1630
|
-
emit,
|
|
1631
|
-
getPlayer,
|
|
1632
|
-
getProxy,
|
|
1633
|
-
isDisposed,
|
|
1634
|
-
live,
|
|
1635
|
-
setIsBuffering,
|
|
1636
|
-
setIsFrameReady,
|
|
1637
|
-
setPlayer,
|
|
1638
|
-
setVideoElement,
|
|
1639
|
-
setVideoPlaying,
|
|
1640
|
-
startProgress,
|
|
1641
|
-
state
|
|
1642
|
-
}) {
|
|
1643
|
-
const restart = (target) => {
|
|
1644
|
-
const restartAt = Math.max(0, live.current.startTime || 0);
|
|
1645
|
-
target?.seekTo?.(restartAt, true);
|
|
1646
|
-
target?.playVideo?.();
|
|
1647
|
-
return restartAt;
|
|
1648
|
-
};
|
|
1649
|
-
const trackProgress = () => {
|
|
1650
|
-
const current = getPlayer();
|
|
1651
|
-
if (!current || typeof current.getCurrentTime !== "function") return;
|
|
1652
|
-
const time = Number(current.getCurrentTime()) || 0;
|
|
1653
|
-
const duration = Number(current.getDuration?.()) || state.duration;
|
|
1654
|
-
state.currentTime = time;
|
|
1655
|
-
if (duration > 0 && duration !== state.duration) {
|
|
1656
|
-
state.duration = duration;
|
|
1657
|
-
emit("durationchange");
|
|
1658
|
-
}
|
|
1659
|
-
const {
|
|
1660
|
-
corp,
|
|
1661
|
-
endTime,
|
|
1662
|
-
isLoop: loops
|
|
1663
|
-
} = live.current;
|
|
1664
|
-
const safetyEnd = resolveIframeSafetyEnd(endTime, corp, duration);
|
|
1665
|
-
if (safetyEnd > 0 && time >= safetyEnd) {
|
|
1666
|
-
if (state.loop || loops) {
|
|
1667
|
-
state.currentTime = restart(current);
|
|
1668
|
-
} else {
|
|
1669
|
-
current.pauseVideo?.();
|
|
1670
|
-
state.paused = true;
|
|
1671
|
-
setVideoPlaying(false);
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
emit("timeupdate");
|
|
1675
|
-
};
|
|
1676
|
-
const handleReady = (event) => {
|
|
1677
|
-
if (isDisposed()) return;
|
|
1678
|
-
const target = event.target;
|
|
1679
|
-
setPlayer(target ?? null);
|
|
1680
|
-
state.duration = Number(target?.getDuration?.()) || 0;
|
|
1681
|
-
const {
|
|
1682
|
-
isMuted: muted,
|
|
1683
|
-
isPlaying,
|
|
1684
|
-
playbackRate: rate
|
|
1685
|
-
} = live.current;
|
|
1686
|
-
if (rate !== 1) target?.setPlaybackRate?.(rate);
|
|
1687
|
-
if (muted) {
|
|
1688
|
-
target?.mute?.();
|
|
1689
|
-
} else {
|
|
1690
|
-
target?.unMute?.();
|
|
1691
|
-
target?.setVolume?.(toPlayerVolume(DEFAULT_AUDIBLE_VOLUME));
|
|
1692
|
-
}
|
|
1693
|
-
if (live.current.shouldAutoPlay && isPlaying) {
|
|
1694
|
-
setHighQuality(target);
|
|
1695
|
-
target?.playVideo?.();
|
|
1696
|
-
state.paused = false;
|
|
1697
|
-
setVideoPlaying(true);
|
|
1698
|
-
}
|
|
1699
|
-
const proxy = getProxy();
|
|
1700
|
-
if (proxy) {
|
|
1701
|
-
setVideoElement(proxy);
|
|
1702
|
-
emit("loadedmetadata");
|
|
1703
|
-
emit("durationchange");
|
|
1704
|
-
}
|
|
1705
|
-
startProgress(trackProgress);
|
|
1706
|
-
};
|
|
1707
|
-
const handleStateChange = (event) => {
|
|
1708
|
-
if (isDisposed()) return;
|
|
1709
|
-
switch (event.data) {
|
|
1710
|
-
case PLAYER_STATE.PLAYING:
|
|
1711
|
-
setHighQuality(event.target);
|
|
1712
|
-
state.paused = false;
|
|
1713
|
-
setIsFrameReady(true);
|
|
1714
|
-
setIsBuffering(false);
|
|
1715
|
-
setVideoPlaying(true);
|
|
1716
|
-
emit("play");
|
|
1717
|
-
emit("playing");
|
|
1718
|
-
break;
|
|
1719
|
-
case PLAYER_STATE.BUFFERING:
|
|
1720
|
-
setIsBuffering(true);
|
|
1721
|
-
break;
|
|
1722
|
-
case PLAYER_STATE.PAUSED:
|
|
1723
|
-
state.paused = true;
|
|
1724
|
-
setIsBuffering(false);
|
|
1725
|
-
setVideoPlaying(false);
|
|
1726
|
-
emit("pause");
|
|
1727
|
-
break;
|
|
1728
|
-
case PLAYER_STATE.ENDED:
|
|
1729
|
-
if (state.loop || live.current.isLoop) {
|
|
1730
|
-
restart(getPlayer());
|
|
1731
|
-
} else {
|
|
1732
|
-
state.paused = true;
|
|
1733
|
-
setVideoPlaying(false);
|
|
1734
|
-
emit("ended");
|
|
1735
|
-
}
|
|
1736
|
-
break;
|
|
1737
|
-
}
|
|
1738
|
-
};
|
|
1739
|
-
return {
|
|
1740
|
-
handleReady,
|
|
1741
|
-
handleStateChange
|
|
1742
|
-
};
|
|
1743
|
-
}
|
|
1744
|
-
|
|
1745
|
-
// src/modules/background/youtube/lib/iframe-proxy.ts
|
|
1746
1648
|
function createIframeProxyController({
|
|
1747
1649
|
player,
|
|
1748
1650
|
setVideoPlaying,
|
|
@@ -1841,7 +1743,7 @@ function createIframePlaybackState({
|
|
|
1841
1743
|
};
|
|
1842
1744
|
}
|
|
1843
1745
|
|
|
1844
|
-
// src/modules/background/youtube/
|
|
1746
|
+
// src/modules/background/youtube/use-iframe-player.ts
|
|
1845
1747
|
var PROGRESS_INTERVAL_MS = 200;
|
|
1846
1748
|
function destroyQuietly(player) {
|
|
1847
1749
|
try {
|
|
@@ -2004,32 +1906,123 @@ function useYouTubeIframePlayer(t0) {
|
|
|
2004
1906
|
}
|
|
2005
1907
|
useEffect(t3, t4);
|
|
2006
1908
|
}
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
1909
|
+
function createIframeEngine({
|
|
1910
|
+
emit,
|
|
1911
|
+
getPlayer,
|
|
1912
|
+
getProxy,
|
|
1913
|
+
isDisposed,
|
|
1914
|
+
live,
|
|
1915
|
+
setIsBuffering,
|
|
1916
|
+
setIsFrameReady,
|
|
1917
|
+
setPlayer,
|
|
1918
|
+
setVideoElement,
|
|
1919
|
+
setVideoPlaying,
|
|
1920
|
+
startProgress,
|
|
1921
|
+
state
|
|
2015
1922
|
}) {
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
1923
|
+
const restart = (target) => {
|
|
1924
|
+
const restartAt = Math.max(0, live.current.startTime || 0);
|
|
1925
|
+
target?.seekTo?.(restartAt, true);
|
|
1926
|
+
target?.playVideo?.();
|
|
1927
|
+
return restartAt;
|
|
1928
|
+
};
|
|
1929
|
+
const trackProgress = () => {
|
|
1930
|
+
const current = getPlayer();
|
|
1931
|
+
if (!current || typeof current.getCurrentTime !== "function") return;
|
|
1932
|
+
const time = Number(current.getCurrentTime()) || 0;
|
|
1933
|
+
const duration = Number(current.getDuration?.()) || state.duration;
|
|
1934
|
+
state.currentTime = time;
|
|
1935
|
+
if (duration > 0 && duration !== state.duration) {
|
|
1936
|
+
state.duration = duration;
|
|
1937
|
+
emit("durationchange");
|
|
1938
|
+
}
|
|
1939
|
+
const {
|
|
1940
|
+
corp,
|
|
1941
|
+
endTime,
|
|
1942
|
+
isLoop: loops
|
|
1943
|
+
} = live.current;
|
|
1944
|
+
const safetyEnd = resolveIframeSafetyEnd(endTime, corp, duration);
|
|
1945
|
+
if (safetyEnd > 0 && time >= safetyEnd) {
|
|
1946
|
+
if (state.loop || loops) {
|
|
1947
|
+
state.currentTime = restart(current);
|
|
1948
|
+
} else {
|
|
1949
|
+
current.pauseVideo?.();
|
|
1950
|
+
state.paused = true;
|
|
1951
|
+
setVideoPlaying(false);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
emit("timeupdate");
|
|
1955
|
+
};
|
|
1956
|
+
const handleReady = (event) => {
|
|
1957
|
+
if (isDisposed()) return;
|
|
1958
|
+
const target = event.target;
|
|
1959
|
+
setPlayer(target ?? null);
|
|
1960
|
+
state.duration = Number(target?.getDuration?.()) || 0;
|
|
1961
|
+
const {
|
|
1962
|
+
isMuted: muted,
|
|
1963
|
+
isPlaying,
|
|
1964
|
+
playbackRate: rate
|
|
1965
|
+
} = live.current;
|
|
1966
|
+
if (rate !== 1) target?.setPlaybackRate?.(rate);
|
|
1967
|
+
if (muted) {
|
|
1968
|
+
target?.mute?.();
|
|
1969
|
+
} else {
|
|
1970
|
+
target?.unMute?.();
|
|
1971
|
+
target?.setVolume?.(toPlayerVolume(DEFAULT_AUDIBLE_VOLUME));
|
|
1972
|
+
}
|
|
1973
|
+
if (live.current.shouldAutoPlay && isPlaying) {
|
|
1974
|
+
setHighQuality(target);
|
|
1975
|
+
target?.playVideo?.();
|
|
1976
|
+
state.paused = false;
|
|
1977
|
+
setVideoPlaying(true);
|
|
1978
|
+
}
|
|
1979
|
+
const proxy = getProxy();
|
|
1980
|
+
if (proxy) {
|
|
1981
|
+
setVideoElement(proxy);
|
|
1982
|
+
emit("loadedmetadata");
|
|
1983
|
+
emit("durationchange");
|
|
1984
|
+
}
|
|
1985
|
+
startProgress(trackProgress);
|
|
1986
|
+
};
|
|
1987
|
+
const handleStateChange = (event) => {
|
|
1988
|
+
if (isDisposed()) return;
|
|
1989
|
+
switch (event.data) {
|
|
1990
|
+
case PLAYER_STATE.PLAYING:
|
|
1991
|
+
setHighQuality(event.target);
|
|
1992
|
+
state.paused = false;
|
|
1993
|
+
setIsFrameReady(true);
|
|
1994
|
+
setIsBuffering(false);
|
|
1995
|
+
setVideoPlaying(true);
|
|
1996
|
+
emit("play");
|
|
1997
|
+
emit("playing");
|
|
1998
|
+
break;
|
|
1999
|
+
case PLAYER_STATE.BUFFERING:
|
|
2000
|
+
setIsBuffering(true);
|
|
2001
|
+
break;
|
|
2002
|
+
case PLAYER_STATE.PAUSED:
|
|
2003
|
+
state.paused = true;
|
|
2004
|
+
setIsBuffering(false);
|
|
2005
|
+
setVideoPlaying(false);
|
|
2006
|
+
emit("pause");
|
|
2007
|
+
break;
|
|
2008
|
+
case PLAYER_STATE.ENDED:
|
|
2009
|
+
if (state.loop || live.current.isLoop) {
|
|
2010
|
+
restart(getPlayer());
|
|
2011
|
+
} else {
|
|
2012
|
+
state.paused = true;
|
|
2013
|
+
setVideoPlaying(false);
|
|
2014
|
+
emit("ended");
|
|
2015
|
+
}
|
|
2016
|
+
break;
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2025
2019
|
return {
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
videoStreamUrl
|
|
2020
|
+
handleReady,
|
|
2021
|
+
handleStateChange
|
|
2029
2022
|
};
|
|
2030
2023
|
}
|
|
2031
2024
|
var AUDIO_SYNC_INTERVAL_MS = 1e3;
|
|
2032
|
-
function
|
|
2025
|
+
function pauseQuietly2(video, audio) {
|
|
2033
2026
|
try {
|
|
2034
2027
|
video.pause();
|
|
2035
2028
|
audio?.pause();
|
|
@@ -2074,13 +2067,13 @@ function useYouTubeVideoSync(t0) {
|
|
|
2074
2067
|
const syncTimer = window.setInterval(onSync, AUDIO_SYNC_INTERVAL_MS);
|
|
2075
2068
|
return () => {
|
|
2076
2069
|
window.clearInterval(syncTimer);
|
|
2077
|
-
retryTimerIds.forEach(
|
|
2070
|
+
retryTimerIds.forEach(_temp2);
|
|
2078
2071
|
retryTimerIds.clear();
|
|
2079
2072
|
for (const event_0 of AUDIO_SYNC_EVENTS) {
|
|
2080
2073
|
video.removeEventListener(event_0, onSync);
|
|
2081
2074
|
}
|
|
2082
2075
|
video.removeEventListener("seeked", onSeeked2);
|
|
2083
|
-
|
|
2076
|
+
pauseQuietly2(video, audio);
|
|
2084
2077
|
};
|
|
2085
2078
|
};
|
|
2086
2079
|
$[0] = audioRef;
|
|
@@ -2164,27 +2157,232 @@ function useYouTubeVideoSync(t0) {
|
|
|
2164
2157
|
}
|
|
2165
2158
|
useEffect(t5, t6);
|
|
2166
2159
|
}
|
|
2167
|
-
function
|
|
2160
|
+
function _temp2(timerId) {
|
|
2168
2161
|
return window.clearTimeout(timerId);
|
|
2169
2162
|
}
|
|
2170
2163
|
|
|
2171
|
-
// src/modules/background/youtube/
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2164
|
+
// src/modules/background/youtube/video-events.ts
|
|
2165
|
+
var HAVE_CURRENT_DATA = 2;
|
|
2166
|
+
var ERROR_RESUME_RETRY_DELAY_MS = 150;
|
|
2167
|
+
var LOAD_RETRY_DELAY_MS = 200;
|
|
2168
|
+
var AUDIO_RETRY_DELAY_MS = 200;
|
|
2169
|
+
var MAX_VIDEO_LOAD_RETRIES = 1;
|
|
2170
|
+
var MAX_AUDIO_LOAD_RETRIES = 1;
|
|
2171
|
+
function playWithMutedFallback({
|
|
2172
|
+
forceSeek,
|
|
2173
|
+
live,
|
|
2174
|
+
setVideoPlaying,
|
|
2175
|
+
syncCompanionAudio,
|
|
2176
|
+
unlockAudio,
|
|
2177
|
+
video,
|
|
2178
|
+
videoRef
|
|
2179
|
+
}) {
|
|
2180
|
+
const onPlayed = () => {
|
|
2181
|
+
setVideoPlaying(true);
|
|
2182
|
+
syncCompanionAudio(forceSeek);
|
|
2183
|
+
};
|
|
2184
|
+
video.play().then(onPlayed).catch((error) => {
|
|
2185
|
+
if (error?.name !== "NotAllowedError") return;
|
|
2186
|
+
video.muted = true;
|
|
2187
|
+
video.play().then(() => {
|
|
2188
|
+
onPlayed();
|
|
2189
|
+
if (!unlockAudio) return;
|
|
2190
|
+
unlockAudioOnGesture(() => {
|
|
2191
|
+
const current = videoRef.current;
|
|
2192
|
+
if (!live.current.isMuted && current) {
|
|
2193
|
+
setElementMuted(current, false);
|
|
2194
|
+
}
|
|
2195
|
+
});
|
|
2196
|
+
}).catch(() => {
|
|
2197
|
+
});
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
function endVideoPlayback(ctx) {
|
|
2201
|
+
const {
|
|
2202
|
+
audioRef,
|
|
2203
|
+
live,
|
|
2204
|
+
setVideoPlaying,
|
|
2205
|
+
syncCompanionAudio,
|
|
2206
|
+
videoRef
|
|
2207
|
+
} = ctx;
|
|
2208
|
+
const video = videoRef.current;
|
|
2209
|
+
const audio = audioRef.current;
|
|
2210
|
+
if (!video) return;
|
|
2211
|
+
if (video.loop || live.current.isLoop) {
|
|
2212
|
+
const resetTime = Math.max(0, live.current.startTime || 0);
|
|
2213
|
+
video.currentTime = resetTime;
|
|
2214
|
+
if (audio && audio.readyState >= HAVE_CURRENT_DATA) {
|
|
2215
|
+
audio.currentTime = resetTime;
|
|
2216
|
+
}
|
|
2217
|
+
video.play().then(() => {
|
|
2218
|
+
setVideoPlaying(true);
|
|
2219
|
+
syncCompanionAudio(true);
|
|
2220
|
+
}).catch(() => {
|
|
2221
|
+
});
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
video.pause();
|
|
2225
|
+
if (audio && !audio.paused) audio.pause();
|
|
2226
|
+
setVideoPlaying(false);
|
|
2227
|
+
}
|
|
2228
|
+
function handleCompanionAudioError(ctx) {
|
|
2229
|
+
const {
|
|
2230
|
+
audioRef,
|
|
2231
|
+
live,
|
|
2232
|
+
scheduleRetry,
|
|
2233
|
+
setUseIframeFallback,
|
|
2234
|
+
videoRef
|
|
2235
|
+
} = ctx;
|
|
2236
|
+
const audio = audioRef.current;
|
|
2237
|
+
if (!audio) return;
|
|
2238
|
+
ctx.audioErrorRetryCountRef.current += 1;
|
|
2239
|
+
if (ctx.audioErrorRetryCountRef.current <= MAX_AUDIO_LOAD_RETRIES) {
|
|
2240
|
+
scheduleRetry(() => {
|
|
2241
|
+
audio.load();
|
|
2242
|
+
if (videoRef.current) {
|
|
2243
|
+
audio.currentTime = videoRef.current.currentTime || 0;
|
|
2244
|
+
}
|
|
2245
|
+
}, AUDIO_RETRY_DELAY_MS);
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
if (!live.current.isMuted) {
|
|
2249
|
+
setUseIframeFallback(true);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
function onTimeUpdate(ctx) {
|
|
2253
|
+
const video = ctx.videoRef.current;
|
|
2254
|
+
if (!video) return;
|
|
2255
|
+
if (video.currentTime > 0 && video.readyState >= HAVE_CURRENT_DATA) {
|
|
2256
|
+
ctx.setIsFrameReady(true);
|
|
2257
|
+
ctx.setIsBuffering(false);
|
|
2258
|
+
}
|
|
2259
|
+
const duration = Number(video.duration) || 0;
|
|
2260
|
+
const {
|
|
2261
|
+
corp,
|
|
2262
|
+
endTime
|
|
2263
|
+
} = ctx.live.current;
|
|
2264
|
+
if (hasPassedEnd(video.currentTime, endTime, corp, duration)) {
|
|
2265
|
+
ctx.handleEnded();
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
function onPlay(ctx) {
|
|
2269
|
+
const video = ctx.videoRef.current;
|
|
2270
|
+
ctx.hasLoadedVideoRef.current = true;
|
|
2271
|
+
if (video && !ctx.live.current.isMuted && video.muted) {
|
|
2272
|
+
setElementMuted(video, false);
|
|
2273
|
+
}
|
|
2274
|
+
if (!video || video.readyState < HAVE_CURRENT_DATA) ctx.setIsBuffering(true);
|
|
2275
|
+
ctx.setVideoPlaying(true);
|
|
2276
|
+
ctx.syncCompanionAudio(false);
|
|
2277
|
+
}
|
|
2278
|
+
function onPlaying(ctx) {
|
|
2279
|
+
ctx.hasLoadedVideoRef.current = true;
|
|
2280
|
+
ctx.setIsFrameReady(true);
|
|
2281
|
+
ctx.setIsBuffering(false);
|
|
2282
|
+
ctx.setVideoPlaying(true);
|
|
2283
|
+
ctx.syncCompanionAudio(false);
|
|
2284
|
+
}
|
|
2285
|
+
function onPause(ctx) {
|
|
2286
|
+
const video = ctx.videoRef.current;
|
|
2287
|
+
ctx.syncCompanionAudio(false);
|
|
2288
|
+
ctx.setIsBuffering(false);
|
|
2289
|
+
if (video && !video.seeking && !video.ended && !ctx.live.current.isPlaying) {
|
|
2290
|
+
ctx.setVideoPlaying(false);
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
function onSeeked(ctx) {
|
|
2294
|
+
const video = ctx.videoRef.current;
|
|
2295
|
+
if (!video) return;
|
|
2296
|
+
const {
|
|
2297
|
+
isPlaying
|
|
2298
|
+
} = ctx.live.current;
|
|
2299
|
+
ctx.setIsFrameReady(true);
|
|
2300
|
+
if (video.readyState >= HAVE_CURRENT_DATA && (!isPlaying || !video.paused)) {
|
|
2301
|
+
ctx.setIsBuffering(false);
|
|
2302
|
+
}
|
|
2303
|
+
ctx.syncCompanionAudio(true);
|
|
2304
|
+
if (isPlaying && video.paused) {
|
|
2305
|
+
video.play().then(() => {
|
|
2306
|
+
ctx.setVideoPlaying(true);
|
|
2307
|
+
ctx.syncCompanionAudio(true);
|
|
2308
|
+
}).catch(() => {
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
function onCanPlay(ctx) {
|
|
2313
|
+
const video = ctx.videoRef.current;
|
|
2314
|
+
if (!video) return;
|
|
2315
|
+
ctx.hasLoadedVideoRef.current = true;
|
|
2316
|
+
if (!ctx.live.current.isPlaying) {
|
|
2317
|
+
ctx.setIsFrameReady(true);
|
|
2318
|
+
ctx.setIsBuffering(false);
|
|
2319
|
+
} else if (video.paused) {
|
|
2320
|
+
setElementMuted(video, Boolean(ctx.live.current.isMuted));
|
|
2321
|
+
ctx.playWithFallback(video, false, true);
|
|
2322
|
+
}
|
|
2323
|
+
}
|
|
2324
|
+
function onLoadedMetadata(ctx) {
|
|
2325
|
+
const video = ctx.videoRef.current;
|
|
2326
|
+
if (!video) return;
|
|
2327
|
+
ctx.hasLoadedVideoRef.current = true;
|
|
2328
|
+
if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
|
|
2329
|
+
video.currentTime = ctx.startTime;
|
|
2330
|
+
if (ctx.audioRef.current) ctx.audioRef.current.currentTime = ctx.startTime;
|
|
2331
|
+
}
|
|
2332
|
+
}
|
|
2333
|
+
function onLoadedData(ctx) {
|
|
2334
|
+
const video = ctx.videoRef.current;
|
|
2335
|
+
if (!video) return;
|
|
2336
|
+
ctx.hasLoadedVideoRef.current = true;
|
|
2337
|
+
video.playbackRate = ctx.playbackRate;
|
|
2338
|
+
setElementMuted(video, Boolean(ctx.live.current.isMuted));
|
|
2339
|
+
if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
|
|
2340
|
+
video.currentTime = ctx.startTime;
|
|
2341
|
+
}
|
|
2342
|
+
if (!ctx.live.current.isPlaying) {
|
|
2343
|
+
ctx.setIsFrameReady(true);
|
|
2344
|
+
ctx.setIsBuffering(false);
|
|
2345
|
+
} else if (video.paused) {
|
|
2346
|
+
ctx.playWithFallback(video, true, false);
|
|
2347
|
+
}
|
|
2348
|
+
}
|
|
2349
|
+
function onError(ctx) {
|
|
2350
|
+
const video = ctx.videoRef.current;
|
|
2351
|
+
if (video && ctx.hasLoadedVideoRef.current) {
|
|
2352
|
+
const resumeTime = video.currentTime || 0;
|
|
2353
|
+
ctx.scheduleRetry(() => {
|
|
2354
|
+
video.load();
|
|
2355
|
+
video.currentTime = resumeTime;
|
|
2356
|
+
if (ctx.live.current.isPlaying) video.play().catch(() => {
|
|
2357
|
+
});
|
|
2358
|
+
}, ERROR_RESUME_RETRY_DELAY_MS);
|
|
2359
|
+
return;
|
|
2360
|
+
}
|
|
2361
|
+
ctx.errorRetryCountRef.current += 1;
|
|
2362
|
+
if (video && ctx.errorRetryCountRef.current <= MAX_VIDEO_LOAD_RETRIES) {
|
|
2363
|
+
ctx.scheduleRetry(() => video.load(), LOAD_RETRY_DELAY_MS);
|
|
2364
|
+
return;
|
|
2365
|
+
}
|
|
2366
|
+
ctx.setUseIframeFallback(true);
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
// src/modules/background/youtube/use-player.ts
|
|
2370
|
+
function useYouTubeBackgroundPlayerModel({
|
|
2371
|
+
codec = "auto",
|
|
2372
|
+
corp = 0,
|
|
2373
|
+
endTime = 0,
|
|
2374
|
+
forceIframe = false,
|
|
2375
|
+
isLoop = false,
|
|
2376
|
+
isMuted = true,
|
|
2377
|
+
isPlaying = true,
|
|
2378
|
+
playbackRate = 1,
|
|
2379
|
+
posterUrl = null,
|
|
2380
|
+
quality = "1080p",
|
|
2381
|
+
setVideoElement,
|
|
2382
|
+
setVideoPlaying,
|
|
2383
|
+
shouldAutoPlay = true,
|
|
2384
|
+
showPoster = false,
|
|
2385
|
+
showSpinner = true,
|
|
2188
2386
|
startTime = 0,
|
|
2189
2387
|
videoClasses: _videoClasses,
|
|
2190
2388
|
videoId,
|
|
@@ -2355,6 +2553,28 @@ function useYouTubeBackgroundPlayerModel({
|
|
|
2355
2553
|
showSpinnerOverlay
|
|
2356
2554
|
};
|
|
2357
2555
|
}
|
|
2556
|
+
function useYouTubeStreamSources({
|
|
2557
|
+
codec,
|
|
2558
|
+
posterUrl,
|
|
2559
|
+
quality,
|
|
2560
|
+
showPoster,
|
|
2561
|
+
videoId
|
|
2562
|
+
}) {
|
|
2563
|
+
const videoStreamUrl = getYouTubeStreamUrl(videoId, {
|
|
2564
|
+
codec,
|
|
2565
|
+
quality,
|
|
2566
|
+
stream: "video"
|
|
2567
|
+
});
|
|
2568
|
+
const audioStreamUrl = getYouTubeStreamUrl(videoId, {
|
|
2569
|
+
stream: "audio"
|
|
2570
|
+
});
|
|
2571
|
+
const resolvedPoster = showPoster ? posterUrl || getYouTubeThumbnailUrl(videoId, true) : null;
|
|
2572
|
+
return {
|
|
2573
|
+
audioStreamUrl,
|
|
2574
|
+
resolvedPoster,
|
|
2575
|
+
videoStreamUrl
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2358
2578
|
function YouTubeBackgroundPlayer(t0) {
|
|
2359
2579
|
const $ = c(75);
|
|
2360
2580
|
const {
|
|
@@ -2550,488 +2770,34 @@ function YouTubeBackgroundPlayer(t0) {
|
|
|
2550
2770
|
$[60] = theme.slots.youtubeHost;
|
|
2551
2771
|
$[61] = theme.slots.youtubeVideo;
|
|
2552
2772
|
$[62] = useIframeFallback;
|
|
2553
|
-
$[63] = videoClasses;
|
|
2554
|
-
$[64] = videoRef;
|
|
2555
|
-
$[65] = videoStreamUrl;
|
|
2556
|
-
$[66] = videoStyle;
|
|
2557
|
-
$[67] = t21;
|
|
2558
|
-
} else {
|
|
2559
|
-
t21 = $[67];
|
|
2560
|
-
}
|
|
2561
|
-
let t22;
|
|
2562
|
-
if ($[68] !== t16 || $[69] !== t18 || $[70] !== t19 || $[71] !== t20 || $[72] !== t21 || $[73] !== theme.slots.youtube) {
|
|
2563
|
-
t22 = /* @__PURE__ */ jsxs("div", { className: theme.slots.youtube, children: [
|
|
2564
|
-
t16,
|
|
2565
|
-
t18,
|
|
2566
|
-
t19,
|
|
2567
|
-
t20,
|
|
2568
|
-
t21
|
|
2569
|
-
] });
|
|
2570
|
-
$[68] = t16;
|
|
2571
|
-
$[69] = t18;
|
|
2572
|
-
$[70] = t19;
|
|
2573
|
-
$[71] = t20;
|
|
2574
|
-
$[72] = t21;
|
|
2575
|
-
$[73] = theme.slots.youtube;
|
|
2576
|
-
$[74] = t22;
|
|
2577
|
-
} else {
|
|
2578
|
-
t22 = $[74];
|
|
2579
|
-
}
|
|
2580
|
-
return t22;
|
|
2581
|
-
}
|
|
2582
|
-
function BackgroundGradients(t0) {
|
|
2583
|
-
const $ = c(11);
|
|
2584
|
-
const {
|
|
2585
|
-
count: t1,
|
|
2586
|
-
direction,
|
|
2587
|
-
color: t2,
|
|
2588
|
-
theme
|
|
2589
|
-
} = t0;
|
|
2590
|
-
const count = t1 === void 0 ? 0 : t1;
|
|
2591
|
-
const color = t2 === void 0 ? DEFAULT_COLOR : t2;
|
|
2592
|
-
if (!count || count <= 0) {
|
|
2593
|
-
return null;
|
|
2594
|
-
}
|
|
2595
|
-
const opacity = Math.min(1, Math.max(0.2, count * 0.25));
|
|
2596
|
-
const t3 = theme.slots.gradient;
|
|
2597
|
-
const t4 = theme.styles.gradient;
|
|
2598
|
-
let t5;
|
|
2599
|
-
if ($[0] !== color || $[1] !== direction) {
|
|
2600
|
-
t5 = generateBaseGradient(direction, color);
|
|
2601
|
-
$[0] = color;
|
|
2602
|
-
$[1] = direction;
|
|
2603
|
-
$[2] = t5;
|
|
2604
|
-
} else {
|
|
2605
|
-
t5 = $[2];
|
|
2606
|
-
}
|
|
2607
|
-
let t6;
|
|
2608
|
-
if ($[3] !== opacity || $[4] !== t5 || $[5] !== theme.styles.gradient) {
|
|
2609
|
-
t6 = {
|
|
2610
|
-
...t4,
|
|
2611
|
-
opacity,
|
|
2612
|
-
background: t5
|
|
2613
|
-
};
|
|
2614
|
-
$[3] = opacity;
|
|
2615
|
-
$[4] = t5;
|
|
2616
|
-
$[5] = theme.styles.gradient;
|
|
2617
|
-
$[6] = t6;
|
|
2618
|
-
} else {
|
|
2619
|
-
t6 = $[6];
|
|
2620
|
-
}
|
|
2621
|
-
let t7;
|
|
2622
|
-
if ($[7] !== direction || $[8] !== t6 || $[9] !== theme.slots.gradient) {
|
|
2623
|
-
t7 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t6 });
|
|
2624
|
-
$[7] = direction;
|
|
2625
|
-
$[8] = t6;
|
|
2626
|
-
$[9] = theme.slots.gradient;
|
|
2627
|
-
$[10] = t7;
|
|
2628
|
-
} else {
|
|
2629
|
-
t7 = $[10];
|
|
2630
|
-
}
|
|
2631
|
-
return t7;
|
|
2632
|
-
}
|
|
2633
|
-
function EdgeGradient(t0) {
|
|
2634
|
-
const $ = c(11);
|
|
2635
|
-
const {
|
|
2636
|
-
direction,
|
|
2637
|
-
percent: t1,
|
|
2638
|
-
opacity: t2,
|
|
2639
|
-
color,
|
|
2640
|
-
theme
|
|
2641
|
-
} = t0;
|
|
2642
|
-
const percent = t1 === void 0 ? 0 : t1;
|
|
2643
|
-
const opacity = t2 === void 0 ? 0 : t2;
|
|
2644
|
-
if (opacity <= 0) {
|
|
2645
|
-
return null;
|
|
2646
|
-
}
|
|
2647
|
-
const t3 = theme.slots.edge;
|
|
2648
|
-
const t4 = `${Math.max(30, percent * 1.15)}%`;
|
|
2649
|
-
const t5 = color || DEFAULT_COLOR;
|
|
2650
|
-
let t6;
|
|
2651
|
-
if ($[0] !== direction || $[1] !== t5) {
|
|
2652
|
-
t6 = generateEdgeGradient(direction, t5);
|
|
2653
|
-
$[0] = direction;
|
|
2654
|
-
$[1] = t5;
|
|
2655
|
-
$[2] = t6;
|
|
2656
|
-
} else {
|
|
2657
|
-
t6 = $[2];
|
|
2658
|
-
}
|
|
2659
|
-
let t7;
|
|
2660
|
-
if ($[3] !== opacity || $[4] !== t4 || $[5] !== t6) {
|
|
2661
|
-
t7 = {
|
|
2662
|
-
width: t4,
|
|
2663
|
-
opacity,
|
|
2664
|
-
background: t6
|
|
2665
|
-
};
|
|
2666
|
-
$[3] = opacity;
|
|
2667
|
-
$[4] = t4;
|
|
2668
|
-
$[5] = t6;
|
|
2669
|
-
$[6] = t7;
|
|
2670
|
-
} else {
|
|
2671
|
-
t7 = $[6];
|
|
2672
|
-
}
|
|
2673
|
-
let t8;
|
|
2674
|
-
if ($[7] !== direction || $[8] !== t7 || $[9] !== theme.slots.edge) {
|
|
2675
|
-
t8 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t7 });
|
|
2676
|
-
$[7] = direction;
|
|
2677
|
-
$[8] = t7;
|
|
2678
|
-
$[9] = theme.slots.edge;
|
|
2679
|
-
$[10] = t8;
|
|
2680
|
-
} else {
|
|
2681
|
-
t8 = $[10];
|
|
2682
|
-
}
|
|
2683
|
-
return t8;
|
|
2684
|
-
}
|
|
2685
|
-
function pauseQuietly2(video) {
|
|
2686
|
-
try {
|
|
2687
|
-
video?.pause();
|
|
2688
|
-
} catch {
|
|
2689
|
-
}
|
|
2690
|
-
}
|
|
2691
|
-
function useNativeVideoModel(t0) {
|
|
2692
|
-
const $ = c(27);
|
|
2693
|
-
const {
|
|
2694
|
-
corp,
|
|
2695
|
-
isMuted,
|
|
2696
|
-
isPlaying,
|
|
2697
|
-
playbackRate,
|
|
2698
|
-
setVideoElement,
|
|
2699
|
-
setVideoPlaying,
|
|
2700
|
-
shouldAutoPlay,
|
|
2701
|
-
src
|
|
2702
|
-
} = t0;
|
|
2703
|
-
const videoRef = useRef(null);
|
|
2704
|
-
let t1;
|
|
2705
|
-
if ($[0] !== setVideoPlaying) {
|
|
2706
|
-
t1 = () => {
|
|
2707
|
-
const video = videoRef.current;
|
|
2708
|
-
if (!video) {
|
|
2709
|
-
return;
|
|
2710
|
-
}
|
|
2711
|
-
if (video.loop) {
|
|
2712
|
-
video.currentTime = 0;
|
|
2713
|
-
video.play().catch(_temp2);
|
|
2714
|
-
return;
|
|
2715
|
-
}
|
|
2716
|
-
video.pause();
|
|
2717
|
-
setVideoPlaying(false);
|
|
2718
|
-
};
|
|
2719
|
-
$[0] = setVideoPlaying;
|
|
2720
|
-
$[1] = t1;
|
|
2721
|
-
} else {
|
|
2722
|
-
t1 = $[1];
|
|
2723
|
-
}
|
|
2724
|
-
const handleEnded = t1;
|
|
2725
|
-
let t2;
|
|
2726
|
-
if ($[2] !== corp || $[3] !== handleEnded) {
|
|
2727
|
-
t2 = () => {
|
|
2728
|
-
const video_0 = videoRef.current;
|
|
2729
|
-
if (video_0 && isWithinCorp(video_0.currentTime, video_0.duration, corp)) {
|
|
2730
|
-
handleEnded();
|
|
2731
|
-
}
|
|
2732
|
-
};
|
|
2733
|
-
$[2] = corp;
|
|
2734
|
-
$[3] = handleEnded;
|
|
2735
|
-
$[4] = t2;
|
|
2736
|
-
} else {
|
|
2737
|
-
t2 = $[4];
|
|
2738
|
-
}
|
|
2739
|
-
const handleTimeUpdate = t2;
|
|
2740
|
-
let t3;
|
|
2741
|
-
if ($[5] !== isMuted || $[6] !== playbackRate || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay) {
|
|
2742
|
-
t3 = () => {
|
|
2743
|
-
const video_1 = videoRef.current;
|
|
2744
|
-
if (!video_1) {
|
|
2745
|
-
return;
|
|
2746
|
-
}
|
|
2747
|
-
video_1.playbackRate = playbackRate;
|
|
2748
|
-
if (!shouldAutoPlay) {
|
|
2749
|
-
return;
|
|
2750
|
-
}
|
|
2751
|
-
if (isMuted) {
|
|
2752
|
-
video_1.muted = true;
|
|
2753
|
-
}
|
|
2754
|
-
video_1.play().then(() => setVideoPlaying(true)).catch((error_0) => {
|
|
2755
|
-
report("Background autoplay", error_0, "warn");
|
|
2756
|
-
setVideoPlaying(false);
|
|
2757
|
-
});
|
|
2758
|
-
};
|
|
2759
|
-
$[5] = isMuted;
|
|
2760
|
-
$[6] = playbackRate;
|
|
2761
|
-
$[7] = setVideoPlaying;
|
|
2762
|
-
$[8] = shouldAutoPlay;
|
|
2763
|
-
$[9] = t3;
|
|
2764
|
-
} else {
|
|
2765
|
-
t3 = $[9];
|
|
2766
|
-
}
|
|
2767
|
-
const handleLoadedData = t3;
|
|
2768
|
-
let t4;
|
|
2769
|
-
if ($[10] !== setVideoElement) {
|
|
2770
|
-
t4 = () => {
|
|
2771
|
-
const video_2 = videoRef.current;
|
|
2772
|
-
setVideoElement(video_2);
|
|
2773
|
-
return () => {
|
|
2774
|
-
pauseQuietly2(video_2);
|
|
2775
|
-
};
|
|
2776
|
-
};
|
|
2777
|
-
$[10] = setVideoElement;
|
|
2778
|
-
$[11] = t4;
|
|
2779
|
-
} else {
|
|
2780
|
-
t4 = $[11];
|
|
2781
|
-
}
|
|
2782
|
-
let t5;
|
|
2783
|
-
if ($[12] !== setVideoElement || $[13] !== src) {
|
|
2784
|
-
t5 = [src, setVideoElement];
|
|
2785
|
-
$[12] = setVideoElement;
|
|
2786
|
-
$[13] = src;
|
|
2787
|
-
$[14] = t5;
|
|
2788
|
-
} else {
|
|
2789
|
-
t5 = $[14];
|
|
2790
|
-
}
|
|
2791
|
-
useEffect(t4, t5);
|
|
2792
|
-
let t6;
|
|
2793
|
-
let t7;
|
|
2794
|
-
if ($[15] !== setVideoElement) {
|
|
2795
|
-
t6 = () => () => setVideoElement(null);
|
|
2796
|
-
t7 = [setVideoElement];
|
|
2797
|
-
$[15] = setVideoElement;
|
|
2798
|
-
$[16] = t6;
|
|
2799
|
-
$[17] = t7;
|
|
2800
|
-
} else {
|
|
2801
|
-
t6 = $[16];
|
|
2802
|
-
t7 = $[17];
|
|
2803
|
-
}
|
|
2804
|
-
useEffect(t6, t7);
|
|
2805
|
-
let t8;
|
|
2806
|
-
let t9;
|
|
2807
|
-
if ($[18] !== isPlaying || $[19] !== playbackRate || $[20] !== setVideoPlaying) {
|
|
2808
|
-
t8 = () => {
|
|
2809
|
-
applyVideoPlaybackState({
|
|
2810
|
-
isPlaying,
|
|
2811
|
-
playbackRate,
|
|
2812
|
-
setVideoPlaying,
|
|
2813
|
-
videoElement: videoRef.current
|
|
2814
|
-
});
|
|
2815
|
-
};
|
|
2816
|
-
t9 = [isPlaying, playbackRate, setVideoPlaying];
|
|
2817
|
-
$[18] = isPlaying;
|
|
2818
|
-
$[19] = playbackRate;
|
|
2819
|
-
$[20] = setVideoPlaying;
|
|
2820
|
-
$[21] = t8;
|
|
2821
|
-
$[22] = t9;
|
|
2822
|
-
} else {
|
|
2823
|
-
t8 = $[21];
|
|
2824
|
-
t9 = $[22];
|
|
2825
|
-
}
|
|
2826
|
-
useEffect(t8, t9);
|
|
2827
|
-
let t10;
|
|
2828
|
-
if ($[23] !== handleEnded || $[24] !== handleLoadedData || $[25] !== handleTimeUpdate) {
|
|
2829
|
-
t10 = {
|
|
2830
|
-
videoRef,
|
|
2831
|
-
handleEnded,
|
|
2832
|
-
handleTimeUpdate,
|
|
2833
|
-
handleLoadedData
|
|
2834
|
-
};
|
|
2835
|
-
$[23] = handleEnded;
|
|
2836
|
-
$[24] = handleLoadedData;
|
|
2837
|
-
$[25] = handleTimeUpdate;
|
|
2838
|
-
$[26] = t10;
|
|
2839
|
-
} else {
|
|
2840
|
-
t10 = $[26];
|
|
2841
|
-
}
|
|
2842
|
-
return t10;
|
|
2843
|
-
}
|
|
2844
|
-
function _temp2(error) {
|
|
2845
|
-
return report("Background loop play", error, "warn");
|
|
2846
|
-
}
|
|
2847
|
-
function NativeVideo(t0) {
|
|
2848
|
-
const $ = c(22);
|
|
2849
|
-
const {
|
|
2850
|
-
corp,
|
|
2851
|
-
isLoop,
|
|
2852
|
-
isMuted,
|
|
2853
|
-
isPlaying,
|
|
2854
|
-
playbackRate,
|
|
2855
|
-
setVideoElement,
|
|
2856
|
-
setVideoPlaying,
|
|
2857
|
-
shouldAutoPlay,
|
|
2858
|
-
src,
|
|
2859
|
-
style,
|
|
2860
|
-
className
|
|
2861
|
-
} = t0;
|
|
2862
|
-
let t1;
|
|
2863
|
-
if ($[0] !== className || $[1] !== corp || $[2] !== isLoop || $[3] !== isMuted || $[4] !== isPlaying || $[5] !== playbackRate || $[6] !== setVideoElement || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay || $[9] !== src || $[10] !== style) {
|
|
2864
|
-
t1 = {
|
|
2865
|
-
corp,
|
|
2866
|
-
isLoop,
|
|
2867
|
-
isMuted,
|
|
2868
|
-
isPlaying,
|
|
2869
|
-
playbackRate,
|
|
2870
|
-
setVideoElement,
|
|
2871
|
-
setVideoPlaying,
|
|
2872
|
-
shouldAutoPlay,
|
|
2873
|
-
src,
|
|
2874
|
-
style,
|
|
2875
|
-
className
|
|
2876
|
-
};
|
|
2877
|
-
$[0] = className;
|
|
2878
|
-
$[1] = corp;
|
|
2879
|
-
$[2] = isLoop;
|
|
2880
|
-
$[3] = isMuted;
|
|
2881
|
-
$[4] = isPlaying;
|
|
2882
|
-
$[5] = playbackRate;
|
|
2883
|
-
$[6] = setVideoElement;
|
|
2884
|
-
$[7] = setVideoPlaying;
|
|
2885
|
-
$[8] = shouldAutoPlay;
|
|
2886
|
-
$[9] = src;
|
|
2887
|
-
$[10] = style;
|
|
2888
|
-
$[11] = t1;
|
|
2889
|
-
} else {
|
|
2890
|
-
t1 = $[11];
|
|
2891
|
-
}
|
|
2892
|
-
const {
|
|
2893
|
-
videoRef,
|
|
2894
|
-
handleEnded,
|
|
2895
|
-
handleTimeUpdate,
|
|
2896
|
-
handleLoadedData
|
|
2897
|
-
} = useNativeVideoModel(t1);
|
|
2898
|
-
let t2;
|
|
2899
|
-
if ($[12] !== className || $[13] !== handleEnded || $[14] !== handleLoadedData || $[15] !== handleTimeUpdate || $[16] !== isLoop || $[17] !== isMuted || $[18] !== src || $[19] !== style || $[20] !== videoRef) {
|
|
2900
|
-
t2 = /* @__PURE__ */ jsx("video", { ref: videoRef, src, className, preload: "auto", muted: isMuted, loop: isLoop, playsInline: true, style, onTimeUpdate: handleTimeUpdate, onEnded: handleEnded, onLoadedData: handleLoadedData });
|
|
2901
|
-
$[12] = className;
|
|
2902
|
-
$[13] = handleEnded;
|
|
2903
|
-
$[14] = handleLoadedData;
|
|
2904
|
-
$[15] = handleTimeUpdate;
|
|
2905
|
-
$[16] = isLoop;
|
|
2906
|
-
$[17] = isMuted;
|
|
2907
|
-
$[18] = src;
|
|
2908
|
-
$[19] = style;
|
|
2909
|
-
$[20] = videoRef;
|
|
2910
|
-
$[21] = t2;
|
|
2911
|
-
} else {
|
|
2912
|
-
t2 = $[21];
|
|
2913
|
-
}
|
|
2914
|
-
return t2;
|
|
2915
|
-
}
|
|
2916
|
-
function NoiseOverlay(t0) {
|
|
2917
|
-
const $ = c(16);
|
|
2918
|
-
const {
|
|
2919
|
-
opacity,
|
|
2920
|
-
blendMode,
|
|
2921
|
-
inlineStyle,
|
|
2922
|
-
maskImage,
|
|
2923
|
-
isFixed,
|
|
2924
|
-
theme
|
|
2925
|
-
} = t0;
|
|
2926
|
-
const t1 = isFixed ? "fixed" : "absolute";
|
|
2927
|
-
let t2;
|
|
2928
|
-
if ($[0] !== opacity) {
|
|
2929
|
-
t2 = typeof opacity === "number" ? {
|
|
2930
|
-
opacity
|
|
2931
|
-
} : {};
|
|
2932
|
-
$[0] = opacity;
|
|
2933
|
-
$[1] = t2;
|
|
2934
|
-
} else {
|
|
2935
|
-
t2 = $[1];
|
|
2936
|
-
}
|
|
2937
|
-
let t3;
|
|
2938
|
-
if ($[2] !== blendMode) {
|
|
2939
|
-
t3 = typeof blendMode === "string" && blendMode.trim() ? {
|
|
2940
|
-
mixBlendMode: blendMode
|
|
2941
|
-
} : {};
|
|
2942
|
-
$[2] = blendMode;
|
|
2943
|
-
$[3] = t3;
|
|
2944
|
-
} else {
|
|
2945
|
-
t3 = $[3];
|
|
2946
|
-
}
|
|
2947
|
-
let t4;
|
|
2948
|
-
if ($[4] !== maskImage) {
|
|
2949
|
-
t4 = maskImage ? {
|
|
2950
|
-
maskImage,
|
|
2951
|
-
WebkitMaskImage: maskImage
|
|
2952
|
-
} : {};
|
|
2953
|
-
$[4] = maskImage;
|
|
2954
|
-
$[5] = t4;
|
|
2955
|
-
} else {
|
|
2956
|
-
t4 = $[5];
|
|
2957
|
-
}
|
|
2958
|
-
let t5;
|
|
2959
|
-
if ($[6] !== inlineStyle || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== theme.styles.noise) {
|
|
2960
|
-
t5 = {
|
|
2961
|
-
...theme.styles.noise,
|
|
2962
|
-
...t2,
|
|
2963
|
-
...t3,
|
|
2964
|
-
...t4,
|
|
2965
|
-
...inlineStyle
|
|
2966
|
-
};
|
|
2967
|
-
$[6] = inlineStyle;
|
|
2968
|
-
$[7] = t2;
|
|
2969
|
-
$[8] = t3;
|
|
2970
|
-
$[9] = t4;
|
|
2971
|
-
$[10] = theme.styles.noise;
|
|
2972
|
-
$[11] = t5;
|
|
2973
|
-
} else {
|
|
2974
|
-
t5 = $[11];
|
|
2975
|
-
}
|
|
2976
|
-
let t6;
|
|
2977
|
-
if ($[12] !== t1 || $[13] !== t5 || $[14] !== theme.slots.noise) {
|
|
2978
|
-
t6 = /* @__PURE__ */ jsx("div", { "data-position": t1, className: theme.slots.noise, style: t5 });
|
|
2979
|
-
$[12] = t1;
|
|
2980
|
-
$[13] = t5;
|
|
2981
|
-
$[14] = theme.slots.noise;
|
|
2982
|
-
$[15] = t6;
|
|
2983
|
-
} else {
|
|
2984
|
-
t6 = $[15];
|
|
2985
|
-
}
|
|
2986
|
-
return t6;
|
|
2987
|
-
}
|
|
2988
|
-
function SolidOverlay(t0) {
|
|
2989
|
-
const $ = c(10);
|
|
2990
|
-
const {
|
|
2991
|
-
opacity: t1,
|
|
2992
|
-
color,
|
|
2993
|
-
transitionStyle,
|
|
2994
|
-
maskImage,
|
|
2995
|
-
theme
|
|
2996
|
-
} = t0;
|
|
2997
|
-
const opacity = t1 === void 0 ? 0 : t1;
|
|
2998
|
-
let t2;
|
|
2999
|
-
if ($[0] !== maskImage) {
|
|
3000
|
-
t2 = maskImage ? {
|
|
3001
|
-
maskImage,
|
|
3002
|
-
WebkitMaskImage: maskImage
|
|
3003
|
-
} : {};
|
|
3004
|
-
$[0] = maskImage;
|
|
3005
|
-
$[1] = t2;
|
|
3006
|
-
} else {
|
|
3007
|
-
t2 = $[1];
|
|
3008
|
-
}
|
|
3009
|
-
let t3;
|
|
3010
|
-
if ($[2] !== color || $[3] !== opacity || $[4] !== t2 || $[5] !== transitionStyle) {
|
|
3011
|
-
t3 = {
|
|
3012
|
-
opacity,
|
|
3013
|
-
backgroundColor: color,
|
|
3014
|
-
...t2,
|
|
3015
|
-
...transitionStyle
|
|
3016
|
-
};
|
|
3017
|
-
$[2] = color;
|
|
3018
|
-
$[3] = opacity;
|
|
3019
|
-
$[4] = t2;
|
|
3020
|
-
$[5] = transitionStyle;
|
|
3021
|
-
$[6] = t3;
|
|
2773
|
+
$[63] = videoClasses;
|
|
2774
|
+
$[64] = videoRef;
|
|
2775
|
+
$[65] = videoStreamUrl;
|
|
2776
|
+
$[66] = videoStyle;
|
|
2777
|
+
$[67] = t21;
|
|
3022
2778
|
} else {
|
|
3023
|
-
|
|
2779
|
+
t21 = $[67];
|
|
3024
2780
|
}
|
|
3025
|
-
let
|
|
3026
|
-
if ($[
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
2781
|
+
let t22;
|
|
2782
|
+
if ($[68] !== t16 || $[69] !== t18 || $[70] !== t19 || $[71] !== t20 || $[72] !== t21 || $[73] !== theme.slots.youtube) {
|
|
2783
|
+
t22 = /* @__PURE__ */ jsxs("div", { className: theme.slots.youtube, children: [
|
|
2784
|
+
t16,
|
|
2785
|
+
t18,
|
|
2786
|
+
t19,
|
|
2787
|
+
t20,
|
|
2788
|
+
t21
|
|
2789
|
+
] });
|
|
2790
|
+
$[68] = t16;
|
|
2791
|
+
$[69] = t18;
|
|
2792
|
+
$[70] = t19;
|
|
2793
|
+
$[71] = t20;
|
|
2794
|
+
$[72] = t21;
|
|
2795
|
+
$[73] = theme.slots.youtube;
|
|
2796
|
+
$[74] = t22;
|
|
3031
2797
|
} else {
|
|
3032
|
-
|
|
2798
|
+
t22 = $[74];
|
|
3033
2799
|
}
|
|
3034
|
-
return
|
|
2800
|
+
return t22;
|
|
3035
2801
|
}
|
|
3036
2802
|
function VideoSource(t0) {
|
|
3037
2803
|
const $ = c(33);
|
|
@@ -3403,6 +3169,229 @@ function BackgroundOverlay() {
|
|
|
3403
3169
|
}
|
|
3404
3170
|
return t1;
|
|
3405
3171
|
}
|
|
3172
|
+
function BackgroundGradients(t0) {
|
|
3173
|
+
const $ = c(11);
|
|
3174
|
+
const {
|
|
3175
|
+
count: t1,
|
|
3176
|
+
direction,
|
|
3177
|
+
color: t2,
|
|
3178
|
+
theme
|
|
3179
|
+
} = t0;
|
|
3180
|
+
const count = t1 === void 0 ? 0 : t1;
|
|
3181
|
+
const color = t2 === void 0 ? DEFAULT_COLOR : t2;
|
|
3182
|
+
if (!count || count <= 0) {
|
|
3183
|
+
return null;
|
|
3184
|
+
}
|
|
3185
|
+
const opacity = Math.min(1, Math.max(0.2, count * 0.25));
|
|
3186
|
+
const t3 = theme.slots.gradient;
|
|
3187
|
+
const t4 = theme.styles.gradient;
|
|
3188
|
+
let t5;
|
|
3189
|
+
if ($[0] !== color || $[1] !== direction) {
|
|
3190
|
+
t5 = generateBaseGradient(direction, color);
|
|
3191
|
+
$[0] = color;
|
|
3192
|
+
$[1] = direction;
|
|
3193
|
+
$[2] = t5;
|
|
3194
|
+
} else {
|
|
3195
|
+
t5 = $[2];
|
|
3196
|
+
}
|
|
3197
|
+
let t6;
|
|
3198
|
+
if ($[3] !== opacity || $[4] !== t5 || $[5] !== theme.styles.gradient) {
|
|
3199
|
+
t6 = {
|
|
3200
|
+
...t4,
|
|
3201
|
+
opacity,
|
|
3202
|
+
background: t5
|
|
3203
|
+
};
|
|
3204
|
+
$[3] = opacity;
|
|
3205
|
+
$[4] = t5;
|
|
3206
|
+
$[5] = theme.styles.gradient;
|
|
3207
|
+
$[6] = t6;
|
|
3208
|
+
} else {
|
|
3209
|
+
t6 = $[6];
|
|
3210
|
+
}
|
|
3211
|
+
let t7;
|
|
3212
|
+
if ($[7] !== direction || $[8] !== t6 || $[9] !== theme.slots.gradient) {
|
|
3213
|
+
t7 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t6 });
|
|
3214
|
+
$[7] = direction;
|
|
3215
|
+
$[8] = t6;
|
|
3216
|
+
$[9] = theme.slots.gradient;
|
|
3217
|
+
$[10] = t7;
|
|
3218
|
+
} else {
|
|
3219
|
+
t7 = $[10];
|
|
3220
|
+
}
|
|
3221
|
+
return t7;
|
|
3222
|
+
}
|
|
3223
|
+
function EdgeGradient(t0) {
|
|
3224
|
+
const $ = c(11);
|
|
3225
|
+
const {
|
|
3226
|
+
direction,
|
|
3227
|
+
percent: t1,
|
|
3228
|
+
opacity: t2,
|
|
3229
|
+
color,
|
|
3230
|
+
theme
|
|
3231
|
+
} = t0;
|
|
3232
|
+
const percent = t1 === void 0 ? 0 : t1;
|
|
3233
|
+
const opacity = t2 === void 0 ? 0 : t2;
|
|
3234
|
+
if (opacity <= 0) {
|
|
3235
|
+
return null;
|
|
3236
|
+
}
|
|
3237
|
+
const t3 = theme.slots.edge;
|
|
3238
|
+
const t4 = `${Math.max(30, percent * 1.15)}%`;
|
|
3239
|
+
const t5 = color || DEFAULT_COLOR;
|
|
3240
|
+
let t6;
|
|
3241
|
+
if ($[0] !== direction || $[1] !== t5) {
|
|
3242
|
+
t6 = generateEdgeGradient(direction, t5);
|
|
3243
|
+
$[0] = direction;
|
|
3244
|
+
$[1] = t5;
|
|
3245
|
+
$[2] = t6;
|
|
3246
|
+
} else {
|
|
3247
|
+
t6 = $[2];
|
|
3248
|
+
}
|
|
3249
|
+
let t7;
|
|
3250
|
+
if ($[3] !== opacity || $[4] !== t4 || $[5] !== t6) {
|
|
3251
|
+
t7 = {
|
|
3252
|
+
width: t4,
|
|
3253
|
+
opacity,
|
|
3254
|
+
background: t6
|
|
3255
|
+
};
|
|
3256
|
+
$[3] = opacity;
|
|
3257
|
+
$[4] = t4;
|
|
3258
|
+
$[5] = t6;
|
|
3259
|
+
$[6] = t7;
|
|
3260
|
+
} else {
|
|
3261
|
+
t7 = $[6];
|
|
3262
|
+
}
|
|
3263
|
+
let t8;
|
|
3264
|
+
if ($[7] !== direction || $[8] !== t7 || $[9] !== theme.slots.edge) {
|
|
3265
|
+
t8 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t7 });
|
|
3266
|
+
$[7] = direction;
|
|
3267
|
+
$[8] = t7;
|
|
3268
|
+
$[9] = theme.slots.edge;
|
|
3269
|
+
$[10] = t8;
|
|
3270
|
+
} else {
|
|
3271
|
+
t8 = $[10];
|
|
3272
|
+
}
|
|
3273
|
+
return t8;
|
|
3274
|
+
}
|
|
3275
|
+
function NoiseOverlay(t0) {
|
|
3276
|
+
const $ = c(16);
|
|
3277
|
+
const {
|
|
3278
|
+
opacity,
|
|
3279
|
+
blendMode,
|
|
3280
|
+
inlineStyle,
|
|
3281
|
+
maskImage,
|
|
3282
|
+
isFixed,
|
|
3283
|
+
theme
|
|
3284
|
+
} = t0;
|
|
3285
|
+
const t1 = isFixed ? "fixed" : "absolute";
|
|
3286
|
+
let t2;
|
|
3287
|
+
if ($[0] !== opacity) {
|
|
3288
|
+
t2 = typeof opacity === "number" ? {
|
|
3289
|
+
opacity
|
|
3290
|
+
} : {};
|
|
3291
|
+
$[0] = opacity;
|
|
3292
|
+
$[1] = t2;
|
|
3293
|
+
} else {
|
|
3294
|
+
t2 = $[1];
|
|
3295
|
+
}
|
|
3296
|
+
let t3;
|
|
3297
|
+
if ($[2] !== blendMode) {
|
|
3298
|
+
t3 = typeof blendMode === "string" && blendMode.trim() ? {
|
|
3299
|
+
mixBlendMode: blendMode
|
|
3300
|
+
} : {};
|
|
3301
|
+
$[2] = blendMode;
|
|
3302
|
+
$[3] = t3;
|
|
3303
|
+
} else {
|
|
3304
|
+
t3 = $[3];
|
|
3305
|
+
}
|
|
3306
|
+
let t4;
|
|
3307
|
+
if ($[4] !== maskImage) {
|
|
3308
|
+
t4 = maskImage ? {
|
|
3309
|
+
maskImage,
|
|
3310
|
+
WebkitMaskImage: maskImage
|
|
3311
|
+
} : {};
|
|
3312
|
+
$[4] = maskImage;
|
|
3313
|
+
$[5] = t4;
|
|
3314
|
+
} else {
|
|
3315
|
+
t4 = $[5];
|
|
3316
|
+
}
|
|
3317
|
+
let t5;
|
|
3318
|
+
if ($[6] !== inlineStyle || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== theme.styles.noise) {
|
|
3319
|
+
t5 = {
|
|
3320
|
+
...theme.styles.noise,
|
|
3321
|
+
...t2,
|
|
3322
|
+
...t3,
|
|
3323
|
+
...t4,
|
|
3324
|
+
...inlineStyle
|
|
3325
|
+
};
|
|
3326
|
+
$[6] = inlineStyle;
|
|
3327
|
+
$[7] = t2;
|
|
3328
|
+
$[8] = t3;
|
|
3329
|
+
$[9] = t4;
|
|
3330
|
+
$[10] = theme.styles.noise;
|
|
3331
|
+
$[11] = t5;
|
|
3332
|
+
} else {
|
|
3333
|
+
t5 = $[11];
|
|
3334
|
+
}
|
|
3335
|
+
let t6;
|
|
3336
|
+
if ($[12] !== t1 || $[13] !== t5 || $[14] !== theme.slots.noise) {
|
|
3337
|
+
t6 = /* @__PURE__ */ jsx("div", { "data-position": t1, className: theme.slots.noise, style: t5 });
|
|
3338
|
+
$[12] = t1;
|
|
3339
|
+
$[13] = t5;
|
|
3340
|
+
$[14] = theme.slots.noise;
|
|
3341
|
+
$[15] = t6;
|
|
3342
|
+
} else {
|
|
3343
|
+
t6 = $[15];
|
|
3344
|
+
}
|
|
3345
|
+
return t6;
|
|
3346
|
+
}
|
|
3347
|
+
function SolidOverlay(t0) {
|
|
3348
|
+
const $ = c(10);
|
|
3349
|
+
const {
|
|
3350
|
+
opacity: t1,
|
|
3351
|
+
color,
|
|
3352
|
+
transitionStyle,
|
|
3353
|
+
maskImage,
|
|
3354
|
+
theme
|
|
3355
|
+
} = t0;
|
|
3356
|
+
const opacity = t1 === void 0 ? 0 : t1;
|
|
3357
|
+
let t2;
|
|
3358
|
+
if ($[0] !== maskImage) {
|
|
3359
|
+
t2 = maskImage ? {
|
|
3360
|
+
maskImage,
|
|
3361
|
+
WebkitMaskImage: maskImage
|
|
3362
|
+
} : {};
|
|
3363
|
+
$[0] = maskImage;
|
|
3364
|
+
$[1] = t2;
|
|
3365
|
+
} else {
|
|
3366
|
+
t2 = $[1];
|
|
3367
|
+
}
|
|
3368
|
+
let t3;
|
|
3369
|
+
if ($[2] !== color || $[3] !== opacity || $[4] !== t2 || $[5] !== transitionStyle) {
|
|
3370
|
+
t3 = {
|
|
3371
|
+
opacity,
|
|
3372
|
+
backgroundColor: color,
|
|
3373
|
+
...t2,
|
|
3374
|
+
...transitionStyle
|
|
3375
|
+
};
|
|
3376
|
+
$[2] = color;
|
|
3377
|
+
$[3] = opacity;
|
|
3378
|
+
$[4] = t2;
|
|
3379
|
+
$[5] = transitionStyle;
|
|
3380
|
+
$[6] = t3;
|
|
3381
|
+
} else {
|
|
3382
|
+
t3 = $[6];
|
|
3383
|
+
}
|
|
3384
|
+
let t4;
|
|
3385
|
+
if ($[7] !== t3 || $[8] !== theme.slots.solid) {
|
|
3386
|
+
t4 = /* @__PURE__ */ jsx("div", { className: theme.slots.solid, style: t3 });
|
|
3387
|
+
$[7] = t3;
|
|
3388
|
+
$[8] = theme.slots.solid;
|
|
3389
|
+
$[9] = t4;
|
|
3390
|
+
} else {
|
|
3391
|
+
t4 = $[9];
|
|
3392
|
+
}
|
|
3393
|
+
return t4;
|
|
3394
|
+
}
|
|
3406
3395
|
function selectPageBackground(background) {
|
|
3407
3396
|
return background ? normalizeBackgroundInput(background) : null;
|
|
3408
3397
|
}
|
|
@@ -3477,5 +3466,5 @@ function defineBackground(definition = {}) {
|
|
|
3477
3466
|
}
|
|
3478
3467
|
|
|
3479
3468
|
export { BACKGROUND_MEDIA_ID, BACKGROUND_REGISTRY_KEY, BG_TOKEN_TO_OBJECT_STYLE, BackgroundContext, BackgroundOverlay, BackgroundProvider, DEFAULT_BACKGROUND, DEFAULT_BACKGROUND_COMPUTED, DEFAULT_COLOR, INERT_BACKGROUND_ACTIONS, OBJECT_FITS, YouTubeBackgroundPlayer, applyVideoPlaybackState, backgroundModule, backgroundTheme, computeBackgroundState, defineBackground, extractYouTubeVideoId, generateBaseGradient, generateEdgeGradient, getEdgeFadeMask, getYouTubeStreamUrl, getYouTubeThumbnailUrl, isDirectVideoUrl, isYouTubeUrl, mergeBackgroundState, normalizeBackgroundInput, parseYouTubeUrlConfig, resolveBackgroundState, resolveVideoClassNames, resolveVideoOptions, selectPageBackground, syncVideoLoopDirect, syncVideoMutedDirect, triggerVideoPlaybackDirect, useBackground, useBackgroundActions, useBackgroundRegistration, useBackgroundState, useOptionalBackgroundActions, useOptionalBackgroundState };
|
|
3480
|
-
//# sourceMappingURL=chunk-
|
|
3481
|
-
//# sourceMappingURL=chunk-
|
|
3469
|
+
//# sourceMappingURL=chunk-DGVRHX3C.js.map
|
|
3470
|
+
//# sourceMappingURL=chunk-DGVRHX3C.js.map
|