@tet/tet-components 1.4.157-testing → 1.4.158-production

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 (590) hide show
  1. package/dist/cjs/format-program-start-date-zxseYpV_.js +151 -0
  2. package/dist/cjs/{http-codes-D7ffzpYW.js → http-codes-BEt9xtqF.js} +2 -1
  3. package/dist/cjs/{index-BL_zVDFC.js → index-puzHM5yZ.js} +21 -21
  4. package/dist/cjs/{index-Dzs7Nkbj.js → index-t4WNVvo_.js} +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/{product-comparison-DUzqZuWv.js → product-comparison-CkjpMhjy.js} +1 -1
  7. package/dist/cjs/{service-availability-services-BXL7V5i1.js → service-availability-services-CcQ-evt-.js} +1 -1
  8. package/dist/cjs/{string-D0kCSyUd.js → string-CL-wkThZ.js} +0 -4
  9. package/dist/cjs/tet-accordion.cjs.entry.js +8 -8
  10. package/dist/cjs/tet-address-offers-filters-products_2.cjs.entry.js +4 -4
  11. package/dist/cjs/tet-address-offers-v2.cjs.entry.js +6 -6
  12. package/dist/cjs/tet-address-offers-view-v2.cjs.entry.js +6 -6
  13. package/dist/cjs/tet-address-offers-view.cjs.entry.js +5 -5
  14. package/dist/cjs/tet-address-offers_3.cjs.entry.js +7 -7
  15. package/dist/cjs/tet-address-search_2.cjs.entry.js +9 -9
  16. package/dist/cjs/tet-assembler_3.cjs.entry.js +5 -5
  17. package/dist/cjs/tet-autocomplete-dropdown.cjs.entry.js +3 -3
  18. package/dist/cjs/tet-autocomplete_2.cjs.entry.js +4 -4
  19. package/dist/cjs/tet-b2b-check-out-form_5.cjs.entry.js +7 -7
  20. package/dist/cjs/tet-b2b-configurator.cjs.entry.js +5 -5
  21. package/dist/cjs/tet-banner-nav.cjs.entry.js +4 -4
  22. package/dist/cjs/tet-bar-graph.cjs.entry.js +1 -1
  23. package/dist/cjs/tet-border-radius.cjs.entry.js +2 -2
  24. package/dist/cjs/tet-business-card.cjs.entry.js +1 -1
  25. package/dist/cjs/tet-business-compare-card.cjs.entry.js +3 -3
  26. package/dist/cjs/tet-business-round-stepper.cjs.entry.js +1 -1
  27. package/dist/cjs/tet-button.cjs.entry.js +1 -1
  28. package/dist/cjs/tet-card-list.cjs.entry.js +5 -5
  29. package/dist/cjs/tet-carousel.cjs.entry.js +10 -10
  30. package/dist/cjs/{tet-checkbox_3.cjs.entry.js → tet-checkbox_2.cjs.entry.js} +1 -453
  31. package/dist/cjs/tet-cloud-application-form-dialog.cjs.entry.js +4 -4
  32. package/dist/cjs/tet-cloud-configurator.cjs.entry.js +4 -4
  33. package/dist/cjs/tet-colors.cjs.entry.js +5 -5
  34. package/dist/cjs/tet-compare-card-v2.cjs.entry.js +3 -3
  35. package/dist/cjs/tet-compare-cards-tab.cjs.entry.js +3 -3
  36. package/dist/cjs/tet-compare-cards_2.cjs.entry.js +5 -5
  37. package/dist/cjs/tet-components.cjs.js +2 -2
  38. package/dist/cjs/tet-container_2.cjs.entry.js +2 -2
  39. package/dist/cjs/tet-countdown.cjs.entry.js +2 -2
  40. package/dist/cjs/tet-counter.cjs.entry.js +1 -1
  41. package/dist/cjs/tet-dialog.cjs.entry.js +4 -4
  42. package/dist/cjs/tet-display.cjs.entry.js +1 -1
  43. package/dist/cjs/tet-divider.cjs.entry.js +1 -1
  44. package/dist/cjs/tet-dynamic-card.cjs.entry.js +1 -1
  45. package/dist/cjs/tet-expandable-input.cjs.entry.js +1 -1
  46. package/dist/cjs/tet-expansion-panel.cjs.entry.js +2 -2
  47. package/dist/cjs/tet-feedback-form.cjs.entry.js +4 -4
  48. package/dist/cjs/tet-filter.cjs.entry.js +1 -1
  49. package/dist/cjs/tet-floating-block.cjs.entry.js +1 -1
  50. package/dist/cjs/tet-font-weight.cjs.entry.js +2 -2
  51. package/dist/cjs/tet-fonts.cjs.entry.js +2 -2
  52. package/dist/cjs/tet-grid.cjs.entry.js +2 -2
  53. package/dist/cjs/tet-icon.cjs.entry.js +2 -2
  54. package/dist/cjs/tet-inline-message.cjs.entry.js +1 -1
  55. package/dist/cjs/tet-input.cjs.entry.js +4 -4
  56. package/dist/cjs/tet-layout.cjs.entry.js +2 -2
  57. package/dist/cjs/tet-link-card-list.cjs.entry.js +1 -1
  58. package/dist/cjs/tet-link.cjs.entry.js +2 -2
  59. package/dist/cjs/tet-menu-mobile.cjs.entry.js +1 -1
  60. package/dist/cjs/tet-menu.cjs.entry.js +1 -1
  61. package/dist/cjs/tet-mini-compare-card.cjs.entry.js +1 -1
  62. package/dist/cjs/tet-multi-step-dialog.cjs.entry.js +5 -5
  63. package/dist/cjs/tet-navigation-mobile.cjs.entry.js +7 -7
  64. package/dist/cjs/tet-news-card-list.cjs.entry.js +2 -2
  65. package/dist/cjs/tet-news-card.cjs.entry.js +2 -2
  66. package/dist/cjs/tet-notification.cjs.entry.js +2 -2
  67. package/dist/cjs/tet-number-input.cjs.entry.js +1 -1
  68. package/dist/cjs/tet-paginator.cjs.entry.js +5 -5
  69. package/dist/cjs/tet-placeholder.cjs.entry.js +2 -2
  70. package/dist/cjs/tet-position.cjs.entry.js +1 -1
  71. package/dist/cjs/tet-price-view.cjs.entry.js +1 -1
  72. package/dist/cjs/tet-radio_2.cjs.entry.js +3 -3
  73. package/dist/cjs/tet-range-slider.cjs.entry.js +8 -8
  74. package/dist/cjs/tet-round-stepper.cjs.entry.js +1 -1
  75. package/dist/cjs/tet-snicker-card-group.cjs.entry.js +1 -1
  76. package/dist/cjs/tet-snicker-card.cjs.entry.js +4 -4
  77. package/dist/cjs/tet-spacing.cjs.entry.js +2 -2
  78. package/dist/cjs/tet-spinner.cjs.entry.js +4 -4
  79. package/dist/cjs/tet-stepper-input.cjs.entry.js +5 -5
  80. package/dist/cjs/tet-stepper-v3.cjs.entry.js +1 -1
  81. package/dist/cjs/tet-sticky-offer.cjs.entry.js +2 -2
  82. package/dist/cjs/tet-support-search.cjs.entry.js +2 -2
  83. package/dist/cjs/tet-switch.cjs.entry.js +1 -1
  84. package/dist/cjs/tet-table.cjs.entry.js +1 -1
  85. package/dist/cjs/tet-tag_2.cjs.entry.js +6 -6
  86. package/dist/cjs/tet-text-list.cjs.entry.js +1 -1
  87. package/dist/cjs/tet-text.cjs.entry.js +1 -1
  88. package/dist/cjs/tet-textarea.cjs.entry.js +3 -3
  89. package/dist/cjs/tet-thank-you-view-v3.cjs.entry.js +4 -4
  90. package/dist/cjs/tet-tooltip.cjs.entry.js +456 -0
  91. package/dist/cjs/tet-tv-program-channel-picker_3.cjs.entry.js +1465 -0
  92. package/dist/cjs/tet-tv-program-item.cjs.entry.js +217 -0
  93. package/dist/cjs/tet-tv-program-placeholders-C4m4UB1-.js +22 -0
  94. package/dist/cjs/tet-tv-program.cjs.entry.js +642 -3
  95. package/dist/cjs/{translations-Uvcq4kv8.js → translations-c8BeO6Gg.js} +2 -2
  96. package/dist/cjs/{typecheck--Bs-bZ_K.js → typecheck-Do6mN8Vg.js} +0 -2
  97. package/dist/collection/collection-manifest.json +3 -1
  98. package/dist/collection/components/advanced/address/tet-address-offers-filters/tet-address-offers-filters.js +1 -1
  99. package/dist/collection/components/advanced/address/tet-address-offers-v2/tet-address-offers-v2.js +1 -1
  100. package/dist/collection/components/advanced/address/tet-address-search/tet-address-search.js +3 -3
  101. package/dist/collection/components/advanced/address/tet-autocomplete-dropdown/tet-autocomplete-dropdown.js +1 -1
  102. package/dist/collection/components/advanced/cards/tet-business-compare-card/tet-business-compare-card.js +2 -2
  103. package/dist/collection/components/advanced/cards/tet-card-list/tet-card-list.js +4 -4
  104. package/dist/collection/components/advanced/cards/tet-news-card/tet-news-card.js +1 -1
  105. package/dist/collection/components/advanced/dialog/tet-multi-step-dialog/tet-multi-step-dialog.js +1 -1
  106. package/dist/collection/components/advanced/forms/tet-availability-contact-form/tet-availability-contact-form.js +1 -1
  107. package/dist/collection/components/advanced/forms/tet-b2b-check-out-form/tet-b2b-check-out-form.js +3 -3
  108. package/dist/collection/components/basic/buttons/tet-tabs/tet-tab-content/tet-tab-content.js +2 -2
  109. package/dist/collection/components/basic/buttons/tet-tabs/tet-tab-header/tet-tab-header.js +2 -2
  110. package/dist/collection/components/basic/buttons/tet-tag/tet-tag.js +2 -2
  111. package/dist/collection/components/basic/carousel/tet-carousel/tet-carousel.js +6 -6
  112. package/dist/collection/components/basic/loaders/tet-loader/tet-loader.js +1 -1
  113. package/dist/collection/components/basic/loaders/tet-placeholder/tet-placeholder.js +1 -1
  114. package/dist/collection/components/basic/loaders/tet-spinner/tet-spinner.js +3 -3
  115. package/dist/collection/components/basic/misc/tet-countdown/tet-countdown.js +1 -1
  116. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-header/tet-datepicker-header.js +2 -2
  117. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-month-view/tet-datepicker-month-view.js +1 -1
  118. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-multi-year-view/tet-datepicker-multi-year-view.js +1 -1
  119. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-year-view/tet-datepicker-year-view.js +1 -1
  120. package/dist/collection/components/simple/inputs/tet-datepicker/tet-datepicker.js +4 -4
  121. package/dist/collection/components/simple/inputs/tet-range-slider/tet-range-slider.js +7 -7
  122. package/dist/collection/components/simple/inputs/tet-stepper-input/tet-stepper-input.js +1 -1
  123. package/dist/collection/components/simple/inputs/tet-textarea/tet-textarea.js +2 -2
  124. package/dist/collection/components/simple/lists/tet-news-card-list/tet-news-card-list.js +1 -1
  125. package/dist/collection/components/simple/menu/tet-navigation-mobile/tet-navigation-mobile.js +3 -3
  126. package/dist/collection/components/simple/menu/tet-paginator/tet-paginator.js +1 -1
  127. package/dist/collection/components/simple/misc/tet-sticky-offer/tet-sticky-offer.js +1 -1
  128. package/dist/collection/components/simple/structural/tet-accordion/tet-accordion.css +5 -1
  129. package/dist/collection/components/simple/structural/tet-accordion/tet-accordion.js +6 -6
  130. package/dist/collection/components/simple/structural/tet-expansion-panel/tet-expansion-panel.js +1 -1
  131. package/dist/collection/components/simple/text-blocks/tet-notification/tet-notification.js +1 -1
  132. package/dist/collection/components/simple/text-blocks/tet-tooltip/tet-tooltip.js +1 -1
  133. package/dist/collection/components/views/tet-address-offers-view/tet-address-offers-view.js +1 -1
  134. package/dist/collection/components/views/tet-address-offers-view-v2/tet-address-offers-view-v2.js +2 -2
  135. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-channel-picker/tet-tv-program-channel-picker.css +21 -8
  136. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-channel-picker/tet-tv-program-channel-picker.js +59 -39
  137. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-date-picker/tet-tv-program-date-picker.css +52 -36
  138. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-date-picker/tet-tv-program-date-picker.js +24 -30
  139. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-item/tet-tv-program-item.css +352 -0
  140. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-item/tet-tv-program-item.js +488 -0
  141. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-item/tet-tv-program-item.mock.js +45 -0
  142. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-schedule/tet-tv-program-schedule.css +567 -0
  143. package/dist/collection/components/views/tet-tv-program/components/tet-tv-program-schedule/tet-tv-program-schedule.js +1309 -0
  144. package/dist/collection/components/views/tet-tv-program/test/mock-schedule-layout.js +74 -0
  145. package/dist/collection/components/views/tet-tv-program/tet-tv-program-placeholders.js +8 -0
  146. package/dist/collection/components/views/tet-tv-program/tet-tv-program.css +777 -0
  147. package/dist/collection/components/views/tet-tv-program/tet-tv-program.js +638 -2
  148. package/dist/collection/components/views/tet-tv-program/tet-tv-program.types.js +1 -0
  149. package/dist/collection/components/views/tet-tv-program/utils/broadcast-time.js +26 -0
  150. package/dist/collection/components/views/tet-tv-program/utils/fill-program-gaps.js +44 -0
  151. package/dist/collection/components/views/tet-tv-program/utils/format-program-start-date.js +13 -0
  152. package/dist/collection/components/views/tet-tv-program/utils/tooltip-lifecycle.js +132 -0
  153. package/dist/collection/docs/styling/border-radius/tet-border-radius.js +1 -1
  154. package/dist/collection/docs/styling/colors/tet-colors.js +4 -4
  155. package/dist/collection/docs/styling/font-weight/tet-font-weight.js +1 -1
  156. package/dist/collection/docs/styling/fonts/tet-fonts.js +1 -1
  157. package/dist/collection/docs/styling/layout/tet-layout.js +1 -1
  158. package/dist/collection/docs/styling/link/tet-link.js +1 -1
  159. package/dist/collection/docs/styling/spacing/tet-spacing.js +1 -1
  160. package/dist/collection/docs/styling/tet-grid/tet-grid.js +1 -1
  161. package/dist/collection/services/api/index.js +1 -0
  162. package/dist/collection/services/api/services/tv/tv-program-types.js +1 -0
  163. package/dist/collection/services/api/services/tv/tv-program.js +31 -0
  164. package/dist/collection/services/utils/date.js +7 -0
  165. package/dist/collection/services/utils/index.js +1 -0
  166. package/dist/components/index.js +1 -1
  167. package/dist/components/{p-B9bE6qY-.js → p--_RUy11E.js} +1 -1
  168. package/dist/components/p-B-Tjx5SX.js +1 -0
  169. package/dist/components/{p-CgV4zAwQ.js → p-B4UX_mB_.js} +1 -1
  170. package/dist/components/{p-p-J7NvGs.js → p-B73K4uEg.js} +1 -1
  171. package/dist/components/{p-BztqMLE1.js → p-BAf_O-kb.js} +1 -1
  172. package/dist/components/{p-BcVrianM.js → p-BOsv3j3J.js} +1 -1
  173. package/dist/components/p-BQ5mo25G.js +1 -0
  174. package/dist/components/{p-BI70OOEF.js → p-BQjtvIgJ.js} +1 -1
  175. package/dist/components/p-BTZzfMYY.js +1 -0
  176. package/dist/components/{p-C-sZ3Bzu.js → p-BX98BUpV.js} +1 -1
  177. package/dist/components/p-Bdbn4prA.js +8 -0
  178. package/dist/components/{p-CF15dAPd.js → p-BjM9vx9w.js} +1 -1
  179. package/dist/components/{p-nKvolHsW.js → p-BkXzaJcc.js} +1 -1
  180. package/dist/components/{p-CYMnJi7q.js → p-ByM3JujT.js} +1 -1
  181. package/dist/components/{p-B5HqUnpw.js → p-C2nyJwDX.js} +1 -1
  182. package/dist/components/{p-CJnk1Plz.js → p-C50q8-fi.js} +1 -1
  183. package/dist/components/{p-DXQ-UeYl.js → p-C5f1C5m_.js} +1 -1
  184. package/dist/components/{p-t_FgKIcd.js → p-CEyoGS5R.js} +1 -1
  185. package/dist/components/{p-BrPUjt5B.js → p-CI8FUu6q.js} +1 -1
  186. package/dist/components/{p-CMxcvnRv.js → p-CKWJROPt.js} +1 -1
  187. package/dist/components/{p-B-1KdQSL.js → p-CVhyWWJA.js} +1 -1
  188. package/dist/components/p-CWuhYFDW.js +1 -0
  189. package/dist/components/{p-44eECwiT.js → p-CXjWLDzk.js} +1 -1
  190. package/dist/components/p-C_Jw5r9B.js +1 -0
  191. package/dist/components/{p-vu71OGLf.js → p-ClXBenaN.js} +1 -1
  192. package/dist/components/{p-B60jnxEn.js → p-ClkvaRio.js} +1 -1
  193. package/dist/components/{p-HzogPVbA.js → p-D323rUMJ.js} +1 -1
  194. package/dist/components/{p-C4uKGuRj.js → p-D4MolLd8.js} +1 -1
  195. package/dist/components/{p-CPGJg5Si.js → p-D4k1E1mH.js} +1 -1
  196. package/dist/components/p-D5YRHMvl.js +1 -0
  197. package/dist/components/p-D9QC8S_K.js +1 -0
  198. package/dist/components/{p-DikHJHTd.js → p-DBK9GhUz.js} +1 -1
  199. package/dist/components/{p-Bho4Xl9R.js → p-DCeNW6E9.js} +1 -1
  200. package/dist/components/{p-C32vgbsV.js → p-DIpqXULQ.js} +1 -1
  201. package/dist/components/p-DPGMd9pW.js +1 -0
  202. package/dist/components/{p-C61jDpta.js → p-DTOuhcpL.js} +1 -1
  203. package/dist/components/{p-DN2JwXg9.js → p-DZRioc0D.js} +1 -1
  204. package/dist/components/{p-B1d6HEqd.js → p-DZecnsEu.js} +1 -1
  205. package/dist/components/{p-CZach5oP.js → p-DezVRSSN.js} +1 -1
  206. package/dist/components/{p-CDUvchOX.js → p-DiSdptzb.js} +1 -1
  207. package/dist/components/{p-lEX8wezw.js → p-DoCUcvkE.js} +1 -1
  208. package/dist/components/{p-Bsqoxd9G.js → p-DobMlMDf.js} +1 -1
  209. package/dist/components/{p-BD6bBnqr.js → p-Dr3_Xm0C.js} +1 -1
  210. package/dist/components/{p-DnPS3TWn.js → p-JrKx7ojI.js} +1 -1
  211. package/dist/components/{p-mVj43aKR.js → p-OAkgt412.js} +1 -1
  212. package/dist/components/{p-Cb2bEUmu.js → p-QcD5cCtX.js} +1 -1
  213. package/dist/components/{p-D8avEs-F.js → p-QlXxBzaI.js} +1 -1
  214. package/dist/components/{p-Mpe-2CVQ.js → p-QlyBltAE.js} +1 -1
  215. package/dist/components/{p-CwZljiBM.js → p-R45gvsNR.js} +1 -1
  216. package/dist/components/{p-sgozlrhg.js → p-RQYdSAu8.js} +1 -1
  217. package/dist/components/{p-CvUaogvc.js → p-RcwM6MVX.js} +1 -1
  218. package/dist/components/p-S9EUQFLQ.js +1 -0
  219. package/dist/components/{p-Bc4oqt_L.js → p-W3LV-Z7z.js} +1 -1
  220. package/dist/components/p-_2UzwYR8.js +1 -0
  221. package/dist/components/{p-DKZxpjnL.js → p-_pn0YVXD.js} +1 -1
  222. package/dist/components/{p-BmH_7-IQ.js → p-gw3AOj6h.js} +1 -1
  223. package/dist/components/{p-Bw-D7nPx.js → p-sp4th_AU.js} +1 -1
  224. package/dist/components/{p-o4S5jRzK.js → p-vwpr_v76.js} +1 -1
  225. package/dist/components/tet-accordion.js +1 -1
  226. package/dist/components/tet-address-offers-filters-products.js +1 -1
  227. package/dist/components/tet-address-offers-filters.js +1 -1
  228. package/dist/components/tet-address-offers-v2.js +1 -1
  229. package/dist/components/tet-address-offers-view-v2.js +1 -1
  230. package/dist/components/tet-address-offers-view.js +1 -1
  231. package/dist/components/tet-address-offers.js +1 -1
  232. package/dist/components/tet-address-search.js +1 -1
  233. package/dist/components/tet-assembler.js +1 -1
  234. package/dist/components/tet-asset-availability-addresses.js +1 -1
  235. package/dist/components/tet-autocomplete-dropdown.js +1 -1
  236. package/dist/components/tet-autocomplete.js +1 -1
  237. package/dist/components/tet-availability-contact-form.js +1 -1
  238. package/dist/components/tet-b2b-check-out-form.js +1 -1
  239. package/dist/components/tet-b2b-compare-card.js +1 -1
  240. package/dist/components/tet-b2b-configurator-cart.js +1 -1
  241. package/dist/components/tet-b2b-configurator.js +1 -1
  242. package/dist/components/tet-banner-nav.js +1 -1
  243. package/dist/components/tet-bar-graph.js +1 -1
  244. package/dist/components/tet-border-radius.js +1 -1
  245. package/dist/components/tet-business-card.js +1 -1
  246. package/dist/components/tet-business-compare-card.js +1 -1
  247. package/dist/components/tet-business-navigation.js +1 -1
  248. package/dist/components/tet-business-round-stepper.js +1 -1
  249. package/dist/components/tet-business-summary-card.js +1 -1
  250. package/dist/components/tet-button.js +1 -1
  251. package/dist/components/tet-card-list.js +1 -1
  252. package/dist/components/tet-carousel.js +1 -1
  253. package/dist/components/tet-checkbox.js +1 -1
  254. package/dist/components/tet-cloud-application-form-dialog.js +1 -1
  255. package/dist/components/tet-cloud-configurator.js +1 -1
  256. package/dist/components/tet-colors.js +1 -1
  257. package/dist/components/tet-compare-card-v2.js +1 -1
  258. package/dist/components/tet-compare-card-v3.js +1 -1
  259. package/dist/components/tet-compare-card.js +1 -1
  260. package/dist/components/tet-compare-cards-tab.js +1 -1
  261. package/dist/components/tet-compare-cards.js +1 -1
  262. package/dist/components/tet-container.js +1 -1
  263. package/dist/components/tet-countdown.js +1 -1
  264. package/dist/components/tet-counter.js +1 -1
  265. package/dist/components/tet-dialog.js +1 -1
  266. package/dist/components/tet-display.js +1 -1
  267. package/dist/components/tet-divider.js +1 -1
  268. package/dist/components/tet-dropdown.js +1 -1
  269. package/dist/components/tet-dynamic-card.js +1 -1
  270. package/dist/components/tet-expandable-input.js +1 -1
  271. package/dist/components/tet-expansion-panel.js +1 -1
  272. package/dist/components/tet-feedback-form.js +1 -1
  273. package/dist/components/tet-filter.js +1 -1
  274. package/dist/components/tet-floating-block.js +1 -1
  275. package/dist/components/tet-font-weight.js +1 -1
  276. package/dist/components/tet-fonts.js +1 -1
  277. package/dist/components/tet-grid.js +1 -1
  278. package/dist/components/tet-icon.js +1 -1
  279. package/dist/components/tet-inline-message.js +1 -1
  280. package/dist/components/tet-input.js +1 -1
  281. package/dist/components/tet-layout.js +1 -1
  282. package/dist/components/tet-link-card-list.js +1 -1
  283. package/dist/components/tet-link.js +1 -1
  284. package/dist/components/tet-loader.js +1 -1
  285. package/dist/components/tet-menu-mobile.js +1 -1
  286. package/dist/components/tet-menu.js +1 -1
  287. package/dist/components/tet-mini-compare-card.js +1 -1
  288. package/dist/components/tet-multi-step-dialog.js +1 -1
  289. package/dist/components/tet-navigation-mobile.js +1 -1
  290. package/dist/components/tet-news-card-list.js +1 -1
  291. package/dist/components/tet-news-card.js +1 -1
  292. package/dist/components/tet-notification.js +1 -1
  293. package/dist/components/tet-number-input.js +1 -1
  294. package/dist/components/tet-paginator.js +1 -1
  295. package/dist/components/tet-placeholder.js +1 -1
  296. package/dist/components/tet-position.js +1 -1
  297. package/dist/components/tet-price-view.js +1 -1
  298. package/dist/components/tet-radio-blocks.js +1 -1
  299. package/dist/components/tet-radio.js +1 -1
  300. package/dist/components/tet-range-slider.js +1 -1
  301. package/dist/components/tet-round-stepper.js +1 -1
  302. package/dist/components/tet-selection-list.js +1 -1
  303. package/dist/components/tet-snicker-card-group.js +1 -1
  304. package/dist/components/tet-snicker-card.js +1 -1
  305. package/dist/components/tet-spacing.js +1 -1
  306. package/dist/components/tet-spinner.js +1 -1
  307. package/dist/components/tet-stepper-input.js +1 -1
  308. package/dist/components/tet-stepper-v3.js +1 -1
  309. package/dist/components/tet-sticky-offer.js +1 -1
  310. package/dist/components/tet-support-search.js +1 -1
  311. package/dist/components/tet-switch.js +1 -1
  312. package/dist/components/tet-tab-content.js +1 -1
  313. package/dist/components/tet-tab-header.js +1 -1
  314. package/dist/components/tet-table.js +1 -1
  315. package/dist/components/tet-tag-group.js +1 -1
  316. package/dist/components/tet-tag.js +1 -1
  317. package/dist/components/tet-text-list.js +1 -1
  318. package/dist/components/tet-text.js +1 -1
  319. package/dist/components/tet-textarea.js +1 -1
  320. package/dist/components/tet-thank-you-view-v3.js +1 -1
  321. package/dist/components/tet-tooltip.js +1 -1
  322. package/dist/components/tet-tv-program-channel-picker.js +1 -1
  323. package/dist/components/tet-tv-program-date-picker.js +1 -1
  324. package/dist/components/{tet-datepicker.d.ts → tet-tv-program-item.d.ts} +4 -4
  325. package/dist/components/tet-tv-program-item.js +1 -0
  326. package/dist/components/tet-tv-program-schedule.d.ts +11 -0
  327. package/dist/components/tet-tv-program-schedule.js +1 -0
  328. package/dist/components/tet-tv-program.js +1 -1
  329. package/dist/esm/format-program-start-date-BTxL4Knq.js +148 -0
  330. package/dist/esm/{http-codes-CHPW8K5J.js → http-codes-8cHNuJ77.js} +2 -1
  331. package/dist/esm/{index-gA3_LS77.js → index-CO8AyGrA.js} +21 -21
  332. package/dist/esm/{index-BzVLx-ae.js → index-Rx46bgOe.js} +1 -1
  333. package/dist/esm/loader.js +3 -3
  334. package/dist/esm/{product-comparison-09p7FlLY.js → product-comparison-DZV6jdwa.js} +1 -1
  335. package/dist/esm/{service-availability-services-DHbWTGBw.js → service-availability-services-DglLgqmx.js} +1 -1
  336. package/dist/esm/{string-D0GJDW-O.js → string-C9BlrGW8.js} +1 -4
  337. package/dist/esm/tet-accordion.entry.js +8 -8
  338. package/dist/esm/tet-address-offers-filters-products_2.entry.js +4 -4
  339. package/dist/esm/tet-address-offers-v2.entry.js +6 -6
  340. package/dist/esm/tet-address-offers-view-v2.entry.js +6 -6
  341. package/dist/esm/tet-address-offers-view.entry.js +5 -5
  342. package/dist/esm/tet-address-offers_3.entry.js +7 -7
  343. package/dist/esm/tet-address-search_2.entry.js +9 -9
  344. package/dist/esm/tet-assembler_3.entry.js +5 -5
  345. package/dist/esm/tet-autocomplete-dropdown.entry.js +3 -3
  346. package/dist/esm/tet-autocomplete_2.entry.js +4 -4
  347. package/dist/esm/tet-b2b-check-out-form_5.entry.js +7 -7
  348. package/dist/esm/tet-b2b-configurator.entry.js +5 -5
  349. package/dist/esm/tet-banner-nav.entry.js +4 -4
  350. package/dist/esm/tet-bar-graph.entry.js +1 -1
  351. package/dist/esm/tet-border-radius.entry.js +2 -2
  352. package/dist/esm/tet-business-card.entry.js +1 -1
  353. package/dist/esm/tet-business-compare-card.entry.js +3 -3
  354. package/dist/esm/tet-business-round-stepper.entry.js +1 -1
  355. package/dist/esm/tet-button.entry.js +1 -1
  356. package/dist/esm/tet-card-list.entry.js +5 -5
  357. package/dist/esm/tet-carousel.entry.js +10 -10
  358. package/dist/esm/{tet-checkbox_3.entry.js → tet-checkbox_2.entry.js} +2 -453
  359. package/dist/esm/tet-cloud-application-form-dialog.entry.js +4 -4
  360. package/dist/esm/tet-cloud-configurator.entry.js +4 -4
  361. package/dist/esm/tet-colors.entry.js +5 -5
  362. package/dist/esm/tet-compare-card-v2.entry.js +3 -3
  363. package/dist/esm/tet-compare-cards-tab.entry.js +3 -3
  364. package/dist/esm/tet-compare-cards_2.entry.js +5 -5
  365. package/dist/esm/tet-components.js +3 -3
  366. package/dist/esm/tet-container_2.entry.js +2 -2
  367. package/dist/esm/tet-countdown.entry.js +2 -2
  368. package/dist/esm/tet-counter.entry.js +1 -1
  369. package/dist/esm/tet-dialog.entry.js +4 -4
  370. package/dist/esm/tet-display.entry.js +1 -1
  371. package/dist/esm/tet-divider.entry.js +1 -1
  372. package/dist/esm/tet-dynamic-card.entry.js +1 -1
  373. package/dist/esm/tet-expandable-input.entry.js +1 -1
  374. package/dist/esm/tet-expansion-panel.entry.js +2 -2
  375. package/dist/esm/tet-feedback-form.entry.js +4 -4
  376. package/dist/esm/tet-filter.entry.js +1 -1
  377. package/dist/esm/tet-floating-block.entry.js +1 -1
  378. package/dist/esm/tet-font-weight.entry.js +2 -2
  379. package/dist/esm/tet-fonts.entry.js +2 -2
  380. package/dist/esm/tet-grid.entry.js +2 -2
  381. package/dist/esm/tet-icon.entry.js +2 -2
  382. package/dist/esm/tet-inline-message.entry.js +1 -1
  383. package/dist/esm/tet-input.entry.js +4 -4
  384. package/dist/esm/tet-layout.entry.js +2 -2
  385. package/dist/esm/tet-link-card-list.entry.js +1 -1
  386. package/dist/esm/tet-link.entry.js +2 -2
  387. package/dist/esm/tet-menu-mobile.entry.js +1 -1
  388. package/dist/esm/tet-menu.entry.js +1 -1
  389. package/dist/esm/tet-mini-compare-card.entry.js +1 -1
  390. package/dist/esm/tet-multi-step-dialog.entry.js +5 -5
  391. package/dist/esm/tet-navigation-mobile.entry.js +7 -7
  392. package/dist/esm/tet-news-card-list.entry.js +2 -2
  393. package/dist/esm/tet-news-card.entry.js +2 -2
  394. package/dist/esm/tet-notification.entry.js +2 -2
  395. package/dist/esm/tet-number-input.entry.js +1 -1
  396. package/dist/esm/tet-paginator.entry.js +5 -5
  397. package/dist/esm/tet-placeholder.entry.js +2 -2
  398. package/dist/esm/tet-position.entry.js +1 -1
  399. package/dist/esm/tet-price-view.entry.js +1 -1
  400. package/dist/esm/tet-radio_2.entry.js +3 -3
  401. package/dist/esm/tet-range-slider.entry.js +8 -8
  402. package/dist/esm/tet-round-stepper.entry.js +1 -1
  403. package/dist/esm/tet-snicker-card-group.entry.js +1 -1
  404. package/dist/esm/tet-snicker-card.entry.js +4 -4
  405. package/dist/esm/tet-spacing.entry.js +2 -2
  406. package/dist/esm/tet-spinner.entry.js +4 -4
  407. package/dist/esm/tet-stepper-input.entry.js +5 -5
  408. package/dist/esm/tet-stepper-v3.entry.js +1 -1
  409. package/dist/esm/tet-sticky-offer.entry.js +2 -2
  410. package/dist/esm/tet-support-search.entry.js +2 -2
  411. package/dist/esm/tet-switch.entry.js +1 -1
  412. package/dist/esm/tet-table.entry.js +1 -1
  413. package/dist/esm/tet-tag_2.entry.js +6 -6
  414. package/dist/esm/tet-text-list.entry.js +1 -1
  415. package/dist/esm/tet-text.entry.js +1 -1
  416. package/dist/esm/tet-textarea.entry.js +3 -3
  417. package/dist/esm/tet-thank-you-view-v3.entry.js +4 -4
  418. package/dist/esm/tet-tooltip.entry.js +454 -0
  419. package/dist/esm/tet-tv-program-channel-picker_3.entry.js +1461 -0
  420. package/dist/esm/tet-tv-program-item.entry.js +215 -0
  421. package/dist/esm/tet-tv-program-placeholders-DyupRSa9.js +19 -0
  422. package/dist/esm/tet-tv-program.entry.js +642 -3
  423. package/dist/esm/{translations-CLCWF8K_.js → translations-Cytyv90Z.js} +2 -2
  424. package/dist/esm/{typecheck-Bvqcvhjw.js → typecheck-CaZKtSyx.js} +1 -2
  425. package/dist/tet-components/{p-8b7bbbbf.entry.js → p-00440570.entry.js} +1 -1
  426. package/dist/tet-components/{p-9d612283.entry.js → p-00ee3383.entry.js} +1 -1
  427. package/dist/tet-components/{p-19cb8e38.entry.js → p-026c4688.entry.js} +1 -1
  428. package/dist/tet-components/{p-e45dab2b.entry.js → p-0a35f634.entry.js} +1 -1
  429. package/dist/tet-components/{p-72c54f04.entry.js → p-0be0b06d.entry.js} +1 -1
  430. package/dist/tet-components/{p-af7f7020.entry.js → p-1125417c.entry.js} +1 -1
  431. package/dist/tet-components/{p-0026968d.entry.js → p-17dd27fc.entry.js} +1 -1
  432. package/dist/tet-components/{p-b389b07a.entry.js → p-18e188fe.entry.js} +1 -1
  433. package/dist/tet-components/p-1Pg6Bg5R.js +1 -0
  434. package/dist/tet-components/{p-22db539b.entry.js → p-1ee4e8b2.entry.js} +1 -1
  435. package/dist/tet-components/{p-0bd6e06e.entry.js → p-25b05e87.entry.js} +1 -1
  436. package/dist/tet-components/p-27d7ad18.entry.js +1 -0
  437. package/dist/tet-components/{p-a2e40f04.entry.js → p-285a92c5.entry.js} +1 -1
  438. package/dist/tet-components/{p-12fe3881.entry.js → p-2a528ade.entry.js} +1 -1
  439. package/dist/tet-components/{p-0e4129ea.entry.js → p-2c75f965.entry.js} +1 -1
  440. package/dist/tet-components/{p-c5068d10.entry.js → p-2eafdaed.entry.js} +1 -1
  441. package/dist/tet-components/{p-0e9201e6.entry.js → p-335a6617.entry.js} +1 -1
  442. package/dist/tet-components/{p-daa8ca5c.entry.js → p-38ac5d83.entry.js} +1 -1
  443. package/dist/tet-components/{p-e88e50e6.entry.js → p-39431ec5.entry.js} +1 -1
  444. package/dist/tet-components/{p-7672a3cf.entry.js → p-3ad392f5.entry.js} +1 -1
  445. package/dist/tet-components/p-3bf86def.entry.js +1 -0
  446. package/dist/tet-components/p-3ec54e1f.entry.js +1 -0
  447. package/dist/tet-components/{p-8329cd9d.entry.js → p-421edd38.entry.js} +1 -1
  448. package/dist/tet-components/{p-7d62e8e0.entry.js → p-4398cb86.entry.js} +1 -1
  449. package/dist/tet-components/{p-039121d4.entry.js → p-43b92cf1.entry.js} +1 -1
  450. package/dist/tet-components/p-444eec19.entry.js +1 -0
  451. package/dist/tet-components/{p-f8aa1f9b.entry.js → p-53288215.entry.js} +1 -1
  452. package/dist/tet-components/{p-8424ddb6.entry.js → p-5466531d.entry.js} +1 -1
  453. package/dist/tet-components/{p-a9706390.entry.js → p-56b3c60a.entry.js} +1 -1
  454. package/dist/tet-components/{p-9f8c0d62.entry.js → p-56c7ed22.entry.js} +1 -1
  455. package/dist/tet-components/p-58dc974a.entry.js +1 -0
  456. package/dist/tet-components/{p-827abc22.entry.js → p-5c9f805c.entry.js} +1 -1
  457. package/dist/tet-components/{p-1af6b8cb.entry.js → p-5cf98e2a.entry.js} +1 -1
  458. package/dist/tet-components/{p-9ab815b3.entry.js → p-5f683fd6.entry.js} +1 -1
  459. package/dist/tet-components/{p-bc73adcc.entry.js → p-61cb3c7b.entry.js} +1 -1
  460. package/dist/tet-components/{p-318947f9.entry.js → p-671a5b50.entry.js} +1 -1
  461. package/dist/tet-components/{p-aa0b655b.entry.js → p-694911f0.entry.js} +1 -1
  462. package/dist/tet-components/{p-e7c43c95.entry.js → p-69c6c216.entry.js} +1 -1
  463. package/dist/tet-components/{p-73acf518.entry.js → p-6baf4f40.entry.js} +1 -1
  464. package/dist/tet-components/p-6c3a131b.entry.js +1 -0
  465. package/dist/tet-components/{p-13550c14.entry.js → p-6e126f61.entry.js} +1 -1
  466. package/dist/tet-components/{p-f53d2d9f.entry.js → p-6f449651.entry.js} +1 -1
  467. package/dist/tet-components/{p-f73c5481.entry.js → p-70775616.entry.js} +1 -1
  468. package/dist/tet-components/{p-0e021d89.entry.js → p-7d81be98.entry.js} +1 -1
  469. package/dist/tet-components/{p-db92c865.entry.js → p-7da500c3.entry.js} +1 -1
  470. package/dist/tet-components/{p-324d8840.entry.js → p-82de3c82.entry.js} +1 -1
  471. package/dist/tet-components/{p-c778dbd4.entry.js → p-84153818.entry.js} +1 -1
  472. package/dist/tet-components/{p-c321199b.entry.js → p-845addd5.entry.js} +1 -1
  473. package/dist/tet-components/{p-b370c444.entry.js → p-88184103.entry.js} +1 -1
  474. package/dist/tet-components/p-8c53b195.entry.js +1 -0
  475. package/dist/tet-components/{p-03b6c7a2.entry.js → p-998ee6ff.entry.js} +1 -1
  476. package/dist/tet-components/{p-e9e288f6.entry.js → p-9cb7e09d.entry.js} +1 -1
  477. package/dist/tet-components/{p-4a21fdfb.entry.js → p-9fcebf59.entry.js} +1 -1
  478. package/dist/tet-components/{p-nYl-0ap-.js → p-B00u2s3v.js} +1 -1
  479. package/dist/tet-components/p-BCewZzcy.js +8 -0
  480. package/dist/tet-components/p-BTxL4Knq.js +1 -0
  481. package/dist/tet-components/p-C9BlrGW8.js +1 -0
  482. package/dist/tet-components/p-CO8AyGrA.js +3 -0
  483. package/dist/tet-components/p-CaZKtSyx.js +1 -0
  484. package/dist/tet-components/p-Cak7jORV.js +1 -0
  485. package/dist/tet-components/{p-AT09y63b.js → p-DSi6YWYP.js} +1 -1
  486. package/dist/tet-components/{p-Th74Kc5K.js → p-WCtqtcml.js} +1 -1
  487. package/dist/tet-components/{p-8b2edb99.entry.js → p-a5dc9b50.entry.js} +1 -1
  488. package/dist/tet-components/{p-ff164570.entry.js → p-a72a6886.entry.js} +1 -1
  489. package/dist/tet-components/{p-484266ca.entry.js → p-aab96319.entry.js} +1 -1
  490. package/dist/tet-components/{p-6800ae9e.entry.js → p-afdfbbe6.entry.js} +1 -1
  491. package/dist/tet-components/{p-0b122cc1.entry.js → p-b32bfbcc.entry.js} +1 -1
  492. package/dist/tet-components/{p-a91c8e30.entry.js → p-b394da8f.entry.js} +1 -1
  493. package/dist/tet-components/{p-25c80589.entry.js → p-b47dbd57.entry.js} +1 -1
  494. package/dist/tet-components/{p-675387bc.entry.js → p-b495c225.entry.js} +1 -1
  495. package/dist/tet-components/{p-6a3891bf.entry.js → p-b85587af.entry.js} +1 -1
  496. package/dist/tet-components/{p-845419ea.entry.js → p-baf51820.entry.js} +1 -1
  497. package/dist/tet-components/{p-17f8270f.entry.js → p-bb72ca94.entry.js} +1 -1
  498. package/dist/tet-components/{p-7b98b883.entry.js → p-bbde7f66.entry.js} +1 -1
  499. package/dist/tet-components/{p-1ce9b751.entry.js → p-bc168e7d.entry.js} +1 -1
  500. package/dist/tet-components/{p-ae31acd5.entry.js → p-c0c72e90.entry.js} +1 -1
  501. package/dist/tet-components/{p-3dd266f3.entry.js → p-c1e542f3.entry.js} +1 -1
  502. package/dist/tet-components/{p-1ed0c66f.entry.js → p-c66fa72e.entry.js} +1 -1
  503. package/dist/tet-components/{p-e59ec4c3.entry.js → p-cc26cad3.entry.js} +1 -1
  504. package/dist/tet-components/{p-467663a9.entry.js → p-d0824b42.entry.js} +1 -1
  505. package/dist/tet-components/{p-73a66398.entry.js → p-d0e27220.entry.js} +1 -1
  506. package/dist/tet-components/{p-ebd66166.entry.js → p-d2bfb56b.entry.js} +1 -1
  507. package/dist/tet-components/{p-57d07760.entry.js → p-d9059fe6.entry.js} +1 -1
  508. package/dist/tet-components/{p-231dde32.entry.js → p-dce8109c.entry.js} +1 -1
  509. package/dist/tet-components/{p-0d0de163.entry.js → p-e6ae26c9.entry.js} +1 -1
  510. package/dist/tet-components/{p-0744b479.entry.js → p-e813e289.entry.js} +1 -1
  511. package/dist/tet-components/{p-2be883e9.entry.js → p-e8395909.entry.js} +1 -1
  512. package/dist/tet-components/{p-7dfd519c.entry.js → p-eac96e34.entry.js} +1 -1
  513. package/dist/tet-components/{p-ac515335.entry.js → p-ece42f8d.entry.js} +1 -1
  514. package/dist/tet-components/{p-7c1dd176.entry.js → p-edd7aeaa.entry.js} +1 -1
  515. package/dist/tet-components/{p-32983951.entry.js → p-ef66b469.entry.js} +1 -1
  516. package/dist/tet-components/{p-16282657.entry.js → p-f1512e81.entry.js} +1 -1
  517. package/dist/tet-components/{p-2884891b.entry.js → p-f8106629.entry.js} +1 -1
  518. package/dist/tet-components/{p-76be889b.entry.js → p-ff09a8f4.entry.js} +1 -1
  519. package/dist/tet-components/tet-components.esm.js +1 -1
  520. package/dist/types/components/views/tet-tv-program/components/tet-tv-program-channel-picker/tet-tv-program-channel-picker.d.ts +9 -13
  521. package/dist/types/components/views/tet-tv-program/components/tet-tv-program-date-picker/tet-tv-program-date-picker.d.ts +1 -3
  522. package/dist/types/components/views/tet-tv-program/components/tet-tv-program-item/tet-tv-program-item.d.ts +62 -0
  523. package/dist/types/components/views/tet-tv-program/components/tet-tv-program-item/tet-tv-program-item.mock.d.ts +2 -0
  524. package/dist/types/components/views/tet-tv-program/components/tet-tv-program-schedule/tet-tv-program-schedule.d.ts +174 -0
  525. package/dist/types/components/views/tet-tv-program/test/mock-schedule-layout.d.ts +4 -0
  526. package/dist/types/components/views/tet-tv-program/tet-tv-program-placeholders.d.ts +2 -0
  527. package/dist/types/components/views/tet-tv-program/tet-tv-program.d.ts +96 -0
  528. package/dist/types/components/views/tet-tv-program/tet-tv-program.types.d.ts +30 -0
  529. package/dist/types/components/views/tet-tv-program/utils/broadcast-time.d.ts +14 -0
  530. package/dist/types/components/views/tet-tv-program/utils/fill-program-gaps.d.ts +3 -0
  531. package/dist/types/components/views/tet-tv-program/utils/format-program-start-date.d.ts +1 -0
  532. package/dist/types/components/views/tet-tv-program/utils/tooltip-lifecycle.d.ts +22 -0
  533. package/dist/types/components.d.ts +339 -389
  534. package/dist/types/services/api/index.d.ts +2 -0
  535. package/dist/types/services/api/services/tv/tv-program-types.d.ts +46 -0
  536. package/dist/types/services/api/services/tv/tv-program.d.ts +7 -0
  537. package/dist/types/services/utils/date.d.ts +2 -0
  538. package/dist/types/services/utils/index.d.ts +1 -0
  539. package/package.json +1 -1
  540. package/dist/cjs/tet-datepicker-header_4.cjs.entry.js +0 -387
  541. package/dist/cjs/tet-datepicker.cjs.entry.js +0 -132
  542. package/dist/cjs/tet-tv-program-channel-picker_2.cjs.entry.js +0 -536
  543. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-header/tet-datepicker-header.css +0 -393
  544. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-month-view/tet-datepicker-month-view.css +0 -455
  545. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-multi-year-view/tet-datepicker-multi-year-view.css +0 -382
  546. package/dist/collection/components/simple/inputs/tet-datepicker/partials/tet-datepicker-year-view/tet-datepicker-year-view.css +0 -382
  547. package/dist/collection/components/simple/inputs/tet-datepicker/tet-datepicker.css +0 -380
  548. package/dist/components/p-BMSAKp34.js +0 -1
  549. package/dist/components/p-Br4jWI9B.js +0 -8
  550. package/dist/components/p-C9dDgHzh.js +0 -1
  551. package/dist/components/p-CSxtbfBJ.js +0 -1
  552. package/dist/components/p-Cdi7KDBd.js +0 -1
  553. package/dist/components/p-Cef0hbKH.js +0 -1
  554. package/dist/components/p-CoQ-OVcl.js +0 -1
  555. package/dist/components/p-Czx7ardH.js +0 -1
  556. package/dist/components/p-D0GJDW-O.js +0 -1
  557. package/dist/components/p-DgT79UG-.js +0 -1
  558. package/dist/components/p-DrFW6lxe.js +0 -1
  559. package/dist/components/p-DutLsF-O.js +0 -1
  560. package/dist/components/p-Lpb2mgqh.js +0 -1
  561. package/dist/components/p-Q3NUC_eC.js +0 -1
  562. package/dist/components/tet-datepicker-header.d.ts +0 -11
  563. package/dist/components/tet-datepicker-header.js +0 -1
  564. package/dist/components/tet-datepicker-month-view.d.ts +0 -11
  565. package/dist/components/tet-datepicker-month-view.js +0 -1
  566. package/dist/components/tet-datepicker-multi-year-view.d.ts +0 -11
  567. package/dist/components/tet-datepicker-multi-year-view.js +0 -1
  568. package/dist/components/tet-datepicker-year-view.d.ts +0 -11
  569. package/dist/components/tet-datepicker-year-view.js +0 -1
  570. package/dist/components/tet-datepicker.js +0 -1
  571. package/dist/esm/tet-datepicker-header_4.entry.js +0 -382
  572. package/dist/esm/tet-datepicker.entry.js +0 -130
  573. package/dist/esm/tet-tv-program-channel-picker_2.entry.js +0 -533
  574. package/dist/tet-components/p-340c3e79.entry.js +0 -1
  575. package/dist/tet-components/p-3a573d6e.entry.js +0 -1
  576. package/dist/tet-components/p-7d218d65.entry.js +0 -1
  577. package/dist/tet-components/p-Bvqcvhjw.js +0 -1
  578. package/dist/tet-components/p-CNGb2lWC.js +0 -8
  579. package/dist/tet-components/p-ChdlTQSF.js +0 -1
  580. package/dist/tet-components/p-D0GJDW-O.js +0 -1
  581. package/dist/tet-components/p-aea861c9.entry.js +0 -1
  582. package/dist/tet-components/p-b21b4329.entry.js +0 -1
  583. package/dist/tet-components/p-c102d7e8.entry.js +0 -1
  584. package/dist/tet-components/p-dabdfe62.entry.js +0 -1
  585. package/dist/tet-components/p-gA3_LS77.js +0 -3
  586. package/dist/types/components/simple/inputs/tet-datepicker/partials/tet-datepicker-header/tet-datepicker-header.d.ts +0 -21
  587. package/dist/types/components/simple/inputs/tet-datepicker/partials/tet-datepicker-month-view/tet-datepicker-month-view.d.ts +0 -45
  588. package/dist/types/components/simple/inputs/tet-datepicker/partials/tet-datepicker-multi-year-view/tet-datepicker-multi-year-view.d.ts +0 -20
  589. package/dist/types/components/simple/inputs/tet-datepicker/partials/tet-datepicker-year-view/tet-datepicker-year-view.d.ts +0 -20
  590. package/dist/types/components/simple/inputs/tet-datepicker/tet-datepicker.d.ts +0 -47
