@swisspost/design-system-components 9.0.0-next.12 → 9.0.0-next.14

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 (452) hide show
  1. package/dist/.config/bindings.angular.js +4 -0
  2. package/dist/cjs/{attribute-observer-10f08c04.js → attribute-observer-6d8b886b.js} +4 -4
  3. package/dist/cjs/{check-one-of-f4f5d0c0.js → check-one-of-ef931478.js} +2 -1
  4. package/dist/cjs/{check-type-64af82a9.js → check-type-696d2c51.js} +4 -4
  5. package/dist/cjs/{check-url-3ffdd2fb.js → check-url-1cf6fb0d.js} +2 -1
  6. package/dist/cjs/{debounce-1151afe3.js → debounce-158fd76f.js} +2 -1
  7. package/dist/cjs/fade-72d5ef55.js +14 -0
  8. package/dist/cjs/{index-f1b08cdb.js → index-0ee3ab4a.js} +334 -152
  9. package/dist/cjs/{index-5d4e0aed.js → index-bea4ac42.js} +7 -5
  10. package/dist/cjs/index.cjs.js +30 -28
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/{package-0bd6fb0d.js → package-7d11b6ea.js} +1 -1
  13. package/dist/cjs/{post-accordion-7aadd881.js → post-accordion-29861d97.js} +15 -8
  14. package/dist/cjs/{post-accordion-item-bd033c7f.js → post-accordion-item-0da0f7aa.js} +20 -13
  15. package/dist/cjs/post-accordion-item.cjs.entry.js +7 -7
  16. package/dist/cjs/post-accordion.cjs.entry.js +4 -4
  17. package/dist/cjs/{post-avatar-5dbdf70d.js → post-avatar-01b9cd6d.js} +29 -21
  18. package/dist/cjs/post-avatar.cjs.entry.js +3 -3
  19. package/dist/cjs/post-back-to-top-9a5647f7.js +80 -0
  20. package/dist/cjs/post-back-to-top.cjs.entry.js +5 -5
  21. package/dist/cjs/post-banner-33929088.js +110 -0
  22. package/dist/cjs/post-banner.cjs.entry.js +8 -8
  23. package/dist/cjs/{post-breadcrumb-531c4f79.js → post-breadcrumb-1384018e.js} +41 -34
  24. package/dist/cjs/post-breadcrumb-item_2.cjs.entry.js +7 -7
  25. package/dist/cjs/post-breadcrumb.cjs.entry.js +5 -5
  26. package/dist/cjs/post-card-control-4c85eda3.js +314 -0
  27. package/dist/cjs/post-card-control.cjs.entry.js +4 -4
  28. package/dist/cjs/post-closebutton_15.cjs.entry.js +8 -8
  29. package/dist/cjs/{post-collapsible-trigger-02924200.js → post-collapsible-trigger-0fb2596a.js} +47 -35
  30. package/dist/cjs/post-collapsible_2.cjs.entry.js +8 -8
  31. package/dist/cjs/post-components.cjs.js +3 -3
  32. package/dist/cjs/{post-footer-96d7bd47.js → post-footer-f621a563.js} +18 -12
  33. package/dist/cjs/post-footer.cjs.entry.js +3 -3
  34. package/dist/cjs/post-linkarea-865079c1.js +32 -0
  35. package/dist/cjs/post-linkarea.cjs.entry.js +11 -0
  36. package/dist/cjs/{post-menu-item-3f73fb4d.js → post-menu-item-ab3e2e7e.js} +12 -9
  37. package/dist/cjs/{post-popover-64195ffd.js → post-popover-a2ba9226.js} +24 -10
  38. package/dist/cjs/post-popover.cjs.entry.js +4 -4
  39. package/dist/cjs/{post-rating-bd27ebfc.js → post-rating-c402c294.js} +33 -10
  40. package/dist/cjs/post-rating.cjs.entry.js +3 -3
  41. package/dist/cjs/post-tab-header-c819517d.js +36 -0
  42. package/dist/cjs/post-tab-header.cjs.entry.js +3 -3
  43. package/dist/cjs/{post-tab-panel-3eedcd19.js → post-tab-panel-3cb207f3.js} +9 -6
  44. package/dist/cjs/post-tab-panel.cjs.entry.js +3 -3
  45. package/dist/cjs/{post-tabs-ea94b243.js → post-tabs-b6fa39c3.js} +29 -18
  46. package/dist/cjs/post-tabs.cjs.entry.js +4 -4
  47. package/dist/cjs/{post-tag-1d75024b.js → post-tag-9c366519.js} +20 -9
  48. package/dist/cjs/post-tag.cjs.entry.js +3 -3
  49. package/dist/cjs/{post-togglebutton-876f7892.js → post-togglebutton-d49bec2c.js} +682 -221
  50. package/dist/cjs/{post-tooltip-e4ef3c7e.js → post-tooltip-425c01ba.js} +24 -12
  51. package/dist/cjs/post-tooltip.cjs.entry.js +8 -8
  52. package/dist/cjs/{slide-5d51abe8.js → slide-8ae17ee4.js} +4 -4
  53. package/dist/collection/animations/collapse.js +5 -5
  54. package/dist/collection/animations/fade.js +6 -2
  55. package/dist/collection/animations/slide.js +4 -4
  56. package/dist/collection/collection-manifest.json +4 -3
  57. package/dist/collection/components/post-accordion/post-accordion.js +16 -6
  58. package/dist/collection/components/post-accordion-item/post-accordion-item.js +21 -11
  59. package/dist/collection/components/post-avatar/post-avatar.js +35 -20
  60. package/dist/collection/components/post-back-to-top/post-back-to-top.css +1 -1
  61. package/dist/collection/components/post-back-to-top/post-back-to-top.js +14 -8
  62. package/dist/collection/components/post-banner/post-banner.css +1 -1
  63. package/dist/collection/components/post-banner/post-banner.js +40 -14
  64. package/dist/collection/components/post-breadcrumb/post-breadcrumb.js +41 -31
  65. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +10 -6
  66. package/dist/collection/components/post-card-control/post-card-control.css +1 -1
  67. package/dist/collection/components/post-card-control/post-card-control.js +104 -43
  68. package/dist/collection/components/post-closebutton/post-closebutton.js +2 -1
  69. package/dist/collection/components/post-collapsible/post-collapsible.js +16 -6
  70. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +25 -21
  71. package/dist/collection/components/post-footer/post-footer.js +9 -5
  72. package/dist/collection/components/post-header/post-header.css +1 -1
  73. package/dist/collection/components/post-header/post-header.js +90 -15
  74. package/dist/collection/components/post-icon/post-icon.js +93 -23
  75. package/dist/collection/components/post-language-option/post-language-option.js +37 -8
  76. package/dist/collection/components/post-language-switch/post-language-switch.css +1 -1
  77. package/dist/collection/components/post-language-switch/post-language-switch.js +24 -7
  78. package/dist/collection/components/post-linkarea/post-linkarea.css +1 -0
  79. package/dist/collection/components/post-linkarea/post-linkarea.js +32 -0
  80. package/dist/collection/components/post-list/post-list.js +19 -6
  81. package/dist/collection/components/post-list-item/post-list-item.js +2 -1
  82. package/dist/collection/components/post-logo/post-logo.js +8 -4
  83. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  84. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +197 -17
  85. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  86. package/dist/collection/components/post-megadropdown/post-megadropdown.js +134 -64
  87. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
  88. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +18 -11
  89. package/dist/collection/components/post-menu/post-menu.js +56 -33
  90. package/dist/collection/components/post-menu-item/post-menu-item.js +1 -1
  91. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +24 -16
  92. package/dist/collection/components/post-popover/post-popover.css +1 -1
  93. package/dist/collection/components/post-popover/post-popover.js +26 -5
  94. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  95. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +55 -8
  96. package/dist/collection/components/post-rating/post-rating.js +39 -7
  97. package/dist/collection/components/post-tab-header/post-tab-header.css +1 -1
  98. package/dist/collection/components/post-tab-header/post-tab-header.js +9 -5
  99. package/dist/collection/components/post-tab-panel/post-tab-panel.js +9 -5
  100. package/dist/collection/components/post-tabs/post-tabs.css +1 -1
  101. package/dist/collection/components/post-tabs/post-tabs.js +25 -18
  102. package/dist/collection/components/post-tag/post-tag.css +1 -1
  103. package/dist/collection/components/post-tag/post-tag.js +23 -5
  104. package/dist/collection/components/post-togglebutton/post-togglebutton.js +18 -14
  105. package/dist/collection/components/post-tooltip/post-tooltip.js +26 -9
  106. package/dist/collection/index.js +1 -0
  107. package/dist/collection/utils/attribute-observer.js +4 -4
  108. package/dist/collection/utils/breakpoints.js +9 -6
  109. package/dist/collection/utils/component-on-ready.js +4 -4
  110. package/dist/collection/utils/debounce.js +2 -1
  111. package/dist/collection/utils/get-focusable-children.js +2 -2
  112. package/dist/collection/utils/property-checkers/check-one-of.js +2 -1
  113. package/dist/collection/utils/property-checkers/check-pattern.js +2 -1
  114. package/dist/collection/utils/property-checkers/check-type.js +4 -4
  115. package/dist/collection/utils/property-checkers/check-url.js +2 -1
  116. package/dist/collection/utils/property-checkers/empty-or.js +2 -1
  117. package/dist/collection/utils/sass-export.js +8 -5
  118. package/dist/components/index.js +36 -35
  119. package/dist/components/{post-collapsible-trigger2.js → p-05590ac0.js} +30 -27
  120. package/dist/components/{post-breadcrumb2.js → p-146677d1.js} +50 -43
  121. package/dist/components/p-1ee1742f.js +237 -0
  122. package/dist/components/p-2083ae2c.js +3 -0
  123. package/dist/components/{post-megadropdown-trigger2.js → p-27edc023.js} +21 -15
  124. package/dist/components/{post-tooltip2.js → p-2d9b46b4.js} +26 -14
  125. package/dist/components/p-38778a14.js +345 -0
  126. package/dist/components/p-3aba7629.js +29 -0
  127. package/dist/components/{post-togglebutton2.js → p-3cee636a.js} +20 -17
  128. package/dist/components/p-3e8554e7.js +1646 -0
  129. package/dist/components/p-424d5ea9.js +199 -0
  130. package/dist/components/p-46a6c5ec.js +168 -0
  131. package/dist/components/p-4965cfe1.js +145 -0
  132. package/{loaders/slide.js → dist/components/p-4af6dbed.js} +4 -4
  133. package/dist/components/{post-list2.js → p-536eba02.js} +19 -9
  134. package/dist/components/p-5653923a.js +44 -0
  135. package/dist/components/{post-footer2.js → p-58878996.js} +23 -17
  136. package/dist/components/{post-logo2.js → p-5f51ec58.js} +10 -7
  137. package/{loaders/post-popovercontainer2.js → dist/components/p-60cf53cc.js} +34 -11
  138. package/dist/components/p-64e3de38.js +11 -0
  139. package/dist/components/{post-accordion-item2.js → p-68ecd276.js} +26 -19
  140. package/dist/components/p-75b8b652.js +54 -0
  141. package/dist/components/{post-tab-panel2.js → p-78e1d893.js} +11 -8
  142. package/dist/components/{check-type.js → p-8562c7dc.js} +4 -4
  143. package/{loaders/post-menu-trigger2.js → dist/components/p-8b053fd5.js} +27 -20
  144. package/dist/components/{post-icon2.js → p-91031e3b.js} +85 -28
  145. package/dist/components/{post-menu2.js → p-91882483.js} +60 -65
  146. package/dist/{esm/attribute-observer-37fa950a.js → components/p-9748a355.js} +4 -4
  147. package/dist/components/{post-list-item2.js → p-9e4b1f10.js} +4 -4
  148. package/dist/components/{post-accordion2.js → p-a3a004e6.js} +17 -10
  149. package/dist/components/{post-popover2.js → p-af23f7de.js} +26 -12
  150. package/dist/components/{post-collapsible2.js → p-b018d864.js} +23 -14
  151. package/dist/components/{check-non-empty.js → p-b095519d.js} +1 -1
  152. package/dist/components/{check-one-of.js → p-bacd3e2c.js} +2 -1
  153. package/dist/components/{post-closebutton2.js → p-bf14d264.js} +6 -6
  154. package/dist/components/{post-breadcrumb-item2.js → p-c7c1d466.js} +13 -10
  155. package/dist/components/{post-tag2.js → p-cab43cee.js} +22 -11
  156. package/dist/components/{post-menu-item2.js → p-ccccf0c3.js} +4 -4
  157. package/dist/components/{post-tabs2.js → p-ce854a7d.js} +30 -19
  158. package/dist/components/{post-avatar2.js → p-d3fb70af.js} +31 -23
  159. package/dist/components/{post-language-option2.js → p-d47bb5bf.js} +32 -12
  160. package/dist/components/{debounce.js → p-e1baac59.js} +2 -1
  161. package/dist/components/{post-back-to-top2.js → p-e20366a6.js} +20 -15
  162. package/dist/components/{index2.js → p-eabb09ad.js} +9 -6
  163. package/dist/components/{post-language-switch2.js → p-f6d80d76.js} +29 -17
  164. package/dist/components/p-f7b9f90a.js +135 -0
  165. package/dist/components/{post-rating2.js → p-fc59de7c.js} +35 -12
  166. package/dist/components/post-accordion-item.js +1 -1
  167. package/dist/components/post-accordion.js +1 -1
  168. package/dist/components/post-avatar.js +1 -1
  169. package/dist/components/post-back-to-top.js +1 -1
  170. package/dist/components/post-banner.js +1 -1
  171. package/dist/components/post-breadcrumb-item.js +1 -1
  172. package/dist/components/post-breadcrumb.js +1 -1
  173. package/dist/components/post-card-control.js +1 -1
  174. package/dist/components/post-closebutton.js +1 -1
  175. package/dist/components/post-collapsible-trigger.js +1 -1
  176. package/dist/components/post-collapsible.js +1 -1
  177. package/dist/components/post-footer.js +1 -1
  178. package/dist/components/post-header.js +1 -1
  179. package/dist/components/post-icon.js +1 -1
  180. package/dist/components/post-language-option.js +1 -1
  181. package/dist/components/post-language-switch.js +1 -1
  182. package/dist/components/post-linkarea.d.ts +11 -0
  183. package/dist/components/post-linkarea.js +6 -0
  184. package/dist/components/post-list-item.js +1 -1
  185. package/dist/components/post-list.js +1 -1
  186. package/dist/components/post-logo.js +1 -1
  187. package/dist/components/post-mainnavigation.js +1 -1
  188. package/dist/components/post-megadropdown-trigger.js +1 -1
  189. package/dist/components/post-megadropdown.js +1 -1
  190. package/dist/components/post-menu-item.js +1 -1
  191. package/dist/components/post-menu-trigger.js +1 -1
  192. package/dist/components/post-menu.js +1 -1
  193. package/dist/components/post-popover.js +1 -1
  194. package/dist/components/post-popovercontainer.js +1 -1
  195. package/dist/components/post-rating.js +1 -1
  196. package/dist/components/post-tab-header.js +1 -1
  197. package/dist/components/post-tab-panel.js +1 -1
  198. package/dist/components/post-tabs.js +1 -1
  199. package/dist/components/post-tag.js +1 -1
  200. package/dist/components/post-togglebutton.js +1 -1
  201. package/dist/components/post-tooltip.js +1 -1
  202. package/dist/docs.d.ts +8 -0
  203. package/dist/docs.json +335 -156
  204. package/{loaders/attribute-observer.js → dist/esm/attribute-observer-2f203993.js} +4 -4
  205. package/{loaders/check-one-of.js → dist/esm/check-one-of-0d5858c0.js} +2 -1
  206. package/dist/esm/{check-type-8828dbe4.js → check-type-a6ccc9a3.js} +4 -4
  207. package/dist/esm/{check-url-a974431e.js → check-url-0bd876f7.js} +2 -1
  208. package/dist/esm/{debounce-abe98cc2.js → debounce-e54c7131.js} +2 -1
  209. package/dist/esm/fade-1f3cacf4.js +11 -0
  210. package/dist/esm/{index-6bfe6554.js → index-2c232bf2.js} +334 -152
  211. package/dist/esm/{index-b49c9904.js → index-d1bbbd88.js} +7 -5
  212. package/dist/esm/index.js +29 -28
  213. package/dist/esm/loader.js +3 -3
  214. package/dist/esm/package-8c98af5e.js +3 -0
  215. package/dist/esm/{post-accordion-ca48eb18.js → post-accordion-49fba403.js} +15 -8
  216. package/dist/esm/{post-accordion-item-a461f2a7.js → post-accordion-item-c516517a.js} +20 -13
  217. package/dist/esm/post-accordion-item.entry.js +7 -7
  218. package/dist/esm/post-accordion.entry.js +4 -4
  219. package/dist/esm/{post-avatar-0da1a2e8.js → post-avatar-b527ac63.js} +29 -21
  220. package/dist/esm/post-avatar.entry.js +3 -3
  221. package/dist/esm/post-back-to-top-f514c1f0.js +78 -0
  222. package/dist/esm/post-back-to-top.entry.js +5 -5
  223. package/dist/esm/post-banner-0ad7758b.js +108 -0
  224. package/dist/esm/post-banner.entry.js +8 -8
  225. package/dist/esm/{post-breadcrumb-85ffd02f.js → post-breadcrumb-57bca9dd.js} +41 -34
  226. package/dist/esm/post-breadcrumb-item_2.entry.js +7 -7
  227. package/dist/esm/post-breadcrumb.entry.js +5 -5
  228. package/dist/esm/post-card-control-ea741f60.js +312 -0
  229. package/dist/esm/post-card-control.entry.js +4 -4
  230. package/dist/esm/post-closebutton_15.entry.js +8 -8
  231. package/dist/esm/{post-collapsible-trigger-883db3bf.js → post-collapsible-trigger-31155750.js} +47 -35
  232. package/dist/esm/post-collapsible_2.entry.js +8 -8
  233. package/dist/esm/post-components.js +4 -4
  234. package/dist/esm/{post-footer-7b0eb067.js → post-footer-cdde2086.js} +18 -12
  235. package/dist/esm/post-footer.entry.js +3 -3
  236. package/dist/esm/post-linkarea-cad95623.js +30 -0
  237. package/dist/esm/post-linkarea.entry.js +3 -0
  238. package/dist/esm/{post-menu-item-37f637a3.js → post-menu-item-db732728.js} +12 -9
  239. package/dist/esm/{post-popover-c24ecd38.js → post-popover-00f427ac.js} +24 -10
  240. package/dist/esm/post-popover.entry.js +4 -4
  241. package/dist/esm/{post-rating-e1c66e5c.js → post-rating-cdcb2a1d.js} +33 -10
  242. package/dist/esm/post-rating.entry.js +3 -3
  243. package/dist/esm/post-tab-header-1d4113cb.js +34 -0
  244. package/dist/esm/post-tab-header.entry.js +3 -3
  245. package/dist/esm/{post-tab-panel-73b56a16.js → post-tab-panel-7a5c03ef.js} +9 -6
  246. package/dist/esm/post-tab-panel.entry.js +3 -3
  247. package/dist/esm/{post-tabs-02e523b8.js → post-tabs-308190c0.js} +29 -18
  248. package/dist/esm/post-tabs.entry.js +4 -4
  249. package/dist/esm/{post-tag-43aba068.js → post-tag-aebbda10.js} +20 -9
  250. package/dist/esm/post-tag.entry.js +3 -3
  251. package/dist/esm/{post-togglebutton-c2231709.js → post-togglebutton-95ba85d2.js} +682 -221
  252. package/dist/esm/{post-tooltip-8271950c.js → post-tooltip-918d3a54.js} +24 -12
  253. package/dist/esm/post-tooltip.entry.js +8 -8
  254. package/dist/{components/slide.js → esm/slide-62768431.js} +4 -4
  255. package/dist/post-components/index.esm.js +1 -1
  256. package/dist/post-components/p-037d6ef2.entry.js +1 -0
  257. package/dist/post-components/p-1e69a72f.js +1 -0
  258. package/dist/post-components/p-1fda117c.js +1 -0
  259. package/dist/post-components/p-2083ae2c.js +1 -0
  260. package/dist/post-components/p-24297444.js +1 -0
  261. package/dist/post-components/{p-e2f886ab.js → p-267f52a9.js} +3 -3
  262. package/dist/post-components/p-2e6c5b60.js +1 -0
  263. package/dist/post-components/p-3591d4e3.entry.js +1 -0
  264. package/dist/post-components/p-3dec4425.entry.js +1 -0
  265. package/dist/post-components/p-423aecd4.js +1 -0
  266. package/dist/post-components/p-43221de8.entry.js +1 -0
  267. package/dist/post-components/p-48fd00e7.entry.js +1 -0
  268. package/dist/post-components/p-4af6dbed.js +1 -0
  269. package/dist/post-components/p-4ca79b52.js +1 -0
  270. package/dist/post-components/p-4d2dee9f.entry.js +1 -0
  271. package/dist/post-components/p-4fedef65.js +1 -0
  272. package/dist/post-components/p-59109b3b.entry.js +1 -0
  273. package/dist/post-components/p-64e3de38.js +1 -0
  274. package/dist/post-components/p-675352c3.entry.js +1 -0
  275. package/dist/post-components/p-6e4527d9.entry.js +1 -0
  276. package/dist/post-components/p-726bfda2.js +1 -0
  277. package/dist/post-components/p-767c0bf3.js +1 -0
  278. package/dist/post-components/p-796968bd.entry.js +1 -0
  279. package/dist/post-components/p-7c9758fa.js +1 -0
  280. package/dist/post-components/p-8a452260.js +1 -0
  281. package/dist/post-components/p-8a50b900.js +1 -0
  282. package/dist/post-components/p-8de4f677.entry.js +1 -0
  283. package/dist/post-components/p-93632808.js +1 -0
  284. package/dist/post-components/p-9748a355.js +1 -0
  285. package/dist/post-components/p-9aca3d07.entry.js +1 -0
  286. package/dist/post-components/p-9f0c5164.js +1 -0
  287. package/dist/post-components/p-a6436e7f.js +1 -0
  288. package/dist/post-components/p-ad246c0d.js +1 -0
  289. package/dist/post-components/p-b015efcb.entry.js +1 -0
  290. package/dist/post-components/p-b0afc087.entry.js +1 -0
  291. package/dist/post-components/p-b1adc221.js +1 -0
  292. package/dist/post-components/p-b2c0d21a.js +1 -0
  293. package/dist/post-components/p-b5a566f1.js +1 -0
  294. package/dist/post-components/p-c0961047.entry.js +1 -0
  295. package/dist/post-components/p-c388b7bb.entry.js +1 -0
  296. package/dist/post-components/{p-c510d968.entry.js → p-ca41b899.entry.js} +1 -1
  297. package/dist/post-components/p-d2395ae9.entry.js +1 -0
  298. package/dist/post-components/p-d9833667.js +2 -0
  299. package/dist/post-components/p-da261c46.entry.js +1 -0
  300. package/dist/post-components/post-components.esm.js +1 -1
  301. package/dist/types/animations/collapse.d.ts +2 -2
  302. package/dist/types/animations/fade.d.ts +2 -2
  303. package/dist/types/animations/slide.d.ts +2 -2
  304. package/dist/types/components/post-header/post-header.d.ts +11 -2
  305. package/dist/types/components/post-icon/post-icon.d.ts +1 -1
  306. package/dist/types/components/post-language-switch/post-language-switch.d.ts +1 -1
  307. package/dist/types/components/post-linkarea/post-linkarea.d.ts +5 -0
  308. package/dist/types/components/post-mainnavigation/post-mainnavigation.d.ts +57 -3
  309. package/dist/types/components/post-megadropdown/post-megadropdown.d.ts +26 -12
  310. package/dist/types/components/post-popovercontainer/post-popovercontainer.d.ts +4 -0
  311. package/dist/types/components/post-tabs/post-tabs.d.ts +1 -1
  312. package/dist/types/components.d.ts +51 -25
  313. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/bindings.angular.d.ts +2 -0
  314. package/dist/types/index.d.ts +3 -2
  315. package/dist/types/stencil-public-runtime.d.ts +6 -0
  316. package/dist/types/utils/attribute-observer.d.ts +1 -1
  317. package/dist/types/utils/component-on-ready.d.ts +1 -1
  318. package/dist/types/utils/get-focusable-children.d.ts +1 -1
  319. package/dist/types/utils/sass-export.d.ts +5 -1
  320. package/loaders/index.d.ts +2 -0
  321. package/loaders/index.js +3 -2
  322. package/loaders/{post-collapsible-trigger2.js → p-05590ac0.js} +30 -27
  323. package/loaders/{post-breadcrumb-item2.js → p-1beacb73.js} +13 -10
  324. package/loaders/p-2083ae2c.js +3 -0
  325. package/loaders/p-3aba7629.js +29 -0
  326. package/loaders/p-3e8554e7.js +1646 -0
  327. package/{dist/esm/slide-3422b8a3.js → loaders/p-4af6dbed.js} +4 -4
  328. package/loaders/{index2.js → p-56ad4838.js} +9 -6
  329. package/{dist/components/post-popovercontainer2.js → loaders/p-60cf53cc.js} +34 -11
  330. package/loaders/p-64e3de38.js +11 -0
  331. package/loaders/{post-accordion-item2.js → p-83baa315.js} +26 -19
  332. package/loaders/{check-type.js → p-8562c7dc.js} +4 -4
  333. package/{dist/components/post-menu-trigger2.js → loaders/p-8b053fd5.js} +27 -20
  334. package/loaders/{post-menu2.js → p-91882483.js} +60 -65
  335. package/{dist/components/attribute-observer.js → loaders/p-9748a355.js} +4 -4
  336. package/loaders/{post-collapsible2.js → p-9fac5d7d.js} +23 -14
  337. package/loaders/{check-non-empty.js → p-b095519d.js} +1 -1
  338. package/{dist/esm/check-one-of-6b3ef8eb.js → loaders/p-bacd3e2c.js} +2 -1
  339. package/loaders/{post-menu-item2.js → p-ccccf0c3.js} +4 -4
  340. package/loaders/{debounce.js → p-e1baac59.js} +2 -1
  341. package/loaders/{post-icon2.js → p-f7177e26.js} +85 -28
  342. package/loaders/p-f7b9f90a.js +135 -0
  343. package/loaders/post-accordion-item.js +1 -1
  344. package/loaders/post-accordion.js +17 -10
  345. package/loaders/post-avatar.js +31 -23
  346. package/loaders/post-back-to-top.js +20 -15
  347. package/loaders/post-banner.js +42 -23
  348. package/loaders/post-breadcrumb-item.js +1 -1
  349. package/loaders/post-breadcrumb.js +50 -43
  350. package/loaders/post-card-control.js +93 -51
  351. package/loaders/post-closebutton.js +6 -6
  352. package/loaders/post-collapsible-trigger.js +1 -1
  353. package/loaders/post-collapsible.js +1 -1
  354. package/loaders/post-footer.js +23 -17
  355. package/loaders/post-header.js +74 -154
  356. package/loaders/post-icon.js +1 -1
  357. package/loaders/post-language-option.js +32 -12
  358. package/loaders/post-language-switch.js +29 -17
  359. package/loaders/post-linkarea.d.ts +11 -0
  360. package/loaders/post-linkarea.js +47 -0
  361. package/loaders/post-list-item.js +4 -4
  362. package/loaders/post-list.js +19 -9
  363. package/loaders/post-logo.js +10 -7
  364. package/loaders/post-mainnavigation.js +197 -8
  365. package/loaders/post-megadropdown-trigger.js +21 -15
  366. package/loaders/post-megadropdown.js +119 -51
  367. package/loaders/post-menu-item.js +1 -1
  368. package/loaders/post-menu-trigger.js +1 -1
  369. package/loaders/post-menu.js +1 -1
  370. package/loaders/post-popover.js +26 -12
  371. package/loaders/post-popovercontainer.js +1 -1
  372. package/loaders/post-rating.js +35 -12
  373. package/loaders/post-tab-header.js +13 -10
  374. package/loaders/post-tab-panel.js +11 -8
  375. package/loaders/post-tabs.js +30 -19
  376. package/loaders/post-tag.js +22 -11
  377. package/loaders/post-togglebutton.js +20 -17
  378. package/loaders/post-tooltip.js +26 -14
  379. package/package.json +19 -16
  380. package/dist/cjs/fade-35a3633a.js +0 -10
  381. package/dist/cjs/post-back-to-top-71bc912c.js +0 -75
  382. package/dist/cjs/post-banner-d4e0c73c.js +0 -91
  383. package/dist/cjs/post-card-control-332f6f1f.js +0 -272
  384. package/dist/cjs/post-tab-header-1f057694.js +0 -33
  385. package/dist/components/fade.js +0 -7
  386. package/dist/components/package.js +0 -3
  387. package/dist/components/post-banner2.js +0 -126
  388. package/dist/components/post-card-control2.js +0 -303
  389. package/dist/components/post-header2.js +0 -279
  390. package/dist/components/post-mainnavigation2.js +0 -48
  391. package/dist/components/post-megadropdown2.js +0 -100
  392. package/dist/components/post-tab-header2.js +0 -51
  393. package/dist/esm/fade-7fd71785.js +0 -7
  394. package/dist/esm/package-f8f7bb40.js +0 -3
  395. package/dist/esm/post-back-to-top-77471a90.js +0 -73
  396. package/dist/esm/post-banner-b0af5bd3.js +0 -89
  397. package/dist/esm/post-card-control-3225eb57.js +0 -270
  398. package/dist/esm/post-tab-header-6a9b0153.js +0 -31
  399. package/dist/post-components/p-025688e5.js +0 -1
  400. package/dist/post-components/p-08b51b35.entry.js +0 -1
  401. package/dist/post-components/p-0e216cc4.js +0 -2
  402. package/dist/post-components/p-24c92608.js +0 -1
  403. package/dist/post-components/p-25a57971.js +0 -1
  404. package/dist/post-components/p-2737eaf5.js +0 -1
  405. package/dist/post-components/p-2cb4a8f1.js +0 -1
  406. package/dist/post-components/p-33b64e0c.js +0 -1
  407. package/dist/post-components/p-34d70cd5.js +0 -1
  408. package/dist/post-components/p-350f3900.entry.js +0 -1
  409. package/dist/post-components/p-35bc4554.js +0 -1
  410. package/dist/post-components/p-38b259a4.entry.js +0 -1
  411. package/dist/post-components/p-3c6cef1e.entry.js +0 -1
  412. package/dist/post-components/p-4a713cf8.js +0 -1
  413. package/dist/post-components/p-4b5e2b24.js +0 -1
  414. package/dist/post-components/p-515e0f96.js +0 -1
  415. package/dist/post-components/p-5467b223.js +0 -1
  416. package/dist/post-components/p-54e58fc2.entry.js +0 -1
  417. package/dist/post-components/p-637759d6.js +0 -1
  418. package/dist/post-components/p-6adeaa6c.js +0 -1
  419. package/dist/post-components/p-7589a19f.js +0 -1
  420. package/dist/post-components/p-7cce7342.entry.js +0 -1
  421. package/dist/post-components/p-819e19de.js +0 -1
  422. package/dist/post-components/p-82d48128.js +0 -1
  423. package/dist/post-components/p-85171893.entry.js +0 -1
  424. package/dist/post-components/p-882fdd0c.entry.js +0 -1
  425. package/dist/post-components/p-94399c69.js +0 -1
  426. package/dist/post-components/p-9a02b162.entry.js +0 -1
  427. package/dist/post-components/p-b1f5bc26.js +0 -1
  428. package/dist/post-components/p-b2f239a1.entry.js +0 -1
  429. package/dist/post-components/p-b571e5c8.js +0 -1
  430. package/dist/post-components/p-ba530822.js +0 -1
  431. package/dist/post-components/p-bae1c85f.entry.js +0 -1
  432. package/dist/post-components/p-bdabdec5.js +0 -1
  433. package/dist/post-components/p-c1225174.entry.js +0 -1
  434. package/dist/post-components/p-c372a141.entry.js +0 -1
  435. package/dist/post-components/p-c87c5d59.entry.js +0 -1
  436. package/dist/post-components/p-d04c1b7f.entry.js +0 -1
  437. package/dist/post-components/p-da300843.entry.js +0 -1
  438. package/dist/post-components/p-fec04a15.entry.js +0 -1
  439. package/loaders/fade.js +0 -7
  440. package/loaders/package.js +0 -3
  441. /package/dist/components/{heading-levels.js → p-247a1668.js} +0 -0
  442. /package/dist/components/{constants.js → p-440193f4.js} +0 -0
  443. /package/dist/components/{index.browser.js → p-5959f2bd.js} +0 -0
  444. /package/dist/components/{get-root.js → p-fc91cbc2.js} +0 -0
  445. /package/dist/post-components/{p-4a3f67ab.js → p-8562c7dc.js} +0 -0
  446. /package/dist/post-components/{p-611b3c41.js → p-bacd3e2c.js} +0 -0
  447. /package/dist/post-components/{p-b22656b1.js → p-cb9ab938.js} +0 -0
  448. /package/dist/post-components/{p-d4f93f2b.js → p-e1baac59.js} +0 -0
  449. /package/loaders/{heading-levels.js → p-247a1668.js} +0 -0
  450. /package/loaders/{constants.js → p-440193f4.js} +0 -0
  451. /package/loaders/{index.browser.js → p-5959f2bd.js} +0 -0
  452. /package/loaders/{get-root.js → p-fc91cbc2.js} +0 -0
