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