@swisspost/internet-header 1.7.3 → 1.7.4

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 (153) hide show
  1. package/dist/cjs/{klp-widget.controller-5dc378ef.js → klp-widget.controller-da70f351.js} +2 -3
  2. package/dist/cjs/klp-widget.controller-da70f351.js.map +1 -0
  3. package/dist/cjs/post-klp-login-widget.cjs.entry.js +2 -2
  4. package/dist/cjs/post-klp-login-widget.cjs.entry.js.map +1 -1
  5. package/dist/cjs/post-language-switch.cjs.entry.js +1 -1
  6. package/dist/cjs/post-language-switch.cjs.entry.js.map +1 -1
  7. package/dist/cjs/post-logo.cjs.entry.js +1 -1
  8. package/dist/cjs/post-logo.cjs.entry.js.map +1 -1
  9. package/dist/cjs/post-main-navigation.cjs.entry.js +1 -1
  10. package/dist/cjs/post-main-navigation.cjs.entry.js.map +1 -1
  11. package/dist/cjs/post-meta-navigation.cjs.entry.js +1 -1
  12. package/dist/cjs/post-meta-navigation.cjs.entry.js.map +1 -1
  13. package/dist/cjs/post-search.cjs.entry.js +1 -1
  14. package/dist/cjs/post-search.cjs.entry.js.map +1 -1
  15. package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js +1 -1
  16. package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js.map +1 -1
  17. package/dist/cjs/swisspost-internet-footer.cjs.entry.js +1 -1
  18. package/dist/cjs/swisspost-internet-footer.cjs.entry.js.map +1 -1
  19. package/dist/cjs/swisspost-internet-header.cjs.entry.js +3 -3
  20. package/dist/cjs/swisspost-internet-header.cjs.entry.js.map +1 -1
  21. package/dist/collection/assets/js/klp-login-widget.js +1 -2
  22. package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.css +21 -0
  23. package/dist/collection/components/post-internet-footer/post-internet-footer.css +21 -0
  24. package/dist/collection/components/post-internet-header/post-internet-header.css +22 -1
  25. package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.css +21 -0
  26. package/dist/collection/components/post-language-switch/post-language-switch.css +21 -0
  27. package/dist/collection/components/post-logo/post-logo.css +21 -0
  28. package/dist/collection/components/post-main-navigation/post-main-navigation.css +21 -0
  29. package/dist/collection/components/post-meta-navigation/post-meta-navigation.css +21 -0
  30. package/dist/collection/components/post-search/post-search.css +31 -0
  31. package/dist/components/klp-widget.controller.js +1 -2
  32. package/dist/components/klp-widget.controller.js.map +1 -1
  33. package/dist/components/post-klp-login-widget2.js +1 -1
  34. package/dist/components/post-klp-login-widget2.js.map +1 -1
  35. package/dist/components/post-language-switch2.js +1 -1
  36. package/dist/components/post-language-switch2.js.map +1 -1
  37. package/dist/components/post-logo2.js +1 -1
  38. package/dist/components/post-logo2.js.map +1 -1
  39. package/dist/components/post-main-navigation2.js +1 -1
  40. package/dist/components/post-main-navigation2.js.map +1 -1
  41. package/dist/components/post-meta-navigation2.js +1 -1
  42. package/dist/components/post-meta-navigation2.js.map +1 -1
  43. package/dist/components/post-search2.js +1 -1
  44. package/dist/components/post-search2.js.map +1 -1
  45. package/dist/components/swisspost-internet-breadcrumbs.js +1 -1
  46. package/dist/components/swisspost-internet-breadcrumbs.js.map +1 -1
  47. package/dist/components/swisspost-internet-footer.js +1 -1
  48. package/dist/components/swisspost-internet-footer.js.map +1 -1
  49. package/dist/components/swisspost-internet-header.js +3 -3
  50. package/dist/components/swisspost-internet-header.js.map +1 -1
  51. package/dist/esm/{klp-widget.controller-5b2b7ce7.js → klp-widget.controller-d2c68d83.js} +2 -3
  52. package/dist/esm/klp-widget.controller-d2c68d83.js.map +1 -0
  53. package/dist/esm/post-klp-login-widget.entry.js +2 -2
  54. package/dist/esm/post-klp-login-widget.entry.js.map +1 -1
  55. package/dist/esm/post-language-switch.entry.js +1 -1
  56. package/dist/esm/post-language-switch.entry.js.map +1 -1
  57. package/dist/esm/post-logo.entry.js +1 -1
  58. package/dist/esm/post-logo.entry.js.map +1 -1
  59. package/dist/esm/post-main-navigation.entry.js +1 -1
  60. package/dist/esm/post-main-navigation.entry.js.map +1 -1
  61. package/dist/esm/post-meta-navigation.entry.js +1 -1
  62. package/dist/esm/post-meta-navigation.entry.js.map +1 -1
  63. package/dist/esm/post-search.entry.js +1 -1
  64. package/dist/esm/post-search.entry.js.map +1 -1
  65. package/dist/esm/swisspost-internet-breadcrumbs.entry.js +1 -1
  66. package/dist/esm/swisspost-internet-breadcrumbs.entry.js.map +1 -1
  67. package/dist/esm/swisspost-internet-footer.entry.js +1 -1
  68. package/dist/esm/swisspost-internet-footer.entry.js.map +1 -1
  69. package/dist/esm/swisspost-internet-header.entry.js +3 -3
  70. package/dist/esm/swisspost-internet-header.entry.js.map +1 -1
  71. package/dist/esm-es5/{klp-widget.controller-5b2b7ce7.js → klp-widget.controller-d2c68d83.js} +2 -2
  72. package/dist/{swisspost-internet-header/p-53670adf.system.js.map → esm-es5/klp-widget.controller-d2c68d83.js.map} +1 -1
  73. package/dist/esm-es5/post-klp-login-widget.entry.js +1 -1
  74. package/dist/esm-es5/post-klp-login-widget.entry.js.map +1 -1
  75. package/dist/esm-es5/post-language-switch.entry.js +1 -1
  76. package/dist/esm-es5/post-language-switch.entry.js.map +1 -1
  77. package/dist/esm-es5/post-logo.entry.js +1 -1
  78. package/dist/esm-es5/post-logo.entry.js.map +1 -1
  79. package/dist/esm-es5/post-main-navigation.entry.js +1 -1
  80. package/dist/esm-es5/post-main-navigation.entry.js.map +1 -1
  81. package/dist/esm-es5/post-meta-navigation.entry.js +1 -1
  82. package/dist/esm-es5/post-meta-navigation.entry.js.map +1 -1
  83. package/dist/esm-es5/post-search.entry.js +1 -1
  84. package/dist/esm-es5/post-search.entry.js.map +1 -1
  85. package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js +1 -1
  86. package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js.map +1 -1
  87. package/dist/esm-es5/swisspost-internet-footer.entry.js +1 -1
  88. package/dist/esm-es5/swisspost-internet-footer.entry.js.map +1 -1
  89. package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
  90. package/dist/esm-es5/swisspost-internet-header.entry.js.map +1 -1
  91. package/dist/swisspost-internet-header/{p-8564ffa5.js → p-05a85d69.js} +2 -2
  92. package/dist/swisspost-internet-header/{p-8564ffa5.js.map → p-05a85d69.js.map} +1 -1
  93. package/dist/swisspost-internet-header/{p-600247ef.system.entry.js → p-091fc70e.system.entry.js} +2 -2
  94. package/dist/swisspost-internet-header/{p-600247ef.system.entry.js.map → p-091fc70e.system.entry.js.map} +1 -1
  95. package/dist/swisspost-internet-header/{p-25872a84.system.entry.js → p-1fc8e907.system.entry.js} +2 -2
  96. package/dist/swisspost-internet-header/{p-25872a84.system.entry.js.map → p-1fc8e907.system.entry.js.map} +1 -1
  97. package/dist/swisspost-internet-header/{p-53670adf.system.js → p-3dbdb321.system.js} +2 -2
  98. package/dist/{esm-es5/klp-widget.controller-5b2b7ce7.js.map → swisspost-internet-header/p-3dbdb321.system.js.map} +1 -1
  99. package/dist/swisspost-internet-header/p-49deb110.system.entry.js +2 -0
  100. package/dist/swisspost-internet-header/{p-af44cf85.system.entry.js.map → p-49deb110.system.entry.js.map} +1 -1
  101. package/dist/swisspost-internet-header/p-4da826b9.system.entry.js +2 -0
  102. package/dist/swisspost-internet-header/{p-981fab9d.system.entry.js.map → p-4da826b9.system.entry.js.map} +1 -1
  103. package/dist/swisspost-internet-header/p-578afec5.entry.js +2 -0
  104. package/dist/swisspost-internet-header/{p-34205e78.entry.js.map → p-578afec5.entry.js.map} +1 -1
  105. package/dist/swisspost-internet-header/p-5efe2cfe.system.entry.js +2 -0
  106. package/dist/swisspost-internet-header/{p-04cf4eeb.system.entry.js.map → p-5efe2cfe.system.entry.js.map} +1 -1
  107. package/dist/swisspost-internet-header/p-65745315.entry.js +2 -0
  108. package/dist/swisspost-internet-header/{p-c96ad7d6.entry.js.map → p-65745315.entry.js.map} +1 -1
  109. package/dist/swisspost-internet-header/p-74b9dcce.entry.js +2 -0
  110. package/dist/swisspost-internet-header/{p-02019f0d.entry.js.map → p-74b9dcce.entry.js.map} +1 -1
  111. package/dist/swisspost-internet-header/p-824c4ba2.system.entry.js +2 -0
  112. package/dist/swisspost-internet-header/{p-1a2a0045.system.entry.js.map → p-824c4ba2.system.entry.js.map} +1 -1
  113. package/dist/swisspost-internet-header/p-aa30b98b.entry.js +2 -0
  114. package/dist/swisspost-internet-header/{p-809e69c8.entry.js.map → p-aa30b98b.entry.js.map} +1 -1
  115. package/dist/swisspost-internet-header/p-ada8f68c.system.entry.js +2 -0
  116. package/dist/swisspost-internet-header/p-ada8f68c.system.entry.js.map +1 -0
  117. package/dist/swisspost-internet-header/p-af1c6b03.entry.js +2 -0
  118. package/dist/swisspost-internet-header/{p-7d4ecdb6.entry.js.map → p-af1c6b03.entry.js.map} +1 -1
  119. package/dist/swisspost-internet-header/p-b379aa04.system.entry.js +2 -0
  120. package/dist/swisspost-internet-header/{p-e415699e.system.entry.js.map → p-b379aa04.system.entry.js.map} +1 -1
  121. package/dist/swisspost-internet-header/p-b9d3e280.entry.js +2 -0
  122. package/dist/swisspost-internet-header/p-b9d3e280.entry.js.map +1 -0
  123. package/dist/swisspost-internet-header/{p-0af4e3e8.entry.js → p-c96feb1f.entry.js} +2 -2
  124. package/dist/swisspost-internet-header/{p-0af4e3e8.entry.js.map → p-c96feb1f.entry.js.map} +1 -1
  125. package/dist/swisspost-internet-header/p-d856f80e.system.entry.js +2 -0
  126. package/dist/swisspost-internet-header/{p-c9cf2e49.system.entry.js.map → p-d856f80e.system.entry.js.map} +1 -1
  127. package/dist/swisspost-internet-header/{p-31a1433d.entry.js → p-d94b092c.entry.js} +3 -3
  128. package/dist/swisspost-internet-header/{p-31a1433d.entry.js.map → p-d94b092c.entry.js.map} +1 -1
  129. package/dist/swisspost-internet-header/p-ed2e9f2a.entry.js +2 -0
  130. package/dist/swisspost-internet-header/{p-a1e11213.entry.js.map → p-ed2e9f2a.entry.js.map} +1 -1
  131. package/dist/swisspost-internet-header/p-f70ab166.system.js +1 -1
  132. package/dist/swisspost-internet-header/swisspost-internet-header.css +1 -1
  133. package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
  134. package/package.json +2 -2
  135. package/readme.md +1 -1
  136. package/dist/cjs/klp-widget.controller-5dc378ef.js.map +0 -1
  137. package/dist/esm/klp-widget.controller-5b2b7ce7.js.map +0 -1
  138. package/dist/swisspost-internet-header/p-02019f0d.entry.js +0 -2
  139. package/dist/swisspost-internet-header/p-04cf4eeb.system.entry.js +0 -2
  140. package/dist/swisspost-internet-header/p-1a2a0045.system.entry.js +0 -2
  141. package/dist/swisspost-internet-header/p-34205e78.entry.js +0 -2
  142. package/dist/swisspost-internet-header/p-4c66f64c.system.entry.js +0 -2
  143. package/dist/swisspost-internet-header/p-4c66f64c.system.entry.js.map +0 -1
  144. package/dist/swisspost-internet-header/p-7d4ecdb6.entry.js +0 -2
  145. package/dist/swisspost-internet-header/p-809e69c8.entry.js +0 -2
  146. package/dist/swisspost-internet-header/p-981fab9d.system.entry.js +0 -2
  147. package/dist/swisspost-internet-header/p-98767123.entry.js +0 -2
  148. package/dist/swisspost-internet-header/p-98767123.entry.js.map +0 -1
  149. package/dist/swisspost-internet-header/p-a1e11213.entry.js +0 -2
  150. package/dist/swisspost-internet-header/p-af44cf85.system.entry.js +0 -2
  151. package/dist/swisspost-internet-header/p-c96ad7d6.entry.js +0 -2
  152. package/dist/swisspost-internet-header/p-c9cf2e49.system.entry.js +0 -2
  153. package/dist/swisspost-internet-header/p-e415699e.system.entry.js +0 -2
