import{kh as G,mh as m}from"./cli-0.5.4-5fpyxq2n.mjs";import{nh as H,oh as C}from"./cli-0.5.4-ngvrzzhe.mjs";import{eZ as X,gZ as Y,lZ as R}from"./cli-0.5.4-prfn3sxd.mjs";import{nZ as k,oZ as y}from"./cli-0.5.4-6xmgebmk.mjs";import{B3 as f,SZ as w,TZ as E,m3 as B}from"./cli-0.5.4-jqt00ywx.mjs";import{F5 as W,X5 as I}from"./cli-0.5.4-j7kkqxv6.mjs";import{B6 as Q,Eaa as S,Haa as j,J6 as x,_aa as D}from"./cli-0.5.4-cbq01zg3.mjs";import{Lea as V,Mea as b}from"./cli-0.5.4-e822fzaq.mjs";import{Zma as Z}from"./cli-0.5.4-aacw1src.mjs";async function _(L){let{accessToken:N,orgUUID:P}=await X(),K={...Y(N),"x-organization-uuid":P},J=`${V().BASE_API_URL}/api/oauth/organizations/${P}/admin_requests`;return(await W.post(J,L,{headers:K})).data}async function $(L,N){let{accessToken:P,orgUUID:K}=await X(),J={...Y(P),"x-organization-uuid":K},F=`${V().BASE_API_URL}/api/oauth/organizations/${K}/admin_requests/me?request_type=${L}`;for(let v of N)F+=`&statuses=${v}`;return(await W.get(F,{headers:J})).data}async function z(L){let{accessToken:N,orgUUID:P}=await X(),K={...Y(N),"x-organization-uuid":P},J=`${V().BASE_API_URL}/api/oauth/organizations/${P}/admin_requests/eligibility?request_type=${L}`;return(await W.get(J,{headers:K})).data}var M=Z(()=>{I();b();R()});async function i(){if(!j().hasVisitedExtraUsage)S((J)=>({...J,hasVisitedExtraUsage:!0}));G();let L=B(),N=L==="team"||L==="enterprise";if(!w()&&N){let J;try{J=(await H())?.extra_usage}catch(F){Q(F)}if(J?.is_enabled&&J.monthly_limit===null)return{type:"message",value:"Your organization already has unlimited extra usage. No request needed."};try{if((await z("limit_increase"))?.is_allowed===!1)return{type:"message",value:"Please contact your admin to manage extra usage settings."}}catch(F){Q(F)}try{let F=await $("limit_increase",["pending","dismissed"]);if(F&&F.length>0)return{type:"message",value:"You have already submitted a request for extra usage to your admin."}}catch(F){Q(F)}try{return await _({request_type:"limit_increase",details:null}),{type:"message",value:J?.is_enabled?"Request sent to your admin to increase extra usage.":"Request sent to your admin to enable extra usage."}}catch(F){Q(F)}return{type:"message",value:"Please contact your admin to manage extra usage settings."}}let K=N?"https://claude.ai/admin-settings/usage":"https://claude.ai/settings/usage";try{let J=await k(K);return{type:"browser-opened",url:K,opened:J}}catch(J){return Q(J),{type:"message",value:`Failed to open browser. Please visit ${K} to manage extra usage.`}}}var A=Z(()=>{M();m();C();f();E();y();D();x()});
export{i as hh,A as ih};
