import{qZ as N,rZ as p,sZ as F,uZ as U,vZ as A}from"./cli-0.5.4-vjgejcrz.mjs";import{C3 as L,D3 as P,G3 as O,I3 as V,S3 as x,U3 as H,V3 as k}from"./cli-0.5.4-9e7rkd8e.mjs";import{E$ as X,Haa as Z,K$ as Y,T$ as K,_aa as M,g9 as I,i9 as D}from"./cli-0.5.4-cbq01zg3.mjs";import{cga as $,mga as b}from"./cli-0.5.4-yd3rd9qt.mjs";import{Zma as G}from"./cli-0.5.4-aacw1src.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};