@@ -1,9 +1,9 @@
1
- import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-6bfe6554.js';
2
- import { v as version } from './package-f8f7bb40.js';
3
- import { s as slideUp, a as slideDown } from './slide-3422b8a3.js';
4
- import { c as checkEmptyOrOneOf, d as checkEmptyOrType, b as checkEmptyOrUrl } from './index-b49c9904.js';
1
+ import { r as registerInstance, g as getElement, h, H as Host, c as createEvent } from './index-2c232bf2.js';
2
+ import { v as version } from './package-8c98af5e.js';
3
+ import { s as slideUp, a as slideDown } from './slide-62768431.js';
4
+ import { c as checkEmptyOrOneOf, d as checkEmptyOrType, b as checkEmptyOrUrl } from './index-d1bbbd88.js';
5
5
  import { c as checkNonEmpty } from './check-non-empty-58bd6b17.js';
6
- import { c as checkType } from './check-type-8828dbe4.js';
6
+ import { c as checkType } from './check-type-a6ccc9a3.js';
7
7
  import { n as nanoid } from './index.browser-51485f85.js';
8
8
  import { g as getRoot } from './get-root-7af2e0d1.js';
9
9
 
@@ -11,10 +11,10 @@ const PostClosebutton = class {
11
11
  constructor(hostRef) {
12
12
  registerInstance(this, hostRef);
13
13
  }
14
+ get host() { return getElement(this); }
14
15
  render() {
15
- return (h(Host, { key: 'cb5be35247053b1227c32f7949baca51ccc31081', "data-version": version }, h("button", { key: 'ece4ca00fedfd0ee76a971ca2a9cf0cf9a1e7f0c', class: "btn btn-icon-close", type: "button" }, h("post-icon", { key: 'c14a15906a1f229d642c2a8aea456f7a4acc5619', "aria-hidden": "true", name: "closex" }), h("span", { key: '94757c5e870f57ec8ba0c52fc5bb2a1f6eed91c2', class: "visually-hidden" }, h("slot", { key: 'a76c388cceca0b7d4da01b8e737e65f24d11df23' })))));
16
+ return (h(Host, { key: 'c03f50379252ba13992bc3d021989ac07dba9f79', "data-version": version }, h("button", { key: 'e97a86bb6e1eace89a1a3a78fb231047f065dd5e', class: "btn btn-icon-close", type: "button" }, h("post-icon", { key: 'aca522d4c251a8183c91c2bd4d810d0716a2fe13', "aria-hidden": "true", name: "closex" }), h("span", { key: '6873522961b1683d1261163b07ee022f93eed836', class: "visually-hidden" }, h("slot", { key: 'bf4b13356c9a0164f1481d1fedc3a78a53e5f8e0' })))));
16
17
  }
17
- get host() { return getElement(this); }
18
18
  };
