import{useThemeConfig as s}from"@redocly/theme";import{getPathnameForLocale as r,withPathPrefix as f}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as l}from"../../../constants/index.js";import{buildClientLoginUrl as p}from"../utils";import{useL10nConfig as c}from"./useL10nConfig";function U(d={}){const u=s(),{auth:o}=u,{defaultLocale:n,locales:e,currentLocale:i}=c(),m=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const t=o.idpsInfo[0];return p(t.idpId,t.type,r("",n,i,e),o.loginUrls,void 0,d)}return f(r(l,n,i,e))}};return o?.devLogin?f(r(l,n,i,e)):m()}export{U as useLoginUrl};
