@videojs/html 10.0.0-beta.29 → 10.0.0-beta.30

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 (667) hide show
  1. package/cdn/{ar-BgO-vdw6.js → ar-BbHGxPgW.js} +2 -2
  2. package/cdn/{ar-BgO-vdw6.js.map → ar-BbHGxPgW.js.map} +1 -1
  3. package/cdn/{ar-DGKbeOEU.js → ar-DsPINVvV.js} +2 -2
  4. package/cdn/{ar-DGKbeOEU.js.map → ar-DsPINVvV.js.map} +1 -1
  5. package/cdn/audio-headless.dev.js +1 -1
  6. package/cdn/audio-headless.js +1 -1
  7. package/cdn/audio-minimal-ui.dev.js +1 -1
  8. package/cdn/audio-minimal-ui.js +1 -1
  9. package/cdn/audio-minimal.dev.js +4 -4
  10. package/cdn/audio-minimal.dev.js.map +1 -1
  11. package/cdn/audio-minimal.js +1 -1
  12. package/cdn/audio-minimal.js.map +1 -1
  13. package/cdn/audio-ui.dev.js +1 -1
  14. package/cdn/audio-ui.js +1 -1
  15. package/cdn/audio.dev.js +4 -4
  16. package/cdn/audio.dev.js.map +1 -1
  17. package/cdn/audio.js +1 -1
  18. package/cdn/audio.js.map +1 -1
  19. package/cdn/{az-BXA58gAV.js → az-BNG9I9VB.js} +2 -2
  20. package/cdn/{az-BXA58gAV.js.map → az-BNG9I9VB.js.map} +1 -1
  21. package/cdn/{az-BT93Xmvh.js → az-q6l4N3j1.js} +2 -2
  22. package/cdn/{az-BT93Xmvh.js.map → az-q6l4N3j1.js.map} +1 -1
  23. package/cdn/background.dev.js +1 -1
  24. package/cdn/background.js +1 -1
  25. package/cdn/{bg-CNMY77ir.js → bg-BdKU1ynW.js} +2 -2
  26. package/cdn/{bg-CNMY77ir.js.map → bg-BdKU1ynW.js.map} +1 -1
  27. package/cdn/{bg-B3I4SlRq.js → bg-DCWtl1c4.js} +2 -2
  28. package/cdn/{bg-B3I4SlRq.js.map → bg-DCWtl1c4.js.map} +1 -1
  29. package/cdn/{bn-KcCmQhYd.js → bn-BbmORCrv.js} +2 -2
  30. package/cdn/{bn-KcCmQhYd.js.map → bn-BbmORCrv.js.map} +1 -1
  31. package/cdn/{bn-CcLIScl6.js → bn-DZmQ9OJ-.js} +2 -2
  32. package/cdn/{bn-CcLIScl6.js.map → bn-DZmQ9OJ-.js.map} +1 -1
  33. package/cdn/{bs-BGd6Lc0X.js → bs-BvptjSqN.js} +2 -2
  34. package/cdn/{bs-BGd6Lc0X.js.map → bs-BvptjSqN.js.map} +1 -1
  35. package/cdn/{bs-CS5F7Fa6.js → bs-Cw5PmwUl.js} +2 -2
  36. package/cdn/{bs-CS5F7Fa6.js.map → bs-Cw5PmwUl.js.map} +1 -1
  37. package/cdn/{ca-BIdQJZV-.js → ca-Cn5dI2Qs.js} +2 -2
  38. package/cdn/{ca-BIdQJZV-.js.map → ca-Cn5dI2Qs.js.map} +1 -1
  39. package/cdn/{ca-tFUfQ2mI.js → ca-CoCZNriH.js} +2 -2
  40. package/cdn/{ca-tFUfQ2mI.js.map → ca-CoCZNriH.js.map} +1 -1
  41. package/cdn/compounds-CHlzbAKu.js +8 -0
  42. package/cdn/compounds-CHlzbAKu.js.map +1 -0
  43. package/cdn/{compounds-C73u1MeO.js → compounds-D1FPw7jg.js} +99 -109
  44. package/cdn/compounds-D1FPw7jg.js.map +1 -0
  45. package/cdn/{create-player-Db1CIvlK.js → create-player-5UrHNqBI.js} +704 -704
  46. package/cdn/create-player-5UrHNqBI.js.map +1 -0
  47. package/cdn/create-player-LjvbIxIq.js +2 -0
  48. package/cdn/create-player-LjvbIxIq.js.map +1 -0
  49. package/cdn/{cs-B9lsmY_k.js → cs-BV3Sx3fM.js} +2 -2
  50. package/cdn/{cs-B9lsmY_k.js.map → cs-BV3Sx3fM.js.map} +1 -1
  51. package/cdn/{cs-CGi94LND.js → cs-D5U7GOvT.js} +2 -2
  52. package/cdn/{cs-CGi94LND.js.map → cs-D5U7GOvT.js.map} +1 -1
  53. package/cdn/{cy-m5eMZq7d.js → cy-C1ARfOdw.js} +2 -2
  54. package/cdn/{cy-m5eMZq7d.js.map → cy-C1ARfOdw.js.map} +1 -1
  55. package/cdn/{cy-DW6qAdUj.js → cy-DudRluPj.js} +2 -2
  56. package/cdn/{cy-DW6qAdUj.js.map → cy-DudRluPj.js.map} +1 -1
  57. package/cdn/{da-B5RntG8L.js → da-B7ZwuW3M.js} +2 -2
  58. package/cdn/{da-B5RntG8L.js.map → da-B7ZwuW3M.js.map} +1 -1
  59. package/cdn/{da-BW7obU8g.js → da-II10K6Ey.js} +2 -2
  60. package/cdn/{da-BW7obU8g.js.map → da-II10K6Ey.js.map} +1 -1
  61. package/cdn/{de-D3KzJ5Tz.js → de-B6OPMaJ5.js} +2 -2
  62. package/cdn/{de-D3KzJ5Tz.js.map → de-B6OPMaJ5.js.map} +1 -1
  63. package/cdn/{de-B1BbfHoj.js → de-Dp0rNs6I.js} +2 -2
  64. package/cdn/{de-B1BbfHoj.js.map → de-Dp0rNs6I.js.map} +1 -1
  65. package/cdn/device-pixel-ratio-BuD3pqk8.js +2 -0
  66. package/cdn/device-pixel-ratio-BuD3pqk8.js.map +1 -0
  67. package/cdn/device-pixel-ratio-mmUkCbE0.js +48 -0
  68. package/cdn/device-pixel-ratio-mmUkCbE0.js.map +1 -0
  69. package/cdn/{el-DpHi5eUV.js → el-EOboxCMK.js} +2 -2
  70. package/cdn/{el-DpHi5eUV.js.map → el-EOboxCMK.js.map} +1 -1
  71. package/cdn/{el-B0opiKbz.js → el-KnLx85RQ.js} +2 -2
  72. package/cdn/{el-B0opiKbz.js.map → el-KnLx85RQ.js.map} +1 -1
  73. package/cdn/{error-surface-D0bo71gD.js → error-surface-BOIu7qNS.js} +30 -13
  74. package/cdn/error-surface-BOIu7qNS.js.map +1 -0
  75. package/cdn/{error-surface-BID4D3DW.js → error-surface-CK9nYgD5.js} +2 -2
  76. package/cdn/error-surface-CK9nYgD5.js.map +1 -0
  77. package/cdn/{es-DPmLLGjd.js → es--93P_KGd.js} +2 -2
  78. package/cdn/{es-DPmLLGjd.js.map → es--93P_KGd.js.map} +1 -1
  79. package/cdn/{es-R4DSKG7w.js → es-COk6VYCt.js} +2 -2
  80. package/cdn/{es-R4DSKG7w.js.map → es-COk6VYCt.js.map} +1 -1
  81. package/cdn/{et-DQHjBg68.js → et-B_7oInYP.js} +2 -2
  82. package/cdn/{et-DQHjBg68.js.map → et-B_7oInYP.js.map} +1 -1
  83. package/cdn/{et-Ba6ZgMTe.js → et-aUy-aqQn.js} +2 -2
  84. package/cdn/{et-Ba6ZgMTe.js.map → et-aUy-aqQn.js.map} +1 -1
  85. package/cdn/{eu-CBUcm8xq.js → eu-B6ITLPO5.js} +2 -2
  86. package/cdn/{eu-CBUcm8xq.js.map → eu-B6ITLPO5.js.map} +1 -1
  87. package/cdn/{eu-DXctohCN.js → eu-BG9wftF5.js} +2 -2
  88. package/cdn/{eu-DXctohCN.js.map → eu-BG9wftF5.js.map} +1 -1
  89. package/cdn/{fa-BSekhYli.js → fa-Dh0ufSh-.js} +2 -2
  90. package/cdn/{fa-BSekhYli.js.map → fa-Dh0ufSh-.js.map} +1 -1
  91. package/cdn/{fa-DVErbQrK.js → fa-Vvr1px4j.js} +2 -2
  92. package/cdn/{fa-DVErbQrK.js.map → fa-Vvr1px4j.js.map} +1 -1
  93. package/cdn/{fi-CvnyRW00.js → fi-BG_ciEXf.js} +2 -2
  94. package/cdn/{fi-CvnyRW00.js.map → fi-BG_ciEXf.js.map} +1 -1
  95. package/cdn/{fi-CFpiNsK2.js → fi-XtLm7xkM.js} +2 -2
  96. package/cdn/{fi-CFpiNsK2.js.map → fi-XtLm7xkM.js.map} +1 -1
  97. package/cdn/{fr-V1tRQlCS.js → fr-BXWr8Jqu.js} +2 -2
  98. package/cdn/{fr-V1tRQlCS.js.map → fr-BXWr8Jqu.js.map} +1 -1
  99. package/cdn/{fr-DFpP-osm.js → fr-CHcVddjH.js} +2 -2
  100. package/cdn/{fr-DFpP-osm.js.map → fr-CHcVddjH.js.map} +1 -1
  101. package/cdn/{gd-BSg8cDZO.js → gd-4GF6aH0c.js} +2 -2
  102. package/cdn/{gd-BSg8cDZO.js.map → gd-4GF6aH0c.js.map} +1 -1
  103. package/cdn/{gd-qpj49Ajf.js → gd-DjfDHZSD.js} +2 -2
  104. package/cdn/{gd-qpj49Ajf.js.map → gd-DjfDHZSD.js.map} +1 -1
  105. package/cdn/{gesture-element-CeRy1IVs.js → gesture-element-BbNy1Pjt.js} +2 -2
  106. package/cdn/{gesture-element-CeRy1IVs.js.map → gesture-element-BbNy1Pjt.js.map} +1 -1
  107. package/cdn/{gesture-element-DB67OYCE.js → gesture-element-KdpjbbBD.js} +3 -3
  108. package/cdn/{gesture-element-DB67OYCE.js.map → gesture-element-KdpjbbBD.js.map} +1 -1
  109. package/cdn/{gl-BkUKK3Id.js → gl-CMgj66_6.js} +2 -2
  110. package/cdn/{gl-BkUKK3Id.js.map → gl-CMgj66_6.js.map} +1 -1
  111. package/cdn/{gl-9SEblv-S.js → gl-D9ioIzwX.js} +2 -2
  112. package/cdn/{gl-9SEblv-S.js.map → gl-D9ioIzwX.js.map} +1 -1
  113. package/cdn/{he-1PXxurjR.js → he-CfWrcfG4.js} +2 -2
  114. package/cdn/{he-1PXxurjR.js.map → he-CfWrcfG4.js.map} +1 -1
  115. package/cdn/{he-DA_NFjk3.js → he-DfwOOgbT.js} +2 -2
  116. package/cdn/{he-DA_NFjk3.js.map → he-DfwOOgbT.js.map} +1 -1
  117. package/cdn/{hi-u7gnYTbQ.js → hi-BZ3n5dDB.js} +2 -2
  118. package/cdn/{hi-u7gnYTbQ.js.map → hi-BZ3n5dDB.js.map} +1 -1
  119. package/cdn/{hi-qm1t0A8G.js → hi-D3c9qx7l.js} +2 -2
  120. package/cdn/{hi-qm1t0A8G.js.map → hi-D3c9qx7l.js.map} +1 -1
  121. package/cdn/{hr-BlnRGxrs.js → hr-DEA0U32S.js} +2 -2
  122. package/cdn/{hr-BlnRGxrs.js.map → hr-DEA0U32S.js.map} +1 -1
  123. package/cdn/{hr-YlMHxjnx.js → hr-WZJQxYNC.js} +2 -2
  124. package/cdn/{hr-YlMHxjnx.js.map → hr-WZJQxYNC.js.map} +1 -1
  125. package/cdn/{hu-Cpl4civp.js → hu-Ci9TDNn-.js} +2 -2
  126. package/cdn/{hu-Cpl4civp.js.map → hu-Ci9TDNn-.js.map} +1 -1
  127. package/cdn/{hu-CfmcttWR.js → hu-XOjo5JlM.js} +2 -2
  128. package/cdn/{hu-CfmcttWR.js.map → hu-XOjo5JlM.js.map} +1 -1
  129. package/cdn/{i18n-D0nhPa0m.js → i18n-DeI9j-ko.js} +2 -2
  130. package/cdn/{i18n-D0nhPa0m.js.map → i18n-DeI9j-ko.js.map} +1 -1
  131. package/cdn/i18n-R3TQ8P2f.js +2 -0
  132. package/cdn/{i18n-CpBDXf6M.js.map → i18n-R3TQ8P2f.js.map} +1 -1
  133. package/cdn/i18n.dev.js +53 -53
  134. package/cdn/i18n.js +1 -1
  135. package/cdn/{id-COi2HloV.js → id-D2Z0jj2m.js} +2 -2
  136. package/cdn/{id-COi2HloV.js.map → id-D2Z0jj2m.js.map} +1 -1
  137. package/cdn/{id-Be_i6jhO.js → id-D9XC3sJi.js} +2 -2
  138. package/cdn/{id-Be_i6jhO.js.map → id-D9XC3sJi.js.map} +1 -1
  139. package/cdn/{it-B18weK94.js → it-CDVRQsJC.js} +2 -2
  140. package/cdn/{it-B18weK94.js.map → it-CDVRQsJC.js.map} +1 -1
  141. package/cdn/{it-DKKYDPD1.js → it-tbmwIgns.js} +2 -2
  142. package/cdn/{it-DKKYDPD1.js.map → it-tbmwIgns.js.map} +1 -1
  143. package/cdn/{ja-CeZwzavz.js → ja-Di4sbE9W.js} +2 -2
  144. package/cdn/{ja-CeZwzavz.js.map → ja-Di4sbE9W.js.map} +1 -1
  145. package/cdn/{ja-Bk6dXsfM.js → ja-DuWgmes7.js} +2 -2
  146. package/cdn/{ja-Bk6dXsfM.js.map → ja-DuWgmes7.js.map} +1 -1
  147. package/cdn/{ko-DpALhNiw.js → ko-BX5hcvm_.js} +2 -2
  148. package/cdn/{ko-DpALhNiw.js.map → ko-BX5hcvm_.js.map} +1 -1
  149. package/cdn/{ko-DzP46eEm.js → ko-CvalpIGs.js} +2 -2
  150. package/cdn/{ko-DzP46eEm.js.map → ko-CvalpIGs.js.map} +1 -1
  151. package/cdn/{live-button-element-Co8z2LkI.js → live-button-element-C-WypudK.js} +2 -2
  152. package/cdn/{live-button-element-Co8z2LkI.js.map → live-button-element-C-WypudK.js.map} +1 -1
  153. package/cdn/{live-button-element-zE-8uoR2.js → live-button-element-CylfQD0v.js} +3 -3
  154. package/cdn/{live-button-element-zE-8uoR2.js.map → live-button-element-CylfQD0v.js.map} +1 -1
  155. package/cdn/live-video-minimal.dev.js +7 -7
  156. package/cdn/live-video-minimal.dev.js.map +1 -1
  157. package/cdn/live-video-minimal.js +1 -1
  158. package/cdn/live-video-minimal.js.map +1 -1
  159. package/cdn/live-video.dev.js +8 -8
  160. package/cdn/live-video.dev.js.map +1 -1
  161. package/cdn/live-video.js +1 -1
  162. package/cdn/live-video.js.map +1 -1
  163. package/cdn/locales/ar.dev.js +1 -1
  164. package/cdn/locales/ar.js +1 -1
  165. package/cdn/locales/az.dev.js +1 -1
  166. package/cdn/locales/az.js +1 -1
  167. package/cdn/locales/bg.dev.js +1 -1
  168. package/cdn/locales/bg.js +1 -1
  169. package/cdn/locales/bn.dev.js +1 -1
  170. package/cdn/locales/bn.js +1 -1
  171. package/cdn/locales/bs.dev.js +1 -1
  172. package/cdn/locales/bs.js +1 -1
  173. package/cdn/locales/ca.dev.js +1 -1
  174. package/cdn/locales/ca.js +1 -1
  175. package/cdn/locales/cs.dev.js +1 -1
  176. package/cdn/locales/cs.js +1 -1
  177. package/cdn/locales/cy.dev.js +1 -1
  178. package/cdn/locales/cy.js +1 -1
  179. package/cdn/locales/da.dev.js +1 -1
  180. package/cdn/locales/da.js +1 -1
  181. package/cdn/locales/de.dev.js +1 -1
  182. package/cdn/locales/de.js +1 -1
  183. package/cdn/locales/el.dev.js +1 -1
  184. package/cdn/locales/el.js +1 -1
  185. package/cdn/locales/es.dev.js +1 -1
  186. package/cdn/locales/es.js +1 -1
  187. package/cdn/locales/et.dev.js +1 -1
  188. package/cdn/locales/et.js +1 -1
  189. package/cdn/locales/eu.dev.js +1 -1
  190. package/cdn/locales/eu.js +1 -1
  191. package/cdn/locales/fa.dev.js +1 -1
  192. package/cdn/locales/fa.js +1 -1
  193. package/cdn/locales/fi.dev.js +1 -1
  194. package/cdn/locales/fi.js +1 -1
  195. package/cdn/locales/fr.dev.js +1 -1
  196. package/cdn/locales/fr.js +1 -1
  197. package/cdn/locales/gd.dev.js +1 -1
  198. package/cdn/locales/gd.js +1 -1
  199. package/cdn/locales/gl.dev.js +1 -1
  200. package/cdn/locales/gl.js +1 -1
  201. package/cdn/locales/he.dev.js +1 -1
  202. package/cdn/locales/he.js +1 -1
  203. package/cdn/locales/hi.dev.js +1 -1
  204. package/cdn/locales/hi.js +1 -1
  205. package/cdn/locales/hr.dev.js +1 -1
  206. package/cdn/locales/hr.js +1 -1
  207. package/cdn/locales/hu.dev.js +1 -1
  208. package/cdn/locales/hu.js +1 -1
  209. package/cdn/locales/id.dev.js +1 -1
  210. package/cdn/locales/id.js +1 -1
  211. package/cdn/locales/it.dev.js +1 -1
  212. package/cdn/locales/it.js +1 -1
  213. package/cdn/locales/ja.dev.js +1 -1
  214. package/cdn/locales/ja.js +1 -1
  215. package/cdn/locales/ko.dev.js +1 -1
  216. package/cdn/locales/ko.js +1 -1
  217. package/cdn/locales/lt.dev.js +1 -1
  218. package/cdn/locales/lt.js +1 -1
  219. package/cdn/locales/lv.dev.js +1 -1
  220. package/cdn/locales/lv.js +1 -1
  221. package/cdn/locales/mr.dev.js +1 -1
  222. package/cdn/locales/mr.js +1 -1
  223. package/cdn/locales/nb.dev.js +1 -1
  224. package/cdn/locales/nb.js +1 -1
  225. package/cdn/locales/ne.dev.js +1 -1
  226. package/cdn/locales/ne.js +1 -1
  227. package/cdn/locales/nl.dev.js +1 -1
  228. package/cdn/locales/nl.js +1 -1
  229. package/cdn/locales/nn.dev.js +1 -1
  230. package/cdn/locales/nn.js +1 -1
  231. package/cdn/locales/oc.dev.js +1 -1
  232. package/cdn/locales/oc.js +1 -1
  233. package/cdn/locales/pl.dev.js +1 -1
  234. package/cdn/locales/pl.js +1 -1
  235. package/cdn/locales/pt-BR.dev.js +1 -1
  236. package/cdn/locales/pt-BR.js +1 -1
  237. package/cdn/locales/pt-PT.dev.js +1 -1
  238. package/cdn/locales/pt-PT.js +1 -1
  239. package/cdn/locales/pt.dev.js +1 -1
  240. package/cdn/locales/pt.js +1 -1
  241. package/cdn/locales/ro.dev.js +1 -1
  242. package/cdn/locales/ro.js +1 -1
  243. package/cdn/locales/ru.dev.js +1 -1
  244. package/cdn/locales/ru.js +1 -1
  245. package/cdn/locales/sk.dev.js +1 -1
  246. package/cdn/locales/sk.js +1 -1
  247. package/cdn/locales/sl.dev.js +1 -1
  248. package/cdn/locales/sl.js +1 -1
  249. package/cdn/locales/sr.dev.js +1 -1
  250. package/cdn/locales/sr.js +1 -1
  251. package/cdn/locales/sv.dev.js +1 -1
  252. package/cdn/locales/sv.js +1 -1
  253. package/cdn/locales/te.dev.js +1 -1
  254. package/cdn/locales/te.js +1 -1
  255. package/cdn/locales/th.dev.js +1 -1
  256. package/cdn/locales/th.js +1 -1
  257. package/cdn/locales/tr.dev.js +1 -1
  258. package/cdn/locales/tr.js +1 -1
  259. package/cdn/locales/uk.dev.js +1 -1
  260. package/cdn/locales/uk.js +1 -1
  261. package/cdn/locales/vi.dev.js +1 -1
  262. package/cdn/locales/vi.js +1 -1
  263. package/cdn/locales/zh-CN.dev.js +1 -1
  264. package/cdn/locales/zh-CN.js +1 -1
  265. package/cdn/locales/zh-TW.dev.js +1 -1
  266. package/cdn/locales/zh-TW.js +1 -1
  267. package/cdn/locales/zh.dev.js +1 -1
  268. package/cdn/locales/zh.js +1 -1
  269. package/cdn/{lt-CJC2CVhF.js → lt-DLXeAqcs.js} +2 -2
  270. package/cdn/{lt-CJC2CVhF.js.map → lt-DLXeAqcs.js.map} +1 -1
  271. package/cdn/{lt-y_SCQZXc.js → lt-ZQzwrnWQ.js} +2 -2
  272. package/cdn/{lt-y_SCQZXc.js.map → lt-ZQzwrnWQ.js.map} +1 -1
  273. package/cdn/{lv-E4LvfHSK.js → lv-CsVQVy3v.js} +2 -2
  274. package/cdn/{lv-E4LvfHSK.js.map → lv-CsVQVy3v.js.map} +1 -1
  275. package/cdn/{lv-CfdIbjKR.js → lv-RRA9zY_N.js} +2 -2
  276. package/cdn/{lv-CfdIbjKR.js.map → lv-RRA9zY_N.js.map} +1 -1
  277. package/cdn/media/cloudflare-video.dev.js +2 -2
  278. package/cdn/media/cloudflare-video.js +1 -1
  279. package/cdn/media/hls-audio.dev.js +1 -1
  280. package/cdn/media/hls-audio.js +1 -1
  281. package/cdn/media/hls-background-video.dev.js +1 -1
  282. package/cdn/media/hls-background-video.js +1 -1
  283. package/cdn/media/hls-video.dev.js +1 -1
  284. package/cdn/media/hls-video.js +1 -1
  285. package/cdn/media/mux-audio/spf.dev.js +1 -1
  286. package/cdn/media/mux-audio/spf.js +1 -1
  287. package/cdn/media/mux-background-video.dev.js +1 -1
  288. package/cdn/media/mux-background-video.js +1 -1
  289. package/cdn/media/mux-data.dev.js +1 -1
  290. package/cdn/media/mux-data.dev.js.map +1 -1
  291. package/cdn/media/mux-data.js +1 -1
  292. package/cdn/media/mux-data.js.map +1 -1
  293. package/cdn/media/mux-video/spf.dev.js +1 -1
  294. package/cdn/media/mux-video/spf.js +1 -1
  295. package/cdn/media/shaka-video.dev.d.ts +1 -0
  296. package/cdn/media/shaka-video.dev.js +35132 -0
  297. package/cdn/media/shaka-video.dev.js.map +1 -0
  298. package/cdn/media/shaka-video.js +55 -0
  299. package/cdn/media/shaka-video.js.map +1 -0
  300. package/cdn/media/spotify-audio.dev.js +2 -2
  301. package/cdn/media/spotify-audio.js +1 -1
  302. package/cdn/media/tiktok-video.dev.js +2 -2
  303. package/cdn/media/tiktok-video.js +1 -1
  304. package/cdn/media/twitch-video.dev.js +1 -1
  305. package/cdn/media/twitch-video.js +1 -1
  306. package/cdn/media/vimeo-video.dev.js +2 -2
  307. package/cdn/media/vimeo-video.js +2 -2
  308. package/cdn/media/youtube-video.dev.js +2 -2
  309. package/cdn/media/youtube-video.js +1 -1
  310. package/cdn/{media-mYKOAsk3.js → media-B4uT13xV.js} +13 -29
  311. package/cdn/media-B4uT13xV.js.map +1 -0
  312. package/cdn/{media-DI6DvYm3.js → media-B6LoDnMy.js} +57 -3
  313. package/cdn/media-B6LoDnMy.js.map +1 -0
  314. package/cdn/media-D6Xer97u.js +2 -0
  315. package/cdn/media-D6Xer97u.js.map +1 -0
  316. package/cdn/media-DdApyCAP.js +2 -0
  317. package/cdn/media-DdApyCAP.js.map +1 -0
  318. package/cdn/{media-D4tG62L5.js → media-YTtOjoEw.js} +2 -2
  319. package/cdn/{media-D4tG62L5.js.map → media-YTtOjoEw.js.map} +1 -1
  320. package/cdn/{media-BI8caj07.js → media-aZ7x4gGL.js} +3 -3
  321. package/cdn/{media-BI8caj07.js.map → media-aZ7x4gGL.js.map} +1 -1
  322. package/cdn/minimal-ui-D3XCtSx_.js +2 -0
  323. package/cdn/{minimal-ui-BXrq3z4U.js.map → minimal-ui-D3XCtSx_.js.map} +1 -1
  324. package/cdn/{minimal-ui-BCIESK8f.js → minimal-ui-KUzZkG_3.js} +8 -8
  325. package/cdn/{minimal-ui-BCIESK8f.js.map → minimal-ui-KUzZkG_3.js.map} +1 -1
  326. package/cdn/{minimal-ui-DEalpMk6.js → minimal-ui-ajeAXABk.js} +4 -4
  327. package/cdn/{minimal-ui-DEalpMk6.js.map → minimal-ui-ajeAXABk.js.map} +1 -1
  328. package/cdn/{minimal-ui-vY3QgohH.js → minimal-ui-p9QCZfCz.js} +2 -2
  329. package/cdn/{minimal-ui-vY3QgohH.js.map → minimal-ui-p9QCZfCz.js.map} +1 -1
  330. package/cdn/{mr-C4OijKV_.js → mr-CZ7oMzua.js} +2 -2
  331. package/cdn/{mr-C4OijKV_.js.map → mr-CZ7oMzua.js.map} +1 -1
  332. package/cdn/{mr-DmbgkSem.js → mr-CgFYVcpx.js} +2 -2
  333. package/cdn/{mr-DmbgkSem.js.map → mr-CgFYVcpx.js.map} +1 -1
  334. package/cdn/{nb-Bx5aKqbD.js → nb-DWtHJLYf.js} +2 -2
  335. package/cdn/{nb-Bx5aKqbD.js.map → nb-DWtHJLYf.js.map} +1 -1
  336. package/cdn/{nb-DQ3Nq1ZC.js → nb-ahqFuIy4.js} +2 -2
  337. package/cdn/{nb-DQ3Nq1ZC.js.map → nb-ahqFuIy4.js.map} +1 -1
  338. package/cdn/{ne-DTL8Y04V.js → ne-CFkutVHH.js} +2 -2
  339. package/cdn/{ne-DTL8Y04V.js.map → ne-CFkutVHH.js.map} +1 -1
  340. package/cdn/{ne-BM_WgrGC.js → ne-DQx0S7DC.js} +2 -2
  341. package/cdn/{ne-BM_WgrGC.js.map → ne-DQx0S7DC.js.map} +1 -1
  342. package/cdn/{nl-C7CWKQe5.js → nl-BbWS-uoT.js} +2 -2
  343. package/cdn/{nl-C7CWKQe5.js.map → nl-BbWS-uoT.js.map} +1 -1
  344. package/cdn/{nl-DMt-nkiN.js → nl-V4DJd2nd.js} +2 -2
  345. package/cdn/{nl-DMt-nkiN.js.map → nl-V4DJd2nd.js.map} +1 -1
  346. package/cdn/{nn-BOoGZjkf.js → nn-BoY6X0bu.js} +2 -2
  347. package/cdn/{nn-BOoGZjkf.js.map → nn-BoY6X0bu.js.map} +1 -1
  348. package/cdn/{nn-CT846E14.js → nn-Bp2EWBHZ.js} +2 -2
  349. package/cdn/{nn-CT846E14.js.map → nn-Bp2EWBHZ.js.map} +1 -1
  350. package/cdn/observe-elements-B4q3zaDw.js +79 -0
  351. package/cdn/observe-elements-B4q3zaDw.js.map +1 -0
  352. package/cdn/observe-elements-BivD4tHs.js +2 -0
  353. package/cdn/observe-elements-BivD4tHs.js.map +1 -0
  354. package/cdn/{oc-DQgnGeb2.js → oc-BJrdQkma.js} +2 -2
  355. package/cdn/{oc-DQgnGeb2.js.map → oc-BJrdQkma.js.map} +1 -1
  356. package/cdn/{oc-ClJwr9d0.js → oc-Dto6NU-U.js} +2 -2
  357. package/cdn/{oc-ClJwr9d0.js.map → oc-Dto6NU-U.js.map} +1 -1
  358. package/cdn/{pl-B7SFuF8C.js → pl-BmUKjVFU.js} +2 -2
  359. package/cdn/{pl-B7SFuF8C.js.map → pl-BmUKjVFU.js.map} +1 -1
  360. package/cdn/{pl-DWVOOhfp.js → pl-HlPnZjYT.js} +2 -2
  361. package/cdn/{pl-DWVOOhfp.js.map → pl-HlPnZjYT.js.map} +1 -1
  362. package/cdn/{player-B3GlPF90.js → player-B5zkgqwT.js} +2 -2
  363. package/cdn/{player-B3GlPF90.js.map → player-B5zkgqwT.js.map} +1 -1
  364. package/cdn/{player-DPDmTRvg.js → player-BXQMSpgR.js} +2 -2
  365. package/cdn/{player-DPDmTRvg.js.map → player-BXQMSpgR.js.map} +1 -1
  366. package/cdn/{player-CtTC7qa5.js → player-BuxifKSM.js} +2 -2
  367. package/cdn/{player-CtTC7qa5.js.map → player-BuxifKSM.js.map} +1 -1
  368. package/cdn/{player-DrDd7LJi.js → player-CngT-cVQ.js} +2 -2
  369. package/cdn/{player-DrDd7LJi.js.map → player-CngT-cVQ.js.map} +1 -1
  370. package/cdn/{player-L5UpZmT4.js → player-DMP2pc3L.js} +2 -2
  371. package/cdn/{player-L5UpZmT4.js.map → player-DMP2pc3L.js.map} +1 -1
  372. package/cdn/{player-DKkph8UM.js → player-POHYt5tr.js} +2 -2
  373. package/cdn/{player-DKkph8UM.js.map → player-POHYt5tr.js.map} +1 -1
  374. package/cdn/{poster-element-B5tdJ2ub.js → poster-element-CuCEBVr3.js} +3 -11
  375. package/cdn/poster-element-CuCEBVr3.js.map +1 -0
  376. package/cdn/{poster-element-B8QwXSU_.js → poster-element-Djlm5fwC.js} +2 -2
  377. package/cdn/{poster-element-B8QwXSU_.js.map → poster-element-Djlm5fwC.js.map} +1 -1
  378. package/cdn/{pt-BR-Dx0zZKM6.js → pt-BR-Cfv1ox9K.js} +2 -2
  379. package/cdn/{pt-BR-Dx0zZKM6.js.map → pt-BR-Cfv1ox9K.js.map} +1 -1
  380. package/cdn/{pt-BR-BweixWSY.js → pt-BR-j4XWQBdJ.js} +2 -2
  381. package/cdn/{pt-BR-BweixWSY.js.map → pt-BR-j4XWQBdJ.js.map} +1 -1
  382. package/cdn/{pt-C0Z9dXhV.js → pt-BUBSLaBp.js} +3 -3
  383. package/cdn/{pt-C0Z9dXhV.js.map → pt-BUBSLaBp.js.map} +1 -1
  384. package/cdn/{pt-PT-Di4o8ntw.js → pt-PT-DQ0otVWH.js} +2 -2
  385. package/cdn/{pt-PT-Di4o8ntw.js.map → pt-PT-DQ0otVWH.js.map} +1 -1
  386. package/cdn/{pt-PT-DlHt57Eg.js → pt-PT-DdJVXfMB.js} +2 -2
  387. package/cdn/{pt-PT-DlHt57Eg.js.map → pt-PT-DdJVXfMB.js.map} +1 -1
  388. package/cdn/pt-akbpk7gG.js +2 -0
  389. package/cdn/{pt-ohZp6iM5.js.map → pt-akbpk7gG.js.map} +1 -1
  390. package/cdn/relocation-pipelines-CBzRuD_s.js +2 -0
  391. package/cdn/relocation-pipelines-CBzRuD_s.js.map +1 -0
  392. package/cdn/{relocation-pipelines-Dh8CcgHw.js → relocation-pipelines-R2UVEy5p.js} +38 -2
  393. package/cdn/relocation-pipelines-R2UVEy5p.js.map +1 -0
  394. package/cdn/resolution-C4bCDOw4.js +2 -0
  395. package/cdn/resolution-C4bCDOw4.js.map +1 -0
  396. package/cdn/resolution-DPr_vTWF.js +29 -0
  397. package/cdn/resolution-DPr_vTWF.js.map +1 -0
  398. package/cdn/{ro-BB4KBp_W.js → ro-BiexogxI.js} +2 -2
  399. package/cdn/{ro-BB4KBp_W.js.map → ro-BiexogxI.js.map} +1 -1
  400. package/cdn/{ro-BU9kKrWV.js → ro-X-mft-iF.js} +2 -2
  401. package/cdn/{ro-BU9kKrWV.js.map → ro-X-mft-iF.js.map} +1 -1
  402. package/cdn/rolldown-runtime-KW3qVizi.js +42 -0
  403. package/cdn/rolldown-runtime-QTnfLwEv.js +1 -0
  404. package/cdn/{ru-CajU7FT2.js → ru-15_5g81L.js} +2 -2
  405. package/cdn/{ru-CajU7FT2.js.map → ru-15_5g81L.js.map} +1 -1
  406. package/cdn/{ru-BrWt8VXI.js → ru-GHEfsz_c.js} +2 -2
  407. package/cdn/{ru-BrWt8VXI.js.map → ru-GHEfsz_c.js.map} +1 -1
  408. package/cdn/{seek-button-element-5co-k0Dx.js → seek-button-element-BD2caCd5.js} +3 -3
  409. package/cdn/{seek-button-element-5co-k0Dx.js.map → seek-button-element-BD2caCd5.js.map} +1 -1
  410. package/cdn/{seek-button-element-B8TkILg-.js → seek-button-element-CgaXVFPS.js} +2 -2
  411. package/cdn/{seek-button-element-B8TkILg-.js.map → seek-button-element-CgaXVFPS.js.map} +1 -1
  412. package/cdn/{sk-DOZafohX.js → sk-BEvGx8AE.js} +2 -2
  413. package/cdn/{sk-DOZafohX.js.map → sk-BEvGx8AE.js.map} +1 -1
  414. package/cdn/{sk-XGkesNm5.js → sk-CbZOx0Xf.js} +2 -2
  415. package/cdn/{sk-XGkesNm5.js.map → sk-CbZOx0Xf.js.map} +1 -1
  416. package/cdn/{skin-element-DrkI8xuM.js → skin-element-DE8OodF5.js} +2 -2
  417. package/cdn/skin-element-DE8OodF5.js.map +1 -0
  418. package/cdn/{skin-element-DvX6Bxsv.js → skin-element-PDwjO4v0.js} +2 -10
  419. package/cdn/{skin-element-DvX6Bxsv.js.map → skin-element-PDwjO4v0.js.map} +1 -1
  420. package/cdn/{sl-CHuwx211.js → sl-BqYDAX6g.js} +2 -2
  421. package/cdn/{sl-CHuwx211.js.map → sl-BqYDAX6g.js.map} +1 -1
  422. package/cdn/{sl-CuZgo3JI.js → sl-D7uEXtkn.js} +2 -2
  423. package/cdn/{sl-CuZgo3JI.js.map → sl-D7uEXtkn.js.map} +1 -1
  424. package/cdn/{sr-BsZrd40u.js → sr-CBBykxkN.js} +2 -2
  425. package/cdn/{sr-BsZrd40u.js.map → sr-CBBykxkN.js.map} +1 -1
  426. package/cdn/{sr-CzT_52m8.js → sr-D10ir4DL.js} +2 -2
  427. package/cdn/{sr-CzT_52m8.js.map → sr-D10ir4DL.js.map} +1 -1
  428. package/cdn/{sv-CsISpTMM.js → sv-BGcohnZb.js} +2 -2
  429. package/cdn/{sv-CsISpTMM.js.map → sv-BGcohnZb.js.map} +1 -1
  430. package/cdn/{sv-hxsarb6k.js → sv-he8gk9up.js} +2 -2
  431. package/cdn/{sv-hxsarb6k.js.map → sv-he8gk9up.js.map} +1 -1
  432. package/cdn/{te-DUaUnw1d.js → te-DhEDBJ0Q.js} +2 -2
  433. package/cdn/{te-DUaUnw1d.js.map → te-DhEDBJ0Q.js.map} +1 -1
  434. package/cdn/{te-CG0NRKuG.js → te-Dw2hLtHG.js} +2 -2
  435. package/cdn/{te-CG0NRKuG.js.map → te-Dw2hLtHG.js.map} +1 -1
  436. package/cdn/{text-element-BoY6AhMn.js → text-element-BJyj7nLo.js} +2 -2
  437. package/cdn/{text-element-BoY6AhMn.js.map → text-element-BJyj7nLo.js.map} +1 -1
  438. package/cdn/{text-element-cg6l21cd.js → text-element-dyiwucQB.js} +2 -2
  439. package/cdn/{text-element-cg6l21cd.js.map → text-element-dyiwucQB.js.map} +1 -1
  440. package/cdn/{th-BYS5ZpYb.js → th-B3iYzmd5.js} +2 -2
  441. package/cdn/{th-BYS5ZpYb.js.map → th-B3iYzmd5.js.map} +1 -1
  442. package/cdn/{th-Bx_CvtvC.js → th-BMZDRGQ7.js} +2 -2
  443. package/cdn/{th-Bx_CvtvC.js.map → th-BMZDRGQ7.js.map} +1 -1
  444. package/cdn/{time-slider-chapters-element-CznFQWFm.js → time-slider-chapters-element-BTMqnBhM.js} +3 -3
  445. package/cdn/{time-slider-chapters-element-CznFQWFm.js.map → time-slider-chapters-element-BTMqnBhM.js.map} +1 -1
  446. package/cdn/{time-slider-chapters-element-BfLjdnU4.js → time-slider-chapters-element-b6oeaZtJ.js} +2 -2
  447. package/cdn/{time-slider-chapters-element-BfLjdnU4.js.map → time-slider-chapters-element-b6oeaZtJ.js.map} +1 -1
  448. package/cdn/{tr-5Cegmhcj.js → tr-BJOEOizJ.js} +2 -2
  449. package/cdn/{tr-5Cegmhcj.js.map → tr-BJOEOizJ.js.map} +1 -1
  450. package/cdn/{tr-BV5YcpOy.js → tr-CdLz59Rt.js} +2 -2
  451. package/cdn/{tr-BV5YcpOy.js.map → tr-CdLz59Rt.js.map} +1 -1
  452. package/cdn/{ui-BwzqkJNK.js → ui-BsUcH4YJ.js} +7 -7
  453. package/cdn/{ui-BwzqkJNK.js.map → ui-BsUcH4YJ.js.map} +1 -1
  454. package/cdn/{ui-fnKp94a7.js → ui-CtONjPC2.js} +9 -9
  455. package/cdn/{ui-fnKp94a7.js.map → ui-CtONjPC2.js.map} +1 -1
  456. package/cdn/ui-CxftD4RF.js +2 -0
  457. package/cdn/{ui-DayfItun.js.map → ui-CxftD4RF.js.map} +1 -1
  458. package/cdn/ui-DLvwCbsU.js +2 -0
  459. package/cdn/{ui-PSnD-pv8.js.map → ui-DLvwCbsU.js.map} +1 -1
  460. package/cdn/{uk-DsHkf0ZB.js → uk-BTa1prcg.js} +2 -2
  461. package/cdn/{uk-DsHkf0ZB.js.map → uk-BTa1prcg.js.map} +1 -1
  462. package/cdn/{uk-D2WGhYFz.js → uk-BW53WsQa.js} +2 -2
  463. package/cdn/{uk-D2WGhYFz.js.map → uk-BW53WsQa.js.map} +1 -1
  464. package/cdn/{vi-DBLOO1G4.js → vi-CGDf02ms.js} +2 -2
  465. package/cdn/{vi-DBLOO1G4.js.map → vi-CGDf02ms.js.map} +1 -1
  466. package/cdn/{vi-CORn5e7t.js → vi-CcOG_Tlw.js} +2 -2
  467. package/cdn/{vi-CORn5e7t.js.map → vi-CcOG_Tlw.js.map} +1 -1
  468. package/cdn/video-headless.dev.js +1 -1
  469. package/cdn/video-headless.js +1 -1
  470. package/cdn/video-minimal-ui.dev.js +1 -1
  471. package/cdn/video-minimal-ui.js +1 -1
  472. package/cdn/video-minimal.dev.js +4 -4
  473. package/cdn/video-minimal.dev.js.map +1 -1
  474. package/cdn/video-minimal.js +1 -1
  475. package/cdn/video-minimal.js.map +1 -1
  476. package/cdn/video-ui.dev.js +1 -1
  477. package/cdn/video-ui.js +1 -1
  478. package/cdn/video.dev.js +5 -5
  479. package/cdn/video.dev.js.map +1 -1
  480. package/cdn/video.js +1 -1
  481. package/cdn/video.js.map +1 -1
  482. package/cdn/{zh-R2vnxJiQ.js → zh-34ObMhvt.js} +3 -3
  483. package/cdn/{zh-R2vnxJiQ.js.map → zh-34ObMhvt.js.map} +1 -1
  484. package/cdn/{zh-CN-Cga4L1h3.js → zh-CN-C_IU0JUw.js} +2 -2
  485. package/cdn/{zh-CN-Cga4L1h3.js.map → zh-CN-C_IU0JUw.js.map} +1 -1
  486. package/cdn/{zh-CN-xq6taoBE.js → zh-CN-rZeJec8v.js} +2 -2
  487. package/cdn/{zh-CN-xq6taoBE.js.map → zh-CN-rZeJec8v.js.map} +1 -1
  488. package/cdn/zh-Cf3NSZs8.js +2 -0
  489. package/cdn/{zh-CtBcRYRs.js.map → zh-Cf3NSZs8.js.map} +1 -1
  490. package/cdn/{zh-TW-DWI1-WUt.js → zh-TW-5fFrgVzt.js} +2 -2
  491. package/cdn/{zh-TW-DWI1-WUt.js.map → zh-TW-5fFrgVzt.js.map} +1 -1
  492. package/cdn/{zh-TW-Dca2WbyD.js → zh-TW-BvuhCu_U.js} +2 -2
  493. package/cdn/{zh-TW-Dca2WbyD.js.map → zh-TW-BvuhCu_U.js.map} +1 -1
  494. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  495. package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  496. package/dist/default/_virtual/inline-css_src/define/audio/skin.js +1 -1
  497. package/dist/default/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  498. package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
  499. package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
  500. package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
  501. package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
  502. package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
  503. package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
  504. package/dist/default/_virtual/inline-css_src/define/live-video/skin.js +1 -1
  505. package/dist/default/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
  506. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  507. package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  508. package/dist/default/_virtual/inline-css_src/define/video/skin.js +1 -1
  509. package/dist/default/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  510. package/dist/default/define/audio/minimal-skin.css +1 -3
  511. package/dist/default/define/audio/skin.css +1 -3
  512. package/dist/default/define/live-audio/minimal-skin.css +1 -3
  513. package/dist/default/define/live-audio/skin.css +1 -3
  514. package/dist/default/define/live-video/minimal-skin.css +2 -31
  515. package/dist/default/define/live-video/skin.css +2 -33
  516. package/dist/default/define/media/shaka-video.js +13 -0
  517. package/dist/default/define/media/shaka-video.js.map +1 -0
  518. package/dist/default/define/skin-element.js +0 -8
  519. package/dist/default/define/skin-element.js.map +1 -1
  520. package/dist/default/define/ui/title.js +7 -0
  521. package/dist/default/define/ui/title.js.map +1 -0
  522. package/dist/default/define/video/minimal-skin.css +2 -31
  523. package/dist/default/define/video/skin.css +2 -33
  524. package/dist/default/index.js +2 -1
  525. package/dist/default/media/shaka-video/media.js +9 -0
  526. package/dist/default/media/shaka-video/media.js.map +1 -0
  527. package/dist/default/skins/dist/default/default/tailwind/components/button.js +1 -1
  528. package/dist/default/skins/dist/default/default/tailwind/components/button.js.map +1 -1
  529. package/dist/default/skins/dist/default/default/tailwind/components/menu.js +2 -2
  530. package/dist/default/skins/dist/default/default/tailwind/components/menu.js.map +1 -1
  531. package/dist/default/skins/dist/default/default/tailwind/components/poster.js +1 -7
  532. package/dist/default/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
  533. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js +1 -10
  534. package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  535. package/dist/default/skins/dist/default/minimal/tailwind/components/button.js +1 -1
  536. package/dist/default/skins/dist/default/minimal/tailwind/components/button.js.map +1 -1
  537. package/dist/default/skins/dist/default/minimal/tailwind/components/menu.js +2 -2
  538. package/dist/default/skins/dist/default/minimal/tailwind/components/menu.js.map +1 -1
  539. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js +1 -7
  540. package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
  541. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js +1 -10
  542. package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  543. package/dist/default/ui/poster/poster-element.js +0 -8
  544. package/dist/default/ui/poster/poster-element.js.map +1 -1
  545. package/dist/default/ui/thumbnail/thumbnail-element.js +22 -7
  546. package/dist/default/ui/thumbnail/thumbnail-element.js.map +1 -1
  547. package/dist/default/ui/time/time-element.js +2 -3
  548. package/dist/default/ui/time/time-element.js.map +1 -1
  549. package/dist/default/ui/title/title-element.js +37 -0
  550. package/dist/default/ui/title/title-element.js.map +1 -0
  551. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
  552. package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
  553. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js +1 -1
  554. package/dist/dev/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
  555. package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
  556. package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
  557. package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
  558. package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
  559. package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
  560. package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
  561. package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js +1 -1
  562. package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
  563. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
  564. package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
  565. package/dist/dev/_virtual/inline-css_src/define/video/skin.js +1 -1
  566. package/dist/dev/_virtual/inline-css_src/define/video/skin.js.map +1 -1
  567. package/dist/dev/define/audio/minimal-skin.css +1 -3
  568. package/dist/dev/define/audio/skin.css +1 -3
  569. package/dist/dev/define/live-audio/minimal-skin.css +1 -3
  570. package/dist/dev/define/live-audio/skin.css +1 -3
  571. package/dist/dev/define/live-video/minimal-skin.css +2 -31
  572. package/dist/dev/define/live-video/skin.css +2 -33
  573. package/dist/dev/define/media/shaka-video.d.ts +14 -0
  574. package/dist/dev/define/media/shaka-video.d.ts.map +1 -0
  575. package/dist/dev/define/media/shaka-video.js +13 -0
  576. package/dist/dev/define/media/shaka-video.js.map +1 -0
  577. package/dist/dev/define/skin-element.d.ts +0 -2
  578. package/dist/dev/define/skin-element.d.ts.map +1 -1
  579. package/dist/dev/define/skin-element.js +0 -8
  580. package/dist/dev/define/skin-element.js.map +1 -1
  581. package/dist/dev/define/ui/title.d.ts +8 -0
  582. package/dist/dev/define/ui/title.d.ts.map +1 -0
  583. package/dist/dev/define/ui/title.js +7 -0
  584. package/dist/dev/define/ui/title.js.map +1 -0
  585. package/dist/dev/define/video/minimal-skin.css +2 -31
  586. package/dist/dev/define/video/skin.css +2 -33
  587. package/dist/dev/index.d.ts +3 -2
  588. package/dist/dev/index.js +2 -1
  589. package/dist/dev/media/shaka-video/index.d.ts +2 -0
  590. package/dist/dev/media/shaka-video/media.d.ts +19 -0
  591. package/dist/dev/media/shaka-video/media.d.ts.map +1 -0
  592. package/dist/dev/media/shaka-video/media.js +9 -0
  593. package/dist/dev/media/shaka-video/media.js.map +1 -0
  594. package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js +1 -1
  595. package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js.map +1 -1
  596. package/dist/dev/packages/skins/dist/default/default/tailwind/components/menu.js +2 -2
  597. package/dist/dev/packages/skins/dist/default/default/tailwind/components/menu.js.map +1 -1
  598. package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js +1 -7
  599. package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
  600. package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js +1 -10
  601. package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
  602. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/button.js +1 -1
  603. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/button.js.map +1 -1
  604. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/menu.js +2 -2
  605. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/menu.js.map +1 -1
  606. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js +1 -7
  607. package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
  608. package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js +1 -10
  609. package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
  610. package/dist/dev/ui/captions-button/captions-button-element.d.ts +1 -0
  611. package/dist/dev/ui/captions-button/captions-button-element.d.ts.map +1 -1
  612. package/dist/dev/ui/poster/poster-element.d.ts +0 -2
  613. package/dist/dev/ui/poster/poster-element.d.ts.map +1 -1
  614. package/dist/dev/ui/poster/poster-element.js +0 -8
  615. package/dist/dev/ui/poster/poster-element.js.map +1 -1
  616. package/dist/dev/ui/thumbnail/thumbnail-element.d.ts.map +1 -1
  617. package/dist/dev/ui/thumbnail/thumbnail-element.js +22 -7
  618. package/dist/dev/ui/thumbnail/thumbnail-element.js.map +1 -1
  619. package/dist/dev/ui/time/time-element.d.ts.map +1 -1
  620. package/dist/dev/ui/time/time-element.js +2 -3
  621. package/dist/dev/ui/time/time-element.js.map +1 -1
  622. package/dist/dev/ui/title/title-element.d.ts +18 -0
  623. package/dist/dev/ui/title/title-element.d.ts.map +1 -0
  624. package/dist/dev/ui/title/title-element.js +38 -0
  625. package/dist/dev/ui/title/title-element.js.map +1 -0
  626. package/docs/README.md +1 -1
  627. package/docs/concepts/presets.md +4 -4
  628. package/docs/concepts/skins.md +6 -37
  629. package/docs/how-to/add-a-poster-placeholder.md +52 -0
  630. package/docs/how-to/customize-skins.md +6 -70
  631. package/docs/how-to/migrate-from-mux-player.md +12 -6
  632. package/docs/llms.txt +3 -0
  633. package/docs/reference/feature-fullscreen.md +7 -8
  634. package/docs/reference/feature-metadata.md +141 -0
  635. package/docs/reference/feature-orientation-lock.md +99 -7
  636. package/docs/reference/feature-text-tracks.md +10 -0
  637. package/docs/reference/menu.md +0 -1
  638. package/docs/reference/thumbnail.md +4 -0
  639. package/docs/reference/title.md +211 -0
  640. package/package.json +9 -9
  641. package/cdn/compounds-C4YYLyL2.js +0 -8
  642. package/cdn/compounds-C4YYLyL2.js.map +0 -1
  643. package/cdn/compounds-C73u1MeO.js.map +0 -1
  644. package/cdn/create-player-BU8LDJDL.js +0 -2
  645. package/cdn/create-player-BU8LDJDL.js.map +0 -1
  646. package/cdn/create-player-Db1CIvlK.js.map +0 -1
  647. package/cdn/error-surface-BID4D3DW.js.map +0 -1
  648. package/cdn/error-surface-D0bo71gD.js.map +0 -1
  649. package/cdn/i18n-CpBDXf6M.js +0 -2
  650. package/cdn/media-CQxFuDcv.js +0 -2
  651. package/cdn/media-CQxFuDcv.js.map +0 -1
  652. package/cdn/media-DI6DvYm3.js.map +0 -1
  653. package/cdn/media-mYKOAsk3.js.map +0 -1
  654. package/cdn/media-zReLnePj.js +0 -2
  655. package/cdn/media-zReLnePj.js.map +0 -1
  656. package/cdn/minimal-ui-BXrq3z4U.js +0 -2
  657. package/cdn/poster-element-B5tdJ2ub.js.map +0 -1
  658. package/cdn/pt-ohZp6iM5.js +0 -2
  659. package/cdn/relocation-pipelines-Dh8CcgHw.js.map +0 -1
  660. package/cdn/relocation-pipelines-DunE4gcV.js +0 -2
  661. package/cdn/relocation-pipelines-DunE4gcV.js.map +0 -1
  662. package/cdn/rolldown-runtime-DK3Fl9T5.js +0 -1
  663. package/cdn/rolldown-runtime-w6R9maHv.js +0 -18
  664. package/cdn/skin-element-DrkI8xuM.js.map +0 -1
  665. package/cdn/ui-DayfItun.js +0 -2
  666. package/cdn/ui-PSnD-pv8.js +0 -2
  667. package/cdn/zh-CtBcRYRs.js +0 -2
