@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
- {"file":"swisspost-internet-header.entry.cjs.js","mappings":";;;;;;;;;;;;;AAGA;;;;;;AAMO,MAAM,eAAe,GAAG,CAC7B,MAAuB,EACvB,eAAgC;;EAGhC,IAAI,eAAe,KAAK,KAAK,EAAE;IAC7B,OAAO,MAAM,CAAC;GACf;;EAGD,IAAI,UAAe,CAAC;EACpB,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;EAErC,IAAI,eAAe,KAAK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,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,IAE9BA,QAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,IAC1CJ,kCAAsB,WAAW,EAAC,UAAU,IAC1CA,QAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,IAC1CJ,kCACE,EAAE,EAAC,6BAA6B,EAChC,IAAI,EAAC,MAAM,GACW,CACrB,CACgB,CACpB,CACgB,EACvBA,iBAAK,KAAK,EAAC,0BAA0B,IACnCA,QAACI,eAAE,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,KAAK,KAAK,IAClCJ,yBAAa,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAgB,CAC/E,EACLA,QAACI,eAAE,IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,IAC1BJ,uCACEA,kBAAM,IAAI,EAAC,cAAc,GAAQ,CACX,CACrB,EACLA,QAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,KAAK,IAAI,oBAAoB,KAAK,IAAI,IAC5EJ,kCACE,EAAE,EAAC,8BAA8B,EACjC,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACrD,IAAI,EAAC,UAAU,GACO,CACrB,EACLA,kBAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CACF,CACC,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;","names":["getUserLang","persistLanguageChoice","uniqueId","state","throttle","debounce","dispose","h","Host","SvgSprite","translate","If","SvgIcon"],"sources":["./src/services/route.service.ts","./src/services/config.service.ts","./src/components/post-internet-header/post-internet-header.scss?tag=swisspost-internet-header&encapsulation=shadow","./src/components/post-internet-header/post-internet-header.tsx"],"sourcesContent":["import { ActiveRouteProp } from '../models/general.model';\nimport { NavMainEntity, MainNavScoreList } from '../models/header.model';\n\n/**\n * Activate the current route based on the config and the match mode\n * @param config Main Navigation Config\n * @param activeRouteProp Match mode\n * @returns Modified Main Navigation Config\n */\nexport const markActiveRoute = (\n config: NavMainEntity[],\n activeRouteProp: ActiveRouteProp,\n): NavMainEntity[] => {\n // Don't highlight any route\n if (activeRouteProp === false) {\n return config;\n }\n\n // Set compare URL and check if activeRouteProp is valid\n let compareUrl: URL;\n config = resetOverrideConfig(config);\n\n if (activeRouteProp === 'auto' || activeRouteProp === 'exact') {\n // Check if an active route is already configured, set override to that and return\n if (hasActivePortalRoute(config)) {\n return resetActiveStateToPortalConfig(config);\n }\n\n compareUrl = new URL(window.location.href);\n } else {\n try {\n compareUrl = new URL(activeRouteProp, document.location.origin);\n } catch (error) {\n console.warn(\n `Active Route: ${activeRouteProp} is not a valid URL. Navigation highlighting has been disabled.`,\n );\n return config;\n }\n }\n\n const scoreList = compileScoreList(config, compareUrl, activeRouteProp);\n\n if (scoreList.length === 0) {\n // No match found or already active links defined\n return config;\n }\n\n const winnerPair = scoreList[0];\n winnerPair.main.isActiveOverride = true;\n if (winnerPair.sub) winnerPair.sub.isActiveOverride = true;\n\n return config;\n};\n\n/**\n * Check if the portal config set any active route\n * @param config Main navigation config\n * @returns True if portal set any route as active\n */\nexport const hasActivePortalRoute = (config: NavMainEntity[]): boolean => {\n return config.filter(nav => nav.isActive).length > 0;\n};\n\nexport const resetActiveStateToPortalConfig = (config: NavMainEntity[]): NavMainEntity[] => {\n return config.map(nav => ({\n ...nav,\n isActiveOverride: nav.isActive,\n flyout: nav.flyout.map(flyout => ({\n ...flyout,\n linkList: flyout.linkList.map(link => ({ ...link, isActiveOverride: link.isActive })),\n })),\n }));\n};\n\nconst resetOverrideConfig = (config: NavMainEntity[]): NavMainEntity[] => {\n return config.map(nav => ({\n ...nav,\n isActiveOverride: false,\n flyout: nav.flyout.map(flyout => ({\n ...flyout,\n linkList: flyout.linkList.map(link => ({ ...link, isActiveOverride: false })),\n })),\n }));\n};\n\n/**\n * Compile a list of scores based on the map mode, sorted in descending order\n * @param config Main Nav Config\n * @param compareUrl Current Browser URL or a custom URL\n * @param activeRouteProp Match mode\n * @returns A list of scored URLs if any matched\n */\nexport const compileScoreList = (\n config: NavMainEntity[],\n compareUrl: URL,\n activeRouteProp: ActiveRouteProp,\n): MainNavScoreList => {\n // Flag to check if the Portal set any active links or if there are any exact matches\n let hadAnyActiveLink = false;\n const scoreList: MainNavScoreList = [];\n\n config\n .filter(mainNav => !hadAnyActiveLink && mainNav)\n .forEach(mainNav => {\n try {\n const score = compareRoutes(\n compareUrl,\n new URL(mainNav.url),\n activeRouteProp as 'auto' | 'exact',\n );\n\n hadAnyActiveLink = updateScoreList(\n scoreList,\n score,\n { main: mainNav, score },\n hadAnyActiveLink,\n );\n } catch {\n // Not a valid url, continue\n }\n\n // Loop through flyout links 2nd level\n mainNav.flyout.forEach(flyout => {\n flyout.linkList?.forEach(linklist => {\n // Don't override if any link is already active\n if (linklist.isActive && (activeRouteProp === 'auto' || activeRouteProp === 'exact')) {\n hadAnyActiveLink = true;\n return;\n }\n\n try {\n const url = new URL(linklist.url);\n const score = compareRoutes(compareUrl, url, activeRouteProp as 'auto' | 'exact');\n\n hadAnyActiveLink = updateScoreList(\n scoreList,\n score,\n { main: mainNav, sub: linklist, score },\n hadAnyActiveLink,\n );\n } catch {\n // Not a valid URL, continue\n }\n });\n });\n });\n\n return scoreList.sort((a, b) => b.score - a.score);\n};\n\n/**\n * Update score list\n */\nfunction updateScoreList(\n scoreList: MainNavScoreList,\n score: number,\n scoreListItem: any,\n hadAnyActiveLink: boolean,\n) {\n let hadActiveLink = hadAnyActiveLink;\n\n if (score > 0) {\n if (score === Infinity) hadActiveLink = true;\n // Push score\n scoreList.push(scoreListItem);\n }\n\n return hadActiveLink;\n}\n\n/**\n * Compare two URLs for similarity based on a match mode\n * @param baseUrl Browser URL\n * @param compareUrl Navigatgion URL\n * @param matchMode exact or auto matching\n * @returns Score\n */\nexport const compareRoutes = (\n baseUrl: URL,\n compareUrl: URL,\n matchMode?: 'auto' | 'exact',\n): number => {\n // One url is not defined or they don't share the same orign\n if (!baseUrl || !compareUrl || baseUrl.origin !== compareUrl.origin) {\n return 0;\n }\n\n const baseUrlPath = baseUrl.pathname.toLocaleLowerCase();\n const compareUrlPath = compareUrl.pathname.toLocaleLowerCase();\n\n // Exact match, origin and pathname are the same\n if (baseUrlPath === compareUrlPath) {\n return Infinity;\n }\n\n // The basepath is longer than the comparison, a match is impossible\n if (baseUrl.pathname.length < compareUrl.pathname.length) {\n return 0;\n }\n\n if (matchMode === 'auto') {\n const baseSegments = [\n baseUrl.origin.toLocaleLowerCase(),\n ...baseUrlPath.split('/').filter(x => !!x),\n ];\n const compareSegments = [\n compareUrl.origin.toLocaleLowerCase(),\n ...compareUrlPath.split('/').filter(x => !!x),\n ];\n\n const score = getSimilarityScore(baseSegments, compareSegments);\n\n // If only some segments match, but not the whole smaller array, it's not a match\n return Math.min(baseSegments.length, compareSegments.length) === score ? score : 0;\n }\n\n return 0;\n};\n\n/**\n * Check how many items in an array match\n * @param a Base array\n * @param b Compare array\n * @returns Score\n */\nexport const getSimilarityScore = (a: string[], b: string[]): number => {\n if (!a?.length || !b?.length) {\n return 0;\n }\n\n let i = 0;\n for (; i < Math.min(a.length, b.length); i++) {\n if (a[i] !== b[i]) {\n return 0;\n }\n }\n\n return i;\n};\n","import {\n Environment,\n IPortalConfig,\n ILocalizedConfig,\n ICustomConfig,\n ILocalizedCustomConfig,\n LocalizedConfigParameters,\n} from '../models/general.model';\nimport { NavMainEntity } from '../models/header.model';\nimport { getUserLang, persistLanguageChoice } from './language.service';\nimport { uniqueId } from '../utils/utils';\nimport { markActiveRoute } from './route.service';\n\n// Prevent double requests\nlet request: Promise<IPortalConfig> | null = null;\n\n// Cache the original os flyout to use it for updates\nlet osFlyoutCache: NavMainEntity | null = null;\n\nconst getPPMConfig = (): ILocalizedConfig | null => {\n const ppmConfigScript = document.querySelector('#PPM_HEADER_DATA');\n\n if (ppmConfigScript?.textContent) {\n return JSON.parse(ppmConfigScript.textContent);\n }\n\n return null;\n};\n\n/**\n * Get a localized config object\n *\n * @param projectId String identifying the project\n * @param language [optional] Preferred language\n * @returns Localized config object\n */\nexport const getLocalizedConfig = async ({\n projectId,\n environment,\n language,\n cookieKey,\n localStorageKey,\n activeRouteProp,\n localizedCustomConfig,\n osFlyoutOverrides,\n}: LocalizedConfigParameters): Promise<ILocalizedConfig> => {\n const ppmConfig = getPPMConfig();\n let localizedConfig: ILocalizedConfig;\n let config: IPortalConfig | null = null;\n let lang: string | undefined;\n\n if (ppmConfig) {\n localizedConfig = ppmConfig;\n lang = document.documentElement.lang;\n } else {\n if (!request) {\n request = fetchConfig(projectId, environment);\n }\n\n config = await request;\n lang = getUserLang(Object.keys(config), language, localStorageKey, cookieKey);\n\n if (lang === undefined) {\n throw new Error('Internet Header: unable to determine current language');\n }\n\n // Clone config for more predictable state updates\n localizedConfig = { ...config[lang] };\n }\n\n // Merge custom config with portal config\n if (localizedCustomConfig) {\n const header = localizedCustomConfig?.header?.navMain\n ? {\n ...localizedConfig.header,\n navMain: [...localizedConfig.header.navMain, ...localizedCustomConfig.header.navMain],\n }\n : localizedConfig.header;\n localizedConfig = {\n ...localizedConfig,\n header,\n };\n }\n\n // Add entries to flyout_os\n if (osFlyoutOverrides)\n localizedConfig.header.navMain = mergeOsFlyoutOverrides(localizedConfig, osFlyoutOverrides);\n\n // Mark active route\n if (activeRouteProp)\n localizedConfig.header.navMain = markActiveRoute(\n localizedConfig.header.navMain,\n activeRouteProp,\n );\n\n setMainNavigationIds(localizedConfig?.header?.navMain);\n\n // Set the new language choice\n persistLanguageChoice(lang, cookieKey, localStorageKey);\n\n return localizedConfig;\n};\n\n/**\n * Merge portal config with custom os flyout overrides\n * @param config Localized config\n * @param osFlyoutOverrides Overrides for the flyout\n * @returns Merged localized config\n */\nexport const mergeOsFlyoutOverrides = (\n config: ILocalizedConfig,\n osFlyoutOverrides: NavMainEntity,\n): NavMainEntity[] => {\n if (!osFlyoutOverrides) return config.header.navMain;\n\n return config.header.navMain.map(mainNav => {\n if (mainNav.id !== 'flyout_os') return mainNav;\n\n if (osFlyoutCache === null) {\n osFlyoutCache = JSON.parse(JSON.stringify(mainNav)) as NavMainEntity;\n }\n\n const mainNavText = osFlyoutOverrides.text ?? osFlyoutCache.text;\n const mainNavTitle = osFlyoutOverrides.title ?? osFlyoutCache.title;\n\n if (\n !osFlyoutCache.flyout ||\n osFlyoutCache.flyout.length === 0 ||\n !osFlyoutOverrides.flyout ||\n osFlyoutOverrides.flyout.length === 0\n )\n return {\n ...mainNav,\n title: mainNavTitle,\n text: mainNavText,\n };\n\n // Add entries for os flyout columns without overriding existing config\n const mainNavFlyout = [\n ...osFlyoutCache.flyout.map((col, index) => {\n const overrides = osFlyoutOverrides.flyout[index];\n const title = overrides.title ?? col.title;\n\n const linkList = overrides.linkList ? osFlyoutOverrides.flyout[index].linkList : [];\n\n return {\n title,\n linkList: [...col.linkList, ...linkList],\n };\n }),\n ...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),\n ];\n\n return {\n ...mainNav,\n text: mainNavText,\n title: mainNavTitle,\n flyout: mainNavFlyout,\n } as NavMainEntity;\n });\n};\n\n/**\n * Fetch the general config based on project id\n *\n * @returns Promise for Post Portal general config\n */\nexport const fetchConfig = async (\n projectId: string,\n environment: Environment,\n): Promise<IPortalConfig> => {\n // Check if project id is sanitized\n if (!isValidProjectId(projectId)) {\n throw new Error(`Internet Header: invalid project id \"${projectId}\"`);\n }\n\n if (projectId === 'test') {\n environment = 'int01';\n }\n\n let url = generateConfigUrl(projectId, environment);\n\n // Get the config if cache is invalid\n try {\n const res = await fetch(url);\n return (await res.json()) as IPortalConfig;\n } catch (error) {\n throw new Error(`Internet Header: fetching config failed. ${error.message}`);\n }\n};\n\n/**\n * Generate an URL with all necessary query params to get the configuration.\n * Project id \"test\" will return a test configuration\n * @param projectId string\n * @param environment int01, int02 or prod\n * @returns URL pointing to the project config\n */\nexport const generateConfigUrl = (projectId: string, environment: Environment): string => {\n if (projectId === 'test') return 'assets/config/test-configuration.json';\n\n const parsedEnvironment = environment.toLowerCase();\n const isProd = parsedEnvironment === 'prod';\n const host = `https://${isProd ? 'www' : 'int'}.post.ch`;\n try {\n // Use URL to validate the generated URL\n return new URL(\n `${host}/api/headerjs/Json?serviceid=${encodeURIComponent(projectId)}${\n !isProd ? '&environment=' + parsedEnvironment : ''\n }`,\n ).toString();\n } catch (error) {\n throw new Error(`Internet Header: Config URL is invalid.`);\n }\n};\n\n/**\n * Check if project id contains only URL safe characters\n *\n * @param projectId Project Id string\n * @returns The valid project id\n */\nexport const isValidProjectId = (projectId: string): boolean => {\n return projectId !== '' && projectId.length > 0 && /^[a-zA-Z][\\w-]*[a-zA-Z0-9]$/.test(projectId);\n};\n\n/**\n * Get the localized config object from a custom config\n *\n * @param config String or json object of the custom config\n * @param language Specific language\n * @returns Localized custom config object\n */\nexport const getLocalizedCustomConfig = (\n config: string | ICustomConfig,\n language: string,\n): ILocalizedCustomConfig | undefined => {\n let customConfig: ICustomConfig;\n try {\n customConfig = typeof config === 'string' ? JSON.parse(config) : config;\n } catch (error) {\n throw new Error(\n `Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. `,\n );\n }\n let localizedCustomConfig: ILocalizedCustomConfig | undefined = customConfig[language];\n if (localizedCustomConfig?.header?.navMain)\n setMainNavigationIds(localizedCustomConfig.header.navMain);\n return localizedCustomConfig;\n};\n\n/**\n * Check if mobile header styles are applied or not\n * @returns True if browser is smaller than 1024px\n */\nexport const isMobile = () => window.innerWidth < 1024;\n\n/**\n * Set unique ID's on main navigation entities but conserve flyout_os to be able to\n * identify the online-service flyout, which can be configured by osFlyoutOverrides\n */\nexport const setMainNavigationIds = (navMainEntities: NavMainEntity[]): void => {\n navMainEntities.forEach(navMainEntity => {\n navMainEntity.id = navMainEntity.id === 'flyout_os' ? navMainEntity.id : uniqueId('main-nav-');\n });\n};\n","@use '@swisspost/design-system-styles/variables/color';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n display: block;\n position: relative;\n font-size: 1rem;\n font-weight: 300;\n z-index: var(--header-z-index, 10);\n\n --header-height: 3.5rem; // 56px\n --meta-header-height: 0px; // Not visible on mobile\n --language-dropdown-margin-top: 0px;\n\n @include mixins.min(lg) {\n --meta-header-height: 3rem; // 48px\n --header-height: 4rem; // 64px\n }\n\n @include mixins.min(xl) {\n --header-height: 4.5rem; // 72px\n }\n}\n\n// Set height to 0 if meta is never visible\n:host([meta='false']) {\n --meta-header-height: 0px;\n // Compensation for header border-bottom, when language dropdown is displayed within main navigation controls\n --language-dropdown-margin-top: 1px;\n}\n\n// Support different kinds of stickyness modes\n// Works only in combination with setting header heights dynamically\n@supports (position: sticky) {\n // If stickyness is none, simply apply no styles, all others are sticky\n :host(:not(.stickyness-none)) {\n position: sticky;\n }\n\n // Everything is always sticky\n :host(.stickyness-full) {\n top: 0;\n }\n\n // Only main nav is sticky\n :host(.stickyness-main) {\n top: calc(var(--meta-header-height, 0px) * -1);\n }\n\n // Hide everything\n :host(.stickyness-minimal) {\n top: calc((var(--header-height, 0px) + var(--meta-header-height, 0px)) * -1);\n transition: top 200ms ease-in;\n }\n\n // Show main when scrolling up or any of the menus are open\n :host(.stickyness-minimal.scrolling-up),\n :host(.stickyness-minimal.dropdown-open) {\n top: calc(var(--meta-header-height, 0px) * -1);\n transition: top 200ms ease-out;\n }\n}\n\n.post-internet-header {\n border-bottom: 1px solid color.$gray-10;\n background-color: white;\n}\n\n.main-navigation-container {\n display: flex;\n\n & > .main-navigation-controls {\n flex: 0 0 auto;\n }\n}\n\n.main-navigation {\n display: flex;\n}\n\n.sub-navigation-container {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n display: flex;\n background: white;\n visibility: hidden;\n}\n\n.main-navigation-item:hover .sub-navigation-container {\n visibility: visible;\n}\n\n.main-navigation-controls {\n display: flex;\n margin-left: auto;\n\n @include mixins.max(lg) {\n font-weight: 400;\n }\n\n @include mixins.min(lg) {\n font-size: 1.0625rem;\n }\n\n & > * {\n border-left: 1px solid color.$gray-10;\n }\n}\n\n.menu-button {\n display: flex;\n align-items: center;\n padding: 0 calc(1rem - 1px);\n font-weight: 300;\n cursor: pointer;\n border-left: 1px solid color.$gray-10;\n order: 1; /* Display on the far right because of tab order */\n\n @include mixins.min(lg) {\n display: none;\n }\n\n .visually-hidden {\n @include mixins.between(rg, lg) {\n @include mixins.reset-visually-hidden();\n\n margin-right: 0.5rem;\n }\n }\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n}\n\n.full-width {\n .wide-container {\n max-width: none;\n }\n}\n","import {\n Component,\n Host,\n Element,\n h,\n State,\n Prop,\n Watch,\n Listen,\n EventEmitter,\n Event,\n Method,\n} from '@stencil/core';\nimport { debounce, throttle } from 'throttle-debounce';\nimport {\n getLocalizedConfig,\n getLocalizedCustomConfig,\n isValidProjectId,\n} from '../../services/config.service';\nimport { state, dispose } from '../../data/store';\nimport { DropdownElement, DropdownEvent, NavMainEntity } from '../../models/header.model';\nimport { SvgSprite } from '../../utils/svg-sprite.component';\nimport { SvgIcon } from '../../utils/svg-icon.component';\nimport { StickynessOptions } from '../../models/implementor.model';\nimport { ActiveRouteProp, Environment, ICustomConfig } from '../../models/general.model';\nimport { IAvailableLanguage } from '../../models/language.model';\nimport { translate } from '../../services/language.service';\nimport { If } from '../../utils/if.component';\nimport packageJson from '../../../package.json';\n\n@Component({\n tag: 'swisspost-internet-header',\n styleUrl: 'post-internet-header.scss',\n shadow: true,\n})\nexport class PostInternetHeader {\n /**\n * Your project id, previously passed as query string parameter serviceId.\n */\n @Prop() project: string;\n\n /**\n * Sticky behaviour of the header.\n */\n @Prop() stickyness: StickynessOptions = 'minimal';\n\n /**\n * Initial language to be used. Overrides automatic language detection.\n */\n @Prop() language?: string;\n\n /**\n * Toggle the meta navigation.\n */\n @Prop() meta: boolean = true;\n\n /**\n * Toggle the login link (when logged out) or the user widget (when logged in).\n */\n @Prop() login: boolean = true;\n\n /**\n * Toggle the search button.\n */\n @Prop() search: boolean = true;\n\n /**\n * Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page.\n */\n @Prop() skiplinks: boolean = true;\n\n /**\n * DEPRECATED!: Define a proxy URL for the config fetch request. Will be removed in the next major version\n */\n @Prop() configProxy?: string;\n\n /**\n * Target environment. Choose 'int01' for local testing.\n */\n @Prop() environment: Environment = 'prod';\n\n /**\n * Override the language switch links with custom URLs. Helpful when your application contains sub-pages and you\n * would like to stay on subpages when the user changes language.\n */\n @Prop() languageSwitchOverrides?: string | IAvailableLanguage[];\n\n /**\n * Customize the header config loaded from the post portal.\n */\n @Prop() customConfig?: string | ICustomConfig;\n\n /**\n * The header uses this cookie to set the language. Disables automatic language detection.\n */\n @Prop() languageCookieKey?: string;\n\n /**\n * The header uses this local storage key to set the language. Disables automatic language selection.\n */\n @Prop() languageLocalStorageKey?: string = 'swisspost-internet-header-language';\n\n /**\n * Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted.\n * Will also highlight partly matching URLs. When set to auto, will use current location.href for comparison.\n */\n @Prop() activeRoute?: 'auto' | false | string = 'auto';\n\n /**\n * Online Services only: Add custom links to the special online service navigation entry\n */\n @Prop() osFlyoutOverrides?: string | NavMainEntity;\n\n /**\n * Displays the header at full width for full-screen applications\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * Fires when the header has been rendered to the page.\n */\n @Event() headerLoaded: EventEmitter<void>;\n\n @State() activeFlyout: string | null = null;\n @State() activeDropdownElement: DropdownElement | null = null;\n @Element() host: HTMLElement;\n\n /**\n * Get the currently set language as a two letter string (\"de\", \"fr\" \"it\" or \"en\")\n * @returns string\n */\n @Method()\n async getCurrentLanguage(): Promise<'de' | 'fr' | 'it' | 'en' | string> {\n return state.currentLanguage ?? 'de';\n }\n\n private mainNav?: HTMLPostMainNavigationElement;\n private lastScrollTop = window.scrollY || document.documentElement.scrollTop;\n private throttledScroll: throttle<() => void>;\n private debouncedResize: debounce<() => void>;\n private lastWindowWidth: number = window.innerWidth;\n\n constructor() {\n if (this.project === undefined || this.project === '' || !isValidProjectId(this.project)) {\n throw new Error(\n `Internet Header project key is \"${this.project}\". Please provide a valid project key.`,\n );\n }\n }\n\n connectedCallback() {\n this.throttledScroll = throttle(300, () => this.handleScrollEvent());\n this.debouncedResize = debounce(200, () => this.handleResize());\n window.addEventListener('scroll', this.throttledScroll, { passive: true });\n window.addEventListener('resize', this.debouncedResize, { passive: true });\n }\n\n disconnectedCallback() {\n window.removeEventListener('scroll', this.throttledScroll);\n window.removeEventListener('resize', this.debouncedResize);\n\n // Reset the store to its original state\n dispose();\n }\n\n async componentWillLoad() {\n // Wait for the config to arrive, then render the header\n try {\n state.projectId = this.project;\n state.environment = this.environment;\n if (this.language !== undefined) state.currentLanguage = this.language;\n state.languageSwitchOverrides =\n typeof this.languageSwitchOverrides === 'string'\n ? JSON.parse(this.languageSwitchOverrides)\n : this.languageSwitchOverrides;\n state.osFlyoutOverrides =\n typeof this.osFlyoutOverrides === 'string'\n ? JSON.parse(this.osFlyoutOverrides)\n : this.osFlyoutOverrides;\n\n if (this.customConfig !== undefined && state.currentLanguage !== null) {\n state.localizedCustomConfig = getLocalizedCustomConfig(\n this.customConfig,\n state.currentLanguage,\n );\n }\n\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n } catch (error) {\n console.error(error);\n }\n }\n\n componentDidLoad() {\n window.requestAnimationFrame(() => {\n this.handleResize();\n this.headerLoaded.emit();\n this.host.classList.add('header-loaded');\n });\n }\n\n @Watch('language')\n async handleLanguageChange(newValue: string) {\n state.currentLanguage = newValue;\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: newValue,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n if (this.customConfig)\n state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, newValue);\n }\n\n @Watch('languageSwitchOverrides')\n handleAvailableLanguagesChage(newValue: string | IAvailableLanguage[]) {\n state.languageSwitchOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;\n }\n\n @Watch('osFlyoutOverrides')\n async handleOsFlyoutOverrides(newValue: string | NavMainEntity) {\n state.osFlyoutOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n }\n\n @Watch('activeRoute')\n async handleActiveRouteChange(newValue: string | ActiveRouteProp) {\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: newValue,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n }\n\n @Watch('customConfig')\n async handleCustomConfigChange(newValue: string | ICustomConfig) {\n if (this.language === undefined) return;\n const localizedCustomConfig = getLocalizedCustomConfig(newValue, this.language);\n state.localizedCustomConfig = localizedCustomConfig;\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n }\n\n @Watch('search')\n handleSearchChange(newValue: boolean) {\n state.search = newValue;\n }\n\n @Watch('login')\n handleLoginChange(newValue: boolean) {\n state.login = newValue;\n }\n\n @Watch('meta')\n handleMetaChange(newValue: boolean) {\n state.meta = newValue;\n }\n\n @Listen('languageChanged')\n handleLanguageChangeEvent(event: CustomEvent<string>) {\n this.handleLanguageChange(event.detail);\n }\n\n private handleClickOutsideBound = this.handleClickOutside.bind(this);\n\n private handleClickOutside(event: Event) {\n // Close active dropdown element on click outside of it\n if (this.activeDropdownElement && !event.composedPath().includes(this.activeDropdownElement)) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n }\n\n private handleKeyUp(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n if (this.activeDropdownElement) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n if (this.activeFlyout !== null && this.mainNav) {\n this.mainNav.toggleDropdown(false);\n }\n }\n }\n\n private handleScrollEvent() {\n // Credits: \"https://github.com/qeremy/so/blob/master/so.dom.js#L426\"\n const st = window.scrollY || document.documentElement.scrollTop;\n\n // Toggle class without re-rendering the component if stickyness is minimal\n // the other stickyness modes do not need the class\n if (this.stickyness === 'minimal') {\n this.host.classList.toggle('scrolling-up', st <= this.lastScrollTop);\n }\n\n // For Mobile or negative scrolling\n this.lastScrollTop = st <= 0 ? 0 : st;\n }\n\n private handleResize() {\n // Close main navigation dropdown if size changed to bigger than 1024px (search dropdown will be kept open)\n if (this.isMainNavOpen() && this.lastWindowWidth < 1024 && window.innerWidth >= 1024) {\n this.activeDropdownElement?.toggleDropdown(false);\n }\n\n this.lastWindowWidth = window.innerWidth;\n }\n\n /**\n * Close open dropdown menus if another is being opened\n *\n * @param event Dropdown toggled event\n * @returns void\n */\n private handleDropdownToggled(event: CustomEvent<DropdownEvent>) {\n if (!event.detail.open && this.activeDropdownElement !== event.detail.element) {\n // Some dropdown got closed programmatically (possibly by this function). To prevent\n // a circle or an outdated state, we'll not handle this event\n return;\n }\n\n if (event.detail.open === true) {\n if (this.activeDropdownElement) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n\n this.activeDropdownElement = event.detail.element;\n\n if (window.innerWidth >= 1024) {\n // Add event listener to close active dropdown element on click outsite of it\n // Also adds 10ms delay in case of an external interaction:\n // Some button on the page calls toggleDropdown() -> dropdown opens\n // Click event bubbles to the window, this.handleClickOutsideBound closes dropdown again\n window.setTimeout(() => {\n window.addEventListener('click', this.handleClickOutsideBound);\n }, 10);\n }\n\n if (this.activeFlyout !== null && this.mainNav) {\n this.mainNav.setActiveFlyout(null);\n }\n } else {\n this.activeDropdownElement = null;\n\n // Remove event listener as it is not needed if no dropdown element is active\n window.removeEventListener('click', this.handleClickOutsideBound);\n }\n }\n\n /**\n * Close open dropdowns if the flyout is being opened\n * @param event Flyout toggle event\n */\n private handleFlyoutToggled(event: CustomEvent<string | null>) {\n this.activeFlyout = event.detail;\n\n if (this.activeDropdownElement && event.detail && !this.isMainNavOpen()) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n }\n\n private toggleMobileDropdown() {\n this.mainNav?.toggleDropdown();\n }\n\n private isMainNavOpen() {\n return (\n this.activeDropdownElement && this.activeDropdownElement.tagName === 'POST-MAIN-NAVIGATION'\n );\n }\n\n render() {\n if (!state.localizedConfig?.header) {\n console.error(new Error('Internet Header: Config cannot be loaded'));\n return;\n }\n\n const config = state.localizedConfig;\n const renderMetaNavigation =\n this.meta &&\n config.header.navMeta !== undefined &&\n config.header.navMeta?.filter(meta => !meta.isHomeLink).length > 0;\n const renderLogin =\n (this.login ?? !config.header.isLoginWidgetHidden) && config.header.loginWidgetOptions;\n const renderLanguageSwitch = config.header.navLang.length > 1;\n\n return (\n <Host\n class={`stickyness-${this.stickyness} ${\n this.activeDropdownElement || this.activeFlyout ? 'dropdown-open' : ''\n }`}\n data-version={packageJson.version}\n onKeyup={(e: KeyboardEvent) => this.handleKeyUp(e)}\n >\n <header class={`post-internet-header${this.fullWidth ? ' full-width' : ''}`}>\n <SvgSprite />\n <h1 class=\"visually-hidden\">{translate('Navigate on post.ch')}</h1>\n <If condition={this.skiplinks === true}>\n <post-skiplinks></post-skiplinks>\n </If>\n <If condition={renderMetaNavigation === true}>\n <post-meta-navigation\n orientation=\"horizontal\"\n class=\"hidden-lg\"\n full-width={this.fullWidth}\n >\n <If condition={renderLanguageSwitch === true}>\n <post-language-switch\n id=\"post-language-switch-desktop\"\n mode=\"dropdown\"\n onDropdownToggled={e => this.handleDropdownToggled(e)}\n ></post-language-switch>\n </If>\n </post-meta-navigation>\n </If>\n <div class=\"main-navigation-container wide-container\">\n <post-logo></post-logo>\n <button\n class=\"menu-button nav-link\"\n onClick={() => this.toggleMobileDropdown()}\n aria-haspopup=\"menu\"\n aria-controls=\"post-internet-header-main-navigation\"\n aria-expanded={this.activeDropdownElement ? 'true' : 'false'}\n >\n <span class=\"menu-button-text visually-hidden\">{config.header.mobileMenu.text}</span>\n <SvgIcon name={this.isMainNavOpen() ? 'pi-close' : 'pi-menu'}></SvgIcon>\n </button>\n <post-main-navigation\n onDropdownToggled={e => this.handleDropdownToggled(e)}\n onFlyoutToggled={e => this.handleFlyoutToggled(e)}\n ref={el => (this.mainNav = el)}\n >\n <If condition={renderMetaNavigation === true}>\n <post-meta-navigation orientation=\"vertical\">\n <If condition={renderLanguageSwitch === true}>\n <post-language-switch\n id=\"post-language-switch-mobile\"\n mode=\"list\"\n ></post-language-switch>\n </If>\n </post-meta-navigation>\n </If>\n </post-main-navigation>\n <div class=\"main-navigation-controls\">\n <If condition={this.search !== false}>\n <post-search onDropdownToggled={e => this.handleDropdownToggled(e)}></post-search>\n </If>\n <If condition={!!renderLogin}>\n <post-klp-login-widget>\n <slot name=\"login-widget\"></slot>\n </post-klp-login-widget>\n </If>\n <If condition={renderMetaNavigation === false && renderLanguageSwitch === true}>\n <post-language-switch\n id=\"post-language-switch-no-meta\"\n onDropdownToggled={e => this.handleDropdownToggled(e)}\n mode=\"dropdown\"\n ></post-language-switch>\n </If>\n <slot name=\"main\"></slot>\n </div>\n </div>\n </header>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"swisspost-internet-header.entry.cjs.js","mapp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AC,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,UAAU,GAAG,SAAS,GAAY,CACjE,EACTL,kCACE,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACrD,eAAe,EAAE,CAAC,IAAI,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EACjD,GAAG,EAAE,EAAE,KAAK,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,IAE9BA,QAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,IAC1CJ,kCAAsB,WAAW,EAAC,UAAU,IAC1CA,QAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,IAAI,IAC1CJ,kCACE,EAAE,EAAC,6BAA6B,EAChC,IAAI,EAAC,MAAM,GACW,CACrB,CACgB,CACpB,CACgB,EACvBA,iBAAK,KAAK,EAAC,0BAA0B,IACnCA,QAACI,eAAE,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,KAAK,KAAK,IAClCJ,yBAAa,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAgB,CAC/E,EACLA,QAACI,eAAE,IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,IAC1BJ,uCACEA,kBAAM,IAAI,EAAC,cAAc,GAAQ,CACX,CACrB,EACLA,QAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,KAAK,IAAI,oBAAoB,KAAK,IAAI,IAC5EJ,kCACE,EAAE,EAAC,8BAA8B,EACjC,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACrD,IAAI,EAAC,UAAU,GACO,CACrB,EACLA,kBAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CACF,CACC,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;","names":["getUserLang","persistLanguageChoice","uniqueId","state","throttle","debounce","dispose","h","Host","SvgSprite","translate","If","SvgIcon"],"sources":["./src/services/route.service.ts","./src/services/config.service.ts","./src/components/post-internet-header/post-internet-header.scss?tag=swisspost-internet-header&encapsulation=shadow","./src/components/post-internet-header/post-internet-header.tsx"],"sourcesContent":["import { ActiveRouteProp } from '../models/general.model';\nimport { NavMainEntity, MainNavScoreList } from '../models/header.model';\n\n/**\n * Activate the current route based on the config and the match mode\n * @param config Main Navigation Config\n * @param activeRouteProp Match mode\n * @returns Modified Main Navigation Config\n */\nexport const markActiveRoute = (\n config: NavMainEntity[],\n activeRouteProp: ActiveRouteProp,\n): NavMainEntity[] => {\n // Don't highlight any route\n if (activeRouteProp === false) {\n return config;\n }\n\n // Set compare URL and check if activeRouteProp is valid\n let compareUrl: URL;\n config = resetOverrideConfig(config);\n\n if (activeRouteProp === 'auto' || activeRouteProp === 'exact') {\n // Check if an active route is already configured, set override to that and return\n if (hasActivePortalRoute(config)) {\n return resetActiveStateToPortalConfig(config);\n }\n\n compareUrl = new URL(window.location.href);\n } else {\n try {\n compareUrl = new URL(activeRouteProp, document.location.origin);\n } catch (error) {\n console.warn(\n `Active Route: ${activeRouteProp} is not a valid URL. Navigation highlighting has been disabled.`,\n );\n return config;\n }\n }\n\n const scoreList = compileScoreList(config, compareUrl, activeRouteProp);\n\n if (scoreList.length === 0) {\n // No match found or already active links defined\n return config;\n }\n\n const winnerPair = scoreList[0];\n winnerPair.main.isActiveOverride = true;\n if (winnerPair.sub) winnerPair.sub.isActiveOverride = true;\n\n return config;\n};\n\n/**\n * Check if the portal config set any active route\n * @param config Main navigation config\n * @returns True if portal set any route as active\n */\nexport const hasActivePortalRoute = (config: NavMainEntity[]): boolean => {\n return config.filter(nav => nav.isActive).length > 0;\n};\n\nexport const resetActiveStateToPortalConfig = (config: NavMainEntity[]): NavMainEntity[] => {\n return config.map(nav => ({\n ...nav,\n isActiveOverride: nav.isActive,\n flyout: nav.flyout.map(flyout => ({\n ...flyout,\n linkList: flyout.linkList.map(link => ({ ...link, isActiveOverride: link.isActive })),\n })),\n }));\n};\n\nconst resetOverrideConfig = (config: NavMainEntity[]): NavMainEntity[] => {\n return config.map(nav => ({\n ...nav,\n isActiveOverride: false,\n flyout: nav.flyout.map(flyout => ({\n ...flyout,\n linkList: flyout.linkList.map(link => ({ ...link, isActiveOverride: false })),\n })),\n }));\n};\n\n/**\n * Compile a list of scores based on the map mode, sorted in descending order\n * @param config Main Nav Config\n * @param compareUrl Current Browser URL or a custom URL\n * @param activeRouteProp Match mode\n * @returns A list of scored URLs if any matched\n */\nexport const compileScoreList = (\n config: NavMainEntity[],\n compareUrl: URL,\n activeRouteProp: ActiveRouteProp,\n): MainNavScoreList => {\n // Flag to check if the Portal set any active links or if there are any exact matches\n let hadAnyActiveLink = false;\n const scoreList: MainNavScoreList = [];\n\n config\n .filter(mainNav => !hadAnyActiveLink && mainNav)\n .forEach(mainNav => {\n try {\n const score = compareRoutes(\n compareUrl,\n new URL(mainNav.url),\n activeRouteProp as 'auto' | 'exact',\n );\n\n hadAnyActiveLink = updateScoreList(\n scoreList,\n score,\n { main: mainNav, score },\n hadAnyActiveLink,\n );\n } catch {\n // Not a valid url, continue\n }\n\n // Loop through flyout links 2nd level\n mainNav.flyout.forEach(flyout => {\n flyout.linkList?.forEach(linklist => {\n // Don't override if any link is already active\n if (linklist.isActive && (activeRouteProp === 'auto' || activeRouteProp === 'exact')) {\n hadAnyActiveLink = true;\n return;\n }\n\n try {\n const url = new URL(linklist.url);\n const score = compareRoutes(compareUrl, url, activeRouteProp as 'auto' | 'exact');\n\n hadAnyActiveLink = updateScoreList(\n scoreList,\n score,\n { main: mainNav, sub: linklist, score },\n hadAnyActiveLink,\n );\n } catch {\n // Not a valid URL, continue\n }\n });\n });\n });\n\n return scoreList.sort((a, b) => b.score - a.score);\n};\n\n/**\n * Update score list\n */\nfunction updateScoreList(\n scoreList: MainNavScoreList,\n score: number,\n scoreListItem: any,\n hadAnyActiveLink: boolean,\n) {\n let hadActiveLink = hadAnyActiveLink;\n\n if (score > 0) {\n if (score === Infinity) hadActiveLink = true;\n // Push score\n scoreList.push(scoreListItem);\n }\n\n return hadActiveLink;\n}\n\n/**\n * Compare two URLs for similarity based on a match mode\n * @param baseUrl Browser URL\n * @param compareUrl Navigatgion URL\n * @param matchMode exact or auto matching\n * @returns Score\n */\nexport const compareRoutes = (\n baseUrl: URL,\n compareUrl: URL,\n matchMode?: 'auto' | 'exact',\n): number => {\n // One url is not defined or they don't share the same orign\n if (!baseUrl || !compareUrl || baseUrl.origin !== compareUrl.origin) {\n return 0;\n }\n\n const baseUrlPath = baseUrl.pathname.toLocaleLowerCase();\n const compareUrlPath = compareUrl.pathname.toLocaleLowerCase();\n\n // Exact match, origin and pathname are the same\n if (baseUrlPath === compareUrlPath) {\n return Infinity;\n }\n\n // The basepath is longer than the comparison, a match is impossible\n if (baseUrl.pathname.length < compareUrl.pathname.length) {\n return 0;\n }\n\n if (matchMode === 'auto') {\n const baseSegments = [\n baseUrl.origin.toLocaleLowerCase(),\n ...baseUrlPath.split('/').filter(x => !!x),\n ];\n const compareSegments = [\n compareUrl.origin.toLocaleLowerCase(),\n ...compareUrlPath.split('/').filter(x => !!x),\n ];\n\n const score = getSimilarityScore(baseSegments, compareSegments);\n\n // If only some segments match, but not the whole smaller array, it's not a match\n return Math.min(baseSegments.length, compareSegments.length) === score ? score : 0;\n }\n\n return 0;\n};\n\n/**\n * Check how many items in an array match\n * @param a Base array\n * @param b Compare array\n * @returns Score\n */\nexport const getSimilarityScore = (a: string[], b: string[]): number => {\n if (!a?.length || !b?.length) {\n return 0;\n }\n\n let i = 0;\n for (; i < Math.min(a.length, b.length); i++) {\n if (a[i] !== b[i]) {\n return 0;\n }\n }\n\n return i;\n};\n","import {\n Environment,\n IPortalConfig,\n ILocalizedConfig,\n ICustomConfig,\n ILocalizedCustomConfig,\n LocalizedConfigParameters,\n} from '../models/general.model';\nimport { NavMainEntity } from '../models/header.model';\nimport { getUserLang, persistLanguageChoice } from './language.service';\nimport { uniqueId } from '../utils/utils';\nimport { markActiveRoute } from './route.service';\n\n// Prevent double requests\nlet request: Promise<IPortalConfig> | null = null;\n\n// Cache the original os flyout to use it for updates\nlet osFlyoutCache: NavMainEntity | null = null;\n\nconst getPPMConfig = (): ILocalizedConfig | null => {\n const ppmConfigScript = document.querySelector('#PPM_HEADER_DATA');\n\n if (ppmConfigScript?.textContent) {\n return JSON.parse(ppmConfigScript.textContent);\n }\n\n return null;\n};\n\n/**\n * Get a localized config object\n *\n * @param projectId String identifying the project\n * @param language [optional] Preferred language\n * @returns Localized config object\n */\nexport const getLocalizedConfig = async ({\n projectId,\n environment,\n language,\n cookieKey,\n localStorageKey,\n activeRouteProp,\n localizedCustomConfig,\n osFlyoutOverrides,\n}: LocalizedConfigParameters): Promise<ILocalizedConfig> => {\n const ppmConfig = getPPMConfig();\n let localizedConfig: ILocalizedConfig;\n let config: IPortalConfig | null = null;\n let lang: string | undefined;\n\n if (ppmConfig) {\n localizedConfig = ppmConfig;\n lang = document.documentElement.lang;\n } else {\n if (!request) {\n request = fetchConfig(projectId, environment);\n }\n\n config = await request;\n lang = getUserLang(Object.keys(config), language, localStorageKey, cookieKey);\n\n if (lang === undefined) {\n throw new Error('Internet Header: unable to determine current language');\n }\n\n // Clone config for more predictable state updates\n localizedConfig = { ...config[lang] };\n }\n\n // Merge custom config with portal config\n if (localizedCustomConfig) {\n const header = localizedCustomConfig?.header?.navMain\n ? {\n ...localizedConfig.header,\n navMain: [...localizedConfig.header.navMain, ...localizedCustomConfig.header.navMain],\n }\n : localizedConfig.header;\n localizedConfig = {\n ...localizedConfig,\n header,\n };\n }\n\n // Add entries to flyout_os\n if (osFlyoutOverrides)\n localizedConfig.header.navMain = mergeOsFlyoutOverrides(localizedConfig, osFlyoutOverrides);\n\n // Mark active route\n if (activeRouteProp)\n localizedConfig.header.navMain = markActiveRoute(\n localizedConfig.header.navMain,\n activeRouteProp,\n );\n\n setMainNavigationIds(localizedConfig?.header?.navMain);\n\n // Set the new language choice\n persistLanguageChoice(lang, cookieKey, localStorageKey);\n\n return localizedConfig;\n};\n\n/**\n * Merge portal config with custom os flyout overrides\n * @param config Localized config\n * @param osFlyoutOverrides Overrides for the flyout\n * @returns Merged localized config\n */\nexport const mergeOsFlyoutOverrides = (\n config: ILocalizedConfig,\n osFlyoutOverrides: NavMainEntity,\n): NavMainEntity[] => {\n if (!osFlyoutOverrides) return config.header.navMain;\n\n return config.header.navMain.map(mainNav => {\n if (mainNav.id !== 'flyout_os') return mainNav;\n\n if (osFlyoutCache === null) {\n osFlyoutCache = JSON.parse(JSON.stringify(mainNav)) as NavMainEntity;\n }\n\n const mainNavText = osFlyoutOverrides.text ?? osFlyoutCache.text;\n const mainNavTitle = osFlyoutOverrides.title ?? osFlyoutCache.title;\n\n if (\n !osFlyoutCache.flyout ||\n osFlyoutCache.flyout.length === 0 ||\n !osFlyoutOverrides.flyout ||\n osFlyoutOverrides.flyout.length === 0\n )\n return {\n ...mainNav,\n title: mainNavTitle,\n text: mainNavText,\n };\n\n // Add entries for os flyout columns without overriding existing config\n const mainNavFlyout = [\n ...osFlyoutCache.flyout.map((col, index) => {\n const overrides = osFlyoutOverrides.flyout[index];\n const title = overrides.title ?? col.title;\n\n const linkList = overrides.linkList ? osFlyoutOverrides.flyout[index].linkList : [];\n\n return {\n title,\n linkList: [...col.linkList, ...linkList],\n };\n }),\n ...osFlyoutOverrides.flyout.slice(osFlyoutCache.flyout.length),\n ];\n\n return {\n ...mainNav,\n text: mainNavText,\n title: mainNavTitle,\n flyout: mainNavFlyout,\n } as NavMainEntity;\n });\n};\n\n/**\n * Fetch the general config based on project id\n *\n * @returns Promise for Post Portal general config\n */\nexport const fetchConfig = async (\n projectId: string,\n environment: Environment,\n): Promise<IPortalConfig> => {\n // Check if project id is sanitized\n if (!isValidProjectId(projectId)) {\n throw new Error(`Internet Header: invalid project id \"${projectId}\"`);\n }\n\n if (projectId === 'test') {\n environment = 'int01';\n }\n\n let url = generateConfigUrl(projectId, environment);\n\n // Get the config if cache is invalid\n try {\n const res = await fetch(url);\n return (await res.json()) as IPortalConfig;\n } catch (error) {\n throw new Error(`Internet Header: fetching config failed. ${error.message}`);\n }\n};\n\n/**\n * Generate an URL with all necessary query params to get the configuration.\n * Project id \"test\" will return a test configuration\n * @param projectId string\n * @param environment int01, int02 or prod\n * @returns URL pointing to the project config\n */\nexport const generateConfigUrl = (projectId: string, environment: Environment): string => {\n if (projectId === 'test') return 'assets/config/test-configuration.json';\n\n const parsedEnvironment = environment.toLowerCase();\n const isProd = parsedEnvironment === 'prod';\n const host = `https://${isProd ? 'www' : 'int'}.post.ch`;\n try {\n // Use URL to validate the generated URL\n return new URL(\n `${host}/api/headerjs/Json?serviceid=${encodeURIComponent(projectId)}${\n !isProd ? '&environment=' + parsedEnvironment : ''\n }`,\n ).toString();\n } catch (error) {\n throw new Error(`Internet Header: Config URL is invalid.`);\n }\n};\n\n/**\n * Check if project id contains only URL safe characters\n *\n * @param projectId Project Id string\n * @returns The valid project id\n */\nexport const isValidProjectId = (projectId: string): boolean => {\n return projectId !== '' && projectId.length > 0 && /^[a-zA-Z][\\w-]*[a-zA-Z0-9]$/.test(projectId);\n};\n\n/**\n * Get the localized config object from a custom config\n *\n * @param config String or json object of the custom config\n * @param language Specific language\n * @returns Localized custom config object\n */\nexport const getLocalizedCustomConfig = (\n config: string | ICustomConfig,\n language: string,\n): ILocalizedCustomConfig | undefined => {\n let customConfig: ICustomConfig;\n try {\n customConfig = typeof config === 'string' ? JSON.parse(config) : config;\n } catch (error) {\n throw new Error(\n `Internet Header: Custom config is invalid. Make sure your custom config contains valid JSON syntax and matches the definition. `,\n );\n }\n let localizedCustomConfig: ILocalizedCustomConfig | undefined = customConfig[language];\n if (localizedCustomConfig?.header?.navMain)\n setMainNavigationIds(localizedCustomConfig.header.navMain);\n return localizedCustomConfig;\n};\n\n/**\n * Check if mobile header styles are applied or not\n * @returns True if browser is smaller than 1024px\n */\nexport const isMobile = () => window.innerWidth < 1024;\n\n/**\n * Set unique ID's on main navigation entities but conserve flyout_os to be able to\n * identify the online-service flyout, which can be configured by osFlyoutOverrides\n */\nexport const setMainNavigationIds = (navMainEntities: NavMainEntity[]): void => {\n navMainEntities.forEach(navMainEntity => {\n navMainEntity.id = navMainEntity.id === 'flyout_os' ? navMainEntity.id : uniqueId('main-nav-');\n });\n};\n","@use '@swisspost/design-system-styles/variables/color';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n\n:host {\n display: block;\n position: relative;\n font-size: 1rem;\n font-weight: 300;\n z-index: var(--header-z-index, 10);\n\n --header-height: 3.5rem; // 56px\n --meta-header-height: 0px; // Not visible on mobile\n --language-dropdown-margin-top: 0px;\n\n @include mixins.min(lg) {\n --meta-header-height: 3rem; // 48px\n --header-height: 4rem; // 64px\n }\n\n @include mixins.min(xl) {\n --header-height: 4.5rem; // 72px\n }\n}\n\n// Set height to 0 if meta is never visible\n:host([meta='false']) {\n --meta-header-height: 0px;\n // Compensation for header border-bottom, when language dropdown is displayed within main navigation controls\n --language-dropdown-margin-top: 1px;\n}\n\n// Support different kinds of stickyness modes\n// Works only in combination with setting header heights dynamically\n@supports (position: sticky) {\n // If stickyness is none, simply apply no styles, all others are sticky\n :host(:not(.stickyness-none)) {\n position: sticky;\n }\n\n // Everything is always sticky\n :host(.stickyness-full) {\n top: 0;\n }\n\n // Only main nav is sticky\n :host(.stickyness-main) {\n top: calc(var(--meta-header-height, 0px) * -1);\n }\n\n // Hide everything\n :host(.stickyness-minimal) {\n top: calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px) * -1);\n transition: top 200ms ease-in;\n }\n\n // Show main when scrolling up or any of the menus are open\n :host(.stickyness-minimal.scrolling-up),\n :host(.stickyness-minimal.dropdown-open) {\n top: calc(var(--meta-header-height, 0px) * -1);\n transition: top 200ms ease-out;\n }\n}\n\n.post-internet-header {\n border-bottom: 1px solid color.$gray-10;\n background-color: white;\n}\n\n.main-navigation-container {\n display: flex;\n\n & > .main-navigation-controls {\n flex: 0 0 auto;\n }\n}\n\n.main-navigation {\n display: flex;\n}\n\n.sub-navigation-container {\n position: absolute;\n top: 100%;\n left: 0;\n width: 100%;\n display: flex;\n background: white;\n visibility: hidden;\n}\n\n.main-navigation-item:hover .sub-navigation-container {\n visibility: visible;\n}\n\n.main-navigation-controls {\n display: flex;\n margin-left: auto;\n\n @include mixins.max(lg) {\n font-weight: 400;\n }\n\n @include mixins.min(lg) {\n font-size: 1.0625rem;\n }\n\n & > * {\n border-left: 1px solid color.$gray-10;\n }\n}\n\n.menu-button {\n display: flex;\n align-items: center;\n padding: 0 calc(1rem - 1px);\n font-weight: 300;\n cursor: pointer;\n border-left: 1px solid color.$gray-10;\n order: 1; /* Display on the far right because of tab order */\n\n @include mixins.min(lg) {\n display: none;\n }\n\n .visually-hidden {\n @include mixins.between(rg, lg) {\n @include mixins.reset-visually-hidden();\n\n margin-right: 0.5rem;\n }\n }\n\n svg {\n width: 1.5rem;\n height: 1.5rem;\n }\n}\n\n.full-width {\n .wide-container {\n max-width: none;\n }\n}\n","import {\n Component,\n Host,\n Element,\n h,\n State,\n Prop,\n Watch,\n Listen,\n EventEmitter,\n Event,\n Method,\n} from '@stencil/core';\nimport { debounce, throttle } from 'throttle-debounce';\nimport {\n getLocalizedConfig,\n getLocalizedCustomConfig,\n isValidProjectId,\n} from '../../services/config.service';\nimport { state, dispose } from '../../data/store';\nimport { DropdownElement, DropdownEvent, NavMainEntity } from '../../models/header.model';\nimport { SvgSprite } from '../../utils/svg-sprite.component';\nimport { SvgIcon } from '../../utils/svg-icon.component';\nimport { StickynessOptions } from '../../models/implementor.model';\nimport { ActiveRouteProp, Environment, ICustomConfig } from '../../models/general.model';\nimport { IAvailableLanguage } from '../../models/language.model';\nimport { translate } from '../../services/language.service';\nimport { If } from '../../utils/if.component';\nimport packageJson from '../../../package.json';\n\n@Component({\n tag: 'swisspost-internet-header',\n styleUrl: 'post-internet-header.scss',\n shadow: true,\n})\nexport class PostInternetHeader {\n /**\n * Your project id, previously passed as query string parameter serviceId.\n */\n @Prop() project: string;\n\n /**\n * Sticky behaviour of the header.\n */\n @Prop() stickyness: StickynessOptions = 'minimal';\n\n /**\n * Initial language to be used. Overrides automatic language detection.\n */\n @Prop() language?: string;\n\n /**\n * Toggle the meta navigation.\n */\n @Prop() meta: boolean = true;\n\n /**\n * Toggle the login link (when logged out) or the user widget (when logged in).\n */\n @Prop() login: boolean = true;\n\n /**\n * Toggle the search button.\n */\n @Prop() search: boolean = true;\n\n /**\n * Toggle skiplinks. They help keyboard users to quickly jump to important sections of the page.\n */\n @Prop() skiplinks: boolean = true;\n\n /**\n * DEPRECATED!: Define a proxy URL for the config fetch request. Will be removed in the next major version\n */\n @Prop() configProxy?: string;\n\n /**\n * Target environment. Choose 'int01' for local testing.\n */\n @Prop() environment: Environment = 'prod';\n\n /**\n * Override the language switch links with custom URLs. Helpful when your application contains sub-pages and you\n * would like to stay on subpages when the user changes language.\n */\n @Prop() languageSwitchOverrides?: string | IAvailableLanguage[];\n\n /**\n * Customize the header config loaded from the post portal.\n */\n @Prop() customConfig?: string | ICustomConfig;\n\n /**\n * The header uses this cookie to set the language. Disables automatic language detection.\n */\n @Prop() languageCookieKey?: string;\n\n /**\n * The header uses this local storage key to set the language. Disables automatic language selection.\n */\n @Prop() languageLocalStorageKey?: string = 'swisspost-internet-header-language';\n\n /**\n * Set the currently activated route. If there is a link matching this URL in the header, it will be highlighted.\n * Will also highlight partly matching URLs. When set to auto, will use current location.href for comparison.\n */\n @Prop() activeRoute?: 'auto' | false | string = 'auto';\n\n /**\n * Online Services only: Add custom links to the special online service navigation entry\n */\n @Prop() osFlyoutOverrides?: string | NavMainEntity;\n\n /**\n * Displays the header at full width for full-screen applications\n */\n @Prop() fullWidth?: boolean = false;\n\n /**\n * Fires when the header has been rendered to the page.\n */\n @Event() headerLoaded: EventEmitter<void>;\n\n @State() activeFlyout: string | null = null;\n @State() activeDropdownElement: DropdownElement | null = null;\n @Element() host: HTMLElement;\n\n /**\n * Get the currently set language as a two letter string (\"de\", \"fr\" \"it\" or \"en\")\n * @returns string\n */\n @Method()\n async getCurrentLanguage(): Promise<'de' | 'fr' | 'it' | 'en' | string> {\n return state.currentLanguage ?? 'de';\n }\n\n private mainNav?: HTMLPostMainNavigationElement;\n private lastScrollTop = window.scrollY || document.documentElement.scrollTop;\n private throttledScroll: throttle<() => void>;\n private debouncedResize: debounce<() => void>;\n private lastWindowWidth: number = window.innerWidth;\n\n constructor() {\n if (this.project === undefined || this.project === '' || !isValidProjectId(this.project)) {\n throw new Error(\n `Internet Header project key is \"${this.project}\". Please provide a valid project key.`,\n );\n }\n }\n\n connectedCallback() {\n this.throttledScroll = throttle(300, () => this.handleScrollEvent());\n this.debouncedResize = debounce(200, () => this.handleResize());\n window.addEventListener('scroll', this.throttledScroll, { passive: true });\n window.addEventListener('resize', this.debouncedResize, { passive: true });\n }\n\n disconnectedCallback() {\n window.removeEventListener('scroll', this.throttledScroll);\n window.removeEventListener('resize', this.debouncedResize);\n\n // Reset the store to its original state\n dispose();\n }\n\n async componentWillLoad() {\n // Wait for the config to arrive, then render the header\n try {\n state.projectId = this.project;\n state.environment = this.environment;\n if (this.language !== undefined) state.currentLanguage = this.language;\n state.languageSwitchOverrides =\n typeof this.languageSwitchOverrides === 'string'\n ? JSON.parse(this.languageSwitchOverrides)\n : this.languageSwitchOverrides;\n state.osFlyoutOverrides =\n typeof this.osFlyoutOverrides === 'string'\n ? JSON.parse(this.osFlyoutOverrides)\n : this.osFlyoutOverrides;\n\n if (this.customConfig !== undefined && state.currentLanguage !== null) {\n state.localizedCustomConfig = getLocalizedCustomConfig(\n this.customConfig,\n state.currentLanguage,\n );\n }\n\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n } catch (error) {\n console.error(error);\n }\n }\n\n componentDidLoad() {\n window.requestAnimationFrame(() => {\n this.handleResize();\n this.headerLoaded.emit();\n this.host.classList.add('header-loaded');\n });\n }\n\n @Watch('language')\n async handleLanguageChange(newValue: string) {\n state.currentLanguage = newValue;\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: newValue,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n if (this.customConfig)\n state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, newValue);\n }\n\n @Watch('languageSwitchOverrides')\n handleAvailableLanguagesChage(newValue: string | IAvailableLanguage[]) {\n state.languageSwitchOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;\n }\n\n @Watch('osFlyoutOverrides')\n async handleOsFlyoutOverrides(newValue: string | NavMainEntity) {\n state.osFlyoutOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n }\n\n @Watch('activeRoute')\n async handleActiveRouteChange(newValue: string | ActiveRouteProp) {\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: newValue,\n localizedCustomConfig: state.localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n }\n\n @Watch('customConfig')\n async handleCustomConfigChange(newValue: string | ICustomConfig) {\n if (this.language === undefined) return;\n const localizedCustomConfig = getLocalizedCustomConfig(newValue, this.language);\n state.localizedCustomConfig = localizedCustomConfig;\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: this.environment,\n language: this.language,\n cookieKey: this.languageCookieKey,\n localStorageKey: this.languageLocalStorageKey,\n activeRouteProp: this.activeRoute,\n localizedCustomConfig: localizedCustomConfig,\n osFlyoutOverrides: state.osFlyoutOverrides,\n });\n }\n\n @Watch('search')\n handleSearchChange(newValue: boolean) {\n state.search = newValue;\n }\n\n @Watch('login')\n handleLoginChange(newValue: boolean) {\n state.login = newValue;\n }\n\n @Watch('meta')\n handleMetaChange(newValue: boolean) {\n state.meta = newValue;\n }\n\n @Listen('languageChanged')\n handleLanguageChangeEvent(event: CustomEvent<string>) {\n this.handleLanguageChange(event.detail);\n }\n\n private handleClickOutsideBound = this.handleClickOutside.bind(this);\n\n private handleClickOutside(event: Event) {\n // Close active dropdown element on click outside of it\n if (this.activeDropdownElement && !event.composedPath().includes(this.activeDropdownElement)) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n }\n\n private handleKeyUp(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n if (this.activeDropdownElement) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n if (this.activeFlyout !== null && this.mainNav) {\n this.mainNav.toggleDropdown(false);\n }\n }\n }\n\n private handleScrollEvent() {\n // Credits: \"https://github.com/qeremy/so/blob/master/so.dom.js#L426\"\n const st = window.scrollY || document.documentElement.scrollTop;\n\n // Toggle class without re-rendering the component if stickyness is minimal\n // the other stickyness modes do not need the class\n if (this.stickyness === 'minimal') {\n this.host.classList.toggle('scrolling-up', st <= this.lastScrollTop);\n }\n\n // For Mobile or negative scrolling\n this.lastScrollTop = st <= 0 ? 0 : st;\n }\n\n private handleResize() {\n // Close main navigation dropdown if size changed to bigger than 1024px (search dropdown will be kept open)\n if (this.isMainNavOpen() && this.lastWindowWidth < 1024 && window.innerWidth >= 1024) {\n this.activeDropdownElement?.toggleDropdown(false);\n }\n\n this.lastWindowWidth = window.innerWidth;\n }\n\n /**\n * Close open dropdown menus if another is being opened\n *\n * @param event Dropdown toggled event\n * @returns void\n */\n private handleDropdownToggled(event: CustomEvent<DropdownEvent>) {\n if (!event.detail.open && this.activeDropdownElement !== event.detail.element) {\n // Some dropdown got closed programmatically (possibly by this function). To prevent\n // a circle or an outdated state, we'll not handle this event\n return;\n }\n\n if (event.detail.open === true) {\n if (this.activeDropdownElement) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n\n this.activeDropdownElement = event.detail.element;\n\n if (window.innerWidth >= 1024) {\n // Add event listener to close active dropdown element on click outsite of it\n // Also adds 10ms delay in case of an external interaction:\n // Some button on the page calls toggleDropdown() -> dropdown opens\n // Click event bubbles to the window, this.handleClickOutsideBound closes dropdown again\n window.setTimeout(() => {\n window.addEventListener('click', this.handleClickOutsideBound);\n }, 10);\n }\n\n if (this.activeFlyout !== null && this.mainNav) {\n this.mainNav.setActiveFlyout(null);\n }\n } else {\n this.activeDropdownElement = null;\n\n // Remove event listener as it is not needed if no dropdown element is active\n window.removeEventListener('click', this.handleClickOutsideBound);\n }\n }\n\n /**\n * Close open dropdowns if the flyout is being opened\n * @param event Flyout toggle event\n */\n private handleFlyoutToggled(event: CustomEvent<string | null>) {\n this.activeFlyout = event.detail;\n\n if (this.activeDropdownElement && event.detail && !this.isMainNavOpen()) {\n this.activeDropdownElement.toggleDropdown(false);\n }\n }\n\n private toggleMobileDropdown() {\n this.mainNav?.toggleDropdown();\n }\n\n private isMainNavOpen() {\n return (\n this.activeDropdownElement && this.activeDropdownElement.tagName === 'POST-MAIN-NAVIGATION'\n );\n }\n\n render() {\n if (!state.localizedConfig?.header) {\n console.error(new Error('Internet Header: Config cannot be loaded'));\n return;\n }\n\n const config = state.localizedConfig;\n const renderMetaNavigation =\n this.meta &&\n config.header.navMeta !== undefined &&\n config.header.navMeta?.filter(meta => !meta.isHomeLink).length > 0;\n const renderLogin =\n (this.login ?? !config.header.isLoginWidgetHidden) && config.header.loginWidgetOptions;\n const renderLanguageSwitch = config.header.navLang.length > 1;\n\n return (\n <Host\n class={`stickyness-${this.stickyness} ${\n this.activeDropdownElement || this.activeFlyout ? 'dropdown-open' : ''\n }`}\n data-version={packageJson.version}\n onKeyup={(e: KeyboardEvent) => this.handleKeyUp(e)}\n >\n <header class={`post-internet-header${this.fullWidth ? ' full-width' : ''}`}>\n <SvgSprite />\n <h1 class=\"visually-hidden\">{translate('Navigate on post.ch')}</h1>\n <If condition={this.skiplinks === true}>\n <post-skiplinks></post-skiplinks>\n </If>\n <If condition={renderMetaNavigation === true}>\n <post-meta-navigation\n orientation=\"horizontal\"\n class=\"hidden-lg\"\n full-width={this.fullWidth}\n >\n <If condition={renderLanguageSwitch === true}>\n <post-language-switch\n id=\"post-language-switch-desktop\"\n mode=\"dropdown\"\n onDropdownToggled={e => this.handleDropdownToggled(e)}\n ></post-language-switch>\n </If>\n </post-meta-navigation>\n </If>\n <div class=\"main-navigation-container wide-container\">\n <post-logo></post-logo>\n <button\n class=\"menu-button nav-link\"\n onClick={() => this.toggleMobileDropdown()}\n aria-haspopup=\"menu\"\n aria-controls=\"post-internet-header-main-navigation\"\n aria-expanded={this.activeDropdownElement ? 'true' : 'false'}\n >\n <span class=\"menu-button-text visually-hidden\">{config.header.mobileMenu.text}</span>\n <SvgIcon name={this.isMainNavOpen() ? 'pi-close' : 'pi-menu'}></SvgIcon>\n </button>\n <post-main-navigation\n onDropdownToggled={e => this.handleDropdownToggled(e)}\n onFlyoutToggled={e => this.handleFlyoutToggled(e)}\n ref={el => (this.mainNav = el)}\n >\n <If condition={renderMetaNavigation === true}>\n <post-meta-navigation orientation=\"vertical\">\n <If condition={renderLanguageSwitch === true}>\n <post-language-switch\n id=\"post-language-switch-mobile\"\n mode=\"list\"\n ></post-language-switch>\n </If>\n </post-meta-navigation>\n </If>\n </post-main-navigation>\n <div class=\"main-navigation-controls\">\n <If condition={this.search !== false}>\n <post-search onDropdownToggled={e => this.handleDropdownToggled(e)}></post-search>\n </If>\n <If condition={!!renderLogin}>\n <post-klp-login-widget>\n <slot name=\"login-widget\"></slot>\n </post-klp-login-widget>\n </If>\n <If condition={renderMetaNavigation === false && renderLanguageSwitch === true}>\n <post-language-switch\n id=\"post-language-switch-no-meta\"\n onDropdownToggled={e => this.handleDropdownToggled(e)}\n mode=\"dropdown\"\n ></post-language-switch>\n </If>\n <slot name=\"main\"></slot>\n </div>\n </div>\n </header>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1243,7 +1243,7 @@ const vertx = window.vertx || {};
1243
1243
  '</li>';
1244
1244
  }
1245
1245
  return (
1246
- '<div class="klp-widget-authenticated-menu" id="authenticated-menu" data-dropdown-toggler="klp-widget__user">' +
1246
+ '<div class="klp-widget-authenticated-menu" id="authenticated-menu" data-dropdown-toggler="klp-widget__user" style="display: none">' +
1247
1247
  '<ul>' +
1248
1248
  menuList +
1249
1249
  changeCompanyEntry +
@@ -1510,7 +1510,6 @@ const vertx = window.vertx || {};
1510
1510
  }
1511
1511
  document.dispatchEvent(new CustomEvent('wepploginwidget_widget_ready'));
1512
1512
  measureWidgetShowsUp();
1513
- selectFromShadowDom().find('.klp-widget-authenticated-session-link').click();
1514
1513
  }
1515
1514
 
1516
1515
  function init() {
@@ -2099,18 +2099,39 @@
2099
2099
  font-weight: 700;
2100
2100
  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");
2101
2101
  }
2102
+ @font-face {
2103
+ font-display: swap;
2104
+ font-family: "Frutiger Neue For Post";
2105
+ font-weight: 700;
2106
+ font-style: italic;
2107
+ 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");
2108
+ }
2102
2109
  @font-face {
2103
2110
  font-display: swap;
2104
2111
  font-family: "Frutiger Neue For Post";
2105
2112
  font-weight: 400;
2106
2113
  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");
2107
2114
  }
2115
+ @font-face {
2116
+ font-display: swap;
2117
+ font-family: "Frutiger Neue For Post";
2118
+ font-weight: 400;
2119
+ font-style: italic;
2120
+ 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");
2121
+ }
2108
2122
  @font-face {
2109
2123
  font-display: swap;
2110
2124
  font-family: "Frutiger Neue For Post";
2111
2125
  font-weight: 300;
2112
2126
  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");
2113
2127
  }
2128
+ @font-face {
2129
+ font-display: swap;
2130
+ font-family: "Frutiger Neue For Post";
2131
+ font-weight: 300;
2132
+ font-style: italic;
2133
+ 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");
2134
+ }
2114
2135
  .visually-hidden {
2115
2136
  position: absolute;
2116
2137
  width: 1px;
@@ -1908,18 +1908,39 @@
1908
1908
  font-weight: 700;
1909
1909
  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");
1910
1910
  }
1911
+ @font-face {
1912
+ font-display: swap;
1913
+ font-family: "Frutiger Neue For Post";
1914
+ font-weight: 700;
1915
+ font-style: italic;
1916
+ 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");
1917
+ }
1911
1918
  @font-face {
1912
1919
  font-display: swap;
1913
1920
  font-family: "Frutiger Neue For Post";
1914
1921
  font-weight: 400;
1915
1922
  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");
1916
1923
  }
1924
+ @font-face {
1925
+ font-display: swap;
1926
+ font-family: "Frutiger Neue For Post";
1927
+ font-weight: 400;
1928
+ font-style: italic;
1929
+ 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");
1930
+ }
1917
1931
  @font-face {
1918
1932
  font-display: swap;
1919
1933
  font-family: "Frutiger Neue For Post";
1920
1934
  font-weight: 300;
1921
1935
  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");
1922
1936
  }
1937
+ @font-face {
1938
+ font-display: swap;
1939
+ font-family: "Frutiger Neue For Post";
1940
+ font-weight: 300;
1941
+ font-style: italic;
1942
+ 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");
1943
+ }
1923
1944
  .visually-hidden {
1924
1945
  position: absolute;
1925
1946
  width: 1px;
@@ -11,18 +11,39 @@
11
11
  font-weight: 700;
12
12
  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");
13
13
  }
14
+ @font-face {
15
+ font-display: swap;
16
+ font-family: "Frutiger Neue For Post";
17
+ font-weight: 700;
18
+ font-style: italic;
19
+ 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");
20
+ }
14
21
  @font-face {
15
22
  font-display: swap;
16
23
  font-family: "Frutiger Neue For Post";
17
24
  font-weight: 400;
18
25
  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");
19
26
  }
27
+ @font-face {
28
+ font-display: swap;
29
+ font-family: "Frutiger Neue For Post";
30
+ font-weight: 400;
31
+ font-style: italic;
32
+ 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");
33
+ }
20
34
  @font-face {
21
35
  font-display: swap;
22
36
  font-family: "Frutiger Neue For Post";
23
37
  font-weight: 300;
24
38
  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");
25
39
  }
40
+ @font-face {
41
+ font-display: swap;
42
+ font-family: "Frutiger Neue For Post";
43
+ font-weight: 300;
44
+ font-style: italic;
45
+ 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");
46
+ }
26
47
  .visually-hidden {
27
48
  position: absolute;
28
49
  width: 1px;
@@ -266,7 +287,7 @@ svg {
266
287
  top: calc(var(--meta-header-height, 0px) * -1);
267
288
  }
268
289
  :host(.stickyness-minimal) {
269
- top: calc((var(--header-height, 0px) + var(--meta-header-height, 0px)) * -1);
290
+ top: calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px) * -1);
270
291
  transition: top 200ms ease-in;
271
292
  }
