@postnord/pn-marketweb-components 4.5.1 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/cjs/pn-dropdown-with-multi-input-rows.cjs.entry.js +1 -1
  2. package/cjs/pn-language-selector_13.cjs.entry.js +6 -5
  3. package/cjs/pn-language-selector_13.cjs.entry.js.map +1 -1
  4. package/cjs/pn-marketweb-siteheader-login-button_2.cjs.entry.js +3 -5
  5. package/cjs/pn-marketweb-siteheader-login-button_2.cjs.entry.js.map +1 -1
  6. package/cjs/pn-multi-row-connected-dropdown-row.cjs.entry.js +1 -1
  7. package/cjs/pn-multi-row-connected-dropdown.cjs.entry.js +1 -1
  8. package/cjs/pn-multiple-input.cjs.entry.js +1 -1
  9. package/cjs/pn-play-on-scroll.cjs.entry.js +1 -1
  10. package/cjs/pn-scroll_2.cjs.entry.js +1 -1
  11. package/cjs/pn-stats-info-data.cjs.entry.js +1 -1
  12. package/cjs/transfer-3cf2ea0d.js +8 -0
  13. package/cjs/transfer-3cf2ea0d.js.map +1 -0
  14. package/cjs/v4-de9aacdf.js +71 -0
  15. package/cjs/v4-de9aacdf.js.map +1 -0
  16. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.css +0 -3
  17. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.css +13 -27
  18. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +4 -4
  19. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js.map +1 -1
  20. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.css +0 -7
  21. package/components/pn-marketweb-siteheader-login-linklist2.js +2 -2
  22. package/components/pn-marketweb-siteheader-login-linklist2.js.map +1 -1
  23. package/components/pn-marketweb-siteheader-login-profileselection2.js +5 -5
  24. package/components/pn-marketweb-siteheader-login-profileselection2.js.map +1 -1
  25. package/components/pn-marketweb-siteheader-login2.js +1 -1
  26. package/components/pn-marketweb-siteheader-login2.js.map +1 -1
  27. package/components/v4.js +53 -52
  28. package/components/v4.js.map +1 -1
  29. package/esm/pn-dropdown-with-multi-input-rows.entry.js +1 -1
  30. package/esm/pn-language-selector_13.entry.js +6 -5
  31. package/esm/pn-language-selector_13.entry.js.map +1 -1
  32. package/esm/pn-marketweb-siteheader-login-button_2.entry.js +2 -4
  33. package/esm/pn-marketweb-siteheader-login-button_2.entry.js.map +1 -1
  34. package/esm/pn-multi-row-connected-dropdown-row.entry.js +1 -1
  35. package/esm/pn-multi-row-connected-dropdown.entry.js +1 -1
  36. package/esm/pn-multiple-input.entry.js +1 -1
  37. package/esm/pn-play-on-scroll.entry.js +1 -1
  38. package/esm/pn-scroll_2.entry.js +1 -1
  39. package/esm/pn-stats-info-data.entry.js +1 -1
  40. package/esm/transfer-a5986b65.js +6 -0
  41. package/esm/transfer-a5986b65.js.map +1 -0
  42. package/esm/v4-08967a5a.js +69 -0
  43. package/esm/v4-08967a5a.js.map +1 -0
  44. package/package.json +8 -5
  45. package/pn-market-web-components/{p-8a76d782.entry.js → p-016016f0.entry.js} +2 -2
  46. package/pn-market-web-components/{p-3f268359.entry.js → p-2dfa364d.entry.js} +2 -2
  47. package/pn-market-web-components/{p-3d11fd8a.entry.js → p-3ab56a51.entry.js} +2 -2
  48. package/pn-market-web-components/{p-71956f95.entry.js → p-6533f8f4.entry.js} +2 -2
  49. package/pn-market-web-components/{p-ac565795.entry.js → p-84ef21c0.entry.js} +2 -2
  50. package/pn-market-web-components/p-a89eaf58.entry.js +2 -0
  51. package/pn-market-web-components/p-a89eaf58.entry.js.map +1 -0
  52. package/pn-market-web-components/p-c4c32c46.js +2 -0
  53. package/pn-market-web-components/p-c4c32c46.js.map +1 -0
  54. package/pn-market-web-components/p-d3a44504.entry.js +2 -0
  55. package/pn-market-web-components/p-d3a44504.entry.js.map +1 -0
  56. package/pn-market-web-components/p-e36420d7.js +2 -0
  57. package/pn-market-web-components/p-e36420d7.js.map +1 -0
  58. package/pn-market-web-components/{p-6f1bf16b.entry.js → p-f1e6ba9e.entry.js} +2 -2
  59. package/pn-market-web-components/{p-6f1e27ec.entry.js → p-fe0a29cf.entry.js} +2 -2
  60. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  61. package/umd/modules/@postnord/web-components/package.json +1 -1
  62. package/umd/pn-marketweb-init.js +1 -1
  63. package/umd/pn-marketweb-salesforce-header.js +1 -1
  64. package/umd/pn-marketweb-salesforce.js +1 -1
  65. package/cjs/v4-9b297151.js +0 -70
  66. package/cjs/v4-9b297151.js.map +0 -1
  67. package/esm/v4-964634d6.js +0 -68
  68. package/esm/v4-964634d6.js.map +0 -1
  69. package/pn-market-web-components/p-4ed69de7.js +0 -2
  70. package/pn-market-web-components/p-4ed69de7.js.map +0 -1
  71. package/pn-market-web-components/p-c668f68a.entry.js +0 -2
  72. package/pn-market-web-components/p-c668f68a.entry.js.map +0 -1
  73. package/pn-market-web-components/p-da4863ad.entry.js +0 -2
  74. package/pn-market-web-components/p-da4863ad.entry.js.map +0 -1
  75. /package/pn-market-web-components/{p-8a76d782.entry.js.map → p-016016f0.entry.js.map} +0 -0
  76. /package/pn-market-web-components/{p-3f268359.entry.js.map → p-2dfa364d.entry.js.map} +0 -0
  77. /package/pn-market-web-components/{p-3d11fd8a.entry.js.map → p-3ab56a51.entry.js.map} +0 -0
  78. /package/pn-market-web-components/{p-71956f95.entry.js.map → p-6533f8f4.entry.js.map} +0 -0
  79. /package/pn-market-web-components/{p-ac565795.entry.js.map → p-84ef21c0.entry.js.map} +0 -0
  80. /package/pn-market-web-components/{p-6f1bf16b.entry.js.map → p-f1e6ba9e.entry.js.map} +0 -0
  81. /package/pn-market-web-components/{p-6f1e27ec.entry.js.map → p-fe0a29cf.entry.js.map} +0 -0
@@ -1,8 +1,8 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { s as state, d as defineCustomElement$1 } from './pn-marketweb-siteheader-login-linklist2.js';
2
+ import { s as state, t as transfer, d as defineCustomElement$1 } from './pn-marketweb-siteheader-login-linklist2.js';
3
3
  import { a as arrow_right } from './arrow_right.js';
4
4
 
5
- const pnMarketwebSiteheaderLoginProfileselectionCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-marketweb-siteheader-login-profileselection{--login-profileselection-heading-color:var(--siteheader-login-profileselection-heading-color,\n inherit);--login-profileselection-description-color:var(--siteheader-login-profileselection-description-color,\n #5e554a);--login-profileselection-user-name-color:var(--siteheader-login-profileselection-user-name-color,\n inherit);--login-profileselection-divider-background:var(--siteheader-login-profileselection-divider-background,\n #00a0d6);--login-profileselection-profileoption-link-background:var(--siteheader-login-profileselection-profileoption-link-background,\n #ffffff);--login-profileselection-profileoption-link-color:var(--siteheader-login-profileselection-profileoption-link-color,\n #005d92);--login-profileselection-profileoption-link-hover-background:var(--siteheader-login-profileselection-profileoption-link-hover-background,\n #f3f2f2);--login-profileselection-logout-link-color:var(--siteheader-login-profileselection-logout-link-color,\n #005d92)}.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem;color:var(--login-profileselection-heading-color)}.pn-marketweb-siteheader-login-profileselection-user,.pn-marketweb-siteheader-login-profileselection-currentprofile{margin-top:1rem;margin-bottom:1rem}.pn-marketweb-siteheader-login-profileselection-user-name,.pn-marketweb-siteheader-login-profileselection-currentprofile-name{line-height:1;color:var(--login-profileselection-user-name-color)}.pn-marketweb-siteheader-login-profileselection-user-description,.pn-marketweb-siteheader-login-profileselection-currentprofile-description{font-weight:400;white-space:normal;word-break:break-all;color:var(--login-profileselection-description-color);font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{position:relative;width:100%;height:1rem;background:var(--login-profileselection-divider-background);margin-left:-1em;margin-top:1.6rem;margin-bottom:1.6rem;border-radius:0 0.6em 0.6em 0;padding:0}.pn-marketweb-siteheader-login-profileselection-divider::after{content:\"\";position:absolute;right:0;top:0;width:0.6em;height:0.6em;border-radius:50%;background:inherit;transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:flex;align-items:center;margin:0 -1em;padding:0.6rem 1.6rem;background:var(--login-profileselection-profileoption-link-background);color:var(--login-profileselection-profileoption-link-color);text-decoration:none;transition:background 0.15s ease-in-out}.pn-marketweb-siteheader-login-profileselection-profileoption-link:hover,.pn-marketweb-siteheader-login-profileselection-profileoption-link:focus,.pn-marketweb-siteheader-login-profileselection-profileoption-link:active{background:var(--login-profileselection-profileoption-link-hover-background)}.pn-marketweb-siteheader-login-profileselection-profileoption-content{flex-grow:1}.pn-marketweb-siteheader-login-profileselection-profileoption-name{font-weight:700}.pn-marketweb-siteheader-login-profileselection-profileoption-description{font-weight:400;white-space:normal;word-break:break-all;color:var(--login-profileselection-description-color);font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{width:100%;padding:1.6rem;text-align:center}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:var(--login-profileselection-logout-link-color);text-decoration:none}.pn-marketweb-siteheader-login-profileselection-logout-link:hover,.pn-marketweb-siteheader-login-profileselection-logout-link:focus,.pn-marketweb-siteheader-login-profileselection-logout-link:active{text-decoration:underline}";
5
+ const pnMarketwebSiteheaderLoginProfileselectionCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-marketweb-siteheader-login-profileselection{--login-profileselection-heading-color:var(--siteheader-login-profileselection-heading-color,\n inherit);--login-profileselection-description-color:var(--siteheader-login-profileselection-description-color,\n #5e554a);--login-profileselection-user-name-color:var(--siteheader-login-profileselection-user-name-color,\n inherit);--login-profileselection-divider-background:var(--siteheader-login-profileselection-divider-background,\n #00a0d6);--login-profileselection-profileoption-link-background:var(--siteheader-login-profileselection-profileoption-link-background,\n #ffffff);--login-profileselection-profileoption-link-color:var(--siteheader-login-profileselection-profileoption-link-color,\n #005d92);--login-profileselection-profileoption-link-hover-background:var(--siteheader-login-profileselection-profileoption-link-hover-background,\n #f3f2f2);--login-profileselection-logout-link-color:var(--siteheader-login-profileselection-logout-link-color,\n #005d92)}.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem;color:var(--login-profileselection-heading-color)}.pn-marketweb-siteheader-login-profileselection-user,.pn-marketweb-siteheader-login-profileselection-currentprofile{margin-top:1rem;margin-bottom:1rem}.pn-marketweb-siteheader-login-profileselection-user-name,.pn-marketweb-siteheader-login-profileselection-currentprofile-name{line-height:1;color:var(--login-profileselection-user-name-color)}.pn-marketweb-siteheader-login-profileselection-user-description,.pn-marketweb-siteheader-login-profileselection-currentprofile-description{font-weight:400;white-space:normal;word-break:break-all;color:var(--login-profileselection-description-color);font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:flex;align-items:flex-start;margin:0 -1em;padding:0.6rem 1.6rem;background:var(--login-profileselection-profileoption-link-background);color:var(--login-profileselection-profileoption-link-color);text-decoration:none;transition:background 0.15s ease-in-out}.pn-marketweb-siteheader-login-profileselection-profileoption-link:hover,.pn-marketweb-siteheader-login-profileselection-profileoption-link:focus,.pn-marketweb-siteheader-login-profileselection-profileoption-link:active{background:var(--login-profileselection-profileoption-link-hover-background)}.pn-marketweb-siteheader-login-profileselection-profileoption-content{padding-right:0.5rem}.pn-marketweb-siteheader-login-profileselection-profileoption-content pn-icon{margin-left:0.5rem}.pn-marketweb-siteheader-login-profileselection-profileoption-name{font-weight:700}.pn-marketweb-siteheader-login-profileselection-profileoption-description{font-weight:400;white-space:normal;word-break:break-all;color:var(--login-profileselection-description-color);font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{width:100%}.pn-marketweb-siteheader-login-profileselection-logout::before{display:block;content:\"\";width:100%;height:2px;margin:1.5rem 0;background:var(--login-dropdown-divider-background)}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:var(--login-profileselection-logout-link-color);text-decoration:none}.pn-marketweb-siteheader-login-profileselection-logout-link:hover,.pn-marketweb-siteheader-login-profileselection-logout-link:focus,.pn-marketweb-siteheader-login-profileselection-logout-link:active{text-decoration:underline}";
6
6
  const PnMarketwebSiteheaderLoginProfileselectionStyle0 = pnMarketwebSiteheaderLoginProfileselectionCss;
7
7
 
8
8
  const PnMarketwebSiteheaderLoginProfileselection = /*@__PURE__*/ proxyCustomElement(class PnMarketwebSiteheaderLoginProfileselection extends HTMLElement {
@@ -200,12 +200,12 @@ const PnMarketwebSiteheaderLoginProfileselection = /*@__PURE__*/ proxyCustomElem
200
200
  return;
201
201
  }
202
202
  let hostElementAttribute = {};
203
- return (h(Host, { ...hostElementAttribute }, this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileoptions
203
+ return (h(Host, { ...hostElementAttribute }, this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, this.currentProfile !== null && this.currentProfile.name ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail))) : null, h("pn-marketweb-siteheader-login-linklist", { links: this.filterLogoutLink(this.loginDialog.loggedInLinks), idNamespace: this.idNamespace }), this.profileoptions
204
204
  .filter(x => x.selected !== true)
205
205
  .map(organization => {
206
206
  let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;
207
- return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)), h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" }))));
208
- }), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))) : null));
207
+ return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, organization.name, h("pn-icon", { icon: arrow_right, small: "false", color: "blue700" })), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, organization.customerNumber ? organization.customerNumber : this.userEmail)))));
208
+ }), this.logoutLink ? (h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("pn-text-link", { href: this.logoutLink.href, rel: "nofollower noopener", id: "pn-marketweb-header-logoutlink", onClick: () => state.loginManager.clearUserData(), class: "pn-marketweb-siteheader-login-profileselection-logout-link", icon: transfer, label: this.logoutLink.linkText }))) : null));
209
209
  }
