1import{L as m,a9 as d,aa as c,ac as p,aw as n,bY as r,af as w,a4 as u,N as g,a5 as f,a6 as S,R as _,T as E,O as L,aC as R,a7 as $,U as C}from"./entry.BARHI1zD.js";const b={name:"LogoutModal",components:{Spinner:d(()=>c(()=>import("./spinner.14dMe1JC.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),Modal:d(()=>c(()=>import("./modal.yC41eaqY.js"),__vite__mapDeps([4,1,2,5,6,7,8,9,10,11,12]),import.meta.url))},data(){return{loading:!1,abortController:null}},computed:{...p({__:"config/__",postLogoutRedirectUrl:"user/index/postLogoutRedirectUrl",currentLanguageCode:"config/currentLanguageCode",themeConfig:"configuration/theme/theme",indexSlug:"configuration/indexPage/slug"})},mounted(){this.abortController=new AbortController,this.$bus.$on(n.LOGOUT_USER,this.logoutAndRedirect),this.$bus.$on(n.LOGOUT_USER_WITHOUT_REDIRECT,this.logoutWithoutRedirect),this.$bus.$on(n.REDIRECT_AFTER_LOGOUT,this.redirectAfterLogout),window.addEventListener(r.LOGOUT_USER,async t=>{t.detail?.nextUrl?await this.logoutAndRedirect(t.detail.nextUrl):(await this.logoutWithoutRedirect(),window.dispatchEvent(new CustomEvent(r.REDIRECT_AFTER_LOGOUT,{detail:{redirectUrl:null}})))},{signal:this.abortController.signal})},created(){window.addEventListener("pageshow",this.onPageShow)},beforeUnmount(){window.removeEventListener("pageshow",this.onPageShow),this.abortController.abort()},methods:{onPageShow(t){this.loading&&t.persisted&&(this.loading=!1)},async logoutAndRedirect(t){const e=await w.getUser();await this.logoutWithoutRedirect(!0),await this.redirectAfterLogout(e,t)},async logoutWithoutRedirect(t=!0){try{t&&(this.loading=!0),await new Promise(e=>setTimeout(e,2e3)),await this.$store.dispatch("user/index/logoutCustomer"),this.$store.commit("user/index/performPostLogoutCleanup"),await this.$store.commit("checkout/removeAllItems"),window.localStorage.clear(),window.localStorage.setItem("skipNextLoginVerify","true"),this.$dataLayer?.push({event:"logout",method:"web"}),this.$bus?.$emit("logoutFinished")}catch(e){console.error(e),this.$bus?.$emit("logoutError")}},async redirectAfterLogout(t,e){let o=`${this.$config.public.BASE_URL}/${this.currentLanguageCode}`;if(this.themeConfig?.["show-region-switch-page"]&&(o+=`/pages/${this.indexSlug}`),e&&(o=e),t){const i=this.$config.public.SWISSPASS_AUTHORITY.indexOf("/",8),l=this.$config.public.SWISSPASS_AUTHORITY.substring(8,i),s=this.postLogoutRedirectUrl||o;this.$store.commit("user/index/setPostLogoutRedirectUrl",null);const a=s?.includes("?")?`${s}&lang=${this.currentLanguageCode}`:`${s}?lang=${this.currentLanguageCode}`;o=`https://${l}/v3/oevlogin/logout?Location=${encodeURIComponent(a)}`,localStorage.setItem("swiss-pass-logout-url",o)}this.$bus.$emit("redirect",o),window.dispatchEvent(new CustomEvent(r.REDIRECT_AFTER_LOGOUT,{detail:{redirectUrl:o}}))}}},U={key:0,class:"logout__modal__body__loading"},T={class:"logout__modal__body__title text-center"};function v(t,e,o,h,i,l){const s=u("Spinner"),a=u("Modal");return g(),f(a,{id:"logout-modal",class:"center-modal logout__modal",visible:i.loading},{default:S(()=>[_("div",{class:E(["logout__modal__body",{"logout__modal__body--loading":i.loading}])},[i.loading?(g(),L("div",U,[R(s,{class:"logout__modal__body__spinner"}),_("div",T,$(t.__("You will be logged out and redirected to the home page")),1)])):C("",!0)],2)]),_:1},8,["visible"])}const O=m(b,[["render",v],["__scopeId","data-v-342c5aa5"]]);export{O as default}; 2function __vite__mapDeps(indexes) { 3 if (!__vite__mapDeps.viteFileDeps) { 4 __vite__mapDeps.viteFileDeps = ["./spinner.14dMe1JC.js","./entry.BARHI1zD.js","./entry.O9KOVcsn.css","./spinner.5Hm6A8TJ.css","./modal.yC41eaqY.js","./use-focus-trap.gDTl49OY.js","./is-element-visible._LEGGY8N.js","./id.ZlnRo7l5.js","./client-only.N7BQUeU9.js","./chatbots-util.pOxAlLV3.js","./is-safari.Uj6n_Aoz.js","./body-scroll-lock.SFLxkBvS.js","./modal.lgeNB4wW.css"] 5 } 6 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 7}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.