272
293
  :host(.stickyness-minimal.scrolling-up),
@@ -400,18 +400,39 @@
400
400
  font-weight: 700;
401
401
  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");
402
402
  }
403
+ @font-face {
404
+ font-display: swap;
405
+ font-family: "Frutiger Neue For Post";
406
+ font-weight: 700;
407
+ font-style: italic;
408
+ 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");
409
+ }
403
410
  @font-face {
404
411
  font-display: swap;
405
412
  font-family: "Frutiger Neue For Post";
406
413
  font-weight: 400;
407
414
  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");
408
415
  }
416
+ @font-face {
417
+ font-display: swap;
418
+ font-family: "Frutiger Neue For Post";
419
+ font-weight: 400;
420
+ font-style: italic;
421
+ 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");
422
+ }
409
423
  @font-face {
410
424
  font-display: swap;
411
425
  font-family: "Frutiger Neue For Post";
412
426
  font-weight: 300;
413
427
  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");
414
428
  }
429
+ @font-face {
430
+ font-display: swap;
431
+ font-family: "Frutiger Neue For Post";
432
+ font-weight: 300;
433
+ font-style: italic;
434
+ 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");
435
+ }
415
436
  .visually-hidden, .klp-widget-anonymous__text {
416
437
  position: absolute;
417
438
  width: 1px;
@@ -11,18 +11,39 @@
11
11
  font-weight: 700;
12
12
  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");
13
13
  }