210
210
  static get style() { return PnMarketwebSiteheaderLoginProfileselectionStyle0; }
211
211
  }, [0, "pn-marketweb-siteheader-login-profileselection", {
@@ -1 +1 @@
1
- {"file":"pn-marketweb-siteheader-login-profileselection2.js","mappings":";;;;AAAA,MAAM,6CAA6C,GAAG,wkIAAwkI,CAAC;AAC/nI,yDAAe,6CAA6C;;MCU/C,0CAA0C;;;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAEQ,IAAI;wBACf,IAAI;yBACH,EAAE;8BAEwC,IAAI;8BACF,EAAE;;;IAE3E,iBAAiB;QACf,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,6BAA6B,EAAE;YACrE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,6BAA6B,CAAC;SACxD;QACD,IAA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Aa,EAAE,EACvD,KAAK,EAAC,4DAA4D,IAEjE,IAAI,CAAC,UAAU,CAAC,QAAQ,CACvB,CACA,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-profileselection-description-font-weight: 400;\n$login-profileselection-description-font-size: 0.75em;\n\n$login-profileselection-divider-dot-size: 0.6em;\n$login-profileselection-divider-dot-offset: 0.2em;\n\n$login-profileselection-profileoption-link-padding: 0.6rem 1.6rem;\n$login-profileselection-profileoption-link-transition: background 0.15s ease-in-out;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-profileselection {\n --login-profileselection-heading-color: var(--siteheader-login-profileselection-heading-color,\n inherit);\n --login-profileselection-description-color: var(--siteheader-login-profileselection-description-color,\n #{$gray700});\n --login-profileselection-user-name-color: var(--siteheader-login-profileselection-user-name-color,\n inherit);\n --login-profileselection-divider-background: var(--siteheader-login-profileselection-divider-background,\n #{$blue400});\n --login-profileselection-profileoption-link-background: var(--siteheader-login-profileselection-profileoption-link-background,\n #{$white});\n --login-profileselection-profileoption-link-color: var(--siteheader-login-profileselection-profileoption-link-color,\n #{$blue700});\n --login-profileselection-profileoption-link-hover-background: var(--siteheader-login-profileselection-profileoption-link-hover-background,\n #{$gray50});\n --login-profileselection-logout-link-color: var(--siteheader-login-profileselection-logout-link-color,\n #{$blue700});\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n color:var(--login-profileselection-heading-color);\n}\n\n// -----------------------------------------------------------------------------\n// User / current profile sections\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n color: var(--login-profileselection-user-name-color);\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Divider\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-divider {\n position: relative;\n width: 100%;\n height: 1rem;\n background: var(--login-profileselection-divider-background);\n\n margin-left: -1em; // Negative positioning due to nav dropdown's padding\n margin-top: 1.6rem;\n margin-bottom: 1.6rem;\n border-radius: 0 0.6em 0.6em 0;\n padding: 0;\n\n &::after {\n content: '';\n position: absolute;\n right: 0;\n top: 0;\n width: $login-profileselection-divider-dot-size;\n height: $login-profileselection-divider-dot-size;\n border-radius: 50%;\n background: inherit;\n transform: translateX(calc(100% + #{$login-profileselection-divider-dot-offset}));\n }\n}\n\n// -----------------------------------------------------------------------------\n// Profile options\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n align-items: center;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: $login-profileselection-profileoption-link-padding;\n background: var(--login-profileselection-profileoption-link-background);\n color: var(--login-profileselection-profileoption-link-color);\n text-decoration: none;\n transition: $login-profileselection-profileoption-link-transition;\n\n &:hover,\n &:focus,\n &:active {\n background: var(--login-profileselection-profileoption-link-hover-background);\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n flex-grow: 1;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Logout\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-logout {\n width: 100%;\n padding: 1.6rem;\n text-align: center;\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: var(--login-profileselection-logout-link-color);\n text-decoration: none;\n\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n this.heading = \"\"; //this is to not get \"logged in as\" text when its private account\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n <div class=\"pn-marketweb-siteheader-login-profileselection-divider\"></div>\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\"\n >\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">{organization.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <a\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n >\n {this.logoutLink.linkText}\n </a>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-marketweb-siteheader-login-profileselection2.js","mappings":";;;;AAAA,MAAM,6CAA6C,GAAG,y3HAAy3H,CAAC;AACh7H,yDAAe,6CAA6C;;MCU/C,0CAA0C;;;;2BAID,IAAI;wBAC7B,EAAE;wBACD,KAAK;2BACH,EAAE;uBACN,IAAI;oBACC;YAC7B,WAAW,EAAE,EAAE;YACf,iBAAiB,EAAE,EAAE;YACrB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,gBAAgB,EAAE,EAAE;YACpB,cAAc,EAAE,EAAE;YAClB,eAAe,EAAE,EAAE;YACnB,6BAA6B,EAAE,EAAE;SAChB;oBAEQ,IAAI;0BAEQ,IAAI;wBACf,IAAI;yBACH,EAAE;8BAEwC,IAAI;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IAEhE,oBACE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,IAAI,EAC1B,GAAG,EAAC,qBAAqB,EACzB,EAAE,EAAC,gCAAgC,EACnC,OAAO,EAAE,MAAMA,KAAW,CAAC,YAAY,CAAC,aAAa,EAAE,EACvD,KAAK,EAAC,4DAA4D,EAClE,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,GAElB,CACX,IACJ,IAAI,CACH,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.scss?tag=pn-marketweb-siteheader-login-profileselection","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.tsx"],"sourcesContent":["@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$login-profileselection-description-font-weight: 400;\n$login-profileselection-description-font-size: 0.75em;\n\n$login-profileselection-divider-dot-size: 0.6em;\n$login-profileselection-divider-dot-offset: 0.2em;\n\n$login-profileselection-profileoption-link-padding: 0.6rem 1.6rem;\n$login-profileselection-profileoption-link-transition: background 0.15s ease-in-out;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login-profileselection {\n --login-profileselection-heading-color: var(--siteheader-login-profileselection-heading-color,\n inherit);\n --login-profileselection-description-color: var(--siteheader-login-profileselection-description-color,\n #{$gray700});\n --login-profileselection-user-name-color: var(--siteheader-login-profileselection-user-name-color,\n inherit);\n --login-profileselection-divider-background: var(--siteheader-login-profileselection-divider-background,\n #{$blue400});\n --login-profileselection-profileoption-link-background: var(--siteheader-login-profileselection-profileoption-link-background,\n #{$white});\n --login-profileselection-profileoption-link-color: var(--siteheader-login-profileselection-profileoption-link-color,\n #{$blue700});\n --login-profileselection-profileoption-link-hover-background: var(--siteheader-login-profileselection-profileoption-link-hover-background,\n #{$gray50});\n --login-profileselection-logout-link-color: var(--siteheader-login-profileselection-logout-link-color,\n #{$blue700});\n}\n\n// -----------------------------------------------------------------------------\n// Heading\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-heading {\n display: block;\n padding: 0.5rem 0 1rem;\n color:var(--login-profileselection-heading-color);\n}\n\n// -----------------------------------------------------------------------------\n// User / current profile sections\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-user,\n.pn-marketweb-siteheader-login-profileselection-currentprofile {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-name,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-name {\n line-height: 1;\n color: var(--login-profileselection-user-name-color);\n}\n\n.pn-marketweb-siteheader-login-profileselection-user-description,\n.pn-marketweb-siteheader-login-profileselection-currentprofile-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Profile options\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-profileoption-link {\n display: flex;\n align-items: flex-start;\n margin: 0 -1em; // Negative margin due to dropdown content padding\n padding: $login-profileselection-profileoption-link-padding;\n background: var(--login-profileselection-profileoption-link-background);\n color: var(--login-profileselection-profileoption-link-color);\n text-decoration: none;\n transition: $login-profileselection-profileoption-link-transition;\n\n &:hover,\n &:focus,\n &:active {\n background: var(--login-profileselection-profileoption-link-hover-background);\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-content {\n padding-right: 0.5rem;\n\n pn-icon {\n margin-left: 0.5rem;\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-name {\n font-weight: 700;\n}\n\n.pn-marketweb-siteheader-login-profileselection-profileoption-description {\n font-weight: $login-profileselection-description-font-weight;\n white-space: normal;\n word-break: break-all;\n color: var(--login-profileselection-description-color);\n font-size: $login-profileselection-description-font-size;\n}\n\n// -----------------------------------------------------------------------------\n// Logout\n// -----------------------------------------------------------------------------\n.pn-marketweb-siteheader-login-profileselection-logout {\n width: 100%;\n\n &::before {\n display: block;\n content: \"\";\n width: 100%;\n height: 2px;\n margin: 1.5rem 0;\n background: var(--login-dropdown-divider-background);\n }\n}\n\n.pn-marketweb-siteheader-login-profileselection-logout-link {\n display: inline-block;\n font-weight: 500;\n color: var(--login-profileselection-logout-link-color);\n text-decoration: none;\n\n &:hover,\n &:focus,\n &:active {\n text-decoration: underline;\n }\n}","import { Component, Element, h, Host, Prop, State } from '@stencil/core';\n\nimport { IUserInfo } from '../../../globals/MarketWebLoginManager';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport { LoginDialog, LoginDialogLink, ProfileSelectorCustomerItem, ProfileSelectorOrganization, SiteHeaderI18N } from './pn-marketweb-siteheader-types';\nimport { arrow_right, transfer } from 'pn-design-assets/pn-assets/icons.js';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login-profileselection',\n styleUrl: 'pn-marketweb-siteheader-login-profileselection.scss',\n})\nexport class PnMarketwebSiteheaderLoginProfileselection {\n @Element() hostElement: HTMLElement;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n @Prop() endpoint: string = '';\n @Prop() loggedin: boolean = false;\n @Prop() idNamespace: string = '';\n @Prop() heading: string = null;\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n } as SiteHeaderI18N;\n\n @State() user: IUserInfo = null;\n\n @State() logoutLink: LoginDialogLink = null;\n @State() userName: string = null;\n @State() userEmail: string = '';\n\n @Prop({ mutable: true }) currentProfile: ProfileSelectorCustomerItem = null;\n @Prop({ mutable: true }) profileoptions: ProfileSelectorOrganization[] = [];\n\n componentWillLoad() {\n if (this.heading === null && this.i18n?.profileSelectionFlyoutHeading) {\n this.heading = this.i18n.profileSelectionFlyoutHeading;\n }\n this.init();\n }\n\n init() {\n this.updateUserInfo();\n this.adjustLoginLinks();\n this.fetchProfiles();\n }\n async fetchProfiles() {\n if (!this.loggedin || this.profileoptions.length > 0) {\n return;\n }\n let apiUrl = `${this.endpoint}${this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1 ? '' : '/'}api/user/parentorganizations`;\n const req = await fetch(apiUrl);\n const reqdata = await req.json();\n const fallbackData = {\n loggedin: true,\n organizations: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '5564513603',\n id: 'dbba867d-1dff-3dbb-b420-c57b4b828b73',\n selected: true,\n profiles: [\n {\n name: 'Forsheda Livs AB',\n customerNumber: '20685482',\n id: 'f757ba28-9a73-15a2-f128-4b394d970f3f',\n ssid: '',\n selected: false,\n customerGroup: 'Business',\n },\n {\n name: 'ICA MAXI KUNGSBACKA',\n customerNumber: '20831191',\n id: '5aea41df-32b0-3f7e-2946-78598360177d',\n ssid: '259686',\n selected: true,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'Hem Livs i Kungsbacka AB',\n customerNumber: '5565271250',\n id: '97ca363c-40ef-cca9-7a3c-9e7f025567c2',\n selected: false,\n profiles: [\n {\n name: 'ICA KVANTUM KUNGSBACKA',\n customerNumber: '20831193',\n id: 'fbd61ffd-41c6-2206-b88e-cfef91e1dc39',\n ssid: '259691',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '5568902679',\n id: '7cb76a94-e1a5-5f57-58fd-bc563851b28e',\n selected: false,\n profiles: [\n {\n name: 'ICA SUPERMARKET TORGET',\n customerNumber: '20831212',\n id: '3a2db017-b68f-6fa0-fe70-542c08cd97ce',\n ssid: '',\n selected: false,\n customerGroup: 'Agent',\n },\n ],\n },\n ],\n };\n const data = window.location.href.indexOf('localhost:6008') !== -1 ? fallbackData : reqdata;\n\n if (!data || !data.organizations || !data.organizations.length) {\n this.heading = \"\"; //this is to not get \"logged in as\" text when its private account\n return;\n }\n\n (data.organizations as ProfileSelectorOrganization[]).forEach(org => {\n if (org.selected === true && org.profiles) {\n const selectedProfile = org.profiles.filter(x => x.selected === true);\n if (selectedProfile && selectedProfile[0] && selectedProfile[0].customerGroup.toLocaleLowerCase() === 'agent' && selectedProfile[0].ssid) {\n org.customerNumber = selectedProfile[0].ssid;\n }\n } else {\n if (org.customerNumber.length === 10 && org.customerNumber.substring(0, 2) === '55') {\n org.customerNumber = org.customerNumber.substring(0, 6) + '-' + org.customerNumber.substring(6);\n }\n this.profileoptions.push(org);\n }\n });\n\n let currentProfileObj = data.organizations.filter(x => x.selected === true)[0];\n const userProfileOption = {\n name: this.userName,\n customerNumber: '',\n id: '',\n selected: !currentProfileObj,\n profiles: [],\n };\n if (!currentProfileObj) {\n currentProfileObj = userProfileOption;\n }\n\n if (currentProfileObj && currentProfileObj.name) {\n this.currentProfile = currentProfileObj;\n }\n this.profileoptions.push(userProfileOption);\n }\n adjustLoginLinks() {\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.href);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n };\n\n if (this.loginDialog?.loggedInLinks) {\n this.loginDialog?.loggedInLinks.forEach(adjustLink);\n }\n\n this.logoutLink = this.loginDialog?.loggedInLinks.filter(x => x.isLogoutLink)[0] ?? null;\n }\n updateUserInfo() {\n const userInfo: IUserInfo = headerState.loginManager.getUserInfo();\n this.user = userInfo;\n if (!userInfo) {\n return;\n }\n if (userInfo && userInfo.email) {\n this.userEmail = userInfo.email;\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n if (userInfo && userInfo.given_name) {\n this.userName = userInfo.given_name;\n return;\n }\n if (userInfo && userInfo.family_name) {\n this.userName = userInfo.family_name;\n return;\n }\n if (userInfo && userInfo.username) {\n this.userName = userInfo.username;\n return;\n }\n }\n\n filterLogoutLink(loggedInLinks: LoginDialogLink[]): LoginDialogLink[] {\n return loggedInLinks.filter((link: LoginDialogLink) => !link.isLogoutLink);\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {};\n return (\n <Host {...hostElementAttribute}>\n {this.heading ? <strong class=\"pn-marketweb-siteheader-login-profileselection-heading\">{this.heading}</strong> : null}\n {this.currentProfile !== null && this.currentProfile.name ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-name\">{this.currentProfile.name}</div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-currentprofile-description\">\n {this.currentProfile.customerNumber ? this.currentProfile.customerNumber : this.userEmail}\n </div>\n </div>\n ) : null}\n\n <pn-marketweb-siteheader-login-linklist\n links={this.filterLogoutLink(this.loginDialog.loggedInLinks)}\n idNamespace={this.idNamespace}\n ></pn-marketweb-siteheader-login-linklist>\n\n {this.profileoptions\n .filter(x => x.selected !== true)\n .map(organization => {\n let customerNumber = organization.profiles.length > 0 ? organization.profiles[0].customerNumber : organization.customerNumber;\n return (\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption\">\n {/* /api/user/setprofile? profile=xxxxx */}\n <a\n href={`${this.endpoint}/api/user/setprofile?customernumber=${customerNumber}&returnUrl=${encodeURIComponent(window.location.href)}`}\n class=\"pn-marketweb-siteheader-login-profileselection-profileoption-link\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-content\">\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-name\">\n {organization.name}\n <pn-icon icon={arrow_right} small=\"false\" color=\"blue700\"></pn-icon>\n </div>\n <div class=\"pn-marketweb-siteheader-login-profileselection-profileoption-description\">\n {organization.customerNumber ? organization.customerNumber : this.userEmail}\n </div>\n </div>\n </a>\n </div>\n );\n })}\n\n {this.logoutLink ? (\n <div class=\"pn-marketweb-siteheader-login-profileselection-logout\">\n {/* https://se-inte.postnord.com/UnifiedLogin/ExternalLoginCallback?returnUrl=https://se-inte.postnord.com/handla-online&profile=770e785b-702b-dc22-b1e9-4839eded4f83 */}\n <pn-text-link\n href={this.logoutLink.href}\n rel=\"nofollower noopener\"\n id=\"pn-marketweb-header-logoutlink\"\n onClick={() => headerState.loginManager.clearUserData()}\n class=\"pn-marketweb-siteheader-login-profileselection-logout-link\"\n icon={transfer}\n label={this.logoutLink.linkText}\n >\n </pn-text-link>\n </div>\n ) : null}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -372,7 +372,7 @@ class MarketWebLoginManager {
372
372
  };
373
373
  }
374
374
 
375
- const pnMarketwebSiteheaderLoginCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-marketweb-siteheader-login{--login-dropdown-divider-background:var(--siteheader-login-dropdown-divider-background,\n #f9f8f8);--login-dropdown-text-color:var(--siteheader-login-dropdown-text-color,\n #2d2013);--login-dropdown-link-color:var(--siteheader-login-dropdown-link-color,\n #005d92);--login-dropdown-link-hover-decoration:var(--siteheader-login-dropdown-link-hover-decoration,\n underline);--login-dark-icon-hover-fill:var(--siteheader-login-dark-icon-hover-fill,\n #000000);padding:1rem 0;max-height:5.2rem;position:relative}pn-marketweb-siteheader-login pn-button-dropdown{display:none}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content{max-width:350px;display:flex;flex-direction:column;gap:2.4rem;padding:4rem}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content pn-button{width:100%}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content pn-marketweb-siteheader-unified-login::after{display:block;content:\"\";width:100%;height:2px;margin-top:2.4rem;background:var(--login-dropdown-divider-background)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span{font-size:1.4rem;color:var(--login-dropdown-text-color)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span::before{display:block;content:\"\";width:100%;height:2px;background:var(--login-dropdown-divider-background)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a{text-decoration:none;color:var(--login-dropdown-link-color)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a:hover{text-decoration:var(--login-dropdown-link-hover-decoration)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span *{margin-bottom:0}pn-marketweb-siteheader-login.hydrated pn-button-dropdown{display:block}pn-marketweb-siteheader-login[appearance=dark] button:hover pn-icon svg path{fill:var(--login-dark-icon-hover-fill)}";
375
+ const pnMarketwebSiteheaderLoginCss = "pn-button-dropdown .pn-button-dropdown>pn-button>.pn-button{min-height:initial}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}@media screen and (max-width: 767px){.sr-only-mobile{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}}pn-marketweb-siteheader-login{--login-dropdown-divider-background:var(--siteheader-login-dropdown-divider-background,\n #f9f8f8);--login-dropdown-text-color:var(--siteheader-login-dropdown-text-color,\n #2d2013);--login-dropdown-link-color:var(--siteheader-login-dropdown-link-color,\n #005d92);--login-dropdown-link-hover-decoration:var(--siteheader-login-dropdown-link-hover-decoration,\n underline);--login-dark-icon-hover-fill:var(--siteheader-login-dark-icon-hover-fill,\n #000000);padding:1rem 0;max-height:5.2rem;position:relative}pn-marketweb-siteheader-login pn-button-dropdown{display:none}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content{max-width:350px;display:flex;flex-direction:column;gap:2.4rem;padding:4rem}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content pn-button{width:100%}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content pn-marketweb-siteheader-unified-login::after{display:block;content:\"\";width:100%;height:2px;margin-top:2.4rem;background:var(--login-dropdown-divider-background)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span{font-size:1.4rem;color:var(--login-dropdown-text-color)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a{text-decoration:none;color:var(--login-dropdown-link-color)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span a:hover{text-decoration:var(--login-dropdown-link-hover-decoration)}pn-marketweb-siteheader-login pn-button-dropdown .pn-button-dropdown-container .pn-button-dropdown-content span *{margin-bottom:0}pn-marketweb-siteheader-login.hydrated pn-button-dropdown{display:block}pn-marketweb-siteheader-login[appearance=dark] button:hover pn-icon svg path{fill:var(--login-dark-icon-hover-fill)}";
376
376
  const PnMarketwebSiteheaderLoginStyle0 = pnMarketwebSiteheaderLoginCss;
377
377
 
378
378
  const PnMarketwebSiteheaderLogin = /*@__PURE__*/ proxyCustomElement(class PnMarketwebSiteheaderLogin extends HTMLEl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UAAU,GAAG,GAAG,GAAG,GAAG,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,GACF,CACxC,EACA,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,SAAS,KAAK,YAAM,SAAS,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,GAAI,CAAC,CACrF,CAChB,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["node_modules/pn-design-assets/pn-assets/icons/user.js","src/globals/MarketWebLoginManager.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.scss?tag=pn-marketweb-siteheader-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.tsx"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M7.5 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0M12 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.928 20.372a1 1 0 0 1-1.856-.743l.883.353a82 82 0 0 1-.883-.354v-.002l.001-.002.003-.007.008-.018a4 4 0 0 1 .114-.25c.078-.161.193-.383.35-.645.315-.523.8-1.217 1.495-1.911C6.444 15.39 8.688 14 12 14s5.556 1.391 6.957 2.793a10 10 0 0 1 1.494 1.911 8 8 0 0 1 .44.837q.016.036.025.058l.008.018.003.007.001.004-.883.354.883-.353a1 1 0 0 1-1.856.744v.001l.001.001v-.002a2 2 0 0 0-.07-.15 6 6 0 0 0-.267-.49 8 8 0 0 0-1.193-1.526C16.444 17.11 14.688 16 12 16s-4.444 1.109-5.543 2.207a8 8 0 0 0-1.193 1.526 6 6 0 0 0-.336.64m0 0-.001.003zm14.144.001\" clip-rule=\"evenodd\"/></svg>';\nexport const user = icon;\n","class MarketWebLoginManager {\n eventTarget: EventTarget = window ?? document?.body;\n endpoint: String = '';\n storagePrefix: String = 'pn-user';\n checkUserLoggedInStateInterval: number = 0;\n baseUrls = {\n at: 'https://atportal.postnord.com/api/unified-login/backend',\n prod: 'https://portal.postnord.com/api/unified-login/backend',\n };\n events = {\n loginstatechange: 'loginstatechange',\n };\n endpoints = {\n authorizationEndpoint: `/authorization`,\n tokenExchangeEndpoint: `/token`,\n userInfoEndpoint: `/user`,\n logoutEndpoint: `/logout`,\n };\n keys = {\n tokensource: 'tokensource',\n token: 'token',\n accessToken: 'accessToken',\n user: 'user',\n expire: 'expire',\n expireDate: 'expiredate',\n };\n overridetokenValue = 'overridetokenValue';\n siteUrl: String = window.location.origin;\n abortSignalForLoginCheck = null;\n loginCheckInProgress = false;\n loginCheckTimer = null;\n\n constructor(options: IMarketWebLoginManagerOptions = null) {\n if (!options) {\n return;\n }\n this.eventTarget = options.eventTarget ? options.eventTarget : this.eventTarget;\n this.endpoint = options.endpoint ? options.endpoint : `${window.location.protocol}//${window.location.host}`;\n this.storagePrefix ??= options.storagePrefix;\n this.checkUserLoggedInStateInterval =\n options.checkUserLoggedInStateInterval && options.checkUserLoggedInStateInterval > 0 ? parseInt(options.checkUserLoggedInStateInterval + '', 10) : 0;\n\n if (options.userInfo) {\n this.store.set(this.keys.user, options.userInfo);\n this.registerToken(this.overridetokenValue, 'override');\n }\n }\n init(checkParameters: boolean = true) {\n if (checkParameters) {\n this.checkParameters();\n this.checkPNTopbar();\n this.checkExpireTime();\n\n if (this.store.get(this.keys.token) && !this.store.get(this.keys.user)) {\n this.fetchUserInfo();\n }\n\n this.loginStateChange();\n\n if (this.checkUserLoggedInStateInterval > 0) {\n this.initiateLoggedInCheck();\n }\n }\n }\n setSiteUrl(siteUrl) {\n if (siteUrl) {\n this.siteUrl = siteUrl;\n }\n }\n initiateLoggedInCheck() {\n if (this.isLoggedIn()) {\n if (window && window['AbortController']) {\n this.abortSignalForLoginCheck = new AbortController();\n }\n this.loginCheckTimer = window.setInterval(() => {\n this.doExternalLoggedInCheck()\n .then(() => {})\n .catch(() => {});\n }, this.checkUserLoggedInStateInterval);\n }\n }\n\n async doExternalLoggedInCheck() {\n if (!window.navigator.onLine) {\n // Don't check if the user is not online\n return;\n }\n if (!this.getToken()) {\n window.clearInterval(this.checkUserLoggedInStateInterval);\n return;\n }\n if (this.loginCheckInProgress && this.abortSignalForLoginCheck) {\n this.abortSignalForLoginCheck.abort();\n this.abortSignalForLoginCheck = new AbortController();\n }\n this.loginCheckInProgress = true;\n const reqConfig: RequestInit = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': this.getToken(),\n },\n };\n if (this.abortSignalForLoginCheck && this.abortSignalForLoginCheck['signal']) {\n reqConfig['signal'] = this.abortSignalForLoginCheck['signal'];\n }\n const response = await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`, reqConfig);\n if (response.status === 409) {\n // This is a status the API returns if a user has been logged out\n window.clearInterval(this.checkUserLoggedInStateInterval);\n console.log('Cleared out user data due to bad response from authentication endpoint');\n this.LogoutUser();\n return;\n }\n if (!response.ok) {\n // The response was \"bad\". This could be due to bad connectivity or something else.\n // We'll ignore it so we don't unecessarily log users out or have them loose state if they're switching connection\n return;\n }\n const data = await response.json();\n if (!data || !data['accessToken']) {\n window.clearInterval(this.checkUserLoggedInStateInterval);\n console.log('Cleared out user data due to bad response from authentication endpoint');\n this.LogoutUser();\n }\n this.loginCheckInProgress = false;\n }\n LogoutUser() {\n this.clearUserData();\n\n // Log out user\n if (this.eventTarget) {\n const logoutLink = (this.eventTarget as HTMLElement).querySelector('#pn-marketweb-header-logoutlink');\n if (logoutLink) {\n (logoutLink as HTMLAnchorElement).click();\n return;\n }\n }\n\n this.loginStateChange();\n \n // If no logout link was found, attempt to change URL to redirect link\n const currentPageHref = window.location.href;\n window.location.href = this.getLogoutUrl(currentPageHref);\n }\n\n isLoggedIn(override = false) {\n if (override) {\n return override;\n }\n\n let isLoggedIn = this.store.get(this.keys.token) && this.store.get(this.keys.user) ? true : false;\n if (!isLoggedIn && this.store.get(this.keys.token) === this.overridetokenValue) {\n isLoggedIn = true;\n }\n return isLoggedIn;\n }\n\n registerToken(token: string = '', tokenSource = 'frontend') {\n if (!token || token === this.getToken()) {\n return;\n }\n this.clearUserData();\n this.store.set(this.keys.tokensource, tokenSource);\n this.store.set(this.keys.token, token);\n this.fetchUserInfo();\n }\n\n invalidateTokenOfType(tokenSource: string = 'frontend') {\n const currentToken = this.store.get(this.keys.token);\n if (!currentToken) {\n return;\n }\n const currentTokenSource = this.store.get(this.keys.tokensource);\n if (currentTokenSource !== tokenSource) {\n return;\n }\n // If we have a token and the source is set then we will invalidate the user data\n this.clearUserData();\n }\n\n getLoginUrl(redirectPage = '') {\n const currentPage = window.location.href;\n redirectPage = redirectPage ? redirectPage : currentPage;\n return `${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${redirectPage}`;\n }\n\n getLogoutUrl(linkHref = '') {\n if (linkHref.indexOf('logout?logoutUrl') !== -1) {\n // Link has already been formatted.\n return linkHref;\n }\n let redirectPage = linkHref\n .replace('logout', '')\n .replace('http://window.location.href/?', window.location.href)\n .replace('https://window.location.href/?', window.location.href);\n let rootUrl = this.siteUrl;\n try {\n const url = new URL(this.siteUrl + '');\n rootUrl = url.origin;\n } catch (e) {}\n const addSlash = rootUrl.lastIndexOf('/') !== rootUrl.length - 1;\n const siteUrl = rootUrl + (addSlash ? '/' : '') + 'logout';\n const secondLogoutUrl = `${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?authorization=${this.store.get(this.keys.token)}%26redirectionUrl=${redirectPage}`;\n const logoutUrl = `${siteUrl}?logoutUrl=${secondLogoutUrl}`;\n\n return logoutUrl;\n }\n\n getUserInfo() {\n if (this.isLoggedIn()) {\n return this.store.get(this.keys.user) as IUserInfo;\n }\n }\n\n getEventTarget() {\n return this.eventTarget;\n }\n\n private checkExpireTime() {\n const expire = this.store.get(this.keys.expire);\n if (!expire) {\n return;\n }\n const now = new Date();\n const expireDate = new Date(Math.floor(parseInt(expire, 10) * 1000));\n if (now > expireDate) {\n console.info('Login time has expired');\n this.clearUserData();\n this.loginStateChange();\n }\n }\n private checkPNTopbar() {\n if (this.isLoggedIn() || !window['pnTopbar'] || !window['pnTopbar']['session_id']) {\n return;\n }\n\n this.store.set(this.keys.token, window['pnTopbar']['session_id']);\n this.fetchUserInfo();\n }\n\n private checkParameters() {\n if (!window?.location) {\n return;\n }\n\n const params = new URLSearchParams(window.location.search);\n if (params.get('oneTimeCode')) {\n const oneTimeCode = params.get('oneTimeCode');\n\n this.exchangeToken(oneTimeCode).then(() => {\n const currentHref = window.location.href;\n const paramPrefix = currentHref.indexOf('?oneTimeCode') !== -1 ? '?' : '&';\n const newUrl = currentHref.replace(`${paramPrefix}oneTimeCode=${oneTimeCode}`, '');\n history.replaceState({}, document.querySelector('title').innerText, newUrl);\n });\n }\n }\n\n private async fetchUserInfo() {\n const token = this.store.get(this.keys.token);\n if (this.store.get(this.keys.token) === this.overridetokenValue) {\n console.info('Did not fetch user data since it was set by an override');\n return;\n }\n const reqConfig: RequestInit = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': token,\n },\n };\n const response = await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`, reqConfig);\n const data = await response.json();\n if (data && data['idToken']) {\n try {\n const { idToken, expiryTime, accessToken } = data;\n const userInfo = this.parseUserInfo(idToken);\n if (!userInfo) {\n console.error('Userdata is not valid');\n this.clearUserData();\n return;\n }\n this.store.set(this.keys.user, userInfo);\n // 10 Min early expire\n this.store.set(this.keys.accessToken, accessToken);\n this.store.set(this.keys.expire, expiryTime);\n this.store.set(this.keys.expireDate, new Date(Math.floor(parseInt(expiryTime, 10) * 1000)));\n this.loginStateChange();\n } catch (e) {\n console.error('Unable to get user information', e);\n }\n } else {\n console.error('Unable to get user information. Clearing login state');\n this.clearUserData();\n }\n }\n clearUserData() {\n this.store.remove(this.keys.user);\n this.store.remove(this.keys.tokensource);\n this.store.remove(this.keys.accessToken);\n this.store.remove(this.keys.token);\n this.store.remove(this.keys.expire);\n this.store.remove(this.keys.expireDate);\n }\n getToken() {\n return this.store.get(this.keys.token);\n }\n getAccessToken() {\n return this.store.get(this.keys.accessToken);\n }\n async exchangeToken(oneTimeCode) {\n this.clearUserData();\n const response = await fetch(`${this.getBaseUrl()}${this.endpoints.tokenExchangeEndpoint}?oneTimeCode=${oneTimeCode}`);\n const { token } = await response.json();\n if (typeof token === 'string' && token) {\n this.store.set(this.keys.token, token);\n }\n this.fetchUserInfo();\n }\n private loginStateChange() {\n if (!this.eventTarget) {\n return;\n }\n this.eventTarget.dispatchEvent(\n new CustomEvent(this.events.loginstatechange, {\n detail: this.isLoggedIn(),\n }),\n );\n }\n private getBaseUrl() {\n const atEnvironments = ['localhost', 'integration.', 'inte.', 'local.','prep.'];\n let useATEnv = atEnvironments.filter(x => this.endpoint.indexOf(x) !== -1).length > 0;\n if (['devportal.postnord.com', 'atportal.postnord.com'].indexOf(window.location.hostname) !== -1) {\n useATEnv = true;\n }\n if (useATEnv) {\n return this.baseUrls.at;\n }\n return this.baseUrls.prod;\n }\n\n private parseUserInfo(idToken: string) {\n if (!idToken) {\n return null;\n }\n var base64Url = idToken.split('.')[1];\n var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n var jsonPayload = decodeURIComponent(\n atob(base64)\n .split('')\n .map(function (c) {\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n })\n .join(''),\n );\n return JSON.parse(jsonPayload);\n }\n\n store = {\n get: (key: string) => {\n const value = window.localStorage.getItem(`${this.storagePrefix}-${key}`);\n if (!value) {\n return value;\n }\n if (value.indexOf('{') === 0) {\n try {\n return JSON.parse(value);\n } catch (e) {}\n }\n if (value.indexOf(',') !== -1) {\n return value.split(',');\n }\n return value;\n },\n set: (key: string, value: any) => {\n if (typeof value === 'object' && typeof value.length === 'undefined') {\n window.localStorage.setItem(`${this.storagePrefix}-${key}`, JSON.stringify(value));\n return;\n }\n window.localStorage.setItem(`${this.storagePrefix}-${key}`, value);\n },\n remove: (key: string) => {\n window.localStorage.removeItem(`${this.storagePrefix}-${key}`);\n },\n };\n}\n\ninterface IMarketWebLoginManagerOptions {\n eventTarget?: EventTarget;\n endpoint?: String;\n storagePrefix?: String;\n userInfo?: IUserInfo;\n checkUserLoggedInStateInterval?: number;\n}\n\ninterface IUserInfo {\n acr?: string;\n ams?: string[];\n at_hash?: string;\n aud?: string;\n auth_time?: number;\n created_at?: number;\n email?: string;\n email_verifier?: true;\n emails?: IUserInfoEmail[];\n exp?: number;\n family_name?: string;\n given_name?: string;\n iat?: number;\n iss?: string;\n jti?: string;\n nonce?: string;\n phone_number?: string;\n phone_number_verified?: boolean;\n phone_number_verified_at?: string;\n phone_numbers?: IUserInfoPhonenumber[];\n rat?: number;\n sid?: string;\n sub?: string;\n uas_status?: number;\n userId?: string;\n username?: string;\n}\n\ninterface IUserInfoEmail {\n email: string;\n verifiet_at: number;\n}\ninterface IUserInfoPhonenumber {\n phone_number: string;\n verifiet_at: string;\n}\n\nexport { MarketWebLoginManager, IMarketWebLoginManagerOptions, IUserInfo };\n","@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$siteheader-login-padding: 1rem 0;\n$siteheader-login-max-height: 5.2rem;\n\n$siteheader-login-dropdown-max-width: 350px;\n$siteheader-login-dropdown-gap: 2.4rem;\n$siteheader-login-dropdown-padding: 4rem;\n\n$siteheader-login-divider-height: 2px;\n$siteheader-login-divider-margin: 2.4rem;\n\n$siteheader-login-text-font-size: 1.4rem;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login {\n --login-dropdown-divider-background: var(--siteheader-login-dropdown-divider-background,\n #{$gray25});\n --login-dropdown-text-color: var(--siteheader-login-dropdown-text-color,\n #{$gray900});\n --login-dropdown-link-color: var(--siteheader-login-dropdown-link-color,\n #{$blue700});\n --login-dropdown-link-hover-decoration: var(--siteheader-login-dropdown-link-hover-decoration,\n underline);\n --login-dark-icon-hover-fill: var(--siteheader-login-dark-icon-hover-fill,\n #{$black});\n\n padding: $siteheader-login-padding;\n max-height: $siteheader-login-max-height;\n position: relative;\n\n // Example of how we could indicate username in smaller viewports\n // .siteheader-topright & {\n // &[username] {\n // &:hover {\n // &::after {\n // content: attr(username);\n // display: block;\n // position: absolute;\n // z-index: 4;\n // background: $white;\n // border: .1rem solid $blue700;\n // border-radius: .8rem;\n // padding: 0.5rem 0.9rem;\n // margin-top: 0.8rem;\n // left: 50%;\n // transform: translateX(-50%);\n //\n // @media screen and (min-width: $siteheader-media-smalldesktop) {\n // content: '';\n // display: none;\n // }\n // }\n // }\n // }\n // }\n\n pn-button-dropdown {\n display: none;\n\n .pn-button-dropdown-container {\n .pn-button-dropdown-content {\n max-width: $siteheader-login-dropdown-max-width;\n display: flex;\n flex-direction: column;\n gap: $siteheader-login-dropdown-gap;\n padding: $siteheader-login-dropdown-padding;\n\n pn-button {\n width: 100%;\n }\n\n pn-marketweb-siteheader-unified-login {\n &::after {\n display: block;\n content: '';\n width: 100%;\n height: $siteheader-login-divider-height;\n margin-top: $siteheader-login-divider-margin;\n background: var(--login-dropdown-divider-background);\n }\n }\n\n span {\n font-size: $siteheader-login-text-font-size;\n color: var(--login-dropdown-text-color);\n\n &::before {\n display: block;\n content: '';\n width: 100%;\n height: $siteheader-login-divider-height;\n background: var(--login-dropdown-divider-background);\n }\n\n a {\n text-decoration: none;\n color: var(--login-dropdown-link-color);\n\n &:hover {\n text-decoration: var(--login-dropdown-link-hover-decoration);\n }\n }\n\n * {\n margin-bottom: 0;\n }\n }\n }\n }\n }\n\n &.hydrated {\n pn-button-dropdown {\n display: block;\n }\n }\n}\n\n// -----------------------------------------------------------------------------\n// Appearance overrides\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login[appearance='dark'] {\n button:hover {\n pn-icon {\n svg path {\n fill: var(--login-dark-icon-hover-fill);\n }\n }\n }\n}","import { user } from 'pn-design-assets/pn-assets/icons.js';\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport {\n IUserInfo,\n MarketWebLoginManager,\n} from '../../../globals/MarketWebLoginManager';\nimport { HeaderAppearance } from '../pn-marketweb-header/utils/header-theme';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport {\n LoginDialog,\n SiteHeaderI18N,\n} from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login',\n styleUrl: 'pn-marketweb-siteheader-login.scss',\n})\nexport class PnMarketwebSiteheaderLogin {\n @Element() hostElement: HTMLElement;\n /** Specifies which endpoint domain we should load from */\n @Prop() endpoint: string = '';\n /** Access token passed from backend */\n @Prop() token: string = '';\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n unifiedLoginButton: '',\n unifiedMyPagesButton: '',\n } as SiteHeaderI18N;\n\n @Prop() siteUrl: string = '';\n @Prop() emitEvents: boolean = true;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n\n /** User Fullname */\n @Prop() fullname: string = '';\n @Prop() loggedin: boolean = false;\n\n /** If this is selected we will show the new profile selection dropdown instead of the login version */\n @Prop({ mutable: true }) showProfileSelection: boolean = false;\n\n /** if this is selected we will show the unifiedlogin button along with new look for dropdown */\n @Prop() showUnifiedLogin: boolean = false;\n\n /** Continiously check if a user is logged in **/\n @Prop({}) checkUserLoggedInStateInterval: number = 0;\n\n @Prop() environment?: string;\n\n @Prop({ mutable: true, reflect: true }) appearance?: HeaderAppearance = 'light';\n\n @State() loginLinks: [];\n\n @State() toggleButtonText: string = this.loginDialog?.loginMenuLinkText ? this.loginDialog.loginMenuLinkText : '';\n\n @State() username: string = this.fullname;\n\n @Prop() useMarketwebLogin: boolean;\n\n // Events\n @Event() loginStateChange: EventEmitter;\n\n componentWillLoad() {\n const userInfo: IUserInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;\n headerState.loginManager = new MarketWebLoginManager({\n endpoint: this.endpoint,\n eventTarget: this.hostElement as EventTarget,\n checkUserLoggedInStateInterval: this.checkUserLoggedInStateInterval,\n userInfo,\n });\n headerState.loginManager.setSiteUrl(this.siteUrl);\n this.hostElement['loginmanager'] = headerState.loginManager;\n if (this.token) {\n headerState.loginManager.registerToken(this.token, 'backend');\n } else if (this.emitEvents) {\n // The primary login instance\n headerState.loginManager.invalidateTokenOfType('backend');\n }\n this.hostElement.addEventListener(headerState.loginManager.events.loginstatechange, this.onLoginStateChange.bind(this));\n this.init();\n this.setUserName();\n this.setToggleButtonText();\n }\n\n @Watch('i18n')\n @Watch('loginDialog')\n async init() {\n headerState.loginManager.init(this.emitEvents);\n this.setToggleButtonText();\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog?.loginMenuLinks) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.pageLink);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n return link;\n };\n if (this.loginDialog) {\n this.loginDialog.loginMenuLinks = this.loginDialog.loginMenuLinks.map(adjustLink);\n this.loginDialog.loggedInLinks = this.loginDialog.loggedInLinks.map(adjustLink);\n }\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n setUserName() {\n const userInfo = headerState.loginManager.getUserInfo();\n let name = '';\n if (!this.loggedin || !userInfo) {\n this.username = name;\n }\n if (userInfo && userInfo.given_name) {\n name = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n\n if (!name && userInfo && userInfo.email) {\n name = userInfo.email;\n }\n if (!name && this.fullname) {\n name = this.fullname;\n }\n\n this.username = name;\n\n this.adjustLoginLinks();\n }\n\n setToggleButtonText() {\n if (this.loggedin) {\n this.toggleButtonText = this.username;\n if (!this.toggleButtonText) {\n this.toggleButtonText = this.loginDialog.loggedInButtonText;\n }\n } else {\n this.toggleButtonText = this.loginDialog.loginMenuLinkText;\n }\n }\n\n onLoginStateChange(e: CustomEvent) {\n if (this.loggedin !== e.detail && this.emitEvents) {\n this.loggedin = e.detail;\n this.loginStateChange.emit({ loggedIn: this.loggedin, token: headerState.loginManager.getToken() });\n this.setUserName();\n this.setToggleButtonText();\n }\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: 'false',\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin + '';\n }\n return (\n <Host {...hostElementAttribute}>\n <pn-button-dropdown label={this.toggleButtonText} icon={user} appearance={this.appearance} variant=\"borderless\" class=\"siteheader-logindialog\">\n {this.showUnifiedLogin && !this.loggedin && (\n <pn-marketweb-siteheader-unified-login\n loggedIn={this.loggedin}\n logInLabel={this.i18n.unifiedLoginButton}\n useMarketwebLogin={this.useMarketwebLogin}\n environment={this.environment}\n />\n )}\n {this.loggedin && this.showProfileSelection ? (\n <pn-marketweb-siteheader-login-profileselection\n loginDialog={this.loginDialog}\n loggedin={this.loggedin}\n i18n={this.i18n}\n idNamespace={this.emitEvents ? '1' : '2'}\n endpoint={this.endpoint}\n ></pn-marketweb-siteheader-login-profileselection>\n ) : (\n <pn-marketweb-siteheader-login-links\n loginDialog={this.loginDialog}\n loggedin={this.loggedin}\n idNamespace={this.emitEvents ? '1' : '2'}\n username={this.username}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-links>\n )}\n {!this.loggedin && this.loginDialog?.loginInfo && (<span innerHTML={`${this.loginDialog.loginInfo}`} />)}\n </pn-button-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"pn-marketweb-siteheader-login2.js","mappings":";;;;;;;AAAA,MAAM,IAAI,GAAG,0xBAA0xB,CAAC;AACjyB,MAAM,IAAI,GAAG,IAAI;;ACDxB,MAAM,qBAAqB;IACzB,WAAW,GAAgB,MAAM,IAAI,QAAQ,EAAE,IAAI,CAAC;IACpD,QAAQ,GAAW,EAAE,CAAC;IACtB,aAAa,GAAW,SAAS,CAAC;IAClC,8BAA8B,GAAW,CAAC,CAAC;IAC3C,QAAQ,GAAG;QACT,EAAE,EAAE,yDAAyD;QAC7D,IAAI,EAAE,uDAAuD;KAC9D,CAAC;IACF,MAAM,GAAG;QACP,gBAAgB,EAAE,kBAAkB;KACrC,CAAC;IACF,SAAS,GAAG;QACV,qBAAqB,EAAE,gBAAgB;QACvC,qBAAqB,EAAE,QAAQ;QAC/B,gBAAgB,EAAE,OAAO;QACzB,cAAc,EAAE,SAAS;KAC1B,CAAC;IACF,IAAI,GAAG;QACL,WAAW,EAAE,aAAa;QAC1B,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,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,6CACE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,kBAAkB,EACxC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,EACzC,WAAW,EAAE,IAAI,CAAC,WAAW,GAC7B,CACH,EACA,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,oBAAoB,IACzC,sDACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,WAAW,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,GAAG,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,GACyB,KAElD,2CACE,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,WAAW,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,GAAG,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,GACF,CACxC,EACA,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,WAAW,EAAE,SAAS,KAAK,YAAM,SAAS,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,EAAE,GAAI,CAAC,CACrF,CAChB,EACP;KACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["headerState"],"sources":["node_modules/pn-design-assets/pn-assets/icons/user.js","src/globals/MarketWebLoginManager.ts","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.scss?tag=pn-marketweb-siteheader-login","src/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.tsx"],"sourcesContent":["const icon = '<svg class=\"pn-icon-svg\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\"><path fill=\"#000\" fill-rule=\"evenodd\" d=\"M7.5 7.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0M12 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4.928 20.372a1 1 0 0 1-1.856-.743l.883.353a82 82 0 0 1-.883-.354v-.002l.001-.002.003-.007.008-.018a4 4 0 0 1 .114-.25c.078-.161.193-.383.35-.645.315-.523.8-1.217 1.495-1.911C6.444 15.39 8.688 14 12 14s5.556 1.391 6.957 2.793a10 10 0 0 1 1.494 1.911 8 8 0 0 1 .44.837q.016.036.025.058l.008.018.003.007.001.004-.883.354.883-.353a1 1 0 0 1-1.856.744v.001l.001.001v-.002a2 2 0 0 0-.07-.15 6 6 0 0 0-.267-.49 8 8 0 0 0-1.193-1.526C16.444 17.11 14.688 16 12 16s-4.444 1.109-5.543 2.207a8 8 0 0 0-1.193 1.526 6 6 0 0 0-.336.64m0 0-.001.003zm14.144.001\" clip-rule=\"evenodd\"/></svg>';\nexport const user = icon;\n","class MarketWebLoginManager {\n eventTarget: EventTarget = window ?? document?.body;\n endpoint: String = '';\n storagePrefix: String = 'pn-user';\n checkUserLoggedInStateInterval: number = 0;\n baseUrls = {\n at: 'https://atportal.postnord.com/api/unified-login/backend',\n prod: 'https://portal.postnord.com/api/unified-login/backend',\n };\n events = {\n loginstatechange: 'loginstatechange',\n };\n endpoints = {\n authorizationEndpoint: `/authorization`,\n tokenExchangeEndpoint: `/token`,\n userInfoEndpoint: `/user`,\n logoutEndpoint: `/logout`,\n };\n keys = {\n tokensource: 'tokensource',\n token: 'token',\n accessToken: 'accessToken',\n user: 'user',\n expire: 'expire',\n expireDate: 'expiredate',\n };\n overridetokenValue = 'overridetokenValue';\n siteUrl: String = window.location.origin;\n abortSignalForLoginCheck = null;\n loginCheckInProgress = false;\n loginCheckTimer = null;\n\n constructor(options: IMarketWebLoginManagerOptions = null) {\n if (!options) {\n return;\n }\n this.eventTarget = options.eventTarget ? options.eventTarget : this.eventTarget;\n this.endpoint = options.endpoint ? options.endpoint : `${window.location.protocol}//${window.location.host}`;\n this.storagePrefix ??= options.storagePrefix;\n this.checkUserLoggedInStateInterval =\n options.checkUserLoggedInStateInterval && options.checkUserLoggedInStateInterval > 0 ? parseInt(options.checkUserLoggedInStateInterval + '', 10) : 0;\n\n if (options.userInfo) {\n this.store.set(this.keys.user, options.userInfo);\n this.registerToken(this.overridetokenValue, 'override');\n }\n }\n init(checkParameters: boolean = true) {\n if (checkParameters) {\n this.checkParameters();\n this.checkPNTopbar();\n this.checkExpireTime();\n\n if (this.store.get(this.keys.token) && !this.store.get(this.keys.user)) {\n this.fetchUserInfo();\n }\n\n this.loginStateChange();\n\n if (this.checkUserLoggedInStateInterval > 0) {\n this.initiateLoggedInCheck();\n }\n }\n }\n setSiteUrl(siteUrl) {\n if (siteUrl) {\n this.siteUrl = siteUrl;\n }\n }\n initiateLoggedInCheck() {\n if (this.isLoggedIn()) {\n if (window && window['AbortController']) {\n this.abortSignalForLoginCheck = new AbortController();\n }\n this.loginCheckTimer = window.setInterval(() => {\n this.doExternalLoggedInCheck()\n .then(() => {})\n .catch(() => {});\n }, this.checkUserLoggedInStateInterval);\n }\n }\n\n async doExternalLoggedInCheck() {\n if (!window.navigator.onLine) {\n // Don't check if the user is not online\n return;\n }\n if (!this.getToken()) {\n window.clearInterval(this.checkUserLoggedInStateInterval);\n return;\n }\n if (this.loginCheckInProgress && this.abortSignalForLoginCheck) {\n this.abortSignalForLoginCheck.abort();\n this.abortSignalForLoginCheck = new AbortController();\n }\n this.loginCheckInProgress = true;\n const reqConfig: RequestInit = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': this.getToken(),\n },\n };\n if (this.abortSignalForLoginCheck && this.abortSignalForLoginCheck['signal']) {\n reqConfig['signal'] = this.abortSignalForLoginCheck['signal'];\n }\n const response = await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`, reqConfig);\n if (response.status === 409) {\n // This is a status the API returns if a user has been logged out\n window.clearInterval(this.checkUserLoggedInStateInterval);\n console.log('Cleared out user data due to bad response from authentication endpoint');\n this.LogoutUser();\n return;\n }\n if (!response.ok) {\n // The response was \"bad\". This could be due to bad connectivity or something else.\n // We'll ignore it so we don't unecessarily log users out or have them loose state if they're switching connection\n return;\n }\n const data = await response.json();\n if (!data || !data['accessToken']) {\n window.clearInterval(this.checkUserLoggedInStateInterval);\n console.log('Cleared out user data due to bad response from authentication endpoint');\n this.LogoutUser();\n }\n this.loginCheckInProgress = false;\n }\n LogoutUser() {\n this.clearUserData();\n\n // Log out user\n if (this.eventTarget) {\n const logoutLink = (this.eventTarget as HTMLElement).querySelector('#pn-marketweb-header-logoutlink');\n if (logoutLink) {\n (logoutLink as HTMLAnchorElement).click();\n return;\n }\n }\n\n this.loginStateChange();\n \n // If no logout link was found, attempt to change URL to redirect link\n const currentPageHref = window.location.href;\n window.location.href = this.getLogoutUrl(currentPageHref);\n }\n\n isLoggedIn(override = false) {\n if (override) {\n return override;\n }\n\n let isLoggedIn = this.store.get(this.keys.token) && this.store.get(this.keys.user) ? true : false;\n if (!isLoggedIn && this.store.get(this.keys.token) === this.overridetokenValue) {\n isLoggedIn = true;\n }\n return isLoggedIn;\n }\n\n registerToken(token: string = '', tokenSource = 'frontend') {\n if (!token || token === this.getToken()) {\n return;\n }\n this.clearUserData();\n this.store.set(this.keys.tokensource, tokenSource);\n this.store.set(this.keys.token, token);\n this.fetchUserInfo();\n }\n\n invalidateTokenOfType(tokenSource: string = 'frontend') {\n const currentToken = this.store.get(this.keys.token);\n if (!currentToken) {\n return;\n }\n const currentTokenSource = this.store.get(this.keys.tokensource);\n if (currentTokenSource !== tokenSource) {\n return;\n }\n // If we have a token and the source is set then we will invalidate the user data\n this.clearUserData();\n }\n\n getLoginUrl(redirectPage = '') {\n const currentPage = window.location.href;\n redirectPage = redirectPage ? redirectPage : currentPage;\n return `${this.getBaseUrl()}${this.endpoints.authorizationEndpoint}?redirectionUrl=${redirectPage}`;\n }\n\n getLogoutUrl(linkHref = '') {\n if (linkHref.indexOf('logout?logoutUrl') !== -1) {\n // Link has already been formatted.\n return linkHref;\n }\n let redirectPage = linkHref\n .replace('logout', '')\n .replace('http://window.location.href/?', window.location.href)\n .replace('https://window.location.href/?', window.location.href);\n let rootUrl = this.siteUrl;\n try {\n const url = new URL(this.siteUrl + '');\n rootUrl = url.origin;\n } catch (e) {}\n const addSlash = rootUrl.lastIndexOf('/') !== rootUrl.length - 1;\n const siteUrl = rootUrl + (addSlash ? '/' : '') + 'logout';\n const secondLogoutUrl = `${this.getBaseUrl()}${this.endpoints.logoutEndpoint}?authorization=${this.store.get(this.keys.token)}%26redirectionUrl=${redirectPage}`;\n const logoutUrl = `${siteUrl}?logoutUrl=${secondLogoutUrl}`;\n\n return logoutUrl;\n }\n\n getUserInfo() {\n if (this.isLoggedIn()) {\n return this.store.get(this.keys.user) as IUserInfo;\n }\n }\n\n getEventTarget() {\n return this.eventTarget;\n }\n\n private checkExpireTime() {\n const expire = this.store.get(this.keys.expire);\n if (!expire) {\n return;\n }\n const now = new Date();\n const expireDate = new Date(Math.floor(parseInt(expire, 10) * 1000));\n if (now > expireDate) {\n console.info('Login time has expired');\n this.clearUserData();\n this.loginStateChange();\n }\n }\n private checkPNTopbar() {\n if (this.isLoggedIn() || !window['pnTopbar'] || !window['pnTopbar']['session_id']) {\n return;\n }\n\n this.store.set(this.keys.token, window['pnTopbar']['session_id']);\n this.fetchUserInfo();\n }\n\n private checkParameters() {\n if (!window?.location) {\n return;\n }\n\n const params = new URLSearchParams(window.location.search);\n if (params.get('oneTimeCode')) {\n const oneTimeCode = params.get('oneTimeCode');\n\n this.exchangeToken(oneTimeCode).then(() => {\n const currentHref = window.location.href;\n const paramPrefix = currentHref.indexOf('?oneTimeCode') !== -1 ? '?' : '&';\n const newUrl = currentHref.replace(`${paramPrefix}oneTimeCode=${oneTimeCode}`, '');\n history.replaceState({}, document.querySelector('title').innerText, newUrl);\n });\n }\n }\n\n private async fetchUserInfo() {\n const token = this.store.get(this.keys.token);\n if (this.store.get(this.keys.token) === this.overridetokenValue) {\n console.info('Did not fetch user data since it was set by an override');\n return;\n }\n const reqConfig: RequestInit = {\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': token,\n },\n };\n const response = await fetch(`${this.getBaseUrl()}${this.endpoints.userInfoEndpoint}`, reqConfig);\n const data = await response.json();\n if (data && data['idToken']) {\n try {\n const { idToken, expiryTime, accessToken } = data;\n const userInfo = this.parseUserInfo(idToken);\n if (!userInfo) {\n console.error('Userdata is not valid');\n this.clearUserData();\n return;\n }\n this.store.set(this.keys.user, userInfo);\n // 10 Min early expire\n this.store.set(this.keys.accessToken, accessToken);\n this.store.set(this.keys.expire, expiryTime);\n this.store.set(this.keys.expireDate, new Date(Math.floor(parseInt(expiryTime, 10) * 1000)));\n this.loginStateChange();\n } catch (e) {\n console.error('Unable to get user information', e);\n }\n } else {\n console.error('Unable to get user information. Clearing login state');\n this.clearUserData();\n }\n }\n clearUserData() {\n this.store.remove(this.keys.user);\n this.store.remove(this.keys.tokensource);\n this.store.remove(this.keys.accessToken);\n this.store.remove(this.keys.token);\n this.store.remove(this.keys.expire);\n this.store.remove(this.keys.expireDate);\n }\n getToken() {\n return this.store.get(this.keys.token);\n }\n getAccessToken() {\n return this.store.get(this.keys.accessToken);\n }\n async exchangeToken(oneTimeCode) {\n this.clearUserData();\n const response = await fetch(`${this.getBaseUrl()}${this.endpoints.tokenExchangeEndpoint}?oneTimeCode=${oneTimeCode}`);\n const { token } = await response.json();\n if (typeof token === 'string' && token) {\n this.store.set(this.keys.token, token);\n }\n this.fetchUserInfo();\n }\n private loginStateChange() {\n if (!this.eventTarget) {\n return;\n }\n this.eventTarget.dispatchEvent(\n new CustomEvent(this.events.loginstatechange, {\n detail: this.isLoggedIn(),\n }),\n );\n }\n private getBaseUrl() {\n const atEnvironments = ['localhost', 'integration.', 'inte.', 'local.','prep.'];\n let useATEnv = atEnvironments.filter(x => this.endpoint.indexOf(x) !== -1).length > 0;\n if (['devportal.postnord.com', 'atportal.postnord.com'].indexOf(window.location.hostname) !== -1) {\n useATEnv = true;\n }\n if (useATEnv) {\n return this.baseUrls.at;\n }\n return this.baseUrls.prod;\n }\n\n private parseUserInfo(idToken: string) {\n if (!idToken) {\n return null;\n }\n var base64Url = idToken.split('.')[1];\n var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n var jsonPayload = decodeURIComponent(\n atob(base64)\n .split('')\n .map(function (c) {\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n })\n .join(''),\n );\n return JSON.parse(jsonPayload);\n }\n\n store = {\n get: (key: string) => {\n const value = window.localStorage.getItem(`${this.storagePrefix}-${key}`);\n if (!value) {\n return value;\n }\n if (value.indexOf('{') === 0) {\n try {\n return JSON.parse(value);\n } catch (e) {}\n }\n if (value.indexOf(',') !== -1) {\n return value.split(',');\n }\n return value;\n },\n set: (key: string, value: any) => {\n if (typeof value === 'object' && typeof value.length === 'undefined') {\n window.localStorage.setItem(`${this.storagePrefix}-${key}`, JSON.stringify(value));\n return;\n }\n window.localStorage.setItem(`${this.storagePrefix}-${key}`, value);\n },\n remove: (key: string) => {\n window.localStorage.removeItem(`${this.storagePrefix}-${key}`);\n },\n };\n}\n\ninterface IMarketWebLoginManagerOptions {\n eventTarget?: EventTarget;\n endpoint?: String;\n storagePrefix?: String;\n userInfo?: IUserInfo;\n checkUserLoggedInStateInterval?: number;\n}\n\ninterface IUserInfo {\n acr?: string;\n ams?: string[];\n at_hash?: string;\n aud?: string;\n auth_time?: number;\n created_at?: number;\n email?: string;\n email_verifier?: true;\n emails?: IUserInfoEmail[];\n exp?: number;\n family_name?: string;\n given_name?: string;\n iat?: number;\n iss?: string;\n jti?: string;\n nonce?: string;\n phone_number?: string;\n phone_number_verified?: boolean;\n phone_number_verified_at?: string;\n phone_numbers?: IUserInfoPhonenumber[];\n rat?: number;\n sid?: string;\n sub?: string;\n uas_status?: number;\n userId?: string;\n username?: string;\n}\n\ninterface IUserInfoEmail {\n email: string;\n verifiet_at: number;\n}\ninterface IUserInfoPhonenumber {\n phone_number: string;\n verifiet_at: string;\n}\n\nexport { MarketWebLoginManager, IMarketWebLoginManagerOptions, IUserInfo };\n","@import '../../../globals/main.scss';\n@import './pn-marketweb-siteheader-common.scss';\n\n// -----------------------------------------------------------------------------\n// Internal layout / visual constants (SCSS only)\n// -----------------------------------------------------------------------------\n$siteheader-login-padding: 1rem 0;\n$siteheader-login-max-height: 5.2rem;\n\n$siteheader-login-dropdown-max-width: 350px;\n$siteheader-login-dropdown-gap: 2.4rem;\n$siteheader-login-dropdown-padding: 4rem;\n\n$siteheader-login-divider-height: 2px;\n$siteheader-login-divider-margin: 2.4rem;\n\n$siteheader-login-text-font-size: 1.4rem;\n\n// -----------------------------------------------------------------------------\n// Component token defaults (CSS vars - only real override surface)\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login {\n --login-dropdown-divider-background: var(--siteheader-login-dropdown-divider-background,\n #{$gray25});\n --login-dropdown-text-color: var(--siteheader-login-dropdown-text-color,\n #{$gray900});\n --login-dropdown-link-color: var(--siteheader-login-dropdown-link-color,\n #{$blue700});\n --login-dropdown-link-hover-decoration: var(--siteheader-login-dropdown-link-hover-decoration,\n underline);\n --login-dark-icon-hover-fill: var(--siteheader-login-dark-icon-hover-fill,\n #{$black});\n\n padding: $siteheader-login-padding;\n max-height: $siteheader-login-max-height;\n position: relative;\n\n // Example of how we could indicate username in smaller viewports\n // .siteheader-topright & {\n // &[username] {\n // &:hover {\n // &::after {\n // content: attr(username);\n // display: block;\n // position: absolute;\n // z-index: 4;\n // background: $white;\n // border: .1rem solid $blue700;\n // border-radius: .8rem;\n // padding: 0.5rem 0.9rem;\n // margin-top: 0.8rem;\n // left: 50%;\n // transform: translateX(-50%);\n //\n // @media screen and (min-width: $siteheader-media-smalldesktop) {\n // content: '';\n // display: none;\n // }\n // }\n // }\n // }\n // }\n\n pn-button-dropdown {\n display: none;\n\n .pn-button-dropdown-container {\n .pn-button-dropdown-content {\n max-width: $siteheader-login-dropdown-max-width;\n display: flex;\n flex-direction: column;\n gap: $siteheader-login-dropdown-gap;\n padding: $siteheader-login-dropdown-padding;\n\n pn-button {\n width: 100%;\n }\n\n pn-marketweb-siteheader-unified-login {\n &::after {\n display: block;\n content: '';\n width: 100%;\n height: $siteheader-login-divider-height;\n margin-top: $siteheader-login-divider-margin;\n background: var(--login-dropdown-divider-background);\n }\n }\n\n span {\n font-size: $siteheader-login-text-font-size;\n color: var(--login-dropdown-text-color);\n\n a {\n text-decoration: none;\n color: var(--login-dropdown-link-color);\n\n &:hover {\n text-decoration: var(--login-dropdown-link-hover-decoration);\n }\n }\n\n * {\n margin-bottom: 0;\n }\n }\n }\n }\n }\n\n &.hydrated {\n pn-button-dropdown {\n display: block;\n }\n }\n}\n\n// -----------------------------------------------------------------------------\n// Appearance overrides\n// -----------------------------------------------------------------------------\npn-marketweb-siteheader-login[appearance='dark'] {\n button:hover {\n pn-icon {\n svg path {\n fill: var(--login-dark-icon-hover-fill);\n }\n }\n }\n}","import { user } from 'pn-design-assets/pn-assets/icons.js';\n\nimport {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport {\n IUserInfo,\n MarketWebLoginManager,\n} from '../../../globals/MarketWebLoginManager';\nimport { HeaderAppearance } from '../pn-marketweb-header/utils/header-theme';\nimport { state as headerState } from './pn-marketweb-siteheader-store';\nimport {\n LoginDialog,\n SiteHeaderI18N,\n} from './pn-marketweb-siteheader-types';\n\n@Component({\n tag: 'pn-marketweb-siteheader-login',\n styleUrl: 'pn-marketweb-siteheader-login.scss',\n})\nexport class PnMarketwebSiteheaderLogin {\n @Element() hostElement: HTMLElement;\n /** Specifies which endpoint domain we should load from */\n @Prop() endpoint: string = '';\n /** Access token passed from backend */\n @Prop() token: string = '';\n @Prop() i18n: SiteHeaderI18N = {\n searchlabel: '',\n searchplaceholder: '',\n searchbuttontext: '',\n menuHomeButton: '',\n menuGoBackButton: '',\n mainMenuButton: '',\n menuStartButton: '',\n profileSelectionFlyoutHeading: '',\n unifiedLoginButton: '',\n unifiedMyPagesButton: '',\n } as SiteHeaderI18N;\n\n @Prop() siteUrl: string = '';\n @Prop() emitEvents: boolean = true;\n\n // Login dialog\n @Prop({ mutable: true }) loginDialog: LoginDialog = null;\n\n /** User Fullname */\n @Prop() fullname: string = '';\n @Prop() loggedin: boolean = false;\n\n /** If this is selected we will show the new profile selection dropdown instead of the login version */\n @Prop({ mutable: true }) showProfileSelection: boolean = false;\n\n /** if this is selected we will show the unifiedlogin button along with new look for dropdown */\n @Prop() showUnifiedLogin: boolean = false;\n\n /** Continiously check if a user is logged in **/\n @Prop({}) checkUserLoggedInStateInterval: number = 0;\n\n @Prop() environment?: string;\n\n @Prop({ mutable: true, reflect: true }) appearance?: HeaderAppearance = 'light';\n\n @State() loginLinks: [];\n\n @State() toggleButtonText: string = this.loginDialog?.loginMenuLinkText ? this.loginDialog.loginMenuLinkText : '';\n\n @State() username: string = this.fullname;\n\n @Prop() useMarketwebLogin: boolean;\n\n // Events\n @Event() loginStateChange: EventEmitter;\n\n componentWillLoad() {\n const userInfo: IUserInfo = this.loggedin && this.fullname ? { given_name: this.fullname } : null;\n headerState.loginManager = new MarketWebLoginManager({\n endpoint: this.endpoint,\n eventTarget: this.hostElement as EventTarget,\n checkUserLoggedInStateInterval: this.checkUserLoggedInStateInterval,\n userInfo,\n });\n headerState.loginManager.setSiteUrl(this.siteUrl);\n this.hostElement['loginmanager'] = headerState.loginManager;\n if (this.token) {\n headerState.loginManager.registerToken(this.token, 'backend');\n } else if (this.emitEvents) {\n // The primary login instance\n headerState.loginManager.invalidateTokenOfType('backend');\n }\n this.hostElement.addEventListener(headerState.loginManager.events.loginstatechange, this.onLoginStateChange.bind(this));\n this.init();\n this.setUserName();\n this.setToggleButtonText();\n }\n\n @Watch('i18n')\n @Watch('loginDialog')\n async init() {\n headerState.loginManager.init(this.emitEvents);\n this.setToggleButtonText();\n this.adjustLoginLinks();\n }\n adjustLoginLinks() {\n if (!this.loginDialog?.loginMenuLinks) {\n return;\n }\n\n const adjustLink = (link, i) => {\n if (!link.isLogoutLink) {\n link.isLogoutLink = link.pageLink.indexOf('location.href') !== -1 && link.pageLink.indexOf('logout') !== -1;\n }\n if (link.isLogoutLink) {\n link.href = headerState.loginManager.getLogoutUrl(link.pageLink);\n }\n\n if (i === 0 && !link.href) {\n link.href = headerState.loginManager.getLoginUrl();\n link.linkType = 'primary';\n }\n if (link.primaryLinkApperance && !link.linkType) {\n link.linkType = 'primary';\n }\n return link;\n };\n if (this.loginDialog) {\n this.loginDialog.loginMenuLinks = this.loginDialog.loginMenuLinks.map(adjustLink);\n this.loginDialog.loggedInLinks = this.loginDialog.loggedInLinks.map(adjustLink);\n }\n this.loginDialog.legacyLoginLinks = [\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.loginUrl),\n linkText: this.loginDialog.loginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n linkType: 'primary',\n primaryLinkApperance: true,\n },\n {\n href: headerState.loginManager.getLoginUrl(this.loginDialog.registerUrl),\n linkText: this.loginDialog.createLoginLinkText,\n openInNewWindow: false,\n isLogoutLink: false,\n pageLink: null,\n primaryLinkApperance: false,\n },\n ];\n }\n\n setUserName() {\n const userInfo = headerState.loginManager.getUserInfo();\n let name = '';\n if (!this.loggedin || !userInfo) {\n this.username = name;\n }\n if (userInfo && userInfo.given_name) {\n name = userInfo.given_name + (userInfo?.family_name ? ` ${userInfo?.family_name}` : '');\n }\n\n if (!name && userInfo && userInfo.email) {\n name = userInfo.email;\n }\n if (!name && this.fullname) {\n name = this.fullname;\n }\n\n this.username = name;\n\n this.adjustLoginLinks();\n }\n\n setToggleButtonText() {\n if (this.loggedin) {\n this.toggleButtonText = this.username;\n if (!this.toggleButtonText) {\n this.toggleButtonText = this.loginDialog.loggedInButtonText;\n }\n } else {\n this.toggleButtonText = this.loginDialog.loginMenuLinkText;\n }\n }\n\n onLoginStateChange(e: CustomEvent) {\n if (this.loggedin !== e.detail && this.emitEvents) {\n this.loggedin = e.detail;\n this.loginStateChange.emit({ loggedIn: this.loggedin, token: headerState.loginManager.getToken() });\n this.setUserName();\n this.setToggleButtonText();\n }\n }\n\n render() {\n if (!this.loginDialog) {\n return;\n }\n\n let hostElementAttribute = {\n username: null,\n loggedin: 'false',\n };\n if (this.username) {\n hostElementAttribute.username = this.username;\n hostElementAttribute.loggedin = this.loggedin + '';\n }\n return (\n <Host {...hostElementAttribute}>\n <pn-button-dropdown label={this.toggleButtonText} icon={user} appearance={this.appearance} variant=\"borderless\" class=\"siteheader-logindialog\">\n {this.showUnifiedLogin && !this.loggedin && (\n <pn-marketweb-siteheader-unified-login\n loggedIn={this.loggedin}\n logInLabel={this.i18n.unifiedLoginButton}\n useMarketwebLogin={this.useMarketwebLogin}\n environment={this.environment}\n />\n )}\n {this.loggedin && this.showProfileSelection ? (\n <pn-marketweb-siteheader-login-profileselection\n loginDialog={this.loginDialog}\n loggedin={this.loggedin}\n i18n={this.i18n}\n idNamespace={this.emitEvents ? '1' : '2'}\n endpoint={this.endpoint}\n ></pn-marketweb-siteheader-login-profileselection>\n ) : (\n <pn-marketweb-siteheader-login-links\n loginDialog={this.loginDialog}\n loggedin={this.loggedin}\n idNamespace={this.emitEvents ? '1' : '2'}\n username={this.username}\n showUnifiedLogin={this.showUnifiedLogin}\n ></pn-marketweb-siteheader-login-links>\n )}\n {!this.loggedin && this.loginDialog?.loginInfo && (<span innerHTML={`${this.loginDialog.loginInfo}`} />)}\n </pn-button-dropdown>\n </Host>\n );\n }\n}\n"],"version":3}
package/components/v4.js CHANGED
@@ -1,66 +1,67 @@
1
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
2
- // require the crypto API and do not support built-in fallback to lower quality random number
3
- // generators (like Math.random()).
1
+ const byteToHex = [];
2
+ for (let i = 0; i < 256; ++i) {
3
+ byteToHex.push((i + 0x100).toString(16).slice(1));
4
+ }
5
+ function unsafeStringify(arr, offset = 0) {
6
+ return (byteToHex[arr[offset + 0]] +
7
+ byteToHex[arr[offset + 1]] +
8
+ byteToHex[arr[offset + 2]] +
9
+ byteToHex[arr[offset + 3]] +
10
+ '-' +
11
+ byteToHex[arr[offset + 4]] +
12
+ byteToHex[arr[offset + 5]] +
13
+ '-' +
14
+ byteToHex[arr[offset + 6]] +
15
+ byteToHex[arr[offset + 7]] +
16
+ '-' +
17
+ byteToHex[arr[offset + 8]] +
18
+ byteToHex[arr[offset + 9]] +
19
+ '-' +
20
+ byteToHex[arr[offset + 10]] +
21
+ byteToHex[arr[offset + 11]] +
22
+ byteToHex[arr[offset + 12]] +
23
+ byteToHex[arr[offset + 13]] +
24
+ byteToHex[arr[offset + 14]] +
25
+ byteToHex[arr[offset + 15]]).toLowerCase();
26
+ }
27
+
4
28
  let getRandomValues;
5
29
  const rnds8 = new Uint8Array(16);
6
30
  function rng() {
7
- // lazy load so that environments that need to polyfill have a chance to do so
8
- if (!getRandomValues) {
9
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation.
10
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
11
-
12
31
  if (!getRandomValues) {
13
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
32
+ if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
33
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
34
+ }
35
+ getRandomValues = crypto.getRandomValues.bind(crypto);
14
36
  }
15
- }
16
-
17
- return getRandomValues(rnds8);
18
- }
19
-
20
- /**
21
- * Convert array of 16 byte values to UUID string format of the form:
22
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
23
- */
24
-
25
- const byteToHex = [];
26
-
27
- for (let i = 0; i < 256; ++i) {
28
- byteToHex.push((i + 0x100).toString(16).slice(1));
29
- }
30
-
31
- function unsafeStringify(arr, offset = 0) {
32
- // Note: Be careful editing this code! It's been tuned for performance
33
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
34
- return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
37
+ return getRandomValues(rnds8);
35
38
  }
36
39
 
37
40
  const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
38
- const native = {
39
- randomUUID
40
- };
41
+ const native = { randomUUID };
41
42
 
42
43
  function v4(options, buf, offset) {
43
- if (native.randomUUID && !buf && !options) {
44
- return native.randomUUID();
45
- }
46
-
47
- options = options || {};
48
- const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
49
-
50
- rnds[6] = rnds[6] & 0x0f | 0x40;
51
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
52
-
53
- if (buf) {
54
- offset = offset || 0;
55
-
56
- for (let i = 0; i < 16; ++i) {
57
- buf[offset + i] = rnds[i];
44
+ if (native.randomUUID && !buf && !options) {
45
+ return native.randomUUID();
58
46
  }
59
-
60
- return buf;
61
- }
62
-
63
- return unsafeStringify(rnds);
47
+ options = options || {};
48
+ const rnds = options.random ?? options.rng?.() ?? rng();
49
+ if (rnds.length < 16) {
50
+ throw new Error('Random bytes length must be >= 16');
51
+ }
52
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
53
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
54
+ if (buf) {
55
+ offset = offset || 0;
56
+ if (offset < 0 || offset + 16 > buf.length) {
57
+ throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
58
+ }
59
+ for (let i = 0; i < 16; ++i) {
60
+ buf[offset + i] = rnds[i];
61
+ }
62
+ return buf;
63
+ }
64
+ return unsafeStringify(rnds);
64
65
  }
65
66
 
66
67
  export { v4 as v };
@@ -1 +1 @@
1
- {"file":"v4.js","mappings":"AAAA;AACA;AACA;AACA,IAAI,eAAe,CAAC;AACpB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;AAClB,SAAS,GAAG,GAAG;AAC9B;AACA,EAAE,IAAI,CAAC,eAAe,EAAE;AACxB;AACA,IAAI,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrH;AACA,IAAI,IAAI,CAAC,eAAe,EAAE;AAC1B,MAAM,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAC;AAClI,KAAK;AACL,GAAG;AACH;AACA,EAAE,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;AAChC;;AChBA;AACA;AACA;AACA;AACA;AACA,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB;AACA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;AAC9B,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AACD;AACO,SAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE;AACjD;AACA;AACA,EAAE,OAAO,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAA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AAU,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE;AAC7C,IAAI,OAAO,MAAM,CAAC,UAAU,EAAE,CAAC;AAC/B,GAAG;AACH;AACA,EAAE,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;AAC1B,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,GAAG,CAAC;AACxD;AACA,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAClC,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAClC;AACA,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,MAAM,GAAG,MAAM,IAAI,CAAC,CAAC;AACzB;AACA,IAAI,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;AACjC,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAChC,KAAK;AACL;AACA,IAAI,OAAO,GAAG,CAAC;AACf,GAAG;AACH;AACA,EAAE,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAC/B;;;;","names":[],"sources":["node_modules/uuid/dist/esm-browser/rng.js","node_modules/uuid/dist/esm-browser/stringify.js","node_modules/uuid/dist/esm-browser/native.js","node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nlet getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\n\nexport function unsafeStringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];\n}\n\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default {\n randomUUID\n};","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\n\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n\n options = options || {};\n const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return unsafeStringify(rnds);\n}\n\nexport default v4;"],"version":3}
1
+ {"file":"v4.js","mappings":"AACA,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,EAAE;AAC9B,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AACM,SAAS,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,EAAE;AACjD,IAAI,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACtC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,GAAG;AACX,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,GAAG;AACX,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,SAAS,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClC,QAAQ,GAAG;AACX,QAAQ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;","names":[],"sources":["node_modules/uuid/dist/esm-browser/stringify.js","node_modules/uuid/dist/esm-browser/rng.js","node_modules/uuid/dist/esm-browser/native.js","node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import validate from './validate.js';\nconst byteToHex = [];\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).slice(1));\n}\nexport function unsafeStringify(arr, offset = 0) {\n return (byteToHex[arr[offset + 0]] +\n byteToHex[arr[offset + 1]] +\n byteToHex[arr[offset + 2]] +\n byteToHex[arr[offset + 3]] +\n '-' +\n byteToHex[arr[offset + 4]] +\n byteToHex[arr[offset + 5]] +\n '-' +\n byteToHex[arr[offset + 6]] +\n byteToHex[arr[offset + 7]] +\n '-' +\n byteToHex[arr[offset + 8]] +\n byteToHex[arr[offset + 9]] +\n '-' +\n byteToHex[arr[offset + 10]] +\n byteToHex[arr[offset + 11]] +\n byteToHex[arr[offset + 12]] +\n byteToHex[arr[offset + 13]] +\n byteToHex[arr[offset + 14]] +\n byteToHex[arr[offset + 15]]).toLowerCase();\n}\nfunction stringify(arr, offset = 0) {\n const uuid = unsafeStringify(arr, offset);\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n return uuid;\n}\nexport default stringify;\n","let getRandomValues;\nconst rnds8 = new Uint8Array(16);\nexport default function rng() {\n if (!getRandomValues) {\n if (typeof crypto === 'undefined' || !crypto.getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n return getRandomValues(rnds8);\n}\n","const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);\nexport default { randomUUID };\n","import native from './native.js';\nimport rng from './rng.js';\nimport { unsafeStringify } from './stringify.js';\nfunction v4(options, buf, offset) {\n if (native.randomUUID && !buf && !options) {\n return native.randomUUID();\n }\n options = options || {};\n const rnds = options.random ?? options.rng?.() ?? rng();\n if (rnds.length < 16) {\n throw new Error('Random bytes length must be >= 16');\n }\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n if (buf) {\n offset = offset || 0;\n if (offset < 0 || offset + 16 > buf.length) {\n throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n }\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n return buf;\n }\n return unsafeStringify(rnds);\n}\nexport default v4;\n"],"version":3}
@@ -1,7 +1,7 @@
1
1
  import { g as getElement, r as registerInstance, c as createEvent, h, d as Host } from './index-c0a4d8bd.js';
2
2
  import { d as debounce } from './index-1190bec4.js';
3
3
  import { p as plus } from './plus-7ee93ae7.js';
4
- import { v as v4 } from './v4-964634d6.js';
4
+ import { v as v4 } from './v4-08967a5a.js';
5
5
 
6
6
  const translations = {
7
7
  'sv': {