@swisspost/design-system-components 10.8.0 → 10.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{package-DAEQGHsE.js → package-kgRYEtTJ.js} +1 -1
  4. package/dist/cjs/post-accordion_2.cjs.entry.js +1 -1
  5. package/dist/cjs/post-autocomplete.cjs.entry.js +1 -1
  6. package/dist/cjs/post-avatar.cjs.entry.js +1 -1
  7. package/dist/cjs/post-back-to-top.cjs.entry.js +1 -1
  8. package/dist/cjs/post-banner.cjs.entry.js +1 -1
  9. package/dist/cjs/post-breadcrumb-item.cjs.entry.js +1 -1
  10. package/dist/cjs/post-breadcrumbs.cjs.entry.js +1 -1
  11. package/dist/cjs/post-closebutton_14.cjs.entry.js +83 -23
  12. package/dist/cjs/post-collapsible_2.cjs.entry.js +1 -1
  13. package/dist/cjs/post-components.cjs.js +1 -1
  14. package/dist/cjs/post-date-picker.cjs.entry.js +6 -5
  15. package/dist/cjs/post-footer.cjs.entry.js +2 -2
  16. package/dist/cjs/post-linkarea.cjs.entry.js +2 -2
  17. package/dist/cjs/post-listbox-option.cjs.entry.js +3 -3
  18. package/dist/cjs/post-listbox.cjs.entry.js +3 -3
  19. package/dist/cjs/post-number-input.cjs.entry.js +3 -3
  20. package/dist/cjs/post-pagination.cjs.entry.js +1 -1
  21. package/dist/cjs/post-popover-trigger.cjs.entry.js +2 -2
  22. package/dist/cjs/post-popover.cjs.entry.js +3 -3
  23. package/dist/cjs/post-progressbar.cjs.entry.js +1 -1
  24. package/dist/cjs/post-rating.cjs.entry.js +2 -2
  25. package/dist/cjs/post-side-navigation-trigger.cjs.entry.js +2 -2
  26. package/dist/cjs/post-side-navigation.cjs.entry.js +2 -2
  27. package/dist/cjs/post-stepper-item.cjs.entry.js +2 -2
  28. package/dist/cjs/post-stepper.cjs.entry.js +2 -2
  29. package/dist/cjs/post-tab-item.cjs.entry.js +2 -2
  30. package/dist/cjs/post-tab-panel.cjs.entry.js +2 -2
  31. package/dist/cjs/post-tabs.cjs.entry.js +32 -4
  32. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +2 -2
  33. package/dist/cjs/post-tooltip.cjs.entry.js +2 -2
  34. package/dist/collection/components/post-date-picker/post-date-picker.css +1 -1
  35. package/dist/collection/components/post-date-picker/post-date-picker.js +4 -3
  36. package/dist/collection/components/post-footer/post-footer.css +1 -1
  37. package/dist/collection/components/post-header/post-header.css +1 -1
  38. package/dist/collection/components/post-header/post-header.js +71 -8
  39. package/dist/collection/components/post-icon/post-icon.css +1 -1
  40. package/dist/collection/components/post-icon/post-icon.js +1 -2
  41. package/dist/collection/components/post-language-menu/post-language-menu.js +1 -1
  42. package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
  43. package/dist/collection/components/post-listbox/post-listbox.css +1 -1
  44. package/dist/collection/components/post-listbox/post-listbox.js +1 -1
  45. package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
  46. package/dist/collection/components/post-logo/post-logo.js +1 -1
  47. package/dist/collection/components/post-mainnavigation/post-mainnavigation.css +1 -1
  48. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  49. package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
  50. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
  51. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  52. package/dist/collection/components/post-menu/post-menu.js +2 -2
  53. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
  54. package/dist/collection/components/post-number-input/post-number-input.js +2 -2
  55. package/dist/collection/components/post-popover/post-popover.js +2 -2
  56. package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
  57. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +1 -1
  58. package/dist/collection/components/post-progressbar/post-progressbar.js +1 -1
  59. package/dist/collection/components/post-rating/post-rating.js +1 -1
  60. package/dist/collection/components/post-side-navigation/post-side-navigation.js +1 -1
  61. package/dist/collection/components/post-side-navigation-trigger/post-side-navigation-trigger.js +1 -1
  62. package/dist/collection/components/post-stepper/post-stepper.js +1 -1
  63. package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
  64. package/dist/collection/components/post-tab-item/post-tab-item.js +2 -2
  65. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  66. package/dist/collection/components/post-tabs/post-tabs.js +31 -3
  67. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  68. package/dist/collection/components/post-tooltip/post-tooltip.js +1 -1
  69. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
  70. package/dist/collection/test-setup.js +28 -0
  71. package/dist/components/package.js +1 -1
  72. package/dist/components/post-date-picker.js +1 -1
  73. package/dist/components/post-footer.js +1 -1
  74. package/dist/components/post-header.js +1 -1
  75. package/dist/components/post-icon2.js +1 -1
  76. package/dist/components/post-linkarea.js +1 -1
  77. package/dist/components/post-listbox-option.js +1 -1
  78. package/dist/components/post-listbox.js +1 -1
  79. package/dist/components/post-logo.js +1 -1
  80. package/dist/components/post-mainnavigation.js +1 -1
  81. package/dist/components/post-megadropdown-trigger.js +1 -1
  82. package/dist/components/post-megadropdown.js +1 -1
  83. package/dist/components/post-menu-trigger2.js +1 -1
  84. package/dist/components/post-menu2.js +1 -1
  85. package/dist/components/post-number-input.js +1 -1
  86. package/dist/components/post-popover-trigger.js +1 -1
  87. package/dist/components/post-popover.js +1 -1
  88. package/dist/components/post-popovercontainer2.js +1 -1
  89. package/dist/components/post-progressbar.js +1 -1
  90. package/dist/components/post-rating.js +1 -1
  91. package/dist/components/post-side-navigation-trigger.js +1 -1
  92. package/dist/components/post-side-navigation.js +1 -1
  93. package/dist/components/post-stepper-item.js +1 -1
  94. package/dist/components/post-stepper.js +1 -1
  95. package/dist/components/post-tab-item.js +1 -1
  96. package/dist/components/post-tab-panel.js +1 -1
  97. package/dist/components/post-tabs.js +1 -1
  98. package/dist/components/post-togglebutton2.js +1 -1
  99. package/dist/components/post-tooltip-trigger.js +1 -1
  100. package/dist/components/post-tooltip.js +1 -1
  101. package/dist/components/react/p-CAL337jJ.js +1 -0
  102. package/dist/components/react/{p-Q5LQWL2X.js → p-CBVthgj-.js} +1 -1
  103. package/dist/components/react/{p-C8i672qm.js → p-CLkb55ud.js} +1 -1
  104. package/dist/components/react/{p-UXyZDQt4.js → p-CYBXVnUJ.js} +1 -1
  105. package/dist/components/react/{p-DRJ9K8sv.js → p-Ci-TsJYj.js} +1 -1
  106. package/dist/components/react/{p-DzYMQFK2.js → p-CtgMQs_Q.js} +1 -1
  107. package/dist/components/react/{p-BMCit4BU.js → p-D4LBzsbB.js} +1 -1
  108. package/dist/components/react/{p-5kW0ZF_f.js → p-D5lqOfVk.js} +1 -1
  109. package/dist/components/react/p-DGpWjdFJ.js +1 -0
  110. package/dist/components/react/{p-C_JY6ipN.js → p-DSk0Nq8U.js} +1 -1
  111. package/dist/components/react/{p-DygUkCKz.js → p-Db3d6dKF.js} +1 -1
  112. package/dist/components/react/{p-BeRGbt65.js → p-DkDIUTRi.js} +1 -1
  113. package/dist/components/react/post-accordion-item.js +1 -1
  114. package/dist/components/react/post-accordion.js +1 -1
  115. package/dist/components/react/post-autocomplete.js +1 -1
  116. package/dist/components/react/post-avatar.js +1 -1
  117. package/dist/components/react/post-back-to-top.js +1 -1
  118. package/dist/components/react/post-banner.js +1 -1
  119. package/dist/components/react/post-breadcrumb-item.js +1 -1
  120. package/dist/components/react/post-breadcrumbs.js +1 -1
  121. package/dist/components/react/post-closebutton.js +1 -1
  122. package/dist/components/react/post-collapsible-trigger.js +1 -1
  123. package/dist/components/react/post-collapsible.js +1 -1
  124. package/dist/components/react/post-date-picker.js +1 -1
  125. package/dist/components/react/post-footer.js +1 -1
  126. package/dist/components/react/post-header.js +1 -1
  127. package/dist/components/react/post-icon.js +1 -1
  128. package/dist/components/react/post-language-menu-item.js +1 -1
  129. package/dist/components/react/post-language-menu.js +1 -1
  130. package/dist/components/react/post-linkarea.js +1 -1
  131. package/dist/components/react/post-listbox-option.js +1 -1
  132. package/dist/components/react/post-listbox.js +1 -1
  133. package/dist/components/react/post-logo.js +1 -1
  134. package/dist/components/react/post-mainnavigation.js +1 -1
  135. package/dist/components/react/post-megadropdown-trigger.js +1 -1
  136. package/dist/components/react/post-megadropdown.js +1 -1
  137. package/dist/components/react/post-menu-item.js +1 -1
  138. package/dist/components/react/post-menu-trigger.js +1 -1
  139. package/dist/components/react/post-menu.js +1 -1
  140. package/dist/components/react/post-number-input.js +1 -1
  141. package/dist/components/react/post-pagination.js +1 -1
  142. package/dist/components/react/post-popover-trigger.js +1 -1
  143. package/dist/components/react/post-popover.js +1 -1
  144. package/dist/components/react/post-popovercontainer.js +1 -1
  145. package/dist/components/react/post-progressbar.js +1 -1
  146. package/dist/components/react/post-rating.js +1 -1
  147. package/dist/components/react/post-side-navigation-trigger.js +1 -1
  148. package/dist/components/react/post-side-navigation.js +1 -1
  149. package/dist/components/react/post-stepper-item.js +1 -1
  150. package/dist/components/react/post-stepper.js +1 -1
  151. package/dist/components/react/post-tab-item.js +1 -1
  152. package/dist/components/react/post-tab-panel.js +1 -1
  153. package/dist/components/react/post-tabs.js +1 -1
  154. package/dist/components/react/post-togglebutton.js +1 -1
  155. package/dist/components/react/post-tooltip-trigger.js +1 -1
  156. package/dist/components/react/post-tooltip.js +1 -1
  157. package/dist/docs.json +1 -1
  158. package/dist/esm/loader.js +1 -1
  159. package/dist/esm/{package-BdiQsTQm.js → package-CAL337jJ.js} +1 -1
  160. package/dist/esm/post-accordion_2.entry.js +1 -1
  161. package/dist/esm/post-autocomplete.entry.js +1 -1
  162. package/dist/esm/post-avatar.entry.js +1 -1
  163. package/dist/esm/post-back-to-top.entry.js +1 -1
  164. package/dist/esm/post-banner.entry.js +1 -1
  165. package/dist/esm/post-breadcrumb-item.entry.js +1 -1
  166. package/dist/esm/post-breadcrumbs.entry.js +1 -1
  167. package/dist/esm/post-closebutton_14.entry.js +83 -23
  168. package/dist/esm/post-collapsible_2.entry.js +1 -1
  169. package/dist/esm/post-components.js +1 -1
  170. package/dist/esm/post-date-picker.entry.js +6 -5
  171. package/dist/esm/post-footer.entry.js +2 -2
  172. package/dist/esm/post-linkarea.entry.js +2 -2
  173. package/dist/esm/post-listbox-option.entry.js +3 -3
  174. package/dist/esm/post-listbox.entry.js +3 -3
  175. package/dist/esm/post-number-input.entry.js +3 -3
  176. package/dist/esm/post-pagination.entry.js +1 -1
  177. package/dist/esm/post-popover-trigger.entry.js +2 -2
  178. package/dist/esm/post-popover.entry.js +3 -3
  179. package/dist/esm/post-progressbar.entry.js +1 -1
  180. package/dist/esm/post-rating.entry.js +2 -2
  181. package/dist/esm/post-side-navigation-trigger.entry.js +2 -2
  182. package/dist/esm/post-side-navigation.entry.js +2 -2
  183. package/dist/esm/post-stepper-item.entry.js +2 -2
  184. package/dist/esm/post-stepper.entry.js +2 -2
  185. package/dist/esm/post-tab-item.entry.js +2 -2
  186. package/dist/esm/post-tab-panel.entry.js +2 -2
  187. package/dist/esm/post-tabs.entry.js +32 -4
  188. package/dist/esm/post-tooltip-trigger.entry.js +2 -2
  189. package/dist/esm/post-tooltip.entry.js +2 -2
  190. package/dist/post-components/{p-ab0500b7.entry.js → p-077be898.entry.js} +1 -1
  191. package/dist/post-components/{p-3712133b.entry.js → p-184bd61c.entry.js} +1 -1
  192. package/dist/post-components/p-1933e4fa.entry.js +1 -0
  193. package/dist/post-components/{p-c123ecde.entry.js → p-21e6f82a.entry.js} +1 -1
  194. package/dist/post-components/{p-534ca27e.entry.js → p-2220db4c.entry.js} +1 -1
  195. package/dist/post-components/{p-dffeb751.entry.js → p-2aff3873.entry.js} +1 -1
  196. package/dist/post-components/{p-6ad44691.entry.js → p-2b475cd7.entry.js} +1 -1
  197. package/dist/post-components/p-33a898ec.entry.js +1 -0
  198. package/dist/post-components/{p-0688d296.entry.js → p-405c1fff.entry.js} +1 -1
  199. package/dist/post-components/{p-379780a3.entry.js → p-5efaca25.entry.js} +1 -1
  200. package/dist/post-components/{p-6833be12.entry.js → p-6a9661d9.entry.js} +1 -1
  201. package/dist/post-components/{p-2a5312a7.entry.js → p-7dd192b3.entry.js} +1 -1
  202. package/dist/post-components/{p-0b0b2f02.entry.js → p-8e5052d5.entry.js} +1 -1
  203. package/dist/post-components/{p-9fedcfba.entry.js → p-9440738d.entry.js} +1 -1
  204. package/dist/post-components/{p-0d25c033.entry.js → p-965a02fb.entry.js} +1 -1
  205. package/dist/post-components/{p-d2de31b7.entry.js → p-9740719e.entry.js} +1 -1
  206. package/dist/post-components/{p-5369b9c2.entry.js → p-9af8f5af.entry.js} +1 -1
  207. package/dist/post-components/p-CAL337jJ.js +1 -0
  208. package/dist/post-components/p-a6971c1c.entry.js +1 -0
  209. package/dist/post-components/p-a7d8f328.entry.js +1 -0
  210. package/dist/post-components/{p-e11ccdbe.entry.js → p-bb9a0e1e.entry.js} +1 -1
  211. package/dist/post-components/{p-82c62e90.entry.js → p-bf8c7dca.entry.js} +1 -1
  212. package/dist/post-components/p-c3351def.entry.js +1 -0
  213. package/dist/post-components/{p-e560767b.entry.js → p-c87f33f0.entry.js} +1 -1
  214. package/dist/post-components/{p-456b0786.entry.js → p-e30b534d.entry.js} +1 -1
  215. package/dist/post-components/{p-330fd6cd.entry.js → p-e73eabac.entry.js} +1 -1
  216. package/dist/post-components/{p-f2629077.entry.js → p-e84fe883.entry.js} +1 -1
  217. package/dist/post-components/{p-229d324e.entry.js → p-eaa28736.entry.js} +1 -1
  218. package/dist/post-components/{p-91a2ef3c.entry.js → p-f2cb8ed1.entry.js} +1 -1
  219. package/dist/post-components/{p-f2b24bbd.entry.js → p-ffbf2375.entry.js} +1 -1
  220. package/dist/post-components/post-components.esm.js +1 -1
  221. package/dist/types/components/post-header/post-header.d.ts +12 -0
  222. package/dist/types/components/post-tabs/post-tabs.d.ts +4 -0
  223. package/hydrate/index.js +140 -50
  224. package/hydrate/index.mjs +140 -50
  225. package/package.json +21 -21
  226. package/dist/components/react/p-BdiQsTQm.js +0 -1
  227. package/dist/components/react/p-E-8qAn1z.js +0 -1
  228. package/dist/post-components/p-3fdb8ebc.entry.js +0 -1
  229. package/dist/post-components/p-4d30c65d.entry.js +0 -1
  230. package/dist/post-components/p-95f5d5ea.entry.js +0 -1
  231. package/dist/post-components/p-9dd286bf.entry.js +0 -1
  232. package/dist/post-components/p-BdiQsTQm.js +0 -1
  233. package/dist/post-components/p-ee7fade4.entry.js +0 -1