19
19
 
20
20
  /* eslint-disable no-undefined,no-param-reassign,no-shadow */
@@ -151,28 +151,77 @@ function throttle (delay, callback, options) {
151
151
  return wrapper;
152
152
  }
153
153
 
154
- const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{--global-header-height:72px;--global-header-minimal-height:24px;--main-header-height:56px;--main-header-min-height:56px;--header-height:calc(var(--global-header-height) + var(--main-header-height))}@media screen and (min-width: 1024px){:host{display:block;position:sticky;inset-inline:0;inset-block-start:calc(-1*(var(--global-header-height) + var(--main-header-height) - var(--global-header-minimal-height)));box-shadow:var(--post-core-elevation-3)}}@media screen and (max-width: 1023.99px){:host{--global-header-height:64px;--main-header-height:48px;--main-header-min-height:48px}}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;align-items:center;position:sticky;padding-inline:var(--post-core-dimension-4);height:var(--global-header-height);z-index:1}@media screen and (max-width: 1023.99px){.global-header{inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{padding-inline-end:var(--post-core-dimension-12);top:calc((var(--global-header-height) - var(--global-header-minimal-height))*-1)}}slot[name=post-logo]{align-self:flex-end}.global-sub{display:flex;align-items:center;gap:var(--post-core-dimension-24)}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-minimal-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.title-header{display:flex;align-items:center;gap:var(--post-core-dimension-8);min-height:var(--main-header-min-height);justify-content:space-between;background:var(--post-core-color-brand-white)}@media screen and (min-width: 1024px){.title-header{padding:var(--post-core-dimension-18) var(--post-core-dimension-16) var(--post-core-dimension-4) var(--post-core-dimension-12)}}@media screen and (max-width: 1023.99px){.title-header{position:sticky;z-index:1;inset-block-start:var(--global-header-height);padding-inline:var(--post-core-dimension-8) var(--post-core-dimension-16);padding-block:var(--post-core-dimension-9);flex-wrap:wrap}.title-header.title-header-mobile-extended{border-bottom:1px solid var(--post-core-color-sandgrey-012)}}:host(:not(:has([slot=title]))) .title-header{display:none}::slotted(h1){margin:0 !important;flex-shrink:10}@media screen and (min-width: 1024px){::slotted(h1){font-size:var(--post-core-font-size-28) !important}}@media screen and (max-width: 1023.99px){::slotted(h1){font-size:var(--post-core-font-size-20) !important;max-width:calc(100vw - var(--post-core-dimension-8) - var(--post-core-dimension-16))}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{background:var(--post-core-color-brand-white)}@media screen and (min-width: 1024px){.navigation{position:sticky;z-index:1;inset-block-start:var(--global-header-minimal-height)}}@media screen and (max-width: 1023.99px){.navigation{position:fixed;inset-inline:0;inset-block-end:calc(100vh - var(--header-height));box-shadow:var(--post-core-elevation-3);min-height:var(--post-core-dimension-10);max-height:calc(100vh - var(--header-height));overflow:auto}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:var(--post-core-dimension-16) var(--post-core-dimension-24);padding-inline:var(--post-core-dimension-32)}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}::slotted(post-mainnavigation){background-color:var(--post-core-color-sandgrey-002);gap:var(--post-core-dimension-32)}.navigation-footer{background-color:var(--post-core-color-sandgrey-006);gap:var(--post-core-dimension-24)}}";
154
+ const focusableSelector = `:where(${[
155
+ 'button',
156
+ 'input:not([type="hidden"])',
157
+ '[tabindex]',
158
+ 'select',
159
+ 'textarea',
160
+ '[contenteditable]',
161
+ 'a[href]',
162
+ 'iframe',
163
+ 'audio[controls]',
164
+ 'video[controls]',
165
+ 'area[href]',
166
+ 'details > summary:first-of-type',
167
+ ].join(',')})`;
168
+ const focusDisablingSelector = `:where(${[
169
+ '[inert]',
170
+ '[inert] *',
171
+ ':disabled',
172
+ 'dialog:not([open]) *',
173
+ '[popover]:not(:popover-open) *',
174
+ 'details:not([open]) > *:not(details > summary:first-of-type)',
175
+ 'details:not([open]) > *:not(details > summary:first-of-type) *',
176
+ '[tabindex^="-"]',
177
+ ].join(',')})`;
178
+ function getFocusableChildren(element) {
179
+ return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
180
+ }
181
+
182
+ const postHeaderCss = "*,::before,::after{box-sizing:border-box}:host{z-index:1090;--global-header-height:72px;--global-header-minimal-height:24px;--local-header-height:112px;--local-header-min-height:56px;--header-height:calc(var(--global-header-height) + var(--local-header-height));z-index:1020;position:relative}@media screen and (min-width: 1024px){:host{--global-header-reduced-height:24px;--main-navigation-height:56px}}@media screen and (max-width: 1023.98px){:host{--global-header-height:64px;--local-header-height:48px;--local-header-min-height:48px;--main-navigation-height:0px}}:host(:not(:has([slot=title]))){--local-header-height:var(--main-navigation-height)}:host(:not(:has([slot=title]))) .local-header{padding-block-start:0}:host(:not(:has([slot=title]))) .local-sub{display:none}.d-flex{display:flex}.space-between{justify-content:space-between}.global-header{background-color:#fc0;display:flex;justify-content:space-between;align-items:center;position:sticky;padding-inline:var(--post-core-dimension-4);height:var(--global-header-height)}@media screen and (max-width: 1023.98px){.global-header{z-index:3;inset-block-start:0}}@media screen and (min-width: 1024px){.global-header{z-index:5;padding-inline-end:var(--post-core-dimension-12);inset-block-start:calc((var(--global-header-height) - var(--global-header-reduced-height))*-1)}}slot[name=post-logo]{align-self:flex-end}.global-sub{display:flex;align-items:center;gap:var(--post-core-dimension-24)}.align-end{align-items:flex-end}.logo{flex:1 0 auto;height:var(--global-header-height);width:var(--global-header-height);min-height:var(--global-header-reduced-height);align-self:flex-end}@media screen and (min-width: 1024px){.logo{height:calc(var(--global-header-height) - var(--header-scroll-top))}}::slotted(ul){margin-block:0 !important;list-style:none;display:flex;padding-left:0;gap:1rem;flex-shrink:0 !important}.local-header{display:flex;position:sticky;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--post-core-dimension-8);min-height:var(--local-header-min-height);background:var(--post-core-color-brand-white);transition:box-shadow .2s ease-in-out}@media screen and (min-width: 1024px){.local-header{z-index:3;inset-block-start:calc(-1*(var(--local-header-height) - var(--main-navigation-height)) + var(--global-header-reduced-height));padding-block-start:var(--post-core-dimension-18);box-shadow:var(--post-core-elevation-3)}}@media screen and (max-width: 1023.98px){.local-header{z-index:2;inset-block-start:var(--global-header-height);padding-block:var(--post-core-dimension-9);flex-wrap:wrap}.local-header.local-header-mobile-extended{border-bottom:1px solid var(--post-core-color-sandgrey-012)}.local-header:not(.title-header-mobile-extended){box-shadow:var(--post-core-elevation-3)}}.local-sub{margin-inline-end:var(--post-core-dimension-16)}::slotted(.list-inline){margin:-8px 0 !important;z-index:3 !important;position:relative !important}::slotted(h1){margin:0 !important;flex-shrink:10;z-index:3}@media screen and (min-width: 600px){::slotted(h1){margin-inline-start:var(--post-core-dimension-12) !important}}@media screen and (max-width: 599.98px){::slotted(h1){margin-inline-start:var(--post-core-dimension-8) !important}}@media screen and (min-width: 1024px){::slotted(h1){font-size:var(--post-core-font-size-28) !important}}@media screen and (max-width: 1023.98px){::slotted(h1){font-size:var(--post-core-font-size-20) !important;max-width:calc(100vw - var(--post-core-dimension-8) - var(--post-core-dimension-16))}}@media screen and (min-width: 1024px){.mobile-toggle{display:none}}.navigation{width:100%}@media screen and (min-width: 1024px){.navigation{inset-block-start:var(--global-header-minimal-height)}.navigation::before{display:block;content:\"\";position:absolute;inset:0;z-index:2;background:var(--post-core-color-brand-white)}}@media screen and (max-width: 1023.98px){.navigation{position:fixed;z-index:1;inset-inline:0;background:var(--post-core-color-brand-white);inset-block-end:calc(100vh - var(--header-height))}::slotted(post-mainnavigation),.navigation-footer{display:none;flex-direction:column;padding-block:var(--post-core-dimension-16) var(--post-core-dimension-24);padding-inline:var(--post-core-dimension-32)}.navigation.extended ::slotted(post-mainnavigation),.navigation.extended .navigation-footer{display:flex}.navigation.extended{height:calc(100vh - var(--header-height));display:flex;flex-direction:column}.navigation.extended ::slotted(post-mainnavigation){flex-grow:1 !important}::slotted(post-mainnavigation){background-color:var(--post-core-color-sandgrey-002);gap:var(--post-core-dimension-32)}.navigation-footer{background-color:var(--post-core-color-sandgrey-006);gap:var(--post-core-dimension-24)}}@media screen and (max-width: 599.98px){::slotted(post-mainnavigation),.navigation-footer{padding-inline:var(--post-core-dimension-16)}}";
155
183
  const PostHeaderStyle0 = postHeaderCss;
156
184
 
157
185
  const PostHeader = class {
158
186
  constructor(hostRef) {
159
187
  registerInstance(this, hostRef);
160
- this.scrollParent = null;
161
- this.throttledScroll = () => this.handleScrollEvent();
162
- this.throttledResize = throttle(50, () => this.handleResize());
163
- this.device = null;
164
- this.mobileMenuExtended = false;
165
- }
188
+ this.postUpdateDevice = createEvent(this, "postUpdateDevice", 7);
189
+ }
190
+ firstFocusableEl;
191
+ lastFocusableEl;
192
+ scrollParent = null;
193
+ mobileMenu;
194
+ mobileMenuAnimation;
195
+ throttledScroll = () => this.handleScrollEvent();
196
+ throttledResize = throttle(50, () => this.handleResize());
166
197
  componentWillRender() {
167
198
  this.scrollParent = this.getScrollParent(this.host);
168
199
  this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
169
200
  window.addEventListener('resize', this.throttledResize, { passive: true });
170
201
  this.handleResize();
171
202
  this.handleScrollEvent();
203
+ this.getFocusableElements();
172
204
  }
205
+ get host() { return getElement(this); }
206
+ device = null;
207
+ mobileMenuExtended = false;
173
208
  frozeBody(isMobileMenuExtended) {
174
209
  document.body.style.overflow = isMobileMenuExtended ? 'hidden' : '';
210
+ if (isMobileMenuExtended) {
211
+ this.host.addEventListener('keydown', e => {
212
+ this.keyboardHandler(e);
213
+ });
214
+ }
215
+ else {
216
+ this.host.removeEventListener('keydown', e => {
217
+ this.keyboardHandler(e);
218
+ });
219
+ }
175
220
  }
221
+ /**
222
+ * An event emitted when the device has changed
223
+ */
224
+ postUpdateDevice;
176
225
  /**
177
226
  * Toggles the mobile navigation.
178
227
  */
@@ -192,6 +241,36 @@ const PostHeader = class {
192
241
  if (!this.mobileMenuExtended)
193
242
  await this.mobileMenuAnimation.finished;
194
243
  }
244
+ // Get all the focusable elements in the post-header mobile menu
245
+ getFocusableElements() {
246
+ // Get elements in the correct order (different as the DOM order)
247
+ const focusableEls = [
248
+ ...Array.from(this.host.querySelectorAll('.list-inline:not([slot="meta-navigation"]) > li')),
249
+ ...Array.from(this.host.querySelectorAll('nav > post-list > div > post-list-item, post-mainnavigation > .back-button, post-megadropdown-trigger')),
250
+ ...Array.from(this.host.querySelectorAll('.list-inline[slot="meta-navigation"] > li, post-language-option')),
251
+ ];
252
+ // Add the main toggle menu button to the list of focusable children
253
+ const focusableChildren = [
254
+ this.host.querySelector('post-togglebutton'),
255
+ ...focusableEls.flatMap(el => Array.from(getFocusableChildren(el))),
256
+ ];
257
+ this.firstFocusableEl = focusableChildren[0];
258
+ this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
259
+ }
260
+ keyboardHandler(e) {
261
+ if (e.key === 'Tab' && this.mobileMenuExtended) {
262
+ if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
263
+ // If back tab (Tab + Shift) and first element is focused, focus goes to the last element of the megadropdown
264
+ e.preventDefault();
265
+ this.lastFocusableEl.focus();
266
+ }
267
+ else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
268
+ // If Tab and last element is focused, focus goes back to the first element of the megadropdown
269
+ e.preventDefault();
270
+ this.firstFocusableEl.focus();
271
+ }
272
+ }
273
+ }
195
274
  handleScrollEvent() {
196
275
  // Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
197
276
  const st = Math.max(0, this.scrollParent instanceof Document
@@ -223,10 +302,9 @@ const PostHeader = class {
223
302
  });
224
303
  }
225
304
  handleResize() {
226
- var _a;
227
305
  const previousDevice = this.device;
228
306
  let newDevice;
229
- const width = window === null || window === void 0 ? void 0 : window.innerWidth;
307
+ const width = window?.innerWidth;
230
308
  if (width >= 1024) {
231
309
  newDevice = 'desktop';
232
310
  }
@@ -241,29 +319,31 @@ const PostHeader = class {
241
319
  this.toggleMobileMenu();
242
320
  this.mobileMenuAnimation.finish(); // no animation
243
321
  }
244
- const mhh = (_a = this.host.shadowRoot.querySelector('.title-header')) === null || _a === void 0 ? void 0 : _a.clientHeight;
322
+ const mhh = this.host.shadowRoot.querySelector('.local-header')?.clientHeight;
245
323
  this.host.style.setProperty('--main-header-height', `${mhh}px`);
246
324
  // Apply only on change for doing work only when necessary
247
325
  if (newDevice !== previousDevice) {
248
326
  this.device = newDevice;
327
+ this.postUpdateDevice.emit(this.device);
249
328
  window.requestAnimationFrame(() => {
250
329
  this.switchLanguageSwitchMode();
251
330
  });
252
331
  }
253
332
  }
254
333
  switchLanguageSwitchMode() {
255
- var _a;
256
334
  const variant = this.device === 'desktop' ? 'menu' : 'list';
257
- (_a = this.host.querySelector('post-language-switch')) === null || _a === void 0 ? void 0 : _a.setAttribute('variant', variant);
335
+ this.host.querySelector('post-language-switch')?.setAttribute('variant', variant);
258
336
  }
