"use strict";exports.id=957,exports.ids=[338,957],exports.modules={21945:(e,r,t)=>{t.d(r,{Q:()=>s});const s="."},29359:(e,r,t)=>{t.d(r,{Y:()=>o});var s=t(61247);const o=async e=>{const r=await(0,s.p)(e);return((...e)=>{const r={};for(const t of e)for(const[e,s]of Object.entries(t))void 0!==r[e]?Object.assign(r[e],s):r[e]=s;return r})(r.configFile,r.credentialsFile)}},44698:(e,r,t)=>{t.d(r,{Z:()=>n});var s=t(47646),o=t(85004);const n={getFileRecord:()=>o.Jj,interceptFile(e,r){o.Jj[e]=Promise.resolve(r)},getTokenRecord:()=>s.a,interceptToken(e,r){s.a[e]=r}}},44988:(e,r,t)=>{t.d(r,{R:()=>i});var s=t(70857),o=t(16928);const n={},i=()=>{const{HOME:e,USERPROFILE:r,HOMEPATH:t,HOMEDRIVE:i=`C:${o.sep}`}=process.env;if(e)return e;if(r)return r;if(t)return`${i}${t}`;const c=process&&process.geteuid?`${process.geteuid()}`:"DEFAULT";return n[c]||(n[c]=(0,s.homedir)()),n[c]}},47646:(e,r,t)=>{t.d(r,{a:()=>n,v:()=>i});var s=t(91943),o=t(56589);const n={},i=async e=>{if(n[e])return n[e];const r=(0,o.C)(e),t=await(0,s.readFile)(r,"utf8");return JSON.parse(t)}},47886:(e,r,t)=>{var s;t.d(r,{I:()=>s}),function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"}(s||(s={}))},56589:(e,r,t)=>{t.d(r,{C:()=>i});var s=t(76982),o=t(16928),n=t(44988);const i=e=>{const r=(0,s.createHash)("sha1").update(e).digest("hex");return(0,o.join)((0,n.R)(),".aws","sso","cache",`${r}.json`)}},61247:(e,r,t)=>{t.d(r,{p:()=>p});var s=t(16928),o=t(47886),n=t(21945);const i=e=>Object.entries(e).filter(([e])=>{const r=e.indexOf(n.Q);return-1!==r&&Object.values(o.I).includes(e.substring(0,r))}).reduce((e,[r,t])=>{const s=r.indexOf(n.Q);return e[r.substring(0,s)===o.I.PROFILE?r.substring(s+1):r]=t,e},{...e.default&&{default:e.default}});var c=t(95519),a=t(44988);const d=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||(0,s.join)((0,a.R)(),".aws","credentials");var l=t(74285),f=t(85004);const u=()=>({}),p=async(e={})=>{const{filepath:r=d(),configFilepath:t=(0,c.g)()}=e,o=(0,a.R)();let n=r;r.startsWith("~/")&&(n=(0,s.join)(o,r.slice(2)));let p=t;t.startsWith("~/")&&(p=(0,s.join)(o,t.slice(2)));const g=await Promise.all([(0,f.TA)(p,{ignoreCache:e.ignoreCache}).then(l.A).then(i).catch(u),(0,f.TA)(n,{ignoreCache:e.ignoreCache}).then(l.A).catch(u)]);return{configFile:g[0],credentialsFile:g[1]}}},73957:(e,r,t)=>{t.r(r),t.d(r,{fromProcess:()=>l});var s=t(29359),o=t(76964),n=t(63725),i=t(44698),c=t(53802),a=t(57975),d=t(38598);const l=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const t=await(0,s.Y)(e);return(async(e,r,t)=>{const s=r[e];if(!r[e])throw new n.C(`Profile ${e} could not be found in shared credentials file.`,{logger:t});{const o=s.credential_process;if(void 0===o)throw new n.C(`Profile ${e} did not contain credential_process.`,{logger:t});{const s=(0,a.promisify)(i.Z?.getTokenRecord?.().exec??c.exec);try{const{stdout:t}=await s(o);let n;try{n=JSON.parse(t.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return((e,r,t)=>{if(1!==r.Version)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(void 0===r.AccessKeyId||void 0===r.SecretAccessKey)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(r.Expiration){const t=new Date;if(new Date(r.Expiration)<t)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let s=r.AccountId;!s&&t?.[e]?.aws_account_id&&(s=t[e].aws_account_id);const o={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...s&&{accountId:s}};return(0,d.setCredentialFeature)(o,"CREDENTIALS_PROCESS","w"),o})(e,n,r)}catch(e){throw new n.C(e.message,{logger:t})}}}})((0,o.Bz)({profile:e.profile??r?.profile}),t,e.logger)}},74285:(e,r,t)=>{t.d(r,{A:()=>c});var s=t(47886),o=t(21945);const n=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,i=["__proto__","profile __proto__"],c=e=>{const r={};let t,c;for(const a of e.split(/\r?\n/)){const e=a.split(/(^|\s)[;#]/)[0].trim();if("["===e[0]&&"]"===e[e.length-1]){t=void 0,c=void 0;const r=e.substring(1,e.length-1),a=n.exec(r);if(a){const[,e,,r]=a;Object.values(s.I).includes(e)&&(t=[e,r].join(o.Q))}else t=r;if(i.includes(r))throw new Error(`Found invalid profile name "${r}"`)}else if(t){const s=e.indexOf("=");if(![0,-1].includes(s)){const[n,i]=[e.substring(0,s).trim(),e.substring(s+1).trim()];if(""===i)c=n;else{c&&a.trimStart()===a&&(c=void 0),r[t]=r[t]||{};const e=c?[c,n].join(o.Q):n;r[t][e]=i}}}}return r}},85004:(e,r,t)=>{t.d(r,{Jj:()=>n,TA:()=>i});var s=t(51455);const o={},n={},i=(e,r)=>void 0!==n[e]?n[e]:(o[e]&&!r?.ignoreCache||(o[e]=(0,s.readFile)(e,"utf8")),o[e])},95519:(e,r,t)=>{t.d(r,{g:()=>n});var s=t(16928),o=t(44988);const n=()=>process.env.AWS_CONFIG_FILE||(0,s.join)((0,o.R)(),".aws","config")}};
//# sourceMappingURL=http://go/sourcemap/sourcemaps/fc2563ec93d793fc275eef734405a4fdf8b47b20/extensions/cursor-agent-exec/dist/957.js.map