@postnord/pn-marketweb-components 2.0.33 → 2.0.34

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.
@@ -135,7 +135,7 @@ let PnMarketwebSiteheaderLoginProfileselection = class {
135
135
  if (!this.loggedin || !this.profileSelectorDialog || this.profileSelectorDialog.profiles.length > 0) {
136
136
  return;
137
137
  }
138
- let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
138
+ let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
139
139
  const req = await fetch(apiUrl);
140
140
  const reqdata = await req.json();
141
141
  const fallbackData = {
@@ -143,12 +143,14 @@ let PnMarketwebSiteheaderLoginProfileselection = class {
143
143
  profiles: [
144
144
  {
145
145
  name: "Hedin HMC Motor Company AB",
146
- organizationNumber: "5560230053",
146
+ customerNumber: "5560230053",
147
+ id: "7ab29701-5430-1a1a-4557-146bfd2aa35b",
147
148
  selected: false
148
149
  },
149
150
  {
150
151
  name: "Bilmetro AB",
151
- organizationNumber: "5560612789",
152
+ customerNumber: "5560612789",
153
+ id: "43707a2b-8e91-cef1-1907-0c091b907ff3",
152
154
  selected: true
153
155
  }
154
156
  ]
@@ -210,9 +212,9 @@ let PnMarketwebSiteheaderLoginProfileselection = class {
210
212
  return (index.h(index.Host, Object.assign({}, hostElementAttribute), this.heading ? index.h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-user" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-user-name" }, this.userName), ((this.user && this.user.username) && this.userName !== this.user.username) ?
211
213
  index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-user-description" }, this.user.username)
212
214
  : null), this.currentProfile !== null && this.currentProfile.name ?
213
- index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.organizationNumber))
215
+ index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber))
214
216
  : null, index.h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks.filter(x => x.isLogoutLink === false), loginManager: this.loginManager, idNamespace: this.idNamespace }), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileSelectorDialog.profiles.filter(x => x.selected === false).map((profile) => {
215
- return (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, index.h("a", { href: `${this.endpoint}/UnifiedLogin/ExternalLoginCallback?returnUrl=${window.location.href}?profile=${profile.organizationNumber}}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, profile.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.organizationNumber)), index.h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
217
+ return (index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, index.h("a", { href: `${this.endpoint}/api/user/setprofile?profile=${profile.id}&returnUrl=${window.location.href}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" }, index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, profile.name), index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.customerNumber)), index.h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
216
218
  }), this.logoutLink ?
217
219
  index.h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, index.h("a", { href: this.logoutLink.href, rel: "nofollower noopener", class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))
218
220
  : null));
@@ -33,7 +33,7 @@ export class PnMarketwebSiteheaderLoginProfileselection {
33
33
  if (!this.loggedin || !this.profileSelectorDialog || this.profileSelectorDialog.profiles.length > 0) {
34
34
  return;
35
35
  }
36
- let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
36
+ let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
37
37
  const req = await fetch(apiUrl);
38
38
  const reqdata = await req.json();
39
39
  const fallbackData = {
@@ -41,12 +41,14 @@ export class PnMarketwebSiteheaderLoginProfileselection {
41
41
  profiles: [
42
42
  {
43
43
  name: "Hedin HMC Motor Company AB",
44
- organizationNumber: "5560230053",
44
+ customerNumber: "5560230053",
45
+ id: "7ab29701-5430-1a1a-4557-146bfd2aa35b",
45
46
  selected: false
46
47
  },
47
48
  {
48
49
  name: "Bilmetro AB",
49
- organizationNumber: "5560612789",
50
+ customerNumber: "5560612789",
51
+ id: "43707a2b-8e91-cef1-1907-0c091b907ff3",
50
52
  selected: true
51
53
  }
52
54
  ]
@@ -115,16 +117,16 @@ export class PnMarketwebSiteheaderLoginProfileselection {
115
117
  this.currentProfile !== null && this.currentProfile.name ?
116
118
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile" },
117
119
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-name" }, this.currentProfile.name),
118
- h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.organizationNumber))
120
+ h("div", { class: "pn-marketweb-siteheader-login-profileselection-currentprofile-description" }, this.currentProfile.customerNumber))
119
121
  : null,
120
122
  h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks.filter(x => x.isLogoutLink === false), loginManager: this.loginManager, idNamespace: this.idNamespace }),
121
123
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }),
122
124
  this.profileSelectorDialog.profiles.filter(x => x.selected === false).map((profile) => {
123
125
  return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" },
124
- h("a", { href: `${this.endpoint}/UnifiedLogin/ExternalLoginCallback?returnUrl=${window.location.href}?profile=${profile.organizationNumber}}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" },
126
+ h("a", { href: `${this.endpoint}/api/user/setprofile?profile=${profile.id}&returnUrl=${window.location.href}`, class: "pn-marketweb-siteheader-login-profileselection-profileoption-link" },
125
127
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-content" },
126
128
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-name" }, profile.name),
127
- h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.organizationNumber)),
129
+ h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.customerNumber)),
128
130
  h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
129
131
  }),
130
132
  this.logoutLink ?
@@ -1,6 +1,6 @@
1
1
  import readme from "./readme.md";
2
2
 
3
- const usertoken = 'b82b55a20e9f8db91ffee53b0469d85f5005089fcadc3548bb0dd77';
3
+ const usertoken = '0f1214883ec7814037c02e6ce7f4d21191e8cef81faab2628e67031';
4
4
 
5
5
  export default {
6
6
  title: "Web Components/Market web site Header",
@@ -4950,7 +4950,7 @@ let PnMarketwebSiteheaderLoginProfileselection$1 = class extends HTMLElement {
4950
4950
  if (!this.loggedin || !this.profileSelectorDialog || this.profileSelectorDialog.profiles.length > 0) {
4951
4951
  return;
4952
4952
  }
4953
- let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
4953
+ let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
4954
4954
  const req = await fetch(apiUrl);
4955
4955
  const reqdata = await req.json();
4956
4956
  const fallbackData = {
@@ -4958,12 +4958,14 @@ let PnMarketwebSiteheaderLoginProfileselection$1 = class extends HTMLElement {
4958
4958
  profiles: [
4959
4959
  {
4960
4960
  name: "Hedin HMC Motor Company AB",
4961
- organizationNumber: "5560230053",
4961
+ customerNumber: "5560230053",
4962
+ id: "7ab29701-5430-1a1a-4557-146bfd2aa35b",
4962
4963
  selected: false
4963
4964
  },
4964
4965
  {
4965
4966
  name: "Bilmetro AB",
4966
- organizationNumber: "5560612789",
4967
+ customerNumber: "5560612789",
4968
+ id: "43707a2b-8e91-cef1-1907-0c091b907ff3",
4967
4969
  selected: true
4968
4970
  }
4969
4971
  ]
@@ -5025,9 +5027,9 @@ let PnMarketwebSiteheaderLoginProfileselection$1 = class extends HTMLElement {
5025
5027
  return (h(Host, Object.assign({}, hostElementAttribute), this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, h("div", { class: "pn-marketweb-siteheader-login-profileselection-user" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-user-name" }, this.userName), ((this.user && this.user.username) && this.userName !== this.user.username) ?
5026
5028
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-user-description" }, this.user.username)
5027
5029
  : null), this.currentProfile !== null && this.currentProfile.name ?
5028
- 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.organizationNumber))
5030
+ 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))
5029
5031
  : null, h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks.filter(x => x.isLogoutLink === false), loginManager: this.loginManager, idNamespace: this.idNamespace }), h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileSelectorDialog.profiles.filter(x => x.selected === false).map((profile) => {
5030
- return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/UnifiedLogin/ExternalLoginCallback?returnUrl=${window.location.href}?profile=${profile.organizationNumber}}`, 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" }, profile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.organizationNumber)), h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
5032
+ return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?profile=${profile.id}&returnUrl=${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" }, profile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.customerNumber)), h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
5031
5033
  }), this.logoutLink ?
5032
5034
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))
5033
5035
  : null));
