@oiz/stzh-components 2.0.0-beta → 2.1.0-alpha

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 (693) hide show
  1. package/dist/cjs/{app-globals-58a084a9.js → app-globals-e1f4f1d9.js} +1 -1
  2. package/dist/cjs/{dom-874a1e39.js → dom-9deb26c8.js} +1 -1
  3. package/dist/cjs/{index-ac9bdc7f.js → index-9fcb4305.js} +228 -210
  4. package/dist/cjs/loader.cjs.js +4 -4
  5. package/dist/cjs/{shadow-css-a33dc836.js → shadow-css-bf3843d2.js} +1 -1
  6. package/dist/cjs/stzh-accordion-item.cjs.entry.js +34 -26
  7. package/dist/cjs/stzh-accordion.cjs.entry.js +1 -3
  8. package/dist/cjs/stzh-actions.cjs.entry.js +3 -5
  9. package/dist/cjs/stzh-actionset.cjs.entry.js +16 -24
  10. package/dist/cjs/stzh-anchornav.cjs.entry.js +52 -0
  11. package/dist/cjs/stzh-appnav.cjs.entry.js +4 -7
  12. package/dist/cjs/stzh-appointments.cjs.entry.js +12 -17
  13. package/dist/cjs/stzh-audio.cjs.entry.js +4150 -0
  14. package/dist/cjs/stzh-badge_3.cjs.entry.js +38 -59
  15. package/dist/cjs/stzh-calendar.cjs.entry.js +9 -25
  16. package/dist/cjs/stzh-card-list.cjs.entry.js +23 -26
  17. package/dist/cjs/stzh-card.cjs.entry.js +37 -49
  18. package/dist/cjs/stzh-cell.cjs.entry.js +1 -8
  19. package/dist/cjs/stzh-checkbox.cjs.entry.js +15 -20
  20. package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +29 -20
  21. package/dist/cjs/stzh-chip-select.cjs.entry.js +57 -11
  22. package/dist/cjs/stzh-chip.cjs.entry.js +15 -24
  23. package/dist/cjs/stzh-clamp.cjs.entry.js +27 -0
  24. package/dist/cjs/stzh-components.cjs.js +5 -5
  25. package/dist/cjs/stzh-container.cjs.entry.js +1 -1
  26. package/dist/cjs/stzh-cspace.cjs.entry.js +2 -2
  27. package/dist/cjs/stzh-datalist.cjs.entry.js +8 -20
  28. package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +12 -12
  29. package/dist/cjs/stzh-datamessagelist.cjs.entry.js +1 -1
  30. package/dist/cjs/stzh-datatable.cjs.entry.js +16 -22
  31. package/dist/cjs/stzh-datepicker_3.cjs.entry.js +431 -0
  32. package/dist/cjs/stzh-dialog.cjs.entry.js +12 -20
  33. package/dist/cjs/stzh-dropdown.cjs.entry.js +17 -37
  34. package/dist/cjs/stzh-fieldset.cjs.entry.js +1 -5
  35. package/dist/cjs/stzh-figure.cjs.entry.js +1 -3
  36. package/dist/cjs/stzh-flyingfocus.cjs.entry.js +7 -7
  37. package/dist/cjs/stzh-footer.cjs.entry.js +5 -5
  38. package/dist/cjs/stzh-ghettobox_2.cjs.entry.js +10 -21
  39. package/dist/cjs/stzh-header.cjs.entry.js +3 -9
  40. package/dist/cjs/stzh-heading.cjs.entry.js +2 -5
  41. package/dist/cjs/stzh-hr.cjs.entry.js +1 -1
  42. package/dist/cjs/stzh-hspace.cjs.entry.js +2 -11
  43. package/dist/cjs/stzh-icon-sprite.cjs.entry.js +2 -2
  44. package/dist/cjs/{stzh-input-description-9802abc2.js → stzh-input-description-4326b0d9.js} +1 -1
  45. package/dist/cjs/stzh-input.cjs.entry.js +32 -39
  46. package/dist/cjs/stzh-link.cjs.entry.js +27 -33
  47. package/dist/cjs/stzh-list-item.cjs.entry.js +1 -1
  48. package/dist/cjs/stzh-list.cjs.entry.js +1 -2
  49. package/dist/cjs/stzh-loader.cjs.entry.js +1 -4
  50. package/dist/cjs/stzh-loadingbar.cjs.entry.js +1 -4
  51. package/dist/cjs/stzh-menu_2.cjs.entry.js +13 -17
  52. package/dist/cjs/stzh-message.cjs.entry.js +6 -19
  53. package/dist/cjs/stzh-metanav.cjs.entry.js +1 -1
  54. package/dist/cjs/stzh-olmap.cjs.entry.js +51129 -0
  55. package/dist/cjs/stzh-overlay.cjs.entry.js +1 -4
  56. package/dist/cjs/stzh-page-skiplinks.cjs.entry.js +1 -1
  57. package/dist/cjs/stzh-pagetitle.cjs.entry.js +2 -2
  58. package/dist/cjs/stzh-popover.cjs.entry.js +10 -13
  59. package/dist/cjs/stzh-portal-mitwirken.cjs.entry.js +2 -2
  60. package/dist/cjs/stzh-progressbar-item.cjs.entry.js +9 -9
  61. package/dist/cjs/stzh-progressbar.cjs.entry.js +9 -24
  62. package/dist/cjs/stzh-readspeaker.cjs.entry.js +3 -1
  63. package/dist/cjs/stzh-row.cjs.entry.js +1 -9
  64. package/dist/cjs/stzh-saptcha.cjs.entry.js +5 -8
  65. package/dist/cjs/stzh-section.cjs.entry.js +1 -2
  66. package/dist/cjs/stzh-skiplink.cjs.entry.js +4 -2
  67. package/dist/cjs/stzh-sortable.cjs.entry.js +29 -32
  68. package/dist/cjs/stzh-status.cjs.entry.js +1 -5
  69. package/dist/cjs/stzh-sticky.cjs.entry.js +84 -0
  70. package/dist/cjs/stzh-table.cjs.entry.js +9 -11
  71. package/dist/cjs/stzh-text.cjs.entry.js +37 -0
  72. package/dist/cjs/stzh-toggle.cjs.entry.js +16 -22
  73. package/dist/cjs/stzh-tooltip.cjs.entry.js +12 -23
  74. package/dist/cjs/stzh-upload.cjs.entry.js +52 -131
  75. package/dist/cjs/stzh-vbz-linechip.cjs.entry.js +5 -7
  76. package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +8 -9
  77. package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +7 -8
  78. package/dist/cjs/stzh-visuallyhidden.cjs.entry.js +1 -1
  79. package/dist/cjs/stzh-vspace.cjs.entry.js +2 -11
  80. package/dist/collection/assets/i18n/de.json +19 -0
  81. package/dist/collection/assets/i18n/en.json +19 -0
  82. package/dist/collection/assets/icons/mono/code-window.svg +3 -0
  83. package/dist/collection/assets/icons/mono/target-bullet.svg +12 -0
  84. package/dist/collection/assets/media/olmap/marker-active.png +0 -0
  85. package/dist/collection/assets/media/olmap/marker-position.png +0 -0
  86. package/dist/collection/assets/media/olmap/marker.png +0 -0
  87. package/dist/collection/assets/media/olmap/thumb-satellite.jpg +0 -0
  88. package/dist/collection/assets/media/olmap/thumb-streets.jpg +0 -0
  89. package/dist/collection/collection-manifest.json +7 -2
  90. package/dist/collection/components/stzh-accordion/stzh-accordion.js +0 -2
  91. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.css +34 -8
  92. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.js +123 -24
  93. package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.stories.js +9 -0
  94. package/dist/collection/components/stzh-actions/stzh-actions.js +2 -4
  95. package/dist/collection/components/stzh-actionset/stzh-actionset.js +21 -29
  96. package/dist/collection/components/stzh-anchornav/stzh-anchornav.css +286 -0
  97. package/dist/collection/components/stzh-anchornav/stzh-anchornav.js +216 -0
  98. package/dist/collection/components/stzh-anchornav/stzh-anchornav.stories.js +76 -0
  99. package/dist/collection/components/stzh-appnav/stzh-appnav.js +3 -6
  100. package/dist/collection/components/stzh-appointments/stzh-appointments.js +11 -16
  101. package/dist/collection/components/stzh-audio/stzh-audio.css +319 -0
  102. package/dist/collection/components/stzh-audio/stzh-audio.js +333 -0
  103. package/dist/collection/components/stzh-audio/stzh-audio.localization.js +1 -0
  104. package/dist/collection/components/stzh-audio/stzh-audio.stories.js +89 -0
  105. package/dist/collection/components/stzh-badge/stzh-badge.css +22 -2
  106. package/dist/collection/components/stzh-badge/stzh-badge.js +24 -2
  107. package/dist/collection/components/stzh-button/stzh-button.css +1 -0
  108. package/dist/collection/components/stzh-button/stzh-button.js +65 -46
  109. package/dist/collection/components/stzh-calendar/stzh-calendar.js +8 -24
  110. package/dist/collection/components/stzh-card/stzh-card.css +2 -14
  111. package/dist/collection/components/stzh-card/stzh-card.js +39 -69
  112. package/dist/collection/components/stzh-card/stzh-card.stories.js +1 -4
  113. package/dist/collection/components/stzh-card-list/stzh-card-list.js +25 -54
  114. package/dist/collection/components/stzh-card-list/stzh-card-list.stories.js +2 -2
  115. package/dist/collection/components/stzh-cell/stzh-cell.js +0 -7
  116. package/dist/collection/components/stzh-checkbox/stzh-checkbox.js +13 -18
  117. package/dist/collection/components/stzh-checkboxgroup/stzh-checkboxgroup.js +33 -20
  118. package/dist/collection/components/stzh-chip/stzh-chip.js +49 -23
  119. package/dist/collection/components/stzh-chip-select/stzh-chip-select.css +80 -0
  120. package/dist/collection/components/stzh-chip-select/stzh-chip-select.js +217 -9
  121. package/dist/collection/components/stzh-clamp/stzh-clamp.css +279 -0
  122. package/dist/collection/components/stzh-clamp/stzh-clamp.js +125 -0
  123. package/dist/collection/components/stzh-clamp/stzh-clamp.stories.js +41 -0
  124. package/dist/collection/components/stzh-cspace/stzh-cspace.css +87 -176
  125. package/dist/collection/components/stzh-datalist/stzh-datalist.js +7 -19
  126. package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.css +3 -8
  127. package/dist/collection/components/stzh-datamessagelist-item/stzh-datamessagelist-item.js +10 -10
  128. package/dist/collection/components/stzh-datatable/stzh-datatable.css +5 -0
  129. package/dist/collection/components/stzh-datatable/stzh-datatable.js +14 -20
  130. package/dist/collection/components/stzh-datepicker/stzh-datepicker.js +19 -35
  131. package/dist/collection/components/stzh-dialog/stzh-dialog.css +9 -19
  132. package/dist/collection/components/stzh-dialog/stzh-dialog.js +10 -18
  133. package/dist/collection/components/stzh-dropdown/stzh-dropdown.js +15 -35
  134. package/dist/collection/components/stzh-fieldset/stzh-fieldset.js +0 -4
  135. package/dist/collection/components/stzh-figure/stzh-figure.js +0 -2
  136. package/dist/collection/components/stzh-flyingfocus/stzh-flyingfocus.js +6 -6
  137. package/dist/collection/components/stzh-footer/stzh-footer.js +4 -4
  138. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.css +16 -16
  139. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.js +7 -16
  140. package/dist/collection/components/stzh-ghettobox/stzh-ghettobox.stories.js +6 -6
  141. package/dist/collection/components/stzh-header/stzh-header.js +2 -8
  142. package/dist/collection/components/stzh-heading/stzh-heading.css +5 -15
  143. package/dist/collection/components/stzh-heading/stzh-heading.js +0 -3
  144. package/dist/collection/components/stzh-hr/stzh-hr.stories.js +11 -1
  145. package/dist/collection/components/stzh-hspace/stzh-hspace.css +19 -24
  146. package/dist/collection/components/stzh-hspace/stzh-hspace.js +0 -9
  147. package/dist/collection/components/stzh-icon/stzh-icon.js +0 -8
  148. package/dist/collection/components/stzh-icon-sprite/assets/svgsprites/symbol/sprite.symbol.html +58 -32
  149. package/dist/collection/components/stzh-icon-sprite/assets/svgsprites/symbol/svg/sprite.symbol.svg +1 -1
  150. package/dist/collection/components/stzh-input/stzh-input.js +31 -38
  151. package/dist/collection/components/stzh-link/stzh-link.css +18 -0
  152. package/dist/collection/components/stzh-link/stzh-link.js +97 -31
  153. package/dist/collection/components/stzh-link/stzh-link.stories.js +3 -1
  154. package/dist/collection/components/stzh-list/stzh-list.js +0 -1
  155. package/dist/collection/components/stzh-loader/stzh-loader.js +0 -3
  156. package/dist/collection/components/stzh-loadingbar/stzh-loadingbar.js +0 -3
  157. package/dist/collection/components/stzh-menu-item/stzh-menu-item.js +48 -16
  158. package/dist/collection/components/stzh-message/stzh-message.css +5 -0
  159. package/dist/collection/components/stzh-message/stzh-message.js +4 -17
  160. package/dist/collection/components/stzh-olmap/stzh-olmap.css +284 -0
  161. package/dist/collection/components/stzh-olmap/stzh-olmap.js +1042 -0
  162. package/dist/collection/components/stzh-olmap/stzh-olmap.localization.js +1 -0
  163. package/dist/collection/components/stzh-olmap/stzh-olmap.stories.js +36 -0
  164. package/dist/collection/components/stzh-overlay/stzh-overlay.js +0 -3
  165. package/dist/collection/components/stzh-pagetitle/stzh-pagetitle.css +3 -8
  166. package/dist/collection/components/stzh-popover/stzh-popover.js +9 -12
  167. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.css +226 -337
  168. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.js +1 -2
  169. package/dist/collection/components/stzh-portal-mitwirken/stzh-portal-mitwirken.stories.js +1 -1
  170. package/dist/collection/components/stzh-progressbar/stzh-progressbar.js +8 -23
  171. package/dist/collection/components/stzh-progressbar-item/stzh-progressbar-item.js +8 -8
  172. package/dist/collection/components/stzh-radio/stzh-radio.js +13 -18
  173. package/dist/collection/components/stzh-radiogroup/stzh-radiogroup.js +34 -22
  174. package/dist/collection/components/stzh-readspeaker/stzh-readspeaker.js +2 -0
  175. package/dist/collection/components/stzh-richtext/stzh-richtext.css +88 -129
  176. package/dist/collection/components/stzh-richtext/stzh-richtext.js +0 -2
  177. package/dist/collection/components/stzh-row/stzh-row.js +0 -8
  178. package/dist/collection/components/stzh-saptcha/stzh-saptcha.css +8 -8
  179. package/dist/collection/components/stzh-saptcha/stzh-saptcha.js +3 -6
  180. package/dist/collection/components/stzh-section/stzh-section.js +0 -1
  181. package/dist/collection/components/stzh-skiplink/stzh-skiplink.js +3 -1
  182. package/dist/collection/components/stzh-sortable/stzh-sortable.css +12 -6
  183. package/dist/collection/components/stzh-sortable/stzh-sortable.js +27 -30
  184. package/dist/collection/components/stzh-status/stzh-status.js +0 -4
  185. package/dist/collection/components/stzh-sticky/stzh-sticky.css +144 -0
  186. package/dist/collection/components/stzh-sticky/stzh-sticky.js +184 -0
  187. package/dist/collection/components/stzh-sticky/stzh-sticky.stories.js +91 -0
  188. package/dist/collection/components/stzh-table/stzh-table.css +5 -0
  189. package/dist/collection/components/stzh-table/stzh-table.js +7 -9
  190. package/dist/collection/components/stzh-text/stzh-text.js +0 -8
  191. package/dist/collection/components/stzh-toggle/stzh-toggle.js +14 -20
  192. package/dist/collection/components/stzh-tooltip/stzh-tooltip.js +11 -22
  193. package/dist/collection/components/stzh-upload/stzh-upload.css +16 -7
  194. package/dist/collection/components/stzh-upload/stzh-upload.js +49 -128
  195. package/dist/collection/components/stzh-upload/stzh-upload.stories.js +1 -1
  196. package/dist/collection/components/stzh-vbz-linechip/stzh-vbz-linechip.js +4 -6
  197. package/dist/collection/components/stzh-vbz-majorticker/stzh-vbz-majorticker.js +7 -8
  198. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.css +2 -7
  199. package/dist/collection/components/stzh-vbz-ticker/stzh-vbz-ticker.js +5 -6
  200. package/dist/collection/components/stzh-vspace/stzh-vspace.css +19 -24
  201. package/dist/collection/components/stzh-vspace/stzh-vspace.js +0 -9
  202. package/dist/collection/pages/meinkonto.stories.js +3 -3
  203. package/dist/components/index.d.ts +5 -0
  204. package/dist/components/index.js +6 -1
  205. package/dist/components/stzh-accordion-item.js +51 -26
  206. package/dist/components/stzh-accordion.js +0 -2
  207. package/dist/components/stzh-actions.js +2 -4
  208. package/dist/components/stzh-actionset2.js +15 -23
  209. package/dist/components/stzh-anchornav.d.ts +11 -0
  210. package/dist/components/stzh-anchornav.js +97 -0
  211. package/dist/components/stzh-appnav.js +3 -6
  212. package/dist/components/stzh-appointments.js +11 -16
  213. package/dist/components/stzh-audio.d.ts +11 -0
  214. package/dist/components/stzh-audio.js +4195 -0
  215. package/dist/components/stzh-badge2.js +9 -4
  216. package/dist/components/stzh-button2.js +32 -47
  217. package/dist/components/stzh-calendar2.js +8 -24
  218. package/dist/components/stzh-card-list.js +23 -27
  219. package/dist/components/stzh-card.js +36 -49
  220. package/dist/components/stzh-cell.js +0 -7
  221. package/dist/components/stzh-checkbox.js +13 -18
  222. package/dist/components/stzh-checkboxgroup.js +28 -19
  223. package/dist/components/stzh-chip-select.js +67 -12
  224. package/dist/components/stzh-chip2.js +16 -23
  225. package/dist/components/stzh-clamp.d.ts +11 -0
  226. package/dist/components/stzh-clamp.js +6 -0
  227. package/dist/components/stzh-clamp2.js +43 -0
  228. package/dist/components/stzh-cspace.js +1 -1
  229. package/dist/components/stzh-datalist.js +7 -19
  230. package/dist/components/stzh-datamessagelist-item.js +11 -11
  231. package/dist/components/stzh-datatable.js +15 -21
  232. package/dist/components/stzh-datepicker2.js +19 -35
  233. package/dist/components/stzh-dialog.js +11 -19
  234. package/dist/components/stzh-dropdown2.js +15 -35
  235. package/dist/components/stzh-fieldset.js +0 -4
  236. package/dist/components/stzh-figure.js +0 -2
  237. package/dist/components/stzh-flyingfocus.js +6 -6
  238. package/dist/components/stzh-footer.js +4 -4
  239. package/dist/components/stzh-ghettobox2.js +8 -17
  240. package/dist/components/stzh-header.js +2 -8
  241. package/dist/components/stzh-heading2.js +1 -4
  242. package/dist/components/stzh-hspace.js +1 -10
  243. package/dist/components/stzh-icon-sprite.js +1 -1
  244. package/dist/components/stzh-icon2.js +0 -8
  245. package/dist/components/stzh-input2.js +30 -37
  246. package/dist/components/stzh-link2.js +30 -32
  247. package/dist/components/stzh-list.js +0 -1
  248. package/dist/components/stzh-loader.js +1 -43
  249. package/dist/components/stzh-loader2.js +42 -0
  250. package/dist/components/stzh-loadingbar.js +0 -3
  251. package/dist/components/stzh-menu-item2.js +14 -16
  252. package/dist/components/stzh-message.js +5 -18
  253. package/dist/components/stzh-olmap.d.ts +11 -0
  254. package/dist/components/stzh-olmap.js +51168 -0
  255. package/dist/components/stzh-overlay.js +0 -3
  256. package/dist/components/stzh-pagetitle.js +1 -1
  257. package/dist/components/stzh-popover2.js +9 -12
  258. package/dist/components/stzh-portal-mitwirken.js +1 -1
  259. package/dist/components/stzh-progressbar-item2.js +8 -8
  260. package/dist/components/stzh-progressbar.js +8 -23
  261. package/dist/components/stzh-radio2.js +13 -18
  262. package/dist/components/stzh-radiogroup2.js +29 -21
  263. package/dist/components/stzh-readspeaker.js +2 -0
  264. package/dist/components/stzh-richtext2.js +1 -3
  265. package/dist/components/stzh-row.js +0 -8
  266. package/dist/components/stzh-saptcha.js +4 -7
  267. package/dist/components/stzh-section.js +0 -1
  268. package/dist/components/stzh-skiplink.js +3 -1
  269. package/dist/components/stzh-sortable2.js +28 -31
  270. package/dist/components/stzh-status2.js +0 -4
  271. package/dist/components/stzh-sticky.d.ts +11 -0
  272. package/dist/components/stzh-sticky.js +102 -0
  273. package/dist/components/stzh-table.js +8 -10
  274. package/dist/components/stzh-text2.js +0 -8
  275. package/dist/components/stzh-toggle.js +14 -20
  276. package/dist/components/stzh-tooltip2.js +11 -22
  277. package/dist/components/stzh-upload.js +50 -129
  278. package/dist/components/stzh-vbz-linechip2.js +4 -6
  279. package/dist/components/stzh-vbz-majorticker.js +7 -8
  280. package/dist/components/stzh-vbz-ticker.js +6 -7
  281. package/dist/components/stzh-vspace.js +1 -10
  282. package/dist/esm/{app-globals-6b6ff890.js → app-globals-453acbdb.js} +1 -1
  283. package/dist/esm/{dom-104fb833.js → dom-6be6f662.js} +1 -1
  284. package/dist/esm/{index-84f71a43.js → index-2915b467.js} +228 -210
  285. package/dist/esm/loader.js +4 -4
  286. package/dist/esm/polyfills/css-shim.js +1 -1
  287. package/dist/esm/{shadow-css-4261c637.js → shadow-css-ed4599f8.js} +1 -1
  288. package/dist/esm/stzh-accordion-item.entry.js +34 -26
  289. package/dist/esm/stzh-accordion.entry.js +1 -3
  290. package/dist/esm/stzh-actions.entry.js +3 -5
  291. package/dist/esm/stzh-actionset.entry.js +16 -24
  292. package/dist/esm/stzh-anchornav.entry.js +48 -0
  293. package/dist/esm/stzh-appnav.entry.js +4 -7
  294. package/dist/esm/stzh-appointments.entry.js +12 -17
  295. package/dist/esm/stzh-audio.entry.js +4146 -0
  296. package/dist/esm/stzh-badge_3.entry.js +38 -59
  297. package/dist/esm/stzh-calendar.entry.js +10 -26
  298. package/dist/esm/stzh-card-list.entry.js +23 -26
  299. package/dist/esm/stzh-card.entry.js +37 -49
  300. package/dist/esm/stzh-cell.entry.js +1 -8
  301. package/dist/esm/stzh-checkbox.entry.js +15 -20
  302. package/dist/esm/stzh-checkboxgroup.entry.js +29 -20
  303. package/dist/esm/stzh-chip-select.entry.js +57 -11
  304. package/dist/esm/stzh-chip.entry.js +15 -24
  305. package/dist/esm/stzh-clamp.entry.js +23 -0
  306. package/dist/esm/stzh-components.js +5 -5
  307. package/dist/esm/stzh-container.entry.js +1 -1
  308. package/dist/esm/stzh-cspace.entry.js +2 -2
  309. package/dist/esm/stzh-datalist.entry.js +8 -20
  310. package/dist/esm/stzh-datamessagelist-item.entry.js +12 -12
  311. package/dist/esm/stzh-datamessagelist.entry.js +1 -1
  312. package/dist/esm/stzh-datatable.entry.js +16 -22
  313. package/dist/esm/stzh-datepicker_3.entry.js +425 -0
  314. package/dist/esm/stzh-dialog.entry.js +12 -20
  315. package/dist/esm/stzh-dropdown.entry.js +17 -37
  316. package/dist/esm/stzh-fieldset.entry.js +1 -5
  317. package/dist/esm/stzh-figure.entry.js +1 -3
  318. package/dist/esm/stzh-flyingfocus.entry.js +7 -7
  319. package/dist/esm/stzh-footer.entry.js +5 -5
  320. package/dist/esm/stzh-ghettobox_2.entry.js +10 -21
  321. package/dist/esm/stzh-header.entry.js +3 -9
  322. package/dist/esm/stzh-heading.entry.js +2 -5
  323. package/dist/esm/stzh-hr.entry.js +1 -1
  324. package/dist/esm/stzh-hspace.entry.js +2 -11
  325. package/dist/esm/stzh-icon-sprite.entry.js +2 -2
  326. package/dist/esm/{stzh-input-description-8c477f97.js → stzh-input-description-e87e6697.js} +1 -1
  327. package/dist/esm/stzh-input.entry.js +32 -39
  328. package/dist/esm/stzh-link.entry.js +27 -33
  329. package/dist/esm/stzh-list-item.entry.js +1 -1
  330. package/dist/esm/stzh-list.entry.js +1 -2
  331. package/dist/esm/stzh-loader.entry.js +1 -4
  332. package/dist/esm/stzh-loadingbar.entry.js +1 -4
  333. package/dist/esm/stzh-menu_2.entry.js +13 -17
  334. package/dist/esm/stzh-message.entry.js +6 -19
  335. package/dist/esm/stzh-metanav.entry.js +1 -1
  336. package/dist/esm/stzh-olmap.entry.js +51125 -0
  337. package/dist/esm/stzh-overlay.entry.js +1 -4
  338. package/dist/esm/stzh-page-skiplinks.entry.js +1 -1
  339. package/dist/esm/stzh-pagetitle.entry.js +2 -2
  340. package/dist/esm/stzh-popover.entry.js +10 -13
  341. package/dist/esm/stzh-portal-mitwirken.entry.js +2 -2
  342. package/dist/esm/stzh-progressbar-item.entry.js +9 -9
  343. package/dist/esm/stzh-progressbar.entry.js +9 -24
  344. package/dist/esm/stzh-readspeaker.entry.js +3 -1
  345. package/dist/esm/stzh-row.entry.js +1 -9
  346. package/dist/esm/stzh-saptcha.entry.js +5 -8
  347. package/dist/esm/stzh-section.entry.js +1 -2
  348. package/dist/esm/stzh-skiplink.entry.js +4 -2
  349. package/dist/esm/stzh-sortable.entry.js +29 -32
  350. package/dist/esm/stzh-status.entry.js +1 -5
  351. package/dist/esm/stzh-sticky.entry.js +80 -0
  352. package/dist/esm/stzh-table.entry.js +9 -11
  353. package/dist/esm/stzh-text.entry.js +33 -0
  354. package/dist/esm/stzh-toggle.entry.js +16 -22
  355. package/dist/esm/stzh-tooltip.entry.js +12 -23
  356. package/dist/esm/stzh-upload.entry.js +52 -131
  357. package/dist/esm/stzh-vbz-linechip.entry.js +5 -7
  358. package/dist/esm/stzh-vbz-majorticker.entry.js +8 -9
  359. package/dist/esm/stzh-vbz-ticker.entry.js +7 -8
  360. package/dist/esm/stzh-visuallyhidden.entry.js +1 -1
  361. package/dist/esm/stzh-vspace.entry.js +2 -11
  362. package/dist/esm-es5/app-globals-453acbdb.js +1 -0
  363. package/dist/esm-es5/{dom-104fb833.js → dom-6be6f662.js} +0 -0
  364. package/dist/esm-es5/index-2915b467.js +2 -0
  365. package/dist/esm-es5/loader.js +1 -1
  366. package/dist/esm-es5/{shadow-css-4261c637.js → shadow-css-ed4599f8.js} +0 -0
  367. package/dist/esm-es5/stzh-accordion-item.entry.js +1 -1
  368. package/dist/esm-es5/stzh-accordion.entry.js +1 -1
  369. package/dist/esm-es5/stzh-actions.entry.js +1 -1
  370. package/dist/esm-es5/stzh-actionset.entry.js +1 -1
  371. package/dist/esm-es5/stzh-anchornav.entry.js +1 -0
  372. package/dist/esm-es5/stzh-appnav.entry.js +1 -1
  373. package/dist/esm-es5/stzh-appointments.entry.js +1 -1
  374. package/dist/esm-es5/stzh-audio.entry.js +31 -0
  375. package/dist/esm-es5/stzh-badge_3.entry.js +1 -1
  376. package/dist/esm-es5/stzh-calendar.entry.js +1 -1
  377. package/dist/esm-es5/stzh-card-list.entry.js +1 -1
  378. package/dist/esm-es5/stzh-card.entry.js +1 -1
  379. package/dist/esm-es5/stzh-cell.entry.js +1 -1
  380. package/dist/esm-es5/stzh-checkbox.entry.js +1 -1
  381. package/dist/esm-es5/stzh-checkboxgroup.entry.js +1 -1
  382. package/dist/esm-es5/stzh-chip-select.entry.js +1 -1
  383. package/dist/esm-es5/stzh-chip.entry.js +1 -1
  384. package/dist/esm-es5/stzh-clamp.entry.js +1 -0
  385. package/dist/esm-es5/stzh-components.js +1 -1
  386. package/dist/esm-es5/stzh-container.entry.js +1 -1
  387. package/dist/esm-es5/stzh-cspace.entry.js +1 -1
  388. package/dist/esm-es5/stzh-datalist.entry.js +1 -1
  389. package/dist/esm-es5/stzh-datamessagelist-item.entry.js +1 -1
  390. package/dist/esm-es5/stzh-datamessagelist.entry.js +1 -1
  391. package/dist/esm-es5/stzh-datatable.entry.js +2 -2
  392. package/dist/esm-es5/stzh-datepicker_3.entry.js +1 -0
  393. package/dist/esm-es5/stzh-dialog.entry.js +1 -1
  394. package/dist/esm-es5/stzh-dropdown.entry.js +1 -1
  395. package/dist/esm-es5/stzh-fieldset.entry.js +1 -1
  396. package/dist/esm-es5/stzh-figure.entry.js +1 -1
  397. package/dist/esm-es5/stzh-flyingfocus.entry.js +1 -1
  398. package/dist/esm-es5/stzh-footer.entry.js +1 -1
  399. package/dist/esm-es5/stzh-ghettobox_2.entry.js +1 -1
  400. package/dist/esm-es5/stzh-header.entry.js +1 -1
  401. package/dist/esm-es5/stzh-heading.entry.js +1 -1
  402. package/dist/esm-es5/stzh-hr.entry.js +1 -1
  403. package/dist/esm-es5/stzh-hspace.entry.js +1 -1
  404. package/dist/esm-es5/stzh-icon-sprite.entry.js +1 -1
  405. package/dist/esm-es5/{stzh-input-description-8c477f97.js → stzh-input-description-e87e6697.js} +1 -1
  406. package/dist/esm-es5/stzh-input.entry.js +1 -1
  407. package/dist/esm-es5/stzh-link.entry.js +1 -1
  408. package/dist/esm-es5/stzh-list-item.entry.js +1 -1
  409. package/dist/esm-es5/stzh-list.entry.js +1 -1
  410. package/dist/esm-es5/stzh-loader.entry.js +1 -1
  411. package/dist/esm-es5/stzh-loadingbar.entry.js +1 -1
  412. package/dist/esm-es5/stzh-menu_2.entry.js +1 -1
  413. package/dist/esm-es5/stzh-message.entry.js +1 -1
  414. package/dist/esm-es5/stzh-metanav.entry.js +1 -1
  415. package/dist/esm-es5/stzh-olmap.entry.js +7 -0
  416. package/dist/esm-es5/stzh-overlay.entry.js +1 -1
  417. package/dist/esm-es5/stzh-page-skiplinks.entry.js +1 -1
  418. package/dist/esm-es5/stzh-pagetitle.entry.js +1 -1
  419. package/dist/esm-es5/stzh-popover.entry.js +1 -1
  420. package/dist/esm-es5/stzh-portal-mitwirken.entry.js +1 -1
  421. package/dist/esm-es5/stzh-progressbar-item.entry.js +1 -1
  422. package/dist/esm-es5/stzh-progressbar.entry.js +1 -1
  423. package/dist/esm-es5/stzh-readspeaker.entry.js +1 -1
  424. package/dist/esm-es5/stzh-row.entry.js +1 -1
  425. package/dist/esm-es5/stzh-saptcha.entry.js +1 -1
  426. package/dist/esm-es5/stzh-section.entry.js +1 -1
  427. package/dist/esm-es5/stzh-skiplink.entry.js +1 -1
  428. package/dist/esm-es5/stzh-sortable.entry.js +2 -2
  429. package/dist/esm-es5/stzh-status.entry.js +1 -1
  430. package/dist/esm-es5/stzh-sticky.entry.js +1 -0
  431. package/dist/esm-es5/stzh-table.entry.js +1 -1
  432. package/dist/{stzh-components/p-fc6b4f91.system.entry.js → esm-es5/stzh-text.entry.js} +1 -1
  433. package/dist/esm-es5/stzh-toggle.entry.js +1 -1
  434. package/dist/esm-es5/stzh-tooltip.entry.js +1 -1
  435. package/dist/esm-es5/stzh-upload.entry.js +1 -1
  436. package/dist/esm-es5/stzh-vbz-linechip.entry.js +1 -1
  437. package/dist/esm-es5/stzh-vbz-majorticker.entry.js +1 -1
  438. package/dist/esm-es5/stzh-vbz-ticker.entry.js +1 -1
  439. package/dist/esm-es5/stzh-visuallyhidden.entry.js +1 -1
  440. package/dist/esm-es5/stzh-vspace.entry.js +1 -1
  441. package/dist/stzh-components/assets/i18n/de.json +19 -0
  442. package/dist/stzh-components/assets/i18n/en.json +19 -0
  443. package/dist/stzh-components/assets/icons/mono/code-window.svg +3 -0
  444. package/dist/stzh-components/assets/icons/mono/target-bullet.svg +12 -0
  445. package/dist/stzh-components/assets/media/olmap/marker-active.png +0 -0
  446. package/dist/stzh-components/assets/media/olmap/marker-position.png +0 -0
  447. package/dist/stzh-components/assets/media/olmap/marker.png +0 -0
  448. package/dist/stzh-components/assets/media/olmap/thumb-satellite.jpg +0 -0
  449. package/dist/stzh-components/assets/media/olmap/thumb-streets.jpg +0 -0
  450. package/dist/stzh-components/assets/svgsprites/symbol/sprite.symbol.html +58 -32
  451. package/dist/stzh-components/assets/svgsprites/symbol/svg/sprite.symbol.svg +1 -1
  452. package/dist/stzh-components/{p-5a354428.system.entry.js → p-011dcf30.system.entry.js} +1 -1
  453. package/dist/stzh-components/p-01909f35.system.entry.js +1 -0
  454. package/dist/stzh-components/p-020379d7.system.entry.js +7 -0
  455. package/dist/stzh-components/p-025953d1.system.entry.js +1 -0
  456. package/dist/stzh-components/{p-981b2629.system.entry.js → p-0321e98e.system.entry.js} +1 -1
  457. package/dist/stzh-components/p-04dd6821.entry.js +1 -0
  458. package/dist/stzh-components/p-05901b22.system.entry.js +1 -0
  459. package/dist/stzh-components/{p-fdf0b4bc.system.entry.js → p-08714718.system.entry.js} +1 -1
  460. package/dist/stzh-components/p-090bfb8e.system.entry.js +1 -0
  461. package/dist/stzh-components/p-0977d9b6.entry.js +1 -0
  462. package/dist/stzh-components/{p-8f16b0ac.entry.js → p-0c10d9b1.entry.js} +2 -2
  463. package/dist/stzh-components/p-0e474d1a.system.entry.js +1 -0
  464. package/dist/stzh-components/p-0e48efa7.entry.js +1 -0
  465. package/dist/stzh-components/{p-4c61dcad.js → p-13051e1c.js} +0 -0
  466. package/dist/stzh-components/{p-b9295dc2.entry.js → p-1399b2d7.entry.js} +1 -1
  467. package/dist/stzh-components/p-140e4b63.entry.js +1 -0
  468. package/dist/stzh-components/p-14f0d546.entry.js +1 -0
  469. package/dist/stzh-components/p-183e4790.system.entry.js +1 -0
  470. package/dist/stzh-components/p-1a5fc8e3.system.entry.js +1 -0
  471. package/dist/stzh-components/{p-db5363ef.entry.js → p-20a6ffbb.entry.js} +1 -1
  472. package/dist/stzh-components/p-229f4ebc.system.entry.js +1 -0
  473. package/dist/stzh-components/{p-89274cd5.system.entry.js → p-26159eac.system.entry.js} +1 -1
  474. package/dist/stzh-components/{p-6523a23b.system.js → p-2732d8c8.system.js} +0 -0
  475. package/dist/stzh-components/{p-56b9cc3c.system.entry.js → p-27573504.system.entry.js} +1 -1
  476. package/dist/stzh-components/p-27839f48.entry.js +1 -0
  477. package/dist/stzh-components/{p-fc13d017.system.entry.js → p-27bfb4c2.system.entry.js} +1 -1
  478. package/dist/stzh-components/{p-29427863.entry.js → p-29d9a568.entry.js} +1 -1
  479. package/dist/stzh-components/p-2bf021f2.js +1 -0
  480. package/dist/stzh-components/{p-f1356a85.entry.js → p-2c16d2ea.entry.js} +1 -1
  481. package/dist/stzh-components/p-2c783943.entry.js +1 -0
  482. package/dist/stzh-components/p-2c891eee.entry.js +1 -0
  483. package/dist/stzh-components/{p-17c6c1db.system.entry.js → p-2e276f2e.system.entry.js} +1 -1
  484. package/dist/stzh-components/{p-5bd2849d.entry.js → p-30e5a674.entry.js} +1 -1
  485. package/dist/stzh-components/{p-19bff884.system.entry.js → p-33a52001.system.entry.js} +1 -1
  486. package/dist/stzh-components/p-34eb65b9.entry.js +1 -0
  487. package/dist/stzh-components/p-3623b3a5.system.js +1 -0
  488. package/dist/stzh-components/p-36596b2b.system.entry.js +1 -0
  489. package/dist/stzh-components/{p-d6c07494.system.entry.js → p-37bdb9cd.system.entry.js} +1 -1
  490. package/dist/stzh-components/p-38977481.entry.js +1 -0
  491. package/dist/stzh-components/p-3a279b45.entry.js +1 -0
  492. package/dist/stzh-components/p-3a47ff2d.system.entry.js +1 -0
  493. package/dist/stzh-components/p-3b33fa76.system.entry.js +1 -0
  494. package/dist/stzh-components/{p-2b338050.entry.js → p-3e24b964.entry.js} +1 -1
  495. package/dist/stzh-components/{p-ee22256f.entry.js → p-3e504f50.entry.js} +1 -1
  496. package/dist/stzh-components/{p-b9382599.entry.js → p-3efefb7f.entry.js} +1 -1
  497. package/dist/stzh-components/{p-8a9e588e.system.entry.js → p-3f8976bc.system.entry.js} +1 -1
  498. package/dist/stzh-components/{p-8d0da18d.system.entry.js → p-3fc40cc0.system.entry.js} +1 -1
  499. package/dist/stzh-components/{p-4c6989ae.system.entry.js → p-440ae0cc.system.entry.js} +1 -1
  500. package/dist/stzh-components/{p-b550feaa.system.entry.js → p-44435254.system.entry.js} +1 -1
  501. package/dist/stzh-components/{p-ab246b66.entry.js → p-456143f9.entry.js} +1 -1
  502. package/dist/stzh-components/{p-190de4de.entry.js → p-46f4e907.entry.js} +1 -1
  503. package/dist/stzh-components/p-470e5f38.system.entry.js +1 -0
  504. package/dist/stzh-components/{p-ce070ccd.entry.js → p-4b93fb24.entry.js} +1 -1
  505. package/dist/stzh-components/p-509c97c9.system.entry.js +1 -0
  506. package/dist/stzh-components/{p-0fc83964.system.entry.js → p-529a56aa.system.entry.js} +1 -1
  507. package/dist/stzh-components/{p-63d89b96.system.js → p-52cd1bd1.system.js} +1 -1
  508. package/dist/stzh-components/p-53c30c58.entry.js +1 -0
  509. package/dist/stzh-components/p-55435022.system.entry.js +1 -0
  510. package/dist/stzh-components/p-554fb3ac.system.js +1 -0
  511. package/dist/stzh-components/{p-e213663c.system.entry.js → p-5869502c.system.entry.js} +1 -1
  512. package/dist/stzh-components/p-58714045.entry.js +1 -0
  513. package/dist/stzh-components/p-59970f71.entry.js +1 -0
  514. package/dist/stzh-components/{p-3d8317b5.entry.js → p-5c2d0572.entry.js} +1 -1
  515. package/dist/stzh-components/p-5c311df3.entry.js +1 -0
  516. package/dist/stzh-components/{p-72f29f07.entry.js → p-5e81420b.entry.js} +1 -1
  517. package/dist/stzh-components/p-609bf766.system.js +2 -0
  518. package/dist/stzh-components/{p-f832e938.system.entry.js → p-616e70e9.system.entry.js} +1 -1
  519. package/dist/stzh-components/p-62afe664.entry.js +1 -0
  520. package/dist/stzh-components/p-62c7caed.entry.js +1 -0
  521. package/dist/stzh-components/{p-851e0caa.system.entry.js → p-641126a8.system.entry.js} +1 -1
  522. package/dist/stzh-components/p-648e03bc.entry.js +1 -0
  523. package/dist/stzh-components/p-652eee8b.system.entry.js +1 -0
  524. package/dist/stzh-components/{p-69c3187f.system.entry.js → p-67ade1c7.system.entry.js} +1 -1
  525. package/dist/stzh-components/p-6a16ceff.entry.js +1 -0
  526. package/dist/stzh-components/{p-9c72f491.system.entry.js → p-6a96d63e.system.entry.js} +1 -1
  527. package/dist/stzh-components/p-6b2282cd.system.entry.js +1 -0
  528. package/dist/stzh-components/p-6b5f447c.system.entry.js +1 -0
  529. package/dist/stzh-components/{p-33c0229f.system.entry.js → p-6c1ad586.system.entry.js} +1 -1
  530. package/dist/stzh-components/{p-f788a468.entry.js → p-6c76e51d.entry.js} +1 -1
  531. package/dist/stzh-components/p-6cbdbd06.entry.js +1 -0
  532. package/dist/stzh-components/{p-64b4cc74.entry.js → p-6f7a7f7a.entry.js} +1 -1
  533. package/dist/stzh-components/{p-61aac051.system.entry.js → p-725b3e74.system.entry.js} +1 -1
  534. package/dist/stzh-components/p-74786856.system.entry.js +1 -0
  535. package/dist/stzh-components/p-783346ed.entry.js +1 -0
  536. package/dist/stzh-components/p-7a4c6adb.js +2 -0
  537. package/dist/stzh-components/{p-a7ee2636.entry.js → p-7d77b8d2.entry.js} +1 -1
  538. package/dist/stzh-components/{p-9fb4da92.system.entry.js → p-7dd6fbc9.system.entry.js} +1 -1
  539. package/dist/stzh-components/{p-f84fa2a4.js → p-8347b91f.js} +1 -1
  540. package/dist/stzh-components/{p-ef5d4167.js → p-8364475f.js} +0 -0
  541. package/dist/stzh-components/{p-b636a18a.system.entry.js → p-881e526e.system.entry.js} +1 -1
  542. package/dist/stzh-components/p-8d9056de.entry.js +1 -0
  543. package/dist/stzh-components/p-8e363084.system.entry.js +1 -0
  544. package/dist/stzh-components/{p-8d547247.system.entry.js → p-8eb72064.system.entry.js} +1 -1
  545. package/dist/stzh-components/{p-fa56fc0d.system.entry.js → p-8fc8d8c2.system.entry.js} +1 -1
  546. package/dist/stzh-components/{p-6305db38.system.entry.js → p-90665664.system.entry.js} +1 -1
  547. package/dist/stzh-components/{p-48b5b697.system.entry.js → p-90941379.system.entry.js} +1 -1
  548. package/dist/stzh-components/p-90ad5e2c.entry.js +1 -0
  549. package/dist/stzh-components/p-92788577.entry.js +34 -0
  550. package/dist/stzh-components/{p-27fd6c6f.system.entry.js → p-92ad9720.system.entry.js} +1 -1
  551. package/dist/stzh-components/{p-c58dd9de.entry.js → p-9454a438.entry.js} +1 -1
  552. package/dist/stzh-components/{p-b084fcbf.system.entry.js → p-965829a6.system.entry.js} +1 -1
  553. package/dist/stzh-components/p-9a7593f5.entry.js +1 -0
  554. package/dist/stzh-components/{p-58d886cb.system.entry.js → p-9ca1efe4.system.entry.js} +1 -1
  555. package/dist/stzh-components/p-9d58c713.entry.js +1 -0
  556. package/dist/stzh-components/p-a10e0117.system.entry.js +1 -0
  557. package/dist/stzh-components/p-a3559e69.entry.js +1 -0
  558. package/dist/stzh-components/p-a4a4370d.entry.js +1 -0
  559. package/dist/stzh-components/p-a61bf274.entry.js +9 -0
  560. package/dist/stzh-components/{p-ab455116.system.entry.js → p-a6da8c06.system.entry.js} +1 -1
  561. package/dist/stzh-components/p-afaa9c37.system.entry.js +1 -0
  562. package/dist/stzh-components/{p-88e0f453.entry.js → p-b09b85ac.entry.js} +1 -1
  563. package/dist/stzh-components/{p-5997e418.system.entry.js → p-b3587b9d.system.entry.js} +1 -1
  564. package/dist/stzh-components/{p-a67e09cd.system.entry.js → p-b491bcd7.system.entry.js} +1 -1
  565. package/dist/stzh-components/p-b5a59ac0.entry.js +1 -0
  566. package/dist/stzh-components/p-b666bb15.entry.js +1 -0
  567. package/dist/stzh-components/{p-2e559062.entry.js → p-b99c0844.entry.js} +1 -1
  568. package/dist/stzh-components/p-bb8f71a4.entry.js +7 -0
  569. package/dist/stzh-components/p-bb9e8364.entry.js +1 -0
  570. package/dist/stzh-components/p-bc841847.entry.js +1 -0
  571. package/dist/stzh-components/p-bd7dd853.system.entry.js +1 -0
  572. package/dist/stzh-components/p-bdc627fa.system.entry.js +1 -0
  573. package/dist/stzh-components/p-be534671.entry.js +1 -0
  574. package/dist/stzh-components/p-bfdce66c.entry.js +1 -0
  575. package/dist/stzh-components/p-c051fc3b.entry.js +1 -0
  576. package/dist/stzh-components/p-c1100fde.entry.js +1 -0
  577. package/dist/stzh-components/{p-55d23a3c.system.entry.js → p-c3161c9b.system.entry.js} +1 -1
  578. package/dist/stzh-components/{p-0fc06049.system.entry.js → p-c5749124.system.entry.js} +1 -1
  579. package/dist/stzh-components/p-c6813d9f.system.entry.js +1 -0
  580. package/dist/stzh-components/p-c7c3735a.entry.js +1 -0
  581. package/dist/stzh-components/p-c8009c05.system.entry.js +1 -0
  582. package/dist/stzh-components/{p-d0aa9d3b.entry.js → p-c866224d.entry.js} +1 -1
  583. package/dist/stzh-components/p-cbaab05e.entry.js +1 -0
  584. package/dist/stzh-components/{p-3b27a43f.system.entry.js → p-cc735465.system.entry.js} +2 -2
  585. package/dist/stzh-components/{p-6a873872.entry.js → p-d00e20ff.entry.js} +1 -1
  586. package/dist/stzh-components/{p-c3d93395.entry.js → p-d26ed018.entry.js} +1 -1
  587. package/dist/stzh-components/p-d408604f.system.entry.js +1 -0
  588. package/dist/stzh-components/{p-b9a027aa.entry.js → p-d69b12f8.entry.js} +1 -1
  589. package/dist/stzh-components/p-da857e0d.entry.js +1 -0
  590. package/dist/stzh-components/p-de8f9508.system.entry.js +1 -0
  591. package/dist/stzh-components/{p-a7c35778.system.entry.js → p-e347ce1e.system.entry.js} +1 -1
  592. package/dist/stzh-components/p-e56d7b16.system.entry.js +1 -0
  593. package/dist/stzh-components/{p-961cb979.entry.js → p-e662b688.entry.js} +1 -1
  594. package/dist/stzh-components/{p-c4b7c2be.entry.js → p-e69903fe.entry.js} +1 -1
  595. package/dist/stzh-components/p-e7afcd6f.entry.js +1 -0
  596. package/dist/stzh-components/p-e9313802.system.entry.js +31 -0
  597. package/dist/stzh-components/{p-560f96f0.system.entry.js → p-eb3425a1.system.entry.js} +1 -1
  598. package/dist/stzh-components/p-ee711f37.system.entry.js +1 -0
  599. package/dist/stzh-components/{p-5987573e.system.entry.js → p-ee944add.system.entry.js} +1 -1
  600. package/dist/stzh-components/{p-5a02ef03.entry.js → p-ef62b905.entry.js} +1 -1
  601. package/dist/stzh-components/{p-a8de6293.system.js → p-f39f347c.system.js} +0 -0
  602. package/dist/stzh-components/p-f8ccf5b1.entry.js +1 -0
  603. package/dist/stzh-components/p-f9039c23.entry.js +1 -0
  604. package/dist/stzh-components/{p-ba94e315.system.entry.js → p-fa9a4cd5.system.entry.js} +1 -1
  605. package/dist/stzh-components/p-fade35c7.entry.js +1 -0
  606. package/dist/stzh-components/{p-e7a84e53.system.entry.js → p-fd811f6b.system.entry.js} +2 -2
  607. package/dist/stzh-components/stzh-components.css +1 -1
  608. package/dist/stzh-components/stzh-components.esm.js +1 -1
  609. package/dist/stzh-components/stzh-components.js +1 -1
  610. package/dist/types/components/stzh-anchornav/stzh-anchornav.d.ts +32 -0
  611. package/dist/types/components/stzh-audio/stzh-audio.localization.d.ts +11 -0
  612. package/dist/types/components/stzh-badge/stzh-badge.d.ts +2 -0
  613. package/dist/types/components/stzh-clamp/stzh-clamp.d.ts +16 -0
  614. package/dist/types/components/stzh-olmap/stzh-olmap.localization.d.ts +10 -0
  615. package/dist/types/components/stzh-portal-mitwirken/stzh-portal-mitwirken.d.ts +1 -2
  616. package/dist/types/components.d.ts +644 -43
  617. package/dist/types/index.d.ts +72 -1
  618. package/dist/types/stencil-public-runtime.d.ts +20 -4
  619. package/dist/vscode-data.json +383 -25
  620. package/package.json +7 -2
  621. package/dist/cjs/stzh-datepicker_4.cjs.entry.js +0 -483
  622. package/dist/esm/stzh-datepicker_4.entry.js +0 -476
  623. package/dist/esm-es5/app-globals-6b6ff890.js +0 -1
  624. package/dist/esm-es5/index-84f71a43.js +0 -2
  625. package/dist/esm-es5/stzh-datepicker_4.entry.js +0 -1
  626. package/dist/stzh-components/p-001b7d10.entry.js +0 -1
  627. package/dist/stzh-components/p-08a564af.entry.js +0 -1
  628. package/dist/stzh-components/p-0b8de542.system.entry.js +0 -1
  629. package/dist/stzh-components/p-0bbbbe85.system.entry.js +0 -1
  630. package/dist/stzh-components/p-0d5522dc.system.entry.js +0 -1
  631. package/dist/stzh-components/p-0efe125f.system.entry.js +0 -1
  632. package/dist/stzh-components/p-13b3500e.entry.js +0 -1
  633. package/dist/stzh-components/p-13f44000.entry.js +0 -1
  634. package/dist/stzh-components/p-216577b4.entry.js +0 -1
  635. package/dist/stzh-components/p-2818488f.entry.js +0 -1
  636. package/dist/stzh-components/p-2cf1ae40.system.entry.js +0 -1
  637. package/dist/stzh-components/p-332e4fd3.entry.js +0 -1
  638. package/dist/stzh-components/p-373f79e8.entry.js +0 -1
  639. package/dist/stzh-components/p-3ac93a01.entry.js +0 -1
  640. package/dist/stzh-components/p-45bab70d.system.entry.js +0 -1
  641. package/dist/stzh-components/p-552f49c4.entry.js +0 -1
  642. package/dist/stzh-components/p-5975c355.system.entry.js +0 -1
  643. package/dist/stzh-components/p-59c323ce.entry.js +0 -1
  644. package/dist/stzh-components/p-6354fee3.entry.js +0 -1
  645. package/dist/stzh-components/p-638bedfa.entry.js +0 -1
  646. package/dist/stzh-components/p-63d8db7b.entry.js +0 -1
  647. package/dist/stzh-components/p-653c6bbc.entry.js +0 -1
  648. package/dist/stzh-components/p-67f906b1.entry.js +0 -1
  649. package/dist/stzh-components/p-69f4a27e.entry.js +0 -1
  650. package/dist/stzh-components/p-6a81e64b.entry.js +0 -1
  651. package/dist/stzh-components/p-75cdc8a6.system.entry.js +0 -1
  652. package/dist/stzh-components/p-7ad87d98.system.entry.js +0 -1
  653. package/dist/stzh-components/p-7d8c9866.entry.js +0 -1
  654. package/dist/stzh-components/p-7f9f9a8d.entry.js +0 -1
  655. package/dist/stzh-components/p-83b1e379.entry.js +0 -9
  656. package/dist/stzh-components/p-86bc421e.system.entry.js +0 -1
  657. package/dist/stzh-components/p-8aebb240.entry.js +0 -1
  658. package/dist/stzh-components/p-8cbc987f.system.entry.js +0 -1
  659. package/dist/stzh-components/p-938ef748.entry.js +0 -1
  660. package/dist/stzh-components/p-93e8e31f.js +0 -2
  661. package/dist/stzh-components/p-9bda100f.system.js +0 -1
  662. package/dist/stzh-components/p-a448f5a5.entry.js +0 -1
  663. package/dist/stzh-components/p-a646c09a.entry.js +0 -1
  664. package/dist/stzh-components/p-a6627504.entry.js +0 -1
  665. package/dist/stzh-components/p-a99d3e97.system.entry.js +0 -1
  666. package/dist/stzh-components/p-af2664fc.system.entry.js +0 -1
  667. package/dist/stzh-components/p-b9c3f3cc.entry.js +0 -1
  668. package/dist/stzh-components/p-bd178c32.system.entry.js +0 -1
  669. package/dist/stzh-components/p-be461e19.system.entry.js +0 -1
  670. package/dist/stzh-components/p-bf0fdd23.system.js +0 -2
  671. package/dist/stzh-components/p-c013a00b.system.entry.js +0 -1
  672. package/dist/stzh-components/p-c1337453.entry.js +0 -1
  673. package/dist/stzh-components/p-c456c04b.system.entry.js +0 -1
  674. package/dist/stzh-components/p-c499e04d.entry.js +0 -1
  675. package/dist/stzh-components/p-c692e405.entry.js +0 -1
  676. package/dist/stzh-components/p-c83e4fec.system.entry.js +0 -1
  677. package/dist/stzh-components/p-ca062c11.system.js +0 -1
  678. package/dist/stzh-components/p-ce28428b.entry.js +0 -1
  679. package/dist/stzh-components/p-cfaac121.js +0 -1
  680. package/dist/stzh-components/p-d11a70e2.system.entry.js +0 -1
  681. package/dist/stzh-components/p-d1dba399.system.entry.js +0 -1
  682. package/dist/stzh-components/p-d2b5e066.entry.js +0 -1
  683. package/dist/stzh-components/p-d54f04c8.system.entry.js +0 -1
  684. package/dist/stzh-components/p-d645d645.entry.js +0 -1
  685. package/dist/stzh-components/p-d7893dfd.entry.js +0 -1
  686. package/dist/stzh-components/p-d9643cc4.entry.js +0 -1
  687. package/dist/stzh-components/p-da7b363e.entry.js +0 -1
  688. package/dist/stzh-components/p-de017b87.system.entry.js +0 -1
  689. package/dist/stzh-components/p-e009bfdc.entry.js +0 -1
  690. package/dist/stzh-components/p-f167eaa4.system.entry.js +0 -1
  691. package/dist/stzh-components/p-f2ee016a.entry.js +0 -1
  692. package/dist/stzh-components/p-fdd1998f.entry.js +0 -1
  693. package/dist/stzh-components/p-ffa1e9dd.system.entry.js +0 -1
