@ew-did-registry/did-s3-store
Version:
S3-based implementation of IDidStore
1 lines • 411 kB
JavaScript
(()=>{var e,t={130:(e,t,n)=>{"use strict";n.d(t,{Kd:()=>i,cS:()=>o,eS:()=>r,oJ:()=>a,jt:()=>s});const r=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler:()=>e.httpHandler,updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs:()=>e.httpHandler.httpHandlerConfigs()}),s=e=>({httpHandler:e.httpHandler()});n(1932);class i{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?":"!==e.protocol.slice(-1)?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?"/"!==e.path.charAt(0)?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const t=new i({...e,headers:{...e.headers}});var n;return t.query&&(t.query=(n=t.query,Object.keys(n).reduce(((e,t)=>{const r=n[t];return{...e,[t]:Array.isArray(r)?[...r]:r}}),{}))),t}static isInstance(e){if(!e)return!1;const t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&"object"==typeof t.query&&"object"==typeof t.headers}clone(){return i.clone(this)}}class o{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const t=e;return"number"==typeof t.statusCode&&"object"==typeof t.headers}}function a(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}},181:e=>{"use strict";e.exports=require("buffer")},425:(e,t,n)=>{"use strict";n(130),n(2952);class r{constructor(e,t=new Map){this.namespace=e,this.schemas=t}static for(e){return r.registries.has(e)||r.registries.set(e,new r(e)),r.registries.get(e)}register(e,t){const n=this.normalizeShapeId(e);r.for(this.getNamespace(e)).schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw new Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}getBaseException(){for(const[e,t]of this.schemas.entries())if(e.startsWith("smithy.ts.sdk.synthetic.")&&e.endsWith("ServiceException"))return t}find(e){return[...this.schemas.values()].find(e)}destroy(){r.registries.delete(this.namespace),this.schemas.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}getNamespace(e){return this.normalizeShapeId(e).split("#")[0]}}r.registries=new Map},548:(e,t,n)=>{"use strict";n.d(t,{o:()=>r});const r=e=>encodeURIComponent(e).replace(/[!'()*]/g,s),s=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`},563:(e,t,n)=>{"use strict";n.d(t,{E:()=>i,n:()=>a});var r=n(6385);const s=/^[A-Za-z0-9+/]*={0,2}$/,i=e=>{if(3*e.length%4!=0)throw new TypeError("Incorrect padding on base64 string.");if(!s.exec(e))throw new TypeError("Invalid base64 string.");const t=(0,r.s)(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};var o=n(7670);const a=e=>{let t;if(t="string"==typeof e?(0,o.ar)(e):e,"object"!=typeof t||"number"!=typeof t.byteOffset||"number"!=typeof t.byteLength)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return(0,r.Q)(t.buffer,t.byteOffset,t.byteLength).toString("base64")}},660:(e,t,n)=>{"use strict";n.d(t,{cV:()=>s,Qm:()=>r});const r=(e,t,n)=>{if(t in e){if("true"===e[t])return!0;if("false"===e[t])return!1;throw new Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}};var s;!function(e){e.ENV="env",e.CONFIG="shared config entry"}(s||(s={}))},784:(e,t,n)=>{"use strict";n.d(t,{h:()=>o});var r=n(8455),s=n(8866),i=n(7991);const o=e=>{let t,n=e.credentials,o=!!e.credentials;Object.defineProperty(e,"credentials",{set(i){i&&i!==n&&i!==t&&(o=!0),n=i;const a=function(e,{credentials:t,credentialDefaultProvider:n}){let r;return r=t?t?.memoized?t:(0,s.K4)(t,s.OC,s.e):n?(0,s.te)(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}(e,{credentials:n,credentialDefaultProvider:e.credentialDefaultProvider}),c=function(e,t){if(t.configBound)return t;const n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}(e,a);o&&!c.attributed?(t=async e=>c(e).then((e=>(0,r.g)(e,"CREDENTIALS_CODE","e"))),t.memoized=c.memoized,t.configBound=c.configBound,t.attributed=!0):t=c},get:()=>t,enumerable:!0,configurable:!0}),e.credentials=n;const{signingEscapePath:a=!0,systemClockOffset:c=e.systemClockOffset||0,sha256:u}=e;let l;return l=e.signer?(0,s.te)(e.signer):e.regionInfoProvider?()=>(0,s.te)(e.region)().then((async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t])).then((([t,n])=>{const{signingRegion:r,signingService:s}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||s||e.serviceId;const o={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:a};return new(e.signerConstructor||i.BB)(o)})):async t=>{const n=(t=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await(0,s.te)(e.region)(),properties:{}},t)).signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;const o={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:u,uriEscapePath:a};return new(e.signerConstructor||i.BB)(o)},Object.assign(e,{systemClockOffset:c,signingEscapePath:a,signer:l})}},852:(e,t,n)=>{"use strict";n.d(t,{C:()=>r});const r=e=>new Date(Date.now()+e)},857:e=>{"use strict";e.exports=require("os")},896:(e,t)=>{"use strict";function n(e,t,o){let a;const c={};for(let u=0;u<e.length;u++){const l=e[u],d=r(l);let p="";if(p=void 0===o?d:o+"."+d,d===t.textNodeName)void 0===a?a=l[d]:a+=""+l[d];else{if(void 0===d)continue;if(l[d]){let e=n(l[d],t,p);const r=i(e,t);l[":@"]?s(e,l[":@"],p,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[d]&&c.hasOwnProperty(d)?(Array.isArray(c[d])||(c[d]=[c[d]]),c[d].push(e)):t.isArray(d,p,r)?c[d]=[e]:c[d]=e}}}return"string"==typeof a?a.length>0&&(c[t.textNodeName]=a):void 0!==a&&(c[t.textNodeName]=a),c}function r(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const n=t[e];if(":@"!==n)return n}}function s(e,t,n,r){if(t){const s=Object.keys(t),i=s.length;for(let o=0;o<i;o++){const i=s[o];r.isArray(i,n+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function i(e,t){const{textNodeName:n}=t,r=Object.keys(e).length;return 0===r||!(1!==r||!e[n]&&"boolean"!=typeof e[n]&&0!==e[n])}t.prettify=function(e,t){return n(e,t)}},919:(e,t,n)=>{"use strict";const r=n(1209),s={allowBooleanAttributes:!1,unpairedTags:[]};function i(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function o(e,t){const n=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const r=e.substr(n,t-n);if(t>5&&"xml"===r)return h("InvalidXml","XML declaration allowed only at the start of the document.",g(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let n=1;for(t+=8;t<e.length;t++)if("<"===e[t])n++;else if(">"===e[t]&&(n--,0===n))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},s,t);const n=[];let c=!1,u=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let s=0;s<e.length;s++)if("<"===e[s]&&"?"===e[s+1]){if(s+=2,s=o(e,s),s.err)return s}else{if("<"!==e[s]){if(i(e[s]))continue;return h("InvalidChar","char '"+e[s]+"' is not expected.",g(e,s))}{let f=s;if(s++,"!"===e[s]){s=a(e,s);continue}{let y=!1;"/"===e[s]&&(y=!0,s++);let b="";for(;s<e.length&&">"!==e[s]&&" "!==e[s]&&"\t"!==e[s]&&"\n"!==e[s]&&"\r"!==e[s];s++)b+=e[s];if(b=b.trim(),"/"===b[b.length-1]&&(b=b.substring(0,b.length-1),s--),d=b,!r.isName(d)){let t;return t=0===b.trim().length?"Invalid space after '<'.":"Tag '"+b+"' is an invalid name.",h("InvalidTag",t,g(e,s))}const C=l(e,s);if(!1===C)return h("InvalidAttr","Attributes for '"+b+"' have open quote.",g(e,s));let S=C.value;if(s=C.index,"/"===S[S.length-1]){const n=s-S.length;S=S.substring(0,S.length-1);const r=p(S,t);if(!0!==r)return h(r.err.code,r.err.msg,g(e,n+r.err.line));c=!0}else if(y){if(!C.tagClosed)return h("InvalidTag","Closing tag '"+b+"' doesn't have proper closing.",g(e,s));if(S.trim().length>0)return h("InvalidTag","Closing tag '"+b+"' can't have attributes or invalid starting.",g(e,f));if(0===n.length)return h("InvalidTag","Closing tag '"+b+"' has not been opened.",g(e,f));{const t=n.pop();if(b!==t.tagName){let n=g(e,t.tagStartPos);return h("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+n.line+", col "+n.col+") instead of closing tag '"+b+"'.",g(e,f))}0==n.length&&(u=!0)}}else{const r=p(S,t);if(!0!==r)return h(r.err.code,r.err.msg,g(e,s-S.length+r.err.line));if(!0===u)return h("InvalidXml","Multiple possible root nodes found.",g(e,s));-1!==t.unpairedTags.indexOf(b)||n.push({tagName:b,tagStartPos:f}),c=!0}for(s++;s<e.length;s++)if("<"===e[s]){if("!"===e[s+1]){s++,s=a(e,s);continue}if("?"!==e[s+1])break;if(s=o(e,++s),s.err)return s}else if("&"===e[s]){const t=m(e,s);if(-1==t)return h("InvalidChar","char '&' is not expected.",g(e,s));s=t}else if(!0===u&&!i(e[s]))return h("InvalidXml","Extra text at the end",g(e,s));"<"===e[s]&&s--}}}var d;return c?1==n.length?h("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",g(e,n[0].tagStartPos)):!(n.length>0)||h("InvalidXml","Invalid '"+JSON.stringify(n.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):h("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(e,t){let n="",r="",s=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===u)""===r?r=e[t]:r!==e[t]||(r="");else if(">"===e[t]&&""===r){s=!0;break}n+=e[t]}return""===r&&{value:n,index:t,tagClosed:s}}const d=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){const n=r.getAllMatches(e,d),s={};for(let e=0;e<n.length;e++){if(0===n[e][1].length)return h("InvalidAttr","Attribute '"+n[e][2]+"' has no space in starting.",y(n[e]));if(void 0!==n[e][3]&&void 0===n[e][4])return h("InvalidAttr","Attribute '"+n[e][2]+"' is without value.",y(n[e]));if(void 0===n[e][3]&&!t.allowBooleanAttributes)return h("InvalidAttr","boolean attribute '"+n[e][2]+"' is not allowed.",y(n[e]));const r=n[e][2];if(!f(r))return h("InvalidAttr","Attribute '"+r+"' is an invalid name.",y(n[e]));if(s.hasOwnProperty(r))return h("InvalidAttr","Attribute '"+r+"' is repeated.",y(n[e]));s[r]=1}return!0}function m(e,t){if(";"===e[++t])return-1;if("#"===e[t])return function(e,t){let n=/\d/;for("x"===e[t]&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(n))break}return-1}(e,++t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(";"===e[t])break;return-1}return t}function h(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function f(e){return r.isName(e)}function g(e,t){const n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function y(e){return e.startIndex+e[1].length}},1065:(e,t,n)=>{"use strict";n.d(t,{$:()=>o});const r=e=>"string"==typeof e&&e.length>0?e.split(",").map((e=>e.trim())):[],s="AWS_AUTH_SCHEME_PREFERENCE",i="auth_scheme_preference",o={environmentVariableSelector:(e,t)=>t?.signingName&&`AWS_BEARER_TOKEN_${t.signingName.replace(/[\s-]/g,"_").toUpperCase()}`in e?["httpBearerAuth"]:s in e?r(e[s]):void 0,configFileSelector:e=>{if(i in e)return r(e[i])},default:[]}},1150:(e,t,n)=>{"use strict";n.d(t,{m:()=>r});const r=e=>"function"==typeof ArrayBuffer&&e instanceof ArrayBuffer||"[object ArrayBuffer]"===Object.prototype.toString.call(e)},1209:(e,t)=>{"use strict";const n=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+n+"]["+n+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",s=new RegExp("^"+r+"$");t.isExist=function(e){return void 0!==e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,n){if(t){const r=Object.keys(t),s=r.length;for(let i=0;i<s;i++)e[r[i]]="strict"===n?[t[r[i]]]:t[r[i]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(e){return!(null==s.exec(e))},t.getAllMatches=function(e,t){const n=[];let r=t.exec(e);for(;r;){const s=[];s.startIndex=t.lastIndex-r[0].length;const i=r.length;for(let e=0;e<i;e++)s.push(r[e]);n.push(s),r=t.exec(e)}return n},t.nameRegexp=r},1320:(e,t,n)=>{"use strict";n.d(t,{vK:()=>o});var r=n(130);const s="content-length",i={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},o=e=>({applyToStack:t=>{var n;t.add((n=e.bodyLengthChecker,e=>async t=>{const i=t.request;if(r.Kd.isInstance(i)){const{body:e,headers:t}=i;if(e&&-1===Object.keys(t).map((e=>e.toLowerCase())).indexOf(s))try{const t=n(e);i.headers={...i.headers,[s]:String(t)}}catch(e){}}return e({...t,request:i})}),i)}})},1336:(e,t,n)=>{"use strict";function r(e,t,n){e.__aws_sdk_context?e.__aws_sdk_context.features||(e.__aws_sdk_context.features={}):e.__aws_sdk_context={features:{}},e.__aws_sdk_context.features[t]=n}n.d(t,{J:()=>r})},1535:(e,t,n)=>{"use strict";n.d(t,{h5:()=>u,S0:()=>c,GQ:()=>p,Qb:()=>l,bV:()=>d});const r=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],s=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],i=["TimeoutError","RequestTimeout","RequestTimeoutException"],o=[500,502,503,504],a=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],c=e=>void 0!==e.$retryable,u=e=>r.includes(e.name),l=e=>429===e.$metadata?.httpStatusCode||s.includes(e.name)||1==e.$retryable?.throttling,d=(e,t=0)=>(e=>e.$metadata?.clockSkewCorrected)(e)||i.includes(e.name)||a.includes(e?.code||"")||o.includes(e.$metadata?.httpStatusCode||0)||(e=>{const t=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return!!(e&&e instanceof TypeError)&&t.has(e.message)})(e)||void 0!==e.cause&&t<=10&&d(e.cause,t+1),p=e=>{if(void 0!==e.$metadata?.httpStatusCode){const t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!d(e)}return!1}},1758:(e,t,n)=>{"use strict";n.d(t,{OV:()=>s,TC:()=>o});var r=n(130);function s(e){return e}const i={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},o=e=>({applyToStack:t=>{t.add((e=>t=>async n=>{if(!r.Kd.isInstance(n.request))return t(n);const{request:s}=n,{handlerProtocol:i=""}=e.requestHandler.metadata||{};if(i.indexOf("h2")>=0&&!s.headers[":authority"])delete s.headers.host,s.headers[":authority"]=s.hostname+(s.port?":"+s.port:"");else if(!s.headers.host){let e=s.hostname;null!=s.port&&(e+=`:${s.port}`),s.headers.host=e}return t(n)})(e),i)}})},1932:(e,t,n)=>{"use strict";var r,s,i,o,a;n.d(t,{dB:()=>o,Ue:()=>i,Ip:()=>u,Vf:()=>c}),function(e){e.HEADER="header",e.QUERY="query"}(r||(r={})),function(e){e.HEADER="header",e.QUERY="query"}(s||(s={})),function(e){e.HTTP="http",e.HTTPS="https"}(i||(i={})),function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"}(o||(o={})),function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"}(a||(a={}));const c="__smithy_context";var u,l;!function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"}(u||(u={})),function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"}(l||(l={}))},1943:e=>{"use strict";e.exports=require("fs/promises")},2032:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6982),s=n(6791),i=n(3770);function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(r);const c=s.from({name:"sha2-256",code:18,encode:e=>i.coerce(a.default.createHash("sha256").update(e).digest())}),u=s.from({name:"sha2-512",code:19,encode:e=>i.coerce(a.default.createHash("sha512").update(e).digest())});t.sha256=c,t.sha512=u},2165:(e,t,n)=>{"use strict";n.d(t,{qs:()=>y,kN:()=>C,ey:()=>T,$z:()=>b});var r=n(4134),s=n(130),i=n(1535),o=n(6982),a=n.n(o);const c={randomUUID:a().randomUUID},u=new Uint8Array(256);let l=u.length;function d(){return l>u.length-16&&(a().randomFillSync(u),l=0),u.slice(l,l+=16)}const p=[];for(let e=0;e<256;++e)p.push((e+256).toString(16).slice(1));const m=function(e,t,n){if(c.randomUUID&&!t&&!e)return c.randomUUID();const r=(e=e||{}).random||(e.rng||d)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return p[e[t+0]]+p[e[t+1]]+p[e[t+2]]+p[e[t+3]]+"-"+p[e[t+4]]+p[e[t+5]]+"-"+p[e[t+6]]+p[e[t+7]]+"-"+p[e[t+8]]+p[e[t+9]]+"-"+p[e[t+10]]+p[e[t+11]]+p[e[t+12]]+p[e[t+13]]+p[e[t+14]]+p[e[t+15]]}(r)};var h=n(2952);const f="AWS_MAX_ATTEMPTS",g="max_attempts",y={environmentVariableSelector:e=>{const t=e[f];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Environment variable ${f} mast be a number, got "${t}"`);return n},configFileSelector:e=>{const t=e[g];if(!t)return;const n=parseInt(t);if(Number.isNaN(n))throw new Error(`Shared config file entry ${g} mast be a number, got "${t}"`);return n},default:r.Gz},b=e=>{const{retryStrategy:t,retryMode:n,maxAttempts:s}=e,i=(0,h.t)(s??r.Gz);return Object.assign(e,{maxAttempts:i,retryStrategy:async()=>t||(await(0,h.t)(n)()===r.cm.ADAPTIVE?new r.Y(i):new r.ru(i))})},C={environmentVariableSelector:e=>e.AWS_RETRY_MODE,configFileSelector:e=>e.retry_mode,default:r.L0};var S=n(8313),w=n(2203);const E=e=>e?.body instanceof w.Readable||"undefined"!=typeof ReadableStream&&e?.body instanceof ReadableStream,k=e=>{const t={error:e,errorType:v(e)},n=A(e.$response);return n&&(t.retryAfterHint=n),t},v=e=>(0,i.Qb)(e)?"THROTTLING":(0,i.bV)(e)?"TRANSIENT":(0,i.GQ)(e)?"SERVER_ERROR":"CLIENT_ERROR",x={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},T=e=>({applyToStack:t=>{t.add((e=>(t,n)=>async i=>{let o=await e.retryStrategy();const a=await e.maxAttempts();if(!(e=>void 0!==e.acquireInitialRetryToken&&void 0!==e.refreshRetryTokenForRetry&&void 0!==e.recordSuccess)(o))return o?.mode&&(n.userAgent=[...n.userAgent||[],["cfg/retry-mode",o.mode]]),o.retry(t,i);{let e=await o.acquireInitialRetryToken(n.partition_id),u=new Error,l=0,d=0;const{request:p}=i,h=s.Kd.isInstance(p);for(h&&(p.headers[r.l5]=m());;)try{h&&(p.headers[r.ok]=`attempt=${l+1}; max=${a}`);const{response:n,output:s}=await t(i);return o.recordSuccess(e),s.$metadata.attempts=l+1,s.$metadata.totalRetryDelay=d,{response:n,output:s}}catch(t){const r=k(t);if(u=(c=t)instanceof Error?c:c instanceof Object?Object.assign(new Error,c):"string"==typeof c?new Error(c):new Error(`AWS SDK error wrapper for ${c}`),h&&E(p))throw(n.logger instanceof S.N4?console:n.logger)?.warn("An error was encountered in a non-retryable streaming request."),u;try{e=await o.refreshRetryTokenForRetry(e,r)}catch(e){throw u.$metadata||(u.$metadata={}),u.$metadata.attempts=l+1,u.$metadata.totalRetryDelay=d,u}l=e.getRetryCount();const s=e.getRetryDelay();d+=s,await new Promise((e=>setTimeout(e,s)))}}var c})(e),x)}}),A=e=>{if(!s.cS.isInstance(e))return;const t=Object.keys(e.headers).find((e=>"retry-after"===e.toLowerCase()));if(!t)return;const n=e.headers[t],r=Number(n);return Number.isNaN(r)?new Date(n):new Date(1e3*r)}},2203:e=>{"use strict";e.exports=require("stream")},2258:(e,t,n)=>{"use strict";n.d(t,{bM:()=>s,sM:()=>g,Dc:()=>i});var r=n(8866);const s=void 0;function i(e){const t=(0,r.te)(e.userAgentAppId??s),{customUserAgent:n}=e;return Object.assign(e,{customUserAgent:"string"==typeof n?[[n]]:n,userAgentAppId:async()=>{const n=await t();if(!function(e){return void 0===e||"string"==typeof e&&e.length<=50}(n)){const t="NoOpLogger"!==e.logger?.constructor?.name&&e.logger?e.logger:console;"string"!=typeof n?t?.warn("userAgentAppId must be a string or undefined."):n.length>50&&t?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}var o=n(6775),a=n(130),c=n(1336);const u=/\d{12}\.ddb/,l="user-agent",d="x-amz-user-agent",p=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,m=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,h=e=>{const t=e[0].split("/").map((e=>e.replace(p,"-"))).join("/"),n=e[1]?.replace(m,"-"),r=t.indexOf("/"),s=t.substring(0,r);let i=t.substring(r+1);return"api"===s&&(i=i.toLowerCase()),[s,i,n].filter((e=>e&&e.length>0)).reduce(((e,t,n)=>{switch(n){case 0:return t;case 1:return`${e}/${t}`;default:return`${e}#${t}`}}),"")},f={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},g=e=>({applyToStack:t=>{var n;t.add((n=e,(e,t)=>async r=>{const{request:s}=r;if(!a.Kd.isInstance(s))return e(r);const{headers:i}=s,p=t?.userAgent?.map(h)||[],m=(await n.defaultUserAgentProvider()).map(h);await async function(e,t,n){const r=n.request;if("rpc-v2-cbor"===r?.headers?.["smithy-protocol"]&&(0,c.J)(e,"PROTOCOL_RPC_V2_CBOR","M"),"function"==typeof t.retryStrategy){const n=await t.retryStrategy();"function"==typeof n.acquireInitialRetryToken?n.constructor?.name?.includes("Adaptive")?(0,c.J)(e,"RETRY_MODE_ADAPTIVE","F"):(0,c.J)(e,"RETRY_MODE_STANDARD","E"):(0,c.J)(e,"RETRY_MODE_LEGACY","D")}if("function"==typeof t.accountIdEndpointMode){const n=e.endpointV2;switch(String(n?.url?.hostname).match(u)&&(0,c.J)(e,"ACCOUNT_ID_ENDPOINT","O"),await(t.accountIdEndpointMode?.())){case"disabled":(0,c.J)(e,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":(0,c.J)(e,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":(0,c.J)(e,"ACCOUNT_ID_MODE_REQUIRED","R")}}const s=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(s?.$source){const t=s;t.accountId&&(0,c.J)(e,"RESOLVED_ACCOUNT_ID","T");for(const[n,r]of Object.entries(t.$source??{}))(0,c.J)(e,n,r)}}(t,n,r);const f=t;m.push(`m/${function(e){let t="";for(const n in e){const r=e[n];if(!(t.length+r.length+1<=1024))break;t.length?t+=","+r:t+=r}return t}(Object.assign({},t.__smithy_context?.features,f.__aws_sdk_context?.features))}`);const g=n?.customUserAgent?.map(h)||[],y=await n.userAgentAppId();y&&m.push(h([`app/${y}`]));const b=(0,o.vL)(),C=(b?[b]:[]).concat([...m,...p,...g]).join(" "),S=[...m.filter((e=>e.startsWith("aws-sdk-"))),...g].join(" ");return"browser"!==n.runtime?(S&&(i[d]=i[d]?`${i[l]} ${S}`:S),i[l]=C):i[d]=C,e({...r,request:s})}),f)}})},2369:(e,t,n)=>{"use strict";n.d(t,{a:()=>i,n:()=>o});const r={},s={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),r[e]=t,s[t]=e}function i(e){if(e.length%2!=0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){const r=e.slice(n,n+2).toLowerCase();if(!(r in s))throw new Error(`Cannot decode unrecognized sequence ${r} as hexadecimal`);t[n/2]=s[r]}return t}function o(e){let t="";for(let n=0;n<e.byteLength;n++)t+=r[e[n]];return t}},2565:(e,t,n)=>{"use strict";n.d(t,{Px:()=>s,$6:()=>i,lI:()=>a});var r=n(9491);const s=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return r.Mu.mutate(e);if(!e)return r.Mu.mutate(new Uint8Array);const n=t.streamCollector(e);return r.Mu.mutate(await n)};function i(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}n(425);var o=n(130);function a(e,t){return new c(e,t)}n(5784);class c{constructor(e,t){this.input=e,this.context=t,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:e,protocol:t="https",port:n,path:r}=await this.context.endpoint();this.path=r;for(const e of this.resolvePathStack)e(this.path);return new o.Kd({protocol:t,hostname:this.hostname||e,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((t=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e})),this}p(e,t,n,r){return this.resolvePathStack.push((s=>{this.path=((e,t,n,r,s,o)=>{if(null==t||void 0===t[n])throw new Error("No value provided for input HTTP label: "+n+".");{const t=r();if(t.length<=0)throw new Error("Empty value provided for input HTTP label: "+n+".");e=e.replace(s,o?t.split("/").map((e=>i(e))).join("/"):i(t))}return e})(s,this.input,e,t,n,r)})),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}n(563),n(7670)},2639:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4761);t.decode=(e,t=0)=>[r.decode(e,t),r.decode.bytes],t.encodeTo=(e,t,n=0)=>(r.encode(e,t,n),t),t.encodingLength=e=>r.encodingLength(e)},2640:(e,t,n)=>{"use strict";n.d(t,{D:()=>r});const r=e=>{if("string"==typeof e)return r(new URL(e));const{hostname:t,pathname:n,port:s,protocol:i,search:o}=e;let a;return o&&(a=function(e){const t={};if(e=e.replace(/^\?/,""))for(const n of e.split("&")){let[e,r=null]=n.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(o)),{hostname:t,port:s?parseInt(s):void 0,protocol:i,path:n,query:a}}},2763:(e,t,n)=>{"use strict";const r=n(919),s=n(6226),i=n(5181);e.exports={XMLParser:s,XMLValidator:r,XMLBuilder:i}},2952:(e,t,n)=>{"use strict";n.d(t,{u:()=>s,t:()=>i});var r=n(1932);const s=e=>e[r.Vf]||(e[r.Vf]={}),i=e=>{if("function"==typeof e)return e;const t=Promise.resolve(e);return()=>t}},3078:(e,t,n)=>{"use strict";n.r(t),n.d(t,{$Command:()=>Q.uB,AbortMultipartUploadCommand:()=>DA,AnalyticsFilter:()=>Fs,AnalyticsS3ExportFileFormat:()=>Gs,ArchiveStatus:()=>Ti,BucketAccelerateStatus:()=>Ss,BucketAlreadyExists:()=>js,BucketAlreadyOwnedByYou:()=>_s,BucketCannedACL:()=>Ns,BucketLocationConstraint:()=>Ls,BucketLogsPermission:()=>ni,BucketType:()=>Us,BucketVersioningStatus:()=>gi,ChecksumAlgorithm:()=>As,ChecksumMode:()=>Ci,ChecksumType:()=>vs,CompleteMultipartUploadCommand:()=>MA,CompleteMultipartUploadOutputFilterSensitiveLog:()=>Ri,CompleteMultipartUploadRequestFilterSensitiveLog:()=>Oi,CompressionType:()=>go,CopyObjectCommand:()=>UA,CopyObjectOutputFilterSensitiveLog:()=>Di,CopyObjectRequestFilterSensitiveLog:()=>ji,CreateBucketCommand:()=>KA,CreateBucketMetadataTableConfigurationCommand:()=>$A,CreateMultipartUploadCommand:()=>qA,CreateMultipartUploadOutputFilterSensitiveLog:()=>_i,CreateMultipartUploadRequestFilterSensitiveLog:()=>Ni,CreateSessionCommand:()=>_T,CreateSessionOutputFilterSensitiveLog:()=>Ui,CreateSessionRequestFilterSensitiveLog:()=>zi,DataRedundancy:()=>Ms,DeleteBucketAnalyticsConfigurationCommand:()=>FA,DeleteBucketCommand:()=>GA,DeleteBucketCorsCommand:()=>HA,DeleteBucketEncryptionCommand:()=>VA,DeleteBucketIntelligentTieringConfigurationCommand:()=>WA,DeleteBucketInventoryConfigurationCommand:()=>YA,DeleteBucketLifecycleCommand:()=>XA,DeleteBucketMetadataTableConfigurationCommand:()=>ZA,DeleteBucketMetricsConfigurationCommand:()=>JA,DeleteBucketOwnershipControlsCommand:()=>QA,DeleteBucketPolicyCommand:()=>eB,DeleteBucketReplicationCommand:()=>tB,DeleteBucketTaggingCommand:()=>nB,DeleteBucketWebsiteCommand:()=>rB,DeleteMarkerReplicationStatus:()=>ai,DeleteObjectCommand:()=>sB,DeleteObjectTaggingCommand:()=>oB,DeleteObjectsCommand:()=>iB,DeletePublicAccessBlockCommand:()=>aB,EncodingType:()=>Ai,EncryptionFilterSensitiveLog:()=>To,EncryptionTypeMismatch:()=>co,Event:()=>ii,ExistingObjectReplicationStatus:()=>li,ExpirationStatus:()=>ei,ExpressionType:()=>fo,FileHeaderInfo:()=>yo,FilterRuleName:()=>oi,GetBucketAccelerateConfigurationCommand:()=>cB,GetBucketAclCommand:()=>uB,GetBucketAnalyticsConfigurationCommand:()=>lB,GetBucketCorsCommand:()=>dB,GetBucketEncryptionCommand:()=>pB,GetBucketEncryptionOutputFilterSensitiveLog:()=>qi,GetBucketIntelligentTieringConfigurationCommand:()=>mB,GetBucketInventoryConfigurationCommand:()=>hB,GetBucketInventoryConfigurationOutputFilterSensitiveLog:()=>Yi,GetBucketLifecycleConfigurationCommand:()=>fB,GetBucketLocationCommand:()=>gB,GetBucketLoggingCommand:()=>yB,GetBucketMetadataTableConfigurationCommand:()=>bB,GetBucketMetricsConfigurationCommand:()=>CB,GetBucketNotificationConfigurationCommand:()=>SB,GetBucketOwnershipControlsCommand:()=>wB,GetBucketPolicyCommand:()=>EB,GetBucketPolicyStatusCommand:()=>kB,GetBucketReplicationCommand:()=>vB,GetBucketRequestPaymentCommand:()=>xB,GetBucketTaggingCommand:()=>TB,GetBucketVersioningCommand:()=>AB,GetBucketWebsiteCommand:()=>BB,GetObjectAclCommand:()=>PB,GetObjectAttributesCommand:()=>IB,GetObjectAttributesRequestFilterSensitiveLog:()=>Ji,GetObjectCommand:()=>RB,GetObjectLegalHoldCommand:()=>OB,GetObjectLockConfigurationCommand:()=>DB,GetObjectOutputFilterSensitiveLog:()=>Xi,GetObjectRequestFilterSensitiveLog:()=>Zi,GetObjectRetentionCommand:()=>jB,GetObjectTaggingCommand:()=>_B,GetObjectTorrentCommand:()=>NB,GetObjectTorrentOutputFilterSensitiveLog:()=>Qi,GetPublicAccessBlockCommand:()=>MB,HeadBucketCommand:()=>UB,HeadObjectCommand:()=>zB,HeadObjectOutputFilterSensitiveLog:()=>eo,HeadObjectRequestFilterSensitiveLog:()=>to,IntelligentTieringAccessTier:()=>Ws,IntelligentTieringStatus:()=>Vs,InvalidObjectState:()=>Si,InvalidRequest:()=>uo,InvalidWriteOffset:()=>lo,InventoryConfigurationFilterSensitiveLog:()=>Wi,InventoryDestinationFilterSensitiveLog:()=>Vi,InventoryEncryptionFilterSensitiveLog:()=>Gi,InventoryFormat:()=>Ys,InventoryFrequency:()=>Js,InventoryIncludedObjectVersions:()=>Xs,InventoryOptionalField:()=>Zs,InventoryS3BucketDestinationFilterSensitiveLog:()=>Hi,JSONType:()=>bo,ListBucketAnalyticsConfigurationsCommand:()=>LB,ListBucketIntelligentTieringConfigurationsCommand:()=>KB,ListBucketInventoryConfigurationsCommand:()=>$B,ListBucketInventoryConfigurationsOutputFilterSensitiveLog:()=>no,ListBucketMetricsConfigurationsCommand:()=>qB,ListBucketsCommand:()=>FB,ListDirectoryBucketsCommand:()=>GB,ListMultipartUploadsCommand:()=>HB,ListObjectVersionsCommand:()=>YB,ListObjectsCommand:()=>VB,ListObjectsV2Command:()=>WB,ListPartsCommand:()=>XB,ListPartsRequestFilterSensitiveLog:()=>ro,LocationType:()=>zs,MFADelete:()=>ao,MFADeleteStatus:()=>fi,MetadataDirective:()=>Bs,MetricsFilter:()=>si,MetricsStatus:()=>ci,NoSuchBucket:()=>qs,NoSuchKey:()=>wi,NoSuchUpload:()=>Cs,NotFound:()=>xi,ObjectAlreadyInActiveTierError:()=>mo,ObjectAttributes:()=>Ei,ObjectCannedACL:()=>Ts,ObjectLockEnabled:()=>ki,ObjectLockLegalHoldStatus:()=>Ps,ObjectLockMode:()=>Is,ObjectLockRetentionMode:()=>vi,ObjectNotInActiveTierError:()=>Ds,ObjectOwnership:()=>Ks,ObjectStorageClass:()=>Bi,ObjectVersionStorageClass:()=>Ii,OptionalObjectAttributes:()=>Pi,OutputLocationFilterSensitiveLog:()=>Bo,OwnerOverride:()=>ks,PartitionDateSource:()=>ri,Payer:()=>hi,Permission:()=>Es,Protocol:()=>yi,PutBucketAccelerateConfigurationCommand:()=>ZB,PutBucketAclCommand:()=>JB,PutBucketAnalyticsConfigurationCommand:()=>QB,PutBucketCorsCommand:()=>eP,PutBucketEncryptionCommand:()=>tP,PutBucketEncryptionRequestFilterSensitiveLog:()=>Eo,PutBucketIntelligentTieringConfigurationCommand:()=>nP,PutBucketInventoryConfigurationCommand:()=>rP,PutBucketInventoryConfigurationRequestFilterSensitiveLog:()=>ko,PutBucketLifecycleConfigurationCommand:()=>sP,PutBucketLoggingCommand:()=>iP,PutBucketMetricsConfigurationCommand:()=>oP,PutBucketNotificationConfigurationCommand:()=>aP,PutBucketOwnershipControlsCommand:()=>cP,PutBucketPolicyCommand:()=>uP,PutBucketReplicationCommand:()=>lP,PutBucketRequestPaymentCommand:()=>dP,PutBucketTaggingCommand:()=>pP,PutBucketVersioningCommand:()=>mP,PutBucketWebsiteCommand:()=>hP,PutObjectAclCommand:()=>fP,PutObjectCommand:()=>gP,PutObjectLegalHoldCommand:()=>yP,PutObjectLockConfigurationCommand:()=>bP,PutObjectOutputFilterSensitiveLog:()=>vo,PutObjectRequestFilterSensitiveLog:()=>xo,PutObjectRetentionCommand:()=>CP,PutObjectTaggingCommand:()=>SP,PutPublicAccessBlockCommand:()=>wP,QuoteFields:()=>Co,ReplicaModificationsStatus:()=>di,ReplicationRuleStatus:()=>mi,ReplicationStatus:()=>bi,ReplicationTimeStatus:()=>ui,RequestCharged:()=>ys,RequestPayer:()=>bs,RestoreObjectCommand:()=>EP,RestoreObjectRequestFilterSensitiveLog:()=>Io,RestoreRequestFilterSensitiveLog:()=>Po,RestoreRequestType:()=>So,S3:()=>BP,S3Client:()=>OA,S3LocationFilterSensitiveLog:()=>Ao,S3ServiceException:()=>gs,SSEKMSFilterSensitiveLog:()=>Fi,SelectObjectContentCommand:()=>kP,SelectObjectContentEventStream:()=>wo,SelectObjectContentEventStreamFilterSensitiveLog:()=>Ro,SelectObjectContentOutputFilterSensitiveLog:()=>Oo,SelectObjectContentRequestFilterSensitiveLog:()=>Do,ServerSideEncryption:()=>xs,ServerSideEncryptionByDefaultFilterSensitiveLog:()=>Li,ServerSideEncryptionConfigurationFilterSensitiveLog:()=>$i,ServerSideEncryptionRuleFilterSensitiveLog:()=>Ki,SessionCredentialsFilterSensitiveLog:()=>Mi,SessionMode:()=>$s,SseKmsEncryptedObjectsStatus:()=>pi,StorageClass:()=>Rs,StorageClassAnalysisSchemaVersion:()=>Hs,TaggingDirective:()=>Os,Tier:()=>ho,TooManyParts:()=>po,TransitionDefaultMinimumObjectSize:()=>ti,TransitionStorageClass:()=>Qs,Type:()=>ws,UploadPartCommand:()=>vP,UploadPartCopyCommand:()=>xP,UploadPartCopyOutputFilterSensitiveLog:()=>No,UploadPartCopyRequestFilterSensitiveLog:()=>Mo,UploadPartOutputFilterSensitiveLog:()=>jo,UploadPartRequestFilterSensitiveLog:()=>_o,WriteGetObjectResponseCommand:()=>TP,WriteGetObjectResponseRequestFilterSensitiveLog:()=>Uo,__Client:()=>Q.Kj,paginateListBuckets:()=>PP,paginateListDirectoryBuckets:()=>IP,paginateListObjectsV2:()=>RP,paginateListParts:()=>OP,waitForBucketExists:()=>FP,waitForBucketNotExists:()=>VP,waitForObjectExists:()=>XP,waitForObjectNotExists:()=>QP,waitUntilBucketExists:()=>GP,waitUntilBucketNotExists:()=>WP,waitUntilObjectExists:()=>ZP,waitUntilObjectNotExists:()=>eI});var r=n(130);const s={step:"build",tags:["SET_EXPECT_HEADER","EXPECT_HEADER"],name:"addExpectContinueMiddleware",override:!0},i={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},o=i.WHEN_SUPPORTED,a={WHEN_SUPPORTED:"WHEN_SUPPORTED",WHEN_REQUIRED:"WHEN_REQUIRED"},c=i.WHEN_SUPPORTED;var u,l;!function(e){e.MD5="MD5",e.CRC32="CRC32",e.CRC32C="CRC32C",e.CRC64NVME="CRC64NVME",e.SHA1="SHA1",e.SHA256="SHA256"}(u||(u={})),function(e){e.HEADER="header",e.TRAILER="trailer"}(l||(l={}));const d=u.CRC32;var p;!function(e){e.ENV="env",e.CONFIG="shared config entry"}(p||(p={}));const m=(e,t,n,r)=>{if(!(t in e))return;const s=e[t].toUpperCase();if(!Object.values(n).includes(s))throw new TypeError(`Cannot load ${r} '${t}'. Expected one of ${Object.values(n)}, got '${e[t]}'.`);return s},h={environmentVariableSelector:e=>m(e,"AWS_REQUEST_CHECKSUM_CALCULATION",i,p.ENV),configFileSelector:e=>m(e,"request_checksum_calculation",i,p.CONFIG),default:o},f={environmentVariableSelector:e=>m(e,"AWS_RESPONSE_CHECKSUM_VALIDATION",a,p.ENV),configFileSelector:e=>m(e,"response_checksum_validation",a,p.CONFIG),default:c};var g=n(1336),y=n(9491);const b=[u.CRC32,u.CRC32C,u.CRC64NVME,u.SHA1,u.SHA256],C=[u.SHA256,u.SHA1,u.CRC32,u.CRC32C,u.CRC64NVME],S=e=>e===u.MD5?"content-md5":`x-amz-checksum-${e.toLowerCase()}`;var w=n(1150);const E=e=>void 0!==e&&"string"!=typeof e&&!ArrayBuffer.isView(e)&&!(0,w.m)(e);function k(e,t,n,r){return new(n||(n=Promise))((function(s,i){function o(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?s(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function v(e,t){var n,r,s,i={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(i=0)),i;)try{if(n=1,r&&(s=2&a[0]?r.return:a[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;switch(r=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((s=(s=i.trys).length>0&&s[s.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(6===a[0]&&i.label<s[1]){i.label=s[1],s=a;break}if(s&&i.label<s[2]){i.label=s[2],i.ops.push(a);break}s[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function x(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var T=n(181),A="undefined"!=typeof Buffer&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:e=>{const t=((e,t)=>{if("string"!=typeof e)throw new TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?T.Buffer.from(e,t):T.Buffer.from(e)})(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function B(e){return e instanceof Uint8Array?e:"string"==typeof e?A(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}function P(e){return"string"==typeof e?0===e.length:0===e.byteLength}function I(e){return new Uint8Array([(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])}function R(e){if(!Uint32Array.from){for(var t=new Uint32Array(e.length),n=0;n<e.length;)t[n]=e[n],n+=1;return t}return Uint32Array.from(e)}var O=function(){function e(){this.crc32c=new D}return e.prototype.update=function(e){P(e)||this.crc32c.update(B(e))},e.prototype.digest=function(){return k(this,void 0,void 0,(function(){return v(this,(function(e){return[2,I(this.crc32c.digest())]}))}))},e.prototype.reset=function(){this.crc32c=new D},e}(),D=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var r=x(e),s=r.next();!s.done;s=r.next()){var i=s.value;this.checksum=this.checksum>>>8^j[255&(this.checksum^i)]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}(),j=R([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]),_=function(){function e(){this.crc32=new N}return e.prototype.update=function(e){P(e)||this.crc32.update(B(e))},e.prototype.digest=function(){return k(this,void 0,void 0,(function(){return v(this,(function(e){return[2,I(this.crc32.digest())]}))}))},e.prototype.reset=function(){this.crc32=new N},e}(),N=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var t,n;try{for(var r=x(e),s=r.next();!s.done;s=r.next()){var i=s.value;this.checksum=this.checksum>>>8^M[255&(this.checksum^i)]}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return this},e.prototype.digest=function(){return(4294967295^this.checksum)>>>0},e}(),M=R([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,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);const U=require("zlib");class z{checksum=0;update(e){this.checksum=U.crc32(e,this.checksum)}async digest(){return I(this.checksum)}reset(){this.checksum=0}}const L=(e,t)=>{switch(e){case u.MD5:return t.md5;case u.CRC32:return void 0===U.crc32?_:z;case u.CRC32C:return O;case u.CRC64NVME:throw new Error('Please check whether you have installed the "@aws-sdk/crc64-nvme-crt" package explicitly. \nYou must also register the package by calling [require("@aws-sdk/crc64-nvme-crt");] or an ESM equivalent such as [import "@aws-sdk/crc64-nvme-crt";]. \nFor more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt');case u.SHA1:return t.sha1;case u.SHA256:return t.sha256;default:throw new Error(`Unsupported checksum algorithm: ${e}`)}};var K=n(7670);const $=(e,t)=>{const n=new e;return n.update((0,K.Fo)(t||"")),n.digest()},q={name:"flexibleChecksumsMiddleware",step:"build",tags:["BODY_CHECKSUM"],override:!0},F={name:"flexibleChecksumsInputMiddleware",toMiddleware:"serializerMiddleware",relation:"before",tags:["BODY_CHECKSUM"],override:!0},G=(e=[])=>{const t=[];for(const n of C)e.includes(n)&&b.includes(n)&&t.push(n);return t},H=async(e,{checksumAlgorithmFn:t,base64Encoder:n})=>n(await $(t,e)),V={name:"flexibleChecksumsResponseMiddleware",toMiddleware:"deserializerMiddleware",relation:"after",tags:["BODY_CHECKSUM"],override:!0},W=(e,t)=>({applyToStack:n=>{n.add(((e,t)=>(n,s)=>async o=>{if(!r.Kd.isInstance(o.request))return n(o);if(((e,t)=>{const n="x-amz-checksum-".toLowerCase();for(const e of Object.keys(t))if(e.toLowerCase().startsWith(n))return!0;return!1})(0,o.request.headers))return n(o);const{request:a,input:c}=o,{body:l,headers:p}=a,{base64Encoder:m,streamHasher:h}=e,{requestChecksumRequired:f,requestAlgorithmMember:C}=t,w=await e.requestChecksumCalculation(),k=C?.name,v=C?.httpHeader;k&&!c[k]&&(w===i.WHEN_SUPPORTED||f)&&(c[k]=d,v&&(p[v]=d));const x=((e,{requestChecksumRequired:t,requestAlgorithmMember:n,requestChecksumCalculation:r})=>{if(!n)return r===i.WHEN_SUPPORTED||t?d:void 0;if(!e[n])return;const s=e[n];if(!b.includes(s))throw new Error(`The checksum algorithm "${s}" is not supported by the client. Select one of ${b}.`);return s})(c,{requestChecksumRequired:f,requestAlgorithmMember:C?.name,requestChecksumCalculation:w});let T=l,A=p;if(x){switch(x){case u.CRC32:(0,g.J)(s,"FLEXIBLE_CHECKSUMS_REQ_CRC32","U");break;case u.CRC32C:(0,g.J)(s,"FLEXIBLE_CHECKSUMS_REQ_CRC32C","V");break;case u.CRC64NVME:(0,g.J)(s,"FLEXIBLE_CHECKSUMS_REQ_CRC64","W");break;case u.SHA1:(0,g.J)(s,"FLEXIBLE_CHECKSUMS_REQ_SHA1","X");break;case u.SHA256:(0,g.J)(s,"FLEXIBLE_CHECKSUMS_REQ_SHA256","Y")}const t=S(x),n=L(x,e);if(E(l)){const{getAwsChunkedEncodingStream:r,bodyLengthChecker:i}=e;T=r("number"==typeof e.requestStreamBufferSize&&e.requestStreamBufferSize>=8192?(0,y.M2)(l,e.requestStreamBufferSize,s.logger):l,{base64Encoder:m,bodyLengthChecker:i,checksumLocationName:t,checksumAlgorithmFn:n,streamHasher:h}),A={...p,"content-encoding":p["content-encoding"]?`${p["content-encoding"]},aws-chunked`:"aws-chunked","transfer-encoding":"chunked","x-amz-decoded-content-length":p["content-length"],"x-amz-content-sha256":"STREAMING-UNSIGNED-PAYLOAD-TRAILER","x-amz-trailer":t},delete A["content-length"]}else if(!((e,t)=>{const n=e.toLowerCase();for(const e of Object.keys(t))if(n===e.toLowerCase())return!0;return!1})(t,p)){const e=await $(n,l);A={...p,[t]:m(e)}}}return await n({...o,request:{...a,headers:A,body:T}})})(e,t),q),n.addRelativeTo(((e,t)=>(n,r)=>async s=>{const o=s.input,{requestValidationModeMember:c}=t,u=await e.requestChecksumCalculation(),l=await e.responseChecksumValidation();switch(u){case i.WHEN_REQUIRED:(0,g.J)(r,"FLEXIBLE_CHECKSUMS_REQ_WHEN_REQUIRED","a");break;case i.WHEN_SUPPORTED:(0,g.J)(r,"FLEXIBLE_CHECKSUMS_REQ_WHEN_SUPPORTED","Z")}switch(l){case a.WHEN_REQUIRED:(0,g.J)(r,"FLEXIBLE_CHECKSUMS_RES_WHEN_REQUIRED","c");break;case a.WHEN_SUPPORTED:(0,g.J)(r,"FLEXIBLE_CHECKSUMS_RES_WHEN_SUPPORTED","b")}return c&&!o[c]&&l===a.WHEN_SUPPORTED&&(o[c]="ENABLED"),n(s)})(e,t),F),n.addRelativeTo(((e,t)=>(n,s)=>async i=>{if(!r.Kd.isInstance(i.request))return n(i);const o=i.input,a=await n(i),c=a.response,{requestValidationModeMember:l,responseAlgorithms:d}=t;if(l&&"ENABLED"===o[l]){const{clientName:t,commandName:n}=s;if("S3Client"===t&&"GetObjectCommand"===n&&G(d).every((e=>{const t=S(e),n=c.headers[t];return!n||(e=>{const t=e.lastIndexOf("-");if(-1!==t){const n=e.slice(t+1);if(!n.startsWith("