14
+ @font-face {
15
+ font-display: swap;
16
+ font-family: "Frutiger Neue For Post";
17
+ font-weight: 700;
18
+ font-style: italic;
19
+ 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");
20
+ }
14
21
  @font-face {
15
22
  font-display: swap;
16
23
  font-family: "Frutiger Neue For Post";
17
24
  font-weight: 400;
18
25
  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");
19
26
  }
27
+ @font-face {
28
+ font-display: swap;
29
+ font-family: "Frutiger Neue For Post";
30
+ font-weight: 400;
31
+ font-style: italic;
32
+ 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");
33
+ }
20
34
  @font-face {
21
35
  font-display: swap;
22
36
  font-family: "Frutiger Neue For Post";
23
37
  font-weight: 300;
24
38
  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");
25
39
  }
40
+ @font-face {
41
+ font-display: swap;
42
+ font-family: "Frutiger Neue For Post";
43
+ font-weight: 300;
44
+ font-style: italic;
45
+ 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");
46
+ }
26
47
  .visually-hidden {
27
48
  position: absolute;
28
49
  width: 1px;
@@ -11,18 +11,39 @@
11
11
  font-weight: 700;
12
12
  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");
13
13
  }
14
+ @font-face {
15
+ font-display: swap;
16
+ font-family: "Frutiger Neue For Post";
17
+ font-weight: 700;
18
+ font-style: italic;
19
+ 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");
20
+ }
14
21
  @font-face {
15
22
  font-display: swap;
16
23
  font-family: "Frutiger Neue For Post";
17
24
  font-weight: 400;
18
25
  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");
19
26
  }