@@ -1 +0,0 @@
1
- {"version":3,"file":"relocation-pipelines-Dh8CcgHw.js","names":["deriveState","deriveState"],"sources":["../../spf/dist/dev/playback/behaviors/dom/track-load-triggers.js","../../spf/dist/dev/playback/behaviors/establish-start-media-time.js","../../spf/dist/dev/playback/behaviors/derive-cdn-priority.js","../../spf/dist/dev/playback/behaviors/dom/airplay.js","../../spf/dist/dev/playback/behaviors/dom/apply-start-position.js","../../spf/dist/dev/playback/behaviors/dom/recover-end-stall.js","../../spf/dist/dev/playback/behaviors/setup-failover-monitor.js","../../spf/dist/dev/playback/behaviors/sync-preload.js","../../spf/dist/dev/media/abr/quality-selection.js","../../spf/dist/dev/playback/behaviors/track-switching.js","../../spf/dist/dev/media/text/parse-vtt-timestamp-map.js","../../spf/dist/dev/media/text/resolve-vtt-metadata.js","../../spf/dist/dev/playback/primitives/text-segment-load-pipeline.js","../../spf/dist/dev/media/mp4/box.js","../../spf/dist/dev/media/mp4/timestamp-origin.js","../../spf/dist/dev/playback/primitives/head-peek.js","../../spf/dist/dev/playback/primitives/relocation-pipelines.js"],"sourcesContent":["import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/track-load-triggers.ts\n/**\n* Slot-driven FSM. The slot `loadActivated` is the canonical externally-\n* observable state; `deriveState` reads it (and the preconditions) to\n* derive the local FSM state. The slot is *both* the state and the data —\n* no separate internal bookkeeping.\n*\n* ```\n* 'preconditions-unmet' ⟷ 'monitoring' ⟷ 'load-active'\n*\n* preconditions-unmet → monitoring element + URL appear\n* monitoring → load-active slot flips true (listener fires\n* or external write)\n* load-active → monitoring within-state cleanup resets slot\n* (URL or element identity change)\n* any → preconditions-unmet element or URL → undefined\n*\n* any state → destroying → destroyed on destroy()\n* ```\n*/\nfunction deriveState(presentation, mediaElement, loadActivated) {\n\tif (!mediaElement || !presentation?.url) return \"preconditions-unmet\";\n\tif (loadActivated) return \"load-active\";\n\treturn \"monitoring\";\n}\n/**\n* Track preload-overriding events per source.\n*\n* Writes `state.loadActivated = true` the first time a `play` or `seeking`\n* event fires on the attached media element for the current source — or\n* immediately on entry if the element is already committed to loading\n* (`el.autoplay`, `!el.paused`, or `el.seeking`), covering autoplay,\n* native-controls, and direct-DOM-`play()` scenarios.\n*\n* Sticky-true *within a source identity*: subsequent play/pause/seek\n* cycles don't flip back. Source identity = (mediaElement, presentation\n* URL). Either changing — including direct in-place swap with no\n* `undefined` intermediate — resets the slot to `false`.\n*\n* Multi-writer with `hls/adapter.ts:play()` (which writes `true` directly\n* on programmatic play) is intentional — different domains. The adapter\n* records programmatic intent; this behavior is the DOM-side observer.\n* Pre-existing `true` writes are honored because `deriveState` reads the\n* slot — a `true` value routes directly to `'load-active'` without\n* entering `'monitoring'`.\n*\n* @example\n* const reactor = trackLoadTriggers.setup({ state, context });\n* // later:\n* reactor.destroy();\n*/\nfunction trackLoadTriggersSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), state.loadActivated.get()));\n\tconst urlSignal = computed(() => state.presentation.get()?.url);\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\tmonitoring: { effects: () => {\n\t\t\t\tconst el = context.mediaElement.get();\n\t\t\t\tconst setLoadActivated = () => state.loadActivated.set(true);\n\t\t\t\tif (el.autoplay || !el.paused || el.seeking) {\n\t\t\t\t\tsetLoadActivated();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst cleanupPlay = listen(el, \"play\", setLoadActivated);\n\t\t\t\tconst cleanupSeeking = listen(el, \"seeking\", setLoadActivated);\n\t\t\t\treturn () => {\n\t\t\t\t\tcleanupPlay();\n\t\t\t\t\tcleanupSeeking();\n\t\t\t\t};\n\t\t\t} },\n\t\t\t\"load-active\": { effects: () => {\n\t\t\t\tcontext.mediaElement.get();\n\t\t\t\turlSignal.get();\n\t\t\t\treturn () => state.loadActivated.set(false);\n\t\t\t} }\n\t\t}\n\t});\n}\nconst trackLoadTriggers = defineBehavior({\n\tstateKeys: [\"loadActivated\", \"presentation\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: trackLoadTriggersSetup\n});\n//#endregion\nexport { trackLoadTriggers };\n\n//# sourceMappingURL=track-load-triggers.js.map","import { update } from \"../../core/signals/primitives.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation, isResolvedTrack } from \"../../media/types/index.js\";\nimport { findTrackById } from \"../../media/utils/tracks.js\";\n//#region src/playback/behaviors/establish-start-media-time.ts\n/**\n* A single type's own media-timeline origin:\n* `baseMediaDecodeTime/timescale − segmentStartTime` (the `segmentStartTime` term\n* makes it the stream origin even when the first loaded segment isn't the 0th).\n* `undefined` until timescale + baseMediaDecodeTime + segmentStartTime are all present.\n*/\nfunction ownOrigin(data) {\n\tconst { timescale, baseMediaDecodeTime, segmentStartTime } = data ?? {};\n\treturn timescale != null && baseMediaDecodeTime != null && segmentStartTime != null ? baseMediaDecodeTime / timescale - segmentStartTime : void 0;\n}\n/** Snap a below-threshold (incl. negative) origin to `0` so it isn't relocated. */\nfunction thresholdOrigin(origin) {\n\treturn origin < 1 ? 0 : origin;\n}\n/**\n* The **default** — relocate the whole presentation by one shared origin: the `min`\n* across the *selected* A/V tracks' own origins, denormalized onto every type. This\n* single reduce subsumes the \"per-type\" and \"shared\" tiers:\n* - **aligned A/V** — `min` equals each origin (they're equal), so it matches per-type;\n* - **skewed A/V** (e.g. Apple's 44ms audio-lead) — `min` keeps every track's earliest\n* DTS ≥ 0 (relocating by ≤ each own origin never drives one negative) *and* preserves\n* the real skew (per-type would flatten it, desyncing A/V);\n* - **single type / muxed** — `min` of the one origin is that origin.\n*\n* Returns `undefined` for every type until all *selected* types have a complete origin\n* (the shared-`min` barrier). Which types must contribute is read from `ctx` (the\n* selected v/a ids); with no selection context it coordinates across whatever types\n* have data. A shared origin below {@link NEAR_ZERO_ORIGIN_THRESHOLD} is returned as `0`\n* (native — ordinary ~0-PTS VOD isn't relocated).\n*/\nconst deriveSharedMinStartMediaTime = (containerData, ctx) => {\n\tconst contributingTypes = [];\n\tif (ctx.selectedVideoTrackId != null) contributingTypes.push(\"video\");\n\tif (ctx.selectedAudioTrackId != null) contributingTypes.push(\"audio\");\n\tconst origins = (contributingTypes.length > 0 ? contributingTypes : Object.keys(containerData)).map((type) => ownOrigin(containerData[type]));\n\tif (origins.length === 0 || origins.some((origin) => origin === void 0)) return {};\n\tconst shared = thresholdOrigin(Math.min(...origins));\n\tconst out = {};\n\tfor (const type of Object.keys(containerData)) out[type] = shared;\n\treturn out;\n};\n/**\n* Coordination-axis *off* — each type relocates by its own origin, independently. Not\n* the default: it flattens real A/V skew (see {@link deriveSharedMinStartMediaTime}).\n* Kept as an opt-in for compositions that know their A/V is aligned and want to skip\n* the shared-`min` barrier (each type stamps as soon as its own origin is discovered).\n*\n* Caution: {@link NEAR_ZERO_ORIGIN_THRESHOLD} applies independently per type here — if\n* two types' origins straddle it, one snaps to `0` and the other doesn't, injecting up\n* to a threshold's worth of A/V offset. Safe for the intended aligned-A/V opt-in; see\n* `internal/design/spf/live-presentation-timeline-model.md` (collision 5).\n*/\nconst derivePerTypeStartMediaTime = (containerData) => {\n\tconst out = {};\n\tfor (const [type, data] of Object.entries(containerData)) {\n\t\tconst origin = ownOrigin(data);\n\t\tout[type] = origin === void 0 ? void 0 : thresholdOrigin(origin);\n\t}\n\treturn out;\n};\n/**\n* The anchor-source track: the selected video track, falling back to audio\n* (audio-only). Deterministic — never \"first resolved\", which is race-dependent\n* under concurrent resolves.\n*/\nfunction referenceTrackId(ctx) {\n\treturn ctx.selectedVideoTrackId ?? ctx.selectedAudioTrackId;\n}\n/**\n* The live-anchor first-parse gate (the \"parses align\" step of the establishment\n* order). Open for the reference track itself — its local-from-0 placement *is*\n* the presentation timeline (presentation-0 = the join point). Every other track\n* holds until the reference's first parse settles the anchor question: no PDT →\n* local placement is already correct, proceed; PDT anchor → hold until the\n* establishment reactor stamps it onto this track, so the parse takes the\n* `placeOnAnchor` path. Establishment is sticky-once, so an unanchored first\n* parse would be permanently misaligned — that's the race this gate closes.\n*\n* Pairs with the {@link establishStartMediaTime} reactor (the stamp that opens\n* the anchored branch); wire both or neither.\n*/\nconst gateFirstParseOnAnchor = (presentation, ctx, trackId) => {\n\tconst referenceId = referenceTrackId(ctx);\n\tif (referenceId === void 0 || referenceId === trackId) return true;\n\tif (!isResolvedPresentation(presentation)) return false;\n\tconst reference = findTrackById(presentation, referenceId);\n\tif (!reference) return true;\n\tif (!isResolvedTrack(reference)) return false;\n\tif (reference.startDate === void 0) return true;\n\treturn findTrackById(presentation, trackId)?.startDate !== void 0;\n};\n/**\n* Stamp the frozen wall-clock anchor as `startDate` onto every track that lacks\n* one (idempotent — same reference when nothing moved). Unresolved shells pick\n* it up as the `placeOnAnchor` preset; covering *all* tracks in one pass means\n* any track selected later — an ABR rung, another audio language, late captions\n* — resolves already anchored. The reference track's own parser-computed\n* `startDate` reads back as the anchor, so it's naturally left untouched.\n*/\nfunction stampStartDates(presentation, anchor) {\n\tlet changed = false;\n\tconst selectionSets = presentation.selectionSets.map((selectionSet) => ({\n\t\t...selectionSet,\n\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t...switchingSet,\n\t\t\ttracks: switchingSet.tracks.map((track) => {\n\t\t\t\tif (track.startDate !== void 0) return track;\n\t\t\t\tchanged = true;\n\t\t\t\treturn {\n\t\t\t\t\t...track,\n\t\t\t\t\tstartDate: anchor\n\t\t\t\t};\n\t\t\t})\n\t\t}))\n\t}));\n\treturn changed ? {\n\t\t...presentation,\n\t\tselectionSets\n\t} : presentation;\n}\n/** Stamp the derived per-track `startMediaTime` onto the model (idempotent — same reference when nothing moved). */\nfunction stampTracks(presentation, startMediaTimes) {\n\tlet changed = false;\n\tconst selectionSets = presentation.selectionSets.map((selectionSet) => ({\n\t\t...selectionSet,\n\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t...switchingSet,\n\t\t\ttracks: switchingSet.tracks.map((track) => {\n\t\t\t\tconst startMediaTime = startMediaTimes[track.type];\n\t\t\t\tif (startMediaTime === void 0 || track.startMediaTime === startMediaTime) return track;\n\t\t\t\tchanged = true;\n\t\t\t\treturn {\n\t\t\t\t\t...track,\n\t\t\t\t\tstartMediaTime\n\t\t\t\t};\n\t\t\t})\n\t\t}))\n\t}));\n\treturn changed ? {\n\t\t...presentation,\n\t\tselectionSets\n\t} : presentation;\n}\nfunction establishStartMediaTimeSetup({ state, config = {} }) {\n\tconst derive = config.deriveStartMediaTime ?? deriveSharedMinStartMediaTime;\n\tconst selectionContext = () => ({\n\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t});\n\t/** Established once the selected A/V tracks (whichever exist) carry `startMediaTime`. */\n\tconst established = () => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!isResolvedPresentation(presentation)) return false;\n\t\tconst ids = [state.selectedVideoTrackId?.get(), state.selectedAudioTrackId?.get()].filter((id) => id !== void 0);\n\t\treturn ids.length > 0 && ids.every((id) => findTrackById(presentation, id)?.startMediaTime !== void 0);\n\t};\n\treturn createMachineReactor({\n\t\tinitial: \"inactive\",\n\t\tmonitor: () => {\n\t\t\tif (!isResolvedPresentation(state.presentation.get())) return \"inactive\";\n\t\t\treturn established() ? \"established\" : \"monitoring\";\n\t\t},\n\t\tstates: {\n\t\t\tinactive: { entry: () => state.mediaContainerData.set(void 0) },\n\t\t\tmonitoring: { effects: [() => {\n\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\tif (!isResolvedPresentation(presentation)) return;\n\t\t\t\tconst referenceId = referenceTrackId(selectionContext());\n\t\t\t\tconst reference = referenceId === void 0 ? void 0 : findTrackById(presentation, referenceId);\n\t\t\t\tif (!reference || !isResolvedTrack(reference)) return;\n\t\t\t\tconst anchor = reference.startDate;\n\t\t\t\tif (anchor === void 0) return;\n\t\t\t\tupdate(state.presentation, (current) => stampStartDates(current, anchor));\n\t\t\t}, () => {\n\t\t\t\tconst containerData = state.mediaContainerData.get();\n\t\t\t\tif (!containerData) return;\n\t\t\t\tconst startMediaTimes = derive(containerData, selectionContext());\n\t\t\t\tupdate(state.presentation, (current) => stampTracks(current, startMediaTimes));\n\t\t\t}] },\n\t\t\testablished: {}\n\t\t}\n\t});\n}\nconst establishStartMediaTime = {\n\tstateKeys: [\"presentation\", \"mediaContainerData\"],\n\tcontextKeys: [],\n\tsetup: establishStartMediaTimeSetup\n};\n//#endregion\nexport { derivePerTypeStartMediaTime, deriveSharedMinStartMediaTime, establishStartMediaTime, gateFirstParseOnAnchor };\n\n//# sourceMappingURL=establish-start-media-time.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { getCdnId, getOrderedCdnIds } from \"../../media/utils/cdn.js\";\n//#region src/playback/behaviors/derive-cdn-priority.ts\n/**\n* **Session-level CDN priority.** While a presentation is resolved, owns the\n* `cdnPriority` signal: the distinct CDNs the source is served from (origin of\n* each track's URL), in manifest priority order — most-preferred first. Cleared\n* on src unload. The name mirrors HLS content steering's `PATHWAY-PRIORITY`.\n*\n* Redundant-stream sources (e.g. Mux's `?redundant_streams=true`) list the same\n* content on multiple hosts, so the candidate tracks already include one variant\n* per CDN. This behavior publishes *which* CDNs exist and their priority; the\n* `preferActiveCdn` scope rule in `track-switching` reads `cdnPriority` and\n* narrows each type's candidates to the first CDN with surviving tracks — so\n* video / audio / text all resolve from one host (the shared list is the\n* per-presentation coherence guarantee).\n*\n* The \"active\" CDN is not stored — it's derived by the scope as the\n* highest-priority entry in `cdnPriority` that still has tracks after the\n* constraints pre-pass. That makes failover a pure consequence of the (future)\n* failed-CDN constraint: when the primary's tracks are pruned during cooldown,\n* the scope falls to the next CDN; when the primary recovers, it snaps back.\n* Content steering, when it lands, reorders `cdnPriority` (pathway priority as a\n* sort key).\n*\n* Lifecycle: `'presentation-unresolved'` ↔ `'presentation-resolved'`, mirroring\n* `setupTrackSwitching`. The resolved state owns the signal; its entry-returned\n* cleanup clears it on exit (canonical cleanup-binds-to-setup per `reactors.md`).\n*/\nconst samePriority = (a, b) => !!a && a.length === b.length && a.every((cdn, i) => cdn === b[i]);\n/**\n* Manage `cdnPriority`: publish the manifest-ordered CDN list on src load, clear\n* on src unload.\n*\n* @example\n* const reactor = deriveCdnPriority.setup({ state });\n*/\nconst deriveCdnPriority = defineBehavior({\n\tstateKeys: [\"presentation\", \"cdnPriority\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": {\n\t\t\t\t\tentry: () => () => state.cdnPriority.set(void 0),\n\t\t\t\t\teffects: [() => {\n\t\t\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\t\t\tif (!isResolvedPresentation(presentation)) return;\n\t\t\t\t\t\tconst next = getOrderedCdnIds(presentation, getCdnId$1);\n\t\t\t\t\t\tif (!samePriority(peek(state.cdnPriority), next)) state.cdnPriority.set(next);\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { deriveCdnPriority };\n\n//# sourceMappingURL=derive-cdn-priority.js.map","import { computed, peek } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isWebKitAirPlayCapable, listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/airplay.ts\n/**\n* **Bridge MSE playback to AirPlay on WebKit.**\n* MSE streams can't be handed to an AirPlay receiver directly.\n* The WebKit-recommended workaround is to append a fallback\n* `<source type=\"application/x-mpegURL\">` carrying the original manifest URL:\n* Safari exposes the AirPlay picker and, when a wireless target is selected,\n* plays that native-HLS source on the receiver. The session state (WebKit's\n* wireless flag, falling edge debounced — see `REMOTE_INACTIVE_SETTLE_MS`) is\n* written straight to its policy consequences, declared here so the\n* cause→policy mapping stays with the feature:\n*\n* - `state.loadingSuspended` — held while the session is live. Observed by\n* the `loadXSegments` dispatchers (no fetching alongside the receiver) and\n* by `setupMediaSource` (its post-close rebuild waits — attaching runs\n* `element.load()` under the live receiver, which destroys a session still\n* being established). The suspension this behavior holds doubles as its own\n* session fact — same writer, same edges.\n* - `state.startPosition` — one-shot command: the position is captured from\n* the element at the session's settled end (still receiver-mirrored) and\n* written once the rebuild's `load()` resets the element (its `'emptied'`),\n* so `applyStartPosition` applies it to the rebuilt source — never to the\n* pre-rebuild element — and starts it where the receiver left off. The\n* playing state rides the same snapshot but stays behavior-local: this\n* behavior itself calls `play()` once the command has been *consumed* — i.e.\n* after the seek — when the receiver was playing at session end. The whole\n* restore is bound to the presentation the session owned and retracted if\n* that changes.\n*\n* A source change during a live session releases the hold rather than deferring\n* until the session ends, so the rebuild runs and WebKit switches the receiver\n* to the newly-built AirPlay alternate. Measured, not contracted — see the\n* effect below.\n* https://webkit.org/blog/15036/how-to-use-media-source-extensions-with-airplay/\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'airplay-capable'`):\n* gated on a WebKit-AirPlay-capable media element being in scope. The entry —\n* gated on `context.mediaSource` — appends the fallback `<source>` (kept\n* current from `state.presentation`) and enables the AirPlay picker once the\n* MediaSource is open, removing the source the moment the MediaSource detaches\n* so it never survives an MSE teardown. State-exit cleanup (author opt-out,\n* detach, source reset, behavior destroy) removes the source and restores the\n* element's `disableRemotePlayback` default. No-op on non-WebKit platforms\n* (Chromium, Firefox) — `deriveState` never leaves `'preconditions-unmet'`.\n*\n* MMS and AirPlay want *opposite* values of `disableRemotePlayback` on the same\n* element, so it is **sequenced**:\n*\n* - **MMS needs `true` to open.** `setupMediaSource` sets\n* `disableRemotePlayback = true` when it attaches a ManagedMediaSource —\n* Safari won't fire `sourceopen` (and MSE playback never starts) otherwise.\n* - **AirPlay needs `false` to offer the picker.** Flipping to `false` *before*\n* the source opens would prevent `sourceopen`, so the flip is gated on\n* `context.mediaSource` — which `setupMediaSource` publishes exactly once the\n* MS is open. Re-fires per source (the slot clears + republishes on reset).\n* - **Author opt-out wins.** `state.disableRemotePlayback` is the author's\n* intent, written only by the media adapter's IDL property; MMS/programmatic\n* code touch the element's own `disableRemotePlayback` instead. A `true`\n* there is unambiguously the author's choice to disable remote playback, so\n* it holds the machine in `'preconditions-unmet'` and nothing is set up.\n*/\n/**\n* How long WebKit's wireless flag must read *inactive* before the\n* session-driven `loadingSuspended` clears.\n*\n* Measured on Safari 26.4 (macOS): when an AirPlay session engages, Safari\n* closes the ManagedMediaSource and — while its pipeline switches to the\n* native-HLS fallback source — transiently reports\n* `webkitCurrentPlaybackTargetIsWireless === false`, firing the changed\n* event. Trusting an instantaneous inactive reading would release\n* `setupMediaSource`'s rebuild hold mid-handoff; its recovery `load()` then\n* destroys the very session being established. Rising edges apply\n* immediately; only the falling edge waits out this settle window.\n*/\nconst REMOTE_INACTIVE_SETTLE_MS = 1e3;\nfunction deriveState(mediaElement, authorDisabledRemotePlayback) {\n\tif (!mediaElement || !isWebKitAirPlayCapable(mediaElement)) return \"preconditions-unmet\";\n\tif (authorDisabledRemotePlayback) return \"preconditions-unmet\";\n\treturn \"airplay-capable\";\n}\nfunction setupAirPlaySetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(context.mediaElement.get(), state.disableRemotePlayback.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"airplay-capable\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst isSessionActive = () => !!mediaElement.webkitCurrentPlaybackTargetIsWireless;\n\t\t\t\tlet settleTimer;\n\t\t\t\tlet sessionPresentationUrl;\n\t\t\t\tlet pendingRestore;\n\t\t\t\t/** Presentation an already-written `state.startPosition` belongs to. */\n\t\t\t\tlet restoreOwnerUrl;\n\t\t\t\tlet resumeWhenRestored = false;\n\t\t\t\tconst sync = () => {\n\t\t\t\t\tif (isSessionActive()) {\n\t\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\t\tif (!peek(state.loadingSuspended)) sessionPresentationUrl = peek(state.presentation)?.url;\n\t\t\t\t\t\tstate.loadingSuspended.set(true);\n\t\t\t\t\t} else if (peek(state.loadingSuspended)) settleTimer ??= setTimeout(() => {\n\t\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\t\tconst stillActive = isSessionActive();\n\t\t\t\t\t\tif (!stillActive) {\n\t\t\t\t\t\t\tconst ownerUrl = sessionPresentationUrl;\n\t\t\t\t\t\t\tsessionPresentationUrl = void 0;\n\t\t\t\t\t\t\tif (peek(state.presentation)?.url === ownerUrl) pendingRestore = {\n\t\t\t\t\t\t\t\tposition: mediaElement.currentTime,\n\t\t\t\t\t\t\t\twasPlaying: !mediaElement.paused,\n\t\t\t\t\t\t\t\tpresentationUrl: ownerUrl\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.loadingSuspended.set(stillActive);\n\t\t\t\t\t}, REMOTE_INACTIVE_SETTLE_MS);\n\t\t\t\t\telse state.loadingSuspended.set(false);\n\t\t\t\t};\n\t\t\t\tconst listenerCleanup = new AbortController();\n\t\t\t\tlisten(mediaElement, \"webkitcurrentplaybacktargetiswirelesschanged\", sync, { signal: listenerCleanup.signal });\n\t\t\t\tlisten(mediaElement, \"emptied\", () => {\n\t\t\t\t\tif (!pendingRestore) return;\n\t\t\t\t\tconst { position, wasPlaying, presentationUrl } = pendingRestore;\n\t\t\t\t\tpendingRestore = void 0;\n\t\t\t\t\tif (peek(state.presentation)?.url !== presentationUrl) return;\n\t\t\t\t\tstate.startPosition.set(position);\n\t\t\t\t\trestoreOwnerUrl = presentationUrl;\n\t\t\t\t\tresumeWhenRestored = wasPlaying;\n\t\t\t\t}, { signal: listenerCleanup.signal });\n\t\t\t\tconst disposeSourceChangeEnd = effect(() => {\n\t\t\t\t\tconst url = state.presentation.get()?.url;\n\t\t\t\t\tif (!peek(state.loadingSuspended) || url === sessionPresentationUrl) return;\n\t\t\t\t\tsessionPresentationUrl = void 0;\n\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\tstate.loadingSuspended.set(false);\n\t\t\t\t});\n\t\t\t\tconst disposeRestoreWatch = effect(() => {\n\t\t\t\t\tconst url = state.presentation.get()?.url;\n\t\t\t\t\tconst position = state.startPosition.get();\n\t\t\t\t\tif (!restoreOwnerUrl) return;\n\t\t\t\t\tif (url !== restoreOwnerUrl) {\n\t\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\t\tif (position !== void 0) state.startPosition.set(void 0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (position !== void 0) return;\n\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\tif (!resumeWhenRestored) return;\n\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\tmediaElement.play().catch((err) => {\n\t\t\t\t\t\tconsole.warn(\"[setupAirPlay] session-end resume play() rejected — staying paused:\", err);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tlet sourceEl = null;\n\t\t\t\tconst disposeSource = effect(() => {\n\t\t\t\t\tconst hasMediaSource = !!context.mediaSource.get();\n\t\t\t\t\tconst sessionActive = !!state.loadingSuspended.get();\n\t\t\t\t\tconst url = state.presentation.get()?.url ?? \"\";\n\t\t\t\t\tif (!hasMediaSource && !sessionActive) {\n\t\t\t\t\t\tsourceEl?.remove();\n\t\t\t\t\t\tsourceEl = null;\n\t\t\t\t\t} else if (hasMediaSource && (!sourceEl || sourceEl.parentNode !== mediaElement)) {\n\t\t\t\t\t\tsourceEl = document.createElement(\"source\");\n\t\t\t\t\t\tsourceEl.type = \"application/x-mpegURL\";\n\t\t\t\t\t\tmediaElement.append(sourceEl);\n\t\t\t\t\t\tmediaElement.disableRemotePlayback = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (sourceEl) sourceEl.src = url;\n\t\t\t\t});\n\t\t\t\tsync();\n\t\t\t\treturn () => {\n\t\t\t\t\tdisposeSource();\n\t\t\t\t\tdisposeSourceChangeEnd();\n\t\t\t\t\tdisposeRestoreWatch();\n\t\t\t\t\tlistenerCleanup.abort();\n\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\tsourceEl?.remove();\n\t\t\t\t\tsourceEl = null;\n\t\t\t\t\tmediaElement.disableRemotePlayback = true;\n\t\t\t\t\tstate.loadingSuspended.set(false);\n\t\t\t\t\tif (restoreOwnerUrl) {\n\t\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\t\tif (peek(state.startPosition) !== void 0) state.startPosition.set(void 0);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} }\n\t\t}\n\t});\n}\nconst setupAirPlay = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"disableRemotePlayback\",\n\t\t\"loadingSuspended\",\n\t\t\"startPosition\"\n\t],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: setupAirPlaySetup\n});\n//#endregion\nexport { setupAirPlay };\n\n//# sourceMappingURL=airplay.js.map","import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../../media/types/index.js\";\nimport { listen } from \"@videojs/utils/dom\";\nimport { isUndefined } from \"@videojs/utils/predicate\";\n//#region src/playback/behaviors/dom/apply-start-position.ts\n/**\n* **Start playback of a source at a requested position.** `state.startPosition`\n* is a one-shot command — \"when the current source can seek, start there\" —\n* the SPF analogue of hls.js's `startPosition` (and the primitive `EXT-X-START`,\n* resume-where-you-left-off, and MediaSource-recovery restore build on).\n* Consumers (adapters, `setupAirPlay`'s session-end snapshot) write it;\n* this behavior is its sole consumer and clears it after applying, so a\n* stale position can never replay against a later source or rebuild.\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'position-pending'`):\n* gated on `mediaElement + resolved presentation + startPosition` defined.\n* The entry applies the command in two steps:\n*\n* 1. **Seed `state.currentTime` immediately.** The segment loaders anchor\n* their load window on `state.currentTime`; seeding points the *first*\n* fetches at the requested position instead of 0. Multi-writer with\n* `trackCurrentTime` (ongoing DOM mirror) — legitimate: different decision\n* domains (element-derived mirror vs one-shot command), and before\n* HAVE_METADATA no `timeupdate`/`seeking` fires to overwrite the seed.\n* Compose this behavior *after* `trackCurrentTime` so the seed lands after\n* the mirror's attach-time sync.\n* 2. **Seek the element at metadata.** `element.currentTime = position` once\n* `readyState >= HAVE_METADATA` (immediately if already there, else on\n* `loadedmetadata`), then clear `startPosition` (consume). The element\n* clamps the seek to its seekable range per spec, and the resulting\n* `seeking` event flows back through `trackCurrentTime` — from here the\n* ordinary seek path owns the position.\n*\n* Position only — playing/paused is deliberately out of scope. The media\n* element load algorithm forces `paused = true`, so a source that was\n* playing before a rebuild comes back paused at the restored position;\n* resume intent belongs to whoever commands the start (e.g. `setupAirPlay`\n* restores its session-end playing state itself).\n*\n* Deliberately NOT relying on the pre-metadata \"default playback start\n* position\" write (setting `currentTime` at HAVE_NOTHING): cross-browser MSE\n* behavior there is inconsistent; the explicit `loadedmetadata` sequencing is\n* deterministic everywhere.\n*\n* State-exit cleanup (source reset, element detach, destroy) drops the\n* pending `loadedmetadata` listener. An *unapplied* command survives a source\n* reset — \"start the source I'm loading at P\" holds while the presentation\n* routes through unresolved — but is consumed the moment it applies.\n*/\nfunction deriveState(presentation, mediaElement, startPosition) {\n\tif (!mediaElement || !isResolvedPresentation(presentation)) return \"preconditions-unmet\";\n\tif (isUndefined(startPosition)) return \"preconditions-unmet\";\n\treturn \"position-pending\";\n}\nfunction applyStartPositionSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), state.startPosition.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"position-pending\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst position = state.startPosition.get();\n\t\t\t\tstate.currentTime.set(position);\n\t\t\t\tconst apply = () => {\n\t\t\t\t\tmediaElement.currentTime = position;\n\t\t\t\t\tstate.startPosition.set(void 0);\n\t\t\t\t};\n\t\t\t\tif (mediaElement.readyState >= HTMLMediaElement.HAVE_METADATA) {\n\t\t\t\t\tapply();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn listen(mediaElement, \"loadedmetadata\", apply, { once: true });\n\t\t\t} }\n\t\t}\n\t});\n}\nconst applyStartPosition = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"startPosition\",\n\t\t\"currentTime\"\n\t],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: applyStartPositionSetup\n});\n//#endregion\nexport { applyStartPosition };\n\n//# sourceMappingURL=apply-start-position.js.map","import { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { getMinBufferedEnd } from \"../../../media/dom/mse/duration.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/recover-end-stall.ts\n/**\n* Recover the end-of-stream stall that Chrome exhibits on skewed A/V. After\n* `endOfStream`, when the audio and video tracks end a few ms apart (e.g. a source\n* with an A/V PTS skew), Chrome's audio-clock-paced playback freezes the playhead\n* ~50–70ms short of the reachable buffered end and never fires `ended` — so playback\n* hangs at the very end and loop never re-triggers. This behavior watches for the\n* `waiting` event that fires at that freeze and, when the MediaSource is `ended` and\n* the playhead sits at the reachable buffered end, nudges `currentTime` to `duration`\n* to force the native `ended`.\n*\n* **Event-driven, no poll.** `waiting` fires at the instant the playhead stalls\n* (measured ~0ms latency), so there's nothing to gain from polling — and polling would\n* add its interval + a stall threshold before reacting.\n*\n* **Proximity to the *reachable* buffered end** is the discriminator. That end is\n* `getMinBufferedEnd(mediaSource.sourceBuffers)` — the `min` of the per-track (video/audio)\n* SourceBuffer ends, i.e. the furthest point playback can reach — read from the SourceBuffers\n* directly rather than the `mediaElement.buffered` aggregate. Once `endOfStream` is signalled\n* that's the true content end. Requiring the playhead within `endStallNudgeWindow` of it\n* distinguishes the real end-of-stream freeze from a mid-stream buffer-hole stall (which sits\n* far from the buffered end), so we never skip content. The window must exceed the freeze gap;\n* too small would miss the stall (a permanent hang), so the default is generous relative to the\n* measured gap and is config-tunable for empirical tuning.\n*\n* Inert where it shouldn't act: live (the MediaSource never reaches `ended` while the\n* window grows; `duration` is `Infinity`) and streams that end cleanly (no `waiting`).\n*\n* See `internal/decisions/spf/end-of-stream-av-skew-recovery.md`.\n*/\n/** ~2.8× the measured max freeze gap (71ms) — tight, but with headroom against a miss. */\nconst DEFAULT_END_STALL_NUDGE_WINDOW = .2;\n/**\n* Whether a `waiting` should be forced to `ended`: the MediaSource is `ended`, the\n* stream is finite (not live), playback is active (not paused/seeking/already-ended),\n* and the playhead sits within `nudgeWindow` of the reachable buffered end (so it's the\n* true end, not a mid-stream buffer hole). Pure — the behavior supplies the live values.\n*/\nfunction shouldForceEnded(input, nudgeWindow) {\n\tconst { msEnded, durationFinite, paused, seeking, ended, currentTime, bufferedEnd } = input;\n\tif (!msEnded || !durationFinite || paused || seeking || ended || bufferedEnd === void 0) return false;\n\tconst gap = bufferedEnd - currentTime;\n\treturn gap >= 0 && gap < nudgeWindow;\n}\nfunction recoverEndStallSetup({ context, config }) {\n\tconst nudgeWindow = config?.endStallNudgeWindow ?? .2;\n\treturn effect(() => {\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) return;\n\t\tconst onWaiting = () => {\n\t\t\tconst mediaSource = context.mediaSource.get();\n\t\t\tif (shouldForceEnded({\n\t\t\t\tmsEnded: mediaSource?.readyState === \"ended\",\n\t\t\t\tdurationFinite: Number.isFinite(mediaElement.duration),\n\t\t\t\tpaused: mediaElement.paused,\n\t\t\t\tseeking: mediaElement.seeking,\n\t\t\t\tended: mediaElement.ended,\n\t\t\t\tcurrentTime: mediaElement.currentTime,\n\t\t\t\tbufferedEnd: mediaSource ? getMinBufferedEnd(mediaSource.sourceBuffers) : void 0\n\t\t\t}, nudgeWindow)) mediaElement.currentTime = mediaElement.duration;\n\t\t};\n\t\treturn listen(mediaElement, \"waiting\", onWaiting);\n\t});\n}\nconst recoverEndStall = defineBehavior({\n\tstateKeys: [],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: recoverEndStallSetup\n});\n//#endregion\nexport { DEFAULT_END_STALL_NUDGE_WINDOW, recoverEndStall, shouldForceEnded };\n\n//# sourceMappingURL=recover-end-stall.js.map","import { computed, update } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\n//#region src/playback/behaviors/setup-failover-monitor.ts\n/**\n* **CDN failover cooldown.** The expiry half of multi-CDN failover. Fetch sites\n* own the *trip*: on a failed fetch they add the failing CDN (origin) to the\n* `failedCdns` state signal directly. This behavior owns the *expiry*: while a\n* presentation is resolved, it watches `failedCdns` and, for each CDN that\n* appears, schedules a timer to remove it once its cooldown lapses.\n* `track-switching`'s `excludeFailedCdns` constraint prunes a failed CDN's\n* tracks and the active-CDN scope falls to the next one — and back, once the\n* cooldown removes it here.\n*\n* Lifecycle is per-source: timers + `failedCdns` are cleared on exit (a new\n* source starts with a clean slate). Policy (cooldown) is engine config. This is\n* the minimal `network-resilience` slice — a single failure trips a CDN, since\n* transient blips are the retry layer's job (it sits below the fetch sites, so\n* anything that reaches `failedCdns` is already terminal).\n*/\nconst DEFAULT_FAILOVER_MONITOR_CONFIG = { cooldownMs: 3e5 };\n/**\n* Expire failed CDNs from `failedCdns` once their cooldown lapses, for the\n* resolved source.\n*\n* @example\n* const reactor = setupFailoverMonitor.setup({ state });\n*/\nconst setupFailoverMonitor = defineBehavior({\n\tstateKeys: [\"presentation\", \"failedCdns\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst cooldownMs = config.failover?.cooldownMs ?? DEFAULT_FAILOVER_MONITOR_CONFIG.cooldownMs;\n\t\tconst timers = /* @__PURE__ */ new Map();\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": {\n\t\t\t\t\tentry: () => () => {\n\t\t\t\t\t\ttimers.forEach((timer) => clearTimeout(timer));\n\t\t\t\t\t\ttimers.clear();\n\t\t\t\t\t\tstate.failedCdns.set(void 0);\n\t\t\t\t\t},\n\t\t\t\t\teffects: [() => {\n\t\t\t\t\t\t(state.failedCdns.get() ?? []).forEach((cdn) => {\n\t\t\t\t\t\t\tif (timers.has(cdn)) return;\n\t\t\t\t\t\t\tconst timer = setTimeout(() => {\n\t\t\t\t\t\t\t\ttimers.delete(cdn);\n\t\t\t\t\t\t\t\tupdate(state.failedCdns, (current) => current?.filter((c) => c !== cdn));\n\t\t\t\t\t\t\t}, cooldownMs);\n\t\t\t\t\t\t\ttimers.set(cdn, timer);\n\t\t\t\t\t\t});\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { DEFAULT_FAILOVER_MONITOR_CONFIG, setupFailoverMonitor };\n\n//# sourceMappingURL=setup-failover-monitor.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { effect } from \"../../core/signals/effect.js\";\nimport { isStandardPreload } from \"../../media/utils/preload.js\";\n//#region src/playback/behaviors/sync-preload.ts\n/**\n* **Bidirectional sync between `state.preload` and `mediaElement.preload`.**\n*\n* Two effects:\n* - **Read (DOM → state)** — on `context.mediaElement` swap or\n* `state.presentation.url` change, copies `mediaElement.preload` into\n* `state.preload` if it's a W3C value and `state.preload` isn't holding\n* an extended (non-W3C) value. When the DOM has no W3C opinion and\n* `state.preload` is undefined, backfills from `config.defaultPreload`\n* (default-default `'metadata'`) so `state.preload` is never undefined\n* in steady state.\n* - **Write (state → DOM)** — on `state.preload` change or\n* `context.mediaElement` swap, writes `state.preload` back to\n* `mediaElement.preload` if the value is W3C.\n*\n* Extended values (e.g. `'canplay'`) written externally to `state.preload`\n* are sticky: read won't overwrite them, write won't push them to the DOM.\n* All writes are deduped to break echo loops and avoid spurious re-triggers\n* downstream (notably `resolvePresentation`, which reads `state.preload`).\n*/\nfunction syncPreloadSetup({ state, context, config }) {\n\tconst defaultPreload = config?.defaultPreload ?? \"metadata\";\n\tconst presentationUrl = computed(() => state.presentation.get()?.url);\n\tconst cleanupRead = effect(() => {\n\t\tpresentationUrl.get();\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tconst current = peek(state.preload);\n\t\tif (current !== void 0 && !isStandardPreload(current)) return;\n\t\tconst target = mediaElement && isStandardPreload(mediaElement.preload) ? mediaElement.preload : current === void 0 ? defaultPreload : void 0;\n\t\tif (target === void 0 || target === current) return;\n\t\tstate.preload.set(target);\n\t});\n\tconst cleanupWrite = effect(() => {\n\t\tconst next = state.preload.get();\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) return;\n\t\tif (!isStandardPreload(next)) return;\n\t\tif (mediaElement.preload === next) return;\n\t\tmediaElement.preload = next;\n\t});\n\treturn () => {\n\t\tcleanupRead();\n\t\tcleanupWrite();\n\t};\n}\nconst syncPreload = defineBehavior({\n\tstateKeys: [\"preload\", \"presentation\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: syncPreloadSetup\n});\n//#endregion\nexport { syncPreload };\n\n//# sourceMappingURL=sync-preload.js.map","//#region src/media/abr/quality-selection.ts\n/**\n* Default quality selection configuration.\n* Values match Shaka Player upgrade threshold (0.85 = 15% headroom).\n*/\nconst DEFAULT_QUALITY_CONFIG = {\n\tsafetyMargin: .85,\n\tupgradeMargin: 1.15\n};\n/**\n* Resolution as a total pixel count (`width × height`), the basis for\n* comparing two tracks at the same bitrate. Missing dimensions count as 0, so\n* tracks without resolution metadata (e.g. audio) area-compare equal.\n*/\nfunction resolutionArea(track) {\n\treturn (track.width ?? 0) * (track.height ?? 0);\n}\n//#endregion\nexport { DEFAULT_QUALITY_CONFIG, resolutionArea };\n\n//# sourceMappingURL=quality-selection.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { getTracksByType } from \"../../media/utils/tracks.js\";\nimport { SVTA_NO_SUPPORTED_AUDIO_TRACK, SVTA_NO_SUPPORTED_VIDEO_TRACK } from \"../../media/errors.js\";\nimport { matchesPartialTrack, pickTextTrackFromTracks } from \"../../media/primitives/select-tracks.js\";\nimport { applyConstraints, applyRules, excludeUnplayableTracks, sameCandidateSet } from \"../primitives/selection-rules.js\";\nimport { emitError } from \"./collect-errors.js\";\nimport { getCdnId } from \"../../media/utils/cdn.js\";\nimport { DEFAULT_BANDWIDTH_CONFIG, getBandwidthEstimate } from \"../../network/bandwidth-estimator.js\";\nimport { DEFAULT_QUALITY_CONFIG, resolutionArea } from \"../../media/abr/quality-selection.js\";\n//#region src/playback/behaviors/track-switching.ts\n/**\n* **Per-type track selection as a rule chain.** While a presentation is\n* resolved, owns that type's `selected{Video,Audio,Text}TrackId` signal: pick a\n* default, react to user intent and algorithmic ranking, and clear it on src\n* unload.\n*\n* Selection runs in two stages. First a **hard-constraints pre-pass**\n* (`applyConstraints`) prunes the unplayable from the candidate set — the\n* failed-CDN constraint (`excludeFailedCdns`, failover cooldown) and the\n* capability constraint (`excludeUnplayableTracks`, codec support). Then a small\n* ordered chain of rules (`applyRules`) picks among the survivors. Each constraint/rule reads the signals it needs at apply\n* time, so the effect subscribes to exactly what was consulted. The chain is\n* three rules, most authoritative first:\n*\n* 1. **user intent** — a soft filter on `user*TrackSelection`: narrow to the\n* partial-track match; an empty match falls through to the full set.\n* 2. **active CDN** — a soft filter on `cdnPriority` (`preferActiveCdn`):\n* narrow to the highest-priority CDN that still has tracks; an empty match\n* falls through. Shared by video and audio, so every type stays on one CDN\n* (`deriveCdnPriority` owns the list). No-op for non-redundant sources.\n* 3. **ranking** — the terminal sort: `rankByBandwidth`, shared by video and\n* audio. Fitting tracks (within the throughput threshold) first, highest\n* bitrate first; over-throughput tracks after, least-over first. Hysteresis\n* via boosting the current track's sort weight by `upgradeMargin`.\n*\n* The composer's early-bail (one survivor → stop) is load-bearing: a user\n* selection that narrows to a single track is the pick without the ranker\n* running, so the bandwidth estimate is never read and the effect doesn't\n* re-fire on bandwidth while that choice holds.\n*\n* Lifecycle: `'presentation-unresolved'` ↔ `'presentation-resolved'`. The\n* resolved state owns the signal; its entry-returned cleanup clears it on exit\n* (canonical cleanup-binds-to-setup per `reactors.md`).\n*\n* The pick is the chain's result mapped to a slot value by `resolveSelection`\n* (default: the head, `applyRules(...)[0]`). Each variant supplies its\n* **constraints + rule chain (+ optional resolveSelection)** via config;\n* `setupTrackSwitching` owns only the lifecycle and runs what it's given. Video\n* and audio run constraints `[excludeFailedCdns, excludeUnplayableTracks]` then\n* rules `[filterByUserSelection, preferActiveCdn, rankByBandwidth]` and take the\n* head; `switchVideoTrack` also accepts ABR tuning config, `switchAudioTrack`\n* takes none. `switchTextTrack` differs — selection is *optional* (captions are\n* opt-in / off-able), so it runs `[excludeFailedCdns]` + `[preferActiveCdn]` and\n* supplies a text terminal (`pickResolvedTextTrack`) that resolves standing user\n* intent (`userTextTrackSelection`, incl. `'off'`) and may yield no selection.\n* (The active-CDN *scope* is the sticky-pick half of multi-CDN; the failed-CDN\n* *constraint* is the failover half — prune the cooled-down CDN, the scope falls\n* to the next.)\n*\n* When the pre-pass prunes a type that *has* tracks to empty, the behavior\n* clears the selection (so a now-unplayable pick can't linger and stall) and\n* reports the type's `noSupportedTrackCode`. Which constraint emptied the set is\n* deliberately not consulted — the behavior reads no constraint's state, so the\n* chain stays composable. A type with no tracks at all is left alone; that's a\n* legitimate source shape, not a failure. The late `createSourceBuffer` check\n* stays as the structural backstop.\n*\n* Deferred: audio's preferred-language / default-track selection as standing\n* soft-filter rules (previously the empty-slot picker, dropped in the move to\n* the rule chain).\n*/\n/** Default initial-bandwidth value before bandwidth measurements arrive. */\nconst DEFAULT_INITIAL_BANDWIDTH = 5e6;\n/**\n* User intent — a soft filter. Narrows to tracks matching the partial-track\n* selection in `user*TrackSelection`; an empty match falls through (the\n* composer skips it) to the unfiltered set — e.g. a stale id from a previous\n* source.\n*/\nfunction filterByUserSelection(tracks, { state, config }) {\n\tconst key = config.userSelectionKey;\n\tif (!key) return tracks;\n\tconst filter = state[key]?.get();\n\treturn filter ? tracks.filter((track) => matchesPartialTrack(track, filter)) : tracks;\n}\n/**\n* Failed-CDN constraint — a *hard* filter (constraints pre-pass), shared by\n* video and audio. Removes tracks served from a CDN currently in failover\n* cooldown (`failedCdns`, written by the failover monitor). Removed tracks are never\n* attempted; the scope then narrows to the next surviving CDN in `cdnPriority`,\n* and snaps back to the primary once it leaves cooldown.\n*\n* Passes everything through when there's no `failedCdns` signal/value. When it\n* prunes *every* track (all CDNs cooled down), the empty result is preserved\n* (per `applyConstraints`) — \"nothing playable,\" which clears the selection (no\n* pick); a later CDN recovery refills the candidate set and re-picks.\n*/\nfunction excludeFailedCdns(tracks, { state, config }) {\n\tconst failed = state.failedCdns?.get();\n\tif (!failed?.length) return tracks;\n\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\tconst failedSet = new Set(failed);\n\treturn tracks.filter((track) => !failedSet.has(getCdnId$1(track.url)));\n}\n/**\n* Active-CDN scope — a soft filter, shared by video and audio. Narrows to the\n* highest-priority CDN in `cdnPriority` (owned by `deriveCdnPriority`) that\n* still has tracks, so every track type stays on one CDN. A redundant-streams\n* source lists the same renditions on multiple hosts; this keeps the pick on one\n* host rather than letting the ranker drift across them.\n*\n* \"Active\" is derived, not stored: constraints run before the rule chain, so a\n* failed CDN's tracks are already pruned by the time this runs — \"first CDN with\n* survivors\" *is* the active CDN, and it falls through to the next on failover\n* (and snaps back to the primary when it recovers). Content steering reorders\n* `cdnPriority`; this rule just honors the order.\n*\n* Soft-filter semantics: passes through when there's no `cdnPriority` signal/value\n* (no preference) or when nothing matches (`applyRules` skips an empty result).\n* Non-redundant sources have one CDN, so the narrow is a no-op.\n*\n* The CDN-id derivation defaults to origin-based `getCdnId`, overridable via the\n* `getCdnId` config — it must match the one `deriveCdnPriority` used to build\n* `cdnPriority`, or no track's CDN would ever equal an entry.\n*/\nfunction preferActiveCdn(tracks, { state, config }) {\n\tconst cdnPriority = state.cdnPriority?.get();\n\tif (!cdnPriority?.length) return tracks;\n\tconst getCdnId$2 = config.getCdnId ?? getCdnId;\n\tfor (const cdn of cdnPriority) {\n\t\tconst tracksUsingCdn = tracks.filter((track) => getCdnId$2(track.url) === cdn);\n\t\tif (tracksUsingCdn.length) return tracksUsingCdn;\n\t}\n\treturn tracks;\n}\n/**\n* Bandwidth ranking — the terminal sort, shared by video and audio. Orders by\n* the throughput estimate: tracks within the bandwidth threshold first\n* (fitting), highest bitrate first; then over-threshold tracks, least-over\n* first. The head is the best-quality track that fits, falling back to the\n* smallest over-throughput track when nothing fits.\n*\n* Hysteresis without temporal state: the current track's effective bitrate is\n* boosted by `upgradeMargin` in the fitting sort, so a higher track only\n* outranks it once it clears `current.bitrate * upgradeMargin` (no flapping on\n* marginal bandwidth gains). Downgrades fall out for free — a current track\n* over the threshold isn't in the fitting set to be boosted, so the best fit (a\n* downgrade) wins immediately. Equal-bitrate tracks break by resolution (higher\n* `width × height` first), so an equal-bitrate ladder never picks a lower-\n* quality rendition by manifest order; audio tracks carry no dimensions, so\n* they area-compare equal and a stable sort keeps their candidate order (e.g.\n* same-bitrate language variants). Early-bail skips this rule when a prior one\n* narrowed to a single track, so the estimate is neither read nor subscribed\n* while that holds.\n*/\nfunction rankByBandwidth(tracks, { state, config }) {\n\tconst safetyMargin = config.quality?.safetyMargin ?? DEFAULT_QUALITY_CONFIG.safetyMargin;\n\tconst upgradeMargin = config.quality?.upgradeMargin ?? DEFAULT_QUALITY_CONFIG.upgradeMargin;\n\tconst initialBandwidth = config.initialBandwidth ?? 5e6;\n\tconst bandwidthConfig = {\n\t\t...DEFAULT_BANDWIDTH_CONFIG,\n\t\t...config.bandwidth\n\t};\n\tif (!state.bandwidthState) console.debug(\"[track-switching] rankByBandwidth: no bandwidthState signal in composition; ranking on initialBandwidth\");\n\tconst threshold = getBandwidthEstimate(state.bandwidthState?.get(), initialBandwidth, bandwidthConfig) * safetyMargin;\n\tconst currentId = state[config.selectionKey].get();\n\tconst bitrate = (track) => track.bandwidth ?? 0;\n\tconst rank = (track) => track.id === currentId ? bitrate(track) * upgradeMargin : bitrate(track);\n\tconst fitting = tracks.filter((track) => bitrate(track) <= threshold).sort((a, b) => rank(b) - rank(a) || resolutionArea(b) - resolutionArea(a));\n\tconst over = tracks.filter((track) => bitrate(track) > threshold).sort((a, b) => bitrate(a) - bitrate(b) || resolutionArea(b) - resolutionArea(a));\n\treturn [...fitting, ...over];\n}\n/**\n* Default final pick: the chain head. `applyRules` never narrows to nothing and\n* early-bails to a single survivor, so video and audio always converge to a\n* track and the head is the pick.\n*/\nfunction selectChainHead(candidates) {\n\treturn candidates[0].id;\n}\n/**\n* Terminal pick for text — the `resolveSelection` the text variant supplies.\n* Resolves the standing `userTextTrackSelection` intent against the chain's\n* survivors (already CDN-failover-pruned and active-CDN-scoped):\n*\n* - `'off'` → no selection (clear the slot). Sticky through re-evaluation, so a\n* live refresh or failover re-run can't re-assert a default.\n* - explicit `Partial<TextTrack>` → narrow to the match (language-based). A\n* stale pick whose match is gone (e.g. the language dropped on a source\n* change) falls through to the default policy.\n* - auto (`undefined`) → the opt-in default policy (`preferredSubtitleLanguage`\n* → `DEFAULT=YES + AUTOSELECT=YES` → none), via `pickTextTrackFromTracks`.\n*\n* Returning `undefined` is a real outcome (captions are opt-in), which is why the\n* text variant relies on `setupTrackSwitching`'s no-selection seam.\n*/\nfunction pickResolvedTextTrack(candidates, { state, config }) {\n\tconst intent = state.userTextTrackSelection?.get();\n\tif (intent === \"off\") return void 0;\n\tif (intent) {\n\t\tconst matched = candidates.filter((track) => matchesPartialTrack(track, intent));\n\t\tif (matched.length) return matched[0].id;\n\t}\n\treturn pickTextTrackFromTracks(candidates, config);\n}\nfunction setupTrackSwitching(deps) {\n\tconst { state, config } = deps;\n\tconst { selectionKey, getTracks, rules, resolveSelection = selectChainHead, noSupportedTrackCode } = config;\n\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\tconst candidateSet = computed(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!isResolvedPresentation(presentation)) return [];\n\t\treturn applyConstraints(config.constraints ?? [], getTracks(presentation), deps);\n\t}, { equals: sameCandidateSet });\n\treturn createMachineReactor({\n\t\tinitial: \"presentation-unresolved\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"presentation-unresolved\": {},\n\t\t\t\"presentation-resolved\": {\n\t\t\t\tentry: () => () => state[selectionKey].set(void 0),\n\t\t\t\teffects: [() => {\n\t\t\t\t\tconst tracks = candidateSet.get();\n\t\t\t\t\tif (!tracks.length) {\n\t\t\t\t\t\tconst presentation = peek(state.presentation);\n\t\t\t\t\t\tif (isResolvedPresentation(presentation) && getTracks(presentation).length > 0) {\n\t\t\t\t\t\t\tif (noSupportedTrackCode !== void 0) emitError(state, {\n\t\t\t\t\t\t\t\tcode: noSupportedTrackCode,\n\t\t\t\t\t\t\t\tdata: { selectionKey }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tstate[selectionKey].set(void 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst candidates = applyRules(rules, tracks, deps);\n\t\t\t\t\tif (!candidates.length) {\n\t\t\t\t\t\tconsole.error(\"[track-switching] applyRules returned no candidates\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tstate[selectionKey].set(resolveSelection(candidates, deps));\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\t});\n}\n/**\n* Manage `selectedVideoTrackId`: pick a default on src load, dynamically\n* adjust based on bandwidth, clear on src unload. Honors\n* `userVideoTrackSelection` as a partial-track constraint on candidates;\n* short-circuits ABR when the constraint narrows to a single track.\n*\n* @example\n* const reactor = switchVideoTrack.setup({ state });\n*/\nconst switchVideoTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedVideoTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedVideoTrackId\",\n\t\t\tuserSelectionKey: \"userVideoTrackSelection\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"video\"),\n\t\t\tconstraints: [excludeFailedCdns, excludeUnplayableTracks],\n\t\t\trules: [\n\t\t\t\tfilterByUserSelection,\n\t\t\t\tpreferActiveCdn,\n\t\t\t\trankByBandwidth\n\t\t\t],\n\t\t\tnoSupportedTrackCode: SVTA_NO_SUPPORTED_VIDEO_TRACK\n\t\t}\n\t})\n});\n/**\n* Manage `selectedAudioTrackId`: pick a default on src load, narrow by\n* `userAudioTrackSelection` filter, re-pick on filter change, clear on\n* src unload.\n*\n* Mid-stream flush on language switch is handled by the segment-loader's\n* `planTasks` (see `playback/actors/dom/segment-loader.ts`) — not this\n* behavior. Same split as the video pipeline: slot owner writes; loader\n* orchestrates segment + flush plans.\n*\n* @example\n* const reactor = switchAudioTrack.setup({ state });\n*/\nconst switchAudioTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedAudioTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedAudioTrackId\",\n\t\t\tuserSelectionKey: \"userAudioTrackSelection\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"audio\"),\n\t\t\tconstraints: [excludeFailedCdns, excludeUnplayableTracks],\n\t\t\trules: [\n\t\t\t\tfilterByUserSelection,\n\t\t\t\tpreferActiveCdn,\n\t\t\t\trankByBandwidth\n\t\t\t],\n\t\t\tnoSupportedTrackCode: SVTA_NO_SUPPORTED_AUDIO_TRACK\n\t\t}\n\t})\n});\n/**\n* Manage `selectedTextTrackId` as the single-writer **output** of standing user\n* intent (`userTextTrackSelection`) resolved against the playable, CDN-scoped\n* text renditions: clear on src unload; re-resolve when a CDN fails or recovers.\n*\n* Unlike video/audio, the selection is *optional* — captions are opt-in and the\n* user can turn them off — so the chain skips the bandwidth ranker and the shared\n* user-selection filter, and supplies a text-specific terminal\n* (`pickResolvedTextTrack`) that may resolve to no-selection via\n* `setupTrackSwitching`'s `resolveSelection` seam. Constraints are failed-CDN only\n* (`excludeUnplayableTracks`/`canPlayTrack` is MSE-based — the wrong probe for\n* text, whose playability is SPF-parser support); the active-CDN scope co-locates\n* captions with the surviving CDN on failover.\n*\n* @example\n* const reactor = switchTextTrack.setup({ state, config: { preferredSubtitleLanguage: 'en' } });\n*/\nconst switchTextTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedTextTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedTextTrackId\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"text\"),\n\t\t\tconstraints: [excludeFailedCdns],\n\t\t\trules: [preferActiveCdn],\n\t\t\tresolveSelection: pickResolvedTextTrack\n\t\t}\n\t})\n});\n//#endregion\nexport { DEFAULT_INITIAL_BANDWIDTH, setupTrackSwitching, switchAudioTrack, switchTextTrack, switchVideoTrack };\n\n//# sourceMappingURL=track-switching.js.map","//#region src/media/text/parse-vtt-timestamp-map.ts\nconst TIMESTAMP_MAP_PREFIX = \"X-TIMESTAMP-MAP=\";\n/**\n* Scrape a WebVTT segment's `X-TIMESTAMP-MAP` header into a {@link TimestampMap}\n* — the only header line we need to correlate LOCAL cue times with the media\n* presentation timeline. Deliberately *not* a WebVTT parser: cue parsing stays\n* with the browser's native `<track>` parser (which drops this line); this reads\n* just the one header field the native path discards.\n*\n* Returns `undefined` when the segment carries no map (e.g. cues already in\n* absolute presentation time) — per the HLS spec that means LOCAL 0 maps to\n* MPEGTS 0. Tolerant of attribute order and `[HH:]MM:SS.mmm` LOCAL forms.\n*/\nfunction parseVttTimestampMap(text) {\n\tconst timestampMapLine = text.split(/\\r\\n|\\r|\\n/).find((line) => line.startsWith(TIMESTAMP_MAP_PREFIX));\n\treturn timestampMapLine ? parseTimestampMapBody(timestampMapLine.slice(16)) : void 0;\n}\nconst TimeStampMapParserMap = {\n\tLOCAL: parseWebVttTimestamp,\n\tMPEGTS: (v) => +v\n};\nfunction parseTimestampMapBody(body) {\n\treturn Object.fromEntries(body.split(\",\").map((kvStr) => {\n\t\tconst [k, v] = kvStr.split(/:(.*)/).map((kOrV) => kOrV.trim());\n\t\treturn [k?.toLowerCase(), TimeStampMapParserMap[k](v)];\n\t}));\n}\n/** Seconds-per-unit for the `[HH:]MM:SS.mmm` parts, right-aligned so a missing HH just drops the leading weight. */\nconst VTT_TIMESTAMP_WEIGHTS = [\n\t3600,\n\t60,\n\t1,\n\t.001\n];\nfunction parseWebVttTimestamp(value) {\n\tconst parts = value.split(/[:.]/);\n\treturn parts.reduce((acc, val, i) => acc + +val * (VTT_TIMESTAMP_WEIGHTS[i + 4 - parts.length] ?? 0), 0);\n}\n//#endregion\nexport { parseVttTimestampMap };\n\n//# sourceMappingURL=parse-vtt-timestamp-map.js.map","import { parseVttTimestampMap } from \"./parse-vtt-timestamp-map.js\";\n//#region src/media/text/resolve-vtt-metadata.ts\n/**\n* Header-level text-segment metadata — the `X-TIMESTAMP-MAP` correlation scraped from\n* a VTT segment's raw bytes. DOM-free (a plain fetch + regex parse): the native\n* `<track>` parser in `media/dom/text` (`resolveVttSegment`) discards this header, so a\n* caller that needs it (e.g. non-zero-PTS relocation) fetches the bytes itself.\n*/\n/**\n* Fetch a VTT segment and scrape only its header metadata (no cue parsing).\n*\n* The native `<track>` parser (`media/dom/text`'s `resolveVttSegment`) discards\n* `X-TIMESTAMP-MAP`, so reading it requires the raw bytes. This is a separate,\n* caller-controlled fetch — the caller decides *when* metadata is needed (e.g.\n* once per source) rather than paying for it on every segment.\n*/\nasync function resolveVttSegmentMetadata(url) {\n\treturn { timestampMap: parseVttTimestampMap(await fetch(url).then((response) => response.text())) };\n}\n//#endregion\nexport { resolveVttSegmentMetadata };\n\n//# sourceMappingURL=resolve-vtt-metadata.js.map","//#region src/playback/primitives/text-segment-load-pipeline.ts\n/**\n* Base-step view of the loader's wiring, folded into `config` by\n* `createTextTrackSegmentLoaderActor` so base steps read it from the uniform passthrough\n* — present in both composition and standalone use. `config` is loose (`object`), so\n* assert the shape here (mirrors the v/a loader's `stepWiring`). The sink is the\n* structural {@link CueSink}, not the concrete actor.\n*/\nfunction textStepWiring(deps) {\n\treturn deps.config;\n}\n/** Resolve the op's cues (via the injected host primitive) into the frame. The text analog of `fetchStep`. */\nconst resolveCuesStep = async (frame, signal, deps) => {\n\tconst cues = await textStepWiring(deps).resolveSegment(frame.op.segment.url);\n\tif (signal.aborted) return;\n\tframe.cues = cues;\n};\n/** Dispatch the frame's cues to the TextTracksActor as `add-cues`. The text analog of `dispatchStep`. */\nconst dispatchCuesStep = (frame, _signal, deps) => {\n\tconst { op } = frame;\n\ttextStepWiring(deps).textTracksActor.send({\n\t\ttype: \"add-cues\",\n\t\tmeta: {\n\t\t\ttrackId: op.trackId,\n\t\t\tid: op.segment.id,\n\t\t\tstartTime: op.segment.startTime,\n\t\t\tduration: op.segment.duration\n\t\t},\n\t\tcues: frame.cues ?? []\n\t});\n};\n/** Tier 0 default: resolve then dispatch. No relocation vocabulary. */\nconst DEFAULT_TEXT_MESSAGE_PIPELINES = () => [resolveCuesStep, dispatchCuesStep];\n//#endregion\nexport { DEFAULT_TEXT_MESSAGE_PIPELINES, dispatchCuesStep, resolveCuesStep, textStepWiring };\n\n//# sourceMappingURL=text-segment-load-pipeline.js.map","//#region src/media/mp4/box.ts\nfunction toDataView(data) {\n\treturn data instanceof Uint8Array ? new DataView(data.buffer, data.byteOffset, data.byteLength) : new DataView(data);\n}\n/** Read a 4-character box type / FourCC at `offset`. */\nfunction readFourCC(view, offset) {\n\treturn String.fromCharCode(view.getUint8(offset), view.getUint8(offset + 1), view.getUint8(offset + 2), view.getUint8(offset + 3));\n}\n/** Iterate the boxes directly contained in `[start, end)`. */\nfunction* iterateBoxes(view, start = 0, end = view.byteLength) {\n\tlet offset = start;\n\twhile (offset + 8 <= end) {\n\t\tlet size = view.getUint32(offset);\n\t\tconst type = readFourCC(view, offset + 4);\n\t\tlet dataStart = offset + 8;\n\t\tif (size === 1) {\n\t\t\tsize = Number(view.getBigUint64(offset + 8));\n\t\t\tdataStart = offset + 16;\n\t\t} else if (size === 0) size = end - offset;\n\t\tif (size < dataStart - offset) return;\n\t\tyield {\n\t\t\ttype,\n\t\t\tstart: offset,\n\t\t\tdataStart,\n\t\t\tend: offset + size\n\t\t};\n\t\toffset += size;\n\t}\n}\n/** Iterate the direct child boxes of a given `type` within `[start, end)`. */\nfunction* iterateBoxesOfType(view, type, start = 0, end = view.byteLength) {\n\tfor (const box of iterateBoxes(view, start, end)) if (box.type === type) yield box;\n}\n/**\n* Depth-first descent to the first box matching a nested path, e.g.\n* `['moov', 'trak', 'mdia', 'mdhd']`. Returns `undefined` if any level is\n* absent.\n*/\nfunction findBox(view, path, start = 0, end = view.byteLength) {\n\tconst [head, ...rest] = path;\n\tfor (const box of iterateBoxes(view, start, end)) {\n\t\tif (box.type !== head) continue;\n\t\tif (rest.length === 0) return box;\n\t\tconst found = findBox(view, rest, box.dataStart, box.end);\n\t\tif (found) return found;\n\t}\n}\n/**\n* Read the version byte of a FullBox — the `version(1) + flags(3)` header at the\n* start of the payload of `mdhd` / `tkhd` / `tfdt` / `hdlr` / `elst` / etc.\n*/\nfunction readFullBoxVersion(view, dataStart) {\n\treturn view.getUint8(dataStart);\n}\n//#endregion\nexport { findBox, iterateBoxes, iterateBoxesOfType, readFourCC, readFullBoxVersion, toDataView };\n\n//# sourceMappingURL=box.js.map","import { findBox, iterateBoxesOfType, readFourCC, readFullBoxVersion, toDataView } from \"./box.js\";\n//#region src/media/mp4/timestamp-origin.ts\n/**\n* Decode-time origin extraction from fMP4/CMAF segments.\n*\n* Non-zero-PTS sources encode media at a non-zero start time (an instant clip\n* starting at asset second 60, an Apple bipbop asset starting at 10s, …). To\n* relocate such a source onto a 0-based presentation timeline via\n* `SourceBuffer.timestampOffset`, the engine needs that start time — the\n* **decode-time origin** — read straight from the container:\n*\n* - `tfdt.baseMediaDecodeTime` (from a media segment's `moof`) — the decode\n* time of the segment's first sample, in the track's media timescale. This is\n* a DTS: relocating by `−(baseMediaDecodeTime / timescale)` lands the earliest\n* DTS at exactly 0, so a negative-DTS append failure on Chromium is impossible\n* by construction.\n* - `mdhd.timescale` (from the init segment's `moov`) — ticks per second for\n* that track, needed to convert the raw tick count to seconds.\n*\n* ## Presumptive vs. track-selected reads\n*\n* The two variants share only the leaf field-readers (`mdhd` timescale, `tfdt`\n* baseMediaDecodeTime) and the box walker. Everything else differs, and the\n* split is deliberate so the presumptive pair is *proportionally* smaller under\n* tree-shaking:\n*\n* - **Presumptive** — {@link readFirstMediaTimescale} / {@link readFirstBaseMediaDecodeTime}\n* read the first `mdhd` timescale and first `tfdt` baseMediaDecodeTime. There's\n* no `track_id` (nothing to match against) and no `trak`/`traf` iteration — a\n* direct `findBox` to the first leaf. Correct when the init/segment holds a\n* single media track (the common CMAF case). A caption-free platform imports\n* only this pair and tree-shakes away all the matching machinery below.\n* - **Track-selected** — {@link findMediaTrack} / {@link readBaseMediaDecodeTime}.\n* `findMediaTrack` returns `{ trackId, timescale }` for the `trak` whose `hdlr`\n* handler matches; `readBaseMediaDecodeTime` takes that `trackId` and reads the\n* `traf` whose `tfhd.track_id` matches. The `track_id` is the join that ties one\n* track's timescale to the *same* track's baseMediaDecodeTime — required when a\n* source muxes CEA-608/708 captions (a `clcp` track shares the same `moov` and\n* `moof`, each track with its own timescale + baseMediaDecodeTime, so a\n* presumptive read there risks `300000 / 6000 = 50s` instead of\n* `60000 / 6000 = 10s`). This pair adds `trak`/`traf` iteration plus the handler\n* and `track_id` reads. We only ever ask for buffered media handlers\n* (`vide` / `soun`); the caption track is never selected — we read the origin,\n* not the captions (caption *rendering* is out of scope).\n*\n* Both raw values are returned un-divided to leave room for an edit-list (`elst`)\n* presentation-time correction term if a source ever carries one — the validated\n* streams do not.\n*/\n/**\n* The `track_ID` + timescale of the `trak` whose `mdhd` handler matches\n* `handlerType`, skipping a muxed `clcp` caption track. `undefined` if no\n* matching track exists.\n*/\nfunction findMediaTrack(initSegment, handlerType) {\n\tconst view = toDataView(initSegment);\n\tconst moov = findBox(view, [\"moov\"]);\n\tif (!moov) return void 0;\n\tfor (const trak of iterateBoxesOfType(view, \"trak\", moov.dataStart, moov.end)) {\n\t\tif (readTrakHandler(view, trak) !== handlerType) continue;\n\t\tconst tkhd = findBox(view, [\"tkhd\"], trak.dataStart, trak.end);\n\t\tconst mdhd = findBox(view, [\"mdia\", \"mdhd\"], trak.dataStart, trak.end);\n\t\tif (!tkhd || !mdhd) return void 0;\n\t\treturn {\n\t\t\ttrackId: view.getUint32(tkhd.dataStart + 4 + (readFullBoxVersion(view, tkhd.dataStart) === 1 ? 16 : 8)),\n\t\t\ttimescale: readMdhdTimescale(view, mdhd)\n\t\t};\n\t}\n}\n/**\n* `baseMediaDecodeTime` (in the track's media timescale) from the `traf` matching\n* `trackId` (via `tfhd.track_id`) — required for muxed multi-`traf` segments.\n* `undefined` if no matching `tfdt` exists.\n*/\nfunction readBaseMediaDecodeTime(mediaSegment, trackId) {\n\tconst view = toDataView(mediaSegment);\n\tconst moof = findBox(view, [\"moof\"]);\n\tif (!moof) return void 0;\n\tfor (const traf of iterateBoxesOfType(view, \"traf\", moof.dataStart, moof.end)) {\n\t\tif (readTrafTrackId(view, traf) !== trackId) continue;\n\t\tconst tfdt = findBox(view, [\"tfdt\"], traf.dataStart, traf.end);\n\t\treturn tfdt ? readTfdtBaseMediaDecodeTime(view, tfdt) : void 0;\n\t}\n}\n/** `mdhd.timescale`: FullBox version(1)+flags(3) + dates (v0: 4+4, v1: 8+8) + timescale. */\nfunction readMdhdTimescale(view, mdhd) {\n\treturn view.getUint32(mdhd.dataStart + 4 + (readFullBoxVersion(view, mdhd.dataStart) === 1 ? 16 : 8));\n}\n/** `tfdt.baseMediaDecodeTime`: FullBox, then the value — v0: (4), v1: (8). */\nfunction readTfdtBaseMediaDecodeTime(view, tfdt) {\n\tconst at = tfdt.dataStart + 4;\n\treturn readFullBoxVersion(view, tfdt.dataStart) === 1 ? Number(view.getBigUint64(at)) : view.getUint32(at);\n}\n/** `hdlr.handler_type` for a `trak`: FullBox version(1)+flags(3) + pre_defined(4) + handler_type(4). */\nfunction readTrakHandler(view, trak) {\n\tconst hdlr = findBox(view, [\"mdia\", \"hdlr\"], trak.dataStart, trak.end);\n\treturn hdlr ? readFourCC(view, hdlr.dataStart + 8) : void 0;\n}\n/** `tfhd.track_id` for a `traf`: FullBox version(1)+flags(3) + track_id(4). */\nfunction readTrafTrackId(view, traf) {\n\tconst tfhd = findBox(view, [\"tfhd\"], traf.dataStart, traf.end);\n\treturn tfhd ? view.getUint32(tfhd.dataStart + 4) : void 0;\n}\n//#endregion\nexport { findMediaTrack, readBaseMediaDecodeTime };\n\n//# sourceMappingURL=timestamp-origin.js.map","//#region src/playback/primitives/head-peek.ts\n/**\n* Eager head-of-stream peek. Pulls chunks from an async byte stream only until\n* `tryParse` signals it has read what it needs (or the stream ends), then returns\n* a stream that re-emits the pulled head followed by the untouched tail — so\n* reading a head-of-stream mp4 box (`mdhd` / `tfdt`) doesn't break streaming of\n* the append. Once the caller has what it wants, the rest streams as normal.\n*/\nfunction concat(chunks) {\n\tif (chunks.length === 1) return chunks[0];\n\tconst total = chunks.reduce((n, c) => n + c.length, 0);\n\tconst out = new Uint8Array(total);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tout.set(chunk, offset);\n\t\toffset += chunk.length;\n\t}\n\treturn out;\n}\n/** Re-emit the eagerly-pulled head chunks, then stream the untouched tail. */\nasync function* reassemble(head, tail) {\n\tyield* head;\n\tfor (let next = await tail.next(); !next.done; next = await tail.next()) yield next.value;\n}\n/**\n* Pull chunks until `tryParse(accumulatedHead)` returns `true` — it found and read\n* its box — or the stream ends, then return a stream re-emitting the pulled head\n* followed by the untouched tail. `tryParse` is called with the growing head after\n* each chunk; it performs the side effect (publishing the parsed value) and returns\n* whether it's done.\n*/\nasync function peekHead(data, tryParse) {\n\tconst iterator = data[Symbol.asyncIterator]();\n\tconst head = [];\n\tfor (let next = await iterator.next(); !next.done; next = await iterator.next()) {\n\t\thead.push(next.value);\n\t\tif (tryParse(concat(head))) break;\n\t}\n\treturn reassemble(head, iterator);\n}\n//#endregion\nexport { peekHead };\n\n//# sourceMappingURL=head-peek.js.map","import { peek, update } from \"../../core/signals/primitives.js\";\nimport { effect } from \"../../core/signals/effect.js\";\nimport { resolveVttSegmentMetadata } from \"../../media/text/resolve-vtt-metadata.js\";\nimport { findTrackById, getTracksByType } from \"../../media/utils/tracks.js\";\nimport { dispatchCuesStep, textStepWiring } from \"./text-segment-load-pipeline.js\";\nimport { dispatchStep, fetchStep } from \"./segment-load-pipeline.js\";\nimport { findMediaTrack, readBaseMediaDecodeTime } from \"../../media/mp4/timestamp-origin.js\";\nimport { peekHead } from \"./head-peek.js\";\n//#region src/playback/primitives/relocation-pipelines.ts\n/** Assert the relocation state view from the opaque step deps — this module knows the slots the composition provides. */\nfunction relocationState(deps) {\n\treturn deps.state;\n}\nfunction containerSlot(deps) {\n\treturn relocationState(deps).mediaContainerData;\n}\n/** Synchronous RMW of the per-type entry — disjoint keys across producers, so no lost update. */\nfunction writeContainer(slot, trackType, patch) {\n\tupdate(slot, (current) => ({\n\t\t...current,\n\t\t[trackType]: {\n\t\t\t...current?.[trackType],\n\t\t\t...patch\n\t\t}\n\t}));\n}\n/**\n* Resolve once `read()` returns a number. Shared by the A/V stamp (waits for the\n* `derive`d origin — immediate for per-type, the shared-`min` barrier for coordinated)\n* and the text step (waits for the primary A/V origin). No bound: for fMP4 the origin\n* always establishes.\n*/\nfunction awaitDefined(read) {\n\treturn new Promise((resolve) => {\n\t\tlet stop;\n\t\tstop = effect(() => {\n\t\t\tconst value = read();\n\t\t\tif (value !== void 0) {\n\t\t\t\tstop?.();\n\t\t\t\tresolve(value);\n\t\t\t}\n\t\t});\n\t});\n}\n/**\n* Relocation pipelines for one track type — a plain config `messagePipelines`.\n* Keyed by **track type** (`'video'` / `'audio'`), so ABR rungs of a type share the\n* origin (discover skips once the type's value is present). The steps read/write\n* `state.mediaContainerData[trackType]` via their call-time `deps`; the stamp applies\n* the same `derive` seam the reactor uses (pass the composition's resolved\n* `deriveStartMediaTime` so the buffer offset and the model's `startMediaTime` agree).\n*/\nfunction relocationPipelinesFor(trackType, derive) {\n\tconst handlerType = trackType === \"video\" ? \"vide\" : \"soun\";\n\t/**\n\t* Init step: head-peek the buffered media track's `track_id` + `mdhd` timescale into\n\t* `mediaContainerData[trackType]`. Matching by handler (`vide`/`soun`) skips a muxed\n\t* `clcp` caption track, and the `track_id` lets `readSegmentOrigin` read *this*\n\t* track's `tfdt` rather than the first `traf` in the segment.\n\t*/\n\tconst readInitTrackInfo = async (frame, _signal, deps) => {\n\t\tconst { op } = frame;\n\t\tif (op.type !== \"append-init\" || !frame.data) return;\n\t\tconst slot = containerSlot(deps);\n\t\tif (peek(slot)?.[trackType]?.timescale !== void 0) return;\n\t\tframe.data = await peekHead(frame.data, (bytes) => {\n\t\t\tconst track = findMediaTrack(bytes, handlerType);\n\t\t\tif (track === void 0) return false;\n\t\t\twriteContainer(slot, trackType, {\n\t\t\t\ttrackId: track.trackId,\n\t\t\t\ttimescale: track.timescale\n\t\t\t});\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* Media-segment step: head-peek the `tfdt` baseMediaDecodeTime of the media track's\n\t* `traf` (matched by the `track_id` discovered from the init), recording the\n\t* segment's 0-based `startTime` with it — the origin is `bmdt/ts − segmentStartTime`,\n\t* so the first *loaded* segment need not be the 0th. Without a discovered `track_id`\n\t* (non-fMP4 / mock init) there's no media track to relocate, so the step no-ops and\n\t* the append stays native.\n\t*/\n\tconst readSegmentOrigin = async (frame, _signal, deps) => {\n\t\tconst { op } = frame;\n\t\tif (op.type !== \"append-segment\" || !frame.data) return;\n\t\tconst slot = containerSlot(deps);\n\t\tconst container = peek(slot)?.[trackType];\n\t\tif (container?.baseMediaDecodeTime !== void 0) return;\n\t\tconst { trackId } = container ?? {};\n\t\tif (trackId === void 0) return;\n\t\tconst segmentStartTime = op.meta.startTime;\n\t\tframe.data = await peekHead(frame.data, (bytes) => {\n\t\t\tconst baseMediaDecodeTime = readBaseMediaDecodeTime(bytes, trackId);\n\t\t\tif (baseMediaDecodeTime === void 0) return false;\n\t\t\twriteContainer(slot, trackType, {\n\t\t\t\tbaseMediaDecodeTime,\n\t\t\t\tsegmentStartTime\n\t\t\t});\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* Stamp step — tier-agnostic apply. Relocate by the `derive`d `startMediaTime` for\n\t* this type (`offset = −startMediaTime`). Applies the **same** `derive` the reactor\n\t* uses, over the shared `mediaContainerData` slot — so the buffer offset matches the\n\t* model's stamped `startMediaTime`, and it's robust to `established` + late tracks\n\t* (the slot persists; the model value may not be re-stamped after the reactor goes\n\t* sticky). Awaited: per-type resolves at once (own origin discovered earlier in this\n\t* pipeline); shared-`min` waits until every selected A/V origin is in — the barrier,\n\t* filled by the other type's discover step. A derived `0` (0-PTS / below threshold)\n\t* leaves the append native — setting `timestampOffset` at all can ripple.\n\t*/\n\tconst stampStartMediaTime = async (frame, signal, deps) => {\n\t\tif (frame.op.type !== \"append-segment\") return;\n\t\tconst state = relocationState(deps);\n\t\tconst own = peek(state.mediaContainerData)?.[trackType];\n\t\tif (own?.timescale === void 0 || own.baseMediaDecodeTime === void 0 || own.segmentStartTime === void 0) return;\n\t\tconst startMediaTime = await awaitDefined(() => {\n\t\t\tconst containerData = state.mediaContainerData.get();\n\t\t\tif (!containerData) return void 0;\n\t\t\treturn derive(containerData, {\n\t\t\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\t\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t\t\t})[trackType];\n\t\t});\n\t\tif (signal.aborted || startMediaTime === 0) return;\n\t\tframe.meta = {\n\t\t\t...frame.meta ?? frame.op.meta,\n\t\t\ttimestampOffset: -startMediaTime\n\t\t};\n\t};\n\treturn () => ({\n\t\tremove: [dispatchStep],\n\t\t\"append-init\": [\n\t\t\tfetchStep,\n\t\t\treadInitTrackInfo,\n\t\t\tdispatchStep\n\t\t],\n\t\t\"append-segment\": [\n\t\t\tfetchStep,\n\t\t\treadSegmentOrigin,\n\t\t\tstampStartMediaTime,\n\t\t\tdispatchStep\n\t\t]\n\t});\n}\n/**\n* Resolve step for the relocation text pipeline. Reuses the injected host resolver\n* (the loader's folded `resolveSegment`, via `textStepWiring`) for cues and fetches\n* the `X-TIMESTAMP-MAP` header in parallel, stashing it on `frame.metadata` for\n* `relocateCuesStep`. Replaces the\n* base `resolveCuesStep` (which fetches cues only) — text's native `<track>` parser\n* discards the header, so the map needs its own raw-bytes fetch.\n*/\nconst resolveWithMetadataStep = async (frame, signal, deps) => {\n\tconst [cues, metadata] = await Promise.all([textStepWiring(deps).resolveSegment(frame.op.segment.url), resolveVttSegmentMetadata(frame.op.segment.url)]);\n\tif (signal.aborted) return;\n\tframe.cues = cues;\n\tframe.metadata = metadata;\n};\n/**\n* Relocate step — shifts each cue onto the 0-based presentation timeline:\n* `cueFinal = cueNative − startMediaTime`, where `startMediaTime` is the primary\n* A/V track's origin (selected **video**, else **audio** — the single-anchor rule,\n* and defensive like the reactor's optional selection) and `cueNative` folds in the\n* `X-TIMESTAMP-MAP` correction (`mpegts/90000 − local`) for map-bearing VTT (Apple)\n* or is the absolute cue time (no map, e.g. Mux). Text can resolve before A/V\n* establishes, so the origin is awaited; fMP4 always establishes it (0-PTS → 0),\n* and a text-only source (no A/V selected) simply gets offset 0.\n*/\nconst relocateCuesStep = async (frame, signal, deps) => {\n\tif (!frame.cues?.length) return;\n\tconst state = deps.state;\n\tconst startMediaTime = await awaitDefined(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!presentation) return void 0;\n\t\tconst primaryId = state.selectedVideoTrackId.get() ?? state.selectedAudioTrackId.get();\n\t\tif (primaryId !== void 0) return findTrackById(presentation, primaryId)?.startMediaTime;\n\t\treturn getTracksByType(presentation, \"video\").length > 0 || getTracksByType(presentation, \"audio\").length > 0 ? void 0 : 0;\n\t});\n\tif (signal.aborted) return;\n\tconst { timestampMap } = frame.metadata ?? {};\n\tconst delta = (timestampMap ? timestampMap.mpegts / 9e4 - timestampMap.local : 0) - startMediaTime;\n\tif (delta !== 0) for (const cue of frame.cues) {\n\t\tcue.startTime += delta;\n\t\tcue.endTime += delta;\n\t}\n};\n/**\n* Relocation text pipeline — the text analog of `relocationPipelinesFor(type)`.\n* `resolveWithMetadata` (cues + `X-TIMESTAMP-MAP`) → `relocateCues` (shift by the\n* primary A/V origin) → `dispatchCues`.\n*/\nconst relocatingTextPipelines = () => [\n\tresolveWithMetadataStep,\n\trelocateCuesStep,\n\tdispatchCuesStep\n];\n//#endregion\nexport { relocatingTextPipelines, relocationPipelinesFor };\n\n//# sourceMappingURL=relocation-pipelines.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAASA,cAAY,cAAc,cAAc,eAAe;CAC/D,IAAI,CAAC,gBAAgB,CAAC,cAAc,KAAK,OAAO;CAChD,IAAI,eAAe,OAAO;CAC1B,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,uBAAuB,EAAE,OAAO,WAAW;CACnD,MAAM,qBAAqB,eAAeA,cAAY,MAAM,aAAa,IAAI,GAAG,QAAQ,aAAa,IAAI,GAAG,MAAM,cAAc,IAAI,CAAC,CAAC;CACtI,MAAM,YAAY,eAAe,MAAM,aAAa,IAAI,CAAC,EAAE,GAAG;CAC9D,OAAO,qBAAqB;EAC3B,SAAS;EACT,eAAe,mBAAmB,IAAI;EACtC,QAAQ;GACP,uBAAuB,CAAC;GACxB,YAAY,EAAE,eAAe;IAC5B,MAAM,KAAK,QAAQ,aAAa,IAAI;IACpC,MAAM,yBAAyB,MAAM,cAAc,IAAI,IAAI;IAC3D,IAAI,GAAG,YAAY,CAAC,GAAG,UAAU,GAAG,SAAS;KAC5C,iBAAiB;KACjB;IACD;IACA,MAAM,cAAc,OAAO,IAAI,QAAQ,gBAAgB;IACvD,MAAM,iBAAiB,OAAO,IAAI,WAAW,gBAAgB;IAC7D,aAAa;KACZ,YAAY;KACZ,eAAe;IAChB;GACD,EAAE;GACF,eAAe,EAAE,eAAe;IAC/B,QAAQ,aAAa,IAAI;IACzB,UAAU,IAAI;IACd,aAAa,MAAM,cAAc,IAAI,KAAK;GAC3C,EAAE;EACH;CACD,C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{$ as r,D as i,F as a,I as o,L as s,M as c,N as l,O as u,Q as d,S as f,at as p,bt as m,d as h,dt as g,f as ee,ft as _,g as te,gt as ne,ht as re,it as v,l as ie,m as y,mt as b,ot as x,u as ae,ut as S,z as oe}from"./error-surface-BID4D3DW.js";function se(e,t,n){return!t||!e?.url?`preconditions-unmet`:n?`load-active`:`monitoring`}function ce({state:e,context:n}){let r=g(()=>se(e.presentation.get(),n.mediaElement.get(),e.loadActivated.get())),i=g(()=>e.presentation.get()?.url);return x({initial:`preconditions-unmet`,monitor:()=>r.get(),states:{"preconditions-unmet":{},monitoring:{effects:()=>{let r=n.mediaElement.get(),i=()=>e.loadActivated.set(!0);if(r.autoplay||!r.paused||r.seeking){i();return}let a=t(r,`play`,i),o=t(r,`seeking`,i);return()=>{a(),o()}}},"load-active":{effects:()=>(n.mediaElement.get(),i.get(),()=>e.loadActivated.set(!1))}}})}const le=S({stateKeys:[`loadActivated`,`presentation`],contextKeys:[`mediaElement`],setup:ce});function ue(e){let{timescale:t,baseMediaDecodeTime:n,segmentStartTime:r}=e??{};return t!=null&&n!=null&&r!=null?n/t-r:void 0}function de(e){return e<1?0:e}const C=(e,t)=>{let n=[];t.selectedVideoTrackId!=null&&n.push(`video`),t.selectedAudioTrackId!=null&&n.push(`audio`);let r=(n.length>0?n:Object.keys(e)).map(t=>ue(e[t]));if(r.length===0||r.some(e=>e===void 0))return{};let i=de(Math.min(...r)),a={};for(let t of Object.keys(e))a[t]=i;return a};function w(e){return e.selectedVideoTrackId??e.selectedAudioTrackId}const fe=(e,t,n)=>{let r=w(t);if(r===void 0||r===n)return!0;if(!v(e))return!1;let i=d(e,r);return i?p(i)?i.startDate===void 0||d(e,n)?.startDate!==void 0:!1:!0};function pe(e,t){let n=!1,r=e.selectionSets.map(e=>({...e,switchingSets:e.switchingSets.map(e=>({...e,tracks:e.tracks.map(e=>e.startDate===void 0?(n=!0,{...e,startDate:t}):e)}))}));return n?{...e,selectionSets:r}:e}function me(e,t){let n=!1,r=e.selectionSets.map(e=>({...e,switchingSets:e.switchingSets.map(e=>({...e,tracks:e.tracks.map(e=>{let r=t[e.type];return r===void 0||e.startMediaTime===r?e:(n=!0,{...e,startMediaTime:r})})}))}));return n?{...e,selectionSets:r}:e}function he({state:e,config:t={}}){let n=t.deriveStartMediaTime??C,r=()=>({selectedVideoTrackId:e.selectedVideoTrackId?.get(),selectedAudioTrackId:e.selectedAudioTrackId?.get()}),i=()=>{let t=e.presentation.get();if(!v(t))return!1;let n=[e.selectedVideoTrackId?.get(),e.selectedAudioTrackId?.get()].filter(e=>e!==void 0);return n.length>0&&n.every(e=>d(t,e)?.startMediaTime!==void 0)};return x({initial:`inactive`,monitor:()=>v(e.presentation.get())?i()?`established`:`monitoring`:`inactive`,states:{inactive:{entry:()=>e.mediaContainerData.set(void 0)},monitoring:{effects:[()=>{let t=e.presentation.get();if(!v(t))return;let n=w(r()),i=n===void 0?void 0:d(t,n);if(!i||!p(i))return;let a=i.startDate;a!==void 0&&b(e.presentation,e=>pe(e,a))},()=>{let t=e.mediaContainerData.get();if(!t)return;let i=n(t,r());b(e.presentation,e=>me(e,i))}]},established:{}}})}const ge={stateKeys:[`presentation`,`mediaContainerData`],contextKeys:[],setup:he},_e=(e,t)=>!!e&&e.length===t.length&&e.every((e,n)=>e===t[n]),ve=S({stateKeys:[`presentation`,`cdnPriority`],contextKeys:[],setup:({state:e,config:t={}})=>{let n=t.getCdnId??o,r=g(()=>v(e.presentation.get())?`presentation-resolved`:`presentation-unresolved`);return x({initial:`presentation-unresolved`,monitor:()=>r.get(),states:{"presentation-unresolved":{},"presentation-resolved":{entry:()=>()=>e.cdnPriority.set(void 0),effects:[()=>{let t=e.presentation.get();if(!v(t))return;let r=s(t,n);_e(_(e.cdnPriority),r)||e.cdnPriority.set(r)}]}}})}});function ye(e,t){return!e||!n(e)||t?`preconditions-unmet`:`airplay-capable`}function be({state:e,context:n}){let r=g(()=>ye(n.mediaElement.get(),e.disableRemotePlayback.get()));return x({initial:`preconditions-unmet`,monitor:()=>r.get(),states:{"preconditions-unmet":{},"airplay-capable":{entry:()=>{let r=n.mediaElement.get(),i=()=>!!r.webkitCurrentPlaybackTargetIsWireless,a,o,s,c,l=!1,u=()=>{i()?(clearTimeout(a),a=void 0,_(e.loadingSuspended)||(o=_(e.presentation)?.url),e.loadingSuspended.set(!0)):_(e.loadingSuspended)?a??=setTimeout(()=>{a=void 0;let t=i();if(!t){let t=o;o=void 0,_(e.presentation)?.url===t&&(s={position:r.currentTime,wasPlaying:!r.paused,presentationUrl:t})}e.loadingSuspended.set(t)},1e3):e.loadingSuspended.set(!1)},d=new AbortController;t(r,`webkitcurrentplaybacktargetiswirelesschanged`,u,{signal:d.signal}),t(r,`emptied`,()=>{if(!s)return;let{position:t,wasPlaying:n,presentationUrl:r}=s;s=void 0,_(e.presentation)?.url===r&&(e.startPosition.set(t),c=r,l=n)},{signal:d.signal});let f=m(()=>{let t=e.presentation.get()?.url;!_(e.loadingSuspended)||t===o||(o=void 0,clearTimeout(a),a=void 0,e.loadingSuspended.set(!1))}),p=m(()=>{let t=e.presentation.get()?.url,n=e.startPosition.get();if(c){if(t!==c){c=void 0,l=!1,n!==void 0&&e.startPosition.set(void 0);return}n===void 0&&(c=void 0,l&&(l=!1,r.play().catch(e=>{console.warn(`[setupAirPlay] session-end resume play() rejected — staying paused:`,e)})))}}),h=null,g=m(()=>{let t=!!n.mediaSource.get(),i=!!e.loadingSuspended.get(),a=e.presentation.get()?.url??``;!t&&!i?(h?.remove(),h=null):t&&(!h||h.parentNode!==r)&&(h=document.createElement(`source`),h.type=`application/x-mpegURL`,r.append(h),r.disableRemotePlayback=!1),h&&(h.src=a)});return u(),()=>{g(),f(),p(),d.abort(),clearTimeout(a),h?.remove(),h=null,r.disableRemotePlayback=!0,e.loadingSuspended.set(!1),c&&(c=void 0,l=!1,_(e.startPosition)!==void 0&&e.startPosition.set(void 0))}}}}})}const xe=S({stateKeys:[`presentation`,`disableRemotePlayback`,`loadingSuspended`,`startPosition`],contextKeys:[`mediaElement`,`mediaSource`],setup:be});function T(t,n,r){return!n||!v(t)||e(r)?`preconditions-unmet`:`position-pending`}function E({state:e,context:n}){let r=g(()=>T(e.presentation.get(),n.mediaElement.get(),e.startPosition.get()));return x({initial:`preconditions-unmet`,monitor:()=>r.get(),states:{"preconditions-unmet":{},"position-pending":{entry:()=>{let r=n.mediaElement.get(),i=e.startPosition.get();e.currentTime.set(i);let a=()=>{r.currentTime=i,e.startPosition.set(void 0)};if(r.readyState>=HTMLMediaElement.HAVE_METADATA){a();return}return t(r,`loadedmetadata`,a,{once:!0})}}}})}const D=S({stateKeys:[`presentation`,`startPosition`,`currentTime`],contextKeys:[`mediaElement`],setup:E});function O(e,t){let{msEnded:n,durationFinite:r,paused:i,seeking:a,ended:o,currentTime:s,bufferedEnd:c}=e;if(!n||!r||i||a||o||c===void 0)return!1;let l=c-s;return l>=0&&l<t}function k({context:e,config:n}){let r=n?.endStallNudgeWindow??.2;return m(()=>{let n=e.mediaElement.get();return n?t(n,`waiting`,()=>{let t=e.mediaSource.get();O({msEnded:t?.readyState===`ended`,durationFinite:Number.isFinite(n.duration),paused:n.paused,seeking:n.seeking,ended:n.ended,currentTime:n.currentTime,bufferedEnd:t?a(t.sourceBuffers):void 0},r)&&(n.currentTime=n.duration)}):void 0})}const A=S({stateKeys:[],contextKeys:[`mediaElement`,`mediaSource`],setup:k}),j={cooldownMs:3e5},M=S({stateKeys:[`presentation`,`failedCdns`],contextKeys:[],setup:({state:e,config:t={}})=>{let n=t.failover?.cooldownMs??j.cooldownMs,r=new Map,i=g(()=>v(e.presentation.get())?`presentation-resolved`:`presentation-unresolved`);return x({initial:`presentation-unresolved`,monitor:()=>i.get(),states:{"presentation-unresolved":{},"presentation-resolved":{entry:()=>()=>{r.forEach(e=>clearTimeout(e)),r.clear(),e.failedCdns.set(void 0)},effects:[()=>{(e.failedCdns.get()??[]).forEach(t=>{if(r.has(t))return;let i=setTimeout(()=>{r.delete(t),b(e.failedCdns,e=>e?.filter(e=>e!==t))},n);r.set(t,i)})}]}}})}});function Se({state:e,context:t,config:n}){let r=n?.defaultPreload??`metadata`,i=g(()=>e.presentation.get()?.url),a=m(()=>{i.get();let n=t.mediaElement.get(),a=_(e.preload);if(a!==void 0&&!f(a))return;let o=n&&f(n.preload)?n.preload:a===void 0?r:void 0;o!==void 0&&o!==a&&e.preload.set(o)}),o=m(()=>{let n=e.preload.get(),r=t.mediaElement.get();r&&f(n)&&r.preload!==n&&(r.preload=n)});return()=>{a(),o()}}const Ce=S({stateKeys:[`preload`,`presentation`],contextKeys:[`mediaElement`],setup:Se}),N={safetyMargin:.85,upgradeMargin:1.15};function P(e){return(e.width??0)*(e.height??0)}function F(e,{state:t,config:n}){let r=n.userSelectionKey;if(!r)return e;let i=t[r]?.get();return i?e.filter(e=>y(e,i)):e}function I(e,{state:t,config:n}){let r=t.failedCdns?.get();if(!r?.length)return e;let i=n.getCdnId??o,a=new Set(r);return e.filter(e=>!a.has(i(e.url)))}function L(e,{state:t,config:n}){let r=t.cdnPriority?.get();if(!r?.length)return e;let i=n.getCdnId??o;for(let t of r){let n=e.filter(e=>i(e.url)===t);if(n.length)return n}return e}function R(e,{state:t,config:n}){let r=n.quality?.safetyMargin??N.safetyMargin,i=n.quality?.upgradeMargin??N.upgradeMargin,a=n.initialBandwidth??5e6,o={...c,...n.bandwidth};t.bandwidthState||console.debug(`[track-switching] rankByBandwidth: no bandwidthState signal in composition; ranking on initialBandwidth`);let s=l(t.bandwidthState?.get(),a,o)*r,u=t[n.selectionKey].get(),d=e=>e.bandwidth??0,f=e=>e.id===u?d(e)*i:d(e),p=e.filter(e=>d(e)<=s).sort((e,t)=>f(t)-f(e)||P(t)-P(e)),m=e.filter(e=>d(e)>s).sort((e,t)=>d(e)-d(t)||P(t)-P(e));return[...p,...m]}function we(e){return e[0].id}function Te(e,{state:t,config:n}){let r=t.userTextTrackSelection?.get();if(r!==`off`){if(r){let t=e.filter(e=>y(e,r));if(t.length)return t[0].id}return te(e,n)}}function z(e){let{state:t,config:n}=e,{selectionKey:r,getTracks:i,rules:a,resolveSelection:o=we,noSupportedTrackCode:s}=n,c=g(()=>v(t.presentation.get())?`presentation-resolved`:`presentation-unresolved`),l=g(()=>{let r=t.presentation.get();return v(r)?ie(n.constraints??[],i(r),e):[]},{equals:ee});return x({initial:`presentation-unresolved`,monitor:()=>c.get(),states:{"presentation-unresolved":{},"presentation-resolved":{entry:()=>()=>t[r].set(void 0),effects:[()=>{let n=l.get();if(!n.length){let e=_(t.presentation);v(e)&&i(e).length>0&&(s!==void 0&&oe(t,{code:s,data:{selectionKey:r}}),t[r].set(void 0));return}let c=ae(a,n,e);if(!c.length){console.error(`[track-switching] applyRules returned no candidates`);return}t[r].set(o(c,e))}]}}})}const Ee=S({stateKeys:[`presentation`,`selectedVideoTrackId`],contextKeys:[],setup:({state:e,config:t,...n})=>z({...n,state:e,config:{...t,selectionKey:`selectedVideoTrackId`,userSelectionKey:`userVideoTrackSelection`,getTracks:e=>r(e,`video`),constraints:[I,h],rules:[F,L,R],noSupportedTrackCode:ne}})}),De=S({stateKeys:[`presentation`,`selectedAudioTrackId`],contextKeys:[],setup:({state:e,config:t,...n})=>z({...n,state:e,config:{...t,selectionKey:`selectedAudioTrackId`,userSelectionKey:`userAudioTrackSelection`,getTracks:e=>r(e,`audio`),constraints:[I,h],rules:[F,L,R],noSupportedTrackCode:re}})}),Oe=S({stateKeys:[`presentation`,`selectedTextTrackId`],contextKeys:[],setup:({state:e,config:t,...n})=>z({...n,state:e,config:{...t,selectionKey:`selectedTextTrackId`,getTracks:e=>r(e,`text`),constraints:[I],rules:[L],resolveSelection:Te}})});function ke(e){let t=e.split(/\r\n|\r|\n/).find(e=>e.startsWith(`X-TIMESTAMP-MAP=`));return t?je(t.slice(16)):void 0}const Ae={LOCAL:Ne,MPEGTS:e=>+e};function je(e){return Object.fromEntries(e.split(`,`).map(e=>{let[t,n]=e.split(/:(.*)/).map(e=>e.trim());return[t?.toLowerCase(),Ae[t](n)]}))}const Me=[3600,60,1,.001];function Ne(e){let t=e.split(/[:.]/);return t.reduce((e,n,r)=>e+ +n*(Me[r+4-t.length]??0),0)}async function Pe(e){return{timestampMap:ke(await fetch(e).then(e=>e.text()))}}function B(e){return e.config}const Fe=async(e,t,n)=>{let r=await B(n).resolveSegment(e.op.segment.url);t.aborted||(e.cues=r)},V=(e,t,n)=>{let{op:r}=e;B(n).textTracksActor.send({type:`add-cues`,meta:{trackId:r.trackId,id:r.segment.id,startTime:r.segment.startTime,duration:r.segment.duration},cues:e.cues??[]})},Ie=()=>[Fe,V];function H(e){return e instanceof Uint8Array?new DataView(e.buffer,e.byteOffset,e.byteLength):new DataView(e)}function U(e,t){return String.fromCharCode(e.getUint8(t),e.getUint8(t+1),e.getUint8(t+2),e.getUint8(t+3))}function*W(e,t=0,n=e.byteLength){let r=t;for(;r+8<=n;){let t=e.getUint32(r),i=U(e,r+4),a=r+8;if(t===1?(t=Number(e.getBigUint64(r+8)),a=r+16):t===0&&(t=n-r),t<a-r)return;yield{type:i,start:r,dataStart:a,end:r+t},r+=t}}function*G(e,t,n=0,r=e.byteLength){for(let i of W(e,n,r))i.type===t&&(yield i)}function K(e,t,n=0,r=e.byteLength){let[i,...a]=t;for(let t of W(e,n,r)){if(t.type!==i)continue;if(a.length===0)return t;let n=K(e,a,t.dataStart,t.end);if(n)return n}}function q(e,t){return e.getUint8(t)}function Le(e,t){let n=H(e),r=K(n,[`moov`]);if(r)for(let e of G(n,`trak`,r.dataStart,r.end)){if(Ve(n,e)!==t)continue;let r=K(n,[`tkhd`],e.dataStart,e.end),i=K(n,[`mdia`,`mdhd`],e.dataStart,e.end);return!r||!i?void 0:{trackId:n.getUint32(r.dataStart+4+(q(n,r.dataStart)===1?16:8)),timescale:ze(n,i)}}}function Re(e,t){let n=H(e),r=K(n,[`moof`]);if(r)for(let e of G(n,`traf`,r.dataStart,r.end)){if(He(n,e)!==t)continue;let r=K(n,[`tfdt`],e.dataStart,e.end);return r?Be(n,r):void 0}}function ze(e,t){return e.getUint32(t.dataStart+4+(q(e,t.dataStart)===1?16:8))}function Be(e,t){let n=t.dataStart+4;return q(e,t.dataStart)===1?Number(e.getBigUint64(n)):e.getUint32(n)}function Ve(e,t){let n=K(e,[`mdia`,`hdlr`],t.dataStart,t.end);return n?U(e,n.dataStart+8):void 0}function He(e,t){let n=K(e,[`tfhd`],t.dataStart,t.end);return n?e.getUint32(n.dataStart+4):void 0}function J(e){if(e.length===1)return e[0];let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}async function*Ue(e,t){yield*e;for(let e=await t.next();!e.done;e=await t.next())yield e.value}async function Y(e,t){let n=e[Symbol.asyncIterator](),r=[];for(let e=await n.next();!e.done&&(r.push(e.value),!t(J(r)));e=await n.next());return Ue(r,n)}function X(e){return e.state}function Z(e){return X(e).mediaContainerData}function Q(e,t,n){b(e,e=>({...e,[t]:{...e?.[t],...n}}))}function $(e){return new Promise(t=>{let n;n=m(()=>{let r=e();r!==void 0&&(n?.(),t(r))})})}function We(e,t){let n=e===`video`?`vide`:`soun`,r=async(t,r,i)=>{let{op:a}=t;if(a.type!==`append-init`||!t.data)return;let o=Z(i);_(o)?.[e]?.timescale===void 0&&(t.data=await Y(t.data,t=>{let r=Le(t,n);return r===void 0?!1:(Q(o,e,{trackId:r.trackId,timescale:r.timescale}),!0)}))},a=async(t,n,r)=>{let{op:i}=t;if(i.type!==`append-segment`||!t.data)return;let a=Z(r),o=_(a)?.[e];if(o?.baseMediaDecodeTime!==void 0)return;let{trackId:s}=o??{};if(s===void 0)return;let c=i.meta.startTime;t.data=await Y(t.data,t=>{let n=Re(t,s);return n===void 0?!1:(Q(a,e,{baseMediaDecodeTime:n,segmentStartTime:c}),!0)})},o=async(n,r,i)=>{if(n.op.type!==`append-segment`)return;let a=X(i),o=_(a.mediaContainerData)?.[e];if(o?.timescale===void 0||o.baseMediaDecodeTime===void 0||o.segmentStartTime===void 0)return;let s=await $(()=>{let n=a.mediaContainerData.get();if(n)return t(n,{selectedVideoTrackId:a.selectedVideoTrackId?.get(),selectedAudioTrackId:a.selectedAudioTrackId?.get()})[e]});r.aborted||s===0||(n.meta={...n.meta??n.op.meta,timestampOffset:-s})};return()=>({remove:[i],"append-init":[u,r,i],"append-segment":[u,a,o,i]})}const Ge=async(e,t,n)=>{let[r,i]=await Promise.all([B(n).resolveSegment(e.op.segment.url),Pe(e.op.segment.url)]);t.aborted||(e.cues=r,e.metadata=i)},Ke=async(e,t,n)=>{if(!e.cues?.length)return;let i=n.state,a=await $(()=>{let e=i.presentation.get();if(!e)return;let t=i.selectedVideoTrackId.get()??i.selectedAudioTrackId.get();return t===void 0?r(e,`video`).length>0||r(e,`audio`).length>0?void 0:0:d(e,t)?.startMediaTime});if(t.aborted)return;let{timestampMap:o}=e.metadata??{},s=(o?o.mpegts/9e4-o.local:0)-a;if(s!==0)for(let t of e.cues)t.startTime+=s,t.endTime+=s},qe=()=>[Ge,Ke,V];export{Oe as a,M as c,xe as d,ve as f,le as g,fe as h,De as i,A as l,ge as m,We as n,Ee as o,C as p,Ie as r,Ce as s,qe as t,D as u};
2
- //# sourceMappingURL=relocation-pipelines-DunE4gcV.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"relocation-pipelines-DunE4gcV.js","names":["deriveState","deriveState"],"sources":["../../spf/dist/default/playback/behaviors/dom/track-load-triggers.js","../../spf/dist/default/playback/behaviors/establish-start-media-time.js","../../spf/dist/default/playback/behaviors/derive-cdn-priority.js","../../spf/dist/default/playback/behaviors/dom/airplay.js","../../spf/dist/default/playback/behaviors/dom/apply-start-position.js","../../spf/dist/default/playback/behaviors/dom/recover-end-stall.js","../../spf/dist/default/playback/behaviors/setup-failover-monitor.js","../../spf/dist/default/playback/behaviors/sync-preload.js","../../spf/dist/default/media/abr/quality-selection.js","../../spf/dist/default/playback/behaviors/track-switching.js","../../spf/dist/default/media/text/parse-vtt-timestamp-map.js","../../spf/dist/default/media/text/resolve-vtt-metadata.js","../../spf/dist/default/playback/primitives/text-segment-load-pipeline.js","../../spf/dist/default/media/mp4/box.js","../../spf/dist/default/media/mp4/timestamp-origin.js","../../spf/dist/default/playback/primitives/head-peek.js","../../spf/dist/default/playback/primitives/relocation-pipelines.js"],"sourcesContent":["import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/track-load-triggers.ts\n/**\n* Slot-driven FSM. The slot `loadActivated` is the canonical externally-\n* observable state; `deriveState` reads it (and the preconditions) to\n* derive the local FSM state. The slot is *both* the state and the data —\n* no separate internal bookkeeping.\n*\n* ```\n* 'preconditions-unmet' ⟷ 'monitoring' ⟷ 'load-active'\n*\n* preconditions-unmet → monitoring element + URL appear\n* monitoring → load-active slot flips true (listener fires\n* or external write)\n* load-active → monitoring within-state cleanup resets slot\n* (URL or element identity change)\n* any → preconditions-unmet element or URL → undefined\n*\n* any state → destroying → destroyed on destroy()\n* ```\n*/\nfunction deriveState(presentation, mediaElement, loadActivated) {\n\tif (!mediaElement || !presentation?.url) return \"preconditions-unmet\";\n\tif (loadActivated) return \"load-active\";\n\treturn \"monitoring\";\n}\n/**\n* Track preload-overriding events per source.\n*\n* Writes `state.loadActivated = true` the first time a `play` or `seeking`\n* event fires on the attached media element for the current source — or\n* immediately on entry if the element is already committed to loading\n* (`el.autoplay`, `!el.paused`, or `el.seeking`), covering autoplay,\n* native-controls, and direct-DOM-`play()` scenarios.\n*\n* Sticky-true *within a source identity*: subsequent play/pause/seek\n* cycles don't flip back. Source identity = (mediaElement, presentation\n* URL). Either changing — including direct in-place swap with no\n* `undefined` intermediate — resets the slot to `false`.\n*\n* Multi-writer with `hls/adapter.ts:play()` (which writes `true` directly\n* on programmatic play) is intentional — different domains. The adapter\n* records programmatic intent; this behavior is the DOM-side observer.\n* Pre-existing `true` writes are honored because `deriveState` reads the\n* slot — a `true` value routes directly to `'load-active'` without\n* entering `'monitoring'`.\n*\n* @example\n* const reactor = trackLoadTriggers.setup({ state, context });\n* // later:\n* reactor.destroy();\n*/\nfunction trackLoadTriggersSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), state.loadActivated.get()));\n\tconst urlSignal = computed(() => state.presentation.get()?.url);\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\tmonitoring: { effects: () => {\n\t\t\t\tconst el = context.mediaElement.get();\n\t\t\t\tconst setLoadActivated = () => state.loadActivated.set(true);\n\t\t\t\tif (el.autoplay || !el.paused || el.seeking) {\n\t\t\t\t\tsetLoadActivated();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst cleanupPlay = listen(el, \"play\", setLoadActivated);\n\t\t\t\tconst cleanupSeeking = listen(el, \"seeking\", setLoadActivated);\n\t\t\t\treturn () => {\n\t\t\t\t\tcleanupPlay();\n\t\t\t\t\tcleanupSeeking();\n\t\t\t\t};\n\t\t\t} },\n\t\t\t\"load-active\": { effects: () => {\n\t\t\t\tcontext.mediaElement.get();\n\t\t\t\turlSignal.get();\n\t\t\t\treturn () => state.loadActivated.set(false);\n\t\t\t} }\n\t\t}\n\t});\n}\nconst trackLoadTriggers = defineBehavior({\n\tstateKeys: [\"loadActivated\", \"presentation\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: trackLoadTriggersSetup\n});\n//#endregion\nexport { trackLoadTriggers };\n\n//# sourceMappingURL=track-load-triggers.js.map","import { update } from \"../../core/signals/primitives.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation, isResolvedTrack } from \"../../media/types/index.js\";\nimport { findTrackById } from \"../../media/utils/tracks.js\";\n//#region src/playback/behaviors/establish-start-media-time.ts\n/**\n* A single type's own media-timeline origin:\n* `baseMediaDecodeTime/timescale − segmentStartTime` (the `segmentStartTime` term\n* makes it the stream origin even when the first loaded segment isn't the 0th).\n* `undefined` until timescale + baseMediaDecodeTime + segmentStartTime are all present.\n*/\nfunction ownOrigin(data) {\n\tconst { timescale, baseMediaDecodeTime, segmentStartTime } = data ?? {};\n\treturn timescale != null && baseMediaDecodeTime != null && segmentStartTime != null ? baseMediaDecodeTime / timescale - segmentStartTime : void 0;\n}\n/** Snap a below-threshold (incl. negative) origin to `0` so it isn't relocated. */\nfunction thresholdOrigin(origin) {\n\treturn origin < 1 ? 0 : origin;\n}\n/**\n* The **default** — relocate the whole presentation by one shared origin: the `min`\n* across the *selected* A/V tracks' own origins, denormalized onto every type. This\n* single reduce subsumes the \"per-type\" and \"shared\" tiers:\n* - **aligned A/V** — `min` equals each origin (they're equal), so it matches per-type;\n* - **skewed A/V** (e.g. Apple's 44ms audio-lead) — `min` keeps every track's earliest\n* DTS ≥ 0 (relocating by ≤ each own origin never drives one negative) *and* preserves\n* the real skew (per-type would flatten it, desyncing A/V);\n* - **single type / muxed** — `min` of the one origin is that origin.\n*\n* Returns `undefined` for every type until all *selected* types have a complete origin\n* (the shared-`min` barrier). Which types must contribute is read from `ctx` (the\n* selected v/a ids); with no selection context it coordinates across whatever types\n* have data. A shared origin below {@link NEAR_ZERO_ORIGIN_THRESHOLD} is returned as `0`\n* (native — ordinary ~0-PTS VOD isn't relocated).\n*/\nconst deriveSharedMinStartMediaTime = (containerData, ctx) => {\n\tconst contributingTypes = [];\n\tif (ctx.selectedVideoTrackId != null) contributingTypes.push(\"video\");\n\tif (ctx.selectedAudioTrackId != null) contributingTypes.push(\"audio\");\n\tconst origins = (contributingTypes.length > 0 ? contributingTypes : Object.keys(containerData)).map((type) => ownOrigin(containerData[type]));\n\tif (origins.length === 0 || origins.some((origin) => origin === void 0)) return {};\n\tconst shared = thresholdOrigin(Math.min(...origins));\n\tconst out = {};\n\tfor (const type of Object.keys(containerData)) out[type] = shared;\n\treturn out;\n};\n/**\n* Coordination-axis *off* — each type relocates by its own origin, independently. Not\n* the default: it flattens real A/V skew (see {@link deriveSharedMinStartMediaTime}).\n* Kept as an opt-in for compositions that know their A/V is aligned and want to skip\n* the shared-`min` barrier (each type stamps as soon as its own origin is discovered).\n*\n* Caution: {@link NEAR_ZERO_ORIGIN_THRESHOLD} applies independently per type here — if\n* two types' origins straddle it, one snaps to `0` and the other doesn't, injecting up\n* to a threshold's worth of A/V offset. Safe for the intended aligned-A/V opt-in; see\n* `internal/design/spf/live-presentation-timeline-model.md` (collision 5).\n*/\nconst derivePerTypeStartMediaTime = (containerData) => {\n\tconst out = {};\n\tfor (const [type, data] of Object.entries(containerData)) {\n\t\tconst origin = ownOrigin(data);\n\t\tout[type] = origin === void 0 ? void 0 : thresholdOrigin(origin);\n\t}\n\treturn out;\n};\n/**\n* The anchor-source track: the selected video track, falling back to audio\n* (audio-only). Deterministic — never \"first resolved\", which is race-dependent\n* under concurrent resolves.\n*/\nfunction referenceTrackId(ctx) {\n\treturn ctx.selectedVideoTrackId ?? ctx.selectedAudioTrackId;\n}\n/**\n* The live-anchor first-parse gate (the \"parses align\" step of the establishment\n* order). Open for the reference track itself — its local-from-0 placement *is*\n* the presentation timeline (presentation-0 = the join point). Every other track\n* holds until the reference's first parse settles the anchor question: no PDT →\n* local placement is already correct, proceed; PDT anchor → hold until the\n* establishment reactor stamps it onto this track, so the parse takes the\n* `placeOnAnchor` path. Establishment is sticky-once, so an unanchored first\n* parse would be permanently misaligned — that's the race this gate closes.\n*\n* Pairs with the {@link establishStartMediaTime} reactor (the stamp that opens\n* the anchored branch); wire both or neither.\n*/\nconst gateFirstParseOnAnchor = (presentation, ctx, trackId) => {\n\tconst referenceId = referenceTrackId(ctx);\n\tif (referenceId === void 0 || referenceId === trackId) return true;\n\tif (!isResolvedPresentation(presentation)) return false;\n\tconst reference = findTrackById(presentation, referenceId);\n\tif (!reference) return true;\n\tif (!isResolvedTrack(reference)) return false;\n\tif (reference.startDate === void 0) return true;\n\treturn findTrackById(presentation, trackId)?.startDate !== void 0;\n};\n/**\n* Stamp the frozen wall-clock anchor as `startDate` onto every track that lacks\n* one (idempotent — same reference when nothing moved). Unresolved shells pick\n* it up as the `placeOnAnchor` preset; covering *all* tracks in one pass means\n* any track selected later — an ABR rung, another audio language, late captions\n* — resolves already anchored. The reference track's own parser-computed\n* `startDate` reads back as the anchor, so it's naturally left untouched.\n*/\nfunction stampStartDates(presentation, anchor) {\n\tlet changed = false;\n\tconst selectionSets = presentation.selectionSets.map((selectionSet) => ({\n\t\t...selectionSet,\n\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t...switchingSet,\n\t\t\ttracks: switchingSet.tracks.map((track) => {\n\t\t\t\tif (track.startDate !== void 0) return track;\n\t\t\t\tchanged = true;\n\t\t\t\treturn {\n\t\t\t\t\t...track,\n\t\t\t\t\tstartDate: anchor\n\t\t\t\t};\n\t\t\t})\n\t\t}))\n\t}));\n\treturn changed ? {\n\t\t...presentation,\n\t\tselectionSets\n\t} : presentation;\n}\n/** Stamp the derived per-track `startMediaTime` onto the model (idempotent — same reference when nothing moved). */\nfunction stampTracks(presentation, startMediaTimes) {\n\tlet changed = false;\n\tconst selectionSets = presentation.selectionSets.map((selectionSet) => ({\n\t\t...selectionSet,\n\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t...switchingSet,\n\t\t\ttracks: switchingSet.tracks.map((track) => {\n\t\t\t\tconst startMediaTime = startMediaTimes[track.type];\n\t\t\t\tif (startMediaTime === void 0 || track.startMediaTime === startMediaTime) return track;\n\t\t\t\tchanged = true;\n\t\t\t\treturn {\n\t\t\t\t\t...track,\n\t\t\t\t\tstartMediaTime\n\t\t\t\t};\n\t\t\t})\n\t\t}))\n\t}));\n\treturn changed ? {\n\t\t...presentation,\n\t\tselectionSets\n\t} : presentation;\n}\nfunction establishStartMediaTimeSetup({ state, config = {} }) {\n\tconst derive = config.deriveStartMediaTime ?? deriveSharedMinStartMediaTime;\n\tconst selectionContext = () => ({\n\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t});\n\t/** Established once the selected A/V tracks (whichever exist) carry `startMediaTime`. */\n\tconst established = () => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!isResolvedPresentation(presentation)) return false;\n\t\tconst ids = [state.selectedVideoTrackId?.get(), state.selectedAudioTrackId?.get()].filter((id) => id !== void 0);\n\t\treturn ids.length > 0 && ids.every((id) => findTrackById(presentation, id)?.startMediaTime !== void 0);\n\t};\n\treturn createMachineReactor({\n\t\tinitial: \"inactive\",\n\t\tmonitor: () => {\n\t\t\tif (!isResolvedPresentation(state.presentation.get())) return \"inactive\";\n\t\t\treturn established() ? \"established\" : \"monitoring\";\n\t\t},\n\t\tstates: {\n\t\t\tinactive: { entry: () => state.mediaContainerData.set(void 0) },\n\t\t\tmonitoring: { effects: [() => {\n\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\tif (!isResolvedPresentation(presentation)) return;\n\t\t\t\tconst referenceId = referenceTrackId(selectionContext());\n\t\t\t\tconst reference = referenceId === void 0 ? void 0 : findTrackById(presentation, referenceId);\n\t\t\t\tif (!reference || !isResolvedTrack(reference)) return;\n\t\t\t\tconst anchor = reference.startDate;\n\t\t\t\tif (anchor === void 0) return;\n\t\t\t\tupdate(state.presentation, (current) => stampStartDates(current, anchor));\n\t\t\t}, () => {\n\t\t\t\tconst containerData = state.mediaContainerData.get();\n\t\t\t\tif (!containerData) return;\n\t\t\t\tconst startMediaTimes = derive(containerData, selectionContext());\n\t\t\t\tupdate(state.presentation, (current) => stampTracks(current, startMediaTimes));\n\t\t\t}] },\n\t\t\testablished: {}\n\t\t}\n\t});\n}\nconst establishStartMediaTime = {\n\tstateKeys: [\"presentation\", \"mediaContainerData\"],\n\tcontextKeys: [],\n\tsetup: establishStartMediaTimeSetup\n};\n//#endregion\nexport { derivePerTypeStartMediaTime, deriveSharedMinStartMediaTime, establishStartMediaTime, gateFirstParseOnAnchor };\n\n//# sourceMappingURL=establish-start-media-time.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { getCdnId, getOrderedCdnIds } from \"../../media/utils/cdn.js\";\n//#region src/playback/behaviors/derive-cdn-priority.ts\n/**\n* **Session-level CDN priority.** While a presentation is resolved, owns the\n* `cdnPriority` signal: the distinct CDNs the source is served from (origin of\n* each track's URL), in manifest priority order — most-preferred first. Cleared\n* on src unload. The name mirrors HLS content steering's `PATHWAY-PRIORITY`.\n*\n* Redundant-stream sources (e.g. Mux's `?redundant_streams=true`) list the same\n* content on multiple hosts, so the candidate tracks already include one variant\n* per CDN. This behavior publishes *which* CDNs exist and their priority; the\n* `preferActiveCdn` scope rule in `track-switching` reads `cdnPriority` and\n* narrows each type's candidates to the first CDN with surviving tracks — so\n* video / audio / text all resolve from one host (the shared list is the\n* per-presentation coherence guarantee).\n*\n* The \"active\" CDN is not stored — it's derived by the scope as the\n* highest-priority entry in `cdnPriority` that still has tracks after the\n* constraints pre-pass. That makes failover a pure consequence of the (future)\n* failed-CDN constraint: when the primary's tracks are pruned during cooldown,\n* the scope falls to the next CDN; when the primary recovers, it snaps back.\n* Content steering, when it lands, reorders `cdnPriority` (pathway priority as a\n* sort key).\n*\n* Lifecycle: `'presentation-unresolved'` ↔ `'presentation-resolved'`, mirroring\n* `setupTrackSwitching`. The resolved state owns the signal; its entry-returned\n* cleanup clears it on exit (canonical cleanup-binds-to-setup per `reactors.md`).\n*/\nconst samePriority = (a, b) => !!a && a.length === b.length && a.every((cdn, i) => cdn === b[i]);\n/**\n* Manage `cdnPriority`: publish the manifest-ordered CDN list on src load, clear\n* on src unload.\n*\n* @example\n* const reactor = deriveCdnPriority.setup({ state });\n*/\nconst deriveCdnPriority = defineBehavior({\n\tstateKeys: [\"presentation\", \"cdnPriority\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": {\n\t\t\t\t\tentry: () => () => state.cdnPriority.set(void 0),\n\t\t\t\t\teffects: [() => {\n\t\t\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\t\t\tif (!isResolvedPresentation(presentation)) return;\n\t\t\t\t\t\tconst next = getOrderedCdnIds(presentation, getCdnId$1);\n\t\t\t\t\t\tif (!samePriority(peek(state.cdnPriority), next)) state.cdnPriority.set(next);\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { deriveCdnPriority };\n\n//# sourceMappingURL=derive-cdn-priority.js.map","import { computed, peek } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isWebKitAirPlayCapable, listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/airplay.ts\n/**\n* **Bridge MSE playback to AirPlay on WebKit.**\n* MSE streams can't be handed to an AirPlay receiver directly.\n* The WebKit-recommended workaround is to append a fallback\n* `<source type=\"application/x-mpegURL\">` carrying the original manifest URL:\n* Safari exposes the AirPlay picker and, when a wireless target is selected,\n* plays that native-HLS source on the receiver. The session state (WebKit's\n* wireless flag, falling edge debounced — see `REMOTE_INACTIVE_SETTLE_MS`) is\n* written straight to its policy consequences, declared here so the\n* cause→policy mapping stays with the feature:\n*\n* - `state.loadingSuspended` — held while the session is live. Observed by\n* the `loadXSegments` dispatchers (no fetching alongside the receiver) and\n* by `setupMediaSource` (its post-close rebuild waits — attaching runs\n* `element.load()` under the live receiver, which destroys a session still\n* being established). The suspension this behavior holds doubles as its own\n* session fact — same writer, same edges.\n* - `state.startPosition` — one-shot command: the position is captured from\n* the element at the session's settled end (still receiver-mirrored) and\n* written once the rebuild's `load()` resets the element (its `'emptied'`),\n* so `applyStartPosition` applies it to the rebuilt source — never to the\n* pre-rebuild element — and starts it where the receiver left off. The\n* playing state rides the same snapshot but stays behavior-local: this\n* behavior itself calls `play()` once the command has been *consumed* — i.e.\n* after the seek — when the receiver was playing at session end. The whole\n* restore is bound to the presentation the session owned and retracted if\n* that changes.\n*\n* A source change during a live session releases the hold rather than deferring\n* until the session ends, so the rebuild runs and WebKit switches the receiver\n* to the newly-built AirPlay alternate. Measured, not contracted — see the\n* effect below.\n* https://webkit.org/blog/15036/how-to-use-media-source-extensions-with-airplay/\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'airplay-capable'`):\n* gated on a WebKit-AirPlay-capable media element being in scope. The entry —\n* gated on `context.mediaSource` — appends the fallback `<source>` (kept\n* current from `state.presentation`) and enables the AirPlay picker once the\n* MediaSource is open, removing the source the moment the MediaSource detaches\n* so it never survives an MSE teardown. State-exit cleanup (author opt-out,\n* detach, source reset, behavior destroy) removes the source and restores the\n* element's `disableRemotePlayback` default. No-op on non-WebKit platforms\n* (Chromium, Firefox) — `deriveState` never leaves `'preconditions-unmet'`.\n*\n* MMS and AirPlay want *opposite* values of `disableRemotePlayback` on the same\n* element, so it is **sequenced**:\n*\n* - **MMS needs `true` to open.** `setupMediaSource` sets\n* `disableRemotePlayback = true` when it attaches a ManagedMediaSource —\n* Safari won't fire `sourceopen` (and MSE playback never starts) otherwise.\n* - **AirPlay needs `false` to offer the picker.** Flipping to `false` *before*\n* the source opens would prevent `sourceopen`, so the flip is gated on\n* `context.mediaSource` — which `setupMediaSource` publishes exactly once the\n* MS is open. Re-fires per source (the slot clears + republishes on reset).\n* - **Author opt-out wins.** `state.disableRemotePlayback` is the author's\n* intent, written only by the media adapter's IDL property; MMS/programmatic\n* code touch the element's own `disableRemotePlayback` instead. A `true`\n* there is unambiguously the author's choice to disable remote playback, so\n* it holds the machine in `'preconditions-unmet'` and nothing is set up.\n*/\n/**\n* How long WebKit's wireless flag must read *inactive* before the\n* session-driven `loadingSuspended` clears.\n*\n* Measured on Safari 26.4 (macOS): when an AirPlay session engages, Safari\n* closes the ManagedMediaSource and — while its pipeline switches to the\n* native-HLS fallback source — transiently reports\n* `webkitCurrentPlaybackTargetIsWireless === false`, firing the changed\n* event. Trusting an instantaneous inactive reading would release\n* `setupMediaSource`'s rebuild hold mid-handoff; its recovery `load()` then\n* destroys the very session being established. Rising edges apply\n* immediately; only the falling edge waits out this settle window.\n*/\nconst REMOTE_INACTIVE_SETTLE_MS = 1e3;\nfunction deriveState(mediaElement, authorDisabledRemotePlayback) {\n\tif (!mediaElement || !isWebKitAirPlayCapable(mediaElement)) return \"preconditions-unmet\";\n\tif (authorDisabledRemotePlayback) return \"preconditions-unmet\";\n\treturn \"airplay-capable\";\n}\nfunction setupAirPlaySetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(context.mediaElement.get(), state.disableRemotePlayback.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"airplay-capable\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst isSessionActive = () => !!mediaElement.webkitCurrentPlaybackTargetIsWireless;\n\t\t\t\tlet settleTimer;\n\t\t\t\tlet sessionPresentationUrl;\n\t\t\t\tlet pendingRestore;\n\t\t\t\t/** Presentation an already-written `state.startPosition` belongs to. */\n\t\t\t\tlet restoreOwnerUrl;\n\t\t\t\tlet resumeWhenRestored = false;\n\t\t\t\tconst sync = () => {\n\t\t\t\t\tif (isSessionActive()) {\n\t\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\t\tif (!peek(state.loadingSuspended)) sessionPresentationUrl = peek(state.presentation)?.url;\n\t\t\t\t\t\tstate.loadingSuspended.set(true);\n\t\t\t\t\t} else if (peek(state.loadingSuspended)) settleTimer ??= setTimeout(() => {\n\t\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\t\tconst stillActive = isSessionActive();\n\t\t\t\t\t\tif (!stillActive) {\n\t\t\t\t\t\t\tconst ownerUrl = sessionPresentationUrl;\n\t\t\t\t\t\t\tsessionPresentationUrl = void 0;\n\t\t\t\t\t\t\tif (peek(state.presentation)?.url === ownerUrl) pendingRestore = {\n\t\t\t\t\t\t\t\tposition: mediaElement.currentTime,\n\t\t\t\t\t\t\t\twasPlaying: !mediaElement.paused,\n\t\t\t\t\t\t\t\tpresentationUrl: ownerUrl\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.loadingSuspended.set(stillActive);\n\t\t\t\t\t}, REMOTE_INACTIVE_SETTLE_MS);\n\t\t\t\t\telse state.loadingSuspended.set(false);\n\t\t\t\t};\n\t\t\t\tconst listenerCleanup = new AbortController();\n\t\t\t\tlisten(mediaElement, \"webkitcurrentplaybacktargetiswirelesschanged\", sync, { signal: listenerCleanup.signal });\n\t\t\t\tlisten(mediaElement, \"emptied\", () => {\n\t\t\t\t\tif (!pendingRestore) return;\n\t\t\t\t\tconst { position, wasPlaying, presentationUrl } = pendingRestore;\n\t\t\t\t\tpendingRestore = void 0;\n\t\t\t\t\tif (peek(state.presentation)?.url !== presentationUrl) return;\n\t\t\t\t\tstate.startPosition.set(position);\n\t\t\t\t\trestoreOwnerUrl = presentationUrl;\n\t\t\t\t\tresumeWhenRestored = wasPlaying;\n\t\t\t\t}, { signal: listenerCleanup.signal });\n\t\t\t\tconst disposeSourceChangeEnd = effect(() => {\n\t\t\t\t\tconst url = state.presentation.get()?.url;\n\t\t\t\t\tif (!peek(state.loadingSuspended) || url === sessionPresentationUrl) return;\n\t\t\t\t\tsessionPresentationUrl = void 0;\n\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\tstate.loadingSuspended.set(false);\n\t\t\t\t});\n\t\t\t\tconst disposeRestoreWatch = effect(() => {\n\t\t\t\t\tconst url = state.presentation.get()?.url;\n\t\t\t\t\tconst position = state.startPosition.get();\n\t\t\t\t\tif (!restoreOwnerUrl) return;\n\t\t\t\t\tif (url !== restoreOwnerUrl) {\n\t\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\t\tif (position !== void 0) state.startPosition.set(void 0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (position !== void 0) return;\n\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\tif (!resumeWhenRestored) return;\n\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\tmediaElement.play().catch((err) => {\n\t\t\t\t\t\tconsole.warn(\"[setupAirPlay] session-end resume play() rejected — staying paused:\", err);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tlet sourceEl = null;\n\t\t\t\tconst disposeSource = effect(() => {\n\t\t\t\t\tconst hasMediaSource = !!context.mediaSource.get();\n\t\t\t\t\tconst sessionActive = !!state.loadingSuspended.get();\n\t\t\t\t\tconst url = state.presentation.get()?.url ?? \"\";\n\t\t\t\t\tif (!hasMediaSource && !sessionActive) {\n\t\t\t\t\t\tsourceEl?.remove();\n\t\t\t\t\t\tsourceEl = null;\n\t\t\t\t\t} else if (hasMediaSource && (!sourceEl || sourceEl.parentNode !== mediaElement)) {\n\t\t\t\t\t\tsourceEl = document.createElement(\"source\");\n\t\t\t\t\t\tsourceEl.type = \"application/x-mpegURL\";\n\t\t\t\t\t\tmediaElement.append(sourceEl);\n\t\t\t\t\t\tmediaElement.disableRemotePlayback = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (sourceEl) sourceEl.src = url;\n\t\t\t\t});\n\t\t\t\tsync();\n\t\t\t\treturn () => {\n\t\t\t\t\tdisposeSource();\n\t\t\t\t\tdisposeSourceChangeEnd();\n\t\t\t\t\tdisposeRestoreWatch();\n\t\t\t\t\tlistenerCleanup.abort();\n\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\tsourceEl?.remove();\n\t\t\t\t\tsourceEl = null;\n\t\t\t\t\tmediaElement.disableRemotePlayback = true;\n\t\t\t\t\tstate.loadingSuspended.set(false);\n\t\t\t\t\tif (restoreOwnerUrl) {\n\t\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\t\tif (peek(state.startPosition) !== void 0) state.startPosition.set(void 0);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} }\n\t\t}\n\t});\n}\nconst setupAirPlay = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"disableRemotePlayback\",\n\t\t\"loadingSuspended\",\n\t\t\"startPosition\"\n\t],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: setupAirPlaySetup\n});\n//#endregion\nexport { setupAirPlay };\n\n//# sourceMappingURL=airplay.js.map","import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../../media/types/index.js\";\nimport { listen } from \"@videojs/utils/dom\";\nimport { isUndefined } from \"@videojs/utils/predicate\";\n//#region src/playback/behaviors/dom/apply-start-position.ts\n/**\n* **Start playback of a source at a requested position.** `state.startPosition`\n* is a one-shot command — \"when the current source can seek, start there\" —\n* the SPF analogue of hls.js's `startPosition` (and the primitive `EXT-X-START`,\n* resume-where-you-left-off, and MediaSource-recovery restore build on).\n* Consumers (adapters, `setupAirPlay`'s session-end snapshot) write it;\n* this behavior is its sole consumer and clears it after applying, so a\n* stale position can never replay against a later source or rebuild.\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'position-pending'`):\n* gated on `mediaElement + resolved presentation + startPosition` defined.\n* The entry applies the command in two steps:\n*\n* 1. **Seed `state.currentTime` immediately.** The segment loaders anchor\n* their load window on `state.currentTime`; seeding points the *first*\n* fetches at the requested position instead of 0. Multi-writer with\n* `trackCurrentTime` (ongoing DOM mirror) — legitimate: different decision\n* domains (element-derived mirror vs one-shot command), and before\n* HAVE_METADATA no `timeupdate`/`seeking` fires to overwrite the seed.\n* Compose this behavior *after* `trackCurrentTime` so the seed lands after\n* the mirror's attach-time sync.\n* 2. **Seek the element at metadata.** `element.currentTime = position` once\n* `readyState >= HAVE_METADATA` (immediately if already there, else on\n* `loadedmetadata`), then clear `startPosition` (consume). The element\n* clamps the seek to its seekable range per spec, and the resulting\n* `seeking` event flows back through `trackCurrentTime` — from here the\n* ordinary seek path owns the position.\n*\n* Position only — playing/paused is deliberately out of scope. The media\n* element load algorithm forces `paused = true`, so a source that was\n* playing before a rebuild comes back paused at the restored position;\n* resume intent belongs to whoever commands the start (e.g. `setupAirPlay`\n* restores its session-end playing state itself).\n*\n* Deliberately NOT relying on the pre-metadata \"default playback start\n* position\" write (setting `currentTime` at HAVE_NOTHING): cross-browser MSE\n* behavior there is inconsistent; the explicit `loadedmetadata` sequencing is\n* deterministic everywhere.\n*\n* State-exit cleanup (source reset, element detach, destroy) drops the\n* pending `loadedmetadata` listener. An *unapplied* command survives a source\n* reset — \"start the source I'm loading at P\" holds while the presentation\n* routes through unresolved — but is consumed the moment it applies.\n*/\nfunction deriveState(presentation, mediaElement, startPosition) {\n\tif (!mediaElement || !isResolvedPresentation(presentation)) return \"preconditions-unmet\";\n\tif (isUndefined(startPosition)) return \"preconditions-unmet\";\n\treturn \"position-pending\";\n}\nfunction applyStartPositionSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), state.startPosition.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"position-pending\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst position = state.startPosition.get();\n\t\t\t\tstate.currentTime.set(position);\n\t\t\t\tconst apply = () => {\n\t\t\t\t\tmediaElement.currentTime = position;\n\t\t\t\t\tstate.startPosition.set(void 0);\n\t\t\t\t};\n\t\t\t\tif (mediaElement.readyState >= HTMLMediaElement.HAVE_METADATA) {\n\t\t\t\t\tapply();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn listen(mediaElement, \"loadedmetadata\", apply, { once: true });\n\t\t\t} }\n\t\t}\n\t});\n}\nconst applyStartPosition = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"startPosition\",\n\t\t\"currentTime\"\n\t],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: applyStartPositionSetup\n});\n//#endregion\nexport { applyStartPosition };\n\n//# sourceMappingURL=apply-start-position.js.map","import { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { getMinBufferedEnd } from \"../../../media/dom/mse/duration.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/recover-end-stall.ts\n/**\n* Recover the end-of-stream stall that Chrome exhibits on skewed A/V. After\n* `endOfStream`, when the audio and video tracks end a few ms apart (e.g. a source\n* with an A/V PTS skew), Chrome's audio-clock-paced playback freezes the playhead\n* ~50–70ms short of the reachable buffered end and never fires `ended` — so playback\n* hangs at the very end and loop never re-triggers. This behavior watches for the\n* `waiting` event that fires at that freeze and, when the MediaSource is `ended` and\n* the playhead sits at the reachable buffered end, nudges `currentTime` to `duration`\n* to force the native `ended`.\n*\n* **Event-driven, no poll.** `waiting` fires at the instant the playhead stalls\n* (measured ~0ms latency), so there's nothing to gain from polling — and polling would\n* add its interval + a stall threshold before reacting.\n*\n* **Proximity to the *reachable* buffered end** is the discriminator. That end is\n* `getMinBufferedEnd(mediaSource.sourceBuffers)` — the `min` of the per-track (video/audio)\n* SourceBuffer ends, i.e. the furthest point playback can reach — read from the SourceBuffers\n* directly rather than the `mediaElement.buffered` aggregate. Once `endOfStream` is signalled\n* that's the true content end. Requiring the playhead within `endStallNudgeWindow` of it\n* distinguishes the real end-of-stream freeze from a mid-stream buffer-hole stall (which sits\n* far from the buffered end), so we never skip content. The window must exceed the freeze gap;\n* too small would miss the stall (a permanent hang), so the default is generous relative to the\n* measured gap and is config-tunable for empirical tuning.\n*\n* Inert where it shouldn't act: live (the MediaSource never reaches `ended` while the\n* window grows; `duration` is `Infinity`) and streams that end cleanly (no `waiting`).\n*\n* See `internal/decisions/spf/end-of-stream-av-skew-recovery.md`.\n*/\n/** ~2.8× the measured max freeze gap (71ms) — tight, but with headroom against a miss. */\nconst DEFAULT_END_STALL_NUDGE_WINDOW = .2;\n/**\n* Whether a `waiting` should be forced to `ended`: the MediaSource is `ended`, the\n* stream is finite (not live), playback is active (not paused/seeking/already-ended),\n* and the playhead sits within `nudgeWindow` of the reachable buffered end (so it's the\n* true end, not a mid-stream buffer hole). Pure — the behavior supplies the live values.\n*/\nfunction shouldForceEnded(input, nudgeWindow) {\n\tconst { msEnded, durationFinite, paused, seeking, ended, currentTime, bufferedEnd } = input;\n\tif (!msEnded || !durationFinite || paused || seeking || ended || bufferedEnd === void 0) return false;\n\tconst gap = bufferedEnd - currentTime;\n\treturn gap >= 0 && gap < nudgeWindow;\n}\nfunction recoverEndStallSetup({ context, config }) {\n\tconst nudgeWindow = config?.endStallNudgeWindow ?? .2;\n\treturn effect(() => {\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) return;\n\t\tconst onWaiting = () => {\n\t\t\tconst mediaSource = context.mediaSource.get();\n\t\t\tif (shouldForceEnded({\n\t\t\t\tmsEnded: mediaSource?.readyState === \"ended\",\n\t\t\t\tdurationFinite: Number.isFinite(mediaElement.duration),\n\t\t\t\tpaused: mediaElement.paused,\n\t\t\t\tseeking: mediaElement.seeking,\n\t\t\t\tended: mediaElement.ended,\n\t\t\t\tcurrentTime: mediaElement.currentTime,\n\t\t\t\tbufferedEnd: mediaSource ? getMinBufferedEnd(mediaSource.sourceBuffers) : void 0\n\t\t\t}, nudgeWindow)) mediaElement.currentTime = mediaElement.duration;\n\t\t};\n\t\treturn listen(mediaElement, \"waiting\", onWaiting);\n\t});\n}\nconst recoverEndStall = defineBehavior({\n\tstateKeys: [],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: recoverEndStallSetup\n});\n//#endregion\nexport { DEFAULT_END_STALL_NUDGE_WINDOW, recoverEndStall, shouldForceEnded };\n\n//# sourceMappingURL=recover-end-stall.js.map","import { computed, update } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\n//#region src/playback/behaviors/setup-failover-monitor.ts\n/**\n* **CDN failover cooldown.** The expiry half of multi-CDN failover. Fetch sites\n* own the *trip*: on a failed fetch they add the failing CDN (origin) to the\n* `failedCdns` state signal directly. This behavior owns the *expiry*: while a\n* presentation is resolved, it watches `failedCdns` and, for each CDN that\n* appears, schedules a timer to remove it once its cooldown lapses.\n* `track-switching`'s `excludeFailedCdns` constraint prunes a failed CDN's\n* tracks and the active-CDN scope falls to the next one — and back, once the\n* cooldown removes it here.\n*\n* Lifecycle is per-source: timers + `failedCdns` are cleared on exit (a new\n* source starts with a clean slate). Policy (cooldown) is engine config. This is\n* the minimal `network-resilience` slice — a single failure trips a CDN, since\n* transient blips are the retry layer's job (it sits below the fetch sites, so\n* anything that reaches `failedCdns` is already terminal).\n*/\nconst DEFAULT_FAILOVER_MONITOR_CONFIG = { cooldownMs: 3e5 };\n/**\n* Expire failed CDNs from `failedCdns` once their cooldown lapses, for the\n* resolved source.\n*\n* @example\n* const reactor = setupFailoverMonitor.setup({ state });\n*/\nconst setupFailoverMonitor = defineBehavior({\n\tstateKeys: [\"presentation\", \"failedCdns\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst cooldownMs = config.failover?.cooldownMs ?? DEFAULT_FAILOVER_MONITOR_CONFIG.cooldownMs;\n\t\tconst timers = /* @__PURE__ */ new Map();\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": {\n\t\t\t\t\tentry: () => () => {\n\t\t\t\t\t\ttimers.forEach((timer) => clearTimeout(timer));\n\t\t\t\t\t\ttimers.clear();\n\t\t\t\t\t\tstate.failedCdns.set(void 0);\n\t\t\t\t\t},\n\t\t\t\t\teffects: [() => {\n\t\t\t\t\t\t(state.failedCdns.get() ?? []).forEach((cdn) => {\n\t\t\t\t\t\t\tif (timers.has(cdn)) return;\n\t\t\t\t\t\t\tconst timer = setTimeout(() => {\n\t\t\t\t\t\t\t\ttimers.delete(cdn);\n\t\t\t\t\t\t\t\tupdate(state.failedCdns, (current) => current?.filter((c) => c !== cdn));\n\t\t\t\t\t\t\t}, cooldownMs);\n\t\t\t\t\t\t\ttimers.set(cdn, timer);\n\t\t\t\t\t\t});\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { DEFAULT_FAILOVER_MONITOR_CONFIG, setupFailoverMonitor };\n\n//# sourceMappingURL=setup-failover-monitor.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { effect } from \"../../core/signals/effect.js\";\nimport { isStandardPreload } from \"../../media/utils/preload.js\";\n//#region src/playback/behaviors/sync-preload.ts\n/**\n* **Bidirectional sync between `state.preload` and `mediaElement.preload`.**\n*\n* Two effects:\n* - **Read (DOM → state)** — on `context.mediaElement` swap or\n* `state.presentation.url` change, copies `mediaElement.preload` into\n* `state.preload` if it's a W3C value and `state.preload` isn't holding\n* an extended (non-W3C) value. When the DOM has no W3C opinion and\n* `state.preload` is undefined, backfills from `config.defaultPreload`\n* (default-default `'metadata'`) so `state.preload` is never undefined\n* in steady state.\n* - **Write (state → DOM)** — on `state.preload` change or\n* `context.mediaElement` swap, writes `state.preload` back to\n* `mediaElement.preload` if the value is W3C.\n*\n* Extended values (e.g. `'canplay'`) written externally to `state.preload`\n* are sticky: read won't overwrite them, write won't push them to the DOM.\n* All writes are deduped to break echo loops and avoid spurious re-triggers\n* downstream (notably `resolvePresentation`, which reads `state.preload`).\n*/\nfunction syncPreloadSetup({ state, context, config }) {\n\tconst defaultPreload = config?.defaultPreload ?? \"metadata\";\n\tconst presentationUrl = computed(() => state.presentation.get()?.url);\n\tconst cleanupRead = effect(() => {\n\t\tpresentationUrl.get();\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tconst current = peek(state.preload);\n\t\tif (current !== void 0 && !isStandardPreload(current)) return;\n\t\tconst target = mediaElement && isStandardPreload(mediaElement.preload) ? mediaElement.preload : current === void 0 ? defaultPreload : void 0;\n\t\tif (target === void 0 || target === current) return;\n\t\tstate.preload.set(target);\n\t});\n\tconst cleanupWrite = effect(() => {\n\t\tconst next = state.preload.get();\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) return;\n\t\tif (!isStandardPreload(next)) return;\n\t\tif (mediaElement.preload === next) return;\n\t\tmediaElement.preload = next;\n\t});\n\treturn () => {\n\t\tcleanupRead();\n\t\tcleanupWrite();\n\t};\n}\nconst syncPreload = defineBehavior({\n\tstateKeys: [\"preload\", \"presentation\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: syncPreloadSetup\n});\n//#endregion\nexport { syncPreload };\n\n//# sourceMappingURL=sync-preload.js.map","//#region src/media/abr/quality-selection.ts\n/**\n* Default quality selection configuration.\n* Values match Shaka Player upgrade threshold (0.85 = 15% headroom).\n*/\nconst DEFAULT_QUALITY_CONFIG = {\n\tsafetyMargin: .85,\n\tupgradeMargin: 1.15\n};\n/**\n* Resolution as a total pixel count (`width × height`), the basis for\n* comparing two tracks at the same bitrate. Missing dimensions count as 0, so\n* tracks without resolution metadata (e.g. audio) area-compare equal.\n*/\nfunction resolutionArea(track) {\n\treturn (track.width ?? 0) * (track.height ?? 0);\n}\n//#endregion\nexport { DEFAULT_QUALITY_CONFIG, resolutionArea };\n\n//# sourceMappingURL=quality-selection.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { getTracksByType } from \"../../media/utils/tracks.js\";\nimport { SVTA_NO_SUPPORTED_AUDIO_TRACK, SVTA_NO_SUPPORTED_VIDEO_TRACK } from \"../../media/errors.js\";\nimport { matchesPartialTrack, pickTextTrackFromTracks } from \"../../media/primitives/select-tracks.js\";\nimport { applyConstraints, applyRules, excludeUnplayableTracks, sameCandidateSet } from \"../primitives/selection-rules.js\";\nimport { emitError } from \"./collect-errors.js\";\nimport { getCdnId } from \"../../media/utils/cdn.js\";\nimport { DEFAULT_BANDWIDTH_CONFIG, getBandwidthEstimate } from \"../../network/bandwidth-estimator.js\";\nimport { DEFAULT_QUALITY_CONFIG, resolutionArea } from \"../../media/abr/quality-selection.js\";\n//#region src/playback/behaviors/track-switching.ts\n/**\n* **Per-type track selection as a rule chain.** While a presentation is\n* resolved, owns that type's `selected{Video,Audio,Text}TrackId` signal: pick a\n* default, react to user intent and algorithmic ranking, and clear it on src\n* unload.\n*\n* Selection runs in two stages. First a **hard-constraints pre-pass**\n* (`applyConstraints`) prunes the unplayable from the candidate set — the\n* failed-CDN constraint (`excludeFailedCdns`, failover cooldown) and the\n* capability constraint (`excludeUnplayableTracks`, codec support). Then a small\n* ordered chain of rules (`applyRules`) picks among the survivors. Each constraint/rule reads the signals it needs at apply\n* time, so the effect subscribes to exactly what was consulted. The chain is\n* three rules, most authoritative first:\n*\n* 1. **user intent** — a soft filter on `user*TrackSelection`: narrow to the\n* partial-track match; an empty match falls through to the full set.\n* 2. **active CDN** — a soft filter on `cdnPriority` (`preferActiveCdn`):\n* narrow to the highest-priority CDN that still has tracks; an empty match\n* falls through. Shared by video and audio, so every type stays on one CDN\n* (`deriveCdnPriority` owns the list). No-op for non-redundant sources.\n* 3. **ranking** — the terminal sort: `rankByBandwidth`, shared by video and\n* audio. Fitting tracks (within the throughput threshold) first, highest\n* bitrate first; over-throughput tracks after, least-over first. Hysteresis\n* via boosting the current track's sort weight by `upgradeMargin`.\n*\n* The composer's early-bail (one survivor → stop) is load-bearing: a user\n* selection that narrows to a single track is the pick without the ranker\n* running, so the bandwidth estimate is never read and the effect doesn't\n* re-fire on bandwidth while that choice holds.\n*\n* Lifecycle: `'presentation-unresolved'` ↔ `'presentation-resolved'`. The\n* resolved state owns the signal; its entry-returned cleanup clears it on exit\n* (canonical cleanup-binds-to-setup per `reactors.md`).\n*\n* The pick is the chain's result mapped to a slot value by `resolveSelection`\n* (default: the head, `applyRules(...)[0]`). Each variant supplies its\n* **constraints + rule chain (+ optional resolveSelection)** via config;\n* `setupTrackSwitching` owns only the lifecycle and runs what it's given. Video\n* and audio run constraints `[excludeFailedCdns, excludeUnplayableTracks]` then\n* rules `[filterByUserSelection, preferActiveCdn, rankByBandwidth]` and take the\n* head; `switchVideoTrack` also accepts ABR tuning config, `switchAudioTrack`\n* takes none. `switchTextTrack` differs — selection is *optional* (captions are\n* opt-in / off-able), so it runs `[excludeFailedCdns]` + `[preferActiveCdn]` and\n* supplies a text terminal (`pickResolvedTextTrack`) that resolves standing user\n* intent (`userTextTrackSelection`, incl. `'off'`) and may yield no selection.\n* (The active-CDN *scope* is the sticky-pick half of multi-CDN; the failed-CDN\n* *constraint* is the failover half — prune the cooled-down CDN, the scope falls\n* to the next.)\n*\n* When the pre-pass prunes a type that *has* tracks to empty, the behavior\n* clears the selection (so a now-unplayable pick can't linger and stall) and\n* reports the type's `noSupportedTrackCode`. Which constraint emptied the set is\n* deliberately not consulted — the behavior reads no constraint's state, so the\n* chain stays composable. A type with no tracks at all is left alone; that's a\n* legitimate source shape, not a failure. The late `createSourceBuffer` check\n* stays as the structural backstop.\n*\n* Deferred: audio's preferred-language / default-track selection as standing\n* soft-filter rules (previously the empty-slot picker, dropped in the move to\n* the rule chain).\n*/\n/** Default initial-bandwidth value before bandwidth measurements arrive. */\nconst DEFAULT_INITIAL_BANDWIDTH = 5e6;\n/**\n* User intent — a soft filter. Narrows to tracks matching the partial-track\n* selection in `user*TrackSelection`; an empty match falls through (the\n* composer skips it) to the unfiltered set — e.g. a stale id from a previous\n* source.\n*/\nfunction filterByUserSelection(tracks, { state, config }) {\n\tconst key = config.userSelectionKey;\n\tif (!key) return tracks;\n\tconst filter = state[key]?.get();\n\treturn filter ? tracks.filter((track) => matchesPartialTrack(track, filter)) : tracks;\n}\n/**\n* Failed-CDN constraint — a *hard* filter (constraints pre-pass), shared by\n* video and audio. Removes tracks served from a CDN currently in failover\n* cooldown (`failedCdns`, written by the failover monitor). Removed tracks are never\n* attempted; the scope then narrows to the next surviving CDN in `cdnPriority`,\n* and snaps back to the primary once it leaves cooldown.\n*\n* Passes everything through when there's no `failedCdns` signal/value. When it\n* prunes *every* track (all CDNs cooled down), the empty result is preserved\n* (per `applyConstraints`) — \"nothing playable,\" which clears the selection (no\n* pick); a later CDN recovery refills the candidate set and re-picks.\n*/\nfunction excludeFailedCdns(tracks, { state, config }) {\n\tconst failed = state.failedCdns?.get();\n\tif (!failed?.length) return tracks;\n\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\tconst failedSet = new Set(failed);\n\treturn tracks.filter((track) => !failedSet.has(getCdnId$1(track.url)));\n}\n/**\n* Active-CDN scope — a soft filter, shared by video and audio. Narrows to the\n* highest-priority CDN in `cdnPriority` (owned by `deriveCdnPriority`) that\n* still has tracks, so every track type stays on one CDN. A redundant-streams\n* source lists the same renditions on multiple hosts; this keeps the pick on one\n* host rather than letting the ranker drift across them.\n*\n* \"Active\" is derived, not stored: constraints run before the rule chain, so a\n* failed CDN's tracks are already pruned by the time this runs — \"first CDN with\n* survivors\" *is* the active CDN, and it falls through to the next on failover\n* (and snaps back to the primary when it recovers). Content steering reorders\n* `cdnPriority`; this rule just honors the order.\n*\n* Soft-filter semantics: passes through when there's no `cdnPriority` signal/value\n* (no preference) or when nothing matches (`applyRules` skips an empty result).\n* Non-redundant sources have one CDN, so the narrow is a no-op.\n*\n* The CDN-id derivation defaults to origin-based `getCdnId`, overridable via the\n* `getCdnId` config — it must match the one `deriveCdnPriority` used to build\n* `cdnPriority`, or no track's CDN would ever equal an entry.\n*/\nfunction preferActiveCdn(tracks, { state, config }) {\n\tconst cdnPriority = state.cdnPriority?.get();\n\tif (!cdnPriority?.length) return tracks;\n\tconst getCdnId$2 = config.getCdnId ?? getCdnId;\n\tfor (const cdn of cdnPriority) {\n\t\tconst tracksUsingCdn = tracks.filter((track) => getCdnId$2(track.url) === cdn);\n\t\tif (tracksUsingCdn.length) return tracksUsingCdn;\n\t}\n\treturn tracks;\n}\n/**\n* Bandwidth ranking — the terminal sort, shared by video and audio. Orders by\n* the throughput estimate: tracks within the bandwidth threshold first\n* (fitting), highest bitrate first; then over-threshold tracks, least-over\n* first. The head is the best-quality track that fits, falling back to the\n* smallest over-throughput track when nothing fits.\n*\n* Hysteresis without temporal state: the current track's effective bitrate is\n* boosted by `upgradeMargin` in the fitting sort, so a higher track only\n* outranks it once it clears `current.bitrate * upgradeMargin` (no flapping on\n* marginal bandwidth gains). Downgrades fall out for free — a current track\n* over the threshold isn't in the fitting set to be boosted, so the best fit (a\n* downgrade) wins immediately. Equal-bitrate tracks break by resolution (higher\n* `width × height` first), so an equal-bitrate ladder never picks a lower-\n* quality rendition by manifest order; audio tracks carry no dimensions, so\n* they area-compare equal and a stable sort keeps their candidate order (e.g.\n* same-bitrate language variants). Early-bail skips this rule when a prior one\n* narrowed to a single track, so the estimate is neither read nor subscribed\n* while that holds.\n*/\nfunction rankByBandwidth(tracks, { state, config }) {\n\tconst safetyMargin = config.quality?.safetyMargin ?? DEFAULT_QUALITY_CONFIG.safetyMargin;\n\tconst upgradeMargin = config.quality?.upgradeMargin ?? DEFAULT_QUALITY_CONFIG.upgradeMargin;\n\tconst initialBandwidth = config.initialBandwidth ?? 5e6;\n\tconst bandwidthConfig = {\n\t\t...DEFAULT_BANDWIDTH_CONFIG,\n\t\t...config.bandwidth\n\t};\n\tif (!state.bandwidthState) console.debug(\"[track-switching] rankByBandwidth: no bandwidthState signal in composition; ranking on initialBandwidth\");\n\tconst threshold = getBandwidthEstimate(state.bandwidthState?.get(), initialBandwidth, bandwidthConfig) * safetyMargin;\n\tconst currentId = state[config.selectionKey].get();\n\tconst bitrate = (track) => track.bandwidth ?? 0;\n\tconst rank = (track) => track.id === currentId ? bitrate(track) * upgradeMargin : bitrate(track);\n\tconst fitting = tracks.filter((track) => bitrate(track) <= threshold).sort((a, b) => rank(b) - rank(a) || resolutionArea(b) - resolutionArea(a));\n\tconst over = tracks.filter((track) => bitrate(track) > threshold).sort((a, b) => bitrate(a) - bitrate(b) || resolutionArea(b) - resolutionArea(a));\n\treturn [...fitting, ...over];\n}\n/**\n* Default final pick: the chain head. `applyRules` never narrows to nothing and\n* early-bails to a single survivor, so video and audio always converge to a\n* track and the head is the pick.\n*/\nfunction selectChainHead(candidates) {\n\treturn candidates[0].id;\n}\n/**\n* Terminal pick for text — the `resolveSelection` the text variant supplies.\n* Resolves the standing `userTextTrackSelection` intent against the chain's\n* survivors (already CDN-failover-pruned and active-CDN-scoped):\n*\n* - `'off'` → no selection (clear the slot). Sticky through re-evaluation, so a\n* live refresh or failover re-run can't re-assert a default.\n* - explicit `Partial<TextTrack>` → narrow to the match (language-based). A\n* stale pick whose match is gone (e.g. the language dropped on a source\n* change) falls through to the default policy.\n* - auto (`undefined`) → the opt-in default policy (`preferredSubtitleLanguage`\n* → `DEFAULT=YES + AUTOSELECT=YES` → none), via `pickTextTrackFromTracks`.\n*\n* Returning `undefined` is a real outcome (captions are opt-in), which is why the\n* text variant relies on `setupTrackSwitching`'s no-selection seam.\n*/\nfunction pickResolvedTextTrack(candidates, { state, config }) {\n\tconst intent = state.userTextTrackSelection?.get();\n\tif (intent === \"off\") return void 0;\n\tif (intent) {\n\t\tconst matched = candidates.filter((track) => matchesPartialTrack(track, intent));\n\t\tif (matched.length) return matched[0].id;\n\t}\n\treturn pickTextTrackFromTracks(candidates, config);\n}\nfunction setupTrackSwitching(deps) {\n\tconst { state, config } = deps;\n\tconst { selectionKey, getTracks, rules, resolveSelection = selectChainHead, noSupportedTrackCode } = config;\n\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\tconst candidateSet = computed(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!isResolvedPresentation(presentation)) return [];\n\t\treturn applyConstraints(config.constraints ?? [], getTracks(presentation), deps);\n\t}, { equals: sameCandidateSet });\n\treturn createMachineReactor({\n\t\tinitial: \"presentation-unresolved\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"presentation-unresolved\": {},\n\t\t\t\"presentation-resolved\": {\n\t\t\t\tentry: () => () => state[selectionKey].set(void 0),\n\t\t\t\teffects: [() => {\n\t\t\t\t\tconst tracks = candidateSet.get();\n\t\t\t\t\tif (!tracks.length) {\n\t\t\t\t\t\tconst presentation = peek(state.presentation);\n\t\t\t\t\t\tif (isResolvedPresentation(presentation) && getTracks(presentation).length > 0) {\n\t\t\t\t\t\t\tif (noSupportedTrackCode !== void 0) emitError(state, {\n\t\t\t\t\t\t\t\tcode: noSupportedTrackCode,\n\t\t\t\t\t\t\t\tdata: { selectionKey }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tstate[selectionKey].set(void 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst candidates = applyRules(rules, tracks, deps);\n\t\t\t\t\tif (!candidates.length) {\n\t\t\t\t\t\tconsole.error(\"[track-switching] applyRules returned no candidates\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tstate[selectionKey].set(resolveSelection(candidates, deps));\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\t});\n}\n/**\n* Manage `selectedVideoTrackId`: pick a default on src load, dynamically\n* adjust based on bandwidth, clear on src unload. Honors\n* `userVideoTrackSelection` as a partial-track constraint on candidates;\n* short-circuits ABR when the constraint narrows to a single track.\n*\n* @example\n* const reactor = switchVideoTrack.setup({ state });\n*/\nconst switchVideoTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedVideoTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedVideoTrackId\",\n\t\t\tuserSelectionKey: \"userVideoTrackSelection\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"video\"),\n\t\t\tconstraints: [excludeFailedCdns, excludeUnplayableTracks],\n\t\t\trules: [\n\t\t\t\tfilterByUserSelection,\n\t\t\t\tpreferActiveCdn,\n\t\t\t\trankByBandwidth\n\t\t\t],\n\t\t\tnoSupportedTrackCode: SVTA_NO_SUPPORTED_VIDEO_TRACK\n\t\t}\n\t})\n});\n/**\n* Manage `selectedAudioTrackId`: pick a default on src load, narrow by\n* `userAudioTrackSelection` filter, re-pick on filter change, clear on\n* src unload.\n*\n* Mid-stream flush on language switch is handled by the segment-loader's\n* `planTasks` (see `playback/actors/dom/segment-loader.ts`) — not this\n* behavior. Same split as the video pipeline: slot owner writes; loader\n* orchestrates segment + flush plans.\n*\n* @example\n* const reactor = switchAudioTrack.setup({ state });\n*/\nconst switchAudioTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedAudioTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedAudioTrackId\",\n\t\t\tuserSelectionKey: \"userAudioTrackSelection\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"audio\"),\n\t\t\tconstraints: [excludeFailedCdns, excludeUnplayableTracks],\n\t\t\trules: [\n\t\t\t\tfilterByUserSelection,\n\t\t\t\tpreferActiveCdn,\n\t\t\t\trankByBandwidth\n\t\t\t],\n\t\t\tnoSupportedTrackCode: SVTA_NO_SUPPORTED_AUDIO_TRACK\n\t\t}\n\t})\n});\n/**\n* Manage `selectedTextTrackId` as the single-writer **output** of standing user\n* intent (`userTextTrackSelection`) resolved against the playable, CDN-scoped\n* text renditions: clear on src unload; re-resolve when a CDN fails or recovers.\n*\n* Unlike video/audio, the selection is *optional* — captions are opt-in and the\n* user can turn them off — so the chain skips the bandwidth ranker and the shared\n* user-selection filter, and supplies a text-specific terminal\n* (`pickResolvedTextTrack`) that may resolve to no-selection via\n* `setupTrackSwitching`'s `resolveSelection` seam. Constraints are failed-CDN only\n* (`excludeUnplayableTracks`/`canPlayTrack` is MSE-based — the wrong probe for\n* text, whose playability is SPF-parser support); the active-CDN scope co-locates\n* captions with the surviving CDN on failover.\n*\n* @example\n* const reactor = switchTextTrack.setup({ state, config: { preferredSubtitleLanguage: 'en' } });\n*/\nconst switchTextTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedTextTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedTextTrackId\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"text\"),\n\t\t\tconstraints: [excludeFailedCdns],\n\t\t\trules: [preferActiveCdn],\n\t\t\tresolveSelection: pickResolvedTextTrack\n\t\t}\n\t})\n});\n//#endregion\nexport { DEFAULT_INITIAL_BANDWIDTH, setupTrackSwitching, switchAudioTrack, switchTextTrack, switchVideoTrack };\n\n//# sourceMappingURL=track-switching.js.map","//#region src/media/text/parse-vtt-timestamp-map.ts\nconst TIMESTAMP_MAP_PREFIX = \"X-TIMESTAMP-MAP=\";\n/**\n* Scrape a WebVTT segment's `X-TIMESTAMP-MAP` header into a {@link TimestampMap}\n* — the only header line we need to correlate LOCAL cue times with the media\n* presentation timeline. Deliberately *not* a WebVTT parser: cue parsing stays\n* with the browser's native `<track>` parser (which drops this line); this reads\n* just the one header field the native path discards.\n*\n* Returns `undefined` when the segment carries no map (e.g. cues already in\n* absolute presentation time) — per the HLS spec that means LOCAL 0 maps to\n* MPEGTS 0. Tolerant of attribute order and `[HH:]MM:SS.mmm` LOCAL forms.\n*/\nfunction parseVttTimestampMap(text) {\n\tconst timestampMapLine = text.split(/\\r\\n|\\r|\\n/).find((line) => line.startsWith(TIMESTAMP_MAP_PREFIX));\n\treturn timestampMapLine ? parseTimestampMapBody(timestampMapLine.slice(16)) : void 0;\n}\nconst TimeStampMapParserMap = {\n\tLOCAL: parseWebVttTimestamp,\n\tMPEGTS: (v) => +v\n};\nfunction parseTimestampMapBody(body) {\n\treturn Object.fromEntries(body.split(\",\").map((kvStr) => {\n\t\tconst [k, v] = kvStr.split(/:(.*)/).map((kOrV) => kOrV.trim());\n\t\treturn [k?.toLowerCase(), TimeStampMapParserMap[k](v)];\n\t}));\n}\n/** Seconds-per-unit for the `[HH:]MM:SS.mmm` parts, right-aligned so a missing HH just drops the leading weight. */\nconst VTT_TIMESTAMP_WEIGHTS = [\n\t3600,\n\t60,\n\t1,\n\t.001\n];\nfunction parseWebVttTimestamp(value) {\n\tconst parts = value.split(/[:.]/);\n\treturn parts.reduce((acc, val, i) => acc + +val * (VTT_TIMESTAMP_WEIGHTS[i + 4 - parts.length] ?? 0), 0);\n}\n//#endregion\nexport { parseVttTimestampMap };\n\n//# sourceMappingURL=parse-vtt-timestamp-map.js.map","import { parseVttTimestampMap } from \"./parse-vtt-timestamp-map.js\";\n//#region src/media/text/resolve-vtt-metadata.ts\n/**\n* Header-level text-segment metadata — the `X-TIMESTAMP-MAP` correlation scraped from\n* a VTT segment's raw bytes. DOM-free (a plain fetch + regex parse): the native\n* `<track>` parser in `media/dom/text` (`resolveVttSegment`) discards this header, so a\n* caller that needs it (e.g. non-zero-PTS relocation) fetches the bytes itself.\n*/\n/**\n* Fetch a VTT segment and scrape only its header metadata (no cue parsing).\n*\n* The native `<track>` parser (`media/dom/text`'s `resolveVttSegment`) discards\n* `X-TIMESTAMP-MAP`, so reading it requires the raw bytes. This is a separate,\n* caller-controlled fetch — the caller decides *when* metadata is needed (e.g.\n* once per source) rather than paying for it on every segment.\n*/\nasync function resolveVttSegmentMetadata(url) {\n\treturn { timestampMap: parseVttTimestampMap(await fetch(url).then((response) => response.text())) };\n}\n//#endregion\nexport { resolveVttSegmentMetadata };\n\n//# sourceMappingURL=resolve-vtt-metadata.js.map","//#region src/playback/primitives/text-segment-load-pipeline.ts\n/**\n* Base-step view of the loader's wiring, folded into `config` by\n* `createTextTrackSegmentLoaderActor` so base steps read it from the uniform passthrough\n* — present in both composition and standalone use. `config` is loose (`object`), so\n* assert the shape here (mirrors the v/a loader's `stepWiring`). The sink is the\n* structural {@link CueSink}, not the concrete actor.\n*/\nfunction textStepWiring(deps) {\n\treturn deps.config;\n}\n/** Resolve the op's cues (via the injected host primitive) into the frame. The text analog of `fetchStep`. */\nconst resolveCuesStep = async (frame, signal, deps) => {\n\tconst cues = await textStepWiring(deps).resolveSegment(frame.op.segment.url);\n\tif (signal.aborted) return;\n\tframe.cues = cues;\n};\n/** Dispatch the frame's cues to the TextTracksActor as `add-cues`. The text analog of `dispatchStep`. */\nconst dispatchCuesStep = (frame, _signal, deps) => {\n\tconst { op } = frame;\n\ttextStepWiring(deps).textTracksActor.send({\n\t\ttype: \"add-cues\",\n\t\tmeta: {\n\t\t\ttrackId: op.trackId,\n\t\t\tid: op.segment.id,\n\t\t\tstartTime: op.segment.startTime,\n\t\t\tduration: op.segment.duration\n\t\t},\n\t\tcues: frame.cues ?? []\n\t});\n};\n/** Tier 0 default: resolve then dispatch. No relocation vocabulary. */\nconst DEFAULT_TEXT_MESSAGE_PIPELINES = () => [resolveCuesStep, dispatchCuesStep];\n//#endregion\nexport { DEFAULT_TEXT_MESSAGE_PIPELINES, dispatchCuesStep, resolveCuesStep, textStepWiring };\n\n//# sourceMappingURL=text-segment-load-pipeline.js.map","//#region src/media/mp4/box.ts\nfunction toDataView(data) {\n\treturn data instanceof Uint8Array ? new DataView(data.buffer, data.byteOffset, data.byteLength) : new DataView(data);\n}\n/** Read a 4-character box type / FourCC at `offset`. */\nfunction readFourCC(view, offset) {\n\treturn String.fromCharCode(view.getUint8(offset), view.getUint8(offset + 1), view.getUint8(offset + 2), view.getUint8(offset + 3));\n}\n/** Iterate the boxes directly contained in `[start, end)`. */\nfunction* iterateBoxes(view, start = 0, end = view.byteLength) {\n\tlet offset = start;\n\twhile (offset + 8 <= end) {\n\t\tlet size = view.getUint32(offset);\n\t\tconst type = readFourCC(view, offset + 4);\n\t\tlet dataStart = offset + 8;\n\t\tif (size === 1) {\n\t\t\tsize = Number(view.getBigUint64(offset + 8));\n\t\t\tdataStart = offset + 16;\n\t\t} else if (size === 0) size = end - offset;\n\t\tif (size < dataStart - offset) return;\n\t\tyield {\n\t\t\ttype,\n\t\t\tstart: offset,\n\t\t\tdataStart,\n\t\t\tend: offset + size\n\t\t};\n\t\toffset += size;\n\t}\n}\n/** Iterate the direct child boxes of a given `type` within `[start, end)`. */\nfunction* iterateBoxesOfType(view, type, start = 0, end = view.byteLength) {\n\tfor (const box of iterateBoxes(view, start, end)) if (box.type === type) yield box;\n}\n/**\n* Depth-first descent to the first box matching a nested path, e.g.\n* `['moov', 'trak', 'mdia', 'mdhd']`. Returns `undefined` if any level is\n* absent.\n*/\nfunction findBox(view, path, start = 0, end = view.byteLength) {\n\tconst [head, ...rest] = path;\n\tfor (const box of iterateBoxes(view, start, end)) {\n\t\tif (box.type !== head) continue;\n\t\tif (rest.length === 0) return box;\n\t\tconst found = findBox(view, rest, box.dataStart, box.end);\n\t\tif (found) return found;\n\t}\n}\n/**\n* Read the version byte of a FullBox — the `version(1) + flags(3)` header at the\n* start of the payload of `mdhd` / `tkhd` / `tfdt` / `hdlr` / `elst` / etc.\n*/\nfunction readFullBoxVersion(view, dataStart) {\n\treturn view.getUint8(dataStart);\n}\n//#endregion\nexport { findBox, iterateBoxes, iterateBoxesOfType, readFourCC, readFullBoxVersion, toDataView };\n\n//# sourceMappingURL=box.js.map","import { findBox, iterateBoxesOfType, readFourCC, readFullBoxVersion, toDataView } from \"./box.js\";\n//#region src/media/mp4/timestamp-origin.ts\n/**\n* Decode-time origin extraction from fMP4/CMAF segments.\n*\n* Non-zero-PTS sources encode media at a non-zero start time (an instant clip\n* starting at asset second 60, an Apple bipbop asset starting at 10s, …). To\n* relocate such a source onto a 0-based presentation timeline via\n* `SourceBuffer.timestampOffset`, the engine needs that start time — the\n* **decode-time origin** — read straight from the container:\n*\n* - `tfdt.baseMediaDecodeTime` (from a media segment's `moof`) — the decode\n* time of the segment's first sample, in the track's media timescale. This is\n* a DTS: relocating by `−(baseMediaDecodeTime / timescale)` lands the earliest\n* DTS at exactly 0, so a negative-DTS append failure on Chromium is impossible\n* by construction.\n* - `mdhd.timescale` (from the init segment's `moov`) — ticks per second for\n* that track, needed to convert the raw tick count to seconds.\n*\n* ## Presumptive vs. track-selected reads\n*\n* The two variants share only the leaf field-readers (`mdhd` timescale, `tfdt`\n* baseMediaDecodeTime) and the box walker. Everything else differs, and the\n* split is deliberate so the presumptive pair is *proportionally* smaller under\n* tree-shaking:\n*\n* - **Presumptive** — {@link readFirstMediaTimescale} / {@link readFirstBaseMediaDecodeTime}\n* read the first `mdhd` timescale and first `tfdt` baseMediaDecodeTime. There's\n* no `track_id` (nothing to match against) and no `trak`/`traf` iteration — a\n* direct `findBox` to the first leaf. Correct when the init/segment holds a\n* single media track (the common CMAF case). A caption-free platform imports\n* only this pair and tree-shakes away all the matching machinery below.\n* - **Track-selected** — {@link findMediaTrack} / {@link readBaseMediaDecodeTime}.\n* `findMediaTrack` returns `{ trackId, timescale }` for the `trak` whose `hdlr`\n* handler matches; `readBaseMediaDecodeTime` takes that `trackId` and reads the\n* `traf` whose `tfhd.track_id` matches. The `track_id` is the join that ties one\n* track's timescale to the *same* track's baseMediaDecodeTime — required when a\n* source muxes CEA-608/708 captions (a `clcp` track shares the same `moov` and\n* `moof`, each track with its own timescale + baseMediaDecodeTime, so a\n* presumptive read there risks `300000 / 6000 = 50s` instead of\n* `60000 / 6000 = 10s`). This pair adds `trak`/`traf` iteration plus the handler\n* and `track_id` reads. We only ever ask for buffered media handlers\n* (`vide` / `soun`); the caption track is never selected — we read the origin,\n* not the captions (caption *rendering* is out of scope).\n*\n* Both raw values are returned un-divided to leave room for an edit-list (`elst`)\n* presentation-time correction term if a source ever carries one — the validated\n* streams do not.\n*/\n/**\n* The `track_ID` + timescale of the `trak` whose `mdhd` handler matches\n* `handlerType`, skipping a muxed `clcp` caption track. `undefined` if no\n* matching track exists.\n*/\nfunction findMediaTrack(initSegment, handlerType) {\n\tconst view = toDataView(initSegment);\n\tconst moov = findBox(view, [\"moov\"]);\n\tif (!moov) return void 0;\n\tfor (const trak of iterateBoxesOfType(view, \"trak\", moov.dataStart, moov.end)) {\n\t\tif (readTrakHandler(view, trak) !== handlerType) continue;\n\t\tconst tkhd = findBox(view, [\"tkhd\"], trak.dataStart, trak.end);\n\t\tconst mdhd = findBox(view, [\"mdia\", \"mdhd\"], trak.dataStart, trak.end);\n\t\tif (!tkhd || !mdhd) return void 0;\n\t\treturn {\n\t\t\ttrackId: view.getUint32(tkhd.dataStart + 4 + (readFullBoxVersion(view, tkhd.dataStart) === 1 ? 16 : 8)),\n\t\t\ttimescale: readMdhdTimescale(view, mdhd)\n\t\t};\n\t}\n}\n/**\n* `baseMediaDecodeTime` (in the track's media timescale) from the `traf` matching\n* `trackId` (via `tfhd.track_id`) — required for muxed multi-`traf` segments.\n* `undefined` if no matching `tfdt` exists.\n*/\nfunction readBaseMediaDecodeTime(mediaSegment, trackId) {\n\tconst view = toDataView(mediaSegment);\n\tconst moof = findBox(view, [\"moof\"]);\n\tif (!moof) return void 0;\n\tfor (const traf of iterateBoxesOfType(view, \"traf\", moof.dataStart, moof.end)) {\n\t\tif (readTrafTrackId(view, traf) !== trackId) continue;\n\t\tconst tfdt = findBox(view, [\"tfdt\"], traf.dataStart, traf.end);\n\t\treturn tfdt ? readTfdtBaseMediaDecodeTime(view, tfdt) : void 0;\n\t}\n}\n/** `mdhd.timescale`: FullBox version(1)+flags(3) + dates (v0: 4+4, v1: 8+8) + timescale. */\nfunction readMdhdTimescale(view, mdhd) {\n\treturn view.getUint32(mdhd.dataStart + 4 + (readFullBoxVersion(view, mdhd.dataStart) === 1 ? 16 : 8));\n}\n/** `tfdt.baseMediaDecodeTime`: FullBox, then the value — v0: (4), v1: (8). */\nfunction readTfdtBaseMediaDecodeTime(view, tfdt) {\n\tconst at = tfdt.dataStart + 4;\n\treturn readFullBoxVersion(view, tfdt.dataStart) === 1 ? Number(view.getBigUint64(at)) : view.getUint32(at);\n}\n/** `hdlr.handler_type` for a `trak`: FullBox version(1)+flags(3) + pre_defined(4) + handler_type(4). */\nfunction readTrakHandler(view, trak) {\n\tconst hdlr = findBox(view, [\"mdia\", \"hdlr\"], trak.dataStart, trak.end);\n\treturn hdlr ? readFourCC(view, hdlr.dataStart + 8) : void 0;\n}\n/** `tfhd.track_id` for a `traf`: FullBox version(1)+flags(3) + track_id(4). */\nfunction readTrafTrackId(view, traf) {\n\tconst tfhd = findBox(view, [\"tfhd\"], traf.dataStart, traf.end);\n\treturn tfhd ? view.getUint32(tfhd.dataStart + 4) : void 0;\n}\n//#endregion\nexport { findMediaTrack, readBaseMediaDecodeTime };\n\n//# sourceMappingURL=timestamp-origin.js.map","//#region src/playback/primitives/head-peek.ts\n/**\n* Eager head-of-stream peek. Pulls chunks from an async byte stream only until\n* `tryParse` signals it has read what it needs (or the stream ends), then returns\n* a stream that re-emits the pulled head followed by the untouched tail — so\n* reading a head-of-stream mp4 box (`mdhd` / `tfdt`) doesn't break streaming of\n* the append. Once the caller has what it wants, the rest streams as normal.\n*/\nfunction concat(chunks) {\n\tif (chunks.length === 1) return chunks[0];\n\tconst total = chunks.reduce((n, c) => n + c.length, 0);\n\tconst out = new Uint8Array(total);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tout.set(chunk, offset);\n\t\toffset += chunk.length;\n\t}\n\treturn out;\n}\n/** Re-emit the eagerly-pulled head chunks, then stream the untouched tail. */\nasync function* reassemble(head, tail) {\n\tyield* head;\n\tfor (let next = await tail.next(); !next.done; next = await tail.next()) yield next.value;\n}\n/**\n* Pull chunks until `tryParse(accumulatedHead)` returns `true` — it found and read\n* its box — or the stream ends, then return a stream re-emitting the pulled head\n* followed by the untouched tail. `tryParse` is called with the growing head after\n* each chunk; it performs the side effect (publishing the parsed value) and returns\n* whether it's done.\n*/\nasync function peekHead(data, tryParse) {\n\tconst iterator = data[Symbol.asyncIterator]();\n\tconst head = [];\n\tfor (let next = await iterator.next(); !next.done; next = await iterator.next()) {\n\t\thead.push(next.value);\n\t\tif (tryParse(concat(head))) break;\n\t}\n\treturn reassemble(head, iterator);\n}\n//#endregion\nexport { peekHead };\n\n//# sourceMappingURL=head-peek.js.map","import { peek, update } from \"../../core/signals/primitives.js\";\nimport { effect } from \"../../core/signals/effect.js\";\nimport { resolveVttSegmentMetadata } from \"../../media/text/resolve-vtt-metadata.js\";\nimport { findTrackById, getTracksByType } from \"../../media/utils/tracks.js\";\nimport { dispatchCuesStep, textStepWiring } from \"./text-segment-load-pipeline.js\";\nimport { dispatchStep, fetchStep } from \"./segment-load-pipeline.js\";\nimport { findMediaTrack, readBaseMediaDecodeTime } from \"../../media/mp4/timestamp-origin.js\";\nimport { peekHead } from \"./head-peek.js\";\n//#region src/playback/primitives/relocation-pipelines.ts\n/** Assert the relocation state view from the opaque step deps — this module knows the slots the composition provides. */\nfunction relocationState(deps) {\n\treturn deps.state;\n}\nfunction containerSlot(deps) {\n\treturn relocationState(deps).mediaContainerData;\n}\n/** Synchronous RMW of the per-type entry — disjoint keys across producers, so no lost update. */\nfunction writeContainer(slot, trackType, patch) {\n\tupdate(slot, (current) => ({\n\t\t...current,\n\t\t[trackType]: {\n\t\t\t...current?.[trackType],\n\t\t\t...patch\n\t\t}\n\t}));\n}\n/**\n* Resolve once `read()` returns a number. Shared by the A/V stamp (waits for the\n* `derive`d origin — immediate for per-type, the shared-`min` barrier for coordinated)\n* and the text step (waits for the primary A/V origin). No bound: for fMP4 the origin\n* always establishes.\n*/\nfunction awaitDefined(read) {\n\treturn new Promise((resolve) => {\n\t\tlet stop;\n\t\tstop = effect(() => {\n\t\t\tconst value = read();\n\t\t\tif (value !== void 0) {\n\t\t\t\tstop?.();\n\t\t\t\tresolve(value);\n\t\t\t}\n\t\t});\n\t});\n}\n/**\n* Relocation pipelines for one track type — a plain config `messagePipelines`.\n* Keyed by **track type** (`'video'` / `'audio'`), so ABR rungs of a type share the\n* origin (discover skips once the type's value is present). The steps read/write\n* `state.mediaContainerData[trackType]` via their call-time `deps`; the stamp applies\n* the same `derive` seam the reactor uses (pass the composition's resolved\n* `deriveStartMediaTime` so the buffer offset and the model's `startMediaTime` agree).\n*/\nfunction relocationPipelinesFor(trackType, derive) {\n\tconst handlerType = trackType === \"video\" ? \"vide\" : \"soun\";\n\t/**\n\t* Init step: head-peek the buffered media track's `track_id` + `mdhd` timescale into\n\t* `mediaContainerData[trackType]`. Matching by handler (`vide`/`soun`) skips a muxed\n\t* `clcp` caption track, and the `track_id` lets `readSegmentOrigin` read *this*\n\t* track's `tfdt` rather than the first `traf` in the segment.\n\t*/\n\tconst readInitTrackInfo = async (frame, _signal, deps) => {\n\t\tconst { op } = frame;\n\t\tif (op.type !== \"append-init\" || !frame.data) return;\n\t\tconst slot = containerSlot(deps);\n\t\tif (peek(slot)?.[trackType]?.timescale !== void 0) return;\n\t\tframe.data = await peekHead(frame.data, (bytes) => {\n\t\t\tconst track = findMediaTrack(bytes, handlerType);\n\t\t\tif (track === void 0) return false;\n\t\t\twriteContainer(slot, trackType, {\n\t\t\t\ttrackId: track.trackId,\n\t\t\t\ttimescale: track.timescale\n\t\t\t});\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* Media-segment step: head-peek the `tfdt` baseMediaDecodeTime of the media track's\n\t* `traf` (matched by the `track_id` discovered from the init), recording the\n\t* segment's 0-based `startTime` with it — the origin is `bmdt/ts − segmentStartTime`,\n\t* so the first *loaded* segment need not be the 0th. Without a discovered `track_id`\n\t* (non-fMP4 / mock init) there's no media track to relocate, so the step no-ops and\n\t* the append stays native.\n\t*/\n\tconst readSegmentOrigin = async (frame, _signal, deps) => {\n\t\tconst { op } = frame;\n\t\tif (op.type !== \"append-segment\" || !frame.data) return;\n\t\tconst slot = containerSlot(deps);\n\t\tconst container = peek(slot)?.[trackType];\n\t\tif (container?.baseMediaDecodeTime !== void 0) return;\n\t\tconst { trackId } = container ?? {};\n\t\tif (trackId === void 0) return;\n\t\tconst segmentStartTime = op.meta.startTime;\n\t\tframe.data = await peekHead(frame.data, (bytes) => {\n\t\t\tconst baseMediaDecodeTime = readBaseMediaDecodeTime(bytes, trackId);\n\t\t\tif (baseMediaDecodeTime === void 0) return false;\n\t\t\twriteContainer(slot, trackType, {\n\t\t\t\tbaseMediaDecodeTime,\n\t\t\t\tsegmentStartTime\n\t\t\t});\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* Stamp step — tier-agnostic apply. Relocate by the `derive`d `startMediaTime` for\n\t* this type (`offset = −startMediaTime`). Applies the **same** `derive` the reactor\n\t* uses, over the shared `mediaContainerData` slot — so the buffer offset matches the\n\t* model's stamped `startMediaTime`, and it's robust to `established` + late tracks\n\t* (the slot persists; the model value may not be re-stamped after the reactor goes\n\t* sticky). Awaited: per-type resolves at once (own origin discovered earlier in this\n\t* pipeline); shared-`min` waits until every selected A/V origin is in — the barrier,\n\t* filled by the other type's discover step. A derived `0` (0-PTS / below threshold)\n\t* leaves the append native — setting `timestampOffset` at all can ripple.\n\t*/\n\tconst stampStartMediaTime = async (frame, signal, deps) => {\n\t\tif (frame.op.type !== \"append-segment\") return;\n\t\tconst state = relocationState(deps);\n\t\tconst own = peek(state.mediaContainerData)?.[trackType];\n\t\tif (own?.timescale === void 0 || own.baseMediaDecodeTime === void 0 || own.segmentStartTime === void 0) return;\n\t\tconst startMediaTime = await awaitDefined(() => {\n\t\t\tconst containerData = state.mediaContainerData.get();\n\t\t\tif (!containerData) return void 0;\n\t\t\treturn derive(containerData, {\n\t\t\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\t\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t\t\t})[trackType];\n\t\t});\n\t\tif (signal.aborted || startMediaTime === 0) return;\n\t\tframe.meta = {\n\t\t\t...frame.meta ?? frame.op.meta,\n\t\t\ttimestampOffset: -startMediaTime\n\t\t};\n\t};\n\treturn () => ({\n\t\tremove: [dispatchStep],\n\t\t\"append-init\": [\n\t\t\tfetchStep,\n\t\t\treadInitTrackInfo,\n\t\t\tdispatchStep\n\t\t],\n\t\t\"append-segment\": [\n\t\t\tfetchStep,\n\t\t\treadSegmentOrigin,\n\t\t\tstampStartMediaTime,\n\t\t\tdispatchStep\n\t\t]\n\t});\n}\n/**\n* Resolve step for the relocation text pipeline. Reuses the injected host resolver\n* (the loader's folded `resolveSegment`, via `textStepWiring`) for cues and fetches\n* the `X-TIMESTAMP-MAP` header in parallel, stashing it on `frame.metadata` for\n* `relocateCuesStep`. Replaces the\n* base `resolveCuesStep` (which fetches cues only) — text's native `<track>` parser\n* discards the header, so the map needs its own raw-bytes fetch.\n*/\nconst resolveWithMetadataStep = async (frame, signal, deps) => {\n\tconst [cues, metadata] = await Promise.all([textStepWiring(deps).resolveSegment(frame.op.segment.url), resolveVttSegmentMetadata(frame.op.segment.url)]);\n\tif (signal.aborted) return;\n\tframe.cues = cues;\n\tframe.metadata = metadata;\n};\n/**\n* Relocate step — shifts each cue onto the 0-based presentation timeline:\n* `cueFinal = cueNative − startMediaTime`, where `startMediaTime` is the primary\n* A/V track's origin (selected **video**, else **audio** — the single-anchor rule,\n* and defensive like the reactor's optional selection) and `cueNative` folds in the\n* `X-TIMESTAMP-MAP` correction (`mpegts/90000 − local`) for map-bearing VTT (Apple)\n* or is the absolute cue time (no map, e.g. Mux). Text can resolve before A/V\n* establishes, so the origin is awaited; fMP4 always establishes it (0-PTS → 0),\n* and a text-only source (no A/V selected) simply gets offset 0.\n*/\nconst relocateCuesStep = async (frame, signal, deps) => {\n\tif (!frame.cues?.length) return;\n\tconst state = deps.state;\n\tconst startMediaTime = await awaitDefined(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!presentation) return void 0;\n\t\tconst primaryId = state.selectedVideoTrackId.get() ?? state.selectedAudioTrackId.get();\n\t\tif (primaryId !== void 0) return findTrackById(presentation, primaryId)?.startMediaTime;\n\t\treturn getTracksByType(presentation, \"video\").length > 0 || getTracksByType(presentation, \"audio\").length > 0 ? void 0 : 0;\n\t});\n\tif (signal.aborted) return;\n\tconst { timestampMap } = frame.metadata ?? {};\n\tconst delta = (timestampMap ? timestampMap.mpegts / 9e4 - timestampMap.local : 0) - startMediaTime;\n\tif (delta !== 0) for (const cue of frame.cues) {\n\t\tcue.startTime += delta;\n\t\tcue.endTime += delta;\n\t}\n};\n/**\n* Relocation text pipeline — the text analog of `relocationPipelinesFor(type)`.\n* `resolveWithMetadata` (cues + `X-TIMESTAMP-MAP`) → `relocateCues` (shift by the\n* primary A/V origin) → `dispatchCues`.\n*/\nconst relocatingTextPipelines = () => [\n\tresolveWithMetadataStep,\n\trelocateCuesStep,\n\tdispatchCuesStep\n];\n//#endregion\nexport { relocatingTextPipelines, relocationPipelinesFor };\n\n//# sourceMappingURL=relocation-pipelines.js.map"],"mappings":"gXAwBA,SAASA,GAAY,EAAc,EAAc,EAAe,CAG/D,MAFI,CAAC,GAAgB,CAAC,GAAc,IAAY,sBAC5C,EAAsB,cACnB,YACR,CA2BA,SAAS,GAAuB,CAAE,QAAO,WAAW,CACnD,IAAM,EAAqB,MAAeA,GAAY,EAAM,aAAa,IAAI,EAAG,EAAQ,aAAa,IAAI,EAAG,EAAM,cAAc,IAAI,CAAC,CAAC,EAChI,EAAY,MAAe,EAAM,aAAa,IAAI,CAAC,EAAE,GAAG,EAC9D,OAAO,EAAqB,CAC3B,QAAS,sBACT,YAAe,EAAmB,IAAI,EACtC,OAAQ,CACP,sBAAuB,CAAC,EACxB,WAAY,CAAE,YAAe,CAC5B,IAAM,EAAK,EAAQ,aAAa,IAAI,EAC9B,MAAyB,EAAM,cAAc,IAAI,EAAI,EAC3D,GAAI,EAAG,UAAY,CAAC,EAAG,QAAU,EAAG,QAAS,CAC5C,EAAiB,EACjB,MACD,CACA,IAAM,EAAc,EAAO,EAAI,OAAQ,CAAgB,EACjD,EAAiB,EAAO,EAAI,UAAW,CAAgB,EAC7D,UAAa,CACZ,EAAY,EACZ,EAAe,CAChB,CACD,CAAE,EACF,cAAe,CAAE,aAChB,EAAQ,aAAa,IAAI,EACzB,EAAU,IAAI,MACD,EAAM,cAAc,IAAI,EAAK,EACzC,CACH,CACD,CAAC,CACF,CACA,MAAM,GAAoB,EAAe,CACxC,UAAW,CAAC,gBAAiB,cAAc,EAC3C,YAAa,CAAC,cAAc,EAC5B,MAAO,EACR,CAAC,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GAAG,KAC1B,gBAAiB,CAAC,CACnB,EACD,EACA,WAAc,CACb,OAAQ,CAAC,CAAY,EACrB,cAAe,CACd,EACA,EACA,CACD,EACA,iBAAkB,CACjB,EACA,EACA,EACA,CACD,CACD,EACD,CASA,MAAM,GAA0B,MAAO,EAAO,EAAQ,IAAS,CAC9D,GAAM,CAAC,EAAM,GAAY,MAAM,QAAQ,IAAI,CAAC,EAAe,CAAI,CAAC,CAAC,eAAe,EAAM,GAAG,QAAQ,GAAG,EAAG,GAA0B,EAAM,GAAG,QAAQ,GAAG,CAAC,CAAC,EACnJ,EAAO,UACX,EAAM,KAAO,EACb,EAAM,SAAW,EAClB,EAWM,GAAmB,MAAO,EAAO,EAAQ,IAAS,CACvD,GAAI,CAAC,EAAM,MAAM,OAAQ,OACzB,IAAM,EAAQ,EAAK,MACb,EAAiB,MAAM,MAAmB,CAC/C,IAAM,EAAe,EAAM,aAAa,IAAI,EAC5C,GAAI,CAAC,EAAc,OACnB,IAAM,EAAY,EAAM,qBAAqB,IAAI,GAAK,EAAM,qBAAqB,IAAI,EAErF,OADI,IAAc,IAAK,GAChB,EAAgB,EAAc,OAAO,CAAC,CAAC,OAAS,GAAK,EAAgB,EAAc,OAAO,CAAC,CAAC,OAAS,EAAI,IAAK,GAAI,EADxF,EAAc,EAAc,CAAS,CAAC,EAAE,cAE1E,CAAC,EACD,GAAI,EAAO,QAAS,OACpB,GAAM,CAAE,gBAAiB,EAAM,UAAY,CAAC,EACtC,GAAS,EAAe,EAAa,OAAS,IAAM,EAAa,MAAQ,GAAK,EACpF,GAAI,IAAU,EAAG,IAAK,IAAM,KAAO,EAAM,KACxC,EAAI,WAAa,EACjB,EAAI,SAAW,CAEjB,EAMM,OAAgC,CACrC,GACA,GACA,CACD"}
@@ -1 +0,0 @@
1
- var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{t};
@@ -1,18 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) {
6
- __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- }
11
- if (!no_symbols) {
12
- __defProp(target, Symbol.toStringTag, { value: "Module" });
13
- }
14
- return target;
15
- };
16
-
17
- //#endregion
18
- export { __exportAll as t };