@@ -0,0 +1,4195 @@
1
+ import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h as h$2, Host } from '@stencil/core/internal/client';
2
+ import { h as hasSlot } from './utils.js';
3
+ import { f as fetchTranslations } from './translation-utils.js';
4
+ import { d as defineCustomElement$5 } from './stzh-icon2.js';
5
+ import { d as defineCustomElement$4 } from './stzh-loader2.js';
6
+ import { d as defineCustomElement$3 } from './stzh-text2.js';
7
+ import { d as defineCustomElement$2 } from './stzh-tooltip2.js';
8
+
9
+ /**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */
14
+ var t$2;const i$2=window,s$3=i$2.trustedTypes,e$3=s$3?s$3.createPolicy("lit-html",{createHTML:t=>t}):void 0,o$3=`lit$${(Math.random()+"").slice(9)}$`,n$3="?"+o$3,l$2=`<${n$3}>`,h$1=document,r$2=(t="")=>h$1.createComment(t),d$1=t=>null===t||"object"!=typeof t&&"function"!=typeof t,u=Array.isArray,c$1=t=>u(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),v=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,a$1=/-->/g,f=/>/g,_=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),m=/'/g,p=/"/g,$=/^(?:script|style|textarea|title)$/i,g=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),y=g(1),x=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),T=new WeakMap,A=h$1.createTreeWalker(h$1,129,null,!1),E=(t,i)=>{const s=t.length-1,n=[];let h,r=2===i?"<svg>":"",d=v;for(let i=0;i<s;i++){const s=t[i];let e,u,c=-1,g=0;for(;g<s.length&&(d.lastIndex=g,u=d.exec(s),null!==u);)g=d.lastIndex,d===v?"!--"===u[1]?d=a$1:void 0!==u[1]?d=f:void 0!==u[2]?($.test(u[2])&&(h=RegExp("</"+u[2],"g")),d=_):void 0!==u[3]&&(d=_):d===_?">"===u[0]?(d=null!=h?h:v,c=-1):void 0===u[1]?c=-2:(c=d.lastIndex-u[2].length,e=u[1],d=void 0===u[3]?_:'"'===u[3]?p:m):d===p||d===m?d=_:d===a$1||d===f?d=v:(d=_,h=void 0);const y=d===_&&t[i+1].startsWith("/>")?" ":"";r+=d===v?s+l$2:c>=0?(n.push(e),s.slice(0,c)+"$lit$"+s.slice(c)+o$3+y):s+o$3+(-2===c?(n.push(void 0),i):y);}const u=r+(t[s]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return [void 0!==e$3?e$3.createHTML(u):u,n]};class C{constructor({strings:t,_$litType$:i},e){let l;this.parts=[];let h=0,d=0;const u=t.length-1,c=this.parts,[v,a]=E(t,i);if(this.el=C.createElement(v,e),A.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes);}for(;null!==(l=A.nextNode())&&c.length<u;){if(1===l.nodeType){if(l.hasAttributes()){const t=[];for(const i of l.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(o$3)){const s=a[d++];if(t.push(i),void 0!==s){const t=l.getAttribute(s.toLowerCase()+"$lit$").split(o$3),i=/([.?@])?(.*)/.exec(s);c.push({type:1,index:h,name:i[2],strings:t,ctor:"."===i[1]?M:"?"===i[1]?k:"@"===i[1]?H:S$1});}else c.push({type:6,index:h});}for(const i of t)l.removeAttribute(i);}if($.test(l.tagName)){const t=l.textContent.split(o$3),i=t.length-1;if(i>0){l.textContent=s$3?s$3.emptyScript:"";for(let s=0;s<i;s++)l.append(t[s],r$2()),A.nextNode(),c.push({type:2,index:++h});l.append(t[i],r$2());}}}else if(8===l.nodeType)if(l.data===n$3)c.push({type:2,index:h});else {let t=-1;for(;-1!==(t=l.data.indexOf(o$3,t+1));)c.push({type:7,index:h}),t+=o$3.length-1;}h++;}}static createElement(t,i){const s=h$1.createElement("template");return s.innerHTML=t,s}}function P(t,i,s=t,e){var o,n,l,h;if(i===x)return i;let r=void 0!==e?null===(o=s._$Co)||void 0===o?void 0:o[e]:s._$Cl;const u=d$1(i)?void 0:i._$litDirective$;return (null==r?void 0:r.constructor)!==u&&(null===(n=null==r?void 0:r._$AO)||void 0===n||n.call(r,!1),void 0===u?r=void 0:(r=new u(t),r._$AT(t,s,e)),void 0!==e?(null!==(l=(h=s)._$Co)&&void 0!==l?l:h._$Co=[])[e]=r:s._$Cl=r),void 0!==r&&(i=P(t,r._$AS(t,i.values),r,e)),i}class V{constructor(t,i){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var i;const{el:{content:s},parts:e}=this._$AD,o=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:h$1).importNode(s,!0);A.currentNode=o;let n=A.nextNode(),l=0,r=0,d=e[0];for(;void 0!==d;){if(l===d.index){let i;2===d.type?i=new N(n,n.nextSibling,this,t):1===d.type?i=new d.ctor(n,d.name,d.strings,this,t):6===d.type&&(i=new I(n,this,t)),this.u.push(i),d=e[++r];}l!==(null==d?void 0:d.index)&&(n=A.nextNode(),l++);}return o}p(t){let i=0;for(const s of this.u)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}}class N{constructor(t,i,s,e){var o;this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cm=null===(o=null==e?void 0:e.isConnected)||void 0===o||o;}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=P(this,t,i),d$1(t)?t===b||null==t||""===t?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==x&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):c$1(t)?this.k(t):this.g(t);}O(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}g(t){this._$AH!==b&&d$1(this._$AH)?this._$AA.nextSibling.data=t:this.T(h$1.createTextNode(t)),this._$AH=t;}$(t){var i;const{values:s,_$litType$:e}=t,o="number"==typeof e?this._$AC(t):(void 0===e.el&&(e.el=C.createElement(e.h,this.options)),e);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===o)this._$AH.p(s);else {const t=new V(o,this),i=t.v(this.options);t.p(s),this.T(i),this._$AH=t;}}_$AC(t){let i=T.get(t.strings);return void 0===i&&T.set(t.strings,i=new C(t)),i}k(t){u(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const o of t)e===i.length?i.push(s=new N(this.O(r$2()),this.O(r$2()),this,this.options)):s=i[e],s._$AI(o),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){var s;for(null===(s=this._$AP)||void 0===s||s.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){var i;void 0===this._$AM&&(this._$Cm=t,null===(i=this._$AP)||void 0===i||i.call(this,t));}}class S$1{constructor(t,i,s,e,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=b;}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,s,e){const o=this.strings;let n=!1;if(void 0===o)t=P(this,t,i,0),n=!d$1(t)||t!==this._$AH&&t!==x,n&&(this._$AH=t);else {const e=t;let l,h;for(t=o[0],l=0;l<o.length-1;l++)h=P(this,e[s+l],i,l),h===x&&(h=this._$AH[l]),n||(n=!d$1(h)||h!==this._$AH[l]),h===b?t=b:t!==b&&(t+=(null!=h?h:"")+o[l+1]),this._$AH[l]=h;}n&&!e&&this.j(t);}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"");}}class M extends S$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===b?void 0:t;}}const R=s$3?s$3.emptyScript:"";class k extends S$1{constructor(){super(...arguments),this.type=4;}j(t){t&&t!==b?this.element.setAttribute(this.name,R):this.element.removeAttribute(this.name);}}class H extends S$1{constructor(t,i,s,e,o){super(t,i,s,e,o),this.type=5;}_$AI(t,i=this){var s;if((t=null!==(s=P(this,t,i,0))&&void 0!==s?s:b)===x)return;const e=this._$AH,o=t===b&&e!==b||t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive,n=t!==b&&(e===b||o);o&&this.element.removeEventListener(this.name,this,e),n&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){var i,s;"function"==typeof this._$AH?this._$AH.call(null!==(s=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==s?s:this.element,t):this._$AH.handleEvent(t);}}class I{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){P(this,t);}}const z=i$2.litHtmlPolyfillSupport;null==z||z(C,N),(null!==(t$2=i$2.litHtmlVersions)&&void 0!==t$2?t$2:i$2.litHtmlVersions=[]).push("2.5.0");const Z=(t,i,s)=>{var e,o;const n=null!==(e=null==s?void 0:s.renderBefore)&&void 0!==e?e:i;let l=n._$litPart$;if(void 0===l){const t=null!==(o=null==s?void 0:s.renderBefore)&&void 0!==o?o:null;n._$litPart$=l=new N(i.insertBefore(r$2(),t),t,void 0,null!=s?s:{});}return l._$AI(t),l};
15
+
16
+ var functionDebounce = debounce;
17
+
18
+ function debounce(fn, wait, callFirst) {
19
+ var timeout = null;
20
+ var debouncedFn = null;
21
+
22
+ var clear = function() {
23
+ if (timeout) {
24
+ clearTimeout(timeout);
25
+
26
+ debouncedFn = null;
27
+ timeout = null;
28
+ }
29
+ };
30
+
31
+ var flush = function() {
32
+ var call = debouncedFn;
33
+ clear();
34
+
35
+ if (call) {
36
+ call();
37
+ }
38
+ };
39
+
40
+ var debounceWrapper = function() {
41
+ if (!wait) {
42
+ return fn.apply(this, arguments);
43
+ }
44
+
45
+ var context = this;
46
+ var args = arguments;
47
+ var callNow = callFirst && !timeout;
48
+ clear();
49
+
50
+ debouncedFn = function() {
51
+ fn.apply(context, args);
52
+ };
53
+
54
+ timeout = setTimeout(function() {
55
+ timeout = null;
56
+
57
+ if (!callNow) {
58
+ var call = debouncedFn;
59
+ debouncedFn = null;
60
+
61
+ return call();
62
+ }
63
+ }, wait);
64
+
65
+ if (callNow) {
66
+ return debouncedFn();
67
+ }
68
+ };
69
+
70
+ debounceWrapper.cancel = clear;
71
+ debounceWrapper.flush = flush;
72
+
73
+ return debounceWrapper;
74
+ }
75
+
76
+ var functionThrottle = throttle;
77
+
78
+ function throttle(fn, interval, options) {
79
+ var timeoutId = null;
80
+ var throttledFn = null;
81
+ var leading = (options && options.leading);
82
+ var trailing = (options && options.trailing);
83
+
84
+ if (leading == null) {
85
+ leading = true; // default
86
+ }
87
+
88
+ if (trailing == null) {
89
+ trailing = !leading; //default
90
+ }
91
+
92
+ if (leading == true) {
93
+ trailing = false; // forced because there should be invocation per call
94
+ }
95
+
96
+ var cancel = function() {
97
+ if (timeoutId) {
98
+ clearTimeout(timeoutId);
99
+ timeoutId = null;
100
+ }
101
+ };
102
+
103
+ var flush = function() {
104
+ var call = throttledFn;
105
+ cancel();
106
+
107
+ if (call) {
108
+ call();
109
+ }
110
+ };
111
+
112
+ var throttleWrapper = function() {
113
+ var callNow = leading && !timeoutId;
114
+ var context = this;
115
+ var args = arguments;
116
+
117
+ throttledFn = function() {
118
+ return fn.apply(context, args);
119
+ };
120
+
121
+ if (!timeoutId) {
122
+ timeoutId = setTimeout(function() {
123
+ timeoutId = null;
124
+
125
+ if (trailing) {
126
+ return throttledFn();
127
+ }
128
+ }, interval);
129
+ }
130
+
131
+ if (callNow) {
132
+ callNow = false;
133
+ return throttledFn();
134
+ }
135
+ };
136
+
137
+ throttleWrapper.cancel = cancel;
138
+ throttleWrapper.flush = flush;
139
+
140
+ return throttleWrapper;
141
+ }
142
+
143
+ // src/utils/events.ts
144
+ function listen(target, type, listener, options) {
145
+ target.addEventListener(type, listener, options);
146
+ return () => {
147
+ target.removeEventListener(type, listener, options);
148
+ };
149
+ }
150
+ var DisposalBin = class {
151
+ constructor() {
152
+ this._disposal = this._disposal ?? [];
153
+ }
154
+ add(...callbacks) {
155
+ if (callbacks) {
156
+ callbacks.forEach((cb) => {
157
+ this._disposal.push(cb);
158
+ });
159
+ }
160
+ }
161
+ empty() {
162
+ this._disposal.forEach((fn) => fn());
163
+ this._disposal = [];
164
+ }
165
+ };
166
+
167
+ // src/events/event-listener.ts
168
+ function eventListener(host, type, listener, options) {
169
+ let off;
170
+ function attach() {
171
+ if (!off) {
172
+ off = listen(options?.target ?? host, type, listener, options);
173
+ }
174
+ }
175
+ attach();
176
+ host.addController({
177
+ hostConnected() {
178
+ attach();
179
+ },
180
+ hostDisconnected() {
181
+ off?.();
182
+ off = void 0;
183
+ }
184
+ });
185
+ }
186
+
187
+ // src/events/VdsEvent.ts
188
+ var VdsEvent = class extends CustomEvent {
189
+ constructor(type, eventInit = {}) {
190
+ super(type, eventInit);
191
+ this.triggerEvent = eventInit.triggerEvent;
192
+ if (!this.hasOwnProperty("originEvent")) {
193
+ Object.defineProperties(this, {
194
+ originEvent: {
195
+ get() {
196
+ return getOriginEvent(this) ?? this;
197
+ }
198
+ },
199
+ isOriginTrusted: {
200
+ get() {
201
+ return getOriginEvent(this)?.isTrusted ?? false;
202
+ }
203
+ }
204
+ });
205
+ }
206
+ }
207
+ get originEvent() {
208
+ return getOriginEvent(this) ?? this;
209
+ }
210
+ get isOriginTrusted() {
211
+ return this.originEvent?.isTrusted ?? false;
212
+ }
213
+ };
214
+ function vdsEvent(type, eventInit = {}) {
215
+ return new VdsEvent(type, eventInit);
216
+ }
217
+ function getOriginEvent(event) {
218
+ let triggerEvent = event.triggerEvent;
219
+ while (triggerEvent && triggerEvent.triggerEvent) {
220
+ triggerEvent = triggerEvent.triggerEvent;
221
+ }
222
+ return triggerEvent;
223
+ }
224
+ function appendTriggerEvent(event, triggerEvent) {
225
+ (getOriginEvent(event) ?? event).triggerEvent = triggerEvent;
226
+ }
227
+
228
+ // src/context/ContextConsumerController.ts
229
+ var orphanConsumers = /* @__PURE__ */ new Map();
230
+ var ContextConsumerController = class {
231
+ constructor(_host, initialValue, _options) {
232
+ this._host = _host;
233
+ this.initialValue = initialValue;
234
+ this._options = _options;
235
+ this._registrationCallbacks = [];
236
+ _host.addController({
237
+ hostConnected: () => {
238
+ this._connect();
239
+ },
240
+ hostDisconnected: () => {
241
+ delete this._host[this.id];
242
+ }
243
+ });
244
+ }
245
+ get id() {
246
+ return this._options.id;
247
+ }
248
+ get value() {
249
+ return this._host[this.id] ?? this.initialValue;
250
+ }
251
+ get registered() {
252
+ return this.id in this._host;
253
+ }
254
+ _connect() {
255
+ if (this.id in this._host)
256
+ return;
257
+ const setValue = (value) => {
258
+ this._host[this.id] = value;
259
+ this._registrationCallbacks?.forEach((fn) => fn(value));
260
+ this._registrationCallbacks = void 0;
261
+ };
262
+ this._host.dispatchEvent(
263
+ vdsEvent("vds-context-consumer-connect", {
264
+ bubbles: true,
265
+ composed: true,
266
+ detail: {
267
+ id: this.id,
268
+ setValue
269
+ }
270
+ })
271
+ );
272
+ if (!this.registered) {
273
+ const orphans = orphanConsumers.get(this.id) ?? [];
274
+ orphans.push({ host: this._host, setValue });
275
+ orphanConsumers.set(this.id, orphans);
276
+ }
277
+ }
278
+ whenRegistered(callback) {
279
+ if (this.registered) {
280
+ callback(this.value);
281
+ return;
282
+ }
283
+ this._registrationCallbacks?.push(callback);
284
+ }
285
+ };
286
+ function adoptOrphans(id, provider) {
287
+ const orphans = orphanConsumers.get(id) ?? [];
288
+ const adoptees = orphans.filter(({ host }) => provider.contains(host));
289
+ orphanConsumers.set(
290
+ id,
291
+ orphans.filter(({ host }) => !provider.contains(host))
292
+ );
293
+ return adoptees;
294
+ }
295
+
296
+ // src/context/ContextProviderController.ts
297
+ var ContextProviderController = class {
298
+ constructor(_host, _initValue, _options) {
299
+ this._host = _host;
300
+ this._initValue = _initValue;
301
+ this._options = _options;
302
+ this._stopDisposal = new DisposalBin();
303
+ this._value = _initValue();
304
+ _host.addController({
305
+ hostConnected: this.start.bind(this),
306
+ hostDisconnected: this.stop.bind(this)
307
+ });
308
+ }
309
+ get id() {
310
+ return this._options.id;
311
+ }
312
+ get value() {
313
+ return this._value;
314
+ }
315
+ start() {
316
+ const dispose = listen(
317
+ this._host,
318
+ "vds-context-consumer-connect",
319
+ this._handleConsumerConnect.bind(this)
320
+ );
321
+ for (const orphan of adoptOrphans(this.id, this._host)) {
322
+ orphan.setValue(this._value);
323
+ }
324
+ this._stopDisposal.add(dispose);
325
+ }
326
+ stop() {
327
+ this._stopDisposal.empty();
328
+ }
329
+ _handleConsumerConnect(event) {
330
+ const consumer = event.detail;
331
+ if (consumer.id !== this.id)
332
+ return;
333
+ event.stopImmediatePropagation();
334
+ consumer.setValue(this._value);
335
+ }
336
+ };
337
+
338
+ // src/context/context.ts
339
+ function createContext(initValue) {
340
+ const id = Symbol("@vidstack/context");
341
+ return {
342
+ id,
343
+ consume(host) {
344
+ return new ContextConsumerController(host, initValue(), { id });
345
+ },
346
+ provide(host) {
347
+ return new ContextProviderController(host, initValue, { id });
348
+ }
349
+ };
350
+ }
351
+ function isContext(context) {
352
+ return typeof context?.id === "symbol" && context.id.description === "@vidstack/context";
353
+ }
354
+
355
+ // src/utils/unit.ts
356
+ function noop(...args) {
357
+ }
358
+ function safeNotEqual(a, b) {
359
+ return a != a ? b == b : a !== b || a && typeof a === "object" || typeof a === "function";
360
+ }
361
+ function isNull(value) {
362
+ return value === null;
363
+ }
364
+ function isUndefined(value) {
365
+ return typeof value === "undefined";
366
+ }
367
+ function isNil(value) {
368
+ return isNull(value) || isUndefined(value);
369
+ }
370
+ function isNumber(value) {
371
+ return typeof value === "number" && !Number.isNaN(value);
372
+ }
373
+ function isString(value) {
374
+ return typeof value === "string";
375
+ }
376
+ function isFunction(value) {
377
+ return typeof value === "function";
378
+ }
379
+ function isArray(value) {
380
+ return Array.isArray(value);
381
+ }
382
+
383
+ // src/elements/discovery/discover.ts
384
+ var discoverers = /* @__PURE__ */ new Map();
385
+ var discoverables = /* @__PURE__ */ new Map();
386
+ function connect(discoverable2, id, onDisconnect) {
387
+ for (const { host, callback } of Array.from(discoverers.get(id) ?? [])) {
388
+ if (host !== discoverable2 && host.contains(discoverable2)) {
389
+ callback(discoverable2, onDisconnect);
390
+ }
391
+ }
392
+ }
393
+ function find(host, id) {
394
+ return Array.from(discoverables.get(id) ?? []).filter(
395
+ ({ element }) => host !== element && host.contains(element)
396
+ );
397
+ }
398
+ function discover(host, id, callback) {
399
+ const discoverer = { host, callback };
400
+ host.addController({
401
+ hostConnected: () => {
402
+ for (const { element, onDisconnect } of find(host, id)) {
403
+ callback(element, onDisconnect);
404
+ }
405
+ discoverers.set(id, (discoverers.get(id) ?? /* @__PURE__ */ new Set()).add(discoverer));
406
+ },
407
+ hostDisconnected: () => {
408
+ discoverers.get(id)?.delete(discoverer);
409
+ }
410
+ });
411
+ }
412
+ function discoverable(host, eventType, options = {}) {
413
+ const id = options.register;
414
+ const disconnectDisposal = new DisposalBin();
415
+ const onDisconnect = (callback) => {
416
+ disconnectDisposal.add(callback);
417
+ };
418
+ const discoverable2 = {
419
+ element: host,
420
+ onDisconnect
421
+ };
422
+ host.addController({
423
+ hostConnected() {
424
+ const event = vdsEvent(eventType, {
425
+ bubbles: true,
426
+ composed: true,
427
+ detail: discoverable2
428
+ });
429
+ host.dispatchEvent(event);
430
+ if (id) {
431
+ discoverables.set(id, (discoverables.get(id) ?? /* @__PURE__ */ new Set()).add(discoverable2));
432
+ connect(host, id, onDisconnect);
433
+ }
434
+ },
435
+ hostDisconnected() {
436
+ disconnectDisposal.empty();
437
+ if (id) {
438
+ discoverables.get(id)?.delete(discoverable2);
439
+ }
440
+ }
441
+ });
442
+ }
443
+
444
+ // src/utils/support.ts
445
+ var IS_CLIENT = typeof window !== "undefined";
446
+ var UA = IS_CLIENT ? window.navigator?.userAgent.toLowerCase() : "";
447
+ var IS_IOS = /iphone|ipad|ipod|ios|CriOS|FxiOS/.test(UA);
448
+ /android/.test(UA);
449
+ IS_CLIENT && /(iPhone|iPod)/gi.test(window.navigator?.platform);
450
+ /firefox/.test(UA);
451
+ var IS_CHROME = IS_CLIENT && !!window.chrome;
452
+ IS_CLIENT && !IS_CHROME && (window.safari || IS_IOS || /(apple|safari)/.test(UA));
453
+ function canOrientScreen() {
454
+ return IS_CLIENT && !isUndefined(screen.orientation) && isFunction(screen.orientation.lock) && isFunction(screen.orientation.unlock);
455
+ }
456
+
457
+ // ../../node_modules/.pnpm/fscreen@1.2.0/node_modules/fscreen/dist/fscreen.esm.js
458
+ var key = {
459
+ fullscreenEnabled: 0,
460
+ fullscreenElement: 1,
461
+ requestFullscreen: 2,
462
+ exitFullscreen: 3,
463
+ fullscreenchange: 4,
464
+ fullscreenerror: 5,
465
+ fullscreen: 6
466
+ };
467
+ var webkit = [
468
+ "webkitFullscreenEnabled",
469
+ "webkitFullscreenElement",
470
+ "webkitRequestFullscreen",
471
+ "webkitExitFullscreen",
472
+ "webkitfullscreenchange",
473
+ "webkitfullscreenerror",
474
+ "-webkit-full-screen"
475
+ ];
476
+ var moz = [
477
+ "mozFullScreenEnabled",
478
+ "mozFullScreenElement",
479
+ "mozRequestFullScreen",
480
+ "mozCancelFullScreen",
481
+ "mozfullscreenchange",
482
+ "mozfullscreenerror",
483
+ "-moz-full-screen"
484
+ ];
485
+ var ms = [
486
+ "msFullscreenEnabled",
487
+ "msFullscreenElement",
488
+ "msRequestFullscreen",
489
+ "msExitFullscreen",
490
+ "MSFullscreenChange",
491
+ "MSFullscreenError",
492
+ "-ms-fullscreen"
493
+ ];
494
+ var document2 = typeof window !== "undefined" && typeof window.document !== "undefined" ? window.document : {};
495
+ var vendor = "fullscreenEnabled" in document2 && Object.keys(key) || webkit[0] in document2 && webkit || moz[0] in document2 && moz || ms[0] in document2 && ms || [];
496
+ var fscreen = {
497
+ requestFullscreen: function(element) {
498
+ return element[vendor[key.requestFullscreen]]();
499
+ },
500
+ requestFullscreenFunction: function(element) {
501
+ return element[vendor[key.requestFullscreen]];
502
+ },
503
+ get exitFullscreen() {
504
+ return document2[vendor[key.exitFullscreen]].bind(document2);
505
+ },
506
+ get fullscreenPseudoClass() {
507
+ return ":" + vendor[key.fullscreen];
508
+ },
509
+ addEventListener: function(type, handler, options) {
510
+ return document2.addEventListener(vendor[key[type]], handler, options);
511
+ },
512
+ removeEventListener: function(type, handler, options) {
513
+ return document2.removeEventListener(vendor[key[type]], handler, options);
514
+ },
515
+ get fullscreenEnabled() {
516
+ return Boolean(document2[vendor[key.fullscreenEnabled]]);
517
+ },
518
+ set fullscreenEnabled(val) {
519
+ },
520
+ get fullscreenElement() {
521
+ return document2[vendor[key.fullscreenElement]];
522
+ },
523
+ set fullscreenElement(val) {
524
+ },
525
+ get onfullscreenchange() {
526
+ return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()];
527
+ },
528
+ set onfullscreenchange(handler) {
529
+ return document2[("on" + vendor[key.fullscreenchange]).toLowerCase()] = handler;
530
+ },
531
+ get onfullscreenerror() {
532
+ return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()];
533
+ },
534
+ set onfullscreenerror(handler) {
535
+ return document2[("on" + vendor[key.fullscreenerror]).toLowerCase()] = handler;
536
+ }
537
+ };
538
+ var fscreen_esm_default = fscreen;
539
+
540
+ // src/logger/colors.ts
541
+ var LOCAL_STORAGE_KEY = "@vidstack/log-colors";
542
+ getSavedColors();
543
+ function getSavedColors() {
544
+ if (IS_CLIENT && !isUndefined(window.localStorage)) {
545
+ let colors2 = {};
546
+ try {
547
+ colors2 = JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY) ?? "");
548
+ } catch {
549
+ }
550
+ return new Map(Object.entries(colors2));
551
+ }
552
+ return /* @__PURE__ */ new Map();
553
+ }
554
+
555
+ // src/logger/LogLevel.ts
556
+ Object.freeze({
557
+ silent: 0,
558
+ error: 1,
559
+ warn: 2,
560
+ info: 3,
561
+ debug: 4
562
+ });
563
+ Object.freeze({
564
+ silent: "white",
565
+ error: "hsl(6, 58%, 50%)",
566
+ warn: "hsl(51, 58%, 50%)",
567
+ info: "hsl(219, 58%, 50%)",
568
+ debug: "hsl(280, 58%, 50%)"
569
+ });
570
+
571
+ // src/utils/number.ts
572
+ function round(num, decimalPlaces = 2) {
573
+ return Number(num.toFixed(decimalPlaces));
574
+ }
575
+ function clampNumber(min, value, max) {
576
+ return Math.max(min, Math.min(max, value));
577
+ }
578
+ function getNumberOfDecimalPlaces(num) {
579
+ return String(num).split(".")[1]?.length ?? 0;
580
+ }
581
+
582
+ // src/fullscreen/FullscreenController.ts
583
+ var FullscreenController = class {
584
+ constructor(_host, _screenOrientationController) {
585
+ this._host = _host;
586
+ this._screenOrientationController = _screenOrientationController;
587
+ this._logger = void 0;
588
+ this._listenerDisposal = new DisposalBin();
589
+ _host.addController({
590
+ hostDisconnected: this._handleHostDisconnected.bind(this)
591
+ });
592
+ }
593
+ async _handleHostDisconnected() {
594
+ if (this.isFullscreen)
595
+ await this.exitFullscreen();
596
+ this._listenerDisposal.empty();
597
+ }
598
+ get isSupported() {
599
+ return this.isSupportedNatively;
600
+ }
601
+ get isSupportedNatively() {
602
+ return fscreen_esm_default.fullscreenEnabled;
603
+ }
604
+ get isFullscreen() {
605
+ return this.isNativeFullscreen;
606
+ }
607
+ get isNativeFullscreen() {
608
+ if (fscreen_esm_default.fullscreenElement === this._host)
609
+ return true;
610
+ try {
611
+ return this._host.matches(
612
+ fscreen_esm_default.fullscreenPseudoClass
613
+ );
614
+ } catch (error) {
615
+ return false;
616
+ }
617
+ }
618
+ _addFullscreenChangeEventListener(listener) {
619
+ if (!this.isSupported)
620
+ return noop;
621
+ const dispose = listen(fscreen_esm_default, "fullscreenchange", listener);
622
+ return () => {
623
+ dispose();
624
+ };
625
+ }
626
+ _addFullscreenErrorEventListener(listener) {
627
+ if (!this.isSupported)
628
+ return noop;
629
+ const dispose = listen(fscreen_esm_default, "fullscreenerror", listener);
630
+ return () => {
631
+ dispose();
632
+ };
633
+ }
634
+ async enterFullscreen() {
635
+ if (this.isFullscreen)
636
+ return;
637
+ this._throwIfNoFullscreenSupport();
638
+ this._listenerDisposal.add(
639
+ this._addFullscreenChangeEventListener(this._handleFullscreenChange.bind(this))
640
+ );
641
+ this._listenerDisposal.add(
642
+ this._addFullscreenErrorEventListener(this._handleFullscreenError.bind(this))
643
+ );
644
+ const response = await this._makeEnterFullscreenRequest();
645
+ await this._lockScreenOrientation();
646
+ return response;
647
+ }
648
+ async _makeEnterFullscreenRequest() {
649
+ return fscreen_esm_default.requestFullscreen(this._host);
650
+ }
651
+ _handleFullscreenChange(event) {
652
+ if (!this.isFullscreen)
653
+ this._listenerDisposal.empty();
654
+ this._host.dispatchEvent(
655
+ vdsEvent("vds-fullscreen-change", {
656
+ bubbles: true,
657
+ composed: true,
658
+ detail: this.isFullscreen,
659
+ triggerEvent: event
660
+ })
661
+ );
662
+ }
663
+ _handleFullscreenError(event) {
664
+ this._host.dispatchEvent(
665
+ vdsEvent("vds-fullscreen-error", {
666
+ bubbles: true,
667
+ composed: true,
668
+ triggerEvent: event
669
+ })
670
+ );
671
+ }
672
+ async exitFullscreen() {
673
+ if (!this.isFullscreen)
674
+ return;
675
+ this._throwIfNoFullscreenSupport();
676
+ const response = await this._makeExitFullscreenRequest();
677
+ await this._unlockScreenOrientation();
678
+ return response;
679
+ }
680
+ async _makeExitFullscreenRequest() {
681
+ return fscreen_esm_default.exitFullscreen();
682
+ }
683
+ _shouldOrientScreen() {
684
+ return this._screenOrientationController.canOrient && !isUndefined(this.screenOrientationLock);
685
+ }
686
+ async _lockScreenOrientation() {
687
+ if (isUndefined(this.screenOrientationLock) || !this._shouldOrientScreen()) {
688
+ return;
689
+ }
690
+ await this._screenOrientationController.lock(this.screenOrientationLock);
691
+ }
692
+ async _unlockScreenOrientation() {
693
+ if (!this._shouldOrientScreen())
694
+ return;
695
+ await this._screenOrientationController.unlock();
696
+ }
697
+ _throwIfNoFullscreenSupport() {
698
+ if (this.isSupported)
699
+ return;
700
+ throw Error("Fullscreen API is not enabled or supported in this environment.");
701
+ }
702
+ };
703
+
704
+ // src/observers/FocusVisibleController.ts
705
+ var FocusVisibleController = class {
706
+ constructor(_host) {
707
+ this._host = _host;
708
+ const disposal = new DisposalBin();
709
+ let hadKeyboardEvent = false;
710
+ disposal.add(
711
+ listen(document, "pointerdown", () => {
712
+ hadKeyboardEvent = false;
713
+ })
714
+ );
715
+ eventListener(_host, "keydown", (e) => {
716
+ if (e.metaKey || e.altKey || e.ctrlKey) {
717
+ return;
718
+ }
719
+ hadKeyboardEvent = true;
720
+ });
721
+ eventListener(_host, "focus", (e) => {
722
+ if (hadKeyboardEvent) {
723
+ _host.classList.add("focus-visible");
724
+ }
725
+ });
726
+ eventListener(_host, "blur", (e) => {
727
+ _host.classList.remove("focus-visible");
728
+ });
729
+ _host.addController({
730
+ hostDisconnected: () => {
731
+ disposal.empty();
732
+ }
733
+ });
734
+ }
735
+ };
736
+ function focusVisiblePolyfill(host) {
737
+ return new FocusVisibleController(host);
738
+ }
739
+
740
+ // src/observers/IntersectionController.ts
741
+ var IntersectionController = class {
742
+ constructor(_host, config = {}, _callback = () => true, _logger = void 0) {
743
+ this._host = _host;
744
+ this._callback = _callback;
745
+ this._logger = _logger;
746
+ this._skipInitial = false;
747
+ this._unobservedUpdate = false;
748
+ const { target, skipInitial, ...intersectionObserverInit } = config;
749
+ this._target = target ?? void 0;
750
+ this._skipInitial = skipInitial ?? this._skipInitial;
751
+ if (!window.IntersectionObserver) {
752
+ return;
753
+ }
754
+ this._observer = new IntersectionObserver((entries) => {
755
+ const unobservedUpdate = this._unobservedUpdate;
756
+ this._unobservedUpdate = false;
757
+ if (this._skipInitial && unobservedUpdate)
758
+ return;
759
+ this.handleChanges(entries);
760
+ this._host.requestUpdate();
761
+ }, intersectionObserverInit);
762
+ _host.addController(this);
763
+ }
764
+ handleChanges(entries) {
765
+ this.value = this._callback(entries, this._observer);
766
+ }
767
+ hostConnected() {
768
+ if (this._target) {
769
+ this.observe(this._target);
770
+ }
771
+ }
772
+ hostDisconnected() {
773
+ this._disconnect();
774
+ }
775
+ async hostUpdated() {
776
+ const pendingRecords = this._observer.takeRecords();
777
+ if (pendingRecords.length) {
778
+ this.handleChanges(pendingRecords);
779
+ }
780
+ }
781
+ observe(target) {
782
+ this._observer.observe(target);
783
+ this._unobservedUpdate = true;
784
+ return () => {
785
+ this._observer.unobserve(target);
786
+ };
787
+ }
788
+ _disconnect() {
789
+ this._observer.disconnect();
790
+ }
791
+ };
792
+ function createIntersectionController(...params) {
793
+ return new IntersectionController(...params);
794
+ }
795
+
796
+ // src/utils/promise.ts
797
+ function deferredPromise() {
798
+ let resolve = noop;
799
+ let reject = noop;
800
+ const promise = new Promise((res, rej) => {
801
+ resolve = res;
802
+ reject = rej;
803
+ });
804
+ return { promise, resolve, reject };
805
+ }
806
+
807
+ // src/queue/RequestQueue.ts
808
+ var RequestQueue = class {
809
+ constructor() {
810
+ this._requestQueue = /* @__PURE__ */ new Map();
811
+ this._requestKeys = [];
812
+ this._pendingFlush = deferredPromise();
813
+ this._isServing = false;
814
+ }
815
+ get isServing() {
816
+ return this._isServing;
817
+ }
818
+ get size() {
819
+ return this._requestQueue.size;
820
+ }
821
+ async waitForFlush() {
822
+ if (this._isServing)
823
+ return;
824
+ await this._pendingFlush.promise;
825
+ }
826
+ queue(key2, callback) {
827
+ if (this._isServing) {
828
+ callback();
829
+ return;
830
+ }
831
+ this._requestKeys = [...this._requestKeys.filter((k) => k !== key2), key2];
832
+ this._requestQueue.set(key2, callback);
833
+ }
834
+ serve(key2) {
835
+ this._requestQueue.get(key2)?.();
836
+ this._requestQueue.delete(key2);
837
+ }
838
+ start() {
839
+ this._flush();
840
+ this._isServing = true;
841
+ if (this._requestQueue.size > 0) {
842
+ this._flush();
843
+ }
844
+ }
845
+ _flush() {
846
+ for (const requestKey of this._requestKeys) {
847
+ this.serve(requestKey);
848
+ }
849
+ this._requestKeys = [];
850
+ this._release();
851
+ }
852
+ _empty() {
853
+ this._requestQueue.clear();
854
+ }
855
+ _release() {
856
+ this._pendingFlush.resolve();
857
+ this._pendingFlush = deferredPromise();
858
+ }
859
+ stop() {
860
+ this._isServing = false;
861
+ }
862
+ destroy() {
863
+ this.stop();
864
+ this._empty();
865
+ this._release();
866
+ }
867
+ };
868
+
869
+ // src/queue/host-request-queue.ts
870
+ function hostRequestQueue(host) {
871
+ const q = new RequestQueue();
872
+ host.addController({
873
+ hostConnected: q.start.bind(q),
874
+ hostDisconnected: q.destroy.bind(q)
875
+ });
876
+ return q;
877
+ }
878
+
879
+ // src/screen-orientation/ScreenOrientationController.ts
880
+ var ScreenOrientationController = class {
881
+ constructor(_host) {
882
+ this._host = _host;
883
+ this._isScreenOrientationLocked = false;
884
+ this._logger = void 0;
885
+ this._updateScreenOrientation();
886
+ this._listenerDisposal = new DisposalBin();
887
+ _host.addController({
888
+ hostConnected: this._handleHostConnected.bind(this),
889
+ hostDisconnected: this._handleHostDisconnected.bind(this)
890
+ });
891
+ }
892
+ async _handleHostConnected() {
893
+ this._updateScreenOrientation();
894
+ this._addScreenOrientationEventListeners();
895
+ }
896
+ async _handleHostDisconnected() {
897
+ if (this.canOrient && this._isScreenOrientationLocked)
898
+ await this.unlock();
899
+ this._listenerDisposal.empty();
900
+ }
901
+ get currentOrientation() {
902
+ return this._screenOrientation;
903
+ }
904
+ get canOrient() {
905
+ return canOrientScreen();
906
+ }
907
+ get isLocked() {
908
+ return this._isScreenOrientationLocked;
909
+ }
910
+ async lock(lockType) {
911
+ this._throwIfScreenOrientationUnavailable();
912
+ await screen.orientation.lock(lockType);
913
+ this._isScreenOrientationLocked = true;
914
+ this._host.dispatchEvent(
915
+ vdsEvent("vds-screen-orientation-lock-change", {
916
+ bubbles: true,
917
+ composed: true,
918
+ detail: lockType
919
+ })
920
+ );
921
+ }
922
+ async unlock() {
923
+ this._throwIfScreenOrientationUnavailable();
924
+ await screen.orientation.unlock();
925
+ this._isScreenOrientationLocked = false;
926
+ this._host.dispatchEvent(
927
+ vdsEvent("vds-screen-orientation-lock-change", {
928
+ bubbles: true,
929
+ composed: true,
930
+ detail: screen.orientation.type
931
+ })
932
+ );
933
+ }
934
+ _addScreenOrientationEventListeners() {
935
+ if (!this.canOrient)
936
+ return;
937
+ this._listenerDisposal.add(this._addScreenOrientationChangeEventListener());
938
+ }
939
+ _addScreenOrientationChangeEventListener() {
940
+ return listen(screen.orientation, "change", this._handleOrientationChange.bind(this));
941
+ }
942
+ _handleOrientationChange(event) {
943
+ this._screenOrientation = window.screen.orientation.type;
944
+ this._host.dispatchEvent(
945
+ vdsEvent("vds-screen-orientation-change", {
946
+ bubbles: true,
947
+ composed: true,
948
+ detail: this._screenOrientation,
949
+ triggerEvent: event
950
+ })
951
+ );
952
+ }
953
+ _updateScreenOrientation() {
954
+ this._screenOrientation = IS_CLIENT ? window.screen?.orientation?.type : void 0;
955
+ }
956
+ _throwIfScreenOrientationUnavailable() {
957
+ if (this.canOrient)
958
+ return;
959
+ throw Error("Screen orientation API is not available.");
960
+ }
961
+ };
962
+
963
+ // src/utils/object.ts
964
+ function keysOf(obj) {
965
+ return Object.keys(obj);
966
+ }
967
+
968
+ // src/stores/store-subscription.ts
969
+ function storeSubscription(host, store, onChange) {
970
+ let consumer;
971
+ let unsubscribe;
972
+ const subscribe = () => {
973
+ unsubscribe = (consumer?.value ?? store).subscribe(onChange);
974
+ };
975
+ if (isContext(store)) {
976
+ consumer = store.consume(host);
977
+ }
978
+ host.addController({
979
+ hostConnected() {
980
+ if (isContext(store)) {
981
+ consumer.whenRegistered(subscribe);
982
+ } else {
983
+ subscribe();
984
+ }
985
+ },
986
+ hostDisconnected() {
987
+ unsubscribe?.();
988
+ }
989
+ });
990
+ }
991
+
992
+ // src/stores/stores.ts
993
+ var subscriberQueue = [];
994
+ function readable(value, start) {
995
+ return {
996
+ initialValue: value,
997
+ subscribe: writable(value, start).subscribe
998
+ };
999
+ }
1000
+ function writable(value, start = noop) {
1001
+ let stop;
1002
+ const subscribers = /* @__PURE__ */ new Set();
1003
+ function set(newValue) {
1004
+ if (safeNotEqual(value, newValue)) {
1005
+ value = newValue;
1006
+ if (stop) {
1007
+ const runQueue = !subscriberQueue.length;
1008
+ for (const subscriber of subscribers) {
1009
+ subscriber[1]();
1010
+ subscriberQueue.push(subscriber, value);
1011
+ }
1012
+ if (runQueue) {
1013
+ for (let i = 0; i < subscriberQueue.length; i += 2) {
1014
+ subscriberQueue[i][0](subscriberQueue[i + 1]);
1015
+ }
1016
+ subscriberQueue.length = 0;
1017
+ }
1018
+ }
1019
+ }
1020
+ }
1021
+ function update(updater) {
1022
+ set(updater(value));
1023
+ }
1024
+ function subscribe(run, invalidate = noop) {
1025
+ const subscriber = [run, invalidate];
1026
+ subscribers.add(subscriber);
1027
+ if (subscribers.size === 1) {
1028
+ stop = start(set) || noop;
1029
+ }
1030
+ run(value);
1031
+ return () => {
1032
+ subscribers.delete(subscriber);
1033
+ if (subscribers.size === 0) {
1034
+ stop?.();
1035
+ stop = null;
1036
+ }
1037
+ };
1038
+ }
1039
+ return { initialValue: value, set, update, subscribe };
1040
+ }
1041
+ function derived(stores, fn, initialValue) {
1042
+ const single = !Array.isArray(stores);
1043
+ const storesArray = single ? [stores] : stores;
1044
+ const auto = fn.length < 2;
1045
+ return readable(initialValue, (set) => {
1046
+ let initialized = false;
1047
+ const values = [];
1048
+ let pending = 0;
1049
+ let cleanup = noop;
1050
+ const sync = () => {
1051
+ if (pending) {
1052
+ return;
1053
+ }
1054
+ cleanup();
1055
+ const result = fn(single ? values[0] : values, set);
1056
+ if (auto) {
1057
+ set(result);
1058
+ } else {
1059
+ cleanup = isFunction(result) ? result : noop;
1060
+ }
1061
+ };
1062
+ const unsubscribers = storesArray.map(
1063
+ (store, i) => store.subscribe(
1064
+ (value) => {
1065
+ values[i] = value;
1066
+ pending &= ~(1 << i);
1067
+ if (initialized) {
1068
+ sync();
1069
+ }
1070
+ },
1071
+ () => {
1072
+ pending |= 1 << i;
1073
+ }
1074
+ )
1075
+ );
1076
+ initialized = true;
1077
+ sync();
1078
+ return function stop() {
1079
+ unsubscribers.forEach((fn2) => fn2());
1080
+ cleanup();
1081
+ };
1082
+ });
1083
+ }
1084
+ function getStoreValue(store) {
1085
+ let value;
1086
+ store.subscribe((_) => value = _)();
1087
+ return value;
1088
+ }
1089
+
1090
+ // src/stores/store-record.ts
1091
+ function storeRecordSubscription(host, store, key2, onChange) {
1092
+ if (isContext(store)) {
1093
+ const consumer = store.consume(host);
1094
+ let unsubscribe;
1095
+ const subscribe = () => {
1096
+ unsubscribe = consumer.value[key2].subscribe(onChange);
1097
+ };
1098
+ host.addController({
1099
+ hostConnected: () => {
1100
+ consumer.whenRegistered(subscribe);
1101
+ },
1102
+ hostDisconnected: () => {
1103
+ unsubscribe?.();
1104
+ }
1105
+ });
1106
+ } else {
1107
+ return storeSubscription(host, store[key2], onChange);
1108
+ }
1109
+ }
1110
+ function copyStoreRecords(storeRecordA, storeRecordB) {
1111
+ for (const key2 of keysOf(storeRecordA)) {
1112
+ const storeA = storeRecordA[key2];
1113
+ const storeB = storeRecordB[key2];
1114
+ if (!storeA || !storeB)
1115
+ continue;
1116
+ const valA = getStoreValue(storeA);
1117
+ const valB = getStoreValue(storeB);
1118
+ if (valA !== valB)
1119
+ storeB.set(valA);
1120
+ }
1121
+ }
1122
+ function unwrapStoreRecord(store) {
1123
+ return new Proxy(store, {
1124
+ get(target, key2) {
1125
+ return getStoreValue(target[key2]);
1126
+ },
1127
+ has(target, key2) {
1128
+ return Reflect.has(target, key2);
1129
+ },
1130
+ ownKeys(target) {
1131
+ return Reflect.ownKeys(target);
1132
+ },
1133
+ getOwnPropertyDescriptor(target, key2) {
1134
+ return Reflect.getOwnPropertyDescriptor(target, key2);
1135
+ }
1136
+ });
1137
+ }
1138
+
1139
+ // src/utils/array.ts
1140
+ function isScalarArrayEqual(arrayA, arrayB) {
1141
+ return arrayA.length === arrayB.length && arrayA.every((value, i) => value === arrayB[i]);
1142
+ }
1143
+
1144
+ // src/utils/dom.ts
1145
+ function raf(callback) {
1146
+ return new Promise((resolve) => {
1147
+ const rafId = window.requestAnimationFrame(async () => {
1148
+ await callback?.();
1149
+ resolve(rafId);
1150
+ });
1151
+ });
1152
+ }
1153
+ function safelyDefineCustomElement(name, constructor, isClient = IS_CLIENT) {
1154
+ const isElementRegistered = isClient && !isUndefined(window.customElements.get(name));
1155
+ if (!isClient || isElementRegistered)
1156
+ return;
1157
+ window.customElements.define(name, constructor);
1158
+ }
1159
+ function setAttribute(element, attrName, attrValue) {
1160
+ if (isNil(attrValue) || attrValue === false) {
1161
+ element.removeAttribute(attrName);
1162
+ } else {
1163
+ const value = isString(attrValue) ? attrValue : "";
1164
+ element.setAttribute(attrName, value);
1165
+ }
1166
+ }
1167
+ function setAttributeIfEmpty(element, attrName, attrValue) {
1168
+ if (!element.hasAttribute(attrName)) {
1169
+ element.setAttribute(attrName, attrValue);
1170
+ }
1171
+ }
1172
+ function setCSSProperty(element, name, value, prefix = "vds") {
1173
+ element.style.setProperty(`--${prefix}-${name}`, value ? value : null);
1174
+ }
1175
+ function getSlottedChildren(el, name) {
1176
+ const selector = name ? `slot[name="${name}"]` : "slot:not([name])";
1177
+ const slot = el.shadowRoot?.querySelector(selector);
1178
+ const childNodes = slot?.assignedNodes({ flatten: true }) ?? [];
1179
+ return Array.prototype.filter.call(childNodes, (node) => node.nodeType == Node.ELEMENT_NODE);
1180
+ }
1181
+ function requestIdleCallback(callback) {
1182
+ const idle = window.requestIdleCallback ?? ((fn) => fn());
1183
+ if (document.readyState === "complete") {
1184
+ idle(callback);
1185
+ } else {
1186
+ window.addEventListener(
1187
+ "load",
1188
+ () => {
1189
+ idle(callback);
1190
+ },
1191
+ { once: true }
1192
+ );
1193
+ }
1194
+ }
1195
+
1196
+ // src/utils/keyboard.ts
1197
+ function isKeyboardEvent(event) {
1198
+ return event?.type.startsWith("key") ?? false;
1199
+ }
1200
+ function isKeyboardClick(event) {
1201
+ return isKeyboardEvent(event) && (event.key === "Enter" || event.key === " ");
1202
+ }
1203
+ function camelToKebabCase(str) {
1204
+ return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
1205
+ }
1206
+
1207
+ // src/utils/time.ts
1208
+ function padNumberWithZeroes(num, expectedLength) {
1209
+ const str = String(num);
1210
+ const actualLength = str.length;
1211
+ const shouldPad = actualLength < expectedLength;
1212
+ if (shouldPad) {
1213
+ const padLength = expectedLength - actualLength;
1214
+ const padding = `0`.repeat(padLength);
1215
+ return `${padding}${num}`;
1216
+ }
1217
+ return str;
1218
+ }
1219
+ function parseTime(duration) {
1220
+ const hours = Math.trunc(duration / 3600);
1221
+ const minutes = Math.trunc(duration % 3600 / 60);
1222
+ const seconds = Math.trunc(duration % 60);
1223
+ const fraction = Number((duration - Math.trunc(duration)).toPrecision(3));
1224
+ return {
1225
+ ["hours" /* Hours */]: hours,
1226
+ ["minutes" /* Minutes */]: minutes,
1227
+ ["seconds" /* Seconds */]: seconds,
1228
+ ["fraction" /* Fraction */]: fraction
1229
+ };
1230
+ }
1231
+ function formatTime(duration, shouldPadHours = false, shouldAlwaysShowHours = false) {
1232
+ const { hours, minutes, seconds } = parseTime(duration);
1233
+ const paddedHours = shouldPadHours ? padNumberWithZeroes(hours, 2) : hours;
1234
+ const paddedMinutes = padNumberWithZeroes(minutes, 2);
1235
+ const paddedSeconds = padNumberWithZeroes(seconds, 2);
1236
+ if (hours > 0 || shouldAlwaysShowHours) {
1237
+ return `${paddedHours}:${paddedMinutes}:${paddedSeconds}`;
1238
+ }
1239
+ return `${minutes}:${paddedSeconds}`;
1240
+ }
1241
+ function formatSpokenTime(duration) {
1242
+ const spokenParts = [];
1243
+ const { hours, minutes, seconds } = parseTime(duration);
1244
+ const pluralize = (num, word) => num === 1 ? word : `${word}s`;
1245
+ if (hours > 0) {
1246
+ spokenParts.push(`${hours} ${pluralize(hours, "hour")}`);
1247
+ }
1248
+ if (minutes > 0) {
1249
+ spokenParts.push(`${minutes} ${pluralize(minutes, "minute")}`);
1250
+ }
1251
+ if (seconds > 0 || spokenParts.length === 0) {
1252
+ spokenParts.push(`${seconds} ${pluralize(seconds, "second")}`);
1253
+ }
1254
+ return spokenParts.join(", ");
1255
+ }
1256
+ function rafThrottle(func) {
1257
+ let rafId;
1258
+ const pending = () => !isUndefined(rafId);
1259
+ const cancel = () => {
1260
+ if (isUndefined(rafId))
1261
+ return;
1262
+ window.cancelAnimationFrame(rafId);
1263
+ rafId = void 0;
1264
+ };
1265
+ function throttled(...args) {
1266
+ if (pending())
1267
+ return;
1268
+ rafId = window.requestAnimationFrame(() => {
1269
+ func.apply(this, args);
1270
+ rafId = void 0;
1271
+ });
1272
+ }
1273
+ throttled.cancel = cancel;
1274
+ throttled.pending = pending;
1275
+ return throttled;
1276
+ }
1277
+
1278
+ // src/media/provider/media-provider-context.ts
1279
+ var mediaProviderElementContext = createContext(
1280
+ () => writable(void 0)
1281
+ );
1282
+
1283
+ // src/media/MediaType.ts
1284
+ function rangeCheck(fnName, index, maxIndex) {
1285
+ if (!isNumber(index) || index < 0 || index > maxIndex) {
1286
+ throw new Error(
1287
+ `Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index}) is non-numeric or out of bounds (0-${maxIndex}).`
1288
+ );
1289
+ }
1290
+ }
1291
+ function getRange(fnName, valueIndex, ranges, rangeIndex) {
1292
+ rangeCheck(fnName, rangeIndex, ranges.length - 1);
1293
+ return ranges[rangeIndex][valueIndex];
1294
+ }
1295
+ function createTimeRangesObj(ranges) {
1296
+ if (isUndefined(ranges) || ranges.length === 0) {
1297
+ const throwEmptyError = () => {
1298
+ throw new Error("This TimeRanges object is empty");
1299
+ };
1300
+ return {
1301
+ length: 0,
1302
+ start: throwEmptyError,
1303
+ end: throwEmptyError
1304
+ };
1305
+ }
1306
+ return {
1307
+ length: ranges.length,
1308
+ start: getRange.bind(null, "start", 0, ranges),
1309
+ end: getRange.bind(null, "end", 1, ranges)
1310
+ };
1311
+ }
1312
+ function createTimeRanges(start, end) {
1313
+ if (isArray(start)) {
1314
+ return createTimeRangesObj(start);
1315
+ } else if (isUndefined(start) || isUndefined(end)) {
1316
+ return createTimeRangesObj();
1317
+ }
1318
+ return createTimeRangesObj([[start, end]]);
1319
+ }
1320
+
1321
+ // src/media/store.ts
1322
+ var MEDIA_STORE_DEFAULTS = {
1323
+ autoplay: false,
1324
+ autoplayError: void 0,
1325
+ buffered: createTimeRanges(),
1326
+ duration: 0,
1327
+ bufferedAmount: 0,
1328
+ canLoad: false,
1329
+ canPlay: false,
1330
+ canFullscreen: false,
1331
+ controls: false,
1332
+ poster: "",
1333
+ currentSrc: "",
1334
+ currentTime: 0,
1335
+ ended: false,
1336
+ error: void 0,
1337
+ fullscreen: false,
1338
+ userIdle: false,
1339
+ loop: false,
1340
+ mediaType: "unknown" /* Unknown */,
1341
+ muted: false,
1342
+ paused: true,
1343
+ played: createTimeRanges(),
1344
+ playing: false,
1345
+ playsinline: false,
1346
+ seekable: createTimeRanges(),
1347
+ seekableAmount: 0,
1348
+ seeking: false,
1349
+ src: [],
1350
+ started: false,
1351
+ viewType: "unknown" /* Unknown */,
1352
+ volume: 1,
1353
+ waiting: false
1354
+ };
1355
+ function createMediaStore() {
1356
+ const store = {};
1357
+ for (const prop of keysOf(MEDIA_STORE_DEFAULTS)) {
1358
+ store[prop] = writable(MEDIA_STORE_DEFAULTS[prop]);
1359
+ }
1360
+ return store;
1361
+ }
1362
+ var DO_NOT_RESET_ON_SRC_CHANGE = /* @__PURE__ */ new Set([
1363
+ "autoplay",
1364
+ "canFullscreen",
1365
+ "canLoad",
1366
+ "controls",
1367
+ "currentSrc",
1368
+ "loop",
1369
+ "muted",
1370
+ "playsinline",
1371
+ "poster",
1372
+ "src",
1373
+ "viewType",
1374
+ "volume"
1375
+ ]);
1376
+ function softResetMediaStore(store) {
1377
+ keysOf(store).forEach((prop) => {
1378
+ if (!DO_NOT_RESET_ON_SRC_CHANGE.has(prop)) {
1379
+ store[prop].set(store[prop].initialValue);
1380
+ }
1381
+ });
1382
+ }
1383
+ function resetMediaStore(store) {
1384
+ for (const prop of keysOf(MEDIA_STORE_DEFAULTS)) {
1385
+ store[prop].set(MEDIA_STORE_DEFAULTS[prop]);
1386
+ }
1387
+ }
1388
+ var mediaStoreContext = createContext(createMediaStore);
1389
+ function mediaStoreSubscription(host, property, onChange) {
1390
+ return storeRecordSubscription(host, mediaStoreContext, property, onChange);
1391
+ }
1392
+
1393
+ var __defProp = Object.defineProperty;
1394
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1395
+ var __decorateClass = (decorators, target, key, kind) => {
1396
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1397
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1398
+ if (decorator = decorators[i])
1399
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1400
+ if (kind && result)
1401
+ __defProp(target, key, result);
1402
+ return result;
1403
+ };
1404
+
1405
+ /**
1406
+ * @license
1407
+ * Copyright 2019 Google LLC
1408
+ * SPDX-License-Identifier: BSD-3-Clause
1409
+ */
1410
+ const t$1=window,e$2=t$1.ShadowRoot&&(void 0===t$1.ShadyCSS||t$1.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),n$2=new WeakMap;class o$2{constructor(t,e,n){if(this._$cssResult$=!0,n!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=n$2.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&n$2.set(s,t));}return t}toString(){return this.cssText}}const r$1=t=>new o$2("string"==typeof t?t:t+"",void 0,s$2),i$1=(t,...e)=>{const n=1===t.length?t[0]:e.reduce(((e,s,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[n+1]),t[0]);return new o$2(n,t,s$2)},S=(s,n)=>{e$2?s.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((e=>{const n=document.createElement("style"),o=t$1.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=e.cssText,s.appendChild(n);}));},c=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$1(e)})(t):t;
1411
+
1412
+ /**
1413
+ * @license
1414
+ * Copyright 2017 Google LLC
1415
+ * SPDX-License-Identifier: BSD-3-Clause
1416
+ */var s$1;const e$1=window,r=e$1.trustedTypes,h=r?r.emptyScript:"",o$1=e$1.reactiveElementPolyfillSupport,n$1={toAttribute(t,i){switch(i){case Boolean:t=t?h:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,i){let s=t;switch(i){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t);}catch(t){s=null;}}return s}},a=(t,i)=>i!==t&&(i==i||t==t),l$1={attribute:!0,type:String,converter:n$1,reflect:!1,hasChanged:a};class d extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u();}static addInitializer(t){var i;this.finalize(),(null!==(i=this.h)&&void 0!==i?i:this.h=[]).push(t);}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((i,s)=>{const e=this._$Ep(s,i);void 0!==e&&(this._$Ev.set(e,s),t.push(e));})),t}static createProperty(t,i=l$1){if(i.state&&(i.attribute=!1),this.finalize(),this.elementProperties.set(t,i),!i.noAccessor&&!this.prototype.hasOwnProperty(t)){const s="symbol"==typeof t?Symbol():"__"+t,e=this.getPropertyDescriptor(t,s,i);void 0!==e&&Object.defineProperty(this.prototype,t,e);}}static getPropertyDescriptor(t,i,s){return {get(){return this[i]},set(e){const r=this[t];this[i]=e,this.requestUpdate(t,r,s);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||l$1}static finalize(){if(this.hasOwnProperty("finalized"))return !1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const s of i)this.createProperty(s,t[s]);}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(i){const s=[];if(Array.isArray(i)){const e=new Set(i.flat(1/0).reverse());for(const i of e)s.unshift(c(i));}else void 0!==i&&s.push(c(i));return s}static _$Ep(t,i){const s=i.attribute;return !1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)));}addController(t){var i,s;(null!==(i=this._$ES)&&void 0!==i?i:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(s=t.hostConnected)||void 0===s||s.call(t));}removeController(t){var i;null===(i=this._$ES)||void 0===i||i.splice(this._$ES.indexOf(t)>>>0,1);}_$Eg(){this.constructor.elementProperties.forEach(((t,i)=>{this.hasOwnProperty(i)&&(this._$Ei.set(i,this[i]),delete this[i]);}));}createRenderRoot(){var t;const s=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return S(s,this.constructor.elementStyles),s}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostConnected)||void 0===i?void 0:i.call(t)}));}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostDisconnected)||void 0===i?void 0:i.call(t)}));}attributeChangedCallback(t,i,s){this._$AK(t,s);}_$EO(t,i,s=l$1){var e;const r=this.constructor._$Ep(t,s);if(void 0!==r&&!0===s.reflect){const h=(void 0!==(null===(e=s.converter)||void 0===e?void 0:e.toAttribute)?s.converter:n$1).toAttribute(i,s.type);this._$El=t,null==h?this.removeAttribute(r):this.setAttribute(r,h),this._$El=null;}}_$AK(t,i){var s;const e=this.constructor,r=e._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=e.getPropertyOptions(r),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(s=t.converter)||void 0===s?void 0:s.fromAttribute)?t.converter:n$1;this._$El=r,this[r]=h.fromAttribute(i,t.type),this._$El=null;}}requestUpdate(t,i,s){let e=!0;void 0!==t&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||a)(this[t],i)?(this._$AL.has(t)||this._$AL.set(t,i),!0===s.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,s))):e=!1),!this.isUpdatePending&&e&&(this._$E_=this._$Ej());}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this._$Ei&&(this._$Ei.forEach(((t,i)=>this[i]=t)),this._$Ei=void 0);let i=!1;const s=this._$AL;try{i=this.shouldUpdate(s),i?(this.willUpdate(s),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var i;return null===(i=t.hostUpdate)||void 0===i?void 0:i.call(t)})),this.update(s)):this._$Ek();}catch(t){throw i=!1,this._$Ek(),t}i&&this._$AE(s);}willUpdate(t){}_$AE(t){var i;null===(i=this._$ES)||void 0===i||i.forEach((t=>{var i;return null===(i=t.hostUpdated)||void 0===i?void 0:i.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return !0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,i)=>this._$EO(i,this[i],t))),this._$EC=void 0),this._$Ek();}updated(t){}firstUpdated(t){}}d.finalized=!0,d.elementProperties=new Map,d.elementStyles=[],d.shadowRootOptions={mode:"open"},null==o$1||o$1({ReactiveElement:d}),(null!==(s$1=e$1.reactiveElementVersions)&&void 0!==s$1?s$1:e$1.reactiveElementVersions=[]).push("1.5.0");
1417
+
1418
+ /**
1419
+ * @license
1420
+ * Copyright 2017 Google LLC
1421
+ * SPDX-License-Identifier: BSD-3-Clause
1422
+ */var l,o;class s extends d{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Z(i,this.renderRoot,this.renderOptions);}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0);}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1);}render(){return x}}s.finalized=!0,s._$litElement$=!0,null===(l=globalThis.litElementHydrateSupport)||void 0===l||l.call(globalThis,{LitElement:s});const n=globalThis.litElementPolyfillSupport;null==n||n({LitElement:s});(null!==(o=globalThis.litElementVersions)&&void 0!==o?o:globalThis.litElementVersions=[]).push("3.2.2");
1423
+
1424
+ /**
1425
+ * @license
1426
+ * Copyright 2017 Google LLC
1427
+ * SPDX-License-Identifier: BSD-3-Clause
1428
+ */
1429
+ const i=(i,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(n){n.createProperty(e.key,i);}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this));},finisher(n){n.createProperty(e.key,i);}};function e(e){return (n,t)=>void 0!==t?((i,e,n)=>{e.constructor.createProperty(n,i);})(e,n,t):i(e,n)}
1430
+
1431
+ /**
1432
+ * @license
1433
+ * Copyright 2017 Google LLC
1434
+ * SPDX-License-Identifier: BSD-3-Clause
1435
+ */function t(t){return e({...t,state:!0})}
1436
+
1437
+ var mediaProviderDiscoveryId = Symbol("@vidstack/media-provider-discovery");
1438
+ var MediaProviderElement = class extends s {
1439
+ constructor() {
1440
+ super();
1441
+ this._disconnectDisposal = new DisposalBin();
1442
+ this._logger = void 0;
1443
+ this.loading = "visible";
1444
+ this._attemptingAutoplay = false;
1445
+ this.controllerQueue = new RequestQueue();
1446
+ this._store = createMediaStore();
1447
+ this._state = unwrapStoreRecord(this._store);
1448
+ this.connectedQueue = hostRequestQueue(this);
1449
+ this.mediaQueue = new RequestQueue();
1450
+ this.screenOrientationController = new ScreenOrientationController(this);
1451
+ this.fullscreenController = new FullscreenController(this, this.screenOrientationController);
1452
+ discoverable(this, "vds-media-provider-connect", { register: mediaProviderDiscoveryId });
1453
+ const intersectionController = createIntersectionController(
1454
+ this,
1455
+ { target: this, threshold: 0 },
1456
+ (entries) => {
1457
+ if (!/(visible|lazy)/.test(this.loading)) {
1458
+ intersectionController.hostDisconnected();
1459
+ return;
1460
+ }
1461
+ if (entries[0]?.isIntersecting) {
1462
+ this.startLoadingMedia();
1463
+ intersectionController.hostDisconnected();
1464
+ }
1465
+ }
1466
+ );
1467
+ }
1468
+ connectedCallback() {
1469
+ super.connectedCallback();
1470
+ this._logMediaEvents();
1471
+ window.requestAnimationFrame(() => {
1472
+ if (isUndefined(this.canLoadPoster)) {
1473
+ this.canLoadPoster = true;
1474
+ }
1475
+ });
1476
+ }
1477
+ firstUpdated(changedProperties) {
1478
+ super.firstUpdated(changedProperties);
1479
+ this.dispatchEvent(
1480
+ vdsEvent("vds-fullscreen-support-change", {
1481
+ detail: this.canFullscreen
1482
+ })
1483
+ );
1484
+ if (this.canLoad || this.loading === "eager") {
1485
+ window?.requestAnimationFrame(() => {
1486
+ this.startLoadingMedia();
1487
+ });
1488
+ } else if (this.loading === "idle") {
1489
+ requestIdleCallback(() => {
1490
+ this.startLoadingMedia();
1491
+ });
1492
+ }
1493
+ }
1494
+ render() {
1495
+ return y`<slot @slotchange="${this.handleDefaultSlotChange}"></slot>`;
1496
+ }
1497
+ disconnectedCallback() {
1498
+ this._updateMediaStoreOnDisconnect(this._store);
1499
+ this.mediaQueue.destroy();
1500
+ this._disconnectDisposal.empty();
1501
+ super.disconnectedCallback();
1502
+ raf(() => {
1503
+ raf(() => {
1504
+ if (!this.isConnected)
1505
+ this.destroy();
1506
+ });
1507
+ });
1508
+ }
1509
+ _updateMediaStoreOnDisconnect(store) {
1510
+ store.paused.set(true);
1511
+ store.playing.set(false);
1512
+ store.seeking.set(false);
1513
+ store.waiting.set(false);
1514
+ store.fullscreen.set(false);
1515
+ }
1516
+ destroy() {
1517
+ if (this.isConnected)
1518
+ this.disconnectedCallback();
1519
+ this.dispatchEvent(vdsEvent("vds-destroy"));
1520
+ }
1521
+ _logMediaEvents() {
1522
+ }
1523
+ get volume() {
1524
+ return this._getVolume();
1525
+ }
1526
+ set volume(newVolume) {
1527
+ this.mediaQueue.queue("volume", () => {
1528
+ const oldVol = this.volume;
1529
+ const newVol = clampNumber(0, newVolume, 1);
1530
+ if (oldVol !== newVol) {
1531
+ this._setVolume(newVol);
1532
+ this.requestUpdate("volume", oldVol);
1533
+ }
1534
+ });
1535
+ }
1536
+ get paused() {
1537
+ return this._getPaused();
1538
+ }
1539
+ set paused(newPaused) {
1540
+ this.mediaQueue.queue("paused", () => {
1541
+ if (this.paused === newPaused)
1542
+ return;
1543
+ try {
1544
+ if (!newPaused) {
1545
+ this.play();
1546
+ } else {
1547
+ this.pause();
1548
+ }
1549
+ this.requestUpdate("paused", !newPaused);
1550
+ } catch (e) {
1551
+ this._logger?.error("paused-change-fail", e);
1552
+ }
1553
+ });
1554
+ }
1555
+ get currentTime() {
1556
+ return this._getCurrentTime();
1557
+ }
1558
+ set currentTime(newTime) {
1559
+ this.mediaQueue.queue("current-time", () => {
1560
+ const oldTime = this.currentTime;
1561
+ if (oldTime !== newTime) {
1562
+ this._setCurrentTime(newTime);
1563
+ this.requestUpdate("currentTime", oldTime);
1564
+ }
1565
+ });
1566
+ }
1567
+ get muted() {
1568
+ return this._getMuted();
1569
+ }
1570
+ set muted(newMuted) {
1571
+ this.mediaQueue.queue("muted", () => {
1572
+ const oldMuted = this.muted;
1573
+ if (oldMuted !== newMuted) {
1574
+ this._setMuted(newMuted);
1575
+ this.requestUpdate("muted", oldMuted);
1576
+ }
1577
+ });
1578
+ }
1579
+ get poster() {
1580
+ return this.state.poster;
1581
+ }
1582
+ set poster(newPoster) {
1583
+ const oldPoster = this.poster;
1584
+ if (oldPoster !== newPoster) {
1585
+ this.dispatchEvent(vdsEvent("vds-poster-change", { detail: newPoster }));
1586
+ this.requestUpdate("poster", oldPoster);
1587
+ }
1588
+ }
1589
+ get loop() {
1590
+ return this.state.loop;
1591
+ }
1592
+ set loop(newLoop) {
1593
+ const oldLoop = this.loop;
1594
+ if (oldLoop !== newLoop) {
1595
+ this.dispatchEvent(vdsEvent("vds-loop-change", { detail: newLoop }));
1596
+ this.requestUpdate("loop", oldLoop);
1597
+ }
1598
+ }
1599
+ get controls() {
1600
+ return this.state.controls;
1601
+ }
1602
+ set controls(newControls) {
1603
+ const oldControls = this.controls;
1604
+ if (oldControls !== newControls) {
1605
+ this.dispatchEvent(vdsEvent("vds-controls-change", { detail: newControls }));
1606
+ this.requestUpdate("controls", oldControls);
1607
+ }
1608
+ }
1609
+ get canLoad() {
1610
+ return this.state.canLoad;
1611
+ }
1612
+ startLoadingMedia() {
1613
+ if (this.state.canPlay)
1614
+ return;
1615
+ this.dispatchEvent(vdsEvent("vds-can-load"));
1616
+ }
1617
+ _throwIfNotReadyForPlayback() {
1618
+ if (!this.state.canPlay) {
1619
+ throw Error(`Media is not ready - wait for \`vds-can-play\` event.`);
1620
+ }
1621
+ }
1622
+ async _resetPlaybackIfEnded() {
1623
+ if (!this.state.ended || this.state.currentTime === 0)
1624
+ return;
1625
+ return this._setCurrentTime(0);
1626
+ }
1627
+ _throwIfNotVideoView() {
1628
+ if (this.state.viewType !== "video" /* Video */) {
1629
+ throw Error("Player is currently not in a video view.");
1630
+ }
1631
+ }
1632
+ async _handleMediaReady({ event, duration }) {
1633
+ if (this.state.canPlay)
1634
+ return;
1635
+ this.dispatchEvent(
1636
+ vdsEvent("vds-can-play", {
1637
+ triggerEvent: event,
1638
+ detail: { duration }
1639
+ })
1640
+ );
1641
+ this.mediaQueue.start();
1642
+ await this._attemptAutoplay();
1643
+ }
1644
+ _handleCurrentSrcChange(currentSrc, triggerEvent) {
1645
+ if (this.state.currentSrc === currentSrc)
1646
+ return;
1647
+ this.mediaQueue.stop();
1648
+ this.dispatchEvent(
1649
+ vdsEvent("vds-current-src-change", {
1650
+ detail: currentSrc,
1651
+ triggerEvent
1652
+ })
1653
+ );
1654
+ }
1655
+ get autoplay() {
1656
+ return this.state.autoplay;
1657
+ }
1658
+ set autoplay(newAutoplay) {
1659
+ if (this.autoplay !== newAutoplay) {
1660
+ this.dispatchEvent(vdsEvent("vds-autoplay-change", { detail: newAutoplay }));
1661
+ this.requestUpdate("autoplay", !newAutoplay);
1662
+ }
1663
+ this._attemptAutoplay();
1664
+ }
1665
+ get _canAttemptAutoplay() {
1666
+ return this.state.canPlay && this.state.autoplay && !this.state.started;
1667
+ }
1668
+ async _attemptAutoplay() {
1669
+ if (!this._canAttemptAutoplay)
1670
+ return;
1671
+ this._attemptingAutoplay = true;
1672
+ try {
1673
+ await this.play();
1674
+ this.dispatchEvent(vdsEvent("vds-autoplay", { detail: { muted: this.muted } }));
1675
+ } catch (error) {
1676
+ this.dispatchEvent(
1677
+ vdsEvent("vds-autoplay-fail", {
1678
+ detail: {
1679
+ muted: this.muted,
1680
+ error
1681
+ }
1682
+ })
1683
+ );
1684
+ this.requestUpdate();
1685
+ }
1686
+ this._attemptingAutoplay = false;
1687
+ }
1688
+ get controller() {
1689
+ return this._controller;
1690
+ }
1691
+ get logLevel() {
1692
+ return this._controller?.logLevel ?? "silent";
1693
+ }
1694
+ set logLevel(level) {
1695
+ }
1696
+ get idleDelay() {
1697
+ return this._controller?.idleDelay ?? 0;
1698
+ }
1699
+ set idleDelay(delay) {
1700
+ this.controllerQueue.queue("idle-delay", () => {
1701
+ this._controller.idleDelay = delay;
1702
+ });
1703
+ }
1704
+ attachMediaController(controller, onDisconnect) {
1705
+ this._controller = controller;
1706
+ this._store = controller._store;
1707
+ this._state = controller.state;
1708
+ this.controllerQueue.start();
1709
+ onDisconnect(() => {
1710
+ this.controllerQueue.destroy();
1711
+ this._store = createMediaStore();
1712
+ this._state = unwrapStoreRecord(this._store);
1713
+ if (this._controller) {
1714
+ copyStoreRecords(this._controller._store, this._store);
1715
+ this._updateMediaStoreOnDisconnect(this._controller._store);
1716
+ }
1717
+ this._controller = void 0;
1718
+ });
1719
+ }
1720
+ dispatchEvent(event) {
1721
+ if (!this._controller && event.type.startsWith("vds-") && event.type !== "vds-destroy") {
1722
+ this.controllerQueue.queue(event.type, () => {
1723
+ super.dispatchEvent(event);
1724
+ });
1725
+ return false;
1726
+ }
1727
+ return super.dispatchEvent(event);
1728
+ }
1729
+ store() {
1730
+ return this._store;
1731
+ }
1732
+ get state() {
1733
+ return this._state;
1734
+ }
1735
+ get canFullscreen() {
1736
+ return this.fullscreenController.isSupported;
1737
+ }
1738
+ get fullscreen() {
1739
+ return this.fullscreenController.isFullscreen;
1740
+ }
1741
+ get fullscreenOrientation() {
1742
+ return this.fullscreenController.screenOrientationLock;
1743
+ }
1744
+ set fullscreenOrientation(lockType) {
1745
+ const prevLockType = this.fullscreenController.screenOrientationLock;
1746
+ if (prevLockType !== lockType) {
1747
+ this.fullscreenController.screenOrientationLock = lockType;
1748
+ this.requestUpdate("fullscreen-orientation", prevLockType);
1749
+ }
1750
+ }
1751
+ enterFullscreen() {
1752
+ return this.fullscreenController.enterFullscreen();
1753
+ }
1754
+ exitFullscreen() {
1755
+ return this.fullscreenController.exitFullscreen();
1756
+ }
1757
+ };
1758
+ __decorateClass([
1759
+ e({ type: Number })
1760
+ ], MediaProviderElement.prototype, "volume", 1);
1761
+ __decorateClass([
1762
+ e({ type: Boolean })
1763
+ ], MediaProviderElement.prototype, "paused", 1);
1764
+ __decorateClass([
1765
+ e({ type: Number })
1766
+ ], MediaProviderElement.prototype, "currentTime", 1);
1767
+ __decorateClass([
1768
+ e({ type: Boolean })
1769
+ ], MediaProviderElement.prototype, "muted", 1);
1770
+ __decorateClass([
1771
+ e()
1772
+ ], MediaProviderElement.prototype, "poster", 1);
1773
+ __decorateClass([
1774
+ e({ type: Boolean })
1775
+ ], MediaProviderElement.prototype, "loop", 1);
1776
+ __decorateClass([
1777
+ e({ type: Boolean })
1778
+ ], MediaProviderElement.prototype, "controls", 1);
1779
+ __decorateClass([
1780
+ t()
1781
+ ], MediaProviderElement.prototype, "canLoadPoster", 2);
1782
+ __decorateClass([
1783
+ e({ attribute: "loading" })
1784
+ ], MediaProviderElement.prototype, "loading", 2);
1785
+ __decorateClass([
1786
+ e({ type: Boolean })
1787
+ ], MediaProviderElement.prototype, "autoplay", 1);
1788
+ __decorateClass([
1789
+ e({ attribute: "log-level" })
1790
+ ], MediaProviderElement.prototype, "logLevel", 1);
1791
+ __decorateClass([
1792
+ e({ attribute: "idle-delay", type: Number })
1793
+ ], MediaProviderElement.prototype, "idleDelay", 1);
1794
+ __decorateClass([
1795
+ e({ attribute: "fullscreen-orientation" })
1796
+ ], MediaProviderElement.prototype, "fullscreenOrientation", 1);
1797
+
1798
+ var UserIdleController = class {
1799
+ constructor(_host, _mediaStore) {
1800
+ this._host = _host;
1801
+ this._mediaStore = _mediaStore;
1802
+ this._idle = false;
1803
+ this._mediaPaused = false;
1804
+ this._idlingPaused = false;
1805
+ this._disposal = new DisposalBin();
1806
+ this.delay = 2e3;
1807
+ _host.addController(this);
1808
+ }
1809
+ get paused() {
1810
+ return this._idlingPaused || this._mediaPaused;
1811
+ }
1812
+ set paused(paused) {
1813
+ this._idlingPaused = paused;
1814
+ this._handleIdleChange();
1815
+ }
1816
+ hostConnected() {
1817
+ this._disposal.add(
1818
+ this._mediaStore.paused.subscribe(($paused) => {
1819
+ this._mediaPaused = $paused;
1820
+ this._handleIdleChange();
1821
+ })
1822
+ );
1823
+ const startIdleTimerEvents = ["pointerdown", "pointermove", "focus", "keydown"];
1824
+ startIdleTimerEvents.forEach((eventType) => {
1825
+ const off = listen(this._host, eventType, this._handleIdleChange.bind(this));
1826
+ this._disposal.add(off);
1827
+ });
1828
+ }
1829
+ hostDisconnected() {
1830
+ this._disposal.empty();
1831
+ this._stopIdleTimer();
1832
+ }
1833
+ _handleIdleChange() {
1834
+ if (this.paused) {
1835
+ this._stopIdleTimer();
1836
+ } else {
1837
+ this._startIdleTimer();
1838
+ }
1839
+ }
1840
+ _startIdleTimer() {
1841
+ this._stopIdleTimer();
1842
+ this._idleTimeout = window.setTimeout(() => {
1843
+ this._dispatchIdleChange(!this.paused);
1844
+ }, this.delay);
1845
+ }
1846
+ _stopIdleTimer() {
1847
+ window.clearTimeout(this._idleTimeout);
1848
+ this._dispatchIdleChange(false);
1849
+ }
1850
+ _dispatchIdleChange(isIdle) {
1851
+ if (this._idle !== isIdle) {
1852
+ this._host.dispatchEvent(vdsEvent("vds-user-idle-change", { detail: isIdle }));
1853
+ this._idle = isIdle;
1854
+ }
1855
+ }
1856
+ };
1857
+ var MediaController = class {
1858
+ constructor(_host) {
1859
+ this._host = _host;
1860
+ this._disconnectDisposal = new DisposalBin();
1861
+ this.providerQueue = new RequestQueue();
1862
+ this.providerDisposal = new DisposalBin();
1863
+ this._logController = void 0;
1864
+ this._logger = void 0;
1865
+ this._providerContext = mediaProviderElementContext.provide(this._host);
1866
+ this._mediaStoreProvider = mediaStoreContext.provide(this._host);
1867
+ this.state = unwrapStoreRecord(this._store);
1868
+ this._userIdleController = new UserIdleController(this._host, this._store);
1869
+ this._handleIdleChange = eventListener(this._host, "vds-user-idle-change", (event) => {
1870
+ this._store.userIdle.set(event.detail);
1871
+ this._satisfyMediaRequest("userIdle", event);
1872
+ });
1873
+ this._pendingMediaRequests = {
1874
+ loading: [],
1875
+ play: [],
1876
+ pause: [],
1877
+ volume: [],
1878
+ fullscreen: [],
1879
+ seeked: [],
1880
+ seeking: [],
1881
+ userIdle: []
1882
+ };
1883
+ this._handleStartLoadingRequest = eventListener(
1884
+ this._host,
1885
+ "vds-start-loading",
1886
+ this._createMediaRequestHandler("loading", (event) => {
1887
+ if (this.state.canLoad)
1888
+ return;
1889
+ this._pendingMediaRequests.loading.push(event);
1890
+ this._provider.startLoadingMedia();
1891
+ })
1892
+ );
1893
+ this._handleMuteRequest = eventListener(
1894
+ this._host,
1895
+ "vds-mute-request",
1896
+ this._createMediaRequestHandler("muted", (event) => {
1897
+ if (this.state.muted)
1898
+ return;
1899
+ this._pendingMediaRequests.volume.push(event);
1900
+ this.provider.muted = true;
1901
+ })
1902
+ );
1903
+ this._handleUnmuteRequest = eventListener(
1904
+ this._host,
1905
+ "vds-unmute-request",
1906
+ this._createMediaRequestHandler("muted", (event) => {
1907
+ if (!this.state.muted)
1908
+ return;
1909
+ this._pendingMediaRequests.volume.push(event);
1910
+ this.provider.muted = false;
1911
+ if (this.state.volume === 0) {
1912
+ this._pendingMediaRequests.volume.push(event);
1913
+ this.provider.volume = 0.25;
1914
+ }
1915
+ })
1916
+ );
1917
+ this._handlePlayRequest = eventListener(
1918
+ this._host,
1919
+ "vds-play-request",
1920
+ this._createMediaRequestHandler("paused", (event) => {
1921
+ if (!this.state.paused)
1922
+ return;
1923
+ this._pendingMediaRequests.play.push(event);
1924
+ this.provider.paused = false;
1925
+ })
1926
+ );
1927
+ this._handlePauseRequest = eventListener(
1928
+ this._host,
1929
+ "vds-pause-request",
1930
+ this._createMediaRequestHandler("paused", (event) => {
1931
+ if (this.state.paused)
1932
+ return;
1933
+ this._pendingMediaRequests.pause.push(event);
1934
+ this.provider.paused = true;
1935
+ })
1936
+ );
1937
+ this._isSeekingRequestPending = false;
1938
+ this._handleSeekingRequest = eventListener(
1939
+ this._host,
1940
+ "vds-seeking-request",
1941
+ this._createMediaRequestHandler("seeking", (event) => {
1942
+ this._stopWaiting();
1943
+ this._pendingMediaRequests.seeking.push(event);
1944
+ this._isSeekingRequestPending = true;
1945
+ this._store.seeking.set(true);
1946
+ })
1947
+ );
1948
+ this._handleSeekRequest = eventListener(
1949
+ this._host,
1950
+ "vds-seek-request",
1951
+ this._createMediaRequestHandler("seeking", (event) => {
1952
+ if (this.store.ended) {
1953
+ this._isReplay = true;
1954
+ }
1955
+ this._pendingMediaRequests.seeked.push(event);
1956
+ this._isSeekingRequestPending = false;
1957
+ let time = event.detail;
1958
+ if (this.state.duration - event.detail < 0.25) {
1959
+ time = this.state.duration;
1960
+ }
1961
+ this.provider.currentTime = time;
1962
+ })
1963
+ );
1964
+ this._handleVolumeChangeRequest = eventListener(
1965
+ this._host,
1966
+ "vds-volume-change-request",
1967
+ this._createMediaRequestHandler("volume", (event) => {
1968
+ const volume = event.detail;
1969
+ if (this.state.volume === volume)
1970
+ return;
1971
+ this._pendingMediaRequests.volume.push(event);
1972
+ this.provider.volume = volume;
1973
+ if (volume > 0 && this.state.muted) {
1974
+ this._pendingMediaRequests.volume.push(event);
1975
+ this.provider.muted = false;
1976
+ }
1977
+ })
1978
+ );
1979
+ this._handleEnterFullscreenRequest = eventListener(
1980
+ this._host,
1981
+ "vds-enter-fullscreen-request",
1982
+ this._createMediaRequestHandler("fullscreen", async (event) => {
1983
+ if (this.state.fullscreen)
1984
+ return;
1985
+ const target = event.detail ?? "media";
1986
+ if (target === "media" && this._host.canFullscreen) {
1987
+ this._pendingMediaRequests.fullscreen.push(event);
1988
+ await this._host.enterFullscreen?.();
1989
+ } else if (this.provider) {
1990
+ this._pendingMediaRequests.fullscreen.push(event);
1991
+ await this.provider.enterFullscreen();
1992
+ }
1993
+ })
1994
+ );
1995
+ this._handleExitFullscreenRequest = eventListener(
1996
+ this._host,
1997
+ "vds-exit-fullscreen-request",
1998
+ this._createMediaRequestHandler("fullscreen", async (event) => {
1999
+ if (!this.state.fullscreen)
2000
+ return;
2001
+ const target = event.detail ?? "media";
2002
+ if (target === "media" && this._host.canFullscreen) {
2003
+ this._pendingMediaRequests.fullscreen.push(event);
2004
+ await this._host.exitFullscreen?.();
2005
+ } else if (this.provider) {
2006
+ this._pendingMediaRequests.fullscreen.push(event);
2007
+ await this.provider.exitFullscreen();
2008
+ }
2009
+ })
2010
+ );
2011
+ this._handleResumeIdlingRequest = eventListener(
2012
+ this._host,
2013
+ "vds-resume-user-idle-request",
2014
+ (event) => {
2015
+ if (!this._mediaRequestEventGateway(event))
2016
+ return;
2017
+ this._pendingMediaRequests.userIdle.push(event);
2018
+ this._userIdleController.paused = false;
2019
+ }
2020
+ );
2021
+ this._handlePauseIdlingRequest = eventListener(
2022
+ this._host,
2023
+ "vds-pause-user-idle-request",
2024
+ (event) => {
2025
+ if (!this._mediaRequestEventGateway(event))
2026
+ return;
2027
+ this._pendingMediaRequests.userIdle.push(event);
2028
+ this._userIdleController.paused = true;
2029
+ }
2030
+ );
2031
+ this._handleShowPosterRequest = eventListener(
2032
+ this._host,
2033
+ "vds-show-poster-request",
2034
+ this._createMediaRequestHandler("poster", () => {
2035
+ this._provider.canLoadPoster = true;
2036
+ })
2037
+ );
2038
+ this._handleHidePosterRequest = eventListener(
2039
+ this._host,
2040
+ "vds-hide-poster-request",
2041
+ this._createMediaRequestHandler("poster", () => {
2042
+ this._provider.canLoadPoster = false;
2043
+ })
2044
+ );
2045
+ this._handleLoopRequest = this._createMediaRequestHandler("loop", () => {
2046
+ window.requestAnimationFrame(async () => {
2047
+ try {
2048
+ this._isLooping = true;
2049
+ this._isReplay = true;
2050
+ await this._provider.play();
2051
+ } catch (e) {
2052
+ this._isReplay = false;
2053
+ this._isLooping = false;
2054
+ }
2055
+ });
2056
+ });
2057
+ this._handleFullscreenChange = eventListener(
2058
+ this._host,
2059
+ "vds-fullscreen-change",
2060
+ (event) => {
2061
+ this._store.fullscreen.set(event.detail);
2062
+ if (event.target !== this._host)
2063
+ return;
2064
+ this._satisfyMediaRequest("fullscreen", event);
2065
+ this._provider?.dispatchEvent(
2066
+ vdsEvent("vds-fullscreen-change", {
2067
+ detail: event.detail,
2068
+ triggerEvent: event
2069
+ })
2070
+ );
2071
+ }
2072
+ );
2073
+ this._handleFullscreenError = eventListener(
2074
+ this._host,
2075
+ "vds-fullscreen-error",
2076
+ (event) => {
2077
+ if (event.target !== this._host)
2078
+ return;
2079
+ this._satisfyMediaRequest("fullscreen", event);
2080
+ this._provider?.dispatchEvent(
2081
+ vdsEvent("vds-fullscreen-error", {
2082
+ detail: event.detail,
2083
+ triggerEvent: event
2084
+ })
2085
+ );
2086
+ }
2087
+ );
2088
+ this._isReplay = false;
2089
+ this._isLooping = false;
2090
+ this._firingWaiting = false;
2091
+ this._mediaEvents = [];
2092
+ this._handleSeeking = functionThrottle(
2093
+ (event) => {
2094
+ this._mediaEvents.push(event);
2095
+ this._store.seeking.set(true);
2096
+ this._store.currentTime.set(event.detail);
2097
+ this._satisfyMediaRequest("seeking", event);
2098
+ },
2099
+ 150,
2100
+ { leading: true }
2101
+ );
2102
+ this._fireWaiting = functionDebounce(() => {
2103
+ if (!this._originalWaitingEvent)
2104
+ return;
2105
+ this._firingWaiting = true;
2106
+ const event = vdsEvent("vds-waiting", this._originalWaitingEvent);
2107
+ this._mediaEvents.push(event);
2108
+ this._store.waiting.set(true);
2109
+ this._store.playing.set(false);
2110
+ this._provider?.dispatchEvent(event);
2111
+ this._originalWaitingEvent = void 0;
2112
+ this._firingWaiting = false;
2113
+ }, 300);
2114
+ this._skipInitialSrcChange = true;
2115
+ discover(_host, mediaProviderDiscoveryId, (provider, onDisconnect) => {
2116
+ this.attachMediaProvider(provider, onDisconnect);
2117
+ });
2118
+ _host.addController({
2119
+ hostConnected: () => {
2120
+ if (!this.state.canPlay) {
2121
+ this._host.setAttribute("aria-busy", "true");
2122
+ }
2123
+ },
2124
+ hostDisconnected: () => {
2125
+ this._clearMediaStateTracking();
2126
+ this._clearPendingMediaRequests();
2127
+ this.providerQueue.destroy();
2128
+ this.providerDisposal.empty();
2129
+ this._skipInitialSrcChange = true;
2130
+ this._disconnectDisposal.empty();
2131
+ }
2132
+ });
2133
+ }
2134
+ get logLevel() {
2135
+ return this._logController?.logLevel ?? "silent";
2136
+ }
2137
+ set logLevel(level) {
2138
+ }
2139
+ get provider() {
2140
+ return this._provider;
2141
+ }
2142
+ attachMediaProvider(provider, onDisconnect) {
2143
+ if (!isNil(this.provider) || this.provider === provider)
2144
+ return;
2145
+ this._handleMediaProviderDisconnect();
2146
+ this._provider = provider;
2147
+ this._providerContext.value.set(provider);
2148
+ copyStoreRecords(this._provider._store, this._store);
2149
+ this._attachMediaEventListeners();
2150
+ provider.attachMediaController(this, (cb) => this._disconnectDisposal.add(cb));
2151
+ this._flushMediaProviderConnectedQueue();
2152
+ onDisconnect(this._handleMediaProviderDisconnect.bind(this));
2153
+ }
2154
+ _handleMediaProviderDisconnect() {
2155
+ if (isNil(this.provider))
2156
+ return;
2157
+ this._stopWaiting();
2158
+ this.providerQueue.destroy();
2159
+ this.providerDisposal.empty();
2160
+ this._provider = void 0;
2161
+ this._providerContext.value.set(void 0);
2162
+ resetMediaStore(this._store);
2163
+ this._store.viewType.set("unknown" /* Unknown */);
2164
+ }
2165
+ _flushMediaProviderConnectedQueue() {
2166
+ this.providerQueue.start();
2167
+ this.providerDisposal.add(() => {
2168
+ this.providerQueue.stop();
2169
+ });
2170
+ }
2171
+ get store() {
2172
+ return this._mediaStoreProvider.value;
2173
+ }
2174
+ get _store() {
2175
+ return this._mediaStoreProvider.value;
2176
+ }
2177
+ get idleDelay() {
2178
+ return this._userIdleController.delay;
2179
+ }
2180
+ set idleDelay(delay) {
2181
+ this._userIdleController.delay = delay;
2182
+ }
2183
+ _clearPendingMediaRequests() {
2184
+ keysOf(this._pendingMediaRequests).forEach((key) => {
2185
+ this._pendingMediaRequests[key] = [];
2186
+ });
2187
+ }
2188
+ _satisfyMediaRequest(type, event) {
2189
+ const requestEvent = this._pendingMediaRequests[type].shift();
2190
+ if (requestEvent) {
2191
+ event.requestEvent = requestEvent;
2192
+ appendTriggerEvent(event, requestEvent);
2193
+ }
2194
+ }
2195
+ _mediaRequestEventGateway(event) {
2196
+ event.stopPropagation();
2197
+ return true;
2198
+ }
2199
+ _createMediaRequestHandler(queueKey, callback) {
2200
+ return (event) => {
2201
+ if (!this._mediaRequestEventGateway(event))
2202
+ return;
2203
+ if (this._provider) {
2204
+ callback(event);
2205
+ return;
2206
+ }
2207
+ this.providerQueue.queue(queueKey, () => {
2208
+ callback(event);
2209
+ });
2210
+ };
2211
+ }
2212
+ _attachMediaEventListeners() {
2213
+ if (!this._provider)
2214
+ return;
2215
+ const mediaEventListeners = {
2216
+ "vds-can-load": this._handleCanLoad,
2217
+ "vds-load-start": this._handleLoadStart,
2218
+ "vds-loaded-data": this._handleLoadedData,
2219
+ "vds-loaded-metadata": this._handleLoadedMetadata,
2220
+ "vds-can-play": this._handleCanPlay,
2221
+ "vds-can-play-through": this._handleCanPlayThrough,
2222
+ "vds-current-src-change": this._handleCurrentSrcChange,
2223
+ "vds-autoplay": this._handleAutoplay,
2224
+ "vds-autoplay-fail": this._handleAutoplayFail,
2225
+ "vds-loop-request": this._handleLoopRequest,
2226
+ "vds-play": this._handlePlay,
2227
+ "vds-play-fail": this._handlePlayFail,
2228
+ "vds-playing": this._handlePlaying,
2229
+ "vds-pause": this._handlePause,
2230
+ "vds-time-update": this._handleTimeUpdate,
2231
+ "vds-volume-change": this._handleVolumeChange,
2232
+ "vds-seeking": this._handleSeeking,
2233
+ "vds-seeked": this._handleSeeked,
2234
+ "vds-waiting": this._handleWaiting,
2235
+ "vds-ended": this._handleEnded,
2236
+ "vds-autoplay-change": this._handleAutoplayChange,
2237
+ "vds-error": this._handleError,
2238
+ "vds-fullscreen-support-change": this._handleFullscreenSupportChange,
2239
+ "vds-poster-change": this._handlePosterChange,
2240
+ "vds-loop-change": this._handleLoopChange,
2241
+ "vds-playsinline-change": this._handlePlaysinlineChange,
2242
+ "vds-controls-change": this._handleControlsChange,
2243
+ "vds-media-type-change": this._handleMediaTypeChange,
2244
+ "vds-view-type-change": this._handleViewTypeChange,
2245
+ "vds-duration-change": this._handleDurationChange,
2246
+ "vds-progress": this._handleProgress,
2247
+ "vds-src-change": this._handleSrcChange
2248
+ };
2249
+ for (const eventType of keysOf(mediaEventListeners)) {
2250
+ const handler = mediaEventListeners[eventType].bind(this);
2251
+ this.providerDisposal.add(listen(this._provider, eventType, handler));
2252
+ }
2253
+ }
2254
+ _clearMediaStateTracking() {
2255
+ this._isReplay = false;
2256
+ this._isLooping = false;
2257
+ this._firingWaiting = false;
2258
+ this._originalWaitingEvent = void 0;
2259
+ this._mediaEvents = [];
2260
+ }
2261
+ _findLastMediaEvent(eventType) {
2262
+ return this._mediaEvents[this._mediaEvents.map((e) => e.type).lastIndexOf(eventType)];
2263
+ }
2264
+ _handleCanLoad(event) {
2265
+ this._store.canLoad.set(true);
2266
+ this._mediaEvents.push(event);
2267
+ this._satisfyMediaRequest("loading", event);
2268
+ }
2269
+ _updateMetadata(metadata) {
2270
+ this._store.currentSrc.set(metadata.currentSrc);
2271
+ this._store.mediaType.set(metadata.mediaType);
2272
+ this._store.viewType.set(metadata.viewType);
2273
+ }
2274
+ _handleLoadStart(event) {
2275
+ this._updateMetadata(event.detail);
2276
+ this._mediaEvents.push(event);
2277
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-src-change"));
2278
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-load"));
2279
+ }
2280
+ _handleLoadedData(event) {
2281
+ this._mediaEvents.push(event);
2282
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-load-start"));
2283
+ }
2284
+ _handleLoadedMetadata(event) {
2285
+ this._updateMetadata(event.detail);
2286
+ this._mediaEvents.push(event);
2287
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-load-start"));
2288
+ }
2289
+ _handleCanPlay(event) {
2290
+ this._mediaEvents.push(event);
2291
+ if (event.triggerEvent?.type !== "loadedmetadata") {
2292
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-loaded-metadata"));
2293
+ }
2294
+ this._store.canPlay.set(true);
2295
+ this._store.duration.set(event.detail.duration);
2296
+ this._host.setAttribute("aria-busy", "false");
2297
+ }
2298
+ _handleCanPlayThrough(event) {
2299
+ this._store.canPlay.set(true);
2300
+ this._store.duration.set(event.detail.duration);
2301
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-play"));
2302
+ }
2303
+ _handleAutoplay(event) {
2304
+ this._mediaEvents.push(event);
2305
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-play"));
2306
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-play"));
2307
+ this._store.autoplayError.set(void 0);
2308
+ }
2309
+ _handleAutoplayFail(event) {
2310
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-play-fail"));
2311
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-can-play"));
2312
+ this._store.autoplayError.set(event.detail);
2313
+ this._clearMediaStateTracking();
2314
+ }
2315
+ _handlePlay(event) {
2316
+ if (this._isLooping || !this.state.paused) {
2317
+ event.stopImmediatePropagation();
2318
+ return;
2319
+ }
2320
+ this._mediaEvents.push(event);
2321
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-waiting"));
2322
+ this._satisfyMediaRequest("play", event);
2323
+ this._store.paused.set(false);
2324
+ this._store.autoplayError.set(void 0);
2325
+ if (this.state.ended || this._isReplay) {
2326
+ this._isReplay = false;
2327
+ this._store.ended.set(false);
2328
+ const replayEvent = vdsEvent("vds-replay", {
2329
+ triggerEvent: event
2330
+ });
2331
+ this._provider?.dispatchEvent(replayEvent);
2332
+ }
2333
+ }
2334
+ _handlePlayFail(event) {
2335
+ this._mediaEvents.push(event);
2336
+ this._stopWaiting();
2337
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-play"));
2338
+ this._store.paused.set(true);
2339
+ this._store.playing.set(false);
2340
+ this._satisfyMediaRequest("play", event);
2341
+ this._clearMediaStateTracking();
2342
+ }
2343
+ _handlePlaying(event) {
2344
+ this._mediaEvents.push(event);
2345
+ const playEvent = this._findLastMediaEvent("vds-play");
2346
+ if (playEvent) {
2347
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-waiting"));
2348
+ appendTriggerEvent(event, playEvent);
2349
+ } else {
2350
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-seeked"));
2351
+ }
2352
+ this._stopWaiting();
2353
+ this._clearMediaStateTracking();
2354
+ this._store.paused.set(false);
2355
+ this._store.playing.set(true);
2356
+ this._store.seeking.set(false);
2357
+ this._store.ended.set(false);
2358
+ if (this._isLooping) {
2359
+ event.stopImmediatePropagation();
2360
+ this._isLooping = false;
2361
+ return;
2362
+ }
2363
+ if (!this.state.started) {
2364
+ this._store.started.set(true);
2365
+ this._provider?.dispatchEvent(vdsEvent("vds-started", { triggerEvent: event }));
2366
+ }
2367
+ }
2368
+ _handlePause(event) {
2369
+ if (this._isLooping) {
2370
+ event.stopImmediatePropagation();
2371
+ return;
2372
+ }
2373
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-seeked"));
2374
+ this._satisfyMediaRequest("pause", event);
2375
+ this._store.paused.set(true);
2376
+ this._store.playing.set(false);
2377
+ this._store.seeking.set(false);
2378
+ this._stopWaiting();
2379
+ this._clearMediaStateTracking();
2380
+ }
2381
+ _handleTimeUpdate(event) {
2382
+ const { currentTime, played } = event.detail;
2383
+ this._store.currentTime.set(currentTime);
2384
+ this._store.played.set(played);
2385
+ this._store.waiting.set(false);
2386
+ }
2387
+ _handleVolumeChange(event) {
2388
+ this._store.volume.set(event.detail.volume);
2389
+ this._store.muted.set(event.detail.muted || event.detail.volume === 0);
2390
+ this._satisfyMediaRequest("volume", event);
2391
+ }
2392
+ _handleSeeked(event) {
2393
+ if (this._isSeekingRequestPending) {
2394
+ this._store.seeking.set(true);
2395
+ event.stopImmediatePropagation();
2396
+ } else if (this.state.seeking) {
2397
+ this._mediaEvents.push(event);
2398
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-waiting"));
2399
+ appendTriggerEvent(event, this._findLastMediaEvent("vds-seeking"));
2400
+ if (this.state.paused) {
2401
+ this._stopWaiting();
2402
+ }
2403
+ this._store.seeking.set(false);
2404
+ if (event.detail !== this.state.duration) {
2405
+ this._store.ended.set(false);
2406
+ }
2407
+ this._store.currentTime.set(event.detail);
2408
+ this._satisfyMediaRequest("seeked", event);
2409
+ }
2410
+ }
2411
+ _stopWaiting() {
2412
+ this._fireWaiting.cancel();
2413
+ this._store.waiting.set(false);
2414
+ }
2415
+ _handleWaiting(event) {
2416
+ if (this._firingWaiting)
2417
+ return;
2418
+ event.stopImmediatePropagation();
2419
+ this._originalWaitingEvent = event;
2420
+ this._fireWaiting();
2421
+ }
2422
+ _handleEnded(event) {
2423
+ if (this._isLooping) {
2424
+ event.stopImmediatePropagation();
2425
+ return;
2426
+ }
2427
+ this._stopWaiting();
2428
+ this._store.paused.set(true);
2429
+ this._store.playing.set(false);
2430
+ this._store.seeking.set(false);
2431
+ this._store.ended.set(true);
2432
+ this._clearMediaStateTracking();
2433
+ }
2434
+ _handleAutoplayChange(event) {
2435
+ this._store.autoplay.set(event.detail);
2436
+ }
2437
+ _handleCurrentSrcChange(event) {
2438
+ this._store.currentSrc.set(event.detail);
2439
+ if (this._skipInitialSrcChange) {
2440
+ this._skipInitialSrcChange = false;
2441
+ return;
2442
+ }
2443
+ this._clearMediaStateTracking();
2444
+ softResetMediaStore(this._store);
2445
+ this._host.setAttribute("aria-busy", "true");
2446
+ }
2447
+ _handleError(event) {
2448
+ this._store.error.set(event.detail);
2449
+ }
2450
+ _handleFullscreenSupportChange(event) {
2451
+ this._store.canFullscreen.set(event.detail);
2452
+ }
2453
+ _handlePosterChange(event) {
2454
+ this._store.poster.set(event.detail);
2455
+ }
2456
+ _handleLoopChange(event) {
2457
+ this._store.loop.set(event.detail);
2458
+ }
2459
+ _handlePlaysinlineChange(event) {
2460
+ this._store.playsinline.set(event.detail);
2461
+ }
2462
+ _handleControlsChange(event) {
2463
+ this._store.controls.set(event.detail);
2464
+ }
2465
+ _handleMediaTypeChange(event) {
2466
+ this._store.mediaType.set(event.detail);
2467
+ }
2468
+ _handleDurationChange(event) {
2469
+ const duration = event.detail;
2470
+ this._store.duration.set(!isNaN(duration) ? duration : 0);
2471
+ }
2472
+ _handleProgress(event) {
2473
+ const { buffered, seekable } = event.detail;
2474
+ const bufferedAmount = buffered.length === 0 ? 0 : buffered.end(buffered.length - 1);
2475
+ const seekableAmount = seekable.length === 0 ? 0 : seekable.end(seekable.length - 1);
2476
+ this._store.buffered.set(buffered);
2477
+ this._store.bufferedAmount.set(bufferedAmount);
2478
+ this._store.seekable.set(seekable);
2479
+ this._store.seekableAmount.set(seekableAmount);
2480
+ }
2481
+ _handleSrcChange(event) {
2482
+ this._store.src.set(event.detail);
2483
+ }
2484
+ _handleViewTypeChange(event) {
2485
+ this._store.viewType.set(event.detail);
2486
+ }
2487
+ };
2488
+ var MediaStyleController = class {
2489
+ constructor(_host, _store, _mediaProps) {
2490
+ this._host = _host;
2491
+ this._store = _store;
2492
+ this._mediaProps = _mediaProps;
2493
+ this._disposal = new DisposalBin();
2494
+ this._host.addController({
2495
+ hostConnected: this._hostConnected.bind(this),
2496
+ hostDisconnected: this._hostDisconnected.bind(this)
2497
+ });
2498
+ }
2499
+ _hostConnected() {
2500
+ requestIdleCallback(() => {
2501
+ for (const propName of this._mediaProps) {
2502
+ const store = this._store[propName];
2503
+ if (store) {
2504
+ const attrName = this._getMediaAttrName(propName);
2505
+ const unsub = store.subscribe(($v) => {
2506
+ window?.requestAnimationFrame(() => {
2507
+ this._handleValueChange(propName, attrName, $v);
2508
+ });
2509
+ });
2510
+ this._disposal.add(unsub);
2511
+ }
2512
+ }
2513
+ });
2514
+ }
2515
+ _hostDisconnected() {
2516
+ for (const propName of this._mediaProps) {
2517
+ this._handleDisconnect(propName, this._getMediaAttrName(propName));
2518
+ }
2519
+ this._disposal.empty();
2520
+ }
2521
+ _getMediaAttrName(propName) {
2522
+ return camelToKebabCase(propName);
2523
+ }
2524
+ };
2525
+
2526
+ // src/media/style/MediaAttrsController.ts
2527
+ var MediaAttrsController = class extends MediaStyleController {
2528
+ _handleValueChange(_, attrName, value) {
2529
+ window.requestAnimationFrame(() => {
2530
+ setAttribute(
2531
+ this._host,
2532
+ attrName,
2533
+ isString(value) || isNumber(value) ? String(value) : !!value
2534
+ );
2535
+ });
2536
+ }
2537
+ _handleDisconnect(_, attrName) {
2538
+ this._host.removeAttribute(attrName);
2539
+ }
2540
+ };
2541
+ function bindMediaPropsToAttrs(...params) {
2542
+ return new MediaAttrsController(...params);
2543
+ }
2544
+ var MediaCssPropsController = class extends MediaStyleController {
2545
+ _handleValueChange(_, attrName, value) {
2546
+ window.requestAnimationFrame(() => {
2547
+ this._host.style.setProperty(
2548
+ this._getCssPropName(attrName),
2549
+ isString(value) || isNumber(value) ? String(value) : null
2550
+ );
2551
+ });
2552
+ }
2553
+ _getCssPropName(attrName) {
2554
+ return `--vds-${attrName}`;
2555
+ }
2556
+ _handleDisconnect(_, attrName) {
2557
+ this._host.style.setProperty(this._getCssPropName(attrName), null);
2558
+ }
2559
+ };
2560
+ function bindMediaPropsToCssProps(...params) {
2561
+ return new MediaCssPropsController(...params);
2562
+ }
2563
+
2564
+ // src/media/MediaElement.ts
2565
+ var mediaDiscoveryId = Symbol("@vidstack/media-discovery");
2566
+ var MediaElement = class extends s {
2567
+ constructor() {
2568
+ super();
2569
+ this.controller = new MediaController(this);
2570
+ this.__mediaFullscreen = false;
2571
+ this.__mediaIsVideoView = false;
2572
+ this.__mediaPlaysinline = false;
2573
+ this.screenOrientationController = new ScreenOrientationController(this);
2574
+ this.fullscreenController = new FullscreenController(this, this.screenOrientationController);
2575
+ discoverable(this, "vds-media-connect", { register: mediaDiscoveryId });
2576
+ mediaStoreSubscription(this, "fullscreen", ($fullscreen) => {
2577
+ this.__mediaFullscreen = $fullscreen;
2578
+ });
2579
+ mediaStoreSubscription(this, "viewType", ($viewType) => {
2580
+ this.__mediaIsVideoView = $viewType === "video" /* Video */;
2581
+ });
2582
+ mediaStoreSubscription(this, "playsinline", ($playsinline) => {
2583
+ this.__mediaPlaysinline = $playsinline;
2584
+ });
2585
+ this._bindMediaAttributes();
2586
+ this._bindMediaCSSProperties();
2587
+ }
2588
+ static get styles() {
2589
+ return [
2590
+ i$1`:host{display:inline-block;position:relative;contain:content}:host([hidden]){display:none}`
2591
+ ];
2592
+ }
2593
+ get provider() {
2594
+ return this.controller.provider;
2595
+ }
2596
+ update(changedProperties) {
2597
+ setAttribute(this, "hide-ui", this._shouldHideMediaUI());
2598
+ super.update(changedProperties);
2599
+ }
2600
+ render() {
2601
+ return y`<slot></slot>`;
2602
+ }
2603
+ get canFullscreen() {
2604
+ return this.fullscreenController.isSupported;
2605
+ }
2606
+ get fullscreen() {
2607
+ return this.fullscreenController.isFullscreen;
2608
+ }
2609
+ get fullscreenOrientation() {
2610
+ return this.fullscreenController.screenOrientationLock;
2611
+ }
2612
+ set fullscreenOrientation(lockType) {
2613
+ const prevLockType = this.fullscreenController.screenOrientationLock;
2614
+ if (prevLockType !== lockType) {
2615
+ this.fullscreenController.screenOrientationLock = lockType;
2616
+ this.requestUpdate("fullscreen-orientation", prevLockType);
2617
+ }
2618
+ }
2619
+ enterFullscreen() {
2620
+ return this.fullscreenController.enterFullscreen();
2621
+ }
2622
+ exitFullscreen() {
2623
+ return this.fullscreenController.exitFullscreen();
2624
+ }
2625
+ _bindMediaAttributes() {
2626
+ bindMediaPropsToAttrs(this, this.controller.store, [
2627
+ "autoplay",
2628
+ "autoplayError",
2629
+ "canLoad",
2630
+ "canPlay",
2631
+ "canFullscreen",
2632
+ "ended",
2633
+ "error",
2634
+ "fullscreen",
2635
+ "userIdle",
2636
+ "loop",
2637
+ "mediaType",
2638
+ "muted",
2639
+ "paused",
2640
+ "playing",
2641
+ "playsinline",
2642
+ "seeking",
2643
+ "started",
2644
+ "viewType",
2645
+ "waiting"
2646
+ ]);
2647
+ }
2648
+ _bindMediaCSSProperties() {
2649
+ bindMediaPropsToCssProps(this, this.controller.store, [
2650
+ "bufferedAmount",
2651
+ "currentTime",
2652
+ "duration",
2653
+ "seekableAmount"
2654
+ ]);
2655
+ }
2656
+ _shouldHideMediaUI() {
2657
+ return IS_IOS && this.__mediaIsVideoView && (!this.__mediaPlaysinline || this.__mediaFullscreen);
2658
+ }
2659
+ };
2660
+ __decorateClass([
2661
+ t()
2662
+ ], MediaElement.prototype, "__mediaFullscreen", 2);
2663
+ __decorateClass([
2664
+ t()
2665
+ ], MediaElement.prototype, "__mediaIsVideoView", 2);
2666
+ __decorateClass([
2667
+ t()
2668
+ ], MediaElement.prototype, "__mediaPlaysinline", 2);
2669
+ __decorateClass([
2670
+ e({ attribute: "fullscreen-orientation" })
2671
+ ], MediaElement.prototype, "fullscreenOrientation", 1);
2672
+
2673
+ safelyDefineCustomElement("vds-media", MediaElement);
2674
+
2675
+ var AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
2676
+ var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v|avi)($|\?)/i;
2677
+ function getMediaTypeFromExt(src) {
2678
+ if (AUDIO_EXTENSIONS.test(src))
2679
+ return "audio" /* Audio */;
2680
+ if (VIDEO_EXTENSIONS.test(src))
2681
+ return "video" /* Video */;
2682
+ return "unknown" /* Unknown */;
2683
+ }
2684
+ var Html5MediaElement = class extends MediaProviderElement {
2685
+ constructor() {
2686
+ super(...arguments);
2687
+ this.preload = "metadata";
2688
+ this._timeRAF = void 0;
2689
+ this._hasMediaElementConnected = false;
2690
+ this._mediaElementDisposal = new DisposalBin();
2691
+ this._isMediaWaiting = false;
2692
+ this._ignoreNextAbortEvent = false;
2693
+ this._ignoreNextEmptiedEvent = false;
2694
+ }
2695
+ get mediaElement() {
2696
+ return this._mediaElement;
2697
+ }
2698
+ disconnectedCallback() {
2699
+ this._isMediaWaiting = false;
2700
+ super.disconnectedCallback();
2701
+ this._cancelTimeUpdates();
2702
+ }
2703
+ destroy() {
2704
+ if (this.mediaElement) {
2705
+ this.mediaElement.pause();
2706
+ this.mediaElement.src = "";
2707
+ this.mediaElement.innerHTML = "";
2708
+ this.mediaElement.load();
2709
+ }
2710
+ super.destroy();
2711
+ }
2712
+ _cancelTimeUpdates() {
2713
+ if (isNumber(this._timeRAF))
2714
+ window.cancelAnimationFrame(this._timeRAF);
2715
+ this._timeRAF = void 0;
2716
+ }
2717
+ _requestTimeUpdates() {
2718
+ if (!isUndefined(this._timeRAF))
2719
+ return;
2720
+ this._requestTimeUpdate();
2721
+ }
2722
+ _requestTimeUpdate() {
2723
+ const newTime = this.mediaElement?.currentTime ?? 0;
2724
+ if (this.state.currentTime !== newTime) {
2725
+ this._updateCurrentTime(newTime);
2726
+ }
2727
+ this._timeRAF = window.requestAnimationFrame(() => {
2728
+ if (isUndefined(this._timeRAF))
2729
+ return;
2730
+ this._requestTimeUpdate();
2731
+ });
2732
+ }
2733
+ _updateCurrentTime(newTime, triggerEvent) {
2734
+ this.dispatchEvent(
2735
+ vdsEvent("vds-time-update", {
2736
+ detail: {
2737
+ currentTime: Math.min(newTime, this.mediaElement?.duration ?? 0),
2738
+ played: this.mediaElement.played
2739
+ },
2740
+ triggerEvent
2741
+ })
2742
+ );
2743
+ }
2744
+ handleDefaultSlotChange() {
2745
+ this._handleMediaElementDisconnect();
2746
+ this._handleMediaElementConnect();
2747
+ }
2748
+ get _canMediaElementConnect() {
2749
+ return this.canLoad && !isNil(this.mediaElement) && !this._hasMediaElementConnected;
2750
+ }
2751
+ _findSlottedMediaElement() {
2752
+ const mediaElement = getSlottedChildren(this)[0];
2753
+ const tagName = mediaElement?.tagName ?? "";
2754
+ if (!/^(audio|video)$/i.test(tagName)) ;
2755
+ this._mediaElement = mediaElement ?? void 0;
2756
+ }
2757
+ _handleMediaElementConnect() {
2758
+ window.requestAnimationFrame(() => {
2759
+ this._findSlottedMediaElement();
2760
+ if (!this._canMediaElementConnect)
2761
+ return;
2762
+ const mediaEl = this.mediaElement;
2763
+ if (mediaEl.hasAttribute("loop")) {
2764
+ this.loop = true;
2765
+ }
2766
+ mediaEl.removeAttribute("loop");
2767
+ mediaEl.removeAttribute("poster");
2768
+ setAttribute(mediaEl, "controls", this.controls);
2769
+ if (!this.state.canFullscreen && this.fullscreenController.isSupported) {
2770
+ this.dispatchEvent(
2771
+ vdsEvent("vds-fullscreen-support-change", {
2772
+ detail: this.canFullscreen
2773
+ })
2774
+ );
2775
+ }
2776
+ this._attachMediaEventListeners();
2777
+ this._observePlaysinline();
2778
+ this._observeMediaSources();
2779
+ if (this.canLoadPoster && this.poster.length > 0 && mediaEl.getAttribute("poster") !== this.poster) {
2780
+ mediaEl.setAttribute("poster", this.poster);
2781
+ }
2782
+ this._startPreloadingMedia();
2783
+ this._hasMediaElementConnected = true;
2784
+ this._disconnectDisposal.add(this._handleMediaElementDisconnect.bind(this));
2785
+ });
2786
+ }
2787
+ _handleMediaElementDisconnect() {
2788
+ this._cancelTimeUpdates();
2789
+ window.requestAnimationFrame(() => {
2790
+ this._mediaElementDisposal.empty();
2791
+ this._mediaElement = void 0;
2792
+ });
2793
+ if (this._hasMediaElementConnected && false) {
2794
+ this._logger?.infoGroup("Media element disconnected").labelledLog("Media Element", this.mediaElement).dispatch();
2795
+ }
2796
+ this._hasMediaElementConnected = false;
2797
+ }
2798
+ startLoadingMedia() {
2799
+ super.startLoadingMedia();
2800
+ this._handleMediaElementConnect();
2801
+ }
2802
+ _startPreloadingMedia() {
2803
+ if (this.state.canPlay)
2804
+ return;
2805
+ this.mediaElement.setAttribute("preload", this.preload);
2806
+ const isNetworkActive = this.mediaElement.networkState >= 1;
2807
+ this._ignoreNextAbortEvent = isNetworkActive;
2808
+ this._ignoreNextEmptiedEvent = isNetworkActive;
2809
+ this.mediaElement.load();
2810
+ setTimeout(() => {
2811
+ this._ignoreNextAbortEvent = false;
2812
+ this._ignoreNextEmptiedEvent = false;
2813
+ }, 0);
2814
+ }
2815
+ _observePlaysinline() {
2816
+ const isPlayingInline = () => this.mediaElement.hasAttribute("playsinline");
2817
+ this._handlePlaysinlineChange(isPlayingInline());
2818
+ const observer = new MutationObserver(() => this._handlePlaysinlineChange(isPlayingInline()));
2819
+ observer.observe(this.mediaElement, { attributeFilter: ["playsinline"] });
2820
+ this._mediaElementDisposal.add(() => observer.disconnect());
2821
+ }
2822
+ _handlePlaysinlineChange(playsinline) {
2823
+ this.dispatchEvent(vdsEvent("vds-playsinline-change", { detail: playsinline }));
2824
+ }
2825
+ _observeMediaSources() {
2826
+ this._handleSrcChange(this._getMediaSources());
2827
+ const observer = new MutationObserver(() => this._handleSrcChange(this._getMediaSources()));
2828
+ observer.observe(this.mediaElement, { attributeFilter: ["src"], subtree: true });
2829
+ this._mediaElementDisposal.add(() => observer.disconnect());
2830
+ }
2831
+ _handleSrcChange(sources) {
2832
+ const prevSources = this.state.src;
2833
+ if (!isScalarArrayEqual(prevSources, sources)) {
2834
+ this.dispatchEvent(vdsEvent("vds-src-change", { detail: sources }));
2835
+ }
2836
+ }
2837
+ _getMediaSources() {
2838
+ const resources = [
2839
+ this.mediaElement?.src,
2840
+ ...Array.from(this.mediaElement?.querySelectorAll("source") ?? []).map(
2841
+ (source) => source.src
2842
+ )
2843
+ ].filter(Boolean);
2844
+ return Array.from(new Set(resources));
2845
+ }
2846
+ _getMediaMetadata() {
2847
+ return {
2848
+ src: this.state.src,
2849
+ currentSrc: this.mediaElement.currentSrc,
2850
+ duration: this.mediaElement.duration || 0,
2851
+ poster: this.mediaElement.poster,
2852
+ mediaType: this._getMediaType(),
2853
+ viewType: this.state.viewType
2854
+ };
2855
+ }
2856
+ _attachMediaEventListeners() {
2857
+ if (isNil(this.mediaElement))
2858
+ return;
2859
+ const mediaEventListeners = {
2860
+ abort: this._handleAbort,
2861
+ canplay: this._handleCanPlay,
2862
+ canplaythrough: this._handleCanPlayThrough,
2863
+ durationchange: this._handleDurationChange,
2864
+ emptied: this._handleEmptied,
2865
+ ended: this._handleEnded,
2866
+ error: this._handleError,
2867
+ loadeddata: this._handleLoadedData,
2868
+ loadedmetadata: this._handleLoadedMetadata,
2869
+ loadstart: this._handleLoadStart,
2870
+ pause: this._handlePause,
2871
+ play: this._handlePlay,
2872
+ playing: this._handlePlaying,
2873
+ progress: this._handleProgress,
2874
+ ratechange: this._handleRateChange,
2875
+ seeked: this._handleSeeked,
2876
+ seeking: this._handleSeeking,
2877
+ stalled: this._handleStalled,
2878
+ suspend: this._handleSuspend,
2879
+ volumechange: this._handleVolumeChange,
2880
+ waiting: this._handleWaiting
2881
+ };
2882
+ keysOf(mediaEventListeners).forEach((type) => {
2883
+ const handler = mediaEventListeners[type].bind(this);
2884
+ const off = listen(this.mediaElement, type, async (event) => {
2885
+ await handler(event);
2886
+ });
2887
+ this._mediaElementDisposal.add(off);
2888
+ });
2889
+ }
2890
+ _handleAbort(event) {
2891
+ if (this._ignoreNextAbortEvent)
2892
+ return;
2893
+ this.dispatchEvent(vdsEvent("vds-abort", { triggerEvent: event }));
2894
+ this._handleCurrentSrcChange("", event);
2895
+ }
2896
+ _handleCanPlay(event) {
2897
+ this._handleMediaReady({ event, duration: this.mediaElement.duration });
2898
+ }
2899
+ _handleCanPlayThrough(event) {
2900
+ if (this.state.started)
2901
+ return;
2902
+ this.dispatchEvent(
2903
+ vdsEvent("vds-can-play-through", {
2904
+ triggerEvent: event,
2905
+ detail: { duration: this.mediaElement.duration }
2906
+ })
2907
+ );
2908
+ }
2909
+ _handleLoadStart(event) {
2910
+ this._handleCurrentSrcChange(this.mediaElement.currentSrc, event);
2911
+ if (this.mediaElement.currentSrc === "") {
2912
+ this._handleAbort();
2913
+ return;
2914
+ }
2915
+ this.dispatchEvent(
2916
+ vdsEvent("vds-load-start", {
2917
+ triggerEvent: event,
2918
+ detail: this._getMediaMetadata()
2919
+ })
2920
+ );
2921
+ }
2922
+ _handleEmptied(event) {
2923
+ if (this._ignoreNextEmptiedEvent)
2924
+ return;
2925
+ this.dispatchEvent(vdsEvent("vds-emptied", { triggerEvent: event }));
2926
+ }
2927
+ _handleLoadedData(event) {
2928
+ this.dispatchEvent(vdsEvent("vds-loaded-data", { triggerEvent: event }));
2929
+ }
2930
+ _handleLoadedMetadata(event) {
2931
+ this.dispatchEvent(
2932
+ vdsEvent("vds-volume-change", {
2933
+ detail: {
2934
+ volume: this.mediaElement.volume,
2935
+ muted: this.mediaElement.muted
2936
+ }
2937
+ })
2938
+ );
2939
+ this.dispatchEvent(
2940
+ vdsEvent("vds-loaded-metadata", {
2941
+ triggerEvent: event,
2942
+ detail: this._getMediaMetadata()
2943
+ })
2944
+ );
2945
+ }
2946
+ _determineMediaType(event) {
2947
+ this.dispatchEvent(
2948
+ vdsEvent("vds-media-type-change", {
2949
+ detail: this._getMediaType(),
2950
+ triggerEvent: event
2951
+ })
2952
+ );
2953
+ }
2954
+ _handlePlay(event) {
2955
+ const playEvent = vdsEvent("vds-play", { triggerEvent: event });
2956
+ playEvent.autoplay = this._attemptingAutoplay;
2957
+ this.dispatchEvent(playEvent);
2958
+ }
2959
+ _handlePause(event) {
2960
+ if (this.mediaElement.readyState === 1 && !this._isMediaWaiting) {
2961
+ return;
2962
+ }
2963
+ this._isMediaWaiting = false;
2964
+ this._cancelTimeUpdates();
2965
+ this.dispatchEvent(vdsEvent("vds-pause", { triggerEvent: event }));
2966
+ }
2967
+ _handlePlaying(event) {
2968
+ this._isMediaWaiting = false;
2969
+ const playingEvent = vdsEvent("vds-playing", { triggerEvent: event });
2970
+ this.dispatchEvent(playingEvent);
2971
+ this._requestTimeUpdates();
2972
+ }
2973
+ _handleDurationChange(event) {
2974
+ if (this.mediaElement.ended) {
2975
+ this._updateCurrentTime(this.mediaElement.duration, event);
2976
+ }
2977
+ this.dispatchEvent(
2978
+ vdsEvent("vds-duration-change", {
2979
+ detail: this.mediaElement.duration,
2980
+ triggerEvent: event
2981
+ })
2982
+ );
2983
+ }
2984
+ _handleProgress(event) {
2985
+ this.dispatchEvent(
2986
+ vdsEvent("vds-progress", {
2987
+ triggerEvent: event,
2988
+ detail: {
2989
+ buffered: this.mediaElement.buffered,
2990
+ seekable: this.mediaElement.seekable
2991
+ }
2992
+ })
2993
+ );
2994
+ }
2995
+ _handleRateChange(event) {
2996
+ throw Error("Not implemented");
2997
+ }
2998
+ _handleSeeking(event) {
2999
+ this.dispatchEvent(
3000
+ vdsEvent("vds-seeking", {
3001
+ detail: this.mediaElement.currentTime,
3002
+ triggerEvent: event
3003
+ })
3004
+ );
3005
+ }
3006
+ _handleSeeked(event) {
3007
+ const seekedEvent = vdsEvent("vds-seeked", {
3008
+ detail: this.mediaElement.currentTime,
3009
+ triggerEvent: event
3010
+ });
3011
+ this.dispatchEvent(seekedEvent);
3012
+ const currentTime = this.mediaElement.currentTime;
3013
+ if (Math.trunc(currentTime) === Math.trunc(this.mediaElement.duration) && getNumberOfDecimalPlaces(this.mediaElement.duration) > getNumberOfDecimalPlaces(currentTime)) {
3014
+ this._updateCurrentTime(this.mediaElement.duration, event);
3015
+ if (!this.mediaElement.ended) {
3016
+ try {
3017
+ this.play();
3018
+ } catch (e) {
3019
+ }
3020
+ }
3021
+ }
3022
+ }
3023
+ _handleStalled(event) {
3024
+ this.dispatchEvent(vdsEvent("vds-stalled", { triggerEvent: event }));
3025
+ if (this.mediaElement.readyState < 3) {
3026
+ this._isMediaWaiting = true;
3027
+ this.dispatchEvent(vdsEvent("vds-waiting", { triggerEvent: event }));
3028
+ }
3029
+ }
3030
+ _handleVolumeChange(event) {
3031
+ this.dispatchEvent(
3032
+ vdsEvent("vds-volume-change", {
3033
+ detail: {
3034
+ volume: this.mediaElement.volume,
3035
+ muted: this.mediaElement.muted
3036
+ },
3037
+ triggerEvent: event
3038
+ })
3039
+ );
3040
+ }
3041
+ _handleWaiting(event) {
3042
+ if (this.mediaElement.readyState < 3) {
3043
+ this._isMediaWaiting = true;
3044
+ this.dispatchEvent(vdsEvent("vds-waiting", { triggerEvent: event }));
3045
+ }
3046
+ }
3047
+ _handleSuspend(event) {
3048
+ const suspendEvent = vdsEvent("vds-suspend", { triggerEvent: event });
3049
+ this.dispatchEvent(suspendEvent);
3050
+ }
3051
+ _handleEnded(event) {
3052
+ this._cancelTimeUpdates();
3053
+ this._updateCurrentTime(this.mediaElement.duration, event);
3054
+ const endEvent = vdsEvent("vds-end", { triggerEvent: event });
3055
+ this.dispatchEvent(endEvent);
3056
+ if (this.state.loop) {
3057
+ this._handleLoop();
3058
+ } else {
3059
+ this.dispatchEvent(vdsEvent("vds-ended", { triggerEvent: event }));
3060
+ }
3061
+ }
3062
+ _handleLoop() {
3063
+ const hasCustomControls = isNil(this.controls);
3064
+ if (hasCustomControls) {
3065
+ this.mediaElement.controls = false;
3066
+ }
3067
+ this.dispatchEvent(vdsEvent("vds-loop-request"));
3068
+ }
3069
+ _handleError(event) {
3070
+ const mediaError = this.mediaElement.error;
3071
+ if (!mediaError)
3072
+ return;
3073
+ this.dispatchEvent(
3074
+ vdsEvent("vds-error", {
3075
+ detail: {
3076
+ message: mediaError.message,
3077
+ code: mediaError.code,
3078
+ mediaError
3079
+ },
3080
+ triggerEvent: event
3081
+ })
3082
+ );
3083
+ }
3084
+ _getPaused() {
3085
+ return this.mediaElement?.paused ?? true;
3086
+ }
3087
+ _getVolume() {
3088
+ return this.mediaElement?.volume ?? 1;
3089
+ }
3090
+ _setVolume(newVolume) {
3091
+ this.mediaElement.volume = newVolume;
3092
+ }
3093
+ _getCurrentTime() {
3094
+ return this.mediaElement?.currentTime ?? 0;
3095
+ }
3096
+ _setCurrentTime(newTime) {
3097
+ if (this.mediaElement.currentTime !== newTime) {
3098
+ this.mediaElement.currentTime = newTime;
3099
+ }
3100
+ }
3101
+ _getMuted() {
3102
+ return this.mediaElement?.muted ?? false;
3103
+ }
3104
+ _setMuted(isMuted) {
3105
+ this.mediaElement.muted = isMuted;
3106
+ }
3107
+ async play() {
3108
+ try {
3109
+ this._throwIfNotReadyForPlayback();
3110
+ await this._resetPlaybackIfEnded();
3111
+ return this.mediaElement?.play();
3112
+ } catch (error) {
3113
+ const playErrorEvent = vdsEvent("vds-play-fail");
3114
+ playErrorEvent.autoplay = this._attemptingAutoplay;
3115
+ playErrorEvent.error = error;
3116
+ throw error;
3117
+ }
3118
+ }
3119
+ async pause() {
3120
+ return this.mediaElement?.pause();
3121
+ }
3122
+ _getMediaType() {
3123
+ return getMediaTypeFromExt(this.state.currentSrc);
3124
+ }
3125
+ };
3126
+ __decorateClass([
3127
+ e()
3128
+ ], Html5MediaElement.prototype, "preload", 2);
3129
+
3130
+ var AudioElement = class extends Html5MediaElement {
3131
+ static get styles() {
3132
+ return [
3133
+ i$1`:host{display:inline-block}:host([hidden]){display:none}`
3134
+ ];
3135
+ }
3136
+ connectedCallback() {
3137
+ super.connectedCallback();
3138
+ this.dispatchEvent(
3139
+ vdsEvent("vds-view-type-change", {
3140
+ detail: "audio" /* Audio */
3141
+ })
3142
+ );
3143
+ }
3144
+ };
3145
+
3146
+ safelyDefineCustomElement("vds-audio", AudioElement);
3147
+
3148
+ var toggleButtonElementStyles = i$1`:host{display:table;contain:content;user-select:none;cursor:pointer;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}:host(:focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}:host(.focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}`;
3149
+
3150
+ // src/ui/toggle-button/ToggleButtonElement.ts
3151
+ var ToggleButtonElement = class extends s {
3152
+ constructor() {
3153
+ super();
3154
+ this.pressed = false;
3155
+ this.disabled = false;
3156
+ this._handleButtonClickCapture = eventListener(
3157
+ this,
3158
+ "click",
3159
+ (event) => {
3160
+ if (this.disabled) {
3161
+ event.preventDefault();
3162
+ event.stopImmediatePropagation();
3163
+ }
3164
+ },
3165
+ { capture: true }
3166
+ );
3167
+ focusVisiblePolyfill(this);
3168
+ ["pointerup", "keydown"].forEach((eventType) => {
3169
+ eventListener(this, eventType, (event) => {
3170
+ if (this.disabled || isKeyboardEvent(event) && !isKeyboardClick(event)) {
3171
+ return;
3172
+ }
3173
+ this._handleButtonClick(event);
3174
+ });
3175
+ });
3176
+ }
3177
+ static get styles() {
3178
+ return [toggleButtonElementStyles];
3179
+ }
3180
+ static get parts() {
3181
+ return [];
3182
+ }
3183
+ connectedCallback() {
3184
+ super.connectedCallback();
3185
+ setAttributeIfEmpty(this, "tabindex", "0");
3186
+ setAttributeIfEmpty(this, "role", "button");
3187
+ this._updateAriaPressedAttr();
3188
+ }
3189
+ updated(changedProperties) {
3190
+ if (changedProperties.has("pressed")) {
3191
+ this._updateAriaPressedAttr();
3192
+ }
3193
+ }
3194
+ _updateAriaPressedAttr() {
3195
+ setAttribute(this, "aria-pressed", this.pressed ? "true" : "false");
3196
+ }
3197
+ render() {
3198
+ return this._renderDefaultSlot();
3199
+ }
3200
+ _renderDefaultSlot() {
3201
+ return y`<slot></slot>`;
3202
+ }
3203
+ _handleButtonClick(event) {
3204
+ this.pressed = !this.pressed;
3205
+ }
3206
+ };
3207
+ __decorateClass([
3208
+ e({ type: Boolean })
3209
+ ], ToggleButtonElement.prototype, "pressed", 2);
3210
+ __decorateClass([
3211
+ e({ type: Boolean, reflect: true })
3212
+ ], ToggleButtonElement.prototype, "disabled", 2);
3213
+
3214
+ // src/media/interact/MediaRemoteControl.ts
3215
+ var MediaRemoteControl = class {
3216
+ constructor(_host) {
3217
+ if (_host) {
3218
+ this._target = _host;
3219
+ this._createLogger(_host);
3220
+ this._requests = hostRequestQueue(_host);
3221
+ } else {
3222
+ this._requests = new RequestQueue();
3223
+ }
3224
+ }
3225
+ startLoading(triggerEvent) {
3226
+ this._dispatchRequest("vds-start-loading", { triggerEvent });
3227
+ }
3228
+ play(triggerEvent) {
3229
+ this._dispatchRequest("vds-play-request", { triggerEvent });
3230
+ }
3231
+ pause(triggerEvent) {
3232
+ this._dispatchRequest("vds-pause-request", { triggerEvent });
3233
+ }
3234
+ mute(triggerEvent) {
3235
+ this._dispatchRequest("vds-mute-request", { triggerEvent });
3236
+ }
3237
+ unmute(triggerEvent) {
3238
+ this._dispatchRequest("vds-unmute-request", { triggerEvent });
3239
+ }
3240
+ enterFullscreen(target, triggerEvent) {
3241
+ this._dispatchRequest("vds-enter-fullscreen-request", {
3242
+ triggerEvent,
3243
+ detail: target
3244
+ });
3245
+ }
3246
+ exitFullscreen(target, triggerEvent) {
3247
+ this._dispatchRequest("vds-exit-fullscreen-request", {
3248
+ triggerEvent,
3249
+ detail: target
3250
+ });
3251
+ }
3252
+ seeking(time, triggerEvent) {
3253
+ this._dispatchRequest("vds-seeking-request", {
3254
+ detail: time,
3255
+ triggerEvent
3256
+ });
3257
+ }
3258
+ seek(time, triggerEvent) {
3259
+ this._dispatchRequest("vds-seek-request", {
3260
+ detail: time,
3261
+ triggerEvent
3262
+ });
3263
+ }
3264
+ changeVolume(volume, triggerEvent) {
3265
+ this._dispatchRequest("vds-volume-change-request", {
3266
+ detail: volume,
3267
+ triggerEvent
3268
+ });
3269
+ }
3270
+ resumeUserIdle(triggerEvent) {
3271
+ this._dispatchRequest("vds-resume-user-idle-request", { triggerEvent });
3272
+ }
3273
+ pauseUserIdle(triggerEvent) {
3274
+ this._dispatchRequest("vds-pause-user-idle-request", { triggerEvent });
3275
+ }
3276
+ showPoster(triggerEvent) {
3277
+ this._dispatchRequest("vds-show-poster-request", { triggerEvent });
3278
+ }
3279
+ hidePoster(triggerEvent) {
3280
+ this._dispatchRequest("vds-hide-poster-request", { triggerEvent });
3281
+ }
3282
+ setTarget(target) {
3283
+ if (this._target === target)
3284
+ return;
3285
+ this._target = target;
3286
+ if (target) {
3287
+ this._createLogger(target);
3288
+ this._requests.start();
3289
+ } else {
3290
+ this._requests.stop();
3291
+ }
3292
+ }
3293
+ _dispatchRequest(type, eventInit) {
3294
+ this._requests.queue(type, () => {
3295
+ const request = vdsEvent(type, {
3296
+ ...eventInit,
3297
+ bubbles: true,
3298
+ composed: true
3299
+ });
3300
+ this._target?.dispatchEvent(request);
3301
+ });
3302
+ }
3303
+ _createLogger(target) {
3304
+ }
3305
+ };
3306
+
3307
+ var PlayButtonElement = class extends ToggleButtonElement {
3308
+ constructor() {
3309
+ super();
3310
+ this._mediaRemote = new MediaRemoteControl(this);
3311
+ mediaStoreSubscription(this, "paused", ($paused) => {
3312
+ this.pressed = !$paused;
3313
+ setAttribute(this, "paused", $paused);
3314
+ });
3315
+ }
3316
+ connectedCallback() {
3317
+ super.connectedCallback();
3318
+ setAttributeIfEmpty(this, "aria-label", "Play");
3319
+ }
3320
+ _handleButtonClick(event) {
3321
+ if (this.disabled)
3322
+ return;
3323
+ if (this.pressed) {
3324
+ this._mediaRemote.pause(event);
3325
+ } else {
3326
+ this._mediaRemote.play(event);
3327
+ }
3328
+ }
3329
+ };
3330
+
3331
+ safelyDefineCustomElement("vds-play-button", PlayButtonElement);
3332
+
3333
+ var MuteButtonElement = class extends ToggleButtonElement {
3334
+ constructor() {
3335
+ super();
3336
+ this._mediaRemote = new MediaRemoteControl(this);
3337
+ this._volume = 1;
3338
+ this._muted = false;
3339
+ mediaStoreSubscription(this, "volume", ($volume) => {
3340
+ this._volume = $volume;
3341
+ this._handleMutedChange();
3342
+ });
3343
+ mediaStoreSubscription(this, "muted", ($muted) => {
3344
+ this._muted = $muted;
3345
+ this._handleMutedChange();
3346
+ });
3347
+ }
3348
+ connectedCallback() {
3349
+ super.connectedCallback();
3350
+ setAttributeIfEmpty(this, "aria-label", "Mute");
3351
+ }
3352
+ _handleMutedChange() {
3353
+ const muted = this._muted || this._volume === 0;
3354
+ this.pressed = muted;
3355
+ setAttribute(this, "muted", muted);
3356
+ }
3357
+ _handleButtonClick(event) {
3358
+ if (this.disabled)
3359
+ return;
3360
+ if (this.pressed) {
3361
+ this._mediaRemote.unmute(event);
3362
+ } else {
3363
+ this._mediaRemote.mute(event);
3364
+ }
3365
+ }
3366
+ };
3367
+
3368
+ safelyDefineCustomElement("vds-mute-button", MuteButtonElement);
3369
+
3370
+ // src/ui/slider/store.ts
3371
+ function createSliderStore() {
3372
+ const dragging = writable(false);
3373
+ const pointing = writable(false);
3374
+ return {
3375
+ value: writable(50),
3376
+ pointerValue: writable(0),
3377
+ min: writable(0),
3378
+ max: writable(100),
3379
+ dragging,
3380
+ pointing,
3381
+ interactive: derived([dragging, pointing], ([$dragging, $pointing]) => $dragging || $pointing)
3382
+ };
3383
+ }
3384
+ var sliderStoreContext = createContext(createSliderStore);
3385
+
3386
+ var sliderElementStyles = i$1`*{box-sizing:border-box;touch-action:none}:host{display:block;contain:layout;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}:host([hidden]){display:none}:host(:focus){outline:0}:host(:focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}:host(.focus-visible){outline:1px auto Highlight;outline:1px auto -webkit-focus-ring-color}`;
3387
+
3388
+ // src/ui/slider/SliderElement.ts
3389
+ var SliderKeyDirection = /* @__PURE__ */ ((SliderKeyDirection2) => {
3390
+ SliderKeyDirection2[SliderKeyDirection2["Left"] = -1] = "Left";
3391
+ SliderKeyDirection2[SliderKeyDirection2["ArrowLeft"] = -1] = "ArrowLeft";
3392
+ SliderKeyDirection2[SliderKeyDirection2["Up"] = -1] = "Up";
3393
+ SliderKeyDirection2[SliderKeyDirection2["ArrowUp"] = -1] = "ArrowUp";
3394
+ SliderKeyDirection2[SliderKeyDirection2["Right"] = 1] = "Right";
3395
+ SliderKeyDirection2[SliderKeyDirection2["ArrowRight"] = 1] = "ArrowRight";
3396
+ SliderKeyDirection2[SliderKeyDirection2["Down"] = 1] = "Down";
3397
+ SliderKeyDirection2[SliderKeyDirection2["ArrowDown"] = 1] = "ArrowDown";
3398
+ return SliderKeyDirection2;
3399
+ })(SliderKeyDirection || {});
3400
+ var SliderElement = class extends s {
3401
+ constructor() {
3402
+ super();
3403
+ this._sliderStoreProvider = sliderStoreContext.provide(this);
3404
+ this.disabled = false;
3405
+ this.value = 50;
3406
+ this._step = 1;
3407
+ this._keyboardStep = 1;
3408
+ this.shiftKeyMultiplier = 5;
3409
+ this.customValueText = false;
3410
+ this._mediaRemote = new MediaRemoteControl(this);
3411
+ this._disconnectDisposal = new DisposalBin();
3412
+ this._handlePointerEnter = eventListener(this, "pointerenter", () => {
3413
+ if (this.disabled)
3414
+ return;
3415
+ this.setAttribute("pointing", "");
3416
+ this.store.pointing.set(true);
3417
+ });
3418
+ this._handlePointerMove = eventListener(this, "pointermove", (event) => {
3419
+ if (this.disabled || this.isDragging)
3420
+ return;
3421
+ const value = this._getValueBasedOnThumbPosition(event);
3422
+ this.store.pointerValue.set(value);
3423
+ this._dispatchPointerValueChange(event);
3424
+ });
3425
+ this._handlePointerLeave = eventListener(this, "pointerleave", () => {
3426
+ if (this.disabled)
3427
+ return;
3428
+ this.removeAttribute("pointing");
3429
+ this.store.pointing.set(false);
3430
+ });
3431
+ this._handlePointerDown = eventListener(this, "pointerdown", (event) => {
3432
+ if (this.disabled)
3433
+ return;
3434
+ this._startDragging(event);
3435
+ this._onDrag(event);
3436
+ });
3437
+ this._handleKeydown = eventListener(this, "keydown", (event) => {
3438
+ if (this.disabled)
3439
+ return;
3440
+ const { key, shiftKey } = event;
3441
+ const isValidKey = Object.keys(SliderKeyDirection).includes(key);
3442
+ if (!isValidKey)
3443
+ return;
3444
+ const modifiedStep = !shiftKey ? this.keyboardStep : this.keyboardStep * this.shiftKeyMultiplier;
3445
+ const direction = Number(SliderKeyDirection[key]);
3446
+ const diff = modifiedStep * direction;
3447
+ const steps = (this.value + diff) / this.step;
3448
+ const value = this.step * steps;
3449
+ this.value = this._getClampedValue(value);
3450
+ this._dispatchValueChange(event);
3451
+ });
3452
+ this._handleFillValueChange = eventListener(
3453
+ this,
3454
+ "vds-slider-value-change",
3455
+ this._updateFillCSSProps.bind(this)
3456
+ );
3457
+ this._handlePointerValueChange = eventListener(
3458
+ this,
3459
+ "vds-slider-pointer-value-change",
3460
+ this._updatePointerCSSProps.bind(this)
3461
+ );
3462
+ this._onDrag = rafThrottle((event) => {
3463
+ if (this.disabled || !this.isDragging)
3464
+ return;
3465
+ const value = this._getValueBasedOnThumbPosition(event);
3466
+ this.store.pointerValue.set(value);
3467
+ this._dispatchPointerValueChange(event);
3468
+ });
3469
+ this._handleDocumentPointerUp = eventListener(
3470
+ this,
3471
+ "pointerup",
3472
+ (event) => {
3473
+ if (this.disabled || !this.isDragging)
3474
+ return;
3475
+ this._stopDragging(event);
3476
+ },
3477
+ { target: document }
3478
+ );
3479
+ this._handleDocumentTouchMove = eventListener(
3480
+ this,
3481
+ "touchmove",
3482
+ (event) => {
3483
+ if (this.disabled || !this.isDragging)
3484
+ return;
3485
+ event.preventDefault();
3486
+ },
3487
+ { target: document, passive: false }
3488
+ );
3489
+ this._handleDocumentPointerMove = eventListener(
3490
+ this,
3491
+ "pointermove",
3492
+ (event) => {
3493
+ if (this.disabled || !this.isDragging)
3494
+ return;
3495
+ this._onDrag(event);
3496
+ },
3497
+ { target: document }
3498
+ );
3499
+ this._lastDispatchedValue = this.value;
3500
+ this._dispatchValueChange = rafThrottle((event) => {
3501
+ if (this.value === this._lastDispatchedValue)
3502
+ return;
3503
+ this.dispatchEvent(
3504
+ vdsEvent("vds-slider-value-change", {
3505
+ detail: this.value,
3506
+ triggerEvent: event
3507
+ })
3508
+ );
3509
+ this._lastDispatchedValue = this.value;
3510
+ });
3511
+ this._lastDispatchedPointerValue = this.pointerValue;
3512
+ this._dispatchPointerValueChange = rafThrottle((event) => {
3513
+ if (this.pointerValue === this._lastDispatchedPointerValue)
3514
+ return;
3515
+ const events = [
3516
+ "vds-slider-pointer-value-change",
3517
+ this.isDragging && "vds-slider-drag-value-change"
3518
+ ];
3519
+ events.forEach((eventType) => {
3520
+ if (eventType) {
3521
+ this.dispatchEvent(
3522
+ vdsEvent(eventType, {
3523
+ detail: this.pointerValue,
3524
+ triggerEvent: event
3525
+ })
3526
+ );
3527
+ }
3528
+ });
3529
+ this._lastDispatchedPointerValue = this.pointerValue;
3530
+ });
3531
+ focusVisiblePolyfill(this);
3532
+ }
3533
+ static get styles() {
3534
+ return [sliderElementStyles];
3535
+ }
3536
+ static get parts() {
3537
+ return [];
3538
+ }
3539
+ get store() {
3540
+ return this._sliderStoreProvider.value;
3541
+ }
3542
+ get min() {
3543
+ return getStoreValue(this.store.min);
3544
+ }
3545
+ set min(newMin) {
3546
+ this.store.min.set(newMin);
3547
+ }
3548
+ get max() {
3549
+ return getStoreValue(this.store.max);
3550
+ }
3551
+ set max(newMax) {
3552
+ this.store.max.set(newMax);
3553
+ }
3554
+ get step() {
3555
+ return this._step;
3556
+ }
3557
+ set step(newStep) {
3558
+ this._step = newStep;
3559
+ }
3560
+ get keyboardStep() {
3561
+ return this._keyboardStep;
3562
+ }
3563
+ set keyboardStep(newStep) {
3564
+ this._keyboardStep = newStep;
3565
+ }
3566
+ get isDragging() {
3567
+ return getStoreValue(this.store.dragging);
3568
+ }
3569
+ get fillRate() {
3570
+ const range = this.max - this.min, offset = this.value - this.min;
3571
+ return range > 0 ? offset / range : 0;
3572
+ }
3573
+ get fillPercent() {
3574
+ return this.fillRate * 100;
3575
+ }
3576
+ get pointerValue() {
3577
+ return getStoreValue(this.store.pointerValue);
3578
+ }
3579
+ get pointerRate() {
3580
+ const range = this.max - this.min, offset = this.pointerValue - this.min;
3581
+ return range > 0 ? offset / range : 0;
3582
+ }
3583
+ get pointerPercent() {
3584
+ return this.pointerRate * 100;
3585
+ }
3586
+ connectedCallback() {
3587
+ super.connectedCallback();
3588
+ this._setupAriaAttrs();
3589
+ this._updateFillCSSProps();
3590
+ this._updatePointerCSSProps();
3591
+ this._disconnectDisposal.add(
3592
+ this.store.interactive.subscribe(($interactive) => {
3593
+ setAttribute(this, "interactive", $interactive);
3594
+ })
3595
+ );
3596
+ }
3597
+ willUpdate(changedProperties) {
3598
+ if (changedProperties.has("value") || changedProperties.has("min") || changedProperties.has("max")) {
3599
+ this.value = this._getClampedValue(this.value);
3600
+ this.store.value.set(this.value);
3601
+ this._updateFillCSSProps();
3602
+ this._dispatchValueChange();
3603
+ }
3604
+ if (changedProperties.has("disabled") && this.disabled) {
3605
+ this.store.dragging.set(false);
3606
+ this.store.pointing.set(false);
3607
+ this.removeAttribute("dragging");
3608
+ this.removeAttribute("pointing");
3609
+ this.removeAttribute("interactive");
3610
+ setAttribute(this, "aria-disabled", this.disabled);
3611
+ }
3612
+ if (!this.customValueText) {
3613
+ this._updateAriaValueAttrs();
3614
+ }
3615
+ super.willUpdate(changedProperties);
3616
+ }
3617
+ disconnectedCallback() {
3618
+ this._onDrag.cancel();
3619
+ this._disconnectDisposal.empty();
3620
+ super.disconnectedCallback();
3621
+ }
3622
+ _updateFillCSSProps() {
3623
+ setCSSProperty(this, "fill-value", `${this.value}`);
3624
+ setCSSProperty(this, "fill-rate", `${this.fillRate}`);
3625
+ setCSSProperty(this, "fill-percent", `${this.fillPercent}%`);
3626
+ }
3627
+ _updatePointerCSSProps() {
3628
+ setCSSProperty(this, "pointer-value", `${this.pointerValue}`);
3629
+ setCSSProperty(this, "pointer-rate", `${this.pointerRate}`);
3630
+ setCSSProperty(this, "pointer-percent", `${this.pointerPercent}%`);
3631
+ }
3632
+ render() {
3633
+ return this._renderSlider();
3634
+ }
3635
+ _renderSlider() {
3636
+ return y`${this._renderDefaultSlot()}`;
3637
+ }
3638
+ _renderDefaultSlot() {
3639
+ return y`<slot></slot>`;
3640
+ }
3641
+ _setupAriaAttrs() {
3642
+ setAttributeIfEmpty(this, "role", "slider");
3643
+ setAttributeIfEmpty(this, "tabindex", "0");
3644
+ setAttributeIfEmpty(this, "aria-orientation", "horizontal");
3645
+ setAttributeIfEmpty(this, "autocomplete", "off");
3646
+ }
3647
+ _updateAriaValueAttrs() {
3648
+ this.setAttribute("aria-valuemin", this._getValueMin());
3649
+ this.setAttribute("aria-valuenow", this._getValueNow());
3650
+ this.setAttribute("aria-valuemax", this._getValueMax());
3651
+ this.setAttribute("aria-valuetext", this._getValueText());
3652
+ }
3653
+ _getValueMin() {
3654
+ return String(this.min);
3655
+ }
3656
+ _getValueNow() {
3657
+ return String(this.value);
3658
+ }
3659
+ _getValueMax() {
3660
+ return String(this.max);
3661
+ }
3662
+ _getValueText() {
3663
+ return `${round(this.value / this.max * 100, 2)}%`;
3664
+ }
3665
+ _startDragging(event) {
3666
+ if (this.isDragging)
3667
+ return;
3668
+ this.store.dragging.set(true);
3669
+ this.setAttribute("dragging", "");
3670
+ const value = this._getValueBasedOnThumbPosition(event);
3671
+ this.store.pointerValue.set(value);
3672
+ this._dispatchPointerValueChange(event);
3673
+ this.dispatchEvent(
3674
+ vdsEvent("vds-slider-drag-start", {
3675
+ triggerEvent: event,
3676
+ detail: this.value
3677
+ })
3678
+ );
3679
+ this._mediaRemote.pauseUserIdle(event);
3680
+ }
3681
+ _stopDragging(event) {
3682
+ if (!this.isDragging)
3683
+ return;
3684
+ this.store.dragging.set(false);
3685
+ this._dispatchValueChange.cancel();
3686
+ this.removeAttribute("dragging");
3687
+ const value = this._getValueBasedOnThumbPosition(event);
3688
+ this.value = value;
3689
+ this.store.pointerValue.set(value);
3690
+ this._dispatchValueChange(event);
3691
+ this._dispatchPointerValueChange(event);
3692
+ this.dispatchEvent(
3693
+ vdsEvent("vds-slider-drag-end", {
3694
+ triggerEvent: event,
3695
+ detail: this.value
3696
+ })
3697
+ );
3698
+ this._mediaRemote.resumeUserIdle(event);
3699
+ }
3700
+ _getClampedValue(value) {
3701
+ return clampNumber(this.min, round(value, getNumberOfDecimalPlaces(this.step)), this.max);
3702
+ }
3703
+ _getValueFromRate(rate) {
3704
+ const boundRate = clampNumber(0, rate, 1);
3705
+ const range = this.max - this.min;
3706
+ const fill = range * boundRate;
3707
+ const stepRatio = Math.round(fill / this.step);
3708
+ const steps = this.step * stepRatio;
3709
+ return this.min + steps;
3710
+ }
3711
+ _getValueBasedOnThumbPosition(event) {
3712
+ const thumbClientX = event.clientX;
3713
+ const { left: trackLeft, width: trackWidth } = this.getBoundingClientRect();
3714
+ const thumbPositionRate = (thumbClientX - trackLeft) / trackWidth;
3715
+ return this._getValueFromRate(thumbPositionRate);
3716
+ }
3717
+ };
3718
+ __decorateClass([
3719
+ e({ type: Number })
3720
+ ], SliderElement.prototype, "min", 1);
3721
+ __decorateClass([
3722
+ e({ type: Number })
3723
+ ], SliderElement.prototype, "max", 1);
3724
+ __decorateClass([
3725
+ e({ reflect: true, type: Boolean })
3726
+ ], SliderElement.prototype, "disabled", 2);
3727
+ __decorateClass([
3728
+ e({ type: Number })
3729
+ ], SliderElement.prototype, "value", 2);
3730
+ __decorateClass([
3731
+ e({ type: Number })
3732
+ ], SliderElement.prototype, "step", 1);
3733
+ __decorateClass([
3734
+ e({ attribute: "keyboard-step", type: Number })
3735
+ ], SliderElement.prototype, "keyboardStep", 1);
3736
+ __decorateClass([
3737
+ e({ attribute: "shift-key-multiplier", type: Number })
3738
+ ], SliderElement.prototype, "shiftKeyMultiplier", 2);
3739
+ __decorateClass([
3740
+ e({ type: Boolean, attribute: "custom-value-text" })
3741
+ ], SliderElement.prototype, "customValueText", 2);
3742
+
3743
+ var timeSliderElementStyles = i$1``;
3744
+
3745
+ // src/ui/time-slider/TimeSliderElement.ts
3746
+ var TimeSliderElement = class extends SliderElement {
3747
+ constructor() {
3748
+ super();
3749
+ this._step = 0.1;
3750
+ this.value = 0;
3751
+ this.valueText = "{currentTime} out of {duration}";
3752
+ this.pauseWhileDragging = false;
3753
+ this.seekingRequestThrottle = 100;
3754
+ this.__mediaDuration = 0;
3755
+ this.__mediaPaused = true;
3756
+ this._handleSliderDragStart = eventListener(
3757
+ this,
3758
+ "vds-slider-drag-start",
3759
+ (event) => {
3760
+ this._togglePlaybackWhileDragging(event);
3761
+ }
3762
+ );
3763
+ this._handleSliderValueChange = eventListener(
3764
+ this,
3765
+ "vds-slider-value-change",
3766
+ (event) => {
3767
+ if (isKeyboardEvent(event.originEvent)) {
3768
+ this._dispatchSeekingRequest.cancel();
3769
+ this._mediaRemote.seek(this.value, event);
3770
+ }
3771
+ }
3772
+ );
3773
+ this._handleSliderDragValueChange = eventListener(
3774
+ this,
3775
+ "vds-slider-drag-value-change",
3776
+ (event) => {
3777
+ this._dispatchSeekingRequest(event);
3778
+ }
3779
+ );
3780
+ this._handleSliderDragEnd = eventListener(this, "vds-slider-drag-end", (event) => {
3781
+ this._dispatchSeekingRequest.cancel();
3782
+ this._mediaRemote.seek(this.value, event);
3783
+ this._togglePlaybackWhileDragging(event);
3784
+ });
3785
+ this._dispatchSeekingRequest = functionThrottle((event) => {
3786
+ this._mediaRemote.seeking(this.value, event);
3787
+ }, this.seekingRequestThrottle);
3788
+ this._wasPlayingBeforeDragStart = false;
3789
+ mediaStoreSubscription(this, "currentTime", ($currentTime) => {
3790
+ this.value = $currentTime;
3791
+ });
3792
+ mediaStoreSubscription(this, "duration", ($duration) => {
3793
+ this.__mediaDuration = $duration;
3794
+ this.requestUpdate("max");
3795
+ });
3796
+ mediaStoreSubscription(this, "paused", ($paused) => {
3797
+ this.__mediaPaused = $paused;
3798
+ });
3799
+ }
3800
+ static get styles() {
3801
+ return [super.styles, timeSliderElementStyles];
3802
+ }
3803
+ connectedCallback() {
3804
+ super.connectedCallback();
3805
+ setAttributeIfEmpty(this, "aria-label", "Media time");
3806
+ }
3807
+ get min() {
3808
+ return 0;
3809
+ }
3810
+ set min(_) {
3811
+ }
3812
+ get max() {
3813
+ return this.__mediaDuration;
3814
+ }
3815
+ set max(_) {
3816
+ }
3817
+ update(changedProperties) {
3818
+ if (changedProperties.has("disabled") && this.disabled) {
3819
+ this._dispatchSeekingRequest.cancel();
3820
+ }
3821
+ super.update(changedProperties);
3822
+ }
3823
+ disconnectedCallback() {
3824
+ this._dispatchSeekingRequest.cancel();
3825
+ super.disconnectedCallback();
3826
+ }
3827
+ _getValueMin() {
3828
+ return "0%";
3829
+ }
3830
+ _getValueNow() {
3831
+ return `${Math.round(this.fillPercent)}%`;
3832
+ }
3833
+ _getValueText() {
3834
+ return this.valueText.replace("{currentTime}", formatSpokenTime(this.value)).replace("{duration}", formatSpokenTime(this.__mediaDuration));
3835
+ }
3836
+ _getValueMax() {
3837
+ return "100%";
3838
+ }
3839
+ _togglePlaybackWhileDragging(event) {
3840
+ if (!this.pauseWhileDragging)
3841
+ return;
3842
+ if (this.isDragging && !this.__mediaPaused) {
3843
+ this._wasPlayingBeforeDragStart = true;
3844
+ this._mediaRemote.pause(event);
3845
+ } else if (this._wasPlayingBeforeDragStart && !this.isDragging && this.__mediaPaused) {
3846
+ this._wasPlayingBeforeDragStart = false;
3847
+ this._mediaRemote.play(event);
3848
+ }
3849
+ }
3850
+ };
3851
+ __decorateClass([
3852
+ e({ attribute: false, state: true })
3853
+ ], TimeSliderElement.prototype, "value", 2);
3854
+ __decorateClass([
3855
+ e({ attribute: false })
3856
+ ], TimeSliderElement.prototype, "min", 1);
3857
+ __decorateClass([
3858
+ e({ attribute: false })
3859
+ ], TimeSliderElement.prototype, "max", 1);
3860
+ __decorateClass([
3861
+ e({ attribute: "value-text" })
3862
+ ], TimeSliderElement.prototype, "valueText", 2);
3863
+ __decorateClass([
3864
+ e({ attribute: "pause-while-dragging", type: Boolean })
3865
+ ], TimeSliderElement.prototype, "pauseWhileDragging", 2);
3866
+ __decorateClass([
3867
+ e({ attribute: "seeking-request-throttle", type: Number })
3868
+ ], TimeSliderElement.prototype, "seekingRequestThrottle", 2);
3869
+ __decorateClass([
3870
+ t()
3871
+ ], TimeSliderElement.prototype, "__mediaDuration", 2);
3872
+ __decorateClass([
3873
+ t()
3874
+ ], TimeSliderElement.prototype, "__mediaPaused", 2);
3875
+
3876
+ safelyDefineCustomElement("vds-time-slider", TimeSliderElement);
3877
+
3878
+ var VolumeSliderElement = class extends SliderElement {
3879
+ constructor() {
3880
+ super();
3881
+ this.value = 100;
3882
+ this._handleSliderValueChange = eventListener(
3883
+ this,
3884
+ "vds-slider-value-change",
3885
+ this._changeVolume.bind(this)
3886
+ );
3887
+ this._handleSliderDragValueChange = eventListener(
3888
+ this,
3889
+ "vds-slider-drag-value-change",
3890
+ this._changeVolume.bind(this)
3891
+ );
3892
+ mediaStoreSubscription(this, "volume", ($volume) => {
3893
+ this.value = $volume * 100;
3894
+ });
3895
+ }
3896
+ connectedCallback() {
3897
+ super.connectedCallback();
3898
+ setAttributeIfEmpty(this, "aria-label", "Media volume");
3899
+ }
3900
+ get min() {
3901
+ return 0;
3902
+ }
3903
+ set min(_) {
3904
+ }
3905
+ get max() {
3906
+ return 100;
3907
+ }
3908
+ set max(_) {
3909
+ }
3910
+ _changeVolume(event) {
3911
+ const newVolume = event.detail;
3912
+ const mediaVolume = round(newVolume / 100, 3);
3913
+ this._mediaRemote.changeVolume(mediaVolume, event);
3914
+ }
3915
+ };
3916
+ __decorateClass([
3917
+ e({ attribute: false })
3918
+ ], VolumeSliderElement.prototype, "min", 1);
3919
+ __decorateClass([
3920
+ e({ attribute: false })
3921
+ ], VolumeSliderElement.prototype, "max", 1);
3922
+ __decorateClass([
3923
+ e({ attribute: false, state: true })
3924
+ ], VolumeSliderElement.prototype, "value", 2);
3925
+
3926
+ safelyDefineCustomElement("vds-volume-slider", VolumeSliderElement);
3927
+
3928
+ var SliderValueTextElement = class extends s {
3929
+ constructor() {
3930
+ super(...arguments);
3931
+ this._disposal = new DisposalBin();
3932
+ this._sliderStoreConsumer = sliderStoreContext.consume(this);
3933
+ this.__value = 0;
3934
+ this.type = "current";
3935
+ this.showHours = false;
3936
+ this.padHours = false;
3937
+ this.decimalPlaces = 2;
3938
+ }
3939
+ static get styles() {
3940
+ return [
3941
+ i$1`:host{display:inline-block;contain:content}:host([hidden]){display:none}`
3942
+ ];
3943
+ }
3944
+ get _sliderStore() {
3945
+ return this._sliderStoreConsumer.value;
3946
+ }
3947
+ connectedCallback() {
3948
+ super.connectedCallback();
3949
+ this._handleTypeChange();
3950
+ }
3951
+ update(changedProperties) {
3952
+ if (changedProperties.has("type") || changedProperties.has("format")) {
3953
+ this._handleTypeChange();
3954
+ }
3955
+ super.update(changedProperties);
3956
+ }
3957
+ disconnectedCallback() {
3958
+ this._disposal.empty();
3959
+ super.disconnectedCallback();
3960
+ }
3961
+ render() {
3962
+ return y`${this._getValueText()}`;
3963
+ }
3964
+ _handleTypeChange() {
3965
+ this._disposal.empty();
3966
+ const valueStore = this._sliderStore[this.type === "current" ? "value" : "pointerValue"];
3967
+ const store = this.format === "percent" ? this._createPercentStore(valueStore) : valueStore;
3968
+ const unsub = store.subscribe(($value) => {
3969
+ this.__value = $value;
3970
+ });
3971
+ this._disposal.add(unsub);
3972
+ }
3973
+ _createPercentStore(valueStore) {
3974
+ return derived(
3975
+ [valueStore, this._sliderStore.min, this._sliderStore.max],
3976
+ ([$value, $min, $max]) => {
3977
+ const range = $max - $min;
3978
+ return $value / range * 100;
3979
+ }
3980
+ );
3981
+ }
3982
+ _getValueText() {
3983
+ switch (this.format) {
3984
+ case "percent":
3985
+ return this._getPercentFormat();
3986
+ case "time":
3987
+ return this._getTimeFormat();
3988
+ default:
3989
+ return `${this.__value}`;
3990
+ }
3991
+ }
3992
+ _getPercentFormat() {
3993
+ return `${round(this.__value, this.decimalPlaces)}%`;
3994
+ }
3995
+ _getTimeFormat() {
3996
+ return formatTime(this.__value, this.padHours, this.showHours);
3997
+ }
3998
+ };
3999
+ __decorateClass([
4000
+ t()
4001
+ ], SliderValueTextElement.prototype, "__value", 2);
4002
+ __decorateClass([
4003
+ e()
4004
+ ], SliderValueTextElement.prototype, "type", 2);
4005
+ __decorateClass([
4006
+ e()
4007
+ ], SliderValueTextElement.prototype, "format", 2);
4008
+ __decorateClass([
4009
+ e({ attribute: "show-hours", type: Boolean })
4010
+ ], SliderValueTextElement.prototype, "showHours", 2);
4011
+ __decorateClass([
4012
+ e({ attribute: "pad-hours", type: Boolean })
4013
+ ], SliderValueTextElement.prototype, "padHours", 2);
4014
+ __decorateClass([
4015
+ e({ attribute: "decimal-places", type: Number })
4016
+ ], SliderValueTextElement.prototype, "decimalPlaces", 2);
4017
+
4018
+ safelyDefineCustomElement("vds-slider-value-text", SliderValueTextElement);
4019
+
4020
+ var TimeElement = class extends s {
4021
+ constructor() {
4022
+ super(...arguments);
4023
+ this._disposal = new DisposalBin();
4024
+ this._mediaStoreConsumer = mediaStoreContext.consume(this);
4025
+ this.__seconds = 0;
4026
+ this.type = "current";
4027
+ this.showHours = false;
4028
+ this.padHours = false;
4029
+ this.remainder = false;
4030
+ }
4031
+ static get styles() {
4032
+ return [
4033
+ i$1`:host{display:inline-block;contain:content}:host([hidden]){display:none}`
4034
+ ];
4035
+ }
4036
+ get _mediaStore() {
4037
+ return this._mediaStoreConsumer.value;
4038
+ }
4039
+ connectedCallback() {
4040
+ super.connectedCallback();
4041
+ this._handleTypeChange();
4042
+ }
4043
+ update(changedProperties) {
4044
+ if (changedProperties.has("type") || changedProperties.has("remainder")) {
4045
+ this._handleTypeChange();
4046
+ }
4047
+ super.update(changedProperties);
4048
+ }
4049
+ disconnectedCallback() {
4050
+ this._disposal.empty();
4051
+ super.disconnectedCallback();
4052
+ }
4053
+ render() {
4054
+ return y`${this._getFormattedTime()}`;
4055
+ }
4056
+ _handleTypeChange() {
4057
+ this._disposal.empty();
4058
+ const store = this._getTypeStore();
4059
+ const unsub = (this.remainder ? this._createRemainderStore(store) : store).subscribe(
4060
+ ($seconds) => {
4061
+ this.__seconds = $seconds;
4062
+ }
4063
+ );
4064
+ this._disposal.add(unsub);
4065
+ }
4066
+ _getTypeStore() {
4067
+ switch (this.type) {
4068
+ case "buffered":
4069
+ return this._mediaStore.bufferedAmount;
4070
+ case "seekable":
4071
+ return this._mediaStore.seekableAmount;
4072
+ case "duration":
4073
+ return this._mediaStore.duration;
4074
+ default:
4075
+ return this._mediaStore.currentTime;
4076
+ }
4077
+ }
4078
+ _createRemainderStore(secondsStore) {
4079
+ return derived(
4080
+ [secondsStore, this._mediaStore.duration],
4081
+ ([$seconds, $duration]) => Math.max(0, $duration - $seconds)
4082
+ );
4083
+ }
4084
+ _getFormattedTime() {
4085
+ return formatTime(this.__seconds, this.padHours, this.showHours);
4086
+ }
4087
+ };
4088
+ __decorateClass([
4089
+ t()
4090
+ ], TimeElement.prototype, "__seconds", 2);
4091
+ __decorateClass([
4092
+ e()
4093
+ ], TimeElement.prototype, "type", 2);
4094
+ __decorateClass([
4095
+ e({ attribute: "show-hours", type: Boolean })
4096
+ ], TimeElement.prototype, "showHours", 2);
4097
+ __decorateClass([
4098
+ e({ attribute: "pad-hours", type: Boolean })
4099
+ ], TimeElement.prototype, "padHours", 2);
4100
+ __decorateClass([
4101
+ e({ type: Boolean })
4102
+ ], TimeElement.prototype, "remainder", 2);
4103
+
4104
+ safelyDefineCustomElement("vds-time", TimeElement);
4105
+
4106
+ const stzhAudioCss = ".sc-stzh-audio-h{font-family:var(--stzh-font-family-regular);font-weight:var(--stzh-font-weight-regular);font-style:normal;color:var(--stzh-base-color);-webkit-box-sizing:border-box;box-sizing:border-box;display:block}[hidden].sc-stzh-audio-h{display:none}.sc-stzh-audio-h *.sc-stzh-audio,.sc-stzh-audio-h *.sc-stzh-audio::before,.sc-stzh-audio-h *.sc-stzh-audio::after{-webkit-box-sizing:border-box;box-sizing:border-box}.stzh-audio.sc-stzh-audio{display:block;contain:none}.stzh-audio__audio.sc-stzh-audio{border:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(100%);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-audio__controls.sc-stzh-audio{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.stzh-audio__controls-top.sc-stzh-audio{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--stzh-space-small)}.stzh-audio__controls-bottom.sc-stzh-audio{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.stzh-audio__controls.sc-stzh-audio,.stzh-audio__transcript.sc-stzh-audio{border:0.0625rem solid var(--stzh-color-grey25);padding:var(--stzh-space-medium) var(--stzh-space-xlarge)}.stzh-audio__controls.sc-stzh-audio{padding-bottom:var(--stzh-space-xsmall)}.stzh-audio__button.sc-stzh-audio{width:2.5rem;height:2.5rem;display:grid;place-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:var(--stzh-button-border-radius);-webkit-transition-duration:var(--stzh-base-transition-animation-speed);transition-duration:var(--stzh-base-transition-animation-speed);-webkit-transition-property:color, background-color;transition-property:color, background-color;color:var(--stzh-color-grey55)}.stzh-audio__button.is-play.sc-stzh-audio,.stzh-audio__button.is-mute.sc-stzh-audio,.stzh-audio__button.is-transcript.sc-stzh-audio{margin-right:var(--stzh-space-xsmall)}.stzh-audio__button.is-active.sc-stzh-audio{color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-audio__button.sc-stzh-audio:hover{color:var(--stzh-color-white);background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue))}.stzh-audio__transcript.sc-stzh-audio{border-top:none}.stzh-audio__loader-overlay.sc-stzh-audio{display:grid;place-items:center;position:absolute;z-index:3;top:0;left:0;width:100%;height:100%;background-color:var(--stzh-color-white);opacity:0;visibility:hidden}.stzh-audio__time.sc-stzh-audio{font-size:var(--stzh-font-curve-p2-default-font-size, var(--stzh-font-micro-font-size));line-height:var(--stzh-font-curve-p2-default-text-line-height, var(--stzh-font-micro-text-line-height));display:-ms-inline-flexbox;display:inline-flex;margin-right:var(--stzh-space-xlarge)}@media screen and (min-width: 1024px){.stzh-audio__time.sc-stzh-audio{font-size:var(--stzh-font-curve-p2-medium-font-size, var(--stzh-font-milli-font-size));line-height:var(--stzh-font-curve-p2-medium-text-line-height, var(--stzh-font-milli-text-line-height));letter-spacing:var(--stzh-font-curve-p2-medium-text-letter-spacing)}}@media screen and (max-width: 599px){.stzh-audio__time.sc-stzh-audio{margin-right:auto}}.stzh-audio__time-separator.sc-stzh-audio{margin:0 var(--stzh-space-xxsmall)}.stzh-audio__slider.sc-stzh-audio{--height:1.1875rem;--thumb-width:0.8125rem;--track-height:0.3125rem;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:var(--height);border-radius:var(--stzh-button-border-radius)}.stzh-audio__slider.is-time.sc-stzh-audio{-ms-flex-positive:1;flex-grow:1}.stzh-audio__slider.is-volume.sc-stzh-audio{width:20%;min-width:5rem;max-width:6.875rem;display:none}@media screen and (min-width: 600px){.stzh-audio__slider.is-volume.sc-stzh-audio{display:-ms-flexbox;display:flex;margin-right:auto}}.stzh-audio__slider-track.sc-stzh-audio{width:100%;height:var(--track-height);position:absolute;top:50%;left:0;z-index:0;-webkit-transform:translateY(-50%);transform:translateY(-50%);border-radius:0.25rem;background-color:var(--stzh-color-grey25)}.stzh-audio__slider-track.is-fill.sc-stzh-audio{background-color:var(--stzh-color-primary, var(--stzh-color-zueriblue));-webkit-transform-origin:left center;transform-origin:left center;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:calc(var(--vds-fill-rate) * 100%);z-index:1}.stzh-audio__slider-thumb-container.sc-stzh-audio{position:absolute;top:0;left:var(--vds-fill-percent);width:var(--thumb-width);height:100%;-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:2}.stzh-audio__slider[dragging].sc-stzh-audio .stzh-audio__slider-thumb-container.sc-stzh-audio{left:var(--vds-pointer-percent)}.stzh-audio__slider-thumb.sc-stzh-audio{position:absolute;top:50%;left:0;width:var(--thumb-width);height:var(--thumb-width);border-radius:50%;background-color:var(--stzh-color-white);-webkit-box-shadow:0 0 0 0.0625rem rgba(0, 0, 0, 0.25);box-shadow:0 0 0 0.0625rem rgba(0, 0, 0, 0.25);-webkit-transform:translateY(-50%);transform:translateY(-50%)}.stzh-audio__media-preview-container.sc-stzh-audio{--width:2.625rem;--width-half:calc(var(--width) / 2);--top:-1.5rem;--left-clamp:max(var(--width-half), var(--vds-pointer-percent));--right-clamp:calc(100% - var(--width-half));--left:min(var(--left-clamp), var(--right-clamp));display:grid;place-items:center;position:absolute;width:var(--width);top:var(--top);left:var(--left);width:var(--width);opacity:0;-webkit-transition:opacity var(--stzh-base-transition-animation-speed);transition:opacity var(--stzh-base-transition-animation-speed);-webkit-transform:translateX(-50%);transform:translateX(-50%);z-index:var(--stzh-z-index-popover);-webkit-box-shadow:var(--stzh-box-shadow-popover);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-tooltip-border-radius);background-color:var(--stzh-color-white)}@supports ((-webkit-filter: var(--stzh-tooltip-drop-shadow)) or (filter: var(--stzh-tooltip-drop-shadow))){.stzh-audio__media-preview-container.sc-stzh-audio{-webkit-box-shadow:none;box-shadow:none;-webkit-filter:var(--stzh-tooltip-drop-shadow);filter:var(--stzh-tooltip-drop-shadow)}}.stzh-audio__slider[pointing].sc-stzh-audio .stzh-audio__media-preview-container.sc-stzh-audio{opacity:1}.stzh-audio__slider-text.sc-stzh-audio{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height)}.stzh-audio[hide-ui].sc-stzh-audio .stzh-audio__controls.sc-stzh-audio{opacity:0;visibility:hidden}.stzh-audio[autoplay-error].sc-stzh-audio .stzh-audio__controls.sc-stzh-audio{opacity:1}.stzh-audio.sc-stzh-audio:not([can-play]) .stzh-audio__loader-overlay.sc-stzh-audio,.stzh-audio[waiting].sc-stzh-audio .stzh-audio__loader-overlay.sc-stzh-audio{opacity:0.8;visibility:visible}.stzh-audio[paused].sc-stzh-audio .stzh-audio__paused.sc-stzh-audio{display:none}.stzh-audio.sc-stzh-audio:not([paused]) .stzh-audio__played.sc-stzh-audio{display:none}.stzh-audio[muted].sc-stzh-audio .stzh-audio__muted.sc-stzh-audio{display:none}.stzh-audio.sc-stzh-audio:not([muted]) .stzh-audio__unmuted.sc-stzh-audio{display:none}";
4107
+
4108
+ const StzhAudio$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement$1 {
4109
+ constructor() {
4110
+ super();
4111
+ this.__registerHost();
4112
+ this.stzhPlay = createEvent(this, "stzhPlay", 7);
4113
+ this.stzhPlaying = createEvent(this, "stzhPlaying", 7);
4114
+ this.stzhPause = createEvent(this, "stzhPause", 7);
4115
+ this.stzhReplay = createEvent(this, "stzhReplay", 7);
4116
+ this.stzhEnd = createEvent(this, "stzhEnd", 7);
4117
+ this.stzhEnded = createEvent(this, "stzhEnded", 7);
4118
+ this.stzhError = createEvent(this, "stzhError", 7);
4119
+ this.localization = undefined;
4120
+ this.src = "";
4121
+ this.preload = "none";
4122
+ this.transcript = "";
4123
+ this.transcriptShown = false;
4124
+ }
4125
+ async play() {
4126
+ this.vsdAudioElement.play();
4127
+ }
4128
+ async pause() {
4129
+ this.vsdAudioElement.pause();
4130
+ }
4131
+ async componentWillLoad() {
4132
+ if (!this.localization) {
4133
+ this.localization = await fetchTranslations(this.element, "audio");
4134
+ }
4135
+ }
4136
+ render() {
4137
+ const hasTranscript = !!this.transcript || hasSlot(this.element, "transcript");
4138
+ const classes = {
4139
+ "stzh-audio": true
4140
+ };
4141
+ return (h$2(Host, null, h$2("vds-media", { class: classes }, h$2("vds-audio", { class: "stzh-audio__audio", ref: (el) => (this.vsdAudioElement = el), "onVds-play": () => { this.stzhPlay.emit({ component: "stzh-audio" }); }, "onVds-playing": () => { this.stzhPlaying.emit({ component: "stzh-audio" }); }, "onVds-end": () => { this.stzhEnd.emit({ component: "stzh-audio" }); }, "onVds-ended": () => { this.stzhEnded.emit({ component: "stzh-audio" }); }, "onVds-replay": () => { this.stzhReplay.emit({ component: "stzh-audio" }); }, "onVds-error": (e) => { this.stzhError.emit({ component: "stzh-audio", originalEvent: e }); } }, h$2("audio", { preload: this.preload, src: this.src }, h$2("slot", null))), h$2("div", { class: "stzh-audio__controls" }, h$2("div", { class: "stzh-audio__loader-overlay" }, h$2("stzh-loader", { class: "stzh-audio__loader", label: this.localization.loading, "hide-label": true })), h$2("div", { class: "stzh-audio__controls-top" }, h$2("vds-time-slider", { class: "stzh-audio__slider is-time" }, h$2("div", { class: "stzh-audio__slider-track" }), h$2("div", { class: "stzh-audio__slider-track is-fill" }), h$2("div", { class: "stzh-audio__slider-thumb-container" }, h$2("div", { class: "stzh-audio__slider-thumb" })), h$2("div", { class: "stzh-audio__media-preview-container" }, h$2("vds-slider-value-text", { class: "stzh-audio__slider-text", type: "pointer", format: "time" })))), h$2("div", { class: "stzh-audio__controls-bottom" }, h$2("stzh-tooltip", null, h$2("vds-play-button", { class: "stzh-audio__button is-play" }, h$2("stzh-icon", { class: "stzh-audio__played", name: "play" }), h$2("stzh-icon", { class: "stzh-audio__paused", name: "close" })), h$2("span", { slot: "content" }, h$2("span", { class: "stzh-audio__played" }, this.localization.play), h$2("span", { class: "stzh-audio__paused" }, this.localization.pause))), h$2("div", { class: "stzh-audio__time" }, h$2("vds-time", { type: "current" }), h$2("span", { class: "stzh-audio__time-separator" }, "/"), h$2("vds-time", { type: "duration" })), h$2("stzh-tooltip", null, h$2("vds-mute-button", { class: "stzh-audio__button is-mute" }, h$2("stzh-icon", { class: "stzh-audio__muted", name: "volume-medium" }), h$2("stzh-icon", { class: "stzh-audio__unmuted", name: "silent-mode" })), h$2("span", { slot: "content" }, h$2("span", { class: "stzh-audio__muted" }, this.localization.mute), h$2("span", { class: "stzh-audio__unmuted" }, this.localization.unmute))), h$2("vds-volume-slider", { class: "stzh-audio__slider is-volume" }, h$2("div", { class: "stzh-audio__slider-track" }), h$2("div", { class: "stzh-audio__slider-track is-fill" }), h$2("div", { class: "stzh-audio__slider-thumb-container" }, h$2("div", { class: "stzh-audio__slider-thumb" })), h$2("div", { class: "stzh-audio__media-preview-container" }, h$2("vds-slider-value-text", { class: "stzh-audio__slider-text", type: "pointer", format: "percent" }))), hasTranscript &&
4142
+ h$2("stzh-tooltip", { content: this.transcriptShown ? this.localization.hideTranscript : this.localization.showTranscript }, h$2("button", { class: {
4143
+ "stzh-audio__button is-transcript": true,
4144
+ "is-active": this.transcriptShown
4145
+ }, onClick: () => this.transcriptShown = !this.transcriptShown }, h$2("stzh-icon", { name: "transcript" }))), h$2("stzh-tooltip", { content: this.localization.download }, h$2("a", { class: "stzh-audio__button is-download", href: this.src, download: "" }, h$2("stzh-icon", { name: "download" }))))), h$2("div", { class: "stzh-audio__transcript", hidden: !this.transcriptShown }, h$2("stzh-text", null, this.transcript ? this.transcript : h$2("slot", { name: "transcript" }))))));
4146
+ }
4147
+ get element() { return this; }
4148
+ static get style() { return stzhAudioCss; }
4149
+ }, [6, "stzh-audio", {
4150
+ "localization": [16],
4151
+ "src": [1],
4152
+ "preload": [1],
4153
+ "transcript": [1],
4154
+ "transcriptShown": [1028, "transcript-shown"],
4155
+ "play": [64],
4156
+ "pause": [64]
4157
+ }]);
4158
+ function defineCustomElement$1() {
4159
+ if (typeof customElements === "undefined") {
4160
+ return;
4161
+ }
4162
+ const components = ["stzh-audio", "stzh-icon", "stzh-loader", "stzh-text", "stzh-tooltip"];
4163
+ components.forEach(tagName => { switch (tagName) {
4164
+ case "stzh-audio":
4165
+ if (!customElements.get(tagName)) {
4166
+ customElements.define(tagName, StzhAudio$1);
4167
+ }
4168
+ break;
4169
+ case "stzh-icon":
4170
+ if (!customElements.get(tagName)) {
4171
+ defineCustomElement$5();
4172
+ }
4173
+ break;
4174
+ case "stzh-loader":
4175
+ if (!customElements.get(tagName)) {
4176
+ defineCustomElement$4();
4177
+ }
4178
+ break;
4179
+ case "stzh-text":
4180
+ if (!customElements.get(tagName)) {
4181
+ defineCustomElement$3();
4182
+ }
4183
+ break;
4184
+ case "stzh-tooltip":
4185
+ if (!customElements.get(tagName)) {
4186
+ defineCustomElement$2();
4187
+ }
4188
+ break;
4189
+ } });
4190
+ }
4191
+
4192
+ const StzhAudio = StzhAudio$1;
4193
+ const defineCustomElement = defineCustomElement$1;
4194
+
4195
+ export { StzhAudio, defineCustomElement };