class c{saveRedirectPath(){const t=new URL(window.location.href),e=new URLSearchParams(t.search).get("redirect");e&&(localStorage.setItem("redirect",e),this.checkRedirectPath())}getRedirectPath(){return this.checkRedirectPath(),localStorage.getItem("redirect")||null}clearRedirectPath(){localStorage.removeItem("redirect")}checkRedirectPath(){let t=localStorage.getItem("redirect");if(!t)return null;const r=new URL(window.location.href),e=new URL(t,r.origin);if(e.origin===r.origin&&e.pathname&&e.pathname!=="/"&&e.pathname!==r.pathname){const a=e.pathname+e.search;localStorage.setItem("redirect",a);return}localStorage.removeItem("redirect")}}let n=new c;export{n as h};
