@digital-realty/app-shell 11.0.9 → 11.0.10-IXUAT-10608.523213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-tWAVf8nP.js +1492 -0
- package/dist/bootstrap.js +1 -1
- package/dist/logout-CEMELcLl.js +1 -0
- package/package.json +1 -1
- package/dist/app-Chr_UAn6.js +0 -1492
- package/dist/logout-DwQJmwiJ.js +0 -1
package/dist/bootstrap.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as S}from"tslib";import{LitElement as I,html as c}from"lit";import{property as C}from"lit/decorators.js";import{ApplicationInsights as q,DistributedTracingModes as Q}from"@microsoft/applicationinsights-web";import{authedUser as T}from"@digital-realty/ix-account-switcher";import{UserManager as Z}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as ee,action as te,observable as se,toJS as ae}from"mobx";const R="planbglobalportalui",re="openid service_management_profile offline_access user_management_profile resource.notifications resource.usermanagementapi resource.servicemanagementapi resource.inventory resource.cookieconsents",O="https://login-a1.digitalrealty.com",ne="https://inxn-a1-gpappshell.azureedge.net/?logout=true",P="https://api-a1.interxion.com",oe="",ie="local",ce="GTM-KXBK8CQP",le=24,pe="https://api-a1.interxion.com",ue="ui-ticket-updates-accessAt,ix-grid-,-grid,app-state,releaseNotesViewed",_e="https://gp-dev.digitalrealty.com/standalone/knowledge-base",de="https://portal.interxion.com",Ee="https://inxn-a1-gpappshell.azureedge.net",me="https://demo.servicefabric.digitalrealty.com/",he="https://marketplaceportal.com/group/telx-new-portal",ge="gp-uat.digitalrealty.com",Ae=!1,Se="/cookie-policy",Ie="1.0",Ce="*digitalrealty.com,gpportaltests-b@yahoo.com",Te={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},Re={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell"},N="globalportalappshell",l="user-authentication",_="redirect-url",Oe="ui-cookie-policy",Pe="date-format",f="Global Portal",w="Service Fabric",L="Marketplace Portal",b="EMEA Customer Portal",y="x-auth",[p,Ne,fe,we]=["CREATE","UPDATE","READ","APPROVE"],[v,d,Le,be,U,ye,bt,ve,k,yt,Ue,ke,x,M,D,vt,xe,Ut,Me,V,G,B,De,H,Ve,Ge,j,Be]=["Cloud Connect","Cross Connect","Custom Roles","Customer Care","Customer Equipment Connection (CEC)","Customer Support","DCIM-enabled location data","Default System Roles","External User","Facility Access","Internal Roles","Internal User","Internet Exchange","Intra-Customer Connectivity (ICC)","IP Bandwidth","OSP Access","Permanent Badge","PoP/POE Room Access","Remote Hands","Remote Hands Package","Service Exchange Cloud Router","Service Exchange Port","Shipping & Receiving","Space & Power","Trouble Ticket","Visitor Access","User","ESG Reporting"],He=[Me,ye,Ve,De,Ge,xe,be],je=[d,v,U,x,M,D,V,G,B,H],Ke=[d,v,U,x,M,D,V,G,B,H],Fe={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},$e={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges"}},[Ye,ze,Xe]=["Security","DCIM","Planned Site Maintenance"],Je=[Ye,ze,Xe],We=[{label:f,href:Ee,selected:!0},{label:L,href:he},{label:b,href:de},{label:w,href:me,target:"_blank"}],K={appInsights:"_appInsights"},qe=()=>{const e=new q({config:{instrumentationKey:oe,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:Q.AI_AND_W3C,correlationHeaderExcludedDomains:ge.split(",").map(t=>t.trim())}});return e.loadAppInsights(),e.trackPageView(),e.addTelemetryInitializer(t=>{t.tags["ai.cloud.role"]=N}),e},u=(e,t,s)=>(...a)=>{const[r,...n]=a;typeof r=="string"&&r.startsWith("[mobx]")&&t===4?s.trackException({exception:{message:n[0].message,stack:n[0].stack,name:r},severityLevel:4}):s.trackTrace({severityLevel:t,message:r},n),e.apply(console,[r,...n])},Qe=e=>{console.log=u(console.log,2,e),console.info=u(console.info,2,e),console.warn=u(console.warn,3,e),console.error=u(console.error,4,e),window.console=console},Ze=()=>{const e=qe();window[K.appInsights]=e,window.dispatchEvent(new Event("appInsightsInitialized")),Qe(e)},F=async e=>{const t=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(s)).map(a=>a.toString(16).padStart(2,"0")).join("")};function et(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`;return{authority:O,client_id:R,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:re,post_logout_redirect_uri:ne,monitorSession:!1}}const E=new Z(et()),tt=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(t).split("").map(a=>`%${`00${a.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(s)},st=()=>{localStorage.removeItem(l)},i=()=>{const e=localStorage.getItem(l);return e?JSON.parse(e):null},at=()=>{var e;const t=localStorage.getItem(y);return t?(e=JSON.parse(t))==null?void 0:e.email:null},rt=async()=>{const e=i();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await F(t)},$=()=>{const e=i();return e?e.id_token:null},Y=(e,t)=>{const s={...t,...e},a=tt(e.access_token);return s.profile.sub=a.sub,s.profile.account_number=a.account_number,s.expires_at=a.exp,s.is_federated=a.is_federated,T.setAccount({accountNumber:a.account_number,email:a.email,name:a.name,givenName:a.given_name,familyName:a.family_name,authTime:a.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(l,JSON.stringify(s)),s},nt=e=>{Y(e,null)},ot=()=>{const e=i();return e?e.access_token:null},it=()=>{const e=i();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},ct=()=>{const e=i();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},lt=["authenticate","auth-callback","logout"],pt=e=>e.expires_at&&new Date(e.expires_at*1e3),ut=e=>e.expires_at&&new Date(e.expires_at*1e3+le*60*60*1e3),z=()=>{const e=i();if(!$())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>pt(e):t>ut(e)},_t=()=>{const e=window.location.pathname.split("/");return lt.includes(e[e.length-1])},dt=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(E.signinRedirect(),!0):!1},Et=()=>{let e="/";const t=localStorage.getItem(_);t&&(localStorage.removeItem(_),e=t),window.location.href=e},mt=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},m=e=>{const t=_t();(!t||e)&&(t||localStorage.setItem(_,window.location.href),window.location.href="/authenticate")},ht=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,s=await F(t);return{...e,profile:{...e.profile,hashed_identifier:s}}},gt=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(E.signinRedirectCallback().then(mt).then(ht).then(nt).then(Et).catch(m),!0):!1};class At extends I{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",At);var St=Object.defineProperty,It=(e,t,s)=>t in e?St(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,h=(e,t,s)=>It(e,typeof t!="symbol"?t+"":t,s);class Ct{constructor(){h(this,"permissions",[]),h(this,"loading",!1),h(this,"getPermissions",async()=>{var t;const s=(t=T)==null?void 0:t.access_token;if(!s)return[];const a=await fetch(`${P}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${s}`}});return a.ok?a.json():[]}),ee(this,{permissions:se,setPermissions:te})}setPermissions(t){this.permissions=t.reduce((s,a)=>(s[a.permission_name]=a.privilege,s),{})}tryLoadPermissions(){try{this.loading||(this.loading=!0,this.getPermissions().then(t=>{this.setPermissions(t),this.loading=!1}).catch(()=>{this.loading=!1}))}catch(t){this.loading=!1}}clearPermissions(){this.setPermissions([])}hasExternalUserCreate(){return this.hasPermission(k,p)||this.hasPermission(j,p)}hasConnectivityCreate(){return this.hasPermission(d,p)}hasPrivilegeLevel(t,s){const a=[we,p,Ne,fe],r=a.findIndex(o=>o===t),n=a.findIndex(o=>o===s);return r>=n}hasPermission(t,s){let a=!1;const r=ae(this.permissions),n=Object.keys(r).find(o=>o===t);return n&&(a=this.hasPrivilegeLevel(s,r[n])),a}}const g=new Ct;class A extends I{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{z()&&m()};try{Ze()}catch(s){console.error("Telemetry initialization failed:",s)}const t=window.location.pathname;if(t==="/session-expired"){this._currentView="session-expired",this._loadView("session-expired");return}if(t==="/logout"){this._currentView="logout",this._loadView("logout");return}if(dt()||gt()){this._currentView="splash";return}if(z()){this._currentView="splash",m();return}this._currentView="app",this._loadApp()}async _loadView(t){t==="session-expired"?await import("@digital-realty/ix-app-logic/views/session-expiry.js"):t==="logout"&&await import("./logout-DwQJmwiJ.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,s,a;return(a=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?a:(s=(t=i())==null?void 0:t.profile)==null?void 0:s.account_number}_isESGAccessOnly(t,s){const a=t.filter(r=>r.account_number===s);return a.length===1&&a[0].permission_name==="ESG Reporting"}_applyMfeOverrides(t,s){const a={};for(const r of Object.keys(t))a[r]={...t[r],enabled:s.includes(r)};return a}async _loadApp(){var t;const{authedUser:s}=await import("@digital-realty/ix-account-switcher");await s.hydrateStore();const[a,r]=await Promise.allSettled([fetch("./registered-apps.json").then(W=>W.json()),g.getPermissions()]);if(a.status==="rejected"){console.error("Failed to load registered apps:",a.reason);return}if(r.status==="rejected"){console.error("Failed to load permissions:",r.reason);return}const{registeredApps:n}=a.value,o=r.value,X=(t=this._getAccountNumber())!=null?t:"",J=this._isESGAccessOnly(o,X)?this._applyMfeOverrides(n,["ui-esg"]):n;window.registeredApps=Object.freeze(J),g.setPermissions(o),await import("./app-Chr_UAn6.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return c`<ix-session-expiry></ix-session-expiry>`;case"logout":return c`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?c`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:c`<splash-screen></splash-screen>`;default:return c`<splash-screen></splash-screen>`}}}S([C({type:String})],A.prototype,"_currentView",void 0),S([C({type:Boolean})],A.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",A);export{Ce as A,l as B,Le as C,ve as D,ie as E,y as F,ce as G,Te as H,je as I,Pe as J,Oe as K,O as L,L as M,_e as N,Ke as O,ue as P,pe as Q,Je as R,He as S,Se as T,j as U,Re as V,Ie as W,Ae as a,rt as b,st as c,at as d,ot as e,i as f,$ as g,Y as h,R as i,P as j,Fe as k,it as l,$e as m,Be as n,ke as o,g as p,k as q,Ue as r,b as s,We as t,E as u,f as v,w,K as x,N as y,ct as z};
|
|
1
|
+
import{__decorate as A}from"tslib";import{LitElement as S,html as c}from"lit";import{property as w}from"lit/decorators.js";import{ApplicationInsights as q,DistributedTracingModes as W}from"@microsoft/applicationinsights-web";import{authedUser as I}from"@digital-realty/ix-account-switcher";import{UserManager as X}from"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import{makeObservable as Q,action as Z,observable as ee,toJS as te}from"mobx";function a(){var e;const t=(e=window.gpConfig)==null?void 0:e["app-shell"];if(!t)throw new Error("App-shell config not loaded. Ensure config.json is fetched before app bootstrap.");return t}const{PortalInterxion:se,PortalGlobalPortal:re,PortalServiceFabric:ne,PortalMarketplacePortal:oe}=a(),ae={strict:"strictly_necessary",performance:"performance",targeting:"targeting"},ie={accept:"accept_all",reject:"reject_all",custom:"customize",no:"no_sell"},P="globalportalappshell",p="user-authentication",h="redirect-url",le="ui-cookie-policy",ce="date-format",R="Global Portal",T="Service Fabric",b="Marketplace Portal",N="EMEA Customer Portal",O="x-auth",[u,pe,ue,de]=["CREATE","UPDATE","READ","APPROVE"],[y,m,he,me,v,ge,mt,_e,k,gt,Ee,Ce,x,U,L,_t,fe,Et,Ae,M,D,V,Se,G,we,Ie,j,Pe]=["Cloud Connect","Cross Connect","Custom Roles","Customer Care","Customer Equipment Connection (CEC)","Customer Support","DCIM-enabled location data","Default System Roles","External User","Facility Access","Internal Roles","Internal User","Internet Exchange","Intra-Customer Connectivity (ICC)","IP Bandwidth","OSP Access","Permanent Badge","PoP/POE Room Access","Remote Hands","Remote Hands Package","Service Exchange Cloud Router","Service Exchange Port","Shipping & Receiving","Space & Power","Trouble Ticket","Visitor Access","User","ESG Reporting"],Re=[Ae,ge,we,Se,Ie,fe,me],Te=[m,y,v,x,U,L,M,D,V,G],be=[m,y,v,x,U,L,M,D,V,G],Ne={LocationChanged:"location-changed",VaadinRouterLocationChanged:"vaadin-router-location-changed",CreateUserClicked:"create-user-clicked"},Oe={SessionStorage:{HasOutstandingChanges:"hasOutstandingChanges"}},[ye,ve,ke]=["Security","DCIM","Planned Site Maintenance"],xe=[ye,ve,ke],Ue=[{label:R,href:re,selected:!0},{label:b,href:oe},{label:N,href:se},{label:T,href:ne,target:"_blank"}],H={appInsights:"_appInsights"},Le=()=>{const{ApplicationInsightsInstrumentationKey:e,ApplicationInsightsCorrelationHeaderExcludedDomains:t}=a(),s=new q({config:{instrumentationKey:e,enableCorsCorrelation:!0,enableRequestHeaderTracking:!0,enableResponseHeaderTracking:!0,enableAutoRouteTracking:!0,autoTrackPageVisitTime:!0,enableAjaxErrorStatusText:!0,enableAjaxPerfTracking:!0,enableUnhandledPromiseRejectionTracking:!0,isCookieUseDisabled:!0,distributedTracingMode:W.AI_AND_W3C,correlationHeaderExcludedDomains:t.split(",").map(r=>r.trim())}});return s.loadAppInsights(),s.trackPageView(),s.addTelemetryInitializer(r=>{r.tags["ai.cloud.role"]=P}),s},d=(e,t,s)=>(...r)=>{const[n,...o]=r;typeof n=="string"&&n.startsWith("[mobx]")&&t===4?s.trackException({exception:{message:o[0].message,stack:o[0].stack,name:n},severityLevel:4}):s.trackTrace({severityLevel:t,message:n},o),e.apply(console,[n,...o])},Me=e=>{console.log=d(console.log,2,e),console.info=d(console.info,2,e),console.warn=d(console.warn,3,e),console.error=d(console.error,4,e),window.console=console},De=()=>{const e=Le();window[H.appInsights]=e,window.dispatchEvent(new Event("appInsightsInitialized")),Me(e)},$=async e=>{const t=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(s)).map(r=>r.toString(16).padStart(2,"0")).join("")};function Ve(){const{location:e}=window,t=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`,{LoginAuthority:s,GlobalPortalClientId:r,GlobalPortalUIScopes:n,GlobalPlanBShellPostLogoutRedirectUrl:o}=a();return{authority:s,client_id:r,redirect_uri:`${t}/auth-callback`,response_type:"code",scope:n,post_logout_redirect_uri:o,monitorSession:!1}}const g=new X(Ve()),Ge=e=>{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),s=decodeURIComponent(window.atob(t).split("").map(r=>`%${`00${r.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""));return JSON.parse(s)},je=()=>{localStorage.removeItem(p)},l=()=>{const e=localStorage.getItem(p);return e?JSON.parse(e):null},He=()=>{var e;const t=localStorage.getItem(O);return t?(e=JSON.parse(t))==null?void 0:e.email:null},$e=async()=>{const e=l();if(!e)return null;const t=(e.profile.given_name||"")+(e.profile.family_name||"")+e.profile.sub;return await $(t)},B=()=>{const e=l();return e?e.id_token:null},F=(e,t)=>{const s={...t,...e},r=Ge(e.access_token);return s.profile.sub=r.sub,s.profile.account_number=r.account_number,s.expires_at=r.exp,s.is_federated=r.is_federated,I.setAccount({accountNumber:r.account_number,email:r.email,name:r.name,givenName:r.given_name,familyName:r.family_name,authTime:r.exp,accessToken:e.access_token,idToken:e.id_token}),localStorage.setItem(p,JSON.stringify(s)),s},Be=e=>{F(e,null)},Fe=()=>{const e=l();return e?e.access_token:null},Ke=()=>{const e=l();return e&&e.is_federated!==null&&e.is_federated!==void 0?String(e.is_federated).toLowerCase()==="true":!1},ze=()=>{const e=l();return e!=null&&e.expires_at?e.expires_at>Date.now()/1e3:!1},Je=["authenticate","auth-callback","logout"],Ye=e=>e.expires_at&&new Date(e.expires_at*1e3),qe=e=>e.expires_at&&new Date(e.expires_at*1e3+a().TokenValidForOfflineUsePostExpiryInHours*60*60*1e3),K=()=>{if(!a().IsLoginEnabled)return!1;const e=l();if(!B())return!0;if(!e.expires_at)return!1;const t=new Date;return navigator.onLine?t>Ye(e):t>qe(e)},We=()=>{const e=window.location.pathname.split("/");return Je.includes(e[e.length-1])},Xe=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="authenticate"?(a().IsLoginEnabled?g.signinRedirect():window.location.href="/",!0):!1},Qe=()=>{let e="/";const t=localStorage.getItem(h);t&&(localStorage.removeItem(h),e=t),window.location.href=e},Ze=e=>{if(!e.id_token)throw new Error("Missing property:id_token");return e},_=e=>{const t=We();(!t||e)&&(t||localStorage.setItem(h,window.location.href),window.location.href="/authenticate")},et=async e=>{const t=`${e.profile.sub}-${e.profile.customer_id}`,s=await $(t);return{...e,profile:{...e.profile,hashed_identifier:s}}},tt=()=>{const e=window.location.pathname.split("/");return e[e.length-1]==="auth-callback"?(g.signinRedirectCallback().then(Ze).then(et).then(Be).then(Qe).catch(_),!0):!1};class st extends S{render(){return c` <ix-splash-screen></ix-splash-screen> `}}window.customElements.define("splash-screen",st);var rt=Object.defineProperty,nt=(e,t,s)=>t in e?rt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,E=(e,t,s)=>nt(e,typeof t!="symbol"?t+"":t,s);class ot{constructor(){E(this,"permissions",[]),E(this,"loading",!1),E(this,"getPermissions",async()=>{var t;const s=(t=I)==null?void 0:t.access_token;if(!s)return[];const{ApiBaseUrl:r}=a(),n=await fetch(`${r}/usermanagement/my-permissions?exclude_parents=false&exclude_siblings=true`,{headers:{Authorization:`Bearer ${s}`}});return n.ok?n.json():[]}),Q(this,{permissions:ee,setPermissions:Z})}setPermissions(t){this.permissions=t.reduce((s,r)=>(s[r.permission_name]=r.privilege,s),{})}tryLoadPermissions(){try{this.loading||(this.loading=!0,this.getPermissions().then(t=>{this.setPermissions(t),this.loading=!1}).catch(()=>{this.loading=!1}))}catch(t){this.loading=!1}}clearPermissions(){this.setPermissions([])}hasExternalUserCreate(){return this.hasPermission(k,u)||this.hasPermission(j,u)}hasConnectivityCreate(){return this.hasPermission(m,u)}hasPrivilegeLevel(t,s){const r=[de,u,pe,ue],n=r.findIndex(i=>i===t),o=r.findIndex(i=>i===s);return n>=o}hasPermission(t,s){let r=!1;const n=te(this.permissions),o=Object.keys(n).find(i=>i===t);return o&&(r=this.hasPrivilegeLevel(s,n[o])),r}}const C=new ot;class f extends S{constructor(){super(),this._currentView="splash",this.appLoaded=!1,this._onPopState=()=>{a().IsLoginEnabled&&K()&&_()};try{De()}catch(s){console.error("Telemetry initialization failed:",s)}const t=window.location.pathname;if(t==="/session-expired"){this._currentView="session-expired",this._loadView("session-expired");return}if(t==="/logout"){this._currentView="logout",this._loadView("logout");return}if(Xe()||tt()){this._currentView="splash";return}if(K()){this._currentView="splash",_();return}this._currentView="app",this._loadApp()}async _loadView(t){t==="session-expired"?await import("@digital-realty/ix-app-logic/views/session-expiry.js"):t==="logout"&&await import("./logout-CEMELcLl.js")}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._onPopState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._onPopState)}_getAccountNumber(){var t,s,r;return(r=new URLSearchParams(window.location.search).get("selected_account_number"))!=null?r:(s=(t=l())==null?void 0:t.profile)==null?void 0:s.account_number}_isESGAccessOnly(t,s){const r=t.filter(n=>n.account_number===s);return r.length===1&&r[0].permission_name==="ESG Reporting"}_applyMfeOverrides(t,s){const r={};for(const n of Object.keys(t))r[n]={...t[n],enabled:s.includes(n)};return r}async _loadApp(){var t;const{authedUser:s}=await import("@digital-realty/ix-account-switcher");await s.hydrateStore();const[r,n]=await Promise.allSettled([fetch("./registered-apps.json").then(Y=>Y.json()),C.getPermissions()]);if(r.status==="rejected"){console.error("Failed to load registered apps:",r.reason);return}if(n.status==="rejected"){console.error("Failed to load permissions:",n.reason);return}const{registeredApps:o}=r.value,i=n.value,z=(t=this._getAccountNumber())!=null?t:"",J=this._isESGAccessOnly(i,z)?this._applyMfeOverrides(o,["ui-esg"]):o;window.registeredApps=Object.freeze(J),C.setPermissions(i),await import("./app-tWAVf8nP.js"),this.appLoaded=!0}render(){switch(this._currentView){case"session-expired":return c`<ix-session-expiry></ix-session-expiry>`;case"logout":return c`<ixp-logout></ixp-logout>`;case"app":return this.appLoaded?c`<global-portal-app appTitle="DLR" showDrawer></global-portal-app>`:c`<splash-screen></splash-screen>`;default:return c`<splash-screen></splash-screen>`}}}A([w({type:String})],f.prototype,"_currentView",void 0),A([w({type:Boolean})],f.prototype,"appLoaded",void 0),window.customElements.define("gp-bootstrap",f);export{Ne as A,ie as B,he as C,_e as D,Pe as E,R as G,Te as I,b as M,be as O,xe as R,Re as S,j as U,B as a,$e as b,je as c,He as d,Fe as e,l as f,a as g,F as h,Ke as i,Oe as j,Ce as k,k as l,Ee as m,N as n,Ue as o,C as p,T as q,H as r,P as s,ze as t,g as u,p as v,ae as w,O as x,ce as y,le as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{LitElement as g,html as m}from"lit";import{appState as i}from"@digital-realty/ix-app-logic/state/app-state.js";import{g as u,a as h,u as n,c as d}from"./bootstrap.js";import"tslib";import"lit/decorators.js";import"@microsoft/applicationinsights-web";import"@digital-realty/ix-account-switcher";import"oidc-client-ts";import"@digital-realty/ix-app-logic/views/splash-screen.js";import"mobx";var p=Object.defineProperty,S=(o,e,t)=>e in o?p(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,a=(o,e,t)=>S(o,typeof e!="symbol"?e+"":e,t);class c extends g{constructor(){super(...arguments),a(this,"isIdle",!1),a(this,"clearLocalStorageExcept",e=>{const t=new Set((typeof e=="string"?e.split(","):[]).map(r=>r.trim().toLowerCase())),s=[];Object.keys(window.localStorage).forEach(r=>{Array.from(t).some(l=>r.toLowerCase().includes(l))||s.push(r)}),s.forEach(r=>window.localStorage.removeItem(r))}),a(this,"clearGridSessionStorage",()=>{Object.keys(sessionStorage).filter(e=>e.startsWith("grid-")).forEach(e=>sessionStorage.removeItem(e))}),a(this,"logout",async()=>{const{PreserveLocalStorageItems:e,PreventLogoutOnTimeout:t}=u();i.lastActive=-1,await i.hydrateStore(),await i.getStoredData();const s=h();this.clearState(),this.clearLocalStorageExcept(e),this.clearGridSessionStorage(),sessionStorage.removeItem("accountSelection:lastAll"),sessionStorage.removeItem("accountSelection:lastFiltered"),this.unregisterServiceWorkers().then(async()=>{if(this.isIdle)try{t||await n.signoutSilent(s),window.location.href="/session-expired"}catch(r){window.location.href="/session-expired"}else{if(!s){await n.clearStaleState(),window.location.href="/authenticate";return}n.signoutRedirect(s)}})}),a(this,"unregisterServiceWorkers",async()=>{const e=await navigator.serviceWorker.getRegistrations();for(const t of e)t.unregister()}),a(this,"clearState",()=>{d()})}firstUpdated(){const{searchParams:e}=new URL(document.location.toString());this.isIdle=e.has("isIdle"),this.logout()}render(){return m` <splash-screen></splash-screen> `}}window.customElements.define("ixp-logout",c);export{c as Logout};
|