@@ -1 +1 @@
1
- {"version":3,"names":["parcelController","getTrackAndTraceApiUrl","id","lang","state","currentLanguage","encodeURIComponent","getTrackAndTraceRedirectUrl","query","packageTrackingRedirectUrl","replace","isParcel","async","searchConfig","parcelInfo","getParcelInfo","ok","redirectPattern","trackingNrPattern","RegExp","test","url","abort","AbortController","Promise","resolve","reject","fetch","signal","then","response","json","trackAndTraceResult","Object","assign","catch","error","name","console","message","timestamp","Date","toDateString","getParcelSuggestion","getSearchRedirectUrl","isTrackTraceId","getSearchPageUrl","_a","localizedConfig","header","search","undefined","searchPageUrl","searchParam","equalizeArrays","arrayA","arrayB","maxLength","coveoSliced","slice","Math","max","length","coveo","environment","prod","organisation","token","int01","int02","dev01","dev02","devs1","suggestionsController","getCoveoSuggestions","_b","config","searchHubName","searchPipelineName","method","headers","Authorization","coveoJSON","completions","map","completion","redirectUrl","expression","gisAPIUrl","placesUrl","hardNormalize","str","toLowerCase","normalize","placesController","queryPlaces","searchParameters","entries","limit","reduce","s","k","v","i","geocodeJSON","Error","info","locations","highlightPlacesString","place","reference","q","indexOfQuery","indexOf","substring","getPlacesUrl","location","HighlightedText","props","highlightClass","highlightedString","text","h","innerHTML","postSearchCss","PostSearch","connectedCallback","this","throttledResize","throttle","handleResize","window","addEventListener","passive","disconnectedCallback","removeEventListener","clearAllBodyScrollLocks","componentWillUpdate","searchFlyout","searchDropdownOpen","classList","remove","elementHasTransition","userPrefersReducedMotion","event","propertyName","componentDidUpdate","getBoundingClientRect","add","searchBox","focus","preventScroll","force","dropdownToggled","emit","open","element","host","coveoSuggestions","placeSuggestions","value","setFocus","setBodyScroll","shadowRoot","toggleButton","querySelector","innerWidth","disableBodyScroll","enableBodyScroll","trim","trackAndTraceInfo","all","parcelSuggestion","deselectSuggestion","handleKeyDown","selectedSuggestion","selectedHref","getAttribute","suggestions","querySelectorAll","key","href","startSearch","_c","parentElement","nextElementSibling","firstElementChild","updateSearchBoxWithSuggestion","_e","_d","previousElementSibling","handleMouseEnterSuggestion","target","handleMouseLeaveSuggestions","suggestedText","dataset","suggestionText","render","translations","showPortalRecommendations","searchRecommendations","links","Host","role","SvgSprite","class","type","onClick","e","toggleDropdown","searchToggleExpanded","searchToggle","SvgIcon","If","condition","ref","placeholder","flyoutSearchBoxFloatingLabel","autocomplete","el","onInput","handleSearchInput","onKeyDown","htmlFor","searchSubmit","title","onMouseLeave","recommendation","URL","label","onMouseEnter","inlineSvg","_f","sending","_h","_g","product","_k","_j","recipient","zipcode","_m","_l","city","_p","_o","suggestion","objectId","highlighted"],"sources":["./src/services/search/parcel.service.ts","./src/services/search/search.service.ts","./src/services/search/coveo.settings.ts","./src/services/search/coveo.service.ts","./src/services/search/places.settings.ts","./src/services/search/search-utilities.ts","./src/services/search/places.service.ts","./src/utils/highlighted.component.tsx","./src/components/post-search/post-search.scss?tag=post-search&encapsulation=shadow","./src/components/post-search/post-search.tsx"],"sourcesContent":["import { state } from '../../data/store';\nimport { ISearchConfig } from '../../models/header.model';\nimport { TrackAndTraceInfo } from '../../models/track-and-trace.model';\n\nlet parcelController: AbortController;\n\n// https://www.post.ch/api/trackandtrace?id=99.00.306600.01004883\n\n// Track and trace URL\nexport const getTrackAndTraceApiUrl = (id: string) => {\n const lang = state.currentLanguage;\n return `https://www.post.ch/${lang}/api/trackandtrace?id=${encodeURIComponent(id)}`;\n};\n\n// Get the redire\nexport const getTrackAndTraceRedirectUrl = (\n query: string,\n { packageTrackingRedirectUrl }: ISearchConfig,\n) => {\n return packageTrackingRedirectUrl.replace('{trackingNumber}', encodeURIComponent(query));\n};\n\n/**\n * Check whether a query is a tracking id\n *\n * @param query User query\n * @returns Boolean\n */\nexport const isParcel = async (query: string, searchConfig: ISearchConfig): Promise<boolean> => {\n const parcelInfo = await getParcelInfo(query, searchConfig);\n return parcelInfo.ok;\n};\n\n/**\n * Try to get parcel info from a query that is possibly a tracking id.\n * This is mainly used to check if a search should redirect to track&trace instead of the regular search.\n *\n * @param query User query that is possibly a tracking number\n * @returns Track and trace info\n */\nexport const getParcelInfo = async (\n query: string,\n { redirectPattern }: ISearchConfig,\n): Promise<TrackAndTraceInfo> => {\n const trackingNrPattern = new RegExp(redirectPattern);\n\n if (trackingNrPattern.test(query)) {\n const url = getTrackAndTraceApiUrl(query);\n\n if (parcelController) parcelController.abort();\n parcelController = new AbortController();\n\n return new Promise((resolve, reject) => {\n fetch(url, { signal: parcelController.signal })\n .then(response => response.json())\n .then((trackAndTraceResult: TrackAndTraceInfo) => {\n resolve({ ...trackAndTraceResult, ok: trackAndTraceResult.ok });\n })\n .catch(error => {\n if (error.name !== 'AbortError') {\n console.error(`Could not check track and trace API due to error: ${error.message}`);\n reject(error);\n }\n });\n });\n }\n\n return { ok: false, timestamp: new Date().toDateString() };\n};\n\n/**\n * Get parcel info if query is a parcel or null\n *\n * @param query Parcel id\n * @returns Parcel info and a redirect url or null if not a parcel\n */\nexport const getParcelSuggestion = async (\n query: string,\n searchConfig: ISearchConfig,\n): Promise<(TrackAndTraceInfo & { url: string }) | null> => {\n const parcelInfo = await getParcelInfo(query, searchConfig);\n return parcelInfo.ok\n ? { ...parcelInfo, url: getTrackAndTraceRedirectUrl(query, searchConfig) }\n : null;\n};\n","import { state } from '../../data/store';\nimport { ISearchConfig } from '../../models/header.model';\nimport { getTrackAndTraceRedirectUrl, isParcel } from './parcel.service';\n\n/**\n * Construct a search page url from a query\n *\n * @param query Search term\n * @returns\n */\nexport const getSearchRedirectUrl = async (\n query: string,\n searchConfig: ISearchConfig,\n): Promise<string | undefined> => {\n const isTrackTraceId = await isParcel(query, searchConfig);\n return isTrackTraceId\n ? getTrackAndTraceRedirectUrl(query, searchConfig)\n : getSearchPageUrl(query);\n};\n\n/**\n * Stitch toghether the search page URL\n *\n * @param query Search term\n * @returns Search page URL\n */\nexport const getSearchPageUrl = (query: string): string | undefined => {\n if (state.localizedConfig?.header.search === undefined) {\n return;\n }\n const { searchPageUrl } = state.localizedConfig.header.search;\n const searchParam = `#q=${encodeURIComponent(query)}`;\n return `${searchPageUrl}${searchParam}&t=AllTab`;\n};\n\n/**\n * Equalize the length of two arrays while filling up empty slots up to max. length\n *\n * @param arrayA First array\n * @param arrayB Second array\n * @param maxLength Max. length of result array\n * @returns Array with two resulting arrays\n */\nexport const equalizeArrays = <A, B>(arrayA: A[], arrayB: B[], maxLength = 7): [A[], B[]] => {\n const coveoSliced = arrayA.slice(0, Math.max(maxLength / 2, maxLength - arrayB.length));\n return [coveoSliced, arrayB.slice(0, maxLength - coveoSliced.length)];\n};\n","import { CoveoOptions } from '../../models/coveo.model';\n\n// Coveo constants\nexport const coveo: CoveoOptions = {\n url: 'https://platform-eu.cloud.coveo.com/rest/search/v2/querySuggest',\n environment: {\n prod: {\n organisation: 'postchagprod6ef4sbet',\n token: 'xx5b629890-23b9-4fbe-b601-0e8719186969',\n },\n int01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n int02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n dev01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n dev02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n devs1: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n test: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n },\n};\n","import { state } from '../../data/store';\nimport { CoveoCompletion, CoveoResponse } from '../../models/coveo.model';\nimport { coveo } from './coveo.settings';\nimport { getSearchPageUrl } from './search.service';\n\nlet suggestionsController: AbortController;\n\n/**\n * Get suggestions from coveo\n * https://docs.coveo.com/en/1459/build-a-search-ui/get-query-suggestions#context-object\n *\n * @param query Search term\n * @returns\n */\nexport const getCoveoSuggestions = async (query: string): Promise<CoveoCompletion[]> => {\n if (state.localizedConfig?.header?.search === undefined) return [];\n const config = state.localizedConfig.header.search;\n const { token, organisation } = coveo.environment[state.environment];\n const url = `${coveo.url}?q=${query}&locale=${state.currentLanguage}&searchHub=${config.searchHubName}&pipeline=${config.searchPipelineName}&organizationId=${organisation}`;\n\n if (suggestionsController) suggestionsController.abort();\n suggestionsController = new AbortController();\n\n return new Promise((resolve, reject) => {\n fetch(url, {\n signal: suggestionsController.signal,\n method: 'GET',\n headers: {\n Authorization: `Bearer ${token}`,\n },\n })\n .then(response => response.json())\n .then((coveoJSON: CoveoResponse) => {\n resolve(\n coveoJSON.completions.map(completion => ({\n ...completion,\n redirectUrl: getSearchPageUrl(completion.expression),\n })),\n );\n })\n .catch(error => {\n if (error.name !== 'AbortError') {\n console.error(\n `Fetching coveo suggestions failed, ${error}\\nDid you add \"*.coveo.com\" to your connect-src content security policy and tried turning off your adblocker?`,\n );\n reject(error);\n }\n });\n });\n};\n","// Implement some TOPOS logic into the header search\nexport const gisAPIUrl = 'https://places.post.ch/StandortSuche/StaoCacheService';\nexport const placesUrl = 'https://places.post.ch';\nexport const pois = [\n '001PST',\n '001MP24',\n '001AG-PICK',\n '001PFFIL',\n '001PFST',\n '001BZ',\n '001LZB',\n '001PZ',\n '001LZP',\n '001AL',\n];\n","/**\n * Transform to lowercase, extract accents to separate unicode chars,\n * replace all accent unicode chars so only standard latin chars remain\n * https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463#37511463\n *\n * @param str Input string\n * @returns\n */\nexport const hardNormalize = (str: string): string =>\n str\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n","import { state } from '../../data/store';\nimport { GeocodeLocation, GeocodeResponse } from '../../models/geocode.model';\nimport { gisAPIUrl, placesUrl } from './places.settings';\nimport { hardNormalize } from './search-utilities';\n\nlet placesController: AbortController;\n\n/**\n * Query the Gis API for locations and localities (pois)\n *\n * @param query User input string\n * @returns\n */\nexport const queryPlaces = async (query: string): Promise<GeocodeLocation[]> => {\n if (query.length === 0) {\n return [];\n }\n\n const searchParameters = Object.entries({\n query: encodeURIComponent(query),\n lang: state.currentLanguage,\n limit: 7,\n }).reduce((s, [k, v], i) => `${s}${i === 0 ? '?' : '&'}${k}=${v}`, '');\n\n const url = `${gisAPIUrl}/Geocode${searchParameters}`;\n\n if (placesController) placesController.abort();\n placesController = new AbortController();\n\n return new Promise((resolve, reject) => {\n fetch(url, { signal: placesController.signal })\n .then(response => response.json())\n .then((geocodeJSON: GeocodeResponse) => {\n if (!geocodeJSON.ok) throw new Error(geocodeJSON.info);\n resolve(geocodeJSON.locations);\n })\n .catch(error => {\n if (error.name !== 'AbortError') {\n console.error(\n `Fetching places failed, ${error}\\nDid you add \"places.post.ch\" to your connect-src content security policy?`,\n );\n reject(error);\n }\n });\n });\n};\n\n/**\n * Try to highlight place suggestions\n * Limitation: accented chars are not handled by this basic function\n *\n * @param query Search term\n * @param place Name of the suggested place\n * @returns\n */\nexport const highlightPlacesString = (query: string | undefined, place: string) => {\n if (query === undefined) return place;\n\n // Strip accents from the string\n const reference = hardNormalize(place);\n const q = hardNormalize(query);\n const indexOfQuery = reference.indexOf(q);\n\n if (indexOfQuery < 0) {\n return place;\n }\n\n return `${place.substring(0, indexOfQuery)}{${place.substring(\n indexOfQuery,\n indexOfQuery + query.length,\n )}}${place.substring(indexOfQuery + query.length, place.length)}`;\n};\n\n/**\n * Get the deeplink to any location found via geocoder\n *\n * @param location A location from the Gis API Geocode endpoint\n * @returns\n */\nexport const getPlacesUrl = (location: GeocodeLocation): string => {\n let url: string;\n\n if (location.id) {\n url = `${placesUrl}/${state.currentLanguage}/${location.id}/detail`;\n } else {\n url = `${placesUrl}?preselecttext=${encodeURIComponent(location.name)}`;\n }\n\n return url;\n};\n","import { h } from '@stencil/core';\n\nexport const HighlightedText = (props: { text: string; highlightClass?: string }) => {\n const highlightClass = props.highlightClass ?? 'bold';\n const highlightedString = props.text\n .replace(/[{(]/g, `<span class=\"${highlightClass}\">`)\n .replace(/[})]/g, '</span>')\n .replace(/[\\[\\]]/g, '');\n return <span innerHTML={highlightedString}></span>;\n};\n","@use '@swisspost/design-system-styles/core' as post;\n@use '@swisspost/design-system-styles/variables/color';\n@use '@swisspost/design-system-styles/components/forms';\n@use '@swisspost/design-system-styles/components/floating-label';\n@use '@swisspost/design-system-styles/components/grid';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n display: block;\n}\n\n.search,\n:host {\n height: 100%;\n}\n\n.search-button {\n @extend %nav-link;\n\n height: 100%;\n display: flex;\n align-items: center;\n cursor: pointer;\n padding-right: calc(1rem - 1px);\n padding-left: calc(1rem - 1px);\n\n @include mixins.min(lg) {\n padding: 0 calc(1.125rem - 1px);\n }\n\n @include mixins.min(xl) {\n padding: 0 calc(1.5rem - 1px);\n }\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n .visually-hidden {\n @include mixins.between(rg, lg) {\n @include mixins.reset-visually-hidden();\n\n font-weight: 300;\n margin-right: 0.5rem;\n cursor: pointer;\n }\n }\n}\n\n.flyout {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n background: white;\n overflow: auto;\n overscroll-behavior: contain;\n padding-top: 3.25rem;\n padding-bottom: 3.25rem;\n z-index: -1;\n transform: translateY(-100%);\n transition: transform 0.35s, box-shadow 0.35s;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n @include mixins.min(lg) {\n max-height: calc(100vh - var(--header-height) - var(--meta-header-height) - 1px);\n box-shadow: 0 0 1px 0 rgb(0 0 0 / 40%);\n\n &.open {\n box-shadow: 0 0 8px 0 rgb(0 0 0 / 40%);\n }\n }\n\n @include mixins.max(lg) {\n height: calc(100vh - var(--header-height) - 1px);\n }\n\n &.open {\n transform: translateY(0);\n }\n}\n\n.form-floating {\n .form-control,\n .form-control + label {\n padding-right: post.$input-padding-x * 3;\n }\n}\n\n.start-search-button {\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n padding-right: 1rem;\n padding-left: 1rem;\n display: flex;\n align-items: center;\n cursor: pointer;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n}\n\n.suggestions {\n margin: 1.5rem 0;\n\n a {\n padding: 0.75rem 1rem;\n\n &:hover,\n &:focus,\n &.selected {\n background: color.$gray-background;\n }\n\n &.parcel-suggestion {\n flex-wrap: wrap;\n }\n }\n}\n\n.search-recommendation__icon {\n height: 1.5em;\n width: 1.5em;\n}\n","import { Component, Host, h, State, Event, EventEmitter, Method, Element } from '@stencil/core';\nimport { throttle } from 'throttle-debounce';\nimport { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';\nimport { state } from '../../data/store';\nimport { CoveoCompletion } from '../../models/coveo.model';\nimport { GeocodeLocation } from '../../models/geocode.model';\nimport {\n DropdownElement,\n DropdownEvent,\n HasDropdown,\n IsFocusable,\n} from '../../models/header.model';\nimport { getSearchRedirectUrl, equalizeArrays } from '../../services/search/search.service';\nimport { getCoveoSuggestions } from '../../services/search/coveo.service';\nimport {\n getPlacesUrl,\n highlightPlacesString,\n queryPlaces,\n} from '../../services/search/places.service';\nimport { userPrefersReducedMotion, elementHasTransition } from '../../services/ui.service';\nimport { HighlightedText } from '../../utils/highlighted.component';\nimport { SvgSprite } from '../../utils/svg-sprite.component';\nimport { SvgIcon } from '../../utils/svg-icon.component';\nimport { TrackAndTraceInfo } from '../../models/track-and-trace.model';\nimport { getParcelSuggestion } from '../../services/search/parcel.service';\nimport { If } from '../../utils/if.component';\n\n@Component({\n tag: 'post-search',\n styleUrl: 'post-search.scss',\n shadow: true,\n})\nexport class PostSearch implements HasDropdown, IsFocusable {\n @State() searchDropdownOpen = false;\n @State() coveoSuggestions: CoveoCompletion[] = [];\n @State() placeSuggestions: GeocodeLocation[] = [];\n @State() parcelSuggestion: (TrackAndTraceInfo & { url: string }) | null = null;\n @Event() dropdownToggled: EventEmitter<DropdownEvent>;\n @Element() host: DropdownElement;\n private searchBox?: HTMLInputElement;\n private searchFlyout: HTMLElement | undefined;\n private throttledResize: throttle<() => void>;\n\n connectedCallback() {\n this.throttledResize = throttle(300, () => this.handleResize());\n window.addEventListener('resize', this.throttledResize, { passive: true });\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.throttledResize);\n clearAllBodyScrollLocks();\n }\n\n componentWillUpdate() {\n // Check if search flyout got set to close\n if (this.searchFlyout && !this.searchDropdownOpen) {\n this.searchFlyout.classList.remove('open');\n\n // Check if element has transition applied and whether user prefers to see animations or not\n if (elementHasTransition(this.searchFlyout, 'transform') && !userPrefersReducedMotion()) {\n // Wait for CSS transition 'transform' to end before continuing\n return new Promise<boolean>(resolve => {\n if (this.searchFlyout === undefined) {\n return resolve(true);\n }\n\n this.searchFlyout.addEventListener('transitionend', event => {\n if (event.propertyName === 'transform') {\n resolve(true);\n }\n });\n });\n }\n }\n }\n\n componentDidUpdate() {\n // Search flyout got set to open\n if (this.searchFlyout && this.searchDropdownOpen) {\n // Force browser to redraw/refresh DOM before adding 'open' class\n this.searchFlyout.getBoundingClientRect();\n this.searchFlyout.classList.add('open');\n }\n\n // Focus on the searchBox whenever the dropdown is opened\n if (this.searchDropdownOpen && this.searchBox) {\n this.searchBox.focus({ preventScroll: true });\n }\n }\n\n public async toggleDropdown(event?: Event): Promise<boolean>;\n public async toggleDropdown(force?: boolean): Promise<boolean>;\n\n /**\n * Toggle the dropdown and optionally force an open/closed state\n * @param force Boolean to force open/closed state\n * @returns Boolean indicating open state of the component\n */\n @Method()\n async toggleDropdown(force?: unknown) {\n this.searchDropdownOpen =\n force === undefined || typeof force !== 'boolean' ? !this.searchDropdownOpen : force;\n this.dropdownToggled.emit({ open: this.searchDropdownOpen, element: this.host });\n\n if (!this.searchDropdownOpen) {\n // Reset suggestions when dropdown closes\n this.coveoSuggestions = [];\n this.placeSuggestions = [];\n if (this.searchBox) this.searchBox.value = '';\n this.setFocus();\n } else {\n // Get basic suggestions when dropdown opens\n try {\n this.coveoSuggestions = await getCoveoSuggestions('');\n } catch {}\n }\n\n this.setBodyScroll();\n\n return this.searchDropdownOpen;\n }\n\n /**\n * Sets the focus on the search button\n */\n @Method()\n public async setFocus() {\n const shadowRoot = this.host.shadowRoot;\n if (shadowRoot === null) {\n return;\n }\n const toggleButton = shadowRoot.querySelector<HTMLElement>('.search-button');\n if (toggleButton) {\n toggleButton.focus();\n }\n }\n\n private handleResize() {\n // Only enable/disable body scroll on resize if the search dropdown is open, otherwise this could lead to side effects in other controls\n if (this.searchDropdownOpen) {\n this.setBodyScroll();\n }\n }\n\n /**\n * Disable or re-enable body scrolling, depending on whether search dropdown is open or closed in mobile view (width < 1024px)\n */\n private setBodyScroll() {\n if (this.searchDropdownOpen && window.innerWidth < 1024) {\n disableBodyScroll(this.searchFlyout);\n } else {\n enableBodyScroll(this.searchFlyout);\n }\n }\n\n /**\n * Fetch suggestions from all available sources\n */\n private async handleSearchInput() {\n if (this.searchBox === undefined || state.localizedConfig?.header.search === undefined) {\n return;\n }\n const query = this.searchBox.value.trim();\n\n const [placeSuggestions, coveoSuggestions, trackAndTraceInfo] = await Promise.all([\n queryPlaces(query),\n getCoveoSuggestions(query),\n getParcelSuggestion(query, state.localizedConfig.header.search),\n ]);\n\n this.parcelSuggestion = trackAndTraceInfo;\n\n // Parcel suggestion is more important than any other\n if (trackAndTraceInfo) {\n this.placeSuggestions = [];\n this.coveoSuggestions = [];\n } else {\n [this.coveoSuggestions, this.placeSuggestions] = equalizeArrays(\n coveoSuggestions,\n placeSuggestions,\n 7,\n );\n }\n\n this.deselectSuggestion();\n }\n\n /**\n * Start search on enter\n * @param event\n */\n private handleKeyDown(event: KeyboardEvent) {\n if (this.searchFlyout === undefined) {\n return;\n }\n\n const selectedSuggestion = this.searchFlyout.querySelector<HTMLElement>(\n '.suggestions > li > a.selected',\n );\n const selectedHref = selectedSuggestion?.getAttribute('href') ?? null;\n const suggestions = this.searchFlyout.querySelectorAll('.suggestions > li > a');\n\n switch (event.key.toLowerCase()) {\n case 'enter':\n if (selectedHref !== null) {\n window.location.href = selectedHref;\n } else {\n this.startSearch();\n }\n\n break;\n case 'arrowdown':\n this.deselectSuggestion();\n\n if (selectedSuggestion?.parentElement?.nextElementSibling?.firstElementChild) {\n // Select next suggestion if there's any, otherwise none will be selected\n selectedSuggestion.parentElement.nextElementSibling.firstElementChild.classList.add(\n 'selected',\n );\n // If there are any suggestions, select first suggestion in list\n } else if (suggestions.length > 0) {\n suggestions[0].classList.add('selected');\n }\n\n this.updateSearchBoxWithSuggestion();\n\n break;\n case 'arrowup':\n this.deselectSuggestion();\n\n if (selectedSuggestion?.parentElement?.previousElementSibling?.firstElementChild) {\n // Select previous suggestion if there's any, otherwise none will be selected\n\n selectedSuggestion.parentElement.previousElementSibling.firstElementChild.classList.add(\n 'selected',\n );\n // If there are any suggestions, select last suggestion in list\n } else if (suggestions.length > 0) {\n suggestions[suggestions.length - 1].classList.add('selected');\n }\n\n this.updateSearchBoxWithSuggestion();\n\n break;\n }\n }\n\n /**\n * Set selected suggestion on mouse enter\n * @param event\n */\n private handleMouseEnterSuggestion(event: MouseEvent) {\n this.deselectSuggestion();\n\n // Set hovered suggestion element as selected\n (event.target as HTMLElement).classList.add('selected');\n }\n\n /**\n * Set selected suggestion on mouse enter\n * @param event\n */\n private handleMouseLeaveSuggestions() {\n this.deselectSuggestion();\n }\n\n /**\n * Deselect any previously selected suggestion\n */\n private deselectSuggestion() {\n if (this.searchFlyout === undefined) return;\n\n const selectedSuggestion = this.searchFlyout.querySelector('.suggestions .selected');\n\n if (selectedSuggestion) {\n selectedSuggestion.classList.remove('selected');\n }\n }\n\n /**\n * Update search box with selected suggestion\n */\n private updateSearchBoxWithSuggestion() {\n if (this.searchFlyout === undefined) return;\n\n // Get the newly selected suggestion\n const selectedSuggestion = this.searchFlyout.querySelector<HTMLElement>(\n '.suggestions > li > a.selected',\n );\n const suggestedText = selectedSuggestion?.dataset.suggestionText;\n\n // Update search box value with selected suggestion text\n if (suggestedText !== undefined && this.searchBox) {\n this.searchBox.value = suggestedText;\n }\n }\n\n /**\n * Redirect to the post search page\n */\n private async startSearch() {\n if (this.searchBox && state.localizedConfig?.header.search) {\n const redirectUrl = await getSearchRedirectUrl(\n this.searchBox.value.trim(),\n state.localizedConfig.header.search,\n );\n if (!redirectUrl) return;\n window.location.href = redirectUrl;\n }\n }\n\n render() {\n if (state.localizedConfig?.header === undefined) {\n return;\n }\n const { translations, search } = state.localizedConfig.header;\n const showPortalRecommendations =\n this.searchBox?.value === '' && search.searchRecommendations?.links.length > 0;\n\n return (\n <Host role=\"search\">\n <SvgSprite />\n <div class=\"search\">\n <button\n id=\"post-internet-header-search-button\"\n class=\"search-button\"\n type=\"button\"\n aria-expanded={`${this.searchDropdownOpen}`}\n onClick={e => this.toggleDropdown(e)}\n >\n <span class=\"visually-hidden\">\n {this.searchDropdownOpen\n ? translations.searchToggleExpanded\n : translations.searchToggle}\n </span>\n <SvgIcon name={this.searchDropdownOpen ? 'pi-close' : 'pi-search'} />\n </button>\n <If condition={this.searchDropdownOpen}>\n <div class=\"flyout\" ref={e => (this.searchFlyout = e)}>\n <div class=\"container box\">\n <div class=\"row\">\n <div class=\"col-xs-12 col-md-10 col-lg-8\">\n <div class=\"form-group form-floating\">\n <input\n type=\"text\"\n role=\"searchbox\"\n id=\"searchBox\"\n class=\"form-control form-control-lg\"\n placeholder={translations.flyoutSearchBoxFloatingLabel}\n autocomplete=\"off\"\n ref={el => (this.searchBox = el)}\n onInput={() => this.handleSearchInput()}\n onKeyDown={e => this.handleKeyDown(e)}\n />\n <label htmlFor=\"searchBox\">{translations.flyoutSearchBoxFloatingLabel}</label>\n <button\n onClick={() => this.startSearch()}\n class=\"nav-link start-search-button\"\n >\n <span class=\"visually-hidden\">{translations.searchSubmit}</span>\n <SvgIcon name=\"pi-search\" />\n </button>\n </div>\n {showPortalRecommendations && (\n <h2 id=\"post-internet-header-search-recommendations-title\" class=\"bold\">\n {search.searchRecommendations.title}\n </h2>\n )}\n <ul\n class=\"suggestions no-list\"\n onMouseLeave={() => this.handleMouseLeaveSuggestions()}\n aria-labelledby={\n showPortalRecommendations\n ? 'post-internet-header-search-recommendations-title'\n : undefined\n }\n >\n {showPortalRecommendations &&\n search.searchRecommendations.links.map(recommendation => (\n <li key={recommendation.href}>\n <a\n class=\"nav-link search-recommendation\"\n href={new URL(recommendation.href, 'https://post.ch').href}\n data-suggestion-text={recommendation.label}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <span\n class=\"search-recommendation__icon\"\n innerHTML={recommendation.inlineSvg}\n ></span>\n <span>{recommendation.label}</span>\n </a>\n </li>\n ))}\n {this.parcelSuggestion && this.parcelSuggestion.ok && (\n <li>\n <a\n class=\"nav-link parcel-suggestion\"\n href={this.parcelSuggestion.url}\n data-suggestion-text={this.searchBox?.value}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <SvgIcon name=\"pi-letter-parcel\" />\n <span class=\"bold\">{this.parcelSuggestion?.sending?.id}:&nbsp;</span>\n <span>\n {this.parcelSuggestion?.sending?.product},{' '}\n {this.parcelSuggestion?.sending?.recipient.zipcode}{' '}\n {this.parcelSuggestion?.sending?.recipient.city},{' '}\n {this.parcelSuggestion?.sending?.state}\n </span>\n </a>\n </li>\n )}\n {!showPortalRecommendations &&\n this.coveoSuggestions &&\n this.coveoSuggestions.map(suggestion => (\n <li key={suggestion.objectId}>\n <a\n class=\"nav-link\"\n href={suggestion.redirectUrl}\n data-suggestion-text={suggestion.expression}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <SvgIcon name=\"pi-search\" />\n <HighlightedText text={suggestion.highlighted} />\n </a>\n </li>\n ))}\n {!showPortalRecommendations &&\n this.placeSuggestions &&\n this.placeSuggestions.map(suggestion => (\n <li key={suggestion.id}>\n <a\n class=\"nav-link\"\n href={getPlacesUrl(suggestion)}\n data-suggestion-text={suggestion.name}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <SvgIcon name=\"pi-place\" />\n <HighlightedText\n text={highlightPlacesString(\n this.searchBox?.value?.trim(),\n suggestion.name,\n )}\n />\n </a>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n </div>\n </If>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"iVAIA,IAAIA,EAKG,MAAMC,EAA0BC,IACrC,MAAMC,EAAOC,EAAMC,gBACnB,MAAO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IkK,GACxB5H,EAAA,MAAI0D,IAAKkE,EAAWC,UAClB7H,EAAA,KACEmF,MAAM,WACNxB,KAAMiE,EAAWhK,YAAW,uBACNgK,EAAW/J,WACjC+I,aAActB,GAAKjF,KAAKgE,2BAA2BiB,IAEnDtF,EAAC0F,EAAO,CAAC/K,KAAK,cACdqF,EAACL,EAAe,CAACI,KAAM6H,EAAWE,mBAIxCjD,GACAxE,KAAKgC,kBACLhC,KAAKgC,iBAAiB3E,KAAIkK,I,QAAc,OACtC5H,EAAA,MAAI0D,IAAKkE,EAAWpP,IAClBwH,EAAA,KACEmF,MAAM,WACNxB,KAAMlE,EAAamI,GAAW,uBACRA,EAAWjN,KACjCiM,aAActB,GAAKjF,KAAKgE,2BAA2BiB,IAEnDtF,EAAC0F,EAAO,CAAC/K,KAAK,aACdqF,EAACL,EAAe,CACdI,KAAMb,GACJjC,GAAA5B,EAAAgF,KAAKsB,aAAS,MAAAtG,SAAA,SAAAA,EAAEiH,SAAK,MAAArF,SAAA,SAAAA,EAAE8F,OACvB6E,EAAWjN,SAId,W"}
1
+ {"version":3,"names":["parcelController","getTrackAndTraceApiUrl","id","lang","state","currentLanguage","encodeURIComponent","getTrackAndTraceRedirectUrl","query","packageTrackingRedirectUrl","replace","isParcel","async","searchConfig","parcelInfo","getParcelInfo","ok","redirectPattern","trackingNrPattern","RegExp","test","url","abort","AbortController","Promise","resolve","reject","fetch","signal","then","response","json","trackAndTraceResult","Object","assign","catch","error","name","console","message","timestamp","Date","toDateString","getParcelSuggestion","getSearchRedirectUrl","isTrackTraceId","getSearchPageUrl","_a","localizedConfig","header","search","undefined","searchPageUrl","searchParam","equalizeArrays","arrayA","arrayB","maxLength","coveoSliced","slice","Math","max","length","coveo","environment","prod","organisation","token","int01","int02","dev01","dev02","devs1","suggestionsController","getCoveoSuggestions","_b","config","searchHubName","searchPipelineName","method","headers","Authorization","coveoJSON","completions","map","completion","redirectUrl","expression","gisAPIUrl","placesUrl","hardNormalize","str","toLowerCase","normalize","placesController","queryPlaces","searchParameters","entries","limit","reduce","s","k","v","i","geocodeJSON","Error","info","locations","highlightPlacesString","place","reference","q","indexOfQuery","indexOf","substring","getPlacesUrl","location","HighlightedText","props","highlightClass","highlightedString","text","h","innerHTML","postSearchCss","PostSearch","connectedCallback","this","throttledResize","throttle","handleResize","window","addEventListener","passive","disconnectedCallback","removeEventListener","clearAllBodyScrollLocks","componentWillUpdate","searchFlyout","searchDropdownOpen","classList","remove","elementHasTransition","userPrefersReducedMotion","event","propertyName","componentDidUpdate","getBoundingClientRect","add","searchBox","focus","preventScroll","force","dropdownToggled","emit","open","element","host","coveoSuggestions","placeSuggestions","value","setFocus","setBodyScroll","shadowRoot","toggleButton","querySelector","innerWidth","disableBodyScroll","enableBodyScroll","trim","trackAndTraceInfo","all","parcelSuggestion","deselectSuggestion","handleKeyDown","selectedSuggestion","selectedHref","getAttribute","suggestions","querySelectorAll","key","href","startSearch","_c","parentElement","nextElementSibling","firstElementChild","updateSearchBoxWithSuggestion","_e","_d","previousElementSibling","handleMouseEnterSuggestion","target","handleMouseLeaveSuggestions","suggestedText","dataset","suggestionText","render","translations","showPortalRecommendations","searchRecommendations","links","Host","role","SvgSprite","class","type","onClick","e","toggleDropdown","searchToggleExpanded","searchToggle","SvgIcon","If","condition","ref","placeholder","flyoutSearchBoxFloatingLabel","autocomplete","el","onInput","handleSearchInput","onKeyDown","htmlFor","searchSubmit","title","onMouseLeave","recommendation","URL","label","onMouseEnter","inlineSvg","_f","sending","_h","_g","product","_k","_j","recipient","zipcode","_m","_l","city","_p","_o","suggestion","objectId","highlighted"],"sources":["./src/services/search/parcel.service.ts","./src/services/search/search.service.ts","./src/services/search/coveo.settings.ts","./src/services/search/coveo.service.ts","./src/services/search/places.settings.ts","./src/services/search/search-utilities.ts","./src/services/search/places.service.ts","./src/utils/highlighted.component.tsx","./src/components/post-search/post-search.scss?tag=post-search&encapsulation=shadow","./src/components/post-search/post-search.tsx"],"sourcesContent":["import { state } from '../../data/store';\nimport { ISearchConfig } from '../../models/header.model';\nimport { TrackAndTraceInfo } from '../../models/track-and-trace.model';\n\nlet parcelController: AbortController;\n\n// https://www.post.ch/api/trackandtrace?id=99.00.306600.01004883\n\n// Track and trace URL\nexport const getTrackAndTraceApiUrl = (id: string) => {\n const lang = state.currentLanguage;\n return `https://www.post.ch/${lang}/api/trackandtrace?id=${encodeURIComponent(id)}`;\n};\n\n// Get the redire\nexport const getTrackAndTraceRedirectUrl = (\n query: string,\n { packageTrackingRedirectUrl }: ISearchConfig,\n) => {\n return packageTrackingRedirectUrl.replace('{trackingNumber}', encodeURIComponent(query));\n};\n\n/**\n * Check whether a query is a tracking id\n *\n * @param query User query\n * @returns Boolean\n */\nexport const isParcel = async (query: string, searchConfig: ISearchConfig): Promise<boolean> => {\n const parcelInfo = await getParcelInfo(query, searchConfig);\n return parcelInfo.ok;\n};\n\n/**\n * Try to get parcel info from a query that is possibly a tracking id.\n * This is mainly used to check if a search should redirect to track&trace instead of the regular search.\n *\n * @param query User query that is possibly a tracking number\n * @returns Track and trace info\n */\nexport const getParcelInfo = async (\n query: string,\n { redirectPattern }: ISearchConfig,\n): Promise<TrackAndTraceInfo> => {\n const trackingNrPattern = new RegExp(redirectPattern);\n\n if (trackingNrPattern.test(query)) {\n const url = getTrackAndTraceApiUrl(query);\n\n if (parcelController) parcelController.abort();\n parcelController = new AbortController();\n\n return new Promise((resolve, reject) => {\n fetch(url, { signal: parcelController.signal })\n .then(response => response.json())\n .then((trackAndTraceResult: TrackAndTraceInfo) => {\n resolve({ ...trackAndTraceResult, ok: trackAndTraceResult.ok });\n })\n .catch(error => {\n if (error.name !== 'AbortError') {\n console.error(`Could not check track and trace API due to error: ${error.message}`);\n reject(error);\n }\n });\n });\n }\n\n return { ok: false, timestamp: new Date().toDateString() };\n};\n\n/**\n * Get parcel info if query is a parcel or null\n *\n * @param query Parcel id\n * @returns Parcel info and a redirect url or null if not a parcel\n */\nexport const getParcelSuggestion = async (\n query: string,\n searchConfig: ISearchConfig,\n): Promise<(TrackAndTraceInfo & { url: string }) | null> => {\n const parcelInfo = await getParcelInfo(query, searchConfig);\n return parcelInfo.ok\n ? { ...parcelInfo, url: getTrackAndTraceRedirectUrl(query, searchConfig) }\n : null;\n};\n","import { state } from '../../data/store';\nimport { ISearchConfig } from '../../models/header.model';\nimport { getTrackAndTraceRedirectUrl, isParcel } from './parcel.service';\n\n/**\n * Construct a search page url from a query\n *\n * @param query Search term\n * @returns\n */\nexport const getSearchRedirectUrl = async (\n query: string,\n searchConfig: ISearchConfig,\n): Promise<string | undefined> => {\n const isTrackTraceId = await isParcel(query, searchConfig);\n return isTrackTraceId\n ? getTrackAndTraceRedirectUrl(query, searchConfig)\n : getSearchPageUrl(query);\n};\n\n/**\n * Stitch toghether the search page URL\n *\n * @param query Search term\n * @returns Search page URL\n */\nexport const getSearchPageUrl = (query: string): string | undefined => {\n if (state.localizedConfig?.header.search === undefined) {\n return;\n }\n const { searchPageUrl } = state.localizedConfig.header.search;\n const searchParam = `#q=${encodeURIComponent(query)}`;\n return `${searchPageUrl}${searchParam}&t=AllTab`;\n};\n\n/**\n * Equalize the length of two arrays while filling up empty slots up to max. length\n *\n * @param arrayA First array\n * @param arrayB Second array\n * @param maxLength Max. length of result array\n * @returns Array with two resulting arrays\n */\nexport const equalizeArrays = <A, B>(arrayA: A[], arrayB: B[], maxLength = 7): [A[], B[]] => {\n const coveoSliced = arrayA.slice(0, Math.max(maxLength / 2, maxLength - arrayB.length));\n return [coveoSliced, arrayB.slice(0, maxLength - coveoSliced.length)];\n};\n","import { CoveoOptions } from '../../models/coveo.model';\n\n// Coveo constants\nexport const coveo: CoveoOptions = {\n url: 'https://platform-eu.cloud.coveo.com/rest/search/v2/querySuggest',\n environment: {\n prod: {\n organisation: 'postchagprod6ef4sbet',\n token: 'xx5b629890-23b9-4fbe-b601-0e8719186969',\n },\n int01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n int02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n dev01: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n dev02: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n devs1: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n test: {\n organisation: 'postchagnonprods5sq57qt',\n token: 'xx7c0e52ab-3de2-4fbd-b9a7-6ca6abd532b4',\n },\n },\n};\n","import { state } from '../../data/store';\nimport { CoveoCompletion, CoveoResponse } from '../../models/coveo.model';\nimport { coveo } from './coveo.settings';\nimport { getSearchPageUrl } from './search.service';\n\nlet suggestionsController: AbortController;\n\n/**\n * Get suggestions from coveo\n * https://docs.coveo.com/en/1459/build-a-search-ui/get-query-suggestions#context-object\n *\n * @param query Search term\n * @returns\n */\nexport const getCoveoSuggestions = async (query: string): Promise<CoveoCompletion[]> => {\n if (state.localizedConfig?.header?.search === undefined) return [];\n const config = state.localizedConfig.header.search;\n const { token, organisation } = coveo.environment[state.environment];\n const url = `${coveo.url}?q=${query}&locale=${state.currentLanguage}&searchHub=${config.searchHubName}&pipeline=${config.searchPipelineName}&organizationId=${organisation}`;\n\n if (suggestionsController) suggestionsController.abort();\n suggestionsController = new AbortController();\n\n return new Promise((resolve, reject) => {\n fetch(url, {\n signal: suggestionsController.signal,\n method: 'GET',\n headers: {\n Authorization: `Bearer ${token}`,\n },\n })\n .then(response => response.json())\n .then((coveoJSON: CoveoResponse) => {\n resolve(\n coveoJSON.completions.map(completion => ({\n ...completion,\n redirectUrl: getSearchPageUrl(completion.expression),\n })),\n );\n })\n .catch(error => {\n if (error.name !== 'AbortError') {\n console.error(\n `Fetching coveo suggestions failed, ${error}\\nDid you add \"*.coveo.com\" to your connect-src content security policy and tried turning off your adblocker?`,\n );\n reject(error);\n }\n });\n });\n};\n","// Implement some TOPOS logic into the header search\nexport const gisAPIUrl = 'https://places.post.ch/StandortSuche/StaoCacheService';\nexport const placesUrl = 'https://places.post.ch';\nexport const pois = [\n '001PST',\n '001MP24',\n '001AG-PICK',\n '001PFFIL',\n '001PFST',\n '001BZ',\n '001LZB',\n '001PZ',\n '001LZP',\n '001AL',\n];\n","/**\n * Transform to lowercase, extract accents to separate unicode chars,\n * replace all accent unicode chars so only standard latin chars remain\n * https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463#37511463\n *\n * @param str Input string\n * @returns\n */\nexport const hardNormalize = (str: string): string =>\n str\n .toLowerCase()\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '');\n","import { state } from '../../data/store';\nimport { GeocodeLocation, GeocodeResponse } from '../../models/geocode.model';\nimport { gisAPIUrl, placesUrl } from './places.settings';\nimport { hardNormalize } from './search-utilities';\n\nlet placesController: AbortController;\n\n/**\n * Query the Gis API for locations and localities (pois)\n *\n * @param query User input string\n * @returns\n */\nexport const queryPlaces = async (query: string): Promise<GeocodeLocation[]> => {\n if (query.length === 0) {\n return [];\n }\n\n const searchParameters = Object.entries({\n query: encodeURIComponent(query),\n lang: state.currentLanguage,\n limit: 7,\n }).reduce((s, [k, v], i) => `${s}${i === 0 ? '?' : '&'}${k}=${v}`, '');\n\n const url = `${gisAPIUrl}/Geocode${searchParameters}`;\n\n if (placesController) placesController.abort();\n placesController = new AbortController();\n\n return new Promise((resolve, reject) => {\n fetch(url, { signal: placesController.signal })\n .then(response => response.json())\n .then((geocodeJSON: GeocodeResponse) => {\n if (!geocodeJSON.ok) throw new Error(geocodeJSON.info);\n resolve(geocodeJSON.locations);\n })\n .catch(error => {\n if (error.name !== 'AbortError') {\n console.error(\n `Fetching places failed, ${error}\\nDid you add \"places.post.ch\" to your connect-src content security policy?`,\n );\n reject(error);\n }\n });\n });\n};\n\n/**\n * Try to highlight place suggestions\n * Limitation: accented chars are not handled by this basic function\n *\n * @param query Search term\n * @param place Name of the suggested place\n * @returns\n */\nexport const highlightPlacesString = (query: string | undefined, place: string) => {\n if (query === undefined) return place;\n\n // Strip accents from the string\n const reference = hardNormalize(place);\n const q = hardNormalize(query);\n const indexOfQuery = reference.indexOf(q);\n\n if (indexOfQuery < 0) {\n return place;\n }\n\n return `${place.substring(0, indexOfQuery)}{${place.substring(\n indexOfQuery,\n indexOfQuery + query.length,\n )}}${place.substring(indexOfQuery + query.length, place.length)}`;\n};\n\n/**\n * Get the deeplink to any location found via geocoder\n *\n * @param location A location from the Gis API Geocode endpoint\n * @returns\n */\nexport const getPlacesUrl = (location: GeocodeLocation): string => {\n let url: string;\n\n if (location.id) {\n url = `${placesUrl}/${state.currentLanguage}/${location.id}/detail`;\n } else {\n url = `${placesUrl}?preselecttext=${encodeURIComponent(location.name)}`;\n }\n\n return url;\n};\n","import { h } from '@stencil/core';\n\nexport const HighlightedText = (props: { text: string; highlightClass?: string }) => {\n const highlightClass = props.highlightClass ?? 'bold';\n const highlightedString = props.text\n .replace(/[{(]/g, `<span class=\"${highlightClass}\">`)\n .replace(/[})]/g, '</span>')\n .replace(/[\\[\\]]/g, '');\n return <span innerHTML={highlightedString}></span>;\n};\n","@use '@swisspost/design-system-styles/core' as post;\n@use '@swisspost/design-system-styles/variables/color';\n@use '@swisspost/design-system-styles/components/forms';\n@use '@swisspost/design-system-styles/components/floating-label';\n@use '@swisspost/design-system-styles/components/grid';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n display: block;\n}\n\n.search,\n:host {\n height: 100%;\n}\n\n.search-button {\n @extend %nav-link;\n\n height: 100%;\n display: flex;\n align-items: center;\n cursor: pointer;\n padding-right: calc(1rem - 1px);\n padding-left: calc(1rem - 1px);\n\n @include mixins.min(lg) {\n padding: 0 calc(1.125rem - 1px);\n }\n\n @include mixins.min(xl) {\n padding: 0 calc(1.5rem - 1px);\n }\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n .visually-hidden {\n @include mixins.between(rg, lg) {\n @include mixins.reset-visually-hidden();\n\n font-weight: 300;\n margin-right: 0.5rem;\n cursor: pointer;\n }\n }\n}\n\n.flyout {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n background: white;\n overflow: auto;\n overscroll-behavior: contain;\n padding-top: 3.25rem;\n padding-bottom: 3.25rem;\n z-index: -1;\n transform: translateY(-100%);\n transition: transform 0.35s, box-shadow 0.35s;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n @include mixins.min(lg) {\n max-height: calc(100vh - var(--header-height) - var(--meta-header-height) - 1px);\n box-shadow: 0 0 1px 0 rgb(0 0 0 / 40%);\n\n &.open {\n box-shadow: 0 0 8px 0 rgb(0 0 0 / 40%);\n }\n }\n\n @include mixins.max(lg) {\n height: calc(100vh - var(--header-height) - 1px);\n }\n\n &.open {\n transform: translateY(0);\n }\n}\n\n.form-floating {\n .form-control,\n .form-control + label {\n padding-right: post.$input-padding-x * 3;\n }\n}\n\n.start-search-button {\n position: absolute;\n top: 0;\n right: 0;\n height: 100%;\n padding-right: 1rem;\n padding-left: 1rem;\n display: flex;\n align-items: center;\n cursor: pointer;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n}\n\n.suggestions {\n margin: 1.5rem 0;\n\n a {\n padding: 0.75rem 1rem;\n\n &:hover,\n &:focus,\n &.selected {\n background: color.$gray-background;\n }\n\n &.parcel-suggestion {\n flex-wrap: wrap;\n }\n }\n}\n\n.search-recommendation__icon {\n height: 1.5em;\n width: 1.5em;\n}\n","import { Component, Host, h, State, Event, EventEmitter, Method, Element } from '@stencil/core';\nimport { throttle } from 'throttle-debounce';\nimport { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock';\nimport { state } from '../../data/store';\nimport { CoveoCompletion } from '../../models/coveo.model';\nimport { GeocodeLocation } from '../../models/geocode.model';\nimport {\n DropdownElement,\n DropdownEvent,\n HasDropdown,\n IsFocusable,\n} from '../../models/header.model';\nimport { getSearchRedirectUrl, equalizeArrays } from '../../services/search/search.service';\nimport { getCoveoSuggestions } from '../../services/search/coveo.service';\nimport {\n getPlacesUrl,\n highlightPlacesString,\n queryPlaces,\n} from '../../services/search/places.service';\nimport { userPrefersReducedMotion, elementHasTransition } from '../../services/ui.service';\nimport { HighlightedText } from '../../utils/highlighted.component';\nimport { SvgSprite } from '../../utils/svg-sprite.component';\nimport { SvgIcon } from '../../utils/svg-icon.component';\nimport { TrackAndTraceInfo } from '../../models/track-and-trace.model';\nimport { getParcelSuggestion } from '../../services/search/parcel.service';\nimport { If } from '../../utils/if.component';\n\n@Component({\n tag: 'post-search',\n styleUrl: 'post-search.scss',\n shadow: true,\n})\nexport class PostSearch implements HasDropdown, IsFocusable {\n @State() searchDropdownOpen = false;\n @State() coveoSuggestions: CoveoCompletion[] = [];\n @State() placeSuggestions: GeocodeLocation[] = [];\n @State() parcelSuggestion: (TrackAndTraceInfo & { url: string }) | null = null;\n @Event() dropdownToggled: EventEmitter<DropdownEvent>;\n @Element() host: DropdownElement;\n private searchBox?: HTMLInputElement;\n private searchFlyout: HTMLElement | undefined;\n private throttledResize: throttle<() => void>;\n\n connectedCallback() {\n this.throttledResize = throttle(300, () => this.handleResize());\n window.addEventListener('resize', this.throttledResize, { passive: true });\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.throttledResize);\n clearAllBodyScrollLocks();\n }\n\n componentWillUpdate() {\n // Check if search flyout got set to close\n if (this.searchFlyout && !this.searchDropdownOpen) {\n this.searchFlyout.classList.remove('open');\n\n // Check if element has transition applied and whether user prefers to see animations or not\n if (elementHasTransition(this.searchFlyout, 'transform') && !userPrefersReducedMotion()) {\n // Wait for CSS transition 'transform' to end before continuing\n return new Promise<boolean>(resolve => {\n if (this.searchFlyout === undefined) {\n return resolve(true);\n }\n\n this.searchFlyout.addEventListener('transitionend', event => {\n if (event.propertyName === 'transform') {\n resolve(true);\n }\n });\n });\n }\n }\n }\n\n componentDidUpdate() {\n // Search flyout got set to open\n if (this.searchFlyout && this.searchDropdownOpen) {\n // Force browser to redraw/refresh DOM before adding 'open' class\n this.searchFlyout.getBoundingClientRect();\n this.searchFlyout.classList.add('open');\n }\n\n // Focus on the searchBox whenever the dropdown is opened\n if (this.searchDropdownOpen && this.searchBox) {\n this.searchBox.focus({ preventScroll: true });\n }\n }\n\n public async toggleDropdown(event?: Event): Promise<boolean>;\n public async toggleDropdown(force?: boolean): Promise<boolean>;\n\n /**\n * Toggle the dropdown and optionally force an open/closed state\n * @param force Boolean to force open/closed state\n * @returns Boolean indicating open state of the component\n */\n @Method()\n async toggleDropdown(force?: unknown) {\n this.searchDropdownOpen =\n force === undefined || typeof force !== 'boolean' ? !this.searchDropdownOpen : force;\n this.dropdownToggled.emit({ open: this.searchDropdownOpen, element: this.host });\n\n if (!this.searchDropdownOpen) {\n // Reset suggestions when dropdown closes\n this.coveoSuggestions = [];\n this.placeSuggestions = [];\n if (this.searchBox) this.searchBox.value = '';\n this.setFocus();\n } else {\n // Get basic suggestions when dropdown opens\n try {\n this.coveoSuggestions = await getCoveoSuggestions('');\n } catch {}\n }\n\n this.setBodyScroll();\n\n return this.searchDropdownOpen;\n }\n\n /**\n * Sets the focus on the search button\n */\n @Method()\n public async setFocus() {\n const shadowRoot = this.host.shadowRoot;\n if (shadowRoot === null) {\n return;\n }\n const toggleButton = shadowRoot.querySelector<HTMLElement>('.search-button');\n if (toggleButton) {\n toggleButton.focus();\n }\n }\n\n private handleResize() {\n // Only enable/disable body scroll on resize if the search dropdown is open, otherwise this could lead to side effects in other controls\n if (this.searchDropdownOpen) {\n this.setBodyScroll();\n }\n }\n\n /**\n * Disable or re-enable body scrolling, depending on whether search dropdown is open or closed in mobile view (width < 1024px)\n */\n private setBodyScroll() {\n if (this.searchDropdownOpen && window.innerWidth < 1024) {\n disableBodyScroll(this.searchFlyout);\n } else {\n enableBodyScroll(this.searchFlyout);\n }\n }\n\n /**\n * Fetch suggestions from all available sources\n */\n private async handleSearchInput() {\n if (this.searchBox === undefined || state.localizedConfig?.header.search === undefined) {\n return;\n }\n const query = this.searchBox.value.trim();\n\n const [placeSuggestions, coveoSuggestions, trackAndTraceInfo] = await Promise.all([\n queryPlaces(query),\n getCoveoSuggestions(query),\n getParcelSuggestion(query, state.localizedConfig.header.search),\n ]);\n\n this.parcelSuggestion = trackAndTraceInfo;\n\n // Parcel suggestion is more important than any other\n if (trackAndTraceInfo) {\n this.placeSuggestions = [];\n this.coveoSuggestions = [];\n } else {\n [this.coveoSuggestions, this.placeSuggestions] = equalizeArrays(\n coveoSuggestions,\n placeSuggestions,\n 7,\n );\n }\n\n this.deselectSuggestion();\n }\n\n /**\n * Start search on enter\n * @param event\n */\n private handleKeyDown(event: KeyboardEvent) {\n if (this.searchFlyout === undefined) {\n return;\n }\n\n const selectedSuggestion = this.searchFlyout.querySelector<HTMLElement>(\n '.suggestions > li > a.selected',\n );\n const selectedHref = selectedSuggestion?.getAttribute('href') ?? null;\n const suggestions = this.searchFlyout.querySelectorAll('.suggestions > li > a');\n\n switch (event.key.toLowerCase()) {\n case 'enter':\n if (selectedHref !== null) {\n window.location.href = selectedHref;\n } else {\n this.startSearch();\n }\n\n break;\n case 'arrowdown':\n this.deselectSuggestion();\n\n if (selectedSuggestion?.parentElement?.nextElementSibling?.firstElementChild) {\n // Select next suggestion if there's any, otherwise none will be selected\n selectedSuggestion.parentElement.nextElementSibling.firstElementChild.classList.add(\n 'selected',\n );\n // If there are any suggestions, select first suggestion in list\n } else if (suggestions.length > 0) {\n suggestions[0].classList.add('selected');\n }\n\n this.updateSearchBoxWithSuggestion();\n\n break;\n case 'arrowup':\n this.deselectSuggestion();\n\n if (selectedSuggestion?.parentElement?.previousElementSibling?.firstElementChild) {\n // Select previous suggestion if there's any, otherwise none will be selected\n\n selectedSuggestion.parentElement.previousElementSibling.firstElementChild.classList.add(\n 'selected',\n );\n // If there are any suggestions, select last suggestion in list\n } else if (suggestions.length > 0) {\n suggestions[suggestions.length - 1].classList.add('selected');\n }\n\n this.updateSearchBoxWithSuggestion();\n\n break;\n }\n }\n\n /**\n * Set selected suggestion on mouse enter\n * @param event\n */\n private handleMouseEnterSuggestion(event: MouseEvent) {\n this.deselectSuggestion();\n\n // Set hovered suggestion element as selected\n (event.target as HTMLElement).classList.add('selected');\n }\n\n /**\n * Set selected suggestion on mouse enter\n * @param event\n */\n private handleMouseLeaveSuggestions() {\n this.deselectSuggestion();\n }\n\n /**\n * Deselect any previously selected suggestion\n */\n private deselectSuggestion() {\n if (this.searchFlyout === undefined) return;\n\n const selectedSuggestion = this.searchFlyout.querySelector('.suggestions .selected');\n\n if (selectedSuggestion) {\n selectedSuggestion.classList.remove('selected');\n }\n }\n\n /**\n * Update search box with selected suggestion\n */\n private updateSearchBoxWithSuggestion() {\n if (this.searchFlyout === undefined) return;\n\n // Get the newly selected suggestion\n const selectedSuggestion = this.searchFlyout.querySelector<HTMLElement>(\n '.suggestions > li > a.selected',\n );\n const suggestedText = selectedSuggestion?.dataset.suggestionText;\n\n // Update search box value with selected suggestion text\n if (suggestedText !== undefined && this.searchBox) {\n this.searchBox.value = suggestedText;\n }\n }\n\n /**\n * Redirect to the post search page\n */\n private async startSearch() {\n if (this.searchBox && state.localizedConfig?.header.search) {\n const redirectUrl = await getSearchRedirectUrl(\n this.searchBox.value.trim(),\n state.localizedConfig.header.search,\n );\n if (!redirectUrl) return;\n window.location.href = redirectUrl;\n }\n }\n\n render() {\n if (state.localizedConfig?.header === undefined) {\n return;\n }\n const { translations, search } = state.localizedConfig.header;\n const showPortalRecommendations =\n this.searchBox?.value === '' && search.searchRecommendations?.links.length > 0;\n\n return (\n <Host role=\"search\">\n <SvgSprite />\n <div class=\"search\">\n <button\n id=\"post-internet-header-search-button\"\n class=\"search-button\"\n type=\"button\"\n aria-expanded={`${this.searchDropdownOpen}`}\n onClick={e => this.toggleDropdown(e)}\n >\n <span class=\"visually-hidden\">\n {this.searchDropdownOpen\n ? translations.searchToggleExpanded\n : translations.searchToggle}\n </span>\n <SvgIcon name={this.searchDropdownOpen ? 'pi-close' : 'pi-search'} />\n </button>\n <If condition={this.searchDropdownOpen}>\n <div class=\"flyout\" ref={e => (this.searchFlyout = e)}>\n <div class=\"container box\">\n <div class=\"row\">\n <div class=\"col-xs-12 col-md-10 col-lg-8\">\n <div class=\"form-group form-floating\">\n <input\n type=\"text\"\n role=\"searchbox\"\n id=\"searchBox\"\n class=\"form-control form-control-lg\"\n placeholder={translations.flyoutSearchBoxFloatingLabel}\n autocomplete=\"off\"\n ref={el => (this.searchBox = el)}\n onInput={() => this.handleSearchInput()}\n onKeyDown={e => this.handleKeyDown(e)}\n />\n <label htmlFor=\"searchBox\">{translations.flyoutSearchBoxFloatingLabel}</label>\n <button\n onClick={() => this.startSearch()}\n class=\"nav-link start-search-button\"\n >\n <span class=\"visually-hidden\">{translations.searchSubmit}</span>\n <SvgIcon name=\"pi-search\" />\n </button>\n </div>\n {showPortalRecommendations && (\n <h2 id=\"post-internet-header-search-recommendations-title\" class=\"bold\">\n {search.searchRecommendations.title}\n </h2>\n )}\n <ul\n class=\"suggestions no-list\"\n onMouseLeave={() => this.handleMouseLeaveSuggestions()}\n aria-labelledby={\n showPortalRecommendations\n ? 'post-internet-header-search-recommendations-title'\n : undefined\n }\n >\n {showPortalRecommendations &&\n search.searchRecommendations.links.map(recommendation => (\n <li key={recommendation.href}>\n <a\n class=\"nav-link search-recommendation\"\n href={new URL(recommendation.href, 'https://post.ch').href}\n data-suggestion-text={recommendation.label}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <span\n class=\"search-recommendation__icon\"\n innerHTML={recommendation.inlineSvg}\n ></span>\n <span>{recommendation.label}</span>\n </a>\n </li>\n ))}\n {this.parcelSuggestion && this.parcelSuggestion.ok && (\n <li>\n <a\n class=\"nav-link parcel-suggestion\"\n href={this.parcelSuggestion.url}\n data-suggestion-text={this.searchBox?.value}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <SvgIcon name=\"pi-letter-parcel\" />\n <span class=\"bold\">{this.parcelSuggestion?.sending?.id}:&nbsp;</span>\n <span>\n {this.parcelSuggestion?.sending?.product},{' '}\n {this.parcelSuggestion?.sending?.recipient.zipcode}{' '}\n {this.parcelSuggestion?.sending?.recipient.city},{' '}\n {this.parcelSuggestion?.sending?.state}\n </span>\n </a>\n </li>\n )}\n {!showPortalRecommendations &&\n this.coveoSuggestions &&\n this.coveoSuggestions.map(suggestion => (\n <li key={suggestion.objectId}>\n <a\n class=\"nav-link\"\n href={suggestion.redirectUrl}\n data-suggestion-text={suggestion.expression}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <SvgIcon name=\"pi-search\" />\n <HighlightedText text={suggestion.highlighted} />\n </a>\n </li>\n ))}\n {!showPortalRecommendations &&\n this.placeSuggestions &&\n this.placeSuggestions.map(suggestion => (\n <li key={suggestion.id}>\n <a\n class=\"nav-link\"\n href={getPlacesUrl(suggestion)}\n data-suggestion-text={suggestion.name}\n onMouseEnter={e => this.handleMouseEnterSuggestion(e)}\n >\n <SvgIcon name=\"pi-place\" />\n <HighlightedText\n text={highlightPlacesString(\n this.searchBox?.value?.trim(),\n suggestion.name,\n )}\n />\n </a>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n </div>\n </If>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"iVAIA,IAAIA,EAKG,MAAMC,EAA0BC,IACrC,MAAMC,EAAOC,EAAMC,gBACnB,MAAO,uBAAuBF,0BAA6BG,mBAAmBJ,IAAK,EAI9E,MAAMK,EAA8B,CACzCC,GACEC,gCAEKA,EAA2BC,QAAQ,mBAAoBJ,mBAAmBE,IAS5E,MAAMG,EAAWC,MAAOJ,EAAeK,KAC5C,MAAMC,QAAmBC,EAAcP,EAAOK,GAC9C,OAAOC,EAAWE,EAAE,EAUf,MAAMD,EAAgBH,MAC3BJ,GACES,sBAEF,MAAMC,EAAoB,IAAI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C,iBAAiB3E,KAAIkK,I,QAAc,OACtC5H,EAAA,MAAI0D,IAAKkE,EAAWpP,IAClBwH,EAAA,KACEmF,MAAM,WACNxB,KAAMlE,EAAamI,GAAW,uBACRA,EAAWjN,KACjCiM,aAActB,GAAKjF,KAAKgE,2BAA2BiB,IAEnDtF,EAAC0F,EAAO,CAAC/K,KAAK,aACdqF,EAACL,EAAe,CACdI,KAAMb,GACJjC,GAAA5B,EAAAgF,KAAKsB,aAAS,MAAAtG,SAAA,SAAAA,EAAEiH,SAAK,MAAArF,SAAA,SAAAA,EAAE8F,OACvB6E,EAAWjN,SAId,W"}
@@ -0,0 +1,2 @@
1
+ var __awaiter=this&&this.__awaiter||function(t,i,e,n){function o(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n["throw"](t))}catch(t){r(t)}}function l(t){t.done?e(t.value):o(t.value).then(a,s)}l((n=n.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return l([t,i])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(n=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;o=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];o=0}finally{n=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-f5935384.system.js","./p-9b4d5e90.system.js","./p-65e18d30.system.js","./p-88aac12c.system.js","./p-ce02164e.system.js","./p-70805f8f.system.js","./p-77394e93.system.js"],(function(t){"use strict";var i,e,n,o,r,a,s,l,u,f,d;return{setters:[function(t){i=t.h;e=t.r;n=t.c;o=t.H;r=t.g},function(t){a=t.t},function(t){s=t.s},function(t){l=t.u},function(t){u=t.t},function(t){f=t.S},function(t){d=t.S}],execute:function(){var c=function(t){var e,n,o;var r=t.level.url?"a":"button";return i(r,{class:{"main-link":true,active:!!t.level.isActiveOverride,focus:t.isOpen},href:t.level.url,title:((e=t.level.title)===null||e===void 0?void 0:e.trim())&&((n=t.level.title)===null||n===void 0?void 0:n.trim())!==((o=t.level.text)===null||o===void 0?void 0:o.trim())?t.level.title:undefined,tabindex:t.level.url?undefined:0,"aria-haspopup":!t.level.noFlyout+"","aria-expanded":t.level.noFlyout?null:t.isOpen+"",onTouchEnd:function(i){return t.onTouchEnd(i)},onKeyDown:function(i){return t.onKeyDown(i)},onClick:function(i){return t.onClick(i)}},i("span",null,t.level.text),t.level.isActiveOverride?i("span",{class:"visually-hidden"},u("Active navigation element")):null,i("svg",{"aria-hidden":"true"},i("use",{href:"#pi-pointy-arrow-right"})))};var m='.flyout-nav,.flyout-column h3{font-size:0.9375rem}@media (min-width: 600px){.flyout-nav,.flyout-column h3{font-size:1rem}}@media (min-width: 1024px){.flyout-nav,.flyout-column h3{font-size:1.0625rem}}.flyout-title{font-size:1.0625rem}@media (min-width: 600px){.flyout-title{font-size:1.25rem}}@media (min-width: 1024px){.flyout-title{font-size:1.5rem}}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:700;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:700;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:400;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:400;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:300;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:300;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:transparent;border:none;border-radius:0;padding:0}.nav-link,.main-link,.flyout-close-button,.flyout-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0, 0, 0, 0.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus),.main-link:is(:focus-visible,:focus-within,.pretend-focus),.flyout-close-button:is(:focus-visible,:focus-within,.pretend-focus),.flyout-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.main-link:hover,.flyout-close-button:hover,.flyout-link:hover,.nav-link:focus,.main-link:focus,.flyout-close-button:focus,.flyout-link:focus{color:black}.nav-link:focus-visible,.main-link:focus-visible,.flyout-close-button:focus-visible,.flyout-link:focus-visible{z-index:1;position:relative}.nav-link>svg,.main-link>svg,.flyout-close-button>svg,.flyout-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span,.main-link>span,.flyout-close-button>span,.flyout-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list,.main-container,.flyout-linklist{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Frutiger Neue For Post", system-ui, sans-serif}button{font:inherit;padding:0}a,button{border-radius:3px;outline:none;outline-offset:2px;}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:3px;position:relative;z-index:1}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active){svg{color:white}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px) and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1440.98px){.hidden-xxl{display:none}}:host{--host-window-height:var(--window-height, 100vh);--calculated-header-height:calc(var(--header-height) + 1px);display:block;min-width:0;height:var(--header-height)}:host(.no-animation) *{-webkit-animation:none !important;animation:none !important;-webkit-transition:none !important;transition:none !important}@media (min-width: 1024px){.main-navigation,.main-container,.main-container li,.main-link{height:100%}}.main-navigation{font-size:1.125rem}@media (min-width: 1024px){.main-navigation{font-size:1rem;margin:0 0.75rem}}@media (min-width: 1280px){.main-navigation{font-size:1.125rem}}@media (min-width: 1441px){.main-navigation{font-size:1.25rem}}@media (max-width: 1023.98px){.main-navigation{position:absolute;top:var(--calculated-header-height);left:0;background:white;height:calc(var(--host-window-height) - var(--calculated-header-height));width:100%;margin:0;overflow:hidden scroll;-webkit-overflow-scrolling:touch;-ms-scroll-chaining:none;overscroll-behavior:contain;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;z-index:-1;visibility:hidden;-webkit-transform:translateY(-100%);transform:translateY(-100%);-webkit-transition:visibility 0.35s, -webkit-transform 0.35s;transition:visibility 0.35s, -webkit-transform 0.35s;transition:transform 0.35s, visibility 0.35s;transition:transform 0.35s, visibility 0.35s, -webkit-transform 0.35s}}@media (max-width: 1023.98px) and (prefers-reduced-motion: reduce){.main-navigation{-webkit-transition:none;transition:none}}@media (max-width: 1023.98px){.main-navigation.open{-webkit-transform:translateY(0);transform:translateY(0);visibility:visible}}.main-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start}@media (max-width: 1023.98px){.main-container{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:start;justify-content:flex-start;padding-top:2.5rem;padding-bottom:2.5rem}.main-container>li+li{border-top:1px solid hsl(0, 0%, 90%)}}@media (min-width: 1024px){.main-container{padding-right:0;padding-left:0}}.main-container>li{-ms-flex:0 1 auto;flex:0 1 auto;min-width:0}.main-link{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-right:0.75rem;padding-left:0.75rem;text-align:left;cursor:pointer;width:100%}@media (min-width: 1024px){.main-link svg{display:none}}@media (max-width: 1023.98px){.main-link{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;font-weight:300;padding:0.625rem 0;width:100%;text-align:left}.main-link svg{width:1.5rem;height:1.5rem}}.main-link span{overflow:hidden;text-overflow:ellipsis}.main-link,.flyout-link{position:relative;color:black}.main-link::after,.flyout-link::after{content:"";position:absolute;bottom:-1px;left:0;width:100%;height:4px;background-color:transparent;opacity:0;-webkit-transform:scaleX(0.8);transform:scaleX(0.8);-webkit-transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)}@media (prefers-reduced-motion: reduce){.main-link::after,.flyout-link::after{-webkit-transition:none;transition:none}}.main-link:hover::after,.main-link.focus::after,.flyout-link:hover::after,.flyout-link.focus::after{background-color:hsl(0, 0%, 80%);opacity:1;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)}.main-link.active,.flyout-link.active{font-weight:700}.main-link.active::after,.flyout-link.active::after{background-color:#fc0;opacity:1;-webkit-transform:scale(1);transform:scale(1)}.flyout{left:0;width:100%;background:white;padding-bottom:3rem;overflow:auto;-ms-scroll-chaining:none;overscroll-behavior:contain;visibility:hidden}@media (min-width: 1024px){.flyout{position:absolute;top:100%;max-height:calc(100vh - var(--header-height) - var(--meta-header-height) - 1px);z-index:-1;-webkit-box-shadow:0 0 1px 0 rgba(0, 0, 0, 0.4);box-shadow:0 0 1px 0 rgba(0, 0, 0, 0.4);-webkit-transform:translateY(-100%);transform:translateY(-100%)}.flyout.open{-webkit-box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.4);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.4);-webkit-transform:translateY(0);transform:translateY(0)}}@media (max-width: 1023.98px){.flyout{position:fixed;top:0;height:100%;z-index:1;-webkit-transform:translateX(100%);transform:translateX(100%)}.flyout.open{-webkit-transform:translateX(0);transform:translateX(0)}}.flyout.open{visibility:visible}.flyout.animate{-webkit-transition:visibility 0.35s, -webkit-transform 0.35s, -webkit-box-shadow 0.35s;transition:visibility 0.35s, -webkit-transform 0.35s, -webkit-box-shadow 0.35s;transition:transform 0.35s, visibility 0.35s, box-shadow 0.35s;transition:transform 0.35s, visibility 0.35s, box-shadow 0.35s, -webkit-transform 0.35s, -webkit-box-shadow 0.35s}@media (prefers-reduced-motion: reduce){.flyout.animate{-webkit-transition:none;transition:none}}.flyout-nav{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;min-height:3.5rem;-webkit-box-sizing:content-box;box-sizing:content-box}.flyout-row{display:-ms-flexbox;display:flex;gap:1.5rem}@media (max-width: 1023.98px){.flyout-row{display:grid;grid-template-columns:1fr 1fr}}@media (max-width: 599.98px){.flyout-row{grid-template-columns:1fr}}.flyout-column{-ms-flex:1;flex:1;max-width:25%}@media (max-width: 1023.98px){.flyout-column{max-width:none}}.flyout-column h3{margin-top:0}.flyout-back-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;font-size:1rem;font-weight:400;cursor:pointer}@media (max-width: 599.98px){.flyout-back-button{padding-right:16px;padding-left:16px}}@media (min-width: 600px) and (max-width: 1023.98px){.flyout-back-button{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.flyout-back-button{padding-right:40px;padding-left:40px}}.flyout-back-button svg{width:1.5rem;height:1.5rem}@media (min-width: 1024px){.flyout-back-button{display:none}}.flyout-close-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-left:auto;padding:0 1.5rem;cursor:pointer}.flyout-close-button svg{width:1.5rem;height:1.5rem}@media (max-width: 1023.98px){.flyout-close-button{display:none}}.flyout-linklist li{border-top:1px solid hsl(0, 0%, 90%)}.flyout-linklist:first-child>li{border-top-color:transparent}.flyout-link{display:block;padding:0.75rem 0}.flyout-title{margin:2.5rem 0 1.5rem 0}@media (min-width: 1024px){.flyout-title{display:none}}';var h=t("post_main_navigation",function(){function t(t){e(this,t);this.dropdownToggled=n(this,"dropdownToggled",7);this.flyoutToggled=n(this,"flyoutToggled",7);this.resizeTimer=null;this.mouseLeaveTimer=null;this.mouseEnterTimer=null;this.activeFlyout=undefined;this.mobileMenuOpen=undefined}t.prototype.connectedCallback=function(){var t=this;this.throttledResize=a(300,(function(){return t.handleResize()}));window.addEventListener("resize",this.throttledResize,{passive:true});this.setWindowHeight()};t.prototype.disconnectedCallback=function(){window.removeEventListener("resize",this.throttledResize);if(this.mouseEnterTimer!==null)window.clearTimeout(this.mouseEnterTimer);if(this.mouseLeaveTimer!==null)window.clearTimeout(this.mouseLeaveTimer)};t.prototype.handleResize=function(){var t=this;this.host.classList.add("no-animation");if(this.resizeTimer!==null)window.clearTimeout(this.resizeTimer);this.resizeTimer=window.setTimeout((function(){t.host.classList.remove("no-animation")}),300);this.setWindowHeight()};t.prototype.setWindowHeight=function(){var t=this;if(!this.host){return}this.host.style.setProperty("--window-height","".concat(window.innerHeight,"px"));window.setTimeout((function(){t.host.style.setProperty("--window-height","".concat(window.innerHeight,"px"))}),100)};t.prototype.openFlyout=function(t){var i;var e=(i=this.host.shadowRoot)===null||i===void 0?void 0:i.getElementById(t);if(e&&this.activeFlyout!==""){this.addFlyoutAnimation(e,"expand")}this.activeFlyout=t;this.flyoutToggled.emit(t);this.setWindowHeight();if(this.mouseLeaveTimer!==null){window.clearTimeout(this.mouseLeaveTimer);this.mouseLeaveTimer=null}};t.prototype.closeFlyout=function(t,i){if(i===void 0){i=true}var e;if(t===undefined)return;var n=(e=this.host.shadowRoot)===null||e===void 0?void 0:e.getElementById(t);if(n){this.addFlyoutAnimation(n,"collapse",i)}this.activeFlyout=null;this.flyoutToggled.emit()};t.prototype.addFlyoutAnimation=function(t,i,e){if(e===void 0){e=true}if(!l()){t.classList.add("animate");t.addEventListener("transitionend",(function(){var n,o,r;if(e){if(i==="expand"){(n=t.querySelector("button.flyout-back-button"))===null||n===void 0?void 0:n.focus()}else if(i==="collapse"){(r=(o=t.parentElement)===null||o===void 0?void 0:o.querySelector("a.main-link"))===null||r===void 0?void 0:r.focus()}}t.classList.remove("animate")}),{once:true})}};t.prototype.isActiveFlyout=function(t){return t===this.activeFlyout};t.prototype.handleMouseEnter=function(t){var i=this;if(this.mouseEnterTimer!==null){window.clearTimeout(this.mouseEnterTimer);this.mouseEnterTimer=null}if(this.mouseLeaveTimer&&this.activeFlyout===t.id){window.clearTimeout(this.mouseLeaveTimer);this.mouseLeaveTimer=null}if(window.innerWidth>=1024&&t.flyout.length>0&&this.activeFlyout!==t.id){this.mouseEnterTimer=window.setTimeout((function(){i.mouseEnterTimer=null;if(t.id!==undefined)i.openFlyout(t.id)}),200)}};t.prototype.handleMouseLeave=function(t){var i=this;if(this.mouseEnterTimer!==null){window.clearTimeout(this.mouseEnterTimer)}if(this.activeFlyout&&this.activeFlyout!==t.id){return}if(window.innerWidth>=1024&&t.flyout.length>0){this.mouseLeaveTimer=window.setTimeout((function(){i.closeFlyout(t.id,false)}),300)}};t.prototype.handleTouchEnd=function(t,i){if(!this.isActiveFlyout(i.id)&&!i.noFlyout){if(t.cancelable)t.preventDefault();if(i.id)this.openFlyout(i.id)}};t.prototype.handleKeyPress=function(t,i){if(t.key==="Enter"&&!this.isActiveFlyout(i.id)&&!i.noFlyout){t.preventDefault();if(i.id)this.openFlyout(i.id)}};t.prototype.handleClick=function(t,i){if(!this.isActiveFlyout(i.id)&&!i.noFlyout){t.preventDefault();if(i.id)this.openFlyout(i.id)}};t.prototype.toggleDropdown=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.mobileMenuOpen=t===undefined?!this.mobileMenuOpen:t;this.dropdownToggled.emit({open:this.mobileMenuOpen,element:this.host});if(t===false){this.closeFlyout()}this.setWindowHeight();return[2,this.mobileMenuOpen]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(e){i=(t=this.host.shadowRoot)===null||t===void 0?void 0:t.querySelector(".main-link");if(i){i.focus()}return[2]}))}))};t.prototype.setActiveFlyout=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){this.activeFlyout=t;this.flyoutToggled.emit(this.activeFlyout);return[2]}))}))};t.prototype.render=function(){var t=this;var e;if(((e=s.localizedConfig)===null||e===void 0?void 0:e.header)===undefined)return;var n=s.localizedConfig.header;return i(o,null,i(f,null),i("nav",{"aria-label":n.translations.navMainAriaLabel,id:"post-internet-header-main-navigation",class:{"main-navigation":true,open:this.mobileMenuOpen},role:"menu"},i("ul",{class:"main-container container"},n.navMain.map((function(e){return i("li",{key:e.text,onMouseLeave:function(){return t.handleMouseLeave(e)},onMouseEnter:function(){return t.handleMouseEnter(e)}},i(c,{level:e,isOpen:t.isActiveFlyout(e.id),onTouchEnd:function(i){return t.handleTouchEnd(i,e)},onKeyDown:function(i){return t.handleKeyPress(i,e)},onClick:function(i){return t.handleClick(i,e)}}),!e.noFlyout?r.bind(t)(e):null)}))),i("slot",null)));function r(t){var e=this;return i("div",{id:t.id,class:{flyout:true,open:this.isActiveFlyout(t.id)}},i("div",{class:"wide-container"},i("div",{class:"flyout-nav"},i("button",{class:"nav-link flyout-back-button",onClick:function(){return e.closeFlyout(t.id)}},i(d,{name:"pi-pointy-arrow-right",classNames:"mirrored"}),i("span",null,n.translations.backButtonText)),i("button",{class:"flyout-close-button",onClick:function(){return e.closeFlyout(t.id)}},i("span",{class:"visually-hidden"},t.text,", ",n.translations.mobileNavToggleClose),i(d,{name:"pi-close"}))),i("h2",{class:"flyout-title container"},i("a",{href:t.url,class:"nav-link"},t.text)),i("div",{class:"flyout-row container"},t.flyout.map((function(e,n){return i("div",{key:e.title,class:"flyout-column"},e.title?i("h3",{id:"".concat(t.id,"-column-").concat(n)},e.title):null,i("ul",{class:"flyout-linklist","aria-labelledby":e.title?"".concat(t.id,"-column-").concat(n):undefined},e.linkList.map((function(t){return i("li",{key:t.url},i("a",{class:{"flyout-link":true,active:!!(t===null||t===void 0?void 0:t.isActiveOverride)},href:t.url,target:t.target},t.title,(t===null||t===void 0?void 0:t.isActiveOverride)?i("span",{class:"visually-hidden"},", ",u("Active navigation element")):null))}))))})))))}};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());h.style=m}}}));
2
+ //# sourceMappingURL=p-824c4ba2.system.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LevelOneAction","props","TagName","level","url","h","class","active","isActiveOverride","focus","isOpen","href","title","_a","trim","_b","_c","text","undefined","tabindex","noFlyout","onTouchEnd","e","onKeyDown","onClick","translate","postMainNavigationCss","PostMainNavigation","exports","this","resizeTimer","mouseLeaveTimer","mouseEnterTimer","class_1","prototype","connectedCallback","_this","throttledResize","throttle","handleResize","window","addEventListener","passive","setWindowHeight","disconnectedCallback","removeEventListener","clearTimeout","host","classList","add","setTimeout","remove","style","setProperty","concat","innerHeight","openFlyout","id","flyout","shadowRoot","getElementById","activeFlyout","addFlyoutAnimation","flyoutToggled","emit","closeFlyout","manageFocus","direction","userPrefersReducedMotion","querySelector","parentElement","once","isActiveFlyout","handleMouseEnter","innerWidth","length","handleMouseLeave","handleTouchEnd","event","cancelable","preventDefault","handleKeyPress","key","handleClick","toggleDropdown","force","mobileMenuOpen","dropdownToggled","open","element","setFocus","firstLink","setActiveFlyout","render","state","localizedConfig","header","headerConfig","Host","SvgSprite","translations","navMainAriaLabel","role","navMain","map","levelOne","onMouseLeave","onMouseEnter","renderLevelOneFlyout","bind","SvgIcon","name","classNames","backButtonText","mobileNavToggleClose","i","linkList","link","target"],"sources":["src/components/post-main-navigation/components/level-one-action.component.tsx","src/components/post-main-navigation/post-main-navigation.scss?tag=post-main-navigation&encapsulation=shadow","src/components/post-main-navigation/post-main-navigation.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { NavMainEntity } from '../../../models/header.model';\nimport { translate } from '../../../services/language.service';\n\nexport const LevelOneAction = (props: {\n level: NavMainEntity;\n isOpen: boolean;\n onTouchEnd: (e: any) => void;\n onKeyDown: (e: any) => void;\n onClick: (e: any) => void;\n}) => {\n const TagName = props.level.url ? 'a' : 'button';\n\n return (\n <TagName\n class={{\n 'main-link': true,\n 'active': !!props.level.isActiveOverride,\n 'focus': props.isOpen,\n }}\n href={props.level.url}\n title={\n props.level.title?.trim() && props.level.title?.trim() !== props.level.text?.trim()\n ? props.level.title\n : undefined\n }\n tabindex={props.level.url ? undefined : 0}\n aria-haspopup={!props.level.noFlyout + ''}\n aria-expanded={props.level.noFlyout ? null : props.isOpen + ''}\n onTouchEnd={e => props.onTouchEnd(e)}\n onKeyDown={e => props.onKeyDown(e)}\n onClick={e => props.onClick(e)}\n >\n <span>{props.level.text}</span>\n {props.level.isActiveOverride ? (\n <span class=\"visually-hidden\">{translate('Active navigation element')}</span>\n ) : null}\n <svg aria-hidden=\"true\">\n <use href=\"#pi-pointy-arrow-right\" />\n </svg>\n </TagName>\n );\n};\n","@use '@swisspost/design-system-styles/variables/color';\n@use '@swisspost/design-system-styles/placeholders/text';\n@use '@swisspost/design-system-styles/functions';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n --host-window-height: var(--window-height, 100vh);\n --calculated-header-height: calc(var(--header-height) + 1px);\n\n display: block;\n min-width: 0;\n height: var(--header-height);\n}\n\n:host(.no-animation) {\n * {\n animation: none !important;\n transition: none !important;\n }\n}\n\n.main-navigation,\n.main-container,\n.main-container li,\n.main-link {\n @include mixins.min(lg) {\n height: 100%;\n }\n}\n\n.main-navigation {\n font-size: functions.px-to-rem(18px);\n\n @include mixins.min(lg) {\n font-size: functions.px-to-rem(16px);\n margin: 0 0.75rem;\n }\n\n @include mixins.min(xl) {\n font-size: functions.px-to-rem(18px);\n }\n\n @include mixins.min(xxl) {\n font-size: functions.px-to-rem(20px);\n }\n\n @include mixins.max(lg) {\n position: absolute;\n top: var(--calculated-header-height);\n left: 0;\n background: white;\n height: calc(var(--host-window-height) - var(--calculated-header-height));\n width: 100%;\n margin: 0;\n overflow: hidden scroll;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n z-index: -1;\n visibility: hidden;\n transform: translateY(-100%);\n transition: transform 0.35s, visibility 0.35s;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n &.open {\n transform: translateY(0);\n visibility: visible;\n }\n }\n}\n\n.main-container {\n @extend %no-list;\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n @include mixins.max(lg) {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n padding-top: 2.5rem;\n padding-bottom: 2.5rem;\n\n > li + li {\n border-top: 1px solid color.$gray-10;\n }\n }\n\n @include mixins.min(lg) {\n padding-right: 0;\n padding-left: 0;\n }\n\n > li {\n flex: 0 1 auto;\n min-width: 0;\n }\n}\n\n.main-link {\n @extend %nav-link;\n\n display: flex;\n align-items: center;\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n text-align: left;\n cursor: pointer;\n width: 100%;\n\n @include mixins.min(lg) {\n svg {\n display: none;\n }\n }\n\n @include mixins.max(lg) {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 300;\n padding: 0.625rem 0;\n width: 100%;\n text-align: left;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n}\n\n.main-link,\n.flyout-link {\n position: relative;\n color: black;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -1px;\n left: 0;\n width: 100%;\n height: 4px;\n background-color: transparent;\n opacity: 0;\n transform: scaleX(0.8);\n transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n\n &:hover,\n &.focus {\n &::after {\n background-color: color.$gray-20;\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n }\n }\n\n &.active {\n font-weight: 700;\n\n &::after {\n background-color: color.$yellow;\n opacity: 1;\n transform: scale(1);\n }\n }\n}\n\n.flyout {\n left: 0;\n width: 100%;\n background: white;\n padding-bottom: 3rem;\n overflow: auto;\n overscroll-behavior: contain;\n visibility: hidden;\n\n @include mixins.min(lg) {\n position: absolute;\n top: 100%;\n max-height: calc(100vh - var(--header-height) - var(--meta-header-height) - 1px);\n z-index: -1;\n box-shadow: 0 0 1px 0 rgb(0 0 0 / 40%);\n transform: translateY(-100%);\n\n &.open {\n box-shadow: 0 0 8px 0 rgb(0 0 0 / 40%);\n transform: translateY(0);\n }\n }\n\n @include mixins.max(lg) {\n position: fixed;\n top: 0;\n height: 100%;\n z-index: 1;\n transform: translateX(100%);\n\n &.open {\n transform: translateX(0);\n }\n }\n\n &.open {\n visibility: visible;\n }\n\n &.animate {\n transition: transform 0.35s, visibility 0.35s, box-shadow 0.35s;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n}\n\n.flyout-nav {\n @extend %font-curve-small;\n\n display: flex;\n justify-content: space-between;\n min-height: 3.5rem;\n\n // Change box-sizing to content-box to add 1px border width to flyout-nav hight.\n // This ensures flyout-nav has same hight as main-navigation-container.\n box-sizing: content-box;\n}\n\n.flyout-row {\n display: flex;\n gap: 1.5rem;\n\n @include mixins.max(lg) {\n display: grid;\n grid-template-columns: 1fr 1fr;\n }\n\n @include mixins.max(rg) {\n grid-template-columns: 1fr;\n }\n}\n\n.flyout-column {\n flex: 1;\n max-width: 25%;\n\n @include mixins.max(lg) {\n max-width: none;\n }\n\n h3 {\n @extend %font-curve-small;\n margin-top: 0;\n }\n}\n\n.flyout-back-button {\n @include mixins.container-padding();\n\n display: flex;\n align-items: center;\n font-size: functions.px-to-rem(16px);\n font-weight: 400;\n cursor: pointer;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n @include mixins.min(lg) {\n display: none;\n }\n}\n\n.flyout-close-button {\n @extend %nav-link;\n\n display: flex;\n align-items: center;\n margin-left: auto;\n padding: 0 1.5rem;\n cursor: pointer;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n @include mixins.max(lg) {\n display: none;\n }\n}\n\n.flyout-linklist {\n @extend %no-list;\n\n li {\n border-top: 1px solid color.$gray-10;\n }\n\n &:first-child > li {\n border-top-color: transparent;\n }\n}\n\n.flyout-link {\n @extend %nav-link;\n\n display: block;\n padding: 0.75rem 0;\n}\n\n.flyout-title {\n @extend %font-curve-bigger-regular;\n\n margin: 2.5rem 0 1.5rem 0;\n\n @include mixins.min(lg) {\n display: none;\n }\n}\n","import { Component, Host, h, State, Method, Event, Element, EventEmitter } from '@stencil/core';\nimport { throttle } from 'throttle-debounce';\nimport { state } from '../../data/store';\nimport {\n DropdownElement,\n DropdownEvent,\n HasDropdown,\n IsFocusable,\n NavMainEntity,\n} from '../../models/header.model';\nimport { userPrefersReducedMotion } from '../../services/ui.service';\nimport { translate } from '../../services/language.service';\nimport { SvgSprite } from '../../utils/svg-sprite.component';\nimport { SvgIcon } from '../../utils/svg-icon.component';\nimport { LevelOneAction } from './components/level-one-action.component';\n\n@Component({\n tag: 'post-main-navigation',\n styleUrl: 'post-main-navigation.scss',\n shadow: true,\n})\nexport class PostMainNavigation implements HasDropdown, IsFocusable {\n @State() activeFlyout: string | null;\n @State() mobileMenuOpen: boolean;\n @Event() dropdownToggled: EventEmitter<DropdownEvent>;\n @Event() flyoutToggled: EventEmitter<string | null>;\n @Element() host: DropdownElement;\n private throttledResize: throttle<() => void>;\n private resizeTimer: number | null = null;\n private mouseLeaveTimer: number | null = null;\n private mouseEnterTimer: number | null = null;\n\n connectedCallback() {\n this.throttledResize = throttle(300, () => this.handleResize());\n window.addEventListener('resize', this.throttledResize, { passive: true });\n this.setWindowHeight();\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.throttledResize);\n if (this.mouseEnterTimer !== null) window.clearTimeout(this.mouseEnterTimer);\n if (this.mouseLeaveTimer !== null) window.clearTimeout(this.mouseLeaveTimer);\n }\n\n handleResize() {\n // Suspend all animations and transitions on window resize\n this.host.classList.add('no-animation');\n if (this.resizeTimer !== null) window.clearTimeout(this.resizeTimer);\n this.resizeTimer = window.setTimeout(() => {\n this.host.classList.remove('no-animation');\n }, 300);\n\n this.setWindowHeight();\n }\n\n // Update window height var\n setWindowHeight() {\n if (!this.host) {\n return;\n }\n this.host.style.setProperty('--window-height', `${window.innerHeight}px`);\n\n // Safari might or might not show a blank bar at the bottom where the browser\n // controls should be. This timeout waits for this bar to appear before resetting the available height\n window.setTimeout(() => {\n this.host.style.setProperty('--window-height', `${window.innerHeight}px`);\n }, 100);\n }\n\n openFlyout(id: string) {\n const flyout = this.host.shadowRoot?.getElementById(id);\n\n if (flyout && this.activeFlyout !== '') {\n // Add flyout animation if there's no flyout open\n this.addFlyoutAnimation(flyout, 'expand');\n }\n\n this.activeFlyout = id;\n this.flyoutToggled.emit(id);\n this.setWindowHeight();\n\n if (this.mouseLeaveTimer !== null) {\n window.clearTimeout(this.mouseLeaveTimer);\n this.mouseLeaveTimer = null;\n }\n }\n\n closeFlyout(id?: string, manageFocus = true) {\n if (id === undefined) return;\n const flyout = this.host.shadowRoot?.getElementById(id);\n\n if (flyout) {\n // Add flyout animation for close action\n this.addFlyoutAnimation(flyout, 'collapse', manageFocus);\n }\n\n this.activeFlyout = null;\n this.flyoutToggled.emit();\n }\n\n addFlyoutAnimation(flyout: HTMLElement, direction?: 'expand' | 'collapse', manageFocus = true) {\n // Check if user prefers to see animations or not\n if (!userPrefersReducedMotion()) {\n flyout.classList.add('animate');\n\n // Remove flyout animation after transition ended\n flyout.addEventListener(\n 'transitionend',\n () => {\n if (manageFocus) {\n if (direction === 'expand') {\n flyout.querySelector<HTMLElement>('button.flyout-back-button')?.focus();\n } else if (direction === 'collapse') {\n flyout.parentElement?.querySelector<HTMLElement>('a.main-link')?.focus();\n }\n }\n\n flyout.classList.remove('animate');\n },\n {\n once: true,\n },\n );\n }\n }\n\n isActiveFlyout(id?: string) {\n return id === this.activeFlyout;\n }\n\n handleMouseEnter(level: NavMainEntity) {\n // Cancel opening the flyout if there already is one scheduled to open\n if (this.mouseEnterTimer !== null) {\n window.clearTimeout(this.mouseEnterTimer);\n this.mouseEnterTimer = null;\n }\n\n // Cancel closing if we enter again\n if (this.mouseLeaveTimer && this.activeFlyout === level.id) {\n window.clearTimeout(this.mouseLeaveTimer);\n this.mouseLeaveTimer = null;\n }\n\n if (window.innerWidth >= 1024 && level.flyout.length > 0 && this.activeFlyout !== level.id) {\n // Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout\n this.mouseEnterTimer = window.setTimeout(() => {\n this.mouseEnterTimer = null;\n if (level.id !== undefined) this.openFlyout(level.id);\n }, 200);\n }\n }\n\n handleMouseLeave(level: NavMainEntity) {\n // Cancel opening the flyout if a mouseleave event happens before the flyout opened\n if (this.mouseEnterTimer !== null) {\n window.clearTimeout(this.mouseEnterTimer);\n }\n\n // Don't close an open flyout if the mouseleave is from another mainnav entry\n if (this.activeFlyout && this.activeFlyout !== level.id) {\n return;\n }\n\n if (window.innerWidth >= 1024 && level.flyout.length > 0) {\n // Allow the pointer to shortly leave the flyout without closing it. This\n // allows for user mistakes and makes the experience less nervous\n this.mouseLeaveTimer = window.setTimeout(() => {\n this.closeFlyout(level.id, false);\n }, 300);\n }\n }\n\n handleTouchEnd(event: TouchEvent, level: NavMainEntity) {\n if (!this.isActiveFlyout(level.id) && !level.noFlyout) {\n // It's the first touchstart and has a flyout, prevent link activation and open the flyout\n if (event.cancelable) event.preventDefault();\n if (level.id) this.openFlyout(level.id);\n }\n }\n\n handleKeyPress(event: KeyboardEvent, level: NavMainEntity) {\n if (event.key === 'Enter' && !this.isActiveFlyout(level.id) && !level.noFlyout) {\n // It's the first enter keypress and has a flyout, prevent link activation and open the flyout\n event.preventDefault();\n if (level.id) this.openFlyout(level.id);\n }\n }\n\n handleClick(event: MouseEvent, level: NavMainEntity) {\n if (!this.isActiveFlyout(level.id) && !level.noFlyout) {\n // It's the first click, always open the flyout, never the link\n // This is relevant for desktop with active screenreader which\n // translates an enter keypress to a click\n event.preventDefault();\n if (level.id) this.openFlyout(level.id);\n }\n }\n\n /**\n * Toggle the main navigation (only visible on mobile)\n * @param force Force a state\n * @returns Boolean indicating new state\n */\n @Method()\n async toggleDropdown(force?: boolean) {\n this.mobileMenuOpen = force === undefined ? !this.mobileMenuOpen : force;\n this.dropdownToggled.emit({ open: this.mobileMenuOpen, element: this.host });\n\n if (force === false) {\n this.closeFlyout();\n }\n\n this.setWindowHeight();\n\n return this.mobileMenuOpen;\n }\n\n /**\n * Focus the main navigation toggle button\n */\n @Method()\n async setFocus() {\n const firstLink = this.host.shadowRoot?.querySelector<HTMLElement>('.main-link');\n if (firstLink) {\n firstLink.focus();\n }\n }\n\n /**\n * Open a specific flyout\n * @param id Flyout ID\n */\n @Method()\n async setActiveFlyout(id: string | null) {\n this.activeFlyout = id;\n this.flyoutToggled.emit(this.activeFlyout);\n }\n\n render() {\n if (state.localizedConfig?.header === undefined) return;\n const headerConfig = state.localizedConfig.header;\n\n return (\n <Host>\n <SvgSprite />\n <nav\n aria-label={headerConfig.translations.navMainAriaLabel}\n id=\"post-internet-header-main-navigation\"\n class={{ 'main-navigation': true, 'open': this.mobileMenuOpen }}\n role=\"menu\"\n >\n <ul class=\"main-container container\">\n {headerConfig.navMain.map(levelOne => (\n <li\n key={levelOne.text}\n onMouseLeave={() => this.handleMouseLeave(levelOne)}\n onMouseEnter={() => this.handleMouseEnter(levelOne)}\n >\n <LevelOneAction\n level={levelOne}\n isOpen={this.isActiveFlyout(levelOne.id)}\n onTouchEnd={e => this.handleTouchEnd(e, levelOne)}\n onKeyDown={e => this.handleKeyPress(e, levelOne)}\n onClick={e => this.handleClick(e, levelOne)}\n />\n {!levelOne.noFlyout ? renderLevelOneFlyout.bind(this)(levelOne) : null}\n </li>\n ))}\n </ul>\n <slot></slot>\n </nav>\n </Host>\n );\n\n function renderLevelOneFlyout(levelOne: NavMainEntity) {\n return (\n <div id={levelOne.id} class={{ flyout: true, open: this.isActiveFlyout(levelOne.id) }}>\n <div class=\"wide-container\">\n <div class=\"flyout-nav\">\n <button\n class=\"nav-link flyout-back-button\"\n onClick={() => this.closeFlyout(levelOne.id)}\n >\n <SvgIcon name=\"pi-pointy-arrow-right\" classNames=\"mirrored\" />\n <span>{headerConfig.translations.backButtonText}</span>\n </button>\n <button class=\"flyout-close-button\" onClick={() => this.closeFlyout(levelOne.id)}>\n <span class=\"visually-hidden\">\n {levelOne.text}, {headerConfig.translations.mobileNavToggleClose}\n </span>\n <SvgIcon name=\"pi-close\" />\n </button>\n </div>\n <h2 class=\"flyout-title container\">\n <a href={levelOne.url} class=\"nav-link\">\n {levelOne.text}\n </a>\n </h2>\n <div class=\"flyout-row container\">\n {levelOne.flyout.map((flyout, i) => (\n <div key={flyout.title} class=\"flyout-column\">\n {flyout.title ? <h3 id={`${levelOne.id}-column-${i}`}>{flyout.title}</h3> : null}\n <ul\n class=\"flyout-linklist\"\n aria-labelledby={flyout.title ? `${levelOne.id}-column-${i}` : undefined}\n >\n {flyout.linkList.map(link => (\n <li key={link.url}>\n <a\n class={{\n 'flyout-link': true,\n 'active': !!link?.isActiveOverride,\n }}\n href={link.url}\n target={link.target}\n >\n {link.title}\n {link?.isActiveOverride ? (\n <span class=\"visually-hidden\">\n , {translate('Active navigation element')}\n </span>\n ) : null}\n </a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n }\n }\n}\n"],"mappings":"o4DAIO,IAAMA,EAAiB,SAACC,G,UAO7B,IAAMC,EAAUD,EAAME,MAAMC,IAAM,IAAM,SAExC,OACEC,EAACH,EAAO,CACNI,MAAO,CACL,YAAa,KACbC,SAAYN,EAAME,MAAMK,iBACxBC,MAASR,EAAMS,QAEjBC,KAAMV,EAAME,MAAMC,IAClBQ,QACEC,EAAAZ,EAAME,MAAMS,SAAK,MAAAC,SAAA,SAAAA,EAAEC,WAAUC,EAAAd,EAAME,MAAMS,SAAK,MAAAG,SAAA,SAAAA,EAAED,YAAWE,EAAAf,EAAME,MAAMc,QAAI,MAAAD,SAAA,SAAAA,EAAEF,QACzEb,EAAME,MAAMS,MACZM,UAENC,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TmG,EAASxF,KAAI,KAAIgF,EAAaG,aAAac,sBAE9C7G,EAACyG,EAAO,CAACC,KAAK,eAGlB1G,EAAA,MAAIC,MAAM,0BACRD,EAAA,KAAGM,KAAM8F,EAASrG,IAAKE,MAAM,YAC1BmG,EAASxF,OAGdZ,EAAA,OAAKC,MAAM,wBACRmG,EAAS/C,OAAO8C,KAAI,SAAC9C,EAAQyD,GAAC,OAC7B9G,EAAA,OAAK6E,IAAKxB,EAAO9C,MAAON,MAAM,iBAC3BoD,EAAO9C,MAAQP,EAAA,MAAIoD,GAAI,GAAAH,OAAGmD,EAAShD,GAAE,YAAAH,OAAW6D,IAAMzD,EAAO9C,OAAc,KAC5EP,EAAA,MACEC,MAAM,kBAAiB,kBACNoD,EAAO9C,MAAQ,GAAA0C,OAAGmD,EAAShD,GAAE,YAAAH,OAAW6D,GAAMjG,WAE9DwC,EAAO0D,SAASZ,KAAI,SAAAa,GAAI,OACvBhH,EAAA,MAAI6E,IAAKmC,EAAKjH,KACZC,EAAA,KACEC,MAAO,CACL,cAAe,KACfC,UAAY8G,IAAI,MAAJA,SAAI,SAAJA,EAAM7G,mBAEpBG,KAAM0G,EAAKjH,IACXkH,OAAQD,EAAKC,QAEZD,EAAKzG,OACLyG,IAAI,MAAJA,SAAI,SAAJA,EAAM7G,kBACLH,EAAA,QAAMC,MAAM,mBAAiB,KACxBmB,EAAU,8BAEb,MAfe,KAPA,M,0HAtRd,I"}
1
+ {"version":3,"names":["LevelOneAction","props","TagName","level","url","h","class","active","isActiveOverride","focus","isOpen","href","title","_a","trim","_b","_c","text","undefined","tabindex","noFlyout","onTouchEnd","e","onKeyDown","onClick","translate","postMainNavigationCss","PostMainNavigation","exports","this","resizeTimer","mouseLeaveTimer","mouseEnterTimer","class_1","prototype","connectedCallback","_this","throttledResize","throttle","handleResize","window","addEventListener","passive","setWindowHeight","disconnectedCallback","removeEventListener","clearTimeout","host","classList","add","setTimeout","remove","style","setProperty","concat","innerHeight","openFlyout","id","flyout","shadowRoot","getElementById","activeFlyout","addFlyoutAnimation","flyoutToggled","emit","closeFlyout","manageFocus","direction","userPrefersReducedMotion","querySelector","parentElement","once","isActiveFlyout","handleMouseEnter","innerWidth","length","handleMouseLeave","handleTouchEnd","event","cancelable","preventDefault","handleKeyPress","key","handleClick","toggleDropdown","force","mobileMenuOpen","dropdownToggled","open","element","setFocus","firstLink","setActiveFlyout","render","state","localizedConfig","header","headerConfig","Host","SvgSprite","translations","navMainAriaLabel","role","navMain","map","levelOne","onMouseLeave","onMouseEnter","renderLevelOneFlyout","bind","SvgIcon","name","classNames","backButtonText","mobileNavToggleClose","i","linkList","link","target"],"sources":["src/components/post-main-navigation/components/level-one-action.component.tsx","src/components/post-main-navigation/post-main-navigation.scss?tag=post-main-navigation&encapsulation=shadow","src/components/post-main-navigation/post-main-navigation.tsx"],"sourcesContent":["import { h } from '@stencil/core';\nimport { NavMainEntity } from '../../../models/header.model';\nimport { translate } from '../../../services/language.service';\n\nexport const LevelOneAction = (props: {\n level: NavMainEntity;\n isOpen: boolean;\n onTouchEnd: (e: any) => void;\n onKeyDown: (e: any) => void;\n onClick: (e: any) => void;\n}) => {\n const TagName = props.level.url ? 'a' : 'button';\n\n return (\n <TagName\n class={{\n 'main-link': true,\n 'active': !!props.level.isActiveOverride,\n 'focus': props.isOpen,\n }}\n href={props.level.url}\n title={\n props.level.title?.trim() && props.level.title?.trim() !== props.level.text?.trim()\n ? props.level.title\n : undefined\n }\n tabindex={props.level.url ? undefined : 0}\n aria-haspopup={!props.level.noFlyout + ''}\n aria-expanded={props.level.noFlyout ? null : props.isOpen + ''}\n onTouchEnd={e => props.onTouchEnd(e)}\n onKeyDown={e => props.onKeyDown(e)}\n onClick={e => props.onClick(e)}\n >\n <span>{props.level.text}</span>\n {props.level.isActiveOverride ? (\n <span class=\"visually-hidden\">{translate('Active navigation element')}</span>\n ) : null}\n <svg aria-hidden=\"true\">\n <use href=\"#pi-pointy-arrow-right\" />\n </svg>\n </TagName>\n );\n};\n","@use '@swisspost/design-system-styles/variables/color';\n@use '@swisspost/design-system-styles/placeholders/text';\n@use '@swisspost/design-system-styles/functions';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n --host-window-height: var(--window-height, 100vh);\n --calculated-header-height: calc(var(--header-height) + 1px);\n\n display: block;\n min-width: 0;\n height: var(--header-height);\n}\n\n:host(.no-animation) {\n * {\n animation: none !important;\n transition: none !important;\n }\n}\n\n.main-navigation,\n.main-container,\n.main-container li,\n.main-link {\n @include mixins.min(lg) {\n height: 100%;\n }\n}\n\n.main-navigation {\n font-size: functions.px-to-rem(18px);\n\n @include mixins.min(lg) {\n font-size: functions.px-to-rem(16px);\n margin: 0 0.75rem;\n }\n\n @include mixins.min(xl) {\n font-size: functions.px-to-rem(18px);\n }\n\n @include mixins.min(xxl) {\n font-size: functions.px-to-rem(20px);\n }\n\n @include mixins.max(lg) {\n position: absolute;\n top: var(--calculated-header-height);\n left: 0;\n background: white;\n height: calc(var(--host-window-height) - var(--calculated-header-height));\n width: 100%;\n margin: 0;\n overflow: hidden scroll;\n -webkit-overflow-scrolling: touch;\n overscroll-behavior: contain;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n z-index: -1;\n visibility: hidden;\n transform: translateY(-100%);\n transition: transform 0.35s, visibility 0.35s;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n\n &.open {\n transform: translateY(0);\n visibility: visible;\n }\n }\n}\n\n.main-container {\n @extend %no-list;\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n\n @include mixins.max(lg) {\n flex-direction: column;\n align-items: stretch;\n justify-content: flex-start;\n padding-top: 2.5rem;\n padding-bottom: 2.5rem;\n\n > li + li {\n border-top: 1px solid color.$gray-10;\n }\n }\n\n @include mixins.min(lg) {\n padding-right: 0;\n padding-left: 0;\n }\n\n > li {\n flex: 0 1 auto;\n min-width: 0;\n }\n}\n\n.main-link {\n @extend %nav-link;\n\n display: flex;\n align-items: center;\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n text-align: left;\n cursor: pointer;\n width: 100%;\n\n @include mixins.min(lg) {\n svg {\n display: none;\n }\n }\n\n @include mixins.max(lg) {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 300;\n padding: 0.625rem 0;\n width: 100%;\n text-align: left;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n }\n\n span {\n overflow: hidden;\n text-overflow: ellipsis;\n }\n}\n\n.main-link,\n.flyout-link {\n position: relative;\n color: black;\n\n &::after {\n content: '';\n position: absolute;\n bottom: -1px;\n left: 0;\n width: 100%;\n height: 4px;\n background-color: transparent;\n opacity: 0;\n transform: scaleX(0.8);\n transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n\n &:hover,\n &.focus {\n &::after {\n background-color: color.$gray-20;\n opacity: 1;\n transform: scale(1);\n transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),\n transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\n }\n }\n\n &.active {\n font-weight: 700;\n\n &::after {\n background-color: color.$yellow;\n opacity: 1;\n transform: scale(1);\n }\n }\n}\n\n.flyout {\n left: 0;\n width: 100%;\n background: white;\n padding-bottom: 3rem;\n overflow: auto;\n overscroll-behavior: contain;\n visibility: hidden;\n\n @include mixins.min(lg) {\n position: absolute;\n top: 100%;\n max-height: calc(100vh - var(--header-height) - var(--meta-header-height) - 1px);\n z-index: -1;\n box-shadow: 0 0 1px 0 rgb(0 0 0 / 40%);\n transform: translateY(-100%);\n\n &.open {\n box-shadow: 0 0 8px 0 rgb(0 0 0 / 40%);\n transform: translateY(0);\n }\n }\n\n @include mixins.max(lg) {\n position: fixed;\n top: 0;\n height: 100%;\n z-index: 1;\n transform: translateX(100%);\n\n &.open {\n transform: translateX(0);\n }\n }\n\n &.open {\n visibility: visible;\n }\n\n &.animate {\n transition: transform 0.35s, visibility 0.35s, box-shadow 0.35s;\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n }\n }\n}\n\n.flyout-nav {\n @extend %font-curve-small;\n\n display: flex;\n justify-content: space-between;\n min-height: 3.5rem;\n\n // Change box-sizing to content-box to add 1px border width to flyout-nav hight.\n // This ensures flyout-nav has same hight as main-navigation-container.\n box-sizing: content-box;\n}\n\n.flyout-row {\n display: flex;\n gap: 1.5rem;\n\n @include mixins.max(lg) {\n display: grid;\n grid-template-columns: 1fr 1fr;\n }\n\n @include mixins.max(rg) {\n grid-template-columns: 1fr;\n }\n}\n\n.flyout-column {\n flex: 1;\n max-width: 25%;\n\n @include mixins.max(lg) {\n max-width: none;\n }\n\n h3 {\n @extend %font-curve-small;\n margin-top: 0;\n }\n}\n\n.flyout-back-button {\n @include mixins.container-padding();\n\n display: flex;\n align-items: center;\n font-size: functions.px-to-rem(16px);\n font-weight: 400;\n cursor: pointer;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n @include mixins.min(lg) {\n display: none;\n }\n}\n\n.flyout-close-button {\n @extend %nav-link;\n\n display: flex;\n align-items: center;\n margin-left: auto;\n padding: 0 1.5rem;\n cursor: pointer;\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n\n @include mixins.max(lg) {\n display: none;\n }\n}\n\n.flyout-linklist {\n @extend %no-list;\n\n li {\n border-top: 1px solid color.$gray-10;\n }\n\n &:first-child > li {\n border-top-color: transparent;\n }\n}\n\n.flyout-link {\n @extend %nav-link;\n\n display: block;\n padding: 0.75rem 0;\n}\n\n.flyout-title {\n @extend %font-curve-bigger-regular;\n\n margin: 2.5rem 0 1.5rem 0;\n\n @include mixins.min(lg) {\n display: none;\n }\n}\n","import { Component, Host, h, State, Method, Event, Element, EventEmitter } from '@stencil/core';\nimport { throttle } from 'throttle-debounce';\nimport { state } from '../../data/store';\nimport {\n DropdownElement,\n DropdownEvent,\n HasDropdown,\n IsFocusable,\n NavMainEntity,\n} from '../../models/header.model';\nimport { userPrefersReducedMotion } from '../../services/ui.service';\nimport { translate } from '../../services/language.service';\nimport { SvgSprite } from '../../utils/svg-sprite.component';\nimport { SvgIcon } from '../../utils/svg-icon.component';\nimport { LevelOneAction } from './components/level-one-action.component';\n\n@Component({\n tag: 'post-main-navigation',\n styleUrl: 'post-main-navigation.scss',\n shadow: true,\n})\nexport class PostMainNavigation implements HasDropdown, IsFocusable {\n @State() activeFlyout: string | null;\n @State() mobileMenuOpen: boolean;\n @Event() dropdownToggled: EventEmitter<DropdownEvent>;\n @Event() flyoutToggled: EventEmitter<string | null>;\n @Element() host: DropdownElement;\n private throttledResize: throttle<() => void>;\n private resizeTimer: number | null = null;\n private mouseLeaveTimer: number | null = null;\n private mouseEnterTimer: number | null = null;\n\n connectedCallback() {\n this.throttledResize = throttle(300, () => this.handleResize());\n window.addEventListener('resize', this.throttledResize, { passive: true });\n this.setWindowHeight();\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.throttledResize);\n if (this.mouseEnterTimer !== null) window.clearTimeout(this.mouseEnterTimer);\n if (this.mouseLeaveTimer !== null) window.clearTimeout(this.mouseLeaveTimer);\n }\n\n handleResize() {\n // Suspend all animations and transitions on window resize\n this.host.classList.add('no-animation');\n if (this.resizeTimer !== null) window.clearTimeout(this.resizeTimer);\n this.resizeTimer = window.setTimeout(() => {\n this.host.classList.remove('no-animation');\n }, 300);\n\n this.setWindowHeight();\n }\n\n // Update window height var\n setWindowHeight() {\n if (!this.host) {\n return;\n }\n this.host.style.setProperty('--window-height', `${window.innerHeight}px`);\n\n // Safari might or might not show a blank bar at the bottom where the browser\n // controls should be. This timeout waits for this bar to appear before resetting the available height\n window.setTimeout(() => {\n this.host.style.setProperty('--window-height', `${window.innerHeight}px`);\n }, 100);\n }\n\n openFlyout(id: string) {\n const flyout = this.host.shadowRoot?.getElementById(id);\n\n if (flyout && this.activeFlyout !== '') {\n // Add flyout animation if there's no flyout open\n this.addFlyoutAnimation(flyout, 'expand');\n }\n\n this.activeFlyout = id;\n this.flyoutToggled.emit(id);\n this.setWindowHeight();\n\n if (this.mouseLeaveTimer !== null) {\n window.clearTimeout(this.mouseLeaveTimer);\n this.mouseLeaveTimer = null;\n }\n }\n\n closeFlyout(id?: string, manageFocus = true) {\n if (id === undefined) return;\n const flyout = this.host.shadowRoot?.getElementById(id);\n\n if (flyout) {\n // Add flyout animation for close action\n this.addFlyoutAnimation(flyout, 'collapse', manageFocus);\n }\n\n this.activeFlyout = null;\n this.flyoutToggled.emit();\n }\n\n addFlyoutAnimation(flyout: HTMLElement, direction?: 'expand' | 'collapse', manageFocus = true) {\n // Check if user prefers to see animations or not\n if (!userPrefersReducedMotion()) {\n flyout.classList.add('animate');\n\n // Remove flyout animation after transition ended\n flyout.addEventListener(\n 'transitionend',\n () => {\n if (manageFocus) {\n if (direction === 'expand') {\n flyout.querySelector<HTMLElement>('button.flyout-back-button')?.focus();\n } else if (direction === 'collapse') {\n flyout.parentElement?.querySelector<HTMLElement>('a.main-link')?.focus();\n }\n }\n\n flyout.classList.remove('animate');\n },\n {\n once: true,\n },\n );\n }\n }\n\n isActiveFlyout(id?: string) {\n return id === this.activeFlyout;\n }\n\n handleMouseEnter(level: NavMainEntity) {\n // Cancel opening the flyout if there already is one scheduled to open\n if (this.mouseEnterTimer !== null) {\n window.clearTimeout(this.mouseEnterTimer);\n this.mouseEnterTimer = null;\n }\n\n // Cancel closing if we enter again\n if (this.mouseLeaveTimer && this.activeFlyout === level.id) {\n window.clearTimeout(this.mouseLeaveTimer);\n this.mouseLeaveTimer = null;\n }\n\n if (window.innerWidth >= 1024 && level.flyout.length > 0 && this.activeFlyout !== level.id) {\n // Delay opening the flyout for a moment to give users a chance to move the mouse over the navigation without triggering the flyout\n this.mouseEnterTimer = window.setTimeout(() => {\n this.mouseEnterTimer = null;\n if (level.id !== undefined) this.openFlyout(level.id);\n }, 200);\n }\n }\n\n handleMouseLeave(level: NavMainEntity) {\n // Cancel opening the flyout if a mouseleave event happens before the flyout opened\n if (this.mouseEnterTimer !== null) {\n window.clearTimeout(this.mouseEnterTimer);\n }\n\n // Don't close an open flyout if the mouseleave is from another mainnav entry\n if (this.activeFlyout && this.activeFlyout !== level.id) {\n return;\n }\n\n if (window.innerWidth >= 1024 && level.flyout.length > 0) {\n // Allow the pointer to shortly leave the flyout without closing it. This\n // allows for user mistakes and makes the experience less nervous\n this.mouseLeaveTimer = window.setTimeout(() => {\n this.closeFlyout(level.id, false);\n }, 300);\n }\n }\n\n handleTouchEnd(event: TouchEvent, level: NavMainEntity) {\n if (!this.isActiveFlyout(level.id) && !level.noFlyout) {\n // It's the first touchstart and has a flyout, prevent link activation and open the flyout\n if (event.cancelable) event.preventDefault();\n if (level.id) this.openFlyout(level.id);\n }\n }\n\n handleKeyPress(event: KeyboardEvent, level: NavMainEntity) {\n if (event.key === 'Enter' && !this.isActiveFlyout(level.id) && !level.noFlyout) {\n // It's the first enter keypress and has a flyout, prevent link activation and open the flyout\n event.preventDefault();\n if (level.id) this.openFlyout(level.id);\n }\n }\n\n handleClick(event: MouseEvent, level: NavMainEntity) {\n if (!this.isActiveFlyout(level.id) && !level.noFlyout) {\n // It's the first click, always open the flyout, never the link\n // This is relevant for desktop with active screenreader which\n // translates an enter keypress to a click\n event.preventDefault();\n if (level.id) this.openFlyout(level.id);\n }\n }\n\n /**\n * Toggle the main navigation (only visible on mobile)\n * @param force Force a state\n * @returns Boolean indicating new state\n */\n @Method()\n async toggleDropdown(force?: boolean) {\n this.mobileMenuOpen = force === undefined ? !this.mobileMenuOpen : force;\n this.dropdownToggled.emit({ open: this.mobileMenuOpen, element: this.host });\n\n if (force === false) {\n this.closeFlyout();\n }\n\n this.setWindowHeight();\n\n return this.mobileMenuOpen;\n }\n\n /**\n * Focus the main navigation toggle button\n */\n @Method()\n async setFocus() {\n const firstLink = this.host.shadowRoot?.querySelector<HTMLElement>('.main-link');\n if (firstLink) {\n firstLink.focus();\n }\n }\n\n /**\n * Open a specific flyout\n * @param id Flyout ID\n */\n @Method()\n async setActiveFlyout(id: string | null) {\n this.activeFlyout = id;\n this.flyoutToggled.emit(this.activeFlyout);\n }\n\n render() {\n if (state.localizedConfig?.header === undefined) return;\n const headerConfig = state.localizedConfig.header;\n\n return (\n <Host>\n <SvgSprite />\n <nav\n aria-label={headerConfig.translations.navMainAriaLabel}\n id=\"post-internet-header-main-navigation\"\n class={{ 'main-navigation': true, 'open': this.mobileMenuOpen }}\n role=\"menu\"\n >\n <ul class=\"main-container container\">\n {headerConfig.navMain.map(levelOne => (\n <li\n key={levelOne.text}\n onMouseLeave={() => this.handleMouseLeave(levelOne)}\n onMouseEnter={() => this.handleMouseEnter(levelOne)}\n >\n <LevelOneAction\n level={levelOne}\n isOpen={this.isActiveFlyout(levelOne.id)}\n onTouchEnd={e => this.handleTouchEnd(e, levelOne)}\n onKeyDown={e => this.handleKeyPress(e, levelOne)}\n onClick={e => this.handleClick(e, levelOne)}\n />\n {!levelOne.noFlyout ? renderLevelOneFlyout.bind(this)(levelOne) : null}\n </li>\n ))}\n </ul>\n <slot></slot>\n </nav>\n </Host>\n );\n\n function renderLevelOneFlyout(levelOne: NavMainEntity) {\n return (\n <div id={levelOne.id} class={{ flyout: true, open: this.isActiveFlyout(levelOne.id) }}>\n <div class=\"wide-container\">\n <div class=\"flyout-nav\">\n <button\n class=\"nav-link flyout-back-button\"\n onClick={() => this.closeFlyout(levelOne.id)}\n >\n <SvgIcon name=\"pi-pointy-arrow-right\" classNames=\"mirrored\" />\n <span>{headerConfig.translations.backButtonText}</span>\n </button>\n <button class=\"flyout-close-button\" onClick={() => this.closeFlyout(levelOne.id)}>\n <span class=\"visually-hidden\">\n {levelOne.text}, {headerConfig.translations.mobileNavToggleClose}\n </span>\n <SvgIcon name=\"pi-close\" />\n </button>\n </div>\n <h2 class=\"flyout-title container\">\n <a href={levelOne.url} class=\"nav-link\">\n {levelOne.text}\n </a>\n </h2>\n <div class=\"flyout-row container\">\n {levelOne.flyout.map((flyout, i) => (\n <div key={flyout.title} class=\"flyout-column\">\n {flyout.title ? <h3 id={`${levelOne.id}-column-${i}`}>{flyout.title}</h3> : null}\n <ul\n class=\"flyout-linklist\"\n aria-labelledby={flyout.title ? `${levelOne.id}-column-${i}` : undefined}\n >\n {flyout.linkList.map(link => (\n <li key={link.url}>\n <a\n class={{\n 'flyout-link': true,\n 'active': !!link?.isActiveOverride,\n }}\n href={link.url}\n target={link.target}\n >\n {link.title}\n {link?.isActiveOverride ? (\n <span class=\"visually-hidden\">\n , {translate('Active navigation element')}\n </span>\n ) : null}\n </a>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n }\n }\n}\n"],"mappings":"o4DAIO,IAAMA,EAAiB,SAACC,G,UAO7B,IAAMC,EAAUD,EAAME,MAAMC,IAAM,IAAM,SAExC,OACEC,EAACH,EAAO,CACNI,MAAO,CACL,YAAa,KACbC,SAAYN,EAAME,MAAMK,iBACxBC,MAASR,EAAMS,QAEjBC,KAAMV,EAAME,MAAMC,IAClBQ,QACEC,EAAAZ,EAAME,MAAMS,SAAK,MAAAC,SAAA,SAAAA,EAAEC,WAAUC,EAAAd,EAAME,MAAMS,SAAK,MAAAG,SAAA,SAAAA,EAAED,YAAWE,EAAAf,EAAME,MAAMc,QAAI,MAAAD,SAAA,SAAAA,EAAEF,QACzEb,EAAME,MAAMS,MACZM,UAENC,SAAUlB,EAAME,MAAMC,IAAMc,UAAY,EAAC,iBACzBjB,EAAME,MAAMiB,SAAW,GAAE,gBAC1BnB,EAAME,MAAMiB,SAAW,KAAOnB,EAAMS,OAAS,GAC5DW,WAAY,SAAAC,GAAK,OAAArB,EAAMoB,WAAWC,EAAjB,EACjBC,UAAW,SAAAD,GAAK,OAAArB,EAAMsB,UAAUD,EAAhB,EAChBE,QAAS,SAAAF,GAAK,OAAArB,EAAMuB,QAAQF,EAAd,GAEdjB,EAAA,YAAOJ,EAAME,MAAMc,MAClBhB,EAAME,MAAMK,iBACXH,EAAA,QAAMC,MAAM,mBAAm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,OAAW6D,IAAMzD,EAAO9C,OAAc,KAC5EP,EAAA,MACEC,MAAM,kBAAiB,kBACNoD,EAAO9C,MAAQ,GAAA0C,OAAGmD,EAAShD,GAAE,YAAAH,OAAW6D,GAAMjG,WAE9DwC,EAAO0D,SAASZ,KAAI,SAAAa,GAAI,OACvBhH,EAAA,MAAI6E,IAAKmC,EAAKjH,KACZC,EAAA,KACEC,MAAO,CACL,cAAe,KACfC,UAAY8G,IAAI,MAAJA,SAAI,SAAJA,EAAM7G,mBAEpBG,KAAM0G,EAAKjH,IACXkH,OAAQD,EAAKC,QAEZD,EAAKzG,OACLyG,IAAI,MAAJA,SAAI,SAAJA,EAAM7G,kBACLH,EAAA,QAAMC,MAAM,mBAAiB,KACxBmB,EAAU,8BAEb,MAfe,KAPA,M,0HAtRd,I"}
@@ -0,0 +1,2 @@
1
+ import{r as t,h as o,H as e,g as i}from"./p-d8b954a1.js";import{t as r}from"./p-a74b380d.js";import{s as n}from"./p-b7feee8d.js";const s='@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:700;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:700;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:400;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:400;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:300;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:300;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:transparent;border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0, 0, 0, 0.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:black}.nav-link:focus-visible{z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Frutiger Neue For Post", system-ui, sans-serif}button{font:inherit;padding:0}a,button{border-radius:3px;outline:none;outline-offset:2px;}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:3px;position:relative;z-index:1}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active){svg{color:white}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px) and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1440.98px){.hidden-xxl{display:none}}:host{display:block}.logo{display:block;-ms-flex-align:center;align-items:center;background:#fc0}.logo svg{display:block;width:var(--header-height);height:var(--header-height)}';const f=class{constructor(o){t(this,o);this.showFaviconLogo=undefined;this.throttledResize=r(300,(()=>this.handleResize()));window.addEventListener("resize",this.throttledResize,{passive:true});this.resizeObserver=new ResizeObserver(this.handleResize.bind(this));this.handleResize()}componentDidLoad(){var t;const o=(t=this.host.parentElement)===null||t===void 0?void 0:t.querySelector(".main-navigation-controls");if(o){this.resizeObserver.observe(o)}}disconnectedCallback(){window.removeEventListener("resize",this.throttledResize);this.resizeObserver.disconnect()}handleResize(){var t,o;const e=(t=this.host.parentElement)===null||t===void 0?void 0:t.querySelector(".main-navigation-controls");const i=(o=this.host.parentElement)===null||o===void 0?void 0:o.querySelector(".menu-button");if(e&&i)this.showFaviconLogo=window.innerWidth-(150+e.clientWidth+i.clientWidth)<=0}render(){var t;if(((t=n.localizedConfig)===null||t===void 0?void 0:t.header.logo)===undefined)return;const i=n.localizedConfig.header.logo;return o(e,null,o("a",{href:i.logoLink,class:"logo"},o("span",{class:"visually-hidden"},i.logoLinkTitle),o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 72 72","aria-hidden":"true"},o("g",{id:"Logo"},o("rect",{fill:"#ffcc00",x:"0",y:"0",width:"72",height:"72"}),o("polygon",{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"}),o("path",{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 i(this)}};f.style=s;export{f as post_logo};
2
+ //# sourceMappingURL=p-aa30b98b.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["postLogoCss","PostLogo","constructor","hostRef","this","throttledResize","throttle","handleResize","window","addEventListener","passive","resizeObserver","ResizeObserver","bind","componentDidLoad","mainNavControls","_a","host","parentElement","querySelector","observe","disconnectedCallback","removeEventListener","disconnect","menuButton","_b","showFaviconLogo","innerWidth","clientWidth","render","state","localizedConfig","header","logo","undefined","config","h","Host","href","logoLink","class","logoLinkTitle","xmlns","viewBox","id","fill","x","y","width","height","points","d"],"sources":["./src/components/post-logo/post-logo.scss?tag=post-logo&encapsulation=shadow","./src/components/post-logo/post-logo.tsx"],"sourcesContent":["@use '@swisspost/design-system-styles/variables/color';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n display: block;\n}\n\n.logo {\n display: block;\n align-items: center;\n background: color.$yellow;\n\n svg {\n display: block;\n width: var(--header-height);\n height: var(--header-height);\n }\n}\n","import { Component, Host, h, State, Element } from '@stencil/core';\nimport { throttle } from 'throttle-debounce';\nimport { state } from '../../data/store';\n\n@Component({\n tag: 'post-logo',\n styleUrl: 'post-logo.scss',\n shadow: true,\n})\nexport class PostLogo {\n @State() showFaviconLogo: boolean;\n @Element() host: HTMLPostLogoElement;\n private throttledResize: throttle<() => void>;\n private resizeObserver: ResizeObserver;\n\n constructor() {\n // Register window resize event listener and a resize observer on the mainnav controls (they change size while controls are being loaded) to display an accurately sized logo\n this.throttledResize = throttle(300, () => this.handleResize());\n window.addEventListener('resize', this.throttledResize, { passive: true });\n this.resizeObserver = new ResizeObserver(this.handleResize.bind(this));\n\n // Initially call the resize handler\n this.handleResize();\n }\n\n componentDidLoad() {\n const mainNavControls = this.host.parentElement?.querySelector('.main-navigation-controls');\n if (mainNavControls) {\n this.resizeObserver.observe(mainNavControls);\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.throttledResize);\n this.resizeObserver.disconnect();\n }\n\n handleResize() {\n const mainNavControls = this.host.parentElement?.querySelector('.main-navigation-controls');\n const menuButton = this.host.parentElement?.querySelector('.menu-button');\n if (mainNavControls && menuButton)\n this.showFaviconLogo =\n window.innerWidth - (150 + mainNavControls.clientWidth + menuButton.clientWidth) <= 0;\n }\n\n render() {\n if (state.localizedConfig?.header.logo === undefined) return;\n const config = state.localizedConfig.header.logo;\n\n return (\n <Host>\n <a href={config.logoLink} class=\"logo\">\n <span class=\"visually-hidden\">{config.logoLinkTitle}</span>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 72 72\" aria-hidden=\"true\">\n <g id=\"Logo\">\n <rect fill=\"#ffcc00\" x=\"0\" y=\"0\" width=\"72\" height=\"72\" />\n <polygon\n fill=\"#ff0000\"\n 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\"\n />\n <path 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\" />\n </g>\n </svg>\n </a>\n </Host>\n );\n }\n}\n"],"mappings":"4HAAA,MAAMA,EAAc,y/G,MCSPC,EAAQ,MAMnBC,YAAAC,G,yCAEEC,KAAKC,gBAAkBC,EAAS,KAAK,IAAMF,KAAKG,iBAChDC,OAAOC,iBAAiB,SAAUL,KAAKC,gBAAiB,CAAEK,QAAS,OACnEN,KAAKO,eAAiB,IAAIC,eAAeR,KAAKG,aAAaM,KAAKT,OAGhEA,KAAKG,c,CAGPO,mB,MACE,MAAMC,GAAkBC,EAAAZ,KAAKa,KAAKC,iBAAa,MAAAF,SAAA,SAAAA,EAAEG,cAAc,6BAC/D,GAAIJ,EAAiB,CACnBX,KAAKO,eAAeS,QAAQL,E,EAIhCM,uBACEb,OAAOc,oBAAoB,SAAUlB,KAAKC,iBAC1CD,KAAKO,eAAeY,Y,CAGtBhB,e,QACE,MAAMQ,GAAkBC,EAAAZ,KAAKa,KAAKC,iBAAa,MAAAF,SAAA,SAAAA,EAAEG,cAAc,6BAC/D,MAAMK,GAAaC,EAAArB,KAAKa,KAAKC,iBAAa,MAAAO,SAAA,SAAAA,EAAEN,cAAc,gBAC1D,GAAIJ,GAAmBS,EACrBpB,KAAKsB,gBACHlB,OAAOmB,YAAc,IAAMZ,EAAgBa,YAAcJ,EAAWI,cAAgB,C,CAG1FC,S,MACE,KAAIb,EAAAc,EAAMC,mBAAe,MAAAf,SAAA,SAAAA,EAAEgB,OAAOC,QAASC,UAAW,OACtD,MAAMC,EAASL,EAAMC,gBAAgBC,OAAOC,KAE5C,OACEG,EAACC,EAAI,KACHD,EAAA,KAAGE,KAAMH,EAAOI,SAAUC,MAAM,QAC9BJ,EAAA,QAAMI,MAAM,mBAAmBL,EAAOM,eACtCL,EAAA,OAAKM,MAAM,6BAA6BC,QAAQ,YAAW,cAAa,QACtEP,EAAA,KAAGQ,GAAG,QACJR,EAAA,QAAMS,KAAK,UAAUC,EAAE,IAAIC,EAAE,IAAIC,MAAM,KAAKC,OAAO,OACnDb,EAAA,WACES,KAAK,UACLK,OAAO,wLAETd,EAAA,QAAMe,EAAE,kQ"}
1
+ {"version":3,"names":["postLogoCss","PostLogo","constructor","hostRef","this","throttledResize","throttle","handleResize","window","addEventListener","passive","resizeObserver","ResizeObserver","bind","componentDidLoad","mainNavControls","_a","host","parentElement","querySelector","observe","disconnectedCallback","removeEventListener","disconnect","menuButton","_b","showFaviconLogo","innerWidth","clientWidth","render","state","localizedConfig","header","logo","undefined","config","h","Host","href","logoLink","class","logoLinkTitle","xmlns","viewBox","id","fill","x","y","width","height","points","d"],"sources":["./src/components/post-logo/post-logo.scss?tag=post-logo&encapsulation=shadow","./src/components/post-logo/post-logo.tsx"],"sourcesContent":["@use '@swisspost/design-system-styles/variables/color';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n display: block;\n}\n\n.logo {\n display: block;\n align-items: center;\n background: color.$yellow;\n\n svg {\n display: block;\n width: var(--header-height);\n height: var(--header-height);\n }\n}\n","import { Component, Host, h, State, Element } from '@stencil/core';\nimport { throttle } from 'throttle-debounce';\nimport { state } from '../../data/store';\n\n@Component({\n tag: 'post-logo',\n styleUrl: 'post-logo.scss',\n shadow: true,\n})\nexport class PostLogo {\n @State() showFaviconLogo: boolean;\n @Element() host: HTMLPostLogoElement;\n private throttledResize: throttle<() => void>;\n private resizeObserver: ResizeObserver;\n\n constructor() {\n // Register window resize event listener and a resize observer on the mainnav controls (they change size while controls are being loaded) to display an accurately sized logo\n this.throttledResize = throttle(300, () => this.handleResize());\n window.addEventListener('resize', this.throttledResize, { passive: true });\n this.resizeObserver = new ResizeObserver(this.handleResize.bind(this));\n\n // Initially call the resize handler\n this.handleResize();\n }\n\n componentDidLoad() {\n const mainNavControls = this.host.parentElement?.querySelector('.main-navigation-controls');\n if (mainNavControls) {\n this.resizeObserver.observe(mainNavControls);\n }\n }\n\n disconnectedCallback() {\n window.removeEventListener('resize', this.throttledResize);\n this.resizeObserver.disconnect();\n }\n\n handleResize() {\n const mainNavControls = this.host.parentElement?.querySelector('.main-navigation-controls');\n const menuButton = this.host.parentElement?.querySelector('.menu-button');\n if (mainNavControls && menuButton)\n this.showFaviconLogo =\n window.innerWidth - (150 + mainNavControls.clientWidth + menuButton.clientWidth) <= 0;\n }\n\n render() {\n if (state.localizedConfig?.header.logo === undefined) return;\n const config = state.localizedConfig.header.logo;\n\n return (\n <Host>\n <a href={config.logoLink} class=\"logo\">\n <span class=\"visually-hidden\">{config.logoLinkTitle}</span>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 72 72\" aria-hidden=\"true\">\n <g id=\"Logo\">\n <rect fill=\"#ffcc00\" x=\"0\" y=\"0\" width=\"72\" height=\"72\" />\n <polygon\n fill=\"#ff0000\"\n 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\"\n />\n <path 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\" />\n </g>\n </svg>\n </a>\n </Host>\n );\n }\n}\n"],"mappings":"iIAAA,MAAMA,EAAc,84I,MCSPC,E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
+ var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function a(e){try{l(i.next(e))}catch(e){r(e)}}function s(e){try{l(i["throw"](e))}catch(e){r(e)}}function l(e){e.done?n(e.value):o(e.value).then(a,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(n=0)),n)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){n.label=s[1];break}if(s[0]===6&&n.label<r[1]){n.label=r[1];r=s;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(s);break}if(r[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++){if(r||!(i in t)){if(!r)r=Array.prototype.slice.call(t,0,i);r[i]=t[i]}}return e.concat(r||Array.prototype.slice.call(t))};System.register(["./p-f5935384.system.js","./p-9b4d5e90.system.js","./p-ce02164e.system.js","./p-0c5624c0.system.js","./p-65e18d30.system.js","./p-70805f8f.system.js","./p-77394e93.system.js","./p-edb2802d.system.js"],(function(e){"use strict";var t,n,i,o,r,a,s,l,u,d,c,f,h,g,p,v;return{setters:[function(e){t=e.r;n=e.c;i=e.h;o=e.H;r=e.g},function(e){a=e.t;s=e.d},function(e){l=e.g;u=e.p;d=e.t},function(e){c=e.u},function(e){f=e.s;h=e.d},function(e){g=e.S},function(e){p=e.S},function(e){v=e.I}],execute:function(){var m=this;var w=function(e,t){if(t===false){return e}var n;e=x(e);if(t==="auto"||t==="exact"){if(y(e)){return b(e)}n=new URL(window.location.href)}else{try{n=new URL(t,document.location.origin)}catch(n){console.warn("Active Route: ".concat(t," is not a valid URL. Navigation highlighting has been disabled."));return e}}var i=k(e,n,t);if(i.length===0){return e}var o=i[0];o.main.isActiveOverride=true;if(o.sub)o.sub.isActiveOverride=true;return e};var y=function(e){return e.filter((function(e){return e.isActive})).length>0};var b=function(e){return e.map((function(e){return Object.assign(Object.assign({},e),{isActiveOverride:e.isActive,flyout:e.flyout.map((function(e){return Object.assign(Object.assign({},e),{linkList:e.linkList.map((function(e){return Object.assign(Object.assign({},e),{isActiveOverride:e.isActive})}))})}))})}))};var x=function(e){return e.map((function(e){return Object.assign(Object.assign({},e),{isActiveOverride:false,flyout:e.flyout.map((function(e){return Object.assign(Object.assign({},e),{linkList:e.linkList.map((function(e){return Object.assign(Object.assign({},e),{isActiveOverride:false})}))})}))})}))};var k=function(e,t,n){var i=false;var o=[];e.filter((function(e){return!i&&e})).forEach((function(e){try{var r=O(t,new URL(e.url),n);i=C(o,r,{main:e,score:r},i)}catch(e){}e.flyout.forEach((function(r){var a;(a=r.linkList)===null||a===void 0?void 0:a.forEach((function(r){if(r.isActive&&(n==="auto"||n==="exact")){i=true;return}try{var a=new URL(r.url);var s=O(t,a,n);i=C(o,s,{main:e,sub:r,score:s},i)}catch(e){}}))}))}));return o.sort((function(e,t){return t.score-e.score}))};function C(e,t,n,i){var o=i;if(t>0){if(t===Infinity)o=true;e.push(n)}return o}var O=function(e,t,n){if(!e||!t||e.origin!==t.origin){return 0}var i=e.pathname.toLocaleLowerCase();var o=t.pathname.toLocaleLowerCase();if(i===o){return Infinity}if(e.pathname.length<t.pathname.length){return 0}if(n==="auto"){var r=__spreadArray([e.origin.toLocaleLowerCase()],i.split("/").filter((function(e){return!!e})),true);var a=__spreadArray([t.origin.toLocaleLowerCase()],o.split("/").filter((function(e){return!!e})),true);var s=j(r,a);return Math.min(r.length,a.length)===s?s:0}return 0};var j=function(e,t){if(!(e===null||e===void 0?void 0:e.length)||!(t===null||t===void 0?void 0:t.length)){return 0}var n=0;for(;n<Math.min(e.length,t.length);n++){if(e[n]!==t[n]){return 0}}return n};var _=null;var L=null;var F=function(){var e=document.querySelector("#PPM_HEADER_DATA");if(e===null||e===void 0?void 0:e.textContent){return JSON.parse(e.textContent)}return null};var S=function(e){var t=e.projectId,n=e.environment,i=e.language,o=e.cookieKey,r=e.localStorageKey,a=e.activeRouteProp,s=e.localizedCustomConfig,d=e.osFlyoutOverrides;return __awaiter(m,void 0,void 0,(function(){var e,c,f,h,g,p,v;return __generator(this,(function(m){switch(m.label){case 0:f=F();g=null;if(!f)return[3,1];h=f;p=document.documentElement.lang;return[3,3];case 1:if(!_){_=N(t,n)}return[4,_];case 2:g=m.sent();p=l(Object.keys(g),i,r,o);if(p===undefined){throw new Error("Internet Header: unable to determine current language")}h=Object.assign({},g[p]);m.label=3;case 3:if(s){v=((e=s===null||s===void 0?void 0:s.header)===null||e===void 0?void 0:e.navMain)?Object.assign(Object.assign({},h.header),{navMain:__spreadArray(__spreadArray([],h.header.navMain,true),s.header.navMain,true)}):h.header;h=Object.assign(Object.assign({},h),{header:v})}if(d)h.header.navMain=E(h,d);if(a)h.header.navMain=w(h.header.navMain,a);P((c=h===null||h===void 0?void 0:h.header)===null||c===void 0?void 0:c.navMain);u(p,o,r);return[2,h]}}))}))};var E=function(e,t){if(!t)return e.header.navMain;return e.header.navMain.map((function(e){var n,i;if(e.id!=="flyout_os")return e;if(L===null){L=JSON.parse(JSON.stringify(e))}var o=(n=t.text)!==null&&n!==void 0?n:L.text;var r=(i=t.title)!==null&&i!==void 0?i:L.title;if(!L.flyout||L.flyout.length===0||!t.flyout||t.flyout.length===0)return Object.assign(Object.assign({},e),{title:r,text:o});var a=__spreadArray(__spreadArray([],L.flyout.map((function(e,n){var i;var o=t.flyout[n];var r=(i=o.title)!==null&&i!==void 0?i:e.title;var a=o.linkList?t.flyout[n].linkList:[];return{title:r,linkList:__spreadArray(__spreadArray([],e.linkList,true),a,true)}})),true),t.flyout.slice(L.flyout.length),true);return Object.assign(Object.assign({},e),{text:o,title:r,flyout:a})}))};var N=function(e,t){return __awaiter(m,void 0,void 0,(function(){var n,i,o;return __generator(this,(function(r){switch(r.label){case 0:if(!D(e)){throw new Error('Internet Header: invalid project id "'.concat(e,'"'))}if(e==="test"){t="int01"}n=z(e,t);r.label=1;case 1:r.trys.push([1,4,,5]);return[4,fetch(n)];case 2:i=r.sent();return[4,i.json()];case 3:return[2,r.sent()];case 4:o=r.sent();throw new Error("Internet Header: fetching config failed. ".concat(o.message));case 5:return[2]}}))}))};var z=function(e,t){if(e==="test")return"assets/config/test-configuration.json";var n=t.toLowerCase();var i=n==="prod";var o="https://".concat(i?"www":"int",".post.ch");try{return new URL("".concat(o,"/api/headerjs/Json?serviceid=").concat(encodeURIComponent(e)).concat(!i?"&environment="+n:"")).toString()}catch(e){throw new Error("Internet Header: Config URL is invalid.")}};var D=function(e){return e!==""&&e.length>0&&/^[a-zA-Z][\w-]*[a-zA-Z0-9]$/.test(e)};var A=function(e,t){var n;var i;try{i=typeof e==="string"?JSON.parse(e):e}catch(e){throw new Error("Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. ")}var o=i[t];if((n=o===null||o===void 0?void 0:o.header)===null||n===void 0?void 0:n.navMain)P(o.header.navMain);return o};var P=function(e){e.forEach((function(e){e.id=e.id==="flyout_os"?e.id:c("main-nav-")}))};var R="@swisspost/internet-header";var M="1.7.4";var W="The header for client facing applications.";var I="Swiss Post <oss@post.ch>";var K="Apache-2.0";var T={type:"git",url:"https://github.com/swisspost/design-system.git"};var H="https://next.design-system.post.ch";var J={url:"https://github.com/swisspost/design-system/issues"};var U="loader/index.cjs.js";var B="loader/index.js";var q="loader/index.es2017.js";var G="loader/index.es2017.js";var X="loader/index.d.ts";var Y="dist/collection/collection-manifest.json";var Z="loader/cdn.js";var V={access:"public"};var $=["dist/","loader/"];var Q={start:"stencil build --docs --watch",dev:"stencil build --watch --serve --docs",build:"stencil build --docs",test:"npm run unit",unit:"jest","unit:watch":"jest --watch",e2e:"cypress run","e2e:watch":"cypress open",clean:"rimraf www dist loader storybook-static",lint:"eslint src/**/*{.ts,.tsx}","lint:fix":"eslint src/**/*{.ts,.tsx} --fix",generate:"stencil generate"};var ee={"@stencil/core":"3.3.1","@stencil/store":"2.0.8","@swisspost/design-system-styles":"workspace:6.2.3","body-scroll-lock":"4.0.0-beta.0","iframe-resizer":"4.3.6",jquery:"3.7.0",tabbable:"6.1.2","throttle-debounce":"5.0.0","url-polyfill":"1.1.12"};var te={"@babel/core":"7.22.5","@percy/cli":"1.25.0","@percy/cypress":"3.1.2","@stencil/eslint-plugin":"0.4.0","@stencil/sass":"3.0.4","@types/iframe-resizer":"3.5.9","@types/jest":"27.5.2","@types/jquery":"3.5.16","@types/node":"18.16.17","@types/throttle-debounce":"5.0.0","babel-loader":"9.1.2",bootstrap:"5.3.0",cypress:"12.14.0","cypress-each":"1.13.3","cypress-storybook":"0.5.1","eslint-plugin-react":"7.32.2",globby:"13.1.4",jest:"27.5.1",rimraf:"5.0.1","rollup-plugin-node-polyfills":"0.2.1","rollup-plugin-scss":"4.0.0","rollup-plugin-visualizer":"5.9.2",sass:"1.63.3","start-server-and-test":"2.0.0","ts-jest":"27.1.5",typescript:"4.9.5"};var ne={name:R,version:M,description:W,author:I,license:K,repository:T,homepage:H,bugs:J,main:U,module:B,es2015:q,es2017:G,"jsnext:main":"loader/index.es2017.js",types:X,collection:Y,"collection:main":"dist/collection/index.js",unpkg:Z,publishConfig:V,files:$,scripts:Q,dependencies:ee,devDependencies:te};var ie='@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:700;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:700;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:400;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:400;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:300;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff") format("woff")}@font-face{font-display:swap;font-family:"Frutiger Neue For Post";font-weight:300;font-style:italic;src:url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff2") format("woff2"), url("https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff") format("woff")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:transparent;border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0, 0, 0, 0.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:transparent;-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:black}.nav-link:focus-visible{z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:"Frutiger Neue For Post", system-ui, sans-serif}button{font:inherit;padding:0}a,button{border-radius:3px;outline:none;outline-offset:2px;}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:3px;position:relative;z-index:1}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active){svg{color:white}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px) and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1440.98px){.hidden-xxl{display:none}}:host{display:block;position:relative;font-size:1rem;font-weight:300;z-index:var(--header-z-index, 10);--header-height:3.5rem;--meta-header-height:0px;--language-dropdown-margin-top:0px}@media (min-width: 1024px){:host{--meta-header-height:3rem;--header-height:4rem}}@media (min-width: 1280px){:host{--header-height:4.5rem}}:host([meta=false]){--meta-header-height:0px;--language-dropdown-margin-top:1px}@supports ((position: -webkit-sticky) or (position: sticky)){:host(:not(.stickyness-none)){position:-webkit-sticky;position:sticky}:host(.stickyness-full){top:0}:host(.stickyness-main){top:calc(var(--meta-header-height, 0px) * -1)}:host(.stickyness-minimal){top:calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px) * -1);-webkit-transition:top 200ms ease-in;transition:top 200ms ease-in}:host(.stickyness-minimal.scrolling-up),:host(.stickyness-minimal.dropdown-open){top:calc(var(--meta-header-height, 0px) * -1);-webkit-transition:top 200ms ease-out;transition:top 200ms ease-out}}.post-internet-header{border-bottom:1px solid hsl(0, 0%, 90%);background-color:white}.main-navigation-container{display:-ms-flexbox;display:flex}.main-navigation-container>.main-navigation-controls{-ms-flex:0 0 auto;flex:0 0 auto}.main-navigation{display:-ms-flexbox;display:flex}.sub-navigation-container{position:absolute;top:100%;left:0;width:100%;display:-ms-flexbox;display:flex;background:white;visibility:hidden}.main-navigation-item:hover .sub-navigation-container{visibility:visible}.main-navigation-controls{display:-ms-flexbox;display:flex;margin-left:auto}@media (max-width: 1023.98px){.main-navigation-controls{font-weight:400}}@media (min-width: 1024px){.main-navigation-controls{font-size:1.0625rem}}.main-navigation-controls>*{border-left:1px solid hsl(0, 0%, 90%)}.menu-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 calc(1rem - 1px);font-weight:300;cursor:pointer;border-left:1px solid hsl(0, 0%, 90%);-ms-flex-order:1;order:1;}@media (min-width: 1024px){.menu-button{display:none}}@media (min-width: 600px) and (max-width: 1023.98px){.menu-button .visually-hidden{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible;margin-right:0.5rem}}.menu-button svg{width:1.5rem;height:1.5rem}.full-width .wide-container{max-width:none}';var oe=e("swisspost_internet_header",function(){function e(e){t(this,e);this.headerLoaded=n(this,"headerLoaded",7);this.lastScrollTop=window.scrollY||document.documentElement.scrollTop;this.lastWindowWidth=window.innerWidth;this.handleClickOutsideBound=this.handleClickOutside.bind(this);this.project=undefined;this.stickyness="minimal";this.language=undefined;this.meta=true;this.login=true;this.search=true;this.skiplinks=true;this.configProxy=undefined;this.environment="prod";this.languageSwitchOverrides=undefined;this.customConfig=undefined;this.languageCookieKey=undefined;this.languageLocalStorageKey="swisspost-internet-header-language";this.activeRoute="auto";this.osFlyoutOverrides=undefined;this.fullWidth=false;this.activeFlyout=null;this.activeDropdownElement=null;if(this.project===undefined||this.project===""||!D(this.project)){throw new Error('Internet Header project key is "'.concat(this.project,'". Please provide a valid project key.'))}}e.prototype.getCurrentLanguage=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){return[2,(e=f.currentLanguage)!==null&&e!==void 0?e:"de"]}))}))};e.prototype.connectedCallback=function(){var e=this;this.throttledScroll=a(300,(function(){return e.handleScrollEvent()}));this.debouncedResize=s(200,(function(){return e.handleResize()}));window.addEventListener("scroll",this.throttledScroll,{passive:true});window.addEventListener("resize",this.debouncedResize,{passive:true})};e.prototype.disconnectedCallback=function(){window.removeEventListener("scroll",this.throttledScroll);window.removeEventListener("resize",this.debouncedResize);h()};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);f.projectId=this.project;f.environment=this.environment;if(this.language!==undefined)f.currentLanguage=this.language;f.languageSwitchOverrides=typeof this.languageSwitchOverrides==="string"?JSON.parse(this.languageSwitchOverrides):this.languageSwitchOverrides;f.osFlyoutOverrides=typeof this.osFlyoutOverrides==="string"?JSON.parse(this.osFlyoutOverrides):this.osFlyoutOverrides;if(this.customConfig!==undefined&&f.currentLanguage!==null){f.localizedCustomConfig=A(this.customConfig,f.currentLanguage)}e=f;return[4,S({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:f.localizedCustomConfig,osFlyoutOverrides:f.osFlyoutOverrides})];case 1:e.localizedConfig=n.sent();return[3,3];case 2:t=n.sent();console.error(t);return[3,3];case 3:return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;window.requestAnimationFrame((function(){e.handleResize();e.headerLoaded.emit();e.host.classList.add("header-loaded")}))};e.prototype.handleLanguageChange=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:f.currentLanguage=e;t=f;return[4,S({projectId:this.project,environment:this.environment,language:e,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:f.localizedCustomConfig,osFlyoutOverrides:f.osFlyoutOverrides})];case 1:t.localizedConfig=n.sent();if(this.customConfig)f.localizedCustomConfig=A(this.customConfig,e);return[2]}}))}))};e.prototype.handleAvailableLanguagesChage=function(e){f.languageSwitchOverrides=typeof e==="string"?JSON.parse(e):e};e.prototype.handleOsFlyoutOverrides=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:f.osFlyoutOverrides=typeof e==="string"?JSON.parse(e):e;t=f;return[4,S({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:f.localizedCustomConfig,osFlyoutOverrides:f.osFlyoutOverrides})];case 1:t.localizedConfig=n.sent();return[2]}}))}))};e.prototype.handleActiveRouteChange=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:t=f;return[4,S({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:e,localizedCustomConfig:f.localizedCustomConfig,osFlyoutOverrides:f.osFlyoutOverrides})];case 1:t.localizedConfig=n.sent();return[2]}}))}))};e.prototype.handleCustomConfigChange=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(i){switch(i.label){case 0:if(this.language===undefined)return[2];t=A(e,this.language);f.localizedCustomConfig=t;n=f;return[4,S({projectId:this.project,environment:this.environment,language:this.language,cookieKey:this.languageCookieKey,localStorageKey:this.languageLocalStorageKey,activeRouteProp:this.activeRoute,localizedCustomConfig:t,osFlyoutOverrides:f.osFlyoutOverrides})];case 1:n.localizedConfig=i.sent();return[2]}}))}))};e.prototype.handleSearchChange=function(e){f.search=e};e.prototype.handleLoginChange=function(e){f.login=e};e.prototype.handleMetaChange=function(e){f.meta=e};e.prototype.handleLanguageChangeEvent=function(e){this.handleLanguageChange(e.detail)};e.prototype.handleClickOutside=function(e){if(this.activeDropdownElement&&!e.composedPath().includes(this.activeDropdownElement)){this.activeDropdownElement.toggleDropdown(false)}};e.prototype.handleKeyUp=function(e){if(e.key==="Escape"){if(this.activeDropdownElement){this.activeDropdownElement.toggleDropdown(false)}if(this.activeFlyout!==null&&this.mainNav){this.mainNav.toggleDropdown(false)}}};e.prototype.handleScrollEvent=function(){var e=window.scrollY||document.documentElement.scrollTop;if(this.stickyness==="minimal"){this.host.classList.toggle("scrolling-up",e<=this.lastScrollTop)}this.lastScrollTop=e<=0?0:e};e.prototype.handleResize=function(){var e;if(this.isMainNavOpen()&&this.lastWindowWidth<1024&&window.innerWidth>=1024){(e=this.activeDropdownElement)===null||e===void 0?void 0:e.toggleDropdown(false)}this.lastWindowWidth=window.innerWidth};e.prototype.handleDropdownToggled=function(e){var t=this;if(!e.detail.open&&this.activeDropdownElement!==e.detail.element){return}if(e.detail.open===true){if(this.activeDropdownElement){this.activeDropdownElement.toggleDropdown(false)}this.activeDropdownElement=e.detail.element;if(window.innerWidth>=1024){window.setTimeout((function(){window.addEventListener("click",t.handleClickOutsideBound)}),10)}if(this.activeFlyout!==null&&this.mainNav){this.mainNav.setActiveFlyout(null)}}else{this.activeDropdownElement=null;window.removeEventListener("click",this.handleClickOutsideBound)}};e.prototype.handleFlyoutToggled=function(e){this.activeFlyout=e.detail;if(this.activeDropdownElement&&e.detail&&!this.isMainNavOpen()){this.activeDropdownElement.toggleDropdown(false)}};e.prototype.toggleMobileDropdown=function(){var e;(e=this.mainNav)===null||e===void 0?void 0:e.toggleDropdown()};e.prototype.isMainNavOpen=function(){return this.activeDropdownElement&&this.activeDropdownElement.tagName==="POST-MAIN-NAVIGATION"};e.prototype.render=function(){var e=this;var t,n,r;if(!((t=f.localizedConfig)===null||t===void 0?void 0:t.header)){console.error(new Error("Internet Header: Config cannot be loaded"));return}var a=f.localizedConfig;var s=this.meta&&a.header.navMeta!==undefined&&((n=a.header.navMeta)===null||n===void 0?void 0:n.filter((function(e){return!e.isHomeLink})).length)>0;var l=((r=this.login)!==null&&r!==void 0?r:!a.header.isLoginWidgetHidden)&&a.header.loginWidgetOptions;var u=a.header.navLang.length>1;return i(o,{class:"stickyness-".concat(this.stickyness," ").concat(this.activeDropdownElement||this.activeFlyout?"dropdown-open":""),"data-version":ne.version,onKeyup:function(t){return e.handleKeyUp(t)}},i("header",{class:"post-internet-header".concat(this.fullWidth?" full-width":"")},i(g,null),i("h1",{class:"visually-hidden"},d("Navigate on post.ch")),i(v,{condition:this.skiplinks===true},i("post-skiplinks",null)),i(v,{condition:s===true},i("post-meta-navigation",{orientation:"horizontal",class:"hidden-lg","full-width":this.fullWidth},i(v,{condition:u===true},i("post-language-switch",{id:"post-language-switch-desktop",mode:"dropdown",onDropdownToggled:function(t){return e.handleDropdownToggled(t)}})))),i("div",{class:"main-navigation-container wide-container"},i("post-logo",null),i("button",{class:"menu-button nav-link",onClick:function(){return e.toggleMobileDropdown()},"aria-haspopup":"menu","aria-controls":"post-internet-header-main-navigation","aria-expanded":this.activeDropdownElement?"true":"false"},i("span",{class:"menu-button-text visually-hidden"},a.header.mobileMenu.text),i(p,{name:this.isMainNavOpen()?"pi-close":"pi-menu"})),i("post-main-navigation",{onDropdownToggled:function(t){return e.handleDropdownToggled(t)},onFlyoutToggled:function(t){return e.handleFlyoutToggled(t)},ref:function(t){return e.mainNav=t}},i(v,{condition:s===true},i("post-meta-navigation",{orientation:"vertical"},i(v,{condition:u===true},i("post-language-switch",{id:"post-language-switch-mobile",mode:"list"}))))),i("div",{class:"main-navigation-controls"},i(v,{condition:this.search!==false},i("post-search",{onDropdownToggled:function(t){return e.handleDropdownToggled(t)}})),i(v,{condition:!!l},i("post-klp-login-widget",null,i("slot",{name:"login-widget"}))),i(v,{condition:s===false&&u===true},i("post-language-switch",{id:"post-language-switch-no-meta",onDropdownToggled:function(t){return e.handleDropdownToggled(t)},mode:"dropdown"})),i("slot",{name:"main"})))))};Object.defineProperty(e.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{language:["handleLanguageChange"],languageSwitchOverrides:["handleAvailableLanguagesChage"],osFlyoutOverrides:["handleOsFlyoutOverrides"],activeRoute:["handleActiveRouteChange"],customConfig:["handleCustomConfigChange"],search:["handleSearchChange"],login:["handleLoginChange"],meta:["handleMetaChange"]}},enumerable:false,configurable:true});return e}());oe.style=ie}}}));
2
+ //# sourceMappingURL=p-ada8f68c.system.entry.js.map