@@ -0,0 +1,1465 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-puzHM5yZ.js');
4
+ var visibilityObserver = require('./visibility-observer-Coef27xg.js');
5
+ var translations = require('./translations-c8BeO6Gg.js');
6
+ var tetTvProgramPlaceholders = require('./tet-tv-program-placeholders-C4m4UB1-.js');
7
+ var formatProgramStartDate = require('./format-program-start-date-zxseYpV_.js');
8
+ var TooltipPosition = require('./TooltipPosition-DcSrsoxg.js');
9
+ require('./http-codes-BEt9xtqF.js');
10
+ require('./typecheck-Do6mN8Vg.js');
11
+
12
+ const tetTvProgramChannelPickerCss = () => `@font-face{font-family:"Gilroy";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Gilroy-W05-Medium.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Medium.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/Gilroy-W05-Medium.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Medium.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/Gilroy-W05-Semibold.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Semibold.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:700;font-display:swap;src:url("assets/fonts/Gilroy-W05-Bold.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Bold.woff") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Inter-Regular.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-Regular.woff?v=3.19") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/Inter-Medium.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-Medium.woff?v=3.19") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/Inter-SemiBold.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-SemiBold.woff?v=3.19") format("woff")}:host{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;padding:0;margin:0}:host{--tv-channel-picker-text-primary-color:var(--tc-text-primary);--tv-channel-picker-button-background-color:var(--tc-layer-grey-primary);--tv-channel-picker-button-pressed-background-color:var(--tc-layer-grey-tertiary);--tv-channel-picker-button-active-background-color:var(--tc-layer-grey-secondary);--tv-channel-picker-button-underline-color:var(--tc-layer-permanent-yellow);--tv-channel-picker-focus-outline-color:var(--tc-blue-40);--tv-channel-picker-gradient-color:var(--tc-background-primary);display:block;height:3.875rem}:host([theme=dark]){--tv-channel-picker-text-primary-color:var(--tc-text-primary-dark);--tv-channel-picker-button-background-color:var(--tc-layer-grey-primary-dark);--tv-channel-picker-button-pressed-background-color:var(--tc-layer-grey-tertiary-dark);--tv-channel-picker-button-active-background-color:var(--tc-layer-grey-secondary-dark);--tv-channel-picker-button-underline-color:var(--tc-layer-permanent-yellow-dark);--tv-channel-picker-focus-outline-color:var(--tc-blue-40-dark);--tv-channel-picker-gradient-color:var(--tc-background-primary-dark)}.tv-channel-picker{position:relative;display:flex;align-items:center;max-width:100%;height:100%}.tv-channel-picker--gradients::before,.tv-channel-picker--gradients::after{content:"";position:absolute;top:0;bottom:0;width:119px;pointer-events:none;z-index:2;opacity:0}.tv-channel-picker--gradients::before{left:0;background:linear-gradient(to right, var(--tv-channel-picker-gradient-color), transparent)}.tv-channel-picker--gradients::after{right:0;background:linear-gradient(to left, var(--tv-channel-picker-gradient-color), transparent)}.tv-channel-picker--gradient-left::before,.tv-channel-picker--gradient-right::after{opacity:1}.tv-channel-picker__list{display:flex;flex:1;flex-direction:row;justify-content:safe center;gap:0.5rem;height:100%;min-width:0;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;-webkit-user-select:none;user-select:none;padding-inline:1rem}@media screen and (min-width: 31.25rem){.tv-channel-picker__list{padding-inline:2rem}}@media screen and (min-width: 48rem){.tv-channel-picker__list{padding-inline:0}}.tv-channel-picker__list--dragging{scroll-behavior:auto;scroll-snap-type:none}.tv-channel-picker__list--dragging,.tv-channel-picker__list--dragging .tv-channel-picker__button{cursor:grabbing}@media (prefers-reduced-motion: reduce){.tv-channel-picker__list{scroll-behavior:auto}}.tv-channel-picker__list::-webkit-scrollbar{display:none}.tv-channel-picker__item{display:flex;flex-direction:column;gap:0.25rem;list-style:none;width:6.25rem;height:100%;flex-shrink:0}.tv-channel-picker__image{display:block;max-width:100%;max-height:100%;object-fit:contain;user-select:none;-webkit-user-select:none}.tv-channel-picker__fallback{font:500 0.875rem/1.25rem "Inter", "Gilroy, Arial, sans-serif";align-self:center;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.tv-channel-picker__button,.tv-channel-picker__placeholder{width:100%;align-self:center;height:3.375rem}.tv-channel-picker__button{display:flex;justify-content:center;align-items:center;border:none;cursor:pointer;border-radius:0.5rem;padding:0.5rem 0.625rem;color:var(--tv-channel-picker-text-primary-color);background-color:var(--tv-channel-picker-button-background-color)}.tv-channel-picker__button:active{background-color:var(--tv-channel-picker-button-pressed-background-color)}.tv-channel-picker__button[aria-pressed=true]{background-color:var(--tv-channel-picker-button-active-background-color)}.tv-channel-picker__button:disabled{pointer-events:none}.tv-channel-picker__button:focus-visible{outline:0.125rem solid var(--tv-channel-picker-focus-outline-color);outline-offset:-0.125rem}.tv-channel-picker__placeholder tet-placeholder{--placeholder-border-radius:0.5rem}.tv-channel-picker__button-underline{height:0.25rem;border-radius:0.5rem;background-color:var(--tv-channel-picker-button-underline-color)}`;
13
+
14
+ const DRAGGING_CLASS$2 = 'tv-channel-picker__list--dragging';
15
+ const DRAG_THRESHOLD$2 = 5;
16
+ const TetTvProgramChannelPicker = class {
17
+ constructor(hostRef) {
18
+ index.registerInstance(this, hostRef);
19
+ this.channelSelected = index.createEvent(this, "channelSelected");
20
+ }
21
+ /** Theme of the component */
22
+ theme = 'light';
23
+ /** Channels available for selection. Channel IDs must be unique. */
24
+ channels = [];
25
+ /** Selected channel ID. Defaults to the first channel when missing or unavailable. */
26
+ selectedChannel;
27
+ /** Disables channel selection and navigation while allowing scrolling. */
28
+ disabled = false;
29
+ /** Shows placeholder items while the parent fetches channels. */
30
+ loading = false;
31
+ /** Shows full-height gradients at both edges of the channel list. */
32
+ showGradients = false;
33
+ focusedChannel;
34
+ failedImageSources = [];
35
+ visibleChannelIds = [];
36
+ canScrollLeft = false;
37
+ canScrollRight = false;
38
+ /** Emitted when the user selects a different channel, with its ID. */
39
+ channelSelected;
40
+ imageObservations = new Map();
41
+ channelList;
42
+ renderedSelectedChannel;
43
+ renderedLoading = false;
44
+ drag;
45
+ suppressChannelClick = false;
46
+ resizeObserver;
47
+ connectedCallback() {
48
+ if (this.channelList) {
49
+ this.resizeObserver?.observe(this.channelList);
50
+ this.observeChannelImages();
51
+ }
52
+ }
53
+ componentWillLoad() {
54
+ this.onChannelsChange();
55
+ }
56
+ componentDidLoad() {
57
+ if (this.channelList && typeof globalThis.ResizeObserver === 'function') {
58
+ this.resizeObserver = new ResizeObserver(() => {
59
+ if (!this.drag) {
60
+ this.centerChannel();
61
+ }
62
+ this.updateScrollEdges();
63
+ });
64
+ this.resizeObserver.observe(this.channelList);
65
+ }
66
+ }
67
+ componentDidRender() {
68
+ const selectionChanged = this.renderedSelectedChannel !== this.selectedChannel;
69
+ const channelsBecameVisible = this.renderedLoading && !this.loading;
70
+ this.renderedSelectedChannel = this.selectedChannel;
71
+ this.renderedLoading = this.loading;
72
+ if (selectionChanged || channelsBecameVisible) {
73
+ this.centerChannel();
74
+ }
75
+ queueMicrotask(() => this.updateScrollEdges());
76
+ this.observeChannelImages();
77
+ }
78
+ disconnectedCallback() {
79
+ this.resizeObserver?.disconnect();
80
+ for (const stop of this.imageObservations.values()) {
81
+ stop();
82
+ }
83
+ this.imageObservations.clear();
84
+ if (this.drag) {
85
+ this.handlePointerEnd(this.drag.pointerId);
86
+ }
87
+ this.suppressChannelClick = false;
88
+ }
89
+ onThemeChange() {
90
+ this.visibleChannelIds = [];
91
+ for (const stop of this.imageObservations.values()) {
92
+ stop();
93
+ }
94
+ this.imageObservations.clear();
95
+ }
96
+ onChannelsChange() {
97
+ const channelIds = new Set(this.channels.map(channel => channel.id));
98
+ this.visibleChannelIds = this.visibleChannelIds.filter(id => channelIds.has(id));
99
+ if (!this.channels.some(channel => channel.id === this.selectedChannel)) {
100
+ this.selectedChannel = this.channels[0]?.id;
101
+ }
102
+ if (!this.channels.some(channel => channel.id === this.focusedChannel)) {
103
+ this.focusedChannel = undefined;
104
+ }
105
+ }
106
+ /** Selects a channel by ID. Missing or unknown IDs select the first channel. Does not emit channelSelected. */
107
+ async setChannel(id) {
108
+ const nextChannel = this.channels.find(channel => channel.id === id) ?? this.channels[0];
109
+ if (nextChannel?.id === this.selectedChannel) {
110
+ this.centerChannel();
111
+ }
112
+ else {
113
+ this.selectedChannel = nextChannel?.id;
114
+ }
115
+ }
116
+ handlePointerDown(event) {
117
+ this.suppressChannelClick = false;
118
+ if (event.pointerType === 'mouse' && event.button === 0 && this.channelList) {
119
+ this.drag = {
120
+ pointerId: event.pointerId,
121
+ startX: event.clientX,
122
+ scrollLeft: this.channelList.scrollLeft,
123
+ active: false,
124
+ };
125
+ }
126
+ }
127
+ handlePointerMove(event) {
128
+ const drag = this.drag;
129
+ const list = this.channelList;
130
+ if (!drag || !list || event.pointerId !== drag.pointerId) {
131
+ return;
132
+ }
133
+ if ((event.buttons & 1) === 0) {
134
+ this.handlePointerEnd(event.pointerId);
135
+ return;
136
+ }
137
+ const distance = event.clientX - drag.startX;
138
+ if (!drag.active && Math.abs(distance) < DRAG_THRESHOLD$2) {
139
+ return;
140
+ }
141
+ if (!drag.active) {
142
+ drag.active = true;
143
+ this.suppressChannelClick = true;
144
+ list.classList.add(DRAGGING_CLASS$2);
145
+ list.setPointerCapture(event.pointerId);
146
+ }
147
+ event.preventDefault();
148
+ list.scrollLeft = drag.scrollLeft - distance;
149
+ }
150
+ handlePointerEnd(pointerId) {
151
+ if (this.drag?.pointerId === pointerId) {
152
+ this.drag = undefined;
153
+ this.channelList?.classList.remove(DRAGGING_CLASS$2);
154
+ if (this.channelList?.hasPointerCapture(pointerId)) {
155
+ this.channelList.releasePointerCapture(pointerId);
156
+ }
157
+ }
158
+ }
159
+ handleChannelButtonClick(channel, event) {
160
+ if (!this.suppressChannelClick || event.detail === 0) {
161
+ this.handleChannelClick(channel);
162
+ }
163
+ }
164
+ handleChannelKeyDown(event, channel) {
165
+ if (this.disabled || this.loading || event.altKey || event.ctrlKey || event.metaKey ||
166
+ !['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) {
167
+ return;
168
+ }
169
+ event.preventDefault();
170
+ const index = this.channels.findIndex(item => item.id === channel.id);
171
+ const targetIndices = {
172
+ ArrowLeft: index - 1,
173
+ ArrowRight: index + 1,
174
+ Home: 0,
175
+ End: this.channels.length - 1,
176
+ };
177
+ const targetIndex = targetIndices[event.key];
178
+ const nextChannel = index >= 0 ? this.channels[targetIndex] : undefined;
179
+ if (nextChannel) {
180
+ this.channelList?.querySelectorAll('button')[targetIndex]?.focus({ preventScroll: true });
181
+ this.centerChannel(nextChannel.id);
182
+ }
183
+ }
184
+ handleChannelFocus(event, channel) {
185
+ this.focusedChannel = channel.id;
186
+ if (!this.drag && event.currentTarget instanceof Element && event.currentTarget.matches(':focus-visible')) {
187
+ this.centerChannel(channel.id);
188
+ }
189
+ }
190
+ handleFocusOut(event) {
191
+ const nextTarget = event.relatedTarget;
192
+ if (!(nextTarget instanceof Node) || !this.channelList?.contains(nextTarget)) {
193
+ this.focusedChannel = undefined;
194
+ this.centerChannel();
195
+ }
196
+ }
197
+ observeChannelImages() {
198
+ const list = this.channelList;
199
+ if (!list) {
200
+ return;
201
+ }
202
+ for (const [button, stop] of this.imageObservations) {
203
+ if (!list.contains(button) || this.visibleChannelIds.includes(button.dataset.channelId ?? '')) {
204
+ stop();
205
+ this.imageObservations.delete(button);
206
+ }
207
+ }
208
+ for (const button of Array.from(list.querySelectorAll('button[data-channel-id]'))) {
209
+ const channelId = button.dataset.channelId;
210
+ if (channelId && !this.visibleChannelIds.includes(channelId) && !this.imageObservations.has(button) && button.querySelector('img')) {
211
+ const observedTheme = this.theme;
212
+ const stop = visibilityObserver.observeOnce(button, () => {
213
+ if (this.theme === observedTheme && list.contains(button) && !this.visibleChannelIds.includes(channelId)) {
214
+ this.visibleChannelIds = [...this.visibleChannelIds, channelId];
215
+ }
216
+ });
217
+ this.imageObservations.set(button, stop);
218
+ }
219
+ }
220
+ }
221
+ updateScrollEdges() {
222
+ const list = this.channelList;
223
+ this.canScrollLeft = !!list && list.scrollLeft > 1;
224
+ this.canScrollRight = !!list && list.scrollWidth - list.clientWidth - list.scrollLeft > 1;
225
+ }
226
+ centerChannel(channelId = this.selectedChannel) {
227
+ const list = this.channelList;
228
+ const index = this.channels.findIndex(channel => channel.id === channelId);
229
+ const button = list?.querySelectorAll('button')[index];
230
+ if (list && button) {
231
+ const listBounds = list.getBoundingClientRect();
232
+ const buttonBounds = button.getBoundingClientRect();
233
+ const offset = buttonBounds.left - listBounds.left - list.clientLeft;
234
+ const target = list.scrollLeft + offset - (list.clientWidth - buttonBounds.width) / 2;
235
+ const maxScroll = Math.max(0, list.scrollWidth - list.clientWidth);
236
+ list.scrollLeft = Math.max(0, Math.min(target, maxScroll));
237
+ }
238
+ }
239
+ handleChannelClick(channel) {
240
+ if (this.disabled || this.loading) {
241
+ return;
242
+ }
243
+ if (channel.id === this.selectedChannel) {
244
+ this.centerChannel();
245
+ return;
246
+ }
247
+ this.selectedChannel = channel.id;
248
+ this.channelSelected.emit(channel.id);
249
+ }
250
+ renderChannelPlaceholders() {
251
+ return Array.from({ length: 16 }, (_, index$1) => (index.h("li", { class: "tv-channel-picker__item", key: `loading-${index$1}`, "aria-hidden": "true" }, index.h("div", { class: "tv-channel-picker__placeholder" }, index.h("tet-placeholder", { width: "100%", height: "100%", darkTheme: this.theme === 'dark' })))));
252
+ }
253
+ renderChannelButtons() {
254
+ return this.channels.map(channel => {
255
+ const isSelected = this.selectedChannel === channel.id;
256
+ const imageSource = this.theme === 'dark' ? channel.imageSourceDark ?? channel.imageSource : channel.imageSource;
257
+ return (index.h("li", { class: "tv-channel-picker__item", key: channel.id }, index.h("button", { type: "button", class: "tv-channel-picker__button", "data-channel-id": channel.id, disabled: this.disabled, "aria-label": channel.name, "aria-pressed": isSelected ? 'true' : 'false', tabIndex: (this.focusedChannel ?? this.selectedChannel) === channel.id ? 0 : -1, onFocus: event => this.handleChannelFocus(event, channel), onClick: event => this.handleChannelButtonClick(channel, event), onKeyDown: event => this.handleChannelKeyDown(event, channel) }, !imageSource || this.failedImageSources.includes(imageSource) ? (index.h("span", { class: "tv-channel-picker__fallback" }, channel.name)) : (index.h("img", { class: "tv-channel-picker__image", src: this.visibleChannelIds.includes(channel.id) ? imageSource : undefined, alt: "", draggable: false, onError: () => {
258
+ if (!this.failedImageSources.includes(imageSource)) {
259
+ this.failedImageSources = [...this.failedImageSources, imageSource];
260
+ }
261
+ } }))), isSelected && (index.h("div", { class: "tv-channel-picker__button-underline" }))));
262
+ });
263
+ }
264
+ render() {
265
+ return (index.h(index.Host, { key: '8e7b35a4998e34008c283b328a5cfe7ec2e969b7' }, index.h("div", { key: '043d490ec8280e64a11d36fc3ea0a15e40528609', class: {
266
+ 'tv-channel-picker': true,
267
+ 'tv-channel-picker--gradients': this.showGradients,
268
+ 'tv-channel-picker--gradient-left': this.showGradients && this.canScrollLeft,
269
+ 'tv-channel-picker--gradient-right': this.showGradients && this.canScrollRight,
270
+ } }, index.h("ul", { key: 'abf60cc7e85d5f58f9b6d6ad186480553f03fd89', class: "tv-channel-picker__list", tabIndex: -1, "aria-busy": this.loading ? 'true' : 'false', ref: element => { this.channelList = element; }, onScroll: () => this.updateScrollEdges(), onFocusout: event => this.handleFocusOut(event), onPointerDown: event => this.handlePointerDown(event), onPointerMove: event => this.handlePointerMove(event), onPointerUp: event => this.handlePointerEnd(event.pointerId), onPointerCancel: event => this.handlePointerEnd(event.pointerId), onLostPointerCapture: event => this.handlePointerEnd(event.pointerId) }, this.loading ? this.renderChannelPlaceholders() : this.renderChannelButtons()))));
271
+ }
272
+ static get watchers() { return {
273
+ "theme": [{
274
+ "onThemeChange": 0
275
+ }],
276
+ "channels": [{
277
+ "onChannelsChange": 0
278
+ }]
279
+ }; }
280
+ };
281
+ TetTvProgramChannelPicker.style = tetTvProgramChannelPickerCss();
282
+
283
+ const tetTvProgramDatePickerCss = () => `@font-face{font-family:"Gilroy";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Gilroy-W05-Medium.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Medium.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/Gilroy-W05-Medium.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Medium.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/Gilroy-W05-Semibold.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Semibold.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:700;font-display:swap;src:url("assets/fonts/Gilroy-W05-Bold.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Bold.woff") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Inter-Regular.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-Regular.woff?v=3.19") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/Inter-Medium.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-Medium.woff?v=3.19") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/Inter-SemiBold.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-SemiBold.woff?v=3.19") format("woff")}:host{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;padding:0;margin:0}:host{--tv-program-navigation-button-background-color:var(--tc-layer-grey-primary);--tv-program-navigation-button-hover-background-color:var(--tc-layer-grey-secondary);--tv-program-navigation-button-pressed-background-color:var(--tc-layer-grey-tertiary);--tv-program-navigation-button-focus-outline-color:var(--tc-blue-40)}:host([theme=dark]){--tv-program-navigation-button-background-color:var(--tc-layer-grey-primary-dark);--tv-program-navigation-button-hover-background-color:var(--tc-layer-grey-secondary-dark);--tv-program-navigation-button-pressed-background-color:var(--tc-layer-grey-tertiary-dark);--tv-program-navigation-button-focus-outline-color:var(--tc-blue-40-dark)}:host{--tv-date-picker-text-primary-color:var(--tc-text-primary);--tv-date-picker-text-permanent-black-color:var(--tc-text-black-permanent);--tv-date-picker-main-background-color:var(--tv-program-navigation-button-background-color);--tv-date-picker-button-active-background-color:var(--tc-button-primary-yellow-background-default);--tv-date-picker-button-active-box-shadow:var(--tc-elevation-one);display:block;min-height:2.75rem}:host([theme=dark]){--tv-date-picker-text-primary-color:var(--tc-text-primary-dark);--tv-date-picker-text-permanent-black-color:var(--tc-text-black-permanent-dark);--tv-date-picker-button-active-background-color:var(--tc-button-primary-yellow-background-default-dark);--tv-date-picker-button-active-box-shadow:var(--tc-elevation-one-dark)}.tv-date-picker{display:flex;align-items:center;max-width:100%;height:2.75rem}@media screen and (min-width: 48rem){.tv-date-picker{height:3.75rem;border-radius:1.875rem;padding-inline:0.5rem;background-color:var(--tv-date-picker-main-background-color)}}.tv-date-picker__button{align-items:center;border:none;cursor:pointer;background-color:var(--tv-program-navigation-button-background-color);color:var(--tv-date-picker-text-primary-color)}.tv-date-picker__button:hover{background-color:var(--tv-program-navigation-button-hover-background-color)}.tv-date-picker__button:active{background-color:var(--tv-program-navigation-button-pressed-background-color)}.tv-date-picker__button:disabled{pointer-events:none}.tv-date-picker__button:focus-visible{outline:0.125rem solid var(--tv-program-navigation-button-focus-outline-color);outline-offset:0.125rem}.tv-date-picker__button:focus-visible{z-index:1}.tv-date-picker__list{--date-gap:0.5rem;display:flex;flex:1;flex-direction:row;justify-content:safe center;gap:var(--date-gap);min-width:0;padding-block:0.25rem;margin-block:-0.25rem;padding-inline:1rem;overflow-x:auto;scroll-behavior:smooth;scrollbar-width:none;-webkit-user-select:none;user-select:none}@media screen and (min-width: 31.25rem){.tv-date-picker__list{padding-inline:2rem}}@media screen and (min-width: 48rem){.tv-date-picker__list{--visible-dates:3;display:grid;grid-auto-flow:column;grid-auto-columns:calc((100% - (var(--visible-dates) - 1) * var(--date-gap)) / var(--visible-dates));padding:0.375rem 0.5rem;margin-inline:0;scroll-snap-type:x mandatory;scroll-padding-inline:0.5rem}}@media screen and (min-width: 64rem){.tv-date-picker__list{--visible-dates:5}}.tv-date-picker__list--dragging{scroll-behavior:auto;scroll-snap-type:none}.tv-date-picker__list--dragging,.tv-date-picker__list--dragging .tv-date-picker__button{cursor:grabbing}@media (prefers-reduced-motion: reduce){.tv-date-picker__list{scroll-behavior:auto}}.tv-date-picker__list::-webkit-scrollbar{display:none}.tv-date-picker__button--nav{display:flex;align-items:center;justify-content:center;padding:0.875rem;border-radius:50%;display:none}@media screen and (min-width: 48rem){.tv-date-picker__button--nav{display:flex}}.tv-date-picker__nav-button-icon{--icon-size:1.25rem}.tv-date-picker__item{list-style:none}@media screen and (min-width: 48rem){.tv-date-picker__item{min-width:0;scroll-snap-align:start}}.tv-date-picker__button-label{display:block;overflow:hidden}@media screen and (min-width: 64rem){.tv-date-picker__date{display:block}}@media screen and (min-width: 80rem){.tv-date-picker__date{display:inline}}.tv-date-picker__button--date{font:500 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";padding-inline:1.25rem;border-radius:1.5rem;height:2.75rem;white-space:nowrap;line-height:1.25}@media screen and (min-width: 48rem){.tv-date-picker__button--date{width:100%;height:3rem;padding-inline:1.25rem}}.tv-date-picker__button--date[aria-pressed=true]{color:var(--tv-date-picker-text-permanent-black-color);background-color:var(--tv-date-picker-button-active-background-color);box-shadow:var(--tv-date-picker-button-active-box-shadow)}`;
284
+
285
+ const DRAGGING_CLASS$1 = 'tv-date-picker__list--dragging';
286
+ const DRAG_THRESHOLD$1 = 5;
287
+ const weekdayFormatter = new Intl.DateTimeFormat('lv-LV', { weekday: 'long' });
288
+ const TetTvProgramDatePicker = class {
289
+ constructor(hostRef) {
290
+ index.registerInstance(this, hostRef);
291
+ this.dateSelected = index.createEvent(this, "dateSelected");
292
+ }
293
+ /** Theme of the component */
294
+ theme = 'light';
295
+ /** Number of days displayed before and after today, clamped to 0–30. Today is always included. */
296
+ daysRange = 7;
297
+ /** Language used for translations. */
298
+ language = 'lv';
299
+ /** Disables date selection and navigation while allowing scrolling. */
300
+ disabled = false;
301
+ selectedDate = tetTvProgramPlaceholders.formatLocalDate(new Date());
302
+ focusedDate;
303
+ /** Emitted when a date is clicked, with the selected local date in YYYY-MM-DD format. */
304
+ dateSelected;
305
+ dateList;
306
+ renderedSelectedDate;
307
+ renderedDaysRange;
308
+ drag;
309
+ suppressDateClick = false;
310
+ resizeObserver;
311
+ async onDaysRangeChange() {
312
+ if (!this.getDates().some(date => tetTvProgramPlaceholders.formatLocalDate(date) === this.focusedDate)) {
313
+ this.focusedDate = undefined;
314
+ }
315
+ await this.setDate(this.selectedDate);
316
+ }
317
+ async onLanguageChange(language) {
318
+ await translations.processTranslations('tet-components', language);
319
+ index.forceUpdate(this);
320
+ }
321
+ /**
322
+ * Selects a local calendar date in YYYY-MM-DD format.
323
+ * Missing, invalid, or out-of-range dates reset to today. Does not emit dateSelected.
324
+ */
325
+ async setDate(date) {
326
+ const isAvailable = this.getDates().some(item => tetTvProgramPlaceholders.formatLocalDate(item) === date);
327
+ const nextDate = date && isAvailable ? date : tetTvProgramPlaceholders.formatLocalDate(new Date());
328
+ if (nextDate === this.selectedDate) {
329
+ this.centerDate();
330
+ }
331
+ else {
332
+ this.selectedDate = nextDate;
333
+ }
334
+ }
335
+ connectedCallback() {
336
+ if (this.dateList) {
337
+ this.resizeObserver?.observe(this.dateList);
338
+ }
339
+ }
340
+ async componentWillLoad() {
341
+ await this.onLanguageChange(this.language);
342
+ }
343
+ componentDidLoad() {
344
+ if (this.dateList && typeof globalThis.ResizeObserver === 'function') {
345
+ this.resizeObserver = new ResizeObserver(() => {
346
+ if (!this.drag) {
347
+ this.centerDate();
348
+ }
349
+ });
350
+ this.resizeObserver.observe(this.dateList);
351
+ }
352
+ }
353
+ componentDidRender() {
354
+ if (this.renderedSelectedDate !== this.selectedDate || this.renderedDaysRange !== this.daysRange) {
355
+ this.centerDate();
356
+ }
357
+ this.renderedSelectedDate = this.selectedDate;
358
+ this.renderedDaysRange = this.daysRange;
359
+ }
360
+ disconnectedCallback() {
361
+ this.resizeObserver?.disconnect();
362
+ if (this.drag) {
363
+ this.handlePointerEnd(this.drag.pointerId);
364
+ }
365
+ this.suppressDateClick = false;
366
+ }
367
+ handlePointerDown(event) {
368
+ this.suppressDateClick = false;
369
+ if (event.pointerType === 'mouse' && event.button === 0 && this.dateList) {
370
+ this.drag = {
371
+ pointerId: event.pointerId,
372
+ startX: event.clientX,
373
+ scrollLeft: this.dateList.scrollLeft,
374
+ active: false,
375
+ };
376
+ }
377
+ }
378
+ handlePointerMove(event) {
379
+ const drag = this.drag;
380
+ const list = this.dateList;
381
+ if (!drag || !list || event.pointerId !== drag.pointerId) {
382
+ return;
383
+ }
384
+ if ((event.buttons & 1) === 0) {
385
+ this.handlePointerEnd(event.pointerId);
386
+ return;
387
+ }
388
+ const distance = event.clientX - drag.startX;
389
+ if (!drag.active && Math.abs(distance) < DRAG_THRESHOLD$1) {
390
+ return;
391
+ }
392
+ if (!drag.active) {
393
+ drag.active = true;
394
+ this.suppressDateClick = true;
395
+ list.classList.add(DRAGGING_CLASS$1);
396
+ list.setPointerCapture(event.pointerId);
397
+ }
398
+ event.preventDefault();
399
+ list.scrollLeft = drag.scrollLeft - distance;
400
+ }
401
+ handlePointerEnd(pointerId) {
402
+ if (this.drag?.pointerId === pointerId) {
403
+ this.drag = undefined;
404
+ this.dateList?.classList.remove(DRAGGING_CLASS$1);
405
+ if (this.dateList?.hasPointerCapture(pointerId)) {
406
+ this.dateList.releasePointerCapture(pointerId);
407
+ }
408
+ }
409
+ }
410
+ handleDateButtonClick(date, event) {
411
+ if (!this.suppressDateClick || event.detail === 0) {
412
+ this.handleDateClick(date);
413
+ }
414
+ }
415
+ handleDateKeyDown(event, date) {
416
+ if (this.disabled || event.altKey || event.ctrlKey || event.metaKey || !['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) {
417
+ return;
418
+ }
419
+ event.preventDefault();
420
+ const dates = this.getDates();
421
+ const index = dates.findIndex(item => tetTvProgramPlaceholders.formatLocalDate(item) === tetTvProgramPlaceholders.formatLocalDate(date));
422
+ const targetIndices = {
423
+ ArrowLeft: index - 1,
424
+ ArrowRight: index + 1,
425
+ Home: 0,
426
+ End: dates.length - 1,
427
+ };
428
+ const nextDate = index >= 0 ? dates[targetIndices[event.key]] : undefined;
429
+ if (nextDate) {
430
+ this.focusedDate = tetTvProgramPlaceholders.formatLocalDate(nextDate);
431
+ this.dateList?.querySelectorAll('button')[targetIndices[event.key]]?.focus({ preventScroll: true });
432
+ this.centerDate(this.focusedDate);
433
+ }
434
+ }
435
+ handleDateFocus(event, dateValue) {
436
+ this.focusedDate = dateValue;
437
+ if (!this.drag && event.currentTarget instanceof Element && event.currentTarget.matches(':focus-visible')) {
438
+ this.centerDate(dateValue);
439
+ }
440
+ }
441
+ handleFocusOut(event) {
442
+ if (!(event.relatedTarget instanceof Node) || !this.dateList?.contains(event.relatedTarget)) {
443
+ this.focusedDate = undefined;
444
+ this.centerDate();
445
+ }
446
+ }
447
+ centerDate(dateValue = this.selectedDate) {
448
+ const list = this.dateList;
449
+ const index = this.getDates().findIndex(date => tetTvProgramPlaceholders.formatLocalDate(date) === dateValue);
450
+ const button = list?.querySelectorAll('button')[index];
451
+ if (list && button) {
452
+ const listBounds = list.getBoundingClientRect();
453
+ const buttonBounds = button.getBoundingClientRect();
454
+ const offset = buttonBounds.left - listBounds.left - list.clientLeft;
455
+ const target = list.scrollLeft + offset - (list.clientWidth - buttonBounds.width) / 2;
456
+ const maxScroll = Math.max(0, list.scrollWidth - list.clientWidth);
457
+ list.scrollLeft = Math.max(0, Math.min(target, maxScroll));
458
+ }
459
+ }
460
+ getDates() {
461
+ const range = Number.isFinite(this.daysRange) ? Math.min(30, Math.max(0, Math.floor(this.daysRange))) : 0;
462
+ const today = new Date();
463
+ return Array.from({ length: range * 2 + 1 }, (_, index) => (new Date(today.getFullYear(), today.getMonth(), today.getDate() + index - range)));
464
+ }
465
+ formatLabel(date, dayOffset) {
466
+ const weekday = weekdayFormatter.format(date);
467
+ const capitalizedWeekday = weekday.charAt(0).toLocaleUpperCase('lv-LV') + weekday.slice(1);
468
+ const relativeDayKeys = {
469
+ [-1]: 'components-tv-program-yesterday',
470
+ 0: 'components-tv-program-today',
471
+ 1: 'components-tv-program-tomorrow',
472
+ };
473
+ const translationKey = relativeDayKeys[dayOffset];
474
+ const dayName = translationKey ? translations.translate(translationKey) : capitalizedWeekday;
475
+ const day = String(date.getDate()).padStart(2, '0');
476
+ const month = String(date.getMonth() + 1).padStart(2, '0');
477
+ return (index.h("span", { class: "tv-date-picker__button-label" }, index.h("span", null, dayName, ","), ' ', index.h("span", { class: "tv-date-picker__date" }, day, ".", month)));
478
+ }
479
+ handleDateClick(date) {
480
+ const formattedDate = tetTvProgramPlaceholders.formatLocalDate(date);
481
+ if (this.disabled) {
482
+ return;
483
+ }
484
+ if (formattedDate === this.selectedDate) {
485
+ this.centerDate();
486
+ return;
487
+ }
488
+ this.selectedDate = formattedDate;
489
+ this.dateSelected.emit(formattedDate);
490
+ }
491
+ getNavigationDate(position, dates) {
492
+ const selectedIndex = dates.findIndex(date => tetTvProgramPlaceholders.formatLocalDate(date) === this.selectedDate);
493
+ const offset = position === 'left' ? -1 : 1;
494
+ return selectedIndex >= 0 ? dates[selectedIndex + offset] : undefined;
495
+ }
496
+ handleNavButtonClick(position) {
497
+ const date = this.getNavigationDate(position, this.getDates());
498
+ if (date) {
499
+ this.handleDateClick(date);
500
+ }
501
+ }
502
+ renderNavigationButtons(position, dates) {
503
+ const isPrevious = position === 'left';
504
+ const iconName = isPrevious ? 'tc-chevron-left' : 'tc-chevron-right';
505
+ const label = translations.translate(isPrevious ? 'components-tv-program-previous-day' : 'components-tv-program-next-day');
506
+ const disabled = this.disabled || !this.getNavigationDate(position, dates);
507
+ return (index.h("button", { type: "button", class: {
508
+ "tv-date-picker__button": true,
509
+ "tv-date-picker__button--nav": true,
510
+ }, "aria-label": label, disabled: disabled, onClick: () => this.handleNavButtonClick(position) }, index.h("tet-icon", { class: "tv-date-picker__nav-button-icon", name: iconName, theme: this.theme, type: disabled ? 'tertiary' : 'primary' })));
511
+ }
512
+ render() {
513
+ const dates = this.getDates();
514
+ const todayIndex = Math.floor(dates.length / 2);
515
+ return (index.h(index.Host, { key: '7f8afb427c4be4c85d17f7fe329f488bbac48fdb' }, index.h("div", { key: '71562a184402085fcfa0add98a53f00233a6ef18', class: "tv-date-picker" }, this.renderNavigationButtons('left', dates), index.h("ul", { key: '9aa58de9e9811ede5826cbed8a1cf7153cdef74b', class: "tv-date-picker__list", tabIndex: -1, ref: element => { this.dateList = element; }, onFocusout: event => this.handleFocusOut(event), onPointerDown: event => this.handlePointerDown(event), onPointerMove: event => this.handlePointerMove(event), onPointerUp: event => this.handlePointerEnd(event.pointerId), onPointerCancel: event => this.handlePointerEnd(event.pointerId), onLostPointerCapture: event => this.handlePointerEnd(event.pointerId) }, dates.map((date, index$1) => {
516
+ const dateValue = tetTvProgramPlaceholders.formatLocalDate(date);
517
+ const isSelected = this.selectedDate === dateValue;
518
+ return (index.h("li", { class: "tv-date-picker__item", key: dateValue }, index.h("button", { type: "button", class: "tv-date-picker__button tv-date-picker__button--date", disabled: this.disabled, "aria-pressed": isSelected ? 'true' : 'false', tabIndex: (this.focusedDate ?? this.selectedDate) === dateValue ? 0 : -1, onFocus: event => this.handleDateFocus(event, dateValue), onClick: event => this.handleDateButtonClick(date, event), onKeyDown: event => this.handleDateKeyDown(event, date) }, index.h("time", { dateTime: dateValue }, this.formatLabel(date, index$1 - todayIndex)))));
519
+ })), this.renderNavigationButtons('right', dates))));
520
+ }
521
+ static get watchers() { return {
522
+ "daysRange": [{
523
+ "onDaysRangeChange": 0
524
+ }],
525
+ "language": [{
526
+ "onLanguageChange": 0
527
+ }]
528
+ }; }
529
+ };
530
+ TetTvProgramDatePicker.style = tetTvProgramDatePickerCss();
531
+
532
+ const tetTvProgramScheduleCss = () => `@font-face{font-family:"Gilroy";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Gilroy-W05-Medium.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Medium.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/Gilroy-W05-Medium.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Medium.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/Gilroy-W05-Semibold.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Semibold.woff") format("woff")}@font-face{font-family:"Gilroy";font-style:normal;font-weight:700;font-display:swap;src:url("assets/fonts/Gilroy-W05-Bold.woff2") format("woff2"), url("assets/fonts/Gilroy-W05-Bold.woff") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Inter-Regular.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-Regular.woff?v=3.19") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:500;font-display:swap;src:url("assets/fonts/Inter-Medium.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-Medium.woff?v=3.19") format("woff")}@font-face{font-family:"Inter";font-style:normal;font-weight:600;font-display:swap;src:url("assets/fonts/Inter-SemiBold.woff2?v=3.19") format("woff2"), url("assets/fonts/Inter-SemiBold.woff?v=3.19") format("woff")}:host{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;padding:0;margin:0}:host{--tv-program-navigation-button-background-color:var(--tc-layer-grey-primary);--tv-program-navigation-button-hover-background-color:var(--tc-layer-grey-secondary);--tv-program-navigation-button-pressed-background-color:var(--tc-layer-grey-tertiary);--tv-program-navigation-button-focus-outline-color:var(--tc-blue-40)}:host([theme=dark]){--tv-program-navigation-button-background-color:var(--tc-layer-grey-primary-dark);--tv-program-navigation-button-hover-background-color:var(--tc-layer-grey-secondary-dark);--tv-program-navigation-button-pressed-background-color:var(--tc-layer-grey-tertiary-dark);--tv-program-navigation-button-focus-outline-color:var(--tc-blue-40-dark)}:host{--tv-program-tooltip-background-color:var(--tc-layer-primary);--tv-program-tooltip-text-primary-color:var(--tc-text-primary);--tv-program-tooltip-text-secondary-color:var(--tc-text-secondary);--tv-program-tooltip-box-shadow:var(--tc-elevation-four)}:host([theme=dark]){--tv-program-tooltip-background-color:var(--tc-layer-primary-dark);--tv-program-tooltip-text-primary-color:var(--tc-text-primary-dark);--tv-program-tooltip-text-secondary-color:var(--tc-text-secondary-dark);--tv-program-tooltip-box-shadow:var(--tc-elevation-four-dark)}:host{--tv-program-hour-width:20rem;--day-width:calc(var(--tv-program-hour-width) * 24);--channel-container-width:8rem;--channel-gap:0.5rem;--channel-row-height:5.375rem;--channel-gutter:calc(var(--channel-container-width) + var(--channel-gap));--tv-program-background-color:var(--tc-background-primary);--tv-program-text-primary-color:var(--tc-text-primary);--tv-program-text-secondary-color:var(--tc-text-secondary);--tv-program-current-time-line-color:var(--tc-yellow-40);--tv-program-current-time-line-box-shadow:var(--tc-elevation-two);--tv-program-logo-background-color:var(--tc-layer-grey-secondary);--tv-program-detail-container-background-color:var(--tc-layer-yellow-tertiary);--tv-program-close-button-hover-background-color:var(--tc-button-secondary-adaptive-yellow-background-hover);--tv-program-close-button-pressed-background-color:var(--tc-button-secondary-adaptive-yellow-background-pressed);--tv-program-focus-outline-color:var(--tc-blue-40);display:block;min-width:0;scroll-margin-top:var(--tv-program-schedule-sticky-top, 0px);color:var(--tv-program-text-primary-color)}:host([theme=dark]){--tv-program-background-color:var(--tc-background-primary-dark);--tv-program-text-primary-color:var(--tc-text-primary-dark);--tv-program-text-secondary-color:var(--tc-text-secondary-dark);--tv-program-current-time-line-color:var(--tc-yellow-40-dark);--tv-program-current-time-line-box-shadow:var(--tc-elevation-two-dark);--tv-program-logo-background-color:var(--tc-layer-grey-secondary-dark);--tv-program-detail-container-background-color:var(--tc-layer-yellow-tertiary-dark);--tv-program-close-button-hover-background-color:var(--tc-button-secondary-adaptive-yellow-background-hover-dark);--tv-program-close-button-pressed-background-color:var(--tc-button-secondary-adaptive-yellow-background-pressed-dark);--tv-program-focus-outline-color:var(--tc-blue-40-dark)}.tv-program__item-placeholder{--placeholder-border-radius:1rem;flex:1;min-width:0}.tv-program__channel-logo-placeholder{--placeholder-border-radius:1rem;width:100%}.tv-program__schedule-container{--schedule-fader-width:2.25rem;position:relative;min-width:0}.tv-program__schedule-container::before{content:"";position:absolute;inset:0 auto 0 -0.25rem;width:var(--channel-gutter);background-color:var(--tv-program-background-color);z-index:4;pointer-events:none}.tv-program__schedule-container--scrollable-left::before{width:calc(var(--channel-gutter) + 0.25rem)}.tv-program__schedule-container--scrollable-left>.tv-program__schedule-fader-left{opacity:1}.tv-program__schedule-container::after{content:"";position:absolute;inset:0 -0.25rem 0 auto;width:var(--schedule-fader-width);background:linear-gradient(270deg, var(--tv-program-background-color) 0%, transparent 100%);z-index:1;pointer-events:none;opacity:0}.tv-program__schedule-container--scrollable-right::after{opacity:1}.tv-program__schedule-fader-left{position:absolute;inset:0 auto 0 var(--channel-gutter);width:var(--schedule-fader-width);background:linear-gradient(90deg, var(--tv-program-background-color) 0%, transparent 100%);z-index:1;pointer-events:none;opacity:0}.tv-program__schedule-edge-mask{position:absolute;inset:0 -0.25rem 0 auto;width:0.25rem;background-color:var(--tv-program-background-color);z-index:2;pointer-events:none}.tv-program__timeline-button-container{position:absolute;top:1rem;z-index:6;background-color:var(--tv-program-background-color)}.tv-program__timeline-button-container--previous{left:0;padding-right:1rem}.tv-program__timeline-button-container--next{right:0;padding-left:1rem;z-index:auto;background-color:transparent}.tv-program__timeline-button-container--next::before{content:"";position:absolute;inset:0;z-index:5;background-color:var(--tv-program-background-color)}.tv-program__timeline-button{align-items:center;border:none;cursor:pointer;background-color:var(--tv-program-navigation-button-background-color);display:flex;align-items:center;justify-content:center;padding:0.875rem;border-radius:50%;position:relative;z-index:6}.tv-program__timeline-button:hover{background-color:var(--tv-program-navigation-button-hover-background-color)}.tv-program__timeline-button:active{background-color:var(--tv-program-navigation-button-pressed-background-color)}.tv-program__timeline-button:disabled{pointer-events:none}.tv-program__timeline-button:focus-visible{outline:0.125rem solid var(--tv-program-navigation-button-focus-outline-color);outline-offset:0.125rem}.tv-program__timeline-button-icon{--icon-size:1.25rem}.tv-program__schedule-header{position:sticky;top:var(--tv-program-schedule-sticky-top, 0);z-index:5;background-color:var(--tv-program-background-color)}.tv-program__schedule-header::before{content:"";position:absolute;inset:0 auto 0 0;width:var(--channel-gutter);background-color:var(--tv-program-background-color);z-index:6;pointer-events:none}.tv-program__header-viewport{position:relative;overflow:hidden;padding-top:1rem}.tv-program__header-viewport>.tv-program__schedule{padding-bottom:2.25rem}.tv-program__schedule-container--dragging,.tv-program__schedule-container--dragging *{cursor:grabbing;-webkit-user-select:none;user-select:none}.tv-program__schedule-viewport{--placeholder-width:max(0px, min(var(--day-width), calc(var(--viewport-width, 100vw) - var(--channel-gutter) - 0.5rem)));min-width:0;max-width:calc(100% + 0.5rem);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;padding-inline:0.25rem;margin-inline:-0.25rem}.tv-program__schedule-viewport::-webkit-scrollbar{display:none}.tv-program__schedule-viewport>.tv-program__schedule{padding-block:0.25rem}.tv-program__schedule{position:relative;display:flex;flex-direction:column;gap:1rem;width:calc(var(--channel-gutter) + var(--day-width))}.tv-program__timeline{position:relative;-webkit-user-select:none;user-select:none;display:flex;align-items:center;width:var(--day-width);height:3rem;padding:0.625rem 0;margin-left:var(--channel-gutter)}.tv-program__timeline-label{font:400 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";position:absolute;z-index:4;white-space:nowrap;color:var(--tv-program-text-secondary-color);transform:translateX(-50%)}.tv-program__timeline-label:last-child{transform:translateX(-100%)}.tv-program__timeline-label--hour{font:600 1.5rem/1.75rem "Gilroy", "Gilroy, Arial, sans-serif";color:var(--tv-program-text-primary-color)}.tv-program__current-time{position:absolute;z-index:2;top:0;bottom:0;left:calc(var(--channel-gutter) + var(--day-width) * var(--current-time-position));width:0.125rem;pointer-events:none;background-color:var(--tv-program-current-time-line-color);box-shadow:var(--tv-program-current-time-line-box-shadow)}.tv-program__current-time--header{top:-1rem;z-index:5}.tv-program__current-time--header::before{content:"";position:absolute;top:0;left:50%;width:1.25rem;height:1.25rem;border-radius:50%;background-color:inherit;transform:translateX(-50%)}.tv-program__channel-row{display:grid;grid-template-columns:var(--channel-container-width) var(--day-width);gap:var(--channel-gap);row-gap:0;align-items:center}.tv-program__program-details{--accordion-header-display:none;scroll-margin-block-start:calc(var(--tv-program-schedule-sticky-top, 0px) + var(--schedule-header-height, 0px) + var(--channel-row-height) + 0.25rem);scroll-margin-block-end:0.25rem;position:sticky;left:0;grid-column:1/-1;width:calc(var(--viewport-width, 100vw) - 0.5rem);min-width:0;z-index:4}@media (prefers-reduced-motion: reduce){.tv-program__program-details{--accordion-animation-duration:0s}}.tv-program__program-details-spacing{box-sizing:border-box;padding-top:1rem}.tv-program__program-details-content{font:400 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";display:flex;align-items:flex-start;gap:1.5rem;padding:2rem;border-radius:1rem;background-color:var(--tv-program-detail-container-background-color);color:var(--tv-program-text-primary-color)}.tv-program__program-details-content-left{flex:1;min-width:0;max-width:24rem;height:14rem;border-radius:1rem;overflow:hidden}.tv-program__program-details-content-right{display:flex;flex:1;flex-direction:column;gap:0.5rem;min-width:0;overflow-wrap:anywhere}.tv-program__program-details-content-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem}.tv-program__program-details-content-meta{display:flex;flex-wrap:wrap;gap:0.5rem;color:var(--tv-program-text-secondary-color)}.tv-program__program-details-content-description{margin-top:0.5rem}.tv-program__program-details-close{width:2rem;height:2rem;border-radius:50%;background:none;border:none;flex-shrink:0;cursor:pointer}.tv-program__program-details-close:hover{background-color:var(--tv-program-close-button-hover-background-color)}.tv-program__program-details-close:active{background-color:var(--tv-program-close-button-pressed-background-color)}.tv-program__program-details-close:focus-visible{outline:0.125rem solid var(--tv-program-focus-outline-color);outline-offset:0.125rem}.tv-program__program-details-close-icon{--icon-size:1.25rem}.tv-program__program-details-title{font:600 1.75rem/2rem "Gilroy", "Gilroy, Arial, sans-serif";min-width:0}.tv-program__program-details-image{display:block;width:100%;height:100%;object-fit:cover;border-radius:1rem}.tv-program__channel-logo{font:500 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";position:sticky;left:0;z-index:4;display:flex;align-items:center;justify-content:center;align-self:stretch;background-color:var(--tv-program-logo-background-color);border-radius:1rem;padding:0;height:var(--channel-row-height);min-width:0}.tv-program__channel-logo--placeholder{padding:0}.tv-program__channel-info-button{position:relative;display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;padding:1.5rem 0.5rem;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;cursor:pointer}.tv-program__channel-info-button:focus-visible{outline:0.125rem solid var(--tv-program-navigation-button-focus-outline-color);outline-offset:0.125rem}.tv-program__channel-tooltip-anchor{position:absolute;inset:0;pointer-events:none}.tv-program__channel-tooltip{font:400 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";--tooltip-delay-show:600ms;--tooltip-delay-hide:120ms;--tooltip-max-width:40rem;--tooltip-padding:1.5rem;--tooltip-border-radius:1rem;--tooltip-background-color:var(--tv-program-tooltip-background-color);--tooltip-text-color:var(--tv-program-tooltip-text-primary-color);border-radius:1rem;box-shadow:var(--tv-program-tooltip-box-shadow);--tooltip-max-width:18.75rem;width:18.75rem;z-index:100;pointer-events:auto;visibility:hidden}.tv-program__channel-tooltip.visible{visibility:visible}.tv-program__channel-tooltip-content{display:flex;flex-direction:column;gap:0.5rem;color:var(--tv-program-tooltip-text-primary-color)}.tv-program__channel-tooltip-header{font:500 1rem/1.5rem "Inter", "Gilroy, Arial, sans-serif";display:flex;justify-content:space-between;gap:1rem}.tv-program__channel-tooltip-language{color:var(--tv-program-text-secondary-color)}.tv-program__channel-image{display:block;width:100%;height:100%;object-fit:contain}.tv-program__channel-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tv-program__channel{position:relative;display:block;height:var(--channel-row-height);list-style:none}.tv-program__channel>li{position:absolute;top:0;bottom:0;display:flex;box-sizing:border-box;min-width:0}.tv-program__channel>li:has(>tet-tv-program-item[data-focus-visible]){z-index:3}.tv-program__channel>li:not(:last-child){padding-right:0.5rem}.tv-program__channel tet-tv-program-item{scroll-margin-inline-start:calc(var(--channel-gutter) + 0.25rem);scroll-margin-inline-end:0.25rem}.tv-program__channel-info-button,.tv-program__channel tet-tv-program-item{scroll-margin-block-start:calc(var(--tv-program-schedule-sticky-top, 0px) + var(--schedule-header-height, 0px) + 0.25rem);scroll-margin-block-end:0.25rem}.tv-program__channel>li.tv-program__placeholders{position:sticky;left:var(--channel-gutter);gap:0.5rem;width:var(--placeholder-width);height:100%;padding-right:0}`;
533
+
534
+ const DRAG_THRESHOLD = 5;
535
+ const DRAGGING_CLASS = 'tv-program__schedule-container--dragging';
536
+ const MINUTES_PER_DAY = 24 * 60;
537
+ const MINUTE_MS = 60 * 1000;
538
+ const TIMELINE_STEP = 15;
539
+ const MINUTES_PER_HOUR = 60;
540
+ const LABELS = Array.from({ length: MINUTES_PER_DAY / TIMELINE_STEP + 1 }, (_, index) => {
541
+ const minute = index * TIMELINE_STEP;
542
+ const isHour = minute % 60 === 0;
543
+ return {
544
+ minute,
545
+ isHour,
546
+ label: isHour ? `${String(minute / 60).padStart(2, '0')}:00` : String(minute % 60),
547
+ left: `${minute / MINUTES_PER_DAY * 100}%`,
548
+ };
549
+ });
550
+ const TetTvProgramSchedule = class {
551
+ constructor(hostRef) {
552
+ index.registerInstance(this, hostRef);
553
+ this.currentTimeVisibilityChanged = index.createEvent(this, "currentTimeVisibilityChanged");
554
+ }
555
+ /** Theme of the schedule and its broadcast cards. */
556
+ theme = 'light';
557
+ /** Language used for navigation labels. */
558
+ language = 'lv';
559
+ /** Translated title displayed for unavailable broadcasts and their details. */
560
+ unavailableTitle = '';
561
+ /** Loaded channel schedules. Channels with no loaded schedule should be omitted. */
562
+ schedules = [];
563
+ /** Available channel metadata, retained while programs reload. */
564
+ channels = [];
565
+ /** Selected local calendar date in YYYY-MM-DD format. */
566
+ date = tetTvProgramPlaceholders.formatLocalDate();
567
+ /** Whether channel metadata is loading. */
568
+ channelsLoading = false;
569
+ /** Whether broadcast programs are loading. */
570
+ programLoading = false;
571
+ /** Whether the next page of channel schedules is loading. */
572
+ loadingMoreChannels = false;
573
+ /** Current timestamp supplied by the parent clock. */
574
+ currentTime = Date.now();
575
+ /** Broadcast status and progress supplied by the parent clock. */
576
+ broadcastTiming = {};
577
+ visibleRange;
578
+ selectedItemId;
579
+ focusedItemId;
580
+ focusedChannelId;
581
+ visibleChannelIds = new Set();
582
+ channelTooltipState;
583
+ canScrollPrevious = false;
584
+ canScrollNext = false;
585
+ failedChannelLogoSources = new Set();
586
+ /** Whether today's current-time line is visible outside the channel gutter. */
587
+ currentTimeVisibilityChanged;
588
+ get element() { return index.getElement(this); }
589
+ channelIdsByRow = new WeakMap();
590
+ channelAnchors = new Map();
591
+ channelRows = new Map();
592
+ channelButtons = new Map();
593
+ placeholderCounts = new Map();
594
+ readyPrograms = new WeakMap();
595
+ channelTooltipLifecycle = new formatProgramStartDate.TooltipLifecycle(() => this.finishChannelTooltip());
596
+ programDetails = new Map();
597
+ detailsAccordions = new Map();
598
+ activePrograms = new Map();
599
+ drag;
600
+ suppressClick = false;
601
+ viewport;
602
+ headerViewport;
603
+ timeline;
604
+ resizeObserver;
605
+ rowVisibilityObserver;
606
+ rangeFrame;
607
+ currentTimeVisible;
608
+ channelTooltip;
609
+ pendingChannelTooltip;
610
+ channelTooltipHovered = false;
611
+ channelTooltipFocused = false;
612
+ channelTooltipPinned = false;
613
+ pendingPrograms = new WeakMap();
614
+ hydrationVersion = 0;
615
+ itemPositions = new WeakMap();
616
+ pendingProgramFocus;
617
+ pendingDetailsScroll;
618
+ detailsScrollTimer;
619
+ pendingDetailsResize;
620
+ detailsResizeAnimation;
621
+ navigationMinute;
622
+ connectedCallback() {
623
+ this.observeChannelVisibility();
624
+ if (this.viewport) {
625
+ this.observeViewport();
626
+ }
627
+ }
628
+ async componentWillLoad() {
629
+ await this.onLanguageChange(this.language);
630
+ }
631
+ componentDidLoad() {
632
+ this.observeViewport();
633
+ }
634
+ componentDidRender() {
635
+ this.focusPendingProgram();
636
+ this.waitForProgramItems();
637
+ this.channelTooltipLifecycle.attach(this.channelTooltip);
638
+ for (const [channelId, accordion] of this.detailsAccordions) {
639
+ this.syncProgramDetails(channelId, accordion);
640
+ }
641
+ }
642
+ disconnectedCallback() {
643
+ this.detailsResizeAnimation?.cancel();
644
+ clearTimeout(this.detailsScrollTimer);
645
+ this.pendingDetailsScroll = undefined;
646
+ this.invalidateProgramHydration();
647
+ this.resetChannelTooltip();
648
+ if (this.drag) {
649
+ this.handlePointerEnd(this.drag.pointerId);
650
+ }
651
+ this.suppressClick = false;
652
+ if (this.rangeFrame !== undefined) {
653
+ cancelAnimationFrame(this.rangeFrame);
654
+ this.rangeFrame = undefined;
655
+ }
656
+ this.resizeObserver?.disconnect();
657
+ this.resizeObserver = undefined;
658
+ this.rowVisibilityObserver?.disconnect();
659
+ this.rowVisibilityObserver = undefined;
660
+ }
661
+ /** Blocks clicks triggered by dragging. */
662
+ handleClick(event) {
663
+ if (this.suppressClick && event.detail !== 0) {
664
+ event.preventDefault();
665
+ event.stopImmediatePropagation();
666
+ }
667
+ }
668
+ /** Resets keyboard navigation and dismisses channel tooltips. */
669
+ handleChannelTooltipKeydown(event) {
670
+ if (event.key === 'Tab') {
671
+ this.navigationMinute = undefined;
672
+ }
673
+ if (event.key === 'Escape' && this.channelTooltipState) {
674
+ this.hideChannelTooltip();
675
+ }
676
+ }
677
+ /** Handles schedule navigation and details dismissal. */
678
+ handleScheduleKeydown(event) {
679
+ const path = event.composedPath();
680
+ const program = path.find(element => element.tagName === 'TET-TV-PROGRAM-ITEM');
681
+ if (event.key === 'Escape') {
682
+ this.closeProgramDetailsOnEscape(event, path);
683
+ return;
684
+ }
685
+ if (program) {
686
+ const channel = this.schedules.find(row => row.items.includes(program.item));
687
+ if (channel) {
688
+ this.navigatePrograms(event, channel.id, program.item);
689
+ }
690
+ }
691
+ else if (event.key === 'ArrowUp' || event.key === 'ArrowDown') {
692
+ const button = path.find(element => element.classList?.contains('tv-program__channel-info-button'));
693
+ if (button && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
694
+ event.preventDefault();
695
+ const channels = this.programLoading && this.channels.length > 0 ? this.channels : this.schedules;
696
+ const buttons = channels.map(channel => this.channelButtons.get(channel.id));
697
+ const index = buttons.indexOf(button) + (event.key === 'ArrowDown' ? 1 : -1);
698
+ buttons[index]?.focus();
699
+ }
700
+ }
701
+ }
702
+ /** Hides channel tooltips when the viewport changes. */
703
+ dismissChannelTooltipOnViewportChange() {
704
+ if (this.channelTooltipState) {
705
+ this.hideChannelTooltip();
706
+ }
707
+ }
708
+ /** Retains selected details and captures their previous height. */
709
+ retainSelectedItem(event) {
710
+ this.selectedItemId = event.detail;
711
+ const channel = this.schedules.find(schedule => schedule.items.some(item => item.id === event.detail));
712
+ const item = channel?.items.find(program => program.id === event.detail);
713
+ this.pendingDetailsResize = undefined;
714
+ if (channel && item) {
715
+ const accordion = this.detailsAccordions.get(channel.id);
716
+ const content = accordion?.querySelector('.tv-program__program-details-spacing');
717
+ if (accordion?.isOpen && content) {
718
+ this.pendingDetailsResize = { channelId: channel.id, height: content.getBoundingClientRect().height };
719
+ }
720
+ this.detailsResizeAnimation?.cancel();
721
+ this.programDetails.set(channel.id, item);
722
+ this.pendingDetailsScroll = item.id;
723
+ }
724
+ }
725
+ /** Tracks focused items to keep them mounted. */
726
+ updateFocusedItem() {
727
+ queueMicrotask(() => {
728
+ const active = this.element.shadowRoot?.activeElement;
729
+ this.focusedItemId = active?.item?.id;
730
+ if (!active && !this.pendingProgramFocus) {
731
+ this.focusedChannelId = undefined;
732
+ }
733
+ });
734
+ }
735
+ /** Clears selection and navigation when the date changes. */
736
+ resetRetainedItems() {
737
+ this.activePrograms.clear();
738
+ this.pendingProgramFocus = undefined;
739
+ this.navigationMinute = undefined;
740
+ this.itemPositions = new WeakMap();
741
+ this.resetChannelTooltip();
742
+ this.selectedItemId = undefined;
743
+ this.focusedItemId = undefined;
744
+ this.programDetails.clear();
745
+ }
746
+ /** Removes details for programs no longer in the schedule. */
747
+ resetProgramDetails() {
748
+ for (const [channelId, item] of this.programDetails) {
749
+ if (!this.schedules.find(channel => channel.id === channelId)?.items.includes(item)) {
750
+ this.programDetails.delete(channelId);
751
+ if (this.selectedItemId === item.id) {
752
+ this.selectedItemId = undefined;
753
+ }
754
+ }
755
+ }
756
+ }
757
+ /** Reloads translations when the language changes. */
758
+ async onLanguageChange(language) {
759
+ await translations.processTranslations('tet-components', language);
760
+ index.forceUpdate(this);
761
+ }
762
+ /** Invalidates pending item readiness checks. */
763
+ invalidateProgramHydration() {
764
+ this.hydrationVersion++;
765
+ this.pendingPrograms = new WeakMap();
766
+ }
767
+ /** Reports whether the current-time marker is visible. */
768
+ updateCurrentTimeVisibility() {
769
+ const viewport = this.viewport;
770
+ const timeline = this.timeline;
771
+ const now = new Date(this.currentTime);
772
+ let visible = false;
773
+ if (viewport && timeline && viewport.clientWidth > 0 && timeline.clientWidth > 0 && this.date === tetTvProgramPlaceholders.formatLocalDate(now)) {
774
+ const width = this.headerViewport?.clientWidth || viewport.clientWidth;
775
+ const minute = this.getCurrentTimeMinute();
776
+ const position = timeline.offsetLeft + timeline.clientWidth * minute / MINUTES_PER_DAY - viewport.scrollLeft;
777
+ visible = position >= timeline.offsetLeft && position < width;
778
+ }
779
+ if (this.currentTimeVisible !== visible) {
780
+ this.currentTimeVisible = visible;
781
+ this.currentTimeVisibilityChanged.emit(visible);
782
+ }
783
+ }
784
+ /** Clears channel tooltip state and timers. */
785
+ resetChannelTooltip() {
786
+ this.channelTooltipLifecycle.reset();
787
+ this.pendingChannelTooltip = undefined;
788
+ this.channelTooltipState = undefined;
789
+ this.channelTooltipHovered = false;
790
+ this.channelTooltipFocused = false;
791
+ this.channelTooltipPinned = false;
792
+ }
793
+ /** Centers the shared horizontal viewport on the current local time. */
794
+ async scrollToNow(behavior = 'smooth') {
795
+ if (this.viewport && this.timeline) {
796
+ const left = this.getCurrentTimeScrollLeft();
797
+ const reducedMotion = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
798
+ if (behavior === 'smooth' && !reducedMotion) {
799
+ this.viewport.scrollTo({ left, behavior });
800
+ }
801
+ else {
802
+ this.viewport.scrollLeft = left;
803
+ }
804
+ this.updateNavigation();
805
+ }
806
+ }
807
+ /** Syncs details expansion and animates content height changes. */
808
+ async syncProgramDetails(channelId, accordion) {
809
+ await accordion.componentOnReady?.();
810
+ if (this.detailsAccordions.get(channelId) !== accordion || !accordion.isConnected) {
811
+ return;
812
+ }
813
+ const open = this.programDetails.get(channelId)?.id === this.selectedItemId;
814
+ if (!open) {
815
+ accordion.querySelector('.tv-program__program-details-spacing')?.getAnimations?.().forEach(animation => animation.cancel());
816
+ }
817
+ if (accordion.isOpen !== open) {
818
+ await accordion.setState(open);
819
+ }
820
+ if (open && this.pendingDetailsResize?.channelId === channelId) {
821
+ const { height } = this.pendingDetailsResize;
822
+ this.pendingDetailsResize = undefined;
823
+ const content = accordion.querySelector('.tv-program__program-details-spacing');
824
+ const nextHeight = content?.getBoundingClientRect().height;
825
+ if (content && height !== nextHeight && !globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches) {
826
+ const duration = Number.parseFloat(getComputedStyle(accordion).getPropertyValue('--accordion-animation-duration')) * 1000;
827
+ this.detailsResizeAnimation = content.animate?.([
828
+ { height: `${height}px`, overflow: 'hidden' },
829
+ { height: `${nextHeight}px`, overflow: 'hidden' },
830
+ ], { duration: duration || 0, easing: 'ease-in-out' });
831
+ }
832
+ }
833
+ if (open && this.selectedItemId && this.pendingDetailsScroll === this.selectedItemId) {
834
+ this.pendingDetailsScroll = undefined;
835
+ this.scheduleDetailsScroll(accordion, this.selectedItemId);
836
+ }
837
+ }
838
+ /** Scrolls details into view after expansion. */
839
+ scheduleDetailsScroll(accordion, itemId) {
840
+ clearTimeout(this.detailsScrollTimer);
841
+ const duration = Number.parseFloat(getComputedStyle(accordion).getPropertyValue('--accordion-animation-duration')) || 0;
842
+ this.detailsScrollTimer = setTimeout(() => {
843
+ if (!accordion.isConnected || !accordion.isOpen || this.selectedItemId !== itemId) {
844
+ return;
845
+ }
846
+ const style = getComputedStyle(accordion);
847
+ const marginTop = Number.parseFloat(style.scrollMarginTop) || 0;
848
+ const marginBottom = Number.parseFloat(style.scrollMarginBottom) || 0;
849
+ const height = accordion.getBoundingClientRect().height + marginTop + marginBottom;
850
+ const reducedMotion = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
851
+ accordion.scrollIntoView?.({
852
+ block: height > globalThis.innerHeight ? 'start' : 'nearest',
853
+ inline: 'nearest',
854
+ behavior: reducedMotion ? 'instant' : 'smooth',
855
+ });
856
+ }, duration * 1000);
857
+ }
858
+ /** Tracks channel rows near the viewport to limit program item rendering. */
859
+ observeChannelVisibility() {
860
+ if (this.rowVisibilityObserver || typeof globalThis.IntersectionObserver !== 'function') {
861
+ return;
862
+ }
863
+ const options = { rootMargin: '500px 0px', scrollMargin: '500px 0px' };
864
+ this.rowVisibilityObserver = new IntersectionObserver(entries => {
865
+ const visible = new Set(this.visibleChannelIds);
866
+ let changed = false;
867
+ for (const entry of entries) {
868
+ const id = this.channelIdsByRow.get(entry.target);
869
+ if (id !== undefined && this.channelRows.get(id) === entry.target && visible.has(id) !== entry.isIntersecting) {
870
+ if (entry.isIntersecting) {
871
+ visible.add(id);
872
+ }
873
+ else {
874
+ visible.delete(id);
875
+ }
876
+ changed = true;
877
+ }
878
+ }
879
+ if (changed) {
880
+ this.visibleChannelIds = visible;
881
+ }
882
+ }, options);
883
+ for (const row of this.channelRows.values()) {
884
+ this.rowVisibilityObserver.observe(row);
885
+ }
886
+ }
887
+ /** Registers channel rows for visibility tracking. */
888
+ setChannelRow(channelId, row) {
889
+ const previous = this.channelRows.get(channelId);
890
+ if (previous === row) {
891
+ return;
892
+ }
893
+ if (previous) {
894
+ this.rowVisibilityObserver?.unobserve(previous);
895
+ }
896
+ if (row) {
897
+ this.channelRows.set(channelId, row);
898
+ this.channelIdsByRow.set(row, channelId);
899
+ this.rowVisibilityObserver?.observe(row);
900
+ }
901
+ else {
902
+ this.channelRows.delete(channelId);
903
+ }
904
+ }
905
+ /** Keeps visible, selected, and focused rows mounted. */
906
+ shouldRenderChannelItems(channelId, items) {
907
+ const hasRetainedItem = this.selectedItemId !== undefined || this.focusedItemId !== undefined;
908
+ return !this.rowVisibilityObserver || this.visibleChannelIds.has(channelId) || this.focusedChannelId === channelId
909
+ || (hasRetainedItem && Boolean(items?.some(item => item.id === this.selectedItemId || item.id === this.focusedItemId)));
910
+ }
911
+ /**
912
+ * Keeps row placeholders visible until the initial mounted items finish hydrating.
913
+ * Caches readiness per program array and date; later mounts do not reset row placeholders.
914
+ */
915
+ waitForProgramItems() {
916
+ if (this.channelsLoading || this.programLoading || !this.visibleRange) {
917
+ return;
918
+ }
919
+ const key = this.date;
920
+ const version = this.hydrationVersion;
921
+ const pending = [];
922
+ for (const { id, items } of this.schedules) {
923
+ if (!this.shouldRenderChannelItems(id, items)) {
924
+ continue;
925
+ }
926
+ const row = this.channelRows.get(id);
927
+ if (!row || this.readyPrograms.get(items) === key || this.pendingPrograms.get(items) === key) {
928
+ continue;
929
+ }
930
+ this.pendingPrograms.set(items, key);
931
+ const elements = Array.from(row.querySelectorAll('tet-tv-program-item'));
932
+ pending.push(Promise.all(elements.map(element => element.componentOnReady?.())).then(() => {
933
+ if (version === this.hydrationVersion) {
934
+ this.readyPrograms.set(items, key);
935
+ this.pendingPrograms.delete(items);
936
+ }
937
+ }));
938
+ }
939
+ if (pending.length > 0) {
940
+ Promise.all(pending).then(() => {
941
+ if (version === this.hydrationVersion && this.element.isConnected) {
942
+ index.forceUpdate(this);
943
+ }
944
+ });
945
+ }
946
+ }
947
+ /** Updates navigation when viewport dimensions change. */
948
+ observeViewport() {
949
+ if (this.viewport && typeof globalThis.ResizeObserver === 'function') {
950
+ this.resizeObserver = new ResizeObserver(() => this.updateNavigation());
951
+ this.resizeObserver.observe(this.viewport);
952
+ if (this.timeline) {
953
+ this.resizeObserver.observe(this.timeline);
954
+ }
955
+ if (this.headerViewport) {
956
+ this.resizeObserver.observe(this.headerViewport);
957
+ }
958
+ }
959
+ else {
960
+ queueMicrotask(() => {
961
+ if (this.element.isConnected) {
962
+ this.updateNavigation();
963
+ }
964
+ });
965
+ }
966
+ }
967
+ /** Syncs scroll controls, header position, and viewport measurements. */
968
+ updateNavigation() {
969
+ const initialized = this.initializeVisibleRange();
970
+ const headerHeight = `${this.headerViewport?.offsetHeight ?? 0}px`;
971
+ if (this.element.style.getPropertyValue('--schedule-header-height') !== headerHeight) {
972
+ this.element.style.setProperty('--schedule-header-height', headerHeight);
973
+ }
974
+ this.updateCurrentTimeVisibility();
975
+ if (!initialized) {
976
+ this.scheduleVisibleRange();
977
+ }
978
+ const viewport = this.viewport;
979
+ const width = viewport?.clientWidth ?? 0;
980
+ const scrollLeft = viewport?.scrollLeft ?? 0;
981
+ const previous = scrollLeft > 1;
982
+ const next = Boolean(viewport && scrollLeft < viewport.scrollWidth - width - 1);
983
+ if (this.canScrollPrevious !== previous) {
984
+ this.canScrollPrevious = previous;
985
+ }
986
+ if (this.canScrollNext !== next) {
987
+ this.canScrollNext = next;
988
+ }
989
+ if (viewport && this.headerViewport && this.headerViewport.scrollLeft !== scrollLeft) {
990
+ this.headerViewport.scrollLeft = scrollLeft;
991
+ }
992
+ const cssWidth = `${width}px`;
993
+ if (viewport && viewport.style.getPropertyValue('--viewport-width') !== cssWidth) {
994
+ viewport.style.setProperty('--viewport-width', cssWidth);
995
+ }
996
+ }
997
+ /** Sets the initial range, centering today's schedule on now. */
998
+ initializeVisibleRange() {
999
+ if (this.visibleRange || !this.viewport?.clientWidth || !this.timeline?.clientWidth) {
1000
+ return false;
1001
+ }
1002
+ if (this.date === tetTvProgramPlaceholders.formatLocalDate(new Date(this.currentTime))) {
1003
+ this.viewport.scrollLeft = this.getCurrentTimeScrollLeft();
1004
+ }
1005
+ this.updateVisibleRange();
1006
+ return true;
1007
+ }
1008
+ /** Returns local minutes since midnight, including seconds. */
1009
+ getCurrentTimeMinute() {
1010
+ const now = new Date(this.currentTime);
1011
+ return now.getHours() * MINUTES_PER_HOUR + now.getMinutes()
1012
+ + (now.getSeconds() * 1000 + now.getMilliseconds()) / MINUTE_MS;
1013
+ }
1014
+ /** Calculates the scroll offset that centers the current time. */
1015
+ getCurrentTimeScrollLeft() {
1016
+ const viewport = this.viewport;
1017
+ const timeline = this.timeline;
1018
+ if (!viewport || !timeline) {
1019
+ return 0;
1020
+ }
1021
+ const fraction = this.getCurrentTimeMinute() / MINUTES_PER_DAY;
1022
+ const width = this.headerViewport?.clientWidth || viewport.clientWidth;
1023
+ return Math.max(0, timeline.offsetLeft + timeline.clientWidth * fraction - width / 2);
1024
+ }
1025
+ /** Batches visible range updates into one animation frame. */
1026
+ scheduleVisibleRange() {
1027
+ this.rangeFrame ??= requestAnimationFrame(() => {
1028
+ this.rangeFrame = undefined;
1029
+ this.updateVisibleRange();
1030
+ });
1031
+ }
1032
+ /** Calculates visible hours with a one-hour rendering buffer. */
1033
+ updateVisibleRange() {
1034
+ if (!this.viewport || !this.timeline) {
1035
+ return;
1036
+ }
1037
+ const { scrollLeft, clientWidth } = this.viewport;
1038
+ const dayWidth = this.timeline.clientWidth;
1039
+ const gutter = this.timeline.offsetLeft;
1040
+ if (!(clientWidth > 0 && dayWidth > 0)) {
1041
+ return;
1042
+ }
1043
+ const pixelsPerMinute = dayWidth / MINUTES_PER_DAY;
1044
+ const start = Math.max(0, (Math.floor((scrollLeft - gutter) / pixelsPerMinute / MINUTES_PER_HOUR) - 1) * MINUTES_PER_HOUR);
1045
+ const end = Math.min(MINUTES_PER_DAY, (Math.ceil((scrollLeft + clientWidth - gutter) / pixelsPerMinute / MINUTES_PER_HOUR) + 1) * MINUTES_PER_HOUR);
1046
+ if (this.visibleRange?.start !== start || this.visibleRange?.end !== end) {
1047
+ this.visibleRange = { start, end };
1048
+ }
1049
+ }
1050
+ /** Prepares horizontal dragging. */
1051
+ handlePointerDown(event) {
1052
+ this.suppressClick = false;
1053
+ const isNavigationButton = event.composedPath().some(target => target instanceof globalThis.Element && target.classList.contains('tv-program__timeline-button'));
1054
+ if (event.pointerType === 'mouse' && event.button === 0 && this.viewport && !isNavigationButton) {
1055
+ this.drag = {
1056
+ pointerId: event.pointerId, startX: event.clientX, scrollLeft: this.viewport.scrollLeft,
1057
+ surface: event.currentTarget, active: false,
1058
+ };
1059
+ }
1060
+ }
1061
+ /** Scrolls horizontally once the drag threshold is reached. */
1062
+ handlePointerMove(event) {
1063
+ const drag = this.drag;
1064
+ if (!drag || !this.viewport || drag.pointerId !== event.pointerId) {
1065
+ return;
1066
+ }
1067
+ if ((event.buttons & 1) === 0) {
1068
+ this.handlePointerEnd(event.pointerId);
1069
+ return;
1070
+ }
1071
+ const distance = event.clientX - drag.startX;
1072
+ if (!drag.active && Math.abs(distance) < DRAG_THRESHOLD) {
1073
+ return;
1074
+ }
1075
+ if (!drag.active) {
1076
+ drag.active = true;
1077
+ this.suppressClick = true;
1078
+ drag.surface.classList.add(DRAGGING_CLASS);
1079
+ drag.surface.setPointerCapture(event.pointerId);
1080
+ }
1081
+ event.preventDefault();
1082
+ this.viewport.scrollLeft = drag.scrollLeft - distance;
1083
+ this.updateNavigation();
1084
+ }
1085
+ /** Clears dragging state and releases pointer capture. */
1086
+ handlePointerEnd(pointerId) {
1087
+ if (this.drag?.pointerId === pointerId) {
1088
+ const { surface } = this.drag;
1089
+ this.drag = undefined;
1090
+ surface.classList.remove(DRAGGING_CLASS);
1091
+ if (surface.hasPointerCapture(pointerId)) {
1092
+ surface.releasePointerCapture(pointerId);
1093
+ }
1094
+ }
1095
+ }
1096
+ /** Scrolls the schedule in the requested direction. */
1097
+ scrollSchedule(direction) {
1098
+ const reducedMotion = globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
1099
+ this.viewport?.scrollBy({ left: direction * 320, behavior: reducedMotion ? 'auto' : 'smooth' });
1100
+ }
1101
+ /** Converts a program time to minutes relative to the selected day. */
1102
+ getTimelineMinute(date, time) {
1103
+ const [hours, minutes] = time.split(':').map(Number);
1104
+ const days = (Date.parse(date) - Date.parse(this.date)) / (MINUTES_PER_DAY * MINUTE_MS);
1105
+ return days * MINUTES_PER_DAY + hours * 60 + minutes;
1106
+ }
1107
+ /** Finds the program closest to the requested timeline minute. */
1108
+ getNearestProgram(items, minute) {
1109
+ let nearest;
1110
+ let distance = Infinity;
1111
+ for (const item of items) {
1112
+ const start = this.getTimelineMinute(item.startDate, item.startTime);
1113
+ const end = this.getTimelineMinute(item.endDate, item.endTime);
1114
+ if (!Number.isFinite(start) || !Number.isFinite(end) || end <= start || end <= 0 || start >= MINUTES_PER_DAY) {
1115
+ continue;
1116
+ }
1117
+ const gap = Math.max(start - minute, minute - end, 0);
1118
+ if (gap < distance || (start <= minute && minute < end)) {
1119
+ nearest = item;
1120
+ distance = gap;
1121
+ }
1122
+ }
1123
+ return nearest;
1124
+ }
1125
+ /** Chooses the channel's keyboard tab stop. */
1126
+ getActiveProgram(channelId, items) {
1127
+ const remembered = items.find(item => item.id === this.activePrograms.get(channelId));
1128
+ const now = new Date(this.currentTime);
1129
+ const minute = this.date === tetTvProgramPlaceholders.formatLocalDate(now)
1130
+ ? now.getHours() * MINUTES_PER_HOUR + now.getMinutes()
1131
+ : this.visibleRange?.start ?? 0;
1132
+ return remembered ?? this.getNearestProgram(items, minute);
1133
+ }
1134
+ /** Moves keyboard focus between programs and channels. */
1135
+ navigatePrograms(event, channelId, item) {
1136
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
1137
+ return;
1138
+ }
1139
+ const channelIndex = this.schedules.findIndex(channel => channel.id === channelId);
1140
+ const channel = this.schedules[channelIndex];
1141
+ if (!channel) {
1142
+ return;
1143
+ }
1144
+ const index = channel.items.indexOf(item);
1145
+ let targetChannel = channel;
1146
+ let target;
1147
+ switch (event.key) {
1148
+ case 'ArrowLeft':
1149
+ target = channel.items[index - 1];
1150
+ if (!target) {
1151
+ this.channelButtons.get(channelId)?.focus();
1152
+ }
1153
+ break;
1154
+ case 'ArrowRight':
1155
+ target = channel.items[index + 1];
1156
+ break;
1157
+ case 'Home':
1158
+ target = channel.items[0];
1159
+ break;
1160
+ case 'End':
1161
+ target = channel.items.at(-1);
1162
+ break;
1163
+ case 'ArrowUp':
1164
+ case 'ArrowDown': {
1165
+ const channels = this.schedules.filter(row => row.items.length > 0);
1166
+ const index = channels.findIndex(row => row.id === channelId);
1167
+ targetChannel = channels[index + (event.key === 'ArrowDown' ? 1 : -1)];
1168
+ this.navigationMinute ??= Math.max(0, this.getTimelineMinute(item.startDate, item.startTime));
1169
+ target = targetChannel && this.getNearestProgram(targetChannel.items, this.navigationMinute);
1170
+ break;
1171
+ }
1172
+ default:
1173
+ return;
1174
+ }
1175
+ event.preventDefault();
1176
+ if (target && targetChannel) {
1177
+ if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown') {
1178
+ this.navigationMinute = undefined;
1179
+ }
1180
+ this.activePrograms.set(targetChannel.id, target.id);
1181
+ this.pendingProgramFocus = { channelId: targetChannel.id, itemId: target.id };
1182
+ this.focusedChannelId = targetChannel.id;
1183
+ this.focusedItemId = target.id;
1184
+ }
1185
+ }
1186
+ /** Focuses the requested program once it is ready. */
1187
+ async focusPendingProgram() {
1188
+ const pending = this.pendingProgramFocus;
1189
+ if (!pending) {
1190
+ return;
1191
+ }
1192
+ const items = this.channelRows.get(pending.channelId)?.querySelectorAll('tet-tv-program-item');
1193
+ const item = Array.from(items ?? []).find(element => element.item.id === pending.itemId);
1194
+ if (item) {
1195
+ this.pendingProgramFocus = undefined;
1196
+ await item.componentOnReady?.();
1197
+ if (this.focusedItemId === pending.itemId && item.isConnected) {
1198
+ item.shadowRoot?.querySelector('button')?.focus({ preventScroll: true });
1199
+ item.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
1200
+ }
1201
+ }
1202
+ }
1203
+ /** Opens or switches the channel tooltip. */
1204
+ showChannelTooltip(channel, interaction) {
1205
+ const anchor = this.channelAnchors.get(channel.id);
1206
+ if (!anchor) {
1207
+ return;
1208
+ }
1209
+ if (interaction === 'click' && this.channelTooltipState?.channel.id === channel.id && this.channelTooltipPinned) {
1210
+ this.hideChannelTooltip();
1211
+ return;
1212
+ }
1213
+ const sameChannel = this.channelTooltipState?.channel.id === channel.id;
1214
+ if (this.channelTooltipState && !sameChannel) {
1215
+ this.pendingChannelTooltip = { channel, interaction };
1216
+ this.channelTooltipHovered = false;
1217
+ this.channelTooltipFocused = false;
1218
+ this.channelTooltipPinned = false;
1219
+ this.channelTooltipLifecycle.dismiss();
1220
+ return;
1221
+ }
1222
+ this.pendingChannelTooltip = undefined;
1223
+ if (!sameChannel) {
1224
+ this.channelTooltipLifecycle.reset();
1225
+ this.channelTooltipHovered = false;
1226
+ this.channelTooltipFocused = false;
1227
+ this.channelTooltipPinned = false;
1228
+ this.channelTooltipState = { channel, anchor };
1229
+ }
1230
+ this.channelTooltipLifecycle.request(interaction === 'click');
1231
+ this.channelTooltipHovered ||= interaction === 'hover';
1232
+ this.channelTooltipFocused ||= interaction === 'focus';
1233
+ this.channelTooltipPinned ||= interaction === 'click';
1234
+ }
1235
+ /** Hides the channel tooltip when no interaction keeps it open. */
1236
+ leaveChannelTooltip(channelId, focused = false) {
1237
+ if (this.pendingChannelTooltip?.channel.id === channelId) {
1238
+ const interaction = this.pendingChannelTooltip.interaction;
1239
+ if (focused ? interaction !== 'hover' : interaction === 'hover') {
1240
+ this.pendingChannelTooltip = undefined;
1241
+ }
1242
+ return;
1243
+ }
1244
+ if (this.channelTooltipState?.channel.id !== channelId) {
1245
+ return;
1246
+ }
1247
+ if (focused) {
1248
+ this.channelTooltipFocused = false;
1249
+ this.channelTooltipPinned = false;
1250
+ }
1251
+ else {
1252
+ this.channelTooltipHovered = false;
1253
+ }
1254
+ if (!this.channelTooltipHovered && !this.channelTooltipFocused && !this.channelTooltipPinned) {
1255
+ this.channelTooltipLifecycle.dismiss();
1256
+ }
1257
+ }
1258
+ /** Starts channel tooltip dismissal. */
1259
+ hideChannelTooltip() {
1260
+ this.pendingChannelTooltip = undefined;
1261
+ this.channelTooltipHovered = false;
1262
+ this.channelTooltipFocused = false;
1263
+ this.channelTooltipPinned = false;
1264
+ this.channelTooltipLifecycle.dismiss(true);
1265
+ }
1266
+ /** Clears the dismissed tooltip and opens any queued tooltip. */
1267
+ finishChannelTooltip() {
1268
+ const pending = this.pendingChannelTooltip;
1269
+ this.resetChannelTooltip();
1270
+ if (pending) {
1271
+ this.showChannelTooltip(pending.channel, pending.interaction);
1272
+ }
1273
+ }
1274
+ /** Closes details unless Escape is already handled or a channel tooltip is open. */
1275
+ closeProgramDetailsOnEscape(event, path) {
1276
+ if (event.defaultPrevented || this.channelTooltipState) {
1277
+ return;
1278
+ }
1279
+ const details = Array.from(this.detailsAccordions).find(([channelId, accordion]) => accordion.isOpen && this.programDetails.get(channelId)?.id === this.selectedItemId);
1280
+ if (details) {
1281
+ event.preventDefault();
1282
+ event.stopPropagation();
1283
+ this.closeProgramDetails(details[0], path.includes(details[1]));
1284
+ }
1285
+ }
1286
+ /** Closes selected details and optionally restores program focus. */
1287
+ async closeProgramDetails(channelId, restoreFocus = true) {
1288
+ const itemId = this.programDetails.get(channelId)?.id;
1289
+ if (!itemId || itemId !== this.selectedItemId) {
1290
+ return;
1291
+ }
1292
+ const items = this.channelRows.get(channelId)?.querySelectorAll('tet-tv-program-item') ?? [];
1293
+ const item = Array.from(items).find(element => element.item.id === itemId);
1294
+ this.selectedItemId = undefined;
1295
+ await item?.close();
1296
+ if (restoreFocus) {
1297
+ item?.shadowRoot?.querySelector('button')?.focus({ preventScroll: true });
1298
+ }
1299
+ }
1300
+ renderNavigationButton(direction) {
1301
+ const previous = direction === 'previous';
1302
+ const disabled = previous ? !this.canScrollPrevious : !this.canScrollNext;
1303
+ return (index.h("div", { class: `tv-program__timeline-button-container tv-program__timeline-button-container--${direction}` }, index.h("button", { type: "button", class: "tv-program__timeline-button", disabled: disabled, "aria-label": translations.translate(previous ? 'components-tv-program-scroll-backward' : 'components-tv-program-scroll-forward'), onClick: () => this.scrollSchedule(previous ? -1 : 1) }, index.h("tet-icon", { class: "tv-program__timeline-button-icon", name: previous ? 'tc-chevron-left' : 'tc-chevron-right', theme: this.theme, type: disabled ? 'tertiary' : 'primary' }))));
1304
+ }
1305
+ renderItem(item, channelId, activeItemId, loading = false) {
1306
+ let position = this.itemPositions.get(item);
1307
+ if (!position) {
1308
+ position = {
1309
+ start: Math.max(0, this.getTimelineMinute(item.startDate, item.startTime)),
1310
+ end: Math.min(MINUTES_PER_DAY, this.getTimelineMinute(item.endDate, item.endTime)),
1311
+ };
1312
+ this.itemPositions.set(item, position);
1313
+ }
1314
+ const { start, end } = position;
1315
+ if (!Number.isFinite(start) || !Number.isFinite(end) || end <= start) {
1316
+ return null;
1317
+ }
1318
+ const retained = item.id === this.selectedItemId || item.id === this.focusedItemId || item.id === activeItemId;
1319
+ // Stable shells prevent Stencil from moving retained custom elements when the time window advances.
1320
+ const renderContent = retained || Boolean(this.visibleRange && end > this.visibleRange.start && start < this.visibleRange.end);
1321
+ const timing = this.broadcastTiming[item.id];
1322
+ return (index.h("li", { key: item.id, "aria-hidden": renderContent ? undefined : 'true', style: {
1323
+ display: renderContent ? undefined : 'none',
1324
+ left: `${start / MINUTES_PER_DAY * 100}%`,
1325
+ width: `${(end - start) / MINUTES_PER_DAY * 100}%`,
1326
+ visibility: loading ? 'hidden' : undefined,
1327
+ } }, renderContent && index.h("tet-tv-program-item", { item: item, unavailableTitle: this.unavailableTitle, clippedStart: item.startDate < this.date, clippedEnd: this.getTimelineMinute(item.endDate, item.endTime) > MINUTES_PER_DAY, theme: this.theme, layout: "desktop", buttonTabIndex: item.id === activeItemId ? 0 : -1, onFocusin: event => {
1328
+ this.activePrograms.set(channelId, item.id);
1329
+ this.focusedItemId = item.id;
1330
+ this.focusedChannelId = channelId;
1331
+ const element = event.currentTarget;
1332
+ if (element.shadowRoot?.querySelector('button')?.matches(':focus-visible')) {
1333
+ element.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
1334
+ }
1335
+ }, isActive: timing?.isActive ?? false, progress: timing?.progress ?? 0 })));
1336
+ }
1337
+ renderCurrentTime(header = false) {
1338
+ const now = new Date(this.currentTime);
1339
+ if (this.date !== tetTvProgramPlaceholders.formatLocalDate(now)) {
1340
+ return null;
1341
+ }
1342
+ const minute = this.getCurrentTimeMinute();
1343
+ return (index.h("div", { class: { 'tv-program__current-time': true, 'tv-program__current-time--header': header }, "aria-hidden": "true", style: { '--current-time-position': `${minute / MINUTES_PER_DAY}` } }));
1344
+ }
1345
+ renderChannelButton(channel) {
1346
+ return (index.h("h2", { class: "tv-program__channel-logo" }, index.h("button", { type: "button", class: "tv-program__channel-info-button", ref: element => {
1347
+ if (element) {
1348
+ this.channelButtons.set(channel.id, element);
1349
+ }
1350
+ else {
1351
+ this.channelButtons.delete(channel.id);
1352
+ }
1353
+ }, "aria-label": channel.name, "aria-describedby": `channel-description-${channel.id}`, onMouseEnter: () => this.showChannelTooltip(channel, 'hover'), onMouseLeave: () => this.leaveChannelTooltip(channel.id), onFocus: event => {
1354
+ this.focusedChannelId = channel.id;
1355
+ this.navigationMinute = undefined;
1356
+ if (event.currentTarget.matches(':focus-visible')) {
1357
+ event.currentTarget.scrollIntoView?.({ block: 'nearest', inline: 'nearest' });
1358
+ this.showChannelTooltip(channel, 'focus');
1359
+ }
1360
+ }, onBlur: () => this.leaveChannelTooltip(channel.id, true), onClick: () => this.showChannelTooltip(channel, 'click') }, index.h("span", { class: "tv-program__channel-tooltip-anchor", "aria-hidden": "true", ref: element => {
1361
+ if (element) {
1362
+ this.channelAnchors.set(channel.id, element);
1363
+ }
1364
+ else {
1365
+ this.channelAnchors.delete(channel.id);
1366
+ }
1367
+ } }), this.renderChannelLogo(channel)), index.h("span", { id: `channel-description-${channel.id}`, hidden: true }, channel.channelNumber, channel.description && `, ${channel.description}`, channel.languages.length > 0 && `, ${translations.translate('components-tv-program-channel-languages')}: ${channel.languages.join(', ').toUpperCase()}`)));
1368
+ }
1369
+ renderChannelTooltip() {
1370
+ if (!this.channelTooltipState) {
1371
+ return null;
1372
+ }
1373
+ const { channel, anchor } = this.channelTooltipState;
1374
+ return (index.h("tet-tooltip", { key: channel.id, class: "tv-program__channel-tooltip", hoverElement: anchor, doNotShowOnHover: true, position: TooltipPosition.TooltipPosition.RIGHT, "aria-hidden": "true", ref: element => { this.channelTooltip = element; }, onMouseEnter: () => this.showChannelTooltip(channel, 'hover'), onMouseLeave: () => this.leaveChannelTooltip(channel.id) }, index.h("span", { class: "tv-program__channel-tooltip-content" }, index.h("span", { class: "tv-program__channel-tooltip-header" }, index.h("span", null, channel.name), index.h("span", null, channel.channelNumber)), channel.description && index.h("span", null, channel.description), channel.languages.length > 0 && (index.h("span", null, index.h("span", { class: "tv-program__channel-tooltip-language" }, translations.translate('components-tv-program-channel-languages'), ": "), channel.languages.join(', ').toUpperCase())))));
1375
+ }
1376
+ renderChannels() {
1377
+ const channels = this.programLoading && this.channels.length > 0 ? this.channels : this.schedules;
1378
+ const itemsByChannel = new Map(this.schedules.map(channel => [channel.id, channel.items]));
1379
+ return channels.map(channel => {
1380
+ const items = itemsByChannel.get(channel.id);
1381
+ const activeItemId = this.getActiveProgram(channel.id, items ?? [])?.id;
1382
+ const renderItems = Boolean(this.visibleRange) && this.shouldRenderChannelItems(channel.id, items);
1383
+ const loading = renderItems && (this.programLoading || Boolean(items?.length && this.readyPrograms.get(items) !== this.date));
1384
+ return (index.h("section", { class: "tv-program__channel-row", key: channel.id, "aria-label": channel.name }, this.renderChannelButton(channel), index.h("ul", { class: "tv-program__channel", "aria-busy": loading ? 'true' : 'false', ref: element => this.setChannelRow(channel.id, element) }, renderItems && !this.programLoading && items?.map(item => this.renderItem(item, channel.id, activeItemId, loading)), loading && this.renderPlaceholders(channel.id)), this.renderProgramDetails(channel.id)));
1385
+ });
1386
+ }
1387
+ renderProgramDetails(channelId) {
1388
+ const item = this.programDetails.get(channelId);
1389
+ if (!item || this.programLoading) {
1390
+ return null;
1391
+ }
1392
+ const title = item.isUnavailable ? this.unavailableTitle : item.title;
1393
+ return (index.h("tet-accordion", { class: "tv-program__program-details", theme: this.theme, isHeaderInteractive: false, transparentBackground: true, ref: element => {
1394
+ if (element) {
1395
+ this.detailsAccordions.set(channelId, element);
1396
+ }
1397
+ else {
1398
+ this.detailsAccordions.delete(channelId);
1399
+ }
1400
+ } }, index.h("div", { class: "tv-program__program-details-spacing" }, index.h("section", { class: "tv-program__program-details-content", "aria-label": title }, item.image && (index.h("div", { class: "tv-program__program-details-content-left" }, index.h("img", { class: "tv-program__program-details-image", src: item.image, alt: "", loading: "lazy", draggable: false }))), index.h("div", { class: "tv-program__program-details-content-right" }, index.h("div", { class: "tv-program__program-details-content-header" }, index.h("h3", { class: "tv-program__program-details-title" }, title), index.h("button", { class: "tv-program__program-details-close", type: "button", "aria-label": translations.translate('components-tv-program-close'), onClick: () => { this.closeProgramDetails(channelId); } }, index.h("tet-icon", { class: "tv-program__program-details-close-icon", name: "tc-close", theme: this.theme }))), index.h("div", { class: "tv-program__program-details-content-meta" }, index.h("span", null, item.startTime, " - ", item.endTime), index.h("span", null, formatProgramStartDate.formatProgramStartDate(item.startDate)), index.h("span", null, item.channelName)), item.description && index.h("p", { class: "tv-program__program-details-content-description" }, item.description))))));
1401
+ }
1402
+ renderChannelLogo(channel) {
1403
+ const imageSource = this.theme === 'dark' ? channel.imageSourceDark ?? channel.imageSource : channel.imageSource;
1404
+ return imageSource && !this.failedChannelLogoSources.has(imageSource) ? (index.h("img", { key: imageSource, class: "tv-program__channel-image", src: imageSource, alt: "", loading: "lazy", draggable: false, onError: () => {
1405
+ this.failedChannelLogoSources = new Set([...this.failedChannelLogoSources, imageSource]);
1406
+ } })) : (index.h("span", { class: "tv-program__channel-name", "aria-hidden": "true" }, channel.name));
1407
+ }
1408
+ renderLoadingChannels(prefix = 'initial') {
1409
+ return Array.from({ length: 20 }, (_, index$1) => (index.h("section", { class: "tv-program__channel-row", key: `${prefix}-channel-placeholder-${index$1}`, "aria-hidden": "true" }, index.h("div", { class: "tv-program__channel-logo tv-program__channel-logo--placeholder" }, index.h("tet-placeholder", { class: "tv-program__channel-logo-placeholder", height: "var(--channel-row-height)", darkTheme: this.theme === 'dark' })), index.h("ul", { class: "tv-program__channel" }, this.renderPlaceholders(`channel-placeholder-${index$1}`)))));
1410
+ }
1411
+ renderPlaceholders(channelId) {
1412
+ let count = this.placeholderCounts.get(channelId);
1413
+ if (count === undefined) {
1414
+ count = 2 + Math.floor(Math.random() * 3);
1415
+ this.placeholderCounts.set(channelId, count);
1416
+ }
1417
+ return tetTvProgramPlaceholders.renderProgramPlaceholders(this.theme, 'desktop', count);
1418
+ }
1419
+ render() {
1420
+ return (index.h("div", { key: 'b9ace66a9a91b2537ee9fbdc5def52f016cf7a8e', class: {
1421
+ 'tv-program__schedule-container': true,
1422
+ 'tv-program__schedule-container--scrollable-left': this.canScrollPrevious,
1423
+ 'tv-program__schedule-container--scrollable-right': this.canScrollNext,
1424
+ }, onPointerDown: event => this.handlePointerDown(event), onPointerMove: event => this.handlePointerMove(event), onPointerUp: event => this.handlePointerEnd(event.pointerId), onPointerCancel: event => this.handlePointerEnd(event.pointerId), onLostPointerCapture: event => this.handlePointerEnd(event.pointerId), onDragStart: event => event.preventDefault() }, this.renderChannelTooltip(), index.h("span", { key: '9213355e58757dbb581cf46b245bea0b8fdf6ed6', class: "tv-program__schedule-fader-left", "aria-hidden": "true" }), index.h("div", { key: '071cf8353309df9c15a47c6be6b0cf855f0a7cad', class: "tv-program__schedule-header" }, this.renderNavigationButton('previous'), this.renderNavigationButton('next'), index.h("div", { key: '873d860398ecbc42efc4b9bb50617c3f14879131', class: "tv-program__header-viewport", ref: element => { this.headerViewport = element; } }, index.h("div", { key: '91069ebd701b08d3bc58b886694305911e86e454', class: "tv-program__schedule" }, index.h("div", { key: 'abdd7d83467847796a7731fdebdf72d3c07a9008', class: "tv-program__timeline", "aria-hidden": "true", ref: element => { this.timeline = element; } }, LABELS.map(({ minute, isHour, label, left }) => (index.h("span", { key: minute, class: { 'tv-program__timeline-label': true, 'tv-program__timeline-label--hour': isHour }, style: { left } }, label)))), this.renderCurrentTime(true)))), index.h("div", { key: '3f22a7e8f3d9ebf837284b98d4a7e1dc6244b091', class: "tv-program__schedule-viewport", "aria-busy": this.channelsLoading || this.programLoading || this.loadingMoreChannels ? 'true' : 'false', ref: element => { this.viewport = element; }, onScroll: () => this.updateNavigation() }, index.h("div", { key: '792d5b3e5145bd76a2ae0e10513482fc136c3714', class: "tv-program__schedule" }, this.channelsLoading ? (this.renderLoadingChannels()) : this.renderChannels(), this.loadingMoreChannels && this.renderLoadingChannels('next-page'), this.renderCurrentTime())), index.h("span", { key: '99bc0df7a3879565ea2e03930d96fc51d10d55e8', class: "tv-program__schedule-edge-mask", "aria-hidden": "true" })));
1425
+ }
1426
+ static get watchers() { return {
1427
+ "date": [{
1428
+ "resetRetainedItems": 0
1429
+ }, {
1430
+ "invalidateProgramHydration": 0
1431
+ }, {
1432
+ "updateCurrentTimeVisibility": 0
1433
+ }],
1434
+ "schedules": [{
1435
+ "resetProgramDetails": 0
1436
+ }, {
1437
+ "invalidateProgramHydration": 0
1438
+ }, {
1439
+ "resetChannelTooltip": 0
1440
+ }],
1441
+ "language": [{
1442
+ "onLanguageChange": 0
1443
+ }],
1444
+ "programLoading": [{
1445
+ "invalidateProgramHydration": 0
1446
+ }],
1447
+ "visibleChannelIds": [{
1448
+ "invalidateProgramHydration": 0
1449
+ }],
1450
+ "visibleRange": [{
1451
+ "invalidateProgramHydration": 0
1452
+ }],
1453
+ "currentTime": [{
1454
+ "updateCurrentTimeVisibility": 0
1455
+ }],
1456
+ "channels": [{
1457
+ "resetChannelTooltip": 0
1458
+ }]
1459
+ }; }
1460
+ };
1461
+ TetTvProgramSchedule.style = tetTvProgramScheduleCss();
1462
+
1463
+ exports.tet_tv_program_channel_picker = TetTvProgramChannelPicker;
1464
+ exports.tet_tv_program_date_picker = TetTvProgramDatePicker;
1465
+ exports.tet_tv_program_schedule = TetTvProgramSchedule;