@@ -131,7 +131,7 @@ let PnMarketwebSiteheaderLoginProfileselection = class {
131
131
  if (!this.loggedin || !this.profileSelectorDialog || this.profileSelectorDialog.profiles.length > 0) {
132
132
  return;
133
133
  }
134
- let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
134
+ let apiUrl = `${this.endpoint}${(this.endpoint.lastIndexOf('/') > -1 && this.endpoint.lastIndexOf('/') === this.endpoint.length - 1) ? '' : '/'}api/user/parentprofiles`;
135
135
  const req = await fetch(apiUrl);
136
136
  const reqdata = await req.json();
137
137
  const fallbackData = {
@@ -139,12 +139,14 @@ let PnMarketwebSiteheaderLoginProfileselection = class {
139
139
  profiles: [
140
140
  {
141
141
  name: "Hedin HMC Motor Company AB",
142
- organizationNumber: "5560230053",
142
+ customerNumber: "5560230053",
143
+ id: "7ab29701-5430-1a1a-4557-146bfd2aa35b",
143
144
  selected: false
144
145
  },
145
146
  {
146
147
  name: "Bilmetro AB",
147
- organizationNumber: "5560612789",
148
+ customerNumber: "5560612789",
149
+ id: "43707a2b-8e91-cef1-1907-0c091b907ff3",
148
150
  selected: true
149
151
  }
150
152
  ]
@@ -206,9 +208,9 @@ let PnMarketwebSiteheaderLoginProfileselection = class {
206
208
  return (h(Host, Object.assign({}, hostElementAttribute), this.heading ? h("strong", { class: "pn-marketweb-siteheader-login-profileselection-heading" }, this.heading) : null, h("div", { class: "pn-marketweb-siteheader-login-profileselection-user" }, h("div", { class: "pn-marketweb-siteheader-login-profileselection-user-name" }, this.userName), ((this.user && this.user.username) && this.userName !== this.user.username) ?
207
209
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-user-description" }, this.user.username)
208
210
  : null), this.currentProfile !== null && this.currentProfile.name ?
209
- 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.organizationNumber))
211
+ 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))
210
212
  : null, h("pn-marketweb-siteheader-login-linklist", { links: this.loginDialog.loggedInLinks.filter(x => x.isLogoutLink === false), loginManager: this.loginManager, idNamespace: this.idNamespace }), h("div", { class: "pn-marketweb-siteheader-login-profileselection-divider" }), this.profileSelectorDialog.profiles.filter(x => x.selected === false).map((profile) => {
211
- return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/UnifiedLogin/ExternalLoginCallback?returnUrl=${window.location.href}?profile=${profile.organizationNumber}}`, 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" }, profile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.organizationNumber)), h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
213
+ return (h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption" }, h("a", { href: `${this.endpoint}/api/user/setprofile?profile=${profile.id}&returnUrl=${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" }, profile.name), h("div", { class: "pn-marketweb-siteheader-login-profileselection-profileoption-description" }, profile.customerNumber)), h("pn-icon", { symbol: "arrow-right", small: "false", color: "blue700" }))));
212
214
  }), this.logoutLink ?
213
215
  h("div", { class: "pn-marketweb-siteheader-login-profileselection-logout" }, h("a", { href: this.logoutLink.href, rel: "nofollower noopener", class: "pn-marketweb-siteheader-login-profileselection-logout-link" }, this.logoutLink.linkText))
214
216
  : null));
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,i,n,t){function o(e){return e instanceof n?e:new n((function(i){i(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{s(t.next(e))}catch(i){r(i)}}function a(e){try{s(t["throw"](e))}catch(i){r(i)}}function s(e){e.done?n(e.value):o(e.value).then(l,a)}s((t=t.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,o,r,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(i){return s([e,i])}}function s(l){if(t)throw new TypeError("Generator is already executing.");while(n)try{if(t=1,o&&(r=l[0]&2?o["return"]:l[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;if(o=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){n.label=l[1];break}if(l[0]===6&&n.label<r[1]){n.label=r[1];r=l;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(l);break}if(r[2])n.ops.pop();n.trys.pop();continue}l=i.call(e,n)}catch(a){l=[6,a];o=0}finally{t=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,h,a as Host,g as getElement}from"./index-5397620b.js";var pnMarketwebSiteheaderLoginLinksCss="";var PnMarketwebSiteheaderLoginLinks=function(){function e(e){registerInstance(this,e);this.loginDialog=null;this.loginManager=null;this.idNamespace="";this.loggedin=false;this.username=""}e.prototype.componentWillLoad=function(){this.init()};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.adjustLoginLinks();return[2]}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;if(!this.loginDialog){return}var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loginMenuLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loginMenuLinks.forEach(r)}if((t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks){(o=this.loginDialog)===null||o===void 0?void 0:o.loggedInLinks.forEach(r)}this.loginDialog.legacyLoginLinks=[{href:this.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,linkType:"primary",primaryLinkApperance:true},{href:this.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,primaryLinkApperance:false}]};e.prototype.render=function(){var e;if(!this.loginDialog){return}var i={username:null,loggedin:false};if(this.username){i.username=this.username;i.loggedin=this.loggedin}return h(Host,Object.assign({},i),!this.loginDialog.overrideLoginMenu?h("div",{"data-loggedin":this.loggedin+""},this.loggedin?h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):h("div",null,((e=this.loginDialog.loginMenuLinks)===null||e===void 0?void 0:e.length)>0?h("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}))):null,this.loginDialog.overrideLoginMenu?h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{loginDialog:["init"]}},enumerable:false,configurable:true});return e}();PnMarketwebSiteheaderLoginLinks.style=pnMarketwebSiteheaderLoginLinksCss;var pnMarketwebSiteheaderLoginProfileselectionCss='.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.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}.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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00A0D6;position:relative;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:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;-webkit-transform:translateX(calc(100% + 0.2em));transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:-ms-flexbox;display:flex;background:#FFFFFF;-webkit-transition:background 0.15s ease-in-out;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005D92;-ms-flex-align:center;align-items:center}.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:#F3F2F2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{-ms-flex-positive:1;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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005D92;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}';var PnMarketwebSiteheaderLoginProfileselection=function(){function e(e){registerInstance(this,e);this.loginDialog=null;this.loginManager=null;this.endpoint="";this.loggedin=false;this.idNamespace="";this.heading=null;this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""};this.user=null;this.logoutLink=null;this.userName=null;this.profileSelectorDialog={profiles:[]};this.currentProfile=null}e.prototype.componentWillLoad=function(){var e;if(this.heading===null&&((e=this.i18n)===null||e===void 0?void 0:e.profileSelectionFlyoutHeading)){this.heading=this.i18n.profileSelectionFlyoutHeading}this.init()};e.prototype.init=function(){this.updateUserInfo();this.adjustLoginLinks();this.fetchProfiles()};e.prototype.fetchProfiles=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,n,t,o,r;return __generator(this,(function(l){switch(l.label){case 0:if(!this.loggedin||!this.profileSelectorDialog||this.profileSelectorDialog.profiles.length>0){return[2]}e="".concat(this.endpoint).concat(this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/","api/user/parentprofiles");return[4,fetch(e)];case 1:i=l.sent();return[4,i.json()];case 2:n=l.sent();t={loggedin:true,profiles:[{name:"Hedin HMC Motor Company AB",organizationNumber:"5560230053",selected:false},{name:"Bilmetro AB",organizationNumber:"5560612789",selected:true}]};o=window.location.href.indexOf("localhost:6008")!==-1?t:n;if(!o||!o.profiles||!o.profiles.length){return[2]}this.profileSelectorDialog.profiles=o.profiles;r=o.profiles.filter((function(e){return e.selected===true}));if(r[0]&&r[0].name){this.currentProfile=r[0]}return[2]}}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loggedInLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loggedInLinks.forEach(r)}this.logoutLink=(o=(t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks.filter((function(e){return e.isLogoutLink}))[0])!==null&&o!==void 0?o:null};e.prototype.updateUserInfo=function(){var e=this.loginManager.getUserInfo();this.user=e;if(!e){return}if(e.given_name){this.userName=e.given_name;return}if(e.family_name){this.userName=e.family_name;return}if(e.username){this.userName=e.username;return}};e.prototype.render=function(){var e=this;if(!this.loginDialog||!this.profileSelectorDialog){return}var i={};return h(Host,Object.assign({},i),this.heading?h("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,h("div",{class:"pn-marketweb-siteheader-login-profileselection-user"},h("div",{class:"pn-marketweb-siteheader-login-profileselection-user-name"},this.userName),this.user&&this.user.username&&this.userName!==this.user.username?h("div",{class:"pn-marketweb-siteheader-login-profileselection-user-description"},this.user.username):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.organizationNumber)):null,h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks.filter((function(e){return e.isLogoutLink===false})),loginManager:this.loginManager,idNamespace:this.idNamespace}),h("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileSelectorDialog.profiles.filter((function(e){return e.selected===false})).map((function(i){return h("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},h("a",{href:"".concat(e.endpoint,"/UnifiedLogin/ExternalLoginCallback?returnUrl=").concat(window.location.href,"?profile=").concat(i.organizationNumber,"}"),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"},i.name),h("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},i.organizationNumber)),h("pn-icon",{symbol:"arrow-right",small:"false",color:"blue700"})))})),this.logoutLink?h("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},h("a",{href:this.logoutLink.href,rel:"nofollower noopener",class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PnMarketwebSiteheaderLoginProfileselection.style=pnMarketwebSiteheaderLoginProfileselectionCss;export{PnMarketwebSiteheaderLoginLinks as pn_marketweb_siteheader_login_links,PnMarketwebSiteheaderLoginProfileselection as pn_marketweb_siteheader_login_profileselection};
1
+ var __awaiter=this&&this.__awaiter||function(e,i,n,t){function o(e){return e instanceof n?e:new n((function(i){i(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{s(t.next(e))}catch(i){r(i)}}function a(e){try{s(t["throw"](e))}catch(i){r(i)}}function s(e){e.done?n(e.value):o(e.value).then(l,a)}s((t=t.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,o,r,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(i){return s([e,i])}}function s(l){if(t)throw new TypeError("Generator is already executing.");while(n)try{if(t=1,o&&(r=l[0]&2?o["return"]:l[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;if(o=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){n.label=l[1];break}if(l[0]===6&&n.label<r[1]){n.label=r[1];r=l;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(l);break}if(r[2])n.ops.pop();n.trys.pop();continue}l=i.call(e,n)}catch(a){l=[6,a];o=0}finally{t=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,h,a as Host,g as getElement}from"./index-5397620b.js";var pnMarketwebSiteheaderLoginLinksCss="";var PnMarketwebSiteheaderLoginLinks=function(){function e(e){registerInstance(this,e);this.loginDialog=null;this.loginManager=null;this.idNamespace="";this.loggedin=false;this.username=""}e.prototype.componentWillLoad=function(){this.init()};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.adjustLoginLinks();return[2]}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;if(!this.loginDialog){return}var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loginMenuLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loginMenuLinks.forEach(r)}if((t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks){(o=this.loginDialog)===null||o===void 0?void 0:o.loggedInLinks.forEach(r)}this.loginDialog.legacyLoginLinks=[{href:this.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,linkType:"primary",primaryLinkApperance:true},{href:this.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,primaryLinkApperance:false}]};e.prototype.render=function(){var e;if(!this.loginDialog){return}var i={username:null,loggedin:false};if(this.username){i.username=this.username;i.loggedin=this.loggedin}return h(Host,Object.assign({},i),!this.loginDialog.overrideLoginMenu?h("div",{"data-loggedin":this.loggedin+""},this.loggedin?h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):h("div",null,((e=this.loginDialog.loginMenuLinks)===null||e===void 0?void 0:e.length)>0?h("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}))):null,this.loginDialog.overrideLoginMenu?h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{loginDialog:["init"]}},enumerable:false,configurable:true});return e}();PnMarketwebSiteheaderLoginLinks.style=pnMarketwebSiteheaderLoginLinksCss;var pnMarketwebSiteheaderLoginProfileselectionCss='.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.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}.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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00A0D6;position:relative;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:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;-webkit-transform:translateX(calc(100% + 0.2em));transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:-ms-flexbox;display:flex;background:#FFFFFF;-webkit-transition:background 0.15s ease-in-out;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005D92;-ms-flex-align:center;align-items:center}.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:#F3F2F2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{-ms-flex-positive:1;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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005D92;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}';var PnMarketwebSiteheaderLoginProfileselection=function(){function e(e){registerInstance(this,e);this.loginDialog=null;this.loginManager=null;this.endpoint="";this.loggedin=false;this.idNamespace="";this.heading=null;this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""};this.user=null;this.logoutLink=null;this.userName=null;this.profileSelectorDialog={profiles:[]};this.currentProfile=null}e.prototype.componentWillLoad=function(){var e;if(this.heading===null&&((e=this.i18n)===null||e===void 0?void 0:e.profileSelectionFlyoutHeading)){this.heading=this.i18n.profileSelectionFlyoutHeading}this.init()};e.prototype.init=function(){this.updateUserInfo();this.adjustLoginLinks();this.fetchProfiles()};e.prototype.fetchProfiles=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,n,t,o,r;return __generator(this,(function(l){switch(l.label){case 0:if(!this.loggedin||!this.profileSelectorDialog||this.profileSelectorDialog.profiles.length>0){return[2]}e="".concat(this.endpoint).concat(this.endpoint.lastIndexOf("/")>-1&&this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/","api/user/parentprofiles");return[4,fetch(e)];case 1:i=l.sent();return[4,i.json()];case 2:n=l.sent();t={loggedin:true,profiles:[{name:"Hedin HMC Motor Company AB",customerNumber:"5560230053",id:"7ab29701-5430-1a1a-4557-146bfd2aa35b",selected:false},{name:"Bilmetro AB",customerNumber:"5560612789",id:"43707a2b-8e91-cef1-1907-0c091b907ff3",selected:true}]};o=window.location.href.indexOf("localhost:6008")!==-1?t:n;if(!o||!o.profiles||!o.profiles.length){return[2]}this.profileSelectorDialog.profiles=o.profiles;r=o.profiles.filter((function(e){return e.selected===true}));if(r[0]&&r[0].name){this.currentProfile=r[0]}return[2]}}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loggedInLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loggedInLinks.forEach(r)}this.logoutLink=(o=(t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks.filter((function(e){return e.isLogoutLink}))[0])!==null&&o!==void 0?o:null};e.prototype.updateUserInfo=function(){var e=this.loginManager.getUserInfo();this.user=e;if(!e){return}if(e.given_name){this.userName=e.given_name;return}if(e.family_name){this.userName=e.family_name;return}if(e.username){this.userName=e.username;return}};e.prototype.render=function(){var e=this;if(!this.loginDialog||!this.profileSelectorDialog){return}var i={};return h(Host,Object.assign({},i),this.heading?h("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,h("div",{class:"pn-marketweb-siteheader-login-profileselection-user"},h("div",{class:"pn-marketweb-siteheader-login-profileselection-user-name"},this.userName),this.user&&this.user.username&&this.userName!==this.user.username?h("div",{class:"pn-marketweb-siteheader-login-profileselection-user-description"},this.user.username):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)):null,h("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks.filter((function(e){return e.isLogoutLink===false})),loginManager:this.loginManager,idNamespace:this.idNamespace}),h("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileSelectorDialog.profiles.filter((function(e){return e.selected===false})).map((function(i){return h("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},h("a",{href:"".concat(e.endpoint,"/api/user/setprofile?profile=").concat(i.id,"&returnUrl=").concat(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"},i.name),h("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},i.customerNumber)),h("pn-icon",{symbol:"arrow-right",small:"false",color:"blue700"})))})),this.logoutLink?h("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},h("a",{href:this.logoutLink.href,rel:"nofollower noopener",class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();PnMarketwebSiteheaderLoginProfileselection.style=pnMarketwebSiteheaderLoginProfileselectionCss;export{PnMarketwebSiteheaderLoginLinks as pn_marketweb_siteheader_login_links,PnMarketwebSiteheaderLoginProfileselection as pn_marketweb_siteheader_login_profileselection};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postnord/pn-marketweb-components",
3
- "version": "2.0.33",
3
+ "version": "2.0.34",
4
4
  "description": "PostNord Market Websites Components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,i,n,t){function o(e){return e instanceof n?e:new n((function(i){i(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{s(t.next(e))}catch(i){r(i)}}function a(e){try{s(t["throw"](e))}catch(i){r(i)}}function s(e){e.done?n(e.value):o(e.value).then(l,a)}s((t=t.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,o,r,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(i){return s([e,i])}}function s(l){if(t)throw new TypeError("Generator is already executing.");while(n)try{if(t=1,o&&(r=l[0]&2?o["return"]:l[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;if(o=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){n.label=l[1];break}if(l[0]===6&&n.label<r[1]){n.label=r[1];r=l;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(l);break}if(r[2])n.ops.pop();n.trys.pop();continue}l=i.call(e,n)}catch(a){l=[6,a];o=0}finally{t=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-36654f2a.system.js"],(function(e){"use strict";var i,n,t,o;return{setters:[function(e){i=e.r;n=e.h;t=e.a;o=e.g}],execute:function(){var r="";var l=e("pn_marketweb_siteheader_login_links",function(){function e(e){i(this,e);this.loginDialog=null;this.loginManager=null;this.idNamespace="";this.loggedin=false;this.username=""}e.prototype.componentWillLoad=function(){this.init()};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.adjustLoginLinks();return[2]}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;if(!this.loginDialog){return}var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loginMenuLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loginMenuLinks.forEach(r)}if((t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks){(o=this.loginDialog)===null||o===void 0?void 0:o.loggedInLinks.forEach(r)}this.loginDialog.legacyLoginLinks=[{href:this.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,linkType:"primary",primaryLinkApperance:true},{href:this.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,primaryLinkApperance:false}]};e.prototype.render=function(){var e;if(!this.loginDialog){return}var i={username:null,loggedin:false};if(this.username){i.username=this.username;i.loggedin=this.loggedin}return n(t,Object.assign({},i),!this.loginDialog.overrideLoginMenu?n("div",{"data-loggedin":this.loggedin+""},this.loggedin?n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):n("div",null,((e=this.loginDialog.loginMenuLinks)===null||e===void 0?void 0:e.length)>0?n("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}))):null,this.loginDialog.overrideLoginMenu?n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{loginDialog:["init"]}},enumerable:false,configurable:true});return e}());l.style=r;var a='.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.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}.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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00A0D6;position:relative;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:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;-webkit-transform:translateX(calc(100% + 0.2em));transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:-ms-flexbox;display:flex;background:#FFFFFF;-webkit-transition:background 0.15s ease-in-out;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005D92;-ms-flex-align:center;align-items:center}.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:#F3F2F2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{-ms-flex-positive:1;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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005D92;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}';var s=e("pn_marketweb_siteheader_login_profileselection",function(){function e(e){i(this,e);this.loginDialog=null;this.loginManager=null;this.endpoint="";this.loggedin=false;this.idNamespace="";this.heading=null;this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""};this.user=null;this.logoutLink=null;this.userName=null;this.profileSelectorDialog={profiles:[]};this.currentProfile=null}e.prototype.componentWillLoad=function(){var e;if(this.heading===null&&((e=this.i18n)===null||e===void 0?void 0:e.profileSelectionFlyoutHeading)){this.heading=this.i18n.profileSelectionFlyoutHeading}this.init()};e.prototype.init=function(){this.updateUserInfo();this.adjustLoginLinks();this.fetchProfiles()};e.prototype.fetchProfiles=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,n,t,o,r;return __generator(this,(function(l){switch(l.label){case 0:if(!this.loggedin||!this.profileSelectorDialog||this.profileSelectorDialog.profiles.length>0){return[2]}e="".concat(this.endpoint).concat(this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/","api/user/parentprofiles");return[4,fetch(e)];case 1:i=l.sent();return[4,i.json()];case 2:n=l.sent();t={loggedin:true,profiles:[{name:"Hedin HMC Motor Company AB",organizationNumber:"5560230053",selected:false},{name:"Bilmetro AB",organizationNumber:"5560612789",selected:true}]};o=window.location.href.indexOf("localhost:6008")!==-1?t:n;if(!o||!o.profiles||!o.profiles.length){return[2]}this.profileSelectorDialog.profiles=o.profiles;r=o.profiles.filter((function(e){return e.selected===true}));if(r[0]&&r[0].name){this.currentProfile=r[0]}return[2]}}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loggedInLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loggedInLinks.forEach(r)}this.logoutLink=(o=(t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks.filter((function(e){return e.isLogoutLink}))[0])!==null&&o!==void 0?o:null};e.prototype.updateUserInfo=function(){var e=this.loginManager.getUserInfo();this.user=e;if(!e){return}if(e.given_name){this.userName=e.given_name;return}if(e.family_name){this.userName=e.family_name;return}if(e.username){this.userName=e.username;return}};e.prototype.render=function(){var e=this;if(!this.loginDialog||!this.profileSelectorDialog){return}var i={};return n(t,Object.assign({},i),this.heading?n("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,n("div",{class:"pn-marketweb-siteheader-login-profileselection-user"},n("div",{class:"pn-marketweb-siteheader-login-profileselection-user-name"},this.userName),this.user&&this.user.username&&this.userName!==this.user.username?n("div",{class:"pn-marketweb-siteheader-login-profileselection-user-description"},this.user.username):null),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),n("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-description"},this.currentProfile.organizationNumber)):null,n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks.filter((function(e){return e.isLogoutLink===false})),loginManager:this.loginManager,idNamespace:this.idNamespace}),n("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileSelectorDialog.profiles.filter((function(e){return e.selected===false})).map((function(i){return n("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},n("a",{href:"".concat(e.endpoint,"/UnifiedLogin/ExternalLoginCallback?returnUrl=").concat(window.location.href,"?profile=").concat(i.organizationNumber,"}"),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"},i.name),n("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},i.organizationNumber)),n("pn-icon",{symbol:"arrow-right",small:"false",color:"blue700"})))})),this.logoutLink?n("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},n("a",{href:this.logoutLink.href,rel:"nofollower noopener",class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());s.style=a}}}));
1
+ var __awaiter=this&&this.__awaiter||function(e,i,n,t){function o(e){return e instanceof n?e:new n((function(i){i(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{s(t.next(e))}catch(i){r(i)}}function a(e){try{s(t["throw"](e))}catch(i){r(i)}}function s(e){e.done?n(e.value):o(e.value).then(l,a)}s((t=t.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,o,r,l;return l={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function a(e){return function(i){return s([e,i])}}function s(l){if(t)throw new TypeError("Generator is already executing.");while(n)try{if(t=1,o&&(r=l[0]&2?o["return"]:l[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,l[1])).done)return r;if(o=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:n.label++;return{value:l[1],done:false};case 5:n.label++;o=l[1];l=[0];continue;case 7:l=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){n.label=l[1];break}if(l[0]===6&&n.label<r[1]){n.label=r[1];r=l;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(l);break}if(r[2])n.ops.pop();n.trys.pop();continue}l=i.call(e,n)}catch(a){l=[6,a];o=0}finally{t=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-36654f2a.system.js"],(function(e){"use strict";var i,n,t,o;return{setters:[function(e){i=e.r;n=e.h;t=e.a;o=e.g}],execute:function(){var r="";var l=e("pn_marketweb_siteheader_login_links",function(){function e(e){i(this,e);this.loginDialog=null;this.loginManager=null;this.idNamespace="";this.loggedin=false;this.username=""}e.prototype.componentWillLoad=function(){this.init()};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.adjustLoginLinks();return[2]}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;if(!this.loginDialog){return}var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loginMenuLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loginMenuLinks.forEach(r)}if((t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks){(o=this.loginDialog)===null||o===void 0?void 0:o.loggedInLinks.forEach(r)}this.loginDialog.legacyLoginLinks=[{href:this.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,linkType:"primary",primaryLinkApperance:true},{href:this.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:false,isLogoutLink:false,pageLink:null,primaryLinkApperance:false}]};e.prototype.render=function(){var e;if(!this.loginDialog){return}var i={username:null,loggedin:false};if(this.username){i.username=this.username;i.loggedin=this.loggedin}return n(t,Object.assign({},i),!this.loginDialog.overrideLoginMenu?n("div",{"data-loggedin":this.loggedin+""},this.loggedin?n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):n("div",null,((e=this.loginDialog.loginMenuLinks)===null||e===void 0?void 0:e.length)>0?n("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}))):null,this.loginDialog.overrideLoginMenu?n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{loginDialog:["init"]}},enumerable:false,configurable:true});return e}());l.style=r;var a='.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.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}.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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00A0D6;position:relative;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:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;-webkit-transform:translateX(calc(100% + 0.2em));transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:-ms-flexbox;display:flex;background:#FFFFFF;-webkit-transition:background 0.15s ease-in-out;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005D92;-ms-flex-align:center;align-items:center}.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:#F3F2F2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{-ms-flex-positive:1;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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005D92;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}';var s=e("pn_marketweb_siteheader_login_profileselection",function(){function e(e){i(this,e);this.loginDialog=null;this.loginManager=null;this.endpoint="";this.loggedin=false;this.idNamespace="";this.heading=null;this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""};this.user=null;this.logoutLink=null;this.userName=null;this.profileSelectorDialog={profiles:[]};this.currentProfile=null}e.prototype.componentWillLoad=function(){var e;if(this.heading===null&&((e=this.i18n)===null||e===void 0?void 0:e.profileSelectionFlyoutHeading)){this.heading=this.i18n.profileSelectionFlyoutHeading}this.init()};e.prototype.init=function(){this.updateUserInfo();this.adjustLoginLinks();this.fetchProfiles()};e.prototype.fetchProfiles=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,n,t,o,r;return __generator(this,(function(l){switch(l.label){case 0:if(!this.loggedin||!this.profileSelectorDialog||this.profileSelectorDialog.profiles.length>0){return[2]}e="".concat(this.endpoint).concat(this.endpoint.lastIndexOf("/")>-1&&this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/","api/user/parentprofiles");return[4,fetch(e)];case 1:i=l.sent();return[4,i.json()];case 2:n=l.sent();t={loggedin:true,profiles:[{name:"Hedin HMC Motor Company AB",customerNumber:"5560230053",id:"7ab29701-5430-1a1a-4557-146bfd2aa35b",selected:false},{name:"Bilmetro AB",customerNumber:"5560612789",id:"43707a2b-8e91-cef1-1907-0c091b907ff3",selected:true}]};o=window.location.href.indexOf("localhost:6008")!==-1?t:n;if(!o||!o.profiles||!o.profiles.length){return[2]}this.profileSelectorDialog.profiles=o.profiles;r=o.profiles.filter((function(e){return e.selected===true}));if(r[0]&&r[0].name){this.currentProfile=r[0]}return[2]}}))}))};e.prototype.adjustLoginLinks=function(){var e=this;var i,n,t,o;var r=function(i,n){i.isLogoutLink=i.href.indexOf("logout")!==-1;if(i.isLogoutLink){i.href=e.loginManager.getLogoutUrl(i.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))}if(n===0&&!i.href){i.href=e.loginManager.getLoginUrl();i.linkType="primary"}if(i.primaryLinkApperance&&!i.linkType){i.linkType="primary"}};if((i=this.loginDialog)===null||i===void 0?void 0:i.loggedInLinks){(n=this.loginDialog)===null||n===void 0?void 0:n.loggedInLinks.forEach(r)}this.logoutLink=(o=(t=this.loginDialog)===null||t===void 0?void 0:t.loggedInLinks.filter((function(e){return e.isLogoutLink}))[0])!==null&&o!==void 0?o:null};e.prototype.updateUserInfo=function(){var e=this.loginManager.getUserInfo();this.user=e;if(!e){return}if(e.given_name){this.userName=e.given_name;return}if(e.family_name){this.userName=e.family_name;return}if(e.username){this.userName=e.username;return}};e.prototype.render=function(){var e=this;if(!this.loginDialog||!this.profileSelectorDialog){return}var i={};return n(t,Object.assign({},i),this.heading?n("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,n("div",{class:"pn-marketweb-siteheader-login-profileselection-user"},n("div",{class:"pn-marketweb-siteheader-login-profileselection-user-name"},this.userName),this.user&&this.user.username&&this.userName!==this.user.username?n("div",{class:"pn-marketweb-siteheader-login-profileselection-user-description"},this.user.username):null),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),n("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-description"},this.currentProfile.customerNumber)):null,n("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks.filter((function(e){return e.isLogoutLink===false})),loginManager:this.loginManager,idNamespace:this.idNamespace}),n("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileSelectorDialog.profiles.filter((function(e){return e.selected===false})).map((function(i){return n("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},n("a",{href:"".concat(e.endpoint,"/api/user/setprofile?profile=").concat(i.id,"&returnUrl=").concat(window.location.href),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"},i.name),n("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},i.customerNumber)),n("pn-icon",{symbol:"arrow-right",small:"false",color:"blue700"})))})),this.logoutLink?n("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},n("a",{href:this.logoutLink.href,rel:"nofollower noopener",class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)};Object.defineProperty(e.prototype,"hostElement",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());s.style=a}}}));
@@ -1 +1 @@
1
- System.register(["./p-36654f2a.system.js"],(function(){"use strict";var e,n,t,a,i,r;return{setters:[function(s){e=s.d;n=s.N;t=s.w;a=s.p;i=s.H;r=s.b}],execute:function(){var s=function(){{o(i.prototype)}var r=Array.from(e.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(n,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===n}));var s={};if("onbeforeload"in r&&!history.scrollRestoration){return{then:function(){}}}{s.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,t.location.href)).href}return a(s)};var o=function(e){var n=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return n.call(this,e)}var t=n.call(this,false);var a=this.childNodes;if(e){for(var i=0;i<a.length;i++){if(a[i].nodeType!==2){t.appendChild(a[i].cloneNode(true))}}}return t}};s().then((function(e){return r([["p-c0be6802.system",[[4,"pn-marketweb-siteheader",{market:[1537],language:[1537],environment:[1537],userToken:[1,"user-token"],userFullname:[1,"user-fullname"],userLoggedin:[4,"user-loggedin"],endpoint:[1],hideSiteSelector:[1540,"hide-site-selector"],hideLanguageSelector:[1540,"hide-language-selector"],hideSearch:[1540,"hide-search"],hideLogin:[1540,"hide-login"],showProfileSelection:[1540,"show-profile-selection"],AutocompleteEndpoint:[1,"autocomplete-endpoint"],sessionForward:[4,"session-forward"],cache:[4],spaMode:[4,"spa-mode"],i18n:[32],gotData:[32],fetchingData:[32],homePageLink:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],languageOptions:[32],loginDialog:[32],minimizeSearch:[32],loggedIn:[32],loginManager:[32]},[[0,"setLanguage","onLanguageSelectorChange"],[0,"loginStateChange","onLoginStateChange"],[9,"resize","handleResize"]]]]],["p-db6efb10.system",[[0,"pn-find-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],weight:[32],weightvalue:[32],sourceData:[32],sizecategory:[32]}]]],["p-8144bcbc.system",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["p-fecc53bb.system",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32],postagetype:[32],weight:[32],weightvalue:[32]}]]],["p-723b9901.system",[[0,"pn-product-pricelist-result",{item:[1040],description:[16],shownitems:[16],showMeasurement:[4,"show-measurement"],weightText:[32]}]]],["p-7422abda.system",[[4,"pn-marketweb-sitefooter",{market:[1537],language:[1537],environment:[1537],endpoint:[1],cache:[4],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["p-d7776336.system",[[4,"pn-bonus-progressbar",{icon:[1],heading:[1],theme:[513],bonuspercentage:[1],currency:[513],value:[1538],min:[1538],max:[1538],valuepercentage:[32],progresspercentage:[32],levelValues:[32],currentLevelAdjustedValue:[32]}]]],["p-2da8e5e8.system",[[0,"pn-pex-pricefinder",{language:[1],currency:[1],apiUrl:[1,"api-url"],i18n:[32],fromzip:[32],tozip:[32],weight:[32],when:[32],response:[32]},[[0,"language","setLanguage"]]]]],["p-1924152a.system",[[4,"pn-customernumber-selector",{language:[1537],open:[1540],heading:[1],description:[1],i18n:[32]}]]],["p-e6fa11ad.system",[[4,"pn-customernumber-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-2718b89a.system",[[1,"pn-filter-checkbox",{value:[520],name:[1],checkboxid:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-80dce81e.system",[[1,"pn-marketweb-search",{disabled:[4],placeholder:[1],inputid:[1],name:[1],autocomplete:[1],list:[1],value:[1],label:[1],loading:[4],button:[1],light:[4],suggestionObserver:[32],hasClonedInput:[32],listSuggestion:[32]},[[0,"input","inputHandler"]]]]],["p-290d5824.system",[[4,"pn-product-tile"]]],["p-8f9f1b71.system",[[4,"pn-profile-selector",{language:[1537],returnUrl:[1,"return-url"],heading:[1],i18n:[32],isLoading:[32],numberOfProfiles:[32]}]]],["p-93cecc43.system",[[0,"pn-profile-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-d10fa9e8.system",[[4,"pn-sidenav",{language:[1],navLabel:[1,"nav-label"],i18n:[32]},[[0,"language","setLanguage"],[0,"openSubMenuLevelChange","onOpenSubMenuLevelChange"]]]]],["p-885bc8d7.system",[[4,"pn-sidenav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],alignment:[32]}]]],["p-625fb7fb.system",[[4,"pn-sidenav-link",{name:[1],href:[1],target:[1],linkid:[1],icon:[1],current:[4],levelId:[32],open:[32],hasChildren:[32]}]]],["p-b88337dd.system",[[4,"pn-sidenav-togglebutton",{label:[1],i18n:[32]}]]],["p-8117b79e.system",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}]]],["p-f7b013a7.system",[[0,"pn-bonus-progressbar-level",{current:[516],value:[1538],bonuspercentage:[1537],visualpercentage:[1538],percentage:[32],max:[32],min:[32],currency:[32]}]]],["p-9edaf6b6.system",[[0,"pn-marketweb-input",{disabled:[4],error:[1],invalid:[4],helpertext:[1],label:[1],placeholder:[1],inputid:[1],name:[1],required:[4],type:[1025],autocomplete:[1],valid:[4],value:[1],maxlength:[1],min:[1],max:[1],step:[1],pattern:[1],showText:[32]}]]],["p-0d5d05cc.system",[[0,"pn-find-price-result",{item:[1040],shownitems:[16],Usp1:[1,"usp-1"],Usp2:[1,"usp-2"],Usp3:[1,"usp-3"],description:[16],showMeasurement:[4,"show-measurement"],weightText:[32],linkId:[32],shopLabel:[32],shopUrl:[32],shopId:[32]}]]],["p-c2a4803f.system",[[4,"pn-site-footer",{url:[1],linktitle:[1]}],[4,"pn-site-footer-col"]]],["p-1ce871c5.system",[[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-fc1083d2.system",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["p-e66a8bb8.system",[[0,"pn-marketweb-siteheader-login-linklist",{heading:[1],links:[16],idNamespace:[1,"id-namespace"],loginManager:[16]}]]],["p-03f98561.system",[[0,"pn-marketweb-siteheader-login-links",{loginDialog:[1040],loginManager:[16],idNamespace:[1,"id-namespace"],loggedin:[516],username:[1]}],[0,"pn-marketweb-siteheader-login-profileselection",{loginDialog:[1040],loginManager:[16],endpoint:[1],loggedin:[4],idNamespace:[1,"id-namespace"],heading:[1],i18n:[16],profileSelectorDialog:[1040],currentProfile:[1040],user:[32],logoutLink:[32],userName:[32]}]]],["p-a921d3fd.system",[[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]],["p-f7d1c0a0.system",[[0,"pn-marketweb-siteheader-login",{endpoint:[1],token:[1],i18n:[16],emitEvents:[4,"emit-events"],loginDialog:[1040],fullname:[1],loggedin:[4],showProfileSelection:[1028,"show-profile-selection"],loginManager:[32],loginLinks:[32],toggleButtonText:[32],username:[32]}],[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"],navLabel:[1,"nav-label"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopenstate","setMenuOpenState"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],language:[1537],search:[1040],primary:[4],autoCompleteOptions:[32]}],[4,"pn-site-selector",{buttontext:[1537],heading:[1537],language:[1537],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["p-6ce5a56d.system",[[0,"pn-product-card-info",{rulle:[1],paket:[1],label:[1],text:[1]}],[0,"pn-product-card-price",{label:[1],amount:[1],currency:[1],note:[1],url:[1],service:[1],linkid:[1]}],[4,"pn-titletag",{icon:[1],color:[1537]}],[4,"pn-product-card"]]]],e)}))}}}));
1
+ System.register(["./p-36654f2a.system.js"],(function(){"use strict";var e,n,t,a,i,r;return{setters:[function(s){e=s.d;n=s.N;t=s.w;a=s.p;i=s.H;r=s.b}],execute:function(){var s=function(){{o(i.prototype)}var r=Array.from(e.querySelectorAll("script")).find((function(e){return new RegExp("/".concat(n,"(\\.esm)?\\.js($|\\?|#)")).test(e.src)||e.getAttribute("data-stencil-namespace")===n}));var s={};if("onbeforeload"in r&&!history.scrollRestoration){return{then:function(){}}}{s.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,t.location.href)).href}return a(s)};var o=function(e){var n=e.cloneNode;e.cloneNode=function(e){if(this.nodeName==="TEMPLATE"){return n.call(this,e)}var t=n.call(this,false);var a=this.childNodes;if(e){for(var i=0;i<a.length;i++){if(a[i].nodeType!==2){t.appendChild(a[i].cloneNode(true))}}}return t}};s().then((function(e){return r([["p-c0be6802.system",[[4,"pn-marketweb-siteheader",{market:[1537],language:[1537],environment:[1537],userToken:[1,"user-token"],userFullname:[1,"user-fullname"],userLoggedin:[4,"user-loggedin"],endpoint:[1],hideSiteSelector:[1540,"hide-site-selector"],hideLanguageSelector:[1540,"hide-language-selector"],hideSearch:[1540,"hide-search"],hideLogin:[1540,"hide-login"],showProfileSelection:[1540,"show-profile-selection"],AutocompleteEndpoint:[1,"autocomplete-endpoint"],sessionForward:[4,"session-forward"],cache:[4],spaMode:[4,"spa-mode"],i18n:[32],gotData:[32],fetchingData:[32],homePageLink:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],languageOptions:[32],loginDialog:[32],minimizeSearch:[32],loggedIn:[32],loginManager:[32]},[[0,"setLanguage","onLanguageSelectorChange"],[0,"loginStateChange","onLoginStateChange"],[9,"resize","handleResize"]]]]],["p-db6efb10.system",[[0,"pn-find-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],weight:[32],weightvalue:[32],sourceData:[32],sizecategory:[32]}]]],["p-8144bcbc.system",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["p-fecc53bb.system",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32],postagetype:[32],weight:[32],weightvalue:[32]}]]],["p-723b9901.system",[[0,"pn-product-pricelist-result",{item:[1040],description:[16],shownitems:[16],showMeasurement:[4,"show-measurement"],weightText:[32]}]]],["p-7422abda.system",[[4,"pn-marketweb-sitefooter",{market:[1537],language:[1537],environment:[1537],endpoint:[1],cache:[4],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["p-d7776336.system",[[4,"pn-bonus-progressbar",{icon:[1],heading:[1],theme:[513],bonuspercentage:[1],currency:[513],value:[1538],min:[1538],max:[1538],valuepercentage:[32],progresspercentage:[32],levelValues:[32],currentLevelAdjustedValue:[32]}]]],["p-2da8e5e8.system",[[0,"pn-pex-pricefinder",{language:[1],currency:[1],apiUrl:[1,"api-url"],i18n:[32],fromzip:[32],tozip:[32],weight:[32],when:[32],response:[32]},[[0,"language","setLanguage"]]]]],["p-1924152a.system",[[4,"pn-customernumber-selector",{language:[1537],open:[1540],heading:[1],description:[1],i18n:[32]}]]],["p-e6fa11ad.system",[[4,"pn-customernumber-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-2718b89a.system",[[1,"pn-filter-checkbox",{value:[520],name:[1],checkboxid:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-80dce81e.system",[[1,"pn-marketweb-search",{disabled:[4],placeholder:[1],inputid:[1],name:[1],autocomplete:[1],list:[1],value:[1],label:[1],loading:[4],button:[1],light:[4],suggestionObserver:[32],hasClonedInput:[32],listSuggestion:[32]},[[0,"input","inputHandler"]]]]],["p-290d5824.system",[[4,"pn-product-tile"]]],["p-8f9f1b71.system",[[4,"pn-profile-selector",{language:[1537],returnUrl:[1,"return-url"],heading:[1],i18n:[32],isLoading:[32],numberOfProfiles:[32]}]]],["p-93cecc43.system",[[0,"pn-profile-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-d10fa9e8.system",[[4,"pn-sidenav",{language:[1],navLabel:[1,"nav-label"],i18n:[32]},[[0,"language","setLanguage"],[0,"openSubMenuLevelChange","onOpenSubMenuLevelChange"]]]]],["p-885bc8d7.system",[[4,"pn-sidenav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],alignment:[32]}]]],["p-625fb7fb.system",[[4,"pn-sidenav-link",{name:[1],href:[1],target:[1],linkid:[1],icon:[1],current:[4],levelId:[32],open:[32],hasChildren:[32]}]]],["p-b88337dd.system",[[4,"pn-sidenav-togglebutton",{label:[1],i18n:[32]}]]],["p-8117b79e.system",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}]]],["p-f7b013a7.system",[[0,"pn-bonus-progressbar-level",{current:[516],value:[1538],bonuspercentage:[1537],visualpercentage:[1538],percentage:[32],max:[32],min:[32],currency:[32]}]]],["p-9edaf6b6.system",[[0,"pn-marketweb-input",{disabled:[4],error:[1],invalid:[4],helpertext:[1],label:[1],placeholder:[1],inputid:[1],name:[1],required:[4],type:[1025],autocomplete:[1],valid:[4],value:[1],maxlength:[1],min:[1],max:[1],step:[1],pattern:[1],showText:[32]}]]],["p-0d5d05cc.system",[[0,"pn-find-price-result",{item:[1040],shownitems:[16],Usp1:[1,"usp-1"],Usp2:[1,"usp-2"],Usp3:[1,"usp-3"],description:[16],showMeasurement:[4,"show-measurement"],weightText:[32],linkId:[32],shopLabel:[32],shopUrl:[32],shopId:[32]}]]],["p-c2a4803f.system",[[4,"pn-site-footer",{url:[1],linktitle:[1]}],[4,"pn-site-footer-col"]]],["p-1ce871c5.system",[[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-fc1083d2.system",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["p-e66a8bb8.system",[[0,"pn-marketweb-siteheader-login-linklist",{heading:[1],links:[16],idNamespace:[1,"id-namespace"],loginManager:[16]}]]],["p-011fc8e2.system",[[0,"pn-marketweb-siteheader-login-links",{loginDialog:[1040],loginManager:[16],idNamespace:[1,"id-namespace"],loggedin:[516],username:[1]}],[0,"pn-marketweb-siteheader-login-profileselection",{loginDialog:[1040],loginManager:[16],endpoint:[1],loggedin:[4],idNamespace:[1,"id-namespace"],heading:[1],i18n:[16],profileSelectorDialog:[1040],currentProfile:[1040],user:[32],logoutLink:[32],userName:[32]}]]],["p-a921d3fd.system",[[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]],["p-f7d1c0a0.system",[[0,"pn-marketweb-siteheader-login",{endpoint:[1],token:[1],i18n:[16],emitEvents:[4,"emit-events"],loginDialog:[1040],fullname:[1],loggedin:[4],showProfileSelection:[1028,"show-profile-selection"],loginManager:[32],loginLinks:[32],toggleButtonText:[32],username:[32]}],[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"],navLabel:[1,"nav-label"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopenstate","setMenuOpenState"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],language:[1537],search:[1040],primary:[4],autoCompleteOptions:[32]}],[4,"pn-site-selector",{buttontext:[1537],heading:[1537],language:[1537],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["p-6ce5a56d.system",[[0,"pn-product-card-info",{rulle:[1],paket:[1],label:[1],text:[1]}],[0,"pn-product-card-price",{label:[1],amount:[1],currency:[1],note:[1],url:[1],service:[1],linkid:[1]}],[4,"pn-titletag",{icon:[1],color:[1537]}],[4,"pn-product-card"]]]],e)}))}}}));
@@ -0,0 +1 @@
1
+ import{r as e,h as i,a as t,g as n}from"./p-58e8d7d5.js";let o=class{constructor(i){e(this,i),this.loginDialog=null,this.loginManager=null,this.idNamespace="",this.loggedin=!1,this.username=""}componentWillLoad(){this.init()}async init(){this.adjustLoginLinks()}adjustLoginLinks(){var e,i,t,n;if(!this.loginDialog)return;const o=(e,i)=>{e.isLogoutLink=-1!==e.href.indexOf("logout"),e.isLogoutLink&&(e.href=this.loginManager.getLogoutUrl(e.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))),0!==i||e.href||(e.href=this.loginManager.getLoginUrl(),e.linkType="primary"),e.primaryLinkApperance&&!e.linkType&&(e.linkType="primary")};(null===(e=this.loginDialog)||void 0===e?void 0:e.loginMenuLinks)&&(null===(i=this.loginDialog)||void 0===i||i.loginMenuLinks.forEach(o)),(null===(t=this.loginDialog)||void 0===t?void 0:t.loggedInLinks)&&(null===(n=this.loginDialog)||void 0===n||n.loggedInLinks.forEach(o)),this.loginDialog.legacyLoginLinks=[{href:this.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:!1,isLogoutLink:!1,pageLink:null,linkType:"primary",primaryLinkApperance:!0},{href:this.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:!1,isLogoutLink:!1,pageLink:null,primaryLinkApperance:!1}]}render(){var e;if(!this.loginDialog)return;let n={username:null,loggedin:!1};return this.username&&(n.username=this.username,n.loggedin=this.loggedin),i(t,Object.assign({},n),this.loginDialog.overrideLoginMenu?null:i("div",{"data-loggedin":this.loggedin+""},this.loggedin?i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):i("div",null,(null===(e=this.loginDialog.loginMenuLinks)||void 0===e?void 0:e.length)>0?i("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}))),this.loginDialog.overrideLoginMenu?i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):null)}get hostElement(){return n(this)}static get watchers(){return{loginDialog:["init"]}}};o.style="";let l=class{constructor(i){e(this,i),this.loginDialog=null,this.loginManager=null,this.endpoint="",this.loggedin=!1,this.idNamespace="",this.heading=null,this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""},this.user=null,this.logoutLink=null,this.userName=null,this.profileSelectorDialog={profiles:[]},this.currentProfile=null}componentWillLoad(){var e;null===this.heading&&(null===(e=this.i18n)||void 0===e?void 0:e.profileSelectionFlyoutHeading)&&(this.heading=this.i18n.profileSelectionFlyoutHeading),this.init()}init(){this.updateUserInfo(),this.adjustLoginLinks(),this.fetchProfiles()}async fetchProfiles(){if(!this.loggedin||!this.profileSelectorDialog||this.profileSelectorDialog.profiles.length>0)return;let e=`${this.endpoint}${this.endpoint.lastIndexOf("/")>-1&&this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/"}api/user/parentprofiles`;const i=await fetch(e),t=await i.json(),n=-1!==window.location.href.indexOf("localhost:6008")?{loggedin:!0,profiles:[{name:"Hedin HMC Motor Company AB",customerNumber:"5560230053",id:"7ab29701-5430-1a1a-4557-146bfd2aa35b",selected:!1},{name:"Bilmetro AB",customerNumber:"5560612789",id:"43707a2b-8e91-cef1-1907-0c091b907ff3",selected:!0}]}:t;if(!n||!n.profiles||!n.profiles.length)return;this.profileSelectorDialog.profiles=n.profiles;const o=n.profiles.filter((e=>!0===e.selected));o[0]&&o[0].name&&(this.currentProfile=o[0])}adjustLoginLinks(){var e,i,t,n;(null===(e=this.loginDialog)||void 0===e?void 0:e.loggedInLinks)&&(null===(i=this.loginDialog)||void 0===i||i.loggedInLinks.forEach(((e,i)=>{e.isLogoutLink=-1!==e.href.indexOf("logout"),e.isLogoutLink&&(e.href=this.loginManager.getLogoutUrl(e.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))),0!==i||e.href||(e.href=this.loginManager.getLoginUrl(),e.linkType="primary"),e.primaryLinkApperance&&!e.linkType&&(e.linkType="primary")}))),this.logoutLink=null!==(n=null===(t=this.loginDialog)||void 0===t?void 0:t.loggedInLinks.filter((e=>e.isLogoutLink))[0])&&void 0!==n?n:null}updateUserInfo(){const e=this.loginManager.getUserInfo();this.user=e,e&&(e.given_name?this.userName=e.given_name:e.family_name?this.userName=e.family_name:e.username&&(this.userName=e.username))}render(){if(this.loginDialog&&this.profileSelectorDialog)return i(t,Object.assign({},{}),this.heading?i("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,i("div",{class:"pn-marketweb-siteheader-login-profileselection-user"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-user-name"},this.userName),this.user&&this.user.username&&this.userName!==this.user.username?i("div",{class:"pn-marketweb-siteheader-login-profileselection-user-description"},this.user.username):null),null!==this.currentProfile&&this.currentProfile.name?i("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-name"},this.currentProfile.name),i("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-description"},this.currentProfile.customerNumber)):null,i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks.filter((e=>!1===e.isLogoutLink)),loginManager:this.loginManager,idNamespace:this.idNamespace}),i("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileSelectorDialog.profiles.filter((e=>!1===e.selected)).map((e=>i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},i("a",{href:`${this.endpoint}/api/user/setprofile?profile=${e.id}&returnUrl=${window.location.href}`,class:"pn-marketweb-siteheader-login-profileselection-profileoption-link"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-content"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-name"},e.name),i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},e.customerNumber)),i("pn-icon",{symbol:"arrow-right",small:"false",color:"blue700"}))))),this.logoutLink?i("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},i("a",{href:this.logoutLink.href,rel:"nofollower noopener",class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)}get hostElement(){return n(this)}};l.style='.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.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}.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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00A0D6;position:relative;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:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;-webkit-transform:translateX(calc(100% + 0.2em));transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:-ms-flexbox;display:flex;background:#FFFFFF;-webkit-transition:background 0.15s ease-in-out;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005D92;-ms-flex-align:center;align-items:center}.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:#F3F2F2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{-ms-flex-positive:1;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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005D92;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}';export{o as pn_marketweb_siteheader_login_links,l as pn_marketweb_siteheader_login_profileselection}
@@ -1 +1 @@
1
- import{d as e,N as n,w as a,p as t,H as i,b as r}from"./p-58e8d7d5.js";const o=e=>{const n=e.cloneNode;e.cloneNode=function(e){if("TEMPLATE"===this.nodeName)return n.call(this,e);const a=n.call(this,!1),t=this.childNodes;if(e)for(let n=0;n<t.length;n++)2!==t[n].nodeType&&a.appendChild(t[n].cloneNode(!0));return a}};(()=>{o(i.prototype);const r=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${n}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===n)),l={};return"onbeforeload"in r&&!history.scrollRestoration?{then(){}}:(l.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,a.location.href)).href,t(l))})().then((e=>r([["p-f27f817e",[[4,"pn-marketweb-siteheader",{market:[1537],language:[1537],environment:[1537],userToken:[1,"user-token"],userFullname:[1,"user-fullname"],userLoggedin:[4,"user-loggedin"],endpoint:[1],hideSiteSelector:[1540,"hide-site-selector"],hideLanguageSelector:[1540,"hide-language-selector"],hideSearch:[1540,"hide-search"],hideLogin:[1540,"hide-login"],showProfileSelection:[1540,"show-profile-selection"],AutocompleteEndpoint:[1,"autocomplete-endpoint"],sessionForward:[4,"session-forward"],cache:[4],spaMode:[4,"spa-mode"],i18n:[32],gotData:[32],fetchingData:[32],homePageLink:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],languageOptions:[32],loginDialog:[32],minimizeSearch:[32],loggedIn:[32],loginManager:[32]},[[0,"setLanguage","onLanguageSelectorChange"],[0,"loginStateChange","onLoginStateChange"],[9,"resize","handleResize"]]]]],["p-00dc1309",[[0,"pn-find-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],weight:[32],weightvalue:[32],sourceData:[32],sizecategory:[32]}]]],["p-774b7a9f",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["p-b32a8507",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32],postagetype:[32],weight:[32],weightvalue:[32]}]]],["p-17c4004f",[[0,"pn-product-pricelist-result",{item:[1040],description:[16],shownitems:[16],showMeasurement:[4,"show-measurement"],weightText:[32]}]]],["p-189ef99c",[[4,"pn-marketweb-sitefooter",{market:[1537],language:[1537],environment:[1537],endpoint:[1],cache:[4],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["p-51df9292",[[4,"pn-bonus-progressbar",{icon:[1],heading:[1],theme:[513],bonuspercentage:[1],currency:[513],value:[1538],min:[1538],max:[1538],valuepercentage:[32],progresspercentage:[32],levelValues:[32],currentLevelAdjustedValue:[32]}]]],["p-381b3ec0",[[0,"pn-pex-pricefinder",{language:[1],currency:[1],apiUrl:[1,"api-url"],i18n:[32],fromzip:[32],tozip:[32],weight:[32],when:[32],response:[32]},[[0,"language","setLanguage"]]]]],["p-1f2d9304",[[4,"pn-customernumber-selector",{language:[1537],open:[1540],heading:[1],description:[1],i18n:[32]}]]],["p-e32dc098",[[4,"pn-customernumber-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-81d764a0",[[1,"pn-filter-checkbox",{value:[520],name:[1],checkboxid:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-e9fe5c54",[[1,"pn-marketweb-search",{disabled:[4],placeholder:[1],inputid:[1],name:[1],autocomplete:[1],list:[1],value:[1],label:[1],loading:[4],button:[1],light:[4],suggestionObserver:[32],hasClonedInput:[32],listSuggestion:[32]},[[0,"input","inputHandler"]]]]],["p-d0155ddf",[[4,"pn-product-tile"]]],["p-dbaa2116",[[4,"pn-profile-selector",{language:[1537],returnUrl:[1,"return-url"],heading:[1],i18n:[32],isLoading:[32],numberOfProfiles:[32]}]]],["p-a7bb94a0",[[0,"pn-profile-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-f62d44bd",[[4,"pn-sidenav",{language:[1],navLabel:[1,"nav-label"],i18n:[32]},[[0,"language","setLanguage"],[0,"openSubMenuLevelChange","onOpenSubMenuLevelChange"]]]]],["p-227e1d46",[[4,"pn-sidenav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],alignment:[32]}]]],["p-f774e2cc",[[4,"pn-sidenav-link",{name:[1],href:[1],target:[1],linkid:[1],icon:[1],current:[4],levelId:[32],open:[32],hasChildren:[32]}]]],["p-67380aa4",[[4,"pn-sidenav-togglebutton",{label:[1],i18n:[32]}]]],["p-61dbe832",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}]]],["p-c240b614",[[0,"pn-bonus-progressbar-level",{current:[516],value:[1538],bonuspercentage:[1537],visualpercentage:[1538],percentage:[32],max:[32],min:[32],currency:[32]}]]],["p-996d8a6a",[[0,"pn-marketweb-input",{disabled:[4],error:[1],invalid:[4],helpertext:[1],label:[1],placeholder:[1],inputid:[1],name:[1],required:[4],type:[1025],autocomplete:[1],valid:[4],value:[1],maxlength:[1],min:[1],max:[1],step:[1],pattern:[1],showText:[32]}]]],["p-845d6b0a",[[0,"pn-find-price-result",{item:[1040],shownitems:[16],Usp1:[1,"usp-1"],Usp2:[1,"usp-2"],Usp3:[1,"usp-3"],description:[16],showMeasurement:[4,"show-measurement"],weightText:[32],linkId:[32],shopLabel:[32],shopUrl:[32],shopId:[32]}]]],["p-414dc33c",[[4,"pn-site-footer",{url:[1],linktitle:[1]}],[4,"pn-site-footer-col"]]],["p-15112837",[[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-715d1ef7",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["p-08411f5e",[[0,"pn-marketweb-siteheader-login-linklist",{heading:[1],links:[16],idNamespace:[1,"id-namespace"],loginManager:[16]}]]],["p-1b5ba17f",[[0,"pn-marketweb-siteheader-login-links",{loginDialog:[1040],loginManager:[16],idNamespace:[1,"id-namespace"],loggedin:[516],username:[1]}],[0,"pn-marketweb-siteheader-login-profileselection",{loginDialog:[1040],loginManager:[16],endpoint:[1],loggedin:[4],idNamespace:[1,"id-namespace"],heading:[1],i18n:[16],profileSelectorDialog:[1040],currentProfile:[1040],user:[32],logoutLink:[32],userName:[32]}]]],["p-8e146205",[[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]],["p-dc1827a6",[[0,"pn-marketweb-siteheader-login",{endpoint:[1],token:[1],i18n:[16],emitEvents:[4,"emit-events"],loginDialog:[1040],fullname:[1],loggedin:[4],showProfileSelection:[1028,"show-profile-selection"],loginManager:[32],loginLinks:[32],toggleButtonText:[32],username:[32]}],[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"],navLabel:[1,"nav-label"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopenstate","setMenuOpenState"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],language:[1537],search:[1040],primary:[4],autoCompleteOptions:[32]}],[4,"pn-site-selector",{buttontext:[1537],heading:[1537],language:[1537],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["p-2ac481d7",[[0,"pn-product-card-info",{rulle:[1],paket:[1],label:[1],text:[1]}],[0,"pn-product-card-price",{label:[1],amount:[1],currency:[1],note:[1],url:[1],service:[1],linkid:[1]}],[4,"pn-titletag",{icon:[1],color:[1537]}],[4,"pn-product-card"]]]],e)));
1
+ import{d as e,N as n,w as a,p as t,H as i,b as r}from"./p-58e8d7d5.js";const o=e=>{const n=e.cloneNode;e.cloneNode=function(e){if("TEMPLATE"===this.nodeName)return n.call(this,e);const a=n.call(this,!1),t=this.childNodes;if(e)for(let n=0;n<t.length;n++)2!==t[n].nodeType&&a.appendChild(t[n].cloneNode(!0));return a}};(()=>{o(i.prototype);const r=Array.from(e.querySelectorAll("script")).find((e=>new RegExp(`/${n}(\\.esm)?\\.js($|\\?|#)`).test(e.src)||e.getAttribute("data-stencil-namespace")===n)),l={};return"onbeforeload"in r&&!history.scrollRestoration?{then(){}}:(l.resourcesUrl=new URL(".",new URL(r.getAttribute("data-resources-url")||r.src,a.location.href)).href,t(l))})().then((e=>r([["p-f27f817e",[[4,"pn-marketweb-siteheader",{market:[1537],language:[1537],environment:[1537],userToken:[1,"user-token"],userFullname:[1,"user-fullname"],userLoggedin:[4,"user-loggedin"],endpoint:[1],hideSiteSelector:[1540,"hide-site-selector"],hideLanguageSelector:[1540,"hide-language-selector"],hideSearch:[1540,"hide-search"],hideLogin:[1540,"hide-login"],showProfileSelection:[1540,"show-profile-selection"],AutocompleteEndpoint:[1,"autocomplete-endpoint"],sessionForward:[4,"session-forward"],cache:[4],spaMode:[4,"spa-mode"],i18n:[32],gotData:[32],fetchingData:[32],homePageLink:[32],menuItems:[32],siteDefinition:[32],search:[32],siteSelector:[32],languageSelector:[32],languageOptions:[32],loginDialog:[32],minimizeSearch:[32],loggedIn:[32],loginManager:[32]},[[0,"setLanguage","onLanguageSelectorChange"],[0,"loginStateChange","onLoginStateChange"],[9,"resize","handleResize"]]]]],["p-00dc1309",[[0,"pn-find-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],weight:[32],weightvalue:[32],sourceData:[32],sizecategory:[32]}]]],["p-774b7a9f",[[0,"pn-find-service-and-price",{source:[1],language:[1025],market:[1025],filteredItems:[32],postagetype:[32],weight:[32],weightvalue:[32],deliveryscope:[32],sourceData:[32]}]]],["p-b32a8507",[[4,"pn-product-pricelist",{source:[1],language:[1025],market:[1025],productid:[1],filteredItems:[32],sourceData:[32],gotData:[32],loading:[32],postagetype:[32],weight:[32],weightvalue:[32]}]]],["p-17c4004f",[[0,"pn-product-pricelist-result",{item:[1040],description:[16],shownitems:[16],showMeasurement:[4,"show-measurement"],weightText:[32]}]]],["p-189ef99c",[[4,"pn-marketweb-sitefooter",{market:[1537],language:[1537],environment:[1537],endpoint:[1],cache:[4],siteDefinition:[32],footerContent:[32],i18n:[32],gotData:[32],fetchingData:[32]}]]],["p-51df9292",[[4,"pn-bonus-progressbar",{icon:[1],heading:[1],theme:[513],bonuspercentage:[1],currency:[513],value:[1538],min:[1538],max:[1538],valuepercentage:[32],progresspercentage:[32],levelValues:[32],currentLevelAdjustedValue:[32]}]]],["p-381b3ec0",[[0,"pn-pex-pricefinder",{language:[1],currency:[1],apiUrl:[1,"api-url"],i18n:[32],fromzip:[32],tozip:[32],weight:[32],when:[32],response:[32]},[[0,"language","setLanguage"]]]]],["p-1f2d9304",[[4,"pn-customernumber-selector",{language:[1537],open:[1540],heading:[1],description:[1],i18n:[32]}]]],["p-e32dc098",[[4,"pn-customernumber-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-81d764a0",[[1,"pn-filter-checkbox",{value:[520],name:[1],checkboxid:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-e9fe5c54",[[1,"pn-marketweb-search",{disabled:[4],placeholder:[1],inputid:[1],name:[1],autocomplete:[1],list:[1],value:[1],label:[1],loading:[4],button:[1],light:[4],suggestionObserver:[32],hasClonedInput:[32],listSuggestion:[32]},[[0,"input","inputHandler"]]]]],["p-d0155ddf",[[4,"pn-product-tile"]]],["p-dbaa2116",[[4,"pn-profile-selector",{language:[1537],returnUrl:[1,"return-url"],heading:[1],i18n:[32],isLoading:[32],numberOfProfiles:[32]}]]],["p-a7bb94a0",[[0,"pn-profile-selector-option",{heading:[1],description:[1],url:[1]}]]],["p-f62d44bd",[[4,"pn-sidenav",{language:[1],navLabel:[1,"nav-label"],i18n:[32]},[[0,"language","setLanguage"],[0,"openSubMenuLevelChange","onOpenSubMenuLevelChange"]]]]],["p-227e1d46",[[4,"pn-sidenav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],alignment:[32]}]]],["p-f774e2cc",[[4,"pn-sidenav-link",{name:[1],href:[1],target:[1],linkid:[1],icon:[1],current:[4],levelId:[32],open:[32],hasChildren:[32]}]]],["p-67380aa4",[[4,"pn-sidenav-togglebutton",{label:[1],i18n:[32]}]]],["p-61dbe832",[[0,"pn-find-service-and-price-result",{item:[1040],shownitems:[16],weightText:[32]}]]],["p-c240b614",[[0,"pn-bonus-progressbar-level",{current:[516],value:[1538],bonuspercentage:[1537],visualpercentage:[1538],percentage:[32],max:[32],min:[32],currency:[32]}]]],["p-996d8a6a",[[0,"pn-marketweb-input",{disabled:[4],error:[1],invalid:[4],helpertext:[1],label:[1],placeholder:[1],inputid:[1],name:[1],required:[4],type:[1025],autocomplete:[1],valid:[4],value:[1],maxlength:[1],min:[1],max:[1],step:[1],pattern:[1],showText:[32]}]]],["p-845d6b0a",[[0,"pn-find-price-result",{item:[1040],shownitems:[16],Usp1:[1,"usp-1"],Usp2:[1,"usp-2"],Usp3:[1,"usp-3"],description:[16],showMeasurement:[4,"show-measurement"],weightText:[32],linkId:[32],shopLabel:[32],shopUrl:[32],shopId:[32]}]]],["p-414dc33c",[[4,"pn-site-footer",{url:[1],linktitle:[1]}],[4,"pn-site-footer-col"]]],["p-15112837",[[4,"pn-choice-button",{value:[520],name:[1],choiceid:[1],type:[1],disabled:[4],checked:[4],indeterminate:[1028]},[[0,"change","handlechange"]]]]],["p-715d1ef7",[[4,"pn-mainnav-link",{name:[1],href:[1],target:[1],linkid:[1],levelId:[32],open:[32],hasChildren:[32]}]]],["p-08411f5e",[[0,"pn-marketweb-siteheader-login-linklist",{heading:[1],links:[16],idNamespace:[1,"id-namespace"],loginManager:[16]}]]],["p-bd827fe6",[[0,"pn-marketweb-siteheader-login-links",{loginDialog:[1040],loginManager:[16],idNamespace:[1,"id-namespace"],loggedin:[516],username:[1]}],[0,"pn-marketweb-siteheader-login-profileselection",{loginDialog:[1040],loginManager:[16],endpoint:[1],loggedin:[4],idNamespace:[1,"id-namespace"],heading:[1],i18n:[16],profileSelectorDialog:[1040],currentProfile:[1040],user:[32],logoutLink:[32],userName:[32]}]]],["p-8e146205",[[0,"pn-product-tile-info",{label:[1],text:[1],icon:[1]}],[0,"pn-product-tile-price",{label:[1],amount:[1],currency:[1],url:[1]}]]],["p-dc1827a6",[[0,"pn-marketweb-siteheader-login",{endpoint:[1],token:[1],i18n:[16],emitEvents:[4,"emit-events"],loginDialog:[1040],fullname:[1],loggedin:[4],showProfileSelection:[1028,"show-profile-selection"],loginManager:[32],loginLinks:[32],toggleButtonText:[32],username:[32]}],[4,"pn-mainnav-level",{level:[32],levelId:[32],isOpen:[32],parentName:[32],parentHref:[32],parentLinkId:[32],listCount:[32],alignment:[32]}],[4,"pn-language-selector",{value:[1537],selectedLanguageName:[32],options:[32],i18n:[32]}],[0,"pn-language-selector-option",{name:[1],code:[1],url:[1],selected:[4],currentLanguage:[1,"current-language"]}],[4,"pn-mainnav",{market:[1],language:[1],navigationId:[1,"navigation-id"],openMenu:[1028,"open-menu"],navLabel:[1,"nav-label"]},[[0,"language","setLanguage"],[0,"market","setMarket"],[0,"menuLanguageChange","onLanguageChange"],[0,"setmenuopenstate","setMenuOpenState"],[0,"openMenuLevelChange","onOpenMenuLevelChange"]]],[4,"pn-mainnav-list",{heading:[1],linkCount:[32]}],[0,"pn-marketweb-siteheader-search",{i18n:[8,"i-1-8n"],showOnlyLink:[1028,"show-only-link"],hideSearch:[1028,"hide-search"],language:[1537],search:[1040],primary:[4],autoCompleteOptions:[32]}],[4,"pn-site-selector",{buttontext:[1537],heading:[1537],language:[1537],i18n:[32]}],[0,"pn-site-selector-item",{url:[1],heading:[1],description:[1],newwindow:[4]}]]],["p-2ac481d7",[[0,"pn-product-card-info",{rulle:[1],paket:[1],label:[1],text:[1]}],[0,"pn-product-card-price",{label:[1],amount:[1],currency:[1],note:[1],url:[1],service:[1],linkid:[1]}],[4,"pn-titletag",{icon:[1],color:[1537]}],[4,"pn-product-card"]]]],e)));
@@ -55,7 +55,8 @@ export interface ProfileSelectorDialog {
55
55
  }
56
56
  export interface ProfileSelectorCustomer {
57
57
  name: string;
58
- organizationNumber: string;
58
+ customerNumber: string;
59
+ id: string;
59
60
  selected: boolean;
60
61
  }
61
62
  export interface LoginDialogLink {
@@ -18,7 +18,7 @@
18
18
 
19
19
  const s = document.createElement('script');
20
20
  s.setAttribute("type", "module");
21
- s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.33/umd/standalone-loader-salesforce.js");
21
+ s.setAttribute("src", "https://cdn.jsdelivr.net/npm/@postnord/pn-marketweb-components@2.0.34/umd/standalone-loader-salesforce.js");
22
22
  document.querySelector("head").appendChild(s);
23
23
 
24
24
 
@@ -1 +0,0 @@
1
- import{r as e,h as i,a as t,g as n}from"./p-58e8d7d5.js";let o=class{constructor(i){e(this,i),this.loginDialog=null,this.loginManager=null,this.idNamespace="",this.loggedin=!1,this.username=""}componentWillLoad(){this.init()}async init(){this.adjustLoginLinks()}adjustLoginLinks(){var e,i,t,n;if(!this.loginDialog)return;const o=(e,i)=>{e.isLogoutLink=-1!==e.href.indexOf("logout"),e.isLogoutLink&&(e.href=this.loginManager.getLogoutUrl(e.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))),0!==i||e.href||(e.href=this.loginManager.getLoginUrl(),e.linkType="primary"),e.primaryLinkApperance&&!e.linkType&&(e.linkType="primary")};(null===(e=this.loginDialog)||void 0===e?void 0:e.loginMenuLinks)&&(null===(i=this.loginDialog)||void 0===i||i.loginMenuLinks.forEach(o)),(null===(t=this.loginDialog)||void 0===t?void 0:t.loggedInLinks)&&(null===(n=this.loginDialog)||void 0===n||n.loggedInLinks.forEach(o)),this.loginDialog.legacyLoginLinks=[{href:this.loginManager.getLoginUrl(this.loginDialog.loginUrl),linkText:this.loginDialog.loginLinkText,openInNewWindow:!1,isLogoutLink:!1,pageLink:null,linkType:"primary",primaryLinkApperance:!0},{href:this.loginManager.getLoginUrl(this.loginDialog.registerUrl),linkText:this.loginDialog.createLoginLinkText,openInNewWindow:!1,isLogoutLink:!1,pageLink:null,primaryLinkApperance:!1}]}render(){var e;if(!this.loginDialog)return;let n={username:null,loggedin:!1};return this.username&&(n.username=this.username,n.loggedin=this.loggedin),i(t,Object.assign({},n),this.loginDialog.overrideLoginMenu?null:i("div",{"data-loggedin":this.loggedin+""},this.loggedin?i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):i("div",null,(null===(e=this.loginDialog.loginMenuLinks)||void 0===e?void 0:e.length)>0?i("pn-marketweb-siteheader-login-linklist",{heading:this.loginDialog.loginTitle,links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.legacyLoginLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}))),this.loginDialog.overrideLoginMenu?i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loginMenuLinks,loginManager:this.loginManager,idNamespace:this.idNamespace}):null)}get hostElement(){return n(this)}static get watchers(){return{loginDialog:["init"]}}};o.style="";let l=class{constructor(i){e(this,i),this.loginDialog=null,this.loginManager=null,this.endpoint="",this.loggedin=!1,this.idNamespace="",this.heading=null,this.i18n={searchlabel:"",searchplaceholder:"",searchbuttontext:"",menuHomeButton:"",menuGoBackButton:"",mainMenuButton:"",menuStartButton:"",profileSelectionFlyoutHeading:""},this.user=null,this.logoutLink=null,this.userName=null,this.profileSelectorDialog={profiles:[]},this.currentProfile=null}componentWillLoad(){var e;null===this.heading&&(null===(e=this.i18n)||void 0===e?void 0:e.profileSelectionFlyoutHeading)&&(this.heading=this.i18n.profileSelectionFlyoutHeading),this.init()}init(){this.updateUserInfo(),this.adjustLoginLinks(),this.fetchProfiles()}async fetchProfiles(){if(!this.loggedin||!this.profileSelectorDialog||this.profileSelectorDialog.profiles.length>0)return;let e=`${this.endpoint}${this.endpoint.lastIndexOf("/")===this.endpoint.length-1?"":"/"}api/user/parentprofiles`;const i=await fetch(e),t=await i.json(),n=-1!==window.location.href.indexOf("localhost:6008")?{loggedin:!0,profiles:[{name:"Hedin HMC Motor Company AB",organizationNumber:"5560230053",selected:!1},{name:"Bilmetro AB",organizationNumber:"5560612789",selected:!0}]}:t;if(!n||!n.profiles||!n.profiles.length)return;this.profileSelectorDialog.profiles=n.profiles;const o=n.profiles.filter((e=>!0===e.selected));o[0]&&o[0].name&&(this.currentProfile=o[0])}adjustLoginLinks(){var e,i,t,n;(null===(e=this.loginDialog)||void 0===e?void 0:e.loggedInLinks)&&(null===(i=this.loginDialog)||void 0===i||i.loggedInLinks.forEach(((e,i)=>{e.isLogoutLink=-1!==e.href.indexOf("logout"),e.isLogoutLink&&(e.href=this.loginManager.getLogoutUrl(e.href.replace("logout","").replace("http://window.location.href/?","").replace("https://window.location.href/?",""))),0!==i||e.href||(e.href=this.loginManager.getLoginUrl(),e.linkType="primary"),e.primaryLinkApperance&&!e.linkType&&(e.linkType="primary")}))),this.logoutLink=null!==(n=null===(t=this.loginDialog)||void 0===t?void 0:t.loggedInLinks.filter((e=>e.isLogoutLink))[0])&&void 0!==n?n:null}updateUserInfo(){const e=this.loginManager.getUserInfo();this.user=e,e&&(e.given_name?this.userName=e.given_name:e.family_name?this.userName=e.family_name:e.username&&(this.userName=e.username))}render(){if(this.loginDialog&&this.profileSelectorDialog)return i(t,Object.assign({},{}),this.heading?i("strong",{class:"pn-marketweb-siteheader-login-profileselection-heading"},this.heading):null,i("div",{class:"pn-marketweb-siteheader-login-profileselection-user"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-user-name"},this.userName),this.user&&this.user.username&&this.userName!==this.user.username?i("div",{class:"pn-marketweb-siteheader-login-profileselection-user-description"},this.user.username):null),null!==this.currentProfile&&this.currentProfile.name?i("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-name"},this.currentProfile.name),i("div",{class:"pn-marketweb-siteheader-login-profileselection-currentprofile-description"},this.currentProfile.organizationNumber)):null,i("pn-marketweb-siteheader-login-linklist",{links:this.loginDialog.loggedInLinks.filter((e=>!1===e.isLogoutLink)),loginManager:this.loginManager,idNamespace:this.idNamespace}),i("div",{class:"pn-marketweb-siteheader-login-profileselection-divider"}),this.profileSelectorDialog.profiles.filter((e=>!1===e.selected)).map((e=>i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption"},i("a",{href:`${this.endpoint}/UnifiedLogin/ExternalLoginCallback?returnUrl=${window.location.href}?profile=${e.organizationNumber}}`,class:"pn-marketweb-siteheader-login-profileselection-profileoption-link"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-content"},i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-name"},e.name),i("div",{class:"pn-marketweb-siteheader-login-profileselection-profileoption-description"},e.organizationNumber)),i("pn-icon",{symbol:"arrow-right",small:"false",color:"blue700"}))))),this.logoutLink?i("div",{class:"pn-marketweb-siteheader-login-profileselection-logout"},i("a",{href:this.logoutLink.href,rel:"nofollower noopener",class:"pn-marketweb-siteheader-login-profileselection-logout-link"},this.logoutLink.linkText)):null)}get hostElement(){return n(this)}};l.style='.pn-marketweb-siteheader-login-profileselection-heading{display:block;padding:0.5rem 0 1rem}.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}.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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-divider{height:1rem;width:100%;background:#00A0D6;position:relative;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:"";width:0.6em;height:0.6em;border-radius:50%;position:absolute;right:0;top:0;background:inherit;-webkit-transform:translateX(calc(100% + 0.2em));transform:translateX(calc(100% + 0.2em))}.pn-marketweb-siteheader-login-profileselection-profileoption-link{display:-ms-flexbox;display:flex;background:#FFFFFF;-webkit-transition:background 0.15s ease-in-out;transition:background 0.15s ease-in-out;margin:0 -1em;padding:0.6rem 1.6rem;text-decoration:none;color:#005D92;-ms-flex-align:center;align-items:center}.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:#F3F2F2}.pn-marketweb-siteheader-login-profileselection-profileoption-content{-ms-flex-positive:1;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:#5E554A;font-size:0.75em}.pn-marketweb-siteheader-login-profileselection-logout{padding:1.6rem;text-align:center;width:100%}.pn-marketweb-siteheader-login-profileselection-logout-link{display:inline-block;font-weight:500;color:#005D92;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}';export{o as pn_marketweb_siteheader_login_links,l as pn_marketweb_siteheader_login_profileselection}