@omerdlw/base-framework 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1183) hide show
  1. package/MIGRATION.md +75 -0
  2. package/README.md +33 -25
  3. package/dist/ambient/index.d.ts +1 -0
  4. package/dist/ambient/index.js +14 -0
  5. package/dist/ambient/server/index.d.ts +1 -0
  6. package/dist/ambient/server/index.js +238 -0
  7. package/dist/ambient/server/index.js.map +1 -0
  8. package/dist/ambient/worker/index.d.ts +1 -0
  9. package/dist/ambient/worker/index.js +143 -0
  10. package/dist/ambient/worker/index.js.map +1 -0
  11. package/dist/background/index.d.ts +1 -0
  12. package/dist/background/index.js +13 -0
  13. package/dist/chunk-2223J34C.js +850 -0
  14. package/dist/chunk-2223J34C.js.map +1 -0
  15. package/dist/chunk-2LGI33JP.js +832 -0
  16. package/dist/chunk-2LGI33JP.js.map +1 -0
  17. package/dist/chunk-37OBXNEO.js +116 -0
  18. package/dist/chunk-37OBXNEO.js.map +1 -0
  19. package/dist/chunk-4OQGXZIH.js +1435 -0
  20. package/dist/chunk-4OQGXZIH.js.map +1 -0
  21. package/dist/chunk-5H6FZW3N.js +535 -0
  22. package/dist/chunk-5H6FZW3N.js.map +1 -0
  23. package/dist/chunk-7RSRDKYE.js +22 -0
  24. package/dist/chunk-7RSRDKYE.js.map +1 -0
  25. package/dist/chunk-AYUEZPAN.js +15762 -0
  26. package/dist/chunk-AYUEZPAN.js.map +1 -0
  27. package/dist/chunk-BCFJSPTI.js +261 -0
  28. package/dist/chunk-BCFJSPTI.js.map +1 -0
  29. package/dist/chunk-BMFHS3GV.js +118 -0
  30. package/dist/chunk-BMFHS3GV.js.map +1 -0
  31. package/dist/chunk-CRKJAACG.js +81 -0
  32. package/dist/chunk-CRKJAACG.js.map +1 -0
  33. package/dist/chunk-CT4UILO2.js +537 -0
  34. package/dist/chunk-CT4UILO2.js.map +1 -0
  35. package/dist/chunk-ESD5EQ5H.js +178 -0
  36. package/dist/chunk-ESD5EQ5H.js.map +1 -0
  37. package/dist/chunk-GCHQ5OC4.js +460 -0
  38. package/dist/chunk-GCHQ5OC4.js.map +1 -0
  39. package/dist/chunk-GT4COZI7.js +110 -0
  40. package/dist/chunk-GT4COZI7.js.map +1 -0
  41. package/dist/chunk-H6HRU3XN.js +567 -0
  42. package/dist/chunk-H6HRU3XN.js.map +1 -0
  43. package/dist/chunk-J3VTDBC6.js +14 -0
  44. package/dist/chunk-J3VTDBC6.js.map +1 -0
  45. package/dist/chunk-LTO77WSO.js +140 -0
  46. package/dist/chunk-LTO77WSO.js.map +1 -0
  47. package/dist/chunk-MCYHKFZL.js +17 -0
  48. package/dist/chunk-MCYHKFZL.js.map +1 -0
  49. package/dist/chunk-NHOJWICA.js +2367 -0
  50. package/dist/chunk-NHOJWICA.js.map +1 -0
  51. package/dist/chunk-QMFV53PP.js +1766 -0
  52. package/dist/chunk-QMFV53PP.js.map +1 -0
  53. package/dist/chunk-RDYYP36I.js +27 -0
  54. package/dist/chunk-RDYYP36I.js.map +1 -0
  55. package/dist/chunk-RF2YGILF.js +656 -0
  56. package/dist/chunk-RF2YGILF.js.map +1 -0
  57. package/dist/chunk-RTCJ35UC.js +825 -0
  58. package/dist/chunk-RTCJ35UC.js.map +1 -0
  59. package/dist/chunk-TUUGWQY5.js +3488 -0
  60. package/dist/chunk-TUUGWQY5.js.map +1 -0
  61. package/dist/chunk-WXEOP6Z4.js +577 -0
  62. package/dist/chunk-WXEOP6Z4.js.map +1 -0
  63. package/dist/chunk-WYVA6AN5.js +590 -0
  64. package/dist/chunk-WYVA6AN5.js.map +1 -0
  65. package/dist/chunk-Y2Q74PJP.js +537 -0
  66. package/dist/chunk-Y2Q74PJP.js.map +1 -0
  67. package/dist/chunk-ZFTQY7OF.js +139 -0
  68. package/dist/chunk-ZFTQY7OF.js.map +1 -0
  69. package/dist/chunk-ZSNP26VU.js +493 -0
  70. package/dist/chunk-ZSNP26VU.js.map +1 -0
  71. package/dist/context-menu/index.d.ts +1 -0
  72. package/dist/context-menu/index.js +19 -0
  73. package/dist/controls/index.d.ts +1 -0
  74. package/dist/controls/index.js +10 -0
  75. package/dist/core/error/boundary.d.ts +27 -0
  76. package/dist/core/error/boundary.d.ts.map +1 -0
  77. package/dist/core/error/constants.d.ts +33 -0
  78. package/dist/core/error/constants.d.ts.map +1 -0
  79. package/dist/core/error/index.d.ts +9 -0
  80. package/dist/core/error/index.d.ts.map +1 -0
  81. package/dist/core/error/listener.d.ts +6 -0
  82. package/dist/core/error/listener.d.ts.map +1 -0
  83. package/dist/core/error/reporter.d.ts +49 -0
  84. package/dist/core/error/reporter.d.ts.map +1 -0
  85. package/dist/core/error/theme.d.ts +10 -0
  86. package/dist/core/error/theme.d.ts.map +1 -0
  87. package/dist/core/error/types.d.ts +128 -0
  88. package/dist/core/error/types.d.ts.map +1 -0
  89. package/dist/core/error/utils.d.ts +55 -0
  90. package/dist/core/error/utils.d.ts.map +1 -0
  91. package/dist/core/kernel/adapters.d.ts +9 -0
  92. package/dist/core/kernel/adapters.d.ts.map +1 -0
  93. package/dist/core/kernel/compose.d.ts +21 -0
  94. package/dist/core/kernel/compose.d.ts.map +1 -0
  95. package/dist/core/kernel/constants.d.ts +42 -0
  96. package/dist/core/kernel/constants.d.ts.map +1 -0
  97. package/dist/core/kernel/handlers.d.ts +7 -0
  98. package/dist/core/kernel/handlers.d.ts.map +1 -0
  99. package/dist/core/kernel/hooks.d.ts +13 -0
  100. package/dist/core/kernel/hooks.d.ts.map +1 -0
  101. package/dist/core/kernel/index.d.ts +15 -0
  102. package/dist/core/kernel/index.d.ts.map +1 -0
  103. package/dist/core/kernel/installed.d.ts +28 -0
  104. package/dist/core/kernel/installed.d.ts.map +1 -0
  105. package/dist/core/kernel/module.d.ts +57 -0
  106. package/dist/core/kernel/module.d.ts.map +1 -0
  107. package/dist/core/kernel/operations-records.d.ts +25 -0
  108. package/dist/core/kernel/operations-records.d.ts.map +1 -0
  109. package/dist/core/kernel/operations-resolve.d.ts +5 -0
  110. package/dist/core/kernel/operations-resolve.d.ts.map +1 -0
  111. package/dist/core/kernel/operations.d.ts +23 -0
  112. package/dist/core/kernel/operations.d.ts.map +1 -0
  113. package/dist/core/kernel/page-controller.d.ts +20 -0
  114. package/dist/core/kernel/page-controller.d.ts.map +1 -0
  115. package/dist/core/kernel/provider.d.ts +29 -0
  116. package/dist/core/kernel/provider.d.ts.map +1 -0
  117. package/dist/core/kernel/runtime.d.ts.map +1 -0
  118. package/dist/core/kernel/schema.d.ts +13 -0
  119. package/dist/core/kernel/schema.d.ts.map +1 -0
  120. package/dist/core/kernel/stabilize.d.ts +13 -0
  121. package/dist/core/kernel/stabilize.d.ts.map +1 -0
  122. package/dist/core/kernel/store-batch.d.ts +17 -0
  123. package/dist/core/kernel/store-batch.d.ts.map +1 -0
  124. package/dist/core/kernel/store-entries.d.ts +6 -0
  125. package/dist/core/kernel/store-entries.d.ts.map +1 -0
  126. package/dist/core/kernel/store-handles.d.ts +4 -0
  127. package/dist/core/kernel/store-handles.d.ts.map +1 -0
  128. package/dist/core/kernel/store-registration.d.ts +14 -0
  129. package/dist/core/kernel/store-registration.d.ts.map +1 -0
  130. package/dist/core/kernel/store-snapshots.d.ts +14 -0
  131. package/dist/core/kernel/store-snapshots.d.ts.map +1 -0
  132. package/dist/core/kernel/store-subscriptions.d.ts +16 -0
  133. package/dist/core/kernel/store-subscriptions.d.ts.map +1 -0
  134. package/dist/core/kernel/store.d.ts +8 -0
  135. package/dist/core/kernel/store.d.ts.map +1 -0
  136. package/dist/core/kernel/types-modules.d.ts +82 -0
  137. package/dist/core/kernel/types-modules.d.ts.map +1 -0
  138. package/dist/core/kernel/types-page.d.ts +67 -0
  139. package/dist/core/kernel/types-page.d.ts.map +1 -0
  140. package/dist/core/kernel/types-store.d.ts +71 -0
  141. package/dist/core/kernel/types-store.d.ts.map +1 -0
  142. package/dist/core/kernel/types.d.ts +169 -0
  143. package/dist/core/kernel/types.d.ts.map +1 -0
  144. package/dist/core/kernel/utils.d.ts +21 -0
  145. package/dist/core/kernel/utils.d.ts.map +1 -0
  146. package/dist/core/navigation/constants.d.ts +48 -0
  147. package/dist/core/navigation/constants.d.ts.map +1 -0
  148. package/dist/core/navigation/navigator-defaults.d.ts +4 -0
  149. package/dist/core/navigation/navigator-defaults.d.ts.map +1 -0
  150. package/dist/core/navigation/navigator-holds.d.ts +8 -0
  151. package/dist/core/navigation/navigator-holds.d.ts.map +1 -0
  152. package/dist/core/navigation/navigator-patience.d.ts +15 -0
  153. package/dist/core/navigation/navigator-patience.d.ts.map +1 -0
  154. package/dist/core/navigation/navigator-payload.d.ts +6 -0
  155. package/dist/core/navigation/navigator-payload.d.ts.map +1 -0
  156. package/dist/core/navigation/navigator-prefetch.d.ts +13 -0
  157. package/dist/core/navigation/navigator-prefetch.d.ts.map +1 -0
  158. package/dist/core/navigation/navigator.d.ts +7 -0
  159. package/dist/core/navigation/navigator.d.ts.map +1 -0
  160. package/dist/core/navigation/settings.d.ts +12 -0
  161. package/dist/core/navigation/settings.d.ts.map +1 -0
  162. package/dist/core/navigation/state.d.ts +26 -0
  163. package/dist/core/navigation/state.d.ts.map +1 -0
  164. package/dist/core/navigation/types.d.ts +194 -0
  165. package/dist/core/navigation/types.d.ts.map +1 -0
  166. package/dist/core/navigation/utils.d.ts +18 -0
  167. package/dist/core/navigation/utils.d.ts.map +1 -0
  168. package/dist/core/provider/index.d.ts +31 -0
  169. package/dist/core/provider/index.d.ts.map +1 -0
  170. package/dist/dock/index.d.ts +1 -0
  171. package/dist/dock/index.js +18 -0
  172. package/dist/error/index.d.ts +1 -9
  173. package/dist/error/index.js +8 -5
  174. package/dist/events/index.d.ts +1 -0
  175. package/dist/events/index.js +83 -0
  176. package/dist/events/index.js.map +1 -0
  177. package/dist/foundation/events/index.d.ts +67 -0
  178. package/dist/foundation/events/index.d.ts.map +1 -0
  179. package/dist/foundation/recipes/anatomy.d.ts +139 -0
  180. package/dist/foundation/recipes/anatomy.d.ts.map +1 -0
  181. package/dist/foundation/recipes/cn.d.ts +17 -0
  182. package/dist/foundation/recipes/cn.d.ts.map +1 -0
  183. package/dist/foundation/recipes/define.d.ts +134 -0
  184. package/dist/foundation/recipes/define.d.ts.map +1 -0
  185. package/dist/foundation/recipes/index.d.ts +11 -0
  186. package/dist/foundation/recipes/index.d.ts.map +1 -0
  187. package/dist/foundation/recipes/recipe.d.ts +97 -0
  188. package/dist/foundation/recipes/recipe.d.ts.map +1 -0
  189. package/dist/foundation/recipes/split.d.ts +10 -0
  190. package/dist/foundation/recipes/split.d.ts.map +1 -0
  191. package/dist/foundation/result/index.d.ts +98 -0
  192. package/dist/foundation/result/index.d.ts.map +1 -0
  193. package/dist/foundation/utils/dom.d.ts +19 -0
  194. package/dist/foundation/utils/dom.d.ts.map +1 -0
  195. package/dist/foundation/utils/index.d.ts +17 -0
  196. package/dist/foundation/utils/index.d.ts.map +1 -0
  197. package/dist/foundation/utils/number.d.ts +9 -0
  198. package/dist/foundation/utils/number.d.ts.map +1 -0
  199. package/dist/foundation/utils/object.d.ts +17 -0
  200. package/dist/foundation/utils/object.d.ts.map +1 -0
  201. package/dist/foundation/utils/report.d.ts +18 -0
  202. package/dist/foundation/utils/report.d.ts.map +1 -0
  203. package/dist/foundation/utils/scheduler.d.ts +52 -0
  204. package/dist/foundation/utils/scheduler.d.ts.map +1 -0
  205. package/dist/foundation/utils/store.d.ts +21 -0
  206. package/dist/foundation/utils/store.d.ts.map +1 -0
  207. package/dist/foundation/utils/string.d.ts +18 -0
  208. package/dist/foundation/utils/string.d.ts.map +1 -0
  209. package/dist/foundation/utils/tempo.d.ts +61 -0
  210. package/dist/foundation/utils/tempo.d.ts.map +1 -0
  211. package/dist/foundation/utils/timing.d.ts +13 -0
  212. package/dist/foundation/utils/timing.d.ts.map +1 -0
  213. package/dist/foundation/utils/transform.d.ts +17 -0
  214. package/dist/foundation/utils/transform.d.ts.map +1 -0
  215. package/dist/foundation/utils/user-message.d.ts +32 -0
  216. package/dist/foundation/utils/user-message.d.ts.map +1 -0
  217. package/dist/hooks/index.d.ts +1 -11
  218. package/dist/hooks/index.js +3 -1
  219. package/dist/index.d.ts +8 -10
  220. package/dist/index.d.ts.map +1 -1
  221. package/dist/index.js +25 -20
  222. package/dist/kernel/index.d.ts +1 -15
  223. package/dist/kernel/index.js +5 -2
  224. package/dist/loading/index.d.ts +1 -0
  225. package/dist/loading/index.js +12 -0
  226. package/dist/media/index.d.ts +1 -0
  227. package/dist/media/index.js +9 -0
  228. package/dist/modal/index.d.ts +1 -0
  229. package/dist/modal/index.js +310 -0
  230. package/dist/modal/index.js.map +1 -0
  231. package/dist/modules/ambient/analyze-bounds.d.ts +12 -0
  232. package/dist/modules/ambient/analyze-bounds.d.ts.map +1 -0
  233. package/dist/modules/ambient/analyze-clusters.d.ts +14 -0
  234. package/dist/modules/ambient/analyze-clusters.d.ts.map +1 -0
  235. package/dist/modules/ambient/analyze-measures.d.ts +22 -0
  236. package/dist/modules/ambient/analyze-measures.d.ts.map +1 -0
  237. package/dist/modules/ambient/analyze-swatches.d.ts +16 -0
  238. package/dist/modules/ambient/analyze-swatches.d.ts.map +1 -0
  239. package/dist/modules/ambient/analyze.d.ts +14 -22
  240. package/dist/modules/ambient/analyze.d.ts.map +1 -1
  241. package/dist/modules/ambient/constants.d.ts +4 -1
  242. package/dist/modules/ambient/constants.d.ts.map +1 -1
  243. package/dist/modules/ambient/context.d.ts +6 -0
  244. package/dist/modules/ambient/context.d.ts.map +1 -1
  245. package/dist/modules/ambient/dom.d.ts +25 -2
  246. package/dist/modules/ambient/dom.d.ts.map +1 -1
  247. package/dist/modules/ambient/extractor.d.ts +10 -0
  248. package/dist/modules/ambient/extractor.d.ts.map +1 -1
  249. package/dist/modules/ambient/hooks.d.ts +12 -0
  250. package/dist/modules/ambient/hooks.d.ts.map +1 -1
  251. package/dist/modules/ambient/module.d.ts +12 -1
  252. package/dist/modules/ambient/module.d.ts.map +1 -1
  253. package/dist/modules/ambient/oklab.d.ts +24 -0
  254. package/dist/modules/ambient/oklab.d.ts.map +1 -1
  255. package/dist/modules/ambient/quantize.d.ts +4 -0
  256. package/dist/modules/ambient/quantize.d.ts.map +1 -1
  257. package/dist/modules/ambient/server/address.d.ts +8 -0
  258. package/dist/modules/ambient/server/address.d.ts.map +1 -1
  259. package/dist/modules/ambient/server/index.d.ts +24 -0
  260. package/dist/modules/ambient/server/index.d.ts.map +1 -1
  261. package/dist/modules/ambient/settings.d.ts +26 -0
  262. package/dist/modules/ambient/settings.d.ts.map +1 -1
  263. package/dist/modules/ambient/types.d.ts +100 -1
  264. package/dist/modules/ambient/types.d.ts.map +1 -1
  265. package/dist/modules/ambient/worker/index.d.ts +16 -0
  266. package/dist/modules/ambient/worker/index.d.ts.map +1 -1
  267. package/dist/modules/background/components/background-gradients.d.ts +8 -0
  268. package/dist/modules/background/components/background-gradients.d.ts.map +1 -0
  269. package/dist/modules/background/components/edge-gradient.d.ts +9 -0
  270. package/dist/modules/background/components/edge-gradient.d.ts.map +1 -0
  271. package/dist/modules/background/components/native-video.d.ts +4 -0
  272. package/dist/modules/background/components/native-video.d.ts.map +1 -0
  273. package/dist/modules/background/components/noise-overlay.d.ts +11 -0
  274. package/dist/modules/background/components/noise-overlay.d.ts.map +1 -0
  275. package/dist/modules/background/components/overlay.d.ts +6 -0
  276. package/dist/modules/background/components/overlay.d.ts.map +1 -0
  277. package/dist/modules/background/components/solid-overlay.d.ts +10 -0
  278. package/dist/modules/background/components/solid-overlay.d.ts.map +1 -0
  279. package/dist/modules/background/constants.d.ts +14 -1
  280. package/dist/modules/background/constants.d.ts.map +1 -1
  281. package/dist/modules/background/context.d.ts +7 -0
  282. package/dist/modules/background/context.d.ts.map +1 -1
  283. package/dist/modules/background/hooks/use-background-media-source.d.ts +4 -0
  284. package/dist/modules/background/hooks/use-background-media-source.d.ts.map +1 -0
  285. package/dist/modules/background/hooks/use-background-motion-model.d.ts +15 -0
  286. package/dist/modules/background/hooks/use-background-motion-model.d.ts.map +1 -0
  287. package/dist/modules/background/hooks/use-background-overlay-model.d.ts +929 -0
  288. package/dist/modules/background/hooks/use-background-overlay-model.d.ts.map +1 -0
  289. package/dist/modules/background/hooks/use-native-video-model.d.ts +22 -0
  290. package/dist/modules/background/hooks/use-native-video-model.d.ts.map +1 -0
  291. package/dist/modules/background/hooks.d.ts +20 -1
  292. package/dist/modules/background/hooks.d.ts.map +1 -1
  293. package/dist/modules/background/index.d.ts +6 -6
  294. package/dist/modules/background/index.d.ts.map +1 -1
  295. package/dist/modules/background/lib/theme.d.ts +4 -0
  296. package/dist/modules/background/lib/theme.d.ts.map +1 -0
  297. package/dist/modules/background/model/override.d.ts +14 -0
  298. package/dist/modules/background/model/override.d.ts.map +1 -0
  299. package/dist/modules/background/model/playback.d.ts +25 -0
  300. package/dist/modules/background/model/playback.d.ts.map +1 -0
  301. package/dist/modules/background/model/state.d.ts +31 -0
  302. package/dist/modules/background/model/state.d.ts.map +1 -0
  303. package/dist/modules/background/model/video-frame.d.ts +31 -0
  304. package/dist/modules/background/model/video-frame.d.ts.map +1 -0
  305. package/dist/modules/background/model/visual.d.ts +932 -0
  306. package/dist/modules/background/model/visual.d.ts.map +1 -0
  307. package/dist/modules/background/module.d.ts +11 -0
  308. package/dist/modules/background/module.d.ts.map +1 -1
  309. package/dist/modules/background/motion.d.ts.map +1 -1
  310. package/dist/modules/background/types.d.ts +66 -3
  311. package/dist/modules/background/types.d.ts.map +1 -1
  312. package/dist/modules/background/youtube/components/player.d.ts +7 -0
  313. package/dist/modules/background/youtube/components/player.d.ts.map +1 -0
  314. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts +27 -0
  315. package/dist/modules/background/youtube/hooks/use-youtube-background-player-model.d.ts.map +1 -0
  316. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts +20 -0
  317. package/dist/modules/background/youtube/hooks/use-youtube-iframe-player.d.ts.map +1 -0
  318. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts +8 -0
  319. package/dist/modules/background/youtube/hooks/use-youtube-stream-sources.d.ts.map +1 -0
  320. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts +16 -0
  321. package/dist/modules/background/youtube/hooks/use-youtube-video-sync.d.ts.map +1 -0
  322. package/dist/modules/background/youtube/lib/audio.d.ts +17 -0
  323. package/dist/modules/background/youtube/lib/audio.d.ts.map +1 -0
  324. package/dist/modules/background/youtube/lib/iframe-engine.d.ts +29 -0
  325. package/dist/modules/background/youtube/lib/iframe-engine.d.ts.map +1 -0
  326. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts +47 -0
  327. package/dist/modules/background/youtube/lib/iframe-proxy.d.ts.map +1 -0
  328. package/dist/modules/background/youtube/lib/iframe.d.ts +47 -0
  329. package/dist/modules/background/youtube/lib/iframe.d.ts.map +1 -0
  330. package/dist/modules/background/youtube/lib/parse.d.ts +36 -0
  331. package/dist/modules/background/youtube/lib/parse.d.ts.map +1 -0
  332. package/dist/modules/background/youtube/lib/timing.d.ts +11 -0
  333. package/dist/modules/background/youtube/lib/timing.d.ts.map +1 -0
  334. package/dist/modules/background/youtube/lib/video-events.d.ts +53 -0
  335. package/dist/modules/background/youtube/lib/video-events.d.ts.map +1 -0
  336. package/dist/modules/context-menu/constants.d.ts +30 -1
  337. package/dist/modules/context-menu/constants.d.ts.map +1 -1
  338. package/dist/modules/context-menu/context.d.ts +10 -2
  339. package/dist/modules/context-menu/context.d.ts.map +1 -1
  340. package/dist/modules/context-menu/dom.d.ts +13 -0
  341. package/dist/modules/context-menu/dom.d.ts.map +1 -1
  342. package/dist/modules/context-menu/hooks.d.ts +32 -5
  343. package/dist/modules/context-menu/hooks.d.ts.map +1 -1
  344. package/dist/modules/context-menu/items.d.ts +25 -0
  345. package/dist/modules/context-menu/items.d.ts.map +1 -1
  346. package/dist/modules/context-menu/module.d.ts +6 -0
  347. package/dist/modules/context-menu/module.d.ts.map +1 -1
  348. package/dist/modules/context-menu/motion.d.ts.map +1 -1
  349. package/dist/modules/context-menu/overlay.d.ts +30 -8
  350. package/dist/modules/context-menu/overlay.d.ts.map +1 -1
  351. package/dist/modules/context-menu/resolver.d.ts +8 -0
  352. package/dist/modules/context-menu/resolver.d.ts.map +1 -1
  353. package/dist/modules/context-menu/state.d.ts +9 -0
  354. package/dist/modules/context-menu/state.d.ts.map +1 -1
  355. package/dist/modules/context-menu/types.d.ts +85 -3
  356. package/dist/modules/context-menu/types.d.ts.map +1 -1
  357. package/dist/modules/controls/constants.d.ts +18 -1
  358. package/dist/modules/controls/constants.d.ts.map +1 -1
  359. package/dist/modules/controls/entries.d.ts +23 -1
  360. package/dist/modules/controls/entries.d.ts.map +1 -1
  361. package/dist/modules/controls/hooks.d.ts +11 -1
  362. package/dist/modules/controls/hooks.d.ts.map +1 -1
  363. package/dist/modules/controls/layout.d.ts +17 -0
  364. package/dist/modules/controls/layout.d.ts.map +1 -1
  365. package/dist/modules/controls/module.d.ts +7 -1
  366. package/dist/modules/controls/module.d.ts.map +1 -1
  367. package/dist/modules/controls/overlay.d.ts +11 -1
  368. package/dist/modules/controls/overlay.d.ts.map +1 -1
  369. package/dist/modules/controls/types.d.ts +51 -2
  370. package/dist/modules/controls/types.d.ts.map +1 -1
  371. package/dist/modules/dock/components/badge.d.ts +5 -0
  372. package/dist/modules/dock/components/badge.d.ts.map +1 -0
  373. package/dist/modules/dock/components/breadcrumbs-card.d.ts +6 -0
  374. package/dist/modules/dock/components/breadcrumbs-card.d.ts.map +1 -0
  375. package/dist/modules/dock/components/card-banner.d.ts +4 -0
  376. package/dist/modules/dock/components/card-banner.d.ts.map +1 -0
  377. package/dist/modules/dock/components/card-header.d.ts +4 -0
  378. package/dist/modules/dock/components/card-header.d.ts.map +1 -0
  379. package/dist/modules/dock/components/card-item.d.ts +3 -0
  380. package/dist/modules/dock/components/card-item.d.ts.map +1 -0
  381. package/dist/modules/dock/components/command-bar.d.ts +7 -0
  382. package/dist/modules/dock/components/command-bar.d.ts.map +1 -0
  383. package/dist/modules/dock/components/description.d.ts +4 -0
  384. package/dist/modules/dock/components/description.d.ts.map +1 -0
  385. package/dist/modules/dock/components/dock.d.ts +4 -0
  386. package/dist/modules/dock/components/dock.d.ts.map +1 -0
  387. package/dist/modules/dock/components/hud-view.d.ts +7 -0
  388. package/dist/modules/dock/components/hud-view.d.ts.map +1 -0
  389. package/dist/modules/dock/components/icon.d.ts +6 -0
  390. package/dist/modules/dock/components/icon.d.ts.map +1 -0
  391. package/dist/modules/dock/components/item-content.d.ts +4 -0
  392. package/dist/modules/dock/components/item-content.d.ts.map +1 -0
  393. package/dist/modules/dock/components/media-action.d.ts +4 -0
  394. package/dist/modules/dock/components/media-action.d.ts.map +1 -0
  395. package/dist/modules/dock/components/media-controls.d.ts +4 -0
  396. package/dist/modules/dock/components/media-controls.d.ts.map +1 -0
  397. package/dist/modules/dock/components/media-scrubber.d.ts +5 -0
  398. package/dist/modules/dock/components/media-scrubber.d.ts.map +1 -0
  399. package/dist/modules/dock/components/status-actions.d.ts +10 -0
  400. package/dist/modules/dock/components/status-actions.d.ts.map +1 -0
  401. package/dist/modules/dock/components/surface/action.d.ts +17 -0
  402. package/dist/modules/dock/components/surface/action.d.ts.map +1 -0
  403. package/dist/modules/dock/components/surface/controls.d.ts +12 -0
  404. package/dist/modules/dock/components/surface/controls.d.ts.map +1 -0
  405. package/dist/modules/dock/components/surface/extensions-bar.d.ts +5 -0
  406. package/dist/modules/dock/components/surface/extensions-bar.d.ts.map +1 -0
  407. package/dist/modules/dock/components/surface/header-button.d.ts +14 -0
  408. package/dist/modules/dock/components/surface/header-button.d.ts.map +1 -0
  409. package/dist/modules/dock/components/surface/item-content.d.ts +6 -0
  410. package/dist/modules/dock/components/surface/item-content.d.ts.map +1 -0
  411. package/dist/modules/dock/components/surface/shell.d.ts +3 -0
  412. package/dist/modules/dock/components/surface/shell.d.ts.map +1 -0
  413. package/dist/modules/dock/components/title.d.ts +4 -0
  414. package/dist/modules/dock/components/title.d.ts.map +1 -0
  415. package/dist/modules/dock/constants.d.ts +11 -2
  416. package/dist/modules/dock/constants.d.ts.map +1 -1
  417. package/dist/modules/dock/context.d.ts +8 -2
  418. package/dist/modules/dock/context.d.ts.map +1 -1
  419. package/dist/modules/dock/hooks/use-action-slot.d.ts +6 -0
  420. package/dist/modules/dock/hooks/use-action-slot.d.ts.map +1 -0
  421. package/dist/modules/dock/hooks/use-badge.d.ts +4 -0
  422. package/dist/modules/dock/hooks/use-badge.d.ts.map +1 -0
  423. package/dist/modules/dock/hooks/use-card-banner-model.d.ts +18 -0
  424. package/dist/modules/dock/hooks/use-card-banner-model.d.ts.map +1 -0
  425. package/dist/modules/dock/hooks/use-card-header-model.d.ts +7 -0
  426. package/dist/modules/dock/hooks/use-card-header-model.d.ts.map +1 -0
  427. package/dist/modules/dock/hooks/use-card-item-model.d.ts +1612 -0
  428. package/dist/modules/dock/hooks/use-card-item-model.d.ts.map +1 -0
  429. package/dist/modules/dock/hooks/use-command-bar-model.d.ts +12 -0
  430. package/dist/modules/dock/hooks/use-command-bar-model.d.ts.map +1 -0
  431. package/dist/modules/dock/hooks/use-dock-banner.d.ts +11 -0
  432. package/dist/modules/dock/hooks/use-dock-banner.d.ts.map +1 -0
  433. package/dist/modules/dock/hooks/use-dock-config.d.ts +19 -0
  434. package/dist/modules/dock/hooks/use-dock-config.d.ts.map +1 -0
  435. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts +7 -0
  436. package/dist/modules/dock/hooks/use-dock-dimensions.d.ts.map +1 -0
  437. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts +7 -0
  438. package/dist/modules/dock/hooks/use-dock-focus-trap.d.ts.map +1 -0
  439. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts +6 -0
  440. package/dist/modules/dock/hooks/use-dock-height-controller.d.ts.map +1 -0
  441. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts +11 -0
  442. package/dist/modules/dock/hooks/use-dock-keyboard.d.ts.map +1 -0
  443. package/dist/modules/dock/hooks/use-dock-registration.d.ts +8 -0
  444. package/dist/modules/dock/hooks/use-dock-registration.d.ts.map +1 -0
  445. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts +2 -0
  446. package/dist/modules/dock/hooks/use-dock-route-reset.d.ts.map +1 -0
  447. package/dist/modules/dock/hooks/use-dock-theme.d.ts +6 -0
  448. package/dist/modules/dock/hooks/use-dock-theme.d.ts.map +1 -0
  449. package/dist/modules/dock/hooks/use-dock-viewport.d.ts +6 -0
  450. package/dist/modules/dock/hooks/use-dock-viewport.d.ts.map +1 -0
  451. package/dist/modules/dock/hooks/use-element-height.d.ts +3 -0
  452. package/dist/modules/dock/hooks/use-element-height.d.ts.map +1 -0
  453. package/dist/modules/dock/hooks/use-hud-registry.d.ts +16 -0
  454. package/dist/modules/dock/hooks/use-hud-registry.d.ts.map +1 -0
  455. package/dist/modules/dock/hooks/use-hud-view-model.d.ts +9 -0
  456. package/dist/modules/dock/hooks/use-hud-view-model.d.ts.map +1 -0
  457. package/dist/modules/dock/hooks/use-media-controls-model.d.ts +27 -0
  458. package/dist/modules/dock/hooks/use-media-controls-model.d.ts.map +1 -0
  459. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts +27 -0
  460. package/dist/modules/dock/hooks/use-media-scrubber-model.d.ts.map +1 -0
  461. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts +12 -0
  462. package/dist/modules/dock/hooks/use-standard-item-content-model.d.ts.map +1 -0
  463. package/dist/modules/dock/hooks/use-surface-return.d.ts +8 -0
  464. package/dist/modules/dock/hooks/use-surface-return.d.ts.map +1 -0
  465. package/dist/modules/dock/hud.d.ts +8 -34
  466. package/dist/modules/dock/hud.d.ts.map +1 -1
  467. package/dist/modules/dock/index.d.ts +18 -12
  468. package/dist/modules/dock/index.d.ts.map +1 -1
  469. package/dist/modules/dock/lib/banner.d.ts +43 -0
  470. package/dist/modules/dock/lib/banner.d.ts.map +1 -0
  471. package/dist/modules/dock/lib/card-item.d.ts +46 -0
  472. package/dist/modules/dock/lib/card-item.d.ts.map +1 -0
  473. package/dist/modules/dock/lib/card.d.ts +20 -0
  474. package/dist/modules/dock/lib/card.d.ts.map +1 -0
  475. package/dist/modules/dock/lib/command-bar.d.ts +8 -0
  476. package/dist/modules/dock/lib/command-bar.d.ts.map +1 -0
  477. package/dist/modules/dock/lib/dom.d.ts +7 -0
  478. package/dist/modules/dock/lib/dom.d.ts.map +1 -0
  479. package/dist/modules/dock/lib/element-helpers.d.ts +8 -0
  480. package/dist/modules/dock/lib/element-helpers.d.ts.map +1 -0
  481. package/dist/modules/dock/lib/helpers.d.ts +19 -0
  482. package/dist/modules/dock/lib/helpers.d.ts.map +1 -0
  483. package/dist/modules/dock/lib/media.d.ts +35 -0
  484. package/dist/modules/dock/lib/media.d.ts.map +1 -0
  485. package/dist/modules/dock/lib/styles.d.ts +902 -0
  486. package/dist/modules/dock/lib/styles.d.ts.map +1 -0
  487. package/dist/modules/dock/model/hud-definition.d.ts +13 -0
  488. package/dist/modules/dock/model/hud-definition.d.ts.map +1 -0
  489. package/dist/modules/dock/model/hud.d.ts +10 -0
  490. package/dist/modules/dock/model/hud.d.ts.map +1 -0
  491. package/dist/modules/dock/model/layout.d.ts +28 -0
  492. package/dist/modules/dock/model/layout.d.ts.map +1 -0
  493. package/dist/modules/dock/model/page-entry.d.ts +11 -0
  494. package/dist/modules/dock/model/page-entry.d.ts.map +1 -0
  495. package/dist/modules/dock/model/page-surface.d.ts +4 -0
  496. package/dist/modules/dock/model/page-surface.d.ts.map +1 -0
  497. package/dist/modules/dock/model/paths.d.ts +15 -0
  498. package/dist/modules/dock/model/paths.d.ts.map +1 -0
  499. package/dist/modules/dock/model/state.d.ts +28 -0
  500. package/dist/modules/dock/model/state.d.ts.map +1 -0
  501. package/dist/modules/dock/model/surface-return.d.ts +14 -0
  502. package/dist/modules/dock/model/surface-return.d.ts.map +1 -0
  503. package/dist/modules/dock/module.d.ts +5 -7
  504. package/dist/modules/dock/module.d.ts.map +1 -1
  505. package/dist/modules/dock/motion.d.ts +716 -5
  506. package/dist/modules/dock/motion.d.ts.map +1 -1
  507. package/dist/modules/dock/provider.d.ts +2 -1
  508. package/dist/modules/dock/provider.d.ts.map +1 -1
  509. package/dist/modules/dock/routing/breadcrumbs.d.ts +6 -2
  510. package/dist/modules/dock/routing/breadcrumbs.d.ts.map +1 -1
  511. package/dist/modules/dock/routing/continuity.d.ts +46 -14
  512. package/dist/modules/dock/routing/continuity.d.ts.map +1 -1
  513. package/dist/modules/dock/routing/guards.d.ts +10 -1
  514. package/dist/modules/dock/routing/guards.d.ts.map +1 -1
  515. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts +12 -0
  516. package/dist/modules/dock/routing/hooks/use-route-prefetch.d.ts.map +1 -0
  517. package/dist/modules/dock/routing/lib/restore.d.ts +7 -0
  518. package/dist/modules/dock/routing/lib/restore.d.ts.map +1 -0
  519. package/dist/modules/dock/routing/model/continuity.d.ts +21 -0
  520. package/dist/modules/dock/routing/model/continuity.d.ts.map +1 -0
  521. package/dist/modules/dock/routing/model/policy.d.ts +7 -0
  522. package/dist/modules/dock/routing/model/policy.d.ts.map +1 -0
  523. package/dist/modules/dock/routing/model/topology.d.ts +5 -0
  524. package/dist/modules/dock/routing/model/topology.d.ts.map +1 -0
  525. package/dist/modules/dock/routing/navigation.d.ts +10 -22
  526. package/dist/modules/dock/routing/navigation.d.ts.map +1 -1
  527. package/dist/modules/dock/runtime/commands.d.ts +10 -1
  528. package/dist/modules/dock/runtime/commands.d.ts.map +1 -1
  529. package/dist/modules/dock/runtime/display.d.ts +9 -42
  530. package/dist/modules/dock/runtime/display.d.ts.map +1 -1
  531. package/dist/modules/dock/runtime/dock.d.ts +11 -70
  532. package/dist/modules/dock/runtime/dock.d.ts.map +1 -1
  533. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts +10 -0
  534. package/dist/modules/dock/runtime/hooks/use-dock-expansion.d.ts.map +1 -0
  535. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts +10 -0
  536. package/dist/modules/dock/runtime/hooks/use-dock-layout.d.ts.map +1 -0
  537. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts +14 -0
  538. package/dist/modules/dock/runtime/hooks/use-dock-operation-state.d.ts.map +1 -0
  539. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts +7 -0
  540. package/dist/modules/dock/runtime/hooks/use-dock-route-bridge.d.ts.map +1 -0
  541. package/dist/modules/dock/runtime/hooks/use-dock.d.ts +30 -0
  542. package/dist/modules/dock/runtime/hooks/use-dock.d.ts.map +1 -0
  543. package/dist/modules/dock/runtime/model/attention.d.ts +25 -0
  544. package/dist/modules/dock/runtime/model/attention.d.ts.map +1 -0
  545. package/dist/modules/dock/runtime/model/cards.d.ts +64 -0
  546. package/dist/modules/dock/runtime/model/cards.d.ts.map +1 -0
  547. package/dist/modules/dock/runtime/model/items.d.ts +31 -0
  548. package/dist/modules/dock/runtime/model/items.d.ts.map +1 -0
  549. package/dist/modules/dock/runtime/model/layout.d.ts +10 -0
  550. package/dist/modules/dock/runtime/model/layout.d.ts.map +1 -0
  551. package/dist/modules/dock/runtime/pipeline.d.ts +1 -1
  552. package/dist/modules/dock/runtime/pipeline.d.ts.map +1 -1
  553. package/dist/modules/dock/runtime/provider-actions.d.ts +38 -0
  554. package/dist/modules/dock/runtime/provider-actions.d.ts.map +1 -0
  555. package/dist/modules/dock/status/action-options.d.ts +35 -0
  556. package/dist/modules/dock/status/action-options.d.ts.map +1 -0
  557. package/dist/modules/dock/status/events.d.ts +2 -2
  558. package/dist/modules/dock/status/events.d.ts.map +1 -1
  559. package/dist/modules/dock/status/hooks.d.ts +1 -1
  560. package/dist/modules/dock/status/hooks.d.ts.map +1 -1
  561. package/dist/modules/dock/status/model.d.ts +12 -32
  562. package/dist/modules/dock/status/model.d.ts.map +1 -1
  563. package/dist/modules/dock/status/state.d.ts +12 -0
  564. package/dist/modules/dock/status/state.d.ts.map +1 -0
  565. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts +5 -0
  566. package/dist/modules/dock/surface/components/surface-extensions-provider.d.ts.map +1 -0
  567. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts +7 -0
  568. package/dist/modules/dock/surface/components/surface-flow-provider.d.ts.map +1 -0
  569. package/dist/modules/dock/surface/constants.d.ts +5 -0
  570. package/dist/modules/dock/surface/constants.d.ts.map +1 -0
  571. package/dist/modules/dock/surface/context.d.ts +14 -1
  572. package/dist/modules/dock/surface/context.d.ts.map +1 -1
  573. package/dist/modules/dock/surface/definition.d.ts +28 -2
  574. package/dist/modules/dock/surface/definition.d.ts.map +1 -1
  575. package/dist/modules/dock/surface/helpers.d.ts +2 -1
  576. package/dist/modules/dock/surface/helpers.d.ts.map +1 -1
  577. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts +15 -0
  578. package/dist/modules/dock/surface/hooks/use-surface-controls-model.d.ts.map +1 -0
  579. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts +7 -0
  580. package/dist/modules/dock/surface/hooks/use-surface-extensions-bar-model.d.ts.map +1 -0
  581. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts +14 -0
  582. package/dist/modules/dock/surface/hooks/use-surface-extensions.d.ts.map +1 -0
  583. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts +20 -0
  584. package/dist/modules/dock/surface/hooks/use-surface-flow.d.ts.map +1 -0
  585. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts +13 -0
  586. package/dist/modules/dock/surface/hooks/use-surface-header-button-model.d.ts.map +1 -0
  587. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts +28 -0
  588. package/dist/modules/dock/surface/hooks/use-surface-shell-model.d.ts.map +1 -0
  589. package/dist/modules/dock/surface/lib/drag.d.ts +9 -0
  590. package/dist/modules/dock/surface/lib/drag.d.ts.map +1 -0
  591. package/dist/modules/dock/surface/lib/target.d.ts +8 -0
  592. package/dist/modules/dock/surface/lib/target.d.ts.map +1 -0
  593. package/dist/modules/dock/surface/machine.d.ts +17 -62
  594. package/dist/modules/dock/surface/machine.d.ts.map +1 -1
  595. package/dist/modules/dock/surface/model/builder.d.ts +39 -0
  596. package/dist/modules/dock/surface/model/builder.d.ts.map +1 -0
  597. package/dist/modules/dock/surface/model/normalize.d.ts +13 -0
  598. package/dist/modules/dock/surface/model/normalize.d.ts.map +1 -0
  599. package/dist/modules/dock/surface/model/open.d.ts +26 -0
  600. package/dist/modules/dock/surface/model/open.d.ts.map +1 -0
  601. package/dist/modules/dock/surface/model/records.d.ts +45 -0
  602. package/dist/modules/dock/surface/model/records.d.ts.map +1 -0
  603. package/dist/modules/dock/surface/model/steps.d.ts +9 -0
  604. package/dist/modules/dock/surface/model/steps.d.ts.map +1 -0
  605. package/dist/modules/dock/surface/model/transition-state.d.ts +23 -0
  606. package/dist/modules/dock/surface/model/transition-state.d.ts.map +1 -0
  607. package/dist/modules/dock/surface/model/url.d.ts +14 -0
  608. package/dist/modules/dock/surface/model/url.d.ts.map +1 -0
  609. package/dist/modules/dock/surface/runtime/choreography.d.ts +22 -0
  610. package/dist/modules/dock/surface/runtime/choreography.d.ts.map +1 -0
  611. package/dist/modules/dock/surface/runtime/context.d.ts +29 -0
  612. package/dist/modules/dock/surface/runtime/context.d.ts.map +1 -0
  613. package/dist/modules/dock/surface/runtime/flows.d.ts +21 -0
  614. package/dist/modules/dock/surface/runtime/flows.d.ts.map +1 -0
  615. package/dist/modules/dock/surface/runtime/open.d.ts +6 -0
  616. package/dist/modules/dock/surface/runtime/open.d.ts.map +1 -0
  617. package/dist/modules/dock/surface/runtime/release.d.ts +9 -0
  618. package/dist/modules/dock/surface/runtime/release.d.ts.map +1 -0
  619. package/dist/modules/dock/surface/runtime/steps.d.ts +10 -0
  620. package/dist/modules/dock/surface/runtime/steps.d.ts.map +1 -0
  621. package/dist/modules/dock/surface/stack.d.ts +20 -11
  622. package/dist/modules/dock/surface/stack.d.ts.map +1 -1
  623. package/dist/modules/dock/surface/view-model.d.ts +5 -1
  624. package/dist/modules/dock/surface/view-model.d.ts.map +1 -1
  625. package/dist/modules/dock/types/card.d.ts +297 -0
  626. package/dist/modules/dock/types/card.d.ts.map +1 -0
  627. package/dist/modules/dock/types/hud.d.ts +142 -0
  628. package/dist/modules/dock/types/hud.d.ts.map +1 -0
  629. package/dist/modules/dock/types/index.d.ts +8 -0
  630. package/dist/modules/dock/types/index.d.ts.map +1 -0
  631. package/dist/modules/dock/types/media.d.ts +66 -0
  632. package/dist/modules/dock/types/media.d.ts.map +1 -0
  633. package/dist/modules/dock/types/routing.d.ts +336 -0
  634. package/dist/modules/dock/types/routing.d.ts.map +1 -0
  635. package/dist/modules/dock/types/surface-flow.d.ts +231 -0
  636. package/dist/modules/dock/types/surface-flow.d.ts.map +1 -0
  637. package/dist/modules/dock/types/surface.d.ts +194 -0
  638. package/dist/modules/dock/types/surface.d.ts.map +1 -0
  639. package/dist/modules/dock/types/theme.d.ts +201 -0
  640. package/dist/modules/dock/types/theme.d.ts.map +1 -0
  641. package/dist/modules/index.d.ts +4 -0
  642. package/dist/modules/index.d.ts.map +1 -1
  643. package/dist/modules/index.js +23 -18
  644. package/dist/modules/loading/constants.d.ts +18 -1
  645. package/dist/modules/loading/constants.d.ts.map +1 -1
  646. package/dist/modules/loading/context.d.ts +11 -1
  647. package/dist/modules/loading/context.d.ts.map +1 -1
  648. package/dist/modules/loading/hooks.d.ts +24 -1
  649. package/dist/modules/loading/hooks.d.ts.map +1 -1
  650. package/dist/modules/loading/module.d.ts +6 -0
  651. package/dist/modules/loading/module.d.ts.map +1 -1
  652. package/dist/modules/loading/overlay.d.ts +3 -0
  653. package/dist/modules/loading/overlay.d.ts.map +1 -1
  654. package/dist/modules/loading/state.d.ts +13 -0
  655. package/dist/modules/loading/state.d.ts.map +1 -1
  656. package/dist/modules/loading/types.d.ts +42 -2
  657. package/dist/modules/loading/types.d.ts.map +1 -1
  658. package/dist/modules/media/constants.d.ts +19 -0
  659. package/dist/modules/media/constants.d.ts.map +1 -1
  660. package/dist/modules/media/context.d.ts +11 -1
  661. package/dist/modules/media/context.d.ts.map +1 -1
  662. package/dist/modules/media/hooks.d.ts +17 -0
  663. package/dist/modules/media/hooks.d.ts.map +1 -1
  664. package/dist/modules/media/module.d.ts +4 -0
  665. package/dist/modules/media/module.d.ts.map +1 -1
  666. package/dist/modules/media/overlay.d.ts +7 -0
  667. package/dist/modules/media/overlay.d.ts.map +1 -1
  668. package/dist/modules/media/playback.d.ts +13 -0
  669. package/dist/modules/media/playback.d.ts.map +1 -1
  670. package/dist/modules/media/session.d.ts +20 -0
  671. package/dist/modules/media/session.d.ts.map +1 -1
  672. package/dist/modules/media/types.d.ts +49 -2
  673. package/dist/modules/media/types.d.ts.map +1 -1
  674. package/dist/modules/modal/components/close-button.d.ts +6 -0
  675. package/dist/modules/modal/components/close-button.d.ts.map +1 -0
  676. package/dist/modules/modal/components/modal-container.d.ts +7 -0
  677. package/dist/modules/modal/components/modal-container.d.ts.map +1 -0
  678. package/dist/modules/modal/components/modal-layer-switcher.d.ts +9 -0
  679. package/dist/modules/modal/components/modal-layer-switcher.d.ts.map +1 -0
  680. package/dist/modules/modal/components/modal-layer.d.ts +17 -0
  681. package/dist/modules/modal/components/modal-layer.d.ts.map +1 -0
  682. package/dist/modules/modal/components/overlay.d.ts +6 -0
  683. package/dist/modules/modal/components/overlay.d.ts.map +1 -0
  684. package/dist/modules/modal/components/resolve-header.d.ts +10 -0
  685. package/dist/modules/modal/components/resolve-header.d.ts.map +1 -0
  686. package/dist/modules/modal/components/slot-row.d.ts +12 -0
  687. package/dist/modules/modal/components/slot-row.d.ts.map +1 -0
  688. package/dist/modules/modal/constants.d.ts +16 -1
  689. package/dist/modules/modal/constants.d.ts.map +1 -1
  690. package/dist/modules/modal/context.d.ts +7 -1
  691. package/dist/modules/modal/context.d.ts.map +1 -1
  692. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts +3 -0
  693. package/dist/modules/modal/hooks/use-mobile-viewport.d.ts.map +1 -0
  694. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts +12 -0
  695. package/dist/modules/modal/hooks/use-modal-focus-trap.d.ts.map +1 -0
  696. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts +3 -0
  697. package/dist/modules/modal/hooks/use-modal-scroll-lock.d.ts.map +1 -0
  698. package/dist/modules/modal/hooks.d.ts +30 -4
  699. package/dist/modules/modal/hooks.d.ts.map +1 -1
  700. package/dist/modules/modal/index.d.ts +7 -6
  701. package/dist/modules/modal/index.d.ts.map +1 -1
  702. package/dist/modules/modal/lib/dom.d.ts +13 -0
  703. package/dist/modules/modal/lib/dom.d.ts.map +1 -0
  704. package/dist/modules/modal/lib/theme.d.ts +4 -0
  705. package/dist/modules/modal/lib/theme.d.ts.map +1 -0
  706. package/dist/modules/modal/model/entry.d.ts +18 -0
  707. package/dist/modules/modal/model/entry.d.ts.map +1 -0
  708. package/dist/modules/modal/model/header.d.ts +16 -0
  709. package/dist/modules/modal/model/header.d.ts.map +1 -0
  710. package/dist/modules/modal/model/identity.d.ts +13 -0
  711. package/dist/modules/modal/model/identity.d.ts.map +1 -0
  712. package/dist/modules/modal/model/layout.d.ts +37 -0
  713. package/dist/modules/modal/model/layout.d.ts.map +1 -0
  714. package/dist/modules/modal/model/state.d.ts +10 -0
  715. package/dist/modules/modal/model/state.d.ts.map +1 -0
  716. package/dist/modules/modal/module.d.ts +7 -0
  717. package/dist/modules/modal/module.d.ts.map +1 -1
  718. package/dist/modules/modal/motion.d.ts.map +1 -1
  719. package/dist/modules/modal/types.d.ts +73 -1
  720. package/dist/modules/modal/types.d.ts.map +1 -1
  721. package/dist/modules/navigation/context.d.ts +16 -4
  722. package/dist/modules/navigation/context.d.ts.map +1 -1
  723. package/dist/modules/navigation/hooks.d.ts +28 -1
  724. package/dist/modules/navigation/hooks.d.ts.map +1 -1
  725. package/dist/modules/navigation/index.d.ts +5 -5
  726. package/dist/modules/navigation/index.d.ts.map +1 -1
  727. package/dist/modules/navigation/listeners.d.ts +10 -1
  728. package/dist/modules/navigation/listeners.d.ts.map +1 -1
  729. package/dist/modules/navigation/module.d.ts +5 -2
  730. package/dist/modules/navigation/module.d.ts.map +1 -1
  731. package/dist/modules/notification/constants.d.ts +22 -2
  732. package/dist/modules/notification/constants.d.ts.map +1 -1
  733. package/dist/modules/notification/context.d.ts +12 -2
  734. package/dist/modules/notification/context.d.ts.map +1 -1
  735. package/dist/modules/notification/hooks.d.ts +32 -1
  736. package/dist/modules/notification/hooks.d.ts.map +1 -1
  737. package/dist/modules/notification/module.d.ts +3 -0
  738. package/dist/modules/notification/module.d.ts.map +1 -1
  739. package/dist/modules/notification/motion.d.ts.map +1 -1
  740. package/dist/modules/notification/overlay.d.ts.map +1 -1
  741. package/dist/modules/notification/state.d.ts +28 -0
  742. package/dist/modules/notification/state.d.ts.map +1 -1
  743. package/dist/modules/notification/types.d.ts +48 -2
  744. package/dist/modules/notification/types.d.ts.map +1 -1
  745. package/dist/navigation/index.d.ts +1 -0
  746. package/dist/navigation/index.js +189 -0
  747. package/dist/navigation/index.js.map +1 -0
  748. package/dist/notification/index.d.ts +1 -0
  749. package/dist/notification/index.js +11 -0
  750. package/dist/overlay-QHSJBV3O.js +13 -0
  751. package/dist/overlay-QHSJBV3O.js.map +1 -0
  752. package/dist/provider/index.d.ts +1 -0
  753. package/dist/provider/index.js +14 -0
  754. package/dist/react/context/index.d.ts +4 -0
  755. package/dist/react/context/index.d.ts.map +1 -0
  756. package/dist/react/hooks/index.d.ts +10 -0
  757. package/dist/react/hooks/index.d.ts.map +1 -0
  758. package/dist/react/hooks/types.d.ts +25 -0
  759. package/dist/react/hooks/types.d.ts.map +1 -0
  760. package/dist/react/hooks/use-click-outside.d.ts +6 -0
  761. package/dist/react/hooks/use-click-outside.d.ts.map +1 -0
  762. package/dist/react/hooks/use-controllable-state.d.ts +7 -0
  763. package/dist/react/hooks/use-controllable-state.d.ts.map +1 -0
  764. package/dist/react/hooks/use-fullscreen-state.d.ts +7 -0
  765. package/dist/react/hooks/use-fullscreen-state.d.ts.map +1 -0
  766. package/dist/react/hooks/use-global-event.d.ts +9 -0
  767. package/dist/react/hooks/use-global-event.d.ts.map +1 -0
  768. package/dist/react/hooks/use-hotkey.d.ts +10 -0
  769. package/dist/react/hooks/use-hotkey.d.ts.map +1 -0
  770. package/dist/react/hooks/use-required-context.d.ts +6 -0
  771. package/dist/react/hooks/use-required-context.d.ts.map +1 -0
  772. package/dist/react/hooks/use-scroll-lock.d.ts +9 -0
  773. package/dist/react/hooks/use-scroll-lock.d.ts.map +1 -0
  774. package/dist/react/hooks/use-store.d.ts +3 -0
  775. package/dist/react/hooks/use-store.d.ts.map +1 -0
  776. package/dist/react/theme/index.d.ts +82 -0
  777. package/dist/react/theme/index.d.ts.map +1 -0
  778. package/dist/react/ui/components/avatar.d.ts +6 -0
  779. package/dist/react/ui/components/avatar.d.ts.map +1 -0
  780. package/dist/react/ui/components/button.d.ts +6 -0
  781. package/dist/react/ui/components/button.d.ts.map +1 -0
  782. package/dist/react/ui/components/carousel.d.ts +6 -0
  783. package/dist/react/ui/components/carousel.d.ts.map +1 -0
  784. package/dist/react/ui/components/checkbox.d.ts +10 -0
  785. package/dist/react/ui/components/checkbox.d.ts.map +1 -0
  786. package/dist/react/ui/components/icon.d.ts +6 -0
  787. package/dist/react/ui/components/icon.d.ts.map +1 -0
  788. package/dist/react/ui/components/image.d.ts +6 -0
  789. package/dist/react/ui/components/image.d.ts.map +1 -0
  790. package/dist/react/ui/components/indicator.d.ts +45 -0
  791. package/dist/react/ui/components/indicator.d.ts.map +1 -0
  792. package/dist/react/ui/components/input.d.ts +10 -0
  793. package/dist/react/ui/components/input.d.ts.map +1 -0
  794. package/dist/react/ui/components/loader.d.ts +10 -0
  795. package/dist/react/ui/components/loader.d.ts.map +1 -0
  796. package/dist/react/ui/components/segmented.d.ts +6 -0
  797. package/dist/react/ui/components/segmented.d.ts.map +1 -0
  798. package/dist/react/ui/components/select-parts.d.ts +22 -0
  799. package/dist/react/ui/components/select-parts.d.ts.map +1 -0
  800. package/dist/react/ui/components/select.d.ts +6 -0
  801. package/dist/react/ui/components/select.d.ts.map +1 -0
  802. package/dist/react/ui/components/skeleton.d.ts +10 -0
  803. package/dist/react/ui/components/skeleton.d.ts.map +1 -0
  804. package/dist/react/ui/components/switch.d.ts +6 -0
  805. package/dist/react/ui/components/switch.d.ts.map +1 -0
  806. package/dist/react/ui/components/tooltip.d.ts +11 -0
  807. package/dist/react/ui/components/tooltip.d.ts.map +1 -0
  808. package/dist/react/ui/index.d.ts +19 -0
  809. package/dist/react/ui/index.d.ts.map +1 -0
  810. package/dist/react/ui/provider.d.ts +22 -0
  811. package/dist/react/ui/provider.d.ts.map +1 -0
  812. package/dist/react/ui/types-controls.d.ts +133 -0
  813. package/dist/react/ui/types-controls.d.ts.map +1 -0
  814. package/dist/react/ui/types.d.ts +192 -0
  815. package/dist/react/ui/types.d.ts.map +1 -0
  816. package/dist/react/ui/utils.d.ts +65 -0
  817. package/dist/react/ui/utils.d.ts.map +1 -0
  818. package/dist/recipes/index.d.ts +1 -0
  819. package/dist/recipes/index.js +233 -0
  820. package/dist/recipes/index.js.map +1 -0
  821. package/dist/result/index.d.ts +1 -0
  822. package/dist/result/index.js +98 -0
  823. package/dist/result/index.js.map +1 -0
  824. package/dist/theme/index.d.ts +1 -0
  825. package/dist/theme/index.js +6 -0
  826. package/dist/ui/index.d.ts +1 -19
  827. package/dist/ui/index.js +2158 -1860
  828. package/dist/ui/index.js.map +1 -1
  829. package/dist/utils/index.d.ts +1 -15
  830. package/dist/utils/index.js +194 -71
  831. package/dist/utils/index.js.map +1 -1
  832. package/docs/README.md +58 -61
  833. package/docs/architecture-and-rules.md +133 -58
  834. package/docs/core-engine.md +36 -52
  835. package/docs/custom-modules.md +43 -32
  836. package/docs/design.md +185 -0
  837. package/docs/getting-started.md +49 -57
  838. package/docs/modules/README.md +50 -61
  839. package/docs/modules/ambient.md +95 -87
  840. package/docs/modules/background.md +39 -36
  841. package/docs/modules/context-menu.md +19 -18
  842. package/docs/modules/controls.md +13 -13
  843. package/docs/modules/dock.md +74 -93
  844. package/docs/modules/error-boundary.md +2 -2
  845. package/docs/modules/kernel.md +38 -26
  846. package/docs/modules/loading.md +14 -14
  847. package/docs/modules/media.md +13 -13
  848. package/docs/modules/modal.md +14 -14
  849. package/docs/modules/navigation.md +87 -84
  850. package/docs/modules/notification.md +13 -13
  851. package/docs/modules/result.md +22 -22
  852. package/docs/proposals/navigation.md +32 -31
  853. package/docs/testing.md +34 -28
  854. package/docs/theming.md +67 -44
  855. package/package.json +100 -97
  856. package/templates/AGENTS.md +35 -25
  857. package/dist/atoms/button.d.ts +0 -11
  858. package/dist/atoms/button.d.ts.map +0 -1
  859. package/dist/atoms/icon.d.ts +0 -15
  860. package/dist/atoms/icon.d.ts.map +0 -1
  861. package/dist/atoms/index.d.ts +0 -5
  862. package/dist/atoms/index.d.ts.map +0 -1
  863. package/dist/atoms/index.js +0 -4
  864. package/dist/atoms/spinner.d.ts +0 -9
  865. package/dist/atoms/spinner.d.ts.map +0 -1
  866. package/dist/atoms/tooltip.d.ts +0 -18
  867. package/dist/atoms/tooltip.d.ts.map +0 -1
  868. package/dist/chunk-6UFMD6TK.js +0 -419
  869. package/dist/chunk-6UFMD6TK.js.map +0 -1
  870. package/dist/chunk-AA2TWJQI.js +0 -2186
  871. package/dist/chunk-AA2TWJQI.js.map +0 -1
  872. package/dist/chunk-ACLLDU3J.js +0 -888
  873. package/dist/chunk-ACLLDU3J.js.map +0 -1
  874. package/dist/chunk-DGCQWQLZ.js +0 -61
  875. package/dist/chunk-DGCQWQLZ.js.map +0 -1
  876. package/dist/chunk-E6ANX5YP.js +0 -1273
  877. package/dist/chunk-E6ANX5YP.js.map +0 -1
  878. package/dist/chunk-GDCVEINL.js +0 -408
  879. package/dist/chunk-GDCVEINL.js.map +0 -1
  880. package/dist/chunk-GN666KV5.js +0 -28
  881. package/dist/chunk-GN666KV5.js.map +0 -1
  882. package/dist/chunk-HCSDQEFB.js +0 -845
  883. package/dist/chunk-HCSDQEFB.js.map +0 -1
  884. package/dist/chunk-HMEWYAWU.js +0 -1889
  885. package/dist/chunk-HMEWYAWU.js.map +0 -1
  886. package/dist/chunk-I3IZUBBU.js +0 -97
  887. package/dist/chunk-I3IZUBBU.js.map +0 -1
  888. package/dist/chunk-JCZUCKI3.js +0 -27
  889. package/dist/chunk-JCZUCKI3.js.map +0 -1
  890. package/dist/chunk-MAGYFVKH.js +0 -67
  891. package/dist/chunk-MAGYFVKH.js.map +0 -1
  892. package/dist/chunk-NEBGCFE3.js +0 -521
  893. package/dist/chunk-NEBGCFE3.js.map +0 -1
  894. package/dist/chunk-NK2DQB3G.js +0 -306
  895. package/dist/chunk-NK2DQB3G.js.map +0 -1
  896. package/dist/chunk-QI3ALLIB.js +0 -38
  897. package/dist/chunk-QI3ALLIB.js.map +0 -1
  898. package/dist/chunk-QM2P6TIU.js +0 -353
  899. package/dist/chunk-QM2P6TIU.js.map +0 -1
  900. package/dist/chunk-RFP2DJAB.js +0 -658
  901. package/dist/chunk-RFP2DJAB.js.map +0 -1
  902. package/dist/chunk-SQ7XZMCN.js +0 -481
  903. package/dist/chunk-SQ7XZMCN.js.map +0 -1
  904. package/dist/chunk-TMTMQNEQ.js +0 -372
  905. package/dist/chunk-TMTMQNEQ.js.map +0 -1
  906. package/dist/chunk-VDNE3A7X.js +0 -9724
  907. package/dist/chunk-VDNE3A7X.js.map +0 -1
  908. package/dist/chunk-XATRMFGU.js +0 -139
  909. package/dist/chunk-XATRMFGU.js.map +0 -1
  910. package/dist/chunk-ZAP2YHZG.js +0 -454
  911. package/dist/chunk-ZAP2YHZG.js.map +0 -1
  912. package/dist/chunk-ZH5FUYPG.js +0 -349
  913. package/dist/chunk-ZH5FUYPG.js.map +0 -1
  914. package/dist/chunk-ZKM4RETZ.js +0 -51
  915. package/dist/chunk-ZKM4RETZ.js.map +0 -1
  916. package/dist/error/boundary.d.ts +0 -14
  917. package/dist/error/boundary.d.ts.map +0 -1
  918. package/dist/error/constants.d.ts +0 -18
  919. package/dist/error/constants.d.ts.map +0 -1
  920. package/dist/error/index.d.ts.map +0 -1
  921. package/dist/error/listener.d.ts +0 -2
  922. package/dist/error/listener.d.ts.map +0 -1
  923. package/dist/error/reporter.d.ts +0 -32
  924. package/dist/error/reporter.d.ts.map +0 -1
  925. package/dist/error/theme.d.ts +0 -3
  926. package/dist/error/theme.d.ts.map +0 -1
  927. package/dist/error/types.d.ts +0 -91
  928. package/dist/error/types.d.ts.map +0 -1
  929. package/dist/error/utils.d.ts +0 -21
  930. package/dist/error/utils.d.ts.map +0 -1
  931. package/dist/events.d.ts +0 -51
  932. package/dist/events.d.ts.map +0 -1
  933. package/dist/events.js +0 -82
  934. package/dist/events.js.map +0 -1
  935. package/dist/hooks/index.d.ts.map +0 -1
  936. package/dist/hooks/types.d.ts +0 -16
  937. package/dist/hooks/types.d.ts.map +0 -1
  938. package/dist/hooks/use-click-outside.d.ts +0 -3
  939. package/dist/hooks/use-click-outside.d.ts.map +0 -1
  940. package/dist/hooks/use-controllable-state.d.ts +0 -3
  941. package/dist/hooks/use-controllable-state.d.ts.map +0 -1
  942. package/dist/hooks/use-fullscreen-state.d.ts +0 -4
  943. package/dist/hooks/use-fullscreen-state.d.ts.map +0 -1
  944. package/dist/hooks/use-global-event.d.ts +0 -5
  945. package/dist/hooks/use-global-event.d.ts.map +0 -1
  946. package/dist/hooks/use-hotkey.d.ts +0 -4
  947. package/dist/hooks/use-hotkey.d.ts.map +0 -1
  948. package/dist/hooks/use-isomorphic-layout-effect.d.ts +0 -3
  949. package/dist/hooks/use-isomorphic-layout-effect.d.ts.map +0 -1
  950. package/dist/hooks/use-required-context.d.ts +0 -3
  951. package/dist/hooks/use-required-context.d.ts.map +0 -1
  952. package/dist/hooks/use-scroll-lock.d.ts +0 -3
  953. package/dist/hooks/use-scroll-lock.d.ts.map +0 -1
  954. package/dist/hooks/use-store.d.ts +0 -3
  955. package/dist/hooks/use-store.d.ts.map +0 -1
  956. package/dist/kernel/adapters.d.ts +0 -5
  957. package/dist/kernel/adapters.d.ts.map +0 -1
  958. package/dist/kernel/compose.d.ts +0 -15
  959. package/dist/kernel/compose.d.ts.map +0 -1
  960. package/dist/kernel/constants.d.ts +0 -12
  961. package/dist/kernel/constants.d.ts.map +0 -1
  962. package/dist/kernel/context-registry.d.ts +0 -3
  963. package/dist/kernel/context-registry.d.ts.map +0 -1
  964. package/dist/kernel/handlers.d.ts +0 -3
  965. package/dist/kernel/handlers.d.ts.map +0 -1
  966. package/dist/kernel/hooks.d.ts +0 -7
  967. package/dist/kernel/hooks.d.ts.map +0 -1
  968. package/dist/kernel/index.d.ts.map +0 -1
  969. package/dist/kernel/installed.d.ts +0 -21
  970. package/dist/kernel/installed.d.ts.map +0 -1
  971. package/dist/kernel/module.d.ts +0 -32
  972. package/dist/kernel/module.d.ts.map +0 -1
  973. package/dist/kernel/operations.d.ts +0 -21
  974. package/dist/kernel/operations.d.ts.map +0 -1
  975. package/dist/kernel/page-controller.d.ts +0 -8
  976. package/dist/kernel/page-controller.d.ts.map +0 -1
  977. package/dist/kernel/provider.d.ts +0 -18
  978. package/dist/kernel/provider.d.ts.map +0 -1
  979. package/dist/kernel/runtime.d.ts.map +0 -1
  980. package/dist/kernel/schema.d.ts +0 -11
  981. package/dist/kernel/schema.d.ts.map +0 -1
  982. package/dist/kernel/store.d.ts +0 -4
  983. package/dist/kernel/store.d.ts.map +0 -1
  984. package/dist/kernel/types.d.ts +0 -233
  985. package/dist/kernel/types.d.ts.map +0 -1
  986. package/dist/kernel/utils.d.ts +0 -18
  987. package/dist/kernel/utils.d.ts.map +0 -1
  988. package/dist/modules/ambient/index.js +0 -10
  989. package/dist/modules/ambient/server/index.js +0 -225
  990. package/dist/modules/ambient/server/index.js.map +0 -1
  991. package/dist/modules/ambient/worker/index.js +0 -122
  992. package/dist/modules/ambient/worker/index.js.map +0 -1
  993. package/dist/modules/background/index.js +0 -9
  994. package/dist/modules/background/overlay.d.ts +0 -135
  995. package/dist/modules/background/overlay.d.ts.map +0 -1
  996. package/dist/modules/background/playback.d.ts +0 -10
  997. package/dist/modules/background/playback.d.ts.map +0 -1
  998. package/dist/modules/background/state.d.ts +0 -9
  999. package/dist/modules/background/state.d.ts.map +0 -1
  1000. package/dist/modules/background/visual.d.ts +0 -48
  1001. package/dist/modules/background/visual.d.ts.map +0 -1
  1002. package/dist/modules/background/youtube/iframe.d.ts +0 -52
  1003. package/dist/modules/background/youtube/iframe.d.ts.map +0 -1
  1004. package/dist/modules/background/youtube/parse.d.ts +0 -17
  1005. package/dist/modules/background/youtube/parse.d.ts.map +0 -1
  1006. package/dist/modules/background/youtube/player.d.ts +0 -28
  1007. package/dist/modules/background/youtube/player.d.ts.map +0 -1
  1008. package/dist/modules/context-menu/index.js +0 -14
  1009. package/dist/modules/controls/index.js +0 -7
  1010. package/dist/modules/dock/cards.d.ts +0 -1722
  1011. package/dist/modules/dock/cards.d.ts.map +0 -1
  1012. package/dist/modules/dock/dom.d.ts +0 -24
  1013. package/dist/modules/dock/dom.d.ts.map +0 -1
  1014. package/dist/modules/dock/helpers.d.ts +0 -25
  1015. package/dist/modules/dock/helpers.d.ts.map +0 -1
  1016. package/dist/modules/dock/hooks.d.ts +0 -42
  1017. package/dist/modules/dock/hooks.d.ts.map +0 -1
  1018. package/dist/modules/dock/index.js +0 -13
  1019. package/dist/modules/dock/layout.d.ts +0 -26
  1020. package/dist/modules/dock/layout.d.ts.map +0 -1
  1021. package/dist/modules/dock/overlay.d.ts +0 -79
  1022. package/dist/modules/dock/overlay.d.ts.map +0 -1
  1023. package/dist/modules/dock/paths.d.ts +0 -10
  1024. package/dist/modules/dock/paths.d.ts.map +0 -1
  1025. package/dist/modules/dock/state.d.ts +0 -22
  1026. package/dist/modules/dock/state.d.ts.map +0 -1
  1027. package/dist/modules/dock/styles.d.ts +0 -900
  1028. package/dist/modules/dock/styles.d.ts.map +0 -1
  1029. package/dist/modules/dock/surface/hooks.d.ts +0 -110
  1030. package/dist/modules/dock/surface/hooks.d.ts.map +0 -1
  1031. package/dist/modules/dock/types.d.ts +0 -1274
  1032. package/dist/modules/dock/types.d.ts.map +0 -1
  1033. package/dist/modules/loading/index.js +0 -8
  1034. package/dist/modules/media/index.js +0 -6
  1035. package/dist/modules/modal/dom.d.ts +0 -4
  1036. package/dist/modules/modal/dom.d.ts.map +0 -1
  1037. package/dist/modules/modal/header.d.ts +0 -7
  1038. package/dist/modules/modal/header.d.ts.map +0 -1
  1039. package/dist/modules/modal/identity.d.ts +0 -7
  1040. package/dist/modules/modal/identity.d.ts.map +0 -1
  1041. package/dist/modules/modal/index.js +0 -11
  1042. package/dist/modules/modal/layout.d.ts +0 -13
  1043. package/dist/modules/modal/layout.d.ts.map +0 -1
  1044. package/dist/modules/modal/overlay.d.ts +0 -4
  1045. package/dist/modules/modal/overlay.d.ts.map +0 -1
  1046. package/dist/modules/modal/state.d.ts +0 -4
  1047. package/dist/modules/modal/state.d.ts.map +0 -1
  1048. package/dist/modules/navigation/constants.d.ts +0 -33
  1049. package/dist/modules/navigation/constants.d.ts.map +0 -1
  1050. package/dist/modules/navigation/index.js +0 -80
  1051. package/dist/modules/navigation/index.js.map +0 -1
  1052. package/dist/modules/navigation/navigator.d.ts +0 -3
  1053. package/dist/modules/navigation/navigator.d.ts.map +0 -1
  1054. package/dist/modules/navigation/settings.d.ts +0 -5
  1055. package/dist/modules/navigation/settings.d.ts.map +0 -1
  1056. package/dist/modules/navigation/state.d.ts +0 -19
  1057. package/dist/modules/navigation/state.d.ts.map +0 -1
  1058. package/dist/modules/navigation/types.d.ts +0 -118
  1059. package/dist/modules/navigation/types.d.ts.map +0 -1
  1060. package/dist/modules/navigation/utils.d.ts +0 -8
  1061. package/dist/modules/navigation/utils.d.ts.map +0 -1
  1062. package/dist/modules/notification/index.js +0 -7
  1063. package/dist/overlay-LTRZUZQD.js +0 -9
  1064. package/dist/overlay-LTRZUZQD.js.map +0 -1
  1065. package/dist/provider.d.ts +0 -23
  1066. package/dist/provider.d.ts.map +0 -1
  1067. package/dist/provider.js +0 -9
  1068. package/dist/provider.js.map +0 -1
  1069. package/dist/result.d.ts +0 -50
  1070. package/dist/result.d.ts.map +0 -1
  1071. package/dist/result.js +0 -102
  1072. package/dist/result.js.map +0 -1
  1073. package/dist/theme.d.ts +0 -46
  1074. package/dist/theme.d.ts.map +0 -1
  1075. package/dist/theme.js +0 -6
  1076. package/dist/theme.js.map +0 -1
  1077. package/dist/tokens/index.d.ts +0 -4
  1078. package/dist/tokens/index.d.ts.map +0 -1
  1079. package/dist/tokens/index.js +0 -297
  1080. package/dist/tokens/index.js.map +0 -1
  1081. package/dist/tokens/motion-config.d.ts +0 -35
  1082. package/dist/tokens/motion-config.d.ts.map +0 -1
  1083. package/dist/tokens/motion.d.ts +0 -164
  1084. package/dist/tokens/motion.d.ts.map +0 -1
  1085. package/dist/tokens/tokens.d.ts +0 -34
  1086. package/dist/tokens/tokens.d.ts.map +0 -1
  1087. package/dist/ui/carousel/carousel.d.ts +0 -24
  1088. package/dist/ui/carousel/carousel.d.ts.map +0 -1
  1089. package/dist/ui/carousel/track.d.ts +0 -11
  1090. package/dist/ui/carousel/track.d.ts.map +0 -1
  1091. package/dist/ui/carousel/use-drag-scroll.d.ts +0 -3
  1092. package/dist/ui/carousel/use-drag-scroll.d.ts.map +0 -1
  1093. package/dist/ui/cn.d.ts +0 -19
  1094. package/dist/ui/cn.d.ts.map +0 -1
  1095. package/dist/ui/components/avatar.d.ts +0 -14
  1096. package/dist/ui/components/avatar.d.ts.map +0 -1
  1097. package/dist/ui/components/button.d.ts +0 -9
  1098. package/dist/ui/components/button.d.ts.map +0 -1
  1099. package/dist/ui/components/checkbox.d.ts +0 -18
  1100. package/dist/ui/components/checkbox.d.ts.map +0 -1
  1101. package/dist/ui/components/icon.d.ts +0 -4
  1102. package/dist/ui/components/icon.d.ts.map +0 -1
  1103. package/dist/ui/components/image.d.ts +0 -13
  1104. package/dist/ui/components/image.d.ts.map +0 -1
  1105. package/dist/ui/components/indicator.d.ts +0 -37
  1106. package/dist/ui/components/indicator.d.ts.map +0 -1
  1107. package/dist/ui/components/input.d.ts +0 -15
  1108. package/dist/ui/components/input.d.ts.map +0 -1
  1109. package/dist/ui/components/loader.d.ts +0 -17
  1110. package/dist/ui/components/loader.d.ts.map +0 -1
  1111. package/dist/ui/components/segmented.d.ts +0 -21
  1112. package/dist/ui/components/segmented.d.ts.map +0 -1
  1113. package/dist/ui/components/select.d.ts +0 -34
  1114. package/dist/ui/components/select.d.ts.map +0 -1
  1115. package/dist/ui/components/skeleton.d.ts +0 -16
  1116. package/dist/ui/components/skeleton.d.ts.map +0 -1
  1117. package/dist/ui/components/switch.d.ts +0 -11
  1118. package/dist/ui/components/switch.d.ts.map +0 -1
  1119. package/dist/ui/components/tooltip.d.ts +0 -25
  1120. package/dist/ui/components/tooltip.d.ts.map +0 -1
  1121. package/dist/ui/defaults.d.ts +0 -250
  1122. package/dist/ui/defaults.d.ts.map +0 -1
  1123. package/dist/ui/define.d.ts +0 -112
  1124. package/dist/ui/define.d.ts.map +0 -1
  1125. package/dist/ui/index.d.ts.map +0 -1
  1126. package/dist/ui/provider.d.ts +0 -11
  1127. package/dist/ui/provider.d.ts.map +0 -1
  1128. package/dist/ui/recipe.d.ts +0 -70
  1129. package/dist/ui/recipe.d.ts.map +0 -1
  1130. package/dist/ui/recipes.d.ts +0 -9
  1131. package/dist/ui/recipes.d.ts.map +0 -1
  1132. package/dist/ui/recipes.js +0 -648
  1133. package/dist/ui/recipes.js.map +0 -1
  1134. package/dist/ui/split.d.ts +0 -4
  1135. package/dist/ui/split.d.ts.map +0 -1
  1136. package/dist/ui/tones.d.ts +0 -23
  1137. package/dist/ui/tones.d.ts.map +0 -1
  1138. package/dist/utils/cn.d.ts +0 -3
  1139. package/dist/utils/cn.d.ts.map +0 -1
  1140. package/dist/utils/dom.d.ts +0 -5
  1141. package/dist/utils/dom.d.ts.map +0 -1
  1142. package/dist/utils/index.d.ts.map +0 -1
  1143. package/dist/utils/number.d.ts +0 -3
  1144. package/dist/utils/number.d.ts.map +0 -1
  1145. package/dist/utils/object.d.ts +0 -5
  1146. package/dist/utils/object.d.ts.map +0 -1
  1147. package/dist/utils/report.d.ts +0 -5
  1148. package/dist/utils/report.d.ts.map +0 -1
  1149. package/dist/utils/scheduler.d.ts +0 -34
  1150. package/dist/utils/scheduler.d.ts.map +0 -1
  1151. package/dist/utils/store.d.ts +0 -11
  1152. package/dist/utils/store.d.ts.map +0 -1
  1153. package/dist/utils/string.d.ts +0 -5
  1154. package/dist/utils/string.d.ts.map +0 -1
  1155. package/dist/utils/timing.d.ts +0 -7
  1156. package/dist/utils/timing.d.ts.map +0 -1
  1157. package/dist/utils/user-message.d.ts +0 -20
  1158. package/dist/utils/user-message.d.ts.map +0 -1
  1159. package/docs/ui.md +0 -183
  1160. package/styles/effects.css +0 -219
  1161. package/styles/index.css +0 -8
  1162. package/styles/interaction.css +0 -273
  1163. package/styles/palette.css +0 -81
  1164. package/styles/time.css +0 -26
  1165. package/styles/tokens.css +0 -114
  1166. package/styles/utilities.css +0 -110
  1167. package/templates/motion/background.ts +0 -15
  1168. package/templates/motion/context-menu.ts +0 -65
  1169. package/templates/motion/dock.ts +0 -421
  1170. package/templates/motion/modal.ts +0 -82
  1171. package/templates/motion/notification.ts +0 -26
  1172. package/templates/motion/tokens.ts +0 -36
  1173. /package/dist/{atoms → ambient}/index.js.map +0 -0
  1174. /package/dist/{modules/ambient → background}/index.js.map +0 -0
  1175. /package/dist/{modules/background → context-menu}/index.js.map +0 -0
  1176. /package/dist/{modules/context-menu → controls}/index.js.map +0 -0
  1177. /package/dist/{kernel → core/kernel}/runtime.d.ts +0 -0
  1178. /package/dist/{modules/controls → dock}/index.js.map +0 -0
  1179. /package/dist/{modules/dock → loading}/index.js.map +0 -0
  1180. /package/dist/{modules/loading → media}/index.js.map +0 -0
  1181. /package/dist/{modules/media → notification}/index.js.map +0 -0
  1182. /package/dist/{modules/modal → provider}/index.js.map +0 -0
  1183. /package/dist/{modules/notification → theme}/index.js.map +0 -0