27
+ @font-face {
28
+ font-display: swap;
29
+ font-family: "Frutiger Neue For Post";
30
+ font-weight: 400;
31
+ font-style: italic;
32
+ 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");
33
+ }
20
34
  @font-face {
21
35
  font-display: swap;
22
36
  font-family: "Frutiger Neue For Post";
23
37
  font-weight: 300;
24
38
  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");
25
39
  }
40
+ @font-face {
41
+ font-display: swap;
42
+ font-family: "Frutiger Neue For Post";
43
+ font-weight: 300;
44
+ font-style: italic;
45
+ 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");
46
+ }
26
47
  .visually-hidden {
27
48
  position: absolute;
28
49
  width: 1px;
@@ -61,18 +61,39 @@
61
61
  font-weight: 700;
62
62
  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");
63
63
  }
64
+ @font-face {
65
+ font-display: swap;
66
+ font-family: "Frutiger Neue For Post";
67
+ font-weight: 700;
68
+ font-style: italic;
69
+ 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");
70
+ }
64
71
  @font-face {
65
72
  font-display: swap;
66
73
  font-family: "Frutiger Neue For Post";
67
74
  font-weight: 400;
68
75
  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");
69
76
  }
77
+ @font-face {
78
+ font-display: swap;
79
+ font-family: "Frutiger Neue For Post";
80
+ font-weight: 400;
81
+ font-style: italic;
82
+ 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");
83
+ }
70
84
  @font-face {
71
85
  font-display: swap;
72
86
  font-family: "Frutiger Neue For Post";
73
87
  font-weight: 300;
74
88
  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");
75
89
  }
90
+ @font-face {
91
+ font-display: swap;
92
+ font-family: "Frutiger Neue For Post";
93
+ font-weight: 300;
94
+ font-style: italic;
95
+ 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");
96
+ }
76
97
  .visually-hidden {
77
98
  position: absolute;
78
99
  width: 1px;