259
- render() {
337
+ renderNavigation() {
260
338
  const navigationClasses = ['navigation'];
261
339
  if (this.mobileMenuExtended) {
262
340
  navigationClasses.push('extended');
263
341
  }
264
- return (h(Host, { key: '008e84568ce41249365d93169b2f94cd988601d0', version: version }, h("div", { key: 'f6415c30b3bfacd01a65166c7f0a3afc37676cc8', class: "global-header" }, h("div", { key: 'dc1465a3a68ce8c66c7da644d992c37d8d09ccc4', class: "global-sub" }, h("div", { key: '490b4afe502465bc20ccc41149533929987f2fab', class: "logo" }, h("slot", { key: '28ee1cdb2804f6315fffa2c319a1e2fa1e54ad08', name: "post-logo" }))), h("div", { key: '777d715f4718bb6738665f3d65c9ee4729a977de', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: 'c1ddbfdecc96fe3a6efb930d8475ee880059d372', name: "meta-navigation" }), h("slot", { key: 'df1ccf5c36ea4a05812c3983961389c42c42ddb9', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'ace2dda9a3f3d898934c7d47c84e2475fb555e5d', name: "post-language-switch" }), h("div", { key: '3e8d94d9534d5daaa2f8e6ca5cc0833e78a49224', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '58e3637f103411f5e577dba931caf884f46a6e47', name: "post-togglebutton" })))), h("div", { key: 'f90ff065ed795fc780c90768e5c0ab5a431bec8d', class: 'title-header ' + (this.mobileMenuExtended ? 'title-header-mobile-extended' : '') }, h("slot", { key: 'a1aaaf02da073b9e7de82e84c93745afa6a8c4e9', name: "title" }), h("div", { key: '84ae2f8b846536130967362de160e054049c8489', class: "global-sub" }, h("slot", { key: '8a845cd7f87b3a2c2fba7ffc1ace31e87f6329d9', name: "local-controls" }), h("slot", { key: 'f3822b883fc88436a84d3ca7f840946af992417e' }))), h("div", { key: '8e0390c6c2b9a71488eea73c9207d0c336c9b75d', ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { key: '5fc2db060eb962c313fc4c9ab67032e990ff54c6', name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { key: '7b9147dcf5de01865785d417c8d1966efb891ace', class: "navigation-footer" }, h("slot", { key: '6e163a7dad7b0b0fc02493cd15152179d4242980', name: "meta-navigation" }), h("slot", { key: 'e8fd19eeed8a99d69ccd8635e36cd0256ed4424b', name: "post-language-switch" }))))));
342
+ return (h("div", { ref: el => (this.mobileMenu = el), class: navigationClasses.join(' ') }, h("slot", { name: "post-mainnavigation" }), (this.device === 'mobile' || this.device === 'tablet') && (h("div", { class: "navigation-footer" }, h("slot", { name: "meta-navigation" }), h("slot", { name: "post-language-switch" })))));
343
+ }
344
+ render() {
345
+ return (h(Host, { key: 'efbf8028f2abf376f497081996dba759f5885630', version: version }, h("div", { key: 'ecaaea274045453ce869f36e8a1155626b1818ba', class: "global-header" }, h("div", { key: '2fda0d65321ad1cbbc47b731f095e0d9b6694d99', class: "global-sub" }, h("div", { key: '24864d5f18c9d923717cc2e996395cff3bd6ce8b', class: "logo" }, h("slot", { key: 'ba82d7f62bb845732fe6066bcdc7eef15913c9e6', name: "post-logo" }))), h("div", { key: 'a0ddea4e564fca1e286998c73fea75eb8c228428', class: "global-sub" }, this.device === 'desktop' && h("slot", { key: '0d7aa11452eb69fe28914ff7787c6dc206fd4009', name: "meta-navigation" }), h("slot", { key: 'e92b7b9db6e16e8fcecb1ca74efa63942dd542c5', name: "global-controls" }), this.device === 'desktop' && h("slot", { key: 'c68984037a71d5ac54828f6cf2367c3b07e428fc', name: "post-language-switch" }), h("div", { key: '70fb5040dc2f000c2afa286bb673ae9cf88521cf', onClick: () => this.toggleMobileMenu(), class: "mobile-toggle" }, h("slot", { key: '509fb81812262cd9efdb3a562e48f72b0d29e376', name: "post-togglebutton" })))), h("div", { key: '393d1040bad2f85caced5b4a8ff02e30fa5fd5f1', class: 'local-header ' + (this.mobileMenuExtended ? 'local-header-mobile-extended' : '') }, h("slot", { key: '786cc114aae985a0612d3cb044684290e3026462', name: "title" }), h("div", { key: 'd4f68653a09bbf0b222873ed5d23fec6ba9d8f6f', class: "local-sub" }, h("slot", { key: '0ad7dda5490964e9a8eae5e0bf66a117882f7a06', name: "local-controls" }), h("slot", { key: 'bddc01c7696f456c38c200b330767a0f1b353d88' })), this.device === 'desktop' && this.renderNavigation()), this.device !== 'desktop' && this.renderNavigation()));
265
346
  }
266
- get host() { return getElement(this); }
267
347
  static get watchers() { return {
268
348
  "mobileMenuExtended": ["frozeBody"]
269
349
  }; }
@@ -286,53 +366,111 @@ const ANIMATION_KEYS = [...ANIMATION_NAMES];
286
366
  const PostIcon = class {
287
367
  constructor(hostRef) {
288
368
  registerInstance(this, hostRef);
289
- this.animation = null;
290
- this.base = null;
291
- this.flipH = false;
292
- this.flipV = false;
293
- this.name = undefined;
294
- this.rotate = null;
295
- this.scale = null;
296
369
  }
370
+ get host() { return getElement(this); }
371
+ /**
372
+ * The name of the animation.
373
+ */
374
+ animation = null;
297
375
  validateAnimation(newValue = this.animation) {
298
376
  if (newValue !== undefined)
299
377
  checkEmptyOrOneOf(newValue, ANIMATION_KEYS, `The post-icon "animation" prop requires one of the following values: ${ANIMATION_KEYS.join(', ')}.`);
300
378
  }
379
+ /**
380
+ * The base path, where the icons are located (must be a public url).<br/>Leave this field empty to use the default cdn url.
381
+ */
382
+ base = null;
301
383
  validateBase(newValue = this.base) {
302
384
  checkEmptyOrType(newValue, 'string', 'The post-icon "base" prop should be a string.');
303
385
  }
386
+ /**
387
+ * When set to `true`, the icon will be flipped horizontally.
388
+ */
389
+ flipH = false;
304
390
  validateFlipH(newValue = this.flipH) {
305
391
  checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipH" prop should be a boolean.');
306
392
  }
393
+ /**
394
+ * When set to `true`, the icon will be flipped vertically.
395
+ */
396
+ flipV = false;
307
397
  validateFlipV(newValue = this.flipV) {
308
398
  checkEmptyOrType(newValue, 'boolean', 'The post-icon "flipV" prop should be a boolean.');
309
399
  }
400
+ /**
401
+ * The name/id of the icon (e.g. 1000, 1001, ...).
402
+ */
403
+ name;
310
404
  validateName(newValue = this.name) {
311
405
  checkNonEmpty(newValue, 'The post-icon "name" prop is required!.');
312
406
  checkType(newValue, 'string', 'The post-icon "name" prop should be a string.');
313
407
  }
408
+ /**
409
+ * The number of degree for the css rotate transformation.
410
+ */
411
+ rotate = null;
314
412
  validateRotate(newValue = this.rotate) {
315
413
  checkEmptyOrType(newValue, 'number', 'The post-icon "rotate" prop should be a number.');
316
414
  }
415
+ /**
416
+ * The number for the css scale transformation.
417
+ */
418
+ scale = null;
317
419
  validateScale(newValue = this.scale) {
318
420
  checkEmptyOrType(newValue, 'number', 'The post-icon "scale" prop should be a number.');
319
421
  }
320
- getPath() {
321
- var _a, _b, _c, _d, _e, _f;
322
- // Construct icon path from different possible sources
323
- const metaBase = (_b = (_a = document.head
324
- .querySelector('meta[name="design-system-settings"][data-post-icon-base]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-post-icon-base')) !== null && _b !== void 0 ? _b : null;
325
- const baseHref = (_c = document.getElementsByTagName('base')[0]) === null || _c === void 0 ? void 0 : _c.href;
326
- const fileBase = `${(_f = (_e = (_d = this.base) !== null && _d !== void 0 ? _d : metaBase) !== null && _e !== void 0 ? _e : baseHref) !== null && _f !== void 0 ? _f : CDN_URL}/`.replace(/\/\/$/, '/');
327
- const fileName = `${this.name}.svg`;
328
- const filePath = `${fileBase}${fileName}`;
329
- return new URL(filePath, window.location.origin).toString();
422
+ // Construct the icon url from different possible sources
423
+ getUrl() {
424
+ // the first definition object which defines a domain, will be used to set the domain of the file url
425
+ // the first definition object which defines a slug, will be used to set the slug of the file url
426
+ const urlDefinitions = [
427
+ getUrlDefinition(this.base, 'both'),
428
+ getUrlDefinition(document.head
429
+ .querySelector('meta[name="design-system-settings"][data-post-icon-base]')
430
+ ?.getAttribute('data-post-icon-base'), 'relative'),
431
+ getUrlDefinition(document.querySelector('base[href]')?.getAttribute('href'), 'both'),
432
+ ];
433
+ // in case no other definition defines a domain, the current origin is used as a fallback
434
+ const origin = urlDefinitions.find(d => d.definesDomain)?.url?.origin ?? window.location.origin;
435
+ // in case no other definition defines a slug, the cdn url is used as a fallback
436
+ const slug = urlDefinitions.find(d => d.definesSlug)?.url?.pathname;
437
+ const file = `${this.name}.svg`;
438
+ let url;
439
+ if (slug) {
440
+ url = new URL(`${origin}${slug}/${file}`).toString();
441
+ }
442
+ else {
443
+ url = new URL(`${CDN_URL}/${file}`).toString();
444
+ }
445
+ return url;
446
+ function getUrlDefinition(url, allow) {
447
+ return {
448
+ url: getUrlObject(url),
449
+ definesDomain: allow !== 'relative' ? definesDomain(url) : false,
450
+ definesSlug: allow !== 'absolute' ? definesSlug(url) : false,
451
+ };
452
+ function getUrlObject(url) {
453
+ if (url) {
454
+ return definesDomain(url) ? new URL(url) : new URL(url, window.location.origin);
455
+ }
456
+ else {
457
+ return null;
458
+ }
459
+ }
460
+ function definesDomain(url) {
461
+ return url ? /^https?:\/\//.test(url) : false;
462
+ }
463
+ function definesSlug(url) {
464
+ const urlObject = getUrlObject(url);
465
+ return Boolean(/^\/.+/.test(urlObject?.pathname));
466
+ }
467
+ }
330
468
  }
331
469
  getStyles() {
332
- const path = this.getPath();
470
+ const url = this.getUrl();
333
471
  return Object.entries({
334
- '-webkit-mask-image': `url(${path})`,
335
- 'mask-image': `url('${path}')`,
472
+ '-webkit-mask-image': `url(${url})`,
473
+ 'mask-image': `url('${url}')`,
336
474
  'transform': (this.scale && !isNaN(Number(this.scale)) ? 'scale(' + this.scale + ')' : '') +
337
475
  (this.rotate && !isNaN(Number(this.rotate)) ? ' rotate(' + this.rotate + 'deg)' : ''),
338
476
  })
@@ -349,9 +487,8 @@ const PostIcon = class {
349
487
  this.validateAnimation();
350
488
  }
351
489
  render() {
352
- return (h(Host, { key: '70e13e357929d2601de3b61f46f9a717ba491fd5', "data-version": version }, h("span", { key: 'a0c40175bfa6bd06f3498dc056685c8396b6e706', style: this.getStyles() })));
490
+ return (h(Host, { key: '6c494ba3cdd2ee173fa99a8ce8ff0e8ab5cf2979', "data-version": version }, h("span", { key: 'd9e0192a2788541b97bf3e25468129ac335d44b5', style: this.getStyles() })));
353
491
  }
354
- get host() { return getElement(this); }
355
492
  static get watchers() { return {
356
493
  "animation": ["validateAnimation"],
357
494
  "base": ["validateBase"],
@@ -371,21 +508,38 @@ const PostLanguageOption = class {
371
508
  constructor(hostRef) {
372
509
  registerInstance(this, hostRef);
373
510
  this.postChange = createEvent(this, "postChange", 7);
374
- this.code = undefined;
375
- this.active = undefined;
376
- this.variant = undefined;
377
- this.name = undefined;
378
- this.url = undefined;
379
511
  }
512
+ get host() { return getElement(this); }
513
+ /**
514
+ * The ISO 639 language code, formatted according to [RFC 5646 (also known as BCP 47)](https://datatracker.ietf.org/doc/html/rfc5646). For example, "de".
515
+ */
516
+ code;
380
517
  validateCode(value = this.code) {
381
518
  checkType(value, 'string', 'The "code" property of the post-language-option component must be a string.');
382
519
  }
520
+ /**
521
+ * If set to `true`, the language option is considered the current language for the page.
522
+ */
523
+ active;
383
524
  validateActiveProp(value = this.active) {
384
525
  checkEmptyOrType(value, 'boolean', 'The "active" property of the post-language-option component must be a boolean value.');
385
526
  }
527
+ /**
528
+ * The variant of the post-language-switch parent (dynamically set by the parent)
529
+ */
530
+ variant;
531
+ /**
532
+ * The full name of the language. For example, "Deutsch".
533
+ */
534
+ name;
386
535
  validateName(value = this.name) {
387
536
  checkEmptyOrType(value, 'string', 'The "name" property of the post-language-option component must be a string.');
388
537
  }
538
+ /**
539
+ * The URL used for the href attribute of the internal anchor.
540
+ * This field is optional; if not provided, a button will be used internally instead of an anchor.
541
+ */
542
+ url;
389
543
  validateUrl(value = this.url) {
390
544
  checkEmptyOrType(value, 'string', 'The "url" property of the post-language-option component must be a valid URL.');
391
545
  }
@@ -398,6 +552,10 @@ const PostLanguageOption = class {
398
552
  throw new Error('The "name" property of the post-language-option component is required when the full language name is not displayed.');
399
553
  }
400
554
  }
555
+ /**
556
+ * An event emitted when the language option is clicked. The payload is the ISO 639 code of the language.
557
+ */
558
+ postChange;
401
559
  /**
402
560
  * Selects the language option programmatically.
403
561
  */
@@ -418,9 +576,8 @@ const PostLanguageOption = class {
418
576
  this.emitChange();
419
577
  }
420
578
  };
421
- return (h(Host, { key: '6a7c4af5ab0a953cc2c70621efc6fff905638900', "data-version": version, role: this.variant ? `${this.variant}item` : null }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null))) : (h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null)))));
579
+ return (h(Host, { key: 'eff35e907ca174aa239604d8e3c937309d306cd1', "data-version": version, role: this.variant ? `${this.variant}item` : null }, this.url ? (h("a", { "aria-current": this.active ? 'page' : undefined, "aria-label": this.name, href: this.url, hrefLang: lang, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null))) : (h("button", { "aria-current": this.active ? 'true' : undefined, "aria-label": this.name, lang: lang, onClick: () => this.emitChange(), onKeyDown: emitOnKeyDown }, h("slot", null)))));
422
580
  }
423
- get host() { return getElement(this); }
424
581
  static get watchers() { return {
425
582
  "code": ["validateCode"],
426
583
  "active": ["validateActiveProp"],
@@ -432,27 +589,39 @@ PostLanguageOption.style = PostLanguageOptionStyle0;
432
589
 
433
590
  const SWITCH_VARIANTS = ['list', 'menu'];
434
591
 
435
- const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.99px){:host{display:flex !important;gap:.5rem}}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-dropdown-container>*{width:100%}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-trigger{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}";
592
+ const postLanguageSwitchCss = ":host{display:block}@media screen and (max-width: 1023.98px){:host{display:flex !important;gap:.5rem}}.post-language-switch-dropdown-container{display:flex;flex-direction:column}.post-language-switch-dropdown-container>*{width:100%}.post-language-switch-trigger{cursor:pointer;padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-decoration:none;display:inline-flex;align-items:center;gap:var(--post-core-dimension-6);border-radius:var(--post-core-dimension-24);font-size:var(--post-core-font-size-16);padding:var(--post-core-dimension-3) var(--post-core-dimension-10)}.post-language-switch-trigger{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.post-language-switch-trigger:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.post-language-switch-trigger:not(:disabled):hover,.post-language-switch-trigger.pretend-hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg)}.post-language-switch-trigger post-icon{height:var(--post-core-dimension-16);width:var(--post-core-dimension-16)}";
436
593
  const PostLanguageSwitchStyle0 = postLanguageSwitchCss;
437
594
 
438
595
  const PostLanguageSwitch = class {
439
596
  constructor(hostRef) {
440
597
  registerInstance(this, hostRef);
441
- this.menuId = `p${nanoid(11)}`;
442
- this.caption = undefined;
443
- this.description = undefined;
444
- this.variant = 'list';
445
- this.activeLang = undefined;
446
598
  }
599
+ get host() { return getElement(this); }
600
+ /**
601
+ * A title for the list of language options
602
+ */
603
+ caption;
447
604
  validateCaption(value = this.caption) {
448
605
  checkType(value, 'string', 'The "caption" property of the post-language-switch component must be a string.');
449
606
  }
607
+ /**
608
+ * A descriptive text for the list of language options
609
+ */
610
+ description;
450
611
  validateDescription(value = this.description) {
451
612
  checkType(value, 'string', 'The "description" property of the post-language-switch component must be a string.');
452
613
  }
614
+ /**
615
+ * Variant that determines the rendering of the language switch either as a list (used on mobile in the header) or a dropdown (used on desktop in the header)
616
+ */
617
+ variant = 'list';
453
618
  validateVariant(value = this.variant) {
454
619
  checkEmptyOrOneOf(value, SWITCH_VARIANTS, `The "variant" property of the post-language-switch component must be: ${SWITCH_VARIANTS.join(', ')}`);
455
620
  }
621
+ /**
622
+ * The active language of the language switch
623
+ */
624
+ activeLang;
456
625
  connectedCallback() {
457
626
  this.updateChildrenVariant();
458
627
  // Get the active language based on children's active state
@@ -492,6 +661,7 @@ const PostLanguageSwitch = class {
492
661
  }
493
662
  });
494
663
  }