@@ -1 +1 @@
1
- import{proxyCustomElement as o,HTMLElement as e,h as t,Host as a,transformTag as s}from"@stencil/core/internal/client";import{b as i}from"./breakpoints.js";import{v as r}from"./package.js";import{d as n}from"./post-accordion2.js";import{d}from"./post-accordion-item2.js";import{d as c}from"./post-collapsible2.js";import{d as p}from"./post-collapsible-trigger2.js";import{d as l}from"./post-icon2.js";import{R as f}from"./required.js";import{T as b}from"./type.js";const m=["grid-1","grid-2","grid-3","grid-4"],g=["prefooter","socialmedia","app","businesssectors","meta","copyright"],h=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.device=i.get("device"),this.slotDisplayed={},this.breakpointChange=o=>{this.device=o.detail},this.handleGridSlotChange=this.handleGridSlotChange.bind(this),this.handleSlotChange=this.handleSlotChange.bind(this)}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange)}componentWillLoad(){[...m,...g].forEach((o=>{const e=this.host.querySelectorAll(`[slot="${o}"]`);this.updateSlotDisplay(o,e.length>0)}))}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange)}handleGridSlotChange(...o){return e=>{o.includes(this.device)&&e.target instanceof HTMLSlotElement&&this.updateSlotDisplay(e.target.name,e.target.assignedElements().length>0)}}handleSlotChange(o){o.target instanceof HTMLSlotElement&&this.updateSlotDisplay(o.target.name,o.target.assignedElements().length>0)}updateSlotDisplay(o,e){this.slotDisplayed[o]!==e&&(this.slotDisplayed={...this.slotDisplayed,[o]:e})}renderAccordion(){return t("post-accordion",{headingLevel:3,multiple:!0},m.map((o=>t("post-accordion-item",{key:o,class:{"d-none":!this.slotDisplayed[o]},collapsed:!0},t("span",{slot:"header"},t("slot",{name:o+"-title"})),t("slot",{onSlotchange:this.handleGridSlotChange("mobile"),name:o})))))}renderColumns(){return m.map((o=>t("div",{key:o,class:{"d-none":!this.slotDisplayed[o]}},t("h3",null,t("slot",{name:o+"-title"})),t("slot",{onSlotchange:this.handleGridSlotChange("tablet","desktop"),name:o}))))}render(){const o=this.slotDisplayed.prefooter,e=this.slotDisplayed.socialmedia,s=this.slotDisplayed.app,i=this.slotDisplayed.businesssectors,n=this.slotDisplayed.meta,d=this.slotDisplayed.copyright,c=m.every((o=>!this.slotDisplayed[o])),p=!c||e||s||i,l=d||n;return t(a,{key:"08a1ce26926dace6b5b58df118007107c971221e","data-version":r,"data-color-scheme":"light"},t("footer",{key:"bcc5101df4f8e203fdba9075e34b7aa125eb53ce"},t("h2",{key:"a8efa01756ea699f5f66346e3cfe05cc56f36264",class:"visually-hidden"},this.textFooter),t("div",{key:"1b8e30a01c3f0a711f0351b36d396f90511154c4",class:{prefooter:!0,"d-none":!o}},t("div",{key:"2c900ed450bc1dc5ad655d35f5f50b1b5a268fec",class:"footer-container"},t("slot",{key:"8ab8cef6c639251543c65ed21a1f14adf043029e",onSlotchange:this.handleSlotChange,name:"prefooter"}))),t("div",{key:"e3f3bedd9725968fbce6e887e22842a7e8e5ffa5",class:{"footer-main":!0,"d-none":!p}},t("div",{key:"76cec7363e3771da636a6c0a32afbf16d5c4d405",class:"footer-container"},t("div",{key:"4e9ea3788103175b48839b6bf815d4c675769c97",class:{"footer-grid":!0,"d-none":c}},"mobile"===this.device?this.renderAccordion():this.renderColumns()),t("div",{key:"64d10c9fb543290e078f7fff098b401926b3bf4b",class:{"footer-column":!0,"d-none":!e&&!s}},t("div",{key:"05b566b43e2c4fed2919e3312a718ea392cad0f7",class:{"footer-socialmedia":!0,"d-none":!e}},t("slot",{key:"a46f739c9d4b6cbf96988f96f89d7cc093797b40",onSlotchange:this.handleSlotChange,name:"socialmedia"})),t("div",{key:"f28490dfaa982a609ba1eb393339980a358488e5",class:{"footer-app":!0,"d-none":!s}},t("slot",{key:"01c10bf12eb2f39a0dbceec320b476041d46c631",onSlotchange:this.handleSlotChange,name:"app"}))),t("div",{key:"609935b6b6ee48176d7e44919726abdaff8e6161",class:{"footer-businesssectors":!0,"d-none":!i}},t("slot",{key:"9f153ba54a08d48e55644fe58089ed7122c1cfdd",onSlotchange:this.handleSlotChange,name:"businesssectors"})))),t("div",{key:"03fd76b711b9d9f1f912ac7a4199ee2706bd3a9a",class:{"footer-base":!0,"d-none":!l}},t("div",{key:"3eb810a55e3193295f8b9291bd824af77a5a2fac",class:"footer-container"},t("div",{key:"04c38d8d5e483b9f9cc8acca1cc8224e381651f1",class:{"footer-copyright":!0,"d-none":!d}},t("slot",{key:"fdd11e63af64161288533c21ea455f3513ac7d87",onSlotchange:this.handleSlotChange,name:"copyright"})),t("div",{key:"adffa17e5f3b94af32e489d113afd9908e2b7abf",class:{"footer-meta":!0,"d-none":!n}},t("slot",{key:"7ebaf69055332d184b86a58e57db1c214b5f08c6",onSlotchange:this.handleSlotChange,name:"meta"}))))))}get host(){return this}static get style(){return":host{display:block}footer{--post-footer-container-padding-inline:16px;--post-footer-container-max-width:1200px;--post-footer-prefooter-padding-block:16px;--post-footer-grid-template:auto / auto;--post-footer-grid-padding-block:32px;--post-footer-column-flex-direction:column;--post-footer-column-align-items:start;--post-footer-column-gap:0;--post-footer-list-flex-direction:column;--post-footer-list-gap:8px;--post-footer-list-align-items:start;--post-footer-socialmedia-padding-block:16px;--post-footer-app-padding-block:var(--post-footer-socialmedia-padding-block);--post-footer-businesssectors-padding-block:var(--post-footer-socialmedia-padding-block);--post-footer-base-padding-block:var(--post-footer-socialmedia-padding-block);--post-footer-base-gap:8px;--post-footer-meta-font-size:inherit;--post-footer-copyright-font-size:var(--post-footer-meta-font-size)}@media screen and (min-width: 600px){footer{--post-footer-prefooter-padding-block:32px;--post-footer-grid-template:repeat(2, auto) / repeat(2, auto);--post-footer-list-flex-direction:row;--post-footer-list-gap:16px;--post-footer-list-align-items:center;--post-footer-base-gap:4px}}@media screen and (min-width: 780px){footer{--post-footer-container-padding-inline:40px;--post-footer-grid-padding-block:48px;--post-footer-socialmedia-padding-block:24px}}@media screen and (min-width: 1024px){footer{--post-footer-grid-template:auto / repeat(4, auto);--post-footer-column-flex-direction:row;--post-footer-column-align-items:center;--post-footer-column-gap:32px;--post-footer-list-gap:24px;--post-footer-meta-font-size:16px}}:is(h3,.h3){margin:0;font-size:var(--post-device-font-size-6);line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black);text-wrap:balance}::slotted(ul){list-style:none;padding:0;margin:0}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.footer-container{box-sizing:content-box;margin:0 auto;padding-inline:var(--post-footer-container-padding-inline);max-width:var(--post-footer-container-max-width)}.prefooter{background-color:#fafafa;border-block-start:1px solid #373632;padding-block:var(--post-footer-prefooter-padding-block)}.prefooter .footer-container{padding-block:0}.footer-main{background-color:#fc0;border-block-start:1px solid #373632}.prefooter:not(.d-none)+.footer-main{border-block-start:unset}.footer-grid{display:grid;grid-template:var(--post-footer-grid-template);gap:32px 24px;padding-block:var(--post-footer-grid-padding-block)}.footer-grid ::part(button),.footer-grid ::part(body){padding-inline:0}.footer-column{display:flex;flex-direction:var(--post-footer-column-flex-direction);flex-wrap:wrap;justify-content:space-between;align-items:var(--post-footer-column-align-items);column-gap:var(--post-footer-column-gap)}.footer-socialmedia ::slotted(div),.footer-app ::slotted(div),.footer-meta ::slotted(div){display:flex !important;flex-direction:var(--post-footer-list-flex-direction) !important;gap:var(--post-footer-list-gap) !important;align-items:var(--post-footer-list-align-items) !important}.footer-socialmedia{padding-block:var(--post-footer-socialmedia-padding-block)}.footer-app{padding-block:var(--post-footer-app-padding-block)}.prefooter ::slotted(div),.footer-businesssectors ::slotted(div){display:flex;flex-wrap:wrap;align-items:center;gap:var(--post-footer-list-gap) !important}.footer-businesssectors{padding-block:var(--post-footer-businesssectors-padding-block)}.footer-base{background-color:#fc0;border-block-start:1px solid #373632;padding-block-start:var(--post-footer-base-padding-block);padding-block-end:max(var(--post-footer-base-padding-block), env(safe-area-inset-bottom, 0px));gap:var(--post-footer-base-gap)}.footer-meta{font-size:var(--post-footer-meta-font-size)}.footer-copyright{display:flex;flex-wrap:wrap;column-gap:8px;font-size:var(--post-footer-copyright-font-size)}.d-none{display:none}"}},[257,"post-footer",{textFooter:[513,"text-footer"],device:[32],slotDisplayed:[32]}]);!function(o,e,t,a){var s,i=arguments.length,r=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(o,e,t,a);else for(var n=o.length-1;n>=0;n--)(s=o[n])&&(r=(i<3?s(r):i>3?s(e,t,r):s(e,t))||r);i>3&&r&&Object.defineProperty(e,t,r)}([f(),b("string")],h.prototype,"textFooter",void 0);const k=h,u=function(){"undefined"!=typeof customElements&&["post-footer","post-accordion","post-accordion-item","post-collapsible","post-collapsible-trigger","post-icon"].forEach((o=>{switch(o){case"post-footer":customElements.get(s(o))||customElements.define(s(o),h);break;case"post-accordion":customElements.get(s(o))||n();break;case"post-accordion-item":customElements.get(s(o))||d();break;case"post-collapsible":customElements.get(s(o))||c();break;case"post-collapsible-trigger":customElements.get(s(o))||p();break;case"post-icon":customElements.get(s(o))||l()}}))};export{k as PostFooter,u as defineCustomElement}
1
+ import{proxyCustomElement as o,HTMLElement as e,h as t,Host as a,transformTag as s}from"@stencil/core/internal/client";import{b as i}from"./breakpoints.js";import{v as r}from"./package.js";import{d as n}from"./post-accordion2.js";import{d}from"./post-accordion-item2.js";import{d as c}from"./post-collapsible2.js";import{d as p}from"./post-collapsible-trigger2.js";import{d as l}from"./post-icon2.js";import{R as f}from"./required.js";import{T as b}from"./type.js";const m=["grid-1","grid-2","grid-3","grid-4"],g=["prefooter","socialmedia","app","businesssectors","meta","copyright"],h=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.device=i.get("device"),this.slotDisplayed={},this.breakpointChange=o=>{this.device=o.detail},this.handleGridSlotChange=this.handleGridSlotChange.bind(this),this.handleSlotChange=this.handleSlotChange.bind(this)}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange)}componentWillLoad(){[...m,...g].forEach((o=>{const e=this.host.querySelectorAll(`[slot="${o}"]`);this.updateSlotDisplay(o,e.length>0)}))}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange)}handleGridSlotChange(...o){return e=>{o.includes(this.device)&&e.target instanceof HTMLSlotElement&&this.updateSlotDisplay(e.target.name,e.target.assignedElements().length>0)}}handleSlotChange(o){o.target instanceof HTMLSlotElement&&this.updateSlotDisplay(o.target.name,o.target.assignedElements().length>0)}updateSlotDisplay(o,e){this.slotDisplayed[o]!==e&&(this.slotDisplayed={...this.slotDisplayed,[o]:e})}renderAccordion(){return t("post-accordion",{headingLevel:3,multiple:!0},m.map((o=>t("post-accordion-item",{key:o,class:{"d-none":!this.slotDisplayed[o]},collapsed:!0},t("span",{slot:"header"},t("slot",{name:o+"-title"})),t("slot",{onSlotchange:this.handleGridSlotChange("mobile"),name:o})))))}renderColumns(){return m.map((o=>t("div",{key:o,class:{"d-none":!this.slotDisplayed[o]}},t("h3",null,t("slot",{name:o+"-title"})),t("slot",{onSlotchange:this.handleGridSlotChange("tablet","desktop"),name:o}))))}render(){const o=this.slotDisplayed.prefooter,e=this.slotDisplayed.socialmedia,s=this.slotDisplayed.app,i=this.slotDisplayed.businesssectors,n=this.slotDisplayed.meta,d=this.slotDisplayed.copyright,c=m.every((o=>!this.slotDisplayed[o])),p=!c||e||s||i,l=d||n;return t(a,{key:"08a1ce26926dace6b5b58df118007107c971221e","data-version":r,"data-color-scheme":"light"},t("footer",{key:"bcc5101df4f8e203fdba9075e34b7aa125eb53ce"},t("h2",{key:"a8efa01756ea699f5f66346e3cfe05cc56f36264",class:"visually-hidden"},this.textFooter),t("div",{key:"1b8e30a01c3f0a711f0351b36d396f90511154c4",class:{prefooter:!0,"d-none":!o}},t("div",{key:"2c900ed450bc1dc5ad655d35f5f50b1b5a268fec",class:"footer-container"},t("slot",{key:"8ab8cef6c639251543c65ed21a1f14adf043029e",onSlotchange:this.handleSlotChange,name:"prefooter"}))),t("div",{key:"e3f3bedd9725968fbce6e887e22842a7e8e5ffa5",class:{"footer-main":!0,"d-none":!p}},t("div",{key:"76cec7363e3771da636a6c0a32afbf16d5c4d405",class:"footer-container"},t("div",{key:"4e9ea3788103175b48839b6bf815d4c675769c97",class:{"footer-grid":!0,"d-none":c}},"mobile"===this.device?this.renderAccordion():this.renderColumns()),t("div",{key:"64d10c9fb543290e078f7fff098b401926b3bf4b",class:{"footer-column":!0,"d-none":!e&&!s}},t("div",{key:"05b566b43e2c4fed2919e3312a718ea392cad0f7",class:{"footer-socialmedia":!0,"d-none":!e}},t("slot",{key:"a46f739c9d4b6cbf96988f96f89d7cc093797b40",onSlotchange:this.handleSlotChange,name:"socialmedia"})),t("div",{key:"f28490dfaa982a609ba1eb393339980a358488e5",class:{"footer-app":!0,"d-none":!s}},t("slot",{key:"01c10bf12eb2f39a0dbceec320b476041d46c631",onSlotchange:this.handleSlotChange,name:"app"}))),t("div",{key:"609935b6b6ee48176d7e44919726abdaff8e6161",class:{"footer-businesssectors":!0,"d-none":!i}},t("slot",{key:"9f153ba54a08d48e55644fe58089ed7122c1cfdd",onSlotchange:this.handleSlotChange,name:"businesssectors"})))),t("div",{key:"03fd76b711b9d9f1f912ac7a4199ee2706bd3a9a",class:{"footer-base":!0,"d-none":!l}},t("div",{key:"3eb810a55e3193295f8b9291bd824af77a5a2fac",class:"footer-container"},t("div",{key:"04c38d8d5e483b9f9cc8acca1cc8224e381651f1",class:{"footer-copyright":!0,"d-none":!d}},t("slot",{key:"fdd11e63af64161288533c21ea455f3513ac7d87",onSlotchange:this.handleSlotChange,name:"copyright"})),t("div",{key:"adffa17e5f3b94af32e489d113afd9908e2b7abf",class:{"footer-meta":!0,"d-none":!n}},t("slot",{key:"7ebaf69055332d184b86a58e57db1c214b5f08c6",onSlotchange:this.handleSlotChange,name:"meta"}))))))}get host(){return this}static get style(){return":host{position:sticky;top:100dvh;display:block}footer{--post-footer-container-padding-inline:16px;--post-footer-container-max-width:1200px;--post-footer-prefooter-padding-block:16px;--post-footer-grid-template:auto / auto;--post-footer-grid-padding-block:32px;--post-footer-column-flex-direction:column;--post-footer-column-align-items:start;--post-footer-column-gap:0;--post-footer-list-flex-direction:column;--post-footer-list-gap:8px;--post-footer-list-align-items:start;--post-footer-socialmedia-padding-block:16px;--post-footer-app-padding-block:var(--post-footer-socialmedia-padding-block);--post-footer-businesssectors-padding-block:var(--post-footer-socialmedia-padding-block);--post-footer-base-padding-block:var(--post-footer-socialmedia-padding-block);--post-footer-base-gap:8px;--post-footer-meta-font-size:inherit;--post-footer-copyright-font-size:var(--post-footer-meta-font-size)}@media screen and (min-width: 600px){footer{--post-footer-prefooter-padding-block:32px;--post-footer-grid-template:repeat(2, auto) / repeat(2, auto);--post-footer-list-flex-direction:row;--post-footer-list-gap:16px;--post-footer-list-align-items:center;--post-footer-base-gap:4px}}@media screen and (min-width: 780px){footer{--post-footer-container-padding-inline:40px;--post-footer-grid-padding-block:48px;--post-footer-socialmedia-padding-block:24px}}@media screen and (min-width: 1024px){footer{--post-footer-grid-template:auto / repeat(4, auto);--post-footer-column-flex-direction:row;--post-footer-column-align-items:center;--post-footer-column-gap:32px;--post-footer-list-gap:24px;--post-footer-meta-font-size:16px}}:is(h3,.h3){margin:0;font-size:var(--post-device-font-size-6);line-height:var(--post-device-line-height-heading);font-weight:var(--post-device-font-weight-extra-black);text-wrap:balance}::slotted(ul){list-style:none;padding:0;margin:0}.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.footer-container{box-sizing:content-box;margin:0 auto;padding-inline:var(--post-footer-container-padding-inline);max-width:var(--post-footer-container-max-width)}.prefooter{background-color:#fafafa;border-block-start:1px solid #373632;padding-block:var(--post-footer-prefooter-padding-block)}.prefooter .footer-container{padding-block:0}.footer-main{background-color:#fc0;border-block-start:1px solid #373632}.prefooter:not(.d-none)+.footer-main{border-block-start:unset}.footer-grid{display:grid;grid-template:var(--post-footer-grid-template);gap:32px 24px;padding-block:var(--post-footer-grid-padding-block)}.footer-grid ::part(button),.footer-grid ::part(body){padding-inline:0}.footer-column{display:flex;flex-direction:var(--post-footer-column-flex-direction);flex-wrap:wrap;justify-content:space-between;align-items:var(--post-footer-column-align-items);column-gap:var(--post-footer-column-gap)}.footer-socialmedia ::slotted(div),.footer-app ::slotted(div),.footer-meta ::slotted(div){display:flex !important;flex-direction:var(--post-footer-list-flex-direction) !important;gap:var(--post-footer-list-gap) !important;align-items:var(--post-footer-list-align-items) !important}.footer-socialmedia{padding-block:var(--post-footer-socialmedia-padding-block)}.footer-app{padding-block:var(--post-footer-app-padding-block)}.prefooter ::slotted(div),.footer-businesssectors ::slotted(div){display:flex;flex-wrap:wrap;align-items:center;gap:var(--post-footer-list-gap) !important}.footer-businesssectors{padding-block:var(--post-footer-businesssectors-padding-block)}.footer-base{background-color:#fc0;border-block-start:1px solid #373632;padding-block-start:var(--post-footer-base-padding-block);padding-block-end:max(var(--post-footer-base-padding-block), env(safe-area-inset-bottom, 0px));gap:var(--post-footer-base-gap)}.footer-meta{font-size:var(--post-footer-meta-font-size)}.footer-copyright{display:flex;flex-wrap:wrap;column-gap:8px;font-size:var(--post-footer-copyright-font-size)}.d-none{display:none}"}},[257,"post-footer",{textFooter:[513,"text-footer"],device:[32],slotDisplayed:[32]}]);!function(o,e,t,a){var s,i=arguments.length,r=i<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(o,e,t,a);else for(var n=o.length-1;n>=0;n--)(s=o[n])&&(r=(i<3?s(r):i>3?s(e,t,r):s(e,t))||r);i>3&&r&&Object.defineProperty(e,t,r)}([f(),b("string")],h.prototype,"textFooter",void 0);const k=h,u=function(){"undefined"!=typeof customElements&&["post-footer","post-accordion","post-accordion-item","post-collapsible","post-collapsible-trigger","post-icon"].forEach((o=>{switch(o){case"post-footer":customElements.get(s(o))||customElements.define(s(o),h);break;case"post-accordion":customElements.get(s(o))||n();break;case"post-accordion-item":customElements.get(s(o))||d();break;case"post-collapsible":customElements.get(s(o))||c();break;case"post-collapsible-trigger":customElements.get(s(o))||p();break;case"post-icon":customElements.get(s(o))||l()}}))};export{k as PostFooter,u as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,Build as o,h as a,Host as i,transformTag as s}from"@stencil/core/internal/client";import{f as r}from"./fade.js";import{b as n}from"./breakpoints.js";import{E as d}from"./event-from.js";import{a as l}from"./get-focusable-children.js";import{v as h}from"./package.js";import{t as c}from"./index2.js";import{d as p}from"./post-icon2.js";import{d as g}from"./post-togglebutton2.js";import{R as b}from"./required.js";import{T as u}from"./type.js";var m=function(e,t,o,a){var i,s=arguments.length,r=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,a);else for(var n=e.length-1;n>=0;n--)(i=e[n])&&(r=(s<3?i(r):s>3?i(t,o,r):i(t,o))||r);return s>3&&r&&Object.defineProperty(t,o,r),r};const f=e(class extends t{get hasBurgerMenu(){return"desktop"!==this.device&&this.hasMainNav}get scrollParent(){const e=document.querySelector("[data-post-scroll-locked]");if(e)return e;let t=this.host.parentElement;for(;t;){const e=getComputedStyle(t).overflowY;if(["auto","scroll"].includes(e))return t;t=t.parentElement}return document.body}lockBody(e,t,o){const a=this.scrollParent;"desktop"!==this.device&&("burgerMenuExtended"===o?e:this.burgerMenuExtended)?(a.dataset.postScrollLocked="",this.host.addEventListener("keydown",this.keyboardHandler)):(delete a.dataset.postScrollLocked,this.host.removeEventListener("keydown",this.keyboardHandler))}constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.throttledResize=c(50,(()=>this.updateLocalHeaderHeight())),this.animationOptions={duration:350,easing:"headerEase"},this.device=n.get("device"),this.hasTitle=!0,this.hasMainNav=!0,this.hasLocalNav=!0,this.burgerMenuExtended=!1,this.megadropdownOpen=!1,this.fullWidth=!1,this.breakpointChange=e=>{const t=this.device;this.device=e.detail,this.switchLanguageSwitchMode();const o="desktop"===this.device;"desktop"===t&&"desktop"!==this.device&&this.megadropdownOpen&&(this.burgerMenuExtended=!0),o&&this.burgerMenuExtended&&this.closeBurgerMenu()},this.onScroll=()=>{this.handleScrollEvent(),this.collapseIfNotKeyboardFocused()},this.handleScrollEvent=this.handleScrollEvent.bind(this),this.updateScrollParentHeight=this.updateScrollParentHeight.bind(this),this.updateLocalHeaderHeight=this.updateLocalHeaderHeight.bind(this),this.keyboardHandler=this.keyboardHandler.bind(this),this.handleLinkClick=this.handleLinkClick.bind(this),this.checkSlottedContent=this.checkSlottedContent.bind(this),this.megadropdownStateHandler=this.megadropdownStateHandler.bind(this)}connectedCallback(){globalThis.addEventListener("resize",this.throttledResize,{passive:!0}),globalThis.addEventListener("scroll",this.onScroll,{passive:!0}),this.scrollParent.addEventListener("scroll",this.onScroll,{passive:!0}),document.addEventListener("postToggleMegadropdown",this.megadropdownStateHandler),globalThis.addEventListener("postBreakpoint:device",this.breakpointChange),this.handleScrollParentResize(),this.lockBody(!1,this.burgerMenuExtended,"burgerMenuExtended")}componentWillRender(){this.handleScrollEvent(),this.handleSlottedContentChanges(),this.switchLanguageSwitchMode()}componentDidRender(){this.getFocusableElements(),this.handleLocalHeaderResize(),this.burgerMenuButton&&this.burgerMenuButton.toggled!==this.burgerMenuExtended&&(this.burgerMenuButton.toggled=this.burgerMenuExtended)}componentDidLoad(){this.updateLocalHeaderHeight(),this.host.shadowRoot.addEventListener("click",this.handleLinkClick)}disconnectedCallback(){const e=this.scrollParent;globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange),globalThis.removeEventListener("resize",this.throttledResize),globalThis.removeEventListener("scroll",this.onScroll),e&&e.removeEventListener("scroll",this.onScroll),document.removeEventListener("postToggleMegadropdown",this.megadropdownStateHandler),this.host.removeEventListener("keydown",this.keyboardHandler),this.host.shadowRoot&&this.host.shadowRoot.removeEventListener("click",this.handleLinkClick),this.scrollParentResizeObserver&&(this.scrollParentResizeObserver.disconnect(),this.scrollParentResizeObserver=null),this.localHeaderResizeObserver&&(this.localHeaderResizeObserver.disconnect(),this.localHeaderResizeObserver=null),this.slottedContentObserver&&(this.slottedContentObserver.disconnect(),this.slottedContentObserver=null),this.burgerMenuExtended=!1}async closeBurgerMenu(){this.burgerMenuAnimation?.finish(),this.burgerMenuButton&&(this.burgerMenuButton.toggled=!1),this.burgerMenuExtended=!1}async toggleBurgerMenu(e=!this.burgerMenuExtended){"desktop"!==this.device&&e!==this.burgerMenuExtended&&(this.burgerMenuAnimation=r(this.burgerMenu,this.burgerMenuExtended?"out":"in",this.animationOptions),this.burgerMenuButton&&this.burgerMenuButton.toggled!==e&&(this.burgerMenuButton.toggled=e),this.burgerMenuExtended?(await this.burgerMenuAnimation.finished,this.burgerMenuExtended=e,!1===this.burgerMenuExtended&&(this.closeAllMegadropdowns(),this.burgerMenu.scrollTop=0)):(this.burgerMenuExtended=e,this.megadropdownOpen&&this.closeAllMegadropdowns()))}megadropdownStateHandler(e){this.megadropdownOpen=e.detail.isVisible}getFocusableElements(){if(!this.burgerMenu)return;const e=[this.burgerMenuButton];e.push(...l(this.localHeader,(e=>!e.matches("post-megadropdown"))),...l(this.burgerMenu,(e=>!e.matches("post-megadropdown")))),this.firstFocusableEl=e[0],this.lastFocusableEl=e.at(-1)}keyboardHandler(e){if("Tab"!==e.key||!this.burgerMenuExtended)return;const t=this.host.shadowRoot.activeElement||document.activeElement;e.shiftKey&&t===this.firstFocusableEl?(e.preventDefault(),this.lastFocusableEl.focus()):e.shiftKey||t!==this.lastFocusableEl||(e.preventDefault(),this.firstFocusableEl.focus())}closeAllMegadropdowns(){Array.from(this.host.querySelectorAll("post-megadropdown")).forEach((e=>{e.hide(!1,!0)})),this.megadropdownOpen=!1}collapseIfNotKeyboardFocused(){"expanded"in this.host.dataset&&(this.getDeepActiveElement()?.matches(":focus-visible")||delete this.host.dataset.expanded)}handleScrollEvent(){const e=this.scrollParent===document.body?window.scrollY:this.scrollParent.scrollTop;document.documentElement.style.setProperty("--post-header-scroll-top",Math.max(e,0)+"px")}updateLocalHeaderHeight(){const e=this.host.shadowRoot.querySelector(".local-header");e&&document.documentElement.style.setProperty("--post-local-header-expanded-height",e.clientHeight+"px")}updateScrollParentHeight(){this.host.style.setProperty("--post-header-scroll-parent-height",this.scrollParent.clientHeight+"px")}handleLinkClick(e){const t=e.target,o=t.closest("post-mainnavigation a"),a=t.closest("post-megadropdown a");(o||a)&&(this.burgerMenuExtended&&(o||a)&&this.toggleBurgerMenu(!1),"desktop"===this.device&&a)&&t.closest("post-megadropdown a")&&t.closest("post-megadropdown").hide(!0)}handleScrollParentResize(){this.scrollParent&&(this.scrollParentResizeObserver=new ResizeObserver(this.updateScrollParentHeight),this.scrollParentResizeObserver.observe(this.scrollParent))}handleLocalHeaderResize(){const e=this.host.shadowRoot.querySelector(".local-header");e&&!this.localHeaderResizeObserver&&(this.localHeaderResizeObserver=new ResizeObserver(this.updateLocalHeaderHeight),this.localHeaderResizeObserver.observe(e))}handleSlottedContentChanges(){this.slottedContentObserver||(this.checkSlottedContent(),this.slottedContentObserver=new MutationObserver(this.checkSlottedContent),this.slottedContentObserver.observe(this.host,{childList:!0}))}checkSlottedContent(){o.isServer||(this.hasTitle=!!this.host.querySelector('[slot="title"]'),this.hasMainNav=!!this.host.querySelector('[slot="main-nav"]'),this.hasLocalNav=!!this.host.querySelector('[slot="local-nav"]'))}switchLanguageSwitchMode(){const e=this.hasBurgerMenu?"list":"menu";Array.from(this.host.querySelectorAll("post-language-menu")).forEach((t=>{t?.setAttribute("variant",e)}))}onFocusChange(e){if("focusout"===e.type){if(this.isWithinHeader(e.relatedTarget))return;return void delete this.host.dataset.expanded}const t=this.getDeepActiveElement()?.matches(":focus-visible");if(!t)return;const o="desktop"===this.device?this.globalHeader:this.localHeader,a=e.composedPath().includes(o);this.host.toggleAttribute("data-expanded",a)}isWithinHeader(e){return e instanceof Node&&(e===this.host||this.host.contains(e))}getDeepActiveElement(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}renderBurgerMenu(){return a("div",{class:{"burger-menu":!0,extended:this.burgerMenuExtended,"second-level-open":this.megadropdownOpen},style:{"--post-header-navigation-current-inset":(this.burgerMenu?.scrollTop??0)+"px"},ref:e=>this.burgerMenu=e},this.hasLocalNav&&!this.hasTitle&&a("div",{class:"local-nav"},a("slot",{name:"local-nav"})),a("div",{class:"burger-menu-body"},a("slot",{name:"audience"}),a("slot",{name:"main-nav"})),a("div",{class:"burger-menu-footer"},a("slot",{name:"global-nav-secondary"}),a("slot",{name:"language-menu"})))}render(){const e=o.isServer||"desktop"===this.device,t=o.isServer||"desktop"!==this.device;return a(i,{key:"4c74840c9613cb23844f18754a25acfc0d16f128","data-version":h,"data-color-scheme":"light","data-burger-menu":this.hasBurgerMenu,"data-menu-extended":this.burgerMenuExtended},a("header",{key:"711ff06b1294ab7cca504cbb1b18ea132f2e2a29"},a("div",{key:"91f37765845ec6df6f878a5750acb2f9d3a9a3ef",ref:e=>this.globalHeader=e,class:"global-header"},a("div",{key:"9ce59aeb02b710ebf435dd71a44daef5729784cb",class:"section"},a("div",{key:"9ae9b8a9d4d53eb18cee84167b6fd0900ca968bf",class:"logo"},a("slot",{key:"a0970fc3b536710b746d62013da387a03ac02ae6",name:"post-logo"})),a("div",{key:"685cf65541a21d8911705317b62ac7a5f900141a",class:"sliding-controls"},e&&a("div",{key:"540854418db78414095ef58d376401955e05458b",class:"audience"},a("slot",{key:"57f1a927cffb3baea05d7ea54d78fd57349dd81f",name:"audience"})),a("slot",{key:"1f473accb45b6da9ca0225ed1ee1c075a89cc5a4",name:"global-nav-primary"}),(e||!this.hasMainNav)&&[a("slot",{key:"global-nav-secondary",name:"global-nav-secondary"}),a("slot",{key:"language-menu",name:"language-menu"})],a("slot",{key:"2f22dad30f8b4482b86aa44f4806844a0543826e",name:"post-login"}),t&&this.hasMainNav&&a("post-togglebutton",{key:"d9440ab691459ee505bd3fee43df08eab4fd7d6e",class:"burger-button",ref:e=>this.burgerMenuButton=e,onClick:()=>this.toggleBurgerMenu()},a("span",{key:"c8e750756d635d4d145393db597e7e6c0aab0bf3"},this.textMenu),a("post-icon",{key:"ff251d5dd1815caccc2c1099dafbda2719e39531","aria-hidden":"true",name:"burger","data-showwhen":"untoggled"}),a("post-icon",{key:"1a607d5b4bf397b17aeeaa392b2444d480740e26","aria-hidden":"true",name:"closex","data-showwhen":"toggled"}))))),a("div",{key:"bdbd60cf795b45ff66c1078defaf388eaa9711a6",ref:e=>this.localHeader=e,class:{"local-header":!0,"megadropdown-open":this.megadropdownOpen}},a("div",{key:"3b065f633b1dbf16595ae2665c425448c08e01a5",class:"section"},a("slot",{key:"8d2a3f4491a348b16dbd71f439ed0e57b8856642",name:"side-nav"}),a("slot",{key:"2b169e02026daaa253e6c607d29b4c51373b30c5",name:"title"}),this.hasTitle&&a("slot",{key:"e4afc5c638c62533387cb35eb121e6736afc957d",name:"local-nav"}),e&&a("slot",{key:"2dedbbec1b4af4b5f22aaf555b0c1adc2260eca3",name:"main-nav"}),e&&!this.hasTitle&&a("slot",{key:"db0bf934df1bd189cbecb74ebc2cdc9b753c56f4",name:"local-nav"}))),this.hasBurgerMenu&&this.renderBurgerMenu()))}get host(){return this}static get watchers(){return{device:[{lockBody:0}],burgerMenuExtended:[{lockBody:0}]}}static get style(){return':host{--post-global-header-top:calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-header-top:calc(var(--post-header-reduced-height) - var(--post-header-expanded-height));--post-logo-height:calc( var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px) );--post-global-controls-top:clamp( 1000 * (var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height)), calc( -1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height)) ), 0px )}@media screen and (min-width: 1024px){:host{--post-header-gap:8px;--post-global-header-padding-inline-start:4px;--post-global-header-padding-inline-end:8px;--post-local-header-padding-inline-start:12px;--post-local-header-padding-inline-end:8px}}@media screen and (min-width: 600px)and (max-width: 1023.98px){:host{--post-header-gap:12px 8px;--post-global-header-padding-inline-start:4px;--post-global-header-padding-inline-end:4px;--post-local-header-padding-inline-start:12px;--post-local-header-padding-inline-end:4px;--post-local-header-padding-block:12px;--post-burger-menu-padding-inline:40px;--post-burger-menu-body-gap:32px;--post-burger-menu-footer-gap:24px}}@media screen and (min-width: 600px)and (max-width: 779.98px){:host{--post-burger-menu-padding-inline:16px}}@media screen and (min-width: 0)and (max-width: 599.98px){:host{--post-header-gap:12px 8px;--post-global-header-padding-inline-start:0px;--post-global-header-padding-inline-end:8px;--post-local-header-padding-inline-start:8px;--post-local-header-padding-inline-end:8px;--post-local-header-padding-block:8px;--post-burger-menu-padding-inline:16px;--post-burger-menu-body-gap:24px;--post-burger-menu-footer-gap:16px}}:host(:not([full-width])),:host([full-width=false]){--post-header-content-max-width:1440px}:host([data-expanded]),:host([data-menu-extended]){--post-header-top:0;--post-global-header-top:-0.001px;--post-global-controls-top:0;--post-global-header-reduced-height:var(--post-global-header-expanded-height)}*,::before,::after{box-sizing:border-box}:host,header,.global-header,.local-header{transition:inset-block-start 150ms cubic-bezier(0.4, 0, 0.2, 1)}.section,.sliding-controls{display:flex;align-items:center;justify-content:space-between;gap:var(--post-header-gap);flex-wrap:wrap}.section{max-width:var(--post-header-content-max-width);margin-inline:auto}:host{display:block;position:sticky;inset-block-start:var(--post-header-top);z-index:1020;box-shadow:var(--post-device-elevation-300)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host{border-bottom:1px solid}}.global-header{z-index:2;position:sticky;inset-block-start:var(--post-global-header-top);background-color:#fc0}.global-header::before{position:absolute;z-index:-1;left:0;bottom:0;width:100%;height:100dvh;content:"";background-color:#fc0}.global-header .section{height:var(--post-global-header-expanded-height);padding-inline-start:var(--post-global-header-padding-inline-start);padding-inline-end:var(--post-global-header-padding-inline-end)}.global-header .logo{align-self:flex-end;width:var(--post-global-header-expanded-height);height:var(--post-logo-height);min-height:var(--post-global-header-reduced-height);max-height:100%;margin-inline-end:calc(20px - var(--post-header-gap));margin-inline-start:clamp(var(--post-logo-expanded-offset),var(--post-logo-expanded-offset) + (var(--post-logo-reduced-offset) - var(--post-logo-expanded-offset))*min(var(--post-header-scroll-top, 0px),var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height))/max(1px,var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height)),var(--post-logo-reduced-offset))}.global-header .sliding-controls{flex-grow:1;justify-content:flex-end;position:relative;inset-block-start:var(--post-global-controls-top)}.global-header .audience{margin-inline-end:auto}@media screen and (max-width: 1023.98px){.global-header slot:where([name=audience],[name=global-nav-secondary]){display:none}}.local-header{position:relative;background-color:#fff;min-height:var(--post-local-header-expanded-min-height);display:var(--post-local-header-display, flex);align-items:var(--post-local-header-align-items, center)}.local-header .section{width:100%;padding-inline-start:var(--post-local-header-padding-inline-start);padding-inline-end:var(--post-local-header-padding-inline-end);padding-block:var(--post-local-header-padding-block)}@media screen and (min-width: 1024px){.local-header .section{display:grid;grid-template:var(--post-local-header-grid-template)}}@media screen and (max-width: 1023.98px){.local-header .section{display:flex;align-self:center}}@media screen and (max-width: 1023.98px)and (max-width: 599.98px){.local-header .section{justify-content:end}}.local-header:where(.megadropdown-open)::after,.local-header:has(~.burger-menu.extended)::after{content:"";display:block;position:absolute;inset-inline:0;inset-block-end:0;height:1px;background-color:#e1e0dc}.local-header .local-nav{flex:0 0 auto}@media screen and (max-width: 1023.98px){.local-header slot[name=main-nav]{display:none}}.burger-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:4px 10px;gap:6px;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);display:var(--post-burger-button-display, flex)}.burger-button:not(:disabled):hover{text-decoration:none}.burger-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.burger-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}.burger-button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:focus-visible{outline-color:Highlight !important}}.burger-button.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){.burger-button.pretend-focus{outline-color:Highlight !important}}.burger-button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.burger-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){.burger-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button{border-width:1px !important;transition:none}.burger-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.burger-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}@media screen and (min-width: 0)and (max-width: 599.98px){.burger-button{padding:10px}.burger-button>:not(post-icon){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.burger-button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){.burger-button{display:none}}.burger-menu{z-index:-1;position:absolute;inset-inline:0;inset-block-start:100%;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));overflow:hidden auto;display:flex;flex-direction:column;background-color:#fafafa}.burger-menu.extended.second-level-open{overflow:hidden}.burger-menu:not(.extended){transform:translateY(-100%);display:none}.burger-menu:not(.extended)>*{display:none}.burger-menu .burger-menu-body,.burger-menu .burger-menu-footer{display:flex;flex-direction:column;padding-inline:var(--post-burger-menu-padding-inline)}.burger-menu .burger-menu-body{flex-grow:1;padding-block:24px;gap:var(--post-burger-menu-body-gap)}.burger-menu .burger-menu-footer{background-color:#f0efed;padding-block-start:16px;padding-block-end:max(24px, env(safe-area-inset-bottom, 0px));gap:var(--post-burger-menu-footer-gap)}.burger-menu .local-nav{min-height:56px;display:flex;align-items:center;justify-content:flex-end;padding-inline:4px}'}},[257,"post-header",{fullWidth:[516,"full-width"],textMenu:[513,"text-menu"],device:[32],hasTitle:[32],hasMainNav:[32],hasLocalNav:[32],burgerMenuExtended:[32],megadropdownOpen:[32],toggleBurgerMenu:[64]},[[0,"focusin","onFocusChange"],[0,"focusout","onFocusChange"]],{device:[{lockBody:0}],burgerMenuExtended:[{lockBody:0}]}]);m([b(),u("boolean")],f.prototype,"fullWidth",void 0),m([b(),u("string")],f.prototype,"textMenu",void 0),m([d("post-megadropdown")],f.prototype,"megadropdownStateHandler",null);const v=f,x=function(){"undefined"!=typeof customElements&&["post-header","post-icon","post-togglebutton"].forEach((e=>{switch(e){case"post-header":customElements.get(s(e))||customElements.define(s(e),f);break;case"post-icon":customElements.get(s(e))||p();break;case"post-togglebutton":customElements.get(s(e))||g()}}))};export{v as PostHeader,x as defineCustomElement}
1
+ import{proxyCustomElement as e,HTMLElement as t,Build as o,h as a,Host as i,transformTag as s}from"@stencil/core/internal/client";import{f as r}from"./fade.js";import{b as n}from"./breakpoints.js";import{E as d}from"./event-from.js";import{a as l}from"./get-focusable-children.js";import{v as h}from"./package.js";import{t as c}from"./index2.js";import{d as p}from"./post-icon2.js";import{d as g}from"./post-togglebutton2.js";import{R as b}from"./required.js";import{T as u}from"./type.js";var m=function(e,t,o,a){var i,s=arguments.length,r=s<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,o):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,a);else for(var n=e.length-1;n>=0;n--)(i=e[n])&&(r=(s<3?i(r):s>3?i(t,o,r):i(t,o))||r);return s>3&&r&&Object.defineProperty(t,o,r),r};const f=e(class extends t{get hasBurgerMenu(){return"desktop"!==this.device&&(this.hasMainNav||this.hasAudience||this.hasGlobalNavSecondary)}get scrollParent(){const e=document.querySelector("[data-post-scroll-locked]");if(e)return e;let t=this.host.parentElement;for(;t;){const e=getComputedStyle(t).overflowY;if(["auto","scroll"].includes(e))return t;t=t.parentElement}return document.body}lockBody(e,t,o){const a=this.scrollParent;"desktop"!==this.device&&("burgerMenuExtended"===o?e:this.burgerMenuExtended)?(a.dataset.postScrollLocked="",this.host.addEventListener("keydown",this.keyboardHandler)):(delete a.dataset.postScrollLocked,this.host.removeEventListener("keydown",this.keyboardHandler))}constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.scrollMax=1/0,this.scrollPosition=0,this.throttledResize=c(50,(()=>this.updateLocalHeaderHeight())),this.animationOptions={duration:350,easing:"headerEase"},this.device=n.get("device"),this.hasTitle=!0,this.hasMainNav=!0,this.hasAudience=!0,this.hasGlobalNavSecondary=!0,this.hasLocalNav=!0,this.burgerMenuExtended=!1,this.megadropdownOpen=!1,this.fullWidth=!1,this.breakpointChange=e=>{const t=this.device;this.device=e.detail,this.switchLanguageSwitchMode();const o="desktop"===this.device;"desktop"===t&&"desktop"!==this.device&&this.megadropdownOpen&&(this.burgerMenuExtended=!0),o&&this.burgerMenuExtended&&this.closeBurgerMenu()},this.onScroll=()=>{this.handleScrollEvent(),this.collapseIfNotKeyboardFocused()},this.handleScrollEvent=this.handleScrollEvent.bind(this),this.updateScrollParentHeight=this.updateScrollParentHeight.bind(this),this.updateLocalHeaderHeight=this.updateLocalHeaderHeight.bind(this),this.updateScrollMax=this.updateScrollMax.bind(this),this.keyboardHandler=this.keyboardHandler.bind(this),this.handleLinkClick=this.handleLinkClick.bind(this),this.checkSlottedContent=this.checkSlottedContent.bind(this),this.megadropdownStateHandler=this.megadropdownStateHandler.bind(this)}connectedCallback(){globalThis.addEventListener("resize",this.throttledResize,{passive:!0}),globalThis.addEventListener("scroll",this.onScroll,{passive:!0}),this.scrollParent.addEventListener("scroll",this.onScroll,{passive:!0}),document.addEventListener("postToggleMegadropdown",this.megadropdownStateHandler),globalThis.addEventListener("postBreakpoint:device",this.breakpointChange),this.handleScrollParentResize(),this.handleScrollMaxResize(),this.lockBody(!1,this.burgerMenuExtended,"burgerMenuExtended")}componentWillRender(){this.handleScrollEvent(),this.handleSlottedContentChanges(),this.switchLanguageSwitchMode()}componentDidRender(){this.getFocusableElements(),this.handleLocalHeaderResize(),this.handleScrollMaxResize(),this.burgerMenuButton&&this.burgerMenuButton.toggled!==this.burgerMenuExtended&&(this.burgerMenuButton.toggled=this.burgerMenuExtended)}componentDidLoad(){this.updateLocalHeaderHeight(),this.host.shadowRoot.addEventListener("click",this.handleLinkClick)}disconnectedCallback(){const e=this.scrollParent;globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange),globalThis.removeEventListener("resize",this.throttledResize),globalThis.removeEventListener("scroll",this.onScroll),e&&e.removeEventListener("scroll",this.onScroll),document.removeEventListener("postToggleMegadropdown",this.megadropdownStateHandler),this.host.removeEventListener("keydown",this.keyboardHandler),this.host.shadowRoot&&this.host.shadowRoot.removeEventListener("click",this.handleLinkClick),this.scrollParentResizeObserver&&(this.scrollParentResizeObserver.disconnect(),this.scrollParentResizeObserver=null),this.localHeaderResizeObserver&&(this.localHeaderResizeObserver.disconnect(),this.localHeaderResizeObserver=null),this.scrollMaxResizeObserver&&(this.scrollMaxResizeObserver.disconnect(),this.scrollMaxResizeObserver=null),this.lastScrollTop=void 0,this.slottedContentObserver&&(this.slottedContentObserver.disconnect(),this.slottedContentObserver=null),this.burgerMenuExtended=!1}async closeBurgerMenu(){this.burgerMenuAnimation?.finish(),this.burgerMenuButton&&(this.burgerMenuButton.toggled=!1),this.burgerMenuExtended=!1}async toggleBurgerMenu(e=!this.burgerMenuExtended){"desktop"!==this.device&&e!==this.burgerMenuExtended&&(this.burgerMenuAnimation=r(this.burgerMenu,this.burgerMenuExtended?"out":"in",this.animationOptions),this.burgerMenuButton&&this.burgerMenuButton.toggled!==e&&(this.burgerMenuButton.toggled=e),this.burgerMenuExtended?(await this.burgerMenuAnimation.finished,this.burgerMenuExtended=e,!1===this.burgerMenuExtended&&(this.closeAllMegadropdowns(),this.burgerMenu.scrollTop=0)):(this.burgerMenuExtended=e,this.megadropdownOpen&&this.closeAllMegadropdowns()))}megadropdownStateHandler(e){this.megadropdownOpen=e.detail.isVisible}getFocusableElements(){if(!this.burgerMenu)return;const e=[this.burgerMenuButton];e.push(...l(this.localHeader,(e=>!e.matches("post-megadropdown"))),...l(this.burgerMenu,(e=>!e.matches("post-megadropdown")))),this.firstFocusableEl=e[0],this.lastFocusableEl=e.at(-1)}keyboardHandler(e){if("Tab"!==e.key||!this.burgerMenuExtended)return;const t=this.host.shadowRoot.activeElement||document.activeElement;e.shiftKey&&t===this.firstFocusableEl?(e.preventDefault(),this.lastFocusableEl.focus()):e.shiftKey||t!==this.lastFocusableEl||(e.preventDefault(),this.firstFocusableEl.focus())}closeAllMegadropdowns(){Array.from(this.host.querySelectorAll("post-megadropdown")).forEach((e=>{e.hide(!1,!0)})),this.megadropdownOpen=!1}collapseIfNotKeyboardFocused(){"expanded"in this.host.dataset&&(this.getDeepActiveElement()?.matches(":focus-visible")||delete this.host.dataset.expanded)}getScrollPosition(){const e=this.scrollParent;return e===document.body?globalThis.scrollY:e.scrollTop}restoreScrollPosition(){const e=this.scrollParent;(e===document.body?globalThis:e).scrollTo({top:this.scrollPosition,behavior:"instant"})}handleScrollEvent(){this.scrollPosition=this.getScrollPosition();const e=Math.min(Math.max(this.scrollPosition,0),this.scrollMax);e!==this.lastScrollTop&&(this.lastScrollTop=e,document.documentElement.style.setProperty("--post-header-scroll-top",e+"px"))}updateScrollMax(){if(!this.scrollMaxElement)return;const e=""!==getComputedStyle(this.host).getPropertyValue("--post-header-scroll-max").trim();this.scrollMax=e?Math.ceil(this.scrollMaxElement.getBoundingClientRect().width):1/0,this.handleScrollEvent()}updateLocalHeaderHeight(){const e=this.host.shadowRoot.querySelector(".local-header");e&&document.documentElement.style.setProperty("--post-local-header-expanded-height",e.clientHeight+"px")}updateScrollParentHeight(){this.host.style.setProperty("--post-header-scroll-parent-height",this.scrollParent.clientHeight+"px")}handleLinkClick(e){const t=e.target,o=t.closest("post-mainnavigation a"),a=t.closest("post-megadropdown a");(o||a)&&(this.burgerMenuExtended&&(o||a)&&this.toggleBurgerMenu(!1),"desktop"===this.device&&a)&&t.closest("post-megadropdown a")&&t.closest("post-megadropdown").hide(!0)}handleScrollParentResize(){this.scrollParent&&(this.scrollParentResizeObserver=new ResizeObserver(this.updateScrollParentHeight),this.scrollParentResizeObserver.observe(this.scrollParent))}handleLocalHeaderResize(){const e=this.host.shadowRoot.querySelector(".local-header");e&&!this.localHeaderResizeObserver&&(this.localHeaderResizeObserver=new ResizeObserver(this.updateLocalHeaderHeight),this.localHeaderResizeObserver.observe(e))}handleScrollMaxResize(){this.scrollMaxElement&&!this.scrollMaxResizeObserver&&(this.updateScrollMax(),this.scrollMaxResizeObserver=new ResizeObserver(this.updateScrollMax),this.scrollMaxResizeObserver.observe(this.scrollMaxElement))}handleSlottedContentChanges(){this.slottedContentObserver||(this.checkSlottedContent(),this.slottedContentObserver=new MutationObserver(this.checkSlottedContent),this.slottedContentObserver.observe(this.host,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["slot"]}))}slotHasNavigationItems(e,t){return Array.from(this.host.querySelectorAll(`:scope > [slot="${e}"]`)).some((e=>e.matches(t)||!!e.querySelector(t)))}checkSlottedContent(){o.isServer||(this.hasTitle=!!this.host.querySelector('[slot="title"]'),this.hasMainNav=this.slotHasNavigationItems("main-nav","a:not(post-megadropdown *), post-megadropdown-trigger"),this.hasAudience=this.slotHasNavigationItems("audience","a, button"),this.hasGlobalNavSecondary=this.slotHasNavigationItems("global-nav-secondary","a, button"),this.hasLocalNav=!!this.host.querySelector('[slot="local-nav"]'))}switchLanguageSwitchMode(){const e=this.hasBurgerMenu?"list":"menu";Array.from(this.host.querySelectorAll("post-language-menu")).forEach((t=>{t?.setAttribute("variant",e)}))}onFocusChange(e){if("focusout"===e.type){if(this.isWithinHeader(e.relatedTarget))return;return void delete this.host.dataset.expanded}const t=this.getDeepActiveElement()?.matches(":focus-visible");if(!t)return;const o="desktop"===this.device?this.globalHeader:this.localHeader,a=e.composedPath().includes(o);this.host.toggleAttribute("data-expanded",a),a&&this.restoreScrollPosition()}isWithinHeader(e){return e instanceof Node&&(e===this.host||this.host.contains(e))}getDeepActiveElement(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}renderBurgerMenu(){return a("div",{class:{"burger-menu":!0,extended:this.burgerMenuExtended,"second-level-open":this.megadropdownOpen},style:{"--post-header-navigation-current-inset":(this.burgerMenu?.scrollTop??0)+"px"},ref:e=>this.burgerMenu=e},this.hasLocalNav&&!this.hasTitle&&a("div",{class:"local-nav"},a("slot",{name:"local-nav"})),a("div",{class:"burger-menu-body"},a("slot",{name:"audience"}),a("slot",{name:"main-nav"})),a("div",{class:"burger-menu-footer"},a("slot",{name:"global-nav-secondary"}),a("slot",{name:"language-menu"})))}render(){const e=o.isServer||"desktop"===this.device;return a(i,{key:"54f311b0483a77983c8a260a730e12b10f936f2d","data-version":h,"data-color-scheme":"light","data-burger-menu":this.hasBurgerMenu,"data-menu-extended":this.burgerMenuExtended},a("span",{key:"464d6e58d8e3beec6ae8a306510e669cb2e2fec9",class:"scroll-max","aria-hidden":"true",ref:e=>this.scrollMaxElement=e}),a("header",{key:"1819b5300843eb4c66141a97c46832cd1ca54466"},a("div",{key:"e1fd6075137cb64ef6d0835d1317659da19a17f6",ref:e=>this.globalHeader=e,class:"global-header"},a("div",{key:"d1833a01d27a59ef9ef3203734e14f8bfe4a1541",class:"section"},a("div",{key:"299fcbb952c0402f239a721459a2ea48a5959131",class:"logo"},a("slot",{key:"cb0b192d7d12dd4ba7a5bcdfea2a9f51232ebc45",name:"post-logo"})),a("div",{key:"69a54116557786db7a1c6401c9fdff4808b64ee2",class:"sliding-controls"},e&&a("div",{key:"3e81349af69790454a0ff80d058cc1d1d34d27a2",class:"audience"},a("slot",{key:"37a1d787da40f9bd3188aa5b640262b802a27310",name:"audience"})),a("slot",{key:"6af478e6aa380ead70df3b6202b1b8de0573f786",name:"global-nav-primary"}),(e||!this.hasBurgerMenu)&&[a("slot",{key:"global-nav-secondary",name:"global-nav-secondary"}),a("slot",{key:"language-menu",name:"language-menu"})],a("slot",{key:"9f1afec759f7c0ec8448077eb81164e5f2f2a86e",name:"post-login"}),(o.isServer||this.hasBurgerMenu)&&a("post-togglebutton",{key:"746afc808afffe295478d5ae8effdad99f551f44",class:"burger-button",ref:e=>this.burgerMenuButton=e,onClick:()=>this.toggleBurgerMenu()},a("span",{key:"4ea61aa1d259b38254914b8f78b4edbd5dbaab2a"},this.textMenu),a("post-icon",{key:"711fd906af8578dc7ecdb90d2d238828e7f184e6","aria-hidden":"true",name:"burger","data-showwhen":"untoggled"}),a("post-icon",{key:"9797c5b101b734f47f35572fb63def04fd63c349","aria-hidden":"true",name:"closex","data-showwhen":"toggled"}))))),a("div",{key:"8e202c4085f060843bbb0e99c1b7af190fdb7c1d",ref:e=>this.localHeader=e,class:{"local-header":!0,"megadropdown-open":this.megadropdownOpen}},a("div",{key:"18035a103958aadc9187d33a938be44a8e13a2d6",class:"section"},a("slot",{key:"77cb8436bea9bfae7a5ab2bcd5594dc92dc6a3ab",name:"side-nav"}),a("slot",{key:"4875e26bc0cc181e7b19771aafe56d27dd451844",name:"title"}),this.hasTitle&&a("slot",{key:"c3d1d22045c19a4ed860ae88e9ebb3d6279341af",name:"local-nav"}),e&&a("slot",{key:"8e65de4132f2b7905b126849e2703da3e9b0a1a0",name:"main-nav"}),e&&!this.hasTitle&&a("slot",{key:"76b439a83965fe0669de37c1f2a29993abdbad30",name:"local-nav"}))),this.hasBurgerMenu&&this.renderBurgerMenu()))}get host(){return this}static get watchers(){return{device:[{lockBody:0}],burgerMenuExtended:[{lockBody:0}]}}static get style(){return':host{--post-global-header-top:calc( var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height) );--post-header-top:calc(var(--post-header-reduced-height) - var(--post-header-expanded-height));--post-logo-height:calc( var(--post-global-header-expanded-height) - var(--post-header-scroll-top, 0px) );--post-global-controls-top:clamp( 1000 * (var(--post-global-header-reduced-height) - var(--post-global-header-expanded-height)), calc( -1 * min(var(--post-header-scroll-top, 0px) / 4, var(--post-global-header-reduced-height)) ), 0px )}@media screen and (min-width: 1024px){:host{--post-header-gap:8px;--post-global-header-padding-inline-start:4px;--post-global-header-padding-inline-end:8px;--post-local-header-padding-inline-start:12px;--post-local-header-padding-inline-end:8px}}@media screen and (min-width: 600px)and (max-width: 1023.98px){:host{--post-header-gap:12px 8px;--post-global-header-padding-inline-start:4px;--post-global-header-padding-inline-end:4px;--post-local-header-padding-inline-start:12px;--post-local-header-padding-inline-end:4px;--post-local-header-padding-block:12px;--post-burger-menu-padding-inline:40px;--post-burger-menu-body-gap:32px;--post-burger-menu-footer-gap:24px}}@media screen and (min-width: 600px)and (max-width: 779.98px){:host{--post-burger-menu-padding-inline:16px}}@media screen and (min-width: 0)and (max-width: 599.98px){:host{--post-header-gap:12px 8px;--post-global-header-padding-inline-start:0px;--post-global-header-padding-inline-end:8px;--post-local-header-padding-inline-start:8px;--post-local-header-padding-inline-end:8px;--post-local-header-padding-block:8px;--post-burger-menu-padding-inline:16px;--post-burger-menu-body-gap:24px;--post-burger-menu-footer-gap:16px}}:host(:not([full-width])),:host([full-width=false]){--post-header-content-max-width:1440px}:host([data-expanded]),:host([data-menu-extended]){--post-header-top:0;--post-global-header-top:-0.001px;--post-global-controls-top:0;--post-global-header-reduced-height:var(--post-global-header-expanded-height)}*,::before,::after{box-sizing:border-box}:host,header,.global-header,.local-header{transition:inset-block-start 150ms cubic-bezier(0.4, 0, 0.2, 1)}.section,.sliding-controls{display:flex;align-items:center;justify-content:space-between;gap:var(--post-header-gap);flex-wrap:wrap}.section{max-width:var(--post-header-content-max-width);margin-inline:auto}:host{display:block;position:sticky;inset-block-start:var(--post-header-top);z-index:1020;box-shadow:var(--post-device-elevation-300)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host{border-bottom:1px solid}}.scroll-max{position:absolute;inset-block-start:0;inset-inline-start:0;inline-size:var(--post-header-scroll-max, 0);block-size:0;visibility:hidden;pointer-events:none}.global-header{z-index:2;position:sticky;inset-block-start:var(--post-global-header-top);background-color:#fc0}.global-header::before{position:absolute;z-index:-1;left:0;bottom:0;width:100%;height:100dvh;content:"";background-color:#fc0}.global-header .section{height:var(--post-global-header-expanded-height);padding-inline-start:var(--post-global-header-padding-inline-start);padding-inline-end:var(--post-global-header-padding-inline-end)}.global-header .logo{align-self:flex-end;width:var(--post-global-header-expanded-height);height:var(--post-logo-height);min-height:var(--post-global-header-reduced-height);max-height:100%;margin-inline-end:calc(20px - var(--post-header-gap));margin-inline-start:clamp(var(--post-logo-expanded-offset),var(--post-logo-expanded-offset) + (var(--post-logo-reduced-offset) - var(--post-logo-expanded-offset))*min(var(--post-header-scroll-top, 0px),var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height))/max(1px,var(--post-global-header-expanded-height) - var(--post-global-header-reduced-height)),var(--post-logo-reduced-offset))}.global-header .sliding-controls{flex-grow:1;justify-content:flex-end;position:relative;inset-block-start:var(--post-global-controls-top)}.global-header .audience{margin-inline-end:auto}@media screen and (max-width: 1023.98px){.global-header slot:where([name=audience],[name=global-nav-secondary]){display:none}}.local-header{position:relative;background-color:#fff;min-height:var(--post-local-header-expanded-min-height);display:var(--post-local-header-display, flex);align-items:var(--post-local-header-align-items, center)}.local-header .section{width:100%;padding-inline-start:var(--post-local-header-padding-inline-start);padding-inline-end:var(--post-local-header-padding-inline-end);padding-block:var(--post-local-header-padding-block)}@media screen and (min-width: 1024px){.local-header .section{display:grid;grid-template:var(--post-local-header-grid-template)}}@media screen and (max-width: 1023.98px){.local-header .section{display:flex;align-self:center}}@media screen and (max-width: 1023.98px)and (max-width: 599.98px){.local-header .section{justify-content:end}}.local-header:where(.megadropdown-open)::after,.local-header:has(~.burger-menu.extended)::after{content:"";display:block;position:absolute;inset-inline:0;inset-block-end:0;height:1px;background-color:#e1e0dc}.local-header .local-nav{flex:0 0 auto}@media screen and (max-width: 1023.98px){.local-header slot[name=main-nav]{display:none}}.burger-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:4px 10px;gap:6px;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);display:var(--post-burger-button-display, flex)}.burger-button:not(:disabled):hover{text-decoration:none}.burger-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.burger-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}.burger-button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:focus-visible{outline-color:Highlight !important}}.burger-button.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){.burger-button.pretend-focus{outline-color:Highlight !important}}.burger-button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.burger-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){.burger-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.burger-button{border-width:1px !important;transition:none}.burger-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.burger-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg)}.burger-button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}@media screen and (min-width: 0)and (max-width: 599.98px){.burger-button{padding:10px}.burger-button>:not(post-icon){position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.burger-button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){.burger-button{display:none}}.burger-menu{z-index:-1;position:absolute;inset-inline:0;inset-block-start:100%;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));overflow:hidden auto;display:flex;flex-direction:column;background-color:#fafafa}.burger-menu.extended.second-level-open{overflow:hidden}.burger-menu:not(.extended){transform:translateY(-100%);display:none}.burger-menu:not(.extended)>*{display:none}.burger-menu .burger-menu-body,.burger-menu .burger-menu-footer{display:flex;flex-direction:column;padding-inline:var(--post-burger-menu-padding-inline)}.burger-menu .burger-menu-body{flex-grow:1;padding-block:24px;gap:var(--post-burger-menu-body-gap)}.burger-menu .burger-menu-footer{background-color:#f0efed;padding-block-start:16px;padding-block-end:max(24px, env(safe-area-inset-bottom, 0px));gap:var(--post-burger-menu-footer-gap)}.burger-menu .local-nav{min-height:56px;display:flex;align-items:center;justify-content:flex-end;padding-inline:4px}'}},[257,"post-header",{fullWidth:[516,"full-width"],textMenu:[513,"text-menu"],device:[32],hasTitle:[32],hasMainNav:[32],hasAudience:[32],hasGlobalNavSecondary:[32],hasLocalNav:[32],burgerMenuExtended:[32],megadropdownOpen:[32],toggleBurgerMenu:[64]},[[0,"focusin","onFocusChange"],[0,"focusout","onFocusChange"]],{device:[{lockBody:0}],burgerMenuExtended:[{lockBody:0}]}]);m([b(),u("boolean")],f.prototype,"fullWidth",void 0),m([b(),u("string")],f.prototype,"textMenu",void 0),m([d("post-megadropdown")],f.prototype,"megadropdownStateHandler",null);const v=f,x=function(){"undefined"!=typeof customElements&&["post-header","post-icon","post-togglebutton"].forEach((e=>{switch(e){case"post-header":customElements.get(s(e))||customElements.define(s(e),f);break;case"post-icon":customElements.get(s(e))||p();break;case"post-togglebutton":customElements.get(s(e))||g()}}))};export{v as PostHeader,x as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,Build as i,h as n,Host as a,transformTag as o}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as s}from"./package.js";import{O as r}from"./one-of.js";import{T as c}from"./type.js";import{R as m}from"./required.js";var l=function(t,e,i,n){var a,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var r=t.length-1;r>=0;r--)(a=t[r])&&(s=(o<3?a(s):o>3?a(e,i,s):a(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};const f=`https://unpkg.com/@swisspost/design-system-icons@${s}/public/post-icons/`,p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.flipH=!1,this.flipV=!1}getUrl(){const t=`${this.name??this.host.getAttribute("name")}.svg`;if(this.url?.startsWith("data:image/"))return this.url;if(i.isServer&&!this.base)return`${f}${t}`;if(this.url)return this.url;const e=t=>/^https?:\/\//.test(t),n=t=>t&&!t.endsWith("/")?`${t}/`:t,a=t=>t.replaceAll(/([^:])\/\//g,"$1/"),o=i.isBrowser?globalThis.location.origin:"",s=i.isBrowser&&document.querySelector("base[href]")?.getAttribute("href")||"";let r="";if(i.isBrowser){const t=document.querySelector('meta[name="design-system-settings"]');r=t?.getAttribute("data-post-icon-base")||""}const c=t=>{const i=n(s),a=n(t);return e(i)?`${i}${a}`:`${o}${i}${a}`};let m;return this.base?(m=e(this.base)?`${n(this.base)}${t}`:`${c(this.base)}${t}`,a(m)):r?(m=e(r)?`${n(r)}${t}`:`${c(r)}${t}`,a(m)):a(`${f}${t}`)}getStyles(){const t=this.getUrl();return Object.fromEntries(Object.entries({"-webkit-mask-image":`url(${t})`,"mask-image":`url('${t}')`,transform:(this.scale&&!Number.isNaN(Number(this.scale))?"scale("+this.scale+")":"")+(this.rotate&&!Number.isNaN(Number(this.rotate))?" rotate("+this.rotate+"deg)":"")}).filter((([t,e])=>null!==e)))}render(){return n(a,{key:"405ccfde4206c14f044575d0b23998d93a03ffb6","data-version":s},n("span",{key:"ad70ccf63add4b881ef6096ae460e13fba09f508",style:this.getStyles()}))}get host(){return this}static get style(){return":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;-webkit-mask-position:center center;mask-position:center center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100%;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}"}},[1,"post-icon",{animation:[513],base:[1],url:[1],flipH:[516,"flip-h"],flipV:[516,"flip-v"],name:[513],rotate:[2],scale:[2]}]);function h(){"undefined"!=typeof customElements&&["post-icon"].forEach((t=>{"post-icon"===t&&(customElements.get(o(t))||customElements.define(o(t),p))}))}l([r(["cylon","cylon-vertical","spin","spin-reverse","fade","throb"])],p.prototype,"animation",void 0),l([c("string")],p.prototype,"base",void 0),l([m(),c("string")],p.prototype,"name",void 0),l([c("number")],p.prototype,"rotate",void 0),l([c("number")],p.prototype,"scale",void 0);export{p as P,h as d}
1
+ import{proxyCustomElement as t,HTMLElement as i,Build as e,h as n,Host as o,transformTag as a}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as s}from"./package.js";import{O as r}from"./one-of.js";import{T as c}from"./type.js";import{R as m}from"./required.js";var l=function(t,i,e,n){var o,a=arguments.length,s=a<3?i:null===n?n=Object.getOwnPropertyDescriptor(i,e):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,n);else for(var r=t.length-1;r>=0;r--)(o=t[r])&&(s=(a<3?o(s):a>3?o(i,e,s):o(i,e))||s);return a>3&&s&&Object.defineProperty(i,e,s),s};const f=`https://unpkg.com/@swisspost/design-system-icons@${s}/public/post-icons/`,h=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.flipH=!1,this.flipV=!1}getUrl(){const t=`${this.name??this.host.getAttribute("name")}.svg`;if(this.url?.startsWith("data:image/"))return this.url;if(e.isServer&&!this.base)return`${f}${t}`;if(this.url)return this.url;const i=t=>/^https?:\/\//.test(t),n=t=>t&&!t.endsWith("/")?`${t}/`:t,o=t=>t.replaceAll(/([^:])\/\//g,"$1/"),a=e.isBrowser?globalThis.location.origin:"",s=e.isBrowser&&document.querySelector("base[href]")?.getAttribute("href")||"";let r="";if(e.isBrowser){const t=document.querySelector('meta[name="design-system-settings"]');r=t?.getAttribute("data-post-icon-base")||""}const c=t=>{const e=n(s),o=n(t);return i(e)?`${e}${o}`:`${a}${e}${o}`};let m;return this.base?(m=i(this.base)?`${n(this.base)}${t}`:`${c(this.base)}${t}`,o(m)):r?(m=i(r)?`${n(r)}${t}`:`${c(r)}${t}`,o(m)):o(`${f}${t}`)}getStyles(){const t=this.getUrl();return Object.fromEntries(Object.entries({"mask-image":`url('${t}')`,transform:(this.scale&&!Number.isNaN(Number(this.scale))?"scale("+this.scale+")":"")+(this.rotate&&!Number.isNaN(Number(this.rotate))?" rotate("+this.rotate+"deg)":"")}).filter((([t,i])=>null!==i)))}render(){return n(o,{key:"2d49a76d0f02832caf330d3419aea80f0aefb4d1","data-version":s},n("span",{key:"bf5ee6b7fc3e7acf2b23d7787928f59b49ce73d5",style:this.getStyles()}))}get host(){return this}static get style(){return":host{display:inline-block;width:1em;height:1em;vertical-align:-0.15em}span{display:block;width:100%;height:100%;fill:currentColor;forced-color-adjust:preserve-parent-color;background-color:currentColor;mask-position:center center;mask-repeat:no-repeat;mask-size:100%}:host([flip-h]:not([flip-h=false])){scale:-1 1}:host([flip-v]:not([flip-v=false])){scale:1 -1}:host([flip-h][flip-v]:not([flip-h=false],[flip-v=false])){scale:-1}:host([animation]){transform-origin:center}:host([animation=cylon]){animation:icon-animation-cylon .75s ease-in-out infinite alternate}:host([animation=cylon-vertical]){animation:icon-animation-cylon-vertical .75s ease-in-out infinite alternate}:host([animation=spin]){animation:icon-animation-spin 2s linear infinite normal}:host([animation=spin-reverse]){animation:icon-animation-spin 2s linear infinite reverse}:host([animation=fade]){animation:icon-animation-fade .75s ease-in-out infinite alternate}:host([animation=throb]){animation:icon-animation-throb .75s ease-in-out infinite alternate}@keyframes icon-animation-cylon{from{transform:translateX(-25%)}to{transform:translateX(25%)}}@keyframes icon-animation-cylon-vertical{from{transform:translateY(25%)}to{transform:translateY(-25%)}}@keyframes icon-animation-fade{from{opacity:.1}to{opacity:1}}@keyframes icon-animation-spin{from{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes icon-animation-throb{from{opacity:.5;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}"}},[1,"post-icon",{animation:[513],base:[1],url:[1],flipH:[516,"flip-h"],flipV:[516,"flip-v"],name:[513],rotate:[2],scale:[2]}]);function p(){"undefined"!=typeof customElements&&["post-icon"].forEach((t=>{"post-icon"===t&&(customElements.get(a(t))||customElements.define(a(t),h))}))}l([r(["cylon","cylon-vertical","spin","spin-reverse","fade","throb"])],h.prototype,"animation",void 0),l([c("string")],h.prototype,"base",void 0),l([m(),c("string")],h.prototype,"name",void 0),l([c("number")],h.prototype,"rotate",void 0),l([c("number")],h.prototype,"scale",void 0);export{h as P,p as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{v as s}from"./package.js";function r(t){const e=t.closest("fieldset");return!(!e||!e.disabled)||"disabled"in t&&!!t.disabled}const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}getDirectTarget(t){for(const o of t.composedPath()){if(o instanceof HTMLSlotElement)break;if(o===this.host)break;if(o instanceof e&&o.matches("a,button,input,select,textarea,label,fieldset,optgroup,option"))return o}return null}getDelegateTarget(){return this.host.querySelector('a,label[for],input[type="checkbox"],input[type="radio"]')}dispatchClick(t){const e=this.getDirectTarget(t);if(e&&!r(e))return;const o=this.getDelegateTarget();if(!o||r(o))return;const{ctrlKey:i,shiftKey:n,altKey:s,metaKey:c,button:a}=t;o.dispatchEvent(new MouseEvent("click",{cancelable:!0,bubbles:!0,ctrlKey:i,shiftKey:n,altKey:s,metaKey:c,button:a}))}render(){return o(i,{key:"a187468c97584b393efb0f73966716947243fe1f","data-version":s,onClick:t=>this.dispatchClick(t)},o("slot",{key:"a374c748871f36acf8ceda423c121645e97a6ce1"}))}get host(){return this}static get style(){return":host{display:block;cursor:pointer;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}:host(:focus-within){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-within){outline-color:Highlight !important}}"}},[257,"post-linkarea"]),a=c,l=function(){"undefined"!=typeof customElements&&["post-linkarea"].forEach((t=>{"post-linkarea"===t&&(customElements.get(n(t))||customElements.define(n(t),c))}))};export{a as PostLinkarea,l as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{v as s}from"./package.js";function r(t){const e=t.closest("fieldset");return!(!e||!e.disabled)||"disabled"in t&&!!t.disabled}const a=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow()}getDirectTarget(t){for(const o of t.composedPath()){if(o instanceof HTMLSlotElement)break;if(o===this.host)break;if(o instanceof e&&o.matches("a,button,input,select,textarea,label,fieldset,optgroup,option"))return o}return null}getDelegateTarget(){return this.host.querySelector('a,label[for],input[type="checkbox"],input[type="radio"]')}dispatchClick(t){const e=this.getDirectTarget(t);if(e&&!r(e))return;const o=this.getDelegateTarget();if(!o||r(o))return;const{ctrlKey:i,shiftKey:n,altKey:s,metaKey:a,button:c}=t;o.dispatchEvent(new MouseEvent("click",{cancelable:!0,bubbles:!0,ctrlKey:i,shiftKey:n,altKey:s,metaKey:a,button:c}))}render(){return o(i,{key:"aa721ba7506fefd66348e09fd17ce828dec89050","data-version":s,onClick:t=>this.dispatchClick(t)},o("slot",{key:"1ad85663662fc0f6c877ff88a6570ff4d4b1fa33"}))}get host(){return this}static get style(){return":host{display:block;cursor:pointer;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}:host(:focus-within){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:focus-within){outline-color:Highlight !important}}"}},[257,"post-linkarea"]),c=a,l=function(){"undefined"!=typeof customElements&&["post-linkarea"].forEach((t=>{"post-linkarea"===t&&(customElements.get(n(t))||customElements.define(n(t),a))}))};export{c as PostLinkarea,l as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as o,createEvent as e,h as s,Host as i,transformTag as n}from"@stencil/core/internal/client";import{v as c}from"./package.js";import{d as p}from"./post-icon2.js";const a=t(class extends o{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postOptionSelected=e(this,"postOptionSelected",7),this.optionId=crypto.randomUUID(),this.selected=!1,this.highlighted=!1}render(){return s(i,{key:"38481f1a4721d50530bbd96a80ebc89933c8311c","data-version":c,role:"option","aria-selected":""+this.selected,"data-active":this.highlighted?"true":null,onPointerDown:t=>t.preventDefault(),onClick:()=>this.postOptionSelected.emit(this.value),id:"post-listbox-option-"+this.optionId},s("span",{key:"25403d2e68f44f68d5c3f2097c5aab57f90176cf",class:"option-content"},this.value,s("span",{key:"0caf89cfb81695f33637facd07dcf628fa6024a8",class:"option-description"},s("slot",{key:"857ed6d15014fb8d32f7074c9f1622d540f8ed13"}))),this.selected&&s("post-icon",{key:"3b300532591be12424a84cebd082b8c0c3ca6935","aria-hidden":"true",name:"checkmark"}))}static get style(){return":host{padding:12px 12px 9px 16px;background-color:#fff;cursor:pointer;user-select:none;display:flex;align-items:center;gap:8px;justify-content:space-between}:host(:hover){background-color:#f0efed}:host([data-active=true]){outline:2px solid #000;outline-offset:-4px}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid #050400;outline-offset:2px}.option-content{display:flex;flex-direction:column;min-width:0}.option-description{display:none;font-size:.85em;color:#666}:host(:not(:empty)) .option-description{display:block}post-icon{width:24px;height:24px}"}},[257,"post-listbox-option",{value:[513],selected:[516],highlighted:[516]}]),d=a,l=function(){"undefined"!=typeof customElements&&["post-listbox-option","post-icon"].forEach((t=>{switch(t){case"post-listbox-option":customElements.get(n(t))||customElements.define(n(t),a);break;case"post-icon":customElements.get(n(t))||p()}}))};export{d as PostListboxOption,l as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as o,h as s,Host as i,transformTag as n}from"@stencil/core/internal/client";import{v as c}from"./package.js";import{d as a}from"./post-icon2.js";const p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postOptionSelected=o(this,"postOptionSelected",7),this.optionId=crypto.randomUUID(),this.selected=!1,this.highlighted=!1}render(){return s(i,{key:"ff0e773f8a89f9df3996a83cd2be6247c1ab5475","data-version":c,role:"option","aria-selected":""+this.selected,"data-active":this.highlighted?"true":null,onPointerDown:t=>t.preventDefault(),onClick:()=>this.postOptionSelected.emit(this.value),id:"post-listbox-option-"+this.optionId},s("span",{key:"cb43e8bec5f262ae25ddfdcae1b7f9979bdd6858",class:"option-content"},this.value,s("span",{key:"5b314c41073a357185613a04a07d2020e4eab300",class:"option-description"},s("slot",{key:"ac1ed1be98f9a348952c0169d7ec89f8aaa99474"}))),this.selected&&s("post-icon",{key:"7691085df732c0c2c5db9824587d54047017adf5","aria-hidden":"true",name:"checkmark"}))}static get style(){return":host{padding:12px 12px 9px 16px;background-color:#fff;cursor:pointer;user-select:none;display:flex;align-items:center;gap:8px;justify-content:space-between}:host(:hover){background-color:#f0efed}:host([data-active=true]){outline:2px solid #000;outline-offset:-4px}:host([hidden]){display:none}:host(:focus-visible){outline:2px solid #050400;outline-offset:2px}.option-content{display:flex;flex-direction:column;min-width:0}.option-description{display:none;font-size:.85em;color:#666}:host(:not(:empty)) .option-description{display:block}post-icon{width:24px;height:24px}"}},[257,"post-listbox-option",{value:[513],selected:[516],highlighted:[516]}]),d=p,l=function(){"undefined"!=typeof customElements&&["post-listbox-option","post-icon"].forEach((t=>{switch(t){case"post-listbox-option":customElements.get(n(t))||customElements.define(n(t),p);break;case"post-icon":customElements.get(n(t))||a()}}))};export{d as PostListboxOption,l as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as o,transformTag as n}from"@stencil/core/internal/client";import"./breakpoints.js";import{E as c}from"./event-from.js";import{v as h}from"./package.js";import{d as a}from"./post-popovercontainer2.js";const r=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postOptionActive=e(this,"postOptionActive",7),this.highlightedIndex=-1,this.visibleOptions=[],this.diacriticPattern=/[\u0300-\u036F]/u,this.registerOptions=()=>{this.visibleOptions=this.options},this.updateSelection=t=>{this.options.forEach((s=>{s.selected=s.value===t,s.highlighted=!1})),this.highlightedIndex=-1,this.clearActive()},this.clearActive=()=>{this.highlightedIndex=-1,this.postOptionActive.emit(null)},this.normalizeText=t=>t.trim().normalize("NFD").replace(this.diacriticPattern,"").toLocaleLowerCase(),this.resetFilter=()=>{this.visibleOptions=this.options,this.options.forEach((t=>{t.hidden=!1,t.highlighted=!1}))}}get options(){return Array.from(this.host.querySelectorAll("post-listbox-option"))}get inputElement(){let t=this.host.closest("post-autocomplete");return t||(t=document.querySelector(`post-autocomplete[listbox="${this.host.id}"]`)),t?.querySelector("input")}componentWillLoad(){this.registerOptions()}async show(){const t=this.inputElement;t&&this.popoverContainer?.show(t)}async hide(){this.popoverContainer?.hide()}async filter(t){const s=this.normalizeText(t);s?this.visibleOptions=this.options.filter((t=>{const e=this.normalizeText(t.textContent),i=this.normalizeText(t.value).includes(s)||e.includes(s);return t.hidden=!i,i})):this.resetFilter(),this.clearActive()}async clearSelection(){this.updateSelection()}async navigate(t){if(0===this.visibleOptions.length)return;switch(this.highlightedIndex>=0&&(this.visibleOptions[this.highlightedIndex].highlighted=!1),t){case"first":this.highlightedIndex=0;break;case"last":this.highlightedIndex=this.visibleOptions.length-1;break;case"up":this.highlightedIndex=(this.highlightedIndex-1+this.visibleOptions.length)%this.visibleOptions.length;break;case"down":this.highlightedIndex=(this.highlightedIndex+1)%this.visibleOptions.length}const s=this.visibleOptions[this.highlightedIndex];s.scrollIntoView({behavior:"smooth",block:"end"}),s.highlighted=!0,this.postOptionActive.emit(s.id)}async selectActive(){if(this.highlightedIndex>=0){const t=this.visibleOptions[this.highlightedIndex];this.updateSelection(t.value),this.host.dispatchEvent(new CustomEvent("postOptionSelected",{bubbles:!0,detail:t.value}))}}optionClicked(t){this.updateSelection(t.detail)}render(){return i(o,{key:"a59296af752a3f88bcd70663d0ce12f61718e92f","data-version":h,role:"listbox"},i("post-popovercontainer",{key:"665dd563705515022edc79a4d98e9ac43b80c525",placement:"bottom-start",ref:t=>this.popoverContainer=t},i("slot",{key:"d8a37fd905dfaca07286913a0c680e61744d65e1",name:"blank-slate"}),i("slot",{key:"22e367ae36329d0586e1a275692983cf0c004df4"})))}get host(){return this}static get style(){return"post-popovercontainer{border-radius:4px;overflow:hidden;box-shadow:var(--post-device-elevation-300)}div[role=listbox]{max-height:384px;overflow:auto;display:flex;flex-direction:column}"}},[257,"post-listbox",{show:[64],hide:[64],filter:[64],clearSelection:[64],navigate:[64],selectActive:[64]},[[0,"postOptionSelected","optionClicked"]]]);!function(t,s,e,i){var o,n=arguments.length,c=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(c=(n<3?o(c):n>3?o(s,e,c):o(s,e))||c);n>3&&c&&Object.defineProperty(s,e,c)}([c("post-listbox-option")],r.prototype,"optionClicked",null);const l=r,p=function(){"undefined"!=typeof customElements&&["post-listbox","post-popovercontainer"].forEach((t=>{switch(t){case"post-listbox":customElements.get(n(t))||customElements.define(n(t),r);break;case"post-popovercontainer":customElements.get(n(t))||a()}}))};export{l as PostListbox,p as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as s,createEvent as e,h as i,Host as o,transformTag as n}from"@stencil/core/internal/client";import"./breakpoints.js";import{E as c}from"./event-from.js";import{v as h}from"./package.js";import{d as r}from"./post-popovercontainer2.js";const a=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postOptionActive=e(this,"postOptionActive",7),this.highlightedIndex=-1,this.visibleOptions=[],this.diacriticPattern=/[\u0300-\u036F]/u,this.registerOptions=()=>{this.visibleOptions=this.options},this.updateSelection=t=>{this.options.forEach((s=>{s.selected=s.value===t,s.highlighted=!1})),this.highlightedIndex=-1,this.clearActive()},this.clearActive=()=>{this.highlightedIndex=-1,this.postOptionActive.emit(null)},this.normalizeText=t=>t.trim().normalize("NFD").replace(this.diacriticPattern,"").toLocaleLowerCase(),this.resetFilter=()=>{this.visibleOptions=this.options,this.options.forEach((t=>{t.hidden=!1,t.highlighted=!1}))}}get options(){return Array.from(this.host.querySelectorAll("post-listbox-option"))}get inputElement(){let t=this.host.closest("post-autocomplete");return t||(t=document.querySelector(`post-autocomplete[listbox="${this.host.id}"]`)),t?.querySelector("input")}componentWillLoad(){this.registerOptions()}async show(){const t=this.inputElement;t&&this.popoverContainer?.show(t)}async hide(){this.popoverContainer?.hide()}async filter(t){const s=this.normalizeText(t);s?this.visibleOptions=this.options.filter((t=>{const e=this.normalizeText(t.textContent),i=this.normalizeText(t.value).includes(s)||e.includes(s);return t.hidden=!i,i})):this.resetFilter(),this.clearActive()}async clearSelection(){this.updateSelection()}async navigate(t){if(0===this.visibleOptions.length)return;switch(this.highlightedIndex>=0&&(this.visibleOptions[this.highlightedIndex].highlighted=!1),t){case"first":this.highlightedIndex=0;break;case"last":this.highlightedIndex=this.visibleOptions.length-1;break;case"up":this.highlightedIndex=(this.highlightedIndex-1+this.visibleOptions.length)%this.visibleOptions.length;break;case"down":this.highlightedIndex=(this.highlightedIndex+1)%this.visibleOptions.length}const s=this.visibleOptions[this.highlightedIndex];s.scrollIntoView({behavior:"smooth",block:"end"}),s.highlighted=!0,this.postOptionActive.emit(s.id)}async selectActive(){if(this.highlightedIndex>=0){const t=this.visibleOptions[this.highlightedIndex];this.updateSelection(t.value),this.host.dispatchEvent(new CustomEvent("postOptionSelected",{bubbles:!0,detail:t.value}))}}optionClicked(t){this.updateSelection(t.detail)}render(){return i(o,{key:"845f11b5c19b41226884c26a7e3859af21587e26","data-version":h,role:"listbox"},i("post-popovercontainer",{key:"21b107869f854ddcf7915b67060cc33ef7c48af3",placement:"bottom-start",ref:t=>this.popoverContainer=t},i("slot",{key:"2e7d6af9eb461c2f5110f0785ca656fa6b96f72e",name:"blank-slate"}),i("slot",{key:"3bef18fa1cc03f93335e99cb85f4f3d2b0461c33"})))}get host(){return this}static get style(){return"post-popovercontainer{border-radius:4px;overflow:hidden;box-shadow:var(--post-device-elevation-300)}post-popovercontainer::part(post-popovercontainer-content){flex-direction:column}"}},[257,"post-listbox",{show:[64],hide:[64],filter:[64],clearSelection:[64],navigate:[64],selectActive:[64]},[[0,"postOptionSelected","optionClicked"]]]);!function(t,s,e,i){var o,n=arguments.length,c=n<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(t,s,e,i);else for(var h=t.length-1;h>=0;h--)(o=t[h])&&(c=(n<3?o(c):n>3?o(s,e,c):o(s,e))||c);n>3&&c&&Object.defineProperty(s,e,c)}([c("post-listbox-option")],a.prototype,"optionClicked",null);const p=a,l=function(){"undefined"!=typeof customElements&&["post-listbox","post-popovercontainer"].forEach((t=>{switch(t){case"post-listbox":customElements.get(n(t))||customElements.define(n(t),a);break;case"post-popovercontainer":customElements.get(n(t))||r()}}))};export{p as PostListbox,l as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as o,HTMLElement as e,h as t,Host as i,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as c}from"./package.js";import{U as l}from"./url.js";const r=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow()}componentDidLoad(){this.checkDescription()}checkDescription(){this.host.textContent||console.warn("Be sure to add descriptive text in the post-logo to ensure good accessibility of the component.")}render(){const o=this.url&&("string"==typeof this.url?this.url:this.url.href);return t(i,{key:"1f69b0ddc0ecf2fde47423cd7824fcbe76e4a529","data-version":c},t(o?"a":"span",{key:"096736bd50a6dd43e02a104e7e81897cb286db60",class:"logo "+(o?"logo-link":""),...o?{href:o}:{}},t("span",{key:"bc49b9591424f02744f771eb1079911f02ceca33",class:"description"},t("slot",{key:"ea905eac805e2a9940bfe50aa222bef738d15d27",onSlotchange:()=>this.checkDescription()})),t("svg",{key:"482d94c38347017269dabd0ab3d15f4ede14f187",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 72 72","aria-hidden":"true"},t("g",{key:"fcd3dc56e8a0e448abe65b557639a8bea8ca580f",id:"Logo"},t("rect",{key:"11ed7bad596ee07301f1c1101ddded089ef2bf99",fill:"#ffcc00",x:"0",y:"0",width:"72",height:"72"}),t("polygon",{key:"6ab9d28c8492c746a2620cff62dbd92a59a00aff",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"}),t("path",{key:"8b96cee7ee8ad1ec3c22aaf7928f7a711c05c828",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"})))))}get host(){return this}static get style(){return":host,.logo{display:inline-block}:host,:host .logo>svg,.logo,.logo .logo>svg{height:100%}.description{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.logo-link{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}.logo-link:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.logo-link:focus-visible{outline-color:Highlight !important}}.logo-link.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){.logo-link.pretend-focus{outline-color:Highlight !important}}.logo-link:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.logo-link:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.logo-link: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){.logo-link:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.logo-link{outline-offset:var(--post-device-spacing-padding-28) !important}.logo-link:focus,.logo-link:focus-visible{border-radius:var(--post-device-border-radius-focus)}"}},[257,"post-logo",{url:[1]}]);!function(o,e,t,i){var s,c=arguments.length,l=c<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(o,e,t,i);else for(var r=o.length-1;r>=0;r--)(s=o[r])&&(l=(c<3?s(l):c>3?s(e,t,l):s(e,t))||l);c>3&&l&&Object.defineProperty(e,t,l)}([l()],r.prototype,"url",void 0);const n=r,a=function(){"undefined"!=typeof customElements&&["post-logo"].forEach((o=>{"post-logo"===o&&(customElements.get(s(o))||customElements.define(s(o),r))}))};export{n as PostLogo,a as defineCustomElement}
1
+ import{proxyCustomElement as o,HTMLElement as e,h as t,Host as i,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as c}from"./package.js";import{U as l}from"./url.js";const r=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow()}componentDidLoad(){this.checkDescription()}checkDescription(){this.host.textContent||console.warn("Be sure to add descriptive text in the post-logo to ensure good accessibility of the component.")}render(){const o=this.url&&("string"==typeof this.url?this.url:this.url.href);return t(i,{key:"84ece8e71d7dec66aa634d9a8a37d6bf3197c1b6","data-version":c},t(o?"a":"span",{key:"1531c6e8f32d42e63f5482d2983f18e4c9a23b1a",class:"logo "+(o?"logo-link":""),...o?{href:o}:{}},t("span",{key:"d45d33329e30de0de9de56f2d588995a7f97d01e",class:"description"},t("slot",{key:"e8665c8d739dc2a2968bf1193c26ba1d1e731b38",onSlotchange:()=>this.checkDescription()})),t("svg",{key:"bb3f534952e29e2e43816c5a5dd55541d05bee26",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 72 72","aria-hidden":"true"},t("g",{key:"9ca05c263f6c9f41cc5406ccfd030a713ffe0254",id:"Logo"},t("rect",{key:"30a59adc0eec11af2d90180da1f5a95b03175d21",fill:"#ffcc00",x:"0",y:"0",width:"72",height:"72"}),t("polygon",{key:"b1cbe7c575d36cf26a1cc41c9124625c2d1e5ef1",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"}),t("path",{key:"398027f23c8c9a4cf2bc7f8d7c8aa4ec0466f0be",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"})))))}get host(){return this}static get style(){return":host,.logo{display:inline-block}:host,:host .logo>svg,.logo,.logo .logo>svg{height:100%}.description{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);border:0}.logo-link{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}.logo-link:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.logo-link:focus-visible{outline-color:Highlight !important}}.logo-link.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){.logo-link.pretend-focus{outline-color:Highlight !important}}.logo-link:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.logo-link:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.logo-link: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){.logo-link:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}.logo-link{outline-offset:var(--post-device-spacing-padding-28) !important}.logo-link:focus,.logo-link:focus-visible{border-radius:var(--post-device-border-radius-focus)}"}},[257,"post-logo",{url:[1]}]);!function(o,e,t,i){var s,c=arguments.length,l=c<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(o,e,t,i);else for(var r=o.length-1;r>=0;r--)(s=o[r])&&(l=(c<3?s(l):c>3?s(e,t,l):s(e,t))||l);c>3&&l&&Object.defineProperty(e,t,l)}([l()],r.prototype,"url",void 0);const n=r,a=function(){"undefined"!=typeof customElements&&["post-logo"].forEach((o=>{"post-logo"===o&&(customElements.get(s(o))||customElements.define(s(o),r))}))};export{n as PostLogo,a as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as i,Host as s,transformTag as o}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as n}from"./package.js";import{d as r}from"./post-icon2.js";import{R as a}from"./required.js";import{T as l}from"./type.js";const c=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.canScrollLeft=!1,this.canScrollRight=!1,this.scrollRight=this.scrollRight.bind(this),this.scrollLeft=this.scrollLeft.bind(this),this.checkScrollability=this.checkScrollability.bind(this),this.resizeObserver=new ResizeObserver(this.checkScrollability),this.mutationObserver=new MutationObserver(this.checkScrollability)}componentDidLoad(){setTimeout((()=>{this.checkScrollability()})),this.resizeObserver.observe(this.navbar),this.mutationObserver.observe(this.navbar,{subtree:!0,childList:!0}),this.navbar?.addEventListener("scrollend",this.checkScrollability)}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.disconnect(),this.navbar?.removeEventListener("scrollend",this.checkScrollability)}stopScrolling(){this.scrollRepeatInterval&&clearInterval(this.scrollRepeatInterval)}get navigationItems(){return Array.from(this.host.querySelectorAll("a:not(post-megadropdown *), post-megadropdown-trigger"))}get canScroll(){return this.canScrollLeft||this.canScrollRight}checkScrollability(){const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.navbar;e===i?this.canScrollLeft=this.canScrollRight=!1:(this.canScrollLeft=Math.floor(t)>0,this.canScrollRight=Math.ceil(i+t)<e)}handleScrollButtonClick(t,e){if(!this.canScroll||0!==t.button)return;this.temporarilyDisableNavbar();const i="right"===e?this.scrollRight:this.scrollLeft;i(),this.scrollRepeatInterval=setInterval((()=>{i()}),100)}scrollRight(){const t=this.host.shadowRoot.querySelector(".scroll-right").getBoundingClientRect().left;for(const e of this.navigationItems){const{right:i,width:s}=e.getBoundingClientRect();if(!(i-.25*s<t))return void this.navbar.scrollBy({left:i-t})}}scrollLeft(){const t=this.host.shadowRoot.querySelector(".scroll-left").getBoundingClientRect().right;for(const e of this.navigationItems.reverse()){const{left:i,width:s}=e.getBoundingClientRect();if(!(i+.25*s>t))return void this.navbar.scrollBy({left:i-t})}}temporarilyDisableNavbar(){this.navbarDisableTimer&&clearTimeout(this.navbarDisableTimer),this.navbar.setAttribute("inert",""),this.navbarDisableTimer=setTimeout((()=>{this.navbar.removeAttribute("inert")}),400)}render(){return i(s,{key:"cf7b2328a41b41ca28956120b8042590655e7bb2",version:n,class:this.canScroll?"scrollable":""},i("div",{key:"a25c55cf7b11a11ce86fb134dd57dbdad3d30301","aria-hidden":"true",class:{"scroll-control scroll-left":!0,"d-none":!this.canScrollLeft},onMouseDown:t=>this.handleScrollButtonClick(t,"left")},i("post-icon",{key:"013778591637d5ee0ac2cd2bf3f23c677ba2a13f","aria-hidden":"true",name:"chevronleft"})),i("nav",{key:"a007b7be57429580de35865e5eff0c54378d0a8e",ref:t=>this.navbar=t,"aria-label":this.textMain},i("slot",{key:"bc8e1db18430ee43b5963539fbaa65e1fb1b0c55"})),i("div",{key:"cdb413fedc9a90c712db0fe5d6ab760a426ff632","aria-hidden":"true",class:{"scroll-control scroll-right":!0,"d-none":!this.canScrollRight},onMouseDown:t=>this.handleScrollButtonClick(t,"right")},i("post-icon",{key:"b2df569a79881b3a044556ba9c0f2e2b0646e78b","aria-hidden":"true",name:"chevronright"})))}get host(){return this}static get style(){return":host{display:flex;user-select:none;max-width:var(--post-header-content-max-width)}@media screen and (min-width: 1024px){:host{width:fit-content;margin-inline-start:calc(-1*var(--post-local-header-padding-inline-start));margin-inline-end:calc(-1*var(--post-local-header-padding-inline-end));overflow:hidden}}nav{flex:1 1 auto}@media screen and (min-width: 1024px){nav{scroll-behavior:smooth;max-width:100vw;overflow:hidden;height:var(--post-main-navigation-height)}}.scroll-control{z-index:1;cursor:pointer;padding:16px;background:#fff;box-shadow:var(--post-device-elevation-500);line-height:1}.scroll-control.scroll-left{margin-inline-end:-48px}.scroll-control.scroll-right{margin-inline-start:-48px}.scroll-control.d-none{display:none}.scroll-control post-icon{font-size:16px}"}},[257,"post-mainnavigation",{textMain:[513,"text-main"],canScrollLeft:[32],canScrollRight:[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]]);!function(t,e,i,s){var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);n>3&&r&&Object.defineProperty(e,i,r)}([a(),l("string")],c.prototype,"textMain",void 0);const h=c,d=function(){"undefined"!=typeof customElements&&["post-mainnavigation","post-icon"].forEach((t=>{switch(t){case"post-mainnavigation":customElements.get(o(t))||customElements.define(o(t),c);break;case"post-icon":customElements.get(o(t))||r()}}))};export{h as PostMainnavigation,d as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as i,Host as o,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as r}from"./package.js";import{d as n}from"./post-icon2.js";import{R as c}from"./required.js";import{T as l}from"./type.js";const a=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.canScrollLeft=!1,this.canScrollRight=!1,this.scrollRight=this.scrollRight.bind(this),this.scrollLeft=this.scrollLeft.bind(this),this.checkScrollability=this.checkScrollability.bind(this),this.resizeObserver=new ResizeObserver(this.checkScrollability),this.mutationObserver=new MutationObserver(this.checkScrollability)}componentDidLoad(){setTimeout((()=>{this.checkScrollability()})),this.resizeObserver.observe(this.navbar),this.mutationObserver.observe(this.navbar,{subtree:!0,childList:!0}),this.navbar?.addEventListener("scrollend",this.checkScrollability)}disconnectedCallback(){this.mutationObserver.disconnect(),this.resizeObserver.disconnect(),this.navbar?.removeEventListener("scrollend",this.checkScrollability)}stopScrolling(){this.scrollRepeatInterval&&clearInterval(this.scrollRepeatInterval)}get navigationItems(){return Array.from(this.host.querySelectorAll("a:not(post-megadropdown *), post-megadropdown-trigger"))}get canScroll(){return this.canScrollLeft||this.canScrollRight}checkScrollability(){const{scrollLeft:t,scrollWidth:e,clientWidth:i}=this.navbar;e===i?this.canScrollLeft=this.canScrollRight=!1:(this.canScrollLeft=Math.floor(t)>0,this.canScrollRight=Math.ceil(i+t)<e)}handleScrollButtonClick(t,e){if(!this.canScroll||0!==t.button)return;this.temporarilyDisableNavbar();const i="right"===e?this.scrollRight:this.scrollLeft;i(),this.scrollRepeatInterval=setInterval((()=>{i()}),100)}scrollRight(){const t=this.host.shadowRoot.querySelector(".scroll-right").getBoundingClientRect().left;for(const e of this.navigationItems){const{right:i,width:o}=e.getBoundingClientRect();if(!(i-.25*o<t))return void this.navbar.scrollBy({left:i-t})}}scrollLeft(){const t=this.host.shadowRoot.querySelector(".scroll-left").getBoundingClientRect().right;for(const e of this.navigationItems.reverse()){const{left:i,width:o}=e.getBoundingClientRect();if(!(i+.25*o>t))return void this.navbar.scrollBy({left:i-t})}}temporarilyDisableNavbar(){this.navbarDisableTimer&&clearTimeout(this.navbarDisableTimer),this.navbar.setAttribute("inert",""),this.navbarDisableTimer=setTimeout((()=>{this.navbar.removeAttribute("inert")}),400)}render(){return i(o,{key:"2e9f2361426298f620411b1d064e166992ba326e",version:r,class:this.canScroll?"scrollable":""},i("div",{key:"10103d153e37fd591c2ce062ef7455228adbf5b9","aria-hidden":"true",class:{"scroll-control scroll-left":!0,"d-none":!this.canScrollLeft},onMouseDown:t=>this.handleScrollButtonClick(t,"left")},i("post-icon",{key:"8bb9b82626d05c1fe8f4fd1bb9f8e6d6be59ad8a","aria-hidden":"true",name:"chevronleft"})),i("nav",{key:"6905afe8c2dfcf0f2411b45237b52d63f187d2c9",ref:t=>this.navbar=t,"aria-label":this.textMain},i("slot",{key:"2db905e52b1604d9c6097734d055100a58625f09"})),i("div",{key:"f8ec4f906f1c99fec2198bb350ac1735c2de8469","aria-hidden":"true",class:{"scroll-control scroll-right":!0,"d-none":!this.canScrollRight},onMouseDown:t=>this.handleScrollButtonClick(t,"right")},i("post-icon",{key:"afed8c1778691ca5b849d78ee20d51a4b8c02fe6","aria-hidden":"true",name:"chevronright"})))}get host(){return this}static get style(){return":host{display:flex;user-select:none;max-width:var(--post-header-content-max-width)}@media screen and (min-width: 1024px){:host{width:fit-content;margin-inline-start:calc(-1*var(--post-local-header-padding-inline-start));margin-inline-end:calc(-1*var(--post-local-header-padding-inline-end));overflow:hidden}}nav{flex:1 1 auto}@media screen and (min-width: 1024px){nav{scroll-behavior:smooth;max-width:100vw;overflow:hidden;height:var(--post-main-navigation-height)}}.scroll-control{z-index:1;cursor:pointer;padding:16px;background:#fff;box-shadow:var(--post-device-elevation-500);line-height:1}.scroll-control:hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}.scroll-control.scroll-left{margin-inline-end:-48px}.scroll-control.scroll-right{margin-inline-start:-48px}.scroll-control.d-none{display:none}.scroll-control post-icon{font-size:16px}"}},[257,"post-mainnavigation",{textMain:[513,"text-main"],canScrollLeft:[32],canScrollRight:[32]},[[9,"mouseup","stopScrolling"],[9,"mouseleave","stopScrolling"]]]);!function(t,e,i,o){var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,i,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);r>3&&n&&Object.defineProperty(e,i,n)}([c(),l("string")],a.prototype,"textMain",void 0);const h=a,d=function(){"undefined"!=typeof customElements&&["post-mainnavigation","post-icon"].forEach((t=>{switch(t){case"post-mainnavigation":customElements.get(s(t))||customElements.define(s(t),a);break;case"post-icon":customElements.get(s(t))||n()}}))};export{h as PostMainnavigation,d as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,Build as o,h as r,Host as i,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{E as n}from"./event-from.js";import{v as a}from"./package.js";import{d as c}from"./post-icon2.js";import{R as d}from"./required.js";import{T as l}from"./type.js";var p=function(t,e,o,r){var i,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(s<3?i(n):s>3?i(e,o,n):i(e,o))||n);return s>3&&n&&Object.defineProperty(e,o,n),n};const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isMegadropdownExpanded=!1,this.slottedContent=null,this.active=!1}componentWillRender(){this.handleSlottedContentChanges()}disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect()}onMegadropdownToggled(t){if(t.target.id===this.for){const e=this.isMegadropdownExpanded;if(this.isMegadropdownExpanded=t.detail.isVisible,!e||this.isMegadropdownExpanded||!t.detail.focusParent)return;setTimeout((()=>{this.interactiveButton.focus()}),100)}}get megadropdown(){const t=document.getElementById(this.for);return"post-megadropdown"!==t?.localName?(console.warn("No post-megadropdown found with ID: "+this.for),null):t}handleSlottedContentChanges(){o.isServer||(this.cloneSlottedButton(),this.mutationObserver=new MutationObserver(this.cloneSlottedButton.bind(this)),this.mutationObserver.observe(this.host,{childList:!0,subtree:!0}))}cloneSlottedButton(){this.slottedContent=this.host.innerHTML}onClick(){this.megadropdown?.toggle()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||this.megadropdown&&(t.preventDefault(),this.megadropdown.toggle())}render(){return r(i,{key:"7e6201e3cdea96113bbebdeeb805acff557c8bbb","data-version":a},r("button",{key:"1863f48dbd6e98b7a2b226b7c3b25b16a38c644b",ref:t=>this.interactiveButton=t,type:"button","aria-haspopup":"menu","aria-expanded":""+this.isMegadropdownExpanded,onClick:this.onClick.bind(this),onKeyDown:this.onKeyDown.bind(this),class:{active:this.active}},r("span",{key:"dee7e77e45914a3e40a9f5027570bef0035dfdf2"},r("span",{key:"362865f7946f14f45ecdb240e81f09370e3f6d10",innerHTML:this.slottedContent}),r("span",{key:"d61eb63433aa65631f787646df2c6705c3d6e7a1","aria-hidden":"true"},r("slot",{key:"c831f7299fe3c80b8229c861e01e09a2ee481bc8"}))),r("post-icon",{key:"bcc8ed53293e16d4571e989a491760f98425b298",name:"chevrondown"})))}get host(){return this}static get style(){return'button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:4px 10px;gap:6px;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg)}button:not(:disabled):hover{text-decoration:none}button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}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}button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:focus-visible{outline-color:Highlight !important}}button.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){button.pretend-focus{outline-color:Highlight !important}}button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){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){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button{border-width:1px !important;transition:none}button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}button{--post-nav-item-border-width:1px;width:100%;justify-content:start;position:relative;padding:12px 12px calc(12px - var(--post-nav-item-border-width)) 8px;gap:16px;border-radius:0;line-height:1.5;outline-color:currentColor !important;border-bottom:var(--post-nav-item-border-width) solid currentColor;height:100%}button:hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);border-bottom-color:rgba(0,0,0,0)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:none}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}button:focus-visible{outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button:focus-visible::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:focus-visible:hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:focus-visible:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:focus-visible{outline-color:Highlight !important}}button.pretend-focus{outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button.pretend-focus::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button.pretend-focus:hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button.pretend-focus:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button.pretend-focus{outline-color:Highlight !important}}button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button:has(:focus-visible)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:has(:focus-visible):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:has(:focus-visible):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button:is(:focus-visible,:focus-within,.pretend-focus)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:is(:focus-visible,:focus-within,.pretend-focus):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:is(:focus-visible,:focus-within,.pretend-focus):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}button>post-icon:where(:last-child){margin-inline-start:auto}@media screen and (min-width: 0)and (max-width: 599.98px){button{padding:9.5px 12px calc(9.5px - var(--post-nav-item-border-width)) 8px;gap:8px;font-size:.875rem}button>post-icon{font-size:1rem}}@media screen and (min-width: 600px)and (max-width: 1023.98px){button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){button{padding:16px 12px;gap:8px;border-bottom:0}}:host{position:relative;display:inline-block}button post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}button>span{position:relative}button>span>span[aria-hidden]{font-weight:700;visibility:hidden}button>span>span[aria-hidden]:where(span:empty+*){visibility:visible}button>span>span:not([aria-hidden]){position:absolute;inset:0}@media screen and (min-width: 1024px){button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){font-weight:700}button[aria-expanded=true]{background-color:#f0efed;color:#050400;z-index:2}button[aria-expanded=true]:hover{box-shadow:inset 0 -0.7px 0 0 #f0efed}button[aria-expanded=true]{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}button[aria-expanded=true]:focus-visible{outline-style:var(--post-core-border-style-solid) !important}button[aria-expanded=true]:focus-visible::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true]:focus-visible{outline-color:Highlight !important}}@media screen and (min-width: 1024px){button[aria-expanded=true].pretend-focus{outline-style:var(--post-core-border-style-solid) !important}button[aria-expanded=true].pretend-focus::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true].pretend-focus{outline-color:Highlight !important}}@media screen and (min-width: 1024px){button[aria-expanded=true]:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}button[aria-expanded=true]:has(:focus-visible)::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true]:has(:focus-visible){outline-color:Highlight !important}}@media screen and (min-width: 1024px){@supports not selector(:has(:focus-visible)){button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important}button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus)::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}}@media screen and (max-width: 1023.98px){button post-icon{margin-inline-start:auto;transform:rotate(-90deg) !important}}'}},[257,"post-megadropdown-trigger",{active:[516],for:[513],isMegadropdownExpanded:[32],slottedContent:[32]},[[4,"postToggleMegadropdown","onMegadropdownToggled"]]]);p([d(),l("string")],u.prototype,"for",void 0),p([n("post-megadropdown",{ignoreNestedComponents:!1})],u.prototype,"onMegadropdownToggled",null);const b=u,h=function(){"undefined"!=typeof customElements&&["post-megadropdown-trigger","post-icon"].forEach((t=>{switch(t){case"post-megadropdown-trigger":customElements.get(s(t))||customElements.define(s(t),u);break;case"post-icon":customElements.get(s(t))||c()}}))};export{b as PostMegadropdownTrigger,h as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,Build as o,h as r,Host as i,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{E as n}from"./event-from.js";import{v as a}from"./package.js";import{d as c}from"./post-icon2.js";import{R as d}from"./required.js";import{T as l}from"./type.js";var p=function(t,e,o,r){var i,s=arguments.length,n=s<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(s<3?i(n):s>3?i(e,o,n):i(e,o))||n);return s>3&&n&&Object.defineProperty(e,o,n),n};const u=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isMegadropdownExpanded=!1,this.slottedContent=null,this.active=!1}componentWillRender(){this.handleSlottedContentChanges()}disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect()}onMegadropdownToggled(t){if(t.target.id===this.for){const e=this.isMegadropdownExpanded;if(this.isMegadropdownExpanded=t.detail.isVisible,!e||this.isMegadropdownExpanded||!t.detail.focusParent)return;setTimeout((()=>{this.interactiveButton.focus()}),100)}}get megadropdown(){const t=document.getElementById(this.for);return"post-megadropdown"!==t?.localName?(console.warn("No post-megadropdown found with ID: "+this.for),null):t}handleSlottedContentChanges(){o.isServer||(this.cloneSlottedButton(),this.mutationObserver=new MutationObserver(this.cloneSlottedButton.bind(this)),this.mutationObserver.observe(this.host,{childList:!0,subtree:!0}))}cloneSlottedButton(){this.slottedContent=this.host.innerHTML}onClick(){this.megadropdown?.toggle()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||this.megadropdown&&(t.preventDefault(),this.megadropdown.toggle())}render(){return r(i,{key:"40d8afcb6b0ec482c0a13f7b78493a66243e03a5","data-version":a},r("button",{key:"6c1362cd4e1af22d26cf9ae74af4092cd083360c",ref:t=>this.interactiveButton=t,type:"button","aria-haspopup":"menu","aria-expanded":""+this.isMegadropdownExpanded,onClick:this.onClick.bind(this),onKeyDown:this.onKeyDown.bind(this),class:{active:this.active}},r("span",{key:"6bd7d94da2055c1c6fb933402f2478a3cee12cc7"},r("span",{key:"8109bdcc23c4a0f8c0861b774a974dde75b464f3",innerHTML:this.slottedContent}),r("span",{key:"edd54adde0d7af4eb9cf7796183d01705d217500","aria-hidden":"true"},r("slot",{key:"dbcc08bb882273f1074dd8963a4b86f67deb0c0a"}))),r("post-icon",{key:"7437573a492181cc3e5ddd59ac3695dc94d43e09",name:"chevrondown"})))}get host(){return this}static get style(){return'button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;border:unset;font-weight:unset;display:flex;padding:4px 10px;gap:6px;font-size:1rem;border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg)}button:not(:disabled):hover{text-decoration:none}button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}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}button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:focus-visible{outline-color:Highlight !important}}button.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){button.pretend-focus{outline-color:Highlight !important}}button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){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){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button{border-width:1px !important;transition:none}button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:var(--post-device-elevation-100);border-color:var(--post-scheme-color-interactive-button-primary-enabled-stroke);color:var(--post-scheme-color-interactive-button-primary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-primary-enabled-bg)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active):hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg)}button{--post-nav-item-border-width:1px;width:100%;justify-content:start;position:relative;padding:12px 12px calc(12px - var(--post-nav-item-border-width)) 8px;gap:16px;border-radius:0;line-height:1.5;outline-color:currentColor !important;border-bottom:var(--post-nav-item-border-width) solid currentColor;height:100%}button:hover{border-color:var(--post-scheme-color-interactive-button-primary-hover-stroke);color:var(--post-scheme-color-interactive-button-primary-hover-fg);background-color:var(--post-scheme-color-interactive-button-primary-hover-bg);border-bottom-color:rgba(0,0,0,0)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){box-shadow:none}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}button:focus-visible{outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button:focus-visible::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:focus-visible:hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:focus-visible:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:focus-visible{outline-color:Highlight !important}}button.pretend-focus{outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button.pretend-focus::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button.pretend-focus:hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button.pretend-focus:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button.pretend-focus{outline-color:Highlight !important}}button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button:has(:focus-visible)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:has(:focus-visible):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:has(:focus-visible):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){button:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline:none !important}button:is(:focus-visible,:focus-within,.pretend-focus)::after{content:"";position:absolute;inset:calc(-1*var(--post-device-spacing-padding-28));border-width:var(--post-device-border-width-focus);border-style:var(--post-core-border-style-solid);border-color:var(--post-scheme-color-interactive-focus-stroke);border-radius:var(--post-device-border-radius-focus);pointer-events:none}button:is(:focus-visible,:focus-within,.pretend-focus):hover::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}button:is(:focus-visible,:focus-within,.pretend-focus):is([aria-current],[aria-pressed=true],[aria-expanded=true],.active)::after{border-color:var(--post-scheme-color-interactive-focus-stroke-inverted)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}button>post-icon:where(:last-child){margin-inline-start:auto}@media screen and (min-width: 0)and (max-width: 599.98px){button{padding:9.5px 12px calc(9.5px - var(--post-nav-item-border-width)) 8px;gap:8px;font-size:.875rem}button>post-icon{font-size:1rem}}@media screen and (min-width: 600px)and (max-width: 1023.98px){button>post-icon{font-size:1.5rem}}@media screen and (min-width: 1024px){button{padding:16px 12px;gap:8px;border-bottom:0}}:host{position:relative;display:inline-block}button post-icon{transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1)}button:is([aria-current],[aria-pressed=true],[aria-expanded=true]) post-icon{transform:rotate(180deg)}button>span{position:relative}button>span>span[aria-hidden]{font-weight:700;visibility:hidden}button>span>span[aria-hidden]:where(span:empty+*){visibility:visible}button>span>span:not([aria-hidden]){position:absolute;inset:0}@media screen and (min-width: 1024px){button:is([aria-current],[aria-pressed=true],[aria-expanded=true],.active){font-weight:700}button[aria-expanded=true]{background-color:#f0efed;color:#050400;z-index:2}button[aria-expanded=true]:hover{box-shadow:inset 0 -0.7px 0 0 #f0efed}button[aria-expanded=true]{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}button[aria-expanded=true]:focus-visible{outline-style:var(--post-core-border-style-solid) !important;outline-style:none !important}button[aria-expanded=true]:focus-visible::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true]:focus-visible{outline-color:Highlight !important}}@media screen and (min-width: 1024px){button[aria-expanded=true].pretend-focus{outline-style:var(--post-core-border-style-solid) !important;outline-style:none !important}button[aria-expanded=true].pretend-focus::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true].pretend-focus{outline-color:Highlight !important}}@media screen and (min-width: 1024px){button[aria-expanded=true]:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important;outline-style:none !important}button[aria-expanded=true]:has(:focus-visible)::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true]:has(:focus-visible){outline-color:Highlight !important}}@media screen and (min-width: 1024px){@supports not selector(:has(:focus-visible)){button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus){outline-style:var(--post-core-border-style-solid) !important;outline-style:none !important}button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus)::after{border-color:var(--post-scheme-color-interactive-focus-stroke)}@media screen and (min-width: 1024px)and (forced-colors: active),screen and (min-width: 1024px)and (-ms-high-contrast: active),screen and (min-width: 1024px)and (-ms-high-contrast: white-on-black){button[aria-expanded=true]:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}}@media screen and (max-width: 1023.98px){button post-icon{margin-inline-start:auto;transform:rotate(-90deg) !important}}'}},[257,"post-megadropdown-trigger",{active:[516],for:[513],isMegadropdownExpanded:[32],slottedContent:[32]},[[4,"postToggleMegadropdown","onMegadropdownToggled"]]]);p([d(),l("string")],u.prototype,"for",void 0),p([n("post-megadropdown",{ignoreNestedComponents:!1})],u.prototype,"onMegadropdownToggled",null);const b=u,h=function(){"undefined"!=typeof customElements&&["post-megadropdown-trigger","post-icon"].forEach((t=>{switch(t){case"post-megadropdown-trigger":customElements.get(s(t))||customElements.define(s(t),u);break;case"post-icon":customElements.get(s(t))||c()}}))};export{b as PostMegadropdownTrigger,h as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as n}from"@stencil/core/internal/client";import{r}from"./utils.js";import{f as a}from"./fade-slide.js";import{b as c}from"./breakpoints.js";import{g as d}from"./get-focusable-children.js";import{v as h}from"./package.js";import{d as l}from"./post-closebutton2.js";import{d as p}from"./post-icon2.js";import{R as u}from"./required.js";import{T as b}from"./type.js";const m={translate:100,duration:500,easing:"ease",fill:"none"};var f=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const g=t(class t extends e{static{this.activeDropdown=null}get megadropdownTrigger(){const t=this.host.getAttribute("id");return t?document.querySelector(`post-megadropdown-trigger[for="${t}"]`):null}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postToggleMegadropdown=i(this,"postToggleMegadropdown",7),this.currentAnimation=null,this.animationDirection=null,this.fsAnimationOptions={translate:-10,duration:350,easing:"headerEase"},this.device=c.get("device"),this.isVisible=!1,this.trigger=!1,this.animationClass=null,this.breakpointChange=t=>{this.device=t.detail,this.cancelAnimation()},this.handleClickOutside=async t=>{if("desktop"!==this.device)return;const i=t.target;if(!this.host.contains(i)&&!this.megadropdownTrigger?.contains(i)){if(i instanceof e){const t=i.closest("post-megadropdown-trigger");if(t&&t.getAttribute("for")!==this.host.id)return}await this.hide(!1)}},this.keyboardHandler=this.keyboardHandler.bind(this),this.handleTabOutside=this.handleTabOutside.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange)}componentDidRender(){this.getFocusableElements()}componentDidLoad(){this.checkInitialAriaCurrent(),this.setupObserver(),this.handleAriaCurrentChange([])}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange),t.activeDropdown===this&&(t.activeDropdown=null),this.removeListeners(),this.defaultSlotObserver&&this.defaultSlotObserver.disconnect()}async toggle(){return this.animationDirection?"in"===this.animationDirection?this.hide():this.show():this.isVisible?this.hide():this.show()}async show(){if("desktop"!==this.device){const t=this.megadropdownTrigger;t&&(this.megadropdownTitle=t.innerHTML)}let e=!1;if(t.activeDropdown&&t.activeDropdown!==this&&(t.activeDropdown.forceClose(),e=!0),this.cancelAnimation(),this.isVisible=!0,t.activeDropdown=this,this.postToggleMegadropdown.emit({isVisible:!0}),e)this.focusFirst(),this.addListeners();else try{await this.animate("in"),this.focusFirst(),this.addListeners()}catch{this.removeListeners(),this.isVisible=!1,t.activeDropdown===this&&(t.activeDropdown=null),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!0})}}async hide(e=!0,i=!1){if(i)this.forceClose();else if(this.isVisible&&"out"!==this.animationDirection){this.postToggleMegadropdown.emit({isVisible:!1,focusParent:e});try{await this.animate("out"),this.isVisible=!1,this.removeListeners(),t.activeDropdown===this&&(t.activeDropdown=null)}catch{t.activeDropdown=this,this.addListeners(),this.isVisible=!0,this.postToggleMegadropdown.emit({isVisible:!0,focusParent:!1})}}}async focusFirst(){this.firstFocusableEl?.focus()}forceClose(){this.removeListeners(),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!1}),this.isVisible=!1,t.activeDropdown===this&&(t.activeDropdown=null)}createAnimation(t){const e="out"===t?"forwards":"none";return"desktop"===this.device?a(this.animatedContainer,t,{...this.fsAnimationOptions,fill:e}):function(t,e,i={}){const o={...m,...i},{translate:s}=o,n=[{transform:`translateX(${s}%)`},{transform:"translateX(0)"}];return function(t,e,i){const{duration:o,easing:s,fill:n}={...m,...i};return t.animate(e,{duration:o,easing:r(s),fill:n})}(t,"in"===e?n:[...n].reverse(),i)}(this.animatedContainer,t,{translate:100,duration:350,easing:"in"===t?"ease-in":"ease-out",fill:e})}async animate(t){this.cancelAnimation(),this.currentAnimation=this.createAnimation(t),this.animationDirection=t;try{await this.currentAnimation.finished}finally{this.animationDirection===t&&(this.animationDirection=null)}"in"===t&&(this.currentAnimation=null)}cancelAnimation(){this.currentAnimation?.cancel(),this.currentAnimation=null}addListeners(){this.host.addEventListener("keydown",this.keyboardHandler),document.addEventListener("keyup",this.handleTabOutside),document.addEventListener("mousedown",this.handleClickOutside)}removeListeners(){this.host.removeEventListener("keydown",this.keyboardHandler),document.removeEventListener("keyup",this.handleTabOutside),document.removeEventListener("mousedown",this.handleClickOutside)}getFocusableElements(){const t=[...d(this.host),...d(this.host.shadowRoot)];this.firstFocusableEl=t[0],this.lastFocusableEl=t.at(-1)}keyboardHandler(t){if("Tab"!==t.key||"desktop"===this.device)return;const e=this.host.shadowRoot.activeElement||document.activeElement;t.shiftKey&&e===this.firstFocusableEl?(t.preventDefault(),this.lastFocusableEl.focus()):t.shiftKey||e!==this.lastFocusableEl||(t.preventDefault(),this.firstFocusableEl.focus())}handleTabOutside(t){if("Tab"!==t.key||"desktop"!==this.device||!this.isVisible)return;const e=t.target;this.host.contains(e)||this.megadropdownTrigger?.contains(e)||this.hide(!1)}setupObserver(){this.defaultSlotObserver=new MutationObserver(this.handleAriaCurrentChange.bind(this)),this.defaultSlotObserver.observe(this.host,{subtree:!0,attributes:!0,attributeFilter:["aria-current"]})}setTriggerActive(t){const e=this.megadropdownTrigger;e&&e.setAttribute("active",""+t)}handleAriaCurrentChange(t){if(0===t.length)return;const i=t.some((t=>t.target instanceof e&&"page"===t.target.getAttribute("aria-current")));this.setTriggerActive(i)}checkInitialAriaCurrent(){this.host.querySelector('[aria-current="page"]')&&this.setTriggerActive(!0)}render(){return o(s,{key:"8b9fe023f42390243b55d4efcf58e57d7bae8982",version:h},o("div",{key:"5840742453a8d44dd16f09f368958ac0f734ece7",ref:t=>this.animatedContainer=t,class:"megadropdown",style:this.isVisible?{}:{display:"none"}},o("div",{key:"76332b6f916948ab11411b3dfd5fe97ca6522847",class:"section"},"desktop"!==this.device&&this.megadropdownTitle&&o("p",{key:"3e7cf05cbd7a134ebb417fd5e83f2052874f6c38",class:"megadropdown-title"},this.megadropdownTitle),o("div",{key:"76f902df0e84fb68556ffc6735e5188b1c1babf8",class:"megadropdown-content"},o("slot",{key:"6b69815d2b418395b246dc2681a0597c47f59034"})),"desktop"===this.device?o("post-closebutton",{onClick:()=>this.hide(!0),class:"close-button",size:"small",placement:"manual"},this.textClose):o("button",{onClick:()=>this.hide(!0),class:"back-button"},o("post-icon",{name:"arrowleft"}),this.textBack))))}get host(){return this}static get style(){return"*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;box-shadow:var(--post-device-elevation-300)}@media screen and (min-width: 1024px){.megadropdown{max-height:calc(100vh - var(--post-header-height) - 48px);background-color:#f0efed;z-index:-1;inset-block-start:100%}.megadropdown.slide-in{animation:slide-down 350ms forwards}.megadropdown.slide-out{animation:slide-up 350ms forwards}}@media screen and (max-width: 1023.98px){.megadropdown{background-color:#fafafa;z-index:1;inset-block-start:var(--post-header-navigation-current-inset);overscroll-behavior:contain}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown{border-block-end:1px solid CanvasText}}.section{width:100%;max-width:var(--post-header-content-max-width);margin-inline:auto;position:relative}@media screen and (min-width: 1024px){.section{padding:48px 40px 40px}}@media screen and (max-width: 1023.98px){.section{display:flex;flex-direction:column;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));padding-inline:var(--post-burger-menu-padding-inline);padding-block-start:24px}}@media screen and (max-width: 1023.98px){.section .megadropdown-content{padding-block-end:max(24px, env(safe-area-inset-bottom, 0px))}}.megadropdown-title{margin-block:0 16px;font-weight:950}@media screen and (min-width: 600px)and (max-width: 1023.98px){.megadropdown-title{font-size:1.25rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.megadropdown-title{font-size:1.125rem}}.back-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-4);gap:var(--post-device-spacing-gap-inline-11);padding:0 var(--post-device-spacing-padding-inline-7);border-radius:calc(var(--post-device-sizing-interactive-button-height-4) / 2);border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);order:-1;width:fit-content;padding-inline:0}.back-button:not(:disabled):hover{text-decoration:none}.back-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.back-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}.back-button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:focus-visible{outline-color:Highlight !important}}.back-button.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){.back-button.pretend-focus{outline-color:Highlight !important}}.back-button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.back-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){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button{border-width:1px !important;transition:none}.back-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.back-button>post-icon{width:var(--post-device-sizing-interactive-button-icon-5);height:var(--post-device-sizing-interactive-button-icon-5);flex-shrink:0}.back-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}@media screen and (min-width: 600px)and (max-width: 1023.98px){.back-button{margin-block-end:32px}}@media screen and (min-width: 0)and (max-width: 599.98px){.back-button{margin-block-end:24px}}.close-button{position:absolute;inset-block-start:8px;inset-inline-end:8px}@media screen and (max-width: 1023.98px){.close-button{display:none}}"}},[257,"post-megadropdown",{textClose:[513,"text-close"],textBack:[513,"text-back"],device:[32],isVisible:[32],trigger:[32],megadropdownTitle:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]}]);f([u(),b("string")],g.prototype,"textClose",void 0),f([u(),b("string")],g.prototype,"textBack",void 0);const v=g,w=function(){"undefined"!=typeof customElements&&["post-megadropdown","post-closebutton","post-icon"].forEach((t=>{switch(t){case"post-megadropdown":customElements.get(n(t))||customElements.define(n(t),g);break;case"post-closebutton":customElements.get(n(t))||l();break;case"post-icon":customElements.get(n(t))||p()}}))};export{v as PostMegadropdown,w as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as o,Host as s,transformTag as n}from"@stencil/core/internal/client";import{r}from"./utils.js";import{f as a}from"./fade-slide.js";import{b as c}from"./breakpoints.js";import{g as d}from"./get-focusable-children.js";import{v as h}from"./package.js";import{d as l}from"./post-closebutton2.js";import{d as p}from"./post-icon2.js";import{R as u}from"./required.js";import{T as b}from"./type.js";const m={translate:100,duration:500,easing:"ease",fill:"none"};var f=function(t,e,i,o){var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const g=t(class t extends e{static{this.activeDropdown=null}get megadropdownTrigger(){const t=this.host.getAttribute("id");return t?document.querySelector(`post-megadropdown-trigger[for="${t}"]`):null}constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.postToggleMegadropdown=i(this,"postToggleMegadropdown",7),this.currentAnimation=null,this.animationDirection=null,this.fsAnimationOptions={translate:-10,duration:350,easing:"headerEase"},this.device=c.get("device"),this.isVisible=!1,this.trigger=!1,this.animationClass=null,this.breakpointChange=t=>{this.device=t.detail,this.cancelAnimation()},this.handleClickOutside=async t=>{if("desktop"!==this.device)return;const i=t.target;if(!this.host.contains(i)&&!this.megadropdownTrigger?.contains(i)){if(i instanceof e){const t=i.closest("post-megadropdown-trigger");if(t&&t.getAttribute("for")!==this.host.id)return}await this.hide(!1)}},this.keyboardHandler=this.keyboardHandler.bind(this),this.handleTabOutside=this.handleTabOutside.bind(this),this.handleClickOutside=this.handleClickOutside.bind(this)}connectedCallback(){globalThis.addEventListener("postBreakpoint:device",this.breakpointChange)}componentDidRender(){this.getFocusableElements()}componentDidLoad(){this.checkInitialAriaCurrent(),this.setupObserver(),this.handleAriaCurrentChange([])}disconnectedCallback(){globalThis.removeEventListener("postBreakpoint:device",this.breakpointChange),t.activeDropdown===this&&(t.activeDropdown=null),this.removeListeners(),this.defaultSlotObserver&&this.defaultSlotObserver.disconnect()}async toggle(){return this.animationDirection?"in"===this.animationDirection?this.hide():this.show():this.isVisible?this.hide():this.show()}async show(){if("desktop"!==this.device){const t=this.megadropdownTrigger;t&&(this.megadropdownTitle=t.innerHTML)}let e=!1;if(t.activeDropdown&&t.activeDropdown!==this&&(t.activeDropdown.forceClose(),e=!0),this.cancelAnimation(),this.isVisible=!0,t.activeDropdown=this,this.postToggleMegadropdown.emit({isVisible:!0}),e)this.focusFirst(),this.addListeners();else try{await this.animate("in"),this.focusFirst(),this.addListeners()}catch{this.removeListeners(),this.isVisible=!1,t.activeDropdown===this&&(t.activeDropdown=null),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!0})}}async hide(e=!0,i=!1){if(i)this.forceClose();else if(this.isVisible&&"out"!==this.animationDirection){this.postToggleMegadropdown.emit({isVisible:!1,focusParent:e});try{await this.animate("out"),this.isVisible=!1,this.removeListeners(),t.activeDropdown===this&&(t.activeDropdown=null)}catch{t.activeDropdown=this,this.addListeners(),this.isVisible=!0,this.postToggleMegadropdown.emit({isVisible:!0,focusParent:!1})}}}async focusFirst(){this.firstFocusableEl?.focus()}forceClose(){this.removeListeners(),this.postToggleMegadropdown.emit({isVisible:!1,focusParent:!1}),this.isVisible=!1,t.activeDropdown===this&&(t.activeDropdown=null)}createAnimation(t){const e="out"===t?"forwards":"none";return"desktop"===this.device?a(this.animatedContainer,t,{...this.fsAnimationOptions,fill:e}):function(t,e,i={}){const o={...m,...i},{translate:s}=o,n=[{transform:`translateX(${s}%)`},{transform:"translateX(0)"}];return function(t,e,i){const{duration:o,easing:s,fill:n}={...m,...i};return t.animate(e,{duration:o,easing:r(s),fill:n})}(t,"in"===e?n:[...n].reverse(),i)}(this.animatedContainer,t,{translate:100,duration:350,easing:"in"===t?"ease-in":"ease-out",fill:e})}async animate(t){this.cancelAnimation(),this.currentAnimation=this.createAnimation(t),this.animationDirection=t;try{await this.currentAnimation.finished}finally{this.animationDirection===t&&(this.animationDirection=null)}"in"===t&&(this.currentAnimation=null)}cancelAnimation(){this.currentAnimation?.cancel(),this.currentAnimation=null}addListeners(){this.host.addEventListener("keydown",this.keyboardHandler),document.addEventListener("keyup",this.handleTabOutside),document.addEventListener("mousedown",this.handleClickOutside)}removeListeners(){this.host.removeEventListener("keydown",this.keyboardHandler),document.removeEventListener("keyup",this.handleTabOutside),document.removeEventListener("mousedown",this.handleClickOutside)}getFocusableElements(){const t=[...d(this.host),...d(this.host.shadowRoot)];this.firstFocusableEl=t[0],this.lastFocusableEl=t.at(-1)}keyboardHandler(t){if("Tab"!==t.key||"desktop"===this.device)return;const e=this.host.shadowRoot.activeElement||document.activeElement;t.shiftKey&&e===this.firstFocusableEl?(t.preventDefault(),this.lastFocusableEl.focus()):t.shiftKey||e!==this.lastFocusableEl||(t.preventDefault(),this.firstFocusableEl.focus())}handleTabOutside(t){if("Tab"!==t.key||"desktop"!==this.device||!this.isVisible)return;const e=t.target;this.host.contains(e)||this.megadropdownTrigger?.contains(e)||this.hide(!1)}setupObserver(){this.defaultSlotObserver=new MutationObserver(this.handleAriaCurrentChange.bind(this)),this.defaultSlotObserver.observe(this.host,{subtree:!0,attributes:!0,attributeFilter:["aria-current"]})}setTriggerActive(t){const e=this.megadropdownTrigger;e&&e.setAttribute("active",""+t)}handleAriaCurrentChange(t){if(0===t.length)return;const i=t.some((t=>t.target instanceof e&&"page"===t.target.getAttribute("aria-current")));this.setTriggerActive(i)}checkInitialAriaCurrent(){this.host.querySelector('[aria-current="page"]')&&this.setTriggerActive(!0)}render(){return o(s,{key:"9be9668e8fa4599cdbd8299d6e317d7207254558",version:h},o("div",{key:"1e655c82f2bdfb5f796c77e25e553869b0afd5f6",ref:t=>this.animatedContainer=t,class:"megadropdown",style:this.isVisible?{}:{display:"none"}},o("div",{key:"9da73fb287424b30cafe0d8c899407dc752391b4",class:"section"},"desktop"!==this.device&&this.megadropdownTitle&&o("p",{key:"86b94b9b304b490ad5a688ef9be2707b857c43a8",class:"megadropdown-title"},this.megadropdownTitle),o("div",{key:"c49520cc0027cc62d6a5fce2bd8eda32989cdfef",class:"megadropdown-content"},o("slot",{key:"1f7169574e12f8395f6b5eacfc03f1171238c5e9"})),"desktop"===this.device?o("post-closebutton",{onClick:()=>this.hide(!0),class:"close-button",size:"small",placement:"manual"},this.textClose):o("button",{onClick:()=>this.hide(!0),class:"back-button"},o("post-icon",{name:"arrowleft"}),this.textBack))))}get host(){return this}static get style(){return"*,::before,::after{box-sizing:border-box}.megadropdown{position:absolute;inset-inline:0;overflow-y:auto;box-shadow:var(--post-device-elevation-300)}@media screen and (min-width: 1024px){.megadropdown{max-height:calc(100vh - var(--post-header-height) - 48px);background-color:#f0efed;z-index:-1;inset-block-start:100%}.megadropdown.slide-in{animation:slide-down 350ms forwards}.megadropdown.slide-out{animation:slide-up 350ms forwards}}@media screen and (max-width: 1023.98px){.megadropdown{background-color:#fafafa;z-index:1;inset-block-start:var(--post-header-navigation-current-inset);overscroll-behavior:contain}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.megadropdown{border-block-end:1px solid CanvasText}}.section{width:100%;max-width:var(--post-header-content-max-width);margin-inline:auto;position:relative}@media screen and (min-width: 1024px){.section{padding:48px 40px 40px}}@media screen and (max-width: 1023.98px){.section{display:flex;flex-direction:column;height:calc(min(var(--post-header-scroll-parent-height, 100dvh),100dvh) - var(--post-header-height));padding-inline:var(--post-burger-menu-padding-inline);padding-block-start:24px}}@media screen and (max-width: 1023.98px){.section .megadropdown-content{padding-block-end:max(24px, env(safe-area-inset-bottom, 0px))}}.megadropdown-title{margin-block:0 16px;font-weight:950}@media screen and (min-width: 600px)and (max-width: 1023.98px){.megadropdown-title{font-size:1.25rem}}@media screen and (min-width: 0)and (max-width: 599.98px){.megadropdown-title{font-size:1.125rem}}.back-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;min-height:var(--post-device-sizing-interactive-button-height-4);gap:var(--post-device-spacing-gap-inline-11);padding:0 var(--post-device-spacing-padding-inline-7);border-radius:calc(var(--post-device-sizing-interactive-button-height-4) / 2);border-color:var(--post-scheme-color-interactive-button-tertiary-enabled-stroke);color:var(--post-scheme-color-interactive-button-tertiary-enabled-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-enabled-bg);order:-1;width:fit-content;padding-inline:0}.back-button:not(:disabled):hover{text-decoration:none}.back-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.back-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}.back-button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:focus-visible{outline-color:Highlight !important}}.back-button.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){.back-button.pretend-focus{outline-color:Highlight !important}}.back-button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.back-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){.back-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.back-button{border-width:1px !important;transition:none}.back-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.back-button>post-icon{width:var(--post-device-sizing-interactive-button-icon-5);height:var(--post-device-sizing-interactive-button-icon-5);flex-shrink:0}.back-button:hover{border-color:var(--post-scheme-color-interactive-button-tertiary-hover-stroke);color:var(--post-scheme-color-interactive-button-tertiary-hover-fg);background-color:var(--post-scheme-color-interactive-button-tertiary-hover-bg)}@media screen and (min-width: 600px)and (max-width: 1023.98px){.back-button{margin-block-end:32px}}@media screen and (min-width: 0)and (max-width: 599.98px){.back-button{margin-block-end:24px}}.close-button{position:absolute;inset-block-start:8px;inset-inline-end:8px}@media screen and (max-width: 1023.98px){.close-button{display:none}}"}},[257,"post-megadropdown",{textClose:[513,"text-close"],textBack:[513,"text-back"],device:[32],isVisible:[32],trigger:[32],megadropdownTitle:[32],animationClass:[32],toggle:[64],show:[64],hide:[64],focusFirst:[64]}]);f([u(),b("string")],g.prototype,"textClose",void 0),f([u(),b("string")],g.prototype,"textBack",void 0);const v=g,w=function(){"undefined"!=typeof customElements&&["post-megadropdown","post-closebutton","post-icon"].forEach((t=>{switch(t){case"post-megadropdown":customElements.get(n(t))||customElements.define(n(t),g);break;case"post-closebutton":customElements.get(n(t))||l();break;case"post-icon":customElements.get(n(t))||p()}}))};export{v as PostMegadropdown,w as defineCustomElement}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as s,Host as o,transformTag as i}from"@stencil/core/internal/client";import"./breakpoints.js";import{g as n}from"./get-root.js";import{v as r}from"./package.js";import{R as c}from"./required.js";import{T as a}from"./type.js";const h=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.updateAriaExpanded=this.updateAriaExpanded.bind(this)}connectedCallback(){this.root=n(this.host)}componentDidLoad(){this.setAriaAttributes(),this.root&&this.root.addEventListener("toggleMenu",this.updateAriaExpanded)}disconnectedCallback(){this.root.removeEventListener("toggleMenu",this.updateAriaExpanded)}updateAriaExpanded(t){const e=t.target;"post-menu"===e.localName&&e.id===this.for&&this.slottedButton.setAttribute("aria-expanded",t.detail.toString())}setAriaAttributes(){const t=this.host.querySelectorAll("button");1===t.length?(this.slottedButton=t.item(0),this.slottedButton.setAttribute("type","button"),this.slottedButton.setAttribute("aria-haspopup","menu"),this.slottedButton.setAttribute("aria-expanded","false"),this.slottedButton.addEventListener("click",this.handleToggle.bind(this)),this.slottedButton.addEventListener("keydown",this.handleKeyDown.bind(this))):console.warn(`The post-menu-trigger should contain exactly one button (${t.length} found).`)}handleKeyDown(t){"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),this.handleToggle())}handleToggle(){const t=this.getMenu();t&&t.toggle(this.host)}getMenu(){const t=this.root.getElementById(this.for);return t&&"post-menu"===t.localName?t:(console.warn(`No post-menu found with ID: ${this.for}`),null)}render(){return s(o,{key:"f75522d28e9a45c80846a191cff3ea2eb51b5bde","data-version":r},s("slot",{key:"bc70e3ddc8dc372611c00a4cda52cd35ede02a3f"}))}get host(){return this}static get style(){return":host{display:inline-block}"}},[257,"post-menu-trigger",{for:[513]}]);function u(){"undefined"!=typeof customElements&&["post-menu-trigger"].forEach((t=>{"post-menu-trigger"===t&&(customElements.get(i(t))||customElements.define(i(t),h))}))}!function(t,e,s,o){var i,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(r=(n<3?i(r):n>3?i(e,s,r):i(e,s))||r);n>3&&r&&Object.defineProperty(e,s,r)}([c(),a("string")],h.prototype,"for",void 0);export{h as P,u as d}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as s,Host as o,transformTag as i}from"@stencil/core/internal/client";import"./breakpoints.js";import{g as n}from"./get-root.js";import{v as r}from"./package.js";import{R as a}from"./required.js";import{T as c}from"./type.js";const h=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.updateAriaExpanded=this.updateAriaExpanded.bind(this)}connectedCallback(){this.root=n(this.host)}componentDidLoad(){this.setAriaAttributes(),this.root&&this.root.addEventListener("toggleMenu",this.updateAriaExpanded)}disconnectedCallback(){this.root.removeEventListener("toggleMenu",this.updateAriaExpanded)}updateAriaExpanded(t){const e=t.target;"post-menu"===e.localName&&e.id===this.for&&this.slottedButton.setAttribute("aria-expanded",t.detail.toString())}setAriaAttributes(){const t=this.host.querySelectorAll("button");1===t.length?(this.slottedButton=t.item(0),this.slottedButton.setAttribute("type","button"),this.slottedButton.setAttribute("aria-haspopup","menu"),this.slottedButton.setAttribute("aria-expanded","false"),this.slottedButton.addEventListener("click",this.handleToggle.bind(this)),this.slottedButton.addEventListener("keydown",this.handleKeyDown.bind(this))):console.warn(`The post-menu-trigger should contain exactly one button (${t.length} found).`)}handleKeyDown(t){"ArrowUp"!==t.key&&"ArrowDown"!==t.key||(t.preventDefault(),this.handleToggle())}handleToggle(){const t=this.getMenu();t&&t.toggle(this.host)}getMenu(){const t=this.root.getElementById(this.for);return t&&"post-menu"===t.localName?t:(console.warn(`No post-menu found with ID: ${this.for}`),null)}render(){return s(o,{key:"8f43fe80dd56550141481f157a06caf559494291","data-version":r},s("slot",{key:"1b5d220cff9894918aedc54b0585df75095dcb0e"}))}get host(){return this}static get style(){return":host{display:inline-block}"}},[257,"post-menu-trigger",{for:[513]}]);function u(){"undefined"!=typeof customElements&&["post-menu-trigger"].forEach((t=>{"post-menu-trigger"===t&&(customElements.get(i(t))||customElements.define(i(t),h))}))}!function(t,e,s,o){var i,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(r=(n<3?i(r):n>3?i(e,s,r):i(e,s))||r);n>3&&r&&Object.defineProperty(e,s,r)}([a(),c("string")],h.prototype,"for",void 0);export{h as P,u as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{d as a,a as r}from"./post-popovercontainer2.js";import"./breakpoints.js";import{E as h}from"./event-from.js";import{g as l}from"./get-focusable-children.js";import{g as c}from"./get-root.js";import{i as p}from"./is-focus-visible.js";import{v as d}from"./package.js";import{O as f}from"./one-of.js";import{R as m}from"./required.js";import{T as u}from"./type.js";var b=function(e,t,s,o){var i,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,s,o);else for(var r=e.length-1;r>=0;r--)(i=e[r])&&(a=(n<3?i(a):n>3?i(t,s,a):i(t,s))||a);return n>3&&a&&Object.defineProperty(t,s,a),a};const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.toggleMenu=s(this,"toggleMenu",7),this.lastFocusedElement=null,this.KEYCODES={SPACE:" ",ENTER:"Enter",UP:"ArrowUp",DOWN:"ArrowDown",TAB:"Tab",HOME:"Home",END:"End",ESCAPE:"Escape"},this.placement="bottom",this.isVisible=!1,this.handleKeyDown=e=>{e.stopPropagation(),e.key!==this.KEYCODES.ESCAPE?Object.values(this.KEYCODES).includes(e.key)&&this.controlKeyDownHandler(e):this.toggle(this.host)},this.handleClick=e=>{["BUTTON","A","INPUT","SELECT","TEXTAREA"].includes(e.target.tagName)&&this.toggle(this.host)}}connectedCallback(){this.root=c(this.host),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("click",this.handleClick)}disconnectedCallback(){this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("click",this.handleClick)}async toggle(e){this.popoverRef?await this.popoverRef.toggle(e):console.error("toggle: popoverRef is null or undefined")}async show(e){this.popoverRef?await this.popoverRef.show(e):console.error("show: popoverRef is null or undefined")}async hide(){this.popoverRef?await this.popoverRef.hide():console.error("hide: popoverRef is null or undefined")}handlePostShown(e){if(e.detail.first){this.host.setAttribute("role","menu");const e=this.getSlottedItems();for(const t of e)t.setAttribute("role","menuitem");this.label&&this.host.setAttribute("aria-label",this.label)}}handlePostBeforeToggle(e){this.isVisible=e.detail.willOpen,this.toggleMenu.emit(this.isVisible),this.isVisible?(this.lastFocusedElement=this.root?.activeElement,p(this.lastFocusedElement)&&requestAnimationFrame((()=>{const e=this.getSlottedItems();e.length>0&&e[0].focus()}))):this.lastFocusedElement&&this.lastFocusedElement.focus()}controlKeyDownHandler(e){const t=this.getSlottedItems();if(0===t.length)return;let s=t.findIndex((e=>e===c(e).activeElement));switch(e.key){case this.KEYCODES.UP:e.preventDefault(),s=(s-1+t.length)%t.length;break;case this.KEYCODES.DOWN:e.preventDefault(),s=(s+1)%t.length;break;case this.KEYCODES.HOME:e.preventDefault(),s=0;break;case this.KEYCODES.END:e.preventDefault(),s=t.length-1;break;case this.KEYCODES.SPACE:return void this.toggle(this.host);case this.KEYCODES.TAB:this.toggle(this.host)}t[s]&&t[s].focus()}getSlottedItems(){const e=this.host.shadowRoot.querySelectorAll("slot"),t=[];return e.forEach((e=>t.push(...e.assignedElements()))),t.flatMap((e=>e instanceof HTMLSlotElement?e.assignedElements():e)).flatMap((e=>[...l(e),...e.shadowRoot?l(e.shadowRoot):[]]))}render(){return o(i,{key:"988b77e3589a499e23e95eb6eff985edbadd4d2e","data-version":d},o("post-popovercontainer",{key:"fd0ee4d4234fe1f222757c00d778ebb2a2c5ac13",autoHide:!0,autoResize:!0,onPostShow:this.handlePostShown.bind(this),onPostBeforeToggle:this.handlePostBeforeToggle.bind(this),placement:this.placement,ref:e=>this.popoverRef=e},o("div",{key:"8b46a79db5944854c97c862608bd5a8d9113398e",part:"post-menu"},o("slot",{key:"a024a0ade2a865b12d1a452c6c33f9afde1f34e0",name:"header"}),o("slot",{key:"1465a5d8d9463e6557a2a8c32aa119429a4783b3"}))))}get host(){return this}static get style(){return":host{display:block}:where([part=post-menu]){display:flex;flex-direction:column;padding-block:8px;overflow-y:auto;overscroll-behavior:contain}::slotted([slot=header]){margin-top:-8px;padding:16px;display:flex;align-items:center;gap:8px;border-block-end:1px solid #050400;font-weight:700}@media screen and (max-width: 1023.98px){::slotted([slot=header]){padding:12px 16px}}@media screen and (max-width: 779.98px){::slotted([slot=header]){padding:8px 16px}}post-popovercontainer::part(post-popovercontainer-content){background-color:#fff}"}},[257,"post-menu",{placement:[1],label:[513],isVisible:[32],toggle:[64],show:[64],hide:[64]}]);function v(){"undefined"!=typeof customElements&&["post-menu","post-popovercontainer"].forEach((e=>{switch(e){case"post-menu":customElements.get(n(e))||customElements.define(n(e),g);break;case"post-popovercontainer":customElements.get(n(e))||a()}}))}b([f(r)],g.prototype,"placement",void 0),b([m(),u("string")],g.prototype,"label",void 0),b([h("post-popovercontainer")],g.prototype,"handlePostShown",null),b([h("post-popovercontainer")],g.prototype,"handlePostBeforeToggle",null);export{g as P,v as d}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as o,Host as i,transformTag as n}from"@stencil/core/internal/client";import{d as a,a as r}from"./post-popovercontainer2.js";import"./breakpoints.js";import{E as c}from"./event-from.js";import{g as h}from"./get-focusable-children.js";import{g as l}from"./get-root.js";import{i as p}from"./is-focus-visible.js";import{v as d}from"./package.js";import{O as f}from"./one-of.js";import{R as m}from"./required.js";import{T as u}from"./type.js";var b=function(t,e,s,o){var i,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,s,o);else for(var r=t.length-1;r>=0;r--)(i=t[r])&&(a=(n<3?i(a):n>3?i(e,s,a):i(e,s))||a);return n>3&&a&&Object.defineProperty(e,s,a),a};const g=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.toggleMenu=s(this,"toggleMenu",7),this.lastFocusedElement=null,this.KEYCODES={SPACE:" ",ENTER:"Enter",UP:"ArrowUp",DOWN:"ArrowDown",TAB:"Tab",HOME:"Home",END:"End",ESCAPE:"Escape"},this.placement="bottom",this.isVisible=!1,this.handleKeyDown=t=>{t.stopPropagation(),t.key!==this.KEYCODES.ESCAPE?Object.values(this.KEYCODES).includes(t.key)&&this.controlKeyDownHandler(t):this.toggle(this.host)},this.handleClick=t=>{["BUTTON","A","INPUT","SELECT","TEXTAREA"].includes(t.target.tagName)&&this.toggle(this.host)}}connectedCallback(){this.root=l(this.host),this.host.addEventListener("keydown",this.handleKeyDown),this.host.addEventListener("click",this.handleClick)}disconnectedCallback(){this.host.removeEventListener("keydown",this.handleKeyDown),this.host.removeEventListener("click",this.handleClick)}async toggle(t){this.popoverRef?await this.popoverRef.toggle(t):console.error("toggle: popoverRef is null or undefined")}async show(t){this.popoverRef?await this.popoverRef.show(t):console.error("show: popoverRef is null or undefined")}async hide(){this.popoverRef?await this.popoverRef.hide():console.error("hide: popoverRef is null or undefined")}handlePostShown(t){if(t.detail.first){this.host.setAttribute("role","menu");const t=this.getSlottedItems();for(const e of t)e.setAttribute("role","menuitem");this.label&&this.host.setAttribute("aria-label",this.label)}}handlePostBeforeToggle(t){this.isVisible=t.detail.willOpen,this.toggleMenu.emit(this.isVisible),this.isVisible?(this.lastFocusedElement=this.root?.activeElement,p(this.lastFocusedElement)&&requestAnimationFrame((()=>{const t=this.getSlottedItems();t.length>0&&t[0].focus()}))):this.lastFocusedElement&&this.lastFocusedElement.focus()}controlKeyDownHandler(t){const e=this.getSlottedItems();if(0===e.length)return;let s=e.findIndex((t=>t===l(t).activeElement));switch(t.key){case this.KEYCODES.UP:t.preventDefault(),s=(s-1+e.length)%e.length;break;case this.KEYCODES.DOWN:t.preventDefault(),s=(s+1)%e.length;break;case this.KEYCODES.HOME:t.preventDefault(),s=0;break;case this.KEYCODES.END:t.preventDefault(),s=e.length-1;break;case this.KEYCODES.SPACE:return void this.toggle(this.host);case this.KEYCODES.TAB:this.toggle(this.host)}e[s]&&e[s].focus()}getSlottedItems(){const t=this.host.shadowRoot.querySelectorAll("slot"),e=[];return t.forEach((t=>e.push(...t.assignedElements()))),e.flatMap((t=>t instanceof HTMLSlotElement?t.assignedElements():t)).flatMap((t=>[...h(t),...t.shadowRoot?h(t.shadowRoot):[]]))}render(){return o(i,{key:"424d6a6b439f05d8fecca4814f2aeba53e7333b9","data-version":d},o("post-popovercontainer",{key:"0dce87ba2c4731ac458105a10a80514c2db07b52",autoHide:!0,autoResize:!0,onPostShow:this.handlePostShown.bind(this),onPostBeforeToggle:this.handlePostBeforeToggle.bind(this),placement:this.placement,ref:t=>this.popoverRef=t},o("div",{key:"693bbd1e352d8c52f76dae4fba41558ef1ad4308",part:"post-menu"},o("slot",{key:"7e3a24f00f99c99120ca75bf8a0b34aad27cbac3",name:"header"}),o("slot",{key:"1d9d360db4880ebc6e35cf2ac6cbdd738289f102"}))))}get host(){return this}static get style(){return":host{display:block}:where([part=post-menu]){display:flex;flex-direction:column;padding-block:8px;overflow-y:auto;overscroll-behavior:contain}::slotted([slot=header]){margin-top:-8px;padding:16px;display:flex;align-items:center;gap:8px;border-block-end:1px solid #050400;font-weight:700}@media screen and (max-width: 1023.98px){::slotted([slot=header]){padding:12px 16px}}@media screen and (max-width: 779.98px){::slotted([slot=header]){padding:8px 16px}}post-popovercontainer::part(post-popovercontainer-content){background-color:#fff}"}},[257,"post-menu",{placement:[1],label:[513],isVisible:[32],toggle:[64],show:[64],hide:[64]}]);function v(){"undefined"!=typeof customElements&&["post-menu","post-popovercontainer"].forEach((t=>{switch(t){case"post-menu":customElements.get(n(t))||customElements.define(n(t),g);break;case"post-popovercontainer":customElements.get(n(t))||a()}}))}b([f(r)],g.prototype,"placement",void 0),b([m(),u("string")],g.prototype,"label",void 0),b([c("post-popovercontainer")],g.prototype,"handlePostShown",null),b([c("post-popovercontainer")],g.prototype,"handlePostBeforeToggle",null);export{g as P,v as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,h as i,Host as o,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as n}from"./package.js";import{d as r}from"./index2.js";import{d as a}from"./post-icon2.js";function c(t,e){const i=Number.parseFloat(t[e]);return Number.isNaN(i)?void 0:i}function d(t,e,i){return void 0!==t&&void 0!==e&&i(t,e)}const p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isDisabled=!1,this.isIncrementDisabled=!1,this.isDecrementDisabled=!1,this.small=!1,this.setupInput=r(50,(()=>{this.input=this.input??function(t,e){const i=t.querySelectorAll(e);return 1===i.length?i[0]:(console.error(`<${t.localName}> expects exactly one element matching "${e}", but found ${i.length}.`,t),null)}(this.host,'input[type="number"]'),this.input&&(this.isDisabled=this.input.disabled,this.small=this.input.classList.contains("form-control-sm"),this.updateStepButtonState(),this.input.addEventListener("input",(()=>this.updateStepButtonState())),this.mutationObserver=new MutationObserver((()=>this.updateStepButtonState())),this.mutationObserver.observe(this.input,{attributes:!0,attributeFilter:["min","max","disabled"]}))}))}get value(){return c(this.input,"value")}get min(){return c(this.input,"min")}get max(){return c(this.input,"max")}get isAtMin(){return d(this.value,this.min,((t,e)=>t===e))}get isAtMax(){return d(this.value,this.max,((t,e)=>t===e))}get isBelowMin(){return d(this.value,this.min,((t,e)=>t<e))}get isAboveMax(){return d(this.value,this.max,((t,e)=>t>e))}disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect()}step(t){const e="up"===t;!function(t,e){const i=function(t,{delayMs:e=300,intervalMs:i=100}={}){let o;t();const s=setTimeout((()=>{o=setInterval(t,i)}),e);return()=>{clearTimeout(s),o&&clearInterval(o)}}(t,e),o=()=>{i(),globalThis.removeEventListener("pointerup",o),globalThis.removeEventListener("pointercancel",o),globalThis.removeEventListener("pointerleave",o)};globalThis.addEventListener("pointerup",o),globalThis.addEventListener("pointercancel",o),globalThis.addEventListener("pointerleave",o)}((()=>{(e?this.isAtMax:this.isAtMin)||((e?this.isBelowMin:this.isAboveMax)?this.input.value=e?this.input.min:this.input.max:(e?this.input.stepUp:this.input.stepDown).call(this.input),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.updateStepButtonState())}))}updateStepButtonState(){this.input.disabled||this.min&&this.max&&this.min>this.max?this.isIncrementDisabled=this.isDecrementDisabled=!0:(this.isIncrementDisabled=this.isAtMax||this.isAboveMax,this.isDecrementDisabled=this.isAtMin||this.isBelowMin)}render(){const t=!!this.input;return i(o,{key:"9bc4f1aff3f0347c5419cbc8c3f03660c8ce0ec3","data-version":n,class:{"number-input-sm":this.small,disabled:this.isDisabled}},t&&i("div",{key:"556bdd45f2dc5b924f7bb2eab0c059c3000bf404","aria-hidden":"true",onPointerDown:()=>this.step("down"),class:{"step-button":!0,disabled:this.isDecrementDisabled}},i("post-icon",{key:"fc8ee1c88ab96345a0aa81928c7fd4d45dd88414",name:"minus"})),i("div",{key:"9284ca5c21009bd79b144e61a33017501646fceb",class:"input-container"},i("slot",{key:"e6dfefd93d26fee610a82863a66f55939552ff7c",onSlotchange:()=>this.setupInput()})),t&&i("div",{key:"d74c99d7f2db50387cd3f0d6033339fbf9480a24","aria-hidden":"true",onPointerDown:()=>this.step("up"),class:{"step-button":!0,disabled:this.isIncrementDisabled}},i("post-icon",{key:"25635f72d1b067663f8458bdbb7994c7dfafa6e8",name:"plus"})))}get host(){return this}static get style(){return':host{display:inline-flex;align-items:end;width:100%}:host ::slotted(input[type=number]),:host .step-button{height:var(--post-device-sizing-interactive-button-height-6) !important}:host ::slotted(input[type=number]){border-radius:0 !important;padding-inline:var(--post-device-spacing-padding-inline-1);padding-block-start:var(--post-device-spacing-padding-block-29);padding-block-end:var(--post-device-spacing-padding-block-3);font-size:var(--post-device-font-size-12)}:host ::slotted(input[type=number]:focus){outline:none !important}:host .step-button.disabled{background-color:var(--post-scheme-color-interactive-button-secondary-disabled-bg);color:var(--post-scheme-color-interactive-button-secondary-disabled-fg);border-color:var(--post-scheme-color-interactive-button-secondary-disabled-stroke);border-style:var(--post-core-border-style-dash)}:host(.number-input-sm) ::slotted(input[type=number]),:host(.number-input-sm) .step-button{height:var(--post-device-sizing-interactive-button-height-8) !important}:host(.number-input-sm) ::slotted(input[type=number]){font-size:var(--post-device-font-size-8) !important;padding-inline:var(--post-device-spacing-padding-inline-1) !important;padding-block:var(--post-device-spacing-padding-26) !important}:host(.number-input-sm) ::slotted(input[type=number].is-valid),:host(.number-input-sm) ::slotted(input[type=number].is-invalid){background-size:var(--post-device-sizing-notification-5) !important;padding-inline-end:calc( (var(--post-device-spacing-padding-inline-1)* 2) + var(--post-device-sizing-notification-5) ) !important}:host(.number-input-sm) .step-button{padding-inline:var(--post-device-spacing-padding-32);padding-block:var(--post-device-spacing-padding-2)}:host(.number-input-sm) .step-button post-icon{width:var(--post-device-sizing-interactive-icon-size7);height:var(--post-device-sizing-interactive-icon-size7)}:host(:hover) .step-button:not(.disabled){background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg);border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:hover) .step-button:not(.disabled){border-color:Highlight}}:host(:hover) .step-button:not(.disabled),:host(:hover) .step-button:not(.disabled) post-icon{color:var(--post-scheme-color-interactive-button-secondary-hover-fg)}.input-container{position:relative;flex-grow:1}.input-container:focus-within::after{content:"";pointer-events:none;z-index:2;width:calc(100% + (var(--post-device-border-width-default) * 2));height:calc(100% + (var(--post-device-border-width-default) * 2));border:var(--post-device-border-width-focus) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-focus-stroke);position:absolute;border-radius:var(--post-device-border-radius-1);top:calc((var(--post-device-border-width-default) * 2)*-1);left:calc((var(--post-device-border-width-default) * 2)*-1)}.step-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;transition:unset;box-sizing:border-box;flex:0 0 auto;border-radius:var(--post-device-border-radius-1);padding-inline:var(--post-device-spacing-padding-23);padding-block:var(--post-device-spacing-padding-22);box-shadow:var(--post-device-elevation-100);border:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-button-secondary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg)}.step-button:not(:disabled):hover{text-decoration:none}.step-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.step-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}.step-button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:focus-visible{outline-color:Highlight !important}}.step-button.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){.step-button.pretend-focus{outline-color:Highlight !important}}.step-button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.step-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){.step-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button{border-width:1px !important;transition:none}.step-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.step-button post-icon{width:var(--post-device-sizing-interactive-icon-size6);height:var(--post-device-sizing-interactive-icon-size6)}.step-button:first-of-type{border-start-end-radius:0;border-end-end-radius:0;border-inline-end-width:0}.step-button:last-of-type{border-start-start-radius:0;border-end-start-radius:0;border-inline-start-width:0}.step-button.disabled{pointer-events:none;cursor:unset}'}},[257,"post-number-input",{isDisabled:[32],isIncrementDisabled:[32],isDecrementDisabled:[32],small:[32],input:[32]}]),l=p,h=function(){"undefined"!=typeof customElements&&["post-number-input","post-icon"].forEach((t=>{switch(t){case"post-number-input":customElements.get(s(t))||customElements.define(s(t),p);break;case"post-icon":customElements.get(s(t))||a()}}))};export{l as PostNumberInput,h as defineCustomElement}
1
+ import{proxyCustomElement as t,HTMLElement as e,h as i,Host as o,transformTag as s}from"@stencil/core/internal/client";import"./breakpoints.js";import{v as n}from"./package.js";import{d as r}from"./index2.js";import{d as a}from"./post-icon2.js";function d(t,e){const i=Number.parseFloat(t[e]);return Number.isNaN(i)?void 0:i}function c(t,e,i){return void 0!==t&&void 0!==e&&i(t,e)}const p=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.isDisabled=!1,this.isIncrementDisabled=!1,this.isDecrementDisabled=!1,this.small=!1,this.setupInput=r(50,(()=>{this.input=this.input??function(t,e){const i=t.querySelectorAll(e);return 1===i.length?i[0]:(console.error(`<${t.localName}> expects exactly one element matching "${e}", but found ${i.length}.`,t),null)}(this.host,'input[type="number"]'),this.input&&(this.isDisabled=this.input.disabled,this.small=this.input.classList.contains("form-control-sm"),this.updateStepButtonState(),this.input.addEventListener("input",(()=>this.updateStepButtonState())),this.mutationObserver=new MutationObserver((()=>this.updateStepButtonState())),this.mutationObserver.observe(this.input,{attributes:!0,attributeFilter:["min","max","disabled"]}))}))}get value(){return d(this.input,"value")}get min(){return d(this.input,"min")}get max(){return d(this.input,"max")}get isAtMin(){return c(this.value,this.min,((t,e)=>t===e))}get isAtMax(){return c(this.value,this.max,((t,e)=>t===e))}get isBelowMin(){return c(this.value,this.min,((t,e)=>t<e))}get isAboveMax(){return c(this.value,this.max,((t,e)=>t>e))}disconnectedCallback(){this.mutationObserver&&this.mutationObserver.disconnect()}step(t){const e="up"===t;!function(t,e){const i=function(t,{delayMs:e=300,intervalMs:i=100}={}){let o;t();const s=setTimeout((()=>{o=setInterval(t,i)}),e);return()=>{clearTimeout(s),o&&clearInterval(o)}}(t,e),o=()=>{i(),globalThis.removeEventListener("pointerup",o),globalThis.removeEventListener("pointercancel",o),globalThis.removeEventListener("pointerleave",o)};globalThis.addEventListener("pointerup",o),globalThis.addEventListener("pointercancel",o),globalThis.addEventListener("pointerleave",o)}((()=>{(e?this.isAtMax:this.isAtMin)||((e?this.isBelowMin:this.isAboveMax)?this.input.value=e?this.input.min:this.input.max:(e?this.input.stepUp:this.input.stepDown).call(this.input),this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.updateStepButtonState())}))}updateStepButtonState(){this.input.disabled||this.min&&this.max&&this.min>this.max?this.isIncrementDisabled=this.isDecrementDisabled=!0:(this.isIncrementDisabled=this.isAtMax||this.isAboveMax,this.isDecrementDisabled=this.isAtMin||this.isBelowMin)}render(){const t=!!this.input;return i(o,{key:"59cbe12c66b0eabbff15a3110ee847396df2d261","data-version":n,class:{"number-input-sm":this.small,disabled:this.isDisabled}},t&&i("div",{key:"43fca97c040104786ab528b04f3e0dd576f29025","aria-hidden":"true",onPointerDown:()=>this.step("down"),class:{"step-button":!0,disabled:this.isDecrementDisabled}},i("post-icon",{key:"1b41c236beb802d98f60776827928335d00599c4",name:"minus"})),i("div",{key:"8342d335e0a84f78514edac5052ffea081fb40c7",class:"input-container"},i("slot",{key:"d2f8eae0656faaab31358cd3582c873d4a491e73",onSlotchange:()=>this.setupInput()})),t&&i("div",{key:"0055b317ed6ec64f2451640c436d169bb0b07626","aria-hidden":"true",onPointerDown:()=>this.step("up"),class:{"step-button":!0,disabled:this.isIncrementDisabled}},i("post-icon",{key:"dafe4a65f6d5d6ba4f54229c55506d5cf14fe126",name:"plus"})))}get host(){return this}static get style(){return':host{display:inline-flex;align-items:end;width:100%}:host ::slotted(input[type=number]),:host .step-button{height:var(--post-device-sizing-interactive-button-height-6) !important}:host ::slotted(input[type=number]){border-radius:0 !important;padding-inline:var(--post-device-spacing-padding-inline-1);padding-block-start:var(--post-device-spacing-padding-block-29);padding-block-end:var(--post-device-spacing-padding-block-3);font-size:var(--post-device-font-size-12)}:host ::slotted(input[type=number]:focus){outline:none !important}:host .step-button.disabled{background-color:var(--post-scheme-color-interactive-button-secondary-disabled-bg);color:var(--post-scheme-color-interactive-button-secondary-disabled-fg);border-color:var(--post-scheme-color-interactive-button-secondary-disabled-stroke);border-style:var(--post-core-border-style-dash)}:host(.number-input-sm) ::slotted(input[type=number]),:host(.number-input-sm) .step-button{height:var(--post-device-sizing-interactive-button-height-8) !important}:host(.number-input-sm) ::slotted(input[type=number]){font-size:var(--post-device-font-size-8) !important;padding-inline:var(--post-device-spacing-padding-inline-1) !important;padding-block:var(--post-device-spacing-padding-26) !important}:host(.number-input-sm) ::slotted(input[type=number].is-valid),:host(.number-input-sm) ::slotted(input[type=number].is-invalid){background-size:var(--post-device-sizing-notification-5) !important;padding-inline-end:calc( (var(--post-device-spacing-padding-inline-1)* 2) + var(--post-device-sizing-notification-5) ) !important}:host(.number-input-sm) .step-button{padding-inline:var(--post-device-spacing-padding-32);padding-block:var(--post-device-spacing-padding-2)}:host(.number-input-sm) .step-button post-icon{width:var(--post-device-sizing-interactive-icon-size7);height:var(--post-device-sizing-interactive-icon-size7)}:host(:hover) .step-button:not(.disabled){background-color:var(--post-scheme-color-interactive-button-secondary-hover-bg);border-color:var(--post-scheme-color-interactive-button-secondary-hover-stroke)}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){:host(:hover) .step-button:not(.disabled){border-color:Highlight}}:host(:hover) .step-button:not(.disabled),:host(:hover) .step-button:not(.disabled) post-icon{color:var(--post-scheme-color-interactive-button-secondary-hover-fg)}.input-container{position:relative;flex-grow:1}.input-container:focus-within::after{content:"";pointer-events:none;z-index:2;width:calc(100% + (var(--post-device-border-width-default) * 2));height:calc(100% + (var(--post-device-border-width-default) * 2));border:var(--post-device-border-width-focus) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-focus-stroke);position:absolute;border-radius:var(--post-device-border-radius-1);top:calc((var(--post-device-border-width-default) * 2)*-1);left:calc((var(--post-device-border-width-default) * 2)*-1)}.step-button{display:inline-flex;position:relative;align-items:center;justify-content:center;max-width:100%;overflow:hidden;transition:opacity 250ms,border-color 250ms,background-color 250ms,color 250ms;border-width:var(--post-device-border-width-default);border-style:solid;border-color:rgba(0,0,0,0);border-radius:var(--post-device-border-radius-round);background-color:rgba(0,0,0,0);box-shadow:none;font-family:inherit;font-size:var(--post-device-font-size-6);font-weight:var(--post-device-font-weight-bold);text-decoration:none;white-space:nowrap;cursor:pointer;transition:unset;box-sizing:border-box;flex:0 0 auto;border-radius:var(--post-device-border-radius-1);padding-inline:var(--post-device-spacing-padding-23);padding-block:var(--post-device-spacing-padding-22);box-shadow:var(--post-device-elevation-100);border:var(--post-device-border-width-default) var(--post-core-border-style-solid) var(--post-scheme-color-interactive-button-secondary-enabled-stroke);background-color:var(--post-scheme-color-interactive-button-secondary-enabled-bg);color:var(--post-scheme-color-interactive-button-secondary-enabled-fg)}.step-button:not(:disabled):hover{text-decoration:none}.step-button:disabled{border-style:var(--post-core-border-style-dash);cursor:unset}.step-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}.step-button:focus-visible{outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:focus-visible{outline-color:Highlight !important}}.step-button.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){.step-button.pretend-focus{outline-color:Highlight !important}}.step-button:has(:focus-visible){outline-style:var(--post-core-border-style-solid) !important}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button:has(:focus-visible){outline-color:Highlight !important}}@supports not selector(:has(:focus-visible)){.step-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){.step-button:is(:focus-visible,:focus-within,.pretend-focus){outline-color:Highlight !important}}}@media (forced-colors: active),(-ms-high-contrast: active),(-ms-high-contrast: white-on-black){.step-button{border-width:1px !important;transition:none}.step-button:is(button){background-color:ButtonFace !important;border-color:ButtonBorder !important}}.step-button post-icon{width:var(--post-device-sizing-interactive-icon-size6);height:var(--post-device-sizing-interactive-icon-size6)}.step-button:first-of-type{border-start-end-radius:0;border-end-end-radius:0;border-inline-end-width:0}.step-button:last-of-type{border-start-start-radius:0;border-end-start-radius:0;border-inline-start-width:0}.step-button.disabled{pointer-events:none;cursor:unset}'}},[257,"post-number-input",{isDisabled:[32],isIncrementDisabled:[32],isDecrementDisabled:[32],small:[32],input:[32]}]),l=p,h=function(){"undefined"!=typeof customElements&&["post-number-input","post-icon"].forEach((t=>{switch(t){case"post-number-input":customElements.get(s(t))||customElements.define(s(t),p);break;case"post-icon":customElements.get(s(t))||a()}}))};export{l as PostNumberInput,h as defineCustomElement}