import{oZ as N,pZ as p,qZ as F,sZ as U,tZ as A}from"./cli-0.5.3-jmkkd5ph.mjs";import{A3 as L,B3 as P,E3 as O,G3 as V,Q3 as x,S3 as H,T3 as k}from"./cli-0.5.3-7017ez65.mjs";import{C$ as X,Faa as Z,I$ as Y,R$ as K,Yaa as M,e9 as I,g9 as D}from"./cli-0.5.3-t65dek0m.mjs";import{aga as $,kga as b}from"./cli-0.5.3-7wdgps7z.mjs";import{Xma as G}from"./cli-0.5.3-0df3r78b.mjs";function R(q){if(!q||!process.env.ANTHROPIC_UNIX_SOCKET)return q||{};let{ANTHROPIC_UNIX_SOCKET:z,ANTHROPIC_BASE_URL:B,ANTHROPIC_API_KEY:Q,ANTHROPIC_AUTH_TOKEN:T,CLAUDE_CODE_OAUTH_TOKEN:f,...m}=q;return m}function _(q){if(!q)return{};if(!$(process.env.CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST))return q;let z={};for(let[B,Q]of Object.entries(q))if(!F(B))z[B]=Q;return z}function h(q){if(!q||!W)return q||{};let z={};for(let[B,Q]of Object.entries(q))if(!W.has(B))z[B]=Q;return z}function J(q){return h(_(R(q)))}function r(){if(W===void 0)W=process.env.CLAUDE_CODE_ENTRYPOINT==="claude-desktop"?new Set(Object.keys(process.env)):null;Object.assign(process.env,J(Z().env));for(let z of w){if(z==="policySettings")continue;if(!I(z))continue;Object.assign(process.env,J(X(z)?.env))}N(),Object.assign(process.env,J(X("policySettings")?.env));let q=J(Y()?.env);for(let[z,B]of Object.entries(q))if(U.has(z.toUpperCase()))process.env[z]=B}function g(){Object.assign(process.env,J(Z().env)),Object.assign(process.env,J(Y()?.env)),L(),O(),H(),x()}var W,w;var j=G(()=>{p();P();M();b();A();V();k();D();K();w=["userSettings","flagSettings","policySettings"]});
export{r as ph,g as qh,j as rh};
