1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`129.76.0`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`b10c183b-e65a-4c8b-a77f-8d8d25b01230`,e._sentryDebugIdIdentifier=`sentry-dbid-b10c183b-e65a-4c8b-a77f-8d8d25b01230`)}catch{}})();import{o as e}from"./rolldown-runtime-CHDfvV7Q.js";import{Ba as t,Bn as n,Ya as r}from"./vendor-DfhnP8k0.js";import{t as i}from"./sdmCreds-CM9_NXNl.js";import"./AuthenticationProvider-Clba9GqS.js";import{a}from"./publicApi-ByhPKZkr.js";import{r as o}from"./organization-Bb86u175.js";import{i as s}from"./self-gvHWmVFI.js";import{a as c,s as l}from"./signedApi-Bq3xEDuv.js";import"./signedApi-2hE0h82f.js";import{r as u,t as d}from"./clearCachedCredentials-DyNpiSjW.js";var f=e(r(),1);t();var p=`landing_page`,m=e=>![`/`,`/home`,`/login`].includes(e)&&!/^\/auth\/?/i.test(e),h=class{static set(e){let t=e.replace(/^\/app\//,`/`);m(t)&&(window.sessionStorage.setItem(p,t),window.localStorage.setItem(p,t))}static clear(){window.sessionStorage.removeItem(p),window.localStorage.removeItem(p)}static get(){let e=window.sessionStorage.getItem(p),t=window.localStorage.getItem(p);return e||t}},g=()=>(0,f.useCallback)(async(e,t,n,r)=>{let o=await a.postLogin({email:t,password:n,token:e,passcode:r});await i.deleteCreds(),await i.saveCreds(o.api_access_key,o.api_secret_key)},[]);async function _({reason:e,clearLandingPage:t,loginUrl:n,appDomain:r}){t&&h.clear();try{await d(),await c.logout()}catch{}if(n)try{let t=new URL(n).origin;await(await fetch(`${t}/controlplanes.json`)).json(),l(`${n}?from=${encodeURIComponent(r)}${e?`&reason=${e}`:``}`);return}catch{}l(`/app/login${e?`?reason=${e}`:``}`)}var v={current:void 0};function y(e,t){return()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(e,t)}}function b(){let{supportLogin:e}=s(),[t,n]=(0,f.useState)(Date.now()),r=o(),{appDomain:i,loginUrl:a}=u();(0,f.useEffect)(()=>{let e=()=>{n(Date.now())};return document.addEventListener(`mousemove`,y(e,500)),document.addEventListener(`keypress`,e),()=>{document.removeEventListener(`mousemove`,e),document.removeEventListener(`keypress`,e)}}),(0,f.useEffect)(()=>{if(e||!t||!r.idleTimeoutEnabled||!r.idleTimeout)return;let n=r.idleTimeout/1e6,o=setTimeout(()=>{_({appDomain:i,loginUrl:a,reason:`timeout`})},Math.min(n,2147483647));return()=>{clearTimeout(o)}},[t,r.idleTimeout,r.idleTimeoutEnabled,e,i,a])}var x=()=>{let e=n(),{appDomain:t,loginUrl:r}=u();return(0,f.useCallback)(async n=>{try{let{api_access_key:t,api_secret_key:r}=await a.getSupportLogin({login_code:n});await i.saveCreds(t,r),e(`/home`)}catch{return _({appDomain:t,loginUrl:r})}},[e,t,r])};export{h as a,g as i,b as n,_ as r,x as t}; 2//# sourceMappingURL=authentication-DD2SaYPg.js.map
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.