@swisspost/internet-header 1.9.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{language.service-9334ca5d.js → language.service-0864d021.js} +7 -2
- package/dist/cjs/language.service-0864d021.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/post-klp-login-widget.cjs.entry.js +1 -1
- package/dist/cjs/post-klp-login-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/post-language-switch.cjs.entry.js +2 -2
- package/dist/cjs/post-language-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/post-logo.cjs.entry.js +1 -1
- package/dist/cjs/post-logo.cjs.entry.js.map +1 -1
- package/dist/cjs/post-main-navigation.cjs.entry.js +2 -2
- package/dist/cjs/post-main-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/post-meta-navigation.cjs.entry.js +1 -1
- package/dist/cjs/post-meta-navigation.cjs.entry.js.map +1 -1
- package/dist/cjs/post-search.cjs.entry.js +25 -2
- package/dist/cjs/post-search.cjs.entry.js.map +1 -1
- package/dist/cjs/post-skiplinks.cjs.entry.js +2 -2
- package/dist/cjs/post-skiplinks.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js +1329 -8
- package/dist/cjs/swisspost-internet-breadcrumbs.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js +2 -2
- package/dist/cjs/swisspost-internet-footer.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.entry.js +67 -37
- package/dist/cjs/swisspost-internet-header.cjs.entry.js.map +1 -1
- package/dist/cjs/swisspost-internet-header.cjs.js +1 -1
- package/dist/collection/assets/i18n/translations.js +5 -0
- package/dist/collection/assets/i18n/translations.js.map +1 -1
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.css +2 -2480
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.js +77 -7
- package/dist/collection/components/post-internet-breadcrumbs/post-internet-breadcrumbs.js.map +1 -1
- package/dist/collection/components/post-internet-footer/post-internet-footer.css +1 -2300
- package/dist/collection/components/post-internet-header/logo-animation/logo-animation.js +6 -3
- package/dist/collection/components/post-internet-header/logo-animation/logo-animation.js.map +1 -1
- package/dist/collection/components/post-internet-header/post-internet-header.css +1 -403
- package/dist/collection/components/post-internet-header/post-internet-header.js +33 -26
- package/dist/collection/components/post-internet-header/post-internet-header.js.map +1 -1
- package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.css +2 -1447
- package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.js +1 -1
- package/dist/collection/components/post-klp-login-widget/post-klp-login-widget.js.map +1 -1
- package/dist/collection/components/post-language-switch/post-language-switch.css +1 -370
- package/dist/collection/components/post-language-switch/post-language-switch.js +2 -2
- package/dist/collection/components/post-language-switch/post-language-switch.js.map +1 -1
- package/dist/collection/components/post-logo/post-logo.css +1 -265
- package/dist/collection/components/post-main-navigation/post-main-navigation.css +1 -637
- package/dist/collection/components/post-main-navigation/post-main-navigation.js +1 -1
- package/dist/collection/components/post-main-navigation/post-main-navigation.js.map +1 -1
- package/dist/collection/components/post-meta-navigation/post-meta-navigation.css +1 -345
- package/dist/collection/components/post-search/post-search.css +4 -2927
- package/dist/collection/components/post-search/post-search.js +28 -5
- package/dist/collection/components/post-search/post-search.js.map +1 -1
- package/dist/collection/components/post-skiplinks/post-skiplinks.css +1 -21
- package/dist/collection/components/post-skiplinks/post-skiplinks.js +1 -1
- package/dist/collection/components/post-skiplinks/post-skiplinks.js.map +1 -1
- package/dist/collection/services/language.service.js +1 -1
- package/dist/collection/services/language.service.js.map +1 -1
- package/dist/collection/utils/scrollparent.js +21 -0
- package/dist/collection/utils/scrollparent.js.map +1 -0
- package/dist/components/language.service.js +6 -1
- package/dist/components/language.service.js.map +1 -1
- package/dist/components/post-klp-login-widget2.js +1 -1
- package/dist/components/post-klp-login-widget2.js.map +1 -1
- package/dist/components/post-language-switch2.js +1 -1
- package/dist/components/post-language-switch2.js.map +1 -1
- package/dist/components/post-logo2.js +1 -1
- package/dist/components/post-logo2.js.map +1 -1
- package/dist/components/post-main-navigation2.js +1 -1
- package/dist/components/post-main-navigation2.js.map +1 -1
- package/dist/components/post-meta-navigation2.js +1 -1
- package/dist/components/post-meta-navigation2.js.map +1 -1
- package/dist/components/post-search2.js +25 -2
- package/dist/components/post-search2.js.map +1 -1
- package/dist/components/post-skiplinks2.js +1 -1
- package/dist/components/post-skiplinks2.js.map +1 -1
- package/dist/components/swisspost-internet-breadcrumbs.js +1331 -8
- package/dist/components/swisspost-internet-breadcrumbs.js.map +1 -1
- package/dist/components/swisspost-internet-footer.js +1 -1
- package/dist/components/swisspost-internet-footer.js.map +1 -1
- package/dist/components/swisspost-internet-header.js +68 -38
- package/dist/components/swisspost-internet-header.js.map +1 -1
- package/dist/docs.json +51 -4
- package/dist/esm/{language.service-bd0f3b6f.js → language.service-109c485e.js} +7 -2
- package/dist/esm/language.service-109c485e.js.map +1 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/post-klp-login-widget.entry.js +1 -1
- package/dist/esm/post-klp-login-widget.entry.js.map +1 -1
- package/dist/esm/post-language-switch.entry.js +2 -2
- package/dist/esm/post-language-switch.entry.js.map +1 -1
- package/dist/esm/post-logo.entry.js +1 -1
- package/dist/esm/post-logo.entry.js.map +1 -1
- package/dist/esm/post-main-navigation.entry.js +2 -2
- package/dist/esm/post-main-navigation.entry.js.map +1 -1
- package/dist/esm/post-meta-navigation.entry.js +1 -1
- package/dist/esm/post-meta-navigation.entry.js.map +1 -1
- package/dist/esm/post-search.entry.js +25 -2
- package/dist/esm/post-search.entry.js.map +1 -1
- package/dist/esm/post-skiplinks.entry.js +2 -2
- package/dist/esm/post-skiplinks.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-breadcrumbs.entry.js +1329 -8
- package/dist/esm/swisspost-internet-breadcrumbs.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-footer.entry.js +2 -2
- package/dist/esm/swisspost-internet-footer.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-header.entry.js +67 -37
- package/dist/esm/swisspost-internet-header.entry.js.map +1 -1
- package/dist/esm/swisspost-internet-header.js +1 -1
- package/dist/esm-es5/language.service-109c485e.js +2 -0
- package/dist/esm-es5/language.service-109c485e.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/post-klp-login-widget.entry.js +1 -1
- package/dist/esm-es5/post-klp-login-widget.entry.js.map +1 -1
- package/dist/esm-es5/post-language-switch.entry.js +1 -1
- package/dist/esm-es5/post-language-switch.entry.js.map +1 -1
- package/dist/esm-es5/post-logo.entry.js +1 -1
- package/dist/esm-es5/post-logo.entry.js.map +1 -1
- package/dist/esm-es5/post-main-navigation.entry.js +1 -1
- package/dist/esm-es5/post-main-navigation.entry.js.map +1 -1
- package/dist/esm-es5/post-meta-navigation.entry.js +1 -1
- package/dist/esm-es5/post-meta-navigation.entry.js.map +1 -1
- package/dist/esm-es5/post-search.entry.js +1 -1
- package/dist/esm-es5/post-search.entry.js.map +1 -1
- package/dist/esm-es5/post-skiplinks.entry.js +1 -1
- package/dist/esm-es5/post-skiplinks.entry.js.map +1 -1
- package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js +2 -2
- package/dist/esm-es5/swisspost-internet-breadcrumbs.entry.js.map +1 -1
- package/dist/esm-es5/swisspost-internet-footer.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-footer.entry.js.map +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.entry.js.map +1 -1
- package/dist/esm-es5/swisspost-internet-header.js +1 -1
- package/dist/esm-es5/swisspost-internet-header.js.map +1 -1
- package/dist/swisspost-internet-header/p-0216631b.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-e2df6e93.system.entry.js.map → p-0216631b.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-0352b702.system.entry.js +7 -0
- package/dist/swisspost-internet-header/p-0352b702.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-0e4299a3.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-6bb07a80.entry.js.map → p-0e4299a3.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-10bfe973.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-10bfe973.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-142627fa.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-9ab24fb3.entry.js.map → p-142627fa.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-194475b8.system.js +2 -0
- package/dist/swisspost-internet-header/p-194475b8.system.js.map +1 -0
- package/dist/swisspost-internet-header/p-1a526dc3.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-1a526dc3.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-28bcc0a1.entry.js +2 -0
- package/dist/swisspost-internet-header/p-28bcc0a1.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-312fcf55.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-fed8d74d.system.entry.js.map → p-312fcf55.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-334412b2.entry.js +2 -0
- package/dist/swisspost-internet-header/p-334412b2.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-334616bc.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-0bfadd54.system.entry.js.map → p-334616bc.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-37872478.entry.js +7 -0
- package/dist/swisspost-internet-header/p-37872478.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-4da084d9.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-273fd39b.entry.js.map → p-4da084d9.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-5d893017.system.js +1 -1
- package/dist/swisspost-internet-header/p-5d893017.system.js.map +1 -1
- package/dist/swisspost-internet-header/p-77426673.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-0dd2de97.entry.js.map → p-77426673.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-7ddfd160.entry.js +2 -0
- package/dist/swisspost-internet-header/p-7ddfd160.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-8120031d.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-3c8504b4.system.entry.js.map → p-8120031d.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-935c70e1.js +2 -0
- package/dist/swisspost-internet-header/p-935c70e1.js.map +1 -0
- package/dist/swisspost-internet-header/p-95a1384f.system.entry.js +2 -0
- package/dist/swisspost-internet-header/p-95a1384f.system.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-b5937320.entry.js +2 -0
- package/dist/swisspost-internet-header/p-b5937320.entry.js.map +1 -0
- package/dist/swisspost-internet-header/p-c291d766.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-131078ce.system.entry.js.map → p-c291d766.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-cfc4dbfd.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-51c15273.entry.js.map → p-cfc4dbfd.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/p-d4106bf6.system.entry.js +2 -0
- package/dist/swisspost-internet-header/{p-a366648c.system.entry.js.map → p-d4106bf6.system.entry.js.map} +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.css +2 -4
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js +1 -1
- package/dist/swisspost-internet-header/swisspost-internet-header.esm.js.map +1 -1
- package/dist/types/assets/i18n/translations.d.ts +5 -0
- package/dist/types/components/post-internet-breadcrumbs/post-internet-breadcrumbs.d.ts +13 -4
- package/dist/types/components/post-internet-header/post-internet-header.d.ts +4 -3
- package/dist/types/components/post-klp-login-widget/post-klp-login-widget.d.ts +1 -1
- package/dist/types/components/post-search/post-search.d.ts +6 -0
- package/dist/types/components/post-skiplinks/post-skiplinks.d.ts +1 -1
- package/dist/types/components.d.ts +19 -6
- package/dist/types/services/language.service.d.ts +7 -5
- package/dist/types/utils/scrollparent.d.ts +1 -0
- package/package.json +13 -12
- package/dist/cjs/language.service-9334ca5d.js.map +0 -1
- package/dist/esm/language.service-bd0f3b6f.js.map +0 -1
- package/dist/esm-es5/language.service-bd0f3b6f.js +0 -2
- package/dist/esm-es5/language.service-bd0f3b6f.js.map +0 -1
- package/dist/swisspost-internet-header/p-06d32a28.entry.js +0 -7
- package/dist/swisspost-internet-header/p-06d32a28.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-0bfadd54.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-0dd2de97.entry.js +0 -2
- package/dist/swisspost-internet-header/p-1078e964.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-1078e964.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-131078ce.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-262611f7.entry.js +0 -2
- package/dist/swisspost-internet-header/p-262611f7.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-273fd39b.entry.js +0 -2
- package/dist/swisspost-internet-header/p-3c8504b4.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-4099b274.system.js +0 -2
- package/dist/swisspost-internet-header/p-4099b274.system.js.map +0 -1
- package/dist/swisspost-internet-header/p-51c15273.entry.js +0 -2
- package/dist/swisspost-internet-header/p-5baac371.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-5baac371.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-64e1182b.entry.js +0 -2
- package/dist/swisspost-internet-header/p-64e1182b.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-6bb07a80.entry.js +0 -2
- package/dist/swisspost-internet-header/p-6f69aff4.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-6f69aff4.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-7bed0797.js +0 -2
- package/dist/swisspost-internet-header/p-7bed0797.js.map +0 -1
- package/dist/swisspost-internet-header/p-97c90e22.system.entry.js +0 -7
- package/dist/swisspost-internet-header/p-97c90e22.system.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-9ab24fb3.entry.js +0 -2
- package/dist/swisspost-internet-header/p-9ec1f474.entry.js +0 -2
- package/dist/swisspost-internet-header/p-9ec1f474.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-a366648c.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-e2df6e93.system.entry.js +0 -2
- package/dist/swisspost-internet-header/p-f531c1ea.entry.js +0 -2
- package/dist/swisspost-internet-header/p-f531c1ea.entry.js.map +0 -1
- package/dist/swisspost-internet-header/p-fed8d74d.system.entry.js +0 -2
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index$1 = require('./index-87874f19.js');
|
|
6
6
|
const index = require('./index-3216e4c8.js');
|
|
7
|
-
const language_service = require('./language.service-
|
|
7
|
+
const language_service = require('./language.service-0864d021.js');
|
|
8
8
|
const utils = require('./utils-60853c5d.js');
|
|
9
9
|
const store = require('./store-b99affc1.js');
|
|
10
10
|
const svgSprite_component = require('./svg-sprite.component-f1866070.js');
|
|
@@ -360,7 +360,7 @@ const setMainNavigationIds = (navMainEntities) => {
|
|
|
360
360
|
};
|
|
361
361
|
|
|
362
362
|
const name = "@swisspost/internet-header";
|
|
363
|
-
const version = "1.
|
|
363
|
+
const version = "1.11.0";
|
|
364
364
|
const description = "The header for client facing applications.";
|
|
365
365
|
const author = "Swiss Post <oss@post.ch>";
|
|
366
366
|
const license = "Apache-2.0";
|
|
@@ -403,28 +403,29 @@ const scripts = {
|
|
|
403
403
|
const dependencies = {
|
|
404
404
|
"@stencil/core": "3.4.2",
|
|
405
405
|
"@stencil/store": "2.0.9",
|
|
406
|
-
"@swisspost/design-system-styles": "workspace:6.4.
|
|
406
|
+
"@swisspost/design-system-styles": "workspace:6.4.2",
|
|
407
407
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
408
|
-
"iframe-resizer": "4.3.
|
|
408
|
+
"iframe-resizer": "4.3.7",
|
|
409
409
|
jquery: "3.7.1",
|
|
410
410
|
tabbable: "6.2.0",
|
|
411
411
|
"throttle-debounce": "5.0.0",
|
|
412
412
|
"url-polyfill": "1.1.12"
|
|
413
413
|
};
|
|
414
414
|
const devDependencies = {
|
|
415
|
-
"@babel/core": "7.22.
|
|
416
|
-
"@percy/cli": "1.
|
|
415
|
+
"@babel/core": "7.22.20",
|
|
416
|
+
"@percy/cli": "1.27.2",
|
|
417
417
|
"@percy/cypress": "3.1.2",
|
|
418
|
-
"@stencil/eslint-plugin": "0.
|
|
418
|
+
"@stencil-community/eslint-plugin": "0.5.0",
|
|
419
419
|
"@stencil/sass": "3.0.5",
|
|
420
|
+
"@types/body-scroll-lock": "3.1.0",
|
|
420
421
|
"@types/iframe-resizer": "3.5.9",
|
|
421
422
|
"@types/jest": "27.5.2",
|
|
422
|
-
"@types/jquery": "3.5.
|
|
423
|
-
"@types/node": "18.17.
|
|
423
|
+
"@types/jquery": "3.5.19",
|
|
424
|
+
"@types/node": "18.17.19",
|
|
424
425
|
"@types/throttle-debounce": "5.0.0",
|
|
425
426
|
"babel-loader": "9.1.3",
|
|
426
|
-
bootstrap: "5.3.
|
|
427
|
-
cypress: "
|
|
427
|
+
bootstrap: "5.3.2",
|
|
428
|
+
cypress: "13.2.0",
|
|
428
429
|
"cypress-each": "1.13.3",
|
|
429
430
|
"cypress-storybook": "0.5.1",
|
|
430
431
|
"eslint-plugin-react": "7.33.2",
|
|
@@ -434,8 +435,8 @@ const devDependencies = {
|
|
|
434
435
|
"rollup-plugin-node-polyfills": "0.2.1",
|
|
435
436
|
"rollup-plugin-scss": "4.0.0",
|
|
436
437
|
"rollup-plugin-visualizer": "5.9.2",
|
|
437
|
-
sass: "1.
|
|
438
|
-
"start-server-and-test": "2.0.
|
|
438
|
+
sass: "1.68.0",
|
|
439
|
+
"start-server-and-test": "2.0.1",
|
|
439
440
|
"ts-jest": "27.1.5",
|
|
440
441
|
typescript: "4.9.5"
|
|
441
442
|
};
|
|
@@ -464,7 +465,29 @@ const packageJson = {
|
|
|
464
465
|
devDependencies: devDependencies
|
|
465
466
|
};
|
|
466
467
|
|
|
468
|
+
const isScrollable = (node) => {
|
|
469
|
+
if (!(node instanceof HTMLElement || node instanceof SVGElement)) {
|
|
470
|
+
return false;
|
|
471
|
+
}
|
|
472
|
+
const style = getComputedStyle(node);
|
|
473
|
+
return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {
|
|
474
|
+
const value = style.getPropertyValue(propertyName);
|
|
475
|
+
return value === 'auto' || value === 'scroll';
|
|
476
|
+
});
|
|
477
|
+
};
|
|
478
|
+
const getScrollParent = (node) => {
|
|
479
|
+
let currentParent = node.parentElement;
|
|
480
|
+
while (currentParent) {
|
|
481
|
+
if (isScrollable(currentParent)) {
|
|
482
|
+
return currentParent;
|
|
483
|
+
}
|
|
484
|
+
currentParent = currentParent.parentElement;
|
|
485
|
+
}
|
|
486
|
+
return document;
|
|
487
|
+
};
|
|
488
|
+
|
|
467
489
|
const registerLogoAnimationObserver = (target, headerRef) => {
|
|
490
|
+
const scrollParent = getScrollParent(headerRef);
|
|
468
491
|
/**
|
|
469
492
|
* Set intersection ratio as CSS custom property
|
|
470
493
|
*/
|
|
@@ -473,7 +496,8 @@ const registerLogoAnimationObserver = (target, headerRef) => {
|
|
|
473
496
|
let scale = 1;
|
|
474
497
|
// Minus 1px border at the bottom that the logo is not covering
|
|
475
498
|
const adjustedHeaderHeight = headerRef.clientHeight - 1;
|
|
476
|
-
const
|
|
499
|
+
const scrollDistance = scrollParent instanceof Element ? scrollParent.scrollTop : scrollParent.documentElement.scrollTop;
|
|
500
|
+
const scrollY = fullStickyness ? 0 : scrollDistance;
|
|
477
501
|
// If meta navigation is not visible (mobile, not configured), scale should just be 1
|
|
478
502
|
if (target.clientHeight > 0) {
|
|
479
503
|
scale = Math.max((adjustedHeaderHeight - Math.max(scrollY, 0)) /
|
|
@@ -489,13 +513,13 @@ const registerLogoAnimationObserver = (target, headerRef) => {
|
|
|
489
513
|
const observer = new IntersectionObserver(entries => {
|
|
490
514
|
entries.forEach(entry => {
|
|
491
515
|
if (entry.isIntersecting && entry.intersectionRatio > 0) {
|
|
492
|
-
|
|
516
|
+
scrollParent.addEventListener('scroll', handleScroll, { passive: true });
|
|
493
517
|
window.addEventListener('resize', debounced);
|
|
494
518
|
// Ensure callback is called at least once in case main thread is too busy while scrolling up
|
|
495
519
|
window.requestAnimationFrame(handleScroll);
|
|
496
520
|
}
|
|
497
521
|
else {
|
|
498
|
-
|
|
522
|
+
scrollParent.removeEventListener('scroll', handleScroll);
|
|
499
523
|
window.removeEventListener('resize', debounced);
|
|
500
524
|
window.requestAnimationFrame(handleScroll);
|
|
501
525
|
}
|
|
@@ -508,7 +532,7 @@ const registerLogoAnimationObserver = (target, headerRef) => {
|
|
|
508
532
|
return handleScroll;
|
|
509
533
|
};
|
|
510
534
|
|
|
511
|
-
const postInternetHeaderCss = "@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:700;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff2\") format(\"woff2\"),
|
|
535
|
+
const postInternetHeaderCss = "@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:700;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Bold.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:700;font-style:italic;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-BdIt.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:400;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Rg.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:400;font-style:italic;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-It.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:300;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-Lt.woff\") format(\"woff\")}@font-face{font-display:swap;font-family:\"Frutiger Neue For Post\";font-weight:300;font-style:italic;src:url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff2\") format(\"woff2\"),url(\"https://fonts.post.ch/frutigerneueforpost/v2/FrutigerNeueforPostW05-LtIt.woff\") format(\"woff\")}.visually-hidden{position:absolute;width:1px;height:1px;border:0;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0)}.btn-blank{background-color:rgba(0,0,0,0);border:none;border-radius:0;padding:0}.nav-link{outline:none;outline-offset:2px;text-decoration:none;color:rgba(0,0,0,.8);-webkit-transition:color 200ms;transition:color 200ms;background-color:rgba(0,0,0,0);-webkit-box-shadow:none;box-shadow:none;border:0;margin:0;cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:.5rem}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color)}.nav-link:hover,.nav-link:focus{color:#000}.nav-link:is(:focus-visible,:focus-within,.pretend-focus){z-index:1;position:relative}.nav-link>svg{width:1.4em;height:1.4em;-ms-flex-negative:0;flex-shrink:0}.nav-link>span{-ms-flex-negative:1;flex-shrink:1}.no-list{list-style:none;padding-left:0;margin-top:0;margin-bottom:0}*,:host,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host{font-family:\"Frutiger Neue For Post\",system-ui,sans-serif}button{font:inherit;padding:0}a,button{border-radius:4px;outline:none;outline-offset:2px}a:is(:focus-visible,:focus-within,.pretend-focus),button:is(:focus-visible,:focus-within,.pretend-focus){outline:2px solid var(--post-contrast-color);border-radius:4px}img,svg{max-width:100%;max-height:100%}@media (forced-colors: active){svg{color:#fff}}.box>*:first-child{margin-top:0}.box>*:last-child{margin-bottom:0}.mirrored{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.bold{font-weight:700}.light{font-weight:300}.d-flex{display:-ms-flexbox;display:flex}.d-inline-flex{display:-ms-inline-flexbox;display:inline-flex}.align-items-center{-ms-flex-align:center;align-items:center}@media (min-width: 1441px){.wide-container{margin:0 auto;max-width:1440px}}@media (max-width: 599.98px){.container{padding-right:16px;padding-left:16px}}@media (min-width: 600px)and (max-width: 1023.98px){.container{padding-right:32px;padding-left:32px}}@media (min-width: 1024px){.container{padding-right:40px;padding-left:40px}}@media (max-width: -0.02px){.hidden-xs{display:none}}@media (max-width: 399.98px){.hidden-sm{display:none}}@media (max-width: 599.98px){.hidden-rg{display:none}}@media (max-width: 779.98px){.hidden-md{display:none}}@media (max-width: 1023.98px){.hidden-lg{display:none}}@media (max-width: 1279.98px){.hidden-xl{display:none}}@media (max-width: 1440.98px){.hidden-xxl{display:none}}:host{--logo-scale:1}@media (max-width: 1023.98px){:host{--logo-scale:1 !important}}post-logo{height:var(--header-height);-webkit-transform-origin:bottom left;transform-origin:bottom left;-webkit-transform:scale(var(--logo-scale));transform:scale(var(--logo-scale))}post-main-navigation{margin-left:calc(var(--header-height)*var(--logo-scale) - var(--header-height))}:host{display:block;position:relative;font-size:1rem;font-weight:300;z-index:var(--header-z-index, 10);--header-height:3.5rem;--meta-header-height:0px;--language-dropdown-margin-top:0px}@media (min-width: 1024px){:host{--meta-header-height:3rem;--header-height:4rem}}@media (min-width: 1280px){:host{--header-height:4.5rem}}:host([meta=false]){--meta-header-height:0px;--language-dropdown-margin-top:1px}@supports ((position: -webkit-sticky) or (position: sticky)){:host(:not(.stickyness-none)){position:-webkit-sticky;position:sticky}:host(.stickyness-full){top:0}:host(.stickyness-main){top:calc(var(--meta-header-height, 0px)*-1)}:host(.stickyness-minimal){top:calc((var(--header-height, 0px) + var(--meta-header-height, 0px) + 1px)*-1);-webkit-transition:top 200ms ease-in;transition:top 200ms ease-in}:host(.stickyness-minimal.scrolling-up),:host(.stickyness-minimal.dropdown-open){top:calc(var(--meta-header-height, 0px)*-1);-webkit-transition:top 200ms ease-out;transition:top 200ms ease-out}}.post-internet-header{border-bottom:1px solid #e6e6e6;background-color:#fff}.main-navigation-container{display:-ms-flexbox;display:flex}.main-navigation-container>.main-navigation-controls{-ms-flex:0 0 auto;flex:0 0 auto}.main-navigation{display:-ms-flexbox;display:flex}.sub-navigation-container{position:absolute;top:100%;left:0;width:100%;display:-ms-flexbox;display:flex;background:#fff;visibility:hidden}.main-navigation-item:hover .sub-navigation-container{visibility:visible}.main-navigation-controls{display:-ms-flexbox;display:flex;margin-left:auto}@media (max-width: 1023.98px){.main-navigation-controls{font-weight:400}}@media (min-width: 1024px){.main-navigation-controls{font-size:1.0625rem}}.main-navigation-controls>*{border-left:1px solid #e6e6e6}.menu-button{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 calc(1rem - 1px);font-weight:300;cursor:pointer;border-left:1px solid #e6e6e6;-ms-flex-order:1;order:1}@media (min-width: 1024px){.menu-button{display:none}}@media (min-width: 600px)and (max-width: 1023.98px){.menu-button .visually-hidden{position:static;width:auto;height:auto;margin:auto;overflow:visible;clip:auto;visibility:visible;margin-right:.5rem}}.menu-button svg{width:1.5rem;height:1.5rem}.full-width .wide-container{max-width:none}";
|
|
512
536
|
|
|
513
537
|
const PostInternetHeader = class {
|
|
514
538
|
/**
|
|
@@ -550,16 +574,17 @@ const PostInternetHeader = class {
|
|
|
550
574
|
connectedCallback() {
|
|
551
575
|
this.throttledScroll = index.throttle(300, () => this.handleScrollEvent());
|
|
552
576
|
this.debouncedResize = index.debounce(200, () => this.handleResize());
|
|
553
|
-
window.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
554
|
-
window.addEventListener('resize', this.debouncedResize, { passive: true });
|
|
555
577
|
}
|
|
556
578
|
disconnectedCallback() {
|
|
557
|
-
|
|
558
|
-
|
|
579
|
+
this.scrollParent.removeEventListener('scroll', this.throttledScroll);
|
|
580
|
+
this.scrollParent.removeEventListener('resize', this.debouncedResize);
|
|
559
581
|
// Reset the store to its original state
|
|
560
582
|
store.dispose();
|
|
561
583
|
}
|
|
562
584
|
async componentWillLoad() {
|
|
585
|
+
this.scrollParent = getScrollParent(this.host);
|
|
586
|
+
this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });
|
|
587
|
+
this.scrollParent.addEventListener('resize', this.debouncedResize, { passive: true });
|
|
563
588
|
// Wait for the config to arrive, then render the header
|
|
564
589
|
try {
|
|
565
590
|
store.state.projectId = this.project;
|
|
@@ -575,8 +600,10 @@ const PostInternetHeader = class {
|
|
|
575
600
|
typeof this.osFlyoutOverrides === 'string'
|
|
576
601
|
? JSON.parse(this.osFlyoutOverrides)
|
|
577
602
|
: this.osFlyoutOverrides;
|
|
578
|
-
if (this.customConfig !== undefined
|
|
579
|
-
|
|
603
|
+
if (this.customConfig !== undefined) {
|
|
604
|
+
const langs = Object.keys(typeof this.customConfig === 'string' ? JSON.parse(this.customConfig) : this.customConfig);
|
|
605
|
+
const lang = store.state.currentLanguage || language_service.getUserLang(langs, this.language);
|
|
606
|
+
store.state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, lang);
|
|
580
607
|
}
|
|
581
608
|
store.state.localizedConfig = await getLocalizedConfig({
|
|
582
609
|
projectId: this.project,
|
|
@@ -620,7 +647,7 @@ const PostInternetHeader = class {
|
|
|
620
647
|
if (this.customConfig)
|
|
621
648
|
store.state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, newValue);
|
|
622
649
|
}
|
|
623
|
-
|
|
650
|
+
handleAvailableLanguagesChange(newValue) {
|
|
624
651
|
store.state.languageSwitchOverrides = typeof newValue === 'string' ? JSON.parse(newValue) : newValue;
|
|
625
652
|
}
|
|
626
653
|
async handleOsFlyoutOverrides(newValue) {
|
|
@@ -674,31 +701,34 @@ const PostInternetHeader = class {
|
|
|
674
701
|
store.state.meta = newValue;
|
|
675
702
|
}
|
|
676
703
|
handleLanguageChangeEvent(event) {
|
|
677
|
-
this.handleLanguageChange(event.detail);
|
|
704
|
+
void this.handleLanguageChange(event.detail);
|
|
678
705
|
}
|
|
679
706
|
handleStickynessChange(newValue) {
|
|
680
707
|
store.state.stickyness = newValue;
|
|
681
|
-
this.updateLogoAnimation
|
|
708
|
+
if (typeof this.updateLogoAnimation === 'function')
|
|
709
|
+
this.updateLogoAnimation();
|
|
682
710
|
}
|
|
683
711
|
handleClickOutside(event) {
|
|
684
712
|
// Close active dropdown element on click outside of it
|
|
685
713
|
if (this.activeDropdownElement && !event.composedPath().includes(this.activeDropdownElement)) {
|
|
686
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
714
|
+
void this.activeDropdownElement.toggleDropdown(false);
|
|
687
715
|
}
|
|
688
716
|
}
|
|
689
717
|
handleKeyUp(event) {
|
|
690
718
|
if (event.key === 'Escape') {
|
|
691
719
|
if (this.activeDropdownElement) {
|
|
692
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
720
|
+
void this.activeDropdownElement.toggleDropdown(false);
|
|
693
721
|
}
|
|
694
722
|
if (this.activeFlyout !== null && this.mainNav) {
|
|
695
|
-
this.mainNav.toggleDropdown(false);
|
|
723
|
+
void this.mainNav.toggleDropdown(false);
|
|
696
724
|
}
|
|
697
725
|
}
|
|
698
726
|
}
|
|
699
727
|
handleScrollEvent() {
|
|
700
728
|
// Credits: "https://github.com/qeremy/so/blob/master/so.dom.js#L426"
|
|
701
|
-
const st =
|
|
729
|
+
const st = this.scrollParent instanceof Document
|
|
730
|
+
? this.scrollParent.documentElement.scrollTop
|
|
731
|
+
: this.scrollParent.scrollTop;
|
|
702
732
|
// Toggle class without re-rendering the component if stickyness is minimal
|
|
703
733
|
// the other stickyness modes do not need the class
|
|
704
734
|
if (this.stickyness === 'minimal') {
|
|
@@ -727,13 +757,13 @@ const PostInternetHeader = class {
|
|
|
727
757
|
// a circle or an outdated state, we'll not handle this event
|
|
728
758
|
return;
|
|
729
759
|
}
|
|
730
|
-
if (event.detail.open
|
|
760
|
+
if (event.detail.open) {
|
|
731
761
|
if (this.activeDropdownElement) {
|
|
732
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
762
|
+
void this.activeDropdownElement.toggleDropdown(false);
|
|
733
763
|
}
|
|
734
764
|
this.activeDropdownElement = event.detail.element;
|
|
735
765
|
if (window.innerWidth >= 1024) {
|
|
736
|
-
// Add event listener to close active dropdown element on click
|
|
766
|
+
// Add event listener to close active dropdown element on click outside of it
|
|
737
767
|
// Also adds 10ms delay in case of an external interaction:
|
|
738
768
|
// Some button on the page calls toggleDropdown() -> dropdown opens
|
|
739
769
|
// Click event bubbles to the window, this.handleClickOutsideBound closes dropdown again
|
|
@@ -742,7 +772,7 @@ const PostInternetHeader = class {
|
|
|
742
772
|
}, 10);
|
|
743
773
|
}
|
|
744
774
|
if (this.activeFlyout !== null && this.mainNav) {
|
|
745
|
-
this.mainNav.setActiveFlyout(null);
|
|
775
|
+
void this.mainNav.setActiveFlyout(null);
|
|
746
776
|
}
|
|
747
777
|
}
|
|
748
778
|
else {
|
|
@@ -758,7 +788,7 @@ const PostInternetHeader = class {
|
|
|
758
788
|
handleFlyoutToggled(event) {
|
|
759
789
|
this.activeFlyout = event.detail;
|
|
760
790
|
if (this.activeDropdownElement && event.detail && !this.isMainNavOpen()) {
|
|
761
|
-
this.activeDropdownElement.toggleDropdown(false);
|
|
791
|
+
void this.activeDropdownElement.toggleDropdown(false);
|
|
762
792
|
}
|
|
763
793
|
}
|
|
764
794
|
toggleMobileDropdown() {
|
|
@@ -780,12 +810,12 @@ const PostInternetHeader = class {
|
|
|
780
810
|
((_b = config.header.navMeta) === null || _b === void 0 ? void 0 : _b.filter(meta => !meta.isHomeLink).length) > 0;
|
|
781
811
|
const renderLogin = ((_c = this.login) !== null && _c !== void 0 ? _c : !config.header.isLoginWidgetHidden) && config.header.loginWidgetOptions;
|
|
782
812
|
const renderLanguageSwitch = config.header.navLang.length > 1;
|
|
783
|
-
return (index$1.h(index$1.Host, { class: `stickyness-${this.stickyness} ${this.activeDropdownElement || this.activeFlyout ? 'dropdown-open' : ''}`, "data-version": packageJson.version, onKeyup: (e) => this.handleKeyUp(e) }, index$1.h("header", { class: `post-internet-header${this.fullWidth ? ' full-width' : ''}` }, index$1.h(svgSprite_component.SvgSprite, null), index$1.h("h1", { class: "visually-hidden" }, language_service.translate('Navigate on post.ch')), index$1.h(if_component.If, { condition: this.skiplinks
|
|
813
|
+
return (index$1.h(index$1.Host, { class: `stickyness-${this.stickyness} ${Boolean(this.activeDropdownElement) || Boolean(this.activeFlyout) ? 'dropdown-open' : ''}`, "data-version": packageJson.version, onKeyup: (e) => this.handleKeyUp(e) }, index$1.h("header", { class: `post-internet-header${this.fullWidth ? ' full-width' : ''}` }, index$1.h(svgSprite_component.SvgSprite, null), index$1.h("h1", { class: "visually-hidden" }, language_service.translate('Navigate on post.ch')), index$1.h(if_component.If, { condition: this.skiplinks }, index$1.h("post-skiplinks", null)), index$1.h(if_component.If, { condition: renderMetaNavigation }, index$1.h("post-meta-navigation", { orientation: "horizontal", class: "hidden-lg", "full-width": this.fullWidth, ref: el => (this.metaNav = el) }, index$1.h(if_component.If, { condition: renderLanguageSwitch }, index$1.h("post-language-switch", { id: "post-language-switch-desktop", mode: "dropdown", onDropdownToggled: e => this.handleDropdownToggled(e) })))), index$1.h("div", { class: "main-navigation-container wide-container" }, index$1.h("post-logo", null), index$1.h("button", { class: "menu-button nav-link", onClick: () => this.toggleMobileDropdown(), "aria-haspopup": "menu", "aria-controls": "post-internet-header-main-navigation", "aria-expanded": this.activeDropdownElement ? 'true' : 'false' }, index$1.h("span", { class: "menu-button-text visually-hidden" }, config.header.mobileMenu.text), index$1.h(svgIcon_component.SvgIcon, { name: this.isMainNavOpen() ? 'pi-close' : 'pi-menu' })), index$1.h("post-main-navigation", { onDropdownToggled: e => this.handleDropdownToggled(e), onFlyoutToggled: e => this.handleFlyoutToggled(e), ref: el => (this.mainNav = el) }, index$1.h(if_component.If, { condition: renderMetaNavigation }, index$1.h("post-meta-navigation", { orientation: "vertical" }, index$1.h(if_component.If, { condition: renderLanguageSwitch }, index$1.h("post-language-switch", { id: "post-language-switch-mobile", mode: "list" }))))), index$1.h("div", { class: "main-navigation-controls" }, index$1.h(if_component.If, { condition: this.search }, index$1.h("post-search", { onDropdownToggled: e => this.handleDropdownToggled(e) })), index$1.h(if_component.If, { condition: !!renderLogin }, index$1.h("post-klp-login-widget", null, index$1.h("slot", { name: "login-widget" }))), index$1.h(if_component.If, { condition: !renderMetaNavigation && renderLanguageSwitch }, index$1.h("post-language-switch", { id: "post-language-switch-no-meta", onDropdownToggled: e => this.handleDropdownToggled(e), mode: "dropdown" })), index$1.h("slot", { name: "main" }))))));
|
|
784
814
|
}
|
|
785
815
|
get host() { return index$1.getElement(this); }
|
|
786
816
|
static get watchers() { return {
|
|
787
817
|
"language": ["handleLanguageChange"],
|
|
788
|
-
"languageSwitchOverrides": ["
|
|
818
|
+
"languageSwitchOverrides": ["handleAvailableLanguagesChange"],
|
|
789
819
|
"osFlyoutOverrides": ["handleOsFlyoutOverrides"],
|
|
790
820
|
"activeRoute": ["handleActiveRouteChange"],
|
|
791
821
|
"customConfig": ["handleCustomConfigChange"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"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KAAK,IAAI,IAC1CJ,oCACE,EAAE,EAAC,6BAA6B,EAChC,IAAI,EAAC,MAAM,GACW,CACrB,CACgB,CACpB,CACgB,EACvBA,mBAAK,KAAK,EAAC,0BAA0B,IACnCA,UAACI,eAAE,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,KAAK,KAAK,IAClCJ,2BAAa,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAgB,CAC/E,EACLA,UAACI,eAAE,IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,IAC1BJ,yCACEA,oBAAM,IAAI,EAAC,cAAc,GAAQ,CACX,CACrB,EACLA,UAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,KAAK,KAAK,IAAI,oBAAoB,KAAK,IAAI,IAC5EJ,oCACE,EAAE,EAAC,8BAA8B,EACjC,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACrD,IAAI,EAAC,UAAU,GACO,CACrB,EACLA,oBAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CACF,CACC,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;;","names":["getUserLang","persistLanguageChoice","uniqueId","state","debounce","throttle","dispose","h","Host","SvgSprite","translate","If","SvgIcon"],"sources":["./src/services/route.service.ts","./src/services/config.service.ts","./src/components/post-internet-header/logo-animation/logo-animation.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","import { debounce } from 'throttle-debounce';\nimport { state } from '../../../data/store';\n\nexport const registerLogoAnimationObserver = (\n target: HTMLElement,\n headerRef: HTMLSwisspostInternetHeaderElement,\n) => {\n /**\n * Set intersection ratio as CSS custom property\n */\n const handleScroll = () => {\n const fullStickyness = state.stickyness === 'full';\n let scale = 1;\n // Minus 1px border at the bottom that the logo is not covering\n const adjustedHeaderHeight = headerRef.clientHeight - 1;\n const scrollY = fullStickyness ? 0 : window.scrollY;\n\n // If meta navigation is not visible (mobile, not configured), scale should just be 1\n if (target.clientHeight > 0) {\n scale = Math.max(\n (adjustedHeaderHeight - Math.max(scrollY, 0)) /\n (adjustedHeaderHeight - target.clientHeight),\n 1,\n );\n }\n headerRef.style.setProperty('--logo-scale', scale.toString());\n };\n\n const debounced = debounce(150, handleScroll);\n\n /**\n * Observe the meta navigation in order to not track scroll events throughout the whole page.\n * This ensures that the scroll listener is only active while the meta navigation is visible.\n */\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting && entry.intersectionRatio > 0) {\n window.addEventListener('scroll', handleScroll, { passive: true });\n window.addEventListener('resize', debounced);\n\n // Ensure callback is called at least once in case main thread is too busy while scrolling up\n window.requestAnimationFrame(handleScroll);\n } else {\n window.removeEventListener('scroll', handleScroll);\n window.removeEventListener('resize', debounced);\n window.requestAnimationFrame(handleScroll);\n }\n });\n },\n {\n // Fires when element leaves viewport (0) and when it just about enters it (0.001)\n threshold: [0, 0.001],\n },\n );\n observer.observe(target);\n\n return handleScroll;\n};\n","@use '@swisspost/design-system-styles/variables/color';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n@use './logo-animation/logo-animation.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';\nimport { registerLogoAnimationObserver } from './logo-animation/logo-animation';\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: HTMLSwisspostInternetHeaderElement;\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 metaNav?: HTMLPostMetaNavigationElement;\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 private updateLogoAnimation: () => void;\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.stickyness = this.stickyness;\n state.environment = this.environment.toLocaleLowerCase() as 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: state.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 if (this.meta && this.metaNav) {\n this.updateLogoAnimation = registerLogoAnimationObserver(this.metaNav, this.host);\n }\n });\n\n if (this.stickyness === 'full')\n console.warn('Internet Header: The stickyness=\"full\" option is deprecated.');\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 @Watch('stickyness')\n handleStickynessChange(newValue: StickynessOptions) {\n state.stickyness = newValue;\n this.updateLogoAnimation();\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 ref={el => (this.metaNav = el)}\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","mappings":";;;;;;;;;;;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WAAW,EAAC,UAAU,IAC1CA,UAACI,eAAE,IAAC,SAAS,EAAE,oBAAoB,IACjCJ,oCACE,EAAE,EAAC,6BAA6B,EAChC,IAAI,EAAC,MAAM,GACW,CACrB,CACgB,CACpB,CACgB,EACvBA,mBAAK,KAAK,EAAC,0BAA0B,IACnCA,UAACI,eAAE,IAAC,SAAS,EAAE,IAAI,CAAC,MAAM,IACxBJ,2BAAa,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAgB,CAC/E,EACLA,UAACI,eAAE,IAAC,SAAS,EAAE,CAAC,CAAC,WAAW,IAC1BJ,yCACEA,oBAAM,IAAI,EAAC,cAAc,GAAQ,CACX,CACrB,EACLA,UAACI,eAAE,IAAC,SAAS,EAAE,CAAC,oBAAoB,IAAI,oBAAoB,IAC1DJ,oCACE,EAAE,EAAC,8BAA8B,EACjC,iBAAiB,EAAE,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,EACrD,IAAI,EAAC,UAAU,GACO,CACrB,EACLA,oBAAM,IAAI,EAAC,MAAM,GAAQ,CACrB,CACF,CACC,CACJ,EACP;GACH;;;;;;;;;;;;;;;;;;","names":["getUserLang","persistLanguageChoice","uniqueId","state","debounce","throttle","dispose","h","Host","SvgSprite","translate","If","SvgIcon"],"sources":["./src/services/route.service.ts","./src/services/config.service.ts","./src/utils/scrollparent.ts","./src/components/post-internet-header/logo-animation/logo-animation.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","const isScrollable = (node: Element) => {\n if (!(node instanceof HTMLElement || node instanceof SVGElement)) {\n return false;\n }\n const style = getComputedStyle(node);\n return ['overflow', 'overflow-x', 'overflow-y'].some(propertyName => {\n const value = style.getPropertyValue(propertyName);\n return value === 'auto' || value === 'scroll';\n });\n};\n\nexport const getScrollParent = (node: Element): Element | Document => {\n let currentParent = node.parentElement;\n while (currentParent) {\n if (isScrollable(currentParent)) {\n return currentParent;\n }\n currentParent = currentParent.parentElement;\n }\n return document;\n};\n","import { debounce } from 'throttle-debounce';\nimport { state } from '../../../data/store';\nimport { getScrollParent } from '../../../utils/scrollparent';\n\nexport const registerLogoAnimationObserver = (\n target: HTMLElement,\n headerRef: HTMLSwisspostInternetHeaderElement,\n) => {\n const scrollParent = getScrollParent(headerRef);\n\n /**\n * Set intersection ratio as CSS custom property\n */\n const handleScroll = () => {\n const fullStickyness = state.stickyness === 'full';\n let scale = 1;\n // Minus 1px border at the bottom that the logo is not covering\n const adjustedHeaderHeight = headerRef.clientHeight - 1;\n const scrollDistance = scrollParent instanceof Element ? scrollParent.scrollTop : scrollParent.documentElement.scrollTop;\n const scrollY = fullStickyness ? 0 : scrollDistance;\n\n // If meta navigation is not visible (mobile, not configured), scale should just be 1\n if (target.clientHeight > 0) {\n scale = Math.max(\n (adjustedHeaderHeight - Math.max(scrollY, 0)) /\n (adjustedHeaderHeight - target.clientHeight),\n 1,\n );\n }\n headerRef.style.setProperty('--logo-scale', scale.toString());\n };\n\n const debounced = debounce(150, handleScroll);\n\n /**\n * Observe the meta navigation in order to not track scroll events throughout the whole page.\n * This ensures that the scroll listener is only active while the meta navigation is visible.\n */\n const observer = new IntersectionObserver(\n entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting && entry.intersectionRatio > 0) {\n scrollParent.addEventListener('scroll', handleScroll, { passive: true });\n window.addEventListener('resize', debounced);\n\n // Ensure callback is called at least once in case main thread is too busy while scrolling up\n window.requestAnimationFrame(handleScroll);\n } else {\n scrollParent.removeEventListener('scroll', handleScroll);\n window.removeEventListener('resize', debounced);\n window.requestAnimationFrame(handleScroll);\n }\n });\n },\n {\n // Fires when element leaves viewport (0) and when it just about enters it (0.001)\n threshold: [0, 0.001],\n },\n );\n observer.observe(target);\n\n return handleScroll;\n};\n","@use '@swisspost/design-system-styles/variables/color';\n@use '../../utils/utils.scss';\n@use '../../utils/mixins.scss';\n@use './logo-animation/logo-animation.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 Element,\n Event,\n EventEmitter,\n h,\n Host,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { debounce, throttle } from 'throttle-debounce';\nimport {\n getLocalizedConfig,\n getLocalizedCustomConfig,\n isValidProjectId,\n} from '../../services/config.service';\nimport { dispose, state } 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 { getUserLang, translate } from '../../services/language.service';\nimport { If } from '../../utils/if.component';\nimport packageJson from '../../../package.json';\nimport { registerLogoAnimationObserver } from './logo-animation/logo-animation';\nimport { getScrollParent } from '../../utils/scrollparent';\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?: 'de' | 'fr' | 'it' | 'en';\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: HTMLSwisspostInternetHeaderElement;\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 metaNav?: HTMLPostMetaNavigationElement;\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 private updateLogoAnimation: () => void;\n private scrollParent: Element | Document;\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 }\n\n disconnectedCallback() {\n this.scrollParent.removeEventListener('scroll', this.throttledScroll);\n this.scrollParent.removeEventListener('resize', this.debouncedResize);\n\n // Reset the store to its original state\n dispose();\n }\n\n async componentWillLoad() {\n this.scrollParent = getScrollParent(this.host);\n this.scrollParent.addEventListener('scroll', this.throttledScroll, { passive: true });\n this.scrollParent.addEventListener('resize', this.debouncedResize, { passive: true });\n\n // Wait for the config to arrive, then render the header\n try {\n state.projectId = this.project;\n state.stickyness = this.stickyness;\n state.environment = this.environment.toLocaleLowerCase() as 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) {\n const langs = Object.keys(\n typeof this.customConfig === 'string' ? JSON.parse(this.customConfig) : this.customConfig,\n );\n const lang = state.currentLanguage || getUserLang(langs, this.language);\n state.localizedCustomConfig = getLocalizedCustomConfig(this.customConfig, lang);\n }\n\n state.localizedConfig = await getLocalizedConfig({\n projectId: this.project,\n environment: state.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 if (this.meta && this.metaNav) {\n this.updateLogoAnimation = registerLogoAnimationObserver(this.metaNav, this.host);\n }\n });\n\n if (this.stickyness === 'full')\n console.warn('Internet Header: The stickyness=\"full\" option is deprecated.');\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 handleAvailableLanguagesChange(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 void this.handleLanguageChange(event.detail);\n }\n\n @Watch('stickyness')\n handleStickynessChange(newValue: StickynessOptions) {\n state.stickyness = newValue;\n if (typeof this.updateLogoAnimation === 'function') this.updateLogoAnimation();\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 void this.activeDropdownElement.toggleDropdown(false);\n }\n }\n\n private handleKeyUp(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n if (this.activeDropdownElement) {\n void this.activeDropdownElement.toggleDropdown(false);\n }\n if (this.activeFlyout !== null && this.mainNav) {\n void 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 =\n this.scrollParent instanceof Document\n ? this.scrollParent.documentElement.scrollTop\n : this.scrollParent.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) {\n if (this.activeDropdownElement) {\n void 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 outside 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 void 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 void 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 Boolean(this.activeDropdownElement) || Boolean(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}>\n <post-skiplinks></post-skiplinks>\n </If>\n <If condition={renderMetaNavigation}>\n <post-meta-navigation\n orientation=\"horizontal\"\n class=\"hidden-lg\"\n full-width={this.fullWidth}\n ref={el => (this.metaNav = el)}\n >\n <If condition={renderLanguageSwitch}>\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}>\n <post-meta-navigation orientation=\"vertical\">\n <If condition={renderLanguageSwitch}>\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}>\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 && renderLanguageSwitch}>\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}
|