gemi 0.4.46 → 0.4.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- import"../chunk-515c26d532207095.js";import{y as W} from"../chunk-7ce930fe69575c87.js";import{$ as $s,A as Pm,B as Nm,C as L,D as Br,E as Yr,F as Gm,G as ir,J as ih,K as Tr,L as J,M as bh,N as xh,O as oh,P as oe,Q as th,R as rm,S as br,T as c,U as nh,V as Il,W as El,X as Oa,Y as Rr,Z as O,ca as wr,da as _a,ea as Ar,fa as qa,ga as Ns,ha as Hr,ja as _f,ka as Dr,la as Ga,ma as _,na as ja,oa as sm,pa as fm,qa as $m,ra as Dm,ta as G,va as ia} from"../chunk-869d80d2e475b938.js";import{xa as WA} from"../chunk-90c5196ff1f827a8.js";import{$a as AA,Aa as cm,Ba as zm,Ca as os,Da as p,Ea as u,Fa as ts,Ga as Hm,Ha as Na,Ia as $a,Ja as Da,Ka as Km,La as em,Ma as lm,Na as am,Oa as hm,Pa as Fm,Qa as Lm,Ra as Ma,Sa as dr,Ta as Ir,Ua as Wm,Va as mm,Wa as ye,Xa as gm,Ya as Xm,Za as wm,_a as Zm,ab as ms,bb as Am,cb as Ls,db as Sm,eb as Rm,fb as Mm,gb as ym,ya as Tm,za as Cm} from"../chunk-99ba9dfd7c11383b.js";import{hb as Sg} from"../chunk-a0003b7feea6fae6.js";import{ib as cA,jb as b} from"../chunk-ccfd101ce72e80bf.js";import{kb as dm} from"../chunk-4cc2463d985f6882.js";import"../chunk-f32726d374c6bee5.js";import"../chunk-63c5605bcce508ea.js";function um(r){return(s)=>async(f)=>{const{request:e}=f;if(L.isInstance(e)&&e.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")e.headers={...e.headers,Expect:"100-continue"}}return s({...f,request:e})}}var tm={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Ue=(r)=>({applyToStack:(s)=>{s.add(um(r),tm)}});function sg(){return(r,s)=>async(f)=>{const{request:e}=f;if(L.isInstance(e)){if(!(rg in e.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Yr))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...f})}}var rg="content-length",fg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Te=(r)=>({applyToStack:(s)=>{s.add(sg(),fg)}});var Ce=(r)=>{return(s,f)=>async(e)=>{const l=await r.region(),a=r.region;let h=()=>{};if(f.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return f.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(e);if(f.__s3RegionRedirect){h();const g=await r.region();if(l!==g)throw new Error("Region was not restored following S3 region redirect.")}return m}catch(m){throw h(),m}}},ce={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function eg(r){return(s,f)=>async(e)=>{try{return await s(e)}catch(l){if(r.followRegionRedirects&&l?.$metadata?.httpStatusCode===301){try{const a=l.$response.headers["x-amz-bucket-region"];f.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),f.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(e)}else throw l}}}var lg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},ze=(r)=>({applyToStack:(s)=>{s.add(eg(r),lg),s.addRelativeTo(Ce(r),ce)}});var ag=(r)=>{return(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(Br.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Dr(a.headers.expires)}catch(h){f.logger?.warn(`AWS SDK Warning for ${f.clientName}::${f.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return l}},hg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Ge=(r)=>({applyToStack:(s)=>{s.addRelativeTo(ag(r),hg)}});class fr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+fr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const f=this.data[s];if(!f.isRefreshing){const e=await f.identity;if(e.expiration){if(e.expiration.getTime()<r)delete this.data[s]}}}}}fr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class er{constructor(r,s=!1,f=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=f}get identity(){return this.accessed=Date.now(),this._identity}}class lr{constructor(r,s=new fr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const f=s.Bucket,{cache:e}=this,l=e.get(f);if(l)return l.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return e.set(f,new er(this.getIdentity(f))).identity;if((a.expiration?.getTime()??0)<Date.now()+lr.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(f).then((g)=>{e.set(f,new er(Promise.resolve(g)))});return a});return e.set(f,new er(this.getIdentity(f))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((e)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+e)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}lr.REFRESH_WINDOW_MS=60000;var xs=W(os(),1),sl=W(oe(),1);var He="X-Amz-Algorithm",Ke="X-Amz-Credential",Fe="X-Amz-Date",Le="X-Amz-SignedHeaders",We="X-Amz-Expires",Xe="X-Amz-Signature",Ze="X-Amz-Security-Token";var Qe="authorization",Bs="X-Amz-Date".toLowerCase();var Ve=["authorization",Bs,"date"],ve="X-Amz-Signature".toLowerCase(),Mr="x-amz-content-sha256",Je="X-Amz-Security-Token".toLowerCase();var Ye={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Be=/^proxy-/,Oe=/^sec-/;var Or="AWS4-HMAC-SHA256";var _e="AWS4-HMAC-SHA256-PAYLOAD",qe="UNSIGNED-PAYLOAD",je=50,Os="aws4_request",ie=604800;var _r={},_s=[],qr=(r,s,f)=>`${r}/${s}/${f}/${Os}`,xe=async(r,s,f,e,l)=>{const a=await be(r,s.secretAccessKey,s.accessKeyId),h=`${f}:${e}:${l}:${c(a)}:${s.sessionToken}`;if(h in _r)return _r[h];_s.push(h);while(_s.length>je)delete _r[_s.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[f,e,l,Os])m=await be(r,m,g);return _r[h]=m};var be=(r,s,f)=>{const e=new r(s);return e.update(J(f)),e.digest()};var jr=({headers:r},s,f)=>{const e={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;const a=l.toLowerCase();if(a in Ye||s?.has(a)||Be.test(a)||Oe.test(a)){if(!f||f&&!f.has(a))continue}e[a]=r[l].trim().replace(/\s+/g," ")}return e};var yr=W(oe(),1);var qs=({query:r={}})=>{const s=[],f={};for(let e of Object.keys(r).sort()){if(e.toLowerCase()===ve)continue;s.push(e);const l=r[e];if(typeof l==="string")f[e]=`${yr.escapeUri(e)}=${yr.escapeUri(l)}`;else if(Array.isArray(l))f[e]=l.slice(0).reduce((a,h)=>a.concat([`${yr.escapeUri(e)}=${yr.escapeUri(h)}`]),[]).sort().join("&")}return s.map((e)=>f[e]).filter((e)=>e).join("&")};var Ur=async({headers:r,body:s},f)=>{for(let e of Object.keys(r))if(e.toLowerCase()===Mr)return r[e];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||ir(s)){const e=new f;return e.update(J(s)),c(await e.digest())}return qe};var pe=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class js{format(r){const s=[];for(let l of Object.keys(r)){const a=Tr(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=Tr(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(is.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!mg.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(br(r.value.replace(/\-/g,"")),1),d}}}var ne;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(ne||(ne={}));var mg=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class is{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)pe(s);return new is(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)pe(r);return parseInt(c(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var ue=(r,s)=>{r=r.toLowerCase();for(let f of Object.keys(s))if(r===f.toLowerCase())return!0;return!1};var bs=(r,s={})=>{const{headers:f,query:e={}}=L.clone(r);for(let l of Object.keys(f)){const a=l.toLowerCase();if(a.slice(0,6)==="x-amz-"&&!s.unhoistableHeaders?.has(a))e[l]=f[l],delete f[l]}return{...r,headers:f,query:e}};var xr=(r)=>{r=L.clone(r);for(let s of Object.keys(r.headers))if(Ve.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var te=(r)=>gg(r).toISOString().replace(/\.\d{3}Z$/,"Z"),gg=(r)=>{if(typeof r==="number")return new Date(r*1000);if(typeof r==="string"){if(Number(r))return new Date(Number(r)*1000);return new Date(r)}return r};class ns{constructor({applyChecksum:r,credentials:s,region:f,service:e,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new js,this.service=e,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=xs.normalizeProvider(f),this.credentialProvider=xs.normalizeProvider(s)}async presign(r,s={}){const{signingDate:f=new Date,expiresIn:e=3600,unsignableHeaders:l,unhoistableHeaders:a,signableHeaders:h,signingRegion:m,signingService:g}=s,S=await this.credentialProvider();this.validateResolvedCredentials(S);const d=m??await this.regionProvider(),{longDate:k,shortDate:P}=or(f);if(e>ie)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const y=qr(P,d,g??this.service),D=bs(xr(r),{unhoistableHeaders:a});if(S.sessionToken)D.query[Ze]=S.sessionToken;D.query[He]=Or,D.query[Ke]=`${S.accessKeyId}/${y}`,D.query[Fe]=k,D.query[We]=e.toString(10);const V=jr(D,l,h);return D.query[Le]=rl(V),D.query[Xe]=await this.getSignature(k,y,this.getSigningKey(S,d,P,g),this.createCanonicalRequest(D,V,await Ur(r,this.sha256))),D}async sign(r,s){if(typeof r==="string")return this.signString(r,s);else if(r.headers&&r.payload)return this.signEvent(r,s);else if(r.message)return this.signMessage(r,s);else return this.signRequest(r,s)}async signEvent({headers:r,payload:s},{signingDate:f=new Date,priorSignature:e,signingRegion:l,signingService:a}){const h=l??await this.regionProvider(),{shortDate:m,longDate:g}=or(f),S=qr(m,h,a??this.service),d=await Ur({headers:{},body:s},this.sha256),k=new this.sha256;k.update(r);const P=c(await k.digest()),y=[_e,g,S,e,P,d].join("\n");return this.signString(y,{signingDate:f,signingRegion:h,signingService:a})}async signMessage(r,{signingDate:s=new Date,signingRegion:f,signingService:e}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:s,signingRegion:f,signingService:e,priorSignature:r.priorSignature}).then((a)=>{return{message:r.message,signature:a}})}async signString(r,{signingDate:s=new Date,signingRegion:f,signingService:e}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const a=f??await this.regionProvider(),{shortDate:h}=or(s),m=new this.sha256(await this.getSigningKey(l,a,h,e));return m.update(J(r)),c(await m.digest())}async signRequest(r,{signingDate:s=new Date,signableHeaders:f,unsignableHeaders:e,signingRegion:l,signingService:a}={}){const h=await this.credentialProvider();this.validateResolvedCredentials(h);const m=l??await this.regionProvider(),g=xr(r),{longDate:S,shortDate:d}=or(s),k=qr(d,m,a??this.service);if(g.headers[Bs]=S,h.sessionToken)g.headers[Je]=h.sessionToken;const P=await Ur(g,this.sha256);if(!ue(Mr,g.headers)&&this.applyChecksum)g.headers[Mr]=P;const y=jr(g,e,f),D=await this.getSignature(S,k,this.getSigningKey(h,m,d,a),this.createCanonicalRequest(g,y,P));return g.headers[Qe]=`${Or} `+`Credential=${h.accessKeyId}/${k}, `+`SignedHeaders=${rl(y)}, `+`Signature=${D}`,g}createCanonicalRequest(r,s,f){const e=Object.keys(s).sort();return`${r.method}
2
+ import"../chunk-c1813278ccdc04b8.js";import{y as M} from"../chunk-7ce930fe69575c87.js";import{$ as Ds,A as Um,B as Tm,C as L,D as Or,E as Br,G as Xm,H as br,K as uh,L as Tr,M as v,N as th,O as rm,P as sm,Q as ue,R as am,S as hm,T as ar,U as fm,V as Nl,W as $l,X as ia,Y as dr,Z as B,ca as Ar,da as ba,ea as Sr,fa as xa,ga as $s,ha as Kr,ja as qf,ka as Dr,la as La,ma as O,na as oa,oa as mm,pa as gm,qa as Cm,ra as cm,ta as G,va as na} from"../chunk-f34a78d9e3a62c43.js";import{xa as YA} from"../chunk-90c5196ff1f827a8.js";import{$a as NA,Aa as Lm,Ba as Wm,Ca as ns,Da as p,Ea as u,Fa as he,Ga as rf,Ha as Zm,Ia as ya,Ja as Ua,Ka as Ta,La as Qm,Ma as wm,Na as Am,Oa as Sm,Pa as Rm,Qa as Vm,Ra as vm,Sa as Ca,Ta as Ir,Ua as Jm,Va as dm,Wa as Te,Xa as Im,Ya as Ym,Za as Em,_a as Bm,ab as gs,bb as km,cb as Ws,db as Pm,eb as Nm,fb as zm,gb as Gm,ya as Km,za as Fm} from"../chunk-590cd512f9e72880.js";import{hb as $g} from"../chunk-a0003b7feea6fae6.js";import{ib as i,jb as em} from"../chunk-4cb19a9e82653084.js";import"../chunk-ff086fe014985526.js";import{qb as $m} from"../chunk-5fd67245740e3908.js";import"../chunk-d26ffb7722e6df54.js";function hg(r){return(s)=>async(f)=>{const{request:e}=f;if(L.isInstance(e)&&e.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")e.headers={...e.headers,Expect:"100-continue"}}return s({...f,request:e})}}var mg={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Ce=(r)=>({applyToStack:(s)=>{s.add(hg(r),mg)}});function wg(){return(r,s)=>async(f)=>{const{request:e}=f;if(L.isInstance(e)){if(!(gg in e.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Br))s.logger.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.");else console.warn("Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.")}return r({...f})}}var gg="content-length",Ag={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},ce=(r)=>({applyToStack:(s)=>{s.add(wg(),Ag)}});var ze=(r)=>{return(s,f)=>async(e)=>{const l=await r.region(),a=r.region;let h=()=>{};if(f.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return f.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(e);if(f.__s3RegionRedirect){h();const g=await r.region();if(l!==g)throw new Error("Region was not restored following S3 region redirect.")}return m}catch(m){throw h(),m}}},Ge={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Sg(r){return(s,f)=>async(e)=>{try{return await s(e)}catch(l){if(r.followRegionRedirects&&l?.$metadata?.httpStatusCode===301){try{const a=l.$response.headers["x-amz-bucket-region"];f.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),f.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(e)}else throw l}}}var Rg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},He=(r)=>({applyToStack:(s)=>{s.add(Sg(r),Rg),s.addRelativeTo(ze(r),Ge)}});var dg=(r)=>{return(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(Or.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Dr(a.headers.expires)}catch(h){f.logger?.warn(`AWS SDK Warning for ${f.clientName}::${f.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return l}},Ig={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Ke=(r)=>({applyToStack:(s)=>{s.addRelativeTo(dg(r),Ig)}});class fr{constructor(r={}){this.data=r,this.lastPurgeTime=Date.now()}get(r){const s=this.data[r];if(!s)return;return s}set(r,s){return this.data[r]=s,s}delete(r){delete this.data[r]}async purgeExpired(){const r=Date.now();if(this.lastPurgeTime+fr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const f=this.data[s];if(!f.isRefreshing){const e=await f.identity;if(e.expiration){if(e.expiration.getTime()<r)delete this.data[s]}}}}}fr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class er{constructor(r,s=!1,f=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=f}get identity(){return this.accessed=Date.now(),this._identity}}class lr{constructor(r,s=new fr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const f=s.Bucket,{cache:e}=this,l=e.get(f);if(l)return l.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return e.set(f,new er(this.getIdentity(f))).identity;if((a.expiration?.getTime()??0)<Date.now()+lr.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(f).then((g)=>{e.set(f,new er(Promise.resolve(g)))});return a});return e.set(f,new er(this.getIdentity(f))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((e)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+e)});const s=await this.createSessionFn(r);if(!s.Credentials?.AccessKeyId||!s.Credentials?.SecretAccessKey)throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");return{accessKeyId:s.Credentials.AccessKeyId,secretAccessKey:s.Credentials.SecretAccessKey,sessionToken:s.Credentials.SessionToken,expiration:s.Credentials.Expiration?new Date(s.Credentials.Expiration):void 0}}}lr.REFRESH_WINDOW_MS=60000;var Cr=M(ar(),1),os=M(ns(),1),al=M(ue(),1);var Fe="X-Amz-Algorithm",Le="X-Amz-Credential",We="X-Amz-Date",Xe="X-Amz-SignedHeaders",Ze="X-Amz-Expires",Qe="X-Amz-Signature",Ve="X-Amz-Security-Token";var ve="authorization",Os="X-Amz-Date".toLowerCase();var Je=["authorization",Os,"date"],Ye="X-Amz-Signature".toLowerCase(),Mr="x-amz-content-sha256",Be="X-Amz-Security-Token".toLowerCase();var Oe={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},_e=/^proxy-/,qe=/^sec-/;var _r="AWS4-HMAC-SHA256";var je="AWS4-HMAC-SHA256-PAYLOAD",ie="UNSIGNED-PAYLOAD",be=50,_s="aws4_request",xe=604800;var ne=M(ar(),1);var qr={},qs=[],jr=(r,s,f)=>`${r}/${s}/${f}/${_s}`,pe=async(r,s,f,e,l)=>{const a=await oe(r,s.secretAccessKey,s.accessKeyId),h=`${f}:${e}:${l}:${ne.toHex(a)}:${s.sessionToken}`;if(h in qr)return qr[h];qs.push(h);while(qs.length>be)delete qr[qs.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[f,e,l,_s])m=await oe(r,m,g);return qr[h]=m};var oe=(r,s,f)=>{const e=new r(s);return e.update(v(f)),e.digest()};var ir=({headers:r},s,f)=>{const e={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;const a=l.toLowerCase();if(a in Oe||s?.has(a)||_e.test(a)||qe.test(a)){if(!f||f&&!f.has(a))continue}e[a]=r[l].trim().replace(/\s+/g," ")}return e};var yr=M(ue(),1);var js=({query:r={}})=>{const s=[],f={};for(let e of Object.keys(r).sort()){if(e.toLowerCase()===Ye)continue;s.push(e);const l=r[e];if(typeof l==="string")f[e]=`${yr.escapeUri(e)}=${yr.escapeUri(l)}`;else if(Array.isArray(l))f[e]=l.slice(0).reduce((a,h)=>a.concat([`${yr.escapeUri(e)}=${yr.escapeUri(h)}`]),[]).sort().join("&")}return s.map((e)=>f[e]).filter((e)=>e).join("&")};var te=M(ar(),1);var Ur=async({headers:r,body:s},f)=>{for(let e of Object.keys(r))if(e.toLowerCase()===Mr)return r[e];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||br(s)){const e=new f;return e.update(v(s)),te.toHex(await e.digest())}return ie};var xr=M(ar(),1);var sl=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class is{format(r){const s=[];for(let l of Object.keys(r)){const a=Tr(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=Tr(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(bs.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!Eg.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(xr.fromHex(r.value.replace(/\-/g,"")),1),d}}}var rl;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(rl||(rl={}));var Eg=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class bs{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)sl(s);return new bs(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)sl(r);return parseInt(xr.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var fl=(r,s)=>{r=r.toLowerCase();for(let f of Object.keys(s))if(r===f.toLowerCase())return!0;return!1};var xs=(r,s={})=>{const{headers:f,query:e={}}=L.clone(r);for(let l of Object.keys(f)){const a=l.toLowerCase();if(a.slice(0,6)==="x-amz-"&&!s.unhoistableHeaders?.has(a))e[l]=f[l],delete f[l]}return{...r,headers:f,query:e}};var or=(r)=>{r=L.clone(r);for(let s of Object.keys(r.headers))if(Je.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var el=(r)=>kg(r).toISOString().replace(/\.\d{3}Z$/,"Z"),kg=(r)=>{if(typeof r==="number")return new Date(r*1000);if(typeof r==="string"){if(Number(r))return new Date(Number(r)*1000);return new Date(r)}return r};class ps{constructor({applyChecksum:r,credentials:s,region:f,service:e,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new is,this.service=e,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=os.normalizeProvider(f),this.credentialProvider=os.normalizeProvider(s)}async presign(r,s={}){const{signingDate:f=new Date,expiresIn:e=3600,unsignableHeaders:l,unhoistableHeaders:a,signableHeaders:h,signingRegion:m,signingService:g}=s,S=await this.credentialProvider();this.validateResolvedCredentials(S);const d=m??await this.regionProvider(),{longDate:k,shortDate:P}=nr(f);if(e>xe)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const U=jr(P,d,g??this.service),D=xs(or(r),{unhoistableHeaders:a});if(S.sessionToken)D.query[Ve]=S.sessionToken;D.query[Fe]=_r,D.query[Le]=`${S.accessKeyId}/${U}`,D.query[We]=k,D.query[Ze]=e.toString(10);const Q=ir(D,l,h);return D.query[Xe]=ll(Q),D.query[Qe]=await this.getSignature(k,U,this.getSigningKey(S,d,P,g),this.createCanonicalRequest(D,Q,await Ur(r,this.sha256))),D}async sign(r,s){if(typeof r==="string")return this.signString(r,s);else if(r.headers&&r.payload)return this.signEvent(r,s);else if(r.message)return this.signMessage(r,s);else return this.signRequest(r,s)}async signEvent({headers:r,payload:s},{signingDate:f=new Date,priorSignature:e,signingRegion:l,signingService:a}){const h=l??await this.regionProvider(),{shortDate:m,longDate:g}=nr(f),S=jr(m,h,a??this.service),d=await Ur({headers:{},body:s},this.sha256),k=new this.sha256;k.update(r);const P=Cr.toHex(await k.digest()),U=[je,g,S,e,P,d].join("\n");return this.signString(U,{signingDate:f,signingRegion:h,signingService:a})}async signMessage(r,{signingDate:s=new Date,signingRegion:f,signingService:e}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:s,signingRegion:f,signingService:e,priorSignature:r.priorSignature}).then((a)=>{return{message:r.message,signature:a}})}async signString(r,{signingDate:s=new Date,signingRegion:f,signingService:e}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const a=f??await this.regionProvider(),{shortDate:h}=nr(s),m=new this.sha256(await this.getSigningKey(l,a,h,e));return m.update(v(r)),Cr.toHex(await m.digest())}async signRequest(r,{signingDate:s=new Date,signableHeaders:f,unsignableHeaders:e,signingRegion:l,signingService:a}={}){const h=await this.credentialProvider();this.validateResolvedCredentials(h);const m=l??await this.regionProvider(),g=or(r),{longDate:S,shortDate:d}=nr(s),k=jr(d,m,a??this.service);if(g.headers[Os]=S,h.sessionToken)g.headers[Be]=h.sessionToken;const P=await Ur(g,this.sha256);if(!fl(Mr,g.headers)&&this.applyChecksum)g.headers[Mr]=P;const U=ir(g,e,f),D=await this.getSignature(S,k,this.getSigningKey(h,m,d,a),this.createCanonicalRequest(g,U,P));return g.headers[ve]=`${_r} `+`Credential=${h.accessKeyId}/${k}, `+`SignedHeaders=${ll(U)}, `+`Signature=${D}`,g}createCanonicalRequest(r,s,f){const e=Object.keys(s).sort();return`${r.method}
3
3
  ${this.getCanonicalPath(r)}
4
- ${qs(r)}
4
+ ${js(r)}
5
5
  ${e.map((l)=>`${l}:${s[l]}`).join("\n")}
6
6
 
7
7
  ${e.join(";")}
8
- ${f}`}async createStringToSign(r,s,f){const e=new this.sha256;e.update(J(f));const l=await e.digest();return`${Or}
8
+ ${f}`}async createStringToSign(r,s,f){const e=new this.sha256;e.update(v(f));const l=await e.digest();return`${_r}
9
9
  ${r}
10
10
  ${s}
11
- ${c(l)}`}getCanonicalPath({path:r}){if(this.uriEscapePath){const s=[];for(let l of r.split("/")){if(l?.length===0)continue;if(l===".")continue;if(l==="..")s.pop();else s.push(l)}const f=`${r?.startsWith("/")?"/":""}${s.join("/")}${s.length>0&&r?.endsWith("/")?"/":""}`;return sl.escapeUri(f).replace(/%2F/g,"/")}return r}async getSignature(r,s,f,e){const l=await this.createStringToSign(r,s,e),a=new this.sha256(await f);return a.update(J(l)),c(await a.digest())}getSigningKey(r,s,f,e){return xe(this.sha256,r,f,s,e||this.service)}validateResolvedCredentials(r){if(typeof r!=="object"||typeof r.accessKeyId!=="string"||typeof r.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}}var or=(r)=>{const s=te(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},rl=(r)=>Object.keys(r).sort().join(";");var fl="Directory",el="S3Express",ll="sigv4-s3express",nr="X-Amz-S3session-Token",Cr=nr.toLowerCase(),wg="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Ag="s3_disable_express_session_auth",ps={environmentVariableSelector:(r)=>p(r,wg,u.ENV),configFileSelector:(r)=>p(r,Ag,u.CONFIG),default:!1};var al=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},hl=function(r,s){const f=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),e=r.credentialProvider,l=()=>{return clearTimeout(f),r.credentialProvider=e,Promise.resolve(s)};r.credentialProvider=l};class pr extends ns{async signWithCredentials(r,s,f){const e=al(s);r.headers[Cr]=s.sessionToken;const l=this;return hl(l,e),l.signRequest(r,f??{})}async presignWithCredentials(r,s,f){const e=al(s);return delete r.headers[Cr],r.headers[nr]=s.sessionToken,r.query=r.query??{},r.query[nr]=s.sessionToken,hl(this,e),this.presign(r,f)}}var ml=(r)=>{return(s,f)=>async(e)=>{if(f.endpointV2){const l=f.endpointV2,a=l.properties?.authSchemes?.[0]?.name===ll;if(l.properties?.backend===el||l.properties?.bucketType===fl)f.isS3ExpressBucket=!0;if(a){const m=e.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(f.s3ExpressIdentity=g,L.isInstance(e.request)&&g.sessionToken)e.request.headers[Cr]=g.sessionToken}}}return s(e)}},gl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},us=(r)=>({applyToStack:(s)=>{s.add(ml(r),gl)}});var Al=W(ts(),1);var Rg=W(Sg(),1),Sl=W(os(),1);var wl=async(r,s,f,e)=>{const l=await e.signWithCredentials(f,r,{});if(l.headers["X-Amz-Security-Token"]||l.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return l};var dg=(r)=>(s)=>{throw s},Ig=(r,s)=>{};var Rl=(r)=>(s,f)=>async(e)=>{if(!L.isInstance(e.request))return s(e);const a=Sl.getSmithyContext(f).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:h={}},identity:m,signer:g}=a;let S;if(f.s3ExpressIdentity)S=await wl(f.s3ExpressIdentity,h,e.request,await r.signer());else S=await g.sign(e.request,m,h);const d=await s({...e,request:S}).catch((g.errorHandler||dg)(h));return(g.successHandler||Ig)(d.response,h),d},rf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Rl(r),Al.httpSigningMiddlewareOptions)}});var dl=(r,{session:s})=>{const[f,e]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new lr(async(l)=>f().send(new e({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Eg={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},kg=3000,Pg=(r)=>(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(!Br.isInstance(a))return l;const{statusCode:h,body:m}=a;if(h<200||h>=300)return l;let g=m,S=m;if(m&&typeof m==="object"&&!(m instanceof Uint8Array))[g,S]=await Il(m);a.body=S;const d=await Ng(g,{streamCollector:async(P)=>{return El(P,kg)}});if(typeof g?.destroy==="function")g.destroy();const k=r.utf8Encoder(d.subarray(d.length-16));if(d.length===0&&Eg[f.commandName]){const P=new Error("S3 aborted request");throw P.name="InternalError",P}if(k&&k.endsWith("</Error>"))a.statusCode=400;return l},Ng=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},$g={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},ur=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Pg(r),$g)}});var sf=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function kl(r){return(s,f)=>async(e)=>{if(r.bucketEndpoint){const l=f.endpointV2;if(l){const a=e.input.Bucket;if(typeof a==="string")try{const h=new URL(a);l.url=h}catch(h){const m=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${a} could not be parsed as URL.`;if(f.logger?.constructor?.name==="NoOpLogger")console.warn(m);else f.logger?.warn?.(m);throw h}}}return s(e)}}var Pl={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Dg({bucketEndpoint:r}){return(s)=>async(f)=>{const{input:{Bucket:e}}=f;if(!r&&typeof e==="string"&&!sf(e)&&e.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${e}'`);throw l.name="InvalidBucketName",l}return s({...f})}}var Mg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Nl=(r)=>({applyToStack:(s)=>{s.add(Dg(r),Mg),s.addRelativeTo(kl(r),Pl)}});var kr=W(ts(),1);var $l=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var gs=W(ms(),1);var tr={CrtSignerV4:null};class ff{constructor(r){this.sigv4Signer=new pr(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,f={}){if(f.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,f)}return this.sigv4Signer.signWithCredentials(r,s,f)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,f={}){if(f.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,f)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=tr.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Gr=W(os(),1);var ar={["required"]:!1,["type"]:"String"},hr={["required"]:!0,default:!1,["type"]:"Boolean"},cr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},N={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},T={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Aa={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Dl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},ls={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},Z={["ref"]:"Bucket"},X={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},es={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Sa={["ref"]:"url"},Ra={["fn"]:"uriEncode",["argv"]:[Z],["assign"]:"uri_encoded_bucket"},j={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},da={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!1]},ef={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},as={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Ml={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},yl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[T]},Ul={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Tl={["fn"]:"not",["argv"]:[ls]},Cl={["ref"]:"hardwareType"},cl={["conditions"]:[A],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},rs={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},lf={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},yg={["ref"]:"ForcePathStyle"},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},H={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[z]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},zl={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},C={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Gl={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Hl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Kl={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},af={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Sa,"isIp"]},!1]},hf={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:C,["headers"]:{}},cf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:C,["headers"]:{}},Fl={["endpoint"]:cf,["type"]:"endpoint"},mf={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Ll={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},ss={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},v={["ref"]:"bucketArn"},Ia={["ref"]:"arnType"},gf={["fn"]:"getAttr",["argv"]:[v,"service"]},zf={["ref"]:"accessPointName"},Wl={["conditions"]:[N],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Xl={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Zl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},wf={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[v,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Ea={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},ka={["fn"]:"getAttr",["argv"]:[v,"accountId"]},Af={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Ql={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Sf={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Rf={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},df={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Vl={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},vl={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},zr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Jl={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},Yl={["fn"]:"aws.parseArn",["argv"]:[Z]},Bl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},Ol={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},_l={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},If={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},ql={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:{}},jl={["ref"]:"UseObjectLambdaEndpoint"},Ef={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},il={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},bl={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},xl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},kf={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:C,["headers"]:{}},ol={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:{}},Pf=[{["ref"]:"Region"}],Ug=[{["ref"]:"Endpoint"}],Tg=[Z],Nf=[N],fs=[B],t=[T,X],nl=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],pl=[es],$f=[Ra],Df=[da],mr=[$],ul=[{["fn"]:"substring",["argv"]:[Z,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],tl=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:j,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:j,["headers"]:{}},["type"]:"endpoint"}],ra=[{["fn"]:"substring",["argv"]:[Z,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[Z,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],sa=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:as,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:as,["headers"]:{}},["type"]:"endpoint"}],Cg=[ls],fa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ea=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],cg=["*"],x=[Aa],la=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],o=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],Mf=[{["fn"]:"stringEquals",["argv"]:[Ia,"accesspoint"]}],aa=[{["fn"]:"getAttr",["argv"]:[v,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[zf,""]}]}],zg=[v,"resourceId[1]"],yf=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[v,"region"]},""]}]}],ha=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[v,"resourceId[2]"]}]}]}],Gg=[v,"resourceId[2]"],Uf=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[v,"region"]}],["assign"]:"bucketPartition"}],ma=[{["fn"]:"stringEquals",["argv"]:[Ea,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Tf=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[v,"region"]},!0]}],Cf=[{["fn"]:"isValidHostLabel",["argv"]:[ka,!1]}],ga=[{["fn"]:"isValidHostLabel",["argv"]:[zf,!1]}],wa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Hg={version:"1.0",parameters:{Bucket:ar,Region:ar,UseFIPS:hr,UseDualStack:hr,Endpoint:ar,ForcePathStyle:hr,Accelerate:hr,UseGlobalEndpoint:hr,UseObjectLambdaEndpoint:cr,Key:ar,Prefix:ar,CopySource:ar,DisableAccessPoints:cr,DisableMultiRegionAccessPoints:hr,UseArnRegion:cr,UseS3ExpressControlEndpoint:cr,DisableS3ExpressSessionAuth:cr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Pf}],rules:[{["conditions"]:[B,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[N,T],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[T,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[T,B],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,Aa,Dl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[ls,{["fn"]:"substring",["argv"]:[Z,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Nf,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:fs,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:t,rules:[{["conditions"]:nl,rules:[{["conditions"]:pl,rules:[{["conditions"]:$f,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:j,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:j,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ef],["type"]:"tree"},{["conditions"]:pl,rules:[{["conditions"]:$f,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:as,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:as,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ef],["type"]:"tree"},{["conditions"]:[Ml,yl],rules:[{["conditions"]:[Ra,A],rules:[{["conditions"]:mr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:j,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:j,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Df,rules:[{["conditions"]:nl,rules:[{["conditions"]:ul,rules:tl,["type"]:"tree"},{["conditions"]:ra,rules:tl,["type"]:"tree"},Ul],["type"]:"tree"},{["conditions"]:ul,rules:sa,["type"]:"tree"},{["conditions"]:ra,rules:sa,["type"]:"tree"},Ul],["type"]:"tree"},ef],["type"]:"tree"},{["conditions"]:[Tl,Ml,yl],rules:[{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:j,["headers"]:w},["type"]:"endpoint"},{["conditions"]:mr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:j,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:j,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[ls,{["fn"]:"substring",["argv"]:[Z,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[Z,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[Z,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[Z,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Pf,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:fa,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Cl,"e"]}],rules:[{["conditions"]:ea,rules:[cl,{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Cl,"o"]}],rules:[{["conditions"]:ea,rules:[cl,{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:rs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Cg,rules:[{["conditions"]:[T,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Ug}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[lf,da],rules:[{["conditions"]:x,rules:[{["conditions"]:la,rules:[{["conditions"]:[B,Dl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[N,$,U,A,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,$,U,A,E,K],rules:[{endpoint:zl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,$,U,A,E,F],endpoint:zl,["type"]:"endpoint"},{["conditions"]:[I,$,U,A,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,$,U,A,E,K],rules:[{endpoint:Gl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,$,U,A,E,F],endpoint:Gl,["type"]:"endpoint"},{["conditions"]:[N,R,B,A,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,B,A,E,K],rules:[{endpoint:Hl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,B,A,E,F],endpoint:Hl,["type"]:"endpoint"},{["conditions"]:[N,R,U,A,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,U,A,E,K],rules:[{endpoint:Kl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,U,A,E,F],endpoint:Kl,["type"]:"endpoint"},{["conditions"]:[I,R,U,T,X,es,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,T,X,af,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,T,X,es,E,K],rules:[{["conditions"]:o,endpoint:hf,["type"]:"endpoint"},{endpoint:hf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,U,T,X,af,E,K],rules:[{["conditions"]:o,endpoint:cf,["type"]:"endpoint"},Fl],["type"]:"tree"},{["conditions"]:[I,R,U,T,X,es,E,F],endpoint:hf,["type"]:"endpoint"},{["conditions"]:[I,R,U,T,X,af,E,F],endpoint:cf,["type"]:"endpoint"},{["conditions"]:[I,R,B,A,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,B,A,E,K],rules:[{["conditions"]:o,endpoint:mf,["type"]:"endpoint"},{endpoint:mf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,B,A,E,F],endpoint:mf,["type"]:"endpoint"},{["conditions"]:[I,R,U,A,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,A,E,K],rules:[{["conditions"]:o,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,U,A,E,F],endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},ss],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[T,X,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Sa,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[Z,!0]},lf,R,I,U],rules:[{["conditions"]:x,rules:[{["conditions"]:la,rules:[Fl],["type"]:"tree"},ss],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[lf,{["fn"]:"aws.parseArn",["argv"]:Tg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[v,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Ia,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[gf,"s3-object-lambda"]}],rules:[{["conditions"]:Mf,rules:[{["conditions"]:aa,rules:[Wl,Xl,{["conditions"]:yf,rules:[Zl,{["conditions"]:ha,rules:[wf,{["conditions"]:Uf,rules:[{["conditions"]:x,rules:[{["conditions"]:ma,rules:[{["conditions"]:Tf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[ka,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:Cf,rules:[{["conditions"]:ga,rules:[{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Af,["headers"]:w},["type"]:"endpoint"},{["conditions"]:mr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Af,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Af,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ql],["type"]:"tree"},Sf],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Vl],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},vl],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{["conditions"]:aa,rules:[{["conditions"]:yf,rules:[{["conditions"]:Mf,rules:[{["conditions"]:yf,rules:[Zl,{["conditions"]:ha,rules:[wf,{["conditions"]:Uf,rules:[{["conditions"]:x,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Ea,"{partitionResult#name}"]}],rules:[{["conditions"]:Tf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[gf,"s3"]}],rules:[{["conditions"]:Cf,rules:[{["conditions"]:ga,rules:[{["conditions"]:fs,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[$,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:zr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:zr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:zr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,T,X],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:zr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:zr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Ql],["type"]:"tree"},Sf],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Vl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[zf,!0]}],rules:[{["conditions"]:Nf,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:mr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:fs,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:Pf,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[v,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:cg}]},["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},vl],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[gf,"s3-outposts"]}],rules:[{["conditions"]:Nf,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:mr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:fs,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[v,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:zg,["assign"]:"outpostId"}],rules:[{["conditions"]:fa,rules:[wf,{["conditions"]:Uf,rules:[{["conditions"]:x,rules:[{["conditions"]:ma,rules:[{["conditions"]:Tf,rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Gg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[v,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:t,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Jl,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Jl,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},Sf],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[Z,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[Yl]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[yg,!0]},Yl],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:$f,rules:[{["conditions"]:x,rules:[{["conditions"]:[U],rules:[{["conditions"]:[N,A,$,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,$,E,K],rules:[{endpoint:Bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,$,E,F],endpoint:Bl,["type"]:"endpoint"},{["conditions"]:[I,A,$,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,$,E,K],rules:[{endpoint:Ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,$,E,F],endpoint:Ol,["type"]:"endpoint"},{["conditions"]:[N,A,R,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,R,E,K],rules:[{endpoint:_l,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,R,E,F],endpoint:_l,["type"]:"endpoint"},{["conditions"]:[I,T,X,R,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,T,X,R,E,K],rules:[{["conditions"]:o,endpoint:If,["type"]:"endpoint"},{endpoint:If,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,X,R,E,F],endpoint:If,["type"]:"endpoint"},{["conditions"]:[I,A,R,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,R,E,K],rules:[{["conditions"]:o,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{endpoint:ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,R,E,F],endpoint:ql,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[jl]},{["fn"]:"booleanEquals",["argv"]:[jl,!0]}],rules:[{["conditions"]:x,rules:[{["conditions"]:wa,rules:[Wl,Xl,{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:Ef,["headers"]:w},["type"]:"endpoint"},{["conditions"]:mr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ef,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:Ef,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ss],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Tl],rules:[{["conditions"]:x,rules:[{["conditions"]:wa,rules:[{["conditions"]:[$,N,A,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,N,A,E,K],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,N,A,E,F],endpoint:il,["type"]:"endpoint"},{["conditions"]:[$,I,A,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I,A,E,K],rules:[{endpoint:bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,I,A,E,F],endpoint:bl,["type"]:"endpoint"},{["conditions"]:[R,N,A,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N,A,E,K],rules:[{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,N,A,E,F],endpoint:xl,["type"]:"endpoint"},{["conditions"]:[R,I,T,X,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,T,X,E,K],rules:[{["conditions"]:o,endpoint:kf,["type"]:"endpoint"},{endpoint:kf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,T,X,E,F],endpoint:kf,["type"]:"endpoint"},{["conditions"]:[R,I,A,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,A,E,K],rules:[{["conditions"]:o,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,A,E,F],endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},ss],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Pa=Hg;var hs=(r,s={})=>{return $a(Pa,{endpointParams:r,logger:s.logger})};Na.aws=Da;var Ua=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Ta=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Kg=(r)=>async(s,f,e)=>{if(!e)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,f,e),a=Gr.getSmithyContext(f)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${f.commandName}\``);const h=await Ma(e,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Fg=async(r,s,f)=>{return{operation:Gr.getSmithyContext(s).operation,region:await Gr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ya=Kg(Fg),Lg=(r,s,f)=>{return(l)=>{const h=r(l).properties?.authSchemes;if(!h)return s(l);const m=[];for(let g of h){const{name:S,properties:d={},...k}=g,P=S.toLowerCase();if(S!==P)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${S}\` to \`${P}\``);let y;if(P==="sigv4a"){y="aws.auth#sigv4a";const Jr=h.find((q)=>{const $r=q.name.toLowerCase();return $r!=="sigv4a"&&$r.startsWith("sigv4")});if(!tr.CrtSignerV4&&Jr)continue}else if(P.startsWith("sigv4"))y="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${P}\``);const D=f[y];if(!D)throw new Error(`Could not find HttpAuthOption create function for \`${y}\``);const V=D(l);V.schemeId=y,V.signingProperties={...V.signingProperties||{},...k,...d},m.push(V)}return m}},Wg=(r)=>{const s=[];switch(r.operation){default:s.push(Ua(r)),s.push(Ta(r))}return s},Ca=Lg(hs,Wg,{"aws.auth#sigv4":Ua,"aws.auth#sigv4a":Ta}),ca=(r)=>{const s=gs.resolveAwsSdkSigV4Config(r);return{...gs.resolveAwsSdkSigV4AConfig(s)}};var za=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},gr={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class Q extends Ga{constructor(r){super(r);Object.setPrototypeOf(this,Q.prototype)}}class ws extends Q{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,ws.prototype)}}class As extends Q{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,As.prototype)}}class Ss extends Q{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Ss.prototype)}}class Rs extends Q{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Rs.prototype)}}class ds extends Q{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,ds.prototype)}}var Gf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Gf||(Gf={}));var Hf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return f.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return f.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Hf||(Hf={}));var Kf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.AccessPointArn!==void 0)return f.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Kf||(Kf={}));var Ff;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Ff||(Ff={}));class Is extends Q{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Is.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class Es extends Q{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,Es.prototype)}}class ks extends Q{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ks.prototype)}}var Xg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:O},...r.SessionToken&&{SessionToken:O}}),Ha=(r)=>({...r,...r.Credentials&&{Credentials:Xg(r.Credentials)}});var Ka=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:O}}),Fa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:O}});var Sr=W(ms(),1);var Ms=W(ts(),1);class Ps extends Q{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ps.prototype)}}var La;(function(r){r.visit=(s,f)=>{if(s.Records!==void 0)return f.Records(s.Records);if(s.Stats!==void 0)return f.Stats(s.Stats);if(s.Progress!==void 0)return f.Progress(s.Progress);if(s.Cont!==void 0)return f.Cont(s.Cont);if(s.End!==void 0)return f.End(s.End);return f._(s.$unknown[0],s.$unknown[1])}})(La||(La={}));var Wa=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:O},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:O}}),Xa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:O},...r.SSEKMSKeyId&&{SSEKMSKeyId:O},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:O}});var ba=async(r,s)=>{const f=Ms.requestBuilder(r,s),e=G({},i,{[_w]:r[Dw]});f.bp("/"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=G({[Jw]:[,""]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var xa=async(r,s)=>{const f=Ms.requestBuilder(r,s),e=G({},i,{[zw]:r[aw],[Gw]:[()=>i(r[Za]),()=>Hr(r[Za]).toString()],[Hw]:r[hw],[Kw]:[()=>i(r[Qa]),()=>Hr(r[Qa]).toString()],[Lw]:r[Sw],[Ts]:r[ys],[zh]:r[Ah],[Cs]:r[Us],[Th]:r[wh],[Dh]:r[lh],[Ow]:r[ng]});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Kh]:[,"GetObject"],[Ww]:[,r[Rw]],[Xw]:[,r[dw]],[Zw]:[,r[Iw]],[Qw]:[,r[Ew]],[Vw]:[,r[kw]],[vw]:[()=>r.ResponseExpires!==void 0,()=>Hr(r[Pw]).toString()],[Yw]:[,r[uf]],[Fw]:[()=>r.PartNumber!==void 0,()=>r[Aw].toString()]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var oa=async(r,s)=>{const f=Ms.requestBuilder(r,s),e=G({},i,{[Ph]:r[eh]||"application/octet-stream",[Bw]:r[bg],[dh]:r[ta],[Ih]:r[rh],[Eh]:r[sh],[kh]:r[fh],[Yf]:[()=>i(r[Vf]),()=>r[Vf].toString()],[Tw]:r[pg],[nw]:r[og],[tf]:r[jf],[re]:r[bf],[se]:r[xf],[fe]:r[of],[Bf]:[()=>i(r[vf]),()=>Hr(r[vf]).toString()],[qw]:r[sw],[jw]:r[fw],[iw]:r[ew],[bw]:r[lw],[ee]:r[nf],[Ch]:r[Fr],[Hh]:r[Rh],[Ts]:r[ys],[zh]:r[Ah],[Cs]:r[Us],[le]:r[pf],[ch]:r[Sh],[Lr]:[()=>i(r[Ds]),()=>r[Ds].toString()],[Th]:r[wh],[pw]:r[Mw],[yh]:r[mh],[Of]:[()=>i(r[Jf]),()=>ia(r[Jf]).toString()],[Mh]:r[hh],[Dh]:r[lh],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Kh]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return f.m("PUT").h(e).q(l).b(a),f.build()};var na=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return qf(r,s);const f=G({$metadata:Y(r)}),e=wr(_a(await Sr.parseXmlBody(r.body,s)),"body");if(e[Xf]!=null)f[Xf]=ig(e[Xf],s);return f};var pa=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return qf(r,s);const f=G({$metadata:Y(r),[tg]:[()=>r.headers[va]!==void 0,()=>$s(r.headers[va])],[xg]:[,r.headers[Uw]],[Kr]:[,r.headers[$h]],[$w]:[,r.headers[xw]],[mw]:[()=>r.headers[Va]!==void 0,()=>wr(Dr(r.headers[Va]))],[Vf]:[()=>r.headers[Yf]!==void 0,()=>qa(r.headers[Yf])],[ah]:[,r.headers[Nh]],[jf]:[,r.headers[tf]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[gw]:[()=>r.headers[Ja]!==void 0,()=>Ns(r.headers[Ja])],[uf]:[,r.headers[Gh]],[ta]:[,r.headers[dh]],[rh]:[,r.headers[Ih]],[sh]:[,r.headers[Eh]],[fh]:[,r.headers[kh]],[ug]:[,r.headers[Cw]],[eh]:[,r.headers[Ph]],[vf]:[()=>r.headers[Bf]!==void 0,()=>wr(Dr(r.headers[Bf]))],[rw]:[,r.headers[cw]],[Rh]:[,r.headers[Hh]],[nf]:[,r.headers[ee]],[ys]:[,r.headers[Ts]],[Us]:[,r.headers[Cs]],[pf]:[,r.headers[le]],[Ds]:[()=>r.headers[Lr]!==void 0,()=>$s(r.headers[Lr])],[Fr]:[,r.headers[Ch]],[gh]:[,r.headers[Uh]],[Nw]:[,r.headers[ow]],[ww]:[()=>r.headers[Ya]!==void 0,()=>Ns(r.headers[Ya])],[yw]:[()=>r.headers[Ba]!==void 0,()=>Ns(r.headers[Ba])],[mh]:[,r.headers[yh]],[Jf]:[()=>r.headers[Of]!==void 0,()=>wr(_f(r.headers[Of]))],[hh]:[,r.headers[Mh]],Metadata:[,Object.keys(r.headers).filter((l)=>l.startsWith("x-amz-meta-")).reduce((l,a)=>{return l[a.substring(11)]=r.headers[a],l},{})]}),e=r.body;return s.sdkStreamMixin(e),f.Body=e,f};var ua=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return qf(r,s);const f=G({$metadata:Y(r),[Kr]:[,r.headers[$h]],[ah]:[,r.headers[Nh]],[jf]:[,r.headers[tf]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[uf]:[,r.headers[Gh]],[ys]:[,r.headers[Ts]],[Us]:[,r.headers[Cs]],[pf]:[,r.headers[le]],[Sh]:[,r.headers[ch]],[Ds]:[()=>r.headers[Lr]!==void 0,()=>$s(r.headers[Lr])],[gh]:[,r.headers[Uh]]});return await Oa(r.body,s),f};var qf=async(r,s)=>{const f={...r,body:await Sr.parseXmlErrorBody(r.body,s)},e=Sr.loadRestXmlErrorCode(r,f.body);switch(e){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await Og(f,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await jg(f,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Vg(f,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await vg(f,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await Yg(f,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await Jg(f,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await Bg(f,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await _g(f,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await qg(f,s);default:const l=f.body;return Qg({output:r,parsedBody:l,errorCode:e})}},Qg=ja(Q),Vg=async(r,s)=>{const f=G({}),e=r.body,l=new Ss({$metadata:Y(r),...f});return _(l,r.body)},vg=async(r,s)=>{const f=G({}),e=r.body,l=new Rs({$metadata:Y(r),...f});return _(l,r.body)},Jg=async(r,s)=>{const f=G({}),e=r.body;if(e[Wf]!=null)f[Wf]=Ar(e[Wf]);if(e[Fr]!=null)f[Fr]=Ar(e[Fr]);const l=new Is({$metadata:Y(r),...f});return _(l,r.body)},Yg=async(r,s)=>{const f=G({}),e=r.body,l=new ds({$metadata:Y(r),...f});return _(l,r.body)},Bg=async(r,s)=>{const f=G({}),e=r.body,l=new Es({$metadata:Y(r),...f});return _(l,r.body)},Og=async(r,s)=>{const f=G({}),e=r.body,l=new ws({$metadata:Y(r),...f});return _(l,r.body)},_g=async(r,s)=>{const f=G({}),e=r.body,l=new ks({$metadata:Y(r),...f});return _(l,r.body)},qg=async(r,s)=>{const f=G({}),e=r.body,l=new Ps({$metadata:Y(r),...f});return _(l,r.body)},jg=async(r,s)=>{const f=G({}),e=r.body,l=new As({$metadata:Y(r),...f});return _(l,r.body)};var ig=(r,s)=>{const f={};if(r[Lf]!=null)f[Lf]=Ar(r[Lf]);if(r[Zf]!=null)f[Zf]=Ar(r[Zf]);if(r[Qf]!=null)f[Qf]=Ar(r[Qf]);if(r[Kr]!=null)f[Kr]=wr(_f(r[Kr]));return f};var Y=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var i=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var bg="ACL";var Lf="AccessKeyId";var xg="AcceptRanges";var Wf="AccessTier";var Ds="BucketKeyEnabled";var Xf="Credentials",og="ChecksumAlgorithm";var ta="CacheControl",jf="ChecksumCRC32",bf="ChecksumCRC32C",rh="ContentDisposition";var sh="ContentEncoding";var fh="ContentLanguage",Vf="ContentLength",ng="ChecksumMode",pg="ContentMD5";var ug="ContentRange";var xf="ChecksumSHA1",of="ChecksumSHA256";var eh="ContentType";var tg="DeleteMarker";var vf="Expires";var lh="ExpectedBucketOwner";var rw="ExpiresString";var ah="ETag";var Kr="Expiration";var sw="GrantFullControl";var fw="GrantRead",ew="GrantReadACP";var lw="GrantWriteACP";var aw="IfMatch",Za="IfModifiedSince",hw="IfNoneMatch";var Qa="IfUnmodifiedSince";var mw="LastModified";var gw="MissingMeta";var hh="ObjectLockLegalHoldStatus",mh="ObjectLockMode";var Jf="ObjectLockRetainUntilDate";var ww="PartsCount";var Aw="PartNumber";var Sw="Range";var gh="RequestCharged",Rw="ResponseCacheControl",dw="ResponseContentDisposition",Iw="ResponseContentEncoding",Ew="ResponseContentLanguage",kw="ResponseContentType";var Pw="ResponseExpires";var wh="RequestPayer";var Nw="ReplicationStatus";var $w="Restore";var Zf="SecretAccessKey";var Fr="StorageClass";var Dw="SessionMode";var nf="ServerSideEncryption";var ys="SSECustomerAlgorithm",Ah="SSECustomerKey",Us="SSECustomerKeyMD5";var Sh="SSEKMSEncryptionContext",pf="SSEKMSKeyId";var Qf="SessionToken";var Mw="Tagging";var yw="TagCount";var uf="VersionId";var Rh="WebsiteRedirectLocation";var Uw="accept-ranges";var dh="cache-control",Ih="content-disposition",Eh="content-encoding",kh="content-language",Yf="content-length",Tw="content-md5",Cw="content-range",Ph="content-type";var Bf="expires";var Nh="etag",cw="expiresstring";var zw="if-match",Gw="if-modified-since";var Hw="if-none-match";var Kw="if-unmodified-since";var Va="last-modified";var Fw="partNumber";var Lw="range",Ww="response-cache-control",Xw="response-content-disposition",Zw="response-content-encoding",Qw="response-content-language",Vw="response-content-type",vw="response-expires";var Jw="session";var Yw="versionId";var Bw="x-amz-acl";var tf="x-amz-checksum-crc32",re="x-amz-checksum-crc32c",Ow="x-amz-checksum-mode";var se="x-amz-checksum-sha1",fe="x-amz-checksum-sha256";var _w="x-amz-create-session-mode";var va="x-amz-delete-marker",$h="x-amz-expiration",Dh="x-amz-expected-bucket-owner";var qw="x-amz-grant-full-control",jw="x-amz-grant-read",iw="x-amz-grant-read-acp";var bw="x-amz-grant-write-acp";var Ja="x-amz-missing-meta";var Ya="x-amz-mp-parts-count";var Mh="x-amz-object-lock-legal-hold",yh="x-amz-object-lock-mode",Of="x-amz-object-lock-retain-until-date";var xw="x-amz-restore",Uh="x-amz-request-charged";var Th="x-amz-request-payer";var ow="x-amz-replication-status";var Ch="x-amz-storage-class",nw="x-amz-sdk-checksum-algorithm";var ee="x-amz-server-side-encryption",le="x-amz-server-side-encryption-aws-kms-key-id",Lr="x-amz-server-side-encryption-bucket-key-enabled",ch="x-amz-server-side-encryption-context",Ts="x-amz-server-side-encryption-customer-algorithm",zh="x-amz-server-side-encryption-customer-key",Cs="x-amz-server-side-encryption-customer-key-md5",pw="x-amz-tagging",Ba="x-amz-tagging-count";var Gh="x-amz-version-id",Hh="x-amz-website-redirect-location",Kh="x-id";class ae extends Rr.classBuilder().ep({...gr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,f,e){return[dr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),ur(f)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Ha).ser(ba).de(na).build(){}var Fh={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.629.0","@aws-sdk/client-sts":"3.629.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-bucket-endpoint":"3.620.0","@aws-sdk/middleware-expect-continue":"3.620.0","@aws-sdk/middleware-flexible-checksums":"3.620.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-location-constraint":"3.609.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-sdk-s3":"3.629.0","@aws-sdk/middleware-ssec":"3.609.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/signature-v4-multi-region":"3.629.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@aws-sdk/xml-builder":"3.609.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-blob-browser":"^3.1.2","@smithy/hash-node":"^3.0.3","@smithy/hash-stream-node":"^3.1.2","@smithy/invalid-dependency":"^3.0.3","@smithy/md5-js":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.2",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.629.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var Ws=W(ms(),1);var tw="AWS_S3_USE_ARN_REGION",rA="s3_use_arn_region",Lh={environmentVariableSelector:(r)=>p(r,tw,u.ENV),configFileSelector:(r)=>p(r,rA,u.CONFIG),default:!1};var Wh=W(AA(),1),{__extends:Ad,__assign:Sd,__rest:Rd,__decorate:dd,__param:Id,__esDecorate:Ed,__runInitializers:kd,__propKey:Pd,__setFunctionName:Nd,__metadata:$d,__awaiter:cs,__generator:zs,__exportStar:Dd,__createBinding:Md,__values:Gs,__read:yd,__spread:Ud,__spreadArrays:Td,__spreadArray:Cd,__await:cd,__asyncGenerator:zd,__asyncDelegator:Gd,__asyncValues:Hd,__makeTemplateObject:Kd,__importStar:Fd,__importDefault:Ld,__classPrivateFieldGet:Wd,__classPrivateFieldSet:Xd,__classPrivateFieldIn:Zd,__addDisposableResource:Qd,__disposeResources:Vd}=Wh.default;import{Buffer as Xh} from"buffer";var Zh=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Xh.from(r,s):Xh.from(r)};var he=(r)=>{const s=Zh(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Wr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return SA(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var SA=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:he;function Xr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Zr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Qr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),f=0;while(f<r.length)s[f]=r[f],f+=1;return s}return Uint32Array.from(r)}var me=function(){function r(){this.crc32=new rr}return r.prototype.update=function(s){if(Xr(s))return;this.crc32.update(Wr(s))},r.prototype.digest=function(){return cs(this,void 0,void 0,function(){return zs(this,function(s){return[2,Zr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new rr},r}();var rr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Gs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^dA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var RA=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],dA=Qr(RA);var Qh=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Er{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)Qh(s);return new Er(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Qh(r);return parseInt(c(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class ge{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let l of Object.keys(r)){const a=this.fromUtf8(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=this.fromUtf8(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(Er.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!yA.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(br(r.value.replace(/\-/g,"")),1),d}}parse(r){const s={};let f=0;while(f<r.byteLength){const e=r.getUint8(f++),l=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,e));switch(f+=e,r.getUint8(f++)){case 0:s[l]={type:vh,value:!0};break;case 1:s[l]={type:vh,value:!1};break;case 2:s[l]={type:IA,value:r.getInt8(f++)};break;case 3:s[l]={type:EA,value:r.getInt16(f,!1)},f+=2;break;case 4:s[l]={type:kA,value:r.getInt32(f,!1)},f+=4;break;case 5:s[l]={type:PA,value:new Er(new Uint8Array(r.buffer,r.byteOffset+f,8))},f+=8;break;case 6:const a=r.getUint16(f,!1);f+=2,s[l]={type:NA,value:new Uint8Array(r.buffer,r.byteOffset+f,a)},f+=a;break;case 7:const h=r.getUint16(f,!1);f+=2,s[l]={type:$A,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,h))},f+=h;break;case 8:s[l]={type:DA,value:new Date(new Er(new Uint8Array(r.buffer,r.byteOffset+f,8)).valueOf())},f+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+f,16);f+=16,s[l]={type:MA,value:`${c(m.subarray(0,4))}-${c(m.subarray(4,6))}-${c(m.subarray(6,8))}-${c(m.subarray(8,10))}-${c(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var Vh;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(Vh||(Vh={}));var vh="boolean",IA="byte",EA="short",kA="integer",PA="long",NA="binary",$A="string",DA="timestamp",MA="uuid",yA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function Yh({byteLength:r,byteOffset:s,buffer:f}){if(r<UA)throw new Error("Provided message too short to accommodate event stream message overhead");const e=new DataView(f,s,r),l=e.getUint32(0,!1);if(r!==l)throw new Error("Reported message length does not match received message length");const a=e.getUint32(Jh,!1),h=e.getUint32(n,!1),m=e.getUint32(r-sr,!1),g=new rr().update(new Uint8Array(f,s,n));if(h!==g.digest())throw new Error(`The prelude checksum specified in the message (${h}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(f,s+n,r-(n+sr))),m!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${m}`);return{headers:new DataView(f,s+n+sr,a),body:new Uint8Array(f,s+n+sr+a,l-a-(n+sr+sr))}}var Jh=4,n=Jh*2,sr=4,UA=n+sr*2;class we{constructor(r,s){this.headerMarshaller=new ge(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const f=this.headerMarshaller.format(r),e=f.byteLength+s.byteLength+16,l=new Uint8Array(e),a=new DataView(l.buffer,l.byteOffset,l.byteLength),h=new rr;return a.setUint32(0,e,!1),a.setUint32(4,f.byteLength,!1),a.setUint32(8,h.update(l.subarray(0,8)).digest(),!1),l.set(f,12),l.set(s,f.byteLength+12),a.setUint32(e-4,h.update(l.subarray(8,e-4)).digest(),!1),l}decode(r){const{headers:s,body:f}=Yh(r);return{headers:this.headerMarshaller.parse(s),body:f}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Ae{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class Se{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Re{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class de{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function Bh(r){let s=0,f=0,e=null,l=null;const a=(m)=>{if(typeof m!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+m);s=m,f=4,e=new Uint8Array(m),new DataView(e.buffer).setUint32(0,m,!1)},h=async function*(){const m=r[Symbol.asyncIterator]();while(!0){const{value:g,done:S}=await m.next();if(S){if(!s)return;else if(s===f)yield e;else throw new Error("Truncated event message received.");return}const d=g.length;let k=0;while(k<d){if(!e){const y=d-k;if(!l)l=new Uint8Array(4);const D=Math.min(4-f,y);if(l.set(g.slice(k,k+D),f),f+=D,k+=D,f<4)break;a(new DataView(l.buffer).getUint32(0,!1)),l=null}const P=Math.min(s-f,d-k);if(e.set(g.slice(k,k+P),f),f+=P,k+=P,s&&s===f)yield e,e=null,s=0,f=0}}};return{[Symbol.asyncIterator]:h}}function Oh(r,s){return async function(f){const{value:e}=f.headers[":message-type"];if(e==="error"){const l=new Error(f.headers[":error-message"].value||"UnknownError");throw l.name=f.headers[":error-code"].value,l}else if(e==="exception"){const l=f.headers[":exception-type"].value,a={[l]:f},h=await r(a);if(h.$unknown){const m=new Error(s(f.body));throw m.name=l,m}throw h[l]}else if(e==="event"){const l={[f.headers[":event-type"].value]:f},a=await r(l);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${f.headers[":event-type"].value}`)}}class Hs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new we(r,s),this.utfEncoder=r}deserialize(r,s){const f=Bh(r);return new Re({messageStream:new Ae({inputStream:f,decoder:this.eventStreamCodec}),deserializer:Oh(s,this.utfEncoder)})}serialize(r,s){return new Se({messageStream:new de({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as TA} from"stream";async function*_h(r){let s=!1,f=!1;const e=new Array;r.on("error",(l)=>{if(!s)s=!0;if(l)throw l}),r.on("data",(l)=>{e.push(l)}),r.on("end",()=>{s=!0});while(!f){const l=await new Promise((a)=>setTimeout(()=>a(e.shift()),0));if(l)yield l;f=s&&e.length===0}}class Ie{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Hs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const f=typeof r[Symbol.asyncIterator]==="function"?r:_h(r);return this.universalMarshaller.deserialize(f,s)}serialize(r,s){return TA.from(this.universalMarshaller.serialize(r,s))}}var qh=(r)=>new Ie(r);import{Writable as CA} from"stream";class Ks extends CA{constructor(r,s){super(s);this.hash=r}_write(r,s,f){try{this.hash.update(J(r))}catch(e){return f(e)}f()}}var jh=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const f=new r,e=new Ks(f);return s.pipe(e),new Promise((l,a)=>{s.on("error",(h)=>{e.end(),a(h)}),e.on("error",a),e.on("finish",()=>{f.digest().then(l).catch(a)})})};var Fs=W(ms(),1);var ph=W(cA(),1);var uh=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??ih,base64Encoder:r?.base64Encoder??xh,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??hs,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??oh,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Ca,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Fs.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Fs.AwsSdkSigV4ASigner}],logger:r?.logger??new Yr,sdkStreamMixin:r?.sdkStreamMixin??nh,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ff,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??ph.parseUrl,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Tr,utf8Encoder:r?.utf8Encoder??bh}};var Im=(r)=>{fm(process.version);const s=Rm(r),f=()=>s().then(sm),e=uh(r);return Ws.emitWarningIfUnsupportedVersion(process.version),{...e,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Sm,credentialDefaultProvider:r?.credentialDefaultProvider??dm,defaultUserAgentProvider:r?.defaultUserAgentProvider??Am({serviceId:e.serviceId,clientVersion:Fh.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??b(ps),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??qh,maxAttempts:r?.maxAttempts??b(gm),md5:r?.md5??Ls.bind(null,"md5"),region:r?.region??b(am,hm),requestHandler:th.create(r?.requestHandler??f),retryMode:r?.retryMode??b({...wm,default:async()=>(await f()).retryMode||mm}),sha1:r?.sha1??Ls.bind(null,"sha1"),sha256:r?.sha256??Ls.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??b(Ws.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??rm,streamHasher:r?.streamHasher??jh,useArnRegion:r?.useArnRegion??b(Lh),useDualstackEndpoint:r?.useDualstackEndpoint??b(em),useFipsEndpoint:r?.useFipsEndpoint??b(lm)}};var Em=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:f,credentials:e}=r;return{setHttpAuthScheme(l){const a=s.findIndex((h)=>h.schemeId===l.schemeId);if(a===-1)s.push(l);else s.splice(a,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){f=l},httpAuthSchemeProvider(){return f},setCredentials(l){e=l},credentials(){return e}}},km=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Xs=(r)=>r,Um=(r,s)=>{const f={...Xs(Mm(r)),...Xs($m(r)),...Xs(Pm(r)),...Xs(Em(r))};return s.forEach((e)=>e.configure(f)),{...r,...ym(f),...Dm(f),...Nm(f),...km(f)}};class Ee extends Gm{constructor(...[r]){const s=Im(r||{}),f=za(s),e=Hm(f),l=Xm(e),a=Fm(l),h=Tm(a),m=Wm(h),g=$l(m),S=ca(g),d=dl(S,{session:[()=>this,ae]}),k=Um(d,r?.extensions||[]);super(k);this.config=k,this.middlewareStack.use(Km(this.config)),this.middlewareStack.use(Zm(this.config)),this.middlewareStack.use(Lm(this.config)),this.middlewareStack.use(Cm(this.config)),this.middlewareStack.use(cm(this.config)),this.middlewareStack.use(zm(this.config)),this.middlewareStack.use(kr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ya,identityProviderConfigProvider:async(P)=>new kr.DefaultIdentityProviderConfig({"aws.auth#sigv4":P.credentials,"aws.auth#sigv4a":P.credentials})})),this.middlewareStack.use(kr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Nl(this.config)),this.middlewareStack.use(Ue(this.config)),this.middlewareStack.use(ze(this.config)),this.middlewareStack.use(us(this.config)),this.middlewareStack.use(rf(this.config))}destroy(){super.destroy()}}function zA(r){return(s)=>async(f)=>{const e={...f.input},l=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of l){const h=e[a.target];if(h){let m;if(typeof h==="string")if(HA(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),e[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),e[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),e[a.hash]=r.base64Encoder(await g.digest())}}return s({...f,input:e})}}function HA(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var GA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Zs=(r)=>({applyToStack:(s)=>{s.add(zA(r),GA)}});var M;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(M||(M={}));var Qm;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Qm||(Qm={}));var{MD5:Vm,CRC32:vm}=M;var Vr=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256],Jm=[M.CRC32,M.CRC32C,M.SHA1,M.SHA256];var Ym=(r,{requestChecksumRequired:s,requestAlgorithmMember:f},e)=>{const l=e?vm:Vm;if(!f||!r[f])return s?l:void 0;const a=r[f];if(!Vr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${Vr}.`);return a};var Pr=(r)=>r===M.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var Bm=(r,s)=>{const f=r.toLowerCase();for(let e of Object.keys(s))if(f===e.toLowerCase())return!0;return!1};var Nr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!ir(r);var Pe=function(){function r(){this.crc32c=new ke}return r.prototype.update=function(s){if(Xr(s))return;this.crc32c.update(Wr(s))},r.prototype.digest=function(){return cs(this,void 0,void 0,function(){return zs(this,function(s){return[2,Zr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new ke},r}();var ke=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Gs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^FA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var KA=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],FA=Qr(KA);var Qs=(r,s)=>({[M.MD5]:s.md5,[M.CRC32]:me,[M.CRC32C]:Pe,[M.SHA1]:s.sha1,[M.SHA256]:s.sha256})[r];var Vs=(r,s)=>{const f=new r;return f.update(J(s||"")),f.digest()};var Om={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},_m=(r,s)=>(f,e)=>async(l)=>{if(!L.isInstance(l.request))return f(l);const{request:a}=l,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:S}=r,{input:d,requestChecksumRequired:k,requestAlgorithmMember:P}=s,y=Ym(d,{requestChecksumRequired:k,requestAlgorithmMember:P},!!e.isS3ExpressBucket);let D=h,V=m;if(y){const q=Pr(y),$r=Qs(y,r);if(Nr(h)){const{getAwsChunkedEncodingStream:Ys,bodyLengthChecker:pm}=r;D=Ys(h,{base64Encoder:g,bodyLengthChecker:pm,checksumLocationName:q,checksumAlgorithmFn:$r,streamHasher:S}),V={...m,"content-encoding":m["content-encoding"]?`${m["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":m["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":q},delete V["content-length"]}else if(!Bm(q,m)){const Ys=await Vs($r,h);V={...m,[q]:g(Ys)}}}return await f({...l,request:{...a,headers:V,body:D}})};var vs=(r=[])=>{const s=[];for(let f of Jm){if(!r.includes(f)||!Vr.includes(f))continue;s.push(f)}return s};var qm=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const f=r.slice(s+1);if(!f.startsWith("0")){const e=parseInt(f,10);if(!isNaN(e)&&e>=1&&e<=1e4)return!0}}return!1};import{Transform as LA} from"stream";function Ne(r){const s=new LA;return s.push(r),s.push(null),s}var jm=async(r,{streamHasher:s,checksumAlgorithmFn:f,base64Encoder:e})=>{const l=Nr(r)?s(f,r):Vs(f,r);return e(await l)};var im=async(r,{config:s,responseAlgorithms:f})=>{const e=vs(f),{body:l,headers:a}=r;for(let h of e){const m=Pr(h),g=a[m];if(g){const S=Qs(h,s),{streamHasher:d,base64Encoder:k}=s,P=await jm(l,{streamHasher:d,checksumAlgorithmFn:S,base64Encoder:k});if(P===g)break;throw new Error(`Checksum mismatch: expected "${P}" but received "${g}"`+` in response header "${m}".`)}}};var bm={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},xm=(r,s)=>(f,e)=>async(l)=>{if(!L.isInstance(l.request))return f(l);const a=l.input,h=await f(l),m=h.response;let g=void 0;const{requestValidationModeMember:S,responseAlgorithms:d}=s;if(S&&a[S]==="ENABLED"){const{clientName:k,commandName:P}=e;if(k==="S3Client"&&P==="GetObjectCommand"&&vs(d).every((V)=>{const Jr=Pr(V),q=m.headers[Jr];return!q||qm(q)}))return h;const D=Nr(m.body);if(D)g=await r.streamCollector(m.body),m.body=Ne(g);if(await im(h.response,{config:r,responseAlgorithms:d}),D&&g)m.body=Ne(g)}return h};var Js=(r,s)=>({applyToStack:(f)=>{f.add(_m(r,s),Om),f.addRelativeTo(xm(r,s),bm)}});class $e extends Rr.classBuilder().ep({...gr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[dr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Js(f,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Zs(f),Ge(f)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Fa,Ka).ser(xa).de(pa).build(){}class De extends Rr.classBuilder().ep({...gr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[dr(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Js(f,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),Te(f),ur(f),Zs(f)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Xa,Wa).ser(oa).de(ua).build(){}var nm=W(WA(),1);import{Buffer as Me} from"buffer";var om=new Ee;class vr{static folder(r){if(!r||r.includes("null")||r.includes("undefined"))throw new Error("Folder path has to be specified.");return{put:async(s)=>{let f;if(s instanceof Blob)return f=`${ye()}.${s.type.split("/")[1]}`,vr.put({body:s,name:`${r}/${f}`});return vr.put({...s,name:`${r}/${f}`})},fetch:async(s)=>{let f=process.env.BUCKET_NAME,e;if(typeof s==="string")e=s;else f=s.bucket??f,e=s.name;if(!e)throw new Error("Object name has to be specified");return vr.fetch({...s,name:`${r}/${e}`})}}}static async put(r){let s,f,e,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,e=`${ye()}.${r.type.split("/")[1]}`,f=r.type;else s=r.body,e=r.name,f=r.contentType;f=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof Me?s:Me.from(await s.arrayBuffer());return await om.send(new De({Bucket:l,Key:e,Body:a,ContentType:f})),e}static async metadata(r){const s=Me.from(await r.arrayBuffer());try{return await nm.default(s).metadata()}catch{return{}}}static async fetch(r){let s=process.env.BUCKET_NAME,f;if(typeof r==="string")f=r;else s=r.bucket??s,f=r.name;if(!f)throw new Error("Object name has to be specified");const e=await om.send(new $e({Bucket:s,Key:f}));return new Response(e.Body.transformToWebStream(),{headers:{"Content-Type":e.ContentType,"Content-Length":e.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":e.LastModified?.toUTCString()||"",ETag:e.ETag||""}})}static delete(){}}export{vr as Storage};
11
+ ${Cr.toHex(l)}`}getCanonicalPath({path:r}){if(this.uriEscapePath){const s=[];for(let l of r.split("/")){if(l?.length===0)continue;if(l===".")continue;if(l==="..")s.pop();else s.push(l)}const f=`${r?.startsWith("/")?"/":""}${s.join("/")}${s.length>0&&r?.endsWith("/")?"/":""}`;return al.escapeUri(f).replace(/%2F/g,"/")}return r}async getSignature(r,s,f,e){const l=await this.createStringToSign(r,s,e),a=new this.sha256(await f);return a.update(v(l)),Cr.toHex(await a.digest())}getSigningKey(r,s,f,e){return pe(this.sha256,r,f,s,e||this.service)}validateResolvedCredentials(r){if(typeof r!=="object"||typeof r.accessKeyId!=="string"||typeof r.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}}var nr=(r)=>{const s=el(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},ll=(r)=>Object.keys(r).sort().join(";");var hl="Directory",ml="S3Express",gl="sigv4-s3express",pr="X-Amz-S3session-Token",cr=pr.toLowerCase(),Pg="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Ng="s3_disable_express_session_auth",us={environmentVariableSelector:(r)=>p(r,Pg,u.ENV),configFileSelector:(r)=>p(r,Ng,u.CONFIG),default:!1};var wl=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},Al=function(r,s){const f=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),e=r.credentialProvider,l=()=>{return clearTimeout(f),r.credentialProvider=e,Promise.resolve(s)};r.credentialProvider=l};class ur extends ps{async signWithCredentials(r,s,f){const e=wl(s);r.headers[cr]=s.sessionToken;const l=this;return Al(l,e),l.signRequest(r,f??{})}async presignWithCredentials(r,s,f){const e=wl(s);return delete r.headers[cr],r.headers[pr]=s.sessionToken,r.query=r.query??{},r.query[pr]=s.sessionToken,Al(this,e),this.presign(r,f)}}var Sl=(r)=>{return(s,f)=>async(e)=>{if(f.endpointV2){const l=f.endpointV2,a=l.properties?.authSchemes?.[0]?.name===gl;if(l.properties?.backend===ml||l.properties?.bucketType===hl)f.isS3ExpressBucket=!0;if(a){const m=e.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(f.s3ExpressIdentity=g,L.isInstance(e.request)&&g.sessionToken)e.request.headers[cr]=g.sessionToken}}}return s(e)}},Rl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},ts=(r)=>({applyToStack:(s)=>{s.add(Sl(r),Rl)}});var Il=M(rf(),1);var Dg=M($g(),1),El=M(ns(),1);var dl=async(r,s,f,e)=>{const l=await e.signWithCredentials(f,r,{});if(l.headers["X-Amz-Security-Token"]||l.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return l};var Mg=(r)=>(s)=>{throw s},yg=(r,s)=>{};var kl=(r)=>(s,f)=>async(e)=>{if(!L.isInstance(e.request))return s(e);const a=El.getSmithyContext(f).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:h={}},identity:m,signer:g}=a;let S;if(f.s3ExpressIdentity)S=await dl(f.s3ExpressIdentity,h,e.request,await r.signer());else S=await g.sign(e.request,m,h);const d=await s({...e,request:S}).catch((g.errorHandler||Mg)(h));return(g.successHandler||yg)(d.response,h),d},sf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(kl(r),Il.httpSigningMiddlewareOptions)}});var Pl=(r,{session:s})=>{const[f,e]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new lr(async(l)=>f().send(new e({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var Ug={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},Tg=3000,Cg=(r)=>(s,f)=>async(e)=>{const l=await s(e),{response:a}=l;if(!Or.isInstance(a))return l;const{statusCode:h,body:m}=a;if(h<200||h>=300)return l;let g=m,S=m;if(m&&typeof m==="object"&&!(m instanceof Uint8Array))[g,S]=await Nl(m);a.body=S;const d=await cg(g,{streamCollector:async(P)=>{return $l(P,Tg)}});if(typeof g?.destroy==="function")g.destroy();const k=r.utf8Encoder(d.subarray(d.length-16));if(d.length===0&&Ug[f.commandName]){const P=new Error("S3 aborted request");throw P.name="InternalError",P}if(k&&k.endsWith("</Error>"))a.statusCode=400;return l},cg=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},zg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},tr=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Cg(r),zg)}});var ff=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Dl(r){return(s,f)=>async(e)=>{if(r.bucketEndpoint){const l=f.endpointV2;if(l){const a=e.input.Bucket;if(typeof a==="string")try{const h=new URL(a);l.url=h}catch(h){const m=`@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${a} could not be parsed as URL.`;if(f.logger?.constructor?.name==="NoOpLogger")console.warn(m);else f.logger?.warn?.(m);throw h}}}return s(e)}}var Ml={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function Gg({bucketEndpoint:r}){return(s)=>async(f)=>{const{input:{Bucket:e}}=f;if(!r&&typeof e==="string"&&!ff(e)&&e.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${e}'`);throw l.name="InvalidBucketName",l}return s({...f})}}var Hg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},yl=(r)=>({applyToStack:(s)=>{s.add(Gg(r),Hg),s.addRelativeTo(Dl(r),Ml)}});var kr=M(rf(),1);var Ul=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var ws=M(gs(),1);var rs={CrtSignerV4:null};class ef{constructor(r){this.sigv4Signer=new ur(r),this.signerOptions=r}async sign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().sign(r,s)}return this.sigv4Signer.sign(r,s)}async signWithCredentials(r,s,f={}){if(f.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().signWithCredentials(r,s,f)}return this.sigv4Signer.signWithCredentials(r,s,f)}async presign(r,s={}){if(s.signingRegion==="*"){if(this.signerOptions.runtime!=="node")throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");return this.getSigv4aSigner().presign(r,s)}return this.sigv4Signer.presign(r,s)}async presignWithCredentials(r,s,f={}){if(f.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,f)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=rs.CrtSignerV4,typeof r!=="function")throw new Error}catch(s){throw s.message=`${s.message}\n`+'Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt',s}this.sigv4aSigner=new r({...this.signerOptions,signingAlgorithm:1})}return this.sigv4aSigner}}var Hr=M(ns(),1);var hr={["required"]:!1,["type"]:"String"},mr={["required"]:!0,default:!1,["type"]:"Boolean"},zr={["required"]:!1,["type"]:"Boolean"},Y={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},$={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},N={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},C={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},Ia={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Tl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},as={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},X={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},ls={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Ea={["ref"]:"url"},ka={["fn"]:"uriEncode",["argv"]:[X],["assign"]:"uri_encoded_bucket"},q={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},Pa={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[X,!1]},lf={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},hs={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Cl={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},cl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[C]},zl={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Gl={["fn"]:"not",["argv"]:[as]},Hl={["ref"]:"hardwareType"},Kl={["conditions"]:[A],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},ss={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},af={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},Kg={["ref"]:"ForcePathStyle"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},z={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},H={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[z]},K={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},Fl={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},c={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},Ll={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Wl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Xl={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},hf={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ea,"isIp"]},!1]},mf={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:c,["headers"]:{}},zf={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:c,["headers"]:{}},Zl={["endpoint"]:zf,["type"]:"endpoint"},gf={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Ql={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},fs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},V={["ref"]:"bucketArn"},Na={["ref"]:"arnType"},wf={["fn"]:"getAttr",["argv"]:[V,"service"]},Gf={["ref"]:"accessPointName"},Vl={["conditions"]:[N],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},vl={["conditions"]:[Y],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Jl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Af={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},$a={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Da={["fn"]:"getAttr",["argv"]:[V,"accountId"]},Sf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Yl={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},Rf={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},df={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},If={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},Bl={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},Ol={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Gr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},_l={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},ql={["fn"]:"aws.parseArn",["argv"]:[X]},jl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},il={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},bl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},Ef={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},xl={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},ol={["ref"]:"UseObjectLambdaEndpoint"},kf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},nl={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},pl={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},ul={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Pf={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:c,["headers"]:{}},tl={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Nf=[{["ref"]:"Region"}],Fg=[{["ref"]:"Endpoint"}],Lg=[X],$f=[N],es=[Y],t=[C,W],ra=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],sa=[ls],Df=[ka],Mf=[Pa],gr=[$],fa=[{["fn"]:"substring",["argv"]:[X,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[X,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],ea=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:q,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:q,["headers"]:{}},["type"]:"endpoint"}],la=[{["fn"]:"substring",["argv"]:[X,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[X,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],aa=[{["conditions"]:[$],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:hs,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:hs,["headers"]:{}},["type"]:"endpoint"}],Wg=[as],ha=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ma=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Xg=["*"],b=[Ia],ga=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],x=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],yf=[{["fn"]:"stringEquals",["argv"]:[Na,"accesspoint"]}],wa=[{["fn"]:"getAttr",["argv"]:[V,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Gf,""]}]}],Zg=[V,"resourceId[1]"],Uf=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},""]}]}],Aa=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[2]"]}]}]}],Qg=[V,"resourceId[2]"],Tf=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]}],["assign"]:"bucketPartition"}],Sa=[{["fn"]:"stringEquals",["argv"]:[$a,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Cf=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},!0]}],cf=[{["fn"]:"isValidHostLabel",["argv"]:[Da,!1]}],Ra=[{["fn"]:"isValidHostLabel",["argv"]:[Gf,!1]}],da=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],Vg={version:"1.0",parameters:{Bucket:hr,Region:hr,UseFIPS:mr,UseDualStack:mr,Endpoint:hr,ForcePathStyle:mr,Accelerate:mr,UseGlobalEndpoint:mr,UseObjectLambdaEndpoint:zr,Key:hr,Prefix:hr,CopySource:hr,DisableAccessPoints:zr,DisableMultiRegionAccessPoints:mr,UseArnRegion:zr,UseS3ExpressControlEndpoint:zr,DisableS3ExpressSessionAuth:zr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Nf}],rules:[{["conditions"]:[Y,$],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[N,C],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[C,$],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[C,Y],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[$,Ia,Tl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[as,{["fn"]:"substring",["argv"]:[X,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:$f,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:es,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:t,rules:[{["conditions"]:ra,rules:[{["conditions"]:sa,rules:[{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:sa,rules:[{["conditions"]:Df,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:hs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:hs,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:[Cl,cl],rules:[{["conditions"]:[ka,A],rules:[{["conditions"]:gr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:Mf,rules:[{["conditions"]:ra,rules:[{["conditions"]:fa,rules:ea,["type"]:"tree"},{["conditions"]:la,rules:ea,["type"]:"tree"},zl],["type"]:"tree"},{["conditions"]:fa,rules:aa,["type"]:"tree"},{["conditions"]:la,rules:aa,["type"]:"tree"},zl],["type"]:"tree"},lf],["type"]:"tree"},{["conditions"]:[Gl,Cl,cl],rules:[{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:q,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[as,{["fn"]:"substring",["argv"]:[X,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[X,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[X,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[X,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Nf,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:ha,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Hl,"e"]}],rules:[{["conditions"]:ma,rules:[Kl,{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Hl,"o"]}],rules:[{["conditions"]:ma,rules:[Kl,{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:ss,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Unrecognized hardware type: \"Expected hardware type o or e but got {hardwareType}\"",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id must only contain a-z, A-Z, 0-9 and `-`.",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Wg,rules:[{["conditions"]:[C,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Fg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[af,Pa],rules:[{["conditions"]:b,rules:[{["conditions"]:ga,rules:[{["conditions"]:[Y,Tl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[N,$,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,$,T,A,E,K],rules:[{endpoint:Fl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,$,T,A,E,F],endpoint:Fl,["type"]:"endpoint"},{["conditions"]:[I,$,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,$,T,A,E,K],rules:[{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,$,T,A,E,F],endpoint:Ll,["type"]:"endpoint"},{["conditions"]:[N,R,Y,A,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,Y,A,E,K],rules:[{endpoint:Wl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,Y,A,E,F],endpoint:Wl,["type"]:"endpoint"},{["conditions"]:[N,R,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,T,A,E,K],rules:[{endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,T,A,E,F],endpoint:Xl,["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,ls,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,hf,z],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,ls,E,K],rules:[{["conditions"]:x,endpoint:mf,["type"]:"endpoint"},{endpoint:mf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,T,C,W,hf,E,K],rules:[{["conditions"]:x,endpoint:zf,["type"]:"endpoint"},Zl],["type"]:"tree"},{["conditions"]:[I,R,T,C,W,ls,E,F],endpoint:mf,["type"]:"endpoint"},{["conditions"]:[I,R,T,C,W,hf,E,F],endpoint:zf,["type"]:"endpoint"},{["conditions"]:[I,R,Y,A,z],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,Y,A,E,K],rules:[{["conditions"]:x,endpoint:gf,["type"]:"endpoint"},{endpoint:gf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,Y,A,E,F],endpoint:gf,["type"]:"endpoint"},{["conditions"]:[I,R,T,A,z],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,T,A,E,K],rules:[{["conditions"]:x,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:Ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,T,A,E,F],endpoint:Ql,["type"]:"endpoint"}],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[C,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ea,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[X,!0]},af,R,I,T],rules:[{["conditions"]:b,rules:[{["conditions"]:ga,rules:[Zl],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[af,{["fn"]:"aws.parseArn",["argv"]:Lg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Na,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3-object-lambda"]}],rules:[{["conditions"]:yf,rules:[{["conditions"]:wa,rules:[Vl,vl,{["conditions"]:Uf,rules:[Jl,{["conditions"]:Aa,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:Sa,rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Da,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:cf,rules:[{["conditions"]:Ra,rules:[{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Sf,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Yl],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Bl],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Ol],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:yf,rules:[{["conditions"]:wa,rules:[{["conditions"]:Uf,rules:[{["conditions"]:yf,rules:[{["conditions"]:Uf,rules:[Jl,{["conditions"]:Aa,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[$a,"{partitionResult#name}"]}],rules:[{["conditions"]:Cf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3"]}],rules:[{["conditions"]:cf,rules:[{["conditions"]:Ra,rules:[{["conditions"]:es,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[$,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,C,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Gr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Yl],["type"]:"tree"},Rf],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Bl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Gf,!0]}],rules:[{["conditions"]:$f,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:es,error:"S3 MRAP does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableMultiRegionAccessPoints"},!0]}],error:"Invalid configuration: Multi-Region Access Point ARNs are disabled.",["type"]:"error"},{["conditions"]:[{["fn"]:"aws.partition",["argv"]:Nf,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[V,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Xg}]},["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Client was configured for partition `{mrapPartition#name}` but bucket referred to partition `{bucketArn#partition}`",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Access Point Name",["type"]:"error"}],["type"]:"tree"},Ol],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[wf,"s3-outposts"]}],rules:[{["conditions"]:$f,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:es,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Zg,["assign"]:"outpostId"}],rules:[{["conditions"]:ha,rules:[Af,{["conditions"]:Tf,rules:[{["conditions"]:b,rules:[{["conditions"]:Sa,rules:[{["conditions"]:Cf,rules:[{["conditions"]:cf,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Qg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:t,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:_l,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:_l,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{error:"Expected an outpost type `accesspoint`, found {outpostType}",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: expected an access point name",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Expected a 4-component resource",["type"]:"error"}],["type"]:"tree"},Rf],["type"]:"tree"},df],["type"]:"tree"},If],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid ARN: The outpost Id may only contain a-z, A-Z, 0-9 and `-`. Found: `{outpostId}`",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: The Outpost Id was not set",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: Unrecognized format: {Bucket} (type: {arnType})",["type"]:"error"}],["type"]:"tree"},{error:"Invalid ARN: No ARN type specified",["type"]:"error"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"substring",["argv"]:[X,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[ql]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[Kg,!0]},ql],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:Df,rules:[{["conditions"]:b,rules:[{["conditions"]:[T],rules:[{["conditions"]:[N,A,$,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,$,E,K],rules:[{endpoint:jl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,$,E,F],endpoint:jl,["type"]:"endpoint"},{["conditions"]:[I,A,$,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,$,E,K],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,$,E,F],endpoint:il,["type"]:"endpoint"},{["conditions"]:[N,A,R,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,R,E,K],rules:[{endpoint:bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,R,E,F],endpoint:bl,["type"]:"endpoint"},{["conditions"]:[I,C,W,R,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,C,W,R,E,K],rules:[{["conditions"]:x,endpoint:Ef,["type"]:"endpoint"},{endpoint:Ef,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,C,W,R,E,F],endpoint:Ef,["type"]:"endpoint"},{["conditions"]:[I,A,R,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,R,E,K],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,R,E,F],endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{error:"Path-style addressing cannot be used with S3 Accelerate",["type"]:"error"}],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[ol]},{["fn"]:"booleanEquals",["argv"]:[ol,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:da,rules:[Vl,vl,{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:kf,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Gl],rules:[{["conditions"]:b,rules:[{["conditions"]:da,rules:[{["conditions"]:[$,N,A,z],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,N,A,E,K],rules:[{endpoint:nl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,N,A,E,F],endpoint:nl,["type"]:"endpoint"},{["conditions"]:[$,I,A,z],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[$,I,A,E,K],rules:[{endpoint:pl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[$,I,A,E,F],endpoint:pl,["type"]:"endpoint"},{["conditions"]:[R,N,A,z],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N,A,E,K],rules:[{endpoint:ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,N,A,E,F],endpoint:ul,["type"]:"endpoint"},{["conditions"]:[R,I,C,W,z],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,C,W,E,K],rules:[{["conditions"]:x,endpoint:Pf,["type"]:"endpoint"},{endpoint:Pf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,C,W,E,F],endpoint:Pf,["type"]:"endpoint"},{["conditions"]:[R,I,A,z],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:H,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,A,E,K],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:tl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,A,E,F],endpoint:tl,["type"]:"endpoint"}],["type"]:"tree"},fs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Ma=Vg;var ms=(r,s={})=>{return Ua(Ma,{endpointParams:r,logger:s.logger})};ya.aws=Ta;var za=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},Ga=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,f)=>({signingProperties:{config:s,context:f}})}},vg=(r)=>async(s,f,e)=>{if(!e)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,f,e),a=Hr.getSmithyContext(f)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${f.commandName}\``);const h=await Ca(e,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Jg=async(r,s,f)=>{return{operation:Hr.getSmithyContext(s).operation,region:await Hr.normalizeProvider(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ca=vg(Jg),Yg=(r,s,f)=>{return(l)=>{const h=r(l).properties?.authSchemes;if(!h)return s(l);const m=[];for(let g of h){const{name:S,properties:d={},...k}=g,P=S.toLowerCase();if(S!==P)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${S}\` to \`${P}\``);let U;if(P==="sigv4a"){U="aws.auth#sigv4a";const Yr=h.find((_)=>{const $r=_.name.toLowerCase();return $r!=="sigv4a"&&$r.startsWith("sigv4")});if(!rs.CrtSignerV4&&Yr)continue}else if(P.startsWith("sigv4"))U="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${P}\``);const D=f[U];if(!D)throw new Error(`Could not find HttpAuthOption create function for \`${U}\``);const Q=D(l);Q.schemeId=U,Q.signingProperties={...Q.signingProperties||{},...k,...d},m.push(Q)}return m}},Bg=(r)=>{const s=[];switch(r.operation){default:s.push(za(r)),s.push(Ga(r))}return s},Ha=Yg(ms,Bg,{"aws.auth#sigv4":za,"aws.auth#sigv4a":Ga}),Ka=(r)=>{const s=ws.resolveAwsSdkSigV4Config(r);return{...ws.resolveAwsSdkSigV4AConfig(s)}};var Zh=M(he(),1);var Fa=(r)=>{return{...r,useFipsEndpoint:r.useFipsEndpoint??!1,useDualstackEndpoint:r.useDualstackEndpoint??!1,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,useGlobalEndpoint:r.useGlobalEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,defaultSigningName:"s3"}},wr={ForcePathStyle:{type:"clientContextParams",name:"forcePathStyle"},UseArnRegion:{type:"clientContextParams",name:"useArnRegion"},DisableMultiRegionAccessPoints:{type:"clientContextParams",name:"disableMultiregionAccessPoints"},Accelerate:{type:"clientContextParams",name:"useAccelerateEndpoint"},DisableS3ExpressSessionAuth:{type:"clientContextParams",name:"disableS3ExpressSessionAuth"},UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};class Z extends La{constructor(r){super(r);Object.setPrototypeOf(this,Z.prototype)}}class As extends Z{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,As.prototype)}}class Ss extends Z{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ss.prototype)}}class Rs extends Z{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,Rs.prototype)}}class ds extends Z{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,ds.prototype)}}class Is extends Z{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Is.prototype)}}var Hf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Hf||(Hf={}));var Kf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return f.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return f.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Kf||(Kf={}));var Ff;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.AccessPointArn!==void 0)return f.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Ff||(Ff={}));var Lf;(function(r){r.visit=(s,f)=>{if(s.Prefix!==void 0)return f.Prefix(s.Prefix);if(s.Tag!==void 0)return f.Tag(s.Tag);if(s.And!==void 0)return f.And(s.And);return f._(s.$unknown[0],s.$unknown[1])}})(Lf||(Lf={}));class Es extends Z{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Es.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class ks extends Z{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,ks.prototype)}}class Ps extends Z{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,Ps.prototype)}}var Og=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:B},...r.SessionToken&&{SessionToken:B}}),Wa=(r)=>({...r,...r.Credentials&&{Credentials:Og(r.Credentials)}});var Xa=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:B}}),Za=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:B}});var Rr=M(gs(),1);var ys=M(rf(),1);class Ns extends Z{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ns.prototype)}}var Qa;(function(r){r.visit=(s,f)=>{if(s.Records!==void 0)return f.Records(s.Records);if(s.Stats!==void 0)return f.Stats(s.Stats);if(s.Progress!==void 0)return f.Progress(s.Progress);if(s.Cont!==void 0)return f.Cont(s.Cont);if(s.End!==void 0)return f.End(s.End);return f._(s.$unknown[0],s.$unknown[1])}})(Qa||(Qa={}));var Va=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:B},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:B}}),va=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:B},...r.SSEKMSKeyId&&{SSEKMSKeyId:B},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:B}});var pa=async(r,s)=>{const f=ys.requestBuilder(r,s),e=G({},j,{[pw]:r[Gw]});f.bp("/"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=G({[bw]:[,""]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var ua=async(r,s)=>{const f=ys.requestBuilder(r,s),e=G({},j,{[Zw]:r[dw],[Qw]:[()=>j(r[Ja]),()=>Kr(r[Ja]).toString()],[Vw]:r[Iw],[vw]:[()=>j(r[Ya]),()=>Kr(r[Ya]).toString()],[Yw]:r[$w],[Cs]:r[Us],[Fh]:r[Ih],[cs]:r[Ts],[Gh]:r[dh],[Th]:r[gh],[nw]:r[lw]});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Xh]:[,"GetObject"],[Bw]:[,r[Dw]],[Ow]:[,r[Mw]],[_w]:[,r[yw]],[qw]:[,r[Uw]],[jw]:[,r[Tw]],[iw]:[()=>r.ResponseExpires!==void 0,()=>Kr(r[Cw]).toString()],[xw]:[,r[tf]],[Jw]:[()=>r.PartNumber!==void 0,()=>r[Nw].toString()]});let a;return f.m("GET").h(e).q(l).b(a),f.build()};var ta=async(r,s)=>{const f=ys.requestBuilder(r,s),e=G({},j,{[Mh]:r[mh]||"application/octet-stream",[ow]:r[sw],[Ph]:r[eh],[Nh]:r[lh],[$h]:r[ah],[Dh]:r[hh],[Bf]:[()=>j(r[vf]),()=>r[vf].toString()],[Lw]:r[aw],[lA]:r[ew],[re]:r[bf],[se]:r[xf],[fe]:r[of],[ee]:r[nf],[Of]:[()=>j(r[Jf]),()=>Kr(r[Jf]).toString()],[uw]:r[ww],[tw]:r[Aw],[rA]:r[Sw],[sA]:r[Rw],[le]:r[pf],[Hh]:r[Lr],[Wh]:r[kh],[Cs]:r[Us],[Fh]:r[Ih],[cs]:r[Ts],[ae]:r[uf],[Kh]:r[Eh],[Wr]:[()=>j(r[Ms]),()=>r[Ms].toString()],[Gh]:r[dh],[aA]:r[Hw],[ch]:r[Sh],[_f]:[()=>j(r[Yf]),()=>na(r[Yf]).toString()],[Ch]:r[Ah],[Th]:r[gh],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});f.bp("/{Key+}"),f.p("Bucket",()=>r.Bucket,"{Bucket}",!1),f.p("Key",()=>r.Key,"{Key+}",!0);const l=G({[Xh]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return f.m("PUT").h(e).q(l).b(a),f.build()};var rh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=G({$metadata:J(r)}),e=Ar(ba(await Rr.parseXmlBody(r.body,s)),"body");if(e[Zf]!=null)f[Zf]=rw(e[Zf],s);return f};var sh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=G({$metadata:J(r),[mw]:[()=>r.headers[Oa]!==void 0,()=>Ds(r.headers[Oa])],[fw]:[,r.headers[Fw]],[Fr]:[,r.headers[Uh]],[zw]:[,r.headers[fA]],[Ew]:[()=>r.headers[Ba]!==void 0,()=>Ar(Dr(r.headers[Ba]))],[vf]:[()=>r.headers[Bf]!==void 0,()=>xa(r.headers[Bf])],[wh]:[,r.headers[yh]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[kw]:[()=>r.headers[_a]!==void 0,()=>$s(r.headers[_a])],[tf]:[,r.headers[Lh]],[eh]:[,r.headers[Ph]],[lh]:[,r.headers[Nh]],[ah]:[,r.headers[$h]],[hh]:[,r.headers[Dh]],[hw]:[,r.headers[Ww]],[mh]:[,r.headers[Mh]],[Jf]:[()=>r.headers[Of]!==void 0,()=>Ar(Dr(r.headers[Of]))],[gw]:[,r.headers[Xw]],[kh]:[,r.headers[Wh]],[pf]:[,r.headers[le]],[Us]:[,r.headers[Cs]],[Ts]:[,r.headers[cs]],[uf]:[,r.headers[ae]],[Ms]:[()=>r.headers[Wr]!==void 0,()=>Ds(r.headers[Wr])],[Lr]:[,r.headers[Hh]],[Rh]:[,r.headers[zh]],[cw]:[,r.headers[eA]],[Pw]:[()=>r.headers[qa]!==void 0,()=>$s(r.headers[qa])],[Kw]:[()=>r.headers[ja]!==void 0,()=>$s(r.headers[ja])],[Sh]:[,r.headers[ch]],[Yf]:[()=>r.headers[_f]!==void 0,()=>Ar(qf(r.headers[_f]))],[Ah]:[,r.headers[Ch]],Metadata:[,Object.keys(r.headers).filter((l)=>l.startsWith("x-amz-meta-")).reduce((l,a)=>{return l[a.substring(11)]=r.headers[a],l},{})]}),e=r.body;return s.sdkStreamMixin(e),f.Body=e,f};var fh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return jf(r,s);const f=G({$metadata:J(r),[Fr]:[,r.headers[Uh]],[wh]:[,r.headers[yh]],[bf]:[,r.headers[re]],[xf]:[,r.headers[se]],[of]:[,r.headers[fe]],[nf]:[,r.headers[ee]],[pf]:[,r.headers[le]],[tf]:[,r.headers[Lh]],[Us]:[,r.headers[Cs]],[Ts]:[,r.headers[cs]],[uf]:[,r.headers[ae]],[Eh]:[,r.headers[Kh]],[Ms]:[()=>r.headers[Wr]!==void 0,()=>Ds(r.headers[Wr])],[Rh]:[,r.headers[zh]]});return await ia(r.body,s),f};var jf=async(r,s)=>{const f={...r,body:await Rr.parseXmlErrorBody(r.body,s)},e=Rr.loadRestXmlErrorCode(r,f.body);switch(e){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await ng(f,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await tg(f,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await jg(f,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await ig(f,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await xg(f,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await bg(f,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await og(f,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await pg(f,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await ug(f,s);default:const l=f.body;return qg({output:r,parsedBody:l,errorCode:e})}},qg=oa(Z),jg=async(r,s)=>{const f=G({}),e=r.body,l=new Rs({$metadata:J(r),...f});return O(l,r.body)},ig=async(r,s)=>{const f=G({}),e=r.body,l=new ds({$metadata:J(r),...f});return O(l,r.body)},bg=async(r,s)=>{const f=G({}),e=r.body;if(e[Xf]!=null)f[Xf]=Sr(e[Xf]);if(e[Lr]!=null)f[Lr]=Sr(e[Lr]);const l=new Es({$metadata:J(r),...f});return O(l,r.body)},xg=async(r,s)=>{const f=G({}),e=r.body,l=new Is({$metadata:J(r),...f});return O(l,r.body)},og=async(r,s)=>{const f=G({}),e=r.body,l=new ks({$metadata:J(r),...f});return O(l,r.body)},ng=async(r,s)=>{const f=G({}),e=r.body,l=new As({$metadata:J(r),...f});return O(l,r.body)},pg=async(r,s)=>{const f=G({}),e=r.body,l=new Ps({$metadata:J(r),...f});return O(l,r.body)},ug=async(r,s)=>{const f=G({}),e=r.body,l=new Ns({$metadata:J(r),...f});return O(l,r.body)},tg=async(r,s)=>{const f=G({}),e=r.body,l=new Ss({$metadata:J(r),...f});return O(l,r.body)};var rw=(r,s)=>{const f={};if(r[Wf]!=null)f[Wf]=Sr(r[Wf]);if(r[Qf]!=null)f[Qf]=Sr(r[Qf]);if(r[Vf]!=null)f[Vf]=Sr(r[Vf]);if(r[Fr]!=null)f[Fr]=Ar(qf(r[Fr]));return f};var J=(r)=>({httpStatusCode:r.statusCode,requestId:r.headers["x-amzn-requestid"]??r.headers["x-amzn-request-id"]??r.headers["x-amz-request-id"],extendedRequestId:r.headers["x-amz-id-2"],cfId:r.headers["x-amz-cf-id"]});var j=(r)=>r!==void 0&&r!==null&&r!==""&&(!Object.getOwnPropertyNames(r).includes("length")||r.length!=0)&&(!Object.getOwnPropertyNames(r).includes("size")||r.size!=0);var sw="ACL";var Wf="AccessKeyId";var fw="AcceptRanges";var Xf="AccessTier";var Ms="BucketKeyEnabled";var Zf="Credentials",ew="ChecksumAlgorithm";var eh="CacheControl",bf="ChecksumCRC32",xf="ChecksumCRC32C",lh="ContentDisposition";var ah="ContentEncoding";var hh="ContentLanguage",vf="ContentLength",lw="ChecksumMode",aw="ContentMD5";var hw="ContentRange";var of="ChecksumSHA1",nf="ChecksumSHA256";var mh="ContentType";var mw="DeleteMarker";var Jf="Expires";var gh="ExpectedBucketOwner";var gw="ExpiresString";var wh="ETag";var Fr="Expiration";var ww="GrantFullControl";var Aw="GrantRead",Sw="GrantReadACP";var Rw="GrantWriteACP";var dw="IfMatch",Ja="IfModifiedSince",Iw="IfNoneMatch";var Ya="IfUnmodifiedSince";var Ew="LastModified";var kw="MissingMeta";var Ah="ObjectLockLegalHoldStatus",Sh="ObjectLockMode";var Yf="ObjectLockRetainUntilDate";var Pw="PartsCount";var Nw="PartNumber";var $w="Range";var Rh="RequestCharged",Dw="ResponseCacheControl",Mw="ResponseContentDisposition",yw="ResponseContentEncoding",Uw="ResponseContentLanguage",Tw="ResponseContentType";var Cw="ResponseExpires";var dh="RequestPayer";var cw="ReplicationStatus";var zw="Restore";var Qf="SecretAccessKey";var Lr="StorageClass";var Gw="SessionMode";var pf="ServerSideEncryption";var Us="SSECustomerAlgorithm",Ih="SSECustomerKey",Ts="SSECustomerKeyMD5";var Eh="SSEKMSEncryptionContext",uf="SSEKMSKeyId";var Vf="SessionToken";var Hw="Tagging";var Kw="TagCount";var tf="VersionId";var kh="WebsiteRedirectLocation";var Fw="accept-ranges";var Ph="cache-control",Nh="content-disposition",$h="content-encoding",Dh="content-language",Bf="content-length",Lw="content-md5",Ww="content-range",Mh="content-type";var Of="expires";var yh="etag",Xw="expiresstring";var Zw="if-match",Qw="if-modified-since";var Vw="if-none-match";var vw="if-unmodified-since";var Ba="last-modified";var Jw="partNumber";var Yw="range",Bw="response-cache-control",Ow="response-content-disposition",_w="response-content-encoding",qw="response-content-language",jw="response-content-type",iw="response-expires";var bw="session";var xw="versionId";var ow="x-amz-acl";var re="x-amz-checksum-crc32",se="x-amz-checksum-crc32c",nw="x-amz-checksum-mode";var fe="x-amz-checksum-sha1",ee="x-amz-checksum-sha256";var pw="x-amz-create-session-mode";var Oa="x-amz-delete-marker",Uh="x-amz-expiration",Th="x-amz-expected-bucket-owner";var uw="x-amz-grant-full-control",tw="x-amz-grant-read",rA="x-amz-grant-read-acp";var sA="x-amz-grant-write-acp";var _a="x-amz-missing-meta";var qa="x-amz-mp-parts-count";var Ch="x-amz-object-lock-legal-hold",ch="x-amz-object-lock-mode",_f="x-amz-object-lock-retain-until-date";var fA="x-amz-restore",zh="x-amz-request-charged";var Gh="x-amz-request-payer";var eA="x-amz-replication-status";var Hh="x-amz-storage-class",lA="x-amz-sdk-checksum-algorithm";var le="x-amz-server-side-encryption",ae="x-amz-server-side-encryption-aws-kms-key-id",Wr="x-amz-server-side-encryption-bucket-key-enabled",Kh="x-amz-server-side-encryption-context",Cs="x-amz-server-side-encryption-customer-algorithm",Fh="x-amz-server-side-encryption-customer-key",cs="x-amz-server-side-encryption-customer-key-md5",aA="x-amz-tagging",ja="x-amz-tagging-count";var Lh="x-amz-version-id",Wh="x-amz-website-redirect-location",Xh="x-id";class me extends dr.classBuilder().ep({...wr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,f,e){return[Zh.getSerdePlugin(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),tr(f)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,Wa).ser(pa).de(rh).build(){}var Qh={name:"@aws-sdk/client-s3",description:"AWS SDK for JavaScript S3 Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-s3","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo s3",test:"yarn test:unit","test:e2e":"yarn test:e2e:node && yarn test:e2e:browser","test:e2e:browser":"ts-mocha test/**/*.browser.ispec.ts && karma start karma.conf.js","test:e2e:node":"jest --c jest.config.e2e.js","test:unit":"ts-mocha test/unit/**/*.spec.ts"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha1-browser":"5.2.0","@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.629.0","@aws-sdk/client-sts":"3.629.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-bucket-endpoint":"3.620.0","@aws-sdk/middleware-expect-continue":"3.620.0","@aws-sdk/middleware-flexible-checksums":"3.620.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-location-constraint":"3.609.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-sdk-s3":"3.629.0","@aws-sdk/middleware-ssec":"3.609.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/signature-v4-multi-region":"3.629.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@aws-sdk/xml-builder":"3.609.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-blob-browser":"^3.1.2","@smithy/hash-node":"^3.0.3","@smithy/hash-stream-node":"^3.1.2","@smithy/invalid-dependency":"^3.0.3","@smithy/md5-js":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0","@smithy/util-waiter":"^3.1.2",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/signature-v4-crt":"3.629.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-s3",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-s3"}};var Xs=M(gs(),1);var mA="AWS_S3_USE_ARN_REGION",gA="s3_use_arn_region",Vh={environmentVariableSelector:(r)=>p(r,mA,u.ENV),configFileSelector:(r)=>p(r,gA,u.CONFIG),default:!1};var vh=M(NA(),1),{__extends:Rd,__assign:dd,__rest:Id,__decorate:Ed,__param:kd,__esDecorate:Pd,__runInitializers:Nd,__propKey:$d,__setFunctionName:Dd,__metadata:Md,__awaiter:zs,__generator:Gs,__exportStar:yd,__createBinding:Ud,__values:Hs,__read:Td,__spread:Cd,__spreadArrays:cd,__spreadArray:zd,__await:Gd,__asyncGenerator:Hd,__asyncDelegator:Kd,__asyncValues:Fd,__makeTemplateObject:Ld,__importStar:Wd,__importDefault:Xd,__classPrivateFieldGet:Zd,__classPrivateFieldSet:Qd,__classPrivateFieldIn:Vd,__addDisposableResource:vd,__disposeResources:Jd}=vh.default;import{Buffer as Jh} from"buffer";var Yh=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Jh.from(r,s):Jh.from(r)};var ge=(r)=>{const s=Yh(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Xr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return $A(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var $A=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ge;function Zr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Qr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Vr(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),f=0;while(f<r.length)s[f]=r[f],f+=1;return s}return Uint32Array.from(r)}var we=function(){function r(){this.crc32=new rr}return r.prototype.update=function(s){if(Zr(s))return;this.crc32.update(Xr(s))},r.prototype.digest=function(){return zs(this,void 0,void 0,function(){return Gs(this,function(s){return[2,Qr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new rr},r}();var rr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Hs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^MA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var DA=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],MA=Vr(DA);var o=M(ar(),1);var Oh=M(ar(),1),Bh=function(r){for(let s=0;s<8;s++)r[s]^=255;for(let s=7;s>-1;s--)if(r[s]++,r[s]!==0)break};class Er{constructor(r){if(this.bytes=r,r.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(r){if(r>9223372036854776000||r<-9223372036854776000)throw new Error(`${r} is too large (or, if negative, too small) to represent as an Int64`);const s=new Uint8Array(8);for(let f=7,e=Math.abs(Math.round(r));f>-1&&e>0;f--,e/=256)s[f]=e;if(r<0)Bh(s);return new Er(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Bh(r);return parseInt(Oh.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Ae{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let l of Object.keys(r)){const a=this.fromUtf8(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const f=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let e=0;for(let l of s)f.set(l,e),e+=l.byteLength;return f}formatHeaderValue(r){switch(r.type){case"boolean":return Uint8Array.from([r.value?0:1]);case"byte":return Uint8Array.from([2,r.value]);case"short":const s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,r.value,!1),new Uint8Array(s.buffer);case"integer":const f=new DataView(new ArrayBuffer(5));return f.setUint8(0,4),f.setInt32(1,r.value,!1),new Uint8Array(f.buffer);case"long":const e=new Uint8Array(9);return e[0]=5,e.set(r.value.bytes,1),e;case"binary":const l=new DataView(new ArrayBuffer(3+r.value.byteLength));l.setUint8(0,6),l.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(l.buffer);return a.set(r.value,3),a;case"string":const h=this.fromUtf8(r.value),m=new DataView(new ArrayBuffer(3+h.byteLength));m.setUint8(0,7),m.setUint16(1,h.byteLength,!1);const g=new Uint8Array(m.buffer);return g.set(h,3),g;case"timestamp":const S=new Uint8Array(9);return S[0]=8,S.set(Er.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!KA.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(o.fromHex(r.value.replace(/\-/g,"")),1),d}}parse(r){const s={};let f=0;while(f<r.byteLength){const e=r.getUint8(f++),l=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,e));switch(f+=e,r.getUint8(f++)){case 0:s[l]={type:qh,value:!0};break;case 1:s[l]={type:qh,value:!1};break;case 2:s[l]={type:yA,value:r.getInt8(f++)};break;case 3:s[l]={type:UA,value:r.getInt16(f,!1)},f+=2;break;case 4:s[l]={type:TA,value:r.getInt32(f,!1)},f+=4;break;case 5:s[l]={type:CA,value:new Er(new Uint8Array(r.buffer,r.byteOffset+f,8))},f+=8;break;case 6:const a=r.getUint16(f,!1);f+=2,s[l]={type:cA,value:new Uint8Array(r.buffer,r.byteOffset+f,a)},f+=a;break;case 7:const h=r.getUint16(f,!1);f+=2,s[l]={type:zA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+f,h))},f+=h;break;case 8:s[l]={type:GA,value:new Date(new Er(new Uint8Array(r.buffer,r.byteOffset+f,8)).valueOf())},f+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+f,16);f+=16,s[l]={type:HA,value:`${o.toHex(m.subarray(0,4))}-${o.toHex(m.subarray(4,6))}-${o.toHex(m.subarray(6,8))}-${o.toHex(m.subarray(8,10))}-${o.toHex(m.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return s}}var _h;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(_h||(_h={}));var qh="boolean",yA="byte",UA="short",TA="integer",CA="long",cA="binary",zA="string",GA="timestamp",HA="uuid",KA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function ih({byteLength:r,byteOffset:s,buffer:f}){if(r<FA)throw new Error("Provided message too short to accommodate event stream message overhead");const e=new DataView(f,s,r),l=e.getUint32(0,!1);if(r!==l)throw new Error("Reported message length does not match received message length");const a=e.getUint32(jh,!1),h=e.getUint32(n,!1),m=e.getUint32(r-sr,!1),g=new rr().update(new Uint8Array(f,s,n));if(h!==g.digest())throw new Error(`The prelude checksum specified in the message (${h}) does not match the calculated CRC32 checksum (${g.digest()})`);if(g.update(new Uint8Array(f,s+n,r-(n+sr))),m!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${m}`);return{headers:new DataView(f,s+n+sr,a),body:new Uint8Array(f,s+n+sr+a,l-a-(n+sr+sr))}}var jh=4,n=jh*2,sr=4,FA=n+sr*2;class Se{constructor(r,s){this.headerMarshaller=new Ae(r,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(r){this.messageBuffer.push(this.decode(r))}endOfStream(){this.isEndOfStream=!0}getMessage(){const r=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return r},isEndOfStream(){return s}}}getAvailableMessages(){const r=this.messageBuffer;this.messageBuffer=[];const s=this.isEndOfStream;return{getMessages(){return r},isEndOfStream(){return s}}}encode({headers:r,body:s}){const f=this.headerMarshaller.format(r),e=f.byteLength+s.byteLength+16,l=new Uint8Array(e),a=new DataView(l.buffer,l.byteOffset,l.byteLength),h=new rr;return a.setUint32(0,e,!1),a.setUint32(4,f.byteLength,!1),a.setUint32(8,h.update(l.subarray(0,8)).digest(),!1),l.set(f,12),l.set(s,f.byteLength+12),a.setUint32(e-4,h.update(l.subarray(8,e-4)).digest(),!1),l}decode(r){const{headers:s,body:f}=ih(r);return{headers:this.headerMarshaller.parse(s),body:f}}formatHeaders(r){return this.headerMarshaller.format(r)}}class Re{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.decoder.decode(r)}}class de{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream)yield this.options.encoder.encode(r);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Ie{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.messageStream){const s=await this.options.deserializer(r);if(s===void 0)continue;yield s}}}class Ee{constructor(r){this.options=r}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let r of this.options.inputStream)yield this.options.serializer(r)}}function bh(r){let s=0,f=0,e=null,l=null;const a=(m)=>{if(typeof m!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+m);s=m,f=4,e=new Uint8Array(m),new DataView(e.buffer).setUint32(0,m,!1)},h=async function*(){const m=r[Symbol.asyncIterator]();while(!0){const{value:g,done:S}=await m.next();if(S){if(!s)return;else if(s===f)yield e;else throw new Error("Truncated event message received.");return}const d=g.length;let k=0;while(k<d){if(!e){const U=d-k;if(!l)l=new Uint8Array(4);const D=Math.min(4-f,U);if(l.set(g.slice(k,k+D),f),f+=D,k+=D,f<4)break;a(new DataView(l.buffer).getUint32(0,!1)),l=null}const P=Math.min(s-f,d-k);if(e.set(g.slice(k,k+P),f),f+=P,k+=P,s&&s===f)yield e,e=null,s=0,f=0}}};return{[Symbol.asyncIterator]:h}}function xh(r,s){return async function(f){const{value:e}=f.headers[":message-type"];if(e==="error"){const l=new Error(f.headers[":error-message"].value||"UnknownError");throw l.name=f.headers[":error-code"].value,l}else if(e==="exception"){const l=f.headers[":exception-type"].value,a={[l]:f},h=await r(a);if(h.$unknown){const m=new Error(s(f.body));throw m.name=l,m}throw h[l]}else if(e==="event"){const l={[f.headers[":event-type"].value]:f},a=await r(l);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${f.headers[":event-type"].value}`)}}class Ks{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new Se(r,s),this.utfEncoder=r}deserialize(r,s){const f=bh(r);return new Ie({messageStream:new Re({inputStream:f,decoder:this.eventStreamCodec}),deserializer:xh(s,this.utfEncoder)})}serialize(r,s){return new de({messageStream:new Ee({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as LA} from"stream";async function*oh(r){let s=!1,f=!1;const e=new Array;r.on("error",(l)=>{if(!s)s=!0;if(l)throw l}),r.on("data",(l)=>{e.push(l)}),r.on("end",()=>{s=!0});while(!f){const l=await new Promise((a)=>setTimeout(()=>a(e.shift()),0));if(l)yield l;f=s&&e.length===0}}class ke{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ks({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const f=typeof r[Symbol.asyncIterator]==="function"?r:oh(r);return this.universalMarshaller.deserialize(f,s)}serialize(r,s){return LA.from(this.universalMarshaller.serialize(r,s))}}var nh=(r)=>new ke(r);import{Writable as WA} from"stream";class Fs extends WA{constructor(r,s){super(s);this.hash=r}_write(r,s,f){try{this.hash.update(v(r))}catch(e){return f(e)}f()}}var ph=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const f=new r,e=new Fs(f);return s.pipe(e),new Promise((l,a)=>{s.on("error",(h)=>{e.end(),a(h)}),e.on("error",a),e.on("finish",()=>{f.digest().then(l).catch(a)})})};var Ls=M(gs(),1);var lm=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??uh,base64Encoder:r?.base64Encoder??rm,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??ms,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??sm,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Ha,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Ls.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Ls.AwsSdkSigV4ASigner}],logger:r?.logger??new Br,sdkStreamMixin:r?.sdkStreamMixin??fm,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??ef,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??em,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Tr,utf8Encoder:r?.utf8Encoder??th}};var Dm=(r)=>{gm(process.version);const s=Nm(r),f=()=>s().then(mm),e=lm(r);return Xs.emitWarningIfUnsupportedVersion(process.version),{...e,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Pm,credentialDefaultProvider:r?.credentialDefaultProvider??$m,defaultUserAgentProvider:r?.defaultUserAgentProvider??km({serviceId:e.serviceId,clientVersion:Qh.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??i(us),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??nh,maxAttempts:r?.maxAttempts??i(Im),md5:r?.md5??Ws.bind(null,"md5"),region:r?.region??i(Sm,Rm),requestHandler:am.create(r?.requestHandler??f),retryMode:r?.retryMode??i({...Em,default:async()=>(await f()).retryMode||dm}),sha1:r?.sha1??Ws.bind(null,"sha1"),sha256:r?.sha256??Ws.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??i(Xs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??hm,streamHasher:r?.streamHasher??ph,useArnRegion:r?.useArnRegion??i(Vh),useDualstackEndpoint:r?.useDualstackEndpoint??i(wm),useFipsEndpoint:r?.useFipsEndpoint??i(Am)}};var Mm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:f,credentials:e}=r;return{setHttpAuthScheme(l){const a=s.findIndex((h)=>h.schemeId===l.schemeId);if(a===-1)s.push(l);else s.splice(a,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){f=l},httpAuthSchemeProvider(){return f},setCredentials(l){e=l},credentials(){return e}}},ym=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Zs=(r)=>r,Hm=(r,s)=>{const f={...Zs(zm(r)),...Zs(Cm(r)),...Zs(Um(r)),...Zs(Mm(r))};return s.forEach((e)=>e.configure(f)),{...r,...Gm(f),...cm(f),...Tm(f),...ym(f)}};class Pe extends Xm{constructor(...[r]){const s=Dm(r||{}),f=Fa(s),e=Zm(f),l=Ym(e),a=Vm(l),h=Km(a),m=Jm(h),g=Ul(m),S=Ka(g),d=Pl(S,{session:[()=>this,me]}),k=Hm(d,r?.extensions||[]);super(k);this.config=k,this.middlewareStack.use(Qm(this.config)),this.middlewareStack.use(Bm(this.config)),this.middlewareStack.use(vm(this.config)),this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Lm(this.config)),this.middlewareStack.use(Wm(this.config)),this.middlewareStack.use(kr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ca,identityProviderConfigProvider:async(P)=>new kr.DefaultIdentityProviderConfig({"aws.auth#sigv4":P.credentials,"aws.auth#sigv4a":P.credentials})})),this.middlewareStack.use(kr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(yl(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(ts(this.config)),this.middlewareStack.use(sf(this.config))}destroy(){super.destroy()}}function XA(r){return(s)=>async(f)=>{const e={...f.input},l=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of l){const h=e[a.target];if(h){let m;if(typeof h==="string")if(QA(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),e[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),e[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),e[a.hash]=r.base64Encoder(await g.digest())}}return s({...f,input:e})}}function QA(r,s){if(!/^(?:[A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(r))return!1;try{return s.base64Decoder(r).length===32}catch{return!1}}var ZA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Qs=(r)=>({applyToStack:(s)=>{s.add(XA(r),ZA)}});var y;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(y||(y={}));var Om;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Om||(Om={}));var{MD5:_m,CRC32:qm}=y;var vr=[y.CRC32,y.CRC32C,y.SHA1,y.SHA256],jm=[y.CRC32,y.CRC32C,y.SHA1,y.SHA256];var im=(r,{requestChecksumRequired:s,requestAlgorithmMember:f},e)=>{const l=e?qm:_m;if(!f||!r[f])return s?l:void 0;const a=r[f];if(!vr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${vr}.`);return a};var Pr=(r)=>r===y.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var bm=(r,s)=>{const f=r.toLowerCase();for(let e of Object.keys(s))if(f===e.toLowerCase())return!0;return!1};var Nr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!br(r);var $e=function(){function r(){this.crc32c=new Ne}return r.prototype.update=function(s){if(Zr(s))return;this.crc32c.update(Xr(s))},r.prototype.digest=function(){return zs(this,void 0,void 0,function(){return Gs(this,function(s){return[2,Qr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new Ne},r}();var Ne=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var f,e;try{for(var l=Hs(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^vA[(this.checksum^h)&255]}}catch(m){f={error:m}}finally{try{if(a&&!a.done&&(e=l.return))e.call(l)}finally{if(f)throw f.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var VA=[0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697],vA=Vr(VA);var Vs=(r,s)=>({[y.MD5]:s.md5,[y.CRC32]:we,[y.CRC32C]:$e,[y.SHA1]:s.sha1,[y.SHA256]:s.sha256})[r];var vs=(r,s)=>{const f=new r;return f.update(v(s||"")),f.digest()};var xm={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},om=(r,s)=>(f,e)=>async(l)=>{if(!L.isInstance(l.request))return f(l);const{request:a}=l,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:S}=r,{input:d,requestChecksumRequired:k,requestAlgorithmMember:P}=s,U=im(d,{requestChecksumRequired:k,requestAlgorithmMember:P},!!e.isS3ExpressBucket);let D=h,Q=m;if(U){const _=Pr(U),$r=Vs(U,r);if(Nr(h)){const{getAwsChunkedEncodingStream:Bs,bodyLengthChecker:ag}=r;D=Bs(h,{base64Encoder:g,bodyLengthChecker:ag,checksumLocationName:_,checksumAlgorithmFn:$r,streamHasher:S}),Q={...m,"content-encoding":m["content-encoding"]?`${m["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":m["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":_},delete Q["content-length"]}else if(!bm(_,m)){const Bs=await vs($r,h);Q={...m,[_]:g(Bs)}}}return await f({...l,request:{...a,headers:Q,body:D}})};var Js=(r=[])=>{const s=[];for(let f of jm){if(!r.includes(f)||!vr.includes(f))continue;s.push(f)}return s};var nm=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const f=r.slice(s+1);if(!f.startsWith("0")){const e=parseInt(f,10);if(!isNaN(e)&&e>=1&&e<=1e4)return!0}}return!1};import{Transform as JA} from"stream";function De(r){const s=new JA;return s.push(r),s.push(null),s}var pm=async(r,{streamHasher:s,checksumAlgorithmFn:f,base64Encoder:e})=>{const l=Nr(r)?s(f,r):vs(f,r);return e(await l)};var um=async(r,{config:s,responseAlgorithms:f})=>{const e=Js(f),{body:l,headers:a}=r;for(let h of e){const m=Pr(h),g=a[m];if(g){const S=Vs(h,s),{streamHasher:d,base64Encoder:k}=s,P=await pm(l,{streamHasher:d,checksumAlgorithmFn:S,base64Encoder:k});if(P===g)break;throw new Error(`Checksum mismatch: expected "${P}" but received "${g}"`+` in response header "${m}".`)}}};var tm={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},rg=(r,s)=>(f,e)=>async(l)=>{if(!L.isInstance(l.request))return f(l);const a=l.input,h=await f(l),m=h.response;let g=void 0;const{requestValidationModeMember:S,responseAlgorithms:d}=s;if(S&&a[S]==="ENABLED"){const{clientName:k,commandName:P}=e;if(k==="S3Client"&&P==="GetObjectCommand"&&Js(d).every((Q)=>{const Yr=Pr(Q),_=m.headers[Yr];return!_||nm(_)}))return h;const D=Nr(m.body);if(D)g=await r.streamCollector(m.body),m.body=De(g);if(await um(h.response,{config:r,responseAlgorithms:d}),D&&g)m.body=De(g)}return h};var Ys=(r,s)=>({applyToStack:(f)=>{f.add(om(r,s),xm),f.addRelativeTo(rg(r,s),tm)}});var sg=M(he(),1);class Me extends dr.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[sg.getSerdePlugin(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Ys(f,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Qs(f),Ke(f)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(Za,Xa).ser(ua).de(sh).build(){}var fg=M(he(),1);class ye extends dr.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,f,e){return[fg.getSerdePlugin(f,this.serialize,this.deserialize),Ir(f,r.getEndpointParameterInstructions()),Ys(f,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),ce(f),tr(f),Qs(f)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(va,Va).ser(ta).de(fh).build(){}var lg=M(YA(),1);import{Buffer as Ue} from"buffer";var eg=new Pe;class Jr{static folder(r){if(!r||r.includes("null")||r.includes("undefined"))throw new Error("Folder path has to be specified.");return{put:async(s)=>{let f;if(s instanceof Blob)return f=`${Te()}.${s.type.split("/")[1]}`,Jr.put({body:s,name:`${r}/${f}`});return Jr.put({...s,name:`${r}/${f}`})},fetch:async(s)=>{let f=process.env.BUCKET_NAME,e;if(typeof s==="string")e=s;else f=s.bucket??f,e=s.name;if(!e)throw new Error("Object name has to be specified");return Jr.fetch({...s,name:`${r}/${e}`})}}}static async put(r){let s,f,e,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,e=`${Te()}.${r.type.split("/")[1]}`,f=r.type;else s=r.body,e=r.name,f=r.contentType;f=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof Ue?s:Ue.from(await s.arrayBuffer());return await eg.send(new ye({Bucket:l,Key:e,Body:a,ContentType:f})),e}static async metadata(r){const s=Ue.from(await r.arrayBuffer());try{return await lg.default(s).metadata()}catch{return{}}}static async fetch(r){let s=process.env.BUCKET_NAME,f;if(typeof r==="string")f=r;else s=r.bucket??s,f=r.name;if(!f)throw new Error("Object name has to be specified");const e=await eg.send(new Me({Bucket:s,Key:f}));return new Response(e.Body.transformToWebStream(),{headers:{"Content-Type":e.ContentType,"Content-Length":e.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":e.LastModified?.toUTCString()||"",ETag:e.ETag||""}})}static delete(){}}export{Jr as Storage};