664
+ menuId = `p${nanoid(11)}`;
495
665
  renderList() {
496
666
  return (h(Host, { "data-version": version, "aria-label": `${this.caption}, ${this.description}`, "aria-role": "list" }, h("slot", null)));
497
667
  }
@@ -501,7 +671,6 @@ const PostLanguageSwitch = class {
501
671
  render() {
502
672
  return this.variant === 'list' ? this.renderList() : this.renderDropdown();
503
673
  }
504
- get host() { return getElement(this); }
505
674
  static get watchers() { return {
506
675
  "caption": ["validateCaption"],
507
676
  "description": ["validateDescription"],
@@ -516,10 +685,21 @@ const PostListStyle0 = postListCss;
516
685
  const PostList = class {
517
686
  constructor(hostRef) {
518
687
  registerInstance(this, hostRef);
519
- this.titleId = undefined;
520
- this.titleHidden = false;
521
- this.horizontal = false;
522
688
  }
689
+ get host() { return getElement(this); }
690
+ /**
691
+ * The unique title of the list that is also referenced in the labelledby
692
+ */
693
+ titleId;
694
+ /**
695
+ * If `true`, the list title will be hidden. Otherwise, it will be displayed.`
696
+ */
697
+ titleHidden = false;
698
+ /**
699
+ * The list can become horizontal by setting `horizontal="true"` or just `horizontal`
700
+ */
701
+ horizontal = false;
702
+ titleEl;
523
703
  componentWillLoad() {
524
704
  /**
525
705
  * Get the id set on the host element or use a random id by default
@@ -535,9 +715,8 @@ const PostList = class {
535
715
  }
536
716
  }
537
717
  render() {
538
- return (h(Host, { key: '70594af566e1fe34ce0b9ebe1a8cbbc868dab973', "data-version": version }, h("div", { key: '27b6c4af3d51a0d83f968ec751b6bcf46feb7d05', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: 'a913bd018199bb031e3d96d487bd528831453387' })), h("div", { key: 'e1a3ddecc643a78f57b91cc9ccb0de6b02302a47', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: 'bd7c6df300d28fe0b9f1dd3135eb42da00e731b9', name: "post-list-item" }))));
718
+ return (h(Host, { key: 'bdd973098d8b2a74635d489dca8f0f6825e31c51', "data-version": version }, h("div", { key: '9dcd6ca7069658c3e7f0d14fc130d18ebe522acb', ref: el => (this.titleEl = el), id: this.titleId, class: `list-title${this.titleHidden ? ' visually-hidden' : ''}` }, h("slot", { key: 'ad51f345b2c120796d02dbc3d6815a58addc7fb4' })), h("div", { key: '47fddd7b977c85c195757f461c0ec009270cdb8b', role: "list", "aria-labelledby": this.titleId }, h("slot", { key: '176662b40ca47b6aeeded26256bc84bdee6483a6', name: "post-list-item" }))));
539
719
  }
540
- get host() { return getElement(this); }
541
720
  };
542
721
  PostList.style = PostListStyle0;
543
722
 
@@ -548,13 +727,13 @@ const PostListItem = class {
548
727
  constructor(hostRef) {
549
728
  registerInstance(this, hostRef);
550
729
  }
730
+ get host() { return getElement(this); }
551
731
  connectedCallback() {
552
732
  this.host.setAttribute('slot', 'post-list-item');
553
733
  }
554
734
  render() {
555
- return (h(Host, { key: 'f7b26e05f1fa8bab9909dcee305dbf74960671eb', role: "listitem", slot: "post-list-item" }, h("slot", { key: '3d75b0acf3f4a89c64c447e8d182bbc9a4f930a0' })));
735
+ return (h(Host, { key: '8e209e77859bd05d62cae41aec9dec6fb2e820cb', role: "listitem", slot: "post-list-item" }, h("slot", { key: 'ce79a335e80401465b74208957e22983d6df4ce0' })));
556
736
  }
557
- get host() { return getElement(this); }
558
737
  };
559
738
  PostListItem.style = PostListItemStyle0;
560
739
 
@@ -564,8 +743,12 @@ const PostLogoStyle0 = postLogoCss;
564
743
  const PostLogo = class {
565
744
  constructor(hostRef) {
566
745
  registerInstance(this, hostRef);
567
- this.url = undefined;
568
746
  }
747
+ get host() { return getElement(this); }
748
+ /**
749
+ * The URL to which the user is redirected upon clicking the logo.
750
+ */
751
+ url;
569
752
  validateUrl() {
570
753
  checkEmptyOrUrl(this.url, 'The "url" property of the post-logo is invalid');
571
754
  }
@@ -581,25 +764,53 @@ const PostLogo = class {
581
764
  render() {
582
765
  const logoLink = this.url && (typeof this.url === 'string' ? this.url : this.url.href);
583
766
  const LogoTag = logoLink ? 'a' : 'span';
584
- return (h(Host, { key: 'c20cf7b8d3684d33cf9b85448a560a93cd4df118', "data-version": version }, h(LogoTag, Object.assign({ key: '16f5f647935c87124d7bf1be5dd5fb4c6d56a76f', class: `logo ${logoLink ? 'logo-link' : ''}` }, (logoLink ? { href: logoLink } : {})), h("span", { key: '1373265c0c2271069c1ee540fb6d5576e67dd923', class: "description" }, h("slot", { key: 'd52c8c0d28e8292f7a30733dc195e1e1e32edf2a', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'ad1c0ff356325415a1f99c4bc941895d1448801a', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: 'ca8015671b16c192d44a1b48699e45ff7adc6123', id: "Logo" }, h("rect", { key: 'e862e2ea34630326ca6f6eea164f227b138d44c1', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: 'd25e571bd67524c33c343312826e37dafedf918c', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: 'a053c52cf9de963d52bc6a0f078a986c836b6038', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
767
+ return (h(Host, { key: 'd5f61d2740588571b77c9317d535b5c12c9ba996', "data-version": version }, h(LogoTag, { key: '95d19b08bae7e4137f43c0b7e345fa44ed1a6e9e', class: `logo ${logoLink ? 'logo-link' : ''}`, ...(logoLink ? { href: logoLink } : {}) }, h("span", { key: 'd7a4e97a9685ebc099e57737926d0fbe6d8ed12f', class: "description" }, h("slot", { key: '6b08a53ad00b103930f0b1aab1d305ae77feccba', onSlotchange: () => this.checkDescription() })), h("svg", { key: 'a7adc544f620325bdec5fa3fbc5a880d10a85f7e', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 72 72", "aria-hidden": "true" }, h("g", { key: 'f68e9b4b0ef8b0d4b34a47a23cb4f0a0e04b5456', id: "Logo" }, h("rect", { key: 'b21a948f30baa4808182ccee37822315d87282eb', fill: "#ffcc00", x: "0", y: "0", width: "72", height: "72" }), h("polygon", { key: '57ec911498cb069aaa80b4857447c1da3aa76959', fill: "#ff0000", points: "34,32.3 34,19 19.7,19 19.7,29.1 10,29.1 10,42.9 19.7,42.9 19.7,53 34,53 34,39.7 30.6,39.7 30.6,49.8 23.1,49.8 23.1,39.7 13.4,39.7 13.4,32.3 23.1,32.3 23.1,22.2 30.6,22.2 30.6,32.3" }), h("path", { key: 'fed41d70f4532da5769cbc51740e21520568af7f', d: "M53.56234,31.10526c0,2.41272-1.99154,4.29475-4.51723,4.29475H45.2v-8.3h3.84511C51.66802,27.1,53.56234,28.78889,53.56234,31.10526z M50.69666,19H36v34h9.2V42.9h5.49666c6.75131,0,11.9971-5.15137,11.9971-11.8057C62.69376,24.39136,57.35099,19,50.69666,19z" }))))));
585
768
  }
586
- get host() { return getElement(this); }
587
769
  static get watchers() { return {
588
770
  "url": ["validateUrl"]
589
771
  }; }
590
772
  };
591
773
  PostLogo.style = PostLogoStyle0;
592
774
 
593
- const postMainnavigationCss = "post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}post-mainnavigation post-list-item post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item>button:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:var(--post-core-dimension-4);z-index:1}@media screen and (min-width: 1024px){post-mainnavigation nav{position:relative;max-width:100vw;max-height:var(--post-core-dimension-56);user-select:none}post-mainnavigation post-list{margin-inline:var(--post-core-dimension-4)}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline:var(--post-core-dimension-12);height:var(--post-core-dimension-56);gap:var(--post-core-dimension-4);font-size:var(--post-core-font-size-16);border-block:0 solid rgba(0,0,0,0);border-block-end-color:currentColor}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{border-block-width:var(--post-core-dimension-2)}post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{border-block-width:var(--post-core-dimension-4);font-weight:var(--post-core-font-weight-700)}post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:var(--post-core-dimension-12);transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.99px){post-mainnavigation post-list>[role=list]{transform:none !important}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;height:var(--post-core-dimension-48);padding-inline-end:var(--post-core-dimension-6);gap:var(--post-core-dimension-16);border-block:var(--post-core-dimension-1) solid rgba(0,0,0,0);border-block-end-color:currentColor;font-weight:var(--post-core-font-weight-700)}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button.selected{border-block-width:var(--post-core-dimension-3)}post-mainnavigation post-list-item>a:hover::after,post-mainnavigation post-list-item>button:hover::after,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::after{content:\"\";display:block;mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20.667 5.333H18.8L29.467 16H0v1.333h29.467L18.8 28h1.867L32 16.667z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-24);height:var(--post-core-dimension-24)}}post-mainnavigation .back-button .btn{padding-inline:0}";
775
+ const postMainnavigationCss = "post-mainnavigation{flex:0 0 auto}post-mainnavigation post-list-item>a{text-decoration:none;border-radius:0}post-mainnavigation post-list-item post-megadropdown-trigger button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;text-align:start}post-mainnavigation post-list-item post-megadropdown-trigger button{outline-offset:var(--post-device-spacing-padding-2) !important;outline:var(--post-scheme-color-interactive-focus-stroke) none var(--post-device-border-width-focus) !important}post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:has(:focus-visible),.pretend-focus){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){post-mainnavigation post-list-item post-megadropdown-trigger button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item post-megadropdown-trigger button{flex:0 0 fit-content;white-space:nowrap;display:flex;align-items:center;justify-content:space-between}post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{color:var(--post-scheme-color-interactive-primary-hover-fg1)}post-mainnavigation post-list-item>a:focus-visible,post-mainnavigation post-list-item post-megadropdown-trigger button:focus-visible{border-radius:var(--post-core-dimension-4)}post-mainnavigation .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.98px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-16)}}@media screen and (max-width: 599.98px){post-mainnavigation .back-button{font-size:var(--post-core-font-size-14)}}@media screen and (min-width: 1024px){post-mainnavigation{display:block}post-mainnavigation nav{max-width:100vw;background:var(--post-core-color-brand-white);max-height:var(--main-navigation-height);user-select:none;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{position:absolute;inset-block:0;overflow:hidden}post-mainnavigation .left-scroll-button button,post-mainnavigation .right-scroll-button button{padding:0;overflow:visible;border:0;background:none;color:inherit;font:inherit;-webkit-user-select:none;user-select:none;appearance:button;background:var(--post-core-color-brand-white);padding:var(--post-core-dimension-16);box-shadow:var(--post-core-elevation-5);line-height:var(--post-core-line-height-100);height:100%}post-mainnavigation .left-scroll-button button post-icon,post-mainnavigation .right-scroll-button button post-icon{font-size:1rem}post-mainnavigation .left-scroll-button{inset-inline-start:0;padding-inline-end:2rem}post-mainnavigation .right-scroll-button{inset-inline-end:0;padding-inline-start:2rem}post-mainnavigation post-list{margin-inline:var(--post-core-dimension-4)}post-mainnavigation post-list>[role=list]{flex-direction:row;max-width:100vw;transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{position:sticky;padding-inline:var(--post-core-dimension-12);height:var(--main-navigation-height);gap:var(--post-core-dimension-4);font-size:var(--post-core-font-size-16);border-block:0 solid rgba(0,0,0,0);border-block-end-color:currentColor}}@media screen and (min-width: 1024px)and (max-width: 1023.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{z-index:3}}@media screen and (min-width: 1024px)and (min-width: 1024px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{z-index:4}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a:hover,post-mainnavigation post-list-item>button:hover,post-mainnavigation post-list-item post-megadropdown-trigger button:hover{border-block-width:var(--post-core-dimension-2)}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>a.selected,post-mainnavigation post-list-item>a[aria-expanded=true],post-mainnavigation post-list-item>button.selected,post-mainnavigation post-list-item>button[aria-expanded=true],post-mainnavigation post-list-item post-megadropdown-trigger button.selected,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]{border-block-width:var(--post-core-dimension-4);font-weight:var(--post-core-font-weight-700)}}@media screen and (min-width: 1024px)and (max-width: 599.98px){post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{font-size:var(--post-core-font-size-14)}}@media screen and (min-width: 1024px){post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{padding-inline-end:var(--post-core-dimension-12);transition:border-block-end-color 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button::after,post-mainnavigation post-list-item post-megadropdown-trigger button::after{content:\"\";mask-image:url(\"data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m23.6 13.2-7.5 7.6-7.6-7.6.9-.9 6.6 6.6 6.6-6.6z'/%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;height:var(--post-core-dimension-24);width:var(--post-core-dimension-24);transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}post-mainnavigation post-list-item>button.selected::after,post-mainnavigation post-list-item>button[aria-expanded=true]::after,post-mainnavigation post-list-item post-megadropdown-trigger button.selected::after,post-mainnavigation post-list-item post-megadropdown-trigger button[aria-expanded=true]::after{transform:rotate(180deg)}}@media screen and (min-width: 1024px){post-mainnavigation post-megadropdown button:not(.btn-icon-close),post-mainnavigation post-megadropdown a{width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative}post-mainnavigation post-megadropdown button:not(.btn-icon-close)::before,post-mainnavigation post-megadropdown a::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::before,post-mainnavigation post-megadropdown a:hover::before{height:var(--post-core-dimension-3)}post-mainnavigation post-megadropdown button:not(.btn-icon-close):hover::after,post-mainnavigation post-megadropdown a:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}}@media screen and (min-width: 1024px){post-mainnavigation [slot=back-button]{display:none}}@media screen and (max-width: 1023.98px){post-mainnavigation nav{transform:none !important}post-mainnavigation .left-scroll-button,post-mainnavigation .right-scroll-button{display:none}post-mainnavigation post-list-item>a,post-mainnavigation post-list-item>button,post-mainnavigation post-list-item post-megadropdown-trigger button{width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative}post-mainnavigation post-list-item>a::before,post-mainnavigation post-list-item>button::before,post-mainnavigation post-list-item post-megadropdown-trigger button::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}post-mainnavigation post-list-item>a:hover::before,post-mainnavigation post-list-item>button:hover::before,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::before{height:var(--post-core-dimension-3)}post-mainnavigation post-list-item>a:hover::after,post-mainnavigation post-list-item>button:hover::after,post-mainnavigation post-list-item post-megadropdown-trigger button:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}}post-mainnavigation .back-button .btn{padding-inline:0}";
594
776
  const PostMainnavigationStyle0 = postMainnavigationCss;
595
777
 
778
+ const SCROLL_REPEAT_INTERVAL = 100; // Interval for repeated scrolling when holding down scroll button
779
+ const NAVBAR_DISABLE_DURATION = 400; // Duration to temporarily disable navbar interactions during scrolling
780
+ const NAVIGATION_LIST_SELECTOR = 'post-list:not(post-megadropdown *) > [role="list"]';
781
+ const NAVIGATION_ITEM_SELECTOR = ':is(post-list-item > a, post-list-item > post-megadropdown-trigger > button):not(post-megadropdown *)';
596
782
  const PostMainnavigation = class {
597
783
  constructor(hostRef) {
598
784
  registerInstance(this, hostRef);
599
- this.postToggle = createEvent(this, "postToggle", 7);
785
+ }
786
+ header;
787
+ navbar;
788
+ rightScrollButton;
789
+ leftScrollButton;
790
+ scrollRepeatInterval;
791
+ navbarDisableTimer;
792
+ mutationObserver = new MutationObserver(async (mutations) => {
793
+ // Wait for all elements to be hydrated
794
+ await Promise.all(mutations
795
+ .flatMap((mutation) => Array.from(mutation.addedNodes))
796
+ .map((item) => item.componentOnReady ? item.componentOnReady() : Promise.resolve(item)));
797
+ // Recalculate scrollability after DOM changes
798
+ this.checkScrollability();
799
+ });
800
+ get host() { return getElement(this); }
801
+ canScrollLeft = false;
802
+ canScrollRight = false;
803
+ translateAmount = 0;
804
+ /**
805
+ * Update navbar translation when 'translateAmount' changes and recalculate scrollability
806
+ */
807
+ onTranslateAmountChanges(value) {
808
+ this.navbar.style.transform = `translateX(-${value}px)`;
809
+ this.checkScrollability();
600
810
  }
601
811
  /**
602
812
  * Retrieves a reference to the closest 'post-header' element when the main navigation is added to the DOM.
813
+ * This ensures that we can interact with the header for mobile menu toggling.
603
814
  */
604
815
  connectedCallback() {
605
816
  this.header = this.host.closest('post-header');
@@ -609,104 +820,329 @@ const PostMainnavigation = class {
609
820
  */
610
821
  disconnectedCallback() {
611
822
  this.header = null;
823
+ this.mutationObserver.disconnect();
824
+ }
825
+ componentDidLoad() {
826
+ setTimeout(() => this.checkScrollability()); // Initial check to determine if scrolling is needed
827
+ this.mutationObserver.observe(this.navigationList, { subtree: true, childList: true }); // Recheck scrollability when navigation list changes
828
+ window.addEventListener('resize', // Recheck scrollability on window resize
829
+ throttle(100, () => this.checkScrollability()));
830
+ // Handle focus changes and adjust scroll as needed
831
+ this.navbar.addEventListener('focusin', e => this.adjustTranslation(e));
612
832
  }
613
833
  handleBackButtonClick() {
614
834
  if (this.header)
615
835
  this.header.toggleMobileMenu();
616
836
  }
837
+ /**
838
+ * Moves focus on the navbar and adjusts scrolling to bring focused element into view.
839
+ */
840
+ adjustTranslation(e) {
841
+ const focusedElement = e.target;
842
+ if (!this.canScroll || !focusedElement.matches(NAVIGATION_ITEM_SELECTOR))
843
+ return;
844
+ // We need to move the element into the view before it is focused to avoid browser default behavior
845
+ e.preventDefault();
846
+ this.withoutTransition(() => {
847
+ // Try scrolling in both directions, only the necessary translation will actually occur
848
+ this.translateRightTo(focusedElement);
849
+ this.translateLeftTo(focusedElement);
850
+ focusedElement.focus();
851
+ });
852
+ }
853
+ /**
854
+ * Checks if scrolling is possible in either direction (left or right) and updates the state accordingly.
855
+ */
856
+ checkScrollability() {
857
+ const { scrollWidth, clientWidth } = this.navbar;
858
+ const couldScroll = this.canScroll;
859
+ if (scrollWidth === clientWidth) {
860
+ // If scroll width equals client width, scrolling is disabled in both directions
861
+ this.canScrollLeft = this.canScrollRight = false;
862
+ }
863
+ else {
864
+ this.canScrollLeft = this.translateAmount !== 0; // Scrolling left is possible if not at the start
865
+ this.canScrollRight = clientWidth + this.translateAmount !== scrollWidth; // Scrolling right is possible if not at the end
866
+ }
867
+ if (couldScroll && !this.canScroll) {
868
+ this.withoutTransition(() => (this.translateAmount = 0));
869
+ }
870
+ }
871
+ /**
872
+ * Returns whether scrolling is enabled in either the left or right direction.
873
+ */
874
+ get canScroll() {
875
+ return this.canScrollLeft || this.canScrollRight;
876
+ }
877
+ /**
878
+ * Handles the scrolling behavior when a user clicks on the left or right scroll buttons.
879
+ */
880
+ handleScrollButtonClick(direction) {
881
+ if (!this.canScroll)
882
+ return;
883
+ // Disable interaction with the navbar during scrolling
884
+ this.disableNavbar();
885
+ // Perform the initial scroll action
886
+ this.scroll(direction);
887
+ // Repeat the scrolling action while the button is held down
888
+ this.scrollRepeatInterval = setInterval(() => {
889
+ this.scroll(direction);
890
+ }, SCROLL_REPEAT_INTERVAL);
891
+ }
892
+ /**
893
+ * Stops the repeated scrolling when the mouse button is released.
894
+ */
895
+ stopScrolling() {
896
+ if (this.scrollRepeatInterval)
897
+ clearInterval(this.scrollRepeatInterval);
898
+ }
899
+ scroll(direction) {
900
+ const navigationItems = Array.from(this.navigationItems);
901
+ if (direction === 'left')
902
+ navigationItems.reverse();
903
+ for (const item of navigationItems) {
904
+ const couldScroll = direction === 'left' ? this.translateLeftTo(item) : this.translateRightTo(item);
905
+ if (couldScroll)
906
+ break;
907
+ }
908
+ }
909
+ translateRightTo(navigationItem) {
910
+ const itemRightEdgePosition = navigationItem.offsetLeft + navigationItem.offsetWidth + this.getFocusMargin(navigationItem);
911
+ const lastVisiblePosition = this.navbar.clientWidth + this.translateAmount;
912
+ // If the item is already fully visible, don't scroll
913
+ if (itemRightEdgePosition < lastVisiblePosition)
914
+ return false;
915
+ const maxTranslateAmount = this.navbar.scrollWidth - this.navbar.clientWidth;
916
+ const newRightEdgePosition = itemRightEdgePosition + this.rightScrollButton.clientWidth - this.navbar.clientWidth;
917
+ this.translateAmount = Math.min(maxTranslateAmount, newRightEdgePosition);
918
+ return true;
919
+ }
920
+ translateLeftTo(navigationItem) {
921
+ const itemLeftEdgePosition = navigationItem.offsetLeft - this.getFocusMargin(navigationItem);
922
+ const firstVisiblePosition = this.translateAmount;
923
+ // If the item is already fully visible, don't scroll
924
+ if (itemLeftEdgePosition > firstVisiblePosition)
925
+ return false;
926
+ const minTranslateAmount = 0;
927
+ const newRightEdgePosition = itemLeftEdgePosition - this.leftScrollButton.clientWidth;
928
+ this.translateAmount = Math.max(minTranslateAmount, newRightEdgePosition);
929
+ return true;
930
+ }
931
+ /**
932
+ * Calculate the margin required for focus outline around navigation items
933
+ */
934
+ getFocusMargin(navigationItem) {
935
+ const { outlineWidth, outlineOffset } = getComputedStyle(navigationItem);
936
+ return parseInt(outlineWidth) + parseInt(outlineOffset) + 1;
937
+ }
938
+ /**
939
+ * Returns the navigation list container element
940
+ */
941
+ get navigationList() {
942
+ return this.navbar.querySelector(NAVIGATION_LIST_SELECTOR);
943
+ }
944
+ /**
945
+ * Returns the navigation items
946
+ */
947
+ get navigationItems() {
948
+ return this.navbar.querySelectorAll(NAVIGATION_ITEM_SELECTOR);
949
+ }
950
+ /**
951
+ * Temporarily disables interactions with the navbar during scrolling to prevent accidental clicks.
952
+ * Re-enables interactions after a brief delay to avoid blocking the user entirely.
953
+ */
954
+ disableNavbar() {
955
+ if (this.navbarDisableTimer)
956
+ clearTimeout(this.navbarDisableTimer);
957
+ this.navbar.style.pointerEvents = 'none';
958
+ this.navbarDisableTimer = setTimeout(() => {
959
+ this.navbar.style.pointerEvents = 'initial';
960
+ }, NAVBAR_DISABLE_DURATION);
961
+ }
962
+ /**
963
+ * Allows to translate the navbar without a transition
964
+ */
965
+ withoutTransition(callback) {
966
+ const transition = this.navbar.style.transition;
967
+ this.navbar.style.transition = 'none';
968
+ callback();
969
+ setTimeout(() => {
970
+ this.navbar.style.transition = transition;
971
+ });
972
+ }
617
973
  render() {
618
- return (h(Host, { key: '23d1cc3919d15543bf409e8fa25be02973532a12', slot: "post-mainnavigation" }, h("div", { key: '8d35b8b7715fbac387361706a03a10e4af481301', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '01899ddef2cdc321ff7383eec310877335e951a7', name: "back-button" })), h("nav", { key: '3237225f2608b28355e669e11189ba1ccc9c593a' }, h("slot", { key: '32105f3acf726a590631896c707a2149706a90d5' }))));
974
+ return (h(Host, { key: '3280c55d0f8e7aec6e1dc3f59744114b2557cb04', slot: "post-mainnavigation" }, h("div", { key: '446ede19ef62a21022a771edb8a6e8eb30a5c5d3', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '5e923b62133d3452676445349624157fd7d3d957', name: "back-button" })), h("nav", { key: 'd67723ba6b42ec2b083197091ec7226dc258897e', ref: el => (this.navbar = el) }, h("slot", { key: 'ea1a0fd7f76e02b89789713a49fc4d7fd6e8a022' })), h("div", { key: '1a3d640acfe23ae5c5f9ab26a7bca9c3c2bc4434', class: `left-scroll-button${this.canScrollLeft ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'a3260bba8104bf9155120e04fed6ba0aa102e529', type: "button", tabindex: "-1", ref: el => (this.leftScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('left') }, h("post-icon", { key: '0bba0a76f93098267be8432636391641f55d5df8', "aria-hidden": "true", name: "chevronleft" }))), h("div", { key: '401ef6821f258737d17ed54ae1c577cc4783a3f9', class: `right-scroll-button${this.canScrollRight ? '' : ' d-none'}`, "aria-hidden": "true" }, h("button", { key: 'd964f4b74ad8fef86115b12fcda12cc54da936f3', type: "button", tabindex: "-1", ref: el => (this.rightScrollButton = el), onMouseDown: () => this.handleScrollButtonClick('right') }, h("post-icon", { key: '5758f48df24b4a3ea241f43464b448878e31977d', "aria-hidden": "true", name: "chevronright" })))));
619
975
  }
620
- get host() { return getElement(this); }
976
+ static get watchers() { return {
977
+ "translateAmount": ["onTranslateAmountChanges"]
978
+ }; }
621
979
  };
622
980
  PostMainnavigation.style = PostMainnavigationStyle0;
623
981
 
624
- const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}*,::before,::after{box-sizing:border-box}post-popovercontainer{background-color:#fafafa;border:none;border-top:1px solid #e1e0dc;width:100%;border-radius:0;box-shadow:0 8px 6px rgba(0,0,0,.16)}@media screen and (max-width: 1023.99px){post-popovercontainer{position:absolute;top:var(--header-height) !important;bottom:0;left:0;width:100%;height:auto;border-top:unset}post-popovercontainer.slide-in{animation:slide-in;animation-duration:350ms;animation-fill-mode:forwards}post-popovercontainer.slide-out{animation:slide-out;animation-duration:350ms;animation-fill-mode:forwards}}.megadropdown{padding:31px 40px 40px}@media screen and (max-width: 1023.99px){.megadropdown{padding:16px 32px 24px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.99px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.99px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-top:0;margin-bottom:8px;font-weight:900}.megadropdown h2 a{text-decoration:none;font-weight:inherit;border-bottom:0;border-top:0}@media screen and (max-width: 1023.99px){.megadropdown h2{display:block;font-size:20px}}.megadropdown a:hover{border-block-width:0}.megadropdown a:hover::after{content:unset}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;border-bottom:1px solid #050400;padding:15px 12px 14px 0;display:block;font-weight:900}.megadropdown post-list .list-title h3 a{text-decoration:none;width:100%;font-size:inherit;display:inline-block;font-weight:inherit;height:unset;padding:0;border:0}@media screen and (max-width: 1023.99px){.megadropdown post-list .list-title h3{font-size:16px;padding:12px 12px 11px 0}}.megadropdown post-list-item{border-bottom:1px solid #050400}.megadropdown post-list-item>a{padding:13px 12px 12px 0;display:block;text-decoration:none;width:100%;border-bottom:0;height:auto;border-top:0}@media screen and (max-width: 1023.99px){.megadropdown post-list-item>a{padding:12px 12px 11px 0}}.megadropdown .back-button{display:none;margin-bottom:2rem}.megadropdown .back-button .btn{width:auto}.megadropdown .back-button post-icon{transform:rotate(180deg)}@media screen and (max-width: 1023.99px){.megadropdown .back-button{display:block}}.megadropdown .close-button{position:absolute;top:1rem;right:1rem}@media screen and (max-width: 1023.99px){.megadropdown .close-button{display:none}}";
982
+ const postMegadropdownCss = "@keyframes slide-in{0%{transform:translateX(100%)}100%{transform:translateX(0%)}}@keyframes slide-out{from{transform:translateX(0%)}to{transform:translateX(100%)}}@keyframes slide-down{from{transform:translateY(-100%)}to{transform:translateY(0%)}}@keyframes slide-up{0%{transform:translateY(0%)}100%{transform:translateY(-100%)}}*,::before,::after{box-sizing:border-box}.megadropdown-container{--post-main-header-height:56px;--post-global-header-height:72px;--post-header-height:calc(var(--post-global-header-height) + var(--post-main-header-height));box-shadow:0 8px 6px rgba(0,0,0,.16);position:absolute;background-color:#fafafa;border:none;z-index:1;border-top:1px solid #e1e0dc;width:100%;top:100%;left:0;border-radius:0}.megadropdown-container.slide-in{animation:slide-down 350ms forwards}.megadropdown-container.slide-out{animation:slide-up 350ms forwards}@media screen and (max-width: 1023.98px){.megadropdown-container{--post-global-header-height:64px;z-index:4;top:0 !important;left:0;width:100%;position:fixed;height:calc(100vh - var(--post-header-height));max-height:calc(100vh - var(--header-height));border-top:unset;overflow:auto}.megadropdown-container.slide-in{animation:slide-in 350ms forwards}.megadropdown-container.slide-out{animation:slide-out 350ms forwards}}.megadropdown{padding:31px 40px 40px;background-color:#fafafa}@media screen and (max-width: 1023.98px){.megadropdown{padding:16px 32px 24px}}@media screen and (max-width: 599.98px){.megadropdown{padding-inline:16px}}.megadropdown .megadropdown-content{gap:1.5rem;display:grid;grid-template-columns:repeat(auto-fit, minmax(min(15vw, 100%), 1fr));grid-auto-rows:1fr auto;grid-auto-flow:dense}@media screen and (max-width: 1023.98px){.megadropdown .megadropdown-content{grid-template-columns:repeat(auto-fit, minmax(min(35vw, 100%), 1fr))}}@media screen and (max-width: 599.98px){.megadropdown .megadropdown-content{grid-template-columns:1fr}}.megadropdown h2{display:none;margin-top:0;margin-bottom:8px;font-weight:900}.megadropdown h2 a{text-decoration:none;font-weight:inherit;border-bottom:0;border-top:0}@media screen and (max-width: 1023.98px){.megadropdown h2{display:block;font-size:1.25rem}}@media screen and (max-width: 599.98px){.megadropdown h2{font-size:1.125rem}}.megadropdown post-list{display:grid;grid-row:span 2;grid-template-rows:subgrid;row-gap:0px}.megadropdown post-list>[role=list]{flex-direction:unset;display:unset}.megadropdown post-list>*{width:100%}.megadropdown post-list .list-title{display:flex;flex-direction:column-reverse;height:100%}.megadropdown post-list .list-title h3{font-size:20px;display:block;font-weight:900}.megadropdown post-list .list-title h3:not(:has(a)){padding:15px 12px 14px 8px;border-bottom:1px solid #050400}.megadropdown post-list .list-title h3 a{padding-block:15px 14px;padding-inline-start:8px;border-radius:0;text-decoration:none;font-size:inherit;display:flex;align-items:center;justify-content:space-between;min-height:53px;width:100%;min-width:100%;height:var(--post-core-dimension-48);padding-inline-end:calc(var(--post-core-dimension-6) + var(--post-core-dimension-24) + var(--post-core-dimension-16));gap:var(--post-core-dimension-16);font-weight:var(--post-core-font-weight-400);position:relative;height:unset;font-weight:900}.megadropdown post-list .list-title h3 a::before{content:\"\";background-color:currentColor;bottom:0;width:100%;height:var(--post-core-dimension-1);position:absolute;left:0}.megadropdown post-list .list-title h3 a:hover::before{height:var(--post-core-dimension-3)}.megadropdown post-list .list-title h3 a:hover::after{content:\"\";display:block;margin-right:calc((var(--post-core-dimension-24) + var(--post-core-dimension-16))*-1);mask-image:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='m31.95 16-9.11 9.11c-.2.2-.45.29-.71.29s-.51-.1-.71-.29a.996.996 0 0 1 0-1.41l6.69-6.69H-.05v-2h28.17l-6.69-6.69a.996.996 0 1 1 1.41-1.41l9.11 9.11Z'%3E%3C/path%3E%3C/svg%3E\");background-color:currentColor;color:currentColor;forced-color-adjust:preserve-parent-color;width:var(--post-core-dimension-20);min-width:var(--post-core-dimension-20);height:var(--post-core-dimension-20)}@media screen and (max-width: 1023.98px){.megadropdown post-list .list-title h3{font-size:1rem}.megadropdown post-list .list-title h3:not(:has(a)){padding:15px 12px 14px 8px;border-bottom:1px solid #050400}}@media screen and (max-width: 599.98px){.megadropdown post-list .list-title h3{font-size:.875rem}}.megadropdown post-list-item>a{padding-block:13px 12px;padding-inline-start:8px;display:flex;text-decoration:none;width:100%;min-width:100%;height:auto;min-height:48px}.megadropdown post-list-item>a:hover{border-block-width:0}@media screen and (min-width: 1024px){.megadropdown post-list-item>a{font-size:1.25rem}}@media screen and (max-width: 1023.98px){.megadropdown post-list-item>a{padding-block:12px 11px}}@media screen and (max-width: 599.98px){.megadropdown post-list-item>a{font-size:.875rem}}.megadropdown .back-button{display:none;margin-bottom:2rem}.megadropdown .back-button .btn{width:auto}@media screen and (max-width: 1023.98px){.megadropdown .back-button{display:block}}.megadropdown .close-button{position:absolute;top:1rem;right:1rem}@media screen and (max-width: 1023.98px){.megadropdown .close-button{display:none}}";
625
983
  const PostMegadropdownStyle0 = postMegadropdownCss;
626
984
 
627
985
  const PostMegadropdown = class {
628
986
  constructor(hostRef) {
629
987
  registerInstance(this, hostRef);
630
988
  this.postToggleMegadropdown = createEvent(this, "postToggleMegadropdown", 7);
631
- this.isVisible = false;
632
- this.animationClass = null;
633
- }
634
- componentDidLoad() {
635
- this.popoverRef.addEventListener('postToggle', (event) => {
636
- this.isVisible = event.detail;
637
- this.postToggleMegadropdown.emit(this.isVisible);
638
- });
639
- this.popoverRef.addEventListener('animationend', () => {
640
- if (this.animationClass === 'slide-out') {
641
- this.hide();
642
- }
643
- });
644
989
  }
990
+ header;
991
+ firstFocusableEl;
992
+ lastFocusableEl;
993
+ device;
994
+ get host() { return getElement(this); }
995
+ /** Tracks the currently active dropdown instance. */
996
+ static activeDropdown = null;
645
997
  /**
646
- * Toggles the dropdown visibility based on its current state.
998
+ * Holds the current visibility state of the dropdown.
999
+ * This state is internally managed to track whether the dropdown is open (`true`) or closed (`false`),
1000
+ * and updates automatically when the dropdown is toggled.
647
1001
  */
648
- async toggle(target) {
649
- this.isVisible ? this.hide() : await this.show(target);
1002
+ isVisible = false;
1003
+ /** Holds the current animation class. */
1004
+ animationClass = null;
1005
+ /**
1006
+ * Emits when the dropdown is shown or hidden.
1007
+ * The event payload is a boolean: `true` when the dropdown was opened, `false` when it was closed.
1008
+ **/
1009
+ postToggleMegadropdown;
1010
+ disconnectedCallback() {
1011
+ this.removeOutsideClickListener();
1012
+ if (PostMegadropdown.activeDropdown === this) {
1013
+ PostMegadropdown.activeDropdown = null;
1014
+ }
1015
+ }
1016
+ componentWillRender() {
1017
+ this.getFocusableElements();
650
1018
  }
651
1019
  /**
652
- * Displays the popover dropdown
653
- *
654
- * @param target - The HTML element relative to which the popover dropdown should be displayed.
1020
+ * Toggles the dropdown visibility based on its current state.
655
1021
  */
656
- async show(target) {
657
- if (this.popoverRef) {
658
- await this.popoverRef.show(target);
659
- this.animationClass = 'slide-in';
1022
+ async toggle() {
1023
+ if (this.isVisible) {
1024
+ this.hide();
660
1025
  }
661
1026
  else {
662
- console.error('show: popoverRef is null or undefined');
1027
+ await this.show();
663
1028
  }
664
1029
  }
665
1030
  /**
666
- * Hides the popover dropdown
1031
+ * Displays the dropdown.
667
1032
  */
668
- hide() {
669
- if (this.popoverRef) {
670
- this.popoverRef.hide();
671
- }
672
- else {
673
- console.error('hide: popoverRef is null or undefined');
1033
+ async show() {
1034
+ if (PostMegadropdown.activeDropdown && PostMegadropdown.activeDropdown !== this) {
1035
+ // Close the previously active dropdown without animation
1036
+ PostMegadropdown.activeDropdown.forceClose();
674
1037
  }
1038
+ this.isVisible = true;
1039
+ this.host.addEventListener('keydown', e => this.keyboardHandler(e));
1040
+ this.animationClass = 'slide-in';
1041
+ PostMegadropdown.activeDropdown = this;
1042
+ this.postToggleMegadropdown.emit(this.isVisible);
1043
+ this.addOutsideClickListener();
675
1044
  }
676
- handleBackButtonClick() {
1045
+ /**
1046
+ * Hides the dropdown with an animation.
1047
+ */
1048
+ async hide() {
677
1049
  this.animationClass = 'slide-out';
1050
+ this.host.removeEventListener('keydown', e => this.keyboardHandler(e));
678
1051
  }
679
- handleCloseButtonClick() {
680
- this.popoverRef.hide();
1052
+ connectedCallback() {
1053
+ this.header = this.host.closest('post-header');
1054
+ if (this.header) {
1055
+ this.header.addEventListener('postUpdateDevice', (event) => (this.device = event.detail));
1056
+ }
681
1057
  }
682
- handleFocusout(event) {
683
- const relatedTarget = event.relatedTarget;
684
- const megadropdown = this.popoverRef.querySelector('.megadropdown');
685
- if (!megadropdown.contains(relatedTarget)) {
686
- this.hide();
1058
+ /**
1059
+ * Forces the dropdown to close without animation.
1060
+ */
1061
+ forceClose() {
1062
+ this.isVisible = false;
1063
+ this.animationClass = null;
1064
+ this.postToggleMegadropdown.emit(this.isVisible);
1065
+ this.removeOutsideClickListener();
1066
+ }
1067
+ handleAnimationEnd() {
1068
+ if (this.animationClass === 'slide-out') {
1069
+ this.isVisible = false;
1070
+ this.animationClass = null;
1071
+ this.postToggleMegadropdown.emit(this.isVisible);
1072
+ this.removeOutsideClickListener();
1073
+ }
1074
+ }
1075
+ handleClickOutside = (event) => {
1076
+ const target = event.target;
1077
+ if (this.host.contains(target)) {
1078
+ return;
1079
+ }
1080
+ if (target instanceof HTMLElement) {
1081
+ const trigger = target.closest('post-megadropdown-trigger');
1082
+ if (trigger) {
1083
+ const targetDropdownId = trigger.getAttribute('for');
1084
+ if (targetDropdownId !== this.host.id) {
1085
+ return;
1086
+ }
1087
+ }
1088
+ }
1089
+ this.hide();
1090
+ };
1091
+ addOutsideClickListener() {
1092
+ document.addEventListener('mousedown', this.handleClickOutside);
1093
+ }
1094
+ removeOutsideClickListener() {
1095
+ document.removeEventListener('mousedown', this.handleClickOutside);
1096
+ }
1097
+ getFocusableElements() {
1098
+ const focusableEls = Array.from(this.host.querySelectorAll('post-list-item, h3, .back-button'));
1099
+ const focusableChildren = focusableEls.flatMap(el => Array.from(getFocusableChildren(el)));
1100
+ this.firstFocusableEl = focusableChildren[0];
1101
+ this.lastFocusableEl = focusableChildren[focusableChildren.length - 1];
1102
+ }
1103
+ // Loop through the focusable children
1104
+ keyboardHandler(e) {
1105
+ if (e.key === 'Tab' && this.device !== 'desktop') {
1106
+ if (e.shiftKey && document.activeElement === this.firstFocusableEl) {
1107
+ // If back tab (TAB + Shift) and first element is focused, focus goes to the last element of the megadropdown
1108
+ e.preventDefault();
1109
+ this.lastFocusableEl.focus();
1110
+ }
1111
+ else if (!e.shiftKey && document.activeElement === this.lastFocusableEl) {
1112
+ // If TAB and last element is focused, focus goes back to the first element of the megadropdown
1113
+ e.preventDefault();
1114
+ this.firstFocusableEl.focus();
1115
+ }
687
1116
  }
688
1117
  }
689
1118
  render() {
690
- return (h(Host, { key: 'cb7df3441b1c064045c6d27cd7e20376a62de57c' }, h("post-popovercontainer", { key: '8c2de3df3d1dd59187f463d751654958326dde02', class: this.animationClass, placement: "bottom", "edge-gap": "0", ref: el => (this.popoverRef = el) }, h("div", { key: '392182e1d6206c969fc64b1758d121e1ab6361f3', class: "megadropdown", onFocusout: e => this.handleFocusout(e) }, h("div", { key: '45742e41d227d0481436bd49de065044a2ce5e35', onClick: () => this.handleBackButtonClick(), class: "back-button" }, h("slot", { key: '5607a569924faba3be599b6e1f53f4a8704b2f05', name: "back-button" })), h("div", { key: 'c1a99e2d25af71fc3122e1173549ad7fe1d920b7', onClick: () => this.handleCloseButtonClick(), class: "close-button" }, h("slot", { key: '82059d749600e18e63c836d5ab6697eb50ec91cf', name: "close-button" })), h("slot", { key: 'eea5e876c1ae5558a3c5c6301b298e564d8b75b0', name: "megadropdown-title" }), h("div", { key: '16b0f351786aef2827ce08163a554e49c40f224b', class: "megadropdown-content" }, h("slot", { key: '97e5230769b01070e488f71704740ec27de9f2d4' }))))));
1119
+ const containerStyle = this.isVisible ? {} : { display: 'none' };
1120
+ return (h(Host, { key: '5aa08b01be715325182c245e1b0ae2456bcc5df6' }, h("div", { key: '0737c9368ecbffac59bbdf47fabac3f3b94ae7bb', class: `megadropdown-container ${this.animationClass || ''}`, style: containerStyle, onAnimationEnd: () => this.handleAnimationEnd() }, h("div", { key: 'efe49f3f9cdcd99e2feca78b772c944405e19f21', class: "megadropdown" }, h("div", { key: '14dd7ff2f7e7b1eb91f2673a25d7ccafffe4f9d0', onClick: () => this.hide(), class: "back-button" }, h("slot", { key: '554e30e6408c0bef0549f5e2c31dcd8b90ceee40', name: "back-button" })), h("div", { key: '4e7335152d7b6649918adf075213ebbf8b8ddeaa', onClick: () => this.hide(), class: "close-button" }, h("slot", { key: 'db90f3a5334ce723c0ee672a96167197ca25b545', name: "close-button" })), h("slot", { key: 'b11b1d16147f88103f2eb24c8dd21394de53f69c', name: "megadropdown-title" }), h("div", { key: '6d837c1a70f66f00097fb531058750fbac6fd41a', class: "megadropdown-content" }, h("slot", { key: 'be685185f04e44d867167f918494d086856b5928' }))))));
691
1121
  }
692
- get host() { return getElement(this); }
693
1122
  };
694
1123
  PostMegadropdown.style = PostMegadropdownStyle0;
695
1124
 
696
- const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100%}";
1125
+ const postMegadropdownTriggerCss = "post-megadropdown-trigger{width:100%;position:relative;z-index:3}";
697
1126
  const PostMegadropdownTriggerStyle0 = postMegadropdownTriggerCss;
698
1127
 
699
1128
  const PostMegadropdownTrigger = class {
700
1129
  constructor(hostRef) {
701
1130
  registerInstance(this, hostRef);
702
- /**
703
- * Reference to the slotted button within the trigger, if present.
704
- * Used to manage click and key events for mega dropdown control.
705
- */
706
- this.slottedButton = null;
707
- this.for = undefined;
708
- this.ariaExpanded = false;
709
1131
  }
1132
+ /**
1133
+ * ID of the mega dropdown element that this trigger is linked to. Used to open and close the specified mega dropdown.
1134
+ */
1135
+ for;
1136
+ get host() { return getElement(this); }
1137
+ /**
1138
+ * Manages the accessibility attribute `aria-expanded` to indicate whether the associated mega dropdown is expanded or collapsed.
1139
+ */
1140
+ ariaExpanded = false;
1141
+ /**
1142
+ * Reference to the slotted button within the trigger, if present.
1143
+ * Used to manage click and key events for mega dropdown control.
1144
+ */
1145
+ slottedButton = null;
710
1146
  /**
711
1147
  * Watch for changes to the `for` property to validate its type and ensure it is a string.
712
1148
  * @param forValue - The new value of the `for` property.
@@ -722,7 +1158,7 @@ const PostMegadropdownTrigger = class {
722
1158
  }
723
1159
  handleToggle() {
724
1160
  if (this.megadropdown) {
725
- this.megadropdown.toggle(this.host);
1161
+ this.megadropdown.toggle();
726
1162
  }
727
1163
  else {
728
1164
  console.warn(`No post-megadropdown found with ID: ${this.for}`);
@@ -751,43 +1187,14 @@ const PostMegadropdownTrigger = class {
751
1187
  }
752
1188
  }
753
1189
  render() {
754
- return (h(Host, { key: 'ba9b6922d4f4eac596f7d1310a5a1bf534b156d8', "data-version": version, "tab-index": "-1" }, h("button", { key: '5fe4ea7f385897606f472ea72be84399e76550e2' }, h("slot", { key: '333f583f0db191599c4be9be9647789b2ea1ecaf' }))));
1190
+ return (h(Host, { key: '2e009cb0dbfd81785d3a8ce5802a4fab0e84a52e', "data-version": version, "tab-index": "-1" }, h("button", { key: 'd77d9a5eb5786a63cf7453c639647adc705892bc' }, h("slot", { key: '19f4b17dc2d073b0770c33d6acfb763c1e47735a' }))));
755
1191
  }
756
- get host() { return getElement(this); }
757
1192
  static get watchers() { return {
758
1193
  "for": ["validateControlFor"]
759
1194
  }; }
760
1195
  };
761
1196
  PostMegadropdownTrigger.style = PostMegadropdownTriggerStyle0;
762
1197
 
763
- const focusableSelector = `:where(${[
764
- 'button',
765
- 'input:not([type="hidden"])',
766
- '[tabindex]',
767
- 'select',
768
- 'textarea',
769
- '[contenteditable]',
770
- 'a[href]',
771
- 'iframe',
772
- 'audio[controls]',
773
- 'video[controls]',
774
- 'area[href]',
775
- 'details > summary:first-of-type',
776
- ].join(',')})`;
777
- const focusDisablingSelector = `:where(${[
778
- '[inert]',
779
- '[inert] *',
780
- ':disabled',
781
- 'dialog:not([open]) *',
782
- '[popover]:not(:popover-open) *',
783
- 'details:not([open]) > *:not(details > summary:first-of-type)',
784
- 'details:not([open]) > *:not(details > summary:first-of-type) *',
785
- '[tabindex^="-"]',
786
- ].join(',')})`;
787
- const getFocusableChildren = (element) => {
788
- return element.querySelectorAll(`& > ${focusableSelector}:not(${focusDisablingSelector})`);
789
- };
790
-
791
1198
  const postMenuCss = "/*!\n * Copyright 2021 by Swiss Post, Information Technology\n */:host{display:block}post-popovercontainer{padding:var(--post-menu-padding);background-color:var(--post-menu-bg, #ffffff);border-color:var(--post-menu-bg, #ffffff)}.popover-container{display:flex;flex-direction:column}";
792
1199
  const PostMenuStyle0 = postMenuCss;
793
1200
 
@@ -795,36 +1202,38 @@ const PostMenu = class {
795
1202
  constructor(hostRef) {
796
1203
  registerInstance(this, hostRef);
797
1204
  this.toggleMenu = createEvent(this, "toggleMenu", 7);
798
- this.lastFocusedElement = null;
799
- this.KEYCODES = {
800
- SPACE: ' ',
801
- ENTER: 'Enter',
802
- UP: 'ArrowUp',
803
- DOWN: 'ArrowDown',
804
- TAB: 'Tab',
805
- HOME: 'Home',
806
- END: 'End',
807
- ESCAPE: 'Escape',
808
- };
809
- this.handleKeyDown = (e) => {
810
- e.stopPropagation();
811
- if (e.key === this.KEYCODES.ESCAPE) {
812
- this.toggle(this.host);
813
- return;
814
- }
815
- if (Object.values(this.KEYCODES).includes(e.key)) {
816
- this.controlKeyDownHandler(e);
817
- }
818
- };
819
- this.handleClick = (e) => {
820
- const target = e.target;
821
- if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
822
- this.toggle(this.host);
823
- }
824
- };
825
- this.placement = 'bottom';
826
- this.isVisible = false;
827
1205
  }
1206
+ popoverRef;
1207
+ lastFocusedElement = null;
1208
+ KEYCODES = {
1209
+ SPACE: ' ',
1210
+ ENTER: 'Enter',
1211
+ UP: 'ArrowUp',
1212
+ DOWN: 'ArrowDown',
1213
+ TAB: 'Tab',
1214
+ HOME: 'Home',
1215
+ END: 'End',
1216
+ ESCAPE: 'Escape',
1217
+ };
1218
+ get host() { return getElement(this); }
1219
+ /**
1220
+ * Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
1221
+ * Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
1222
+ * towards the viewport if they would overlap edge boundaries.
1223
+ */
1224
+ placement = 'bottom';
1225
+ /**
1226
+ * Holds the current visibility state of the menu.
1227
+ * This state is internally managed to track whether the menu is open (`true`) or closed (`false`),
1228
+ * and updates automatically when the menu is toggled.
1229
+ */
1230
+ isVisible = false;
1231
+ /**
1232
+ * Emits when the menu is shown or hidden.
1233
+ * The event payload is a boolean: `true` when the menu was opened, `false` when it was closed.
1234
+ **/
1235
+ toggleMenu;
1236
+ root;
828
1237
  connectedCallback() {
829
1238
  this.root = getRoot(this.host);
830
1239
  this.host.addEventListener('keydown', this.handleKeyDown);
@@ -844,7 +1253,12 @@ const PostMenu = class {
844
1253
  * Toggles the menu visibility based on its current state.
845
1254
  */
846
1255
  async toggle(target) {
847
- this.isVisible ? await this.hide() : await this.show(target);
1256
+ if (this.isVisible) {
1257
+ await this.hide();
1258
+ }
1259
+ else {
1260
+ await this.show(target);
1261
+ }
848
1262
  }
849
1263
  /**
850
1264
  * Displays the popover menu, focusing the first menu item.
@@ -878,6 +1292,22 @@ const PostMenu = class {
878
1292
  console.error('hide: popoverRef is null or undefined');
879
1293
  }
880
1294
  }
1295
+ handleKeyDown = (e) => {
1296
+ e.stopPropagation();
1297
+ if (e.key === this.KEYCODES.ESCAPE) {
1298
+ this.toggle(this.host);
1299
+ return;
1300
+ }
1301
+ if (Object.values(this.KEYCODES).includes(e.key)) {
1302
+ this.controlKeyDownHandler(e);
1303
+ }
1304
+ };
1305
+ handleClick = (e) => {
1306
+ const target = e.target;
1307
+ if (['BUTTON', 'A', 'INPUT', 'SELECT', 'TEXTAREA'].includes(target.tagName)) {
1308
+ this.toggle(this.host);
1309
+ }
1310
+ };
881
1311
  controlKeyDownHandler(e) {
882
1312
  const menuItems = this.getSlottedItems();
883
1313
  if (!menuItems.length) {
@@ -926,9 +1356,8 @@ const PostMenu = class {
926
1356
  .flatMap(el => Array.from(getFocusableChildren(el))));
927
1357
  }
928
1358
  render() {
929
- return (h(Host, { key: '68c4661d3ab9256dadbbe3243247456c090b728e', "data-version": version }, h("post-popovercontainer", { key: 'b6cb0624239e0ed5aeadac63ffb1b1f7fb0e873e', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '608f677ae715eb09ed46fde9912241dc35673e06', class: "popover-container", part: "popover-container" }, h("slot", { key: '83f84b7b29b4d7c9d4e0924026ca7469c1f0cfb0' })))));
1359
+ return (h(Host, { key: '071532c327f80197dda662f77e5cb2444281087d', "data-version": version }, h("post-popovercontainer", { key: '9f70ca4009139e0547026b26be610a02f4f1a95a', placement: this.placement, ref: e => (this.popoverRef = e) }, h("div", { key: '3ff1048a8fb27402a82cedc3dc300366063c9601', class: "popover-container", part: "popover-container" }, h("slot", { key: 'bed6c96b7502e0032b746ac6fdf8c3dd6d782e48' })))));
930
1360
  }
931
- get host() { return getElement(this); }
932
1361
  };
933
1362
  PostMenu.style = PostMenuStyle0;
934
1363
 
@@ -938,20 +1367,22 @@ const PostMenuTriggerStyle0 = postMenuTriggerCss;
938
1367
  const PostMenuTrigger = class {
939
1368
  constructor(hostRef) {
940
1369
  registerInstance(this, hostRef);
941
- /**
942
- * Reference to the slotted button within the trigger, if present.
943
- * Used to manage click and key events for menu control.
944
- */
945
- this.slottedButton = null;
946
- this.handleKeyDown = (e) => {
947
- if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
948
- e.preventDefault();
949
- this.handleToggle();
950
- }
951
- };
952
- this.for = undefined;
953
- this.ariaExpanded = false;
954
1370
  }
1371
+ /**
1372
+ * ID of the menu element that this trigger is linked to. Used to open and close the specified menu.
1373
+ */
1374
+ for;
1375
+ get host() { return getElement(this); }
1376
+ /**
1377
+ * Manages the accessibility attribute `aria-expanded` to indicate whether the associated menu is expanded or collapsed.
1378
+ */
1379
+ ariaExpanded = false;
1380
+ /**
1381
+ * Reference to the slotted button within the trigger, if present.
1382
+ * Used to manage click and key events for menu control.
1383
+ */
1384
+ slottedButton = null;
1385
+ root;
955
1386
  /**
956
1387
  * Watch for changes to the `for` property to validate its type and ensure it is a string.
957
1388
  * @param forValue - The new value of the `for` property.
@@ -974,6 +1405,12 @@ const PostMenuTrigger = class {
974
1405
  console.warn(`No post-menu found with ID: ${this.for}`);
975
1406
  }
976
1407
  }
1408
+ handleKeyDown = (e) => {
1409
+ if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {
1410
+ e.preventDefault();
1411
+ this.handleToggle();
1412
+ }
1413
+ };
977
1414
  componentDidLoad() {
978
1415
  this.root = getRoot(this.host);
979
1416
  this.validateControlFor();
@@ -1000,9 +1437,8 @@ const PostMenuTrigger = class {
1000
1437
  }
1001
1438
  }
1002
1439
  render() {
1003
- return (h(Host, { key: '5bdaebd0c1f46fda5804c0e8d39ab3e714b523c5', "data-version": version, "tab-index": "-1" }, h("slot", { key: 'ffee26535991d712f44cb1859a5976ec89ad772a' })));
1440
+ return (h(Host, { key: 'a0fff619978087ce0c67d7d327982424e3784ff0', "data-version": version, "tab-index": "-1" }, h("slot", { key: '93e26150b59e9a01275a6815096e09ff5fac146b' })));
1004
1441
  }
1005
- get host() { return getElement(this); }
1006
1442
  static get watchers() { return {
1007
1443
  "for": ["validateControlFor"]
1008
1444
  }; }
@@ -3111,7 +3547,7 @@ const computePosition = (reference, floating, options) => {
3111
3547
  }
3112
3548
  `,E=null;function I(e){if(E===null)try{E=new CSSStyleSheet,E.replaceSync(C);}catch{E=!1;}if(E===!1){let t=document.createElement("style");t.textContent=C,e instanceof Document?e.head.prepend(t):e.prepend(t);}else e.adoptedStyleSheets=[E,...e.adoptedStyleSheets];}function K(){window.ToggleEvent=window.ToggleEvent||c;function e(n){return n?.includes(":popover-open")&&(n=n.replace(J,"$1.\\:popover-open")),n}f(Document.prototype,"querySelector",e),f(Document.prototype,"querySelectorAll",e),f(Element.prototype,"querySelector",e),f(Element.prototype,"querySelectorAll",e),f(Element.prototype,"matches",e),f(Element.prototype,"closest",e),f(DocumentFragment.prototype,"querySelectorAll",e),f(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let n=(this.getAttribute("popover")||"").toLowerCase();return n===""||n=="auto"?"auto":"manual"},set(n){this.setAttribute("popover",n);}},showPopover:{enumerable:!0,configurable:!0,value(){S(this);}},hidePopover:{enumerable:!0,configurable:!0,value(){m(this,!0,!0);}},togglePopover:{enumerable:!0,configurable:!0,value(n){h.get(this)==="showing"&&n===void 0||n===!1?m(this,!0,!0):(n===void 0||n===!0)&&S(this);}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(n){let s=t.call(this,n);return I(s),s}}});let o=HTMLElement.prototype.attachInternals;o&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let n=o.call(this);return n.shadowRoot&&I(n.shadowRoot),n}}});let r=new WeakMap;function i(n){Object.defineProperties(n.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(s){if(s===null)this.removeAttribute("popovertarget"),r.delete(this);else if(s instanceof Element)this.setAttribute("popovertarget",""),r.set(this,s);else throw new TypeError("popoverTargetElement must be an element or null")},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let s=r.get(this);if(s&&s.isConnected)return s;if(s&&!s.isConnected)return r.delete(this),null;let u=v(this),w=this.getAttribute("popovertarget");return (u instanceof Document||u instanceof B)&&w&&u.getElementById(w)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let s=(this.getAttribute("popovertargetaction")||"").toLowerCase();return s==="show"||s==="hide"?s:"toggle"},set(s){this.setAttribute("popovertargetaction",s);}}});}i(HTMLButtonElement),i(HTMLInputElement);let l=n=>{if(!n.isTrusted)return;let s=n.composedPath()[0];if(!(s instanceof Element)||s?.shadowRoot)return;let u=v(s);if(!(u instanceof B||u instanceof Document))return;let w=s.closest("[popovertargetaction],[popovertarget]");if(w){O(w),n.preventDefault();return}},a=n=>{let s=n.key,u=n.target;!n.defaultPrevented&&u&&(s==="Escape"||s==="Esc")&&T(u.ownerDocument,!0,!0);};(n=>{n.addEventListener("click",l),n.addEventListener("keydown",a),n.addEventListener("pointerdown",x),n.addEventListener("pointerup",x);})(document),I(document);}j()||K();})();
3113
3549
 
3114
- const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:.5px 3px 4px rgba(0,0,0,.1),2px 4px 10px 4px rgba(0,0,0,.12);background:var(--post-current-palette-bg);color:var(--post-current-palette-fg);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
3550
+ const postPopovercontainerCss = "@layer polyfill{@supports not selector(:popover-open){[popover]:not(.\\:popover-open){display:none}}}:where(post-popovercontainer){box-shadow:var(--post-device-elevation-300);background:var(--post-current-palette-bg);color:var(--post-current-palette-fg);position:fixed;z-index:1060;width:max-content;margin:0;padding:0;box-sizing:border-box;border:2px solid rgba(0,0,0,0);border-radius:4px;overflow:visible}:where(post-popovercontainer)[tooltip]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}:where(post-popovercontainer):not(:has(.arrow)){box-shadow:var(--post-device-elevation-300)}:where(post-popovercontainer):has(.arrow){filter:drop-shadow(1px 2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(2px 4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(4px 8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.top){filter:drop-shadow(0px -2px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(0px -4px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(0px -8px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.left){filter:drop-shadow(-2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(-4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(-8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer):has(.arrow.right){filter:drop-shadow(2px 0px 3px hsla(216, 9%, 11%, 0.15)) drop-shadow(4px 0px 6px hsla(225, 17%, 9%, 0.15)) drop-shadow(8px 0px 12px hsla(225, 7%, 11%, 0.15))}:where(post-popovercontainer) .arrow{position:absolute;width:.5825rem;height:.5825rem;background-color:inherit;rotate:45deg;pointer-events:none;z-index:-1}:where(post-popovercontainer) .arrow.top{border-left:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.right{border-right:2px solid rgba(0,0,0,0);border-top:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.left{border-left:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}:where(post-popovercontainer) .arrow.bottom{border-right:2px solid rgba(0,0,0,0);border-bottom:2px solid rgba(0,0,0,0)}";
3115
3551
  const PostPopovercontainerStyle0 = postPopovercontainerCss;
3116
3552
 
3117
3553
  const SIDE_MAP = {
@@ -3124,12 +3560,35 @@ const PostPopovercontainer = class {
3124
3560
  constructor(hostRef) {
3125
3561
  registerInstance(this, hostRef);
3126
3562
  this.postToggle = createEvent(this, "postToggle", 7);
3127
- this.placement = 'top';
3128
- this.edgeGap = 8;
3129
- this.arrow = false;
3130
3563
  }
3564
+ get host() { return getElement(this); }
3565
+ arrowRef;
3566
+ eventTarget;
3567
+ clearAutoUpdate;
3568
+ toggleTimeoutId;
3569
+ /**
3570
+ * Fires whenever the popover gets shown or hidden, passing the new state in event.details as a boolean
3571
+ */
3572
+ postToggle;
3573
+ /**
3574
+ * Whether or not the popover should close when user clicks outside of it
3575
+ */
3576
+ manualClose = false;
3577
+ /**
3578
+ * Defines the placement of the tooltip according to the floating-ui options available at https://floating-ui.com/docs/computePosition#placement.
3579
+ * Tooltips are automatically flipped to the opposite side if there is not enough available space and are shifted
3580
+ * towards the viewport if they would overlap edge boundaries.
3581
+ */
3582
+ placement = 'top';
3583
+ /**
3584
+ * Gap between the edge of the page and the popover
3585
+ */
3586
+ edgeGap = 8;
3587
+ /**
3588
+ * Wheter or not to display a little pointer arrow
3589
+ */
3590
+ arrow = false;
3131
3591
  componentDidLoad() {
3132
- this.host.setAttribute('popover', '');
3133
3592
  this.host.addEventListener('beforetoggle', this.handleToggle.bind(this));
3134
3593
  }
3135
3594
  disconnectedCallback() {
@@ -3247,11 +3706,10 @@ const PostPopovercontainer = class {
3247
3706
  }
3248
3707
  }
3249
3708
  render() {
3250
- return (h(Host, { key: '844302edb3852f99229d4f4ccacf82cd78588435', "data-version": version }, this.arrow && (h("span", { key: 'ae293d24ef24282bfcaeb7f545653a563e5246d5', class: "arrow", ref: el => {
3709
+ return (h(Host, { key: '6bebf9ab3013796d0eebb3d543411a0e80d2e913', "data-version": version, popover: this.manualClose ? 'manual' : 'auto' }, this.arrow && (h("span", { key: 'd6eca10452a54073a293128e8faf76e45e35c4c5', class: "arrow", ref: el => {
3251
3710
  this.arrowRef = el;
3252
- } })), h("slot", { key: '61dd3072a5217099028e3dd4b22fa845ea2f5970' })));
3711
+ } })), h("slot", { key: '3b6674dfa1b3ffac10c6640717c7ae713577c965' })));
3253
3712
  }
3254
- get host() { return getElement(this); }
3255
3713
  };
3256
3714
  PostPopovercontainer.style = PostPopovercontainerStyle0;
3257
3715
 
@@ -3261,18 +3719,12 @@ const PostTogglebuttonStyle0 = postTogglebuttonCss;
3261
3719
  const PostTogglebutton = class {
3262
3720
  constructor(hostRef) {
3263
3721
  registerInstance(this, hostRef);
3264
- this.handleClick = () => {
3265
- this.toggled = !this.toggled;
3266
- };
3267
- this.handleKeydown = (event) => {
3268
- // perform a click when enter or spaced are pressed to mimic the button behavior
3269
- if (event.key === 'Enter' || event.key === ' ') {
3270
- event.preventDefault(); // prevents the page from scrolling when space is pressed
3271
- this.host.click();
3272
- }
3273
- };
3274
- this.toggled = false;
3275
3722
  }
3723
+ get host() { return getElement(this); }
3724
+ /**
3725
+ * If `true`, the button is in the "on" state, otherwise it is in the "off" state.
3726
+ */
3727
+ toggled = false;
3276
3728
  validateToggled(value = this.toggled) {
3277
3729
  checkType(value, 'boolean', 'The "toggled" property of the post-togglebutton must be a boolean.');
3278
3730
  }
@@ -3282,10 +3734,19 @@ const PostTogglebutton = class {
3282
3734
  this.host.addEventListener('click', () => this.handleClick());
3283
3735
  this.host.addEventListener('keydown', (e) => this.handleKeydown(e));
3284
3736
  }
3737
+ handleClick = () => {
3738
+ this.toggled = !this.toggled;
3739
+ };
3740
+ handleKeydown = (event) => {
3741
+ // perform a click when enter or spaced are pressed to mimic the button behavior
3742
+ if (event.key === 'Enter' || event.key === ' ') {
3743
+ event.preventDefault(); // prevents the page from scrolling when space is pressed
3744
+ this.host.click();
3745
+ }
3746
+ };
3285
3747
  render() {
3286
- return (h(Host, { key: '461f72ebada75a99921b7a166f67f2547aa6465e', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'cd5f4cc4df687cceacb3ea6c125b7b62f01b2712' })));
3748
+ return (h(Host, { key: 'e4974336def6dbf244b3d63b9aa00e2e7bce1920', "data-version": version, role: "button", tabindex: "0", "aria-pressed": this.toggled.toString() }, h("slot", { key: 'b1179664b0f0651865e973c7afe951102b048877' })));
3287
3749
  }
3288
- get host() { return getElement(this); }
3289
3750
  static get watchers() { return {
3290
3751
  "toggled": ["validateToggled"]
3291
3752
  }; }