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