@@ -0,0 +1,3488 @@
1
+ import { useOptionalMediaActions } from './chunk-WXEOP6Z4.js';
2
+ import { defineModule, useRegistryValue, useModuleRegistration } from './chunk-NHOJWICA.js';
3
+ import { useStore, useRequiredContext } from './chunk-Y2Q74PJP.js';
4
+ import { Spinner } from './chunk-CT4UILO2.js';
5
+ import { cn } from './chunk-7RSRDKYE.js';
6
+ import { defineThemeSpec, useTheme, useMotionTokens, useModuleMotion } from './chunk-ESD5EQ5H.js';
7
+ import { createStore, cssEasing, report } from './chunk-5H6FZW3N.js';
8
+ import { getOrCreateGlobalContext } from './chunk-J3VTDBC6.js';
9
+ import { retime } from './chunk-BMFHS3GV.js';
10
+ import { c } from 'react/compiler-runtime';
11
+ import { motion, AnimatePresence } from 'motion/react';
12
+ import { useState, useLayoutEffect, useEffect, use, useRef, useCallback } from 'react';
13
+ import { usePathname } from 'next/navigation';
14
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
15
+
16
+ // src/modules/background/constants.ts
17
+ var backgroundTheme = defineThemeSpec("background");
18
+ var BACKGROUND_REGISTRY_KEY = "page-background";
19
+ var BACKGROUND_MEDIA_ID = "background";
20
+ var DEFAULT_AUDIBLE_VOLUME = 0.8;
21
+ var PROXY_UNMUTE_VOLUME = 0.7;
22
+ function useBackgroundMediaSource(state, actions) {
23
+ const $ = c(11);
24
+ const media = useOptionalMediaActions();
25
+ const {
26
+ isPlaying,
27
+ isVideo,
28
+ videoElement
29
+ } = state;
30
+ const isLoop = Boolean(state.videoOptions?.loop);
31
+ let t0;
32
+ let t1;
33
+ if ($[0] !== actions || $[1] !== isLoop || $[2] !== isPlaying || $[3] !== isVideo || $[4] !== media || $[5] !== videoElement) {
34
+ t0 = () => {
35
+ if (!isVideo) {
36
+ media.removeSource(BACKGROUND_MEDIA_ID);
37
+ return;
38
+ }
39
+ media.upsertSource({
40
+ controls: {
41
+ setMuted: actions.setVideoMuted,
42
+ toggle: actions.toggleVideo,
43
+ toggleLoop: actions.toggleLoop
44
+ },
45
+ element: videoElement ?? null,
46
+ id: BACKGROUND_MEDIA_ID,
47
+ isPlaying,
48
+ kind: "video",
49
+ loop: isLoop
50
+ });
51
+ };
52
+ t1 = [actions, isLoop, isPlaying, isVideo, media, videoElement];
53
+ $[0] = actions;
54
+ $[1] = isLoop;
55
+ $[2] = isPlaying;
56
+ $[3] = isVideo;
57
+ $[4] = media;
58
+ $[5] = videoElement;
59
+ $[6] = t0;
60
+ $[7] = t1;
61
+ } else {
62
+ t0 = $[6];
63
+ t1 = $[7];
64
+ }
65
+ useEffect(t0, t1);
66
+ let t2;
67
+ let t3;
68
+ if ($[8] !== media) {
69
+ t2 = () => () => media.removeSource(BACKGROUND_MEDIA_ID);
70
+ t3 = [media];
71
+ $[8] = media;
72
+ $[9] = t2;
73
+ $[10] = t3;
74
+ } else {
75
+ t2 = $[9];
76
+ t3 = $[10];
77
+ }
78
+ useEffect(t2, t3);
79
+ }
80
+
81
+ // src/modules/background/youtube/lib/parse.ts
82
+ var YOUTUBE_ID_PATTERN = /^[a-zA-Z0-9_-]{11}$/;
83
+ function parseYouTubeTimeParam(value) {
84
+ if (value === void 0 || value === null || value === "") return 0;
85
+ if (typeof value === "number") {
86
+ return Number.isFinite(value) && value >= 0 ? value : 0;
87
+ }
88
+ const trimmed = String(value).trim().toLowerCase();
89
+ if (!trimmed) return 0;
90
+ if (/^\d+(\.\d+)?$/.test(trimmed)) {
91
+ return Math.max(0, parseFloat(trimmed));
92
+ }
93
+ const hmsMatch = /^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+(?:\.\d+)?)s?)?$/.exec(trimmed);
94
+ if (hmsMatch && (hmsMatch[1] || hmsMatch[2] || hmsMatch[3])) {
95
+ const hours = parseInt(hmsMatch[1] || "0", 10);
96
+ const minutes = parseInt(hmsMatch[2] || "0", 10);
97
+ const seconds = parseFloat(hmsMatch[3] || "0");
98
+ return Math.max(0, hours * 3600 + minutes * 60 + seconds);
99
+ }
100
+ return 0;
101
+ }
102
+ var YOUTUBE_HOST_PATH = /^(?:www\.|m\.|music\.)?(?:youtube\.com|youtu\.be|youtube-nocookie\.com)\//i;
103
+ function toUrl(input, {
104
+ youtubeOnly = false
105
+ } = {}) {
106
+ let candidate = null;
107
+ if (/^https?:\/\//.test(input)) candidate = input;
108
+ else if (input.startsWith("//")) candidate = `https:${input}`;
109
+ else if (!youtubeOnly || YOUTUBE_HOST_PATH.test(input)) {
110
+ candidate = `https://${input}`;
111
+ }
112
+ try {
113
+ return candidate ? new URL(candidate) : null;
114
+ } catch {
115
+ return null;
116
+ }
117
+ }
118
+ function getIdFromUrl(url) {
119
+ const host = url.hostname.replace(/^(www\.|m\.|music\.)/i, "").toLowerCase();
120
+ const segments = url.pathname.split("/").filter(Boolean);
121
+ if (host === "youtu.be") {
122
+ return YOUTUBE_ID_PATTERN.test(segments[0] ?? "") ? segments[0] : null;
123
+ }
124
+ if (host !== "youtube.com" && host !== "youtube-nocookie.com" && !host.endsWith(".youtube.com")) {
125
+ return null;
126
+ }
127
+ const fromQuery = url.searchParams.get("v") || url.searchParams.get("vi");
128
+ if (fromQuery && YOUTUBE_ID_PATTERN.test(fromQuery)) return fromQuery;
129
+ const isVideoPath = segments.length >= 2 && ["embed", "shorts", "live", "v", "e", "watch"].includes(segments[0].toLowerCase());
130
+ return isVideoPath && YOUTUBE_ID_PATTERN.test(segments[1]) ? segments[1] : null;
131
+ }
132
+ function extractYouTubeVideoId(input, options = {}) {
133
+ const trimmed = typeof input === "string" ? input.trim() : "";
134
+ if (!trimmed) return null;
135
+ if (options.allowBareId && YOUTUBE_ID_PATTERN.test(trimmed)) return trimmed;
136
+ const prefixed = /^(?:youtube|yt):([a-zA-Z0-9_-]{11})$/i.exec(trimmed);
137
+ if (prefixed) return prefixed[1];
138
+ const url = toUrl(trimmed, {
139
+ youtubeOnly: true
140
+ });
141
+ return url ? getIdFromUrl(url) : null;
142
+ }
143
+ function isYouTubeUrl(input) {
144
+ return Boolean(extractYouTubeVideoId(input));
145
+ }
146
+ function isDirectVideoUrl(input) {
147
+ if (!input || typeof input !== "string") return false;
148
+ const trimmed = input.trim();
149
+ if (!trimmed) return false;
150
+ if (isYouTubeUrl(trimmed)) return true;
151
+ if (trimmed.startsWith("/api/background/youtube") || trimmed.startsWith("blob:")) {
152
+ return true;
153
+ }
154
+ const cleanPath = trimmed.split("?")[0].split("#")[0].toLowerCase();
155
+ return /\.(mp4|webm|mov|m4v|ogg|ogv|m3u8)$/i.test(cleanPath);
156
+ }
157
+ function parseYouTubeUrlConfig(input, options = {}) {
158
+ const videoId = extractYouTubeVideoId(input, options);
159
+ if (!videoId || !input) return null;
160
+ const params = toUrl(input.trim())?.searchParams;
161
+ return {
162
+ endTime: parseYouTubeTimeParam(params?.get("end")),
163
+ listId: params?.get("list") || null,
164
+ rawUrl: input,
165
+ startTime: parseYouTubeTimeParam(params?.get("t") || params?.get("start")),
166
+ videoId
167
+ };
168
+ }
169
+ function getYouTubeStreamUrl(videoId, options = {}) {
170
+ const params = new URLSearchParams();
171
+ params.set("id", videoId);
172
+ params.set("stream", options.stream || "video");
173
+ if (options.quality) params.set("quality", options.quality);
174
+ if (options.codec) params.set("codec", options.codec);
175
+ return `/api/background/youtube?${params.toString()}`;
176
+ }
177
+ function getYouTubeThumbnailUrl(videoId, proxied = true) {
178
+ if (proxied) {
179
+ return `/api/background/youtube?id=${encodeURIComponent(videoId)}&stream=thumbnail`;
180
+ }
181
+ return `https://i.ytimg.com/vi/${encodeURIComponent(videoId)}/maxresdefault.jpg`;
182
+ }
183
+ function createYouTubeVideoElementProxy(controller) {
184
+ const proxyVideo = document.createElement("video");
185
+ Object.defineProperties(proxyVideo, {
186
+ currentTime: {
187
+ configurable: true,
188
+ get: () => controller.getCurrentTime(),
189
+ set: (value) => {
190
+ controller.seekTo(Number(value) || 0);
191
+ proxyVideo.dispatchEvent(new Event("timeupdate"));
192
+ }
193
+ },
194
+ duration: {
195
+ configurable: true,
196
+ get: () => controller.getDuration()
197
+ },
198
+ loop: {
199
+ configurable: true,
200
+ get: () => controller.getLoop(),
201
+ set: (value) => {
202
+ controller.setLoop(Boolean(value));
203
+ }
204
+ },
205
+ muted: {
206
+ configurable: true,
207
+ get: () => controller.getMuted(),
208
+ set: (value) => {
209
+ controller.setMuted(Boolean(value));
210
+ proxyVideo.dispatchEvent(new Event("volumechange"));
211
+ }
212
+ },
213
+ pause: {
214
+ configurable: true,
215
+ value: () => {
216
+ controller.pause();
217
+ proxyVideo.dispatchEvent(new Event("pause"));
218
+ }
219
+ },
220
+ paused: {
221
+ configurable: true,
222
+ get: () => controller.getPaused()
223
+ },
224
+ play: {
225
+ configurable: true,
226
+ value: () => controller.play().then(() => {
227
+ proxyVideo.dispatchEvent(new Event("play"));
228
+ proxyVideo.dispatchEvent(new Event("playing"));
229
+ })
230
+ },
231
+ playbackRate: {
232
+ configurable: true,
233
+ get: () => controller.getPlaybackRate(),
234
+ set: (value) => {
235
+ controller.setPlaybackRate(Number(value) || 1);
236
+ proxyVideo.dispatchEvent(new Event("ratechange"));
237
+ }
238
+ },
239
+ volume: {
240
+ configurable: true,
241
+ get: () => controller.getVolume(),
242
+ set: (value) => {
243
+ const clamped = Math.max(0, Math.min(1, Number(value) || 0));
244
+ controller.setVolume(clamped);
245
+ proxyVideo.dispatchEvent(new Event("volumechange"));
246
+ }
247
+ }
248
+ });
249
+ return proxyVideo;
250
+ }
251
+
252
+ // src/modules/background/model/state.ts
253
+ var DEFAULT_BACKGROUND = Object.freeze({
254
+ animation: null,
255
+ className: "",
256
+ fadeEdges: null,
257
+ fit: null,
258
+ image: null,
259
+ imageStyle: {},
260
+ isPlaying: false,
261
+ noiseStyle: {},
262
+ overlay: false,
263
+ overlayColor: "currentColor",
264
+ overlayOpacity: 0,
265
+ position: "center",
266
+ video: null,
267
+ videoClassName: "",
268
+ videoElement: null,
269
+ videoOptions: {
270
+ autoplay: true,
271
+ className: "",
272
+ corp: 0,
273
+ loop: false,
274
+ muted: true,
275
+ playbackRate: 1,
276
+ width: null
277
+ },
278
+ videoStyle: {},
279
+ width: null
280
+ });
281
+ var DEFAULT_BACKGROUND_COMPUTED = Object.freeze({
282
+ ...DEFAULT_BACKGROUND,
283
+ hasBackground: false,
284
+ isVideo: false,
285
+ isYouTube: false,
286
+ posterUrl: null,
287
+ youtubeVideoId: null
288
+ });
289
+ var INERT_BACKGROUND_ACTIONS = Object.freeze({
290
+ resetBackground: () => {
291
+ },
292
+ setBackground: () => {
293
+ },
294
+ setVideoElement: () => {
295
+ },
296
+ setVideoMuted: () => {
297
+ },
298
+ setVideoPlaying: () => {
299
+ },
300
+ toggleLoop: () => {
301
+ },
302
+ toggleMute: () => {
303
+ },
304
+ toggleVideo: () => {
305
+ }
306
+ });
307
+ function normalizeBackgroundInput(patch = {}) {
308
+ if (!patch) return {};
309
+ if (typeof patch === "string") {
310
+ const trimmed = patch.trim();
311
+ if (isYouTubeUrl(trimmed) || isDirectVideoUrl(trimmed)) {
312
+ return {
313
+ image: null,
314
+ video: trimmed
315
+ };
316
+ }
317
+ return {
318
+ image: trimmed
319
+ };
320
+ }
321
+ const nextPatch = {
322
+ ...patch
323
+ };
324
+ if (typeof nextPatch.image === "string" && isYouTubeUrl(nextPatch.image) && !nextPatch.video) {
325
+ nextPatch.video = nextPatch.image;
326
+ nextPatch.image = null;
327
+ }
328
+ return nextPatch;
329
+ }
330
+ function resolveIsPlaying(baseState, patch, shouldAutoPlay) {
331
+ if (patch.isPlaying !== void 0) return patch.isPlaying;
332
+ if (patch.video !== void 0 && Boolean(patch.video)) return shouldAutoPlay;
333
+ return baseState.isPlaying;
334
+ }
335
+ function mergeAnimation(base, patch) {
336
+ if (patch === void 0) return base;
337
+ if (!patch) return patch;
338
+ return {
339
+ ...base || {},
340
+ ...patch
341
+ };
342
+ }
343
+ function mergeBackgroundState(baseState, patch = {}) {
344
+ const resolvedPatch = normalizeBackgroundInput(patch);
345
+ const nextVideoOptions = {
346
+ ...baseState.videoOptions,
347
+ ...resolvedPatch.videoOptions || {}
348
+ };
349
+ const shouldAutoPlay = nextVideoOptions.autoplay !== false;
350
+ const resolvedIsPlaying = resolveIsPlaying(baseState, resolvedPatch, shouldAutoPlay);
351
+ return {
352
+ ...baseState,
353
+ ...resolvedPatch,
354
+ isPlaying: resolvedIsPlaying,
355
+ animation: mergeAnimation(baseState.animation, resolvedPatch.animation),
356
+ imageStyle: {
357
+ ...baseState.imageStyle,
358
+ ...resolvedPatch.imageStyle || {}
359
+ },
360
+ noiseStyle: {
361
+ ...baseState.noiseStyle,
362
+ ...resolvedPatch.noiseStyle || {}
363
+ },
364
+ videoOptions: nextVideoOptions,
365
+ videoStyle: {
366
+ ...baseState.videoStyle,
367
+ ...resolvedPatch.videoStyle || {}
368
+ }
369
+ };
370
+ }
371
+ function resolveBackgroundState(registryBackground, override, pathname) {
372
+ const base = registryBackground ? mergeBackgroundState(DEFAULT_BACKGROUND, registryBackground) : DEFAULT_BACKGROUND;
373
+ const patch = override.pathname === pathname ? override.patch : null;
374
+ return patch ? mergeBackgroundState(base, patch) : base;
375
+ }
376
+ function computeBackgroundState(background) {
377
+ const youtubeVideoId = extractYouTubeVideoId(background.video);
378
+ const isYouTube = Boolean(youtubeVideoId);
379
+ const isVideo = Boolean(background.video || isYouTube);
380
+ return {
381
+ ...background,
382
+ hasBackground: Boolean(background.image || isVideo || background.color || background.overlay || background.noiseStyle && (background.noiseStyle.opacity === void 0 || (background.noiseStyle.opacity ?? 0) > 0)),
383
+ isVideo,
384
+ isYouTube,
385
+ posterUrl: youtubeVideoId ? getYouTubeThumbnailUrl(youtubeVideoId) : null,
386
+ youtubeVideoId
387
+ };
388
+ }
389
+
390
+ // src/modules/background/model/override.ts
391
+ function mergeOverridePatch(currentPatch, nextPatch) {
392
+ return {
393
+ ...currentPatch || {},
394
+ ...nextPatch,
395
+ ...currentPatch?.videoOptions || nextPatch.videoOptions ? {
396
+ videoOptions: {
397
+ ...currentPatch?.videoOptions || {},
398
+ ...nextPatch.videoOptions || {}
399
+ }
400
+ } : {}
401
+ };
402
+ }
403
+ function applyOverrideUpdate(prev, inputs, updater) {
404
+ const {
405
+ pathname: currentPath,
406
+ registryBackground: registry
407
+ } = inputs;
408
+ const currentPatch = prev.pathname === currentPath ? prev.patch : null;
409
+ const rawNext = updater(resolveBackgroundState(registry, prev, currentPath));
410
+ if (!rawNext || Object.keys(rawNext).length === 0) return prev;
411
+ const normalizedNext = normalizeBackgroundInput(rawNext);
412
+ return {
413
+ patch: mergeOverridePatch(currentPatch, normalizedNext),
414
+ pathname: currentPath
415
+ };
416
+ }
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
+ var BackgroundContext = getOrCreateGlobalContext("BackgroundContext", null);
490
+ function useSafePathname() {
491
+ try {
492
+ return usePathname();
493
+ } catch {
494
+ return null;
495
+ }
496
+ }
497
+ function createBackground(initial) {
498
+ let inputs = initial;
499
+ let videoElement = null;
500
+ let last = null;
501
+ const overrideStore = createStore({
502
+ patch: null,
503
+ pathname: initial.pathname
504
+ }, {
505
+ freezeSnapshots: false
506
+ });
507
+ const resolveState = (registryBackground, scopedOverride, pathname) => {
508
+ if (last && last.pathname === pathname && last.registryBackground === registryBackground && last.scopedOverride === scopedOverride) {
509
+ return last.state;
510
+ }
511
+ const state = computeBackgroundState(resolveBackgroundState(registryBackground, scopedOverride, pathname));
512
+ last = {
513
+ pathname,
514
+ registryBackground,
515
+ scopedOverride,
516
+ state
517
+ };
518
+ return state;
519
+ };
520
+ const stateStore = createStore(resolveState(initial.registryBackground, overrideStore.getSnapshot(), initial.pathname), {
521
+ freezeSnapshots: false
522
+ });
523
+ const readCurrent = () => resolveBackgroundState(inputs.registryBackground, overrideStore.getSnapshot(), inputs.pathname);
524
+ const updatePatch = (updater) => {
525
+ overrideStore.publish((prev) => applyOverrideUpdate(prev, inputs, updater));
526
+ };
527
+ const currentVideoElement = (current) => videoElement || current.videoElement;
528
+ const actions = {
529
+ resetBackground: () => {
530
+ overrideStore.publish({
531
+ patch: null,
532
+ pathname: inputs.pathname
533
+ });
534
+ },
535
+ setBackground: (nextBackground) => {
536
+ updatePatch(() => normalizeBackgroundInput(nextBackground));
537
+ },
538
+ setVideoElement: (element) => {
539
+ videoElement = element;
540
+ updatePatch((cur) => cur.videoElement === element ? {} : {
541
+ videoElement: element
542
+ });
543
+ },
544
+ setVideoMuted: (muted) => {
545
+ const nextMuted = Boolean(muted);
546
+ syncVideoMutedDirect(currentVideoElement(readCurrent()), nextMuted);
547
+ updatePatch((cur) => {
548
+ if (cur.videoOptions?.muted === nextMuted) return {};
549
+ return {
550
+ videoOptions: {
551
+ ...cur.videoOptions,
552
+ muted: nextMuted
553
+ }
554
+ };
555
+ });
556
+ },
557
+ setVideoPlaying: (isPlaying) => {
558
+ updatePatch((cur) => cur.isPlaying === isPlaying ? {} : {
559
+ isPlaying
560
+ });
561
+ },
562
+ toggleLoop: () => {
563
+ const current = readCurrent();
564
+ const nextLoop = !current.videoOptions?.loop;
565
+ syncVideoLoopDirect(currentVideoElement(current), nextLoop);
566
+ updatePatch((cur) => ({
567
+ videoOptions: {
568
+ ...cur.videoOptions,
569
+ loop: nextLoop
570
+ }
571
+ }));
572
+ },
573
+ toggleMute: () => {
574
+ const current = readCurrent();
575
+ const nextMuted = !current.videoOptions?.muted;
576
+ syncVideoMutedDirect(currentVideoElement(current), nextMuted);
577
+ updatePatch((cur) => ({
578
+ isPlaying: nextMuted ? cur.isPlaying : true,
579
+ videoOptions: {
580
+ ...cur.videoOptions,
581
+ muted: nextMuted
582
+ }
583
+ }));
584
+ },
585
+ toggleVideo: () => {
586
+ const current = readCurrent();
587
+ const videoEl = currentVideoElement(current);
588
+ const domIsActuallyPlaying = isElementPlaying(videoEl, current.isPlaying);
589
+ const nextPlaying = !domIsActuallyPlaying;
590
+ const configuredMuted = Boolean(current.videoOptions?.muted);
591
+ triggerVideoPlaybackDirect(videoEl, nextPlaying, configuredMuted);
592
+ updatePatch(() => ({
593
+ isPlaying: nextPlaying
594
+ }));
595
+ }
596
+ };
597
+ return {
598
+ overrideStore,
599
+ resolveState,
600
+ setInputs: (next) => {
601
+ inputs = next;
602
+ },
603
+ value: {
604
+ actions,
605
+ store: stateStore
606
+ }
607
+ };
608
+ }
609
+ function BackgroundProvider(t0) {
610
+ const $ = c(20);
611
+ const {
612
+ children
613
+ } = t0;
614
+ const pathname = useSafePathname();
615
+ const registryBackground = useRegistryValue("background", BACKGROUND_REGISTRY_KEY) ?? null;
616
+ let t1;
617
+ if ($[0] !== pathname || $[1] !== registryBackground) {
618
+ t1 = () => createBackground({
619
+ pathname,
620
+ registryBackground
621
+ });
622
+ $[0] = pathname;
623
+ $[1] = registryBackground;
624
+ $[2] = t1;
625
+ } else {
626
+ t1 = $[2];
627
+ }
628
+ const [t2] = useState(t1);
629
+ const {
630
+ overrideStore,
631
+ resolveState,
632
+ setInputs,
633
+ value
634
+ } = t2;
635
+ const scopedOverride = useStore(overrideStore);
636
+ let t3;
637
+ let t4;
638
+ if ($[3] !== pathname || $[4] !== registryBackground || $[5] !== setInputs) {
639
+ t3 = () => {
640
+ setInputs({
641
+ pathname,
642
+ registryBackground
643
+ });
644
+ };
645
+ t4 = [pathname, registryBackground, setInputs];
646
+ $[3] = pathname;
647
+ $[4] = registryBackground;
648
+ $[5] = setInputs;
649
+ $[6] = t3;
650
+ $[7] = t4;
651
+ } else {
652
+ t3 = $[6];
653
+ t4 = $[7];
654
+ }
655
+ useLayoutEffect(t3, t4);
656
+ let t5;
657
+ if ($[8] !== pathname || $[9] !== registryBackground || $[10] !== resolveState || $[11] !== scopedOverride) {
658
+ t5 = resolveState(registryBackground, scopedOverride, pathname);
659
+ $[8] = pathname;
660
+ $[9] = registryBackground;
661
+ $[10] = resolveState;
662
+ $[11] = scopedOverride;
663
+ $[12] = t5;
664
+ } else {
665
+ t5 = $[12];
666
+ }
667
+ const state = t5;
668
+ const {
669
+ actions,
670
+ store
671
+ } = value;
672
+ let t6;
673
+ let t7;
674
+ if ($[13] !== state || $[14] !== store) {
675
+ t6 = () => {
676
+ store.publish(state);
677
+ };
678
+ t7 = [state, store];
679
+ $[13] = state;
680
+ $[14] = store;
681
+ $[15] = t6;
682
+ $[16] = t7;
683
+ } else {
684
+ t6 = $[15];
685
+ t7 = $[16];
686
+ }
687
+ useLayoutEffect(t6, t7);
688
+ useBackgroundMediaSource(state, actions);
689
+ let t8;
690
+ if ($[17] !== children || $[18] !== value) {
691
+ t8 = /* @__PURE__ */ jsx(BackgroundContext, { value, children });
692
+ $[17] = children;
693
+ $[18] = value;
694
+ $[19] = t8;
695
+ } else {
696
+ t8 = $[19];
697
+ }
698
+ return t8;
699
+ }
700
+
701
+ // src/modules/background/hooks.ts
702
+ var NOOP_BACKGROUND_STORE = createStore(DEFAULT_BACKGROUND_COMPUTED);
703
+ function useBackgroundRegistration(config, options) {
704
+ useModuleRegistration("background", config, options);
705
+ }
706
+ function useBackgroundState() {
707
+ const {
708
+ store
709
+ } = useRequiredContext(BackgroundContext, "useBackgroundState", "BackgroundProvider");
710
+ return useStore(store);
711
+ }
712
+ function useBackgroundActions() {
713
+ return useRequiredContext(BackgroundContext, "useBackgroundActions", "BackgroundProvider").actions;
714
+ }
715
+ function useBackground(config, options) {
716
+ const $ = c(3);
717
+ useBackgroundRegistration(config, options);
718
+ const actions = useBackgroundActions();
719
+ const state = useBackgroundState();
720
+ let t0;
721
+ if ($[0] !== actions || $[1] !== state) {
722
+ t0 = {
723
+ ...state,
724
+ ...actions
725
+ };
726
+ $[0] = actions;
727
+ $[1] = state;
728
+ $[2] = t0;
729
+ } else {
730
+ t0 = $[2];
731
+ }
732
+ return t0;
733
+ }
734
+ function useOptionalBackgroundState(selector, isEqual) {
735
+ const ctx = use(BackgroundContext);
736
+ return useStore(ctx?.store ?? NOOP_BACKGROUND_STORE, selector, isEqual);
737
+ }
738
+ function useOptionalBackgroundActions() {
739
+ const ctx = use(BackgroundContext);
740
+ return ctx?.actions ?? INERT_BACKGROUND_ACTIONS;
741
+ }
742
+
743
+ // src/modules/background/model/visual.ts
744
+ var objectFit = (value) => ({
745
+ objectFit: value
746
+ });
747
+ var objectPosition = (value) => ({
748
+ objectPosition: value
749
+ });
750
+ var BG_TOKEN_TO_OBJECT_STYLE = Object.freeze({
751
+ "bg-bottom": objectPosition("bottom"),
752
+ "bg-center": objectPosition("center"),
753
+ "bg-contain": objectFit("contain"),
754
+ "bg-cover": objectFit("cover"),
755
+ "bg-fill": objectFit("fill"),
756
+ "bg-left": objectPosition("left"),
757
+ "bg-left-bottom": objectPosition("left bottom"),
758
+ "bg-left-top": objectPosition("left top"),
759
+ "bg-none": objectFit("none"),
760
+ "bg-right": objectPosition("right"),
761
+ "bg-right-bottom": objectPosition("right bottom"),
762
+ "bg-right-top": objectPosition("right top"),
763
+ "bg-scale-down": objectFit("scale-down"),
764
+ "bg-top": objectPosition("top")
765
+ });
766
+ var OBJECT_FITS = Object.freeze(["contain", "cover", "fill", "none", "scale-down"]);
767
+ var DEFAULT_COLOR = "currentColor";
768
+ var WIDTH_CLASS = /^(w-|max-w-|min-w-)/;
769
+ function resolveVideoClassNames(...inputs) {
770
+ const tokens = inputs.flatMap((input) => typeof input === "string" ? input.replace(/,/g, " ").split(/\s+/) : []).filter(Boolean);
771
+ return {
772
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- the Object.assign spread overload is typed any
773
+ objectStyle: Object.assign({}, ...tokens.map((token) => BG_TOKEN_TO_OBJECT_STYLE[token])),
774
+ other: tokens.filter((token) => !WIDTH_CLASS.test(token)).join(" "),
775
+ width: tokens.filter((token) => WIDTH_CLASS.test(token)).join(" ")
776
+ };
777
+ }
778
+ function resolveVideoOptions(options = {}) {
779
+ return {
780
+ codec: options.codec || "auto",
781
+ corp: options.corp ?? 0,
782
+ forceIframe: Boolean(options.forceIframe),
783
+ isLoop: options.loop ?? false,
784
+ isMuted: options.muted ?? true,
785
+ playbackRate: options.playbackRate ?? 1,
786
+ quality: options.quality || "1080p",
787
+ shouldAutoPlay: options.autoplay ?? true,
788
+ showPoster: Boolean(options.showPoster),
789
+ showSpinner: options.showSpinner !== false
790
+ };
791
+ }
792
+ var generateBaseGradient = (direction, color) => {
793
+ const to = direction === "left" ? "to right" : "to left";
794
+ return `linear-gradient(${to}, ${color} 0%, color-mix(in srgb, ${color} 85%, transparent) 15%, color-mix(in srgb, ${color} 50%, transparent) 45%, color-mix(in srgb, ${color} 18%, transparent) 75%, transparent 100%)`;
795
+ };
796
+ var generateEdgeGradient = (direction, color) => {
797
+ const to = direction === "left" ? "to right" : "to left";
798
+ return `linear-gradient(${to}, color-mix(in srgb, ${color} 95%, transparent) 0%, color-mix(in srgb, ${color} 70%, transparent) 25%, color-mix(in srgb, ${color} 35%, transparent) 55%, color-mix(in srgb, ${color} 10%, transparent) 80%, transparent 100%)`;
799
+ };
800
+ function getVisualStyle(currentStyle = {}) {
801
+ const {
802
+ className: _className,
803
+ leftGradient = 0,
804
+ rightGradient = 0,
805
+ ...baseStyle
806
+ } = currentStyle;
807
+ return {
808
+ baseStyle,
809
+ leftGradient: Number(leftGradient) || 0,
810
+ rightGradient: Number(rightGradient) || 0
811
+ };
812
+ }
813
+ function resolveGradientSettings({
814
+ fadeEdges = null,
815
+ hasWidth = false,
816
+ leftGradient = 0,
817
+ rightGradient = 0
818
+ }) {
819
+ let leftPercent = 0;
820
+ let rightPercent = 0;
821
+ if (leftGradient > 0) leftPercent = Math.min(48, Math.max(12, leftGradient * 7.5));
822
+ else if (hasWidth && fadeEdges !== false) leftPercent = 20;
823
+ if (rightGradient > 0) rightPercent = Math.min(48, Math.max(12, rightGradient * 7.5));
824
+ else if (hasWidth && fadeEdges !== false) rightPercent = 20;
825
+ if (typeof fadeEdges === "number") {
826
+ leftPercent = fadeEdges;
827
+ rightPercent = fadeEdges;
828
+ } else if (typeof fadeEdges === "string") {
829
+ const parsed = parseFloat(fadeEdges);
830
+ if (!Number.isNaN(parsed)) {
831
+ leftPercent = parsed;
832
+ rightPercent = parsed;
833
+ }
834
+ } else if (typeof fadeEdges === "object" && fadeEdges !== null) {
835
+ const edgeObj = fadeEdges;
836
+ if (edgeObj.left !== void 0)
837
+ leftPercent = parseFloat(String(edgeObj.left)) || 0;
838
+ if (edgeObj.right !== void 0)
839
+ rightPercent = parseFloat(String(edgeObj.right)) || 0;
840
+ } else if (fadeEdges === false) {
841
+ leftPercent = 0;
842
+ rightPercent = 0;
843
+ }
844
+ const leftOpacity = leftGradient > 0 ? Math.min(1, leftGradient * 0.22) : 0;
845
+ const rightOpacity = rightGradient > 0 ? Math.min(1, rightGradient * 0.22) : 0;
846
+ return {
847
+ enabled: leftPercent > 0 || rightPercent > 0,
848
+ leftOpacity,
849
+ leftPercent,
850
+ rightOpacity,
851
+ rightPercent
852
+ };
853
+ }
854
+ function formatSmoothstepStop(strength, position, color) {
855
+ if (strength === 0) return `transparent ${position}`;
856
+ if (strength === 1) return `${color} ${position}`;
857
+ return `color-mix(in srgb, ${color} ${Math.round(strength * 100)}%, transparent) ${position}`;
858
+ }
859
+ function generateSmoothstepStops(percent, direction = "in", color = DEFAULT_COLOR) {
860
+ const steps = [{
861
+ s: 0,
862
+ t: 0
863
+ }, {
864
+ s: 0.06,
865
+ t: 0.15
866
+ }, {
867
+ s: 0.22,
868
+ t: 0.35
869
+ }, {
870
+ s: 0.47,
871
+ t: 0.55
872
+ }, {
873
+ s: 0.76,
874
+ t: 0.75
875
+ }, {
876
+ s: 0.93,
877
+ t: 0.9
878
+ }, {
879
+ s: 1,
880
+ t: 1
881
+ }];
882
+ if (direction === "in") {
883
+ return steps.map(({
884
+ s,
885
+ t
886
+ }) => formatSmoothstepStop(s, `${(t * percent).toFixed(1)}%`, color));
887
+ }
888
+ return steps.map(({
889
+ s,
890
+ t
891
+ }) => formatSmoothstepStop(1 - s, `${(100 - percent + t * percent).toFixed(1)}%`, color));
892
+ }
893
+ function getEdgeFadeMask({
894
+ color = DEFAULT_COLOR,
895
+ leftPercent = 0,
896
+ rightPercent = 0
897
+ }) {
898
+ if (leftPercent <= 0 && rightPercent <= 0) return void 0;
899
+ const leftStops = leftPercent > 0 ? generateSmoothstepStops(leftPercent, "in", color) : [`${color} 0%`];
900
+ const rightStops = rightPercent > 0 ? generateSmoothstepStops(rightPercent, "out", color) : [`${color} 100%`];
901
+ return `linear-gradient(to right, ${leftStops.join(", ")}, ${rightStops.join(", ")})`;
902
+ }
903
+ function resolveCssWidth(rawWidth) {
904
+ if (rawWidth === void 0 || rawWidth === null || rawWidth === "") {
905
+ return void 0;
906
+ }
907
+ return typeof rawWidth === "number" ? `${rawWidth}px` : String(rawWidth);
908
+ }
909
+
910
+ // src/modules/background/model/video-frame.ts
911
+ function resolveVideoFrame({
912
+ baseStyle,
913
+ className,
914
+ fadeEdges,
915
+ fit,
916
+ leftGradient,
917
+ overlayColor,
918
+ position,
919
+ rightGradient,
920
+ theme,
921
+ videoClassName,
922
+ videoOptions,
923
+ videoStyle,
924
+ width
925
+ }) {
926
+ const resolvedWidth = resolveCssWidth(width ?? videoOptions?.width ?? videoStyle?.width);
927
+ const rawFit = fit ?? videoOptions?.fit ?? videoOptions?.objectFit;
928
+ const fitStyle = rawFit && OBJECT_FITS.includes(rawFit) ? {
929
+ objectFit: rawFit
930
+ } : {};
931
+ const classNames = resolveVideoClassNames(videoClassName, className, videoOptions?.videoClassName, videoOptions?.className, videoStyle?.className);
932
+ const hasCustomWidth = Boolean(resolvedWidth || classNames.width);
933
+ const gradientSettings = resolveGradientSettings({
934
+ fadeEdges,
935
+ hasWidth: hasCustomWidth,
936
+ leftGradient,
937
+ rightGradient
938
+ });
939
+ const maskImage = gradientSettings.enabled ? getEdgeFadeMask({
940
+ color: overlayColor || DEFAULT_COLOR,
941
+ leftPercent: gradientSettings.leftPercent,
942
+ rightPercent: gradientSettings.rightPercent
943
+ }) : void 0;
944
+ const videoClasses = cn(theme.slots.video, classNames.other);
945
+ const objectPosition2 = baseStyle.objectPosition || position || void 0;
946
+ const sharedVideoStyle = {
947
+ ...classNames.objectStyle,
948
+ ...fitStyle,
949
+ ...objectPosition2 ? {
950
+ objectPosition: objectPosition2
951
+ } : {},
952
+ ...maskImage ? {
953
+ WebkitMaskImage: maskImage,
954
+ maskImage
955
+ } : {},
956
+ ...baseStyle
957
+ };
958
+ return {
959
+ classNames,
960
+ gradientSettings,
961
+ hasCustomWidth,
962
+ maskImage,
963
+ resolvedWidth,
964
+ sharedVideoStyle,
965
+ videoClasses
966
+ };
967
+ }
968
+
969
+ // src/modules/background/motion.ts
970
+ function useBackgroundMotion() {
971
+ return useModuleMotion(backgroundTheme);
972
+ }
973
+ function getBackgroundMotionConfig(motion2, animation) {
974
+ return {
975
+ animate: animation?.animate ?? motion2.animate,
976
+ exit: animation?.exit ?? motion2.exit,
977
+ exitDurationFactor: Number(animation?.exitDurationFactor),
978
+ initial: animation?.initial ?? motion2.initial,
979
+ transition: animation?.transition ?? motion2.transition
980
+ };
981
+ }
982
+ function getBackgroundExitTransition(motion2, config) {
983
+ const own = config.exit.transition;
984
+ const fallback = motion2.exit.transition;
985
+ const factor = Number.isFinite(config.exitDurationFactor) ? Math.max(0, config.exitDurationFactor) : motion2.exitDurationFactor;
986
+ return {
987
+ ...config.transition,
988
+ delay: 0,
989
+ duration: own?.duration ?? (config.transition.duration ?? motion2.transition.duration ?? 0) * factor,
990
+ ease: own?.ease ?? fallback?.ease
991
+ };
992
+ }
993
+ function toCssDuration(seconds, fallback = 0) {
994
+ const value = Number(seconds);
995
+ return `${Math.max(0, Number.isFinite(value) ? value : fallback) * 1e3}ms`;
996
+ }
997
+ function toCssDelay(seconds) {
998
+ const value = Number(seconds);
999
+ return `${Math.max(0, Number.isFinite(value) ? value : 0) * 1e3}ms`;
1000
+ }
1001
+ function toCssEasing(easing) {
1002
+ return cssEasing(easing);
1003
+ }
1004
+
1005
+ // src/modules/background/hooks/use-background-motion-model.ts
1006
+ function useBackgroundMotionModel(animation) {
1007
+ const $ = c(12);
1008
+ const backgroundMotion = useBackgroundMotion();
1009
+ const {
1010
+ reduced,
1011
+ still,
1012
+ tempo
1013
+ } = useMotionTokens();
1014
+ let motionConfig;
1015
+ let overlayTransitionStyle;
1016
+ let t0;
1017
+ if ($[0] !== animation || $[1] !== backgroundMotion || $[2] !== reduced || $[3] !== still || $[4] !== tempo) {
1018
+ motionConfig = getBackgroundMotionConfig(backgroundMotion, retime(animation, {
1019
+ reduced,
1020
+ still,
1021
+ tempo
1022
+ }));
1023
+ overlayTransitionStyle = {
1024
+ transitionDelay: toCssDelay(motionConfig.transition.delay),
1025
+ transitionDuration: toCssDuration(motionConfig.transition.duration, backgroundMotion.transition.duration),
1026
+ transitionProperty: "opacity",
1027
+ transitionTimingFunction: toCssEasing(motionConfig.transition.ease)
1028
+ };
1029
+ t0 = getBackgroundExitTransition(backgroundMotion, motionConfig);
1030
+ $[0] = animation;
1031
+ $[1] = backgroundMotion;
1032
+ $[2] = reduced;
1033
+ $[3] = still;
1034
+ $[4] = tempo;
1035
+ $[5] = motionConfig;
1036
+ $[6] = overlayTransitionStyle;
1037
+ $[7] = t0;
1038
+ } else {
1039
+ motionConfig = $[5];
1040
+ overlayTransitionStyle = $[6];
1041
+ t0 = $[7];
1042
+ }
1043
+ const exitTransition = t0;
1044
+ let t1;
1045
+ if ($[8] !== exitTransition || $[9] !== motionConfig || $[10] !== overlayTransitionStyle) {
1046
+ t1 = {
1047
+ exitTransition,
1048
+ motionConfig,
1049
+ overlayTransitionStyle
1050
+ };
1051
+ $[8] = exitTransition;
1052
+ $[9] = motionConfig;
1053
+ $[10] = overlayTransitionStyle;
1054
+ $[11] = t1;
1055
+ } else {
1056
+ t1 = $[11];
1057
+ }
1058
+ return t1;
1059
+ }
1060
+
1061
+ // src/modules/background/hooks/use-background-overlay-model.ts
1062
+ function resolveBackgroundKey({
1063
+ image,
1064
+ isVideo,
1065
+ video,
1066
+ youtubeVideoId
1067
+ }) {
1068
+ if (!isVideo) return image;
1069
+ return youtubeVideoId ? `youtube:${youtubeVideoId}` : video;
1070
+ }
1071
+ function useBackgroundOverlayModel() {
1072
+ const $ = c(59);
1073
+ const {
1074
+ animation,
1075
+ className,
1076
+ fadeEdges,
1077
+ fit,
1078
+ hasBackground,
1079
+ image,
1080
+ imageStyle,
1081
+ isPlaying,
1082
+ isVideo,
1083
+ isYouTube,
1084
+ leftGradient: configuredLeftGradient,
1085
+ noiseStyle,
1086
+ overlay,
1087
+ overlayColor,
1088
+ overlayOpacity,
1089
+ position,
1090
+ rightGradient: configuredRightGradient,
1091
+ video,
1092
+ videoClassName,
1093
+ videoOptions,
1094
+ videoStyle,
1095
+ width
1096
+ } = useBackgroundState();
1097
+ const {
1098
+ setVideoElement,
1099
+ setVideoPlaying
1100
+ } = useBackgroundActions();
1101
+ let t0;
1102
+ if ($[0] !== videoOptions) {
1103
+ t0 = resolveVideoOptions(videoOptions);
1104
+ $[0] = videoOptions;
1105
+ $[1] = t0;
1106
+ } else {
1107
+ t0 = $[1];
1108
+ }
1109
+ const options = t0;
1110
+ const {
1111
+ corp,
1112
+ isMuted,
1113
+ playbackRate
1114
+ } = options;
1115
+ let endTime;
1116
+ let startTime;
1117
+ let t1;
1118
+ let youtubeConfig;
1119
+ if ($[2] !== image || $[3] !== isVideo || $[4] !== isYouTube || $[5] !== video || $[6] !== videoOptions?.endTime || $[7] !== videoOptions?.startTime) {
1120
+ youtubeConfig = isYouTube ? parseYouTubeUrlConfig(video) : null;
1121
+ startTime = videoOptions?.startTime ?? youtubeConfig?.startTime ?? 0;
1122
+ endTime = videoOptions?.endTime ?? youtubeConfig?.endTime ?? 0;
1123
+ t1 = resolveBackgroundKey({
1124
+ image,
1125
+ isVideo,
1126
+ video,
1127
+ youtubeVideoId: youtubeConfig?.videoId
1128
+ });
1129
+ $[2] = image;
1130
+ $[3] = isVideo;
1131
+ $[4] = isYouTube;
1132
+ $[5] = video;
1133
+ $[6] = videoOptions?.endTime;
1134
+ $[7] = videoOptions?.startTime;
1135
+ $[8] = endTime;
1136
+ $[9] = startTime;
1137
+ $[10] = t1;
1138
+ $[11] = youtubeConfig;
1139
+ } else {
1140
+ endTime = $[8];
1141
+ startTime = $[9];
1142
+ t1 = $[10];
1143
+ youtubeConfig = $[11];
1144
+ }
1145
+ const backgroundKey = t1;
1146
+ const {
1147
+ exitTransition,
1148
+ motionConfig,
1149
+ overlayTransitionStyle
1150
+ } = useBackgroundMotionModel(animation);
1151
+ const {
1152
+ baseStyle,
1153
+ leftGradient: styleLeft,
1154
+ rightGradient: styleRight
1155
+ } = getVisualStyle((isVideo ? videoStyle : imageStyle) || {});
1156
+ const leftGradient = configuredLeftGradient ?? styleLeft;
1157
+ const rightGradient = configuredRightGradient ?? styleRight;
1158
+ let t2;
1159
+ if ($[12] !== noiseStyle) {
1160
+ t2 = noiseStyle || {};
1161
+ $[12] = noiseStyle;
1162
+ $[13] = t2;
1163
+ } else {
1164
+ t2 = $[13];
1165
+ }
1166
+ let noiseBlendMode;
1167
+ let noiseInlineStyle;
1168
+ let noiseOpacity;
1169
+ if ($[14] !== t2) {
1170
+ ({
1171
+ opacity: noiseOpacity,
1172
+ mixBlendMode: noiseBlendMode,
1173
+ ...noiseInlineStyle
1174
+ } = t2);
1175
+ $[14] = t2;
1176
+ $[15] = noiseBlendMode;
1177
+ $[16] = noiseInlineStyle;
1178
+ $[17] = noiseOpacity;
1179
+ } else {
1180
+ noiseBlendMode = $[15];
1181
+ noiseInlineStyle = $[16];
1182
+ noiseOpacity = $[17];
1183
+ }
1184
+ const theme = useTheme(backgroundTheme);
1185
+ const {
1186
+ classNames,
1187
+ gradientSettings,
1188
+ hasCustomWidth,
1189
+ maskImage,
1190
+ resolvedWidth,
1191
+ sharedVideoStyle,
1192
+ videoClasses
1193
+ } = resolveVideoFrame({
1194
+ baseStyle,
1195
+ className,
1196
+ fadeEdges,
1197
+ fit,
1198
+ leftGradient,
1199
+ overlayColor,
1200
+ position,
1201
+ rightGradient,
1202
+ theme,
1203
+ videoClassName,
1204
+ videoOptions,
1205
+ videoStyle,
1206
+ width
1207
+ });
1208
+ const framePosition = position === "left" || position === "right" ? position : "center";
1209
+ let t3;
1210
+ if ($[18] !== backgroundKey || $[19] !== baseStyle || $[20] !== className || $[21] !== classNames || $[22] !== corp || $[23] !== endTime || $[24] !== exitTransition || $[25] !== framePosition || $[26] !== gradientSettings || $[27] !== hasBackground || $[28] !== hasCustomWidth || $[29] !== image || $[30] !== isMuted || $[31] !== isPlaying || $[32] !== isVideo || $[33] !== leftGradient || $[34] !== maskImage || $[35] !== motionConfig || $[36] !== noiseBlendMode || $[37] !== noiseInlineStyle || $[38] !== noiseOpacity || $[39] !== options || $[40] !== overlay || $[41] !== overlayColor || $[42] !== overlayOpacity || $[43] !== overlayTransitionStyle || $[44] !== playbackRate || $[45] !== position || $[46] !== resolvedWidth || $[47] !== rightGradient || $[48] !== setVideoElement || $[49] !== setVideoPlaying || $[50] !== sharedVideoStyle || $[51] !== startTime || $[52] !== theme || $[53] !== video || $[54] !== videoClasses || $[55] !== videoStyle || $[56] !== width || $[57] !== youtubeConfig) {
1211
+ t3 = {
1212
+ className,
1213
+ hasBackground,
1214
+ image,
1215
+ isPlaying,
1216
+ isVideo,
1217
+ overlay,
1218
+ overlayColor,
1219
+ overlayOpacity,
1220
+ position,
1221
+ video,
1222
+ videoStyle,
1223
+ width,
1224
+ setVideoElement,
1225
+ setVideoPlaying,
1226
+ options,
1227
+ corp,
1228
+ isMuted,
1229
+ playbackRate,
1230
+ youtubeConfig,
1231
+ startTime,
1232
+ endTime,
1233
+ backgroundKey,
1234
+ motionConfig,
1235
+ baseStyle,
1236
+ leftGradient,
1237
+ rightGradient,
1238
+ noiseOpacity,
1239
+ noiseBlendMode,
1240
+ noiseInlineStyle,
1241
+ overlayTransitionStyle,
1242
+ resolvedWidth,
1243
+ classNames,
1244
+ hasCustomWidth,
1245
+ gradientSettings,
1246
+ maskImage,
1247
+ framePosition,
1248
+ videoClasses,
1249
+ sharedVideoStyle,
1250
+ exitTransition,
1251
+ theme
1252
+ };
1253
+ $[18] = backgroundKey;
1254
+ $[19] = baseStyle;
1255
+ $[20] = className;
1256
+ $[21] = classNames;
1257
+ $[22] = corp;
1258
+ $[23] = endTime;
1259
+ $[24] = exitTransition;
1260
+ $[25] = framePosition;
1261
+ $[26] = gradientSettings;
1262
+ $[27] = hasBackground;
1263
+ $[28] = hasCustomWidth;
1264
+ $[29] = image;
1265
+ $[30] = isMuted;
1266
+ $[31] = isPlaying;
1267
+ $[32] = isVideo;
1268
+ $[33] = leftGradient;
1269
+ $[34] = maskImage;
1270
+ $[35] = motionConfig;
1271
+ $[36] = noiseBlendMode;
1272
+ $[37] = noiseInlineStyle;
1273
+ $[38] = noiseOpacity;
1274
+ $[39] = options;
1275
+ $[40] = overlay;
1276
+ $[41] = overlayColor;
1277
+ $[42] = overlayOpacity;
1278
+ $[43] = overlayTransitionStyle;
1279
+ $[44] = playbackRate;
1280
+ $[45] = position;
1281
+ $[46] = resolvedWidth;
1282
+ $[47] = rightGradient;
1283
+ $[48] = setVideoElement;
1284
+ $[49] = setVideoPlaying;
1285
+ $[50] = sharedVideoStyle;
1286
+ $[51] = startTime;
1287
+ $[52] = theme;
1288
+ $[53] = video;
1289
+ $[54] = videoClasses;
1290
+ $[55] = videoStyle;
1291
+ $[56] = width;
1292
+ $[57] = youtubeConfig;
1293
+ $[58] = t3;
1294
+ } else {
1295
+ t3 = $[58];
1296
+ }
1297
+ return t3;
1298
+ }
1299
+
1300
+ // src/modules/background/youtube/lib/audio.ts
1301
+ var AUDIO_SEEK_COOLDOWN_MS = 1500;
1302
+ var AUDIO_DRIFT_LIMIT = 0.35;
1303
+ var AUDIO_DRIFT_LIMIT_SILENT = 0.5;
1304
+ var AUDIO_VOLUME_EPSILON = 5e-3;
1305
+ var AUDIO_MIN_READY_STATE = 2;
1306
+ var AUDIO_SYNC_EVENTS = ["play", "playing", "pause", "waiting", "volumechange", "ratechange"];
1307
+ function setElementMuted(video, muted) {
1308
+ video.muted = muted;
1309
+ if (!muted && video.volume === 0) video.volume = DEFAULT_AUDIBLE_VOLUME;
1310
+ }
1311
+ function unlockAudioOnGesture(unlock) {
1312
+ const handler = () => {
1313
+ unlock();
1314
+ window.removeEventListener("pointerdown", handler);
1315
+ window.removeEventListener("keydown", handler);
1316
+ };
1317
+ window.addEventListener("pointerdown", handler, {
1318
+ once: true
1319
+ });
1320
+ window.addEventListener("keydown", handler, {
1321
+ once: true
1322
+ });
1323
+ }
1324
+ function resolveCompanionVolume(volume) {
1325
+ const numeric = Number(volume);
1326
+ return Math.max(0, Math.min(1, Number.isFinite(numeric) ? numeric : 1));
1327
+ }
1328
+ function syncCompanionAudioElements({
1329
+ audio,
1330
+ forceSeek,
1331
+ seekClock,
1332
+ video
1333
+ }) {
1334
+ if (!video || !audio) return;
1335
+ try {
1336
+ const targetRate = Number(video.playbackRate) || 1;
1337
+ if (audio.playbackRate !== targetRate) audio.playbackRate = targetRate;
1338
+ if (audio.readyState < AUDIO_MIN_READY_STATE || !Number.isFinite(audio.duration) || audio.duration <= 0) {
1339
+ return;
1340
+ }
1341
+ const volume = resolveCompanionVolume(video.volume);
1342
+ if (Math.abs(audio.volume - volume) > AUDIO_VOLUME_EPSILON) {
1343
+ audio.volume = volume;
1344
+ }
1345
+ const isSilent = Boolean(video.muted) || volume === 0;
1346
+ if (audio.muted !== isSilent) audio.muted = isSilent;
1347
+ if (video.paused || video.ended || video.seeking) {
1348
+ if (!audio.paused) audio.pause();
1349
+ return;
1350
+ }
1351
+ const now = performance.now();
1352
+ const drift = Math.abs(audio.currentTime - video.currentTime);
1353
+ const maxDrift = isSilent ? AUDIO_DRIFT_LIMIT_SILENT : AUDIO_DRIFT_LIMIT;
1354
+ if (forceSeek || drift > maxDrift && now - seekClock.current > AUDIO_SEEK_COOLDOWN_MS) {
1355
+ seekClock.current = now;
1356
+ audio.currentTime = video.currentTime;
1357
+ }
1358
+ if (audio.paused) audio.play().catch(() => {
1359
+ });
1360
+ } catch {
1361
+ }
1362
+ }
1363
+
1364
+ // src/modules/background/youtube/lib/timing.ts
1365
+ function scheduleRetryTimer(timerIds, callback, delay) {
1366
+ const timerId = window.setTimeout(() => {
1367
+ timerIds.delete(timerId);
1368
+ try {
1369
+ callback();
1370
+ } catch {
1371
+ }
1372
+ }, delay);
1373
+ timerIds.add(timerId);
1374
+ }
1375
+ function resolveEffectiveEnd(endTime, corp, duration) {
1376
+ if (endTime > 0) return endTime;
1377
+ if (corp > 0 && duration > 0) return duration - corp;
1378
+ return 0;
1379
+ }
1380
+ var IFRAME_MIN_END_MARGIN = 0.4;
1381
+ function resolveIframeSafetyEnd(endTime, corp, duration) {
1382
+ if (endTime > 0) return endTime;
1383
+ if (duration > 0) return duration - Math.max(corp, IFRAME_MIN_END_MARGIN);
1384
+ return 0;
1385
+ }
1386
+ function hasPassedEnd(currentTime, endTime, corp, duration) {
1387
+ const effectiveEnd = resolveEffectiveEnd(endTime, corp, duration);
1388
+ return effectiveEnd > 0 && currentTime >= effectiveEnd;
1389
+ }
1390
+ function isWithinCorp(currentTime, duration, corp) {
1391
+ if (!duration) return false;
1392
+ return corp > 0 && currentTime >= duration - corp;
1393
+ }
1394
+
1395
+ // src/modules/background/youtube/lib/video-events.ts
1396
+ var HAVE_CURRENT_DATA = 2;
1397
+ var ERROR_RESUME_RETRY_DELAY_MS = 150;
1398
+ var LOAD_RETRY_DELAY_MS = 200;
1399
+ var AUDIO_RETRY_DELAY_MS = 200;
1400
+ var MAX_VIDEO_LOAD_RETRIES = 1;
1401
+ var MAX_AUDIO_LOAD_RETRIES = 1;
1402
+ function playWithMutedFallback({
1403
+ forceSeek,
1404
+ live,
1405
+ setVideoPlaying,
1406
+ syncCompanionAudio,
1407
+ unlockAudio,
1408
+ video,
1409
+ videoRef
1410
+ }) {
1411
+ const onPlayed = () => {
1412
+ setVideoPlaying(true);
1413
+ syncCompanionAudio(forceSeek);
1414
+ };
1415
+ video.play().then(onPlayed).catch((error) => {
1416
+ if (error?.name !== "NotAllowedError") return;
1417
+ video.muted = true;
1418
+ video.play().then(() => {
1419
+ onPlayed();
1420
+ if (!unlockAudio) return;
1421
+ unlockAudioOnGesture(() => {
1422
+ const current = videoRef.current;
1423
+ if (!live.current.isMuted && current) {
1424
+ setElementMuted(current, false);
1425
+ }
1426
+ });
1427
+ }).catch(() => {
1428
+ });
1429
+ });
1430
+ }
1431
+ function endVideoPlayback(ctx) {
1432
+ const {
1433
+ audioRef,
1434
+ live,
1435
+ setVideoPlaying,
1436
+ syncCompanionAudio,
1437
+ videoRef
1438
+ } = ctx;
1439
+ const video = videoRef.current;
1440
+ const audio = audioRef.current;
1441
+ if (!video) return;
1442
+ if (video.loop || live.current.isLoop) {
1443
+ const resetTime = Math.max(0, live.current.startTime || 0);
1444
+ video.currentTime = resetTime;
1445
+ if (audio && audio.readyState >= HAVE_CURRENT_DATA) {
1446
+ audio.currentTime = resetTime;
1447
+ }
1448
+ video.play().then(() => {
1449
+ setVideoPlaying(true);
1450
+ syncCompanionAudio(true);
1451
+ }).catch(() => {
1452
+ });
1453
+ return;
1454
+ }
1455
+ video.pause();
1456
+ if (audio && !audio.paused) audio.pause();
1457
+ setVideoPlaying(false);
1458
+ }
1459
+ function handleCompanionAudioError(ctx) {
1460
+ const {
1461
+ audioRef,
1462
+ live,
1463
+ scheduleRetry,
1464
+ setUseIframeFallback,
1465
+ videoRef
1466
+ } = ctx;
1467
+ const audio = audioRef.current;
1468
+ if (!audio) return;
1469
+ ctx.audioErrorRetryCountRef.current += 1;
1470
+ if (ctx.audioErrorRetryCountRef.current <= MAX_AUDIO_LOAD_RETRIES) {
1471
+ scheduleRetry(() => {
1472
+ audio.load();
1473
+ if (videoRef.current) {
1474
+ audio.currentTime = videoRef.current.currentTime || 0;
1475
+ }
1476
+ }, AUDIO_RETRY_DELAY_MS);
1477
+ return;
1478
+ }
1479
+ if (!live.current.isMuted) {
1480
+ setUseIframeFallback(true);
1481
+ }
1482
+ }
1483
+ function onTimeUpdate(ctx) {
1484
+ const video = ctx.videoRef.current;
1485
+ if (!video) return;
1486
+ if (video.currentTime > 0 && video.readyState >= HAVE_CURRENT_DATA) {
1487
+ ctx.setIsFrameReady(true);
1488
+ ctx.setIsBuffering(false);
1489
+ }
1490
+ const duration = Number(video.duration) || 0;
1491
+ const {
1492
+ corp,
1493
+ endTime
1494
+ } = ctx.live.current;
1495
+ if (hasPassedEnd(video.currentTime, endTime, corp, duration)) {
1496
+ ctx.handleEnded();
1497
+ }
1498
+ }
1499
+ function onPlay(ctx) {
1500
+ const video = ctx.videoRef.current;
1501
+ ctx.hasLoadedVideoRef.current = true;
1502
+ if (video && !ctx.live.current.isMuted && video.muted) {
1503
+ setElementMuted(video, false);
1504
+ }
1505
+ if (!video || video.readyState < HAVE_CURRENT_DATA) ctx.setIsBuffering(true);
1506
+ ctx.setVideoPlaying(true);
1507
+ ctx.syncCompanionAudio(false);
1508
+ }
1509
+ function onPlaying(ctx) {
1510
+ ctx.hasLoadedVideoRef.current = true;
1511
+ ctx.setIsFrameReady(true);
1512
+ ctx.setIsBuffering(false);
1513
+ ctx.setVideoPlaying(true);
1514
+ ctx.syncCompanionAudio(false);
1515
+ }
1516
+ function onPause(ctx) {
1517
+ const video = ctx.videoRef.current;
1518
+ ctx.syncCompanionAudio(false);
1519
+ ctx.setIsBuffering(false);
1520
+ if (video && !video.seeking && !video.ended && !ctx.live.current.isPlaying) {
1521
+ ctx.setVideoPlaying(false);
1522
+ }
1523
+ }
1524
+ function onSeeked(ctx) {
1525
+ const video = ctx.videoRef.current;
1526
+ if (!video) return;
1527
+ const {
1528
+ isPlaying
1529
+ } = ctx.live.current;
1530
+ ctx.setIsFrameReady(true);
1531
+ if (video.readyState >= HAVE_CURRENT_DATA && (!isPlaying || !video.paused)) {
1532
+ ctx.setIsBuffering(false);
1533
+ }
1534
+ ctx.syncCompanionAudio(true);
1535
+ if (isPlaying && video.paused) {
1536
+ video.play().then(() => {
1537
+ ctx.setVideoPlaying(true);
1538
+ ctx.syncCompanionAudio(true);
1539
+ }).catch(() => {
1540
+ });
1541
+ }
1542
+ }
1543
+ function onCanPlay(ctx) {
1544
+ const video = ctx.videoRef.current;
1545
+ if (!video) return;
1546
+ ctx.hasLoadedVideoRef.current = true;
1547
+ if (!ctx.live.current.isPlaying) {
1548
+ ctx.setIsFrameReady(true);
1549
+ ctx.setIsBuffering(false);
1550
+ } else if (video.paused) {
1551
+ setElementMuted(video, Boolean(ctx.live.current.isMuted));
1552
+ ctx.playWithFallback(video, false, true);
1553
+ }
1554
+ }
1555
+ function onLoadedMetadata(ctx) {
1556
+ const video = ctx.videoRef.current;
1557
+ if (!video) return;
1558
+ ctx.hasLoadedVideoRef.current = true;
1559
+ if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
1560
+ video.currentTime = ctx.startTime;
1561
+ if (ctx.audioRef.current) ctx.audioRef.current.currentTime = ctx.startTime;
1562
+ }
1563
+ }
1564
+ function onLoadedData(ctx) {
1565
+ const video = ctx.videoRef.current;
1566
+ if (!video) return;
1567
+ ctx.hasLoadedVideoRef.current = true;
1568
+ video.playbackRate = ctx.playbackRate;
1569
+ setElementMuted(video, Boolean(ctx.live.current.isMuted));
1570
+ if (ctx.startTime > 0 && video.currentTime < ctx.startTime) {
1571
+ video.currentTime = ctx.startTime;
1572
+ }
1573
+ if (!ctx.live.current.isPlaying) {
1574
+ ctx.setIsFrameReady(true);
1575
+ ctx.setIsBuffering(false);
1576
+ } else if (video.paused) {
1577
+ ctx.playWithFallback(video, true, false);
1578
+ }
1579
+ }
1580
+ function onError(ctx) {
1581
+ const video = ctx.videoRef.current;
1582
+ if (video && ctx.hasLoadedVideoRef.current) {
1583
+ const resumeTime = video.currentTime || 0;
1584
+ ctx.scheduleRetry(() => {
1585
+ video.load();
1586
+ video.currentTime = resumeTime;
1587
+ if (ctx.live.current.isPlaying) video.play().catch(() => {
1588
+ });
1589
+ }, ERROR_RESUME_RETRY_DELAY_MS);
1590
+ return;
1591
+ }
1592
+ ctx.errorRetryCountRef.current += 1;
1593
+ if (video && ctx.errorRetryCountRef.current <= MAX_VIDEO_LOAD_RETRIES) {
1594
+ ctx.scheduleRetry(() => video.load(), LOAD_RETRY_DELAY_MS);
1595
+ return;
1596
+ }
1597
+ ctx.setUseIframeFallback(true);
1598
+ }
1599
+
1600
+ // src/modules/background/youtube/lib/iframe.ts
1601
+ var PLAYER_STATE = {
1602
+ ENDED: 0,
1603
+ PLAYING: 1,
1604
+ PAUSED: 2,
1605
+ BUFFERING: 3
1606
+ };
1607
+ var apiPromise = null;
1608
+ function loadYouTubeIframeApi() {
1609
+ if (typeof window === "undefined") return Promise.resolve(null);
1610
+ if (window.YT?.Player) return Promise.resolve(window.YT);
1611
+ if (apiPromise) return apiPromise;
1612
+ apiPromise = new Promise((resolve) => {
1613
+ const previousCallback = window.onYouTubeIframeAPIReady;
1614
+ window.onYouTubeIframeAPIReady = () => {
1615
+ previousCallback?.();
1616
+ resolve(window.YT);
1617
+ };
1618
+ if (!document.querySelector('script[src="https://www.youtube.com/iframe_api"]')) {
1619
+ const script = document.createElement("script");
1620
+ script.src = "https://www.youtube.com/iframe_api";
1621
+ script.async = true;
1622
+ document.head.appendChild(script);
1623
+ }
1624
+ });
1625
+ return apiPromise;
1626
+ }
1627
+ function toPlayerVolume(volume) {
1628
+ return Math.round(volume * 100);
1629
+ }
1630
+ function setHighQuality(player) {
1631
+ player?.setPlaybackQualityRange?.("hd1080", "hd1080");
1632
+ player?.setPlaybackQuality?.("hd1080");
1633
+ }
1634
+
1635
+ // src/modules/background/youtube/lib/iframe-engine.ts
1636
+ function createIframeEngine({
1637
+ emit,
1638
+ getPlayer,
1639
+ getProxy,
1640
+ isDisposed,
1641
+ live,
1642
+ setIsBuffering,
1643
+ setIsFrameReady,
1644
+ setPlayer,
1645
+ setVideoElement,
1646
+ setVideoPlaying,
1647
+ startProgress,
1648
+ state
1649
+ }) {
1650
+ const restart = (target) => {
1651
+ const restartAt = Math.max(0, live.current.startTime || 0);
1652
+ target?.seekTo?.(restartAt, true);
1653
+ target?.playVideo?.();
1654
+ return restartAt;
1655
+ };
1656
+ const trackProgress = () => {
1657
+ const current = getPlayer();
1658
+ if (!current || typeof current.getCurrentTime !== "function") return;
1659
+ const time = Number(current.getCurrentTime()) || 0;
1660
+ const duration = Number(current.getDuration?.()) || state.duration;
1661
+ state.currentTime = time;
1662
+ if (duration > 0 && duration !== state.duration) {
1663
+ state.duration = duration;
1664
+ emit("durationchange");
1665
+ }
1666
+ const {
1667
+ corp,
1668
+ endTime,
1669
+ isLoop: loops
1670
+ } = live.current;
1671
+ const safetyEnd = resolveIframeSafetyEnd(endTime, corp, duration);
1672
+ if (safetyEnd > 0 && time >= safetyEnd) {
1673
+ if (state.loop || loops) {
1674
+ state.currentTime = restart(current);
1675
+ } else {
1676
+ current.pauseVideo?.();
1677
+ state.paused = true;
1678
+ setVideoPlaying(false);
1679
+ }
1680
+ }
1681
+ emit("timeupdate");
1682
+ };
1683
+ const handleReady = (event) => {
1684
+ if (isDisposed()) return;
1685
+ const target = event.target;
1686
+ setPlayer(target ?? null);
1687
+ state.duration = Number(target?.getDuration?.()) || 0;
1688
+ const {
1689
+ isMuted: muted,
1690
+ isPlaying,
1691
+ playbackRate: rate
1692
+ } = live.current;
1693
+ if (rate !== 1) target?.setPlaybackRate?.(rate);
1694
+ if (muted) {
1695
+ target?.mute?.();
1696
+ } else {
1697
+ target?.unMute?.();
1698
+ target?.setVolume?.(toPlayerVolume(DEFAULT_AUDIBLE_VOLUME));
1699
+ }
1700
+ if (live.current.shouldAutoPlay && isPlaying) {
1701
+ setHighQuality(target);
1702
+ target?.playVideo?.();
1703
+ state.paused = false;
1704
+ setVideoPlaying(true);
1705
+ }
1706
+ const proxy = getProxy();
1707
+ if (proxy) {
1708
+ setVideoElement(proxy);
1709
+ emit("loadedmetadata");
1710
+ emit("durationchange");
1711
+ }
1712
+ startProgress(trackProgress);
1713
+ };
1714
+ const handleStateChange = (event) => {
1715
+ if (isDisposed()) return;
1716
+ switch (event.data) {
1717
+ case PLAYER_STATE.PLAYING:
1718
+ setHighQuality(event.target);
1719
+ state.paused = false;
1720
+ setIsFrameReady(true);
1721
+ setIsBuffering(false);
1722
+ setVideoPlaying(true);
1723
+ emit("play");
1724
+ emit("playing");
1725
+ break;
1726
+ case PLAYER_STATE.BUFFERING:
1727
+ setIsBuffering(true);
1728
+ break;
1729
+ case PLAYER_STATE.PAUSED:
1730
+ state.paused = true;
1731
+ setIsBuffering(false);
1732
+ setVideoPlaying(false);
1733
+ emit("pause");
1734
+ break;
1735
+ case PLAYER_STATE.ENDED:
1736
+ if (state.loop || live.current.isLoop) {
1737
+ restart(getPlayer());
1738
+ } else {
1739
+ state.paused = true;
1740
+ setVideoPlaying(false);
1741
+ emit("ended");
1742
+ }
1743
+ break;
1744
+ }
1745
+ };
1746
+ return {
1747
+ handleReady,
1748
+ handleStateChange
1749
+ };
1750
+ }
1751
+
1752
+ // src/modules/background/youtube/lib/iframe-proxy.ts
1753
+ function createIframeProxyController({
1754
+ player,
1755
+ setVideoPlaying,
1756
+ state
1757
+ }) {
1758
+ return {
1759
+ getCurrentTime: () => state.currentTime,
1760
+ getDuration: () => state.duration,
1761
+ getLoop: () => state.loop,
1762
+ getMuted: () => state.muted,
1763
+ getPaused: () => state.paused,
1764
+ getPlaybackRate: () => state.playbackRate,
1765
+ getVolume: () => state.volume,
1766
+ pause: () => {
1767
+ state.paused = true;
1768
+ player()?.pauseVideo?.();
1769
+ setVideoPlaying(false);
1770
+ },
1771
+ // The controller contract is async; the YouTube player call is not.
1772
+ // eslint-disable-next-line @typescript-eslint/require-await
1773
+ play: async () => {
1774
+ state.paused = false;
1775
+ player()?.playVideo?.();
1776
+ setVideoPlaying(true);
1777
+ },
1778
+ seekTo: (seconds) => {
1779
+ state.currentTime = seconds;
1780
+ player()?.seekTo?.(seconds, true);
1781
+ if (!state.paused) player()?.playVideo?.();
1782
+ },
1783
+ setLoop: (loop) => {
1784
+ state.loop = loop;
1785
+ },
1786
+ setMuted: (muted) => {
1787
+ state.muted = muted;
1788
+ if (muted) {
1789
+ player()?.mute?.();
1790
+ return;
1791
+ }
1792
+ player()?.unMute?.();
1793
+ if (state.volume === 0) {
1794
+ state.volume = PROXY_UNMUTE_VOLUME;
1795
+ player()?.setVolume?.(toPlayerVolume(PROXY_UNMUTE_VOLUME));
1796
+ }
1797
+ },
1798
+ setPlaybackRate: (rate) => {
1799
+ state.playbackRate = rate;
1800
+ player()?.setPlaybackRate?.(rate);
1801
+ },
1802
+ setVolume: (volume) => {
1803
+ state.volume = volume;
1804
+ player()?.setVolume?.(toPlayerVolume(volume));
1805
+ if (volume > 0 && state.muted) {
1806
+ state.muted = false;
1807
+ player()?.unMute?.();
1808
+ } else if (volume === 0 && !state.muted) {
1809
+ state.muted = true;
1810
+ player()?.mute?.();
1811
+ }
1812
+ }
1813
+ };
1814
+ }
1815
+ function buildPlayerVars(initial, videoId) {
1816
+ return {
1817
+ autoplay: initial.shouldAutoPlay ? 1 : 0,
1818
+ controls: 0,
1819
+ disablekb: 1,
1820
+ enablejsapi: 1,
1821
+ fs: 0,
1822
+ iv_load_policy: 3,
1823
+ loop: initial.isLoop ? 1 : 0,
1824
+ modestbranding: 1,
1825
+ mute: initial.isMuted ? 1 : 0,
1826
+ origin: window.location.origin,
1827
+ playlist: videoId,
1828
+ playsinline: 1,
1829
+ rel: 0,
1830
+ start: Math.floor(initial.startTime || 0)
1831
+ };
1832
+ }
1833
+ function createIframePlaybackState({
1834
+ isLoop,
1835
+ isMuted,
1836
+ playbackRate,
1837
+ shouldAutoPlay,
1838
+ startTime
1839
+ }) {
1840
+ return {
1841
+ currentTime: startTime || 0,
1842
+ duration: 0,
1843
+ loop: Boolean(isLoop),
1844
+ muted: Boolean(isMuted),
1845
+ paused: !shouldAutoPlay,
1846
+ playbackRate: Number(playbackRate) || 1,
1847
+ volume: isMuted ? 0 : DEFAULT_AUDIBLE_VOLUME
1848
+ };
1849
+ }
1850
+
1851
+ // src/modules/background/youtube/hooks/use-youtube-iframe-player.ts
1852
+ var PROGRESS_INTERVAL_MS = 200;
1853
+ function destroyQuietly(player) {
1854
+ try {
1855
+ player?.destroy?.();
1856
+ } catch {
1857
+ }
1858
+ }
1859
+ function applyPlayerState(player, {
1860
+ isMuted,
1861
+ isPlaying,
1862
+ playbackRate
1863
+ }) {
1864
+ try {
1865
+ if (isPlaying) player.playVideo?.();
1866
+ else player.pauseVideo?.();
1867
+ if (isMuted) player.mute?.();
1868
+ else player.unMute?.();
1869
+ if (playbackRate) player.setPlaybackRate?.(playbackRate);
1870
+ } catch {
1871
+ }
1872
+ }
1873
+ function useYouTubeIframePlayer(t0) {
1874
+ const $ = c(21);
1875
+ const {
1876
+ enabled,
1877
+ hostRef,
1878
+ isLoop,
1879
+ isMuted,
1880
+ isPlaying,
1881
+ live,
1882
+ playbackRate,
1883
+ setIsBuffering,
1884
+ setIsFrameReady,
1885
+ setVideoElement,
1886
+ setVideoPlaying,
1887
+ shouldAutoPlay,
1888
+ startTime,
1889
+ videoId
1890
+ } = t0;
1891
+ const playerRef = useRef(null);
1892
+ let t1;
1893
+ let t2;
1894
+ if ($[0] !== enabled || $[1] !== hostRef || $[2] !== isLoop || $[3] !== isMuted || $[4] !== live || $[5] !== playbackRate || $[6] !== setIsBuffering || $[7] !== setIsFrameReady || $[8] !== setVideoElement || $[9] !== setVideoPlaying || $[10] !== shouldAutoPlay || $[11] !== startTime || $[12] !== videoId) {
1895
+ t1 = () => {
1896
+ if (!enabled) {
1897
+ return;
1898
+ }
1899
+ let isDisposed = false;
1900
+ let progressInterval = null;
1901
+ let proxyElement = null;
1902
+ const state = createIframePlaybackState({
1903
+ isLoop,
1904
+ isMuted,
1905
+ playbackRate,
1906
+ shouldAutoPlay,
1907
+ startTime
1908
+ });
1909
+ const player = () => playerRef.current;
1910
+ const emit = (type) => proxyElement?.dispatchEvent(new Event(type));
1911
+ const {
1912
+ handleReady,
1913
+ handleStateChange
1914
+ } = createIframeEngine({
1915
+ emit,
1916
+ getPlayer: player,
1917
+ getProxy: () => proxyElement,
1918
+ isDisposed: () => isDisposed,
1919
+ live,
1920
+ setIsBuffering,
1921
+ setIsFrameReady,
1922
+ setPlayer: (next) => {
1923
+ playerRef.current = next;
1924
+ },
1925
+ setVideoElement,
1926
+ setVideoPlaying,
1927
+ startProgress: (tick) => {
1928
+ progressInterval = window.setInterval(tick, PROGRESS_INTERVAL_MS);
1929
+ },
1930
+ state
1931
+ });
1932
+ loadYouTubeIframeApi().then((YT) => {
1933
+ const host = hostRef.current;
1934
+ if (isDisposed || !YT?.Player || !host) {
1935
+ return;
1936
+ }
1937
+ host.innerHTML = "";
1938
+ const mountTarget = document.createElement("div");
1939
+ host.appendChild(mountTarget);
1940
+ proxyElement = createYouTubeVideoElementProxy(createIframeProxyController({
1941
+ player,
1942
+ setVideoPlaying,
1943
+ state
1944
+ }));
1945
+ const initial = live.current;
1946
+ playerRef.current = new YT.Player(mountTarget, {
1947
+ events: {
1948
+ onReady: handleReady,
1949
+ onStateChange: handleStateChange
1950
+ },
1951
+ host: "https://www.youtube-nocookie.com",
1952
+ playerVars: buildPlayerVars(initial, videoId),
1953
+ videoId
1954
+ });
1955
+ });
1956
+ return () => {
1957
+ isDisposed = true;
1958
+ if (progressInterval !== null) {
1959
+ window.clearInterval(progressInterval);
1960
+ }
1961
+ destroyQuietly(playerRef.current);
1962
+ playerRef.current = null;
1963
+ setVideoElement(null);
1964
+ };
1965
+ };
1966
+ t2 = [enabled, hostRef, isLoop, isMuted, live, playbackRate, setIsBuffering, setIsFrameReady, setVideoElement, setVideoPlaying, shouldAutoPlay, startTime, videoId];
1967
+ $[0] = enabled;
1968
+ $[1] = hostRef;
1969
+ $[2] = isLoop;
1970
+ $[3] = isMuted;
1971
+ $[4] = live;
1972
+ $[5] = playbackRate;
1973
+ $[6] = setIsBuffering;
1974
+ $[7] = setIsFrameReady;
1975
+ $[8] = setVideoElement;
1976
+ $[9] = setVideoPlaying;
1977
+ $[10] = shouldAutoPlay;
1978
+ $[11] = startTime;
1979
+ $[12] = videoId;
1980
+ $[13] = t1;
1981
+ $[14] = t2;
1982
+ } else {
1983
+ t1 = $[13];
1984
+ t2 = $[14];
1985
+ }
1986
+ useEffect(t1, t2);
1987
+ let t3;
1988
+ let t4;
1989
+ if ($[15] !== enabled || $[16] !== isMuted || $[17] !== isPlaying || $[18] !== playbackRate) {
1990
+ t3 = () => {
1991
+ const current = playerRef.current;
1992
+ if (!enabled || !current) {
1993
+ return;
1994
+ }
1995
+ applyPlayerState(current, {
1996
+ isMuted,
1997
+ isPlaying,
1998
+ playbackRate
1999
+ });
2000
+ };
2001
+ t4 = [enabled, isMuted, isPlaying, playbackRate];
2002
+ $[15] = enabled;
2003
+ $[16] = isMuted;
2004
+ $[17] = isPlaying;
2005
+ $[18] = playbackRate;
2006
+ $[19] = t3;
2007
+ $[20] = t4;
2008
+ } else {
2009
+ t3 = $[19];
2010
+ t4 = $[20];
2011
+ }
2012
+ useEffect(t3, t4);
2013
+ }
2014
+
2015
+ // src/modules/background/youtube/hooks/use-youtube-stream-sources.ts
2016
+ function useYouTubeStreamSources({
2017
+ codec,
2018
+ posterUrl,
2019
+ quality,
2020
+ showPoster,
2021
+ videoId
2022
+ }) {
2023
+ const videoStreamUrl = getYouTubeStreamUrl(videoId, {
2024
+ codec,
2025
+ quality,
2026
+ stream: "video"
2027
+ });
2028
+ const audioStreamUrl = getYouTubeStreamUrl(videoId, {
2029
+ stream: "audio"
2030
+ });
2031
+ const resolvedPoster = showPoster ? posterUrl || getYouTubeThumbnailUrl(videoId, true) : null;
2032
+ return {
2033
+ audioStreamUrl,
2034
+ resolvedPoster,
2035
+ videoStreamUrl
2036
+ };
2037
+ }
2038
+ var AUDIO_SYNC_INTERVAL_MS = 1e3;
2039
+ function pauseQuietly(video, audio) {
2040
+ try {
2041
+ video.pause();
2042
+ audio?.pause();
2043
+ } catch {
2044
+ }
2045
+ }
2046
+ function useYouTubeVideoSync(t0) {
2047
+ const $ = c(29);
2048
+ const {
2049
+ audioRef,
2050
+ isMuted,
2051
+ isPlaying,
2052
+ playbackRate,
2053
+ retryTimerIdsRef,
2054
+ setVideoElement,
2055
+ setVideoPlaying,
2056
+ syncCompanionAudio,
2057
+ useIframeFallback,
2058
+ videoRef,
2059
+ videoStreamUrl
2060
+ } = t0;
2061
+ let t1;
2062
+ if ($[0] !== audioRef || $[1] !== retryTimerIdsRef || $[2] !== setVideoElement || $[3] !== syncCompanionAudio || $[4] !== useIframeFallback || $[5] !== videoRef) {
2063
+ t1 = () => {
2064
+ if (useIframeFallback) {
2065
+ return;
2066
+ }
2067
+ const video = videoRef.current;
2068
+ const audio = audioRef.current;
2069
+ const retryTimerIds = retryTimerIdsRef.current;
2070
+ if (!video) {
2071
+ setVideoElement(null);
2072
+ return;
2073
+ }
2074
+ setVideoElement(video);
2075
+ const onSync = () => syncCompanionAudio(false);
2076
+ const onSeeked2 = () => syncCompanionAudio(true);
2077
+ for (const event of AUDIO_SYNC_EVENTS) {
2078
+ video.addEventListener(event, onSync);
2079
+ }
2080
+ video.addEventListener("seeked", onSeeked2);
2081
+ const syncTimer = window.setInterval(onSync, AUDIO_SYNC_INTERVAL_MS);
2082
+ return () => {
2083
+ window.clearInterval(syncTimer);
2084
+ retryTimerIds.forEach(_temp);
2085
+ retryTimerIds.clear();
2086
+ for (const event_0 of AUDIO_SYNC_EVENTS) {
2087
+ video.removeEventListener(event_0, onSync);
2088
+ }
2089
+ video.removeEventListener("seeked", onSeeked2);
2090
+ pauseQuietly(video, audio);
2091
+ };
2092
+ };
2093
+ $[0] = audioRef;
2094
+ $[1] = retryTimerIdsRef;
2095
+ $[2] = setVideoElement;
2096
+ $[3] = syncCompanionAudio;
2097
+ $[4] = useIframeFallback;
2098
+ $[5] = videoRef;
2099
+ $[6] = t1;
2100
+ } else {
2101
+ t1 = $[6];
2102
+ }
2103
+ let t2;
2104
+ if ($[7] !== audioRef || $[8] !== retryTimerIdsRef || $[9] !== setVideoElement || $[10] !== syncCompanionAudio || $[11] !== useIframeFallback || $[12] !== videoRef || $[13] !== videoStreamUrl) {
2105
+ t2 = [audioRef, retryTimerIdsRef, setVideoElement, syncCompanionAudio, useIframeFallback, videoRef, videoStreamUrl];
2106
+ $[7] = audioRef;
2107
+ $[8] = retryTimerIdsRef;
2108
+ $[9] = setVideoElement;
2109
+ $[10] = syncCompanionAudio;
2110
+ $[11] = useIframeFallback;
2111
+ $[12] = videoRef;
2112
+ $[13] = videoStreamUrl;
2113
+ $[14] = t2;
2114
+ } else {
2115
+ t2 = $[14];
2116
+ }
2117
+ useEffect(t1, t2);
2118
+ let t3;
2119
+ let t4;
2120
+ if ($[15] !== isPlaying || $[16] !== playbackRate || $[17] !== setVideoPlaying || $[18] !== syncCompanionAudio || $[19] !== useIframeFallback || $[20] !== videoRef) {
2121
+ t3 = () => {
2122
+ const video_0 = videoRef.current;
2123
+ if (useIframeFallback || !video_0) {
2124
+ return;
2125
+ }
2126
+ applyVideoPlaybackState({
2127
+ isPlaying,
2128
+ playbackRate,
2129
+ setVideoPlaying,
2130
+ videoElement: video_0
2131
+ });
2132
+ syncCompanionAudio();
2133
+ };
2134
+ t4 = [isPlaying, playbackRate, setVideoPlaying, syncCompanionAudio, useIframeFallback, videoRef];
2135
+ $[15] = isPlaying;
2136
+ $[16] = playbackRate;
2137
+ $[17] = setVideoPlaying;
2138
+ $[18] = syncCompanionAudio;
2139
+ $[19] = useIframeFallback;
2140
+ $[20] = videoRef;
2141
+ $[21] = t3;
2142
+ $[22] = t4;
2143
+ } else {
2144
+ t3 = $[21];
2145
+ t4 = $[22];
2146
+ }
2147
+ useEffect(t3, t4);
2148
+ let t5;
2149
+ let t6;
2150
+ if ($[23] !== isMuted || $[24] !== syncCompanionAudio || $[25] !== useIframeFallback || $[26] !== videoRef) {
2151
+ t5 = () => {
2152
+ const video_1 = videoRef.current;
2153
+ if (useIframeFallback || !video_1) {
2154
+ return;
2155
+ }
2156
+ if (video_1.muted !== isMuted) {
2157
+ setElementMuted(video_1, isMuted);
2158
+ }
2159
+ syncCompanionAudio(true);
2160
+ };
2161
+ t6 = [isMuted, syncCompanionAudio, useIframeFallback, videoRef];
2162
+ $[23] = isMuted;
2163
+ $[24] = syncCompanionAudio;
2164
+ $[25] = useIframeFallback;
2165
+ $[26] = videoRef;
2166
+ $[27] = t5;
2167
+ $[28] = t6;
2168
+ } else {
2169
+ t5 = $[27];
2170
+ t6 = $[28];
2171
+ }
2172
+ useEffect(t5, t6);
2173
+ }
2174
+ function _temp(timerId) {
2175
+ return window.clearTimeout(timerId);
2176
+ }
2177
+
2178
+ // src/modules/background/youtube/hooks/use-youtube-background-player-model.ts
2179
+ function useYouTubeBackgroundPlayerModel({
2180
+ codec = "auto",
2181
+ corp = 0,
2182
+ endTime = 0,
2183
+ forceIframe = false,
2184
+ isLoop = false,
2185
+ isMuted = true,
2186
+ isPlaying = true,
2187
+ playbackRate = 1,
2188
+ posterUrl = null,
2189
+ quality = "1080p",
2190
+ setVideoElement,
2191
+ setVideoPlaying,
2192
+ shouldAutoPlay = true,
2193
+ showPoster = false,
2194
+ showSpinner = true,
2195
+ startTime = 0,
2196
+ videoClasses: _videoClasses,
2197
+ videoId,
2198
+ videoStyle: _videoStyle
2199
+ }) {
2200
+ const [useIframeFallback, setUseIframeFallback] = useState(Boolean(forceIframe));
2201
+ const [isFrameReady, setIsFrameReady] = useState(false);
2202
+ const [isBuffering, setIsBuffering] = useState(true);
2203
+ const videoRef = useRef(null);
2204
+ const audioRef = useRef(null);
2205
+ const iframeHostRef = useRef(null);
2206
+ const hasLoadedVideoRef = useRef(false);
2207
+ const errorRetryCountRef = useRef(0);
2208
+ const audioErrorRetryCountRef = useRef(0);
2209
+ const retryTimerIdsRef = useRef(/* @__PURE__ */ new Set());
2210
+ const lastAudioSeekAtRef = useRef(0);
2211
+ const live = useRef({
2212
+ corp,
2213
+ endTime,
2214
+ isLoop,
2215
+ isMuted,
2216
+ isPlaying,
2217
+ playbackRate,
2218
+ shouldAutoPlay,
2219
+ startTime
2220
+ });
2221
+ live.current = {
2222
+ corp,
2223
+ endTime,
2224
+ isLoop,
2225
+ isMuted,
2226
+ isPlaying,
2227
+ playbackRate,
2228
+ shouldAutoPlay,
2229
+ startTime
2230
+ };
2231
+ useEffect(() => {
2232
+ setUseIframeFallback(Boolean(forceIframe));
2233
+ setIsFrameReady(false);
2234
+ setIsBuffering(true);
2235
+ hasLoadedVideoRef.current = false;
2236
+ errorRetryCountRef.current = 0;
2237
+ audioErrorRetryCountRef.current = 0;
2238
+ }, [forceIframe, videoId]);
2239
+ const {
2240
+ audioStreamUrl,
2241
+ resolvedPoster,
2242
+ videoStreamUrl
2243
+ } = useYouTubeStreamSources({
2244
+ codec,
2245
+ posterUrl,
2246
+ quality,
2247
+ showPoster,
2248
+ videoId
2249
+ });
2250
+ const syncCompanionAudio = useCallback((forceSeek = false) => {
2251
+ syncCompanionAudioElements({
2252
+ audio: audioRef.current,
2253
+ forceSeek,
2254
+ seekClock: lastAudioSeekAtRef,
2255
+ video: videoRef.current
2256
+ });
2257
+ }, []);
2258
+ const playWithFallback = useCallback((video, forceSeek_0, unlockAudio) => {
2259
+ playWithMutedFallback({
2260
+ forceSeek: forceSeek_0,
2261
+ live,
2262
+ setVideoPlaying,
2263
+ syncCompanionAudio,
2264
+ unlockAudio,
2265
+ video,
2266
+ videoRef
2267
+ });
2268
+ }, [setVideoPlaying, syncCompanionAudio]);
2269
+ const scheduleRetry = (callback, delay) => {
2270
+ scheduleRetryTimer(retryTimerIdsRef.current, callback, delay);
2271
+ };
2272
+ const handleEnded = useCallback(() => {
2273
+ endVideoPlayback({
2274
+ audioRef,
2275
+ live,
2276
+ setVideoPlaying,
2277
+ syncCompanionAudio,
2278
+ videoRef
2279
+ });
2280
+ }, [setVideoPlaying, syncCompanionAudio]);
2281
+ const handleAudioError = useCallback(() => {
2282
+ handleCompanionAudioError({
2283
+ audioErrorRetryCountRef,
2284
+ audioRef,
2285
+ live,
2286
+ scheduleRetry,
2287
+ setUseIframeFallback,
2288
+ videoRef
2289
+ });
2290
+ }, []);
2291
+ const videoContext = {
2292
+ audioRef,
2293
+ errorRetryCountRef,
2294
+ handleEnded,
2295
+ hasLoadedVideoRef,
2296
+ live,
2297
+ playWithFallback,
2298
+ playbackRate,
2299
+ scheduleRetry,
2300
+ setIsBuffering,
2301
+ setIsFrameReady,
2302
+ setUseIframeFallback,
2303
+ setVideoPlaying,
2304
+ startTime,
2305
+ syncCompanionAudio,
2306
+ videoRef
2307
+ };
2308
+ useYouTubeVideoSync({
2309
+ audioRef,
2310
+ isMuted,
2311
+ isPlaying,
2312
+ playbackRate,
2313
+ retryTimerIdsRef,
2314
+ setVideoElement,
2315
+ setVideoPlaying,
2316
+ syncCompanionAudio,
2317
+ useIframeFallback,
2318
+ videoRef,
2319
+ videoStreamUrl
2320
+ });
2321
+ useYouTubeIframePlayer({
2322
+ enabled: useIframeFallback,
2323
+ hostRef: iframeHostRef,
2324
+ isLoop,
2325
+ isMuted,
2326
+ isPlaying,
2327
+ live,
2328
+ playbackRate,
2329
+ setIsBuffering,
2330
+ setIsFrameReady,
2331
+ setVideoElement,
2332
+ setVideoPlaying,
2333
+ shouldAutoPlay,
2334
+ startTime,
2335
+ videoId
2336
+ });
2337
+ const isCovered = !isFrameReady || useIframeFallback && !isPlaying;
2338
+ const showSpinnerOverlay = showSpinner && (!isFrameReady || isBuffering);
2339
+ return {
2340
+ useIframeFallback,
2341
+ isFrameReady,
2342
+ setIsBuffering,
2343
+ videoRef,
2344
+ audioRef,
2345
+ iframeHostRef,
2346
+ videoStreamUrl,
2347
+ audioStreamUrl,
2348
+ resolvedPoster,
2349
+ syncCompanionAudio,
2350
+ handleEnded,
2351
+ handleTimeUpdate: () => onTimeUpdate(videoContext),
2352
+ handlePlay: () => onPlay(videoContext),
2353
+ handlePlaying: () => onPlaying(videoContext),
2354
+ handlePause: () => onPause(videoContext),
2355
+ handleSeeked: () => onSeeked(videoContext),
2356
+ handleCanPlay: () => onCanPlay(videoContext),
2357
+ handleLoadedMetadata: () => onLoadedMetadata(videoContext),
2358
+ handleLoadedData: () => onLoadedData(videoContext),
2359
+ handleError: () => onError(videoContext),
2360
+ handleAudioError,
2361
+ isCovered,
2362
+ showSpinnerOverlay
2363
+ };
2364
+ }
2365
+ function YouTubeBackgroundPlayer(t0) {
2366
+ const $ = c(75);
2367
+ const {
2368
+ codec: t1,
2369
+ corp: t2,
2370
+ endTime: t3,
2371
+ forceIframe: t4,
2372
+ isLoop: t5,
2373
+ isMuted: t6,
2374
+ isPlaying: t7,
2375
+ playbackRate: t8,
2376
+ posterUrl: t9,
2377
+ quality: t10,
2378
+ setVideoElement,
2379
+ setVideoPlaying,
2380
+ shouldAutoPlay: t11,
2381
+ showPoster: t12,
2382
+ showSpinner: t13,
2383
+ startTime: t14,
2384
+ theme,
2385
+ videoClasses,
2386
+ videoId,
2387
+ videoStyle
2388
+ } = t0;
2389
+ const codec = t1 === void 0 ? "auto" : t1;
2390
+ const corp = t2 === void 0 ? 0 : t2;
2391
+ const endTime = t3 === void 0 ? 0 : t3;
2392
+ const forceIframe = t4 === void 0 ? false : t4;
2393
+ const isLoop = t5 === void 0 ? false : t5;
2394
+ const isMuted = t6 === void 0 ? true : t6;
2395
+ const isPlaying = t7 === void 0 ? true : t7;
2396
+ const playbackRate = t8 === void 0 ? 1 : t8;
2397
+ const posterUrl = t9 === void 0 ? null : t9;
2398
+ const quality = t10 === void 0 ? "1080p" : t10;
2399
+ const shouldAutoPlay = t11 === void 0 ? true : t11;
2400
+ const showPoster = t12 === void 0 ? false : t12;
2401
+ const showSpinner = t13 === void 0 ? true : t13;
2402
+ const startTime = t14 === void 0 ? 0 : t14;
2403
+ let t15;
2404
+ if ($[0] !== codec || $[1] !== corp || $[2] !== endTime || $[3] !== forceIframe || $[4] !== isLoop || $[5] !== isMuted || $[6] !== isPlaying || $[7] !== playbackRate || $[8] !== posterUrl || $[9] !== quality || $[10] !== setVideoElement || $[11] !== setVideoPlaying || $[12] !== shouldAutoPlay || $[13] !== showPoster || $[14] !== showSpinner || $[15] !== startTime || $[16] !== theme || $[17] !== videoClasses || $[18] !== videoId || $[19] !== videoStyle) {
2405
+ t15 = {
2406
+ codec,
2407
+ corp,
2408
+ endTime,
2409
+ forceIframe,
2410
+ isLoop,
2411
+ isMuted,
2412
+ isPlaying,
2413
+ playbackRate,
2414
+ posterUrl,
2415
+ quality,
2416
+ setVideoElement,
2417
+ setVideoPlaying,
2418
+ shouldAutoPlay,
2419
+ showPoster,
2420
+ showSpinner,
2421
+ startTime,
2422
+ theme,
2423
+ videoClasses,
2424
+ videoId,
2425
+ videoStyle
2426
+ };
2427
+ $[0] = codec;
2428
+ $[1] = corp;
2429
+ $[2] = endTime;
2430
+ $[3] = forceIframe;
2431
+ $[4] = isLoop;
2432
+ $[5] = isMuted;
2433
+ $[6] = isPlaying;
2434
+ $[7] = playbackRate;
2435
+ $[8] = posterUrl;
2436
+ $[9] = quality;
2437
+ $[10] = setVideoElement;
2438
+ $[11] = setVideoPlaying;
2439
+ $[12] = shouldAutoPlay;
2440
+ $[13] = showPoster;
2441
+ $[14] = showSpinner;
2442
+ $[15] = startTime;
2443
+ $[16] = theme;
2444
+ $[17] = videoClasses;
2445
+ $[18] = videoId;
2446
+ $[19] = videoStyle;
2447
+ $[20] = t15;
2448
+ } else {
2449
+ t15 = $[20];
2450
+ }
2451
+ const {
2452
+ useIframeFallback,
2453
+ isFrameReady,
2454
+ setIsBuffering: _setIsBuffering,
2455
+ videoRef,
2456
+ audioRef,
2457
+ iframeHostRef,
2458
+ videoStreamUrl,
2459
+ audioStreamUrl,
2460
+ resolvedPoster,
2461
+ syncCompanionAudio: _syncCompanionAudio,
2462
+ handleEnded,
2463
+ handleTimeUpdate,
2464
+ handlePlay,
2465
+ handlePlaying,
2466
+ handlePause,
2467
+ handleSeeked,
2468
+ handleCanPlay,
2469
+ handleLoadedMetadata,
2470
+ handleLoadedData,
2471
+ handleError,
2472
+ handleAudioError,
2473
+ isCovered,
2474
+ showSpinnerOverlay
2475
+ } = useYouTubeBackgroundPlayerModel(t15);
2476
+ let t16;
2477
+ if ($[21] !== isCovered || $[22] !== theme.slots.youtubeCover) {
2478
+ t16 = /* @__PURE__ */ jsx("div", { "data-visible": isCovered, className: theme.slots.youtubeCover });
2479
+ $[21] = isCovered;
2480
+ $[22] = theme.slots.youtubeCover;
2481
+ $[23] = t16;
2482
+ } else {
2483
+ t16 = $[23];
2484
+ }
2485
+ let t17;
2486
+ if ($[24] !== showSpinner || $[25] !== theme.slots.youtubeSpinnerIcon) {
2487
+ t17 = showSpinner ? /* @__PURE__ */ jsx(Spinner, { size: 30, className: theme.slots.youtubeSpinnerIcon }) : null;
2488
+ $[24] = showSpinner;
2489
+ $[25] = theme.slots.youtubeSpinnerIcon;
2490
+ $[26] = t17;
2491
+ } else {
2492
+ t17 = $[26];
2493
+ }
2494
+ let t18;
2495
+ if ($[27] !== showSpinnerOverlay || $[28] !== t17 || $[29] !== theme.slots.youtubeSpinner) {
2496
+ t18 = /* @__PURE__ */ jsx("div", { "data-visible": showSpinnerOverlay, className: theme.slots.youtubeSpinner, children: t17 });
2497
+ $[27] = showSpinnerOverlay;
2498
+ $[28] = t17;
2499
+ $[29] = theme.slots.youtubeSpinner;
2500
+ $[30] = t18;
2501
+ } else {
2502
+ t18 = $[30];
2503
+ }
2504
+ let t19;
2505
+ if ($[31] !== isCovered || $[32] !== resolvedPoster || $[33] !== theme.slots.youtubePoster || $[34] !== videoStyle) {
2506
+ t19 = resolvedPoster ? /* @__PURE__ */ jsx("div", { "data-visible": isCovered, className: theme.slots.youtubePoster, style: {
2507
+ backgroundImage: `url(${resolvedPoster})`,
2508
+ ...videoStyle
2509
+ } }) : null;
2510
+ $[31] = isCovered;
2511
+ $[32] = resolvedPoster;
2512
+ $[33] = theme.slots.youtubePoster;
2513
+ $[34] = videoStyle;
2514
+ $[35] = t19;
2515
+ } else {
2516
+ t19 = $[35];
2517
+ }
2518
+ let t20;
2519
+ if ($[36] !== isPlaying || $[37] !== theme.slots.youtubeBlackout || $[38] !== useIframeFallback) {
2520
+ t20 = useIframeFallback && !isPlaying ? /* @__PURE__ */ jsx("div", { className: theme.slots.youtubeBlackout }) : null;
2521
+ $[36] = isPlaying;
2522
+ $[37] = theme.slots.youtubeBlackout;
2523
+ $[38] = useIframeFallback;
2524
+ $[39] = t20;
2525
+ } else {
2526
+ t20 = $[39];
2527
+ }
2528
+ let t21;
2529
+ if ($[40] !== _setIsBuffering || $[41] !== _syncCompanionAudio || $[42] !== audioRef || $[43] !== audioStreamUrl || $[44] !== handleAudioError || $[45] !== handleCanPlay || $[46] !== handleEnded || $[47] !== handleError || $[48] !== handleLoadedData || $[49] !== handleLoadedMetadata || $[50] !== handlePause || $[51] !== handlePlay || $[52] !== handlePlaying || $[53] !== handleSeeked || $[54] !== handleTimeUpdate || $[55] !== iframeHostRef || $[56] !== isFrameReady || $[57] !== isLoop || $[58] !== isMuted || $[59] !== theme.slots.youtubeFrame || $[60] !== theme.slots.youtubeHost || $[61] !== theme.slots.youtubeVideo || $[62] !== useIframeFallback || $[63] !== videoClasses || $[64] !== videoRef || $[65] !== videoStreamUrl || $[66] !== videoStyle) {
2530
+ t21 = useIframeFallback ? /* @__PURE__ */ jsx("div", { "data-visible": isFrameReady, className: theme.slots.youtubeFrame, style: videoStyle, children: /* @__PURE__ */ jsx("div", { ref: iframeHostRef, className: theme.slots.youtubeHost }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2531
+ /* @__PURE__ */ jsx("video", { ref: videoRef, src: videoStreamUrl, "data-visible": isFrameReady, className: cn(videoClasses, theme.slots.youtubeVideo), preload: "auto", muted: isMuted, loop: isLoop, playsInline: true, style: videoStyle, onTimeUpdate: handleTimeUpdate, onEnded: handleEnded, onPlay: handlePlay, onWaiting: () => {
2532
+ _setIsBuffering(true);
2533
+ _syncCompanionAudio(false);
2534
+ }, onPlaying: handlePlaying, onPause: handlePause, onSeeking: () => _setIsBuffering(true), onSeeked: handleSeeked, onCanPlay: handleCanPlay, onLoadedMetadata: handleLoadedMetadata, onLoadedData: handleLoadedData, onError: handleError }),
2535
+ /* @__PURE__ */ jsx("audio", { ref: audioRef, src: audioStreamUrl, preload: "auto", onCanPlay: () => _syncCompanionAudio(true), onError: handleAudioError })
2536
+ ] });
2537
+ $[40] = _setIsBuffering;
2538
+ $[41] = _syncCompanionAudio;
2539
+ $[42] = audioRef;
2540
+ $[43] = audioStreamUrl;
2541
+ $[44] = handleAudioError;
2542
+ $[45] = handleCanPlay;
2543
+ $[46] = handleEnded;
2544
+ $[47] = handleError;
2545
+ $[48] = handleLoadedData;
2546
+ $[49] = handleLoadedMetadata;
2547
+ $[50] = handlePause;
2548
+ $[51] = handlePlay;
2549
+ $[52] = handlePlaying;
2550
+ $[53] = handleSeeked;
2551
+ $[54] = handleTimeUpdate;
2552
+ $[55] = iframeHostRef;
2553
+ $[56] = isFrameReady;
2554
+ $[57] = isLoop;
2555
+ $[58] = isMuted;
2556
+ $[59] = theme.slots.youtubeFrame;
2557
+ $[60] = theme.slots.youtubeHost;
2558
+ $[61] = theme.slots.youtubeVideo;
2559
+ $[62] = useIframeFallback;
2560
+ $[63] = videoClasses;
2561
+ $[64] = videoRef;
2562
+ $[65] = videoStreamUrl;
2563
+ $[66] = videoStyle;
2564
+ $[67] = t21;
2565
+ } else {
2566
+ t21 = $[67];
2567
+ }
2568
+ let t22;
2569
+ if ($[68] !== t16 || $[69] !== t18 || $[70] !== t19 || $[71] !== t20 || $[72] !== t21 || $[73] !== theme.slots.youtube) {
2570
+ t22 = /* @__PURE__ */ jsxs("div", { className: theme.slots.youtube, children: [
2571
+ t16,
2572
+ t18,
2573
+ t19,
2574
+ t20,
2575
+ t21
2576
+ ] });
2577
+ $[68] = t16;
2578
+ $[69] = t18;
2579
+ $[70] = t19;
2580
+ $[71] = t20;
2581
+ $[72] = t21;
2582
+ $[73] = theme.slots.youtube;
2583
+ $[74] = t22;
2584
+ } else {
2585
+ t22 = $[74];
2586
+ }
2587
+ return t22;
2588
+ }
2589
+ function BackgroundGradients(t0) {
2590
+ const $ = c(11);
2591
+ const {
2592
+ count: t1,
2593
+ direction,
2594
+ color: t2,
2595
+ theme
2596
+ } = t0;
2597
+ const count = t1 === void 0 ? 0 : t1;
2598
+ const color = t2 === void 0 ? DEFAULT_COLOR : t2;
2599
+ if (!count || count <= 0) {
2600
+ return null;
2601
+ }
2602
+ const opacity = Math.min(1, Math.max(0.2, count * 0.25));
2603
+ const t3 = theme.slots.gradient;
2604
+ const t4 = theme.styles.gradient;
2605
+ let t5;
2606
+ if ($[0] !== color || $[1] !== direction) {
2607
+ t5 = generateBaseGradient(direction, color);
2608
+ $[0] = color;
2609
+ $[1] = direction;
2610
+ $[2] = t5;
2611
+ } else {
2612
+ t5 = $[2];
2613
+ }
2614
+ let t6;
2615
+ if ($[3] !== opacity || $[4] !== t5 || $[5] !== theme.styles.gradient) {
2616
+ t6 = {
2617
+ ...t4,
2618
+ opacity,
2619
+ background: t5
2620
+ };
2621
+ $[3] = opacity;
2622
+ $[4] = t5;
2623
+ $[5] = theme.styles.gradient;
2624
+ $[6] = t6;
2625
+ } else {
2626
+ t6 = $[6];
2627
+ }
2628
+ let t7;
2629
+ if ($[7] !== direction || $[8] !== t6 || $[9] !== theme.slots.gradient) {
2630
+ t7 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t6 });
2631
+ $[7] = direction;
2632
+ $[8] = t6;
2633
+ $[9] = theme.slots.gradient;
2634
+ $[10] = t7;
2635
+ } else {
2636
+ t7 = $[10];
2637
+ }
2638
+ return t7;
2639
+ }
2640
+ function EdgeGradient(t0) {
2641
+ const $ = c(11);
2642
+ const {
2643
+ direction,
2644
+ percent: t1,
2645
+ opacity: t2,
2646
+ color,
2647
+ theme
2648
+ } = t0;
2649
+ const percent = t1 === void 0 ? 0 : t1;
2650
+ const opacity = t2 === void 0 ? 0 : t2;
2651
+ if (opacity <= 0) {
2652
+ return null;
2653
+ }
2654
+ const t3 = theme.slots.edge;
2655
+ const t4 = `${Math.max(30, percent * 1.15)}%`;
2656
+ const t5 = color || DEFAULT_COLOR;
2657
+ let t6;
2658
+ if ($[0] !== direction || $[1] !== t5) {
2659
+ t6 = generateEdgeGradient(direction, t5);
2660
+ $[0] = direction;
2661
+ $[1] = t5;
2662
+ $[2] = t6;
2663
+ } else {
2664
+ t6 = $[2];
2665
+ }
2666
+ let t7;
2667
+ if ($[3] !== opacity || $[4] !== t4 || $[5] !== t6) {
2668
+ t7 = {
2669
+ width: t4,
2670
+ opacity,
2671
+ background: t6
2672
+ };
2673
+ $[3] = opacity;
2674
+ $[4] = t4;
2675
+ $[5] = t6;
2676
+ $[6] = t7;
2677
+ } else {
2678
+ t7 = $[6];
2679
+ }
2680
+ let t8;
2681
+ if ($[7] !== direction || $[8] !== t7 || $[9] !== theme.slots.edge) {
2682
+ t8 = /* @__PURE__ */ jsx("div", { "data-side": direction, className: t3, style: t7 });
2683
+ $[7] = direction;
2684
+ $[8] = t7;
2685
+ $[9] = theme.slots.edge;
2686
+ $[10] = t8;
2687
+ } else {
2688
+ t8 = $[10];
2689
+ }
2690
+ return t8;
2691
+ }
2692
+ function pauseQuietly2(video) {
2693
+ try {
2694
+ video?.pause();
2695
+ } catch {
2696
+ }
2697
+ }
2698
+ function useNativeVideoModel(t0) {
2699
+ const $ = c(27);
2700
+ const {
2701
+ corp,
2702
+ isMuted,
2703
+ isPlaying,
2704
+ playbackRate,
2705
+ setVideoElement,
2706
+ setVideoPlaying,
2707
+ shouldAutoPlay,
2708
+ src
2709
+ } = t0;
2710
+ const videoRef = useRef(null);
2711
+ let t1;
2712
+ if ($[0] !== setVideoPlaying) {
2713
+ t1 = () => {
2714
+ const video = videoRef.current;
2715
+ if (!video) {
2716
+ return;
2717
+ }
2718
+ if (video.loop) {
2719
+ video.currentTime = 0;
2720
+ video.play().catch(_temp2);
2721
+ return;
2722
+ }
2723
+ video.pause();
2724
+ setVideoPlaying(false);
2725
+ };
2726
+ $[0] = setVideoPlaying;
2727
+ $[1] = t1;
2728
+ } else {
2729
+ t1 = $[1];
2730
+ }
2731
+ const handleEnded = t1;
2732
+ let t2;
2733
+ if ($[2] !== corp || $[3] !== handleEnded) {
2734
+ t2 = () => {
2735
+ const video_0 = videoRef.current;
2736
+ if (video_0 && isWithinCorp(video_0.currentTime, video_0.duration, corp)) {
2737
+ handleEnded();
2738
+ }
2739
+ };
2740
+ $[2] = corp;
2741
+ $[3] = handleEnded;
2742
+ $[4] = t2;
2743
+ } else {
2744
+ t2 = $[4];
2745
+ }
2746
+ const handleTimeUpdate = t2;
2747
+ let t3;
2748
+ if ($[5] !== isMuted || $[6] !== playbackRate || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay) {
2749
+ t3 = () => {
2750
+ const video_1 = videoRef.current;
2751
+ if (!video_1) {
2752
+ return;
2753
+ }
2754
+ video_1.playbackRate = playbackRate;
2755
+ if (!shouldAutoPlay) {
2756
+ return;
2757
+ }
2758
+ if (isMuted) {
2759
+ video_1.muted = true;
2760
+ }
2761
+ video_1.play().then(() => setVideoPlaying(true)).catch((error_0) => {
2762
+ report("Background autoplay", error_0, "warn");
2763
+ setVideoPlaying(false);
2764
+ });
2765
+ };
2766
+ $[5] = isMuted;
2767
+ $[6] = playbackRate;
2768
+ $[7] = setVideoPlaying;
2769
+ $[8] = shouldAutoPlay;
2770
+ $[9] = t3;
2771
+ } else {
2772
+ t3 = $[9];
2773
+ }
2774
+ const handleLoadedData = t3;
2775
+ let t4;
2776
+ if ($[10] !== setVideoElement) {
2777
+ t4 = () => {
2778
+ const video_2 = videoRef.current;
2779
+ setVideoElement(video_2);
2780
+ return () => {
2781
+ pauseQuietly2(video_2);
2782
+ };
2783
+ };
2784
+ $[10] = setVideoElement;
2785
+ $[11] = t4;
2786
+ } else {
2787
+ t4 = $[11];
2788
+ }
2789
+ let t5;
2790
+ if ($[12] !== setVideoElement || $[13] !== src) {
2791
+ t5 = [src, setVideoElement];
2792
+ $[12] = setVideoElement;
2793
+ $[13] = src;
2794
+ $[14] = t5;
2795
+ } else {
2796
+ t5 = $[14];
2797
+ }
2798
+ useEffect(t4, t5);
2799
+ let t6;
2800
+ let t7;
2801
+ if ($[15] !== setVideoElement) {
2802
+ t6 = () => () => setVideoElement(null);
2803
+ t7 = [setVideoElement];
2804
+ $[15] = setVideoElement;
2805
+ $[16] = t6;
2806
+ $[17] = t7;
2807
+ } else {
2808
+ t6 = $[16];
2809
+ t7 = $[17];
2810
+ }
2811
+ useEffect(t6, t7);
2812
+ let t8;
2813
+ let t9;
2814
+ if ($[18] !== isPlaying || $[19] !== playbackRate || $[20] !== setVideoPlaying) {
2815
+ t8 = () => {
2816
+ applyVideoPlaybackState({
2817
+ isPlaying,
2818
+ playbackRate,
2819
+ setVideoPlaying,
2820
+ videoElement: videoRef.current
2821
+ });
2822
+ };
2823
+ t9 = [isPlaying, playbackRate, setVideoPlaying];
2824
+ $[18] = isPlaying;
2825
+ $[19] = playbackRate;
2826
+ $[20] = setVideoPlaying;
2827
+ $[21] = t8;
2828
+ $[22] = t9;
2829
+ } else {
2830
+ t8 = $[21];
2831
+ t9 = $[22];
2832
+ }
2833
+ useEffect(t8, t9);
2834
+ let t10;
2835
+ if ($[23] !== handleEnded || $[24] !== handleLoadedData || $[25] !== handleTimeUpdate) {
2836
+ t10 = {
2837
+ videoRef,
2838
+ handleEnded,
2839
+ handleTimeUpdate,
2840
+ handleLoadedData
2841
+ };
2842
+ $[23] = handleEnded;
2843
+ $[24] = handleLoadedData;
2844
+ $[25] = handleTimeUpdate;
2845
+ $[26] = t10;
2846
+ } else {
2847
+ t10 = $[26];
2848
+ }
2849
+ return t10;
2850
+ }
2851
+ function _temp2(error) {
2852
+ return report("Background loop play", error, "warn");
2853
+ }
2854
+ function NativeVideo(t0) {
2855
+ const $ = c(22);
2856
+ const {
2857
+ corp,
2858
+ isLoop,
2859
+ isMuted,
2860
+ isPlaying,
2861
+ playbackRate,
2862
+ setVideoElement,
2863
+ setVideoPlaying,
2864
+ shouldAutoPlay,
2865
+ src,
2866
+ style,
2867
+ className
2868
+ } = t0;
2869
+ let t1;
2870
+ if ($[0] !== className || $[1] !== corp || $[2] !== isLoop || $[3] !== isMuted || $[4] !== isPlaying || $[5] !== playbackRate || $[6] !== setVideoElement || $[7] !== setVideoPlaying || $[8] !== shouldAutoPlay || $[9] !== src || $[10] !== style) {
2871
+ t1 = {
2872
+ corp,
2873
+ isLoop,
2874
+ isMuted,
2875
+ isPlaying,
2876
+ playbackRate,
2877
+ setVideoElement,
2878
+ setVideoPlaying,
2879
+ shouldAutoPlay,
2880
+ src,
2881
+ style,
2882
+ className
2883
+ };
2884
+ $[0] = className;
2885
+ $[1] = corp;
2886
+ $[2] = isLoop;
2887
+ $[3] = isMuted;
2888
+ $[4] = isPlaying;
2889
+ $[5] = playbackRate;
2890
+ $[6] = setVideoElement;
2891
+ $[7] = setVideoPlaying;
2892
+ $[8] = shouldAutoPlay;
2893
+ $[9] = src;
2894
+ $[10] = style;
2895
+ $[11] = t1;
2896
+ } else {
2897
+ t1 = $[11];
2898
+ }
2899
+ const {
2900
+ videoRef,
2901
+ handleEnded,
2902
+ handleTimeUpdate,
2903
+ handleLoadedData
2904
+ } = useNativeVideoModel(t1);
2905
+ let t2;
2906
+ if ($[12] !== className || $[13] !== handleEnded || $[14] !== handleLoadedData || $[15] !== handleTimeUpdate || $[16] !== isLoop || $[17] !== isMuted || $[18] !== src || $[19] !== style || $[20] !== videoRef) {
2907
+ t2 = /* @__PURE__ */ jsx("video", { ref: videoRef, src, className, preload: "auto", muted: isMuted, loop: isLoop, playsInline: true, style, onTimeUpdate: handleTimeUpdate, onEnded: handleEnded, onLoadedData: handleLoadedData });
2908
+ $[12] = className;
2909
+ $[13] = handleEnded;
2910
+ $[14] = handleLoadedData;
2911
+ $[15] = handleTimeUpdate;
2912
+ $[16] = isLoop;
2913
+ $[17] = isMuted;
2914
+ $[18] = src;
2915
+ $[19] = style;
2916
+ $[20] = videoRef;
2917
+ $[21] = t2;
2918
+ } else {
2919
+ t2 = $[21];
2920
+ }
2921
+ return t2;
2922
+ }
2923
+ function NoiseOverlay(t0) {
2924
+ const $ = c(16);
2925
+ const {
2926
+ opacity,
2927
+ blendMode,
2928
+ inlineStyle,
2929
+ maskImage,
2930
+ isFixed,
2931
+ theme
2932
+ } = t0;
2933
+ const t1 = isFixed ? "fixed" : "absolute";
2934
+ let t2;
2935
+ if ($[0] !== opacity) {
2936
+ t2 = typeof opacity === "number" ? {
2937
+ opacity
2938
+ } : {};
2939
+ $[0] = opacity;
2940
+ $[1] = t2;
2941
+ } else {
2942
+ t2 = $[1];
2943
+ }
2944
+ let t3;
2945
+ if ($[2] !== blendMode) {
2946
+ t3 = typeof blendMode === "string" && blendMode.trim() ? {
2947
+ mixBlendMode: blendMode
2948
+ } : {};
2949
+ $[2] = blendMode;
2950
+ $[3] = t3;
2951
+ } else {
2952
+ t3 = $[3];
2953
+ }
2954
+ let t4;
2955
+ if ($[4] !== maskImage) {
2956
+ t4 = maskImage ? {
2957
+ maskImage,
2958
+ WebkitMaskImage: maskImage
2959
+ } : {};
2960
+ $[4] = maskImage;
2961
+ $[5] = t4;
2962
+ } else {
2963
+ t4 = $[5];
2964
+ }
2965
+ let t5;
2966
+ if ($[6] !== inlineStyle || $[7] !== t2 || $[8] !== t3 || $[9] !== t4 || $[10] !== theme.styles.noise) {
2967
+ t5 = {
2968
+ ...theme.styles.noise,
2969
+ ...t2,
2970
+ ...t3,
2971
+ ...t4,
2972
+ ...inlineStyle
2973
+ };
2974
+ $[6] = inlineStyle;
2975
+ $[7] = t2;
2976
+ $[8] = t3;
2977
+ $[9] = t4;
2978
+ $[10] = theme.styles.noise;
2979
+ $[11] = t5;
2980
+ } else {
2981
+ t5 = $[11];
2982
+ }
2983
+ let t6;
2984
+ if ($[12] !== t1 || $[13] !== t5 || $[14] !== theme.slots.noise) {
2985
+ t6 = /* @__PURE__ */ jsx("div", { "data-position": t1, className: theme.slots.noise, style: t5 });
2986
+ $[12] = t1;
2987
+ $[13] = t5;
2988
+ $[14] = theme.slots.noise;
2989
+ $[15] = t6;
2990
+ } else {
2991
+ t6 = $[15];
2992
+ }
2993
+ return t6;
2994
+ }
2995
+ function SolidOverlay(t0) {
2996
+ const $ = c(10);
2997
+ const {
2998
+ opacity: t1,
2999
+ color,
3000
+ transitionStyle,
3001
+ maskImage,
3002
+ theme
3003
+ } = t0;
3004
+ const opacity = t1 === void 0 ? 0 : t1;
3005
+ let t2;
3006
+ if ($[0] !== maskImage) {
3007
+ t2 = maskImage ? {
3008
+ maskImage,
3009
+ WebkitMaskImage: maskImage
3010
+ } : {};
3011
+ $[0] = maskImage;
3012
+ $[1] = t2;
3013
+ } else {
3014
+ t2 = $[1];
3015
+ }
3016
+ let t3;
3017
+ if ($[2] !== color || $[3] !== opacity || $[4] !== t2 || $[5] !== transitionStyle) {
3018
+ t3 = {
3019
+ opacity,
3020
+ backgroundColor: color,
3021
+ ...t2,
3022
+ ...transitionStyle
3023
+ };
3024
+ $[2] = color;
3025
+ $[3] = opacity;
3026
+ $[4] = t2;
3027
+ $[5] = transitionStyle;
3028
+ $[6] = t3;
3029
+ } else {
3030
+ t3 = $[6];
3031
+ }
3032
+ let t4;
3033
+ if ($[7] !== t3 || $[8] !== theme.slots.solid) {
3034
+ t4 = /* @__PURE__ */ jsx("div", { className: theme.slots.solid, style: t3 });
3035
+ $[7] = t3;
3036
+ $[8] = theme.slots.solid;
3037
+ $[9] = t4;
3038
+ } else {
3039
+ t4 = $[9];
3040
+ }
3041
+ return t4;
3042
+ }
3043
+ function VideoSource(t0) {
3044
+ const $ = c(33);
3045
+ const {
3046
+ model
3047
+ } = t0;
3048
+ const {
3049
+ corp,
3050
+ endTime,
3051
+ image,
3052
+ isMuted,
3053
+ isPlaying,
3054
+ options,
3055
+ playbackRate,
3056
+ setVideoElement,
3057
+ setVideoPlaying,
3058
+ sharedVideoStyle,
3059
+ startTime,
3060
+ theme,
3061
+ video,
3062
+ videoClasses,
3063
+ youtubeConfig
3064
+ } = model;
3065
+ if (youtubeConfig) {
3066
+ const t12 = options.showPoster ? image || null : null;
3067
+ let t22;
3068
+ if ($[0] !== corp || $[1] !== endTime || $[2] !== isMuted || $[3] !== isPlaying || $[4] !== options.codec || $[5] !== options.forceIframe || $[6] !== options.isLoop || $[7] !== options.quality || $[8] !== options.shouldAutoPlay || $[9] !== options.showPoster || $[10] !== options.showSpinner || $[11] !== playbackRate || $[12] !== setVideoElement || $[13] !== setVideoPlaying || $[14] !== sharedVideoStyle || $[15] !== startTime || $[16] !== t12 || $[17] !== theme || $[18] !== videoClasses || $[19] !== youtubeConfig.videoId) {
3069
+ t22 = /* @__PURE__ */ jsx(YouTubeBackgroundPlayer, { videoId: youtubeConfig.videoId, startTime, endTime, corp, isPlaying, isMuted, isLoop: options.isLoop, shouldAutoPlay: options.shouldAutoPlay, showPoster: options.showPoster, showSpinner: options.showSpinner, playbackRate, quality: options.quality, codec: options.codec, forceIframe: options.forceIframe, posterUrl: t12, theme, videoClasses, videoStyle: sharedVideoStyle, setVideoElement, setVideoPlaying });
3070
+ $[0] = corp;
3071
+ $[1] = endTime;
3072
+ $[2] = isMuted;
3073
+ $[3] = isPlaying;
3074
+ $[4] = options.codec;
3075
+ $[5] = options.forceIframe;
3076
+ $[6] = options.isLoop;
3077
+ $[7] = options.quality;
3078
+ $[8] = options.shouldAutoPlay;
3079
+ $[9] = options.showPoster;
3080
+ $[10] = options.showSpinner;
3081
+ $[11] = playbackRate;
3082
+ $[12] = setVideoElement;
3083
+ $[13] = setVideoPlaying;
3084
+ $[14] = sharedVideoStyle;
3085
+ $[15] = startTime;
3086
+ $[16] = t12;
3087
+ $[17] = theme;
3088
+ $[18] = videoClasses;
3089
+ $[19] = youtubeConfig.videoId;
3090
+ $[20] = t22;
3091
+ } else {
3092
+ t22 = $[20];
3093
+ }
3094
+ return t22;
3095
+ }
3096
+ const t1 = video || void 0;
3097
+ let t2;
3098
+ if ($[21] !== corp || $[22] !== isMuted || $[23] !== isPlaying || $[24] !== options.isLoop || $[25] !== options.shouldAutoPlay || $[26] !== playbackRate || $[27] !== setVideoElement || $[28] !== setVideoPlaying || $[29] !== sharedVideoStyle || $[30] !== t1 || $[31] !== videoClasses) {
3099
+ t2 = /* @__PURE__ */ jsx(NativeVideo, { src: t1, className: videoClasses, style: sharedVideoStyle, corp, isLoop: options.isLoop, isMuted, isPlaying, playbackRate, shouldAutoPlay: options.shouldAutoPlay, setVideoElement, setVideoPlaying });
3100
+ $[21] = corp;
3101
+ $[22] = isMuted;
3102
+ $[23] = isPlaying;
3103
+ $[24] = options.isLoop;
3104
+ $[25] = options.shouldAutoPlay;
3105
+ $[26] = playbackRate;
3106
+ $[27] = setVideoElement;
3107
+ $[28] = setVideoPlaying;
3108
+ $[29] = sharedVideoStyle;
3109
+ $[30] = t1;
3110
+ $[31] = videoClasses;
3111
+ $[32] = t2;
3112
+ } else {
3113
+ t2 = $[32];
3114
+ }
3115
+ return t2;
3116
+ }
3117
+ function VideoFrame(t0) {
3118
+ const $ = c(45);
3119
+ const {
3120
+ model
3121
+ } = t0;
3122
+ const {
3123
+ classNames,
3124
+ framePosition,
3125
+ gradientSettings,
3126
+ hasCustomWidth,
3127
+ maskImage,
3128
+ noiseBlendMode,
3129
+ noiseInlineStyle,
3130
+ noiseOpacity,
3131
+ overlay,
3132
+ overlayColor,
3133
+ overlayOpacity,
3134
+ overlayTransitionStyle,
3135
+ resolvedWidth,
3136
+ theme
3137
+ } = model;
3138
+ const t1 = classNames.width || resolvedWidth ? void 0 : "full";
3139
+ let t2;
3140
+ if ($[0] !== classNames.width || $[1] !== theme.slots.videoFrame) {
3141
+ t2 = cn(theme.slots.videoFrame, classNames.width);
3142
+ $[0] = classNames.width;
3143
+ $[1] = theme.slots.videoFrame;
3144
+ $[2] = t2;
3145
+ } else {
3146
+ t2 = $[2];
3147
+ }
3148
+ let t3;
3149
+ if ($[3] !== resolvedWidth) {
3150
+ t3 = resolvedWidth ? {
3151
+ width: resolvedWidth
3152
+ } : {};
3153
+ $[3] = resolvedWidth;
3154
+ $[4] = t3;
3155
+ } else {
3156
+ t3 = $[4];
3157
+ }
3158
+ let t4;
3159
+ if ($[5] !== t3 || $[6] !== theme.styles.videoFrame) {
3160
+ t4 = {
3161
+ ...theme.styles.videoFrame,
3162
+ ...t3
3163
+ };
3164
+ $[5] = t3;
3165
+ $[6] = theme.styles.videoFrame;
3166
+ $[7] = t4;
3167
+ } else {
3168
+ t4 = $[7];
3169
+ }
3170
+ let t5;
3171
+ if ($[8] !== model) {
3172
+ t5 = /* @__PURE__ */ jsx(VideoSource, { model });
3173
+ $[8] = model;
3174
+ $[9] = t5;
3175
+ } else {
3176
+ t5 = $[9];
3177
+ }
3178
+ let t6;
3179
+ if ($[10] !== gradientSettings.leftOpacity || $[11] !== gradientSettings.leftPercent || $[12] !== overlayColor || $[13] !== theme) {
3180
+ t6 = /* @__PURE__ */ jsx(EdgeGradient, { theme, direction: "left", percent: gradientSettings.leftPercent, opacity: gradientSettings.leftOpacity, color: overlayColor });
3181
+ $[10] = gradientSettings.leftOpacity;
3182
+ $[11] = gradientSettings.leftPercent;
3183
+ $[12] = overlayColor;
3184
+ $[13] = theme;
3185
+ $[14] = t6;
3186
+ } else {
3187
+ t6 = $[14];
3188
+ }
3189
+ let t7;
3190
+ if ($[15] !== gradientSettings.rightOpacity || $[16] !== gradientSettings.rightPercent || $[17] !== overlayColor || $[18] !== theme) {
3191
+ t7 = /* @__PURE__ */ jsx(EdgeGradient, { theme, direction: "right", percent: gradientSettings.rightPercent, opacity: gradientSettings.rightOpacity, color: overlayColor });
3192
+ $[15] = gradientSettings.rightOpacity;
3193
+ $[16] = gradientSettings.rightPercent;
3194
+ $[17] = overlayColor;
3195
+ $[18] = theme;
3196
+ $[19] = t7;
3197
+ } else {
3198
+ t7 = $[19];
3199
+ }
3200
+ let t8;
3201
+ if ($[20] !== hasCustomWidth || $[21] !== maskImage || $[22] !== noiseBlendMode || $[23] !== noiseInlineStyle || $[24] !== noiseOpacity || $[25] !== theme) {
3202
+ t8 = hasCustomWidth && /* @__PURE__ */ jsx(NoiseOverlay, { theme, opacity: noiseOpacity, blendMode: noiseBlendMode, inlineStyle: noiseInlineStyle, maskImage });
3203
+ $[20] = hasCustomWidth;
3204
+ $[21] = maskImage;
3205
+ $[22] = noiseBlendMode;
3206
+ $[23] = noiseInlineStyle;
3207
+ $[24] = noiseOpacity;
3208
+ $[25] = theme;
3209
+ $[26] = t8;
3210
+ } else {
3211
+ t8 = $[26];
3212
+ }
3213
+ let t9;
3214
+ if ($[27] !== hasCustomWidth || $[28] !== maskImage || $[29] !== overlay || $[30] !== overlayColor || $[31] !== overlayOpacity || $[32] !== overlayTransitionStyle || $[33] !== theme) {
3215
+ t9 = hasCustomWidth && overlay && /* @__PURE__ */ jsx(SolidOverlay, { theme, opacity: overlayOpacity, color: overlayColor, transitionStyle: overlayTransitionStyle, maskImage });
3216
+ $[27] = hasCustomWidth;
3217
+ $[28] = maskImage;
3218
+ $[29] = overlay;
3219
+ $[30] = overlayColor;
3220
+ $[31] = overlayOpacity;
3221
+ $[32] = overlayTransitionStyle;
3222
+ $[33] = theme;
3223
+ $[34] = t9;
3224
+ } else {
3225
+ t9 = $[34];
3226
+ }
3227
+ let t10;
3228
+ if ($[35] !== framePosition || $[36] !== t1 || $[37] !== t2 || $[38] !== t4 || $[39] !== t5 || $[40] !== t6 || $[41] !== t7 || $[42] !== t8 || $[43] !== t9) {
3229
+ t10 = /* @__PURE__ */ jsxs("div", { "data-position": framePosition, "data-width": t1, className: t2, style: t4, children: [
3230
+ t5,
3231
+ t6,
3232
+ t7,
3233
+ t8,
3234
+ t9
3235
+ ] });
3236
+ $[35] = framePosition;
3237
+ $[36] = t1;
3238
+ $[37] = t2;
3239
+ $[38] = t4;
3240
+ $[39] = t5;
3241
+ $[40] = t6;
3242
+ $[41] = t7;
3243
+ $[42] = t8;
3244
+ $[43] = t9;
3245
+ $[44] = t10;
3246
+ } else {
3247
+ t10 = $[44];
3248
+ }
3249
+ return t10;
3250
+ }
3251
+ function ImageLayer(t0) {
3252
+ const $ = c(7);
3253
+ const {
3254
+ model
3255
+ } = t0;
3256
+ const {
3257
+ baseStyle,
3258
+ image,
3259
+ position,
3260
+ theme
3261
+ } = model;
3262
+ const t1 = image ? `url(${image})` : void 0;
3263
+ let t2;
3264
+ if ($[0] !== baseStyle || $[1] !== position || $[2] !== t1) {
3265
+ t2 = {
3266
+ backgroundImage: t1,
3267
+ backgroundPosition: position,
3268
+ ...baseStyle
3269
+ };
3270
+ $[0] = baseStyle;
3271
+ $[1] = position;
3272
+ $[2] = t1;
3273
+ $[3] = t2;
3274
+ } else {
3275
+ t2 = $[3];
3276
+ }
3277
+ let t3;
3278
+ if ($[4] !== t2 || $[5] !== theme.slots.image) {
3279
+ t3 = /* @__PURE__ */ jsx("div", { className: theme.slots.image, style: t2 });
3280
+ $[4] = t2;
3281
+ $[5] = theme.slots.image;
3282
+ $[6] = t3;
3283
+ } else {
3284
+ t3 = $[6];
3285
+ }
3286
+ return t3;
3287
+ }
3288
+ function FullBleedEffects(t0) {
3289
+ const $ = c(24);
3290
+ const {
3291
+ model
3292
+ } = t0;
3293
+ const {
3294
+ leftGradient,
3295
+ noiseBlendMode,
3296
+ noiseInlineStyle,
3297
+ noiseOpacity,
3298
+ overlay,
3299
+ overlayColor,
3300
+ overlayOpacity,
3301
+ overlayTransitionStyle,
3302
+ rightGradient,
3303
+ theme
3304
+ } = model;
3305
+ let t1;
3306
+ if ($[0] !== leftGradient || $[1] !== overlayColor || $[2] !== theme) {
3307
+ t1 = /* @__PURE__ */ jsx(BackgroundGradients, { theme, count: leftGradient, direction: "left", color: overlayColor });
3308
+ $[0] = leftGradient;
3309
+ $[1] = overlayColor;
3310
+ $[2] = theme;
3311
+ $[3] = t1;
3312
+ } else {
3313
+ t1 = $[3];
3314
+ }
3315
+ let t2;
3316
+ if ($[4] !== overlayColor || $[5] !== rightGradient || $[6] !== theme) {
3317
+ t2 = /* @__PURE__ */ jsx(BackgroundGradients, { theme, count: rightGradient, direction: "right", color: overlayColor });
3318
+ $[4] = overlayColor;
3319
+ $[5] = rightGradient;
3320
+ $[6] = theme;
3321
+ $[7] = t2;
3322
+ } else {
3323
+ t2 = $[7];
3324
+ }
3325
+ let t3;
3326
+ if ($[8] !== noiseBlendMode || $[9] !== noiseInlineStyle || $[10] !== noiseOpacity || $[11] !== theme) {
3327
+ t3 = /* @__PURE__ */ jsx(NoiseOverlay, { theme, isFixed: true, opacity: noiseOpacity, blendMode: noiseBlendMode, inlineStyle: noiseInlineStyle });
3328
+ $[8] = noiseBlendMode;
3329
+ $[9] = noiseInlineStyle;
3330
+ $[10] = noiseOpacity;
3331
+ $[11] = theme;
3332
+ $[12] = t3;
3333
+ } else {
3334
+ t3 = $[12];
3335
+ }
3336
+ let t4;
3337
+ if ($[13] !== overlay || $[14] !== overlayColor || $[15] !== overlayOpacity || $[16] !== overlayTransitionStyle || $[17] !== theme) {
3338
+ t4 = overlay && /* @__PURE__ */ jsx(SolidOverlay, { theme, opacity: overlayOpacity, color: overlayColor, transitionStyle: overlayTransitionStyle });
3339
+ $[13] = overlay;
3340
+ $[14] = overlayColor;
3341
+ $[15] = overlayOpacity;
3342
+ $[16] = overlayTransitionStyle;
3343
+ $[17] = theme;
3344
+ $[18] = t4;
3345
+ } else {
3346
+ t4 = $[18];
3347
+ }
3348
+ let t5;
3349
+ if ($[19] !== t1 || $[20] !== t2 || $[21] !== t3 || $[22] !== t4) {
3350
+ t5 = /* @__PURE__ */ jsxs(Fragment, { children: [
3351
+ t1,
3352
+ t2,
3353
+ t3,
3354
+ t4
3355
+ ] });
3356
+ $[19] = t1;
3357
+ $[20] = t2;
3358
+ $[21] = t3;
3359
+ $[22] = t4;
3360
+ $[23] = t5;
3361
+ } else {
3362
+ t5 = $[23];
3363
+ }
3364
+ return t5;
3365
+ }
3366
+ function BackgroundOverlay() {
3367
+ const $ = c(11);
3368
+ const model = useBackgroundOverlayModel();
3369
+ const {
3370
+ backgroundKey,
3371
+ exitTransition,
3372
+ hasBackground,
3373
+ hasCustomWidth,
3374
+ isVideo,
3375
+ motionConfig,
3376
+ theme
3377
+ } = model;
3378
+ const showFullBleedEffects = !isVideo || !hasCustomWidth;
3379
+ let t0;
3380
+ if ($[0] !== backgroundKey || $[1] !== exitTransition || $[2] !== hasBackground || $[3] !== isVideo || $[4] !== model || $[5] !== motionConfig || $[6] !== showFullBleedEffects || $[7] !== theme) {
3381
+ t0 = hasBackground && /* @__PURE__ */ jsxs(motion.div, { initial: motionConfig.initial, animate: motionConfig.animate, transition: motionConfig.transition, exit: {
3382
+ ...motionConfig.exit,
3383
+ transition: exitTransition
3384
+ }, className: theme.slots.root, style: {
3385
+ willChange: "transform, opacity, filter",
3386
+ ...theme.styles.root
3387
+ }, children: [
3388
+ isVideo ? /* @__PURE__ */ jsx(VideoFrame, { model }) : /* @__PURE__ */ jsx(ImageLayer, { model }),
3389
+ showFullBleedEffects && /* @__PURE__ */ jsx(FullBleedEffects, { model })
3390
+ ] }, backgroundKey);
3391
+ $[0] = backgroundKey;
3392
+ $[1] = exitTransition;
3393
+ $[2] = hasBackground;
3394
+ $[3] = isVideo;
3395
+ $[4] = model;
3396
+ $[5] = motionConfig;
3397
+ $[6] = showFullBleedEffects;
3398
+ $[7] = theme;
3399
+ $[8] = t0;
3400
+ } else {
3401
+ t0 = $[8];
3402
+ }
3403
+ let t1;
3404
+ if ($[9] !== t0) {
3405
+ t1 = /* @__PURE__ */ jsx(AnimatePresence, { mode: "sync", children: t0 });
3406
+ $[9] = t0;
3407
+ $[10] = t1;
3408
+ } else {
3409
+ t1 = $[10];
3410
+ }
3411
+ return t1;
3412
+ }
3413
+ function selectPageBackground(background) {
3414
+ return background ? normalizeBackgroundInput(background) : null;
3415
+ }
3416
+ function useBackgroundPage(_slice, page) {
3417
+ const $ = c(5);
3418
+ const actions = useBackgroundActions();
3419
+ let t0;
3420
+ if ($[0] !== page) {
3421
+ t0 = (background) => page.set({
3422
+ background
3423
+ });
3424
+ $[0] = page;
3425
+ $[1] = t0;
3426
+ } else {
3427
+ t0 = $[1];
3428
+ }
3429
+ let t1;
3430
+ if ($[2] !== actions || $[3] !== t0) {
3431
+ t1 = {
3432
+ ...actions,
3433
+ set: t0
3434
+ };
3435
+ $[2] = actions;
3436
+ $[3] = t0;
3437
+ $[4] = t1;
3438
+ } else {
3439
+ t1 = $[4];
3440
+ }
3441
+ return t1;
3442
+ }
3443
+ var backgroundModule = defineModule({
3444
+ id: "background",
3445
+ context: BackgroundContext,
3446
+ Provider: BackgroundProvider,
3447
+ Backdrop: BackgroundOverlay,
3448
+ uses: ["media"],
3449
+ registry: {
3450
+ cleanupDelayMs: 600,
3451
+ keyPolicy: "singleton",
3452
+ lifecycle: "immediate",
3453
+ singletonKey: BACKGROUND_REGISTRY_KEY
3454
+ },
3455
+ page: {
3456
+ select: (config) => selectPageBackground(config.background),
3457
+ entries: (slice) => [{
3458
+ key: BACKGROUND_REGISTRY_KEY,
3459
+ value: slice
3460
+ }],
3461
+ use: useBackgroundPage
3462
+ }
3463
+ });
3464
+ function defineBackground(definition = {}) {
3465
+ const {
3466
+ id = "background",
3467
+ ...config
3468
+ } = typeof definition === "string" ? {
3469
+ image: definition
3470
+ } : definition;
3471
+ return Object.freeze({
3472
+ config,
3473
+ id,
3474
+ use: function useDefinedBackground(overrides = {}, options = {}) {
3475
+ const patch = typeof overrides === "string" ? {
3476
+ image: overrides
3477
+ } : overrides;
3478
+ return useBackground({
3479
+ ...config,
3480
+ ...patch
3481
+ }, options);
3482
+ }
3483
+ });
3484
+ }
3485
+
3486
+ 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 };
3487
+ //# sourceMappingURL=chunk-TUUGWQY5.js.map
3488
+ //# sourceMappingURL=chunk-TUUGWQY5.js.map