gemi 0.4.77 → 0.4.79
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.
- package/dist/app/index.js +1 -1
- package/dist/chunk-0f4780d78065ed6f.js +2 -0
- package/dist/chunk-1488c30be491de9b.js +2 -0
- package/dist/chunk-1e96eb132f10e361.js +2 -0
- package/dist/{chunk-ff29cddef49e00e4.js → chunk-3bb296632dccdb02.js} +1 -1
- package/dist/chunk-3ccfbc315f74b335.js +2 -0
- package/dist/chunk-4573fe60e6dbd787.js +2 -0
- package/dist/chunk-4e41bf12b68e3aa2.js +2 -0
- package/dist/chunk-584b2ebaffb0c907.js +9 -0
- package/dist/chunk-611480789c8b04f4.js +3 -0
- package/dist/chunk-788611478527c8c3.js +6 -0
- package/dist/chunk-7ab2e8abae3c8902.js +2 -0
- package/dist/{chunk-89e90a79da7b7d4f.js → chunk-827fe74e5b55863c.js} +1 -1
- package/dist/chunk-8b1dc3428a74b1f4.js +2 -0
- package/dist/chunk-9b2a6bd400c9c6c7.js +18 -0
- package/dist/chunk-9ca526226958d45c.js +2 -0
- package/dist/chunk-a2795d68352fdd98.js +2 -0
- package/dist/chunk-ae46c8b6092236d2.js +2 -0
- package/dist/chunk-b092d6945f70ff1c.js +2 -0
- package/dist/chunk-bfc01c0e40e4551c.js +2 -0
- package/dist/chunk-e20c0e69128c42f5.js +2 -0
- package/dist/{chunk-20e12a96dfe36b97.js → chunk-e9695f3cdafee20b.js} +1 -1
- package/dist/{chunk-ce4edd37b38f213e.js → chunk-ed4022c20775d58f.js} +1 -1
- package/dist/chunk-f7784dffc6c59a9e.js +2 -0
- package/dist/chunk-fcaf4626e5fe5d26.js +3 -0
- package/dist/client/HttpReload.d.ts.map +1 -1
- package/dist/client/index.js +20 -18
- package/dist/client/useQuery.d.ts.map +1 -1
- package/dist/email/Email.d.ts +12 -5
- package/dist/email/Email.d.ts.map +1 -1
- package/dist/email/index.d.ts +0 -2
- package/dist/email/index.d.ts.map +1 -1
- package/dist/email/index.js +1 -1
- package/dist/facades/Prefetch.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/index.js +1 -1
- package/dist/kernel/Kernel.d.ts +4 -3
- package/dist/kernel/Kernel.d.ts.map +1 -1
- package/dist/kernel/context.d.ts +2 -2
- package/dist/kernel/context.d.ts.map +1 -1
- package/dist/kernel/index.js +1 -2
- package/dist/server/index.js +1 -1
- package/dist/services/ServiceContainer.d.ts +7 -0
- package/dist/services/ServiceContainer.d.ts.map +1 -0
- package/dist/services/email/EmailServiceContainer.d.ts +8 -0
- package/dist/services/email/EmailServiceContainer.d.ts.map +1 -0
- package/dist/services/email/EmailServiceProvider.d.ts +9 -0
- package/dist/services/email/EmailServiceProvider.d.ts.map +1 -0
- package/dist/services/email/drivers/EmailDriver.d.ts +5 -0
- package/dist/services/email/drivers/EmailDriver.d.ts.map +1 -0
- package/dist/services/email/drivers/ResendDriver.d.ts +8 -0
- package/dist/services/email/drivers/ResendDriver.d.ts.map +1 -0
- package/dist/{email → services/email/drivers}/types.d.ts +2 -3
- package/dist/services/email/drivers/types.d.ts.map +1 -0
- package/dist/services/index.d.ts +4 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -10
- package/package.json +2 -1
- package/dist/chunk-0db33ac43bd1d504.js +0 -2
- package/dist/chunk-1188efed5cccf7ee.js +0 -2
- package/dist/chunk-193d58e0d5debcce.js +0 -2
- package/dist/chunk-262b22a97074dc8e.js +0 -2
- package/dist/chunk-33a7a8e8edf3b1f5.js +0 -18
- package/dist/chunk-46c8ce96eb46b34e.js +0 -2
- package/dist/chunk-503c9c540c3e0da0.js +0 -3
- package/dist/chunk-510bdb2fff647a32.js +0 -2
- package/dist/chunk-64e4ceaa55b4483e.js +0 -2
- package/dist/chunk-6cb18981e131ebdb.js +0 -6
- package/dist/chunk-8401f0f53dc26633.js +0 -1
- package/dist/chunk-86828b70027cd6b5.js +0 -2
- package/dist/chunk-895d9b1ef7a65211.js +0 -2
- package/dist/chunk-92acbb11789c8564.js +0 -2
- package/dist/chunk-95e4f6637849e021.js +0 -9
- package/dist/chunk-a3a347630c23269b.js +0 -2
- package/dist/chunk-e2694d95f2b71db0.js +0 -2
- package/dist/email/EmailServiceProvider.d.ts +0 -8
- package/dist/email/EmailServiceProvider.d.ts.map +0 -1
- package/dist/email/EmailTemplate.d.ts +0 -22
- package/dist/email/EmailTemplate.d.ts.map +0 -1
- package/dist/email/providers.d.ts +0 -5
- package/dist/email/providers.d.ts.map +0 -1
- package/dist/email/types.d.ts.map +0 -1
package/dist/services/index.js
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-510bdb2fff647a32.js";import{A as L} from"../chunk-e3d242546d1a2927.js";import{$ as Qm,D as qr,E as Gm,F as Hm,G as Fm,H as Km,I as Fr,J as Gr,K as u,L as t,M as le,N as Wm,O as ya,P as Ma,Q as Ua,R as vm,S as mm,T as gm,U as wm,V as Am,W as Xm,X as Zm,Y as Ta,Z as kr,_ as Pr,aa as Sm,ba as Rm,ca as Vm,da as dm,ea as Jm,fa as Rs,ga as Im,ha as Qs,ia as Em,ja as km,ka as cm,la as Cm} from"../chunk-33a7a8e8edf3b1f5.js";import{$a as am,Aa as th,Ba as p,Ca as fm,Da as lm,Ea as mr,Fa as rm,Ga as Pl,Ha as Nl,Ia as ja,Ja as Er,Ka as Y,Ma as Ts,Pa as Rr,Qa as ia,Ra as dr,Sa as ba,Ta as Us,Ua as Wr,Wa as xe,Xa as Ur,Ya as Ka,Za as O,_a as xa,ab as hm,bb as Um,cb as Tm,eb as z,gb as oa,ma as ym,na as Mm,oa as K,pa as ir,qa as jr,ra as Lm,sa as pr,va as nh,wa as Cr,xa as V,ya as ph,za as uh} from"../chunk-503c9c540c3e0da0.js";import{ib as kg} from"../chunk-ce4edd37b38f213e.js";import{jb as i,kb as sm} from"../chunk-86828b70027cd6b5.js";import"../chunk-8401f0f53dc26633.js";import"../chunk-89e90a79da7b7d4f.js";import{Db as Pm} from"../chunk-95e4f6637849e021.js";import{Eb as EA} from"../chunk-ff29cddef49e00e4.js";class fr{}class _r extends fr{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,e;if(r instanceof Blob)s=r,e=`${qr()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,e=r.name;const f=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),l=`${this.folderPath}/${e}`;return await Bun.write(l,f),e}async fetch(r){let s=process.env.BUCKET_NAME,e;if(typeof r==="string")e=r;else s=r.bucket??s,e=r.name;if(!e)throw new Error("Object name has to be specified");const f=`${this.folderPath}/${e}`,l=Bun.file(f),a=Bun.file(f).stream(),h=new Date(l.lastModified).toUTCString();return new Response(a,{headers:{"Content-Type":l.type,"Content-Length":String(l.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":h}})}}class cf{driver=new _r}function fg(r){return(s)=>async(e)=>{const{request:f}=e;if(K.isInstance(f)&&f.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")f.headers={...f.headers,Expect:"100-continue"}}return s({...e,request:f})}}var lg={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Cf=(r)=>({applyToStack:(s)=>{s.add(fg(r),lg)}});function hg(){return(r,s)=>async(e)=>{const{request:f}=e;if(K.isInstance(f)){if(!(ag in f.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof jr))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({...e})}}var ag="content-length",mg={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},zf=(r)=>({applyToStack:(s)=>{s.add(hg(),mg)}});var Gf=(r)=>{return(s,e)=>async(f)=>{const l=await r.region(),a=r.region;let h=()=>{};if(e.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return e.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(f);if(e.__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}}},Hf={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function gg(r){return(s,e)=>async(f)=>{try{return await s(f)}catch(l){if(r.followRegionRedirects&&l?.$metadata?.httpStatusCode===301){try{const a=l.$response.headers["x-amz-bucket-region"];e.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),e.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(f)}else throw l}}}var wg={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Ff=(r)=>({applyToStack:(s)=>{s.add(gg(r),wg),s.addRelativeTo(Gf(r),Hf)}});var Ag=(r)=>{return(s,e)=>async(f)=>{const l=await s(f),{response:a}=l;if(ir.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Ur(a.headers.expires)}catch(h){e.logger?.warn(`AWS SDK Warning for ${e.clientName}::${e.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return l}},Sg={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},Kf=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Ag(r),Sg)}});class lr{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+lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const e=this.data[s];if(!e.isRefreshing){const f=await e.identity;if(f.expiration){if(f.expiration.getTime()<r)delete this.data[s]}}}}}lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class ar{constructor(r,s=!1,e=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=e}get identity(){return this.accessed=Date.now(),this._identity}}class hr{constructor(r,s=new lr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const e=s.Bucket,{cache:f}=this,l=f.get(e);if(l)return l.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return f.set(e,new ar(this.getIdentity(e))).identity;if((a.expiration?.getTime()??0)<Date.now()+hr.REFRESH_WINDOW_MS&&!l.isRefreshing)l.isRefreshing=!0,this.getIdentity(e).then((g)=>{f.set(e,new ar(Promise.resolve(g)))});return a});return f.set(e,new ar(this.getIdentity(e))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((f)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+f)});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}}}hr.REFRESH_WINDOW_MS=60000;var zr=L(mr(),1);var Lf="X-Amz-Algorithm",Wf="X-Amz-Credential",vf="X-Amz-Date",Xf="X-Amz-SignedHeaders",Zf="X-Amz-Expires",Qf="X-Amz-Signature",Vf="X-Amz-Security-Token";var Jf="authorization",xs="X-Amz-Date".toLowerCase();var Bf=["authorization",xs,"date"],Yf="X-Amz-Signature".toLowerCase(),Tr="x-amz-content-sha256",Of="X-Amz-Security-Token".toLowerCase();var qf={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},_f=/^proxy-/,jf=/^sec-/;var br="AWS4-HMAC-SHA256";var bf="AWS4-HMAC-SHA256-PAYLOAD",xf="UNSIGNED-PAYLOAD",of=50,os="aws4_request",nf=604800;var uf=L(mr(),1);var xr={},ns=[],or=(r,s,e)=>`${r}/${s}/${e}/${os}`,tf=async(r,s,e,f,l)=>{const a=await pf(r,s.secretAccessKey,s.accessKeyId),h=`${e}:${f}:${l}:${uf.toHex(a)}:${s.sessionToken}`;if(h in xr)return xr[h];ns.push(h);while(ns.length>of)delete xr[ns.shift()];let m=`AWS4${s.secretAccessKey}`;for(let g of[e,f,l,os])m=await pf(r,m,g);return xr[h]=m};var pf=(r,s,e)=>{const f=new r(s);return f.update(V(e)),f.digest()};var nr=({headers:r},s,e)=>{const f={};for(let l of Object.keys(r).sort()){if(r[l]==null)continue;const a=l.toLowerCase();if(a in qf||s?.has(a)||_f.test(a)||jf.test(a)){if(!e||e&&!e.has(a))continue}f[a]=r[l].trim().replace(/\s+/g," ")}return f};var ps=({query:r={}})=>{const s=[],e={};for(let f of Object.keys(r).sort()){if(f.toLowerCase()===Yf)continue;s.push(f);const l=r[f];if(typeof l==="string")e[f]=`${p(f)}=${p(l)}`;else if(Array.isArray(l))e[f]=l.slice(0).reduce((a,h)=>a.concat([`${p(f)}=${p(h)}`]),[]).sort().join("&")}return s.map((f)=>e[f]).filter((f)=>f).join("&")};var rl=L(mr(),1);var cr=async({headers:r,body:s},e)=>{for(let f of Object.keys(r))if(f.toLowerCase()===Tr)return r[f];if(s==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof s==="string"||ArrayBuffer.isView(s)||pr(s)){const f=new e;return f.update(V(s)),rl.toHex(await f.digest())}return xf};var ur=L(mr(),1);var el=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 us{format(r){const s=[];for(let l of Object.keys(r)){const a=Cr(l);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[l]))}const e=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let f=0;for(let l of s)e.set(l,f),f+=l.byteLength;return e}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 e=new DataView(new ArrayBuffer(5));return e.setUint8(0,4),e.setInt32(1,r.value,!1),new Uint8Array(e.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;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=Cr(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(ts.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!Rg.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const d=new Uint8Array(17);return d[0]=9,d.set(ur.fromHex(r.value.replace(/\-/g,"")),1),d}}}var sl;(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"})(sl||(sl={}));var Rg=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class ts{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 e=7,f=Math.abs(Math.round(r));e>-1&&f>0;e--,f/=256)s[e]=f;if(r<0)el(s);return new ts(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)el(r);return parseInt(ur.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}var fl=(r,s)=>{r=r.toLowerCase();for(let e of Object.keys(s))if(r===e.toLowerCase())return!0;return!1};var re=(r,s={})=>{const{headers:e,query:f={}}=K.clone(r);for(let l of Object.keys(e)){const a=l.toLowerCase();if(a.slice(0,6)==="x-amz-"&&!s.unhoistableHeaders?.has(a))f[l]=e[l],delete e[l]}return{...r,headers:e,query:f}};var tr=(r)=>{r=K.clone(r);for(let s of Object.keys(r.headers))if(Bf.indexOf(s.toLowerCase())>-1)delete r.headers[s];return r};var ll=(r)=>dg(r).toISOString().replace(/\.\d{3}Z$/,"Z"),dg=(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 se{constructor({applyChecksum:r,credentials:s,region:e,service:f,sha256:l,uriEscapePath:a=!0}){this.headerFormatter=new us,this.service=f,this.sha256=l,this.uriEscapePath=a,this.applyChecksum=typeof r==="boolean"?r:!0,this.regionProvider=Gr(e),this.credentialProvider=Gr(s)}async presign(r,s={}){const{signingDate:e=new Date,expiresIn:f=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}=rs(e);if(f>nf)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const M=or(P,d,g??this.service),$=re(tr(r),{unhoistableHeaders:a});if(S.sessionToken)$.query[Vf]=S.sessionToken;$.query[Lf]=br,$.query[Wf]=`${S.accessKeyId}/${M}`,$.query[vf]=k,$.query[Zf]=f.toString(10);const Z=nr($,l,h);return $.query[Xf]=al(Z),$.query[Qf]=await this.getSignature(k,M,this.getSigningKey(S,d,P,g),this.createCanonicalRequest($,Z,await cr(r,this.sha256))),$}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:e=new Date,priorSignature:f,signingRegion:l,signingService:a}){const h=l??await this.regionProvider(),{shortDate:m,longDate:g}=rs(e),S=or(m,h,a??this.service),d=await cr({headers:{},body:s},this.sha256),k=new this.sha256;k.update(r);const P=zr.toHex(await k.digest()),M=[bf,g,S,f,P,d].join("\n");return this.signString(M,{signingDate:e,signingRegion:h,signingService:a})}async signMessage(r,{signingDate:s=new Date,signingRegion:e,signingService:f}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:s,signingRegion:e,signingService:f,priorSignature:r.priorSignature}).then((a)=>{return{message:r.message,signature:a}})}async signString(r,{signingDate:s=new Date,signingRegion:e,signingService:f}={}){const l=await this.credentialProvider();this.validateResolvedCredentials(l);const a=e??await this.regionProvider(),{shortDate:h}=rs(s),m=new this.sha256(await this.getSigningKey(l,a,h,f));return m.update(V(r)),zr.toHex(await m.digest())}async signRequest(r,{signingDate:s=new Date,signableHeaders:e,unsignableHeaders:f,signingRegion:l,signingService:a}={}){const h=await this.credentialProvider();this.validateResolvedCredentials(h);const m=l??await this.regionProvider(),g=tr(r),{longDate:S,shortDate:d}=rs(s),k=or(d,m,a??this.service);if(g.headers[xs]=S,h.sessionToken)g.headers[Of]=h.sessionToken;const P=await cr(g,this.sha256);if(!fl(Tr,g.headers)&&this.applyChecksum)g.headers[Tr]=P;const M=nr(g,f,e),$=await this.getSignature(S,k,this.getSigningKey(h,m,d,a),this.createCanonicalRequest(g,M,P));return g.headers[Jf]=`${br} `+`Credential=${h.accessKeyId}/${k}, `+`SignedHeaders=${al(M)}, `+`Signature=${$}`,g}createCanonicalRequest(r,s,e){const f=Object.keys(s).sort();return`${r.method}
|
|
3
|
-
${this.getCanonicalPath(r)}
|
|
4
|
-
${ps(r)}
|
|
5
|
-
${f.map((l)=>`${l}:${s[l]}`).join("\n")}
|
|
6
|
-
|
|
7
|
-
${f.join(";")}
|
|
8
|
-
${e}`}async createStringToSign(r,s,e){const f=new this.sha256;f.update(V(e));const l=await f.digest();return`${br}
|
|
9
|
-
${r}
|
|
10
|
-
${s}
|
|
11
|
-
${zr.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 e=`${r?.startsWith("/")?"/":""}${s.join("/")}${s.length>0&&r?.endsWith("/")?"/":""}`;return p(e).replace(/%2F/g,"/")}return r}async getSignature(r,s,e,f){const l=await this.createStringToSign(r,s,f),a=new this.sha256(await e);return a.update(V(l)),zr.toHex(await a.digest())}getSigningKey(r,s,e,f){return tf(this.sha256,r,e,s,f||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 rs=(r)=>{const s=ll(r).replace(/[\-:]/g,"");return{longDate:s,shortDate:s.slice(0,8)}},al=(r)=>Object.keys(r).sort().join(";");var hl="Directory",ml="S3Express",gl="sigv4-s3express",ss="X-Amz-S3session-Token",Hr=ss.toLowerCase(),Ig="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Eg="s3_disable_express_session_auth",ee={environmentVariableSelector:(r)=>u(r,Ig,t.ENV),configFileSelector:(r)=>u(r,Eg,t.CONFIG),default:!1};var wl=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},Al=function(r,s){const e=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),f=r.credentialProvider,l=()=>{return clearTimeout(e),r.credentialProvider=f,Promise.resolve(s)};r.credentialProvider=l};class es extends se{async signWithCredentials(r,s,e){const f=wl(s);r.headers[Hr]=s.sessionToken;const l=this;return Al(l,f),l.signRequest(r,e??{})}async presignWithCredentials(r,s,e){const f=wl(s);return delete r.headers[Hr],r.headers[ss]=s.sessionToken,r.query=r.query??{},r.query[ss]=s.sessionToken,Al(this,f),this.presign(r,e)}}var Sl=(r)=>{return(s,e)=>async(f)=>{if(e.endpointV2){const l=e.endpointV2,a=l.properties?.authSchemes?.[0]?.name===gl;if(l.properties?.backend===ml||l.properties?.bucketType===hl)e.isS3ExpressBucket=!0;if(a){const m=f.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(e.s3ExpressIdentity=g,K.isInstance(f.request)&&g.sessionToken)f.request.headers[Hr]=g.sessionToken}}}return s(f)}},Rl={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},fe=(r)=>({applyToStack:(s)=>{s.add(Sl(r),Rl)}});var Il=L(le(),1);var Pg=L(kg(),1);var dl=async(r,s,e,f)=>{const l=await f.signWithCredentials(e,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 Ng=(r)=>(s)=>{throw s},Dg=(r,s)=>{};var El=(r)=>(s,e)=>async(f)=>{if(!K.isInstance(f.request))return s(f);const a=Fr(e).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(e.s3ExpressIdentity)S=await dl(e.s3ExpressIdentity,h,f.request,await r.signer());else S=await g.sign(f.request,m,h);const d=await s({...f,request:S}).catch((g.errorHandler||Ng)(h));return(g.successHandler||Dg)(d.response,h),d},ae=(r)=>({applyToStack:(s)=>{s.addRelativeTo(El(r),Il.httpSigningMiddlewareOptions)}});var kl=(r,{session:s})=>{const[e,f]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new hr(async(l)=>e().send(new f({Bucket:l,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var $g={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},yg=3000,Mg=(r)=>(s,e)=>async(f)=>{const l=await s(f),{response:a}=l;if(!ir.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 Pl(m);a.body=S;const d=await Ug(g,{streamCollector:async(P)=>{return Nl(P,yg)}});if(typeof g?.destroy==="function")g.destroy();const k=r.utf8Encoder(d.subarray(d.length-16));if(d.length===0&&$g[e.commandName]){const P=new Error("S3 aborted request");throw P.name="InternalError",P}if(k&&k.endsWith("</Error>"))a.statusCode=400;return l},Ug=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},Tg={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},fs=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Mg(r),Tg)}});var he=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Dl(r){return(s,e)=>async(f)=>{if(r.bucketEndpoint){const l=e.endpointV2;if(l){const a=f.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(e.logger?.constructor?.name==="NoOpLogger")console.warn(m);else e.logger?.warn?.(m);throw h}}}return s(f)}}var $l={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function cg({bucketEndpoint:r}){return(s)=>async(e)=>{const{input:{Bucket:f}}=e;if(!r&&typeof f==="string"&&!he(f)&&f.indexOf("/")>=0){const l=new Error(`Bucket name shouldn't contain '/', received '${f}'`);throw l.name="InvalidBucketName",l}return s({...e})}}var Cg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},yl=(r)=>({applyToStack:(s)=>{s.add(cg(r),Cg),s.addRelativeTo(Dl(r),$l)}});var Dr=L(le(),1);var Ml=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var ds=L(Rs(),1);var ls={CrtSignerV4:null};class me{constructor(r){this.sigv4Signer=new es(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,e={}){if(e.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,e)}return this.sigv4Signer.signWithCredentials(r,s,e)}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,e={}){if(e.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,e)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=ls.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={["required"]:!1,["type"]:"String"},wr={["required"]:!0,default:!1,["type"]:"Boolean"},Kr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},D={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},N={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},T={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},da={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Ul={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},ws={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},v={["ref"]:"Bucket"},W={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},gs={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Ia={["ref"]:"url"},Ea={["fn"]:"uriEncode",["argv"]:[v],["assign"]:"uri_encoded_bucket"},_={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},ka={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[v,!1]},ge={["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}"}]},Tl={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},cl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},A={["fn"]:"not",["argv"]:[T]},Cl={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},zl={["fn"]:"not",["argv"]:[ws]},Gl={["ref"]:"hardwareType"},Hl={["conditions"]:[A],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},as={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},we={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},zg={["ref"]:"ForcePathStyle"},U={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},C={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},G={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},E={["fn"]:"not",["argv"]:[C]},H={["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]},Kl={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},Ll={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Wl={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Ae={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ia,"isIp"]},!1]},Se={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:c,["headers"]:{}},Ke={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:c,["headers"]:{}},vl={["endpoint"]:Ke,["type"]:"endpoint"},Re={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Xl={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},hs={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},Q={["ref"]:"bucketArn"},Pa={["ref"]:"arnType"},de={["fn"]:"getAttr",["argv"]:[Q,"service"]},Le={["ref"]:"accessPointName"},Zl={["conditions"]:[N],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},Ql={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},Vl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},Ie={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"UseArnRegion"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseArnRegion"},!1]},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Q,"region"]},"{Region}"]}]}],["error"]:"Invalid configuration: region from ARN `{bucketArn#region}` does not match client region `{Region}` and UseArnRegion is `false`",["type"]:"error"},Na={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Da={["fn"]:"getAttr",["argv"]:[Q,"accountId"]},Ee={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},Jl={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},ke={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},Pe={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},Ne={["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"},Yl={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Lr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},Ol={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},ql={["fn"]:"aws.parseArn",["argv"]:[v]},_l={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},jl={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},il={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},De={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},bl={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:{}},xl={["ref"]:"UseObjectLambdaEndpoint"},$e={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},ol={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},nl={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},pl={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},ye={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:c,["headers"]:{}},ul={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:{}},Me=[{["ref"]:"Region"}],Gg=[{["ref"]:"Endpoint"}],Hg=[v],Ue=[N],ms=[B],rr=[T,W],tl=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],ra=[gs],Te=[Ea],ce=[ka],Ar=[D],sa=[{["fn"]:"substring",["argv"]:[v,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[v,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],ea=[{["conditions"]:[D],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:_,["headers"]:{}},["type"]:"endpoint"}],fa=[{["fn"]:"substring",["argv"]:[v,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[v,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],la=[{["conditions"]:[D],["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"}],Fg=[ws],aa=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],ha=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],Kg=["*"],b=[da],ma=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],x=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],Ce=[{["fn"]:"stringEquals",["argv"]:[Pa,"accesspoint"]}],ga=[{["fn"]:"getAttr",["argv"]:[Q,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Le,""]}]}],Lg=[Q,"resourceId[1]"],ze=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Q,"region"]},""]}]}],wa=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[Q,"resourceId[2]"]}]}]}],Wg=[Q,"resourceId[2]"],Ge=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[Q,"region"]}],["assign"]:"bucketPartition"}],Aa=[{["fn"]:"stringEquals",["argv"]:[Na,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],He=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[Q,"region"]},!0]}],Fe=[{["fn"]:"isValidHostLabel",["argv"]:[Da,!1]}],Sa=[{["fn"]:"isValidHostLabel",["argv"]:[Le,!1]}],Ra=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],vg={version:"1.0",parameters:{Bucket:gr,Region:gr,UseFIPS:wr,UseDualStack:wr,Endpoint:gr,ForcePathStyle:wr,Accelerate:wr,UseGlobalEndpoint:wr,UseObjectLambdaEndpoint:Kr,Key:gr,Prefix:gr,CopySource:gr,DisableAccessPoints:Kr,DisableMultiRegionAccessPoints:wr,UseArnRegion:Kr,UseS3ExpressControlEndpoint:Kr,DisableS3ExpressSessionAuth:Kr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:Me}],rules:[{["conditions"]:[B,D],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,D],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"]:[D,da,Ul],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[ws,{["fn"]:"substring",["argv"]:[v,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:Ue,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:ms,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:rr,rules:[{["conditions"]:tl,rules:[{["conditions"]:ra,rules:[{["conditions"]:Te,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:_,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ce,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:_,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ge],["type"]:"tree"},{["conditions"]:ra,rules:[{["conditions"]:Te,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:As,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ce,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:As,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ge],["type"]:"tree"},{["conditions"]:[Tl,cl],rules:[{["conditions"]:[Ea,A],rules:[{["conditions"]:Ar,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com/{uri_encoded_bucket}",["properties"]:_,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:ce,rules:[{["conditions"]:tl,rules:[{["conditions"]:sa,rules:ea,["type"]:"tree"},{["conditions"]:fa,rules:ea,["type"]:"tree"},Cl],["type"]:"tree"},{["conditions"]:sa,rules:la,["type"]:"tree"},{["conditions"]:fa,rules:la,["type"]:"tree"},Cl],["type"]:"tree"},ge],["type"]:"tree"},{["conditions"]:[zl,Tl,cl],rules:[{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:_,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ar,endpoint:{["url"]:"https://s3express-control-fips.{Region}.amazonaws.com",["properties"]:_,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3express-control.{Region}.amazonaws.com",["properties"]:_,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[ws,{["fn"]:"substring",["argv"]:[v,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[v,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[v,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[v,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:Me,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:aa,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Gl,"e"]}],rules:[{["conditions"]:ha,rules:[Hl,{["conditions"]:rr,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:as,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:as,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Gl,"o"]}],rules:[{["conditions"]:ha,rules:[Hl,{["conditions"]:rr,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:as,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:as,["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"]:Fg,rules:[{["conditions"]:[T,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:Gg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[we,ka],rules:[{["conditions"]:b,rules:[{["conditions"]:ma,rules:[{["conditions"]:[B,Ul],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[N,D,U,A,C],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,D,U,A,E,H],rules:[{endpoint:Fl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,D,U,A,E,F],endpoint:Fl,["type"]:"endpoint"},{["conditions"]:[I,D,U,A,C],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,D,U,A,E,H],rules:[{endpoint:Kl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,D,U,A,E,F],endpoint:Kl,["type"]:"endpoint"},{["conditions"]:[N,R,B,A,C],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,B,A,E,H],rules:[{endpoint:Ll,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,B,A,E,F],endpoint:Ll,["type"]:"endpoint"},{["conditions"]:[N,R,U,A,C],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,R,U,A,E,H],rules:[{endpoint:Wl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,R,U,A,E,F],endpoint:Wl,["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,gs,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,Ae,C],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,gs,E,H],rules:[{["conditions"]:x,endpoint:Se,["type"]:"endpoint"},{endpoint:Se,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,U,T,W,Ae,E,H],rules:[{["conditions"]:x,endpoint:Ke,["type"]:"endpoint"},vl],["type"]:"tree"},{["conditions"]:[I,R,U,T,W,gs,E,F],endpoint:Se,["type"]:"endpoint"},{["conditions"]:[I,R,U,T,W,Ae,E,F],endpoint:Ke,["type"]:"endpoint"},{["conditions"]:[I,R,B,A,C],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,B,A,E,H],rules:[{["conditions"]:x,endpoint:Re,["type"]:"endpoint"},{endpoint:Re,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,B,A,E,F],endpoint:Re,["type"]:"endpoint"},{["conditions"]:[I,R,U,A,C],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,R,U,A,E,H],rules:[{["conditions"]:x,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,R,U,A,E,F],endpoint:Xl,["type"]:"endpoint"}],["type"]:"tree"},hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[T,W,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ia,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[v,!0]},we,R,I,U],rules:[{["conditions"]:b,rules:[{["conditions"]:ma,rules:[vl],["type"]:"tree"},hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[we,{["fn"]:"aws.parseArn",["argv"]:Hg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[Q,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Pa,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[de,"s3-object-lambda"]}],rules:[{["conditions"]:Ce,rules:[{["conditions"]:ga,rules:[Zl,Ql,{["conditions"]:ze,rules:[Vl,{["conditions"]:wa,rules:[Ie,{["conditions"]:Ge,rules:[{["conditions"]:b,rules:[{["conditions"]:Aa,rules:[{["conditions"]:He,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Da,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:Fe,rules:[{["conditions"]:Sa,rules:[{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ee,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ar,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ee,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ee,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Jl],["type"]:"tree"},ke],["type"]:"tree"},Pe],["type"]:"tree"},Ne],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Bl],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},Yl],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:Ce,rules:[{["conditions"]:ga,rules:[{["conditions"]:ze,rules:[{["conditions"]:Ce,rules:[{["conditions"]:ze,rules:[Vl,{["conditions"]:wa,rules:[Ie,{["conditions"]:Ge,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Na,"{partitionResult#name}"]}],rules:[{["conditions"]:He,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[de,"s3"]}],rules:[{["conditions"]:Fe,rules:[{["conditions"]:Sa,rules:[{["conditions"]:ms,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[D,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Lr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[D,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Lr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Lr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,T,W],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Lr,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Lr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},Jl],["type"]:"tree"},ke],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},Pe],["type"]:"tree"},Ne],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},Bl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[Le,!0]}],rules:[{["conditions"]:Ue,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:Ar,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:ms,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"]:Me,["assign"]:"mrapPartition"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"mrapPartition"},"name"]},{["fn"]:"getAttr",["argv"]:[Q,"partition"]}]}],rules:[{endpoint:{["url"]:"https://{accessPointName}.accesspoint.s3-global.{mrapPartition#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,name:"sigv4a",["signingName"]:"s3",["signingRegionSet"]:Kg}]},["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"},Yl],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[de,"s3-outposts"]}],rules:[{["conditions"]:Ue,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:Ar,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:ms,error:"S3 Outposts does not support S3 Accelerate",["type"]:"error"},{["conditions"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[Q,"resourceId[4]"]}]}],error:"Invalid Arn: Outpost Access Point ARN contains sub resources",["type"]:"error"},{["conditions"]:[{["fn"]:"getAttr",["argv"]:Lg,["assign"]:"outpostId"}],rules:[{["conditions"]:aa,rules:[Ie,{["conditions"]:Ge,rules:[{["conditions"]:b,rules:[{["conditions"]:Aa,rules:[{["conditions"]:He,rules:[{["conditions"]:Fe,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:Wg,["assign"]:"outpostType"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[Q,"resourceId[3]"],["assign"]:"accessPointName"}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"outpostType"},"accesspoint"]}],rules:[{["conditions"]:rr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.{url#authority}",["properties"]:Ol,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ol,["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"},ke],["type"]:"tree"},Pe],["type"]:"tree"},Ne],["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"]:[v,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"]:[zg,!0]},ql],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:Te,rules:[{["conditions"]:b,rules:[{["conditions"]:[U],rules:[{["conditions"]:[N,A,D,C],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,D,E,H],rules:[{endpoint:_l,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,D,E,F],endpoint:_l,["type"]:"endpoint"},{["conditions"]:[I,A,D,C],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,D,E,H],rules:[{endpoint:jl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,D,E,F],endpoint:jl,["type"]:"endpoint"},{["conditions"]:[N,A,R,C],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[N,A,R,E,H],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[N,A,R,E,F],endpoint:il,["type"]:"endpoint"},{["conditions"]:[I,T,W,R,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,T,W,R,E,H],rules:[{["conditions"]:x,endpoint:De,["type"]:"endpoint"},{endpoint:De,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,T,W,R,E,F],endpoint:De,["type"]:"endpoint"},{["conditions"]:[I,A,R,C],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,A,R,E,H],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:bl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,A,R,E,F],endpoint:bl,["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"]:[xl]},{["fn"]:"booleanEquals",["argv"]:[xl,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:Ra,rules:[Zl,Ql,{["conditions"]:rr,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:$e,["headers"]:w},["type"]:"endpoint"},{["conditions"]:Ar,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:$e,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:$e,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},hs],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[zl],rules:[{["conditions"]:b,rules:[{["conditions"]:Ra,rules:[{["conditions"]:[D,N,A,C],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[D,N,A,E,H],rules:[{endpoint:ol,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,N,A,E,F],endpoint:ol,["type"]:"endpoint"},{["conditions"]:[D,I,A,C],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[D,I,A,E,H],rules:[{endpoint:nl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[D,I,A,E,F],endpoint:nl,["type"]:"endpoint"},{["conditions"]:[R,N,A,C],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,N,A,E,H],rules:[{endpoint:pl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,N,A,E,F],endpoint:pl,["type"]:"endpoint"},{["conditions"]:[R,I,T,W,C],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,T,W,E,H],rules:[{["conditions"]:x,endpoint:ye,["type"]:"endpoint"},{endpoint:ye,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,T,W,E,F],endpoint:ye,["type"]:"endpoint"},{["conditions"]:[R,I,A,C],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:G,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,I,A,E,H],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:c,["headers"]:w},["type"]:"endpoint"},{endpoint:ul,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,I,A,E,F],endpoint:ul,["type"]:"endpoint"}],["type"]:"tree"},hs],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},$a=vg;var Ss=(r,s={})=>{return Ma($a,{endpointParams:r,logger:s.logger})};ya.aws=Ua;var Ca=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}},za=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}},Xg=(r)=>async(s,e,f)=>{if(!f)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const l=await r(s,e,f),a=Fr(e)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${e.commandName}\``);const h=await Ta(f,{getEndpointParameterInstructions:a},s);return Object.assign(l,h)},Zg=async(r,s,e)=>{return{operation:Fr(s).operation,region:await Gr(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ca=Xg(Zg),Qg=(r,s,e)=>{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 M;if(P==="sigv4a"){M="aws.auth#sigv4a";const Or=h.find((q)=>{const Mr=q.name.toLowerCase();return Mr!=="sigv4a"&&Mr.startsWith("sigv4")});if(!ls.CrtSignerV4&&Or)continue}else if(P.startsWith("sigv4"))M="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${P}\``);const $=e[M];if(!$)throw new Error(`Could not find HttpAuthOption create function for \`${M}\``);const Z=$(l);Z.schemeId=M,Z.signingProperties={...Z.signingProperties||{},...k,...d},m.push(Z)}return m}},Vg=(r)=>{const s=[];switch(r.operation){default:s.push(Ca(r)),s.push(za(r))}return s},Ga=Qg(Ss,Vg,{"aws.auth#sigv4":Ca,"aws.auth#sigv4a":za}),Ha=(r)=>{const s=ds.resolveAwsSdkSigV4Config(r);return{...ds.resolveAwsSdkSigV4AConfig(s)}};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"}},Sr={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 X extends Ka{constructor(r){super(r);Object.setPrototypeOf(this,X.prototype)}}class Is extends X{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,Is.prototype)}}class Es extends X{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Es.prototype)}}class ks extends X{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,ks.prototype)}}class Ps extends X{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,Ps.prototype)}}class Ns extends X{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,Ns.prototype)}}var We;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(We||(We={}));var ve;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return e.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return e.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(ve||(ve={}));var Xe;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.AccessPointArn!==void 0)return e.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(Xe||(Xe={}));var Ze;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(Ze||(Ze={}));class Ds extends X{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,Ds.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class $s extends X{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,$s.prototype)}}class ys extends X{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}var Jg=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:Y},...r.SessionToken&&{SessionToken:Y}}),La=(r)=>({...r,...r.Credentials&&{Credentials:Jg(r.Credentials)}});var Wa=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Y}}),va=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Y}});var Ir=L(Rs(),1);var Cs=L(le(),1);class Ms extends X{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,Ms.prototype)}}var Xa;(function(r){r.visit=(s,e)=>{if(s.Records!==void 0)return e.Records(s.Records);if(s.Stats!==void 0)return e.Stats(s.Stats);if(s.Progress!==void 0)return e.Progress(s.Progress);if(s.Cont!==void 0)return e.Cont(s.Cont);if(s.End!==void 0)return e.End(s.End);return e._(s.$unknown[0],s.$unknown[1])}})(Xa||(Xa={}));var Za=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Y},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Y}}),Qa=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Y},...r.SSEKMSKeyId&&{SSEKMSKeyId:Y},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Y}});var na=async(r,s)=>{const e=Cs.requestBuilder(r,s),f=z({},j,{[xw]:r[cw]});e.bp("/"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const l=z({[_w]:[,""]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var pa=async(r,s)=>{const e=Cs.requestBuilder(r,s),f=z({},j,{[Lw]:r[Aw],[Ww]:[()=>j(r[Va]),()=>Wr(r[Va]).toString()],[vw]:r[Sw],[Xw]:[()=>j(r[Ja]),()=>Wr(r[Ja]).toString()],[Qw]:r[kw],[Hs]:r[zs],[Fh]:r[dh],[Fs]:r[Gs],[zh]:r[Rh],[Uh]:r[mh],[bw]:r[sw]});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const l=z({[Wh]:[,"GetObject"],[Vw]:[,r[Pw]],[Jw]:[,r[Nw]],[Bw]:[,r[Dw]],[Yw]:[,r[$w]],[Ow]:[,r[yw]],[qw]:[()=>r.ResponseExpires!==void 0,()=>Wr(r[Mw]).toString()],[jw]:[,r[ef]],[Zw]:[()=>r.PartNumber!==void 0,()=>r[Ew].toString()]});let a;return e.m("GET").h(f).q(l).b(a),e.build()};var ua=async(r,s)=>{const e=Cs.requestBuilder(r,s),f=z({},j,{[$h]:r[hh]||"application/octet-stream",[iw]:r[ug],[kh]:r[eh],[Ph]:r[fh],[Nh]:r[lh],[Dh]:r[ah],[je]:[()=>j(r[Oe]),()=>r[Oe].toString()],[Hw]:r[ew],[sA]:r[rw],[ff]:r[ne],[lf]:r[pe],[af]:r[ue],[hf]:r[te],[ie]:[()=>j(r[qe]),()=>Wr(r[qe]).toString()],[ow]:r[hw],[nw]:r[mw],[pw]:r[gw],[uw]:r[ww],[mf]:r[rf],[Gh]:r[Xr],[Lh]:r[Eh],[Hs]:r[zs],[Fh]:r[dh],[Fs]:r[Gs],[gf]:r[sf],[Hh]:r[Ih],[Zr]:[()=>j(r[cs]),()=>r[cs].toString()],[zh]:r[Rh],[eA]:r[Cw],[ch]:r[Ah],[be]:[()=>j(r[_e]),()=>oa(r[_e]).toString()],[Th]:r[wh],[Uh]:r[mh],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const l=z({[Wh]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return e.m("PUT").h(f).q(l).b(a),e.build()};var ta=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return oe(r,s);const e=z({$metadata:J(r)}),f=Rr(ia(await Ir.parseXmlBody(r.body,s)),"body");if(f[Je]!=null)e[Je]=pg(f[Je],s);return e};var rh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return oe(r,s);const e=z({$metadata:J(r),[lw]:[()=>r.headers[Ya]!==void 0,()=>Ts(r.headers[Ya])],[tg]:[,r.headers[Gw]],[vr]:[,r.headers[Mh]],[Tw]:[,r.headers[tw]],[Rw]:[()=>r.headers[Ba]!==void 0,()=>Rr(Ur(r.headers[Ba]))],[Oe]:[()=>r.headers[je]!==void 0,()=>ba(r.headers[je])],[gh]:[,r.headers[yh]],[ne]:[,r.headers[ff]],[pe]:[,r.headers[lf]],[ue]:[,r.headers[af]],[te]:[,r.headers[hf]],[dw]:[()=>r.headers[Oa]!==void 0,()=>Us(r.headers[Oa])],[ef]:[,r.headers[Kh]],[eh]:[,r.headers[kh]],[fh]:[,r.headers[Ph]],[lh]:[,r.headers[Nh]],[ah]:[,r.headers[Dh]],[fw]:[,r.headers[Fw]],[hh]:[,r.headers[$h]],[qe]:[()=>r.headers[ie]!==void 0,()=>Rr(Ur(r.headers[ie]))],[aw]:[,r.headers[Kw]],[Eh]:[,r.headers[Lh]],[rf]:[,r.headers[mf]],[zs]:[,r.headers[Hs]],[Gs]:[,r.headers[Fs]],[sf]:[,r.headers[gf]],[cs]:[()=>r.headers[Zr]!==void 0,()=>Ts(r.headers[Zr])],[Xr]:[,r.headers[Gh]],[Sh]:[,r.headers[Ch]],[Uw]:[,r.headers[rA]],[Iw]:[()=>r.headers[qa]!==void 0,()=>Us(r.headers[qa])],[zw]:[()=>r.headers[_a]!==void 0,()=>Us(r.headers[_a])],[Ah]:[,r.headers[ch]],[_e]:[()=>r.headers[be]!==void 0,()=>Rr(xe(r.headers[be]))],[wh]:[,r.headers[Th]],Metadata:[,Object.keys(r.headers).filter((l)=>l.startsWith("x-amz-meta-")).reduce((l,a)=>{return l[a.substring(11)]=r.headers[a],l},{})]}),f=r.body;return s.sdkStreamMixin(f),e.Body=f,e};var sh=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return oe(r,s);const e=z({$metadata:J(r),[vr]:[,r.headers[Mh]],[gh]:[,r.headers[yh]],[ne]:[,r.headers[ff]],[pe]:[,r.headers[lf]],[ue]:[,r.headers[af]],[te]:[,r.headers[hf]],[rf]:[,r.headers[mf]],[ef]:[,r.headers[Kh]],[zs]:[,r.headers[Hs]],[Gs]:[,r.headers[Fs]],[sf]:[,r.headers[gf]],[Ih]:[,r.headers[Hh]],[cs]:[()=>r.headers[Zr]!==void 0,()=>Ts(r.headers[Zr])],[Sh]:[,r.headers[Ch]]});return await ja(r.body,s),e};var oe=async(r,s)=>{const e={...r,body:await Ir.parseXmlErrorBody(r.body,s)},f=Ir.loadRestXmlErrorCode(r,e.body);switch(f){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await bg(e,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await ng(e,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Og(e,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await qg(e,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await jg(e,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await _g(e,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await ig(e,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await xg(e,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await og(e,s);default:const l=e.body;return Yg({output:r,parsedBody:l,errorCode:f})}},Yg=xa(X),Og=async(r,s)=>{const e=z({}),f=r.body,l=new ks({$metadata:J(r),...e});return O(l,r.body)},qg=async(r,s)=>{const e=z({}),f=r.body,l=new Ps({$metadata:J(r),...e});return O(l,r.body)},_g=async(r,s)=>{const e=z({}),f=r.body;if(f[Ve]!=null)e[Ve]=dr(f[Ve]);if(f[Xr]!=null)e[Xr]=dr(f[Xr]);const l=new Ds({$metadata:J(r),...e});return O(l,r.body)},jg=async(r,s)=>{const e=z({}),f=r.body,l=new Ns({$metadata:J(r),...e});return O(l,r.body)},ig=async(r,s)=>{const e=z({}),f=r.body,l=new $s({$metadata:J(r),...e});return O(l,r.body)},bg=async(r,s)=>{const e=z({}),f=r.body,l=new Is({$metadata:J(r),...e});return O(l,r.body)},xg=async(r,s)=>{const e=z({}),f=r.body,l=new ys({$metadata:J(r),...e});return O(l,r.body)},og=async(r,s)=>{const e=z({}),f=r.body,l=new Ms({$metadata:J(r),...e});return O(l,r.body)},ng=async(r,s)=>{const e=z({}),f=r.body,l=new Es({$metadata:J(r),...e});return O(l,r.body)};var pg=(r,s)=>{const e={};if(r[Qe]!=null)e[Qe]=dr(r[Qe]);if(r[Be]!=null)e[Be]=dr(r[Be]);if(r[Ye]!=null)e[Ye]=dr(r[Ye]);if(r[vr]!=null)e[vr]=Rr(xe(r[vr]));return e};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 ug="ACL";var Qe="AccessKeyId";var tg="AcceptRanges";var Ve="AccessTier";var cs="BucketKeyEnabled";var Je="Credentials",rw="ChecksumAlgorithm";var eh="CacheControl",ne="ChecksumCRC32",pe="ChecksumCRC32C",fh="ContentDisposition";var lh="ContentEncoding";var ah="ContentLanguage",Oe="ContentLength",sw="ChecksumMode",ew="ContentMD5";var fw="ContentRange";var ue="ChecksumSHA1",te="ChecksumSHA256";var hh="ContentType";var lw="DeleteMarker";var qe="Expires";var mh="ExpectedBucketOwner";var aw="ExpiresString";var gh="ETag";var vr="Expiration";var hw="GrantFullControl";var mw="GrantRead",gw="GrantReadACP";var ww="GrantWriteACP";var Aw="IfMatch",Va="IfModifiedSince",Sw="IfNoneMatch";var Ja="IfUnmodifiedSince";var Rw="LastModified";var dw="MissingMeta";var wh="ObjectLockLegalHoldStatus",Ah="ObjectLockMode";var _e="ObjectLockRetainUntilDate";var Iw="PartsCount";var Ew="PartNumber";var kw="Range";var Sh="RequestCharged",Pw="ResponseCacheControl",Nw="ResponseContentDisposition",Dw="ResponseContentEncoding",$w="ResponseContentLanguage",yw="ResponseContentType";var Mw="ResponseExpires";var Rh="RequestPayer";var Uw="ReplicationStatus";var Tw="Restore";var Be="SecretAccessKey";var Xr="StorageClass";var cw="SessionMode";var rf="ServerSideEncryption";var zs="SSECustomerAlgorithm",dh="SSECustomerKey",Gs="SSECustomerKeyMD5";var Ih="SSEKMSEncryptionContext",sf="SSEKMSKeyId";var Ye="SessionToken";var Cw="Tagging";var zw="TagCount";var ef="VersionId";var Eh="WebsiteRedirectLocation";var Gw="accept-ranges";var kh="cache-control",Ph="content-disposition",Nh="content-encoding",Dh="content-language",je="content-length",Hw="content-md5",Fw="content-range",$h="content-type";var ie="expires";var yh="etag",Kw="expiresstring";var Lw="if-match",Ww="if-modified-since";var vw="if-none-match";var Xw="if-unmodified-since";var Ba="last-modified";var Zw="partNumber";var Qw="range",Vw="response-cache-control",Jw="response-content-disposition",Bw="response-content-encoding",Yw="response-content-language",Ow="response-content-type",qw="response-expires";var _w="session";var jw="versionId";var iw="x-amz-acl";var ff="x-amz-checksum-crc32",lf="x-amz-checksum-crc32c",bw="x-amz-checksum-mode";var af="x-amz-checksum-sha1",hf="x-amz-checksum-sha256";var xw="x-amz-create-session-mode";var Ya="x-amz-delete-marker",Mh="x-amz-expiration",Uh="x-amz-expected-bucket-owner";var ow="x-amz-grant-full-control",nw="x-amz-grant-read",pw="x-amz-grant-read-acp";var uw="x-amz-grant-write-acp";var Oa="x-amz-missing-meta";var qa="x-amz-mp-parts-count";var Th="x-amz-object-lock-legal-hold",ch="x-amz-object-lock-mode",be="x-amz-object-lock-retain-until-date";var tw="x-amz-restore",Ch="x-amz-request-charged";var zh="x-amz-request-payer";var rA="x-amz-replication-status";var Gh="x-amz-storage-class",sA="x-amz-sdk-checksum-algorithm";var mf="x-amz-server-side-encryption",gf="x-amz-server-side-encryption-aws-kms-key-id",Zr="x-amz-server-side-encryption-bucket-key-enabled",Hh="x-amz-server-side-encryption-context",Hs="x-amz-server-side-encryption-customer-algorithm",Fh="x-amz-server-side-encryption-customer-key",Fs="x-amz-server-side-encryption-customer-key-md5",eA="x-amz-tagging",_a="x-amz-tagging-count";var Kh="x-amz-version-id",Lh="x-amz-website-redirect-location",Wh="x-id";class wf extends Er.classBuilder().ep({...Sr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,e,f){return[kr(e,this.serialize,this.deserialize),Pr(e,r.getEndpointParameterInstructions()),fs(e)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,La).ser(na).de(ta).build(){}var vh={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 Vs=L(Rs(),1);var lA="AWS_S3_USE_ARN_REGION",aA="s3_use_arn_region",Xh={environmentVariableSelector:(r)=>u(r,lA,t.ENV),configFileSelector:(r)=>u(r,aA,t.CONFIG),default:!1};var Zh=L(EA(),1),{__extends:$d,__assign:yd,__rest:Md,__decorate:Ud,__param:Td,__esDecorate:cd,__runInitializers:Cd,__propKey:zd,__setFunctionName:Gd,__metadata:Hd,__awaiter:Ks,__generator:Ls,__exportStar:Fd,__createBinding:Kd,__values:Ws,__read:Ld,__spread:Wd,__spreadArrays:vd,__spreadArray:Xd,__await:Zd,__asyncGenerator:Qd,__asyncDelegator:Vd,__asyncValues:Jd,__makeTemplateObject:Bd,__importStar:Yd,__importDefault:Od,__classPrivateFieldGet:qd,__classPrivateFieldSet:_d,__classPrivateFieldIn:jd,__addDisposableResource:id,__disposeResources:bd}=Zh.default;import{Buffer as Qh} from"buffer";var Vh=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?Qh.from(r,s):Qh.from(r)};var Af=(r)=>{const s=Vh(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Qr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return kA(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var kA=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:Af;function Vr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Jr(r){return new Uint8Array([(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255])}function Br(r){if(!Uint32Array.from){var s=new Uint32Array(r.length),e=0;while(e<r.length)s[e]=r[e],e+=1;return s}return Uint32Array.from(r)}var Sf=function(){function r(){this.crc32=new sr}return r.prototype.update=function(s){if(Vr(s))return;this.crc32.update(Qr(s))},r.prototype.digest=function(){return Ks(this,void 0,void 0,function(){return Ls(this,function(s){return[2,Jr(this.crc32.digest())]})})},r.prototype.reset=function(){this.crc32=new sr},r}();var sr=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var e,f;try{for(var l=Ws(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^NA[(this.checksum^h)&255]}}catch(m){e={error:m}}finally{try{if(a&&!a.done&&(f=l.return))f.call(l)}finally{if(e)throw e.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var PA=[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],NA=Br(PA);var o=L(mr(),1);var Bh=L(mr(),1),Jh=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 Nr{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 e=7,f=Math.abs(Math.round(r));e>-1&&f>0;e--,f/=256)s[e]=f;if(r<0)Jh(s);return new Nr(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)Jh(r);return parseInt(Bh.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class Rf{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 e=new Uint8Array(s.reduce((l,a)=>l+a.byteLength,0));let f=0;for(let l of s)e.set(l,f),f+=l.byteLength;return e}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 e=new DataView(new ArrayBuffer(5));return e.setUint8(0,4),e.setInt32(1,r.value,!1),new Uint8Array(e.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(r.value.bytes,1),f;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(Nr.fromNumber(r.value.valueOf()).bytes,1),S;case"uuid":if(!zA.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 e=0;while(e<r.byteLength){const f=r.getUint8(e++),l=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,f));switch(e+=f,r.getUint8(e++)){case 0:s[l]={type:Oh,value:!0};break;case 1:s[l]={type:Oh,value:!1};break;case 2:s[l]={type:DA,value:r.getInt8(e++)};break;case 3:s[l]={type:$A,value:r.getInt16(e,!1)},e+=2;break;case 4:s[l]={type:yA,value:r.getInt32(e,!1)},e+=4;break;case 5:s[l]={type:MA,value:new Nr(new Uint8Array(r.buffer,r.byteOffset+e,8))},e+=8;break;case 6:const a=r.getUint16(e,!1);e+=2,s[l]={type:UA,value:new Uint8Array(r.buffer,r.byteOffset+e,a)},e+=a;break;case 7:const h=r.getUint16(e,!1);e+=2,s[l]={type:TA,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,h))},e+=h;break;case 8:s[l]={type:cA,value:new Date(new Nr(new Uint8Array(r.buffer,r.byteOffset+e,8)).valueOf())},e+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+e,16);e+=16,s[l]={type:CA,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 Yh;(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"})(Yh||(Yh={}));var Oh="boolean",DA="byte",$A="short",yA="integer",MA="long",UA="binary",TA="string",cA="timestamp",CA="uuid",zA=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function _h({byteLength:r,byteOffset:s,buffer:e}){if(r<GA)throw new Error("Provided message too short to accommodate event stream message overhead");const f=new DataView(e,s,r),l=f.getUint32(0,!1);if(r!==l)throw new Error("Reported message length does not match received message length");const a=f.getUint32(qh,!1),h=f.getUint32(n,!1),m=f.getUint32(r-er,!1),g=new sr().update(new Uint8Array(e,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(e,s+n,r-(n+er))),m!==g.digest())throw new Error(`The message checksum (${g.digest()}) did not match the expected value of ${m}`);return{headers:new DataView(e,s+n+er,a),body:new Uint8Array(e,s+n+er+a,l-a-(n+er+er))}}var qh=4,n=qh*2,er=4,GA=n+er*2;class df{constructor(r,s){this.headerMarshaller=new Rf(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 e=this.headerMarshaller.format(r),f=e.byteLength+s.byteLength+16,l=new Uint8Array(f),a=new DataView(l.buffer,l.byteOffset,l.byteLength),h=new sr;return a.setUint32(0,f,!1),a.setUint32(4,e.byteLength,!1),a.setUint32(8,h.update(l.subarray(0,8)).digest(),!1),l.set(e,12),l.set(s,e.byteLength+12),a.setUint32(f-4,h.update(l.subarray(8,f-4)).digest(),!1),l}decode(r){const{headers:s,body:e}=_h(r);return{headers:this.headerMarshaller.parse(s),body:e}}formatHeaders(r){return this.headerMarshaller.format(r)}}class If{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 Ef{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 kf{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 Pf{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 jh(r){let s=0,e=0,f=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,e=4,f=new Uint8Array(m),new DataView(f.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===e)yield f;else throw new Error("Truncated event message received.");return}const d=g.length;let k=0;while(k<d){if(!f){const M=d-k;if(!l)l=new Uint8Array(4);const $=Math.min(4-e,M);if(l.set(g.slice(k,k+$),e),e+=$,k+=$,e<4)break;a(new DataView(l.buffer).getUint32(0,!1)),l=null}const P=Math.min(s-e,d-k);if(f.set(g.slice(k,k+P),e),e+=P,k+=P,s&&s===e)yield f,f=null,s=0,e=0}}};return{[Symbol.asyncIterator]:h}}function ih(r,s){return async function(e){const{value:f}=e.headers[":message-type"];if(f==="error"){const l=new Error(e.headers[":error-message"].value||"UnknownError");throw l.name=e.headers[":error-code"].value,l}else if(f==="exception"){const l=e.headers[":exception-type"].value,a={[l]:e},h=await r(a);if(h.$unknown){const m=new Error(s(e.body));throw m.name=l,m}throw h[l]}else if(f==="event"){const l={[e.headers[":event-type"].value]:e},a=await r(l);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${e.headers[":event-type"].value}`)}}class vs{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new df(r,s),this.utfEncoder=r}deserialize(r,s){const e=jh(r);return new kf({messageStream:new If({inputStream:e,decoder:this.eventStreamCodec}),deserializer:ih(s,this.utfEncoder)})}serialize(r,s){return new Ef({messageStream:new Pf({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as HA} from"stream";async function*bh(r){let s=!1,e=!1;const f=new Array;r.on("error",(l)=>{if(!s)s=!0;if(l)throw l}),r.on("data",(l)=>{f.push(l)}),r.on("end",()=>{s=!0});while(!e){const l=await new Promise((a)=>setTimeout(()=>a(f.shift()),0));if(l)yield l;e=s&&f.length===0}}class Nf{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new vs({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const e=typeof r[Symbol.asyncIterator]==="function"?r:bh(r);return this.universalMarshaller.deserialize(e,s)}serialize(r,s){return HA.from(this.universalMarshaller.serialize(r,s))}}var xh=(r)=>new Nf(r);import{Writable as FA} from"stream";class Xs extends FA{constructor(r,s){super(s);this.hash=r}_write(r,s,e){try{this.hash.update(V(r))}catch(f){return e(f)}e()}}var oh=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const e=new r,f=new Xs(e);return s.pipe(f),new Promise((l,a)=>{s.on("error",(h)=>{f.end(),a(h)}),f.on("error",a),f.on("finish",()=>{e.digest().then(l).catch(a)})})};var Zs=L(Rs(),1);var em=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??nh,base64Encoder:r?.base64Encoder??uh,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??Ss,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??th,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Ga,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new Zs.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new Zs.AwsSdkSigV4ASigner}],logger:r?.logger??new jr,sdkStreamMixin:r?.sdkStreamMixin??rm,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??me,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??sm,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Cr,utf8Encoder:r?.utf8Encoder??ph}};var Nm=(r)=>{hm(process.version);const s=km(r),e=()=>s().then(am),f=em(r);return Vs.emitWarningIfUnsupportedVersion(process.version),{...f,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Em,credentialDefaultProvider:r?.credentialDefaultProvider??Pm,defaultUserAgentProvider:r?.defaultUserAgentProvider??Im({serviceId:f.serviceId,clientVersion:vh.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??i(ee),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??xh,maxAttempts:r?.maxAttempts??i(Rm),md5:r?.md5??Qs.bind(null,"md5"),region:r?.region??i(wm,Am),requestHandler:fm.create(r?.requestHandler??e),retryMode:r?.retryMode??i({...dm,default:async()=>(await e()).retryMode||Sm}),sha1:r?.sha1??Qs.bind(null,"sha1"),sha256:r?.sha256??Qs.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??i(Vs.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??lm,streamHasher:r?.streamHasher??oh,useArnRegion:r?.useArnRegion??i(Xh),useDualstackEndpoint:r?.useDualstackEndpoint??i(mm),useFipsEndpoint:r?.useFipsEndpoint??i(gm)}};var Dm=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:e,credentials:f}=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){e=l},httpAuthSchemeProvider(){return e},setCredentials(l){f=l},credentials(){return f}}},$m=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var Js=(r)=>r,zm=(r,s)=>{const e={...Js(cm(r)),...Js(Um(r)),...Js(ym(r)),...Js(Dm(r))};return s.forEach((f)=>f.configure(e)),{...r,...Cm(e),...Tm(e),...Mm(e),...$m(e)}};class Df extends Lm{constructor(...[r]){const s=Nm(r||{}),e=Fa(s),f=Wm(e),l=Vm(f),a=Xm(l),h=Gm(a),m=Qm(h),g=Ml(m),S=Ha(g),d=kl(S,{session:[()=>this,wf]}),k=zm(d,r?.extensions||[]);super(k);this.config=k,this.middlewareStack.use(vm(this.config)),this.middlewareStack.use(Jm(this.config)),this.middlewareStack.use(Zm(this.config)),this.middlewareStack.use(Hm(this.config)),this.middlewareStack.use(Fm(this.config)),this.middlewareStack.use(Km(this.config)),this.middlewareStack.use(Dr.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ca,identityProviderConfigProvider:async(P)=>new Dr.DefaultIdentityProviderConfig({"aws.auth#sigv4":P.credentials,"aws.auth#sigv4a":P.credentials})})),this.middlewareStack.use(Dr.getHttpSigningPlugin(this.config)),this.middlewareStack.use(yl(this.config)),this.middlewareStack.use(Cf(this.config)),this.middlewareStack.use(Ff(this.config)),this.middlewareStack.use(fe(this.config)),this.middlewareStack.use(ae(this.config))}destroy(){super.destroy()}}function KA(r){return(s)=>async(e)=>{const f={...e.input},l=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of l){const h=f[a.target];if(h){let m;if(typeof h==="string")if(WA(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),f[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),f[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),f[a.hash]=r.base64Encoder(await g.digest())}}return s({...e,input:f})}}function WA(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 LA={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Bs=(r)=>({applyToStack:(s)=>{s.add(KA(r),LA)}});var y;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(y||(y={}));var Bm;(function(r){r.HEADER="header",r.TRAILER="trailer"})(Bm||(Bm={}));var{MD5:Ym,CRC32:Om}=y;var Yr=[y.CRC32,y.CRC32C,y.SHA1,y.SHA256],qm=[y.CRC32,y.CRC32C,y.SHA1,y.SHA256];var _m=(r,{requestChecksumRequired:s,requestAlgorithmMember:e},f)=>{const l=f?Om:Ym;if(!e||!r[e])return s?l:void 0;const a=r[e];if(!Yr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${Yr}.`);return a};var $r=(r)=>r===y.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var jm=(r,s)=>{const e=r.toLowerCase();for(let f of Object.keys(s))if(e===f.toLowerCase())return!0;return!1};var yr=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!pr(r);var yf=function(){function r(){this.crc32c=new $f}return r.prototype.update=function(s){if(Vr(s))return;this.crc32c.update(Qr(s))},r.prototype.digest=function(){return Ks(this,void 0,void 0,function(){return Ls(this,function(s){return[2,Jr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new $f},r}();var $f=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var e,f;try{for(var l=Ws(s),a=l.next();!a.done;a=l.next()){var h=a.value;this.checksum=this.checksum>>>8^XA[(this.checksum^h)&255]}}catch(m){e={error:m}}finally{try{if(a&&!a.done&&(f=l.return))f.call(l)}finally{if(e)throw e.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],XA=Br(vA);var Ys=(r,s)=>({[y.MD5]:s.md5,[y.CRC32]:Sf,[y.CRC32C]:yf,[y.SHA1]:s.sha1,[y.SHA256]:s.sha256})[r];var Os=(r,s)=>{const e=new r;return e.update(V(s||"")),e.digest()};var im={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},bm=(r,s)=>(e,f)=>async(l)=>{if(!K.isInstance(l.request))return e(l);const{request:a}=l,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:S}=r,{input:d,requestChecksumRequired:k,requestAlgorithmMember:P}=s,M=_m(d,{requestChecksumRequired:k,requestAlgorithmMember:P},!!f.isS3ExpressBucket);let $=h,Z=m;if(M){const q=$r(M),Mr=Ys(M,r);if(yr(h)){const{getAwsChunkedEncodingStream:bs,bodyLengthChecker:eg}=r;$=bs(h,{base64Encoder:g,bodyLengthChecker:eg,checksumLocationName:q,checksumAlgorithmFn:Mr,streamHasher:S}),Z={...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 Z["content-length"]}else if(!jm(q,m)){const bs=await Os(Mr,h);Z={...m,[q]:g(bs)}}}return await e({...l,request:{...a,headers:Z,body:$}})};var qs=(r=[])=>{const s=[];for(let e of qm){if(!r.includes(e)||!Yr.includes(e))continue;s.push(e)}return s};var xm=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const e=r.slice(s+1);if(!e.startsWith("0")){const f=parseInt(e,10);if(!isNaN(f)&&f>=1&&f<=1e4)return!0}}return!1};import{Transform as ZA} from"stream";function Mf(r){const s=new ZA;return s.push(r),s.push(null),s}var om=async(r,{streamHasher:s,checksumAlgorithmFn:e,base64Encoder:f})=>{const l=yr(r)?s(e,r):Os(e,r);return f(await l)};var nm=async(r,{config:s,responseAlgorithms:e})=>{const f=qs(e),{body:l,headers:a}=r;for(let h of f){const m=$r(h),g=a[m];if(g){const S=Ys(h,s),{streamHasher:d,base64Encoder:k}=s,P=await om(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 pm={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},um=(r,s)=>(e,f)=>async(l)=>{if(!K.isInstance(l.request))return e(l);const a=l.input,h=await e(l),m=h.response;let g=void 0;const{requestValidationModeMember:S,responseAlgorithms:d}=s;if(S&&a[S]==="ENABLED"){const{clientName:k,commandName:P}=f;if(k==="S3Client"&&P==="GetObjectCommand"&&qs(d).every((Z)=>{const Or=$r(Z),q=m.headers[Or];return!q||xm(q)}))return h;const $=yr(m.body);if($)g=await r.streamCollector(m.body),m.body=Mf(g);if(await nm(h.response,{config:r,responseAlgorithms:d}),$&&g)m.body=Mf(g)}return h};var _s=(r,s)=>({applyToStack:(e)=>{e.add(bm(r,s),im),e.addRelativeTo(um(r,s),pm)}});class Uf extends Er.classBuilder().ep({...Sr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[kr(e,this.serialize,this.deserialize),Pr(e,r.getEndpointParameterInstructions()),_s(e,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Bs(e),Kf(e)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(va,Wa).ser(pa).de(rh).build(){}class Tf extends Er.classBuilder().ep({...Sr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,f){return[kr(e,this.serialize,this.deserialize),Pr(e,r.getEndpointParameterInstructions()),_s(e,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),zf(e),fs(e),Bs(e)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(Qa,Za).ser(ua).de(sh).build(){}import{Buffer as tm} from"buffer";class rg extends fr{client;constructor(...r){super();this.client=new Df(...r)}async put(r){let s,e,f,l=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,f=`${qr()}.${r.type.split("/")[1].split(";")[0]}`,e=r.type;else s=r.body,f=r.name,e=r.contentType;e=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof tm?s:tm.from(await s.arrayBuffer());return await this.client.send(new Tf({Bucket:l,Key:f,Body:a,ContentType:e})),f}async fetch(r){let s=process.env.BUCKET_NAME,e;if(typeof r==="string")e=r;else s=r.bucket??s,e=r.name;if(!e)throw new Error("Object name has to be specified");const f=await this.client.send(new Uf({Bucket:s,Key:e}));return new Response(f.Body.transformToWebStream(),{headers:{"Content-Type":f.ContentType,"Content-Length":f.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":f.LastModified?.toUTCString()||"",ETag:f.ETag||""}})}}class js{}class is extends js{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const e=this.requests.get(r),f=Date.now();if(f-e.date>=60000)this.requests.set(r,{date:f,count:1});else this.requests.set(r,{date:e.date,count:e.count+1})}return this.requests.get(r).count}}class sg{driver=new is}export{rg as S3Driver,sg as RateLimiterServiceProvider,js as RateLimiterDriver,is as InMemoryRateLimiter,_r as FileSystemDriver,cf as FileStorageServiceProvider,fr as FileStorageDriver};export{cf as t,sg as u};
|
|
2
|
+
import"../chunk-bfc01c0e40e4551c.js";import{A as Z} from"../chunk-e3d242546d1a2927.js";import{E as dl,F as Sd} from"../chunk-fcaf4626e5fe5d26.js";import{K as _w} from"../chunk-3bb296632dccdb02.js";import{$ as Mh,L as Jr,M as jh,N as ih,O as bh,P as xh,Q as _m,R as p,S as u,T as Bs,U as yr,V as Jf,W as nh,X as Lf,Y as Zf,Z as Xf,_ as ph,aa as Uh,ba as vh,ca as Ch,da as uh,ea as th,fa as Hf,ga as kr,ha as Pr,ia as rm,ja as zh,ka as Fh,la as sm,ma as Gh,na as em,oa as ur,pa as Kh,qa as Ms,ra as Wh,sa as Vh,ta as Oh,ua as _h} from"../chunk-9b2a6bd400c9c6c7.js";import{$a as ga,Aa as oh,Ba as wm,Ea as Rh,Fa as Ah,Ga as Ts,Ha as kh,Ia as Ph,Ja as Ih,La as Dh,Ma as Th,Na as sh,Oa as Eh,Pa as Gl,Qa as Kl,Ra as ha,Sa as Ar,Ta as Y,Va as ds,Ya as dr,Za as ma,_a as Sr,ab as ws,bb as vr,db as Ge,eb as Tr,fb as jf,gb as O,hb as wa,ib as ch,jb as yh,kb as Bh,lb as Yh,nb as v,pb as da,va as Hh,wa as Qh,xa as L,ya as Br,za as Qr} from"../chunk-611480789c8b04f4.js";import{rb as qm} from"../chunk-ed4022c20775d58f.js";import{sb as i,tb as Nh} from"../chunk-1488c30be491de9b.js";import"../chunk-9ca526226958d45c.js";import{vb as Lh} from"../chunk-584b2ebaffb0c907.js";import"../chunk-827fe74e5b55863c.js";class er{}class Hr extends er{r;constructor(r=`${process.env.ROOT_DIR}/storage`){super();this.folderPath=r}async put(r){let s,e;if(r instanceof Blob)s=r,e=`${Jr()}.${r.type.split("/")[1].split(";")[0]}`;else s=r.body,e=r.name;const l=s instanceof Buffer?s:Buffer.from(await s.arrayBuffer()),f=`${this.folderPath}/${e}`;return await Bun.write(f,l),e}async fetch(r){let s=process.env.BUCKET_NAME,e;if(typeof r==="string")e=r;else s=r.bucket??s,e=r.name;if(!e)throw new Error("Object name has to be specified");const l=`${this.folderPath}/${e}`,f=Bun.file(l),a=Bun.file(l).stream(),h=new Date(f.lastModified).toUTCString();return new Response(a,{headers:{"Content-Type":f.type,"Content-Length":String(f.size),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":h}})}}class Sl{driver=new Hr}function Wm(r){return(s)=>async(e)=>{const{request:l}=e;if(L.isInstance(l)&&l.body&&r.runtime==="node"){if(r.requestHandler?.constructor?.name!=="FetchHttpHandler")l.headers={...l.headers,Expect:"100-continue"}}return s({...e,request:l})}}var Vm={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},Rl=(r)=>({applyToStack:(s)=>{s.add(Wm(r),Vm)}});function Zm(){return(r,s)=>async(e)=>{const{request:l}=e;if(L.isInstance(l)){if(!(Lm in l.headers))if(typeof s?.logger?.warn==="function"&&!(s.logger instanceof Qr))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({...e})}}var Lm="content-length",Xm={step:"finalizeRequest",tags:["CHECK_CONTENT_LENGTH_HEADER"],name:"getCheckContentLengthHeaderPlugin",override:!0},Al=(r)=>({applyToStack:(s)=>{s.add(Zm(),Xm)}});var kl=(r)=>{return(s,e)=>async(l)=>{const f=await r.region(),a=r.region;let h=()=>{};if(e.__s3RegionRedirect)Object.defineProperty(r,"region",{writable:!1,value:async()=>{return e.__s3RegionRedirect}}),h=()=>Object.defineProperty(r,"region",{writable:!0,value:a});try{const m=await s(l);if(e.__s3RegionRedirect){h();const g=await r.region();if(f!==g)throw new Error("Region was not restored following S3 region redirect.")}return m}catch(m){throw h(),m}}},Pl={tags:["REGION_REDIRECT","S3"],name:"regionRedirectEndpointMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"};function Jm(r){return(s,e)=>async(l)=>{try{return await s(l)}catch(f){if(r.followRegionRedirects&&f?.$metadata?.httpStatusCode===301){try{const a=f.$response.headers["x-amz-bucket-region"];e.logger?.debug(`Redirecting from ${await r.region()} to ${a}`),e.__s3RegionRedirect=a}catch(a){throw new Error("Region redirect failed: "+a)}return s(l)}else throw f}}}var Hm={step:"initialize",tags:["REGION_REDIRECT","S3"],name:"regionRedirectMiddleware",override:!0},Il=(r)=>({applyToStack:(s)=>{s.add(Jm(r),Hm),s.addRelativeTo(kl(r),Pl)}});var Qm=(r)=>{return(s,e)=>async(l)=>{const f=await s(l),{response:a}=f;if(Br.isInstance(a)){if(a.headers.expires){a.headers.expiresstring=a.headers.expires;try{Tr(a.headers.expires)}catch(h){e.logger?.warn(`AWS SDK Warning for ${e.clientName}::${e.commandName} response parsing (${a.headers.expires}): ${h}`),delete a.headers.expires}}}return f}},Bm={tags:["S3"],name:"s3ExpiresMiddleware",override:!0,relation:"after",toMiddleware:"deserializerMiddleware"},El=(r)=>({applyToStack:(s)=>{s.addRelativeTo(Qm(r),Bm)}});class lr{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+lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS>r)return;for(let s in this.data){const e=this.data[s];if(!e.isRefreshing){const l=await e.identity;if(l.expiration){if(l.expiration.getTime()<r)delete this.data[s]}}}}}lr.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS=30000;class fr{constructor(r,s=!1,e=Date.now()){this._identity=r,this.isRefreshing=s,this.accessed=e}get identity(){return this.accessed=Date.now(),this._identity}}class ar{constructor(r,s=new lr){this.createSessionFn=r,this.cache=s}async getS3ExpressIdentity(r,s){const e=s.Bucket,{cache:l}=this,f=l.get(e);if(f)return f.identity.then((a)=>{if((a.expiration?.getTime()??0)<Date.now())return l.set(e,new fr(this.getIdentity(e))).identity;if((a.expiration?.getTime()??0)<Date.now()+ar.REFRESH_WINDOW_MS&&!f.isRefreshing)f.isRefreshing=!0,this.getIdentity(e).then((g)=>{l.set(e,new fr(Promise.resolve(g)))});return a});return l.set(e,new fr(this.getIdentity(e))).identity}async getIdentity(r){await this.cache.purgeExpired().catch((l)=>{console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n"+l)});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}}}ar.REFRESH_WINDOW_MS=60000;var yl=Z(_m(),1);var Nl="Directory",$l="S3Express",Dl="sigv4-s3express",Yr="X-Amz-S3session-Token",cr=Yr.toLowerCase(),Ym="AWS_S3_DISABLE_EXPRESS_SESSION_AUTH",Om="s3_disable_express_session_auth",Hs={environmentVariableSelector:(r)=>p(r,Ym,u.ENV),configFileSelector:(r)=>p(r,Om,u.CONFIG),default:!1};var Tl=function(r){return{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,expiration:r.expiration}},cl=function(r,s){const e=setTimeout(()=>{throw new Error("SignatureV4S3Express credential override was created but not called.")},10),l=r.credentialProvider,f=()=>{return clearTimeout(e),r.credentialProvider=l,Promise.resolve(s)};r.credentialProvider=f};class Or extends yl.SignatureV4{async signWithCredentials(r,s,e){const l=Tl(s);r.headers[cr]=s.sessionToken;const f=this;return cl(f,l),f.signRequest(r,e??{})}async presignWithCredentials(r,s,e){const l=Tl(s);return delete r.headers[cr],r.headers[Yr]=s.sessionToken,r.query=r.query??{},r.query[Yr]=s.sessionToken,cl(this,l),this.presign(r,e)}}var Ml=(r)=>{return(s,e)=>async(l)=>{if(e.endpointV2){const f=e.endpointV2,a=f.properties?.authSchemes?.[0]?.name===Dl;if(f.properties?.backend===$l||f.properties?.bucketType===Nl)e.isS3ExpressBucket=!0;if(a){const m=l.input.Bucket;if(m){const g=await r.s3ExpressIdentityProvider.getS3ExpressIdentity(await r.credentials(),{Bucket:m});if(e.s3ExpressIdentity=g,L.isInstance(l.request)&&g.sessionToken)l.request.headers[cr]=g.sessionToken}}}return s(l)}},Ul={name:"s3ExpressMiddleware",step:"build",tags:["S3","S3_EXPRESS"],override:!0},Qs=(r)=>({applyToStack:(s)=>{s.add(Ml(r),Ul)}});var Cl=Z(Bs(),1);var jm=Z(qm(),1);var vl=async(r,s,e,l)=>{const f=await l.signWithCredentials(e,r,{});if(f.headers["X-Amz-Security-Token"]||f.headers["x-amz-security-token"])throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");return f};var im=(r)=>(s)=>{throw s},bm=(r,s)=>{};var zl=(r)=>(s,e)=>async(l)=>{if(!L.isInstance(l.request))return s(l);const a=yr(e).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:h={}},identity:m,signer:g}=a;let k;if(e.s3ExpressIdentity)k=await vl(e.s3ExpressIdentity,h,l.request,await r.signer());else k=await g.sign(l.request,m,h);const N=await s({...l,request:k}).catch((g.errorHandler||im)(h));return(g.successHandler||bm)(N.response,h),N},Ys=(r)=>({applyToStack:(s)=>{s.addRelativeTo(zl(r),Cl.httpSigningMiddlewareOptions)}});var Fl=(r,{session:s})=>{const[e,l]=s;return{...r,forcePathStyle:r.forcePathStyle??!1,useAccelerateEndpoint:r.useAccelerateEndpoint??!1,disableMultiregionAccessPoints:r.disableMultiregionAccessPoints??!1,followRegionRedirects:r.followRegionRedirects??!1,s3ExpressIdentityProvider:r.s3ExpressIdentityProvider??new ar(async(f)=>e().send(new l({Bucket:f,SessionMode:"ReadWrite"}))),bucketEndpoint:r.bucketEndpoint??!1}};var xm={CopyObjectCommand:!0,UploadPartCopyCommand:!0,CompleteMultipartUploadCommand:!0},om=3000,nm=(r)=>(s,e)=>async(l)=>{const f=await s(l),{response:a}=f;if(!Br.isInstance(a))return f;const{statusCode:h,body:m}=a;if(h<200||h>=300)return f;let g=m,k=m;if(m&&typeof m==="object"&&!(m instanceof Uint8Array))[g,k]=await Gl(m);a.body=k;const N=await pm(g,{streamCollector:async($)=>{return Kl($,om)}});if(typeof g?.destroy==="function")g.destroy();const D=r.utf8Encoder(N.subarray(N.length-16));if(N.length===0&&xm[e.commandName]){const $=new Error("S3 aborted request");throw $.name="InternalError",$}if(D&&D.endsWith("</Error>"))a.statusCode=400;return f},pm=(r=new Uint8Array,s)=>{if(r instanceof Uint8Array)return Promise.resolve(r);return s.streamCollector(r)||Promise.resolve(new Uint8Array)},um={relation:"after",toMiddleware:"deserializerMiddleware",tags:["THROW_200_EXCEPTIONS","S3"],name:"throw200ExceptionsMiddleware",override:!0},_r=(r)=>({applyToStack:(s)=>{s.addRelativeTo(nm(r),um)}});var Os=(r)=>typeof r==="string"&&r.indexOf("arn:")===0&&r.split(":").length>=6;function Wl(r){return(s,e)=>async(l)=>{if(r.bucketEndpoint){const f=e.endpointV2;if(f){const a=l.input.Bucket;if(typeof a==="string")try{const h=new URL(a);f.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(e.logger?.constructor?.name==="NoOpLogger")console.warn(m);else e.logger?.warn?.(m);throw h}}}return s(l)}}var Vl={name:"bucketEndpointMiddleware",override:!0,relation:"after",toMiddleware:"endpointV2Middleware"};function tm({bucketEndpoint:r}){return(s)=>async(e)=>{const{input:{Bucket:l}}=e;if(!r&&typeof l==="string"&&!Os(l)&&l.indexOf("/")>=0){const f=new Error(`Bucket name shouldn't contain '/', received '${l}'`);throw f.name="InvalidBucketName",f}return s({...e})}}var rg={step:"initialize",tags:["VALIDATE_BUCKET_NAME"],name:"validateBucketNameMiddleware",override:!0},Ll=(r)=>({applyToStack:(s)=>{s.add(tm(r),rg),s.addRelativeTo(Wl(r),Vl)}});var Er=Z(Bs(),1);var Zl=(r)=>({...r,eventStreamMarshaller:r.eventStreamSerdeProvider(r)});var tr=Z(ur(),1);var qr={CrtSignerV4:null};class _s{constructor(r){this.sigv4Signer=new Or(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,e={}){if(e.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,e)}return this.sigv4Signer.signWithCredentials(r,s,e)}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,e={}){if(e.signingRegion==="*")throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(r,s,e)}getSigv4aSigner(){if(!this.sigv4aSigner){let r=null;try{if(r=qr.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={["required"]:!1,["type"]:"String"},mr={["required"]:!0,default:!1,["type"]:"Boolean"},Mr={["required"]:!1,["type"]:"Boolean"},B={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!0]},E={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},I={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},y={["fn"]:"isSet",["argv"]:[{["ref"]:"Endpoint"}]},vf={["fn"]:"aws.partition",["argv"]:[{["ref"]:"Region"}],["assign"]:"partitionResult"},Xl={["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]},"aws-cn"]},or={["fn"]:"isSet",["argv"]:[{["ref"]:"Bucket"}]},K={["ref"]:"Bucket"},G={["fn"]:"parseURL",["argv"]:[{["ref"]:"Endpoint"}],["assign"]:"url"},xr={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[{["ref"]:"url"},"isIp"]},!0]},Cf={["ref"]:"url"},zf={["fn"]:"uriEncode",["argv"]:[K],["assign"]:"uri_encoded_bucket"},q={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},w={},Ff={["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[K,!1]},qs={["error"]:"S3Express bucket name is not a valid virtual hostable name.",["type"]:"error"},nr={["backend"]:"S3Express",["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4-s3express",["signingName"]:"s3express",["signingRegion"]:"{Region}"}]},Jl={["fn"]:"isSet",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"}]},Hl={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseS3ExpressControlEndpoint"},!0]},d={["fn"]:"not",["argv"]:[y]},Ql={["error"]:"Unrecognized S3Express bucket name format.",["type"]:"error"},Bl={["fn"]:"not",["argv"]:[or]},Yl={["ref"]:"hardwareType"},Ol={["conditions"]:[d],["error"]:"Expected a endpoint to be specified but no endpoint was found",["type"]:"error"},jr={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{Region}"}]},js={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"ForcePathStyle"},!1]},sg={["ref"]:"ForcePathStyle"},c={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"Accelerate"},!1]},U={["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"aws-global"]},C={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"us-east-1"}]},A={["fn"]:"not",["argv"]:[U]},z={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},_l={["url"]:"https://{Bucket}.s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:{["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},["headers"]:{}},M={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{Region}"}]},F={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!1]},R={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!1]},ql={["url"]:"https://{Bucket}.s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},S={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!1]},jl={["url"]:"https://{Bucket}.s3-accelerate.dualstack.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},il={["url"]:"https://{Bucket}.s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},is={["fn"]:"booleanEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Cf,"isIp"]},!1]},bs={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:M,["headers"]:{}},Ae={["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:M,["headers"]:{}},bl={["endpoint"]:Ae,["type"]:"endpoint"},xs={["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},xl={["url"]:"https://{Bucket}.s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},ir={["error"]:"Invalid region: region was not a valid DNS name.",["type"]:"error"},V={["ref"]:"bucketArn"},Gf={["ref"]:"arnType"},os={["fn"]:"getAttr",["argv"]:[V,"service"]},ke={["ref"]:"accessPointName"},ol={["conditions"]:[I],["error"]:"S3 Object Lambda does not support Dual-stack",["type"]:"error"},nl={["conditions"]:[B],["error"]:"S3 Object Lambda does not support S3 Accelerate",["type"]:"error"},pl={["conditions"]:[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableAccessPoints"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableAccessPoints"},!0]}],["error"]:"Access points are not supported for this operation",["type"]:"error"},ns={["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"},Kf={["fn"]:"getAttr",["argv"]:[{["ref"]:"bucketPartition"},"name"]},Wf={["fn"]:"getAttr",["argv"]:[V,"accountId"]},ps={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{bucketArn#region}"}]},ul={["error"]:"Invalid ARN: The access point name may only contain a-z, A-Z, 0-9 and `-`. Found: `{accessPointName}`",["type"]:"error"},us={["error"]:"Invalid ARN: The account id may only contain a-z, A-Z, 0-9 and `-`. Found: `{bucketArn#accountId}`",["type"]:"error"},ts={["error"]:"Invalid region in ARN: `{bucketArn#region}` (invalid DNS name)",["type"]:"error"},re={["error"]:"Client was configured for partition `{partitionResult#name}` but ARN (`{Bucket}`) has `{bucketPartition#name}`",["type"]:"error"},tl={["error"]:"Invalid ARN: The ARN may only contain a single resource component after `accesspoint`.",["type"]:"error"},rf={["error"]:"Invalid ARN: Expected a resource of the format `accesspoint:<accesspoint name>` but no name was provided",["type"]:"error"},Ur={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3",["signingRegion"]:"{bucketArn#region}"}]},sf={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4a",["signingName"]:"s3-outposts",["signingRegionSet"]:["*"]},{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-outposts",["signingRegion"]:"{bucketArn#region}"}]},ef={["fn"]:"aws.parseArn",["argv"]:[K]},lf={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:M,["headers"]:{}},ff={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:M,["headers"]:{}},af={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:M,["headers"]:{}},se={["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:M,["headers"]:{}},hf={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:M,["headers"]:{}},mf={["ref"]:"UseObjectLambdaEndpoint"},ee={["authSchemes"]:[{["disableDoubleEncoding"]:!0,["name"]:"sigv4",["signingName"]:"s3-object-lambda",["signingRegion"]:"{Region}"}]},gf={["url"]:"https://s3-fips.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},wf={["url"]:"https://s3-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},df={["url"]:"https://s3.dualstack.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},le={["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:M,["headers"]:{}},Sf={["url"]:"https://s3.{Region}.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:{}},fe=[{["ref"]:"Region"}],eg=[{["ref"]:"Endpoint"}],lg=[K],ae=[I],br=[B],t=[y,G],Rf=[{["fn"]:"isSet",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"}]},{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"DisableS3ExpressSessionAuth"},!0]}],Af=[xr],he=[zf],me=[Ff],gr=[E],kf=[{["fn"]:"substring",["argv"]:[K,6,14,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[K,14,16,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Pf=[{["conditions"]:[E],["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"}],If=[{["fn"]:"substring",["argv"]:[K,6,15,!0],["assign"]:"s3expressAvailabilityZoneId"},{["fn"]:"substring",["argv"]:[K,15,17,!0],["assign"]:"s3expressAvailabilityZoneDelim"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"s3expressAvailabilityZoneDelim"},"--"]}],Ef=[{["conditions"]:[E],["endpoint"]:{["url"]:"https://{Bucket}.s3express-fips-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:nr,["headers"]:{}},["type"]:"endpoint"},{["endpoint"]:{["url"]:"https://{Bucket}.s3express-{s3expressAvailabilityZoneId}.{Region}.amazonaws.com",["properties"]:nr,["headers"]:{}},["type"]:"endpoint"}],fg=[or],Nf=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"outpostId"},!1]}],$f=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"regionPrefix"},"beta"]}],ag=["*"],b=[vf],Df=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!1]}],x=[{["fn"]:"stringEquals",["argv"]:[{["ref"]:"Region"},"us-east-1"]}],ge=[{["fn"]:"stringEquals",["argv"]:[Gf,"accesspoint"]}],Tf=[{["fn"]:"getAttr",["argv"]:[V,"resourceId[1]"],["assign"]:"accessPointName"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[ke,""]}]}],hg=[V,"resourceId[1]"],we=[{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},""]}]}],cf=[{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[2]"]}]}]}],mg=[V,"resourceId[2]"],de=[{["fn"]:"aws.partition",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]}],["assign"]:"bucketPartition"}],yf=[{["fn"]:"stringEquals",["argv"]:[Kf,{["fn"]:"getAttr",["argv"]:[{["ref"]:"partitionResult"},"name"]}]}],Se=[{["fn"]:"isValidHostLabel",["argv"]:[{["fn"]:"getAttr",["argv"]:[V,"region"]},!0]}],Re=[{["fn"]:"isValidHostLabel",["argv"]:[Wf,!1]}],Mf=[{["fn"]:"isValidHostLabel",["argv"]:[ke,!1]}],Uf=[{["fn"]:"isValidHostLabel",["argv"]:[{["ref"]:"Region"},!0]}],gg={version:"1.0",parameters:{Bucket:hr,Region:hr,UseFIPS:mr,UseDualStack:mr,Endpoint:hr,ForcePathStyle:mr,Accelerate:mr,UseGlobalEndpoint:mr,UseObjectLambdaEndpoint:Mr,Key:hr,Prefix:hr,CopySource:hr,DisableAccessPoints:Mr,DisableMultiRegionAccessPoints:mr,UseArnRegion:Mr,UseS3ExpressControlEndpoint:Mr,DisableS3ExpressSessionAuth:Mr},rules:[{["conditions"]:[{["fn"]:"isSet",["argv"]:fe}],rules:[{["conditions"]:[B,E],error:"Accelerate cannot be used with FIPS",["type"]:"error"},{["conditions"]:[I,y],error:"Cannot set dual-stack in combination with a custom endpoint.",["type"]:"error"},{["conditions"]:[y,E],error:"A custom endpoint cannot be combined with FIPS",["type"]:"error"},{["conditions"]:[y,B],error:"A custom endpoint cannot be combined with S3 Accelerate",["type"]:"error"},{["conditions"]:[E,vf,Xl],error:"Partition does not support FIPS",["type"]:"error"},{["conditions"]:[or,{["fn"]:"substring",["argv"]:[K,0,6,!0],["assign"]:"bucketSuffix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketSuffix"},"--x-s3"]}],rules:[{["conditions"]:ae,error:"S3Express does not support Dual-stack.",["type"]:"error"},{["conditions"]:br,error:"S3Express does not support S3 Accelerate.",["type"]:"error"},{["conditions"]:t,rules:[{["conditions"]:Rf,rules:[{["conditions"]:Af,rules:[{["conditions"]:he,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:me,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:q,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},qs],["type"]:"tree"},{["conditions"]:Af,rules:[{["conditions"]:he,rules:[{endpoint:{["url"]:"{url#scheme}://{url#authority}/{uri_encoded_bucket}{url#path}",["properties"]:nr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:me,rules:[{endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:nr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},qs],["type"]:"tree"},{["conditions"]:[Jl,Hl],rules:[{["conditions"]:[zf,d],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"]:me,rules:[{["conditions"]:Rf,rules:[{["conditions"]:kf,rules:Pf,["type"]:"tree"},{["conditions"]:If,rules:Pf,["type"]:"tree"},Ql],["type"]:"tree"},{["conditions"]:kf,rules:Ef,["type"]:"tree"},{["conditions"]:If,rules:Ef,["type"]:"tree"},Ql],["type"]:"tree"},qs],["type"]:"tree"},{["conditions"]:[Bl,Jl,Hl],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"]:[or,{["fn"]:"substring",["argv"]:[K,49,50,!0],["assign"]:"hardwareType"},{["fn"]:"substring",["argv"]:[K,8,12,!0],["assign"]:"regionPrefix"},{["fn"]:"substring",["argv"]:[K,0,7,!0],["assign"]:"bucketAliasSuffix"},{["fn"]:"substring",["argv"]:[K,32,49,!0],["assign"]:"outpostId"},{["fn"]:"aws.partition",["argv"]:fe,["assign"]:"regionPartition"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"bucketAliasSuffix"},"--op-s3"]}],rules:[{["conditions"]:Nf,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Yl,"e"]}],rules:[{["conditions"]:$f,rules:[Ol,{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.ec2.{url#authority}",["properties"]:jr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.ec2.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:jr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Yl,"o"]}],rules:[{["conditions"]:$f,rules:[Ol,{["conditions"]:t,endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.{url#authority}",["properties"]:jr,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},{endpoint:{["url"]:"https://{Bucket}.op-{outpostId}.s3-outposts.{Region}.{regionPartition#dnsSuffix}",["properties"]:jr,["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"]:fg,rules:[{["conditions"]:[y,{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[{["fn"]:"parseURL",["argv"]:eg}]}]}],error:"Custom endpoint `{Endpoint}` was not a valid URI",["type"]:"error"},{["conditions"]:[js,Ff],rules:[{["conditions"]:b,rules:[{["conditions"]:Df,rules:[{["conditions"]:[B,Xl],error:"S3 Accelerate cannot be used in this region",["type"]:"error"},{["conditions"]:[I,E,c,d,U],endpoint:{["url"]:"https://{Bucket}.s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,E,c,d,A,z],rules:[{endpoint:_l,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,E,c,d,A,F],endpoint:_l,["type"]:"endpoint"},{["conditions"]:[R,E,c,d,U],endpoint:{["url"]:"https://{Bucket}.s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,E,c,d,A,z],rules:[{endpoint:ql,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,E,c,d,A,F],endpoint:ql,["type"]:"endpoint"},{["conditions"]:[I,S,B,d,U],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,S,B,d,A,z],rules:[{endpoint:jl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,S,B,d,A,F],endpoint:jl,["type"]:"endpoint"},{["conditions"]:[I,S,c,d,U],endpoint:{["url"]:"https://{Bucket}.s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,S,c,d,A,z],rules:[{endpoint:il,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,S,c,d,A,F],endpoint:il,["type"]:"endpoint"},{["conditions"]:[R,S,c,y,G,xr,U],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{Bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,S,c,y,G,is,U],endpoint:{["url"]:"{url#scheme}://{Bucket}.{url#authority}{url#path}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,S,c,y,G,xr,A,z],rules:[{["conditions"]:x,endpoint:bs,["type"]:"endpoint"},{endpoint:bs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,c,y,G,is,A,z],rules:[{["conditions"]:x,endpoint:Ae,["type"]:"endpoint"},bl],["type"]:"tree"},{["conditions"]:[R,S,c,y,G,xr,A,F],endpoint:bs,["type"]:"endpoint"},{["conditions"]:[R,S,c,y,G,is,A,F],endpoint:Ae,["type"]:"endpoint"},{["conditions"]:[R,S,B,d,U],endpoint:{["url"]:"https://{Bucket}.s3-accelerate.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,S,B,d,A,z],rules:[{["conditions"]:x,endpoint:xs,["type"]:"endpoint"},{endpoint:xs,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,B,d,A,F],endpoint:xs,["type"]:"endpoint"},{["conditions"]:[R,S,c,d,U],endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,S,c,d,A,z],rules:[{["conditions"]:x,endpoint:{["url"]:"https://{Bucket}.s3.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:w},["type"]:"endpoint"},{endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,S,c,d,A,F],endpoint:xl,["type"]:"endpoint"}],["type"]:"tree"},ir],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[y,G,{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Cf,"scheme"]},"http"]},{["fn"]:"aws.isVirtualHostableS3Bucket",["argv"]:[K,!0]},js,S,R,c],rules:[{["conditions"]:b,rules:[{["conditions"]:Df,rules:[bl],["type"]:"tree"},ir],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[js,{["fn"]:"aws.parseArn",["argv"]:lg,["assign"]:"bucketArn"}],rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:[V,"resourceId[0]"],["assign"]:"arnType"},{["fn"]:"not",["argv"]:[{["fn"]:"stringEquals",["argv"]:[Gf,""]}]}],rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[os,"s3-object-lambda"]}],rules:[{["conditions"]:ge,rules:[{["conditions"]:Tf,rules:[ol,nl,{["conditions"]:we,rules:[pl,{["conditions"]:cf,rules:[ns,{["conditions"]:de,rules:[{["conditions"]:b,rules:[{["conditions"]:yf,rules:[{["conditions"]:Se,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Wf,""]}],error:"Invalid ARN: Missing account id",["type"]:"error"},{["conditions"]:Re,rules:[{["conditions"]:Mf,rules:[{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:ps,["headers"]:w},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:ps,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-object-lambda.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:ps,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ul],["type"]:"tree"},us],["type"]:"tree"},ts],["type"]:"tree"},re],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},tl],["type"]:"tree"},{error:"Invalid ARN: bucket ARN is missing a region",["type"]:"error"}],["type"]:"tree"},rf],["type"]:"tree"},{error:"Invalid ARN: Object Lambda ARNs only support `accesspoint` arn types, but found: `{arnType}`",["type"]:"error"}],["type"]:"tree"},{["conditions"]:ge,rules:[{["conditions"]:Tf,rules:[{["conditions"]:we,rules:[{["conditions"]:ge,rules:[{["conditions"]:we,rules:[pl,{["conditions"]:cf,rules:[ns,{["conditions"]:de,rules:[{["conditions"]:b,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[Kf,"{partitionResult#name}"]}],rules:[{["conditions"]:Se,rules:[{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[os,"s3"]}],rules:[{["conditions"]:Re,rules:[{["conditions"]:Mf,rules:[{["conditions"]:br,error:"Access Points do not support S3 Accelerate",["type"]:"error"},{["conditions"]:[E,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ur,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[E,R],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint-fips.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ur,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,I],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.dualstack.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ur,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,R,y,G],endpoint:{["url"]:"{url#scheme}://{accessPointName}-{bucketArn#accountId}.{url#authority}{url#path}",["properties"]:Ur,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,R],endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.s3-accesspoint.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:Ur,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ul],["type"]:"tree"},us],["type"]:"tree"},{error:"Invalid ARN: The ARN was not for the S3 service, found: {bucketArn#service}",["type"]:"error"}],["type"]:"tree"},ts],["type"]:"tree"},re],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},tl],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[{["fn"]:"isValidHostLabel",["argv"]:[ke,!0]}],rules:[{["conditions"]:ae,error:"S3 MRAP does not support dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 MRAP does not support FIPS",["type"]:"error"},{["conditions"]:br,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"]:fe,["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"]:ag}]},["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"},rf],["type"]:"tree"},{["conditions"]:[{["fn"]:"stringEquals",["argv"]:[os,"s3-outposts"]}],rules:[{["conditions"]:ae,error:"S3 Outposts does not support Dual-stack",["type"]:"error"},{["conditions"]:gr,error:"S3 Outposts does not support FIPS",["type"]:"error"},{["conditions"]:br,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"]:hg,["assign"]:"outpostId"}],rules:[{["conditions"]:Nf,rules:[ns,{["conditions"]:de,rules:[{["conditions"]:b,rules:[{["conditions"]:yf,rules:[{["conditions"]:Se,rules:[{["conditions"]:Re,rules:[{["conditions"]:[{["fn"]:"getAttr",["argv"]:mg,["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"]:sf,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://{accessPointName}-{bucketArn#accountId}.{outpostId}.s3-outposts.{bucketArn#region}.{bucketPartition#dnsSuffix}",["properties"]:sf,["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"},us],["type"]:"tree"},ts],["type"]:"tree"},re],["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"]:[K,0,4,!1],["assign"]:"arnPrefix"},{["fn"]:"stringEquals",["argv"]:[{["ref"]:"arnPrefix"},"arn:"]},{["fn"]:"not",["argv"]:[{["fn"]:"isSet",["argv"]:[ef]}]}],error:"Invalid ARN: `{Bucket}` was not a valid ARN",["type"]:"error"},{["conditions"]:[{["fn"]:"booleanEquals",["argv"]:[sg,!0]},ef],error:"Path-style addressing cannot be used with ARN buckets",["type"]:"error"},{["conditions"]:he,rules:[{["conditions"]:b,rules:[{["conditions"]:[c],rules:[{["conditions"]:[I,d,E,U],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,d,E,A,z],rules:[{endpoint:lf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,d,E,A,F],endpoint:lf,["type"]:"endpoint"},{["conditions"]:[R,d,E,U],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,d,E,A,z],rules:[{endpoint:ff,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,d,E,A,F],endpoint:ff,["type"]:"endpoint"},{["conditions"]:[I,d,S,U],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[I,d,S,A,z],rules:[{endpoint:af,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[I,d,S,A,F],endpoint:af,["type"]:"endpoint"},{["conditions"]:[R,y,G,S,U],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#normalizedPath}{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,y,G,S,A,z],rules:[{["conditions"]:x,endpoint:se,["type"]:"endpoint"},{endpoint:se,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,y,G,S,A,F],endpoint:se,["type"]:"endpoint"},{["conditions"]:[R,d,S,U],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[R,d,S,A,z],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}/{uri_encoded_bucket}",["properties"]:M,["headers"]:w},["type"]:"endpoint"},{endpoint:hf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[R,d,S,A,F],endpoint:hf,["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"]:[mf]},{["fn"]:"booleanEquals",["argv"]:[mf,!0]}],rules:[{["conditions"]:b,rules:[{["conditions"]:Uf,rules:[ol,nl,{["conditions"]:t,endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:ee,["headers"]:w},["type"]:"endpoint"},{["conditions"]:gr,endpoint:{["url"]:"https://s3-object-lambda-fips.{Region}.{partitionResult#dnsSuffix}",["properties"]:ee,["headers"]:w},["type"]:"endpoint"},{endpoint:{["url"]:"https://s3-object-lambda.{Region}.{partitionResult#dnsSuffix}",["properties"]:ee,["headers"]:w},["type"]:"endpoint"}],["type"]:"tree"},ir],["type"]:"tree"}],["type"]:"tree"},{["conditions"]:[Bl],rules:[{["conditions"]:b,rules:[{["conditions"]:Uf,rules:[{["conditions"]:[E,I,d,U],endpoint:{["url"]:"https://s3-fips.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[E,I,d,A,z],rules:[{endpoint:gf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[E,I,d,A,F],endpoint:gf,["type"]:"endpoint"},{["conditions"]:[E,R,d,U],endpoint:{["url"]:"https://s3-fips.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[E,R,d,A,z],rules:[{endpoint:wf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[E,R,d,A,F],endpoint:wf,["type"]:"endpoint"},{["conditions"]:[S,I,d,U],endpoint:{["url"]:"https://s3.dualstack.us-east-1.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,I,d,A,z],rules:[{endpoint:df,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,I,d,A,F],endpoint:df,["type"]:"endpoint"},{["conditions"]:[S,R,y,G,U],endpoint:{["url"]:"{url#scheme}://{url#authority}{url#path}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,R,y,G,A,z],rules:[{["conditions"]:x,endpoint:le,["type"]:"endpoint"},{endpoint:le,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,y,G,A,F],endpoint:le,["type"]:"endpoint"},{["conditions"]:[S,R,d,U],endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:C,["headers"]:w},["type"]:"endpoint"},{["conditions"]:[S,R,d,A,z],rules:[{["conditions"]:x,endpoint:{["url"]:"https://s3.{partitionResult#dnsSuffix}",["properties"]:M,["headers"]:w},["type"]:"endpoint"},{endpoint:Sf,["type"]:"endpoint"}],["type"]:"tree"},{["conditions"]:[S,R,d,A,F],endpoint:Sf,["type"]:"endpoint"}],["type"]:"tree"},ir],["type"]:"tree"}],["type"]:"tree"}],["type"]:"tree"},{error:"A region must be set when sending requests to S3.",["type"]:"error"}]},Vf=gg;var pr=(r,s={})=>{return Zf(Vf,{endpointParams:r,logger:s.logger})};Lf.aws=Xf;var Bf=function(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}},Yf=function(r){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"s3",region:r.region},propertiesExtractor:(s,e)=>({signingProperties:{config:s,context:e}})}},wg=(r)=>async(s,e,l)=>{if(!l)throw new Error("Could not find \`input\` for \`defaultEndpointRuleSetHttpAuthSchemeParametersProvider\`");const f=await r(s,e,l),a=yr(e)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!a)throw new Error(`getEndpointParameterInstructions() is not defined on \`${e.commandName}\``);const h=await Hf(l,{getEndpointParameterInstructions:a},s);return Object.assign(f,h)},dg=async(r,s,e)=>{return{operation:yr(s).operation,region:await Jf(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Qf=wg(dg),Sg=(r,s,e)=>{return(f)=>{const h=r(f).properties?.authSchemes;if(!h)return s(f);const m=[];for(let g of h){const{name:k,properties:N={},...D}=g,$=k.toLowerCase();if(k!==$)console.warn(`HttpAuthScheme has been normalized with lowercasing: \`${k}\` to \`${$}\``);let X;if($==="sigv4a"){X="aws.auth#sigv4a";const Xr=h.find((_)=>{const Dr=_.name.toLowerCase();return Dr!=="sigv4a"&&Dr.startsWith("sigv4")});if(!qr.CrtSignerV4&&Xr)continue}else if($.startsWith("sigv4"))X="aws.auth#sigv4";else throw new Error(`Unknown HttpAuthScheme found in \`@smithy.rules#endpointRuleSet\`: \`${$}\``);const J=e[X];if(!J)throw new Error(`Could not find HttpAuthOption create function for \`${X}\``);const Q=J(f);Q.schemeId=X,Q.signingProperties={...Q.signingProperties||{},...D,...N},m.push(Q)}return m}},Rg=(r)=>{const s=[];switch(r.operation){default:s.push(Bf(r)),s.push(Yf(r))}return s},Of=Sg(pr,Rg,{"aws.auth#sigv4":Bf,"aws.auth#sigv4a":Yf}),_f=(r)=>{const s=tr.resolveAwsSdkSigV4Config(r);return{...tr.resolveAwsSdkSigV4AConfig(s)}};var qf=(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 W extends jf{constructor(r){super(r);Object.setPrototypeOf(this,W.prototype)}}class rs extends W{constructor(r){super({name:"NoSuchUpload",$fault:"client",...r});this.name="NoSuchUpload",this.$fault="client",Object.setPrototypeOf(this,rs.prototype)}}class ss extends W{constructor(r){super({name:"ObjectNotInActiveTierError",$fault:"client",...r});this.name="ObjectNotInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,ss.prototype)}}class es extends W{constructor(r){super({name:"BucketAlreadyExists",$fault:"client",...r});this.name="BucketAlreadyExists",this.$fault="client",Object.setPrototypeOf(this,es.prototype)}}class ls extends W{constructor(r){super({name:"BucketAlreadyOwnedByYou",$fault:"client",...r});this.name="BucketAlreadyOwnedByYou",this.$fault="client",Object.setPrototypeOf(this,ls.prototype)}}class fs extends W{constructor(r){super({name:"NoSuchBucket",$fault:"client",...r});this.name="NoSuchBucket",this.$fault="client",Object.setPrototypeOf(this,fs.prototype)}}var Pe;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(Pe||(Pe={}));var Ie;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.ObjectSizeGreaterThan!==void 0)return e.ObjectSizeGreaterThan(s.ObjectSizeGreaterThan);if(s.ObjectSizeLessThan!==void 0)return e.ObjectSizeLessThan(s.ObjectSizeLessThan);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(Ie||(Ie={}));var Ee;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.AccessPointArn!==void 0)return e.AccessPointArn(s.AccessPointArn);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(Ee||(Ee={}));var Ne;(function(r){r.visit=(s,e)=>{if(s.Prefix!==void 0)return e.Prefix(s.Prefix);if(s.Tag!==void 0)return e.Tag(s.Tag);if(s.And!==void 0)return e.And(s.And);return e._(s.$unknown[0],s.$unknown[1])}})(Ne||(Ne={}));class as extends W{constructor(r){super({name:"InvalidObjectState",$fault:"client",...r});this.name="InvalidObjectState",this.$fault="client",Object.setPrototypeOf(this,as.prototype),this.StorageClass=r.StorageClass,this.AccessTier=r.AccessTier}}class hs extends W{constructor(r){super({name:"NoSuchKey",$fault:"client",...r});this.name="NoSuchKey",this.$fault="client",Object.setPrototypeOf(this,hs.prototype)}}class ms extends W{constructor(r){super({name:"NotFound",$fault:"client",...r});this.name="NotFound",this.$fault="client",Object.setPrototypeOf(this,ms.prototype)}}var Ag=(r)=>({...r,...r.SecretAccessKey&&{SecretAccessKey:Y},...r.SessionToken&&{SessionToken:Y}}),bf=(r)=>({...r,...r.Credentials&&{Credentials:Ag(r.Credentials)}});var xf=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Y}}),of=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Y}});var Rr=Z(ur(),1);var Rs=Z(Bs(),1);class gs extends W{constructor(r){super({name:"ObjectAlreadyInActiveTierError",$fault:"client",...r});this.name="ObjectAlreadyInActiveTierError",this.$fault="client",Object.setPrototypeOf(this,gs.prototype)}}var nf;(function(r){r.visit=(s,e)=>{if(s.Records!==void 0)return e.Records(s.Records);if(s.Stats!==void 0)return e.Stats(s.Stats);if(s.Progress!==void 0)return e.Progress(s.Progress);if(s.Cont!==void 0)return e.Cont(s.Cont);if(s.End!==void 0)return e.End(s.End);return e._(s.$unknown[0],s.$unknown[1])}})(nf||(nf={}));var pf=(r)=>({...r,...r.SSEKMSKeyId&&{SSEKMSKeyId:Y},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Y}}),uf=(r)=>({...r,...r.SSECustomerKey&&{SSECustomerKey:Y},...r.SSEKMSKeyId&&{SSEKMSKeyId:Y},...r.SSEKMSEncryptionContext&&{SSEKMSEncryptionContext:Y}});var Sa=async(r,s)=>{const e=Rs.requestBuilder(r,s),l=v({},j,{[cw]:r[tg]});e.bp("/"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1);const f=v({[Nw]:[,""]});let a;return e.m("GET").h(l).q(f).b(a),e.build()};var Ra=async(r,s)=>{const e=Rs.requestBuilder(r,s),l=v({},j,{[hw]:r[Hg],[mw]:[()=>j(r[tf]),()=>vr(r[tf]).toString()],[gw]:r[Qg],[ww]:[()=>j(r[ra]),()=>vr(r[ra]).toString()],[Sw]:r[qg],[Ps]:r[As],[ja]:r[za],[Is]:r[ks],[Oa]:r[Ca],[Ha]:r[ca],[Tw]:r[Fg]});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const f=v({[xa]:[,"GetObject"],[Rw]:[,r[jg]],[Aw]:[,r[ig]],[kw]:[,r[bg]],[Pw]:[,r[xg]],[Iw]:[,r[og]],[Ew]:[()=>r.ResponseExpires!==void 0,()=>vr(r[ng]).toString()],[$w]:[,r[He]],[dw]:[()=>r.PartNumber!==void 0,()=>r[_g].toString()]});let a;return e.m("GET").h(l).q(f).b(a),e.build()};var Aa=async(r,s)=>{const e=Rs.requestBuilder(r,s),l=v({},j,{[Za]:r[Ta]||"application/octet-stream",[Dw]:r[vg],[Ka]:r[Ea],[Wa]:r[Na],[Va]:r[$a],[La]:r[Da],[Ce]:[()=>j(r[Me]),()=>r[Me].toString()],[lw]:r[Gg],[Fw]:r[zg],[Qe]:r[We],[Be]:r[Ve],[Ye]:r[Le],[Oe]:r[Ze],[ze]:[()=>j(r[Ue]),()=>vr(r[Ue]).toString()],[yw]:r[Lg],[Mw]:r[Zg],[Uw]:r[Xg],[vw]:r[Jg],[_e]:r[Xe],[_a]:r[zr],[ba]:r[Ga],[Ps]:r[As],[ja]:r[za],[Is]:r[ks],[qe]:r[Je],[qa]:r[Fa],[Fr]:[()=>j(r[Ss]),()=>r[Ss].toString()],[Oa]:r[Ca],[Gw]:r[rw],[Ba]:r[Ua],[Fe]:[()=>j(r[ve]),()=>da(r[ve]).toString()],[Qa]:r[Ma],[Ha]:r[ca],...r.Metadata!==void 0&&Object.keys(r.Metadata).reduce((m,g)=>{return m[`x-amz-meta-${g.toLowerCase()}`]=r.Metadata[g],m},{})});e.bp("/{Key+}"),e.p("Bucket",()=>r.Bucket,"{Bucket}",!1),e.p("Key",()=>r.Key,"{Key+}",!0);const f=v({[xa]:[,"PutObject"]});let a,h;if(r.Body!==void 0)h=r.Body,a=h;return e.m("PUT").h(l).q(f).b(a),e.build()};var ka=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Ke(r,s);const e=v({$metadata:H(r)}),l=dr(ma(await Rr.parseXmlBody(r.body,s)),"body");if(l[Te]!=null)e[Te]=Ug(l[Te],s);return e};var Pa=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Ke(r,s);const e=v({$metadata:H(r),[Wg]:[()=>r.headers[ea]!==void 0,()=>ds(r.headers[ea])],[Cg]:[,r.headers[ew]],[Cr]:[,r.headers[Ja]],[ug]:[,r.headers[Cw]],[Bg]:[()=>r.headers[sa]!==void 0,()=>dr(Tr(r.headers[sa]))],[Me]:[()=>r.headers[Ce]!==void 0,()=>ga(r.headers[Ce])],[ya]:[,r.headers[Xa]],[We]:[,r.headers[Qe]],[Ve]:[,r.headers[Be]],[Le]:[,r.headers[Ye]],[Ze]:[,r.headers[Oe]],[Yg]:[()=>r.headers[la]!==void 0,()=>ws(r.headers[la])],[He]:[,r.headers[ia]],[Ea]:[,r.headers[Ka]],[Na]:[,r.headers[Wa]],[$a]:[,r.headers[Va]],[Da]:[,r.headers[La]],[Kg]:[,r.headers[fw]],[Ta]:[,r.headers[Za]],[Ue]:[()=>r.headers[ze]!==void 0,()=>dr(Tr(r.headers[ze]))],[Vg]:[,r.headers[aw]],[Ga]:[,r.headers[ba]],[Xe]:[,r.headers[_e]],[As]:[,r.headers[Ps]],[ks]:[,r.headers[Is]],[Je]:[,r.headers[qe]],[Ss]:[()=>r.headers[Fr]!==void 0,()=>ds(r.headers[Fr])],[zr]:[,r.headers[_a]],[va]:[,r.headers[Ya]],[pg]:[,r.headers[zw]],[Og]:[()=>r.headers[fa]!==void 0,()=>ws(r.headers[fa])],[sw]:[()=>r.headers[aa]!==void 0,()=>ws(r.headers[aa])],[Ua]:[,r.headers[Ba]],[ve]:[()=>r.headers[Fe]!==void 0,()=>dr(Ge(r.headers[Fe]))],[Ma]:[,r.headers[Qa]],Metadata:[,Object.keys(r.headers).filter((f)=>f.startsWith("x-amz-meta-")).reduce((f,a)=>{return f[a.substring(11)]=r.headers[a],f},{})]}),l=r.body;return s.sdkStreamMixin(l),e.Body=l,e};var Ia=async(r,s)=>{if(r.statusCode!==200&&r.statusCode>=300)return Ke(r,s);const e=v({$metadata:H(r),[Cr]:[,r.headers[Ja]],[ya]:[,r.headers[Xa]],[We]:[,r.headers[Qe]],[Ve]:[,r.headers[Be]],[Le]:[,r.headers[Ye]],[Ze]:[,r.headers[Oe]],[Xe]:[,r.headers[_e]],[He]:[,r.headers[ia]],[As]:[,r.headers[Ps]],[ks]:[,r.headers[Is]],[Je]:[,r.headers[qe]],[Fa]:[,r.headers[qa]],[Ss]:[()=>r.headers[Fr]!==void 0,()=>ds(r.headers[Fr])],[va]:[,r.headers[Ya]]});return await ha(r.body,s),e};var Ke=async(r,s)=>{const e={...r,body:await Rr.parseXmlErrorBody(r.body,s)},l=Rr.loadRestXmlErrorCode(r,e.body);switch(l){case"NoSuchUpload":case"com.amazonaws.s3#NoSuchUpload":throw await Tg(e,s);case"ObjectNotInActiveTierError":case"com.amazonaws.s3#ObjectNotInActiveTierError":throw await Mg(e,s);case"BucketAlreadyExists":case"com.amazonaws.s3#BucketAlreadyExists":throw await Ig(e,s);case"BucketAlreadyOwnedByYou":case"com.amazonaws.s3#BucketAlreadyOwnedByYou":throw await Eg(e,s);case"NoSuchBucket":case"com.amazonaws.s3#NoSuchBucket":throw await $g(e,s);case"InvalidObjectState":case"com.amazonaws.s3#InvalidObjectState":throw await Ng(e,s);case"NoSuchKey":case"com.amazonaws.s3#NoSuchKey":throw await Dg(e,s);case"NotFound":case"com.amazonaws.s3#NotFound":throw await cg(e,s);case"ObjectAlreadyInActiveTierError":case"com.amazonaws.s3#ObjectAlreadyInActiveTierError":throw await yg(e,s);default:const f=e.body;return Pg({output:r,parsedBody:f,errorCode:l})}},Pg=wa(W),Ig=async(r,s)=>{const e=v({}),l=r.body,f=new es({$metadata:H(r),...e});return O(f,r.body)},Eg=async(r,s)=>{const e=v({}),l=r.body,f=new ls({$metadata:H(r),...e});return O(f,r.body)},Ng=async(r,s)=>{const e=v({}),l=r.body;if(l[De]!=null)e[De]=Sr(l[De]);if(l[zr]!=null)e[zr]=Sr(l[zr]);const f=new as({$metadata:H(r),...e});return O(f,r.body)},$g=async(r,s)=>{const e=v({}),l=r.body,f=new fs({$metadata:H(r),...e});return O(f,r.body)},Dg=async(r,s)=>{const e=v({}),l=r.body,f=new hs({$metadata:H(r),...e});return O(f,r.body)},Tg=async(r,s)=>{const e=v({}),l=r.body,f=new rs({$metadata:H(r),...e});return O(f,r.body)},cg=async(r,s)=>{const e=v({}),l=r.body,f=new ms({$metadata:H(r),...e});return O(f,r.body)},yg=async(r,s)=>{const e=v({}),l=r.body,f=new gs({$metadata:H(r),...e});return O(f,r.body)},Mg=async(r,s)=>{const e=v({}),l=r.body,f=new ss({$metadata:H(r),...e});return O(f,r.body)};var Ug=(r,s)=>{const e={};if(r[$e]!=null)e[$e]=Sr(r[$e]);if(r[ce]!=null)e[ce]=Sr(r[ce]);if(r[ye]!=null)e[ye]=Sr(r[ye]);if(r[Cr]!=null)e[Cr]=dr(Ge(r[Cr]));return e};var H=(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 vg="ACL";var $e="AccessKeyId";var Cg="AcceptRanges";var De="AccessTier";var Ss="BucketKeyEnabled";var Te="Credentials",zg="ChecksumAlgorithm";var Ea="CacheControl",We="ChecksumCRC32",Ve="ChecksumCRC32C",Na="ContentDisposition";var $a="ContentEncoding";var Da="ContentLanguage",Me="ContentLength",Fg="ChecksumMode",Gg="ContentMD5";var Kg="ContentRange";var Le="ChecksumSHA1",Ze="ChecksumSHA256";var Ta="ContentType";var Wg="DeleteMarker";var Ue="Expires";var ca="ExpectedBucketOwner";var Vg="ExpiresString";var ya="ETag";var Cr="Expiration";var Lg="GrantFullControl";var Zg="GrantRead",Xg="GrantReadACP";var Jg="GrantWriteACP";var Hg="IfMatch",tf="IfModifiedSince",Qg="IfNoneMatch";var ra="IfUnmodifiedSince";var Bg="LastModified";var Yg="MissingMeta";var Ma="ObjectLockLegalHoldStatus",Ua="ObjectLockMode";var ve="ObjectLockRetainUntilDate";var Og="PartsCount";var _g="PartNumber";var qg="Range";var va="RequestCharged",jg="ResponseCacheControl",ig="ResponseContentDisposition",bg="ResponseContentEncoding",xg="ResponseContentLanguage",og="ResponseContentType";var ng="ResponseExpires";var Ca="RequestPayer";var pg="ReplicationStatus";var ug="Restore";var ce="SecretAccessKey";var zr="StorageClass";var tg="SessionMode";var Xe="ServerSideEncryption";var As="SSECustomerAlgorithm",za="SSECustomerKey",ks="SSECustomerKeyMD5";var Fa="SSEKMSEncryptionContext",Je="SSEKMSKeyId";var ye="SessionToken";var rw="Tagging";var sw="TagCount";var He="VersionId";var Ga="WebsiteRedirectLocation";var ew="accept-ranges";var Ka="cache-control",Wa="content-disposition",Va="content-encoding",La="content-language",Ce="content-length",lw="content-md5",fw="content-range",Za="content-type";var ze="expires";var Xa="etag",aw="expiresstring";var hw="if-match",mw="if-modified-since";var gw="if-none-match";var ww="if-unmodified-since";var sa="last-modified";var dw="partNumber";var Sw="range",Rw="response-cache-control",Aw="response-content-disposition",kw="response-content-encoding",Pw="response-content-language",Iw="response-content-type",Ew="response-expires";var Nw="session";var $w="versionId";var Dw="x-amz-acl";var Qe="x-amz-checksum-crc32",Be="x-amz-checksum-crc32c",Tw="x-amz-checksum-mode";var Ye="x-amz-checksum-sha1",Oe="x-amz-checksum-sha256";var cw="x-amz-create-session-mode";var ea="x-amz-delete-marker",Ja="x-amz-expiration",Ha="x-amz-expected-bucket-owner";var yw="x-amz-grant-full-control",Mw="x-amz-grant-read",Uw="x-amz-grant-read-acp";var vw="x-amz-grant-write-acp";var la="x-amz-missing-meta";var fa="x-amz-mp-parts-count";var Qa="x-amz-object-lock-legal-hold",Ba="x-amz-object-lock-mode",Fe="x-amz-object-lock-retain-until-date";var Cw="x-amz-restore",Ya="x-amz-request-charged";var Oa="x-amz-request-payer";var zw="x-amz-replication-status";var _a="x-amz-storage-class",Fw="x-amz-sdk-checksum-algorithm";var _e="x-amz-server-side-encryption",qe="x-amz-server-side-encryption-aws-kms-key-id",Fr="x-amz-server-side-encryption-bucket-key-enabled",qa="x-amz-server-side-encryption-context",Ps="x-amz-server-side-encryption-customer-algorithm",ja="x-amz-server-side-encryption-customer-key",Is="x-amz-server-side-encryption-customer-key-md5",Gw="x-amz-tagging",aa="x-amz-tagging-count";var ia="x-amz-version-id",ba="x-amz-website-redirect-location",xa="x-id";class je extends Ar.classBuilder().ep({...wr,DisableS3ExpressSessionAuth:{type:"staticContextParams",value:!0},Bucket:{type:"contextParams",name:"Bucket"}}).m(function(r,s,e,l){return[kr(e,this.serialize,this.deserialize),Pr(e,r.getEndpointParameterInstructions()),_r(e)]}).s("AmazonS3","CreateSession",{}).n("S3Client","CreateSessionCommand").f(void 0,bf).ser(Sa).de(ka).build(){}var oa={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 Us=Z(ur(),1);var Ww="AWS_S3_USE_ARN_REGION",Vw="s3_use_arn_region",na={environmentVariableSelector:(r)=>p(r,Ww,u.ENV),configFileSelector:(r)=>p(r,Vw,u.CONFIG),default:!1};var pa=Z(_w(),1),{__extends:CR,__assign:zR,__rest:FR,__decorate:GR,__param:KR,__esDecorate:WR,__runInitializers:VR,__propKey:LR,__setFunctionName:ZR,__metadata:XR,__awaiter:Es,__generator:Ns,__exportStar:JR,__createBinding:HR,__values:$s,__read:QR,__spread:BR,__spreadArrays:YR,__spreadArray:OR,__await:_R,__asyncGenerator:qR,__asyncDelegator:jR,__asyncValues:iR,__makeTemplateObject:bR,__importStar:xR,__importDefault:oR,__classPrivateFieldGet:nR,__classPrivateFieldSet:pR,__classPrivateFieldIn:uR,__addDisposableResource:tR,__disposeResources:rA}=pa.default;import{Buffer as ua} from"buffer";var ta=(r,s)=>{if(typeof r!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof r} (${r})`);return s?ua.from(r,s):ua.from(r)};var ie=(r)=>{const s=ta(r,"utf8");return new Uint8Array(s.buffer,s.byteOffset,s.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function Gr(r){if(r instanceof Uint8Array)return r;if(typeof r==="string")return qw(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(r)}var qw=typeof Buffer!=="undefined"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:ie;function Kr(r){if(typeof r==="string")return r.length===0;return r.byteLength===0}function Wr(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),e=0;while(e<r.length)s[e]=r[e],e+=1;return s}return Uint32Array.from(r)}var be=function(){function r(){this.crc32=new rr}return r.prototype.update=function(s){if(Kr(s))return;this.crc32.update(Gr(s))},r.prototype.digest=function(){return Es(this,void 0,void 0,function(){return Ns(this,function(s){return[2,Wr(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 e,l;try{for(var f=$s(s),a=f.next();!a.done;a=f.next()){var h=a.value;this.checksum=this.checksum>>>8^iw[(this.checksum^h)&255]}}catch(m){e={error:m}}finally{try{if(a&&!a.done&&(l=f.return))l.call(f)}finally{if(e)throw e.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var jw=[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],iw=Vr(jw);var o=Z(sh(),1);var eh=Z(sh(),1),rh=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 Ir{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 e=7,l=Math.abs(Math.round(r));e>-1&&l>0;e--,l/=256)s[e]=l;if(r<0)rh(s);return new Ir(s)}valueOf(){const r=this.bytes.slice(0),s=r[0]&128;if(s)rh(r);return parseInt(eh.toHex(r),16)*(s?-1:1)}toString(){return String(this.valueOf())}}class xe{constructor(r,s){this.toUtf8=r,this.fromUtf8=s}format(r){const s=[];for(let f of Object.keys(r)){const a=this.fromUtf8(f);s.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(r[f]))}const e=new Uint8Array(s.reduce((f,a)=>f+a.byteLength,0));let l=0;for(let f of s)e.set(f,l),l+=f.byteLength;return e}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 e=new DataView(new ArrayBuffer(5));return e.setUint8(0,4),e.setInt32(1,r.value,!1),new Uint8Array(e.buffer);case"long":const l=new Uint8Array(9);return l[0]=5,l.set(r.value.bytes,1),l;case"binary":const f=new DataView(new ArrayBuffer(3+r.value.byteLength));f.setUint8(0,6),f.setUint16(1,r.value.byteLength,!1);const a=new Uint8Array(f.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 k=new Uint8Array(9);return k[0]=8,k.set(Ir.fromNumber(r.value.valueOf()).bytes,1),k;case"uuid":if(!sd.test(r.value))throw new Error(`Invalid UUID received: ${r.value}`);const N=new Uint8Array(17);return N[0]=9,N.set(o.fromHex(r.value.replace(/\-/g,"")),1),N}}parse(r){const s={};let e=0;while(e<r.byteLength){const l=r.getUint8(e++),f=this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,l));switch(e+=l,r.getUint8(e++)){case 0:s[f]={type:fh,value:!0};break;case 1:s[f]={type:fh,value:!1};break;case 2:s[f]={type:bw,value:r.getInt8(e++)};break;case 3:s[f]={type:xw,value:r.getInt16(e,!1)},e+=2;break;case 4:s[f]={type:ow,value:r.getInt32(e,!1)},e+=4;break;case 5:s[f]={type:nw,value:new Ir(new Uint8Array(r.buffer,r.byteOffset+e,8))},e+=8;break;case 6:const a=r.getUint16(e,!1);e+=2,s[f]={type:pw,value:new Uint8Array(r.buffer,r.byteOffset+e,a)},e+=a;break;case 7:const h=r.getUint16(e,!1);e+=2,s[f]={type:uw,value:this.toUtf8(new Uint8Array(r.buffer,r.byteOffset+e,h))},e+=h;break;case 8:s[f]={type:tw,value:new Date(new Ir(new Uint8Array(r.buffer,r.byteOffset+e,8)).valueOf())},e+=8;break;case 9:const m=new Uint8Array(r.buffer,r.byteOffset+e,16);e+=16,s[f]={type:rd,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 lh;(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"})(lh||(lh={}));var fh="boolean",bw="byte",xw="short",ow="integer",nw="long",pw="binary",uw="string",tw="timestamp",rd="uuid",sd=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function hh({byteLength:r,byteOffset:s,buffer:e}){if(r<ed)throw new Error("Provided message too short to accommodate event stream message overhead");const l=new DataView(e,s,r),f=l.getUint32(0,!1);if(r!==f)throw new Error("Reported message length does not match received message length");const a=l.getUint32(ah,!1),h=l.getUint32(n,!1),m=l.getUint32(r-sr,!1),g=new rr().update(new Uint8Array(e,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(e,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(e,s+n+sr,a),body:new Uint8Array(e,s+n+sr+a,f-a-(n+sr+sr))}}var ah=4,n=ah*2,sr=4,ed=n+sr*2;class oe{constructor(r,s){this.headerMarshaller=new xe(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 e=this.headerMarshaller.format(r),l=e.byteLength+s.byteLength+16,f=new Uint8Array(l),a=new DataView(f.buffer,f.byteOffset,f.byteLength),h=new rr;return a.setUint32(0,l,!1),a.setUint32(4,e.byteLength,!1),a.setUint32(8,h.update(f.subarray(0,8)).digest(),!1),f.set(e,12),f.set(s,e.byteLength+12),a.setUint32(l-4,h.update(f.subarray(8,l-4)).digest(),!1),f}decode(r){const{headers:s,body:e}=hh(r);return{headers:this.headerMarshaller.parse(s),body:e}}formatHeaders(r){return this.headerMarshaller.format(r)}}class ne{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 pe{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 ue{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 te{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 mh(r){let s=0,e=0,l=null,f=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,e=4,l=new Uint8Array(m),new DataView(l.buffer).setUint32(0,m,!1)},h=async function*(){const m=r[Symbol.asyncIterator]();while(!0){const{value:g,done:k}=await m.next();if(k){if(!s)return;else if(s===e)yield l;else throw new Error("Truncated event message received.");return}const N=g.length;let D=0;while(D<N){if(!l){const X=N-D;if(!f)f=new Uint8Array(4);const J=Math.min(4-e,X);if(f.set(g.slice(D,D+J),e),e+=J,D+=J,e<4)break;a(new DataView(f.buffer).getUint32(0,!1)),f=null}const $=Math.min(s-e,N-D);if(l.set(g.slice(D,D+$),e),e+=$,D+=$,s&&s===e)yield l,l=null,s=0,e=0}}};return{[Symbol.asyncIterator]:h}}function gh(r,s){return async function(e){const{value:l}=e.headers[":message-type"];if(l==="error"){const f=new Error(e.headers[":error-message"].value||"UnknownError");throw f.name=e.headers[":error-code"].value,f}else if(l==="exception"){const f=e.headers[":exception-type"].value,a={[f]:e},h=await r(a);if(h.$unknown){const m=new Error(s(e.body));throw m.name=f,m}throw h[f]}else if(l==="event"){const f={[e.headers[":event-type"].value]:e},a=await r(f);if(a.$unknown)return;return a}else throw Error(`Unrecognizable event type: ${e.headers[":event-type"].value}`)}}class Ds{constructor({utf8Encoder:r,utf8Decoder:s}){this.eventStreamCodec=new oe(r,s),this.utfEncoder=r}deserialize(r,s){const e=mh(r);return new ue({messageStream:new ne({inputStream:e,decoder:this.eventStreamCodec}),deserializer:gh(s,this.utfEncoder)})}serialize(r,s){return new pe({messageStream:new te({inputStream:r,serializer:s}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as ld} from"stream";async function*wh(r){let s=!1,e=!1;const l=new Array;r.on("error",(f)=>{if(!s)s=!0;if(f)throw f}),r.on("data",(f)=>{l.push(f)}),r.on("end",()=>{s=!0});while(!e){const f=await new Promise((a)=>setTimeout(()=>a(l.shift()),0));if(f)yield f;e=s&&l.length===0}}class rl{constructor({utf8Encoder:r,utf8Decoder:s}){this.universalMarshaller=new Ds({utf8Decoder:s,utf8Encoder:r})}deserialize(r,s){const e=typeof r[Symbol.asyncIterator]==="function"?r:wh(r);return this.universalMarshaller.deserialize(e,s)}serialize(r,s){return ld.from(this.universalMarshaller.serialize(r,s))}}var dh=(r)=>new rl(r);import{Writable as fd} from"stream";class cs extends fd{constructor(r,s){super(s);this.hash=r}_write(r,s,e){try{this.hash.update(Ts(r))}catch(l){return e(l)}e()}}var Sh=(r,s)=>{if(s.readableFlowing!==null)throw new Error("Unable to calculate hash for flowing readable stream");const e=new r,l=new cs(e);return s.pipe(l),new Promise((f,a)=>{s.on("error",(h)=>{l.end(),a(h)}),l.on("error",a),l.on("finish",()=>{e.digest().then(f).catch(a)})})};var ys=Z(ur(),1);var $h=(r)=>{return{apiVersion:"2006-03-01",base64Decoder:r?.base64Decoder??Rh,base64Encoder:r?.base64Encoder??Ph,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??pr,extensions:r?.extensions??[],getAwsChunkedEncodingStream:r?.getAwsChunkedEncodingStream??Ih,httpAuthSchemeProvider:r?.httpAuthSchemeProvider??Of,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new ys.AwsSdkSigV4Signer},{schemeId:"aws.auth#sigv4a",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4a"),signer:new ys.AwsSdkSigV4ASigner}],logger:r?.logger??new Qr,sdkStreamMixin:r?.sdkStreamMixin??Eh,serviceId:r?.serviceId??"S3",signerConstructor:r?.signerConstructor??_s,signingEscapePath:r?.signingEscapePath??!1,urlParser:r?.urlParser??Nh,useArnRegion:r?.useArnRegion??!1,utf8Decoder:r?.utf8Decoder??Ah,utf8Encoder:r?.utf8Encoder??kh}};var Zh=(r)=>{yh(process.version);const s=Vh(r),e=()=>s().then(ch),l=$h(r);return Us.emitWarningIfUnsupportedVersion(process.version),{...l,...r,runtime:"node",defaultsMode:s,bodyLengthChecker:r?.bodyLengthChecker??Wh,credentialDefaultProvider:r?.credentialDefaultProvider??Lh,defaultUserAgentProvider:r?.defaultUserAgentProvider??Kh({serviceId:l.serviceId,clientVersion:oa.version}),disableS3ExpressSessionAuth:r?.disableS3ExpressSessionAuth??i(Hs),eventStreamSerdeProvider:r?.eventStreamSerdeProvider??dh,maxAttempts:r?.maxAttempts??i(Fh),md5:r?.md5??Ms.bind(null,"md5"),region:r?.region??i(vh,Ch),requestHandler:Dh.create(r?.requestHandler??e),retryMode:r?.retryMode??i({...Gh,default:async()=>(await e()).retryMode||zh}),sha1:r?.sha1??Ms.bind(null,"sha1"),sha256:r?.sha256??Ms.bind(null,"sha256"),sigv4aSigningRegionSet:r?.sigv4aSigningRegionSet??i(Us.NODE_SIGV4A_CONFIG_OPTIONS),streamCollector:r?.streamCollector??Th,streamHasher:r?.streamHasher??Sh,useArnRegion:r?.useArnRegion??i(na),useDualstackEndpoint:r?.useDualstackEndpoint??i(Mh),useFipsEndpoint:r?.useFipsEndpoint??i(Uh)}};var Xh=(r)=>{const s=r.httpAuthSchemes;let{httpAuthSchemeProvider:e,credentials:l}=r;return{setHttpAuthScheme(f){const a=s.findIndex((h)=>h.schemeId===f.schemeId);if(a===-1)s.push(f);else s.splice(a,1,f)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(f){e=f},httpAuthSchemeProvider(){return e},setCredentials(f){l=f},credentials(){return l}}},Jh=(r)=>{return{httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}};var vs=(r)=>r,qh=(r,s)=>{const e={...vs(Oh(r)),...vs(Bh(r)),...vs(Hh(r)),...vs(Xh(r))};return s.forEach((l)=>l.configure(e)),{...r,..._h(e),...Yh(e),...Qh(e),...Jh(e)}};class sl extends oh{constructor(...[r]){const s=Zh(r||{}),e=qf(s),l=nh(e),f=sm(l),a=uh(f),h=jh(a),m=rm(h),g=Zl(m),k=_f(g),N=Fl(k,{session:[()=>this,je]}),D=qh(N,r?.extensions||[]);super(D);this.config=D,this.middlewareStack.use(ph(this.config)),this.middlewareStack.use(em(this.config)),this.middlewareStack.use(th(this.config)),this.middlewareStack.use(ih(this.config)),this.middlewareStack.use(bh(this.config)),this.middlewareStack.use(xh(this.config)),this.middlewareStack.use(Er.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Qf,identityProviderConfigProvider:async($)=>new Er.DefaultIdentityProviderConfig({"aws.auth#sigv4":$.credentials,"aws.auth#sigv4a":$.credentials})})),this.middlewareStack.use(Er.getHttpSigningPlugin(this.config)),this.middlewareStack.use(Ll(this.config)),this.middlewareStack.use(Rl(this.config)),this.middlewareStack.use(Il(this.config)),this.middlewareStack.use(Qs(this.config)),this.middlewareStack.use(Ys(this.config))}destroy(){super.destroy()}}function ad(r){return(s)=>async(e)=>{const l={...e.input},f=[{target:"SSECustomerKey",hash:"SSECustomerKeyMD5"},{target:"CopySourceSSECustomerKey",hash:"CopySourceSSECustomerKeyMD5"}];for(let a of f){const h=l[a.target];if(h){let m;if(typeof h==="string")if(md(h,r))m=r.base64Decoder(h);else m=r.utf8Decoder(h),l[a.target]=r.base64Encoder(m);else m=ArrayBuffer.isView(h)?new Uint8Array(h.buffer,h.byteOffset,h.byteLength):new Uint8Array(h),l[a.target]=r.base64Encoder(m);const g=new r.md5;g.update(m),l[a.hash]=r.base64Encoder(await g.digest())}}return s({...e,input:l})}}function md(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 hd={name:"ssecMiddleware",step:"initialize",tags:["SSE"],override:!0},Cs=(r)=>({applyToStack:(s)=>{s.add(ad(r),hd)}});var T;(function(r){r.MD5="MD5",r.CRC32="CRC32",r.CRC32C="CRC32C",r.SHA1="SHA1",r.SHA256="SHA256"})(T||(T={}));var lm;(function(r){r.HEADER="header",r.TRAILER="trailer"})(lm||(lm={}));var{MD5:fm,CRC32:am}=T;var Lr=[T.CRC32,T.CRC32C,T.SHA1,T.SHA256],hm=[T.CRC32,T.CRC32C,T.SHA1,T.SHA256];var mm=(r,{requestChecksumRequired:s,requestAlgorithmMember:e},l)=>{const f=l?am:fm;if(!e||!r[e])return s?f:void 0;const a=r[e];if(!Lr.includes(a))throw new Error(`The checksum algorithm "${a}" is not supported by the client.`+` Select one of ${Lr}.`);return a};var Nr=(r)=>r===T.MD5?"content-md5":`x-amz-checksum-${r.toLowerCase()}`;var gm=(r,s)=>{const e=r.toLowerCase();for(let l of Object.keys(s))if(e===l.toLowerCase())return!0;return!1};var $r=(r)=>r!==void 0&&typeof r!=="string"&&!ArrayBuffer.isView(r)&&!wm(r);var ll=function(){function r(){this.crc32c=new el}return r.prototype.update=function(s){if(Kr(s))return;this.crc32c.update(Gr(s))},r.prototype.digest=function(){return Es(this,void 0,void 0,function(){return Ns(this,function(s){return[2,Wr(this.crc32c.digest())]})})},r.prototype.reset=function(){this.crc32c=new el},r}();var el=function(){function r(){this.checksum=4294967295}return r.prototype.update=function(s){var e,l;try{for(var f=$s(s),a=f.next();!a.done;a=f.next()){var h=a.value;this.checksum=this.checksum>>>8^wd[(this.checksum^h)&255]}}catch(m){e={error:m}}finally{try{if(a&&!a.done&&(l=f.return))l.call(f)}finally{if(e)throw e.error}}return this},r.prototype.digest=function(){return(this.checksum^4294967295)>>>0},r}();var gd=[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],wd=Vr(gd);var zs=(r,s)=>({[T.MD5]:s.md5,[T.CRC32]:be,[T.CRC32C]:ll,[T.SHA1]:s.sha1,[T.SHA256]:s.sha256})[r];var Fs=(r,s)=>{const e=new r;return e.update(Ts(s||"")),e.digest()};var dm={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},Sm=(r,s)=>(e,l)=>async(f)=>{if(!L.isInstance(f.request))return e(f);const{request:a}=f,{body:h,headers:m}=a,{base64Encoder:g,streamHasher:k}=r,{input:N,requestChecksumRequired:D,requestAlgorithmMember:$}=s,X=mm(N,{requestChecksumRequired:D,requestAlgorithmMember:$},!!l.isS3ExpressBucket);let J=h,Q=m;if(X){const _=Nr(X),Dr=zs(X,r);if($r(h)){const{getAwsChunkedEncodingStream:Js,bodyLengthChecker:Km}=r;J=Js(h,{base64Encoder:g,bodyLengthChecker:Km,checksumLocationName:_,checksumAlgorithmFn:Dr,streamHasher:k}),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(!gm(_,m)){const Js=await Fs(Dr,h);Q={...m,[_]:g(Js)}}}return await e({...f,request:{...a,headers:Q,body:J}})};var Gs=(r=[])=>{const s=[];for(let e of hm){if(!r.includes(e)||!Lr.includes(e))continue;s.push(e)}return s};var Rm=(r)=>{const s=r.lastIndexOf("-");if(s!==-1){const e=r.slice(s+1);if(!e.startsWith("0")){const l=parseInt(e,10);if(!isNaN(l)&&l>=1&&l<=1e4)return!0}}return!1};import{Transform as dd} from"stream";function fl(r){const s=new dd;return s.push(r),s.push(null),s}var Am=async(r,{streamHasher:s,checksumAlgorithmFn:e,base64Encoder:l})=>{const f=$r(r)?s(e,r):Fs(e,r);return l(await f)};var km=async(r,{config:s,responseAlgorithms:e})=>{const l=Gs(e),{body:f,headers:a}=r;for(let h of l){const m=Nr(h),g=a[m];if(g){const k=zs(h,s),{streamHasher:N,base64Encoder:D}=s,$=await Am(f,{streamHasher:N,checksumAlgorithmFn:k,base64Encoder:D});if($===g)break;throw new Error(`Checksum mismatch: expected "${$}" but received "${g}"`+` in response header "${m}".`)}}};var Pm={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},Im=(r,s)=>(e,l)=>async(f)=>{if(!L.isInstance(f.request))return e(f);const a=f.input,h=await e(f),m=h.response;let g=void 0;const{requestValidationModeMember:k,responseAlgorithms:N}=s;if(k&&a[k]==="ENABLED"){const{clientName:D,commandName:$}=l;if(D==="S3Client"&&$==="GetObjectCommand"&&Gs(N).every((Q)=>{const Xr=Nr(Q),_=m.headers[Xr];return!_||Rm(_)}))return h;const J=$r(m.body);if(J)g=await r.streamCollector(m.body),m.body=fl(g);if(await km(h.response,{config:r,responseAlgorithms:N}),J&&g)m.body=fl(g)}return h};var Ks=(r,s)=>({applyToStack:(e)=>{e.add(Sm(r,s),dm),e.addRelativeTo(Im(r,s),Pm)}});class al extends Ar.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,l){return[kr(e,this.serialize,this.deserialize),Pr(e,r.getEndpointParameterInstructions()),Ks(e,{input:this.input,requestChecksumRequired:!1,requestValidationModeMember:"ChecksumMode",responseAlgorithms:["CRC32","CRC32C","SHA256","SHA1"]}),Cs(e),El(e)]}).s("AmazonS3","GetObject",{}).n("S3Client","GetObjectCommand").f(of,xf).ser(Ra).de(Pa).build(){}class hl extends Ar.classBuilder().ep({...wr,Bucket:{type:"contextParams",name:"Bucket"},Key:{type:"contextParams",name:"Key"}}).m(function(r,s,e,l){return[kr(e,this.serialize,this.deserialize),Pr(e,r.getEndpointParameterInstructions()),Ks(e,{input:this.input,requestAlgorithmMember:"ChecksumAlgorithm",requestChecksumRequired:!1}),Al(e),_r(e),Cs(e)]}).s("AmazonS3","PutObject",{}).n("S3Client","PutObjectCommand").f(uf,pf).ser(Aa).de(Ia).build(){}import{Buffer as Em} from"buffer";class Nm extends er{client;constructor(...r){super();this.client=new sl(...r)}async put(r){let s,e,l,f=process.env.BUCKET_NAME;if(r instanceof Blob)s=r,l=`${Jr()}.${r.type.split("/")[1].split(";")[0]}`,e=r.type;else s=r.body,l=r.name,e=r.contentType;e=s instanceof Blob||s instanceof File?s.type:void 0;const a=s instanceof Em?s:Em.from(await s.arrayBuffer());return await this.client.send(new hl({Bucket:f,Key:l,Body:a,ContentType:e})),l}async fetch(r){let s=process.env.BUCKET_NAME,e;if(typeof r==="string")e=r;else s=r.bucket??s,e=r.name;if(!e)throw new Error("Object name has to be specified");const l=await this.client.send(new al({Bucket:s,Key:e}));return new Response(l.Body.transformToWebStream(),{headers:{"Content-Type":l.ContentType,"Content-Length":l.ContentLength.toString(),"Cache-Control":"private, max-age=12000, must-revalidate","Last-Modified":l.LastModified?.toUTCString()||"",ETag:l.ETag||""}})}}class Ws{}class Vs extends Ws{constructor(){super(...arguments)}requests=new Map;consume(r,s){if(!this.requests.has(r))this.requests.set(r,{date:Date.now(),count:1});else{const e=this.requests.get(r),l=Date.now();if(l-e.date>=60000)this.requests.set(r,{date:l,count:1});else this.requests.set(r,{date:e.date,count:e.count+1})}return this.requests.get(r).count}}class $m{driver=new Vs}class ml{}import*as Id from"react-dom/server";var Mm=Z(Sd(),1);var{defineProperty:Rd,getOwnPropertySymbols:Dm}=Object,Ad=Object.prototype.hasOwnProperty,kd=Object.prototype.propertyIsEnumerable,Tm=(r,s,e)=>(s in r)?Rd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,gl=(r,s)=>{for(var e in s||(s={}))if(Ad.call(s,e))Tm(r,e,s[e]);if(Dm){for(var e of Dm(s))if(kd.call(s,e))Tm(r,e,s[e])}return r},Pd=((r)=>typeof import.meta.require!=="undefined"?import.meta.require:typeof Proxy!=="undefined"?new Proxy(r,{get:(s,e)=>(typeof import.meta.require!=="undefined"?import.meta.require:s)[e]}):r)(function(r){if(typeof import.meta.require!=="undefined")return import.meta.require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')}),wl=(r,s,e)=>{return new Promise((l,f)=>{var a=(g)=>{try{m(e.next(g))}catch(k){f(k)}},h=(g)=>{try{m(e.throw(g))}catch(k){f(k)}},m=(g)=>g.done?l(g.value):Promise.resolve(g.value).then(a,h);m((e=e.apply(r,s)).next())})},Ed={unformatted:["code","pre","em","strong","span"],indent_inner_html:!0,indent_char:" ",indent_size:2,sep:"\n"},Nd=(r,s={})=>{return Mm.default.html(r,gl(gl({},Ed),s))},$d=[{selector:"img",format:"skip"},{selector:"#__react-email-preview",format:"skip"},{selector:"a",options:{linkBrackets:!1}}];var cm=new TextDecoder("utf-8"),ym=(r)=>wl(void 0,null,function*(){let s="";if("pipeTo"in r){const e=new WritableStream({write(l){s+=cm.decode(l)}});yield r.pipeTo(e)}else{const{Writable:e}=Pd("stream"),l=new e({write(f,a,h){s+=cm.decode(f),h()}});return r.pipe(l),new Promise((f,a)=>{l.on("error",a),l.on("close",()=>{f(s)})})}return s}),Ls=(r,s)=>wl(void 0,null,function*(){const e=yield import("react-dom/server");let l;if(Object.hasOwn(e,"renderToReadableStream"))l=yield ym(yield e.renderToReadableStream(r));else yield new Promise((h,m)=>{const g=e.renderToPipeableStream(r,{onAllReady(){return wl(this,null,function*(){l=yield ym(g),h()})},onError(k){m(k)}})});if(s==null?void 0:s.plainText)return dl(l,gl({selectors:$d},s.htmlToTextOptions));const a=`${'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'}${l.replace(/<!DOCTYPE.*?>/,"")}`;if(s==null?void 0:s.pretty)return Nd(a);return a});var{defineProperty:Dd,defineProperties:Td,getOwnPropertyDescriptors:cd,getOwnPropertySymbols:Um}=Object,yd=Object.prototype.hasOwnProperty,Md=Object.prototype.propertyIsEnumerable,vm=(r,s,e)=>(s in r)?Dd(r,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[s]=e,Zr=(r,s)=>{for(var e in s||(s={}))if(yd.call(s,e))vm(r,e,s[e]);if(Um){for(var e of Um(s))if(Md.call(s,e))vm(r,e,s[e])}return r},Ud=(r,s)=>Td(r,cd(s)),P=(r,s,e)=>{return new Promise((l,f)=>{var a=(g)=>{try{m(e.next(g))}catch(k){f(k)}},h=(g)=>{try{m(e.throw(g))}catch(k){f(k)}},m=(g)=>g.done?l(g.value):Promise.resolve(g.value).then(a,h);m((e=e.apply(r,s)).next())})},vd="3.4.0",Cd=class{constructor(r){this.resend=r}create(r){return P(this,arguments,function*(s,e={}){return yield this.resend.post("/api-keys",s,e)})}list(){return P(this,null,function*(){return yield this.resend.get("/api-keys")})}remove(r){return P(this,null,function*(){return yield this.resend.delete(`/api-keys/${r}`)})}},zd=class{constructor(r){this.resend=r}create(r){return P(this,arguments,function*(s,e={}){return yield this.resend.post("/audiences",s,e)})}list(){return P(this,null,function*(){return yield this.resend.get("/audiences")})}get(r){return P(this,null,function*(){return yield this.resend.get(`/audiences/${r}`)})}remove(r){return P(this,null,function*(){return yield this.resend.delete(`/audiences/${r}`)})}},Fd=class{constructor(r){this.resend=r}send(r){return P(this,arguments,function*(s,e={}){return this.create(s,e)})}create(r){return P(this,arguments,function*(s,e={}){for(let f of s)if(f.react)f.html=yield Ls(f.react),delete f.react;return yield this.resend.post("/emails/batch",s,e)})}},Gd=class{constructor(r){this.resend=r}create(r){return P(this,arguments,function*(s,e={}){return yield this.resend.post(`/audiences/${s.audienceId}/contacts`,{unsubscribed:s.unsubscribed,email:s.email,first_name:s.firstName,last_name:s.lastName},e)})}list(r){return P(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts`)})}get(r){return P(this,null,function*(){return yield this.resend.get(`/audiences/${r.audienceId}/contacts/${r.id}`)})}update(r){return P(this,null,function*(){return yield this.resend.patch(`/audiences/${r.audienceId}/contacts/${r.id}`,{unsubscribed:r.unsubscribed,first_name:r.firstName,last_name:r.lastName})})}remove(r){return P(this,null,function*(){return yield this.resend.delete(`/audiences/${r.audienceId}/contacts/${(r==null?void 0:r.email)?r==null?void 0:r.email:r==null?void 0:r.id}`)})}},Kd=class{constructor(r){this.resend=r}create(r){return P(this,arguments,function*(s,e={}){return yield this.resend.post("/domains",s,e)})}list(){return P(this,null,function*(){return yield this.resend.get("/domains")})}get(r){return P(this,null,function*(){return yield this.resend.get(`/domains/${r}`)})}update(r){return P(this,null,function*(){return yield this.resend.patch(`/domains/${r.id}`,{click_tracking:r.clickTracking,open_tracking:r.openTracking,tls:r.tls})})}remove(r){return P(this,null,function*(){return yield this.resend.delete(`/domains/${r}`)})}verify(r){return P(this,null,function*(){return yield this.resend.post(`/domains/${r}/verify`)})}},Wd=class{constructor(r){this.resend=r}send(r){return P(this,arguments,function*(s,e={}){return this.create(s,e)})}create(r){return P(this,arguments,function*(s,e={}){if(s.react)s.html=yield Ls(s.react),delete s.react;return yield this.resend.post("/emails",s,e)})}get(r){return P(this,null,function*(){return yield this.resend.get(`/emails/${r}`)})}},Cm="https://api.resend.com",zm=`resend-node:${vd}`,Vd=typeof process!=="undefined"&&process.env?process.env.RESEND_BASE_URL||Cm:Cm,Ld=typeof process!=="undefined"&&process.env?process.env.RESEND_USER_AGENT||zm:zm,Fm=class{constructor(r){if(this.key=r,this.apiKeys=new Cd(this),this.audiences=new zd(this),this.batch=new Fd(this),this.contacts=new Gd(this),this.domains=new Kd(this),this.emails=new Wd(this),!r){if(typeof process!=="undefined"&&process.env)this.key=process.env.RESEND_API_KEY;if(!this.key)throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`')}this.headers=new Headers({Authorization:`Bearer ${this.key}`,"User-Agent":Ld,"Content-Type":"application/json"})}fetchRequest(r){return P(this,arguments,function*(s,e={}){try{const l=yield fetch(`${Vd}${s}`,e);if(!l.ok)try{const a=yield l.text();return{data:null,error:JSON.parse(a)}}catch(a){if(a instanceof SyntaxError)return{data:null,error:{name:"application_error",message:"Internal server error. We are unable to process your request right now, please try again later."}};const h={message:l.statusText,name:"application_error"};if(a instanceof Error)return{data:null,error:Ud(Zr({},h),{message:a.message})};return{data:null,error:h}}return{data:yield l.json(),error:null}}catch(l){return{data:null,error:{name:"application_error",message:"Unable to fetch data. The request could not be resolved."}}}})}post(r,s){return P(this,arguments,function*(e,l,f={}){const a=Zr({method:"POST",headers:this.headers,body:JSON.stringify(l)},f);return this.fetchRequest(e,a)})}get(r){return P(this,arguments,function*(s,e={}){const l=Zr({method:"GET",headers:this.headers},e);return this.fetchRequest(s,l)})}put(r,s){return P(this,arguments,function*(e,l,f={}){const a=Zr({method:"PUT",headers:this.headers,body:JSON.stringify(l)},f);return this.fetchRequest(e,a)})}patch(r,s){return P(this,arguments,function*(e,l,f={}){const a=Zr({method:"PATCH",headers:this.headers,body:JSON.stringify(l)},f);return this.fetchRequest(e,a)})}delete(r,s){return P(this,null,function*(){const e={method:"DELETE",headers:this.headers,body:JSON.stringify(s)};return this.fetchRequest(r,e)})}};class Zs{}class Xs extends Zs{r;constructor(r=process.env.RESEND_API_KEY){super();this.apiKey=r}async send(r){const s=new Fm(this.apiKey),{data:e,error:l}=await s.emails.send({...r});if(l)throw l;if(e)return!0}}class Gm extends ml{constructor(){super(...arguments)}debug=!0;defaultFrom="";driver=new Xs;boot(){}}export{Nm as S3Driver,Xs as ResendDriver,$m as RateLimiterServiceProvider,Ws as RateLimiterDriver,Vs as InMemoryRateLimiter,Hr as FileSystemDriver,Sl as FileStorageServiceProvider,er as FileStorageDriver,Gm as EmailServiceProvider,Zs as EmailDriver};export{Sl as p,ml as q,$m as r,Gm as s};
|