(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8958],{41667:function(e,n,t){Promise.resolve().then(t.bind(t,8786))},25512:function(e,n,t){"use strict";t.d(n,{P:function(){return r.Z},Q:function(){return u.Z}});var r=t(27281),u=t(57365)},56522:function(e,n,t){"use strict";t.d(n,{o:function(){return u.Z},x:function(){return r.Z}});var r=t(84264),u=t(49566)},90246:function(e,n,t){"use strict";function r(e){let n=[e];return{all:n,lists:()=>[...n,"list"],list:e=>[...n,"list",{params:e}],details:()=>[...n,"detail"],detail:e=>[...n,"detail",e]}}t.d(n,{n:function(){return r}})},55584:function(e,n,t){"use strict";t.d(n,{L:function(){return l}});var r=t(19250),u=t(11713);let i=(0,t(90246).n)("uiSettings"),l=e=>(0,u.a)({queryKey:i.list({}),queryFn:async()=>await (0,r.getUiSettings)(e),enabled:!!e,staleTime:36e5,gcTime:36e5})},39760:function(e,n,t){"use strict";var r=t(2265),u=t(99376),i=t(14474),l=t(3914),a=t(19250);n.Z=()=>{var e,n,t,s,o,c;let d=(0,u.useRouter)(),f="undefined"!=typeof document?(0,l.e)("token"):null;(0,r.useEffect)(()=>{f||d.replace("".concat((0,a.getProxyBaseUrl)(),"/ui/login"))},[f,d]);let _=(0,r.useMemo)(()=>{if(!f)return null;try{return(0,i.o)(f)}catch(e){return(0,l.b)(),d.replace("".concat((0,a.getProxyBaseUrl)(),"/ui/login")),null}},[f,d]);return{token:f,accessToken:null!==(e=null==_?void 0:_.key)&&void 0!==e?e:null,userId:null!==(n=null==_?void 0:_.user_id)&&void 0!==n?n:null,userEmail:null!==(t=null==_?void 0:_.user_email)&&void 0!==t?t:null,userRole:function(e){if(!e)return"Undefined Role";switch(e.toLowerCase()){case"app_owner":case"demo_app_owner":return"App Owner";case"app_admin":case"proxy_admin":return"Admin";case"proxy_admin_viewer":return"Admin Viewer";case"org_admin":return"Org Admin";case"internal_user":return"Internal User";case"internal_user_viewer":case"internal_viewer":return"Internal Viewer";case"app_user":return"App User";default:return"Unknown Role"}}(null!==(s=null==_?void 0:_.user_role)&&void 0!==s?s:null),premiumUser:null!==(o=null==_?void 0:_.premium_user)&&void 0!==o?o:null,disabledPersonalKeyCreation:null!==(c=null==_?void 0:_.disabled_non_admin_personal_key_creation)&&void 0!==c?c:null,showSSOBanner:(null==_?void 0:_.login_method)==="username_password"}}},11318:function(e,n,t){"use strict";t.d(n,{Z:function(){return a}});var r=t(2265),u=t(39760),i=t(19250);let l=async(e,n,t,r)=>"Admin"!=t&&"Admin Viewer"!=t?await (0,i.teamListCall)(e,(null==r?void 0:r.organization_id)||null,n):await (0,i.teamListCall)(e,(null==r?void 0:r.organization_id)||null);var a=()=>{let[e,n]=(0,r.useState)([]),{accessToken:t,userId:i,userRole:a}=(0,u.Z)();return(0,r.useEffect)(()=>{(async()=>{n(await l(t,i,a,null))})()},[t,i,a]),{teams:e,setTeams:n}}},8786:function(e,n,t){"use strict";t.r(n);var r=t(57437),u=t(48449),i=t(39760),l=t(2265),a=t(11318);n.default=()=>{let{teams:e,setTeams:n}=(0,a.Z)(),[t,s]=(0,l.useState)(()=>new URLSearchParams(window.location.search)),{accessToken:o,userId:c,premiumUser:d,showSSOBanner:f}=(0,i.Z)();return(0,r.jsx)(u.Z,{searchParams:t,accessToken:o,userID:c,setTeams:n,showSSOBanner:f,premiumUser:d})}},12363:function(e,n,t){"use strict";t.d(n,{d:function(){return i},n:function(){return u}});var r=t(2265);let u=()=>{let[e,n]=(0,r.useState)("http://localhost:4000");return(0,r.useEffect)(()=>{{let{protocol:e,host:t}=window.location;n("".concat(e,"//").concat(t))}},[]),e},i=25}},function(e){e.O(0,[1047,9028,9409,4865,337,8135,1442,2926,2409,3367,3709,5869,5333,1713,5945,7448,8049,8449,2971,2117,1744],function(){return e(e.s=41667)}),_N_E=e.O()}]);