@awsless/cli 0.0.34 → 0.0.36
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/bin.js +3 -3
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-error-log/bundle.zip +0 -0
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/pubsub-publisher/HASH +1 -1
- package/dist/prebuild/pubsub-publisher/bundle.zip +0 -0
- package/dist/prebuild/pubsub-server/HASH +1 -1
- package/dist/prebuild/pubsub-server/index.mjs +23 -23
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/package.json +10 -10
|
@@ -25,26 +25,26 @@ ${(0,t.toHex)(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];fo
|
|
|
25
25
|
`);let i=t.parse(e),a=`#text`,o=Object.keys(i)[0],s=i[o];return s[a]&&(s[o]=s[a],delete s[a]),(0,n.getValueFromTextNode)(s)}return{}}),je=async(e,t)=>{let n=await Ae(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},Me=e=>Object.entries(e).map(([e,t])=>(0,n.extendedEncodeURIComponent)(e)+`=`+(0,n.extendedEncodeURIComponent)(t)).join(`&`),Ne=(e,t)=>{if(t.Error?.Code!==void 0)return t.Error.Code;if(e.statusCode==404)return`NotFound`}})),as=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AssumeRoleCommand=void 0;let t=L(),n=F(),r=xa(),i=P(),a=is();e.AssumeRoleCommand=class e extends i.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(i,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions())),this.middlewareStack.use((0,r.getAwsAuthPlugin)(a));let s=i.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`STSClient`,commandName:`AssumeRoleCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_AssumeRoleCommand)(e,t)}deserialize(e,t){return(0,a.de_AssumeRoleCommand)(e,t)}}})),os=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AssumeRoleWithSAMLCommand=void 0;let t=L(),n=F(),r=P(),i=is();e.AssumeRoleWithSAMLCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`STSClient`,commandName:`AssumeRoleWithSAMLCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_AssumeRoleWithSAMLCommand)(e,t)}deserialize(e,t){return(0,i.de_AssumeRoleWithSAMLCommand)(e,t)}}})),ss=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AssumeRoleWithWebIdentityCommand=void 0;let t=L(),n=F(),r=P(),i=is();e.AssumeRoleWithWebIdentityCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`STSClient`,commandName:`AssumeRoleWithWebIdentityCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_AssumeRoleWithWebIdentityCommand)(e,t)}deserialize(e,t){return(0,i.de_AssumeRoleWithWebIdentityCommand)(e,t)}}})),cs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DecodeAuthorizationMessageCommand=void 0;let t=L(),n=F(),r=xa(),i=P(),a=is();e.DecodeAuthorizationMessageCommand=class e extends i.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(i,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions())),this.middlewareStack.use((0,r.getAwsAuthPlugin)(a));let s=i.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`STSClient`,commandName:`DecodeAuthorizationMessageCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_DecodeAuthorizationMessageCommand)(e,t)}deserialize(e,t){return(0,a.de_DecodeAuthorizationMessageCommand)(e,t)}}})),ls=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GetAccessKeyInfoCommand=void 0;let t=L(),n=F(),r=xa(),i=P(),a=is();e.GetAccessKeyInfoCommand=class e extends i.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(i,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions())),this.middlewareStack.use((0,r.getAwsAuthPlugin)(a));let s=i.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`STSClient`,commandName:`GetAccessKeyInfoCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_GetAccessKeyInfoCommand)(e,t)}deserialize(e,t){return(0,a.de_GetAccessKeyInfoCommand)(e,t)}}})),us=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GetCallerIdentityCommand=void 0;let t=L(),n=F(),r=xa(),i=P(),a=is();e.GetCallerIdentityCommand=class e extends i.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(i,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions())),this.middlewareStack.use((0,r.getAwsAuthPlugin)(a));let s=i.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`STSClient`,commandName:`GetCallerIdentityCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_GetCallerIdentityCommand)(e,t)}deserialize(e,t){return(0,a.de_GetCallerIdentityCommand)(e,t)}}})),ds=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GetFederationTokenCommand=void 0;let t=L(),n=F(),r=xa(),i=P(),a=is();e.GetFederationTokenCommand=class e extends i.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(i,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions())),this.middlewareStack.use((0,r.getAwsAuthPlugin)(a));let s=i.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`STSClient`,commandName:`GetFederationTokenCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_GetFederationTokenCommand)(e,t)}deserialize(e,t){return(0,a.de_GetFederationTokenCommand)(e,t)}}})),fs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GetSessionTokenCommand=void 0;let t=L(),n=F(),r=xa(),i=P(),a=is();e.GetSessionTokenCommand=class e extends i.Command{static getEndpointParameterInstructions(){return{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`}}}constructor(e){super(),this.input=e}resolveMiddleware(i,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions())),this.middlewareStack.use((0,r.getAwsAuthPlugin)(a));let s=i.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`STSClient`,commandName:`GetSessionTokenCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_GetSessionTokenCommand)(e,t)}deserialize(e,t){return(0,a.de_GetSessionTokenCommand)(e,t)}}})),ps=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveStsAuthConfig=void 0;let t=xa();e.resolveStsAuthConfig=(e,{stsClientCtor:n})=>(0,t.resolveAwsAuthConfig)({...e,stsClientCtor:n})})),ms=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveClientEndpointParameters=void 0,e.resolveClientEndpointParameters=e=>({...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:`sts`})})),hs=u(((e,t)=>{t.exports={name:`@aws-sdk/client-sts`,description:`AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native`,version:`3.329.0`,scripts:{build:`concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'`,"build:cjs":`tsc -p tsconfig.cjs.json`,"build:docs":`typedoc`,"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 sts`,test:`yarn test:unit`,"test:unit":`jest`},main:`./dist-cjs/index.js`,types:`./dist-types/index.d.ts`,module:`./dist-es/index.js`,sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":`3.0.0`,"@aws-crypto/sha256-js":`3.0.0`,"@aws-sdk/config-resolver":`3.329.0`,"@aws-sdk/credential-provider-node":`3.329.0`,"@aws-sdk/fetch-http-handler":`3.329.0`,"@aws-sdk/hash-node":`3.329.0`,"@aws-sdk/invalid-dependency":`3.329.0`,"@aws-sdk/middleware-content-length":`3.329.0`,"@aws-sdk/middleware-endpoint":`3.329.0`,"@aws-sdk/middleware-host-header":`3.329.0`,"@aws-sdk/middleware-logger":`3.329.0`,"@aws-sdk/middleware-recursion-detection":`3.329.0`,"@aws-sdk/middleware-retry":`3.329.0`,"@aws-sdk/middleware-sdk-sts":`3.329.0`,"@aws-sdk/middleware-serde":`3.329.0`,"@aws-sdk/middleware-signing":`3.329.0`,"@aws-sdk/middleware-stack":`3.329.0`,"@aws-sdk/middleware-user-agent":`3.329.0`,"@aws-sdk/node-config-provider":`3.329.0`,"@aws-sdk/node-http-handler":`3.329.0`,"@aws-sdk/protocol-http":`3.329.0`,"@aws-sdk/smithy-client":`3.329.0`,"@aws-sdk/types":`3.329.0`,"@aws-sdk/url-parser":`3.329.0`,"@aws-sdk/util-base64":`3.310.0`,"@aws-sdk/util-body-length-browser":`3.310.0`,"@aws-sdk/util-body-length-node":`3.310.0`,"@aws-sdk/util-defaults-mode-browser":`3.329.0`,"@aws-sdk/util-defaults-mode-node":`3.329.0`,"@aws-sdk/util-endpoints":`3.329.0`,"@aws-sdk/util-retry":`3.329.0`,"@aws-sdk/util-user-agent-browser":`3.329.0`,"@aws-sdk/util-user-agent-node":`3.329.0`,"@aws-sdk/util-utf8":`3.310.0`,"fast-xml-parser":`4.1.2`,tslib:`^2.5.0`},devDependencies:{"@aws-sdk/service-client-documentation-generator":`3.310.0`,"@tsconfig/node14":`1.0.3`,"@types/node":`^14.14.31`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,rimraf:`3.0.2`,typedoc:`0.23.23`,typescript:`~4.9.5`},engines:{node:`>=14.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-sts`,repository:{type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-sts`}}})),gs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.decorateDefaultCredentialProvider=e.getDefaultRoleAssumerWithWebIdentity=e.getDefaultRoleAssumer=void 0;let t=as(),n=ss(),r=`us-east-1`,i=e=>typeof e==`function`?async()=>{try{return await e()}catch{return r}}:e===void 0?r:e;e.getDefaultRoleAssumer=(e,n)=>{let r,a;return async(o,s)=>{if(a=o,!r){let{logger:t,region:o,requestHandler:s}=e;r=new n({logger:t,credentialDefaultProvider:()=>async()=>a,region:i(o||e.region),...s?{requestHandler:s}:{}})}let{Credentials:c}=await r.send(new t.AssumeRoleCommand(s));if(!c||!c.AccessKeyId||!c.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${s.RoleArn}`);return{accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.SessionToken,expiration:c.Expiration}}},e.getDefaultRoleAssumerWithWebIdentity=(e,t)=>{let r;return async a=>{if(!r){let{logger:n,region:a,requestHandler:o}=e;r=new t({logger:n,region:i(a||e.region),...o?{requestHandler:o}:{}})}let{Credentials:o}=await r.send(new n.AssumeRoleWithWebIdentityCommand(a));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${a.RoleArn}`);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration}}},e.decorateDefaultCredentialProvider=t=>n=>t({roleAssumer:(0,e.getDefaultRoleAssumer)(n,n.stsClientCtor),roleAssumerWithWebIdentity:(0,e.getDefaultRoleAssumerWithWebIdentity)(n,n.stsClientCtor),...n})})),_s=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromEnv=e.ENV_EXPIRATION=e.ENV_SESSION=e.ENV_SECRET=e.ENV_KEY=void 0;let t=qi();e.ENV_KEY=`AWS_ACCESS_KEY_ID`,e.ENV_SECRET=`AWS_SECRET_ACCESS_KEY`,e.ENV_SESSION=`AWS_SESSION_TOKEN`,e.ENV_EXPIRATION=`AWS_CREDENTIAL_EXPIRATION`,e.fromEnv=()=>async()=>{let n=process.env[e.ENV_KEY],r=process.env[e.ENV_SECRET],i=process.env[e.ENV_SESSION],a=process.env[e.ENV_EXPIRATION];if(n&&r)return{accessKeyId:n,secretAccessKey:r,...i&&{sessionToken:i},...a&&{expiration:new Date(a)}};throw new t.CredentialsProviderError(`Unable to find environment variable credentials.`)}})),vs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(_s(),e)})),ys=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getHomeDir=void 0;let t=h(`os`),n=h(`path`);e.getHomeDir=()=>{let{HOME:e,USERPROFILE:r,HOMEPATH:i,HOMEDRIVE:a=`C:${n.sep}`}=process.env;return e||r||(i?`${a}${i}`:(0,t.homedir)())}})),bs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getProfileName=e.DEFAULT_PROFILE=e.ENV_PROFILE=void 0,e.ENV_PROFILE=`AWS_PROFILE`,e.DEFAULT_PROFILE=`default`,e.getProfileName=t=>t.profile||process.env[e.ENV_PROFILE]||e.DEFAULT_PROFILE})),xs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSSOTokenFilepath=void 0;let t=h(`crypto`),n=h(`path`),r=ys();e.getSSOTokenFilepath=e=>{let i=(0,t.createHash)(`sha1`).update(e).digest(`hex`);return(0,n.join)((0,r.getHomeDir)(),`.aws`,`sso`,`cache`,`${i}.json`)}})),Ss=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSSOTokenFromFile=void 0;let t=h(`fs`),n=xs(),{readFile:r}=t.promises;e.getSSOTokenFromFile=async e=>{let t=await r((0,n.getSSOTokenFilepath)(e),`utf8`);return JSON.parse(t)}})),Cs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getConfigFilepath=e.ENV_CONFIG_PATH=void 0;let t=h(`path`),n=ys();e.ENV_CONFIG_PATH=`AWS_CONFIG_FILE`,e.getConfigFilepath=()=>process.env[e.ENV_CONFIG_PATH]||(0,t.join)((0,n.getHomeDir)(),`.aws`,`config`)})),ws=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getCredentialsFilepath=e.ENV_CREDENTIALS_PATH=void 0;let t=h(`path`),n=ys();e.ENV_CREDENTIALS_PATH=`AWS_SHARED_CREDENTIALS_FILE`,e.getCredentialsFilepath=()=>process.env[e.ENV_CREDENTIALS_PATH]||(0,t.join)((0,n.getHomeDir)(),`.aws`,`credentials`)})),Ts=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getProfileData=void 0;let t=/^profile\s(["'])?([^\1]+)\1$/;e.getProfileData=e=>Object.entries(e).filter(([e])=>t.test(e)).reduce((e,[n,r])=>({...e,[t.exec(n)[2]]:r}),{...e.default&&{default:e.default}})})),Es=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseIni=void 0;let t=[`__proto__`,`profile __proto__`];e.parseIni=e=>{let n={},r;for(let i of e.split(/\r?\n/))if(i=i.split(/(^|\s)[;#]/)[0].trim(),i[0]===`[`&&i[i.length-1]===`]`){if(r=i.substring(1,i.length-1),t.includes(r))throw Error(`Found invalid profile name "${r}"`)}else if(r){let e=i.indexOf(`=`),t=i.length-1;if(e!==-1&&e!==0&&e!==t){let[t,a]=[i.substring(0,e).trim(),i.substring(e+1).trim()];n[r]=n[r]||{},n[r][t]=a}}return n}})),Ds=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.slurpFile=void 0;let{readFile:t}=h(`fs`).promises,n={};e.slurpFile=(e,r)=>((!n[e]||r?.ignoreCache)&&(n[e]=t(e,`utf8`)),n[e])})),Os=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.loadSharedConfigFiles=void 0;let t=Cs(),n=ws(),r=Ts(),i=Es(),a=Ds(),o=()=>({});e.loadSharedConfigFiles=async(e={})=>{let{filepath:s=(0,n.getCredentialsFilepath)(),configFilepath:c=(0,t.getConfigFilepath)()}=e,l=await Promise.all([(0,a.slurpFile)(c,{ignoreCache:e.ignoreCache}).then(i.parseIni).then(r.getProfileData).catch(o),(0,a.slurpFile)(s,{ignoreCache:e.ignoreCache}).then(i.parseIni).catch(o)]);return{configFile:l[0],credentialsFile:l[1]}}})),ks=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSsoSessionData=void 0;let t=/^sso-session\s(["'])?([^\1]+)\1$/;e.getSsoSessionData=e=>Object.entries(e).filter(([e])=>t.test(e)).reduce((e,[n,r])=>({...e,[t.exec(n)[2]]:r}),{})})),As=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.loadSsoSessionData=void 0;let t=Cs(),n=ks(),r=Es(),i=Ds(),a=()=>({});e.loadSsoSessionData=async(e={})=>(0,i.slurpFile)(e.configFilepath??(0,t.getConfigFilepath)()).then(r.parseIni).then(n.getSsoSessionData).catch(a)})),js=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.mergeConfigFiles=void 0,e.mergeConfigFiles=(...e)=>{let t={};for(let n of e)for(let[e,r]of Object.entries(n))t[e]===void 0?t[e]=r:Object.assign(t[e],r);return t}})),Ms=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseKnownFiles=void 0;let t=Os(),n=js();e.parseKnownFiles=async e=>{let r=await(0,t.loadSharedConfigFiles)(e);return(0,n.mergeConfigFiles)(r.configFile,r.credentialsFile)}})),Ns=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Ps=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(ys(),e),t.__exportStar(bs(),e),t.__exportStar(xs(),e),t.__exportStar(Ss(),e),t.__exportStar(Os(),e),t.__exportStar(As(),e),t.__exportStar(Ms(),e),t.__exportStar(Ns(),e)})),Fs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.httpRequest=void 0;let t=qi(),n=h(`buffer`),r=h(`http`);function i(e){return new Promise((i,a)=>{let o=(0,r.request)({method:`GET`,...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,`$1`)});o.on(`error`,e=>{a(Object.assign(new t.ProviderError(`Unable to connect to instance metadata service`),e)),o.destroy()}),o.on(`timeout`,()=>{a(new t.ProviderError(`TimeoutError from instance metadata service`)),o.destroy()}),o.on(`response`,e=>{let{statusCode:r=400}=e;(r<200||300<=r)&&(a(Object.assign(new t.ProviderError(`Error response received from instance metadata service`),{statusCode:r})),o.destroy());let s=[];e.on(`data`,e=>{s.push(e)}),e.on(`end`,()=>{i(n.Buffer.concat(s)),o.destroy()})}),o.end()})}e.httpRequest=i})),Is=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromImdsCredentials=e.isImdsCredentials=void 0,e.isImdsCredentials=e=>!!e&&typeof e==`object`&&typeof e.AccessKeyId==`string`&&typeof e.SecretAccessKey==`string`&&typeof e.Token==`string`&&typeof e.Expiration==`string`,e.fromImdsCredentials=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration)})})),Ls=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.providerConfigFromInit=e.DEFAULT_MAX_RETRIES=e.DEFAULT_TIMEOUT=void 0,e.DEFAULT_TIMEOUT=1e3,e.DEFAULT_MAX_RETRIES=0,e.providerConfigFromInit=({maxRetries:t=e.DEFAULT_MAX_RETRIES,timeout:n=e.DEFAULT_TIMEOUT})=>({maxRetries:t,timeout:n})})),Rs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.retry=void 0,e.retry=(e,t)=>{let n=e();for(let r=0;r<t;r++)n=n.catch(e);return n}})),zs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromContainerMetadata=e.ENV_CMDS_AUTH_TOKEN=e.ENV_CMDS_RELATIVE_URI=e.ENV_CMDS_FULL_URI=void 0;let t=qi(),n=h(`url`),r=Fs(),i=Is(),a=Ls(),o=Rs();e.ENV_CMDS_FULL_URI=`AWS_CONTAINER_CREDENTIALS_FULL_URI`,e.ENV_CMDS_RELATIVE_URI=`AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`,e.ENV_CMDS_AUTH_TOKEN=`AWS_CONTAINER_AUTHORIZATION_TOKEN`,e.fromContainerMetadata=(e={})=>{let{timeout:n,maxRetries:r}=(0,a.providerConfigFromInit)(e);return()=>(0,o.retry)(async()=>{let e=await u(),r=JSON.parse(await s(n,e));if(!(0,i.isImdsCredentials)(r))throw new t.CredentialsProviderError(`Invalid response received from instance metadata service.`);return(0,i.fromImdsCredentials)(r)},r)};let s=async(t,n)=>(process.env[e.ENV_CMDS_AUTH_TOKEN]&&(n.headers={...n.headers,Authorization:process.env[e.ENV_CMDS_AUTH_TOKEN]}),(await(0,r.httpRequest)({...n,timeout:t})).toString()),c={localhost:!0,"127.0.0.1":!0},l={"http:":!0,"https:":!0},u=async()=>{if(process.env[e.ENV_CMDS_RELATIVE_URI])return{hostname:`169.254.170.2`,path:process.env[e.ENV_CMDS_RELATIVE_URI]};if(process.env[e.ENV_CMDS_FULL_URI]){let r=(0,n.parse)(process.env[e.ENV_CMDS_FULL_URI]);if(!r.hostname||!(r.hostname in c))throw new t.CredentialsProviderError(`${r.hostname} is not a valid container metadata service hostname`,!1);if(!r.protocol||!(r.protocol in l))throw new t.CredentialsProviderError(`${r.protocol} is not a valid container metadata service protocol`,!1);return{...r,port:r.port?parseInt(r.port,10):void 0}}throw new t.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${e.ENV_CMDS_RELATIVE_URI} or ${e.ENV_CMDS_FULL_URI} environment variable is set`,!1)}})),Bs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromEnv=void 0;let t=qi();e.fromEnv=e=>async()=>{try{let t=e(process.env);if(t===void 0)throw Error();return t}catch(n){throw new t.CredentialsProviderError(n.message||`Cannot load config from environment variables with getter: ${e}`)}}})),Vs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromSharedConfigFiles=void 0;let t=qi(),n=Ps();e.fromSharedConfigFiles=(e,{preferredFile:r=`config`,...i}={})=>async()=>{let a=(0,n.getProfileName)(i),{configFile:o,credentialsFile:s}=await(0,n.loadSharedConfigFiles)(i),c=s[a]||{},l=o[a]||{},u=r===`config`?{...c,...l}:{...l,...c};try{let t=e(u);if(t===void 0)throw Error();return t}catch(n){throw new t.CredentialsProviderError(n.message||`Cannot load config for profile ${a} in SDK configuration files with getter: ${e}`)}}})),Hs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromStatic=void 0;let t=qi(),n=e=>typeof e==`function`;e.fromStatic=e=>n(e)?async()=>await e():(0,t.fromStatic)(e)})),Us=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.loadConfig=void 0;let t=qi(),n=Bs(),r=Vs(),i=Hs();e.loadConfig=({environmentVariableSelector:e,configFileSelector:a,default:o},s={})=>(0,t.memoize)((0,t.chain)((0,n.fromEnv)(e),(0,r.fromSharedConfigFiles)(a,s),(0,i.fromStatic)(o)))})),Ws=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Us(),e)})),Gs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Endpoint=void 0,(function(e){e.IPv4=`http://169.254.169.254`,e.IPv6=`http://[fd00:ec2::254]`})(e.Endpoint||={})})),Ks=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ENDPOINT_CONFIG_OPTIONS=e.CONFIG_ENDPOINT_NAME=e.ENV_ENDPOINT_NAME=void 0,e.ENV_ENDPOINT_NAME=`AWS_EC2_METADATA_SERVICE_ENDPOINT`,e.CONFIG_ENDPOINT_NAME=`ec2_metadata_service_endpoint`,e.ENDPOINT_CONFIG_OPTIONS={environmentVariableSelector:t=>t[e.ENV_ENDPOINT_NAME],configFileSelector:t=>t[e.CONFIG_ENDPOINT_NAME],default:void 0}})),qs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.EndpointMode=void 0,(function(e){e.IPv4=`IPv4`,e.IPv6=`IPv6`})(e.EndpointMode||={})})),Js=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ENDPOINT_MODE_CONFIG_OPTIONS=e.CONFIG_ENDPOINT_MODE_NAME=e.ENV_ENDPOINT_MODE_NAME=void 0;let t=qs();e.ENV_ENDPOINT_MODE_NAME=`AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE`,e.CONFIG_ENDPOINT_MODE_NAME=`ec2_metadata_service_endpoint_mode`,e.ENDPOINT_MODE_CONFIG_OPTIONS={environmentVariableSelector:t=>t[e.ENV_ENDPOINT_MODE_NAME],configFileSelector:t=>t[e.CONFIG_ENDPOINT_MODE_NAME],default:t.EndpointMode.IPv4}})),Ys=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getInstanceMetadataEndpoint=void 0;let t=Ws(),n=Zt(),r=Gs(),i=Ks(),a=qs(),o=Js();e.getInstanceMetadataEndpoint=async()=>(0,n.parseUrl)(await s()||await c());let s=async()=>(0,t.loadConfig)(i.ENDPOINT_CONFIG_OPTIONS)(),c=async()=>{let e=await(0,t.loadConfig)(o.ENDPOINT_MODE_CONFIG_OPTIONS)();switch(e){case a.EndpointMode.IPv4:return r.Endpoint.IPv4;case a.EndpointMode.IPv6:return r.Endpoint.IPv6;default:throw Error(`Unsupported endpoint mode: ${e}. Select from ${Object.values(a.EndpointMode)}`)}}})),Xs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getExtendedInstanceMetadataCredentials=void 0,e.getExtendedInstanceMetadataCredentials=(e,t)=>{let n=300+Math.floor(Math.random()*300),r=new Date(Date.now()+n*1e3);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after \${new Date(newExpiration)}.
|
|
26
26
|
For more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let i=e.originalExpiration??e.expiration;return{...e,...i?{originalExpiration:i}:{},expiration:r}}})),Zs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.staticStabilityProvider=void 0;let t=Xs();e.staticStabilityProvider=(e,n={})=>{let r=n?.logger||console,i;return async()=>{let n;try{n=await e(),n.expiration&&n.expiration.getTime()<Date.now()&&(n=(0,t.getExtendedInstanceMetadataCredentials)(n,r))}catch(e){if(i)r.warn(`Credential renew failed: `,e),n=(0,t.getExtendedInstanceMetadataCredentials)(i,r);else throw e}return i=n,n}}})),Qs=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromInstanceMetadata=void 0;let t=qi(),n=Fs(),r=Is(),i=Ls(),a=Rs(),o=Ys(),s=Zs(),c=`/latest/meta-data/iam/security-credentials/`;e.fromInstanceMetadata=(e={})=>(0,s.staticStabilityProvider)(l(e),{logger:e.logger});let l=e=>{let t=!1,{timeout:n,maxRetries:r}=(0,i.providerConfigFromInit)(e),s=async(e,n)=>{let r=(await(0,a.retry)(async()=>{let e;try{e=await d(n)}catch(e){throw e.statusCode===401&&(t=!1),e}return e},e)).trim();return(0,a.retry)(async()=>{let e;try{e=await f(r,n)}catch(e){throw e.statusCode===401&&(t=!1),e}return e},e)};return async()=>{let e=await(0,o.getInstanceMetadataEndpoint)();if(t)return s(r,{...e,timeout:n});{let i;try{i=(await u({...e,timeout:n})).toString()}catch(i){if(i?.statusCode===400)throw Object.assign(i,{message:`EC2 Metadata token request returned error`});return(i.message===`TimeoutError`||[403,404,405].includes(i.statusCode))&&(t=!0),s(r,{...e,timeout:n})}return s(r,{...e,headers:{"x-aws-ec2-metadata-token":i},timeout:n})}}},u=async e=>(0,n.httpRequest)({...e,path:`/latest/api/token`,method:`PUT`,headers:{"x-aws-ec2-metadata-token-ttl-seconds":`21600`}}),d=async e=>(await(0,n.httpRequest)({...e,path:c})).toString(),f=async(e,i)=>{let a=JSON.parse((await(0,n.httpRequest)({...i,path:c+e})).toString());if(!(0,r.isImdsCredentials)(a))throw new t.CredentialsProviderError(`Invalid response received from instance metadata service.`);return(0,r.fromImdsCredentials)(a)}})),$s=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),ec=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getInstanceMetadataEndpoint=e.httpRequest=void 0;let t=(N(),m(j));t.__exportStar(zs(),e),t.__exportStar(Qs(),e),t.__exportStar(Ls(),e),t.__exportStar($s(),e);var n=Fs();Object.defineProperty(e,`httpRequest`,{enumerable:!0,get:function(){return n.httpRequest}});var r=Ys();Object.defineProperty(e,`getInstanceMetadataEndpoint`,{enumerable:!0,get:function(){return r.getInstanceMetadataEndpoint}})})),tc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveCredentialSource=void 0;let t=vs(),n=ec(),r=qi();e.resolveCredentialSource=(e,i)=>{let a={EcsContainer:n.fromContainerMetadata,Ec2InstanceMetadata:n.fromInstanceMetadata,Environment:t.fromEnv};if(e in a)return a[e]();throw new r.CredentialsProviderError(`Unsupported credential source in profile ${i}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`)}})),nc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveAssumeRoleCredentials=e.isAssumeRoleProfile=void 0;let t=qi(),n=Ps(),r=tc(),i=xu();e.isAssumeRoleProfile=e=>!!e&&typeof e==`object`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1&&[`undefined`,`string`].indexOf(typeof e.external_id)>-1&&[`undefined`,`string`].indexOf(typeof e.mfa_serial)>-1&&(a(e)||o(e));let a=e=>typeof e.source_profile==`string`&&e.credential_source===void 0,o=e=>typeof e.credential_source==`string`&&e.source_profile===void 0;e.resolveAssumeRoleCredentials=async(e,a,o,s={})=>{let c=a[e];if(!o.roleAssumer)throw new t.CredentialsProviderError(`Profile ${e} requires a role to be assumed, but no role assumption callback was provided.`,!1);let{source_profile:l}=c;if(l&&l in s)throw new t.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${(0,n.getProfileName)(o)}. Profiles visited: `+Object.keys(s).join(`, `),!1);let u=l?(0,i.resolveProfileData)(l,a,o,{...s,[l]:!0}):(0,r.resolveCredentialSource)(c.credential_source,e)(),d={RoleArn:c.role_arn,RoleSessionName:c.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:c.external_id},{mfa_serial:f}=c;if(f){if(!o.mfaCodeProvider)throw new t.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,!1);d.SerialNumber=f,d.TokenCode=await o.mfaCodeProvider(f)}let p=await u;return o.roleAssumer(p,d)}})),rc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getValidatedProcessCredentials=void 0,e.getValidatedProcessCredentials=(e,t)=>{if(t.Version!==1)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(t.AccessKeyId===void 0||t.SecretAccessKey===void 0)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){let n=new Date;if(new Date(t.Expiration)<n)throw Error(`Profile ${e} credential_process returned expired credentials.`)}return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)}}}})),ic=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveProcessCredentials=void 0;let t=qi(),n=h(`child_process`),r=h(`util`),i=rc();e.resolveProcessCredentials=async(e,a)=>{let o=a[e];if(a[e]){let a=o.credential_process;if(a!==void 0){let o=(0,r.promisify)(n.exec);try{let{stdout:t}=await o(a),n;try{n=JSON.parse(t.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return(0,i.getValidatedProcessCredentials)(e,n)}catch(e){throw new t.CredentialsProviderError(e.message)}}else throw new t.CredentialsProviderError(`Profile ${e} did not contain credential_process.`)}else throw new t.CredentialsProviderError(`Profile ${e} could not be found in shared credentials file.`)}})),ac=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromProcess=void 0;let t=Ps(),n=ic();e.fromProcess=(e={})=>async()=>{let r=await(0,t.parseKnownFiles)(e);return(0,n.resolveProcessCredentials)((0,t.getProfileName)(e),r)}})),oc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(ac(),e)})),sc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveProcessCredentials=e.isProcessProfile=void 0;let t=oc();e.isProcessProfile=e=>!!e&&typeof e==`object`&&typeof e.credential_process==`string`,e.resolveProcessCredentials=async(e,n)=>(0,t.fromProcess)({...e,profile:n})()})),cc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isSsoProfile=void 0,e.isSsoProfile=e=>e&&(typeof e.sso_start_url==`string`||typeof e.sso_account_id==`string`||typeof e.sso_session==`string`||typeof e.sso_region==`string`||typeof e.sso_role_name==`string`)})),lc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOServiceException=void 0;let t=P();e.SSOServiceException=class e extends t.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),uc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LogoutRequestFilterSensitiveLog=e.ListAccountsRequestFilterSensitiveLog=e.ListAccountRolesRequestFilterSensitiveLog=e.GetRoleCredentialsResponseFilterSensitiveLog=e.RoleCredentialsFilterSensitiveLog=e.GetRoleCredentialsRequestFilterSensitiveLog=e.UnauthorizedException=e.TooManyRequestsException=e.ResourceNotFoundException=e.InvalidRequestException=void 0;let t=P(),n=lc();e.InvalidRequestException=class e extends n.SSOServiceException{constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),this.name=`InvalidRequestException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype)}},e.ResourceNotFoundException=class e extends n.SSOServiceException{constructor(t){super({name:`ResourceNotFoundException`,$fault:`client`,...t}),this.name=`ResourceNotFoundException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype)}},e.TooManyRequestsException=class e extends n.SSOServiceException{constructor(t){super({name:`TooManyRequestsException`,$fault:`client`,...t}),this.name=`TooManyRequestsException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype)}},e.UnauthorizedException=class e extends n.SSOServiceException{constructor(t){super({name:`UnauthorizedException`,$fault:`client`,...t}),this.name=`UnauthorizedException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype)}},e.GetRoleCredentialsRequestFilterSensitiveLog=e=>({...e,...e.accessToken&&{accessToken:t.SENSITIVE_STRING}}),e.RoleCredentialsFilterSensitiveLog=e=>({...e,...e.secretAccessKey&&{secretAccessKey:t.SENSITIVE_STRING},...e.sessionToken&&{sessionToken:t.SENSITIVE_STRING}}),e.GetRoleCredentialsResponseFilterSensitiveLog=t=>({...t,...t.roleCredentials&&{roleCredentials:(0,e.RoleCredentialsFilterSensitiveLog)(t.roleCredentials)}}),e.ListAccountRolesRequestFilterSensitiveLog=e=>({...e,...e.accessToken&&{accessToken:t.SENSITIVE_STRING}}),e.ListAccountsRequestFilterSensitiveLog=e=>({...e,...e.accessToken&&{accessToken:t.SENSITIVE_STRING}}),e.LogoutRequestFilterSensitiveLog=e=>({...e,...e.accessToken&&{accessToken:t.SENSITIVE_STRING}})})),dc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.de_LogoutCommand=e.de_ListAccountsCommand=e.de_ListAccountRolesCommand=e.de_GetRoleCredentialsCommand=e.se_LogoutCommand=e.se_ListAccountsCommand=e.se_ListAccountRolesCommand=e.se_GetRoleCredentialsCommand=void 0;let t=gn(),n=P(),r=uc(),i=lc();e.se_GetRoleCredentialsCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c=(0,n.map)({},_,{"x-amz-sso_bearer_token":e.accessToken}),l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/federation/credentials`,u=(0,n.map)({role_name:[,(0,n.expectNonNull)(e.roleName,`roleName`)],account_id:[,(0,n.expectNonNull)(e.accountId,`accountId`)]});return new t.HttpRequest({protocol:a,hostname:i,port:o,method:`GET`,headers:c,path:l,query:u,body:void 0})},e.se_ListAccountRolesCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c=(0,n.map)({},_,{"x-amz-sso_bearer_token":e.accessToken}),l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/assignment/roles`,u=(0,n.map)({next_token:[,e.nextToken],max_result:[()=>e.maxResults!==void 0,()=>e.maxResults.toString()],account_id:[,(0,n.expectNonNull)(e.accountId,`accountId`)]});return new t.HttpRequest({protocol:a,hostname:i,port:o,method:`GET`,headers:c,path:l,query:u,body:void 0})},e.se_ListAccountsCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c=(0,n.map)({},_,{"x-amz-sso_bearer_token":e.accessToken}),l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/assignment/accounts`,u=(0,n.map)({next_token:[,e.nextToken],max_result:[()=>e.maxResults!==void 0,()=>e.maxResults.toString()]});return new t.HttpRequest({protocol:a,hostname:i,port:o,method:`GET`,headers:c,path:l,query:u,body:void 0})},e.se_LogoutCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c=(0,n.map)({},_,{"x-amz-sso_bearer_token":e.accessToken}),l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/logout`;return new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:void 0})},e.de_GetRoleCredentialsCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return a(e,t);let r=(0,n.map)({$metadata:m(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await v(e.body,t)),`body`),o=(0,n.take)(i,{roleCredentials:n._json});return Object.assign(r,o),r};let a=async(e,t)=>{let n={...e,body:await y(e.body,t)},r=b(e,n.body);switch(r){case`InvalidRequestException`:case`com.amazonaws.sso#InvalidRequestException`:throw await u(n,t);case`ResourceNotFoundException`:case`com.amazonaws.sso#ResourceNotFoundException`:throw await d(n,t);case`TooManyRequestsException`:case`com.amazonaws.sso#TooManyRequestsException`:throw await f(n,t);case`UnauthorizedException`:case`com.amazonaws.sso#UnauthorizedException`:throw await p(n,t);default:let i=n.body;return l({output:e,parsedBody:i,errorCode:r})}};e.de_ListAccountRolesCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return o(e,t);let r=(0,n.map)({$metadata:m(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await v(e.body,t)),`body`),a=(0,n.take)(i,{nextToken:n.expectString,roleList:n._json});return Object.assign(r,a),r};let o=async(e,t)=>{let n={...e,body:await y(e.body,t)},r=b(e,n.body);switch(r){case`InvalidRequestException`:case`com.amazonaws.sso#InvalidRequestException`:throw await u(n,t);case`ResourceNotFoundException`:case`com.amazonaws.sso#ResourceNotFoundException`:throw await d(n,t);case`TooManyRequestsException`:case`com.amazonaws.sso#TooManyRequestsException`:throw await f(n,t);case`UnauthorizedException`:case`com.amazonaws.sso#UnauthorizedException`:throw await p(n,t);default:let i=n.body;return l({output:e,parsedBody:i,errorCode:r})}};e.de_ListAccountsCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return s(e,t);let r=(0,n.map)({$metadata:m(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await v(e.body,t)),`body`),a=(0,n.take)(i,{accountList:n._json,nextToken:n.expectString});return Object.assign(r,a),r};let s=async(e,t)=>{let n={...e,body:await y(e.body,t)},r=b(e,n.body);switch(r){case`InvalidRequestException`:case`com.amazonaws.sso#InvalidRequestException`:throw await u(n,t);case`ResourceNotFoundException`:case`com.amazonaws.sso#ResourceNotFoundException`:throw await d(n,t);case`TooManyRequestsException`:case`com.amazonaws.sso#TooManyRequestsException`:throw await f(n,t);case`UnauthorizedException`:case`com.amazonaws.sso#UnauthorizedException`:throw await p(n,t);default:let i=n.body;return l({output:e,parsedBody:i,errorCode:r})}};e.de_LogoutCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return c(e,t);let r=(0,n.map)({$metadata:m(e)});return await h(e.body,t),r};let c=async(e,t)=>{let n={...e,body:await y(e.body,t)},r=b(e,n.body);switch(r){case`InvalidRequestException`:case`com.amazonaws.sso#InvalidRequestException`:throw await u(n,t);case`TooManyRequestsException`:case`com.amazonaws.sso#TooManyRequestsException`:throw await f(n,t);case`UnauthorizedException`:case`com.amazonaws.sso#UnauthorizedException`:throw await p(n,t);default:let i=n.body;return l({output:e,parsedBody:i,errorCode:r})}},l=(0,n.withBaseException)(i.SSOServiceException),u=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{message:n.expectString});Object.assign(i,o);let s=new r.InvalidRequestException({$metadata:m(e),...i});return(0,n.decorateServiceException)(s,e.body)},d=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{message:n.expectString});Object.assign(i,o);let s=new r.ResourceNotFoundException({$metadata:m(e),...i});return(0,n.decorateServiceException)(s,e.body)},f=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{message:n.expectString});Object.assign(i,o);let s=new r.TooManyRequestsException({$metadata:m(e),...i});return(0,n.decorateServiceException)(s,e.body)},p=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{message:n.expectString});Object.assign(i,o);let s=new r.UnauthorizedException({$metadata:m(e),...i});return(0,n.decorateServiceException)(s,e.body)},m=e=>({httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}),h=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),g=(e,t)=>h(e,t).then(e=>t.utf8Encoder(e)),_=e=>e!=null&&e!==``&&(!Object.getOwnPropertyNames(e).includes(`length`)||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes(`size`)||e.size!=0),v=(e,t)=>g(e,t).then(e=>e.length?JSON.parse(e):{}),y=async(e,t)=>{let n=await v(e,t);return n.message=n.message??n.Message,n},b=(e,t)=>{let n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t},i=n(e.headers,`x-amzn-errortype`);if(i!==void 0)return r(e.headers[i]);if(t.code!==void 0)return r(t.code);if(t.__type!==void 0)return r(t.__type)}})),fc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.GetRoleCredentialsCommand=void 0;let t=L(),n=F(),r=P(),i=uc(),a=dc();e.GetRoleCredentialsCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions()));let s=r.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`SSOClient`,commandName:`GetRoleCredentialsCommand`,inputFilterSensitiveLog:i.GetRoleCredentialsRequestFilterSensitiveLog,outputFilterSensitiveLog:i.GetRoleCredentialsResponseFilterSensitiveLog},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_GetRoleCredentialsCommand)(e,t)}deserialize(e,t){return(0,a.de_GetRoleCredentialsCommand)(e,t)}}})),pc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ListAccountRolesCommand=void 0;let t=L(),n=F(),r=P(),i=uc(),a=dc();e.ListAccountRolesCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions()));let s=r.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`SSOClient`,commandName:`ListAccountRolesCommand`,inputFilterSensitiveLog:i.ListAccountRolesRequestFilterSensitiveLog,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_ListAccountRolesCommand)(e,t)}deserialize(e,t){return(0,a.de_ListAccountRolesCommand)(e,t)}}})),mc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ListAccountsCommand=void 0;let t=L(),n=F(),r=P(),i=uc(),a=dc();e.ListAccountsCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions()));let s=r.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`SSOClient`,commandName:`ListAccountsCommand`,inputFilterSensitiveLog:i.ListAccountsRequestFilterSensitiveLog,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_ListAccountsCommand)(e,t)}deserialize(e,t){return(0,a.de_ListAccountsCommand)(e,t)}}})),hc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LogoutCommand=void 0;let t=L(),n=F(),r=P(),i=uc(),a=dc();e.LogoutCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,a,o){this.middlewareStack.use((0,n.getSerdePlugin)(a,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(a,e.getEndpointParameterInstructions()));let s=r.concat(this.middlewareStack),{logger:c}=a,l={logger:c,clientName:`SSOClient`,commandName:`LogoutCommand`,inputFilterSensitiveLog:i.LogoutRequestFilterSensitiveLog,outputFilterSensitiveLog:e=>e},{requestHandler:u}=a;return s.resolve(e=>u.handle(e.request,o||{}),l)}serialize(e,t){return(0,a.se_LogoutCommand)(e,t)}deserialize(e,t){return(0,a.de_LogoutCommand)(e,t)}}})),gc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveClientEndpointParameters=void 0,e.resolveClientEndpointParameters=e=>({...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`awsssoportal`})})),_c=u(((e,t)=>{t.exports={name:`@aws-sdk/client-sso`,description:`AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native`,version:`3.329.0`,scripts:{build:`concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'`,"build:cjs":`tsc -p tsconfig.cjs.json`,"build:docs":`typedoc`,"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 sso`},main:`./dist-cjs/index.js`,types:`./dist-types/index.d.ts`,module:`./dist-es/index.js`,sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":`3.0.0`,"@aws-crypto/sha256-js":`3.0.0`,"@aws-sdk/config-resolver":`3.329.0`,"@aws-sdk/fetch-http-handler":`3.329.0`,"@aws-sdk/hash-node":`3.329.0`,"@aws-sdk/invalid-dependency":`3.329.0`,"@aws-sdk/middleware-content-length":`3.329.0`,"@aws-sdk/middleware-endpoint":`3.329.0`,"@aws-sdk/middleware-host-header":`3.329.0`,"@aws-sdk/middleware-logger":`3.329.0`,"@aws-sdk/middleware-recursion-detection":`3.329.0`,"@aws-sdk/middleware-retry":`3.329.0`,"@aws-sdk/middleware-serde":`3.329.0`,"@aws-sdk/middleware-stack":`3.329.0`,"@aws-sdk/middleware-user-agent":`3.329.0`,"@aws-sdk/node-config-provider":`3.329.0`,"@aws-sdk/node-http-handler":`3.329.0`,"@aws-sdk/protocol-http":`3.329.0`,"@aws-sdk/smithy-client":`3.329.0`,"@aws-sdk/types":`3.329.0`,"@aws-sdk/url-parser":`3.329.0`,"@aws-sdk/util-base64":`3.310.0`,"@aws-sdk/util-body-length-browser":`3.310.0`,"@aws-sdk/util-body-length-node":`3.310.0`,"@aws-sdk/util-defaults-mode-browser":`3.329.0`,"@aws-sdk/util-defaults-mode-node":`3.329.0`,"@aws-sdk/util-endpoints":`3.329.0`,"@aws-sdk/util-retry":`3.329.0`,"@aws-sdk/util-user-agent-browser":`3.329.0`,"@aws-sdk/util-user-agent-node":`3.329.0`,"@aws-sdk/util-utf8":`3.310.0`,tslib:`^2.5.0`},devDependencies:{"@aws-sdk/service-client-documentation-generator":`3.310.0`,"@tsconfig/node14":`1.0.3`,"@types/node":`^14.14.31`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,rimraf:`3.0.2`,typedoc:`0.23.23`,typescript:`~4.9.5`},engines:{node:`>=14.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-sso`,repository:{type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-sso`}}})),vc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Hash=void 0;let t=Xi(),n=ea(),r=h(`buffer`),i=h(`crypto`);e.Hash=class{constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update((0,n.toUint8Array)(a(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?(0,i.createHmac)(this.algorithmIdentifier,a(this.secret)):(0,i.createHash)(this.algorithmIdentifier)}};function a(e,n){return r.Buffer.isBuffer(e)?e:typeof e==`string`?(0,t.fromString)(e,n):ArrayBuffer.isView(e)?(0,t.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength):(0,t.fromArrayBuffer)(e)}})),yc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.buildQueryString=void 0;let t=oa();function n(e){let n=[];for(let r of Object.keys(e).sort()){let i=e[r];if(r=(0,t.escapeUri)(r),Array.isArray(i))for(let e=0,a=i.length;e<a;e++)n.push(`${r}=${(0,t.escapeUri)(i[e])}`);else{let e=r;(i||typeof i==`string`)&&(e+=`=${(0,t.escapeUri)(i)}`),n.push(e)}}return n.join(`&`)}e.buildQueryString=n})),bc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NODEJS_TIMEOUT_ERROR_CODES=void 0,e.NODEJS_TIMEOUT_ERROR_CODES=[`ECONNRESET`,`EPIPE`,`ETIMEDOUT`]})),xc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getTransformedHeaders=void 0,e.getTransformedHeaders=e=>{let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.join(`,`):r}return t}})),Sc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.setConnectionTimeout=void 0,e.setConnectionTimeout=(e,t,n=0)=>{n&&e.on(`socket`,r=>{if(r.connecting){let i=setTimeout(()=>{e.destroy(),t(Object.assign(Error(`Socket timed out without establishing a connection within ${n} ms`),{name:`TimeoutError`}))},n);r.on(`connect`,()=>{clearTimeout(i)})}})}})),Cc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.setSocketTimeout=void 0,e.setSocketTimeout=(e,t,n=0)=>{e.setTimeout(n,()=>{e.destroy(),t(Object.assign(Error(`Connection timed out after ${n} ms`),{name:`TimeoutError`}))})}})),wc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.writeRequestBody=void 0;let t=h(`stream`);function n(e,t){(t.headers.Expect||t.headers.expect)===`100-continue`?e.on(`continue`,()=>{r(e,t.body)}):r(e,t.body)}e.writeRequestBody=n;function r(e,n){n instanceof t.Readable?n.pipe(e):n?e.end(Buffer.from(n)):e.end()}})),Tc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.setSocketKeepAlive=void 0,e.setSocketKeepAlive=(e,{keepAlive:t,keepAliveMsecs:n})=>{t===!0&&e.on(`socket`,e=>{e.setKeepAlive(t,n||0)})}})),Ec=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NodeHttpHandler=e.DEFAULT_REQUEST_TIMEOUT=void 0;let t=gn(),n=yc(),r=h(`http`),i=h(`https`),a=bc(),o=xc(),s=Sc(),c=Cc(),l=wc(),u=Tc();e.DEFAULT_REQUEST_TIMEOUT=0,e.NodeHttpHandler=class{constructor(e){this.metadata={handlerProtocol:`http/1.1`},this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(this.resolveDefaultConfig(e))}).catch(n):t(this.resolveDefaultConfig(e))})}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:n,socketTimeout:a,httpAgent:o,httpsAgent:s}=e||{};return{connectionTimeout:n,requestTimeout:t??a,httpAgent:o||new r.Agent({keepAlive:!0,maxSockets:50}),httpsAgent:s||new i.Agent({keepAlive:!0,maxSockets:50})}}destroy(){var e,t;(e=this.config?.httpAgent)==null||e.destroy(),(t=this.config?.httpsAgent)==null||t.destroy()}async handle(e,{abortSignal:d}={}){return this.config||=await this.configProvider,new Promise((f,p)=>{if(!this.config)throw Error(`Node HTTP request handler config is not resolved`);if(d?.aborted){let e=Error(`Request aborted`);e.name=`AbortError`,p(e);return}let m=e.protocol===`https:`,h=(0,n.buildQueryString)(e.query||{}),g={headers:e.headers,host:e.hostname,method:e.method,path:h?`${e.path}?${h}`:e.path,port:e.port,agent:m?this.config.httpsAgent:this.config.httpAgent},_=(m?i.request:r.request)(g,e=>{f({response:new t.HttpResponse({statusCode:e.statusCode||-1,headers:(0,o.getTransformedHeaders)(e.headers),body:e})})});_.on(`error`,e=>{a.NODEJS_TIMEOUT_ERROR_CODES.includes(e.code)?p(Object.assign(e,{name:`TimeoutError`})):p(e)}),(0,s.setConnectionTimeout)(_,p,this.config.connectionTimeout),(0,c.setSocketTimeout)(_,p,this.config.requestTimeout),d&&(d.onabort=()=>{_.abort();let e=Error(`Request aborted`);e.name=`AbortError`,p(e)});let v=g.agent;typeof v==`object`&&`keepAlive`in v&&(0,u.setSocketKeepAlive)(_,{keepAlive:v.keepAlive,keepAliveMsecs:v.keepAliveMsecs}),(0,l.writeRequestBody)(_,e)})}}})),Dc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NodeHttp2ConnectionPool=void 0,e.NodeHttp2ConnectionPool=class{constructor(e){this.sessions=[],this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter(t=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)t===e&&(t.destroyed||t.destroy())}}})),Oc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NodeHttp2ConnectionManager=void 0;let t=(N(),m(j)).__importDefault(h(`http2`)),n=Dc();e.NodeHttp2ConnectionManager=class{constructor(e){if(this.sessionCache=new Map,this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError(`maxConcurrency must be greater than zero.`)}lease(e,r){let i=this.getUrlString(e),a=this.sessionCache.get(i);if(a){let e=a.poll();if(e&&!this.config.disableConcurrency)return e}let o=t.default.connect(i);this.config.maxConcurrency&&o.settings({maxConcurrentStreams:this.config.maxConcurrency},t=>{if(t)throw Error(`Fail to set maxConcurrentStreams to `+this.config.maxConcurrency+`when creating new session for `+e.destination.toString())}),o.unref();let s=()=>{o.destroy(),this.deleteSession(i,o)};o.on(`goaway`,s),o.on(`error`,s),o.on(`frameError`,s),o.on(`close`,()=>this.deleteSession(i,o)),r.requestTimeout&&o.setTimeout(r.requestTimeout,s);let c=this.sessionCache.get(i)||new n.NodeHttp2ConnectionPool;return c.offerLast(o),this.sessionCache.set(i,c),o}deleteSession(e,t){let n=this.sessionCache.get(e);n&&n.contains(t)&&(n.remove(t),this.sessionCache.set(e,n))}release(e,t){var n;let r=this.getUrlString(e);(n=this.sessionCache.get(r))==null||n.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let e of t)e.destroyed||e.destroy(),t.remove(e);this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError(`maxConcurrentStreams must be greater than zero.`);this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}}})),kc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NodeHttp2Handler=void 0;let t=gn(),n=yc(),r=h(`http2`),i=xc(),a=Oc(),o=wc();e.NodeHttp2Handler=class{constructor(e){this.metadata={handlerProtocol:`h2`},this.connectionManager=new a.NodeHttp2ConnectionManager({}),this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(e||{})}).catch(n):t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:a}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));let{requestTimeout:s,disableConcurrentStreams:c}=this.config;return new Promise((l,u)=>{let d=!1;if(a?.aborted){d=!0;let e=Error(`Request aborted`);e.name=`AbortError`,u(e);return}let{hostname:f,method:p,port:m,protocol:h,path:g,query:_}=e,v=`${h}//${f}${m?`:${m}`:``}`,y={destination:new URL(v)},b=this.connectionManager.lease(y,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:c||!1}),x=e=>{c&&this.destroySession(b),d=!0,u(e)},S=(0,n.buildQueryString)(_||{}),C=b.request({...e.headers,[r.constants.HTTP2_HEADER_PATH]:S?`${g}?${S}`:g,[r.constants.HTTP2_HEADER_METHOD]:p});b.ref(),C.on(`response`,e=>{let n=new t.HttpResponse({statusCode:e[`:status`]||-1,headers:(0,i.getTransformedHeaders)(e),body:C});d=!0,l({response:n}),c&&(b.close(),this.connectionManager.deleteSession(v,b))}),s&&C.setTimeout(s,()=>{C.close();let e=Error(`Stream timed out because of no activity for ${s} ms`);e.name=`TimeoutError`,x(e)}),a&&(a.onabort=()=>{C.close();let e=Error(`Request aborted`);e.name=`AbortError`,x(e)}),C.on(`frameError`,(e,t,n)=>{x(Error(`Frame type id ${e} in stream id ${n} has failed with code ${t}.`))}),C.on(`error`,x),C.on(`aborted`,()=>{x(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${C.rstCode}.`))}),C.on(`close`,()=>{b.unref(),c&&b.destroy(),d||x(Error(`Unexpected error: http2 request did not get a response`))}),(0,o.writeRequestBody)(C,e)})}destroySession(e){e.destroyed||e.destroy()}}})),Ac=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Collector=void 0;let t=h(`stream`);e.Collector=class extends t.Writable{constructor(){super(...arguments),this.bufferedBytes=[]}_write(e,t,n){this.bufferedBytes.push(e),n()}}})),jc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.streamCollector=void 0;let t=Ac();e.streamCollector=e=>new Promise((n,r)=>{let i=new t.Collector;e.pipe(i),e.on(`error`,e=>{i.end(),r(e)}),i.on(`error`,r),i.on(`finish`,function(){n(new Uint8Array(Buffer.concat(this.bufferedBytes)))})})})),Mc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Ec(),e),t.__exportStar(kc(),e),t.__exportStar(jc(),e)})),Nc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.calculateBodyLength=void 0;let t=h(`fs`);e.calculateBodyLength=e=>{if(!e)return 0;if(typeof e==`string`)return Buffer.from(e).length;if(typeof e.byteLength==`number`)return e.byteLength;if(typeof e.size==`number`)return e.size;if(typeof e.path==`string`||Buffer.isBuffer(e.path))return(0,t.lstatSync)(e.path).size;if(typeof e.fd==`number`)return(0,t.fstatSync)(e.fd).size;throw Error(`Body Length computation failed for ${e}`)}})),Pc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Nc(),e)})),Fc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.newLiftedPromise=e.makeSelfCleaningPromise=void 0;function t(e,t){return t?e.finally(()=>{t()}):e}e.makeSelfCleaningPromise=t;function n(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});if(!t||!n)throw Error(`Failed to bind resolve and reject when making lifted promise`);return e&&e(t,n),{promise:r,resolve:t,reject:n}}e.newLiftedPromise=n})),Ic=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.newCancellablePromiseFromNextEvent=e.CancelController=e.EVENT_NAME=void 0;let i=h(`events`),a=r(Fc());e.EVENT_NAME=`cancelled`,e.CancelController=class{constructor(e){this.cancelled=!1,e&&e.emitterFactory?this.emitter=e.emitterFactory():this.emitter=new i.EventEmitter}cancel(){this.cancelled||(this.cancelled=!0,this.emitter.emit(e.EVENT_NAME),this.emitter.removeAllListeners(e.EVENT_NAME))}hasBeenCancelled(){return this.cancelled}addListener(t){if(this.cancelled){t();return}return this.emitter.on(e.EVENT_NAME,t),()=>{this.emitter.removeListener(e.EVENT_NAME,t)}}};function o(e){let t,n,r=a.newLiftedPromise();return t=t=>{try{e.eventDataTransformer?r.resolve(e.eventDataTransformer(t)):r.resolve(t)}catch(e){r.reject(e)}},e.emitter.addListener(e.eventName,t),e.cancelController&&(n=e.cancelController.addListener(()=>{r.reject(e.cancelMessage)})),a.makeSelfCleaningPromise(r.promise,()=>{t&&e.emitter.removeListener(e.eventName,t),n&&n()})}e.newCancellablePromiseFromNextEvent=o})),Lc=u(((e,t)=>{t.exports={name:`aws-crt`,version:`1.30.0`,description:`NodeJS/browser bindings to the aws-c-* libraries`,homepage:`https://github.com/awslabs/aws-crt-nodejs`,repository:{type:`git`,url:`git+https://github.com/awslabs/aws-crt-nodejs.git`},contributors:[`AWS Common Runtime Team <aws-sdk-common-runtime@amazon.com>`],license:`Apache-2.0`,main:`./dist/index.js`,browser:`./dist.browser/browser.js`,types:`./dist/index.d.ts`,scripts:{tsc:`node ./scripts/tsc.js`,test:`npm run test:native`,"test:node":`npm run test:native`,"test:native":`npx jest --runInBand --verbose --config test/native/jest.config.js --forceExit`,"test:browser":`npx jest --runInBand --verbose --config test/browser/jest.config.js --forceExit`,"test:browser:ci":`npm run install:puppeteer && npm run test:browser`,"install:puppeteer":`npm install --save-dev jest-puppeteer puppeteer @types/puppeteer`,prepare:`node ./scripts/tsc.js && node ./scripts/install.js`,install:`node ./scripts/install.js`},overrides:{axios:`^1.12.2`},devDependencies:{"@types/crypto-js":`^3.1.43`,"@types/jest":`^27.0.1`,"@types/node":`^14.18.63`,"@types/prettier":`2.6.0`,"@types/puppeteer":`^5.4.7`,"@types/uuid":`^10.0.0`,"@types/ws":`^7.4.7`,"aws-sdk":`^2.1537.0`,"cmake-js":`^7.3.0`,"https-proxy-agent":`^5.0.1`,jest:`^27.2.1`,"jest-puppeteer":`^5.0.4`,"jest-runtime":`^27.2.1`,puppeteer:`^3.3.0`,tar:`^7.5.4`,"ts-jest":`^27.0.5`,typedoc:`^0.24.8`,"typedoc-plugin-merge-modules":`^5.1.0`,typescript:`^4.9.5`,uuid:`^10.0.0`,yargs:`^17.2.1`},dependencies:{"@aws-sdk/util-utf8-browser":`^3.259.0`,"@httptoolkit/websocket-stream":`^6.0.1`,axios:`^1.12.2`,buffer:`^6.0.3`,"crypto-js":`^4.2.0`,mqtt:`^4.3.8`,process:`^0.11.10`}}})),Rc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.crt_version=e.package_info=e.is_browser=e.is_nodejs=void 0;function t(){return typeof process==`object`&&typeof process.versions==`object`&&process.versions.node!==void 0}e.is_nodejs=t;function n(){return!t()}e.is_browser=n;function r(){try{return Lc()}catch{return{name:`aws-crt-nodejs`,version:`UNKNOWN`}}}e.package_info=r;function i(){return r().version}e.crt_version=i})),zc=u((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.using=void 0;function n(e,n){return t(this,void 0,void 0,function*(){try{yield n(e)}finally{e.close()}})}e.using=n})),Bc=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.cRuntime=e.CRuntimeType=void 0;let a=r(h(`path`)),o=h(`os`),s=h(`fs`),c=h(`process`),l=i(h(`child_process`)),u=Object.freeze({NON_LINUX:`cruntime`,MUSL:`musl`,GLIBC:`glibc`});e.CRuntimeType=u;function d(){if((0,o.platform)()!==`linux`)return u.NON_LINUX;try{let e=l.default.spawnSync(`ldd`,[`--version`],{encoding:`utf8`});return(e.stdout+e.stderr).includes(u.MUSL)?u.MUSL:u.GLIBC}catch{return u.GLIBC}}let f=`Please upgrade to node >=10.16.0, or use the provided browser implementation.`;if(`napi`in c.versions){if(parseInt(c.versions.napi)<4)throw Error(`The AWS CRT native implementation requires that NAPI version 4 be present. `+f)}else throw Error(`The current runtime is not reporting an NAPI version. `+f);let p=d();e.cRuntime=p;let m=`${o.platform}-${o.arch}-${p}`,g=a.resolve(__dirname,`..`,`..`),_=a.join(g,`dist`);(0,s.existsSync)(_)&&(g=_);let v=a.resolve(g,`bin`),y=[a.join(v,m,`aws-crt-nodejs`)+`.node`],b=process.env.AWS_CRT_NODEJS_BINARY_RELATIVE_PATH;if(b){let e=a.resolve(__dirname,...b.split(a.sep));y.push(e)}process.env.AWS_CRT_NODEJS_BINARY_ABSOLUTE_PATH&&y.push(process.env.AWS_CRT_NODEJS_BINARY_ABSOLUTE_PATH);let x;for(let e of y)if((0,s.existsSync)(e)){x=h(e);break}if(x==null)throw Error(`AWS CRT binary not present in any of the following locations:
|
|
27
27
|
`+y.join(`
|
|
28
|
-
`));let S=i(Bc());process.versions.hasOwnProperty(`electron`)&&process.on(`exit`,function(){S.default.disable_threadsafe_function()}),e.default=x})),Vc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.CrtError=void 0;let n=t(Bc());var r=class extends Error{constructor(e){super(i(e)),this.error=e,this.error_code=a(e),this.error_name=o(e)}};e.CrtError=r;function i(e){return typeof e==`number`?n.default.error_code_to_string(e):e instanceof r?e.message:e.toString()}function a(e){if(typeof e==`number`)return e;if(e instanceof r)return e.error_code}function o(e){if(typeof e==`number`)return n.default.error_code_to_name(e);if(e instanceof r)return e.error_name}})),Hc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NativeResourceMixin=e.NativeResource=void 0,e.NativeResource=class{constructor(e){this.handle=e}native_handle(){return this.handle}};function t(e){return class extends e{constructor(...e){let t=e.shift();super(...e),this._handle=t}_super(e){this._handle=e}native_handle(){return this._handle}}}e.NativeResourceMixin=t})),Uc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.logTrace=e.logDebug=e.logInfo=e.logWarn=e.logError=e.logFatal=e.setLogLevel=e.LogLevel=e.SocketDomain=e.SocketType=e.TlsVersion=void 0,(function(e){e[e.SSLv3=0]=`SSLv3`,e[e.TLSv1=1]=`TLSv1`,e[e.TLSv1_1=2]=`TLSv1_1`,e[e.TLSv1_2=3]=`TLSv1_2`,e[e.TLSv1_3=4]=`TLSv1_3`,e[e.Default=128]=`Default`})(e.TlsVersion||={}),(function(e){e[e.STREAM=0]=`STREAM`,e[e.DGRAM=1]=`DGRAM`})(e.SocketType||={}),(function(e){e[e.IPV4=0]=`IPV4`,e[e.IPV6=1]=`IPV6`,e[e.LOCAL=2]=`LOCAL`})(e.SocketDomain||={});var t;(function(e){e[e.NONE=0]=`NONE`,e[e.FATAL=1]=`FATAL`,e[e.ERROR=2]=`ERROR`,e[e.WARN=3]=`WARN`,e[e.INFO=4]=`INFO`,e[e.DEBUG=5]=`DEBUG`,e[e.TRACE=6]=`TRACE`})(t=e.LogLevel||={});let n=t.NONE;function r(e){n=e}e.setLogLevel=r;function i(e,r){if(n<t.FATAL)return;let i=new Date().toISOString();console.log(`[FATAL] [${i}] [${e}] - ${r}`)}e.logFatal=i;function a(e,r){if(n<t.ERROR)return;let i=new Date().toISOString();console.log(`[ERROR] [${i}] [${e}] - ${r}`)}e.logError=a;function o(e,r){if(n<t.WARN)return;let i=new Date().toISOString();console.log(`[WARN] [${i}] [${e}] - ${r}`)}e.logWarn=o;function s(e,r){if(n<t.INFO)return;let i=new Date().toISOString();console.log(`[INFO] [${i}] [${e}] - ${r}`)}e.logInfo=s;function c(e,r){if(n<t.DEBUG)return;let i=new Date().toISOString();console.log(`[DEBUG] [${i}] [${e}] - ${r}`)}e.logDebug=c;function l(e,r){if(n<t.TRACE)return;let i=new Date().toISOString();console.log(`[TRACE] [${i}] [${e}] - ${r}`)}e.logTrace=l})),Wc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Pkcs11Lib=e.TlsConnectionOptions=e.ServerTlsContext=e.ClientTlsContext=e.TlsContext=e.TlsContextOptions=e.tls_cipher_preference_is_supported=e.TlsCipherPreference=e.SocketOptions=e.ClientBootstrap=e.InputStream=e.is_alpn_available=e.enable_logging=e.error_code_to_name=e.error_code_to_string=e.SocketDomain=e.SocketType=e.TlsVersion=e.LogLevel=e.setLogLevel=void 0;let n=t(Bc()),r=Hc(),i=Uc();var a=Uc();Object.defineProperty(e,`setLogLevel`,{enumerable:!0,get:function(){return a.setLogLevel}}),Object.defineProperty(e,`LogLevel`,{enumerable:!0,get:function(){return a.LogLevel}}),Object.defineProperty(e,`TlsVersion`,{enumerable:!0,get:function(){return a.TlsVersion}}),Object.defineProperty(e,`SocketType`,{enumerable:!0,get:function(){return a.SocketType}}),Object.defineProperty(e,`SocketDomain`,{enumerable:!0,get:function(){return a.SocketDomain}});let o=Vc();function s(e){return n.default.error_code_to_string(e)}e.error_code_to_string=s;function c(e){return n.default.error_code_to_name(e)}e.error_code_to_name=c;function l(e){n.default.io_logging_enable(e),(0,i.setLogLevel)(e)}e.enable_logging=l;function u(){return n.default.is_alpn_available()}e.is_alpn_available=u,e.InputStream=class extends r.NativeResource{constructor(e){super(n.default.io_input_stream_new(16*1024)),this.source=e,this.source.on(`data`,e=>{e=Buffer.isBuffer(e)?e:Buffer.from(e.toString()),n.default.io_input_stream_append(this.native_handle(),e)}),this.source.on(`end`,()=>{n.default.io_input_stream_append(this.native_handle(),void 0)})}},e.ClientBootstrap=class extends r.NativeResource{constructor(){super(n.default.io_client_bootstrap_new())}},e.SocketOptions=class extends r.NativeResource{constructor(e=i.SocketType.STREAM,t=i.SocketDomain.IPV6,r=5e3,a=!1,o=0,s=0,c=0){super(n.default.io_socket_options_new(e,t,r,o,s,c,a))}},(function(e){e[e.Default=0]=`Default`,e[e.PQ_TLSv1_0_2021_05=6]=`PQ_TLSv1_0_2021_05`,e[e.PQ_Default=8]=`PQ_Default`,e[e.TLSv1_2_2025_07=9]=`TLSv1_2_2025_07`})(e.TlsCipherPreference||={});function d(e){return n.default.io_tls_cipher_preference_is_supported(e)}e.tls_cipher_preference_is_supported=d;var f=class e{constructor(){this.min_tls_version=i.TlsVersion.Default,this.alpn_list=[],this.verify_peer=!0}override_default_trust_store_from_path(e,t){this.ca_dirpath=e,this.ca_filepath=t}override_default_trust_store(e){this.certificate_authority=e}static create_client_with_mtls(t,n){let r=new e;return r.certificate=t,r.private_key=n,r.verify_peer=!0,r}static create_client_with_mtls_from_path(t,n){let r=new e;return r.certificate_filepath=t,r.private_key_filepath=n,r.verify_peer=!0,r}static create_client_with_mtls_pkcs12_from_path(t,n){let r=new e;return r.pkcs12_filepath=t,r.pkcs12_password=n,r.verify_peer=!0,r}static create_client_with_mtls_pkcs_from_path(e,t){return this.create_client_with_mtls_pkcs12_from_path(e,t)}static create_client_with_mtls_pkcs11(t){let n=new e;return n.pkcs11_options=t,n.verify_peer=!0,n}static create_client_with_mtls_windows_cert_store_path(t){let n=new e;return n.windows_cert_store_path=t,n.verify_peer=!0,n}static create_server_with_mtls_from_path(t,n){let r=new e;return r.certificate_filepath=t,r.private_key_filepath=n,r.verify_peer=!1,r}static create_server_with_mtls_pkcs_from_path(t,n){let r=new e;return r.pkcs12_filepath=t,r.pkcs12_password=n,r.verify_peer=!1,r}};e.TlsContextOptions=f;var p=class extends r.NativeResource{constructor(e){if(e==null||e==null)throw new o.CrtError(`TlsContext constructor: ctx_opt not defined`);super(n.default.io_tls_ctx_new(e.min_tls_version,e.ca_filepath,e.ca_dirpath,e.certificate_authority,e.alpn_list&&e.alpn_list.length>0?e.alpn_list.join(`;`):void 0,e.certificate_filepath,e.certificate,e.private_key_filepath,e.private_key,e.pkcs12_filepath,e.pkcs12_password,e.pkcs11_options,e.windows_cert_store_path,e.tls_cipher_preference,e.verify_peer))}};e.TlsContext=p,e.ClientTlsContext=class extends p{constructor(e){e||(e=new f,e.verify_peer=!0),super(e)}},e.ServerTlsContext=class extends p{constructor(e){e||(e=new f,e.verify_peer=!1),super(e)}},e.TlsConnectionOptions=class extends r.NativeResource{constructor(e,t,r=[]){if(e==null||e==null)throw new o.CrtError(`TlsConnectionOptions constructor: tls_ctx not defined`);super(n.default.io_tls_connection_options_new(e.native_handle(),t,r&&r.length>0?r.join(`;`):void 0)),this.tls_ctx=e,this.server_name=t,this.alpn_list=r}};var m=class e extends r.NativeResource{constructor(t,r=e.InitializeFinalizeBehavior.DEFAULT){super(n.default.io_pkcs11_lib_new(t,r))}close(){n.default.io_pkcs11_lib_close(this.native_handle())}};e.Pkcs11Lib=m,(function(e){(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.OMIT=1]=`OMIT`,e[e.STRICT=2]=`STRICT`})(e.InitializeFinalizeBehavior||={})})(m=e.Pkcs11Lib||={})})),Gc=u((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.aws_verify_sigv4a_signing=e.aws_sign_request=e.AwsSignedBodyHeaderType=e.AwsSignedBodyValue=e.AwsSignatureType=e.AwsSigningAlgorithm=e.AwsCredentialsProvider=void 0;let r=n(Bc()),i=Vc(),a=Wc();e.AwsCredentialsProvider=class extends r.default.AwsCredentialsProvider{static newDefault(e=void 0){return super.newDefault(e==null?null:e.native_handle())}static newStatic(e,t,n){return super.newStatic(e,t,n)}static newCognito(e){if(e==null||e==null)throw new i.CrtError(`AwsCredentialsProvider newCognito: Cognito config not defined`);return super.newCognito(e,e.tlsContext==null?new a.ClientTlsContext().native_handle():e.tlsContext.native_handle(),e.bootstrap==null?null:e.bootstrap.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}static newX509(e){if(e==null||e==null)throw new i.CrtError(`AwsCredentialsProvider newX509: X509 config not defined`);return super.newX509(e,e.tlsContext.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}},(function(e){e[e.SigV4=0]=`SigV4`,e[e.SigV4Asymmetric=1]=`SigV4Asymmetric`})(e.AwsSigningAlgorithm||={}),(function(e){e[e.HttpRequestViaHeaders=0]=`HttpRequestViaHeaders`,e[e.HttpRequestViaQueryParams=1]=`HttpRequestViaQueryParams`,e[e.HttpRequestChunk=2]=`HttpRequestChunk`,e[e.HttpRequestEvent=3]=`HttpRequestEvent`})(e.AwsSignatureType||={}),(function(e){e.EmptySha256=`e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`,e.UnsignedPayload=`UNSIGNED-PAYLOAD`,e.StreamingAws4HmacSha256Payload=`STREAMING-AWS4-HMAC-SHA256-PAYLOAD`,e.StreamingAws4HmacSha256Events=`STREAMING-AWS4-HMAC-SHA256-EVENTS`})(e.AwsSignedBodyValue||={}),(function(e){e[e.None=0]=`None`,e[e.XAmzContentSha256=1]=`XAmzContentSha256`})(e.AwsSignedBodyHeaderType||={});function o(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{try{r.default.aws_sign_request(e,n,n=>{n==0?t(e):a(new i.CrtError(n))})}catch(e){a(e)}})})}e.aws_sign_request=o;function s(e,t,n,i,a,o){return r.default.aws_verify_sigv4a_signing(e,t,n,i,a,o)}e.aws_verify_sigv4a_signing=s})),Kc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.crc64nvme=e.crc32c=e.crc32=void 0;let n=t(Bc());function r(e,t){return n.default.checksums_crc32(e,t)}e.crc32=r;function i(e,t){return n.default.checksums_crc32c(e,t)}e.crc32c=i;function a(e,t){return n.default.checksums_crc64nvme(e,t)}e.crc64nvme=a})),qc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.native_memory_dump=e.native_memory=void 0;let n=t(Bc());function r(){return n.default.native_memory()}e.native_memory=r;function i(){return n.default.native_memory_dump()}e.native_memory_dump=i})),Jc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.hmac_sha256=e.Sha256Hmac=e.hash_sha1=e.Sha1Hash=e.hash_sha256=e.Sha256Hash=e.hash_md5=e.Md5Hash=void 0;let n=t(Bc()),r=Hc();var i=class extends r.NativeResource{update(e){n.default.hash_update(this.native_handle(),e)}finalize(e){return n.default.hash_digest(this.native_handle(),e)}constructor(e){super(e)}};e.Md5Hash=class extends i{constructor(){super(n.default.hash_md5_new())}};function a(e,t){return n.default.hash_md5_compute(e,t)}e.hash_md5=a,e.Sha256Hash=class extends i{constructor(){super(n.default.hash_sha256_new())}};function o(e,t){return n.default.hash_sha256_compute(e,t)}e.hash_sha256=o,e.Sha1Hash=class extends i{constructor(){super(n.default.hash_sha1_new())}};function s(e,t){return n.default.hash_sha1_compute(e,t)}e.hash_sha1=s;var c=class extends r.NativeResource{update(e){n.default.hmac_update(this.native_handle(),e)}finalize(e){return n.default.hmac_digest(this.native_handle(),e)}constructor(e){super(e)}};e.Sha256Hmac=class extends c{constructor(e){super(n.default.hmac_sha256_new(e))}};function l(e,t,r){return n.default.hmac_sha256_compute(e,t,r)}e.hmac_sha256=l})),Yc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BufferedEventEmitter=void 0;let t=h(`events`);var n=class{constructor(e,t){this.event=e,this.args=t}};e.BufferedEventEmitter=class extends t.EventEmitter{constructor(){super(),this.corked=!1}cork(){this.corked=!0}uncork(){for(this.corked=!1;this.eventQueue;){let e=this.eventQueue;super.emit(e.event,...e.args),this.eventQueue=this.eventQueue.next}}emit(e,...t){if(this.corked){let r=this.lastQueuedEvent;return this.lastQueuedEvent=new n(e,t),r?r.next=this.lastQueuedEvent:this.eventQueue=this.lastQueuedEvent,this.listeners(e).length>0}return super.emit(e,...t)}}})),Xc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unmarshalInt64BigintFromBuffer=e.marshalInt64BigintAsBuffer=e.MIN_INT64=e.MAX_INT64=e.MIN_INT32=e.MAX_INT32=e.MIN_INT16=e.MAX_INT16=e.MIN_INT8=e.MAX_INT8=void 0;let t=Vc();e.MAX_INT8=127,e.MIN_INT8=-128,e.MAX_INT16=32767,e.MIN_INT16=-32768,e.MAX_INT32=2147483647,e.MIN_INT32=-2147483648,e.MAX_INT64=BigInt(`9223372036854775807`),e.MIN_INT64=BigInt(`-9223372036854775808`);let n=BigInt(`256`);function r(r){if(r<e.MIN_INT64||r>e.MAX_INT64)throw new t.CrtError(`marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes`);let i=new Uint8Array(8);if(r<0){r=-r-BigInt(1);for(let e=0;e<8;++e)i[e]=255-Number(r%n),r/=n}else for(let e=0;e<8;++e)i[e]=Number(r%n),r/=n;return i}e.marshalInt64BigintAsBuffer=r;function i(e){let r=BigInt(0),i=new Uint8Array(e);if(i.length!=8)throw new t.CrtError(`unmarshalInt64BigintFromBuffer expects a byte buffer of length 8`);let a=BigInt(1);if(i[7]&128){for(let e=0;e<i.length;++e){let t=BigInt(255-i[e]);r+=t*a,a*=n}r+=BigInt(1),r=-r}else for(let e=0;e<i.length;++e){let t=BigInt(i[e]);r+=t*a,a*=n}return r}e.unmarshalInt64BigintFromBuffer=i})),Zc=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ClientStream=e.ClientConnection=e.MessageType=e.MessageFlags=e.Header=e.HeaderType=void 0;let o=Hc(),s=Yc(),c=Vc(),l=r(Wc()),u=r(Xc()),d=r(Fc()),f=a(Bc());var p;(function(e){e[e.BooleanTrue=0]=`BooleanTrue`,e[e.BooleanFalse=1]=`BooleanFalse`,e[e.Byte=2]=`Byte`,e[e.Int16=3]=`Int16`,e[e.Int32=4]=`Int32`,e[e.Int64=5]=`Int64`,e[e.ByteBuffer=6]=`ByteBuffer`,e[e.String=7]=`String`,e[e.Timestamp=8]=`Timestamp`,e[e.UUID=9]=`UUID`})(p=e.HeaderType||={});var m=class e{constructor(e,t,n){this.name=e,this.type=t,this.value=n}static validateHeaderName(e){if(e.length==0||e.length>127)throw new c.CrtError(`Event stream header name (${e}) is not valid`)}static newBoolean(t,n){return e.validateHeaderName(t),n?new e(t,p.BooleanTrue):new e(t,p.BooleanFalse)}static newByte(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT8&&n<=u.MAX_INT8&&Number.isSafeInteger(n))return new e(t,p.Byte,n);throw new c.CrtError(`Illegal value for eventstream byte-valued header: ${n}`)}static newInt16(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT16&&n<=u.MAX_INT16&&Number.isSafeInteger(n))return new e(t,p.Int16,n);throw new c.CrtError(`Illegal value for eventstream int16-valued header: ${n}`)}static newInt32(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT32&&n<=u.MAX_INT32&&Number.isSafeInteger(n))return new e(t,p.Int32,n);throw new c.CrtError(`Illegal value for eventstream int32-valued header: ${n}`)}static newInt64FromNumber(t,n){if(e.validateHeaderName(t),Number.isSafeInteger(n))return new e(t,p.Int64,u.marshalInt64BigintAsBuffer(BigInt(n)));throw new c.CrtError(`Illegal value for eventstream int64-valued header: ${n}`)}static newInt64FromBigint(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT64&&n<=u.MAX_INT64)return new e(t,p.Int64,u.marshalInt64BigintAsBuffer(n));throw new c.CrtError(`Illegal value for eventstream int64-valued header: ${n}`)}static newByteBuffer(t,n){return e.validateHeaderName(t),new e(t,p.ByteBuffer,n)}static newString(t,n){return e.validateHeaderName(t),new e(t,p.String,n)}static newTimeStampFromSecondsSinceEpoch(t,n){if(e.validateHeaderName(t),Number.isSafeInteger(n)&&n>=0)return new e(t,p.Timestamp,n);throw new c.CrtError(`Illegal value for eventstream timestamp-valued header: ${n}`)}static newTimeStampFromDate(t,n){e.validateHeaderName(t);let r=n.getTime();if(Number.isSafeInteger(r))return new e(t,p.Timestamp,r);throw new c.CrtError(`Illegal value for eventstream timestamp-valued header: ${n}`)}static newUUID(t,n){if(e.validateHeaderName(t),n.byteLength==16)return new e(t,p.UUID,n);throw new c.CrtError(`Illegal value for eventstream uuid-valued header: ${n}`)}toValue(e){if(e!=this.type)throw new c.CrtError(`Header of type (${this.type}) cannot be converted to type (${e})`);return this.value}asBoolean(){switch(this.type){case p.BooleanFalse:return!1;case p.BooleanTrue:return!0;default:throw new c.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`)}}asByte(){return this.toValue(p.Byte)}asInt16(){return this.toValue(p.Int16)}asInt32(){return this.toValue(p.Int32)}asInt64(){return u.unmarshalInt64BigintFromBuffer(this.toValue(p.Int64))}asByteBuffer(){return this.toValue(p.ByteBuffer)}asString(){return this.toValue(p.String)}asTimestamp(){return this.toValue(p.Timestamp)}asUUID(){return this.toValue(p.UUID)}};e.Header=m,(function(e){e[e.None=0]=`None`,e[e.ConnectionAccepted=1]=`ConnectionAccepted`,e[e.TerminateStream=2]=`TerminateStream`})(e.MessageFlags||={}),(function(e){e[e.ApplicationMessage=0]=`ApplicationMessage`,e[e.ApplicationError=1]=`ApplicationError`,e[e.Ping=2]=`Ping`,e[e.PingResponse=3]=`PingResponse`,e[e.Connect=4]=`Connect`,e[e.ConnectAck=5]=`ConnectAck`,e[e.ProtocolError=6]=`ProtocolError`,e[e.InternalError=7]=`InternalError`})(e.MessageType||={});function h(e){return Array.from(e,e=>new m(e.name,e.type,e.value))}function g(e){let t={type:e.type,flags:e.flags,payload:e.payload};return e.headers&&(t.headers=h(e.headers)),t}var _;(function(e){e[e.None=0]=`None`,e[e.Connecting=1]=`Connecting`,e[e.Connected=2]=`Connected`,e[e.Disconnected=3]=`Disconnected`,e[e.Closed=4]=`Closed`})(_||={});var v=class e extends (0,o.NativeResourceMixin)(s.BufferedEventEmitter){constructor(t){if(t===void 0)throw new c.CrtError(`Invalid configuration passed to eventstream ClientConnection constructor`);super(),this.state=_.None,this._super(f.default.event_stream_client_connection_new(this,t,(t,n)=>{e._s_on_disconnect(t,n)},(t,n)=>{e._s_on_protocol_message(t,n)},t.socketOptions?t.socketOptions.native_handle():null,t.tlsCtx?t.tlsCtx.native_handle():null))}close(){this.state!=_.Closed&&(this.state=_.Closed,f.default.event_stream_client_connection_close(this.native_handle()))}connect(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{if(!t){i(new c.CrtError(`Invalid options passed to event stream ClientConnection.connect`));return}if(this.state!=_.None){i(new c.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));return}if(this.state=_.Connecting,t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream connection connect() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t,n){return e._s_on_connection_setup(r,i,t,n)}try{f.default.event_stream_client_connection_connect(this.native_handle(),a)}catch(e){this.state=_.Disconnected,i(e)}});return d.makeSelfCleaningPromise(r,n)})}sendProtocolMessage(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{try{if(!t){i(new c.CrtError(`Invalid options passed to event stream ClientConnection.sendProtocolMessage`));return}if(!this.isConnected()){i(new c.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));return}if(t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream connection sendProtocolMessage() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t){return e._s_on_connection_send_protocol_message_completion(r,i,t)}f.default.event_stream_client_connection_send_protocol_message(this.native_handle(),t,a)}catch(e){i(e)}});return d.makeSelfCleaningPromise(r,n)})}isConnected(){return this.state==_.Connected}newStream(){if(!this.isConnected())throw new c.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);return new b(this)}on(e,t){return super.on(e,t),this}static _s_on_connection_setup(e,t,n,r){r==0&&n.state==_.Connecting?(n.state=_.Connected,e()):(n.state!=_.Closed&&(n.state=_.Disconnected),t(l.error_code_to_string(r)))}static _s_on_disconnect(e,t){e.state!=_.Closed&&(e.state=_.Disconnected),process.nextTick(()=>{e.emit(`disconnection`,{errorCode:t})})}static _s_on_protocol_message(e,t){process.nextTick(()=>{e.emit(`protocolMessage`,{message:g(t)})})}static _s_on_connection_send_protocol_message_completion(e,t,n){n==0?e():t(l.error_code_to_string(n))}};e.ClientConnection=v,v.DISCONNECTION=`disconnection`,v.PROTOCOL_MESSAGE=`protocolMessage`;var y;(function(e){e[e.None=0]=`None`,e[e.Activating=1]=`Activating`,e[e.Activated=2]=`Activated`,e[e.Ended=3]=`Ended`,e[e.Closed=4]=`Closed`})(y||={});var b=class e extends (0,o.NativeResourceMixin)(s.BufferedEventEmitter){constructor(t){super(),this._super(f.default.event_stream_client_stream_new(this,t.native_handle(),t=>{e._s_on_stream_ended(t)},(t,n)=>{e._s_on_stream_message(t,n)})),this.state=y.None}close(){this.state!=y.Closed&&(this.state=y.Closed,f.default.event_stream_client_stream_close(this.native_handle()))}activate(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{try{if(this.state!=y.None){i(new c.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));return}if(t===void 0){this.state=y.Ended,i(new c.CrtError(`Invalid options passed to ClientStream.activate`));return}if(this.state=y.Activating,t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream activate() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t,n){return e._s_on_stream_activated(r,i,t,n)}f.default.event_stream_client_stream_activate(this.native_handle(),t,a)}catch(e){this.state=y.Ended,i(e)}});return d.makeSelfCleaningPromise(r,n)})}sendMessage(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{try{if(!t){i(new c.CrtError(`Invalid options passed to ClientStream.sendMessage`));return}if(this.state!=y.Activated){i(new c.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));return}if(t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream sendMessage() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t){return e._s_on_stream_send_message_completion(r,i,t)}f.default.event_stream_client_stream_send_message(this.native_handle(),t,a)}catch(e){i(e)}});return d.makeSelfCleaningPromise(r,n)})}isActive(){return this.state==y.Activated}on(e,t){return super.on(e,t),this}static _s_on_stream_activated(e,t,n,r){r==0&&n.state==y.Activating?(n.state=y.Activated,e()):(n.state!=y.Closed&&(n.state=y.Ended),t(l.error_code_to_string(r)))}static _s_on_stream_send_message_completion(e,t,n){n==0?e():t(l.error_code_to_string(n))}static _s_on_stream_ended(t){process.nextTick(()=>{t.emit(e.ENDED,{})})}static _s_on_stream_message(t,n){process.nextTick(()=>{t.emit(e.MESSAGE,{message:g(n)})})}};e.ClientStream=b,b.ENDED=`ended`,b.MESSAGE=`message`})),Qc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CommonHttpProxyOptions=e.HttpProxyAuthenticationType=e.HttpVersion=void 0,(function(e){e[e.Unknown=0]=`Unknown`,e[e.Http1_0=1]=`Http1_0`,e[e.Http1_1=2]=`Http1_1`,e[e.Http2=3]=`Http2`})(e.HttpVersion||={});var t;(function(e){e[e.None=0]=`None`,e[e.Basic=1]=`Basic`})(t=e.HttpProxyAuthenticationType||={}),e.CommonHttpProxyOptions=class{constructor(e,n,r=t.None,i,a){this.host_name=e,this.port=n,this.auth_method=r,this.auth_username=i,this.auth_password=a}}})),$c=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.HttpClientConnectionManager=e.HttpClientStream=e.HttpStream=e.HttpClientConnection=e.HttpProxyOptions=e.HttpProxyConnectionType=e.HttpConnection=e.HttpRequest=e.HttpHeaders=e.HttpProxyAuthenticationType=void 0;let n=t(Bc()),r=Hc(),i=Vc(),a=Qc();var o=Qc();Object.defineProperty(e,`HttpProxyAuthenticationType`,{enumerable:!0,get:function(){return o.HttpProxyAuthenticationType}});let s=Yc();e.HttpHeaders=n.default.HttpHeaders;let c=n.default.HttpRequest;e.HttpRequest=class extends c{constructor(e,t,n,r){super(e,t,n,r?.native_handle())}};var l=class extends (0,r.NativeResourceMixin)(s.BufferedEventEmitter){constructor(e){super(),this._super(e)}close(){n.default.http_connection_close(this.native_handle())}on(e,t){return super.on(e,t),e==`connect`&&process.nextTick(()=>{this.uncork()}),this}};e.HttpConnection=l,l.CONNECT=`connect`,l.ERROR=`error`,l.CLOSE=`close`;var u;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Forwarding=1]=`Forwarding`,e[e.Tunneling=2]=`Tunneling`})(u=e.HttpProxyConnectionType||={}),e.HttpProxyOptions=class extends a.CommonHttpProxyOptions{constructor(e,t,n=a.HttpProxyAuthenticationType.None,r,i,o,s){super(e,t,n,r,i),this.tls_opts=o,this.connection_type=s}create_native_handle(){return n.default.http_proxy_options_new(this.host_name,this.port,this.auth_method,this.auth_username,this.auth_password,this.tls_opts?this.tls_opts.native_handle():void 0,this.connection_type?this.connection_type:u.Legacy)}};var d=class extends l{_on_setup(e,t){if(t){this.emit(`error`,new i.CrtError(t));return}this.emit(`connect`)}_on_shutdown(e,t){if(t){this.emit(`error`,new i.CrtError(t));return}this.emit(`close`)}constructor(e,t,r,a,o,s,c){if(a==null||a==null)throw new i.CrtError(`HttpClientConnection constructor: socket_options not defined`);super(c||n.default.http_connection_new(e==null?null:e.native_handle(),(e,t)=>{this._on_setup(e,t)},(e,t)=>{this._on_shutdown(e,t)},t,r,a.native_handle(),o?o.native_handle():void 0,s?s.create_native_handle():void 0)),this.bootstrap=e,this.socket_options=a,this.tls_opts=o}request(e){let t;return t=new p(n.default.http_stream_new(this.native_handle(),e,e=>{t._on_complete(e)},(e,n)=>{t._on_response(e,n)},e=>{t._on_body(e)}),this,e)}};e.HttpClientConnection=d;var f=class extends (0,r.NativeResourceMixin)(s.BufferedEventEmitter){constructor(e,t){super(),this.connection=t,this._super(e),this.cork()}activate(){n.default.http_stream_activate(this.native_handle())}close(){n.default.http_stream_close(this.native_handle())}_on_body(e){this.emit(`data`,e)}_on_complete(e){if(e){this.emit(`error`,new i.CrtError(e)),this.close();return}this.on(`end`,()=>{this.close()}),this.emit(`end`)}};e.HttpStream=f;var p=class extends f{constructor(e,t,n){super(e,t),this.request=n}status_code(){return this.response_status_code}on(e,t){return super.on(e,t),e==`response`&&process.nextTick(()=>{this.uncork()}),this}_on_response(t,n){this.response_status_code=t;let r=new e.HttpHeaders(n);this.emit(`response`,t,r)}};e.HttpClientStream=p,p.RESPONSE=`response`,p.DATA=`data`,p.ERROR=`error`,p.END=`end`,p.HEADERS=`headers`,e.HttpClientConnectionManager=class extends r.NativeResource{constructor(e,t,r,a,o,s,c,l){if(s==null||s==null)throw new i.CrtError(`HttpClientConnectionManager constructor: socket_options not defined`);super(n.default.http_connection_manager_new(e==null?null:e.native_handle(),t,r,a,o,s.native_handle(),c?c.native_handle():void 0,l?l.create_native_handle():void 0,void 0)),this.bootstrap=e,this.host=t,this.port=r,this.max_connections=a,this.initial_window_size=o,this.socket_options=s,this.tls_opts=c,this.proxy_options=l,this.connections=new Map}acquire(){return new Promise((e,t)=>{n.default.http_connection_manager_acquire(this.native_handle(),(n,r)=>{if(r){t(new i.CrtError(r));return}let a=this.connections.get(n);a||(a=new d(this.bootstrap,this.host,this.port,this.socket_options,this.tls_opts,this.proxy_options,n),this.connections.set(n,a),a.on(`close`,()=>{this.connections.delete(n)})),e(a)})})}release(e){if(e==null||e==null)throw new i.CrtError(`HttpClientConnectionManager release: connection not defined`);n.default.http_connection_manager_release(this.native_handle(),e.native_handle())}close(){n.default.http_connection_manager_close(this.native_handle())}}})),el=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_RECONNECT_MIN_SEC=e.DEFAULT_RECONNECT_MAX_SEC=e.MqttWill=e.QoS=void 0,(function(e){e[e.AtMostOnce=0]=`AtMostOnce`,e[e.AtLeastOnce=1]=`AtLeastOnce`,e[e.ExactlyOnce=2]=`ExactlyOnce`})(e.QoS||={}),e.MqttWill=class{constructor(e,t,n,r=!1){this.topic=e,this.qos=t,this.payload=n,this.retain=r}},e.DEFAULT_RECONNECT_MAX_SEC=128,e.DEFAULT_RECONNECT_MIN_SEC=1})),tl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.set_defined_property=void 0;function t(e,t,n){return n===void 0||n==null?!1:(e[t]=n,!0)}e.set_defined_property=t})),nl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.extractRegionFromEndpoint=e.buildMqtt5FinalUsername=e.canonicalizeCustomAuthConfig=e.canonicalizeCustomAuthTokenSignature=e.populate_username_string_with_custom_authorizer=e.is_string_and_not_empty=e.add_to_username_parameter=void 0;let i=r(Rc()),a=r(tl());function o(e,t,n){let r=e;return r.indexOf(`?`)==-1?r+=`?`:r+=`&`,t.indexOf(n)==-1?r+n+t:r+t}e.add_to_username_parameter=o;function s(e){return e!=null&&typeof e==`string`&&e!=``}e.is_string_and_not_empty=s;function c(e,t,n,r,i,a,c){let l=``;if(e&&(l+=e),s(t)==0?s(i)&&i&&(l+=i):l+=t,s(n)&&n&&(l=o(l,n,`x-amz-customauthorizer-name=`)),(s(r)||s(c)||s(a))&&(!c||!a||!r))throw Error(`Signing-based custom authentication requires all token-related properties to be set`);return s(r)&&r&&(l=o(l,r,`x-amz-customauthorizer-signature=`)),s(c)&&s(a)&&(l=o(l,c,a+`=`)),l}e.populate_username_string_with_custom_authorizer=c;function l(e){if(!(e===void 0||e==null))return e.indexOf(`%`)==-1?encodeURIComponent(e):e}e.canonicalizeCustomAuthTokenSignature=l;function u(e){let t={};return a.set_defined_property(t,`authorizerName`,e.authorizerName),a.set_defined_property(t,`username`,e.username),a.set_defined_property(t,`password`,e.password),a.set_defined_property(t,`tokenKeyName`,e.tokenKeyName),a.set_defined_property(t,`tokenValue`,e.tokenValue),a.set_defined_property(t,`tokenSignature`,l(e.tokenSignature)),t}e.canonicalizeCustomAuthConfig=u;function d(e,t,n){t&&n.push([e,t])}function f(e){let t=``,n=[];if(e){let r=!1;if((e.tokenValue||e.tokenKeyName||e.tokenSignature)&&(r=!0,!e.tokenValue||!e.tokenKeyName||!e.tokenSignature))throw Error(`Token-based custom authentication requires all token-related properties to be set`);let i=(e.username??``).split(`?`),a=i.slice(1);if(t=i[0],a.length>1)throw Error(`Custom auth username property value is invalid`);a.length==1&&a[0].split(`&`).forEach((e,t,r)=>{let i=e.split(`=`);n.push([i[0],i[1]??``])}),d(`x-amz-customauthorizer-name`,e.authorizerName,n),r&&(d(e.tokenKeyName,e.tokenValue,n),d(`x-amz-customauthorizer-signature`,e.tokenSignature,n))}return n.push([`SDK`,`NodeJSv2`]),n.push([`Version`,i.crt_version()]),(t??``)+`?`+n.map(e=>`${e[0]}=${e[1]}`).join(`&`)}e.buildMqtt5FinalUsername=f;function p(e){let t=e.match(/^[\w\-]+\.[\w\-]+\.([\w+\-]+)\./);if(t)return t[1];throw Error(`AWS region could not be extracted from endpoint. Use 'region' property on WebsocketConfig to set manually.`)}e.extractRegionFromEndpoint=p})),rl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsIotMqttConnectionConfigBuilder=void 0;let a=el(),o=r(Wc()),s=Wc(),c=r(Rc()),l=Vc(),u=Gc(),d=r(nl());e.AwsIotMqttConnectionConfigBuilder=class e{constructor(e){this.tls_ctx_options=e,this.params={client_id:``,host_name:``,socket_options:new o.SocketOptions,port:8883,use_websocket:!1,clean_session:!1,keep_alive:void 0,will:void 0,username:``,password:void 0,tls_ctx:void 0,reconnect_min_sec:a.DEFAULT_RECONNECT_MIN_SEC,reconnect_max_sec:a.DEFAULT_RECONNECT_MAX_SEC},this.is_using_custom_authorizer=!1}static new_mtls_builder_from_path(t,n){let r=new e(s.TlsContextOptions.create_client_with_mtls_from_path(t,n));return r.params.port=8883,o.is_alpn_available()&&r.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static new_mtls_builder(t,n){let r=new e(s.TlsContextOptions.create_client_with_mtls(t,n));return r.params.port=8883,o.is_alpn_available()&&r.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static new_mtls_pkcs11_builder(t){let n=new e(s.TlsContextOptions.create_client_with_mtls_pkcs11(t));return n.params.port=8883,o.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),n}static new_mtls_pkcs12_builder(t){let n=new e(s.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(t.pkcs12_file,t.pkcs12_password));return n.params.port=8883,o.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),n}static new_mtls_windows_cert_store_path_builder(t){let n=new e(s.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(t));return n.params.port=8883,o.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),n}static new_default_builder(){return new e(new o.TlsContextOptions)}static new_websocket_builder(...e){return this.new_with_websockets(...e)}static configure_websocket_handshake(e,t){if(t){if(e==null||e==null)throw new l.CrtError(`AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined`);e.params.websocket_handshake_transform=(e,n)=>i(this,void 0,void 0,function*(){let r=t.create_signing_config?.call(t)??{algorithm:u.AwsSigningAlgorithm.SigV4,signature_type:u.AwsSignatureType.HttpRequestViaQueryParams,provider:t.credentials_provider,region:t.region,service:t.service??`iotdevicegateway`,signed_body_value:u.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};try{yield(0,u.aws_sign_request)(e,r),n()}catch(e){e instanceof l.CrtError?n(e.error_code):n(3)}})}return e}static new_with_websockets(t){let n=t?.tls_ctx_options;n||(n=new s.TlsContextOptions,n.alpn_list=[]);let r=new e(n);return r.params.use_websocket=!0,r.params.proxy_options=t?.proxy_options,r.tls_ctx_options&&(r.params.port=443),this.configure_websocket_handshake(r,t),r}static new_builder_for_websocket(){return this.new_with_websockets()}with_certificate_authority_from_path(e,t){return this.tls_ctx_options.override_default_trust_store_from_path(e,t),this}with_certificate_authority(e){return this.tls_ctx_options.override_default_trust_store(e),this}with_tls_cipher_preference(e){return this.tls_ctx_options.tls_cipher_preference=e,this}with_endpoint(e){return this.params.host_name=e,this}with_port(e){return this.params.port=e,this}with_client_id(e){return this.params.client_id=e,this}with_clean_session(e){return this.params.clean_session=e,this}with_keep_alive_seconds(e){return this.params.keep_alive=e,this}with_timeout_ms(e){return this.with_ping_timeout_ms(e),this}with_ping_timeout_ms(e){return this.params.ping_timeout=e,this}with_protocol_operation_timeout_ms(e){return this.params.protocol_operation_timeout=e,this}with_will(e){return this.params.will=e,this}with_socket_options(e){return this.params.socket_options=e,this}with_credentials(t,n,r,i){return e.configure_websocket_handshake(this,{credentials_provider:u.AwsCredentialsProvider.newStatic(n,r,i),region:t,service:`iotdevicegateway`})}with_http_proxy_options(e){return this.params.proxy_options=e,this}with_custom_authorizer(e,t,n,r,i,a){this.is_using_custom_authorizer=!0;let o=d.canonicalizeCustomAuthTokenSignature(n),s=d.populate_username_string_with_custom_authorizer(``,e,t,o,this.params.username,i,a);return this.params.username=s,this.params.password=r,this.params.use_websocket||(this.tls_ctx_options.alpn_list=[`mqtt`]),this.params.port=443,this}with_username(e){return this.params.username=e,this}with_password(e){return this.params.password=e,this}with_reconnect_max_sec(e){return this.params.reconnect_max_sec=e,this}with_reconnect_min_sec(e){return this.params.reconnect_min_sec=e,this}build(){if(this.params.client_id===void 0||this.params.host_name===void 0)throw`client_id and endpoint are required`;return this.is_using_custom_authorizer==0&&d.is_string_and_not_empty(this.params.username)&&(this.params.username?.indexOf(`x-amz-customauthorizer-name=`)!=-1||this.params.username?.indexOf(`x-amz-customauthorizer-signature=`)!=-1)&&(this.is_using_custom_authorizer=!0),this.is_using_custom_authorizer==1&&this.params.port!=443&&console.log(`Warning: Attempting to connect to authorizer with unsupported port. Port is not 443...`),this.params.tls_ctx===void 0&&(this.params.tls_ctx=new o.ClientTlsContext(this.tls_ctx_options)),d.is_string_and_not_empty(this.params.username)==0?this.params.username=`?SDK=NodeJSv2&Version=`:this.params.username?.indexOf(`?`)==-1?this.params.username+=`?SDK=NodeJSv2&Version=`:this.params.username+=`&SDK=NodeJSv2&Version=`,this.params.username+=c.crt_version(),this.params}}})),il=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isValidTopic=e.isValidTopicFilter=e.DEFAULT_KEEP_ALIVE=e.normalize_payload_to_buffer=e.normalize_payload=void 0;function t(e){if(e instanceof Buffer||typeof e==`string`)return e;if(ArrayBuffer.isView(e)){let t=e;return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}if(e instanceof ArrayBuffer)return Buffer.from(e);if(typeof e==`object`)return JSON.stringify(e);if(!e)return``;throw TypeError(`payload parameter must be a string, object, or DataView.`)}e.normalize_payload=t;function n(e){let n=t(e);return typeof n==`string`?Buffer.from(n):n}e.normalize_payload_to_buffer=n,e.DEFAULT_KEEP_ALIVE=1200;function r(e,t){if(e.length===0||e.length>65535)return!1;let n=!1;for(let r of e.split(`/`)){if(n)return!1;if(r.length!==0){if(r.includes(`+`)&&(!t||r.length>1))return!1;if(r.includes(`#`)){if(!t||r.length>1)return!1;n=!0}}}return!0}function i(e){return typeof e==`string`?r(e,!0):!1}e.isValidTopicFilter=i;function a(e){return typeof e==`string`?r(e,!1):!1}e.isValidTopic=a})),al=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InboundTopicAliasBehaviorType=e.OutboundTopicAliasBehaviorType=e.RetryJitterType=e.ClientSessionBehavior=void 0,(function(e){e[e.Default=0]=`Default`,e[e.Clean=1]=`Clean`,e[e.RejoinPostSuccess=2]=`RejoinPostSuccess`,e[e.RejoinAlways=3]=`RejoinAlways`})(e.ClientSessionBehavior||={}),(function(e){e[e.Default=0]=`Default`,e[e.None=1]=`None`,e[e.Full=2]=`Full`,e[e.Decorrelated=3]=`Decorrelated`})(e.RetryJitterType||={}),(function(e){e[e.Default=0]=`Default`,e[e.Manual=1]=`Manual`,e[e.LRU=2]=`LRU`,e[e.Disabled=3]=`Disabled`})(e.OutboundTopicAliasBehaviorType||={}),(function(e){e[e.Default=0]=`Default`,e[e.Enabled=1]=`Enabled`,e[e.Disabled=2]=`Disabled`})(e.InboundTopicAliasBehaviorType||={})})),ol=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PacketType=e.RetainHandlingType=e.QoS=e.PayloadFormatIndicator=e.isSuccessfulPubackReasonCode=e.PubackReasonCode=e.isSuccessfulUnsubackReasonCode=e.UnsubackReasonCode=e.isSuccessfulSubackReasonCode=e.SubackReasonCode=e.isSuccessfulDisconnectReasonCode=e.DisconnectReasonCode=e.isSuccessfulConnectReasonCode=e.ConnectReasonCode=void 0,(function(e){e[e.Success=0]=`Success`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.MalformedPacket=129]=`MalformedPacket`,e[e.ProtocolError=130]=`ProtocolError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.UnsupportedProtocolVersion=132]=`UnsupportedProtocolVersion`,e[e.ClientIdentifierNotValid=133]=`ClientIdentifierNotValid`,e[e.BadUsernameOrPassword=134]=`BadUsernameOrPassword`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.ServerUnavailable=136]=`ServerUnavailable`,e[e.ServerBusy=137]=`ServerBusy`,e[e.Banned=138]=`Banned`,e[e.BadAuthenticationMethod=140]=`BadAuthenticationMethod`,e[e.TopicNameInvalid=144]=`TopicNameInvalid`,e[e.PacketTooLarge=149]=`PacketTooLarge`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.PayloadFormatInvalid=153]=`PayloadFormatInvalid`,e[e.RetainNotSupported=154]=`RetainNotSupported`,e[e.QosNotSupported=155]=`QosNotSupported`,e[e.UseAnotherServer=156]=`UseAnotherServer`,e[e.ServerMoved=157]=`ServerMoved`,e[e.ConnectionRateExceeded=159]=`ConnectionRateExceeded`})(e.ConnectReasonCode||={});function t(e){return e<128}e.isSuccessfulConnectReasonCode=t,(function(e){e[e.NormalDisconnection=0]=`NormalDisconnection`,e[e.DisconnectWithWillMessage=4]=`DisconnectWithWillMessage`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.MalformedPacket=129]=`MalformedPacket`,e[e.ProtocolError=130]=`ProtocolError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.ServerBusy=137]=`ServerBusy`,e[e.ServerShuttingDown=139]=`ServerShuttingDown`,e[e.KeepAliveTimeout=141]=`KeepAliveTimeout`,e[e.SessionTakenOver=142]=`SessionTakenOver`,e[e.TopicFilterInvalid=143]=`TopicFilterInvalid`,e[e.TopicNameInvalid=144]=`TopicNameInvalid`,e[e.ReceiveMaximumExceeded=147]=`ReceiveMaximumExceeded`,e[e.TopicAliasInvalid=148]=`TopicAliasInvalid`,e[e.PacketTooLarge=149]=`PacketTooLarge`,e[e.MessageRateTooHigh=150]=`MessageRateTooHigh`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.AdministrativeAction=152]=`AdministrativeAction`,e[e.PayloadFormatInvalid=153]=`PayloadFormatInvalid`,e[e.RetainNotSupported=154]=`RetainNotSupported`,e[e.QosNotSupported=155]=`QosNotSupported`,e[e.UseAnotherServer=156]=`UseAnotherServer`,e[e.ServerMoved=157]=`ServerMoved`,e[e.SharedSubscriptionsNotSupported=158]=`SharedSubscriptionsNotSupported`,e[e.ConnectionRateExceeded=159]=`ConnectionRateExceeded`,e[e.MaximumConnectTime=160]=`MaximumConnectTime`,e[e.SubscriptionIdentifiersNotSupported=161]=`SubscriptionIdentifiersNotSupported`,e[e.WildcardSubscriptionsNotSupported=162]=`WildcardSubscriptionsNotSupported`})(e.DisconnectReasonCode||={});function n(e){return e<128}e.isSuccessfulDisconnectReasonCode=n,(function(e){e[e.GrantedQoS0=0]=`GrantedQoS0`,e[e.GrantedQoS1=1]=`GrantedQoS1`,e[e.GrantedQoS2=2]=`GrantedQoS2`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.TopicFilterInvalid=143]=`TopicFilterInvalid`,e[e.PacketIdentifierInUse=145]=`PacketIdentifierInUse`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.SharedSubscriptionsNotSupported=158]=`SharedSubscriptionsNotSupported`,e[e.SubscriptionIdentifiersNotSupported=161]=`SubscriptionIdentifiersNotSupported`,e[e.WildcardSubscriptionsNotSupported=162]=`WildcardSubscriptionsNotSupported`})(e.SubackReasonCode||={});function r(e){return e<128}e.isSuccessfulSubackReasonCode=r,(function(e){e[e.Success=0]=`Success`,e[e.NoSubscriptionExisted=17]=`NoSubscriptionExisted`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.TopicFilterInvalid=143]=`TopicFilterInvalid`,e[e.PacketIdentifierInUse=145]=`PacketIdentifierInUse`})(e.UnsubackReasonCode||={});function i(e){return e<128}e.isSuccessfulUnsubackReasonCode=i,(function(e){e[e.Success=0]=`Success`,e[e.NoMatchingSubscribers=16]=`NoMatchingSubscribers`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.TopicNameInvalid=144]=`TopicNameInvalid`,e[e.PacketIdentifierInUse=145]=`PacketIdentifierInUse`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.PayloadFormatInvalid=153]=`PayloadFormatInvalid`})(e.PubackReasonCode||={});function a(e){return e<128}e.isSuccessfulPubackReasonCode=a,(function(e){e[e.Bytes=0]=`Bytes`,e[e.Utf8=1]=`Utf8`})(e.PayloadFormatIndicator||={}),(function(e){e[e.AtMostOnce=0]=`AtMostOnce`,e[e.AtLeastOnce=1]=`AtLeastOnce`,e[e.ExactlyOnce=2]=`ExactlyOnce`})(e.QoS||={}),(function(e){e[e.SendOnSubscribe=0]=`SendOnSubscribe`,e[e.SendOnSubscribeIfNew=1]=`SendOnSubscribeIfNew`,e[e.DontSend=2]=`DontSend`})(e.RetainHandlingType||={}),(function(e){e[e.Connect=1]=`Connect`,e[e.Connack=2]=`Connack`,e[e.Publish=3]=`Publish`,e[e.Puback=4]=`Puback`,e[e.Pubrec=5]=`Pubrec`,e[e.Pubrel=6]=`Pubrel`,e[e.Pubcomp=7]=`Pubcomp`,e[e.Subscribe=8]=`Subscribe`,e[e.Suback=9]=`Suback`,e[e.Unsubscribe=10]=`Unsubscribe`,e[e.Unsuback=11]=`Unsuback`,e[e.Pingreq=12]=`Pingreq`,e[e.Pingresp=13]=`Pingresp`,e[e.Disconnect=14]=`Disconnect`,e[e.Auth=15]=`Auth`})(e.PacketType||={})})),sl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)},a=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Mqtt5Client=e.ClientExtendedValidationAndFlowControl=e.ClientOperationQueueBehavior=e.HttpProxyOptions=void 0;let s=o(Bc()),c=Hc(),l=Yc(),u=r(Wc()),d=r(il()),f=Vc();var p=$c();Object.defineProperty(e,`HttpProxyOptions`,{enumerable:!0,get:function(){return p.HttpProxyOptions}}),i(al(),e),i(ol(),e),(function(e){e[e.Default=0]=`Default`,e[e.FailNonQos1PublishOnDisconnect=1]=`FailNonQos1PublishOnDisconnect`,e[e.FailQos0PublishOnDisconnect=2]=`FailQos0PublishOnDisconnect`,e[e.FailAllOnDisconnect=3]=`FailAllOnDisconnect`})(e.ClientOperationQueueBehavior||={}),(function(e){e[e.None=0]=`None`,e[e.AwsIotCoreDefaults=1]=`AwsIotCoreDefaults`})(e.ClientExtendedValidationAndFlowControl||={});var m=class e extends (0,c.NativeResourceMixin)(l.BufferedEventEmitter){constructor(t){super(),this._super(s.default.mqtt5_client_new(this,t,t=>{e._s_on_stopped(t)},t=>{e._s_on_attempting_connect(t)},(t,n,r)=>{e._s_on_connection_success(t,n,r)},(t,n,r)=>{e._s_on_connection_failure(t,new f.CrtError(n),r)},(t,n,r)=>{e._s_on_disconnection(t,new f.CrtError(n),r)},(t,n)=>{e._s_on_message_received(t,n)},t.clientBootstrap?t.clientBootstrap.native_handle():null,t.socketOptions?t.socketOptions.native_handle():null,t.tlsCtx?t.tlsCtx.native_handle():null,t.httpProxyOptions?t.httpProxyOptions.create_native_handle():null))}close(){s.default.mqtt5_client_close(this.native_handle())}start(){s.default.mqtt5_client_start(this.native_handle())}stop(e){s.default.mqtt5_client_stop(this.native_handle(),e)}subscribe(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{function i(t,i,a){return e._s_on_suback_callback(n,r,t,i,a)}try{s.default.mqtt5_client_subscribe(this.native_handle(),t,i)}catch(e){r(e)}})})}unsubscribe(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{function i(t,i,a){return e._s_on_unsuback_callback(n,r,t,i,a)}try{s.default.mqtt5_client_unsubscribe(this.native_handle(),t,i)}catch(e){r(e)}})})}publish(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{t&&t.payload&&(t.payload=d.normalize_payload(t.payload));function i(t,i,a){return e._s_on_puback_callback(n,r,t,i,a)}try{s.default.mqtt5_client_publish(this.native_handle(),t,i)}catch(e){r(e)}})})}getOperationalStatistics(){return s.default.mqtt5_client_get_queue_statistics(this.native_handle())}getQueueStatistics(){return this.getOperationalStatistics()}on(e,t){return super.on(e,t),this}static _s_on_stopped(t){process.nextTick(()=>{t.emit(e.STOPPED,{})})}static _s_on_attempting_connect(t){process.nextTick(()=>{t.emit(e.ATTEMPTING_CONNECT,{})})}static _s_on_connection_success(t,n,r){let i={connack:n,settings:r};process.nextTick(()=>{t.emit(e.CONNECTION_SUCCESS,i)})}static _s_on_connection_failure(t,n,r){let i={error:n};r!=null&&(i.connack=r),process.nextTick(()=>{t.emit(e.CONNECTION_FAILURE,i)})}static _s_on_disconnection(t,n,r){let i={error:n};r!=null&&(i.disconnect=r),process.nextTick(()=>{t.emit(e.DISCONNECTION,i)})}static _s_on_suback_callback(e,t,n,r,i){r==0&&i!==void 0?e(i):t(u.error_code_to_string(r))}static _s_on_unsuback_callback(e,t,n,r,i){r==0&&i!==void 0?e(i):t(u.error_code_to_string(r))}static _s_on_puback_callback(e,t,n,r,i){r==0?e(i):t(u.error_code_to_string(r))}static _s_on_message_received(t,n){let r={message:n};process.nextTick(()=>{t.emit(e.MESSAGE_RECEIVED,r)})}};e.Mqtt5Client=m,m.ERROR=`error`,m.MESSAGE_RECEIVED=`messageReceived`,m.ATTEMPTING_CONNECT=`attemptingConnect`,m.CONNECTION_SUCCESS=`connectionSuccess`,m.CONNECTION_FAILURE=`connectionFailure`,m.DISCONNECTION=`disconnection`,m.STOPPED=`stopped`})),cl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsIotMqtt5ClientConfigBuilder=void 0;let a=r(sl()),o=r(Wc()),s=r(Gc()),c=Vc(),l=r(nl()),u=r(il());var d=class e{constructor(e,t,n){this.tlsContextOptions=n,this.config={hostName:e,port:t,connectProperties:{keepAliveIntervalSeconds:u.DEFAULT_KEEP_ALIVE},extendedValidationAndFlowControlOptions:a.ClientExtendedValidationAndFlowControl.AwsIotCoreDefaults}}static newDirectMqttBuilderWithMtlsFromPath(t,n,r){let i=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_from_path(n,r));return o.is_alpn_available()&&i.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),i}static newDirectMqttBuilderWithMtlsFromMemory(t,n,r){let i=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls(n,r));return o.is_alpn_available()&&i.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),i}static newDirectMqttBuilderWithMtlsFromPkcs11(t,n){let r=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_pkcs11(n));return o.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static newDirectMqttBuilderWithMtlsFromPkcs12(t,n){let r=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(n.pkcs12_file,n.pkcs12_password));return o.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static newDirectMqttBuilderWithMtlsFromWindowsCertStorePath(t,n){let r=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(n));return o.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static newDirectMqttBuilderWithCustomAuth(t,n){let r=new e(t,e.DEFAULT_WEBSOCKET_MQTT_PORT,new o.TlsContextOptions);return r.customAuthConfig=l.canonicalizeCustomAuthConfig(n),r.tlsContextOptions.alpn_list=[`mqtt`],r}static newWebsocketMqttBuilderWithSigv4Auth(t,n){let r=new o.TlsContextOptions;r.alpn_list=[];let a=new e(t,e.DEFAULT_WEBSOCKET_MQTT_PORT,r),u=n?.credentialsProvider;return u||=s.AwsCredentialsProvider.newDefault(),a.config.websocketHandshakeTransform=(e,r)=>i(this,void 0,void 0,function*(){try{let i={algorithm:s.AwsSigningAlgorithm.SigV4,signature_type:s.AwsSignatureType.HttpRequestViaQueryParams,provider:u,region:n?.region??l.extractRegionFromEndpoint(t),service:`iotdevicegateway`,signed_body_value:s.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};yield s.aws_sign_request(e,i),r()}catch(e){e instanceof c.CrtError?r(e.error_code):r(3)}}),a}static newWebsocketMqttBuilderWithCustomAuth(t,n){let r=new e(t,e.DEFAULT_WEBSOCKET_MQTT_PORT,new o.TlsContextOptions);return r.customAuthConfig=n,r.config.websocketHandshakeTransform=(e,t)=>i(this,void 0,void 0,function*(){t(0)}),r}withCertificateAuthorityFromPath(e,t){return this.tlsContextOptions.override_default_trust_store_from_path(e,t),this}withCertificateAuthority(e){return this.tlsContextOptions.override_default_trust_store(e),this}withTlsCipherPreference(e){return this.tlsContextOptions.tls_cipher_preference=e,this}withPort(e){return this.config.port=e,this}withConnectProperties(e){return this.config.connectProperties=e,this}withSessionBehavior(e){return this.config.sessionBehavior=e,this}withRetryJitterMode(e){return this.config.retryJitterMode=e,this}withMinReconnectDelayMs(e){return this.config.minReconnectDelayMs=e,this}withMaxReconnectDelayMs(e){return this.config.maxReconnectDelayMs=e,this}withMinConnectedTimeToResetReconnectDelayMs(e){return this.config.minConnectedTimeToResetReconnectDelayMs=e,this}withConnackTimeoutMs(e){return this.config.connackTimeoutMs=e,this}withOfflineQueueBehavior(e){return this.config.offlineQueueBehavior=e,this}withPingTimeoutMs(e){return this.config.pingTimeoutMs=e,this}withAckTimeoutSeconds(e){return this.config.ackTimeoutSeconds=e,this}withSocketOptions(e){return this.config.socketOptions=e,this}withHttpProxyOptions(e){return this.config.httpProxyOptions=e,this}withExtendedValidationAndFlowControlOptions(e){return this.config.extendedValidationAndFlowControlOptions=e,this}withTopicAliasingOptions(e){return this.config.topicAliasingOptions=e,this}build(){return this.config.tlsCtx===void 0&&(this.config.tlsCtx=new o.ClientTlsContext(this.tlsContextOptions)),this.config.connectProperties&&(this.config.connectProperties.username=l.buildMqtt5FinalUsername(this.customAuthConfig),this.customAuthConfig?.password&&(this.config.connectProperties.password=this.customAuthConfig?.password)),this.config}};e.AwsIotMqtt5ClientConfigBuilder=d,d.DEFAULT_WEBSOCKET_MQTT_PORT=443,d.DEFAULT_DIRECT_MQTT_PORT=8883})),ll=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(rl(),e),n(cl(),e)})),ul=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MqttClientConnection=e.MqttClient=e.MqttWill=e.QoS=e.HttpProxyOptions=void 0;let o=a(Bc()),s=Hc(),c=Yc(),l=r(il()),u=Vc(),d=r(Wc());var f=$c();Object.defineProperty(e,`HttpProxyOptions`,{enumerable:!0,get:function(){return f.HttpProxyOptions}});let p=el();var m=el();Object.defineProperty(e,`QoS`,{enumerable:!0,get:function(){return m.QoS}}),Object.defineProperty(e,`MqttWill`,{enumerable:!0,get:function(){return m.MqttWill}}),e.MqttClient=class extends s.NativeResource{constructor(e=void 0){super(o.default.mqtt_client_new(e==null?null:e.native_handle())),this.bootstrap=e}new_connection(e){return new h(this,e)}};var h=class extends (0,s.NativeResourceMixin)(c.BufferedEventEmitter){constructor(e,t){if(super(),this.client=e,this.config=t,t==null||t==null)throw new u.CrtError(`MqttClientConnection constructor: config not defined`);let n=t.will?{topic:t.will.topic,qos:t.will.qos,payload:l.normalize_payload(t.will.payload),retain:t.will.retain}:void 0;var r=p.DEFAULT_RECONNECT_MIN_SEC,i=p.DEFAULT_RECONNECT_MAX_SEC;if(t.reconnect_min_sec&&(r=t.reconnect_min_sec,i=Math.max(r,i)),t.reconnect_max_sec&&(i=t.reconnect_max_sec,r=Math.min(r,i)),e==null||e==null)throw new u.CrtError(`MqttClientConnection constructor: client not defined`);if(t.socket_options==null||t.socket_options==null)throw new u.CrtError(`MqttClientConnection constructor: socket_options in configuration not defined`);this._super(o.default.mqtt_client_connection_new(e.native_handle(),e=>{this._on_connection_interrupted(e)},(e,t)=>{this._on_connection_resumed(e,t)},(e,t)=>{this._on_connection_success(e,t)},e=>{this._on_connection_failure(e)},t.tls_ctx?t.tls_ctx.native_handle():null,n,t.username,t.password,t.use_websocket,t.proxy_options?t.proxy_options.create_native_handle():void 0,t.websocket_handshake_transform,r,i)),this.tls_ctx=t.tls_ctx,o.default.mqtt_client_connection_on_message(this.native_handle(),this._on_any_publish.bind(this)),o.default.mqtt_client_connection_on_closed(this.native_handle(),this._on_connection_closed.bind(this)),this.on(`error`,e=>{})}close(){o.default.mqtt_client_connection_close(this.native_handle())}on(e,t){return super.on(e,t),e==`connect`&&process.nextTick(()=>{this.uncork()}),this}connect(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{if(t=this._reject(t),this.config.socket_options==null||this.config.socket_options==null)throw new u.CrtError(`MqttClientConnection connect: socket_options in configuration not defined`);try{o.default.mqtt_client_connection_connect(this.native_handle(),this.config.client_id,this.config.host_name,this.config.port,this.config.socket_options.native_handle(),this.config.keep_alive,this.config.ping_timeout,this.config.protocol_operation_timeout,this.config.clean_session,this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}})})}reconnect(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{t=this._reject(t);try{o.default.mqtt_client_connection_reconnect(this.native_handle(),this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}})})}publish(e,t,n,r=!1){return i(this,void 0,void 0,function*(){return typeof e==`string`?typeof n==`number`?typeof r==`boolean`?new Promise((i,a)=>{a=this._reject(a);try{o.default.mqtt_client_connection_publish(this.native_handle(),e,l.normalize_payload(t),n,r,this._on_puback_callback.bind(this,i,a))}catch(e){a(e)}}):Promise.reject(`retain is not a boolean`):Promise.reject(`qos is not a number`):Promise.reject(`topic is not a string`)})}subscribe(e,t,n){return i(this,void 0,void 0,function*(){return typeof e==`string`?typeof t==`number`?new Promise((r,i)=>{i=this._reject(i);try{o.default.mqtt_client_connection_subscribe(this.native_handle(),e,t,n,this._on_suback_callback.bind(this,r,i))}catch(e){i(e)}}):Promise.reject(`qos is not a number`):Promise.reject(`topic is not a string`)})}unsubscribe(e){return i(this,void 0,void 0,function*(){return typeof e==`string`?new Promise((t,n)=>{n=this._reject(n);try{o.default.mqtt_client_connection_unsubscribe(this.native_handle(),e,this._on_unsuback_callback.bind(this,t,n))}catch(e){n(e)}}):Promise.reject(`topic is not a string`)})}disconnect(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{t=this._reject(t);try{o.default.mqtt_client_connection_disconnect(this.native_handle(),this._on_disconnect_callback.bind(this,e))}catch(e){t(e)}})})}getOperationalStatistics(){return o.default.mqtt_client_connection_get_queue_statistics(this.native_handle())}getQueueStatistics(){return this.getOperationalStatistics()}_reject(e){return t=>{e(t),process.nextTick(()=>{this.emit(`error`,new u.CrtError(t))})}}_on_connection_failure(e){let t={error:new u.CrtError(e)};this.emit(`connection_failure`,t)}_on_connection_success(e,t){let n={session_present:t,reason_code:e};this.emit(`connection_success`,n)}_on_connection_interrupted(e){this.emit(`interrupt`,new u.CrtError(e))}_on_connection_resumed(e,t){this.emit(`resume`,e,t)}_on_any_publish(e,t,n,r,i){this.emit(`message`,e,t,n,r,i)}_on_connection_closed(){this.emit(`closed`,{}),this.close()}_on_connect_callback(e,t,n,r,i){n==0&&r==0?(e(i),this.emit(`connect`,i)):t(n==0?`Server rejected connection.`:`Failed to connect: `+d.error_code_to_string(n))}_on_puback_callback(e,t,n,r){r==0?e({packet_id:n}):t(`Failed to publish: `+d.error_code_to_string(r))}_on_suback_callback(e,t,n,r,i,a){a==0?e({packet_id:n,topic:r,qos:i,error_code:a}):t(`Failed to subscribe: `+d.error_code_to_string(a))}_on_unsuback_callback(e,t,n,r){r==0?e({packet_id:n}):t(`Failed to unsubscribe: `+d.error_code_to_string(r))}_on_disconnect_callback(e){e(),this.emit(`disconnect`)}};e.MqttClientConnection=h,h.CONNECT=`connect`,h.DISCONNECT=`disconnect`,h.ERROR=`error`,h.INTERRUPT=`interrupt`,h.RESUME=`resume`,h.MESSAGE=`message`,h.CONNECTION_SUCCESS=`connection_success`,h.CONNECTION_FAILURE=`connection_failure`,h.CLOSED=`closed`})),dl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RequestResponseClientState=e.StreamingOperationState=void 0,(function(e){e[e.None=0]=`None`,e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`})(e.StreamingOperationState||={}),(function(e){e[e.Ready=0]=`Ready`,e[e.Closed=1]=`Closed`})(e.RequestResponseClientState||={})})),fl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SubscriptionStatusEventType=void 0,(function(e){e[e.SubscriptionEstablished=0]=`SubscriptionEstablished`,e[e.SubscriptionLost=1]=`SubscriptionLost`,e[e.SubscriptionHalted=2]=`SubscriptionHalted`})(e.SubscriptionStatusEventType||={})})),pl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)},a=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RequestResponseClient=e.StreamingOperationBase=void 0;let s=Vc(),c=r(dl()),l=Hc(),u=Yc(),d=o(Bc()),f=Wc();i(fl(),e);var p=class e extends (0,l.NativeResourceMixin)(u.BufferedEventEmitter){static new(t,n){if(!t)throw new s.CrtError(`invalid configuration for streaming operation`);let r=new e(n);return r._super(d.default.mqtt_streaming_operation_new(r,n.native_handle(),t,(t,n,i)=>{e._s_on_subscription_status_update(r,n,i)},(t,n)=>{e._s_on_incoming_publish(r,n)})),n.registerUnclosedStreamingOperation(r),r}constructor(e){super(),this.state=c.StreamingOperationState.None,this.client=e}open(){if(this.state==c.StreamingOperationState.None)this.state=c.StreamingOperationState.Open,d.default.mqtt_streaming_operation_open(this.native_handle());else if(this.state==c.StreamingOperationState.Closed)throw new s.CrtError(`MQTT streaming operation already closed`)}close(){this.state!=c.StreamingOperationState.Closed&&(this.client.unregisterUnclosedStreamingOperation(this),this.state=c.StreamingOperationState.Closed,d.default.mqtt_streaming_operation_close(this.native_handle()))}on(e,t){return super.on(e,t),this}static _s_on_subscription_status_update(t,n,r){let i={type:n};r!=0&&(i.error=new s.CrtError(r)),process.nextTick(()=>{t.emit(e.SUBSCRIPTION_STATUS,i)})}static _s_on_incoming_publish(t,n){process.nextTick(()=>{t.emit(e.INCOMING_PUBLISH,n)})}};e.StreamingOperationBase=p,p.SUBSCRIPTION_STATUS=`subscriptionStatus`,p.INCOMING_PUBLISH=`incomingPublish`,e.RequestResponseClient=class e extends (0,l.NativeResourceMixin)(u.BufferedEventEmitter){constructor(){super(),this.state=c.RequestResponseClientState.Ready,this.unclosedOperations=new Set}static newFromMqtt5(t,n){if(!t)throw new s.CrtError(`protocol client is null`);let r=new e;return r._super(d.default.mqtt_request_response_client_new_from_5(r,t.native_handle(),n)),r}static newFromMqtt311(t,n){if(!t)throw new s.CrtError(`protocol client is null`);let r=new e;return r._super(d.default.mqtt_request_response_client_new_from_311(r,t.native_handle(),n)),r}close(){this.state!=c.RequestResponseClientState.Closed&&(this.state=c.RequestResponseClientState.Closed,this.closeStreamingOperations(),d.default.mqtt_request_response_client_close(this.native_handle()))}createStream(e){if(this.state==c.RequestResponseClientState.Closed)throw new s.CrtError(`MQTT request-response client has already been closed`);return p.new(e,this)}submitRequest(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{if(this.state==c.RequestResponseClientState.Closed){r(new s.CrtError(`MQTT request-response client has already been closed`));return}if(!t){r(new s.CrtError(`null request options`));return}function i(t,i,a){return e._s_on_request_completion(n,r,t,i,a)}try{d.default.mqtt_request_response_client_submit_request(this.native_handle(),t,i)}catch(e){r(e)}})})}registerUnclosedStreamingOperation(e){this.unclosedOperations&&this.unclosedOperations.add(e)}unregisterUnclosedStreamingOperation(e){this.unclosedOperations&&this.unclosedOperations.delete(e)}closeStreamingOperations(){if(this.unclosedOperations){let e=this.unclosedOperations;this.unclosedOperations=void 0;for(let t of e)t.close()}}static _s_on_request_completion(e,t,n,r,i){n==0&&r!==void 0&&i!==void 0?e({payload:i,topic:r}):t(new s.CrtError((0,f.error_code_to_string)(n)))}}})),ml=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.CrtError=e.resource_safety=e.promise=e.platform=e.mqtt_request_response=e.mqtt5=e.mqtt=e.iot=e.io=e.http=e.eventstream=e.crt=e.crypto=e.checksums=e.cancel=e.auth=void 0,e.cancel=r(Ic()),e.platform=r(Rc()),e.promise=r(Fc()),e.resource_safety=r(zc()),e.auth=r(Gc()),e.checksums=r(Kc()),e.crt=r(qc()),e.crypto=r(Jc()),e.eventstream=r(Zc()),e.http=r($c()),e.io=r(Wc()),e.iot=r(ll()),e.mqtt=r(ul()),e.mqtt5=r(sl()),e.mqtt_request_response=r(pl());let i=Vc();Object.defineProperty(e,`CrtError`,{enumerable:!0,get:function(){return i.CrtError}})})),hl=u(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isCrtAvailable=void 0,e.isCrtAvailable=()=>{try{return typeof h==`function`&&t!==void 0&&ml()?[`md/crt-avail`]:null}catch{return null}}})),gl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultUserAgent=e.UA_APP_ID_INI_NAME=e.UA_APP_ID_ENV_NAME=void 0;let t=Ws(),n=h(`os`),r=h(`process`),i=hl();e.UA_APP_ID_ENV_NAME=`AWS_SDK_UA_APP_ID`,e.UA_APP_ID_INI_NAME=`sdk-ua-app-id`,e.defaultUserAgent=({serviceId:a,clientVersion:o})=>{let s=[[`aws-sdk-js`,o],[`os/${(0,n.platform)()}`,(0,n.release)()],[`lang/js`],[`md/nodejs`,`${r.versions.node}`]],c=(0,i.isCrtAvailable)();c&&s.push(c),a&&s.push([`api/${a}`,o]),r.env.AWS_EXECUTION_ENV&&s.push([`exec-env/${r.env.AWS_EXECUTION_ENV}`]);let l=(0,t.loadConfig)({environmentVariableSelector:t=>t[e.UA_APP_ID_ENV_NAME],configFileSelector:t=>t[e.UA_APP_ID_INI_NAME],default:void 0})(),u;return async()=>{if(!u){let e=await l;u=e?[...s,[`app/${e}`]]:[...s]}return u}}})),_l=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromBase64=void 0;let t=Xi(),n=/^[A-Za-z0-9+/]*={0,2}$/;e.fromBase64=e=>{if(e.length*3%4!=0)throw TypeError(`Incorrect padding on base64 string.`);if(!n.exec(e))throw TypeError(`Invalid base64 string.`);let r=(0,t.fromString)(e,`base64`);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}})),vl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.toBase64=void 0;let t=Xi();e.toBase64=e=>(0,t.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString(`base64`)})),yl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(_l(),e),t.__exportStar(vl(),e)})),bl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`PartitionResult`,i=`tree`,a=`error`,o=`endpoint`,s={[t]:!1,type:`String`},c={[t]:!0,default:!1,type:`Boolean`},l={ref:`Endpoint`},u={fn:`booleanEquals`,[n]:[{ref:`UseFIPS`},!0]},d={fn:`booleanEquals`,[n]:[{ref:`UseDualStack`},!0]},f={},p={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsFIPS`]}]},m={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsDualStack`]}]},h=[l],g=[u],_=[d];e.ruleSet={version:`1.0`,parameters:{Region:s,UseDualStack:c,UseFIPS:c,Endpoint:s},rules:[{conditions:[{fn:`aws.partition`,[n]:[{ref:`Region`}],assign:r}],type:i,rules:[{conditions:[{fn:`isSet`,[n]:h},{fn:`parseURL`,[n]:h,assign:`url`}],type:i,rules:[{conditions:g,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{type:i,rules:[{conditions:_,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:l,properties:f,headers:f},type:o}]}]},{conditions:[u,d],type:i,rules:[{conditions:[p,m],type:i,rules:[{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}]},{conditions:g,type:i,rules:[{conditions:[p],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}]},{conditions:_,type:i,rules:[{conditions:[m],type:i,rules:[{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}]},{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]}})),xl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=bl();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),Sl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=xl();e.getRuntimeConfig=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`SSO`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Cl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IMDS_REGION_PATH=e.DEFAULTS_MODE_OPTIONS=e.ENV_IMDS_DISABLED=e.AWS_DEFAULT_REGION_ENV=e.AWS_REGION_ENV=e.AWS_EXECUTION_ENV=void 0,e.AWS_EXECUTION_ENV=`AWS_EXECUTION_ENV`,e.AWS_REGION_ENV=`AWS_REGION`,e.AWS_DEFAULT_REGION_ENV=`AWS_DEFAULT_REGION`,e.ENV_IMDS_DISABLED=`AWS_EC2_METADATA_DISABLED`,e.DEFAULTS_MODE_OPTIONS=[`in-region`,`cross-region`,`mobile`,`standard`,`legacy`],e.IMDS_REGION_PATH=`/latest/meta-data/placement/region`})),wl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NODE_DEFAULTS_MODE_CONFIG_OPTIONS=void 0,e.NODE_DEFAULTS_MODE_CONFIG_OPTIONS={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:`legacy`}})),Tl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveDefaultsModeConfig=void 0;let t=Or(),n=ec(),r=Ws(),i=qi(),a=Cl(),o=wl();e.resolveDefaultsModeConfig=({region:e=(0,r.loadConfig)(t.NODE_REGION_CONFIG_OPTIONS),defaultsMode:n=(0,r.loadConfig)(o.NODE_DEFAULTS_MODE_CONFIG_OPTIONS)}={})=>(0,i.memoize)(async()=>{let t=typeof n==`function`?await n():n;switch(t?.toLowerCase()){case`auto`:return s(e);case`in-region`:case`cross-region`:case`mobile`:case`standard`:case`legacy`:return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve(`legacy`);default:throw Error(`Invalid parameter for "defaultsMode", expect ${a.DEFAULTS_MODE_OPTIONS.join(`, `)}, got ${t}`)}});let s=async e=>{if(e){let t=typeof e==`function`?await e():e,n=await c();return n?t===n?`in-region`:`cross-region`:`standard`}return`standard`},c=async()=>{if(process.env[a.AWS_EXECUTION_ENV]&&(process.env[a.AWS_REGION_ENV]||process.env[a.AWS_DEFAULT_REGION_ENV]))return process.env[a.AWS_REGION_ENV]??process.env[a.AWS_DEFAULT_REGION_ENV];if(!process.env[a.ENV_IMDS_DISABLED])try{let e=await(0,n.getInstanceMetadataEndpoint)();return(await(0,n.httpRequest)({...e,path:a.IMDS_REGION_PATH})).toString()}catch{}}})),El=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Tl(),e)})),Dl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(_c()),n=Or(),r=vc(),i=Bi(),a=Ws(),o=Mc(),s=Pc(),c=Wr(),l=gl(),u=Sl(),d=P(),f=El(),p=P();e.getRuntimeConfig=e=>{(0,p.emitWarningIfUnsupportedVersion)(process.version);let m=(0,f.resolveDefaultsModeConfig)(e),h=()=>m().then(d.loadConfigsForDefaultMode),g=(0,u.getRuntimeConfig)(e);return{...g,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??s.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,l.defaultUserAgent)({serviceId:g.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,a.loadConfig)(i.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,a.loadConfig)(n.NODE_REGION_CONFIG_OPTIONS,n.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new o.NodeHttpHandler(h),retryMode:e?.retryMode??(0,a.loadConfig)({...i.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await h()).retryMode||c.DEFAULT_RETRY_MODE}),sha256:e?.sha256??r.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??o.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,a.loadConfig)(n.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,a.loadConfig)(n.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),Ol=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=$o(),l=P(),u=gc(),d=Dl();e.SSOClient=class extends l.Client{constructor(e){let l=(0,d.getRuntimeConfig)(e),f=(0,u.resolveClientEndpointParameters)(l),p=(0,t.resolveRegionConfig)(f),m=(0,r.resolveEndpointConfig)(p),h=(0,s.resolveRetryConfig)(m),g=(0,i.resolveHostHeaderConfig)(h),_=(0,c.resolveUserAgentConfig)(g);super(_),this.config=_,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,c.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),kl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSO=void 0;let t=P(),n=fc(),r=pc(),i=mc(),a=hc(),o=Ol(),s={GetRoleCredentialsCommand:n.GetRoleCredentialsCommand,ListAccountRolesCommand:r.ListAccountRolesCommand,ListAccountsCommand:i.ListAccountsCommand,LogoutCommand:a.LogoutCommand};var c=class extends o.SSOClient{};e.SSO=c,(0,t.createAggregatedClient)(s,c)})),Al=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(fc(),e),t.__exportStar(pc(),e),t.__exportStar(mc(),e),t.__exportStar(hc(),e)})),jl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(uc(),e)})),Ml=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Nl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListAccountRoles=void 0;let t=pc(),n=Ol(),r=async(e,n,...r)=>await e.send(new t.ListAccountRolesCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.nextToken=a,t.maxResults=e.pageSize,e.client instanceof n.SSOClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SSO | SSOClient`);yield s;let c=a;a=s.nextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListAccountRoles=i})),Pl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListAccounts=void 0;let t=mc(),n=Ol(),r=async(e,n,...r)=>await e.send(new t.ListAccountsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.nextToken=a,t.maxResults=e.pageSize,e.client instanceof n.SSOClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SSO | SSOClient`);yield s;let c=a;a=s.nextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListAccounts=i})),Fl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Ml(),e),t.__exportStar(Nl(),e),t.__exportStar(Pl(),e)})),Il=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOServiceException=void 0;let t=(N(),m(j));t.__exportStar(kl(),e),t.__exportStar(Ol(),e),t.__exportStar(Al(),e),t.__exportStar(jl(),e),t.__exportStar(Fl(),e);var n=lc();Object.defineProperty(e,`SSOServiceException`,{enumerable:!0,get:function(){return n.SSOServiceException}})})),Ll=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.REFRESH_MESSAGE=e.EXPIRE_WINDOW_MS=void 0,e.EXPIRE_WINDOW_MS=300*1e3,e.REFRESH_MESSAGE=`To refresh this SSO session run 'aws sso login' with the corresponding profile.`})),Rl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDCServiceException=void 0;let t=P();e.SSOOIDCServiceException=class e extends t.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),zl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidClientMetadataException=e.UnsupportedGrantTypeException=e.UnauthorizedClientException=e.SlowDownException=e.InvalidScopeException=e.InvalidRequestException=e.InvalidGrantException=e.InvalidClientException=e.InternalServerException=e.ExpiredTokenException=e.AuthorizationPendingException=e.AccessDeniedException=void 0;let t=Rl();e.AccessDeniedException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),this.name=`AccessDeniedException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.AuthorizationPendingException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`AuthorizationPendingException`,$fault:`client`,...t}),this.name=`AuthorizationPendingException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.ExpiredTokenException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),this.name=`ExpiredTokenException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InternalServerException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),this.name=`InternalServerException`,this.$fault=`server`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidClientException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidClientException`,$fault:`client`,...t}),this.name=`InvalidClientException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidGrantException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidGrantException`,$fault:`client`,...t}),this.name=`InvalidGrantException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidRequestException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),this.name=`InvalidRequestException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidScopeException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidScopeException`,$fault:`client`,...t}),this.name=`InvalidScopeException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.SlowDownException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`SlowDownException`,$fault:`client`,...t}),this.name=`SlowDownException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.UnauthorizedClientException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`UnauthorizedClientException`,$fault:`client`,...t}),this.name=`UnauthorizedClientException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.UnsupportedGrantTypeException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`UnsupportedGrantTypeException`,$fault:`client`,...t}),this.name=`UnsupportedGrantTypeException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidClientMetadataException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidClientMetadataException`,$fault:`client`,...t}),this.name=`InvalidClientMetadataException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}}})),Bl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.de_StartDeviceAuthorizationCommand=e.de_RegisterClientCommand=e.de_CreateTokenCommand=e.se_StartDeviceAuthorizationCommand=e.se_RegisterClientCommand=e.se_CreateTokenCommand=void 0;let t=gn(),n=P(),r=zl(),i=Rl();e.se_CreateTokenCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c={"content-type":`application/json`},l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/token`,u;return u=JSON.stringify((0,n.take)(e,{clientId:[],clientSecret:[],code:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,n._json)(e)})),new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:u})},e.se_RegisterClientCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c={"content-type":`application/json`},l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/client/register`,u;return u=JSON.stringify((0,n.take)(e,{clientName:[],clientType:[],scopes:e=>(0,n._json)(e)})),new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:u})},e.se_StartDeviceAuthorizationCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c={"content-type":`application/json`},l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/device_authorization`,u;return u=JSON.stringify((0,n.take)(e,{clientId:[],clientSecret:[],startUrl:[]})),new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:u})},e.de_CreateTokenCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return a(e,t);let r=(0,n.map)({$metadata:x(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await w(e.body,t)),`body`),o=(0,n.take)(i,{accessToken:n.expectString,expiresIn:n.expectInt32,idToken:n.expectString,refreshToken:n.expectString,tokenType:n.expectString});return Object.assign(r,o),r};let a=async(e,t)=>{let n={...e,body:await ee(e.body,t)},r=te(e,n.body);switch(r){case`AccessDeniedException`:case`com.amazonaws.ssooidc#AccessDeniedException`:throw await l(n,t);case`AuthorizationPendingException`:case`com.amazonaws.ssooidc#AuthorizationPendingException`:throw await u(n,t);case`ExpiredTokenException`:case`com.amazonaws.ssooidc#ExpiredTokenException`:throw await d(n,t);case`InternalServerException`:case`com.amazonaws.ssooidc#InternalServerException`:throw await f(n,t);case`InvalidClientException`:case`com.amazonaws.ssooidc#InvalidClientException`:throw await p(n,t);case`InvalidGrantException`:case`com.amazonaws.ssooidc#InvalidGrantException`:throw await h(n,t);case`InvalidRequestException`:case`com.amazonaws.ssooidc#InvalidRequestException`:throw await g(n,t);case`InvalidScopeException`:case`com.amazonaws.ssooidc#InvalidScopeException`:throw await _(n,t);case`SlowDownException`:case`com.amazonaws.ssooidc#SlowDownException`:throw await v(n,t);case`UnauthorizedClientException`:case`com.amazonaws.ssooidc#UnauthorizedClientException`:throw await y(n,t);case`UnsupportedGrantTypeException`:case`com.amazonaws.ssooidc#UnsupportedGrantTypeException`:throw await b(n,t);default:let i=n.body;return c({output:e,parsedBody:i,errorCode:r})}};e.de_RegisterClientCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return o(e,t);let r=(0,n.map)({$metadata:x(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await w(e.body,t)),`body`),a=(0,n.take)(i,{authorizationEndpoint:n.expectString,clientId:n.expectString,clientIdIssuedAt:n.expectLong,clientSecret:n.expectString,clientSecretExpiresAt:n.expectLong,tokenEndpoint:n.expectString});return Object.assign(r,a),r};let o=async(e,t)=>{let n={...e,body:await ee(e.body,t)},r=te(e,n.body);switch(r){case`InternalServerException`:case`com.amazonaws.ssooidc#InternalServerException`:throw await f(n,t);case`InvalidClientMetadataException`:case`com.amazonaws.ssooidc#InvalidClientMetadataException`:throw await m(n,t);case`InvalidRequestException`:case`com.amazonaws.ssooidc#InvalidRequestException`:throw await g(n,t);case`InvalidScopeException`:case`com.amazonaws.ssooidc#InvalidScopeException`:throw await _(n,t);default:let i=n.body;return c({output:e,parsedBody:i,errorCode:r})}};e.de_StartDeviceAuthorizationCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return s(e,t);let r=(0,n.map)({$metadata:x(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await w(e.body,t)),`body`),a=(0,n.take)(i,{deviceCode:n.expectString,expiresIn:n.expectInt32,interval:n.expectInt32,userCode:n.expectString,verificationUri:n.expectString,verificationUriComplete:n.expectString});return Object.assign(r,a),r};let s=async(e,t)=>{let n={...e,body:await ee(e.body,t)},r=te(e,n.body);switch(r){case`InternalServerException`:case`com.amazonaws.ssooidc#InternalServerException`:throw await f(n,t);case`InvalidClientException`:case`com.amazonaws.ssooidc#InvalidClientException`:throw await p(n,t);case`InvalidRequestException`:case`com.amazonaws.ssooidc#InvalidRequestException`:throw await g(n,t);case`SlowDownException`:case`com.amazonaws.ssooidc#SlowDownException`:throw await v(n,t);case`UnauthorizedClientException`:case`com.amazonaws.ssooidc#UnauthorizedClientException`:throw await y(n,t);default:let i=n.body;return c({output:e,parsedBody:i,errorCode:r})}},c=(0,n.withBaseException)(i.SSOOIDCServiceException),l=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.AccessDeniedException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},u=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.AuthorizationPendingException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},d=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.ExpiredTokenException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},f=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InternalServerException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},p=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidClientException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},m=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidClientMetadataException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},h=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidGrantException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},g=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidRequestException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},_=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidScopeException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},v=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.SlowDownException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},y=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.UnauthorizedClientException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},b=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.UnsupportedGrantTypeException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},x=e=>({httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}),S=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),C=(e,t)=>S(e,t).then(e=>t.utf8Encoder(e)),w=(e,t)=>C(e,t).then(e=>e.length?JSON.parse(e):{}),ee=async(e,t)=>{let n=await w(e,t);return n.message=n.message??n.Message,n},te=(e,t)=>{let n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t},i=n(e.headers,`x-amzn-errortype`);if(i!==void 0)return r(e.headers[i]);if(t.code!==void 0)return r(t.code);if(t.__type!==void 0)return r(t.__type)}})),Vl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CreateTokenCommand=void 0;let t=L(),n=F(),r=P(),i=Bl();e.CreateTokenCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`SSOOIDCClient`,commandName:`CreateTokenCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_CreateTokenCommand)(e,t)}deserialize(e,t){return(0,i.de_CreateTokenCommand)(e,t)}}})),Hl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RegisterClientCommand=void 0;let t=L(),n=F(),r=P(),i=Bl();e.RegisterClientCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`SSOOIDCClient`,commandName:`RegisterClientCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_RegisterClientCommand)(e,t)}deserialize(e,t){return(0,i.de_RegisterClientCommand)(e,t)}}})),Ul=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.StartDeviceAuthorizationCommand=void 0;let t=L(),n=F(),r=P(),i=Bl();e.StartDeviceAuthorizationCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`SSOOIDCClient`,commandName:`StartDeviceAuthorizationCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_StartDeviceAuthorizationCommand)(e,t)}deserialize(e,t){return(0,i.de_StartDeviceAuthorizationCommand)(e,t)}}})),Wl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveClientEndpointParameters=void 0,e.resolveClientEndpointParameters=e=>({...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`awsssooidc`})})),Gl=u(((e,t)=>{t.exports={name:`@aws-sdk/client-sso-oidc`,description:`AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native`,version:`3.329.0`,scripts:{build:`concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'`,"build:cjs":`tsc -p tsconfig.cjs.json`,"build:docs":`typedoc`,"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 sso-oidc`},main:`./dist-cjs/index.js`,types:`./dist-types/index.d.ts`,module:`./dist-es/index.js`,sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":`3.0.0`,"@aws-crypto/sha256-js":`3.0.0`,"@aws-sdk/config-resolver":`3.329.0`,"@aws-sdk/fetch-http-handler":`3.329.0`,"@aws-sdk/hash-node":`3.329.0`,"@aws-sdk/invalid-dependency":`3.329.0`,"@aws-sdk/middleware-content-length":`3.329.0`,"@aws-sdk/middleware-endpoint":`3.329.0`,"@aws-sdk/middleware-host-header":`3.329.0`,"@aws-sdk/middleware-logger":`3.329.0`,"@aws-sdk/middleware-recursion-detection":`3.329.0`,"@aws-sdk/middleware-retry":`3.329.0`,"@aws-sdk/middleware-serde":`3.329.0`,"@aws-sdk/middleware-stack":`3.329.0`,"@aws-sdk/middleware-user-agent":`3.329.0`,"@aws-sdk/node-config-provider":`3.329.0`,"@aws-sdk/node-http-handler":`3.329.0`,"@aws-sdk/protocol-http":`3.329.0`,"@aws-sdk/smithy-client":`3.329.0`,"@aws-sdk/types":`3.329.0`,"@aws-sdk/url-parser":`3.329.0`,"@aws-sdk/util-base64":`3.310.0`,"@aws-sdk/util-body-length-browser":`3.310.0`,"@aws-sdk/util-body-length-node":`3.310.0`,"@aws-sdk/util-defaults-mode-browser":`3.329.0`,"@aws-sdk/util-defaults-mode-node":`3.329.0`,"@aws-sdk/util-endpoints":`3.329.0`,"@aws-sdk/util-retry":`3.329.0`,"@aws-sdk/util-user-agent-browser":`3.329.0`,"@aws-sdk/util-user-agent-node":`3.329.0`,"@aws-sdk/util-utf8":`3.310.0`,tslib:`^2.5.0`},devDependencies:{"@aws-sdk/service-client-documentation-generator":`3.310.0`,"@tsconfig/node14":`1.0.3`,"@types/node":`^14.14.31`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,rimraf:`3.0.2`,typedoc:`0.23.23`,typescript:`~4.9.5`},engines:{node:`>=14.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-sso-oidc`,repository:{type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-sso-oidc`}}})),Kl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`PartitionResult`,i=`tree`,a=`error`,o=`endpoint`,s={[t]:!1,type:`String`},c={[t]:!0,default:!1,type:`Boolean`},l={ref:`Endpoint`},u={fn:`booleanEquals`,[n]:[{ref:`UseFIPS`},!0]},d={fn:`booleanEquals`,[n]:[{ref:`UseDualStack`},!0]},f={},p={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsFIPS`]}]},m={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsDualStack`]}]},h=[l],g=[u],_=[d];e.ruleSet={version:`1.0`,parameters:{Region:s,UseDualStack:c,UseFIPS:c,Endpoint:s},rules:[{conditions:[{fn:`aws.partition`,[n]:[{ref:`Region`}],assign:r}],type:i,rules:[{conditions:[{fn:`isSet`,[n]:h},{fn:`parseURL`,[n]:h,assign:`url`}],type:i,rules:[{conditions:g,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{type:i,rules:[{conditions:_,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:l,properties:f,headers:f},type:o}]}]},{conditions:[u,d],type:i,rules:[{conditions:[p,m],type:i,rules:[{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}]},{conditions:g,type:i,rules:[{conditions:[p],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}]},{conditions:_,type:i,rules:[{conditions:[m],type:i,rules:[{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}]},{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]}})),ql=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=Kl();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),Jl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=ql();e.getRuntimeConfig=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`SSO OIDC`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Yl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(Gl()),n=Or(),r=vc(),i=Bi(),a=Ws(),o=Mc(),s=Pc(),c=Wr(),l=gl(),u=Jl(),d=P(),f=El(),p=P();e.getRuntimeConfig=e=>{(0,p.emitWarningIfUnsupportedVersion)(process.version);let m=(0,f.resolveDefaultsModeConfig)(e),h=()=>m().then(d.loadConfigsForDefaultMode),g=(0,u.getRuntimeConfig)(e);return{...g,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??s.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,l.defaultUserAgent)({serviceId:g.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,a.loadConfig)(i.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,a.loadConfig)(n.NODE_REGION_CONFIG_OPTIONS,n.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new o.NodeHttpHandler(h),retryMode:e?.retryMode??(0,a.loadConfig)({...i.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await h()).retryMode||c.DEFAULT_RETRY_MODE}),sha256:e?.sha256??r.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??o.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,a.loadConfig)(n.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,a.loadConfig)(n.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),Xl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDCClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=$o(),l=P(),u=Wl(),d=Yl();e.SSOOIDCClient=class extends l.Client{constructor(e){let l=(0,d.getRuntimeConfig)(e),f=(0,u.resolveClientEndpointParameters)(l),p=(0,t.resolveRegionConfig)(f),m=(0,r.resolveEndpointConfig)(p),h=(0,s.resolveRetryConfig)(m),g=(0,i.resolveHostHeaderConfig)(h),_=(0,c.resolveUserAgentConfig)(g);super(_),this.config=_,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,c.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),Zl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDC=void 0;let t=P(),n=Vl(),r=Hl(),i=Ul(),a=Xl(),o={CreateTokenCommand:n.CreateTokenCommand,RegisterClientCommand:r.RegisterClientCommand,StartDeviceAuthorizationCommand:i.StartDeviceAuthorizationCommand};var s=class extends a.SSOOIDCClient{};e.SSOOIDC=s,(0,t.createAggregatedClient)(o,s)})),Ql=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Vl(),e),t.__exportStar(Hl(),e),t.__exportStar(Ul(),e)})),$l=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(zl(),e)})),eu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDCServiceException=void 0;let t=(N(),m(j));t.__exportStar(Zl(),e),t.__exportStar(Xl(),e),t.__exportStar(Ql(),e),t.__exportStar($l(),e);var n=Rl();Object.defineProperty(e,`SSOOIDCServiceException`,{enumerable:!0,get:function(){return n.SSOOIDCServiceException}})})),tu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSsoOidcClient=void 0;let t=eu(),n={};e.getSsoOidcClient=e=>{if(n[e])return n[e];let r=new t.SSOOIDCClient({region:e});return n[e]=r,r}})),nu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getNewSsoOidcToken=void 0;let t=eu(),n=tu();e.getNewSsoOidcToken=(e,r)=>(0,n.getSsoOidcClient)(r).send(new t.CreateTokenCommand({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:`refresh_token`}))})),ru=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTokenExpiry=void 0;let t=qi(),n=Ll();e.validateTokenExpiry=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new t.TokenProviderError(`Token is expired. ${n.REFRESH_MESSAGE}`,!1)}})),iu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTokenKey=void 0;let t=qi(),n=Ll();e.validateTokenKey=(e,r,i=!1)=>{if(r===void 0)throw new t.TokenProviderError(`Value not present for '${e}' in SSO Token${i?`. Cannot refresh`:``}. ${n.REFRESH_MESSAGE}`,!1)}})),au=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.writeSSOTokenToFile=void 0;let t=Ps(),{writeFile:n}=h(`fs`).promises;e.writeSSOTokenToFile=(e,r)=>n((0,t.getSSOTokenFilepath)(e),JSON.stringify(r,null,2))})),ou=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromSso=void 0;let t=qi(),n=Ps(),r=Ll(),i=nu(),a=ru(),o=iu(),s=au(),c=new Date(0);e.fromSso=(e={})=>async()=>{let l=await(0,n.parseKnownFiles)(e),u=(0,n.getProfileName)(e),d=l[u];if(!d)throw new t.TokenProviderError(`Profile '${u}' could not be found in shared credentials file.`,!1);if(!d.sso_session)throw new t.TokenProviderError(`Profile '${u}' is missing required property 'sso_session'.`);let f=d.sso_session,p=(await(0,n.loadSsoSessionData)(e))[f];if(!p)throw new t.TokenProviderError(`Sso session '${f}' could not be found in shared credentials file.`,!1);for(let e of[`sso_start_url`,`sso_region`])if(!p[e])throw new t.TokenProviderError(`Sso session '${f}' is missing required property '${e}'.`,!1);p.sso_start_url;let m=p.sso_region,h;try{h=await(0,n.getSSOTokenFromFile)(f)}catch{throw new t.TokenProviderError(`The SSO session token associated with profile=${u} was not found or is invalid. ${r.REFRESH_MESSAGE}`,!1)}(0,o.validateTokenKey)(`accessToken`,h.accessToken),(0,o.validateTokenKey)(`expiresAt`,h.expiresAt);let{accessToken:g,expiresAt:_}=h,v={token:g,expiration:new Date(_)};if(v.expiration.getTime()-Date.now()>r.EXPIRE_WINDOW_MS)return v;if(Date.now()-c.getTime()<30*1e3)return(0,a.validateTokenExpiry)(v),v;(0,o.validateTokenKey)(`clientId`,h.clientId,!0),(0,o.validateTokenKey)(`clientSecret`,h.clientSecret,!0),(0,o.validateTokenKey)(`refreshToken`,h.refreshToken,!0);try{c.setTime(Date.now());let e=await(0,i.getNewSsoOidcToken)(h,m);(0,o.validateTokenKey)(`accessToken`,e.accessToken),(0,o.validateTokenKey)(`expiresIn`,e.expiresIn);let t=new Date(Date.now()+e.expiresIn*1e3);try{await(0,s.writeSSOTokenToFile)(f,{...h,accessToken:e.accessToken,expiresAt:t.toISOString(),refreshToken:e.refreshToken})}catch{}return{token:e.accessToken,expiration:t}}catch{return(0,a.validateTokenExpiry)(v),v}}})),su=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromStatic=void 0;let t=qi();e.fromStatic=({token:e})=>async()=>{if(!e||!e.token)throw new t.TokenProviderError(`Please pass a valid token to fromStatic`,!1);return e}})),cu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.nodeProvider=void 0;let t=qi(),n=ou();e.nodeProvider=(e={})=>(0,t.memoize)((0,t.chain)((0,n.fromSso)(e),async()=>{throw new t.TokenProviderError(`Could not load token from any providers`,!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0)})),lu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(ou(),e),t.__exportStar(su(),e),t.__exportStar(cu(),e)})),uu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSSOCredentials=void 0;let t=Il(),n=qi(),r=Ps(),i=lu();e.resolveSSOCredentials=async({ssoStartUrl:e,ssoSession:a,ssoAccountId:o,ssoRegion:s,ssoRoleName:c,ssoClient:l,profile:u})=>{let d,f=`To refresh this SSO session run aws sso login with the corresponding profile.`;if(a)try{let e=await(0,i.fromSso)({profile:u})();d={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new n.CredentialsProviderError(e.message,!1)}else try{d=await(0,r.getSSOTokenFromFile)(e)}catch{throw new n.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${f}`,!1)}if(new Date(d.expiresAt).getTime()-Date.now()<=9e5)throw new n.CredentialsProviderError(`The SSO session associated with this profile has expired. ${f}`,!1);let{accessToken:p}=d,m=l||new t.SSOClient({region:s}),h;try{h=await m.send(new t.GetRoleCredentialsCommand({accountId:o,roleName:c,accessToken:p}))}catch(e){throw n.CredentialsProviderError.from(e,!1)}let{roleCredentials:{accessKeyId:g,secretAccessKey:_,sessionToken:v,expiration:y}={}}=h;if(!g||!_||!v||!y)throw new n.CredentialsProviderError(`SSO returns an invalid temporary credential.`,!1);return{accessKeyId:g,secretAccessKey:_,sessionToken:v,expiration:new Date(y)}}})),du=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSsoProfile=void 0;let t=qi();e.validateSsoProfile=e=>{let{sso_start_url:n,sso_account_id:r,sso_region:i,sso_role_name:a}=e;if(!n||!r||!i||!a)throw new t.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(`, `)}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,!1);return e}})),fu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromSSO=void 0;let t=qi(),n=Ps(),r=cc(),i=uu(),a=du();e.fromSSO=(e={})=>async()=>{let{ssoStartUrl:o,ssoAccountId:s,ssoRegion:c,ssoRoleName:l,ssoClient:u,ssoSession:d}=e,f=(0,n.getProfileName)(e);if(!o&&!s&&!c&&!l&&!d){let s=(await(0,n.parseKnownFiles)(e))[f];if(!s)throw new t.CredentialsProviderError(`Profile ${f} was not found.`);if(!(0,r.isSsoProfile)(s))throw new t.CredentialsProviderError(`Profile ${f} is not configured with SSO credentials.`);if(s?.sso_session){let r=(await(0,n.loadSsoSessionData)(e))[s.sso_session],i=` configurations in profile ${f} and sso-session ${s.sso_session}`;if(c&&c!==r.sso_region)throw new t.CredentialsProviderError(`Conflicting SSO region`+i,!1);if(o&&o!==r.sso_start_url)throw new t.CredentialsProviderError(`Conflicting SSO start_url`+i,!1);s.sso_region=r.sso_region,s.sso_start_url=r.sso_start_url}let{sso_start_url:l,sso_account_id:d,sso_region:p,sso_role_name:m,sso_session:h}=(0,a.validateSsoProfile)(s);return(0,i.resolveSSOCredentials)({ssoStartUrl:l,ssoSession:h,ssoAccountId:d,ssoRegion:p,ssoRoleName:m,ssoClient:u,profile:f})}else if(!o||!s||!c||!l)throw new t.CredentialsProviderError(`Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"`);else return(0,i.resolveSSOCredentials)({ssoStartUrl:o,ssoSession:d,ssoAccountId:s,ssoRegion:c,ssoRoleName:l,ssoClient:u,profile:f})}})),pu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),mu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(fu(),e),t.__exportStar(cc(),e),t.__exportStar(pu(),e),t.__exportStar(du(),e)})),hu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSsoCredentials=e.isSsoProfile=void 0;let t=mu();var n=mu();Object.defineProperty(e,`isSsoProfile`,{enumerable:!0,get:function(){return n.isSsoProfile}}),e.resolveSsoCredentials=e=>{let{sso_start_url:n,sso_account_id:r,sso_session:i,sso_region:a,sso_role_name:o}=(0,t.validateSsoProfile)(e);return(0,t.fromSSO)({ssoStartUrl:n,ssoAccountId:r,ssoSession:i,ssoRegion:a,ssoRoleName:o})()}})),gu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveStaticCredentials=e.isStaticCredsProfile=void 0,e.isStaticCredsProfile=e=>!!e&&typeof e==`object`&&typeof e.aws_access_key_id==`string`&&typeof e.aws_secret_access_key==`string`&&[`undefined`,`string`].indexOf(typeof e.aws_session_token)>-1,e.resolveStaticCredentials=e=>Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token})})),_u=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromWebToken=void 0;let t=qi();e.fromWebToken=e=>()=>{let{roleArn:n,roleSessionName:r,webIdentityToken:i,providerId:a,policyArns:o,policy:s,durationSeconds:c,roleAssumerWithWebIdentity:l}=e;if(!l)throw new t.CredentialsProviderError(`Role Arn '${n}' needs to be assumed with web identity, but no role assumption callback was provided.`,!1);return l({RoleArn:n,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:a,PolicyArns:o,Policy:s,DurationSeconds:c})}})),vu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromTokenFile=void 0;let t=qi(),n=h(`fs`),r=_u();e.fromTokenFile=(e={})=>async()=>i(e);let i=e=>{let i=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,a=e?.roleArn??process.env.AWS_ROLE_ARN,o=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!i||!a)throw new t.CredentialsProviderError(`Web identity configuration not specified`);return(0,r.fromWebToken)({...e,webIdentityToken:(0,n.readFileSync)(i,{encoding:`ascii`}),roleArn:a,roleSessionName:o})()}})),yu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(vu(),e),t.__exportStar(_u(),e)})),bu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveWebIdentityCredentials=e.isWebIdentityProfile=void 0;let t=yu();e.isWebIdentityProfile=e=>!!e&&typeof e==`object`&&typeof e.web_identity_token_file==`string`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1,e.resolveWebIdentityCredentials=async(e,n)=>(0,t.fromTokenFile)({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:n.roleAssumerWithWebIdentity})()})),xu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveProfileData=void 0;let t=qi(),n=nc(),r=sc(),i=hu(),a=gu(),o=bu();e.resolveProfileData=async(e,s,c,l={})=>{let u=s[e];if(Object.keys(l).length>0&&(0,a.isStaticCredsProfile)(u))return(0,a.resolveStaticCredentials)(u);if((0,n.isAssumeRoleProfile)(u))return(0,n.resolveAssumeRoleCredentials)(e,s,c,l);if((0,a.isStaticCredsProfile)(u))return(0,a.resolveStaticCredentials)(u);if((0,o.isWebIdentityProfile)(u))return(0,o.resolveWebIdentityCredentials)(u,c);if((0,r.isProcessProfile)(u))return(0,r.resolveProcessCredentials)(c,e);if((0,i.isSsoProfile)(u))return(0,i.resolveSsoCredentials)(u);throw new t.CredentialsProviderError(`Profile ${e} could not be found or parsed in shared credentials file.`)}})),Su=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromIni=void 0;let t=Ps(),n=xu();e.fromIni=(e={})=>async()=>{let r=await(0,t.parseKnownFiles)(e);return(0,n.resolveProfileData)((0,t.getProfileName)(e),r,e)}})),Cu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Su(),e)})),wu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.remoteProvider=e.ENV_IMDS_DISABLED=void 0;let t=ec(),n=qi();e.ENV_IMDS_DISABLED=`AWS_EC2_METADATA_DISABLED`,e.remoteProvider=r=>process.env[t.ENV_CMDS_RELATIVE_URI]||process.env[t.ENV_CMDS_FULL_URI]?(0,t.fromContainerMetadata)(r):process.env[e.ENV_IMDS_DISABLED]?async()=>{throw new n.CredentialsProviderError(`EC2 Instance Metadata Service access disabled`)}:(0,t.fromInstanceMetadata)(r)})),Tu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultProvider=void 0;let t=vs(),n=Cu(),r=oc(),i=mu(),a=yu(),o=qi(),s=Ps(),c=wu();e.defaultProvider=(e={})=>(0,o.memoize)((0,o.chain)(...e.profile||process.env[s.ENV_PROFILE]?[]:[(0,t.fromEnv)()],(0,i.fromSSO)(e),(0,n.fromIni)(e),(0,r.fromProcess)(e),(0,a.fromTokenFile)(e),(0,c.remoteProvider)(e),async()=>{throw new o.CredentialsProviderError(`Could not load credentials from any providers`,!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0)})),Eu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Tu(),e)})),Du=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`type`,r=`argv`,i=`booleanEquals`,a=`tree`,o=`stringEquals`,s=`sigv4`,c=`us-east-1`,l=`endpoint`,u=`https://sts.{Region}.{PartitionResult#dnsSuffix}`,d=`error`,f=`getAttr`,p={[t]:!1,[n]:`String`},m={[t]:!0,default:!1,[n]:`Boolean`},h={ref:`Endpoint`},g={fn:`isSet`,[r]:[{ref:`Region`}]},_={ref:`Region`},v={fn:`aws.partition`,[r]:[_],assign:`PartitionResult`},y={ref:`UseFIPS`},b={ref:`UseDualStack`},x={url:`https://sts.amazonaws.com`,properties:{authSchemes:[{name:s,signingName:`sts`,signingRegion:c}]},headers:{}},S={},C={conditions:[{fn:o,[r]:[_,`aws-global`]}],[l]:x,[n]:l},w={fn:i,[r]:[y,!0]},ee={fn:i,[r]:[b,!0]},te={fn:i,[r]:[!0,{fn:f,[r]:[{ref:`PartitionResult`},`supportsFIPS`]}]},T={ref:`PartitionResult`},E={fn:i,[r]:[!0,{fn:f,[r]:[T,`supportsDualStack`]}]},ne=[{fn:`isSet`,[r]:[h]}],re=[w],ie=[ee];e.ruleSet={version:`1.0`,parameters:{Region:p,UseDualStack:m,UseFIPS:m,Endpoint:p,UseGlobalEndpoint:m},rules:[{conditions:[{fn:i,[r]:[{ref:`UseGlobalEndpoint`},!0]},{fn:`not`,[r]:ne},g,v,{fn:i,[r]:[y,!1]},{fn:i,[r]:[b,!1]}],[n]:a,rules:[{conditions:[{fn:o,[r]:[_,`ap-northeast-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`ap-south-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`ap-southeast-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`ap-southeast-2`]}],endpoint:x,[n]:l},C,{conditions:[{fn:o,[r]:[_,`ca-central-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-central-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-north-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-west-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-west-2`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-west-3`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`sa-east-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,c]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`us-east-2`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`us-west-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`us-west-2`]}],endpoint:x,[n]:l},{endpoint:{url:u,properties:{authSchemes:[{name:s,signingName:`sts`,signingRegion:`{Region}`}]},headers:S},[n]:l}]},{conditions:ne,[n]:a,rules:[{conditions:re,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,[n]:d},{[n]:a,rules:[{conditions:ie,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,[n]:d},{endpoint:{url:h,properties:S,headers:S},[n]:l}]}]},{[n]:a,rules:[{conditions:[g],[n]:a,rules:[{conditions:[v],[n]:a,rules:[{conditions:[w,ee],[n]:a,rules:[{conditions:[te,E],[n]:a,rules:[{[n]:a,rules:[{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:S,headers:S},[n]:l}]}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,[n]:d}]},{conditions:re,[n]:a,rules:[{conditions:[te],[n]:a,rules:[{[n]:a,rules:[{conditions:[{fn:o,[r]:[`aws-us-gov`,{fn:f,[r]:[T,`name`]}]}],endpoint:{url:`https://sts.{Region}.amazonaws.com`,properties:S,headers:S},[n]:l},{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:S,headers:S},[n]:l}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,[n]:d}]},{conditions:ie,[n]:a,rules:[{conditions:[E],[n]:a,rules:[{[n]:a,rules:[{endpoint:{url:`https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:S,headers:S},[n]:l}]}]},{error:`DualStack is enabled but this partition does not support DualStack`,[n]:d}]},{[n]:a,rules:[C,{endpoint:{url:u,properties:S,headers:S},[n]:l}]}]}]},{error:`Invalid Configuration: Missing Region`,[n]:d}]}]}})),Ou=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=Du();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),ku=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=Ou();e.getRuntimeConfig=e=>({apiVersion:`2011-06-15`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`STS`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Au=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(hs()),n=gs(),r=Or(),i=Eu(),a=vc(),o=Bi(),s=Ws(),c=Mc(),l=Pc(),u=Wr(),d=gl(),f=ku(),p=P(),h=El(),g=P();e.getRuntimeConfig=e=>{(0,g.emitWarningIfUnsupportedVersion)(process.version);let m=(0,h.resolveDefaultsModeConfig)(e),_=()=>m().then(p.loadConfigsForDefaultMode),v=(0,f.getRuntimeConfig)(e);return{...v,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??l.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??(0,n.decorateDefaultCredentialProvider)(i.defaultProvider),defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,d.defaultUserAgent)({serviceId:v.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,s.loadConfig)(o.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,s.loadConfig)(r.NODE_REGION_CONFIG_OPTIONS,r.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new c.NodeHttpHandler(_),retryMode:e?.retryMode??(0,s.loadConfig)({...o.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await _()).retryMode||u.DEFAULT_RETRY_MODE}),sha256:e?.sha256??a.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??c.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,s.loadConfig)(r.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,s.loadConfig)(r.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),ju=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.STSClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=ps(),l=$o(),u=P(),d=ms(),f=Au();e.STSClient=class e extends u.Client{constructor(u){let p=(0,f.getRuntimeConfig)(u),m=(0,d.resolveClientEndpointParameters)(p),h=(0,t.resolveRegionConfig)(m),g=(0,r.resolveEndpointConfig)(h),_=(0,s.resolveRetryConfig)(g),v=(0,i.resolveHostHeaderConfig)(_),y=(0,c.resolveStsAuthConfig)(v,{stsClientCtor:e}),b=(0,l.resolveUserAgentConfig)(y);super(b),this.config=b,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,l.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),Mu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.STS=void 0;let t=P(),n=as(),r=os(),i=ss(),a=cs(),o=ls(),s=us(),c=ds(),l=fs(),u=ju(),d={AssumeRoleCommand:n.AssumeRoleCommand,AssumeRoleWithSAMLCommand:r.AssumeRoleWithSAMLCommand,AssumeRoleWithWebIdentityCommand:i.AssumeRoleWithWebIdentityCommand,DecodeAuthorizationMessageCommand:a.DecodeAuthorizationMessageCommand,GetAccessKeyInfoCommand:o.GetAccessKeyInfoCommand,GetCallerIdentityCommand:s.GetCallerIdentityCommand,GetFederationTokenCommand:c.GetFederationTokenCommand,GetSessionTokenCommand:l.GetSessionTokenCommand};var f=class extends u.STSClient{};e.STS=f,(0,t.createAggregatedClient)(d,f)})),Nu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(as(),e),t.__exportStar(os(),e),t.__exportStar(ss(),e),t.__exportStar(cs(),e),t.__exportStar(ls(),e),t.__exportStar(us(),e),t.__exportStar(ds(),e),t.__exportStar(fs(),e)})),Pu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.decorateDefaultCredentialProvider=e.getDefaultRoleAssumerWithWebIdentity=e.getDefaultRoleAssumer=void 0;let t=gs(),n=ju(),r=(e,t)=>t?class extends e{constructor(e){super(e);for(let e of t)this.middlewareStack.use(e)}}:e;e.getDefaultRoleAssumer=(e={},i)=>(0,t.getDefaultRoleAssumer)(e,r(n.STSClient,i)),e.getDefaultRoleAssumerWithWebIdentity=(e={},i)=>(0,t.getDefaultRoleAssumerWithWebIdentity)(e,r(n.STSClient,i)),e.decorateDefaultCredentialProvider=t=>n=>t({roleAssumer:(0,e.getDefaultRoleAssumer)(n),roleAssumerWithWebIdentity:(0,e.getDefaultRoleAssumerWithWebIdentity)(n),...n})})),Fu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(rs(),e)})),Iu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.STSServiceException=void 0;let t=(N(),m(j));t.__exportStar(Mu(),e),t.__exportStar(ju(),e),t.__exportStar(Nu(),e),t.__exportStar(Pu(),e),t.__exportStar(Fu(),e);var n=ns();Object.defineProperty(e,`STSServiceException`,{enumerable:!0,get:function(){return n.STSServiceException}})})),Lu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`isSet`,i=`tree`,a=`error`,o=`endpoint`,s=`PartitionResult`,c=`stringEquals`,l={[t]:!1,type:`String`},u={[t]:!0,default:!1,type:`Boolean`},d={ref:`Endpoint`},f={fn:`booleanEquals`,[n]:[{ref:`UseFIPS`},!0]},p={fn:`booleanEquals`,[n]:[{ref:`UseDualStack`},!0]},m={},h={ref:`Region`},g={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:s},`supportsFIPS`]}]},_={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:s},`supportsDualStack`]}]},v=[f],y=[p],b=[h];e.ruleSet={version:`1.0`,parameters:{Region:l,UseDualStack:u,UseFIPS:u,Endpoint:l},rules:[{conditions:[{fn:r,[n]:[d]}],type:i,rules:[{conditions:v,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{type:i,rules:[{conditions:y,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:d,properties:m,headers:m},type:o}]}]},{type:i,rules:[{conditions:[{fn:r,[n]:b}],type:i,rules:[{conditions:[{fn:`aws.partition`,[n]:b,assign:s}],type:i,rules:[{conditions:[f,p],type:i,rules:[{conditions:[g,_],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://sns-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}]}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}]},{conditions:v,type:i,rules:[{conditions:[g],type:i,rules:[{type:i,rules:[{conditions:[{fn:c,[n]:[h,`us-gov-east-1`]}],endpoint:{url:`https://sns.us-gov-east-1.amazonaws.com`,properties:m,headers:m},type:o},{conditions:[{fn:c,[n]:[h,`us-gov-west-1`]}],endpoint:{url:`https://sns.us-gov-west-1.amazonaws.com`,properties:m,headers:m},type:o},{endpoint:{url:`https://sns-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}]},{conditions:y,type:i,rules:[{conditions:[_],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://sns.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}]}]},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}]},{type:i,rules:[{endpoint:{url:`https://sns.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}]}]}]},{error:`Invalid Configuration: Missing Region`,type:a}]}]}})),Ru=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=Lu();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),zu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=Ru();e.getRuntimeConfig=e=>({apiVersion:`2010-03-31`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`SNS`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Bu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(ts()),n=Iu(),r=Or(),i=Eu(),a=vc(),o=Bi(),s=Ws(),c=Mc(),l=Pc(),u=Wr(),d=gl(),f=zu(),p=P(),h=El(),g=P();e.getRuntimeConfig=e=>{(0,g.emitWarningIfUnsupportedVersion)(process.version);let m=(0,h.resolveDefaultsModeConfig)(e),_=()=>m().then(p.loadConfigsForDefaultMode),v=(0,f.getRuntimeConfig)(e);return{...v,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??l.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??(0,n.decorateDefaultCredentialProvider)(i.defaultProvider),defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,d.defaultUserAgent)({serviceId:v.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,s.loadConfig)(o.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,s.loadConfig)(r.NODE_REGION_CONFIG_OPTIONS,r.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new c.NodeHttpHandler(_),retryMode:e?.retryMode??(0,s.loadConfig)({...o.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await _()).retryMode||u.DEFAULT_RETRY_MODE}),sha256:e?.sha256??a.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??c.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,s.loadConfig)(r.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,s.loadConfig)(r.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),Vu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SNSClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=xa(),l=$o(),u=P(),d=es(),f=Bu();e.SNSClient=class extends u.Client{constructor(e){let u=(0,f.getRuntimeConfig)(e),p=(0,d.resolveClientEndpointParameters)(u),m=(0,t.resolveRegionConfig)(p),h=(0,r.resolveEndpointConfig)(m),g=(0,s.resolveRetryConfig)(h),_=(0,i.resolveHostHeaderConfig)(g),v=(0,c.resolveAwsAuthConfig)(_),y=(0,l.resolveUserAgentConfig)(v);super(y),this.config=y,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,c.getAwsAuthPlugin)(this.config)),this.middlewareStack.use((0,l.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),Hu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SNS=void 0;let t=P(),n=jn(),r=Mn(),i=Nn(),a=Pn(),o=Fn(),s=In(),c=Ln(),l=Rn(),u=zn(),d=Bn(),f=Vn(),p=Hn(),m=Un(),h=Wn(),g=Gn(),_=Kn(),v=qn(),y=Jn(),b=Yn(),x=Xn(),S=Zn(),C=z(),w=Qn(),ee=$n(),te=er(),T=tr(),E=nr(),ne=rr(),re=ir(),ie=ar(),ae=or(),oe=sr(),se=cr(),ce=lr(),le=ur(),ue=dr(),de=fr(),fe=pr(),pe=mr(),me=hr(),he=gr(),ge=_r(),_e=Vu(),ve={AddPermissionCommand:n.AddPermissionCommand,CheckIfPhoneNumberIsOptedOutCommand:r.CheckIfPhoneNumberIsOptedOutCommand,ConfirmSubscriptionCommand:i.ConfirmSubscriptionCommand,CreatePlatformApplicationCommand:a.CreatePlatformApplicationCommand,CreatePlatformEndpointCommand:o.CreatePlatformEndpointCommand,CreateSMSSandboxPhoneNumberCommand:s.CreateSMSSandboxPhoneNumberCommand,CreateTopicCommand:c.CreateTopicCommand,DeleteEndpointCommand:l.DeleteEndpointCommand,DeletePlatformApplicationCommand:u.DeletePlatformApplicationCommand,DeleteSMSSandboxPhoneNumberCommand:d.DeleteSMSSandboxPhoneNumberCommand,DeleteTopicCommand:f.DeleteTopicCommand,GetDataProtectionPolicyCommand:p.GetDataProtectionPolicyCommand,GetEndpointAttributesCommand:m.GetEndpointAttributesCommand,GetPlatformApplicationAttributesCommand:h.GetPlatformApplicationAttributesCommand,GetSMSAttributesCommand:g.GetSMSAttributesCommand,GetSMSSandboxAccountStatusCommand:_.GetSMSSandboxAccountStatusCommand,GetSubscriptionAttributesCommand:v.GetSubscriptionAttributesCommand,GetTopicAttributesCommand:y.GetTopicAttributesCommand,ListEndpointsByPlatformApplicationCommand:b.ListEndpointsByPlatformApplicationCommand,ListOriginationNumbersCommand:x.ListOriginationNumbersCommand,ListPhoneNumbersOptedOutCommand:S.ListPhoneNumbersOptedOutCommand,ListPlatformApplicationsCommand:C.ListPlatformApplicationsCommand,ListSMSSandboxPhoneNumbersCommand:w.ListSMSSandboxPhoneNumbersCommand,ListSubscriptionsCommand:te.ListSubscriptionsCommand,ListSubscriptionsByTopicCommand:ee.ListSubscriptionsByTopicCommand,ListTagsForResourceCommand:T.ListTagsForResourceCommand,ListTopicsCommand:E.ListTopicsCommand,OptInPhoneNumberCommand:ne.OptInPhoneNumberCommand,PublishCommand:ie.PublishCommand,PublishBatchCommand:re.PublishBatchCommand,PutDataProtectionPolicyCommand:ae.PutDataProtectionPolicyCommand,RemovePermissionCommand:oe.RemovePermissionCommand,SetEndpointAttributesCommand:se.SetEndpointAttributesCommand,SetPlatformApplicationAttributesCommand:ce.SetPlatformApplicationAttributesCommand,SetSMSAttributesCommand:le.SetSMSAttributesCommand,SetSubscriptionAttributesCommand:ue.SetSubscriptionAttributesCommand,SetTopicAttributesCommand:de.SetTopicAttributesCommand,SubscribeCommand:fe.SubscribeCommand,TagResourceCommand:pe.TagResourceCommand,UnsubscribeCommand:me.UnsubscribeCommand,UntagResourceCommand:he.UntagResourceCommand,VerifySMSSandboxPhoneNumberCommand:ge.VerifySMSSandboxPhoneNumberCommand};var ye=class extends _e.SNSClient{};e.SNS=ye,(0,t.createAggregatedClient)(ve,ye)})),Uu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(jn(),e),t.__exportStar(Mn(),e),t.__exportStar(Nn(),e),t.__exportStar(Pn(),e),t.__exportStar(Fn(),e),t.__exportStar(In(),e),t.__exportStar(Ln(),e),t.__exportStar(Rn(),e),t.__exportStar(zn(),e),t.__exportStar(Bn(),e),t.__exportStar(Vn(),e),t.__exportStar(Hn(),e),t.__exportStar(Un(),e),t.__exportStar(Wn(),e),t.__exportStar(Gn(),e),t.__exportStar(Kn(),e),t.__exportStar(qn(),e),t.__exportStar(Jn(),e),t.__exportStar(Yn(),e),t.__exportStar(Xn(),e),t.__exportStar(Zn(),e),t.__exportStar(z(),e),t.__exportStar(Qn(),e),t.__exportStar($n(),e),t.__exportStar(er(),e),t.__exportStar(tr(),e),t.__exportStar(nr(),e),t.__exportStar(rr(),e),t.__exportStar(ir(),e),t.__exportStar(ar(),e),t.__exportStar(or(),e),t.__exportStar(sr(),e),t.__exportStar(cr(),e),t.__exportStar(lr(),e),t.__exportStar(ur(),e),t.__exportStar(dr(),e),t.__exportStar(fr(),e),t.__exportStar(pr(),e),t.__exportStar(mr(),e),t.__exportStar(hr(),e),t.__exportStar(gr(),e),t.__exportStar(_r(),e)})),Wu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(An(),e)})),Gu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Ku=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListEndpointsByPlatformApplication=void 0;let t=Yn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListEndpointsByPlatformApplicationCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListEndpointsByPlatformApplication=i})),qu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListOriginationNumbers=void 0;let t=Xn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListOriginationNumbersCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,t.MaxResults=e.pageSize,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListOriginationNumbers=i})),Ju=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListPhoneNumbersOptedOut=void 0;let t=Zn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListPhoneNumbersOptedOutCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.nextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.nextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListPhoneNumbersOptedOut=i})),Yu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListPlatformApplications=void 0;let t=z(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListPlatformApplicationsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListPlatformApplications=i})),Xu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListSMSSandboxPhoneNumbers=void 0;let t=Qn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListSMSSandboxPhoneNumbersCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,t.MaxResults=e.pageSize,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListSMSSandboxPhoneNumbers=i})),Zu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListSubscriptionsByTopic=void 0;let t=$n(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListSubscriptionsByTopicCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListSubscriptionsByTopic=i})),Qu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListSubscriptions=void 0;let t=er(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListSubscriptionsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListSubscriptions=i})),$u=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListTopics=void 0;let t=nr(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListTopicsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListTopics=i})),ed=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Gu(),e),t.__exportStar(Ku(),e),t.__exportStar(qu(),e),t.__exportStar(Ju(),e),t.__exportStar(Yu(),e),t.__exportStar(Xu(),e),t.__exportStar(Zu(),e),t.__exportStar(Qu(),e),t.__exportStar($u(),e)})),td=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SNSServiceException=void 0;let t=(N(),m(j));t.__exportStar(Hu(),e),t.__exportStar(Vu(),e),t.__exportStar(Uu(),e),t.__exportStar(Wu(),e),t.__exportStar(ed(),e);var n=kn();Object.defineProperty(e,`SNSServiceException`,{enumerable:!0,get:function(){return n.SNSServiceException}})})),nd=e=>{let t,n=()=>(t||=e(),t);return n.set=e=>{t=e},n},rd=u(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),id=u(((e,t)=>{let n=h(`os`),r=h(`tty`),i=rd(),{env:a}=process,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)||i(`color=never`)?o=0:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=1),`FORCE_COLOR`in a&&(o=a.FORCE_COLOR===`true`?1:a.FORCE_COLOR===`false`?0:a.FORCE_COLOR.length===0?1:Math.min(parseInt(a.FORCE_COLOR,10),3));function s(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e,t){if(o===0)return 0;if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2;if(e&&!t&&o===void 0)return 0;let r=o||0;if(a.TERM===`dumb`)return r;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in a)||a.CI_NAME===`codeship`?1:r;if(`TEAMCITY_VERSION`in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:r}function l(e){return s(c(e,e&&e.isTTY))}t.exports={supportsColor:l,stdout:s(c(!0,r.isatty(1))),stderr:s(c(!0,r.isatty(2)))}})),ad=td(),od=nd(()=>new ad.SNSClient({})),sd=e=>{let t={};for(let n in e)t[n]={DataType:`String`,StringValue:e[n]};return t},cd=async({client:e=od(),topic:t,subject:n,payload:r,attributes:i={},region:a=process.env.AWS_REGION,accountId:o=process.env.AWS_ACCOUNT_ID})=>{let s=new ad.PublishCommand({TopicArn:`arn:aws:sns:${a}:${o}:${t}`,Subject:n,Message:r,MessageAttributes:sd({topic:t,...i})});await e.send(s)};const ld=(e,t)=>{let n=process.env.EVENTS_TOPIC;n&&cd({topic:n,payload:ze({event:e,date:new Date,...t}),attributes:{event:e}}).catch(e=>{console.error(`Failed to publish socket event`,e)})},ud=(e,t)=>{let n=me(pe(ne(pe(le(),ee(25),re(e=>typeof e==`string`&&t.includes(e)))),te(1),ee(25)),e);return n.success?{valid:!0,topics:n.output}:{valid:!1,reason:n.issues[0].message}},dd=e=>{ld(`connected`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context})},fd=e=>{hd(e),e.close(),e.data.authenticated&&ld(`disconnected`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context})},pd=(e,t)=>{let n=ud(t,e.data.allowed);if(!n.valid){hd(e),e.close(4e3,`Invalid topic payload`);return}for(let t of n.topics)e.subscribe(t);n.topics.length>0&&ld(`subscribed`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context,topics:n.topics}),e.sendText(`ACK`)},md=(e,t)=>{let n=ud(t,e.data.allowed);if(!n.valid){hd(e),e.close(4e3,`Invalid topic payload`);return}let r=n.topics.filter(t=>e.isSubscribed(t));for(let t of r)e.unsubscribe(t);r.length>0&&ld(`unsubscribed`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context,topics:r}),e.sendText(`ACK`)},hd=e=>{let t=e.subscriptions;for(let n of t)e.unsubscribe(n);t.length>0&&ld(`unsubscribed`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context,topics:t})};var gd=u((e=>{e.HttpAuthLocation=void 0,(function(e){e.HEADER=`header`,e.QUERY=`query`})(e.HttpAuthLocation||={}),e.HttpApiKeyAuthLocation=void 0,(function(e){e.HEADER=`header`,e.QUERY=`query`})(e.HttpApiKeyAuthLocation||={}),e.EndpointURLScheme=void 0,(function(e){e.HTTP=`http`,e.HTTPS=`https`})(e.EndpointURLScheme||={}),e.AlgorithmId=void 0,(function(e){e.MD5=`md5`,e.CRC32=`crc32`,e.CRC32C=`crc32c`,e.SHA1=`sha1`,e.SHA256=`sha256`})(e.AlgorithmId||={});let t=t=>{let n=[];return t.sha256!==void 0&&n.push({algorithmId:()=>e.AlgorithmId.SHA256,checksumConstructor:()=>t.sha256}),t.md5!=null&&n.push({algorithmId:()=>e.AlgorithmId.MD5,checksumConstructor:()=>t.md5}),{addChecksumAlgorithm(e){n.push(e)},checksumAlgorithms(){return n}}},n=e=>{let t={};return e.checksumAlgorithms().forEach(e=>{t[e.algorithmId()]=e.checksumConstructor()}),t};e.FieldPosition=void 0,(function(e){e[e.HEADER=0]=`HEADER`,e[e.TRAILER=1]=`TRAILER`})(e.FieldPosition||={}),e.IniSectionType=void 0,(function(e){e.PROFILE=`profile`,e.SSO_SESSION=`sso-session`,e.SERVICES=`services`})(e.IniSectionType||={}),e.RequestHandlerProtocol=void 0,(function(e){e.HTTP_0_9=`http/0.9`,e.HTTP_1_0=`http/1.0`,e.TDS_8_0=`tds/8.0`})(e.RequestHandlerProtocol||={}),e.SMITHY_CONTEXT_KEY=`__smithy_context`,e.getDefaultClientConfiguration=e=>t(e),e.resolveDefaultRuntimeConfig=e=>n(e)})),_d=u((e=>{var t=gd();let n=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),r=e=>({httpHandler:e.httpHandler()});var i=class{name;kind;values;constructor({name:e,kind:n=t.FieldPosition.HEADER,values:r=[]}){this.name=e,this.kind=n,this.values=r}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter(t=>t!==e)}toString(){return this.values.map(e=>e.includes(`,`)||e.includes(` `)?`"${e}"`:e).join(`, `)}get(){return this.values}},a=class{entries={};encoding;constructor({fields:e=[],encoding:t=`utf-8`}){e.forEach(this.setField.bind(this)),this.encoding=t}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter(t=>t.kind===e)}},o=class e{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;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(t){let n=new e({...t,headers:{...t.headers}});return n.query&&=s(n.query),n}static isInstance(e){if(!e)return!1;let t=e;return`method`in t&&`protocol`in t&&`hostname`in t&&`path`in t&&typeof t.query==`object`&&typeof t.headers==`object`}clone(){return e.clone(this)}};function s(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}var c=class{statusCode;reason;headers;body;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;let t=e;return typeof t.statusCode==`number`&&typeof t.headers==`object`}};function l(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}e.Field=i,e.Fields=a,e.HttpRequest=o,e.HttpResponse=c,e.getHttpHandlerExtensionConfiguration=n,e.isValidHostname=l,e.resolveHttpHandlerRuntimeConfig=r})),vd=u((e=>{var t=_d();function n(e){return e}let r=e=>n=>async r=>{if(!t.HttpRequest.isInstance(r.request))return n(r);let{request:i}=r,{handlerProtocol:a=``}=e.requestHandler.metadata||{};if(a.indexOf(`h2`)>=0&&!i.headers[`:authority`])delete i.headers.host,i.headers[`:authority`]=i.hostname+(i.port?`:`+i.port:``);else if(!i.headers.host){let e=i.hostname;i.port!=null&&(e+=`:${i.port}`),i.headers.host=e}return n(r)},i={name:`hostHeaderMiddleware`,step:`build`,priority:`low`,tags:[`HOST`],override:!0};e.getHostHeaderPlugin=e=>({applyToStack:t=>{t.add(r(e),i)}}),e.hostHeaderMiddleware=r,e.hostHeaderMiddlewareOptions=i,e.resolveHostHeaderConfig=n})),yd=u((e=>{let t=()=>(e,t)=>async n=>{try{let r=await e(n),{clientName:i,commandName:a,logger:o,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:l}=s,u=c??t.inputFilterSensitiveLog,d=l??t.outputFilterSensitiveLog,{$metadata:f,...p}=r.output;return o?.info?.({clientName:i,commandName:a,input:u(n.input),output:d(p),metadata:f}),r}catch(e){let{clientName:r,commandName:i,logger:a,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:s}=o,c=s??t.inputFilterSensitiveLog;throw a?.error?.({clientName:r,commandName:i,input:c(n.input),error:e,metadata:e.$metadata}),e}},n={name:`loggerMiddleware`,tags:[`LOGGER`],step:`initialize`,override:!0};e.getLoggerPlugin=e=>({applyToStack:e=>{e.add(t(),n)}}),e.loggerMiddleware=t,e.loggerMiddlewareOptions=n})),bd=d({InvokeStore:()=>Ed,InvokeStoreBase:()=>Cd}),xd,Sd,Cd,wd,Td,Ed,Dd=l((()=>{xd={REQUEST_ID:Symbol.for(`_AWS_LAMBDA_REQUEST_ID`),X_RAY_TRACE_ID:Symbol.for(`_AWS_LAMBDA_X_RAY_TRACE_ID`),TENANT_ID:Symbol.for(`_AWS_LAMBDA_TENANT_ID`)},Sd=[`true`,`1`].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??``),Sd||(globalThis.awslambda=globalThis.awslambda||{}),Cd=class{static PROTECTED_KEYS=xd;isProtectedKey(e){return Object.values(xd).includes(e)}getRequestId(){return this.get(xd.REQUEST_ID)??`-`}getXRayTraceId(){return this.get(xd.X_RAY_TRACE_ID)}getTenantId(){return this.get(xd.TENANT_ID)}},wd=class extends Cd{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=t}run(e,t){return this.currentContext=e,t()}},Td=class e extends Cd{als;static async create(){let t=new e;return t.als=new(await(import(`node:async_hooks`))).AsyncLocalStorage,t}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);let n=this.als.getStore();if(!n)throw Error(`No context available`);n[e]=t}run(e,t){return this.als.run(e,t)}},(function(e){let t=null;async function n(e){return t||=(async()=>{let t=e===!0||`AWS_LAMBDA_MAX_CONCURRENCY`in process.env?await Td.create():new wd;return!Sd&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!Sd&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=t),t)})(),t}e.getInstanceAsync=n,e._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE===`1`?{reset:()=>{t=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0}}}:void 0})(Ed||={})})),Od=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.recursionDetectionMiddleware=void 0;let t=(Dd(),m(bd)),n=_d(),r=`X-Amzn-Trace-Id`;e.recursionDetectionMiddleware=()=>e=>async i=>{let{request:a}=i;if(!n.HttpRequest.isInstance(a))return e(i);let o=Object.keys(a.headers??{}).find(e=>e.toLowerCase()===`x-amzn-trace-id`)??r;if(a.headers.hasOwnProperty(o))return e(i);let s=process.env.AWS_LAMBDA_FUNCTION_NAME,c=process.env._X_AMZN_TRACE_ID,l=(await t.InvokeStore.getInstanceAsync())?.getXRayTraceId()??c,u=e=>typeof e==`string`&&e.length>0;return u(s)&&u(l)&&(a.headers[r]=l),e({...i,request:a})}})),kd=u((e=>{var t=Od();let n={step:`build`,tags:[`RECURSION_DETECTION`],name:`recursionDetectionMiddleware`,override:!0,priority:`low`};e.getRecursionDetectionPlugin=e=>({applyToStack:e=>{e.add(t.recursionDetectionMiddleware(),n)}}),Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])})})),Ad,jd,Md=l((()=>{Ad=gd(),jd=e=>e[Ad.SMITHY_CONTEXT_KEY]||(e[Ad.SMITHY_CONTEXT_KEY]={})})),Nd=u((e=>{var t=gd();e.getSmithyContext=e=>e[t.SMITHY_CONTEXT_KEY]||(e[t.SMITHY_CONTEXT_KEY]={}),e.normalizeProvider=e=>{if(typeof e==`function`)return e;let t=Promise.resolve(e);return()=>t}})),Pd,Fd=l((()=>{Pd=(e,t)=>{if(!t||t.length===0)return e;let n=[];for(let r of t)for(let t of e)t.schemeId.split(`#`)[1]===r&&n.push(t);for(let t of e)n.find(({schemeId:e})=>e===t.schemeId)||n.push(t);return n}}));function Id(e){let t=new Map;for(let n of e)t.set(n.schemeId,n);return t}var Ld,Rd,zd=l((()=>{Ld=Nd(),Fd(),Rd=(e,t)=>(n,r)=>async i=>{let a=Pd(e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),e.authSchemePreference?await e.authSchemePreference():[]),o=Id(e.httpAuthSchemes),s=(0,Ld.getSmithyContext)(r),c=[];for(let n of a){let i=o.get(n.schemeId);if(!i){c.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}let a=i.identityProvider(await t.identityProviderConfigProvider(e));if(!a){c.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:l={},signingProperties:u={}}=n.propertiesExtractor?.(e,r)||{};n.identityProperties=Object.assign(n.identityProperties||{},l),n.signingProperties=Object.assign(n.signingProperties||{},u),s.selectedHttpAuthScheme={httpAuthOption:n,identity:await a(n.identityProperties),signer:i.signer};break}if(!s.selectedHttpAuthScheme)throw Error(c.join(`
|
|
29
|
-
`));return n(i)}})),Bd,Vd,Hd=l((()=>{zd(),Bd={step:`serialize`,tags:[`HTTP_AUTH_SCHEME`],name:`httpAuthSchemeMiddleware`,override:!0,relation:`before`,toMiddleware:`endpointV2Middleware`},Vd=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(Rd(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),Bd)}})})),Ud,Wd,Gd=l((()=>{zd(),Ud={step:`serialize`,tags:[`HTTP_AUTH_SCHEME`],name:`httpAuthSchemeMiddleware`,override:!0,relation:`before`,toMiddleware:`serializerMiddleware`},Wd=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(Rd(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),Ud)}})})),Kd=l((()=>{zd(),Hd(),Gd()})),qd,Jd,Yd,Xd,Zd,Qd=l((()=>{qd=_d(),Jd=Nd(),Yd=e=>e=>{throw e},Xd=(e,t)=>{},Zd=e=>(e,t)=>async n=>{if(!qd.HttpRequest.isInstance(n.request))return e(n);let r=(0,Jd.getSmithyContext)(t).selectedHttpAuthScheme;if(!r)throw Error(`No HttpAuthScheme was selected: unable to sign request`);let{httpAuthOption:{signingProperties:i={}},identity:a,signer:o}=r,s=await e({...n,request:await o.sign(n.request,a,i)}).catch((o.errorHandler||Yd)(i));return(o.successHandler||Xd)(s.response,i),s}})),$d,ef,tf=l((()=>{Qd(),$d={step:`finalizeRequest`,tags:[`HTTP_SIGNING`],name:`httpSigningMiddleware`,aliases:[`apiKeyMiddleware`,`tokenMiddleware`,`awsAuthMiddleware`],override:!0,relation:`after`,toMiddleware:`retryMiddleware`},ef=e=>({applyToStack:t=>{t.addRelativeTo(Zd(e),$d)}})})),nf=l((()=>{Qd(),tf()})),rf,af=l((()=>{rf=e=>{if(typeof e==`function`)return e;let t=Promise.resolve(e);return()=>t}}));function of(e,t,n,r,i){return async function*(a,o,...s){let c=o,l=a.startingToken??c[n],u=!0,d;for(;u;){if(c[n]=l,i&&(c[i]=c[i]??a.pageSize),a.client instanceof e)d=await sf(t,a.client,o,a.withCommand,...s);else throw Error(`Invalid client, expected instance of ${e.name}`);yield d;let f=l;l=cf(d,r),u=!!(l&&(!a.stopOnSameToken||l!==f))}return void 0}}var sf,cf,lf=l((()=>{sf=async(e,t,n,r=e=>e,...i)=>{let a=new e(n);return a=r(a)??a,await t.send(a,...i)},cf=(e,t)=>{let n=e,r=t.split(`.`);for(let e of r){if(!n||typeof n!=`object`)return;n=n[e]}return n}})),uf=u((e=>{e.isArrayBuffer=e=>typeof ArrayBuffer==`function`&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`})),df=u((e=>{var t=uf(),n=h(`buffer`);e.fromArrayBuffer=(e,r=0,i=e.byteLength-r)=>{if(!t.isArrayBuffer(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return n.Buffer.from(e,r,i)},e.fromString=(e,t)=>{if(typeof e!=`string`)throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?n.Buffer.from(e,t):n.Buffer.from(e)}})),ff=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromBase64=void 0;let t=df(),n=/^[A-Za-z0-9+/]*={0,2}$/;e.fromBase64=e=>{if(e.length*3%4!=0)throw TypeError(`Incorrect padding on base64 string.`);if(!n.exec(e))throw TypeError(`Invalid base64 string.`);let r=(0,t.fromString)(e,`base64`);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}})),pf=u((e=>{var t=df();let n=e=>{let n=t.fromString(e,`utf8`);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)};e.fromUtf8=n,e.toUint8Array=e=>typeof e==`string`?n(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),e.toUtf8=e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||typeof e.byteOffset!=`number`||typeof e.byteLength!=`number`)throw Error(`@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.`);return t.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`)}})),mf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.toBase64=void 0;let t=df(),n=pf();e.toBase64=e=>{let r;if(r=typeof e==`string`?(0,n.fromUtf8)(e):e,typeof r!=`object`||typeof r.byteOffset!=`number`||typeof r.byteLength!=`number`)throw Error(`@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.`);return(0,t.fromArrayBuffer)(r.buffer,r.byteOffset,r.byteLength).toString(`base64`)}})),hf=u((e=>{var t=ff(),n=mf();Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),Object.prototype.hasOwnProperty.call(n,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:n.__proto__}),Object.keys(n).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=n[t])})})),gf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChecksumStream=void 0;let t=hf(),n=h(`stream`);e.ChecksumStream=class extends n.Duplex{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;pendingCallback=null;constructor({expectedChecksum:e,checksum:n,source:r,checksumSourceLocation:i,base64Encoder:a}){if(super(),typeof r.pipe==`function`)this.source=r;else throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);this.base64Encoder=a??t.toBase64,this.expectedChecksum=e,this.checksum=n,this.checksumSourceLocation=i,this.source.pipe(this)}_read(e){if(this.pendingCallback){let e=this.pendingCallback;this.pendingCallback=null,e()}}_write(e,t,n){try{if(this.checksum.update(e),!this.push(e)){this.pendingCallback=n;return}}catch(e){return n(e)}return n()}async _final(e){try{let t=await this.checksum.digest(),n=this.base64Encoder(t);if(this.expectedChecksum!==n)return e(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`))}catch(t){return e(t)}return this.push(null),e()}}})),_f=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isBlob=e.isReadableStream=void 0,e.isReadableStream=e=>typeof ReadableStream==`function`&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),e.isBlob=e=>typeof Blob==`function`&&(e?.constructor?.name===Blob.name||e instanceof Blob)})),vf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChecksumStream=void 0;let t=typeof ReadableStream==`function`?ReadableStream:function(){};e.ChecksumStream=class extends t{}})),yf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createChecksumStream=void 0;let t=hf(),n=_f(),r=vf();e.createChecksumStream=({expectedChecksum:e,checksum:i,source:a,checksumSourceLocation:o,base64Encoder:s})=>{if(!(0,n.isReadableStream)(a))throw Error(`@smithy/util-stream: unsupported source type ${a?.constructor?.name??a} in ChecksumStream.`);let c=s??t.toBase64;if(typeof TransformStream!=`function`)throw Error(`@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.`);let l=new TransformStream({start(){},async transform(e,t){i.update(e),t.enqueue(e)},async flush(t){let n=c(await i.digest());if(e!==n){let r=Error(`Checksum mismatch: expected "${e}" but received "${n}" in response header "${o}".`);t.error(r)}else t.terminate()}});a.pipeThrough(l);let u=l.readable;return Object.setPrototypeOf(u,r.ChecksumStream.prototype),u}})),bf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createChecksumStream=i;let t=_f(),n=gf(),r=yf();function i(e){return typeof ReadableStream==`function`&&(0,t.isReadableStream)(e.source)?(0,r.createChecksumStream)(e):new n.ChecksumStream(e)}})),xf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ByteArrayCollector=void 0,e.ByteArrayCollector=class{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let e=this.byteArrays[0];return this.reset(),e}let e=this.allocByteArray(this.byteLength),t=0;for(let n=0;n<this.byteArrays.length;++n){let r=this.byteArrays[n];e.set(r,t),t+=r.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}})),Sf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createBufferedReadable=void 0,e.createBufferedReadableStream=n,e.merge=r,e.flush=i,e.sizeOf=a,e.modeOf=o;let t=xf();function n(e,n,s){let c=e.getReader(),l=!1,u=0,d=[``,new t.ByteArrayCollector(e=>new Uint8Array(e))],f=-1,p=async e=>{let{value:t,done:m}=await c.read(),h=t;if(m){if(f!==-1){let t=i(d,f);a(t)>0&&e.enqueue(t)}e.close()}else{let t=o(h,!1);if(f!==t&&(f>=0&&e.enqueue(i(d,f)),f=t),f===-1){e.enqueue(h);return}let c=a(h);u+=c;let m=a(d[f]);if(c>=n&&m===0)e.enqueue(h);else{let t=r(d,f,h);!l&&u>n*2&&(l=!0,s?.warn(`@smithy/util-stream - stream chunk size ${c} is below threshold of ${n}, automatically buffering.`)),t>=n?e.enqueue(i(d,f)):await p(e)}}};return new ReadableStream({pull:p})}e.createBufferedReadable=n;function r(e,t,n){switch(t){case 0:return e[0]+=n,a(e[0]);case 1:case 2:return e[t].push(n),a(e[t])}}function i(e,t){switch(t){case 0:let n=e[0];return e[0]=``,n;case 1:case 2:return e[t].flush()}throw Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function a(e){return e?.byteLength??e?.length??0}function o(e,t=!0){return t&&typeof Buffer<`u`&&e instanceof Buffer?2:e instanceof Uint8Array?1:typeof e==`string`?0:-1}})),Cf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createBufferedReadable=a;let t=h(`node:stream`),n=xf(),r=Sf(),i=_f();function a(e,a,o){if((0,i.isReadableStream)(e))return(0,r.createBufferedReadableStream)(e,a,o);let s=new t.Readable({read(){}}),c=!1,l=0,u=[``,new n.ByteArrayCollector(e=>new Uint8Array(e)),new n.ByteArrayCollector(e=>Buffer.from(new Uint8Array(e)))],d=-1;return e.on(`data`,e=>{let t=(0,r.modeOf)(e,!0);if(d!==t&&(d>=0&&s.push((0,r.flush)(u,d)),d=t),d===-1){s.push(e);return}let n=(0,r.sizeOf)(e);l+=n;let i=(0,r.sizeOf)(u[d]);if(n>=a&&i===0)s.push(e);else{let t=(0,r.merge)(u,d,e);!c&&l>a*2&&(c=!0,o?.warn(`@smithy/util-stream - stream chunk size ${n} is below threshold of ${a}, automatically buffering.`)),t>=a&&s.push((0,r.flush)(u,d))}}),e.on(`end`,()=>{if(d!==-1){let e=(0,r.flush)(u,d);(0,r.sizeOf)(e)>0&&s.push(e)}s.push(null)}),s}})),wf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getAwsChunkedEncodingStream=void 0,e.getAwsChunkedEncodingStream=(e,t)=>{let{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:i,checksumLocationName:a,streamHasher:o}=t,s=n!==void 0&&r!==void 0&&i!==void 0&&a!==void 0&&o!==void 0,c=s?o(i,e):void 0,l=e.getReader();return new ReadableStream({async pull(e){let{value:t,done:i}=await l.read();if(i){if(e.enqueue(`0\r
|
|
28
|
+
`));let S=i(Bc());process.versions.hasOwnProperty(`electron`)&&process.on(`exit`,function(){S.default.disable_threadsafe_function()}),e.default=x})),Vc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.CrtError=void 0;let n=t(Bc());var r=class extends Error{constructor(e){super(i(e)),this.error=e,this.error_code=a(e),this.error_name=o(e)}};e.CrtError=r;function i(e){return typeof e==`number`?n.default.error_code_to_string(e):e instanceof r?e.message:e.toString()}function a(e){if(typeof e==`number`)return e;if(e instanceof r)return e.error_code}function o(e){if(typeof e==`number`)return n.default.error_code_to_name(e);if(e instanceof r)return e.error_name}})),Hc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NativeResourceMixin=e.NativeResource=void 0,e.NativeResource=class{constructor(e){this.handle=e}native_handle(){return this.handle}};function t(e){return class extends e{constructor(...e){let t=e.shift();super(...e),this._handle=t}_super(e){this._handle=e}native_handle(){return this._handle}}}e.NativeResourceMixin=t})),Uc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.logTrace=e.logDebug=e.logInfo=e.logWarn=e.logError=e.logFatal=e.setLogLevel=e.LogLevel=e.SocketDomain=e.SocketType=e.TlsVersion=void 0,(function(e){e[e.SSLv3=0]=`SSLv3`,e[e.TLSv1=1]=`TLSv1`,e[e.TLSv1_1=2]=`TLSv1_1`,e[e.TLSv1_2=3]=`TLSv1_2`,e[e.TLSv1_3=4]=`TLSv1_3`,e[e.Default=128]=`Default`})(e.TlsVersion||={}),(function(e){e[e.STREAM=0]=`STREAM`,e[e.DGRAM=1]=`DGRAM`})(e.SocketType||={}),(function(e){e[e.IPV4=0]=`IPV4`,e[e.IPV6=1]=`IPV6`,e[e.LOCAL=2]=`LOCAL`})(e.SocketDomain||={});var t;(function(e){e[e.NONE=0]=`NONE`,e[e.FATAL=1]=`FATAL`,e[e.ERROR=2]=`ERROR`,e[e.WARN=3]=`WARN`,e[e.INFO=4]=`INFO`,e[e.DEBUG=5]=`DEBUG`,e[e.TRACE=6]=`TRACE`})(t=e.LogLevel||={});let n=t.NONE;function r(e){n=e}e.setLogLevel=r;function i(e,r){if(n<t.FATAL)return;let i=new Date().toISOString();console.log(`[FATAL] [${i}] [${e}] - ${r}`)}e.logFatal=i;function a(e,r){if(n<t.ERROR)return;let i=new Date().toISOString();console.log(`[ERROR] [${i}] [${e}] - ${r}`)}e.logError=a;function o(e,r){if(n<t.WARN)return;let i=new Date().toISOString();console.log(`[WARN] [${i}] [${e}] - ${r}`)}e.logWarn=o;function s(e,r){if(n<t.INFO)return;let i=new Date().toISOString();console.log(`[INFO] [${i}] [${e}] - ${r}`)}e.logInfo=s;function c(e,r){if(n<t.DEBUG)return;let i=new Date().toISOString();console.log(`[DEBUG] [${i}] [${e}] - ${r}`)}e.logDebug=c;function l(e,r){if(n<t.TRACE)return;let i=new Date().toISOString();console.log(`[TRACE] [${i}] [${e}] - ${r}`)}e.logTrace=l})),Wc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Pkcs11Lib=e.TlsConnectionOptions=e.ServerTlsContext=e.ClientTlsContext=e.TlsContext=e.TlsContextOptions=e.tls_cipher_preference_is_supported=e.TlsCipherPreference=e.SocketOptions=e.ClientBootstrap=e.InputStream=e.is_alpn_available=e.enable_logging=e.error_code_to_name=e.error_code_to_string=e.SocketDomain=e.SocketType=e.TlsVersion=e.LogLevel=e.setLogLevel=void 0;let n=t(Bc()),r=Hc(),i=Uc();var a=Uc();Object.defineProperty(e,`setLogLevel`,{enumerable:!0,get:function(){return a.setLogLevel}}),Object.defineProperty(e,`LogLevel`,{enumerable:!0,get:function(){return a.LogLevel}}),Object.defineProperty(e,`TlsVersion`,{enumerable:!0,get:function(){return a.TlsVersion}}),Object.defineProperty(e,`SocketType`,{enumerable:!0,get:function(){return a.SocketType}}),Object.defineProperty(e,`SocketDomain`,{enumerable:!0,get:function(){return a.SocketDomain}});let o=Vc();function s(e){return n.default.error_code_to_string(e)}e.error_code_to_string=s;function c(e){return n.default.error_code_to_name(e)}e.error_code_to_name=c;function l(e){n.default.io_logging_enable(e),(0,i.setLogLevel)(e)}e.enable_logging=l;function u(){return n.default.is_alpn_available()}e.is_alpn_available=u,e.InputStream=class extends r.NativeResource{constructor(e){super(n.default.io_input_stream_new(16*1024)),this.source=e,this.source.on(`data`,e=>{e=Buffer.isBuffer(e)?e:Buffer.from(e.toString()),n.default.io_input_stream_append(this.native_handle(),e)}),this.source.on(`end`,()=>{n.default.io_input_stream_append(this.native_handle(),void 0)})}},e.ClientBootstrap=class extends r.NativeResource{constructor(){super(n.default.io_client_bootstrap_new())}},e.SocketOptions=class extends r.NativeResource{constructor(e=i.SocketType.STREAM,t=i.SocketDomain.IPV6,r=5e3,a=!1,o=0,s=0,c=0){super(n.default.io_socket_options_new(e,t,r,o,s,c,a))}},(function(e){e[e.Default=0]=`Default`,e[e.PQ_TLSv1_0_2021_05=6]=`PQ_TLSv1_0_2021_05`,e[e.PQ_Default=8]=`PQ_Default`,e[e.TLSv1_2_2025_07=9]=`TLSv1_2_2025_07`})(e.TlsCipherPreference||={});function d(e){return n.default.io_tls_cipher_preference_is_supported(e)}e.tls_cipher_preference_is_supported=d;var f=class e{constructor(){this.min_tls_version=i.TlsVersion.Default,this.alpn_list=[],this.verify_peer=!0}override_default_trust_store_from_path(e,t){this.ca_dirpath=e,this.ca_filepath=t}override_default_trust_store(e){this.certificate_authority=e}static create_client_with_mtls(t,n){let r=new e;return r.certificate=t,r.private_key=n,r.verify_peer=!0,r}static create_client_with_mtls_from_path(t,n){let r=new e;return r.certificate_filepath=t,r.private_key_filepath=n,r.verify_peer=!0,r}static create_client_with_mtls_pkcs12_from_path(t,n){let r=new e;return r.pkcs12_filepath=t,r.pkcs12_password=n,r.verify_peer=!0,r}static create_client_with_mtls_pkcs_from_path(e,t){return this.create_client_with_mtls_pkcs12_from_path(e,t)}static create_client_with_mtls_pkcs11(t){let n=new e;return n.pkcs11_options=t,n.verify_peer=!0,n}static create_client_with_mtls_windows_cert_store_path(t){let n=new e;return n.windows_cert_store_path=t,n.verify_peer=!0,n}static create_server_with_mtls_from_path(t,n){let r=new e;return r.certificate_filepath=t,r.private_key_filepath=n,r.verify_peer=!1,r}static create_server_with_mtls_pkcs_from_path(t,n){let r=new e;return r.pkcs12_filepath=t,r.pkcs12_password=n,r.verify_peer=!1,r}};e.TlsContextOptions=f;var p=class extends r.NativeResource{constructor(e){if(e==null||e==null)throw new o.CrtError(`TlsContext constructor: ctx_opt not defined`);super(n.default.io_tls_ctx_new(e.min_tls_version,e.ca_filepath,e.ca_dirpath,e.certificate_authority,e.alpn_list&&e.alpn_list.length>0?e.alpn_list.join(`;`):void 0,e.certificate_filepath,e.certificate,e.private_key_filepath,e.private_key,e.pkcs12_filepath,e.pkcs12_password,e.pkcs11_options,e.windows_cert_store_path,e.tls_cipher_preference,e.verify_peer))}};e.TlsContext=p,e.ClientTlsContext=class extends p{constructor(e){e||(e=new f,e.verify_peer=!0),super(e)}},e.ServerTlsContext=class extends p{constructor(e){e||(e=new f,e.verify_peer=!1),super(e)}},e.TlsConnectionOptions=class extends r.NativeResource{constructor(e,t,r=[]){if(e==null||e==null)throw new o.CrtError(`TlsConnectionOptions constructor: tls_ctx not defined`);super(n.default.io_tls_connection_options_new(e.native_handle(),t,r&&r.length>0?r.join(`;`):void 0)),this.tls_ctx=e,this.server_name=t,this.alpn_list=r}};var m=class e extends r.NativeResource{constructor(t,r=e.InitializeFinalizeBehavior.DEFAULT){super(n.default.io_pkcs11_lib_new(t,r))}close(){n.default.io_pkcs11_lib_close(this.native_handle())}};e.Pkcs11Lib=m,(function(e){(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.OMIT=1]=`OMIT`,e[e.STRICT=2]=`STRICT`})(e.InitializeFinalizeBehavior||={})})(m=e.Pkcs11Lib||={})})),Gc=u((e=>{var t=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.aws_verify_sigv4a_signing=e.aws_sign_request=e.AwsSignedBodyHeaderType=e.AwsSignedBodyValue=e.AwsSignatureType=e.AwsSigningAlgorithm=e.AwsCredentialsProvider=void 0;let r=n(Bc()),i=Vc(),a=Wc();e.AwsCredentialsProvider=class extends r.default.AwsCredentialsProvider{static newDefault(e=void 0){return super.newDefault(e==null?null:e.native_handle())}static newStatic(e,t,n){return super.newStatic(e,t,n)}static newCognito(e){if(e==null||e==null)throw new i.CrtError(`AwsCredentialsProvider newCognito: Cognito config not defined`);return super.newCognito(e,e.tlsContext==null?new a.ClientTlsContext().native_handle():e.tlsContext.native_handle(),e.bootstrap==null?null:e.bootstrap.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}static newX509(e){if(e==null||e==null)throw new i.CrtError(`AwsCredentialsProvider newX509: X509 config not defined`);return super.newX509(e,e.tlsContext.native_handle(),e.httpProxyOptions?e.httpProxyOptions.create_native_handle():null)}},(function(e){e[e.SigV4=0]=`SigV4`,e[e.SigV4Asymmetric=1]=`SigV4Asymmetric`})(e.AwsSigningAlgorithm||={}),(function(e){e[e.HttpRequestViaHeaders=0]=`HttpRequestViaHeaders`,e[e.HttpRequestViaQueryParams=1]=`HttpRequestViaQueryParams`,e[e.HttpRequestChunk=2]=`HttpRequestChunk`,e[e.HttpRequestEvent=3]=`HttpRequestEvent`})(e.AwsSignatureType||={}),(function(e){e.EmptySha256=`e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`,e.UnsignedPayload=`UNSIGNED-PAYLOAD`,e.StreamingAws4HmacSha256Payload=`STREAMING-AWS4-HMAC-SHA256-PAYLOAD`,e.StreamingAws4HmacSha256Events=`STREAMING-AWS4-HMAC-SHA256-EVENTS`})(e.AwsSignedBodyValue||={}),(function(e){e[e.None=0]=`None`,e[e.XAmzContentSha256=1]=`XAmzContentSha256`})(e.AwsSignedBodyHeaderType||={});function o(e,n){return t(this,void 0,void 0,function*(){return new Promise((t,a)=>{try{r.default.aws_sign_request(e,n,n=>{n==0?t(e):a(new i.CrtError(n))})}catch(e){a(e)}})})}e.aws_sign_request=o;function s(e,t,n,i,a,o){return r.default.aws_verify_sigv4a_signing(e,t,n,i,a,o)}e.aws_verify_sigv4a_signing=s})),Kc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.crc64nvme=e.crc32c=e.crc32=void 0;let n=t(Bc());function r(e,t){return n.default.checksums_crc32(e,t)}e.crc32=r;function i(e,t){return n.default.checksums_crc32c(e,t)}e.crc32c=i;function a(e,t){return n.default.checksums_crc64nvme(e,t)}e.crc64nvme=a})),qc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.native_memory_dump=e.native_memory=void 0;let n=t(Bc());function r(){return n.default.native_memory()}e.native_memory=r;function i(){return n.default.native_memory_dump()}e.native_memory_dump=i})),Jc=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.hmac_sha256=e.Sha256Hmac=e.hash_sha1=e.Sha1Hash=e.hash_sha256=e.Sha256Hash=e.hash_md5=e.Md5Hash=void 0;let n=t(Bc()),r=Hc();var i=class extends r.NativeResource{update(e){n.default.hash_update(this.native_handle(),e)}finalize(e){return n.default.hash_digest(this.native_handle(),e)}constructor(e){super(e)}};e.Md5Hash=class extends i{constructor(){super(n.default.hash_md5_new())}};function a(e,t){return n.default.hash_md5_compute(e,t)}e.hash_md5=a,e.Sha256Hash=class extends i{constructor(){super(n.default.hash_sha256_new())}};function o(e,t){return n.default.hash_sha256_compute(e,t)}e.hash_sha256=o,e.Sha1Hash=class extends i{constructor(){super(n.default.hash_sha1_new())}};function s(e,t){return n.default.hash_sha1_compute(e,t)}e.hash_sha1=s;var c=class extends r.NativeResource{update(e){n.default.hmac_update(this.native_handle(),e)}finalize(e){return n.default.hmac_digest(this.native_handle(),e)}constructor(e){super(e)}};e.Sha256Hmac=class extends c{constructor(e){super(n.default.hmac_sha256_new(e))}};function l(e,t,r){return n.default.hmac_sha256_compute(e,t,r)}e.hmac_sha256=l})),Yc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.BufferedEventEmitter=void 0;let t=h(`events`);var n=class{constructor(e,t){this.event=e,this.args=t}};e.BufferedEventEmitter=class extends t.EventEmitter{constructor(){super(),this.corked=!1}cork(){this.corked=!0}uncork(){for(this.corked=!1;this.eventQueue;){let e=this.eventQueue;super.emit(e.event,...e.args),this.eventQueue=this.eventQueue.next}}emit(e,...t){if(this.corked){let r=this.lastQueuedEvent;return this.lastQueuedEvent=new n(e,t),r?r.next=this.lastQueuedEvent:this.eventQueue=this.lastQueuedEvent,this.listeners(e).length>0}return super.emit(e,...t)}}})),Xc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.unmarshalInt64BigintFromBuffer=e.marshalInt64BigintAsBuffer=e.MIN_INT64=e.MAX_INT64=e.MIN_INT32=e.MAX_INT32=e.MIN_INT16=e.MAX_INT16=e.MIN_INT8=e.MAX_INT8=void 0;let t=Vc();e.MAX_INT8=127,e.MIN_INT8=-128,e.MAX_INT16=32767,e.MIN_INT16=-32768,e.MAX_INT32=2147483647,e.MIN_INT32=-2147483648,e.MAX_INT64=BigInt(`9223372036854775807`),e.MIN_INT64=BigInt(`-9223372036854775808`);let n=BigInt(`256`);function r(r){if(r<e.MIN_INT64||r>e.MAX_INT64)throw new t.CrtError(`marshalInt64BigintAsBuffer expects a value that can fit in 8 bytes`);let i=new Uint8Array(8);if(r<0){r=-r-BigInt(1);for(let e=0;e<8;++e)i[e]=255-Number(r%n),r/=n}else for(let e=0;e<8;++e)i[e]=Number(r%n),r/=n;return i}e.marshalInt64BigintAsBuffer=r;function i(e){let r=BigInt(0),i=new Uint8Array(e);if(i.length!=8)throw new t.CrtError(`unmarshalInt64BigintFromBuffer expects a byte buffer of length 8`);let a=BigInt(1);if(i[7]&128){for(let e=0;e<i.length;++e){let t=BigInt(255-i[e]);r+=t*a,a*=n}r+=BigInt(1),r=-r}else for(let e=0;e<i.length;++e){let t=BigInt(i[e]);r+=t*a,a*=n}return r}e.unmarshalInt64BigintFromBuffer=i})),Zc=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.ClientStream=e.ClientConnection=e.MessageType=e.MessageFlags=e.Header=e.HeaderType=void 0;let o=Hc(),s=Yc(),c=Vc(),l=r(Wc()),u=r(Xc()),d=r(Fc()),f=a(Bc());var p;(function(e){e[e.BooleanTrue=0]=`BooleanTrue`,e[e.BooleanFalse=1]=`BooleanFalse`,e[e.Byte=2]=`Byte`,e[e.Int16=3]=`Int16`,e[e.Int32=4]=`Int32`,e[e.Int64=5]=`Int64`,e[e.ByteBuffer=6]=`ByteBuffer`,e[e.String=7]=`String`,e[e.Timestamp=8]=`Timestamp`,e[e.UUID=9]=`UUID`})(p=e.HeaderType||={});var m=class e{constructor(e,t,n){this.name=e,this.type=t,this.value=n}static validateHeaderName(e){if(e.length==0||e.length>127)throw new c.CrtError(`Event stream header name (${e}) is not valid`)}static newBoolean(t,n){return e.validateHeaderName(t),n?new e(t,p.BooleanTrue):new e(t,p.BooleanFalse)}static newByte(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT8&&n<=u.MAX_INT8&&Number.isSafeInteger(n))return new e(t,p.Byte,n);throw new c.CrtError(`Illegal value for eventstream byte-valued header: ${n}`)}static newInt16(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT16&&n<=u.MAX_INT16&&Number.isSafeInteger(n))return new e(t,p.Int16,n);throw new c.CrtError(`Illegal value for eventstream int16-valued header: ${n}`)}static newInt32(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT32&&n<=u.MAX_INT32&&Number.isSafeInteger(n))return new e(t,p.Int32,n);throw new c.CrtError(`Illegal value for eventstream int32-valued header: ${n}`)}static newInt64FromNumber(t,n){if(e.validateHeaderName(t),Number.isSafeInteger(n))return new e(t,p.Int64,u.marshalInt64BigintAsBuffer(BigInt(n)));throw new c.CrtError(`Illegal value for eventstream int64-valued header: ${n}`)}static newInt64FromBigint(t,n){if(e.validateHeaderName(t),n>=u.MIN_INT64&&n<=u.MAX_INT64)return new e(t,p.Int64,u.marshalInt64BigintAsBuffer(n));throw new c.CrtError(`Illegal value for eventstream int64-valued header: ${n}`)}static newByteBuffer(t,n){return e.validateHeaderName(t),new e(t,p.ByteBuffer,n)}static newString(t,n){return e.validateHeaderName(t),new e(t,p.String,n)}static newTimeStampFromSecondsSinceEpoch(t,n){if(e.validateHeaderName(t),Number.isSafeInteger(n)&&n>=0)return new e(t,p.Timestamp,n);throw new c.CrtError(`Illegal value for eventstream timestamp-valued header: ${n}`)}static newTimeStampFromDate(t,n){e.validateHeaderName(t);let r=n.getTime();if(Number.isSafeInteger(r))return new e(t,p.Timestamp,r);throw new c.CrtError(`Illegal value for eventstream timestamp-valued header: ${n}`)}static newUUID(t,n){if(e.validateHeaderName(t),n.byteLength==16)return new e(t,p.UUID,n);throw new c.CrtError(`Illegal value for eventstream uuid-valued header: ${n}`)}toValue(e){if(e!=this.type)throw new c.CrtError(`Header of type (${this.type}) cannot be converted to type (${e})`);return this.value}asBoolean(){switch(this.type){case p.BooleanFalse:return!1;case p.BooleanTrue:return!0;default:throw new c.CrtError(`Header of type (${this.type}) cannot be converted to type (boolean)`)}}asByte(){return this.toValue(p.Byte)}asInt16(){return this.toValue(p.Int16)}asInt32(){return this.toValue(p.Int32)}asInt64(){return u.unmarshalInt64BigintFromBuffer(this.toValue(p.Int64))}asByteBuffer(){return this.toValue(p.ByteBuffer)}asString(){return this.toValue(p.String)}asTimestamp(){return this.toValue(p.Timestamp)}asUUID(){return this.toValue(p.UUID)}};e.Header=m,(function(e){e[e.None=0]=`None`,e[e.ConnectionAccepted=1]=`ConnectionAccepted`,e[e.TerminateStream=2]=`TerminateStream`})(e.MessageFlags||={}),(function(e){e[e.ApplicationMessage=0]=`ApplicationMessage`,e[e.ApplicationError=1]=`ApplicationError`,e[e.Ping=2]=`Ping`,e[e.PingResponse=3]=`PingResponse`,e[e.Connect=4]=`Connect`,e[e.ConnectAck=5]=`ConnectAck`,e[e.ProtocolError=6]=`ProtocolError`,e[e.InternalError=7]=`InternalError`})(e.MessageType||={});function h(e){return Array.from(e,e=>new m(e.name,e.type,e.value))}function g(e){let t={type:e.type,flags:e.flags,payload:e.payload};return e.headers&&(t.headers=h(e.headers)),t}var _;(function(e){e[e.None=0]=`None`,e[e.Connecting=1]=`Connecting`,e[e.Connected=2]=`Connected`,e[e.Disconnected=3]=`Disconnected`,e[e.Closed=4]=`Closed`})(_||={});var v=class e extends (0,o.NativeResourceMixin)(s.BufferedEventEmitter){constructor(t){if(t===void 0)throw new c.CrtError(`Invalid configuration passed to eventstream ClientConnection constructor`);super(),this.state=_.None,this._super(f.default.event_stream_client_connection_new(this,t,(t,n)=>{e._s_on_disconnect(t,n)},(t,n)=>{e._s_on_protocol_message(t,n)},t.socketOptions?t.socketOptions.native_handle():null,t.tlsCtx?t.tlsCtx.native_handle():null))}close(){this.state!=_.Closed&&(this.state=_.Closed,f.default.event_stream_client_connection_close(this.native_handle()))}connect(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{if(!t){i(new c.CrtError(`Invalid options passed to event stream ClientConnection.connect`));return}if(this.state!=_.None){i(new c.CrtError(`Event stream connection in a state (${this.state}) where connect() is not allowed.`));return}if(this.state=_.Connecting,t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream connection connect() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t,n){return e._s_on_connection_setup(r,i,t,n)}try{f.default.event_stream_client_connection_connect(this.native_handle(),a)}catch(e){this.state=_.Disconnected,i(e)}});return d.makeSelfCleaningPromise(r,n)})}sendProtocolMessage(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{try{if(!t){i(new c.CrtError(`Invalid options passed to event stream ClientConnection.sendProtocolMessage`));return}if(!this.isConnected()){i(new c.CrtError(`Event stream connection in a state (${this.state}) where sending protocol messages is not allowed.`));return}if(t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream connection sendProtocolMessage() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t){return e._s_on_connection_send_protocol_message_completion(r,i,t)}f.default.event_stream_client_connection_send_protocol_message(this.native_handle(),t,a)}catch(e){i(e)}});return d.makeSelfCleaningPromise(r,n)})}isConnected(){return this.state==_.Connected}newStream(){if(!this.isConnected())throw new c.CrtError(`Event stream connection in a state (${this.state}) where creating new streams is forbidden.`);return new b(this)}on(e,t){return super.on(e,t),this}static _s_on_connection_setup(e,t,n,r){r==0&&n.state==_.Connecting?(n.state=_.Connected,e()):(n.state!=_.Closed&&(n.state=_.Disconnected),t(l.error_code_to_string(r)))}static _s_on_disconnect(e,t){e.state!=_.Closed&&(e.state=_.Disconnected),process.nextTick(()=>{e.emit(`disconnection`,{errorCode:t})})}static _s_on_protocol_message(e,t){process.nextTick(()=>{e.emit(`protocolMessage`,{message:g(t)})})}static _s_on_connection_send_protocol_message_completion(e,t,n){n==0?e():t(l.error_code_to_string(n))}};e.ClientConnection=v,v.DISCONNECTION=`disconnection`,v.PROTOCOL_MESSAGE=`protocolMessage`;var y;(function(e){e[e.None=0]=`None`,e[e.Activating=1]=`Activating`,e[e.Activated=2]=`Activated`,e[e.Ended=3]=`Ended`,e[e.Closed=4]=`Closed`})(y||={});var b=class e extends (0,o.NativeResourceMixin)(s.BufferedEventEmitter){constructor(t){super(),this._super(f.default.event_stream_client_stream_new(this,t.native_handle(),t=>{e._s_on_stream_ended(t)},(t,n)=>{e._s_on_stream_message(t,n)})),this.state=y.None}close(){this.state!=y.Closed&&(this.state=y.Closed,f.default.event_stream_client_stream_close(this.native_handle()))}activate(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{try{if(this.state!=y.None){i(new c.CrtError(`Event stream in a state (${this.state}) where activation is not allowed.`));return}if(t===void 0){this.state=y.Ended,i(new c.CrtError(`Invalid options passed to ClientStream.activate`));return}if(this.state=y.Activating,t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream activate() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t,n){return e._s_on_stream_activated(r,i,t,n)}f.default.event_stream_client_stream_activate(this.native_handle(),t,a)}catch(e){this.state=y.Ended,i(e)}});return d.makeSelfCleaningPromise(r,n)})}sendMessage(t){return i(this,void 0,void 0,function*(){let n,r=new Promise((r,i)=>{try{if(!t){i(new c.CrtError(`Invalid options passed to ClientStream.sendMessage`));return}if(this.state!=y.Activated){i(new c.CrtError(`Event stream in a state (${this.state}) where sending messages is not allowed.`));return}if(t.cancelController&&(n=t.cancelController.addListener(()=>{i(new c.CrtError(`Event stream sendMessage() cancelled by external request.`)),setImmediate(()=>{this.close()})}),!n))return;function a(t){return e._s_on_stream_send_message_completion(r,i,t)}f.default.event_stream_client_stream_send_message(this.native_handle(),t,a)}catch(e){i(e)}});return d.makeSelfCleaningPromise(r,n)})}isActive(){return this.state==y.Activated}on(e,t){return super.on(e,t),this}static _s_on_stream_activated(e,t,n,r){r==0&&n.state==y.Activating?(n.state=y.Activated,e()):(n.state!=y.Closed&&(n.state=y.Ended),t(l.error_code_to_string(r)))}static _s_on_stream_send_message_completion(e,t,n){n==0?e():t(l.error_code_to_string(n))}static _s_on_stream_ended(t){process.nextTick(()=>{t.emit(e.ENDED,{})})}static _s_on_stream_message(t,n){process.nextTick(()=>{t.emit(e.MESSAGE,{message:g(n)})})}};e.ClientStream=b,b.ENDED=`ended`,b.MESSAGE=`message`})),Qc=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CommonHttpProxyOptions=e.HttpProxyAuthenticationType=e.HttpVersion=void 0,(function(e){e[e.Unknown=0]=`Unknown`,e[e.Http1_0=1]=`Http1_0`,e[e.Http1_1=2]=`Http1_1`,e[e.Http2=3]=`Http2`})(e.HttpVersion||={});var t;(function(e){e[e.None=0]=`None`,e[e.Basic=1]=`Basic`})(t=e.HttpProxyAuthenticationType||={}),e.CommonHttpProxyOptions=class{constructor(e,n,r=t.None,i,a){this.host_name=e,this.port=n,this.auth_method=r,this.auth_username=i,this.auth_password=a}}})),$c=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.HttpClientConnectionManager=e.HttpClientStream=e.HttpStream=e.HttpClientConnection=e.HttpProxyOptions=e.HttpProxyConnectionType=e.HttpConnection=e.HttpRequest=e.HttpHeaders=e.HttpProxyAuthenticationType=void 0;let n=t(Bc()),r=Hc(),i=Vc(),a=Qc();var o=Qc();Object.defineProperty(e,`HttpProxyAuthenticationType`,{enumerable:!0,get:function(){return o.HttpProxyAuthenticationType}});let s=Yc();e.HttpHeaders=n.default.HttpHeaders;let c=n.default.HttpRequest;e.HttpRequest=class extends c{constructor(e,t,n,r){super(e,t,n,r?.native_handle())}};var l=class extends (0,r.NativeResourceMixin)(s.BufferedEventEmitter){constructor(e){super(),this._super(e)}close(){n.default.http_connection_close(this.native_handle())}on(e,t){return super.on(e,t),e==`connect`&&process.nextTick(()=>{this.uncork()}),this}};e.HttpConnection=l,l.CONNECT=`connect`,l.ERROR=`error`,l.CLOSE=`close`;var u;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Forwarding=1]=`Forwarding`,e[e.Tunneling=2]=`Tunneling`})(u=e.HttpProxyConnectionType||={}),e.HttpProxyOptions=class extends a.CommonHttpProxyOptions{constructor(e,t,n=a.HttpProxyAuthenticationType.None,r,i,o,s){super(e,t,n,r,i),this.tls_opts=o,this.connection_type=s}create_native_handle(){return n.default.http_proxy_options_new(this.host_name,this.port,this.auth_method,this.auth_username,this.auth_password,this.tls_opts?this.tls_opts.native_handle():void 0,this.connection_type?this.connection_type:u.Legacy)}};var d=class extends l{_on_setup(e,t){if(t){this.emit(`error`,new i.CrtError(t));return}this.emit(`connect`)}_on_shutdown(e,t){if(t){this.emit(`error`,new i.CrtError(t));return}this.emit(`close`)}constructor(e,t,r,a,o,s,c){if(a==null||a==null)throw new i.CrtError(`HttpClientConnection constructor: socket_options not defined`);super(c||n.default.http_connection_new(e==null?null:e.native_handle(),(e,t)=>{this._on_setup(e,t)},(e,t)=>{this._on_shutdown(e,t)},t,r,a.native_handle(),o?o.native_handle():void 0,s?s.create_native_handle():void 0)),this.bootstrap=e,this.socket_options=a,this.tls_opts=o}request(e){let t;return t=new p(n.default.http_stream_new(this.native_handle(),e,e=>{t._on_complete(e)},(e,n)=>{t._on_response(e,n)},e=>{t._on_body(e)}),this,e)}};e.HttpClientConnection=d;var f=class extends (0,r.NativeResourceMixin)(s.BufferedEventEmitter){constructor(e,t){super(),this.connection=t,this._super(e),this.cork()}activate(){n.default.http_stream_activate(this.native_handle())}close(){n.default.http_stream_close(this.native_handle())}_on_body(e){this.emit(`data`,e)}_on_complete(e){if(e){this.emit(`error`,new i.CrtError(e)),this.close();return}this.on(`end`,()=>{this.close()}),this.emit(`end`)}};e.HttpStream=f;var p=class extends f{constructor(e,t,n){super(e,t),this.request=n}status_code(){return this.response_status_code}on(e,t){return super.on(e,t),e==`response`&&process.nextTick(()=>{this.uncork()}),this}_on_response(t,n){this.response_status_code=t;let r=new e.HttpHeaders(n);this.emit(`response`,t,r)}};e.HttpClientStream=p,p.RESPONSE=`response`,p.DATA=`data`,p.ERROR=`error`,p.END=`end`,p.HEADERS=`headers`,e.HttpClientConnectionManager=class extends r.NativeResource{constructor(e,t,r,a,o,s,c,l){if(s==null||s==null)throw new i.CrtError(`HttpClientConnectionManager constructor: socket_options not defined`);super(n.default.http_connection_manager_new(e==null?null:e.native_handle(),t,r,a,o,s.native_handle(),c?c.native_handle():void 0,l?l.create_native_handle():void 0,void 0)),this.bootstrap=e,this.host=t,this.port=r,this.max_connections=a,this.initial_window_size=o,this.socket_options=s,this.tls_opts=c,this.proxy_options=l,this.connections=new Map}acquire(){return new Promise((e,t)=>{n.default.http_connection_manager_acquire(this.native_handle(),(n,r)=>{if(r){t(new i.CrtError(r));return}let a=this.connections.get(n);a||(a=new d(this.bootstrap,this.host,this.port,this.socket_options,this.tls_opts,this.proxy_options,n),this.connections.set(n,a),a.on(`close`,()=>{this.connections.delete(n)})),e(a)})})}release(e){if(e==null||e==null)throw new i.CrtError(`HttpClientConnectionManager release: connection not defined`);n.default.http_connection_manager_release(this.native_handle(),e.native_handle())}close(){n.default.http_connection_manager_close(this.native_handle())}}})),el=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_RECONNECT_MIN_SEC=e.DEFAULT_RECONNECT_MAX_SEC=e.MqttWill=e.QoS=void 0,(function(e){e[e.AtMostOnce=0]=`AtMostOnce`,e[e.AtLeastOnce=1]=`AtLeastOnce`,e[e.ExactlyOnce=2]=`ExactlyOnce`})(e.QoS||={}),e.MqttWill=class{constructor(e,t,n,r=!1){this.topic=e,this.qos=t,this.payload=n,this.retain=r}},e.DEFAULT_RECONNECT_MAX_SEC=128,e.DEFAULT_RECONNECT_MIN_SEC=1})),tl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.set_defined_property=void 0;function t(e,t,n){return n===void 0||n==null?!1:(e[t]=n,!0)}e.set_defined_property=t})),nl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.extractRegionFromEndpoint=e.buildMqtt5FinalUsername=e.canonicalizeCustomAuthConfig=e.canonicalizeCustomAuthTokenSignature=e.populate_username_string_with_custom_authorizer=e.is_string_and_not_empty=e.add_to_username_parameter=void 0;let i=r(Rc()),a=r(tl());function o(e,t,n){let r=e;return r.indexOf(`?`)==-1?r+=`?`:r+=`&`,t.indexOf(n)==-1?r+n+t:r+t}e.add_to_username_parameter=o;function s(e){return e!=null&&typeof e==`string`&&e!=``}e.is_string_and_not_empty=s;function c(e,t,n,r,i,a,c){let l=``;if(e&&(l+=e),s(t)==0?s(i)&&i&&(l+=i):l+=t,s(n)&&n&&(l=o(l,n,`x-amz-customauthorizer-name=`)),(s(r)||s(c)||s(a))&&(!c||!a||!r))throw Error(`Signing-based custom authentication requires all token-related properties to be set`);return s(r)&&r&&(l=o(l,r,`x-amz-customauthorizer-signature=`)),s(c)&&s(a)&&(l=o(l,c,a+`=`)),l}e.populate_username_string_with_custom_authorizer=c;function l(e){if(!(e===void 0||e==null))return e.indexOf(`%`)==-1?encodeURIComponent(e):e}e.canonicalizeCustomAuthTokenSignature=l;function u(e){let t={};return a.set_defined_property(t,`authorizerName`,e.authorizerName),a.set_defined_property(t,`username`,e.username),a.set_defined_property(t,`password`,e.password),a.set_defined_property(t,`tokenKeyName`,e.tokenKeyName),a.set_defined_property(t,`tokenValue`,e.tokenValue),a.set_defined_property(t,`tokenSignature`,l(e.tokenSignature)),t}e.canonicalizeCustomAuthConfig=u;function d(e,t,n){t&&n.push([e,t])}function f(e){let t=``,n=[];if(e){let r=!1;if((e.tokenValue||e.tokenKeyName||e.tokenSignature)&&(r=!0,!e.tokenValue||!e.tokenKeyName||!e.tokenSignature))throw Error(`Token-based custom authentication requires all token-related properties to be set`);let i=(e.username??``).split(`?`),a=i.slice(1);if(t=i[0],a.length>1)throw Error(`Custom auth username property value is invalid`);a.length==1&&a[0].split(`&`).forEach((e,t,r)=>{let i=e.split(`=`);n.push([i[0],i[1]??``])}),d(`x-amz-customauthorizer-name`,e.authorizerName,n),r&&(d(e.tokenKeyName,e.tokenValue,n),d(`x-amz-customauthorizer-signature`,e.tokenSignature,n))}return n.push([`SDK`,`NodeJSv2`]),n.push([`Version`,i.crt_version()]),(t??``)+`?`+n.map(e=>`${e[0]}=${e[1]}`).join(`&`)}e.buildMqtt5FinalUsername=f;function p(e){let t=e.match(/^[\w\-]+\.[\w\-]+\.([\w+\-]+)\./);if(t)return t[1];throw Error(`AWS region could not be extracted from endpoint. Use 'region' property on WebsocketConfig to set manually.`)}e.extractRegionFromEndpoint=p})),rl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsIotMqttConnectionConfigBuilder=void 0;let a=el(),o=r(Wc()),s=Wc(),c=r(Rc()),l=Vc(),u=Gc(),d=r(nl());e.AwsIotMqttConnectionConfigBuilder=class e{constructor(e){this.tls_ctx_options=e,this.params={client_id:``,host_name:``,socket_options:new o.SocketOptions,port:8883,use_websocket:!1,clean_session:!1,keep_alive:void 0,will:void 0,username:``,password:void 0,tls_ctx:void 0,reconnect_min_sec:a.DEFAULT_RECONNECT_MIN_SEC,reconnect_max_sec:a.DEFAULT_RECONNECT_MAX_SEC},this.is_using_custom_authorizer=!1}static new_mtls_builder_from_path(t,n){let r=new e(s.TlsContextOptions.create_client_with_mtls_from_path(t,n));return r.params.port=8883,o.is_alpn_available()&&r.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static new_mtls_builder(t,n){let r=new e(s.TlsContextOptions.create_client_with_mtls(t,n));return r.params.port=8883,o.is_alpn_available()&&r.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static new_mtls_pkcs11_builder(t){let n=new e(s.TlsContextOptions.create_client_with_mtls_pkcs11(t));return n.params.port=8883,o.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),n}static new_mtls_pkcs12_builder(t){let n=new e(s.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(t.pkcs12_file,t.pkcs12_password));return n.params.port=8883,o.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),n}static new_mtls_windows_cert_store_path_builder(t){let n=new e(s.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(t));return n.params.port=8883,o.is_alpn_available()&&n.tls_ctx_options.alpn_list.unshift(`x-amzn-mqtt-ca`),n}static new_default_builder(){return new e(new o.TlsContextOptions)}static new_websocket_builder(...e){return this.new_with_websockets(...e)}static configure_websocket_handshake(e,t){if(t){if(e==null||e==null)throw new l.CrtError(`AwsIotMqttConnectionConfigBuilder configure_websocket_handshake: builder not defined`);e.params.websocket_handshake_transform=(e,n)=>i(this,void 0,void 0,function*(){let r=t.create_signing_config?.call(t)??{algorithm:u.AwsSigningAlgorithm.SigV4,signature_type:u.AwsSignatureType.HttpRequestViaQueryParams,provider:t.credentials_provider,region:t.region,service:t.service??`iotdevicegateway`,signed_body_value:u.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};try{yield(0,u.aws_sign_request)(e,r),n()}catch(e){e instanceof l.CrtError?n(e.error_code):n(3)}})}return e}static new_with_websockets(t){let n=t?.tls_ctx_options;n||(n=new s.TlsContextOptions,n.alpn_list=[]);let r=new e(n);return r.params.use_websocket=!0,r.params.proxy_options=t?.proxy_options,r.tls_ctx_options&&(r.params.port=443),this.configure_websocket_handshake(r,t),r}static new_builder_for_websocket(){return this.new_with_websockets()}with_certificate_authority_from_path(e,t){return this.tls_ctx_options.override_default_trust_store_from_path(e,t),this}with_certificate_authority(e){return this.tls_ctx_options.override_default_trust_store(e),this}with_tls_cipher_preference(e){return this.tls_ctx_options.tls_cipher_preference=e,this}with_endpoint(e){return this.params.host_name=e,this}with_port(e){return this.params.port=e,this}with_client_id(e){return this.params.client_id=e,this}with_clean_session(e){return this.params.clean_session=e,this}with_keep_alive_seconds(e){return this.params.keep_alive=e,this}with_timeout_ms(e){return this.with_ping_timeout_ms(e),this}with_ping_timeout_ms(e){return this.params.ping_timeout=e,this}with_protocol_operation_timeout_ms(e){return this.params.protocol_operation_timeout=e,this}with_will(e){return this.params.will=e,this}with_socket_options(e){return this.params.socket_options=e,this}with_credentials(t,n,r,i){return e.configure_websocket_handshake(this,{credentials_provider:u.AwsCredentialsProvider.newStatic(n,r,i),region:t,service:`iotdevicegateway`})}with_http_proxy_options(e){return this.params.proxy_options=e,this}with_custom_authorizer(e,t,n,r,i,a){this.is_using_custom_authorizer=!0;let o=d.canonicalizeCustomAuthTokenSignature(n),s=d.populate_username_string_with_custom_authorizer(``,e,t,o,this.params.username,i,a);return this.params.username=s,this.params.password=r,this.params.use_websocket||(this.tls_ctx_options.alpn_list=[`mqtt`]),this.params.port=443,this}with_username(e){return this.params.username=e,this}with_password(e){return this.params.password=e,this}with_reconnect_max_sec(e){return this.params.reconnect_max_sec=e,this}with_reconnect_min_sec(e){return this.params.reconnect_min_sec=e,this}build(){if(this.params.client_id===void 0||this.params.host_name===void 0)throw`client_id and endpoint are required`;return this.is_using_custom_authorizer==0&&d.is_string_and_not_empty(this.params.username)&&(this.params.username?.indexOf(`x-amz-customauthorizer-name=`)!=-1||this.params.username?.indexOf(`x-amz-customauthorizer-signature=`)!=-1)&&(this.is_using_custom_authorizer=!0),this.is_using_custom_authorizer==1&&this.params.port!=443&&console.log(`Warning: Attempting to connect to authorizer with unsupported port. Port is not 443...`),this.params.tls_ctx===void 0&&(this.params.tls_ctx=new o.ClientTlsContext(this.tls_ctx_options)),d.is_string_and_not_empty(this.params.username)==0?this.params.username=`?SDK=NodeJSv2&Version=`:this.params.username?.indexOf(`?`)==-1?this.params.username+=`?SDK=NodeJSv2&Version=`:this.params.username+=`&SDK=NodeJSv2&Version=`,this.params.username+=c.crt_version(),this.params}}})),il=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isValidTopic=e.isValidTopicFilter=e.DEFAULT_KEEP_ALIVE=e.normalize_payload_to_buffer=e.normalize_payload=void 0;function t(e){if(e instanceof Buffer||typeof e==`string`)return e;if(ArrayBuffer.isView(e)){let t=e;return Buffer.from(t.buffer,t.byteOffset,t.byteLength)}if(e instanceof ArrayBuffer)return Buffer.from(e);if(typeof e==`object`)return JSON.stringify(e);if(!e)return``;throw TypeError(`payload parameter must be a string, object, or DataView.`)}e.normalize_payload=t;function n(e){let n=t(e);return typeof n==`string`?Buffer.from(n):n}e.normalize_payload_to_buffer=n,e.DEFAULT_KEEP_ALIVE=1200;function r(e,t){if(e.length===0||e.length>65535)return!1;let n=!1;for(let r of e.split(`/`)){if(n)return!1;if(r.length!==0){if(r.includes(`+`)&&(!t||r.length>1))return!1;if(r.includes(`#`)){if(!t||r.length>1)return!1;n=!0}}}return!0}function i(e){return typeof e==`string`?r(e,!0):!1}e.isValidTopicFilter=i;function a(e){return typeof e==`string`?r(e,!1):!1}e.isValidTopic=a})),al=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InboundTopicAliasBehaviorType=e.OutboundTopicAliasBehaviorType=e.RetryJitterType=e.ClientSessionBehavior=void 0,(function(e){e[e.Default=0]=`Default`,e[e.Clean=1]=`Clean`,e[e.RejoinPostSuccess=2]=`RejoinPostSuccess`,e[e.RejoinAlways=3]=`RejoinAlways`})(e.ClientSessionBehavior||={}),(function(e){e[e.Default=0]=`Default`,e[e.None=1]=`None`,e[e.Full=2]=`Full`,e[e.Decorrelated=3]=`Decorrelated`})(e.RetryJitterType||={}),(function(e){e[e.Default=0]=`Default`,e[e.Manual=1]=`Manual`,e[e.LRU=2]=`LRU`,e[e.Disabled=3]=`Disabled`})(e.OutboundTopicAliasBehaviorType||={}),(function(e){e[e.Default=0]=`Default`,e[e.Enabled=1]=`Enabled`,e[e.Disabled=2]=`Disabled`})(e.InboundTopicAliasBehaviorType||={})})),ol=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.PacketType=e.RetainHandlingType=e.QoS=e.PayloadFormatIndicator=e.isSuccessfulPubackReasonCode=e.PubackReasonCode=e.isSuccessfulUnsubackReasonCode=e.UnsubackReasonCode=e.isSuccessfulSubackReasonCode=e.SubackReasonCode=e.isSuccessfulDisconnectReasonCode=e.DisconnectReasonCode=e.isSuccessfulConnectReasonCode=e.ConnectReasonCode=void 0,(function(e){e[e.Success=0]=`Success`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.MalformedPacket=129]=`MalformedPacket`,e[e.ProtocolError=130]=`ProtocolError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.UnsupportedProtocolVersion=132]=`UnsupportedProtocolVersion`,e[e.ClientIdentifierNotValid=133]=`ClientIdentifierNotValid`,e[e.BadUsernameOrPassword=134]=`BadUsernameOrPassword`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.ServerUnavailable=136]=`ServerUnavailable`,e[e.ServerBusy=137]=`ServerBusy`,e[e.Banned=138]=`Banned`,e[e.BadAuthenticationMethod=140]=`BadAuthenticationMethod`,e[e.TopicNameInvalid=144]=`TopicNameInvalid`,e[e.PacketTooLarge=149]=`PacketTooLarge`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.PayloadFormatInvalid=153]=`PayloadFormatInvalid`,e[e.RetainNotSupported=154]=`RetainNotSupported`,e[e.QosNotSupported=155]=`QosNotSupported`,e[e.UseAnotherServer=156]=`UseAnotherServer`,e[e.ServerMoved=157]=`ServerMoved`,e[e.ConnectionRateExceeded=159]=`ConnectionRateExceeded`})(e.ConnectReasonCode||={});function t(e){return e<128}e.isSuccessfulConnectReasonCode=t,(function(e){e[e.NormalDisconnection=0]=`NormalDisconnection`,e[e.DisconnectWithWillMessage=4]=`DisconnectWithWillMessage`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.MalformedPacket=129]=`MalformedPacket`,e[e.ProtocolError=130]=`ProtocolError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.ServerBusy=137]=`ServerBusy`,e[e.ServerShuttingDown=139]=`ServerShuttingDown`,e[e.KeepAliveTimeout=141]=`KeepAliveTimeout`,e[e.SessionTakenOver=142]=`SessionTakenOver`,e[e.TopicFilterInvalid=143]=`TopicFilterInvalid`,e[e.TopicNameInvalid=144]=`TopicNameInvalid`,e[e.ReceiveMaximumExceeded=147]=`ReceiveMaximumExceeded`,e[e.TopicAliasInvalid=148]=`TopicAliasInvalid`,e[e.PacketTooLarge=149]=`PacketTooLarge`,e[e.MessageRateTooHigh=150]=`MessageRateTooHigh`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.AdministrativeAction=152]=`AdministrativeAction`,e[e.PayloadFormatInvalid=153]=`PayloadFormatInvalid`,e[e.RetainNotSupported=154]=`RetainNotSupported`,e[e.QosNotSupported=155]=`QosNotSupported`,e[e.UseAnotherServer=156]=`UseAnotherServer`,e[e.ServerMoved=157]=`ServerMoved`,e[e.SharedSubscriptionsNotSupported=158]=`SharedSubscriptionsNotSupported`,e[e.ConnectionRateExceeded=159]=`ConnectionRateExceeded`,e[e.MaximumConnectTime=160]=`MaximumConnectTime`,e[e.SubscriptionIdentifiersNotSupported=161]=`SubscriptionIdentifiersNotSupported`,e[e.WildcardSubscriptionsNotSupported=162]=`WildcardSubscriptionsNotSupported`})(e.DisconnectReasonCode||={});function n(e){return e<128}e.isSuccessfulDisconnectReasonCode=n,(function(e){e[e.GrantedQoS0=0]=`GrantedQoS0`,e[e.GrantedQoS1=1]=`GrantedQoS1`,e[e.GrantedQoS2=2]=`GrantedQoS2`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.TopicFilterInvalid=143]=`TopicFilterInvalid`,e[e.PacketIdentifierInUse=145]=`PacketIdentifierInUse`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.SharedSubscriptionsNotSupported=158]=`SharedSubscriptionsNotSupported`,e[e.SubscriptionIdentifiersNotSupported=161]=`SubscriptionIdentifiersNotSupported`,e[e.WildcardSubscriptionsNotSupported=162]=`WildcardSubscriptionsNotSupported`})(e.SubackReasonCode||={});function r(e){return e<128}e.isSuccessfulSubackReasonCode=r,(function(e){e[e.Success=0]=`Success`,e[e.NoSubscriptionExisted=17]=`NoSubscriptionExisted`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.TopicFilterInvalid=143]=`TopicFilterInvalid`,e[e.PacketIdentifierInUse=145]=`PacketIdentifierInUse`})(e.UnsubackReasonCode||={});function i(e){return e<128}e.isSuccessfulUnsubackReasonCode=i,(function(e){e[e.Success=0]=`Success`,e[e.NoMatchingSubscribers=16]=`NoMatchingSubscribers`,e[e.UnspecifiedError=128]=`UnspecifiedError`,e[e.ImplementationSpecificError=131]=`ImplementationSpecificError`,e[e.NotAuthorized=135]=`NotAuthorized`,e[e.TopicNameInvalid=144]=`TopicNameInvalid`,e[e.PacketIdentifierInUse=145]=`PacketIdentifierInUse`,e[e.QuotaExceeded=151]=`QuotaExceeded`,e[e.PayloadFormatInvalid=153]=`PayloadFormatInvalid`})(e.PubackReasonCode||={});function a(e){return e<128}e.isSuccessfulPubackReasonCode=a,(function(e){e[e.Bytes=0]=`Bytes`,e[e.Utf8=1]=`Utf8`})(e.PayloadFormatIndicator||={}),(function(e){e[e.AtMostOnce=0]=`AtMostOnce`,e[e.AtLeastOnce=1]=`AtLeastOnce`,e[e.ExactlyOnce=2]=`ExactlyOnce`})(e.QoS||={}),(function(e){e[e.SendOnSubscribe=0]=`SendOnSubscribe`,e[e.SendOnSubscribeIfNew=1]=`SendOnSubscribeIfNew`,e[e.DontSend=2]=`DontSend`})(e.RetainHandlingType||={}),(function(e){e[e.Connect=1]=`Connect`,e[e.Connack=2]=`Connack`,e[e.Publish=3]=`Publish`,e[e.Puback=4]=`Puback`,e[e.Pubrec=5]=`Pubrec`,e[e.Pubrel=6]=`Pubrel`,e[e.Pubcomp=7]=`Pubcomp`,e[e.Subscribe=8]=`Subscribe`,e[e.Suback=9]=`Suback`,e[e.Unsubscribe=10]=`Unsubscribe`,e[e.Unsuback=11]=`Unsuback`,e[e.Pingreq=12]=`Pingreq`,e[e.Pingresp=13]=`Pingresp`,e[e.Disconnect=14]=`Disconnect`,e[e.Auth=15]=`Auth`})(e.PacketType||={})})),sl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)},a=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.Mqtt5Client=e.ClientExtendedValidationAndFlowControl=e.ClientOperationQueueBehavior=e.HttpProxyOptions=void 0;let s=o(Bc()),c=Hc(),l=Yc(),u=r(Wc()),d=r(il()),f=Vc();var p=$c();Object.defineProperty(e,`HttpProxyOptions`,{enumerable:!0,get:function(){return p.HttpProxyOptions}}),i(al(),e),i(ol(),e),(function(e){e[e.Default=0]=`Default`,e[e.FailNonQos1PublishOnDisconnect=1]=`FailNonQos1PublishOnDisconnect`,e[e.FailQos0PublishOnDisconnect=2]=`FailQos0PublishOnDisconnect`,e[e.FailAllOnDisconnect=3]=`FailAllOnDisconnect`})(e.ClientOperationQueueBehavior||={}),(function(e){e[e.None=0]=`None`,e[e.AwsIotCoreDefaults=1]=`AwsIotCoreDefaults`})(e.ClientExtendedValidationAndFlowControl||={});var m=class e extends (0,c.NativeResourceMixin)(l.BufferedEventEmitter){constructor(t){super(),this._super(s.default.mqtt5_client_new(this,t,t=>{e._s_on_stopped(t)},t=>{e._s_on_attempting_connect(t)},(t,n,r)=>{e._s_on_connection_success(t,n,r)},(t,n,r)=>{e._s_on_connection_failure(t,new f.CrtError(n),r)},(t,n,r)=>{e._s_on_disconnection(t,new f.CrtError(n),r)},(t,n)=>{e._s_on_message_received(t,n)},t.clientBootstrap?t.clientBootstrap.native_handle():null,t.socketOptions?t.socketOptions.native_handle():null,t.tlsCtx?t.tlsCtx.native_handle():null,t.httpProxyOptions?t.httpProxyOptions.create_native_handle():null))}close(){s.default.mqtt5_client_close(this.native_handle())}start(){s.default.mqtt5_client_start(this.native_handle())}stop(e){s.default.mqtt5_client_stop(this.native_handle(),e)}subscribe(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{function i(t,i,a){return e._s_on_suback_callback(n,r,t,i,a)}try{s.default.mqtt5_client_subscribe(this.native_handle(),t,i)}catch(e){r(e)}})})}unsubscribe(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{function i(t,i,a){return e._s_on_unsuback_callback(n,r,t,i,a)}try{s.default.mqtt5_client_unsubscribe(this.native_handle(),t,i)}catch(e){r(e)}})})}publish(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{t&&t.payload&&(t.payload=d.normalize_payload(t.payload));function i(t,i,a){return e._s_on_puback_callback(n,r,t,i,a)}try{s.default.mqtt5_client_publish(this.native_handle(),t,i)}catch(e){r(e)}})})}getOperationalStatistics(){return s.default.mqtt5_client_get_queue_statistics(this.native_handle())}getQueueStatistics(){return this.getOperationalStatistics()}on(e,t){return super.on(e,t),this}static _s_on_stopped(t){process.nextTick(()=>{t.emit(e.STOPPED,{})})}static _s_on_attempting_connect(t){process.nextTick(()=>{t.emit(e.ATTEMPTING_CONNECT,{})})}static _s_on_connection_success(t,n,r){let i={connack:n,settings:r};process.nextTick(()=>{t.emit(e.CONNECTION_SUCCESS,i)})}static _s_on_connection_failure(t,n,r){let i={error:n};r!=null&&(i.connack=r),process.nextTick(()=>{t.emit(e.CONNECTION_FAILURE,i)})}static _s_on_disconnection(t,n,r){let i={error:n};r!=null&&(i.disconnect=r),process.nextTick(()=>{t.emit(e.DISCONNECTION,i)})}static _s_on_suback_callback(e,t,n,r,i){r==0&&i!==void 0?e(i):t(u.error_code_to_string(r))}static _s_on_unsuback_callback(e,t,n,r,i){r==0&&i!==void 0?e(i):t(u.error_code_to_string(r))}static _s_on_puback_callback(e,t,n,r,i){r==0?e(i):t(u.error_code_to_string(r))}static _s_on_message_received(t,n){let r={message:n};process.nextTick(()=>{t.emit(e.MESSAGE_RECEIVED,r)})}};e.Mqtt5Client=m,m.ERROR=`error`,m.MESSAGE_RECEIVED=`messageReceived`,m.ATTEMPTING_CONNECT=`attemptingConnect`,m.CONNECTION_SUCCESS=`connectionSuccess`,m.CONNECTION_FAILURE=`connectionFailure`,m.DISCONNECTION=`disconnection`,m.STOPPED=`stopped`})),cl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsIotMqtt5ClientConfigBuilder=void 0;let a=r(sl()),o=r(Wc()),s=r(Gc()),c=Vc(),l=r(nl()),u=r(il());var d=class e{constructor(e,t,n){this.tlsContextOptions=n,this.config={hostName:e,port:t,connectProperties:{keepAliveIntervalSeconds:u.DEFAULT_KEEP_ALIVE},extendedValidationAndFlowControlOptions:a.ClientExtendedValidationAndFlowControl.AwsIotCoreDefaults}}static newDirectMqttBuilderWithMtlsFromPath(t,n,r){let i=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_from_path(n,r));return o.is_alpn_available()&&i.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),i}static newDirectMqttBuilderWithMtlsFromMemory(t,n,r){let i=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls(n,r));return o.is_alpn_available()&&i.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),i}static newDirectMqttBuilderWithMtlsFromPkcs11(t,n){let r=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_pkcs11(n));return o.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static newDirectMqttBuilderWithMtlsFromPkcs12(t,n){let r=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_pkcs12_from_path(n.pkcs12_file,n.pkcs12_password));return o.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static newDirectMqttBuilderWithMtlsFromWindowsCertStorePath(t,n){let r=new e(t,e.DEFAULT_DIRECT_MQTT_PORT,o.TlsContextOptions.create_client_with_mtls_windows_cert_store_path(n));return o.is_alpn_available()&&r.tlsContextOptions.alpn_list.unshift(`x-amzn-mqtt-ca`),r}static newDirectMqttBuilderWithCustomAuth(t,n){let r=new e(t,e.DEFAULT_WEBSOCKET_MQTT_PORT,new o.TlsContextOptions);return r.customAuthConfig=l.canonicalizeCustomAuthConfig(n),r.tlsContextOptions.alpn_list=[`mqtt`],r}static newWebsocketMqttBuilderWithSigv4Auth(t,n){let r=new o.TlsContextOptions;r.alpn_list=[];let a=new e(t,e.DEFAULT_WEBSOCKET_MQTT_PORT,r),u=n?.credentialsProvider;return u||=s.AwsCredentialsProvider.newDefault(),a.config.websocketHandshakeTransform=(e,r)=>i(this,void 0,void 0,function*(){try{let i={algorithm:s.AwsSigningAlgorithm.SigV4,signature_type:s.AwsSignatureType.HttpRequestViaQueryParams,provider:u,region:n?.region??l.extractRegionFromEndpoint(t),service:`iotdevicegateway`,signed_body_value:s.AwsSignedBodyValue.EmptySha256,omit_session_token:!0};yield s.aws_sign_request(e,i),r()}catch(e){e instanceof c.CrtError?r(e.error_code):r(3)}}),a}static newWebsocketMqttBuilderWithCustomAuth(t,n){let r=new e(t,e.DEFAULT_WEBSOCKET_MQTT_PORT,new o.TlsContextOptions);return r.customAuthConfig=n,r.config.websocketHandshakeTransform=(e,t)=>i(this,void 0,void 0,function*(){t(0)}),r}withCertificateAuthorityFromPath(e,t){return this.tlsContextOptions.override_default_trust_store_from_path(e,t),this}withCertificateAuthority(e){return this.tlsContextOptions.override_default_trust_store(e),this}withTlsCipherPreference(e){return this.tlsContextOptions.tls_cipher_preference=e,this}withPort(e){return this.config.port=e,this}withConnectProperties(e){return this.config.connectProperties=e,this}withSessionBehavior(e){return this.config.sessionBehavior=e,this}withRetryJitterMode(e){return this.config.retryJitterMode=e,this}withMinReconnectDelayMs(e){return this.config.minReconnectDelayMs=e,this}withMaxReconnectDelayMs(e){return this.config.maxReconnectDelayMs=e,this}withMinConnectedTimeToResetReconnectDelayMs(e){return this.config.minConnectedTimeToResetReconnectDelayMs=e,this}withConnackTimeoutMs(e){return this.config.connackTimeoutMs=e,this}withOfflineQueueBehavior(e){return this.config.offlineQueueBehavior=e,this}withPingTimeoutMs(e){return this.config.pingTimeoutMs=e,this}withAckTimeoutSeconds(e){return this.config.ackTimeoutSeconds=e,this}withSocketOptions(e){return this.config.socketOptions=e,this}withHttpProxyOptions(e){return this.config.httpProxyOptions=e,this}withExtendedValidationAndFlowControlOptions(e){return this.config.extendedValidationAndFlowControlOptions=e,this}withTopicAliasingOptions(e){return this.config.topicAliasingOptions=e,this}build(){return this.config.tlsCtx===void 0&&(this.config.tlsCtx=new o.ClientTlsContext(this.tlsContextOptions)),this.config.connectProperties&&(this.config.connectProperties.username=l.buildMqtt5FinalUsername(this.customAuthConfig),this.customAuthConfig?.password&&(this.config.connectProperties.password=this.customAuthConfig?.password)),this.config}};e.AwsIotMqtt5ClientConfigBuilder=d,d.DEFAULT_WEBSOCKET_MQTT_PORT=443,d.DEFAULT_DIRECT_MQTT_PORT=8883})),ll=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,`__esModule`,{value:!0}),n(rl(),e),n(cl(),e)})),ul=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.MqttClientConnection=e.MqttClient=e.MqttWill=e.QoS=e.HttpProxyOptions=void 0;let o=a(Bc()),s=Hc(),c=Yc(),l=r(il()),u=Vc(),d=r(Wc());var f=$c();Object.defineProperty(e,`HttpProxyOptions`,{enumerable:!0,get:function(){return f.HttpProxyOptions}});let p=el();var m=el();Object.defineProperty(e,`QoS`,{enumerable:!0,get:function(){return m.QoS}}),Object.defineProperty(e,`MqttWill`,{enumerable:!0,get:function(){return m.MqttWill}}),e.MqttClient=class extends s.NativeResource{constructor(e=void 0){super(o.default.mqtt_client_new(e==null?null:e.native_handle())),this.bootstrap=e}new_connection(e){return new h(this,e)}};var h=class extends (0,s.NativeResourceMixin)(c.BufferedEventEmitter){constructor(e,t){if(super(),this.client=e,this.config=t,t==null||t==null)throw new u.CrtError(`MqttClientConnection constructor: config not defined`);let n=t.will?{topic:t.will.topic,qos:t.will.qos,payload:l.normalize_payload(t.will.payload),retain:t.will.retain}:void 0;var r=p.DEFAULT_RECONNECT_MIN_SEC,i=p.DEFAULT_RECONNECT_MAX_SEC;if(t.reconnect_min_sec&&(r=t.reconnect_min_sec,i=Math.max(r,i)),t.reconnect_max_sec&&(i=t.reconnect_max_sec,r=Math.min(r,i)),e==null||e==null)throw new u.CrtError(`MqttClientConnection constructor: client not defined`);if(t.socket_options==null||t.socket_options==null)throw new u.CrtError(`MqttClientConnection constructor: socket_options in configuration not defined`);this._super(o.default.mqtt_client_connection_new(e.native_handle(),e=>{this._on_connection_interrupted(e)},(e,t)=>{this._on_connection_resumed(e,t)},(e,t)=>{this._on_connection_success(e,t)},e=>{this._on_connection_failure(e)},t.tls_ctx?t.tls_ctx.native_handle():null,n,t.username,t.password,t.use_websocket,t.proxy_options?t.proxy_options.create_native_handle():void 0,t.websocket_handshake_transform,r,i)),this.tls_ctx=t.tls_ctx,o.default.mqtt_client_connection_on_message(this.native_handle(),this._on_any_publish.bind(this)),o.default.mqtt_client_connection_on_closed(this.native_handle(),this._on_connection_closed.bind(this)),this.on(`error`,e=>{})}close(){o.default.mqtt_client_connection_close(this.native_handle())}on(e,t){return super.on(e,t),e==`connect`&&process.nextTick(()=>{this.uncork()}),this}connect(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{if(t=this._reject(t),this.config.socket_options==null||this.config.socket_options==null)throw new u.CrtError(`MqttClientConnection connect: socket_options in configuration not defined`);try{o.default.mqtt_client_connection_connect(this.native_handle(),this.config.client_id,this.config.host_name,this.config.port,this.config.socket_options.native_handle(),this.config.keep_alive,this.config.ping_timeout,this.config.protocol_operation_timeout,this.config.clean_session,this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}})})}reconnect(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{t=this._reject(t);try{o.default.mqtt_client_connection_reconnect(this.native_handle(),this._on_connect_callback.bind(this,e,t))}catch(e){t(e)}})})}publish(e,t,n,r=!1){return i(this,void 0,void 0,function*(){return typeof e==`string`?typeof n==`number`?typeof r==`boolean`?new Promise((i,a)=>{a=this._reject(a);try{o.default.mqtt_client_connection_publish(this.native_handle(),e,l.normalize_payload(t),n,r,this._on_puback_callback.bind(this,i,a))}catch(e){a(e)}}):Promise.reject(`retain is not a boolean`):Promise.reject(`qos is not a number`):Promise.reject(`topic is not a string`)})}subscribe(e,t,n){return i(this,void 0,void 0,function*(){return typeof e==`string`?typeof t==`number`?new Promise((r,i)=>{i=this._reject(i);try{o.default.mqtt_client_connection_subscribe(this.native_handle(),e,t,n,this._on_suback_callback.bind(this,r,i))}catch(e){i(e)}}):Promise.reject(`qos is not a number`):Promise.reject(`topic is not a string`)})}unsubscribe(e){return i(this,void 0,void 0,function*(){return typeof e==`string`?new Promise((t,n)=>{n=this._reject(n);try{o.default.mqtt_client_connection_unsubscribe(this.native_handle(),e,this._on_unsuback_callback.bind(this,t,n))}catch(e){n(e)}}):Promise.reject(`topic is not a string`)})}disconnect(){return i(this,void 0,void 0,function*(){return new Promise((e,t)=>{t=this._reject(t);try{o.default.mqtt_client_connection_disconnect(this.native_handle(),this._on_disconnect_callback.bind(this,e))}catch(e){t(e)}})})}getOperationalStatistics(){return o.default.mqtt_client_connection_get_queue_statistics(this.native_handle())}getQueueStatistics(){return this.getOperationalStatistics()}_reject(e){return t=>{e(t),process.nextTick(()=>{this.emit(`error`,new u.CrtError(t))})}}_on_connection_failure(e){let t={error:new u.CrtError(e)};this.emit(`connection_failure`,t)}_on_connection_success(e,t){let n={session_present:t,reason_code:e};this.emit(`connection_success`,n)}_on_connection_interrupted(e){this.emit(`interrupt`,new u.CrtError(e))}_on_connection_resumed(e,t){this.emit(`resume`,e,t)}_on_any_publish(e,t,n,r,i){this.emit(`message`,e,t,n,r,i)}_on_connection_closed(){this.emit(`closed`,{}),this.close()}_on_connect_callback(e,t,n,r,i){n==0&&r==0?(e(i),this.emit(`connect`,i)):t(n==0?`Server rejected connection.`:`Failed to connect: `+d.error_code_to_string(n))}_on_puback_callback(e,t,n,r){r==0?e({packet_id:n}):t(`Failed to publish: `+d.error_code_to_string(r))}_on_suback_callback(e,t,n,r,i,a){a==0?e({packet_id:n,topic:r,qos:i,error_code:a}):t(`Failed to subscribe: `+d.error_code_to_string(a))}_on_unsuback_callback(e,t,n,r){r==0?e({packet_id:n}):t(`Failed to unsubscribe: `+d.error_code_to_string(r))}_on_disconnect_callback(e){e(),this.emit(`disconnect`)}};e.MqttClientConnection=h,h.CONNECT=`connect`,h.DISCONNECT=`disconnect`,h.ERROR=`error`,h.INTERRUPT=`interrupt`,h.RESUME=`resume`,h.MESSAGE=`message`,h.CONNECTION_SUCCESS=`connection_success`,h.CONNECTION_FAILURE=`connection_failure`,h.CLOSED=`closed`})),dl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RequestResponseClientState=e.StreamingOperationState=void 0,(function(e){e[e.None=0]=`None`,e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`})(e.StreamingOperationState||={}),(function(e){e[e.Ready=0]=`Ready`,e[e.Closed=1]=`Closed`})(e.RequestResponseClientState||={})})),fl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SubscriptionStatusEventType=void 0,(function(e){e[e.SubscriptionEstablished=0]=`SubscriptionEstablished`,e[e.SubscriptionLost=1]=`SubscriptionLost`,e[e.SubscriptionHalted=2]=`SubscriptionHalted`})(e.SubscriptionStatusEventType||={})})),pl=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=e&&e.__exportStar||function(e,n){for(var r in e)r!==`default`&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)},a=e&&e.__awaiter||function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.RequestResponseClient=e.StreamingOperationBase=void 0;let s=Vc(),c=r(dl()),l=Hc(),u=Yc(),d=o(Bc()),f=Wc();i(fl(),e);var p=class e extends (0,l.NativeResourceMixin)(u.BufferedEventEmitter){static new(t,n){if(!t)throw new s.CrtError(`invalid configuration for streaming operation`);let r=new e(n);return r._super(d.default.mqtt_streaming_operation_new(r,n.native_handle(),t,(t,n,i)=>{e._s_on_subscription_status_update(r,n,i)},(t,n)=>{e._s_on_incoming_publish(r,n)})),n.registerUnclosedStreamingOperation(r),r}constructor(e){super(),this.state=c.StreamingOperationState.None,this.client=e}open(){if(this.state==c.StreamingOperationState.None)this.state=c.StreamingOperationState.Open,d.default.mqtt_streaming_operation_open(this.native_handle());else if(this.state==c.StreamingOperationState.Closed)throw new s.CrtError(`MQTT streaming operation already closed`)}close(){this.state!=c.StreamingOperationState.Closed&&(this.client.unregisterUnclosedStreamingOperation(this),this.state=c.StreamingOperationState.Closed,d.default.mqtt_streaming_operation_close(this.native_handle()))}on(e,t){return super.on(e,t),this}static _s_on_subscription_status_update(t,n,r){let i={type:n};r!=0&&(i.error=new s.CrtError(r)),process.nextTick(()=>{t.emit(e.SUBSCRIPTION_STATUS,i)})}static _s_on_incoming_publish(t,n){process.nextTick(()=>{t.emit(e.INCOMING_PUBLISH,n)})}};e.StreamingOperationBase=p,p.SUBSCRIPTION_STATUS=`subscriptionStatus`,p.INCOMING_PUBLISH=`incomingPublish`,e.RequestResponseClient=class e extends (0,l.NativeResourceMixin)(u.BufferedEventEmitter){constructor(){super(),this.state=c.RequestResponseClientState.Ready,this.unclosedOperations=new Set}static newFromMqtt5(t,n){if(!t)throw new s.CrtError(`protocol client is null`);let r=new e;return r._super(d.default.mqtt_request_response_client_new_from_5(r,t.native_handle(),n)),r}static newFromMqtt311(t,n){if(!t)throw new s.CrtError(`protocol client is null`);let r=new e;return r._super(d.default.mqtt_request_response_client_new_from_311(r,t.native_handle(),n)),r}close(){this.state!=c.RequestResponseClientState.Closed&&(this.state=c.RequestResponseClientState.Closed,this.closeStreamingOperations(),d.default.mqtt_request_response_client_close(this.native_handle()))}createStream(e){if(this.state==c.RequestResponseClientState.Closed)throw new s.CrtError(`MQTT request-response client has already been closed`);return p.new(e,this)}submitRequest(t){return a(this,void 0,void 0,function*(){return new Promise((n,r)=>{if(this.state==c.RequestResponseClientState.Closed){r(new s.CrtError(`MQTT request-response client has already been closed`));return}if(!t){r(new s.CrtError(`null request options`));return}function i(t,i,a){return e._s_on_request_completion(n,r,t,i,a)}try{d.default.mqtt_request_response_client_submit_request(this.native_handle(),t,i)}catch(e){r(e)}})})}registerUnclosedStreamingOperation(e){this.unclosedOperations&&this.unclosedOperations.add(e)}unregisterUnclosedStreamingOperation(e){this.unclosedOperations&&this.unclosedOperations.delete(e)}closeStreamingOperations(){if(this.unclosedOperations){let e=this.unclosedOperations;this.unclosedOperations=void 0;for(let t of e)t.close()}}static _s_on_request_completion(e,t,n,r,i){n==0&&r!==void 0&&i!==void 0?e({payload:i,topic:r}):t(new s.CrtError((0,f.error_code_to_string)(n)))}}})),ml=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var i in e)i!==`default`&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,`__esModule`,{value:!0}),e.CrtError=e.resource_safety=e.promise=e.platform=e.mqtt_request_response=e.mqtt5=e.mqtt=e.iot=e.io=e.http=e.eventstream=e.crt=e.crypto=e.checksums=e.cancel=e.auth=void 0,e.cancel=r(Ic()),e.platform=r(Rc()),e.promise=r(Fc()),e.resource_safety=r(zc()),e.auth=r(Gc()),e.checksums=r(Kc()),e.crt=r(qc()),e.crypto=r(Jc()),e.eventstream=r(Zc()),e.http=r($c()),e.io=r(Wc()),e.iot=r(ll()),e.mqtt=r(ul()),e.mqtt5=r(sl()),e.mqtt_request_response=r(pl());let i=Vc();Object.defineProperty(e,`CrtError`,{enumerable:!0,get:function(){return i.CrtError}})})),hl=u(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isCrtAvailable=void 0,e.isCrtAvailable=()=>{try{return typeof h==`function`&&t!==void 0&&ml()?[`md/crt-avail`]:null}catch{return null}}})),gl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultUserAgent=e.UA_APP_ID_INI_NAME=e.UA_APP_ID_ENV_NAME=void 0;let t=Ws(),n=h(`os`),r=h(`process`),i=hl();e.UA_APP_ID_ENV_NAME=`AWS_SDK_UA_APP_ID`,e.UA_APP_ID_INI_NAME=`sdk-ua-app-id`,e.defaultUserAgent=({serviceId:a,clientVersion:o})=>{let s=[[`aws-sdk-js`,o],[`os/${(0,n.platform)()}`,(0,n.release)()],[`lang/js`],[`md/nodejs`,`${r.versions.node}`]],c=(0,i.isCrtAvailable)();c&&s.push(c),a&&s.push([`api/${a}`,o]),r.env.AWS_EXECUTION_ENV&&s.push([`exec-env/${r.env.AWS_EXECUTION_ENV}`]);let l=(0,t.loadConfig)({environmentVariableSelector:t=>t[e.UA_APP_ID_ENV_NAME],configFileSelector:t=>t[e.UA_APP_ID_INI_NAME],default:void 0})(),u;return async()=>{if(!u){let e=await l;u=e?[...s,[`app/${e}`]]:[...s]}return u}}})),_l=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromBase64=void 0;let t=Xi(),n=/^[A-Za-z0-9+/]*={0,2}$/;e.fromBase64=e=>{if(e.length*3%4!=0)throw TypeError(`Incorrect padding on base64 string.`);if(!n.exec(e))throw TypeError(`Invalid base64 string.`);let r=(0,t.fromString)(e,`base64`);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}})),vl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.toBase64=void 0;let t=Xi();e.toBase64=e=>(0,t.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString(`base64`)})),yl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(_l(),e),t.__exportStar(vl(),e)})),bl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`PartitionResult`,i=`tree`,a=`error`,o=`endpoint`,s={[t]:!1,type:`String`},c={[t]:!0,default:!1,type:`Boolean`},l={ref:`Endpoint`},u={fn:`booleanEquals`,[n]:[{ref:`UseFIPS`},!0]},d={fn:`booleanEquals`,[n]:[{ref:`UseDualStack`},!0]},f={},p={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsFIPS`]}]},m={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsDualStack`]}]},h=[l],g=[u],_=[d];e.ruleSet={version:`1.0`,parameters:{Region:s,UseDualStack:c,UseFIPS:c,Endpoint:s},rules:[{conditions:[{fn:`aws.partition`,[n]:[{ref:`Region`}],assign:r}],type:i,rules:[{conditions:[{fn:`isSet`,[n]:h},{fn:`parseURL`,[n]:h,assign:`url`}],type:i,rules:[{conditions:g,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{type:i,rules:[{conditions:_,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:l,properties:f,headers:f},type:o}]}]},{conditions:[u,d],type:i,rules:[{conditions:[p,m],type:i,rules:[{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}]},{conditions:g,type:i,rules:[{conditions:[p],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}]},{conditions:_,type:i,rules:[{conditions:[m],type:i,rules:[{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}]},{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]}})),xl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=bl();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),Sl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=xl();e.getRuntimeConfig=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`SSO`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Cl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IMDS_REGION_PATH=e.DEFAULTS_MODE_OPTIONS=e.ENV_IMDS_DISABLED=e.AWS_DEFAULT_REGION_ENV=e.AWS_REGION_ENV=e.AWS_EXECUTION_ENV=void 0,e.AWS_EXECUTION_ENV=`AWS_EXECUTION_ENV`,e.AWS_REGION_ENV=`AWS_REGION`,e.AWS_DEFAULT_REGION_ENV=`AWS_DEFAULT_REGION`,e.ENV_IMDS_DISABLED=`AWS_EC2_METADATA_DISABLED`,e.DEFAULTS_MODE_OPTIONS=[`in-region`,`cross-region`,`mobile`,`standard`,`legacy`],e.IMDS_REGION_PATH=`/latest/meta-data/placement/region`})),wl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.NODE_DEFAULTS_MODE_CONFIG_OPTIONS=void 0,e.NODE_DEFAULTS_MODE_CONFIG_OPTIONS={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:`legacy`}})),Tl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveDefaultsModeConfig=void 0;let t=Or(),n=ec(),r=Ws(),i=qi(),a=Cl(),o=wl();e.resolveDefaultsModeConfig=({region:e=(0,r.loadConfig)(t.NODE_REGION_CONFIG_OPTIONS),defaultsMode:n=(0,r.loadConfig)(o.NODE_DEFAULTS_MODE_CONFIG_OPTIONS)}={})=>(0,i.memoize)(async()=>{let t=typeof n==`function`?await n():n;switch(t?.toLowerCase()){case`auto`:return s(e);case`in-region`:case`cross-region`:case`mobile`:case`standard`:case`legacy`:return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve(`legacy`);default:throw Error(`Invalid parameter for "defaultsMode", expect ${a.DEFAULTS_MODE_OPTIONS.join(`, `)}, got ${t}`)}});let s=async e=>{if(e){let t=typeof e==`function`?await e():e,n=await c();return n?t===n?`in-region`:`cross-region`:`standard`}return`standard`},c=async()=>{if(process.env[a.AWS_EXECUTION_ENV]&&(process.env[a.AWS_REGION_ENV]||process.env[a.AWS_DEFAULT_REGION_ENV]))return process.env[a.AWS_REGION_ENV]??process.env[a.AWS_DEFAULT_REGION_ENV];if(!process.env[a.ENV_IMDS_DISABLED])try{let e=await(0,n.getInstanceMetadataEndpoint)();return(await(0,n.httpRequest)({...e,path:a.IMDS_REGION_PATH})).toString()}catch{}}})),El=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Tl(),e)})),Dl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(_c()),n=Or(),r=vc(),i=Bi(),a=Ws(),o=Mc(),s=Pc(),c=Wr(),l=gl(),u=Sl(),d=P(),f=El(),p=P();e.getRuntimeConfig=e=>{(0,p.emitWarningIfUnsupportedVersion)(process.version);let m=(0,f.resolveDefaultsModeConfig)(e),h=()=>m().then(d.loadConfigsForDefaultMode),g=(0,u.getRuntimeConfig)(e);return{...g,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??s.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,l.defaultUserAgent)({serviceId:g.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,a.loadConfig)(i.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,a.loadConfig)(n.NODE_REGION_CONFIG_OPTIONS,n.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new o.NodeHttpHandler(h),retryMode:e?.retryMode??(0,a.loadConfig)({...i.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await h()).retryMode||c.DEFAULT_RETRY_MODE}),sha256:e?.sha256??r.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??o.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,a.loadConfig)(n.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,a.loadConfig)(n.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),Ol=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=$o(),l=P(),u=gc(),d=Dl();e.SSOClient=class extends l.Client{constructor(e){let l=(0,d.getRuntimeConfig)(e),f=(0,u.resolveClientEndpointParameters)(l),p=(0,t.resolveRegionConfig)(f),m=(0,r.resolveEndpointConfig)(p),h=(0,s.resolveRetryConfig)(m),g=(0,i.resolveHostHeaderConfig)(h),_=(0,c.resolveUserAgentConfig)(g);super(_),this.config=_,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,c.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),kl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSO=void 0;let t=P(),n=fc(),r=pc(),i=mc(),a=hc(),o=Ol(),s={GetRoleCredentialsCommand:n.GetRoleCredentialsCommand,ListAccountRolesCommand:r.ListAccountRolesCommand,ListAccountsCommand:i.ListAccountsCommand,LogoutCommand:a.LogoutCommand};var c=class extends o.SSOClient{};e.SSO=c,(0,t.createAggregatedClient)(s,c)})),Al=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(fc(),e),t.__exportStar(pc(),e),t.__exportStar(mc(),e),t.__exportStar(hc(),e)})),jl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(uc(),e)})),Ml=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Nl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListAccountRoles=void 0;let t=pc(),n=Ol(),r=async(e,n,...r)=>await e.send(new t.ListAccountRolesCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.nextToken=a,t.maxResults=e.pageSize,e.client instanceof n.SSOClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SSO | SSOClient`);yield s;let c=a;a=s.nextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListAccountRoles=i})),Pl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListAccounts=void 0;let t=mc(),n=Ol(),r=async(e,n,...r)=>await e.send(new t.ListAccountsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.nextToken=a,t.maxResults=e.pageSize,e.client instanceof n.SSOClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SSO | SSOClient`);yield s;let c=a;a=s.nextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListAccounts=i})),Fl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Ml(),e),t.__exportStar(Nl(),e),t.__exportStar(Pl(),e)})),Il=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOServiceException=void 0;let t=(N(),m(j));t.__exportStar(kl(),e),t.__exportStar(Ol(),e),t.__exportStar(Al(),e),t.__exportStar(jl(),e),t.__exportStar(Fl(),e);var n=lc();Object.defineProperty(e,`SSOServiceException`,{enumerable:!0,get:function(){return n.SSOServiceException}})})),Ll=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.REFRESH_MESSAGE=e.EXPIRE_WINDOW_MS=void 0,e.EXPIRE_WINDOW_MS=300*1e3,e.REFRESH_MESSAGE=`To refresh this SSO session run 'aws sso login' with the corresponding profile.`})),Rl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDCServiceException=void 0;let t=P();e.SSOOIDCServiceException=class e extends t.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),zl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidClientMetadataException=e.UnsupportedGrantTypeException=e.UnauthorizedClientException=e.SlowDownException=e.InvalidScopeException=e.InvalidRequestException=e.InvalidGrantException=e.InvalidClientException=e.InternalServerException=e.ExpiredTokenException=e.AuthorizationPendingException=e.AccessDeniedException=void 0;let t=Rl();e.AccessDeniedException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),this.name=`AccessDeniedException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.AuthorizationPendingException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`AuthorizationPendingException`,$fault:`client`,...t}),this.name=`AuthorizationPendingException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.ExpiredTokenException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),this.name=`ExpiredTokenException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InternalServerException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),this.name=`InternalServerException`,this.$fault=`server`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidClientException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidClientException`,$fault:`client`,...t}),this.name=`InvalidClientException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidGrantException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidGrantException`,$fault:`client`,...t}),this.name=`InvalidGrantException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidRequestException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),this.name=`InvalidRequestException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidScopeException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidScopeException`,$fault:`client`,...t}),this.name=`InvalidScopeException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.SlowDownException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`SlowDownException`,$fault:`client`,...t}),this.name=`SlowDownException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.UnauthorizedClientException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`UnauthorizedClientException`,$fault:`client`,...t}),this.name=`UnauthorizedClientException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.UnsupportedGrantTypeException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`UnsupportedGrantTypeException`,$fault:`client`,...t}),this.name=`UnsupportedGrantTypeException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},e.InvalidClientMetadataException=class e extends t.SSOOIDCServiceException{constructor(t){super({name:`InvalidClientMetadataException`,$fault:`client`,...t}),this.name=`InvalidClientMetadataException`,this.$fault=`client`,Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}}})),Bl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.de_StartDeviceAuthorizationCommand=e.de_RegisterClientCommand=e.de_CreateTokenCommand=e.se_StartDeviceAuthorizationCommand=e.se_RegisterClientCommand=e.se_CreateTokenCommand=void 0;let t=gn(),n=P(),r=zl(),i=Rl();e.se_CreateTokenCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c={"content-type":`application/json`},l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/token`,u;return u=JSON.stringify((0,n.take)(e,{clientId:[],clientSecret:[],code:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:e=>(0,n._json)(e)})),new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:u})},e.se_RegisterClientCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c={"content-type":`application/json`},l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/client/register`,u;return u=JSON.stringify((0,n.take)(e,{clientName:[],clientType:[],scopes:e=>(0,n._json)(e)})),new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:u})},e.se_StartDeviceAuthorizationCommand=async(e,r)=>{let{hostname:i,protocol:a=`https`,port:o,path:s}=await r.endpoint(),c={"content-type":`application/json`},l=`${s?.endsWith(`/`)?s.slice(0,-1):s||``}/device_authorization`,u;return u=JSON.stringify((0,n.take)(e,{clientId:[],clientSecret:[],startUrl:[]})),new t.HttpRequest({protocol:a,hostname:i,port:o,method:`POST`,headers:c,path:l,body:u})},e.de_CreateTokenCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return a(e,t);let r=(0,n.map)({$metadata:x(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await w(e.body,t)),`body`),o=(0,n.take)(i,{accessToken:n.expectString,expiresIn:n.expectInt32,idToken:n.expectString,refreshToken:n.expectString,tokenType:n.expectString});return Object.assign(r,o),r};let a=async(e,t)=>{let n={...e,body:await ee(e.body,t)},r=te(e,n.body);switch(r){case`AccessDeniedException`:case`com.amazonaws.ssooidc#AccessDeniedException`:throw await l(n,t);case`AuthorizationPendingException`:case`com.amazonaws.ssooidc#AuthorizationPendingException`:throw await u(n,t);case`ExpiredTokenException`:case`com.amazonaws.ssooidc#ExpiredTokenException`:throw await d(n,t);case`InternalServerException`:case`com.amazonaws.ssooidc#InternalServerException`:throw await f(n,t);case`InvalidClientException`:case`com.amazonaws.ssooidc#InvalidClientException`:throw await p(n,t);case`InvalidGrantException`:case`com.amazonaws.ssooidc#InvalidGrantException`:throw await h(n,t);case`InvalidRequestException`:case`com.amazonaws.ssooidc#InvalidRequestException`:throw await g(n,t);case`InvalidScopeException`:case`com.amazonaws.ssooidc#InvalidScopeException`:throw await _(n,t);case`SlowDownException`:case`com.amazonaws.ssooidc#SlowDownException`:throw await v(n,t);case`UnauthorizedClientException`:case`com.amazonaws.ssooidc#UnauthorizedClientException`:throw await y(n,t);case`UnsupportedGrantTypeException`:case`com.amazonaws.ssooidc#UnsupportedGrantTypeException`:throw await b(n,t);default:let i=n.body;return c({output:e,parsedBody:i,errorCode:r})}};e.de_RegisterClientCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return o(e,t);let r=(0,n.map)({$metadata:x(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await w(e.body,t)),`body`),a=(0,n.take)(i,{authorizationEndpoint:n.expectString,clientId:n.expectString,clientIdIssuedAt:n.expectLong,clientSecret:n.expectString,clientSecretExpiresAt:n.expectLong,tokenEndpoint:n.expectString});return Object.assign(r,a),r};let o=async(e,t)=>{let n={...e,body:await ee(e.body,t)},r=te(e,n.body);switch(r){case`InternalServerException`:case`com.amazonaws.ssooidc#InternalServerException`:throw await f(n,t);case`InvalidClientMetadataException`:case`com.amazonaws.ssooidc#InvalidClientMetadataException`:throw await m(n,t);case`InvalidRequestException`:case`com.amazonaws.ssooidc#InvalidRequestException`:throw await g(n,t);case`InvalidScopeException`:case`com.amazonaws.ssooidc#InvalidScopeException`:throw await _(n,t);default:let i=n.body;return c({output:e,parsedBody:i,errorCode:r})}};e.de_StartDeviceAuthorizationCommand=async(e,t)=>{if(e.statusCode!==200&&e.statusCode>=300)return s(e,t);let r=(0,n.map)({$metadata:x(e)}),i=(0,n.expectNonNull)((0,n.expectObject)(await w(e.body,t)),`body`),a=(0,n.take)(i,{deviceCode:n.expectString,expiresIn:n.expectInt32,interval:n.expectInt32,userCode:n.expectString,verificationUri:n.expectString,verificationUriComplete:n.expectString});return Object.assign(r,a),r};let s=async(e,t)=>{let n={...e,body:await ee(e.body,t)},r=te(e,n.body);switch(r){case`InternalServerException`:case`com.amazonaws.ssooidc#InternalServerException`:throw await f(n,t);case`InvalidClientException`:case`com.amazonaws.ssooidc#InvalidClientException`:throw await p(n,t);case`InvalidRequestException`:case`com.amazonaws.ssooidc#InvalidRequestException`:throw await g(n,t);case`SlowDownException`:case`com.amazonaws.ssooidc#SlowDownException`:throw await v(n,t);case`UnauthorizedClientException`:case`com.amazonaws.ssooidc#UnauthorizedClientException`:throw await y(n,t);default:let i=n.body;return c({output:e,parsedBody:i,errorCode:r})}},c=(0,n.withBaseException)(i.SSOOIDCServiceException),l=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.AccessDeniedException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},u=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.AuthorizationPendingException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},d=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.ExpiredTokenException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},f=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InternalServerException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},p=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidClientException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},m=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidClientMetadataException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},h=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidGrantException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},g=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidRequestException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},_=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.InvalidScopeException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},v=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.SlowDownException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},y=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.UnauthorizedClientException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},b=async(e,t)=>{let i=(0,n.map)({}),a=e.body,o=(0,n.take)(a,{error:n.expectString,error_description:n.expectString});Object.assign(i,o);let s=new r.UnsupportedGrantTypeException({$metadata:x(e),...i});return(0,n.decorateServiceException)(s,e.body)},x=e=>({httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}),S=(e=new Uint8Array,t)=>e instanceof Uint8Array?Promise.resolve(e):t.streamCollector(e)||Promise.resolve(new Uint8Array),C=(e,t)=>S(e,t).then(e=>t.utf8Encoder(e)),w=(e,t)=>C(e,t).then(e=>e.length?JSON.parse(e):{}),ee=async(e,t)=>{let n=await w(e,t);return n.message=n.message??n.Message,n},te=(e,t)=>{let n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t},i=n(e.headers,`x-amzn-errortype`);if(i!==void 0)return r(e.headers[i]);if(t.code!==void 0)return r(t.code);if(t.__type!==void 0)return r(t.__type)}})),Vl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CreateTokenCommand=void 0;let t=L(),n=F(),r=P(),i=Bl();e.CreateTokenCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`SSOOIDCClient`,commandName:`CreateTokenCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_CreateTokenCommand)(e,t)}deserialize(e,t){return(0,i.de_CreateTokenCommand)(e,t)}}})),Hl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.RegisterClientCommand=void 0;let t=L(),n=F(),r=P(),i=Bl();e.RegisterClientCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`SSOOIDCClient`,commandName:`RegisterClientCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_RegisterClientCommand)(e,t)}deserialize(e,t){return(0,i.de_RegisterClientCommand)(e,t)}}})),Ul=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.StartDeviceAuthorizationCommand=void 0;let t=L(),n=F(),r=P(),i=Bl();e.StartDeviceAuthorizationCommand=class e extends r.Command{static getEndpointParameterInstructions(){return{UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}}constructor(e){super(),this.input=e}resolveMiddleware(r,i,a){this.middlewareStack.use((0,n.getSerdePlugin)(i,this.serialize,this.deserialize)),this.middlewareStack.use((0,t.getEndpointPlugin)(i,e.getEndpointParameterInstructions()));let o=r.concat(this.middlewareStack),{logger:s}=i,c={logger:s,clientName:`SSOOIDCClient`,commandName:`StartDeviceAuthorizationCommand`,inputFilterSensitiveLog:e=>e,outputFilterSensitiveLog:e=>e},{requestHandler:l}=i;return o.resolve(e=>l.handle(e.request,a||{}),c)}serialize(e,t){return(0,i.se_StartDeviceAuthorizationCommand)(e,t)}deserialize(e,t){return(0,i.de_StartDeviceAuthorizationCommand)(e,t)}}})),Wl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveClientEndpointParameters=void 0,e.resolveClientEndpointParameters=e=>({...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`awsssooidc`})})),Gl=u(((e,t)=>{t.exports={name:`@aws-sdk/client-sso-oidc`,description:`AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native`,version:`3.329.0`,scripts:{build:`concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'`,"build:cjs":`tsc -p tsconfig.cjs.json`,"build:docs":`typedoc`,"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 sso-oidc`},main:`./dist-cjs/index.js`,types:`./dist-types/index.d.ts`,module:`./dist-es/index.js`,sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":`3.0.0`,"@aws-crypto/sha256-js":`3.0.0`,"@aws-sdk/config-resolver":`3.329.0`,"@aws-sdk/fetch-http-handler":`3.329.0`,"@aws-sdk/hash-node":`3.329.0`,"@aws-sdk/invalid-dependency":`3.329.0`,"@aws-sdk/middleware-content-length":`3.329.0`,"@aws-sdk/middleware-endpoint":`3.329.0`,"@aws-sdk/middleware-host-header":`3.329.0`,"@aws-sdk/middleware-logger":`3.329.0`,"@aws-sdk/middleware-recursion-detection":`3.329.0`,"@aws-sdk/middleware-retry":`3.329.0`,"@aws-sdk/middleware-serde":`3.329.0`,"@aws-sdk/middleware-stack":`3.329.0`,"@aws-sdk/middleware-user-agent":`3.329.0`,"@aws-sdk/node-config-provider":`3.329.0`,"@aws-sdk/node-http-handler":`3.329.0`,"@aws-sdk/protocol-http":`3.329.0`,"@aws-sdk/smithy-client":`3.329.0`,"@aws-sdk/types":`3.329.0`,"@aws-sdk/url-parser":`3.329.0`,"@aws-sdk/util-base64":`3.310.0`,"@aws-sdk/util-body-length-browser":`3.310.0`,"@aws-sdk/util-body-length-node":`3.310.0`,"@aws-sdk/util-defaults-mode-browser":`3.329.0`,"@aws-sdk/util-defaults-mode-node":`3.329.0`,"@aws-sdk/util-endpoints":`3.329.0`,"@aws-sdk/util-retry":`3.329.0`,"@aws-sdk/util-user-agent-browser":`3.329.0`,"@aws-sdk/util-user-agent-node":`3.329.0`,"@aws-sdk/util-utf8":`3.310.0`,tslib:`^2.5.0`},devDependencies:{"@aws-sdk/service-client-documentation-generator":`3.310.0`,"@tsconfig/node14":`1.0.3`,"@types/node":`^14.14.31`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,rimraf:`3.0.2`,typedoc:`0.23.23`,typescript:`~4.9.5`},engines:{node:`>=14.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-sso-oidc`,repository:{type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-sso-oidc`}}})),Kl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`PartitionResult`,i=`tree`,a=`error`,o=`endpoint`,s={[t]:!1,type:`String`},c={[t]:!0,default:!1,type:`Boolean`},l={ref:`Endpoint`},u={fn:`booleanEquals`,[n]:[{ref:`UseFIPS`},!0]},d={fn:`booleanEquals`,[n]:[{ref:`UseDualStack`},!0]},f={},p={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsFIPS`]}]},m={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:r},`supportsDualStack`]}]},h=[l],g=[u],_=[d];e.ruleSet={version:`1.0`,parameters:{Region:s,UseDualStack:c,UseFIPS:c,Endpoint:s},rules:[{conditions:[{fn:`aws.partition`,[n]:[{ref:`Region`}],assign:r}],type:i,rules:[{conditions:[{fn:`isSet`,[n]:h},{fn:`parseURL`,[n]:h,assign:`url`}],type:i,rules:[{conditions:g,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{type:i,rules:[{conditions:_,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:l,properties:f,headers:f},type:o}]}]},{conditions:[u,d],type:i,rules:[{conditions:[p,m],type:i,rules:[{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}]},{conditions:g,type:i,rules:[{conditions:[p],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}]},{conditions:_,type:i,rules:[{conditions:[m],type:i,rules:[{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:f,headers:f},type:o}]},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}]},{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dnsSuffix}`,properties:f,headers:f},type:o}]}]}})),ql=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=Kl();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),Jl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=ql();e.getRuntimeConfig=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`SSO OIDC`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Yl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(Gl()),n=Or(),r=vc(),i=Bi(),a=Ws(),o=Mc(),s=Pc(),c=Wr(),l=gl(),u=Jl(),d=P(),f=El(),p=P();e.getRuntimeConfig=e=>{(0,p.emitWarningIfUnsupportedVersion)(process.version);let m=(0,f.resolveDefaultsModeConfig)(e),h=()=>m().then(d.loadConfigsForDefaultMode),g=(0,u.getRuntimeConfig)(e);return{...g,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??s.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,l.defaultUserAgent)({serviceId:g.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,a.loadConfig)(i.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,a.loadConfig)(n.NODE_REGION_CONFIG_OPTIONS,n.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new o.NodeHttpHandler(h),retryMode:e?.retryMode??(0,a.loadConfig)({...i.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await h()).retryMode||c.DEFAULT_RETRY_MODE}),sha256:e?.sha256??r.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??o.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,a.loadConfig)(n.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,a.loadConfig)(n.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),Xl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDCClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=$o(),l=P(),u=Wl(),d=Yl();e.SSOOIDCClient=class extends l.Client{constructor(e){let l=(0,d.getRuntimeConfig)(e),f=(0,u.resolveClientEndpointParameters)(l),p=(0,t.resolveRegionConfig)(f),m=(0,r.resolveEndpointConfig)(p),h=(0,s.resolveRetryConfig)(m),g=(0,i.resolveHostHeaderConfig)(h),_=(0,c.resolveUserAgentConfig)(g);super(_),this.config=_,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,c.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),Zl=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDC=void 0;let t=P(),n=Vl(),r=Hl(),i=Ul(),a=Xl(),o={CreateTokenCommand:n.CreateTokenCommand,RegisterClientCommand:r.RegisterClientCommand,StartDeviceAuthorizationCommand:i.StartDeviceAuthorizationCommand};var s=class extends a.SSOOIDCClient{};e.SSOOIDC=s,(0,t.createAggregatedClient)(o,s)})),Ql=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Vl(),e),t.__exportStar(Hl(),e),t.__exportStar(Ul(),e)})),$l=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(zl(),e)})),eu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SSOOIDCServiceException=void 0;let t=(N(),m(j));t.__exportStar(Zl(),e),t.__exportStar(Xl(),e),t.__exportStar(Ql(),e),t.__exportStar($l(),e);var n=Rl();Object.defineProperty(e,`SSOOIDCServiceException`,{enumerable:!0,get:function(){return n.SSOOIDCServiceException}})})),tu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSsoOidcClient=void 0;let t=eu(),n={};e.getSsoOidcClient=e=>{if(n[e])return n[e];let r=new t.SSOOIDCClient({region:e});return n[e]=r,r}})),nu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getNewSsoOidcToken=void 0;let t=eu(),n=tu();e.getNewSsoOidcToken=(e,r)=>(0,n.getSsoOidcClient)(r).send(new t.CreateTokenCommand({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:`refresh_token`}))})),ru=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTokenExpiry=void 0;let t=qi(),n=Ll();e.validateTokenExpiry=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new t.TokenProviderError(`Token is expired. ${n.REFRESH_MESSAGE}`,!1)}})),iu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateTokenKey=void 0;let t=qi(),n=Ll();e.validateTokenKey=(e,r,i=!1)=>{if(r===void 0)throw new t.TokenProviderError(`Value not present for '${e}' in SSO Token${i?`. Cannot refresh`:``}. ${n.REFRESH_MESSAGE}`,!1)}})),au=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.writeSSOTokenToFile=void 0;let t=Ps(),{writeFile:n}=h(`fs`).promises;e.writeSSOTokenToFile=(e,r)=>n((0,t.getSSOTokenFilepath)(e),JSON.stringify(r,null,2))})),ou=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromSso=void 0;let t=qi(),n=Ps(),r=Ll(),i=nu(),a=ru(),o=iu(),s=au(),c=new Date(0);e.fromSso=(e={})=>async()=>{let l=await(0,n.parseKnownFiles)(e),u=(0,n.getProfileName)(e),d=l[u];if(!d)throw new t.TokenProviderError(`Profile '${u}' could not be found in shared credentials file.`,!1);if(!d.sso_session)throw new t.TokenProviderError(`Profile '${u}' is missing required property 'sso_session'.`);let f=d.sso_session,p=(await(0,n.loadSsoSessionData)(e))[f];if(!p)throw new t.TokenProviderError(`Sso session '${f}' could not be found in shared credentials file.`,!1);for(let e of[`sso_start_url`,`sso_region`])if(!p[e])throw new t.TokenProviderError(`Sso session '${f}' is missing required property '${e}'.`,!1);p.sso_start_url;let m=p.sso_region,h;try{h=await(0,n.getSSOTokenFromFile)(f)}catch{throw new t.TokenProviderError(`The SSO session token associated with profile=${u} was not found or is invalid. ${r.REFRESH_MESSAGE}`,!1)}(0,o.validateTokenKey)(`accessToken`,h.accessToken),(0,o.validateTokenKey)(`expiresAt`,h.expiresAt);let{accessToken:g,expiresAt:_}=h,v={token:g,expiration:new Date(_)};if(v.expiration.getTime()-Date.now()>r.EXPIRE_WINDOW_MS)return v;if(Date.now()-c.getTime()<30*1e3)return(0,a.validateTokenExpiry)(v),v;(0,o.validateTokenKey)(`clientId`,h.clientId,!0),(0,o.validateTokenKey)(`clientSecret`,h.clientSecret,!0),(0,o.validateTokenKey)(`refreshToken`,h.refreshToken,!0);try{c.setTime(Date.now());let e=await(0,i.getNewSsoOidcToken)(h,m);(0,o.validateTokenKey)(`accessToken`,e.accessToken),(0,o.validateTokenKey)(`expiresIn`,e.expiresIn);let t=new Date(Date.now()+e.expiresIn*1e3);try{await(0,s.writeSSOTokenToFile)(f,{...h,accessToken:e.accessToken,expiresAt:t.toISOString(),refreshToken:e.refreshToken})}catch{}return{token:e.accessToken,expiration:t}}catch{return(0,a.validateTokenExpiry)(v),v}}})),su=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromStatic=void 0;let t=qi();e.fromStatic=({token:e})=>async()=>{if(!e||!e.token)throw new t.TokenProviderError(`Please pass a valid token to fromStatic`,!1);return e}})),cu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.nodeProvider=void 0;let t=qi(),n=ou();e.nodeProvider=(e={})=>(0,t.memoize)((0,t.chain)((0,n.fromSso)(e),async()=>{throw new t.TokenProviderError(`Could not load token from any providers`,!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0)})),lu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(ou(),e),t.__exportStar(su(),e),t.__exportStar(cu(),e)})),uu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSSOCredentials=void 0;let t=Il(),n=qi(),r=Ps(),i=lu();e.resolveSSOCredentials=async({ssoStartUrl:e,ssoSession:a,ssoAccountId:o,ssoRegion:s,ssoRoleName:c,ssoClient:l,profile:u})=>{let d,f=`To refresh this SSO session run aws sso login with the corresponding profile.`;if(a)try{let e=await(0,i.fromSso)({profile:u})();d={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new n.CredentialsProviderError(e.message,!1)}else try{d=await(0,r.getSSOTokenFromFile)(e)}catch{throw new n.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${f}`,!1)}if(new Date(d.expiresAt).getTime()-Date.now()<=9e5)throw new n.CredentialsProviderError(`The SSO session associated with this profile has expired. ${f}`,!1);let{accessToken:p}=d,m=l||new t.SSOClient({region:s}),h;try{h=await m.send(new t.GetRoleCredentialsCommand({accountId:o,roleName:c,accessToken:p}))}catch(e){throw n.CredentialsProviderError.from(e,!1)}let{roleCredentials:{accessKeyId:g,secretAccessKey:_,sessionToken:v,expiration:y}={}}=h;if(!g||!_||!v||!y)throw new n.CredentialsProviderError(`SSO returns an invalid temporary credential.`,!1);return{accessKeyId:g,secretAccessKey:_,sessionToken:v,expiration:new Date(y)}}})),du=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.validateSsoProfile=void 0;let t=qi();e.validateSsoProfile=e=>{let{sso_start_url:n,sso_account_id:r,sso_region:i,sso_role_name:a}=e;if(!n||!r||!i||!a)throw new t.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(`, `)}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,!1);return e}})),fu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromSSO=void 0;let t=qi(),n=Ps(),r=cc(),i=uu(),a=du();e.fromSSO=(e={})=>async()=>{let{ssoStartUrl:o,ssoAccountId:s,ssoRegion:c,ssoRoleName:l,ssoClient:u,ssoSession:d}=e,f=(0,n.getProfileName)(e);if(!o&&!s&&!c&&!l&&!d){let s=(await(0,n.parseKnownFiles)(e))[f];if(!s)throw new t.CredentialsProviderError(`Profile ${f} was not found.`);if(!(0,r.isSsoProfile)(s))throw new t.CredentialsProviderError(`Profile ${f} is not configured with SSO credentials.`);if(s?.sso_session){let r=(await(0,n.loadSsoSessionData)(e))[s.sso_session],i=` configurations in profile ${f} and sso-session ${s.sso_session}`;if(c&&c!==r.sso_region)throw new t.CredentialsProviderError(`Conflicting SSO region`+i,!1);if(o&&o!==r.sso_start_url)throw new t.CredentialsProviderError(`Conflicting SSO start_url`+i,!1);s.sso_region=r.sso_region,s.sso_start_url=r.sso_start_url}let{sso_start_url:l,sso_account_id:d,sso_region:p,sso_role_name:m,sso_session:h}=(0,a.validateSsoProfile)(s);return(0,i.resolveSSOCredentials)({ssoStartUrl:l,ssoSession:h,ssoAccountId:d,ssoRegion:p,ssoRoleName:m,ssoClient:u,profile:f})}else if(!o||!s||!c||!l)throw new t.CredentialsProviderError(`Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"`);else return(0,i.resolveSSOCredentials)({ssoStartUrl:o,ssoSession:d,ssoAccountId:s,ssoRegion:c,ssoRoleName:l,ssoClient:u,profile:f})}})),pu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),mu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(fu(),e),t.__exportStar(cc(),e),t.__exportStar(pu(),e),t.__exportStar(du(),e)})),hu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveSsoCredentials=e.isSsoProfile=void 0;let t=mu();var n=mu();Object.defineProperty(e,`isSsoProfile`,{enumerable:!0,get:function(){return n.isSsoProfile}}),e.resolveSsoCredentials=e=>{let{sso_start_url:n,sso_account_id:r,sso_session:i,sso_region:a,sso_role_name:o}=(0,t.validateSsoProfile)(e);return(0,t.fromSSO)({ssoStartUrl:n,ssoAccountId:r,ssoSession:i,ssoRegion:a,ssoRoleName:o})()}})),gu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveStaticCredentials=e.isStaticCredsProfile=void 0,e.isStaticCredsProfile=e=>!!e&&typeof e==`object`&&typeof e.aws_access_key_id==`string`&&typeof e.aws_secret_access_key==`string`&&[`undefined`,`string`].indexOf(typeof e.aws_session_token)>-1,e.resolveStaticCredentials=e=>Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token})})),_u=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromWebToken=void 0;let t=qi();e.fromWebToken=e=>()=>{let{roleArn:n,roleSessionName:r,webIdentityToken:i,providerId:a,policyArns:o,policy:s,durationSeconds:c,roleAssumerWithWebIdentity:l}=e;if(!l)throw new t.CredentialsProviderError(`Role Arn '${n}' needs to be assumed with web identity, but no role assumption callback was provided.`,!1);return l({RoleArn:n,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:a,PolicyArns:o,Policy:s,DurationSeconds:c})}})),vu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromTokenFile=void 0;let t=qi(),n=h(`fs`),r=_u();e.fromTokenFile=(e={})=>async()=>i(e);let i=e=>{let i=e?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,a=e?.roleArn??process.env.AWS_ROLE_ARN,o=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!i||!a)throw new t.CredentialsProviderError(`Web identity configuration not specified`);return(0,r.fromWebToken)({...e,webIdentityToken:(0,n.readFileSync)(i,{encoding:`ascii`}),roleArn:a,roleSessionName:o})()}})),yu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(vu(),e),t.__exportStar(_u(),e)})),bu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveWebIdentityCredentials=e.isWebIdentityProfile=void 0;let t=yu();e.isWebIdentityProfile=e=>!!e&&typeof e==`object`&&typeof e.web_identity_token_file==`string`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1,e.resolveWebIdentityCredentials=async(e,n)=>(0,t.fromTokenFile)({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:n.roleAssumerWithWebIdentity})()})),xu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveProfileData=void 0;let t=qi(),n=nc(),r=sc(),i=hu(),a=gu(),o=bu();e.resolveProfileData=async(e,s,c,l={})=>{let u=s[e];if(Object.keys(l).length>0&&(0,a.isStaticCredsProfile)(u))return(0,a.resolveStaticCredentials)(u);if((0,n.isAssumeRoleProfile)(u))return(0,n.resolveAssumeRoleCredentials)(e,s,c,l);if((0,a.isStaticCredsProfile)(u))return(0,a.resolveStaticCredentials)(u);if((0,o.isWebIdentityProfile)(u))return(0,o.resolveWebIdentityCredentials)(u,c);if((0,r.isProcessProfile)(u))return(0,r.resolveProcessCredentials)(c,e);if((0,i.isSsoProfile)(u))return(0,i.resolveSsoCredentials)(u);throw new t.CredentialsProviderError(`Profile ${e} could not be found or parsed in shared credentials file.`)}})),Su=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromIni=void 0;let t=Ps(),n=xu();e.fromIni=(e={})=>async()=>{let r=await(0,t.parseKnownFiles)(e);return(0,n.resolveProfileData)((0,t.getProfileName)(e),r,e)}})),Cu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Su(),e)})),wu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.remoteProvider=e.ENV_IMDS_DISABLED=void 0;let t=ec(),n=qi();e.ENV_IMDS_DISABLED=`AWS_EC2_METADATA_DISABLED`,e.remoteProvider=r=>process.env[t.ENV_CMDS_RELATIVE_URI]||process.env[t.ENV_CMDS_FULL_URI]?(0,t.fromContainerMetadata)(r):process.env[e.ENV_IMDS_DISABLED]?async()=>{throw new n.CredentialsProviderError(`EC2 Instance Metadata Service access disabled`)}:(0,t.fromInstanceMetadata)(r)})),Tu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultProvider=void 0;let t=vs(),n=Cu(),r=oc(),i=mu(),a=yu(),o=qi(),s=Ps(),c=wu();e.defaultProvider=(e={})=>(0,o.memoize)((0,o.chain)(...e.profile||process.env[s.ENV_PROFILE]?[]:[(0,t.fromEnv)()],(0,i.fromSSO)(e),(0,n.fromIni)(e),(0,r.fromProcess)(e),(0,a.fromTokenFile)(e),(0,c.remoteProvider)(e),async()=>{throw new o.CredentialsProviderError(`Could not load credentials from any providers`,!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0)})),Eu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(Tu(),e)})),Du=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`type`,r=`argv`,i=`booleanEquals`,a=`tree`,o=`stringEquals`,s=`sigv4`,c=`us-east-1`,l=`endpoint`,u=`https://sts.{Region}.{PartitionResult#dnsSuffix}`,d=`error`,f=`getAttr`,p={[t]:!1,[n]:`String`},m={[t]:!0,default:!1,[n]:`Boolean`},h={ref:`Endpoint`},g={fn:`isSet`,[r]:[{ref:`Region`}]},_={ref:`Region`},v={fn:`aws.partition`,[r]:[_],assign:`PartitionResult`},y={ref:`UseFIPS`},b={ref:`UseDualStack`},x={url:`https://sts.amazonaws.com`,properties:{authSchemes:[{name:s,signingName:`sts`,signingRegion:c}]},headers:{}},S={},C={conditions:[{fn:o,[r]:[_,`aws-global`]}],[l]:x,[n]:l},w={fn:i,[r]:[y,!0]},ee={fn:i,[r]:[b,!0]},te={fn:i,[r]:[!0,{fn:f,[r]:[{ref:`PartitionResult`},`supportsFIPS`]}]},T={ref:`PartitionResult`},E={fn:i,[r]:[!0,{fn:f,[r]:[T,`supportsDualStack`]}]},ne=[{fn:`isSet`,[r]:[h]}],re=[w],ie=[ee];e.ruleSet={version:`1.0`,parameters:{Region:p,UseDualStack:m,UseFIPS:m,Endpoint:p,UseGlobalEndpoint:m},rules:[{conditions:[{fn:i,[r]:[{ref:`UseGlobalEndpoint`},!0]},{fn:`not`,[r]:ne},g,v,{fn:i,[r]:[y,!1]},{fn:i,[r]:[b,!1]}],[n]:a,rules:[{conditions:[{fn:o,[r]:[_,`ap-northeast-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`ap-south-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`ap-southeast-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`ap-southeast-2`]}],endpoint:x,[n]:l},C,{conditions:[{fn:o,[r]:[_,`ca-central-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-central-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-north-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-west-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-west-2`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`eu-west-3`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`sa-east-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,c]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`us-east-2`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`us-west-1`]}],endpoint:x,[n]:l},{conditions:[{fn:o,[r]:[_,`us-west-2`]}],endpoint:x,[n]:l},{endpoint:{url:u,properties:{authSchemes:[{name:s,signingName:`sts`,signingRegion:`{Region}`}]},headers:S},[n]:l}]},{conditions:ne,[n]:a,rules:[{conditions:re,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,[n]:d},{[n]:a,rules:[{conditions:ie,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,[n]:d},{endpoint:{url:h,properties:S,headers:S},[n]:l}]}]},{[n]:a,rules:[{conditions:[g],[n]:a,rules:[{conditions:[v],[n]:a,rules:[{conditions:[w,ee],[n]:a,rules:[{conditions:[te,E],[n]:a,rules:[{[n]:a,rules:[{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:S,headers:S},[n]:l}]}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,[n]:d}]},{conditions:re,[n]:a,rules:[{conditions:[te],[n]:a,rules:[{[n]:a,rules:[{conditions:[{fn:o,[r]:[`aws-us-gov`,{fn:f,[r]:[T,`name`]}]}],endpoint:{url:`https://sts.{Region}.amazonaws.com`,properties:S,headers:S},[n]:l},{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:S,headers:S},[n]:l}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,[n]:d}]},{conditions:ie,[n]:a,rules:[{conditions:[E],[n]:a,rules:[{[n]:a,rules:[{endpoint:{url:`https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:S,headers:S},[n]:l}]}]},{error:`DualStack is enabled but this partition does not support DualStack`,[n]:d}]},{[n]:a,rules:[C,{endpoint:{url:u,properties:S,headers:S},[n]:l}]}]}]},{error:`Invalid Configuration: Missing Region`,[n]:d}]}]}})),Ou=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=Du();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),ku=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=Ou();e.getRuntimeConfig=e=>({apiVersion:`2011-06-15`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`STS`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Au=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(hs()),n=gs(),r=Or(),i=Eu(),a=vc(),o=Bi(),s=Ws(),c=Mc(),l=Pc(),u=Wr(),d=gl(),f=ku(),p=P(),h=El(),g=P();e.getRuntimeConfig=e=>{(0,g.emitWarningIfUnsupportedVersion)(process.version);let m=(0,h.resolveDefaultsModeConfig)(e),_=()=>m().then(p.loadConfigsForDefaultMode),v=(0,f.getRuntimeConfig)(e);return{...v,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??l.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??(0,n.decorateDefaultCredentialProvider)(i.defaultProvider),defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,d.defaultUserAgent)({serviceId:v.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,s.loadConfig)(o.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,s.loadConfig)(r.NODE_REGION_CONFIG_OPTIONS,r.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new c.NodeHttpHandler(_),retryMode:e?.retryMode??(0,s.loadConfig)({...o.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await _()).retryMode||u.DEFAULT_RETRY_MODE}),sha256:e?.sha256??a.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??c.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,s.loadConfig)(r.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,s.loadConfig)(r.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),ju=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.STSClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=ps(),l=$o(),u=P(),d=ms(),f=Au();e.STSClient=class e extends u.Client{constructor(u){let p=(0,f.getRuntimeConfig)(u),m=(0,d.resolveClientEndpointParameters)(p),h=(0,t.resolveRegionConfig)(m),g=(0,r.resolveEndpointConfig)(h),_=(0,s.resolveRetryConfig)(g),v=(0,i.resolveHostHeaderConfig)(_),y=(0,c.resolveStsAuthConfig)(v,{stsClientCtor:e}),b=(0,l.resolveUserAgentConfig)(y);super(b),this.config=b,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,l.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),Mu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.STS=void 0;let t=P(),n=as(),r=os(),i=ss(),a=cs(),o=ls(),s=us(),c=ds(),l=fs(),u=ju(),d={AssumeRoleCommand:n.AssumeRoleCommand,AssumeRoleWithSAMLCommand:r.AssumeRoleWithSAMLCommand,AssumeRoleWithWebIdentityCommand:i.AssumeRoleWithWebIdentityCommand,DecodeAuthorizationMessageCommand:a.DecodeAuthorizationMessageCommand,GetAccessKeyInfoCommand:o.GetAccessKeyInfoCommand,GetCallerIdentityCommand:s.GetCallerIdentityCommand,GetFederationTokenCommand:c.GetFederationTokenCommand,GetSessionTokenCommand:l.GetSessionTokenCommand};var f=class extends u.STSClient{};e.STS=f,(0,t.createAggregatedClient)(d,f)})),Nu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(as(),e),t.__exportStar(os(),e),t.__exportStar(ss(),e),t.__exportStar(cs(),e),t.__exportStar(ls(),e),t.__exportStar(us(),e),t.__exportStar(ds(),e),t.__exportStar(fs(),e)})),Pu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.decorateDefaultCredentialProvider=e.getDefaultRoleAssumerWithWebIdentity=e.getDefaultRoleAssumer=void 0;let t=gs(),n=ju(),r=(e,t)=>t?class extends e{constructor(e){super(e);for(let e of t)this.middlewareStack.use(e)}}:e;e.getDefaultRoleAssumer=(e={},i)=>(0,t.getDefaultRoleAssumer)(e,r(n.STSClient,i)),e.getDefaultRoleAssumerWithWebIdentity=(e={},i)=>(0,t.getDefaultRoleAssumerWithWebIdentity)(e,r(n.STSClient,i)),e.decorateDefaultCredentialProvider=t=>n=>t({roleAssumer:(0,e.getDefaultRoleAssumer)(n),roleAssumerWithWebIdentity:(0,e.getDefaultRoleAssumerWithWebIdentity)(n),...n})})),Fu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(rs(),e)})),Iu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.STSServiceException=void 0;let t=(N(),m(j));t.__exportStar(Mu(),e),t.__exportStar(ju(),e),t.__exportStar(Nu(),e),t.__exportStar(Pu(),e),t.__exportStar(Fu(),e);var n=ns();Object.defineProperty(e,`STSServiceException`,{enumerable:!0,get:function(){return n.STSServiceException}})})),Lu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`isSet`,i=`tree`,a=`error`,o=`endpoint`,s=`PartitionResult`,c=`stringEquals`,l={[t]:!1,type:`String`},u={[t]:!0,default:!1,type:`Boolean`},d={ref:`Endpoint`},f={fn:`booleanEquals`,[n]:[{ref:`UseFIPS`},!0]},p={fn:`booleanEquals`,[n]:[{ref:`UseDualStack`},!0]},m={},h={ref:`Region`},g={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:s},`supportsFIPS`]}]},_={fn:`booleanEquals`,[n]:[!0,{fn:`getAttr`,[n]:[{ref:s},`supportsDualStack`]}]},v=[f],y=[p],b=[h];e.ruleSet={version:`1.0`,parameters:{Region:l,UseDualStack:u,UseFIPS:u,Endpoint:l},rules:[{conditions:[{fn:r,[n]:[d]}],type:i,rules:[{conditions:v,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{type:i,rules:[{conditions:y,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:d,properties:m,headers:m},type:o}]}]},{type:i,rules:[{conditions:[{fn:r,[n]:b}],type:i,rules:[{conditions:[{fn:`aws.partition`,[n]:b,assign:s}],type:i,rules:[{conditions:[f,p],type:i,rules:[{conditions:[g,_],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://sns-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}]}]},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}]},{conditions:v,type:i,rules:[{conditions:[g],type:i,rules:[{type:i,rules:[{conditions:[{fn:c,[n]:[h,`us-gov-east-1`]}],endpoint:{url:`https://sns.us-gov-east-1.amazonaws.com`,properties:m,headers:m},type:o},{conditions:[{fn:c,[n]:[h,`us-gov-west-1`]}],endpoint:{url:`https://sns.us-gov-west-1.amazonaws.com`,properties:m,headers:m},type:o},{endpoint:{url:`https://sns-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}]}]},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}]},{conditions:y,type:i,rules:[{conditions:[_],type:i,rules:[{type:i,rules:[{endpoint:{url:`https://sns.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}]}]},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}]},{type:i,rules:[{endpoint:{url:`https://sns.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}]}]}]},{error:`Invalid Configuration: Missing Region`,type:a}]}]}})),Ru=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Xo(),n=Lu();e.defaultEndpointResolver=(e,r={})=>(0,t.resolveEndpoint)(n.ruleSet,{endpointParams:e,logger:r.logger})})),zu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=P(),n=Zt(),r=yl(),i=ea(),a=Ru();e.getRuntimeConfig=e=>({apiVersion:`2010-03-31`,base64Decoder:e?.base64Decoder??r.fromBase64,base64Encoder:e?.base64Encoder??r.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??a.defaultEndpointResolver,logger:e?.logger??new t.NoOpLogger,serviceId:e?.serviceId??`SNS`,urlParser:e?.urlParser??n.parseUrl,utf8Decoder:e?.utf8Decoder??i.fromUtf8,utf8Encoder:e?.utf8Encoder??i.toUtf8})})),Bu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(ts()),n=Iu(),r=Or(),i=Eu(),a=vc(),o=Bi(),s=Ws(),c=Mc(),l=Pc(),u=Wr(),d=gl(),f=zu(),p=P(),h=El(),g=P();e.getRuntimeConfig=e=>{(0,g.emitWarningIfUnsupportedVersion)(process.version);let m=(0,h.resolveDefaultsModeConfig)(e),_=()=>m().then(p.loadConfigsForDefaultMode),v=(0,f.getRuntimeConfig)(e);return{...v,...e,runtime:`node`,defaultsMode:m,bodyLengthChecker:e?.bodyLengthChecker??l.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??(0,n.decorateDefaultCredentialProvider)(i.defaultProvider),defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,d.defaultUserAgent)({serviceId:v.serviceId,clientVersion:t.default.version}),maxAttempts:e?.maxAttempts??(0,s.loadConfig)(o.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),region:e?.region??(0,s.loadConfig)(r.NODE_REGION_CONFIG_OPTIONS,r.NODE_REGION_CONFIG_FILE_OPTIONS),requestHandler:e?.requestHandler??new c.NodeHttpHandler(_),retryMode:e?.retryMode??(0,s.loadConfig)({...o.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await _()).retryMode||u.DEFAULT_RETRY_MODE}),sha256:e?.sha256??a.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??c.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,s.loadConfig)(r.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS),useFipsEndpoint:e?.useFipsEndpoint??(0,s.loadConfig)(r.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS)}}})),Vu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SNSClient=void 0;let t=Or(),n=kr(),r=L(),i=Z(),a=jr(),o=Mr(),s=Bi(),c=xa(),l=$o(),u=P(),d=es(),f=Bu();e.SNSClient=class extends u.Client{constructor(e){let u=(0,f.getRuntimeConfig)(e),p=(0,d.resolveClientEndpointParameters)(u),m=(0,t.resolveRegionConfig)(p),h=(0,r.resolveEndpointConfig)(m),g=(0,s.resolveRetryConfig)(h),_=(0,i.resolveHostHeaderConfig)(g),v=(0,c.resolveAwsAuthConfig)(_),y=(0,l.resolveUserAgentConfig)(v);super(y),this.config=y,this.middlewareStack.use((0,s.getRetryPlugin)(this.config)),this.middlewareStack.use((0,n.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,i.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,a.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,o.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use((0,c.getAwsAuthPlugin)(this.config)),this.middlewareStack.use((0,l.getUserAgentPlugin)(this.config))}destroy(){super.destroy()}}})),Hu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SNS=void 0;let t=P(),n=jn(),r=Mn(),i=Nn(),a=Pn(),o=Fn(),s=In(),c=Ln(),l=Rn(),u=zn(),d=Bn(),f=Vn(),p=Hn(),m=Un(),h=Wn(),g=Gn(),_=Kn(),v=qn(),y=Jn(),b=Yn(),x=Xn(),S=Zn(),C=z(),w=Qn(),ee=$n(),te=er(),T=tr(),E=nr(),ne=rr(),re=ir(),ie=ar(),ae=or(),oe=sr(),se=cr(),ce=lr(),le=ur(),ue=dr(),de=fr(),fe=pr(),pe=mr(),me=hr(),he=gr(),ge=_r(),_e=Vu(),ve={AddPermissionCommand:n.AddPermissionCommand,CheckIfPhoneNumberIsOptedOutCommand:r.CheckIfPhoneNumberIsOptedOutCommand,ConfirmSubscriptionCommand:i.ConfirmSubscriptionCommand,CreatePlatformApplicationCommand:a.CreatePlatformApplicationCommand,CreatePlatformEndpointCommand:o.CreatePlatformEndpointCommand,CreateSMSSandboxPhoneNumberCommand:s.CreateSMSSandboxPhoneNumberCommand,CreateTopicCommand:c.CreateTopicCommand,DeleteEndpointCommand:l.DeleteEndpointCommand,DeletePlatformApplicationCommand:u.DeletePlatformApplicationCommand,DeleteSMSSandboxPhoneNumberCommand:d.DeleteSMSSandboxPhoneNumberCommand,DeleteTopicCommand:f.DeleteTopicCommand,GetDataProtectionPolicyCommand:p.GetDataProtectionPolicyCommand,GetEndpointAttributesCommand:m.GetEndpointAttributesCommand,GetPlatformApplicationAttributesCommand:h.GetPlatformApplicationAttributesCommand,GetSMSAttributesCommand:g.GetSMSAttributesCommand,GetSMSSandboxAccountStatusCommand:_.GetSMSSandboxAccountStatusCommand,GetSubscriptionAttributesCommand:v.GetSubscriptionAttributesCommand,GetTopicAttributesCommand:y.GetTopicAttributesCommand,ListEndpointsByPlatformApplicationCommand:b.ListEndpointsByPlatformApplicationCommand,ListOriginationNumbersCommand:x.ListOriginationNumbersCommand,ListPhoneNumbersOptedOutCommand:S.ListPhoneNumbersOptedOutCommand,ListPlatformApplicationsCommand:C.ListPlatformApplicationsCommand,ListSMSSandboxPhoneNumbersCommand:w.ListSMSSandboxPhoneNumbersCommand,ListSubscriptionsCommand:te.ListSubscriptionsCommand,ListSubscriptionsByTopicCommand:ee.ListSubscriptionsByTopicCommand,ListTagsForResourceCommand:T.ListTagsForResourceCommand,ListTopicsCommand:E.ListTopicsCommand,OptInPhoneNumberCommand:ne.OptInPhoneNumberCommand,PublishCommand:ie.PublishCommand,PublishBatchCommand:re.PublishBatchCommand,PutDataProtectionPolicyCommand:ae.PutDataProtectionPolicyCommand,RemovePermissionCommand:oe.RemovePermissionCommand,SetEndpointAttributesCommand:se.SetEndpointAttributesCommand,SetPlatformApplicationAttributesCommand:ce.SetPlatformApplicationAttributesCommand,SetSMSAttributesCommand:le.SetSMSAttributesCommand,SetSubscriptionAttributesCommand:ue.SetSubscriptionAttributesCommand,SetTopicAttributesCommand:de.SetTopicAttributesCommand,SubscribeCommand:fe.SubscribeCommand,TagResourceCommand:pe.TagResourceCommand,UnsubscribeCommand:me.UnsubscribeCommand,UntagResourceCommand:he.UntagResourceCommand,VerifySMSSandboxPhoneNumberCommand:ge.VerifySMSSandboxPhoneNumberCommand};var ye=class extends _e.SNSClient{};e.SNS=ye,(0,t.createAggregatedClient)(ve,ye)})),Uu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(jn(),e),t.__exportStar(Mn(),e),t.__exportStar(Nn(),e),t.__exportStar(Pn(),e),t.__exportStar(Fn(),e),t.__exportStar(In(),e),t.__exportStar(Ln(),e),t.__exportStar(Rn(),e),t.__exportStar(zn(),e),t.__exportStar(Bn(),e),t.__exportStar(Vn(),e),t.__exportStar(Hn(),e),t.__exportStar(Un(),e),t.__exportStar(Wn(),e),t.__exportStar(Gn(),e),t.__exportStar(Kn(),e),t.__exportStar(qn(),e),t.__exportStar(Jn(),e),t.__exportStar(Yn(),e),t.__exportStar(Xn(),e),t.__exportStar(Zn(),e),t.__exportStar(z(),e),t.__exportStar(Qn(),e),t.__exportStar($n(),e),t.__exportStar(er(),e),t.__exportStar(tr(),e),t.__exportStar(nr(),e),t.__exportStar(rr(),e),t.__exportStar(ir(),e),t.__exportStar(ar(),e),t.__exportStar(or(),e),t.__exportStar(sr(),e),t.__exportStar(cr(),e),t.__exportStar(lr(),e),t.__exportStar(ur(),e),t.__exportStar(dr(),e),t.__exportStar(fr(),e),t.__exportStar(pr(),e),t.__exportStar(mr(),e),t.__exportStar(hr(),e),t.__exportStar(gr(),e),t.__exportStar(_r(),e)})),Wu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),(N(),m(j)).__exportStar(An(),e)})),Gu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0})})),Ku=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListEndpointsByPlatformApplication=void 0;let t=Yn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListEndpointsByPlatformApplicationCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListEndpointsByPlatformApplication=i})),qu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListOriginationNumbers=void 0;let t=Xn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListOriginationNumbersCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,t.MaxResults=e.pageSize,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListOriginationNumbers=i})),Ju=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListPhoneNumbersOptedOut=void 0;let t=Zn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListPhoneNumbersOptedOutCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.nextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.nextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListPhoneNumbersOptedOut=i})),Yu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListPlatformApplications=void 0;let t=z(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListPlatformApplicationsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListPlatformApplications=i})),Xu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListSMSSandboxPhoneNumbers=void 0;let t=Qn(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListSMSSandboxPhoneNumbersCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,t.MaxResults=e.pageSize,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListSMSSandboxPhoneNumbers=i})),Zu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListSubscriptionsByTopic=void 0;let t=$n(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListSubscriptionsByTopicCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListSubscriptionsByTopic=i})),Qu=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListSubscriptions=void 0;let t=er(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListSubscriptionsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListSubscriptions=i})),$u=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.paginateListTopics=void 0;let t=nr(),n=Vu(),r=async(e,n,...r)=>await e.send(new t.ListTopicsCommand(n),...r);async function*i(e,t,...i){let a=e.startingToken||void 0,o=!0,s;for(;o;){if(t.NextToken=a,e.client instanceof n.SNSClient)s=await r(e.client,t,...i);else throw Error(`Invalid client, expected SNS | SNSClient`);yield s;let c=a;a=s.NextToken,o=!!(a&&(!e.stopOnSameToken||a!==c))}return void 0}e.paginateListTopics=i})),ed=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(N(),m(j));t.__exportStar(Gu(),e),t.__exportStar(Ku(),e),t.__exportStar(qu(),e),t.__exportStar(Ju(),e),t.__exportStar(Yu(),e),t.__exportStar(Xu(),e),t.__exportStar(Zu(),e),t.__exportStar(Qu(),e),t.__exportStar($u(),e)})),td=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SNSServiceException=void 0;let t=(N(),m(j));t.__exportStar(Hu(),e),t.__exportStar(Vu(),e),t.__exportStar(Uu(),e),t.__exportStar(Wu(),e),t.__exportStar(ed(),e);var n=kn();Object.defineProperty(e,`SNSServiceException`,{enumerable:!0,get:function(){return n.SNSServiceException}})})),nd=e=>{let t,n=()=>(t||=e(),t);return n.set=e=>{t=e},n},rd=u(((e,t)=>{t.exports=(e,t=process.argv)=>{let n=e.startsWith(`-`)?``:e.length===1?`-`:`--`,r=t.indexOf(n+e),i=t.indexOf(`--`);return r!==-1&&(i===-1||r<i)}})),id=u(((e,t)=>{let n=h(`os`),r=h(`tty`),i=rd(),{env:a}=process,o;i(`no-color`)||i(`no-colors`)||i(`color=false`)||i(`color=never`)?o=0:(i(`color`)||i(`colors`)||i(`color=true`)||i(`color=always`))&&(o=1),`FORCE_COLOR`in a&&(o=a.FORCE_COLOR===`true`?1:a.FORCE_COLOR===`false`?0:a.FORCE_COLOR.length===0?1:Math.min(parseInt(a.FORCE_COLOR,10),3));function s(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function c(e,t){if(o===0)return 0;if(i(`color=16m`)||i(`color=full`)||i(`color=truecolor`))return 3;if(i(`color=256`))return 2;if(e&&!t&&o===void 0)return 0;let r=o||0;if(a.TERM===`dumb`)return r;if(process.platform===`win32`){let e=n.release().split(`.`);return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if(`CI`in a)return[`TRAVIS`,`CIRCLECI`,`APPVEYOR`,`GITLAB_CI`,`GITHUB_ACTIONS`,`BUILDKITE`].some(e=>e in a)||a.CI_NAME===`codeship`?1:r;if(`TEAMCITY_VERSION`in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if(a.COLORTERM===`truecolor`)return 3;if(`TERM_PROGRAM`in a){let e=parseInt((a.TERM_PROGRAM_VERSION||``).split(`.`)[0],10);switch(a.TERM_PROGRAM){case`iTerm.app`:return e>=3?3:2;case`Apple_Terminal`:return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||`COLORTERM`in a?1:r}function l(e){return s(c(e,e&&e.isTTY))}t.exports={supportsColor:l,stdout:s(c(!0,r.isatty(1))),stderr:s(c(!0,r.isatty(2)))}})),ad=td(),od=nd(()=>new ad.SNSClient({})),sd=e=>{let t={};for(let n in e)t[n]={DataType:`String`,StringValue:e[n]};return t},cd=async({client:e=od(),topic:t,subject:n,payload:r,attributes:i={},region:a=process.env.AWS_REGION,accountId:o=process.env.AWS_ACCOUNT_ID})=>{let s=new ad.PublishCommand({TopicArn:`arn:aws:sns:${a}:${o}:${t}`,Subject:n,Message:r,MessageAttributes:sd({topic:t,...i})});await e.send(s)};const ld=(e,t)=>{let n=process.env.EVENTS_TOPIC;n&&cd({topic:n,payload:ze({event:e,date:new Date,...t}),attributes:{event:e}}).catch(e=>{console.error(`Failed to publish socket event`,e)})},ud=(e,t)=>{let n=t.split(`/`);return e.some(e=>{let t=e.split(`/`);return t.length===n.length?t.every((e,t)=>e===`*`||e===n[t]):!1})},dd=(e,t)=>{let n=me(pe(ne(pe(le(),te(1),ee(128),re(e=>typeof e==`string`&&ud(t,e)))),te(1),ee(32)),e);return n.success?{valid:!0,topics:n.output}:{valid:!1,reason:n.issues[0].message}},fd=e=>{ld(`connected`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context})},pd=e=>{gd(e),e.close(),e.data.authenticated&&ld(`disconnected`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context})},md=(e,t)=>{let n=dd(t,e.data.allowed);if(!n.valid){e.close(4e3,`Invalid topic payload`);return}let r=[...new Set(n.topics)].filter(t=>!e.isSubscribed(t));if(e.subscriptions.length+r.length>32){e.close(4e3,`Too many topic subscriptions`);return}for(let t of r)e.subscribe(t);r.length>0&&ld(`subscribed`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context,topics:r}),e.sendText(`ACK`)},hd=(e,t)=>{let n=dd(t,e.data.allowed);if(!n.valid){e.close(4e3,`Invalid topic payload`);return}let r=n.topics.filter(t=>e.isSubscribed(t));for(let t of r)e.unsubscribe(t);r.length>0&&ld(`unsubscribed`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context,topics:r}),e.sendText(`ACK`)},gd=e=>{let t=e.subscriptions;for(let n of t)e.unsubscribe(n);t.length>0&&ld(`unsubscribed`,{socketId:e.data.id,ip:e.data.ip,context:e.data.context,topics:t})};var _d=u((e=>{e.HttpAuthLocation=void 0,(function(e){e.HEADER=`header`,e.QUERY=`query`})(e.HttpAuthLocation||={}),e.HttpApiKeyAuthLocation=void 0,(function(e){e.HEADER=`header`,e.QUERY=`query`})(e.HttpApiKeyAuthLocation||={}),e.EndpointURLScheme=void 0,(function(e){e.HTTP=`http`,e.HTTPS=`https`})(e.EndpointURLScheme||={}),e.AlgorithmId=void 0,(function(e){e.MD5=`md5`,e.CRC32=`crc32`,e.CRC32C=`crc32c`,e.SHA1=`sha1`,e.SHA256=`sha256`})(e.AlgorithmId||={});let t=t=>{let n=[];return t.sha256!==void 0&&n.push({algorithmId:()=>e.AlgorithmId.SHA256,checksumConstructor:()=>t.sha256}),t.md5!=null&&n.push({algorithmId:()=>e.AlgorithmId.MD5,checksumConstructor:()=>t.md5}),{addChecksumAlgorithm(e){n.push(e)},checksumAlgorithms(){return n}}},n=e=>{let t={};return e.checksumAlgorithms().forEach(e=>{t[e.algorithmId()]=e.checksumConstructor()}),t};e.FieldPosition=void 0,(function(e){e[e.HEADER=0]=`HEADER`,e[e.TRAILER=1]=`TRAILER`})(e.FieldPosition||={}),e.IniSectionType=void 0,(function(e){e.PROFILE=`profile`,e.SSO_SESSION=`sso-session`,e.SERVICES=`services`})(e.IniSectionType||={}),e.RequestHandlerProtocol=void 0,(function(e){e.HTTP_0_9=`http/0.9`,e.HTTP_1_0=`http/1.0`,e.TDS_8_0=`tds/8.0`})(e.RequestHandlerProtocol||={}),e.SMITHY_CONTEXT_KEY=`__smithy_context`,e.getDefaultClientConfiguration=e=>t(e),e.resolveDefaultRuntimeConfig=e=>n(e)})),vd=u((e=>{var t=_d();let n=e=>({setHttpHandler(t){e.httpHandler=t},httpHandler(){return e.httpHandler},updateHttpClientConfig(t,n){e.httpHandler?.updateHttpClientConfig(t,n)},httpHandlerConfigs(){return e.httpHandler.httpHandlerConfigs()}}),r=e=>({httpHandler:e.httpHandler()});var i=class{name;kind;values;constructor({name:e,kind:n=t.FieldPosition.HEADER,values:r=[]}){this.name=e,this.kind=n,this.values=r}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter(t=>t!==e)}toString(){return this.values.map(e=>e.includes(`,`)||e.includes(` `)?`"${e}"`:e).join(`, `)}get(){return this.values}},a=class{entries={};encoding;constructor({fields:e=[],encoding:t=`utf-8`}){e.forEach(this.setField.bind(this)),this.encoding=t}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter(t=>t.kind===e)}},o=class e{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;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(t){let n=new e({...t,headers:{...t.headers}});return n.query&&=s(n.query),n}static isInstance(e){if(!e)return!1;let t=e;return`method`in t&&`protocol`in t&&`hostname`in t&&`path`in t&&typeof t.query==`object`&&typeof t.headers==`object`}clone(){return e.clone(this)}};function s(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return{...t,[n]:Array.isArray(r)?[...r]:r}},{})}var c=class{statusCode;reason;headers;body;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;let t=e;return typeof t.statusCode==`number`&&typeof t.headers==`object`}};function l(e){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(e)}e.Field=i,e.Fields=a,e.HttpRequest=o,e.HttpResponse=c,e.getHttpHandlerExtensionConfiguration=n,e.isValidHostname=l,e.resolveHttpHandlerRuntimeConfig=r})),yd=u((e=>{var t=vd();function n(e){return e}let r=e=>n=>async r=>{if(!t.HttpRequest.isInstance(r.request))return n(r);let{request:i}=r,{handlerProtocol:a=``}=e.requestHandler.metadata||{};if(a.indexOf(`h2`)>=0&&!i.headers[`:authority`])delete i.headers.host,i.headers[`:authority`]=i.hostname+(i.port?`:`+i.port:``);else if(!i.headers.host){let e=i.hostname;i.port!=null&&(e+=`:${i.port}`),i.headers.host=e}return n(r)},i={name:`hostHeaderMiddleware`,step:`build`,priority:`low`,tags:[`HOST`],override:!0};e.getHostHeaderPlugin=e=>({applyToStack:t=>{t.add(r(e),i)}}),e.hostHeaderMiddleware=r,e.hostHeaderMiddlewareOptions=i,e.resolveHostHeaderConfig=n})),bd=u((e=>{let t=()=>(e,t)=>async n=>{try{let r=await e(n),{clientName:i,commandName:a,logger:o,dynamoDbDocumentClientOptions:s={}}=t,{overrideInputFilterSensitiveLog:c,overrideOutputFilterSensitiveLog:l}=s,u=c??t.inputFilterSensitiveLog,d=l??t.outputFilterSensitiveLog,{$metadata:f,...p}=r.output;return o?.info?.({clientName:i,commandName:a,input:u(n.input),output:d(p),metadata:f}),r}catch(e){let{clientName:r,commandName:i,logger:a,dynamoDbDocumentClientOptions:o={}}=t,{overrideInputFilterSensitiveLog:s}=o,c=s??t.inputFilterSensitiveLog;throw a?.error?.({clientName:r,commandName:i,input:c(n.input),error:e,metadata:e.$metadata}),e}},n={name:`loggerMiddleware`,tags:[`LOGGER`],step:`initialize`,override:!0};e.getLoggerPlugin=e=>({applyToStack:e=>{e.add(t(),n)}}),e.loggerMiddleware=t,e.loggerMiddlewareOptions=n})),xd=d({InvokeStore:()=>Dd,InvokeStoreBase:()=>wd}),Sd,Cd,wd,Td,Ed,Dd,Od=l((()=>{Sd={REQUEST_ID:Symbol.for(`_AWS_LAMBDA_REQUEST_ID`),X_RAY_TRACE_ID:Symbol.for(`_AWS_LAMBDA_X_RAY_TRACE_ID`),TENANT_ID:Symbol.for(`_AWS_LAMBDA_TENANT_ID`)},Cd=[`true`,`1`].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??``),Cd||(globalThis.awslambda=globalThis.awslambda||{}),wd=class{static PROTECTED_KEYS=Sd;isProtectedKey(e){return Object.values(Sd).includes(e)}getRequestId(){return this.get(Sd.REQUEST_ID)??`-`}getXRayTraceId(){return this.get(Sd.X_RAY_TRACE_ID)}getTenantId(){return this.get(Sd.TENANT_ID)}},Td=class extends wd{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(e){return this.currentContext?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);this.currentContext=this.currentContext||{},this.currentContext[e]=t}run(e,t){return this.currentContext=e,t()}},Ed=class e extends wd{als;static async create(){let t=new e;return t.als=new(await(import(`node:async_hooks`))).AsyncLocalStorage,t}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(e){return this.als.getStore()?.[e]}set(e,t){if(this.isProtectedKey(e))throw Error(`Cannot modify protected Lambda context field: ${String(e)}`);let n=this.als.getStore();if(!n)throw Error(`No context available`);n[e]=t}run(e,t){return this.als.run(e,t)}},(function(e){let t=null;async function n(e){return t||=(async()=>{let t=e===!0||`AWS_LAMBDA_MAX_CONCURRENCY`in process.env?await Ed.create():new Td;return!Cd&&globalThis.awslambda?.InvokeStore?globalThis.awslambda.InvokeStore:(!Cd&&globalThis.awslambda&&(globalThis.awslambda.InvokeStore=t),t)})(),t}e.getInstanceAsync=n,e._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE===`1`?{reset:()=>{t=null,globalThis.awslambda?.InvokeStore&&delete globalThis.awslambda.InvokeStore,globalThis.awslambda={InvokeStore:void 0}}}:void 0})(Dd||={})})),kd=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.recursionDetectionMiddleware=void 0;let t=(Od(),m(xd)),n=vd(),r=`X-Amzn-Trace-Id`;e.recursionDetectionMiddleware=()=>e=>async i=>{let{request:a}=i;if(!n.HttpRequest.isInstance(a))return e(i);let o=Object.keys(a.headers??{}).find(e=>e.toLowerCase()===`x-amzn-trace-id`)??r;if(a.headers.hasOwnProperty(o))return e(i);let s=process.env.AWS_LAMBDA_FUNCTION_NAME,c=process.env._X_AMZN_TRACE_ID,l=(await t.InvokeStore.getInstanceAsync())?.getXRayTraceId()??c,u=e=>typeof e==`string`&&e.length>0;return u(s)&&u(l)&&(a.headers[r]=l),e({...i,request:a})}})),Ad=u((e=>{var t=kd();let n={step:`build`,tags:[`RECURSION_DETECTION`],name:`recursionDetectionMiddleware`,override:!0,priority:`low`};e.getRecursionDetectionPlugin=e=>({applyToStack:e=>{e.add(t.recursionDetectionMiddleware(),n)}}),Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])})})),jd,Md,Nd=l((()=>{jd=_d(),Md=e=>e[jd.SMITHY_CONTEXT_KEY]||(e[jd.SMITHY_CONTEXT_KEY]={})})),Pd=u((e=>{var t=_d();e.getSmithyContext=e=>e[t.SMITHY_CONTEXT_KEY]||(e[t.SMITHY_CONTEXT_KEY]={}),e.normalizeProvider=e=>{if(typeof e==`function`)return e;let t=Promise.resolve(e);return()=>t}})),Fd,Id=l((()=>{Fd=(e,t)=>{if(!t||t.length===0)return e;let n=[];for(let r of t)for(let t of e)t.schemeId.split(`#`)[1]===r&&n.push(t);for(let t of e)n.find(({schemeId:e})=>e===t.schemeId)||n.push(t);return n}}));function Ld(e){let t=new Map;for(let n of e)t.set(n.schemeId,n);return t}var Rd,zd,Bd=l((()=>{Rd=Pd(),Id(),zd=(e,t)=>(n,r)=>async i=>{let a=Fd(e.httpAuthSchemeProvider(await t.httpAuthSchemeParametersProvider(e,r,i.input)),e.authSchemePreference?await e.authSchemePreference():[]),o=Ld(e.httpAuthSchemes),s=(0,Rd.getSmithyContext)(r),c=[];for(let n of a){let i=o.get(n.schemeId);if(!i){c.push(`HttpAuthScheme \`${n.schemeId}\` was not enabled for this service.`);continue}let a=i.identityProvider(await t.identityProviderConfigProvider(e));if(!a){c.push(`HttpAuthScheme \`${n.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:l={},signingProperties:u={}}=n.propertiesExtractor?.(e,r)||{};n.identityProperties=Object.assign(n.identityProperties||{},l),n.signingProperties=Object.assign(n.signingProperties||{},u),s.selectedHttpAuthScheme={httpAuthOption:n,identity:await a(n.identityProperties),signer:i.signer};break}if(!s.selectedHttpAuthScheme)throw Error(c.join(`
|
|
29
|
+
`));return n(i)}})),Vd,Hd,Ud=l((()=>{Bd(),Vd={step:`serialize`,tags:[`HTTP_AUTH_SCHEME`],name:`httpAuthSchemeMiddleware`,override:!0,relation:`before`,toMiddleware:`endpointV2Middleware`},Hd=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(zd(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),Vd)}})})),Wd,Gd,Kd=l((()=>{Bd(),Wd={step:`serialize`,tags:[`HTTP_AUTH_SCHEME`],name:`httpAuthSchemeMiddleware`,override:!0,relation:`before`,toMiddleware:`serializerMiddleware`},Gd=(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n})=>({applyToStack:r=>{r.addRelativeTo(zd(e,{httpAuthSchemeParametersProvider:t,identityProviderConfigProvider:n}),Wd)}})})),qd=l((()=>{Bd(),Ud(),Kd()})),Jd,Yd,Xd,Zd,Qd,$d=l((()=>{Jd=vd(),Yd=Pd(),Xd=e=>e=>{throw e},Zd=(e,t)=>{},Qd=e=>(e,t)=>async n=>{if(!Jd.HttpRequest.isInstance(n.request))return e(n);let r=(0,Yd.getSmithyContext)(t).selectedHttpAuthScheme;if(!r)throw Error(`No HttpAuthScheme was selected: unable to sign request`);let{httpAuthOption:{signingProperties:i={}},identity:a,signer:o}=r,s=await e({...n,request:await o.sign(n.request,a,i)}).catch((o.errorHandler||Xd)(i));return(o.successHandler||Zd)(s.response,i),s}})),ef,tf,nf=l((()=>{$d(),ef={step:`finalizeRequest`,tags:[`HTTP_SIGNING`],name:`httpSigningMiddleware`,aliases:[`apiKeyMiddleware`,`tokenMiddleware`,`awsAuthMiddleware`],override:!0,relation:`after`,toMiddleware:`retryMiddleware`},tf=e=>({applyToStack:t=>{t.addRelativeTo(Qd(e),ef)}})})),rf=l((()=>{$d(),nf()})),af,of=l((()=>{af=e=>{if(typeof e==`function`)return e;let t=Promise.resolve(e);return()=>t}}));function sf(e,t,n,r,i){return async function*(a,o,...s){let c=o,l=a.startingToken??c[n],u=!0,d;for(;u;){if(c[n]=l,i&&(c[i]=c[i]??a.pageSize),a.client instanceof e)d=await cf(t,a.client,o,a.withCommand,...s);else throw Error(`Invalid client, expected instance of ${e.name}`);yield d;let f=l;l=lf(d,r),u=!!(l&&(!a.stopOnSameToken||l!==f))}return void 0}}var cf,lf,uf=l((()=>{cf=async(e,t,n,r=e=>e,...i)=>{let a=new e(n);return a=r(a)??a,await t.send(a,...i)},lf=(e,t)=>{let n=e,r=t.split(`.`);for(let e of r){if(!n||typeof n!=`object`)return;n=n[e]}return n}})),df=u((e=>{e.isArrayBuffer=e=>typeof ArrayBuffer==`function`&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`})),ff=u((e=>{var t=df(),n=h(`buffer`);e.fromArrayBuffer=(e,r=0,i=e.byteLength-r)=>{if(!t.isArrayBuffer(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return n.Buffer.from(e,r,i)},e.fromString=(e,t)=>{if(typeof e!=`string`)throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?n.Buffer.from(e,t):n.Buffer.from(e)}})),pf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromBase64=void 0;let t=ff(),n=/^[A-Za-z0-9+/]*={0,2}$/;e.fromBase64=e=>{if(e.length*3%4!=0)throw TypeError(`Incorrect padding on base64 string.`);if(!n.exec(e))throw TypeError(`Invalid base64 string.`);let r=(0,t.fromString)(e,`base64`);return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}})),mf=u((e=>{var t=ff();let n=e=>{let n=t.fromString(e,`utf8`);return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT)};e.fromUtf8=n,e.toUint8Array=e=>typeof e==`string`?n(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),e.toUtf8=e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||typeof e.byteOffset!=`number`||typeof e.byteLength!=`number`)throw Error(`@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.`);return t.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`)}})),hf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.toBase64=void 0;let t=ff(),n=mf();e.toBase64=e=>{let r;if(r=typeof e==`string`?(0,n.fromUtf8)(e):e,typeof r!=`object`||typeof r.byteOffset!=`number`||typeof r.byteLength!=`number`)throw Error(`@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.`);return(0,t.fromArrayBuffer)(r.buffer,r.byteOffset,r.byteLength).toString(`base64`)}})),gf=u((e=>{var t=pf(),n=hf();Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),Object.prototype.hasOwnProperty.call(n,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:n.__proto__}),Object.keys(n).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=n[t])})})),_f=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChecksumStream=void 0;let t=gf(),n=h(`stream`);e.ChecksumStream=class extends n.Duplex{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;pendingCallback=null;constructor({expectedChecksum:e,checksum:n,source:r,checksumSourceLocation:i,base64Encoder:a}){if(super(),typeof r.pipe==`function`)this.source=r;else throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);this.base64Encoder=a??t.toBase64,this.expectedChecksum=e,this.checksum=n,this.checksumSourceLocation=i,this.source.pipe(this)}_read(e){if(this.pendingCallback){let e=this.pendingCallback;this.pendingCallback=null,e()}}_write(e,t,n){try{if(this.checksum.update(e),!this.push(e)){this.pendingCallback=n;return}}catch(e){return n(e)}return n()}async _final(e){try{let t=await this.checksum.digest(),n=this.base64Encoder(t);if(this.expectedChecksum!==n)return e(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`))}catch(t){return e(t)}return this.push(null),e()}}})),vf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isBlob=e.isReadableStream=void 0,e.isReadableStream=e=>typeof ReadableStream==`function`&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),e.isBlob=e=>typeof Blob==`function`&&(e?.constructor?.name===Blob.name||e instanceof Blob)})),yf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ChecksumStream=void 0;let t=typeof ReadableStream==`function`?ReadableStream:function(){};e.ChecksumStream=class extends t{}})),bf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createChecksumStream=void 0;let t=gf(),n=vf(),r=yf();e.createChecksumStream=({expectedChecksum:e,checksum:i,source:a,checksumSourceLocation:o,base64Encoder:s})=>{if(!(0,n.isReadableStream)(a))throw Error(`@smithy/util-stream: unsupported source type ${a?.constructor?.name??a} in ChecksumStream.`);let c=s??t.toBase64;if(typeof TransformStream!=`function`)throw Error(`@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.`);let l=new TransformStream({start(){},async transform(e,t){i.update(e),t.enqueue(e)},async flush(t){let n=c(await i.digest());if(e!==n){let r=Error(`Checksum mismatch: expected "${e}" but received "${n}" in response header "${o}".`);t.error(r)}else t.terminate()}});a.pipeThrough(l);let u=l.readable;return Object.setPrototypeOf(u,r.ChecksumStream.prototype),u}})),xf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createChecksumStream=i;let t=vf(),n=_f(),r=bf();function i(e){return typeof ReadableStream==`function`&&(0,t.isReadableStream)(e.source)?(0,r.createChecksumStream)(e):new n.ChecksumStream(e)}})),Sf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ByteArrayCollector=void 0,e.ByteArrayCollector=class{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let e=this.byteArrays[0];return this.reset(),e}let e=this.allocByteArray(this.byteLength),t=0;for(let n=0;n<this.byteArrays.length;++n){let r=this.byteArrays[n];e.set(r,t),t+=r.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}})),Cf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createBufferedReadable=void 0,e.createBufferedReadableStream=n,e.merge=r,e.flush=i,e.sizeOf=a,e.modeOf=o;let t=Sf();function n(e,n,s){let c=e.getReader(),l=!1,u=0,d=[``,new t.ByteArrayCollector(e=>new Uint8Array(e))],f=-1,p=async e=>{let{value:t,done:m}=await c.read(),h=t;if(m){if(f!==-1){let t=i(d,f);a(t)>0&&e.enqueue(t)}e.close()}else{let t=o(h,!1);if(f!==t&&(f>=0&&e.enqueue(i(d,f)),f=t),f===-1){e.enqueue(h);return}let c=a(h);u+=c;let m=a(d[f]);if(c>=n&&m===0)e.enqueue(h);else{let t=r(d,f,h);!l&&u>n*2&&(l=!0,s?.warn(`@smithy/util-stream - stream chunk size ${c} is below threshold of ${n}, automatically buffering.`)),t>=n?e.enqueue(i(d,f)):await p(e)}}};return new ReadableStream({pull:p})}e.createBufferedReadable=n;function r(e,t,n){switch(t){case 0:return e[0]+=n,a(e[0]);case 1:case 2:return e[t].push(n),a(e[t])}}function i(e,t){switch(t){case 0:let n=e[0];return e[0]=``,n;case 1:case 2:return e[t].flush()}throw Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function a(e){return e?.byteLength??e?.length??0}function o(e,t=!0){return t&&typeof Buffer<`u`&&e instanceof Buffer?2:e instanceof Uint8Array?1:typeof e==`string`?0:-1}})),wf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createBufferedReadable=a;let t=h(`node:stream`),n=Sf(),r=Cf(),i=vf();function a(e,a,o){if((0,i.isReadableStream)(e))return(0,r.createBufferedReadableStream)(e,a,o);let s=new t.Readable({read(){}}),c=!1,l=0,u=[``,new n.ByteArrayCollector(e=>new Uint8Array(e)),new n.ByteArrayCollector(e=>Buffer.from(new Uint8Array(e)))],d=-1;return e.on(`data`,e=>{let t=(0,r.modeOf)(e,!0);if(d!==t&&(d>=0&&s.push((0,r.flush)(u,d)),d=t),d===-1){s.push(e);return}let n=(0,r.sizeOf)(e);l+=n;let i=(0,r.sizeOf)(u[d]);if(n>=a&&i===0)s.push(e);else{let t=(0,r.merge)(u,d,e);!c&&l>a*2&&(c=!0,o?.warn(`@smithy/util-stream - stream chunk size ${n} is below threshold of ${a}, automatically buffering.`)),t>=a&&s.push((0,r.flush)(u,d))}}),e.on(`end`,()=>{if(d!==-1){let e=(0,r.flush)(u,d);(0,r.sizeOf)(e)>0&&s.push(e)}s.push(null)}),s}})),Tf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getAwsChunkedEncodingStream=void 0,e.getAwsChunkedEncodingStream=(e,t)=>{let{base64Encoder:n,bodyLengthChecker:r,checksumAlgorithmFn:i,checksumLocationName:a,streamHasher:o}=t,s=n!==void 0&&r!==void 0&&i!==void 0&&a!==void 0&&o!==void 0,c=s?o(i,e):void 0,l=e.getReader();return new ReadableStream({async pull(e){let{value:t,done:i}=await l.read();if(i){if(e.enqueue(`0\r
|
|
30
30
|
`),s){let t=n(await c);e.enqueue(`${a}:${t}\r\n`),e.enqueue(`\r
|
|
31
|
-
`)}e.close()}else e.enqueue(`${(r(t)||0).toString(16)}\r\n${t}\r\n`)}})}})),
|
|
31
|
+
`)}e.close()}else e.enqueue(`${(r(t)||0).toString(16)}\r\n${t}\r\n`)}})}})),Ef=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getAwsChunkedEncodingStream=i;let t=h(`node:stream`),n=Tf(),r=vf();function i(e,i){let a=e,o=e;if((0,r.isReadableStream)(o))return(0,n.getAwsChunkedEncodingStream)(o,i);let{base64Encoder:s,bodyLengthChecker:c,checksumAlgorithmFn:l,checksumLocationName:u,streamHasher:d}=i,f=s!==void 0&&l!==void 0&&u!==void 0&&d!==void 0,p=f?d(l,a):void 0,m=new t.Readable({read:()=>{}});return a.on(`data`,e=>{let t=c(e)||0;t!==0&&(m.push(`${t.toString(16)}\r\n`),m.push(e),m.push(`\r
|
|
32
32
|
`))}),a.on(`end`,async()=>{if(m.push(`0\r
|
|
33
33
|
`),f){let e=s(await p);m.push(`${u}:${e}\r\n`),m.push(`\r
|
|
34
|
-
`)}m.push(null)}),m}})),
|
|
34
|
+
`)}m.push(null)}),m}})),Df=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.headStream=t;async function t(e,t){let n=0,r=[],i=e.getReader(),a=!1;for(;!a;){let{done:e,value:o}=await i.read();if(o&&(r.push(o),n+=o?.byteLength??0),n>=t)break;a=e}i.releaseLock();let o=new Uint8Array(Math.min(t,n)),s=0;for(let e of r){if(e.byteLength>o.byteLength-s){o.set(e.subarray(0,o.byteLength-s),s);break}else o.set(e,s);s+=e.length}return o}})),Of=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.headStream=void 0;let t=h(`stream`),n=Df(),r=vf();e.headStream=(e,t)=>(0,r.isReadableStream)(e)?(0,n.headStream)(e,t):new Promise((n,r)=>{let a=new i;a.limit=t,e.pipe(a),e.on(`error`,e=>{a.end(),r(e)}),a.on(`error`,r),a.on(`finish`,function(){n(new Uint8Array(Buffer.concat(this.buffers)))})});var i=class extends t.Writable{buffers=[];limit=1/0;bytesBuffered=0;_write(e,t,n){if(this.buffers.push(e),this.bytesBuffered+=e.byteLength??0,this.bytesBuffered>=this.limit){let e=this.bytesBuffered-this.limit,t=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=t.subarray(0,t.byteLength-e),this.emit(`finish`)}n()}}})),kf=u((e=>{let t=e=>encodeURIComponent(e).replace(/[!'()*]/g,n),n=e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;e.escapeUri=t,e.escapeUriPath=e=>e.split(`/`).map(t).join(`/`)})),Af=u((e=>{var t=kf();function n(e){let n=[];for(let r of Object.keys(e).sort()){let i=e[r];if(r=t.escapeUri(r),Array.isArray(i))for(let e=0,a=i.length;e<a;e++)n.push(`${r}=${t.escapeUri(i[e])}`);else{let e=r;(i||typeof i==`string`)&&(e+=`=${t.escapeUri(i)}`),n.push(e)}}return n.join(`&`)}e.buildQueryString=n})),jf=u((e=>{var t=vd(),n=Af(),r=h(`node:https`),i=h(`node:stream`),a=h(`node:http2`);function o(e){let t=e&&typeof e==`object`&&`reason`in e?e.reason:void 0;if(t){if(t instanceof Error){let e=Error(`Request aborted`);return e.name=`AbortError`,e.cause=t,e}let e=Error(String(t));return e.name=`AbortError`,e}let n=Error(`Request aborted`);return n.name=`AbortError`,n}let s=[`ECONNRESET`,`EPIPE`,`ETIMEDOUT`],c=e=>{let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.join(`,`):r}return t},l={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},u=1e3,d=(e,t,n=0)=>{if(!n)return-1;let r=r=>{let i=l.setTimeout(()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:`TimeoutError`}))},n-r),a=e=>{e?.connecting?e.on(`connect`,()=>{l.clearTimeout(i)}):l.clearTimeout(i)};e.socket?a(e.socket):e.on(`socket`,a)};return n<2e3?(r(0),0):l.setTimeout(r.bind(null,u),u)},f=(e,t,n=0,r,i)=>n?l.setTimeout(()=>{let a=`@smithy/node-http-handler - [${r?`ERROR`:`WARN`}] a request has exceeded the configured ${n} ms requestTimeout.`;if(r){let n=Object.assign(Error(a),{name:`TimeoutError`,code:`ETIMEDOUT`});e.destroy(n),t(n)}else a+=` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`,i?.warn?.(a)},n):-1,p=(e,{keepAlive:t,keepAliveMsecs:n},r=3e3)=>{if(t!==!0)return-1;let i=()=>{e.socket?e.socket.setKeepAlive(t,n||0):e.on(`socket`,e=>{e.setKeepAlive(t,n||0)})};return r===0?(i(),0):l.setTimeout(i,r)},m=3e3,g=(e,t,n=0)=>{let r=r=>{let i=n-r,a=()=>{e.destroy(),t(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:`TimeoutError`}))};e.socket?(e.socket.setTimeout(i,a),e.on(`close`,()=>e.socket?.removeListener(`timeout`,a))):e.setTimeout(i,a)};return 0<n&&n<6e3?(r(0),0):l.setTimeout(r.bind(null,n===0?0:m),m)},_=6e3;async function v(e,t,n=_,r=!1){let i=t.headers??{},a=i.Expect||i.expect,o=-1,s=!0;!r&&a===`100-continue`&&(s=await Promise.race([new Promise(e=>{o=Number(l.setTimeout(()=>e(!0),Math.max(_,n)))}),new Promise(t=>{e.on(`continue`,()=>{l.clearTimeout(o),t(!0)}),e.on(`response`,()=>{l.clearTimeout(o),t(!1)}),e.on(`error`,()=>{l.clearTimeout(o),t(!1)})})])),s&&y(e,t.body)}function y(e,t){if(t instanceof i.Readable){t.pipe(e);return}if(t){let n=Buffer.isBuffer(t);if(n||typeof t==`string`){n&&t.byteLength===0?e.end():e.end(t);return}let r=t;if(typeof r==`object`&&r.buffer&&typeof r.byteOffset==`number`&&typeof r.byteLength==`number`){e.end(Buffer.from(r.buffer,r.byteOffset,r.byteLength));return}e.end(Buffer.from(t));return}e.end()}let b,x;var S=class e{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:`http/1.1`};static create(t){return typeof t?.handle==`function`?t:new e(t)}static checkSocketUsage(e,t,n=console){let{sockets:r,requests:i,maxSockets:a}=e;if(typeof a!=`number`||a===1/0||Date.now()-15e3<t)return t;if(r&&i)for(let e in r){let t=r[e]?.length??0,o=i[e]?.length??0;if(t>=a&&o>=2*a)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${t} and ${o} additional requests are enqueued.
|
|
35
35
|
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
36
|
-
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(this.resolveDefaultConfig(e))}).catch(n):t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(i,{abortSignal:a,requestTimeout:u}={}){this.config||=await this.configProvider;let m=this.config,h=i.protocol===`https:`;return!h&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((_,y)=>{let S,C=[],w=async e=>{await S,C.forEach(l.clearTimeout),_(e)},ee=async e=>{await S,C.forEach(l.clearTimeout),y(e)};if(a?.aborted){ee(o(a));return}let te=i.headers??{},T=(te.Expect??te.expect)===`100-continue`,E=h?m.httpsAgent:m.httpAgent;T&&!this.externalAgent&&(E=new(h?r.Agent:b)({keepAlive:!1,maxSockets:1/0})),C.push(l.setTimeout(()=>{this.socketWarningTimestamp=e.checkSocketUsage(E,this.socketWarningTimestamp,m.logger)},m.socketAcquisitionWarningTimeout??(m.requestTimeout??2e3)+(m.connectionTimeout??1e3)));let ne=n.buildQueryString(i.query||{}),re;(i.username!=null||i.password!=null)&&(re=`${i.username??``}:${i.password??``}`);let ie=i.path;ne&&(ie+=`?${ne}`),i.fragment&&(ie+=`#${i.fragment}`);let ae=i.hostname??``;ae=ae[0]===`[`&&ae.endsWith(`]`)?i.hostname.slice(1,-1):i.hostname;let oe={headers:i.headers,host:ae,method:i.method,path:ie,port:i.port,agent:E,auth:re},se=(h?r.request:x)(oe,e=>{w({response:new t.HttpResponse({statusCode:e.statusCode||-1,reason:e.statusMessage,headers:c(e.headers),body:e})})});if(se.on(`error`,e=>{s.includes(e.code)?ee(Object.assign(e,{name:`TimeoutError`})):ee(e)}),a){let e=()=>{se.destroy(),ee(o(a))};if(typeof a.addEventListener==`function`){let t=a;t.addEventListener(`abort`,e,{once:!0}),se.once(`close`,()=>t.removeEventListener(`abort`,e))}else a.onabort=e}let ce=u??m.requestTimeout;C.push(d(se,ee,m.connectionTimeout)),C.push(f(se,ee,ce,m.throwOnRequestTimeout,m.logger??console)),C.push(g(se,ee,m.socketTimeout));let le=oe.agent;typeof le==`object`&&`keepAlive`in le&&C.push(p(se,{keepAlive:le.keepAlive,keepAliveMsecs:le.keepAliveMsecs})),S=v(se,i,ce,this.externalAgent).catch(e=>(C.forEach(l.clearTimeout),y(e)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:n,socketTimeout:i,socketAcquisitionWarningTimeout:a,httpAgent:o,httpsAgent:s,throwOnRequestTimeout:c,logger:l}=e||{};return{connectionTimeout:n,requestTimeout:t,socketTimeout:i,socketAcquisitionWarningTimeout:a,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:e,request:t}=await import(`node:http`);return x=t,b=e,o instanceof b||typeof o?.destroy==`function`?(this.externalAgent=!0,o):new b({keepAlive:!0,maxSockets:50,...o})},httpsAgent:s instanceof r.Agent||typeof s?.destroy==`function`?(this.externalAgent=!0,s):new r.Agent({keepAlive:!0,maxSockets:50,...s}),logger:l}}},C=class{sessions=[];constructor(e){this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter(t=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)t===e&&(t.destroyed||t.destroy())}},w=class{constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError(`maxConcurrency must be greater than zero.`)}config;sessionCache=new Map;lease(e,t){let n=this.getUrlString(e),r=this.sessionCache.get(n);if(r){let e=r.poll();if(e&&!this.config.disableConcurrency)return e}let i=a.connect(n);this.config.maxConcurrency&&i.settings({maxConcurrentStreams:this.config.maxConcurrency},t=>{if(t)throw Error(`Fail to set maxConcurrentStreams to `+this.config.maxConcurrency+`when creating new session for `+e.destination.toString())}),i.unref();let o=()=>{i.destroy(),this.deleteSession(n,i)};i.on(`goaway`,o),i.on(`error`,o),i.on(`frameError`,o),i.on(`close`,()=>this.deleteSession(n,i)),t.requestTimeout&&i.setTimeout(t.requestTimeout,o);let s=this.sessionCache.get(n)||new C;return s.offerLast(i),this.sessionCache.set(n,s),i}deleteSession(e,t){let n=this.sessionCache.get(e);n&&n.contains(t)&&(n.remove(t),this.sessionCache.set(e,n))}release(e,t){let n=this.getUrlString(e);this.sessionCache.get(n)?.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let e of t)e.destroyed||e.destroy(),t.remove(e);this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError(`maxConcurrentStreams must be greater than zero.`);this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}},ee=class e{config;configProvider;metadata={handlerProtocol:`h2`};connectionManager=new w({});static create(t){return typeof t?.handle==`function`?t:new e(t)}constructor(e){this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(e||{})}).catch(n):t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:r,requestTimeout:i}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));let{requestTimeout:s,disableConcurrentStreams:l}=this.config,u=i??s;return new Promise((i,s)=>{let d=!1,f,p=async e=>{await f,i(e)},m=async e=>{await f,s(e)};if(r?.aborted){d=!0,m(o(r));return}let{hostname:h,method:g,port:_,protocol:y,query:b}=e,x=``;(e.username!=null||e.password!=null)&&(x=`${e.username??``}:${e.password??``}@`);let S=`${y}//${x}${h}${_?`:${_}`:``}`,C={destination:new URL(S)},w=this.connectionManager.lease(C,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:l||!1}),ee=e=>{l&&this.destroySession(w),d=!0,m(e)},te=n.buildQueryString(b||{}),T=e.path;te&&(T+=`?${te}`),e.fragment&&(T+=`#${e.fragment}`);let E=w.request({...e.headers,[a.constants.HTTP2_HEADER_PATH]:T,[a.constants.HTTP2_HEADER_METHOD]:g});if(w.ref(),E.on(`response`,e=>{let n=new t.HttpResponse({statusCode:e[`:status`]||-1,headers:c(e),body:E});d=!0,p({response:n}),l&&(w.close(),this.connectionManager.deleteSession(S,w))}),u&&E.setTimeout(u,()=>{E.close();let e=Error(`Stream timed out because of no activity for ${u} ms`);e.name=`TimeoutError`,ee(e)}),r){let e=()=>{E.close(),ee(o(r))};if(typeof r.addEventListener==`function`){let t=r;t.addEventListener(`abort`,e,{once:!0}),E.once(`close`,()=>t.removeEventListener(`abort`,e))}else r.onabort=e}E.on(`frameError`,(e,t,n)=>{ee(Error(`Frame type id ${e} in stream id ${n} has failed with code ${t}.`))}),E.on(`error`,ee),E.on(`aborted`,()=>{ee(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${E.rstCode}.`))}),E.on(`close`,()=>{w.unref(),l&&w.destroy(),d||ee(Error(`Unexpected error: http2 request did not get a response`))}),f=v(E,e,u)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}destroySession(e){e.destroyed||e.destroy()}},te=class extends i.Writable{bufferedBytes=[];_write(e,t,n){this.bufferedBytes.push(e),n()}};let T=e=>E(e)?ne(e):new Promise((t,n)=>{let r=new te;e.pipe(r),e.on(`error`,e=>{r.end(),n(e)}),r.on(`error`,n),r.on(`finish`,function(){t(new Uint8Array(Buffer.concat(this.bufferedBytes)))})}),E=e=>typeof ReadableStream==`function`&&e instanceof ReadableStream;async function ne(e){let t=[],n=e.getReader(),r=!1,i=0;for(;!r;){let{done:e,value:a}=await n.read();a&&(t.push(a),i+=a.length),r=e}let a=new Uint8Array(i),o=0;for(let e of t)a.set(e,o),o+=e.length;return a}e.DEFAULT_REQUEST_TIMEOUT=0,e.NodeHttp2Handler=ee,e.NodeHttpHandler=S,e.streamCollector=T})),jf=u((e=>{var t=_d(),n=kf(),r=hf();function i(e,t){return new Request(e,t)}function a(e=0){return new Promise((t,n)=>{e&&setTimeout(()=>{let t=Error(`Request did not complete within ${e} ms`);t.name=`TimeoutError`,n(t)},e)})}let o={supported:void 0};var s=class e{config;configProvider;static create(t){return typeof t?.handle==`function`?t:new e(t)}constructor(e){typeof e==`function`?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),o.supported===void 0&&(o.supported=typeof Request<`u`&&`keepalive`in i(`https://[::1]`))}destroy(){}async handle(e,{abortSignal:r,requestTimeout:s}={}){this.config||=await this.configProvider;let l=s??this.config.requestTimeout,u=this.config.keepAlive===!0,d=this.config.credentials;if(r?.aborted){let e=c(r);return Promise.reject(e)}let f=e.path,p=n.buildQueryString(e.query||{});p&&(f+=`?${p}`),e.fragment&&(f+=`#${e.fragment}`);let m=``;(e.username!=null||e.password!=null)&&(m=`${e.username??``}:${e.password??``}@`);let{port:h,method:g}=e,_=`${e.protocol}//${m}${e.hostname}${h?`:${h}`:``}${f}`,v=g===`GET`||g===`HEAD`?void 0:e.body,y={body:v,headers:new Headers(e.headers),method:g,credentials:d};this.config?.cache&&(y.cache=this.config.cache),v&&(y.duplex=`half`),typeof AbortController<`u`&&(y.signal=r),o.supported&&(y.keepalive=u),typeof this.config.requestInit==`function`&&Object.assign(y,this.config.requestInit(e));let b=()=>{},x=i(_,y),S=[fetch(x).then(e=>{let n=e.headers,r={};for(let e of n.entries())r[e[0]]=e[1];return e.body==null?e.blob().then(n=>({response:new t.HttpResponse({headers:r,reason:e.statusText,statusCode:e.status,body:n})})):{response:new t.HttpResponse({headers:r,reason:e.statusText,statusCode:e.status,body:e.body})}}),a(l)];return r&&S.push(new Promise((e,t)=>{let n=()=>{t(c(r))};if(typeof r.addEventListener==`function`){let e=r;e.addEventListener(`abort`,n,{once:!0}),b=()=>e.removeEventListener(`abort`,n)}else r.onabort=n})),Promise.race(S).finally(b)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}};function c(e){let t=e&&typeof e==`object`&&`reason`in e?e.reason:void 0;if(t){if(t instanceof Error){let e=Error(`Request aborted`);return e.name=`AbortError`,e.cause=t,e}let e=Error(String(t));return e.name=`AbortError`,e}let n=Error(`Request aborted`);return n.name=`AbortError`,n}let l=async e=>typeof Blob==`function`&&e instanceof Blob||e.constructor?.name===`Blob`?Blob.prototype.arrayBuffer===void 0?u(e):new Uint8Array(await e.arrayBuffer()):d(e);async function u(e){let t=await f(e),n=r.fromBase64(t);return new Uint8Array(n)}async function d(e){let t=[],n=e.getReader(),r=!1,i=0;for(;!r;){let{done:e,value:a}=await n.read();a&&(t.push(a),i+=a.length),r=e}let a=new Uint8Array(i),o=0;for(let e of t)a.set(e,o),o+=e.length;return a}function f(e){return new Promise((t,n)=>{let r=new FileReader;r.onloadend=()=>{if(r.readyState!==2)return n(Error(`Reader aborted too early`));let e=r.result??``,i=e.indexOf(`,`),a=i>-1?i+1:e.length;t(e.substring(a))},r.onabort=()=>n(Error(`Read aborted`)),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}e.FetchHttpHandler=s,e.keepAliveSupport=o,e.streamCollector=l})),Mf=u((e=>{let t={},n={};for(let e=0;e<256;e++){let r=e.toString(16).toLowerCase();r.length===1&&(r=`0${r}`),t[e]=r,n[r]=e}function r(e){if(e.length%2!=0)throw Error(`Hex encoded strings must have an even number length`);let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let i=e.slice(r,r+2).toLowerCase();if(i in n)t[r/2]=n[i];else throw Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return t}function i(e){let n=``;for(let r=0;r<e.byteLength;r++)n+=t[e[r]];return n}e.fromHex=r,e.toHex=i})),Nf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sdkStreamMixin=void 0;let t=jf(),n=hf(),r=Mf(),i=pf(),a=_f(),o=`The stream has already been transformed.`;e.sdkStreamMixin=e=>{if(!s(e)&&!(0,a.isReadableStream)(e)){let t=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${t}`)}let c=!1,l=async()=>{if(c)throw Error(o);return c=!0,await(0,t.streamCollector)(e)},u=e=>{if(typeof e.stream!=`function`)throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
37
|
-
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return e.stream()};return Object.assign(e,{transformToByteArray:l,transformToString:async e=>{let t=await l();if(e===`base64`)return(0,n.toBase64)(t);if(e===`hex`)return(0,r.toHex)(t);if(e===void 0||e===`utf8`||e===`utf-8`)return(0,i.toUtf8)(t);if(typeof TextDecoder==`function`)return new TextDecoder(e).decode(t);throw Error(`TextDecoder is not available, please make sure polyfill is provided.`)},transformToWebStream:()=>{if(c)throw Error(o);if(c=!0,s(e))return u(e);if((0,a.isReadableStream)(e))return e;throw Error(`Cannot transform payload to web stream, got ${e}`)}})};let s=e=>typeof Blob==`function`&&e instanceof Blob})),
|
|
38
|
-
`+t}catch{!n.logger||n.logger?.constructor?.name===`NoOpLogger`?console.warn(t):n.logger?.warn?.(t)}e.$responseBodyText!==void 0&&e.$response&&(e.$response.body=e.$responseBodyText);try{if(qf.HttpResponse.isInstance(i)){let{headers:t={}}=i,n=Object.entries(t);e.$metadata={httpStatusCode:i.statusCode,requestId:Xf(/^x-[\w-]+-request-?id$/,n),extendedRequestId:Xf(/^x-[\w-]+-id-2$/,n),cfId:Xf(/^x-[\w-]+-cf-id$/,n)}}}catch{}}throw e}},Xf=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1]})),Qf=u((e=>{function t(e){let t={};if(e=e.replace(/^\?/,``),e)for(let n of e.split(`&`)){let[e,r=null]=n.split(`=`);e=decodeURIComponent(e),r&&=decodeURIComponent(r),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}e.parseQueryString=t})),$f=u((e=>{var t=Qf();let n=e=>{if(typeof e==`string`)return n(new URL(e));let{hostname:r,pathname:i,port:a,protocol:o,search:s}=e,c;return s&&(c=t.parseQueryString(s)),{hostname:r,port:a?parseInt(a):void 0,protocol:o,path:i,query:c}};e.parseUrl=n})),ep,tp,np=l((()=>{ep=$f(),tp=e=>{if(typeof e==`object`){if(`url`in e){let t=(0,ep.parseUrl)(e.url);if(e.headers){t.headers={};for(let[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(`, `)}return t}return e}return(0,ep.parseUrl)(e)}})),rp=d({toEndpointV1:()=>tp}),ip=l((()=>{np()})),ap,op,sp=l((()=>{ip(),ap=Nd(),Kf(),op=e=>(t,n)=>async r=>{let{operationSchema:i}=(0,ap.getSmithyContext)(n),[,a,o,s,c,l]=i??[],u=n.endpointV2?async()=>tp(n.endpointV2):e.endpoint,d=await e.protocol.serializeRequest(Gf(a,o,s,c,l),r.input,{...e,...n,endpoint:u});return t({...r,request:d})}}));function cp(e){return{applyToStack:t=>{t.add(op(e),up),t.add(Yf(e),lp),e.protocol.setSerdeContext(e)}}}var lp,up,dp=l((()=>{Zf(),sp(),lp={name:`deserializerMiddleware`,step:`deserialize`,tags:[`DESERIALIZER`],override:!0},up={name:`serializerMiddleware`,step:`serialize`,tags:[`SERIALIZER`],override:!0}})),fp,pp=l((()=>{fp=class{name;namespace;traits;static assign(e,t){return Object.assign(e,t)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);return!t&&typeof e==`object`&&e?e.symbol===this.symbol:t}getName(){return this.namespace+`#`+this.name}}})),mp,hp,gp=l((()=>{pp(),mp=class e extends fp{static symbol=Symbol.for(`@smithy/lis`);name;traits;valueSchema;symbol=e.symbol},hp=(e,t,n,r)=>fp.assign(new mp,{name:t,namespace:e,traits:n,valueSchema:r})})),_p,vp,yp=l((()=>{pp(),_p=class e extends fp{static symbol=Symbol.for(`@smithy/map`);name;traits;keySchema;valueSchema;symbol=e.symbol},vp=(e,t,n,r,i)=>fp.assign(new _p,{name:t,namespace:e,traits:n,keySchema:r,valueSchema:i})})),bp,xp,Sp=l((()=>{pp(),bp=class e extends fp{static symbol=Symbol.for(`@smithy/ope`);name;traits;input;output;symbol=e.symbol},xp=(e,t,n,r,i)=>fp.assign(new bp,{name:t,namespace:e,traits:n,input:r,output:i})})),Cp,wp,Tp=l((()=>{pp(),Cp=class e extends fp{static symbol=Symbol.for(`@smithy/str`);name;traits;memberNames;memberList;symbol=e.symbol},wp=(e,t,n,r,i)=>fp.assign(new Cp,{name:t,namespace:e,traits:n,memberNames:r,memberList:i})})),Ep,Dp,Op=l((()=>{pp(),Tp(),Ep=class e extends Cp{static symbol=Symbol.for(`@smithy/err`);ctor;symbol=e.symbol},Dp=(e,t,n,r,i,a)=>fp.assign(new Ep,{name:t,namespace:e,traits:n,memberNames:r,memberList:i,ctor:null})}));function kp(e){if(typeof e==`object`)return e;if(e|=0,Ap[e])return Ap[e];let t={},n=0;for(let r of[`httpLabel`,`idempotent`,`idempotencyToken`,`sensitive`,`httpPayload`,`httpResponseCode`,`httpQueryParams`])(e>>n++&1)==1&&(t[r]=1);return Ap[e]=t}var Ap,jp=l((()=>{Ap=[]}));function Mp(e,t){return e instanceof Ip?Object.assign(e,{memberName:t,_isMemberSchema:!0}):new Ip(e,t)}var Np,Pp,Fp,Ip,Lp,Rp,zp=l((()=>{Wf(),jp(),Np={it:Symbol.for(`@smithy/nor-struct-it`),ns:Symbol.for(`@smithy/ns`)},Pp=[],Fp={},Ip=class e{ref;memberName;static symbol=Symbol.for(`@smithy/nor`);symbol=e.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,n){this.ref=t,this.memberName=n;let r=[],i=t,a=t;for(this._isMemberSchema=!1;Lp(i);)r.push(i[1]),i=i[0],a=Uf(i),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let e=r.length-1;e>=0;--e){let t=r[e];Object.assign(this.memberTraits,kp(t))}}else this.memberTraits=0;if(a instanceof e){let e=this.memberTraits;Object.assign(this,a),this.memberTraits=Object.assign({},e,a.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=n??a.memberName;return}if(this.schema=Uf(a),Rp(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(a),this.traits=0),this._isMemberSchema&&!n)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);return!t&&typeof e==`object`&&e?e.symbol===this.symbol:t}static of(t){let n=typeof t==`function`||typeof t==`object`&&!!t;if(typeof t==`number`){if(Pp[t])return Pp[t]}else if(typeof t==`string`){if(Fp[t])return Fp[t]}else if(n&&t[Np.ns])return t[Np.ns];let r=Uf(t);if(r instanceof e)return r;if(Lp(r)){let[n,i]=r;if(n instanceof e)return Object.assign(n.getMergedTraits(),kp(i)),n;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}let i=new e(r);return n?t[Np.ns]=i:typeof r==`string`?Fp[r]=i:typeof r==`number`?Pp[r]=i:i}getSchema(){let e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){let{name:t}=this;return!e&&t&&t.includes(`#`)?t.split(`#`)[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e==`number`?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e==`number`?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!=`object`)return!1;let t=e[0];return t===3||t===-3||t===4}isUnionSchema(){let e=this.getSchema();return typeof e==`object`?e[0]===4:!1}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e==`number`&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()===`unit`}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??={...this.getOwnTraits(),...this.getMemberTraits()}}getMemberTraits(){return kp(this.memberTraits)}getOwnTraits(){return kp(this.traits)}getKeySchema(){let[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let n=this.getSchema();return Mp([e?15:n[4]??0,0],`key`)}getValueSchema(){let e=this.getSchema(),[t,n,r]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i=typeof e==`number`?63&e:e&&typeof e==`object`&&(n||r)?e[3+e[0]]:t?15:void 0;if(i!=null)return Mp([i,0],n?`value`:`member`);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){let n=t[4].indexOf(e),r=t[5][n];return Mp(Lp(r)?r:[r,0],e)}if(this.isDocumentSchema())return Mp([15,0],e);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[t,n]of this.structIterator())e[t]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return``}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error(`@smithy/core/schema - cannot iterate non-struct schema.`);let e=this.getSchema(),t=e[4].length,n=e[Np.it];if(n&&t===n.length){yield*n;return}n=Array(t);for(let r=0;r<t;++r){let t=e[4][r],i=Mp([e[5][r],0],t);yield n[r]=[t,i]}e[Np.it]=n}},Lp=e=>Array.isArray(e)&&e.length===2,Rp=e=>Array.isArray(e)&&e.length>=5})),Bp,Vp,Hp,Up=l((()=>{pp(),Bp=class e extends fp{static symbol=Symbol.for(`@smithy/sim`);name;schemaRef;traits;symbol=e.symbol},Vp=(e,t,n,r)=>fp.assign(new Bp,{name:t,namespace:e,traits:r,schemaRef:n}),Hp=(e,t,n,r)=>fp.assign(new Bp,{name:t,namespace:e,traits:n,schemaRef:r})})),Wp,Gp=l((()=>{Wp={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128}})),Kp,qp=l((()=>{Kp=class e{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(t){return e.registries.has(t)||e.registries.set(t,new e(t)),e.registries.get(t)}copyFrom(e){let{schemas:t,exceptions:n}=this;for(let[n,r]of e.schemas)t.has(n)||t.set(n,r);for(let[t,r]of e.exceptions)n.has(t)||n.set(t,r)}register(t,n){let r=this.normalizeShapeId(t);for(let t of[this,e.for(r.split(`#`)[0])])t.schemas.set(r,n)}getSchema(e){let t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(t,n){let r=t,i=r[1];for(let t of[this,e.for(i)])t.schemas.set(i+`#`+r[2],r),t.exceptions.set(r,n)}getErrorCtor(t){let n=t;return this.exceptions.has(n)?this.exceptions.get(n):e.for(n[1]).exceptions.get(n)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,t,n]=e,r=t+`#`+n;if(r.startsWith(`smithy.ts.sdk.synthetic.`)&&r.endsWith(`ServiceException`))return e}}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes(`#`)?e:this.namespace+`#`+e}}})),Jp=d({ErrorSchema:()=>Ep,ListSchema:()=>mp,MapSchema:()=>_p,NormalizedSchema:()=>Ip,OperationSchema:()=>bp,SCHEMA:()=>Wp,Schema:()=>fp,SimpleSchema:()=>Bp,StructureSchema:()=>Cp,TypeRegistry:()=>Kp,deref:()=>Uf,deserializerMiddlewareOption:()=>lp,error:()=>Dp,getSchemaSerdePlugin:()=>cp,isStaticSchema:()=>Rp,list:()=>hp,map:()=>vp,op:()=>xp,operation:()=>Gf,serializerMiddlewareOption:()=>up,sim:()=>Vp,simAdapter:()=>Hp,simpleSchemaCacheN:()=>Pp,simpleSchemaCacheS:()=>Fp,struct:()=>wp,traitsCache:()=>Ap,translateTraits:()=>kp}),Yp=l((()=>{Wf(),dp(),gp(),yp(),Sp(),Kf(),Op(),zp(),pp(),Up(),Tp(),Gp(),jp(),qp()})),Xp,Zp=l((()=>{Xp=(e,t,n=e=>e)=>e})),Qp,$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm=l((()=>{Qp=e=>{switch(e){case`true`:return!0;case`false`:return!1;default:throw Error(`Unable to parse boolean value "${e}"`)}},$p=e=>{if(e!=null){if(typeof e==`number`){if((e===0||e===1)&&Am.warn(km(`Expected boolean, got ${typeof e}: ${e}`)),e===0)return!1;if(e===1)return!0}if(typeof e==`string`){let t=e.toLowerCase();if((t===`false`||t===`true`)&&Am.warn(km(`Expected boolean, got ${typeof e}: ${e}`)),t===`false`)return!1;if(t===`true`)return!0}if(typeof e==`boolean`)return e;throw TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},em=e=>{if(e!=null){if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&Am.warn(km(`Expected number but observed string: ${e}`)),t}if(typeof e==`number`)return e;throw TypeError(`Expected number, got ${typeof e}: ${e}`)}},tm=Math.ceil(2**127*(2-2**-23)),nm=e=>{let t=em(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>tm)throw TypeError(`Expected 32-bit float, got ${e}`);return t},rm=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw TypeError(`Expected integer, got ${typeof e}: ${e}`)}},im=rm,am=e=>cm(e,32),om=e=>cm(e,16),sm=e=>cm(e,8),cm=(e,t)=>{let n=rm(e);if(n!==void 0&&lm(n,t)!==n)throw TypeError(`Expected ${t}-bit integer, got ${e}`);return n},lm=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},um=(e,t)=>{if(e==null)throw t?TypeError(`Expected a non-null value for ${t}`):TypeError(`Expected a non-null value`);return e},dm=e=>{if(e==null)return;if(typeof e==`object`&&!Array.isArray(e))return e;let t=Array.isArray(e)?`array`:typeof e;throw TypeError(`Expected object, got ${t}: ${e}`)},fm=e=>{if(e!=null){if(typeof e==`string`)return e;if([`boolean`,`number`,`bigint`].includes(typeof e))return Am.warn(km(`Expected string, got ${typeof e}: ${e}`)),String(e);throw TypeError(`Expected string, got ${typeof e}: ${e}`)}},pm=e=>{if(e==null)return;let t=dm(e),n=Object.entries(t).filter(([,e])=>e!=null).map(([e])=>e);if(n.length===0)throw TypeError(`Unions must have exactly one non-null member. None were found.`);if(n.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return t},mm=e=>em(typeof e==`string`?vm(e):e),hm=mm,gm=e=>nm(typeof e==`string`?vm(e):e),_m=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,vm=e=>{let t=e.match(_m);if(t===null||t[0].length!==e.length)throw TypeError(`Expected real number, got implicit NaN`);return parseFloat(e)},ym=e=>typeof e==`string`?Cm(e):em(e),bm=ym,xm=ym,Sm=e=>typeof e==`string`?Cm(e):nm(e),Cm=e=>{switch(e){case`NaN`:return NaN;case`Infinity`:return 1/0;case`-Infinity`:return-1/0;default:throw Error(`Unable to parse float value: ${e}`)}},wm=e=>rm(typeof e==`string`?vm(e):e),Tm=wm,Em=e=>am(typeof e==`string`?vm(e):e),Dm=e=>om(typeof e==`string`?vm(e):e),Om=e=>sm(typeof e==`string`?vm(e):e),km=e=>String(TypeError(e).stack||e).split(`
|
|
36
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(e){this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(this.resolveDefaultConfig(e))}).catch(n):t(this.resolveDefaultConfig(e))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(i,{abortSignal:a,requestTimeout:u}={}){this.config||=await this.configProvider;let m=this.config,h=i.protocol===`https:`;return!h&&!this.config.httpAgent&&(this.config.httpAgent=await this.config.httpAgentProvider()),new Promise((_,y)=>{let S,C=[],w=async e=>{await S,C.forEach(l.clearTimeout),_(e)},ee=async e=>{await S,C.forEach(l.clearTimeout),y(e)};if(a?.aborted){ee(o(a));return}let te=i.headers??{},T=(te.Expect??te.expect)===`100-continue`,E=h?m.httpsAgent:m.httpAgent;T&&!this.externalAgent&&(E=new(h?r.Agent:b)({keepAlive:!1,maxSockets:1/0})),C.push(l.setTimeout(()=>{this.socketWarningTimestamp=e.checkSocketUsage(E,this.socketWarningTimestamp,m.logger)},m.socketAcquisitionWarningTimeout??(m.requestTimeout??2e3)+(m.connectionTimeout??1e3)));let ne=n.buildQueryString(i.query||{}),re;(i.username!=null||i.password!=null)&&(re=`${i.username??``}:${i.password??``}`);let ie=i.path;ne&&(ie+=`?${ne}`),i.fragment&&(ie+=`#${i.fragment}`);let ae=i.hostname??``;ae=ae[0]===`[`&&ae.endsWith(`]`)?i.hostname.slice(1,-1):i.hostname;let oe={headers:i.headers,host:ae,method:i.method,path:ie,port:i.port,agent:E,auth:re},se=(h?r.request:x)(oe,e=>{w({response:new t.HttpResponse({statusCode:e.statusCode||-1,reason:e.statusMessage,headers:c(e.headers),body:e})})});if(se.on(`error`,e=>{s.includes(e.code)?ee(Object.assign(e,{name:`TimeoutError`})):ee(e)}),a){let e=()=>{se.destroy(),ee(o(a))};if(typeof a.addEventListener==`function`){let t=a;t.addEventListener(`abort`,e,{once:!0}),se.once(`close`,()=>t.removeEventListener(`abort`,e))}else a.onabort=e}let ce=u??m.requestTimeout;C.push(d(se,ee,m.connectionTimeout)),C.push(f(se,ee,ce,m.throwOnRequestTimeout,m.logger??console)),C.push(g(se,ee,m.socketTimeout));let le=oe.agent;typeof le==`object`&&`keepAlive`in le&&C.push(p(se,{keepAlive:le.keepAlive,keepAliveMsecs:le.keepAliveMsecs})),S=v(se,i,ce,this.externalAgent).catch(e=>(C.forEach(l.clearTimeout),y(e)))})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(e){let{requestTimeout:t,connectionTimeout:n,socketTimeout:i,socketAcquisitionWarningTimeout:a,httpAgent:o,httpsAgent:s,throwOnRequestTimeout:c,logger:l}=e||{};return{connectionTimeout:n,requestTimeout:t,socketTimeout:i,socketAcquisitionWarningTimeout:a,throwOnRequestTimeout:c,httpAgentProvider:async()=>{let{Agent:e,request:t}=await import(`node:http`);return x=t,b=e,o instanceof b||typeof o?.destroy==`function`?(this.externalAgent=!0,o):new b({keepAlive:!0,maxSockets:50,...o})},httpsAgent:s instanceof r.Agent||typeof s?.destroy==`function`?(this.externalAgent=!0,s):new r.Agent({keepAlive:!0,maxSockets:50,...s}),logger:l}}},C=class{sessions=[];constructor(e){this.sessions=e??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(e){this.sessions.push(e)}contains(e){return this.sessions.includes(e)}remove(e){this.sessions=this.sessions.filter(t=>t!==e)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(e){for(let t of this.sessions)t===e&&(t.destroyed||t.destroy())}},w=class{constructor(e){if(this.config=e,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError(`maxConcurrency must be greater than zero.`)}config;sessionCache=new Map;lease(e,t){let n=this.getUrlString(e),r=this.sessionCache.get(n);if(r){let e=r.poll();if(e&&!this.config.disableConcurrency)return e}let i=a.connect(n);this.config.maxConcurrency&&i.settings({maxConcurrentStreams:this.config.maxConcurrency},t=>{if(t)throw Error(`Fail to set maxConcurrentStreams to `+this.config.maxConcurrency+`when creating new session for `+e.destination.toString())}),i.unref();let o=()=>{i.destroy(),this.deleteSession(n,i)};i.on(`goaway`,o),i.on(`error`,o),i.on(`frameError`,o),i.on(`close`,()=>this.deleteSession(n,i)),t.requestTimeout&&i.setTimeout(t.requestTimeout,o);let s=this.sessionCache.get(n)||new C;return s.offerLast(i),this.sessionCache.set(n,s),i}deleteSession(e,t){let n=this.sessionCache.get(e);n&&n.contains(t)&&(n.remove(t),this.sessionCache.set(e,n))}release(e,t){let n=this.getUrlString(e);this.sessionCache.get(n)?.offerLast(t)}destroy(){for(let[e,t]of this.sessionCache){for(let e of t)e.destroyed||e.destroy(),t.remove(e);this.sessionCache.delete(e)}}setMaxConcurrentStreams(e){if(e&&e<=0)throw RangeError(`maxConcurrentStreams must be greater than zero.`);this.config.maxConcurrency=e}setDisableConcurrentStreams(e){this.config.disableConcurrency=e}getUrlString(e){return e.destination.toString()}},ee=class e{config;configProvider;metadata={handlerProtocol:`h2`};connectionManager=new w({});static create(t){return typeof t?.handle==`function`?t:new e(t)}constructor(e){this.configProvider=new Promise((t,n)=>{typeof e==`function`?e().then(e=>{t(e||{})}).catch(n):t(e||{})})}destroy(){this.connectionManager.destroy()}async handle(e,{abortSignal:r,requestTimeout:i}={}){this.config||(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams&&this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams));let{requestTimeout:s,disableConcurrentStreams:l}=this.config,u=i??s;return new Promise((i,s)=>{let d=!1,f,p=async e=>{await f,i(e)},m=async e=>{await f,s(e)};if(r?.aborted){d=!0,m(o(r));return}let{hostname:h,method:g,port:_,protocol:y,query:b}=e,x=``;(e.username!=null||e.password!=null)&&(x=`${e.username??``}:${e.password??``}@`);let S=`${y}//${x}${h}${_?`:${_}`:``}`,C={destination:new URL(S)},w=this.connectionManager.lease(C,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:l||!1}),ee=e=>{l&&this.destroySession(w),d=!0,m(e)},te=n.buildQueryString(b||{}),T=e.path;te&&(T+=`?${te}`),e.fragment&&(T+=`#${e.fragment}`);let E=w.request({...e.headers,[a.constants.HTTP2_HEADER_PATH]:T,[a.constants.HTTP2_HEADER_METHOD]:g});if(w.ref(),E.on(`response`,e=>{let n=new t.HttpResponse({statusCode:e[`:status`]||-1,headers:c(e),body:E});d=!0,p({response:n}),l&&(w.close(),this.connectionManager.deleteSession(S,w))}),u&&E.setTimeout(u,()=>{E.close();let e=Error(`Stream timed out because of no activity for ${u} ms`);e.name=`TimeoutError`,ee(e)}),r){let e=()=>{E.close(),ee(o(r))};if(typeof r.addEventListener==`function`){let t=r;t.addEventListener(`abort`,e,{once:!0}),E.once(`close`,()=>t.removeEventListener(`abort`,e))}else r.onabort=e}E.on(`frameError`,(e,t,n)=>{ee(Error(`Frame type id ${e} in stream id ${n} has failed with code ${t}.`))}),E.on(`error`,ee),E.on(`aborted`,()=>{ee(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${E.rstCode}.`))}),E.on(`close`,()=>{w.unref(),l&&w.destroy(),d||ee(Error(`Unexpected error: http2 request did not get a response`))}),f=v(E,e,u)})}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>({...n,[e]:t}))}httpHandlerConfigs(){return this.config??{}}destroySession(e){e.destroyed||e.destroy()}},te=class extends i.Writable{bufferedBytes=[];_write(e,t,n){this.bufferedBytes.push(e),n()}};let T=e=>E(e)?ne(e):new Promise((t,n)=>{let r=new te;e.pipe(r),e.on(`error`,e=>{r.end(),n(e)}),r.on(`error`,n),r.on(`finish`,function(){t(new Uint8Array(Buffer.concat(this.bufferedBytes)))})}),E=e=>typeof ReadableStream==`function`&&e instanceof ReadableStream;async function ne(e){let t=[],n=e.getReader(),r=!1,i=0;for(;!r;){let{done:e,value:a}=await n.read();a&&(t.push(a),i+=a.length),r=e}let a=new Uint8Array(i),o=0;for(let e of t)a.set(e,o),o+=e.length;return a}e.DEFAULT_REQUEST_TIMEOUT=0,e.NodeHttp2Handler=ee,e.NodeHttpHandler=S,e.streamCollector=T})),Mf=u((e=>{var t=vd(),n=Af(),r=gf();function i(e,t){return new Request(e,t)}function a(e=0){return new Promise((t,n)=>{e&&setTimeout(()=>{let t=Error(`Request did not complete within ${e} ms`);t.name=`TimeoutError`,n(t)},e)})}let o={supported:void 0};var s=class e{config;configProvider;static create(t){return typeof t?.handle==`function`?t:new e(t)}constructor(e){typeof e==`function`?this.configProvider=e().then(e=>e||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),o.supported===void 0&&(o.supported=typeof Request<`u`&&`keepalive`in i(`https://[::1]`))}destroy(){}async handle(e,{abortSignal:r,requestTimeout:s}={}){this.config||=await this.configProvider;let l=s??this.config.requestTimeout,u=this.config.keepAlive===!0,d=this.config.credentials;if(r?.aborted){let e=c(r);return Promise.reject(e)}let f=e.path,p=n.buildQueryString(e.query||{});p&&(f+=`?${p}`),e.fragment&&(f+=`#${e.fragment}`);let m=``;(e.username!=null||e.password!=null)&&(m=`${e.username??``}:${e.password??``}@`);let{port:h,method:g}=e,_=`${e.protocol}//${m}${e.hostname}${h?`:${h}`:``}${f}`,v=g===`GET`||g===`HEAD`?void 0:e.body,y={body:v,headers:new Headers(e.headers),method:g,credentials:d};this.config?.cache&&(y.cache=this.config.cache),v&&(y.duplex=`half`),typeof AbortController<`u`&&(y.signal=r),o.supported&&(y.keepalive=u),typeof this.config.requestInit==`function`&&Object.assign(y,this.config.requestInit(e));let b=()=>{},x=i(_,y),S=[fetch(x).then(e=>{let n=e.headers,r={};for(let e of n.entries())r[e[0]]=e[1];return e.body==null?e.blob().then(n=>({response:new t.HttpResponse({headers:r,reason:e.statusText,statusCode:e.status,body:n})})):{response:new t.HttpResponse({headers:r,reason:e.statusText,statusCode:e.status,body:e.body})}}),a(l)];return r&&S.push(new Promise((e,t)=>{let n=()=>{t(c(r))};if(typeof r.addEventListener==`function`){let e=r;e.addEventListener(`abort`,n,{once:!0}),b=()=>e.removeEventListener(`abort`,n)}else r.onabort=n})),Promise.race(S).finally(b)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}};function c(e){let t=e&&typeof e==`object`&&`reason`in e?e.reason:void 0;if(t){if(t instanceof Error){let e=Error(`Request aborted`);return e.name=`AbortError`,e.cause=t,e}let e=Error(String(t));return e.name=`AbortError`,e}let n=Error(`Request aborted`);return n.name=`AbortError`,n}let l=async e=>typeof Blob==`function`&&e instanceof Blob||e.constructor?.name===`Blob`?Blob.prototype.arrayBuffer===void 0?u(e):new Uint8Array(await e.arrayBuffer()):d(e);async function u(e){let t=await f(e),n=r.fromBase64(t);return new Uint8Array(n)}async function d(e){let t=[],n=e.getReader(),r=!1,i=0;for(;!r;){let{done:e,value:a}=await n.read();a&&(t.push(a),i+=a.length),r=e}let a=new Uint8Array(i),o=0;for(let e of t)a.set(e,o),o+=e.length;return a}function f(e){return new Promise((t,n)=>{let r=new FileReader;r.onloadend=()=>{if(r.readyState!==2)return n(Error(`Reader aborted too early`));let e=r.result??``,i=e.indexOf(`,`),a=i>-1?i+1:e.length;t(e.substring(a))},r.onabort=()=>n(Error(`Read aborted`)),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}e.FetchHttpHandler=s,e.keepAliveSupport=o,e.streamCollector=l})),Nf=u((e=>{let t={},n={};for(let e=0;e<256;e++){let r=e.toString(16).toLowerCase();r.length===1&&(r=`0${r}`),t[e]=r,n[r]=e}function r(e){if(e.length%2!=0)throw Error(`Hex encoded strings must have an even number length`);let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let i=e.slice(r,r+2).toLowerCase();if(i in n)t[r/2]=n[i];else throw Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return t}function i(e){let n=``;for(let r=0;r<e.byteLength;r++)n+=t[e[r]];return n}e.fromHex=r,e.toHex=i})),Pf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sdkStreamMixin=void 0;let t=Mf(),n=gf(),r=Nf(),i=mf(),a=vf(),o=`The stream has already been transformed.`;e.sdkStreamMixin=e=>{if(!s(e)&&!(0,a.isReadableStream)(e)){let t=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${t}`)}let c=!1,l=async()=>{if(c)throw Error(o);return c=!0,await(0,t.streamCollector)(e)},u=e=>{if(typeof e.stream!=`function`)throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
37
|
+
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return e.stream()};return Object.assign(e,{transformToByteArray:l,transformToString:async e=>{let t=await l();if(e===`base64`)return(0,n.toBase64)(t);if(e===`hex`)return(0,r.toHex)(t);if(e===void 0||e===`utf8`||e===`utf-8`)return(0,i.toUtf8)(t);if(typeof TextDecoder==`function`)return new TextDecoder(e).decode(t);throw Error(`TextDecoder is not available, please make sure polyfill is provided.`)},transformToWebStream:()=>{if(c)throw Error(o);if(c=!0,s(e))return u(e);if((0,a.isReadableStream)(e))return e;throw Error(`Cannot transform payload to web stream, got ${e}`)}})};let s=e=>typeof Blob==`function`&&e instanceof Blob})),Ff=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.sdkStreamMixin=void 0;let t=jf(),n=ff(),r=h(`stream`),i=Pf(),a=`The stream has already been transformed.`;e.sdkStreamMixin=e=>{if(!(e instanceof r.Readable))try{return(0,i.sdkStreamMixin)(e)}catch{let t=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${t}`)}let o=!1,s=async()=>{if(o)throw Error(a);return o=!0,await(0,t.streamCollector)(e)};return Object.assign(e,{transformToByteArray:s,transformToString:async e=>{let t=await s();return e===void 0||Buffer.isEncoding(e)?(0,n.fromArrayBuffer)(t.buffer,t.byteOffset,t.byteLength).toString(e):new TextDecoder(e).decode(t)},transformToWebStream:()=>{if(o)throw Error(a);if(e.readableFlowing!==null)throw Error(`The stream has been consumed by other callbacks.`);if(typeof r.Readable.toWeb!=`function`)throw Error(`Readable.toWeb() is not supported. Please ensure a polyfill is available.`);return o=!0,r.Readable.toWeb(e)}})}})),If=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.splitStream=t;async function t(e){return typeof e.stream==`function`&&(e=e.stream()),e.tee()}})),Lf=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.splitStream=i;let t=h(`stream`),n=If(),r=vf();async function i(e){if((0,r.isReadableStream)(e)||(0,r.isBlob)(e))return(0,n.splitStream)(e);let i=new t.PassThrough,a=new t.PassThrough;return e.pipe(i),e.pipe(a),[i,a]}})),Rf=u((e=>{var t=gf(),n=mf(),r=_f(),i=xf(),a=wf(),o=Ef(),s=Of(),c=Ff(),l=Lf(),u=vf(),d=class e extends Uint8Array{static fromString(r,i=`utf-8`){if(typeof r==`string`)return i===`base64`?e.mutate(t.fromBase64(r)):e.mutate(n.fromUtf8(r));throw Error(`Unsupported conversion from ${typeof r} to Uint8ArrayBlobAdapter.`)}static mutate(t){return Object.setPrototypeOf(t,e.prototype),t}transformToString(e=`utf-8`){return e===`base64`?t.toBase64(this):n.toUtf8(this)}};e.isBlob=u.isBlob,e.isReadableStream=u.isReadableStream,e.Uint8ArrayBlobAdapter=d,Object.prototype.hasOwnProperty.call(r,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:r.__proto__}),Object.keys(r).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=r[t])}),Object.prototype.hasOwnProperty.call(i,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:i.__proto__}),Object.keys(i).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=i[t])}),Object.prototype.hasOwnProperty.call(a,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:a.__proto__}),Object.keys(a).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=a[t])}),Object.prototype.hasOwnProperty.call(o,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:o.__proto__}),Object.keys(o).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=o[t])}),Object.prototype.hasOwnProperty.call(s,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:s.__proto__}),Object.keys(s).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=s[t])}),Object.prototype.hasOwnProperty.call(c,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:c.__proto__}),Object.keys(c).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=c[t])}),Object.prototype.hasOwnProperty.call(l,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:l.__proto__}),Object.keys(l).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=l[t])})})),zf,Bf,Vf=l((()=>{zf=Rf(),Bf=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return zf.Uint8ArrayBlobAdapter.mutate(e);if(!e)return zf.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let n=t.streamCollector(e);return zf.Uint8ArrayBlobAdapter.mutate(await n)}}));function Hf(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return`%`+e.charCodeAt(0).toString(16).toUpperCase()})}var Uf=l((()=>{})),Wf,Gf=l((()=>{Wf=e=>typeof e==`function`?e():e})),Kf,qf=l((()=>{Kf=(e,t,n,r,i)=>({name:t,namespace:e,traits:n,input:r,output:i})})),Jf,Yf,Xf,Zf,Qf=l((()=>{Jf=vd(),Yf=Pd(),qf(),Xf=e=>(t,n)=>async r=>{let{response:i}=await t(r),{operationSchema:a}=(0,Yf.getSmithyContext)(n),[,o,s,c,l,u]=a??[];try{return{response:i,output:await e.protocol.deserializeResponse(Kf(o,s,c,l,u),{...e,...n},i)}}catch(e){if(Object.defineProperty(e,`$response`,{value:i,enumerable:!1,writable:!1,configurable:!1}),!(`$metadata`in e)){let t=`Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;try{e.message+=`
|
|
38
|
+
`+t}catch{!n.logger||n.logger?.constructor?.name===`NoOpLogger`?console.warn(t):n.logger?.warn?.(t)}e.$responseBodyText!==void 0&&e.$response&&(e.$response.body=e.$responseBodyText);try{if(Jf.HttpResponse.isInstance(i)){let{headers:t={}}=i,n=Object.entries(t);e.$metadata={httpStatusCode:i.statusCode,requestId:Zf(/^x-[\w-]+-request-?id$/,n),extendedRequestId:Zf(/^x-[\w-]+-id-2$/,n),cfId:Zf(/^x-[\w-]+-cf-id$/,n)}}}catch{}}throw e}},Zf=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1]})),$f=u((e=>{function t(e){let t={};if(e=e.replace(/^\?/,``),e)for(let n of e.split(`&`)){let[e,r=null]=n.split(`=`);e=decodeURIComponent(e),r&&=decodeURIComponent(r),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}e.parseQueryString=t})),ep=u((e=>{var t=$f();let n=e=>{if(typeof e==`string`)return n(new URL(e));let{hostname:r,pathname:i,port:a,protocol:o,search:s}=e,c;return s&&(c=t.parseQueryString(s)),{hostname:r,port:a?parseInt(a):void 0,protocol:o,path:i,query:c}};e.parseUrl=n})),tp,np,rp=l((()=>{tp=ep(),np=e=>{if(typeof e==`object`){if(`url`in e){let t=(0,tp.parseUrl)(e.url);if(e.headers){t.headers={};for(let[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(`, `)}return t}return e}return(0,tp.parseUrl)(e)}})),ip=d({toEndpointV1:()=>np}),ap=l((()=>{rp()})),op,sp,cp=l((()=>{ap(),op=Pd(),qf(),sp=e=>(t,n)=>async r=>{let{operationSchema:i}=(0,op.getSmithyContext)(n),[,a,o,s,c,l]=i??[],u=n.endpointV2?async()=>np(n.endpointV2):e.endpoint,d=await e.protocol.serializeRequest(Kf(a,o,s,c,l),r.input,{...e,...n,endpoint:u});return t({...r,request:d})}}));function lp(e){return{applyToStack:t=>{t.add(sp(e),dp),t.add(Xf(e),up),e.protocol.setSerdeContext(e)}}}var up,dp,fp=l((()=>{Qf(),cp(),up={name:`deserializerMiddleware`,step:`deserialize`,tags:[`DESERIALIZER`],override:!0},dp={name:`serializerMiddleware`,step:`serialize`,tags:[`SERIALIZER`],override:!0}})),pp,mp=l((()=>{pp=class{name;namespace;traits;static assign(e,t){return Object.assign(e,t)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);return!t&&typeof e==`object`&&e?e.symbol===this.symbol:t}getName(){return this.namespace+`#`+this.name}}})),hp,gp,_p=l((()=>{mp(),hp=class e extends pp{static symbol=Symbol.for(`@smithy/lis`);name;traits;valueSchema;symbol=e.symbol},gp=(e,t,n,r)=>pp.assign(new hp,{name:t,namespace:e,traits:n,valueSchema:r})})),vp,yp,bp=l((()=>{mp(),vp=class e extends pp{static symbol=Symbol.for(`@smithy/map`);name;traits;keySchema;valueSchema;symbol=e.symbol},yp=(e,t,n,r,i)=>pp.assign(new vp,{name:t,namespace:e,traits:n,keySchema:r,valueSchema:i})})),xp,Sp,Cp=l((()=>{mp(),xp=class e extends pp{static symbol=Symbol.for(`@smithy/ope`);name;traits;input;output;symbol=e.symbol},Sp=(e,t,n,r,i)=>pp.assign(new xp,{name:t,namespace:e,traits:n,input:r,output:i})})),wp,Tp,Ep=l((()=>{mp(),wp=class e extends pp{static symbol=Symbol.for(`@smithy/str`);name;traits;memberNames;memberList;symbol=e.symbol},Tp=(e,t,n,r,i)=>pp.assign(new wp,{name:t,namespace:e,traits:n,memberNames:r,memberList:i})})),Dp,Op,kp=l((()=>{mp(),Ep(),Dp=class e extends wp{static symbol=Symbol.for(`@smithy/err`);ctor;symbol=e.symbol},Op=(e,t,n,r,i,a)=>pp.assign(new Dp,{name:t,namespace:e,traits:n,memberNames:r,memberList:i,ctor:null})}));function Ap(e){if(typeof e==`object`)return e;if(e|=0,jp[e])return jp[e];let t={},n=0;for(let r of[`httpLabel`,`idempotent`,`idempotencyToken`,`sensitive`,`httpPayload`,`httpResponseCode`,`httpQueryParams`])(e>>n++&1)==1&&(t[r]=1);return jp[e]=t}var jp,Mp=l((()=>{jp=[]}));function Np(e,t){return e instanceof Lp?Object.assign(e,{memberName:t,_isMemberSchema:!0}):new Lp(e,t)}var Pp,Fp,Ip,Lp,Rp,zp,Bp=l((()=>{Gf(),Mp(),Pp={it:Symbol.for(`@smithy/nor-struct-it`),ns:Symbol.for(`@smithy/ns`)},Fp=[],Ip={},Lp=class e{ref;memberName;static symbol=Symbol.for(`@smithy/nor`);symbol=e.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,n){this.ref=t,this.memberName=n;let r=[],i=t,a=t;for(this._isMemberSchema=!1;Rp(i);)r.push(i[1]),i=i[0],a=Wf(i),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let e=r.length-1;e>=0;--e){let t=r[e];Object.assign(this.memberTraits,Ap(t))}}else this.memberTraits=0;if(a instanceof e){let e=this.memberTraits;Object.assign(this,a),this.memberTraits=Object.assign({},e,a.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=n??a.memberName;return}if(this.schema=Wf(a),zp(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(a),this.traits=0),this._isMemberSchema&&!n)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);return!t&&typeof e==`object`&&e?e.symbol===this.symbol:t}static of(t){let n=typeof t==`function`||typeof t==`object`&&!!t;if(typeof t==`number`){if(Fp[t])return Fp[t]}else if(typeof t==`string`){if(Ip[t])return Ip[t]}else if(n&&t[Pp.ns])return t[Pp.ns];let r=Wf(t);if(r instanceof e)return r;if(Rp(r)){let[n,i]=r;if(n instanceof e)return Object.assign(n.getMergedTraits(),Ap(i)),n;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}let i=new e(r);return n?t[Pp.ns]=i:typeof r==`string`?Ip[r]=i:typeof r==`number`?Fp[r]=i:i}getSchema(){let e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){let{name:t}=this;return!e&&t&&t.includes(`#`)?t.split(`#`)[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e==`number`?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e==`number`?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!=`object`)return!1;let t=e[0];return t===3||t===-3||t===4}isUnionSchema(){let e=this.getSchema();return typeof e==`object`?e[0]===4:!1}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e==`number`&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()===`unit`}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??={...this.getOwnTraits(),...this.getMemberTraits()}}getMemberTraits(){return Ap(this.memberTraits)}getOwnTraits(){return Ap(this.traits)}getKeySchema(){let[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let n=this.getSchema();return Np([e?15:n[4]??0,0],`key`)}getValueSchema(){let e=this.getSchema(),[t,n,r]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i=typeof e==`number`?63&e:e&&typeof e==`object`&&(n||r)?e[3+e[0]]:t?15:void 0;if(i!=null)return Np([i,0],n?`value`:`member`);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){let n=t[4].indexOf(e),r=t[5][n];return Np(Rp(r)?r:[r,0],e)}if(this.isDocumentSchema())return Np([15,0],e);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[t,n]of this.structIterator())e[t]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return``}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error(`@smithy/core/schema - cannot iterate non-struct schema.`);let e=this.getSchema(),t=e[4].length,n=e[Pp.it];if(n&&t===n.length){yield*n;return}n=Array(t);for(let r=0;r<t;++r){let t=e[4][r],i=Np([e[5][r],0],t);yield n[r]=[t,i]}e[Pp.it]=n}},Rp=e=>Array.isArray(e)&&e.length===2,zp=e=>Array.isArray(e)&&e.length>=5})),Vp,Hp,Up,Wp=l((()=>{mp(),Vp=class e extends pp{static symbol=Symbol.for(`@smithy/sim`);name;schemaRef;traits;symbol=e.symbol},Hp=(e,t,n,r)=>pp.assign(new Vp,{name:t,namespace:e,traits:r,schemaRef:n}),Up=(e,t,n,r)=>pp.assign(new Vp,{name:t,namespace:e,traits:n,schemaRef:r})})),Gp,Kp=l((()=>{Gp={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128}})),qp,Jp=l((()=>{qp=class e{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(t){return e.registries.has(t)||e.registries.set(t,new e(t)),e.registries.get(t)}copyFrom(e){let{schemas:t,exceptions:n}=this;for(let[n,r]of e.schemas)t.has(n)||t.set(n,r);for(let[t,r]of e.exceptions)n.has(t)||n.set(t,r)}register(t,n){let r=this.normalizeShapeId(t);for(let t of[this,e.for(r.split(`#`)[0])])t.schemas.set(r,n)}getSchema(e){let t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(t,n){let r=t,i=r[1];for(let t of[this,e.for(i)])t.schemas.set(i+`#`+r[2],r),t.exceptions.set(r,n)}getErrorCtor(t){let n=t;return this.exceptions.has(n)?this.exceptions.get(n):e.for(n[1]).exceptions.get(n)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,t,n]=e,r=t+`#`+n;if(r.startsWith(`smithy.ts.sdk.synthetic.`)&&r.endsWith(`ServiceException`))return e}}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes(`#`)?e:this.namespace+`#`+e}}})),Yp=d({ErrorSchema:()=>Dp,ListSchema:()=>hp,MapSchema:()=>vp,NormalizedSchema:()=>Lp,OperationSchema:()=>xp,SCHEMA:()=>Gp,Schema:()=>pp,SimpleSchema:()=>Vp,StructureSchema:()=>wp,TypeRegistry:()=>qp,deref:()=>Wf,deserializerMiddlewareOption:()=>up,error:()=>Op,getSchemaSerdePlugin:()=>lp,isStaticSchema:()=>zp,list:()=>gp,map:()=>yp,op:()=>Sp,operation:()=>Kf,serializerMiddlewareOption:()=>dp,sim:()=>Hp,simAdapter:()=>Up,simpleSchemaCacheN:()=>Fp,simpleSchemaCacheS:()=>Ip,struct:()=>Tp,traitsCache:()=>jp,translateTraits:()=>Ap}),Xp=l((()=>{Gf(),fp(),_p(),bp(),Cp(),qf(),kp(),Bp(),mp(),Wp(),Ep(),Kp(),Mp(),Jp()})),Zp,Qp=l((()=>{Zp=(e,t,n=e=>e)=>e})),$p,em,tm,nm,rm,im,am,om,sm,cm,lm,um,dm,fm,pm,mm,hm,gm,_m,vm,ym,bm,xm,Sm,Cm,wm,Tm,Em,Dm,Om,km,Am,jm,Mm=l((()=>{$p=e=>{switch(e){case`true`:return!0;case`false`:return!1;default:throw Error(`Unable to parse boolean value "${e}"`)}},em=e=>{if(e!=null){if(typeof e==`number`){if((e===0||e===1)&&jm.warn(Am(`Expected boolean, got ${typeof e}: ${e}`)),e===0)return!1;if(e===1)return!0}if(typeof e==`string`){let t=e.toLowerCase();if((t===`false`||t===`true`)&&jm.warn(Am(`Expected boolean, got ${typeof e}: ${e}`)),t===`false`)return!1;if(t===`true`)return!0}if(typeof e==`boolean`)return e;throw TypeError(`Expected boolean, got ${typeof e}: ${e}`)}},tm=e=>{if(e!=null){if(typeof e==`string`){let t=parseFloat(e);if(!Number.isNaN(t))return String(t)!==String(e)&&jm.warn(Am(`Expected number but observed string: ${e}`)),t}if(typeof e==`number`)return e;throw TypeError(`Expected number, got ${typeof e}: ${e}`)}},nm=Math.ceil(2**127*(2-2**-23)),rm=e=>{let t=tm(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0&&Math.abs(t)>nm)throw TypeError(`Expected 32-bit float, got ${e}`);return t},im=e=>{if(e!=null){if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw TypeError(`Expected integer, got ${typeof e}: ${e}`)}},am=im,om=e=>lm(e,32),sm=e=>lm(e,16),cm=e=>lm(e,8),lm=(e,t)=>{let n=im(e);if(n!==void 0&&um(n,t)!==n)throw TypeError(`Expected ${t}-bit integer, got ${e}`);return n},um=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},dm=(e,t)=>{if(e==null)throw t?TypeError(`Expected a non-null value for ${t}`):TypeError(`Expected a non-null value`);return e},fm=e=>{if(e==null)return;if(typeof e==`object`&&!Array.isArray(e))return e;let t=Array.isArray(e)?`array`:typeof e;throw TypeError(`Expected object, got ${t}: ${e}`)},pm=e=>{if(e!=null){if(typeof e==`string`)return e;if([`boolean`,`number`,`bigint`].includes(typeof e))return jm.warn(Am(`Expected string, got ${typeof e}: ${e}`)),String(e);throw TypeError(`Expected string, got ${typeof e}: ${e}`)}},mm=e=>{if(e==null)return;let t=fm(e),n=Object.entries(t).filter(([,e])=>e!=null).map(([e])=>e);if(n.length===0)throw TypeError(`Unions must have exactly one non-null member. None were found.`);if(n.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return t},hm=e=>tm(typeof e==`string`?ym(e):e),gm=hm,_m=e=>rm(typeof e==`string`?ym(e):e),vm=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,ym=e=>{let t=e.match(vm);if(t===null||t[0].length!==e.length)throw TypeError(`Expected real number, got implicit NaN`);return parseFloat(e)},bm=e=>typeof e==`string`?wm(e):tm(e),xm=bm,Sm=bm,Cm=e=>typeof e==`string`?wm(e):rm(e),wm=e=>{switch(e){case`NaN`:return NaN;case`Infinity`:return 1/0;case`-Infinity`:return-1/0;default:throw Error(`Unable to parse float value: ${e}`)}},Tm=e=>im(typeof e==`string`?ym(e):e),Em=Tm,Dm=e=>om(typeof e==`string`?ym(e):e),Om=e=>sm(typeof e==`string`?ym(e):e),km=e=>cm(typeof e==`string`?ym(e):e),Am=e=>String(TypeError(e).stack||e).split(`
|
|
39
39
|
`).slice(0,5).filter(e=>!e.includes(`stackTraceWarning`)).join(`
|
|
40
|
-
`),Am={warn:console.warn}}));function Mm(e){let t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=i<10?`0${i}`:`${i}`,l=a<10?`0${a}`:`${a}`,u=o<10?`0${o}`:`${o}`,d=s<10?`0${s}`:`${s}`;return`${Nm[r]}, ${c} ${Pm[n]} ${t} ${l}:${u}:${d} GMT`}var Nm,Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh=l((()=>{jm(),Nm=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Pm=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Fm=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Im=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-3339 date-times must be expressed as strings`);let t=Fm.exec(e);if(!t)throw TypeError(`Invalid RFC-3339 date-time value`);let[n,r,i,a,o,s,c,l]=t;return Wm(Dm(th(r)),Qm(i,`month`,1,12),Qm(a,`day`,1,31),{hours:o,minutes:s,seconds:c,fractionalMilliseconds:l})},Lm=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Rm=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-3339 date-times must be expressed as strings`);let t=Lm.exec(e);if(!t)throw TypeError(`Invalid RFC-3339 date-time value`);let[n,r,i,a,o,s,c,l,u]=t,d=Wm(Dm(th(r)),Qm(i,`month`,1,12),Qm(a,`day`,1,31),{hours:o,minutes:s,seconds:c,fractionalMilliseconds:l});return u.toUpperCase()!=`Z`&&d.setTime(d.getTime()-eh(u)),d},zm=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Bm=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Vm=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Hm=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-7231 date-times must be expressed as strings`);let t=zm.exec(e);if(t){let[e,n,r,i,a,o,s,c]=t;return Wm(Dm(th(i)),Jm(r),Qm(n,`day`,1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:c})}if(t=Bm.exec(e),t){let[e,n,r,i,a,o,s,c]=t;return qm(Wm(Gm(i),Jm(r),Qm(n,`day`,1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:c}))}if(t=Vm.exec(e),t){let[e,n,r,i,a,o,s,c]=t;return Wm(Dm(th(c)),Jm(n),Qm(r.trimLeft(),`day`,1,31),{hours:i,minutes:a,seconds:o,fractionalMilliseconds:s})}throw TypeError(`Invalid RFC-7231 date-time value`)},Um=e=>{if(e==null)return;let t;if(typeof e==`number`)t=e;else if(typeof e==`string`)t=mm(e);else if(typeof e==`object`&&e.tag===1)t=e.value;else throw TypeError(`Epoch timestamps must be expressed as floating point numbers or their string representation`);if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError(`Epoch timestamps must be valid, non-Infinite, non-NaN numerics`);return new Date(Math.round(t*1e3))},Wm=(e,t,n,r)=>{let i=t-1;return Xm(e,i,n),new Date(Date.UTC(e,i,n,Qm(r.hours,`hour`,0,23),Qm(r.minutes,`minute`,0,59),Qm(r.seconds,`seconds`,0,60),$m(r.fractionalMilliseconds)))},Gm=e=>{let t=new Date().getUTCFullYear(),n=Math.floor(t/100)*100+Dm(th(e));return n<t?n+100:n},Km=50*365*24*60*60*1e3,qm=e=>e.getTime()-new Date().getTime()>Km?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,Jm=e=>{let t=Pm.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Ym=[31,28,31,30,31,30,31,31,30,31,30,31],Xm=(e,t,n)=>{let r=Ym[t];if(t===1&&Zm(e)&&(r=29),n>r)throw TypeError(`Invalid day for ${Pm[t]} in ${e}: ${n}`)},Zm=e=>e%4==0&&(e%100!=0||e%400==0),Qm=(e,t,n,r)=>{let i=Om(th(e));if(i<n||i>r)throw TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},$m=e=>e==null?0:gm(`0.`+e)*1e3,eh=e=>{let t=e[0],n=1;if(t==`+`)n=1;else if(t==`-`)n=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let r=Number(e.substring(1,3)),i=Number(e.substring(4,6));return n*(r*60+i)*60*1e3},th=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)===`0`;)t++;return t===0?e:e.slice(t)}})),rh=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.randomUUID=void 0;let t=(N(),m(j)).__importDefault(h(`crypto`));e.randomUUID=t.default.randomUUID.bind(t.default)})),ih=u((e=>{var t=rh();let n=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));e.v4=()=>{if(t.randomUUID)return t.randomUUID();let e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+`-`+n[e[4]]+n[e[5]]+`-`+n[e[6]]+n[e[7]]+`-`+n[e[8]]+n[e[9]]+`-`+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}})),ah,oh=l((()=>{ah=ih()})),sh,ch=l((()=>{sh=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})},sh.from=e=>e&&typeof e==`object`&&(e instanceof sh||`deserializeJSON`in e)?e:typeof e==`string`||Object.getPrototypeOf(e)===String.prototype?sh(String(e)):sh(JSON.stringify(e)),sh.fromObject=sh.from}));function lh(e){return(e.includes(`,`)||e.includes(`"`))&&(e=`"${e.replace(/"/g,`\\"`)}"`),e}var uh=l((()=>{}));function dh(e,t,n){let r=Number(e);if(r<t||r>n)throw Error(`Value ${r} out of range [${t}, ${n}]`)}var fh,ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th=l((()=>{fh=`(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`,ph=`(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`,mh=`(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`,hh=`(\\d?\\d)`,gh=`(\\d{4})`,_h=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),vh=RegExp(`^${fh}, ${hh} ${ph} ${gh} ${mh} GMT$`),yh=RegExp(`^${fh}, ${hh}-${ph}-(\\d\\d) ${mh} GMT$`),bh=RegExp(`^${fh} ${ph} ( [1-9]|\\d\\d) ${mh} ${gh}$`),xh=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Sh=e=>{if(e==null)return;let t=NaN;if(typeof e==`number`)t=e;else if(typeof e==`string`){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError(`parseEpochTimestamp - numeric string invalid.`);t=Number.parseFloat(e)}else typeof e==`object`&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw TypeError(`Epoch timestamps must be valid finite numbers.`);return new Date(Math.round(t*1e3))},Ch=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC3339 timestamps must be strings`);let t=_h.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,n,r,i,a,o,s,,c,l]=t;dh(r,1,12),dh(i,1,31),dh(a,0,23),dh(o,0,59),dh(s,0,60);let u=new Date(Date.UTC(Number(n),Number(r)-1,Number(i),Number(a),Number(o),Number(s),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(u.setUTCFullYear(Number(n)),l.toUpperCase()!=`Z`){let[,e,t,n]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,`+`,0,0],r=e===`-`?1:-1;u.setTime(u.getTime()+r*(Number(t)*60*60*1e3+Number(n)*60*1e3))}return u},wh=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC7231 timestamps must be strings.`);let t,n,r,i,a,o,s,c;if((c=vh.exec(e))?[,t,n,r,i,a,o,s]=c:(c=yh.exec(e))?([,t,n,r,i,a,o,s]=c,r=(Number(r)+1900).toString()):(c=bh.exec(e))&&([,n,t,i,a,o,s,r]=c),r&&o){let e=Date.UTC(Number(r),xh.indexOf(n),Number(t),Number(i),Number(a),Number(o),s?Math.round(parseFloat(`0.${s}`)*1e3):0);dh(t,1,31),dh(i,0,23),dh(a,0,59),dh(o,0,60);let c=new Date(e);return c.setUTCFullYear(Number(r)),c}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)}}));function Eh(e,t,n){if(n<=0||!Number.isInteger(n))throw Error(`Invalid number of delimiters (`+n+`) for splitEvery.`);let r=e.split(t);if(n===1)return r;let i=[],a=``;for(let e=0;e<r.length;e++)a===``?a=r[e]:a+=t+r[e],(e+1)%n===0&&(i.push(a),a=``);return a!==``&&i.push(a),i}var Dh=l((()=>{})),Oh,kh=l((()=>{Oh=e=>{let t=e.length,n=[],r=!1,i,a=0;for(let o=0;o<t;++o){let t=e[o];switch(t){case`"`:i!==`\\`&&(r=!r);break;case`,`:r||(n.push(e.slice(a,o)),a=o+1);break;default:}i=t}return n.push(e.slice(a)),n.map(e=>{e=e.trim();let t=e.length;return t<2?e:(e[0]===`"`&&e[t-1]===`"`&&(e=e.slice(1,t-1)),e.replace(/\\"/g,`"`))})}}));function Ah(e){return new Mh(String(e),`bigDecimal`)}var jh,Mh,Nh=l((()=>{jh=/^-?\d*(\.\d+)?$/,Mh=class e{string;type;constructor(e,t){if(this.string=e,this.type=t,!jh.test(e))throw Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`)}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!=`object`)return!1;let n=t;return e.prototype.isPrototypeOf(t)||n.type===`bigDecimal`&&jh.test(n.string)}}})),Ph=d({LazyJsonString:()=>sh,NumericValue:()=>Mh,_parseEpochTimestamp:()=>Sh,_parseRfc3339DateTimeWithOffset:()=>Ch,_parseRfc7231DateTime:()=>wh,copyDocumentWithTransform:()=>Xp,dateToUtcString:()=>Mm,expectBoolean:()=>$p,expectByte:()=>sm,expectFloat32:()=>nm,expectInt:()=>im,expectInt32:()=>am,expectLong:()=>rm,expectNonNull:()=>um,expectNumber:()=>em,expectObject:()=>dm,expectShort:()=>om,expectString:()=>fm,expectUnion:()=>pm,generateIdempotencyToken:()=>ah.v4,handleFloat:()=>bm,limitedParseDouble:()=>ym,limitedParseFloat:()=>xm,limitedParseFloat32:()=>Sm,logger:()=>Am,nv:()=>Ah,parseBoolean:()=>Qp,parseEpochTimestamp:()=>Um,parseRfc3339DateTime:()=>Im,parseRfc3339DateTimeWithOffset:()=>Rm,parseRfc7231DateTime:()=>Hm,quoteHeader:()=>lh,splitEvery:()=>Eh,splitHeader:()=>Oh,strictParseByte:()=>Om,strictParseDouble:()=>mm,strictParseFloat:()=>hm,strictParseFloat32:()=>gm,strictParseInt:()=>Tm,strictParseInt32:()=>Em,strictParseLong:()=>wm,strictParseShort:()=>Dm}),Fh=l((()=>{Zp(),nh(),oh(),ch(),jm(),uh(),Th(),Dh(),kh(),Nh()})),Ih,Lh=l((()=>{Ih=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}})),Rh,zh,Bh=l((()=>{Rh=pf(),zh=class{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:e,serializer:t,deserializer:n,serdeContext:r,defaultContentType:i}){this.marshaller=e,this.serializer=t,this.deserializer=n,this.serdeContext=r,this.defaultContentType=i}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){let r=this.marshaller,i=t.getEventStreamMember(),a=t.getMemberSchema(i),o=this.serializer,s=this.defaultContentType,c=Symbol(`initialRequestMarker`),l={async*[Symbol.asyncIterator](){if(n){let e={":event-type":{type:`string`,value:`initial-request`},":message-type":{type:`string`,value:`event`},":content-type":{type:`string`,value:s}};o.write(t,n);let r=o.flush();yield{[c]:!0,headers:e,body:r}}for await(let t of e)yield t}};return r.serialize(l,e=>{if(e[c])return{headers:e.headers,body:e.body};let t=Object.keys(e).find(e=>e!==`__type`)??``,{additionalHeaders:n,body:r,eventType:i,explicitPayloadContentType:o}=this.writeEventBody(t,a,e);return{headers:{":event-type":{type:`string`,value:i},":message-type":{type:`string`,value:`event`},":content-type":{type:`string`,value:o??s},...n},body:r}})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){let r=this.marshaller,i=t.getEventStreamMember(),a=t.getMemberSchema(i).getMemberSchemas(),o=Symbol(`initialResponseMarker`),s=r.deserialize(e.body,async e=>{let n=Object.keys(e).find(e=>e!==`__type`)??``,r=e[n].body;if(n===`initial-response`){let e=await this.deserializer.read(t,r);return delete e[i],{[o]:!0,...e}}else if(n in a){let t=a[n];if(t.isStructSchema()){let i={},a=!1;for(let[o,s]of t.structIterator()){let{eventHeader:t,eventPayload:c}=s.getMergedTraits();if(a||=!!(t||c),c)s.isBlobSchema()?i[o]=r:s.isStringSchema()?i[o]=(this.serdeContext?.utf8Encoder??Rh.toUtf8)(r):s.isStructSchema()&&(i[o]=await this.deserializer.read(s,r));else if(t){let t=e[n].headers[o]?.value;t!=null&&(s.isNumericSchema()?t&&typeof t==`object`&&`bytes`in t?i[o]=BigInt(t.toString()):i[o]=Number(t):i[o]=t)}}if(a)return{[n]:i};if(r.byteLength===0)return{[n]:{}}}return{[n]:await this.deserializer.read(t,r)}}else return{$unknown:e}}),c=s[Symbol.asyncIterator](),l=await c.next();if(l.done)return s;if(l.value?.[o]){if(!t)throw Error(`@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.`);for(let[e,t]of Object.entries(l.value))n[e]=t}return{async*[Symbol.asyncIterator](){for(l?.value?.[o]||(yield l.value);;){let{done:e,value:t}=await c.next();if(e)break;yield t}}}}writeEventBody(e,t,n){let r=this.serializer,i=e,a=null,o,s=t.getSchema()[4].includes(e),c={};if(s){let i=t.getMemberSchema(e);if(i.isStructSchema()){for(let[t,r]of i.structIterator()){let{eventHeader:i,eventPayload:o}=r.getMergedTraits();if(o)a=t;else if(i){let i=n[e][t],a=`binary`;r.isNumericSchema()?a=(-2)**31<=i&&i<=2**31-1?`integer`:`long`:r.isTimestampSchema()?a=`timestamp`:r.isStringSchema()?a=`string`:r.isBooleanSchema()&&(a=`boolean`),i!=null&&(c[t]={type:a,value:i},delete n[e][t])}}if(a!==null){let t=i.getMemberSchema(a);t.isBlobSchema()?o=`application/octet-stream`:t.isStringSchema()&&(o=`text/plain`),r.write(t,n[e][a])}else r.write(i,n[e])}else if(i.isUnitSchema())r.write(i,{});else throw Error(`@smithy/core/event-streams - non-struct member not supported in event stream union.`)}else{let[t,a]=n[e];i=t,r.write(15,a)}let l=r.flush()??new Uint8Array;return{body:typeof l==`string`?(this.serdeContext?.utf8Decoder??Rh.fromUtf8)(l):l,eventType:i,explicitPayloadContentType:o,additionalHeaders:c}}}})),Vh=d({EventStreamSerde:()=>zh}),Hh=l((()=>{Bh()})),Uh,Wh,Gh=l((()=>{Yp(),Uh=_d(),Lh(),Wh=class extends Ih{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=Kp.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return Uh.HttpRequest}getResponseType(){return Uh.HttpResponse}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if(`url`in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||={};for(let[n,r]of t.url.searchParams.entries())e.query[n]=r;if(t.headers)for(let[n,r]of Object.entries(t.headers))e.headers[n]=r.join(`, `);return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let[n,r]of Object.entries(t.headers))e.headers[n]=r;return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;let r=Ip.of(t.input),i=kp(t.traits??{});if(i.endpoint){let t=i.endpoint?.[0];if(typeof t==`string`){let i=[...r.structIterator()].filter(([,e])=>e.getMergedTraits().hostLabel);for(let[e]of i){let r=n[e];if(typeof r!=`string`)throw Error(`@smithy/core/schema - ${e} in input must be a string as hostLabel.`);t=t.replace(`{${e}}`,r)}e.hostname=t+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){let{EventStreamSerde:e}=await Promise.resolve().then(()=>(Hh(),Vh));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,r,i){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw Error(`@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.`);return e.eventStreamMarshaller}}})),Kh,qh,Jh,Yh=l((()=>{Yp(),Fh(),Kh=_d(),qh=Lf(),Bf(),Hf(),Gh(),Jh=class extends Wh{async serializeRequest(e,t,n){let r=t&&typeof t==`object`?t:{},i=this.serializer,a={},o={},s=await n.endpoint(),c=Ip.of(e?.input),l=[],u=[],d=!1,f,p=new Kh.HttpRequest({protocol:``,hostname:``,port:void 0,path:``,fragment:void 0,query:a,headers:o,body:void 0});if(s){this.updateServiceEndpoint(p,s),this.setHostPrefix(p,e,r);let t=kp(e.traits);if(t.http){p.method=t.http[0];let[e,n]=t.http[1].split(`?`);p.path==`/`?p.path=e:p.path+=e;let r=new URLSearchParams(n??``);Object.assign(a,Object.fromEntries(r))}}for(let[e,t]of c.structIterator()){let n=t.getMergedTraits()??{},s=r[e];if(s==null&&!t.isIdempotencyToken()){if(n.httpLabel&&(p.path.includes(`{${e}+}`)||p.path.includes(`{${e}}`)))throw Error(`No value provided for input HTTP label: ${e}.`);continue}if(n.httpPayload)t.isStreaming()?t.isStructSchema()?r[e]&&(f=await this.serializeEventStream({eventStream:r[e],requestSchema:c})):f=s:(i.write(t,s),f=i.flush());else if(n.httpLabel){i.write(t,s);let n=i.flush();p.path.includes(`{${e}+}`)?p.path=p.path.replace(`{${e}+}`,n.split(`/`).map(Vf).join(`/`)):p.path.includes(`{${e}}`)&&(p.path=p.path.replace(`{${e}}`,Vf(n)))}else if(n.httpHeader)i.write(t,s),o[n.httpHeader.toLowerCase()]=String(i.flush());else if(typeof n.httpPrefixHeaders==`string`)for(let[e,r]of Object.entries(s)){let a=n.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:a}],r),o[a.toLowerCase()]=i.flush()}else n.httpQuery||n.httpQueryParams?this.serializeQuery(t,s,a):(d=!0,l.push(e),u.push(t))}if(d&&r){let[e,t]=(c.getName(!0)??`#Unknown`).split(`#`),n=c.getSchema()[6],a=[3,e,t,c.getMergedTraits(),l,u,void 0];n?a[6]=n:a.pop(),i.write(a,r),f=i.flush()}return p.headers=o,p.query=a,p.body=f,p}serializeQuery(e,t,n){let r=this.serializer,i=e.getMergedTraits();if(i.httpQueryParams){for(let[r,a]of Object.entries(t))if(!(r in n)){let t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...i,httpQuery:r,httpQueryParams:void 0}),this.serializeQuery(t,a,n)}return}if(e.isListSchema()){let a=!!e.getMergedTraits().sparse,o=[];for(let n of t){r.write([e.getValueSchema(),i],n);let t=r.flush();(a||t!==void 0)&&o.push(t)}n[i.httpQuery]=o}else r.write([e,i],t),n[i.httpQuery]=r.flush()}async deserializeResponse(e,t,n){let r=this.deserializer,i=Ip.of(e.output),a={};if(n.statusCode>=300){let i=await zf(n.body,t);throw i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n)),Error(`@smithy/core/protocols - HTTP Protocol error handler failed to throw.`)}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=await this.deserializeHttpMessage(i,t,n,a);if(o.length){let e=await zf(n.body,t);if(e.byteLength>0){let t=await r.read(i,e);for(let e of o)t[e]!=null&&(a[e]=t[e])}}else o.discardResponseBody&&await zf(n.body,t);return a.$metadata=this.deserializeMetadata(n),a}async deserializeHttpMessage(e,t,n,r,i){let a;a=r instanceof Set?i:r;let o=!0,s=this.deserializer,c=Ip.of(e),l=[];for(let[e,r]of c.structIterator()){let i=r.getMemberTraits();if(i.httpPayload){if(o=!1,r.isStreaming())r.isStructSchema()?a[e]=await this.deserializeEventStream({response:n,responseSchema:c}):a[e]=(0,qh.sdkStreamMixin)(n.body);else if(n.body){let i=await zf(n.body,t);i.byteLength>0&&(a[e]=await s.read(r,i))}}else if(i.httpHeader){let t=String(i.httpHeader).toLowerCase(),o=n.headers[t];if(o!=null)if(r.isListSchema()){let n=r.getValueSchema();n.getMergedTraits().httpHeader=t;let i;i=n.isTimestampSchema()&&n.getSchema()===4?Eh(o,`,`,2):Oh(o);let c=[];for(let e of i)c.push(await s.read(n,e.trim()));a[e]=c}else a[e]=await s.read(r,o)}else if(i.httpPrefixHeaders!==void 0){a[e]={};for(let[t,o]of Object.entries(n.headers))if(t.startsWith(i.httpPrefixHeaders)){let n=r.getValueSchema();n.getMergedTraits().httpHeader=t,a[e][t.slice(i.httpPrefixHeaders.length)]=await s.read(n,o)}}else i.httpResponseCode?a[e]=n.statusCode:l.push(e)}return l.discardResponseBody=o,l}}})),Xh,Zh,Qh=l((()=>{Yp(),Xh=_d(),Bf(),Gh(),Zh=class extends Wh{async serializeRequest(e,t,n){let r=this.serializer,i={},a={},o=await n.endpoint(),s=Ip.of(e?.input),c=s.getSchema(),l,u=t&&typeof t==`object`?t:{},d=new Xh.HttpRequest({protocol:``,hostname:``,port:void 0,path:`/`,fragment:void 0,query:i,headers:a,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,u)),u){let e=s.getEventStreamMember();if(e){if(u[e]){let t={};for(let[n,i]of s.structIterator())n!==e&&u[n]&&(r.write(i,u[n]),t[n]=r.flush());l=await this.serializeEventStream({eventStream:u[e],requestSchema:s,initialRequest:t})}}else r.write(c,u),l=r.flush()}return d.headers=Object.assign(d.headers,a),d.query=i,d.body=l,d.method=`POST`,d}async deserializeResponse(e,t,n){let r=this.deserializer,i=Ip.of(e.output),a={};if(n.statusCode>=300){let i=await zf(n.body,t);throw i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n)),Error(`@smithy/core/protocols - RPC Protocol error handler failed to throw.`)}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=i.getEventStreamMember();if(o)a[o]=await this.deserializeEventStream({response:n,responseSchema:i,initialResponseContainer:a});else{let e=await zf(n.body,t);e.byteLength>0&&Object.assign(a,await r.read(i,e))}return a.$metadata=this.deserializeMetadata(n),a}}})),$h,eg=l((()=>{Hf(),$h=(e,t,n,r,i,a)=>{if(t!=null&&t[n]!==void 0){let t=r();if(t==null||t.length<=0)throw Error(`Empty value provided for input HTTP label: `+n+`.`);e=e.replace(i,a?t.split(`/`).map(e=>Vf(e)).join(`/`):Vf(t))}else throw Error(`No value provided for input HTTP label: `+n+`.`);return e}}));function tg(e,t){return new rg(e,t)}var ng,rg,ig=l((()=>{ng=_d(),eg(),rg=class{input;context;query={};method=``;headers={};path=``;body=null;hostname=``;resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){let{hostname:e,protocol:t=`https`,port:n,path:r}=await this.context.endpoint();this.path=r;for(let e of this.resolvePathStack)e(this.path);return new ng.HttpRequest({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(i=>{this.path=$h(i,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}}}));function ag(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();let{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:a}=e.getMergedTraits();return(t.httpBindings?typeof r==`string`||i?6:a||n?5:void 0:void 0)??t.timestampFormat.default}var og=l((()=>{})),sg,cg,lg,ug=l((()=>{Yp(),Fh(),sg=hf(),cg=pf(),Lh(),og(),lg=class extends Ih{settings;constructor(e){super(),this.settings=e}read(e,t){let n=Ip.of(e);if(n.isListSchema())return Oh(t).map(e=>this.read(n.getValueSchema(),e));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??sg.fromBase64)(t);if(n.isTimestampSchema())switch(ag(n,this.settings)){case 5:return Ch(t);case 6:return wh(t);case 7:return Sh(t);default:return console.warn(`Missing timestamp format, parsing value with Date constructor:`,t),new Date(t)}if(n.isStringSchema()){let e=n.getMergedTraits().mediaType,r=t;if(e)return n.getMergedTraits().httpHeader&&(r=this.base64ToUtf8(r)),(e===`application/json`||e.endsWith(`+json`))&&(r=sh.from(r)),r}return n.isNumericSchema()?Number(t):n.isBigIntegerSchema()?BigInt(t):n.isBigDecimalSchema()?new Mh(t,`bigDecimal`):n.isBooleanSchema()?String(t).toLowerCase()===`true`:t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??cg.toUtf8)((this.serdeContext?.base64Decoder??sg.fromBase64)(e))}}})),dg,fg,pg=l((()=>{Yp(),dg=pf(),Lh(),ug(),fg=class extends Ih{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new lg(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){let n=Ip.of(e),r=n.getMergedTraits(),i=this.serdeContext?.utf8Encoder??dg.toUtf8;if(r.httpHeader||r.httpResponseCode)return this.stringDeserializer.read(n,i(t));if(r.httpPayload){if(n.isBlobSchema()){let e=this.serdeContext?.utf8Decoder??dg.fromUtf8;return typeof t==`string`?e(t):t}else if(n.isStringSchema())return`byteLength`in t?i(t):t}return this.codecDeserializer.read(n,t)}}})),mg,hg,gg=l((()=>{Yp(),Fh(),mg=hf(),Lh(),og(),hg=class extends Ih{settings;stringBuffer=``;constructor(e){super(),this.settings=e}write(e,t){let n=Ip.of(e);switch(typeof t){case`object`:if(t===null){this.stringBuffer=`null`;return}if(n.isTimestampSchema()){if(!(t instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${n.getName(!0)}`);switch(ag(n,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(`.000Z`,`Z`);break;case 6:this.stringBuffer=Mm(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn(`Missing timestamp format, using epoch seconds`,t),this.stringBuffer=String(t.getTime()/1e3)}return}if(n.isBlobSchema()&&`byteLength`in t){this.stringBuffer=(this.serdeContext?.base64Encoder??mg.toBase64)(t);return}if(n.isListSchema()&&Array.isArray(t)){let e=``;for(let r of t){this.write([n.getValueSchema(),n.getMergedTraits()],r);let t=this.flush(),i=n.getValueSchema().isTimestampSchema()?t:lh(t);e!==``&&(e+=`, `),e+=i}this.stringBuffer=e;return}this.stringBuffer=JSON.stringify(t,null,2);break;case`string`:let e=n.getMergedTraits().mediaType,r=t;if(e&&((e===`application/json`||e.endsWith(`+json`))&&(r=sh.from(r)),n.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??mg.toBase64)(r.toString());return}this.stringBuffer=t;break;default:n.isIdempotencyToken()?this.stringBuffer=(0,ah.v4)():this.stringBuffer=String(t)}}flush(){let e=this.stringBuffer;return this.stringBuffer=``,e}}})),_g,vg=l((()=>{Yp(),gg(),_g=class{codecSerializer;stringSerializer;buffer;constructor(e,t,n=new hg(t)){this.codecSerializer=e,this.stringSerializer=n}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){let n=Ip.of(e),r=n.getMergedTraits();if(r.httpHeader||r.httpLabel||r.httpQuery){this.stringSerializer.write(n,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}})),yg=d({FromStringShapeDeserializer:()=>lg,HttpBindingProtocol:()=>Jh,HttpInterceptingShapeDeserializer:()=>fg,HttpInterceptingShapeSerializer:()=>_g,HttpProtocol:()=>Wh,RequestBuilder:()=>rg,RpcProtocol:()=>Zh,SerdeContext:()=>Ih,ToStringShapeSerializer:()=>hg,collectBody:()=>zf,determineTimestampFormat:()=>ag,extendedEncodeURIComponent:()=>Vf,requestBuilder:()=>tg,resolvedPath:()=>$h}),bg=l((()=>{Bf(),Hf(),Yh(),Gh(),Qh(),ig(),eg(),ug(),pg(),vg(),gg(),og(),Lh()})),xg=l((()=>{bg()}));function Sg(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}var Cg=l((()=>{})),wg,Tg=l((()=>{wg=class{authSchemes=new Map;constructor(e){for(let[t,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}})),Eg,Dg,Og,kg=l((()=>{Eg=_d(),Dg=gd(),Og=class{async sign(e,t,n){if(!n)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!n.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!n.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!t.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let r=Eg.HttpRequest.clone(e);if(n.in===Dg.HttpApiKeyAuthLocation.QUERY)r.query[n.name]=t.apiKey;else if(n.in===Dg.HttpApiKeyAuthLocation.HEADER)r.headers[n.name]=n.scheme?`${n.scheme} ${t.apiKey}`:t.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+n.in+"`");return r}}})),Ag,jg,Mg=l((()=>{Ag=_d(),jg=class{async sign(e,t,n){let r=Ag.HttpRequest.clone(e);if(!t.token)throw Error("request could not be signed with `token` since the `token` is not defined");return r.headers.Authorization=`Bearer ${t.token}`,r}}})),Ng,Pg=l((()=>{Ng=class{async sign(e,t,n){return e}}})),Fg=l((()=>{kg(),Mg(),Pg()})),Ig,Lg,Rg,zg,Bg,Vg=l((()=>{Ig=e=>function(t){return zg(t)&&t.expiration.getTime()-Date.now()<e},Lg=3e5,Rg=Ig(Lg),zg=e=>e.expiration!==void 0,Bg=(e,t,n)=>{if(e===void 0)return;let r=typeof e==`function`?e:async()=>Promise.resolve(e),i,a,o,s=!1,c=async e=>{a||=r(e);try{i=await a,o=!0,s=!1}finally{a=void 0}return i};return t===void 0?async e=>((!o||e?.forceRefresh)&&(i=await c(e)),i):async e=>((!o||e?.forceRefresh)&&(i=await c(e)),s?i:n(i)?(t(i)&&await c(e),i):(s=!0,i))}})),Hg=l((()=>{Tg(),Fg(),Vg()})),Ug=d({DefaultIdentityProviderConfig:()=>wg,EXPIRATION_MS:()=>Lg,HttpApiKeyAuthSigner:()=>Og,HttpBearerAuthSigner:()=>jg,NoAuthSigner:()=>Ng,createIsIdentityExpiredFunction:()=>Ig,createPaginator:()=>of,doesIdentityRequireRefresh:()=>zg,getHttpAuthSchemeEndpointRuleSetPlugin:()=>Vd,getHttpAuthSchemePlugin:()=>Wd,getHttpSigningPlugin:()=>ef,getSmithyContext:()=>jd,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>Bd,httpAuthSchemeMiddleware:()=>Rd,httpAuthSchemeMiddlewareOptions:()=>Ud,httpSigningMiddleware:()=>Zd,httpSigningMiddlewareOptions:()=>$d,isIdentityExpired:()=>Rg,memoizeIdentityProvider:()=>Bg,normalizeProvider:()=>rf,requestBuilder:()=>tg,setFeature:()=>Sg}),Wg=l((()=>{Md(),Kd(),nf(),af(),lf(),xg(),Cg(),Hg()})),Gg=u((e=>{var t=gd(),n=class{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){let n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){let e=this.data.keys(),t=0;for(;;){let{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t=``,{parameters:n}=this;if(n.length===0)return!1;for(let r of n){let n=String(e[r]??``);if(n.includes(`|;`))return!1;t+=n+`|;`}return t}};let r=RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`),i=e=>r.test(e)||e.startsWith(`[`)&&e.endsWith(`]`),a=RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`),o=(e,t=!1)=>{if(!t)return a.test(e);let n=e.split(`.`);for(let e of n)if(!o(e))return!1;return!0},s={},c=`endpoints`;function l(e){return typeof e!=`object`||!e?e:`ref`in e?`$${l(e.ref)}`:`fn`in e?`${e.fn}(${(e.argv||[]).map(l).join(`, `)})`:JSON.stringify(e,null,2)}var u=class extends Error{constructor(e){super(e),this.name=`EndpointError`}};let d=(e,t)=>e===t,f=e=>{let t=e.split(`.`),n=[];for(let r of t){let t=r.indexOf(`[`);if(t!==-1){if(r.indexOf(`]`)!==r.length-1)throw new u(`Path: '${e}' does not end with ']'`);let i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new u(`Invalid array index: '${i}' in path: '${e}'`);t!==0&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n},p=(e,t)=>f(t).reduce((n,r)=>{if(typeof n!=`object`)throw new u(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]},e),m=e=>e!=null,h=e=>!e,g={[t.EndpointURLScheme.HTTP]:80,[t.EndpointURLScheme.HTTPS]:443},_={booleanEquals:d,getAttr:p,isSet:m,isValidHostLabel:o,not:h,parseURL:e=>{let n=(()=>{try{if(e instanceof URL)return e;if(typeof e==`object`&&`hostname`in e){let{hostname:t,port:n,protocol:r=``,path:i=``,query:a={}}=e,o=new URL(`${r}//${t}${n?`:${n}`:``}${i}`);return o.search=Object.entries(a).map(([e,t])=>`${e}=${t}`).join(`&`),o}return new URL(e)}catch{return null}})();if(!n)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let r=n.href,{host:a,hostname:o,pathname:s,protocol:c,search:l}=n;if(l)return null;let u=c.slice(0,-1);if(!Object.values(t.EndpointURLScheme).includes(u))return null;let d=i(o);return{scheme:u,authority:`${a}${r.includes(`${a}:${g[u]}`)||typeof e==`string`&&e.includes(`${a}:${g[u]}`)?`:${g[u]}`:``}`,path:s,normalizedPath:s.endsWith(`/`)?s:`${s}/`,isIp:d}},stringEquals:(e,t)=>e===t,substring:(e,t,n,r)=>t>=n||e.length<n||/[^\u0000-\u007f]/.test(e)?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),uriEncode:e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},v=(e,t)=>{let n=[],r={...t.endpointParams,...t.referenceRecord},i=0;for(;i<e.length;){let t=e.indexOf(`{`,i);if(t===-1){n.push(e.slice(i));break}n.push(e.slice(i,t));let a=e.indexOf(`}`,t);if(a===-1){n.push(e.slice(t));break}e[t+1]===`{`&&e[a+1]===`}`&&(n.push(e.slice(t+1,a)),i=a+2);let o=e.substring(t+1,a);if(o.includes(`#`)){let[e,t]=o.split(`#`);n.push(p(r[e],t))}else n.push(r[o]);i=a+1}return n.join(``)},y=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],b=(e,t,n)=>{if(typeof e==`string`)return v(e,n);if(e.fn)return S.callFunction(e,n);if(e.ref)return y(e,n);throw new u(`'${t}': ${String(e)} is not a string, function or reference.`)},x=({fn:e,argv:t},n)=>{let r=t.map(e=>[`boolean`,`number`].includes(typeof e)?e:S.evaluateExpression(e,`arg`,n)),i=e.split(`.`);return i[0]in s&&i[1]!=null?s[i[0]][i[1]](...r):_[e](...r)},S={evaluateExpression:b,callFunction:x},C=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new u(`'${e}' is already defined in Reference Record.`);let r=x(t,n);return n.logger?.debug?.(`${c} evaluateCondition: ${l(t)} = ${l(r)}`),{result:r===``?!0:!!r,...e!=null&&{toAssign:{name:e,value:r}}}},w=(e=[],t)=>{let n={};for(let r of e){let{result:e,toAssign:i}=C(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};i&&(n[i.name]=i.value,t.logger?.debug?.(`${c} assign: ${i.name} := ${l(i.value)}`))}return{result:!0,referenceRecord:n}},ee=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r.map(e=>{let r=b(e,`Header value entry`,t);if(typeof r!=`string`)throw new u(`Header '${n}' value '${r}' is not a string`);return r})}),{}),te=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:E.getEndpointProperty(r,t)}),{}),T=(e,t)=>{if(Array.isArray(e))return e.map(e=>T(e,t));switch(typeof e){case`string`:return v(e,t);case`object`:if(e===null)throw new u(`Unexpected endpoint property: ${e}`);return E.getEndpointProperties(e,t);case`boolean`:return e;default:throw new u(`Unexpected endpoint property type: ${typeof e}`)}},E={getEndpointProperty:T,getEndpointProperties:te},ne=(e,t)=>{let n=b(e,`Endpoint URL`,t);if(typeof n==`string`)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new u(`Endpoint URL must be a string, got ${typeof n}`)},re=(e,t)=>{let{conditions:n,endpoint:r}=e,{result:i,referenceRecord:a}=w(n,t);if(!i)return;let o={...t,referenceRecord:{...t.referenceRecord,...a}},{url:s,properties:u,headers:d}=r;return t.logger?.debug?.(`${c} Resolving endpoint from template: ${l(r)}`),{...d!=null&&{headers:ee(d,o)},...u!=null&&{properties:te(u,o)},url:ne(s,o)}},ie=(e,t)=>{let{conditions:n,error:r}=e,{result:i,referenceRecord:a}=w(n,t);if(i)throw new u(b(r,`Error`,{...t,referenceRecord:{...t.referenceRecord,...a}}))},ae=(e,t)=>{for(let n of e)if(n.type===`endpoint`){let e=re(n,t);if(e)return e}else if(n.type===`error`)ie(n,t);else if(n.type===`tree`){let e=oe.evaluateTreeRule(n,t);if(e)return e}else throw new u(`Unknown endpoint rule: ${n}`);throw new u(`Rules evaluation failed`)},oe={evaluateRules:ae,evaluateTreeRule:(e,t)=>{let{conditions:n,rules:r}=e,{result:i,referenceRecord:a}=w(n,t);if(i)return oe.evaluateRules(r,{...t,referenceRecord:{...t.referenceRecord,...a}})}};e.EndpointCache=n,e.EndpointError=u,e.customEndpointFunctions=s,e.isIpAddress=i,e.isValidHostLabel=o,e.resolveEndpoint=(e,t)=>{let{endpointParams:n,logger:r}=t,{parameters:i,rules:a}=e;t.logger?.debug?.(`${c} Initial EndpointParams: ${l(n)}`);let o=Object.entries(i).filter(([,e])=>e.default!=null).map(([e,t])=>[e,t.default]);if(o.length>0)for(let[e,t]of o)n[e]=n[e]??t;let s=Object.entries(i).filter(([,e])=>e.required).map(([e])=>e);for(let e of s)if(n[e]==null)throw new u(`Missing required parameter: '${e}'`);let d=ae(a,{endpointParams:n,logger:r,referenceRecord:{}});return t.logger?.debug?.(`${c} Resolved endpoint: ${l(d)}`),d}})),Kg=u((e=>{var t=Gg(),n=$f();let r=(e,n=!1)=>{if(n){for(let t of e.split(`.`))if(!r(t))return!1;return!0}return!(!t.isValidHostLabel(e)||e.length<3||e.length>63||e!==e.toLowerCase()||t.isIpAddress(e))},i=e=>{let t=e.split(`:`);if(t.length<6)return null;let[n,r,i,a,o,...s]=t;return n!==`arn`||r===``||i===``||s.join(`:`)===``?null:{partition:r,service:i,region:a,accountId:o,resourceId:s.map(e=>e.split(`/`)).flat()}};var a={partitions:[{id:`aws`,outputs:{dnsSuffix:`amazonaws.com`,dualStackDnsSuffix:`api.aws`,implicitGlobalRegion:`us-east-1`,name:`aws`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$`,regions:{"af-south-1":{description:`Africa (Cape Town)`},"ap-east-1":{description:`Asia Pacific (Hong Kong)`},"ap-east-2":{description:`Asia Pacific (Taipei)`},"ap-northeast-1":{description:`Asia Pacific (Tokyo)`},"ap-northeast-2":{description:`Asia Pacific (Seoul)`},"ap-northeast-3":{description:`Asia Pacific (Osaka)`},"ap-south-1":{description:`Asia Pacific (Mumbai)`},"ap-south-2":{description:`Asia Pacific (Hyderabad)`},"ap-southeast-1":{description:`Asia Pacific (Singapore)`},"ap-southeast-2":{description:`Asia Pacific (Sydney)`},"ap-southeast-3":{description:`Asia Pacific (Jakarta)`},"ap-southeast-4":{description:`Asia Pacific (Melbourne)`},"ap-southeast-5":{description:`Asia Pacific (Malaysia)`},"ap-southeast-6":{description:`Asia Pacific (New Zealand)`},"ap-southeast-7":{description:`Asia Pacific (Thailand)`},"aws-global":{description:`aws global region`},"ca-central-1":{description:`Canada (Central)`},"ca-west-1":{description:`Canada West (Calgary)`},"eu-central-1":{description:`Europe (Frankfurt)`},"eu-central-2":{description:`Europe (Zurich)`},"eu-north-1":{description:`Europe (Stockholm)`},"eu-south-1":{description:`Europe (Milan)`},"eu-south-2":{description:`Europe (Spain)`},"eu-west-1":{description:`Europe (Ireland)`},"eu-west-2":{description:`Europe (London)`},"eu-west-3":{description:`Europe (Paris)`},"il-central-1":{description:`Israel (Tel Aviv)`},"me-central-1":{description:`Middle East (UAE)`},"me-south-1":{description:`Middle East (Bahrain)`},"mx-central-1":{description:`Mexico (Central)`},"sa-east-1":{description:`South America (Sao Paulo)`},"us-east-1":{description:`US East (N. Virginia)`},"us-east-2":{description:`US East (Ohio)`},"us-west-1":{description:`US West (N. California)`},"us-west-2":{description:`US West (Oregon)`}}},{id:`aws-cn`,outputs:{dnsSuffix:`amazonaws.com.cn`,dualStackDnsSuffix:`api.amazonwebservices.com.cn`,implicitGlobalRegion:`cn-northwest-1`,name:`aws-cn`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^cn\\-\\w+\\-\\d+$`,regions:{"aws-cn-global":{description:`aws-cn global region`},"cn-north-1":{description:`China (Beijing)`},"cn-northwest-1":{description:`China (Ningxia)`}}},{id:`aws-eusc`,outputs:{dnsSuffix:`amazonaws.eu`,dualStackDnsSuffix:`api.amazonwebservices.eu`,implicitGlobalRegion:`eusc-de-east-1`,name:`aws-eusc`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^eusc\\-(de)\\-\\w+\\-\\d+$`,regions:{"eusc-de-east-1":{description:`AWS European Sovereign Cloud (Germany)`}}},{id:`aws-iso`,outputs:{dnsSuffix:`c2s.ic.gov`,dualStackDnsSuffix:`api.aws.ic.gov`,implicitGlobalRegion:`us-iso-east-1`,name:`aws-iso`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-iso\\-\\w+\\-\\d+$`,regions:{"aws-iso-global":{description:`aws-iso global region`},"us-iso-east-1":{description:`US ISO East`},"us-iso-west-1":{description:`US ISO WEST`}}},{id:`aws-iso-b`,outputs:{dnsSuffix:`sc2s.sgov.gov`,dualStackDnsSuffix:`api.aws.scloud`,implicitGlobalRegion:`us-isob-east-1`,name:`aws-iso-b`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-isob\\-\\w+\\-\\d+$`,regions:{"aws-iso-b-global":{description:`aws-iso-b global region`},"us-isob-east-1":{description:`US ISOB East (Ohio)`},"us-isob-west-1":{description:`US ISOB West`}}},{id:`aws-iso-e`,outputs:{dnsSuffix:`cloud.adc-e.uk`,dualStackDnsSuffix:`api.cloud-aws.adc-e.uk`,implicitGlobalRegion:`eu-isoe-west-1`,name:`aws-iso-e`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^eu\\-isoe\\-\\w+\\-\\d+$`,regions:{"aws-iso-e-global":{description:`aws-iso-e global region`},"eu-isoe-west-1":{description:`EU ISOE West`}}},{id:`aws-iso-f`,outputs:{dnsSuffix:`csp.hci.ic.gov`,dualStackDnsSuffix:`api.aws.hci.ic.gov`,implicitGlobalRegion:`us-isof-south-1`,name:`aws-iso-f`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-isof\\-\\w+\\-\\d+$`,regions:{"aws-iso-f-global":{description:`aws-iso-f global region`},"us-isof-east-1":{description:`US ISOF EAST`},"us-isof-south-1":{description:`US ISOF SOUTH`}}},{id:`aws-us-gov`,outputs:{dnsSuffix:`amazonaws.com`,dualStackDnsSuffix:`api.aws`,implicitGlobalRegion:`us-gov-west-1`,name:`aws-us-gov`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-gov\\-\\w+\\-\\d+$`,regions:{"aws-us-gov-global":{description:`aws-us-gov global region`},"us-gov-east-1":{description:`AWS GovCloud (US-East)`},"us-gov-west-1":{description:`AWS GovCloud (US-West)`}}}],version:`1.1`};let o=a,s=``,c=e=>{let{partitions:t}=o;for(let n of t){let{regions:t,outputs:r}=n;for(let[n,i]of Object.entries(t))if(n===e)return{...r,...i}}for(let n of t){let{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}let n=t.find(e=>e.id===`aws`);if(!n)throw Error(`Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.`);return{...n.outputs}},l=(e,t=``)=>{o=e,s=t},u=()=>{l(a,``)},d=()=>s,f={isVirtualHostableS3Bucket:r,parseArn:i,partition:c};t.customEndpointFunctions.aws=f;let p=e=>{if(typeof e.endpointProvider!=`function`)throw Error(`@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.`);let{endpoint:t}=e;return t===void 0&&(e.endpoint=async()=>m(e.endpointProvider({Region:typeof e.region==`function`?await e.region():e.region,UseDualStack:typeof e.useDualstackEndpoint==`function`?await e.useDualstackEndpoint():e.useDualstackEndpoint,UseFIPS:typeof e.useFipsEndpoint==`function`?await e.useFipsEndpoint():e.useFipsEndpoint,Endpoint:void 0},{logger:e.logger}))),e},m=e=>n.parseUrl(e.url);e.EndpointError=t.EndpointError,e.isIpAddress=t.isIpAddress,e.resolveEndpoint=t.resolveEndpoint,e.awsEndpointFunctions=f,e.getUserAgentPrefix=d,e.partition=c,e.resolveDefaultAwsRegionalEndpointsConfig=p,e.setPartitionInfo=l,e.toEndpointV1=m,e.useDefaultPartitionInfo=u})),qg,Jg,Yg=l((()=>{qg={warningEmitted:!1},Jg=e=>{e&&!qg.warningEmitted&&parseInt(e.substring(1,e.indexOf(`.`)))<20&&(qg.warningEmitted=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
40
|
+
`),jm={warn:console.warn}}));function Nm(e){let t=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDay(),i=e.getUTCDate(),a=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getUTCSeconds(),c=i<10?`0${i}`:`${i}`,l=a<10?`0${a}`:`${a}`,u=o<10?`0${o}`:`${o}`,d=s<10?`0${s}`:`${s}`;return`${Pm[r]}, ${c} ${Fm[n]} ${t} ${l}:${u}:${d} GMT`}var Pm,Fm,Im,Lm,Rm,zm,Bm,Vm,Hm,Um,Wm,Gm,Km,qm,Jm,Ym,Xm,Zm,Qm,$m,eh,th,nh,rh=l((()=>{Mm(),Pm=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],Fm=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Im=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Lm=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-3339 date-times must be expressed as strings`);let t=Im.exec(e);if(!t)throw TypeError(`Invalid RFC-3339 date-time value`);let[n,r,i,a,o,s,c,l]=t;return Gm(Om(nh(r)),$m(i,`month`,1,12),$m(a,`day`,1,31),{hours:o,minutes:s,seconds:c,fractionalMilliseconds:l})},Rm=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),zm=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-3339 date-times must be expressed as strings`);let t=Rm.exec(e);if(!t)throw TypeError(`Invalid RFC-3339 date-time value`);let[n,r,i,a,o,s,c,l,u]=t,d=Gm(Om(nh(r)),$m(i,`month`,1,12),$m(a,`day`,1,31),{hours:o,minutes:s,seconds:c,fractionalMilliseconds:l});return u.toUpperCase()!=`Z`&&d.setTime(d.getTime()-th(u)),d},Bm=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Vm=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Hm=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Um=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC-7231 date-times must be expressed as strings`);let t=Bm.exec(e);if(t){let[e,n,r,i,a,o,s,c]=t;return Gm(Om(nh(i)),Ym(r),$m(n,`day`,1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:c})}if(t=Vm.exec(e),t){let[e,n,r,i,a,o,s,c]=t;return Jm(Gm(Km(i),Ym(r),$m(n,`day`,1,31),{hours:a,minutes:o,seconds:s,fractionalMilliseconds:c}))}if(t=Hm.exec(e),t){let[e,n,r,i,a,o,s,c]=t;return Gm(Om(nh(c)),Ym(n),$m(r.trimLeft(),`day`,1,31),{hours:i,minutes:a,seconds:o,fractionalMilliseconds:s})}throw TypeError(`Invalid RFC-7231 date-time value`)},Wm=e=>{if(e==null)return;let t;if(typeof e==`number`)t=e;else if(typeof e==`string`)t=hm(e);else if(typeof e==`object`&&e.tag===1)t=e.value;else throw TypeError(`Epoch timestamps must be expressed as floating point numbers or their string representation`);if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError(`Epoch timestamps must be valid, non-Infinite, non-NaN numerics`);return new Date(Math.round(t*1e3))},Gm=(e,t,n,r)=>{let i=t-1;return Zm(e,i,n),new Date(Date.UTC(e,i,n,$m(r.hours,`hour`,0,23),$m(r.minutes,`minute`,0,59),$m(r.seconds,`seconds`,0,60),eh(r.fractionalMilliseconds)))},Km=e=>{let t=new Date().getUTCFullYear(),n=Math.floor(t/100)*100+Om(nh(e));return n<t?n+100:n},qm=50*365*24*60*60*1e3,Jm=e=>e.getTime()-new Date().getTime()>qm?new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds())):e,Ym=e=>{let t=Fm.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Xm=[31,28,31,30,31,30,31,31,30,31,30,31],Zm=(e,t,n)=>{let r=Xm[t];if(t===1&&Qm(e)&&(r=29),n>r)throw TypeError(`Invalid day for ${Fm[t]} in ${e}: ${n}`)},Qm=e=>e%4==0&&(e%100!=0||e%400==0),$m=(e,t,n,r)=>{let i=km(nh(e));if(i<n||i>r)throw TypeError(`${t} must be between ${n} and ${r}, inclusive`);return i},eh=e=>e==null?0:_m(`0.`+e)*1e3,th=e=>{let t=e[0],n=1;if(t==`+`)n=1;else if(t==`-`)n=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let r=Number(e.substring(1,3)),i=Number(e.substring(4,6));return n*(r*60+i)*60*1e3},nh=e=>{let t=0;for(;t<e.length-1&&e.charAt(t)===`0`;)t++;return t===0?e:e.slice(t)}})),ih=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.randomUUID=void 0;let t=(N(),m(j)).__importDefault(h(`crypto`));e.randomUUID=t.default.randomUUID.bind(t.default)})),ah=u((e=>{var t=ih();let n=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));e.v4=()=>{if(t.randomUUID)return t.randomUUID();let e=new Uint8Array(16);return crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128,n[e[0]]+n[e[1]]+n[e[2]]+n[e[3]]+`-`+n[e[4]]+n[e[5]]+`-`+n[e[6]]+n[e[7]]+`-`+n[e[8]]+n[e[9]]+`-`+n[e[10]]+n[e[11]]+n[e[12]]+n[e[13]]+n[e[14]]+n[e[15]]}})),oh,sh=l((()=>{oh=ah()})),ch,lh=l((()=>{ch=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})},ch.from=e=>e&&typeof e==`object`&&(e instanceof ch||`deserializeJSON`in e)?e:typeof e==`string`||Object.getPrototypeOf(e)===String.prototype?ch(String(e)):ch(JSON.stringify(e)),ch.fromObject=ch.from}));function uh(e){return(e.includes(`,`)||e.includes(`"`))&&(e=`"${e.replace(/"/g,`\\"`)}"`),e}var dh=l((()=>{}));function fh(e,t,n){let r=Number(e);if(r<t||r>n)throw Error(`Value ${r} out of range [${t}, ${n}]`)}var ph,mh,hh,gh,_h,vh,yh,bh,xh,Sh,Ch,wh,Th,Eh=l((()=>{ph=`(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`,mh=`(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`,hh=`(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`,gh=`(\\d?\\d)`,_h=`(\\d{4})`,vh=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),yh=RegExp(`^${ph}, ${gh} ${mh} ${_h} ${hh} GMT$`),bh=RegExp(`^${ph}, ${gh}-${mh}-(\\d\\d) ${hh} GMT$`),xh=RegExp(`^${ph} ${mh} ( [1-9]|\\d\\d) ${hh} ${_h}$`),Sh=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Ch=e=>{if(e==null)return;let t=NaN;if(typeof e==`number`)t=e;else if(typeof e==`string`){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError(`parseEpochTimestamp - numeric string invalid.`);t=Number.parseFloat(e)}else typeof e==`object`&&e.tag===1&&(t=e.value);if(isNaN(t)||Math.abs(t)===1/0)throw TypeError(`Epoch timestamps must be valid finite numbers.`);return new Date(Math.round(t*1e3))},wh=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC3339 timestamps must be strings`);let t=vh.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,n,r,i,a,o,s,,c,l]=t;fh(r,1,12),fh(i,1,31),fh(a,0,23),fh(o,0,59),fh(s,0,60);let u=new Date(Date.UTC(Number(n),Number(r)-1,Number(i),Number(a),Number(o),Number(s),Number(c)?Math.round(parseFloat(`0.${c}`)*1e3):0));if(u.setUTCFullYear(Number(n)),l.toUpperCase()!=`Z`){let[,e,t,n]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,`+`,0,0],r=e===`-`?1:-1;u.setTime(u.getTime()+r*(Number(t)*60*60*1e3+Number(n)*60*1e3))}return u},Th=e=>{if(e==null)return;if(typeof e!=`string`)throw TypeError(`RFC7231 timestamps must be strings.`);let t,n,r,i,a,o,s,c;if((c=yh.exec(e))?[,t,n,r,i,a,o,s]=c:(c=bh.exec(e))?([,t,n,r,i,a,o,s]=c,r=(Number(r)+1900).toString()):(c=xh.exec(e))&&([,n,t,i,a,o,s,r]=c),r&&o){let e=Date.UTC(Number(r),Sh.indexOf(n),Number(t),Number(i),Number(a),Number(o),s?Math.round(parseFloat(`0.${s}`)*1e3):0);fh(t,1,31),fh(i,0,23),fh(a,0,59),fh(o,0,60);let c=new Date(e);return c.setUTCFullYear(Number(r)),c}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)}}));function Dh(e,t,n){if(n<=0||!Number.isInteger(n))throw Error(`Invalid number of delimiters (`+n+`) for splitEvery.`);let r=e.split(t);if(n===1)return r;let i=[],a=``;for(let e=0;e<r.length;e++)a===``?a=r[e]:a+=t+r[e],(e+1)%n===0&&(i.push(a),a=``);return a!==``&&i.push(a),i}var Oh=l((()=>{})),kh,Ah=l((()=>{kh=e=>{let t=e.length,n=[],r=!1,i,a=0;for(let o=0;o<t;++o){let t=e[o];switch(t){case`"`:i!==`\\`&&(r=!r);break;case`,`:r||(n.push(e.slice(a,o)),a=o+1);break;default:}i=t}return n.push(e.slice(a)),n.map(e=>{e=e.trim();let t=e.length;return t<2?e:(e[0]===`"`&&e[t-1]===`"`&&(e=e.slice(1,t-1)),e.replace(/\\"/g,`"`))})}}));function jh(e){return new Nh(String(e),`bigDecimal`)}var Mh,Nh,Ph=l((()=>{Mh=/^-?\d*(\.\d+)?$/,Nh=class e{string;type;constructor(e,t){if(this.string=e,this.type=t,!Mh.test(e))throw Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`)}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!=`object`)return!1;let n=t;return e.prototype.isPrototypeOf(t)||n.type===`bigDecimal`&&Mh.test(n.string)}}})),Fh=d({LazyJsonString:()=>ch,NumericValue:()=>Nh,_parseEpochTimestamp:()=>Ch,_parseRfc3339DateTimeWithOffset:()=>wh,_parseRfc7231DateTime:()=>Th,copyDocumentWithTransform:()=>Zp,dateToUtcString:()=>Nm,expectBoolean:()=>em,expectByte:()=>cm,expectFloat32:()=>rm,expectInt:()=>am,expectInt32:()=>om,expectLong:()=>im,expectNonNull:()=>dm,expectNumber:()=>tm,expectObject:()=>fm,expectShort:()=>sm,expectString:()=>pm,expectUnion:()=>mm,generateIdempotencyToken:()=>oh.v4,handleFloat:()=>xm,limitedParseDouble:()=>bm,limitedParseFloat:()=>Sm,limitedParseFloat32:()=>Cm,logger:()=>jm,nv:()=>jh,parseBoolean:()=>$p,parseEpochTimestamp:()=>Wm,parseRfc3339DateTime:()=>Lm,parseRfc3339DateTimeWithOffset:()=>zm,parseRfc7231DateTime:()=>Um,quoteHeader:()=>uh,splitEvery:()=>Dh,splitHeader:()=>kh,strictParseByte:()=>km,strictParseDouble:()=>hm,strictParseFloat:()=>gm,strictParseFloat32:()=>_m,strictParseInt:()=>Em,strictParseInt32:()=>Dm,strictParseLong:()=>Tm,strictParseShort:()=>Om}),Ih=l((()=>{Qp(),rh(),sh(),lh(),Mm(),dh(),Eh(),Oh(),Ah(),Ph()})),Lh,Rh=l((()=>{Lh=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}})),zh,Bh,Vh=l((()=>{zh=mf(),Bh=class{marshaller;serializer;deserializer;serdeContext;defaultContentType;constructor({marshaller:e,serializer:t,deserializer:n,serdeContext:r,defaultContentType:i}){this.marshaller=e,this.serializer=t,this.deserializer=n,this.serdeContext=r,this.defaultContentType=i}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){let r=this.marshaller,i=t.getEventStreamMember(),a=t.getMemberSchema(i),o=this.serializer,s=this.defaultContentType,c=Symbol(`initialRequestMarker`),l={async*[Symbol.asyncIterator](){if(n){let e={":event-type":{type:`string`,value:`initial-request`},":message-type":{type:`string`,value:`event`},":content-type":{type:`string`,value:s}};o.write(t,n);let r=o.flush();yield{[c]:!0,headers:e,body:r}}for await(let t of e)yield t}};return r.serialize(l,e=>{if(e[c])return{headers:e.headers,body:e.body};let t=Object.keys(e).find(e=>e!==`__type`)??``,{additionalHeaders:n,body:r,eventType:i,explicitPayloadContentType:o}=this.writeEventBody(t,a,e);return{headers:{":event-type":{type:`string`,value:i},":message-type":{type:`string`,value:`event`},":content-type":{type:`string`,value:o??s},...n},body:r}})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){let r=this.marshaller,i=t.getEventStreamMember(),a=t.getMemberSchema(i).getMemberSchemas(),o=Symbol(`initialResponseMarker`),s=r.deserialize(e.body,async e=>{let n=Object.keys(e).find(e=>e!==`__type`)??``,r=e[n].body;if(n===`initial-response`){let e=await this.deserializer.read(t,r);return delete e[i],{[o]:!0,...e}}else if(n in a){let t=a[n];if(t.isStructSchema()){let i={},a=!1;for(let[o,s]of t.structIterator()){let{eventHeader:t,eventPayload:c}=s.getMergedTraits();if(a||=!!(t||c),c)s.isBlobSchema()?i[o]=r:s.isStringSchema()?i[o]=(this.serdeContext?.utf8Encoder??zh.toUtf8)(r):s.isStructSchema()&&(i[o]=await this.deserializer.read(s,r));else if(t){let t=e[n].headers[o]?.value;t!=null&&(s.isNumericSchema()?t&&typeof t==`object`&&`bytes`in t?i[o]=BigInt(t.toString()):i[o]=Number(t):i[o]=t)}}if(a)return{[n]:i};if(r.byteLength===0)return{[n]:{}}}return{[n]:await this.deserializer.read(t,r)}}else return{$unknown:e}}),c=s[Symbol.asyncIterator](),l=await c.next();if(l.done)return s;if(l.value?.[o]){if(!t)throw Error(`@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.`);for(let[e,t]of Object.entries(l.value))n[e]=t}return{async*[Symbol.asyncIterator](){for(l?.value?.[o]||(yield l.value);;){let{done:e,value:t}=await c.next();if(e)break;yield t}}}}writeEventBody(e,t,n){let r=this.serializer,i=e,a=null,o,s=t.getSchema()[4].includes(e),c={};if(s){let i=t.getMemberSchema(e);if(i.isStructSchema()){for(let[t,r]of i.structIterator()){let{eventHeader:i,eventPayload:o}=r.getMergedTraits();if(o)a=t;else if(i){let i=n[e][t],a=`binary`;r.isNumericSchema()?a=(-2)**31<=i&&i<=2**31-1?`integer`:`long`:r.isTimestampSchema()?a=`timestamp`:r.isStringSchema()?a=`string`:r.isBooleanSchema()&&(a=`boolean`),i!=null&&(c[t]={type:a,value:i},delete n[e][t])}}if(a!==null){let t=i.getMemberSchema(a);t.isBlobSchema()?o=`application/octet-stream`:t.isStringSchema()&&(o=`text/plain`),r.write(t,n[e][a])}else r.write(i,n[e])}else if(i.isUnitSchema())r.write(i,{});else throw Error(`@smithy/core/event-streams - non-struct member not supported in event stream union.`)}else{let[t,a]=n[e];i=t,r.write(15,a)}let l=r.flush()??new Uint8Array;return{body:typeof l==`string`?(this.serdeContext?.utf8Decoder??zh.fromUtf8)(l):l,eventType:i,explicitPayloadContentType:o,additionalHeaders:c}}}})),Hh=d({EventStreamSerde:()=>Bh}),Uh=l((()=>{Vh()})),Wh,Gh,Kh=l((()=>{Xp(),Wh=vd(),Rh(),Gh=class extends Lh{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=qp.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return Wh.HttpRequest}getResponseType(){return Wh.HttpResponse}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if(`url`in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||={};for(let[n,r]of t.url.searchParams.entries())e.query[n]=r;if(t.headers)for(let[n,r]of Object.entries(t.headers))e.headers[n]=r.join(`, `);return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let[n,r]of Object.entries(t.headers))e.headers[n]=r;return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;let r=Lp.of(t.input),i=Ap(t.traits??{});if(i.endpoint){let t=i.endpoint?.[0];if(typeof t==`string`){let i=[...r.structIterator()].filter(([,e])=>e.getMergedTraits().hostLabel);for(let[e]of i){let r=n[e];if(typeof r!=`string`)throw Error(`@smithy/core/schema - ${e} in input must be a string as hostLabel.`);t=t.replace(`{${e}}`,r)}e.hostname=t+e.hostname}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){let{EventStreamSerde:e}=await Promise.resolve().then(()=>(Uh(),Hh));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,n,r,i){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw Error(`@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.`);return e.eventStreamMarshaller}}})),qh,Jh,Yh,Xh=l((()=>{Xp(),Ih(),qh=vd(),Jh=Rf(),Vf(),Uf(),Kh(),Yh=class extends Gh{async serializeRequest(e,t,n){let r=t&&typeof t==`object`?t:{},i=this.serializer,a={},o={},s=await n.endpoint(),c=Lp.of(e?.input),l=[],u=[],d=!1,f,p=new qh.HttpRequest({protocol:``,hostname:``,port:void 0,path:``,fragment:void 0,query:a,headers:o,body:void 0});if(s){this.updateServiceEndpoint(p,s),this.setHostPrefix(p,e,r);let t=Ap(e.traits);if(t.http){p.method=t.http[0];let[e,n]=t.http[1].split(`?`);p.path==`/`?p.path=e:p.path+=e;let r=new URLSearchParams(n??``);Object.assign(a,Object.fromEntries(r))}}for(let[e,t]of c.structIterator()){let n=t.getMergedTraits()??{},s=r[e];if(s==null&&!t.isIdempotencyToken()){if(n.httpLabel&&(p.path.includes(`{${e}+}`)||p.path.includes(`{${e}}`)))throw Error(`No value provided for input HTTP label: ${e}.`);continue}if(n.httpPayload)t.isStreaming()?t.isStructSchema()?r[e]&&(f=await this.serializeEventStream({eventStream:r[e],requestSchema:c})):f=s:(i.write(t,s),f=i.flush());else if(n.httpLabel){i.write(t,s);let n=i.flush();p.path.includes(`{${e}+}`)?p.path=p.path.replace(`{${e}+}`,n.split(`/`).map(Hf).join(`/`)):p.path.includes(`{${e}}`)&&(p.path=p.path.replace(`{${e}}`,Hf(n)))}else if(n.httpHeader)i.write(t,s),o[n.httpHeader.toLowerCase()]=String(i.flush());else if(typeof n.httpPrefixHeaders==`string`)for(let[e,r]of Object.entries(s)){let a=n.httpPrefixHeaders+e;i.write([t.getValueSchema(),{httpHeader:a}],r),o[a.toLowerCase()]=i.flush()}else n.httpQuery||n.httpQueryParams?this.serializeQuery(t,s,a):(d=!0,l.push(e),u.push(t))}if(d&&r){let[e,t]=(c.getName(!0)??`#Unknown`).split(`#`),n=c.getSchema()[6],a=[3,e,t,c.getMergedTraits(),l,u,void 0];n?a[6]=n:a.pop(),i.write(a,r),f=i.flush()}return p.headers=o,p.query=a,p.body=f,p}serializeQuery(e,t,n){let r=this.serializer,i=e.getMergedTraits();if(i.httpQueryParams){for(let[r,a]of Object.entries(t))if(!(r in n)){let t=e.getValueSchema();Object.assign(t.getMergedTraits(),{...i,httpQuery:r,httpQueryParams:void 0}),this.serializeQuery(t,a,n)}return}if(e.isListSchema()){let a=!!e.getMergedTraits().sparse,o=[];for(let n of t){r.write([e.getValueSchema(),i],n);let t=r.flush();(a||t!==void 0)&&o.push(t)}n[i.httpQuery]=o}else r.write([e,i],t),n[i.httpQuery]=r.flush()}async deserializeResponse(e,t,n){let r=this.deserializer,i=Lp.of(e.output),a={};if(n.statusCode>=300){let i=await Bf(n.body,t);throw i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n)),Error(`@smithy/core/protocols - HTTP Protocol error handler failed to throw.`)}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=await this.deserializeHttpMessage(i,t,n,a);if(o.length){let e=await Bf(n.body,t);if(e.byteLength>0){let t=await r.read(i,e);for(let e of o)t[e]!=null&&(a[e]=t[e])}}else o.discardResponseBody&&await Bf(n.body,t);return a.$metadata=this.deserializeMetadata(n),a}async deserializeHttpMessage(e,t,n,r,i){let a;a=r instanceof Set?i:r;let o=!0,s=this.deserializer,c=Lp.of(e),l=[];for(let[e,r]of c.structIterator()){let i=r.getMemberTraits();if(i.httpPayload){if(o=!1,r.isStreaming())r.isStructSchema()?a[e]=await this.deserializeEventStream({response:n,responseSchema:c}):a[e]=(0,Jh.sdkStreamMixin)(n.body);else if(n.body){let i=await Bf(n.body,t);i.byteLength>0&&(a[e]=await s.read(r,i))}}else if(i.httpHeader){let t=String(i.httpHeader).toLowerCase(),o=n.headers[t];if(o!=null)if(r.isListSchema()){let n=r.getValueSchema();n.getMergedTraits().httpHeader=t;let i;i=n.isTimestampSchema()&&n.getSchema()===4?Dh(o,`,`,2):kh(o);let c=[];for(let e of i)c.push(await s.read(n,e.trim()));a[e]=c}else a[e]=await s.read(r,o)}else if(i.httpPrefixHeaders!==void 0){a[e]={};for(let[t,o]of Object.entries(n.headers))if(t.startsWith(i.httpPrefixHeaders)){let n=r.getValueSchema();n.getMergedTraits().httpHeader=t,a[e][t.slice(i.httpPrefixHeaders.length)]=await s.read(n,o)}}else i.httpResponseCode?a[e]=n.statusCode:l.push(e)}return l.discardResponseBody=o,l}}})),Zh,Qh,$h=l((()=>{Xp(),Zh=vd(),Vf(),Kh(),Qh=class extends Gh{async serializeRequest(e,t,n){let r=this.serializer,i={},a={},o=await n.endpoint(),s=Lp.of(e?.input),c=s.getSchema(),l,u=t&&typeof t==`object`?t:{},d=new Zh.HttpRequest({protocol:``,hostname:``,port:void 0,path:`/`,fragment:void 0,query:i,headers:a,body:void 0});if(o&&(this.updateServiceEndpoint(d,o),this.setHostPrefix(d,e,u)),u){let e=s.getEventStreamMember();if(e){if(u[e]){let t={};for(let[n,i]of s.structIterator())n!==e&&u[n]&&(r.write(i,u[n]),t[n]=r.flush());l=await this.serializeEventStream({eventStream:u[e],requestSchema:s,initialRequest:t})}}else r.write(c,u),l=r.flush()}return d.headers=Object.assign(d.headers,a),d.query=i,d.body=l,d.method=`POST`,d}async deserializeResponse(e,t,n){let r=this.deserializer,i=Lp.of(e.output),a={};if(n.statusCode>=300){let i=await Bf(n.body,t);throw i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n)),Error(`@smithy/core/protocols - RPC Protocol error handler failed to throw.`)}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=i.getEventStreamMember();if(o)a[o]=await this.deserializeEventStream({response:n,responseSchema:i,initialResponseContainer:a});else{let e=await Bf(n.body,t);e.byteLength>0&&Object.assign(a,await r.read(i,e))}return a.$metadata=this.deserializeMetadata(n),a}}})),eg,tg=l((()=>{Uf(),eg=(e,t,n,r,i,a)=>{if(t!=null&&t[n]!==void 0){let t=r();if(t==null||t.length<=0)throw Error(`Empty value provided for input HTTP label: `+n+`.`);e=e.replace(i,a?t.split(`/`).map(e=>Hf(e)).join(`/`):Hf(t))}else throw Error(`No value provided for input HTTP label: `+n+`.`);return e}}));function ng(e,t){return new ig(e,t)}var rg,ig,ag=l((()=>{rg=vd(),tg(),ig=class{input;context;query={};method=``;headers={};path=``;body=null;hostname=``;resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){let{hostname:e,protocol:t=`https`,port:n,path:r}=await this.context.endpoint();this.path=r;for(let e of this.resolvePathStack)e(this.path);return new rg.HttpRequest({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(i=>{this.path=eg(i,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}}}));function og(e,t){if(t.timestampFormat.useTrait&&e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema();let{httpLabel:n,httpPrefixHeaders:r,httpHeader:i,httpQuery:a}=e.getMergedTraits();return(t.httpBindings?typeof r==`string`||i?6:a||n?5:void 0:void 0)??t.timestampFormat.default}var sg=l((()=>{})),cg,lg,ug,dg=l((()=>{Xp(),Ih(),cg=gf(),lg=mf(),Rh(),sg(),ug=class extends Lh{settings;constructor(e){super(),this.settings=e}read(e,t){let n=Lp.of(e);if(n.isListSchema())return kh(t).map(e=>this.read(n.getValueSchema(),e));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??cg.fromBase64)(t);if(n.isTimestampSchema())switch(og(n,this.settings)){case 5:return wh(t);case 6:return Th(t);case 7:return Ch(t);default:return console.warn(`Missing timestamp format, parsing value with Date constructor:`,t),new Date(t)}if(n.isStringSchema()){let e=n.getMergedTraits().mediaType,r=t;if(e)return n.getMergedTraits().httpHeader&&(r=this.base64ToUtf8(r)),(e===`application/json`||e.endsWith(`+json`))&&(r=ch.from(r)),r}return n.isNumericSchema()?Number(t):n.isBigIntegerSchema()?BigInt(t):n.isBigDecimalSchema()?new Nh(t,`bigDecimal`):n.isBooleanSchema()?String(t).toLowerCase()===`true`:t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??lg.toUtf8)((this.serdeContext?.base64Decoder??cg.fromBase64)(e))}}})),fg,pg,mg=l((()=>{Xp(),fg=mf(),Rh(),dg(),pg=class extends Lh{codecDeserializer;stringDeserializer;constructor(e,t){super(),this.codecDeserializer=e,this.stringDeserializer=new ug(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){let n=Lp.of(e),r=n.getMergedTraits(),i=this.serdeContext?.utf8Encoder??fg.toUtf8;if(r.httpHeader||r.httpResponseCode)return this.stringDeserializer.read(n,i(t));if(r.httpPayload){if(n.isBlobSchema()){let e=this.serdeContext?.utf8Decoder??fg.fromUtf8;return typeof t==`string`?e(t):t}else if(n.isStringSchema())return`byteLength`in t?i(t):t}return this.codecDeserializer.read(n,t)}}})),hg,gg,_g=l((()=>{Xp(),Ih(),hg=gf(),Rh(),sg(),gg=class extends Lh{settings;stringBuffer=``;constructor(e){super(),this.settings=e}write(e,t){let n=Lp.of(e);switch(typeof t){case`object`:if(t===null){this.stringBuffer=`null`;return}if(n.isTimestampSchema()){if(!(t instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${n.getName(!0)}`);switch(og(n,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(`.000Z`,`Z`);break;case 6:this.stringBuffer=Nm(t);break;case 7:this.stringBuffer=String(t.getTime()/1e3);break;default:console.warn(`Missing timestamp format, using epoch seconds`,t),this.stringBuffer=String(t.getTime()/1e3)}return}if(n.isBlobSchema()&&`byteLength`in t){this.stringBuffer=(this.serdeContext?.base64Encoder??hg.toBase64)(t);return}if(n.isListSchema()&&Array.isArray(t)){let e=``;for(let r of t){this.write([n.getValueSchema(),n.getMergedTraits()],r);let t=this.flush(),i=n.getValueSchema().isTimestampSchema()?t:uh(t);e!==``&&(e+=`, `),e+=i}this.stringBuffer=e;return}this.stringBuffer=JSON.stringify(t,null,2);break;case`string`:let e=n.getMergedTraits().mediaType,r=t;if(e&&((e===`application/json`||e.endsWith(`+json`))&&(r=ch.from(r)),n.getMergedTraits().httpHeader)){this.stringBuffer=(this.serdeContext?.base64Encoder??hg.toBase64)(r.toString());return}this.stringBuffer=t;break;default:n.isIdempotencyToken()?this.stringBuffer=(0,oh.v4)():this.stringBuffer=String(t)}}flush(){let e=this.stringBuffer;return this.stringBuffer=``,e}}})),vg,yg=l((()=>{Xp(),_g(),vg=class{codecSerializer;stringSerializer;buffer;constructor(e,t,n=new gg(t)){this.codecSerializer=e,this.stringSerializer=n}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){let n=Lp.of(e),r=n.getMergedTraits();if(r.httpHeader||r.httpLabel||r.httpQuery){this.stringSerializer.write(n,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}})),bg=d({FromStringShapeDeserializer:()=>ug,HttpBindingProtocol:()=>Yh,HttpInterceptingShapeDeserializer:()=>pg,HttpInterceptingShapeSerializer:()=>vg,HttpProtocol:()=>Gh,RequestBuilder:()=>ig,RpcProtocol:()=>Qh,SerdeContext:()=>Lh,ToStringShapeSerializer:()=>gg,collectBody:()=>Bf,determineTimestampFormat:()=>og,extendedEncodeURIComponent:()=>Hf,requestBuilder:()=>ng,resolvedPath:()=>eg}),xg=l((()=>{Vf(),Uf(),Xh(),Kh(),$h(),ag(),tg(),dg(),mg(),yg(),_g(),sg(),Rh()})),Sg=l((()=>{xg()}));function Cg(e,t,n){e.__smithy_context?e.__smithy_context.features||(e.__smithy_context.features={}):e.__smithy_context={features:{}},e.__smithy_context.features[t]=n}var wg=l((()=>{})),Tg,Eg=l((()=>{Tg=class{authSchemes=new Map;constructor(e){for(let[t,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}})),Dg,Og,kg,Ag=l((()=>{Dg=vd(),Og=_d(),kg=class{async sign(e,t,n){if(!n)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!n.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!n.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!t.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let r=Dg.HttpRequest.clone(e);if(n.in===Og.HttpApiKeyAuthLocation.QUERY)r.query[n.name]=t.apiKey;else if(n.in===Og.HttpApiKeyAuthLocation.HEADER)r.headers[n.name]=n.scheme?`${n.scheme} ${t.apiKey}`:t.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+n.in+"`");return r}}})),jg,Mg,Ng=l((()=>{jg=vd(),Mg=class{async sign(e,t,n){let r=jg.HttpRequest.clone(e);if(!t.token)throw Error("request could not be signed with `token` since the `token` is not defined");return r.headers.Authorization=`Bearer ${t.token}`,r}}})),Pg,Fg=l((()=>{Pg=class{async sign(e,t,n){return e}}})),Ig=l((()=>{Ag(),Ng(),Fg()})),Lg,Rg,zg,Bg,Vg,Hg=l((()=>{Lg=e=>function(t){return Bg(t)&&t.expiration.getTime()-Date.now()<e},Rg=3e5,zg=Lg(Rg),Bg=e=>e.expiration!==void 0,Vg=(e,t,n)=>{if(e===void 0)return;let r=typeof e==`function`?e:async()=>Promise.resolve(e),i,a,o,s=!1,c=async e=>{a||=r(e);try{i=await a,o=!0,s=!1}finally{a=void 0}return i};return t===void 0?async e=>((!o||e?.forceRefresh)&&(i=await c(e)),i):async e=>((!o||e?.forceRefresh)&&(i=await c(e)),s?i:n(i)?(t(i)&&await c(e),i):(s=!0,i))}})),Ug=l((()=>{Eg(),Ig(),Hg()})),Wg=d({DefaultIdentityProviderConfig:()=>Tg,EXPIRATION_MS:()=>Rg,HttpApiKeyAuthSigner:()=>kg,HttpBearerAuthSigner:()=>Mg,NoAuthSigner:()=>Pg,createIsIdentityExpiredFunction:()=>Lg,createPaginator:()=>sf,doesIdentityRequireRefresh:()=>Bg,getHttpAuthSchemeEndpointRuleSetPlugin:()=>Hd,getHttpAuthSchemePlugin:()=>Gd,getHttpSigningPlugin:()=>tf,getSmithyContext:()=>Md,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>Vd,httpAuthSchemeMiddleware:()=>zd,httpAuthSchemeMiddlewareOptions:()=>Wd,httpSigningMiddleware:()=>Qd,httpSigningMiddlewareOptions:()=>ef,isIdentityExpired:()=>zg,memoizeIdentityProvider:()=>Vg,normalizeProvider:()=>af,requestBuilder:()=>ng,setFeature:()=>Cg}),Gg=l((()=>{Nd(),qd(),rf(),of(),uf(),Sg(),wg(),Ug()})),Kg=u((e=>{var t=_d(),n=class{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){let n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){let e=this.data.keys(),t=0;for(;;){let{value:n,done:r}=e.next();if(this.data.delete(n),r||++t>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t=``,{parameters:n}=this;if(n.length===0)return!1;for(let r of n){let n=String(e[r]??``);if(n.includes(`|;`))return!1;t+=n+`|;`}return t}};let r=RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`),i=e=>r.test(e)||e.startsWith(`[`)&&e.endsWith(`]`),a=RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`),o=(e,t=!1)=>{if(!t)return a.test(e);let n=e.split(`.`);for(let e of n)if(!o(e))return!1;return!0},s={},c=`endpoints`;function l(e){return typeof e!=`object`||!e?e:`ref`in e?`$${l(e.ref)}`:`fn`in e?`${e.fn}(${(e.argv||[]).map(l).join(`, `)})`:JSON.stringify(e,null,2)}var u=class extends Error{constructor(e){super(e),this.name=`EndpointError`}};let d=(e,t)=>e===t,f=e=>{let t=e.split(`.`),n=[];for(let r of t){let t=r.indexOf(`[`);if(t!==-1){if(r.indexOf(`]`)!==r.length-1)throw new u(`Path: '${e}' does not end with ']'`);let i=r.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new u(`Invalid array index: '${i}' in path: '${e}'`);t!==0&&n.push(r.slice(0,t)),n.push(i)}else n.push(r)}return n},p=(e,t)=>f(t).reduce((n,r)=>{if(typeof n!=`object`)throw new u(`Index '${r}' in '${t}' not found in '${JSON.stringify(e)}'`);return Array.isArray(n)?n[parseInt(r)]:n[r]},e),m=e=>e!=null,h=e=>!e,g={[t.EndpointURLScheme.HTTP]:80,[t.EndpointURLScheme.HTTPS]:443},_={booleanEquals:d,getAttr:p,isSet:m,isValidHostLabel:o,not:h,parseURL:e=>{let n=(()=>{try{if(e instanceof URL)return e;if(typeof e==`object`&&`hostname`in e){let{hostname:t,port:n,protocol:r=``,path:i=``,query:a={}}=e,o=new URL(`${r}//${t}${n?`:${n}`:``}${i}`);return o.search=Object.entries(a).map(([e,t])=>`${e}=${t}`).join(`&`),o}return new URL(e)}catch{return null}})();if(!n)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let r=n.href,{host:a,hostname:o,pathname:s,protocol:c,search:l}=n;if(l)return null;let u=c.slice(0,-1);if(!Object.values(t.EndpointURLScheme).includes(u))return null;let d=i(o);return{scheme:u,authority:`${a}${r.includes(`${a}:${g[u]}`)||typeof e==`string`&&e.includes(`${a}:${g[u]}`)?`:${g[u]}`:``}`,path:s,normalizedPath:s.endsWith(`/`)?s:`${s}/`,isIp:d}},stringEquals:(e,t)=>e===t,substring:(e,t,n,r)=>t>=n||e.length<n||/[^\u0000-\u007f]/.test(e)?null:r?e.substring(e.length-n,e.length-t):e.substring(t,n),uriEncode:e=>encodeURIComponent(e).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},v=(e,t)=>{let n=[],r={...t.endpointParams,...t.referenceRecord},i=0;for(;i<e.length;){let t=e.indexOf(`{`,i);if(t===-1){n.push(e.slice(i));break}n.push(e.slice(i,t));let a=e.indexOf(`}`,t);if(a===-1){n.push(e.slice(t));break}e[t+1]===`{`&&e[a+1]===`}`&&(n.push(e.slice(t+1,a)),i=a+2);let o=e.substring(t+1,a);if(o.includes(`#`)){let[e,t]=o.split(`#`);n.push(p(r[e],t))}else n.push(r[o]);i=a+1}return n.join(``)},y=({ref:e},t)=>({...t.endpointParams,...t.referenceRecord})[e],b=(e,t,n)=>{if(typeof e==`string`)return v(e,n);if(e.fn)return S.callFunction(e,n);if(e.ref)return y(e,n);throw new u(`'${t}': ${String(e)} is not a string, function or reference.`)},x=({fn:e,argv:t},n)=>{let r=t.map(e=>[`boolean`,`number`].includes(typeof e)?e:S.evaluateExpression(e,`arg`,n)),i=e.split(`.`);return i[0]in s&&i[1]!=null?s[i[0]][i[1]](...r):_[e](...r)},S={evaluateExpression:b,callFunction:x},C=({assign:e,...t},n)=>{if(e&&e in n.referenceRecord)throw new u(`'${e}' is already defined in Reference Record.`);let r=x(t,n);return n.logger?.debug?.(`${c} evaluateCondition: ${l(t)} = ${l(r)}`),{result:r===``?!0:!!r,...e!=null&&{toAssign:{name:e,value:r}}}},w=(e=[],t)=>{let n={};for(let r of e){let{result:e,toAssign:i}=C(r,{...t,referenceRecord:{...t.referenceRecord,...n}});if(!e)return{result:e};i&&(n[i.name]=i.value,t.logger?.debug?.(`${c} assign: ${i.name} := ${l(i.value)}`))}return{result:!0,referenceRecord:n}},ee=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:r.map(e=>{let r=b(e,`Header value entry`,t);if(typeof r!=`string`)throw new u(`Header '${n}' value '${r}' is not a string`);return r})}),{}),te=(e,t)=>Object.entries(e).reduce((e,[n,r])=>({...e,[n]:E.getEndpointProperty(r,t)}),{}),T=(e,t)=>{if(Array.isArray(e))return e.map(e=>T(e,t));switch(typeof e){case`string`:return v(e,t);case`object`:if(e===null)throw new u(`Unexpected endpoint property: ${e}`);return E.getEndpointProperties(e,t);case`boolean`:return e;default:throw new u(`Unexpected endpoint property type: ${typeof e}`)}},E={getEndpointProperty:T,getEndpointProperties:te},ne=(e,t)=>{let n=b(e,`Endpoint URL`,t);if(typeof n==`string`)try{return new URL(n)}catch(e){throw console.error(`Failed to construct URL with ${n}`,e),e}throw new u(`Endpoint URL must be a string, got ${typeof n}`)},re=(e,t)=>{let{conditions:n,endpoint:r}=e,{result:i,referenceRecord:a}=w(n,t);if(!i)return;let o={...t,referenceRecord:{...t.referenceRecord,...a}},{url:s,properties:u,headers:d}=r;return t.logger?.debug?.(`${c} Resolving endpoint from template: ${l(r)}`),{...d!=null&&{headers:ee(d,o)},...u!=null&&{properties:te(u,o)},url:ne(s,o)}},ie=(e,t)=>{let{conditions:n,error:r}=e,{result:i,referenceRecord:a}=w(n,t);if(i)throw new u(b(r,`Error`,{...t,referenceRecord:{...t.referenceRecord,...a}}))},ae=(e,t)=>{for(let n of e)if(n.type===`endpoint`){let e=re(n,t);if(e)return e}else if(n.type===`error`)ie(n,t);else if(n.type===`tree`){let e=oe.evaluateTreeRule(n,t);if(e)return e}else throw new u(`Unknown endpoint rule: ${n}`);throw new u(`Rules evaluation failed`)},oe={evaluateRules:ae,evaluateTreeRule:(e,t)=>{let{conditions:n,rules:r}=e,{result:i,referenceRecord:a}=w(n,t);if(i)return oe.evaluateRules(r,{...t,referenceRecord:{...t.referenceRecord,...a}})}};e.EndpointCache=n,e.EndpointError=u,e.customEndpointFunctions=s,e.isIpAddress=i,e.isValidHostLabel=o,e.resolveEndpoint=(e,t)=>{let{endpointParams:n,logger:r}=t,{parameters:i,rules:a}=e;t.logger?.debug?.(`${c} Initial EndpointParams: ${l(n)}`);let o=Object.entries(i).filter(([,e])=>e.default!=null).map(([e,t])=>[e,t.default]);if(o.length>0)for(let[e,t]of o)n[e]=n[e]??t;let s=Object.entries(i).filter(([,e])=>e.required).map(([e])=>e);for(let e of s)if(n[e]==null)throw new u(`Missing required parameter: '${e}'`);let d=ae(a,{endpointParams:n,logger:r,referenceRecord:{}});return t.logger?.debug?.(`${c} Resolved endpoint: ${l(d)}`),d}})),qg=u((e=>{var t=Kg(),n=ep();let r=(e,n=!1)=>{if(n){for(let t of e.split(`.`))if(!r(t))return!1;return!0}return!(!t.isValidHostLabel(e)||e.length<3||e.length>63||e!==e.toLowerCase()||t.isIpAddress(e))},i=e=>{let t=e.split(`:`);if(t.length<6)return null;let[n,r,i,a,o,...s]=t;return n!==`arn`||r===``||i===``||s.join(`:`)===``?null:{partition:r,service:i,region:a,accountId:o,resourceId:s.map(e=>e.split(`/`)).flat()}};var a={partitions:[{id:`aws`,outputs:{dnsSuffix:`amazonaws.com`,dualStackDnsSuffix:`api.aws`,implicitGlobalRegion:`us-east-1`,name:`aws`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$`,regions:{"af-south-1":{description:`Africa (Cape Town)`},"ap-east-1":{description:`Asia Pacific (Hong Kong)`},"ap-east-2":{description:`Asia Pacific (Taipei)`},"ap-northeast-1":{description:`Asia Pacific (Tokyo)`},"ap-northeast-2":{description:`Asia Pacific (Seoul)`},"ap-northeast-3":{description:`Asia Pacific (Osaka)`},"ap-south-1":{description:`Asia Pacific (Mumbai)`},"ap-south-2":{description:`Asia Pacific (Hyderabad)`},"ap-southeast-1":{description:`Asia Pacific (Singapore)`},"ap-southeast-2":{description:`Asia Pacific (Sydney)`},"ap-southeast-3":{description:`Asia Pacific (Jakarta)`},"ap-southeast-4":{description:`Asia Pacific (Melbourne)`},"ap-southeast-5":{description:`Asia Pacific (Malaysia)`},"ap-southeast-6":{description:`Asia Pacific (New Zealand)`},"ap-southeast-7":{description:`Asia Pacific (Thailand)`},"aws-global":{description:`aws global region`},"ca-central-1":{description:`Canada (Central)`},"ca-west-1":{description:`Canada West (Calgary)`},"eu-central-1":{description:`Europe (Frankfurt)`},"eu-central-2":{description:`Europe (Zurich)`},"eu-north-1":{description:`Europe (Stockholm)`},"eu-south-1":{description:`Europe (Milan)`},"eu-south-2":{description:`Europe (Spain)`},"eu-west-1":{description:`Europe (Ireland)`},"eu-west-2":{description:`Europe (London)`},"eu-west-3":{description:`Europe (Paris)`},"il-central-1":{description:`Israel (Tel Aviv)`},"me-central-1":{description:`Middle East (UAE)`},"me-south-1":{description:`Middle East (Bahrain)`},"mx-central-1":{description:`Mexico (Central)`},"sa-east-1":{description:`South America (Sao Paulo)`},"us-east-1":{description:`US East (N. Virginia)`},"us-east-2":{description:`US East (Ohio)`},"us-west-1":{description:`US West (N. California)`},"us-west-2":{description:`US West (Oregon)`}}},{id:`aws-cn`,outputs:{dnsSuffix:`amazonaws.com.cn`,dualStackDnsSuffix:`api.amazonwebservices.com.cn`,implicitGlobalRegion:`cn-northwest-1`,name:`aws-cn`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^cn\\-\\w+\\-\\d+$`,regions:{"aws-cn-global":{description:`aws-cn global region`},"cn-north-1":{description:`China (Beijing)`},"cn-northwest-1":{description:`China (Ningxia)`}}},{id:`aws-eusc`,outputs:{dnsSuffix:`amazonaws.eu`,dualStackDnsSuffix:`api.amazonwebservices.eu`,implicitGlobalRegion:`eusc-de-east-1`,name:`aws-eusc`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^eusc\\-(de)\\-\\w+\\-\\d+$`,regions:{"eusc-de-east-1":{description:`AWS European Sovereign Cloud (Germany)`}}},{id:`aws-iso`,outputs:{dnsSuffix:`c2s.ic.gov`,dualStackDnsSuffix:`api.aws.ic.gov`,implicitGlobalRegion:`us-iso-east-1`,name:`aws-iso`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-iso\\-\\w+\\-\\d+$`,regions:{"aws-iso-global":{description:`aws-iso global region`},"us-iso-east-1":{description:`US ISO East`},"us-iso-west-1":{description:`US ISO WEST`}}},{id:`aws-iso-b`,outputs:{dnsSuffix:`sc2s.sgov.gov`,dualStackDnsSuffix:`api.aws.scloud`,implicitGlobalRegion:`us-isob-east-1`,name:`aws-iso-b`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-isob\\-\\w+\\-\\d+$`,regions:{"aws-iso-b-global":{description:`aws-iso-b global region`},"us-isob-east-1":{description:`US ISOB East (Ohio)`},"us-isob-west-1":{description:`US ISOB West`}}},{id:`aws-iso-e`,outputs:{dnsSuffix:`cloud.adc-e.uk`,dualStackDnsSuffix:`api.cloud-aws.adc-e.uk`,implicitGlobalRegion:`eu-isoe-west-1`,name:`aws-iso-e`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^eu\\-isoe\\-\\w+\\-\\d+$`,regions:{"aws-iso-e-global":{description:`aws-iso-e global region`},"eu-isoe-west-1":{description:`EU ISOE West`}}},{id:`aws-iso-f`,outputs:{dnsSuffix:`csp.hci.ic.gov`,dualStackDnsSuffix:`api.aws.hci.ic.gov`,implicitGlobalRegion:`us-isof-south-1`,name:`aws-iso-f`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-isof\\-\\w+\\-\\d+$`,regions:{"aws-iso-f-global":{description:`aws-iso-f global region`},"us-isof-east-1":{description:`US ISOF EAST`},"us-isof-south-1":{description:`US ISOF SOUTH`}}},{id:`aws-us-gov`,outputs:{dnsSuffix:`amazonaws.com`,dualStackDnsSuffix:`api.aws`,implicitGlobalRegion:`us-gov-west-1`,name:`aws-us-gov`,supportsDualStack:!0,supportsFIPS:!0},regionRegex:`^us\\-gov\\-\\w+\\-\\d+$`,regions:{"aws-us-gov-global":{description:`aws-us-gov global region`},"us-gov-east-1":{description:`AWS GovCloud (US-East)`},"us-gov-west-1":{description:`AWS GovCloud (US-West)`}}}],version:`1.1`};let o=a,s=``,c=e=>{let{partitions:t}=o;for(let n of t){let{regions:t,outputs:r}=n;for(let[n,i]of Object.entries(t))if(n===e)return{...r,...i}}for(let n of t){let{regionRegex:t,outputs:r}=n;if(new RegExp(t).test(e))return{...r}}let n=t.find(e=>e.id===`aws`);if(!n)throw Error(`Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.`);return{...n.outputs}},l=(e,t=``)=>{o=e,s=t},u=()=>{l(a,``)},d=()=>s,f={isVirtualHostableS3Bucket:r,parseArn:i,partition:c};t.customEndpointFunctions.aws=f;let p=e=>{if(typeof e.endpointProvider!=`function`)throw Error(`@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.`);let{endpoint:t}=e;return t===void 0&&(e.endpoint=async()=>m(e.endpointProvider({Region:typeof e.region==`function`?await e.region():e.region,UseDualStack:typeof e.useDualstackEndpoint==`function`?await e.useDualstackEndpoint():e.useDualstackEndpoint,UseFIPS:typeof e.useFipsEndpoint==`function`?await e.useFipsEndpoint():e.useFipsEndpoint,Endpoint:void 0},{logger:e.logger}))),e},m=e=>n.parseUrl(e.url);e.EndpointError=t.EndpointError,e.isIpAddress=t.isIpAddress,e.resolveEndpoint=t.resolveEndpoint,e.awsEndpointFunctions=f,e.getUserAgentPrefix=d,e.partition=c,e.resolveDefaultAwsRegionalEndpointsConfig=p,e.setPartitionInfo=l,e.toEndpointV1=m,e.useDefaultPartitionInfo=u})),Jg,Yg,Xg=l((()=>{Jg={warningEmitted:!1},Yg=e=>{e&&!Jg.warningEmitted&&parseInt(e.substring(1,e.indexOf(`.`)))<20&&(Jg.warningEmitted=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
41
41
|
no longer support Node.js ${e} in January 2026.
|
|
42
42
|
|
|
43
43
|
To continue receiving updates to AWS services, bug fixes, and security
|
|
44
44
|
updates please upgrade to a supported Node.js LTS version.
|
|
45
45
|
|
|
46
|
-
More information can be found at: https://a.co/c895JFp`))}}));function Xg(e,t,n){return e.$source||={},e.$source[t]=n,e}var Zg=l((()=>{}));function Qg(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}var $g=l((()=>{}));function e_(e,t,n){return e.$source||={},e.$source[t]=n,e}var t_=l((()=>{})),n_=d({emitWarningIfUnsupportedVersion:()=>Jg,setCredentialFeature:()=>Xg,setFeature:()=>Qg,setTokenFeature:()=>e_,state:()=>qg}),r_=l((()=>{Yg(),Zg(),$g(),t_()})),i_=u((e=>{let t=[`AuthFailure`,`InvalidSignatureException`,`RequestExpired`,`RequestInTheFuture`,`RequestTimeTooSkewed`,`SignatureDoesNotMatch`],n=[`BandwidthLimitExceeded`,`EC2ThrottledException`,`LimitExceededException`,`PriorRequestNotComplete`,`ProvisionedThroughputExceededException`,`RequestLimitExceeded`,`RequestThrottled`,`RequestThrottledException`,`SlowDown`,`ThrottledException`,`Throttling`,`ThrottlingException`,`TooManyRequestsException`,`TransactionInProgressException`],r=[`TimeoutError`,`RequestTimeout`,`RequestTimeoutException`],i=[500,502,503,504],a=[`ECONNRESET`,`ECONNREFUSED`,`EPIPE`,`ETIMEDOUT`],o=[`EHOSTUNREACH`,`ENETUNREACH`,`ENOTFOUND`],s=e=>e?.$retryable!==void 0,c=e=>t.includes(e.name),l=e=>e.$metadata?.clockSkewCorrected,u=e=>{let 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):!1},d=e=>e.$metadata?.httpStatusCode===429||n.includes(e.name)||e.$retryable?.throttling==1,f=(e,t=0)=>s(e)||l(e)||r.includes(e.name)||a.includes(e?.code||``)||o.includes(e?.code||``)||i.includes(e.$metadata?.httpStatusCode||0)||u(e)||e.cause!==void 0&&t<=10&&f(e.cause,t+1);e.isBrowserNetworkError=u,e.isClockSkewCorrectedError=l,e.isClockSkewError=c,e.isRetryableByTrait=s,e.isServerError=e=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!f(e)}return!1},e.isThrottlingError=d,e.isTransientError=f})),a_=u((e=>{var t=i_();e.RETRY_MODES=void 0,(function(e){e.STANDARD=`standard`,e.ADAPTIVE=`adaptive`})(e.RETRY_MODES||={});let n=e.RETRY_MODES.STANDARD;var r=class e{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.availableTokens){let n=(t-this.availableTokens)/this.fillRate*1e3;await new Promise(t=>e.setTimeoutFn(t,n))}this.availableTokens-=t}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}updateClientSendingRate(e){let n;this.updateMeasuredRate();let r=e;if(r?.errorType===`THROTTLING`||t.isThrottlingError(r?.error??e)){let e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),n=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),n=this.cubicSuccess(this.getCurrentTimeInSeconds());let i=Math.min(n,2*this.measuredTxRate);this.updateTokenBucketRate(i)}calculateTimeWindow(){this.timeWindow=this.getPrecise((this.lastMaxRate*(1-this.beta)/this.scaleConstant)**(1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*(e-this.lastThrottleTime-this.timeWindow)**3+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){let e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}};let i=20*1e3,a=()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(i,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}},o=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(i,e),getRetryCost:()=>n});var s=class{maxAttempts;mode=e.RETRY_MODES.STANDARD;capacity=500;retryBackoffStrategy=a();maxAttemptsProvider;constructor(e){this.maxAttempts=e,this.maxAttemptsProvider=typeof e==`function`?e:async()=>e}async acquireInitialRetryToken(e){return o({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(e,t){let n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n)){let n=t.errorType;this.retryBackoffStrategy.setDelayBase(n===`THROTTLING`?500:100);let r=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),i=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,r):r,a=this.getCapacityCost(n);return this.capacity-=a,o({retryDelay:i,retryCount:e.getRetryCount()+1,retryCost:a})}throw Error(`No retry token available`)}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of 3`),3}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===`TRANSIENT`?10:5}isRetryableError(e){return e===`THROTTLING`||e===`TRANSIENT`}},c=class{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=e.RETRY_MODES.ADAPTIVE;constructor(e,t){this.maxAttemptsProvider=e;let{rateLimiter:n}=t??{};this.rateLimiter=n??new r,this.standardRetryStrategy=new s(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}},l=class extends s{computeNextBackoffDelay;constructor(e,t=100){super(typeof e==`function`?e:async()=>e),typeof t==`number`?this.computeNextBackoffDelay=()=>t:this.computeNextBackoffDelay=t}async refreshRetryTokenForRetry(e,t){let n=await super.refreshRetryTokenForRetry(e,t);return n.getRetryDelay=()=>this.computeNextBackoffDelay(n.getRetryCount()),n}};e.AdaptiveRetryStrategy=c,e.ConfiguredRetryStrategy=l,e.DEFAULT_MAX_ATTEMPTS=3,e.DEFAULT_RETRY_DELAY_BASE=100,e.DEFAULT_RETRY_MODE=n,e.DefaultRateLimiter=r,e.INITIAL_RETRY_TOKENS=500,e.INVOCATION_ID_HEADER=`amz-sdk-invocation-id`,e.MAXIMUM_RETRY_DELAY=i,e.NO_RETRY_INCREMENT=1,e.REQUEST_HEADER=`amz-sdk-request`,e.RETRY_COST=5,e.StandardRetryStrategy=s,e.THROTTLING_RETRY_DELAY_BASE=500,e.TIMEOUT_RETRY_COST=10})),o_=u((e=>{var t=(Wg(),m(Ug)),n=Kg(),r=_d(),i=(r_(),m(n_)),a=a_();function o(e){return e===void 0?!0:typeof e==`string`&&e.length<=50}function s(e){let n=t.normalizeProvider(e.userAgentAppId??void 0),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r==`string`?[[r]]:r,userAgentAppId:async()=>{let t=await n();if(!o(t)){let n=e.logger?.constructor?.name===`NoOpLogger`||!e.logger?console:e.logger;typeof t==`string`?t.length>50&&n?.warn(`The provided userAgentAppId exceeds the maximum length of 50 characters.`):n?.warn(`userAgentAppId must be a string or undefined.`)}return t}})}let c=/\d{12}\.ddb/;async function l(e,t,n){if(n.request?.headers?.[`smithy-protocol`]===`rpc-v2-cbor`&&i.setFeature(e,`PROTOCOL_RPC_V2_CBOR`,`M`),typeof t.retryStrategy==`function`){let n=await t.retryStrategy();if(typeof n.mode==`string`)switch(n.mode){case a.RETRY_MODES.ADAPTIVE:i.setFeature(e,`RETRY_MODE_ADAPTIVE`,`F`);break;case a.RETRY_MODES.STANDARD:i.setFeature(e,`RETRY_MODE_STANDARD`,`E`);break}}if(typeof t.accountIdEndpointMode==`function`){let n=e.endpointV2;switch(String(n?.url?.hostname).match(c)&&i.setFeature(e,`ACCOUNT_ID_ENDPOINT`,`O`),await t.accountIdEndpointMode?.()){case`disabled`:i.setFeature(e,`ACCOUNT_ID_MODE_DISABLED`,`Q`);break;case`preferred`:i.setFeature(e,`ACCOUNT_ID_MODE_PREFERRED`,`P`);break;case`required`:i.setFeature(e,`ACCOUNT_ID_MODE_REQUIRED`,`R`);break}}let r=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(r?.$source){let t=r;t.accountId&&i.setFeature(e,`RESOLVED_ACCOUNT_ID`,`T`);for(let[n,r]of Object.entries(t.$source??{}))i.setFeature(e,n,r)}}let u=`user-agent`,d=`x-amz-user-agent`,f=/[^!$%&'*+\-.^_`|~\w]/g,p=/[^!$%&'*+\-.^_`|~\w#]/g;function h(e){let t=``;for(let n in e){let r=e[n];if(t.length+r.length+1<=1024){t.length?t+=`,`+r:t+=r;continue}break}return t}let g=e=>(t,i)=>async a=>{let{request:o}=a;if(!r.HttpRequest.isInstance(o))return t(a);let{headers:s}=o,c=i?.userAgent?.map(_)||[],f=(await e.defaultUserAgentProvider()).map(_);await l(i,e,a);let p=i;f.push(`m/${h(Object.assign({},i.__smithy_context?.features,p.__aws_sdk_context?.features))}`);let m=e?.customUserAgent?.map(_)||[],g=await e.userAgentAppId();g&&f.push(_([`app`,`${g}`]));let v=n.getUserAgentPrefix(),y=(v?[v]:[]).concat([...f,...c,...m]).join(` `),b=[...f.filter(e=>e.startsWith(`aws-sdk-`)),...m].join(` `);return e.runtime===`browser`?s[d]=y:(b&&(s[d]=s[d]?`${s[u]} ${b}`:b),s[u]=y),t({...a,request:o})},_=e=>{let t=e[0].split(`/`).map(e=>e.replace(f,`-`)).join(`/`),n=e[1]?.replace(p,`-`),r=t.indexOf(`/`),i=t.substring(0,r),a=t.substring(r+1);return i===`api`&&(a=a.toLowerCase()),[i,a,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}`}},``)},v={name:`getUserAgentMiddleware`,step:`build`,priority:`low`,tags:[`SET_USER_AGENT`,`USER_AGENT`],override:!0};e.DEFAULT_UA_APP_ID=void 0,e.getUserAgentMiddlewareOptions=v,e.getUserAgentPlugin=e=>({applyToStack:t=>{t.add(g(e),v)}}),e.resolveUserAgentConfig=s,e.userAgentMiddleware=g})),s_=u((e=>{e.SelectorType=void 0,(function(e){e.ENV=`env`,e.CONFIG=`shared config entry`})(e.SelectorType||={}),e.booleanSelector=(e,t,n)=>{if(t in e){if(e[t]===`true`)return!0;if(e[t]===`false`)return!1;throw Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}},e.numberSelector=(e,t,n)=>{if(!(t in e))return;let r=parseInt(e[t],10);if(Number.isNaN(r))throw TypeError(`Cannot load ${n} '${t}'. Expected number, got '${e[t]}'.`);return r}})),c_=u((e=>{var t=s_(),n=Nd(),r=Gg();let i=`AWS_USE_DUALSTACK_ENDPOINT`,a=`use_dualstack_endpoint`,o={environmentVariableSelector:e=>t.booleanSelector(e,i,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,a,t.SelectorType.CONFIG),default:!1},s={environmentVariableSelector:e=>t.booleanSelector(e,i,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,a,t.SelectorType.CONFIG),default:void 0},c=`AWS_USE_FIPS_ENDPOINT`,l=`use_fips_endpoint`,u={environmentVariableSelector:e=>t.booleanSelector(e,c,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,l,t.SelectorType.CONFIG),default:!1},d={environmentVariableSelector:e=>t.booleanSelector(e,c,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,l,t.SelectorType.CONFIG),default:void 0},f=e=>{let{tls:t,endpoint:r,urlParser:i,useDualstackEndpoint:a}=e;return Object.assign(e,{tls:t??!0,endpoint:n.normalizeProvider(typeof r==`string`?i(r):r),isCustomEndpoint:!0,useDualstackEndpoint:n.normalizeProvider(a??!1)})},p=async e=>{let{tls:t=!0}=e,n=await e.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw Error(`Invalid region in client config`);let r=await e.useDualstackEndpoint(),i=await e.useFipsEndpoint(),{hostname:a}=await e.regionInfoProvider(n,{useDualstackEndpoint:r,useFipsEndpoint:i})??{};if(!a)throw Error(`Cannot resolve hostname from client config`);return e.urlParser(`${t?`https:`:`http:`}//${a}`)},m=e=>{let t=n.normalizeProvider(e.useDualstackEndpoint??!1),{endpoint:r,useFipsEndpoint:i,urlParser:a,tls:o}=e;return Object.assign(e,{tls:o??!0,endpoint:r?n.normalizeProvider(typeof r==`string`?a(r):r):()=>p({...e,useDualstackEndpoint:t,useFipsEndpoint:i}),isCustomEndpoint:!!r,useDualstackEndpoint:t})},h=`AWS_REGION`,g=`region`,_={environmentVariableSelector:e=>e[h],configFileSelector:e=>e[g],default:()=>{throw Error(`Region is missing`)}},v={preferredFile:`credentials`},y=new Set,b=(e,t=r.isValidHostLabel)=>{if(!y.has(e)&&!t(e))if(e===`*`)console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`);else throw Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else y.add(e)},x=e=>typeof e==`string`&&(e.startsWith(`fips-`)||e.endsWith(`-fips`)),S=e=>x(e)?[`fips-aws-global`,`aws-fips`].includes(e)?`us-east-1`:e.replace(/fips-(dkr-|prod-)?|-fips/,``):e,C=e=>{let{region:t,useFipsEndpoint:n}=e;if(!t)throw Error(`Region is missing`);return Object.assign(e,{region:async()=>{let e=S(typeof t==`function`?await t():t);return b(e),e},useFipsEndpoint:async()=>x(typeof t==`string`?t:await t())?!0:typeof n==`function`?n():Promise.resolve(!!n)})},w=(e=[],{useFipsEndpoint:t,useDualstackEndpoint:n})=>e.find(({tags:e})=>t===e.includes(`fips`)&&n===e.includes(`dualstack`))?.hostname,ee=(e,{regionHostname:t,partitionHostname:n})=>t||(n?n.replace(`{region}`,e):void 0),te=(e,{partitionHash:t})=>Object.keys(t||{}).find(n=>t[n].regions.includes(e))??`aws`,T=(e,{signingRegion:t,regionRegex:n,useFipsEndpoint:r})=>{if(t)return t;if(r){let t=n.replace(`\\\\`,`\\`).replace(/^\^/g,`\\.`).replace(/\$$/g,`\\.`),r=e.match(t);if(r)return r[0].slice(1,-1)}};e.CONFIG_USE_DUALSTACK_ENDPOINT=a,e.CONFIG_USE_FIPS_ENDPOINT=l,e.DEFAULT_USE_DUALSTACK_ENDPOINT=!1,e.DEFAULT_USE_FIPS_ENDPOINT=!1,e.ENV_USE_DUALSTACK_ENDPOINT=i,e.ENV_USE_FIPS_ENDPOINT=c,e.NODE_REGION_CONFIG_FILE_OPTIONS=v,e.NODE_REGION_CONFIG_OPTIONS=_,e.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=o,e.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=u,e.REGION_ENV_NAME=h,e.REGION_INI_NAME=g,e.getRegionInfo=(e,{useFipsEndpoint:t=!1,useDualstackEndpoint:n=!1,signingService:r,regionHash:i,partitionHash:a})=>{let o=te(e,{partitionHash:a}),s=e in i?e:a[o]?.endpoint??e,c={useFipsEndpoint:t,useDualstackEndpoint:n},l=ee(s,{regionHostname:w(i[s]?.variants,c),partitionHostname:w(a[o]?.variants,c)});if(l===void 0)throw Error(`Endpoint resolution failed for: [object Object]`);let u=T(l,{signingRegion:i[s]?.signingRegion,regionRegex:a[o].regionRegex,useFipsEndpoint:t});return{partition:o,signingService:r,hostname:l,...u&&{signingRegion:u},...i[s]?.signingService&&{signingService:i[s].signingService}}},e.nodeDualstackConfigSelectors=s,e.nodeFipsConfigSelectors=d,e.resolveCustomEndpointsConfig=f,e.resolveEndpointsConfig=m,e.resolveRegionConfig=C})),l_=u((e=>{e.resolveEventStreamSerdeConfig=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)})})),u_=u((e=>{var t=_d();let n=`content-length`;function r(e){return r=>async i=>{let a=i.request;if(t.HttpRequest.isInstance(a)){let{body:t,headers:r}=a;if(t&&Object.keys(r).map(e=>e.toLowerCase()).indexOf(n)===-1)try{let r=e(t);a.headers={...a.headers,[n]:String(r)}}catch{}}return r({...i,request:a})}}let i={step:`build`,tags:[`SET_CONTENT_LENGTH`,`CONTENT_LENGTH`],name:`contentLengthMiddleware`,override:!0};e.contentLengthMiddleware=r,e.contentLengthMiddlewareOptions=i,e.getContentLengthPlugin=e=>({applyToStack:t=>{t.add(r(e.bodyLengthChecker),i)}})})),d_=u((e=>{var t=class e extends Error{name=`ProviderError`;tryNextLink;constructor(t,n=!0){let r,i=!0;typeof n==`boolean`?(r=void 0,i=n):typeof n==`object`&&n&&(r=n.logger,i=n.tryNextLink??!0),super(t),this.tryNextLink=i,Object.setPrototypeOf(this,e.prototype),r?.debug?.(`@smithy/property-provider ${i?`->`:`(!)`} ${t}`)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}},n=class e extends t{name=`CredentialsProviderError`;constructor(t,n=!0){super(t,n),Object.setPrototypeOf(this,e.prototype)}},r=class e extends t{name=`TokenProviderError`;constructor(t,n=!0){super(t,n),Object.setPrototypeOf(this,e.prototype)}};e.CredentialsProviderError=n,e.ProviderError=t,e.TokenProviderError=r,e.chain=(...e)=>async()=>{if(e.length===0)throw new t(`No providers in chain`);let n;for(let t of e)try{return await t()}catch(e){if(n=e,e?.tryNextLink)continue;throw e}throw n},e.fromStatic=e=>()=>Promise.resolve(e),e.memoize=(e,t,n)=>{let r,i,a,o=!1,s=async()=>{i||=e();try{r=await i,a=!0,o=!1}finally{i=void 0}return r};return t===void 0?async e=>((!a||e?.forceRefresh)&&(r=await s()),r):async e=>((!a||e?.forceRefresh)&&(r=await s()),o?r:n&&!n(r)?(o=!0,r):(t(r)&&await s(),r))}})),f_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getHomeDir=void 0;let t=h(`os`),n=h(`path`),r={},i=()=>process&&process.geteuid?`${process.geteuid()}`:`DEFAULT`;e.getHomeDir=()=>{let{HOME:e,USERPROFILE:a,HOMEPATH:o,HOMEDRIVE:s=`C:${n.sep}`}=process.env;if(e)return e;if(a)return a;if(o)return`${s}${o}`;let c=i();return r[c]||(r[c]=(0,t.homedir)()),r[c]}})),p_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSSOTokenFilepath=void 0;let t=h(`crypto`),n=h(`path`),r=f_();e.getSSOTokenFilepath=e=>{let i=(0,t.createHash)(`sha1`).update(e).digest(`hex`);return(0,n.join)((0,r.getHomeDir)(),`.aws`,`sso`,`cache`,`${i}.json`)}})),m_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSSOTokenFromFile=e.tokenIntercept=void 0;let t=h(`fs/promises`),n=p_();e.tokenIntercept={},e.getSSOTokenFromFile=async r=>{if(e.tokenIntercept[r])return e.tokenIntercept[r];let i=(0,n.getSSOTokenFilepath)(r),a=await(0,t.readFile)(i,`utf8`);return JSON.parse(a)}})),h_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readFile=e.fileIntercept=e.filePromises=void 0;let t=h(`node:fs/promises`);e.filePromises={},e.fileIntercept={},e.readFile=(n,r)=>e.fileIntercept[n]===void 0?((!e.filePromises[n]||r?.ignoreCache)&&(e.filePromises[n]=(0,t.readFile)(n,`utf8`)),e.filePromises[n]):e.fileIntercept[n]})),g_=u((e=>{var t=f_(),n=p_(),r=m_(),i=h(`path`),a=gd(),o=h_();let s=`AWS_PROFILE`,c=`default`,l=e=>e.profile||process.env[s]||c,u=e=>Object.entries(e).filter(([e])=>{let t=e.indexOf(`.`);return t===-1?!1:Object.values(a.IniSectionType).includes(e.substring(0,t))}).reduce((e,[t,n])=>{let r=t.indexOf(`.`),i=t.substring(0,r)===a.IniSectionType.PROFILE?t.substring(r+1):t;return e[i]=n,e},{...e.default&&{default:e.default}}),d=()=>process.env.AWS_CONFIG_FILE||i.join(t.getHomeDir(),`.aws`,`config`),f=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||i.join(t.getHomeDir(),`.aws`,`credentials`),p=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,m=[`__proto__`,`profile __proto__`],g=e=>{let t={},n,r;for(let i of e.split(/\r?\n/)){let e=i.split(/(^|\s)[;#]/)[0].trim();if(e[0]===`[`&&e[e.length-1]===`]`){n=void 0,r=void 0;let t=e.substring(1,e.length-1),i=p.exec(t);if(i){let[,e,,t]=i;Object.values(a.IniSectionType).includes(e)&&(n=[e,t].join(`.`))}else n=t;if(m.includes(t))throw Error(`Found invalid profile name "${t}"`)}else if(n){let a=e.indexOf(`=`);if(![0,-1].includes(a)){let[o,s]=[e.substring(0,a).trim(),e.substring(a+1).trim()];if(s===``)r=o;else{r&&i.trimStart()===i&&(r=void 0),t[n]=t[n]||{};let e=r?[r,o].join(`.`):o;t[n][e]=s}}}}return t},_=()=>({}),v=async(e={})=>{let{filepath:n=f(),configFilepath:r=d()}=e,a=t.getHomeDir(),s=n;n.startsWith(`~/`)&&(s=i.join(a,n.slice(2)));let c=r;r.startsWith(`~/`)&&(c=i.join(a,r.slice(2)));let l=await Promise.all([o.readFile(c,{ignoreCache:e.ignoreCache}).then(g).then(u).catch(_),o.readFile(s,{ignoreCache:e.ignoreCache}).then(g).catch(_)]);return{configFile:l[0],credentialsFile:l[1]}},y=e=>Object.entries(e).filter(([e])=>e.startsWith(a.IniSectionType.SSO_SESSION+`.`)).reduce((e,[t,n])=>({...e,[t.substring(t.indexOf(`.`)+1)]:n}),{}),b=()=>({}),x=async(e={})=>o.readFile(e.configFilepath??d()).then(g).then(y).catch(b),S=(...e)=>{let t={};for(let n of e)for(let[e,r]of Object.entries(n))t[e]===void 0?t[e]=r:Object.assign(t[e],r);return t};e.getSSOTokenFromFile=r.getSSOTokenFromFile,e.readFile=o.readFile,e.CONFIG_PREFIX_SEPARATOR=`.`,e.DEFAULT_PROFILE=c,e.ENV_PROFILE=s,e.externalDataInterceptor={getFileRecord(){return o.fileIntercept},interceptFile(e,t){o.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return r.tokenIntercept},interceptToken(e,t){r.tokenIntercept[e]=t}},e.getProfileName=l,e.loadSharedConfigFiles=v,e.loadSsoSessionData=x,e.parseKnownFiles=async e=>{let t=await v(e);return S(t.configFile,t.credentialsFile)},Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),Object.prototype.hasOwnProperty.call(n,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:n.__proto__}),Object.keys(n).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=n[t])})})),__=u((e=>{var t=d_(),n=g_();function r(e){try{let t=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return t.delete(`CONFIG`),t.delete(`CONFIG_PREFIX_SEPARATOR`),t.delete(`ENV`),[...t].join(`, `)}catch{return e}}let i=(e,n)=>async()=>{try{let t=e(process.env,n);if(t===void 0)throw Error();return t}catch(i){throw new t.CredentialsProviderError(i.message||`Not found in ENV: ${r(e.toString())}`,{logger:n?.logger})}},a=(e,{preferredFile:i=`config`,...a}={})=>async()=>{let o=n.getProfileName(a),{configFile:s,credentialsFile:c}=await n.loadSharedConfigFiles(a),l=c[o]||{},u=s[o]||{},d=i===`config`?{...l,...u}:{...u,...l};try{let t=e(d,i===`config`?s:c);if(t===void 0)throw Error();return t}catch(n){throw new t.CredentialsProviderError(n.message||`Not found in config files w/ profile [${o}]: ${r(e.toString())}`,{logger:a.logger})}},o=e=>typeof e==`function`,s=e=>o(e)?async()=>await e():t.fromStatic(e);e.loadConfig=({environmentVariableSelector:e,configFileSelector:n,default:r},o={})=>{let{signingName:c,logger:l}=o,u={signingName:c,logger:l};return t.memoize(t.chain(i(e,u),a(n,o),s(r)))}})),v_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getEndpointUrlConfig=void 0;let t=g_(),n=`AWS_ENDPOINT_URL`,r=`endpoint_url`;e.getEndpointUrlConfig=e=>({environmentVariableSelector:t=>{let r=t[[n,...e.split(` `).map(e=>e.toUpperCase())].join(`_`)];if(r)return r;let i=t[n];if(i)return i},configFileSelector:(n,i)=>{if(i&&n.services){let a=i[[`services`,n.services].join(t.CONFIG_PREFIX_SEPARATOR)];if(a){let n=a[[e.split(` `).map(e=>e.toLowerCase()).join(`_`),r].join(t.CONFIG_PREFIX_SEPARATOR)];if(n)return n}}let a=n[r];if(a)return a},default:void 0})})),y_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getEndpointFromConfig=void 0;let t=__(),n=v_();e.getEndpointFromConfig=async e=>(0,t.loadConfig)((0,n.getEndpointUrlConfig)(e??``))()})),b_=u((e=>{var t=_d(),n=(ip(),m(rp));let r=(e,n)=>(r,a)=>async o=>{let{response:s}=await r(o);try{return{response:s,output:await n(s,e)}}catch(e){if(Object.defineProperty(e,`$response`,{value:s,enumerable:!1,writable:!1,configurable:!1}),!(`$metadata`in e)){let n=`Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;try{e.message+=`
|
|
47
|
-
`+n}catch{!a.logger||a.logger?.constructor?.name===`NoOpLogger`?console.warn(n):a.logger?.warn?.(n)}e.$responseBodyText!==void 0&&e.$response&&(e.$response.body=e.$responseBodyText);try{if(t.HttpResponse.isInstance(s)){let{headers:t={}}=s,n=Object.entries(t);e.$metadata={httpStatusCode:s.statusCode,requestId:i(/^x-[\w-]+-request-?id$/,n),extendedRequestId:i(/^x-[\w-]+-id-2$/,n),cfId:i(/^x-[\w-]+-cf-id$/,n)}}}catch{}}throw e}},i=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1],a=(e,t)=>(r,i)=>async a=>{let o=e,s=i.endpointV2?async()=>n.toEndpointV1(i.endpointV2):o.endpoint;if(!s)throw Error(`No valid endpoint provider available.`);let c=await t(a.input,{...e,endpoint:s});return r({...a,request:c})},o={name:`deserializerMiddleware`,step:`deserialize`,tags:[`DESERIALIZER`],override:!0},s={name:`serializerMiddleware`,step:`serialize`,tags:[`SERIALIZER`],override:!0};function c(e,t,n){return{applyToStack:i=>{i.add(r(e,n),o),i.add(a(e,t),s)}}}e.deserializerMiddleware=r,e.deserializerMiddlewareOption=o,e.getSerdePlugin=c,e.serializerMiddleware=a,e.serializerMiddlewareOption=s})),x_=u((e=>{var t=y_(),n=$f(),r=(Wg(),m(Ug)),i=Nd(),a=b_();let o=async e=>{let t=e?.Bucket||``;if(typeof e.Bucket==`string`&&(e.Bucket=t.replace(/#/g,`%23`).replace(/\?/g,`%3F`)),d(t)){if(e.ForcePathStyle===!0)throw Error(`Path-style addressing cannot be used with ARN buckets`)}else (!u(t)||t.indexOf(`.`)!==-1&&!String(e.Endpoint).startsWith(`http:`)||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},s=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,c=/(\d+\.){3}\d+/,l=/\.\./,u=e=>s.test(e)&&!c.test(e)&&!l.test(e),d=e=>{let[t,n,r,,,i]=e.split(`:`),a=t===`arn`&&e.split(`:`).length>=6,o=!!(a&&n&&r&&i);if(a&&!o)throw Error(`Invalid ARN: ${e} was an invalid ARN.`);return o},f=(e,t,n,r=!1)=>{let i=async()=>{let i;return i=r?n.clientContextParams?.[e]??n[e]??n[t]:n[e]??n[t],typeof i==`function`?i():i};return e===`credentialScope`||t===`CredentialScope`?async()=>{let e=typeof n.credentials==`function`?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:e===`accountId`||t===`AccountId`?async()=>{let e=typeof n.credentials==`function`?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:e===`endpoint`||t===`endpoint`?async()=>{if(n.isCustomEndpoint===!1)return;let e=await i();if(e&&typeof e==`object`){if(`url`in e)return e.url.href;if(`hostname`in e){let{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?`:`+r:``}${i}`}}return e}:i},p=e=>{if(typeof e==`object`){if(`url`in e){let t=n.parseUrl(e.url);if(e.headers){t.headers={};for(let[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(`, `)}return t}return e}return n.parseUrl(e)},h=async(e,n,r,i)=>{if(!r.isCustomEndpoint){let e;e=r.serviceConfiguredEndpoint?await r.serviceConfiguredEndpoint():await t.getEndpointFromConfig(r.serviceId),e&&(r.endpoint=()=>Promise.resolve(p(e)),r.isCustomEndpoint=!0)}let a=await g(e,n,r);if(typeof r.endpointProvider!=`function`)throw Error(`config.endpointProvider is not set.`);let o=r.endpointProvider(a,i);if(r.isCustomEndpoint&&r.endpoint){let e=await r.endpoint();if(e?.headers){o.headers??={};for(let[t,n]of Object.entries(e.headers))o.headers[t]=Array.isArray(n)?n:[n]}}return o},g=async(e,t,n)=>{let r={},i=t?.getEndpointParameterInstructions?.()||{};for(let[t,a]of Object.entries(i))switch(a.type){case`staticContextParams`:r[t]=a.value;break;case`contextParams`:r[t]=e[a.name];break;case`clientContextParams`:case`builtInParams`:r[t]=await f(a.name,t,n,a.type!==`builtInParams`)();break;case`operationContextParams`:r[t]=a.get(e);break;default:throw Error(`Unrecognized endpoint parameter instruction: `+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()===`s3`&&await o(r),r},_=({config:e,instructions:t})=>(n,a)=>async o=>{e.isCustomEndpoint&&r.setFeature(a,`ENDPOINT_OVERRIDE`,`N`);let s=await h(o.input,{getEndpointParameterInstructions(){return t}},{...e},a);a.endpointV2=s,a.authSchemes=s.properties?.authSchemes;let c=a.authSchemes?.[0];if(c){a.signing_region=c.signingRegion,a.signing_service=c.signingName;let e=i.getSmithyContext(a)?.selectedHttpAuthScheme?.httpAuthOption;e&&(e.signingProperties=Object.assign(e.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties))}return n({...o})},v={step:`serialize`,tags:[`ENDPOINT_PARAMETERS`,`ENDPOINT_V2`,`ENDPOINT`],name:`endpointV2Middleware`,override:!0,relation:`before`,toMiddleware:a.serializerMiddlewareOption.name};e.endpointMiddleware=_,e.endpointMiddlewareOptions=v,e.getEndpointFromInstructions=h,e.getEndpointPlugin=(e,t)=>({applyToStack:n=>{n.addRelativeTo(_({config:e,instructions:t}),v)}}),e.resolveEndpointConfig=e=>{let n=e.tls??!0,{endpoint:r,useDualstackEndpoint:a,useFipsEndpoint:o}=e,s=r==null?void 0:async()=>p(await i.normalizeProvider(r)()),c=!!r,l=Object.assign(e,{endpoint:s,tls:n,isCustomEndpoint:c,useDualstackEndpoint:i.normalizeProvider(a??!1),useFipsEndpoint:i.normalizeProvider(o??!1)}),u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=t.getEndpointFromConfig(e.serviceId)),u),l},e.resolveEndpointRequiredConfig=e=>{let{endpoint:t}=e;return t===void 0&&(e.endpoint=async()=>{throw Error(`@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.`)}),e},e.resolveParams=g,e.toEndpointV1=p})),S_=u((e=>{let t=(e,t)=>{let n=[];if(e&&n.push(e),t)for(let e of t)n.push(e);return n},n=(e,t)=>`${e||`anonymous`}${t&&t.length>0?` (a.k.a. ${t.join(`,`)})`:``}`,r=()=>{let e=[],o=[],s=!1,c=new Set,l=e=>e.sort((e,t)=>i[t.step]-i[e.step]||a[t.priority||`normal`]-a[e.priority||`normal`]),u=n=>{let r=!1,i=e=>{let i=t(e.name,e.aliases);if(i.includes(n)){r=!0;for(let e of i)c.delete(e);return!1}return!0};return e=e.filter(i),o=o.filter(i),r},d=n=>{let r=!1,i=e=>{if(e.middleware===n){r=!0;for(let n of t(e.name,e.aliases))c.delete(n);return!1}return!0};return e=e.filter(i),o=o.filter(i),r},f=t=>(e.forEach(e=>{t.add(e.middleware,{...e})}),o.forEach(e=>{t.addRelativeTo(e.middleware,{...e})}),t.identifyOnResolve?.(h.identifyOnResolve()),t),p=e=>{let t=[];return e.before.forEach(e=>{e.before.length===0&&e.after.length===0?t.push(e):t.push(...p(e))}),t.push(e),e.after.reverse().forEach(e=>{e.before.length===0&&e.after.length===0?t.push(e):t.push(...p(e))}),t},m=(r=!1)=>{let i=[],a=[],s={};return e.forEach(e=>{let n={...e,before:[],after:[]};for(let e of t(n.name,n.aliases))s[e]=n;i.push(n)}),o.forEach(e=>{let n={...e,before:[],after:[]};for(let e of t(n.name,n.aliases))s[e]=n;a.push(n)}),a.forEach(e=>{if(e.toMiddleware){let t=s[e.toMiddleware];if(t===void 0){if(r)return;throw Error(`${e.toMiddleware} is not found when adding ${n(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}e.relation===`after`&&t.after.push(e),e.relation===`before`&&t.before.push(e)}}),l(i).map(p).reduce((e,t)=>(e.push(...t),e),[])},h={add:(r,i={})=>{let{name:a,override:o,aliases:s}=i,l={step:`initialize`,priority:`normal`,middleware:r,...i},u=t(a,s);if(u.length>0){if(u.some(e=>c.has(e))){if(!o)throw Error(`Duplicate middleware name '${n(a,s)}'`);for(let t of u){let r=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(r===-1)continue;let i=e[r];if(i.step!==l.step||l.priority!==i.priority)throw Error(`"${n(i.name,i.aliases)}" middleware with ${i.priority} priority in ${i.step} step cannot be overridden by "${n(a,s)}" middleware with ${l.priority} priority in ${l.step} step.`);e.splice(r,1)}}for(let e of u)c.add(e)}e.push(l)},addRelativeTo:(e,r)=>{let{name:i,override:a,aliases:s}=r,l={middleware:e,...r},u=t(i,s);if(u.length>0){if(u.some(e=>c.has(e))){if(!a)throw Error(`Duplicate middleware name '${n(i,s)}'`);for(let e of u){let t=o.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(t===-1)continue;let r=o[t];if(r.toMiddleware!==l.toMiddleware||r.relation!==l.relation)throw Error(`"${n(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${n(i,s)}" middleware ${l.relation} "${l.toMiddleware}" middleware.`);o.splice(t,1)}}for(let e of u)c.add(e)}o.push(l)},clone:()=>f(r()),use:e=>{e.applyToStack(h)},remove:e=>typeof e==`string`?u(e):d(e),removeByTag:n=>{let r=!1,i=e=>{let{tags:i,name:a,aliases:o}=e;if(i&&i.includes(n)){let e=t(a,o);for(let t of e)c.delete(t);return r=!0,!1}return!0};return e=e.filter(i),o=o.filter(i),r},concat:e=>{let t=f(r());return t.use(e),t.identifyOnResolve(s||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:f,identify:()=>m(!0).map(e=>{let t=e.step??e.relation+` `+e.toMiddleware;return n(e.name,e.aliases)+` - `+t}),identifyOnResolve(e){return typeof e==`boolean`&&(s=e),s},resolve:(e,t)=>{for(let n of m().map(e=>e.middleware).reverse())e=n(e,t);return s&&console.log(h.identify()),e}};return h},i={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},a={high:3,normal:2,low:1};e.constructStack=r})),C_=u((e=>{var t=S_(),n=(bg(),m(yg)),r=gd(),i=(Yp(),m(Jp)),a=(Fh(),m(Ph)),o=class{config;middlewareStack=t.constructStack();initConfig;handlers;constructor(e){this.config=e;let{protocol:t,protocolSettings:n}=e;n&&typeof t==`function`&&(e.protocol=new t(n))}send(e,t,n){let r=typeof t==`function`?void 0:t,i=typeof t==`function`?t:n,a=r===void 0&&this.config.cacheMiddleware===!0,o;if(a){this.handlers||=new WeakMap;let t=this.handlers;t.has(e.constructor)?o=t.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(i)o(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{});else return o(e).then(e=>e.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}};let s=`***SensitiveInformation***`;function c(e,t){if(t==null)return t;let n=i.NormalizedSchema.of(e);if(n.getMergedTraits().sensitive)return s;if(n.isListSchema()){if(n.getValueSchema().getMergedTraits().sensitive)return s}else if(n.isMapSchema()){if(n.getKeySchema().getMergedTraits().sensitive||n.getValueSchema().getMergedTraits().sensitive)return s}else if(n.isStructSchema()&&typeof t==`object`){let e=t,r={};for(let[t,i]of n.structIterator())e[t]!=null&&(r[t]=c(i,e[t]));return r}return t}var l=class{middlewareStack=t.constructStack();schema;static classBuilder(){return new u}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:c,smithyContext:l,additionalContext:u,CommandCtor:d}){for(let r of i.bind(this)(d,e,t,n))this.middlewareStack.use(r);let f=e.concat(this.middlewareStack),{logger:p}=t,m={logger:p,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:c,[r.SMITHY_CONTEXT_KEY]:{commandInstance:this,...l},...u},{requestHandler:h}=t;return f.resolve(e=>h.handle(e.request,n||{}),m)}},u=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName=``;_clientName=``;_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends l{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){let a=e._operationSchema,o=a?.[4]??a?.input,s=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(a?c.bind(null,o):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(a?c.bind(null,s):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}};let d=(e,t,n)=>{for(let[n,r]of Object.entries(e)){let e=async function(e,t,n){let i=new r(e);if(typeof t==`function`)this.send(i,t);else if(typeof n==`function`){if(typeof t!=`object`)throw Error(`Expected http options but got ${typeof t}`);this.send(i,t||{},n)}else return this.send(i,t)},i=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,``);t.prototype[i]=e}let{paginators:r={},waiters:i={}}=n??{};for(let[e,n]of Object.entries(r))t.prototype[e]===void 0&&(t.prototype[e]=function(e={},t,...r){return n({...t,client:this},e,...r)});for(let[e,n]of Object.entries(i))t.prototype[e]===void 0&&(t.prototype[e]=async function(e={},t,...r){let i=t;return typeof t==`number`&&(i={maxWaitTime:t}),n({...i,client:this},e,...r)})};var f=class e extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(t){if(!t)return!1;let n=t;return e.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault===`client`||n.$fault===`server`)}static[Symbol.hasInstance](t){if(!t)return!1;let n=t;return this===e?e.isInstance(t):e.isInstance(t)?n.name&&this.name?this.prototype.isPrototypeOf(t)||n.name===this.name:this.prototype.isPrototypeOf(t):!1}};let p=(e,t={})=>(Object.entries(t).filter(([,e])=>e!==void 0).forEach(([t,n])=>{(e[t]==null||e[t]===``)&&(e[t]=n)}),e.message=e.message||e.Message||`UnknownError`,delete e.Message,e),h=({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{let i=_(e),a=i.httpStatusCode?i.httpStatusCode+``:void 0;throw p(new n({name:t?.code||t?.Code||r||a||`UnknownError`,$fault:`client`,$metadata:i}),t)},g=e=>({output:t,parsedBody:n,errorCode:r})=>{h({output:t,parsedBody:n,exceptionCtor:e,errorCode:r})},_=e=>({httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}),v=e=>{switch(e){case`standard`:return{retryMode:`standard`,connectionTimeout:3100};case`in-region`:return{retryMode:`standard`,connectionTimeout:1100};case`cross-region`:return{retryMode:`standard`,connectionTimeout:3100};case`mobile`:return{retryMode:`standard`,connectionTimeout:3e4};default:return{}}},y=!1,b=e=>{e&&!y&&parseInt(e.substring(1,e.indexOf(`.`)))<16&&(y=!0)},x=Object.values(r.AlgorithmId),S=e=>{let t=[];for(let n in r.AlgorithmId){let i=r.AlgorithmId[n];e[i]!==void 0&&t.push({algorithmId:()=>i,checksumConstructor:()=>e[i]})}for(let[n,r]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){e.checksumAlgorithms=e.checksumAlgorithms??{};let r=n.algorithmId(),i=n.checksumConstructor();x.includes(r)?e.checksumAlgorithms[r.toUpperCase()]=i:e.checksumAlgorithms[r]=i,t.push(n)},checksumAlgorithms(){return t}}},C=e=>{let t={};return e.checksumAlgorithms().forEach(e=>{let n=e.algorithmId();x.includes(n)&&(t[n]=e.checksumConstructor())}),t},w=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),ee=e=>{let t={};return t.retryStrategy=e.retryStrategy(),t},te=e=>Object.assign(S(e),w(e)),T=te,E=e=>Object.assign(C(e),ee(e)),ne=e=>Array.isArray(e)?e:[e],re=e=>{let t=`#text`;for(let n in e)e.hasOwnProperty(n)&&e[n][t]!==void 0?e[n]=e[n][t]:typeof e[n]==`object`&&e[n]!==null&&(e[n]=re(e[n]));return e},ie=e=>e!=null;var ae=class{trace(){}debug(){}info(){}warn(){}error(){}};function oe(e,t,n){let r,i,a;if(t===void 0&&n===void 0)r={},a=e;else{if(r=e,typeof t==`function`)return i=t,a=n,le(r,i,a);a=t}for(let e of Object.keys(a)){if(!Array.isArray(a[e])){r[e]=a[e];continue}ue(r,null,a,e)}return r}let se=e=>{let t={};for(let[n,r]of Object.entries(e||{}))t[n]=[,r];return t},ce=(e,t)=>{let n={};for(let r in t)ue(n,e,t,r);return n},le=(e,t,n)=>oe(e,Object.entries(n).reduce((e,[n,r])=>(Array.isArray(r)?e[n]=r:typeof r==`function`?e[n]=[t,r()]:e[n]=[t,r],e),{})),ue=(e,t,n,r)=>{if(t!==null){let i=n[r];typeof i==`function`&&(i=[,i]);let[a=de,o=fe,s=r]=i;(typeof a==`function`&&a(t[s])||typeof a!=`function`&&a)&&(e[r]=o(t[s]));return}let[i,a]=n[r];if(typeof a==`function`){let t,n=i===void 0&&(t=a())!=null,o=typeof i==`function`&&!!i(void 0)||typeof i!=`function`&&!!i;n?e[r]=t:o&&(e[r]=a())}else{let t=i===void 0&&a!=null,n=typeof i==`function`&&!!i(a)||typeof i!=`function`&&!!i;(t||n)&&(e[r]=a)}},de=e=>e!=null,fe=e=>e,pe=e=>{if(e!==e)return`NaN`;switch(e){case 1/0:return`Infinity`;case-1/0:return`-Infinity`;default:return e}},me=e=>e.toISOString().replace(`.000Z`,`Z`),he=e=>{if(e==null)return{};if(Array.isArray(e))return e.filter(e=>e!=null).map(he);if(typeof e==`object`){let t={};for(let n of Object.keys(e))e[n]!=null&&(t[n]=he(e[n]));return t}return e};e.collectBody=n.collectBody,e.extendedEncodeURIComponent=n.extendedEncodeURIComponent,e.resolvedPath=n.resolvedPath,e.Client=o,e.Command=l,e.NoOpLogger=ae,e.SENSITIVE_STRING=`***SensitiveInformation***`,e.ServiceException=f,e._json=he,e.convertMap=se,e.createAggregatedClient=d,e.decorateServiceException=p,e.emitWarningIfUnsupportedVersion=b,e.getArrayIfSingleItem=ne,e.getDefaultClientConfiguration=T,e.getDefaultExtensionConfiguration=te,e.getValueFromTextNode=re,e.isSerializableHeaderValue=ie,e.loadConfigsForDefaultMode=v,e.map=oe,e.resolveDefaultRuntimeConfig=E,e.serializeDateTime=me,e.serializeFloat=pe,e.take=ce,e.throwDefaultError=h,e.withBaseException=g,Object.prototype.hasOwnProperty.call(a,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:a.__proto__}),Object.keys(a).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=a[t])})})),w_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isStreamingPayload=void 0;let t=h(`stream`);e.isStreamingPayload=e=>e?.body instanceof t.Readable||typeof ReadableStream<`u`&&e?.body instanceof ReadableStream})),T_=u((e=>{var t=a_(),n=_d(),r=i_(),i=ih(),a=Nd(),o=C_(),s=w_();let c=(e,n)=>{let r=e,i=t.NO_RETRY_INCREMENT,a=t.RETRY_COST,o=t.TIMEOUT_RETRY_COST,s=e,c=e=>e.name===`TimeoutError`?o:a,l=e=>c(e)<=s;return Object.freeze({hasRetryTokens:l,retrieveRetryTokens:e=>{if(!l(e))throw Error(`No retry token available`);let t=c(e);return s-=t,t},releaseRetryTokens:e=>{s+=e??i,s=Math.min(s,r)}})},l=(e,n)=>Math.floor(Math.min(t.MAXIMUM_RETRY_DELAY,Math.random()*2**n*e)),u=e=>e?r.isRetryableByTrait(e)||r.isClockSkewError(e)||r.isThrottlingError(e)||r.isTransientError(e):!1,d=e=>e instanceof Error?e:e instanceof Object?Object.assign(Error(),e):typeof e==`string`?Error(e):Error(`AWS SDK error wrapper for ${e}`);var f=class{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=t.RETRY_MODES.STANDARD;constructor(e,n){this.maxAttemptsProvider=e,this.retryDecider=n?.retryDecider??u,this.delayDecider=n?.delayDecider??l,this.retryQuota=n?.retryQuota??c(t.INITIAL_RETRY_TOKENS)}shouldRetry(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)}async getMaxAttempts(){let e;try{e=await this.maxAttemptsProvider()}catch{e=t.DEFAULT_MAX_ATTEMPTS}return e}async retry(e,a,o){let s,c=0,l=0,u=await this.getMaxAttempts(),{request:f}=a;for(n.HttpRequest.isInstance(f)&&(f.headers[t.INVOCATION_ID_HEADER]=i.v4());;)try{n.HttpRequest.isInstance(f)&&(f.headers[t.REQUEST_HEADER]=`attempt=${c+1}; max=${u}`),o?.beforeRequest&&await o.beforeRequest();let{response:r,output:i}=await e(a);return o?.afterRequest&&o.afterRequest(r),this.retryQuota.releaseRetryTokens(s),i.$metadata.attempts=c+1,i.$metadata.totalRetryDelay=l,{response:r,output:i}}catch(e){let n=d(e);if(c++,this.shouldRetry(n,c,u)){s=this.retryQuota.retrieveRetryTokens(n);let e=this.delayDecider(r.isThrottlingError(n)?t.THROTTLING_RETRY_DELAY_BASE:t.DEFAULT_RETRY_DELAY_BASE,c),i=p(n.$response),a=Math.max(i||0,e);l+=a,await new Promise(e=>setTimeout(e,a));continue}throw n.$metadata||={},n.$metadata.attempts=c,n.$metadata.totalRetryDelay=l,n}}};let p=e=>{if(!n.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find(e=>e.toLowerCase()===`retry-after`);if(!t)return;let r=e.headers[t],i=Number(r);return Number.isNaN(i)?new Date(r).getTime()-Date.now():i*1e3};var m=class extends f{rateLimiter;constructor(e,n){let{rateLimiter:r,...i}=n??{};super(e,i),this.rateLimiter=r??new t.DefaultRateLimiter,this.mode=t.RETRY_MODES.ADAPTIVE}async retry(e,t){return super.retry(e,t,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:e=>{this.rateLimiter.updateClientSendingRate(e)}})}};let h=`AWS_MAX_ATTEMPTS`,g=`max_attempts`,_={environmentVariableSelector:e=>{let t=e[h];if(!t)return;let n=parseInt(t);if(Number.isNaN(n))throw Error(`Environment variable ${h} mast be a number, got "${t}"`);return n},configFileSelector:e=>{let t=e[g];if(!t)return;let n=parseInt(t);if(Number.isNaN(n))throw Error(`Shared config file entry ${g} mast be a number, got "${t}"`);return n},default:t.DEFAULT_MAX_ATTEMPTS},v=e=>{let{retryStrategy:n,retryMode:r}=e,i=a.normalizeProvider(e.maxAttempts??t.DEFAULT_MAX_ATTEMPTS),o=n?Promise.resolve(n):void 0,s=async()=>await a.normalizeProvider(r)()===t.RETRY_MODES.ADAPTIVE?new t.AdaptiveRetryStrategy(i):new t.StandardRetryStrategy(i);return Object.assign(e,{maxAttempts:i,retryStrategy:()=>o??=s()})},y=`AWS_RETRY_MODE`,b=`retry_mode`,x={environmentVariableSelector:e=>e[y],configFileSelector:e=>e[b],default:t.DEFAULT_RETRY_MODE},S=()=>e=>async r=>{let{request:i}=r;return n.HttpRequest.isInstance(i)&&(delete i.headers[t.INVOCATION_ID_HEADER],delete i.headers[t.REQUEST_HEADER]),e(r)},C={name:`omitRetryHeadersMiddleware`,tags:[`RETRY`,`HEADERS`,`OMIT_RETRY_HEADERS`],relation:`before`,toMiddleware:`awsAuthMiddleware`,override:!0},w=e=>({applyToStack:e=>{e.addRelativeTo(S(),C)}}),ee=e=>(r,a)=>async c=>{let l=await e.retryStrategy(),u=await e.maxAttempts();if(te(l)){l=l;let e=await l.acquireInitialRetryToken(a.partition_id),f=Error(),p=0,m=0,{request:h}=c,g=n.HttpRequest.isInstance(h);for(g&&(h.headers[t.INVOCATION_ID_HEADER]=i.v4());;)try{g&&(h.headers[t.REQUEST_HEADER]=`attempt=${p+1}; max=${u}`);let{response:n,output:i}=await r(c);return l.recordSuccess(e),i.$metadata.attempts=p+1,i.$metadata.totalRetryDelay=m,{response:n,output:i}}catch(t){let n=T(t);if(f=d(t),g&&s.isStreamingPayload(h))throw(a.logger instanceof o.NoOpLogger?console:a.logger)?.warn(`An error was encountered in a non-retryable streaming request.`),f;try{e=await l.refreshRetryTokenForRetry(e,n)}catch{throw f.$metadata||={},f.$metadata.attempts=p+1,f.$metadata.totalRetryDelay=m,f}p=e.getRetryCount();let r=e.getRetryDelay();m+=r,await new Promise(e=>setTimeout(e,r))}}else return l=l,l?.mode&&(a.userAgent=[...a.userAgent||[],[`cfg/retry-mode`,l.mode]]),l.retry(r,c)},te=e=>e.acquireInitialRetryToken!==void 0&&e.refreshRetryTokenForRetry!==void 0&&e.recordSuccess!==void 0,T=e=>{let t={error:e,errorType:E(e)},n=ie(e.$response);return n&&(t.retryAfterHint=n),t},E=e=>r.isThrottlingError(e)?`THROTTLING`:r.isTransientError(e)?`TRANSIENT`:r.isServerError(e)?`SERVER_ERROR`:`CLIENT_ERROR`,ne={name:`retryMiddleware`,tags:[`RETRY`],step:`finalizeRequest`,priority:`high`,override:!0},re=e=>({applyToStack:t=>{t.add(ee(e),ne)}}),ie=e=>{if(!n.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find(e=>e.toLowerCase()===`retry-after`);if(!t)return;let r=e.headers[t],i=Number(r);return Number.isNaN(i)?new Date(r):new Date(i*1e3)};e.AdaptiveRetryStrategy=m,e.CONFIG_MAX_ATTEMPTS=g,e.CONFIG_RETRY_MODE=b,e.ENV_MAX_ATTEMPTS=h,e.ENV_RETRY_MODE=y,e.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=_,e.NODE_RETRY_MODE_CONFIG_OPTIONS=x,e.StandardRetryStrategy=f,e.defaultDelayDecider=l,e.defaultRetryDecider=u,e.getOmitRetryHeadersPlugin=w,e.getRetryAfterHint=ie,e.getRetryPlugin=re,e.omitRetryHeadersMiddleware=S,e.omitRetryHeadersMiddlewareOptions=C,e.resolveRetryConfig=v,e.retryMiddleware=ee,e.retryMiddlewareOptions=ne})),E_,D_,O_=l((()=>{E_=_d(),D_=e=>E_.HttpResponse.isInstance(e)?e.headers?.date??e.headers?.Date:void 0})),k_,A_=l((()=>{k_=e=>new Date(Date.now()+e)})),j_,M_=l((()=>{A_(),j_=(e,t)=>Math.abs(k_(t).getTime()-e)>=3e5})),N_,P_=l((()=>{M_(),N_=(e,t)=>{let n=Date.parse(e);return j_(n,t)?n-Date.now():t}})),F_=l((()=>{O_(),A_(),P_()})),I_,L_,R_,z_,B_,V_=l((()=>{I_=_d(),F_(),L_=(e,t)=>{if(!t)throw Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},R_=async e=>{let t=L_(`context`,e.context),n=L_(`config`,e.config),r=t.endpointV2?.properties?.authSchemes?.[0];return{config:n,signer:await L_(`signer`,n.signer)(r),signingRegion:e?.signingRegion,signingRegionSet:e?.signingRegionSet,signingName:e?.signingName}},z_=class{async sign(e,t,n){if(!I_.HttpRequest.isInstance(e))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let r=await R_(n),{config:i,signer:a}=r,{signingRegion:o,signingName:s}=r,c=n.context;if(c?.authSchemes?.length??!1){let[e,t]=c.authSchemes;e?.name===`sigv4a`&&t?.name===`sigv4`&&(o=t?.signingRegion??o,s=t?.signingName??s)}return await a.sign(e,{signingDate:k_(i.systemClockOffset),signingRegion:o,signingService:s})}errorHandler(e){return t=>{let n=t.ServerTime??D_(t.$response);if(n){let r=L_(`config`,e.config),i=r.systemClockOffset;r.systemClockOffset=N_(n,r.systemClockOffset),r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){let n=D_(e);if(n){let e=L_(`config`,t.config);e.systemClockOffset=N_(n,e.systemClockOffset)}}},B_=z_})),H_,U_,W_=l((()=>{H_=_d(),F_(),V_(),U_=class extends z_{async sign(e,t,n){if(!H_.HttpRequest.isInstance(e))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:r,signer:i,signingRegion:a,signingRegionSet:o,signingName:s}=await R_(n),c=(await r.sigv4aSigningRegionSet?.()??o??[a]).join(`,`);return await i.sign(e,{signingDate:k_(r.systemClockOffset),signingRegion:c,signingService:s})}}})),G_,K_=l((()=>{G_=e=>typeof e==`string`&&e.length>0?e.split(`,`).map(e=>e.trim()):[]})),q_,J_=l((()=>{q_=e=>`AWS_BEARER_TOKEN_${e.replace(/[\s-]/g,`_`).toUpperCase()}`})),Y_,X_,Z_,Q_=l((()=>{K_(),J_(),Y_=`AWS_AUTH_SCHEME_PREFERENCE`,X_=`auth_scheme_preference`,Z_={environmentVariableSelector:(e,t)=>{if(t?.signingName&&q_(t.signingName)in e)return[`httpBearerAuth`];if(Y_ in e)return G_(e[Y_])},configFileSelector:e=>{if(X_ in e)return G_(e[X_])},default:[]}})),$_,ev,tv,nv=l((()=>{Wg(),$_=d_(),ev=e=>(e.sigv4aSigningRegionSet=rf(e.sigv4aSigningRegionSet),e),tv={environmentVariableSelector(e){if(e.AWS_SIGV4A_SIGNING_REGION_SET)return e.AWS_SIGV4A_SIGNING_REGION_SET.split(`,`).map(e=>e.trim());throw new $_.ProviderError(`AWS_SIGV4A_SIGNING_REGION_SET not set in env.`,{tryNextLink:!0})},configFileSelector(e){if(e.sigv4a_signing_region_set)return(e.sigv4a_signing_region_set??``).split(`,`).map(e=>e.trim());throw new $_.ProviderError(`sigv4a_signing_region_set not set in profile.`,{tryNextLink:!0})},default:void 0}})),rv=u((e=>{var t=Mf(),n=pf(),r=uf(),i=_d(),a=Nd(),o=Of();let s=`authorization`,c=`x-amz-date`,l=[s,c,`date`],u=`x-amz-content-sha256`,d={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},f=/^proxy-/,p=/^sec-/,m=`AWS4-HMAC-SHA256`,h=`aws4_request`,g={},_=[],v=(e,t,n)=>`${e}/${t}/${n}/${h}`,y=async(e,n,r,i,a)=>{let o=await b(e,n.secretAccessKey,n.accessKeyId),s=`${r}:${i}:${a}:${t.toHex(o)}:${n.sessionToken}`;if(s in g)return g[s];for(_.push(s);_.length>50;)delete g[_.shift()];let c=`AWS4${n.secretAccessKey}`;for(let t of[r,i,a,h])c=await b(e,c,t);return g[s]=c},b=(e,t,r)=>{let i=new e(t);return i.update(n.toUint8Array(r)),i.digest()},x=({headers:e},t,n)=>{let r={};for(let i of Object.keys(e).sort()){if(e[i]==null)continue;let a=i.toLowerCase();(a in d||t?.has(a)||f.test(a)||p.test(a))&&(!n||n&&!n.has(a))||(r[a]=e[i].trim().replace(/\s+/g,` `))}return r},S=async({headers:e,body:i},a)=>{for(let t of Object.keys(e))if(t.toLowerCase()===u)return e[t];if(i==null)return`e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`;if(typeof i==`string`||ArrayBuffer.isView(i)||r.isArrayBuffer(i)){let e=new a;return e.update(n.toUint8Array(i)),t.toHex(await e.digest())}return`UNSIGNED-PAYLOAD`};var C=class{format(e){let t=[];for(let r of Object.keys(e)){let i=n.fromUtf8(r);t.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[r]))}let r=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),i=0;for(let e of t)r.set(e,i),i+=e.byteLength;return r}formatHeaderValue(e){switch(e.type){case`boolean`:return Uint8Array.from([e.value?0:1]);case`byte`:return Uint8Array.from([2,e.value]);case`short`:let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case`integer`:let i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case`long`:let a=new Uint8Array(9);return a[0]=5,a.set(e.value.bytes,1),a;case`binary`:let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);let s=new Uint8Array(o.buffer);return s.set(e.value,3),s;case`string`:let c=n.fromUtf8(e.value),l=new DataView(new ArrayBuffer(3+c.byteLength));l.setUint8(0,7),l.setUint16(1,c.byteLength,!1);let u=new Uint8Array(l.buffer);return u.set(c,3),u;case`timestamp`:let d=new Uint8Array(9);return d[0]=8,d.set(ee.fromNumber(e.value.valueOf()).bytes,1),d;case`uuid`:if(!w.test(e.value))throw Error(`Invalid UUID received: ${e.value}`);let f=new Uint8Array(17);return f[0]=9,f.set(t.fromHex(e.value.replace(/\-/g,``)),1),f}}};let w=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var ee=class e{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw Error(`Int64 buffers must be exactly 8 bytes`)}static fromNumber(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let e=7,r=Math.abs(Math.round(t));e>-1&&r>0;e--,r/=256)n[e]=r;return t<0&&te(n),new e(n)}valueOf(){let e=this.bytes.slice(0),n=e[0]&128;return n&&te(e),parseInt(t.toHex(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}};function te(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}let T=(e,t)=>{e=e.toLowerCase();for(let n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1},E=(e,t={})=>{let{headers:n,query:r={}}=i.HttpRequest.clone(e);for(let e of Object.keys(n)){let i=e.toLowerCase();(i.slice(0,6)===`x-amz-`&&!t.unhoistableHeaders?.has(i)||t.hoistableHeaders?.has(i))&&(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}},ne=e=>{e=i.HttpRequest.clone(e);for(let t of Object.keys(e.headers))l.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},re=({query:e={}})=>{let t=[],n={};for(let r of Object.keys(e)){if(r.toLowerCase()===`x-amz-signature`)continue;let i=o.escapeUri(r);t.push(i);let a=e[r];typeof a==`string`?n[i]=`${i}=${o.escapeUri(a)}`:Array.isArray(a)&&(n[i]=a.slice(0).reduce((e,t)=>e.concat([`${i}=${o.escapeUri(t)}`]),[]).sort().join(`&`))}return t.sort().map(e=>n[e]).filter(e=>e).join(`&`)},ie=e=>ae(e).toISOString().replace(/\.\d{3}Z$/,`Z`),ae=e=>typeof e==`number`?new Date(e*1e3):typeof e==`string`?Number(e)?new Date(Number(e)*1e3):new Date(e):e;var oe=class{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){this.service=r,this.sha256=i,this.uriEscapePath=o,this.applyChecksum=typeof e==`boolean`?e:!0,this.regionProvider=a.normalizeProvider(n),this.credentialProvider=a.normalizeProvider(t)}createCanonicalRequest(e,t,n){let r=Object.keys(t).sort();return`${e.method}
|
|
46
|
+
More information can be found at: https://a.co/c895JFp`))}}));function Zg(e,t,n){return e.$source||={},e.$source[t]=n,e}var Qg=l((()=>{}));function $g(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}var e_=l((()=>{}));function t_(e,t,n){return e.$source||={},e.$source[t]=n,e}var n_=l((()=>{})),r_=d({emitWarningIfUnsupportedVersion:()=>Yg,setCredentialFeature:()=>Zg,setFeature:()=>$g,setTokenFeature:()=>t_,state:()=>Jg}),i_=l((()=>{Xg(),Qg(),e_(),n_()})),a_=u((e=>{let t=[`AuthFailure`,`InvalidSignatureException`,`RequestExpired`,`RequestInTheFuture`,`RequestTimeTooSkewed`,`SignatureDoesNotMatch`],n=[`BandwidthLimitExceeded`,`EC2ThrottledException`,`LimitExceededException`,`PriorRequestNotComplete`,`ProvisionedThroughputExceededException`,`RequestLimitExceeded`,`RequestThrottled`,`RequestThrottledException`,`SlowDown`,`ThrottledException`,`Throttling`,`ThrottlingException`,`TooManyRequestsException`,`TransactionInProgressException`],r=[`TimeoutError`,`RequestTimeout`,`RequestTimeoutException`],i=[500,502,503,504],a=[`ECONNRESET`,`ECONNREFUSED`,`EPIPE`,`ETIMEDOUT`],o=[`EHOSTUNREACH`,`ENETUNREACH`,`ENOTFOUND`],s=e=>e?.$retryable!==void 0,c=e=>t.includes(e.name),l=e=>e.$metadata?.clockSkewCorrected,u=e=>{let 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):!1},d=e=>e.$metadata?.httpStatusCode===429||n.includes(e.name)||e.$retryable?.throttling==1,f=(e,t=0)=>s(e)||l(e)||r.includes(e.name)||a.includes(e?.code||``)||o.includes(e?.code||``)||i.includes(e.$metadata?.httpStatusCode||0)||u(e)||e.cause!==void 0&&t<=10&&f(e.cause,t+1);e.isBrowserNetworkError=u,e.isClockSkewCorrectedError=l,e.isClockSkewError=c,e.isRetryableByTrait=s,e.isServerError=e=>{if(e.$metadata?.httpStatusCode!==void 0){let t=e.$metadata.httpStatusCode;return 500<=t&&t<=599&&!f(e)}return!1},e.isThrottlingError=d,e.isTransientError=f})),o_=u((e=>{var t=a_();e.RETRY_MODES=void 0,(function(e){e.STANDARD=`standard`,e.ADAPTIVE=`adaptive`})(e.RETRY_MODES||={});let n=e.RETRY_MODES.STANDARD;var r=class e{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(t){if(this.enabled){if(this.refillTokenBucket(),t>this.availableTokens){let n=(t-this.availableTokens)/this.fillRate*1e3;await new Promise(t=>e.setTimeoutFn(t,n))}this.availableTokens-=t}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}updateClientSendingRate(e){let n;this.updateMeasuredRate();let r=e;if(r?.errorType===`THROTTLING`||t.isThrottlingError(r?.error??e)){let e=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=e,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),n=this.cubicThrottle(e),this.enableTokenBucket()}else this.calculateTimeWindow(),n=this.cubicSuccess(this.getCurrentTimeInSeconds());let i=Math.min(n,2*this.measuredTxRate);this.updateTokenBucketRate(i)}calculateTimeWindow(){this.timeWindow=this.getPrecise((this.lastMaxRate*(1-this.beta)/this.scaleConstant)**(1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*(e-this.lastThrottleTime-this.timeWindow)**3+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){let e=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(e*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}};let i=20*1e3,a=()=>{let e=100;return{computeNextBackoffDelay:t=>Math.floor(Math.min(i,Math.random()*2**t*e)),setDelayBase:t=>{e=t}}},o=({retryDelay:e,retryCount:t,retryCost:n})=>({getRetryCount:()=>t,getRetryDelay:()=>Math.min(i,e),getRetryCost:()=>n});var s=class{maxAttempts;mode=e.RETRY_MODES.STANDARD;capacity=500;retryBackoffStrategy=a();maxAttemptsProvider;constructor(e){this.maxAttempts=e,this.maxAttemptsProvider=typeof e==`function`?e:async()=>e}async acquireInitialRetryToken(e){return o({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(e,t){let n=await this.getMaxAttempts();if(this.shouldRetry(e,t,n)){let n=t.errorType;this.retryBackoffStrategy.setDelayBase(n===`THROTTLING`?500:100);let r=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),i=t.retryAfterHint?Math.max(t.retryAfterHint.getTime()-Date.now()||0,r):r,a=this.getCapacityCost(n);return this.capacity-=a,o({retryDelay:i,retryCount:e.getRetryCount()+1,retryCost:a})}throw Error(`No retry token available`)}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of 3`),3}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===`TRANSIENT`?10:5}isRetryableError(e){return e===`THROTTLING`||e===`TRANSIENT`}},c=class{maxAttemptsProvider;rateLimiter;standardRetryStrategy;mode=e.RETRY_MODES.ADAPTIVE;constructor(e,t){this.maxAttemptsProvider=e;let{rateLimiter:n}=t??{};this.rateLimiter=n??new r,this.standardRetryStrategy=new s(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}},l=class extends s{computeNextBackoffDelay;constructor(e,t=100){super(typeof e==`function`?e:async()=>e),typeof t==`number`?this.computeNextBackoffDelay=()=>t:this.computeNextBackoffDelay=t}async refreshRetryTokenForRetry(e,t){let n=await super.refreshRetryTokenForRetry(e,t);return n.getRetryDelay=()=>this.computeNextBackoffDelay(n.getRetryCount()),n}};e.AdaptiveRetryStrategy=c,e.ConfiguredRetryStrategy=l,e.DEFAULT_MAX_ATTEMPTS=3,e.DEFAULT_RETRY_DELAY_BASE=100,e.DEFAULT_RETRY_MODE=n,e.DefaultRateLimiter=r,e.INITIAL_RETRY_TOKENS=500,e.INVOCATION_ID_HEADER=`amz-sdk-invocation-id`,e.MAXIMUM_RETRY_DELAY=i,e.NO_RETRY_INCREMENT=1,e.REQUEST_HEADER=`amz-sdk-request`,e.RETRY_COST=5,e.StandardRetryStrategy=s,e.THROTTLING_RETRY_DELAY_BASE=500,e.TIMEOUT_RETRY_COST=10})),s_=u((e=>{var t=(Gg(),m(Wg)),n=qg(),r=vd(),i=(i_(),m(r_)),a=o_();function o(e){return e===void 0?!0:typeof e==`string`&&e.length<=50}function s(e){let n=t.normalizeProvider(e.userAgentAppId??void 0),{customUserAgent:r}=e;return Object.assign(e,{customUserAgent:typeof r==`string`?[[r]]:r,userAgentAppId:async()=>{let t=await n();if(!o(t)){let n=e.logger?.constructor?.name===`NoOpLogger`||!e.logger?console:e.logger;typeof t==`string`?t.length>50&&n?.warn(`The provided userAgentAppId exceeds the maximum length of 50 characters.`):n?.warn(`userAgentAppId must be a string or undefined.`)}return t}})}let c=/\d{12}\.ddb/;async function l(e,t,n){if(n.request?.headers?.[`smithy-protocol`]===`rpc-v2-cbor`&&i.setFeature(e,`PROTOCOL_RPC_V2_CBOR`,`M`),typeof t.retryStrategy==`function`){let n=await t.retryStrategy();if(typeof n.mode==`string`)switch(n.mode){case a.RETRY_MODES.ADAPTIVE:i.setFeature(e,`RETRY_MODE_ADAPTIVE`,`F`);break;case a.RETRY_MODES.STANDARD:i.setFeature(e,`RETRY_MODE_STANDARD`,`E`);break}}if(typeof t.accountIdEndpointMode==`function`){let n=e.endpointV2;switch(String(n?.url?.hostname).match(c)&&i.setFeature(e,`ACCOUNT_ID_ENDPOINT`,`O`),await t.accountIdEndpointMode?.()){case`disabled`:i.setFeature(e,`ACCOUNT_ID_MODE_DISABLED`,`Q`);break;case`preferred`:i.setFeature(e,`ACCOUNT_ID_MODE_PREFERRED`,`P`);break;case`required`:i.setFeature(e,`ACCOUNT_ID_MODE_REQUIRED`,`R`);break}}let r=e.__smithy_context?.selectedHttpAuthScheme?.identity;if(r?.$source){let t=r;t.accountId&&i.setFeature(e,`RESOLVED_ACCOUNT_ID`,`T`);for(let[n,r]of Object.entries(t.$source??{}))i.setFeature(e,n,r)}}let u=`user-agent`,d=`x-amz-user-agent`,f=/[^!$%&'*+\-.^_`|~\w]/g,p=/[^!$%&'*+\-.^_`|~\w#]/g;function h(e){let t=``;for(let n in e){let r=e[n];if(t.length+r.length+1<=1024){t.length?t+=`,`+r:t+=r;continue}break}return t}let g=e=>(t,i)=>async a=>{let{request:o}=a;if(!r.HttpRequest.isInstance(o))return t(a);let{headers:s}=o,c=i?.userAgent?.map(_)||[],f=(await e.defaultUserAgentProvider()).map(_);await l(i,e,a);let p=i;f.push(`m/${h(Object.assign({},i.__smithy_context?.features,p.__aws_sdk_context?.features))}`);let m=e?.customUserAgent?.map(_)||[],g=await e.userAgentAppId();g&&f.push(_([`app`,`${g}`]));let v=n.getUserAgentPrefix(),y=(v?[v]:[]).concat([...f,...c,...m]).join(` `),b=[...f.filter(e=>e.startsWith(`aws-sdk-`)),...m].join(` `);return e.runtime===`browser`?s[d]=y:(b&&(s[d]=s[d]?`${s[u]} ${b}`:b),s[u]=y),t({...a,request:o})},_=e=>{let t=e[0].split(`/`).map(e=>e.replace(f,`-`)).join(`/`),n=e[1]?.replace(p,`-`),r=t.indexOf(`/`),i=t.substring(0,r),a=t.substring(r+1);return i===`api`&&(a=a.toLowerCase()),[i,a,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}`}},``)},v={name:`getUserAgentMiddleware`,step:`build`,priority:`low`,tags:[`SET_USER_AGENT`,`USER_AGENT`],override:!0};e.DEFAULT_UA_APP_ID=void 0,e.getUserAgentMiddlewareOptions=v,e.getUserAgentPlugin=e=>({applyToStack:t=>{t.add(g(e),v)}}),e.resolveUserAgentConfig=s,e.userAgentMiddleware=g})),c_=u((e=>{e.SelectorType=void 0,(function(e){e.ENV=`env`,e.CONFIG=`shared config entry`})(e.SelectorType||={}),e.booleanSelector=(e,t,n)=>{if(t in e){if(e[t]===`true`)return!0;if(e[t]===`false`)return!1;throw Error(`Cannot load ${n} "${t}". Expected "true" or "false", got ${e[t]}.`)}},e.numberSelector=(e,t,n)=>{if(!(t in e))return;let r=parseInt(e[t],10);if(Number.isNaN(r))throw TypeError(`Cannot load ${n} '${t}'. Expected number, got '${e[t]}'.`);return r}})),l_=u((e=>{var t=c_(),n=Pd(),r=Kg();let i=`AWS_USE_DUALSTACK_ENDPOINT`,a=`use_dualstack_endpoint`,o={environmentVariableSelector:e=>t.booleanSelector(e,i,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,a,t.SelectorType.CONFIG),default:!1},s={environmentVariableSelector:e=>t.booleanSelector(e,i,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,a,t.SelectorType.CONFIG),default:void 0},c=`AWS_USE_FIPS_ENDPOINT`,l=`use_fips_endpoint`,u={environmentVariableSelector:e=>t.booleanSelector(e,c,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,l,t.SelectorType.CONFIG),default:!1},d={environmentVariableSelector:e=>t.booleanSelector(e,c,t.SelectorType.ENV),configFileSelector:e=>t.booleanSelector(e,l,t.SelectorType.CONFIG),default:void 0},f=e=>{let{tls:t,endpoint:r,urlParser:i,useDualstackEndpoint:a}=e;return Object.assign(e,{tls:t??!0,endpoint:n.normalizeProvider(typeof r==`string`?i(r):r),isCustomEndpoint:!0,useDualstackEndpoint:n.normalizeProvider(a??!1)})},p=async e=>{let{tls:t=!0}=e,n=await e.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw Error(`Invalid region in client config`);let r=await e.useDualstackEndpoint(),i=await e.useFipsEndpoint(),{hostname:a}=await e.regionInfoProvider(n,{useDualstackEndpoint:r,useFipsEndpoint:i})??{};if(!a)throw Error(`Cannot resolve hostname from client config`);return e.urlParser(`${t?`https:`:`http:`}//${a}`)},m=e=>{let t=n.normalizeProvider(e.useDualstackEndpoint??!1),{endpoint:r,useFipsEndpoint:i,urlParser:a,tls:o}=e;return Object.assign(e,{tls:o??!0,endpoint:r?n.normalizeProvider(typeof r==`string`?a(r):r):()=>p({...e,useDualstackEndpoint:t,useFipsEndpoint:i}),isCustomEndpoint:!!r,useDualstackEndpoint:t})},h=`AWS_REGION`,g=`region`,_={environmentVariableSelector:e=>e[h],configFileSelector:e=>e[g],default:()=>{throw Error(`Region is missing`)}},v={preferredFile:`credentials`},y=new Set,b=(e,t=r.isValidHostLabel)=>{if(!y.has(e)&&!t(e))if(e===`*`)console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`);else throw Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else y.add(e)},x=e=>typeof e==`string`&&(e.startsWith(`fips-`)||e.endsWith(`-fips`)),S=e=>x(e)?[`fips-aws-global`,`aws-fips`].includes(e)?`us-east-1`:e.replace(/fips-(dkr-|prod-)?|-fips/,``):e,C=e=>{let{region:t,useFipsEndpoint:n}=e;if(!t)throw Error(`Region is missing`);return Object.assign(e,{region:async()=>{let e=S(typeof t==`function`?await t():t);return b(e),e},useFipsEndpoint:async()=>x(typeof t==`string`?t:await t())?!0:typeof n==`function`?n():Promise.resolve(!!n)})},w=(e=[],{useFipsEndpoint:t,useDualstackEndpoint:n})=>e.find(({tags:e})=>t===e.includes(`fips`)&&n===e.includes(`dualstack`))?.hostname,ee=(e,{regionHostname:t,partitionHostname:n})=>t||(n?n.replace(`{region}`,e):void 0),te=(e,{partitionHash:t})=>Object.keys(t||{}).find(n=>t[n].regions.includes(e))??`aws`,T=(e,{signingRegion:t,regionRegex:n,useFipsEndpoint:r})=>{if(t)return t;if(r){let t=n.replace(`\\\\`,`\\`).replace(/^\^/g,`\\.`).replace(/\$$/g,`\\.`),r=e.match(t);if(r)return r[0].slice(1,-1)}};e.CONFIG_USE_DUALSTACK_ENDPOINT=a,e.CONFIG_USE_FIPS_ENDPOINT=l,e.DEFAULT_USE_DUALSTACK_ENDPOINT=!1,e.DEFAULT_USE_FIPS_ENDPOINT=!1,e.ENV_USE_DUALSTACK_ENDPOINT=i,e.ENV_USE_FIPS_ENDPOINT=c,e.NODE_REGION_CONFIG_FILE_OPTIONS=v,e.NODE_REGION_CONFIG_OPTIONS=_,e.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=o,e.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=u,e.REGION_ENV_NAME=h,e.REGION_INI_NAME=g,e.getRegionInfo=(e,{useFipsEndpoint:t=!1,useDualstackEndpoint:n=!1,signingService:r,regionHash:i,partitionHash:a})=>{let o=te(e,{partitionHash:a}),s=e in i?e:a[o]?.endpoint??e,c={useFipsEndpoint:t,useDualstackEndpoint:n},l=ee(s,{regionHostname:w(i[s]?.variants,c),partitionHostname:w(a[o]?.variants,c)});if(l===void 0)throw Error(`Endpoint resolution failed for: [object Object]`);let u=T(l,{signingRegion:i[s]?.signingRegion,regionRegex:a[o].regionRegex,useFipsEndpoint:t});return{partition:o,signingService:r,hostname:l,...u&&{signingRegion:u},...i[s]?.signingService&&{signingService:i[s].signingService}}},e.nodeDualstackConfigSelectors=s,e.nodeFipsConfigSelectors=d,e.resolveCustomEndpointsConfig=f,e.resolveEndpointsConfig=m,e.resolveRegionConfig=C})),u_=u((e=>{e.resolveEventStreamSerdeConfig=e=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)})})),d_=u((e=>{var t=vd();let n=`content-length`;function r(e){return r=>async i=>{let a=i.request;if(t.HttpRequest.isInstance(a)){let{body:t,headers:r}=a;if(t&&Object.keys(r).map(e=>e.toLowerCase()).indexOf(n)===-1)try{let r=e(t);a.headers={...a.headers,[n]:String(r)}}catch{}}return r({...i,request:a})}}let i={step:`build`,tags:[`SET_CONTENT_LENGTH`,`CONTENT_LENGTH`],name:`contentLengthMiddleware`,override:!0};e.contentLengthMiddleware=r,e.contentLengthMiddlewareOptions=i,e.getContentLengthPlugin=e=>({applyToStack:t=>{t.add(r(e.bodyLengthChecker),i)}})})),f_=u((e=>{var t=class e extends Error{name=`ProviderError`;tryNextLink;constructor(t,n=!0){let r,i=!0;typeof n==`boolean`?(r=void 0,i=n):typeof n==`object`&&n&&(r=n.logger,i=n.tryNextLink??!0),super(t),this.tryNextLink=i,Object.setPrototypeOf(this,e.prototype),r?.debug?.(`@smithy/property-provider ${i?`->`:`(!)`} ${t}`)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}},n=class e extends t{name=`CredentialsProviderError`;constructor(t,n=!0){super(t,n),Object.setPrototypeOf(this,e.prototype)}},r=class e extends t{name=`TokenProviderError`;constructor(t,n=!0){super(t,n),Object.setPrototypeOf(this,e.prototype)}};e.CredentialsProviderError=n,e.ProviderError=t,e.TokenProviderError=r,e.chain=(...e)=>async()=>{if(e.length===0)throw new t(`No providers in chain`);let n;for(let t of e)try{return await t()}catch(e){if(n=e,e?.tryNextLink)continue;throw e}throw n},e.fromStatic=e=>()=>Promise.resolve(e),e.memoize=(e,t,n)=>{let r,i,a,o=!1,s=async()=>{i||=e();try{r=await i,a=!0,o=!1}finally{i=void 0}return r};return t===void 0?async e=>((!a||e?.forceRefresh)&&(r=await s()),r):async e=>((!a||e?.forceRefresh)&&(r=await s()),o?r:n&&!n(r)?(o=!0,r):(t(r)&&await s(),r))}})),p_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getHomeDir=void 0;let t=h(`os`),n=h(`path`),r={},i=()=>process&&process.geteuid?`${process.geteuid()}`:`DEFAULT`;e.getHomeDir=()=>{let{HOME:e,USERPROFILE:a,HOMEPATH:o,HOMEDRIVE:s=`C:${n.sep}`}=process.env;if(e)return e;if(a)return a;if(o)return`${s}${o}`;let c=i();return r[c]||(r[c]=(0,t.homedir)()),r[c]}})),m_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSSOTokenFilepath=void 0;let t=h(`crypto`),n=h(`path`),r=p_();e.getSSOTokenFilepath=e=>{let i=(0,t.createHash)(`sha1`).update(e).digest(`hex`);return(0,n.join)((0,r.getHomeDir)(),`.aws`,`sso`,`cache`,`${i}.json`)}})),h_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getSSOTokenFromFile=e.tokenIntercept=void 0;let t=h(`fs/promises`),n=m_();e.tokenIntercept={},e.getSSOTokenFromFile=async r=>{if(e.tokenIntercept[r])return e.tokenIntercept[r];let i=(0,n.getSSOTokenFilepath)(r),a=await(0,t.readFile)(i,`utf8`);return JSON.parse(a)}})),g_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readFile=e.fileIntercept=e.filePromises=void 0;let t=h(`node:fs/promises`);e.filePromises={},e.fileIntercept={},e.readFile=(n,r)=>e.fileIntercept[n]===void 0?((!e.filePromises[n]||r?.ignoreCache)&&(e.filePromises[n]=(0,t.readFile)(n,`utf8`)),e.filePromises[n]):e.fileIntercept[n]})),__=u((e=>{var t=p_(),n=m_(),r=h_(),i=h(`path`),a=_d(),o=g_();let s=`AWS_PROFILE`,c=`default`,l=e=>e.profile||process.env[s]||c,u=e=>Object.entries(e).filter(([e])=>{let t=e.indexOf(`.`);return t===-1?!1:Object.values(a.IniSectionType).includes(e.substring(0,t))}).reduce((e,[t,n])=>{let r=t.indexOf(`.`),i=t.substring(0,r)===a.IniSectionType.PROFILE?t.substring(r+1):t;return e[i]=n,e},{...e.default&&{default:e.default}}),d=()=>process.env.AWS_CONFIG_FILE||i.join(t.getHomeDir(),`.aws`,`config`),f=()=>process.env.AWS_SHARED_CREDENTIALS_FILE||i.join(t.getHomeDir(),`.aws`,`credentials`),p=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,m=[`__proto__`,`profile __proto__`],g=e=>{let t={},n,r;for(let i of e.split(/\r?\n/)){let e=i.split(/(^|\s)[;#]/)[0].trim();if(e[0]===`[`&&e[e.length-1]===`]`){n=void 0,r=void 0;let t=e.substring(1,e.length-1),i=p.exec(t);if(i){let[,e,,t]=i;Object.values(a.IniSectionType).includes(e)&&(n=[e,t].join(`.`))}else n=t;if(m.includes(t))throw Error(`Found invalid profile name "${t}"`)}else if(n){let a=e.indexOf(`=`);if(![0,-1].includes(a)){let[o,s]=[e.substring(0,a).trim(),e.substring(a+1).trim()];if(s===``)r=o;else{r&&i.trimStart()===i&&(r=void 0),t[n]=t[n]||{};let e=r?[r,o].join(`.`):o;t[n][e]=s}}}}return t},_=()=>({}),v=async(e={})=>{let{filepath:n=f(),configFilepath:r=d()}=e,a=t.getHomeDir(),s=n;n.startsWith(`~/`)&&(s=i.join(a,n.slice(2)));let c=r;r.startsWith(`~/`)&&(c=i.join(a,r.slice(2)));let l=await Promise.all([o.readFile(c,{ignoreCache:e.ignoreCache}).then(g).then(u).catch(_),o.readFile(s,{ignoreCache:e.ignoreCache}).then(g).catch(_)]);return{configFile:l[0],credentialsFile:l[1]}},y=e=>Object.entries(e).filter(([e])=>e.startsWith(a.IniSectionType.SSO_SESSION+`.`)).reduce((e,[t,n])=>({...e,[t.substring(t.indexOf(`.`)+1)]:n}),{}),b=()=>({}),x=async(e={})=>o.readFile(e.configFilepath??d()).then(g).then(y).catch(b),S=(...e)=>{let t={};for(let n of e)for(let[e,r]of Object.entries(n))t[e]===void 0?t[e]=r:Object.assign(t[e],r);return t};e.getSSOTokenFromFile=r.getSSOTokenFromFile,e.readFile=o.readFile,e.CONFIG_PREFIX_SEPARATOR=`.`,e.DEFAULT_PROFILE=c,e.ENV_PROFILE=s,e.externalDataInterceptor={getFileRecord(){return o.fileIntercept},interceptFile(e,t){o.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return r.tokenIntercept},interceptToken(e,t){r.tokenIntercept[e]=t}},e.getProfileName=l,e.loadSharedConfigFiles=v,e.loadSsoSessionData=x,e.parseKnownFiles=async e=>{let t=await v(e);return S(t.configFile,t.credentialsFile)},Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),Object.prototype.hasOwnProperty.call(n,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:n.__proto__}),Object.keys(n).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=n[t])})})),v_=u((e=>{var t=f_(),n=__();function r(e){try{let t=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return t.delete(`CONFIG`),t.delete(`CONFIG_PREFIX_SEPARATOR`),t.delete(`ENV`),[...t].join(`, `)}catch{return e}}let i=(e,n)=>async()=>{try{let t=e(process.env,n);if(t===void 0)throw Error();return t}catch(i){throw new t.CredentialsProviderError(i.message||`Not found in ENV: ${r(e.toString())}`,{logger:n?.logger})}},a=(e,{preferredFile:i=`config`,...a}={})=>async()=>{let o=n.getProfileName(a),{configFile:s,credentialsFile:c}=await n.loadSharedConfigFiles(a),l=c[o]||{},u=s[o]||{},d=i===`config`?{...l,...u}:{...u,...l};try{let t=e(d,i===`config`?s:c);if(t===void 0)throw Error();return t}catch(n){throw new t.CredentialsProviderError(n.message||`Not found in config files w/ profile [${o}]: ${r(e.toString())}`,{logger:a.logger})}},o=e=>typeof e==`function`,s=e=>o(e)?async()=>await e():t.fromStatic(e);e.loadConfig=({environmentVariableSelector:e,configFileSelector:n,default:r},o={})=>{let{signingName:c,logger:l}=o,u={signingName:c,logger:l};return t.memoize(t.chain(i(e,u),a(n,o),s(r)))}})),y_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getEndpointUrlConfig=void 0;let t=__(),n=`AWS_ENDPOINT_URL`,r=`endpoint_url`;e.getEndpointUrlConfig=e=>({environmentVariableSelector:t=>{let r=t[[n,...e.split(` `).map(e=>e.toUpperCase())].join(`_`)];if(r)return r;let i=t[n];if(i)return i},configFileSelector:(n,i)=>{if(i&&n.services){let a=i[[`services`,n.services].join(t.CONFIG_PREFIX_SEPARATOR)];if(a){let n=a[[e.split(` `).map(e=>e.toLowerCase()).join(`_`),r].join(t.CONFIG_PREFIX_SEPARATOR)];if(n)return n}}let a=n[r];if(a)return a},default:void 0})})),b_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getEndpointFromConfig=void 0;let t=v_(),n=y_();e.getEndpointFromConfig=async e=>(0,t.loadConfig)((0,n.getEndpointUrlConfig)(e??``))()})),x_=u((e=>{var t=vd(),n=(ap(),m(ip));let r=(e,n)=>(r,a)=>async o=>{let{response:s}=await r(o);try{return{response:s,output:await n(s,e)}}catch(e){if(Object.defineProperty(e,`$response`,{value:s,enumerable:!1,writable:!1,configurable:!1}),!(`$metadata`in e)){let n=`Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;try{e.message+=`
|
|
47
|
+
`+n}catch{!a.logger||a.logger?.constructor?.name===`NoOpLogger`?console.warn(n):a.logger?.warn?.(n)}e.$responseBodyText!==void 0&&e.$response&&(e.$response.body=e.$responseBodyText);try{if(t.HttpResponse.isInstance(s)){let{headers:t={}}=s,n=Object.entries(t);e.$metadata={httpStatusCode:s.statusCode,requestId:i(/^x-[\w-]+-request-?id$/,n),extendedRequestId:i(/^x-[\w-]+-id-2$/,n),cfId:i(/^x-[\w-]+-cf-id$/,n)}}}catch{}}throw e}},i=(e,t)=>(t.find(([t])=>t.match(e))||[void 0,void 0])[1],a=(e,t)=>(r,i)=>async a=>{let o=e,s=i.endpointV2?async()=>n.toEndpointV1(i.endpointV2):o.endpoint;if(!s)throw Error(`No valid endpoint provider available.`);let c=await t(a.input,{...e,endpoint:s});return r({...a,request:c})},o={name:`deserializerMiddleware`,step:`deserialize`,tags:[`DESERIALIZER`],override:!0},s={name:`serializerMiddleware`,step:`serialize`,tags:[`SERIALIZER`],override:!0};function c(e,t,n){return{applyToStack:i=>{i.add(r(e,n),o),i.add(a(e,t),s)}}}e.deserializerMiddleware=r,e.deserializerMiddlewareOption=o,e.getSerdePlugin=c,e.serializerMiddleware=a,e.serializerMiddlewareOption=s})),S_=u((e=>{var t=b_(),n=ep(),r=(Gg(),m(Wg)),i=Pd(),a=x_();let o=async e=>{let t=e?.Bucket||``;if(typeof e.Bucket==`string`&&(e.Bucket=t.replace(/#/g,`%23`).replace(/\?/g,`%3F`)),d(t)){if(e.ForcePathStyle===!0)throw Error(`Path-style addressing cannot be used with ARN buckets`)}else (!u(t)||t.indexOf(`.`)!==-1&&!String(e.Endpoint).startsWith(`http:`)||t.toLowerCase()!==t||t.length<3)&&(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},s=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,c=/(\d+\.){3}\d+/,l=/\.\./,u=e=>s.test(e)&&!c.test(e)&&!l.test(e),d=e=>{let[t,n,r,,,i]=e.split(`:`),a=t===`arn`&&e.split(`:`).length>=6,o=!!(a&&n&&r&&i);if(a&&!o)throw Error(`Invalid ARN: ${e} was an invalid ARN.`);return o},f=(e,t,n,r=!1)=>{let i=async()=>{let i;return i=r?n.clientContextParams?.[e]??n[e]??n[t]:n[e]??n[t],typeof i==`function`?i():i};return e===`credentialScope`||t===`CredentialScope`?async()=>{let e=typeof n.credentials==`function`?await n.credentials():n.credentials;return e?.credentialScope??e?.CredentialScope}:e===`accountId`||t===`AccountId`?async()=>{let e=typeof n.credentials==`function`?await n.credentials():n.credentials;return e?.accountId??e?.AccountId}:e===`endpoint`||t===`endpoint`?async()=>{if(n.isCustomEndpoint===!1)return;let e=await i();if(e&&typeof e==`object`){if(`url`in e)return e.url.href;if(`hostname`in e){let{protocol:t,hostname:n,port:r,path:i}=e;return`${t}//${n}${r?`:`+r:``}${i}`}}return e}:i},p=e=>{if(typeof e==`object`){if(`url`in e){let t=n.parseUrl(e.url);if(e.headers){t.headers={};for(let[n,r]of Object.entries(e.headers))t.headers[n.toLowerCase()]=r.join(`, `)}return t}return e}return n.parseUrl(e)},h=async(e,n,r,i)=>{if(!r.isCustomEndpoint){let e;e=r.serviceConfiguredEndpoint?await r.serviceConfiguredEndpoint():await t.getEndpointFromConfig(r.serviceId),e&&(r.endpoint=()=>Promise.resolve(p(e)),r.isCustomEndpoint=!0)}let a=await g(e,n,r);if(typeof r.endpointProvider!=`function`)throw Error(`config.endpointProvider is not set.`);let o=r.endpointProvider(a,i);if(r.isCustomEndpoint&&r.endpoint){let e=await r.endpoint();if(e?.headers){o.headers??={};for(let[t,n]of Object.entries(e.headers))o.headers[t]=Array.isArray(n)?n:[n]}}return o},g=async(e,t,n)=>{let r={},i=t?.getEndpointParameterInstructions?.()||{};for(let[t,a]of Object.entries(i))switch(a.type){case`staticContextParams`:r[t]=a.value;break;case`contextParams`:r[t]=e[a.name];break;case`clientContextParams`:case`builtInParams`:r[t]=await f(a.name,t,n,a.type!==`builtInParams`)();break;case`operationContextParams`:r[t]=a.get(e);break;default:throw Error(`Unrecognized endpoint parameter instruction: `+JSON.stringify(a))}return Object.keys(i).length===0&&Object.assign(r,n),String(n.serviceId).toLowerCase()===`s3`&&await o(r),r},_=({config:e,instructions:t})=>(n,a)=>async o=>{e.isCustomEndpoint&&r.setFeature(a,`ENDPOINT_OVERRIDE`,`N`);let s=await h(o.input,{getEndpointParameterInstructions(){return t}},{...e},a);a.endpointV2=s,a.authSchemes=s.properties?.authSchemes;let c=a.authSchemes?.[0];if(c){a.signing_region=c.signingRegion,a.signing_service=c.signingName;let e=i.getSmithyContext(a)?.selectedHttpAuthScheme?.httpAuthOption;e&&(e.signingProperties=Object.assign(e.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties))}return n({...o})},v={step:`serialize`,tags:[`ENDPOINT_PARAMETERS`,`ENDPOINT_V2`,`ENDPOINT`],name:`endpointV2Middleware`,override:!0,relation:`before`,toMiddleware:a.serializerMiddlewareOption.name};e.endpointMiddleware=_,e.endpointMiddlewareOptions=v,e.getEndpointFromInstructions=h,e.getEndpointPlugin=(e,t)=>({applyToStack:n=>{n.addRelativeTo(_({config:e,instructions:t}),v)}}),e.resolveEndpointConfig=e=>{let n=e.tls??!0,{endpoint:r,useDualstackEndpoint:a,useFipsEndpoint:o}=e,s=r==null?void 0:async()=>p(await i.normalizeProvider(r)()),c=!!r,l=Object.assign(e,{endpoint:s,tls:n,isCustomEndpoint:c,useDualstackEndpoint:i.normalizeProvider(a??!1),useFipsEndpoint:i.normalizeProvider(o??!1)}),u;return l.serviceConfiguredEndpoint=async()=>(e.serviceId&&!u&&(u=t.getEndpointFromConfig(e.serviceId)),u),l},e.resolveEndpointRequiredConfig=e=>{let{endpoint:t}=e;return t===void 0&&(e.endpoint=async()=>{throw Error(`@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.`)}),e},e.resolveParams=g,e.toEndpointV1=p})),C_=u((e=>{let t=(e,t)=>{let n=[];if(e&&n.push(e),t)for(let e of t)n.push(e);return n},n=(e,t)=>`${e||`anonymous`}${t&&t.length>0?` (a.k.a. ${t.join(`,`)})`:``}`,r=()=>{let e=[],o=[],s=!1,c=new Set,l=e=>e.sort((e,t)=>i[t.step]-i[e.step]||a[t.priority||`normal`]-a[e.priority||`normal`]),u=n=>{let r=!1,i=e=>{let i=t(e.name,e.aliases);if(i.includes(n)){r=!0;for(let e of i)c.delete(e);return!1}return!0};return e=e.filter(i),o=o.filter(i),r},d=n=>{let r=!1,i=e=>{if(e.middleware===n){r=!0;for(let n of t(e.name,e.aliases))c.delete(n);return!1}return!0};return e=e.filter(i),o=o.filter(i),r},f=t=>(e.forEach(e=>{t.add(e.middleware,{...e})}),o.forEach(e=>{t.addRelativeTo(e.middleware,{...e})}),t.identifyOnResolve?.(h.identifyOnResolve()),t),p=e=>{let t=[];return e.before.forEach(e=>{e.before.length===0&&e.after.length===0?t.push(e):t.push(...p(e))}),t.push(e),e.after.reverse().forEach(e=>{e.before.length===0&&e.after.length===0?t.push(e):t.push(...p(e))}),t},m=(r=!1)=>{let i=[],a=[],s={};return e.forEach(e=>{let n={...e,before:[],after:[]};for(let e of t(n.name,n.aliases))s[e]=n;i.push(n)}),o.forEach(e=>{let n={...e,before:[],after:[]};for(let e of t(n.name,n.aliases))s[e]=n;a.push(n)}),a.forEach(e=>{if(e.toMiddleware){let t=s[e.toMiddleware];if(t===void 0){if(r)return;throw Error(`${e.toMiddleware} is not found when adding ${n(e.name,e.aliases)} middleware ${e.relation} ${e.toMiddleware}`)}e.relation===`after`&&t.after.push(e),e.relation===`before`&&t.before.push(e)}}),l(i).map(p).reduce((e,t)=>(e.push(...t),e),[])},h={add:(r,i={})=>{let{name:a,override:o,aliases:s}=i,l={step:`initialize`,priority:`normal`,middleware:r,...i},u=t(a,s);if(u.length>0){if(u.some(e=>c.has(e))){if(!o)throw Error(`Duplicate middleware name '${n(a,s)}'`);for(let t of u){let r=e.findIndex(e=>e.name===t||e.aliases?.some(e=>e===t));if(r===-1)continue;let i=e[r];if(i.step!==l.step||l.priority!==i.priority)throw Error(`"${n(i.name,i.aliases)}" middleware with ${i.priority} priority in ${i.step} step cannot be overridden by "${n(a,s)}" middleware with ${l.priority} priority in ${l.step} step.`);e.splice(r,1)}}for(let e of u)c.add(e)}e.push(l)},addRelativeTo:(e,r)=>{let{name:i,override:a,aliases:s}=r,l={middleware:e,...r},u=t(i,s);if(u.length>0){if(u.some(e=>c.has(e))){if(!a)throw Error(`Duplicate middleware name '${n(i,s)}'`);for(let e of u){let t=o.findIndex(t=>t.name===e||t.aliases?.some(t=>t===e));if(t===-1)continue;let r=o[t];if(r.toMiddleware!==l.toMiddleware||r.relation!==l.relation)throw Error(`"${n(r.name,r.aliases)}" middleware ${r.relation} "${r.toMiddleware}" middleware cannot be overridden by "${n(i,s)}" middleware ${l.relation} "${l.toMiddleware}" middleware.`);o.splice(t,1)}}for(let e of u)c.add(e)}o.push(l)},clone:()=>f(r()),use:e=>{e.applyToStack(h)},remove:e=>typeof e==`string`?u(e):d(e),removeByTag:n=>{let r=!1,i=e=>{let{tags:i,name:a,aliases:o}=e;if(i&&i.includes(n)){let e=t(a,o);for(let t of e)c.delete(t);return r=!0,!1}return!0};return e=e.filter(i),o=o.filter(i),r},concat:e=>{let t=f(r());return t.use(e),t.identifyOnResolve(s||t.identifyOnResolve()||(e.identifyOnResolve?.()??!1)),t},applyToStack:f,identify:()=>m(!0).map(e=>{let t=e.step??e.relation+` `+e.toMiddleware;return n(e.name,e.aliases)+` - `+t}),identifyOnResolve(e){return typeof e==`boolean`&&(s=e),s},resolve:(e,t)=>{for(let n of m().map(e=>e.middleware).reverse())e=n(e,t);return s&&console.log(h.identify()),e}};return h},i={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},a={high:3,normal:2,low:1};e.constructStack=r})),w_=u((e=>{var t=C_(),n=(xg(),m(bg)),r=_d(),i=(Xp(),m(Yp)),a=(Ih(),m(Fh)),o=class{config;middlewareStack=t.constructStack();initConfig;handlers;constructor(e){this.config=e;let{protocol:t,protocolSettings:n}=e;n&&typeof t==`function`&&(e.protocol=new t(n))}send(e,t,n){let r=typeof t==`function`?void 0:t,i=typeof t==`function`?t:n,a=r===void 0&&this.config.cacheMiddleware===!0,o;if(a){this.handlers||=new WeakMap;let t=this.handlers;t.has(e.constructor)?o=t.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,r),t.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,r);if(i)o(e).then(e=>i(null,e.output),e=>i(e)).catch(()=>{});else return o(e).then(e=>e.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}};let s=`***SensitiveInformation***`;function c(e,t){if(t==null)return t;let n=i.NormalizedSchema.of(e);if(n.getMergedTraits().sensitive)return s;if(n.isListSchema()){if(n.getValueSchema().getMergedTraits().sensitive)return s}else if(n.isMapSchema()){if(n.getKeySchema().getMergedTraits().sensitive||n.getValueSchema().getMergedTraits().sensitive)return s}else if(n.isStructSchema()&&typeof t==`object`){let e=t,r={};for(let[t,i]of n.structIterator())e[t]!=null&&(r[t]=c(i,e[t]));return r}return t}var l=class{middlewareStack=t.constructStack();schema;static classBuilder(){return new u}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:c,smithyContext:l,additionalContext:u,CommandCtor:d}){for(let r of i.bind(this)(d,e,t,n))this.middlewareStack.use(r);let f=e.concat(this.middlewareStack),{logger:p}=t,m={logger:p,clientName:a,commandName:o,inputFilterSensitiveLog:s,outputFilterSensitiveLog:c,[r.SMITHY_CONTEXT_KEY]:{commandInstance:this,...l},...u},{requestHandler:h}=t;return f.resolve(e=>h.handle(e.request,n||{}),m)}},u=class{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName=``;_clientName=``;_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=e=>e,t=e=>e){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends l{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[t]){super(),this.input=t??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,r,i){let a=e._operationSchema,o=a?.[4]??a?.input,s=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(n,r,i,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(a?c.bind(null,o):e=>e),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(a?c.bind(null,s):e=>e),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}};let d=(e,t,n)=>{for(let[n,r]of Object.entries(e)){let e=async function(e,t,n){let i=new r(e);if(typeof t==`function`)this.send(i,t);else if(typeof n==`function`){if(typeof t!=`object`)throw Error(`Expected http options but got ${typeof t}`);this.send(i,t||{},n)}else return this.send(i,t)},i=(n[0].toLowerCase()+n.slice(1)).replace(/Command$/,``);t.prototype[i]=e}let{paginators:r={},waiters:i={}}=n??{};for(let[e,n]of Object.entries(r))t.prototype[e]===void 0&&(t.prototype[e]=function(e={},t,...r){return n({...t,client:this},e,...r)});for(let[e,n]of Object.entries(i))t.prototype[e]===void 0&&(t.prototype[e]=async function(e={},t,...r){let i=t;return typeof t==`number`&&(i={maxWaitTime:t}),n({...i,client:this},e,...r)})};var f=class e extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(t){if(!t)return!1;let n=t;return e.prototype.isPrototypeOf(n)||!!n.$fault&&!!n.$metadata&&(n.$fault===`client`||n.$fault===`server`)}static[Symbol.hasInstance](t){if(!t)return!1;let n=t;return this===e?e.isInstance(t):e.isInstance(t)?n.name&&this.name?this.prototype.isPrototypeOf(t)||n.name===this.name:this.prototype.isPrototypeOf(t):!1}};let p=(e,t={})=>(Object.entries(t).filter(([,e])=>e!==void 0).forEach(([t,n])=>{(e[t]==null||e[t]===``)&&(e[t]=n)}),e.message=e.message||e.Message||`UnknownError`,delete e.Message,e),h=({output:e,parsedBody:t,exceptionCtor:n,errorCode:r})=>{let i=_(e),a=i.httpStatusCode?i.httpStatusCode+``:void 0;throw p(new n({name:t?.code||t?.Code||r||a||`UnknownError`,$fault:`client`,$metadata:i}),t)},g=e=>({output:t,parsedBody:n,errorCode:r})=>{h({output:t,parsedBody:n,exceptionCtor:e,errorCode:r})},_=e=>({httpStatusCode:e.statusCode,requestId:e.headers[`x-amzn-requestid`]??e.headers[`x-amzn-request-id`]??e.headers[`x-amz-request-id`],extendedRequestId:e.headers[`x-amz-id-2`],cfId:e.headers[`x-amz-cf-id`]}),v=e=>{switch(e){case`standard`:return{retryMode:`standard`,connectionTimeout:3100};case`in-region`:return{retryMode:`standard`,connectionTimeout:1100};case`cross-region`:return{retryMode:`standard`,connectionTimeout:3100};case`mobile`:return{retryMode:`standard`,connectionTimeout:3e4};default:return{}}},y=!1,b=e=>{e&&!y&&parseInt(e.substring(1,e.indexOf(`.`)))<16&&(y=!0)},x=Object.values(r.AlgorithmId),S=e=>{let t=[];for(let n in r.AlgorithmId){let i=r.AlgorithmId[n];e[i]!==void 0&&t.push({algorithmId:()=>i,checksumConstructor:()=>e[i]})}for(let[n,r]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>n,checksumConstructor:()=>r});return{addChecksumAlgorithm(n){e.checksumAlgorithms=e.checksumAlgorithms??{};let r=n.algorithmId(),i=n.checksumConstructor();x.includes(r)?e.checksumAlgorithms[r.toUpperCase()]=i:e.checksumAlgorithms[r]=i,t.push(n)},checksumAlgorithms(){return t}}},C=e=>{let t={};return e.checksumAlgorithms().forEach(e=>{let n=e.algorithmId();x.includes(n)&&(t[n]=e.checksumConstructor())}),t},w=e=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),ee=e=>{let t={};return t.retryStrategy=e.retryStrategy(),t},te=e=>Object.assign(S(e),w(e)),T=te,E=e=>Object.assign(C(e),ee(e)),ne=e=>Array.isArray(e)?e:[e],re=e=>{let t=`#text`;for(let n in e)e.hasOwnProperty(n)&&e[n][t]!==void 0?e[n]=e[n][t]:typeof e[n]==`object`&&e[n]!==null&&(e[n]=re(e[n]));return e},ie=e=>e!=null;var ae=class{trace(){}debug(){}info(){}warn(){}error(){}};function oe(e,t,n){let r,i,a;if(t===void 0&&n===void 0)r={},a=e;else{if(r=e,typeof t==`function`)return i=t,a=n,le(r,i,a);a=t}for(let e of Object.keys(a)){if(!Array.isArray(a[e])){r[e]=a[e];continue}ue(r,null,a,e)}return r}let se=e=>{let t={};for(let[n,r]of Object.entries(e||{}))t[n]=[,r];return t},ce=(e,t)=>{let n={};for(let r in t)ue(n,e,t,r);return n},le=(e,t,n)=>oe(e,Object.entries(n).reduce((e,[n,r])=>(Array.isArray(r)?e[n]=r:typeof r==`function`?e[n]=[t,r()]:e[n]=[t,r],e),{})),ue=(e,t,n,r)=>{if(t!==null){let i=n[r];typeof i==`function`&&(i=[,i]);let[a=de,o=fe,s=r]=i;(typeof a==`function`&&a(t[s])||typeof a!=`function`&&a)&&(e[r]=o(t[s]));return}let[i,a]=n[r];if(typeof a==`function`){let t,n=i===void 0&&(t=a())!=null,o=typeof i==`function`&&!!i(void 0)||typeof i!=`function`&&!!i;n?e[r]=t:o&&(e[r]=a())}else{let t=i===void 0&&a!=null,n=typeof i==`function`&&!!i(a)||typeof i!=`function`&&!!i;(t||n)&&(e[r]=a)}},de=e=>e!=null,fe=e=>e,pe=e=>{if(e!==e)return`NaN`;switch(e){case 1/0:return`Infinity`;case-1/0:return`-Infinity`;default:return e}},me=e=>e.toISOString().replace(`.000Z`,`Z`),he=e=>{if(e==null)return{};if(Array.isArray(e))return e.filter(e=>e!=null).map(he);if(typeof e==`object`){let t={};for(let n of Object.keys(e))e[n]!=null&&(t[n]=he(e[n]));return t}return e};e.collectBody=n.collectBody,e.extendedEncodeURIComponent=n.extendedEncodeURIComponent,e.resolvedPath=n.resolvedPath,e.Client=o,e.Command=l,e.NoOpLogger=ae,e.SENSITIVE_STRING=`***SensitiveInformation***`,e.ServiceException=f,e._json=he,e.convertMap=se,e.createAggregatedClient=d,e.decorateServiceException=p,e.emitWarningIfUnsupportedVersion=b,e.getArrayIfSingleItem=ne,e.getDefaultClientConfiguration=T,e.getDefaultExtensionConfiguration=te,e.getValueFromTextNode=re,e.isSerializableHeaderValue=ie,e.loadConfigsForDefaultMode=v,e.map=oe,e.resolveDefaultRuntimeConfig=E,e.serializeDateTime=me,e.serializeFloat=pe,e.take=ce,e.throwDefaultError=h,e.withBaseException=g,Object.prototype.hasOwnProperty.call(a,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:a.__proto__}),Object.keys(a).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=a[t])})})),T_=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isStreamingPayload=void 0;let t=h(`stream`);e.isStreamingPayload=e=>e?.body instanceof t.Readable||typeof ReadableStream<`u`&&e?.body instanceof ReadableStream})),E_=u((e=>{var t=o_(),n=vd(),r=a_(),i=ah(),a=Pd(),o=w_(),s=T_();let c=(e,n)=>{let r=e,i=t.NO_RETRY_INCREMENT,a=t.RETRY_COST,o=t.TIMEOUT_RETRY_COST,s=e,c=e=>e.name===`TimeoutError`?o:a,l=e=>c(e)<=s;return Object.freeze({hasRetryTokens:l,retrieveRetryTokens:e=>{if(!l(e))throw Error(`No retry token available`);let t=c(e);return s-=t,t},releaseRetryTokens:e=>{s+=e??i,s=Math.min(s,r)}})},l=(e,n)=>Math.floor(Math.min(t.MAXIMUM_RETRY_DELAY,Math.random()*2**n*e)),u=e=>e?r.isRetryableByTrait(e)||r.isClockSkewError(e)||r.isThrottlingError(e)||r.isTransientError(e):!1,d=e=>e instanceof Error?e:e instanceof Object?Object.assign(Error(),e):typeof e==`string`?Error(e):Error(`AWS SDK error wrapper for ${e}`);var f=class{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=t.RETRY_MODES.STANDARD;constructor(e,n){this.maxAttemptsProvider=e,this.retryDecider=n?.retryDecider??u,this.delayDecider=n?.delayDecider??l,this.retryQuota=n?.retryQuota??c(t.INITIAL_RETRY_TOKENS)}shouldRetry(e,t,n){return t<n&&this.retryDecider(e)&&this.retryQuota.hasRetryTokens(e)}async getMaxAttempts(){let e;try{e=await this.maxAttemptsProvider()}catch{e=t.DEFAULT_MAX_ATTEMPTS}return e}async retry(e,a,o){let s,c=0,l=0,u=await this.getMaxAttempts(),{request:f}=a;for(n.HttpRequest.isInstance(f)&&(f.headers[t.INVOCATION_ID_HEADER]=i.v4());;)try{n.HttpRequest.isInstance(f)&&(f.headers[t.REQUEST_HEADER]=`attempt=${c+1}; max=${u}`),o?.beforeRequest&&await o.beforeRequest();let{response:r,output:i}=await e(a);return o?.afterRequest&&o.afterRequest(r),this.retryQuota.releaseRetryTokens(s),i.$metadata.attempts=c+1,i.$metadata.totalRetryDelay=l,{response:r,output:i}}catch(e){let n=d(e);if(c++,this.shouldRetry(n,c,u)){s=this.retryQuota.retrieveRetryTokens(n);let e=this.delayDecider(r.isThrottlingError(n)?t.THROTTLING_RETRY_DELAY_BASE:t.DEFAULT_RETRY_DELAY_BASE,c),i=p(n.$response),a=Math.max(i||0,e);l+=a,await new Promise(e=>setTimeout(e,a));continue}throw n.$metadata||={},n.$metadata.attempts=c,n.$metadata.totalRetryDelay=l,n}}};let p=e=>{if(!n.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find(e=>e.toLowerCase()===`retry-after`);if(!t)return;let r=e.headers[t],i=Number(r);return Number.isNaN(i)?new Date(r).getTime()-Date.now():i*1e3};var m=class extends f{rateLimiter;constructor(e,n){let{rateLimiter:r,...i}=n??{};super(e,i),this.rateLimiter=r??new t.DefaultRateLimiter,this.mode=t.RETRY_MODES.ADAPTIVE}async retry(e,t){return super.retry(e,t,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:e=>{this.rateLimiter.updateClientSendingRate(e)}})}};let h=`AWS_MAX_ATTEMPTS`,g=`max_attempts`,_={environmentVariableSelector:e=>{let t=e[h];if(!t)return;let n=parseInt(t);if(Number.isNaN(n))throw Error(`Environment variable ${h} mast be a number, got "${t}"`);return n},configFileSelector:e=>{let t=e[g];if(!t)return;let n=parseInt(t);if(Number.isNaN(n))throw Error(`Shared config file entry ${g} mast be a number, got "${t}"`);return n},default:t.DEFAULT_MAX_ATTEMPTS},v=e=>{let{retryStrategy:n,retryMode:r}=e,i=a.normalizeProvider(e.maxAttempts??t.DEFAULT_MAX_ATTEMPTS),o=n?Promise.resolve(n):void 0,s=async()=>await a.normalizeProvider(r)()===t.RETRY_MODES.ADAPTIVE?new t.AdaptiveRetryStrategy(i):new t.StandardRetryStrategy(i);return Object.assign(e,{maxAttempts:i,retryStrategy:()=>o??=s()})},y=`AWS_RETRY_MODE`,b=`retry_mode`,x={environmentVariableSelector:e=>e[y],configFileSelector:e=>e[b],default:t.DEFAULT_RETRY_MODE},S=()=>e=>async r=>{let{request:i}=r;return n.HttpRequest.isInstance(i)&&(delete i.headers[t.INVOCATION_ID_HEADER],delete i.headers[t.REQUEST_HEADER]),e(r)},C={name:`omitRetryHeadersMiddleware`,tags:[`RETRY`,`HEADERS`,`OMIT_RETRY_HEADERS`],relation:`before`,toMiddleware:`awsAuthMiddleware`,override:!0},w=e=>({applyToStack:e=>{e.addRelativeTo(S(),C)}}),ee=e=>(r,a)=>async c=>{let l=await e.retryStrategy(),u=await e.maxAttempts();if(te(l)){l=l;let e=await l.acquireInitialRetryToken(a.partition_id),f=Error(),p=0,m=0,{request:h}=c,g=n.HttpRequest.isInstance(h);for(g&&(h.headers[t.INVOCATION_ID_HEADER]=i.v4());;)try{g&&(h.headers[t.REQUEST_HEADER]=`attempt=${p+1}; max=${u}`);let{response:n,output:i}=await r(c);return l.recordSuccess(e),i.$metadata.attempts=p+1,i.$metadata.totalRetryDelay=m,{response:n,output:i}}catch(t){let n=T(t);if(f=d(t),g&&s.isStreamingPayload(h))throw(a.logger instanceof o.NoOpLogger?console:a.logger)?.warn(`An error was encountered in a non-retryable streaming request.`),f;try{e=await l.refreshRetryTokenForRetry(e,n)}catch{throw f.$metadata||={},f.$metadata.attempts=p+1,f.$metadata.totalRetryDelay=m,f}p=e.getRetryCount();let r=e.getRetryDelay();m+=r,await new Promise(e=>setTimeout(e,r))}}else return l=l,l?.mode&&(a.userAgent=[...a.userAgent||[],[`cfg/retry-mode`,l.mode]]),l.retry(r,c)},te=e=>e.acquireInitialRetryToken!==void 0&&e.refreshRetryTokenForRetry!==void 0&&e.recordSuccess!==void 0,T=e=>{let t={error:e,errorType:E(e)},n=ie(e.$response);return n&&(t.retryAfterHint=n),t},E=e=>r.isThrottlingError(e)?`THROTTLING`:r.isTransientError(e)?`TRANSIENT`:r.isServerError(e)?`SERVER_ERROR`:`CLIENT_ERROR`,ne={name:`retryMiddleware`,tags:[`RETRY`],step:`finalizeRequest`,priority:`high`,override:!0},re=e=>({applyToStack:t=>{t.add(ee(e),ne)}}),ie=e=>{if(!n.HttpResponse.isInstance(e))return;let t=Object.keys(e.headers).find(e=>e.toLowerCase()===`retry-after`);if(!t)return;let r=e.headers[t],i=Number(r);return Number.isNaN(i)?new Date(r):new Date(i*1e3)};e.AdaptiveRetryStrategy=m,e.CONFIG_MAX_ATTEMPTS=g,e.CONFIG_RETRY_MODE=b,e.ENV_MAX_ATTEMPTS=h,e.ENV_RETRY_MODE=y,e.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=_,e.NODE_RETRY_MODE_CONFIG_OPTIONS=x,e.StandardRetryStrategy=f,e.defaultDelayDecider=l,e.defaultRetryDecider=u,e.getOmitRetryHeadersPlugin=w,e.getRetryAfterHint=ie,e.getRetryPlugin=re,e.omitRetryHeadersMiddleware=S,e.omitRetryHeadersMiddlewareOptions=C,e.resolveRetryConfig=v,e.retryMiddleware=ee,e.retryMiddlewareOptions=ne})),D_,O_,k_=l((()=>{D_=vd(),O_=e=>D_.HttpResponse.isInstance(e)?e.headers?.date??e.headers?.Date:void 0})),A_,j_=l((()=>{A_=e=>new Date(Date.now()+e)})),M_,N_=l((()=>{j_(),M_=(e,t)=>Math.abs(A_(t).getTime()-e)>=3e5})),P_,F_=l((()=>{N_(),P_=(e,t)=>{let n=Date.parse(e);return M_(n,t)?n-Date.now():t}})),I_=l((()=>{k_(),j_(),F_()})),L_,R_,z_,B_,V_,H_=l((()=>{L_=vd(),I_(),R_=(e,t)=>{if(!t)throw Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return t},z_=async e=>{let t=R_(`context`,e.context),n=R_(`config`,e.config),r=t.endpointV2?.properties?.authSchemes?.[0];return{config:n,signer:await R_(`signer`,n.signer)(r),signingRegion:e?.signingRegion,signingRegionSet:e?.signingRegionSet,signingName:e?.signingName}},B_=class{async sign(e,t,n){if(!L_.HttpRequest.isInstance(e))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let r=await z_(n),{config:i,signer:a}=r,{signingRegion:o,signingName:s}=r,c=n.context;if(c?.authSchemes?.length??!1){let[e,t]=c.authSchemes;e?.name===`sigv4a`&&t?.name===`sigv4`&&(o=t?.signingRegion??o,s=t?.signingName??s)}return await a.sign(e,{signingDate:A_(i.systemClockOffset),signingRegion:o,signingService:s})}errorHandler(e){return t=>{let n=t.ServerTime??O_(t.$response);if(n){let r=R_(`config`,e.config),i=r.systemClockOffset;r.systemClockOffset=P_(n,r.systemClockOffset),r.systemClockOffset!==i&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){let n=O_(e);if(n){let e=R_(`config`,t.config);e.systemClockOffset=P_(n,e.systemClockOffset)}}},V_=B_})),U_,W_,G_=l((()=>{U_=vd(),I_(),H_(),W_=class extends B_{async sign(e,t,n){if(!U_.HttpRequest.isInstance(e))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:r,signer:i,signingRegion:a,signingRegionSet:o,signingName:s}=await z_(n),c=(await r.sigv4aSigningRegionSet?.()??o??[a]).join(`,`);return await i.sign(e,{signingDate:A_(r.systemClockOffset),signingRegion:c,signingService:s})}}})),K_,q_=l((()=>{K_=e=>typeof e==`string`&&e.length>0?e.split(`,`).map(e=>e.trim()):[]})),J_,Y_=l((()=>{J_=e=>`AWS_BEARER_TOKEN_${e.replace(/[\s-]/g,`_`).toUpperCase()}`})),X_,Z_,Q_,$_=l((()=>{q_(),Y_(),X_=`AWS_AUTH_SCHEME_PREFERENCE`,Z_=`auth_scheme_preference`,Q_={environmentVariableSelector:(e,t)=>{if(t?.signingName&&J_(t.signingName)in e)return[`httpBearerAuth`];if(X_ in e)return K_(e[X_])},configFileSelector:e=>{if(Z_ in e)return K_(e[Z_])},default:[]}})),ev,tv,nv,rv=l((()=>{Gg(),ev=f_(),tv=e=>(e.sigv4aSigningRegionSet=af(e.sigv4aSigningRegionSet),e),nv={environmentVariableSelector(e){if(e.AWS_SIGV4A_SIGNING_REGION_SET)return e.AWS_SIGV4A_SIGNING_REGION_SET.split(`,`).map(e=>e.trim());throw new ev.ProviderError(`AWS_SIGV4A_SIGNING_REGION_SET not set in env.`,{tryNextLink:!0})},configFileSelector(e){if(e.sigv4a_signing_region_set)return(e.sigv4a_signing_region_set??``).split(`,`).map(e=>e.trim());throw new ev.ProviderError(`sigv4a_signing_region_set not set in profile.`,{tryNextLink:!0})},default:void 0}})),iv=u((e=>{var t=Nf(),n=mf(),r=df(),i=vd(),a=Pd(),o=kf();let s=`authorization`,c=`x-amz-date`,l=[s,c,`date`],u=`x-amz-content-sha256`,d={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},f=/^proxy-/,p=/^sec-/,m=`AWS4-HMAC-SHA256`,h=`aws4_request`,g={},_=[],v=(e,t,n)=>`${e}/${t}/${n}/${h}`,y=async(e,n,r,i,a)=>{let o=await b(e,n.secretAccessKey,n.accessKeyId),s=`${r}:${i}:${a}:${t.toHex(o)}:${n.sessionToken}`;if(s in g)return g[s];for(_.push(s);_.length>50;)delete g[_.shift()];let c=`AWS4${n.secretAccessKey}`;for(let t of[r,i,a,h])c=await b(e,c,t);return g[s]=c},b=(e,t,r)=>{let i=new e(t);return i.update(n.toUint8Array(r)),i.digest()},x=({headers:e},t,n)=>{let r={};for(let i of Object.keys(e).sort()){if(e[i]==null)continue;let a=i.toLowerCase();(a in d||t?.has(a)||f.test(a)||p.test(a))&&(!n||n&&!n.has(a))||(r[a]=e[i].trim().replace(/\s+/g,` `))}return r},S=async({headers:e,body:i},a)=>{for(let t of Object.keys(e))if(t.toLowerCase()===u)return e[t];if(i==null)return`e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855`;if(typeof i==`string`||ArrayBuffer.isView(i)||r.isArrayBuffer(i)){let e=new a;return e.update(n.toUint8Array(i)),t.toHex(await e.digest())}return`UNSIGNED-PAYLOAD`};var C=class{format(e){let t=[];for(let r of Object.keys(e)){let i=n.fromUtf8(r);t.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[r]))}let r=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),i=0;for(let e of t)r.set(e,i),i+=e.byteLength;return r}formatHeaderValue(e){switch(e.type){case`boolean`:return Uint8Array.from([e.value?0:1]);case`byte`:return Uint8Array.from([2,e.value]);case`short`:let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case`integer`:let i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case`long`:let a=new Uint8Array(9);return a[0]=5,a.set(e.value.bytes,1),a;case`binary`:let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);let s=new Uint8Array(o.buffer);return s.set(e.value,3),s;case`string`:let c=n.fromUtf8(e.value),l=new DataView(new ArrayBuffer(3+c.byteLength));l.setUint8(0,7),l.setUint16(1,c.byteLength,!1);let u=new Uint8Array(l.buffer);return u.set(c,3),u;case`timestamp`:let d=new Uint8Array(9);return d[0]=8,d.set(ee.fromNumber(e.value.valueOf()).bytes,1),d;case`uuid`:if(!w.test(e.value))throw Error(`Invalid UUID received: ${e.value}`);let f=new Uint8Array(17);return f[0]=9,f.set(t.fromHex(e.value.replace(/\-/g,``)),1),f}}};let w=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var ee=class e{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw Error(`Int64 buffers must be exactly 8 bytes`)}static fromNumber(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let e=7,r=Math.abs(Math.round(t));e>-1&&r>0;e--,r/=256)n[e]=r;return t<0&&te(n),new e(n)}valueOf(){let e=this.bytes.slice(0),n=e[0]&128;return n&&te(e),parseInt(t.toHex(e),16)*(n?-1:1)}toString(){return String(this.valueOf())}};function te(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}let T=(e,t)=>{e=e.toLowerCase();for(let n of Object.keys(t))if(e===n.toLowerCase())return!0;return!1},E=(e,t={})=>{let{headers:n,query:r={}}=i.HttpRequest.clone(e);for(let e of Object.keys(n)){let i=e.toLowerCase();(i.slice(0,6)===`x-amz-`&&!t.unhoistableHeaders?.has(i)||t.hoistableHeaders?.has(i))&&(r[e]=n[e],delete n[e])}return{...e,headers:n,query:r}},ne=e=>{e=i.HttpRequest.clone(e);for(let t of Object.keys(e.headers))l.indexOf(t.toLowerCase())>-1&&delete e.headers[t];return e},re=({query:e={}})=>{let t=[],n={};for(let r of Object.keys(e)){if(r.toLowerCase()===`x-amz-signature`)continue;let i=o.escapeUri(r);t.push(i);let a=e[r];typeof a==`string`?n[i]=`${i}=${o.escapeUri(a)}`:Array.isArray(a)&&(n[i]=a.slice(0).reduce((e,t)=>e.concat([`${i}=${o.escapeUri(t)}`]),[]).sort().join(`&`))}return t.sort().map(e=>n[e]).filter(e=>e).join(`&`)},ie=e=>ae(e).toISOString().replace(/\.\d{3}Z$/,`Z`),ae=e=>typeof e==`number`?new Date(e*1e3):typeof e==`string`?Number(e)?new Date(Number(e)*1e3):new Date(e):e;var oe=class{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:o=!0}){this.service=r,this.sha256=i,this.uriEscapePath=o,this.applyChecksum=typeof e==`boolean`?e:!0,this.regionProvider=a.normalizeProvider(n),this.credentialProvider=a.normalizeProvider(t)}createCanonicalRequest(e,t,n){let r=Object.keys(t).sort();return`${e.method}
|
|
48
48
|
${this.getCanonicalPath(e)}
|
|
49
49
|
${re(e)}
|
|
50
50
|
${r.map(e=>`${e}:${t[e]}`).join(`
|
|
@@ -55,19 +55,19 @@ ${n}`}async createStringToSign(e,r,i,a){let o=new this.sha256;o.update(n.toUint8
|
|
|
55
55
|
${e}
|
|
56
56
|
${r}
|
|
57
57
|
${t.toHex(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let t=[];for(let n of e.split(`/`))n?.length!==0&&n!==`.`&&(n===`..`?t.pop():t.push(n));let n=`${e?.startsWith(`/`)?`/`:``}${t.join(`/`)}${t.length>0&&e?.endsWith(`/`)?`/`:``}`;return o.escapeUri(n).replace(/%2F/g,`/`)}return e}validateResolvedCredentials(e){if(typeof e!=`object`||typeof e.accessKeyId!=`string`||typeof e.secretAccessKey!=`string`)throw Error(`Resolved credential object is not valid`)}formatDate(e){let t=ie(e).replace(/[\-:]/g,``);return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(`;`)}};e.SignatureV4=class extends oe{headerFormatter=new C;constructor({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:a=!0}){super({applyChecksum:e,credentials:t,region:n,service:r,sha256:i,uriEscapePath:a})}async presign(e,t={}){let{signingDate:n=new Date,expiresIn:r=3600,unsignableHeaders:i,unhoistableHeaders:a,signableHeaders:o,hoistableHeaders:s,signingRegion:c,signingService:l}=t,u=await this.credentialProvider();this.validateResolvedCredentials(u);let d=c??await this.regionProvider(),{longDate:f,shortDate:p}=this.formatDate(n);if(r>604800)return Promise.reject(`Signature version 4 presigned URLs must have an expiration date less than one week in the future`);let h=v(p,d,l??this.service),g=E(ne(e),{unhoistableHeaders:a,hoistableHeaders:s});u.sessionToken&&(g.query[`X-Amz-Security-Token`]=u.sessionToken),g.query[`X-Amz-Algorithm`]=m,g.query[`X-Amz-Credential`]=`${u.accessKeyId}/${h}`,g.query[`X-Amz-Date`]=f,g.query[`X-Amz-Expires`]=r.toString(10);let _=x(g,i,o);return g.query[`X-Amz-SignedHeaders`]=this.getCanonicalHeaderList(_),g.query[`X-Amz-Signature`]=await this.getSignature(f,h,this.getSigningKey(u,d,p,l),this.createCanonicalRequest(g,_,await S(e,this.sha256))),g}async sign(e,t){return typeof e==`string`?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:n},{signingDate:r=new Date,priorSignature:i,signingRegion:a,signingService:o}){let s=a??await this.regionProvider(),{shortDate:c,longDate:l}=this.formatDate(r),u=v(c,s,o??this.service),d=await S({headers:{},body:n},this.sha256),f=new this.sha256;f.update(e);let p=[`AWS4-HMAC-SHA256-PAYLOAD`,l,u,i,t.toHex(await f.digest()),d].join(`
|
|
58
|
-
`);return this.signString(p,{signingDate:r,signingRegion:s,signingService:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:r=new Date,signingRegion:i,signingService:a}={}){let o=await this.credentialProvider();this.validateResolvedCredentials(o);let s=i??await this.regionProvider(),{shortDate:c}=this.formatDate(r),l=new this.sha256(await this.getSigningKey(o,s,c,a));return l.update(n.toUint8Array(e)),t.toHex(await l.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:a}={}){let o=await this.credentialProvider();this.validateResolvedCredentials(o);let l=i??await this.regionProvider(),d=ne(e),{longDate:f,shortDate:p}=this.formatDate(t),h=v(p,l,a??this.service);d.headers[c]=f,o.sessionToken&&(d.headers[`x-amz-security-token`]=o.sessionToken);let g=await S(d,this.sha256);!T(u,d.headers)&&this.applyChecksum&&(d.headers[u]=g);let _=x(d,r,n),y=await this.getSignature(f,h,this.getSigningKey(o,l,p,a),this.createCanonicalRequest(d,_,g));return d.headers[s]=`${m} Credential=${o.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(_)}, Signature=${y}`,d}async getSignature(e,r,i,a){let o=await this.createStringToSign(e,r,a,m),s=new this.sha256(await i);return s.update(n.toUint8Array(o)),t.toHex(await s.digest())}getSigningKey(e,t,n,r){return y(this.sha256,e,n,t,r||this.service)}}}));function iv(e,{credentials:t,credentialDefaultProvider:n}){let r;return r=t?t?.memoized?t:Bg(t,Rg,zg):n?rf(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function av(e,t){if(t.configBound)return t;let n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}var ov,sv,cv,lv=l((()=>{r_(),Wg(),ov=rv(),sv=e=>{let t=e.credentials,n=!!e.credentials,r;Object.defineProperty(e,`credentials`,{set(i){i&&i!==t&&i!==r&&(n=!0),t=i;let a=av(e,iv(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}));if(n&&!a.attributed){let e=typeof t==`object`&&!!t;r=async t=>{let n=await a(t);return e&&(!n.$source||Object.keys(n.$source).length===0)?Xg(n,`CREDENTIALS_CODE`,`e`):n},r.memoized=a.memoized,r.configBound=a.configBound,r.attributed=!0}else r=a},get(){return r},enumerable:!0,configurable:!0}),e.credentials=t;let{signingEscapePath:i=!0,systemClockOffset:a=e.systemClockOffset||0,sha256:o}=e,s;return s=e.signer?rf(e.signer):e.regionInfoProvider?()=>rf(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{let{signingRegion:r,signingService:a}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||a||e.serviceId;let s={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||ov.SignatureV4)(s)}):async t=>{t=Object.assign({},{name:`sigv4`,signingName:e.signingName||e.defaultSigningName,signingRegion:await rf(e.region)(),properties:{}},t);let n=t.signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;let a={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||ov.SignatureV4)(a)},Object.assign(e,{systemClockOffset:a,signingEscapePath:i,signer:s})},cv=sv})),uv=l((()=>{V_(),W_(),Q_(),nv(),lv()})),dv=d({AWSSDKSigV4Signer:()=>B_,AwsSdkSigV4ASigner:()=>U_,AwsSdkSigV4Signer:()=>z_,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:()=>Z_,NODE_SIGV4A_CONFIG_OPTIONS:()=>tv,getBearerTokenEnvKey:()=>q_,resolveAWSSDKSigV4Config:()=>cv,resolveAwsSdkSigV4AConfig:()=>ev,resolveAwsSdkSigV4Config:()=>sv,validateSigningProperties:()=>R_}),fv=l((()=>{uv(),J_()})),pv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveHttpAuthSchemeConfig=e.defaultLambdaHttpAuthSchemeProvider=e.defaultLambdaHttpAuthSchemeParametersProvider=void 0;let t=(fv(),m(dv)),n=Nd();e.defaultLambdaHttpAuthSchemeParametersProvider=async(e,t,r)=>({operation:(0,n.getSmithyContext)(t).operation,region:await(0,n.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function r(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`lambda`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}e.defaultLambdaHttpAuthSchemeProvider=e=>{let t=[];switch(e.operation){default:t.push(r(e))}return t},e.resolveHttpAuthSchemeConfig=e=>{let r=(0,t.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,n.normalizeProvider)(e.authSchemePreference??[])})}})),mv=u(((e,t)=>{t.exports={name:`@aws-sdk/client-lambda`,description:`AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native`,version:`3.1023.0`,scripts:{build:`concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs`,"build:cjs":`node ../../scripts/compilation/inline client-lambda`,"build:es":`tsc -p tsconfig.es.json`,"build:include:deps":`yarn g:turbo run build -F="$npm_package_name"`,"build:types":`tsc -p tsconfig.types.json`,"build:types:downlevel":`downlevel-dts dist-types dist-types/ts3.4`,clean:`premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo`,"extract:docs":`api-extractor run --local`,"generate:client":`node ../../scripts/generate-clients/single-service --solo lambda`,"test:e2e":`yarn g:vitest run -c vitest.config.e2e.mts --mode development`,"test:e2e:watch":`yarn g:vitest watch -c vitest.config.e2e.mts`,"test:index":`tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs`},main:`./dist-cjs/index.js`,types:`./dist-types/index.d.ts`,module:`./dist-es/index.js`,sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":`5.2.0`,"@aws-crypto/sha256-js":`5.2.0`,"@aws-sdk/core":`^3.973.26`,"@aws-sdk/credential-provider-node":`^3.972.29`,"@aws-sdk/middleware-host-header":`^3.972.8`,"@aws-sdk/middleware-logger":`^3.972.8`,"@aws-sdk/middleware-recursion-detection":`^3.972.9`,"@aws-sdk/middleware-user-agent":`^3.972.28`,"@aws-sdk/region-config-resolver":`^3.972.10`,"@aws-sdk/types":`^3.973.6`,"@aws-sdk/util-endpoints":`^3.996.5`,"@aws-sdk/util-user-agent-browser":`^3.972.8`,"@aws-sdk/util-user-agent-node":`^3.973.14`,"@smithy/config-resolver":`^4.4.13`,"@smithy/core":`^3.23.13`,"@smithy/eventstream-serde-browser":`^4.2.12`,"@smithy/eventstream-serde-config-resolver":`^4.3.12`,"@smithy/eventstream-serde-node":`^4.2.12`,"@smithy/fetch-http-handler":`^5.3.15`,"@smithy/hash-node":`^4.2.12`,"@smithy/invalid-dependency":`^4.2.12`,"@smithy/middleware-content-length":`^4.2.12`,"@smithy/middleware-endpoint":`^4.4.28`,"@smithy/middleware-retry":`^4.4.46`,"@smithy/middleware-serde":`^4.2.16`,"@smithy/middleware-stack":`^4.2.12`,"@smithy/node-config-provider":`^4.3.12`,"@smithy/node-http-handler":`^4.5.1`,"@smithy/protocol-http":`^5.3.12`,"@smithy/smithy-client":`^4.12.8`,"@smithy/types":`^4.13.1`,"@smithy/url-parser":`^4.2.12`,"@smithy/util-base64":`^4.3.2`,"@smithy/util-body-length-browser":`^4.2.2`,"@smithy/util-body-length-node":`^4.2.3`,"@smithy/util-defaults-mode-browser":`^4.3.44`,"@smithy/util-defaults-mode-node":`^4.2.48`,"@smithy/util-endpoints":`^3.3.3`,"@smithy/util-middleware":`^4.2.12`,"@smithy/util-retry":`^4.2.13`,"@smithy/util-stream":`^4.5.21`,"@smithy/util-utf8":`^4.2.2`,"@smithy/util-waiter":`^4.2.14`,tslib:`^2.6.2`},devDependencies:{"@tsconfig/node20":`20.1.8`,"@types/node":`^20.14.8`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,premove:`4.0.0`,typescript:`~5.8.3`},engines:{node:`>=20.0.0`},typesVersions:{"<4.5":{"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-lambda`,repository:{type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-lambda`}}})),hv=u((e=>{var t=(r_(),m(n_)),n=d_();let r=`AWS_ACCESS_KEY_ID`,i=`AWS_SECRET_ACCESS_KEY`,a=`AWS_SESSION_TOKEN`,o=`AWS_CREDENTIAL_EXPIRATION`,s=`AWS_CREDENTIAL_SCOPE`,c=`AWS_ACCOUNT_ID`;e.ENV_ACCOUNT_ID=c,e.ENV_CREDENTIAL_SCOPE=s,e.ENV_EXPIRATION=o,e.ENV_KEY=r,e.ENV_SECRET=i,e.ENV_SESSION=a,e.fromEnv=e=>async()=>{e?.logger?.debug(`@aws-sdk/credential-provider-env - fromEnv`);let l=process.env[r],u=process.env[i],d=process.env[a],f=process.env[o],p=process.env[s],m=process.env[c];if(l&&u){let e={accessKeyId:l,secretAccessKey:u,...d&&{sessionToken:d},...f&&{expiration:new Date(f)},...p&&{credentialScope:p},...m&&{accountId:m}};return t.setCredentialFeature(e,`CREDENTIALS_ENV_VARS`,`g`),e}throw new n.CredentialsProviderError(`Unable to find environment variable credentials.`,{logger:e?.logger})}})),gv=u((e=>{var t=d_(),n=h(`url`),r=h(`buffer`),i=h(`http`),a=__(),o=$f();function s(e){return new Promise((n,a)=>{let o=i.request({method:`GET`,...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,`$1`)});o.on(`error`,e=>{a(Object.assign(new t.ProviderError(`Unable to connect to instance metadata service`),e)),o.destroy()}),o.on(`timeout`,()=>{a(new t.ProviderError(`TimeoutError from instance metadata service`)),o.destroy()}),o.on(`response`,e=>{let{statusCode:i=400}=e;(i<200||300<=i)&&(a(Object.assign(new t.ProviderError(`Error response received from instance metadata service`),{statusCode:i})),o.destroy());let s=[];e.on(`data`,e=>{s.push(e)}),e.on(`end`,()=>{n(r.Buffer.concat(s)),o.destroy()})}),o.end()})}let c=e=>!!e&&typeof e==`object`&&typeof e.AccessKeyId==`string`&&typeof e.SecretAccessKey==`string`&&typeof e.Token==`string`&&typeof e.Expiration==`string`,l=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}}),u=1e3,d=({maxRetries:e=0,timeout:t=u})=>({maxRetries:e,timeout:t}),f=(e,t)=>{let n=e();for(let r=0;r<t;r++)n=n.catch(e);return n},p=`AWS_CONTAINER_CREDENTIALS_FULL_URI`,m=`AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`,g=`AWS_CONTAINER_AUTHORIZATION_TOKEN`,_=(e={})=>{let{timeout:n,maxRetries:r}=d(e);return()=>f(async()=>{let r=await x({logger:e.logger}),i=JSON.parse(await v(n,r));if(!c(i))throw new t.CredentialsProviderError(`Invalid response received from instance metadata service.`,{logger:e.logger});return l(i)},r)},v=async(e,t)=>(process.env[g]&&(t.headers={...t.headers,Authorization:process.env[g]}),(await s({...t,timeout:e})).toString()),y={localhost:!0,"127.0.0.1":!0},b={"http:":!0,"https:":!0},x=async({logger:e})=>{if(process.env[m])return{hostname:`169.254.170.2`,path:process.env[m]};if(process.env[p]){let r=n.parse(process.env[p]);if(!r.hostname||!(r.hostname in y))throw new t.CredentialsProviderError(`${r.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!r.protocol||!(r.protocol in b))throw new t.CredentialsProviderError(`${r.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...r,port:r.port?parseInt(r.port,10):void 0}}throw new t.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${m} or ${p} environment variable is set`,{tryNextLink:!1,logger:e})};var S=class e extends t.CredentialsProviderError{tryNextLink;name=`InstanceMetadataV1FallbackError`;constructor(t,n=!0){super(t,n),this.tryNextLink=n,Object.setPrototypeOf(this,e.prototype)}};e.Endpoint=void 0,(function(e){e.IPv4=`http://169.254.169.254`,e.IPv6=`http://[fd00:ec2::254]`})(e.Endpoint||={});let C={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var w;(function(e){e.IPv4=`IPv4`,e.IPv6=`IPv6`})(w||={});let ee={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:w.IPv4},te=async()=>o.parseUrl(await T()||await E()),T=async()=>a.loadConfig(C)(),E=async()=>{let t=await a.loadConfig(ee)();switch(t){case w.IPv4:return e.Endpoint.IPv4;case w.IPv6:return e.Endpoint.IPv6;default:throw Error(`Unsupported endpoint mode: ${t}. Select from ${Object.values(w)}`)}},ne=(e,t)=>{let n=300+Math.floor(Math.random()*300),r=new Date(Date.now()+n*1e3);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(r)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let i=e.originalExpiration??e.expiration;return{...e,...i?{originalExpiration:i}:{},expiration:r}},re=(e,t={})=>{let n=t?.logger||console,r;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=ne(t,n))}catch(e){if(r)n.warn(`Credential renew failed: `,e),t=ne(r,n);else throw e}return r=t,t}},ie=`/latest/meta-data/iam/security-credentials/`,ae=`AWS_EC2_METADATA_V1_DISABLED`,oe=`ec2_metadata_v1_disabled`,se=`x-aws-ec2-metadata-token`,ce=(e={})=>re(le(e),{logger:e.logger}),le=(e={})=>{let n=!1,{logger:r,profile:i}=e,{timeout:o,maxRetries:s}=d(e),c=async(r,o)=>{if(n||o.headers?.[se]==null){let n=!1,r=!1,o=await a.loadConfig({environmentVariableSelector:n=>{let i=n[ae];if(r=!!i&&i!==`false`,i===void 0)throw new t.CredentialsProviderError(`${ae} not set in env, checking config file next.`,{logger:e.logger});return r},configFileSelector:e=>{let t=e[oe];return n=!!t&&t!==`false`,n},default:!1},{profile:i})();if(e.ec2MetadataV1Disabled||o){let t=[];throw e.ec2MetadataV1Disabled&&t.push(`credential provider initialization (runtime option ec2MetadataV1Disabled)`),n&&t.push(`config file profile (${oe})`),r&&t.push(`process environment variable (${ae})`),new S(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${t.join(`, `)}].`)}}let s=(await f(async()=>{let e;try{e=await de(o)}catch(e){throw e.statusCode===401&&(n=!1),e}return e},r)).trim();return f(async()=>{let t;try{t=await fe(s,o,e)}catch(e){throw e.statusCode===401&&(n=!1),e}return t},r)};return async()=>{let e=await te();if(n)return r?.debug(`AWS SDK Instance Metadata`,`using v1 fallback (no token fetch)`),c(s,{...e,timeout:o});{let t;try{t=(await ue({...e,timeout:o})).toString()}catch(t){if(t?.statusCode===400)throw Object.assign(t,{message:`EC2 Metadata token request returned error`});return(t.message===`TimeoutError`||[403,404,405].includes(t.statusCode))&&(n=!0),r?.debug(`AWS SDK Instance Metadata`,`using v1 fallback (initial)`),c(s,{...e,timeout:o})}return c(s,{...e,headers:{[se]:t},timeout:o})}}},ue=async e=>s({...e,path:`/latest/api/token`,method:`PUT`,headers:{"x-aws-ec2-metadata-token-ttl-seconds":`21600`}}),de=async e=>(await s({...e,path:ie})).toString(),fe=async(e,n,r)=>{let i=JSON.parse((await s({...n,path:ie+e})).toString());if(!c(i))throw new t.CredentialsProviderError(`Invalid response received from instance metadata service.`,{logger:r.logger});return l(i)};e.DEFAULT_MAX_RETRIES=0,e.DEFAULT_TIMEOUT=u,e.ENV_CMDS_AUTH_TOKEN=g,e.ENV_CMDS_FULL_URI=p,e.ENV_CMDS_RELATIVE_URI=m,e.fromContainerMetadata=_,e.fromInstanceMetadata=ce,e.getInstanceMetadataEndpoint=te,e.httpRequest=s,e.providerConfigFromInit=d})),_v=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkUrl=void 0;let t=d_();e.checkUrl=(e,n)=>{if(e.protocol!==`https:`&&!(e.hostname===`169.254.170.2`||e.hostname===`169.254.170.23`||e.hostname===`[fd00:ec2::23]`)){if(e.hostname.includes(`[`)){if(e.hostname===`[::1]`||e.hostname===`[0000:0000:0000:0000:0000:0000:0000:0001]`)return}else{if(e.hostname===`localhost`)return;let t=e.hostname.split(`.`),n=e=>{let t=parseInt(e,10);return 0<=t&&t<=255};if(t[0]===`127`&&n(t[1])&&n(t[2])&&n(t[3])&&t.length===4)return}throw new t.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
58
|
+
`);return this.signString(p,{signingDate:r,signingRegion:s,signingService:o})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:r}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:r,priorSignature:e.priorSignature}).then(t=>({message:e.message,signature:t}))}async signString(e,{signingDate:r=new Date,signingRegion:i,signingService:a}={}){let o=await this.credentialProvider();this.validateResolvedCredentials(o);let s=i??await this.regionProvider(),{shortDate:c}=this.formatDate(r),l=new this.sha256(await this.getSigningKey(o,s,c,a));return l.update(n.toUint8Array(e)),t.toHex(await l.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:r,signingRegion:i,signingService:a}={}){let o=await this.credentialProvider();this.validateResolvedCredentials(o);let l=i??await this.regionProvider(),d=ne(e),{longDate:f,shortDate:p}=this.formatDate(t),h=v(p,l,a??this.service);d.headers[c]=f,o.sessionToken&&(d.headers[`x-amz-security-token`]=o.sessionToken);let g=await S(d,this.sha256);!T(u,d.headers)&&this.applyChecksum&&(d.headers[u]=g);let _=x(d,r,n),y=await this.getSignature(f,h,this.getSigningKey(o,l,p,a),this.createCanonicalRequest(d,_,g));return d.headers[s]=`${m} Credential=${o.accessKeyId}/${h}, SignedHeaders=${this.getCanonicalHeaderList(_)}, Signature=${y}`,d}async getSignature(e,r,i,a){let o=await this.createStringToSign(e,r,a,m),s=new this.sha256(await i);return s.update(n.toUint8Array(o)),t.toHex(await s.digest())}getSigningKey(e,t,n,r){return y(this.sha256,e,n,t,r||this.service)}}}));function av(e,{credentials:t,credentialDefaultProvider:n}){let r;return r=t?t?.memoized?t:Vg(t,zg,Bg):n?af(n(Object.assign({},e,{parentClientConfig:e}))):async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},r.memoized=!0,r}function ov(e,t){if(t.configBound)return t;let n=async n=>t({...n,callerClientConfig:e});return n.memoized=t.memoized,n.configBound=!0,n}var sv,cv,lv,uv=l((()=>{i_(),Gg(),sv=iv(),cv=e=>{let t=e.credentials,n=!!e.credentials,r;Object.defineProperty(e,`credentials`,{set(i){i&&i!==t&&i!==r&&(n=!0),t=i;let a=ov(e,av(e,{credentials:t,credentialDefaultProvider:e.credentialDefaultProvider}));if(n&&!a.attributed){let e=typeof t==`object`&&!!t;r=async t=>{let n=await a(t);return e&&(!n.$source||Object.keys(n.$source).length===0)?Zg(n,`CREDENTIALS_CODE`,`e`):n},r.memoized=a.memoized,r.configBound=a.configBound,r.attributed=!0}else r=a},get(){return r},enumerable:!0,configurable:!0}),e.credentials=t;let{signingEscapePath:i=!0,systemClockOffset:a=e.systemClockOffset||0,sha256:o}=e,s;return s=e.signer?af(e.signer):e.regionInfoProvider?()=>af(e.region)().then(async t=>[await e.regionInfoProvider(t,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},t]).then(([t,n])=>{let{signingRegion:r,signingService:a}=t;e.signingRegion=e.signingRegion||r||n,e.signingName=e.signingName||a||e.serviceId;let s={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||sv.SignatureV4)(s)}):async t=>{t=Object.assign({},{name:`sigv4`,signingName:e.signingName||e.defaultSigningName,signingRegion:await af(e.region)(),properties:{}},t);let n=t.signingRegion,r=t.signingName;e.signingRegion=e.signingRegion||n,e.signingName=e.signingName||r||e.serviceId;let a={...e,credentials:e.credentials,region:e.signingRegion,service:e.signingName,sha256:o,uriEscapePath:i};return new(e.signerConstructor||sv.SignatureV4)(a)},Object.assign(e,{systemClockOffset:a,signingEscapePath:i,signer:s})},lv=cv})),dv=l((()=>{H_(),G_(),$_(),rv(),uv()})),fv=d({AWSSDKSigV4Signer:()=>V_,AwsSdkSigV4ASigner:()=>W_,AwsSdkSigV4Signer:()=>B_,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:()=>Q_,NODE_SIGV4A_CONFIG_OPTIONS:()=>nv,getBearerTokenEnvKey:()=>J_,resolveAWSSDKSigV4Config:()=>lv,resolveAwsSdkSigV4AConfig:()=>tv,resolveAwsSdkSigV4Config:()=>cv,validateSigningProperties:()=>z_}),pv=l((()=>{dv(),Y_()})),mv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.resolveHttpAuthSchemeConfig=e.defaultLambdaHttpAuthSchemeProvider=e.defaultLambdaHttpAuthSchemeParametersProvider=void 0;let t=(pv(),m(fv)),n=Pd();e.defaultLambdaHttpAuthSchemeParametersProvider=async(e,t,r)=>({operation:(0,n.getSmithyContext)(t).operation,region:await(0,n.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function r(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`lambda`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}e.defaultLambdaHttpAuthSchemeProvider=e=>{let t=[];switch(e.operation){default:t.push(r(e))}return t},e.resolveHttpAuthSchemeConfig=e=>{let r=(0,t.resolveAwsSdkSigV4Config)(e);return Object.assign(r,{authSchemePreference:(0,n.normalizeProvider)(e.authSchemePreference??[])})}})),hv=u(((e,t)=>{t.exports={name:`@aws-sdk/client-lambda`,description:`AWS SDK for JavaScript Lambda Client for Node.js, Browser and React Native`,version:`3.1023.0`,scripts:{build:`concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs`,"build:cjs":`node ../../scripts/compilation/inline client-lambda`,"build:es":`tsc -p tsconfig.es.json`,"build:include:deps":`yarn g:turbo run build -F="$npm_package_name"`,"build:types":`tsc -p tsconfig.types.json`,"build:types:downlevel":`downlevel-dts dist-types dist-types/ts3.4`,clean:`premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo`,"extract:docs":`api-extractor run --local`,"generate:client":`node ../../scripts/generate-clients/single-service --solo lambda`,"test:e2e":`yarn g:vitest run -c vitest.config.e2e.mts --mode development`,"test:e2e:watch":`yarn g:vitest watch -c vitest.config.e2e.mts`,"test:index":`tsc --noEmit ./test/index-types.ts && node ./test/index-objects.spec.mjs`},main:`./dist-cjs/index.js`,types:`./dist-types/index.d.ts`,module:`./dist-es/index.js`,sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":`5.2.0`,"@aws-crypto/sha256-js":`5.2.0`,"@aws-sdk/core":`^3.973.26`,"@aws-sdk/credential-provider-node":`^3.972.29`,"@aws-sdk/middleware-host-header":`^3.972.8`,"@aws-sdk/middleware-logger":`^3.972.8`,"@aws-sdk/middleware-recursion-detection":`^3.972.9`,"@aws-sdk/middleware-user-agent":`^3.972.28`,"@aws-sdk/region-config-resolver":`^3.972.10`,"@aws-sdk/types":`^3.973.6`,"@aws-sdk/util-endpoints":`^3.996.5`,"@aws-sdk/util-user-agent-browser":`^3.972.8`,"@aws-sdk/util-user-agent-node":`^3.973.14`,"@smithy/config-resolver":`^4.4.13`,"@smithy/core":`^3.23.13`,"@smithy/eventstream-serde-browser":`^4.2.12`,"@smithy/eventstream-serde-config-resolver":`^4.3.12`,"@smithy/eventstream-serde-node":`^4.2.12`,"@smithy/fetch-http-handler":`^5.3.15`,"@smithy/hash-node":`^4.2.12`,"@smithy/invalid-dependency":`^4.2.12`,"@smithy/middleware-content-length":`^4.2.12`,"@smithy/middleware-endpoint":`^4.4.28`,"@smithy/middleware-retry":`^4.4.46`,"@smithy/middleware-serde":`^4.2.16`,"@smithy/middleware-stack":`^4.2.12`,"@smithy/node-config-provider":`^4.3.12`,"@smithy/node-http-handler":`^4.5.1`,"@smithy/protocol-http":`^5.3.12`,"@smithy/smithy-client":`^4.12.8`,"@smithy/types":`^4.13.1`,"@smithy/url-parser":`^4.2.12`,"@smithy/util-base64":`^4.3.2`,"@smithy/util-body-length-browser":`^4.2.2`,"@smithy/util-body-length-node":`^4.2.3`,"@smithy/util-defaults-mode-browser":`^4.3.44`,"@smithy/util-defaults-mode-node":`^4.2.48`,"@smithy/util-endpoints":`^3.3.3`,"@smithy/util-middleware":`^4.2.12`,"@smithy/util-retry":`^4.2.13`,"@smithy/util-stream":`^4.5.21`,"@smithy/util-utf8":`^4.2.2`,"@smithy/util-waiter":`^4.2.14`,tslib:`^2.6.2`},devDependencies:{"@tsconfig/node20":`20.1.8`,"@types/node":`^20.14.8`,concurrently:`7.0.0`,"downlevel-dts":`0.10.1`,premove:`4.0.0`,typescript:`~5.8.3`},engines:{node:`>=20.0.0`},typesVersions:{"<4.5":{"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-lambda`,repository:{type:`git`,url:`https://github.com/aws/aws-sdk-js-v3.git`,directory:`clients/client-lambda`}}})),gv=u((e=>{var t=(i_(),m(r_)),n=f_();let r=`AWS_ACCESS_KEY_ID`,i=`AWS_SECRET_ACCESS_KEY`,a=`AWS_SESSION_TOKEN`,o=`AWS_CREDENTIAL_EXPIRATION`,s=`AWS_CREDENTIAL_SCOPE`,c=`AWS_ACCOUNT_ID`;e.ENV_ACCOUNT_ID=c,e.ENV_CREDENTIAL_SCOPE=s,e.ENV_EXPIRATION=o,e.ENV_KEY=r,e.ENV_SECRET=i,e.ENV_SESSION=a,e.fromEnv=e=>async()=>{e?.logger?.debug(`@aws-sdk/credential-provider-env - fromEnv`);let l=process.env[r],u=process.env[i],d=process.env[a],f=process.env[o],p=process.env[s],m=process.env[c];if(l&&u){let e={accessKeyId:l,secretAccessKey:u,...d&&{sessionToken:d},...f&&{expiration:new Date(f)},...p&&{credentialScope:p},...m&&{accountId:m}};return t.setCredentialFeature(e,`CREDENTIALS_ENV_VARS`,`g`),e}throw new n.CredentialsProviderError(`Unable to find environment variable credentials.`,{logger:e?.logger})}})),_v=u((e=>{var t=f_(),n=h(`url`),r=h(`buffer`),i=h(`http`),a=v_(),o=ep();function s(e){return new Promise((n,a)=>{let o=i.request({method:`GET`,...e,hostname:e.hostname?.replace(/^\[(.+)\]$/,`$1`)});o.on(`error`,e=>{a(Object.assign(new t.ProviderError(`Unable to connect to instance metadata service`),e)),o.destroy()}),o.on(`timeout`,()=>{a(new t.ProviderError(`TimeoutError from instance metadata service`)),o.destroy()}),o.on(`response`,e=>{let{statusCode:i=400}=e;(i<200||300<=i)&&(a(Object.assign(new t.ProviderError(`Error response received from instance metadata service`),{statusCode:i})),o.destroy());let s=[];e.on(`data`,e=>{s.push(e)}),e.on(`end`,()=>{n(r.Buffer.concat(s)),o.destroy()})}),o.end()})}let c=e=>!!e&&typeof e==`object`&&typeof e.AccessKeyId==`string`&&typeof e.SecretAccessKey==`string`&&typeof e.Token==`string`&&typeof e.Expiration==`string`,l=e=>({accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:new Date(e.Expiration),...e.AccountId&&{accountId:e.AccountId}}),u=1e3,d=({maxRetries:e=0,timeout:t=u})=>({maxRetries:e,timeout:t}),f=(e,t)=>{let n=e();for(let r=0;r<t;r++)n=n.catch(e);return n},p=`AWS_CONTAINER_CREDENTIALS_FULL_URI`,m=`AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`,g=`AWS_CONTAINER_AUTHORIZATION_TOKEN`,_=(e={})=>{let{timeout:n,maxRetries:r}=d(e);return()=>f(async()=>{let r=await x({logger:e.logger}),i=JSON.parse(await v(n,r));if(!c(i))throw new t.CredentialsProviderError(`Invalid response received from instance metadata service.`,{logger:e.logger});return l(i)},r)},v=async(e,t)=>(process.env[g]&&(t.headers={...t.headers,Authorization:process.env[g]}),(await s({...t,timeout:e})).toString()),y={localhost:!0,"127.0.0.1":!0},b={"http:":!0,"https:":!0},x=async({logger:e})=>{if(process.env[m])return{hostname:`169.254.170.2`,path:process.env[m]};if(process.env[p]){let r=n.parse(process.env[p]);if(!r.hostname||!(r.hostname in y))throw new t.CredentialsProviderError(`${r.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:e});if(!r.protocol||!(r.protocol in b))throw new t.CredentialsProviderError(`${r.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:e});return{...r,port:r.port?parseInt(r.port,10):void 0}}throw new t.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${m} or ${p} environment variable is set`,{tryNextLink:!1,logger:e})};var S=class e extends t.CredentialsProviderError{tryNextLink;name=`InstanceMetadataV1FallbackError`;constructor(t,n=!0){super(t,n),this.tryNextLink=n,Object.setPrototypeOf(this,e.prototype)}};e.Endpoint=void 0,(function(e){e.IPv4=`http://169.254.169.254`,e.IPv6=`http://[fd00:ec2::254]`})(e.Endpoint||={});let C={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:e=>e.ec2_metadata_service_endpoint,default:void 0};var w;(function(e){e.IPv4=`IPv4`,e.IPv6=`IPv6`})(w||={});let ee={environmentVariableSelector:e=>e.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE,configFileSelector:e=>e.ec2_metadata_service_endpoint_mode,default:w.IPv4},te=async()=>o.parseUrl(await T()||await E()),T=async()=>a.loadConfig(C)(),E=async()=>{let t=await a.loadConfig(ee)();switch(t){case w.IPv4:return e.Endpoint.IPv4;case w.IPv6:return e.Endpoint.IPv6;default:throw Error(`Unsupported endpoint mode: ${t}. Select from ${Object.values(w)}`)}},ne=(e,t)=>{let n=300+Math.floor(Math.random()*300),r=new Date(Date.now()+n*1e3);t.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(r)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);let i=e.originalExpiration??e.expiration;return{...e,...i?{originalExpiration:i}:{},expiration:r}},re=(e,t={})=>{let n=t?.logger||console,r;return async()=>{let t;try{t=await e(),t.expiration&&t.expiration.getTime()<Date.now()&&(t=ne(t,n))}catch(e){if(r)n.warn(`Credential renew failed: `,e),t=ne(r,n);else throw e}return r=t,t}},ie=`/latest/meta-data/iam/security-credentials/`,ae=`AWS_EC2_METADATA_V1_DISABLED`,oe=`ec2_metadata_v1_disabled`,se=`x-aws-ec2-metadata-token`,ce=(e={})=>re(le(e),{logger:e.logger}),le=(e={})=>{let n=!1,{logger:r,profile:i}=e,{timeout:o,maxRetries:s}=d(e),c=async(r,o)=>{if(n||o.headers?.[se]==null){let n=!1,r=!1,o=await a.loadConfig({environmentVariableSelector:n=>{let i=n[ae];if(r=!!i&&i!==`false`,i===void 0)throw new t.CredentialsProviderError(`${ae} not set in env, checking config file next.`,{logger:e.logger});return r},configFileSelector:e=>{let t=e[oe];return n=!!t&&t!==`false`,n},default:!1},{profile:i})();if(e.ec2MetadataV1Disabled||o){let t=[];throw e.ec2MetadataV1Disabled&&t.push(`credential provider initialization (runtime option ec2MetadataV1Disabled)`),n&&t.push(`config file profile (${oe})`),r&&t.push(`process environment variable (${ae})`),new S(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${t.join(`, `)}].`)}}let s=(await f(async()=>{let e;try{e=await de(o)}catch(e){throw e.statusCode===401&&(n=!1),e}return e},r)).trim();return f(async()=>{let t;try{t=await fe(s,o,e)}catch(e){throw e.statusCode===401&&(n=!1),e}return t},r)};return async()=>{let e=await te();if(n)return r?.debug(`AWS SDK Instance Metadata`,`using v1 fallback (no token fetch)`),c(s,{...e,timeout:o});{let t;try{t=(await ue({...e,timeout:o})).toString()}catch(t){if(t?.statusCode===400)throw Object.assign(t,{message:`EC2 Metadata token request returned error`});return(t.message===`TimeoutError`||[403,404,405].includes(t.statusCode))&&(n=!0),r?.debug(`AWS SDK Instance Metadata`,`using v1 fallback (initial)`),c(s,{...e,timeout:o})}return c(s,{...e,headers:{[se]:t},timeout:o})}}},ue=async e=>s({...e,path:`/latest/api/token`,method:`PUT`,headers:{"x-aws-ec2-metadata-token-ttl-seconds":`21600`}}),de=async e=>(await s({...e,path:ie})).toString(),fe=async(e,n,r)=>{let i=JSON.parse((await s({...n,path:ie+e})).toString());if(!c(i))throw new t.CredentialsProviderError(`Invalid response received from instance metadata service.`,{logger:r.logger});return l(i)};e.DEFAULT_MAX_RETRIES=0,e.DEFAULT_TIMEOUT=u,e.ENV_CMDS_AUTH_TOKEN=g,e.ENV_CMDS_FULL_URI=p,e.ENV_CMDS_RELATIVE_URI=m,e.fromContainerMetadata=_,e.fromInstanceMetadata=ce,e.getInstanceMetadataEndpoint=te,e.httpRequest=s,e.providerConfigFromInit=d})),vv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.checkUrl=void 0;let t=f_();e.checkUrl=(e,n)=>{if(e.protocol!==`https:`&&!(e.hostname===`169.254.170.2`||e.hostname===`169.254.170.23`||e.hostname===`[fd00:ec2::23]`)){if(e.hostname.includes(`[`)){if(e.hostname===`[::1]`||e.hostname===`[0000:0000:0000:0000:0000:0000:0000:0001]`)return}else{if(e.hostname===`localhost`)return;let t=e.hostname.split(`.`),n=e=>{let t=parseInt(e,10);return 0<=t&&t<=255};if(t[0]===`127`&&n(t[1])&&n(t[2])&&n(t[3])&&t.length===4)return}throw new t.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
59
59
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
60
60
|
- ECS container host 169.254.170.2
|
|
61
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:n})}}})),
|
|
62
|
-
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let m=new URL(t);(0,o.checkUrl)(m,e.logger);let h=r.NodeHttpHandler.create({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return(0,c.retryWrapper)(async()=>{let t=(0,s.createGetRequest)(m);d?t.headers.Authorization=d:f&&(t.headers.Authorization=(await a.default.readFile(f)).toString());try{let e=await h.handle(t);return(0,s.getCredentials)(e.response).then(e=>(0,n.setCredentialFeature)(e,`CREDENTIALS_HTTP`,`z`))}catch(t){throw new i.CredentialsProviderError(String(t),{logger:e.logger})}},e.maxRetries??3,e.timeout??1e3)}})),xv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHttp=void 0;var t=bv();Object.defineProperty(e,`fromHttp`,{enumerable:!0,get:function(){return t.fromHttp}})}));function Sv(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sso-oauth`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Cv(e){return{schemeId:`smithy.api#noAuth`}}var wv,Tv,Ev,Dv,Ov=l((()=>{fv(),wv=Nd(),Tv=async(e,t,n)=>({operation:(0,wv.getSmithyContext)(t).operation,region:await(0,wv.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Ev=e=>{let t=[];switch(e.operation){case`CreateToken`:t.push(Cv(e));break;default:t.push(Sv(e))}return t},Dv=e=>{let t=sv(e);return Object.assign(t,{authSchemePreference:(0,wv.normalizeProvider)(e.authSchemePreference??[])})}})),kv,Av,jv=l((()=>{kv=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`sso-oauth`}),Av={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),Mv=`3.996.18`,Nv=u((e=>{var t=h(`node:os`),n=h(`node:process`),r=s_(),i=h(`node:fs/promises`),a=h(`node:path`),o=o_();let s=()=>{for(let e of[`deno`,`bun`,`llrt`])if(n.versions[e])return[`md/${e}`,n.versions[e]];return[`md/nodejs`,n.versions.node]},c=e=>{let t=process.cwd();if(!e)return[t];let n=a.normalize(e),r=n.split(a.sep),i=r.indexOf(`node_modules`),o=i===-1?n:r.slice(0,i).join(a.sep);return t===o?[t]:[o,t]},l=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,u=(e=``)=>{let t=e.match(l);if(!t)return;let[n,r,i,a]=[t[1],t[2],t[3],t[4]];return a?`${n}.${r}.${i}-${a}`:`${n}.${r}.${i}`},d=[`^`,`~`,`>=`,`<=`,`>`,`<`],f=[`latest`,`beta`,`dev`,`rc`,`insiders`,`next`],p=(e=``)=>{if(f.includes(e))return e;let t=d.find(t=>e.startsWith(t))??``,n=u(e.slice(t.length));if(n)return`${t}${n}`},m,g=a.join(`node_modules`,`typescript`,`package.json`),_=async()=>{if(m===null)return;if(typeof m==`string`)return[`md/tsc`,m];let e=!1;try{e=r.booleanSelector(process.env,`AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED`,r.SelectorType.ENV)||!1}catch{}if(e){m=null;return}let t=c(typeof __dirname<`u`?__dirname:void 0),n;for(let e of t)try{let t=a.join(e,`package.json`),r=await i.readFile(t,`utf-8`),{dependencies:o,devDependencies:s}=JSON.parse(r),c=s?.typescript??o?.typescript;if(typeof c!=`string`)continue;n=c;break}catch{}if(!n){m=null;return}let o;for(let e of t)try{let t=a.join(e,g),n=await i.readFile(t,`utf-8`),{version:r}=JSON.parse(n),s=u(r);if(typeof s!=`string`)continue;o=s;break}catch{}if(o)return m=o,[`md/tsc`,m];let s=p(n);if(typeof s!=`string`){m=null;return}return m=`dev_${s}`,[`md/tsc`,m]},v={isCrtAvailable:!1},y=()=>v.isCrtAvailable?[`md/crt-avail`]:null,b=({serviceId:e,clientVersion:r})=>{let i=s();return async a=>{let o=[[`aws-sdk-js`,r],[`ua`,`2.1`],[`os/${t.platform()}`,t.release()],[`lang/js`],i],s=await _();s&&o.push(s);let c=y();c&&o.push(c),e&&o.push([`api/${e}`,r]),n.env.AWS_EXECUTION_ENV&&o.push([`exec-env/${n.env.AWS_EXECUTION_ENV}`]);let l=await a?.userAgentAppId?.();return l?[...o,[`app/${l}`]]:[...o]}},x=b,S=`AWS_SDK_UA_APP_ID`,C=`sdk_ua_app_id`;e.NODE_APP_ID_CONFIG_OPTIONS={environmentVariableSelector:e=>e[S],configFileSelector:e=>e[C]??e[`sdk-ua-app-id`],default:o.DEFAULT_UA_APP_ID},e.UA_APP_ID_ENV_NAME=S,e.UA_APP_ID_INI_NAME=C,e.createDefaultUserAgentProvider=b,e.crtAvailability=v,e.defaultUserAgent=x})),Pv=u((e=>{var t=df(),n=pf(),r=h(`buffer`),i=h(`crypto`),a=class{algorithmIdentifier;secret;hash;constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(n.toUint8Array(o(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?i.createHmac(this.algorithmIdentifier,o(this.secret)):i.createHash(this.algorithmIdentifier)}};function o(e,n){return r.Buffer.isBuffer(e)?e:typeof e==`string`?t.fromString(e,n):ArrayBuffer.isView(e)?t.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength):t.fromArrayBuffer(e)}e.Hash=a})),Fv=u((e=>{var t=h(`node:fs`);e.calculateBodyLength=e=>{if(!e)return 0;if(typeof e==`string`)return Buffer.byteLength(e);if(typeof e.byteLength==`number`)return e.byteLength;if(typeof e.size==`number`)return e.size;if(typeof e.start==`number`&&typeof e.end==`number`)return e.end+1-e.start;if(e instanceof t.ReadStream){if(e.path!=null)return t.lstatSync(e.path).size;if(typeof e.fd==`number`)return t.fstatSync(e.fd).size}throw Error(`Body Length computation failed for ${e}`)}})),Iv=u((e=>{var t=c_(),n=__(),r=d_();let i=`AWS_REGION`,a=`AWS_DEFAULT_REGION`,o=[`in-region`,`cross-region`,`mobile`,`standard`,`legacy`],s={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:`legacy`},c=({region:e=n.loadConfig(t.NODE_REGION_CONFIG_OPTIONS),defaultsMode:i=n.loadConfig(s)}={})=>r.memoize(async()=>{let t=typeof i==`function`?await i():i;switch(t?.toLowerCase()){case`auto`:return l(e);case`in-region`:case`cross-region`:case`mobile`:case`standard`:case`legacy`:return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve(`legacy`);default:throw Error(`Invalid parameter for "defaultsMode", expect ${o.join(`, `)}, got ${t}`)}}),l=async e=>{if(e){let t=typeof e==`function`?await e():e,n=await u();return n?t===n?`in-region`:`cross-region`:`standard`}return`standard`},u=async()=>{if(process.env.AWS_EXECUTION_ENV&&(process.env[i]||process.env[a]))return process.env[i]??process.env[a];if(!process.env.AWS_EC2_METADATA_DISABLED)try{let{getInstanceMetadataEndpoint:e,httpRequest:t}=await Promise.resolve().then(()=>p(gv()));return(await t({...await e(),path:`/latest/meta-data/placement/region`})).toString()}catch{}};e.resolveDefaultsModeConfig=c}));function Lv(e){return typeof Buffer<`u`?Buffer.alloc(e):new Uint8Array(e)}function Rv(e){return e[ny]=!0,e}var zv,Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry=l((()=>{zv=0,Bv=1,Vv=2,Hv=3,Uv=4,Wv=5,Gv=6,Kv=7,qv=20,Jv=21,Yv=22,Xv=23,Zv=24,Qv=25,$v=26,ey=27,ty=31,ny=Symbol(`@smithy/core/cbor::tagSymbol`)}));function iy(e){Cy=e,wy=new DataView(Cy.buffer,Cy.byteOffset,Cy.byteLength)}function ay(e,t){if(e>=t)throw Error(`unexpected end of (decode) payload.`);let n=(Cy[e]&224)>>5,r=Cy[e]&31;switch(n){case zv:case Bv:case Gv:let i,a;if(r<24)i=r,a=1;else switch(r){case Zv:case Qv:case $v:case ey:let n=Dy[r],o=n+1;if(a=o,t-e<o)throw Error(`countLength ${n} greater than remaining buf len.`);let s=e+1;i=n===1?Cy[s]:n===2?wy.getUint16(s):n===4?wy.getUint32(s):wy.getBigUint64(s);break;default:throw Error(`unexpected minor value ${r}.`)}if(n===zv)return Ey=a,yy(i);if(n===Bv){let e;return e=typeof i==`bigint`?BigInt(-1)-i:-1-i,Ey=a,yy(e)}else if(r===2||r===3){let n=ly(e+a,t),i=BigInt(0),o=e+a+Ey;for(let e=o;e<o+n;++e)i=i<<BigInt(8)|BigInt(Cy[e]);return Ey=a+Ey+n,r===3?-i-BigInt(1):i}else if(r===4){let[n,r]=ay(e+a,t),i=r<0?-1:1,o=`0`.repeat(Math.abs(n)+1)+String(BigInt(i)*BigInt(r)),s,c=r<0?`-`:``;return s=n===0?o:o.slice(0,o.length+n)+`.`+o.slice(n),s=s.replace(/^0+/g,``),s===``&&(s=`0`),s[0]===`.`&&(s=`0`+s),s=c+s,Ey=a+Ey,Ah(s)}else{let n=ay(e+a,t);return Ey=a+Ey,Rv({tag:yy(i),value:n})}case Hv:case Wv:case Uv:case Vv:if(r===ty)switch(n){case Hv:return dy(e,t);case Wv:return _y(e,t);case Uv:return hy(e,t);case Vv:return py(e,t)}else switch(n){case Hv:return uy(e,t);case Wv:return gy(e,t);case Uv:return my(e,t);case Vv:return fy(e,t)}default:return vy(e,t)}}function oy(e,t,n){return Sy&&e.constructor?.name===`Buffer`?e.toString(`utf-8`,t,n):Ty?Ty.decode(e.subarray(t,n)):(0,by.toUtf8)(e.subarray(t,n))}function sy(e){let t=Number(e);return(t<-(2**53-1)||2**53-1<t)&&console.warn(Error(`@smithy/core/cbor - truncating BigInt(${e}) to ${t} with loss of precision.`)),t}function cy(e,t){let n=e>>7,r=(e&124)>>2,i=(e&3)<<8|t,a=n===0?1:-1,o,s;if(r===0){if(i===0)return 0;o=2**-14,s=0}else if(r===31)return i===0?a*(1/0):NaN;else o=2**(r-15),s=1;return s+=i/1024,o*s*a}function ly(e,t){let n=Cy[e]&31;if(n<24)return Ey=1,n;if(n===Zv||n===Qv||n===$v||n===ey){let r=Dy[n];if(Ey=r+1,t-e<Ey)throw Error(`countLength ${r} greater than remaining buf len.`);let i=e+1;return r===1?Cy[i]:r===2?wy.getUint16(i):r===4?wy.getUint32(i):sy(wy.getBigUint64(i))}throw Error(`unexpected minor value ${n}.`)}function uy(e,t){let n=ly(e,t),r=Ey;if(e+=r,t-e<n)throw Error(`string len ${n} greater than remaining buf len.`);let i=oy(Cy,e,e+n);return Ey=r+n,i}function dy(e,t){e+=1;let n=[];for(let r=e;e<t;){if(Cy[e]===255){let t=Lv(n.length);return t.set(n,0),Ey=e-r+2,oy(t,0,t.length)}let i=(Cy[e]&224)>>5,a=Cy[e]&31;if(i!==Hv)throw Error(`unexpected major type ${i} in indefinite string.`);if(a===ty)throw Error(`nested indefinite string.`);let o=fy(e,t);e+=Ey;for(let e=0;e<o.length;++e)n.push(o[e])}throw Error(`expected break marker.`)}function fy(e,t){let n=ly(e,t),r=Ey;if(e+=r,t-e<n)throw Error(`unstructured byte string len ${n} greater than remaining buf len.`);let i=Cy.subarray(e,e+n);return Ey=r+n,i}function py(e,t){e+=1;let n=[];for(let r=e;e<t;){if(Cy[e]===255){let t=Lv(n.length);return t.set(n,0),Ey=e-r+2,t}let i=(Cy[e]&224)>>5,a=Cy[e]&31;if(i!==Vv)throw Error(`unexpected major type ${i} in indefinite string.`);if(a===ty)throw Error(`nested indefinite string.`);let o=fy(e,t);e+=Ey;for(let e=0;e<o.length;++e)n.push(o[e])}throw Error(`expected break marker.`)}function my(e,t){let n=ly(e,t),r=Ey;e+=r;let i=e,a=Array(n);for(let r=0;r<n;++r){let n=ay(e,t),i=Ey;a[r]=n,e+=i}return Ey=r+(e-i),a}function hy(e,t){e+=1;let n=[];for(let r=e;e<t;){if(Cy[e]===255)return Ey=e-r+2,n;let i=ay(e,t);e+=Ey,n.push(i)}throw Error(`expected break marker.`)}function gy(e,t){let n=ly(e,t),r=Ey;e+=r;let i=e,a={};for(let r=0;r<n;++r){if(e>=t)throw Error(`unexpected end of map payload.`);let n=(Cy[e]&224)>>5;if(n!==Hv)throw Error(`unexpected major type ${n} for map key at index ${e}.`);let r=ay(e,t);e+=Ey;let i=ay(e,t);e+=Ey,a[r]=i}return Ey=r+(e-i),a}function _y(e,t){e+=1;let n=e,r={};for(;e<t;){if(e>=t)throw Error(`unexpected end of map payload.`);if(Cy[e]===255)return Ey=e-n+2,r;let i=(Cy[e]&224)>>5;if(i!==Hv)throw Error(`unexpected major type ${i} for map key.`);let a=ay(e,t);e+=Ey;let o=ay(e,t);e+=Ey,r[a]=o}throw Error(`expected break marker.`)}function vy(e,t){let n=Cy[e]&31;switch(n){case Jv:case qv:return Ey=1,n===Jv;case Yv:return Ey=1,null;case Xv:return Ey=1,null;case Qv:if(t-e<3)throw Error(`incomplete float16 at end of buf.`);return Ey=3,cy(Cy[e+1],Cy[e+2]);case $v:if(t-e<5)throw Error(`incomplete float32 at end of buf.`);return Ey=5,wy.getFloat32(e+1);case ey:if(t-e<9)throw Error(`incomplete float64 at end of buf.`);return Ey=9,wy.getFloat64(e+1);default:throw Error(`unexpected minor value ${n}.`)}}function yy(e){if(typeof e==`number`)return e;let t=Number(e);return-(2**53-1)<=t&&t<=2**53-1?t:e}var by,xy,Sy,Cy,wy,Ty,Ey,Dy,Oy=l((()=>{Fh(),by=pf(),ry(),xy=typeof TextDecoder<`u`,Sy=typeof Buffer<`u`,Cy=Lv(0),wy=new DataView(Cy.buffer,Cy.byteOffset,Cy.byteLength),Ty=xy?new TextDecoder:null,Ey=0,Dy={[Zv]:1,[Qv]:2,[$v]:4,[ey]:8}}));function ky(e){Q.byteLength-$<e&&jy($<16e6?Math.max(Q.byteLength*4,Q.byteLength+e):Q.byteLength+e+16e6)}function Ay(){let e=Lv($);return e.set(Q.subarray(0,$),0),$=0,e}function jy(e){let t=Q;Q=Lv(e),t&&(t.copy?t.copy(Q,0,0,t.byteLength):Q.set(t,0)),Iy=new DataView(Q.buffer,Q.byteOffset,Q.byteLength)}function My(e,t){t<24?Q[$++]=e<<5|t:t<256?(Q[$++]=e<<5|24,Q[$++]=t):t<65536?(Q[$++]=e<<5|Qv,Iy.setUint16($,t),$+=2):t<2**32?(Q[$++]=e<<5|$v,Iy.setUint32($,t),$+=4):(Q[$++]=e<<5|ey,Iy.setBigUint64($,typeof t==`bigint`?t:BigInt(t)),$+=8)}function Ny(e){let t=[e];for(;t.length;){let e=t.pop();if(ky(typeof e==`string`?e.length*4:64),typeof e==`string`){if(Fy)My(Hv,Buffer.byteLength(e)),$+=Q.write(e,$);else{let t=(0,Py.fromUtf8)(e);My(Hv,t.byteLength),Q.set(t,$),$+=t.byteLength}continue}else if(typeof e==`number`){if(Number.isInteger(e)){let t=e>=0,n=t?zv:Bv,r=t?e:-e-1;r<24?Q[$++]=n<<5|r:r<256?(Q[$++]=n<<5|24,Q[$++]=r):r<65536?(Q[$++]=n<<5|Qv,Q[$++]=r>>8,Q[$++]=r):r<4294967296?(Q[$++]=n<<5|$v,Iy.setUint32($,r),$+=4):(Q[$++]=n<<5|ey,Iy.setBigUint64($,BigInt(r)),$+=8);continue}Q[$++]=Kv<<5|ey,Iy.setFloat64($,e),$+=8;continue}else if(typeof e==`bigint`){let t=e>=0,n=t?zv:Bv,r=t?e:-e-BigInt(1),i=Number(r);if(i<24)Q[$++]=n<<5|i;else if(i<256)Q[$++]=n<<5|24,Q[$++]=i;else if(i<65536)Q[$++]=n<<5|Qv,Q[$++]=i>>8,Q[$++]=i&255;else if(i<4294967296)Q[$++]=n<<5|$v,Iy.setUint32($,i),$+=4;else if(r<BigInt(`18446744073709551616`))Q[$++]=n<<5|ey,Iy.setBigUint64($,r),$+=8;else{let e=r.toString(2),n=new Uint8Array(Math.ceil(e.length/8)),i=r,a=0;for(;n.byteLength-++a>=0;)n[n.byteLength-a]=Number(i&BigInt(255)),i>>=BigInt(8);ky(n.byteLength*2),Q[$++]=t?194:195,Fy?My(Vv,Buffer.byteLength(n)):My(Vv,n.byteLength),Q.set(n,$),$+=n.byteLength}continue}else if(e===null){Q[$++]=Kv<<5|Yv;continue}else if(typeof e==`boolean`){Q[$++]=Kv<<5|(e?Jv:qv);continue}else if(e===void 0)throw Error(`@smithy/core/cbor: client may not serialize undefined value.`);else if(Array.isArray(e)){for(let n=e.length-1;n>=0;--n)t.push(e[n]);My(Uv,e.length);continue}else if(typeof e.byteLength==`number`){ky(e.length*2),My(Vv,e.length),Q.set(e,$),$+=e.byteLength;continue}else if(typeof e==`object`){if(e instanceof Mh){let n=e.string.indexOf(`.`),r=n===-1?0:n-e.string.length+1,i=BigInt(e.string.replace(`.`,``));Q[$++]=196,t.push(i),t.push(r),My(Uv,2);continue}if(e[ny])if(`tag`in e&&`value`in e){t.push(e.value),My(Gv,e.tag);continue}else throw Error(`tag encountered with missing fields, need 'tag' and 'value', found: `+JSON.stringify(e));let n=Object.keys(e);for(let r=n.length-1;r>=0;--r){let i=n[r];t.push(e[i]),t.push(i)}My(Wv,n.length);continue}throw Error(`data type ${e?.constructor?.name??typeof e} not compatible for encoding.`)}}var Py,Fy,Q,Iy,$,Ly=l((()=>{Fh(),Py=pf(),ry(),Fy=typeof Buffer<`u`,Q=Lv(2048),Iy=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),$=0})),Ry,zy=l((()=>{Oy(),Ly(),Ry={deserialize(e){return iy(e),ay(0,e.length)},serialize(e){try{return Ny(e),Ay()}catch(e){throw Ay(),e}},resizeEncodingBuffer(e){jy(e)}}})),By,Vy,Hy=l((()=>{ry(),By=e=>Rv({tag:1,value:e.getTime()/1e3}),Vy=(e,t)=>{let n=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t};if(t.__type!==void 0)return n(t.__type);let r=Object.keys(t).find(e=>e.toLowerCase()===`code`);if(r&&t[r]!==void 0)return n(t[r])}})),Uy,Wy,Gy,Ky,qy=l((()=>{bg(),Yp(),Fh(),Uy=hf(),zy(),Hy(),Wy=class extends Ih{createSerializer(){let e=new Gy;return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Ky;return e.setSerdeContext(this.serdeContext),e}},Gy=class extends Ih{value;write(e,t){this.value=this.serialize(e,t)}serialize(e,t){let n=Ip.of(e);if(t==null)return n.isIdempotencyToken()?(0,ah.v4)():t;if(n.isBlobSchema())return typeof t==`string`?(this.serdeContext?.base64Decoder??Uy.fromBase64)(t):t;if(n.isTimestampSchema())return By(typeof t==`number`||typeof t==`bigint`?new Date(Number(t)/1e3|0):t);if(typeof t==`function`||typeof t==`object`){let e=t;if(n.isListSchema()&&Array.isArray(e)){let t=!!n.getMergedTraits().sparse,r=[],i=0;for(let a of e){let e=this.serialize(n.getValueSchema(),a);(e!=null||t)&&(r[i++]=e)}return r}if(e instanceof Date)return By(e);let r={};if(n.isMapSchema()){let t=!!n.getMergedTraits().sparse;for(let i of Object.keys(e)){let a=this.serialize(n.getValueSchema(),e[i]);(a!=null||t)&&(r[i]=a)}}else if(n.isStructSchema()){for(let[t,i]of n.structIterator()){let n=this.serialize(i,e[t]);n!=null&&(r[t]=n)}if(n.isUnionSchema()&&Array.isArray(e.$unknown)){let[t,n]=e.$unknown;r[t]=n}else if(typeof e.__type==`string`)for(let[t,n]of Object.entries(e))t in r||(r[t]=this.serialize(15,n))}else if(n.isDocumentSchema())for(let t of Object.keys(e))r[t]=this.serialize(n.getValueSchema(),e[t]);else if(n.isBigDecimalSchema())return e;return r}return t}flush(){let e=Ry.serialize(this.value);return this.value=void 0,e}},Ky=class extends Ih{read(e,t){let n=Ry.deserialize(t);return this.readValue(e,n)}readValue(e,t){let n=Ip.of(e);if(n.isTimestampSchema()){if(typeof t==`number`)return Sh(t);if(typeof t==`object`&&t.tag===1&&`value`in t)return Sh(t.value)}if(n.isBlobSchema())return typeof t==`string`?(this.serdeContext?.base64Decoder??Uy.fromBase64)(t):t;if(t===void 0||typeof t==`boolean`||typeof t==`number`||typeof t==`string`||typeof t==`bigint`||typeof t==`symbol`)return t;if(typeof t==`object`){if(t===null)return null;if(`byteLength`in t||t instanceof Date||n.isDocumentSchema())return t;if(n.isListSchema()){let e=[],r=n.getValueSchema();for(let n of t){let t=this.readValue(r,n);e.push(t)}return e}let e={};if(n.isMapSchema()){let r=n.getValueSchema();for(let n of Object.keys(t))e[n]=this.readValue(r,t[n])}else if(n.isStructSchema()){let r=n.isUnionSchema(),i;r&&(i=new Set(Object.keys(t).filter(e=>e!==`__type`)));for(let[a,o]of n.structIterator())r&&i.delete(a),t[a]!=null&&(e[a]=this.readValue(o,t[a]));if(r&&i?.size===1&&Object.keys(e).length===0){let n=i.values().next().value;e.$unknown=[n,t[n]]}else if(typeof t.__type==`string`)for(let[n,r]of Object.entries(t))n in e||(e[n]=r)}else if(t instanceof Mh)return t;return e}else return t}}})),Jy,Yy,Xy=l((()=>{bg(),Yp(),Jy=Nd(),qy(),Hy(),Yy=class extends Zh{codec=new Wy;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t})}getShapeId(){return`smithy.protocols#rpcv2Cbor`}getPayloadCodec(){return this.codec}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);if(Object.assign(r.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":`rpc-v2-cbor`,accept:this.getDefaultContentType()}),Uf(e.input)===`unit`)delete r.body,delete r.headers[`content-type`];else{r.body||=(this.serializer.write(15,{}),this.serializer.flush());try{r.headers[`content-length`]=String(r.body.byteLength)}catch{}}let{service:i,operation:a}=(0,Jy.getSmithyContext)(n),o=`/service/${i}/operation/${a}`;return r.path.endsWith(`/`)?r.path+=o.slice(1):r.path+=o,r}async deserializeResponse(e,t,n){return super.deserializeResponse(e,t,n)}async handleError(e,t,n,r,i){let a=Vy(n,r)??`Unknown`,o={$metadata:i,$fault:n.statusCode<=500?`client`:`server`},s=this.options.defaultNamespace;a.includes(`#`)&&([s]=a.split(`#`));let c=this.compositeErrorRegistry,l=Kp.for(s);c.copyFrom(l);let u;try{u=c.getSchema(a)}catch{r.Message&&(r.message=r.Message);let e=Kp.for(`smithy.ts.sdk.synthetic.`+s);c.copyFrom(e);let t=c.getBaseException();if(t){let e=c.getErrorCtor(t);throw Object.assign(new e({name:a}),o,r)}throw Object.assign(Error(a),o,r)}let d=Ip.of(u),f=c.getErrorCtor(u),p=r.message??r.Message??`Unknown`,m=new f(p),h={};for(let[e,t]of d.structIterator())h[e]=this.deserializer.readValue(t,r[e]);throw Object.assign(m,o,{$fault:d.getMergedTraits().error,message:p},h)}getDefaultContentType(){return`application/cbor`}}})),Zy=l((()=>{Hy(),Xy(),qy()})),Qy,$y,eb=l((()=>{Yp(),Qy=C_(),$y=class{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){let n=t.getMemberSchemas(),r=Object.values(n).find(e=>!!e.getMergedTraits().httpPayload);if(r)return r.getMergedTraits().mediaType||(r.isStringSchema()?`text/plain`:r.isBlobSchema()?`application/octet-stream`:e);if(!t.isUnitSchema()&&Object.values(n).find(e=>{let{httpQuery:t,httpQueryParams:n,httpHeader:r,httpLabel:i,httpPrefixHeaders:a}=e.getMergedTraits();return!t&&!n&&!r&&!i&&a===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,r,i,a){let o=e;e.includes(`#`)&&([,o]=e.split(`#`));let s={$metadata:i,$fault:n.statusCode<500?`client`:`server`};if(!this.errorRegistry)throw Error(`@aws-sdk/core/protocols - error handler not initialized.`);try{return{errorSchema:a?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:s}}catch{r.message=r.message??r.Message??`UnknownError`;let e=this.errorRegistry,t=e.getBaseException();if(t){let n=e.getErrorCtor(t)??Error;throw this.decorateServiceException(Object.assign(new n({name:o}),s),r)}let n=r,i=n?.message??n?.Message??n?.Error?.Message??n?.Error?.message;throw this.decorateServiceException(Object.assign(Error(i),{name:o},s),r)}}compose(e,t,n){let r=n;t.includes(`#`)&&([r]=t.split(`#`));let i=Kp.for(r),a=Kp.for(`smithy.ts.sdk.synthetic.`+n);e.copyFrom(i),e.copyFrom(a),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){let n=e.Message??t.Message,r=(0,Qy.decorateServiceException)(e,t);n&&(r.message=n),r.Error={...r.Error,Type:r.Error?.Type,Code:r.Error?.Code,Message:r.Error?.message??r.Error?.Message??n};let i=r.$metadata.requestId;return i&&(r.RequestId=i),r}return(0,Qy.decorateServiceException)(e,t)}setQueryCompatError(e,t){let n=t.headers?.[`x-amzn-query-error`];if(e!==void 0&&n!=null){let[t,r]=n.split(`;`),i=Object.entries(e),a={Code:t,Type:r};Object.assign(e,a);for(let[e,t]of i)a[e===`message`?`Message`:e]=t;delete a.__type,e.Error=a}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(e=>Ip.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}})),tb,nb=l((()=>{Zy(),Yp(),eb(),tb=class extends Yy{awsQueryCompatible;mixin;constructor({defaultNamespace:e,errorTypeRegistries:t,awsQueryCompatible:n}){super({defaultNamespace:e,errorTypeRegistries:t}),this.awsQueryCompatible=!!n,this.mixin=new $y(this.awsQueryCompatible)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return this.awsQueryCompatible&&(r.headers[`x-amzn-query-mode`]=`true`),r}async handleError(e,t,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);let a=(()=>{let e=n.headers[`x-amzn-query-error`];return e&&this.awsQueryCompatible?e.split(`;`)[0]:Vy(n,r)??`Unknown`})();this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),c=Ip.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l),d={};for(let[e,t]of c.structIterator())r[e]!=null&&(d[e]=this.deserializer.readValue(t,r[e]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,d),this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}}})),rb,ib,ab,ob=l((()=>{rb=e=>{if(e==null)return e;if(typeof e==`number`||typeof e==`bigint`){let t=Error(`Received number ${e} where a string was expected.`);return t.name=`Warning`,console.warn(t),String(e)}if(typeof e==`boolean`){let t=Error(`Received boolean ${e} where a string was expected.`);return t.name=`Warning`,console.warn(t),String(e)}return e},ib=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.toLowerCase();if(e!==``&&t!==`false`&&t!==`true`){let t=Error(`Received string "${e}" where a boolean was expected.`);t.name=`Warning`,console.warn(t)}return e!==``&&t!==`false`}return e},ab=e=>{if(e==null)return e;if(typeof e==`string`){let t=Number(e);if(t.toString()!==e){let t=Error(`Received string "${e}" where a number was expected.`);return t.name=`Warning`,console.warn(t),e}return t}return e}})),sb,cb=l((()=>{sb=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}})),lb,ub=l((()=>{lb=class{from;to;keys;constructor(e,t){this.from=e,this.to=t,this.keys=new Set(Object.keys(this.from).filter(e=>e!==`__type`))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}}));function db(e,t,n){if(n?.source){let e=n.source;if(typeof t==`number`&&(t>2**53-1||t<-(2**53-1)||e!==String(t)))return e.includes(`.`)?new Mh(e,`bigDecimal`):BigInt(e)}return t}var fb=l((()=>{Fh()})),pb,mb,hb,gb=l((()=>{pb=C_(),mb=pf(),hb=(e,t)=>(0,pb.collectBody)(e,t).then(e=>(t?.utf8Encoder??mb.toUtf8)(e))})),_b,vb,yb,bb=l((()=>{gb(),_b=(e,t)=>hb(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw t?.name===`SyntaxError`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}return{}}),vb=async(e,t)=>{let n=await _b(e,t);return n.message=n.message??n.Message,n},yb=(e,t)=>{let n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t},i=n(e.headers,`x-amzn-errortype`);if(i!==void 0)return r(e.headers[i]);if(t&&typeof t==`object`){let e=n(t,`code`);if(e&&t[e]!==void 0)return r(t[e]);if(t.__type!==void 0)return r(t.__type)}}})),xb,Sb,Cb=l((()=>{bg(),Yp(),Fh(),xb=hf(),cb(),ub(),fb(),bb(),Sb=class extends sb{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,typeof t==`string`?JSON.parse(t,db):await _b(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){let n=typeof t==`object`&&!!t,r=Ip.of(e);if(n){if(r.isStructSchema()){let e=t,n=r.isUnionSchema(),i={},a,{jsonName:o}=this.settings;o&&(a={});let s;n&&(s=new lb(e,i));for(let[t,c]of r.structIterator()){let r=t;o&&(r=c.getMergedTraits().jsonName??r,a[r]=t),n&&s.mark(r),e[r]!=null&&(i[t]=this._read(c,e[r]))}if(n)s.writeUnknown();else if(typeof e.__type==`string`)for(let[t,n]of Object.entries(e)){let e=o?a[t]??t:t;e in i||(i[e]=n)}return i}if(Array.isArray(t)&&r.isListSchema()){let e=r.getValueSchema(),n=[];for(let r of t)n.push(this._read(e,r));return n}if(r.isMapSchema()){let e=r.getValueSchema(),n={};for(let[r,i]of Object.entries(t))n[r]=this._read(e,i);return n}}if(r.isBlobSchema()&&typeof t==`string`)return(0,xb.fromBase64)(t);let i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&typeof t==`string`&&i)return i===`application/json`||i.endsWith(`+json`)?sh.from(t):t;if(r.isTimestampSchema()&&t!=null)switch(ag(r,this.settings)){case 5:return Rm(t);case 6:return Hm(t);case 7:return Um(t);default:return console.warn(`Missing timestamp format, parsing value with Date constructor:`,t),new Date(t)}if(r.isBigIntegerSchema()&&(typeof t==`number`||typeof t==`string`))return BigInt(t);if(r.isBigDecimalSchema()&&t!=null){if(t instanceof Mh)return t;let e=t;return e.type===`bigDecimal`&&`string`in e?new Mh(e.string,e.type):new Mh(String(t),`bigDecimal`)}if(r.isNumericSchema()&&typeof t==`string`){switch(t){case`Infinity`:return 1/0;case`-Infinity`:return-1/0;case`NaN`:return NaN}return t}if(r.isDocumentSchema())if(n){let e=Array.isArray(t)?[]:{};for(let[n,i]of Object.entries(t))i instanceof Mh?e[n]=i:e[n]=this._read(r,i);return e}else return structuredClone(t);return t}}})),wb,Tb,Eb=l((()=>{Fh(),wb=`Ν`,Tb=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw Error(`@aws-sdk/core/protocols - JsonReplacer already created.`);if(this.stage===2)throw Error(`@aws-sdk/core/protocols - JsonReplacer exhausted.`);return this.stage=1,(e,t)=>{if(t instanceof Mh){let e=`${wb+`nv`+ this.counter++}_`+t.string;return this.values.set(`"${e}"`,t.string),e}if(typeof t==`bigint`){let e=t.toString(),n=`${wb+`b`+ this.counter++}_`+e;return this.values.set(`"${n}"`,e),n}return t}}replaceInJson(e){if(this.stage===0)throw Error(`@aws-sdk/core/protocols - JsonReplacer not created yet.`);if(this.stage===2)throw Error(`@aws-sdk/core/protocols - JsonReplacer exhausted.`);if(this.stage=2,this.counter===0)return e;for(let[t,n]of this.values)e=e.replace(t,n);return e}}})),Db,Ob,kb=l((()=>{bg(),Yp(),Fh(),Db=hf(),cb(),Eb(),Ob=class extends sb{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=Ip.of(e),this.buffer=this._write(this.rootSchema,t)}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer==`object`&&(this.buffer.__type=Ip.of(e).getName(!0))}flush(){let{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);let e=new Tb;return e.replaceInJson(JSON.stringify(this.buffer,e.createReplacer(),0))}return this.buffer}_write(e,t,n){let r=typeof t==`object`&&!!t,i=Ip.of(e);if(r){if(i.isStructSchema()){let e=t,n={},{jsonName:r}=this.settings,a;r&&(a={});for(let[t,o]of i.structIterator()){let s=this._write(o,e[t],i);if(s!==void 0){let e=t;r&&(e=o.getMergedTraits().jsonName??t,a[t]=e),n[e]=s}}if(i.isUnionSchema()&&Object.keys(n).length===0){let{$unknown:t}=e;if(Array.isArray(t)){let[e,r]=t;n[e]=this._write(15,r)}}else if(typeof e.__type==`string`)for(let[t,i]of Object.entries(e)){let e=r?a[t]??t:t;e in n||(n[e]=this._write(15,i))}return n}if(Array.isArray(t)&&i.isListSchema()){let e=i.getValueSchema(),n=[],r=!!i.getMergedTraits().sparse;for(let i of t)(r||i!=null)&&n.push(this._write(e,i));return n}if(i.isMapSchema()){let e=i.getValueSchema(),n={},r=!!i.getMergedTraits().sparse;for(let[i,a]of Object.entries(t))(r||a!=null)&&(n[i]=this._write(e,a));return n}if(t instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??Db.toBase64)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(ag(i,this.settings)){case 5:return t.toISOString().replace(`.000Z`,`Z`);case 6:return Mm(t);case 7:return t.getTime()/1e3;default:return console.warn(`Missing timestamp format, using epoch seconds`,t),t.getTime()/1e3}t instanceof Mh&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(i.isStringSchema()){if(t===void 0&&i.isIdempotencyToken())return(0,ah.v4)();let e=i.getMergedTraits().mediaType;return t!=null&&e&&(e===`application/json`||e.endsWith(`+json`))?sh.from(t):t}if(typeof t==`number`&&i.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t==`string`&&i.isBlobSchema())return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??Db.toBase64)(t);if(typeof t==`bigint`&&(this.useReplacer=!0),i.isDocumentSchema())if(r){let e=Array.isArray(t)?[]:{};for(let[n,r]of Object.entries(t))r instanceof Mh?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r);return e}else return structuredClone(t);return t}}}})),Ab,jb=l((()=>{cb(),Cb(),kb(),Ab=class extends sb{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new Ob(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Sb(this.settings);return e.setSerdeContext(this.serdeContext),e}}})),Mb,Nb=l((()=>{bg(),Yp(),eb(),jb(),bb(),Mb=class extends Zh{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=i??new Ab({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new $y(this.awsQueryCompatible)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return r.path.endsWith(`/`)||(r.path+=`/`),Object.assign(r.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${e.name}`}),this.awsQueryCompatible&&(r.headers[`x-amzn-query-mode`]=`true`),(Uf(e.input)===`unit`||!r.body)&&(r.body=`{}`),r}getPayloadCodec(){return this.codec}async handleError(e,t,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);let a=yb(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),c=Ip.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l),d={};for(let[e,t]of c.structIterator())r[e]!=null&&(d[e]=this.codec.createDeserializer().readObject(t,r[e]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,d),this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}}})),Pb,Fb=l((()=>{Nb(),Pb=class extends Mb{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i})}getShapeId(){return`aws.protocols#awsJson1_0`}getJsonRpcVersion(){return`1.0`}getDefaultContentType(){return`application/x-amz-json-1.0`}}})),Ib,Lb=l((()=>{Nb(),Ib=class extends Mb{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i})}getShapeId(){return`aws.protocols#awsJson1_1`}getJsonRpcVersion(){return`1.1`}getDefaultContentType(){return`application/x-amz-json-1.1`}}})),Rb,zb=l((()=>{bg(),Yp(),eb(),jb(),bb(),Rb=class extends Jh{serializer;deserializer;codec;mixin=new $y;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});let n={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new Ab(n),this.serializer=new _g(this.codec.createSerializer(),n),this.deserializer=new fg(this.codec.createDeserializer(),n)}getShapeId(){return`aws.protocols#restJson1`}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n),i=Ip.of(e.input);if(!r.headers[`content-type`]){let e=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);e&&(r.headers[`content-type`]=e)}return r.body==null&&r.headers[`content-type`]===this.getDefaultContentType()&&(r.body=`{}`),r}async deserializeResponse(e,t,n){let r=await super.deserializeResponse(e,t,n),i=Ip.of(e.output);for(let[e,t]of i.structIterator())t.getMemberTraits().httpPayload&&!(e in r)&&(r[e]=null);return r}async handleError(e,t,n,r,i){let a=yb(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i),c=Ip.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l);await this.deserializeHttpMessage(o,t,n,r);let d={};for(let[e,t]of c.structIterator()){let n=t.getMergedTraits().jsonName??e;d[e]=this.codec.createDeserializer().readObject(t,r[n])}throw this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}getDefaultContentType(){return`application/json`}}})),Bb,Vb,Hb=l((()=>{Bb=C_(),Vb=e=>{if(e!=null)return typeof e==`object`&&`__type`in e&&delete e.__type,(0,Bb.expectUnion)(e)}})),Ub=u(((e,t)=>{(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})}},n={};e.r(n),e.d(n,{XMLBuilder:()=>Xe,XMLParser:()=>Ie,XMLValidator:()=>Ze});let r=RegExp(`^[: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][: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\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function i(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}let a=function(e){return r.exec(e)!=null},o=[`hasOwnProperty`,`toString`,`valueOf`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`],s=[`__proto__`,`constructor`,`prototype`],c={allowBooleanAttributes:!1,unpairedTags:[]};function l(e,t){t=Object.assign({},c,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=d(e,a),a.err)return a}else{if(e[a]!==`<`){if(u(e[a]))continue;return _(`InvalidChar`,`char '`+e[a]+`' is not expected.`,b(e,a))}{let o=a;if(a++,e[a]===`!`){a=f(e,a);continue}{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
|
|
61
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:n})}}})),yv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createGetRequest=a,e.getCredentials=o;let t=f_(),n=vd(),r=w_(),i=Rf();function a(e){return new n.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((e,[t,n])=>(e[t]=n,e),{}),fragment:e.hash})}async function o(e,n){let a=await(0,i.sdkStreamMixin)(e.body).transformToString();if(e.statusCode===200){let e=JSON.parse(a);if(typeof e.AccessKeyId!=`string`||typeof e.SecretAccessKey!=`string`||typeof e.Token!=`string`||typeof e.Expiration!=`string`)throw new t.CredentialsProviderError(`HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }`,{logger:n});return{accessKeyId:e.AccessKeyId,secretAccessKey:e.SecretAccessKey,sessionToken:e.Token,expiration:(0,r.parseRfc3339DateTime)(e.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let r={};try{r=JSON.parse(a)}catch{}throw Object.assign(new t.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:n}),{Code:r.Code,Message:r.Message})}throw new t.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:n})}})),bv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.retryWrapper=void 0,e.retryWrapper=(e,t,n)=>async()=>{for(let r=0;r<t;++r)try{return await e()}catch{await new Promise(e=>setTimeout(e,n))}return await e()}})),xv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHttp=void 0;let t=(N(),m(j)),n=(i_(),m(r_)),r=jf(),i=f_(),a=t.__importDefault(h(`node:fs/promises`)),o=vv(),s=yv(),c=bv();e.fromHttp=(e={})=>{e.logger?.debug(`@aws-sdk/credential-provider-http - fromHttp`);let t,l=e.awsContainerCredentialsRelativeUri??process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,u=e.awsContainerCredentialsFullUri??process.env.AWS_CONTAINER_CREDENTIALS_FULL_URI,d=e.awsContainerAuthorizationToken??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN,f=e.awsContainerAuthorizationTokenFile??process.env.AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE,p=e.logger?.constructor?.name===`NoOpLogger`||!e.logger?.warn?console.warn:e.logger.warn.bind(e.logger);if(l&&u&&(p(`@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri.`),p(`awsContainerCredentialsFullUri will take precedence.`)),d&&f&&(p(`@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile.`),p(`awsContainerAuthorizationToken will take precedence.`)),u)t=u;else if(l)t=`http://169.254.170.2${l}`;else throw new i.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
62
|
+
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let m=new URL(t);(0,o.checkUrl)(m,e.logger);let h=r.NodeHttpHandler.create({requestTimeout:e.timeout??1e3,connectionTimeout:e.timeout??1e3});return(0,c.retryWrapper)(async()=>{let t=(0,s.createGetRequest)(m);d?t.headers.Authorization=d:f&&(t.headers.Authorization=(await a.default.readFile(f)).toString());try{let e=await h.handle(t);return(0,s.getCredentials)(e.response).then(e=>(0,n.setCredentialFeature)(e,`CREDENTIALS_HTTP`,`z`))}catch(t){throw new i.CredentialsProviderError(String(t),{logger:e.logger})}},e.maxRetries??3,e.timeout??1e3)}})),Sv=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromHttp=void 0;var t=xv();Object.defineProperty(e,`fromHttp`,{enumerable:!0,get:function(){return t.fromHttp}})}));function Cv(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sso-oauth`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function wv(e){return{schemeId:`smithy.api#noAuth`}}var Tv,Ev,Dv,Ov,kv=l((()=>{pv(),Tv=Pd(),Ev=async(e,t,n)=>({operation:(0,Tv.getSmithyContext)(t).operation,region:await(0,Tv.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Dv=e=>{let t=[];switch(e.operation){case`CreateToken`:t.push(wv(e));break;default:t.push(Cv(e))}return t},Ov=e=>{let t=cv(e);return Object.assign(t,{authSchemePreference:(0,Tv.normalizeProvider)(e.authSchemePreference??[])})}})),Av,jv,Mv=l((()=>{Av=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`sso-oauth`}),jv={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),Nv=`3.996.18`,Pv=u((e=>{var t=h(`node:os`),n=h(`node:process`),r=c_(),i=h(`node:fs/promises`),a=h(`node:path`),o=s_();let s=()=>{for(let e of[`deno`,`bun`,`llrt`])if(n.versions[e])return[`md/${e}`,n.versions[e]];return[`md/nodejs`,n.versions.node]},c=e=>{let t=process.cwd();if(!e)return[t];let n=a.normalize(e),r=n.split(a.sep),i=r.indexOf(`node_modules`),o=i===-1?n:r.slice(0,i).join(a.sep);return t===o?[t]:[o,t]},l=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/,u=(e=``)=>{let t=e.match(l);if(!t)return;let[n,r,i,a]=[t[1],t[2],t[3],t[4]];return a?`${n}.${r}.${i}-${a}`:`${n}.${r}.${i}`},d=[`^`,`~`,`>=`,`<=`,`>`,`<`],f=[`latest`,`beta`,`dev`,`rc`,`insiders`,`next`],p=(e=``)=>{if(f.includes(e))return e;let t=d.find(t=>e.startsWith(t))??``,n=u(e.slice(t.length));if(n)return`${t}${n}`},m,g=a.join(`node_modules`,`typescript`,`package.json`),_=async()=>{if(m===null)return;if(typeof m==`string`)return[`md/tsc`,m];let e=!1;try{e=r.booleanSelector(process.env,`AWS_SDK_JS_TYPESCRIPT_DETECTION_DISABLED`,r.SelectorType.ENV)||!1}catch{}if(e){m=null;return}let t=c(typeof __dirname<`u`?__dirname:void 0),n;for(let e of t)try{let t=a.join(e,`package.json`),r=await i.readFile(t,`utf-8`),{dependencies:o,devDependencies:s}=JSON.parse(r),c=s?.typescript??o?.typescript;if(typeof c!=`string`)continue;n=c;break}catch{}if(!n){m=null;return}let o;for(let e of t)try{let t=a.join(e,g),n=await i.readFile(t,`utf-8`),{version:r}=JSON.parse(n),s=u(r);if(typeof s!=`string`)continue;o=s;break}catch{}if(o)return m=o,[`md/tsc`,m];let s=p(n);if(typeof s!=`string`){m=null;return}return m=`dev_${s}`,[`md/tsc`,m]},v={isCrtAvailable:!1},y=()=>v.isCrtAvailable?[`md/crt-avail`]:null,b=({serviceId:e,clientVersion:r})=>{let i=s();return async a=>{let o=[[`aws-sdk-js`,r],[`ua`,`2.1`],[`os/${t.platform()}`,t.release()],[`lang/js`],i],s=await _();s&&o.push(s);let c=y();c&&o.push(c),e&&o.push([`api/${e}`,r]),n.env.AWS_EXECUTION_ENV&&o.push([`exec-env/${n.env.AWS_EXECUTION_ENV}`]);let l=await a?.userAgentAppId?.();return l?[...o,[`app/${l}`]]:[...o]}},x=b,S=`AWS_SDK_UA_APP_ID`,C=`sdk_ua_app_id`;e.NODE_APP_ID_CONFIG_OPTIONS={environmentVariableSelector:e=>e[S],configFileSelector:e=>e[C]??e[`sdk-ua-app-id`],default:o.DEFAULT_UA_APP_ID},e.UA_APP_ID_ENV_NAME=S,e.UA_APP_ID_INI_NAME=C,e.createDefaultUserAgentProvider=b,e.crtAvailability=v,e.defaultUserAgent=x})),Fv=u((e=>{var t=ff(),n=mf(),r=h(`buffer`),i=h(`crypto`),a=class{algorithmIdentifier;secret;hash;constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(n.toUint8Array(o(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?i.createHmac(this.algorithmIdentifier,o(this.secret)):i.createHash(this.algorithmIdentifier)}};function o(e,n){return r.Buffer.isBuffer(e)?e:typeof e==`string`?t.fromString(e,n):ArrayBuffer.isView(e)?t.fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength):t.fromArrayBuffer(e)}e.Hash=a})),Iv=u((e=>{var t=h(`node:fs`);e.calculateBodyLength=e=>{if(!e)return 0;if(typeof e==`string`)return Buffer.byteLength(e);if(typeof e.byteLength==`number`)return e.byteLength;if(typeof e.size==`number`)return e.size;if(typeof e.start==`number`&&typeof e.end==`number`)return e.end+1-e.start;if(e instanceof t.ReadStream){if(e.path!=null)return t.lstatSync(e.path).size;if(typeof e.fd==`number`)return t.fstatSync(e.fd).size}throw Error(`Body Length computation failed for ${e}`)}})),Lv=u((e=>{var t=l_(),n=v_(),r=f_();let i=`AWS_REGION`,a=`AWS_DEFAULT_REGION`,o=[`in-region`,`cross-region`,`mobile`,`standard`,`legacy`],s={environmentVariableSelector:e=>e.AWS_DEFAULTS_MODE,configFileSelector:e=>e.defaults_mode,default:`legacy`},c=({region:e=n.loadConfig(t.NODE_REGION_CONFIG_OPTIONS),defaultsMode:i=n.loadConfig(s)}={})=>r.memoize(async()=>{let t=typeof i==`function`?await i():i;switch(t?.toLowerCase()){case`auto`:return l(e);case`in-region`:case`cross-region`:case`mobile`:case`standard`:case`legacy`:return Promise.resolve(t?.toLocaleLowerCase());case void 0:return Promise.resolve(`legacy`);default:throw Error(`Invalid parameter for "defaultsMode", expect ${o.join(`, `)}, got ${t}`)}}),l=async e=>{if(e){let t=typeof e==`function`?await e():e,n=await u();return n?t===n?`in-region`:`cross-region`:`standard`}return`standard`},u=async()=>{if(process.env.AWS_EXECUTION_ENV&&(process.env[i]||process.env[a]))return process.env[i]??process.env[a];if(!process.env.AWS_EC2_METADATA_DISABLED)try{let{getInstanceMetadataEndpoint:e,httpRequest:t}=await Promise.resolve().then(()=>p(_v()));return(await t({...await e(),path:`/latest/meta-data/placement/region`})).toString()}catch{}};e.resolveDefaultsModeConfig=c}));function Rv(e){return typeof Buffer<`u`?Buffer.alloc(e):new Uint8Array(e)}function zv(e){return e[ry]=!0,e}var Bv,Vv,Hv,Uv,Wv,Gv,Kv,qv,Jv,Yv,Xv,Zv,Qv,$v,ey,ty,ny,ry,iy=l((()=>{Bv=0,Vv=1,Hv=2,Uv=3,Wv=4,Gv=5,Kv=6,qv=7,Jv=20,Yv=21,Xv=22,Zv=23,Qv=24,$v=25,ey=26,ty=27,ny=31,ry=Symbol(`@smithy/core/cbor::tagSymbol`)}));function ay(e){wy=e,Ty=new DataView(wy.buffer,wy.byteOffset,wy.byteLength)}function oy(e,t){if(e>=t)throw Error(`unexpected end of (decode) payload.`);let n=(wy[e]&224)>>5,r=wy[e]&31;switch(n){case Bv:case Vv:case Kv:let i,a;if(r<24)i=r,a=1;else switch(r){case Qv:case $v:case ey:case ty:let n=Oy[r],o=n+1;if(a=o,t-e<o)throw Error(`countLength ${n} greater than remaining buf len.`);let s=e+1;i=n===1?wy[s]:n===2?Ty.getUint16(s):n===4?Ty.getUint32(s):Ty.getBigUint64(s);break;default:throw Error(`unexpected minor value ${r}.`)}if(n===Bv)return Dy=a,by(i);if(n===Vv){let e;return e=typeof i==`bigint`?BigInt(-1)-i:-1-i,Dy=a,by(e)}else if(r===2||r===3){let n=uy(e+a,t),i=BigInt(0),o=e+a+Dy;for(let e=o;e<o+n;++e)i=i<<BigInt(8)|BigInt(wy[e]);return Dy=a+Dy+n,r===3?-i-BigInt(1):i}else if(r===4){let[n,r]=oy(e+a,t),i=r<0?-1:1,o=`0`.repeat(Math.abs(n)+1)+String(BigInt(i)*BigInt(r)),s,c=r<0?`-`:``;return s=n===0?o:o.slice(0,o.length+n)+`.`+o.slice(n),s=s.replace(/^0+/g,``),s===``&&(s=`0`),s[0]===`.`&&(s=`0`+s),s=c+s,Dy=a+Dy,jh(s)}else{let n=oy(e+a,t);return Dy=a+Dy,zv({tag:by(i),value:n})}case Uv:case Gv:case Wv:case Hv:if(r===ny)switch(n){case Uv:return fy(e,t);case Gv:return vy(e,t);case Wv:return gy(e,t);case Hv:return my(e,t)}else switch(n){case Uv:return dy(e,t);case Gv:return _y(e,t);case Wv:return hy(e,t);case Hv:return py(e,t)}default:return yy(e,t)}}function sy(e,t,n){return Cy&&e.constructor?.name===`Buffer`?e.toString(`utf-8`,t,n):Ey?Ey.decode(e.subarray(t,n)):(0,xy.toUtf8)(e.subarray(t,n))}function cy(e){let t=Number(e);return(t<-(2**53-1)||2**53-1<t)&&console.warn(Error(`@smithy/core/cbor - truncating BigInt(${e}) to ${t} with loss of precision.`)),t}function ly(e,t){let n=e>>7,r=(e&124)>>2,i=(e&3)<<8|t,a=n===0?1:-1,o,s;if(r===0){if(i===0)return 0;o=2**-14,s=0}else if(r===31)return i===0?a*(1/0):NaN;else o=2**(r-15),s=1;return s+=i/1024,o*s*a}function uy(e,t){let n=wy[e]&31;if(n<24)return Dy=1,n;if(n===Qv||n===$v||n===ey||n===ty){let r=Oy[n];if(Dy=r+1,t-e<Dy)throw Error(`countLength ${r} greater than remaining buf len.`);let i=e+1;return r===1?wy[i]:r===2?Ty.getUint16(i):r===4?Ty.getUint32(i):cy(Ty.getBigUint64(i))}throw Error(`unexpected minor value ${n}.`)}function dy(e,t){let n=uy(e,t),r=Dy;if(e+=r,t-e<n)throw Error(`string len ${n} greater than remaining buf len.`);let i=sy(wy,e,e+n);return Dy=r+n,i}function fy(e,t){e+=1;let n=[];for(let r=e;e<t;){if(wy[e]===255){let t=Rv(n.length);return t.set(n,0),Dy=e-r+2,sy(t,0,t.length)}let i=(wy[e]&224)>>5,a=wy[e]&31;if(i!==Uv)throw Error(`unexpected major type ${i} in indefinite string.`);if(a===ny)throw Error(`nested indefinite string.`);let o=py(e,t);e+=Dy;for(let e=0;e<o.length;++e)n.push(o[e])}throw Error(`expected break marker.`)}function py(e,t){let n=uy(e,t),r=Dy;if(e+=r,t-e<n)throw Error(`unstructured byte string len ${n} greater than remaining buf len.`);let i=wy.subarray(e,e+n);return Dy=r+n,i}function my(e,t){e+=1;let n=[];for(let r=e;e<t;){if(wy[e]===255){let t=Rv(n.length);return t.set(n,0),Dy=e-r+2,t}let i=(wy[e]&224)>>5,a=wy[e]&31;if(i!==Hv)throw Error(`unexpected major type ${i} in indefinite string.`);if(a===ny)throw Error(`nested indefinite string.`);let o=py(e,t);e+=Dy;for(let e=0;e<o.length;++e)n.push(o[e])}throw Error(`expected break marker.`)}function hy(e,t){let n=uy(e,t),r=Dy;e+=r;let i=e,a=Array(n);for(let r=0;r<n;++r){let n=oy(e,t),i=Dy;a[r]=n,e+=i}return Dy=r+(e-i),a}function gy(e,t){e+=1;let n=[];for(let r=e;e<t;){if(wy[e]===255)return Dy=e-r+2,n;let i=oy(e,t);e+=Dy,n.push(i)}throw Error(`expected break marker.`)}function _y(e,t){let n=uy(e,t),r=Dy;e+=r;let i=e,a={};for(let r=0;r<n;++r){if(e>=t)throw Error(`unexpected end of map payload.`);let n=(wy[e]&224)>>5;if(n!==Uv)throw Error(`unexpected major type ${n} for map key at index ${e}.`);let r=oy(e,t);e+=Dy;let i=oy(e,t);e+=Dy,a[r]=i}return Dy=r+(e-i),a}function vy(e,t){e+=1;let n=e,r={};for(;e<t;){if(e>=t)throw Error(`unexpected end of map payload.`);if(wy[e]===255)return Dy=e-n+2,r;let i=(wy[e]&224)>>5;if(i!==Uv)throw Error(`unexpected major type ${i} for map key.`);let a=oy(e,t);e+=Dy;let o=oy(e,t);e+=Dy,r[a]=o}throw Error(`expected break marker.`)}function yy(e,t){let n=wy[e]&31;switch(n){case Yv:case Jv:return Dy=1,n===Yv;case Xv:return Dy=1,null;case Zv:return Dy=1,null;case $v:if(t-e<3)throw Error(`incomplete float16 at end of buf.`);return Dy=3,ly(wy[e+1],wy[e+2]);case ey:if(t-e<5)throw Error(`incomplete float32 at end of buf.`);return Dy=5,Ty.getFloat32(e+1);case ty:if(t-e<9)throw Error(`incomplete float64 at end of buf.`);return Dy=9,Ty.getFloat64(e+1);default:throw Error(`unexpected minor value ${n}.`)}}function by(e){if(typeof e==`number`)return e;let t=Number(e);return-(2**53-1)<=t&&t<=2**53-1?t:e}var xy,Sy,Cy,wy,Ty,Ey,Dy,Oy,ky=l((()=>{Ih(),xy=mf(),iy(),Sy=typeof TextDecoder<`u`,Cy=typeof Buffer<`u`,wy=Rv(0),Ty=new DataView(wy.buffer,wy.byteOffset,wy.byteLength),Ey=Sy?new TextDecoder:null,Dy=0,Oy={[Qv]:1,[$v]:2,[ey]:4,[ty]:8}}));function Ay(e){Q.byteLength-$<e&&My($<16e6?Math.max(Q.byteLength*4,Q.byteLength+e):Q.byteLength+e+16e6)}function jy(){let e=Rv($);return e.set(Q.subarray(0,$),0),$=0,e}function My(e){let t=Q;Q=Rv(e),t&&(t.copy?t.copy(Q,0,0,t.byteLength):Q.set(t,0)),Ly=new DataView(Q.buffer,Q.byteOffset,Q.byteLength)}function Ny(e,t){t<24?Q[$++]=e<<5|t:t<256?(Q[$++]=e<<5|24,Q[$++]=t):t<65536?(Q[$++]=e<<5|$v,Ly.setUint16($,t),$+=2):t<2**32?(Q[$++]=e<<5|ey,Ly.setUint32($,t),$+=4):(Q[$++]=e<<5|ty,Ly.setBigUint64($,typeof t==`bigint`?t:BigInt(t)),$+=8)}function Py(e){let t=[e];for(;t.length;){let e=t.pop();if(Ay(typeof e==`string`?e.length*4:64),typeof e==`string`){if(Iy)Ny(Uv,Buffer.byteLength(e)),$+=Q.write(e,$);else{let t=(0,Fy.fromUtf8)(e);Ny(Uv,t.byteLength),Q.set(t,$),$+=t.byteLength}continue}else if(typeof e==`number`){if(Number.isInteger(e)){let t=e>=0,n=t?Bv:Vv,r=t?e:-e-1;r<24?Q[$++]=n<<5|r:r<256?(Q[$++]=n<<5|24,Q[$++]=r):r<65536?(Q[$++]=n<<5|$v,Q[$++]=r>>8,Q[$++]=r):r<4294967296?(Q[$++]=n<<5|ey,Ly.setUint32($,r),$+=4):(Q[$++]=n<<5|ty,Ly.setBigUint64($,BigInt(r)),$+=8);continue}Q[$++]=qv<<5|ty,Ly.setFloat64($,e),$+=8;continue}else if(typeof e==`bigint`){let t=e>=0,n=t?Bv:Vv,r=t?e:-e-BigInt(1),i=Number(r);if(i<24)Q[$++]=n<<5|i;else if(i<256)Q[$++]=n<<5|24,Q[$++]=i;else if(i<65536)Q[$++]=n<<5|$v,Q[$++]=i>>8,Q[$++]=i&255;else if(i<4294967296)Q[$++]=n<<5|ey,Ly.setUint32($,i),$+=4;else if(r<BigInt(`18446744073709551616`))Q[$++]=n<<5|ty,Ly.setBigUint64($,r),$+=8;else{let e=r.toString(2),n=new Uint8Array(Math.ceil(e.length/8)),i=r,a=0;for(;n.byteLength-++a>=0;)n[n.byteLength-a]=Number(i&BigInt(255)),i>>=BigInt(8);Ay(n.byteLength*2),Q[$++]=t?194:195,Iy?Ny(Hv,Buffer.byteLength(n)):Ny(Hv,n.byteLength),Q.set(n,$),$+=n.byteLength}continue}else if(e===null){Q[$++]=qv<<5|Xv;continue}else if(typeof e==`boolean`){Q[$++]=qv<<5|(e?Yv:Jv);continue}else if(e===void 0)throw Error(`@smithy/core/cbor: client may not serialize undefined value.`);else if(Array.isArray(e)){for(let n=e.length-1;n>=0;--n)t.push(e[n]);Ny(Wv,e.length);continue}else if(typeof e.byteLength==`number`){Ay(e.length*2),Ny(Hv,e.length),Q.set(e,$),$+=e.byteLength;continue}else if(typeof e==`object`){if(e instanceof Nh){let n=e.string.indexOf(`.`),r=n===-1?0:n-e.string.length+1,i=BigInt(e.string.replace(`.`,``));Q[$++]=196,t.push(i),t.push(r),Ny(Wv,2);continue}if(e[ry])if(`tag`in e&&`value`in e){t.push(e.value),Ny(Kv,e.tag);continue}else throw Error(`tag encountered with missing fields, need 'tag' and 'value', found: `+JSON.stringify(e));let n=Object.keys(e);for(let r=n.length-1;r>=0;--r){let i=n[r];t.push(e[i]),t.push(i)}Ny(Gv,n.length);continue}throw Error(`data type ${e?.constructor?.name??typeof e} not compatible for encoding.`)}}var Fy,Iy,Q,Ly,$,Ry=l((()=>{Ih(),Fy=mf(),iy(),Iy=typeof Buffer<`u`,Q=Rv(2048),Ly=new DataView(Q.buffer,Q.byteOffset,Q.byteLength),$=0})),zy,By=l((()=>{ky(),Ry(),zy={deserialize(e){return ay(e),oy(0,e.length)},serialize(e){try{return Py(e),jy()}catch(e){throw jy(),e}},resizeEncodingBuffer(e){My(e)}}})),Vy,Hy,Uy=l((()=>{iy(),Vy=e=>zv({tag:1,value:e.getTime()/1e3}),Hy=(e,t)=>{let n=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t};if(t.__type!==void 0)return n(t.__type);let r=Object.keys(t).find(e=>e.toLowerCase()===`code`);if(r&&t[r]!==void 0)return n(t[r])}})),Wy,Gy,Ky,qy,Jy=l((()=>{xg(),Xp(),Ih(),Wy=gf(),By(),Uy(),Gy=class extends Lh{createSerializer(){let e=new Ky;return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new qy;return e.setSerdeContext(this.serdeContext),e}},Ky=class extends Lh{value;write(e,t){this.value=this.serialize(e,t)}serialize(e,t){let n=Lp.of(e);if(t==null)return n.isIdempotencyToken()?(0,oh.v4)():t;if(n.isBlobSchema())return typeof t==`string`?(this.serdeContext?.base64Decoder??Wy.fromBase64)(t):t;if(n.isTimestampSchema())return Vy(typeof t==`number`||typeof t==`bigint`?new Date(Number(t)/1e3|0):t);if(typeof t==`function`||typeof t==`object`){let e=t;if(n.isListSchema()&&Array.isArray(e)){let t=!!n.getMergedTraits().sparse,r=[],i=0;for(let a of e){let e=this.serialize(n.getValueSchema(),a);(e!=null||t)&&(r[i++]=e)}return r}if(e instanceof Date)return Vy(e);let r={};if(n.isMapSchema()){let t=!!n.getMergedTraits().sparse;for(let i of Object.keys(e)){let a=this.serialize(n.getValueSchema(),e[i]);(a!=null||t)&&(r[i]=a)}}else if(n.isStructSchema()){for(let[t,i]of n.structIterator()){let n=this.serialize(i,e[t]);n!=null&&(r[t]=n)}if(n.isUnionSchema()&&Array.isArray(e.$unknown)){let[t,n]=e.$unknown;r[t]=n}else if(typeof e.__type==`string`)for(let[t,n]of Object.entries(e))t in r||(r[t]=this.serialize(15,n))}else if(n.isDocumentSchema())for(let t of Object.keys(e))r[t]=this.serialize(n.getValueSchema(),e[t]);else if(n.isBigDecimalSchema())return e;return r}return t}flush(){let e=zy.serialize(this.value);return this.value=void 0,e}},qy=class extends Lh{read(e,t){let n=zy.deserialize(t);return this.readValue(e,n)}readValue(e,t){let n=Lp.of(e);if(n.isTimestampSchema()){if(typeof t==`number`)return Ch(t);if(typeof t==`object`&&t.tag===1&&`value`in t)return Ch(t.value)}if(n.isBlobSchema())return typeof t==`string`?(this.serdeContext?.base64Decoder??Wy.fromBase64)(t):t;if(t===void 0||typeof t==`boolean`||typeof t==`number`||typeof t==`string`||typeof t==`bigint`||typeof t==`symbol`)return t;if(typeof t==`object`){if(t===null)return null;if(`byteLength`in t||t instanceof Date||n.isDocumentSchema())return t;if(n.isListSchema()){let e=[],r=n.getValueSchema();for(let n of t){let t=this.readValue(r,n);e.push(t)}return e}let e={};if(n.isMapSchema()){let r=n.getValueSchema();for(let n of Object.keys(t))e[n]=this.readValue(r,t[n])}else if(n.isStructSchema()){let r=n.isUnionSchema(),i;r&&(i=new Set(Object.keys(t).filter(e=>e!==`__type`)));for(let[a,o]of n.structIterator())r&&i.delete(a),t[a]!=null&&(e[a]=this.readValue(o,t[a]));if(r&&i?.size===1&&Object.keys(e).length===0){let n=i.values().next().value;e.$unknown=[n,t[n]]}else if(typeof t.__type==`string`)for(let[n,r]of Object.entries(t))n in e||(e[n]=r)}else if(t instanceof Nh)return t;return e}else return t}}})),Yy,Xy,Zy=l((()=>{xg(),Xp(),Yy=Pd(),Jy(),Uy(),Xy=class extends Qh{codec=new Gy;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t})}getShapeId(){return`smithy.protocols#rpcv2Cbor`}getPayloadCodec(){return this.codec}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);if(Object.assign(r.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":`rpc-v2-cbor`,accept:this.getDefaultContentType()}),Wf(e.input)===`unit`)delete r.body,delete r.headers[`content-type`];else{r.body||=(this.serializer.write(15,{}),this.serializer.flush());try{r.headers[`content-length`]=String(r.body.byteLength)}catch{}}let{service:i,operation:a}=(0,Yy.getSmithyContext)(n),o=`/service/${i}/operation/${a}`;return r.path.endsWith(`/`)?r.path+=o.slice(1):r.path+=o,r}async deserializeResponse(e,t,n){return super.deserializeResponse(e,t,n)}async handleError(e,t,n,r,i){let a=Hy(n,r)??`Unknown`,o={$metadata:i,$fault:n.statusCode<=500?`client`:`server`},s=this.options.defaultNamespace;a.includes(`#`)&&([s]=a.split(`#`));let c=this.compositeErrorRegistry,l=qp.for(s);c.copyFrom(l);let u;try{u=c.getSchema(a)}catch{r.Message&&(r.message=r.Message);let e=qp.for(`smithy.ts.sdk.synthetic.`+s);c.copyFrom(e);let t=c.getBaseException();if(t){let e=c.getErrorCtor(t);throw Object.assign(new e({name:a}),o,r)}throw Object.assign(Error(a),o,r)}let d=Lp.of(u),f=c.getErrorCtor(u),p=r.message??r.Message??`Unknown`,m=new f(p),h={};for(let[e,t]of d.structIterator())h[e]=this.deserializer.readValue(t,r[e]);throw Object.assign(m,o,{$fault:d.getMergedTraits().error,message:p},h)}getDefaultContentType(){return`application/cbor`}}})),Qy=l((()=>{Uy(),Zy(),Jy()})),$y,eb,tb=l((()=>{Xp(),$y=w_(),eb=class{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){let n=t.getMemberSchemas(),r=Object.values(n).find(e=>!!e.getMergedTraits().httpPayload);if(r)return r.getMergedTraits().mediaType||(r.isStringSchema()?`text/plain`:r.isBlobSchema()?`application/octet-stream`:e);if(!t.isUnitSchema()&&Object.values(n).find(e=>{let{httpQuery:t,httpQueryParams:n,httpHeader:r,httpLabel:i,httpPrefixHeaders:a}=e.getMergedTraits();return!t&&!n&&!r&&!i&&a===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,r,i,a){let o=e;e.includes(`#`)&&([,o]=e.split(`#`));let s={$metadata:i,$fault:n.statusCode<500?`client`:`server`};if(!this.errorRegistry)throw Error(`@aws-sdk/core/protocols - error handler not initialized.`);try{return{errorSchema:a?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:s}}catch{r.message=r.message??r.Message??`UnknownError`;let e=this.errorRegistry,t=e.getBaseException();if(t){let n=e.getErrorCtor(t)??Error;throw this.decorateServiceException(Object.assign(new n({name:o}),s),r)}let n=r,i=n?.message??n?.Message??n?.Error?.Message??n?.Error?.message;throw this.decorateServiceException(Object.assign(Error(i),{name:o},s),r)}}compose(e,t,n){let r=n;t.includes(`#`)&&([r]=t.split(`#`));let i=qp.for(r),a=qp.for(`smithy.ts.sdk.synthetic.`+n);e.copyFrom(i),e.copyFrom(a),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){let n=e.Message??t.Message,r=(0,$y.decorateServiceException)(e,t);n&&(r.message=n),r.Error={...r.Error,Type:r.Error?.Type,Code:r.Error?.Code,Message:r.Error?.message??r.Error?.Message??n};let i=r.$metadata.requestId;return i&&(r.RequestId=i),r}return(0,$y.decorateServiceException)(e,t)}setQueryCompatError(e,t){let n=t.headers?.[`x-amzn-query-error`];if(e!==void 0&&n!=null){let[t,r]=n.split(`;`),i=Object.entries(e),a={Code:t,Type:r};Object.assign(e,a);for(let[e,t]of i)a[e===`message`?`Message`:e]=t;delete a.__type,e.Error=a}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(e=>Lp.of(e).getMergedTraits().awsQueryError?.[0]===t)}}}})),nb,rb=l((()=>{Qy(),Xp(),tb(),nb=class extends Xy{awsQueryCompatible;mixin;constructor({defaultNamespace:e,errorTypeRegistries:t,awsQueryCompatible:n}){super({defaultNamespace:e,errorTypeRegistries:t}),this.awsQueryCompatible=!!n,this.mixin=new eb(this.awsQueryCompatible)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return this.awsQueryCompatible&&(r.headers[`x-amzn-query-mode`]=`true`),r}async handleError(e,t,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);let a=(()=>{let e=n.headers[`x-amzn-query-error`];return e&&this.awsQueryCompatible?e.split(`;`)[0]:Hy(n,r)??`Unknown`})();this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),c=Lp.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l),d={};for(let[e,t]of c.structIterator())r[e]!=null&&(d[e]=this.deserializer.readValue(t,r[e]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,d),this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}}})),ib,ab,ob,sb=l((()=>{ib=e=>{if(e==null)return e;if(typeof e==`number`||typeof e==`bigint`){let t=Error(`Received number ${e} where a string was expected.`);return t.name=`Warning`,console.warn(t),String(e)}if(typeof e==`boolean`){let t=Error(`Received boolean ${e} where a string was expected.`);return t.name=`Warning`,console.warn(t),String(e)}return e},ab=e=>{if(e==null)return e;if(typeof e==`string`){let t=e.toLowerCase();if(e!==``&&t!==`false`&&t!==`true`){let t=Error(`Received string "${e}" where a boolean was expected.`);t.name=`Warning`,console.warn(t)}return e!==``&&t!==`false`}return e},ob=e=>{if(e==null)return e;if(typeof e==`string`){let t=Number(e);if(t.toString()!==e){let t=Error(`Received string "${e}" where a number was expected.`);return t.name=`Warning`,console.warn(t),e}return t}return e}})),cb,lb=l((()=>{cb=class{serdeContext;setSerdeContext(e){this.serdeContext=e}}})),ub,db=l((()=>{ub=class{from;to;keys;constructor(e,t){this.from=e,this.to=t,this.keys=new Set(Object.keys(this.from).filter(e=>e!==`__type`))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}}));function fb(e,t,n){if(n?.source){let e=n.source;if(typeof t==`number`&&(t>2**53-1||t<-(2**53-1)||e!==String(t)))return e.includes(`.`)?new Nh(e,`bigDecimal`):BigInt(e)}return t}var pb=l((()=>{Ih()})),mb,hb,gb,_b=l((()=>{mb=w_(),hb=mf(),gb=(e,t)=>(0,mb.collectBody)(e,t).then(e=>(t?.utf8Encoder??hb.toUtf8)(e))})),vb,yb,bb,xb=l((()=>{_b(),vb=(e,t)=>gb(e,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(t){throw t?.name===`SyntaxError`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}return{}}),yb=async(e,t)=>{let n=await vb(e,t);return n.message=n.message??n.Message,n},bb=(e,t)=>{let n=(e,t)=>Object.keys(e).find(e=>e.toLowerCase()===t.toLowerCase()),r=e=>{let t=e;return typeof t==`number`&&(t=t.toString()),t.indexOf(`,`)>=0&&(t=t.split(`,`)[0]),t.indexOf(`:`)>=0&&(t=t.split(`:`)[0]),t.indexOf(`#`)>=0&&(t=t.split(`#`)[1]),t},i=n(e.headers,`x-amzn-errortype`);if(i!==void 0)return r(e.headers[i]);if(t&&typeof t==`object`){let e=n(t,`code`);if(e&&t[e]!==void 0)return r(t[e]);if(t.__type!==void 0)return r(t.__type)}}})),Sb,Cb,wb=l((()=>{xg(),Xp(),Ih(),Sb=gf(),lb(),db(),pb(),xb(),Cb=class extends cb{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,typeof t==`string`?JSON.parse(t,fb):await vb(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){let n=typeof t==`object`&&!!t,r=Lp.of(e);if(n){if(r.isStructSchema()){let e=t,n=r.isUnionSchema(),i={},a,{jsonName:o}=this.settings;o&&(a={});let s;n&&(s=new ub(e,i));for(let[t,c]of r.structIterator()){let r=t;o&&(r=c.getMergedTraits().jsonName??r,a[r]=t),n&&s.mark(r),e[r]!=null&&(i[t]=this._read(c,e[r]))}if(n)s.writeUnknown();else if(typeof e.__type==`string`)for(let[t,n]of Object.entries(e)){let e=o?a[t]??t:t;e in i||(i[e]=n)}return i}if(Array.isArray(t)&&r.isListSchema()){let e=r.getValueSchema(),n=[];for(let r of t)n.push(this._read(e,r));return n}if(r.isMapSchema()){let e=r.getValueSchema(),n={};for(let[r,i]of Object.entries(t))n[r]=this._read(e,i);return n}}if(r.isBlobSchema()&&typeof t==`string`)return(0,Sb.fromBase64)(t);let i=r.getMergedTraits().mediaType;if(r.isStringSchema()&&typeof t==`string`&&i)return i===`application/json`||i.endsWith(`+json`)?ch.from(t):t;if(r.isTimestampSchema()&&t!=null)switch(og(r,this.settings)){case 5:return zm(t);case 6:return Um(t);case 7:return Wm(t);default:return console.warn(`Missing timestamp format, parsing value with Date constructor:`,t),new Date(t)}if(r.isBigIntegerSchema()&&(typeof t==`number`||typeof t==`string`))return BigInt(t);if(r.isBigDecimalSchema()&&t!=null){if(t instanceof Nh)return t;let e=t;return e.type===`bigDecimal`&&`string`in e?new Nh(e.string,e.type):new Nh(String(t),`bigDecimal`)}if(r.isNumericSchema()&&typeof t==`string`){switch(t){case`Infinity`:return 1/0;case`-Infinity`:return-1/0;case`NaN`:return NaN}return t}if(r.isDocumentSchema())if(n){let e=Array.isArray(t)?[]:{};for(let[n,i]of Object.entries(t))i instanceof Nh?e[n]=i:e[n]=this._read(r,i);return e}else return structuredClone(t);return t}}})),Tb,Eb,Db=l((()=>{Ih(),Tb=`Ν`,Eb=class{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw Error(`@aws-sdk/core/protocols - JsonReplacer already created.`);if(this.stage===2)throw Error(`@aws-sdk/core/protocols - JsonReplacer exhausted.`);return this.stage=1,(e,t)=>{if(t instanceof Nh){let e=`${Tb+`nv`+ this.counter++}_`+t.string;return this.values.set(`"${e}"`,t.string),e}if(typeof t==`bigint`){let e=t.toString(),n=`${Tb+`b`+ this.counter++}_`+e;return this.values.set(`"${n}"`,e),n}return t}}replaceInJson(e){if(this.stage===0)throw Error(`@aws-sdk/core/protocols - JsonReplacer not created yet.`);if(this.stage===2)throw Error(`@aws-sdk/core/protocols - JsonReplacer exhausted.`);if(this.stage=2,this.counter===0)return e;for(let[t,n]of this.values)e=e.replace(t,n);return e}}})),Ob,kb,Ab=l((()=>{xg(),Xp(),Ih(),Ob=gf(),lb(),Db(),kb=class extends cb{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=Lp.of(e),this.buffer=this._write(this.rootSchema,t)}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer==`object`&&(this.buffer.__type=Lp.of(e).getName(!0))}flush(){let{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);let e=new Eb;return e.replaceInJson(JSON.stringify(this.buffer,e.createReplacer(),0))}return this.buffer}_write(e,t,n){let r=typeof t==`object`&&!!t,i=Lp.of(e);if(r){if(i.isStructSchema()){let e=t,n={},{jsonName:r}=this.settings,a;r&&(a={});for(let[t,o]of i.structIterator()){let s=this._write(o,e[t],i);if(s!==void 0){let e=t;r&&(e=o.getMergedTraits().jsonName??t,a[t]=e),n[e]=s}}if(i.isUnionSchema()&&Object.keys(n).length===0){let{$unknown:t}=e;if(Array.isArray(t)){let[e,r]=t;n[e]=this._write(15,r)}}else if(typeof e.__type==`string`)for(let[t,i]of Object.entries(e)){let e=r?a[t]??t:t;e in n||(n[e]=this._write(15,i))}return n}if(Array.isArray(t)&&i.isListSchema()){let e=i.getValueSchema(),n=[],r=!!i.getMergedTraits().sparse;for(let i of t)(r||i!=null)&&n.push(this._write(e,i));return n}if(i.isMapSchema()){let e=i.getValueSchema(),n={},r=!!i.getMergedTraits().sparse;for(let[i,a]of Object.entries(t))(r||a!=null)&&(n[i]=this._write(e,a));return n}if(t instanceof Uint8Array&&(i.isBlobSchema()||i.isDocumentSchema()))return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??Ob.toBase64)(t);if(t instanceof Date&&(i.isTimestampSchema()||i.isDocumentSchema()))switch(og(i,this.settings)){case 5:return t.toISOString().replace(`.000Z`,`Z`);case 6:return Nm(t);case 7:return t.getTime()/1e3;default:return console.warn(`Missing timestamp format, using epoch seconds`,t),t.getTime()/1e3}t instanceof Nh&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(i.isStringSchema()){if(t===void 0&&i.isIdempotencyToken())return(0,oh.v4)();let e=i.getMergedTraits().mediaType;return t!=null&&e&&(e===`application/json`||e.endsWith(`+json`))?ch.from(t):t}if(typeof t==`number`&&i.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t==`string`&&i.isBlobSchema())return i===this.rootSchema?t:(this.serdeContext?.base64Encoder??Ob.toBase64)(t);if(typeof t==`bigint`&&(this.useReplacer=!0),i.isDocumentSchema())if(r){let e=Array.isArray(t)?[]:{};for(let[n,r]of Object.entries(t))r instanceof Nh?(this.useReplacer=!0,e[n]=r):e[n]=this._write(i,r);return e}else return structuredClone(t);return t}}}})),jb,Mb=l((()=>{lb(),wb(),Ab(),jb=class extends cb{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new kb(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Cb(this.settings);return e.setSerdeContext(this.serdeContext),e}}})),Nb,Pb=l((()=>{xg(),Xp(),tb(),Mb(),xb(),Nb=class extends Qh{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=i??new jb({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!r,this.mixin=new eb(this.awsQueryCompatible)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return r.path.endsWith(`/`)||(r.path+=`/`),Object.assign(r.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${e.name}`}),this.awsQueryCompatible&&(r.headers[`x-amzn-query-mode`]=`true`),(Wf(e.input)===`unit`||!r.body)&&(r.body=`{}`),r}getPayloadCodec(){return this.codec}async handleError(e,t,n,r,i){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);let a=bb(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),c=Lp.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l),d={};for(let[e,t]of c.structIterator())r[e]!=null&&(d[e]=this.codec.createDeserializer().readObject(t,r[e]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,d),this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}}})),Fb,Ib=l((()=>{Pb(),Fb=class extends Nb{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i})}getShapeId(){return`aws.protocols#awsJson1_0`}getJsonRpcVersion(){return`1.0`}getDefaultContentType(){return`application/x-amz-json-1.0`}}})),Lb,Rb=l((()=>{Pb(),Lb=class extends Nb{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:r,jsonCodec:i})}getShapeId(){return`aws.protocols#awsJson1_1`}getJsonRpcVersion(){return`1.1`}getDefaultContentType(){return`application/x-amz-json-1.1`}}})),zb,Bb=l((()=>{xg(),Xp(),tb(),Mb(),xb(),zb=class extends Yh{serializer;deserializer;codec;mixin=new eb;constructor({defaultNamespace:e,errorTypeRegistries:t}){super({defaultNamespace:e,errorTypeRegistries:t});let n={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=new jb(n),this.serializer=new vg(this.codec.createSerializer(),n),this.deserializer=new pg(this.codec.createDeserializer(),n)}getShapeId(){return`aws.protocols#restJson1`}getPayloadCodec(){return this.codec}setSerdeContext(e){this.codec.setSerdeContext(e),super.setSerdeContext(e)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n),i=Lp.of(e.input);if(!r.headers[`content-type`]){let e=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);e&&(r.headers[`content-type`]=e)}return r.body==null&&r.headers[`content-type`]===this.getDefaultContentType()&&(r.body=`{}`),r}async deserializeResponse(e,t,n){let r=await super.deserializeResponse(e,t,n),i=Lp.of(e.output);for(let[e,t]of i.structIterator())t.getMemberTraits().httpPayload&&!(e in r)&&(r[e]=null);return r}async handleError(e,t,n,r,i){let a=bb(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i),c=Lp.of(o),l=r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l);await this.deserializeHttpMessage(o,t,n,r);let d={};for(let[e,t]of c.structIterator()){let n=t.getMergedTraits().jsonName??e;d[e]=this.codec.createDeserializer().readObject(t,r[n])}throw this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}getDefaultContentType(){return`application/json`}}})),Vb,Hb,Ub=l((()=>{Vb=w_(),Hb=e=>{if(e!=null)return typeof e==`object`&&`__type`in e&&delete e.__type,(0,Vb.expectUnion)(e)}})),Wb=u(((e,t)=>{(()=>{var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,`__esModule`,{value:!0})}},n={};e.r(n),e.d(n,{XMLBuilder:()=>Xe,XMLParser:()=>Ie,XMLValidator:()=>Ze});let r=RegExp(`^[: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][: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\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function i(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}let a=function(e){return r.exec(e)!=null},o=[`hasOwnProperty`,`toString`,`valueOf`,`__defineGetter__`,`__defineSetter__`,`__lookupGetter__`,`__lookupSetter__`],s=[`__proto__`,`constructor`,`prototype`],c={allowBooleanAttributes:!1,unpairedTags:[]};function l(e,t){t=Object.assign({},c,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=d(e,a),a.err)return a}else{if(e[a]!==`<`){if(u(e[a]))continue;return _(`InvalidChar`,`char '`+e[a]+`' is not expected.`,b(e,a))}{let o=a;if(a++,e[a]===`!`){a=f(e,a);continue}{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
|
|
63
63
|
`&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!y(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,_(`InvalidTag`,t,b(e,a))}let l=p(e,a);if(!1===l)return _(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,b(e,a));let m=l.value;if(a=l.index,m[m.length-1]===`/`){let n=a-m.length;m=m.substring(0,m.length-1);let i=h(m,t);if(!0!==i)return _(i.err.code,i.err.msg,b(e,n+i.err.line));r=!0}else if(s){if(!l.tagClosed)return _(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,b(e,a));if(m.trim().length>0)return _(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,b(e,o));if(n.length===0)return _(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,b(e,o));{let t=n.pop();if(c!==t.tagName){let n=b(e,t.tagStartPos);return _(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,b(e,o))}n.length==0&&(i=!0)}}else{let s=h(m,t);if(!0!==s)return _(s.err.code,s.err.msg,b(e,a-m.length+s.err.line));if(!0===i)return _(`InvalidXml`,`Multiple possible root nodes found.`,b(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`){if(e[a+1]===`!`){a++,a=f(e,a);continue}if(e[a+1]!==`?`)break;if(a=d(e,++a),a.err)return a}else if(e[a]===`&`){let t=g(e,a);if(t==-1)return _(`InvalidChar`,`char '&' is not expected.`,b(e,a));a=t}else if(!0===i&&!u(e[a]))return _(`InvalidXml`,`Extra text at the end`,b(e,a));e[a]===`<`&&a--}}}return r?n.length==1?_(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,b(e,n[0].tagStartPos)):!(n.length>0)||_(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1}):_(`InvalidXml`,`Start tag expected.`,1)}function u(e){return e===` `||e===` `||e===`
|
|
64
64
|
`||e===`\r`}function d(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return _(`InvalidXml`,`XML declaration allowed only at the start of the document.`,b(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}continue}return t}function f(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&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}function p(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``&&{value:n,index:t,tagClosed:i}}let m=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function h(e,t){let n=i(e,m),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return _(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,x(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return _(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,x(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return _(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,x(n[e]));let i=n[e][2];if(!v(i))return _(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,x(n[e]));if(Object.prototype.hasOwnProperty.call(r,i))return _(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,x(n[e]));r[i]=1}return!0}function g(e,t){if(e[++t]===`;`)return-1;if(e[t]===`#`)return function(e,t){let n=/\d/;for(e[t]===`x`&&(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 _(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function v(e){return a(e)}function y(e){return a(e)}function b(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function x(e){return e.startIndex+e[1].length}let S=e=>o.includes(e)?`__`+e:e,C={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:S};function w(e,t){if(typeof e!=`string`)return;let n=e.toLowerCase();if(o.some(e=>n===e.toLowerCase())||s.some(e=>n===e.toLowerCase()))throw Error(`[SECURITY] Invalid ${t}: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`)}function ee(e){return typeof e==`boolean`?{enabled:e,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof e==`object`&&e?{enabled:!1!==e.enabled,maxEntitySize:Math.max(1,e.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,e.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,e.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,e.maxExpandedLength??1e5),maxEntityCount:Math.max(1,e.maxEntityCount??100),allowedTags:e.allowedTags??null,tagFilter:e.tagFilter??null}:ee(!0)}let te=function(e){let t=Object.assign({},C,e),n=[{value:t.attributeNamePrefix,name:`attributeNamePrefix`},{value:t.attributesGroupName,name:`attributesGroupName`},{value:t.textNodeName,name:`textNodeName`},{value:t.cdataPropName,name:`cdataPropName`},{value:t.commentPropName,name:`commentPropName`}];for(let{value:e,name:t}of n)e&&w(e,t);return t.onDangerousProperty===null&&(t.onDangerousProperty=S),t.processEntities=ee(t.processEntities),t.stopNodes&&Array.isArray(t.stopNodes)&&(t.stopNodes=t.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),t},T;T=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;class E{constructor(e){this.tagname=e,this.child=[],this[`:@`]=Object.create(null)}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][T]={startIndex:t})}static getMetaDataSymbol(){return T}}class ne{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){let n=Object.create(null),r=0;if(e[t+3]!==`O`||e[t+4]!==`C`||e[t+5]!==`T`||e[t+6]!==`Y`||e[t+7]!==`P`||e[t+8]!==`E`)throw Error(`Invalid Tag instead of DOCTYPE`);{t+=9;let i=1,a=!1,o=!1,s=``;for(;t<e.length;t++)if(e[t]!==`<`||o)if(e[t]===`>`){if(o?e[t-1]===`-`&&e[t-2]===`-`&&(o=!1,i--):i--,i===0)break}else e[t]===`[`?a=!0:s+=e[t];else{if(a&&ie(e,`!ENTITY`,t)){let i,a;if(t+=7,[i,a,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),a.indexOf(`&`)===-1){if(!1!==this.options.enabled&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);let e=i.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);n[i]={regx:RegExp(`&${e};`,`g`),val:a},r++}}else if(a&&ie(e,`!ELEMENT`,t)){t+=8;let{index:n}=this.readElementExp(e,t+1);t=n}else if(a&&ie(e,`!ATTLIST`,t))t+=8;else if(a&&ie(e,`!NOTATION`,t)){t+=9;let{index:n}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=n}else{if(!ie(e,`!--`,t))throw Error(`Invalid DOCTYPE`);o=!0}i++,s=``}if(i!==0)throw Error(`Unclosed DOCTYPE`)}return{entities:n,i:t}}readEntityExp(e,t){let n=t=re(e,t);for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)t++;let r=e.substring(n,t);if(ae(r),t=re(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`)}let i=``;if([t,i]=this.readIdentifierVal(e,t,`entity`),!1!==this.options.enabled&&this.options.maxEntitySize!=null&&i.length>this.options.maxEntitySize)throw Error(`Entity "${r}" size (${i.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return[r,i,--t]}readNotationExp(e,t){let n=t=re(e,t);for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);!this.suppressValidationErr&&ae(r),t=re(e,t);let i=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&i!==`SYSTEM`&&i!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${i}"`);t+=i.length,t=re(e,t);let a=null,o=null;if(i===`PUBLIC`)[t,a]=this.readIdentifierVal(e,t,`publicIdentifier`),e[t=re(e,t)]!==`"`&&e[t]!==`'`||([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`));else if(i===`SYSTEM`&&([t,o]=this.readIdentifierVal(e,t,`systemIdentifier`),!this.suppressValidationErr&&!o))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:r,publicIdentifier:a,systemIdentifier:o,index:--t}}readIdentifierVal(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);let a=++t;for(;t<e.length&&e[t]!==i;)t++;if(r=e.substring(a,t),e[t]!==i)throw Error(`Unterminated ${n} value`);return[++t,r]}readElementExp(e,t){let n=t=re(e,t);for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);if(!this.suppressValidationErr&&!a(r))throw Error(`Invalid element name: "${r}"`);let i=``;if(e[t=re(e,t)]===`E`&&ie(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&ie(e,`NY`,t))t+=2;else if(e[t]===`(`){let n=++t;for(;t<e.length&&e[t]!==`)`;)t++;if(i=e.substring(n,t),e[t]!==`)`)throw Error(`Unterminated content model`)}else if(!this.suppressValidationErr)throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:i.trim(),index:t}}readAttlistExp(e,t){let n=t=re(e,t);for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(n,t);for(ae(r),n=t=re(e,t);t<e.length&&!/\s/.test(e[t]);)t++;let i=e.substring(n,t);if(!ae(i))throw Error(`Invalid attribute name: "${i}"`);t=re(e,t);let a=``;if(e.substring(t,t+8).toUpperCase()===`NOTATION`){if(a=`NOTATION`,e[t=re(e,t+=8)]!==`(`)throw Error(`Expected '(', found "${e[t]}"`);t++;let n=[];for(;t<e.length&&e[t]!==`)`;){let r=t;for(;t<e.length&&e[t]!==`|`&&e[t]!==`)`;)t++;let i=e.substring(r,t);if(i=i.trim(),!ae(i))throw Error(`Invalid notation name: "${i}"`);n.push(i),e[t]===`|`&&(t++,t=re(e,t))}if(e[t]!==`)`)throw Error(`Unterminated list of notations`);t++,a+=` (`+n.join(`|`)+`)`}else{let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;if(a+=e.substring(n,t),!this.suppressValidationErr&&![`CDATA`,`ID`,`IDREF`,`IDREFS`,`ENTITY`,`ENTITIES`,`NMTOKEN`,`NMTOKENS`].includes(a.toUpperCase()))throw Error(`Invalid attribute type: "${a}"`)}t=re(e,t);let o=``;return e.substring(t,t+8).toUpperCase()===`#REQUIRED`?(o=`#REQUIRED`,t+=8):e.substring(t,t+7).toUpperCase()===`#IMPLIED`?(o=`#IMPLIED`,t+=7):[t,o]=this.readIdentifierVal(e,t,`ATTLIST`),{elementName:r,attributeName:i,attributeType:a,defaultValue:o,index:t}}}let re=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function ie(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function ae(e){if(a(e))return e;throw Error(`Invalid entity name ${e}`)}let oe=/^[-+]?0x[a-fA-F0-9]+$/,se=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,ce={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0,infinity:`original`},le=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/,ue=new Set([`push`,`pop`,`reset`,`updateCurrent`,`restore`]);class de{constructor(e={}){this.separator=e.separator||`.`,this.path=[],this.siblingStacks=[]}push(e,t=null,n=null){this.path.length>0&&(this.path[this.path.length-1].values=void 0);let r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);let i=this.siblingStacks[r],a=n?`${n}:${e}`:e,o=i.get(a)||0,s=0;for(let e of i.values())s+=e;i.set(a,o+1);let c={tag:e,position:s,counter:o};n!=null&&(c.namespace=n),t!=null&&(c.values=t),this.path.push(c)}pop(){if(this.path.length===0)return;let e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){let t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){if(this.path.length!==0)return this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;let t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){let n=e||this.separator;return this.path.map(e=>t&&e.namespace?`${e.namespace}:${e.tag}`:e.tag).join(n)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){let t=e.segments;return t.length!==0&&(e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t))}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++){let n=e[t],r=this.path[t],i=t===this.path.length-1;if(!this._matchSegment(n,r,i))return!1}return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,n=e.length-1;for(;n>=0&&t>=0;){let r=e[n];if(r.type===`deep-wildcard`){if(n--,n<0)return!0;let r=e[n],i=!1;for(let e=t;e>=0;e--){let a=e===this.path.length-1;if(this._matchSegment(r,this.path[e],a)){t=e-1,n--,i=!0;break}}if(!i)return!1}else{let e=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],e))return!1;t--,n--}}return n<0}_matchSegment(e,t,n){if(e.tag!==`*`&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!==`*`&&e.namespace!==t.namespace)return!1;if(e.attrName!==void 0){if(!n||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){let n=t.values[e.attrName];if(String(n)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!n)return!1;let r=t.counter??0;if(e.position===`first`&&r!==0||e.position===`odd`&&r%2!=1||e.position===`even`&&r%2!=0||e.position===`nth`&&r!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(e=>({...e})),this.siblingStacks=e.siblingStacks.map(e=>new Map(e))}readOnly(){return new Proxy(this,{get(e,t,n){if(ue.has(t))return()=>{throw TypeError(`Cannot call '${t}' on a read-only Matcher. Obtain a writable instance to mutate state.`)};let r=Reflect.get(e,t,n);return t===`path`||t===`siblingStacks`?Object.freeze(Array.isArray(r)?r.map(e=>e instanceof Map?Object.freeze(new Map(e)):Object.freeze({...e})):r):typeof r==`function`?r.bind(e):r},set(e,t){throw TypeError(`Cannot set property '${String(t)}' on a read-only Matcher.`)},deleteProperty(e,t){throw TypeError(`Cannot delete property '${String(t)}' from a read-only Matcher.`)}})}}class fe{constructor(e,t={}){this.pattern=e,this.separator=t.separator||`.`,this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(e=>e.type===`deep-wildcard`),this._hasAttributeCondition=this.segments.some(e=>e.attrName!==void 0),this._hasPositionSelector=this.segments.some(e=>e.position!==void 0)}_parse(e){let t=[],n=0,r=``;for(;n<e.length;)e[n]===this.separator?n+1<e.length&&e[n+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=``),t.push({type:`deep-wildcard`}),n+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r=``,n++):(r+=e[n],n++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){let t={type:`tag`},n=null,r=e,i=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(i&&(r=i[1]+i[3],i[2])){let e=i[2].slice(1,-1);e&&(n=e)}let a,o,s=r;if(r.includes(`::`)){let t=r.indexOf(`::`);if(a=r.substring(0,t).trim(),s=r.substring(t+2).trim(),!a)throw Error(`Invalid namespace in pattern: ${e}`)}let c=null;if(s.includes(`:`)){let e=s.lastIndexOf(`:`),t=s.substring(0,e).trim(),n=s.substring(e+1).trim();[`first`,`last`,`odd`,`even`].includes(n)||/^nth\(\d+\)$/.test(n)?(o=t,c=n):o=s}else o=s;if(!o)throw Error(`Invalid segment pattern: ${e}`);if(t.tag=o,a&&(t.namespace=a),n)if(n.includes(`=`)){let e=n.indexOf(`=`);t.attrName=n.substring(0,e).trim(),t.attrValue=n.substring(e+1).trim()}else t.attrName=n.trim();if(c){let e=c.match(/^nth\((\d+)\)$/);e?(t.position=`nth`,t.positionValue=parseInt(e[1],10)):t.position=c}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}function pe(e,t){if(!e)return{};let n=t.attributesGroupName?e[t.attributesGroupName]:e;if(!n)return{};let r={};for(let e in n)e.startsWith(t.attributeNamePrefix)?r[e.substring(t.attributeNamePrefix.length)]=n[e]:r[e]=n[e];return r}function me(e){if(!e||typeof e!=`string`)return;let t=e.indexOf(`:`);if(t!==-1&&t>0){let n=e.substring(0,t);if(n!==`xmlns`)return n}}class he{constructor(e){var t;if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>k(t,10,`&#`)},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>k(t,16,`&#x`)}},this.addExternalEntities=ge,this.parseXml=D,this.parseTextData=_e,this.resolveNameSpace=ve,this.buildAttributesMap=be,this.isItStopNode=we,this.replaceEntitiesValue=Se,this.readStopNodeData=O,this.saveTextToParentTag=Ce,this.addChild=xe,this.ignoreAttributesFn=typeof(t=this.options.ignoreAttributes)==`function`?t:Array.isArray(t)?e=>{for(let n of t)if(typeof n==`string`&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1,this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new de,this.readonlyMatcher=this.matcher.readOnly(),this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`?this.stopNodeExpressions.push(new fe(t)):t instanceof fe&&this.stopNodeExpressions.push(t)}}}}function ge(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n],i=r.replace(/[.\-+*:]/g,`\\.`);this.lastEntities[r]={regex:RegExp(`&`+i+`;`,`g`),val:e[r]}}}function _e(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e,t,n));let r=this.options.jPath?n.toString():n,s=this.options.tagValueProcessor(t,e,r,i,a);return s==null?e:typeof s!=typeof e||s!==e?s:this.options.trimValues||e.trim()===e?De(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function ve(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}let ye=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function be(e,t,n){if(!0!==this.options.ignoreAttributes&&typeof e==`string`){let r=i(e,ye),a=r.length,o={},s={};for(let e=0;e<a;e++){let t=this.resolveNameSpace(r[e][1]),i=r[e][4];if(t.length&&i!==void 0){let e=i;this.options.trimValues&&(e=e.trim()),e=this.replaceEntitiesValue(e,n,this.readonlyMatcher),s[t]=e}}Object.keys(s).length>0&&typeof t==`object`&&t.updateCurrent&&t.updateCurrent(s);for(let e=0;e<a;e++){let i=this.resolveNameSpace(r[e][1]),a=this.options.jPath?t.toString():this.readonlyMatcher;if(this.ignoreAttributesFn(i,a))continue;let s=r[e][4],c=this.options.attributeNamePrefix+i;if(i.length)if(this.options.transformAttributeName&&(c=this.options.transformAttributeName(c)),c=ke(c,this.options),s!==void 0){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s,n,this.readonlyMatcher);let e=this.options.jPath?t.toString():this.readonlyMatcher,r=this.options.attributeValueProcessor(i,s,e);o[c]=r==null?s:typeof r!=typeof s||r!==s?r:De(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(o[c]=!0)}if(!Object.keys(o).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=o,e}return o}}let D=function(e){e=e.replace(/\r\n?/g,`
|
|
65
65
|
`);let t=new E(`!xml`),n=t,r=``;this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;let i=new ne(this.options.processEntities);for(let a=0;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`/`){let t=Te(e,`>`,a,`Closing Tag is not closed.`),i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=i.indexOf(`:`);e!==-1&&(i=i.substr(e+1))}i=Oe(this.options.transformTagName,i,``,this.options).tagName,n&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher));let o=this.matcher.getCurrentTag();if(i&&this.options.unpairedTags.indexOf(i)!==-1)throw Error(`Unpaired tag can not be used as closing tag: </${i}>`);o&&this.options.unpairedTags.indexOf(o)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=Ee(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,this.readonlyMatcher),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new E(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,this.matcher,t.tagName)),this.addChild(n,e,this.readonlyMatcher,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=Te(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let i=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,this.readonlyMatcher),n.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=i.readDocType(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=Te(e,`]]>`,a,`CDATA is not closed.`)-2,i=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,this.readonlyMatcher);let o=this.parseTextData(i,n.tagname,this.readonlyMatcher,!0,!1,!0,!0);o??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):n.add(this.options.textNodeName,o),a=t+2}else{let i=Ee(e,a,this.options.removeNSPrefix);if(!i){let t=e.substring(Math.max(0,a-50),Math.min(e.length,a+50));throw Error(`readTagExp returned undefined at position ${a}. Context: "${t}"`)}let o=i.tagName,s=i.rawTagName,c=i.tagExp,l=i.attrExpPresent,u=i.closeIndex;if({tagName:o,tagExp:c}=Oe(this.options.transformTagName,o,c,this.options),this.options.strictReservedNames&&(o===this.options.commentPropName||o===this.options.cdataPropName||o===this.options.textNodeName||o===this.options.attributesGroupName))throw Error(`Invalid tag name: ${o}`);n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,this.readonlyMatcher,!1));let d=n;d&&this.options.unpairedTags.indexOf(d.tagname)!==-1&&(n=this.tagsNodeStack.pop(),this.matcher.pop());let f=!1;c.length>0&&c.lastIndexOf(`/`)===c.length-1&&(f=!0,o[o.length-1]===`/`?(o=o.substr(0,o.length-1),c=o):c=c.substr(0,c.length-1),l=o!==c);let p,m=null;p=me(s),o!==t.tagname&&this.matcher.push(o,{},p),o!==c&&l&&(m=this.buildAttributesMap(c,this.matcher,o),m&&pe(m,this.options)),o!==t.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));let h=a;if(this.isCurrentNodeStopNode){let t=``;if(f)a=i.closeIndex;else if(this.options.unpairedTags.indexOf(o)!==-1)a=i.closeIndex;else{let n=this.readStopNodeData(e,s,u+1);if(!n)throw Error(`Unexpected end of ${s}`);a=n.i,t=n.tagContent}let r=new E(o);m&&(r[`:@`]=m),r.add(this.options.textNodeName,t),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(n,r,this.readonlyMatcher,h)}else{if(f){({tagName:o,tagExp:c}=Oe(this.options.transformTagName,o,c,this.options));let e=new E(o);m&&(e[`:@`]=m),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else{if(this.options.unpairedTags.indexOf(o)!==-1){let e=new E(o);m&&(e[`:@`]=m),this.addChild(n,e,this.readonlyMatcher,h),this.matcher.pop(),this.isCurrentNodeStopNode=!1,a=i.closeIndex;continue}{let e=new E(o);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);this.tagsNodeStack.push(n),m&&(e[`:@`]=m),this.addChild(n,e,this.readonlyMatcher,h),n=e}}r=``,a=u}}else r+=e[a];return t.child};function xe(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.jPath?n.toString():n,a=this.options.updateTag(t.tagname,i,t[`:@`]);!1===a||(typeof a==`string`&&(t.tagname=a),e.addChild(t,r))}function Se(e,t,n){let r=this.options.processEntities;if(!r||!r.enabled)return e;if(r.allowedTags){let i=this.options.jPath?n.toString():n;if(!(Array.isArray(r.allowedTags)?r.allowedTags.includes(t):r.allowedTags(t,i)))return e}if(r.tagFilter){let i=this.options.jPath?n.toString():n;if(!r.tagFilter(t,i))return e}for(let t of Object.keys(this.docTypeEntities)){let n=this.docTypeEntities[t],i=e.match(n.regx);if(i){if(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions)throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);let t=e.length;if(e=e.replace(n.regx,n.val),r.maxExpandedLength&&(this.currentExpandedLength+=e.length-t,this.currentExpandedLength>r.maxExpandedLength))throw Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${r.maxExpandedLength}`)}}for(let t of Object.keys(this.lastEntities)){let n=this.lastEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}if(e.indexOf(`&`)===-1)return e;if(this.options.htmlEntities)for(let t of Object.keys(this.htmlEntities)){let n=this.htmlEntities[t],i=e.match(n.regex);if(i&&(this.entityExpansionCount+=i.length,r.maxTotalExpansions&&this.entityExpansionCount>r.maxTotalExpansions))throw Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${r.maxTotalExpansions}`);e=e.replace(n.regex,n.val)}return e.replace(this.ampEntity.regex,this.ampEntity.val)}function Ce(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),(e=this.parseTextData(e,t.tagname,n,!1,!!t[`:@`]&&Object.keys(t[`:@`]).length!==0,r))!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function we(e,t){if(!e||e.length===0)return!1;for(let n=0;n<e.length;n++)if(t.matches(e[n]))return!0;return!1}function Te(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function Ee(e,t,n,r=`>`){let i=function(e,t,n=`>`){let r,i=``;for(let a=t;a<e.length;a++){let t=e[a];if(r)t===r&&(r=``);else if(t===`"`||t===`'`)r=t;else if(t===n[0]){if(!n[1]||e[a+1]===n[1])return{data:i,index:a}}else t===` `&&(t=` `);i+=t}}(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function O(e,t,n){let r=n,i=1;for(;n<e.length;n++)if(e[n]===`<`)if(e[n+1]===`/`){let a=Te(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=Te(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=Te(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=Te(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=Ee(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function De(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`||t!==`false`&&function(e,t={}){if(t=Object.assign({},ce,t),!e||typeof e!=`string`)return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e===`0`)return 0;if(t.hex&&oe.test(n))return function(e){if(parseInt)return parseInt(e,16);if(Number.parseInt)return Number.parseInt(e,16);if(window&&window.parseInt)return window.parseInt(e,16);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}(n);if(isFinite(n)){if(n.includes(`e`)||n.includes(`E`))return function(e,t,n){if(!n.eNotation)return e;let r=t.match(le);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:(o.length!==1||!r[3].startsWith(`.${a}`)&&r[3][0]!==a)&&o.length>0?n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e:Number(t)}return e}(e,n,t);{let i=se.exec(n);if(i){let a=i[1]||``,o=i[2],s=((r=i[3])&&r.indexOf(`.`)!==-1&&((r=r.replace(/0+$/,``))===`.`?r=`0`:r[0]===`.`?r=`0`+r:r[r.length-1]===`.`&&(r=r.substring(0,r.length-1))),r),c=a?e[o.length+1]===`.`:e[o.length]===`.`;if(!t.leadingZeros&&(o.length>1||o.length===1&&!c))return e;{let r=Number(n),i=String(r);if(r===0)return r;if(i.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return i===`0`||i===s||i===`${a}${s}`?r:e;let c=o?s:n;return o?c===i||a+c===i?r:e:c===i||c===a+i?r:e}}return e}}var r;return function(e,t,n){let r=t===1/0;switch(n.infinity.toLowerCase()){case`null`:return null;case`infinity`:return t;case`string`:return r?`Infinity`:`-Infinity`;default:return e}}(e,Number(n),t)}(e,n)}return e===void 0?``:e}function k(e,t,n){let r=Number.parseInt(e,t);return r>=0&&r<=1114111?String.fromCodePoint(r):n+e+`;`}function Oe(e,t,n,r){if(e){let r=e(t);n===t&&(n=r),t=r}return{tagName:t=ke(t,r),tagExp:n}}function ke(e,t){if(s.includes(e))throw Error(`[SECURITY] Invalid name: "${e}" is a reserved JavaScript keyword that could cause prototype pollution`);return o.includes(e)?t.onDangerousProperty(e):e}let Ae=E.getMetaDataSymbol();function je(e,t){if(!e||typeof e!=`object`)return{};if(!t)return e;let n={};for(let r in e)r.startsWith(t)?n[r.substring(t.length)]=e[r]:n[r]=e[r];return n}function Me(e,t,n,r){return Ne(e,t,n,r)}function Ne(e,t,n,r){let i,a={};for(let o=0;o<e.length;o++){let s=e[o],c=Pe(s);if(c!==void 0&&c!==t.textNodeName){let e=je(s[`:@`]||{},t.attributeNamePrefix);n.push(c,e)}if(c===t.textNodeName)i===void 0?i=s[c]:i+=``+s[c];else{if(c===void 0)continue;if(s[c]){let e=Ne(s[c],t,n,r),i=A(e,t);if(s[`:@`]?Fe(e,s[`:@`],r,t):Object.keys(e).length!==1||e[t.textNodeName]===void 0||t.alwaysCreateTextNode?Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``):e=e[t.textNodeName],s[Ae]!==void 0&&typeof e==`object`&&e&&(e[Ae]=s[Ae]),a[c]!==void 0&&Object.prototype.hasOwnProperty.call(a,c))Array.isArray(a[c])||(a[c]=[a[c]]),a[c].push(e);else{let n=t.jPath?r.toString():r;t.isArray(c,n,i)?a[c]=[e]:a[c]=e}c!==void 0&&c!==t.textNodeName&&n.pop()}}}return typeof i==`string`?i.length>0&&(a[t.textNodeName]=i):i!==void 0&&(a[t.textNodeName]=i),a}function Pe(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function Fe(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o],s=a.startsWith(r.attributeNamePrefix)?a.substring(r.attributeNamePrefix.length):a,c=r.jPath?n.toString()+`.`+s:n;r.isArray(a,c,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function A(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return r===0||!(r!==1||!e[n]&&typeof e[n]!=`boolean`&&e[n]!==0)}class Ie{constructor(e){this.externalEntities={},this.options=te(e)}parse(e,t){if(typeof e!=`string`&&e.toString)e=e.toString();else if(typeof e!=`string`)throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){!0===t&&(t={});let n=l(e,t);if(!0!==n)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new he(this.options);n.addExternalEntities(this.externalEntities);let r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:Me(r,this.options,n.matcher,n.readonlyMatcher)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '
'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return E.getMetaDataSymbol()}}function Le(e,t){let n=``;t.format&&t.indentBy.length>0&&(n=`
|
|
66
66
|
`);let r=[];if(t.stopNodes&&Array.isArray(t.stopNodes))for(let e=0;e<t.stopNodes.length;e++){let n=t.stopNodes[e];typeof n==`string`?r.push(new fe(n)):n instanceof fe&&r.push(n)}return Re(e,t,n,new de,r)}function Re(e,t,n,r,i){let a=``,o=!1;if(t.maxNestedTags&&r.getDepth()>t.maxNestedTags)throw Error(`Maximum nested tags exceeded`);if(!Array.isArray(e)){if(e!=null){let n=e.toString();return n=We(n,t),n}return``}for(let s=0;s<e.length;s++){let c=e[s],l=j(c);if(l===void 0)continue;let u=ze(c[`:@`],t);r.push(l,u);let d=Ue(r,i);if(l===t.textNodeName){let e=c[l];d||(e=t.tagValueProcessor(l,e),e=We(e,t)),o&&(a+=n),a+=e,o=!1,r.pop();continue}if(l===t.cdataPropName){o&&(a+=n),a+=`<![CDATA[${c[l][0][t.textNodeName]}]]>`,o=!1,r.pop();continue}if(l===t.commentPropName){a+=n+`\x3c!--${c[l][0][t.textNodeName]}--\x3e`,o=!0,r.pop();continue}if(l[0]===`?`){let e=He(c[`:@`],t,d),i=l===`?xml`?``:n,s=c[l][0][t.textNodeName];s=s.length===0?``:` `+s,a+=i+`<${l}${s}${e}?>`,o=!0,r.pop();continue}let f=n;f!==``&&(f+=t.indentBy);let p=n+`<${l}${He(c[`:@`],t,d)}`,m;m=d?Be(c[l],t):Re(c[l],t,f,r,i),t.unpairedTags.indexOf(l)===-1?m&&m.length!==0||!t.suppressEmptyNode?m&&m.endsWith(`>`)?a+=p+`>${m}${n}</${l}>`:(a+=p+`>`,m&&n!==``&&(m.includes(`/>`)||m.includes(`</`))?a+=n+t.indentBy+m+n:a+=m,a+=`</${l}>`):a+=p+`/>`:t.suppressUnpairedNode?a+=p+`>`:a+=p+`/>`,o=!0,r.pop()}return a}function ze(e,t){if(!e||t.ignoreAttributes)return null;let n={},r=!1;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i.startsWith(t.attributeNamePrefix)?i.substr(t.attributeNamePrefix.length):i]=e[i],r=!0);return r?n:null}function Be(e,t){if(!Array.isArray(e))return e==null?``:e.toString();let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=j(i);if(a===t.textNodeName)n+=i[a];else if(a===t.cdataPropName)n+=i[a][0][t.textNodeName];else if(a===t.commentPropName)n+=i[a][0][t.textNodeName];else{if(a&&a[0]===`?`)continue;if(a){let e=Ve(i[`:@`],t),r=Be(i[a],t);r&&r.length!==0?n+=`<${a}${e}>${r}</${a}>`:n+=`<${a}${e}/>`}}}return n}function Ve(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];!0===i&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function j(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(Object.prototype.hasOwnProperty.call(e,r)&&r!==`:@`)return r}}function He(e,t,n){let r=``;if(e&&!t.ignoreAttributes)for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let a;n?a=e[i]:(a=t.attributeValueProcessor(i,e[i]),a=We(a,t)),!0===a&&t.suppressBooleanAttributes?r+=` ${i.substr(t.attributeNamePrefix.length)}`:r+=` ${i.substr(t.attributeNamePrefix.length)}="${a}"`}return r}function Ue(e,t){if(!t||t.length===0)return!1;for(let n=0;n<t.length;n++)if(e.matches(t[n]))return!0;return!1}function We(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}let Ge={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function Ke(e){if(this.options=Object.assign({},Ge,e),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(e=>typeof e==`string`&&e.startsWith(`*.`)?`..`+e.substring(2):e)),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(let e=0;e<this.options.stopNodes.length;e++){let t=this.options.stopNodes[e];typeof t==`string`?this.stopNodeExpressions.push(new fe(t)):t instanceof fe&&this.stopNodeExpressions.push(t)}var t;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=typeof(t=this.options.ignoreAttributes)==`function`?t:Array.isArray(t)?e=>{for(let n of t)if(typeof n==`string`&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1,this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Ye),this.processTextOrObjNode=qe,this.options.format?(this.indentate=Je,this.tagEndChar=`>
|
|
67
67
|
`,this.newLine=`
|
|
68
|
-
`):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function qe(e,t,n,r){let i=this.extractAttributes(e);if(r.push(t,i),this.checkStopNode(r)){let i=this.buildRawContent(e),a=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(i,t,a,n)}let a=this.j2x(e,n+1,r);return r.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,a.attrStr,n,r):this.buildObjectNode(a.val,t,a.attrStr,n)}function Je(e){return this.options.indentBy.repeat(e)}function Ye(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Ke.prototype.build=function(e){if(this.options.preserveOrder)return Le(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new de;return this.j2x(e,0,t).val}},Ke.prototype.j2x=function(e,t,n){let r=``,i=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let a=this.options.jPath?n.toString():n,o=this.checkStopNode(n);for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(e[s]===void 0)this.isAttribute(s)&&(i+=``);else if(e[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+=``:s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,``,t,n);else if(typeof e[s]!=`object`){let c=this.isAttribute(s);if(c&&!this.ignoreAttributesFn(c,a))r+=this.buildAttrPairStr(c,``+e[s],o);else if(!c)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,``+e[s]);i+=this.replaceEntitiesValue(t)}else{n.push(s);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[s];i+=n===``?this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+`<`+s+`>`+n+`</`+s+this.tagEndChar}else i+=this.buildTextValNode(e[s],s,``,t,n)}}else if(Array.isArray(e[s])){let r=e[s].length,a=``,o=``;for(let c=0;c<r;c++){let r=e[s][c];if(r!==void 0)if(r===null)s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(typeof r==`object`)if(this.options.oneListGroup){n.push(s);let e=this.j2x(r,t+1,n);n.pop(),a+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(o+=e.attrStr)}else a+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),a+=e}else{n.push(s);let e=this.checkStopNode(n);if(n.pop(),e){let e=``+r;a+=e===``?this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+`<`+s+`>`+e+`</`+s+this.tagEndChar}else a+=this.buildTextValNode(r,s,``,t,n)}}this.options.oneListGroup&&(a=this.buildObjectNode(a,s,o,t)),i+=a}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],``+e[s][t[i]],o)}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},Ke.prototype.buildAttrPairStr=function(e,t,n){return n||(t=this.options.attributeValueProcessor(e,``+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t===`true`?` `+e:` `+e+`="`+t+`"`},Ke.prototype.extractAttributes=function(e){if(!e||typeof e!=`object`)return null;let t={},n=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let r=e[this.options.attributesGroupName];for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e]=r[e],n=!0)}else for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=this.isAttribute(r);i&&(t[i]=e[r],n=!0)}return n?t:null},Ke.prototype.buildRawContent=function(e){if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];let t=``;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||this.isAttribute(n)||this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;let r=e[n];if(n===this.options.textNodeName)t+=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`||typeof e==`number`)t+=`<${n}>${e}</${n}>`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);t+=r===``?`<${n}${i}/>`:`<${n}${i}>${r}</${n}>`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);t+=e===``?`<${n}${i}/>`:`<${n}${i}>${e}</${n}>`}else t+=`<${n}>${r}</${n}>`}return t},Ke.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];!0===i&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];!0===i&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}return t},Ke.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;{let i=`</`+t+this.tagEndChar,a=``;return t[0]===`?`&&(a=`?`,i=``),!n&&n!==``||e.indexOf(`<`)!==-1?!1!==this.options.commentPropName&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+`<`+t+n+a+`>`+e+i}},Ke.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},Ke.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},Ke.prototype.buildTextValNode=function(e,t,n,r,i){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`</`+t+this.tagEndChar}},Ke.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};let Xe=Ke,Ze={validate:l};t.exports=n})()})),
|
|
68
|
+
`):(this.indentate=function(){return``},this.tagEndChar=`>`,this.newLine=``)}function qe(e,t,n,r){let i=this.extractAttributes(e);if(r.push(t,i),this.checkStopNode(r)){let i=this.buildRawContent(e),a=this.buildAttributesForStopNode(e);return r.pop(),this.buildObjectNode(i,t,a,n)}let a=this.j2x(e,n+1,r);return r.pop(),e[this.options.textNodeName]!==void 0&&Object.keys(e).length===1?this.buildTextValNode(e[this.options.textNodeName],t,a.attrStr,n,r):this.buildObjectNode(a.val,t,a.attrStr,n)}function Je(e){return this.options.indentBy.repeat(e)}function Ye(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}Ke.prototype.build=function(e){if(this.options.preserveOrder)return Le(e,this.options);{Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e});let t=new de;return this.j2x(e,0,t).val}},Ke.prototype.j2x=function(e,t,n){let r=``,i=``;if(this.options.maxNestedTags&&n.getDepth()>=this.options.maxNestedTags)throw Error(`Maximum nested tags exceeded`);let a=this.options.jPath?n.toString():n,o=this.checkStopNode(n);for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if(e[s]===void 0)this.isAttribute(s)&&(i+=``);else if(e[s]===null)this.isAttribute(s)||s===this.options.cdataPropName?i+=``:s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(e[s]instanceof Date)i+=this.buildTextValNode(e[s],s,``,t,n);else if(typeof e[s]!=`object`){let c=this.isAttribute(s);if(c&&!this.ignoreAttributesFn(c,a))r+=this.buildAttrPairStr(c,``+e[s],o);else if(!c)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,``+e[s]);i+=this.replaceEntitiesValue(t)}else{n.push(s);let r=this.checkStopNode(n);if(n.pop(),r){let n=``+e[s];i+=n===``?this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+`<`+s+`>`+n+`</`+s+this.tagEndChar}else i+=this.buildTextValNode(e[s],s,``,t,n)}}else if(Array.isArray(e[s])){let r=e[s].length,a=``,o=``;for(let c=0;c<r;c++){let r=e[s][c];if(r!==void 0)if(r===null)s[0]===`?`?i+=this.indentate(t)+`<`+s+`?`+this.tagEndChar:i+=this.indentate(t)+`<`+s+`/`+this.tagEndChar;else if(typeof r==`object`)if(this.options.oneListGroup){n.push(s);let e=this.j2x(r,t+1,n);n.pop(),a+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(o+=e.attrStr)}else a+=this.processTextOrObjNode(r,s,t,n);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,r);e=this.replaceEntitiesValue(e),a+=e}else{n.push(s);let e=this.checkStopNode(n);if(n.pop(),e){let e=``+r;a+=e===``?this.indentate(t)+`<`+s+this.closeTag(s)+this.tagEndChar:this.indentate(t)+`<`+s+`>`+e+`</`+s+this.tagEndChar}else a+=this.buildTextValNode(r,s,``,t,n)}}this.options.oneListGroup&&(a=this.buildObjectNode(a,s,o,t)),i+=a}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){let t=Object.keys(e[s]),n=t.length;for(let i=0;i<n;i++)r+=this.buildAttrPairStr(t[i],``+e[s][t[i]],o)}else i+=this.processTextOrObjNode(e[s],s,t,n);return{attrStr:r,val:i}},Ke.prototype.buildAttrPairStr=function(e,t,n){return n||(t=this.options.attributeValueProcessor(e,``+t),t=this.replaceEntitiesValue(t)),this.options.suppressBooleanAttributes&&t===`true`?` `+e:` `+e+`="`+t+`"`},Ke.prototype.extractAttributes=function(e){if(!e||typeof e!=`object`)return null;let t={},n=!1;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let r=e[this.options.attributesGroupName];for(let e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e]=r[e],n=!0)}else for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=this.isAttribute(r);i&&(t[i]=e[r],n=!0)}return n?t:null},Ke.prototype.buildRawContent=function(e){if(typeof e==`string`)return e;if(typeof e!=`object`||!e)return String(e);if(e[this.options.textNodeName]!==void 0)return e[this.options.textNodeName];let t=``;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n)||this.isAttribute(n)||this.options.attributesGroupName&&n===this.options.attributesGroupName)continue;let r=e[n];if(n===this.options.textNodeName)t+=r;else if(Array.isArray(r)){for(let e of r)if(typeof e==`string`||typeof e==`number`)t+=`<${n}>${e}</${n}>`;else if(typeof e==`object`&&e){let r=this.buildRawContent(e),i=this.buildAttributesForStopNode(e);t+=r===``?`<${n}${i}/>`:`<${n}${i}>${r}</${n}>`}}else if(typeof r==`object`&&r){let e=this.buildRawContent(r),i=this.buildAttributesForStopNode(r);t+=e===``?`<${n}${i}/>`:`<${n}${i}>${e}</${n}>`}else t+=`<${n}>${r}</${n}>`}return t},Ke.prototype.buildAttributesForStopNode=function(e){if(!e||typeof e!=`object`)return``;let t=``;if(this.options.attributesGroupName&&e[this.options.attributesGroupName]){let n=e[this.options.attributesGroupName];for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;let r=e.startsWith(this.options.attributeNamePrefix)?e.substring(this.options.attributeNamePrefix.length):e,i=n[e];!0===i&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}else for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let r=this.isAttribute(n);if(r){let i=e[n];!0===i&&this.options.suppressBooleanAttributes?t+=` `+r:t+=` `+r+`="`+i+`"`}}return t},Ke.prototype.buildObjectNode=function(e,t,n,r){if(e===``)return t[0]===`?`?this.indentate(r)+`<`+t+n+`?`+this.tagEndChar:this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar;{let i=`</`+t+this.tagEndChar,a=``;return t[0]===`?`&&(a=`?`,i=``),!n&&n!==``||e.indexOf(`<`)!==-1?!1!==this.options.commentPropName&&t===this.options.commentPropName&&a.length===0?this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(r)+`<`+t+n+a+this.tagEndChar+e+this.indentate(r)+i:this.indentate(r)+`<`+t+n+a+`>`+e+i}},Ke.prototype.closeTag=function(e){let t=``;return this.options.unpairedTags.indexOf(e)===-1?t=this.options.suppressEmptyNode?`/`:`></${e}`:this.options.suppressUnpairedNode||(t=`/`),t},Ke.prototype.checkStopNode=function(e){if(!this.stopNodeExpressions||this.stopNodeExpressions.length===0)return!1;for(let t=0;t<this.stopNodeExpressions.length;t++)if(e.matches(this.stopNodeExpressions[t]))return!0;return!1},Ke.prototype.buildTextValNode=function(e,t,n,r,i){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(r)+`\x3c!--${e}--\x3e`+this.newLine;if(t[0]===`?`)return this.indentate(r)+`<`+t+n+`?`+this.tagEndChar;{let i=this.options.tagValueProcessor(t,e);return i=this.replaceEntitiesValue(i),i===``?this.indentate(r)+`<`+t+n+this.closeTag(t)+this.tagEndChar:this.indentate(r)+`<`+t+n+`>`+i+`</`+t+this.tagEndChar}},Ke.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){let n=this.options.entities[t];e=e.replace(n.regex,n.val)}return e};let Xe=Ke,Ze={validate:l};t.exports=n})()})),Gb=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseXML=n;let t=new(Wb()).XMLParser({attributeNamePrefix:``,processEntities:{enabled:!0,maxTotalExpansions:1/0},htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(e,t)=>t.trim()===``&&t.includes(`
|
|
69
69
|
`)?``:void 0,maxNestedTags:1/0});t.addEntity(`#xD`,`\r`),t.addEntity(`#10`,`
|
|
70
|
-
`);function n(e){return t.parse(e,!0)}})),Gb=u((e=>{var t=Wb();let n=/[&<>"]/g,r={"&":`&`,"<":`<`,">":`>`,'"':`"`};function i(e){return e.replace(n,e=>r[e])}let a=/[&"'<>\r\n\u0085\u2028]/g,o={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`,"\r":`
`,"\n":`
`,"
":`…`,"\u2028":`
`};function s(e){return e.replace(a,e=>o[e])}var c=class{value;constructor(e){this.value=e}toString(){return s(``+this.value)}},l=class e{name;children;attributes={};static of(t,n,r){let i=new e(t);return n!==void 0&&i.addChildNode(new c(n)),r!==void 0&&i.withName(r),i}constructor(e,t=[]){this.name=e,this.children=t}withName(e){return this.name=e,this}addAttribute(e,t){return this.attributes[e]=t,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,t){return t!=null&&(this.attributes[e]=t),this}cc(t,n,r=n){if(t[n]!=null){let i=e.of(n,t[n]).withName(r);this.c(i)}}l(e,t,n,r){e[t]!=null&&r().map(e=>{e.withName(n),this.c(e)})}lc(t,n,r,i){if(t[n]!=null){let t=i(),n=new e(r);t.map(e=>{n.c(e)}),this.c(n)}}toString(){let e=!!this.children.length,t=`<${this.name}`,n=this.attributes;for(let e of Object.keys(n)){let r=n[e];r!=null&&(t+=` ${e}="${i(``+r)}"`)}return t+=e?`>${this.children.map(e=>e.toString()).join(``)}</${this.name}>`:`/>`}};e.parseXML=t.parseXML,e.XmlNode=l,e.XmlText=c})),Kb,qb,Jb,Yb,Xb=l((()=>{Kb=Gb(),bg(),Yp(),qb=C_(),Jb=pf(),cb(),ub(),Yb=class extends sb{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new lg(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,n){let r=Ip.of(e),i=r.getMemberSchemas();if(r.isStructSchema()&&r.isMemberSchema()&&Object.values(i).find(e=>!!e.getMemberTraits().eventPayload)){let e={},n=Object.keys(i)[0];return i[n].isBlobSchema()?e[n]=t:e[n]=this.read(i[n],t),e}let a=(this.serdeContext?.utf8Encoder??Jb.toUtf8)(t),o=this.parseXml(a);return this.readSchema(e,n?o[n]:o)}readSchema(e,t){let n=Ip.of(e);if(n.isUnitSchema())return;let r=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(t))return this.readSchema(n,[t]);if(t==null)return t;if(typeof t==`object`){let e=!!r.xmlFlattened;if(n.isListSchema()){let r=n.getValueSchema(),i=[],a=r.getMergedTraits().xmlName??`member`,o=e?t:(t[0]??t)[a];if(o==null)return i;let s=Array.isArray(o)?o:[o];for(let e of s)i.push(this.readSchema(r,e));return i}let i={};if(n.isMapSchema()){let r=n.getKeySchema(),a=n.getValueSchema(),o;o=e?Array.isArray(t)?t:[t]:Array.isArray(t.entry)?t.entry:[t.entry];let s=r.getMergedTraits().xmlName??`key`,c=a.getMergedTraits().xmlName??`value`;for(let e of o){let t=e[s],n=e[c];i[t]=this.readSchema(a,n)}return i}if(n.isStructSchema()){let e=n.isUnionSchema(),r;e&&(r=new lb(t,i));for(let[a,o]of n.structIterator()){let n=o.getMergedTraits(),s=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??a;e&&r.mark(s),t[s]!=null&&(i[a]=this.readSchema(o,t[s]))}return e&&r.writeUnknown(),i}if(n.isDocumentSchema())return t;throw Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,t)}parseXml(e){if(e.length){let t;try{t=(0,Kb.parseXML)(e)}catch(t){throw t&&typeof t==`object`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}let n=`#text`,r=Object.keys(t)[0],i=t[r];return i[n]&&(i[r]=i[n],delete i[n]),(0,qb.getValueFromTextNode)(i)}return{}}}})),Zb,Qb,$b,ex=l((()=>{bg(),Yp(),Fh(),Zb=C_(),Qb=hf(),cb(),$b=class extends sb{settings;buffer;constructor(e){super(),this.settings=e}write(e,t,n=``){this.buffer===void 0&&(this.buffer=``);let r=Ip.of(e);if(n&&!n.endsWith(`.`)&&(n+=`.`),r.isBlobSchema())(typeof t==`string`||t instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??Qb.toBase64)(t)));else if(r.isBooleanSchema()||r.isNumericSchema()||r.isStringSchema())t==null?r.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,ah.v4)())):(this.writeKey(n),this.writeValue(String(t)));else if(r.isBigIntegerSchema())t!=null&&(this.writeKey(n),this.writeValue(String(t)));else if(r.isBigDecimalSchema())t!=null&&(this.writeKey(n),this.writeValue(t instanceof Mh?t.string:String(t)));else if(r.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(n),ag(r,this.settings)){case 5:this.writeValue(t.toISOString().replace(`.000Z`,`Z`));break;case 6:this.writeValue((0,Zb.dateToUtcString)(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(r.isDocumentSchema())Array.isArray(t)?this.write(79,t,n):t instanceof Date?this.write(4,t,n):t instanceof Uint8Array?this.write(21,t,n):t&&typeof t==`object`?this.write(143,t,n):(this.writeKey(n),this.writeValue(String(t)));else if(r.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(``));else{let e=r.getValueSchema(),i=this.settings.flattenLists||r.getMergedTraits().xmlFlattened,a=1;for(let r of t){if(r==null)continue;let t=e.getMergedTraits(),o=this.getKey(`member`,t.xmlName,t.ec2QueryName),s=i?`${n}${a}`:`${n}${o}.${a}`;this.write(e,r,s),++a}}}else if(r.isMapSchema()){if(t&&typeof t==`object`){let e=r.getKeySchema(),i=r.getValueSchema(),a=r.getMergedTraits().xmlFlattened,o=1;for(let[r,s]of Object.entries(t)){if(s==null)continue;let t=e.getMergedTraits(),c=this.getKey(`key`,t.xmlName,t.ec2QueryName),l=a?`${n}${o}.${c}`:`${n}entry.${o}.${c}`,u=i.getMergedTraits(),d=this.getKey(`value`,u.xmlName,u.ec2QueryName),f=a?`${n}${o}.${d}`:`${n}entry.${o}.${d}`;this.write(e,r,l),this.write(i,s,f),++o}}}else if(r.isStructSchema()){if(t&&typeof t==`object`){let e=!1;for(let[i,a]of r.structIterator()){if(t[i]==null&&!a.isIdempotencyToken())continue;let r=a.getMergedTraits(),o=this.getKey(i,r.xmlName,r.ec2QueryName,`struct`),s=`${n}${o}`;this.write(a,t[i],s),e=!0}if(!e&&r.isUnionSchema()){let{$unknown:e}=t;if(Array.isArray(e)){let[t,r]=e,i=`${n}${t}`;this.write(15,r,i)}}}}else if(!r.isUnitSchema())throw Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${r.getName(!0)}`)}flush(){if(this.buffer===void 0)throw Error(`@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.`);let e=this.buffer;return delete this.buffer,e}getKey(e,t,n,r){let{ec2:i,capitalizeKeys:a}=this.settings;if(i&&n)return n;let o=t??e;return a&&r===`struct`?o[0].toUpperCase()+o.slice(1):o}writeKey(e){e.endsWith(`.`)&&(e=e.slice(0,e.length-1)),this.buffer+=`&${Vf(e)}=`}writeValue(e){this.buffer+=Vf(e)}}})),tx,nx=l((()=>{bg(),Yp(),eb(),Xb(),ex(),tx=class extends Zh{options;serializer;deserializer;mixin=new $y;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new $b(t),this.deserializer=new Yb(t)}getShapeId(){return`aws.protocols#awsQuery`}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw Error(`AWSQuery protocol has no payload codec.`)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return r.path.endsWith(`/`)||(r.path+=`/`),Object.assign(r.headers,{"content-type":`application/x-www-form-urlencoded`}),(Uf(e.input)===`unit`||!r.body)&&(r.body=``),r.body=`Action=${e.name.split(`#`)[1]??e.name}&Version=${this.options.version}`+r.body,r.body.endsWith(`&`)&&(r.body=r.body.slice(-1)),r}async deserializeResponse(e,t,n){let r=this.deserializer,i=Ip.of(e.output),a={};if(n.statusCode>=300){let i=await zf(n.body,t);i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n))}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=e.name.split(`#`)[1]??e.name,s=i.isStructSchema()&&this.useNestedResult()?o+`Result`:void 0,c=await zf(n.body,t);return c.byteLength>0&&Object.assign(a,await r.read(i,c,s)),{$metadata:this.deserializeMetadata(n),...a}}useNestedResult(){return!0}async handleError(e,t,n,r,i){let a=this.loadQueryErrorCode(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let o=this.loadQueryError(r)??{},s=this.loadQueryErrorMessage(r);o.message=s,o.Error={Type:o.Type,Code:o.Code,Message:s};let{errorSchema:c,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,o,i,this.mixin.findQueryCompatibleError),u=Ip.of(c),d=new((this.compositeErrorRegistry.getErrorCtor(c))??Error)(s),f={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(let[e,t]of u.structIterator()){let n=t.getMergedTraits().xmlName??e,i=o[n]??r[n];f[e]=this.deserializer.readSchema(t,i)}throw this.mixin.decorateServiceException(Object.assign(d,l,{$fault:u.getMergedTraits().error,message:s},f),r)}loadQueryErrorCode(e,t){let n=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(n!==void 0)return n;if(e.statusCode==404)return`NotFound`}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??`Unknown`}getDefaultContentType(){return`application/x-www-form-urlencoded`}}})),rx,ix=l((()=>{nx(),rx=class extends tx{options;constructor(e){super(e),this.options=e,Object.assign(this.serializer.settings,{capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0})}getShapeId(){return`aws.protocols#ec2Query`}useNestedResult(){return!1}}})),ax=l((()=>{})),ox,sx,cx,lx,ux,dx=l((()=>{ox=Gb(),sx=C_(),gb(),cx=(e,t)=>hb(e,t).then(e=>{if(e.length){let t;try{t=(0,ox.parseXML)(e)}catch(t){throw t&&typeof t==`object`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}let n=`#text`,r=Object.keys(t)[0],i=t[r];return i[n]&&(i[r]=i[n],delete i[n]),(0,sx.getValueFromTextNode)(i)}return{}}),lx=async(e,t)=>{let n=await cx(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},ux=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return`NotFound`}})),fx,px,mx,hx,gx=l((()=>{fx=Gb(),bg(),Yp(),Fh(),px=C_(),mx=hf(),cb(),hx=class extends sb{settings;stringBuffer;byteBuffer;buffer;constructor(e){super(),this.settings=e}write(e,t){let n=Ip.of(e);if(n.isStringSchema()&&typeof t==`string`)this.stringBuffer=t;else if(n.isBlobSchema())this.byteBuffer=`byteLength`in t?t:(this.serdeContext?.base64Decoder??mx.fromBase64)(t);else{this.buffer=this.writeStruct(n,t,void 0);let e=n.getMergedTraits();e.httpPayload&&!e.xmlName&&this.buffer.withName(n.getName())}}flush(){if(this.byteBuffer!==void 0){let e=this.byteBuffer;return delete this.byteBuffer,e}if(this.stringBuffer!==void 0){let e=this.stringBuffer;return delete this.stringBuffer,e}let e=this.buffer;return this.settings.xmlNamespace&&(e?.attributes?.xmlns||e.addAttribute(`xmlns`,this.settings.xmlNamespace)),delete this.buffer,e.toString()}writeStruct(e,t,n){let r=e.getMergedTraits(),i=e.isMemberSchema()&&!r.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():r.xmlName??e.getName();if(!i||!e.isStructSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(!0)}.`);let a=fx.XmlNode.of(i),[o,s]=this.getXmlnsAttribute(e,n);for(let[n,r]of e.structIterator()){let e=t[n];if(e!=null||r.isIdempotencyToken()){if(r.getMergedTraits().xmlAttribute){a.addAttribute(r.getMergedTraits().xmlName??n,this.writeSimple(r,e));continue}if(r.isListSchema())this.writeList(r,e,a,s);else if(r.isMapSchema())this.writeMap(r,e,a,s);else if(r.isStructSchema())a.addChildNode(this.writeStruct(r,e,s));else{let t=fx.XmlNode.of(r.getMergedTraits().xmlName??r.getMemberName());this.writeSimpleInto(r,e,t,s),a.addChildNode(t)}}}let{$unknown:c}=t;if(c&&e.isUnionSchema()&&Array.isArray(c)&&Object.keys(t).length===1){let[e,n]=c,r=fx.XmlNode.of(e);if(typeof n!=`string`)if(t instanceof fx.XmlNode||t instanceof fx.XmlText)a.addChildNode(t);else throw Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`);this.writeSimpleInto(0,n,r,s),a.addChildNode(r)}return s&&a.addAttribute(o,s),a}writeList(e,t,n,r){if(!e.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(!0)}`);let i=e.getMergedTraits(),a=e.getValueSchema(),o=a.getMergedTraits(),s=!!o.sparse,c=!!i.xmlFlattened,[l,u]=this.getXmlnsAttribute(e,r),d=(t,n)=>{if(a.isListSchema())this.writeList(a,Array.isArray(n)?n:[n],t,u);else if(a.isMapSchema())this.writeMap(a,n,t,u);else if(a.isStructSchema()){let r=this.writeStruct(a,n,u);t.addChildNode(r.withName(c?i.xmlName??e.getMemberName():o.xmlName??`member`))}else{let r=fx.XmlNode.of(c?i.xmlName??e.getMemberName():o.xmlName??`member`);this.writeSimpleInto(a,n,r,u),t.addChildNode(r)}};if(c)for(let e of t)(s||e!=null)&&d(n,e);else{let r=fx.XmlNode.of(i.xmlName??e.getMemberName());u&&r.addAttribute(l,u);for(let e of t)(s||e!=null)&&d(r,e);n.addChildNode(r)}}writeMap(e,t,n,r,i=!1){if(!e.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(!0)}`);let a=e.getMergedTraits(),o=e.getKeySchema(),s=o.getMergedTraits().xmlName??`key`,c=e.getValueSchema(),l=c.getMergedTraits(),u=l.xmlName??`value`,d=!!l.sparse,f=!!a.xmlFlattened,[p,m]=this.getXmlnsAttribute(e,r),h=(e,t,n)=>{let r=fx.XmlNode.of(s,t),[i,a]=this.getXmlnsAttribute(o,m);a&&r.addAttribute(i,a),e.addChildNode(r);let l=fx.XmlNode.of(u);c.isListSchema()?this.writeList(c,n,l,m):c.isMapSchema()?this.writeMap(c,n,l,m,!0):c.isStructSchema()?l=this.writeStruct(c,n,m):this.writeSimpleInto(c,n,l,m),e.addChildNode(l)};if(f){for(let[r,i]of Object.entries(t))if(d||i!=null){let t=fx.XmlNode.of(a.xmlName??e.getMemberName());h(t,r,i),n.addChildNode(t)}}else{let r;i||(r=fx.XmlNode.of(a.xmlName??e.getMemberName()),m&&r.addAttribute(p,m),n.addChildNode(r));for(let[e,a]of Object.entries(t))if(d||a!=null){let t=fx.XmlNode.of(`entry`);h(t,e,a),(i?n:r).addChildNode(t)}}}writeSimple(e,t){if(t===null)throw Error(`@aws-sdk/core/protocols - (XML serializer) cannot write null value.`);let n=Ip.of(e),r=null;if(t&&typeof t==`object`)if(n.isBlobSchema())r=(this.serdeContext?.base64Encoder??mx.toBase64)(t);else if(n.isTimestampSchema()&&t instanceof Date)switch(ag(n,this.settings)){case 5:r=t.toISOString().replace(`.000Z`,`Z`);break;case 6:r=(0,px.dateToUtcString)(t);break;case 7:r=String(t.getTime()/1e3);break;default:console.warn(`Missing timestamp format, using http date`,t),r=(0,px.dateToUtcString)(t);break}else if(n.isBigDecimalSchema()&&t)return t instanceof Mh?t.string:String(t);else if(n.isMapSchema()||n.isListSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.`);else throw Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${n.getName(!0)}`);if((n.isBooleanSchema()||n.isNumericSchema()||n.isBigIntegerSchema()||n.isBigDecimalSchema())&&(r=String(t)),n.isStringSchema()&&(r=t===void 0&&n.isIdempotencyToken()?(0,ah.v4)():String(t)),r===null)throw Error(`Unhandled schema-value pair ${n.getName(!0)}=${t}`);return r}writeSimpleInto(e,t,n,r){let i=this.writeSimple(e,t),a=Ip.of(e),o=new fx.XmlText(i),[s,c]=this.getXmlnsAttribute(a,r);c&&n.addAttribute(s,c),n.addChildNode(o)}getXmlnsAttribute(e,t){let[n,r]=e.getMergedTraits().xmlNamespace??[];return r&&r!==t?[n?`xmlns:${n}`:`xmlns`,r]:[void 0,void 0]}}})),_x,vx=l((()=>{cb(),Xb(),gx(),_x=class extends sb{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new hx(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Yb(this.settings);return e.setSerdeContext(this.serdeContext),e}}})),yx,bx=l((()=>{bg(),Yp(),eb(),dx(),vx(),yx=class extends Jh{codec;serializer;deserializer;mixin=new $y;constructor(e){super(e);let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new _x(t),this.serializer=new _g(this.codec.createSerializer(),t),this.deserializer=new fg(this.codec.createDeserializer(),t),this.compositeErrorRegistry}getPayloadCodec(){return this.codec}getShapeId(){return`aws.protocols#restXml`}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n),i=Ip.of(e.input);if(!r.headers[`content-type`]){let e=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);e&&(r.headers[`content-type`]=e)}return typeof r.body==`string`&&r.headers[`content-type`]===this.getDefaultContentType()&&!r.body.startsWith(`<?xml `)&&!this.hasUnstructuredPayloadBinding(i)&&(r.body=`<?xml version="1.0" encoding="UTF-8"?>`+r.body),r}async deserializeResponse(e,t,n){return super.deserializeResponse(e,t,n)}async handleError(e,t,n,r,i){let a=ux(n,r)??`Unknown`;if(this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace),r.Error&&typeof r.Error==`object`)for(let e of Object.keys(r.Error))r[e]=r.Error[e],e.toLowerCase()===`message`&&(r.message=r.Error[e]);r.RequestId&&!i.requestId&&(i.requestId=r.RequestId);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i),c=Ip.of(o),l=r.Error?.message??r.Error?.Message??r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l);await this.deserializeHttpMessage(o,t,n,r);let d={};for(let[e,t]of c.structIterator()){let n=t.getMergedTraits().xmlName??e,i=r.Error?.[n]??r[n];d[e]=this.codec.createDeserializer().readSchema(t,i)}throw this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}getDefaultContentType(){return`application/xml`}hasUnstructuredPayloadBinding(e){for(let[,t]of e.structIterator())if(t.getMergedTraits().httpPayload)return!(t.isStructSchema()||t.isMapSchema()||t.isListSchema());return!1}}})),xx=d({AwsEc2QueryProtocol:()=>rx,AwsJson1_0Protocol:()=>Pb,AwsJson1_1Protocol:()=>Ib,AwsJsonRpcProtocol:()=>Mb,AwsQueryProtocol:()=>tx,AwsRestJsonProtocol:()=>Rb,AwsRestXmlProtocol:()=>yx,AwsSmithyRpcV2CborProtocol:()=>tb,JsonCodec:()=>Ab,JsonShapeDeserializer:()=>Sb,JsonShapeSerializer:()=>Ob,QueryShapeSerializer:()=>$b,XmlCodec:()=>_x,XmlShapeDeserializer:()=>Yb,XmlShapeSerializer:()=>hx,_toBool:()=>ib,_toNum:()=>ab,_toStr:()=>rb,awsExpectUnion:()=>Vb,loadRestJsonErrorCode:()=>yb,loadRestXmlErrorCode:()=>ux,parseJsonBody:()=>_b,parseJsonErrorBody:()=>vb,parseXmlBody:()=>cx,parseXmlErrorBody:()=>lx}),Sx=l((()=>{nb(),ob(),Fb(),Lb(),Nb(),zb(),jb(),Cb(),kb(),Hb(),bb(),ix(),nx(),ax(),ex(),bx(),vx(),Xb(),gx(),dx()})),Cx,wx,Tx,Ex,Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,Kx,qx,Jx,Yx=l((()=>{Cx=`required`,wx=`fn`,Tx=`argv`,Ex=`ref`,Dx=!0,Ox=`isSet`,kx=`booleanEquals`,Ax=`error`,jx=`endpoint`,Mx=`tree`,Nx=`PartitionResult`,Px=`getAttr`,Fx={[Cx]:!1,type:`string`},Ix={[Cx]:!0,default:!1,type:`boolean`},Lx={[Ex]:`Endpoint`},Rx={[wx]:kx,[Tx]:[{[Ex]:`UseFIPS`},!0]},zx={[wx]:kx,[Tx]:[{[Ex]:`UseDualStack`},!0]},Bx={},Vx={[wx]:Px,[Tx]:[{[Ex]:Nx},`supportsFIPS`]},Hx={[Ex]:Nx},Ux={[wx]:kx,[Tx]:[!0,{[wx]:Px,[Tx]:[Hx,`supportsDualStack`]}]},Wx=[Rx],Gx=[zx],Kx=[{[Ex]:`Region`}],qx={version:`1.0`,parameters:{Region:Fx,UseDualStack:Ix,UseFIPS:Ix,Endpoint:Fx},rules:[{conditions:[{[wx]:Ox,[Tx]:[Lx]}],rules:[{conditions:Wx,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:Ax},{conditions:Gx,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:Ax},{endpoint:{url:Lx,properties:Bx,headers:Bx},type:jx}],type:Mx},{conditions:[{[wx]:Ox,[Tx]:Kx}],rules:[{conditions:[{[wx]:`aws.partition`,[Tx]:Kx,assign:Nx}],rules:[{conditions:[Rx,zx],rules:[{conditions:[{[wx]:kx,[Tx]:[Dx,Vx]},Ux],rules:[{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:Bx,headers:Bx},type:jx}],type:Mx},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:Ax}],type:Mx},{conditions:Wx,rules:[{conditions:[{[wx]:kx,[Tx]:[Vx,Dx]}],rules:[{conditions:[{[wx]:`stringEquals`,[Tx]:[{[wx]:Px,[Tx]:[Hx,`name`]},`aws-us-gov`]}],endpoint:{url:`https://oidc.{Region}.amazonaws.com`,properties:Bx,headers:Bx},type:jx},{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:Bx,headers:Bx},type:jx}],type:Mx},{error:`FIPS is enabled but this partition does not support FIPS`,type:Ax}],type:Mx},{conditions:Gx,rules:[{conditions:[Ux],rules:[{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:Bx,headers:Bx},type:jx}],type:Mx},{error:`DualStack is enabled but this partition does not support DualStack`,type:Ax}],type:Mx},{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dnsSuffix}`,properties:Bx,headers:Bx},type:jx}],type:Mx}],type:Mx},{error:`Invalid Configuration: Missing Region`,type:Ax}]},Jx=qx})),Xx,Zx,Qx,$x,eS=l((()=>{Xx=Kg(),Zx=Gg(),Yx(),Qx=new Zx.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),$x=(e,t={})=>Qx.get(e,()=>(0,Zx.resolveEndpoint)(Jx,{endpointParams:e,logger:t.logger})),Zx.customEndpointFunctions.aws=Xx.awsEndpointFunctions})),tS,nS,rS=l((()=>{tS=C_(),nS=class e extends tS.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),iS,aS,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS=l((()=>{rS(),iS=class e extends nS{name=`AccessDeniedException`;$fault=`client`;error;reason;error_description;constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},aS=class e extends nS{name=`AuthorizationPendingException`;$fault=`client`;error;error_description;constructor(t){super({name:`AuthorizationPendingException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},oS=class e extends nS{name=`ExpiredTokenException`;$fault=`client`;error;error_description;constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},sS=class e extends nS{name=`InternalServerException`;$fault=`server`;error;error_description;constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},cS=class e extends nS{name=`InvalidClientException`;$fault=`client`;error;error_description;constructor(t){super({name:`InvalidClientException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},lS=class e extends nS{name=`InvalidGrantException`;$fault=`client`;error;error_description;constructor(t){super({name:`InvalidGrantException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},uS=class e extends nS{name=`InvalidRequestException`;$fault=`client`;error;reason;error_description;constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},dS=class e extends nS{name=`InvalidScopeException`;$fault=`client`;error;error_description;constructor(t){super({name:`InvalidScopeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},fS=class e extends nS{name=`SlowDownException`;$fault=`client`;error;error_description;constructor(t){super({name:`SlowDownException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},pS=class e extends nS{name=`UnauthorizedClientException`;$fault=`client`;error;error_description;constructor(t){super({name:`UnauthorizedClientException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},mS=class e extends nS{name=`UnsupportedGrantTypeException`;$fault=`client`;error;error_description;constructor(t){super({name:`UnsupportedGrantTypeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}}})),gS,_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC=l((()=>{Yp(),hS(),rS(),gS=`AccessDeniedException`,_S=`AuthorizationPendingException`,vS=`AccessToken`,yS=`ClientSecret`,bS=`CreateToken`,xS=`CreateTokenRequest`,SS=`CreateTokenResponse`,CS=`CodeVerifier`,wS=`ExpiredTokenException`,TS=`InvalidClientException`,ES=`InvalidGrantException`,DS=`InvalidRequestException`,OS=`InternalServerException`,kS=`InvalidScopeException`,AS=`IdToken`,jS=`RefreshToken`,MS=`SlowDownException`,NS=`UnauthorizedClientException`,PS=`UnsupportedGrantTypeException`,FS=`accessToken`,IS=`client`,LS=`clientId`,RS=`clientSecret`,zS=`codeVerifier`,BS=`code`,VS=`deviceCode`,HS=`error`,US=`expiresIn`,WS=`error_description`,GS=`grantType`,KS=`http`,qS=`httpError`,JS=`idToken`,YS=`reason`,XS=`refreshToken`,ZS=`redirectUri`,QS=`smithy.ts.sdk.synthetic.com.amazonaws.ssooidc`,$S=`scope`,eC=`server`,tC=`tokenType`,nC=`com.amazonaws.ssooidc`,rC=Kp.for(QS),iC=[-3,QS,`SSOOIDCServiceException`,0,[],[]],rC.registerError(iC,nS),aC=Kp.for(nC),oC=[-3,nC,gS,{[HS]:IS,[qS]:400},[HS,YS,WS],[0,0,0]],aC.registerError(oC,iS),sC=[-3,nC,_S,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(sC,aS),cC=[-3,nC,wS,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(cC,oS),lC=[-3,nC,OS,{[HS]:eC,[qS]:500},[HS,WS],[0,0]],aC.registerError(lC,sS),uC=[-3,nC,TS,{[HS]:IS,[qS]:401},[HS,WS],[0,0]],aC.registerError(uC,cS),dC=[-3,nC,ES,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(dC,lS),fC=[-3,nC,DS,{[HS]:IS,[qS]:400},[HS,YS,WS],[0,0,0]],aC.registerError(fC,uS),pC=[-3,nC,kS,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(pC,dS),mC=[-3,nC,MS,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(mC,fS),hC=[-3,nC,NS,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(hC,pS),gC=[-3,nC,PS,{[HS]:IS,[qS]:400},[HS,WS],[0,0]],aC.registerError(gC,mS),_C=[rC,aC],vC=[0,nC,vS,8,0],yC=[0,nC,yS,8,0],bC=[0,nC,CS,8,0],xC=[0,nC,AS,8,0],SC=[0,nC,jS,8,0],CC=[3,nC,xS,0,[LS,RS,GS,VS,BS,XS,$S,ZS,zS],[0,[()=>yC,0],0,0,0,[()=>SC,0],64,0,[()=>bC,0]],3],wC=[3,nC,SS,0,[FS,tC,US,XS,JS],[[()=>vC,0],0,1,[()=>SC,0],[()=>xC,0]]],TC=[9,nC,bS,{[KS]:[`POST`,`/token`,200]},()=>CC,()=>wC]})),DC,OC,kC,AC,jC,MC=l((()=>{fv(),Sx(),Wg(),DC=C_(),OC=$f(),kC=hf(),AC=pf(),Ov(),eS(),EC(),jC=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??kC.fromBase64,base64Encoder:e?.base64Encoder??kC.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??$x,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Ev,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new z_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Ng}],logger:e?.logger??new DC.NoOpLogger,protocol:e?.protocol??Rb,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.ssooidc`,errorTypeRegistries:_C,version:`2019-06-10`,serviceTarget:`AWSSSOOIDCService`},serviceId:e?.serviceId??`SSO OIDC`,urlParser:e?.urlParser??OC.parseUrl,utf8Decoder:e?.utf8Decoder??AC.fromUtf8,utf8Encoder:e?.utf8Encoder??AC.toUtf8})})),NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC=l((()=>{r_(),fv(),NC=Nv(),PC=c_(),FC=Pv(),IC=T_(),LC=__(),RC=Af(),zC=C_(),BC=Fv(),VC=Iv(),HC=a_(),MC(),UC=e=>{(0,zC.emitWarningIfUnsupportedVersion)(process.version);let t=(0,VC.resolveDefaultsModeConfig)(e),n=()=>t().then(zC.loadConfigsForDefaultMode),r=jC(e);Jg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,LC.loadConfig)(Z_,i),bodyLengthChecker:e?.bodyLengthChecker??BC.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,NC.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Mv}),maxAttempts:e?.maxAttempts??(0,LC.loadConfig)(IC.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,LC.loadConfig)(PC.NODE_REGION_CONFIG_OPTIONS,{...PC.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:RC.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,LC.loadConfig)({...IC.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||HC.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??FC.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??RC.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,LC.loadConfig)(PC.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,LC.loadConfig)(PC.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,LC.loadConfig)(NC.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),GC=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.warning=void 0,e.stsRegionDefaultResolver=r;let t=c_(),n=__();function r(r={}){return(0,n.loadConfig)({...t.NODE_REGION_CONFIG_OPTIONS,async default(){return e.warning.silence||console.warn(`@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.`),`us-east-1`}},{...t.NODE_REGION_CONFIG_FILE_OPTIONS,...r})}e.warning={silence:!1}})),KC=u((e=>{var t=GC(),n=c_();e.NODE_REGION_CONFIG_FILE_OPTIONS=n.NODE_REGION_CONFIG_FILE_OPTIONS,e.NODE_REGION_CONFIG_OPTIONS=n.NODE_REGION_CONFIG_OPTIONS,e.REGION_ENV_NAME=n.REGION_ENV_NAME,e.REGION_INI_NAME=n.REGION_INI_NAME,e.resolveRegionConfig=n.resolveRegionConfig,e.getAwsRegionExtensionConfiguration=e=>({setRegion(t){e.region=t},region(){return e.region}}),e.resolveAwsRegionExtensionConfiguration=e=>({region:e.region()}),Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])})})),qC,JC,YC=l((()=>{qC=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},JC=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),XC,ZC,QC,$C,ew=l((()=>{XC=KC(),ZC=_d(),QC=C_(),YC(),$C=(e,t)=>{let n=Object.assign((0,XC.getAwsRegionExtensionConfiguration)(e),(0,QC.getDefaultExtensionConfiguration)(e),(0,ZC.getHttpHandlerExtensionConfiguration)(e),qC(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,XC.resolveAwsRegionExtensionConfiguration)(n),(0,QC.resolveDefaultRuntimeConfig)(n),(0,ZC.resolveHttpHandlerRuntimeConfig)(n),JC(n))}})),tw,nw,rw,iw,aw,ow,sw,cw,lw,uw,dw=l((()=>{tw=vd(),nw=yd(),rw=kd(),iw=o_(),aw=c_(),Wg(),Yp(),ow=u_(),sw=x_(),cw=T_(),lw=C_(),Ov(),jv(),WC(),ew(),uw=class extends lw.Client{config;constructor(...[e]){let t=UC(e||{});super(t),this.initConfig=t,this.config=$C(Dv((0,sw.resolveEndpointConfig)((0,tw.resolveHostHeaderConfig)((0,aw.resolveRegionConfig)((0,cw.resolveRetryConfig)((0,iw.resolveUserAgentConfig)(kv(t))))))),e?.extensions||[]),this.middlewareStack.use(cp(this.config)),this.middlewareStack.use((0,iw.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,cw.getRetryPlugin)(this.config)),this.middlewareStack.use((0,ow.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,tw.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,nw.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,rw.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Vd(this.config,{httpAuthSchemeParametersProvider:Tv,identityProviderConfigProvider:async e=>new wg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(ef(this.config))}destroy(){super.destroy()}}})),fw,pw,mw,hw=l((()=>{fw=x_(),pw=C_(),jv(),EC(),mw=class extends pw.Command.classBuilder().ep(Av).m(function(e,t,n,r){return[(0,fw.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`AWSSSOOIDCService`,`CreateToken`,{}).n(`SSOOIDCClient`,`CreateTokenCommand`).sc(TC).build(){}})),gw,_w,vw,yw=l((()=>{gw=C_(),hw(),dw(),_w={CreateTokenCommand:mw},vw=class extends uw{},(0,gw.createAggregatedClient)(_w,vw)})),bw=l((()=>{hw()})),xw,Sw,Cw=l((()=>{xw={KMS_ACCESS_DENIED:`KMS_AccessDeniedException`},Sw={KMS_DISABLED_KEY:`KMS_DisabledException`,KMS_INVALID_KEY_USAGE:`KMS_InvalidKeyUsageException`,KMS_INVALID_STATE:`KMS_InvalidStateException`,KMS_KEY_NOT_FOUND:`KMS_NotFoundException`}})),ww=l((()=>{})),Tw=d({$Command:()=>pw.Command,AccessDeniedException:()=>iS,AccessDeniedException$:()=>oC,AccessDeniedExceptionReason:()=>xw,AuthorizationPendingException:()=>aS,AuthorizationPendingException$:()=>sC,CreateToken$:()=>TC,CreateTokenCommand:()=>mw,CreateTokenRequest$:()=>CC,CreateTokenResponse$:()=>wC,ExpiredTokenException:()=>oS,ExpiredTokenException$:()=>cC,InternalServerException:()=>sS,InternalServerException$:()=>lC,InvalidClientException:()=>cS,InvalidClientException$:()=>uC,InvalidGrantException:()=>lS,InvalidGrantException$:()=>dC,InvalidRequestException:()=>uS,InvalidRequestException$:()=>fC,InvalidRequestExceptionReason:()=>Sw,InvalidScopeException:()=>dS,InvalidScopeException$:()=>pC,SSOOIDC:()=>vw,SSOOIDCClient:()=>uw,SSOOIDCServiceException:()=>nS,SSOOIDCServiceException$:()=>iC,SlowDownException:()=>fS,SlowDownException$:()=>mC,UnauthorizedClientException:()=>pS,UnauthorizedClientException$:()=>hC,UnsupportedGrantTypeException:()=>mS,UnsupportedGrantTypeException$:()=>gC,__Client:()=>lw.Client,errorTypeRegistries:()=>_C}),Ew=l((()=>{dw(),yw(),bw(),EC(),Cw(),hS(),ww(),rS()})),Dw=u((e=>{var t=(r_(),m(n_)),n=(fv(),m(dv)),r=d_(),i=g_(),a=h(`node:fs`);let o=({logger:e,signingName:i}={})=>async()=>{if(e?.debug?.(`@aws-sdk/token-providers - fromEnvSigningName`),!i)throw new r.TokenProviderError(`Please pass 'signingName' to compute environment variable key`,{logger:e});let a=n.getBearerTokenEnvKey(i);if(!(a in process.env))throw new r.TokenProviderError(`Token not present in '${a}' environment variable`,{logger:e});let o={token:process.env[a]};return t.setTokenFeature(o,`BEARER_SERVICE_ENV_VARS`,`3`),o},s=`To refresh this SSO session run 'aws sso login' with the corresponding profile.`,c=async(e,t={},n)=>{let{SSOOIDCClient:r}=await Promise.resolve().then(()=>(Ew(),Tw)),i=e=>t.clientConfig?.[e]??t.parentClientConfig?.[e]??n?.[e];return new r(Object.assign({},t.clientConfig??{},{region:e??t.clientConfig?.region,logger:i(`logger`),userAgentAppId:i(`userAgentAppId`)}))},l=async(e,t,n={},r)=>{let{CreateTokenCommand:i}=await Promise.resolve().then(()=>(Ew(),Tw));return(await c(t,n,r)).send(new i({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:`refresh_token`}))},u=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new r.TokenProviderError(`Token is expired. ${s}`,!1)},d=(e,t,n=!1)=>{if(t===void 0)throw new r.TokenProviderError(`Value not present for '${e}' in SSO Token${n?`. Cannot refresh`:``}. ${s}`,!1)},{writeFile:f}=a.promises,p=(e,t)=>f(i.getSSOTokenFilepath(e),JSON.stringify(t,null,2)),g=new Date(0),_=(e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug(`@aws-sdk/token-providers - fromSso`);let n=await i.parseKnownFiles(e),a=i.getProfileName({profile:e.profile??t?.profile}),o=n[a];if(!o)throw new r.TokenProviderError(`Profile '${a}' could not be found in shared credentials file.`,!1);if(!o.sso_session)throw new r.TokenProviderError(`Profile '${a}' is missing required property 'sso_session'.`);let c=o.sso_session,f=(await i.loadSsoSessionData(e))[c];if(!f)throw new r.TokenProviderError(`Sso session '${c}' could not be found in shared credentials file.`,!1);for(let e of[`sso_start_url`,`sso_region`])if(!f[e])throw new r.TokenProviderError(`Sso session '${c}' is missing required property '${e}'.`,!1);f.sso_start_url;let m=f.sso_region,h;try{h=await i.getSSOTokenFromFile(c)}catch{throw new r.TokenProviderError(`The SSO session token associated with profile=${a} was not found or is invalid. ${s}`,!1)}d(`accessToken`,h.accessToken),d(`expiresAt`,h.expiresAt);let{accessToken:_,expiresAt:v}=h,y={token:_,expiration:new Date(v)};if(y.expiration.getTime()-Date.now()>3e5)return y;if(Date.now()-g.getTime()<30*1e3)return u(y),y;d(`clientId`,h.clientId,!0),d(`clientSecret`,h.clientSecret,!0),d(`refreshToken`,h.refreshToken,!0);try{g.setTime(Date.now());let n=await l(h,m,e,t);d(`accessToken`,n.accessToken),d(`expiresIn`,n.expiresIn);let r=new Date(Date.now()+n.expiresIn*1e3);try{await p(c,{...h,accessToken:n.accessToken,expiresAt:r.toISOString(),refreshToken:n.refreshToken})}catch{}return{token:n.accessToken,expiration:r}}catch{return u(y),y}};e.fromEnvSigningName=o,e.fromSso=_,e.fromStatic=({token:e,logger:t})=>async()=>{if(t?.debug(`@aws-sdk/token-providers - fromStatic`),!e||!e.token)throw new r.TokenProviderError(`Please pass a valid token to fromStatic`,!1);return e},e.nodeProvider=(e={})=>r.memoize(r.chain(_(e),async()=>{throw new r.TokenProviderError(`Could not load token from any providers`,!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0)}));function Ow(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`awsssoportal`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function kw(e){return{schemeId:`smithy.api#noAuth`}}var Aw,jw,Mw,Nw,Pw=l((()=>{fv(),Aw=Nd(),jw=async(e,t,n)=>({operation:(0,Aw.getSmithyContext)(t).operation,region:await(0,Aw.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Mw=e=>{let t=[];switch(e.operation){case`GetRoleCredentials`:t.push(kw(e));break;default:t.push(Ow(e))}return t},Nw=e=>{let t=sv(e);return Object.assign(t,{authSchemePreference:(0,Aw.normalizeProvider)(e.authSchemePreference??[])})}})),Fw,Iw,Lw=l((()=>{Fw=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`awsssoportal`}),Iw={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),Rw,zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw,Yw,Xw,Zw,Qw,$w,eT,tT,nT,rT,iT,aT,oT,sT,cT,lT,uT=l((()=>{Rw=`required`,zw=`fn`,Bw=`argv`,Vw=`ref`,Hw=!0,Uw=`isSet`,Ww=`booleanEquals`,Gw=`error`,Kw=`endpoint`,qw=`tree`,Jw=`PartitionResult`,Yw=`getAttr`,Xw={[Rw]:!1,type:`string`},Zw={[Rw]:!0,default:!1,type:`boolean`},Qw={[Vw]:`Endpoint`},$w={[zw]:Ww,[Bw]:[{[Vw]:`UseFIPS`},!0]},eT={[zw]:Ww,[Bw]:[{[Vw]:`UseDualStack`},!0]},tT={},nT={[zw]:Yw,[Bw]:[{[Vw]:Jw},`supportsFIPS`]},rT={[Vw]:Jw},iT={[zw]:Ww,[Bw]:[!0,{[zw]:Yw,[Bw]:[rT,`supportsDualStack`]}]},aT=[$w],oT=[eT],sT=[{[Vw]:`Region`}],cT={version:`1.0`,parameters:{Region:Xw,UseDualStack:Zw,UseFIPS:Zw,Endpoint:Xw},rules:[{conditions:[{[zw]:Uw,[Bw]:[Qw]}],rules:[{conditions:aT,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:Gw},{conditions:oT,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:Gw},{endpoint:{url:Qw,properties:tT,headers:tT},type:Kw}],type:qw},{conditions:[{[zw]:Uw,[Bw]:sT}],rules:[{conditions:[{[zw]:`aws.partition`,[Bw]:sT,assign:Jw}],rules:[{conditions:[$w,eT],rules:[{conditions:[{[zw]:Ww,[Bw]:[Hw,nT]},iT],rules:[{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:tT,headers:tT},type:Kw}],type:qw},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:Gw}],type:qw},{conditions:aT,rules:[{conditions:[{[zw]:Ww,[Bw]:[nT,Hw]}],rules:[{conditions:[{[zw]:`stringEquals`,[Bw]:[{[zw]:Yw,[Bw]:[rT,`name`]},`aws-us-gov`]}],endpoint:{url:`https://portal.sso.{Region}.amazonaws.com`,properties:tT,headers:tT},type:Kw},{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:tT,headers:tT},type:Kw}],type:qw},{error:`FIPS is enabled but this partition does not support FIPS`,type:Gw}],type:qw},{conditions:oT,rules:[{conditions:[iT],rules:[{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:tT,headers:tT},type:Kw}],type:qw},{error:`DualStack is enabled but this partition does not support DualStack`,type:Gw}],type:qw},{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dnsSuffix}`,properties:tT,headers:tT},type:Kw}],type:qw}],type:qw},{error:`Invalid Configuration: Missing Region`,type:Gw}]},lT=cT})),dT,fT,pT,mT,hT=l((()=>{dT=Kg(),fT=Gg(),uT(),pT=new fT.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),mT=(e,t={})=>pT.get(e,()=>(0,fT.resolveEndpoint)(lT,{endpointParams:e,logger:t.logger})),fT.customEndpointFunctions.aws=dT.awsEndpointFunctions})),gT,_T,vT=l((()=>{gT=C_(),_T=class e extends gT.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),yT,bT,xT,ST,CT=l((()=>{vT(),yT=class e extends _T{name=`InvalidRequestException`;$fault=`client`;constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},bT=class e extends _T{name=`ResourceNotFoundException`;$fault=`client`;constructor(t){super({name:`ResourceNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},xT=class e extends _T{name=`TooManyRequestsException`;$fault=`client`;constructor(t){super({name:`TooManyRequestsException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},ST=class e extends _T{name=`UnauthorizedException`;$fault=`client`;constructor(t){super({name:`UnauthorizedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}}})),wT,TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE=l((()=>{Yp(),CT(),vT(),wT=`AccessTokenType`,TT=`GetRoleCredentials`,ET=`GetRoleCredentialsRequest`,DT=`GetRoleCredentialsResponse`,OT=`InvalidRequestException`,kT=`RoleCredentials`,AT=`ResourceNotFoundException`,jT=`SecretAccessKeyType`,MT=`SessionTokenType`,NT=`TooManyRequestsException`,PT=`UnauthorizedException`,FT=`accountId`,IT=`accessKeyId`,LT=`accessToken`,RT=`account_id`,zT=`client`,BT=`error`,VT=`expiration`,HT=`http`,UT=`httpError`,WT=`httpHeader`,GT=`httpQuery`,KT=`message`,qT=`roleCredentials`,JT=`roleName`,YT=`role_name`,XT=`smithy.ts.sdk.synthetic.com.amazonaws.sso`,ZT=`secretAccessKey`,QT=`sessionToken`,$T=`x-amz-sso_bearer_token`,eE=`com.amazonaws.sso`,tE=Kp.for(XT),nE=[-3,XT,`SSOServiceException`,0,[],[]],tE.registerError(nE,_T),rE=Kp.for(eE),iE=[-3,eE,OT,{[BT]:zT,[UT]:400},[KT],[0]],rE.registerError(iE,yT),aE=[-3,eE,AT,{[BT]:zT,[UT]:404},[KT],[0]],rE.registerError(aE,bT),oE=[-3,eE,NT,{[BT]:zT,[UT]:429},[KT],[0]],rE.registerError(oE,xT),sE=[-3,eE,PT,{[BT]:zT,[UT]:401},[KT],[0]],rE.registerError(sE,ST),cE=[tE,rE],lE=[0,eE,wT,8,0],uE=[0,eE,jT,8,0],dE=[0,eE,MT,8,0],fE=[3,eE,ET,0,[JT,FT,LT],[[0,{[GT]:YT}],[0,{[GT]:RT}],[()=>lE,{[WT]:$T}]],3],pE=[3,eE,DT,0,[qT],[[()=>mE,0]]],mE=[3,eE,kT,0,[IT,ZT,QT,VT],[0,[()=>uE,0],[()=>dE,0],1]],hE=[9,eE,TT,{[HT]:[`GET`,`/federation/credentials`,200]},()=>fE,()=>pE]})),_E,vE,yE,bE,xE,SE=l((()=>{fv(),Sx(),Wg(),_E=C_(),vE=$f(),yE=hf(),bE=pf(),Pw(),hT(),gE(),xE=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??yE.fromBase64,base64Encoder:e?.base64Encoder??yE.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??mT,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Mw,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new z_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Ng}],logger:e?.logger??new _E.NoOpLogger,protocol:e?.protocol??Rb,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.sso`,errorTypeRegistries:cE,version:`2019-06-10`,serviceTarget:`SWBPortalService`},serviceId:e?.serviceId??`SSO`,urlParser:e?.urlParser??vE.parseUrl,utf8Decoder:e?.utf8Decoder??bE.fromUtf8,utf8Encoder:e?.utf8Encoder??bE.toUtf8})})),CE,wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE=l((()=>{r_(),fv(),CE=Nv(),wE=c_(),TE=Pv(),EE=T_(),DE=__(),OE=Af(),kE=C_(),AE=Fv(),jE=Iv(),ME=a_(),SE(),NE=e=>{(0,kE.emitWarningIfUnsupportedVersion)(process.version);let t=(0,jE.resolveDefaultsModeConfig)(e),n=()=>t().then(kE.loadConfigsForDefaultMode),r=xE(e);Jg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,DE.loadConfig)(Z_,i),bodyLengthChecker:e?.bodyLengthChecker??AE.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,CE.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Mv}),maxAttempts:e?.maxAttempts??(0,DE.loadConfig)(EE.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,DE.loadConfig)(wE.NODE_REGION_CONFIG_OPTIONS,{...wE.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:OE.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,DE.loadConfig)({...EE.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||ME.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??TE.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??OE.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,DE.loadConfig)(wE.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,DE.loadConfig)(wE.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,DE.loadConfig)(CE.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),FE,IE,LE=l((()=>{FE=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},IE=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),RE,zE,BE,VE,HE=l((()=>{RE=KC(),zE=_d(),BE=C_(),LE(),VE=(e,t)=>{let n=Object.assign((0,RE.getAwsRegionExtensionConfiguration)(e),(0,BE.getDefaultExtensionConfiguration)(e),(0,zE.getHttpHandlerExtensionConfiguration)(e),FE(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,RE.resolveAwsRegionExtensionConfiguration)(n),(0,BE.resolveDefaultRuntimeConfig)(n),(0,zE.resolveHttpHandlerRuntimeConfig)(n),IE(n))}})),UE,WE,GE,KE,qE,JE,YE,XE,ZE,QE,$E=l((()=>{UE=vd(),WE=yd(),GE=kd(),KE=o_(),qE=c_(),Wg(),Yp(),JE=u_(),YE=x_(),XE=T_(),ZE=C_(),Pw(),Lw(),PE(),HE(),QE=class extends ZE.Client{config;constructor(...[e]){let t=NE(e||{});super(t),this.initConfig=t,this.config=VE(Nw((0,YE.resolveEndpointConfig)((0,UE.resolveHostHeaderConfig)((0,qE.resolveRegionConfig)((0,XE.resolveRetryConfig)((0,KE.resolveUserAgentConfig)(Fw(t))))))),e?.extensions||[]),this.middlewareStack.use(cp(this.config)),this.middlewareStack.use((0,KE.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,XE.getRetryPlugin)(this.config)),this.middlewareStack.use((0,JE.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,UE.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,WE.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,GE.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Vd(this.config,{httpAuthSchemeParametersProvider:jw,identityProviderConfigProvider:async e=>new wg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(ef(this.config))}destroy(){super.destroy()}}})),eD,tD,nD,rD=l((()=>{eD=x_(),tD=C_(),Lw(),gE(),nD=class extends tD.Command.classBuilder().ep(Iw).m(function(e,t,n,r){return[(0,eD.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`SWBPortalService`,`GetRoleCredentials`,{}).n(`SSOClient`,`GetRoleCredentialsCommand`).sc(hE).build(){}})),iD,aD,oD,sD=l((()=>{iD=C_(),rD(),$E(),aD={GetRoleCredentialsCommand:nD},oD=class extends QE{},(0,iD.createAggregatedClient)(aD,oD)})),cD=l((()=>{rD()})),lD=l((()=>{})),uD=d({$Command:()=>tD.Command,GetRoleCredentials$:()=>hE,GetRoleCredentialsCommand:()=>nD,GetRoleCredentialsRequest$:()=>fE,GetRoleCredentialsResponse$:()=>pE,InvalidRequestException:()=>yT,InvalidRequestException$:()=>iE,ResourceNotFoundException:()=>bT,ResourceNotFoundException$:()=>aE,RoleCredentials$:()=>mE,SSO:()=>oD,SSOClient:()=>QE,SSOServiceException:()=>_T,SSOServiceException$:()=>nE,TooManyRequestsException:()=>xT,TooManyRequestsException$:()=>oE,UnauthorizedException:()=>ST,UnauthorizedException$:()=>sE,__Client:()=>ZE.Client,errorTypeRegistries:()=>cE}),dD=l((()=>{$E(),sD(),cD(),gE(),CT(),lD(),vT()})),fD=u((e=>{var t=(dD(),m(uD));e.GetRoleCredentialsCommand=t.GetRoleCredentialsCommand,e.SSOClient=t.SSOClient})),pD=u((e=>{var t=d_(),n=g_(),r=(r_(),m(n_)),i=Dw();let a=e=>e&&(typeof e.sso_start_url==`string`||typeof e.sso_account_id==`string`||typeof e.sso_session==`string`||typeof e.sso_region==`string`||typeof e.sso_role_name==`string`),o=async({ssoStartUrl:e,ssoSession:a,ssoAccountId:o,ssoRegion:s,ssoRoleName:c,ssoClient:l,clientConfig:u,parentClientConfig:d,callerClientConfig:f,profile:p,filepath:m,configFilepath:h,ignoreCache:g,logger:_})=>{let v,y=`To refresh this SSO session run aws sso login with the corresponding profile.`;if(a)try{let e=await i.fromSso({profile:p,filepath:m,configFilepath:h,ignoreCache:g})();v={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new t.CredentialsProviderError(e.message,{tryNextLink:!1,logger:_})}else try{v=await n.getSSOTokenFromFile(e)}catch{throw new t.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${y}`,{tryNextLink:!1,logger:_})}if(new Date(v.expiresAt).getTime()-Date.now()<=0)throw new t.CredentialsProviderError(`The SSO session associated with this profile has expired. ${y}`,{tryNextLink:!1,logger:_});let{accessToken:b}=v,{SSOClient:x,GetRoleCredentialsCommand:S}=await Promise.resolve().then(function(){return fD()}),C=l||new x(Object.assign({},u??{},{logger:u?.logger??f?.logger??d?.logger,region:u?.region??s,userAgentAppId:u?.userAgentAppId??f?.userAgentAppId??d?.userAgentAppId})),w;try{w=await C.send(new S({accountId:o,roleName:c,accessToken:b}))}catch(e){throw new t.CredentialsProviderError(e,{tryNextLink:!1,logger:_})}let{roleCredentials:{accessKeyId:ee,secretAccessKey:te,sessionToken:T,expiration:E,credentialScope:ne,accountId:re}={}}=w;if(!ee||!te||!T||!E)throw new t.CredentialsProviderError(`SSO returns an invalid temporary credential.`,{tryNextLink:!1,logger:_});let ie={accessKeyId:ee,secretAccessKey:te,sessionToken:T,expiration:new Date(E),...ne&&{credentialScope:ne},...re&&{accountId:re}};return a?r.setCredentialFeature(ie,`CREDENTIALS_SSO`,`s`):r.setCredentialFeature(ie,`CREDENTIALS_SSO_LEGACY`,`u`),ie},s=(e,n)=>{let{sso_start_url:r,sso_account_id:i,sso_region:a,sso_role_name:o}=e;if(!r||!i||!a||!o)throw new t.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(`, `)}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:n});return e};e.fromSSO=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-sso - fromSSO`);let{ssoStartUrl:i,ssoAccountId:c,ssoRegion:l,ssoRoleName:u,ssoSession:d}=e,{ssoClient:f}=e,p=n.getProfileName({profile:e.profile??r?.profile});if(!i&&!c&&!l&&!u&&!d){let r=(await n.parseKnownFiles(e))[p];if(!r)throw new t.CredentialsProviderError(`Profile ${p} was not found.`,{logger:e.logger});if(!a(r))throw new t.CredentialsProviderError(`Profile ${p} is not configured with SSO credentials.`,{logger:e.logger});if(r?.sso_session){let a=(await n.loadSsoSessionData(e))[r.sso_session],o=` configurations in profile ${p} and sso-session ${r.sso_session}`;if(l&&l!==a.sso_region)throw new t.CredentialsProviderError(`Conflicting SSO region`+o,{tryNextLink:!1,logger:e.logger});if(i&&i!==a.sso_start_url)throw new t.CredentialsProviderError(`Conflicting SSO start_url`+o,{tryNextLink:!1,logger:e.logger});r.sso_region=a.sso_region,r.sso_start_url=a.sso_start_url}let{sso_start_url:c,sso_account_id:u,sso_region:d,sso_role_name:m,sso_session:h}=s(r,e.logger);return o({ssoStartUrl:c,ssoSession:h,ssoAccountId:u,ssoRegion:d,ssoRoleName:m,ssoClient:f,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:p,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!i||!c||!l||!u)throw new t.CredentialsProviderError(`Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"`,{tryNextLink:!1,logger:e.logger});else return o({ssoStartUrl:i,ssoSession:d,ssoAccountId:c,ssoRegion:l,ssoRoleName:u,ssoClient:f,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:p,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})},e.isSsoProfile=a,e.validateSsoProfile=s}));function mD(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`signin`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function hD(e){return{schemeId:`smithy.api#noAuth`}}var gD,_D,vD,yD,bD=l((()=>{fv(),gD=Nd(),_D=async(e,t,n)=>({operation:(0,gD.getSmithyContext)(t).operation,region:await(0,gD.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),vD=e=>{let t=[];switch(e.operation){case`CreateOAuth2Token`:t.push(hD(e));break;default:t.push(mD(e))}return t},yD=e=>{let t=sv(e);return Object.assign(t,{authSchemePreference:(0,gD.normalizeProvider)(e.authSchemePreference??[])})}})),xD,SD,CD=l((()=>{xD=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`signin`}),SD={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),wD,TD,ED,DD,OD,kD,AD,jD,MD,ND,PD,FD,ID,LD,RD,zD,BD,VD,HD,UD,WD,GD,KD,qD,JD,YD,XD=l((()=>{wD=`required`,TD=`fn`,ED=`argv`,DD=`ref`,OD=!0,kD=`isSet`,AD=`booleanEquals`,jD=`error`,MD=`endpoint`,ND=`tree`,PD=`PartitionResult`,FD=`stringEquals`,ID={[wD]:!0,default:!1,type:`boolean`},LD={[wD]:!1,type:`string`},RD={[DD]:`Endpoint`},zD={[TD]:AD,[ED]:[{[DD]:`UseFIPS`},!0]},BD={[TD]:AD,[ED]:[{[DD]:`UseDualStack`},!0]},VD={},HD={[TD]:`getAttr`,[ED]:[{[DD]:PD},`name`]},UD={[TD]:AD,[ED]:[{[DD]:`UseFIPS`},!1]},WD={[TD]:AD,[ED]:[{[DD]:`UseDualStack`},!1]},GD={[TD]:`getAttr`,[ED]:[{[DD]:PD},`supportsFIPS`]},KD={[TD]:AD,[ED]:[!0,{[TD]:`getAttr`,[ED]:[{[DD]:PD},`supportsDualStack`]}]},qD=[{[DD]:`Region`}],JD={version:`1.0`,parameters:{UseDualStack:ID,UseFIPS:ID,Endpoint:LD,Region:LD},rules:[{conditions:[{[TD]:kD,[ED]:[RD]}],rules:[{conditions:[zD],error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:jD},{rules:[{conditions:[BD],error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:jD},{endpoint:{url:RD,properties:VD,headers:VD},type:MD}],type:ND}],type:ND},{rules:[{conditions:[{[TD]:kD,[ED]:qD}],rules:[{conditions:[{[TD]:`aws.partition`,[ED]:qD,assign:PD}],rules:[{conditions:[{[TD]:FD,[ED]:[HD,`aws`]},UD,WD],endpoint:{url:`https://{Region}.signin.aws.amazon.com`,properties:VD,headers:VD},type:MD},{conditions:[{[TD]:FD,[ED]:[HD,`aws-cn`]},UD,WD],endpoint:{url:`https://{Region}.signin.amazonaws.cn`,properties:VD,headers:VD},type:MD},{conditions:[{[TD]:FD,[ED]:[HD,`aws-us-gov`]},UD,WD],endpoint:{url:`https://{Region}.signin.amazonaws-us-gov.com`,properties:VD,headers:VD},type:MD},{conditions:[zD,BD],rules:[{conditions:[{[TD]:AD,[ED]:[OD,GD]},KD],rules:[{endpoint:{url:`https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:VD,headers:VD},type:MD}],type:ND},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:jD}],type:ND},{conditions:[zD,WD],rules:[{conditions:[{[TD]:AD,[ED]:[GD,OD]}],rules:[{endpoint:{url:`https://signin-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:VD,headers:VD},type:MD}],type:ND},{error:`FIPS is enabled but this partition does not support FIPS`,type:jD}],type:ND},{conditions:[UD,BD],rules:[{conditions:[KD],rules:[{endpoint:{url:`https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:VD,headers:VD},type:MD}],type:ND},{error:`DualStack is enabled but this partition does not support DualStack`,type:jD}],type:ND},{endpoint:{url:`https://signin.{Region}.{PartitionResult#dnsSuffix}`,properties:VD,headers:VD},type:MD}],type:ND}],type:ND},{error:`Invalid Configuration: Missing Region`,type:jD}],type:ND}]},YD=JD})),ZD,QD,$D,eO,tO=l((()=>{ZD=Kg(),QD=Gg(),XD(),$D=new QD.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),eO=(e,t={})=>$D.get(e,()=>(0,QD.resolveEndpoint)(YD,{endpointParams:e,logger:t.logger})),QD.customEndpointFunctions.aws=ZD.awsEndpointFunctions})),nO,rO,iO=l((()=>{nO=C_(),rO=class e extends nO.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),aO,oO,sO,cO,lO=l((()=>{iO(),aO=class e extends rO{name=`AccessDeniedException`;$fault=`client`;error;constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},oO=class e extends rO{name=`InternalServerException`;$fault=`server`;error;constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},sO=class e extends rO{name=`TooManyRequestsError`;$fault=`client`;error;constructor(t){super({name:`TooManyRequestsError`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},cO=class e extends rO{name=`ValidationException`;$fault=`client`;error;constructor(t){super({name:`ValidationException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}}})),uO,dO,fO,pO,mO,hO,gO,_O,vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok=l((()=>{Yp(),lO(),iO(),uO=`AccessDeniedException`,dO=`AccessToken`,fO=`CreateOAuth2Token`,pO=`CreateOAuth2TokenRequest`,mO=`CreateOAuth2TokenRequestBody`,hO=`CreateOAuth2TokenResponseBody`,gO=`CreateOAuth2TokenResponse`,_O=`InternalServerException`,vO=`RefreshToken`,yO=`TooManyRequestsError`,bO=`ValidationException`,xO=`accessKeyId`,SO=`accessToken`,CO=`client`,wO=`clientId`,TO=`codeVerifier`,EO=`code`,DO=`error`,OO=`expiresIn`,kO=`grantType`,AO=`http`,jO=`httpError`,MO=`idToken`,NO=`jsonName`,PO=`message`,FO=`refreshToken`,IO=`redirectUri`,LO=`smithy.ts.sdk.synthetic.com.amazonaws.signin`,RO=`secretAccessKey`,zO=`sessionToken`,BO=`server`,VO=`tokenInput`,HO=`tokenOutput`,UO=`tokenType`,WO=`com.amazonaws.signin`,GO=Kp.for(LO),KO=[-3,LO,`SigninServiceException`,0,[],[]],GO.registerError(KO,rO),qO=Kp.for(WO),JO=[-3,WO,uO,{[DO]:CO},[DO,PO],[0,0],2],qO.registerError(JO,aO),YO=[-3,WO,_O,{[DO]:BO,[jO]:500},[DO,PO],[0,0],2],qO.registerError(YO,oO),XO=[-3,WO,yO,{[DO]:CO,[jO]:429},[DO,PO],[0,0],2],qO.registerError(XO,sO),ZO=[-3,WO,bO,{[DO]:CO,[jO]:400},[DO,PO],[0,0],2],qO.registerError(ZO,cO),QO=[GO,qO],$O=[0,WO,vO,8,0],ek=[3,WO,dO,8,[xO,RO,zO],[[0,{[NO]:xO}],[0,{[NO]:RO}],[0,{[NO]:zO}]],3],tk=[3,WO,pO,0,[VO],[[()=>nk,16]],1],nk=[3,WO,mO,0,[wO,kO,EO,IO,TO,FO],[[0,{[NO]:wO}],[0,{[NO]:kO}],0,[0,{[NO]:IO}],[0,{[NO]:TO}],[()=>$O,{[NO]:FO}]],2],rk=[3,WO,gO,0,[HO],[[()=>ik,16]],1],ik=[3,WO,hO,0,[SO,UO,OO,FO,MO],[[()=>ek,{[NO]:SO}],[0,{[NO]:UO}],[1,{[NO]:OO}],[()=>$O,{[NO]:FO}],[0,{[NO]:MO}]],4],ak=[9,WO,fO,{[AO]:[`POST`,`/v1/token`,200]},()=>tk,()=>rk]})),sk,ck,lk,uk,dk,fk=l((()=>{fv(),Sx(),Wg(),sk=C_(),ck=$f(),lk=hf(),uk=pf(),bD(),tO(),ok(),dk=e=>({apiVersion:`2023-01-01`,base64Decoder:e?.base64Decoder??lk.fromBase64,base64Encoder:e?.base64Encoder??lk.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??eO,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??vD,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new z_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Ng}],logger:e?.logger??new sk.NoOpLogger,protocol:e?.protocol??Rb,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.signin`,errorTypeRegistries:QO,version:`2023-01-01`,serviceTarget:`Signin`},serviceId:e?.serviceId??`Signin`,urlParser:e?.urlParser??ck.parseUrl,utf8Decoder:e?.utf8Decoder??uk.fromUtf8,utf8Encoder:e?.utf8Encoder??uk.toUtf8})})),pk,mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk=l((()=>{r_(),fv(),pk=Nv(),mk=c_(),hk=Pv(),gk=T_(),_k=__(),vk=Af(),yk=C_(),bk=Fv(),xk=Iv(),Sk=a_(),fk(),Ck=e=>{(0,yk.emitWarningIfUnsupportedVersion)(process.version);let t=(0,xk.resolveDefaultsModeConfig)(e),n=()=>t().then(yk.loadConfigsForDefaultMode),r=dk(e);Jg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,_k.loadConfig)(Z_,i),bodyLengthChecker:e?.bodyLengthChecker??bk.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,pk.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Mv}),maxAttempts:e?.maxAttempts??(0,_k.loadConfig)(gk.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,_k.loadConfig)(mk.NODE_REGION_CONFIG_OPTIONS,{...mk.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:vk.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,_k.loadConfig)({...gk.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||Sk.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??hk.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??vk.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,_k.loadConfig)(mk.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,_k.loadConfig)(mk.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,_k.loadConfig)(pk.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),Tk,Ek,Dk=l((()=>{Tk=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},Ek=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),Ok,kk,Ak,jk,Mk=l((()=>{Ok=KC(),kk=_d(),Ak=C_(),Dk(),jk=(e,t)=>{let n=Object.assign((0,Ok.getAwsRegionExtensionConfiguration)(e),(0,Ak.getDefaultExtensionConfiguration)(e),(0,kk.getHttpHandlerExtensionConfiguration)(e),Tk(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,Ok.resolveAwsRegionExtensionConfiguration)(n),(0,Ak.resolveDefaultRuntimeConfig)(n),(0,kk.resolveHttpHandlerRuntimeConfig)(n),Ek(n))}})),Nk,Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk=l((()=>{Nk=vd(),Pk=yd(),Fk=kd(),Ik=o_(),Lk=c_(),Wg(),Yp(),Rk=u_(),zk=x_(),Bk=T_(),Vk=C_(),bD(),CD(),wk(),Mk(),Hk=class extends Vk.Client{config;constructor(...[e]){let t=Ck(e||{});super(t),this.initConfig=t,this.config=jk(yD((0,zk.resolveEndpointConfig)((0,Nk.resolveHostHeaderConfig)((0,Lk.resolveRegionConfig)((0,Bk.resolveRetryConfig)((0,Ik.resolveUserAgentConfig)(xD(t))))))),e?.extensions||[]),this.middlewareStack.use(cp(this.config)),this.middlewareStack.use((0,Ik.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,Bk.getRetryPlugin)(this.config)),this.middlewareStack.use((0,Rk.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,Nk.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,Pk.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,Fk.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Vd(this.config,{httpAuthSchemeParametersProvider:_D,identityProviderConfigProvider:async e=>new wg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(ef(this.config))}destroy(){super.destroy()}}})),Wk,Gk,Kk,qk=l((()=>{Wk=x_(),Gk=C_(),CD(),ok(),Kk=class extends Gk.Command.classBuilder().ep(SD).m(function(e,t,n,r){return[(0,Wk.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`Signin`,`CreateOAuth2Token`,{}).n(`SigninClient`,`CreateOAuth2TokenCommand`).sc(ak).build(){}})),Jk,Yk,Xk,Zk=l((()=>{Jk=C_(),qk(),Uk(),Yk={CreateOAuth2TokenCommand:Kk},Xk=class extends Hk{},(0,Jk.createAggregatedClient)(Yk,Xk)})),Qk=l((()=>{qk()})),$k,eA=l((()=>{$k={AUTHCODE_EXPIRED:`AUTHCODE_EXPIRED`,INSUFFICIENT_PERMISSIONS:`INSUFFICIENT_PERMISSIONS`,INVALID_REQUEST:`INVALID_REQUEST`,SERVER_ERROR:`server_error`,TOKEN_EXPIRED:`TOKEN_EXPIRED`,USER_CREDENTIALS_CHANGED:`USER_CREDENTIALS_CHANGED`}})),tA=l((()=>{})),nA=d({$Command:()=>Gk.Command,AccessDeniedException:()=>aO,AccessDeniedException$:()=>JO,AccessToken$:()=>ek,CreateOAuth2Token$:()=>ak,CreateOAuth2TokenCommand:()=>Kk,CreateOAuth2TokenRequest$:()=>tk,CreateOAuth2TokenRequestBody$:()=>nk,CreateOAuth2TokenResponse$:()=>rk,CreateOAuth2TokenResponseBody$:()=>ik,InternalServerException:()=>oO,InternalServerException$:()=>YO,OAuth2ErrorCode:()=>$k,Signin:()=>Xk,SigninClient:()=>Hk,SigninServiceException:()=>rO,SigninServiceException$:()=>KO,TooManyRequestsError:()=>sO,TooManyRequestsError$:()=>XO,ValidationException:()=>cO,ValidationException$:()=>ZO,__Client:()=>Vk.Client,errorTypeRegistries:()=>QO}),rA=l((()=>{Uk(),Zk(),Qk(),ok(),eA(),lO(),tA(),iO()})),iA=u((e=>{var t=(r_(),m(n_)),n=d_(),r=g_(),i=_d(),a=h(`node:crypto`),o=h(`node:fs`),s=h(`node:os`),c=h(`node:path`),l=class e{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300*1e3;constructor(e,t,n){this.profileData=e,this.init=t,this.callerClientConfig=n}async loadCredentials(){let t=await this.loadToken();if(!t)throw new n.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let r=t.accessToken,i=Date.now();return new Date(r.expiresAt).getTime()-i<=e.REFRESH_THRESHOLD?this.refresh(t):{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,sessionToken:r.sessionToken,accountId:r.accountId,expiration:new Date(r.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){let{SigninClient:t,CreateOAuth2TokenCommand:r}=await Promise.resolve().then(()=>(rA(),nA)),{logger:i,userAgentAppId:a}=this.callerClientConfig??{},o=(e=>e?.metadata?.handlerProtocol===`h2`)(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,s=new t({credentials:{accessKeyId:``,secretAccessKey:``},region:this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,requestHandler:o,logger:i,userAgentAppId:a,...this.init?.clientConfig});this.createDPoPInterceptor(s.middlewareStack);let c={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:`refresh_token`}};try{let t=await s.send(new r(c)),{accessKeyId:i,secretAccessKey:a,sessionToken:o}=t.tokenOutput?.accessToken??{},{refreshToken:l,expiresIn:u}=t.tokenOutput??{};if(!i||!a||!o||!l)throw new n.CredentialsProviderError(`Token refresh response missing required fields`,{logger:this.logger,tryNextLink:!1});let d=(u??900)*1e3,f=new Date(Date.now()+d),p={...e,accessToken:{...e.accessToken,accessKeyId:i,secretAccessKey:a,sessionToken:o,expiresAt:f.toISOString()},refreshToken:l};await this.saveToken(p);let m=p.accessToken;return{accessKeyId:m.accessKeyId,secretAccessKey:m.secretAccessKey,sessionToken:m.sessionToken,accountId:m.accountId,expiration:f}}catch(e){if(e.name===`AccessDeniedException`){let t=e.error,r;switch(t){case`TOKEN_EXPIRED`:r=`Your session has expired. Please reauthenticate.`;break;case`USER_CREDENTIALS_CHANGED`:r=`Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.`;break;case`INSUFFICIENT_PERMISSIONS`:r=`Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.`;break;default:r=`Failed to refresh token: ${String(e)}. Please re-authenticate using \`aws login\``}throw new n.CredentialsProviderError(r,{logger:this.logger,tryNextLink:!1})}throw new n.CredentialsProviderError(`Failed to refresh token: ${String(e)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let t;try{t=await r.readFile(e,{ignoreCache:this.init?.ignoreCache})}catch{t=await o.promises.readFile(e,`utf8`)}let i=JSON.parse(t),a=[`accessToken`,`clientId`,`refreshToken`,`dpopKey`].filter(e=>!i[e]);if(i.accessToken?.accountId||a.push(`accountId`),a.length>0)throw new n.CredentialsProviderError(`Token validation failed, missing fields: ${a.join(`, `)}`,{logger:this.logger,tryNextLink:!1});return i}catch(t){throw new n.CredentialsProviderError(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let t=this.getTokenFilePath(),n=c.dirname(t);try{await o.promises.mkdir(n,{recursive:!0})}catch{}await o.promises.writeFile(t,JSON.stringify(e,null,2),`utf8`)}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??c.join(s.homedir(),`.aws`,`login`,`cache`),t=Buffer.from(this.loginSession,`utf8`),n=a.createHash(`sha256`).update(t).digest(`hex`);return c.join(e,`${n}.json`)}derToRawSignature(e){let t=2;if(e[t]!==2)throw Error(`Invalid DER signature`);t++;let n=e[t++],r=e.subarray(t,t+n);if(t+=n,e[t]!==2)throw Error(`Invalid DER signature`);t++;let i=e[t++],a=e.subarray(t,t+i);r=r[0]===0?r.subarray(1):r,a=a[0]===0?a.subarray(1):a;let o=Buffer.concat([Buffer.alloc(32-r.length),r]),s=Buffer.concat([Buffer.alloc(32-a.length),a]);return Buffer.concat([o,s])}createDPoPInterceptor(e){e.add(e=>async t=>{if(i.HttpRequest.isInstance(t.request)){let e=t.request,n=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:``}${e.path}`,r=await this.generateDpop(e.method,n);e.headers={...e.headers,DPoP:r}}return e(t)},{step:`finalizeRequest`,name:`dpopInterceptor`,override:!0})}async generateDpop(e=`POST`,t){let r=await this.loadToken();try{let n=a.createPrivateKey({key:r.dpopKey,format:`pem`,type:`sec1`}),i=a.createPublicKey(n).export({format:`der`,type:`spki`}),o=-1;for(let e=0;e<i.length;e++)if(i[e]===4){o=e;break}let s=i.slice(o+1,o+33),c=i.slice(o+33,o+65),l={alg:`ES256`,typ:`dpop+jwt`,jwk:{kty:`EC`,crv:`P-256`,x:s.toString(`base64url`),y:c.toString(`base64url`)}},u={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1e3)},d=`${Buffer.from(JSON.stringify(l)).toString(`base64url`)}.${Buffer.from(JSON.stringify(u)).toString(`base64url`)}`,f=a.sign(`sha256`,Buffer.from(d),n);return`${d}.${this.derToRawSignature(f).toString(`base64url`)}`}catch(e){throw new n.CredentialsProviderError(`Failed to generate Dpop proof: ${e instanceof Error?e.message:String(e)}`,{logger:this.logger,tryNextLink:!1})}}};e.fromLoginCredentials=e=>async({callerClientConfig:i}={})=>{e?.logger?.debug?.(`@aws-sdk/credential-providers - fromLoginCredentials`);let a=await r.parseKnownFiles(e||{}),o=r.getProfileName({profile:e?.profile??i?.profile}),s=a[o];if(!s?.login_session)throw new n.CredentialsProviderError(`Profile ${o} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let c=await new l(s,e,i).loadCredentials();return t.setCredentialFeature(c,`CREDENTIALS_LOGIN`,`AD`)}}));function aA(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sts`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function oA(e){return{schemeId:`smithy.api#noAuth`}}var sA,cA,lA,uA,dA,fA=l((()=>{fv(),sA=Nd(),MN(),cA=async(e,t,n)=>({operation:(0,sA.getSmithyContext)(t).operation,region:await(0,sA.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),lA=e=>{let t=[];switch(e.operation){case`AssumeRoleWithWebIdentity`:t.push(oA(e));break;default:t.push(aA(e))}return t},uA=e=>Object.assign(e,{stsClientCtor:jN}),dA=e=>{let t=sv(uA(e));return Object.assign(t,{authSchemePreference:(0,sA.normalizeProvider)(e.authSchemePreference??[])})}})),pA,mA,hA=l((()=>{pA=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:`sts`}),mA={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`}}})),gA,_A,vA,yA,bA,xA,SA,CA,wA,TA,EA,DA,OA,kA,AA,jA,MA,NA,PA,FA,IA,LA,RA,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,XA,ZA,QA,$A,ej=l((()=>{gA=`required`,_A=`type`,vA=`fn`,yA=`argv`,bA=`ref`,xA=!1,SA=!0,CA=`booleanEquals`,wA=`stringEquals`,TA=`sigv4`,EA=`sts`,DA=`us-east-1`,OA=`endpoint`,kA=`https://sts.{Region}.{PartitionResult#dnsSuffix}`,AA=`tree`,jA=`error`,MA=`getAttr`,NA={[gA]:!1,[_A]:`string`},PA={[gA]:!0,default:!1,[_A]:`boolean`},FA={[bA]:`Endpoint`},IA={[vA]:`isSet`,[yA]:[{[bA]:`Region`}]},LA={[bA]:`Region`},RA={[vA]:`aws.partition`,[yA]:[LA],assign:`PartitionResult`},zA={[bA]:`UseFIPS`},BA={[bA]:`UseDualStack`},VA={url:`https://sts.amazonaws.com`,properties:{authSchemes:[{name:TA,signingName:EA,signingRegion:DA}]},headers:{}},HA={},UA={conditions:[{[vA]:wA,[yA]:[LA,`aws-global`]}],[OA]:VA,[_A]:OA},WA={[vA]:CA,[yA]:[zA,!0]},GA={[vA]:CA,[yA]:[BA,!0]},KA={[vA]:MA,[yA]:[{[bA]:`PartitionResult`},`supportsFIPS`]},qA={[bA]:`PartitionResult`},JA={[vA]:CA,[yA]:[!0,{[vA]:MA,[yA]:[qA,`supportsDualStack`]}]},YA=[{[vA]:`isSet`,[yA]:[FA]}],XA=[WA],ZA=[GA],QA={version:`1.0`,parameters:{Region:NA,UseDualStack:PA,UseFIPS:PA,Endpoint:NA,UseGlobalEndpoint:PA},rules:[{conditions:[{[vA]:CA,[yA]:[{[bA]:`UseGlobalEndpoint`},SA]},{[vA]:`not`,[yA]:YA},IA,RA,{[vA]:CA,[yA]:[zA,xA]},{[vA]:CA,[yA]:[BA,xA]}],rules:[{conditions:[{[vA]:wA,[yA]:[LA,`ap-northeast-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`ap-south-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`ap-southeast-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`ap-southeast-2`]}],endpoint:VA,[_A]:OA},UA,{conditions:[{[vA]:wA,[yA]:[LA,`ca-central-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`eu-central-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`eu-north-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`eu-west-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`eu-west-2`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`eu-west-3`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`sa-east-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,DA]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`us-east-2`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`us-west-1`]}],endpoint:VA,[_A]:OA},{conditions:[{[vA]:wA,[yA]:[LA,`us-west-2`]}],endpoint:VA,[_A]:OA},{endpoint:{url:kA,properties:{authSchemes:[{name:TA,signingName:EA,signingRegion:`{Region}`}]},headers:HA},[_A]:OA}],[_A]:AA},{conditions:YA,rules:[{conditions:XA,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,[_A]:jA},{conditions:ZA,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,[_A]:jA},{endpoint:{url:FA,properties:HA,headers:HA},[_A]:OA}],[_A]:AA},{conditions:[IA],rules:[{conditions:[RA],rules:[{conditions:[WA,GA],rules:[{conditions:[{[vA]:CA,[yA]:[SA,KA]},JA],rules:[{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:HA,headers:HA},[_A]:OA}],[_A]:AA},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,[_A]:jA}],[_A]:AA},{conditions:XA,rules:[{conditions:[{[vA]:CA,[yA]:[KA,SA]}],rules:[{conditions:[{[vA]:wA,[yA]:[{[vA]:MA,[yA]:[qA,`name`]},`aws-us-gov`]}],endpoint:{url:`https://sts.{Region}.amazonaws.com`,properties:HA,headers:HA},[_A]:OA},{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:HA,headers:HA},[_A]:OA}],[_A]:AA},{error:`FIPS is enabled but this partition does not support FIPS`,[_A]:jA}],[_A]:AA},{conditions:ZA,rules:[{conditions:[JA],rules:[{endpoint:{url:`https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:HA,headers:HA},[_A]:OA}],[_A]:AA},{error:`DualStack is enabled but this partition does not support DualStack`,[_A]:jA}],[_A]:AA},UA,{endpoint:{url:kA,properties:HA,headers:HA},[_A]:OA}],[_A]:AA}],[_A]:AA},{error:`Invalid Configuration: Missing Region`,[_A]:jA}]},$A=QA})),tj,nj,rj,ij,aj=l((()=>{tj=Kg(),nj=Gg(),ej(),rj=new nj.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`,`UseGlobalEndpoint`]}),ij=(e,t={})=>rj.get(e,()=>(0,nj.resolveEndpoint)($A,{endpointParams:e,logger:t.logger})),nj.customEndpointFunctions.aws=tj.awsEndpointFunctions})),oj,sj,cj=l((()=>{oj=C_(),sj=class e extends oj.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),lj,uj,dj,fj,pj,mj,hj,gj=l((()=>{cj(),lj=class e extends sj{name=`ExpiredTokenException`;$fault=`client`;constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},uj=class e extends sj{name=`MalformedPolicyDocumentException`;$fault=`client`;constructor(t){super({name:`MalformedPolicyDocumentException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},dj=class e extends sj{name=`PackedPolicyTooLargeException`;$fault=`client`;constructor(t){super({name:`PackedPolicyTooLargeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},fj=class e extends sj{name=`RegionDisabledException`;$fault=`client`;constructor(t){super({name:`RegionDisabledException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},pj=class e extends sj{name=`IDPRejectedClaimException`;$fault=`client`;constructor(t){super({name:`IDPRejectedClaimException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},mj=class e extends sj{name=`InvalidIdentityTokenException`;$fault=`client`;constructor(t){super({name:`InvalidIdentityTokenException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},hj=class e extends sj{name=`IDPCommunicationErrorException`;$fault=`client`;constructor(t){super({name:`IDPCommunicationErrorException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}}})),_j,vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj,Yj,Xj,Zj,Qj,$j,eM,tM,nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM=l((()=>{Yp(),gj(),cj(),_j=`Arn`,vj=`AccessKeyId`,yj=`AssumeRole`,bj=`AssumedRoleId`,xj=`AssumeRoleRequest`,Sj=`AssumeRoleResponse`,Cj=`AssumedRoleUser`,wj=`AssumeRoleWithWebIdentity`,Tj=`AssumeRoleWithWebIdentityRequest`,Ej=`AssumeRoleWithWebIdentityResponse`,Dj=`Audience`,Oj=`Credentials`,kj=`ContextAssertion`,Aj=`DurationSeconds`,jj=`Expiration`,Mj=`ExternalId`,Nj=`ExpiredTokenException`,Pj=`IDPCommunicationErrorException`,Fj=`IDPRejectedClaimException`,Ij=`InvalidIdentityTokenException`,Lj=`Key`,Rj=`MalformedPolicyDocumentException`,zj=`Policy`,Bj=`PolicyArns`,Vj=`ProviderArn`,Hj=`ProvidedContexts`,Uj=`ProvidedContextsListType`,Wj=`ProvidedContext`,Gj=`PolicyDescriptorType`,Kj=`ProviderId`,qj=`PackedPolicySize`,Jj=`PackedPolicyTooLargeException`,Yj=`Provider`,Xj=`RoleArn`,Zj=`RegionDisabledException`,Qj=`RoleSessionName`,$j=`SecretAccessKey`,eM=`SubjectFromWebIdentityToken`,tM=`SourceIdentity`,nM=`SerialNumber`,rM=`SessionToken`,iM=`Tags`,aM=`TokenCode`,oM=`TransitiveTagKeys`,sM=`Tag`,cM=`Value`,lM=`WebIdentityToken`,uM=`arn`,dM=`accessKeySecretType`,fM=`awsQueryError`,pM=`client`,mM=`clientTokenType`,hM=`error`,gM=`httpError`,_M=`message`,vM=`policyDescriptorListType`,yM=`smithy.ts.sdk.synthetic.com.amazonaws.sts`,bM=`tagListType`,xM=`com.amazonaws.sts`,SM=Kp.for(yM),CM=[-3,yM,`STSServiceException`,0,[],[]],SM.registerError(CM,sj),wM=Kp.for(xM),TM=[-3,xM,Nj,{[fM]:[`ExpiredTokenException`,400],[hM]:pM,[gM]:400},[_M],[0]],wM.registerError(TM,lj),EM=[-3,xM,Pj,{[fM]:[`IDPCommunicationError`,400],[hM]:pM,[gM]:400},[_M],[0]],wM.registerError(EM,hj),DM=[-3,xM,Fj,{[fM]:[`IDPRejectedClaim`,403],[hM]:pM,[gM]:403},[_M],[0]],wM.registerError(DM,pj),OM=[-3,xM,Ij,{[fM]:[`InvalidIdentityToken`,400],[hM]:pM,[gM]:400},[_M],[0]],wM.registerError(OM,mj),kM=[-3,xM,Rj,{[fM]:[`MalformedPolicyDocument`,400],[hM]:pM,[gM]:400},[_M],[0]],wM.registerError(kM,uj),AM=[-3,xM,Jj,{[fM]:[`PackedPolicyTooLarge`,400],[hM]:pM,[gM]:400},[_M],[0]],wM.registerError(AM,dj),jM=[-3,xM,Zj,{[fM]:[`RegionDisabledException`,403],[hM]:pM,[gM]:403},[_M],[0]],wM.registerError(jM,fj),MM=[SM,wM],NM=[0,xM,dM,8,0],PM=[0,xM,mM,8,0],FM=[3,xM,Cj,0,[bj,_j],[0,0],2],IM=[3,xM,xj,0,[Xj,Qj,Bj,zj,Aj,iM,oM,Mj,nM,aM,tM,Hj],[0,0,()=>WM,0,1,()=>KM,64,0,0,0,0,()=>GM],2],LM=[3,xM,Sj,0,[Oj,Cj,qj,tM],[[()=>BM,0],()=>FM,1,0]],RM=[3,xM,Tj,0,[Xj,Qj,lM,Kj,Bj,zj,Aj],[0,0,[()=>PM,0],0,()=>WM,0,1],3],zM=[3,xM,Ej,0,[Oj,eM,Cj,qj,Yj,Dj,tM],[[()=>BM,0],0,()=>FM,1,0,0,0]],BM=[3,xM,Oj,0,[vj,$j,rM,jj],[0,[()=>NM,0],0,4],4],VM=[3,xM,Gj,0,[uM],[0]],HM=[3,xM,Wj,0,[Vj,kj],[0,0]],UM=[3,xM,sM,0,[Lj,cM],[0,0],2],WM=[1,xM,vM,0,()=>VM],GM=[1,xM,Uj,0,()=>HM],KM=[1,xM,bM,0,()=>UM],qM=[9,xM,yj,0,()=>IM,()=>LM],JM=[9,xM,wj,0,()=>RM,()=>zM]})),XM,ZM,QM,$M,eN,tN=l((()=>{fv(),Sx(),Wg(),XM=C_(),ZM=$f(),QM=hf(),$M=pf(),fA(),aj(),YM(),eN=e=>({apiVersion:`2011-06-15`,base64Decoder:e?.base64Decoder??QM.fromBase64,base64Encoder:e?.base64Encoder??QM.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??ij,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??lA,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new z_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Ng}],logger:e?.logger??new XM.NoOpLogger,protocol:e?.protocol??tx,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.sts`,errorTypeRegistries:MM,xmlNamespace:`https://sts.amazonaws.com/doc/2011-06-15/`,version:`2011-06-15`,serviceTarget:`AWSSecurityTokenServiceV20110615`},serviceId:e?.serviceId??`STS`,urlParser:e?.urlParser??ZM.parseUrl,utf8Decoder:e?.utf8Decoder??$M.fromUtf8,utf8Encoder:e?.utf8Encoder??$M.toUtf8})})),nN,rN,iN,aN,oN,sN,cN,lN,uN,dN,fN,pN=l((()=>{r_(),fv(),nN=Nv(),rN=c_(),Wg(),iN=Pv(),aN=T_(),oN=__(),sN=Af(),cN=C_(),lN=Fv(),uN=Iv(),dN=a_(),tN(),fN=e=>{(0,cN.emitWarningIfUnsupportedVersion)(process.version);let t=(0,uN.resolveDefaultsModeConfig)(e),n=()=>t().then(cN.loadConfigsForDefaultMode),r=eN(e);Jg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,oN.loadConfig)(Z_,i),bodyLengthChecker:e?.bodyLengthChecker??lN.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,nN.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Mv}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:t=>t.getIdentityProvider(`aws.auth#sigv4`)||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new z_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Ng}],maxAttempts:e?.maxAttempts??(0,oN.loadConfig)(aN.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,oN.loadConfig)(rN.NODE_REGION_CONFIG_OPTIONS,{...rN.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:sN.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,oN.loadConfig)({...aN.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||dN.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??iN.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??sN.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,oN.loadConfig)(rN.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,oN.loadConfig)(rN.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,oN.loadConfig)(nN.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),mN,hN,gN=l((()=>{mN=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},hN=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),_N,vN,yN,bN,xN=l((()=>{_N=KC(),vN=_d(),yN=C_(),gN(),bN=(e,t)=>{let n=Object.assign((0,_N.getAwsRegionExtensionConfiguration)(e),(0,yN.getDefaultExtensionConfiguration)(e),(0,vN.getHttpHandlerExtensionConfiguration)(e),mN(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,_N.resolveAwsRegionExtensionConfiguration)(n),(0,yN.resolveDefaultRuntimeConfig)(n),(0,vN.resolveHttpHandlerRuntimeConfig)(n),hN(n))}})),SN,CN,wN,TN,EN,DN,ON,kN,AN,jN,MN=l((()=>{SN=vd(),CN=yd(),wN=kd(),TN=o_(),EN=c_(),Wg(),Yp(),DN=u_(),ON=x_(),kN=T_(),AN=C_(),fA(),hA(),pN(),xN(),jN=class extends AN.Client{config;constructor(...[e]){let t=fN(e||{});super(t),this.initConfig=t,this.config=bN(dA((0,ON.resolveEndpointConfig)((0,SN.resolveHostHeaderConfig)((0,EN.resolveRegionConfig)((0,kN.resolveRetryConfig)((0,TN.resolveUserAgentConfig)(pA(t))))))),e?.extensions||[]),this.middlewareStack.use(cp(this.config)),this.middlewareStack.use((0,TN.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,kN.getRetryPlugin)(this.config)),this.middlewareStack.use((0,DN.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,SN.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,CN.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,wN.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Vd(this.config,{httpAuthSchemeParametersProvider:cA,identityProviderConfigProvider:async e=>new wg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(ef(this.config))}destroy(){super.destroy()}}})),NN,PN,FN,IN=l((()=>{NN=x_(),PN=C_(),hA(),YM(),FN=class extends PN.Command.classBuilder().ep(mA).m(function(e,t,n,r){return[(0,NN.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`AWSSecurityTokenServiceV20110615`,`AssumeRole`,{}).n(`STSClient`,`AssumeRoleCommand`).sc(qM).build(){}})),LN,RN,zN,BN=l((()=>{LN=x_(),RN=C_(),hA(),YM(),zN=class extends RN.Command.classBuilder().ep(mA).m(function(e,t,n,r){return[(0,LN.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`AWSSecurityTokenServiceV20110615`,`AssumeRoleWithWebIdentity`,{}).n(`STSClient`,`AssumeRoleWithWebIdentityCommand`).sc(JM).build(){}})),VN,HN,UN,WN=l((()=>{VN=C_(),IN(),BN(),MN(),HN={AssumeRoleCommand:FN,AssumeRoleWithWebIdentityCommand:zN},UN=class extends jN{},(0,VN.createAggregatedClient)(HN,UN)})),GN=l((()=>{IN(),BN()})),KN=l((()=>{})),qN,JN,YN,XN,ZN,QN,$N=l((()=>{r_(),qN=KC(),IN(),BN(),JN=e=>{if(typeof e?.Arn==`string`){let t=e.Arn.split(`:`);if(t.length>4&&t[4]!==``)return t[4]}},YN=async(e,t,n,r={})=>{let i=typeof e==`function`?await e():e,a=typeof t==`function`?await t():t,o=``,s=i??a??(o=await(0,qN.stsRegionDefaultResolver)(r)());return n?.debug?.(`@aws-sdk/client-sts::resolveRegion`,`accepting first of:`,`${i} (credential provider clientConfig)`,`${a} (contextual client)`,`${o} (STS default: AWS_REGION, profile region, or us-east-1)`),s},XN=(e,t)=>{let n,r;return async(i,a)=>{if(r=i,!n){let{logger:i=e?.parentClientConfig?.logger,profile:a=e?.parentClientConfig?.profile,region:o,requestHandler:s=e?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:l=e?.parentClientConfig?.userAgentAppId}=e,u=await YN(o,e?.parentClientConfig?.region,c,{logger:i,profile:a}),d=!QN(s);n=new t({...e,userAgentAppId:l,profile:a,credentialDefaultProvider:()=>async()=>r,region:u,requestHandler:d?s:void 0,logger:i})}let{Credentials:o,AssumedRoleUser:s}=await n.send(new FN(a));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${a.RoleArn}`);let c=JN(s),l={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};return Xg(l,`CREDENTIALS_STS_ASSUME_ROLE`,`i`),l}},ZN=(e,t)=>{let n;return async r=>{if(!n){let{logger:r=e?.parentClientConfig?.logger,profile:i=e?.parentClientConfig?.profile,region:a,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:s,userAgentAppId:c=e?.parentClientConfig?.userAgentAppId}=e,l=await YN(a,e?.parentClientConfig?.region,s,{logger:r,profile:i}),u=!QN(o);n=new t({...e,userAgentAppId:c,profile:i,region:l,requestHandler:u?o:void 0,logger:r})}let{Credentials:i,AssumedRoleUser:a}=await n.send(new zN(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);let o=JN(a),s={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...o&&{accountId:o}};return o&&Xg(s,`RESOLVED_ACCOUNT_ID`,`T`),Xg(s,`CREDENTIALS_STS_ASSUME_ROLE_WEB_ID`,`k`),s}},QN=e=>e?.metadata?.handlerProtocol===`h2`})),eP,tP,nP,rP,iP=l((()=>{$N(),MN(),eP=(e,t)=>t?class extends e{constructor(e){super(e);for(let e of t)this.middlewareStack.use(e)}}:e,tP=(e={},t)=>XN(e,eP(jN,t)),nP=(e={},t)=>ZN(e,eP(jN,t)),rP=e=>t=>e({roleAssumer:tP(t),roleAssumerWithWebIdentity:nP(t),...t})})),aP=d({AssumeRole$:()=>qM,AssumeRoleCommand:()=>FN,AssumeRoleRequest$:()=>IM,AssumeRoleResponse$:()=>LM,AssumeRoleWithWebIdentity$:()=>JM,AssumeRoleWithWebIdentityCommand:()=>zN,AssumeRoleWithWebIdentityRequest$:()=>RM,AssumeRoleWithWebIdentityResponse$:()=>zM,AssumedRoleUser$:()=>FM,Credentials$:()=>BM,ExpiredTokenException:()=>lj,ExpiredTokenException$:()=>TM,IDPCommunicationErrorException:()=>hj,IDPCommunicationErrorException$:()=>EM,IDPRejectedClaimException:()=>pj,IDPRejectedClaimException$:()=>DM,InvalidIdentityTokenException:()=>mj,InvalidIdentityTokenException$:()=>OM,MalformedPolicyDocumentException:()=>uj,MalformedPolicyDocumentException$:()=>kM,PackedPolicyTooLargeException:()=>dj,PackedPolicyTooLargeException$:()=>AM,PolicyDescriptorType$:()=>VM,ProvidedContext$:()=>HM,RegionDisabledException:()=>fj,RegionDisabledException$:()=>jM,STS:()=>UN,STSClient:()=>jN,STSServiceException:()=>sj,STSServiceException$:()=>CM,Tag$:()=>UM,__Client:()=>AN.Client,decorateDefaultCredentialProvider:()=>rP,errorTypeRegistries:()=>MM,getDefaultRoleAssumer:()=>tP,getDefaultRoleAssumerWithWebIdentity:()=>nP}),oP=l((()=>{MN(),WN(),GN(),YM(),gj(),KN(),iP(),cj()})),sP=u((e=>{var t=g_(),n=d_(),r=h(`node:child_process`),i=h(`node:util`),a=(r_(),m(n_));let o=(e,t,n)=>{if(t.Version!==1)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(t.AccessKeyId===void 0||t.SecretAccessKey===void 0)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){let n=new Date;if(new Date(t.Expiration)<n)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let r=t.AccountId;!r&&n?.[e]?.aws_account_id&&(r=n[e].aws_account_id);let i={accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)},...t.CredentialScope&&{credentialScope:t.CredentialScope},...r&&{accountId:r}};return a.setCredentialFeature(i,`CREDENTIALS_PROCESS`,`w`),i},s=async(e,a,s)=>{let c=a[e];if(a[e]){let l=c.credential_process;if(l!==void 0){let c=i.promisify(t.externalDataInterceptor?.getTokenRecord?.().exec??r.exec);try{let{stdout:t}=await c(l),n;try{n=JSON.parse(t.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return o(e,n,a)}catch(e){throw new n.CredentialsProviderError(e.message,{logger:s})}}else throw new n.CredentialsProviderError(`Profile ${e} did not contain credential_process.`,{logger:s})}else throw new n.CredentialsProviderError(`Profile ${e} could not be found in shared credentials file.`,{logger:s})};e.fromProcess=(e={})=>async({callerClientConfig:n}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-process - fromProcess`);let r=await t.parseKnownFiles(e);return s(t.getProfileName({profile:e.profile??n?.profile}),r,e.logger)}})),cP=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!==`default`&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.fromWebToken=void 0,e.fromWebToken=e=>async t=>{e.logger?.debug(`@aws-sdk/credential-provider-web-identity - fromWebToken`);let{roleArn:n,roleSessionName:i,webIdentityToken:a,providerId:o,policyArns:s,policy:c,durationSeconds:l}=e,{roleAssumerWithWebIdentity:u}=e;if(!u){let{getDefaultRoleAssumerWithWebIdentity:n}=await Promise.resolve().then(()=>r((oP(),m(aP))));u=n({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...t?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return u({RoleArn:n,RoleSessionName:i??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:a,ProviderId:o,PolicyArns:s,Policy:c,DurationSeconds:l})}})),lP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromTokenFile=void 0;let t=(r_(),m(n_)),n=d_(),r=g_(),i=h(`node:fs`),a=cP(),o=`AWS_WEB_IDENTITY_TOKEN_FILE`;e.fromTokenFile=(e={})=>async s=>{e.logger?.debug(`@aws-sdk/credential-provider-web-identity - fromTokenFile`);let c=e?.webIdentityTokenFile??process.env[o],l=e?.roleArn??process.env.AWS_ROLE_ARN,u=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!c||!l)throw new n.CredentialsProviderError(`Web identity configuration not specified`,{logger:e.logger});let d=await(0,a.fromWebToken)({...e,webIdentityToken:r.externalDataInterceptor?.getTokenRecord?.()[c]??(0,i.readFileSync)(c,{encoding:`ascii`}),roleArn:l,roleSessionName:u})(s);return c===process.env[o]&&(0,t.setCredentialFeature)(d,`CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN`,`h`),d}})),uP=u((e=>{var t=lP(),n=cP();Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),Object.prototype.hasOwnProperty.call(n,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:n.__proto__}),Object.keys(n).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=n[t])})})),dP=u((e=>{var t=g_(),n=d_(),r=(r_(),m(n_)),i=iA();let a=(e,t,r)=>{let i={EcsContainer:async e=>{let{fromHttp:t}=await Promise.resolve().then(()=>p(xv())),{fromContainerMetadata:i}=await Promise.resolve().then(()=>p(gv()));return r?.debug(`@aws-sdk/credential-provider-ini - credential_source is EcsContainer`),async()=>n.chain(t(e??{}),i(e))().then(o)},Ec2InstanceMetadata:async e=>{r?.debug(`@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata`);let{fromInstanceMetadata:t}=await Promise.resolve().then(()=>p(gv()));return async()=>t(e)().then(o)},Environment:async e=>{r?.debug(`@aws-sdk/credential-provider-ini - credential_source is Environment`);let{fromEnv:t}=await Promise.resolve().then(()=>p(hv()));return async()=>t(e)().then(o)}};if(e in i)return i[e];throw new n.CredentialsProviderError(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:r})},o=e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_NAMED_PROVIDER`,`p`),s=(e,{profile:t=`default`,logger:n}={})=>!!e&&typeof e==`object`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1&&[`undefined`,`string`].indexOf(typeof e.external_id)>-1&&[`undefined`,`string`].indexOf(typeof e.mfa_serial)>-1&&(c(e,{profile:t,logger:n})||l(e,{profile:t,logger:n})),c=(e,{profile:t,logger:n})=>{let r=typeof e.source_profile==`string`&&e.credential_source===void 0;return r&&n?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),r},l=(e,{profile:t,logger:n})=>{let r=typeof e.credential_source==`string`&&e.source_profile===void 0;return r&&n?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),r},u=async(e,i,o,s,c={},l)=>{o.logger?.debug(`@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)`);let u=i[e],{source_profile:f,region:p}=u;if(!o.roleAssumer){let{getDefaultRoleAssumer:e}=await Promise.resolve().then(()=>(oP(),aP));o.roleAssumer=e({...o.clientConfig,credentialProviderLogger:o.logger,parentClientConfig:{...s,...o?.parentClientConfig,region:p??o?.parentClientConfig?.region??s?.region}},o.clientPlugins)}if(f&&f in c)throw new n.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${t.getProfileName(o)}. Profiles visited: `+Object.keys(c).join(`, `),{logger:o.logger});o.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${f?`source_profile=[${f}]`:`profile=[${e}]`}`);let m=f?l(f,i,o,s,{...c,[f]:!0},d(i[f]??{})):(await a(u.credential_source,e,o.logger)(o))();if(d(u))return m.then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SOURCE_PROFILE`,`o`));{let t={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||`3600`,10)},{mfa_serial:i}=u;if(i){if(!o.mfaCodeProvider)throw new n.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:o.logger,tryNextLink:!1});t.SerialNumber=i,t.TokenCode=await o.mfaCodeProvider(i)}let a=await m;return o.roleAssumer(a,t).then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SOURCE_PROFILE`,`o`))}},d=e=>!e.role_arn&&!!e.credential_source,f=e=>!!(e&&e.login_session),h=async(e,t,n)=>{let a=await i.fromLoginCredentials({...t,profile:e})({callerClientConfig:n});return r.setCredentialFeature(a,`CREDENTIALS_PROFILE_LOGIN`,`AC`)},g=e=>!!e&&typeof e==`object`&&typeof e.credential_process==`string`,_=async(e,t)=>Promise.resolve().then(()=>p(sP())).then(({fromProcess:n})=>n({...e,profile:t})().then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_PROCESS`,`v`))),v=async(e,t,n={},i)=>{let{fromSSO:a}=await Promise.resolve().then(()=>p(pD()));return a({profile:e,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:i}).then(e=>t.sso_session?r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SSO`,`r`):r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SSO_LEGACY`,`t`))},y=e=>e&&(typeof e.sso_start_url==`string`||typeof e.sso_account_id==`string`||typeof e.sso_session==`string`||typeof e.sso_region==`string`||typeof e.sso_role_name==`string`),b=e=>!!e&&typeof e==`object`&&typeof e.aws_access_key_id==`string`&&typeof e.aws_secret_access_key==`string`&&[`undefined`,`string`].indexOf(typeof e.aws_session_token)>-1&&[`undefined`,`string`].indexOf(typeof e.aws_account_id)>-1,x=async(e,t)=>{t?.logger?.debug(`@aws-sdk/credential-provider-ini - resolveStaticCredentials`);let n={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return r.setCredentialFeature(n,`CREDENTIALS_PROFILE`,`n`)},S=e=>!!e&&typeof e==`object`&&typeof e.web_identity_token_file==`string`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1,C=async(e,t,n)=>Promise.resolve().then(()=>p(uP())).then(({fromTokenFile:i})=>i({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity,logger:t.logger,parentClientConfig:t.parentClientConfig})({callerClientConfig:n}).then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN`,`q`))),w=async(e,t,r,i,a={},o=!1)=>{let c=t[e];if(Object.keys(a).length>0&&b(c))return x(c,r);if(o||s(c,{profile:e,logger:r.logger}))return u(e,t,r,i,a,w);if(b(c))return x(c,r);if(S(c))return C(c,r,i);if(g(c))return _(r,e);if(y(c))return await v(e,c,r,i);if(f(c))return h(e,r,i);throw new n.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})};e.fromIni=(e={})=>async({callerClientConfig:n}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-ini - fromIni`);let r=await t.parseKnownFiles(e);return w(t.getProfileName({profile:e.profile??n?.profile}),r,e,n)}})),fP=u((e=>{var t=hv(),n=d_(),r=g_();let i=`AWS_EC2_METADATA_DISABLED`,a=async e=>{let{ENV_CMDS_FULL_URI:t,ENV_CMDS_RELATIVE_URI:r,fromContainerMetadata:a,fromInstanceMetadata:o}=await Promise.resolve().then(()=>p(gv()));if(process.env[r]||process.env[t]){e.logger?.debug(`@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata`);let{fromHttp:t}=await Promise.resolve().then(()=>p(xv()));return n.chain(t(e),a(e))}return process.env[i]&&process.env[i]!==`false`?async()=>{throw new n.CredentialsProviderError(`EC2 Instance Metadata Service access disabled`,{logger:e.logger})}:(e.logger?.debug(`@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata`),o(e))};function o(e,t){let n=s(e),r,i,a,o=async e=>{if(e?.forceRefresh)return await n(e);if(a?.expiration&&a?.expiration?.getTime()<Date.now()&&(a=void 0),r)await r;else if(!a||t?.(a))if(a)i||=n(e).then(e=>{a=e}).finally(()=>{i=void 0});else return r=n(e).then(e=>{a=e}).finally(()=>{r=void 0}),o(e);return a};return o}let s=e=>async t=>{let n;for(let r of e)try{return await r(t)}catch(e){if(n=e,e?.tryNextLink)continue;throw e}throw n},c=!1,l=(e={})=>o([async()=>{if(e.profile??process.env[r.ENV_PROFILE])throw process.env[t.ENV_KEY]&&process.env[t.ENV_SECRET]&&(c||=((e.logger?.warn&&e.logger?.constructor?.name!==`NoOpLogger`?e.logger.warn.bind(e.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
70
|
+
`);function n(e){return t.parse(e,!0)}})),Kb=u((e=>{var t=Gb();let n=/[&<>"]/g,r={"&":`&`,"<":`<`,">":`>`,'"':`"`};function i(e){return e.replace(n,e=>r[e])}let a=/[&"'<>\r\n\u0085\u2028]/g,o={"&":`&`,'"':`"`,"'":`'`,"<":`<`,">":`>`,"\r":`
`,"\n":`
`,"
":`…`,"\u2028":`
`};function s(e){return e.replace(a,e=>o[e])}var c=class{value;constructor(e){this.value=e}toString(){return s(``+this.value)}},l=class e{name;children;attributes={};static of(t,n,r){let i=new e(t);return n!==void 0&&i.addChildNode(new c(n)),r!==void 0&&i.withName(r),i}constructor(e,t=[]){this.name=e,this.children=t}withName(e){return this.name=e,this}addAttribute(e,t){return this.attributes[e]=t,this}addChildNode(e){return this.children.push(e),this}removeAttribute(e){return delete this.attributes[e],this}n(e){return this.name=e,this}c(e){return this.children.push(e),this}a(e,t){return t!=null&&(this.attributes[e]=t),this}cc(t,n,r=n){if(t[n]!=null){let i=e.of(n,t[n]).withName(r);this.c(i)}}l(e,t,n,r){e[t]!=null&&r().map(e=>{e.withName(n),this.c(e)})}lc(t,n,r,i){if(t[n]!=null){let t=i(),n=new e(r);t.map(e=>{n.c(e)}),this.c(n)}}toString(){let e=!!this.children.length,t=`<${this.name}`,n=this.attributes;for(let e of Object.keys(n)){let r=n[e];r!=null&&(t+=` ${e}="${i(``+r)}"`)}return t+=e?`>${this.children.map(e=>e.toString()).join(``)}</${this.name}>`:`/>`}};e.parseXML=t.parseXML,e.XmlNode=l,e.XmlText=c})),qb,Jb,Yb,Xb,Zb=l((()=>{qb=Kb(),xg(),Xp(),Jb=w_(),Yb=mf(),lb(),db(),Xb=class extends cb{settings;stringDeserializer;constructor(e){super(),this.settings=e,this.stringDeserializer=new ug(e)}setSerdeContext(e){this.serdeContext=e,this.stringDeserializer.setSerdeContext(e)}read(e,t,n){let r=Lp.of(e),i=r.getMemberSchemas();if(r.isStructSchema()&&r.isMemberSchema()&&Object.values(i).find(e=>!!e.getMemberTraits().eventPayload)){let e={},n=Object.keys(i)[0];return i[n].isBlobSchema()?e[n]=t:e[n]=this.read(i[n],t),e}let a=(this.serdeContext?.utf8Encoder??Yb.toUtf8)(t),o=this.parseXml(a);return this.readSchema(e,n?o[n]:o)}readSchema(e,t){let n=Lp.of(e);if(n.isUnitSchema())return;let r=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(t))return this.readSchema(n,[t]);if(t==null)return t;if(typeof t==`object`){let e=!!r.xmlFlattened;if(n.isListSchema()){let r=n.getValueSchema(),i=[],a=r.getMergedTraits().xmlName??`member`,o=e?t:(t[0]??t)[a];if(o==null)return i;let s=Array.isArray(o)?o:[o];for(let e of s)i.push(this.readSchema(r,e));return i}let i={};if(n.isMapSchema()){let r=n.getKeySchema(),a=n.getValueSchema(),o;o=e?Array.isArray(t)?t:[t]:Array.isArray(t.entry)?t.entry:[t.entry];let s=r.getMergedTraits().xmlName??`key`,c=a.getMergedTraits().xmlName??`value`;for(let e of o){let t=e[s],n=e[c];i[t]=this.readSchema(a,n)}return i}if(n.isStructSchema()){let e=n.isUnionSchema(),r;e&&(r=new ub(t,i));for(let[a,o]of n.structIterator()){let n=o.getMergedTraits(),s=n.httpPayload?n.xmlName??o.getName():o.getMemberTraits().xmlName??a;e&&r.mark(s),t[s]!=null&&(i[a]=this.readSchema(o,t[s]))}return e&&r.writeUnknown(),i}if(n.isDocumentSchema())return t;throw Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}return n.isListSchema()?[]:n.isMapSchema()||n.isStructSchema()?{}:this.stringDeserializer.read(n,t)}parseXml(e){if(e.length){let t;try{t=(0,qb.parseXML)(e)}catch(t){throw t&&typeof t==`object`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}let n=`#text`,r=Object.keys(t)[0],i=t[r];return i[n]&&(i[r]=i[n],delete i[n]),(0,Jb.getValueFromTextNode)(i)}return{}}}})),Qb,$b,ex,tx=l((()=>{xg(),Xp(),Ih(),Qb=w_(),$b=gf(),lb(),ex=class extends cb{settings;buffer;constructor(e){super(),this.settings=e}write(e,t,n=``){this.buffer===void 0&&(this.buffer=``);let r=Lp.of(e);if(n&&!n.endsWith(`.`)&&(n+=`.`),r.isBlobSchema())(typeof t==`string`||t instanceof Uint8Array)&&(this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??$b.toBase64)(t)));else if(r.isBooleanSchema()||r.isNumericSchema()||r.isStringSchema())t==null?r.isIdempotencyToken()&&(this.writeKey(n),this.writeValue((0,oh.v4)())):(this.writeKey(n),this.writeValue(String(t)));else if(r.isBigIntegerSchema())t!=null&&(this.writeKey(n),this.writeValue(String(t)));else if(r.isBigDecimalSchema())t!=null&&(this.writeKey(n),this.writeValue(t instanceof Nh?t.string:String(t)));else if(r.isTimestampSchema()){if(t instanceof Date)switch(this.writeKey(n),og(r,this.settings)){case 5:this.writeValue(t.toISOString().replace(`.000Z`,`Z`));break;case 6:this.writeValue((0,Qb.dateToUtcString)(t));break;case 7:this.writeValue(String(t.getTime()/1e3));break}}else if(r.isDocumentSchema())Array.isArray(t)?this.write(79,t,n):t instanceof Date?this.write(4,t,n):t instanceof Uint8Array?this.write(21,t,n):t&&typeof t==`object`?this.write(143,t,n):(this.writeKey(n),this.writeValue(String(t)));else if(r.isListSchema()){if(Array.isArray(t))if(t.length===0)this.settings.serializeEmptyLists&&(this.writeKey(n),this.writeValue(``));else{let e=r.getValueSchema(),i=this.settings.flattenLists||r.getMergedTraits().xmlFlattened,a=1;for(let r of t){if(r==null)continue;let t=e.getMergedTraits(),o=this.getKey(`member`,t.xmlName,t.ec2QueryName),s=i?`${n}${a}`:`${n}${o}.${a}`;this.write(e,r,s),++a}}}else if(r.isMapSchema()){if(t&&typeof t==`object`){let e=r.getKeySchema(),i=r.getValueSchema(),a=r.getMergedTraits().xmlFlattened,o=1;for(let[r,s]of Object.entries(t)){if(s==null)continue;let t=e.getMergedTraits(),c=this.getKey(`key`,t.xmlName,t.ec2QueryName),l=a?`${n}${o}.${c}`:`${n}entry.${o}.${c}`,u=i.getMergedTraits(),d=this.getKey(`value`,u.xmlName,u.ec2QueryName),f=a?`${n}${o}.${d}`:`${n}entry.${o}.${d}`;this.write(e,r,l),this.write(i,s,f),++o}}}else if(r.isStructSchema()){if(t&&typeof t==`object`){let e=!1;for(let[i,a]of r.structIterator()){if(t[i]==null&&!a.isIdempotencyToken())continue;let r=a.getMergedTraits(),o=this.getKey(i,r.xmlName,r.ec2QueryName,`struct`),s=`${n}${o}`;this.write(a,t[i],s),e=!0}if(!e&&r.isUnionSchema()){let{$unknown:e}=t;if(Array.isArray(e)){let[t,r]=e,i=`${n}${t}`;this.write(15,r,i)}}}}else if(!r.isUnitSchema())throw Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${r.getName(!0)}`)}flush(){if(this.buffer===void 0)throw Error(`@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.`);let e=this.buffer;return delete this.buffer,e}getKey(e,t,n,r){let{ec2:i,capitalizeKeys:a}=this.settings;if(i&&n)return n;let o=t??e;return a&&r===`struct`?o[0].toUpperCase()+o.slice(1):o}writeKey(e){e.endsWith(`.`)&&(e=e.slice(0,e.length-1)),this.buffer+=`&${Hf(e)}=`}writeValue(e){this.buffer+=Hf(e)}}})),nx,rx=l((()=>{xg(),Xp(),tb(),Zb(),tx(),nx=class extends Qh{options;serializer;deserializer;mixin=new eb;constructor(e){super({defaultNamespace:e.defaultNamespace,errorTypeRegistries:e.errorTypeRegistries}),this.options=e;let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace,serializeEmptyLists:!0};this.serializer=new ex(t),this.deserializer=new Xb(t)}getShapeId(){return`aws.protocols#awsQuery`}setSerdeContext(e){this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e)}getPayloadCodec(){throw Error(`AWSQuery protocol has no payload codec.`)}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n);return r.path.endsWith(`/`)||(r.path+=`/`),Object.assign(r.headers,{"content-type":`application/x-www-form-urlencoded`}),(Wf(e.input)===`unit`||!r.body)&&(r.body=``),r.body=`Action=${e.name.split(`#`)[1]??e.name}&Version=${this.options.version}`+r.body,r.body.endsWith(`&`)&&(r.body=r.body.slice(-1)),r}async deserializeResponse(e,t,n){let r=this.deserializer,i=Lp.of(e.output),a={};if(n.statusCode>=300){let i=await Bf(n.body,t);i.byteLength>0&&Object.assign(a,await r.read(15,i)),await this.handleError(e,t,n,a,this.deserializeMetadata(n))}for(let e in n.headers){let t=n.headers[e];delete n.headers[e],n.headers[e.toLowerCase()]=t}let o=e.name.split(`#`)[1]??e.name,s=i.isStructSchema()&&this.useNestedResult()?o+`Result`:void 0,c=await Bf(n.body,t);return c.byteLength>0&&Object.assign(a,await r.read(i,c,s)),{$metadata:this.deserializeMetadata(n),...a}}useNestedResult(){return!0}async handleError(e,t,n,r,i){let a=this.loadQueryErrorCode(n,r)??`Unknown`;this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace);let o=this.loadQueryError(r)??{},s=this.loadQueryErrorMessage(r);o.message=s,o.Error={Type:o.Type,Code:o.Code,Message:s};let{errorSchema:c,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,o,i,this.mixin.findQueryCompatibleError),u=Lp.of(c),d=new((this.compositeErrorRegistry.getErrorCtor(c))??Error)(s),f={Type:o.Error.Type,Code:o.Error.Code,Error:o.Error};for(let[e,t]of u.structIterator()){let n=t.getMergedTraits().xmlName??e,i=o[n]??r[n];f[e]=this.deserializer.readSchema(t,i)}throw this.mixin.decorateServiceException(Object.assign(d,l,{$fault:u.getMergedTraits().error,message:s},f),r)}loadQueryErrorCode(e,t){let n=(t.Errors?.[0]?.Error??t.Errors?.Error??t.Error)?.Code;if(n!==void 0)return n;if(e.statusCode==404)return`NotFound`}loadQueryError(e){return e.Errors?.[0]?.Error??e.Errors?.Error??e.Error}loadQueryErrorMessage(e){let t=this.loadQueryError(e);return t?.message??t?.Message??e.message??e.Message??`Unknown`}getDefaultContentType(){return`application/x-www-form-urlencoded`}}})),ix,ax=l((()=>{rx(),ix=class extends nx{options;constructor(e){super(e),this.options=e,Object.assign(this.serializer.settings,{capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0})}getShapeId(){return`aws.protocols#ec2Query`}useNestedResult(){return!1}}})),ox=l((()=>{})),sx,cx,lx,ux,dx,fx=l((()=>{sx=Kb(),cx=w_(),_b(),lx=(e,t)=>gb(e,t).then(e=>{if(e.length){let t;try{t=(0,sx.parseXML)(e)}catch(t){throw t&&typeof t==`object`&&Object.defineProperty(t,`$responseBodyText`,{value:e}),t}let n=`#text`,r=Object.keys(t)[0],i=t[r];return i[n]&&(i[r]=i[n],delete i[n]),(0,cx.getValueFromTextNode)(i)}return{}}),ux=async(e,t)=>{let n=await lx(e,t);return n.Error&&(n.Error.message=n.Error.message??n.Error.Message),n},dx=(e,t)=>{if(t?.Error?.Code!==void 0)return t.Error.Code;if(t?.Code!==void 0)return t.Code;if(e.statusCode==404)return`NotFound`}})),px,mx,hx,gx,_x=l((()=>{px=Kb(),xg(),Xp(),Ih(),mx=w_(),hx=gf(),lb(),gx=class extends cb{settings;stringBuffer;byteBuffer;buffer;constructor(e){super(),this.settings=e}write(e,t){let n=Lp.of(e);if(n.isStringSchema()&&typeof t==`string`)this.stringBuffer=t;else if(n.isBlobSchema())this.byteBuffer=`byteLength`in t?t:(this.serdeContext?.base64Decoder??hx.fromBase64)(t);else{this.buffer=this.writeStruct(n,t,void 0);let e=n.getMergedTraits();e.httpPayload&&!e.xmlName&&this.buffer.withName(n.getName())}}flush(){if(this.byteBuffer!==void 0){let e=this.byteBuffer;return delete this.byteBuffer,e}if(this.stringBuffer!==void 0){let e=this.stringBuffer;return delete this.stringBuffer,e}let e=this.buffer;return this.settings.xmlNamespace&&(e?.attributes?.xmlns||e.addAttribute(`xmlns`,this.settings.xmlNamespace)),delete this.buffer,e.toString()}writeStruct(e,t,n){let r=e.getMergedTraits(),i=e.isMemberSchema()&&!r.httpPayload?e.getMemberTraits().xmlName??e.getMemberName():r.xmlName??e.getName();if(!i||!e.isStructSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${e.getName(!0)}.`);let a=px.XmlNode.of(i),[o,s]=this.getXmlnsAttribute(e,n);for(let[n,r]of e.structIterator()){let e=t[n];if(e!=null||r.isIdempotencyToken()){if(r.getMergedTraits().xmlAttribute){a.addAttribute(r.getMergedTraits().xmlName??n,this.writeSimple(r,e));continue}if(r.isListSchema())this.writeList(r,e,a,s);else if(r.isMapSchema())this.writeMap(r,e,a,s);else if(r.isStructSchema())a.addChildNode(this.writeStruct(r,e,s));else{let t=px.XmlNode.of(r.getMergedTraits().xmlName??r.getMemberName());this.writeSimpleInto(r,e,t,s),a.addChildNode(t)}}}let{$unknown:c}=t;if(c&&e.isUnionSchema()&&Array.isArray(c)&&Object.keys(t).length===1){let[e,n]=c,r=px.XmlNode.of(e);if(typeof n!=`string`)if(t instanceof px.XmlNode||t instanceof px.XmlText)a.addChildNode(t);else throw Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`);this.writeSimpleInto(0,n,r,s),a.addChildNode(r)}return s&&a.addAttribute(o,s),a}writeList(e,t,n,r){if(!e.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${e.getName(!0)}`);let i=e.getMergedTraits(),a=e.getValueSchema(),o=a.getMergedTraits(),s=!!o.sparse,c=!!i.xmlFlattened,[l,u]=this.getXmlnsAttribute(e,r),d=(t,n)=>{if(a.isListSchema())this.writeList(a,Array.isArray(n)?n:[n],t,u);else if(a.isMapSchema())this.writeMap(a,n,t,u);else if(a.isStructSchema()){let r=this.writeStruct(a,n,u);t.addChildNode(r.withName(c?i.xmlName??e.getMemberName():o.xmlName??`member`))}else{let r=px.XmlNode.of(c?i.xmlName??e.getMemberName():o.xmlName??`member`);this.writeSimpleInto(a,n,r,u),t.addChildNode(r)}};if(c)for(let e of t)(s||e!=null)&&d(n,e);else{let r=px.XmlNode.of(i.xmlName??e.getMemberName());u&&r.addAttribute(l,u);for(let e of t)(s||e!=null)&&d(r,e);n.addChildNode(r)}}writeMap(e,t,n,r,i=!1){if(!e.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${e.getName(!0)}`);let a=e.getMergedTraits(),o=e.getKeySchema(),s=o.getMergedTraits().xmlName??`key`,c=e.getValueSchema(),l=c.getMergedTraits(),u=l.xmlName??`value`,d=!!l.sparse,f=!!a.xmlFlattened,[p,m]=this.getXmlnsAttribute(e,r),h=(e,t,n)=>{let r=px.XmlNode.of(s,t),[i,a]=this.getXmlnsAttribute(o,m);a&&r.addAttribute(i,a),e.addChildNode(r);let l=px.XmlNode.of(u);c.isListSchema()?this.writeList(c,n,l,m):c.isMapSchema()?this.writeMap(c,n,l,m,!0):c.isStructSchema()?l=this.writeStruct(c,n,m):this.writeSimpleInto(c,n,l,m),e.addChildNode(l)};if(f){for(let[r,i]of Object.entries(t))if(d||i!=null){let t=px.XmlNode.of(a.xmlName??e.getMemberName());h(t,r,i),n.addChildNode(t)}}else{let r;i||(r=px.XmlNode.of(a.xmlName??e.getMemberName()),m&&r.addAttribute(p,m),n.addChildNode(r));for(let[e,a]of Object.entries(t))if(d||a!=null){let t=px.XmlNode.of(`entry`);h(t,e,a),(i?n:r).addChildNode(t)}}}writeSimple(e,t){if(t===null)throw Error(`@aws-sdk/core/protocols - (XML serializer) cannot write null value.`);let n=Lp.of(e),r=null;if(t&&typeof t==`object`)if(n.isBlobSchema())r=(this.serdeContext?.base64Encoder??hx.toBase64)(t);else if(n.isTimestampSchema()&&t instanceof Date)switch(og(n,this.settings)){case 5:r=t.toISOString().replace(`.000Z`,`Z`);break;case 6:r=(0,mx.dateToUtcString)(t);break;case 7:r=String(t.getTime()/1e3);break;default:console.warn(`Missing timestamp format, using http date`,t),r=(0,mx.dateToUtcString)(t);break}else if(n.isBigDecimalSchema()&&t)return t instanceof Nh?t.string:String(t);else if(n.isMapSchema()||n.isListSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.`);else throw Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${n.getName(!0)}`);if((n.isBooleanSchema()||n.isNumericSchema()||n.isBigIntegerSchema()||n.isBigDecimalSchema())&&(r=String(t)),n.isStringSchema()&&(r=t===void 0&&n.isIdempotencyToken()?(0,oh.v4)():String(t)),r===null)throw Error(`Unhandled schema-value pair ${n.getName(!0)}=${t}`);return r}writeSimpleInto(e,t,n,r){let i=this.writeSimple(e,t),a=Lp.of(e),o=new px.XmlText(i),[s,c]=this.getXmlnsAttribute(a,r);c&&n.addAttribute(s,c),n.addChildNode(o)}getXmlnsAttribute(e,t){let[n,r]=e.getMergedTraits().xmlNamespace??[];return r&&r!==t?[n?`xmlns:${n}`:`xmlns`,r]:[void 0,void 0]}}})),vx,yx=l((()=>{lb(),Zb(),_x(),vx=class extends cb{settings;constructor(e){super(),this.settings=e}createSerializer(){let e=new gx(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){let e=new Xb(this.settings);return e.setSerdeContext(this.serdeContext),e}}})),bx,xx=l((()=>{xg(),Xp(),tb(),fx(),yx(),bx=class extends Yh{codec;serializer;deserializer;mixin=new eb;constructor(e){super(e);let t={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:e.xmlNamespace,serviceNamespace:e.defaultNamespace};this.codec=new vx(t),this.serializer=new vg(this.codec.createSerializer(),t),this.deserializer=new pg(this.codec.createDeserializer(),t),this.compositeErrorRegistry}getPayloadCodec(){return this.codec}getShapeId(){return`aws.protocols#restXml`}async serializeRequest(e,t,n){let r=await super.serializeRequest(e,t,n),i=Lp.of(e.input);if(!r.headers[`content-type`]){let e=this.mixin.resolveRestContentType(this.getDefaultContentType(),i);e&&(r.headers[`content-type`]=e)}return typeof r.body==`string`&&r.headers[`content-type`]===this.getDefaultContentType()&&!r.body.startsWith(`<?xml `)&&!this.hasUnstructuredPayloadBinding(i)&&(r.body=`<?xml version="1.0" encoding="UTF-8"?>`+r.body),r}async deserializeResponse(e,t,n){return super.deserializeResponse(e,t,n)}async handleError(e,t,n,r,i){let a=dx(n,r)??`Unknown`;if(this.mixin.compose(this.compositeErrorRegistry,a,this.options.defaultNamespace),r.Error&&typeof r.Error==`object`)for(let e of Object.keys(r.Error))r[e]=r.Error[e],e.toLowerCase()===`message`&&(r.message=r.Error[e]);r.RequestId&&!i.requestId&&(i.requestId=r.RequestId);let{errorSchema:o,errorMetadata:s}=await this.mixin.getErrorSchemaOrThrowBaseException(a,this.options.defaultNamespace,n,r,i),c=Lp.of(o),l=r.Error?.message??r.Error?.Message??r.message??r.Message??`UnknownError`,u=new((this.compositeErrorRegistry.getErrorCtor(o))??Error)(l);await this.deserializeHttpMessage(o,t,n,r);let d={};for(let[e,t]of c.structIterator()){let n=t.getMergedTraits().xmlName??e,i=r.Error?.[n]??r[n];d[e]=this.codec.createDeserializer().readSchema(t,i)}throw this.mixin.decorateServiceException(Object.assign(u,s,{$fault:c.getMergedTraits().error,message:l},d),r)}getDefaultContentType(){return`application/xml`}hasUnstructuredPayloadBinding(e){for(let[,t]of e.structIterator())if(t.getMergedTraits().httpPayload)return!(t.isStructSchema()||t.isMapSchema()||t.isListSchema());return!1}}})),Sx=d({AwsEc2QueryProtocol:()=>ix,AwsJson1_0Protocol:()=>Fb,AwsJson1_1Protocol:()=>Lb,AwsJsonRpcProtocol:()=>Nb,AwsQueryProtocol:()=>nx,AwsRestJsonProtocol:()=>zb,AwsRestXmlProtocol:()=>bx,AwsSmithyRpcV2CborProtocol:()=>nb,JsonCodec:()=>jb,JsonShapeDeserializer:()=>Cb,JsonShapeSerializer:()=>kb,QueryShapeSerializer:()=>ex,XmlCodec:()=>vx,XmlShapeDeserializer:()=>Xb,XmlShapeSerializer:()=>gx,_toBool:()=>ab,_toNum:()=>ob,_toStr:()=>ib,awsExpectUnion:()=>Hb,loadRestJsonErrorCode:()=>bb,loadRestXmlErrorCode:()=>dx,parseJsonBody:()=>vb,parseJsonErrorBody:()=>yb,parseXmlBody:()=>lx,parseXmlErrorBody:()=>ux}),Cx=l((()=>{rb(),sb(),Ib(),Rb(),Pb(),Bb(),Mb(),wb(),Ab(),Ub(),xb(),ax(),rx(),ox(),tx(),xx(),yx(),Zb(),_x(),fx()})),wx,Tx,Ex,Dx,Ox,kx,Ax,jx,Mx,Nx,Px,Fx,Ix,Lx,Rx,zx,Bx,Vx,Hx,Ux,Wx,Gx,Kx,qx,Jx,Yx,Xx=l((()=>{wx=`required`,Tx=`fn`,Ex=`argv`,Dx=`ref`,Ox=!0,kx=`isSet`,Ax=`booleanEquals`,jx=`error`,Mx=`endpoint`,Nx=`tree`,Px=`PartitionResult`,Fx=`getAttr`,Ix={[wx]:!1,type:`string`},Lx={[wx]:!0,default:!1,type:`boolean`},Rx={[Dx]:`Endpoint`},zx={[Tx]:Ax,[Ex]:[{[Dx]:`UseFIPS`},!0]},Bx={[Tx]:Ax,[Ex]:[{[Dx]:`UseDualStack`},!0]},Vx={},Hx={[Tx]:Fx,[Ex]:[{[Dx]:Px},`supportsFIPS`]},Ux={[Dx]:Px},Wx={[Tx]:Ax,[Ex]:[!0,{[Tx]:Fx,[Ex]:[Ux,`supportsDualStack`]}]},Gx=[zx],Kx=[Bx],qx=[{[Dx]:`Region`}],Jx={version:`1.0`,parameters:{Region:Ix,UseDualStack:Lx,UseFIPS:Lx,Endpoint:Ix},rules:[{conditions:[{[Tx]:kx,[Ex]:[Rx]}],rules:[{conditions:Gx,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:jx},{conditions:Kx,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:jx},{endpoint:{url:Rx,properties:Vx,headers:Vx},type:Mx}],type:Nx},{conditions:[{[Tx]:kx,[Ex]:qx}],rules:[{conditions:[{[Tx]:`aws.partition`,[Ex]:qx,assign:Px}],rules:[{conditions:[zx,Bx],rules:[{conditions:[{[Tx]:Ax,[Ex]:[Ox,Hx]},Wx],rules:[{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:Vx,headers:Vx},type:Mx}],type:Nx},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:jx}],type:Nx},{conditions:Gx,rules:[{conditions:[{[Tx]:Ax,[Ex]:[Hx,Ox]}],rules:[{conditions:[{[Tx]:`stringEquals`,[Ex]:[{[Tx]:Fx,[Ex]:[Ux,`name`]},`aws-us-gov`]}],endpoint:{url:`https://oidc.{Region}.amazonaws.com`,properties:Vx,headers:Vx},type:Mx},{endpoint:{url:`https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:Vx,headers:Vx},type:Mx}],type:Nx},{error:`FIPS is enabled but this partition does not support FIPS`,type:jx}],type:Nx},{conditions:Kx,rules:[{conditions:[Wx],rules:[{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:Vx,headers:Vx},type:Mx}],type:Nx},{error:`DualStack is enabled but this partition does not support DualStack`,type:jx}],type:Nx},{endpoint:{url:`https://oidc.{Region}.{PartitionResult#dnsSuffix}`,properties:Vx,headers:Vx},type:Mx}],type:Nx}],type:Nx},{error:`Invalid Configuration: Missing Region`,type:jx}]},Yx=Jx})),Zx,Qx,$x,eS,tS=l((()=>{Zx=qg(),Qx=Kg(),Xx(),$x=new Qx.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),eS=(e,t={})=>$x.get(e,()=>(0,Qx.resolveEndpoint)(Yx,{endpointParams:e,logger:t.logger})),Qx.customEndpointFunctions.aws=Zx.awsEndpointFunctions})),nS,rS,iS=l((()=>{nS=w_(),rS=class e extends nS.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),aS,oS,sS,cS,lS,uS,dS,fS,pS,mS,hS,gS=l((()=>{iS(),aS=class e extends rS{name=`AccessDeniedException`;$fault=`client`;error;reason;error_description;constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},oS=class e extends rS{name=`AuthorizationPendingException`;$fault=`client`;error;error_description;constructor(t){super({name:`AuthorizationPendingException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},sS=class e extends rS{name=`ExpiredTokenException`;$fault=`client`;error;error_description;constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},cS=class e extends rS{name=`InternalServerException`;$fault=`server`;error;error_description;constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},lS=class e extends rS{name=`InvalidClientException`;$fault=`client`;error;error_description;constructor(t){super({name:`InvalidClientException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},uS=class e extends rS{name=`InvalidGrantException`;$fault=`client`;error;error_description;constructor(t){super({name:`InvalidGrantException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},dS=class e extends rS{name=`InvalidRequestException`;$fault=`client`;error;reason;error_description;constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}},fS=class e extends rS{name=`InvalidScopeException`;$fault=`client`;error;error_description;constructor(t){super({name:`InvalidScopeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},pS=class e extends rS{name=`SlowDownException`;$fault=`client`;error;error_description;constructor(t){super({name:`SlowDownException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},mS=class e extends rS{name=`UnauthorizedClientException`;$fault=`client`;error;error_description;constructor(t){super({name:`UnauthorizedClientException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}},hS=class e extends rS{name=`UnsupportedGrantTypeException`;$fault=`client`;error;error_description;constructor(t){super({name:`UnsupportedGrantTypeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error,this.error_description=t.error_description}}})),_S,vS,yS,bS,xS,SS,CS,wS,TS,ES,DS,OS,kS,AS,jS,MS,NS,PS,FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC=l((()=>{Xp(),gS(),iS(),_S=`AccessDeniedException`,vS=`AuthorizationPendingException`,yS=`AccessToken`,bS=`ClientSecret`,xS=`CreateToken`,SS=`CreateTokenRequest`,CS=`CreateTokenResponse`,wS=`CodeVerifier`,TS=`ExpiredTokenException`,ES=`InvalidClientException`,DS=`InvalidGrantException`,OS=`InvalidRequestException`,kS=`InternalServerException`,AS=`InvalidScopeException`,jS=`IdToken`,MS=`RefreshToken`,NS=`SlowDownException`,PS=`UnauthorizedClientException`,FS=`UnsupportedGrantTypeException`,IS=`accessToken`,LS=`client`,RS=`clientId`,zS=`clientSecret`,BS=`codeVerifier`,VS=`code`,HS=`deviceCode`,US=`error`,WS=`expiresIn`,GS=`error_description`,KS=`grantType`,qS=`http`,JS=`httpError`,YS=`idToken`,XS=`reason`,ZS=`refreshToken`,QS=`redirectUri`,$S=`smithy.ts.sdk.synthetic.com.amazonaws.ssooidc`,eC=`scope`,tC=`server`,nC=`tokenType`,rC=`com.amazonaws.ssooidc`,iC=qp.for($S),aC=[-3,$S,`SSOOIDCServiceException`,0,[],[]],iC.registerError(aC,rS),oC=qp.for(rC),sC=[-3,rC,_S,{[US]:LS,[JS]:400},[US,XS,GS],[0,0,0]],oC.registerError(sC,aS),cC=[-3,rC,vS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(cC,oS),lC=[-3,rC,TS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(lC,sS),uC=[-3,rC,kS,{[US]:tC,[JS]:500},[US,GS],[0,0]],oC.registerError(uC,cS),dC=[-3,rC,ES,{[US]:LS,[JS]:401},[US,GS],[0,0]],oC.registerError(dC,lS),fC=[-3,rC,DS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(fC,uS),pC=[-3,rC,OS,{[US]:LS,[JS]:400},[US,XS,GS],[0,0,0]],oC.registerError(pC,dS),mC=[-3,rC,AS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(mC,fS),hC=[-3,rC,NS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(hC,pS),gC=[-3,rC,PS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(gC,mS),_C=[-3,rC,FS,{[US]:LS,[JS]:400},[US,GS],[0,0]],oC.registerError(_C,hS),vC=[iC,oC],yC=[0,rC,yS,8,0],bC=[0,rC,bS,8,0],xC=[0,rC,wS,8,0],SC=[0,rC,jS,8,0],CC=[0,rC,MS,8,0],wC=[3,rC,SS,0,[RS,zS,KS,HS,VS,ZS,eC,QS,BS],[0,[()=>bC,0],0,0,0,[()=>CC,0],64,0,[()=>xC,0]],3],TC=[3,rC,CS,0,[IS,nC,WS,ZS,YS],[[()=>yC,0],0,1,[()=>CC,0],[()=>SC,0]]],EC=[9,rC,xS,{[qS]:[`POST`,`/token`,200]},()=>wC,()=>TC]})),OC,kC,AC,jC,MC,NC=l((()=>{pv(),Cx(),Gg(),OC=w_(),kC=ep(),AC=gf(),jC=mf(),kv(),tS(),DC(),MC=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??AC.fromBase64,base64Encoder:e?.base64Encoder??AC.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??eS,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Dv,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new B_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Pg}],logger:e?.logger??new OC.NoOpLogger,protocol:e?.protocol??zb,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.ssooidc`,errorTypeRegistries:vC,version:`2019-06-10`,serviceTarget:`AWSSSOOIDCService`},serviceId:e?.serviceId??`SSO OIDC`,urlParser:e?.urlParser??kC.parseUrl,utf8Decoder:e?.utf8Decoder??jC.fromUtf8,utf8Encoder:e?.utf8Encoder??jC.toUtf8})})),PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC=l((()=>{i_(),pv(),PC=Pv(),FC=l_(),IC=Fv(),LC=E_(),RC=v_(),zC=jf(),BC=w_(),VC=Iv(),HC=Lv(),UC=o_(),NC(),WC=e=>{(0,BC.emitWarningIfUnsupportedVersion)(process.version);let t=(0,HC.resolveDefaultsModeConfig)(e),n=()=>t().then(BC.loadConfigsForDefaultMode),r=MC(e);Yg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,RC.loadConfig)(Q_,i),bodyLengthChecker:e?.bodyLengthChecker??VC.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,PC.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Nv}),maxAttempts:e?.maxAttempts??(0,RC.loadConfig)(LC.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,RC.loadConfig)(FC.NODE_REGION_CONFIG_OPTIONS,{...FC.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:zC.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,RC.loadConfig)({...LC.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||UC.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??IC.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??zC.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,RC.loadConfig)(FC.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,RC.loadConfig)(FC.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,RC.loadConfig)(PC.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),KC=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.warning=void 0,e.stsRegionDefaultResolver=r;let t=l_(),n=v_();function r(r={}){return(0,n.loadConfig)({...t.NODE_REGION_CONFIG_OPTIONS,async default(){return e.warning.silence||console.warn(`@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.`),`us-east-1`}},{...t.NODE_REGION_CONFIG_FILE_OPTIONS,...r})}e.warning={silence:!1}})),qC=u((e=>{var t=KC(),n=l_();e.NODE_REGION_CONFIG_FILE_OPTIONS=n.NODE_REGION_CONFIG_FILE_OPTIONS,e.NODE_REGION_CONFIG_OPTIONS=n.NODE_REGION_CONFIG_OPTIONS,e.REGION_ENV_NAME=n.REGION_ENV_NAME,e.REGION_INI_NAME=n.REGION_INI_NAME,e.resolveRegionConfig=n.resolveRegionConfig,e.getAwsRegionExtensionConfiguration=e=>({setRegion(t){e.region=t},region(){return e.region}}),e.resolveAwsRegionExtensionConfiguration=e=>({region:e.region()}),Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])})})),JC,YC,XC=l((()=>{JC=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},YC=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),ZC,QC,$C,ew,tw=l((()=>{ZC=qC(),QC=vd(),$C=w_(),XC(),ew=(e,t)=>{let n=Object.assign((0,ZC.getAwsRegionExtensionConfiguration)(e),(0,$C.getDefaultExtensionConfiguration)(e),(0,QC.getHttpHandlerExtensionConfiguration)(e),JC(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,ZC.resolveAwsRegionExtensionConfiguration)(n),(0,$C.resolveDefaultRuntimeConfig)(n),(0,QC.resolveHttpHandlerRuntimeConfig)(n),YC(n))}})),nw,rw,iw,aw,ow,sw,cw,lw,uw,dw,fw=l((()=>{nw=yd(),rw=bd(),iw=Ad(),aw=s_(),ow=l_(),Gg(),Xp(),sw=d_(),cw=S_(),lw=E_(),uw=w_(),kv(),Mv(),GC(),tw(),dw=class extends uw.Client{config;constructor(...[e]){let t=WC(e||{});super(t),this.initConfig=t,this.config=ew(Ov((0,cw.resolveEndpointConfig)((0,nw.resolveHostHeaderConfig)((0,ow.resolveRegionConfig)((0,lw.resolveRetryConfig)((0,aw.resolveUserAgentConfig)(Av(t))))))),e?.extensions||[]),this.middlewareStack.use(lp(this.config)),this.middlewareStack.use((0,aw.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,lw.getRetryPlugin)(this.config)),this.middlewareStack.use((0,sw.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,nw.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,rw.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,iw.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Hd(this.config,{httpAuthSchemeParametersProvider:Ev,identityProviderConfigProvider:async e=>new Tg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(tf(this.config))}destroy(){super.destroy()}}})),pw,mw,hw,gw=l((()=>{pw=S_(),mw=w_(),Mv(),DC(),hw=class extends mw.Command.classBuilder().ep(jv).m(function(e,t,n,r){return[(0,pw.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`AWSSSOOIDCService`,`CreateToken`,{}).n(`SSOOIDCClient`,`CreateTokenCommand`).sc(EC).build(){}})),_w,vw,yw,bw=l((()=>{_w=w_(),gw(),fw(),vw={CreateTokenCommand:hw},yw=class extends dw{},(0,_w.createAggregatedClient)(vw,yw)})),xw=l((()=>{gw()})),Sw,Cw,ww=l((()=>{Sw={KMS_ACCESS_DENIED:`KMS_AccessDeniedException`},Cw={KMS_DISABLED_KEY:`KMS_DisabledException`,KMS_INVALID_KEY_USAGE:`KMS_InvalidKeyUsageException`,KMS_INVALID_STATE:`KMS_InvalidStateException`,KMS_KEY_NOT_FOUND:`KMS_NotFoundException`}})),Tw=l((()=>{})),Ew=d({$Command:()=>mw.Command,AccessDeniedException:()=>aS,AccessDeniedException$:()=>sC,AccessDeniedExceptionReason:()=>Sw,AuthorizationPendingException:()=>oS,AuthorizationPendingException$:()=>cC,CreateToken$:()=>EC,CreateTokenCommand:()=>hw,CreateTokenRequest$:()=>wC,CreateTokenResponse$:()=>TC,ExpiredTokenException:()=>sS,ExpiredTokenException$:()=>lC,InternalServerException:()=>cS,InternalServerException$:()=>uC,InvalidClientException:()=>lS,InvalidClientException$:()=>dC,InvalidGrantException:()=>uS,InvalidGrantException$:()=>fC,InvalidRequestException:()=>dS,InvalidRequestException$:()=>pC,InvalidRequestExceptionReason:()=>Cw,InvalidScopeException:()=>fS,InvalidScopeException$:()=>mC,SSOOIDC:()=>yw,SSOOIDCClient:()=>dw,SSOOIDCServiceException:()=>rS,SSOOIDCServiceException$:()=>aC,SlowDownException:()=>pS,SlowDownException$:()=>hC,UnauthorizedClientException:()=>mS,UnauthorizedClientException$:()=>gC,UnsupportedGrantTypeException:()=>hS,UnsupportedGrantTypeException$:()=>_C,__Client:()=>uw.Client,errorTypeRegistries:()=>vC}),Dw=l((()=>{fw(),bw(),xw(),DC(),ww(),gS(),Tw(),iS()})),Ow=u((e=>{var t=(i_(),m(r_)),n=(pv(),m(fv)),r=f_(),i=__(),a=h(`node:fs`);let o=({logger:e,signingName:i}={})=>async()=>{if(e?.debug?.(`@aws-sdk/token-providers - fromEnvSigningName`),!i)throw new r.TokenProviderError(`Please pass 'signingName' to compute environment variable key`,{logger:e});let a=n.getBearerTokenEnvKey(i);if(!(a in process.env))throw new r.TokenProviderError(`Token not present in '${a}' environment variable`,{logger:e});let o={token:process.env[a]};return t.setTokenFeature(o,`BEARER_SERVICE_ENV_VARS`,`3`),o},s=`To refresh this SSO session run 'aws sso login' with the corresponding profile.`,c=async(e,t={},n)=>{let{SSOOIDCClient:r}=await Promise.resolve().then(()=>(Dw(),Ew)),i=e=>t.clientConfig?.[e]??t.parentClientConfig?.[e]??n?.[e];return new r(Object.assign({},t.clientConfig??{},{region:e??t.clientConfig?.region,logger:i(`logger`),userAgentAppId:i(`userAgentAppId`)}))},l=async(e,t,n={},r)=>{let{CreateTokenCommand:i}=await Promise.resolve().then(()=>(Dw(),Ew));return(await c(t,n,r)).send(new i({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:`refresh_token`}))},u=e=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new r.TokenProviderError(`Token is expired. ${s}`,!1)},d=(e,t,n=!1)=>{if(t===void 0)throw new r.TokenProviderError(`Value not present for '${e}' in SSO Token${n?`. Cannot refresh`:``}. ${s}`,!1)},{writeFile:f}=a.promises,p=(e,t)=>f(i.getSSOTokenFilepath(e),JSON.stringify(t,null,2)),g=new Date(0),_=(e={})=>async({callerClientConfig:t}={})=>{e.logger?.debug(`@aws-sdk/token-providers - fromSso`);let n=await i.parseKnownFiles(e),a=i.getProfileName({profile:e.profile??t?.profile}),o=n[a];if(!o)throw new r.TokenProviderError(`Profile '${a}' could not be found in shared credentials file.`,!1);if(!o.sso_session)throw new r.TokenProviderError(`Profile '${a}' is missing required property 'sso_session'.`);let c=o.sso_session,f=(await i.loadSsoSessionData(e))[c];if(!f)throw new r.TokenProviderError(`Sso session '${c}' could not be found in shared credentials file.`,!1);for(let e of[`sso_start_url`,`sso_region`])if(!f[e])throw new r.TokenProviderError(`Sso session '${c}' is missing required property '${e}'.`,!1);f.sso_start_url;let m=f.sso_region,h;try{h=await i.getSSOTokenFromFile(c)}catch{throw new r.TokenProviderError(`The SSO session token associated with profile=${a} was not found or is invalid. ${s}`,!1)}d(`accessToken`,h.accessToken),d(`expiresAt`,h.expiresAt);let{accessToken:_,expiresAt:v}=h,y={token:_,expiration:new Date(v)};if(y.expiration.getTime()-Date.now()>3e5)return y;if(Date.now()-g.getTime()<30*1e3)return u(y),y;d(`clientId`,h.clientId,!0),d(`clientSecret`,h.clientSecret,!0),d(`refreshToken`,h.refreshToken,!0);try{g.setTime(Date.now());let n=await l(h,m,e,t);d(`accessToken`,n.accessToken),d(`expiresIn`,n.expiresIn);let r=new Date(Date.now()+n.expiresIn*1e3);try{await p(c,{...h,accessToken:n.accessToken,expiresAt:r.toISOString(),refreshToken:n.refreshToken})}catch{}return{token:n.accessToken,expiration:r}}catch{return u(y),y}};e.fromEnvSigningName=o,e.fromSso=_,e.fromStatic=({token:e,logger:t})=>async()=>{if(t?.debug(`@aws-sdk/token-providers - fromStatic`),!e||!e.token)throw new r.TokenProviderError(`Please pass a valid token to fromStatic`,!1);return e},e.nodeProvider=(e={})=>r.memoize(r.chain(_(e),async()=>{throw new r.TokenProviderError(`Could not load token from any providers`,!1)}),e=>e.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5,e=>e.expiration!==void 0)}));function kw(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`awsssoportal`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Aw(e){return{schemeId:`smithy.api#noAuth`}}var jw,Mw,Nw,Pw,Fw=l((()=>{pv(),jw=Pd(),Mw=async(e,t,n)=>({operation:(0,jw.getSmithyContext)(t).operation,region:await(0,jw.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Nw=e=>{let t=[];switch(e.operation){case`GetRoleCredentials`:t.push(Aw(e));break;default:t.push(kw(e))}return t},Pw=e=>{let t=cv(e);return Object.assign(t,{authSchemePreference:(0,jw.normalizeProvider)(e.authSchemePreference??[])})}})),Iw,Lw,Rw=l((()=>{Iw=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`awsssoportal`}),Lw={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),zw,Bw,Vw,Hw,Uw,Ww,Gw,Kw,qw,Jw,Yw,Xw,Zw,Qw,$w,eT,tT,nT,rT,iT,aT,oT,sT,cT,lT,uT,dT=l((()=>{zw=`required`,Bw=`fn`,Vw=`argv`,Hw=`ref`,Uw=!0,Ww=`isSet`,Gw=`booleanEquals`,Kw=`error`,qw=`endpoint`,Jw=`tree`,Yw=`PartitionResult`,Xw=`getAttr`,Zw={[zw]:!1,type:`string`},Qw={[zw]:!0,default:!1,type:`boolean`},$w={[Hw]:`Endpoint`},eT={[Bw]:Gw,[Vw]:[{[Hw]:`UseFIPS`},!0]},tT={[Bw]:Gw,[Vw]:[{[Hw]:`UseDualStack`},!0]},nT={},rT={[Bw]:Xw,[Vw]:[{[Hw]:Yw},`supportsFIPS`]},iT={[Hw]:Yw},aT={[Bw]:Gw,[Vw]:[!0,{[Bw]:Xw,[Vw]:[iT,`supportsDualStack`]}]},oT=[eT],sT=[tT],cT=[{[Hw]:`Region`}],lT={version:`1.0`,parameters:{Region:Zw,UseDualStack:Qw,UseFIPS:Qw,Endpoint:Zw},rules:[{conditions:[{[Bw]:Ww,[Vw]:[$w]}],rules:[{conditions:oT,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:Kw},{conditions:sT,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:Kw},{endpoint:{url:$w,properties:nT,headers:nT},type:qw}],type:Jw},{conditions:[{[Bw]:Ww,[Vw]:cT}],rules:[{conditions:[{[Bw]:`aws.partition`,[Vw]:cT,assign:Yw}],rules:[{conditions:[eT,tT],rules:[{conditions:[{[Bw]:Gw,[Vw]:[Uw,rT]},aT],rules:[{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:nT,headers:nT},type:qw}],type:Jw},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:Kw}],type:Jw},{conditions:oT,rules:[{conditions:[{[Bw]:Gw,[Vw]:[rT,Uw]}],rules:[{conditions:[{[Bw]:`stringEquals`,[Vw]:[{[Bw]:Xw,[Vw]:[iT,`name`]},`aws-us-gov`]}],endpoint:{url:`https://portal.sso.{Region}.amazonaws.com`,properties:nT,headers:nT},type:qw},{endpoint:{url:`https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:nT,headers:nT},type:qw}],type:Jw},{error:`FIPS is enabled but this partition does not support FIPS`,type:Kw}],type:Jw},{conditions:sT,rules:[{conditions:[aT],rules:[{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:nT,headers:nT},type:qw}],type:Jw},{error:`DualStack is enabled but this partition does not support DualStack`,type:Kw}],type:Jw},{endpoint:{url:`https://portal.sso.{Region}.{PartitionResult#dnsSuffix}`,properties:nT,headers:nT},type:qw}],type:Jw}],type:Jw},{error:`Invalid Configuration: Missing Region`,type:Kw}]},uT=lT})),fT,pT,mT,hT,gT=l((()=>{fT=qg(),pT=Kg(),dT(),mT=new pT.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),hT=(e,t={})=>mT.get(e,()=>(0,pT.resolveEndpoint)(uT,{endpointParams:e,logger:t.logger})),pT.customEndpointFunctions.aws=fT.awsEndpointFunctions})),_T,vT,yT=l((()=>{_T=w_(),vT=class e extends _T.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),bT,xT,ST,CT,wT=l((()=>{yT(),bT=class e extends vT{name=`InvalidRequestException`;$fault=`client`;constructor(t){super({name:`InvalidRequestException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},xT=class e extends vT{name=`ResourceNotFoundException`;$fault=`client`;constructor(t){super({name:`ResourceNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},ST=class e extends vT{name=`TooManyRequestsException`;$fault=`client`;constructor(t){super({name:`TooManyRequestsException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},CT=class e extends vT{name=`UnauthorizedException`;$fault=`client`;constructor(t){super({name:`UnauthorizedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}}})),TT,ET,DT,OT,kT,AT,jT,MT,NT,PT,FT,IT,LT,RT,zT,BT,VT,HT,UT,WT,GT,KT,qT,JT,YT,XT,ZT,QT,$T,eE,tE,nE,rE,iE,aE,oE,sE,cE,lE,uE,dE,fE,pE,mE,hE,gE,_E=l((()=>{Xp(),wT(),yT(),TT=`AccessTokenType`,ET=`GetRoleCredentials`,DT=`GetRoleCredentialsRequest`,OT=`GetRoleCredentialsResponse`,kT=`InvalidRequestException`,AT=`RoleCredentials`,jT=`ResourceNotFoundException`,MT=`SecretAccessKeyType`,NT=`SessionTokenType`,PT=`TooManyRequestsException`,FT=`UnauthorizedException`,IT=`accountId`,LT=`accessKeyId`,RT=`accessToken`,zT=`account_id`,BT=`client`,VT=`error`,HT=`expiration`,UT=`http`,WT=`httpError`,GT=`httpHeader`,KT=`httpQuery`,qT=`message`,JT=`roleCredentials`,YT=`roleName`,XT=`role_name`,ZT=`smithy.ts.sdk.synthetic.com.amazonaws.sso`,QT=`secretAccessKey`,$T=`sessionToken`,eE=`x-amz-sso_bearer_token`,tE=`com.amazonaws.sso`,nE=qp.for(ZT),rE=[-3,ZT,`SSOServiceException`,0,[],[]],nE.registerError(rE,vT),iE=qp.for(tE),aE=[-3,tE,kT,{[VT]:BT,[WT]:400},[qT],[0]],iE.registerError(aE,bT),oE=[-3,tE,jT,{[VT]:BT,[WT]:404},[qT],[0]],iE.registerError(oE,xT),sE=[-3,tE,PT,{[VT]:BT,[WT]:429},[qT],[0]],iE.registerError(sE,ST),cE=[-3,tE,FT,{[VT]:BT,[WT]:401},[qT],[0]],iE.registerError(cE,CT),lE=[nE,iE],uE=[0,tE,TT,8,0],dE=[0,tE,MT,8,0],fE=[0,tE,NT,8,0],pE=[3,tE,DT,0,[YT,IT,RT],[[0,{[KT]:XT}],[0,{[KT]:zT}],[()=>uE,{[GT]:eE}]],3],mE=[3,tE,OT,0,[JT],[[()=>hE,0]]],hE=[3,tE,AT,0,[LT,QT,$T,HT],[0,[()=>dE,0],[()=>fE,0],1]],gE=[9,tE,ET,{[UT]:[`GET`,`/federation/credentials`,200]},()=>pE,()=>mE]})),vE,yE,bE,xE,SE,CE=l((()=>{pv(),Cx(),Gg(),vE=w_(),yE=ep(),bE=gf(),xE=mf(),Fw(),gT(),_E(),SE=e=>({apiVersion:`2019-06-10`,base64Decoder:e?.base64Decoder??bE.fromBase64,base64Encoder:e?.base64Encoder??bE.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??hT,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Nw,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new B_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Pg}],logger:e?.logger??new vE.NoOpLogger,protocol:e?.protocol??zb,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.sso`,errorTypeRegistries:lE,version:`2019-06-10`,serviceTarget:`SWBPortalService`},serviceId:e?.serviceId??`SSO`,urlParser:e?.urlParser??yE.parseUrl,utf8Decoder:e?.utf8Decoder??xE.fromUtf8,utf8Encoder:e?.utf8Encoder??xE.toUtf8})})),wE,TE,EE,DE,OE,kE,AE,jE,ME,NE,PE,FE=l((()=>{i_(),pv(),wE=Pv(),TE=l_(),EE=Fv(),DE=E_(),OE=v_(),kE=jf(),AE=w_(),jE=Iv(),ME=Lv(),NE=o_(),CE(),PE=e=>{(0,AE.emitWarningIfUnsupportedVersion)(process.version);let t=(0,ME.resolveDefaultsModeConfig)(e),n=()=>t().then(AE.loadConfigsForDefaultMode),r=SE(e);Yg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,OE.loadConfig)(Q_,i),bodyLengthChecker:e?.bodyLengthChecker??jE.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,wE.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Nv}),maxAttempts:e?.maxAttempts??(0,OE.loadConfig)(DE.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,OE.loadConfig)(TE.NODE_REGION_CONFIG_OPTIONS,{...TE.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:kE.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,OE.loadConfig)({...DE.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||NE.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??EE.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??kE.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,OE.loadConfig)(TE.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,OE.loadConfig)(TE.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,OE.loadConfig)(wE.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),IE,LE,RE=l((()=>{IE=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},LE=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),zE,BE,VE,HE,UE=l((()=>{zE=qC(),BE=vd(),VE=w_(),RE(),HE=(e,t)=>{let n=Object.assign((0,zE.getAwsRegionExtensionConfiguration)(e),(0,VE.getDefaultExtensionConfiguration)(e),(0,BE.getHttpHandlerExtensionConfiguration)(e),IE(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,zE.resolveAwsRegionExtensionConfiguration)(n),(0,VE.resolveDefaultRuntimeConfig)(n),(0,BE.resolveHttpHandlerRuntimeConfig)(n),LE(n))}})),WE,GE,KE,qE,JE,YE,XE,ZE,QE,$E,eD=l((()=>{WE=yd(),GE=bd(),KE=Ad(),qE=s_(),JE=l_(),Gg(),Xp(),YE=d_(),XE=S_(),ZE=E_(),QE=w_(),Fw(),Rw(),FE(),UE(),$E=class extends QE.Client{config;constructor(...[e]){let t=PE(e||{});super(t),this.initConfig=t,this.config=HE(Pw((0,XE.resolveEndpointConfig)((0,WE.resolveHostHeaderConfig)((0,JE.resolveRegionConfig)((0,ZE.resolveRetryConfig)((0,qE.resolveUserAgentConfig)(Iw(t))))))),e?.extensions||[]),this.middlewareStack.use(lp(this.config)),this.middlewareStack.use((0,qE.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,ZE.getRetryPlugin)(this.config)),this.middlewareStack.use((0,YE.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,WE.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,GE.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,KE.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Hd(this.config,{httpAuthSchemeParametersProvider:Mw,identityProviderConfigProvider:async e=>new Tg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(tf(this.config))}destroy(){super.destroy()}}})),tD,nD,rD,iD=l((()=>{tD=S_(),nD=w_(),Rw(),_E(),rD=class extends nD.Command.classBuilder().ep(Lw).m(function(e,t,n,r){return[(0,tD.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`SWBPortalService`,`GetRoleCredentials`,{}).n(`SSOClient`,`GetRoleCredentialsCommand`).sc(gE).build(){}})),aD,oD,sD,cD=l((()=>{aD=w_(),iD(),eD(),oD={GetRoleCredentialsCommand:rD},sD=class extends $E{},(0,aD.createAggregatedClient)(oD,sD)})),lD=l((()=>{iD()})),uD=l((()=>{})),dD=d({$Command:()=>nD.Command,GetRoleCredentials$:()=>gE,GetRoleCredentialsCommand:()=>rD,GetRoleCredentialsRequest$:()=>pE,GetRoleCredentialsResponse$:()=>mE,InvalidRequestException:()=>bT,InvalidRequestException$:()=>aE,ResourceNotFoundException:()=>xT,ResourceNotFoundException$:()=>oE,RoleCredentials$:()=>hE,SSO:()=>sD,SSOClient:()=>$E,SSOServiceException:()=>vT,SSOServiceException$:()=>rE,TooManyRequestsException:()=>ST,TooManyRequestsException$:()=>sE,UnauthorizedException:()=>CT,UnauthorizedException$:()=>cE,__Client:()=>QE.Client,errorTypeRegistries:()=>lE}),fD=l((()=>{eD(),cD(),lD(),_E(),wT(),uD(),yT()})),pD=u((e=>{var t=(fD(),m(dD));e.GetRoleCredentialsCommand=t.GetRoleCredentialsCommand,e.SSOClient=t.SSOClient})),mD=u((e=>{var t=f_(),n=__(),r=(i_(),m(r_)),i=Ow();let a=e=>e&&(typeof e.sso_start_url==`string`||typeof e.sso_account_id==`string`||typeof e.sso_session==`string`||typeof e.sso_region==`string`||typeof e.sso_role_name==`string`),o=async({ssoStartUrl:e,ssoSession:a,ssoAccountId:o,ssoRegion:s,ssoRoleName:c,ssoClient:l,clientConfig:u,parentClientConfig:d,callerClientConfig:f,profile:p,filepath:m,configFilepath:h,ignoreCache:g,logger:_})=>{let v,y=`To refresh this SSO session run aws sso login with the corresponding profile.`;if(a)try{let e=await i.fromSso({profile:p,filepath:m,configFilepath:h,ignoreCache:g})();v={accessToken:e.token,expiresAt:new Date(e.expiration).toISOString()}}catch(e){throw new t.CredentialsProviderError(e.message,{tryNextLink:!1,logger:_})}else try{v=await n.getSSOTokenFromFile(e)}catch{throw new t.CredentialsProviderError(`The SSO session associated with this profile is invalid. ${y}`,{tryNextLink:!1,logger:_})}if(new Date(v.expiresAt).getTime()-Date.now()<=0)throw new t.CredentialsProviderError(`The SSO session associated with this profile has expired. ${y}`,{tryNextLink:!1,logger:_});let{accessToken:b}=v,{SSOClient:x,GetRoleCredentialsCommand:S}=await Promise.resolve().then(function(){return pD()}),C=l||new x(Object.assign({},u??{},{logger:u?.logger??f?.logger??d?.logger,region:u?.region??s,userAgentAppId:u?.userAgentAppId??f?.userAgentAppId??d?.userAgentAppId})),w;try{w=await C.send(new S({accountId:o,roleName:c,accessToken:b}))}catch(e){throw new t.CredentialsProviderError(e,{tryNextLink:!1,logger:_})}let{roleCredentials:{accessKeyId:ee,secretAccessKey:te,sessionToken:T,expiration:E,credentialScope:ne,accountId:re}={}}=w;if(!ee||!te||!T||!E)throw new t.CredentialsProviderError(`SSO returns an invalid temporary credential.`,{tryNextLink:!1,logger:_});let ie={accessKeyId:ee,secretAccessKey:te,sessionToken:T,expiration:new Date(E),...ne&&{credentialScope:ne},...re&&{accountId:re}};return a?r.setCredentialFeature(ie,`CREDENTIALS_SSO`,`s`):r.setCredentialFeature(ie,`CREDENTIALS_SSO_LEGACY`,`u`),ie},s=(e,n)=>{let{sso_start_url:r,sso_account_id:i,sso_region:a,sso_role_name:o}=e;if(!r||!i||!a||!o)throw new t.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(`, `)}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:n});return e};e.fromSSO=(e={})=>async({callerClientConfig:r}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-sso - fromSSO`);let{ssoStartUrl:i,ssoAccountId:c,ssoRegion:l,ssoRoleName:u,ssoSession:d}=e,{ssoClient:f}=e,p=n.getProfileName({profile:e.profile??r?.profile});if(!i&&!c&&!l&&!u&&!d){let r=(await n.parseKnownFiles(e))[p];if(!r)throw new t.CredentialsProviderError(`Profile ${p} was not found.`,{logger:e.logger});if(!a(r))throw new t.CredentialsProviderError(`Profile ${p} is not configured with SSO credentials.`,{logger:e.logger});if(r?.sso_session){let a=(await n.loadSsoSessionData(e))[r.sso_session],o=` configurations in profile ${p} and sso-session ${r.sso_session}`;if(l&&l!==a.sso_region)throw new t.CredentialsProviderError(`Conflicting SSO region`+o,{tryNextLink:!1,logger:e.logger});if(i&&i!==a.sso_start_url)throw new t.CredentialsProviderError(`Conflicting SSO start_url`+o,{tryNextLink:!1,logger:e.logger});r.sso_region=a.sso_region,r.sso_start_url=a.sso_start_url}let{sso_start_url:c,sso_account_id:u,sso_region:d,sso_role_name:m,sso_session:h}=s(r,e.logger);return o({ssoStartUrl:c,ssoSession:h,ssoAccountId:u,ssoRegion:d,ssoRoleName:m,ssoClient:f,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:p,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!i||!c||!l||!u)throw new t.CredentialsProviderError(`Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"`,{tryNextLink:!1,logger:e.logger});else return o({ssoStartUrl:i,ssoSession:d,ssoAccountId:c,ssoRegion:l,ssoRoleName:u,ssoClient:f,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:p,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})},e.isSsoProfile=a,e.validateSsoProfile=s}));function hD(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`signin`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function gD(e){return{schemeId:`smithy.api#noAuth`}}var _D,vD,yD,bD,xD=l((()=>{pv(),_D=Pd(),vD=async(e,t,n)=>({operation:(0,_D.getSmithyContext)(t).operation,region:await(0,_D.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),yD=e=>{let t=[];switch(e.operation){case`CreateOAuth2Token`:t.push(gD(e));break;default:t.push(hD(e))}return t},bD=e=>{let t=cv(e);return Object.assign(t,{authSchemePreference:(0,_D.normalizeProvider)(e.authSchemePreference??[])})}})),SD,CD,wD=l((()=>{SD=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`signin`}),CD={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}}})),TD,ED,DD,OD,kD,AD,jD,MD,ND,PD,FD,ID,LD,RD,zD,BD,VD,HD,UD,WD,GD,KD,qD,JD,YD,XD,ZD=l((()=>{TD=`required`,ED=`fn`,DD=`argv`,OD=`ref`,kD=!0,AD=`isSet`,jD=`booleanEquals`,MD=`error`,ND=`endpoint`,PD=`tree`,FD=`PartitionResult`,ID=`stringEquals`,LD={[TD]:!0,default:!1,type:`boolean`},RD={[TD]:!1,type:`string`},zD={[OD]:`Endpoint`},BD={[ED]:jD,[DD]:[{[OD]:`UseFIPS`},!0]},VD={[ED]:jD,[DD]:[{[OD]:`UseDualStack`},!0]},HD={},UD={[ED]:`getAttr`,[DD]:[{[OD]:FD},`name`]},WD={[ED]:jD,[DD]:[{[OD]:`UseFIPS`},!1]},GD={[ED]:jD,[DD]:[{[OD]:`UseDualStack`},!1]},KD={[ED]:`getAttr`,[DD]:[{[OD]:FD},`supportsFIPS`]},qD={[ED]:jD,[DD]:[!0,{[ED]:`getAttr`,[DD]:[{[OD]:FD},`supportsDualStack`]}]},JD=[{[OD]:`Region`}],YD={version:`1.0`,parameters:{UseDualStack:LD,UseFIPS:LD,Endpoint:RD,Region:RD},rules:[{conditions:[{[ED]:AD,[DD]:[zD]}],rules:[{conditions:[BD],error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:MD},{rules:[{conditions:[VD],error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:MD},{endpoint:{url:zD,properties:HD,headers:HD},type:ND}],type:PD}],type:PD},{rules:[{conditions:[{[ED]:AD,[DD]:JD}],rules:[{conditions:[{[ED]:`aws.partition`,[DD]:JD,assign:FD}],rules:[{conditions:[{[ED]:ID,[DD]:[UD,`aws`]},WD,GD],endpoint:{url:`https://{Region}.signin.aws.amazon.com`,properties:HD,headers:HD},type:ND},{conditions:[{[ED]:ID,[DD]:[UD,`aws-cn`]},WD,GD],endpoint:{url:`https://{Region}.signin.amazonaws.cn`,properties:HD,headers:HD},type:ND},{conditions:[{[ED]:ID,[DD]:[UD,`aws-us-gov`]},WD,GD],endpoint:{url:`https://{Region}.signin.amazonaws-us-gov.com`,properties:HD,headers:HD},type:ND},{conditions:[BD,VD],rules:[{conditions:[{[ED]:jD,[DD]:[kD,KD]},qD],rules:[{endpoint:{url:`https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:HD,headers:HD},type:ND}],type:PD},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:MD}],type:PD},{conditions:[BD,GD],rules:[{conditions:[{[ED]:jD,[DD]:[KD,kD]}],rules:[{endpoint:{url:`https://signin-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:HD,headers:HD},type:ND}],type:PD},{error:`FIPS is enabled but this partition does not support FIPS`,type:MD}],type:PD},{conditions:[WD,VD],rules:[{conditions:[qD],rules:[{endpoint:{url:`https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:HD,headers:HD},type:ND}],type:PD},{error:`DualStack is enabled but this partition does not support DualStack`,type:MD}],type:PD},{endpoint:{url:`https://signin.{Region}.{PartitionResult#dnsSuffix}`,properties:HD,headers:HD},type:ND}],type:PD}],type:PD},{error:`Invalid Configuration: Missing Region`,type:MD}],type:PD}]},XD=YD})),QD,$D,eO,tO,nO=l((()=>{QD=qg(),$D=Kg(),ZD(),eO=new $D.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]}),tO=(e,t={})=>eO.get(e,()=>(0,$D.resolveEndpoint)(XD,{endpointParams:e,logger:t.logger})),$D.customEndpointFunctions.aws=QD.awsEndpointFunctions})),rO,iO,aO=l((()=>{rO=w_(),iO=class e extends rO.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),oO,sO,cO,lO,uO=l((()=>{aO(),oO=class e extends iO{name=`AccessDeniedException`;$fault=`client`;error;constructor(t){super({name:`AccessDeniedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},sO=class e extends iO{name=`InternalServerException`;$fault=`server`;error;constructor(t){super({name:`InternalServerException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},cO=class e extends iO{name=`TooManyRequestsError`;$fault=`client`;error;constructor(t){super({name:`TooManyRequestsError`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}},lO=class e extends iO{name=`ValidationException`;$fault=`client`;error;constructor(t){super({name:`ValidationException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.error=t.error}}})),dO,fO,pO,mO,hO,gO,_O,vO,yO,bO,xO,SO,CO,wO,TO,EO,DO,OO,kO,AO,jO,MO,NO,PO,FO,IO,LO,RO,zO,BO,VO,HO,UO,WO,GO,KO,qO,JO,YO,XO,ZO,QO,$O,ek,tk,nk,rk,ik,ak,ok,sk=l((()=>{Xp(),uO(),aO(),dO=`AccessDeniedException`,fO=`AccessToken`,pO=`CreateOAuth2Token`,mO=`CreateOAuth2TokenRequest`,hO=`CreateOAuth2TokenRequestBody`,gO=`CreateOAuth2TokenResponseBody`,_O=`CreateOAuth2TokenResponse`,vO=`InternalServerException`,yO=`RefreshToken`,bO=`TooManyRequestsError`,xO=`ValidationException`,SO=`accessKeyId`,CO=`accessToken`,wO=`client`,TO=`clientId`,EO=`codeVerifier`,DO=`code`,OO=`error`,kO=`expiresIn`,AO=`grantType`,jO=`http`,MO=`httpError`,NO=`idToken`,PO=`jsonName`,FO=`message`,IO=`refreshToken`,LO=`redirectUri`,RO=`smithy.ts.sdk.synthetic.com.amazonaws.signin`,zO=`secretAccessKey`,BO=`sessionToken`,VO=`server`,HO=`tokenInput`,UO=`tokenOutput`,WO=`tokenType`,GO=`com.amazonaws.signin`,KO=qp.for(RO),qO=[-3,RO,`SigninServiceException`,0,[],[]],KO.registerError(qO,iO),JO=qp.for(GO),YO=[-3,GO,dO,{[OO]:wO},[OO,FO],[0,0],2],JO.registerError(YO,oO),XO=[-3,GO,vO,{[OO]:VO,[MO]:500},[OO,FO],[0,0],2],JO.registerError(XO,sO),ZO=[-3,GO,bO,{[OO]:wO,[MO]:429},[OO,FO],[0,0],2],JO.registerError(ZO,cO),QO=[-3,GO,xO,{[OO]:wO,[MO]:400},[OO,FO],[0,0],2],JO.registerError(QO,lO),$O=[KO,JO],ek=[0,GO,yO,8,0],tk=[3,GO,fO,8,[SO,zO,BO],[[0,{[PO]:SO}],[0,{[PO]:zO}],[0,{[PO]:BO}]],3],nk=[3,GO,mO,0,[HO],[[()=>rk,16]],1],rk=[3,GO,hO,0,[TO,AO,DO,LO,EO,IO],[[0,{[PO]:TO}],[0,{[PO]:AO}],0,[0,{[PO]:LO}],[0,{[PO]:EO}],[()=>ek,{[PO]:IO}]],2],ik=[3,GO,_O,0,[UO],[[()=>ak,16]],1],ak=[3,GO,gO,0,[CO,WO,kO,IO,NO],[[()=>tk,{[PO]:CO}],[0,{[PO]:WO}],[1,{[PO]:kO}],[()=>ek,{[PO]:IO}],[0,{[PO]:NO}]],4],ok=[9,GO,pO,{[jO]:[`POST`,`/v1/token`,200]},()=>nk,()=>ik]})),ck,lk,uk,dk,fk,pk=l((()=>{pv(),Cx(),Gg(),ck=w_(),lk=ep(),uk=gf(),dk=mf(),xD(),nO(),sk(),fk=e=>({apiVersion:`2023-01-01`,base64Decoder:e?.base64Decoder??uk.fromBase64,base64Encoder:e?.base64Encoder??uk.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??tO,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??yD,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new B_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Pg}],logger:e?.logger??new ck.NoOpLogger,protocol:e?.protocol??zb,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.signin`,errorTypeRegistries:$O,version:`2023-01-01`,serviceTarget:`Signin`},serviceId:e?.serviceId??`Signin`,urlParser:e?.urlParser??lk.parseUrl,utf8Decoder:e?.utf8Decoder??dk.fromUtf8,utf8Encoder:e?.utf8Encoder??dk.toUtf8})})),mk,hk,gk,_k,vk,yk,bk,xk,Sk,Ck,wk,Tk=l((()=>{i_(),pv(),mk=Pv(),hk=l_(),gk=Fv(),_k=E_(),vk=v_(),yk=jf(),bk=w_(),xk=Iv(),Sk=Lv(),Ck=o_(),pk(),wk=e=>{(0,bk.emitWarningIfUnsupportedVersion)(process.version);let t=(0,Sk.resolveDefaultsModeConfig)(e),n=()=>t().then(bk.loadConfigsForDefaultMode),r=fk(e);Yg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,vk.loadConfig)(Q_,i),bodyLengthChecker:e?.bodyLengthChecker??xk.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,mk.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Nv}),maxAttempts:e?.maxAttempts??(0,vk.loadConfig)(_k.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,vk.loadConfig)(hk.NODE_REGION_CONFIG_OPTIONS,{...hk.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:yk.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,vk.loadConfig)({..._k.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||Ck.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??gk.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??yk.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,vk.loadConfig)(hk.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,vk.loadConfig)(hk.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,vk.loadConfig)(mk.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),Ek,Dk,Ok=l((()=>{Ek=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},Dk=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),kk,Ak,jk,Mk,Nk=l((()=>{kk=qC(),Ak=vd(),jk=w_(),Ok(),Mk=(e,t)=>{let n=Object.assign((0,kk.getAwsRegionExtensionConfiguration)(e),(0,jk.getDefaultExtensionConfiguration)(e),(0,Ak.getHttpHandlerExtensionConfiguration)(e),Ek(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,kk.resolveAwsRegionExtensionConfiguration)(n),(0,jk.resolveDefaultRuntimeConfig)(n),(0,Ak.resolveHttpHandlerRuntimeConfig)(n),Dk(n))}})),Pk,Fk,Ik,Lk,Rk,zk,Bk,Vk,Hk,Uk,Wk=l((()=>{Pk=yd(),Fk=bd(),Ik=Ad(),Lk=s_(),Rk=l_(),Gg(),Xp(),zk=d_(),Bk=S_(),Vk=E_(),Hk=w_(),xD(),wD(),Tk(),Nk(),Uk=class extends Hk.Client{config;constructor(...[e]){let t=wk(e||{});super(t),this.initConfig=t,this.config=Mk(bD((0,Bk.resolveEndpointConfig)((0,Pk.resolveHostHeaderConfig)((0,Rk.resolveRegionConfig)((0,Vk.resolveRetryConfig)((0,Lk.resolveUserAgentConfig)(SD(t))))))),e?.extensions||[]),this.middlewareStack.use(lp(this.config)),this.middlewareStack.use((0,Lk.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,Vk.getRetryPlugin)(this.config)),this.middlewareStack.use((0,zk.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,Pk.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,Fk.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,Ik.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Hd(this.config,{httpAuthSchemeParametersProvider:vD,identityProviderConfigProvider:async e=>new Tg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(tf(this.config))}destroy(){super.destroy()}}})),Gk,Kk,qk,Jk=l((()=>{Gk=S_(),Kk=w_(),wD(),sk(),qk=class extends Kk.Command.classBuilder().ep(CD).m(function(e,t,n,r){return[(0,Gk.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`Signin`,`CreateOAuth2Token`,{}).n(`SigninClient`,`CreateOAuth2TokenCommand`).sc(ok).build(){}})),Yk,Xk,Zk,Qk=l((()=>{Yk=w_(),Jk(),Wk(),Xk={CreateOAuth2TokenCommand:qk},Zk=class extends Uk{},(0,Yk.createAggregatedClient)(Xk,Zk)})),$k=l((()=>{Jk()})),eA,tA=l((()=>{eA={AUTHCODE_EXPIRED:`AUTHCODE_EXPIRED`,INSUFFICIENT_PERMISSIONS:`INSUFFICIENT_PERMISSIONS`,INVALID_REQUEST:`INVALID_REQUEST`,SERVER_ERROR:`server_error`,TOKEN_EXPIRED:`TOKEN_EXPIRED`,USER_CREDENTIALS_CHANGED:`USER_CREDENTIALS_CHANGED`}})),nA=l((()=>{})),rA=d({$Command:()=>Kk.Command,AccessDeniedException:()=>oO,AccessDeniedException$:()=>YO,AccessToken$:()=>tk,CreateOAuth2Token$:()=>ok,CreateOAuth2TokenCommand:()=>qk,CreateOAuth2TokenRequest$:()=>nk,CreateOAuth2TokenRequestBody$:()=>rk,CreateOAuth2TokenResponse$:()=>ik,CreateOAuth2TokenResponseBody$:()=>ak,InternalServerException:()=>sO,InternalServerException$:()=>XO,OAuth2ErrorCode:()=>eA,Signin:()=>Zk,SigninClient:()=>Uk,SigninServiceException:()=>iO,SigninServiceException$:()=>qO,TooManyRequestsError:()=>cO,TooManyRequestsError$:()=>ZO,ValidationException:()=>lO,ValidationException$:()=>QO,__Client:()=>Hk.Client,errorTypeRegistries:()=>$O}),iA=l((()=>{Wk(),Qk(),$k(),sk(),tA(),uO(),nA(),aO()})),aA=u((e=>{var t=(i_(),m(r_)),n=f_(),r=__(),i=vd(),a=h(`node:crypto`),o=h(`node:fs`),s=h(`node:os`),c=h(`node:path`),l=class e{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300*1e3;constructor(e,t,n){this.profileData=e,this.init=t,this.callerClientConfig=n}async loadCredentials(){let t=await this.loadToken();if(!t)throw new n.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let r=t.accessToken,i=Date.now();return new Date(r.expiresAt).getTime()-i<=e.REFRESH_THRESHOLD?this.refresh(t):{accessKeyId:r.accessKeyId,secretAccessKey:r.secretAccessKey,sessionToken:r.sessionToken,accountId:r.accountId,expiration:new Date(r.expiresAt)}}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}async refresh(e){let{SigninClient:t,CreateOAuth2TokenCommand:r}=await Promise.resolve().then(()=>(iA(),rA)),{logger:i,userAgentAppId:a}=this.callerClientConfig??{},o=(e=>e?.metadata?.handlerProtocol===`h2`)(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,s=new t({credentials:{accessKeyId:``,secretAccessKey:``},region:this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,requestHandler:o,logger:i,userAgentAppId:a,...this.init?.clientConfig});this.createDPoPInterceptor(s.middlewareStack);let c={tokenInput:{clientId:e.clientId,refreshToken:e.refreshToken,grantType:`refresh_token`}};try{let t=await s.send(new r(c)),{accessKeyId:i,secretAccessKey:a,sessionToken:o}=t.tokenOutput?.accessToken??{},{refreshToken:l,expiresIn:u}=t.tokenOutput??{};if(!i||!a||!o||!l)throw new n.CredentialsProviderError(`Token refresh response missing required fields`,{logger:this.logger,tryNextLink:!1});let d=(u??900)*1e3,f=new Date(Date.now()+d),p={...e,accessToken:{...e.accessToken,accessKeyId:i,secretAccessKey:a,sessionToken:o,expiresAt:f.toISOString()},refreshToken:l};await this.saveToken(p);let m=p.accessToken;return{accessKeyId:m.accessKeyId,secretAccessKey:m.secretAccessKey,sessionToken:m.sessionToken,accountId:m.accountId,expiration:f}}catch(e){if(e.name===`AccessDeniedException`){let t=e.error,r;switch(t){case`TOKEN_EXPIRED`:r=`Your session has expired. Please reauthenticate.`;break;case`USER_CREDENTIALS_CHANGED`:r=`Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.`;break;case`INSUFFICIENT_PERMISSIONS`:r=`Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.`;break;default:r=`Failed to refresh token: ${String(e)}. Please re-authenticate using \`aws login\``}throw new n.CredentialsProviderError(r,{logger:this.logger,tryNextLink:!1})}throw new n.CredentialsProviderError(`Failed to refresh token: ${String(e)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let t;try{t=await r.readFile(e,{ignoreCache:this.init?.ignoreCache})}catch{t=await o.promises.readFile(e,`utf8`)}let i=JSON.parse(t),a=[`accessToken`,`clientId`,`refreshToken`,`dpopKey`].filter(e=>!i[e]);if(i.accessToken?.accountId||a.push(`accountId`),a.length>0)throw new n.CredentialsProviderError(`Token validation failed, missing fields: ${a.join(`, `)}`,{logger:this.logger,tryNextLink:!1});return i}catch(t){throw new n.CredentialsProviderError(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let t=this.getTokenFilePath(),n=c.dirname(t);try{await o.promises.mkdir(n,{recursive:!0})}catch{}await o.promises.writeFile(t,JSON.stringify(e,null,2),`utf8`)}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??c.join(s.homedir(),`.aws`,`login`,`cache`),t=Buffer.from(this.loginSession,`utf8`),n=a.createHash(`sha256`).update(t).digest(`hex`);return c.join(e,`${n}.json`)}derToRawSignature(e){let t=2;if(e[t]!==2)throw Error(`Invalid DER signature`);t++;let n=e[t++],r=e.subarray(t,t+n);if(t+=n,e[t]!==2)throw Error(`Invalid DER signature`);t++;let i=e[t++],a=e.subarray(t,t+i);r=r[0]===0?r.subarray(1):r,a=a[0]===0?a.subarray(1):a;let o=Buffer.concat([Buffer.alloc(32-r.length),r]),s=Buffer.concat([Buffer.alloc(32-a.length),a]);return Buffer.concat([o,s])}createDPoPInterceptor(e){e.add(e=>async t=>{if(i.HttpRequest.isInstance(t.request)){let e=t.request,n=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:``}${e.path}`,r=await this.generateDpop(e.method,n);e.headers={...e.headers,DPoP:r}}return e(t)},{step:`finalizeRequest`,name:`dpopInterceptor`,override:!0})}async generateDpop(e=`POST`,t){let r=await this.loadToken();try{let n=a.createPrivateKey({key:r.dpopKey,format:`pem`,type:`sec1`}),i=a.createPublicKey(n).export({format:`der`,type:`spki`}),o=-1;for(let e=0;e<i.length;e++)if(i[e]===4){o=e;break}let s=i.slice(o+1,o+33),c=i.slice(o+33,o+65),l={alg:`ES256`,typ:`dpop+jwt`,jwk:{kty:`EC`,crv:`P-256`,x:s.toString(`base64url`),y:c.toString(`base64url`)}},u={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1e3)},d=`${Buffer.from(JSON.stringify(l)).toString(`base64url`)}.${Buffer.from(JSON.stringify(u)).toString(`base64url`)}`,f=a.sign(`sha256`,Buffer.from(d),n);return`${d}.${this.derToRawSignature(f).toString(`base64url`)}`}catch(e){throw new n.CredentialsProviderError(`Failed to generate Dpop proof: ${e instanceof Error?e.message:String(e)}`,{logger:this.logger,tryNextLink:!1})}}};e.fromLoginCredentials=e=>async({callerClientConfig:i}={})=>{e?.logger?.debug?.(`@aws-sdk/credential-providers - fromLoginCredentials`);let a=await r.parseKnownFiles(e||{}),o=r.getProfileName({profile:e?.profile??i?.profile}),s=a[o];if(!s?.login_session)throw new n.CredentialsProviderError(`Profile ${o} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let c=await new l(s,e,i).loadCredentials();return t.setCredentialFeature(c,`CREDENTIALS_LOGIN`,`AD`)}}));function oA(e){return{schemeId:`aws.auth#sigv4`,signingProperties:{name:`sts`,region:e.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function sA(e){return{schemeId:`smithy.api#noAuth`}}var cA,lA,uA,dA,fA,pA=l((()=>{pv(),cA=Pd(),NN(),lA=async(e,t,n)=>({operation:(0,cA.getSmithyContext)(t).operation,region:await(0,cA.normalizeProvider)(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),uA=e=>{let t=[];switch(e.operation){case`AssumeRoleWithWebIdentity`:t.push(sA(e));break;default:t.push(oA(e))}return t},dA=e=>Object.assign(e,{stsClientCtor:MN}),fA=e=>{let t=cv(dA(e));return Object.assign(t,{authSchemePreference:(0,cA.normalizeProvider)(e.authSchemePreference??[])})}})),mA,hA,gA=l((()=>{mA=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:`sts`}),hA={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`}}})),_A,vA,yA,bA,xA,SA,CA,wA,TA,EA,DA,OA,kA,AA,jA,MA,NA,PA,FA,IA,LA,RA,zA,BA,VA,HA,UA,WA,GA,KA,qA,JA,YA,XA,ZA,QA,$A,ej,tj=l((()=>{_A=`required`,vA=`type`,yA=`fn`,bA=`argv`,xA=`ref`,SA=!1,CA=!0,wA=`booleanEquals`,TA=`stringEquals`,EA=`sigv4`,DA=`sts`,OA=`us-east-1`,kA=`endpoint`,AA=`https://sts.{Region}.{PartitionResult#dnsSuffix}`,jA=`tree`,MA=`error`,NA=`getAttr`,PA={[_A]:!1,[vA]:`string`},FA={[_A]:!0,default:!1,[vA]:`boolean`},IA={[xA]:`Endpoint`},LA={[yA]:`isSet`,[bA]:[{[xA]:`Region`}]},RA={[xA]:`Region`},zA={[yA]:`aws.partition`,[bA]:[RA],assign:`PartitionResult`},BA={[xA]:`UseFIPS`},VA={[xA]:`UseDualStack`},HA={url:`https://sts.amazonaws.com`,properties:{authSchemes:[{name:EA,signingName:DA,signingRegion:OA}]},headers:{}},UA={},WA={conditions:[{[yA]:TA,[bA]:[RA,`aws-global`]}],[kA]:HA,[vA]:kA},GA={[yA]:wA,[bA]:[BA,!0]},KA={[yA]:wA,[bA]:[VA,!0]},qA={[yA]:NA,[bA]:[{[xA]:`PartitionResult`},`supportsFIPS`]},JA={[xA]:`PartitionResult`},YA={[yA]:wA,[bA]:[!0,{[yA]:NA,[bA]:[JA,`supportsDualStack`]}]},XA=[{[yA]:`isSet`,[bA]:[IA]}],ZA=[GA],QA=[KA],$A={version:`1.0`,parameters:{Region:PA,UseDualStack:FA,UseFIPS:FA,Endpoint:PA,UseGlobalEndpoint:FA},rules:[{conditions:[{[yA]:wA,[bA]:[{[xA]:`UseGlobalEndpoint`},CA]},{[yA]:`not`,[bA]:XA},LA,zA,{[yA]:wA,[bA]:[BA,SA]},{[yA]:wA,[bA]:[VA,SA]}],rules:[{conditions:[{[yA]:TA,[bA]:[RA,`ap-northeast-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`ap-south-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`ap-southeast-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`ap-southeast-2`]}],endpoint:HA,[vA]:kA},WA,{conditions:[{[yA]:TA,[bA]:[RA,`ca-central-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`eu-central-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`eu-north-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`eu-west-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`eu-west-2`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`eu-west-3`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`sa-east-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,OA]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`us-east-2`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`us-west-1`]}],endpoint:HA,[vA]:kA},{conditions:[{[yA]:TA,[bA]:[RA,`us-west-2`]}],endpoint:HA,[vA]:kA},{endpoint:{url:AA,properties:{authSchemes:[{name:EA,signingName:DA,signingRegion:`{Region}`}]},headers:UA},[vA]:kA}],[vA]:jA},{conditions:XA,rules:[{conditions:ZA,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,[vA]:MA},{conditions:QA,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,[vA]:MA},{endpoint:{url:IA,properties:UA,headers:UA},[vA]:kA}],[vA]:jA},{conditions:[LA],rules:[{conditions:[zA],rules:[{conditions:[GA,KA],rules:[{conditions:[{[yA]:wA,[bA]:[CA,qA]},YA],rules:[{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:UA,headers:UA},[vA]:kA}],[vA]:jA},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,[vA]:MA}],[vA]:jA},{conditions:ZA,rules:[{conditions:[{[yA]:wA,[bA]:[qA,CA]}],rules:[{conditions:[{[yA]:TA,[bA]:[{[yA]:NA,[bA]:[JA,`name`]},`aws-us-gov`]}],endpoint:{url:`https://sts.{Region}.amazonaws.com`,properties:UA,headers:UA},[vA]:kA},{endpoint:{url:`https://sts-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:UA,headers:UA},[vA]:kA}],[vA]:jA},{error:`FIPS is enabled but this partition does not support FIPS`,[vA]:MA}],[vA]:jA},{conditions:QA,rules:[{conditions:[YA],rules:[{endpoint:{url:`https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:UA,headers:UA},[vA]:kA}],[vA]:jA},{error:`DualStack is enabled but this partition does not support DualStack`,[vA]:MA}],[vA]:jA},WA,{endpoint:{url:AA,properties:UA,headers:UA},[vA]:kA}],[vA]:jA}],[vA]:jA},{error:`Invalid Configuration: Missing Region`,[vA]:MA}]},ej=$A})),nj,rj,ij,aj,oj=l((()=>{nj=qg(),rj=Kg(),tj(),ij=new rj.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`,`UseGlobalEndpoint`]}),aj=(e,t={})=>ij.get(e,()=>(0,rj.resolveEndpoint)(ej,{endpointParams:e,logger:t.logger})),rj.customEndpointFunctions.aws=nj.awsEndpointFunctions})),sj,cj,lj=l((()=>{sj=w_(),cj=class e extends sj.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),uj,dj,fj,pj,mj,hj,gj,_j=l((()=>{lj(),uj=class e extends cj{name=`ExpiredTokenException`;$fault=`client`;constructor(t){super({name:`ExpiredTokenException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},dj=class e extends cj{name=`MalformedPolicyDocumentException`;$fault=`client`;constructor(t){super({name:`MalformedPolicyDocumentException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},fj=class e extends cj{name=`PackedPolicyTooLargeException`;$fault=`client`;constructor(t){super({name:`PackedPolicyTooLargeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},pj=class e extends cj{name=`RegionDisabledException`;$fault=`client`;constructor(t){super({name:`RegionDisabledException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},mj=class e extends cj{name=`IDPRejectedClaimException`;$fault=`client`;constructor(t){super({name:`IDPRejectedClaimException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},hj=class e extends cj{name=`InvalidIdentityTokenException`;$fault=`client`;constructor(t){super({name:`InvalidIdentityTokenException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}},gj=class e extends cj{name=`IDPCommunicationErrorException`;$fault=`client`;constructor(t){super({name:`IDPCommunicationErrorException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype)}}})),vj,yj,bj,xj,Sj,Cj,wj,Tj,Ej,Dj,Oj,kj,Aj,jj,Mj,Nj,Pj,Fj,Ij,Lj,Rj,zj,Bj,Vj,Hj,Uj,Wj,Gj,Kj,qj,Jj,Yj,Xj,Zj,Qj,$j,eM,tM,nM,rM,iM,aM,oM,sM,cM,lM,uM,dM,fM,pM,mM,hM,gM,_M,vM,yM,bM,xM,SM,CM,wM,TM,EM,DM,OM,kM,AM,jM,MM,NM,PM,FM,IM,LM,RM,zM,BM,VM,HM,UM,WM,GM,KM,qM,JM,YM,XM=l((()=>{Xp(),_j(),lj(),vj=`Arn`,yj=`AccessKeyId`,bj=`AssumeRole`,xj=`AssumedRoleId`,Sj=`AssumeRoleRequest`,Cj=`AssumeRoleResponse`,wj=`AssumedRoleUser`,Tj=`AssumeRoleWithWebIdentity`,Ej=`AssumeRoleWithWebIdentityRequest`,Dj=`AssumeRoleWithWebIdentityResponse`,Oj=`Audience`,kj=`Credentials`,Aj=`ContextAssertion`,jj=`DurationSeconds`,Mj=`Expiration`,Nj=`ExternalId`,Pj=`ExpiredTokenException`,Fj=`IDPCommunicationErrorException`,Ij=`IDPRejectedClaimException`,Lj=`InvalidIdentityTokenException`,Rj=`Key`,zj=`MalformedPolicyDocumentException`,Bj=`Policy`,Vj=`PolicyArns`,Hj=`ProviderArn`,Uj=`ProvidedContexts`,Wj=`ProvidedContextsListType`,Gj=`ProvidedContext`,Kj=`PolicyDescriptorType`,qj=`ProviderId`,Jj=`PackedPolicySize`,Yj=`PackedPolicyTooLargeException`,Xj=`Provider`,Zj=`RoleArn`,Qj=`RegionDisabledException`,$j=`RoleSessionName`,eM=`SecretAccessKey`,tM=`SubjectFromWebIdentityToken`,nM=`SourceIdentity`,rM=`SerialNumber`,iM=`SessionToken`,aM=`Tags`,oM=`TokenCode`,sM=`TransitiveTagKeys`,cM=`Tag`,lM=`Value`,uM=`WebIdentityToken`,dM=`arn`,fM=`accessKeySecretType`,pM=`awsQueryError`,mM=`client`,hM=`clientTokenType`,gM=`error`,_M=`httpError`,vM=`message`,yM=`policyDescriptorListType`,bM=`smithy.ts.sdk.synthetic.com.amazonaws.sts`,xM=`tagListType`,SM=`com.amazonaws.sts`,CM=qp.for(bM),wM=[-3,bM,`STSServiceException`,0,[],[]],CM.registerError(wM,cj),TM=qp.for(SM),EM=[-3,SM,Pj,{[pM]:[`ExpiredTokenException`,400],[gM]:mM,[_M]:400},[vM],[0]],TM.registerError(EM,uj),DM=[-3,SM,Fj,{[pM]:[`IDPCommunicationError`,400],[gM]:mM,[_M]:400},[vM],[0]],TM.registerError(DM,gj),OM=[-3,SM,Ij,{[pM]:[`IDPRejectedClaim`,403],[gM]:mM,[_M]:403},[vM],[0]],TM.registerError(OM,mj),kM=[-3,SM,Lj,{[pM]:[`InvalidIdentityToken`,400],[gM]:mM,[_M]:400},[vM],[0]],TM.registerError(kM,hj),AM=[-3,SM,zj,{[pM]:[`MalformedPolicyDocument`,400],[gM]:mM,[_M]:400},[vM],[0]],TM.registerError(AM,dj),jM=[-3,SM,Yj,{[pM]:[`PackedPolicyTooLarge`,400],[gM]:mM,[_M]:400},[vM],[0]],TM.registerError(jM,fj),MM=[-3,SM,Qj,{[pM]:[`RegionDisabledException`,403],[gM]:mM,[_M]:403},[vM],[0]],TM.registerError(MM,pj),NM=[CM,TM],PM=[0,SM,fM,8,0],FM=[0,SM,hM,8,0],IM=[3,SM,wj,0,[xj,vj],[0,0],2],LM=[3,SM,Sj,0,[Zj,$j,Vj,Bj,jj,aM,sM,Nj,rM,oM,nM,Uj],[0,0,()=>GM,0,1,()=>qM,64,0,0,0,0,()=>KM],2],RM=[3,SM,Cj,0,[kj,wj,Jj,nM],[[()=>VM,0],()=>IM,1,0]],zM=[3,SM,Ej,0,[Zj,$j,uM,qj,Vj,Bj,jj],[0,0,[()=>FM,0],0,()=>GM,0,1],3],BM=[3,SM,Dj,0,[kj,tM,wj,Jj,Xj,Oj,nM],[[()=>VM,0],0,()=>IM,1,0,0,0]],VM=[3,SM,kj,0,[yj,eM,iM,Mj],[0,[()=>PM,0],0,4],4],HM=[3,SM,Kj,0,[dM],[0]],UM=[3,SM,Gj,0,[Hj,Aj],[0,0]],WM=[3,SM,cM,0,[Rj,lM],[0,0],2],GM=[1,SM,yM,0,()=>HM],KM=[1,SM,Wj,0,()=>UM],qM=[1,SM,xM,0,()=>WM],JM=[9,SM,bj,0,()=>LM,()=>RM],YM=[9,SM,Tj,0,()=>zM,()=>BM]})),ZM,QM,$M,eN,tN,nN=l((()=>{pv(),Cx(),Gg(),ZM=w_(),QM=ep(),$M=gf(),eN=mf(),pA(),oj(),XM(),tN=e=>({apiVersion:`2011-06-15`,base64Decoder:e?.base64Decoder??$M.fromBase64,base64Encoder:e?.base64Encoder??$M.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??aj,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??uA,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new B_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Pg}],logger:e?.logger??new ZM.NoOpLogger,protocol:e?.protocol??nx,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.sts`,errorTypeRegistries:NM,xmlNamespace:`https://sts.amazonaws.com/doc/2011-06-15/`,version:`2011-06-15`,serviceTarget:`AWSSecurityTokenServiceV20110615`},serviceId:e?.serviceId??`STS`,urlParser:e?.urlParser??QM.parseUrl,utf8Decoder:e?.utf8Decoder??eN.fromUtf8,utf8Encoder:e?.utf8Encoder??eN.toUtf8})})),rN,iN,aN,oN,sN,cN,lN,uN,dN,fN,pN,mN=l((()=>{i_(),pv(),rN=Pv(),iN=l_(),Gg(),aN=Fv(),oN=E_(),sN=v_(),cN=jf(),lN=w_(),uN=Iv(),dN=Lv(),fN=o_(),nN(),pN=e=>{(0,lN.emitWarningIfUnsupportedVersion)(process.version);let t=(0,dN.resolveDefaultsModeConfig)(e),n=()=>t().then(lN.loadConfigsForDefaultMode),r=tN(e);Yg(process.version);let i={profile:e?.profile,logger:r.logger};return{...r,...e,runtime:`node`,defaultsMode:t,authSchemePreference:e?.authSchemePreference??(0,sN.loadConfig)(Q_,i),bodyLengthChecker:e?.bodyLengthChecker??uN.calculateBodyLength,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,rN.createDefaultUserAgentProvider)({serviceId:r.serviceId,clientVersion:Nv}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:t=>t.getIdentityProvider(`aws.auth#sigv4`)||(async t=>await e.credentialDefaultProvider(t?.__config||{})()),signer:new B_},{schemeId:`smithy.api#noAuth`,identityProvider:e=>e.getIdentityProvider(`smithy.api#noAuth`)||(async()=>({})),signer:new Pg}],maxAttempts:e?.maxAttempts??(0,sN.loadConfig)(oN.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,sN.loadConfig)(iN.NODE_REGION_CONFIG_OPTIONS,{...iN.NODE_REGION_CONFIG_FILE_OPTIONS,...i}),requestHandler:cN.NodeHttpHandler.create(e?.requestHandler??n),retryMode:e?.retryMode??(0,sN.loadConfig)({...oN.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await n()).retryMode||fN.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??aN.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??cN.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,sN.loadConfig)(iN.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,i),useFipsEndpoint:e?.useFipsEndpoint??(0,sN.loadConfig)(iN.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,i),userAgentAppId:e?.userAgentAppId??(0,sN.loadConfig)(rN.NODE_APP_ID_CONFIG_OPTIONS,i)}}})),hN,gN,_N=l((()=>{hN=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},gN=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()})})),vN,yN,bN,xN,SN=l((()=>{vN=qC(),yN=vd(),bN=w_(),_N(),xN=(e,t)=>{let n=Object.assign((0,vN.getAwsRegionExtensionConfiguration)(e),(0,bN.getDefaultExtensionConfiguration)(e),(0,yN.getHttpHandlerExtensionConfiguration)(e),hN(e));return t.forEach(e=>e.configure(n)),Object.assign(e,(0,vN.resolveAwsRegionExtensionConfiguration)(n),(0,bN.resolveDefaultRuntimeConfig)(n),(0,yN.resolveHttpHandlerRuntimeConfig)(n),gN(n))}})),CN,wN,TN,EN,DN,ON,kN,AN,jN,MN,NN=l((()=>{CN=yd(),wN=bd(),TN=Ad(),EN=s_(),DN=l_(),Gg(),Xp(),ON=d_(),kN=S_(),AN=E_(),jN=w_(),pA(),gA(),mN(),SN(),MN=class extends jN.Client{config;constructor(...[e]){let t=pN(e||{});super(t),this.initConfig=t,this.config=xN(fA((0,kN.resolveEndpointConfig)((0,CN.resolveHostHeaderConfig)((0,DN.resolveRegionConfig)((0,AN.resolveRetryConfig)((0,EN.resolveUserAgentConfig)(mA(t))))))),e?.extensions||[]),this.middlewareStack.use(lp(this.config)),this.middlewareStack.use((0,EN.getUserAgentPlugin)(this.config)),this.middlewareStack.use((0,AN.getRetryPlugin)(this.config)),this.middlewareStack.use((0,ON.getContentLengthPlugin)(this.config)),this.middlewareStack.use((0,CN.getHostHeaderPlugin)(this.config)),this.middlewareStack.use((0,wN.getLoggerPlugin)(this.config)),this.middlewareStack.use((0,TN.getRecursionDetectionPlugin)(this.config)),this.middlewareStack.use(Hd(this.config,{httpAuthSchemeParametersProvider:lA,identityProviderConfigProvider:async e=>new Tg({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(tf(this.config))}destroy(){super.destroy()}}})),PN,FN,IN,LN=l((()=>{PN=S_(),FN=w_(),gA(),XM(),IN=class extends FN.Command.classBuilder().ep(hA).m(function(e,t,n,r){return[(0,PN.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`AWSSecurityTokenServiceV20110615`,`AssumeRole`,{}).n(`STSClient`,`AssumeRoleCommand`).sc(JM).build(){}})),RN,zN,BN,VN=l((()=>{RN=S_(),zN=w_(),gA(),XM(),BN=class extends zN.Command.classBuilder().ep(hA).m(function(e,t,n,r){return[(0,RN.getEndpointPlugin)(n,e.getEndpointParameterInstructions())]}).s(`AWSSecurityTokenServiceV20110615`,`AssumeRoleWithWebIdentity`,{}).n(`STSClient`,`AssumeRoleWithWebIdentityCommand`).sc(YM).build(){}})),HN,UN,WN,GN=l((()=>{HN=w_(),LN(),VN(),NN(),UN={AssumeRoleCommand:IN,AssumeRoleWithWebIdentityCommand:BN},WN=class extends MN{},(0,HN.createAggregatedClient)(UN,WN)})),KN=l((()=>{LN(),VN()})),qN=l((()=>{})),JN,YN,XN,ZN,QN,$N,eP=l((()=>{i_(),JN=qC(),LN(),VN(),YN=e=>{if(typeof e?.Arn==`string`){let t=e.Arn.split(`:`);if(t.length>4&&t[4]!==``)return t[4]}},XN=async(e,t,n,r={})=>{let i=typeof e==`function`?await e():e,a=typeof t==`function`?await t():t,o=``,s=i??a??(o=await(0,JN.stsRegionDefaultResolver)(r)());return n?.debug?.(`@aws-sdk/client-sts::resolveRegion`,`accepting first of:`,`${i} (credential provider clientConfig)`,`${a} (contextual client)`,`${o} (STS default: AWS_REGION, profile region, or us-east-1)`),s},ZN=(e,t)=>{let n,r;return async(i,a)=>{if(r=i,!n){let{logger:i=e?.parentClientConfig?.logger,profile:a=e?.parentClientConfig?.profile,region:o,requestHandler:s=e?.parentClientConfig?.requestHandler,credentialProviderLogger:c,userAgentAppId:l=e?.parentClientConfig?.userAgentAppId}=e,u=await XN(o,e?.parentClientConfig?.region,c,{logger:i,profile:a}),d=!$N(s);n=new t({...e,userAgentAppId:l,profile:a,credentialDefaultProvider:()=>async()=>r,region:u,requestHandler:d?s:void 0,logger:i})}let{Credentials:o,AssumedRoleUser:s}=await n.send(new IN(a));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${a.RoleArn}`);let c=YN(s),l={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...c&&{accountId:c}};return Zg(l,`CREDENTIALS_STS_ASSUME_ROLE`,`i`),l}},QN=(e,t)=>{let n;return async r=>{if(!n){let{logger:r=e?.parentClientConfig?.logger,profile:i=e?.parentClientConfig?.profile,region:a,requestHandler:o=e?.parentClientConfig?.requestHandler,credentialProviderLogger:s,userAgentAppId:c=e?.parentClientConfig?.userAgentAppId}=e,l=await XN(a,e?.parentClientConfig?.region,s,{logger:r,profile:i}),u=!$N(o);n=new t({...e,userAgentAppId:c,profile:i,region:l,requestHandler:u?o:void 0,logger:r})}let{Credentials:i,AssumedRoleUser:a}=await n.send(new BN(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${r.RoleArn}`);let o=YN(a),s={accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,...i.CredentialScope&&{credentialScope:i.CredentialScope},...o&&{accountId:o}};return o&&Zg(s,`RESOLVED_ACCOUNT_ID`,`T`),Zg(s,`CREDENTIALS_STS_ASSUME_ROLE_WEB_ID`,`k`),s}},$N=e=>e?.metadata?.handlerProtocol===`h2`})),tP,nP,rP,iP,aP=l((()=>{eP(),NN(),tP=(e,t)=>t?class extends e{constructor(e){super(e);for(let e of t)this.middlewareStack.use(e)}}:e,nP=(e={},t)=>ZN(e,tP(MN,t)),rP=(e={},t)=>QN(e,tP(MN,t)),iP=e=>t=>e({roleAssumer:nP(t),roleAssumerWithWebIdentity:rP(t),...t})})),oP=d({AssumeRole$:()=>JM,AssumeRoleCommand:()=>IN,AssumeRoleRequest$:()=>LM,AssumeRoleResponse$:()=>RM,AssumeRoleWithWebIdentity$:()=>YM,AssumeRoleWithWebIdentityCommand:()=>BN,AssumeRoleWithWebIdentityRequest$:()=>zM,AssumeRoleWithWebIdentityResponse$:()=>BM,AssumedRoleUser$:()=>IM,Credentials$:()=>VM,ExpiredTokenException:()=>uj,ExpiredTokenException$:()=>EM,IDPCommunicationErrorException:()=>gj,IDPCommunicationErrorException$:()=>DM,IDPRejectedClaimException:()=>mj,IDPRejectedClaimException$:()=>OM,InvalidIdentityTokenException:()=>hj,InvalidIdentityTokenException$:()=>kM,MalformedPolicyDocumentException:()=>dj,MalformedPolicyDocumentException$:()=>AM,PackedPolicyTooLargeException:()=>fj,PackedPolicyTooLargeException$:()=>jM,PolicyDescriptorType$:()=>HM,ProvidedContext$:()=>UM,RegionDisabledException:()=>pj,RegionDisabledException$:()=>MM,STS:()=>WN,STSClient:()=>MN,STSServiceException:()=>cj,STSServiceException$:()=>wM,Tag$:()=>WM,__Client:()=>jN.Client,decorateDefaultCredentialProvider:()=>iP,errorTypeRegistries:()=>NM,getDefaultRoleAssumer:()=>nP,getDefaultRoleAssumerWithWebIdentity:()=>rP}),sP=l((()=>{NN(),GN(),KN(),XM(),_j(),qN(),aP(),lj()})),cP=u((e=>{var t=__(),n=f_(),r=h(`node:child_process`),i=h(`node:util`),a=(i_(),m(r_));let o=(e,t,n)=>{if(t.Version!==1)throw Error(`Profile ${e} credential_process did not return Version 1.`);if(t.AccessKeyId===void 0||t.SecretAccessKey===void 0)throw Error(`Profile ${e} credential_process returned invalid credentials.`);if(t.Expiration){let n=new Date;if(new Date(t.Expiration)<n)throw Error(`Profile ${e} credential_process returned expired credentials.`)}let r=t.AccountId;!r&&n?.[e]?.aws_account_id&&(r=n[e].aws_account_id);let i={accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,...t.SessionToken&&{sessionToken:t.SessionToken},...t.Expiration&&{expiration:new Date(t.Expiration)},...t.CredentialScope&&{credentialScope:t.CredentialScope},...r&&{accountId:r}};return a.setCredentialFeature(i,`CREDENTIALS_PROCESS`,`w`),i},s=async(e,a,s)=>{let c=a[e];if(a[e]){let l=c.credential_process;if(l!==void 0){let c=i.promisify(t.externalDataInterceptor?.getTokenRecord?.().exec??r.exec);try{let{stdout:t}=await c(l),n;try{n=JSON.parse(t.trim())}catch{throw Error(`Profile ${e} credential_process returned invalid JSON.`)}return o(e,n,a)}catch(e){throw new n.CredentialsProviderError(e.message,{logger:s})}}else throw new n.CredentialsProviderError(`Profile ${e} did not contain credential_process.`,{logger:s})}else throw new n.CredentialsProviderError(`Profile ${e} could not be found in shared credentials file.`,{logger:s})};e.fromProcess=(e={})=>async({callerClientConfig:n}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-process - fromProcess`);let r=await t.parseKnownFiles(e);return s(t.getProfileName({profile:e.profile??n?.profile}),r,e.logger)}})),lP=u((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,`default`,{enumerable:!0,value:t})}):function(e,t){e.default=t}),r=e&&e.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},e(t)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=e(r),o=0;o<a.length;o++)a[o]!==`default`&&t(i,r,a[o]);return n(i,r),i}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.fromWebToken=void 0,e.fromWebToken=e=>async t=>{e.logger?.debug(`@aws-sdk/credential-provider-web-identity - fromWebToken`);let{roleArn:n,roleSessionName:i,webIdentityToken:a,providerId:o,policyArns:s,policy:c,durationSeconds:l}=e,{roleAssumerWithWebIdentity:u}=e;if(!u){let{getDefaultRoleAssumerWithWebIdentity:n}=await Promise.resolve().then(()=>r((sP(),m(oP))));u=n({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...t?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return u({RoleArn:n,RoleSessionName:i??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:a,ProviderId:o,PolicyArns:s,Policy:c,DurationSeconds:l})}})),uP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fromTokenFile=void 0;let t=(i_(),m(r_)),n=f_(),r=__(),i=h(`node:fs`),a=lP(),o=`AWS_WEB_IDENTITY_TOKEN_FILE`;e.fromTokenFile=(e={})=>async s=>{e.logger?.debug(`@aws-sdk/credential-provider-web-identity - fromTokenFile`);let c=e?.webIdentityTokenFile??process.env[o],l=e?.roleArn??process.env.AWS_ROLE_ARN,u=e?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!c||!l)throw new n.CredentialsProviderError(`Web identity configuration not specified`,{logger:e.logger});let d=await(0,a.fromWebToken)({...e,webIdentityToken:r.externalDataInterceptor?.getTokenRecord?.()[c]??(0,i.readFileSync)(c,{encoding:`ascii`}),roleArn:l,roleSessionName:u})(s);return c===process.env[o]&&(0,t.setCredentialFeature)(d,`CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN`,`h`),d}})),dP=u((e=>{var t=uP(),n=lP();Object.prototype.hasOwnProperty.call(t,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:t.__proto__}),Object.keys(t).forEach(function(n){n!==`default`&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=t[n])}),Object.prototype.hasOwnProperty.call(n,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:n.__proto__}),Object.keys(n).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=n[t])})})),fP=u((e=>{var t=__(),n=f_(),r=(i_(),m(r_)),i=aA();let a=(e,t,r)=>{let i={EcsContainer:async e=>{let{fromHttp:t}=await Promise.resolve().then(()=>p(Sv())),{fromContainerMetadata:i}=await Promise.resolve().then(()=>p(_v()));return r?.debug(`@aws-sdk/credential-provider-ini - credential_source is EcsContainer`),async()=>n.chain(t(e??{}),i(e))().then(o)},Ec2InstanceMetadata:async e=>{r?.debug(`@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata`);let{fromInstanceMetadata:t}=await Promise.resolve().then(()=>p(_v()));return async()=>t(e)().then(o)},Environment:async e=>{r?.debug(`@aws-sdk/credential-provider-ini - credential_source is Environment`);let{fromEnv:t}=await Promise.resolve().then(()=>p(gv()));return async()=>t(e)().then(o)}};if(e in i)return i[e];throw new n.CredentialsProviderError(`Unsupported credential source in profile ${t}. Got ${e}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:r})},o=e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_NAMED_PROVIDER`,`p`),s=(e,{profile:t=`default`,logger:n}={})=>!!e&&typeof e==`object`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1&&[`undefined`,`string`].indexOf(typeof e.external_id)>-1&&[`undefined`,`string`].indexOf(typeof e.mfa_serial)>-1&&(c(e,{profile:t,logger:n})||l(e,{profile:t,logger:n})),c=(e,{profile:t,logger:n})=>{let r=typeof e.source_profile==`string`&&e.credential_source===void 0;return r&&n?.debug?.(` ${t} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`),r},l=(e,{profile:t,logger:n})=>{let r=typeof e.credential_source==`string`&&e.source_profile===void 0;return r&&n?.debug?.(` ${t} isCredentialSourceProfile credential_source=${e.credential_source}`),r},u=async(e,i,o,s,c={},l)=>{o.logger?.debug(`@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)`);let u=i[e],{source_profile:f,region:p}=u;if(!o.roleAssumer){let{getDefaultRoleAssumer:e}=await Promise.resolve().then(()=>(sP(),oP));o.roleAssumer=e({...o.clientConfig,credentialProviderLogger:o.logger,parentClientConfig:{...s,...o?.parentClientConfig,region:p??o?.parentClientConfig?.region??s?.region}},o.clientPlugins)}if(f&&f in c)throw new n.CredentialsProviderError(`Detected a cycle attempting to resolve credentials for profile ${t.getProfileName(o)}. Profiles visited: `+Object.keys(c).join(`, `),{logger:o.logger});o.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${f?`source_profile=[${f}]`:`profile=[${e}]`}`);let m=f?l(f,i,o,s,{...c,[f]:!0},d(i[f]??{})):(await a(u.credential_source,e,o.logger)(o))();if(d(u))return m.then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SOURCE_PROFILE`,`o`));{let t={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||`3600`,10)},{mfa_serial:i}=u;if(i){if(!o.mfaCodeProvider)throw new n.CredentialsProviderError(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:o.logger,tryNextLink:!1});t.SerialNumber=i,t.TokenCode=await o.mfaCodeProvider(i)}let a=await m;return o.roleAssumer(a,t).then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SOURCE_PROFILE`,`o`))}},d=e=>!e.role_arn&&!!e.credential_source,f=e=>!!(e&&e.login_session),h=async(e,t,n)=>{let a=await i.fromLoginCredentials({...t,profile:e})({callerClientConfig:n});return r.setCredentialFeature(a,`CREDENTIALS_PROFILE_LOGIN`,`AC`)},g=e=>!!e&&typeof e==`object`&&typeof e.credential_process==`string`,_=async(e,t)=>Promise.resolve().then(()=>p(cP())).then(({fromProcess:n})=>n({...e,profile:t})().then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_PROCESS`,`v`))),v=async(e,t,n={},i)=>{let{fromSSO:a}=await Promise.resolve().then(()=>p(mD()));return a({profile:e,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:i}).then(e=>t.sso_session?r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SSO`,`r`):r.setCredentialFeature(e,`CREDENTIALS_PROFILE_SSO_LEGACY`,`t`))},y=e=>e&&(typeof e.sso_start_url==`string`||typeof e.sso_account_id==`string`||typeof e.sso_session==`string`||typeof e.sso_region==`string`||typeof e.sso_role_name==`string`),b=e=>!!e&&typeof e==`object`&&typeof e.aws_access_key_id==`string`&&typeof e.aws_secret_access_key==`string`&&[`undefined`,`string`].indexOf(typeof e.aws_session_token)>-1&&[`undefined`,`string`].indexOf(typeof e.aws_account_id)>-1,x=async(e,t)=>{t?.logger?.debug(`@aws-sdk/credential-provider-ini - resolveStaticCredentials`);let n={accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}};return r.setCredentialFeature(n,`CREDENTIALS_PROFILE`,`n`)},S=e=>!!e&&typeof e==`object`&&typeof e.web_identity_token_file==`string`&&typeof e.role_arn==`string`&&[`undefined`,`string`].indexOf(typeof e.role_session_name)>-1,C=async(e,t,n)=>Promise.resolve().then(()=>p(dP())).then(({fromTokenFile:i})=>i({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:t.roleAssumerWithWebIdentity,logger:t.logger,parentClientConfig:t.parentClientConfig})({callerClientConfig:n}).then(e=>r.setCredentialFeature(e,`CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN`,`q`))),w=async(e,t,r,i,a={},o=!1)=>{let c=t[e];if(Object.keys(a).length>0&&b(c))return x(c,r);if(o||s(c,{profile:e,logger:r.logger}))return u(e,t,r,i,a,w);if(b(c))return x(c,r);if(S(c))return C(c,r,i);if(g(c))return _(r,e);if(y(c))return await v(e,c,r,i);if(f(c))return h(e,r,i);throw new n.CredentialsProviderError(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})};e.fromIni=(e={})=>async({callerClientConfig:n}={})=>{e.logger?.debug(`@aws-sdk/credential-provider-ini - fromIni`);let r=await t.parseKnownFiles(e);return w(t.getProfileName({profile:e.profile??n?.profile}),r,e,n)}})),pP=u((e=>{var t=gv(),n=f_(),r=__();let i=`AWS_EC2_METADATA_DISABLED`,a=async e=>{let{ENV_CMDS_FULL_URI:t,ENV_CMDS_RELATIVE_URI:r,fromContainerMetadata:a,fromInstanceMetadata:o}=await Promise.resolve().then(()=>p(_v()));if(process.env[r]||process.env[t]){e.logger?.debug(`@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata`);let{fromHttp:t}=await Promise.resolve().then(()=>p(Sv()));return n.chain(t(e),a(e))}return process.env[i]&&process.env[i]!==`false`?async()=>{throw new n.CredentialsProviderError(`EC2 Instance Metadata Service access disabled`,{logger:e.logger})}:(e.logger?.debug(`@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata`),o(e))};function o(e,t){let n=s(e),r,i,a,o=async e=>{if(e?.forceRefresh)return await n(e);if(a?.expiration&&a?.expiration?.getTime()<Date.now()&&(a=void 0),r)await r;else if(!a||t?.(a))if(a)i||=n(e).then(e=>{a=e}).finally(()=>{i=void 0});else return r=n(e).then(e=>{a=e}).finally(()=>{r=void 0}),o(e);return a};return o}let s=e=>async t=>{let n;for(let r of e)try{return await r(t)}catch(e){if(n=e,e?.tryNextLink)continue;throw e}throw n},c=!1,l=(e={})=>o([async()=>{if(e.profile??process.env[r.ENV_PROFILE])throw process.env[t.ENV_KEY]&&process.env[t.ENV_SECRET]&&(c||=((e.logger?.warn&&e.logger?.constructor?.name!==`NoOpLogger`?e.logger.warn.bind(e.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
71
71
|
Multiple credential sources detected:
|
|
72
72
|
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
73
73
|
This SDK will proceed with the AWS_PROFILE value.
|
|
@@ -75,11 +75,11 @@ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
|
|
|
75
75
|
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
76
76
|
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
77
77
|
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
78
|
-
`),!0)),new n.CredentialsProviderError(`AWS_PROFILE is set, skipping fromEnv provider.`,{logger:e.logger,tryNextLink:!0});return e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv`),t.fromEnv(e)()},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromSSO`);let{ssoStartUrl:r,ssoAccountId:i,ssoRegion:a,ssoRoleName:o,ssoSession:s}=e;if(!r&&!i&&!a&&!o&&!s)throw new n.CredentialsProviderError(`Skipping SSO provider in default chain (inputs do not include SSO fields).`,{logger:e.logger});let{fromSSO:c}=await Promise.resolve().then(()=>p(pD()));return c(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromIni`);let{fromIni:n}=await Promise.resolve().then(()=>p(dP()));return n(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromProcess`);let{fromProcess:n}=await Promise.resolve().then(()=>p(sP()));return n(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile`);let{fromTokenFile:n}=await Promise.resolve().then(()=>p(uP()));return n(e)(t)},async()=>(e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::remoteProvider`),(await a(e))()),async()=>{throw new n.CredentialsProviderError(`Could not load credentials from any providers`,{tryNextLink:!1,logger:e.logger})}],d),u=e=>e?.expiration!==void 0,d=e=>e?.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5;e.credentialsTreatedAsExpired=d,e.credentialsWillNeedRefresh=u,e.defaultProvider=l})),pP=u(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>n(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{isArrayBuffer:()=>d}),t.exports=l(u);var d=o(e=>typeof ArrayBuffer==`function`&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`,`isArrayBuffer`)})),mP=u(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>n(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{fromArrayBuffer:()=>p,fromString:()=>m}),t.exports=l(u);var d=pP(),f=h(`buffer`),p=o((e,t=0,n=e.byteLength-t)=>{if(!(0,d.isArrayBuffer)(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return f.Buffer.from(e,t,n)},`fromArrayBuffer`),m=o((e,t)=>{if(typeof e!=`string`)throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?f.Buffer.from(e,t):f.Buffer.from(e)},`fromString`)})),hP=u(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>n(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{fromUtf8:()=>f,toUint8Array:()=>p,toUtf8:()=>m}),t.exports=l(u);var d=mP(),f=o(e=>{let t=(0,d.fromString)(e,`utf8`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},`fromUtf8`),p=o(e=>typeof e==`string`?f(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),`toUint8Array`),m=o(e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||typeof e.byteOffset!=`number`||typeof e.byteLength!=`number`)throw Error(`@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.`);return(0,d.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`)},`toUtf8`)})),gP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertToBuffer=void 0;var t=hP(),n=typeof Buffer<`u`&&Buffer.from?function(e){return Buffer.from(e,`utf8`)}:t.fromUtf8;function r(e){return e instanceof Uint8Array?e:typeof e==`string`?n(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}e.convertToBuffer=r})),_P=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmptyData=void 0;function t(e){return typeof e==`string`?e.length===0:e.byteLength===0}e.isEmptyData=t})),vP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}e.numToUint8=t})),yP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uint32ArrayFrom=void 0;function t(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)}e.uint32ArrayFrom=t})),bP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uint32ArrayFrom=e.numToUint8=e.isEmptyData=e.convertToBuffer=void 0;var t=gP();Object.defineProperty(e,`convertToBuffer`,{enumerable:!0,get:function(){return t.convertToBuffer}});var n=_P();Object.defineProperty(e,`isEmptyData`,{enumerable:!0,get:function(){return n.isEmptyData}});var r=vP();Object.defineProperty(e,`numToUint8`,{enumerable:!0,get:function(){return r.numToUint8}});var i=yP();Object.defineProperty(e,`uint32ArrayFrom`,{enumerable:!0,get:function(){return i.uint32ArrayFrom}})})),xP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsCrc32=void 0;var t=(N(),m(j)),n=bP(),r=SP();e.AwsCrc32=function(){function e(){this.crc32=new r.Crc32}return e.prototype.update=function(e){(0,n.isEmptyData)(e)||this.crc32.update((0,n.convertToBuffer)(e))},e.prototype.digest=function(){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(e){return[2,(0,n.numToUint8)(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new r.Crc32},e}()})),SP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsCrc32=e.Crc32=e.crc32=void 0;var t=(N(),m(j)),n=bP();function r(e){return new i().update(e).digest()}e.crc32=r;var i=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var n,r;try{for(var i=t.__values(e),o=i.next();!o.done;o=i.next()){var s=o.value;this.checksum=this.checksum>>>8^a[(this.checksum^s)&255]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e}();e.Crc32=i;var a=(0,n.uint32ArrayFrom)([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]),o=xP();Object.defineProperty(e,`AwsCrc32`,{enumerable:!0,get:function(){return o.AwsCrc32}})})),CP=u((e=>{var t=SP(),n=Mf(),r=class e{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw Error(`Int64 buffers must be exactly 8 bytes`)}static fromNumber(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let e=7,r=Math.abs(Math.round(t));e>-1&&r>0;e--,r/=256)n[e]=r;return t<0&&i(n),new e(n)}valueOf(){let e=this.bytes.slice(0),t=e[0]&128;return t&&i(e),parseInt(n.toHex(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}};function i(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}var a=class{toUtf8;fromUtf8;constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){let t=[];for(let n of Object.keys(e)){let r=this.fromUtf8(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}let n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case`boolean`:return Uint8Array.from([e.value?0:1]);case`byte`:return Uint8Array.from([2,e.value]);case`short`:let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case`integer`:let i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case`long`:let a=new Uint8Array(9);return a[0]=5,a.set(e.value.bytes,1),a;case`binary`:let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);let s=new Uint8Array(o.buffer);return s.set(e.value,3),s;case`string`:let c=this.fromUtf8(e.value),l=new DataView(new ArrayBuffer(3+c.byteLength));l.setUint8(0,7),l.setUint16(1,c.byteLength,!1);let u=new Uint8Array(l.buffer);return u.set(c,3),u;case`timestamp`:let d=new Uint8Array(9);return d[0]=8,d.set(r.fromNumber(e.value.valueOf()).bytes,1),d;case`uuid`:if(!h.test(e.value))throw Error(`Invalid UUID received: ${e.value}`);let f=new Uint8Array(17);return f[0]=9,f.set(n.fromHex(e.value.replace(/\-/g,``)),1),f}}parse(e){let t={},i=0;for(;i<e.byteLength;){let a=e.getUint8(i++),h=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+i,a));switch(i+=a,e.getUint8(i++)){case 0:t[h]={type:o,value:!0};break;case 1:t[h]={type:o,value:!1};break;case 2:t[h]={type:s,value:e.getInt8(i++)};break;case 3:t[h]={type:c,value:e.getInt16(i,!1)},i+=2;break;case 4:t[h]={type:l,value:e.getInt32(i,!1)},i+=4;break;case 5:t[h]={type:u,value:new r(new Uint8Array(e.buffer,e.byteOffset+i,8))},i+=8;break;case 6:let a=e.getUint16(i,!1);i+=2,t[h]={type:d,value:new Uint8Array(e.buffer,e.byteOffset+i,a)},i+=a;break;case 7:let g=e.getUint16(i,!1);i+=2,t[h]={type:f,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+i,g))},i+=g;break;case 8:t[h]={type:p,value:new Date(new r(new Uint8Array(e.buffer,e.byteOffset+i,8)).valueOf())},i+=8;break;case 9:let _=new Uint8Array(e.buffer,e.byteOffset+i,16);i+=16,t[h]={type:m,value:`${n.toHex(_.subarray(0,4))}-${n.toHex(_.subarray(4,6))}-${n.toHex(_.subarray(6,8))}-${n.toHex(_.subarray(8,10))}-${n.toHex(_.subarray(10))}`};break;default:throw Error(`Unrecognized header type tag`)}}return t}};let o=`boolean`,s=`byte`,c=`short`,l=`integer`,u=`long`,d=`binary`,f=`string`,p=`timestamp`,m=`uuid`,h=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function g({byteLength:e,byteOffset:n,buffer:r}){if(e<16)throw Error(`Provided message too short to accommodate event stream message overhead`);let i=new DataView(r,n,e),a=i.getUint32(0,!1);if(e!==a)throw Error(`Reported message length does not match received message length`);let o=i.getUint32(4,!1),s=i.getUint32(8,!1),c=i.getUint32(e-4,!1),l=new t.Crc32().update(new Uint8Array(r,n,8));if(s!==l.digest())throw Error(`The prelude checksum specified in the message (${s}) does not match the calculated CRC32 checksum (${l.digest()})`);if(l.update(new Uint8Array(r,n+8,e-12)),c!==l.digest())throw Error(`The message checksum (${l.digest()}) did not match the expected value of ${c}`);return{headers:new DataView(r,n+8+4,o),body:new Uint8Array(r,n+8+4+o,a-o-16)}}var _=class{headerMarshaller;messageBuffer;isEndOfStream;constructor(e,t){this.headerMarshaller=new a(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){let e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return t}}}getAvailableMessages(){let e=this.messageBuffer;this.messageBuffer=[];let t=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return t}}}encode({headers:e,body:n}){let r=this.headerMarshaller.format(e),i=r.byteLength+n.byteLength+16,a=new Uint8Array(i),o=new DataView(a.buffer,a.byteOffset,a.byteLength),s=new t.Crc32;return o.setUint32(0,i,!1),o.setUint32(4,r.byteLength,!1),o.setUint32(8,s.update(a.subarray(0,8)).digest(),!1),a.set(r,12),a.set(n,r.byteLength+12),o.setUint32(i-4,s.update(a.subarray(8,i-4)).digest(),!1),a}decode(e){let{headers:t,body:n}=g(e);return{headers:this.headerMarshaller.parse(t),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}},v=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}},y=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array)}},b=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){let t=await this.options.deserializer(e);t!==void 0&&(yield t)}}},x=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}};e.EventStreamCodec=_,e.HeaderMarshaller=a,e.Int64=r,e.MessageDecoderStream=v,e.MessageEncoderStream=y,e.SmithyMessageDecoderStream=b,e.SmithyMessageEncoderStream=x})),wP=u((e=>{var t=CP();function n(e){let t=0,n=0,r=null,i=null,a=e=>{if(typeof e!=`number`)throw Error(`Attempted to allocate an event message where size was not a number: `+e);t=e,n=4,r=new Uint8Array(e),new DataView(r.buffer).setUint32(0,e,!1)},o=async function*(){let o=e[Symbol.asyncIterator]();for(;;){let{value:e,done:s}=await o.next();if(s){if(!t)return;if(t===n)yield r;else throw Error(`Truncated event message received.`);return}let c=e.length,l=0;for(;l<c;){if(!r){let t=c-l;i||=new Uint8Array(4);let r=Math.min(4-n,t);if(i.set(e.slice(l,l+r),n),n+=r,l+=r,n<4)break;a(new DataView(i.buffer).getUint32(0,!1)),i=null}let o=Math.min(t-n,c-l);r.set(e.slice(l,l+o),n),n+=o,l+=o,t&&t===n&&(yield r,r=null,t=0,n=0)}}};return{[Symbol.asyncIterator]:o}}function r(e,t){return async function(n){let{value:r}=n.headers[`:message-type`];if(r===`error`){let e=Error(n.headers[`:error-message`].value||`UnknownError`);throw e.name=n.headers[`:error-code`].value,e}else if(r===`exception`){let r=n.headers[`:exception-type`].value,i=await e({[r]:n});if(i.$unknown){let e=Error(t(n.body));throw e.name=r,e}throw i[r]}else if(r===`event`){let t=await e({[n.headers[`:event-type`].value]:n});return t.$unknown?void 0:t}else throw Error(`Unrecognizable event type: ${n.headers[`:event-type`].value}`)}}var i=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:e,utf8Decoder:n}){this.eventStreamCodec=new t.EventStreamCodec(e,n),this.utfEncoder=e}deserialize(e,i){let a=n(e);return new t.SmithyMessageDecoderStream({messageStream:new t.MessageDecoderStream({inputStream:a,decoder:this.eventStreamCodec}),deserializer:r(i,this.utfEncoder)})}serialize(e,n){return new t.MessageEncoderStream({messageStream:new t.SmithyMessageEncoderStream({inputStream:e,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};e.EventStreamMarshaller=i,e.eventStreamSerdeProvider=e=>new i(e)})),TP=u((e=>{var t=wP(),n=h(`stream`);async function*r(e){let t=!1,n=!1,r=[];for(e.on(`error`,e=>{if(t||=!0,e)throw e}),e.on(`data`,e=>{r.push(e)}),e.on(`end`,()=>{t=!0});!n;){let e=await new Promise(e=>setTimeout(()=>e(r.shift()),0));e&&(yield e),n=t&&r.length===0}}var i=class{universalMarshaller;constructor({utf8Encoder:e,utf8Decoder:n}){this.universalMarshaller=new t.EventStreamMarshaller({utf8Decoder:n,utf8Encoder:e})}deserialize(e,t){let n=typeof e[Symbol.asyncIterator]==`function`?e:r(e);return this.universalMarshaller.deserialize(n,t)}serialize(e,t){return n.Readable.from(this.universalMarshaller.serialize(e,t))}};e.EventStreamMarshaller=i,e.eventStreamSerdeProvider=e=>new i(e)})),EP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`isSet`,i=`booleanEquals`,a=`error`,o=`endpoint`,s=`tree`,c=`PartitionResult`,l={[t]:!1,type:`string`},u={[t]:!0,default:!1,type:`boolean`},d={ref:`Endpoint`},f={fn:i,[n]:[{ref:`UseFIPS`},!0]},p={fn:i,[n]:[{ref:`UseDualStack`},!0]},m={},h={fn:`getAttr`,[n]:[{ref:c},`supportsFIPS`]},g={fn:i,[n]:[!0,{fn:`getAttr`,[n]:[{ref:c},`supportsDualStack`]}]},_=[f],v=[p],y=[{ref:`Region`}];e.ruleSet={version:`1.0`,parameters:{Region:l,UseDualStack:u,UseFIPS:u,Endpoint:l},rules:[{conditions:[{fn:r,[n]:[d]}],rules:[{conditions:_,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{conditions:v,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:d,properties:m,headers:m},type:o}],type:s},{conditions:[{fn:r,[n]:y}],rules:[{conditions:[{fn:`aws.partition`,[n]:y,assign:c}],rules:[{conditions:[f,p],rules:[{conditions:[{fn:i,[n]:[!0,h]},g],rules:[{endpoint:{url:`https://lambda-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}],type:s},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}],type:s},{conditions:_,rules:[{conditions:[{fn:i,[n]:[h,!0]}],rules:[{endpoint:{url:`https://lambda-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}],type:s},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}],type:s},{conditions:v,rules:[{conditions:[g],rules:[{endpoint:{url:`https://lambda.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}],type:s},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}],type:s},{endpoint:{url:`https://lambda.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}],type:s}],type:s},{error:`Invalid Configuration: Missing Region`,type:a}]}})),DP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=Kg(),n=Gg(),r=EP(),i=new n.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]});e.defaultEndpointResolver=(e,t={})=>i.get(e,()=>(0,n.resolveEndpoint)(r.ruleSet,{endpointParams:e,logger:t.logger})),n.customEndpointFunctions.aws=t.awsEndpointFunctions})),OP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LambdaServiceException=e.__ServiceException=void 0;let t=C_();Object.defineProperty(e,`__ServiceException`,{enumerable:!0,get:function(){return t.ServiceException}}),e.LambdaServiceException=class e extends t.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),kP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CallbackTimeoutException=e.ProvisionedConcurrencyConfigNotFoundException=e.UnsupportedMediaTypeException=e.SubnetIPAddressLimitReachedException=e.SnapStartTimeoutException=e.SnapStartNotReadyException=e.SnapStartException=e.SerializedRequestEntityTooLargeException=e.ResourceNotReadyException=e.RequestTooLargeException=e.RecursiveInvocationException=e.NoPublishedVersionException=e.KMSNotFoundException=e.KMSInvalidStateException=e.KMSDisabledException=e.KMSAccessDeniedException=e.InvalidZipFileException=e.InvalidSubnetIDException=e.InvalidSecurityGroupIDException=e.InvalidRuntimeException=e.InvalidRequestContentException=e.ENILimitReachedException=e.EFSMountTimeoutException=e.EFSMountFailureException=e.EFSMountConnectivityException=e.EFSIOException=e.EC2UnexpectedException=e.EC2ThrottledException=e.EC2AccessDeniedException=e.DurableExecutionAlreadyStartedException=e.InvalidCodeSignatureException=e.FunctionVersionsPerCapacityProviderLimitExceededException=e.CodeVerificationFailedException=e.CodeStorageExceededException=e.CodeSigningConfigNotFoundException=e.ResourceInUseException=e.CapacityProviderLimitExceededException=e.TooManyRequestsException=e.ServiceException=e.ResourceNotFoundException=e.ResourceConflictException=e.PreconditionFailedException=e.PolicyLengthExceededException=e.InvalidParameterValueException=void 0;let t=OP();e.InvalidParameterValueException=class e extends t.LambdaServiceException{name=`InvalidParameterValueException`;$fault=`client`;Type;constructor(t){super({name:`InvalidParameterValueException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.PolicyLengthExceededException=class e extends t.LambdaServiceException{name=`PolicyLengthExceededException`;$fault=`client`;Type;constructor(t){super({name:`PolicyLengthExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.PreconditionFailedException=class e extends t.LambdaServiceException{name=`PreconditionFailedException`;$fault=`client`;Type;constructor(t){super({name:`PreconditionFailedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceConflictException=class e extends t.LambdaServiceException{name=`ResourceConflictException`;$fault=`client`;Type;constructor(t){super({name:`ResourceConflictException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceNotFoundException=class e extends t.LambdaServiceException{name=`ResourceNotFoundException`;$fault=`client`;Type;Message;constructor(t){super({name:`ResourceNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.ServiceException=class e extends t.LambdaServiceException{name=`ServiceException`;$fault=`server`;Type;Message;constructor(t){super({name:`ServiceException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.TooManyRequestsException=class e extends t.LambdaServiceException{name=`TooManyRequestsException`;$fault=`client`;retryAfterSeconds;Type;Reason;constructor(t){super({name:`TooManyRequestsException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.retryAfterSeconds=t.retryAfterSeconds,this.Type=t.Type,this.Reason=t.Reason}},e.CapacityProviderLimitExceededException=class e extends t.LambdaServiceException{name=`CapacityProviderLimitExceededException`;$fault=`client`;Type;constructor(t){super({name:`CapacityProviderLimitExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceInUseException=class e extends t.LambdaServiceException{name=`ResourceInUseException`;$fault=`client`;Type;Message;constructor(t){super({name:`ResourceInUseException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.CodeSigningConfigNotFoundException=class e extends t.LambdaServiceException{name=`CodeSigningConfigNotFoundException`;$fault=`client`;Type;Message;constructor(t){super({name:`CodeSigningConfigNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.CodeStorageExceededException=class e extends t.LambdaServiceException{name=`CodeStorageExceededException`;$fault=`client`;Type;constructor(t){super({name:`CodeStorageExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.CodeVerificationFailedException=class e extends t.LambdaServiceException{name=`CodeVerificationFailedException`;$fault=`client`;Type;Message;constructor(t){super({name:`CodeVerificationFailedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.FunctionVersionsPerCapacityProviderLimitExceededException=class e extends t.LambdaServiceException{name=`FunctionVersionsPerCapacityProviderLimitExceededException`;$fault=`client`;Type;constructor(t){super({name:`FunctionVersionsPerCapacityProviderLimitExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.InvalidCodeSignatureException=class e extends t.LambdaServiceException{name=`InvalidCodeSignatureException`;$fault=`client`;Type;Message;constructor(t){super({name:`InvalidCodeSignatureException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.DurableExecutionAlreadyStartedException=class e extends t.LambdaServiceException{name=`DurableExecutionAlreadyStartedException`;$fault=`client`;Type;Message;constructor(t){super({name:`DurableExecutionAlreadyStartedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EC2AccessDeniedException=class e extends t.LambdaServiceException{name=`EC2AccessDeniedException`;$fault=`server`;Type;Message;constructor(t){super({name:`EC2AccessDeniedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EC2ThrottledException=class e extends t.LambdaServiceException{name=`EC2ThrottledException`;$fault=`server`;Type;Message;constructor(t){super({name:`EC2ThrottledException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EC2UnexpectedException=class e extends t.LambdaServiceException{name=`EC2UnexpectedException`;$fault=`server`;Type;Message;EC2ErrorCode;constructor(t){super({name:`EC2UnexpectedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message,this.EC2ErrorCode=t.EC2ErrorCode}},e.EFSIOException=class e extends t.LambdaServiceException{name=`EFSIOException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSIOException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EFSMountConnectivityException=class e extends t.LambdaServiceException{name=`EFSMountConnectivityException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSMountConnectivityException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EFSMountFailureException=class e extends t.LambdaServiceException{name=`EFSMountFailureException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSMountFailureException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EFSMountTimeoutException=class e extends t.LambdaServiceException{name=`EFSMountTimeoutException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSMountTimeoutException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.ENILimitReachedException=class e extends t.LambdaServiceException{name=`ENILimitReachedException`;$fault=`server`;Type;Message;constructor(t){super({name:`ENILimitReachedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidRequestContentException=class e extends t.LambdaServiceException{name=`InvalidRequestContentException`;$fault=`client`;Type;constructor(t){super({name:`InvalidRequestContentException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.InvalidRuntimeException=class e extends t.LambdaServiceException{name=`InvalidRuntimeException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidRuntimeException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidSecurityGroupIDException=class e extends t.LambdaServiceException{name=`InvalidSecurityGroupIDException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidSecurityGroupIDException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidSubnetIDException=class e extends t.LambdaServiceException{name=`InvalidSubnetIDException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidSubnetIDException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidZipFileException=class e extends t.LambdaServiceException{name=`InvalidZipFileException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidZipFileException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSAccessDeniedException=class e extends t.LambdaServiceException{name=`KMSAccessDeniedException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSAccessDeniedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSDisabledException=class e extends t.LambdaServiceException{name=`KMSDisabledException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSDisabledException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSInvalidStateException=class e extends t.LambdaServiceException{name=`KMSInvalidStateException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSInvalidStateException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSNotFoundException=class e extends t.LambdaServiceException{name=`KMSNotFoundException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSNotFoundException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.NoPublishedVersionException=class e extends t.LambdaServiceException{name=`NoPublishedVersionException`;$fault=`client`;Type;Message;constructor(t){super({name:`NoPublishedVersionException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.RecursiveInvocationException=class e extends t.LambdaServiceException{name=`RecursiveInvocationException`;$fault=`client`;Type;Message;constructor(t){super({name:`RecursiveInvocationException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.RequestTooLargeException=class e extends t.LambdaServiceException{name=`RequestTooLargeException`;$fault=`client`;Type;constructor(t){super({name:`RequestTooLargeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceNotReadyException=class e extends t.LambdaServiceException{name=`ResourceNotReadyException`;$fault=`server`;Type;constructor(t){super({name:`ResourceNotReadyException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.SerializedRequestEntityTooLargeException=class e extends t.LambdaServiceException{name=`SerializedRequestEntityTooLargeException`;$fault=`client`;Type;constructor(t){super({name:`SerializedRequestEntityTooLargeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.SnapStartException=class e extends t.LambdaServiceException{name=`SnapStartException`;$fault=`client`;Type;Message;constructor(t){super({name:`SnapStartException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.SnapStartNotReadyException=class e extends t.LambdaServiceException{name=`SnapStartNotReadyException`;$fault=`client`;Type;Message;constructor(t){super({name:`SnapStartNotReadyException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.SnapStartTimeoutException=class e extends t.LambdaServiceException{name=`SnapStartTimeoutException`;$fault=`client`;Type;Message;constructor(t){super({name:`SnapStartTimeoutException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.SubnetIPAddressLimitReachedException=class e extends t.LambdaServiceException{name=`SubnetIPAddressLimitReachedException`;$fault=`server`;Type;Message;constructor(t){super({name:`SubnetIPAddressLimitReachedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.UnsupportedMediaTypeException=class e extends t.LambdaServiceException{name=`UnsupportedMediaTypeException`;$fault=`client`;Type;constructor(t){super({name:`UnsupportedMediaTypeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ProvisionedConcurrencyConfigNotFoundException=class e extends t.LambdaServiceException{name=`ProvisionedConcurrencyConfigNotFoundException`;$fault=`client`;Type;constructor(t){super({name:`ProvisionedConcurrencyConfigNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.CallbackTimeoutException=class e extends t.LambdaServiceException{name=`CallbackTimeoutException`;$fault=`client`;Type;Message;constructor(t){super({name:`CallbackTimeoutException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}}})),AP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AddLayerVersionPermissionResponse$=e.AddLayerVersionPermissionRequest$=e.AccountUsage$=e.AccountLimit$=e.errorTypeRegistries=e.UnsupportedMediaTypeException$=e.TooManyRequestsException$=e.SubnetIPAddressLimitReachedException$=e.SnapStartTimeoutException$=e.SnapStartNotReadyException$=e.SnapStartException$=e.ServiceException$=e.SerializedRequestEntityTooLargeException$=e.ResourceNotReadyException$=e.ResourceNotFoundException$=e.ResourceInUseException$=e.ResourceConflictException$=e.RequestTooLargeException$=e.RecursiveInvocationException$=e.ProvisionedConcurrencyConfigNotFoundException$=e.PreconditionFailedException$=e.PolicyLengthExceededException$=e.NoPublishedVersionException$=e.KMSNotFoundException$=e.KMSInvalidStateException$=e.KMSDisabledException$=e.KMSAccessDeniedException$=e.InvalidZipFileException$=e.InvalidSubnetIDException$=e.InvalidSecurityGroupIDException$=e.InvalidRuntimeException$=e.InvalidRequestContentException$=e.InvalidParameterValueException$=e.InvalidCodeSignatureException$=e.FunctionVersionsPerCapacityProviderLimitExceededException$=e.ENILimitReachedException$=e.EFSMountTimeoutException$=e.EFSMountFailureException$=e.EFSMountConnectivityException$=e.EFSIOException$=e.EC2UnexpectedException$=e.EC2ThrottledException$=e.EC2AccessDeniedException$=e.DurableExecutionAlreadyStartedException$=e.CodeVerificationFailedException$=e.CodeStorageExceededException$=e.CodeSigningConfigNotFoundException$=e.CapacityProviderLimitExceededException$=e.CallbackTimeoutException$=e.LambdaServiceException$=void 0,e.DeleteCodeSigningConfigRequest$=e.DeleteCapacityProviderResponse$=e.DeleteCapacityProviderRequest$=e.DeleteAliasRequest$=e.DeadLetterConfig$=e.CreateFunctionUrlConfigResponse$=e.CreateFunctionUrlConfigRequest$=e.CreateFunctionRequest$=e.CreateEventSourceMappingRequest$=e.CreateCodeSigningConfigResponse$=e.CreateCodeSigningConfigRequest$=e.CreateCapacityProviderResponse$=e.CreateCapacityProviderRequest$=e.CreateAliasRequest$=e.Cors$=e.ContextSucceededDetails$=e.ContextStartedDetails$=e.ContextOptions$=e.ContextFailedDetails$=e.ContextDetails$=e.Concurrency$=e.CodeSigningPolicies$=e.CodeSigningConfig$=e.CheckpointUpdatedExecutionState$=e.CheckpointDurableExecutionResponse$=e.CheckpointDurableExecutionRequest$=e.ChainedInvokeTimedOutDetails$=e.ChainedInvokeSucceededDetails$=e.ChainedInvokeStoppedDetails$=e.ChainedInvokeStartedDetails$=e.ChainedInvokeOptions$=e.ChainedInvokeFailedDetails$=e.ChainedInvokeDetails$=e.CapacityProviderVpcConfig$=e.CapacityProviderScalingConfig$=e.CapacityProviderPermissionsConfig$=e.CapacityProviderConfig$=e.CapacityProvider$=e.CallbackTimedOutDetails$=e.CallbackSucceededDetails$=e.CallbackStartedDetails$=e.CallbackOptions$=e.CallbackFailedDetails$=e.CallbackDetails$=e.AmazonManagedKafkaEventSourceConfig$=e.AllowedPublishers$=e.AliasRoutingConfiguration$=e.AliasConfiguration$=e.AddPermissionResponse$=e.AddPermissionRequest$=void 0,e.GetCodeSigningConfigResponse$=e.GetCodeSigningConfigRequest$=e.GetCapacityProviderResponse$=e.GetCapacityProviderRequest$=e.GetAliasRequest$=e.GetAccountSettingsResponse$=e.GetAccountSettingsRequest$=e.FunctionVersionsByCapacityProviderListItem$=e.FunctionUrlConfig$=e.FunctionScalingConfig$=e.FunctionEventInvokeConfig$=e.FunctionConfiguration$=e.FunctionCodeLocation$=e.FunctionCode$=e.FilterCriteriaError$=e.FilterCriteria$=e.Filter$=e.FileSystemConfig$=e.ExecutionTimedOutDetails$=e.ExecutionSucceededDetails$=e.ExecutionStoppedDetails$=e.ExecutionStartedDetails$=e.ExecutionFailedDetails$=e.ExecutionDetails$=e.Execution$=e.EventSourceMappingMetricsConfig$=e.EventSourceMappingLoggingConfig$=e.EventSourceMappingConfiguration$=e.EventResult$=e.EventInput$=e.EventError$=e.Event$=e.ErrorObject$=e.EphemeralStorage$=e.EnvironmentResponse$=e.EnvironmentError$=e.Environment$=e.DurableConfig$=e.DocumentDBEventSourceConfig$=e.DestinationConfig$=e.DeleteProvisionedConcurrencyConfigRequest$=e.DeleteLayerVersionRequest$=e.DeleteFunctionUrlConfigRequest$=e.DeleteFunctionResponse$=e.DeleteFunctionRequest$=e.DeleteFunctionEventInvokeConfigRequest$=e.DeleteFunctionConcurrencyRequest$=e.DeleteFunctionCodeSigningConfigRequest$=e.DeleteEventSourceMappingRequest$=e.DeleteCodeSigningConfigResponse$=void 0,e.Layer$=e.LambdaManagedInstancesCapacityProviderConfig$=e.KafkaSchemaValidationConfig$=e.KafkaSchemaRegistryConfig$=e.KafkaSchemaRegistryAccessConfig$=e.InvokeWithResponseStreamResponse$=e.InvokeWithResponseStreamRequest$=e.InvokeWithResponseStreamCompleteEvent$=e.InvokeResponseStreamUpdate$=e.InvokeAsyncResponse$=e.InvokeAsyncRequest$=e.InvocationResponse$=e.InvocationRequest$=e.InvocationCompletedDetails$=e.InstanceRequirements$=e.ImageConfigResponse$=e.ImageConfigError$=e.ImageConfig$=e.GetRuntimeManagementConfigResponse$=e.GetRuntimeManagementConfigRequest$=e.GetProvisionedConcurrencyConfigResponse$=e.GetProvisionedConcurrencyConfigRequest$=e.GetPolicyResponse$=e.GetPolicyRequest$=e.GetLayerVersionResponse$=e.GetLayerVersionRequest$=e.GetLayerVersionPolicyResponse$=e.GetLayerVersionPolicyRequest$=e.GetLayerVersionByArnRequest$=e.GetFunctionUrlConfigResponse$=e.GetFunctionUrlConfigRequest$=e.GetFunctionScalingConfigResponse$=e.GetFunctionScalingConfigRequest$=e.GetFunctionResponse$=e.GetFunctionRequest$=e.GetFunctionRecursionConfigResponse$=e.GetFunctionRecursionConfigRequest$=e.GetFunctionEventInvokeConfigRequest$=e.GetFunctionConfigurationRequest$=e.GetFunctionConcurrencyResponse$=e.GetFunctionConcurrencyRequest$=e.GetFunctionCodeSigningConfigResponse$=e.GetFunctionCodeSigningConfigRequest$=e.GetEventSourceMappingRequest$=e.GetDurableExecutionStateResponse$=e.GetDurableExecutionStateRequest$=e.GetDurableExecutionResponse$=e.GetDurableExecutionRequest$=e.GetDurableExecutionHistoryResponse$=e.GetDurableExecutionHistoryRequest$=void 0,e.PutFunctionRecursionConfigResponse$=e.PutFunctionRecursionConfigRequest$=e.PutFunctionEventInvokeConfigRequest$=e.PutFunctionConcurrencyRequest$=e.PutFunctionCodeSigningConfigResponse$=e.PutFunctionCodeSigningConfigRequest$=e.PublishVersionRequest$=e.PublishLayerVersionResponse$=e.PublishLayerVersionRequest$=e.ProvisionedPollerConfig$=e.ProvisionedConcurrencyConfigListItem$=e.OperationUpdate$=e.Operation$=e.OnSuccess$=e.OnFailure$=e.LoggingConfig$=e.ListVersionsByFunctionResponse$=e.ListVersionsByFunctionRequest$=e.ListTagsResponse$=e.ListTagsRequest$=e.ListProvisionedConcurrencyConfigsResponse$=e.ListProvisionedConcurrencyConfigsRequest$=e.ListLayerVersionsResponse$=e.ListLayerVersionsRequest$=e.ListLayersResponse$=e.ListLayersRequest$=e.ListFunctionVersionsByCapacityProviderResponse$=e.ListFunctionVersionsByCapacityProviderRequest$=e.ListFunctionUrlConfigsResponse$=e.ListFunctionUrlConfigsRequest$=e.ListFunctionsResponse$=e.ListFunctionsRequest$=e.ListFunctionsByCodeSigningConfigResponse$=e.ListFunctionsByCodeSigningConfigRequest$=e.ListFunctionEventInvokeConfigsResponse$=e.ListFunctionEventInvokeConfigsRequest$=e.ListEventSourceMappingsResponse$=e.ListEventSourceMappingsRequest$=e.ListDurableExecutionsByFunctionResponse$=e.ListDurableExecutionsByFunctionRequest$=e.ListCodeSigningConfigsResponse$=e.ListCodeSigningConfigsRequest$=e.ListCapacityProvidersResponse$=e.ListCapacityProvidersRequest$=e.ListAliasesResponse$=e.ListAliasesRequest$=e.LayerVersionsListItem$=e.LayerVersionContentOutput$=e.LayerVersionContentInput$=e.LayersListItem$=void 0,e.VpcConfig$=e.UpdateFunctionUrlConfigResponse$=e.UpdateFunctionUrlConfigRequest$=e.UpdateFunctionEventInvokeConfigRequest$=e.UpdateFunctionConfigurationRequest$=e.UpdateFunctionCodeRequest$=e.UpdateEventSourceMappingRequest$=e.UpdateCodeSigningConfigResponse$=e.UpdateCodeSigningConfigRequest$=e.UpdateCapacityProviderResponse$=e.UpdateCapacityProviderRequest$=e.UpdateAliasRequest$=e.UntagResourceRequest$=e.TracingConfigResponse$=e.TracingConfig$=e.TraceHeader$=e.TenancyConfig$=e.TargetTrackingScalingPolicy$=e.TagsError$=e.TagResourceRequest$=e.StopDurableExecutionResponse$=e.StopDurableExecutionRequest$=e.StepSucceededDetails$=e.StepStartedDetails$=e.StepOptions$=e.StepFailedDetails$=e.StepDetails$=e.SourceAccessConfiguration$=e.SnapStartResponse$=e.SnapStart$=e.SendDurableExecutionCallbackSuccessResponse$=e.SendDurableExecutionCallbackSuccessRequest$=e.SendDurableExecutionCallbackHeartbeatResponse$=e.SendDurableExecutionCallbackHeartbeatRequest$=e.SendDurableExecutionCallbackFailureResponse$=e.SendDurableExecutionCallbackFailureRequest$=e.SelfManagedKafkaEventSourceConfig$=e.SelfManagedEventSource$=e.ScalingConfig$=e.RuntimeVersionError$=e.RuntimeVersionConfig$=e.RetryDetails$=e.RemovePermissionRequest$=e.RemoveLayerVersionPermissionRequest$=e.PutRuntimeManagementConfigResponse$=e.PutRuntimeManagementConfigRequest$=e.PutProvisionedConcurrencyConfigResponse$=e.PutProvisionedConcurrencyConfigRequest$=e.PutFunctionScalingConfigResponse$=e.PutFunctionScalingConfigRequest$=void 0,e.Invoke$=e.GetRuntimeManagementConfig$=e.GetProvisionedConcurrencyConfig$=e.GetPolicy$=e.GetLayerVersionPolicy$=e.GetLayerVersionByArn$=e.GetLayerVersion$=e.GetFunctionUrlConfig$=e.GetFunctionScalingConfig$=e.GetFunctionRecursionConfig$=e.GetFunctionEventInvokeConfig$=e.GetFunctionConfiguration$=e.GetFunctionConcurrency$=e.GetFunctionCodeSigningConfig$=e.GetFunction$=e.GetEventSourceMapping$=e.GetDurableExecutionState$=e.GetDurableExecutionHistory$=e.GetDurableExecution$=e.GetCodeSigningConfig$=e.GetCapacityProvider$=e.GetAlias$=e.GetAccountSettings$=e.DeleteProvisionedConcurrencyConfig$=e.DeleteLayerVersion$=e.DeleteFunctionUrlConfig$=e.DeleteFunctionEventInvokeConfig$=e.DeleteFunctionConcurrency$=e.DeleteFunctionCodeSigningConfig$=e.DeleteFunction$=e.DeleteEventSourceMapping$=e.DeleteCodeSigningConfig$=e.DeleteCapacityProvider$=e.DeleteAlias$=e.CreateFunctionUrlConfig$=e.CreateFunction$=e.CreateEventSourceMapping$=e.CreateCodeSigningConfig$=e.CreateCapacityProvider$=e.CreateAlias$=e.CheckpointDurableExecution$=e.AddPermission$=e.AddLayerVersionPermission$=e.InvokeWithResponseStreamResponseEvent$=e.WaitSucceededDetails$=e.WaitStartedDetails$=e.WaitOptions$=e.WaitDetails$=e.WaitCancelledDetails$=e.VpcConfigResponse$=void 0,e.UpdateFunctionUrlConfig$=e.UpdateFunctionEventInvokeConfig$=e.UpdateFunctionConfiguration$=e.UpdateFunctionCode$=e.UpdateEventSourceMapping$=e.UpdateCodeSigningConfig$=e.UpdateCapacityProvider$=e.UpdateAlias$=e.UntagResource$=e.TagResource$=e.StopDurableExecution$=e.SendDurableExecutionCallbackSuccess$=e.SendDurableExecutionCallbackHeartbeat$=e.SendDurableExecutionCallbackFailure$=e.RemovePermission$=e.RemoveLayerVersionPermission$=e.PutRuntimeManagementConfig$=e.PutProvisionedConcurrencyConfig$=e.PutFunctionScalingConfig$=e.PutFunctionRecursionConfig$=e.PutFunctionEventInvokeConfig$=e.PutFunctionConcurrency$=e.PutFunctionCodeSigningConfig$=e.PublishVersion$=e.PublishLayerVersion$=e.ListVersionsByFunction$=e.ListTags$=e.ListProvisionedConcurrencyConfigs$=e.ListLayerVersions$=e.ListLayers$=e.ListFunctionVersionsByCapacityProvider$=e.ListFunctionUrlConfigs$=e.ListFunctionsByCodeSigningConfig$=e.ListFunctions$=e.ListFunctionEventInvokeConfigs$=e.ListEventSourceMappings$=e.ListDurableExecutionsByFunction$=e.ListCodeSigningConfigs$=e.ListCapacityProviders$=e.ListAliases$=e.InvokeWithResponseStream$=e.InvokeAsync$=void 0;let t=`Action`,n=`AccountLimit`,r=`AmazonManagedKafkaEventSourceConfig`,i=`ApplyOn`,a=`AllowedPublishers`,o=`AvailableProvisionedConcurrentExecutions`,s=`AllocatedProvisionedConcurrentExecutions`,c=`AuthType`,l=`AccountUsage`,u=`Architectures`,d=`BisectBatchOnFunctionError`,f=`BatchSize`,p=`Concurrency`,h=`CompatibleArchitectures`,g=`CompatibleArchitecture`,_=`ClientContext`,v=`CallbackDetails`,y=`ContextDetails`,b=`CreatedDate`,x=`CallbackFailedDetails`,S=`ContextFailedDetails`,C=`ConsumerGroupId`,w=`CallbackId`,ee=`ChainedInvokeDetails`,te=`ChainedInvokeFailedDetails`,T=`ChainedInvokeOptions`,E=`ChainedInvokeStartedDetails`,ne=`ChainedInvokeStoppedDetails`,re=`ChainedInvokeSucceededDetails`,ie=`ChainedInvokeTimedOutDetails`,ae=`CallbackOptions`,oe=`ContextOptions`,se=`CapacityProvider`,ce=`CapacityProviderArn`,le=`CapacityProviderConfig`,ue=`CapacityProviderName`,de=`CapacityProviderScalingConfig`,fe=`CompatibleRuntimes`,pe=`CompatibleRuntime`,me=`CodeSize`,he=`CodeSigningConfig`,ge=`CodeSigningConfigArn`,_e=`CallbackStartedDetails`,ve=`CallbackSucceededDetails`,ye=`ContextStartedDetails`,be=`ContextSucceededDetails`,D=`CodeSigningPolicies`,xe=`CodeSha256`,Se=`CheckpointToken`,Ce=`CallbackTimedOutDetails`,we=`CreationTime`,Te=`Cors`,Ee=`Code`,O=`Content`,De=`Description`,k=`DestinationConfig`,Oe=`DurableConfig`,ke=`DocumentDBEventSourceConfig`,Ae=`DurableExecutions`,je=`DurableExecutionArn`,Me=`DurableExecutionName`,Ne=`DeadLetterConfig`,Pe=`Destination`,Fe=`Duration`,A=`Error`,Ie=`ErrorCode`,Le=`ErrorData`,Re=`ExecutionDetails`,ze=`ExecutionFailedDetails`,Be=`ErrorMessage`,Ve=`EphemeralStorage`,j=`EventSourceArn`,He=`ExecutionStartedDetails`,Ue=`ExecutionSucceededDetails`,We=`ExecutionStoppedDetails`,Ge=`ErrorType`,Ke=`ExecutionTimedOutDetails`,qe=`EndTimestamp`,Je=`ExecutionTimeout`,Ye=`ExecutedVersion`,Xe=`Enabled`,Ze=`Endpoints`,Qe=`Environment`,$e=`Events`,et=`FunctionArn`,tt=`FilterCriteriaError`,nt=`FilterCriteria`,M=`FunctionName`,rt=`FunctionResponseTypes`,it=`FileSystemConfigs`,at=`FunctionScalingConfig`,ot=`FunctionUrl`,st=`FunctionVersion`,ct=`Handler`,lt=`Input`,ut=`Ipv6AllowedForDualStack`,dt=`ImageConfig`,ft=`InvocationCompletedDetails`,pt=`ImageConfigResponse`,mt=`IncludeExecutionData`,ht=`InvokeMode`,gt=`InputPayload`,_t=`InstanceRequirements`,vt=`InvocationType`,yt=`ImageUri`,bt=`KmsKeyArn`,xt=`KMSKeyArn`,St=`Layers`,Ct=`LayerArn`,N=`LoggingConfig`,wt=`LicenseInfo`,Tt=`LastModified`,Et=`LambdaManagedInstancesCapacityProviderConfig`,Dt=`LastModifiedTime`,Ot=`LayerName`,kt=`LogResult`,At=`LogType`,jt=`LayerVersionArn`,Mt=`Location`,Nt=`Message`,Pt=`MaximumBatchingWindowInSeconds`,Ft=`MetricsConfig`,It=`MaximumEventAgeInSeconds`,Lt=`MaxItems`,Rt=`MasterRegion`,zt=`MaximumRetryAttempts`,Bt=`MaximumRecordAgeInSeconds`,Vt=`MemorySize`,Ht=`Marker`,Ut=`Mode`,Wt=`Name`,Gt=`NextAttemptDelaySeconds`,P=`NextMarker`,Kt=`Operations`,qt=`OnFailure`,Jt=`OnSuccess`,Yt=`Principal`,Xt=`PermissionsConfig`,Zt=`ParallelizationFactor`,Qt=`ParentId`,$t=`ProvisionedPollerConfig`,en=`PackageType`,tn=`PublishTo`,nn=`Payload`,rn=`Policy`,F=`Publish`,I=`Qualifier`,an=`Queues`,on=`RoutingConfig`,sn=`ReservedConcurrentExecutions`,cn=`ReplayChildren`,L=`RetryDetails`,ln=`RevisionId`,un=`RecursiveLoop`,dn=`ReverseOrder`,fn=`RequestedProvisionedConcurrentExecutions`,pn=`RuntimeVersionArn`,mn=`RuntimeVersionConfig`,hn=`Result`,gn=`Resource`,_n=`Role`,vn=`Runtime`,yn=`Statement`,bn=`SourceAccessConfigurations`,xn=`StartedAfter`,Sn=`S3Bucket`,Cn=`StartedBefore`,wn=`ScalingConfig`,Tn=`StatusCode`,En=`StepDetails`,Dn=`ScheduledEndTimestamp`,On=`StepFailedDetails`,kn=`SecurityGroupIds`,An=`StatementId`,R=`SubnetIds`,jn=`SigningJobArn`,Mn=`S3Key`,Nn=`SourceKMSKeyArn`,Pn=`SystemLogLevel`,Fn=`SelfManagedEventSource`,In=`SelfManagedKafkaEventSourceConfig`,Ln=`StepOptions`,Rn=`S3ObjectVersion`,zn=`StartingPositionTimestamp`,Bn=`SigningProfileVersionArn`,Vn=`StartingPosition`,Hn=`SchemaRegistryConfig`,Un=`StatusReason`,Wn=`StepStartedDetails`,Gn=`StepSucceededDetails`,Kn=`SnapStart`,qn=`StartTimestamp`,Jn=`SubType`,Yn=`State`,Xn=`Status`,Zn=`Statuses`,z=`Type`,Qn=`TracingConfig`,$n=`TotalCodeSize`,er=`TenancyConfig`,tr=`TagsError`,nr=`TraceHeader`,rr=`TenantId`,ir=`TumblingWindowInSeconds`,ar=`Tags`,or=`Timeout`,sr=`Topics`,cr=`Truncated`,lr=`UpdateRuntimeOn`,ur=`UUID`,dr=`Variables`,fr=`VpcConfig`,pr=`VersionNumber`,mr=`Version`,hr=`WaitCancelledDetails`,gr=`WaitDetails`,_r=`WaitOptions`,vr=`WaitStartedDetails`,yr=`WaitSucceededDetails`,br=`X-Amz-Client-Context`,xr=`X-Amz-Executed-Version`,Sr=`X-Amz-Invocation-Type`,Cr=`X-Amz-Log-Type`,wr=`X-Amz-Tenant-Id`,B=`ZipFile`,Tr=`client`,V=`error`,H=`http`,U=`httpError`,W=`httpHeader`,G=`httpQuery`,K=`message`,q=`smithy.ts.sdk.synthetic.com.amazonaws.lambda`,J=`server`,Er=`streaming`,Y=`com.amazonaws.lambda`,Dr=(Yp(),m(Jp)),X=kP(),Or=OP(),kr=Dr.TypeRegistry.for(q);e.LambdaServiceException$=[-3,q,`LambdaServiceException`,0,[],[]],kr.registerError(e.LambdaServiceException$,Or.LambdaServiceException);let Z=Dr.TypeRegistry.for(Y);e.CallbackTimeoutException$=[-3,Y,`CallbackTimeoutException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.CallbackTimeoutException$,X.CallbackTimeoutException),e.CapacityProviderLimitExceededException$=[-3,Y,`CapacityProviderLimitExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.CapacityProviderLimitExceededException$,X.CapacityProviderLimitExceededException),e.CodeSigningConfigNotFoundException$=[-3,Y,`CodeSigningConfigNotFoundException`,{[V]:Tr,[U]:404},[z,Nt],[0,0]],Z.registerError(e.CodeSigningConfigNotFoundException$,X.CodeSigningConfigNotFoundException),e.CodeStorageExceededException$=[-3,Y,`CodeStorageExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.CodeStorageExceededException$,X.CodeStorageExceededException),e.CodeVerificationFailedException$=[-3,Y,`CodeVerificationFailedException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.CodeVerificationFailedException$,X.CodeVerificationFailedException),e.DurableExecutionAlreadyStartedException$=[-3,Y,`DurableExecutionAlreadyStartedException`,{[V]:Tr,[U]:409},[z,Nt],[0,0]],Z.registerError(e.DurableExecutionAlreadyStartedException$,X.DurableExecutionAlreadyStartedException),e.EC2AccessDeniedException$=[-3,Y,`EC2AccessDeniedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.EC2AccessDeniedException$,X.EC2AccessDeniedException),e.EC2ThrottledException$=[-3,Y,`EC2ThrottledException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.EC2ThrottledException$,X.EC2ThrottledException),e.EC2UnexpectedException$=[-3,Y,`EC2UnexpectedException`,{[V]:J,[U]:502},[z,Nt,`EC2ErrorCode`],[0,0,0]],Z.registerError(e.EC2UnexpectedException$,X.EC2UnexpectedException),e.EFSIOException$=[-3,Y,`EFSIOException`,{[V]:Tr,[U]:410},[z,Nt],[0,0]],Z.registerError(e.EFSIOException$,X.EFSIOException),e.EFSMountConnectivityException$=[-3,Y,`EFSMountConnectivityException`,{[V]:Tr,[U]:408},[z,Nt],[0,0]],Z.registerError(e.EFSMountConnectivityException$,X.EFSMountConnectivityException),e.EFSMountFailureException$=[-3,Y,`EFSMountFailureException`,{[V]:Tr,[U]:403},[z,Nt],[0,0]],Z.registerError(e.EFSMountFailureException$,X.EFSMountFailureException),e.EFSMountTimeoutException$=[-3,Y,`EFSMountTimeoutException`,{[V]:Tr,[U]:408},[z,Nt],[0,0]],Z.registerError(e.EFSMountTimeoutException$,X.EFSMountTimeoutException),e.ENILimitReachedException$=[-3,Y,`ENILimitReachedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.ENILimitReachedException$,X.ENILimitReachedException),e.FunctionVersionsPerCapacityProviderLimitExceededException$=[-3,Y,`FunctionVersionsPerCapacityProviderLimitExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.FunctionVersionsPerCapacityProviderLimitExceededException$,X.FunctionVersionsPerCapacityProviderLimitExceededException),e.InvalidCodeSignatureException$=[-3,Y,`InvalidCodeSignatureException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.InvalidCodeSignatureException$,X.InvalidCodeSignatureException),e.InvalidParameterValueException$=[-3,Y,`InvalidParameterValueException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.InvalidParameterValueException$,X.InvalidParameterValueException),e.InvalidRequestContentException$=[-3,Y,`InvalidRequestContentException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.InvalidRequestContentException$,X.InvalidRequestContentException),e.InvalidRuntimeException$=[-3,Y,`InvalidRuntimeException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidRuntimeException$,X.InvalidRuntimeException),e.InvalidSecurityGroupIDException$=[-3,Y,`InvalidSecurityGroupIDException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidSecurityGroupIDException$,X.InvalidSecurityGroupIDException),e.InvalidSubnetIDException$=[-3,Y,`InvalidSubnetIDException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidSubnetIDException$,X.InvalidSubnetIDException),e.InvalidZipFileException$=[-3,Y,`InvalidZipFileException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidZipFileException$,X.InvalidZipFileException),e.KMSAccessDeniedException$=[-3,Y,`KMSAccessDeniedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSAccessDeniedException$,X.KMSAccessDeniedException),e.KMSDisabledException$=[-3,Y,`KMSDisabledException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSDisabledException$,X.KMSDisabledException),e.KMSInvalidStateException$=[-3,Y,`KMSInvalidStateException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSInvalidStateException$,X.KMSInvalidStateException),e.KMSNotFoundException$=[-3,Y,`KMSNotFoundException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSNotFoundException$,X.KMSNotFoundException),e.NoPublishedVersionException$=[-3,Y,`NoPublishedVersionException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.NoPublishedVersionException$,X.NoPublishedVersionException),e.PolicyLengthExceededException$=[-3,Y,`PolicyLengthExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.PolicyLengthExceededException$,X.PolicyLengthExceededException),e.PreconditionFailedException$=[-3,Y,`PreconditionFailedException`,{[V]:Tr,[U]:412},[z,K],[0,0]],Z.registerError(e.PreconditionFailedException$,X.PreconditionFailedException),e.ProvisionedConcurrencyConfigNotFoundException$=[-3,Y,`ProvisionedConcurrencyConfigNotFoundException`,{[V]:Tr,[U]:404},[z,K],[0,0]],Z.registerError(e.ProvisionedConcurrencyConfigNotFoundException$,X.ProvisionedConcurrencyConfigNotFoundException),e.RecursiveInvocationException$=[-3,Y,`RecursiveInvocationException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.RecursiveInvocationException$,X.RecursiveInvocationException),e.RequestTooLargeException$=[-3,Y,`RequestTooLargeException`,{[V]:Tr,[U]:413},[z,K],[0,0]],Z.registerError(e.RequestTooLargeException$,X.RequestTooLargeException),e.ResourceConflictException$=[-3,Y,`ResourceConflictException`,{[V]:Tr,[U]:409},[z,K],[0,0]],Z.registerError(e.ResourceConflictException$,X.ResourceConflictException),e.ResourceInUseException$=[-3,Y,`ResourceInUseException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.ResourceInUseException$,X.ResourceInUseException),e.ResourceNotFoundException$=[-3,Y,`ResourceNotFoundException`,{[V]:Tr,[U]:404},[z,Nt],[0,0]],Z.registerError(e.ResourceNotFoundException$,X.ResourceNotFoundException),e.ResourceNotReadyException$=[-3,Y,`ResourceNotReadyException`,{[V]:J,[U]:502},[z,K],[0,0]],Z.registerError(e.ResourceNotReadyException$,X.ResourceNotReadyException),e.SerializedRequestEntityTooLargeException$=[-3,Y,`SerializedRequestEntityTooLargeException`,{[V]:Tr,[U]:413},[z,K],[0,0]],Z.registerError(e.SerializedRequestEntityTooLargeException$,X.SerializedRequestEntityTooLargeException),e.ServiceException$=[-3,Y,`ServiceException`,{[V]:J,[U]:500},[z,Nt],[0,0]],Z.registerError(e.ServiceException$,X.ServiceException),e.SnapStartException$=[-3,Y,`SnapStartException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.SnapStartException$,X.SnapStartException),e.SnapStartNotReadyException$=[-3,Y,`SnapStartNotReadyException`,{[V]:Tr,[U]:409},[z,Nt],[0,0]],Z.registerError(e.SnapStartNotReadyException$,X.SnapStartNotReadyException),e.SnapStartTimeoutException$=[-3,Y,`SnapStartTimeoutException`,{[V]:Tr,[U]:408},[z,Nt],[0,0]],Z.registerError(e.SnapStartTimeoutException$,X.SnapStartTimeoutException),e.SubnetIPAddressLimitReachedException$=[-3,Y,`SubnetIPAddressLimitReachedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.SubnetIPAddressLimitReachedException$,X.SubnetIPAddressLimitReachedException),e.TooManyRequestsException$=[-3,Y,`TooManyRequestsException`,{[V]:Tr,[U]:429},[`retryAfterSeconds`,z,K,`Reason`],[[0,{[W]:`Retry-After`}],0,0,0]],Z.registerError(e.TooManyRequestsException$,X.TooManyRequestsException),e.UnsupportedMediaTypeException$=[-3,Y,`UnsupportedMediaTypeException`,{[V]:Tr,[U]:415},[z,K],[0,0]],Z.registerError(e.UnsupportedMediaTypeException$,X.UnsupportedMediaTypeException),e.errorTypeRegistries=[kr,Z];var Ar=[0,Y,`BinaryOperationPayload`,8,21],jr=[0,Y,`Blob`,8,21],Mr=[0,Y,`BlobStream`,{[Er]:1},42],Nr=[0,Y,`EnvironmentVariableName`,8,0],Pr=[0,Y,`EnvironmentVariableValue`,8,0],Fr=[0,Y,Le,8,0],Ir=[0,Y,Be,8,0],Lr=[0,Y,Ge,8,0],Rr=[0,Y,gt,8,0],zr=[0,Y,`OperationPayload`,8,0],Br=[0,Y,`OutputPayload`,8,0],Vr=[0,Y,`SensitiveString`,8,0],Hr=[0,Y,`StackTraceEntry`,8,0];e.AccountLimit$=[3,Y,n,0,[$n,`CodeSizeUnzipped`,`CodeSizeZipped`,`ConcurrentExecutions`,`UnreservedConcurrentExecutions`],[1,1,1,1,1]],e.AccountUsage$=[3,Y,l,0,[$n,`FunctionCount`],[1,1]],e.AddLayerVersionPermissionRequest$=[3,Y,`AddLayerVersionPermissionRequest`,0,[Ot,pr,An,t,Yt,`OrganizationId`,ln],[[0,1],[1,1],0,0,0,0,[0,{[G]:ln}]],5],e.AddLayerVersionPermissionResponse$=[3,Y,`AddLayerVersionPermissionResponse`,0,[yn,ln],[0,0]],e.AddPermissionRequest$=[3,Y,`AddPermissionRequest`,0,[M,An,t,Yt,`SourceArn`,`SourceAccount`,`EventSourceToken`,I,ln,`PrincipalOrgID`,`FunctionUrlAuthType`,`InvokedViaFunctionUrl`],[[0,1],0,0,0,0,0,0,[0,{[G]:I}],0,0,0,2],4],e.AddPermissionResponse$=[3,Y,`AddPermissionResponse`,0,[yn],[0]],e.AliasConfiguration$=[3,Y,`AliasConfiguration`,0,[`AliasArn`,Wt,st,De,on,ln],[0,0,0,0,()=>e.AliasRoutingConfiguration$,0]],e.AliasRoutingConfiguration$=[3,Y,`AliasRoutingConfiguration`,0,[`AdditionalVersionWeights`],[129]],e.AllowedPublishers$=[3,Y,a,0,[`SigningProfileVersionArns`],[64],1],e.AmazonManagedKafkaEventSourceConfig$=[3,Y,r,0,[C,Hn],[0,()=>e.KafkaSchemaRegistryConfig$]],e.CallbackDetails$=[3,Y,v,0,[w,hn,A],[0,[()=>zr,0],[()=>e.ErrorObject$,0]]],e.CallbackFailedDetails$=[3,Y,x,0,[A],[[()=>e.EventError$,0]],1],e.CallbackOptions$=[3,Y,ae,0,[`TimeoutSeconds`,`HeartbeatTimeoutSeconds`],[1,1]],e.CallbackStartedDetails$=[3,Y,_e,0,[w,`HeartbeatTimeout`,or],[0,1,1],1],e.CallbackSucceededDetails$=[3,Y,ve,0,[hn],[[()=>e.EventResult$,0]],1],e.CallbackTimedOutDetails$=[3,Y,Ce,0,[A],[[()=>e.EventError$,0]],1],e.CapacityProvider$=[3,Y,se,0,[ce,Yn,fr,Xt,_t,de,bt,Tt],[0,0,()=>e.CapacityProviderVpcConfig$,()=>e.CapacityProviderPermissionsConfig$,()=>e.InstanceRequirements$,()=>e.CapacityProviderScalingConfig$,0,0],4],e.CapacityProviderConfig$=[3,Y,le,0,[Et],[()=>e.LambdaManagedInstancesCapacityProviderConfig$],1],e.CapacityProviderPermissionsConfig$=[3,Y,`CapacityProviderPermissionsConfig`,0,[`CapacityProviderOperatorRoleArn`],[0],1],e.CapacityProviderScalingConfig$=[3,Y,de,0,[`MaxVCpuCount`,`ScalingMode`,`ScalingPolicies`],[1,0,()=>Gr]],e.CapacityProviderVpcConfig$=[3,Y,`CapacityProviderVpcConfig`,0,[R,kn],[64,64],2],e.ChainedInvokeDetails$=[3,Y,ee,0,[hn,A],[[()=>zr,0],[()=>e.ErrorObject$,0]]],e.ChainedInvokeFailedDetails$=[3,Y,te,0,[A],[[()=>e.EventError$,0]],1],e.ChainedInvokeOptions$=[3,Y,T,0,[M,rr],[0,0],1],e.ChainedInvokeStartedDetails$=[3,Y,E,0,[M,rr,lt,Ye,je],[0,0,[()=>e.EventInput$,0],0,0],1],e.ChainedInvokeStoppedDetails$=[3,Y,ne,0,[A],[[()=>e.EventError$,0]],1],e.ChainedInvokeSucceededDetails$=[3,Y,re,0,[hn],[[()=>e.EventResult$,0]],1],e.ChainedInvokeTimedOutDetails$=[3,Y,ie,0,[A],[[()=>e.EventError$,0]],1],e.CheckpointDurableExecutionRequest$=[3,Y,`CheckpointDurableExecutionRequest`,0,[je,Se,`Updates`,`ClientToken`],[[0,1],0,[()=>li,0],[0,4]],2],e.CheckpointDurableExecutionResponse$=[3,Y,`CheckpointDurableExecutionResponse`,0,[`NewExecutionState`,Se],[[()=>e.CheckpointUpdatedExecutionState$,0],0],1],e.CheckpointUpdatedExecutionState$=[3,Y,`CheckpointUpdatedExecutionState`,0,[Kt,P],[[()=>ci,0],0]],e.CodeSigningConfig$=[3,Y,he,0,[`CodeSigningConfigId`,ge,a,D,Tt,De],[0,0,()=>e.AllowedPublishers$,()=>e.CodeSigningPolicies$,0,0],5],e.CodeSigningPolicies$=[3,Y,D,0,[`UntrustedArtifactOnDeployment`],[0]],e.Concurrency$=[3,Y,p,0,[sn],[1]],e.ContextDetails$=[3,Y,y,0,[cn,hn,A],[2,[()=>zr,0],[()=>e.ErrorObject$,0]]],e.ContextFailedDetails$=[3,Y,S,0,[A],[[()=>e.EventError$,0]],1],e.ContextOptions$=[3,Y,oe,0,[cn],[2]],e.ContextStartedDetails$=[3,Y,ye,0,[],[]],e.ContextSucceededDetails$=[3,Y,be,0,[hn],[[()=>e.EventResult$,0]],1],e.Cors$=[3,Y,Te,0,[`AllowCredentials`,`AllowHeaders`,`AllowMethods`,`AllowOrigins`,`ExposeHeaders`,`MaxAge`],[2,64,64,64,64,1]],e.CreateAliasRequest$=[3,Y,`CreateAliasRequest`,0,[M,Wt,st,De,on],[[0,1],0,0,0,()=>e.AliasRoutingConfiguration$],3],e.CreateCapacityProviderRequest$=[3,Y,`CreateCapacityProviderRequest`,0,[ue,fr,Xt,_t,de,bt,ar],[0,()=>e.CapacityProviderVpcConfig$,()=>e.CapacityProviderPermissionsConfig$,()=>e.InstanceRequirements$,()=>e.CapacityProviderScalingConfig$,0,128],3],e.CreateCapacityProviderResponse$=[3,Y,`CreateCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.CreateCodeSigningConfigRequest$=[3,Y,`CreateCodeSigningConfigRequest`,0,[a,De,D,ar],[()=>e.AllowedPublishers$,0,()=>e.CodeSigningPolicies$,128],1],e.CreateCodeSigningConfigResponse$=[3,Y,`CreateCodeSigningConfigResponse`,0,[he],[()=>e.CodeSigningConfig$],1],e.CreateEventSourceMappingRequest$=[3,Y,`CreateEventSourceMappingRequest`,0,[M,j,Xe,f,nt,Pt,Zt,Vn,zn,k,Bt,d,zt,ar,ir,sr,an,bn,Fn,rt,r,In,wn,ke,xt,Ft,N,$t],[0,0,2,1,()=>e.FilterCriteria$,1,1,0,4,()=>e.DestinationConfig$,1,2,1,128,1,64,64,()=>di,()=>e.SelfManagedEventSource$,64,()=>e.AmazonManagedKafkaEventSourceConfig$,()=>e.SelfManagedKafkaEventSourceConfig$,()=>e.ScalingConfig$,()=>e.DocumentDBEventSourceConfig$,0,()=>e.EventSourceMappingMetricsConfig$,()=>e.EventSourceMappingLoggingConfig$,()=>e.ProvisionedPollerConfig$],1],e.CreateFunctionRequest$=[3,Y,`CreateFunctionRequest`,0,[M,_n,Ee,vn,ct,De,or,Vt,F,fr,en,Ne,Qe,xt,Qn,ar,St,it,dt,ge,u,Ve,Kn,N,le,tn,Oe,er],[0,0,[()=>e.FunctionCode$,0],0,0,0,1,1,2,()=>e.VpcConfig$,0,()=>e.DeadLetterConfig$,[()=>e.Environment$,0],0,()=>e.TracingConfig$,128,64,()=>Zr,()=>e.ImageConfig$,0,64,()=>e.EphemeralStorage$,()=>e.SnapStart$,()=>e.LoggingConfig$,()=>e.CapacityProviderConfig$,0,()=>e.DurableConfig$,()=>e.TenancyConfig$],3],e.CreateFunctionUrlConfigRequest$=[3,Y,`CreateFunctionUrlConfigRequest`,0,[M,c,I,Te,ht],[[0,1],0,[0,{[G]:I}],()=>e.Cors$,0],2],e.CreateFunctionUrlConfigResponse$=[3,Y,`CreateFunctionUrlConfigResponse`,0,[ot,et,c,we,Te,ht],[0,0,0,0,()=>e.Cors$,0],4],e.DeadLetterConfig$=[3,Y,Ne,0,[`TargetArn`],[0]],e.DeleteAliasRequest$=[3,Y,`DeleteAliasRequest`,0,[M,Wt],[[0,1],[0,1]],2],e.DeleteCapacityProviderRequest$=[3,Y,`DeleteCapacityProviderRequest`,0,[ue],[[0,1]],1],e.DeleteCapacityProviderResponse$=[3,Y,`DeleteCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.DeleteCodeSigningConfigRequest$=[3,Y,`DeleteCodeSigningConfigRequest`,0,[ge],[[0,1]],1],e.DeleteCodeSigningConfigResponse$=[3,Y,`DeleteCodeSigningConfigResponse`,0,[],[]],e.DeleteEventSourceMappingRequest$=[3,Y,`DeleteEventSourceMappingRequest`,0,[ur],[[0,1]],1],e.DeleteFunctionCodeSigningConfigRequest$=[3,Y,`DeleteFunctionCodeSigningConfigRequest`,0,[M],[[0,1]],1],e.DeleteFunctionConcurrencyRequest$=[3,Y,`DeleteFunctionConcurrencyRequest`,0,[M],[[0,1]],1],e.DeleteFunctionEventInvokeConfigRequest$=[3,Y,`DeleteFunctionEventInvokeConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.DeleteFunctionRequest$=[3,Y,`DeleteFunctionRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.DeleteFunctionResponse$=[3,Y,`DeleteFunctionResponse`,0,[Tn],[[1,32]]],e.DeleteFunctionUrlConfigRequest$=[3,Y,`DeleteFunctionUrlConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.DeleteLayerVersionRequest$=[3,Y,`DeleteLayerVersionRequest`,0,[Ot,pr],[[0,1],[1,1]],2],e.DeleteProvisionedConcurrencyConfigRequest$=[3,Y,`DeleteProvisionedConcurrencyConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],2],e.DestinationConfig$=[3,Y,k,0,[Jt,qt],[()=>e.OnSuccess$,()=>e.OnFailure$]],e.DocumentDBEventSourceConfig$=[3,Y,ke,0,[`DatabaseName`,`CollectionName`,`FullDocument`],[0,0,0]],e.DurableConfig$=[3,Y,Oe,0,[`RetentionPeriodInDays`,Je],[1,1]],e.Environment$=[3,Y,Qe,0,[dr],[[()=>pi,0]]],e.EnvironmentError$=[3,Y,`EnvironmentError`,0,[Ie,Nt],[0,[()=>Vr,0]]],e.EnvironmentResponse$=[3,Y,`EnvironmentResponse`,0,[dr,A],[[()=>pi,0],[()=>e.EnvironmentError$,0]]],e.EphemeralStorage$=[3,Y,Ve,0,[`Size`],[1],1],e.ErrorObject$=[3,Y,`ErrorObject`,0,[Be,Ge,Le,`StackTrace`],[[()=>Ir,0],[()=>Lr,0],[()=>Fr,0],[()=>fi,0]]],e.Event$=[3,Y,`Event`,0,[`EventType`,Jn,`EventId`,`Id`,Wt,`EventTimestamp`,Qt,He,Ue,ze,Ke,We,ye,be,S,vr,yr,hr,Wn,Gn,On,E,re,te,ie,ne,_e,ve,x,Ce,ft],[0,0,1,0,0,4,0,[()=>e.ExecutionStartedDetails$,0],[()=>e.ExecutionSucceededDetails$,0],[()=>e.ExecutionFailedDetails$,0],[()=>e.ExecutionTimedOutDetails$,0],[()=>e.ExecutionStoppedDetails$,0],()=>e.ContextStartedDetails$,[()=>e.ContextSucceededDetails$,0],[()=>e.ContextFailedDetails$,0],()=>e.WaitStartedDetails$,()=>e.WaitSucceededDetails$,[()=>e.WaitCancelledDetails$,0],()=>e.StepStartedDetails$,[()=>e.StepSucceededDetails$,0],[()=>e.StepFailedDetails$,0],[()=>e.ChainedInvokeStartedDetails$,0],[()=>e.ChainedInvokeSucceededDetails$,0],[()=>e.ChainedInvokeFailedDetails$,0],[()=>e.ChainedInvokeTimedOutDetails$,0],[()=>e.ChainedInvokeStoppedDetails$,0],()=>e.CallbackStartedDetails$,[()=>e.CallbackSucceededDetails$,0],[()=>e.CallbackFailedDetails$,0],[()=>e.CallbackTimedOutDetails$,0],[()=>e.InvocationCompletedDetails$,0]]],e.EventError$=[3,Y,`EventError`,0,[nn,cr],[[()=>e.ErrorObject$,0],2]],e.EventInput$=[3,Y,`EventInput`,0,[nn,cr],[[()=>Rr,0],2]],e.EventResult$=[3,Y,`EventResult`,0,[nn,cr],[[()=>zr,0],2]],e.EventSourceMappingConfiguration$=[3,Y,`EventSourceMappingConfiguration`,0,[ur,Vn,zn,f,Pt,Zt,j,nt,et,Tt,`LastProcessingResult`,Yn,`StateTransitionReason`,k,sr,an,bn,Fn,Bt,d,zt,ir,rt,r,In,wn,ke,xt,tt,`EventSourceMappingArn`,Ft,N,$t],[0,0,4,1,1,1,0,()=>e.FilterCriteria$,0,4,0,0,0,()=>e.DestinationConfig$,64,64,()=>di,()=>e.SelfManagedEventSource$,1,2,1,1,64,()=>e.AmazonManagedKafkaEventSourceConfig$,()=>e.SelfManagedKafkaEventSourceConfig$,()=>e.ScalingConfig$,()=>e.DocumentDBEventSourceConfig$,0,()=>e.FilterCriteriaError$,0,()=>e.EventSourceMappingMetricsConfig$,()=>e.EventSourceMappingLoggingConfig$,()=>e.ProvisionedPollerConfig$]],e.EventSourceMappingLoggingConfig$=[3,Y,`EventSourceMappingLoggingConfig`,0,[Pn],[0]],e.EventSourceMappingMetricsConfig$=[3,Y,`EventSourceMappingMetricsConfig`,0,[`Metrics`],[64]],e.Execution$=[3,Y,`Execution`,0,[je,Me,et,Xn,qn,qe],[0,0,0,0,4,4],5],e.ExecutionDetails$=[3,Y,Re,0,[gt],[[()=>Rr,0]]],e.ExecutionFailedDetails$=[3,Y,ze,0,[A],[[()=>e.EventError$,0]],1],e.ExecutionStartedDetails$=[3,Y,He,0,[lt,Je],[[()=>e.EventInput$,0],1],2],e.ExecutionStoppedDetails$=[3,Y,We,0,[A],[[()=>e.EventError$,0]],1],e.ExecutionSucceededDetails$=[3,Y,Ue,0,[hn],[[()=>e.EventResult$,0]],1],e.ExecutionTimedOutDetails$=[3,Y,Ke,0,[A],[[()=>e.EventError$,0]]],e.FileSystemConfig$=[3,Y,`FileSystemConfig`,0,[`Arn`,`LocalMountPath`],[0,0],2],e.Filter$=[3,Y,`Filter`,0,[`Pattern`],[0]],e.FilterCriteria$=[3,Y,nt,0,[`Filters`],[()=>Qr]],e.FilterCriteriaError$=[3,Y,tt,0,[Ie,Nt],[0,0]],e.FunctionCode$=[3,Y,`FunctionCode`,0,[B,Sn,Mn,Rn,yt,Nn],[[()=>jr,0],0,0,0,0,0]],e.FunctionCodeLocation$=[3,Y,`FunctionCodeLocation`,0,[`RepositoryType`,Mt,yt,`ResolvedImageUri`,Nn],[0,0,0,0,0]],e.FunctionConfiguration$=[3,Y,`FunctionConfiguration`,0,[M,et,vn,_n,ct,me,De,or,Vt,Tt,xe,mr,fr,Ne,Qe,xt,Qn,`MasterArn`,ln,St,Yn,`StateReason`,`StateReasonCode`,`LastUpdateStatus`,`LastUpdateStatusReason`,`LastUpdateStatusReasonCode`,it,en,pt,Bn,jn,u,Ve,Kn,mn,N,le,`ConfigSha256`,Oe,er],[0,0,0,0,0,1,0,1,1,0,0,0,()=>e.VpcConfigResponse$,()=>e.DeadLetterConfig$,[()=>e.EnvironmentResponse$,0],0,()=>e.TracingConfigResponse$,0,0,()=>oi,0,0,0,0,0,0,()=>Zr,0,[()=>e.ImageConfigResponse$,0],0,0,64,()=>e.EphemeralStorage$,()=>e.SnapStartResponse$,[()=>e.RuntimeVersionConfig$,0],()=>e.LoggingConfig$,()=>e.CapacityProviderConfig$,0,()=>e.DurableConfig$,()=>e.TenancyConfig$]],e.FunctionEventInvokeConfig$=[3,Y,`FunctionEventInvokeConfig`,0,[Tt,et,zt,It,k],[4,0,1,1,()=>e.DestinationConfig$]],e.FunctionScalingConfig$=[3,Y,at,0,[`MinExecutionEnvironments`,`MaxExecutionEnvironments`],[1,1]],e.FunctionUrlConfig$=[3,Y,`FunctionUrlConfig`,0,[ot,et,we,Dt,c,Te,ht],[0,0,0,0,0,()=>e.Cors$,0],5],e.FunctionVersionsByCapacityProviderListItem$=[3,Y,`FunctionVersionsByCapacityProviderListItem`,0,[et,Yn],[0,0],2],e.GetAccountSettingsRequest$=[3,Y,`GetAccountSettingsRequest`,0,[],[]],e.GetAccountSettingsResponse$=[3,Y,`GetAccountSettingsResponse`,0,[n,l],[()=>e.AccountLimit$,()=>e.AccountUsage$]],e.GetAliasRequest$=[3,Y,`GetAliasRequest`,0,[M,Wt],[[0,1],[0,1]],2],e.GetCapacityProviderRequest$=[3,Y,`GetCapacityProviderRequest`,0,[ue],[[0,1]],1],e.GetCapacityProviderResponse$=[3,Y,`GetCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.GetCodeSigningConfigRequest$=[3,Y,`GetCodeSigningConfigRequest`,0,[ge],[[0,1]],1],e.GetCodeSigningConfigResponse$=[3,Y,`GetCodeSigningConfigResponse`,0,[he],[()=>e.CodeSigningConfig$],1],e.GetDurableExecutionHistoryRequest$=[3,Y,`GetDurableExecutionHistoryRequest`,0,[je,mt,Lt,Ht,dn],[[0,1],[2,{[G]:mt}],[1,{[G]:Lt}],[0,{[G]:Ht}],[2,{[G]:dn}]],1],e.GetDurableExecutionHistoryResponse$=[3,Y,`GetDurableExecutionHistoryResponse`,0,[$e,P],[[()=>Yr,0],0],1],e.GetDurableExecutionRequest$=[3,Y,`GetDurableExecutionRequest`,0,[je],[[0,1]],1],e.GetDurableExecutionResponse$=[3,Y,`GetDurableExecutionResponse`,0,[je,Me,et,qn,Xn,gt,hn,A,qe,mr,nr],[0,0,0,4,0,[()=>Rr,0],[()=>Br,0],[()=>e.ErrorObject$,0],4,0,()=>e.TraceHeader$],5],e.GetDurableExecutionStateRequest$=[3,Y,`GetDurableExecutionStateRequest`,0,[je,Se,Ht,Lt],[[0,1],[0,{[G]:Se}],[0,{[G]:Ht}],[1,{[G]:Lt}]],2],e.GetDurableExecutionStateResponse$=[3,Y,`GetDurableExecutionStateResponse`,0,[Kt,P],[[()=>ci,0],0],1],e.GetEventSourceMappingRequest$=[3,Y,`GetEventSourceMappingRequest`,0,[ur],[[0,1]],1],e.GetFunctionCodeSigningConfigRequest$=[3,Y,`GetFunctionCodeSigningConfigRequest`,0,[M],[[0,1]],1],e.GetFunctionCodeSigningConfigResponse$=[3,Y,`GetFunctionCodeSigningConfigResponse`,0,[ge,M],[0,0],2],e.GetFunctionConcurrencyRequest$=[3,Y,`GetFunctionConcurrencyRequest`,0,[M],[[0,1]],1],e.GetFunctionConcurrencyResponse$=[3,Y,`GetFunctionConcurrencyResponse`,0,[sn],[1]],e.GetFunctionConfigurationRequest$=[3,Y,`GetFunctionConfigurationRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionEventInvokeConfigRequest$=[3,Y,`GetFunctionEventInvokeConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionRecursionConfigRequest$=[3,Y,`GetFunctionRecursionConfigRequest`,0,[M],[[0,1]],1],e.GetFunctionRecursionConfigResponse$=[3,Y,`GetFunctionRecursionConfigResponse`,0,[un],[0]],e.GetFunctionRequest$=[3,Y,`GetFunctionRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionResponse$=[3,Y,`GetFunctionResponse`,0,[`Configuration`,Ee,ar,tr,p],[[()=>e.FunctionConfiguration$,0],()=>e.FunctionCodeLocation$,128,()=>e.TagsError$,()=>e.Concurrency$]],e.GetFunctionScalingConfigRequest$=[3,Y,`GetFunctionScalingConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],2],e.GetFunctionScalingConfigResponse$=[3,Y,`GetFunctionScalingConfigResponse`,0,[et,`AppliedFunctionScalingConfig`,`RequestedFunctionScalingConfig`],[0,()=>e.FunctionScalingConfig$,()=>e.FunctionScalingConfig$]],e.GetFunctionUrlConfigRequest$=[3,Y,`GetFunctionUrlConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionUrlConfigResponse$=[3,Y,`GetFunctionUrlConfigResponse`,0,[ot,et,c,we,Dt,Te,ht],[0,0,0,0,0,()=>e.Cors$,0],5],e.GetLayerVersionByArnRequest$=[3,Y,`GetLayerVersionByArnRequest`,0,[`Arn`],[[0,{[G]:`Arn`}]],1],e.GetLayerVersionPolicyRequest$=[3,Y,`GetLayerVersionPolicyRequest`,0,[Ot,pr],[[0,1],[1,1]],2],e.GetLayerVersionPolicyResponse$=[3,Y,`GetLayerVersionPolicyResponse`,0,[rn,ln],[0,0]],e.GetLayerVersionRequest$=[3,Y,`GetLayerVersionRequest`,0,[Ot,pr],[[0,1],[1,1]],2],e.GetLayerVersionResponse$=[3,Y,`GetLayerVersionResponse`,0,[O,Ct,jt,De,b,mr,fe,wt,h],[()=>e.LayerVersionContentOutput$,0,0,0,0,1,64,0,64]],e.GetPolicyRequest$=[3,Y,`GetPolicyRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetPolicyResponse$=[3,Y,`GetPolicyResponse`,0,[rn,ln],[0,0]],e.GetProvisionedConcurrencyConfigRequest$=[3,Y,`GetProvisionedConcurrencyConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],2],e.GetProvisionedConcurrencyConfigResponse$=[3,Y,`GetProvisionedConcurrencyConfigResponse`,0,[fn,o,s,Xn,Un,Tt],[1,1,1,0,0,0]],e.GetRuntimeManagementConfigRequest$=[3,Y,`GetRuntimeManagementConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetRuntimeManagementConfigResponse$=[3,Y,`GetRuntimeManagementConfigResponse`,0,[lr,pn,et],[0,0,0]],e.ImageConfig$=[3,Y,dt,0,[`EntryPoint`,`Command`,`WorkingDirectory`],[64,64,0]],e.ImageConfigError$=[3,Y,`ImageConfigError`,0,[Ie,Nt],[0,[()=>Vr,0]]],e.ImageConfigResponse$=[3,Y,pt,0,[dt,A],[()=>e.ImageConfig$,[()=>e.ImageConfigError$,0]]],e.InstanceRequirements$=[3,Y,_t,0,[u,`AllowedInstanceTypes`,`ExcludedInstanceTypes`],[64,64,64]],e.InvocationCompletedDetails$=[3,Y,ft,0,[qn,qe,`RequestId`,A],[4,4,0,[()=>e.EventError$,0]],3],e.InvocationRequest$=[3,Y,`InvocationRequest`,0,[M,vt,At,_,Me,nn,I,rr],[[0,1],[0,{[W]:Sr}],[0,{[W]:Cr}],[0,{[W]:br}],[0,{[W]:`X-Amz-Durable-Execution-Name`}],[()=>jr,16],[0,{[G]:I}],[0,{[W]:wr}]],1],e.InvocationResponse$=[3,Y,`InvocationResponse`,0,[Tn,`FunctionError`,kt,nn,Ye,je],[[1,32],[0,{[W]:`X-Amz-Function-Error`}],[0,{[W]:`X-Amz-Log-Result`}],[()=>jr,16],[0,{[W]:xr}],[0,{[W]:`X-Amz-Durable-Execution-Arn`}]]],e.InvokeAsyncRequest$=[3,Y,`InvokeAsyncRequest`,0,[M,`InvokeArgs`],[[0,1],[()=>Mr,16]],2],e.InvokeAsyncResponse$=[3,Y,`InvokeAsyncResponse`,0,[Xn],[[1,32]]],e.InvokeResponseStreamUpdate$=[3,Y,`InvokeResponseStreamUpdate`,0,[nn],[[()=>jr,{eventPayload:1}]]],e.InvokeWithResponseStreamCompleteEvent$=[3,Y,`InvokeWithResponseStreamCompleteEvent`,0,[Ie,`ErrorDetails`,kt],[0,0,0]],e.InvokeWithResponseStreamRequest$=[3,Y,`InvokeWithResponseStreamRequest`,0,[M,vt,At,_,I,nn,rr],[[0,1],[0,{[W]:Sr}],[0,{[W]:Cr}],[0,{[W]:br}],[0,{[G]:I}],[()=>jr,16],[0,{[W]:wr}]],1],e.InvokeWithResponseStreamResponse$=[3,Y,`InvokeWithResponseStreamResponse`,0,[Tn,Ye,`EventStream`,`ResponseStreamContentType`],[[1,32],[0,{[W]:xr}],[()=>e.InvokeWithResponseStreamResponseEvent$,16],[0,{[W]:`Content-Type`}]]],e.KafkaSchemaRegistryAccessConfig$=[3,Y,`KafkaSchemaRegistryAccessConfig`,0,[z,`URI`],[0,0]],e.KafkaSchemaRegistryConfig$=[3,Y,`KafkaSchemaRegistryConfig`,0,[`SchemaRegistryURI`,`EventRecordFormat`,`AccessConfigs`,`SchemaValidationConfigs`],[0,0,()=>ri,()=>ii]],e.KafkaSchemaValidationConfig$=[3,Y,`KafkaSchemaValidationConfig`,0,[`Attribute`],[0]],e.LambdaManagedInstancesCapacityProviderConfig$=[3,Y,Et,0,[ce,`PerExecutionEnvironmentMaxConcurrency`,`ExecutionEnvironmentMemoryGiBPerVCpu`],[0,1,1],1],e.Layer$=[3,Y,`Layer`,0,[`Arn`,me,Bn,jn],[0,1,0,0]],e.LayersListItem$=[3,Y,`LayersListItem`,0,[Ot,Ct,`LatestMatchingVersion`],[0,0,()=>e.LayerVersionsListItem$]],e.LayerVersionContentInput$=[3,Y,`LayerVersionContentInput`,0,[Sn,Mn,Rn,B],[0,0,0,[()=>jr,0]]],e.LayerVersionContentOutput$=[3,Y,`LayerVersionContentOutput`,0,[Mt,xe,me,Bn,jn],[0,0,1,0,0]],e.LayerVersionsListItem$=[3,Y,`LayerVersionsListItem`,0,[jt,mr,De,b,fe,wt,h],[0,1,0,0,64,0,64]],e.ListAliasesRequest$=[3,Y,`ListAliasesRequest`,0,[M,st,Ht,Lt],[[0,1],[0,{[G]:st}],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListAliasesResponse$=[3,Y,`ListAliasesResponse`,0,[P,`Aliases`],[0,()=>Wr]],e.ListCapacityProvidersRequest$=[3,Y,`ListCapacityProvidersRequest`,0,[Yn,Ht,Lt],[[0,{[G]:Yn}],[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListCapacityProvidersResponse$=[3,Y,`ListCapacityProvidersResponse`,0,[`CapacityProviders`,P],[()=>Kr,0],1],e.ListCodeSigningConfigsRequest$=[3,Y,`ListCodeSigningConfigsRequest`,0,[Ht,Lt],[[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListCodeSigningConfigsResponse$=[3,Y,`ListCodeSigningConfigsResponse`,0,[P,`CodeSigningConfigs`],[0,()=>qr]],e.ListDurableExecutionsByFunctionRequest$=[3,Y,`ListDurableExecutionsByFunctionRequest`,0,[M,I,Me,Zn,xn,Cn,dn,Ht,Lt],[[0,1],[0,{[G]:I}],[0,{[G]:Me}],[64,{[G]:Zn}],[4,{[G]:xn}],[4,{[G]:Cn}],[2,{[G]:dn}],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListDurableExecutionsByFunctionResponse$=[3,Y,`ListDurableExecutionsByFunctionResponse`,0,[Ae,P],[()=>Jr,0]],e.ListEventSourceMappingsRequest$=[3,Y,`ListEventSourceMappingsRequest`,0,[j,M,Ht,Lt],[[0,{[G]:j}],[0,{[G]:M}],[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListEventSourceMappingsResponse$=[3,Y,`ListEventSourceMappingsResponse`,0,[P,`EventSourceMappings`],[0,()=>Xr]],e.ListFunctionEventInvokeConfigsRequest$=[3,Y,`ListFunctionEventInvokeConfigsRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionEventInvokeConfigsResponse$=[3,Y,`ListFunctionEventInvokeConfigsResponse`,0,[`FunctionEventInvokeConfigs`,P],[()=>$r,0]],e.ListFunctionsByCodeSigningConfigRequest$=[3,Y,`ListFunctionsByCodeSigningConfigRequest`,0,[ge,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionsByCodeSigningConfigResponse$=[3,Y,`ListFunctionsByCodeSigningConfigResponse`,0,[P,`FunctionArns`],[0,64]],e.ListFunctionsRequest$=[3,Y,`ListFunctionsRequest`,0,[Rt,st,Ht,Lt],[[0,{[G]:Rt}],[0,{[G]:st}],[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListFunctionsResponse$=[3,Y,`ListFunctionsResponse`,0,[P,`Functions`],[0,[()=>ei,0]]],e.ListFunctionUrlConfigsRequest$=[3,Y,`ListFunctionUrlConfigsRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionUrlConfigsResponse$=[3,Y,`ListFunctionUrlConfigsResponse`,0,[`FunctionUrlConfigs`,P],[()=>ti,0],1],e.ListFunctionVersionsByCapacityProviderRequest$=[3,Y,`ListFunctionVersionsByCapacityProviderRequest`,0,[ue,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionVersionsByCapacityProviderResponse$=[3,Y,`ListFunctionVersionsByCapacityProviderResponse`,0,[ce,`FunctionVersions`,P],[0,()=>ni,0],2],e.ListLayersRequest$=[3,Y,`ListLayersRequest`,0,[pe,Ht,Lt,g],[[0,{[G]:pe}],[0,{[G]:Ht}],[1,{[G]:Lt}],[0,{[G]:g}]]],e.ListLayersResponse$=[3,Y,`ListLayersResponse`,0,[P,St],[0,()=>ai]],e.ListLayerVersionsRequest$=[3,Y,`ListLayerVersionsRequest`,0,[Ot,pe,Ht,Lt,g],[[0,1],[0,{[G]:pe}],[0,{[G]:Ht}],[1,{[G]:Lt}],[0,{[G]:g}]],1],e.ListLayerVersionsResponse$=[3,Y,`ListLayerVersionsResponse`,0,[P,`LayerVersions`],[0,()=>si]],e.ListProvisionedConcurrencyConfigsRequest$=[3,Y,`ListProvisionedConcurrencyConfigsRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListProvisionedConcurrencyConfigsResponse$=[3,Y,`ListProvisionedConcurrencyConfigsResponse`,0,[`ProvisionedConcurrencyConfigs`,P],[()=>ui,0]],e.ListTagsRequest$=[3,Y,`ListTagsRequest`,0,[gn],[[0,1]],1],e.ListTagsResponse$=[3,Y,`ListTagsResponse`,0,[ar],[128]],e.ListVersionsByFunctionRequest$=[3,Y,`ListVersionsByFunctionRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListVersionsByFunctionResponse$=[3,Y,`ListVersionsByFunctionResponse`,0,[P,`Versions`],[0,[()=>ei,0]]],e.LoggingConfig$=[3,Y,N,0,[`LogFormat`,`ApplicationLogLevel`,Pn,`LogGroup`],[0,0,0,0]],e.OnFailure$=[3,Y,qt,0,[Pe],[0]],e.OnSuccess$=[3,Y,Jt,0,[Pe],[0]],e.Operation$=[3,Y,`Operation`,0,[`Id`,z,qn,Xn,Qt,Wt,Jn,qe,Re,y,En,gr,v,ee],[0,0,4,0,0,0,0,4,[()=>e.ExecutionDetails$,0],[()=>e.ContextDetails$,0],[()=>e.StepDetails$,0],()=>e.WaitDetails$,[()=>e.CallbackDetails$,0],[()=>e.ChainedInvokeDetails$,0]],4],e.OperationUpdate$=[3,Y,`OperationUpdate`,0,[`Id`,z,t,Qt,Wt,Jn,nn,A,oe,Ln,_r,ae,T],[0,0,0,0,0,0,[()=>zr,0],[()=>e.ErrorObject$,0],()=>e.ContextOptions$,()=>e.StepOptions$,()=>e.WaitOptions$,()=>e.CallbackOptions$,()=>e.ChainedInvokeOptions$],3],e.ProvisionedConcurrencyConfigListItem$=[3,Y,`ProvisionedConcurrencyConfigListItem`,0,[et,fn,o,s,Xn,Un,Tt],[0,1,1,1,0,0,0]],e.ProvisionedPollerConfig$=[3,Y,$t,0,[`MinimumPollers`,`MaximumPollers`,`PollerGroupName`],[1,1,0]],e.PublishLayerVersionRequest$=[3,Y,`PublishLayerVersionRequest`,0,[Ot,O,De,fe,wt,h],[[0,1],[()=>e.LayerVersionContentInput$,0],0,64,0,64],2],e.PublishLayerVersionResponse$=[3,Y,`PublishLayerVersionResponse`,0,[O,Ct,jt,De,b,mr,fe,wt,h],[()=>e.LayerVersionContentOutput$,0,0,0,0,1,64,0,64]],e.PublishVersionRequest$=[3,Y,`PublishVersionRequest`,0,[M,xe,De,ln,tn],[[0,1],0,0,0,0],1],e.PutFunctionCodeSigningConfigRequest$=[3,Y,`PutFunctionCodeSigningConfigRequest`,0,[ge,M],[0,[0,1]],2],e.PutFunctionCodeSigningConfigResponse$=[3,Y,`PutFunctionCodeSigningConfigResponse`,0,[ge,M],[0,0],2],e.PutFunctionConcurrencyRequest$=[3,Y,`PutFunctionConcurrencyRequest`,0,[M,sn],[[0,1],1],2],e.PutFunctionEventInvokeConfigRequest$=[3,Y,`PutFunctionEventInvokeConfigRequest`,0,[M,I,zt,It,k],[[0,1],[0,{[G]:I}],1,1,()=>e.DestinationConfig$],1],e.PutFunctionRecursionConfigRequest$=[3,Y,`PutFunctionRecursionConfigRequest`,0,[M,un],[[0,1],0],2],e.PutFunctionRecursionConfigResponse$=[3,Y,`PutFunctionRecursionConfigResponse`,0,[un],[0]],e.PutFunctionScalingConfigRequest$=[3,Y,`PutFunctionScalingConfigRequest`,0,[M,I,at],[[0,1],[0,{[G]:I}],()=>e.FunctionScalingConfig$],2],e.PutFunctionScalingConfigResponse$=[3,Y,`PutFunctionScalingConfigResponse`,0,[`FunctionState`],[0]],e.PutProvisionedConcurrencyConfigRequest$=[3,Y,`PutProvisionedConcurrencyConfigRequest`,0,[M,I,`ProvisionedConcurrentExecutions`],[[0,1],[0,{[G]:I}],1],3],e.PutProvisionedConcurrencyConfigResponse$=[3,Y,`PutProvisionedConcurrencyConfigResponse`,0,[fn,o,s,Xn,Un,Tt],[1,1,1,0,0,0]],e.PutRuntimeManagementConfigRequest$=[3,Y,`PutRuntimeManagementConfigRequest`,0,[M,lr,I,pn],[[0,1],0,[0,{[G]:I}],0],2],e.PutRuntimeManagementConfigResponse$=[3,Y,`PutRuntimeManagementConfigResponse`,0,[lr,et,pn],[0,0,0],2],e.RemoveLayerVersionPermissionRequest$=[3,Y,`RemoveLayerVersionPermissionRequest`,0,[Ot,pr,An,ln],[[0,1],[1,1],[0,1],[0,{[G]:ln}]],3],e.RemovePermissionRequest$=[3,Y,`RemovePermissionRequest`,0,[M,An,I,ln],[[0,1],[0,1],[0,{[G]:I}],[0,{[G]:ln}]],2],e.RetryDetails$=[3,Y,L,0,[`CurrentAttempt`,Gt],[1,1]],e.RuntimeVersionConfig$=[3,Y,mn,0,[pn,A],[0,[()=>e.RuntimeVersionError$,0]]],e.RuntimeVersionError$=[3,Y,`RuntimeVersionError`,0,[Ie,Nt],[0,[()=>Vr,0]]],e.ScalingConfig$=[3,Y,wn,0,[`MaximumConcurrency`],[1]],e.SelfManagedEventSource$=[3,Y,Fn,0,[Ze],[[2,Y,Ze,0,0,64]]],e.SelfManagedKafkaEventSourceConfig$=[3,Y,In,0,[C,Hn],[0,()=>e.KafkaSchemaRegistryConfig$]],e.SendDurableExecutionCallbackFailureRequest$=[3,Y,`SendDurableExecutionCallbackFailureRequest`,0,[w,A],[[0,1],[()=>e.ErrorObject$,16]],1],e.SendDurableExecutionCallbackFailureResponse$=[3,Y,`SendDurableExecutionCallbackFailureResponse`,0,[],[]],e.SendDurableExecutionCallbackHeartbeatRequest$=[3,Y,`SendDurableExecutionCallbackHeartbeatRequest`,0,[w],[[0,1]],1],e.SendDurableExecutionCallbackHeartbeatResponse$=[3,Y,`SendDurableExecutionCallbackHeartbeatResponse`,0,[],[]],e.SendDurableExecutionCallbackSuccessRequest$=[3,Y,`SendDurableExecutionCallbackSuccessRequest`,0,[w,hn],[[0,1],[()=>Ar,16]],1],e.SendDurableExecutionCallbackSuccessResponse$=[3,Y,`SendDurableExecutionCallbackSuccessResponse`,0,[],[]],e.SnapStart$=[3,Y,Kn,0,[i],[0]],e.SnapStartResponse$=[3,Y,`SnapStartResponse`,0,[i,`OptimizationStatus`],[0,0]],e.SourceAccessConfiguration$=[3,Y,`SourceAccessConfiguration`,0,[z,`URI`],[0,0]],e.StepDetails$=[3,Y,En,0,[`Attempt`,`NextAttemptTimestamp`,hn,A],[1,4,[()=>zr,0],[()=>e.ErrorObject$,0]]],e.StepFailedDetails$=[3,Y,On,0,[A,L],[[()=>e.EventError$,0],()=>e.RetryDetails$],2],e.StepOptions$=[3,Y,Ln,0,[Gt],[1]],e.StepStartedDetails$=[3,Y,Wn,0,[],[]],e.StepSucceededDetails$=[3,Y,Gn,0,[hn,L],[[()=>e.EventResult$,0],()=>e.RetryDetails$],2],e.StopDurableExecutionRequest$=[3,Y,`StopDurableExecutionRequest`,0,[je,A],[[0,1],[()=>e.ErrorObject$,16]],1],e.StopDurableExecutionResponse$=[3,Y,`StopDurableExecutionResponse`,0,[`StopTimestamp`],[4],1],e.TagResourceRequest$=[3,Y,`TagResourceRequest`,0,[gn,ar],[[0,1],128],2],e.TagsError$=[3,Y,tr,0,[Ie,Nt],[0,0],2],e.TargetTrackingScalingPolicy$=[3,Y,`TargetTrackingScalingPolicy`,0,[`PredefinedMetricType`,`TargetValue`],[0,1],2],e.TenancyConfig$=[3,Y,er,0,[`TenantIsolationMode`],[0],1],e.TraceHeader$=[3,Y,nr,0,[`XAmznTraceId`],[0]],e.TracingConfig$=[3,Y,Qn,0,[Ut],[0]],e.TracingConfigResponse$=[3,Y,`TracingConfigResponse`,0,[Ut],[0]],e.UntagResourceRequest$=[3,Y,`UntagResourceRequest`,0,[gn,`TagKeys`],[[0,1],[64,{[G]:`tagKeys`}]],2],e.UpdateAliasRequest$=[3,Y,`UpdateAliasRequest`,0,[M,Wt,st,De,on,ln],[[0,1],[0,1],0,0,()=>e.AliasRoutingConfiguration$,0],2],e.UpdateCapacityProviderRequest$=[3,Y,`UpdateCapacityProviderRequest`,0,[ue,de],[[0,1],()=>e.CapacityProviderScalingConfig$],1],e.UpdateCapacityProviderResponse$=[3,Y,`UpdateCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.UpdateCodeSigningConfigRequest$=[3,Y,`UpdateCodeSigningConfigRequest`,0,[ge,De,a,D],[[0,1],0,()=>e.AllowedPublishers$,()=>e.CodeSigningPolicies$],1],e.UpdateCodeSigningConfigResponse$=[3,Y,`UpdateCodeSigningConfigResponse`,0,[he],[()=>e.CodeSigningConfig$],1],e.UpdateEventSourceMappingRequest$=[3,Y,`UpdateEventSourceMappingRequest`,0,[ur,M,Xe,f,nt,Pt,k,Bt,d,zt,Zt,bn,ir,rt,wn,r,In,ke,xt,Ft,N,$t],[[0,1],0,2,1,()=>e.FilterCriteria$,1,()=>e.DestinationConfig$,1,2,1,1,()=>di,1,64,()=>e.ScalingConfig$,()=>e.AmazonManagedKafkaEventSourceConfig$,()=>e.SelfManagedKafkaEventSourceConfig$,()=>e.DocumentDBEventSourceConfig$,0,()=>e.EventSourceMappingMetricsConfig$,()=>e.EventSourceMappingLoggingConfig$,()=>e.ProvisionedPollerConfig$],1],e.UpdateFunctionCodeRequest$=[3,Y,`UpdateFunctionCodeRequest`,0,[M,B,Sn,Mn,Rn,yt,F,`DryRun`,ln,u,Nn,tn],[[0,1],[()=>jr,0],0,0,0,0,2,2,0,64,0,0],1],e.UpdateFunctionConfigurationRequest$=[3,Y,`UpdateFunctionConfigurationRequest`,0,[M,_n,ct,De,or,Vt,fr,Qe,vn,Ne,xt,Qn,ln,St,it,dt,Ve,Kn,N,le,Oe],[[0,1],0,0,0,1,1,()=>e.VpcConfig$,[()=>e.Environment$,0],0,()=>e.DeadLetterConfig$,0,()=>e.TracingConfig$,0,64,()=>Zr,()=>e.ImageConfig$,()=>e.EphemeralStorage$,()=>e.SnapStart$,()=>e.LoggingConfig$,()=>e.CapacityProviderConfig$,()=>e.DurableConfig$],1],e.UpdateFunctionEventInvokeConfigRequest$=[3,Y,`UpdateFunctionEventInvokeConfigRequest`,0,[M,I,zt,It,k],[[0,1],[0,{[G]:I}],1,1,()=>e.DestinationConfig$],1],e.UpdateFunctionUrlConfigRequest$=[3,Y,`UpdateFunctionUrlConfigRequest`,0,[M,I,c,Te,ht],[[0,1],[0,{[G]:I}],0,()=>e.Cors$,0],1],e.UpdateFunctionUrlConfigResponse$=[3,Y,`UpdateFunctionUrlConfigResponse`,0,[ot,et,c,we,Dt,Te,ht],[0,0,0,0,0,()=>e.Cors$,0],5],e.VpcConfig$=[3,Y,fr,0,[R,kn,ut],[64,64,2]],e.VpcConfigResponse$=[3,Y,`VpcConfigResponse`,0,[R,kn,`VpcId`,ut],[64,64,0,2]],e.WaitCancelledDetails$=[3,Y,hr,0,[A],[[()=>e.EventError$,0]]],e.WaitDetails$=[3,Y,gr,0,[Dn],[4]],e.WaitOptions$=[3,Y,_r,0,[`WaitSeconds`],[1]],e.WaitStartedDetails$=[3,Y,vr,0,[Fe,Dn],[1,4],2],e.WaitSucceededDetails$=[3,Y,yr,0,[Fe],[1]];var Ur=`unit`,Wr=[1,Y,`AliasList`,0,()=>e.AliasConfiguration$],Gr=[1,Y,`CapacityProviderScalingPoliciesList`,0,()=>e.TargetTrackingScalingPolicy$],Kr=[1,Y,`CapacityProvidersList`,0,()=>e.CapacityProvider$],qr=[1,Y,`CodeSigningConfigList`,0,()=>e.CodeSigningConfig$],Jr=[1,Y,Ae,0,()=>e.Execution$],Yr=[1,Y,$e,0,[()=>e.Event$,0]],Xr=[1,Y,`EventSourceMappingsList`,0,()=>e.EventSourceMappingConfiguration$],Zr=[1,Y,`FileSystemConfigList`,0,()=>e.FileSystemConfig$],Qr=[1,Y,`FilterList`,0,()=>e.Filter$],$r=[1,Y,`FunctionEventInvokeConfigList`,0,()=>e.FunctionEventInvokeConfig$],ei=[1,Y,`FunctionList`,0,[()=>e.FunctionConfiguration$,0]],ti=[1,Y,`FunctionUrlConfigList`,0,()=>e.FunctionUrlConfig$],ni=[1,Y,`FunctionVersionsByCapacityProviderList`,0,()=>e.FunctionVersionsByCapacityProviderListItem$],ri=[1,Y,`KafkaSchemaRegistryAccessConfigList`,0,()=>e.KafkaSchemaRegistryAccessConfig$],ii=[1,Y,`KafkaSchemaValidationConfigList`,0,()=>e.KafkaSchemaValidationConfig$],ai=[1,Y,`LayersList`,0,()=>e.LayersListItem$],oi=[1,Y,`LayersReferenceList`,0,()=>e.Layer$],si=[1,Y,`LayerVersionsList`,0,()=>e.LayerVersionsListItem$],ci=[1,Y,Kt,0,[()=>e.Operation$,0]],li=[1,Y,`OperationUpdates`,0,[()=>e.OperationUpdate$,0]],ui=[1,Y,`ProvisionedConcurrencyConfigList`,0,()=>e.ProvisionedConcurrencyConfigListItem$],di=[1,Y,bn,0,()=>e.SourceAccessConfiguration$],fi=[1,Y,`StackTraceEntries`,0,[()=>Hr,0]],pi=[2,Y,`EnvironmentVariables`,8,[()=>Nr,0],[()=>Pr,0]];e.InvokeWithResponseStreamResponseEvent$=[4,Y,`InvokeWithResponseStreamResponseEvent`,{[Er]:1},[`PayloadChunk`,`InvokeComplete`],[[()=>e.InvokeResponseStreamUpdate$,0],()=>e.InvokeWithResponseStreamCompleteEvent$]],e.AddLayerVersionPermission$=[9,Y,`AddLayerVersionPermission`,{[H]:[`POST`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy`,201]},()=>e.AddLayerVersionPermissionRequest$,()=>e.AddLayerVersionPermissionResponse$],e.AddPermission$=[9,Y,`AddPermission`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/policy`,201]},()=>e.AddPermissionRequest$,()=>e.AddPermissionResponse$],e.CheckpointDurableExecution$=[9,Y,`CheckpointDurableExecution`,{[H]:[`POST`,`/2025-12-01/durable-executions/{DurableExecutionArn}/checkpoint`,200]},()=>e.CheckpointDurableExecutionRequest$,()=>e.CheckpointDurableExecutionResponse$],e.CreateAlias$=[9,Y,`CreateAlias`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/aliases`,201]},()=>e.CreateAliasRequest$,()=>e.AliasConfiguration$],e.CreateCapacityProvider$=[9,Y,`CreateCapacityProvider`,{[H]:[`POST`,`/2025-11-30/capacity-providers`,202]},()=>e.CreateCapacityProviderRequest$,()=>e.CreateCapacityProviderResponse$],e.CreateCodeSigningConfig$=[9,Y,`CreateCodeSigningConfig`,{[H]:[`POST`,`/2020-04-22/code-signing-configs`,201]},()=>e.CreateCodeSigningConfigRequest$,()=>e.CreateCodeSigningConfigResponse$],e.CreateEventSourceMapping$=[9,Y,`CreateEventSourceMapping`,{[H]:[`POST`,`/2015-03-31/event-source-mappings`,202]},()=>e.CreateEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.CreateFunction$=[9,Y,`CreateFunction`,{[H]:[`POST`,`/2015-03-31/functions`,201]},()=>e.CreateFunctionRequest$,()=>e.FunctionConfiguration$],e.CreateFunctionUrlConfig$=[9,Y,`CreateFunctionUrlConfig`,{[H]:[`POST`,`/2021-10-31/functions/{FunctionName}/url`,201]},()=>e.CreateFunctionUrlConfigRequest$,()=>e.CreateFunctionUrlConfigResponse$],e.DeleteAlias$=[9,Y,`DeleteAlias`,{[H]:[`DELETE`,`/2015-03-31/functions/{FunctionName}/aliases/{Name}`,204]},()=>e.DeleteAliasRequest$,()=>Ur],e.DeleteCapacityProvider$=[9,Y,`DeleteCapacityProvider`,{[H]:[`DELETE`,`/2025-11-30/capacity-providers/{CapacityProviderName}`,202]},()=>e.DeleteCapacityProviderRequest$,()=>e.DeleteCapacityProviderResponse$],e.DeleteCodeSigningConfig$=[9,Y,`DeleteCodeSigningConfig`,{[H]:[`DELETE`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}`,204]},()=>e.DeleteCodeSigningConfigRequest$,()=>e.DeleteCodeSigningConfigResponse$],e.DeleteEventSourceMapping$=[9,Y,`DeleteEventSourceMapping`,{[H]:[`DELETE`,`/2015-03-31/event-source-mappings/{UUID}`,202]},()=>e.DeleteEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.DeleteFunction$=[9,Y,`DeleteFunction`,{[H]:[`DELETE`,`/2015-03-31/functions/{FunctionName}`,200]},()=>e.DeleteFunctionRequest$,()=>e.DeleteFunctionResponse$],e.DeleteFunctionCodeSigningConfig$=[9,Y,`DeleteFunctionCodeSigningConfig`,{[H]:[`DELETE`,`/2020-06-30/functions/{FunctionName}/code-signing-config`,204]},()=>e.DeleteFunctionCodeSigningConfigRequest$,()=>Ur],e.DeleteFunctionConcurrency$=[9,Y,`DeleteFunctionConcurrency`,{[H]:[`DELETE`,`/2017-10-31/functions/{FunctionName}/concurrency`,204]},()=>e.DeleteFunctionConcurrencyRequest$,()=>Ur],e.DeleteFunctionEventInvokeConfig$=[9,Y,`DeleteFunctionEventInvokeConfig`,{[H]:[`DELETE`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,204]},()=>e.DeleteFunctionEventInvokeConfigRequest$,()=>Ur],e.DeleteFunctionUrlConfig$=[9,Y,`DeleteFunctionUrlConfig`,{[H]:[`DELETE`,`/2021-10-31/functions/{FunctionName}/url`,204]},()=>e.DeleteFunctionUrlConfigRequest$,()=>Ur],e.DeleteLayerVersion$=[9,Y,`DeleteLayerVersion`,{[H]:[`DELETE`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}`,204]},()=>e.DeleteLayerVersionRequest$,()=>Ur],e.DeleteProvisionedConcurrencyConfig$=[9,Y,`DeleteProvisionedConcurrencyConfig`,{[H]:[`DELETE`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency`,204]},()=>e.DeleteProvisionedConcurrencyConfigRequest$,()=>Ur],e.GetAccountSettings$=[9,Y,`GetAccountSettings`,{[H]:[`GET`,`/2016-08-19/account-settings`,200]},()=>e.GetAccountSettingsRequest$,()=>e.GetAccountSettingsResponse$],e.GetAlias$=[9,Y,`GetAlias`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/aliases/{Name}`,200]},()=>e.GetAliasRequest$,()=>e.AliasConfiguration$],e.GetCapacityProvider$=[9,Y,`GetCapacityProvider`,{[H]:[`GET`,`/2025-11-30/capacity-providers/{CapacityProviderName}`,200]},()=>e.GetCapacityProviderRequest$,()=>e.GetCapacityProviderResponse$],e.GetCodeSigningConfig$=[9,Y,`GetCodeSigningConfig`,{[H]:[`GET`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}`,200]},()=>e.GetCodeSigningConfigRequest$,()=>e.GetCodeSigningConfigResponse$],e.GetDurableExecution$=[9,Y,`GetDurableExecution`,{[H]:[`GET`,`/2025-12-01/durable-executions/{DurableExecutionArn}`,200]},()=>e.GetDurableExecutionRequest$,()=>e.GetDurableExecutionResponse$],e.GetDurableExecutionHistory$=[9,Y,`GetDurableExecutionHistory`,{[H]:[`GET`,`/2025-12-01/durable-executions/{DurableExecutionArn}/history`,200]},()=>e.GetDurableExecutionHistoryRequest$,()=>e.GetDurableExecutionHistoryResponse$],e.GetDurableExecutionState$=[9,Y,`GetDurableExecutionState`,{[H]:[`GET`,`/2025-12-01/durable-executions/{DurableExecutionArn}/state`,200]},()=>e.GetDurableExecutionStateRequest$,()=>e.GetDurableExecutionStateResponse$],e.GetEventSourceMapping$=[9,Y,`GetEventSourceMapping`,{[H]:[`GET`,`/2015-03-31/event-source-mappings/{UUID}`,200]},()=>e.GetEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.GetFunction$=[9,Y,`GetFunction`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}`,200]},()=>e.GetFunctionRequest$,()=>e.GetFunctionResponse$],e.GetFunctionCodeSigningConfig$=[9,Y,`GetFunctionCodeSigningConfig`,{[H]:[`GET`,`/2020-06-30/functions/{FunctionName}/code-signing-config`,200]},()=>e.GetFunctionCodeSigningConfigRequest$,()=>e.GetFunctionCodeSigningConfigResponse$],e.GetFunctionConcurrency$=[9,Y,`GetFunctionConcurrency`,{[H]:[`GET`,`/2019-09-30/functions/{FunctionName}/concurrency`,200]},()=>e.GetFunctionConcurrencyRequest$,()=>e.GetFunctionConcurrencyResponse$],e.GetFunctionConfiguration$=[9,Y,`GetFunctionConfiguration`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/configuration`,200]},()=>e.GetFunctionConfigurationRequest$,()=>e.FunctionConfiguration$],e.GetFunctionEventInvokeConfig$=[9,Y,`GetFunctionEventInvokeConfig`,{[H]:[`GET`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,200]},()=>e.GetFunctionEventInvokeConfigRequest$,()=>e.FunctionEventInvokeConfig$],e.GetFunctionRecursionConfig$=[9,Y,`GetFunctionRecursionConfig`,{[H]:[`GET`,`/2024-08-31/functions/{FunctionName}/recursion-config`,200]},()=>e.GetFunctionRecursionConfigRequest$,()=>e.GetFunctionRecursionConfigResponse$],e.GetFunctionScalingConfig$=[9,Y,`GetFunctionScalingConfig`,{[H]:[`GET`,`/2025-11-30/functions/{FunctionName}/function-scaling-config`,200]},()=>e.GetFunctionScalingConfigRequest$,()=>e.GetFunctionScalingConfigResponse$],e.GetFunctionUrlConfig$=[9,Y,`GetFunctionUrlConfig`,{[H]:[`GET`,`/2021-10-31/functions/{FunctionName}/url`,200]},()=>e.GetFunctionUrlConfigRequest$,()=>e.GetFunctionUrlConfigResponse$],e.GetLayerVersion$=[9,Y,`GetLayerVersion`,{[H]:[`GET`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}`,200]},()=>e.GetLayerVersionRequest$,()=>e.GetLayerVersionResponse$],e.GetLayerVersionByArn$=[9,Y,`GetLayerVersionByArn`,{[H]:[`GET`,`/2018-10-31/layers?find=LayerVersion`,200]},()=>e.GetLayerVersionByArnRequest$,()=>e.GetLayerVersionResponse$],e.GetLayerVersionPolicy$=[9,Y,`GetLayerVersionPolicy`,{[H]:[`GET`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy`,200]},()=>e.GetLayerVersionPolicyRequest$,()=>e.GetLayerVersionPolicyResponse$],e.GetPolicy$=[9,Y,`GetPolicy`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/policy`,200]},()=>e.GetPolicyRequest$,()=>e.GetPolicyResponse$],e.GetProvisionedConcurrencyConfig$=[9,Y,`GetProvisionedConcurrencyConfig`,{[H]:[`GET`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency`,200]},()=>e.GetProvisionedConcurrencyConfigRequest$,()=>e.GetProvisionedConcurrencyConfigResponse$],e.GetRuntimeManagementConfig$=[9,Y,`GetRuntimeManagementConfig`,{[H]:[`GET`,`/2021-07-20/functions/{FunctionName}/runtime-management-config`,200]},()=>e.GetRuntimeManagementConfigRequest$,()=>e.GetRuntimeManagementConfigResponse$],e.Invoke$=[9,Y,`Invoke`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/invocations`,200]},()=>e.InvocationRequest$,()=>e.InvocationResponse$],e.InvokeAsync$=[9,Y,`InvokeAsync`,{[H]:[`POST`,`/2014-11-13/functions/{FunctionName}/invoke-async`,202]},()=>e.InvokeAsyncRequest$,()=>e.InvokeAsyncResponse$],e.InvokeWithResponseStream$=[9,Y,`InvokeWithResponseStream`,{[H]:[`POST`,`/2021-11-15/functions/{FunctionName}/response-streaming-invocations`,200]},()=>e.InvokeWithResponseStreamRequest$,()=>e.InvokeWithResponseStreamResponse$],e.ListAliases$=[9,Y,`ListAliases`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/aliases`,200]},()=>e.ListAliasesRequest$,()=>e.ListAliasesResponse$],e.ListCapacityProviders$=[9,Y,`ListCapacityProviders`,{[H]:[`GET`,`/2025-11-30/capacity-providers`,200]},()=>e.ListCapacityProvidersRequest$,()=>e.ListCapacityProvidersResponse$],e.ListCodeSigningConfigs$=[9,Y,`ListCodeSigningConfigs`,{[H]:[`GET`,`/2020-04-22/code-signing-configs`,200]},()=>e.ListCodeSigningConfigsRequest$,()=>e.ListCodeSigningConfigsResponse$],e.ListDurableExecutionsByFunction$=[9,Y,`ListDurableExecutionsByFunction`,{[H]:[`GET`,`/2025-12-01/functions/{FunctionName}/durable-executions`,200]},()=>e.ListDurableExecutionsByFunctionRequest$,()=>e.ListDurableExecutionsByFunctionResponse$],e.ListEventSourceMappings$=[9,Y,`ListEventSourceMappings`,{[H]:[`GET`,`/2015-03-31/event-source-mappings`,200]},()=>e.ListEventSourceMappingsRequest$,()=>e.ListEventSourceMappingsResponse$],e.ListFunctionEventInvokeConfigs$=[9,Y,`ListFunctionEventInvokeConfigs`,{[H]:[`GET`,`/2019-09-25/functions/{FunctionName}/event-invoke-config/list`,200]},()=>e.ListFunctionEventInvokeConfigsRequest$,()=>e.ListFunctionEventInvokeConfigsResponse$],e.ListFunctions$=[9,Y,`ListFunctions`,{[H]:[`GET`,`/2015-03-31/functions`,200]},()=>e.ListFunctionsRequest$,()=>e.ListFunctionsResponse$],e.ListFunctionsByCodeSigningConfig$=[9,Y,`ListFunctionsByCodeSigningConfig`,{[H]:[`GET`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions`,200]},()=>e.ListFunctionsByCodeSigningConfigRequest$,()=>e.ListFunctionsByCodeSigningConfigResponse$],e.ListFunctionUrlConfigs$=[9,Y,`ListFunctionUrlConfigs`,{[H]:[`GET`,`/2021-10-31/functions/{FunctionName}/urls`,200]},()=>e.ListFunctionUrlConfigsRequest$,()=>e.ListFunctionUrlConfigsResponse$],e.ListFunctionVersionsByCapacityProvider$=[9,Y,`ListFunctionVersionsByCapacityProvider`,{[H]:[`GET`,`/2025-11-30/capacity-providers/{CapacityProviderName}/function-versions`,200]},()=>e.ListFunctionVersionsByCapacityProviderRequest$,()=>e.ListFunctionVersionsByCapacityProviderResponse$],e.ListLayers$=[9,Y,`ListLayers`,{[H]:[`GET`,`/2018-10-31/layers`,200]},()=>e.ListLayersRequest$,()=>e.ListLayersResponse$],e.ListLayerVersions$=[9,Y,`ListLayerVersions`,{[H]:[`GET`,`/2018-10-31/layers/{LayerName}/versions`,200]},()=>e.ListLayerVersionsRequest$,()=>e.ListLayerVersionsResponse$],e.ListProvisionedConcurrencyConfigs$=[9,Y,`ListProvisionedConcurrencyConfigs`,{[H]:[`GET`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL`,200]},()=>e.ListProvisionedConcurrencyConfigsRequest$,()=>e.ListProvisionedConcurrencyConfigsResponse$],e.ListTags$=[9,Y,`ListTags`,{[H]:[`GET`,`/2017-03-31/tags/{Resource}`,200]},()=>e.ListTagsRequest$,()=>e.ListTagsResponse$],e.ListVersionsByFunction$=[9,Y,`ListVersionsByFunction`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/versions`,200]},()=>e.ListVersionsByFunctionRequest$,()=>e.ListVersionsByFunctionResponse$],e.PublishLayerVersion$=[9,Y,`PublishLayerVersion`,{[H]:[`POST`,`/2018-10-31/layers/{LayerName}/versions`,201]},()=>e.PublishLayerVersionRequest$,()=>e.PublishLayerVersionResponse$],e.PublishVersion$=[9,Y,`PublishVersion`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/versions`,201]},()=>e.PublishVersionRequest$,()=>e.FunctionConfiguration$],e.PutFunctionCodeSigningConfig$=[9,Y,`PutFunctionCodeSigningConfig`,{[H]:[`PUT`,`/2020-06-30/functions/{FunctionName}/code-signing-config`,200]},()=>e.PutFunctionCodeSigningConfigRequest$,()=>e.PutFunctionCodeSigningConfigResponse$],e.PutFunctionConcurrency$=[9,Y,`PutFunctionConcurrency`,{[H]:[`PUT`,`/2017-10-31/functions/{FunctionName}/concurrency`,200]},()=>e.PutFunctionConcurrencyRequest$,()=>e.Concurrency$],e.PutFunctionEventInvokeConfig$=[9,Y,`PutFunctionEventInvokeConfig`,{[H]:[`PUT`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,200]},()=>e.PutFunctionEventInvokeConfigRequest$,()=>e.FunctionEventInvokeConfig$],e.PutFunctionRecursionConfig$=[9,Y,`PutFunctionRecursionConfig`,{[H]:[`PUT`,`/2024-08-31/functions/{FunctionName}/recursion-config`,200]},()=>e.PutFunctionRecursionConfigRequest$,()=>e.PutFunctionRecursionConfigResponse$],e.PutFunctionScalingConfig$=[9,Y,`PutFunctionScalingConfig`,{[H]:[`PUT`,`/2025-11-30/functions/{FunctionName}/function-scaling-config`,202]},()=>e.PutFunctionScalingConfigRequest$,()=>e.PutFunctionScalingConfigResponse$],e.PutProvisionedConcurrencyConfig$=[9,Y,`PutProvisionedConcurrencyConfig`,{[H]:[`PUT`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency`,202]},()=>e.PutProvisionedConcurrencyConfigRequest$,()=>e.PutProvisionedConcurrencyConfigResponse$],e.PutRuntimeManagementConfig$=[9,Y,`PutRuntimeManagementConfig`,{[H]:[`PUT`,`/2021-07-20/functions/{FunctionName}/runtime-management-config`,200]},()=>e.PutRuntimeManagementConfigRequest$,()=>e.PutRuntimeManagementConfigResponse$],e.RemoveLayerVersionPermission$=[9,Y,`RemoveLayerVersionPermission`,{[H]:[`DELETE`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}`,204]},()=>e.RemoveLayerVersionPermissionRequest$,()=>Ur],e.RemovePermission$=[9,Y,`RemovePermission`,{[H]:[`DELETE`,`/2015-03-31/functions/{FunctionName}/policy/{StatementId}`,204]},()=>e.RemovePermissionRequest$,()=>Ur],e.SendDurableExecutionCallbackFailure$=[9,Y,`SendDurableExecutionCallbackFailure`,{[H]:[`POST`,`/2025-12-01/durable-execution-callbacks/{CallbackId}/fail`,200]},()=>e.SendDurableExecutionCallbackFailureRequest$,()=>e.SendDurableExecutionCallbackFailureResponse$],e.SendDurableExecutionCallbackHeartbeat$=[9,Y,`SendDurableExecutionCallbackHeartbeat`,{[H]:[`POST`,`/2025-12-01/durable-execution-callbacks/{CallbackId}/heartbeat`,200]},()=>e.SendDurableExecutionCallbackHeartbeatRequest$,()=>e.SendDurableExecutionCallbackHeartbeatResponse$],e.SendDurableExecutionCallbackSuccess$=[9,Y,`SendDurableExecutionCallbackSuccess`,{[H]:[`POST`,`/2025-12-01/durable-execution-callbacks/{CallbackId}/succeed`,200]},()=>e.SendDurableExecutionCallbackSuccessRequest$,()=>e.SendDurableExecutionCallbackSuccessResponse$],e.StopDurableExecution$=[9,Y,`StopDurableExecution`,{[H]:[`POST`,`/2025-12-01/durable-executions/{DurableExecutionArn}/stop`,200]},()=>e.StopDurableExecutionRequest$,()=>e.StopDurableExecutionResponse$],e.TagResource$=[9,Y,`TagResource`,{[H]:[`POST`,`/2017-03-31/tags/{Resource}`,204]},()=>e.TagResourceRequest$,()=>Ur],e.UntagResource$=[9,Y,`UntagResource`,{[H]:[`DELETE`,`/2017-03-31/tags/{Resource}`,204]},()=>e.UntagResourceRequest$,()=>Ur],e.UpdateAlias$=[9,Y,`UpdateAlias`,{[H]:[`PUT`,`/2015-03-31/functions/{FunctionName}/aliases/{Name}`,200]},()=>e.UpdateAliasRequest$,()=>e.AliasConfiguration$],e.UpdateCapacityProvider$=[9,Y,`UpdateCapacityProvider`,{[H]:[`PUT`,`/2025-11-30/capacity-providers/{CapacityProviderName}`,202]},()=>e.UpdateCapacityProviderRequest$,()=>e.UpdateCapacityProviderResponse$],e.UpdateCodeSigningConfig$=[9,Y,`UpdateCodeSigningConfig`,{[H]:[`PUT`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}`,200]},()=>e.UpdateCodeSigningConfigRequest$,()=>e.UpdateCodeSigningConfigResponse$],e.UpdateEventSourceMapping$=[9,Y,`UpdateEventSourceMapping`,{[H]:[`PUT`,`/2015-03-31/event-source-mappings/{UUID}`,202]},()=>e.UpdateEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.UpdateFunctionCode$=[9,Y,`UpdateFunctionCode`,{[H]:[`PUT`,`/2015-03-31/functions/{FunctionName}/code`,200]},()=>e.UpdateFunctionCodeRequest$,()=>e.FunctionConfiguration$],e.UpdateFunctionConfiguration$=[9,Y,`UpdateFunctionConfiguration`,{[H]:[`PUT`,`/2015-03-31/functions/{FunctionName}/configuration`,200]},()=>e.UpdateFunctionConfigurationRequest$,()=>e.FunctionConfiguration$],e.UpdateFunctionEventInvokeConfig$=[9,Y,`UpdateFunctionEventInvokeConfig`,{[H]:[`POST`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,200]},()=>e.UpdateFunctionEventInvokeConfigRequest$,()=>e.FunctionEventInvokeConfig$],e.UpdateFunctionUrlConfig$=[9,Y,`UpdateFunctionUrlConfig`,{[H]:[`PUT`,`/2021-10-31/functions/{FunctionName}/url`,200]},()=>e.UpdateFunctionUrlConfigRequest$,()=>e.UpdateFunctionUrlConfigResponse$]})),jP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(fv(),m(dv)),n=(Sx(),m(xx)),r=C_(),i=$f(),a=hf(),o=pf(),s=pv(),c=DP(),l=AP();e.getRuntimeConfig=e=>({apiVersion:`2015-03-31`,base64Decoder:e?.base64Decoder??a.fromBase64,base64Encoder:e?.base64Encoder??a.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??c.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??s.defaultLambdaHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new t.AwsSdkSigV4Signer}],logger:e?.logger??new r.NoOpLogger,protocol:e?.protocol??n.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.lambda`,errorTypeRegistries:l.errorTypeRegistries,version:`2015-03-31`,serviceTarget:`AWSGirApiService`},serviceId:e?.serviceId??`Lambda`,urlParser:e?.urlParser??i.parseUrl,utf8Decoder:e?.utf8Decoder??o.fromUtf8,utf8Encoder:e?.utf8Encoder??o.toUtf8})})),MP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(mv()),n=(r_(),m(n_)),r=(fv(),m(dv)),i=fP(),a=Nv(),o=c_(),s=TP(),c=Pv(),l=T_(),u=__(),d=Af(),f=C_(),p=Fv(),h=Iv(),g=a_(),_=jP();e.getRuntimeConfig=e=>{(0,f.emitWarningIfUnsupportedVersion)(process.version);let m=(0,h.resolveDefaultsModeConfig)(e),v=()=>m().then(f.loadConfigsForDefaultMode),y=(0,_.getRuntimeConfig)(e);(0,n.emitWarningIfUnsupportedVersion)(process.version);let b={profile:e?.profile,logger:y.logger};return{...y,...e,runtime:`node`,defaultsMode:m,authSchemePreference:e?.authSchemePreference??(0,u.loadConfig)(r.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,b),bodyLengthChecker:e?.bodyLengthChecker??p.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??i.defaultProvider,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,a.createDefaultUserAgentProvider)({serviceId:y.serviceId,clientVersion:t.default.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??s.eventStreamSerdeProvider,maxAttempts:e?.maxAttempts??(0,u.loadConfig)(l.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,u.loadConfig)(o.NODE_REGION_CONFIG_OPTIONS,{...o.NODE_REGION_CONFIG_FILE_OPTIONS,...b}),requestHandler:d.NodeHttpHandler.create(e?.requestHandler??v),retryMode:e?.retryMode??(0,u.loadConfig)({...l.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await v()).retryMode||g.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??c.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??d.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,u.loadConfig)(o.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,b),useFipsEndpoint:e?.useFipsEndpoint??(0,u.loadConfig)(o.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,b),userAgentAppId:e?.userAgentAppId??(0,u.loadConfig)(a.NODE_APP_ID_CONFIG_OPTIONS,b)}}})),NP=u((e=>{let t=()=>{let e=new WeakSet;return(t,n)=>{if(typeof n==`object`&&n){if(e.has(n))return`[Circular]`;e.add(n)}return n}},n=e=>new Promise(t=>setTimeout(t,e*1e3)),r={minDelay:2,maxDelay:120};e.WaiterState=void 0,(function(e){e.ABORTED=`ABORTED`,e.FAILURE=`FAILURE`,e.SUCCESS=`SUCCESS`,e.RETRY=`RETRY`,e.TIMEOUT=`TIMEOUT`})(e.WaiterState||={});let i=n=>{if(n.state===e.WaiterState.ABORTED){let e=Error(`${JSON.stringify({...n,reason:`Request was aborted`},t())}`);throw e.name=`AbortError`,e}else if(n.state===e.WaiterState.TIMEOUT){let e=Error(`${JSON.stringify({...n,reason:`Waiter has timed out`},t())}`);throw e.name=`TimeoutError`,e}else if(n.state!==e.WaiterState.SUCCESS)throw Error(`${JSON.stringify(n,t())}`);return n},a=(e,t,n,r)=>r>n?t:o(e,e*2**(r-1)),o=(e,t)=>e+Math.random()*(t-e),s=async({minDelay:t,maxDelay:r,maxWaitTime:i,abortController:o,client:s,abortSignal:l},u,d)=>{let f={},{state:p,reason:m}=await d(s,u);if(m){let e=c(m);f[e]|=0,f[e]+=1}if(p!==e.WaiterState.RETRY)return{state:p,reason:m,observedResponses:f};let h=1,g=Date.now()+i*1e3,_=Math.log(r/t)/Math.log(2)+1;for(;;){if(o?.signal?.aborted||l?.aborted){let t=`AbortController signal aborted.`;return f[t]|=0,f[t]+=1,{state:e.WaiterState.ABORTED,observedResponses:f}}let i=a(t,r,_,h);if(Date.now()+i*1e3>g)return{state:e.WaiterState.TIMEOUT,observedResponses:f};await n(i);let{state:p,reason:m}=await d(s,u);if(m){let e=c(m);f[e]|=0,f[e]+=1}if(p!==e.WaiterState.RETRY)return{state:p,reason:m,observedResponses:f};h+=1}},c=e=>e?.$responseBodyText?`Deserialization error for body: ${e.$responseBodyText}`:e?.$metadata?.httpStatusCode?e.$response||e.message?`${e.$response?.statusCode??e.$metadata.httpStatusCode??`Unknown`}: ${e.message}`:`${e.$metadata.httpStatusCode}: OK`:String(e?.message??JSON.stringify(e,t())??`Unknown`),l=e=>{if(e.maxWaitTime<=0)throw Error(`WaiterConfiguration.maxWaitTime must be greater than 0`);if(e.minDelay<=0)throw Error(`WaiterConfiguration.minDelay must be greater than 0`);if(e.maxDelay<=0)throw Error(`WaiterConfiguration.maxDelay must be greater than 0`);if(e.maxWaitTime<=e.minDelay)throw Error(`WaiterConfiguration.maxWaitTime [${e.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`);if(e.maxDelay<e.minDelay)throw Error(`WaiterConfiguration.maxDelay [${e.maxDelay}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`)},u=t=>{let n;return{clearListener(){typeof t.removeEventListener==`function`&&t.removeEventListener(`abort`,n)},aborted:new Promise(r=>{n=()=>r({state:e.WaiterState.ABORTED}),typeof t.addEventListener==`function`?t.addEventListener(`abort`,n):t.onabort=n})}};e.checkExceptions=i,e.createWaiter=async(e,t,n)=>{let i={...r,...e};l(i);let a=[s(i,t,n)],o=[];if(e.abortSignal){let{aborted:t,clearListener:n}=u(e.abortSignal);o.push(n),a.push(t)}if(e.abortController?.signal){let{aborted:t,clearListener:n}=u(e.abortController.signal);o.push(n),a.push(t)}return Promise.race(a).then(e=>{for(let e of o)e();return e})},e.waiterServiceDefaults=r})),PP=u((e=>{var t=vd(),n=yd(),r=kd(),i=o_(),a=c_(),o=(Wg(),m(Ug)),s=(Yp(),m(Jp)),c=l_(),l=u_(),u=x_(),d=T_(),f=C_(),p=pv(),h=MP(),g=KC(),_=_d(),v=AP(),y=NP(),b=kP(),x=OP();let S=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`lambda`}),C={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}},w=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},ee=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),te=(e,t)=>{let n=Object.assign(g.getAwsRegionExtensionConfiguration(e),f.getDefaultExtensionConfiguration(e),_.getHttpHandlerExtensionConfiguration(e),w(e));return t.forEach(e=>e.configure(n)),Object.assign(e,g.resolveAwsRegionExtensionConfiguration(n),f.resolveDefaultRuntimeConfig(n),_.resolveHttpHandlerRuntimeConfig(n),ee(n))};var T=class extends f.Client{config;constructor(...[e]){let f=h.getRuntimeConfig(e||{});super(f),this.initConfig=f;let m=S(f),g=i.resolveUserAgentConfig(m),_=d.resolveRetryConfig(g),v=a.resolveRegionConfig(_),y=t.resolveHostHeaderConfig(v),b=u.resolveEndpointConfig(y),x=c.resolveEventStreamSerdeConfig(b);this.config=te(p.resolveHttpAuthSchemeConfig(x),e?.extensions||[]),this.middlewareStack.use(s.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(i.getUserAgentPlugin(this.config)),this.middlewareStack.use(d.getRetryPlugin(this.config)),this.middlewareStack.use(l.getContentLengthPlugin(this.config)),this.middlewareStack.use(t.getHostHeaderPlugin(this.config)),this.middlewareStack.use(n.getLoggerPlugin(this.config)),this.middlewareStack.use(r.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(o.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:p.defaultLambdaHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async e=>new o.DefaultIdentityProviderConfig({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(o.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}},E=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`AddLayerVersionPermission`,{}).n(`LambdaClient`,`AddLayerVersionPermissionCommand`).sc(v.AddLayerVersionPermission$).build(){},ne=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`AddPermission`,{}).n(`LambdaClient`,`AddPermissionCommand`).sc(v.AddPermission$).build(){},re=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CheckpointDurableExecution`,{}).n(`LambdaClient`,`CheckpointDurableExecutionCommand`).sc(v.CheckpointDurableExecution$).build(){},ie=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateAlias`,{}).n(`LambdaClient`,`CreateAliasCommand`).sc(v.CreateAlias$).build(){},ae=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateCapacityProvider`,{}).n(`LambdaClient`,`CreateCapacityProviderCommand`).sc(v.CreateCapacityProvider$).build(){},oe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateCodeSigningConfig`,{}).n(`LambdaClient`,`CreateCodeSigningConfigCommand`).sc(v.CreateCodeSigningConfig$).build(){},se=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateEventSourceMapping`,{}).n(`LambdaClient`,`CreateEventSourceMappingCommand`).sc(v.CreateEventSourceMapping$).build(){},ce=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateFunction`,{}).n(`LambdaClient`,`CreateFunctionCommand`).sc(v.CreateFunction$).build(){},le=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateFunctionUrlConfig`,{}).n(`LambdaClient`,`CreateFunctionUrlConfigCommand`).sc(v.CreateFunctionUrlConfig$).build(){},ue=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteAlias`,{}).n(`LambdaClient`,`DeleteAliasCommand`).sc(v.DeleteAlias$).build(){},de=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteCapacityProvider`,{}).n(`LambdaClient`,`DeleteCapacityProviderCommand`).sc(v.DeleteCapacityProvider$).build(){},fe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteCodeSigningConfig`,{}).n(`LambdaClient`,`DeleteCodeSigningConfigCommand`).sc(v.DeleteCodeSigningConfig$).build(){},pe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteEventSourceMapping`,{}).n(`LambdaClient`,`DeleteEventSourceMappingCommand`).sc(v.DeleteEventSourceMapping$).build(){},me=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionCodeSigningConfig`,{}).n(`LambdaClient`,`DeleteFunctionCodeSigningConfigCommand`).sc(v.DeleteFunctionCodeSigningConfig$).build(){},he=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunction`,{}).n(`LambdaClient`,`DeleteFunctionCommand`).sc(v.DeleteFunction$).build(){},ge=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionConcurrency`,{}).n(`LambdaClient`,`DeleteFunctionConcurrencyCommand`).sc(v.DeleteFunctionConcurrency$).build(){},_e=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`DeleteFunctionEventInvokeConfigCommand`).sc(v.DeleteFunctionEventInvokeConfig$).build(){},ve=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionUrlConfig`,{}).n(`LambdaClient`,`DeleteFunctionUrlConfigCommand`).sc(v.DeleteFunctionUrlConfig$).build(){},ye=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteLayerVersion`,{}).n(`LambdaClient`,`DeleteLayerVersionCommand`).sc(v.DeleteLayerVersion$).build(){},be=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteProvisionedConcurrencyConfig`,{}).n(`LambdaClient`,`DeleteProvisionedConcurrencyConfigCommand`).sc(v.DeleteProvisionedConcurrencyConfig$).build(){},D=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetAccountSettings`,{}).n(`LambdaClient`,`GetAccountSettingsCommand`).sc(v.GetAccountSettings$).build(){},xe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetAlias`,{}).n(`LambdaClient`,`GetAliasCommand`).sc(v.GetAlias$).build(){},Se=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetCapacityProvider`,{}).n(`LambdaClient`,`GetCapacityProviderCommand`).sc(v.GetCapacityProvider$).build(){},Ce=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetCodeSigningConfig`,{}).n(`LambdaClient`,`GetCodeSigningConfigCommand`).sc(v.GetCodeSigningConfig$).build(){},we=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetDurableExecution`,{}).n(`LambdaClient`,`GetDurableExecutionCommand`).sc(v.GetDurableExecution$).build(){},Te=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetDurableExecutionHistory`,{}).n(`LambdaClient`,`GetDurableExecutionHistoryCommand`).sc(v.GetDurableExecutionHistory$).build(){},Ee=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetDurableExecutionState`,{}).n(`LambdaClient`,`GetDurableExecutionStateCommand`).sc(v.GetDurableExecutionState$).build(){},O=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetEventSourceMapping`,{}).n(`LambdaClient`,`GetEventSourceMappingCommand`).sc(v.GetEventSourceMapping$).build(){},De=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionCodeSigningConfig`,{}).n(`LambdaClient`,`GetFunctionCodeSigningConfigCommand`).sc(v.GetFunctionCodeSigningConfig$).build(){},k=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunction`,{}).n(`LambdaClient`,`GetFunctionCommand`).sc(v.GetFunction$).build(){},Oe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionConcurrency`,{}).n(`LambdaClient`,`GetFunctionConcurrencyCommand`).sc(v.GetFunctionConcurrency$).build(){},ke=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionConfiguration`,{}).n(`LambdaClient`,`GetFunctionConfigurationCommand`).sc(v.GetFunctionConfiguration$).build(){},Ae=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`GetFunctionEventInvokeConfigCommand`).sc(v.GetFunctionEventInvokeConfig$).build(){},je=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionRecursionConfig`,{}).n(`LambdaClient`,`GetFunctionRecursionConfigCommand`).sc(v.GetFunctionRecursionConfig$).build(){},Me=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionScalingConfig`,{}).n(`LambdaClient`,`GetFunctionScalingConfigCommand`).sc(v.GetFunctionScalingConfig$).build(){},Ne=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionUrlConfig`,{}).n(`LambdaClient`,`GetFunctionUrlConfigCommand`).sc(v.GetFunctionUrlConfig$).build(){},Pe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetLayerVersionByArn`,{}).n(`LambdaClient`,`GetLayerVersionByArnCommand`).sc(v.GetLayerVersionByArn$).build(){},Fe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetLayerVersion`,{}).n(`LambdaClient`,`GetLayerVersionCommand`).sc(v.GetLayerVersion$).build(){},A=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetLayerVersionPolicy`,{}).n(`LambdaClient`,`GetLayerVersionPolicyCommand`).sc(v.GetLayerVersionPolicy$).build(){},Ie=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetPolicy`,{}).n(`LambdaClient`,`GetPolicyCommand`).sc(v.GetPolicy$).build(){},Le=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetProvisionedConcurrencyConfig`,{}).n(`LambdaClient`,`GetProvisionedConcurrencyConfigCommand`).sc(v.GetProvisionedConcurrencyConfig$).build(){},Re=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetRuntimeManagementConfig`,{}).n(`LambdaClient`,`GetRuntimeManagementConfigCommand`).sc(v.GetRuntimeManagementConfig$).build(){},ze=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`InvokeAsync`,{}).n(`LambdaClient`,`InvokeAsyncCommand`).sc(v.InvokeAsync$).build(){},Be=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`Invoke`,{}).n(`LambdaClient`,`InvokeCommand`).sc(v.Invoke$).build(){},Ve=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`InvokeWithResponseStream`,{eventStream:{output:!0}}).n(`LambdaClient`,`InvokeWithResponseStreamCommand`).sc(v.InvokeWithResponseStream$).build(){},j=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListAliases`,{}).n(`LambdaClient`,`ListAliasesCommand`).sc(v.ListAliases$).build(){},He=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListCapacityProviders`,{}).n(`LambdaClient`,`ListCapacityProvidersCommand`).sc(v.ListCapacityProviders$).build(){},Ue=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListCodeSigningConfigs`,{}).n(`LambdaClient`,`ListCodeSigningConfigsCommand`).sc(v.ListCodeSigningConfigs$).build(){},We=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListDurableExecutionsByFunction`,{}).n(`LambdaClient`,`ListDurableExecutionsByFunctionCommand`).sc(v.ListDurableExecutionsByFunction$).build(){},Ge=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListEventSourceMappings`,{}).n(`LambdaClient`,`ListEventSourceMappingsCommand`).sc(v.ListEventSourceMappings$).build(){},Ke=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionEventInvokeConfigs`,{}).n(`LambdaClient`,`ListFunctionEventInvokeConfigsCommand`).sc(v.ListFunctionEventInvokeConfigs$).build(){},qe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionsByCodeSigningConfig`,{}).n(`LambdaClient`,`ListFunctionsByCodeSigningConfigCommand`).sc(v.ListFunctionsByCodeSigningConfig$).build(){},Je=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctions`,{}).n(`LambdaClient`,`ListFunctionsCommand`).sc(v.ListFunctions$).build(){},Ye=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionUrlConfigs`,{}).n(`LambdaClient`,`ListFunctionUrlConfigsCommand`).sc(v.ListFunctionUrlConfigs$).build(){},Xe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionVersionsByCapacityProvider`,{}).n(`LambdaClient`,`ListFunctionVersionsByCapacityProviderCommand`).sc(v.ListFunctionVersionsByCapacityProvider$).build(){},Ze=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListLayers`,{}).n(`LambdaClient`,`ListLayersCommand`).sc(v.ListLayers$).build(){},Qe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListLayerVersions`,{}).n(`LambdaClient`,`ListLayerVersionsCommand`).sc(v.ListLayerVersions$).build(){},$e=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListProvisionedConcurrencyConfigs`,{}).n(`LambdaClient`,`ListProvisionedConcurrencyConfigsCommand`).sc(v.ListProvisionedConcurrencyConfigs$).build(){},et=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListTags`,{}).n(`LambdaClient`,`ListTagsCommand`).sc(v.ListTags$).build(){},tt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListVersionsByFunction`,{}).n(`LambdaClient`,`ListVersionsByFunctionCommand`).sc(v.ListVersionsByFunction$).build(){},nt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PublishLayerVersion`,{}).n(`LambdaClient`,`PublishLayerVersionCommand`).sc(v.PublishLayerVersion$).build(){},M=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PublishVersion`,{}).n(`LambdaClient`,`PublishVersionCommand`).sc(v.PublishVersion$).build(){},rt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionCodeSigningConfig`,{}).n(`LambdaClient`,`PutFunctionCodeSigningConfigCommand`).sc(v.PutFunctionCodeSigningConfig$).build(){},it=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionConcurrency`,{}).n(`LambdaClient`,`PutFunctionConcurrencyCommand`).sc(v.PutFunctionConcurrency$).build(){},at=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`PutFunctionEventInvokeConfigCommand`).sc(v.PutFunctionEventInvokeConfig$).build(){},ot=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionRecursionConfig`,{}).n(`LambdaClient`,`PutFunctionRecursionConfigCommand`).sc(v.PutFunctionRecursionConfig$).build(){},st=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionScalingConfig`,{}).n(`LambdaClient`,`PutFunctionScalingConfigCommand`).sc(v.PutFunctionScalingConfig$).build(){},ct=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutProvisionedConcurrencyConfig`,{}).n(`LambdaClient`,`PutProvisionedConcurrencyConfigCommand`).sc(v.PutProvisionedConcurrencyConfig$).build(){},lt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutRuntimeManagementConfig`,{}).n(`LambdaClient`,`PutRuntimeManagementConfigCommand`).sc(v.PutRuntimeManagementConfig$).build(){},ut=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`RemoveLayerVersionPermission`,{}).n(`LambdaClient`,`RemoveLayerVersionPermissionCommand`).sc(v.RemoveLayerVersionPermission$).build(){},dt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`RemovePermission`,{}).n(`LambdaClient`,`RemovePermissionCommand`).sc(v.RemovePermission$).build(){},ft=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`SendDurableExecutionCallbackFailure`,{}).n(`LambdaClient`,`SendDurableExecutionCallbackFailureCommand`).sc(v.SendDurableExecutionCallbackFailure$).build(){},pt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`SendDurableExecutionCallbackHeartbeat`,{}).n(`LambdaClient`,`SendDurableExecutionCallbackHeartbeatCommand`).sc(v.SendDurableExecutionCallbackHeartbeat$).build(){},mt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`SendDurableExecutionCallbackSuccess`,{}).n(`LambdaClient`,`SendDurableExecutionCallbackSuccessCommand`).sc(v.SendDurableExecutionCallbackSuccess$).build(){},ht=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`StopDurableExecution`,{}).n(`LambdaClient`,`StopDurableExecutionCommand`).sc(v.StopDurableExecution$).build(){},gt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`TagResource`,{}).n(`LambdaClient`,`TagResourceCommand`).sc(v.TagResource$).build(){},_t=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UntagResource`,{}).n(`LambdaClient`,`UntagResourceCommand`).sc(v.UntagResource$).build(){},vt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateAlias`,{}).n(`LambdaClient`,`UpdateAliasCommand`).sc(v.UpdateAlias$).build(){},yt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateCapacityProvider`,{}).n(`LambdaClient`,`UpdateCapacityProviderCommand`).sc(v.UpdateCapacityProvider$).build(){},bt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateCodeSigningConfig`,{}).n(`LambdaClient`,`UpdateCodeSigningConfigCommand`).sc(v.UpdateCodeSigningConfig$).build(){},xt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateEventSourceMapping`,{}).n(`LambdaClient`,`UpdateEventSourceMappingCommand`).sc(v.UpdateEventSourceMapping$).build(){},St=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionCode`,{}).n(`LambdaClient`,`UpdateFunctionCodeCommand`).sc(v.UpdateFunctionCode$).build(){},Ct=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionConfiguration`,{}).n(`LambdaClient`,`UpdateFunctionConfigurationCommand`).sc(v.UpdateFunctionConfiguration$).build(){},N=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`UpdateFunctionEventInvokeConfigCommand`).sc(v.UpdateFunctionEventInvokeConfig$).build(){},wt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionUrlConfig`,{}).n(`LambdaClient`,`UpdateFunctionUrlConfigCommand`).sc(v.UpdateFunctionUrlConfig$).build(){};let Tt=o.createPaginator(T,Te,`Marker`,`NextMarker`,`MaxItems`),Et=o.createPaginator(T,Ee,`Marker`,`NextMarker`,`MaxItems`),Dt=o.createPaginator(T,j,`Marker`,`NextMarker`,`MaxItems`),Ot=o.createPaginator(T,He,`Marker`,`NextMarker`,`MaxItems`),kt=o.createPaginator(T,Ue,`Marker`,`NextMarker`,`MaxItems`),At=o.createPaginator(T,We,`Marker`,`NextMarker`,`MaxItems`),jt=o.createPaginator(T,Ge,`Marker`,`NextMarker`,`MaxItems`),Mt=o.createPaginator(T,Ke,`Marker`,`NextMarker`,`MaxItems`),Nt=o.createPaginator(T,qe,`Marker`,`NextMarker`,`MaxItems`),Pt=o.createPaginator(T,Je,`Marker`,`NextMarker`,`MaxItems`),Ft=o.createPaginator(T,Ye,`Marker`,`NextMarker`,`MaxItems`),It=o.createPaginator(T,Xe,`Marker`,`NextMarker`,`MaxItems`),Lt=o.createPaginator(T,Ze,`Marker`,`NextMarker`,`MaxItems`),Rt=o.createPaginator(T,Qe,`Marker`,`NextMarker`,`MaxItems`),zt=o.createPaginator(T,$e,`Marker`,`NextMarker`,`MaxItems`),Bt=o.createPaginator(T,tt,`Marker`,`NextMarker`,`MaxItems`),Vt=async(e,t)=>{let n;try{let r=await e.send(new ke(t));n=r;try{if(r.State===`Active`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.State===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.State===`Pending`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},Ht=async(e,t)=>y.createWaiter({minDelay:5,maxDelay:300,...e},t,Vt),Ut=async(e,t)=>{let n=await y.createWaiter({minDelay:5,maxDelay:300,...e},t,Vt);return y.checkExceptions(n)},Wt=async(e,t)=>{let n;try{let r=await e.send(new k(t));n=r;try{if(r.Configuration.State===`Active`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.Configuration.State===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.Configuration.State===`Pending`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},Gt=async(e,t)=>y.createWaiter({minDelay:1,maxDelay:300,...e},t,Wt),P=async(e,t)=>{let n=await y.createWaiter({minDelay:1,maxDelay:300,...e},t,Wt);return y.checkExceptions(n)},Kt=async(e,t)=>{let n;try{return n=await e.send(new k(t)),{state:y.WaiterState.SUCCESS,reason:n}}catch(e){if(n=e,e.name&&e.name==`ResourceNotFoundException`)return{state:y.WaiterState.RETRY,reason:n}}return{state:y.WaiterState.RETRY,reason:n}},qt=async(e,t)=>y.createWaiter({minDelay:1,maxDelay:20,...e},t,Kt),Jt=async(e,t)=>{let n=await y.createWaiter({minDelay:1,maxDelay:20,...e},t,Kt);return y.checkExceptions(n)},Yt=async(e,t)=>{let n;try{let r=await e.send(new ke(t));n=r;try{if(r.LastUpdateStatus===`Successful`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.LastUpdateStatus===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.LastUpdateStatus===`InProgress`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},Xt=async(e,t)=>y.createWaiter({minDelay:5,maxDelay:300,...e},t,Yt),Zt=async(e,t)=>{let n=await y.createWaiter({minDelay:5,maxDelay:300,...e},t,Yt);return y.checkExceptions(n)},Qt=async(e,t)=>{let n;try{let r=await e.send(new k(t));n=r;try{if(r.Configuration.LastUpdateStatus===`Successful`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.Configuration.LastUpdateStatus===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.Configuration.LastUpdateStatus===`InProgress`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},$t=async(e,t)=>y.createWaiter({minDelay:1,maxDelay:300,...e},t,Qt),en=async(e,t)=>{let n=await y.createWaiter({minDelay:1,maxDelay:300,...e},t,Qt);return y.checkExceptions(n)},tn=async(e,t)=>{let n;try{let r=await e.send(new ke(t));n=r;try{if(r.State===`Active`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.State===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.State===`Pending`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},nn=async(e,t)=>y.createWaiter({minDelay:5,maxDelay:1560,...e},t,tn),rn=async(e,t)=>{let n=await y.createWaiter({minDelay:5,maxDelay:1560,...e},t,tn);return y.checkExceptions(n)},F={AddLayerVersionPermissionCommand:E,AddPermissionCommand:ne,CheckpointDurableExecutionCommand:re,CreateAliasCommand:ie,CreateCapacityProviderCommand:ae,CreateCodeSigningConfigCommand:oe,CreateEventSourceMappingCommand:se,CreateFunctionCommand:ce,CreateFunctionUrlConfigCommand:le,DeleteAliasCommand:ue,DeleteCapacityProviderCommand:de,DeleteCodeSigningConfigCommand:fe,DeleteEventSourceMappingCommand:pe,DeleteFunctionCommand:he,DeleteFunctionCodeSigningConfigCommand:me,DeleteFunctionConcurrencyCommand:ge,DeleteFunctionEventInvokeConfigCommand:_e,DeleteFunctionUrlConfigCommand:ve,DeleteLayerVersionCommand:ye,DeleteProvisionedConcurrencyConfigCommand:be,GetAccountSettingsCommand:D,GetAliasCommand:xe,GetCapacityProviderCommand:Se,GetCodeSigningConfigCommand:Ce,GetDurableExecutionCommand:we,GetDurableExecutionHistoryCommand:Te,GetDurableExecutionStateCommand:Ee,GetEventSourceMappingCommand:O,GetFunctionCommand:k,GetFunctionCodeSigningConfigCommand:De,GetFunctionConcurrencyCommand:Oe,GetFunctionConfigurationCommand:ke,GetFunctionEventInvokeConfigCommand:Ae,GetFunctionRecursionConfigCommand:je,GetFunctionScalingConfigCommand:Me,GetFunctionUrlConfigCommand:Ne,GetLayerVersionCommand:Fe,GetLayerVersionByArnCommand:Pe,GetLayerVersionPolicyCommand:A,GetPolicyCommand:Ie,GetProvisionedConcurrencyConfigCommand:Le,GetRuntimeManagementConfigCommand:Re,InvokeCommand:Be,InvokeAsyncCommand:ze,InvokeWithResponseStreamCommand:Ve,ListAliasesCommand:j,ListCapacityProvidersCommand:He,ListCodeSigningConfigsCommand:Ue,ListDurableExecutionsByFunctionCommand:We,ListEventSourceMappingsCommand:Ge,ListFunctionEventInvokeConfigsCommand:Ke,ListFunctionsCommand:Je,ListFunctionsByCodeSigningConfigCommand:qe,ListFunctionUrlConfigsCommand:Ye,ListFunctionVersionsByCapacityProviderCommand:Xe,ListLayersCommand:Ze,ListLayerVersionsCommand:Qe,ListProvisionedConcurrencyConfigsCommand:$e,ListTagsCommand:et,ListVersionsByFunctionCommand:tt,PublishLayerVersionCommand:nt,PublishVersionCommand:M,PutFunctionCodeSigningConfigCommand:rt,PutFunctionConcurrencyCommand:it,PutFunctionEventInvokeConfigCommand:at,PutFunctionRecursionConfigCommand:ot,PutFunctionScalingConfigCommand:st,PutProvisionedConcurrencyConfigCommand:ct,PutRuntimeManagementConfigCommand:lt,RemoveLayerVersionPermissionCommand:ut,RemovePermissionCommand:dt,SendDurableExecutionCallbackFailureCommand:ft,SendDurableExecutionCallbackHeartbeatCommand:pt,SendDurableExecutionCallbackSuccessCommand:mt,StopDurableExecutionCommand:ht,TagResourceCommand:gt,UntagResourceCommand:_t,UpdateAliasCommand:vt,UpdateCapacityProviderCommand:yt,UpdateCodeSigningConfigCommand:bt,UpdateEventSourceMappingCommand:xt,UpdateFunctionCodeCommand:St,UpdateFunctionConfigurationCommand:Ct,UpdateFunctionEventInvokeConfigCommand:N,UpdateFunctionUrlConfigCommand:wt},I={paginateGetDurableExecutionHistory:Tt,paginateGetDurableExecutionState:Et,paginateListAliases:Dt,paginateListCapacityProviders:Ot,paginateListCodeSigningConfigs:kt,paginateListDurableExecutionsByFunction:At,paginateListEventSourceMappings:jt,paginateListFunctionEventInvokeConfigs:Mt,paginateListFunctions:Pt,paginateListFunctionsByCodeSigningConfig:Nt,paginateListFunctionUrlConfigs:Ft,paginateListFunctionVersionsByCapacityProvider:It,paginateListLayers:Lt,paginateListLayerVersions:Rt,paginateListProvisionedConcurrencyConfigs:zt,paginateListVersionsByFunction:Bt},an={waitUntilFunctionActiveV2:P,waitUntilFunctionExists:Jt,waitUntilFunctionUpdatedV2:en,waitUntilFunctionActive:Ut,waitUntilFunctionUpdated:Zt,waitUntilPublishedVersionActive:rn};var on=class extends T{};f.createAggregatedClient(F,on,{paginators:I,waiters:an}),e.$Command=f.Command,e.__Client=f.Client,e.LambdaServiceException=x.LambdaServiceException,e.AddLayerVersionPermissionCommand=E,e.AddPermissionCommand=ne,e.ApplicationLogLevel={Debug:`DEBUG`,Error:`ERROR`,Fatal:`FATAL`,Info:`INFO`,Trace:`TRACE`,Warn:`WARN`},e.Architecture={arm64:`arm64`,x86_64:`x86_64`},e.CapacityProviderPredefinedMetricType={LambdaCapacityProviderAverageCPUUtilization:`LambdaCapacityProviderAverageCPUUtilization`},e.CapacityProviderScalingMode={Auto:`Auto`,Manual:`Manual`},e.CapacityProviderState={Active:`Active`,Deleting:`Deleting`,Failed:`Failed`,Pending:`Pending`},e.CheckpointDurableExecutionCommand=re,e.CodeSigningPolicy={Enforce:`Enforce`,Warn:`Warn`},e.CreateAliasCommand=ie,e.CreateCapacityProviderCommand=ae,e.CreateCodeSigningConfigCommand=oe,e.CreateEventSourceMappingCommand=se,e.CreateFunctionCommand=ce,e.CreateFunctionUrlConfigCommand=le,e.DeleteAliasCommand=ue,e.DeleteCapacityProviderCommand=de,e.DeleteCodeSigningConfigCommand=fe,e.DeleteEventSourceMappingCommand=pe,e.DeleteFunctionCodeSigningConfigCommand=me,e.DeleteFunctionCommand=he,e.DeleteFunctionConcurrencyCommand=ge,e.DeleteFunctionEventInvokeConfigCommand=_e,e.DeleteFunctionUrlConfigCommand=ve,e.DeleteLayerVersionCommand=ye,e.DeleteProvisionedConcurrencyConfigCommand=be,e.EndPointType={KAFKA_BOOTSTRAP_SERVERS:`KAFKA_BOOTSTRAP_SERVERS`},e.EventSourceMappingMetric={ErrorCount:`ErrorCount`,EventCount:`EventCount`,KafkaMetrics:`KafkaMetrics`},e.EventSourceMappingSystemLogLevel={Debug:`DEBUG`,Info:`INFO`,Warn:`WARN`},e.EventSourcePosition={AT_TIMESTAMP:`AT_TIMESTAMP`,LATEST:`LATEST`,TRIM_HORIZON:`TRIM_HORIZON`},e.EventType={CallbackFailed:`CallbackFailed`,CallbackStarted:`CallbackStarted`,CallbackSucceeded:`CallbackSucceeded`,CallbackTimedOut:`CallbackTimedOut`,ChainedInvokeFailed:`ChainedInvokeFailed`,ChainedInvokeStarted:`ChainedInvokeStarted`,ChainedInvokeStopped:`ChainedInvokeStopped`,ChainedInvokeSucceeded:`ChainedInvokeSucceeded`,ChainedInvokeTimedOut:`ChainedInvokeTimedOut`,ContextFailed:`ContextFailed`,ContextStarted:`ContextStarted`,ContextSucceeded:`ContextSucceeded`,ExecutionFailed:`ExecutionFailed`,ExecutionStarted:`ExecutionStarted`,ExecutionStopped:`ExecutionStopped`,ExecutionSucceeded:`ExecutionSucceeded`,ExecutionTimedOut:`ExecutionTimedOut`,InvocationCompleted:`InvocationCompleted`,StepFailed:`StepFailed`,StepStarted:`StepStarted`,StepSucceeded:`StepSucceeded`,WaitCancelled:`WaitCancelled`,WaitStarted:`WaitStarted`,WaitSucceeded:`WaitSucceeded`},e.ExecutionStatus={FAILED:`FAILED`,RUNNING:`RUNNING`,STOPPED:`STOPPED`,SUCCEEDED:`SUCCEEDED`,TIMED_OUT:`TIMED_OUT`},e.FullDocument={Default:`Default`,UpdateLookup:`UpdateLookup`},e.FunctionResponseType={ReportBatchItemFailures:`ReportBatchItemFailures`},e.FunctionUrlAuthType={AWS_IAM:`AWS_IAM`,NONE:`NONE`},e.FunctionVersion={ALL:`ALL`},e.FunctionVersionLatestPublished={LATEST_PUBLISHED:`LATEST_PUBLISHED`},e.GetAccountSettingsCommand=D,e.GetAliasCommand=xe,e.GetCapacityProviderCommand=Se,e.GetCodeSigningConfigCommand=Ce,e.GetDurableExecutionCommand=we,e.GetDurableExecutionHistoryCommand=Te,e.GetDurableExecutionStateCommand=Ee,e.GetEventSourceMappingCommand=O,e.GetFunctionCodeSigningConfigCommand=De,e.GetFunctionCommand=k,e.GetFunctionConcurrencyCommand=Oe,e.GetFunctionConfigurationCommand=ke,e.GetFunctionEventInvokeConfigCommand=Ae,e.GetFunctionRecursionConfigCommand=je,e.GetFunctionScalingConfigCommand=Me,e.GetFunctionUrlConfigCommand=Ne,e.GetLayerVersionByArnCommand=Pe,e.GetLayerVersionCommand=Fe,e.GetLayerVersionPolicyCommand=A,e.GetPolicyCommand=Ie,e.GetProvisionedConcurrencyConfigCommand=Le,e.GetRuntimeManagementConfigCommand=Re,e.InvocationType={DryRun:`DryRun`,Event:`Event`,RequestResponse:`RequestResponse`},e.InvokeAsyncCommand=ze,e.InvokeCommand=Be,e.InvokeMode={BUFFERED:`BUFFERED`,RESPONSE_STREAM:`RESPONSE_STREAM`},e.InvokeWithResponseStreamCommand=Ve,e.KafkaSchemaRegistryAuthType={BASIC_AUTH:`BASIC_AUTH`,CLIENT_CERTIFICATE_TLS_AUTH:`CLIENT_CERTIFICATE_TLS_AUTH`,SERVER_ROOT_CA_CERTIFICATE:`SERVER_ROOT_CA_CERTIFICATE`},e.KafkaSchemaValidationAttribute={KEY:`KEY`,VALUE:`VALUE`},e.Lambda=on,e.LambdaClient=T,e.LastUpdateStatus={Failed:`Failed`,InProgress:`InProgress`,Successful:`Successful`},e.LastUpdateStatusReasonCode={CapacityProviderScalingLimitExceeded:`CapacityProviderScalingLimitExceeded`,DisabledKMSKey:`DisabledKMSKey`,DisallowedByVpcEncryptionControl:`DisallowedByVpcEncryptionControl`,EC2RequestLimitExceeded:`EC2RequestLimitExceeded`,EFSIOError:`EFSIOError`,EFSMountConnectivityError:`EFSMountConnectivityError`,EFSMountFailure:`EFSMountFailure`,EFSMountTimeout:`EFSMountTimeout`,EniLimitExceeded:`EniLimitExceeded`,FunctionError:`FunctionError`,FunctionErrorExtensionInitError:`FunctionError.ExtensionInitError`,FunctionErrorInitResourceExhausted:`FunctionError.InitResourceExhausted`,FunctionErrorInitTimeout:`FunctionError.InitTimeout`,FunctionErrorInvalidEntryPoint:`FunctionError.InvalidEntryPoint`,FunctionErrorInvalidWorkingDirectory:`FunctionError.InvalidWorkingDirectory`,FunctionErrorPermissionDenied:`FunctionError.PermissionDenied`,FunctionErrorRuntimeInitError:`FunctionError.RuntimeInitError`,FunctionErrorTooManyExtensions:`FunctionError.TooManyExtensions`,ImageAccessDenied:`ImageAccessDenied`,ImageDeleted:`ImageDeleted`,InsufficientCapacity:`InsufficientCapacity`,InsufficientRolePermissions:`InsufficientRolePermissions`,InternalError:`InternalError`,InvalidConfiguration:`InvalidConfiguration`,InvalidImage:`InvalidImage`,InvalidRuntime:`InvalidRuntime`,InvalidSecurityGroup:`InvalidSecurityGroup`,InvalidStateKMSKey:`InvalidStateKMSKey`,InvalidSubnet:`InvalidSubnet`,InvalidZipFileException:`InvalidZipFileException`,KMSKeyAccessDenied:`KMSKeyAccessDenied`,KMSKeyNotFound:`KMSKeyNotFound`,SubnetOutOfIPAddresses:`SubnetOutOfIPAddresses`,VcpuLimitExceeded:`VcpuLimitExceeded`},e.ListAliasesCommand=j,e.ListCapacityProvidersCommand=He,e.ListCodeSigningConfigsCommand=Ue,e.ListDurableExecutionsByFunctionCommand=We,e.ListEventSourceMappingsCommand=Ge,e.ListFunctionEventInvokeConfigsCommand=Ke,e.ListFunctionUrlConfigsCommand=Ye,e.ListFunctionVersionsByCapacityProviderCommand=Xe,e.ListFunctionsByCodeSigningConfigCommand=qe,e.ListFunctionsCommand=Je,e.ListLayerVersionsCommand=Qe,e.ListLayersCommand=Ze,e.ListProvisionedConcurrencyConfigsCommand=$e,e.ListTagsCommand=et,e.ListVersionsByFunctionCommand=tt,e.LogFormat={Json:`JSON`,Text:`Text`},e.LogType={None:`None`,Tail:`Tail`},e.OperationAction={CANCEL:`CANCEL`,FAIL:`FAIL`,RETRY:`RETRY`,START:`START`,SUCCEED:`SUCCEED`},e.OperationStatus={CANCELLED:`CANCELLED`,FAILED:`FAILED`,PENDING:`PENDING`,READY:`READY`,STARTED:`STARTED`,STOPPED:`STOPPED`,SUCCEEDED:`SUCCEEDED`,TIMED_OUT:`TIMED_OUT`},e.OperationType={CALLBACK:`CALLBACK`,CHAINED_INVOKE:`CHAINED_INVOKE`,CONTEXT:`CONTEXT`,EXECUTION:`EXECUTION`,STEP:`STEP`,WAIT:`WAIT`},e.PackageType={Image:`Image`,Zip:`Zip`},e.ProvisionedConcurrencyStatusEnum={FAILED:`FAILED`,IN_PROGRESS:`IN_PROGRESS`,READY:`READY`},e.PublishLayerVersionCommand=nt,e.PublishVersionCommand=M,e.PutFunctionCodeSigningConfigCommand=rt,e.PutFunctionConcurrencyCommand=it,e.PutFunctionEventInvokeConfigCommand=at,e.PutFunctionRecursionConfigCommand=ot,e.PutFunctionScalingConfigCommand=st,e.PutProvisionedConcurrencyConfigCommand=ct,e.PutRuntimeManagementConfigCommand=lt,e.RecursiveLoop={Allow:`Allow`,Terminate:`Terminate`},e.RemoveLayerVersionPermissionCommand=ut,e.RemovePermissionCommand=dt,e.ResponseStreamingInvocationType={DryRun:`DryRun`,RequestResponse:`RequestResponse`},e.Runtime={dotnet10:`dotnet10`,dotnet6:`dotnet6`,dotnet8:`dotnet8`,dotnetcore10:`dotnetcore1.0`,dotnetcore20:`dotnetcore2.0`,dotnetcore21:`dotnetcore2.1`,dotnetcore31:`dotnetcore3.1`,go1x:`go1.x`,java11:`java11`,java17:`java17`,java21:`java21`,java25:`java25`,java8:`java8`,java8al2:`java8.al2`,nodejs:`nodejs`,nodejs10x:`nodejs10.x`,nodejs12x:`nodejs12.x`,nodejs14x:`nodejs14.x`,nodejs16x:`nodejs16.x`,nodejs18x:`nodejs18.x`,nodejs20x:`nodejs20.x`,nodejs22x:`nodejs22.x`,nodejs24x:`nodejs24.x`,nodejs43:`nodejs4.3`,nodejs43edge:`nodejs4.3-edge`,nodejs610:`nodejs6.10`,nodejs810:`nodejs8.10`,provided:`provided`,providedal2:`provided.al2`,providedal2023:`provided.al2023`,python27:`python2.7`,python310:`python3.10`,python311:`python3.11`,python312:`python3.12`,python313:`python3.13`,python314:`python3.14`,python36:`python3.6`,python37:`python3.7`,python38:`python3.8`,python39:`python3.9`,ruby25:`ruby2.5`,ruby27:`ruby2.7`,ruby32:`ruby3.2`,ruby33:`ruby3.3`,ruby34:`ruby3.4`},e.SchemaRegistryEventRecordFormat={JSON:`JSON`,SOURCE:`SOURCE`},e.SendDurableExecutionCallbackFailureCommand=ft,e.SendDurableExecutionCallbackHeartbeatCommand=pt,e.SendDurableExecutionCallbackSuccessCommand=mt,e.SnapStartApplyOn={None:`None`,PublishedVersions:`PublishedVersions`},e.SnapStartOptimizationStatus={Off:`Off`,On:`On`},e.SourceAccessType={BASIC_AUTH:`BASIC_AUTH`,CLIENT_CERTIFICATE_TLS_AUTH:`CLIENT_CERTIFICATE_TLS_AUTH`,SASL_SCRAM_256_AUTH:`SASL_SCRAM_256_AUTH`,SASL_SCRAM_512_AUTH:`SASL_SCRAM_512_AUTH`,SERVER_ROOT_CA_CERTIFICATE:`SERVER_ROOT_CA_CERTIFICATE`,VIRTUAL_HOST:`VIRTUAL_HOST`,VPC_SECURITY_GROUP:`VPC_SECURITY_GROUP`,VPC_SUBNET:`VPC_SUBNET`},e.State={Active:`Active`,ActiveNonInvocable:`ActiveNonInvocable`,Deactivated:`Deactivated`,Deactivating:`Deactivating`,Deleting:`Deleting`,Failed:`Failed`,Inactive:`Inactive`,Pending:`Pending`},e.StateReasonCode={CapacityProviderScalingLimitExceeded:`CapacityProviderScalingLimitExceeded`,Creating:`Creating`,DisabledKMSKey:`DisabledKMSKey`,DisallowedByVpcEncryptionControl:`DisallowedByVpcEncryptionControl`,DrainingDurableExecutions:`DrainingDurableExecutions`,EC2RequestLimitExceeded:`EC2RequestLimitExceeded`,EFSIOError:`EFSIOError`,EFSMountConnectivityError:`EFSMountConnectivityError`,EFSMountFailure:`EFSMountFailure`,EFSMountTimeout:`EFSMountTimeout`,EniLimitExceeded:`EniLimitExceeded`,FunctionError:`FunctionError`,FunctionErrorExtensionInitError:`FunctionError.ExtensionInitError`,FunctionErrorInitResourceExhausted:`FunctionError.InitResourceExhausted`,FunctionErrorInitTimeout:`FunctionError.InitTimeout`,FunctionErrorInvalidEntryPoint:`FunctionError.InvalidEntryPoint`,FunctionErrorInvalidWorkingDirectory:`FunctionError.InvalidWorkingDirectory`,FunctionErrorPermissionDenied:`FunctionError.PermissionDenied`,FunctionErrorRuntimeInitError:`FunctionError.RuntimeInitError`,FunctionErrorTooManyExtensions:`FunctionError.TooManyExtensions`,Idle:`Idle`,ImageAccessDenied:`ImageAccessDenied`,ImageDeleted:`ImageDeleted`,InsufficientCapacity:`InsufficientCapacity`,InsufficientRolePermissions:`InsufficientRolePermissions`,InternalError:`InternalError`,InvalidConfiguration:`InvalidConfiguration`,InvalidImage:`InvalidImage`,InvalidRuntime:`InvalidRuntime`,InvalidSecurityGroup:`InvalidSecurityGroup`,InvalidStateKMSKey:`InvalidStateKMSKey`,InvalidSubnet:`InvalidSubnet`,InvalidZipFileException:`InvalidZipFileException`,KMSKeyAccessDenied:`KMSKeyAccessDenied`,KMSKeyNotFound:`KMSKeyNotFound`,Restoring:`Restoring`,SubnetOutOfIPAddresses:`SubnetOutOfIPAddresses`,VcpuLimitExceeded:`VcpuLimitExceeded`},e.StopDurableExecutionCommand=ht,e.SystemLogLevel={Debug:`DEBUG`,Info:`INFO`,Warn:`WARN`},e.TagResourceCommand=gt,e.TenantIsolationMode={PER_TENANT:`PER_TENANT`},e.ThrottleReason={CallerRateLimitExceeded:`CallerRateLimitExceeded`,ConcurrentInvocationLimitExceeded:`ConcurrentInvocationLimitExceeded`,ConcurrentSnapshotCreateLimitExceeded:`ConcurrentSnapshotCreateLimitExceeded`,FunctionInvocationRateLimitExceeded:`FunctionInvocationRateLimitExceeded`,ReservedFunctionConcurrentInvocationLimitExceeded:`ReservedFunctionConcurrentInvocationLimitExceeded`,ReservedFunctionInvocationRateLimitExceeded:`ReservedFunctionInvocationRateLimitExceeded`},e.TracingMode={Active:`Active`,PassThrough:`PassThrough`},e.UntagResourceCommand=_t,e.UpdateAliasCommand=vt,e.UpdateCapacityProviderCommand=yt,e.UpdateCodeSigningConfigCommand=bt,e.UpdateEventSourceMappingCommand=xt,e.UpdateFunctionCodeCommand=St,e.UpdateFunctionConfigurationCommand=Ct,e.UpdateFunctionEventInvokeConfigCommand=N,e.UpdateFunctionUrlConfigCommand=wt,e.UpdateRuntimeOn={Auto:`Auto`,FunctionUpdate:`FunctionUpdate`,Manual:`Manual`},e.paginateGetDurableExecutionHistory=Tt,e.paginateGetDurableExecutionState=Et,e.paginateListAliases=Dt,e.paginateListCapacityProviders=Ot,e.paginateListCodeSigningConfigs=kt,e.paginateListDurableExecutionsByFunction=At,e.paginateListEventSourceMappings=jt,e.paginateListFunctionEventInvokeConfigs=Mt,e.paginateListFunctionUrlConfigs=Ft,e.paginateListFunctionVersionsByCapacityProvider=It,e.paginateListFunctions=Pt,e.paginateListFunctionsByCodeSigningConfig=Nt,e.paginateListLayerVersions=Rt,e.paginateListLayers=Lt,e.paginateListProvisionedConcurrencyConfigs=zt,e.paginateListVersionsByFunction=Bt,e.waitForFunctionActive=Ht,e.waitForFunctionActiveV2=Gt,e.waitForFunctionExists=qt,e.waitForFunctionUpdated=Xt,e.waitForFunctionUpdatedV2=$t,e.waitForPublishedVersionActive=nn,e.waitUntilFunctionActive=Ut,e.waitUntilFunctionActiveV2=P,e.waitUntilFunctionExists=Jt,e.waitUntilFunctionUpdated=Zt,e.waitUntilFunctionUpdatedV2=en,e.waitUntilPublishedVersionActive=rn,Object.prototype.hasOwnProperty.call(v,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:v.__proto__}),Object.keys(v).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=v[t])}),Object.prototype.hasOwnProperty.call(b,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:b.__proto__}),Object.keys(b).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=b[t])})}))(),FP=class extends Error{constructor(e,t){super(t),this.type=e}type},IP=e=>typeof e==`object`&&!!e&&`__error__`in e&&typeof e.__error__==`object`,LP=nd(()=>new PP.LambdaClient({})),RP=e=>typeof e==`object`&&!!e&&typeof e.errorMessage==`string`,zP=async({client:e=LP(),name:t,qualifier:n,type:r=`RequestResponse`,payload:i,reflectViewableErrors:a=!0})=>{let o=new PP.InvokeCommand({InvocationType:r,FunctionName:t,Payload:i?new TextEncoder().encode(ze(i)):void 0,Qualifier:n}),s=await e.send(o);if(!s.Payload)return;let c=new TextDecoder().decode(s.Payload);if(!c)return;let l=Le(c);if(IP(l)){let e=l.__error__;throw a?new FP(e.type,e.message):Error(e.message)}if(RP(l)){let e=Error(l.errorMessage);throw e.name=l.errorType,e}return l};new class{#e;async run(e,t){this.#e=e;try{return await t()}finally{this.#e=void 0}}get(){return this.#e}};var BP=class{registry;cache;constructor(){this.cache=new Map,this.registry=new FinalizationRegistry(e=>{this.cache.delete(e)})}set(e,t){let n={value:t},r=new WeakRef(n);return this.cache.set(e,r),this.registry.register(n,e,r),this}get(e,t){let n=this.cache.get(e);if(n){let e=n.deref();if(e!==void 0)return e.value}return t}has(e){return this.get(e)!==void 0}delete(e){let t=this.cache.get(e);return t?(this.cache.delete(e),this.registry.unregister(t),!0):!1}clear(){for(let e of this.keys())this.delete(e)}get size(){return this.cache.size}[Symbol.iterator](){return this.entries()}keys(){return this.cache.keys()}*values(){for(let e of this.cache.values()){let t=e.deref();t&&(yield t.value)}}*entries(){for(let[e,t]of this.cache.entries()){let n=t.deref();n&&(yield[e,n.value])}}};const VP=3600*24;VP*7,VP*365.2425;const HP=Symbol.for(`constructDateFrom`);function UP(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&HP in e?e[HP](t):e instanceof Date?new e.constructor(t):new Date(t)}function WP(e,t){return UP(t||e,e)}function GP(e,t,n){return UP(n?.in||e,+WP(e)+t)}function KP(e,t,n){return GP(e,t*1e3,n)}function qP(e){return+WP(e)>Date.now()}const JP=de([oe({authorized:ae(!0),allowed:ne(le()),context:se(ce(le(),fe())),ttl:se(Ve(),De(1))}),oe({authorized:ae(!1)})]),YP=new BP,XP=async e=>{if(!process.env.AUTH)return{authorized:!1,reason:`No authorizer configured`};if(!e)return{authorized:!1,reason:`No authentication token provided`};let t=YP.get(e);if(t){if(qP(t.ttl))return{authorized:!0,context:t.context,allowed:t.allowed};YP.delete(e)}let n;try{n=await zP({name:process.env.AUTH,payload:{token:e}})}catch(e){return console.error(e),{authorized:!1,reason:`Invoke auth handle error`}}let r=me(JP,n);if(!r.success)return{authorized:!1,reason:`Invalid auth handle response`};if(!r.output.authorized)return{authorized:!1,reason:`Invalid auth token`};let i=KP(new Date,Number(k(r.output.ttl))),a=r.output.context,o=r.output.allowed;return YP.set(e,{ttl:i,context:a,allowed:o}),{authorized:!0,context:a,allowed:o}};var ZP=u(((e,t)=>{t.exports={acl:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},append:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},asking:{arity:1,flags:[`fast`],keyStart:0,keyStop:0,step:0},auth:{arity:-2,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},bgrewriteaof:{arity:1,flags:[`admin`,`noscript`,`no_async_loading`],keyStart:0,keyStop:0,step:0},bgsave:{arity:-1,flags:[`admin`,`noscript`,`no_async_loading`],keyStart:0,keyStop:0,step:0},bitcount:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},bitfield:{arity:-2,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},bitfield_ro:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},bitop:{arity:-4,flags:[`write`,`denyoom`],keyStart:2,keyStop:-1,step:1},bitpos:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},blmove:{arity:6,flags:[`write`,`denyoom`,`noscript`,`blocking`],keyStart:1,keyStop:2,step:1},blmpop:{arity:-5,flags:[`write`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},blpop:{arity:-3,flags:[`write`,`noscript`,`blocking`],keyStart:1,keyStop:-2,step:1},brpop:{arity:-3,flags:[`write`,`noscript`,`blocking`],keyStart:1,keyStop:-2,step:1},brpoplpush:{arity:4,flags:[`write`,`denyoom`,`noscript`,`blocking`],keyStart:1,keyStop:2,step:1},bzmpop:{arity:-5,flags:[`write`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},bzpopmax:{arity:-3,flags:[`write`,`noscript`,`blocking`,`fast`],keyStart:1,keyStop:-2,step:1},bzpopmin:{arity:-3,flags:[`write`,`noscript`,`blocking`,`fast`],keyStart:1,keyStop:-2,step:1},client:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},cluster:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},command:{arity:-1,flags:[`loading`,`stale`],keyStart:0,keyStop:0,step:0},config:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},copy:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},dbsize:{arity:1,flags:[`readonly`,`fast`],keyStart:0,keyStop:0,step:0},debug:{arity:-2,flags:[`admin`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},decr:{arity:2,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},decrby:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},del:{arity:-2,flags:[`write`],keyStart:1,keyStop:-1,step:1},discard:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:0,keyStop:0,step:0},dump:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},echo:{arity:2,flags:[`fast`],keyStart:0,keyStop:0,step:0},eval:{arity:-3,flags:[`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},eval_ro:{arity:-3,flags:[`readonly`,`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},evalsha:{arity:-3,flags:[`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},evalsha_ro:{arity:-3,flags:[`readonly`,`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},exec:{arity:1,flags:[`noscript`,`loading`,`stale`,`skip_slowlog`],keyStart:0,keyStop:0,step:0},exists:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:-1,step:1},expire:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},expireat:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},expiretime:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},failover:{arity:-1,flags:[`admin`,`noscript`,`stale`],keyStart:0,keyStop:0,step:0},fcall:{arity:-3,flags:[`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},fcall_ro:{arity:-3,flags:[`readonly`,`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},flushall:{arity:-1,flags:[`write`],keyStart:0,keyStop:0,step:0},flushdb:{arity:-1,flags:[`write`],keyStart:0,keyStop:0,step:0},function:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},geoadd:{arity:-5,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},geodist:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geohash:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geopos:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},georadius:{arity:-6,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},georadius_ro:{arity:-6,flags:[`readonly`],keyStart:1,keyStop:1,step:1},georadiusbymember:{arity:-5,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},georadiusbymember_ro:{arity:-5,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geosearch:{arity:-7,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geosearchstore:{arity:-8,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},get:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},getbit:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},getdel:{arity:2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},getex:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},getrange:{arity:4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},getset:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hdel:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hello:{arity:-1,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},hexists:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hexpire:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hexpireat:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hexpiretime:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hget:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hgetall:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hgetdel:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hgetex:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hincrby:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hincrbyfloat:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hkeys:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hlen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hmget:{arity:-3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hmset:{arity:-4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hpersist:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hpexpire:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hpexpireat:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hpexpiretime:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hpttl:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hrandfield:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hscan:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hset:{arity:-4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hsetex:{arity:-6,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hsetnx:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hstrlen:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},httl:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hvals:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},incr:{arity:2,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},incrby:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},incrbyfloat:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},info:{arity:-1,flags:[`loading`,`stale`],keyStart:0,keyStop:0,step:0},keys:{arity:2,flags:[`readonly`],keyStart:0,keyStop:0,step:0},lastsave:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},latency:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},lcs:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:2,step:1},lindex:{arity:3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},linsert:{arity:5,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},llen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},lmove:{arity:5,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},lmpop:{arity:-4,flags:[`write`,`movablekeys`],keyStart:0,keyStop:0,step:0},lolwut:{arity:-1,flags:[`readonly`,`fast`],keyStart:0,keyStop:0,step:0},lpop:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},lpos:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},lpush:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},lpushx:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},lrange:{arity:4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},lrem:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},lset:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},ltrim:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},memory:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},mget:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:-1,step:1},migrate:{arity:-6,flags:[`write`,`movablekeys`],keyStart:3,keyStop:3,step:1},module:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},monitor:{arity:1,flags:[`admin`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},move:{arity:3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},mset:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:2},msetnx:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:2},multi:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:0,keyStop:0,step:0},object:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},persist:{arity:2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},pexpire:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},pexpireat:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},pexpiretime:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},pfadd:{arity:-2,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},pfcount:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},pfdebug:{arity:3,flags:[`write`,`denyoom`,`admin`],keyStart:2,keyStop:2,step:1},pfmerge:{arity:-2,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},pfselftest:{arity:1,flags:[`admin`],keyStart:0,keyStop:0,step:0},ping:{arity:-1,flags:[`fast`],keyStart:0,keyStop:0,step:0},psetex:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},psubscribe:{arity:-2,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},psync:{arity:-3,flags:[`admin`,`noscript`,`no_async_loading`,`no_multi`],keyStart:0,keyStop:0,step:0},pttl:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},publish:{arity:3,flags:[`pubsub`,`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},pubsub:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},punsubscribe:{arity:-1,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},quit:{arity:-1,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},randomkey:{arity:1,flags:[`readonly`],keyStart:0,keyStop:0,step:0},readonly:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},readwrite:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},rename:{arity:3,flags:[`write`],keyStart:1,keyStop:2,step:1},renamenx:{arity:3,flags:[`write`,`fast`],keyStart:1,keyStop:2,step:1},replconf:{arity:-1,flags:[`admin`,`noscript`,`loading`,`stale`,`allow_busy`],keyStart:0,keyStop:0,step:0},replicaof:{arity:3,flags:[`admin`,`noscript`,`stale`,`no_async_loading`],keyStart:0,keyStop:0,step:0},reset:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},restore:{arity:-4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},"restore-asking":{arity:-4,flags:[`write`,`denyoom`,`asking`],keyStart:1,keyStop:1,step:1},role:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},rpop:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},rpoplpush:{arity:3,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},rpush:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},rpushx:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},sadd:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},save:{arity:1,flags:[`admin`,`noscript`,`no_async_loading`,`no_multi`],keyStart:0,keyStop:0,step:0},scan:{arity:-2,flags:[`readonly`],keyStart:0,keyStop:0,step:0},scard:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},script:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},sdiff:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},sdiffstore:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},select:{arity:2,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},set:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},setbit:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},setex:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},setnx:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},setrange:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},shutdown:{arity:-1,flags:[`admin`,`noscript`,`loading`,`stale`,`no_multi`,`allow_busy`],keyStart:0,keyStop:0,step:0},sinter:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},sintercard:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},sinterstore:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},sismember:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},slaveof:{arity:3,flags:[`admin`,`noscript`,`stale`,`no_async_loading`],keyStart:0,keyStop:0,step:0},slowlog:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},smembers:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},smismember:{arity:-3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},smove:{arity:4,flags:[`write`,`fast`],keyStart:1,keyStop:2,step:1},sort:{arity:-2,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},sort_ro:{arity:-2,flags:[`readonly`,`movablekeys`],keyStart:1,keyStop:1,step:1},spop:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},spublish:{arity:3,flags:[`pubsub`,`loading`,`stale`,`fast`],keyStart:1,keyStop:1,step:1},srandmember:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},srem:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},sscan:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},ssubscribe:{arity:-2,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:1,keyStop:-1,step:1},strlen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},subscribe:{arity:-2,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},substr:{arity:4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},sunion:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},sunionstore:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},sunsubscribe:{arity:-1,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:1,keyStop:-1,step:1},swapdb:{arity:3,flags:[`write`,`fast`],keyStart:0,keyStop:0,step:0},sync:{arity:1,flags:[`admin`,`noscript`,`no_async_loading`,`no_multi`],keyStart:0,keyStop:0,step:0},time:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},touch:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:-1,step:1},ttl:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},type:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},unlink:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:-1,step:1},unsubscribe:{arity:-1,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},unwatch:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:0,keyStop:0,step:0},wait:{arity:3,flags:[`noscript`],keyStart:0,keyStop:0,step:0},watch:{arity:-2,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:1,keyStop:-1,step:1},xack:{arity:-4,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xadd:{arity:-5,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},xautoclaim:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xclaim:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xdel:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xdelex:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xgroup:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xinfo:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xlen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},xpending:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},xrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},xread:{arity:-4,flags:[`readonly`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},xreadgroup:{arity:-7,flags:[`write`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},xrevrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},xsetid:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},xtrim:{arity:-4,flags:[`write`],keyStart:1,keyStop:1,step:1},zadd:{arity:-4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},zcard:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zcount:{arity:4,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zdiff:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zdiffstore:{arity:-4,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},zincrby:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},zinter:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zintercard:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zinterstore:{arity:-4,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},zlexcount:{arity:4,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zmpop:{arity:-4,flags:[`write`,`movablekeys`],keyStart:0,keyStop:0,step:0},zmscore:{arity:-3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zpopmax:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},zpopmin:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},zrandmember:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrangebylex:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrangebyscore:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrangestore:{arity:-5,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},zrank:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zrem:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},zremrangebylex:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},zremrangebyrank:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},zremrangebyscore:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},zrevrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrevrangebylex:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrevrangebyscore:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrevrank:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zscan:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zscore:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zunion:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zunionstore:{arity:-4,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1}}})),QP=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.getKeyIndexes=e.hasFlag=e.exists=e.list=void 0;let n=t(ZP());e.list=Object.keys(n.default);let r={};e.list.forEach(e=>{r[e]=n.default[e].flags.reduce(function(e,t){return e[t]=!0,e},{})});function i(e,t){return e=t?.caseInsensitive?String(e).toLowerCase():e,!!n.default[e]}e.exists=i;function a(e,t,n){if(e=n?.nameCaseInsensitive?String(e).toLowerCase():e,!r[e])throw Error(`Unknown command `+e);return!!r[e][t]}e.hasFlag=a;function o(e,t,r){e=r?.nameCaseInsensitive?String(e).toLowerCase():e;let i=n.default[e];if(!i)throw Error(`Unknown command `+e);if(!Array.isArray(t))throw Error(`Expect args to be an array`);let a=[],o=!!(r&&r.parseExternalKey),c=(e,t)=>{let n=[],r=Number(e[t]);for(let e=0;e<r;e++)n.push(e+t+1);return n},l=(e,t,n)=>{for(let r=t;r<e.length-1;r+=1)if(String(e[r]).toLowerCase()===n.toLowerCase())return r+1;return null};switch(e){case`zunionstore`:case`zinterstore`:case`zdiffstore`:a.push(0,...c(t,1));break;case`eval`:case`evalsha`:case`eval_ro`:case`evalsha_ro`:case`fcall`:case`fcall_ro`:case`blmpop`:case`bzmpop`:a.push(...c(t,1));break;case`sintercard`:case`lmpop`:case`zunion`:case`zinter`:case`zmpop`:case`zintercard`:case`zdiff`:a.push(...c(t,0));break;case`georadius`:{a.push(0);let e=l(t,5,`STORE`);e&&a.push(e);let n=l(t,5,`STOREDIST`);n&&a.push(n);break}case`georadiusbymember`:{a.push(0);let e=l(t,4,`STORE`);e&&a.push(e);let n=l(t,4,`STOREDIST`);n&&a.push(n);break}case`sort`:case`sort_ro`:a.push(0);for(let e=1;e<t.length-1;e++){let n=t[e];if(typeof n!=`string`)continue;let r=n.toUpperCase();r===`GET`?(e+=1,n=t[e],n!==`#`&&(o?a.push([e,s(n)]):a.push(e))):r===`BY`?(e+=1,o?a.push([e,s(t[e])]):a.push(e)):r===`STORE`&&(e+=1,a.push(e))}break;case`migrate`:if(t[2]===``)for(let e=5;e<t.length-1;e++){let n=t[e];if(typeof n==`string`&&n.toUpperCase()===`KEYS`){for(let n=e+1;n<t.length;n++)a.push(n);break}}else a.push(2);break;case`xreadgroup`:case`xread`:for(let n=e===`xread`?0:3;n<t.length-1;n++)if(String(t[n]).toUpperCase()===`STREAMS`){for(let e=n+1;e<=n+(t.length-1-n)/2;e++)a.push(e);break}break;default:if(i.step>0){let e=i.keyStart-1,n=i.keyStop>0?i.keyStop:t.length+i.keyStop+1;for(let t=e;t<n;t+=i.step)a.push(t)}break}return a}e.getKeyIndexes=o;function s(e){typeof e!=`string`&&(e=String(e));let t=e.indexOf(`->`);return t===-1?e.length:t}})),$P=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.tryCatch=e.errorObj=void 0,e.errorObj={e:{}};let t;function n(n,r){try{let e=t;return t=null,e.apply(this,arguments)}catch(t){return e.errorObj.e=t,e.errorObj}}function r(e){return t=e,n}e.tryCatch=r})),eF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$P();function n(e){setTimeout(function(){throw e},0)}function r(e,r,i){return typeof r==`function`&&e.then(e=>{let a;a=i!==void 0&&Object(i).spread&&Array.isArray(e)?t.tryCatch(r).apply(void 0,[null].concat(e)):e===void 0?t.tryCatch(r)(null):t.tryCatch(r)(null,e),a===t.errorObj&&n(a.e)},e=>{if(!e){let t=Error(e+``);Object.assign(t,{cause:e}),e=t}let i=t.tryCatch(r)(e);i===t.errorObj&&n(i.e)}),e}e.default=r})),tF=u(((e,t)=>{let n=h(`assert`),r=h(`util`);function i(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}r.inherits(i,Error),Object.defineProperty(i.prototype,`name`,{value:`RedisError`,configurable:!0,writable:!0});function a(e,t,r){n(t),n.strictEqual(typeof r,`number`),Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0});let i=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=i,this.offset=r,this.buffer=t}r.inherits(a,i),Object.defineProperty(a.prototype,`name`,{value:`ParserError`,configurable:!0,writable:!0});function o(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0});let t=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=t}r.inherits(o,i),Object.defineProperty(o.prototype,`name`,{value:`ReplyError`,configurable:!0,writable:!0});function s(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}r.inherits(s,i),Object.defineProperty(s.prototype,`name`,{value:`AbortError`,configurable:!0,writable:!0});function c(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}r.inherits(c,s),Object.defineProperty(c.prototype,`name`,{value:`InterruptError`,configurable:!0,writable:!0}),t.exports={RedisError:i,ParserError:a,ReplyError:o,AbortError:s,InterruptError:c}})),nF=u(((e,t)=>{let n=h(`assert`);var r=class extends Error{get name(){return this.constructor.name}},i=class extends r{constructor(e,t,r){n(t),n.strictEqual(typeof r,`number`);let i=Error.stackTraceLimit;Error.stackTraceLimit=2,super(e),Error.stackTraceLimit=i,this.offset=r,this.buffer=t}get name(){return this.constructor.name}},a=class extends r{constructor(e){let t=Error.stackTraceLimit;Error.stackTraceLimit=2,super(e),Error.stackTraceLimit=t}get name(){return this.constructor.name}},o=class extends r{get name(){return this.constructor.name}};t.exports={RedisError:r,ParserError:i,ReplyError:a,AbortError:o,InterruptError:class extends o{get name(){return this.constructor.name}}}})),rF=u(((e,t)=>{t.exports=process.version.charCodeAt(1)<55&&process.version.charCodeAt(2)===46?tF():nF()})),iF=u(((e,t)=>{var n=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=function(e){for(var t,n=0,r=0,i=[],a=e.length;n<a;n++)t=e.charCodeAt(n),t<128?i[r++]=t:t<2048?(i[r++]=t>>6|192,i[r++]=t&63|128):(t&64512)==55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)==56320?(t=65536+((t&1023)<<10)+(e.charCodeAt(++n)&1023),i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=t&63|128):(i[r++]=t>>12|224,i[r++]=t>>6&63|128,i[r++]=t&63|128);return i},i=t.exports=function(e){for(var t,i=0,a=-1,o=0,s=0,c=typeof e==`string`?r(e):e,l=c.length;i<l;){if(t=c[i++],a===-1)t===123&&(a=i);else if(t!==125)s=n[(t^s>>8)&255]^s<<8;else if(i-1!==a)return s&16383;o=n[(t^o>>8)&255]^o<<8}return o&16383};t.exports.generateMulti=function(e){for(var t=1,n=e.length,r=i(e[0]);t<n;)if(i(e[t++])!==r)return-1;return r}})),aF=u(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=/^(?:0|[1-9]\d*)$/;function s(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function c(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var l=Object.prototype,u=l.hasOwnProperty,d=l.toString,f=l.propertyIsEnumerable,p=Math.max;function m(e,t){var n=T(e)||te(e)?c(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||u.call(e,a))&&!(i&&(a==`length`||x(a,r)))&&n.push(a);return n}function h(e,t,n,r){return e===void 0||ee(e,l[n])&&!u.call(r,n)?t:e}function g(e,t,n){var r=e[t];(!(u.call(e,t)&&ee(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function _(e){if(!ae(e))return w(e);var t=C(e),n=[];for(var r in e)r==`constructor`&&(t||!u.call(e,r))||n.push(r);return n}function v(e,t){return t=p(t===void 0?e.length-1:t,0),function(){for(var n=arguments,r=-1,i=p(n.length-t,0),a=Array(i);++r<i;)a[r]=n[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=n[r];return o[t]=a,s(e,this,o)}}function y(e,t,n,r){n||={};for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;g(n,o,s===void 0?e[o]:s)}return n}function b(e){return v(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&S(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function x(e,t){return t??=n,!!t&&(typeof e==`number`||o.test(e))&&e>-1&&e%1==0&&e<t}function S(e,t,n){if(!ae(n))return!1;var r=typeof t;return(r==`number`?E(n)&&x(t,n.length):r==`string`&&t in n)?ee(n[t],e):!1}function C(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||l)}function w(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}function ee(e,t){return e===t||e!==e&&t!==t}function te(e){return ne(e)&&u.call(e,`callee`)&&(!f.call(e,`callee`)||d.call(e)==r)}var T=Array.isArray;function E(e){return e!=null&&ie(e.length)&&!re(e)}function ne(e){return oe(e)&&E(e)}function re(e){var t=ae(e)?d.call(e):``;return t==i||t==a}function ie(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function ae(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function oe(e){return!!e&&typeof e==`object`}var se=b(function(e,t,n,r){y(t,le(t),e,r)}),ce=v(function(e){return e.push(void 0,h),s(se,void 0,e)});function le(e){return E(e)?m(e,!0):_(e)}t.exports=ce})),oF=u(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=Object.prototype,s=o.hasOwnProperty,c=o.toString,l=o.propertyIsEnumerable;function u(e){return f(e)&&s.call(e,`callee`)&&(!l.call(e,`callee`)||c.call(e)==r)}function d(e){return e!=null&&m(e.length)&&!p(e)}function f(e){return g(e)&&d(e)}function p(e){var t=h(e)?c.call(e):``;return t==i||t==a}function m(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function h(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function g(e){return!!e&&typeof e==`object`}t.exports=u})),sF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isArguments=e.defaults=e.noop=void 0,e.defaults=aF(),e.isArguments=oF();function t(){}e.noop=t})),cF=u(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),lF=u(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=cF(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),uF=u(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=lF()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),dF=u(((e,t)=>{let n=h(`tty`),r=h(`util`);e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=id();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
|
|
78
|
+
`),!0)),new n.CredentialsProviderError(`AWS_PROFILE is set, skipping fromEnv provider.`,{logger:e.logger,tryNextLink:!0});return e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv`),t.fromEnv(e)()},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromSSO`);let{ssoStartUrl:r,ssoAccountId:i,ssoRegion:a,ssoRoleName:o,ssoSession:s}=e;if(!r&&!i&&!a&&!o&&!s)throw new n.CredentialsProviderError(`Skipping SSO provider in default chain (inputs do not include SSO fields).`,{logger:e.logger});let{fromSSO:c}=await Promise.resolve().then(()=>p(mD()));return c(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromIni`);let{fromIni:n}=await Promise.resolve().then(()=>p(fP()));return n(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromProcess`);let{fromProcess:n}=await Promise.resolve().then(()=>p(cP()));return n(e)(t)},async t=>{e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile`);let{fromTokenFile:n}=await Promise.resolve().then(()=>p(dP()));return n(e)(t)},async()=>(e.logger?.debug(`@aws-sdk/credential-provider-node - defaultProvider::remoteProvider`),(await a(e))()),async()=>{throw new n.CredentialsProviderError(`Could not load credentials from any providers`,{tryNextLink:!1,logger:e.logger})}],d),u=e=>e?.expiration!==void 0,d=e=>e?.expiration!==void 0&&e.expiration.getTime()-Date.now()<3e5;e.credentialsTreatedAsExpired=d,e.credentialsWillNeedRefresh=u,e.defaultProvider=l})),mP=u(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>n(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{isArrayBuffer:()=>d}),t.exports=l(u);var d=o(e=>typeof ArrayBuffer==`function`&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)===`[object ArrayBuffer]`,`isArrayBuffer`)})),hP=u(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>n(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{fromArrayBuffer:()=>p,fromString:()=>m}),t.exports=l(u);var d=mP(),f=h(`buffer`),p=o((e,t=0,n=e.byteLength-t)=>{if(!(0,d.isArrayBuffer)(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return f.Buffer.from(e,t,n)},`fromArrayBuffer`),m=o((e,t)=>{if(typeof e!=`string`)throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?f.Buffer.from(e,t):f.Buffer.from(e)},`fromString`)})),gP=u(((e,t)=>{var n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.prototype.hasOwnProperty,o=(e,t)=>n(e,`name`,{value:t,configurable:!0}),s=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},c=(e,t,o,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let c of i(t))!a.call(e,c)&&c!==o&&n(e,c,{get:()=>t[c],enumerable:!(s=r(t,c))||s.enumerable});return e},l=e=>c(n({},`__esModule`,{value:!0}),e),u={};s(u,{fromUtf8:()=>f,toUint8Array:()=>p,toUtf8:()=>m}),t.exports=l(u);var d=hP(),f=o(e=>{let t=(0,d.fromString)(e,`utf8`);return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},`fromUtf8`),p=o(e=>typeof e==`string`?f(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e),`toUint8Array`),m=o(e=>{if(typeof e==`string`)return e;if(typeof e!=`object`||typeof e.byteOffset!=`number`||typeof e.byteLength!=`number`)throw Error(`@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.`);return(0,d.fromArrayBuffer)(e.buffer,e.byteOffset,e.byteLength).toString(`utf8`)},`toUtf8`)})),_P=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertToBuffer=void 0;var t=gP(),n=typeof Buffer<`u`&&Buffer.from?function(e){return Buffer.from(e,`utf8`)}:t.fromUtf8;function r(e){return e instanceof Uint8Array?e:typeof e==`string`?n(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}e.convertToBuffer=r})),vP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmptyData=void 0;function t(e){return typeof e==`string`?e.length===0:e.byteLength===0}e.isEmptyData=t})),yP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.numToUint8=void 0;function t(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}e.numToUint8=t})),bP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uint32ArrayFrom=void 0;function t(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)}e.uint32ArrayFrom=t})),xP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.uint32ArrayFrom=e.numToUint8=e.isEmptyData=e.convertToBuffer=void 0;var t=_P();Object.defineProperty(e,`convertToBuffer`,{enumerable:!0,get:function(){return t.convertToBuffer}});var n=vP();Object.defineProperty(e,`isEmptyData`,{enumerable:!0,get:function(){return n.isEmptyData}});var r=yP();Object.defineProperty(e,`numToUint8`,{enumerable:!0,get:function(){return r.numToUint8}});var i=bP();Object.defineProperty(e,`uint32ArrayFrom`,{enumerable:!0,get:function(){return i.uint32ArrayFrom}})})),SP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsCrc32=void 0;var t=(N(),m(j)),n=xP(),r=CP();e.AwsCrc32=function(){function e(){this.crc32=new r.Crc32}return e.prototype.update=function(e){(0,n.isEmptyData)(e)||this.crc32.update((0,n.convertToBuffer)(e))},e.prototype.digest=function(){return t.__awaiter(this,void 0,void 0,function(){return t.__generator(this,function(e){return[2,(0,n.numToUint8)(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new r.Crc32},e}()})),CP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AwsCrc32=e.Crc32=e.crc32=void 0;var t=(N(),m(j)),n=xP();function r(e){return new i().update(e).digest()}e.crc32=r;var i=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(e){var n,r;try{for(var i=t.__values(e),o=i.next();!o.done;o=i.next()){var s=o.value;this.checksum=this.checksum>>>8^a[(this.checksum^s)&255]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e}();e.Crc32=i;var a=(0,n.uint32ArrayFrom)([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]),o=SP();Object.defineProperty(e,`AwsCrc32`,{enumerable:!0,get:function(){return o.AwsCrc32}})})),wP=u((e=>{var t=CP(),n=Nf(),r=class e{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw Error(`Int64 buffers must be exactly 8 bytes`)}static fromNumber(t){if(t>0x8000000000000000||t<-0x8000000000000000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let n=new Uint8Array(8);for(let e=7,r=Math.abs(Math.round(t));e>-1&&r>0;e--,r/=256)n[e]=r;return t<0&&i(n),new e(n)}valueOf(){let e=this.bytes.slice(0),t=e[0]&128;return t&&i(e),parseInt(n.toHex(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}};function i(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1&&(e[t]++,e[t]===0);t--);}var a=class{toUtf8;fromUtf8;constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){let t=[];for(let n of Object.keys(e)){let r=this.fromUtf8(n);t.push(Uint8Array.from([r.byteLength]),r,this.formatHeaderValue(e[n]))}let n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}formatHeaderValue(e){switch(e.type){case`boolean`:return Uint8Array.from([e.value?0:1]);case`byte`:return Uint8Array.from([2,e.value]);case`short`:let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case`integer`:let i=new DataView(new ArrayBuffer(5));return i.setUint8(0,4),i.setInt32(1,e.value,!1),new Uint8Array(i.buffer);case`long`:let a=new Uint8Array(9);return a[0]=5,a.set(e.value.bytes,1),a;case`binary`:let o=new DataView(new ArrayBuffer(3+e.value.byteLength));o.setUint8(0,6),o.setUint16(1,e.value.byteLength,!1);let s=new Uint8Array(o.buffer);return s.set(e.value,3),s;case`string`:let c=this.fromUtf8(e.value),l=new DataView(new ArrayBuffer(3+c.byteLength));l.setUint8(0,7),l.setUint16(1,c.byteLength,!1);let u=new Uint8Array(l.buffer);return u.set(c,3),u;case`timestamp`:let d=new Uint8Array(9);return d[0]=8,d.set(r.fromNumber(e.value.valueOf()).bytes,1),d;case`uuid`:if(!h.test(e.value))throw Error(`Invalid UUID received: ${e.value}`);let f=new Uint8Array(17);return f[0]=9,f.set(n.fromHex(e.value.replace(/\-/g,``)),1),f}}parse(e){let t={},i=0;for(;i<e.byteLength;){let a=e.getUint8(i++),h=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+i,a));switch(i+=a,e.getUint8(i++)){case 0:t[h]={type:o,value:!0};break;case 1:t[h]={type:o,value:!1};break;case 2:t[h]={type:s,value:e.getInt8(i++)};break;case 3:t[h]={type:c,value:e.getInt16(i,!1)},i+=2;break;case 4:t[h]={type:l,value:e.getInt32(i,!1)},i+=4;break;case 5:t[h]={type:u,value:new r(new Uint8Array(e.buffer,e.byteOffset+i,8))},i+=8;break;case 6:let a=e.getUint16(i,!1);i+=2,t[h]={type:d,value:new Uint8Array(e.buffer,e.byteOffset+i,a)},i+=a;break;case 7:let g=e.getUint16(i,!1);i+=2,t[h]={type:f,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+i,g))},i+=g;break;case 8:t[h]={type:p,value:new Date(new r(new Uint8Array(e.buffer,e.byteOffset+i,8)).valueOf())},i+=8;break;case 9:let _=new Uint8Array(e.buffer,e.byteOffset+i,16);i+=16,t[h]={type:m,value:`${n.toHex(_.subarray(0,4))}-${n.toHex(_.subarray(4,6))}-${n.toHex(_.subarray(6,8))}-${n.toHex(_.subarray(8,10))}-${n.toHex(_.subarray(10))}`};break;default:throw Error(`Unrecognized header type tag`)}}return t}};let o=`boolean`,s=`byte`,c=`short`,l=`integer`,u=`long`,d=`binary`,f=`string`,p=`timestamp`,m=`uuid`,h=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function g({byteLength:e,byteOffset:n,buffer:r}){if(e<16)throw Error(`Provided message too short to accommodate event stream message overhead`);let i=new DataView(r,n,e),a=i.getUint32(0,!1);if(e!==a)throw Error(`Reported message length does not match received message length`);let o=i.getUint32(4,!1),s=i.getUint32(8,!1),c=i.getUint32(e-4,!1),l=new t.Crc32().update(new Uint8Array(r,n,8));if(s!==l.digest())throw Error(`The prelude checksum specified in the message (${s}) does not match the calculated CRC32 checksum (${l.digest()})`);if(l.update(new Uint8Array(r,n+8,e-12)),c!==l.digest())throw Error(`The message checksum (${l.digest()}) did not match the expected value of ${c}`);return{headers:new DataView(r,n+8+4,o),body:new Uint8Array(r,n+8+4+o,a-o-16)}}var _=class{headerMarshaller;messageBuffer;isEndOfStream;constructor(e,t){this.headerMarshaller=new a(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){let e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return t}}}getAvailableMessages(){let e=this.messageBuffer;this.messageBuffer=[];let t=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return t}}}encode({headers:e,body:n}){let r=this.headerMarshaller.format(e),i=r.byteLength+n.byteLength+16,a=new Uint8Array(i),o=new DataView(a.buffer,a.byteOffset,a.byteLength),s=new t.Crc32;return o.setUint32(0,i,!1),o.setUint32(4,r.byteLength,!1),o.setUint32(8,s.update(a.subarray(0,8)).digest(),!1),a.set(r,12),a.set(n,r.byteLength+12),o.setUint32(i-4,s.update(a.subarray(8,i-4)).digest(),!1),a}decode(e){let{headers:t,body:n}=g(e);return{headers:this.headerMarshaller.parse(t),body:n}}formatHeaders(e){return this.headerMarshaller.format(e)}},v=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}},y=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);this.options.includeEndFrame&&(yield new Uint8Array)}},b=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){let t=await this.options.deserializer(e);t!==void 0&&(yield t)}}},x=class{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}};e.EventStreamCodec=_,e.HeaderMarshaller=a,e.Int64=r,e.MessageDecoderStream=v,e.MessageEncoderStream=y,e.SmithyMessageDecoderStream=b,e.SmithyMessageEncoderStream=x})),TP=u((e=>{var t=wP();function n(e){let t=0,n=0,r=null,i=null,a=e=>{if(typeof e!=`number`)throw Error(`Attempted to allocate an event message where size was not a number: `+e);t=e,n=4,r=new Uint8Array(e),new DataView(r.buffer).setUint32(0,e,!1)},o=async function*(){let o=e[Symbol.asyncIterator]();for(;;){let{value:e,done:s}=await o.next();if(s){if(!t)return;if(t===n)yield r;else throw Error(`Truncated event message received.`);return}let c=e.length,l=0;for(;l<c;){if(!r){let t=c-l;i||=new Uint8Array(4);let r=Math.min(4-n,t);if(i.set(e.slice(l,l+r),n),n+=r,l+=r,n<4)break;a(new DataView(i.buffer).getUint32(0,!1)),i=null}let o=Math.min(t-n,c-l);r.set(e.slice(l,l+o),n),n+=o,l+=o,t&&t===n&&(yield r,r=null,t=0,n=0)}}};return{[Symbol.asyncIterator]:o}}function r(e,t){return async function(n){let{value:r}=n.headers[`:message-type`];if(r===`error`){let e=Error(n.headers[`:error-message`].value||`UnknownError`);throw e.name=n.headers[`:error-code`].value,e}else if(r===`exception`){let r=n.headers[`:exception-type`].value,i=await e({[r]:n});if(i.$unknown){let e=Error(t(n.body));throw e.name=r,e}throw i[r]}else if(r===`event`){let t=await e({[n.headers[`:event-type`].value]:n});return t.$unknown?void 0:t}else throw Error(`Unrecognizable event type: ${n.headers[`:event-type`].value}`)}}var i=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:e,utf8Decoder:n}){this.eventStreamCodec=new t.EventStreamCodec(e,n),this.utfEncoder=e}deserialize(e,i){let a=n(e);return new t.SmithyMessageDecoderStream({messageStream:new t.MessageDecoderStream({inputStream:a,decoder:this.eventStreamCodec}),deserializer:r(i,this.utfEncoder)})}serialize(e,n){return new t.MessageEncoderStream({messageStream:new t.SmithyMessageEncoderStream({inputStream:e,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}};e.EventStreamMarshaller=i,e.eventStreamSerdeProvider=e=>new i(e)})),EP=u((e=>{var t=TP(),n=h(`stream`);async function*r(e){let t=!1,n=!1,r=[];for(e.on(`error`,e=>{if(t||=!0,e)throw e}),e.on(`data`,e=>{r.push(e)}),e.on(`end`,()=>{t=!0});!n;){let e=await new Promise(e=>setTimeout(()=>e(r.shift()),0));e&&(yield e),n=t&&r.length===0}}var i=class{universalMarshaller;constructor({utf8Encoder:e,utf8Decoder:n}){this.universalMarshaller=new t.EventStreamMarshaller({utf8Decoder:n,utf8Encoder:e})}deserialize(e,t){let n=typeof e[Symbol.asyncIterator]==`function`?e:r(e);return this.universalMarshaller.deserialize(n,t)}serialize(e,t){return n.Readable.from(this.universalMarshaller.serialize(e,t))}};e.EventStreamMarshaller=i,e.eventStreamSerdeProvider=e=>new i(e)})),DP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.ruleSet=void 0;let t=`required`,n=`argv`,r=`isSet`,i=`booleanEquals`,a=`error`,o=`endpoint`,s=`tree`,c=`PartitionResult`,l={[t]:!1,type:`string`},u={[t]:!0,default:!1,type:`boolean`},d={ref:`Endpoint`},f={fn:i,[n]:[{ref:`UseFIPS`},!0]},p={fn:i,[n]:[{ref:`UseDualStack`},!0]},m={},h={fn:`getAttr`,[n]:[{ref:c},`supportsFIPS`]},g={fn:i,[n]:[!0,{fn:`getAttr`,[n]:[{ref:c},`supportsDualStack`]}]},_=[f],v=[p],y=[{ref:`Region`}];e.ruleSet={version:`1.0`,parameters:{Region:l,UseDualStack:u,UseFIPS:u,Endpoint:l},rules:[{conditions:[{fn:r,[n]:[d]}],rules:[{conditions:_,error:`Invalid Configuration: FIPS and custom endpoint are not supported`,type:a},{conditions:v,error:`Invalid Configuration: Dualstack and custom endpoint are not supported`,type:a},{endpoint:{url:d,properties:m,headers:m},type:o}],type:s},{conditions:[{fn:r,[n]:y}],rules:[{conditions:[{fn:`aws.partition`,[n]:y,assign:c}],rules:[{conditions:[f,p],rules:[{conditions:[{fn:i,[n]:[!0,h]},g],rules:[{endpoint:{url:`https://lambda-fips.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}],type:s},{error:`FIPS and DualStack are enabled, but this partition does not support one or both`,type:a}],type:s},{conditions:_,rules:[{conditions:[{fn:i,[n]:[h,!0]}],rules:[{endpoint:{url:`https://lambda-fips.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}],type:s},{error:`FIPS is enabled but this partition does not support FIPS`,type:a}],type:s},{conditions:v,rules:[{conditions:[g],rules:[{endpoint:{url:`https://lambda.{Region}.{PartitionResult#dualStackDnsSuffix}`,properties:m,headers:m},type:o}],type:s},{error:`DualStack is enabled but this partition does not support DualStack`,type:a}],type:s},{endpoint:{url:`https://lambda.{Region}.{PartitionResult#dnsSuffix}`,properties:m,headers:m},type:o}],type:s}],type:s},{error:`Invalid Configuration: Missing Region`,type:a}]}})),OP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.defaultEndpointResolver=void 0;let t=qg(),n=Kg(),r=DP(),i=new n.EndpointCache({size:50,params:[`Endpoint`,`Region`,`UseDualStack`,`UseFIPS`]});e.defaultEndpointResolver=(e,t={})=>i.get(e,()=>(0,n.resolveEndpoint)(r.ruleSet,{endpointParams:e,logger:t.logger})),n.customEndpointFunctions.aws=t.awsEndpointFunctions})),kP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.LambdaServiceException=e.__ServiceException=void 0;let t=w_();Object.defineProperty(e,`__ServiceException`,{enumerable:!0,get:function(){return t.ServiceException}}),e.LambdaServiceException=class e extends t.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}}})),AP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.CallbackTimeoutException=e.ProvisionedConcurrencyConfigNotFoundException=e.UnsupportedMediaTypeException=e.SubnetIPAddressLimitReachedException=e.SnapStartTimeoutException=e.SnapStartNotReadyException=e.SnapStartException=e.SerializedRequestEntityTooLargeException=e.ResourceNotReadyException=e.RequestTooLargeException=e.RecursiveInvocationException=e.NoPublishedVersionException=e.KMSNotFoundException=e.KMSInvalidStateException=e.KMSDisabledException=e.KMSAccessDeniedException=e.InvalidZipFileException=e.InvalidSubnetIDException=e.InvalidSecurityGroupIDException=e.InvalidRuntimeException=e.InvalidRequestContentException=e.ENILimitReachedException=e.EFSMountTimeoutException=e.EFSMountFailureException=e.EFSMountConnectivityException=e.EFSIOException=e.EC2UnexpectedException=e.EC2ThrottledException=e.EC2AccessDeniedException=e.DurableExecutionAlreadyStartedException=e.InvalidCodeSignatureException=e.FunctionVersionsPerCapacityProviderLimitExceededException=e.CodeVerificationFailedException=e.CodeStorageExceededException=e.CodeSigningConfigNotFoundException=e.ResourceInUseException=e.CapacityProviderLimitExceededException=e.TooManyRequestsException=e.ServiceException=e.ResourceNotFoundException=e.ResourceConflictException=e.PreconditionFailedException=e.PolicyLengthExceededException=e.InvalidParameterValueException=void 0;let t=kP();e.InvalidParameterValueException=class e extends t.LambdaServiceException{name=`InvalidParameterValueException`;$fault=`client`;Type;constructor(t){super({name:`InvalidParameterValueException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.PolicyLengthExceededException=class e extends t.LambdaServiceException{name=`PolicyLengthExceededException`;$fault=`client`;Type;constructor(t){super({name:`PolicyLengthExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.PreconditionFailedException=class e extends t.LambdaServiceException{name=`PreconditionFailedException`;$fault=`client`;Type;constructor(t){super({name:`PreconditionFailedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceConflictException=class e extends t.LambdaServiceException{name=`ResourceConflictException`;$fault=`client`;Type;constructor(t){super({name:`ResourceConflictException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceNotFoundException=class e extends t.LambdaServiceException{name=`ResourceNotFoundException`;$fault=`client`;Type;Message;constructor(t){super({name:`ResourceNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.ServiceException=class e extends t.LambdaServiceException{name=`ServiceException`;$fault=`server`;Type;Message;constructor(t){super({name:`ServiceException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.TooManyRequestsException=class e extends t.LambdaServiceException{name=`TooManyRequestsException`;$fault=`client`;retryAfterSeconds;Type;Reason;constructor(t){super({name:`TooManyRequestsException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.retryAfterSeconds=t.retryAfterSeconds,this.Type=t.Type,this.Reason=t.Reason}},e.CapacityProviderLimitExceededException=class e extends t.LambdaServiceException{name=`CapacityProviderLimitExceededException`;$fault=`client`;Type;constructor(t){super({name:`CapacityProviderLimitExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceInUseException=class e extends t.LambdaServiceException{name=`ResourceInUseException`;$fault=`client`;Type;Message;constructor(t){super({name:`ResourceInUseException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.CodeSigningConfigNotFoundException=class e extends t.LambdaServiceException{name=`CodeSigningConfigNotFoundException`;$fault=`client`;Type;Message;constructor(t){super({name:`CodeSigningConfigNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.CodeStorageExceededException=class e extends t.LambdaServiceException{name=`CodeStorageExceededException`;$fault=`client`;Type;constructor(t){super({name:`CodeStorageExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.CodeVerificationFailedException=class e extends t.LambdaServiceException{name=`CodeVerificationFailedException`;$fault=`client`;Type;Message;constructor(t){super({name:`CodeVerificationFailedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.FunctionVersionsPerCapacityProviderLimitExceededException=class e extends t.LambdaServiceException{name=`FunctionVersionsPerCapacityProviderLimitExceededException`;$fault=`client`;Type;constructor(t){super({name:`FunctionVersionsPerCapacityProviderLimitExceededException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.InvalidCodeSignatureException=class e extends t.LambdaServiceException{name=`InvalidCodeSignatureException`;$fault=`client`;Type;Message;constructor(t){super({name:`InvalidCodeSignatureException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.DurableExecutionAlreadyStartedException=class e extends t.LambdaServiceException{name=`DurableExecutionAlreadyStartedException`;$fault=`client`;Type;Message;constructor(t){super({name:`DurableExecutionAlreadyStartedException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EC2AccessDeniedException=class e extends t.LambdaServiceException{name=`EC2AccessDeniedException`;$fault=`server`;Type;Message;constructor(t){super({name:`EC2AccessDeniedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EC2ThrottledException=class e extends t.LambdaServiceException{name=`EC2ThrottledException`;$fault=`server`;Type;Message;constructor(t){super({name:`EC2ThrottledException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EC2UnexpectedException=class e extends t.LambdaServiceException{name=`EC2UnexpectedException`;$fault=`server`;Type;Message;EC2ErrorCode;constructor(t){super({name:`EC2UnexpectedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message,this.EC2ErrorCode=t.EC2ErrorCode}},e.EFSIOException=class e extends t.LambdaServiceException{name=`EFSIOException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSIOException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EFSMountConnectivityException=class e extends t.LambdaServiceException{name=`EFSMountConnectivityException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSMountConnectivityException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EFSMountFailureException=class e extends t.LambdaServiceException{name=`EFSMountFailureException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSMountFailureException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.EFSMountTimeoutException=class e extends t.LambdaServiceException{name=`EFSMountTimeoutException`;$fault=`client`;Type;Message;constructor(t){super({name:`EFSMountTimeoutException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.ENILimitReachedException=class e extends t.LambdaServiceException{name=`ENILimitReachedException`;$fault=`server`;Type;Message;constructor(t){super({name:`ENILimitReachedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidRequestContentException=class e extends t.LambdaServiceException{name=`InvalidRequestContentException`;$fault=`client`;Type;constructor(t){super({name:`InvalidRequestContentException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.InvalidRuntimeException=class e extends t.LambdaServiceException{name=`InvalidRuntimeException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidRuntimeException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidSecurityGroupIDException=class e extends t.LambdaServiceException{name=`InvalidSecurityGroupIDException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidSecurityGroupIDException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidSubnetIDException=class e extends t.LambdaServiceException{name=`InvalidSubnetIDException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidSubnetIDException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.InvalidZipFileException=class e extends t.LambdaServiceException{name=`InvalidZipFileException`;$fault=`server`;Type;Message;constructor(t){super({name:`InvalidZipFileException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSAccessDeniedException=class e extends t.LambdaServiceException{name=`KMSAccessDeniedException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSAccessDeniedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSDisabledException=class e extends t.LambdaServiceException{name=`KMSDisabledException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSDisabledException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSInvalidStateException=class e extends t.LambdaServiceException{name=`KMSInvalidStateException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSInvalidStateException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.KMSNotFoundException=class e extends t.LambdaServiceException{name=`KMSNotFoundException`;$fault=`server`;Type;Message;constructor(t){super({name:`KMSNotFoundException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.NoPublishedVersionException=class e extends t.LambdaServiceException{name=`NoPublishedVersionException`;$fault=`client`;Type;Message;constructor(t){super({name:`NoPublishedVersionException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.RecursiveInvocationException=class e extends t.LambdaServiceException{name=`RecursiveInvocationException`;$fault=`client`;Type;Message;constructor(t){super({name:`RecursiveInvocationException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.RequestTooLargeException=class e extends t.LambdaServiceException{name=`RequestTooLargeException`;$fault=`client`;Type;constructor(t){super({name:`RequestTooLargeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ResourceNotReadyException=class e extends t.LambdaServiceException{name=`ResourceNotReadyException`;$fault=`server`;Type;constructor(t){super({name:`ResourceNotReadyException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.SerializedRequestEntityTooLargeException=class e extends t.LambdaServiceException{name=`SerializedRequestEntityTooLargeException`;$fault=`client`;Type;constructor(t){super({name:`SerializedRequestEntityTooLargeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.SnapStartException=class e extends t.LambdaServiceException{name=`SnapStartException`;$fault=`client`;Type;Message;constructor(t){super({name:`SnapStartException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.SnapStartNotReadyException=class e extends t.LambdaServiceException{name=`SnapStartNotReadyException`;$fault=`client`;Type;Message;constructor(t){super({name:`SnapStartNotReadyException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.SnapStartTimeoutException=class e extends t.LambdaServiceException{name=`SnapStartTimeoutException`;$fault=`client`;Type;Message;constructor(t){super({name:`SnapStartTimeoutException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.SubnetIPAddressLimitReachedException=class e extends t.LambdaServiceException{name=`SubnetIPAddressLimitReachedException`;$fault=`server`;Type;Message;constructor(t){super({name:`SubnetIPAddressLimitReachedException`,$fault:`server`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}},e.UnsupportedMediaTypeException=class e extends t.LambdaServiceException{name=`UnsupportedMediaTypeException`;$fault=`client`;Type;constructor(t){super({name:`UnsupportedMediaTypeException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.ProvisionedConcurrencyConfigNotFoundException=class e extends t.LambdaServiceException{name=`ProvisionedConcurrencyConfigNotFoundException`;$fault=`client`;Type;constructor(t){super({name:`ProvisionedConcurrencyConfigNotFoundException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type}},e.CallbackTimeoutException=class e extends t.LambdaServiceException{name=`CallbackTimeoutException`;$fault=`client`;Type;Message;constructor(t){super({name:`CallbackTimeoutException`,$fault:`client`,...t}),Object.setPrototypeOf(this,e.prototype),this.Type=t.Type,this.Message=t.Message}}})),jP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.AddLayerVersionPermissionResponse$=e.AddLayerVersionPermissionRequest$=e.AccountUsage$=e.AccountLimit$=e.errorTypeRegistries=e.UnsupportedMediaTypeException$=e.TooManyRequestsException$=e.SubnetIPAddressLimitReachedException$=e.SnapStartTimeoutException$=e.SnapStartNotReadyException$=e.SnapStartException$=e.ServiceException$=e.SerializedRequestEntityTooLargeException$=e.ResourceNotReadyException$=e.ResourceNotFoundException$=e.ResourceInUseException$=e.ResourceConflictException$=e.RequestTooLargeException$=e.RecursiveInvocationException$=e.ProvisionedConcurrencyConfigNotFoundException$=e.PreconditionFailedException$=e.PolicyLengthExceededException$=e.NoPublishedVersionException$=e.KMSNotFoundException$=e.KMSInvalidStateException$=e.KMSDisabledException$=e.KMSAccessDeniedException$=e.InvalidZipFileException$=e.InvalidSubnetIDException$=e.InvalidSecurityGroupIDException$=e.InvalidRuntimeException$=e.InvalidRequestContentException$=e.InvalidParameterValueException$=e.InvalidCodeSignatureException$=e.FunctionVersionsPerCapacityProviderLimitExceededException$=e.ENILimitReachedException$=e.EFSMountTimeoutException$=e.EFSMountFailureException$=e.EFSMountConnectivityException$=e.EFSIOException$=e.EC2UnexpectedException$=e.EC2ThrottledException$=e.EC2AccessDeniedException$=e.DurableExecutionAlreadyStartedException$=e.CodeVerificationFailedException$=e.CodeStorageExceededException$=e.CodeSigningConfigNotFoundException$=e.CapacityProviderLimitExceededException$=e.CallbackTimeoutException$=e.LambdaServiceException$=void 0,e.DeleteCodeSigningConfigRequest$=e.DeleteCapacityProviderResponse$=e.DeleteCapacityProviderRequest$=e.DeleteAliasRequest$=e.DeadLetterConfig$=e.CreateFunctionUrlConfigResponse$=e.CreateFunctionUrlConfigRequest$=e.CreateFunctionRequest$=e.CreateEventSourceMappingRequest$=e.CreateCodeSigningConfigResponse$=e.CreateCodeSigningConfigRequest$=e.CreateCapacityProviderResponse$=e.CreateCapacityProviderRequest$=e.CreateAliasRequest$=e.Cors$=e.ContextSucceededDetails$=e.ContextStartedDetails$=e.ContextOptions$=e.ContextFailedDetails$=e.ContextDetails$=e.Concurrency$=e.CodeSigningPolicies$=e.CodeSigningConfig$=e.CheckpointUpdatedExecutionState$=e.CheckpointDurableExecutionResponse$=e.CheckpointDurableExecutionRequest$=e.ChainedInvokeTimedOutDetails$=e.ChainedInvokeSucceededDetails$=e.ChainedInvokeStoppedDetails$=e.ChainedInvokeStartedDetails$=e.ChainedInvokeOptions$=e.ChainedInvokeFailedDetails$=e.ChainedInvokeDetails$=e.CapacityProviderVpcConfig$=e.CapacityProviderScalingConfig$=e.CapacityProviderPermissionsConfig$=e.CapacityProviderConfig$=e.CapacityProvider$=e.CallbackTimedOutDetails$=e.CallbackSucceededDetails$=e.CallbackStartedDetails$=e.CallbackOptions$=e.CallbackFailedDetails$=e.CallbackDetails$=e.AmazonManagedKafkaEventSourceConfig$=e.AllowedPublishers$=e.AliasRoutingConfiguration$=e.AliasConfiguration$=e.AddPermissionResponse$=e.AddPermissionRequest$=void 0,e.GetCodeSigningConfigResponse$=e.GetCodeSigningConfigRequest$=e.GetCapacityProviderResponse$=e.GetCapacityProviderRequest$=e.GetAliasRequest$=e.GetAccountSettingsResponse$=e.GetAccountSettingsRequest$=e.FunctionVersionsByCapacityProviderListItem$=e.FunctionUrlConfig$=e.FunctionScalingConfig$=e.FunctionEventInvokeConfig$=e.FunctionConfiguration$=e.FunctionCodeLocation$=e.FunctionCode$=e.FilterCriteriaError$=e.FilterCriteria$=e.Filter$=e.FileSystemConfig$=e.ExecutionTimedOutDetails$=e.ExecutionSucceededDetails$=e.ExecutionStoppedDetails$=e.ExecutionStartedDetails$=e.ExecutionFailedDetails$=e.ExecutionDetails$=e.Execution$=e.EventSourceMappingMetricsConfig$=e.EventSourceMappingLoggingConfig$=e.EventSourceMappingConfiguration$=e.EventResult$=e.EventInput$=e.EventError$=e.Event$=e.ErrorObject$=e.EphemeralStorage$=e.EnvironmentResponse$=e.EnvironmentError$=e.Environment$=e.DurableConfig$=e.DocumentDBEventSourceConfig$=e.DestinationConfig$=e.DeleteProvisionedConcurrencyConfigRequest$=e.DeleteLayerVersionRequest$=e.DeleteFunctionUrlConfigRequest$=e.DeleteFunctionResponse$=e.DeleteFunctionRequest$=e.DeleteFunctionEventInvokeConfigRequest$=e.DeleteFunctionConcurrencyRequest$=e.DeleteFunctionCodeSigningConfigRequest$=e.DeleteEventSourceMappingRequest$=e.DeleteCodeSigningConfigResponse$=void 0,e.Layer$=e.LambdaManagedInstancesCapacityProviderConfig$=e.KafkaSchemaValidationConfig$=e.KafkaSchemaRegistryConfig$=e.KafkaSchemaRegistryAccessConfig$=e.InvokeWithResponseStreamResponse$=e.InvokeWithResponseStreamRequest$=e.InvokeWithResponseStreamCompleteEvent$=e.InvokeResponseStreamUpdate$=e.InvokeAsyncResponse$=e.InvokeAsyncRequest$=e.InvocationResponse$=e.InvocationRequest$=e.InvocationCompletedDetails$=e.InstanceRequirements$=e.ImageConfigResponse$=e.ImageConfigError$=e.ImageConfig$=e.GetRuntimeManagementConfigResponse$=e.GetRuntimeManagementConfigRequest$=e.GetProvisionedConcurrencyConfigResponse$=e.GetProvisionedConcurrencyConfigRequest$=e.GetPolicyResponse$=e.GetPolicyRequest$=e.GetLayerVersionResponse$=e.GetLayerVersionRequest$=e.GetLayerVersionPolicyResponse$=e.GetLayerVersionPolicyRequest$=e.GetLayerVersionByArnRequest$=e.GetFunctionUrlConfigResponse$=e.GetFunctionUrlConfigRequest$=e.GetFunctionScalingConfigResponse$=e.GetFunctionScalingConfigRequest$=e.GetFunctionResponse$=e.GetFunctionRequest$=e.GetFunctionRecursionConfigResponse$=e.GetFunctionRecursionConfigRequest$=e.GetFunctionEventInvokeConfigRequest$=e.GetFunctionConfigurationRequest$=e.GetFunctionConcurrencyResponse$=e.GetFunctionConcurrencyRequest$=e.GetFunctionCodeSigningConfigResponse$=e.GetFunctionCodeSigningConfigRequest$=e.GetEventSourceMappingRequest$=e.GetDurableExecutionStateResponse$=e.GetDurableExecutionStateRequest$=e.GetDurableExecutionResponse$=e.GetDurableExecutionRequest$=e.GetDurableExecutionHistoryResponse$=e.GetDurableExecutionHistoryRequest$=void 0,e.PutFunctionRecursionConfigResponse$=e.PutFunctionRecursionConfigRequest$=e.PutFunctionEventInvokeConfigRequest$=e.PutFunctionConcurrencyRequest$=e.PutFunctionCodeSigningConfigResponse$=e.PutFunctionCodeSigningConfigRequest$=e.PublishVersionRequest$=e.PublishLayerVersionResponse$=e.PublishLayerVersionRequest$=e.ProvisionedPollerConfig$=e.ProvisionedConcurrencyConfigListItem$=e.OperationUpdate$=e.Operation$=e.OnSuccess$=e.OnFailure$=e.LoggingConfig$=e.ListVersionsByFunctionResponse$=e.ListVersionsByFunctionRequest$=e.ListTagsResponse$=e.ListTagsRequest$=e.ListProvisionedConcurrencyConfigsResponse$=e.ListProvisionedConcurrencyConfigsRequest$=e.ListLayerVersionsResponse$=e.ListLayerVersionsRequest$=e.ListLayersResponse$=e.ListLayersRequest$=e.ListFunctionVersionsByCapacityProviderResponse$=e.ListFunctionVersionsByCapacityProviderRequest$=e.ListFunctionUrlConfigsResponse$=e.ListFunctionUrlConfigsRequest$=e.ListFunctionsResponse$=e.ListFunctionsRequest$=e.ListFunctionsByCodeSigningConfigResponse$=e.ListFunctionsByCodeSigningConfigRequest$=e.ListFunctionEventInvokeConfigsResponse$=e.ListFunctionEventInvokeConfigsRequest$=e.ListEventSourceMappingsResponse$=e.ListEventSourceMappingsRequest$=e.ListDurableExecutionsByFunctionResponse$=e.ListDurableExecutionsByFunctionRequest$=e.ListCodeSigningConfigsResponse$=e.ListCodeSigningConfigsRequest$=e.ListCapacityProvidersResponse$=e.ListCapacityProvidersRequest$=e.ListAliasesResponse$=e.ListAliasesRequest$=e.LayerVersionsListItem$=e.LayerVersionContentOutput$=e.LayerVersionContentInput$=e.LayersListItem$=void 0,e.VpcConfig$=e.UpdateFunctionUrlConfigResponse$=e.UpdateFunctionUrlConfigRequest$=e.UpdateFunctionEventInvokeConfigRequest$=e.UpdateFunctionConfigurationRequest$=e.UpdateFunctionCodeRequest$=e.UpdateEventSourceMappingRequest$=e.UpdateCodeSigningConfigResponse$=e.UpdateCodeSigningConfigRequest$=e.UpdateCapacityProviderResponse$=e.UpdateCapacityProviderRequest$=e.UpdateAliasRequest$=e.UntagResourceRequest$=e.TracingConfigResponse$=e.TracingConfig$=e.TraceHeader$=e.TenancyConfig$=e.TargetTrackingScalingPolicy$=e.TagsError$=e.TagResourceRequest$=e.StopDurableExecutionResponse$=e.StopDurableExecutionRequest$=e.StepSucceededDetails$=e.StepStartedDetails$=e.StepOptions$=e.StepFailedDetails$=e.StepDetails$=e.SourceAccessConfiguration$=e.SnapStartResponse$=e.SnapStart$=e.SendDurableExecutionCallbackSuccessResponse$=e.SendDurableExecutionCallbackSuccessRequest$=e.SendDurableExecutionCallbackHeartbeatResponse$=e.SendDurableExecutionCallbackHeartbeatRequest$=e.SendDurableExecutionCallbackFailureResponse$=e.SendDurableExecutionCallbackFailureRequest$=e.SelfManagedKafkaEventSourceConfig$=e.SelfManagedEventSource$=e.ScalingConfig$=e.RuntimeVersionError$=e.RuntimeVersionConfig$=e.RetryDetails$=e.RemovePermissionRequest$=e.RemoveLayerVersionPermissionRequest$=e.PutRuntimeManagementConfigResponse$=e.PutRuntimeManagementConfigRequest$=e.PutProvisionedConcurrencyConfigResponse$=e.PutProvisionedConcurrencyConfigRequest$=e.PutFunctionScalingConfigResponse$=e.PutFunctionScalingConfigRequest$=void 0,e.Invoke$=e.GetRuntimeManagementConfig$=e.GetProvisionedConcurrencyConfig$=e.GetPolicy$=e.GetLayerVersionPolicy$=e.GetLayerVersionByArn$=e.GetLayerVersion$=e.GetFunctionUrlConfig$=e.GetFunctionScalingConfig$=e.GetFunctionRecursionConfig$=e.GetFunctionEventInvokeConfig$=e.GetFunctionConfiguration$=e.GetFunctionConcurrency$=e.GetFunctionCodeSigningConfig$=e.GetFunction$=e.GetEventSourceMapping$=e.GetDurableExecutionState$=e.GetDurableExecutionHistory$=e.GetDurableExecution$=e.GetCodeSigningConfig$=e.GetCapacityProvider$=e.GetAlias$=e.GetAccountSettings$=e.DeleteProvisionedConcurrencyConfig$=e.DeleteLayerVersion$=e.DeleteFunctionUrlConfig$=e.DeleteFunctionEventInvokeConfig$=e.DeleteFunctionConcurrency$=e.DeleteFunctionCodeSigningConfig$=e.DeleteFunction$=e.DeleteEventSourceMapping$=e.DeleteCodeSigningConfig$=e.DeleteCapacityProvider$=e.DeleteAlias$=e.CreateFunctionUrlConfig$=e.CreateFunction$=e.CreateEventSourceMapping$=e.CreateCodeSigningConfig$=e.CreateCapacityProvider$=e.CreateAlias$=e.CheckpointDurableExecution$=e.AddPermission$=e.AddLayerVersionPermission$=e.InvokeWithResponseStreamResponseEvent$=e.WaitSucceededDetails$=e.WaitStartedDetails$=e.WaitOptions$=e.WaitDetails$=e.WaitCancelledDetails$=e.VpcConfigResponse$=void 0,e.UpdateFunctionUrlConfig$=e.UpdateFunctionEventInvokeConfig$=e.UpdateFunctionConfiguration$=e.UpdateFunctionCode$=e.UpdateEventSourceMapping$=e.UpdateCodeSigningConfig$=e.UpdateCapacityProvider$=e.UpdateAlias$=e.UntagResource$=e.TagResource$=e.StopDurableExecution$=e.SendDurableExecutionCallbackSuccess$=e.SendDurableExecutionCallbackHeartbeat$=e.SendDurableExecutionCallbackFailure$=e.RemovePermission$=e.RemoveLayerVersionPermission$=e.PutRuntimeManagementConfig$=e.PutProvisionedConcurrencyConfig$=e.PutFunctionScalingConfig$=e.PutFunctionRecursionConfig$=e.PutFunctionEventInvokeConfig$=e.PutFunctionConcurrency$=e.PutFunctionCodeSigningConfig$=e.PublishVersion$=e.PublishLayerVersion$=e.ListVersionsByFunction$=e.ListTags$=e.ListProvisionedConcurrencyConfigs$=e.ListLayerVersions$=e.ListLayers$=e.ListFunctionVersionsByCapacityProvider$=e.ListFunctionUrlConfigs$=e.ListFunctionsByCodeSigningConfig$=e.ListFunctions$=e.ListFunctionEventInvokeConfigs$=e.ListEventSourceMappings$=e.ListDurableExecutionsByFunction$=e.ListCodeSigningConfigs$=e.ListCapacityProviders$=e.ListAliases$=e.InvokeWithResponseStream$=e.InvokeAsync$=void 0;let t=`Action`,n=`AccountLimit`,r=`AmazonManagedKafkaEventSourceConfig`,i=`ApplyOn`,a=`AllowedPublishers`,o=`AvailableProvisionedConcurrentExecutions`,s=`AllocatedProvisionedConcurrentExecutions`,c=`AuthType`,l=`AccountUsage`,u=`Architectures`,d=`BisectBatchOnFunctionError`,f=`BatchSize`,p=`Concurrency`,h=`CompatibleArchitectures`,g=`CompatibleArchitecture`,_=`ClientContext`,v=`CallbackDetails`,y=`ContextDetails`,b=`CreatedDate`,x=`CallbackFailedDetails`,S=`ContextFailedDetails`,C=`ConsumerGroupId`,w=`CallbackId`,ee=`ChainedInvokeDetails`,te=`ChainedInvokeFailedDetails`,T=`ChainedInvokeOptions`,E=`ChainedInvokeStartedDetails`,ne=`ChainedInvokeStoppedDetails`,re=`ChainedInvokeSucceededDetails`,ie=`ChainedInvokeTimedOutDetails`,ae=`CallbackOptions`,oe=`ContextOptions`,se=`CapacityProvider`,ce=`CapacityProviderArn`,le=`CapacityProviderConfig`,ue=`CapacityProviderName`,de=`CapacityProviderScalingConfig`,fe=`CompatibleRuntimes`,pe=`CompatibleRuntime`,me=`CodeSize`,he=`CodeSigningConfig`,ge=`CodeSigningConfigArn`,_e=`CallbackStartedDetails`,ve=`CallbackSucceededDetails`,ye=`ContextStartedDetails`,be=`ContextSucceededDetails`,D=`CodeSigningPolicies`,xe=`CodeSha256`,Se=`CheckpointToken`,Ce=`CallbackTimedOutDetails`,we=`CreationTime`,Te=`Cors`,Ee=`Code`,O=`Content`,De=`Description`,k=`DestinationConfig`,Oe=`DurableConfig`,ke=`DocumentDBEventSourceConfig`,Ae=`DurableExecutions`,je=`DurableExecutionArn`,Me=`DurableExecutionName`,Ne=`DeadLetterConfig`,Pe=`Destination`,Fe=`Duration`,A=`Error`,Ie=`ErrorCode`,Le=`ErrorData`,Re=`ExecutionDetails`,ze=`ExecutionFailedDetails`,Be=`ErrorMessage`,Ve=`EphemeralStorage`,j=`EventSourceArn`,He=`ExecutionStartedDetails`,Ue=`ExecutionSucceededDetails`,We=`ExecutionStoppedDetails`,Ge=`ErrorType`,Ke=`ExecutionTimedOutDetails`,qe=`EndTimestamp`,Je=`ExecutionTimeout`,Ye=`ExecutedVersion`,Xe=`Enabled`,Ze=`Endpoints`,Qe=`Environment`,$e=`Events`,et=`FunctionArn`,tt=`FilterCriteriaError`,nt=`FilterCriteria`,M=`FunctionName`,rt=`FunctionResponseTypes`,it=`FileSystemConfigs`,at=`FunctionScalingConfig`,ot=`FunctionUrl`,st=`FunctionVersion`,ct=`Handler`,lt=`Input`,ut=`Ipv6AllowedForDualStack`,dt=`ImageConfig`,ft=`InvocationCompletedDetails`,pt=`ImageConfigResponse`,mt=`IncludeExecutionData`,ht=`InvokeMode`,gt=`InputPayload`,_t=`InstanceRequirements`,vt=`InvocationType`,yt=`ImageUri`,bt=`KmsKeyArn`,xt=`KMSKeyArn`,St=`Layers`,Ct=`LayerArn`,N=`LoggingConfig`,wt=`LicenseInfo`,Tt=`LastModified`,Et=`LambdaManagedInstancesCapacityProviderConfig`,Dt=`LastModifiedTime`,Ot=`LayerName`,kt=`LogResult`,At=`LogType`,jt=`LayerVersionArn`,Mt=`Location`,Nt=`Message`,Pt=`MaximumBatchingWindowInSeconds`,Ft=`MetricsConfig`,It=`MaximumEventAgeInSeconds`,Lt=`MaxItems`,Rt=`MasterRegion`,zt=`MaximumRetryAttempts`,Bt=`MaximumRecordAgeInSeconds`,Vt=`MemorySize`,Ht=`Marker`,Ut=`Mode`,Wt=`Name`,Gt=`NextAttemptDelaySeconds`,P=`NextMarker`,Kt=`Operations`,qt=`OnFailure`,Jt=`OnSuccess`,Yt=`Principal`,Xt=`PermissionsConfig`,Zt=`ParallelizationFactor`,Qt=`ParentId`,$t=`ProvisionedPollerConfig`,en=`PackageType`,tn=`PublishTo`,nn=`Payload`,rn=`Policy`,F=`Publish`,I=`Qualifier`,an=`Queues`,on=`RoutingConfig`,sn=`ReservedConcurrentExecutions`,cn=`ReplayChildren`,L=`RetryDetails`,ln=`RevisionId`,un=`RecursiveLoop`,dn=`ReverseOrder`,fn=`RequestedProvisionedConcurrentExecutions`,pn=`RuntimeVersionArn`,mn=`RuntimeVersionConfig`,hn=`Result`,gn=`Resource`,_n=`Role`,vn=`Runtime`,yn=`Statement`,bn=`SourceAccessConfigurations`,xn=`StartedAfter`,Sn=`S3Bucket`,Cn=`StartedBefore`,wn=`ScalingConfig`,Tn=`StatusCode`,En=`StepDetails`,Dn=`ScheduledEndTimestamp`,On=`StepFailedDetails`,kn=`SecurityGroupIds`,An=`StatementId`,R=`SubnetIds`,jn=`SigningJobArn`,Mn=`S3Key`,Nn=`SourceKMSKeyArn`,Pn=`SystemLogLevel`,Fn=`SelfManagedEventSource`,In=`SelfManagedKafkaEventSourceConfig`,Ln=`StepOptions`,Rn=`S3ObjectVersion`,zn=`StartingPositionTimestamp`,Bn=`SigningProfileVersionArn`,Vn=`StartingPosition`,Hn=`SchemaRegistryConfig`,Un=`StatusReason`,Wn=`StepStartedDetails`,Gn=`StepSucceededDetails`,Kn=`SnapStart`,qn=`StartTimestamp`,Jn=`SubType`,Yn=`State`,Xn=`Status`,Zn=`Statuses`,z=`Type`,Qn=`TracingConfig`,$n=`TotalCodeSize`,er=`TenancyConfig`,tr=`TagsError`,nr=`TraceHeader`,rr=`TenantId`,ir=`TumblingWindowInSeconds`,ar=`Tags`,or=`Timeout`,sr=`Topics`,cr=`Truncated`,lr=`UpdateRuntimeOn`,ur=`UUID`,dr=`Variables`,fr=`VpcConfig`,pr=`VersionNumber`,mr=`Version`,hr=`WaitCancelledDetails`,gr=`WaitDetails`,_r=`WaitOptions`,vr=`WaitStartedDetails`,yr=`WaitSucceededDetails`,br=`X-Amz-Client-Context`,xr=`X-Amz-Executed-Version`,Sr=`X-Amz-Invocation-Type`,Cr=`X-Amz-Log-Type`,wr=`X-Amz-Tenant-Id`,B=`ZipFile`,Tr=`client`,V=`error`,H=`http`,U=`httpError`,W=`httpHeader`,G=`httpQuery`,K=`message`,q=`smithy.ts.sdk.synthetic.com.amazonaws.lambda`,J=`server`,Er=`streaming`,Y=`com.amazonaws.lambda`,Dr=(Xp(),m(Yp)),X=AP(),Or=kP(),kr=Dr.TypeRegistry.for(q);e.LambdaServiceException$=[-3,q,`LambdaServiceException`,0,[],[]],kr.registerError(e.LambdaServiceException$,Or.LambdaServiceException);let Z=Dr.TypeRegistry.for(Y);e.CallbackTimeoutException$=[-3,Y,`CallbackTimeoutException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.CallbackTimeoutException$,X.CallbackTimeoutException),e.CapacityProviderLimitExceededException$=[-3,Y,`CapacityProviderLimitExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.CapacityProviderLimitExceededException$,X.CapacityProviderLimitExceededException),e.CodeSigningConfigNotFoundException$=[-3,Y,`CodeSigningConfigNotFoundException`,{[V]:Tr,[U]:404},[z,Nt],[0,0]],Z.registerError(e.CodeSigningConfigNotFoundException$,X.CodeSigningConfigNotFoundException),e.CodeStorageExceededException$=[-3,Y,`CodeStorageExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.CodeStorageExceededException$,X.CodeStorageExceededException),e.CodeVerificationFailedException$=[-3,Y,`CodeVerificationFailedException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.CodeVerificationFailedException$,X.CodeVerificationFailedException),e.DurableExecutionAlreadyStartedException$=[-3,Y,`DurableExecutionAlreadyStartedException`,{[V]:Tr,[U]:409},[z,Nt],[0,0]],Z.registerError(e.DurableExecutionAlreadyStartedException$,X.DurableExecutionAlreadyStartedException),e.EC2AccessDeniedException$=[-3,Y,`EC2AccessDeniedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.EC2AccessDeniedException$,X.EC2AccessDeniedException),e.EC2ThrottledException$=[-3,Y,`EC2ThrottledException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.EC2ThrottledException$,X.EC2ThrottledException),e.EC2UnexpectedException$=[-3,Y,`EC2UnexpectedException`,{[V]:J,[U]:502},[z,Nt,`EC2ErrorCode`],[0,0,0]],Z.registerError(e.EC2UnexpectedException$,X.EC2UnexpectedException),e.EFSIOException$=[-3,Y,`EFSIOException`,{[V]:Tr,[U]:410},[z,Nt],[0,0]],Z.registerError(e.EFSIOException$,X.EFSIOException),e.EFSMountConnectivityException$=[-3,Y,`EFSMountConnectivityException`,{[V]:Tr,[U]:408},[z,Nt],[0,0]],Z.registerError(e.EFSMountConnectivityException$,X.EFSMountConnectivityException),e.EFSMountFailureException$=[-3,Y,`EFSMountFailureException`,{[V]:Tr,[U]:403},[z,Nt],[0,0]],Z.registerError(e.EFSMountFailureException$,X.EFSMountFailureException),e.EFSMountTimeoutException$=[-3,Y,`EFSMountTimeoutException`,{[V]:Tr,[U]:408},[z,Nt],[0,0]],Z.registerError(e.EFSMountTimeoutException$,X.EFSMountTimeoutException),e.ENILimitReachedException$=[-3,Y,`ENILimitReachedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.ENILimitReachedException$,X.ENILimitReachedException),e.FunctionVersionsPerCapacityProviderLimitExceededException$=[-3,Y,`FunctionVersionsPerCapacityProviderLimitExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.FunctionVersionsPerCapacityProviderLimitExceededException$,X.FunctionVersionsPerCapacityProviderLimitExceededException),e.InvalidCodeSignatureException$=[-3,Y,`InvalidCodeSignatureException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.InvalidCodeSignatureException$,X.InvalidCodeSignatureException),e.InvalidParameterValueException$=[-3,Y,`InvalidParameterValueException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.InvalidParameterValueException$,X.InvalidParameterValueException),e.InvalidRequestContentException$=[-3,Y,`InvalidRequestContentException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.InvalidRequestContentException$,X.InvalidRequestContentException),e.InvalidRuntimeException$=[-3,Y,`InvalidRuntimeException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidRuntimeException$,X.InvalidRuntimeException),e.InvalidSecurityGroupIDException$=[-3,Y,`InvalidSecurityGroupIDException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidSecurityGroupIDException$,X.InvalidSecurityGroupIDException),e.InvalidSubnetIDException$=[-3,Y,`InvalidSubnetIDException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidSubnetIDException$,X.InvalidSubnetIDException),e.InvalidZipFileException$=[-3,Y,`InvalidZipFileException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.InvalidZipFileException$,X.InvalidZipFileException),e.KMSAccessDeniedException$=[-3,Y,`KMSAccessDeniedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSAccessDeniedException$,X.KMSAccessDeniedException),e.KMSDisabledException$=[-3,Y,`KMSDisabledException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSDisabledException$,X.KMSDisabledException),e.KMSInvalidStateException$=[-3,Y,`KMSInvalidStateException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSInvalidStateException$,X.KMSInvalidStateException),e.KMSNotFoundException$=[-3,Y,`KMSNotFoundException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.KMSNotFoundException$,X.KMSNotFoundException),e.NoPublishedVersionException$=[-3,Y,`NoPublishedVersionException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.NoPublishedVersionException$,X.NoPublishedVersionException),e.PolicyLengthExceededException$=[-3,Y,`PolicyLengthExceededException`,{[V]:Tr,[U]:400},[z,K],[0,0]],Z.registerError(e.PolicyLengthExceededException$,X.PolicyLengthExceededException),e.PreconditionFailedException$=[-3,Y,`PreconditionFailedException`,{[V]:Tr,[U]:412},[z,K],[0,0]],Z.registerError(e.PreconditionFailedException$,X.PreconditionFailedException),e.ProvisionedConcurrencyConfigNotFoundException$=[-3,Y,`ProvisionedConcurrencyConfigNotFoundException`,{[V]:Tr,[U]:404},[z,K],[0,0]],Z.registerError(e.ProvisionedConcurrencyConfigNotFoundException$,X.ProvisionedConcurrencyConfigNotFoundException),e.RecursiveInvocationException$=[-3,Y,`RecursiveInvocationException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.RecursiveInvocationException$,X.RecursiveInvocationException),e.RequestTooLargeException$=[-3,Y,`RequestTooLargeException`,{[V]:Tr,[U]:413},[z,K],[0,0]],Z.registerError(e.RequestTooLargeException$,X.RequestTooLargeException),e.ResourceConflictException$=[-3,Y,`ResourceConflictException`,{[V]:Tr,[U]:409},[z,K],[0,0]],Z.registerError(e.ResourceConflictException$,X.ResourceConflictException),e.ResourceInUseException$=[-3,Y,`ResourceInUseException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.ResourceInUseException$,X.ResourceInUseException),e.ResourceNotFoundException$=[-3,Y,`ResourceNotFoundException`,{[V]:Tr,[U]:404},[z,Nt],[0,0]],Z.registerError(e.ResourceNotFoundException$,X.ResourceNotFoundException),e.ResourceNotReadyException$=[-3,Y,`ResourceNotReadyException`,{[V]:J,[U]:502},[z,K],[0,0]],Z.registerError(e.ResourceNotReadyException$,X.ResourceNotReadyException),e.SerializedRequestEntityTooLargeException$=[-3,Y,`SerializedRequestEntityTooLargeException`,{[V]:Tr,[U]:413},[z,K],[0,0]],Z.registerError(e.SerializedRequestEntityTooLargeException$,X.SerializedRequestEntityTooLargeException),e.ServiceException$=[-3,Y,`ServiceException`,{[V]:J,[U]:500},[z,Nt],[0,0]],Z.registerError(e.ServiceException$,X.ServiceException),e.SnapStartException$=[-3,Y,`SnapStartException`,{[V]:Tr,[U]:400},[z,Nt],[0,0]],Z.registerError(e.SnapStartException$,X.SnapStartException),e.SnapStartNotReadyException$=[-3,Y,`SnapStartNotReadyException`,{[V]:Tr,[U]:409},[z,Nt],[0,0]],Z.registerError(e.SnapStartNotReadyException$,X.SnapStartNotReadyException),e.SnapStartTimeoutException$=[-3,Y,`SnapStartTimeoutException`,{[V]:Tr,[U]:408},[z,Nt],[0,0]],Z.registerError(e.SnapStartTimeoutException$,X.SnapStartTimeoutException),e.SubnetIPAddressLimitReachedException$=[-3,Y,`SubnetIPAddressLimitReachedException`,{[V]:J,[U]:502},[z,Nt],[0,0]],Z.registerError(e.SubnetIPAddressLimitReachedException$,X.SubnetIPAddressLimitReachedException),e.TooManyRequestsException$=[-3,Y,`TooManyRequestsException`,{[V]:Tr,[U]:429},[`retryAfterSeconds`,z,K,`Reason`],[[0,{[W]:`Retry-After`}],0,0,0]],Z.registerError(e.TooManyRequestsException$,X.TooManyRequestsException),e.UnsupportedMediaTypeException$=[-3,Y,`UnsupportedMediaTypeException`,{[V]:Tr,[U]:415},[z,K],[0,0]],Z.registerError(e.UnsupportedMediaTypeException$,X.UnsupportedMediaTypeException),e.errorTypeRegistries=[kr,Z];var Ar=[0,Y,`BinaryOperationPayload`,8,21],jr=[0,Y,`Blob`,8,21],Mr=[0,Y,`BlobStream`,{[Er]:1},42],Nr=[0,Y,`EnvironmentVariableName`,8,0],Pr=[0,Y,`EnvironmentVariableValue`,8,0],Fr=[0,Y,Le,8,0],Ir=[0,Y,Be,8,0],Lr=[0,Y,Ge,8,0],Rr=[0,Y,gt,8,0],zr=[0,Y,`OperationPayload`,8,0],Br=[0,Y,`OutputPayload`,8,0],Vr=[0,Y,`SensitiveString`,8,0],Hr=[0,Y,`StackTraceEntry`,8,0];e.AccountLimit$=[3,Y,n,0,[$n,`CodeSizeUnzipped`,`CodeSizeZipped`,`ConcurrentExecutions`,`UnreservedConcurrentExecutions`],[1,1,1,1,1]],e.AccountUsage$=[3,Y,l,0,[$n,`FunctionCount`],[1,1]],e.AddLayerVersionPermissionRequest$=[3,Y,`AddLayerVersionPermissionRequest`,0,[Ot,pr,An,t,Yt,`OrganizationId`,ln],[[0,1],[1,1],0,0,0,0,[0,{[G]:ln}]],5],e.AddLayerVersionPermissionResponse$=[3,Y,`AddLayerVersionPermissionResponse`,0,[yn,ln],[0,0]],e.AddPermissionRequest$=[3,Y,`AddPermissionRequest`,0,[M,An,t,Yt,`SourceArn`,`SourceAccount`,`EventSourceToken`,I,ln,`PrincipalOrgID`,`FunctionUrlAuthType`,`InvokedViaFunctionUrl`],[[0,1],0,0,0,0,0,0,[0,{[G]:I}],0,0,0,2],4],e.AddPermissionResponse$=[3,Y,`AddPermissionResponse`,0,[yn],[0]],e.AliasConfiguration$=[3,Y,`AliasConfiguration`,0,[`AliasArn`,Wt,st,De,on,ln],[0,0,0,0,()=>e.AliasRoutingConfiguration$,0]],e.AliasRoutingConfiguration$=[3,Y,`AliasRoutingConfiguration`,0,[`AdditionalVersionWeights`],[129]],e.AllowedPublishers$=[3,Y,a,0,[`SigningProfileVersionArns`],[64],1],e.AmazonManagedKafkaEventSourceConfig$=[3,Y,r,0,[C,Hn],[0,()=>e.KafkaSchemaRegistryConfig$]],e.CallbackDetails$=[3,Y,v,0,[w,hn,A],[0,[()=>zr,0],[()=>e.ErrorObject$,0]]],e.CallbackFailedDetails$=[3,Y,x,0,[A],[[()=>e.EventError$,0]],1],e.CallbackOptions$=[3,Y,ae,0,[`TimeoutSeconds`,`HeartbeatTimeoutSeconds`],[1,1]],e.CallbackStartedDetails$=[3,Y,_e,0,[w,`HeartbeatTimeout`,or],[0,1,1],1],e.CallbackSucceededDetails$=[3,Y,ve,0,[hn],[[()=>e.EventResult$,0]],1],e.CallbackTimedOutDetails$=[3,Y,Ce,0,[A],[[()=>e.EventError$,0]],1],e.CapacityProvider$=[3,Y,se,0,[ce,Yn,fr,Xt,_t,de,bt,Tt],[0,0,()=>e.CapacityProviderVpcConfig$,()=>e.CapacityProviderPermissionsConfig$,()=>e.InstanceRequirements$,()=>e.CapacityProviderScalingConfig$,0,0],4],e.CapacityProviderConfig$=[3,Y,le,0,[Et],[()=>e.LambdaManagedInstancesCapacityProviderConfig$],1],e.CapacityProviderPermissionsConfig$=[3,Y,`CapacityProviderPermissionsConfig`,0,[`CapacityProviderOperatorRoleArn`],[0],1],e.CapacityProviderScalingConfig$=[3,Y,de,0,[`MaxVCpuCount`,`ScalingMode`,`ScalingPolicies`],[1,0,()=>Gr]],e.CapacityProviderVpcConfig$=[3,Y,`CapacityProviderVpcConfig`,0,[R,kn],[64,64],2],e.ChainedInvokeDetails$=[3,Y,ee,0,[hn,A],[[()=>zr,0],[()=>e.ErrorObject$,0]]],e.ChainedInvokeFailedDetails$=[3,Y,te,0,[A],[[()=>e.EventError$,0]],1],e.ChainedInvokeOptions$=[3,Y,T,0,[M,rr],[0,0],1],e.ChainedInvokeStartedDetails$=[3,Y,E,0,[M,rr,lt,Ye,je],[0,0,[()=>e.EventInput$,0],0,0],1],e.ChainedInvokeStoppedDetails$=[3,Y,ne,0,[A],[[()=>e.EventError$,0]],1],e.ChainedInvokeSucceededDetails$=[3,Y,re,0,[hn],[[()=>e.EventResult$,0]],1],e.ChainedInvokeTimedOutDetails$=[3,Y,ie,0,[A],[[()=>e.EventError$,0]],1],e.CheckpointDurableExecutionRequest$=[3,Y,`CheckpointDurableExecutionRequest`,0,[je,Se,`Updates`,`ClientToken`],[[0,1],0,[()=>li,0],[0,4]],2],e.CheckpointDurableExecutionResponse$=[3,Y,`CheckpointDurableExecutionResponse`,0,[`NewExecutionState`,Se],[[()=>e.CheckpointUpdatedExecutionState$,0],0],1],e.CheckpointUpdatedExecutionState$=[3,Y,`CheckpointUpdatedExecutionState`,0,[Kt,P],[[()=>ci,0],0]],e.CodeSigningConfig$=[3,Y,he,0,[`CodeSigningConfigId`,ge,a,D,Tt,De],[0,0,()=>e.AllowedPublishers$,()=>e.CodeSigningPolicies$,0,0],5],e.CodeSigningPolicies$=[3,Y,D,0,[`UntrustedArtifactOnDeployment`],[0]],e.Concurrency$=[3,Y,p,0,[sn],[1]],e.ContextDetails$=[3,Y,y,0,[cn,hn,A],[2,[()=>zr,0],[()=>e.ErrorObject$,0]]],e.ContextFailedDetails$=[3,Y,S,0,[A],[[()=>e.EventError$,0]],1],e.ContextOptions$=[3,Y,oe,0,[cn],[2]],e.ContextStartedDetails$=[3,Y,ye,0,[],[]],e.ContextSucceededDetails$=[3,Y,be,0,[hn],[[()=>e.EventResult$,0]],1],e.Cors$=[3,Y,Te,0,[`AllowCredentials`,`AllowHeaders`,`AllowMethods`,`AllowOrigins`,`ExposeHeaders`,`MaxAge`],[2,64,64,64,64,1]],e.CreateAliasRequest$=[3,Y,`CreateAliasRequest`,0,[M,Wt,st,De,on],[[0,1],0,0,0,()=>e.AliasRoutingConfiguration$],3],e.CreateCapacityProviderRequest$=[3,Y,`CreateCapacityProviderRequest`,0,[ue,fr,Xt,_t,de,bt,ar],[0,()=>e.CapacityProviderVpcConfig$,()=>e.CapacityProviderPermissionsConfig$,()=>e.InstanceRequirements$,()=>e.CapacityProviderScalingConfig$,0,128],3],e.CreateCapacityProviderResponse$=[3,Y,`CreateCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.CreateCodeSigningConfigRequest$=[3,Y,`CreateCodeSigningConfigRequest`,0,[a,De,D,ar],[()=>e.AllowedPublishers$,0,()=>e.CodeSigningPolicies$,128],1],e.CreateCodeSigningConfigResponse$=[3,Y,`CreateCodeSigningConfigResponse`,0,[he],[()=>e.CodeSigningConfig$],1],e.CreateEventSourceMappingRequest$=[3,Y,`CreateEventSourceMappingRequest`,0,[M,j,Xe,f,nt,Pt,Zt,Vn,zn,k,Bt,d,zt,ar,ir,sr,an,bn,Fn,rt,r,In,wn,ke,xt,Ft,N,$t],[0,0,2,1,()=>e.FilterCriteria$,1,1,0,4,()=>e.DestinationConfig$,1,2,1,128,1,64,64,()=>di,()=>e.SelfManagedEventSource$,64,()=>e.AmazonManagedKafkaEventSourceConfig$,()=>e.SelfManagedKafkaEventSourceConfig$,()=>e.ScalingConfig$,()=>e.DocumentDBEventSourceConfig$,0,()=>e.EventSourceMappingMetricsConfig$,()=>e.EventSourceMappingLoggingConfig$,()=>e.ProvisionedPollerConfig$],1],e.CreateFunctionRequest$=[3,Y,`CreateFunctionRequest`,0,[M,_n,Ee,vn,ct,De,or,Vt,F,fr,en,Ne,Qe,xt,Qn,ar,St,it,dt,ge,u,Ve,Kn,N,le,tn,Oe,er],[0,0,[()=>e.FunctionCode$,0],0,0,0,1,1,2,()=>e.VpcConfig$,0,()=>e.DeadLetterConfig$,[()=>e.Environment$,0],0,()=>e.TracingConfig$,128,64,()=>Zr,()=>e.ImageConfig$,0,64,()=>e.EphemeralStorage$,()=>e.SnapStart$,()=>e.LoggingConfig$,()=>e.CapacityProviderConfig$,0,()=>e.DurableConfig$,()=>e.TenancyConfig$],3],e.CreateFunctionUrlConfigRequest$=[3,Y,`CreateFunctionUrlConfigRequest`,0,[M,c,I,Te,ht],[[0,1],0,[0,{[G]:I}],()=>e.Cors$,0],2],e.CreateFunctionUrlConfigResponse$=[3,Y,`CreateFunctionUrlConfigResponse`,0,[ot,et,c,we,Te,ht],[0,0,0,0,()=>e.Cors$,0],4],e.DeadLetterConfig$=[3,Y,Ne,0,[`TargetArn`],[0]],e.DeleteAliasRequest$=[3,Y,`DeleteAliasRequest`,0,[M,Wt],[[0,1],[0,1]],2],e.DeleteCapacityProviderRequest$=[3,Y,`DeleteCapacityProviderRequest`,0,[ue],[[0,1]],1],e.DeleteCapacityProviderResponse$=[3,Y,`DeleteCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.DeleteCodeSigningConfigRequest$=[3,Y,`DeleteCodeSigningConfigRequest`,0,[ge],[[0,1]],1],e.DeleteCodeSigningConfigResponse$=[3,Y,`DeleteCodeSigningConfigResponse`,0,[],[]],e.DeleteEventSourceMappingRequest$=[3,Y,`DeleteEventSourceMappingRequest`,0,[ur],[[0,1]],1],e.DeleteFunctionCodeSigningConfigRequest$=[3,Y,`DeleteFunctionCodeSigningConfigRequest`,0,[M],[[0,1]],1],e.DeleteFunctionConcurrencyRequest$=[3,Y,`DeleteFunctionConcurrencyRequest`,0,[M],[[0,1]],1],e.DeleteFunctionEventInvokeConfigRequest$=[3,Y,`DeleteFunctionEventInvokeConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.DeleteFunctionRequest$=[3,Y,`DeleteFunctionRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.DeleteFunctionResponse$=[3,Y,`DeleteFunctionResponse`,0,[Tn],[[1,32]]],e.DeleteFunctionUrlConfigRequest$=[3,Y,`DeleteFunctionUrlConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.DeleteLayerVersionRequest$=[3,Y,`DeleteLayerVersionRequest`,0,[Ot,pr],[[0,1],[1,1]],2],e.DeleteProvisionedConcurrencyConfigRequest$=[3,Y,`DeleteProvisionedConcurrencyConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],2],e.DestinationConfig$=[3,Y,k,0,[Jt,qt],[()=>e.OnSuccess$,()=>e.OnFailure$]],e.DocumentDBEventSourceConfig$=[3,Y,ke,0,[`DatabaseName`,`CollectionName`,`FullDocument`],[0,0,0]],e.DurableConfig$=[3,Y,Oe,0,[`RetentionPeriodInDays`,Je],[1,1]],e.Environment$=[3,Y,Qe,0,[dr],[[()=>pi,0]]],e.EnvironmentError$=[3,Y,`EnvironmentError`,0,[Ie,Nt],[0,[()=>Vr,0]]],e.EnvironmentResponse$=[3,Y,`EnvironmentResponse`,0,[dr,A],[[()=>pi,0],[()=>e.EnvironmentError$,0]]],e.EphemeralStorage$=[3,Y,Ve,0,[`Size`],[1],1],e.ErrorObject$=[3,Y,`ErrorObject`,0,[Be,Ge,Le,`StackTrace`],[[()=>Ir,0],[()=>Lr,0],[()=>Fr,0],[()=>fi,0]]],e.Event$=[3,Y,`Event`,0,[`EventType`,Jn,`EventId`,`Id`,Wt,`EventTimestamp`,Qt,He,Ue,ze,Ke,We,ye,be,S,vr,yr,hr,Wn,Gn,On,E,re,te,ie,ne,_e,ve,x,Ce,ft],[0,0,1,0,0,4,0,[()=>e.ExecutionStartedDetails$,0],[()=>e.ExecutionSucceededDetails$,0],[()=>e.ExecutionFailedDetails$,0],[()=>e.ExecutionTimedOutDetails$,0],[()=>e.ExecutionStoppedDetails$,0],()=>e.ContextStartedDetails$,[()=>e.ContextSucceededDetails$,0],[()=>e.ContextFailedDetails$,0],()=>e.WaitStartedDetails$,()=>e.WaitSucceededDetails$,[()=>e.WaitCancelledDetails$,0],()=>e.StepStartedDetails$,[()=>e.StepSucceededDetails$,0],[()=>e.StepFailedDetails$,0],[()=>e.ChainedInvokeStartedDetails$,0],[()=>e.ChainedInvokeSucceededDetails$,0],[()=>e.ChainedInvokeFailedDetails$,0],[()=>e.ChainedInvokeTimedOutDetails$,0],[()=>e.ChainedInvokeStoppedDetails$,0],()=>e.CallbackStartedDetails$,[()=>e.CallbackSucceededDetails$,0],[()=>e.CallbackFailedDetails$,0],[()=>e.CallbackTimedOutDetails$,0],[()=>e.InvocationCompletedDetails$,0]]],e.EventError$=[3,Y,`EventError`,0,[nn,cr],[[()=>e.ErrorObject$,0],2]],e.EventInput$=[3,Y,`EventInput`,0,[nn,cr],[[()=>Rr,0],2]],e.EventResult$=[3,Y,`EventResult`,0,[nn,cr],[[()=>zr,0],2]],e.EventSourceMappingConfiguration$=[3,Y,`EventSourceMappingConfiguration`,0,[ur,Vn,zn,f,Pt,Zt,j,nt,et,Tt,`LastProcessingResult`,Yn,`StateTransitionReason`,k,sr,an,bn,Fn,Bt,d,zt,ir,rt,r,In,wn,ke,xt,tt,`EventSourceMappingArn`,Ft,N,$t],[0,0,4,1,1,1,0,()=>e.FilterCriteria$,0,4,0,0,0,()=>e.DestinationConfig$,64,64,()=>di,()=>e.SelfManagedEventSource$,1,2,1,1,64,()=>e.AmazonManagedKafkaEventSourceConfig$,()=>e.SelfManagedKafkaEventSourceConfig$,()=>e.ScalingConfig$,()=>e.DocumentDBEventSourceConfig$,0,()=>e.FilterCriteriaError$,0,()=>e.EventSourceMappingMetricsConfig$,()=>e.EventSourceMappingLoggingConfig$,()=>e.ProvisionedPollerConfig$]],e.EventSourceMappingLoggingConfig$=[3,Y,`EventSourceMappingLoggingConfig`,0,[Pn],[0]],e.EventSourceMappingMetricsConfig$=[3,Y,`EventSourceMappingMetricsConfig`,0,[`Metrics`],[64]],e.Execution$=[3,Y,`Execution`,0,[je,Me,et,Xn,qn,qe],[0,0,0,0,4,4],5],e.ExecutionDetails$=[3,Y,Re,0,[gt],[[()=>Rr,0]]],e.ExecutionFailedDetails$=[3,Y,ze,0,[A],[[()=>e.EventError$,0]],1],e.ExecutionStartedDetails$=[3,Y,He,0,[lt,Je],[[()=>e.EventInput$,0],1],2],e.ExecutionStoppedDetails$=[3,Y,We,0,[A],[[()=>e.EventError$,0]],1],e.ExecutionSucceededDetails$=[3,Y,Ue,0,[hn],[[()=>e.EventResult$,0]],1],e.ExecutionTimedOutDetails$=[3,Y,Ke,0,[A],[[()=>e.EventError$,0]]],e.FileSystemConfig$=[3,Y,`FileSystemConfig`,0,[`Arn`,`LocalMountPath`],[0,0],2],e.Filter$=[3,Y,`Filter`,0,[`Pattern`],[0]],e.FilterCriteria$=[3,Y,nt,0,[`Filters`],[()=>Qr]],e.FilterCriteriaError$=[3,Y,tt,0,[Ie,Nt],[0,0]],e.FunctionCode$=[3,Y,`FunctionCode`,0,[B,Sn,Mn,Rn,yt,Nn],[[()=>jr,0],0,0,0,0,0]],e.FunctionCodeLocation$=[3,Y,`FunctionCodeLocation`,0,[`RepositoryType`,Mt,yt,`ResolvedImageUri`,Nn],[0,0,0,0,0]],e.FunctionConfiguration$=[3,Y,`FunctionConfiguration`,0,[M,et,vn,_n,ct,me,De,or,Vt,Tt,xe,mr,fr,Ne,Qe,xt,Qn,`MasterArn`,ln,St,Yn,`StateReason`,`StateReasonCode`,`LastUpdateStatus`,`LastUpdateStatusReason`,`LastUpdateStatusReasonCode`,it,en,pt,Bn,jn,u,Ve,Kn,mn,N,le,`ConfigSha256`,Oe,er],[0,0,0,0,0,1,0,1,1,0,0,0,()=>e.VpcConfigResponse$,()=>e.DeadLetterConfig$,[()=>e.EnvironmentResponse$,0],0,()=>e.TracingConfigResponse$,0,0,()=>oi,0,0,0,0,0,0,()=>Zr,0,[()=>e.ImageConfigResponse$,0],0,0,64,()=>e.EphemeralStorage$,()=>e.SnapStartResponse$,[()=>e.RuntimeVersionConfig$,0],()=>e.LoggingConfig$,()=>e.CapacityProviderConfig$,0,()=>e.DurableConfig$,()=>e.TenancyConfig$]],e.FunctionEventInvokeConfig$=[3,Y,`FunctionEventInvokeConfig`,0,[Tt,et,zt,It,k],[4,0,1,1,()=>e.DestinationConfig$]],e.FunctionScalingConfig$=[3,Y,at,0,[`MinExecutionEnvironments`,`MaxExecutionEnvironments`],[1,1]],e.FunctionUrlConfig$=[3,Y,`FunctionUrlConfig`,0,[ot,et,we,Dt,c,Te,ht],[0,0,0,0,0,()=>e.Cors$,0],5],e.FunctionVersionsByCapacityProviderListItem$=[3,Y,`FunctionVersionsByCapacityProviderListItem`,0,[et,Yn],[0,0],2],e.GetAccountSettingsRequest$=[3,Y,`GetAccountSettingsRequest`,0,[],[]],e.GetAccountSettingsResponse$=[3,Y,`GetAccountSettingsResponse`,0,[n,l],[()=>e.AccountLimit$,()=>e.AccountUsage$]],e.GetAliasRequest$=[3,Y,`GetAliasRequest`,0,[M,Wt],[[0,1],[0,1]],2],e.GetCapacityProviderRequest$=[3,Y,`GetCapacityProviderRequest`,0,[ue],[[0,1]],1],e.GetCapacityProviderResponse$=[3,Y,`GetCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.GetCodeSigningConfigRequest$=[3,Y,`GetCodeSigningConfigRequest`,0,[ge],[[0,1]],1],e.GetCodeSigningConfigResponse$=[3,Y,`GetCodeSigningConfigResponse`,0,[he],[()=>e.CodeSigningConfig$],1],e.GetDurableExecutionHistoryRequest$=[3,Y,`GetDurableExecutionHistoryRequest`,0,[je,mt,Lt,Ht,dn],[[0,1],[2,{[G]:mt}],[1,{[G]:Lt}],[0,{[G]:Ht}],[2,{[G]:dn}]],1],e.GetDurableExecutionHistoryResponse$=[3,Y,`GetDurableExecutionHistoryResponse`,0,[$e,P],[[()=>Yr,0],0],1],e.GetDurableExecutionRequest$=[3,Y,`GetDurableExecutionRequest`,0,[je],[[0,1]],1],e.GetDurableExecutionResponse$=[3,Y,`GetDurableExecutionResponse`,0,[je,Me,et,qn,Xn,gt,hn,A,qe,mr,nr],[0,0,0,4,0,[()=>Rr,0],[()=>Br,0],[()=>e.ErrorObject$,0],4,0,()=>e.TraceHeader$],5],e.GetDurableExecutionStateRequest$=[3,Y,`GetDurableExecutionStateRequest`,0,[je,Se,Ht,Lt],[[0,1],[0,{[G]:Se}],[0,{[G]:Ht}],[1,{[G]:Lt}]],2],e.GetDurableExecutionStateResponse$=[3,Y,`GetDurableExecutionStateResponse`,0,[Kt,P],[[()=>ci,0],0],1],e.GetEventSourceMappingRequest$=[3,Y,`GetEventSourceMappingRequest`,0,[ur],[[0,1]],1],e.GetFunctionCodeSigningConfigRequest$=[3,Y,`GetFunctionCodeSigningConfigRequest`,0,[M],[[0,1]],1],e.GetFunctionCodeSigningConfigResponse$=[3,Y,`GetFunctionCodeSigningConfigResponse`,0,[ge,M],[0,0],2],e.GetFunctionConcurrencyRequest$=[3,Y,`GetFunctionConcurrencyRequest`,0,[M],[[0,1]],1],e.GetFunctionConcurrencyResponse$=[3,Y,`GetFunctionConcurrencyResponse`,0,[sn],[1]],e.GetFunctionConfigurationRequest$=[3,Y,`GetFunctionConfigurationRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionEventInvokeConfigRequest$=[3,Y,`GetFunctionEventInvokeConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionRecursionConfigRequest$=[3,Y,`GetFunctionRecursionConfigRequest`,0,[M],[[0,1]],1],e.GetFunctionRecursionConfigResponse$=[3,Y,`GetFunctionRecursionConfigResponse`,0,[un],[0]],e.GetFunctionRequest$=[3,Y,`GetFunctionRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionResponse$=[3,Y,`GetFunctionResponse`,0,[`Configuration`,Ee,ar,tr,p],[[()=>e.FunctionConfiguration$,0],()=>e.FunctionCodeLocation$,128,()=>e.TagsError$,()=>e.Concurrency$]],e.GetFunctionScalingConfigRequest$=[3,Y,`GetFunctionScalingConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],2],e.GetFunctionScalingConfigResponse$=[3,Y,`GetFunctionScalingConfigResponse`,0,[et,`AppliedFunctionScalingConfig`,`RequestedFunctionScalingConfig`],[0,()=>e.FunctionScalingConfig$,()=>e.FunctionScalingConfig$]],e.GetFunctionUrlConfigRequest$=[3,Y,`GetFunctionUrlConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetFunctionUrlConfigResponse$=[3,Y,`GetFunctionUrlConfigResponse`,0,[ot,et,c,we,Dt,Te,ht],[0,0,0,0,0,()=>e.Cors$,0],5],e.GetLayerVersionByArnRequest$=[3,Y,`GetLayerVersionByArnRequest`,0,[`Arn`],[[0,{[G]:`Arn`}]],1],e.GetLayerVersionPolicyRequest$=[3,Y,`GetLayerVersionPolicyRequest`,0,[Ot,pr],[[0,1],[1,1]],2],e.GetLayerVersionPolicyResponse$=[3,Y,`GetLayerVersionPolicyResponse`,0,[rn,ln],[0,0]],e.GetLayerVersionRequest$=[3,Y,`GetLayerVersionRequest`,0,[Ot,pr],[[0,1],[1,1]],2],e.GetLayerVersionResponse$=[3,Y,`GetLayerVersionResponse`,0,[O,Ct,jt,De,b,mr,fe,wt,h],[()=>e.LayerVersionContentOutput$,0,0,0,0,1,64,0,64]],e.GetPolicyRequest$=[3,Y,`GetPolicyRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetPolicyResponse$=[3,Y,`GetPolicyResponse`,0,[rn,ln],[0,0]],e.GetProvisionedConcurrencyConfigRequest$=[3,Y,`GetProvisionedConcurrencyConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],2],e.GetProvisionedConcurrencyConfigResponse$=[3,Y,`GetProvisionedConcurrencyConfigResponse`,0,[fn,o,s,Xn,Un,Tt],[1,1,1,0,0,0]],e.GetRuntimeManagementConfigRequest$=[3,Y,`GetRuntimeManagementConfigRequest`,0,[M,I],[[0,1],[0,{[G]:I}]],1],e.GetRuntimeManagementConfigResponse$=[3,Y,`GetRuntimeManagementConfigResponse`,0,[lr,pn,et],[0,0,0]],e.ImageConfig$=[3,Y,dt,0,[`EntryPoint`,`Command`,`WorkingDirectory`],[64,64,0]],e.ImageConfigError$=[3,Y,`ImageConfigError`,0,[Ie,Nt],[0,[()=>Vr,0]]],e.ImageConfigResponse$=[3,Y,pt,0,[dt,A],[()=>e.ImageConfig$,[()=>e.ImageConfigError$,0]]],e.InstanceRequirements$=[3,Y,_t,0,[u,`AllowedInstanceTypes`,`ExcludedInstanceTypes`],[64,64,64]],e.InvocationCompletedDetails$=[3,Y,ft,0,[qn,qe,`RequestId`,A],[4,4,0,[()=>e.EventError$,0]],3],e.InvocationRequest$=[3,Y,`InvocationRequest`,0,[M,vt,At,_,Me,nn,I,rr],[[0,1],[0,{[W]:Sr}],[0,{[W]:Cr}],[0,{[W]:br}],[0,{[W]:`X-Amz-Durable-Execution-Name`}],[()=>jr,16],[0,{[G]:I}],[0,{[W]:wr}]],1],e.InvocationResponse$=[3,Y,`InvocationResponse`,0,[Tn,`FunctionError`,kt,nn,Ye,je],[[1,32],[0,{[W]:`X-Amz-Function-Error`}],[0,{[W]:`X-Amz-Log-Result`}],[()=>jr,16],[0,{[W]:xr}],[0,{[W]:`X-Amz-Durable-Execution-Arn`}]]],e.InvokeAsyncRequest$=[3,Y,`InvokeAsyncRequest`,0,[M,`InvokeArgs`],[[0,1],[()=>Mr,16]],2],e.InvokeAsyncResponse$=[3,Y,`InvokeAsyncResponse`,0,[Xn],[[1,32]]],e.InvokeResponseStreamUpdate$=[3,Y,`InvokeResponseStreamUpdate`,0,[nn],[[()=>jr,{eventPayload:1}]]],e.InvokeWithResponseStreamCompleteEvent$=[3,Y,`InvokeWithResponseStreamCompleteEvent`,0,[Ie,`ErrorDetails`,kt],[0,0,0]],e.InvokeWithResponseStreamRequest$=[3,Y,`InvokeWithResponseStreamRequest`,0,[M,vt,At,_,I,nn,rr],[[0,1],[0,{[W]:Sr}],[0,{[W]:Cr}],[0,{[W]:br}],[0,{[G]:I}],[()=>jr,16],[0,{[W]:wr}]],1],e.InvokeWithResponseStreamResponse$=[3,Y,`InvokeWithResponseStreamResponse`,0,[Tn,Ye,`EventStream`,`ResponseStreamContentType`],[[1,32],[0,{[W]:xr}],[()=>e.InvokeWithResponseStreamResponseEvent$,16],[0,{[W]:`Content-Type`}]]],e.KafkaSchemaRegistryAccessConfig$=[3,Y,`KafkaSchemaRegistryAccessConfig`,0,[z,`URI`],[0,0]],e.KafkaSchemaRegistryConfig$=[3,Y,`KafkaSchemaRegistryConfig`,0,[`SchemaRegistryURI`,`EventRecordFormat`,`AccessConfigs`,`SchemaValidationConfigs`],[0,0,()=>ri,()=>ii]],e.KafkaSchemaValidationConfig$=[3,Y,`KafkaSchemaValidationConfig`,0,[`Attribute`],[0]],e.LambdaManagedInstancesCapacityProviderConfig$=[3,Y,Et,0,[ce,`PerExecutionEnvironmentMaxConcurrency`,`ExecutionEnvironmentMemoryGiBPerVCpu`],[0,1,1],1],e.Layer$=[3,Y,`Layer`,0,[`Arn`,me,Bn,jn],[0,1,0,0]],e.LayersListItem$=[3,Y,`LayersListItem`,0,[Ot,Ct,`LatestMatchingVersion`],[0,0,()=>e.LayerVersionsListItem$]],e.LayerVersionContentInput$=[3,Y,`LayerVersionContentInput`,0,[Sn,Mn,Rn,B],[0,0,0,[()=>jr,0]]],e.LayerVersionContentOutput$=[3,Y,`LayerVersionContentOutput`,0,[Mt,xe,me,Bn,jn],[0,0,1,0,0]],e.LayerVersionsListItem$=[3,Y,`LayerVersionsListItem`,0,[jt,mr,De,b,fe,wt,h],[0,1,0,0,64,0,64]],e.ListAliasesRequest$=[3,Y,`ListAliasesRequest`,0,[M,st,Ht,Lt],[[0,1],[0,{[G]:st}],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListAliasesResponse$=[3,Y,`ListAliasesResponse`,0,[P,`Aliases`],[0,()=>Wr]],e.ListCapacityProvidersRequest$=[3,Y,`ListCapacityProvidersRequest`,0,[Yn,Ht,Lt],[[0,{[G]:Yn}],[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListCapacityProvidersResponse$=[3,Y,`ListCapacityProvidersResponse`,0,[`CapacityProviders`,P],[()=>Kr,0],1],e.ListCodeSigningConfigsRequest$=[3,Y,`ListCodeSigningConfigsRequest`,0,[Ht,Lt],[[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListCodeSigningConfigsResponse$=[3,Y,`ListCodeSigningConfigsResponse`,0,[P,`CodeSigningConfigs`],[0,()=>qr]],e.ListDurableExecutionsByFunctionRequest$=[3,Y,`ListDurableExecutionsByFunctionRequest`,0,[M,I,Me,Zn,xn,Cn,dn,Ht,Lt],[[0,1],[0,{[G]:I}],[0,{[G]:Me}],[64,{[G]:Zn}],[4,{[G]:xn}],[4,{[G]:Cn}],[2,{[G]:dn}],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListDurableExecutionsByFunctionResponse$=[3,Y,`ListDurableExecutionsByFunctionResponse`,0,[Ae,P],[()=>Jr,0]],e.ListEventSourceMappingsRequest$=[3,Y,`ListEventSourceMappingsRequest`,0,[j,M,Ht,Lt],[[0,{[G]:j}],[0,{[G]:M}],[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListEventSourceMappingsResponse$=[3,Y,`ListEventSourceMappingsResponse`,0,[P,`EventSourceMappings`],[0,()=>Xr]],e.ListFunctionEventInvokeConfigsRequest$=[3,Y,`ListFunctionEventInvokeConfigsRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionEventInvokeConfigsResponse$=[3,Y,`ListFunctionEventInvokeConfigsResponse`,0,[`FunctionEventInvokeConfigs`,P],[()=>$r,0]],e.ListFunctionsByCodeSigningConfigRequest$=[3,Y,`ListFunctionsByCodeSigningConfigRequest`,0,[ge,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionsByCodeSigningConfigResponse$=[3,Y,`ListFunctionsByCodeSigningConfigResponse`,0,[P,`FunctionArns`],[0,64]],e.ListFunctionsRequest$=[3,Y,`ListFunctionsRequest`,0,[Rt,st,Ht,Lt],[[0,{[G]:Rt}],[0,{[G]:st}],[0,{[G]:Ht}],[1,{[G]:Lt}]]],e.ListFunctionsResponse$=[3,Y,`ListFunctionsResponse`,0,[P,`Functions`],[0,[()=>ei,0]]],e.ListFunctionUrlConfigsRequest$=[3,Y,`ListFunctionUrlConfigsRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionUrlConfigsResponse$=[3,Y,`ListFunctionUrlConfigsResponse`,0,[`FunctionUrlConfigs`,P],[()=>ti,0],1],e.ListFunctionVersionsByCapacityProviderRequest$=[3,Y,`ListFunctionVersionsByCapacityProviderRequest`,0,[ue,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListFunctionVersionsByCapacityProviderResponse$=[3,Y,`ListFunctionVersionsByCapacityProviderResponse`,0,[ce,`FunctionVersions`,P],[0,()=>ni,0],2],e.ListLayersRequest$=[3,Y,`ListLayersRequest`,0,[pe,Ht,Lt,g],[[0,{[G]:pe}],[0,{[G]:Ht}],[1,{[G]:Lt}],[0,{[G]:g}]]],e.ListLayersResponse$=[3,Y,`ListLayersResponse`,0,[P,St],[0,()=>ai]],e.ListLayerVersionsRequest$=[3,Y,`ListLayerVersionsRequest`,0,[Ot,pe,Ht,Lt,g],[[0,1],[0,{[G]:pe}],[0,{[G]:Ht}],[1,{[G]:Lt}],[0,{[G]:g}]],1],e.ListLayerVersionsResponse$=[3,Y,`ListLayerVersionsResponse`,0,[P,`LayerVersions`],[0,()=>si]],e.ListProvisionedConcurrencyConfigsRequest$=[3,Y,`ListProvisionedConcurrencyConfigsRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListProvisionedConcurrencyConfigsResponse$=[3,Y,`ListProvisionedConcurrencyConfigsResponse`,0,[`ProvisionedConcurrencyConfigs`,P],[()=>ui,0]],e.ListTagsRequest$=[3,Y,`ListTagsRequest`,0,[gn],[[0,1]],1],e.ListTagsResponse$=[3,Y,`ListTagsResponse`,0,[ar],[128]],e.ListVersionsByFunctionRequest$=[3,Y,`ListVersionsByFunctionRequest`,0,[M,Ht,Lt],[[0,1],[0,{[G]:Ht}],[1,{[G]:Lt}]],1],e.ListVersionsByFunctionResponse$=[3,Y,`ListVersionsByFunctionResponse`,0,[P,`Versions`],[0,[()=>ei,0]]],e.LoggingConfig$=[3,Y,N,0,[`LogFormat`,`ApplicationLogLevel`,Pn,`LogGroup`],[0,0,0,0]],e.OnFailure$=[3,Y,qt,0,[Pe],[0]],e.OnSuccess$=[3,Y,Jt,0,[Pe],[0]],e.Operation$=[3,Y,`Operation`,0,[`Id`,z,qn,Xn,Qt,Wt,Jn,qe,Re,y,En,gr,v,ee],[0,0,4,0,0,0,0,4,[()=>e.ExecutionDetails$,0],[()=>e.ContextDetails$,0],[()=>e.StepDetails$,0],()=>e.WaitDetails$,[()=>e.CallbackDetails$,0],[()=>e.ChainedInvokeDetails$,0]],4],e.OperationUpdate$=[3,Y,`OperationUpdate`,0,[`Id`,z,t,Qt,Wt,Jn,nn,A,oe,Ln,_r,ae,T],[0,0,0,0,0,0,[()=>zr,0],[()=>e.ErrorObject$,0],()=>e.ContextOptions$,()=>e.StepOptions$,()=>e.WaitOptions$,()=>e.CallbackOptions$,()=>e.ChainedInvokeOptions$],3],e.ProvisionedConcurrencyConfigListItem$=[3,Y,`ProvisionedConcurrencyConfigListItem`,0,[et,fn,o,s,Xn,Un,Tt],[0,1,1,1,0,0,0]],e.ProvisionedPollerConfig$=[3,Y,$t,0,[`MinimumPollers`,`MaximumPollers`,`PollerGroupName`],[1,1,0]],e.PublishLayerVersionRequest$=[3,Y,`PublishLayerVersionRequest`,0,[Ot,O,De,fe,wt,h],[[0,1],[()=>e.LayerVersionContentInput$,0],0,64,0,64],2],e.PublishLayerVersionResponse$=[3,Y,`PublishLayerVersionResponse`,0,[O,Ct,jt,De,b,mr,fe,wt,h],[()=>e.LayerVersionContentOutput$,0,0,0,0,1,64,0,64]],e.PublishVersionRequest$=[3,Y,`PublishVersionRequest`,0,[M,xe,De,ln,tn],[[0,1],0,0,0,0],1],e.PutFunctionCodeSigningConfigRequest$=[3,Y,`PutFunctionCodeSigningConfigRequest`,0,[ge,M],[0,[0,1]],2],e.PutFunctionCodeSigningConfigResponse$=[3,Y,`PutFunctionCodeSigningConfigResponse`,0,[ge,M],[0,0],2],e.PutFunctionConcurrencyRequest$=[3,Y,`PutFunctionConcurrencyRequest`,0,[M,sn],[[0,1],1],2],e.PutFunctionEventInvokeConfigRequest$=[3,Y,`PutFunctionEventInvokeConfigRequest`,0,[M,I,zt,It,k],[[0,1],[0,{[G]:I}],1,1,()=>e.DestinationConfig$],1],e.PutFunctionRecursionConfigRequest$=[3,Y,`PutFunctionRecursionConfigRequest`,0,[M,un],[[0,1],0],2],e.PutFunctionRecursionConfigResponse$=[3,Y,`PutFunctionRecursionConfigResponse`,0,[un],[0]],e.PutFunctionScalingConfigRequest$=[3,Y,`PutFunctionScalingConfigRequest`,0,[M,I,at],[[0,1],[0,{[G]:I}],()=>e.FunctionScalingConfig$],2],e.PutFunctionScalingConfigResponse$=[3,Y,`PutFunctionScalingConfigResponse`,0,[`FunctionState`],[0]],e.PutProvisionedConcurrencyConfigRequest$=[3,Y,`PutProvisionedConcurrencyConfigRequest`,0,[M,I,`ProvisionedConcurrentExecutions`],[[0,1],[0,{[G]:I}],1],3],e.PutProvisionedConcurrencyConfigResponse$=[3,Y,`PutProvisionedConcurrencyConfigResponse`,0,[fn,o,s,Xn,Un,Tt],[1,1,1,0,0,0]],e.PutRuntimeManagementConfigRequest$=[3,Y,`PutRuntimeManagementConfigRequest`,0,[M,lr,I,pn],[[0,1],0,[0,{[G]:I}],0],2],e.PutRuntimeManagementConfigResponse$=[3,Y,`PutRuntimeManagementConfigResponse`,0,[lr,et,pn],[0,0,0],2],e.RemoveLayerVersionPermissionRequest$=[3,Y,`RemoveLayerVersionPermissionRequest`,0,[Ot,pr,An,ln],[[0,1],[1,1],[0,1],[0,{[G]:ln}]],3],e.RemovePermissionRequest$=[3,Y,`RemovePermissionRequest`,0,[M,An,I,ln],[[0,1],[0,1],[0,{[G]:I}],[0,{[G]:ln}]],2],e.RetryDetails$=[3,Y,L,0,[`CurrentAttempt`,Gt],[1,1]],e.RuntimeVersionConfig$=[3,Y,mn,0,[pn,A],[0,[()=>e.RuntimeVersionError$,0]]],e.RuntimeVersionError$=[3,Y,`RuntimeVersionError`,0,[Ie,Nt],[0,[()=>Vr,0]]],e.ScalingConfig$=[3,Y,wn,0,[`MaximumConcurrency`],[1]],e.SelfManagedEventSource$=[3,Y,Fn,0,[Ze],[[2,Y,Ze,0,0,64]]],e.SelfManagedKafkaEventSourceConfig$=[3,Y,In,0,[C,Hn],[0,()=>e.KafkaSchemaRegistryConfig$]],e.SendDurableExecutionCallbackFailureRequest$=[3,Y,`SendDurableExecutionCallbackFailureRequest`,0,[w,A],[[0,1],[()=>e.ErrorObject$,16]],1],e.SendDurableExecutionCallbackFailureResponse$=[3,Y,`SendDurableExecutionCallbackFailureResponse`,0,[],[]],e.SendDurableExecutionCallbackHeartbeatRequest$=[3,Y,`SendDurableExecutionCallbackHeartbeatRequest`,0,[w],[[0,1]],1],e.SendDurableExecutionCallbackHeartbeatResponse$=[3,Y,`SendDurableExecutionCallbackHeartbeatResponse`,0,[],[]],e.SendDurableExecutionCallbackSuccessRequest$=[3,Y,`SendDurableExecutionCallbackSuccessRequest`,0,[w,hn],[[0,1],[()=>Ar,16]],1],e.SendDurableExecutionCallbackSuccessResponse$=[3,Y,`SendDurableExecutionCallbackSuccessResponse`,0,[],[]],e.SnapStart$=[3,Y,Kn,0,[i],[0]],e.SnapStartResponse$=[3,Y,`SnapStartResponse`,0,[i,`OptimizationStatus`],[0,0]],e.SourceAccessConfiguration$=[3,Y,`SourceAccessConfiguration`,0,[z,`URI`],[0,0]],e.StepDetails$=[3,Y,En,0,[`Attempt`,`NextAttemptTimestamp`,hn,A],[1,4,[()=>zr,0],[()=>e.ErrorObject$,0]]],e.StepFailedDetails$=[3,Y,On,0,[A,L],[[()=>e.EventError$,0],()=>e.RetryDetails$],2],e.StepOptions$=[3,Y,Ln,0,[Gt],[1]],e.StepStartedDetails$=[3,Y,Wn,0,[],[]],e.StepSucceededDetails$=[3,Y,Gn,0,[hn,L],[[()=>e.EventResult$,0],()=>e.RetryDetails$],2],e.StopDurableExecutionRequest$=[3,Y,`StopDurableExecutionRequest`,0,[je,A],[[0,1],[()=>e.ErrorObject$,16]],1],e.StopDurableExecutionResponse$=[3,Y,`StopDurableExecutionResponse`,0,[`StopTimestamp`],[4],1],e.TagResourceRequest$=[3,Y,`TagResourceRequest`,0,[gn,ar],[[0,1],128],2],e.TagsError$=[3,Y,tr,0,[Ie,Nt],[0,0],2],e.TargetTrackingScalingPolicy$=[3,Y,`TargetTrackingScalingPolicy`,0,[`PredefinedMetricType`,`TargetValue`],[0,1],2],e.TenancyConfig$=[3,Y,er,0,[`TenantIsolationMode`],[0],1],e.TraceHeader$=[3,Y,nr,0,[`XAmznTraceId`],[0]],e.TracingConfig$=[3,Y,Qn,0,[Ut],[0]],e.TracingConfigResponse$=[3,Y,`TracingConfigResponse`,0,[Ut],[0]],e.UntagResourceRequest$=[3,Y,`UntagResourceRequest`,0,[gn,`TagKeys`],[[0,1],[64,{[G]:`tagKeys`}]],2],e.UpdateAliasRequest$=[3,Y,`UpdateAliasRequest`,0,[M,Wt,st,De,on,ln],[[0,1],[0,1],0,0,()=>e.AliasRoutingConfiguration$,0],2],e.UpdateCapacityProviderRequest$=[3,Y,`UpdateCapacityProviderRequest`,0,[ue,de],[[0,1],()=>e.CapacityProviderScalingConfig$],1],e.UpdateCapacityProviderResponse$=[3,Y,`UpdateCapacityProviderResponse`,0,[se],[()=>e.CapacityProvider$],1],e.UpdateCodeSigningConfigRequest$=[3,Y,`UpdateCodeSigningConfigRequest`,0,[ge,De,a,D],[[0,1],0,()=>e.AllowedPublishers$,()=>e.CodeSigningPolicies$],1],e.UpdateCodeSigningConfigResponse$=[3,Y,`UpdateCodeSigningConfigResponse`,0,[he],[()=>e.CodeSigningConfig$],1],e.UpdateEventSourceMappingRequest$=[3,Y,`UpdateEventSourceMappingRequest`,0,[ur,M,Xe,f,nt,Pt,k,Bt,d,zt,Zt,bn,ir,rt,wn,r,In,ke,xt,Ft,N,$t],[[0,1],0,2,1,()=>e.FilterCriteria$,1,()=>e.DestinationConfig$,1,2,1,1,()=>di,1,64,()=>e.ScalingConfig$,()=>e.AmazonManagedKafkaEventSourceConfig$,()=>e.SelfManagedKafkaEventSourceConfig$,()=>e.DocumentDBEventSourceConfig$,0,()=>e.EventSourceMappingMetricsConfig$,()=>e.EventSourceMappingLoggingConfig$,()=>e.ProvisionedPollerConfig$],1],e.UpdateFunctionCodeRequest$=[3,Y,`UpdateFunctionCodeRequest`,0,[M,B,Sn,Mn,Rn,yt,F,`DryRun`,ln,u,Nn,tn],[[0,1],[()=>jr,0],0,0,0,0,2,2,0,64,0,0],1],e.UpdateFunctionConfigurationRequest$=[3,Y,`UpdateFunctionConfigurationRequest`,0,[M,_n,ct,De,or,Vt,fr,Qe,vn,Ne,xt,Qn,ln,St,it,dt,Ve,Kn,N,le,Oe],[[0,1],0,0,0,1,1,()=>e.VpcConfig$,[()=>e.Environment$,0],0,()=>e.DeadLetterConfig$,0,()=>e.TracingConfig$,0,64,()=>Zr,()=>e.ImageConfig$,()=>e.EphemeralStorage$,()=>e.SnapStart$,()=>e.LoggingConfig$,()=>e.CapacityProviderConfig$,()=>e.DurableConfig$],1],e.UpdateFunctionEventInvokeConfigRequest$=[3,Y,`UpdateFunctionEventInvokeConfigRequest`,0,[M,I,zt,It,k],[[0,1],[0,{[G]:I}],1,1,()=>e.DestinationConfig$],1],e.UpdateFunctionUrlConfigRequest$=[3,Y,`UpdateFunctionUrlConfigRequest`,0,[M,I,c,Te,ht],[[0,1],[0,{[G]:I}],0,()=>e.Cors$,0],1],e.UpdateFunctionUrlConfigResponse$=[3,Y,`UpdateFunctionUrlConfigResponse`,0,[ot,et,c,we,Dt,Te,ht],[0,0,0,0,0,()=>e.Cors$,0],5],e.VpcConfig$=[3,Y,fr,0,[R,kn,ut],[64,64,2]],e.VpcConfigResponse$=[3,Y,`VpcConfigResponse`,0,[R,kn,`VpcId`,ut],[64,64,0,2]],e.WaitCancelledDetails$=[3,Y,hr,0,[A],[[()=>e.EventError$,0]]],e.WaitDetails$=[3,Y,gr,0,[Dn],[4]],e.WaitOptions$=[3,Y,_r,0,[`WaitSeconds`],[1]],e.WaitStartedDetails$=[3,Y,vr,0,[Fe,Dn],[1,4],2],e.WaitSucceededDetails$=[3,Y,yr,0,[Fe],[1]];var Ur=`unit`,Wr=[1,Y,`AliasList`,0,()=>e.AliasConfiguration$],Gr=[1,Y,`CapacityProviderScalingPoliciesList`,0,()=>e.TargetTrackingScalingPolicy$],Kr=[1,Y,`CapacityProvidersList`,0,()=>e.CapacityProvider$],qr=[1,Y,`CodeSigningConfigList`,0,()=>e.CodeSigningConfig$],Jr=[1,Y,Ae,0,()=>e.Execution$],Yr=[1,Y,$e,0,[()=>e.Event$,0]],Xr=[1,Y,`EventSourceMappingsList`,0,()=>e.EventSourceMappingConfiguration$],Zr=[1,Y,`FileSystemConfigList`,0,()=>e.FileSystemConfig$],Qr=[1,Y,`FilterList`,0,()=>e.Filter$],$r=[1,Y,`FunctionEventInvokeConfigList`,0,()=>e.FunctionEventInvokeConfig$],ei=[1,Y,`FunctionList`,0,[()=>e.FunctionConfiguration$,0]],ti=[1,Y,`FunctionUrlConfigList`,0,()=>e.FunctionUrlConfig$],ni=[1,Y,`FunctionVersionsByCapacityProviderList`,0,()=>e.FunctionVersionsByCapacityProviderListItem$],ri=[1,Y,`KafkaSchemaRegistryAccessConfigList`,0,()=>e.KafkaSchemaRegistryAccessConfig$],ii=[1,Y,`KafkaSchemaValidationConfigList`,0,()=>e.KafkaSchemaValidationConfig$],ai=[1,Y,`LayersList`,0,()=>e.LayersListItem$],oi=[1,Y,`LayersReferenceList`,0,()=>e.Layer$],si=[1,Y,`LayerVersionsList`,0,()=>e.LayerVersionsListItem$],ci=[1,Y,Kt,0,[()=>e.Operation$,0]],li=[1,Y,`OperationUpdates`,0,[()=>e.OperationUpdate$,0]],ui=[1,Y,`ProvisionedConcurrencyConfigList`,0,()=>e.ProvisionedConcurrencyConfigListItem$],di=[1,Y,bn,0,()=>e.SourceAccessConfiguration$],fi=[1,Y,`StackTraceEntries`,0,[()=>Hr,0]],pi=[2,Y,`EnvironmentVariables`,8,[()=>Nr,0],[()=>Pr,0]];e.InvokeWithResponseStreamResponseEvent$=[4,Y,`InvokeWithResponseStreamResponseEvent`,{[Er]:1},[`PayloadChunk`,`InvokeComplete`],[[()=>e.InvokeResponseStreamUpdate$,0],()=>e.InvokeWithResponseStreamCompleteEvent$]],e.AddLayerVersionPermission$=[9,Y,`AddLayerVersionPermission`,{[H]:[`POST`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy`,201]},()=>e.AddLayerVersionPermissionRequest$,()=>e.AddLayerVersionPermissionResponse$],e.AddPermission$=[9,Y,`AddPermission`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/policy`,201]},()=>e.AddPermissionRequest$,()=>e.AddPermissionResponse$],e.CheckpointDurableExecution$=[9,Y,`CheckpointDurableExecution`,{[H]:[`POST`,`/2025-12-01/durable-executions/{DurableExecutionArn}/checkpoint`,200]},()=>e.CheckpointDurableExecutionRequest$,()=>e.CheckpointDurableExecutionResponse$],e.CreateAlias$=[9,Y,`CreateAlias`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/aliases`,201]},()=>e.CreateAliasRequest$,()=>e.AliasConfiguration$],e.CreateCapacityProvider$=[9,Y,`CreateCapacityProvider`,{[H]:[`POST`,`/2025-11-30/capacity-providers`,202]},()=>e.CreateCapacityProviderRequest$,()=>e.CreateCapacityProviderResponse$],e.CreateCodeSigningConfig$=[9,Y,`CreateCodeSigningConfig`,{[H]:[`POST`,`/2020-04-22/code-signing-configs`,201]},()=>e.CreateCodeSigningConfigRequest$,()=>e.CreateCodeSigningConfigResponse$],e.CreateEventSourceMapping$=[9,Y,`CreateEventSourceMapping`,{[H]:[`POST`,`/2015-03-31/event-source-mappings`,202]},()=>e.CreateEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.CreateFunction$=[9,Y,`CreateFunction`,{[H]:[`POST`,`/2015-03-31/functions`,201]},()=>e.CreateFunctionRequest$,()=>e.FunctionConfiguration$],e.CreateFunctionUrlConfig$=[9,Y,`CreateFunctionUrlConfig`,{[H]:[`POST`,`/2021-10-31/functions/{FunctionName}/url`,201]},()=>e.CreateFunctionUrlConfigRequest$,()=>e.CreateFunctionUrlConfigResponse$],e.DeleteAlias$=[9,Y,`DeleteAlias`,{[H]:[`DELETE`,`/2015-03-31/functions/{FunctionName}/aliases/{Name}`,204]},()=>e.DeleteAliasRequest$,()=>Ur],e.DeleteCapacityProvider$=[9,Y,`DeleteCapacityProvider`,{[H]:[`DELETE`,`/2025-11-30/capacity-providers/{CapacityProviderName}`,202]},()=>e.DeleteCapacityProviderRequest$,()=>e.DeleteCapacityProviderResponse$],e.DeleteCodeSigningConfig$=[9,Y,`DeleteCodeSigningConfig`,{[H]:[`DELETE`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}`,204]},()=>e.DeleteCodeSigningConfigRequest$,()=>e.DeleteCodeSigningConfigResponse$],e.DeleteEventSourceMapping$=[9,Y,`DeleteEventSourceMapping`,{[H]:[`DELETE`,`/2015-03-31/event-source-mappings/{UUID}`,202]},()=>e.DeleteEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.DeleteFunction$=[9,Y,`DeleteFunction`,{[H]:[`DELETE`,`/2015-03-31/functions/{FunctionName}`,200]},()=>e.DeleteFunctionRequest$,()=>e.DeleteFunctionResponse$],e.DeleteFunctionCodeSigningConfig$=[9,Y,`DeleteFunctionCodeSigningConfig`,{[H]:[`DELETE`,`/2020-06-30/functions/{FunctionName}/code-signing-config`,204]},()=>e.DeleteFunctionCodeSigningConfigRequest$,()=>Ur],e.DeleteFunctionConcurrency$=[9,Y,`DeleteFunctionConcurrency`,{[H]:[`DELETE`,`/2017-10-31/functions/{FunctionName}/concurrency`,204]},()=>e.DeleteFunctionConcurrencyRequest$,()=>Ur],e.DeleteFunctionEventInvokeConfig$=[9,Y,`DeleteFunctionEventInvokeConfig`,{[H]:[`DELETE`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,204]},()=>e.DeleteFunctionEventInvokeConfigRequest$,()=>Ur],e.DeleteFunctionUrlConfig$=[9,Y,`DeleteFunctionUrlConfig`,{[H]:[`DELETE`,`/2021-10-31/functions/{FunctionName}/url`,204]},()=>e.DeleteFunctionUrlConfigRequest$,()=>Ur],e.DeleteLayerVersion$=[9,Y,`DeleteLayerVersion`,{[H]:[`DELETE`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}`,204]},()=>e.DeleteLayerVersionRequest$,()=>Ur],e.DeleteProvisionedConcurrencyConfig$=[9,Y,`DeleteProvisionedConcurrencyConfig`,{[H]:[`DELETE`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency`,204]},()=>e.DeleteProvisionedConcurrencyConfigRequest$,()=>Ur],e.GetAccountSettings$=[9,Y,`GetAccountSettings`,{[H]:[`GET`,`/2016-08-19/account-settings`,200]},()=>e.GetAccountSettingsRequest$,()=>e.GetAccountSettingsResponse$],e.GetAlias$=[9,Y,`GetAlias`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/aliases/{Name}`,200]},()=>e.GetAliasRequest$,()=>e.AliasConfiguration$],e.GetCapacityProvider$=[9,Y,`GetCapacityProvider`,{[H]:[`GET`,`/2025-11-30/capacity-providers/{CapacityProviderName}`,200]},()=>e.GetCapacityProviderRequest$,()=>e.GetCapacityProviderResponse$],e.GetCodeSigningConfig$=[9,Y,`GetCodeSigningConfig`,{[H]:[`GET`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}`,200]},()=>e.GetCodeSigningConfigRequest$,()=>e.GetCodeSigningConfigResponse$],e.GetDurableExecution$=[9,Y,`GetDurableExecution`,{[H]:[`GET`,`/2025-12-01/durable-executions/{DurableExecutionArn}`,200]},()=>e.GetDurableExecutionRequest$,()=>e.GetDurableExecutionResponse$],e.GetDurableExecutionHistory$=[9,Y,`GetDurableExecutionHistory`,{[H]:[`GET`,`/2025-12-01/durable-executions/{DurableExecutionArn}/history`,200]},()=>e.GetDurableExecutionHistoryRequest$,()=>e.GetDurableExecutionHistoryResponse$],e.GetDurableExecutionState$=[9,Y,`GetDurableExecutionState`,{[H]:[`GET`,`/2025-12-01/durable-executions/{DurableExecutionArn}/state`,200]},()=>e.GetDurableExecutionStateRequest$,()=>e.GetDurableExecutionStateResponse$],e.GetEventSourceMapping$=[9,Y,`GetEventSourceMapping`,{[H]:[`GET`,`/2015-03-31/event-source-mappings/{UUID}`,200]},()=>e.GetEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.GetFunction$=[9,Y,`GetFunction`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}`,200]},()=>e.GetFunctionRequest$,()=>e.GetFunctionResponse$],e.GetFunctionCodeSigningConfig$=[9,Y,`GetFunctionCodeSigningConfig`,{[H]:[`GET`,`/2020-06-30/functions/{FunctionName}/code-signing-config`,200]},()=>e.GetFunctionCodeSigningConfigRequest$,()=>e.GetFunctionCodeSigningConfigResponse$],e.GetFunctionConcurrency$=[9,Y,`GetFunctionConcurrency`,{[H]:[`GET`,`/2019-09-30/functions/{FunctionName}/concurrency`,200]},()=>e.GetFunctionConcurrencyRequest$,()=>e.GetFunctionConcurrencyResponse$],e.GetFunctionConfiguration$=[9,Y,`GetFunctionConfiguration`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/configuration`,200]},()=>e.GetFunctionConfigurationRequest$,()=>e.FunctionConfiguration$],e.GetFunctionEventInvokeConfig$=[9,Y,`GetFunctionEventInvokeConfig`,{[H]:[`GET`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,200]},()=>e.GetFunctionEventInvokeConfigRequest$,()=>e.FunctionEventInvokeConfig$],e.GetFunctionRecursionConfig$=[9,Y,`GetFunctionRecursionConfig`,{[H]:[`GET`,`/2024-08-31/functions/{FunctionName}/recursion-config`,200]},()=>e.GetFunctionRecursionConfigRequest$,()=>e.GetFunctionRecursionConfigResponse$],e.GetFunctionScalingConfig$=[9,Y,`GetFunctionScalingConfig`,{[H]:[`GET`,`/2025-11-30/functions/{FunctionName}/function-scaling-config`,200]},()=>e.GetFunctionScalingConfigRequest$,()=>e.GetFunctionScalingConfigResponse$],e.GetFunctionUrlConfig$=[9,Y,`GetFunctionUrlConfig`,{[H]:[`GET`,`/2021-10-31/functions/{FunctionName}/url`,200]},()=>e.GetFunctionUrlConfigRequest$,()=>e.GetFunctionUrlConfigResponse$],e.GetLayerVersion$=[9,Y,`GetLayerVersion`,{[H]:[`GET`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}`,200]},()=>e.GetLayerVersionRequest$,()=>e.GetLayerVersionResponse$],e.GetLayerVersionByArn$=[9,Y,`GetLayerVersionByArn`,{[H]:[`GET`,`/2018-10-31/layers?find=LayerVersion`,200]},()=>e.GetLayerVersionByArnRequest$,()=>e.GetLayerVersionResponse$],e.GetLayerVersionPolicy$=[9,Y,`GetLayerVersionPolicy`,{[H]:[`GET`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy`,200]},()=>e.GetLayerVersionPolicyRequest$,()=>e.GetLayerVersionPolicyResponse$],e.GetPolicy$=[9,Y,`GetPolicy`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/policy`,200]},()=>e.GetPolicyRequest$,()=>e.GetPolicyResponse$],e.GetProvisionedConcurrencyConfig$=[9,Y,`GetProvisionedConcurrencyConfig`,{[H]:[`GET`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency`,200]},()=>e.GetProvisionedConcurrencyConfigRequest$,()=>e.GetProvisionedConcurrencyConfigResponse$],e.GetRuntimeManagementConfig$=[9,Y,`GetRuntimeManagementConfig`,{[H]:[`GET`,`/2021-07-20/functions/{FunctionName}/runtime-management-config`,200]},()=>e.GetRuntimeManagementConfigRequest$,()=>e.GetRuntimeManagementConfigResponse$],e.Invoke$=[9,Y,`Invoke`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/invocations`,200]},()=>e.InvocationRequest$,()=>e.InvocationResponse$],e.InvokeAsync$=[9,Y,`InvokeAsync`,{[H]:[`POST`,`/2014-11-13/functions/{FunctionName}/invoke-async`,202]},()=>e.InvokeAsyncRequest$,()=>e.InvokeAsyncResponse$],e.InvokeWithResponseStream$=[9,Y,`InvokeWithResponseStream`,{[H]:[`POST`,`/2021-11-15/functions/{FunctionName}/response-streaming-invocations`,200]},()=>e.InvokeWithResponseStreamRequest$,()=>e.InvokeWithResponseStreamResponse$],e.ListAliases$=[9,Y,`ListAliases`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/aliases`,200]},()=>e.ListAliasesRequest$,()=>e.ListAliasesResponse$],e.ListCapacityProviders$=[9,Y,`ListCapacityProviders`,{[H]:[`GET`,`/2025-11-30/capacity-providers`,200]},()=>e.ListCapacityProvidersRequest$,()=>e.ListCapacityProvidersResponse$],e.ListCodeSigningConfigs$=[9,Y,`ListCodeSigningConfigs`,{[H]:[`GET`,`/2020-04-22/code-signing-configs`,200]},()=>e.ListCodeSigningConfigsRequest$,()=>e.ListCodeSigningConfigsResponse$],e.ListDurableExecutionsByFunction$=[9,Y,`ListDurableExecutionsByFunction`,{[H]:[`GET`,`/2025-12-01/functions/{FunctionName}/durable-executions`,200]},()=>e.ListDurableExecutionsByFunctionRequest$,()=>e.ListDurableExecutionsByFunctionResponse$],e.ListEventSourceMappings$=[9,Y,`ListEventSourceMappings`,{[H]:[`GET`,`/2015-03-31/event-source-mappings`,200]},()=>e.ListEventSourceMappingsRequest$,()=>e.ListEventSourceMappingsResponse$],e.ListFunctionEventInvokeConfigs$=[9,Y,`ListFunctionEventInvokeConfigs`,{[H]:[`GET`,`/2019-09-25/functions/{FunctionName}/event-invoke-config/list`,200]},()=>e.ListFunctionEventInvokeConfigsRequest$,()=>e.ListFunctionEventInvokeConfigsResponse$],e.ListFunctions$=[9,Y,`ListFunctions`,{[H]:[`GET`,`/2015-03-31/functions`,200]},()=>e.ListFunctionsRequest$,()=>e.ListFunctionsResponse$],e.ListFunctionsByCodeSigningConfig$=[9,Y,`ListFunctionsByCodeSigningConfig`,{[H]:[`GET`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}/functions`,200]},()=>e.ListFunctionsByCodeSigningConfigRequest$,()=>e.ListFunctionsByCodeSigningConfigResponse$],e.ListFunctionUrlConfigs$=[9,Y,`ListFunctionUrlConfigs`,{[H]:[`GET`,`/2021-10-31/functions/{FunctionName}/urls`,200]},()=>e.ListFunctionUrlConfigsRequest$,()=>e.ListFunctionUrlConfigsResponse$],e.ListFunctionVersionsByCapacityProvider$=[9,Y,`ListFunctionVersionsByCapacityProvider`,{[H]:[`GET`,`/2025-11-30/capacity-providers/{CapacityProviderName}/function-versions`,200]},()=>e.ListFunctionVersionsByCapacityProviderRequest$,()=>e.ListFunctionVersionsByCapacityProviderResponse$],e.ListLayers$=[9,Y,`ListLayers`,{[H]:[`GET`,`/2018-10-31/layers`,200]},()=>e.ListLayersRequest$,()=>e.ListLayersResponse$],e.ListLayerVersions$=[9,Y,`ListLayerVersions`,{[H]:[`GET`,`/2018-10-31/layers/{LayerName}/versions`,200]},()=>e.ListLayerVersionsRequest$,()=>e.ListLayerVersionsResponse$],e.ListProvisionedConcurrencyConfigs$=[9,Y,`ListProvisionedConcurrencyConfigs`,{[H]:[`GET`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL`,200]},()=>e.ListProvisionedConcurrencyConfigsRequest$,()=>e.ListProvisionedConcurrencyConfigsResponse$],e.ListTags$=[9,Y,`ListTags`,{[H]:[`GET`,`/2017-03-31/tags/{Resource}`,200]},()=>e.ListTagsRequest$,()=>e.ListTagsResponse$],e.ListVersionsByFunction$=[9,Y,`ListVersionsByFunction`,{[H]:[`GET`,`/2015-03-31/functions/{FunctionName}/versions`,200]},()=>e.ListVersionsByFunctionRequest$,()=>e.ListVersionsByFunctionResponse$],e.PublishLayerVersion$=[9,Y,`PublishLayerVersion`,{[H]:[`POST`,`/2018-10-31/layers/{LayerName}/versions`,201]},()=>e.PublishLayerVersionRequest$,()=>e.PublishLayerVersionResponse$],e.PublishVersion$=[9,Y,`PublishVersion`,{[H]:[`POST`,`/2015-03-31/functions/{FunctionName}/versions`,201]},()=>e.PublishVersionRequest$,()=>e.FunctionConfiguration$],e.PutFunctionCodeSigningConfig$=[9,Y,`PutFunctionCodeSigningConfig`,{[H]:[`PUT`,`/2020-06-30/functions/{FunctionName}/code-signing-config`,200]},()=>e.PutFunctionCodeSigningConfigRequest$,()=>e.PutFunctionCodeSigningConfigResponse$],e.PutFunctionConcurrency$=[9,Y,`PutFunctionConcurrency`,{[H]:[`PUT`,`/2017-10-31/functions/{FunctionName}/concurrency`,200]},()=>e.PutFunctionConcurrencyRequest$,()=>e.Concurrency$],e.PutFunctionEventInvokeConfig$=[9,Y,`PutFunctionEventInvokeConfig`,{[H]:[`PUT`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,200]},()=>e.PutFunctionEventInvokeConfigRequest$,()=>e.FunctionEventInvokeConfig$],e.PutFunctionRecursionConfig$=[9,Y,`PutFunctionRecursionConfig`,{[H]:[`PUT`,`/2024-08-31/functions/{FunctionName}/recursion-config`,200]},()=>e.PutFunctionRecursionConfigRequest$,()=>e.PutFunctionRecursionConfigResponse$],e.PutFunctionScalingConfig$=[9,Y,`PutFunctionScalingConfig`,{[H]:[`PUT`,`/2025-11-30/functions/{FunctionName}/function-scaling-config`,202]},()=>e.PutFunctionScalingConfigRequest$,()=>e.PutFunctionScalingConfigResponse$],e.PutProvisionedConcurrencyConfig$=[9,Y,`PutProvisionedConcurrencyConfig`,{[H]:[`PUT`,`/2019-09-30/functions/{FunctionName}/provisioned-concurrency`,202]},()=>e.PutProvisionedConcurrencyConfigRequest$,()=>e.PutProvisionedConcurrencyConfigResponse$],e.PutRuntimeManagementConfig$=[9,Y,`PutRuntimeManagementConfig`,{[H]:[`PUT`,`/2021-07-20/functions/{FunctionName}/runtime-management-config`,200]},()=>e.PutRuntimeManagementConfigRequest$,()=>e.PutRuntimeManagementConfigResponse$],e.RemoveLayerVersionPermission$=[9,Y,`RemoveLayerVersionPermission`,{[H]:[`DELETE`,`/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}`,204]},()=>e.RemoveLayerVersionPermissionRequest$,()=>Ur],e.RemovePermission$=[9,Y,`RemovePermission`,{[H]:[`DELETE`,`/2015-03-31/functions/{FunctionName}/policy/{StatementId}`,204]},()=>e.RemovePermissionRequest$,()=>Ur],e.SendDurableExecutionCallbackFailure$=[9,Y,`SendDurableExecutionCallbackFailure`,{[H]:[`POST`,`/2025-12-01/durable-execution-callbacks/{CallbackId}/fail`,200]},()=>e.SendDurableExecutionCallbackFailureRequest$,()=>e.SendDurableExecutionCallbackFailureResponse$],e.SendDurableExecutionCallbackHeartbeat$=[9,Y,`SendDurableExecutionCallbackHeartbeat`,{[H]:[`POST`,`/2025-12-01/durable-execution-callbacks/{CallbackId}/heartbeat`,200]},()=>e.SendDurableExecutionCallbackHeartbeatRequest$,()=>e.SendDurableExecutionCallbackHeartbeatResponse$],e.SendDurableExecutionCallbackSuccess$=[9,Y,`SendDurableExecutionCallbackSuccess`,{[H]:[`POST`,`/2025-12-01/durable-execution-callbacks/{CallbackId}/succeed`,200]},()=>e.SendDurableExecutionCallbackSuccessRequest$,()=>e.SendDurableExecutionCallbackSuccessResponse$],e.StopDurableExecution$=[9,Y,`StopDurableExecution`,{[H]:[`POST`,`/2025-12-01/durable-executions/{DurableExecutionArn}/stop`,200]},()=>e.StopDurableExecutionRequest$,()=>e.StopDurableExecutionResponse$],e.TagResource$=[9,Y,`TagResource`,{[H]:[`POST`,`/2017-03-31/tags/{Resource}`,204]},()=>e.TagResourceRequest$,()=>Ur],e.UntagResource$=[9,Y,`UntagResource`,{[H]:[`DELETE`,`/2017-03-31/tags/{Resource}`,204]},()=>e.UntagResourceRequest$,()=>Ur],e.UpdateAlias$=[9,Y,`UpdateAlias`,{[H]:[`PUT`,`/2015-03-31/functions/{FunctionName}/aliases/{Name}`,200]},()=>e.UpdateAliasRequest$,()=>e.AliasConfiguration$],e.UpdateCapacityProvider$=[9,Y,`UpdateCapacityProvider`,{[H]:[`PUT`,`/2025-11-30/capacity-providers/{CapacityProviderName}`,202]},()=>e.UpdateCapacityProviderRequest$,()=>e.UpdateCapacityProviderResponse$],e.UpdateCodeSigningConfig$=[9,Y,`UpdateCodeSigningConfig`,{[H]:[`PUT`,`/2020-04-22/code-signing-configs/{CodeSigningConfigArn}`,200]},()=>e.UpdateCodeSigningConfigRequest$,()=>e.UpdateCodeSigningConfigResponse$],e.UpdateEventSourceMapping$=[9,Y,`UpdateEventSourceMapping`,{[H]:[`PUT`,`/2015-03-31/event-source-mappings/{UUID}`,202]},()=>e.UpdateEventSourceMappingRequest$,()=>e.EventSourceMappingConfiguration$],e.UpdateFunctionCode$=[9,Y,`UpdateFunctionCode`,{[H]:[`PUT`,`/2015-03-31/functions/{FunctionName}/code`,200]},()=>e.UpdateFunctionCodeRequest$,()=>e.FunctionConfiguration$],e.UpdateFunctionConfiguration$=[9,Y,`UpdateFunctionConfiguration`,{[H]:[`PUT`,`/2015-03-31/functions/{FunctionName}/configuration`,200]},()=>e.UpdateFunctionConfigurationRequest$,()=>e.FunctionConfiguration$],e.UpdateFunctionEventInvokeConfig$=[9,Y,`UpdateFunctionEventInvokeConfig`,{[H]:[`POST`,`/2019-09-25/functions/{FunctionName}/event-invoke-config`,200]},()=>e.UpdateFunctionEventInvokeConfigRequest$,()=>e.FunctionEventInvokeConfig$],e.UpdateFunctionUrlConfig$=[9,Y,`UpdateFunctionUrlConfig`,{[H]:[`PUT`,`/2021-10-31/functions/{FunctionName}/url`,200]},()=>e.UpdateFunctionUrlConfigRequest$,()=>e.UpdateFunctionUrlConfigResponse$]})),MP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(pv(),m(fv)),n=(Cx(),m(Sx)),r=w_(),i=ep(),a=gf(),o=mf(),s=mv(),c=OP(),l=jP();e.getRuntimeConfig=e=>({apiVersion:`2015-03-31`,base64Decoder:e?.base64Decoder??a.fromBase64,base64Encoder:e?.base64Encoder??a.toBase64,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??c.defaultEndpointResolver,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??s.defaultLambdaHttpAuthSchemeProvider,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:`aws.auth#sigv4`,identityProvider:e=>e.getIdentityProvider(`aws.auth#sigv4`),signer:new t.AwsSdkSigV4Signer}],logger:e?.logger??new r.NoOpLogger,protocol:e?.protocol??n.AwsRestJsonProtocol,protocolSettings:e?.protocolSettings??{defaultNamespace:`com.amazonaws.lambda`,errorTypeRegistries:l.errorTypeRegistries,version:`2015-03-31`,serviceTarget:`AWSGirApiService`},serviceId:e?.serviceId??`Lambda`,urlParser:e?.urlParser??i.parseUrl,utf8Decoder:e?.utf8Decoder??o.fromUtf8,utf8Encoder:e?.utf8Encoder??o.toUtf8})})),NP=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getRuntimeConfig=void 0;let t=(N(),m(j)).__importDefault(hv()),n=(i_(),m(r_)),r=(pv(),m(fv)),i=pP(),a=Pv(),o=l_(),s=EP(),c=Fv(),l=E_(),u=v_(),d=jf(),f=w_(),p=Iv(),h=Lv(),g=o_(),_=MP();e.getRuntimeConfig=e=>{(0,f.emitWarningIfUnsupportedVersion)(process.version);let m=(0,h.resolveDefaultsModeConfig)(e),v=()=>m().then(f.loadConfigsForDefaultMode),y=(0,_.getRuntimeConfig)(e);(0,n.emitWarningIfUnsupportedVersion)(process.version);let b={profile:e?.profile,logger:y.logger};return{...y,...e,runtime:`node`,defaultsMode:m,authSchemePreference:e?.authSchemePreference??(0,u.loadConfig)(r.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS,b),bodyLengthChecker:e?.bodyLengthChecker??p.calculateBodyLength,credentialDefaultProvider:e?.credentialDefaultProvider??i.defaultProvider,defaultUserAgentProvider:e?.defaultUserAgentProvider??(0,a.createDefaultUserAgentProvider)({serviceId:y.serviceId,clientVersion:t.default.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??s.eventStreamSerdeProvider,maxAttempts:e?.maxAttempts??(0,u.loadConfig)(l.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,e),region:e?.region??(0,u.loadConfig)(o.NODE_REGION_CONFIG_OPTIONS,{...o.NODE_REGION_CONFIG_FILE_OPTIONS,...b}),requestHandler:d.NodeHttpHandler.create(e?.requestHandler??v),retryMode:e?.retryMode??(0,u.loadConfig)({...l.NODE_RETRY_MODE_CONFIG_OPTIONS,default:async()=>(await v()).retryMode||g.DEFAULT_RETRY_MODE},e),sha256:e?.sha256??c.Hash.bind(null,`sha256`),streamCollector:e?.streamCollector??d.streamCollector,useDualstackEndpoint:e?.useDualstackEndpoint??(0,u.loadConfig)(o.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,b),useFipsEndpoint:e?.useFipsEndpoint??(0,u.loadConfig)(o.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,b),userAgentAppId:e?.userAgentAppId??(0,u.loadConfig)(a.NODE_APP_ID_CONFIG_OPTIONS,b)}}})),PP=u((e=>{let t=()=>{let e=new WeakSet;return(t,n)=>{if(typeof n==`object`&&n){if(e.has(n))return`[Circular]`;e.add(n)}return n}},n=e=>new Promise(t=>setTimeout(t,e*1e3)),r={minDelay:2,maxDelay:120};e.WaiterState=void 0,(function(e){e.ABORTED=`ABORTED`,e.FAILURE=`FAILURE`,e.SUCCESS=`SUCCESS`,e.RETRY=`RETRY`,e.TIMEOUT=`TIMEOUT`})(e.WaiterState||={});let i=n=>{if(n.state===e.WaiterState.ABORTED){let e=Error(`${JSON.stringify({...n,reason:`Request was aborted`},t())}`);throw e.name=`AbortError`,e}else if(n.state===e.WaiterState.TIMEOUT){let e=Error(`${JSON.stringify({...n,reason:`Waiter has timed out`},t())}`);throw e.name=`TimeoutError`,e}else if(n.state!==e.WaiterState.SUCCESS)throw Error(`${JSON.stringify(n,t())}`);return n},a=(e,t,n,r)=>r>n?t:o(e,e*2**(r-1)),o=(e,t)=>e+Math.random()*(t-e),s=async({minDelay:t,maxDelay:r,maxWaitTime:i,abortController:o,client:s,abortSignal:l},u,d)=>{let f={},{state:p,reason:m}=await d(s,u);if(m){let e=c(m);f[e]|=0,f[e]+=1}if(p!==e.WaiterState.RETRY)return{state:p,reason:m,observedResponses:f};let h=1,g=Date.now()+i*1e3,_=Math.log(r/t)/Math.log(2)+1;for(;;){if(o?.signal?.aborted||l?.aborted){let t=`AbortController signal aborted.`;return f[t]|=0,f[t]+=1,{state:e.WaiterState.ABORTED,observedResponses:f}}let i=a(t,r,_,h);if(Date.now()+i*1e3>g)return{state:e.WaiterState.TIMEOUT,observedResponses:f};await n(i);let{state:p,reason:m}=await d(s,u);if(m){let e=c(m);f[e]|=0,f[e]+=1}if(p!==e.WaiterState.RETRY)return{state:p,reason:m,observedResponses:f};h+=1}},c=e=>e?.$responseBodyText?`Deserialization error for body: ${e.$responseBodyText}`:e?.$metadata?.httpStatusCode?e.$response||e.message?`${e.$response?.statusCode??e.$metadata.httpStatusCode??`Unknown`}: ${e.message}`:`${e.$metadata.httpStatusCode}: OK`:String(e?.message??JSON.stringify(e,t())??`Unknown`),l=e=>{if(e.maxWaitTime<=0)throw Error(`WaiterConfiguration.maxWaitTime must be greater than 0`);if(e.minDelay<=0)throw Error(`WaiterConfiguration.minDelay must be greater than 0`);if(e.maxDelay<=0)throw Error(`WaiterConfiguration.maxDelay must be greater than 0`);if(e.maxWaitTime<=e.minDelay)throw Error(`WaiterConfiguration.maxWaitTime [${e.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`);if(e.maxDelay<e.minDelay)throw Error(`WaiterConfiguration.maxDelay [${e.maxDelay}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`)},u=t=>{let n;return{clearListener(){typeof t.removeEventListener==`function`&&t.removeEventListener(`abort`,n)},aborted:new Promise(r=>{n=()=>r({state:e.WaiterState.ABORTED}),typeof t.addEventListener==`function`?t.addEventListener(`abort`,n):t.onabort=n})}};e.checkExceptions=i,e.createWaiter=async(e,t,n)=>{let i={...r,...e};l(i);let a=[s(i,t,n)],o=[];if(e.abortSignal){let{aborted:t,clearListener:n}=u(e.abortSignal);o.push(n),a.push(t)}if(e.abortController?.signal){let{aborted:t,clearListener:n}=u(e.abortController.signal);o.push(n),a.push(t)}return Promise.race(a).then(e=>{for(let e of o)e();return e})},e.waiterServiceDefaults=r})),FP=u((e=>{var t=yd(),n=bd(),r=Ad(),i=s_(),a=l_(),o=(Gg(),m(Wg)),s=(Xp(),m(Yp)),c=u_(),l=d_(),u=S_(),d=E_(),f=w_(),p=mv(),h=NP(),g=qC(),_=vd(),v=jP(),y=PP(),b=AP(),x=kP();let S=e=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:`lambda`}),C={UseFIPS:{type:`builtInParams`,name:`useFipsEndpoint`},Endpoint:{type:`builtInParams`,name:`endpoint`},Region:{type:`builtInParams`,name:`region`},UseDualStack:{type:`builtInParams`,name:`useDualstackEndpoint`}},w=e=>{let t=e.httpAuthSchemes,n=e.httpAuthSchemeProvider,r=e.credentials;return{setHttpAuthScheme(e){let n=t.findIndex(t=>t.schemeId===e.schemeId);n===-1?t.push(e):t.splice(n,1,e)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(e){n=e},httpAuthSchemeProvider(){return n},setCredentials(e){r=e},credentials(){return r}}},ee=e=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),te=(e,t)=>{let n=Object.assign(g.getAwsRegionExtensionConfiguration(e),f.getDefaultExtensionConfiguration(e),_.getHttpHandlerExtensionConfiguration(e),w(e));return t.forEach(e=>e.configure(n)),Object.assign(e,g.resolveAwsRegionExtensionConfiguration(n),f.resolveDefaultRuntimeConfig(n),_.resolveHttpHandlerRuntimeConfig(n),ee(n))};var T=class extends f.Client{config;constructor(...[e]){let f=h.getRuntimeConfig(e||{});super(f),this.initConfig=f;let m=S(f),g=i.resolveUserAgentConfig(m),_=d.resolveRetryConfig(g),v=a.resolveRegionConfig(_),y=t.resolveHostHeaderConfig(v),b=u.resolveEndpointConfig(y),x=c.resolveEventStreamSerdeConfig(b);this.config=te(p.resolveHttpAuthSchemeConfig(x),e?.extensions||[]),this.middlewareStack.use(s.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(i.getUserAgentPlugin(this.config)),this.middlewareStack.use(d.getRetryPlugin(this.config)),this.middlewareStack.use(l.getContentLengthPlugin(this.config)),this.middlewareStack.use(t.getHostHeaderPlugin(this.config)),this.middlewareStack.use(n.getLoggerPlugin(this.config)),this.middlewareStack.use(r.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(o.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:p.defaultLambdaHttpAuthSchemeParametersProvider,identityProviderConfigProvider:async e=>new o.DefaultIdentityProviderConfig({"aws.auth#sigv4":e.credentials})})),this.middlewareStack.use(o.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}},E=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`AddLayerVersionPermission`,{}).n(`LambdaClient`,`AddLayerVersionPermissionCommand`).sc(v.AddLayerVersionPermission$).build(){},ne=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`AddPermission`,{}).n(`LambdaClient`,`AddPermissionCommand`).sc(v.AddPermission$).build(){},re=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CheckpointDurableExecution`,{}).n(`LambdaClient`,`CheckpointDurableExecutionCommand`).sc(v.CheckpointDurableExecution$).build(){},ie=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateAlias`,{}).n(`LambdaClient`,`CreateAliasCommand`).sc(v.CreateAlias$).build(){},ae=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateCapacityProvider`,{}).n(`LambdaClient`,`CreateCapacityProviderCommand`).sc(v.CreateCapacityProvider$).build(){},oe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateCodeSigningConfig`,{}).n(`LambdaClient`,`CreateCodeSigningConfigCommand`).sc(v.CreateCodeSigningConfig$).build(){},se=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateEventSourceMapping`,{}).n(`LambdaClient`,`CreateEventSourceMappingCommand`).sc(v.CreateEventSourceMapping$).build(){},ce=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateFunction`,{}).n(`LambdaClient`,`CreateFunctionCommand`).sc(v.CreateFunction$).build(){},le=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`CreateFunctionUrlConfig`,{}).n(`LambdaClient`,`CreateFunctionUrlConfigCommand`).sc(v.CreateFunctionUrlConfig$).build(){},ue=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteAlias`,{}).n(`LambdaClient`,`DeleteAliasCommand`).sc(v.DeleteAlias$).build(){},de=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteCapacityProvider`,{}).n(`LambdaClient`,`DeleteCapacityProviderCommand`).sc(v.DeleteCapacityProvider$).build(){},fe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteCodeSigningConfig`,{}).n(`LambdaClient`,`DeleteCodeSigningConfigCommand`).sc(v.DeleteCodeSigningConfig$).build(){},pe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteEventSourceMapping`,{}).n(`LambdaClient`,`DeleteEventSourceMappingCommand`).sc(v.DeleteEventSourceMapping$).build(){},me=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionCodeSigningConfig`,{}).n(`LambdaClient`,`DeleteFunctionCodeSigningConfigCommand`).sc(v.DeleteFunctionCodeSigningConfig$).build(){},he=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunction`,{}).n(`LambdaClient`,`DeleteFunctionCommand`).sc(v.DeleteFunction$).build(){},ge=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionConcurrency`,{}).n(`LambdaClient`,`DeleteFunctionConcurrencyCommand`).sc(v.DeleteFunctionConcurrency$).build(){},_e=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`DeleteFunctionEventInvokeConfigCommand`).sc(v.DeleteFunctionEventInvokeConfig$).build(){},ve=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteFunctionUrlConfig`,{}).n(`LambdaClient`,`DeleteFunctionUrlConfigCommand`).sc(v.DeleteFunctionUrlConfig$).build(){},ye=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteLayerVersion`,{}).n(`LambdaClient`,`DeleteLayerVersionCommand`).sc(v.DeleteLayerVersion$).build(){},be=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`DeleteProvisionedConcurrencyConfig`,{}).n(`LambdaClient`,`DeleteProvisionedConcurrencyConfigCommand`).sc(v.DeleteProvisionedConcurrencyConfig$).build(){},D=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetAccountSettings`,{}).n(`LambdaClient`,`GetAccountSettingsCommand`).sc(v.GetAccountSettings$).build(){},xe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetAlias`,{}).n(`LambdaClient`,`GetAliasCommand`).sc(v.GetAlias$).build(){},Se=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetCapacityProvider`,{}).n(`LambdaClient`,`GetCapacityProviderCommand`).sc(v.GetCapacityProvider$).build(){},Ce=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetCodeSigningConfig`,{}).n(`LambdaClient`,`GetCodeSigningConfigCommand`).sc(v.GetCodeSigningConfig$).build(){},we=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetDurableExecution`,{}).n(`LambdaClient`,`GetDurableExecutionCommand`).sc(v.GetDurableExecution$).build(){},Te=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetDurableExecutionHistory`,{}).n(`LambdaClient`,`GetDurableExecutionHistoryCommand`).sc(v.GetDurableExecutionHistory$).build(){},Ee=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetDurableExecutionState`,{}).n(`LambdaClient`,`GetDurableExecutionStateCommand`).sc(v.GetDurableExecutionState$).build(){},O=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetEventSourceMapping`,{}).n(`LambdaClient`,`GetEventSourceMappingCommand`).sc(v.GetEventSourceMapping$).build(){},De=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionCodeSigningConfig`,{}).n(`LambdaClient`,`GetFunctionCodeSigningConfigCommand`).sc(v.GetFunctionCodeSigningConfig$).build(){},k=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunction`,{}).n(`LambdaClient`,`GetFunctionCommand`).sc(v.GetFunction$).build(){},Oe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionConcurrency`,{}).n(`LambdaClient`,`GetFunctionConcurrencyCommand`).sc(v.GetFunctionConcurrency$).build(){},ke=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionConfiguration`,{}).n(`LambdaClient`,`GetFunctionConfigurationCommand`).sc(v.GetFunctionConfiguration$).build(){},Ae=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`GetFunctionEventInvokeConfigCommand`).sc(v.GetFunctionEventInvokeConfig$).build(){},je=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionRecursionConfig`,{}).n(`LambdaClient`,`GetFunctionRecursionConfigCommand`).sc(v.GetFunctionRecursionConfig$).build(){},Me=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionScalingConfig`,{}).n(`LambdaClient`,`GetFunctionScalingConfigCommand`).sc(v.GetFunctionScalingConfig$).build(){},Ne=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetFunctionUrlConfig`,{}).n(`LambdaClient`,`GetFunctionUrlConfigCommand`).sc(v.GetFunctionUrlConfig$).build(){},Pe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetLayerVersionByArn`,{}).n(`LambdaClient`,`GetLayerVersionByArnCommand`).sc(v.GetLayerVersionByArn$).build(){},Fe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetLayerVersion`,{}).n(`LambdaClient`,`GetLayerVersionCommand`).sc(v.GetLayerVersion$).build(){},A=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetLayerVersionPolicy`,{}).n(`LambdaClient`,`GetLayerVersionPolicyCommand`).sc(v.GetLayerVersionPolicy$).build(){},Ie=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetPolicy`,{}).n(`LambdaClient`,`GetPolicyCommand`).sc(v.GetPolicy$).build(){},Le=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetProvisionedConcurrencyConfig`,{}).n(`LambdaClient`,`GetProvisionedConcurrencyConfigCommand`).sc(v.GetProvisionedConcurrencyConfig$).build(){},Re=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`GetRuntimeManagementConfig`,{}).n(`LambdaClient`,`GetRuntimeManagementConfigCommand`).sc(v.GetRuntimeManagementConfig$).build(){},ze=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`InvokeAsync`,{}).n(`LambdaClient`,`InvokeAsyncCommand`).sc(v.InvokeAsync$).build(){},Be=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`Invoke`,{}).n(`LambdaClient`,`InvokeCommand`).sc(v.Invoke$).build(){},Ve=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`InvokeWithResponseStream`,{eventStream:{output:!0}}).n(`LambdaClient`,`InvokeWithResponseStreamCommand`).sc(v.InvokeWithResponseStream$).build(){},j=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListAliases`,{}).n(`LambdaClient`,`ListAliasesCommand`).sc(v.ListAliases$).build(){},He=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListCapacityProviders`,{}).n(`LambdaClient`,`ListCapacityProvidersCommand`).sc(v.ListCapacityProviders$).build(){},Ue=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListCodeSigningConfigs`,{}).n(`LambdaClient`,`ListCodeSigningConfigsCommand`).sc(v.ListCodeSigningConfigs$).build(){},We=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListDurableExecutionsByFunction`,{}).n(`LambdaClient`,`ListDurableExecutionsByFunctionCommand`).sc(v.ListDurableExecutionsByFunction$).build(){},Ge=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListEventSourceMappings`,{}).n(`LambdaClient`,`ListEventSourceMappingsCommand`).sc(v.ListEventSourceMappings$).build(){},Ke=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionEventInvokeConfigs`,{}).n(`LambdaClient`,`ListFunctionEventInvokeConfigsCommand`).sc(v.ListFunctionEventInvokeConfigs$).build(){},qe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionsByCodeSigningConfig`,{}).n(`LambdaClient`,`ListFunctionsByCodeSigningConfigCommand`).sc(v.ListFunctionsByCodeSigningConfig$).build(){},Je=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctions`,{}).n(`LambdaClient`,`ListFunctionsCommand`).sc(v.ListFunctions$).build(){},Ye=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionUrlConfigs`,{}).n(`LambdaClient`,`ListFunctionUrlConfigsCommand`).sc(v.ListFunctionUrlConfigs$).build(){},Xe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListFunctionVersionsByCapacityProvider`,{}).n(`LambdaClient`,`ListFunctionVersionsByCapacityProviderCommand`).sc(v.ListFunctionVersionsByCapacityProvider$).build(){},Ze=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListLayers`,{}).n(`LambdaClient`,`ListLayersCommand`).sc(v.ListLayers$).build(){},Qe=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListLayerVersions`,{}).n(`LambdaClient`,`ListLayerVersionsCommand`).sc(v.ListLayerVersions$).build(){},$e=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListProvisionedConcurrencyConfigs`,{}).n(`LambdaClient`,`ListProvisionedConcurrencyConfigsCommand`).sc(v.ListProvisionedConcurrencyConfigs$).build(){},et=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListTags`,{}).n(`LambdaClient`,`ListTagsCommand`).sc(v.ListTags$).build(){},tt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`ListVersionsByFunction`,{}).n(`LambdaClient`,`ListVersionsByFunctionCommand`).sc(v.ListVersionsByFunction$).build(){},nt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PublishLayerVersion`,{}).n(`LambdaClient`,`PublishLayerVersionCommand`).sc(v.PublishLayerVersion$).build(){},M=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PublishVersion`,{}).n(`LambdaClient`,`PublishVersionCommand`).sc(v.PublishVersion$).build(){},rt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionCodeSigningConfig`,{}).n(`LambdaClient`,`PutFunctionCodeSigningConfigCommand`).sc(v.PutFunctionCodeSigningConfig$).build(){},it=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionConcurrency`,{}).n(`LambdaClient`,`PutFunctionConcurrencyCommand`).sc(v.PutFunctionConcurrency$).build(){},at=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`PutFunctionEventInvokeConfigCommand`).sc(v.PutFunctionEventInvokeConfig$).build(){},ot=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionRecursionConfig`,{}).n(`LambdaClient`,`PutFunctionRecursionConfigCommand`).sc(v.PutFunctionRecursionConfig$).build(){},st=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutFunctionScalingConfig`,{}).n(`LambdaClient`,`PutFunctionScalingConfigCommand`).sc(v.PutFunctionScalingConfig$).build(){},ct=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutProvisionedConcurrencyConfig`,{}).n(`LambdaClient`,`PutProvisionedConcurrencyConfigCommand`).sc(v.PutProvisionedConcurrencyConfig$).build(){},lt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`PutRuntimeManagementConfig`,{}).n(`LambdaClient`,`PutRuntimeManagementConfigCommand`).sc(v.PutRuntimeManagementConfig$).build(){},ut=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`RemoveLayerVersionPermission`,{}).n(`LambdaClient`,`RemoveLayerVersionPermissionCommand`).sc(v.RemoveLayerVersionPermission$).build(){},dt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`RemovePermission`,{}).n(`LambdaClient`,`RemovePermissionCommand`).sc(v.RemovePermission$).build(){},ft=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`SendDurableExecutionCallbackFailure`,{}).n(`LambdaClient`,`SendDurableExecutionCallbackFailureCommand`).sc(v.SendDurableExecutionCallbackFailure$).build(){},pt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`SendDurableExecutionCallbackHeartbeat`,{}).n(`LambdaClient`,`SendDurableExecutionCallbackHeartbeatCommand`).sc(v.SendDurableExecutionCallbackHeartbeat$).build(){},mt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`SendDurableExecutionCallbackSuccess`,{}).n(`LambdaClient`,`SendDurableExecutionCallbackSuccessCommand`).sc(v.SendDurableExecutionCallbackSuccess$).build(){},ht=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`StopDurableExecution`,{}).n(`LambdaClient`,`StopDurableExecutionCommand`).sc(v.StopDurableExecution$).build(){},gt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`TagResource`,{}).n(`LambdaClient`,`TagResourceCommand`).sc(v.TagResource$).build(){},_t=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UntagResource`,{}).n(`LambdaClient`,`UntagResourceCommand`).sc(v.UntagResource$).build(){},vt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateAlias`,{}).n(`LambdaClient`,`UpdateAliasCommand`).sc(v.UpdateAlias$).build(){},yt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateCapacityProvider`,{}).n(`LambdaClient`,`UpdateCapacityProviderCommand`).sc(v.UpdateCapacityProvider$).build(){},bt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateCodeSigningConfig`,{}).n(`LambdaClient`,`UpdateCodeSigningConfigCommand`).sc(v.UpdateCodeSigningConfig$).build(){},xt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateEventSourceMapping`,{}).n(`LambdaClient`,`UpdateEventSourceMappingCommand`).sc(v.UpdateEventSourceMapping$).build(){},St=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionCode`,{}).n(`LambdaClient`,`UpdateFunctionCodeCommand`).sc(v.UpdateFunctionCode$).build(){},Ct=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionConfiguration`,{}).n(`LambdaClient`,`UpdateFunctionConfigurationCommand`).sc(v.UpdateFunctionConfiguration$).build(){},N=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionEventInvokeConfig`,{}).n(`LambdaClient`,`UpdateFunctionEventInvokeConfigCommand`).sc(v.UpdateFunctionEventInvokeConfig$).build(){},wt=class extends f.Command.classBuilder().ep(C).m(function(e,t,n,r){return[u.getEndpointPlugin(n,e.getEndpointParameterInstructions())]}).s(`AWSGirApiService`,`UpdateFunctionUrlConfig`,{}).n(`LambdaClient`,`UpdateFunctionUrlConfigCommand`).sc(v.UpdateFunctionUrlConfig$).build(){};let Tt=o.createPaginator(T,Te,`Marker`,`NextMarker`,`MaxItems`),Et=o.createPaginator(T,Ee,`Marker`,`NextMarker`,`MaxItems`),Dt=o.createPaginator(T,j,`Marker`,`NextMarker`,`MaxItems`),Ot=o.createPaginator(T,He,`Marker`,`NextMarker`,`MaxItems`),kt=o.createPaginator(T,Ue,`Marker`,`NextMarker`,`MaxItems`),At=o.createPaginator(T,We,`Marker`,`NextMarker`,`MaxItems`),jt=o.createPaginator(T,Ge,`Marker`,`NextMarker`,`MaxItems`),Mt=o.createPaginator(T,Ke,`Marker`,`NextMarker`,`MaxItems`),Nt=o.createPaginator(T,qe,`Marker`,`NextMarker`,`MaxItems`),Pt=o.createPaginator(T,Je,`Marker`,`NextMarker`,`MaxItems`),Ft=o.createPaginator(T,Ye,`Marker`,`NextMarker`,`MaxItems`),It=o.createPaginator(T,Xe,`Marker`,`NextMarker`,`MaxItems`),Lt=o.createPaginator(T,Ze,`Marker`,`NextMarker`,`MaxItems`),Rt=o.createPaginator(T,Qe,`Marker`,`NextMarker`,`MaxItems`),zt=o.createPaginator(T,$e,`Marker`,`NextMarker`,`MaxItems`),Bt=o.createPaginator(T,tt,`Marker`,`NextMarker`,`MaxItems`),Vt=async(e,t)=>{let n;try{let r=await e.send(new ke(t));n=r;try{if(r.State===`Active`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.State===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.State===`Pending`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},Ht=async(e,t)=>y.createWaiter({minDelay:5,maxDelay:300,...e},t,Vt),Ut=async(e,t)=>{let n=await y.createWaiter({minDelay:5,maxDelay:300,...e},t,Vt);return y.checkExceptions(n)},Wt=async(e,t)=>{let n;try{let r=await e.send(new k(t));n=r;try{if(r.Configuration.State===`Active`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.Configuration.State===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.Configuration.State===`Pending`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},Gt=async(e,t)=>y.createWaiter({minDelay:1,maxDelay:300,...e},t,Wt),P=async(e,t)=>{let n=await y.createWaiter({minDelay:1,maxDelay:300,...e},t,Wt);return y.checkExceptions(n)},Kt=async(e,t)=>{let n;try{return n=await e.send(new k(t)),{state:y.WaiterState.SUCCESS,reason:n}}catch(e){if(n=e,e.name&&e.name==`ResourceNotFoundException`)return{state:y.WaiterState.RETRY,reason:n}}return{state:y.WaiterState.RETRY,reason:n}},qt=async(e,t)=>y.createWaiter({minDelay:1,maxDelay:20,...e},t,Kt),Jt=async(e,t)=>{let n=await y.createWaiter({minDelay:1,maxDelay:20,...e},t,Kt);return y.checkExceptions(n)},Yt=async(e,t)=>{let n;try{let r=await e.send(new ke(t));n=r;try{if(r.LastUpdateStatus===`Successful`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.LastUpdateStatus===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.LastUpdateStatus===`InProgress`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},Xt=async(e,t)=>y.createWaiter({minDelay:5,maxDelay:300,...e},t,Yt),Zt=async(e,t)=>{let n=await y.createWaiter({minDelay:5,maxDelay:300,...e},t,Yt);return y.checkExceptions(n)},Qt=async(e,t)=>{let n;try{let r=await e.send(new k(t));n=r;try{if(r.Configuration.LastUpdateStatus===`Successful`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.Configuration.LastUpdateStatus===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.Configuration.LastUpdateStatus===`InProgress`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},$t=async(e,t)=>y.createWaiter({minDelay:1,maxDelay:300,...e},t,Qt),en=async(e,t)=>{let n=await y.createWaiter({minDelay:1,maxDelay:300,...e},t,Qt);return y.checkExceptions(n)},tn=async(e,t)=>{let n;try{let r=await e.send(new ke(t));n=r;try{if(r.State===`Active`)return{state:y.WaiterState.SUCCESS,reason:n}}catch{}try{if(r.State===`Failed`)return{state:y.WaiterState.FAILURE,reason:n}}catch{}try{if(r.State===`Pending`)return{state:y.WaiterState.RETRY,reason:n}}catch{}}catch(e){n=e}return{state:y.WaiterState.RETRY,reason:n}},nn=async(e,t)=>y.createWaiter({minDelay:5,maxDelay:1560,...e},t,tn),rn=async(e,t)=>{let n=await y.createWaiter({minDelay:5,maxDelay:1560,...e},t,tn);return y.checkExceptions(n)},F={AddLayerVersionPermissionCommand:E,AddPermissionCommand:ne,CheckpointDurableExecutionCommand:re,CreateAliasCommand:ie,CreateCapacityProviderCommand:ae,CreateCodeSigningConfigCommand:oe,CreateEventSourceMappingCommand:se,CreateFunctionCommand:ce,CreateFunctionUrlConfigCommand:le,DeleteAliasCommand:ue,DeleteCapacityProviderCommand:de,DeleteCodeSigningConfigCommand:fe,DeleteEventSourceMappingCommand:pe,DeleteFunctionCommand:he,DeleteFunctionCodeSigningConfigCommand:me,DeleteFunctionConcurrencyCommand:ge,DeleteFunctionEventInvokeConfigCommand:_e,DeleteFunctionUrlConfigCommand:ve,DeleteLayerVersionCommand:ye,DeleteProvisionedConcurrencyConfigCommand:be,GetAccountSettingsCommand:D,GetAliasCommand:xe,GetCapacityProviderCommand:Se,GetCodeSigningConfigCommand:Ce,GetDurableExecutionCommand:we,GetDurableExecutionHistoryCommand:Te,GetDurableExecutionStateCommand:Ee,GetEventSourceMappingCommand:O,GetFunctionCommand:k,GetFunctionCodeSigningConfigCommand:De,GetFunctionConcurrencyCommand:Oe,GetFunctionConfigurationCommand:ke,GetFunctionEventInvokeConfigCommand:Ae,GetFunctionRecursionConfigCommand:je,GetFunctionScalingConfigCommand:Me,GetFunctionUrlConfigCommand:Ne,GetLayerVersionCommand:Fe,GetLayerVersionByArnCommand:Pe,GetLayerVersionPolicyCommand:A,GetPolicyCommand:Ie,GetProvisionedConcurrencyConfigCommand:Le,GetRuntimeManagementConfigCommand:Re,InvokeCommand:Be,InvokeAsyncCommand:ze,InvokeWithResponseStreamCommand:Ve,ListAliasesCommand:j,ListCapacityProvidersCommand:He,ListCodeSigningConfigsCommand:Ue,ListDurableExecutionsByFunctionCommand:We,ListEventSourceMappingsCommand:Ge,ListFunctionEventInvokeConfigsCommand:Ke,ListFunctionsCommand:Je,ListFunctionsByCodeSigningConfigCommand:qe,ListFunctionUrlConfigsCommand:Ye,ListFunctionVersionsByCapacityProviderCommand:Xe,ListLayersCommand:Ze,ListLayerVersionsCommand:Qe,ListProvisionedConcurrencyConfigsCommand:$e,ListTagsCommand:et,ListVersionsByFunctionCommand:tt,PublishLayerVersionCommand:nt,PublishVersionCommand:M,PutFunctionCodeSigningConfigCommand:rt,PutFunctionConcurrencyCommand:it,PutFunctionEventInvokeConfigCommand:at,PutFunctionRecursionConfigCommand:ot,PutFunctionScalingConfigCommand:st,PutProvisionedConcurrencyConfigCommand:ct,PutRuntimeManagementConfigCommand:lt,RemoveLayerVersionPermissionCommand:ut,RemovePermissionCommand:dt,SendDurableExecutionCallbackFailureCommand:ft,SendDurableExecutionCallbackHeartbeatCommand:pt,SendDurableExecutionCallbackSuccessCommand:mt,StopDurableExecutionCommand:ht,TagResourceCommand:gt,UntagResourceCommand:_t,UpdateAliasCommand:vt,UpdateCapacityProviderCommand:yt,UpdateCodeSigningConfigCommand:bt,UpdateEventSourceMappingCommand:xt,UpdateFunctionCodeCommand:St,UpdateFunctionConfigurationCommand:Ct,UpdateFunctionEventInvokeConfigCommand:N,UpdateFunctionUrlConfigCommand:wt},I={paginateGetDurableExecutionHistory:Tt,paginateGetDurableExecutionState:Et,paginateListAliases:Dt,paginateListCapacityProviders:Ot,paginateListCodeSigningConfigs:kt,paginateListDurableExecutionsByFunction:At,paginateListEventSourceMappings:jt,paginateListFunctionEventInvokeConfigs:Mt,paginateListFunctions:Pt,paginateListFunctionsByCodeSigningConfig:Nt,paginateListFunctionUrlConfigs:Ft,paginateListFunctionVersionsByCapacityProvider:It,paginateListLayers:Lt,paginateListLayerVersions:Rt,paginateListProvisionedConcurrencyConfigs:zt,paginateListVersionsByFunction:Bt},an={waitUntilFunctionActiveV2:P,waitUntilFunctionExists:Jt,waitUntilFunctionUpdatedV2:en,waitUntilFunctionActive:Ut,waitUntilFunctionUpdated:Zt,waitUntilPublishedVersionActive:rn};var on=class extends T{};f.createAggregatedClient(F,on,{paginators:I,waiters:an}),e.$Command=f.Command,e.__Client=f.Client,e.LambdaServiceException=x.LambdaServiceException,e.AddLayerVersionPermissionCommand=E,e.AddPermissionCommand=ne,e.ApplicationLogLevel={Debug:`DEBUG`,Error:`ERROR`,Fatal:`FATAL`,Info:`INFO`,Trace:`TRACE`,Warn:`WARN`},e.Architecture={arm64:`arm64`,x86_64:`x86_64`},e.CapacityProviderPredefinedMetricType={LambdaCapacityProviderAverageCPUUtilization:`LambdaCapacityProviderAverageCPUUtilization`},e.CapacityProviderScalingMode={Auto:`Auto`,Manual:`Manual`},e.CapacityProviderState={Active:`Active`,Deleting:`Deleting`,Failed:`Failed`,Pending:`Pending`},e.CheckpointDurableExecutionCommand=re,e.CodeSigningPolicy={Enforce:`Enforce`,Warn:`Warn`},e.CreateAliasCommand=ie,e.CreateCapacityProviderCommand=ae,e.CreateCodeSigningConfigCommand=oe,e.CreateEventSourceMappingCommand=se,e.CreateFunctionCommand=ce,e.CreateFunctionUrlConfigCommand=le,e.DeleteAliasCommand=ue,e.DeleteCapacityProviderCommand=de,e.DeleteCodeSigningConfigCommand=fe,e.DeleteEventSourceMappingCommand=pe,e.DeleteFunctionCodeSigningConfigCommand=me,e.DeleteFunctionCommand=he,e.DeleteFunctionConcurrencyCommand=ge,e.DeleteFunctionEventInvokeConfigCommand=_e,e.DeleteFunctionUrlConfigCommand=ve,e.DeleteLayerVersionCommand=ye,e.DeleteProvisionedConcurrencyConfigCommand=be,e.EndPointType={KAFKA_BOOTSTRAP_SERVERS:`KAFKA_BOOTSTRAP_SERVERS`},e.EventSourceMappingMetric={ErrorCount:`ErrorCount`,EventCount:`EventCount`,KafkaMetrics:`KafkaMetrics`},e.EventSourceMappingSystemLogLevel={Debug:`DEBUG`,Info:`INFO`,Warn:`WARN`},e.EventSourcePosition={AT_TIMESTAMP:`AT_TIMESTAMP`,LATEST:`LATEST`,TRIM_HORIZON:`TRIM_HORIZON`},e.EventType={CallbackFailed:`CallbackFailed`,CallbackStarted:`CallbackStarted`,CallbackSucceeded:`CallbackSucceeded`,CallbackTimedOut:`CallbackTimedOut`,ChainedInvokeFailed:`ChainedInvokeFailed`,ChainedInvokeStarted:`ChainedInvokeStarted`,ChainedInvokeStopped:`ChainedInvokeStopped`,ChainedInvokeSucceeded:`ChainedInvokeSucceeded`,ChainedInvokeTimedOut:`ChainedInvokeTimedOut`,ContextFailed:`ContextFailed`,ContextStarted:`ContextStarted`,ContextSucceeded:`ContextSucceeded`,ExecutionFailed:`ExecutionFailed`,ExecutionStarted:`ExecutionStarted`,ExecutionStopped:`ExecutionStopped`,ExecutionSucceeded:`ExecutionSucceeded`,ExecutionTimedOut:`ExecutionTimedOut`,InvocationCompleted:`InvocationCompleted`,StepFailed:`StepFailed`,StepStarted:`StepStarted`,StepSucceeded:`StepSucceeded`,WaitCancelled:`WaitCancelled`,WaitStarted:`WaitStarted`,WaitSucceeded:`WaitSucceeded`},e.ExecutionStatus={FAILED:`FAILED`,RUNNING:`RUNNING`,STOPPED:`STOPPED`,SUCCEEDED:`SUCCEEDED`,TIMED_OUT:`TIMED_OUT`},e.FullDocument={Default:`Default`,UpdateLookup:`UpdateLookup`},e.FunctionResponseType={ReportBatchItemFailures:`ReportBatchItemFailures`},e.FunctionUrlAuthType={AWS_IAM:`AWS_IAM`,NONE:`NONE`},e.FunctionVersion={ALL:`ALL`},e.FunctionVersionLatestPublished={LATEST_PUBLISHED:`LATEST_PUBLISHED`},e.GetAccountSettingsCommand=D,e.GetAliasCommand=xe,e.GetCapacityProviderCommand=Se,e.GetCodeSigningConfigCommand=Ce,e.GetDurableExecutionCommand=we,e.GetDurableExecutionHistoryCommand=Te,e.GetDurableExecutionStateCommand=Ee,e.GetEventSourceMappingCommand=O,e.GetFunctionCodeSigningConfigCommand=De,e.GetFunctionCommand=k,e.GetFunctionConcurrencyCommand=Oe,e.GetFunctionConfigurationCommand=ke,e.GetFunctionEventInvokeConfigCommand=Ae,e.GetFunctionRecursionConfigCommand=je,e.GetFunctionScalingConfigCommand=Me,e.GetFunctionUrlConfigCommand=Ne,e.GetLayerVersionByArnCommand=Pe,e.GetLayerVersionCommand=Fe,e.GetLayerVersionPolicyCommand=A,e.GetPolicyCommand=Ie,e.GetProvisionedConcurrencyConfigCommand=Le,e.GetRuntimeManagementConfigCommand=Re,e.InvocationType={DryRun:`DryRun`,Event:`Event`,RequestResponse:`RequestResponse`},e.InvokeAsyncCommand=ze,e.InvokeCommand=Be,e.InvokeMode={BUFFERED:`BUFFERED`,RESPONSE_STREAM:`RESPONSE_STREAM`},e.InvokeWithResponseStreamCommand=Ve,e.KafkaSchemaRegistryAuthType={BASIC_AUTH:`BASIC_AUTH`,CLIENT_CERTIFICATE_TLS_AUTH:`CLIENT_CERTIFICATE_TLS_AUTH`,SERVER_ROOT_CA_CERTIFICATE:`SERVER_ROOT_CA_CERTIFICATE`},e.KafkaSchemaValidationAttribute={KEY:`KEY`,VALUE:`VALUE`},e.Lambda=on,e.LambdaClient=T,e.LastUpdateStatus={Failed:`Failed`,InProgress:`InProgress`,Successful:`Successful`},e.LastUpdateStatusReasonCode={CapacityProviderScalingLimitExceeded:`CapacityProviderScalingLimitExceeded`,DisabledKMSKey:`DisabledKMSKey`,DisallowedByVpcEncryptionControl:`DisallowedByVpcEncryptionControl`,EC2RequestLimitExceeded:`EC2RequestLimitExceeded`,EFSIOError:`EFSIOError`,EFSMountConnectivityError:`EFSMountConnectivityError`,EFSMountFailure:`EFSMountFailure`,EFSMountTimeout:`EFSMountTimeout`,EniLimitExceeded:`EniLimitExceeded`,FunctionError:`FunctionError`,FunctionErrorExtensionInitError:`FunctionError.ExtensionInitError`,FunctionErrorInitResourceExhausted:`FunctionError.InitResourceExhausted`,FunctionErrorInitTimeout:`FunctionError.InitTimeout`,FunctionErrorInvalidEntryPoint:`FunctionError.InvalidEntryPoint`,FunctionErrorInvalidWorkingDirectory:`FunctionError.InvalidWorkingDirectory`,FunctionErrorPermissionDenied:`FunctionError.PermissionDenied`,FunctionErrorRuntimeInitError:`FunctionError.RuntimeInitError`,FunctionErrorTooManyExtensions:`FunctionError.TooManyExtensions`,ImageAccessDenied:`ImageAccessDenied`,ImageDeleted:`ImageDeleted`,InsufficientCapacity:`InsufficientCapacity`,InsufficientRolePermissions:`InsufficientRolePermissions`,InternalError:`InternalError`,InvalidConfiguration:`InvalidConfiguration`,InvalidImage:`InvalidImage`,InvalidRuntime:`InvalidRuntime`,InvalidSecurityGroup:`InvalidSecurityGroup`,InvalidStateKMSKey:`InvalidStateKMSKey`,InvalidSubnet:`InvalidSubnet`,InvalidZipFileException:`InvalidZipFileException`,KMSKeyAccessDenied:`KMSKeyAccessDenied`,KMSKeyNotFound:`KMSKeyNotFound`,SubnetOutOfIPAddresses:`SubnetOutOfIPAddresses`,VcpuLimitExceeded:`VcpuLimitExceeded`},e.ListAliasesCommand=j,e.ListCapacityProvidersCommand=He,e.ListCodeSigningConfigsCommand=Ue,e.ListDurableExecutionsByFunctionCommand=We,e.ListEventSourceMappingsCommand=Ge,e.ListFunctionEventInvokeConfigsCommand=Ke,e.ListFunctionUrlConfigsCommand=Ye,e.ListFunctionVersionsByCapacityProviderCommand=Xe,e.ListFunctionsByCodeSigningConfigCommand=qe,e.ListFunctionsCommand=Je,e.ListLayerVersionsCommand=Qe,e.ListLayersCommand=Ze,e.ListProvisionedConcurrencyConfigsCommand=$e,e.ListTagsCommand=et,e.ListVersionsByFunctionCommand=tt,e.LogFormat={Json:`JSON`,Text:`Text`},e.LogType={None:`None`,Tail:`Tail`},e.OperationAction={CANCEL:`CANCEL`,FAIL:`FAIL`,RETRY:`RETRY`,START:`START`,SUCCEED:`SUCCEED`},e.OperationStatus={CANCELLED:`CANCELLED`,FAILED:`FAILED`,PENDING:`PENDING`,READY:`READY`,STARTED:`STARTED`,STOPPED:`STOPPED`,SUCCEEDED:`SUCCEEDED`,TIMED_OUT:`TIMED_OUT`},e.OperationType={CALLBACK:`CALLBACK`,CHAINED_INVOKE:`CHAINED_INVOKE`,CONTEXT:`CONTEXT`,EXECUTION:`EXECUTION`,STEP:`STEP`,WAIT:`WAIT`},e.PackageType={Image:`Image`,Zip:`Zip`},e.ProvisionedConcurrencyStatusEnum={FAILED:`FAILED`,IN_PROGRESS:`IN_PROGRESS`,READY:`READY`},e.PublishLayerVersionCommand=nt,e.PublishVersionCommand=M,e.PutFunctionCodeSigningConfigCommand=rt,e.PutFunctionConcurrencyCommand=it,e.PutFunctionEventInvokeConfigCommand=at,e.PutFunctionRecursionConfigCommand=ot,e.PutFunctionScalingConfigCommand=st,e.PutProvisionedConcurrencyConfigCommand=ct,e.PutRuntimeManagementConfigCommand=lt,e.RecursiveLoop={Allow:`Allow`,Terminate:`Terminate`},e.RemoveLayerVersionPermissionCommand=ut,e.RemovePermissionCommand=dt,e.ResponseStreamingInvocationType={DryRun:`DryRun`,RequestResponse:`RequestResponse`},e.Runtime={dotnet10:`dotnet10`,dotnet6:`dotnet6`,dotnet8:`dotnet8`,dotnetcore10:`dotnetcore1.0`,dotnetcore20:`dotnetcore2.0`,dotnetcore21:`dotnetcore2.1`,dotnetcore31:`dotnetcore3.1`,go1x:`go1.x`,java11:`java11`,java17:`java17`,java21:`java21`,java25:`java25`,java8:`java8`,java8al2:`java8.al2`,nodejs:`nodejs`,nodejs10x:`nodejs10.x`,nodejs12x:`nodejs12.x`,nodejs14x:`nodejs14.x`,nodejs16x:`nodejs16.x`,nodejs18x:`nodejs18.x`,nodejs20x:`nodejs20.x`,nodejs22x:`nodejs22.x`,nodejs24x:`nodejs24.x`,nodejs43:`nodejs4.3`,nodejs43edge:`nodejs4.3-edge`,nodejs610:`nodejs6.10`,nodejs810:`nodejs8.10`,provided:`provided`,providedal2:`provided.al2`,providedal2023:`provided.al2023`,python27:`python2.7`,python310:`python3.10`,python311:`python3.11`,python312:`python3.12`,python313:`python3.13`,python314:`python3.14`,python36:`python3.6`,python37:`python3.7`,python38:`python3.8`,python39:`python3.9`,ruby25:`ruby2.5`,ruby27:`ruby2.7`,ruby32:`ruby3.2`,ruby33:`ruby3.3`,ruby34:`ruby3.4`},e.SchemaRegistryEventRecordFormat={JSON:`JSON`,SOURCE:`SOURCE`},e.SendDurableExecutionCallbackFailureCommand=ft,e.SendDurableExecutionCallbackHeartbeatCommand=pt,e.SendDurableExecutionCallbackSuccessCommand=mt,e.SnapStartApplyOn={None:`None`,PublishedVersions:`PublishedVersions`},e.SnapStartOptimizationStatus={Off:`Off`,On:`On`},e.SourceAccessType={BASIC_AUTH:`BASIC_AUTH`,CLIENT_CERTIFICATE_TLS_AUTH:`CLIENT_CERTIFICATE_TLS_AUTH`,SASL_SCRAM_256_AUTH:`SASL_SCRAM_256_AUTH`,SASL_SCRAM_512_AUTH:`SASL_SCRAM_512_AUTH`,SERVER_ROOT_CA_CERTIFICATE:`SERVER_ROOT_CA_CERTIFICATE`,VIRTUAL_HOST:`VIRTUAL_HOST`,VPC_SECURITY_GROUP:`VPC_SECURITY_GROUP`,VPC_SUBNET:`VPC_SUBNET`},e.State={Active:`Active`,ActiveNonInvocable:`ActiveNonInvocable`,Deactivated:`Deactivated`,Deactivating:`Deactivating`,Deleting:`Deleting`,Failed:`Failed`,Inactive:`Inactive`,Pending:`Pending`},e.StateReasonCode={CapacityProviderScalingLimitExceeded:`CapacityProviderScalingLimitExceeded`,Creating:`Creating`,DisabledKMSKey:`DisabledKMSKey`,DisallowedByVpcEncryptionControl:`DisallowedByVpcEncryptionControl`,DrainingDurableExecutions:`DrainingDurableExecutions`,EC2RequestLimitExceeded:`EC2RequestLimitExceeded`,EFSIOError:`EFSIOError`,EFSMountConnectivityError:`EFSMountConnectivityError`,EFSMountFailure:`EFSMountFailure`,EFSMountTimeout:`EFSMountTimeout`,EniLimitExceeded:`EniLimitExceeded`,FunctionError:`FunctionError`,FunctionErrorExtensionInitError:`FunctionError.ExtensionInitError`,FunctionErrorInitResourceExhausted:`FunctionError.InitResourceExhausted`,FunctionErrorInitTimeout:`FunctionError.InitTimeout`,FunctionErrorInvalidEntryPoint:`FunctionError.InvalidEntryPoint`,FunctionErrorInvalidWorkingDirectory:`FunctionError.InvalidWorkingDirectory`,FunctionErrorPermissionDenied:`FunctionError.PermissionDenied`,FunctionErrorRuntimeInitError:`FunctionError.RuntimeInitError`,FunctionErrorTooManyExtensions:`FunctionError.TooManyExtensions`,Idle:`Idle`,ImageAccessDenied:`ImageAccessDenied`,ImageDeleted:`ImageDeleted`,InsufficientCapacity:`InsufficientCapacity`,InsufficientRolePermissions:`InsufficientRolePermissions`,InternalError:`InternalError`,InvalidConfiguration:`InvalidConfiguration`,InvalidImage:`InvalidImage`,InvalidRuntime:`InvalidRuntime`,InvalidSecurityGroup:`InvalidSecurityGroup`,InvalidStateKMSKey:`InvalidStateKMSKey`,InvalidSubnet:`InvalidSubnet`,InvalidZipFileException:`InvalidZipFileException`,KMSKeyAccessDenied:`KMSKeyAccessDenied`,KMSKeyNotFound:`KMSKeyNotFound`,Restoring:`Restoring`,SubnetOutOfIPAddresses:`SubnetOutOfIPAddresses`,VcpuLimitExceeded:`VcpuLimitExceeded`},e.StopDurableExecutionCommand=ht,e.SystemLogLevel={Debug:`DEBUG`,Info:`INFO`,Warn:`WARN`},e.TagResourceCommand=gt,e.TenantIsolationMode={PER_TENANT:`PER_TENANT`},e.ThrottleReason={CallerRateLimitExceeded:`CallerRateLimitExceeded`,ConcurrentInvocationLimitExceeded:`ConcurrentInvocationLimitExceeded`,ConcurrentSnapshotCreateLimitExceeded:`ConcurrentSnapshotCreateLimitExceeded`,FunctionInvocationRateLimitExceeded:`FunctionInvocationRateLimitExceeded`,ReservedFunctionConcurrentInvocationLimitExceeded:`ReservedFunctionConcurrentInvocationLimitExceeded`,ReservedFunctionInvocationRateLimitExceeded:`ReservedFunctionInvocationRateLimitExceeded`},e.TracingMode={Active:`Active`,PassThrough:`PassThrough`},e.UntagResourceCommand=_t,e.UpdateAliasCommand=vt,e.UpdateCapacityProviderCommand=yt,e.UpdateCodeSigningConfigCommand=bt,e.UpdateEventSourceMappingCommand=xt,e.UpdateFunctionCodeCommand=St,e.UpdateFunctionConfigurationCommand=Ct,e.UpdateFunctionEventInvokeConfigCommand=N,e.UpdateFunctionUrlConfigCommand=wt,e.UpdateRuntimeOn={Auto:`Auto`,FunctionUpdate:`FunctionUpdate`,Manual:`Manual`},e.paginateGetDurableExecutionHistory=Tt,e.paginateGetDurableExecutionState=Et,e.paginateListAliases=Dt,e.paginateListCapacityProviders=Ot,e.paginateListCodeSigningConfigs=kt,e.paginateListDurableExecutionsByFunction=At,e.paginateListEventSourceMappings=jt,e.paginateListFunctionEventInvokeConfigs=Mt,e.paginateListFunctionUrlConfigs=Ft,e.paginateListFunctionVersionsByCapacityProvider=It,e.paginateListFunctions=Pt,e.paginateListFunctionsByCodeSigningConfig=Nt,e.paginateListLayerVersions=Rt,e.paginateListLayers=Lt,e.paginateListProvisionedConcurrencyConfigs=zt,e.paginateListVersionsByFunction=Bt,e.waitForFunctionActive=Ht,e.waitForFunctionActiveV2=Gt,e.waitForFunctionExists=qt,e.waitForFunctionUpdated=Xt,e.waitForFunctionUpdatedV2=$t,e.waitForPublishedVersionActive=nn,e.waitUntilFunctionActive=Ut,e.waitUntilFunctionActiveV2=P,e.waitUntilFunctionExists=Jt,e.waitUntilFunctionUpdated=Zt,e.waitUntilFunctionUpdatedV2=en,e.waitUntilPublishedVersionActive=rn,Object.prototype.hasOwnProperty.call(v,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:v.__proto__}),Object.keys(v).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=v[t])}),Object.prototype.hasOwnProperty.call(b,`__proto__`)&&!Object.prototype.hasOwnProperty.call(e,`__proto__`)&&Object.defineProperty(e,`__proto__`,{enumerable:!0,value:b.__proto__}),Object.keys(b).forEach(function(t){t!==`default`&&!Object.prototype.hasOwnProperty.call(e,t)&&(e[t]=b[t])})}))(),IP=class extends Error{constructor(e,t){super(t),this.type=e}type},LP=e=>typeof e==`object`&&!!e&&`__error__`in e&&typeof e.__error__==`object`,RP=nd(()=>new FP.LambdaClient({})),zP=e=>typeof e==`object`&&!!e&&typeof e.errorMessage==`string`,BP=async({client:e=RP(),name:t,qualifier:n,type:r=`RequestResponse`,payload:i,reflectViewableErrors:a=!0})=>{let o=new FP.InvokeCommand({InvocationType:r,FunctionName:t,Payload:i?new TextEncoder().encode(ze(i)):void 0,Qualifier:n}),s=await e.send(o);if(!s.Payload)return;let c=new TextDecoder().decode(s.Payload);if(!c)return;let l=Le(c);if(LP(l)){let e=l.__error__;throw a?new IP(e.type,e.message):Error(e.message)}if(zP(l)){let e=Error(l.errorMessage);throw e.name=l.errorType,e}return l};new class{#e;async run(e,t){this.#e=e;try{return await t()}finally{this.#e=void 0}}get(){return this.#e}};var VP=class{registry;cache;constructor(){this.cache=new Map,this.registry=new FinalizationRegistry(e=>{this.cache.delete(e)})}set(e,t){let n={value:t},r=new WeakRef(n);return this.cache.set(e,r),this.registry.register(n,e,r),this}get(e,t){let n=this.cache.get(e);if(n){let e=n.deref();if(e!==void 0)return e.value}return t}has(e){return this.get(e)!==void 0}delete(e){let t=this.cache.get(e);return t?(this.cache.delete(e),this.registry.unregister(t),!0):!1}clear(){for(let e of this.keys())this.delete(e)}get size(){return this.cache.size}[Symbol.iterator](){return this.entries()}keys(){return this.cache.keys()}*values(){for(let e of this.cache.values()){let t=e.deref();t&&(yield t.value)}}*entries(){for(let[e,t]of this.cache.entries()){let n=t.deref();n&&(yield[e,n.value])}}};const HP=3600*24;HP*7,HP*365.2425;const UP=Symbol.for(`constructDateFrom`);function WP(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&UP in e?e[UP](t):e instanceof Date?new e.constructor(t):new Date(t)}function GP(e,t){return WP(t||e,e)}function KP(e,t,n){return WP(n?.in||e,+GP(e)+t)}function qP(e,t,n){return KP(e,t*1e3,n)}function JP(e){return+GP(e)>Date.now()}const YP=de([oe({authorized:ae(!0),allowed:ne(le()),context:se(ce(le(),fe())),ttl:se(Ve(),De(1))}),oe({authorized:ae(!1)})]),XP=new VP,ZP=async e=>{if(!process.env.AUTH)return{authorized:!1,reason:`No authorizer configured`};let t=e??``,n=XP.get(t);if(n){if(JP(n.ttl))return{authorized:!0,context:n.context,allowed:n.allowed};XP.delete(t)}let r;try{r=await BP({name:process.env.AUTH,payload:{token:e??void 0}})}catch(e){return console.error(e),{authorized:!1,reason:`Invoke auth handle error`}}let i=me(YP,r);if(!i.success)return{authorized:!1,reason:`Invalid auth handle response`};if(!i.output.authorized)return{authorized:!1,reason:`Invalid auth token`};let a=qP(new Date,Number(k(i.output.ttl))),o=i.output.context,s=i.output.allowed;return XP.set(t,{ttl:a,context:o,allowed:s}),{authorized:!0,context:o,allowed:s}};var QP=u(((e,t)=>{t.exports={acl:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},append:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},asking:{arity:1,flags:[`fast`],keyStart:0,keyStop:0,step:0},auth:{arity:-2,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},bgrewriteaof:{arity:1,flags:[`admin`,`noscript`,`no_async_loading`],keyStart:0,keyStop:0,step:0},bgsave:{arity:-1,flags:[`admin`,`noscript`,`no_async_loading`],keyStart:0,keyStop:0,step:0},bitcount:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},bitfield:{arity:-2,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},bitfield_ro:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},bitop:{arity:-4,flags:[`write`,`denyoom`],keyStart:2,keyStop:-1,step:1},bitpos:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},blmove:{arity:6,flags:[`write`,`denyoom`,`noscript`,`blocking`],keyStart:1,keyStop:2,step:1},blmpop:{arity:-5,flags:[`write`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},blpop:{arity:-3,flags:[`write`,`noscript`,`blocking`],keyStart:1,keyStop:-2,step:1},brpop:{arity:-3,flags:[`write`,`noscript`,`blocking`],keyStart:1,keyStop:-2,step:1},brpoplpush:{arity:4,flags:[`write`,`denyoom`,`noscript`,`blocking`],keyStart:1,keyStop:2,step:1},bzmpop:{arity:-5,flags:[`write`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},bzpopmax:{arity:-3,flags:[`write`,`noscript`,`blocking`,`fast`],keyStart:1,keyStop:-2,step:1},bzpopmin:{arity:-3,flags:[`write`,`noscript`,`blocking`,`fast`],keyStart:1,keyStop:-2,step:1},client:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},cluster:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},command:{arity:-1,flags:[`loading`,`stale`],keyStart:0,keyStop:0,step:0},config:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},copy:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},dbsize:{arity:1,flags:[`readonly`,`fast`],keyStart:0,keyStop:0,step:0},debug:{arity:-2,flags:[`admin`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},decr:{arity:2,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},decrby:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},del:{arity:-2,flags:[`write`],keyStart:1,keyStop:-1,step:1},discard:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:0,keyStop:0,step:0},dump:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},echo:{arity:2,flags:[`fast`],keyStart:0,keyStop:0,step:0},eval:{arity:-3,flags:[`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},eval_ro:{arity:-3,flags:[`readonly`,`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},evalsha:{arity:-3,flags:[`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},evalsha_ro:{arity:-3,flags:[`readonly`,`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},exec:{arity:1,flags:[`noscript`,`loading`,`stale`,`skip_slowlog`],keyStart:0,keyStop:0,step:0},exists:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:-1,step:1},expire:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},expireat:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},expiretime:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},failover:{arity:-1,flags:[`admin`,`noscript`,`stale`],keyStart:0,keyStop:0,step:0},fcall:{arity:-3,flags:[`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},fcall_ro:{arity:-3,flags:[`readonly`,`noscript`,`stale`,`skip_monitor`,`no_mandatory_keys`,`movablekeys`],keyStart:0,keyStop:0,step:0},flushall:{arity:-1,flags:[`write`],keyStart:0,keyStop:0,step:0},flushdb:{arity:-1,flags:[`write`],keyStart:0,keyStop:0,step:0},function:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},geoadd:{arity:-5,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},geodist:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geohash:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geopos:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},georadius:{arity:-6,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},georadius_ro:{arity:-6,flags:[`readonly`],keyStart:1,keyStop:1,step:1},georadiusbymember:{arity:-5,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},georadiusbymember_ro:{arity:-5,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geosearch:{arity:-7,flags:[`readonly`],keyStart:1,keyStop:1,step:1},geosearchstore:{arity:-8,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},get:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},getbit:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},getdel:{arity:2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},getex:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},getrange:{arity:4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},getset:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hdel:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hello:{arity:-1,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},hexists:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hexpire:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hexpireat:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hexpiretime:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hget:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hgetall:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hgetdel:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hgetex:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hincrby:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hincrbyfloat:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hkeys:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hlen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hmget:{arity:-3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hmset:{arity:-4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hpersist:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hpexpire:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hpexpireat:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},hpexpiretime:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hpttl:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hrandfield:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hscan:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},hset:{arity:-4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hsetex:{arity:-6,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hsetnx:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},hstrlen:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},httl:{arity:-5,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},hvals:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},incr:{arity:2,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},incrby:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},incrbyfloat:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},info:{arity:-1,flags:[`loading`,`stale`],keyStart:0,keyStop:0,step:0},keys:{arity:2,flags:[`readonly`],keyStart:0,keyStop:0,step:0},lastsave:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},latency:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},lcs:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:2,step:1},lindex:{arity:3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},linsert:{arity:5,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},llen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},lmove:{arity:5,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},lmpop:{arity:-4,flags:[`write`,`movablekeys`],keyStart:0,keyStop:0,step:0},lolwut:{arity:-1,flags:[`readonly`,`fast`],keyStart:0,keyStop:0,step:0},lpop:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},lpos:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},lpush:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},lpushx:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},lrange:{arity:4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},lrem:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},lset:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},ltrim:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},memory:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},mget:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:-1,step:1},migrate:{arity:-6,flags:[`write`,`movablekeys`],keyStart:3,keyStop:3,step:1},module:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},monitor:{arity:1,flags:[`admin`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},move:{arity:3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},mset:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:2},msetnx:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:2},multi:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:0,keyStop:0,step:0},object:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},persist:{arity:2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},pexpire:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},pexpireat:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},pexpiretime:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},pfadd:{arity:-2,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},pfcount:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},pfdebug:{arity:3,flags:[`write`,`denyoom`,`admin`],keyStart:2,keyStop:2,step:1},pfmerge:{arity:-2,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},pfselftest:{arity:1,flags:[`admin`],keyStart:0,keyStop:0,step:0},ping:{arity:-1,flags:[`fast`],keyStart:0,keyStop:0,step:0},psetex:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},psubscribe:{arity:-2,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},psync:{arity:-3,flags:[`admin`,`noscript`,`no_async_loading`,`no_multi`],keyStart:0,keyStop:0,step:0},pttl:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},publish:{arity:3,flags:[`pubsub`,`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},pubsub:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},punsubscribe:{arity:-1,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},quit:{arity:-1,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},randomkey:{arity:1,flags:[`readonly`],keyStart:0,keyStop:0,step:0},readonly:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},readwrite:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},rename:{arity:3,flags:[`write`],keyStart:1,keyStop:2,step:1},renamenx:{arity:3,flags:[`write`,`fast`],keyStart:1,keyStop:2,step:1},replconf:{arity:-1,flags:[`admin`,`noscript`,`loading`,`stale`,`allow_busy`],keyStart:0,keyStop:0,step:0},replicaof:{arity:3,flags:[`admin`,`noscript`,`stale`,`no_async_loading`],keyStart:0,keyStop:0,step:0},reset:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`no_auth`,`allow_busy`],keyStart:0,keyStop:0,step:0},restore:{arity:-4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},"restore-asking":{arity:-4,flags:[`write`,`denyoom`,`asking`],keyStart:1,keyStop:1,step:1},role:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},rpop:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},rpoplpush:{arity:3,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},rpush:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},rpushx:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},sadd:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},save:{arity:1,flags:[`admin`,`noscript`,`no_async_loading`,`no_multi`],keyStart:0,keyStop:0,step:0},scan:{arity:-2,flags:[`readonly`],keyStart:0,keyStop:0,step:0},scard:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},script:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},sdiff:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},sdiffstore:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},select:{arity:2,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},set:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},setbit:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},setex:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},setnx:{arity:3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},setrange:{arity:4,flags:[`write`,`denyoom`],keyStart:1,keyStop:1,step:1},shutdown:{arity:-1,flags:[`admin`,`noscript`,`loading`,`stale`,`no_multi`,`allow_busy`],keyStart:0,keyStop:0,step:0},sinter:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},sintercard:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},sinterstore:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},sismember:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},slaveof:{arity:3,flags:[`admin`,`noscript`,`stale`,`no_async_loading`],keyStart:0,keyStop:0,step:0},slowlog:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},smembers:{arity:2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},smismember:{arity:-3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},smove:{arity:4,flags:[`write`,`fast`],keyStart:1,keyStop:2,step:1},sort:{arity:-2,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},sort_ro:{arity:-2,flags:[`readonly`,`movablekeys`],keyStart:1,keyStop:1,step:1},spop:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},spublish:{arity:3,flags:[`pubsub`,`loading`,`stale`,`fast`],keyStart:1,keyStop:1,step:1},srandmember:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},srem:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},sscan:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},ssubscribe:{arity:-2,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:1,keyStop:-1,step:1},strlen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},subscribe:{arity:-2,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},substr:{arity:4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},sunion:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:-1,step:1},sunionstore:{arity:-3,flags:[`write`,`denyoom`],keyStart:1,keyStop:-1,step:1},sunsubscribe:{arity:-1,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:1,keyStop:-1,step:1},swapdb:{arity:3,flags:[`write`,`fast`],keyStart:0,keyStop:0,step:0},sync:{arity:1,flags:[`admin`,`noscript`,`no_async_loading`,`no_multi`],keyStart:0,keyStop:0,step:0},time:{arity:1,flags:[`loading`,`stale`,`fast`],keyStart:0,keyStop:0,step:0},touch:{arity:-2,flags:[`readonly`,`fast`],keyStart:1,keyStop:-1,step:1},ttl:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},type:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},unlink:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:-1,step:1},unsubscribe:{arity:-1,flags:[`pubsub`,`noscript`,`loading`,`stale`],keyStart:0,keyStop:0,step:0},unwatch:{arity:1,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:0,keyStop:0,step:0},wait:{arity:3,flags:[`noscript`],keyStart:0,keyStop:0,step:0},watch:{arity:-2,flags:[`noscript`,`loading`,`stale`,`fast`,`allow_busy`],keyStart:1,keyStop:-1,step:1},xack:{arity:-4,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xadd:{arity:-5,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},xautoclaim:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xclaim:{arity:-6,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xdel:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xdelex:{arity:-5,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},xgroup:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xinfo:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xlen:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},xpending:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},xrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},xread:{arity:-4,flags:[`readonly`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},xreadgroup:{arity:-7,flags:[`write`,`blocking`,`movablekeys`],keyStart:0,keyStop:0,step:0},xrevrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},xsetid:{arity:-3,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},xtrim:{arity:-4,flags:[`write`],keyStart:1,keyStop:1,step:1},zadd:{arity:-4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},zcard:{arity:2,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zcount:{arity:4,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zdiff:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zdiffstore:{arity:-4,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},zincrby:{arity:4,flags:[`write`,`denyoom`,`fast`],keyStart:1,keyStop:1,step:1},zinter:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zintercard:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zinterstore:{arity:-4,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1},zlexcount:{arity:4,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zmpop:{arity:-4,flags:[`write`,`movablekeys`],keyStart:0,keyStop:0,step:0},zmscore:{arity:-3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zpopmax:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},zpopmin:{arity:-2,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},zrandmember:{arity:-2,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrangebylex:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrangebyscore:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrangestore:{arity:-5,flags:[`write`,`denyoom`],keyStart:1,keyStop:2,step:1},zrank:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zrem:{arity:-3,flags:[`write`,`fast`],keyStart:1,keyStop:1,step:1},zremrangebylex:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},zremrangebyrank:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},zremrangebyscore:{arity:4,flags:[`write`],keyStart:1,keyStop:1,step:1},zrevrange:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrevrangebylex:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrevrangebyscore:{arity:-4,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zrevrank:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zscan:{arity:-3,flags:[`readonly`],keyStart:1,keyStop:1,step:1},zscore:{arity:3,flags:[`readonly`,`fast`],keyStart:1,keyStop:1,step:1},zunion:{arity:-3,flags:[`readonly`,`movablekeys`],keyStart:0,keyStop:0,step:0},zunionstore:{arity:-4,flags:[`write`,`denyoom`,`movablekeys`],keyStart:1,keyStop:1,step:1}}})),$P=u((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.getKeyIndexes=e.hasFlag=e.exists=e.list=void 0;let n=t(QP());e.list=Object.keys(n.default);let r={};e.list.forEach(e=>{r[e]=n.default[e].flags.reduce(function(e,t){return e[t]=!0,e},{})});function i(e,t){return e=t?.caseInsensitive?String(e).toLowerCase():e,!!n.default[e]}e.exists=i;function a(e,t,n){if(e=n?.nameCaseInsensitive?String(e).toLowerCase():e,!r[e])throw Error(`Unknown command `+e);return!!r[e][t]}e.hasFlag=a;function o(e,t,r){e=r?.nameCaseInsensitive?String(e).toLowerCase():e;let i=n.default[e];if(!i)throw Error(`Unknown command `+e);if(!Array.isArray(t))throw Error(`Expect args to be an array`);let a=[],o=!!(r&&r.parseExternalKey),c=(e,t)=>{let n=[],r=Number(e[t]);for(let e=0;e<r;e++)n.push(e+t+1);return n},l=(e,t,n)=>{for(let r=t;r<e.length-1;r+=1)if(String(e[r]).toLowerCase()===n.toLowerCase())return r+1;return null};switch(e){case`zunionstore`:case`zinterstore`:case`zdiffstore`:a.push(0,...c(t,1));break;case`eval`:case`evalsha`:case`eval_ro`:case`evalsha_ro`:case`fcall`:case`fcall_ro`:case`blmpop`:case`bzmpop`:a.push(...c(t,1));break;case`sintercard`:case`lmpop`:case`zunion`:case`zinter`:case`zmpop`:case`zintercard`:case`zdiff`:a.push(...c(t,0));break;case`georadius`:{a.push(0);let e=l(t,5,`STORE`);e&&a.push(e);let n=l(t,5,`STOREDIST`);n&&a.push(n);break}case`georadiusbymember`:{a.push(0);let e=l(t,4,`STORE`);e&&a.push(e);let n=l(t,4,`STOREDIST`);n&&a.push(n);break}case`sort`:case`sort_ro`:a.push(0);for(let e=1;e<t.length-1;e++){let n=t[e];if(typeof n!=`string`)continue;let r=n.toUpperCase();r===`GET`?(e+=1,n=t[e],n!==`#`&&(o?a.push([e,s(n)]):a.push(e))):r===`BY`?(e+=1,o?a.push([e,s(t[e])]):a.push(e)):r===`STORE`&&(e+=1,a.push(e))}break;case`migrate`:if(t[2]===``)for(let e=5;e<t.length-1;e++){let n=t[e];if(typeof n==`string`&&n.toUpperCase()===`KEYS`){for(let n=e+1;n<t.length;n++)a.push(n);break}}else a.push(2);break;case`xreadgroup`:case`xread`:for(let n=e===`xread`?0:3;n<t.length-1;n++)if(String(t[n]).toUpperCase()===`STREAMS`){for(let e=n+1;e<=n+(t.length-1-n)/2;e++)a.push(e);break}break;default:if(i.step>0){let e=i.keyStart-1,n=i.keyStop>0?i.keyStop:t.length+i.keyStop+1;for(let t=e;t<n;t+=i.step)a.push(t)}break}return a}e.getKeyIndexes=o;function s(e){typeof e!=`string`&&(e=String(e));let t=e.indexOf(`->`);return t===-1?e.length:t}})),eF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.tryCatch=e.errorObj=void 0,e.errorObj={e:{}};let t;function n(n,r){try{let e=t;return t=null,e.apply(this,arguments)}catch(t){return e.errorObj.e=t,e.errorObj}}function r(e){return t=e,n}e.tryCatch=r})),tF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=eF();function n(e){setTimeout(function(){throw e},0)}function r(e,r,i){return typeof r==`function`&&e.then(e=>{let a;a=i!==void 0&&Object(i).spread&&Array.isArray(e)?t.tryCatch(r).apply(void 0,[null].concat(e)):e===void 0?t.tryCatch(r)(null):t.tryCatch(r)(null,e),a===t.errorObj&&n(a.e)},e=>{if(!e){let t=Error(e+``);Object.assign(t,{cause:e}),e=t}let i=t.tryCatch(r)(e);i===t.errorObj&&n(i.e)}),e}e.default=r})),nF=u(((e,t)=>{let n=h(`assert`),r=h(`util`);function i(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}r.inherits(i,Error),Object.defineProperty(i.prototype,`name`,{value:`RedisError`,configurable:!0,writable:!0});function a(e,t,r){n(t),n.strictEqual(typeof r,`number`),Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0});let i=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=i,this.offset=r,this.buffer=t}r.inherits(a,i),Object.defineProperty(a.prototype,`name`,{value:`ParserError`,configurable:!0,writable:!0});function o(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0});let t=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=t}r.inherits(o,i),Object.defineProperty(o.prototype,`name`,{value:`ReplyError`,configurable:!0,writable:!0});function s(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}r.inherits(s,i),Object.defineProperty(s.prototype,`name`,{value:`AbortError`,configurable:!0,writable:!0});function c(e){Object.defineProperty(this,`message`,{value:e||``,configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}r.inherits(c,s),Object.defineProperty(c.prototype,`name`,{value:`InterruptError`,configurable:!0,writable:!0}),t.exports={RedisError:i,ParserError:a,ReplyError:o,AbortError:s,InterruptError:c}})),rF=u(((e,t)=>{let n=h(`assert`);var r=class extends Error{get name(){return this.constructor.name}},i=class extends r{constructor(e,t,r){n(t),n.strictEqual(typeof r,`number`);let i=Error.stackTraceLimit;Error.stackTraceLimit=2,super(e),Error.stackTraceLimit=i,this.offset=r,this.buffer=t}get name(){return this.constructor.name}},a=class extends r{constructor(e){let t=Error.stackTraceLimit;Error.stackTraceLimit=2,super(e),Error.stackTraceLimit=t}get name(){return this.constructor.name}},o=class extends r{get name(){return this.constructor.name}};t.exports={RedisError:r,ParserError:i,ReplyError:a,AbortError:o,InterruptError:class extends o{get name(){return this.constructor.name}}}})),iF=u(((e,t)=>{t.exports=process.version.charCodeAt(1)<55&&process.version.charCodeAt(2)===46?nF():rF()})),aF=u(((e,t)=>{var n=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],r=function(e){for(var t,n=0,r=0,i=[],a=e.length;n<a;n++)t=e.charCodeAt(n),t<128?i[r++]=t:t<2048?(i[r++]=t>>6|192,i[r++]=t&63|128):(t&64512)==55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)==56320?(t=65536+((t&1023)<<10)+(e.charCodeAt(++n)&1023),i[r++]=t>>18|240,i[r++]=t>>12&63|128,i[r++]=t>>6&63|128,i[r++]=t&63|128):(i[r++]=t>>12|224,i[r++]=t>>6&63|128,i[r++]=t&63|128);return i},i=t.exports=function(e){for(var t,i=0,a=-1,o=0,s=0,c=typeof e==`string`?r(e):e,l=c.length;i<l;){if(t=c[i++],a===-1)t===123&&(a=i);else if(t!==125)s=n[(t^s>>8)&255]^s<<8;else if(i-1!==a)return s&16383;o=n[(t^o>>8)&255]^o<<8}return o&16383};t.exports.generateMulti=function(e){for(var t=1,n=e.length,r=i(e[0]);t<n;)if(i(e[t++])!==r)return-1;return r}})),oF=u(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=/^(?:0|[1-9]\d*)$/;function s(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function c(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var l=Object.prototype,u=l.hasOwnProperty,d=l.toString,f=l.propertyIsEnumerable,p=Math.max;function m(e,t){var n=T(e)||te(e)?c(e.length,String):[],r=n.length,i=!!r;for(var a in e)(t||u.call(e,a))&&!(i&&(a==`length`||x(a,r)))&&n.push(a);return n}function h(e,t,n,r){return e===void 0||ee(e,l[n])&&!u.call(r,n)?t:e}function g(e,t,n){var r=e[t];(!(u.call(e,t)&&ee(r,n))||n===void 0&&!(t in e))&&(e[t]=n)}function _(e){if(!ae(e))return w(e);var t=C(e),n=[];for(var r in e)r==`constructor`&&(t||!u.call(e,r))||n.push(r);return n}function v(e,t){return t=p(t===void 0?e.length-1:t,0),function(){for(var n=arguments,r=-1,i=p(n.length-t,0),a=Array(i);++r<i;)a[r]=n[t+r];r=-1;for(var o=Array(t+1);++r<t;)o[r]=n[r];return o[t]=a,s(e,this,o)}}function y(e,t,n,r){n||={};for(var i=-1,a=t.length;++i<a;){var o=t[i],s=r?r(n[o],e[o],o,n,e):void 0;g(n,o,s===void 0?e[o]:s)}return n}function b(e){return v(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&S(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}function x(e,t){return t??=n,!!t&&(typeof e==`number`||o.test(e))&&e>-1&&e%1==0&&e<t}function S(e,t,n){if(!ae(n))return!1;var r=typeof t;return(r==`number`?E(n)&&x(t,n.length):r==`string`&&t in n)?ee(n[t],e):!1}function C(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||l)}function w(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}function ee(e,t){return e===t||e!==e&&t!==t}function te(e){return ne(e)&&u.call(e,`callee`)&&(!f.call(e,`callee`)||d.call(e)==r)}var T=Array.isArray;function E(e){return e!=null&&ie(e.length)&&!re(e)}function ne(e){return oe(e)&&E(e)}function re(e){var t=ae(e)?d.call(e):``;return t==i||t==a}function ie(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function ae(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function oe(e){return!!e&&typeof e==`object`}var se=b(function(e,t,n,r){y(t,le(t),e,r)}),ce=v(function(e){return e.push(void 0,h),s(se,void 0,e)});function le(e){return E(e)?m(e,!0):_(e)}t.exports=ce})),sF=u(((e,t)=>{var n=9007199254740991,r=`[object Arguments]`,i=`[object Function]`,a=`[object GeneratorFunction]`,o=Object.prototype,s=o.hasOwnProperty,c=o.toString,l=o.propertyIsEnumerable;function u(e){return f(e)&&s.call(e,`callee`)&&(!l.call(e,`callee`)||c.call(e)==r)}function d(e){return e!=null&&m(e.length)&&!p(e)}function f(e){return g(e)&&d(e)}function p(e){var t=h(e)?c.call(e):``;return t==i||t==a}function m(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}function h(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function g(e){return!!e&&typeof e==`object`}t.exports=u})),cF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isArguments=e.defaults=e.noop=void 0,e.defaults=oF(),e.isArguments=sF();function t(){}e.noop=t})),lF=u(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*7,s=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return c(e);if(n===`number`&&isFinite(e))return t.long?u(e):l(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function c(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var c=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return c*s;case`weeks`:case`week`:case`w`:return c*o;case`days`:case`day`:case`d`:return c*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return c*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return c*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return c*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return c;default:return}}}}function l(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+`d`:t>=i?Math.round(e/i)+`h`:t>=r?Math.round(e/r)+`m`:t>=n?Math.round(e/n)+`s`:e+`ms`}function u(e){var t=Math.abs(e);return t>=a?d(e,t,a,`day`):t>=i?d(e,t,i,`hour`):t>=r?d(e,t,r,`minute`):t>=n?d(e,t,n,`second`):e+` ms`}function d(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+` `+r+(i?`s`:``)}})),uF=u(((e,t)=>{function n(e){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=i,n.enabled=s,n.humanize=lF(),n.destroy=l,Object.keys(e).forEach(t=>{n[t]=e[t]}),n.names=[],n.skips=[],n.formatters={};function t(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){let t,i=null,a,o;function s(...e){if(!s.enabled)return;let r=s,i=Number(new Date);r.diff=i-(t||i),r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),typeof e[0]!=`string`&&e.unshift(`%O`);let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if(t===`%%`)return`%`;a++;let o=n.formatters[i];if(typeof o==`function`){let n=e[a];t=o.call(r,n),e.splice(a,1),a--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=r,s.destroy=n.destroy,Object.defineProperty(s,`enabled`,{enumerable:!0,configurable:!1,get:()=>i===null?(a!==n.namespaces&&(a=n.namespaces,o=n.enabled(e)),o):i,set:e=>{i=e}}),typeof n.init==`function`&&n.init(s),s}function r(e,t){let r=n(this.namespace+(t===void 0?`:`:t)+e);return r.log=this.log,r}function i(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];let t=(typeof e==`string`?e:``).trim().replace(/\s+/g,`,`).split(`,`).filter(Boolean);for(let e of t)e[0]===`-`?n.skips.push(e.slice(1)):n.names.push(e)}function a(e,t){let n=0,r=0,i=-1,a=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||t[r]===`*`))t[r]===`*`?(i=r,a=n,r++):(n++,r++);else if(i!==-1)r=i+1,a++,n=a;else return!1;for(;r<t.length&&t[r]===`*`;)r++;return r===t.length}function o(){let e=[...n.names,...n.skips.map(e=>`-`+e)].join(`,`);return n.enable(``),e}function s(e){for(let t of n.skips)if(a(e,t))return!1;for(let t of n.names)if(a(e,t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}t.exports=n})),dF=u(((e,t)=>{e.formatArgs=r,e.save=i,e.load=a,e.useColors=n,e.storage=o(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=`#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33`.split(`.`);function n(){if(typeof window<`u`&&window.process&&(window.process.type===`renderer`||window.process.__nwjs))return!0;if(typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(e){if(e[0]=(this.useColors?`%c`:``)+this.namespace+(this.useColors?` %c`:` `)+e[0]+(this.useColors?`%c `:` `)+`+`+t.exports.humanize(this.diff),!this.useColors)return;let n=`color: `+this.color;e.splice(1,0,n,`color: inherit`);let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{e!==`%%`&&(r++,e===`%c`&&(i=r))}),e.splice(i,0,n)}e.log=console.debug||console.log||(()=>{});function i(t){try{t?e.storage.setItem(`debug`,t):e.storage.removeItem(`debug`)}catch{}}function a(){let t;try{t=e.storage.getItem(`debug`)||e.storage.getItem(`DEBUG`)}catch{}return!t&&typeof process<`u`&&`env`in process&&(t=process.env.DEBUG),t}function o(){try{return localStorage}catch{}}t.exports=uF()(e);let{formatters:s}=t.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}}})),fF=u(((e,t)=>{let n=h(`tty`),r=h(`util`);e.init=u,e.log=s,e.formatArgs=a,e.save=c,e.load=l,e.useColors=i,e.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{let t=id();t&&(t.stderr||t).level>=2&&(e.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}e.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase()),r=process.env[t];return r=/^(yes|on|true|enabled)$/i.test(r)?!0:/^(no|off|false|disabled)$/i.test(r)?!1:r===`null`?null:Number(r),e[n]=r,e},{});function i(){return`colors`in e.inspectOpts?!!e.inspectOpts.colors:n.isatty(process.stderr.fd)}function a(e){let{namespace:n,useColors:r}=this;if(r){let r=this.color,i=`\x1B[3`+(r<8?r:`8;5;`+r),a=` ${i};1m${n} \u001B[0m`;e[0]=a+e[0].split(`
|
|
79
79
|
`).join(`
|
|
80
80
|
`+a),e.push(i+`m+`+t.exports.humanize(this.diff)+`\x1B[0m`)}else e[0]=o()+n+` `+e[0]}function o(){return e.inspectOpts.hideDate?``:new Date().toISOString()+` `}function s(...t){return process.stderr.write(r.formatWithOptions(e.inspectOpts,...t)+`
|
|
81
|
-
`)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=
|
|
82
|
-
`).map(e=>e.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),
|
|
81
|
+
`)}function c(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(t){t.inspectOpts={};let n=Object.keys(e.inspectOpts);for(let r=0;r<n.length;r++)t.inspectOpts[n[r]]=e.inspectOpts[n[r]]}t.exports=uF()(e);let{formatters:d}=t.exports;d.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split(`
|
|
82
|
+
`).map(e=>e.trim()).join(` `)},d.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}})),pF=u(((e,t)=>{typeof process>`u`||process.type===`renderer`||process.browser===!0||process.__nwjs?t.exports=dF():t.exports=fF()})),mF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.genRedactedString=e.getStringValue=e.MAX_ARGUMENT_LENGTH=void 0;let t=pF();e.MAX_ARGUMENT_LENGTH=200;function n(e){if(e!==null)switch(typeof e){case`boolean`:return;case`number`:return;case`object`:if(Buffer.isBuffer(e))return e.toString(`hex`);if(Array.isArray(e))return e.join(`,`);try{return JSON.stringify(e)}catch{return}case`string`:return e}}e.getStringValue=n;function r(e,t){let{length:n}=e;return n<=t?e:e.slice(0,t)+` ... <REDACTED full-length="`+n+`">`}e.genRedactedString=r;function i(e){let i=(0,t.default)(`ioredis:${e}`);function a(...e){if(i.enabled){for(let t=1;t<e.length;t++){let i=n(e[t]);typeof i==`string`&&i.length>200&&(e[t]=r(i,200))}return i.apply(null,e)}}return Object.defineProperties(a,{namespace:{get(){return i.namespace}},enabled:{get(){return i.enabled}},destroy:{get(){return i.destroy}},log:{get(){return i.log},set(e){i.log=e}}}),a}e.default=i})),hF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=`-----BEGIN CERTIFICATE-----
|
|
83
83
|
MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV
|
|
84
84
|
BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1
|
|
85
85
|
dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV
|
|
@@ -217,10 +217,10 @@ jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
|
|
|
217
217
|
mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
|
|
218
218
|
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
|
|
219
219
|
WD9f
|
|
220
|
-
-----END CERTIFICATE-----`;e.default={RedisCloudFixed:{ca:t},RedisCloudFlexible:{ca:t}}})),
|
|
220
|
+
-----END CERTIFICATE-----`;e.default={RedisCloudFixed:{ca:t},RedisCloudFlexible:{ca:t}}})),gF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.noop=e.defaults=e.Debug=e.getPackageMeta=e.zipMap=e.CONNECTION_CLOSED_ERROR_MSG=e.shuffle=e.sample=e.resolveTLSProfile=e.parseURL=e.optimizeErrorStack=e.toArg=e.convertMapToArray=e.convertObjectToArray=e.timeout=e.packObject=e.isInt=e.wrapMultiResult=e.convertBufferToString=void 0;let t=h(`fs`),n=h(`path`),r=h(`url`),i=cF();Object.defineProperty(e,`defaults`,{enumerable:!0,get:function(){return i.defaults}}),Object.defineProperty(e,`noop`,{enumerable:!0,get:function(){return i.noop}}),e.Debug=mF().default;let a=hF();function o(e,t){if(e instanceof Buffer)return e.toString(t);if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=e[i]instanceof Buffer&&t===`utf8`?e[i].toString():o(e[i],t);return r}return e}e.convertBufferToString=o;function s(e){if(!e)return null;let t=[],n=e.length;for(let r=0;r<n;++r){let n=e[r];n instanceof Error?t.push([n]):t.push([null,n])}return t}e.wrapMultiResult=s;function c(e){let t=parseFloat(e);return!isNaN(e)&&(t|0)===t}e.isInt=c;function l(e){let t={},n=e.length;for(let r=1;r<n;r+=2)t[e[r-1]]=e[r];return t}e.packObject=l;function u(e,t){let n=null,r=function(){n&&(clearTimeout(n),n=null,e.apply(this,arguments))};return n=setTimeout(r,t,Error(`timeout`)),r}e.timeout=u;function d(e){let t=[],n=Object.keys(e);for(let r=0,i=n.length;r<i;r++)t.push(n[r],e[n[r]]);return t}e.convertObjectToArray=d;function f(e){let t=[],n=0;return e.forEach(function(e,r){t[n]=r,t[n+1]=e,n+=2}),t}e.convertMapToArray=f;function p(e){return e==null?``:String(e)}e.toArg=p;function m(e,t,n){let r=t.split(`
|
|
221
221
|
`),i=``,a;for(a=1;a<r.length&&r[a].indexOf(n)!==-1;++a);for(let e=a;e<r.length;++e)i+=`
|
|
222
222
|
`+r[e];if(e.stack){let t=e.stack.indexOf(`
|
|
223
|
-
`);e.stack=e.stack.slice(0,t)+i}return e}e.optimizeErrorStack=m;function g(e){if(c(e))return{port:e};let t=(0,r.parse)(e,!0,!0);!t.slashes&&e[0]!==`/`&&(e=`//`+e,t=(0,r.parse)(e,!0,!0));let n=t.query||{},a={};if(t.auth){let e=t.auth.indexOf(`:`);a.username=e===-1?t.auth:t.auth.slice(0,e),a.password=e===-1?``:t.auth.slice(e+1)}if(t.pathname&&(t.protocol===`redis:`||t.protocol===`rediss:`?t.pathname.length>1&&(a.db=t.pathname.slice(1)):a.path=t.pathname),t.host&&(a.host=t.hostname),t.port&&(a.port=t.port),typeof n.family==`string`){let e=Number.parseInt(n.family,10);Number.isNaN(e)||(a.family=e)}return(0,i.defaults)(a,n),a}e.parseURL=g;function _(e){let t=e?.tls;typeof t==`string`&&(t={profile:t});let n=a.default[t?.profile];return n&&(t=Object.assign({},n,t),delete t.profile,e=Object.assign({},e,{tls:t})),e}e.resolveTLSProfile=_;function v(e,t=0){let n=e.length;return t>=n?null:e[t+Math.floor(Math.random()*(n-t))]}e.sample=v;function y(e){let t=e.length;for(;t>0;){let n=Math.floor(Math.random()*t);t--,[e[t],e[n]]=[e[n],e[t]]}return e}e.shuffle=y,e.CONNECTION_CLOSED_ERROR_MSG=`Connection is closed.`;function b(e,t){let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n}e.zipMap=b;let x=null;async function S(){if(x)return x;try{let e=(0,n.resolve)(__dirname,`..`,`..`,`package.json`),r=await t.promises.readFile(e,`utf8`);return x={version:JSON.parse(r).version},x}catch{return x={version:`error-fetching-version`},x}}e.getPackageMeta=S})),
|
|
223
|
+
`);e.stack=e.stack.slice(0,t)+i}return e}e.optimizeErrorStack=m;function g(e){if(c(e))return{port:e};let t=(0,r.parse)(e,!0,!0);!t.slashes&&e[0]!==`/`&&(e=`//`+e,t=(0,r.parse)(e,!0,!0));let n=t.query||{},a={};if(t.auth){let e=t.auth.indexOf(`:`);a.username=e===-1?t.auth:t.auth.slice(0,e),a.password=e===-1?``:t.auth.slice(e+1)}if(t.pathname&&(t.protocol===`redis:`||t.protocol===`rediss:`?t.pathname.length>1&&(a.db=t.pathname.slice(1)):a.path=t.pathname),t.host&&(a.host=t.hostname),t.port&&(a.port=t.port),typeof n.family==`string`){let e=Number.parseInt(n.family,10);Number.isNaN(e)||(a.family=e)}return(0,i.defaults)(a,n),a}e.parseURL=g;function _(e){let t=e?.tls;typeof t==`string`&&(t={profile:t});let n=a.default[t?.profile];return n&&(t=Object.assign({},n,t),delete t.profile,e=Object.assign({},e,{tls:t})),e}e.resolveTLSProfile=_;function v(e,t=0){let n=e.length;return t>=n?null:e[t+Math.floor(Math.random()*(n-t))]}e.sample=v;function y(e){let t=e.length;for(;t>0;){let n=Math.floor(Math.random()*t);t--,[e[t],e[n]]=[e[n],e[t]]}return e}e.shuffle=y,e.CONNECTION_CLOSED_ERROR_MSG=`Connection is closed.`;function b(e,t){let n=new Map;return e.forEach((e,r)=>{n.set(e,t[r])}),n}e.zipMap=b;let x=null;async function S(){if(x)return x;try{let e=(0,n.resolve)(__dirname,`..`,`..`,`package.json`),r=await t.promises.readFile(e,`utf8`);return x={version:JSON.parse(r).version},x}catch{return x={version:`error-fetching-version`},x}}e.getPackageMeta=S})),_F=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.parseBlockOption=e.parseSecondsArgument=void 0;let t=e=>{if(typeof e==`number`)return e;if(Buffer.isBuffer(e))return t(e.toString());if(typeof e==`string`){let t=Number(e);return Number.isFinite(t)?t:void 0}},n=e=>{if(typeof e==`string`)return e;if(Buffer.isBuffer(e))return e.toString()};e.parseSecondsArgument=e=>{let n=t(e);if(n!==void 0)return n<=0?0:n*1e3},e.parseBlockOption=e=>{for(let r=0;r<e.length;r++){let i=n(e[r]);if(i&&i.toLowerCase()===`block`){let n=t(e[r+1]);return n===void 0?void 0:n<=0?0:n}}return null}})),vF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$P(),n=aF(),r=tF(),i=gF(),a=_F();var o=class e{constructor(e,t=[],n={},r){if(this.name=e,this.inTransaction=!1,this.isResolved=!1,this.transformed=!1,this.replyEncoding=n.replyEncoding,this.errorStack=n.errorStack,this.args=t.flat(),this.callback=r,this.initPromise(),n.keyPrefix){let e=n.keyPrefix instanceof Buffer,t=e?n.keyPrefix:null;this._iterateKeys(r=>r instanceof Buffer?(t===null&&(t=Buffer.from(n.keyPrefix)),Buffer.concat([t,r])):e?Buffer.concat([n.keyPrefix,Buffer.from(String(r))]):n.keyPrefix+r)}n.readOnly&&(this.isReadOnly=!0)}static checkFlag(e,t){return t=t.toLowerCase(),!!this.getFlagMap()[e][t]}static setArgumentTransformer(e,t){this._transformer.argument[e]=t}static setReplyTransformer(e,t){this._transformer.reply[e]=t}static getFlagMap(){return this.flagMap||=Object.keys(e.FLAGS).reduce((t,n)=>(t[n]={},e.FLAGS[n].forEach(e=>{t[n][e]=!0}),t),{}),this.flagMap}getSlot(){if(this.slot===void 0){let e=this.getKeys()[0];this.slot=e==null?null:n(e)}return this.slot}getKeys(){return this._iterateKeys()}toWritable(e){let t,n=`*`+(this.args.length+1)+`\r
|
|
224
224
|
$`+Buffer.byteLength(this.name)+`\r
|
|
225
225
|
`+this.name+`\r
|
|
226
226
|
`;if(this.bufferMode){let e=new l;e.push(n);for(let t=0;t<this.args.length;++t){let n=this.args[t];n instanceof Buffer?n.length===0?e.push(`$0\r
|
|
@@ -231,6 +231,6 @@ $`+Buffer.byteLength(this.name)+`\r
|
|
|
231
231
|
`+n+`\r
|
|
232
232
|
`)}t=e.toBuffer()}else{t=n;for(let e=0;e<this.args.length;++e){let n=this.args[e];t+=`$`+Buffer.byteLength(n)+`\r
|
|
233
233
|
`+n+`\r
|
|
234
|
-
`}}return t}stringifyArguments(){for(let e=0;e<this.args.length;++e){let t=this.args[e];typeof t==`string`||(t instanceof Buffer?this.bufferMode=!0:this.args[e]=(0,i.toArg)(t))}}transformReply(t){this.replyEncoding&&(t=(0,i.convertBufferToString)(t,this.replyEncoding));let n=e._transformer.reply[this.name];return n&&(t=n(t)),t}setTimeout(e){this._commandTimeoutTimer||=setTimeout(()=>{this.isResolved||this.reject(Error(`Command timed out`))},e)}setBlockingTimeout(e){if(e<=0)return;this._blockingTimeoutTimer&&=(clearTimeout(this._blockingTimeoutTimer),void 0);let t=Date.now();this._blockingDeadline===void 0&&(this._blockingDeadline=t+e);let n=this._blockingDeadline-t;if(n<=0){this.resolve(null);return}this._blockingTimeoutTimer=setTimeout(()=>{if(this.isResolved){this._blockingTimeoutTimer=void 0;return}this._blockingTimeoutTimer=void 0,this.resolve(null)},n)}extractBlockingTimeout(){let t=this.args;if(!t||t.length===0)return;let n=this.name.toLowerCase();if(e.checkFlag(`LAST_ARG_TIMEOUT_COMMANDS`,n))return(0,a.parseSecondsArgument)(t[t.length-1]);if(e.checkFlag(`FIRST_ARG_TIMEOUT_COMMANDS`,n))return(0,a.parseSecondsArgument)(t[0]);if(e.checkFlag(`BLOCK_OPTION_COMMANDS`,n))return(0,a.parseBlockOption)(t)}_clearTimers(){let e=this._commandTimeoutTimer;e&&(clearTimeout(e),delete this._commandTimeoutTimer);let t=this._blockingTimeoutTimer;t&&(clearTimeout(t),delete this._blockingTimeoutTimer)}initPromise(){let t=new Promise((t,n)=>{if(!this.transformed){this.transformed=!0;let t=e._transformer.argument[this.name];t&&(this.args=t(this.args)),this.stringifyArguments()}this.resolve=this._convertValue(t),this.reject=e=>{this._clearTimers(),this.errorStack?n((0,i.optimizeErrorStack)(e,this.errorStack.stack,__dirname)):n(e)}});this.promise=(0,r.default)(t,this.callback)}_iterateKeys(e=e=>e){if(this.keys===void 0&&(this.keys=[],(0,t.exists)(this.name,{caseInsensitive:!0}))){let n=(0,t.getKeyIndexes)(this.name,this.args,{nameCaseInsensitive:!0});for(let t of n)this.args[t]=e(this.args[t]),this.keys.push(this.args[t])}return this.keys}_convertValue(e){return t=>{try{this._clearTimers(),e(this.transformReply(t)),this.isResolved=!0}catch(e){this.reject(e)}return this.promise}}};e.default=o,o.FLAGS={VALID_IN_SUBSCRIBER_MODE:[`subscribe`,`psubscribe`,`unsubscribe`,`punsubscribe`,`ssubscribe`,`sunsubscribe`,`ping`,`quit`],VALID_IN_MONITOR_MODE:[`monitor`,`auth`],ENTER_SUBSCRIBER_MODE:[`subscribe`,`psubscribe`,`ssubscribe`],EXIT_SUBSCRIBER_MODE:[`unsubscribe`,`punsubscribe`,`sunsubscribe`],WILL_DISCONNECT:[`quit`],HANDSHAKE_COMMANDS:[`auth`,`select`,`client`,`readonly`,`info`],IGNORE_RECONNECT_ON_ERROR:[`client`],BLOCKING_COMMANDS:[`blpop`,`brpop`,`brpoplpush`,`blmove`,`bzpopmin`,`bzpopmax`,`bzmpop`,`blmpop`,`xread`,`xreadgroup`],LAST_ARG_TIMEOUT_COMMANDS:[`blpop`,`brpop`,`brpoplpush`,`blmove`,`bzpopmin`,`bzpopmax`],FIRST_ARG_TIMEOUT_COMMANDS:[`bzmpop`,`blmpop`],BLOCK_OPTION_COMMANDS:[`xread`,`xreadgroup`]},o._transformer={argument:{},reply:{}};let s=function(e){if(e.length===1){if(e[0]instanceof Map)return(0,i.convertMapToArray)(e[0]);if(typeof e[0]==`object`&&e[0]!==null)return(0,i.convertObjectToArray)(e[0])}return e},c=function(e){if(e.length===2){if(e[1]instanceof Map)return[e[0]].concat((0,i.convertMapToArray)(e[1]));if(typeof e[1]==`object`&&e[1]!==null)return[e[0]].concat((0,i.convertObjectToArray)(e[1]))}return e};o.setArgumentTransformer(`mset`,s),o.setArgumentTransformer(`msetnx`,s),o.setArgumentTransformer(`hset`,c),o.setArgumentTransformer(`hmset`,c),o.setReplyTransformer(`hgetall`,function(e){if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];r in t?Object.defineProperty(t,r,{value:i,configurable:!0,enumerable:!0,writable:!0}):t[r]=i}return t}return e});var l=class{constructor(){this.length=0,this.items=[]}push(e){this.length+=Buffer.byteLength(e),this.items.push(e)}toBuffer(){let e=Buffer.allocUnsafe(this.length),t=0;for(let n of this.items){let r=Buffer.byteLength(n);Buffer.isBuffer(n)?n.copy(e,t):e.write(n,t,r),t+=r}return e}}})),vF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=rF();var n=class extends t.RedisError{constructor(e,t){super(e),this.lastNodeError=t,Error.captureStackTrace(this,this.constructor)}get name(){return this.constructor.name}};e.default=n,n.defaultMessage=`Failed to refresh slots cache.`})),yF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`stream`);e.default=class extends t.Readable{constructor(e){super(e),this.opt=e,this._redisCursor=`0`,this._redisDrained=!1}_read(){if(this._redisDrained){this.push(null);return}let e=[this._redisCursor];this.opt.key&&e.unshift(this.opt.key),this.opt.match&&e.push(`MATCH`,this.opt.match),this.opt.type&&e.push(`TYPE`,this.opt.type),this.opt.count&&e.push(`COUNT`,String(this.opt.count)),this.opt.noValues&&e.push(`NOVALUES`),this.opt.redis[this.opt.command](e,(e,t)=>{if(e){this.emit(`error`,e);return}this._redisCursor=t[0]instanceof Buffer?t[0].toString():t[0],this._redisCursor===`0`&&(this._redisDrained=!0),this.push(t[1])})}close(){this._redisDrained=!0}}})),bF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.executeWithAutoPipelining=e.getFirstValueInFlattenedArray=e.shouldUseAutoPipelining=e.notAllowedAutoPipelineCommands=e.kCallbacks=e.kExec=void 0;let t=sF(),n=iF(),r=eF(),i=QP();e.kExec=Symbol(`exec`),e.kCallbacks=Symbol(`callbacks`),e.notAllowedAutoPipelineCommands=[`auth`,`info`,`script`,`quit`,`cluster`,`pipeline`,`multi`,`subscribe`,`psubscribe`,`unsubscribe`,`unpsubscribe`,`select`,`client`];function a(t,n){if(t._runningAutoPipelines.has(n)||!t._autoPipelines.has(n))return;t._runningAutoPipelines.add(n);let r=t._autoPipelines.get(n);t._autoPipelines.delete(n);let i=r[e.kCallbacks];r[e.kCallbacks]=null,r.exec(function(e,r){if(t._runningAutoPipelines.delete(n),e)for(let t=0;t<i.length;t++)process.nextTick(i[t],e);else for(let e=0;e<i.length;e++)process.nextTick(i[e],...r[e]);t._autoPipelines.has(n)&&a(t,n)})}function o(t,n,r){return n&&t.options.enableAutoPipelining&&!t.isPipeline&&!e.notAllowedAutoPipelineCommands.includes(r)&&!t.options.autoPipeliningIgnoredCommands.includes(r)}e.shouldUseAutoPipelining=o;function s(e){for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`)return r;if(Array.isArray(r)||(0,t.isArguments)(r)){if(r.length===0)continue;return r[0]}let i=[r].flat();if(i.length>0)return i[0]}}e.getFirstValueInFlattenedArray=s;function c(o,l,u,d,f){if(o.isCluster&&!o.slots.length)return o.status===`wait`&&o.connect().catch(t.noop),(0,r.default)(new Promise(function(e,t){o.delayUntilReady(n=>{if(n){t(n);return}c(o,l,u,d,null).then(e,t)})}),f);let p=o.options.keyPrefix||``,m=o.isCluster?o.slots[n(`${p}${s(d)}`)].join(`,`):`main`;if(o.isCluster&&o.options.scaleReads!==`master`){let e=(0,i.exists)(u)&&(0,i.hasFlag)(u,`readonly`);m+=e?`:read`:`:write`}if(!o._autoPipelines.has(m)){let t=o.pipeline();t[e.kExec]=!1,t[e.kCallbacks]=[],o._autoPipelines.set(m,t)}let h=o._autoPipelines.get(m);h[e.kExec]||(h[e.kExec]=!0,setImmediate(a,o,m));let g=new Promise(function(t,n){h[e.kCallbacks].push(function(e,r){if(e){n(e);return}t(r)}),l===`call`&&d.unshift(u),h[l](...d)});return(0,r.default)(g,f)}e.executeWithAutoPipelining=c})),xF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`crypto`),n=_F(),r=eF();e.default=class{constructor(e,r=null,i=``,a=!1){this.lua=e,this.numberOfKeys=r,this.keyPrefix=i,this.readOnly=a,this.sha=(0,t.createHash)(`sha1`).update(e).digest(`hex`);let o=this.sha,s=new WeakSet;this.Command=class extends n.default{toWritable(t){let n=this.reject;return this.reject=e=>{e.message.indexOf(`NOSCRIPT`)!==-1&&s.delete(t),n.call(this,e)},s.has(t)?this.name===`eval`&&(this.name=`evalsha`,this.args[0]=o):(s.add(t),this.name=`eval`,this.args[0]=e),super.toWritable(t)}}}execute(e,t,n,i){typeof this.numberOfKeys==`number`&&t.unshift(this.numberOfKeys),this.keyPrefix&&(n.keyPrefix=this.keyPrefix),this.readOnly&&(n.readOnly=!0);let a=new this.Command(`evalsha`,[this.sha,...t],n);return a.promise=a.promise.catch(r=>{if(r.message.indexOf(`NOSCRIPT`)===-1)throw r;let i=new this.Command(`evalsha`,[this.sha,...t],n);return(e.isPipeline?e.redis:e).sendCommand(i)}),(0,r.default)(a.promise,i),e.sendCommand(a)}}})),SF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=QP(),n=bF(),r=_F(),i=xF();var a=class{constructor(){this.options={},this.scriptsSet={},this.addedBuiltinSet=new Set}getBuiltinCommands(){return o.slice(0)}createBuiltinCommand(e){return{string:s(null,e,`utf8`),buffer:s(null,e,null)}}addBuiltinCommand(e){this.addedBuiltinSet.add(e),this[e]=s(e,e,`utf8`),this[e+`Buffer`]=s(e+`Buffer`,e,null)}defineCommand(e,t){let n=new i.default(t.lua,t.numberOfKeys,this.options.keyPrefix,t.readOnly);this.scriptsSet[e]=n,this[e]=c(e,e,n,`utf8`),this[e+`Buffer`]=c(e+`Buffer`,e,n,null)}sendCommand(e,t,n){throw Error(`"sendCommand" is not implemented`)}};let o=t.list.filter(e=>e!==`monitor`);o.push(`sentinel`),o.forEach(function(e){a.prototype[e]=s(e,e,`utf8`),a.prototype[e+`Buffer`]=s(e+`Buffer`,e,null)}),a.prototype.call=s(`call`,`utf8`),a.prototype.callBuffer=s(`callBuffer`,null),a.prototype.send_command=a.prototype.call;function s(e,t,i){return i===void 0&&(i=t,t=null),function(...a){let o=t||a.shift(),s=a[a.length-1];typeof s==`function`?a.pop():s=void 0;let c={errorStack:this.options.showFriendlyErrorStack?Error():void 0,keyPrefix:this.options.keyPrefix,replyEncoding:i};return(0,n.shouldUseAutoPipelining)(this,e,o)?(0,n.executeWithAutoPipelining)(this,e,o,a,s):this.sendCommand(new r.default(o,a,c,s))}}function c(e,t,r,i){return function(...a){let o=typeof a[a.length-1]==`function`?a.pop():void 0,s={replyEncoding:i};return this.options.showFriendlyErrorStack&&(s.errorStack=Error()),(0,n.shouldUseAutoPipelining)(this,e,t)?(0,n.executeWithAutoPipelining)(this,e,t,a,o):r.execute(this,a,s,o)}}e.default=a})),CF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=iF(),n=QP(),r=eF(),i=h(`util`),a=_F(),o=hF(),s=SF();function c(e,n){let r=t(n[0]),i=e._groupsBySlot[r];for(let r=1;r<n.length;r++)if(e._groupsBySlot[t(n[r])]!==i)return-1;return r}var l=class extends s.default{constructor(e){super(),this.redis=e,this.isPipeline=!0,this.replyPending=0,this._queue=[],this._result=[],this._transactions=0,this._shaToScript={},this.isCluster=this.redis.constructor.name===`Cluster`||this.redis.isCluster,this.options=e.options,Object.keys(e.scriptsSet).forEach(t=>{let n=e.scriptsSet[t];this._shaToScript[n.sha]=n,this[t]=e[t],this[t+`Buffer`]=e[t+`Buffer`]}),e.addedBuiltinSet.forEach(t=>{this[t]=e[t],this[t+`Buffer`]=e[t+`Buffer`]}),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t});let t=this;Object.defineProperty(this,`length`,{get:function(){return t._queue.length}})}fillResult(e,t){if(this._queue[t].name===`exec`&&Array.isArray(e[1])){let n=e[1].length;for(let r=0;r<n;r++){if(e[1][r]instanceof Error)continue;let i=this._queue[t-(n-r)];try{e[1][r]=i.transformReply(e[1][r])}catch(t){e[1][r]=t}}}if(this._result[t]=e,--this.replyPending)return;if(this.isCluster){let e=!0,t;for(let r=0;r<this._result.length;++r){let i=this._result[r][0],a=this._queue[r];if(i){if(a.name===`exec`&&i.message===`EXECABORT Transaction discarded because of previous errors.`)continue;if(!t)t={name:i.name,message:i.message};else if(t.name!==i.name||t.message!==i.message){e=!1;break}}else if(!a.inTransaction&&!((0,n.exists)(a.name,{caseInsensitive:!0})&&(0,n.hasFlag)(a.name,`readonly`,{nameCaseInsensitive:!0}))){e=!1;break}}if(t&&e){let e=this,n=t.message.split(` `),r=this._queue,i=!1;this._queue=[];for(let e=0;e<r.length;++e){if(n[0]===`ASK`&&!i&&r[e].name!==`asking`&&(!r[e-1]||r[e-1].name!==`asking`)){let e=new a.default(`asking`);e.ignore=!0,this.sendCommand(e)}r[e].initPromise(),this.sendCommand(r[e]),i=r[e].inTransaction}let o=!0;this.leftRedirections===void 0&&(this.leftRedirections={});let s=function(){e.exec()},c=this.redis;if(c.handleError(t,this.leftRedirections,{moved:function(t,r){e.preferKey=r,c.slots[n[1]]?c.slots[n[1]][0]!==r&&(c.slots[n[1]]=[r]):c.slots[n[1]]=[r],c._groupsBySlot[n[1]]=c._groupsIds[c.slots[n[1]].join(`;`)],c.refreshSlotsCache(),e.exec()},ask:function(t,n){e.preferKey=n,e.exec()},tryagain:s,clusterDown:s,connectionClosed:s,maxRedirections:()=>{o=!1},defaults:()=>{o=!1}}),o)return}}let r=0;for(let e=0;e<this._queue.length-r;++e)this._queue[e+r].ignore&&(r+=1),this._result[e]=this._result[e+r];this.resolve(this._result.slice(0,this._result.length-r))}sendCommand(e){this._transactions>0&&(e.inTransaction=!0);let t=this._queue.length;return e.pipelineIndex=t,e.promise.then(e=>{this.fillResult([null,e],t)}).catch(e=>{this.fillResult([e],t)}),this._queue.push(e),this}addBatch(e){let t,n,r;for(let i=0;i<e.length;++i)t=e[i],n=t[0],r=t.slice(1),this[n].apply(this,r);return this}};e.default=l;let u=l.prototype.multi;l.prototype.multi=function(){return this._transactions+=1,u.apply(this,arguments)};let d=l.prototype.execBuffer;l.prototype.execBuffer=(0,i.deprecate)(function(){return this._transactions>0&&--this._transactions,d.apply(this,arguments)},`Pipeline#execBuffer: Use Pipeline#exec instead`),l.prototype.exec=function(e){if(this.isCluster&&!this.redis.slots.length)return this.redis.status===`wait`&&this.redis.connect().catch(o.noop),e&&!this.nodeifiedPromise&&(this.nodeifiedPromise=!0,(0,r.default)(this.promise,e)),this.redis.delayUntilReady(t=>{if(t){this.reject(t);return}this.exec(e)}),this.promise;if(this._transactions>0)return--this._transactions,d.apply(this,arguments);this.nodeifiedPromise||(this.nodeifiedPromise=!0,(0,r.default)(this.promise,e)),this._queue.length||this.resolve([]);let n;if(this.isCluster){let e=[];for(let n=0;n<this._queue.length;n++){let r=this._queue[n].getKeys();if(r.length&&e.push(r[0]),r.length&&t.generateMulti(r)<0)return this.reject(Error(`All the keys in a pipeline command should belong to the same slot`)),this.promise}if(e.length){if(n=c(this.redis,e),n<0)return this.reject(Error(`All keys in the pipeline should belong to the same slots allocation group`)),this.promise}else n=Math.random()*16384|0}let i=this;return a(),this.promise;function a(){let e=i.replyPending=i._queue.length,t;i.isCluster&&(t={slot:n,redis:i.redis.connectionPool.nodes.all[i.preferKey]});let r=``,a,o={isPipeline:!0,destination:i.isCluster?t:{redis:i.redis},write(t){typeof t==`string`?r+=t:(a||=[],r&&=(a.push(Buffer.from(r,`utf8`)),``),a.push(t)),--e||(a?(r&&a.push(Buffer.from(r,`utf8`)),o.destination.redis.stream.write(Buffer.concat(a))):o.destination.redis.stream.write(r),e=i._queue.length,r=``,a=void 0)}};for(let e=0;e<i._queue.length;++e)i.redis.sendCommand(i._queue[e],o,t);return i.promise}}})),wF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.addTransactionSupport=void 0;let t=hF(),n=eF(),r=CF();function i(e){e.pipeline=function(e){let t=new r.default(this);return Array.isArray(e)&&t.addBatch(e),t};let{multi:i}=e;e.multi=function(e,a){if(a===void 0&&!Array.isArray(e)&&(a=e,e=null),a&&a.pipeline===!1)return i.call(this);let o=new r.default(this);o.multi(),Array.isArray(e)&&o.addBatch(e);let s=o.exec;o.exec=function(e){if(this.isCluster&&!this.redis.slots.length)return this.redis.status===`wait`&&this.redis.connect().catch(t.noop),(0,n.default)(new Promise((e,t)=>{this.redis.delayUntilReady(n=>{if(n){t(n);return}this.exec(o).then(e,t)})}),e);if(this._transactions>0&&s.call(o),this.nodeifiedPromise)return s.call(o);let r=s.call(o);return(0,n.default)(r.then(function(e){let n=e[e.length-1];if(n===void 0)throw Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it.");if(n[0]){n[0].previousErrors=[];for(let t=0;t<e.length-1;++t)e[t][0]&&n[0].previousErrors.push(e[t][0]);throw n[0]}return(0,t.wrapMultiResult)(n[1])}),e)};let{execBuffer:c}=o;return o.execBuffer=function(e){return this._transactions>0&&c.call(o),o.exec(e)},o};let{exec:a}=e;e.exec=function(e){return(0,n.default)(a.call(this).then(function(e){return Array.isArray(e)&&(e=(0,t.wrapMultiResult)(e)),e}),e)}}e.addTransactionSupport=i})),TF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})}e.default=t})),EF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_CLUSTER_OPTIONS=void 0;let t=h(`dns`);e.DEFAULT_CLUSTER_OPTIONS={clusterRetryStrategy:e=>Math.min(100+e*2,2e3),enableOfflineQueue:!0,enableReadyCheck:!0,scaleReads:`master`,maxRedirections:16,retryDelayOnMoved:0,retryDelayOnFailover:100,retryDelayOnClusterDown:100,retryDelayOnTryAgain:100,slotsRefreshTimeout:1e3,useSRVRecords:!1,resolveSrv:t.resolveSrv,dnsLookup:t.lookup,enableAutoPipelining:!1,autoPipeliningIgnoredCommands:[],shardedSubscribers:!1}})),DF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getConnectionName=e.weightSrvRecords=e.groupSrvRecords=e.getUniqueHostnamesFromOptions=e.normalizeNodeOptions=e.nodeKeyToRedisOptions=e.getNodeKey=void 0;let t=hF(),n=h(`net`);function r(e){return e.port=e.port||6379,e.host=e.host||`127.0.0.1`,e.host+`:`+e.port}e.getNodeKey=r;function i(e){let t=e.lastIndexOf(`:`);if(t===-1)throw Error(`Invalid node key ${e}`);return{host:e.slice(0,t),port:Number(e.slice(t+1))}}e.nodeKeyToRedisOptions=i;function a(e){return e.map(e=>{let n={};if(typeof e==`object`)Object.assign(n,e);else if(typeof e==`string`)Object.assign(n,(0,t.parseURL)(e));else if(typeof e==`number`)n.port=e;else throw Error(`Invalid argument `+e);return typeof n.port==`string`&&(n.port=parseInt(n.port,10)),delete n.db,n.port||=6379,n.host||=`127.0.0.1`,(0,t.resolveTLSProfile)(n)})}e.normalizeNodeOptions=a;function o(e){let t={};return e.forEach(e=>{t[e.host]=!0}),Object.keys(t).filter(e=>!(0,n.isIP)(e))}e.getUniqueHostnamesFromOptions=o;function s(e){let t={};for(let n of e)t.hasOwnProperty(n.priority)?(t[n.priority].totalWeight+=n.weight,t[n.priority].records.push(n)):t[n.priority]={totalWeight:n.weight,records:[n]};return t}e.groupSrvRecords=s;function c(e){if(e.records.length===1)return e.totalWeight=0,e.records.shift();let t=Math.floor(Math.random()*(e.totalWeight+e.records.length)),n=0;for(let[r,i]of e.records.entries())if(n+=1+i.weight,n>t)return e.totalWeight-=i.weight,e.records.splice(r,1),i}e.weightSrvRecords=c;function l(e,t){let n=`ioredis-cluster(${e})`;return t?`${n}:${t}`:n}e.getConnectionName=l})),OF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=DF(),n=hF(),r=YF(),i=(0,n.Debug)(`cluster:subscriber`);e.default=class{constructor(e,n,r=!1){this.connectionPool=e,this.emitter=n,this.isSharded=r,this.started=!1,this.subscriber=null,this.slotRange=[],this.onSubscriberEnd=()=>{if(!this.started){i(`subscriber has disconnected, but ClusterSubscriber is not started, so not reconnecting.`);return}i(`subscriber has disconnected, selecting a new one...`),this.selectSubscriber()},this.connectionPool.on(`-node`,(e,n)=>{!this.started||!this.subscriber||(0,t.getNodeKey)(this.subscriber.options)===n&&(i(`subscriber has left, selecting a new one...`),this.selectSubscriber())}),this.connectionPool.on(`+node`,()=>{!this.started||this.subscriber||(i(`a new node is discovered and there is no subscriber, selecting a new one...`),this.selectSubscriber())})}getInstance(){return this.subscriber}associateSlotRange(e){return this.isSharded&&(this.slotRange=e),this.slotRange}start(){this.started=!0,this.selectSubscriber(),i(`started`)}stop(){this.started=!1,this.subscriber&&=(this.subscriber.disconnect(),null)}isStarted(){return this.started}selectSubscriber(){let e=this.lastActiveSubscriber;e&&(e.off(`end`,this.onSubscriberEnd),e.disconnect()),this.subscriber&&(this.subscriber.off(`end`,this.onSubscriberEnd),this.subscriber.disconnect());let a=(0,n.sample)(this.connectionPool.getNodes());if(!a){i(`selecting subscriber failed since there is no node discovered in the cluster yet`),this.subscriber=null;return}let{options:o}=a;i(`selected a subscriber %s:%s`,o.host,o.port);let s=`subscriber`;this.isSharded&&(s=`ssubscriber`),this.subscriber=new r.default({port:o.port,host:o.host,username:o.username,password:o.password,enableReadyCheck:!0,connectionName:(0,t.getConnectionName)(s,o.connectionName),lazyConnect:!0,tls:o.tls,retryStrategy:null}),this.subscriber.on(`error`,n.noop),this.subscriber.on(`moved`,()=>{this.emitter.emit(`forceRefresh`)}),this.subscriber.once(`end`,this.onSubscriberEnd);let c={subscribe:[],psubscribe:[],ssubscribe:[]};if(e){let t=e.condition||e.prevCondition;t&&t.subscriber&&(c.subscribe=t.subscriber.channels(`subscribe`),c.psubscribe=t.subscriber.channels(`psubscribe`),c.ssubscribe=t.subscriber.channels(`ssubscribe`))}if(c.subscribe.length||c.psubscribe.length||c.ssubscribe.length){let e=0;for(let t of[`subscribe`,`psubscribe`,`ssubscribe`]){let n=c[t];if(n.length!=0)if(i(`%s %d channels`,t,n.length),t===`ssubscribe`)for(let r of n)e+=1,this.subscriber[t](r).then(()=>{--e||(this.lastActiveSubscriber=this.subscriber)}).catch(()=>{i(`failed to ssubscribe to channel: %s`,r)});else e+=1,this.subscriber[t](n).then(()=>{--e||(this.lastActiveSubscriber=this.subscriber)}).catch(()=>{i(`failed to %s %d channels`,t,n.length)})}}else this.lastActiveSubscriber=this.subscriber;for(let e of[`message`,`messageBuffer`])this.subscriber.on(e,(t,n)=>{this.emitter.emit(e,t,n)});for(let e of[`pmessage`,`pmessageBuffer`])this.subscriber.on(e,(t,n,r)=>{this.emitter.emit(e,t,n,r)});if(this.isSharded==1)for(let e of[`smessage`,`smessageBuffer`])this.subscriber.on(e,(t,n)=>{this.emitter.emit(e,t,n)})}}})),kF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`events`),n=hF(),r=DF(),i=YF(),a=(0,n.Debug)(`cluster:connectionPool`);e.default=class extends t.EventEmitter{constructor(e){super(),this.redisOptions=e,this.nodes={all:{},master:{},slave:{}},this.specifiedOptions={}}getNodes(e=`all`){let t=this.nodes[e];return Object.keys(t).map(e=>t[e])}getInstanceByKey(e){return this.nodes.all[e]}getSampleInstance(e){let t=Object.keys(this.nodes[e]),r=(0,n.sample)(t);return this.nodes[e][r]}addMasterNode(e){let t=(0,r.getNodeKey)(e.options),n=this.createRedisFromOptions(e,e.options.readOnly);return e.options.readOnly?!1:(this.nodes.all[t]=n,this.nodes.master[t]=n,!0)}createRedisFromOptions(e,t){return new i.default((0,n.defaults)({retryStrategy:null,enableOfflineQueue:!0,readOnly:t},e,this.redisOptions,{lazyConnect:!0}))}findOrCreate(e,t=!1){let i=(0,r.getNodeKey)(e);t=!!t,this.specifiedOptions[i]?Object.assign(e,this.specifiedOptions[i]):this.specifiedOptions[i]=e;let o;return this.nodes.all[i]?(o=this.nodes.all[i],o.options.readOnly!==t&&(o.options.readOnly=t,a(`Change role of %s to %s`,i,t?`slave`:`master`),o[t?`readonly`:`readwrite`]().catch(n.noop),t?(delete this.nodes.master[i],this.nodes.slave[i]=o):(delete this.nodes.slave[i],this.nodes.master[i]=o))):(a(`Connecting to %s as %s`,i,t?`slave`:`master`),o=this.createRedisFromOptions(e,t),this.nodes.all[i]=o,this.nodes[t?`slave`:`master`][i]=o,o.once(`end`,()=>{this.removeNode(i),this.emit(`-node`,o,i),Object.keys(this.nodes.all).length||this.emit(`drain`)}),this.emit(`+node`,o,i),o.on(`error`,function(e){this.emit(`nodeError`,e,i)})),o}reset(e){a(`Reset with %O`,e);let t={};e.forEach(e=>{let n=(0,r.getNodeKey)(e);e.readOnly&&t[n]||(t[n]=e)}),Object.keys(this.nodes.all).forEach(e=>{t[e]||(a(`Disconnect %s because the node does not hold any slot`,e),this.nodes.all[e].disconnect(),this.removeNode(e))}),Object.keys(t).forEach(e=>{let n=t[e];this.findOrCreate(n,n.readOnly)})}removeNode(e){let{nodes:t}=this;t.all[e]&&(a(`Remove %s from the pool`,e),delete t.all[e]),delete t.master[e],delete t.slave[e]}}})),AF=u(((e,t)=>{function n(e,t){var t=t||{};this._capacity=t.capacity,this._head=0,this._tail=0,Array.isArray(e)?this._fromArray(e):(this._capacityMask=3,this._list=[,,,,])}n.prototype.peekAt=function(e){var t=e;if(t===(t|0)){var n=this.size();if(!(t>=n||t<-n))return t<0&&(t+=n),t=this._head+t&this._capacityMask,this._list[t]}},n.prototype.get=function(e){return this.peekAt(e)},n.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},n.prototype.peekFront=function(){return this.peek()},n.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(n.prototype,`length`,{get:function(){return this.size()}}),n.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},n.prototype.unshift=function(e){if(arguments.length===0)return this.size();var t=this._list.length;return this._head=this._head-1+t&this._capacityMask,this._list[this._head]=e,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},n.prototype.shift=function(){var e=this._head;if(e!==this._tail){var t=this._list[e];return this._list[e]=void 0,this._head=e+1&this._capacityMask,e<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),t}},n.prototype.push=function(e){if(arguments.length===0)return this.size();var t=this._tail;return this._list[t]=e,this._tail=t+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},n.prototype.pop=function(){var e=this._tail;if(e!==this._head){var t=this._list.length;this._tail=e-1+t&this._capacityMask;var n=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&e>1e4&&e<=t>>>2&&this._shrinkArray(),n}},n.prototype.removeOne=function(e){var t=e;if(t===(t|0)&&this._head!==this._tail){var n=this.size(),r=this._list.length;if(!(t>=n||t<-n)){t<0&&(t+=n),t=this._head+t&this._capacityMask;var i=this._list[t],a;if(e<n/2){for(a=e;a>0;a--)this._list[t]=this._list[t=t-1+r&this._capacityMask];this._list[t]=void 0,this._head=this._head+1+r&this._capacityMask}else{for(a=n-1-e;a>0;a--)this._list[t]=this._list[t=t+1+r&this._capacityMask];this._list[t]=void 0,this._tail=this._tail-1+r&this._capacityMask}return i}}},n.prototype.remove=function(e,t){var n=e,r,i=t;if(n===(n|0)&&this._head!==this._tail){var a=this.size(),o=this._list.length;if(!(n>=a||n<-a||t<1)){if(n<0&&(n+=a),t===1||!t)return r=[,],r[0]=this.removeOne(n),r;if(n===0&&n+t>=a)return r=this.toArray(),this.clear(),r;n+t>a&&(t=a-n);var s;for(r=Array(t),s=0;s<t;s++)r[s]=this._list[this._head+n+s&this._capacityMask];if(n=this._head+n&this._capacityMask,e+t===a){for(this._tail=this._tail-t+o&this._capacityMask,s=t;s>0;s--)this._list[n=n+1+o&this._capacityMask]=void 0;return r}if(e===0){for(this._head=this._head+t+o&this._capacityMask,s=t-1;s>0;s--)this._list[n=n+1+o&this._capacityMask]=void 0;return r}if(n<a/2){for(this._head=this._head+e+t+o&this._capacityMask,s=e;s>0;s--)this.unshift(this._list[n=n-1+o&this._capacityMask]);for(n=this._head-1+o&this._capacityMask;i>0;)this._list[n=n-1+o&this._capacityMask]=void 0,i--;e<0&&(this._tail=n)}else{for(this._tail=n,n=n+t+o&this._capacityMask,s=a-(t+e);s>0;s--)this.push(this._list[n++]);for(n=this._tail;i>0;)this._list[n=n+1+o&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=o>>>2&&this._shrinkArray(),r}}},n.prototype.splice=function(e,t){var n=e;if(n===(n|0)){var r=this.size();if(n<0&&(n+=r),!(n>r))if(arguments.length>2){var i,a,o,s=arguments.length,c=this._list.length,l=2;if(!r||n<r/2){for(a=Array(n),i=0;i<n;i++)a[i]=this._list[this._head+i&this._capacityMask];for(t===0?(o=[],n>0&&(this._head=this._head+n+c&this._capacityMask)):(o=this.remove(n,t),this._head=this._head+n+c&this._capacityMask);s>l;)this.unshift(arguments[--s]);for(i=n;i>0;i--)this.unshift(a[i-1])}else{a=Array(r-(n+t));var u=a.length;for(i=0;i<u;i++)a[i]=this._list[this._head+n+t+i&this._capacityMask];for(t===0?(o=[],n!=r&&(this._tail=this._head+n+c&this._capacityMask)):(o=this.remove(n,t),this._tail=this._tail-u+c&this._capacityMask);l<s;)this.push(arguments[l++]);for(i=0;i<u;i++)this.push(a[i])}return o}else return this.remove(n,t)}},n.prototype.clear=function(){this._list=Array(this._list.length),this._head=0,this._tail=0},n.prototype.isEmpty=function(){return this._head===this._tail},n.prototype.toArray=function(){return this._copyArray(!1)},n.prototype._fromArray=function(e){var t=e.length,n=this._nextPowerOf2(t);this._list=Array(n),this._capacityMask=n-1,this._tail=t;for(var r=0;r<t;r++)this._list[r]=e[r]},n.prototype._copyArray=function(e,t){var n=this._list,r=n.length,i=this.length;if(t|=i,t==i&&this._head<this._tail)return this._list.slice(this._head,this._tail);var a=Array(t),o=0,s;if(e||this._head>this._tail){for(s=this._head;s<r;s++)a[o++]=n[s];for(s=0;s<this._tail;s++)a[o++]=n[s]}else for(s=this._head;s<this._tail;s++)a[o++]=n[s];return a},n.prototype._growArray=function(){if(this._head!=0){var e=this._copyArray(!0,this._list.length<<1);this._tail=this._list.length,this._head=0,this._list=e}else this._tail=this._list.length,this._list.length<<=1;this._capacityMask=this._capacityMask<<1|1},n.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},n.prototype._nextPowerOf2=function(e){var t=1<<Math.log(e)/Math.log(2)+1;return Math.max(t,4)},t.exports=n})),jF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=hF(),n=AF(),r=(0,t.Debug)(`delayqueue`);e.default=class{constructor(){this.queues={},this.timeouts={}}push(e,t,r){let i=r.callback||process.nextTick;this.queues[e]||(this.queues[e]=new n),this.queues[e].push(t),this.timeouts[e]||(this.timeouts[e]=setTimeout(()=>{i(()=>{this.timeouts[e]=null,this.execute(e)})},r.timeout))}execute(e){let t=this.queues[e];if(!t)return;let{length:n}=t;if(n)for(r(`send %d commands in %s queue`,n,e),this.queues[e]=null;t.length>0;)t.shift()()}}})),MF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=DF(),n=hF(),r=YF(),i=(0,n.Debug)(`cluster:subscriberGroup:shardedSubscriber`),a={IDLE:`idle`,STARTING:`starting`,CONNECTED:`connected`,STOPPING:`stopping`,ENDED:`ended`},o={[a.IDLE]:[a.STARTING,a.STOPPING,a.ENDED],[a.STARTING]:[a.CONNECTED,a.STOPPING,a.ENDED],[a.CONNECTED]:[a.STOPPING,a.ENDED],[a.STOPPING]:[a.ENDED],[a.ENDED]:[]};e.default=class{constructor(e,i,o){this.emitter=e,this.status=a.IDLE,this.instance=null,this.connectPromise=null,this.messageListeners=new Map,this.onEnd=()=>{this.updateStatus(a.ENDED),this.emitter.emit(`-node`,this.instance,this.nodeKey)},this.onError=e=>{this.emitter.emit(`nodeError`,e,this.nodeKey)},this.onMoved=()=>{this.emitter.emit(`moved`)},this.instance=new r.default((0,n.defaults)({enableReadyCheck:!1,enableOfflineQueue:!0,connectionName:(0,t.getConnectionName)(`ssubscriber`,i.connectionName),retryStrategy:null,lazyConnect:!0},i,o)),this.lazyConnect=o?.lazyConnect??!0,this.nodeKey=(0,t.getNodeKey)(i),this.instance.on(`end`,this.onEnd),this.instance.on(`error`,this.onError),this.instance.on(`moved`,this.onMoved);for(let e of[`smessage`,`smessageBuffer`]){let t=(...t)=>{this.emitter.emit(e,...t)};this.messageListeners.set(e,t),this.instance.on(e,t)}}async start(){if(this.connectPromise)return this.connectPromise;if(!(this.status===a.STARTING||this.status===a.CONNECTED)){if(this.status===a.ENDED||!this.instance)throw Error(`Sharded subscriber ${this.nodeKey} cannot be restarted once ended.`);this.updateStatus(a.STARTING),this.connectPromise=this.instance.connect();try{await this.connectPromise,this.updateStatus(a.CONNECTED)}catch(e){throw this.updateStatus(a.ENDED),e}finally{this.connectPromise=null}}}stop(){this.updateStatus(a.STOPPING),this.instance&&=(this.instance.disconnect(),this.instance.removeAllListeners(),this.messageListeners.clear(),null),this.updateStatus(a.ENDED),i(`stopped %s`,this.nodeKey)}isStarted(){return[a.CONNECTED,a.STARTING].includes(this.status)}get subscriberStatus(){return this.status}isHealthy(){return(this.status===a.IDLE||this.status===a.CONNECTED||this.status===a.STARTING)&&this.instance!==null}getInstance(){return this.instance}getNodeKey(){return this.nodeKey}isLazyConnect(){return this.lazyConnect}updateStatus(e){if(this.status!==e){if(!o[this.status].includes(e)){i(`Invalid status transition for %s: %s -> %s`,this.nodeKey,this.status,e);return}this.status=e}}}})),NF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=hF(),n=DF(),r=iF(),i=MF(),a=(0,t.Debug)(`cluster:subscriberGroup`);var o=class e{constructor(t,n){this.subscriberGroupEmitter=t,this.options=n,this.shardedSubscribers=new Map,this.clusterSlots=[],this.subscriberToSlotsIndex=new Map,this.channels=new Map,this.failedAttemptsByNode=new Map,this.isResetting=!1,this.pendingReset=null,this.handleSubscriberConnectFailed=(t,n)=>{let r=(this.failedAttemptsByNode.get(n)||0)+1;this.failedAttemptsByNode.set(n,r);let i=Math.min(r,e.MAX_RETRY_ATTEMPTS),o=Math.min(e.BASE_BACKOFF_MS*2**i,e.MAX_BACKOFF_MS),s=Math.floor((Math.random()-.5)*(o*.5)),c=Math.max(0,o+s);a(`Failed to connect subscriber for %s. Refreshing slots in %dms`,n,c),this.subscriberGroupEmitter.emit(`subscriberConnectFailed`,{delay:c,error:t})},this.handleSubscriberConnectSucceeded=e=>{this.failedAttemptsByNode.delete(e)}}getResponsibleSubscriber(e){let t=this.clusterSlots[e][0],n=this.shardedSubscribers.get(t);return n&&n.subscriberStatus===`idle`&&n.start().then(()=>{this.handleSubscriberConnectSucceeded(n.getNodeKey())}).catch(e=>{this.handleSubscriberConnectFailed(e,n.getNodeKey())}),n}addChannels(e){let t=r(e[0]);for(let n of e)if(r(n)!==t)return-1;let n=this.channels.get(t);return n?this.channels.set(t,n.concat(e)):this.channels.set(t,e),Array.from(this.channels.values()).reduce((e,t)=>e+t.length,0)}removeChannels(e){let t=r(e[0]);for(let n of e)if(r(n)!==t)return-1;let n=this.channels.get(t);if(n){let r=n.filter(t=>!e.includes(t));this.channels.set(t,r)}return Array.from(this.channels.values()).reduce((e,t)=>e+t.length,0)}stop(){for(let e of this.shardedSubscribers.values())e.stop();this.pendingReset=null,this.shardedSubscribers.clear(),this.subscriberToSlotsIndex.clear()}start(){let e=[];for(let t of this.shardedSubscribers.values())this.shouldStartSubscriber(t)&&(e.push(t.start().then(()=>{this.handleSubscriberConnectSucceeded(t.getNodeKey())}).catch(e=>{this.handleSubscriberConnectFailed(e,t.getNodeKey())})),this.subscriberGroupEmitter.emit(`+subscriber`));return Promise.all(e)}async reset(e,t){if(this.isResetting){this.pendingReset={slots:e,nodes:t};return}this.isResetting=!0;try{let r=this._refreshSlots(e),o=this.hasUnhealthySubscribers();if(!r&&!o){a(`No topology change detected or failed subscribers. Skipping reset.`);return}for(let[e,t]of this.shardedSubscribers){if(this.subscriberToSlotsIndex.has(e)&&t.isHealthy()){a(`Skipping deleting subscriber for %s`,e);continue}a(`Removing subscriber for %s`,e),t.stop(),this.shardedSubscribers.delete(e),this.subscriberGroupEmitter.emit(`-subscriber`)}let s=[];for(let[e,r]of this.subscriberToSlotsIndex){let r=this.shardedSubscribers.get(e);if(r&&r.isHealthy()){a(`Skipping creating new subscriber for %s`,e),!r.isStarted()&&this.shouldStartSubscriber(r)&&s.push(r.start().then(()=>{this.handleSubscriberConnectSucceeded(e)}).catch(t=>{this.handleSubscriberConnectFailed(t,e)}));continue}r&&!r.isHealthy()&&(a(`Replacing subscriber for %s`,e),r.stop(),this.shardedSubscribers.delete(e),this.subscriberGroupEmitter.emit(`-subscriber`)),a(`Creating new subscriber for %s`,e);let o=t.find(t=>(0,n.getNodeKey)(t.options)===e);if(!o){a(`Failed to find node for key %s`,e);continue}let c=new i.default(this.subscriberGroupEmitter,o.options,this.options.redisOptions);this.shardedSubscribers.set(e,c),this.shouldStartSubscriber(c)&&s.push(c.start().then(()=>{this.handleSubscriberConnectSucceeded(e)}).catch(t=>{this.handleSubscriberConnectFailed(t,e)})),this.subscriberGroupEmitter.emit(`+subscriber`)}await Promise.all(s),this._resubscribe(),this.subscriberGroupEmitter.emit(`subscribersReady`)}finally{if(this.isResetting=!1,this.pendingReset){let{slots:e,nodes:t}=this.pendingReset;this.pendingReset=null,await this.reset(e,t)}}}_refreshSlots(e){if(this._slotsAreEqual(e)&&this.subscriberToSlotsIndex.size>0)return a(`Nothing to refresh because the new cluster map is equal to the previous one.`),!1;a(`Refreshing the slots of the subscriber group.`),this.subscriberToSlotsIndex=new Map;for(let t=0;t<e.length;t++){let n=e[t][0];this.subscriberToSlotsIndex.has(n)||this.subscriberToSlotsIndex.set(n,[]),this.subscriberToSlotsIndex.get(n).push(Number(t))}return this.clusterSlots=JSON.parse(JSON.stringify(e)),!0}_resubscribe(){this.shardedSubscribers&&this.shardedSubscribers.forEach((e,t)=>{let n=this.subscriberToSlotsIndex.get(t);n&&n.forEach(n=>{let r=e.getInstance(),i=this.channels.get(n);if(i&&i.length>0){if(!r||r.status===`end`)return;r.status===`ready`?r.ssubscribe(...i).catch(e=>{a(`Failed to ssubscribe on node %s: %s`,t,e)}):r.once(`ready`,()=>{r.ssubscribe(...i).catch(e=>{a(`Failed to ssubscribe on node %s: %s`,t,e)})})}})})}_slotsAreEqual(e){return this.clusterSlots===void 0?!1:JSON.stringify(this.clusterSlots)===JSON.stringify(e)}hasUnhealthySubscribers(){let e=Array.from(this.shardedSubscribers.values()).some(e=>!e.isHealthy()),t=Array.from(this.subscriberToSlotsIndex.keys()).some(e=>!this.shardedSubscribers.has(e));return e||t}shouldStartSubscriber(e){if(e.isStarted())return!1;if(!e.isLazyConnect())return!0;let t=this.subscriberToSlotsIndex.get(e.getNodeKey());return t?t.some(e=>{let t=this.channels.get(e);return!!(t&&t.length>0)}):!1}};e.default=o,o.MAX_RETRY_ATTEMPTS=10,o.MAX_BACKOFF_MS=2e3,o.BASE_BACKOFF_MS=100})),PF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=QP(),n=h(`events`),r=rF(),i=eF(),a=_F(),o=vF(),s=YF(),c=yF(),l=wF(),u=hF(),d=TF(),f=SF(),p=EF(),m=OF(),g=kF(),_=jF(),v=DF(),y=AF(),b=NF(),x=(0,u.Debug)(`cluster`),S=new WeakSet;var C=class e extends f.default{constructor(e,t={}){if(super(),this.slots=[],this._groupsIds={},this._groupsBySlot=Array(16384),this.isCluster=!0,this.retryAttempts=0,this.delayQueue=new _.default,this.offlineQueue=new y,this.isRefreshing=!1,this._refreshSlotsCacheCallbacks=[],this._autoPipelines=new Map,this._runningAutoPipelines=new Set,this._readyDelayedCallbacks=[],this.connectionEpoch=0,n.EventEmitter.call(this),this.startupNodes=e,this.options=(0,u.defaults)({},t,p.DEFAULT_CLUSTER_OPTIONS,this.options),this.options.shardedSubscribers&&this.createShardedSubscriberGroup(),this.options.redisOptions&&this.options.redisOptions.keyPrefix&&!this.options.keyPrefix&&(this.options.keyPrefix=this.options.redisOptions.keyPrefix),typeof this.options.scaleReads!=`function`&&[`all`,`master`,`slave`].indexOf(this.options.scaleReads)===-1)throw Error(`Invalid option scaleReads "`+this.options.scaleReads+`". Expected "all", "master", "slave" or a custom function`);this.connectionPool=new g.default(this.options.redisOptions),this.connectionPool.on(`-node`,(e,t)=>{this.emit(`-node`,e)}),this.connectionPool.on(`+node`,e=>{this.emit(`+node`,e)}),this.connectionPool.on(`drain`,()=>{this.setStatus(`close`)}),this.connectionPool.on(`nodeError`,(e,t)=>{this.emit(`node error`,e,t)}),this.subscriber=new m.default(this.connectionPool,this),this.options.scripts&&Object.entries(this.options.scripts).forEach(([e,t])=>{this.defineCommand(e,t)}),this.options.lazyConnect?this.setStatus(`wait`):this.connect().catch(e=>{x(`connecting failed: %s`,e)})}connect(){return new Promise((e,t)=>{if(this.status===`connecting`||this.status===`connect`||this.status===`ready`){t(Error(`Redis is already connecting/connected`));return}let n=++this.connectionEpoch;this.setStatus(`connecting`),this.resolveStartupNodeHostnames().then(i=>{if(this.connectionEpoch!==n){x(`discard connecting after resolving startup nodes because epoch not match: %d != %d`,n,this.connectionEpoch),t(new r.RedisError(`Connection is discarded because a new connection is made`));return}if(this.status!==`connecting`){x(`discard connecting after resolving startup nodes because the status changed to %s`,this.status),t(new r.RedisError(`Connection is aborted`));return}this.connectionPool.reset(i),this.options.shardedSubscribers&&this.shardedSubscribers.reset(this.slots,this.connectionPool.getNodes(`all`)).catch(e=>{x(`Error while starting subscribers: %s`,e)});let a=()=>{this.setStatus(`ready`),this.retryAttempts=0,this.executeOfflineCommands(),this.resetNodesRefreshInterval(),e()},c,l=()=>{this.invokeReadyDelayedCallbacks(void 0),this.removeListener(`close`,c),this.manuallyClosing=!1,this.setStatus(`connect`),this.options.enableReadyCheck?this.readyCheck((e,t)=>{e||t?(x(`Ready check failed (%s). Reconnecting...`,e||t),this.status===`connect`&&this.disconnect(!0)):a()}):a()};c=()=>{let e=Error(`None of startup nodes is available`);this.removeListener(`refresh`,l),this.invokeReadyDelayedCallbacks(e),t(e)},this.once(`refresh`,l),this.once(`close`,c),this.once(`close`,this.handleCloseEvent.bind(this)),this.refreshSlotsCache(e=>{e&&e.message===o.default.defaultMessage&&(s.default.prototype.silentEmit.call(this,`error`,e),this.connectionPool.reset([]))}),this.subscriber.start(),this.options.shardedSubscribers&&this.shardedSubscribers.start().catch(e=>{x(`Error while starting subscribers: %s`,e)})}).catch(e=>{this.setStatus(`close`),this.handleCloseEvent(e),this.invokeReadyDelayedCallbacks(e),t(e)})})}disconnect(e=!1){let t=this.status;this.setStatus(`disconnecting`),e||(this.manuallyClosing=!0),this.reconnectTimeout&&!e&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null,x(`Canceled reconnecting attempts`)),this.clearNodesRefreshInterval(),this.subscriber.stop(),this.options.shardedSubscribers&&this.shardedSubscribers.stop(),t===`wait`?(this.setStatus(`close`),this.handleCloseEvent()):this.connectionPool.reset([])}quit(e){let t=this.status;if(this.setStatus(`disconnecting`),this.manuallyClosing=!0,this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),this.clearNodesRefreshInterval(),this.subscriber.stop(),this.options.shardedSubscribers&&this.shardedSubscribers.stop(),t===`wait`){let t=(0,i.default)(Promise.resolve(`OK`),e);return setImmediate(function(){this.setStatus(`close`),this.handleCloseEvent()}.bind(this)),t}return(0,i.default)(Promise.all(this.nodes().map(e=>e.quit().catch(e=>{if(e.message===u.CONNECTION_CLOSED_ERROR_MSG)return`OK`;throw e}))).then(()=>`OK`),e)}duplicate(t=[],n={}){return new e(t.length>0?t:this.startupNodes.slice(0),Object.assign({},this.options,n))}nodes(e=`all`){if(e!==`all`&&e!==`master`&&e!==`slave`)throw Error(`Invalid role "`+e+`". Expected "all", "master" or "slave"`);return this.connectionPool.getNodes(e)}delayUntilReady(e){this._readyDelayedCallbacks.push(e)}get autoPipelineQueueSize(){let e=0;for(let t of this._autoPipelines.values())e+=t.length;return e}refreshSlotsCache(e){if(e&&this._refreshSlotsCacheCallbacks.push(e),this.isRefreshing)return;this.isRefreshing=!0;let t=this,n=e=>{this.isRefreshing=!1;for(let t of this._refreshSlotsCacheCallbacks)t(e);this._refreshSlotsCacheCallbacks=[]},r=(0,u.shuffle)(this.connectionPool.getNodes()),i=null;function a(e){if(e===r.length)return n(new o.default(o.default.defaultMessage,i));let s=r[e],c=`${s.options.host}:${s.options.port}`;x(`getting slot cache from %s`,c),t.getInfoFromNode(s,function(r){switch(t.status){case`close`:case`end`:return n(Error(`Cluster is disconnected.`));case`disconnecting`:return n(Error(`Cluster is disconnecting.`))}r?(t.emit(`node error`,r,c),i=r,a(e+1)):(t.emit(`refresh`),n())})}a(0)}sendCommand(e,n,i){if(this.status===`wait`&&this.connect().catch(u.noop),this.status===`end`)return e.reject(Error(u.CONNECTION_CLOSED_ERROR_MSG)),e.promise;let o=this.options.scaleReads;o!==`master`&&(e.isReadOnly||(0,t.exists)(e.name)&&(0,t.hasFlag)(e.name,`readonly`)||(o=`master`));let s=i?i.slot:e.getSlot(),c={},l=this;if(!i&&!S.has(e)){S.add(e);let t=e.reject;e.reject=function(n){let r=d.bind(null,!0);l.handleError(n,c,{moved:function(t,n){x(`command %s is moved to %s`,e.name,n),s=Number(t),l.slots[t]?l.slots[t][0]=n:l.slots[t]=[n],l._groupsBySlot[t]=l._groupsIds[l.slots[t].join(`;`)],l.connectionPool.findOrCreate(l.natMapper(n)),d(),x(`refreshing slot caches... (triggered by MOVED error)`),l.refreshSlotsCache()},ask:function(t,n){x(`command %s is required to ask %s:%s`,e.name,n);let r=l.natMapper(n);l.connectionPool.findOrCreate(r),d(!1,`${r.host}:${r.port}`)},tryagain:r,clusterDown:r,connectionClosed:r,maxRedirections:function(n){t.call(e,n)},defaults:function(){t.call(e,n)}})}}d();function d(t,c){if(l.status===`end`){e.reject(new r.AbortError(`Cluster is ended.`));return}let d;if(l.status===`ready`||e.name===`cluster`){if(i&&i.redis)d=i.redis;else if(a.default.checkFlag(`ENTER_SUBSCRIBER_MODE`,e.name)||a.default.checkFlag(`EXIT_SUBSCRIBER_MODE`,e.name)){if(l.options.shardedSubscribers&&(e.name==`ssubscribe`||e.name==`sunsubscribe`)){let t=l.shardedSubscribers.getResponsibleSubscriber(s);if(!t){e.reject(new r.AbortError(`No sharded subscriber for slot: ${s}`));return}let n=-1;e.name==`ssubscribe`&&(n=l.shardedSubscribers.addChannels(e.getKeys())),e.name==`sunsubscribe`&&(n=l.shardedSubscribers.removeChannels(e.getKeys())),n===-1?e.reject(new r.AbortError(`Possible CROSSSLOT error: All channels must hash to the same slot`)):d=t.getInstance()}else d=l.subscriber.getInstance();if(!d){e.reject(new r.AbortError(`No subscriber for the cluster`));return}}else{if(!t){if(typeof s==`number`&&l.slots[s]){let t=l.slots[s];if(typeof o==`function`){let n=t.map(function(e){return l.connectionPool.getInstanceByKey(e)});d=o(n,e),Array.isArray(d)&&(d=(0,u.sample)(d)),d||=n[0]}else{let e;e=o===`all`?(0,u.sample)(t):o===`slave`&&t.length>1?(0,u.sample)(t,1):t[0],d=l.connectionPool.getInstanceByKey(e)}}c&&(d=l.connectionPool.getInstanceByKey(c),d.asking())}d||=(typeof o==`function`?null:l.connectionPool.getSampleInstance(o))||l.connectionPool.getSampleInstance(`all`)}i&&!i.redis&&(i.redis=d)}d?d.sendCommand(e,n):l.options.enableOfflineQueue?l.offlineQueue.push({command:e,stream:n,node:i}):e.reject(Error(`Cluster isn't ready and enableOfflineQueue options is false`))}return e.promise}sscanStream(e,t){return this.createScanStream(`sscan`,{key:e,options:t})}sscanBufferStream(e,t){return this.createScanStream(`sscanBuffer`,{key:e,options:t})}hscanStream(e,t){return this.createScanStream(`hscan`,{key:e,options:t})}hscanBufferStream(e,t){return this.createScanStream(`hscanBuffer`,{key:e,options:t})}zscanStream(e,t){return this.createScanStream(`zscan`,{key:e,options:t})}zscanBufferStream(e,t){return this.createScanStream(`zscanBuffer`,{key:e,options:t})}handleError(e,t,n){if(t.value===void 0?t.value=this.options.maxRedirections:--t.value,t.value<=0){n.maxRedirections(Error(`Too many Cluster redirections. Last error: `+e));return}let r=e.message.split(` `);if(r[0]===`MOVED`){let e=this.options.retryDelayOnMoved;e&&typeof e==`number`?this.delayQueue.push(`moved`,n.moved.bind(null,r[1],r[2]),{timeout:e}):n.moved(r[1],r[2])}else r[0]===`ASK`?n.ask(r[1],r[2]):r[0]===`TRYAGAIN`?this.delayQueue.push(`tryagain`,n.tryagain,{timeout:this.options.retryDelayOnTryAgain}):r[0]===`CLUSTERDOWN`&&this.options.retryDelayOnClusterDown>0?this.delayQueue.push(`clusterdown`,n.connectionClosed,{timeout:this.options.retryDelayOnClusterDown,callback:this.refreshSlotsCache.bind(this)}):e.message===u.CONNECTION_CLOSED_ERROR_MSG&&this.options.retryDelayOnFailover>0&&this.status===`ready`?this.delayQueue.push(`failover`,n.connectionClosed,{timeout:this.options.retryDelayOnFailover,callback:this.refreshSlotsCache.bind(this)}):n.defaults()}resetOfflineQueue(){this.offlineQueue=new y}clearNodesRefreshInterval(){this.slotsTimer&&=(clearTimeout(this.slotsTimer),null)}resetNodesRefreshInterval(){if(this.slotsTimer||!this.options.slotsRefreshInterval)return;let e=()=>{this.slotsTimer=setTimeout(()=>{x(`refreshing slot caches... (triggered by "slotsRefreshInterval" option)`),this.refreshSlotsCache(()=>{e()})},this.options.slotsRefreshInterval)};e()}setStatus(e){x(`status: %s -> %s`,this.status||`[empty]`,e),this.status=e,process.nextTick(()=>{this.emit(e)})}handleCloseEvent(e){var t;e&&x(`closed because %s`,e);let n;!this.manuallyClosing&&typeof this.options.clusterRetryStrategy==`function`&&(n=this.options.clusterRetryStrategy.call(this,++this.retryAttempts,e)),typeof n==`number`?(this.setStatus(`reconnecting`),this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,x(`Cluster is disconnected. Retrying after %dms`,n),this.connect().catch(function(e){x(`Got error %s when reconnecting. Ignoring...`,e)})},n)):(this.options.shardedSubscribers&&((t=this.subscriberGroupEmitter)==null||t.removeAllListeners()),this.setStatus(`end`),this.flushQueue(Error(`None of startup nodes is available`)))}flushQueue(e){let t;for(;t=this.offlineQueue.shift();)t.command.reject(e)}executeOfflineCommands(){if(this.offlineQueue.length){x(`send %d commands in offline queue`,this.offlineQueue.length);let e=this.offlineQueue;this.resetOfflineQueue();let t;for(;t=e.shift();)this.sendCommand(t.command,t.stream,t.node)}}natMapper(e){let t=typeof e==`string`?e:`${e.host}:${e.port}`,n=null;return this.options.natMap&&typeof this.options.natMap==`function`?n=this.options.natMap(t):this.options.natMap&&typeof this.options.natMap==`object`&&(n=this.options.natMap[t]),n?(x(`NAT mapping %s -> %O`,t,n),Object.assign({},n)):typeof e==`string`?(0,v.nodeKeyToRedisOptions)(e):e}getInfoFromNode(e,t){if(!e)return t(Error(`Node is disconnected`));let n=e.duplicate({enableOfflineQueue:!0,enableReadyCheck:!1,retryStrategy:null,connectionName:(0,v.getConnectionName)(`refresher`,this.options.redisOptions&&this.options.redisOptions.connectionName)});n.on(`error`,u.noop),n.cluster(`SLOTS`,(0,u.timeout)((e,r)=>{if(n.disconnect(),e)return x(`error encountered running CLUSTER.SLOTS: %s`,e),t(e);if(this.status===`disconnecting`||this.status===`close`||this.status===`end`){x(`ignore CLUSTER.SLOTS results (count: %d) since cluster status is %s`,r.length,this.status),t();return}let i=[];x(`cluster slots result count: %d`,r.length);for(let e=0;e<r.length;++e){let t=r[e],n=t[0],a=t[1],o=[];for(let e=2;e<t.length;e++){if(!t[e][0])continue;let n=this.natMapper({host:t[e][0],port:t[e][1]});n.readOnly=e!==2,i.push(n),o.push(n.host+`:`+n.port)}x(`cluster slots result [%d]: slots %d~%d served by %s`,e,n,a,o);for(let e=n;e<=a;e++)this.slots[e]=o}this._groupsIds=Object.create(null);let a=0;for(let e=0;e<16384;e++){let t=(this.slots[e]||[]).join(`;`);if(!t.length){this._groupsBySlot[e]=void 0;continue}this._groupsIds[t]||(this._groupsIds[t]=++a),this._groupsBySlot[e]=this._groupsIds[t]}this.connectionPool.reset(i),this.options.shardedSubscribers&&this.shardedSubscribers.reset(this.slots,this.connectionPool.getNodes(`all`)).catch(e=>{x(`Error while starting subscribers: %s`,e)}),t()},this.options.slotsRefreshTimeout))}invokeReadyDelayedCallbacks(e){for(let t of this._readyDelayedCallbacks)process.nextTick(t,e);this._readyDelayedCallbacks=[]}readyCheck(e){this.cluster(`INFO`,(t,n)=>{if(t)return e(t);if(typeof n!=`string`)return e();let r,i=n.split(`\r
|
|
235
|
-
`);for(let e=0;e<i.length;++e){let t=i[e].split(`:`);if(t[0]===`cluster_state`){r=t[1];break}}r===`fail`?(x(`cluster state not ok (%s)`,r),e(null,r)):e()})}resolveSrv(e){return new Promise((t,n)=>{this.options.resolveSrv(e,(e,r)=>{if(e)return n(e);let i=this,a=(0,v.groupSrvRecords)(r),o=Object.keys(a).sort((e,t)=>parseInt(e)-parseInt(t));function s(e){if(!o.length)return n(e);let r=a[o[0]],c=(0,v.weightSrvRecords)(r);r.records.length||o.shift(),i.dnsLookup(c.name).then(e=>t({host:e,port:c.port}),s)}s()})})}dnsLookup(e){return new Promise((t,n)=>{this.options.dnsLookup(e,(r,i)=>{r?(x(`failed to resolve hostname %s to IP: %s`,e,r.message),n(r)):(x(`resolved hostname %s to IP %s`,e,i),t(i))})})}async resolveStartupNodeHostnames(){if(!Array.isArray(this.startupNodes)||this.startupNodes.length===0)throw Error("`startupNodes` should contain at least one node.");let e=(0,v.normalizeNodeOptions)(this.startupNodes),t=(0,v.getUniqueHostnamesFromOptions)(e);if(t.length===0)return e;let n=await Promise.all(t.map((this.options.useSRVRecords?this.resolveSrv:this.dnsLookup).bind(this))),r=(0,u.zipMap)(t,n);return e.map(e=>{let t=r.get(e.host);return t?this.options.useSRVRecords?Object.assign({},e,t):Object.assign({},e,{host:t}):e})}createScanStream(e,{key:t,options:n={}}){return new c.default({objectMode:!0,key:t,redis:this,command:e,...n})}createShardedSubscriberGroup(){this.subscriberGroupEmitter=new n.EventEmitter,this.shardedSubscribers=new b.default(this.subscriberGroupEmitter,this.options);let e=e=>{e instanceof o.default&&this.disconnect(!0)};this.subscriberGroupEmitter.on(`-node`,(t,n)=>{this.emit(`-node`,t,n),this.refreshSlotsCache(e)}),this.subscriberGroupEmitter.on(`subscriberConnectFailed`,({delay:t,error:n})=>{this.emit(`error`,n),setTimeout(()=>{this.refreshSlotsCache(e)},t)}),this.subscriberGroupEmitter.on(`moved`,()=>{this.refreshSlotsCache(e)}),this.subscriberGroupEmitter.on(`-subscriber`,()=>{this.emit(`-subscriber`)}),this.subscriberGroupEmitter.on(`+subscriber`,()=>{this.emit(`+subscriber`)}),this.subscriberGroupEmitter.on(`nodeError`,(e,t)=>{this.emit(`nodeError`,e,t)}),this.subscriberGroupEmitter.on(`subscribersReady`,()=>{this.emit(`subscribersReady`)});for(let e of[`smessage`,`smessageBuffer`])this.subscriberGroupEmitter.on(e,(t,n,r)=>{this.emit(e,t,n,r)})}};(0,d.default)(C,n.EventEmitter),(0,l.addTransactionSupport)(C.prototype),e.default=C})),FF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(0,hF().Debug)(`AbstractConnector`);e.default=class{constructor(e){this.connecting=!1,this.disconnectTimeout=e}check(e){return!0}disconnect(){if(this.connecting=!1,this.stream){let e=this.stream,n=setTimeout(()=>{t(`stream %s:%s still open, destroying it`,e.remoteAddress,e.remotePort),e.destroy()},this.disconnectTimeout);e.on(`close`,()=>clearTimeout(n)),e.end()}}}})),IF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`net`),n=h(`tls`),r=hF(),i=FF();e.default=class extends i.default{constructor(e){super(e.disconnectTimeout),this.options=e}connect(e){let{options:i}=this;this.connecting=!0;let a;return`path`in i&&i.path?a={path:i.path}:(a={},`port`in i&&i.port!=null&&(a.port=i.port),`host`in i&&i.host!=null&&(a.host=i.host),`family`in i&&i.family!=null&&(a.family=i.family)),i.tls&&Object.assign(a,i.tls),new Promise((e,o)=>{process.nextTick(()=>{if(!this.connecting){o(Error(r.CONNECTION_CLOSED_ERROR_MSG));return}try{i.tls?this.stream=(0,n.connect)(a):this.stream=(0,t.createConnection)(a)}catch(e){o(e);return}this.stream.once(`error`,e=>{this.firstError=e}),e(this.stream)})})}}})),LF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){return(e.host||`127.0.0.1`)===(t.host||`127.0.0.1`)&&(e.port||26379)===(t.port||26379)}e.default=class{constructor(e){this.cursor=0,this.sentinels=e.slice(0)}next(){let e=this.cursor>=this.sentinels.length;return{done:e,value:e?void 0:this.sentinels[this.cursor++]}}reset(e){e&&this.sentinels.length>1&&this.cursor!==1&&this.sentinels.unshift(...this.sentinels.splice(this.cursor-1)),this.cursor=0}add(e){for(let n=0;n<this.sentinels.length;n++)if(t(e,this.sentinels[n]))return!1;return this.sentinels.push(e),!0}toString(){return`${JSON.stringify(this.sentinels)} @${this.cursor}`}}})),RF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FailoverDetector=void 0;let t=(0,hF().Debug)(`FailoverDetector`),n=`+switch-master`;e.FailoverDetector=class{constructor(e,t){this.isDisconnected=!1,this.connector=e,this.sentinels=t}cleanup(){this.isDisconnected=!0;for(let e of this.sentinels)e.client.disconnect()}async subscribe(){t(`Starting FailoverDetector`);let e=[];for(let r of this.sentinels){let i=r.client.subscribe(n).catch(e=>{t(`Failed to subscribe to failover messages on sentinel %s:%s (%s)`,r.address.host||`127.0.0.1`,r.address.port||26739,e.message)});e.push(i),r.client.on(`message`,e=>{!this.isDisconnected&&e===n&&this.disconnect()})}await Promise.all(e)}disconnect(){this.isDisconnected=!0,t(`Failover detected, disconnecting`),this.connector.disconnect()}}})),zF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SentinelIterator=void 0;let t=h(`net`),n=hF(),r=h(`tls`),i=LF();e.SentinelIterator=i.default;let a=FF(),o=YF(),s=RF(),c=(0,n.Debug)(`SentinelConnector`);e.default=class extends a.default{constructor(e){if(super(e.disconnectTimeout),this.options=e,this.emitter=null,this.failoverDetector=null,!this.options.sentinels.length)throw Error(`Requires at least one sentinel to connect to.`);if(!this.options.name)throw Error(`Requires the name of master.`);this.sentinelIterator=new i.default(this.options.sentinels)}check(e){let t=!e.role||this.options.role===e.role;return t||(c(`role invalid, expected %s, but got %s`,this.options.role,e.role),this.sentinelIterator.next(),this.sentinelIterator.next(),this.sentinelIterator.reset(!0)),t}disconnect(){super.disconnect(),this.failoverDetector&&this.failoverDetector.cleanup()}connect(e){this.connecting=!0,this.retryAttempts=0;let i,a=async()=>{let o=this.sentinelIterator.next();if(o.done){this.sentinelIterator.reset(!1);let t=typeof this.options.sentinelRetryStrategy==`function`?this.options.sentinelRetryStrategy(++this.retryAttempts):null,n=typeof t==`number`?`All sentinels are unreachable. Retrying from scratch after ${t}ms.`:`All sentinels are unreachable and retry is disabled.`;i&&(n+=` Last error: ${i.message}`),c(n);let r=Error(n);if(typeof t==`number`)return e(`error`,r),await new Promise(e=>setTimeout(e,t)),a();throw r}let s=null,l=null;try{s=await this.resolve(o.value)}catch(e){l=e}if(!this.connecting)throw Error(n.CONNECTION_CLOSED_ERROR_MSG);let u=o.value.host+`:`+o.value.port;if(s)return c(`resolved: %s:%s from sentinel %s`,s.host,s.port,u),this.options.enableTLSForSentinelMode&&this.options.tls?(Object.assign(s,this.options.tls),this.stream=(0,r.connect)(s),this.stream.once(`secureConnect`,this.initFailoverDetector.bind(this))):(this.stream=(0,t.createConnection)(s),this.stream.once(`connect`,this.initFailoverDetector.bind(this))),this.stream.once(`error`,e=>{this.firstError=e}),this.stream;{let t=l?`failed to connect to sentinel `+u+` because `+l.message:`connected to sentinel `+u+` successfully, but got an invalid reply: `+s;return c(t),e(`sentinelError`,Error(t)),l&&(i=l),a()}};return a()}async updateSentinels(e){if(!this.options.updateSentinels)return;let t=await e.sentinel(`sentinels`,this.options.name);Array.isArray(t)&&(t.map(n.packObject).forEach(e=>{if((e.flags?e.flags.split(`,`):[]).indexOf(`disconnected`)===-1&&e.ip&&e.port){let t=this.sentinelNatResolve(u(e));this.sentinelIterator.add(t)&&c(`adding sentinel %s:%s`,t.host,t.port)}}),c(`Updated internal sentinels: %s`,this.sentinelIterator))}async resolveMaster(e){let t=await e.sentinel(`get-master-addr-by-name`,this.options.name);return await this.updateSentinels(e),this.sentinelNatResolve(Array.isArray(t)?{host:t[0],port:Number(t[1])}:null)}async resolveSlave(e){let t=await e.sentinel(`slaves`,this.options.name);if(!Array.isArray(t))return null;let r=t.map(n.packObject).filter(e=>e.flags&&!e.flags.match(/(disconnected|s_down|o_down)/));return this.sentinelNatResolve(l(r,this.options.preferredSlaves))}sentinelNatResolve(e){if(!e||!this.options.natMap)return e;let t=`${e.host}:${e.port}`,n=e;return typeof this.options.natMap==`function`?n=this.options.natMap(t)||e:typeof this.options.natMap==`object`&&(n=this.options.natMap[t]||e),n}connectToSentinel(e,t){return new o.default({port:e.port||26379,host:e.host,username:this.options.sentinelUsername||null,password:this.options.sentinelPassword||null,family:e.family||(`path`in this.options&&this.options.path?void 0:this.options.family),tls:this.options.sentinelTLS,retryStrategy:null,enableReadyCheck:!1,connectTimeout:this.options.connectTimeout,commandTimeout:this.options.sentinelCommandTimeout,...t})}async resolve(e){let t=this.connectToSentinel(e);t.on(`error`,d);try{return this.options.role===`slave`?await this.resolveSlave(t):await this.resolveMaster(t)}finally{t.disconnect()}}async initFailoverDetector(){var e;if(!this.options.failoverDetector)return;this.sentinelIterator.reset(!0);let t=[];for(;t.length<this.options.sentinelMaxConnections;){let{done:e,value:n}=this.sentinelIterator.next();if(e)break;let r=this.connectToSentinel(n,{lazyConnect:!0,retryStrategy:this.options.sentinelReconnectStrategy});r.on(`reconnecting`,()=>{var e;(e=this.emitter)==null||e.emit(`sentinelReconnecting`)}),t.push({address:n,client:r})}this.sentinelIterator.reset(!1),this.failoverDetector&&this.failoverDetector.cleanup(),this.failoverDetector=new s.FailoverDetector(this,t),await this.failoverDetector.subscribe(),(e=this.emitter)==null||e.emit(`failoverSubscribed`)}};function l(e,t){if(e.length===0)return null;let r;if(typeof t==`function`)r=t(e);else if(typeof t==`object`&&t){let n=Array.isArray(t)?t:[t];n.sort((e,t)=>(e.prio||=1,t.prio||=1,e.prio<t.prio?-1:e.prio>t.prio?1:0));for(let t=0;t<n.length;t++){for(let i=0;i<e.length;i++){let a=e[i];if(a.ip===n[t].ip&&a.port===n[t].port){r=a;break}}if(r)break}}return r||=(0,n.sample)(e),u(r)}function u(e){return{host:e.ip,port:Number(e.port)}}function d(){}})),BF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SentinelConnector=e.StandaloneConnector=void 0,e.StandaloneConnector=IF().default,e.SentinelConnector=zF().default})),VF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=rF();e.default=class extends t.AbortError{constructor(e){let t=`Reached the max retries per request limit (which is ${e}). Refer to "maxRetriesPerRequest" option for details.`;super(t),Error.captureStackTrace(this,this.constructor)}get name(){return this.constructor.name}}})),HF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MaxRetriesPerRequestError=void 0,e.MaxRetriesPerRequestError=VF().default})),UF=u(((e,t)=>{let n=h(`buffer`).Buffer,r=h(`string_decoder`).StringDecoder,i=new r,a=rF(),o=a.ReplyError,s=a.ParserError;var c=n.allocUnsafe(32*1024),l=0,u=null,d=0,f=0;function p(e){let t=e.buffer.length-1;var n=e.offset,r=0,i=1;for(e.buffer[n]===45&&(i=-1,n++);n<t;){let t=e.buffer[n++];if(t===13)return e.offset=n+1,i*r;r=r*10+(t-48)}}function m(e){let t=e.buffer.length-1;var n=e.offset,r=0,i=``;for(e.buffer[n]===45&&(i+=`-`,n++);n<t;){var a=e.buffer[n++];if(a===13)return e.offset=n+1,r!==0&&(i+=r),i;r>429496728?(i+=r*10+(a-48),r=0):a===48&&r===0?i+=0:r=r*10+(a-48)}}function g(e){let t=e.offset,n=e.buffer,r=n.length-1;for(var i=t;i<r;)if(n[i++]===13)return e.offset=i+1,e.optionReturnBuffers===!0?e.buffer.slice(t,i-1):e.buffer.toString(`utf8`,t,i-1)}function _(e){let t=e.buffer.length-1;for(var n=e.offset,r=0;n<t;){let t=e.buffer[n++];if(t===13)return e.offset=n+1,r;r=r*10+(t-48)}}function v(e){return e.optionStringNumbers===!0?m(e):p(e)}function y(e){let t=_(e);if(t===void 0)return;if(t<0)return null;let n=e.offset+t;if(n+2>e.buffer.length){e.bigStrSize=n+2,e.totalChunkSize=e.buffer.length,e.bufferCache.push(e.buffer);return}let r=e.offset;return e.offset=n+2,e.optionReturnBuffers===!0?e.buffer.slice(r,n):e.buffer.toString(`utf8`,r,n)}function b(e){var t=g(e);if(t!==void 0)return e.optionReturnBuffers===!0&&(t=t.toString()),new o(t)}function x(e,t){let n=new s(`Protocol error, got `+JSON.stringify(String.fromCharCode(t))+` as reply type byte`,JSON.stringify(e.buffer),e.offset);e.buffer=null,e.returnFatalError(n)}function S(e){let t=_(e);if(t!==void 0)return t<0?null:ee(e,Array(t),0)}function C(e,t,n){e.arrayCache.push(t),e.arrayPos.push(n)}function w(e){let t=e.arrayCache.pop();var n=e.arrayPos.pop();if(e.arrayCache.length){let r=w(e);if(r===void 0){C(e,t,n);return}t[n++]=r}return ee(e,t,n)}function ee(e,t,n){let r=e.buffer.length;for(;n<t.length;){let i=e.offset;if(e.offset>=r){C(e,t,n);return}let a=te(e,e.buffer[e.offset++]);if(a===void 0){e.arrayCache.length||e.bufferCache.length||(e.offset=i),C(e,t,n);return}t[n]=a,n++}return t}function te(e,t){switch(t){case 36:return y(e);case 43:return g(e);case 42:return S(e);case 58:return v(e);case 45:return b(e);default:return x(e,t)}}function T(){if(c.length>50*1024)if(d===1||f>d*2){let e=Math.floor(c.length/10),t=e<l?l:e;l=0,c=c.slice(t,c.length)}else f++,d--;else clearInterval(u),d=0,f=0,u=null}function E(e){if(c.length<e+l){let t=e>1024*1024*75?2:3;l>1024*1024*111&&(l=1024*1024*50),c=n.allocUnsafe(e*t+l),l=0,d++,u===null&&(u=setInterval(T,50))}}function ne(e){let t=e.bufferCache,n=e.offset;var r=t.length,a=e.bigStrSize-e.totalChunkSize;if(e.offset=a,a<=2){if(r===2)return t[0].toString(`utf8`,n,t[0].length+a-2);r--,a=t[t.length-2].length+a}for(var o=i.write(t[0].slice(n)),s=1;s<r-1;s++)o+=i.write(t[s]);return o+=i.end(t[s].slice(0,a-2)),o}function re(e){let t=e.bufferCache,n=e.offset,r=e.bigStrSize-n-2;var i=t.length,a=e.bigStrSize-e.totalChunkSize;if(e.offset=a,a<=2){if(i===2)return t[0].slice(n,t[0].length+a-2);i--,a=t[t.length-2].length+a}E(r);let o=l;t[0].copy(c,o,n,t[0].length),l+=t[0].length-n;for(var s=1;s<i-1;s++)t[s].copy(c,l),l+=t[s].length;return t[s].copy(c,l,0,a-2),l+=a-2,c.slice(o,l)}t.exports=class{constructor(e){if(!e)throw TypeError(`Options are mandatory.`);if(typeof e.returnError!=`function`||typeof e.returnReply!=`function`)throw TypeError(`The returnReply and returnError options have to be functions.`);this.setReturnBuffers(!!e.returnBuffers),this.setStringNumbers(!!e.stringNumbers),this.returnError=e.returnError,this.returnFatalError=e.returnFatalError||e.returnError,this.returnReply=e.returnReply,this.reset()}reset(){this.offset=0,this.buffer=null,this.bigStrSize=0,this.totalChunkSize=0,this.bufferCache=[],this.arrayCache=[],this.arrayPos=[]}setReturnBuffers(e){if(typeof e!=`boolean`)throw TypeError(`The returnBuffers argument has to be a boolean`);this.optionReturnBuffers=e}setStringNumbers(e){if(typeof e!=`boolean`)throw TypeError(`The stringNumbers argument has to be a boolean`);this.optionStringNumbers=e}execute(e){if(this.buffer===null)this.buffer=e,this.offset=0;else if(this.bigStrSize===0){let t=this.buffer.length,r=t-this.offset,i=n.allocUnsafe(r+e.length);if(this.buffer.copy(i,0,this.offset,t),e.copy(i,r,0,e.length),this.buffer=i,this.offset=0,this.arrayCache.length){let e=w(this);if(e===void 0)return;this.returnReply(e)}}else if(this.totalChunkSize+e.length>=this.bigStrSize){this.bufferCache.push(e);var t=this.optionReturnBuffers?re(this):ne(this);if(this.bigStrSize=0,this.bufferCache=[],this.buffer=e,this.arrayCache.length&&(this.arrayCache[0][this.arrayPos[0]++]=t,t=w(this),t===void 0))return;this.returnReply(t)}else{this.bufferCache.push(e),this.totalChunkSize+=e.length;return}for(;this.offset<this.buffer.length;){let e=this.offset,t=this.buffer[this.offset++],n=te(this,t);if(n===void 0){this.arrayCache.length||this.bufferCache.length||(this.offset=e);return}t===45?this.returnError(n):this.returnReply(n)}this.buffer=null}}})),WF=u(((e,t)=>{t.exports=UF()})),GF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class{constructor(){this.set={subscribe:{},psubscribe:{},ssubscribe:{}}}add(e,n){this.set[t(e)][n]=!0}del(e,n){delete this.set[t(e)][n]}channels(e){return Object.keys(this.set[t(e)])}isEmpty(){return this.channels(`subscribe`).length===0&&this.channels(`psubscribe`).length===0&&this.channels(`ssubscribe`).length===0}};function t(e){return e===`unsubscribe`?`subscribe`:e===`punsubscribe`?`psubscribe`:e===`sunsubscribe`?`ssubscribe`:e}})),KF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=_F(),n=hF(),r=WF(),i=GF(),a=(0,n.Debug)(`dataHandler`);e.default=class{constructor(e,t){this.redis=e;let n=new r({stringNumbers:t.stringNumbers,returnBuffers:!0,returnError:e=>{this.returnError(e)},returnFatalError:e=>{this.returnFatalError(e)},returnReply:e=>{this.returnReply(e)}});e.stream.prependListener(`data`,e=>{n.execute(e)}),e.stream.resume()}returnFatalError(e){e.message+=`. Please report this.`,this.redis.recoverFromFatalError(e,e,{offlineQueue:!1})}returnError(e){let t=this.shiftCommand(e);if(t){if(e.command={name:t.command.name,args:t.command.args},t.command.name==`ssubscribe`&&e.message.includes(`MOVED`)){this.redis.emit(`moved`);return}this.redis.handleReconnection(e,t)}}returnReply(e){if(this.handleMonitorReply(e)||this.handleSubscriberReply(e))return;let n=this.shiftCommand(e);n&&(t.default.checkFlag(`ENTER_SUBSCRIBER_MODE`,n.command.name)?(this.redis.condition.subscriber=new i.default,this.redis.condition.subscriber.add(n.command.name,e[1].toString()),s(n.command,e[2])||this.redis.commandQueue.unshift(n)):t.default.checkFlag(`EXIT_SUBSCRIBER_MODE`,n.command.name)?c(n.command,e[2])||this.redis.commandQueue.unshift(n):n.command.resolve(e))}handleSubscriberReply(e){if(!this.redis.condition.subscriber)return!1;let t=Array.isArray(e)?e[0].toString():null;switch(a(`receive reply "%s" in subscriber mode`,t),t){case`message`:this.redis.listeners(`message`).length>0&&this.redis.emit(`message`,e[1].toString(),e[2]?e[2].toString():``),this.redis.emit(`messageBuffer`,e[1],e[2]);break;case`pmessage`:{let t=e[1].toString();this.redis.listeners(`pmessage`).length>0&&this.redis.emit(`pmessage`,t,e[2].toString(),e[3].toString()),this.redis.emit(`pmessageBuffer`,t,e[2],e[3]);break}case`smessage`:this.redis.listeners(`smessage`).length>0&&this.redis.emit(`smessage`,e[1].toString(),e[2]?e[2].toString():``),this.redis.emit(`smessageBuffer`,e[1],e[2]);break;case`ssubscribe`:case`subscribe`:case`psubscribe`:{let n=e[1].toString();this.redis.condition.subscriber.add(t,n);let r=this.shiftCommand(e);if(!r)return;s(r.command,e[2])||this.redis.commandQueue.unshift(r);break}case`sunsubscribe`:case`unsubscribe`:case`punsubscribe`:{let n=e[1]?e[1].toString():null;n&&this.redis.condition.subscriber.del(t,n);let r=e[2];Number(r)===0&&(this.redis.condition.subscriber=!1);let i=this.shiftCommand(e);if(!i)return;c(i.command,r)||this.redis.commandQueue.unshift(i);break}default:{let t=this.shiftCommand(e);if(!t)return;t.command.resolve(e)}}return!0}handleMonitorReply(e){if(this.redis.status!==`monitoring`)return!1;let t=e.toString();if(t===`OK`)return!1;let n=t.indexOf(` `),r=t.slice(0,n),i=t.indexOf(`"`),a=t.slice(i+1,-1).split(`" "`).map(e=>e.replace(/\\"/g,`"`)),o=t.slice(n+2,i-2).split(` `);return this.redis.emit(`monitor`,r,a,o[1],o[0]),!0}shiftCommand(e){let t=this.redis.commandQueue.shift();if(!t){let t=Error(`Command queue state error. If you can reproduce this, please report it.`+(e instanceof Error?` Last error: ${e.message}`:` Last reply: ${e.toString()}`));return this.redis.emit(`error`,t),null}return t}};let o=new WeakMap;function s(e,t){let n=o.has(e)?o.get(e):e.args.length;return--n,n<=0?(e.resolve(t),o.delete(e),!0):(o.set(e,n),!1)}function c(e,t){let n=o.has(e)?o.get(e):e.args.length;return n===0?Number(t)===0?(o.delete(e),e.resolve(t),!0):!1:(--n,n<=0?(e.resolve(t),!0):(o.set(e,n),!1))}})),qF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readyHandler=e.errorHandler=e.closeHandler=e.connectHandler=void 0;let t=rF(),n=_F(),r=HF(),i=hF(),a=KF(),o=(0,i.Debug)(`connection`);function s(t){return function(){t.setStatus(`connect`),t.resetCommandQueue();let n=!1,{connectionEpoch:r}=t;t.condition.auth&&t.auth(t.condition.auth,function(e){r===t.connectionEpoch&&e&&(e.message.indexOf(`no password is set`)===-1?e.message.indexOf(`without any password configured for the default user`)===-1?e.message.indexOf(`wrong number of arguments for 'auth' command`)===-1?(n=!0,t.recoverFromFatalError(e,e)):console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`):console.warn("[WARN] This Redis server's `default` user does not require a password, but a password was supplied"):console.warn(`[WARN] Redis server does not require a password, but a password was supplied.`))}),t.condition.select&&t.select(t.condition.select).catch(e=>{t.silentEmit(`error`,e)}),new a.default(t,{stringNumbers:t.options.stringNumbers});let s=[];t.options.connectionName&&(o(`set the connection name [%s]`,t.options.connectionName),s.push(t.client(`setname`,t.options.connectionName).catch(i.noop))),t.options.disableClientInfo||(o(`set the client info`),s.push((0,i.getPackageMeta)().then(e=>t.client(`SETINFO`,`LIB-VER`,e.version).catch(i.noop)).catch(i.noop)),s.push(t.client(`SETINFO`,`LIB-NAME`,t.options?.clientInfoTag?`ioredis(${t.options.clientInfoTag})`:`ioredis`).catch(i.noop))),Promise.all(s).catch(i.noop).finally(()=>{t.options.enableReadyCheck||e.readyHandler(t)(),t.options.enableReadyCheck&&t._readyCheck(function(i,a){r===t.connectionEpoch&&(i?n||t.recoverFromFatalError(Error(`Ready check failed: `+i.message),i):t.connector.check(a)?e.readyHandler(t)():t.disconnect(!0))})})}}e.connectHandler=s;function c(e){let n=new t.AbortError(`Command aborted due to connection close`);return n.command={name:e.name,args:e.args},n}function l(e){let t=0;for(let n=0;n<e.length;){let r=e.peekAt(n)?.command,i=r.pipelineIndex;if((i===void 0||i===0)&&(t=0),i!==void 0&&i!==t++){e.remove(n,1),r.reject(c(r));continue}n++}}function u(e){for(let t=0;t<e.length;){let n=e.peekAt(t)?.command;if(n.name===`multi`)break;if(n.name===`exec`){e.remove(t,1),n.reject(c(n));break}n.inTransaction?(e.remove(t,1),n.reject(c(n))):t++}}function d(e){return function(){let n=e.status;if(e.setStatus(`close`),e.commandQueue.length&&l(e.commandQueue),e.offlineQueue.length&&u(e.offlineQueue),n===`ready`&&(e.prevCondition||=e.condition,e.commandQueue.length&&(e.prevCommandQueue=e.commandQueue)),e.manuallyClosing)return e.manuallyClosing=!1,o(`skip reconnecting since the connection is manually closed.`),t();if(typeof e.options.retryStrategy!=`function`)return o("skip reconnecting because `retryStrategy` is not a function"),t();let a=e.options.retryStrategy(++e.retryAttempts);if(typeof a!=`number`)return o("skip reconnecting because `retryStrategy` doesn't return a number"),t();o(`reconnect in %sms`,a),e.setStatus(`reconnecting`,a),e.reconnectTimeout=setTimeout(function(){e.reconnectTimeout=null,e.connect().catch(i.noop)},a);let{maxRetriesPerRequest:s}=e.options;typeof s==`number`&&(s<0?o(`maxRetriesPerRequest is negative, ignoring...`):e.retryAttempts%(s+1)===0&&(o(`reach maxRetriesPerRequest limitation, flushing command queue...`),e.flushQueue(new r.MaxRetriesPerRequestError(s))))};function t(){e.setStatus(`end`),e.flushQueue(Error(i.CONNECTION_CLOSED_ERROR_MSG))}}e.closeHandler=d;function f(e){return function(t){o(`error: %s`,t),e.silentEmit(`error`,t)}}e.errorHandler=f;function p(e){return function(){if(e.setStatus(`ready`),e.retryAttempts=0,e.options.monitor){e.call(`monitor`).then(()=>e.setStatus(`monitoring`),t=>e.emit(`error`,t));let{sendCommand:t}=e;e.sendCommand=function(r){return n.default.checkFlag(`VALID_IN_MONITOR_MODE`,r.name)?t.call(e,r):(r.reject(Error(`Connection is in monitoring mode, can't process commands.`)),r.promise)},e.once(`close`,function(){delete e.sendCommand});return}let t=e.prevCondition?e.prevCondition.select:e.condition.select;if(e.options.readOnly&&(o(`set the connection to readonly mode`),e.readonly().catch(i.noop)),e.prevCondition){let n=e.prevCondition;if(e.prevCondition=null,n.subscriber&&e.options.autoResubscribe){e.condition.select!==t&&(o(`connect to db [%d]`,t),e.select(t));let r=n.subscriber.channels(`subscribe`);r.length&&(o(`subscribe %d channels`,r.length),e.subscribe(r));let i=n.subscriber.channels(`psubscribe`);i.length&&(o(`psubscribe %d channels`,i.length),e.psubscribe(i));let a=n.subscriber.channels(`ssubscribe`);if(a.length){o(`ssubscribe %s`,a.length);for(let t of a)e.ssubscribe(t)}}}if(e.prevCommandQueue)if(e.options.autoResendUnfulfilledCommands)for(o(`resend %d unfulfilled commands`,e.prevCommandQueue.length);e.prevCommandQueue.length>0;){let t=e.prevCommandQueue.shift();t.select!==e.condition.select&&t.command.name!==`select`&&e.select(t.select),e.sendCommand(t.command,t.stream)}else e.prevCommandQueue=null;if(e.offlineQueue.length){o(`send %d commands in offline queue`,e.offlineQueue.length);let t=e.offlineQueue;for(e.resetOfflineQueue();t.length>0;){let n=t.shift();n.select!==e.condition.select&&n.command.name!==`select`&&e.select(n.select),e.sendCommand(n.command,n.stream)}}e.condition.select!==t&&(o(`connect to db [%d]`,t),e.select(t))}}e.readyHandler=p})),JF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_REDIS_OPTIONS=void 0,e.DEFAULT_REDIS_OPTIONS={port:6379,host:`localhost`,family:0,connectTimeout:1e4,disconnectTimeout:2e3,retryStrategy:function(e){return Math.min(e*50,2e3)},keepAlive:0,noDelay:!0,connectionName:null,disableClientInfo:!1,clientInfoTag:void 0,sentinels:null,name:null,role:`master`,sentinelRetryStrategy:function(e){return Math.min(e*10,1e3)},sentinelReconnectStrategy:function(){return 6e4},natMap:null,enableTLSForSentinelMode:!1,updateSentinels:!0,failoverDetector:!1,username:null,password:null,db:0,enableOfflineQueue:!0,enableReadyCheck:!0,autoResubscribe:!0,autoResendUnfulfilledCommands:!0,lazyConnect:!1,keyPrefix:``,reconnectOnError:null,readOnly:!1,stringNumbers:!1,maxRetriesPerRequest:20,maxLoadingRetryTime:1e4,enableAutoPipelining:!1,autoPipeliningIgnoredCommands:[],sentinelMaxConnections:10,blockingTimeoutGrace:100}})),YF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=QP(),n=h(`events`),r=eF(),i=PF(),a=_F(),o=BF(),s=zF(),c=qF(),l=JF(),u=yF(),d=wF(),f=hF(),p=TF(),m=SF(),g=sF(),_=AF(),v=(0,f.Debug)(`redis`);var y=class e extends m.default{constructor(e,t,r){if(super(),this.status=`wait`,this.isCluster=!1,this.reconnectTimeout=null,this.connectionEpoch=0,this.retryAttempts=0,this.manuallyClosing=!1,this._autoPipelines=new Map,this._runningAutoPipelines=new Set,this.parseOptions(e,t,r),n.EventEmitter.call(this),this.resetCommandQueue(),this.resetOfflineQueue(),this.options.Connector)this.connector=new this.options.Connector(this.options);else if(this.options.sentinels){let e=new s.default(this.options);e.emitter=this,this.connector=e}else this.connector=new o.StandaloneConnector(this.options);this.options.scripts&&Object.entries(this.options.scripts).forEach(([e,t])=>{this.defineCommand(e,t)}),this.options.lazyConnect?this.setStatus(`wait`):this.connect().catch(g.noop)}static createClient(...t){return new e(...t)}get autoPipelineQueueSize(){let e=0;for(let t of this._autoPipelines.values())e+=t.length;return e}connect(e){let t=new Promise((e,t)=>{if(this.status===`connecting`||this.status===`connect`||this.status===`ready`){t(Error(`Redis is already connecting/connected`));return}this.connectionEpoch+=1,this.setStatus(`connecting`);let{options:n}=this;this.condition={select:n.db,auth:n.username?[n.username,n.password]:n.password,subscriber:!1};let i=this;(0,r.default)(this.connector.connect(function(e,t){i.silentEmit(e,t)}),function(r,a){if(r){i.flushQueue(r),i.silentEmit(`error`,r),t(r),i.setStatus(`end`);return}let o=n.tls?`secureConnect`:`connect`;if(`sentinels`in n&&n.sentinels&&!n.enableTLSForSentinelMode&&(o=`connect`),i.stream=a,n.noDelay&&a.setNoDelay(!0),typeof n.keepAlive==`number`&&(a.connecting?a.once(o,()=>{a.setKeepAlive(!0,n.keepAlive)}):a.setKeepAlive(!0,n.keepAlive)),a.connecting){if(a.once(o,c.connectHandler(i)),n.connectTimeout){let e=!1;a.setTimeout(n.connectTimeout,function(){if(e)return;a.setTimeout(0),a.destroy();let t=Error(`connect ETIMEDOUT`);t.errorno=`ETIMEDOUT`,t.code=`ETIMEDOUT`,t.syscall=`connect`,c.errorHandler(i)(t)}),a.once(o,function(){e=!0,a.setTimeout(0)})}}else if(a.destroyed){let e=i.connector.firstError;e&&process.nextTick(()=>{c.errorHandler(i)(e)}),process.nextTick(c.closeHandler(i))}else process.nextTick(c.connectHandler(i));a.destroyed||(a.once(`error`,c.errorHandler(i)),a.once(`close`,c.closeHandler(i)));let s=function(){i.removeListener(`close`,l),e()};var l=function(){i.removeListener(`ready`,s),t(Error(f.CONNECTION_CLOSED_ERROR_MSG))};i.once(`ready`,s),i.once(`close`,l)})});return(0,r.default)(t,e)}disconnect(e=!1){e||(this.manuallyClosing=!0),this.reconnectTimeout&&!e&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.status===`wait`?c.closeHandler(this)():this.connector.disconnect()}end(){this.disconnect()}duplicate(t){return new e({...this.options,...t})}get mode(){return this.options.monitor?`monitor`:this.condition?.subscriber?`subscriber`:`normal`}monitor(e){let t=this.duplicate({monitor:!0,lazyConnect:!1});return(0,r.default)(new Promise(function(e,n){t.once(`error`,n),t.once(`monitoring`,function(){e(t)})}),e)}sendCommand(e,n){if(this.status===`wait`&&this.connect().catch(g.noop),this.status===`end`)return e.reject(Error(f.CONNECTION_CLOSED_ERROR_MSG)),e.promise;if(this.condition?.subscriber&&!a.default.checkFlag(`VALID_IN_SUBSCRIBER_MODE`,e.name))return e.reject(Error(`Connection in subscriber mode, only subscriber commands may be used`)),e.promise;typeof this.options.commandTimeout==`number`&&e.setTimeout(this.options.commandTimeout);let r=this.getBlockingTimeoutInMs(e),i=this.status===`ready`||!n&&this.status===`connect`&&(0,t.exists)(e.name,{caseInsensitive:!0})&&((0,t.hasFlag)(e.name,`loading`,{nameCaseInsensitive:!0})||a.default.checkFlag(`HANDSHAKE_COMMANDS`,e.name));if(this.stream&&this.stream.writable?this.stream._writableState&&this.stream._writableState.ended&&(i=!1):i=!1,i)v.enabled&&v(`write command[%s]: %d -> %s(%o)`,this._getDescription(),this.condition?.select,e.name,e.args),n?`isPipeline`in n&&n.isPipeline?n.write(e.toWritable(n.destination.redis.stream)):n.write(e.toWritable(n)):this.stream.write(e.toWritable(this.stream)),this.commandQueue.push({command:e,stream:n,select:this.condition.select}),r!==void 0&&e.setBlockingTimeout(r),a.default.checkFlag(`WILL_DISCONNECT`,e.name)&&(this.manuallyClosing=!0),this.options.socketTimeout!==void 0&&this.socketTimeoutTimer===void 0&&this.setSocketTimeout();else{if(!this.options.enableOfflineQueue)return e.reject(Error(`Stream isn't writeable and enableOfflineQueue options is false`)),e.promise;if(e.name===`quit`&&this.offlineQueue.length===0)return this.disconnect(),e.resolve(Buffer.from(`OK`)),e.promise;if(v.enabled&&v(`queue command[%s]: %d -> %s(%o)`,this._getDescription(),this.condition.select,e.name,e.args),this.offlineQueue.push({command:e,stream:n,select:this.condition.select}),a.default.checkFlag(`BLOCKING_COMMANDS`,e.name)){let t=this.getConfiguredBlockingTimeout();t!==void 0&&e.setBlockingTimeout(t)}}if(e.name===`select`&&(0,f.isInt)(e.args[0])){let t=parseInt(e.args[0],10);this.condition.select!==t&&(this.condition.select=t,this.emit(`select`,t),v(`switch to db [%d]`,this.condition.select))}return e.promise}getBlockingTimeoutInMs(e){if(!a.default.checkFlag(`BLOCKING_COMMANDS`,e.name))return;let t=this.getConfiguredBlockingTimeout();if(t===void 0)return;let n=e.extractBlockingTimeout();if(typeof n==`number`)return n>0?n+(this.options.blockingTimeoutGrace??l.DEFAULT_REDIS_OPTIONS.blockingTimeoutGrace):t;if(n===null)return t}getConfiguredBlockingTimeout(){if(typeof this.options.blockingTimeout==`number`&&this.options.blockingTimeout>0)return this.options.blockingTimeout}setSocketTimeout(){this.socketTimeoutTimer=setTimeout(()=>{this.stream.destroy(Error(`Socket timeout. Expecting data, but didn't receive any in ${this.options.socketTimeout}ms.`)),this.socketTimeoutTimer=void 0},this.options.socketTimeout),this.stream.once(`data`,()=>{clearTimeout(this.socketTimeoutTimer),this.socketTimeoutTimer=void 0,this.commandQueue.length!==0&&this.setSocketTimeout()})}scanStream(e){return this.createScanStream(`scan`,{options:e})}scanBufferStream(e){return this.createScanStream(`scanBuffer`,{options:e})}sscanStream(e,t){return this.createScanStream(`sscan`,{key:e,options:t})}sscanBufferStream(e,t){return this.createScanStream(`sscanBuffer`,{key:e,options:t})}hscanStream(e,t){return this.createScanStream(`hscan`,{key:e,options:t})}hscanBufferStream(e,t){return this.createScanStream(`hscanBuffer`,{key:e,options:t})}zscanStream(e,t){return this.createScanStream(`zscan`,{key:e,options:t})}zscanBufferStream(e,t){return this.createScanStream(`zscanBuffer`,{key:e,options:t})}silentEmit(e,t){let n;if(!(e===`error`&&(n=t,this.status===`end`||this.manuallyClosing&&n instanceof Error&&(n.message===f.CONNECTION_CLOSED_ERROR_MSG||n.syscall===`connect`||n.syscall===`read`))))return this.listeners(e).length>0?this.emit.apply(this,arguments):(n&&n instanceof Error&&console.error(`[ioredis] Unhandled error event:`,n.stack),!1)}recoverFromFatalError(e,t,n){this.flushQueue(t,n),this.silentEmit(`error`,t),this.disconnect(!0)}handleReconnection(e,t){let n=!1;switch(this.options.reconnectOnError&&!a.default.checkFlag(`IGNORE_RECONNECT_ON_ERROR`,t.command.name)&&(n=this.options.reconnectOnError(e)),n){case 1:case!0:this.status!==`reconnecting`&&this.disconnect(!0),t.command.reject(e);break;case 2:this.status!==`reconnecting`&&this.disconnect(!0),this.condition?.select!==t.select&&t.command.name!==`select`&&this.select(t.select),this.sendCommand(t.command);break;default:t.command.reject(e)}}_getDescription(){let e;return e=`path`in this.options&&this.options.path?this.options.path:this.stream&&this.stream.remoteAddress&&this.stream.remotePort?this.stream.remoteAddress+`:`+this.stream.remotePort:`host`in this.options&&this.options.host?this.options.host+`:`+this.options.port:``,this.options.connectionName&&(e+=` (${this.options.connectionName})`),e}resetCommandQueue(){this.commandQueue=new _}resetOfflineQueue(){this.offlineQueue=new _}parseOptions(...t){let n={},r=!1;for(let e=0;e<t.length;++e){let i=t[e];if(i!=null)if(typeof i==`object`)(0,g.defaults)(n,i);else if(typeof i==`string`)(0,g.defaults)(n,(0,f.parseURL)(i)),i.startsWith(`rediss://`)&&(r=!0);else if(typeof i==`number`)n.port=i;else throw Error(`Invalid argument `+i)}r&&(0,g.defaults)(n,{tls:!0}),(0,g.defaults)(n,e.defaultOptions),typeof n.port==`string`&&(n.port=parseInt(n.port,10)),typeof n.db==`string`&&(n.db=parseInt(n.db,10)),this.options=(0,f.resolveTLSProfile)(n)}setStatus(e,t){v.enabled&&v(`status[%s]: %s -> %s`,this._getDescription(),this.status||`[empty]`,e),this.status=e,process.nextTick(this.emit.bind(this,e,t))}createScanStream(e,{key:t,options:n={}}){return new u.default({objectMode:!0,key:t,redis:this,command:e,...n})}flushQueue(e,t){t=(0,g.defaults)({},t,{offlineQueue:!0,commandQueue:!0});let n;if(t.offlineQueue)for(;n=this.offlineQueue.shift();)n.command.reject(e);if(t.commandQueue&&this.commandQueue.length>0)for(this.stream&&this.stream.removeAllListeners(`data`);n=this.commandQueue.shift();)n.command.reject(e)}_readyCheck(e){let t=this;this.info(function(n,r){if(n)return n.message&&n.message.includes(`NOPERM`)?(console.warn(`Skipping the ready check because INFO command fails: "${n.message}". You can disable ready check with "enableReadyCheck". More: https://github.com/luin/ioredis/wiki/Disable-ready-check.`),e(null,{})):e(n);if(typeof r!=`string`)return e(null,r);let i={},a=r.split(`\r
|
|
236
|
-
`);for(let e=0;e<a.length;++e){let[t,...n]=a[e].split(`:`),r=n.join(`:`);r&&(i[t]=r)}if(!i.loading||i.loading===`0`)e(null,i);else{let n=(i.loading_eta_seconds||1)*1e3,r=t.options.maxLoadingRetryTime&&t.options.maxLoadingRetryTime<n?t.options.maxLoadingRetryTime:n;v(`Redis server still loading, trying again in `+r+`ms`),setTimeout(function(){t._readyCheck(e)},r)}}).catch(g.noop)}};y.Cluster=i.default,y.Command=a.default,y.defaultOptions=l.DEFAULT_REDIS_OPTIONS,(0,p.default)(y,n.EventEmitter),(0,d.addTransactionSupport)(y.prototype),e.default=y})),
|
|
234
|
+
`}}return t}stringifyArguments(){for(let e=0;e<this.args.length;++e){let t=this.args[e];typeof t==`string`||(t instanceof Buffer?this.bufferMode=!0:this.args[e]=(0,i.toArg)(t))}}transformReply(t){this.replyEncoding&&(t=(0,i.convertBufferToString)(t,this.replyEncoding));let n=e._transformer.reply[this.name];return n&&(t=n(t)),t}setTimeout(e){this._commandTimeoutTimer||=setTimeout(()=>{this.isResolved||this.reject(Error(`Command timed out`))},e)}setBlockingTimeout(e){if(e<=0)return;this._blockingTimeoutTimer&&=(clearTimeout(this._blockingTimeoutTimer),void 0);let t=Date.now();this._blockingDeadline===void 0&&(this._blockingDeadline=t+e);let n=this._blockingDeadline-t;if(n<=0){this.resolve(null);return}this._blockingTimeoutTimer=setTimeout(()=>{if(this.isResolved){this._blockingTimeoutTimer=void 0;return}this._blockingTimeoutTimer=void 0,this.resolve(null)},n)}extractBlockingTimeout(){let t=this.args;if(!t||t.length===0)return;let n=this.name.toLowerCase();if(e.checkFlag(`LAST_ARG_TIMEOUT_COMMANDS`,n))return(0,a.parseSecondsArgument)(t[t.length-1]);if(e.checkFlag(`FIRST_ARG_TIMEOUT_COMMANDS`,n))return(0,a.parseSecondsArgument)(t[0]);if(e.checkFlag(`BLOCK_OPTION_COMMANDS`,n))return(0,a.parseBlockOption)(t)}_clearTimers(){let e=this._commandTimeoutTimer;e&&(clearTimeout(e),delete this._commandTimeoutTimer);let t=this._blockingTimeoutTimer;t&&(clearTimeout(t),delete this._blockingTimeoutTimer)}initPromise(){let t=new Promise((t,n)=>{if(!this.transformed){this.transformed=!0;let t=e._transformer.argument[this.name];t&&(this.args=t(this.args)),this.stringifyArguments()}this.resolve=this._convertValue(t),this.reject=e=>{this._clearTimers(),this.errorStack?n((0,i.optimizeErrorStack)(e,this.errorStack.stack,__dirname)):n(e)}});this.promise=(0,r.default)(t,this.callback)}_iterateKeys(e=e=>e){if(this.keys===void 0&&(this.keys=[],(0,t.exists)(this.name,{caseInsensitive:!0}))){let n=(0,t.getKeyIndexes)(this.name,this.args,{nameCaseInsensitive:!0});for(let t of n)this.args[t]=e(this.args[t]),this.keys.push(this.args[t])}return this.keys}_convertValue(e){return t=>{try{this._clearTimers(),e(this.transformReply(t)),this.isResolved=!0}catch(e){this.reject(e)}return this.promise}}};e.default=o,o.FLAGS={VALID_IN_SUBSCRIBER_MODE:[`subscribe`,`psubscribe`,`unsubscribe`,`punsubscribe`,`ssubscribe`,`sunsubscribe`,`ping`,`quit`],VALID_IN_MONITOR_MODE:[`monitor`,`auth`],ENTER_SUBSCRIBER_MODE:[`subscribe`,`psubscribe`,`ssubscribe`],EXIT_SUBSCRIBER_MODE:[`unsubscribe`,`punsubscribe`,`sunsubscribe`],WILL_DISCONNECT:[`quit`],HANDSHAKE_COMMANDS:[`auth`,`select`,`client`,`readonly`,`info`],IGNORE_RECONNECT_ON_ERROR:[`client`],BLOCKING_COMMANDS:[`blpop`,`brpop`,`brpoplpush`,`blmove`,`bzpopmin`,`bzpopmax`,`bzmpop`,`blmpop`,`xread`,`xreadgroup`],LAST_ARG_TIMEOUT_COMMANDS:[`blpop`,`brpop`,`brpoplpush`,`blmove`,`bzpopmin`,`bzpopmax`],FIRST_ARG_TIMEOUT_COMMANDS:[`bzmpop`,`blmpop`],BLOCK_OPTION_COMMANDS:[`xread`,`xreadgroup`]},o._transformer={argument:{},reply:{}};let s=function(e){if(e.length===1){if(e[0]instanceof Map)return(0,i.convertMapToArray)(e[0]);if(typeof e[0]==`object`&&e[0]!==null)return(0,i.convertObjectToArray)(e[0])}return e},c=function(e){if(e.length===2){if(e[1]instanceof Map)return[e[0]].concat((0,i.convertMapToArray)(e[1]));if(typeof e[1]==`object`&&e[1]!==null)return[e[0]].concat((0,i.convertObjectToArray)(e[1]))}return e};o.setArgumentTransformer(`mset`,s),o.setArgumentTransformer(`msetnx`,s),o.setArgumentTransformer(`hset`,c),o.setArgumentTransformer(`hmset`,c),o.setReplyTransformer(`hgetall`,function(e){if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];r in t?Object.defineProperty(t,r,{value:i,configurable:!0,enumerable:!0,writable:!0}):t[r]=i}return t}return e});var l=class{constructor(){this.length=0,this.items=[]}push(e){this.length+=Buffer.byteLength(e),this.items.push(e)}toBuffer(){let e=Buffer.allocUnsafe(this.length),t=0;for(let n of this.items){let r=Buffer.byteLength(n);Buffer.isBuffer(n)?n.copy(e,t):e.write(n,t,r),t+=r}return e}}})),yF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=iF();var n=class extends t.RedisError{constructor(e,t){super(e),this.lastNodeError=t,Error.captureStackTrace(this,this.constructor)}get name(){return this.constructor.name}};e.default=n,n.defaultMessage=`Failed to refresh slots cache.`})),bF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`stream`);e.default=class extends t.Readable{constructor(e){super(e),this.opt=e,this._redisCursor=`0`,this._redisDrained=!1}_read(){if(this._redisDrained){this.push(null);return}let e=[this._redisCursor];this.opt.key&&e.unshift(this.opt.key),this.opt.match&&e.push(`MATCH`,this.opt.match),this.opt.type&&e.push(`TYPE`,this.opt.type),this.opt.count&&e.push(`COUNT`,String(this.opt.count)),this.opt.noValues&&e.push(`NOVALUES`),this.opt.redis[this.opt.command](e,(e,t)=>{if(e){this.emit(`error`,e);return}this._redisCursor=t[0]instanceof Buffer?t[0].toString():t[0],this._redisCursor===`0`&&(this._redisDrained=!0),this.push(t[1])})}close(){this._redisDrained=!0}}})),xF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.executeWithAutoPipelining=e.getFirstValueInFlattenedArray=e.shouldUseAutoPipelining=e.notAllowedAutoPipelineCommands=e.kCallbacks=e.kExec=void 0;let t=cF(),n=aF(),r=tF(),i=$P();e.kExec=Symbol(`exec`),e.kCallbacks=Symbol(`callbacks`),e.notAllowedAutoPipelineCommands=[`auth`,`info`,`script`,`quit`,`cluster`,`pipeline`,`multi`,`subscribe`,`psubscribe`,`unsubscribe`,`unpsubscribe`,`select`,`client`];function a(t,n){if(t._runningAutoPipelines.has(n)||!t._autoPipelines.has(n))return;t._runningAutoPipelines.add(n);let r=t._autoPipelines.get(n);t._autoPipelines.delete(n);let i=r[e.kCallbacks];r[e.kCallbacks]=null,r.exec(function(e,r){if(t._runningAutoPipelines.delete(n),e)for(let t=0;t<i.length;t++)process.nextTick(i[t],e);else for(let e=0;e<i.length;e++)process.nextTick(i[e],...r[e]);t._autoPipelines.has(n)&&a(t,n)})}function o(t,n,r){return n&&t.options.enableAutoPipelining&&!t.isPipeline&&!e.notAllowedAutoPipelineCommands.includes(r)&&!t.options.autoPipeliningIgnoredCommands.includes(r)}e.shouldUseAutoPipelining=o;function s(e){for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`)return r;if(Array.isArray(r)||(0,t.isArguments)(r)){if(r.length===0)continue;return r[0]}let i=[r].flat();if(i.length>0)return i[0]}}e.getFirstValueInFlattenedArray=s;function c(o,l,u,d,f){if(o.isCluster&&!o.slots.length)return o.status===`wait`&&o.connect().catch(t.noop),(0,r.default)(new Promise(function(e,t){o.delayUntilReady(n=>{if(n){t(n);return}c(o,l,u,d,null).then(e,t)})}),f);let p=o.options.keyPrefix||``,m=o.isCluster?o.slots[n(`${p}${s(d)}`)].join(`,`):`main`;if(o.isCluster&&o.options.scaleReads!==`master`){let e=(0,i.exists)(u)&&(0,i.hasFlag)(u,`readonly`);m+=e?`:read`:`:write`}if(!o._autoPipelines.has(m)){let t=o.pipeline();t[e.kExec]=!1,t[e.kCallbacks]=[],o._autoPipelines.set(m,t)}let h=o._autoPipelines.get(m);h[e.kExec]||(h[e.kExec]=!0,setImmediate(a,o,m));let g=new Promise(function(t,n){h[e.kCallbacks].push(function(e,r){if(e){n(e);return}t(r)}),l===`call`&&d.unshift(u),h[l](...d)});return(0,r.default)(g,f)}e.executeWithAutoPipelining=c})),SF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`crypto`),n=vF(),r=tF();e.default=class{constructor(e,r=null,i=``,a=!1){this.lua=e,this.numberOfKeys=r,this.keyPrefix=i,this.readOnly=a,this.sha=(0,t.createHash)(`sha1`).update(e).digest(`hex`);let o=this.sha,s=new WeakSet;this.Command=class extends n.default{toWritable(t){let n=this.reject;return this.reject=e=>{e.message.indexOf(`NOSCRIPT`)!==-1&&s.delete(t),n.call(this,e)},s.has(t)?this.name===`eval`&&(this.name=`evalsha`,this.args[0]=o):(s.add(t),this.name=`eval`,this.args[0]=e),super.toWritable(t)}}}execute(e,t,n,i){typeof this.numberOfKeys==`number`&&t.unshift(this.numberOfKeys),this.keyPrefix&&(n.keyPrefix=this.keyPrefix),this.readOnly&&(n.readOnly=!0);let a=new this.Command(`evalsha`,[this.sha,...t],n);return a.promise=a.promise.catch(r=>{if(r.message.indexOf(`NOSCRIPT`)===-1)throw r;let i=new this.Command(`evalsha`,[this.sha,...t],n);return(e.isPipeline?e.redis:e).sendCommand(i)}),(0,r.default)(a.promise,i),e.sendCommand(a)}}})),CF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$P(),n=xF(),r=vF(),i=SF();var a=class{constructor(){this.options={},this.scriptsSet={},this.addedBuiltinSet=new Set}getBuiltinCommands(){return o.slice(0)}createBuiltinCommand(e){return{string:s(null,e,`utf8`),buffer:s(null,e,null)}}addBuiltinCommand(e){this.addedBuiltinSet.add(e),this[e]=s(e,e,`utf8`),this[e+`Buffer`]=s(e+`Buffer`,e,null)}defineCommand(e,t){let n=new i.default(t.lua,t.numberOfKeys,this.options.keyPrefix,t.readOnly);this.scriptsSet[e]=n,this[e]=c(e,e,n,`utf8`),this[e+`Buffer`]=c(e+`Buffer`,e,n,null)}sendCommand(e,t,n){throw Error(`"sendCommand" is not implemented`)}};let o=t.list.filter(e=>e!==`monitor`);o.push(`sentinel`),o.forEach(function(e){a.prototype[e]=s(e,e,`utf8`),a.prototype[e+`Buffer`]=s(e+`Buffer`,e,null)}),a.prototype.call=s(`call`,`utf8`),a.prototype.callBuffer=s(`callBuffer`,null),a.prototype.send_command=a.prototype.call;function s(e,t,i){return i===void 0&&(i=t,t=null),function(...a){let o=t||a.shift(),s=a[a.length-1];typeof s==`function`?a.pop():s=void 0;let c={errorStack:this.options.showFriendlyErrorStack?Error():void 0,keyPrefix:this.options.keyPrefix,replyEncoding:i};return(0,n.shouldUseAutoPipelining)(this,e,o)?(0,n.executeWithAutoPipelining)(this,e,o,a,s):this.sendCommand(new r.default(o,a,c,s))}}function c(e,t,r,i){return function(...a){let o=typeof a[a.length-1]==`function`?a.pop():void 0,s={replyEncoding:i};return this.options.showFriendlyErrorStack&&(s.errorStack=Error()),(0,n.shouldUseAutoPipelining)(this,e,t)?(0,n.executeWithAutoPipelining)(this,e,t,a,o):r.execute(this,a,s,o)}}e.default=a})),wF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=aF(),n=$P(),r=tF(),i=h(`util`),a=vF(),o=gF(),s=CF();function c(e,n){let r=t(n[0]),i=e._groupsBySlot[r];for(let r=1;r<n.length;r++)if(e._groupsBySlot[t(n[r])]!==i)return-1;return r}var l=class extends s.default{constructor(e){super(),this.redis=e,this.isPipeline=!0,this.replyPending=0,this._queue=[],this._result=[],this._transactions=0,this._shaToScript={},this.isCluster=this.redis.constructor.name===`Cluster`||this.redis.isCluster,this.options=e.options,Object.keys(e.scriptsSet).forEach(t=>{let n=e.scriptsSet[t];this._shaToScript[n.sha]=n,this[t]=e[t],this[t+`Buffer`]=e[t+`Buffer`]}),e.addedBuiltinSet.forEach(t=>{this[t]=e[t],this[t+`Buffer`]=e[t+`Buffer`]}),this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t});let t=this;Object.defineProperty(this,`length`,{get:function(){return t._queue.length}})}fillResult(e,t){if(this._queue[t].name===`exec`&&Array.isArray(e[1])){let n=e[1].length;for(let r=0;r<n;r++){if(e[1][r]instanceof Error)continue;let i=this._queue[t-(n-r)];try{e[1][r]=i.transformReply(e[1][r])}catch(t){e[1][r]=t}}}if(this._result[t]=e,--this.replyPending)return;if(this.isCluster){let e=!0,t;for(let r=0;r<this._result.length;++r){let i=this._result[r][0],a=this._queue[r];if(i){if(a.name===`exec`&&i.message===`EXECABORT Transaction discarded because of previous errors.`)continue;if(!t)t={name:i.name,message:i.message};else if(t.name!==i.name||t.message!==i.message){e=!1;break}}else if(!a.inTransaction&&!((0,n.exists)(a.name,{caseInsensitive:!0})&&(0,n.hasFlag)(a.name,`readonly`,{nameCaseInsensitive:!0}))){e=!1;break}}if(t&&e){let e=this,n=t.message.split(` `),r=this._queue,i=!1;this._queue=[];for(let e=0;e<r.length;++e){if(n[0]===`ASK`&&!i&&r[e].name!==`asking`&&(!r[e-1]||r[e-1].name!==`asking`)){let e=new a.default(`asking`);e.ignore=!0,this.sendCommand(e)}r[e].initPromise(),this.sendCommand(r[e]),i=r[e].inTransaction}let o=!0;this.leftRedirections===void 0&&(this.leftRedirections={});let s=function(){e.exec()},c=this.redis;if(c.handleError(t,this.leftRedirections,{moved:function(t,r){e.preferKey=r,c.slots[n[1]]?c.slots[n[1]][0]!==r&&(c.slots[n[1]]=[r]):c.slots[n[1]]=[r],c._groupsBySlot[n[1]]=c._groupsIds[c.slots[n[1]].join(`;`)],c.refreshSlotsCache(),e.exec()},ask:function(t,n){e.preferKey=n,e.exec()},tryagain:s,clusterDown:s,connectionClosed:s,maxRedirections:()=>{o=!1},defaults:()=>{o=!1}}),o)return}}let r=0;for(let e=0;e<this._queue.length-r;++e)this._queue[e+r].ignore&&(r+=1),this._result[e]=this._result[e+r];this.resolve(this._result.slice(0,this._result.length-r))}sendCommand(e){this._transactions>0&&(e.inTransaction=!0);let t=this._queue.length;return e.pipelineIndex=t,e.promise.then(e=>{this.fillResult([null,e],t)}).catch(e=>{this.fillResult([e],t)}),this._queue.push(e),this}addBatch(e){let t,n,r;for(let i=0;i<e.length;++i)t=e[i],n=t[0],r=t.slice(1),this[n].apply(this,r);return this}};e.default=l;let u=l.prototype.multi;l.prototype.multi=function(){return this._transactions+=1,u.apply(this,arguments)};let d=l.prototype.execBuffer;l.prototype.execBuffer=(0,i.deprecate)(function(){return this._transactions>0&&--this._transactions,d.apply(this,arguments)},`Pipeline#execBuffer: Use Pipeline#exec instead`),l.prototype.exec=function(e){if(this.isCluster&&!this.redis.slots.length)return this.redis.status===`wait`&&this.redis.connect().catch(o.noop),e&&!this.nodeifiedPromise&&(this.nodeifiedPromise=!0,(0,r.default)(this.promise,e)),this.redis.delayUntilReady(t=>{if(t){this.reject(t);return}this.exec(e)}),this.promise;if(this._transactions>0)return--this._transactions,d.apply(this,arguments);this.nodeifiedPromise||(this.nodeifiedPromise=!0,(0,r.default)(this.promise,e)),this._queue.length||this.resolve([]);let n;if(this.isCluster){let e=[];for(let n=0;n<this._queue.length;n++){let r=this._queue[n].getKeys();if(r.length&&e.push(r[0]),r.length&&t.generateMulti(r)<0)return this.reject(Error(`All the keys in a pipeline command should belong to the same slot`)),this.promise}if(e.length){if(n=c(this.redis,e),n<0)return this.reject(Error(`All keys in the pipeline should belong to the same slots allocation group`)),this.promise}else n=Math.random()*16384|0}let i=this;return a(),this.promise;function a(){let e=i.replyPending=i._queue.length,t;i.isCluster&&(t={slot:n,redis:i.redis.connectionPool.nodes.all[i.preferKey]});let r=``,a,o={isPipeline:!0,destination:i.isCluster?t:{redis:i.redis},write(t){typeof t==`string`?r+=t:(a||=[],r&&=(a.push(Buffer.from(r,`utf8`)),``),a.push(t)),--e||(a?(r&&a.push(Buffer.from(r,`utf8`)),o.destination.redis.stream.write(Buffer.concat(a))):o.destination.redis.stream.write(r),e=i._queue.length,r=``,a=void 0)}};for(let e=0;e<i._queue.length;++e)i.redis.sendCommand(i._queue[e],o,t);return i.promise}}})),TF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.addTransactionSupport=void 0;let t=gF(),n=tF(),r=wF();function i(e){e.pipeline=function(e){let t=new r.default(this);return Array.isArray(e)&&t.addBatch(e),t};let{multi:i}=e;e.multi=function(e,a){if(a===void 0&&!Array.isArray(e)&&(a=e,e=null),a&&a.pipeline===!1)return i.call(this);let o=new r.default(this);o.multi(),Array.isArray(e)&&o.addBatch(e);let s=o.exec;o.exec=function(e){if(this.isCluster&&!this.redis.slots.length)return this.redis.status===`wait`&&this.redis.connect().catch(t.noop),(0,n.default)(new Promise((e,t)=>{this.redis.delayUntilReady(n=>{if(n){t(n);return}this.exec(o).then(e,t)})}),e);if(this._transactions>0&&s.call(o),this.nodeifiedPromise)return s.call(o);let r=s.call(o);return(0,n.default)(r.then(function(e){let n=e[e.length-1];if(n===void 0)throw Error("Pipeline cannot be used to send any commands when the `exec()` has been called on it.");if(n[0]){n[0].previousErrors=[];for(let t=0;t<e.length-1;++t)e[t][0]&&n[0].previousErrors.push(e[t][0]);throw n[0]}return(0,t.wrapMultiResult)(n[1])}),e)};let{execBuffer:c}=o;return o.execBuffer=function(e){return this._transactions>0&&c.call(o),o.exec(e)},o};let{exec:a}=e;e.exec=function(e){return(0,n.default)(a.call(this).then(function(e){return Array.isArray(e)&&(e=(0,t.wrapMultiResult)(e)),e}),e)}}e.addTransactionSupport=i})),EF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){Object.getOwnPropertyNames(t.prototype).forEach(n=>{Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n))})}e.default=t})),DF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_CLUSTER_OPTIONS=void 0;let t=h(`dns`);e.DEFAULT_CLUSTER_OPTIONS={clusterRetryStrategy:e=>Math.min(100+e*2,2e3),enableOfflineQueue:!0,enableReadyCheck:!0,scaleReads:`master`,maxRedirections:16,retryDelayOnMoved:0,retryDelayOnFailover:100,retryDelayOnClusterDown:100,retryDelayOnTryAgain:100,slotsRefreshTimeout:1e3,useSRVRecords:!1,resolveSrv:t.resolveSrv,dnsLookup:t.lookup,enableAutoPipelining:!1,autoPipeliningIgnoredCommands:[],shardedSubscribers:!1}})),OF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.getConnectionName=e.weightSrvRecords=e.groupSrvRecords=e.getUniqueHostnamesFromOptions=e.normalizeNodeOptions=e.nodeKeyToRedisOptions=e.getNodeKey=void 0;let t=gF(),n=h(`net`);function r(e){return e.port=e.port||6379,e.host=e.host||`127.0.0.1`,e.host+`:`+e.port}e.getNodeKey=r;function i(e){let t=e.lastIndexOf(`:`);if(t===-1)throw Error(`Invalid node key ${e}`);return{host:e.slice(0,t),port:Number(e.slice(t+1))}}e.nodeKeyToRedisOptions=i;function a(e){return e.map(e=>{let n={};if(typeof e==`object`)Object.assign(n,e);else if(typeof e==`string`)Object.assign(n,(0,t.parseURL)(e));else if(typeof e==`number`)n.port=e;else throw Error(`Invalid argument `+e);return typeof n.port==`string`&&(n.port=parseInt(n.port,10)),delete n.db,n.port||=6379,n.host||=`127.0.0.1`,(0,t.resolveTLSProfile)(n)})}e.normalizeNodeOptions=a;function o(e){let t={};return e.forEach(e=>{t[e.host]=!0}),Object.keys(t).filter(e=>!(0,n.isIP)(e))}e.getUniqueHostnamesFromOptions=o;function s(e){let t={};for(let n of e)t.hasOwnProperty(n.priority)?(t[n.priority].totalWeight+=n.weight,t[n.priority].records.push(n)):t[n.priority]={totalWeight:n.weight,records:[n]};return t}e.groupSrvRecords=s;function c(e){if(e.records.length===1)return e.totalWeight=0,e.records.shift();let t=Math.floor(Math.random()*(e.totalWeight+e.records.length)),n=0;for(let[r,i]of e.records.entries())if(n+=1+i.weight,n>t)return e.totalWeight-=i.weight,e.records.splice(r,1),i}e.weightSrvRecords=c;function l(e,t){let n=`ioredis-cluster(${e})`;return t?`${n}:${t}`:n}e.getConnectionName=l})),kF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=OF(),n=gF(),r=XF(),i=(0,n.Debug)(`cluster:subscriber`);e.default=class{constructor(e,n,r=!1){this.connectionPool=e,this.emitter=n,this.isSharded=r,this.started=!1,this.subscriber=null,this.slotRange=[],this.onSubscriberEnd=()=>{if(!this.started){i(`subscriber has disconnected, but ClusterSubscriber is not started, so not reconnecting.`);return}i(`subscriber has disconnected, selecting a new one...`),this.selectSubscriber()},this.connectionPool.on(`-node`,(e,n)=>{!this.started||!this.subscriber||(0,t.getNodeKey)(this.subscriber.options)===n&&(i(`subscriber has left, selecting a new one...`),this.selectSubscriber())}),this.connectionPool.on(`+node`,()=>{!this.started||this.subscriber||(i(`a new node is discovered and there is no subscriber, selecting a new one...`),this.selectSubscriber())})}getInstance(){return this.subscriber}associateSlotRange(e){return this.isSharded&&(this.slotRange=e),this.slotRange}start(){this.started=!0,this.selectSubscriber(),i(`started`)}stop(){this.started=!1,this.subscriber&&=(this.subscriber.disconnect(),null)}isStarted(){return this.started}selectSubscriber(){let e=this.lastActiveSubscriber;e&&(e.off(`end`,this.onSubscriberEnd),e.disconnect()),this.subscriber&&(this.subscriber.off(`end`,this.onSubscriberEnd),this.subscriber.disconnect());let a=(0,n.sample)(this.connectionPool.getNodes());if(!a){i(`selecting subscriber failed since there is no node discovered in the cluster yet`),this.subscriber=null;return}let{options:o}=a;i(`selected a subscriber %s:%s`,o.host,o.port);let s=`subscriber`;this.isSharded&&(s=`ssubscriber`),this.subscriber=new r.default({port:o.port,host:o.host,username:o.username,password:o.password,enableReadyCheck:!0,connectionName:(0,t.getConnectionName)(s,o.connectionName),lazyConnect:!0,tls:o.tls,retryStrategy:null}),this.subscriber.on(`error`,n.noop),this.subscriber.on(`moved`,()=>{this.emitter.emit(`forceRefresh`)}),this.subscriber.once(`end`,this.onSubscriberEnd);let c={subscribe:[],psubscribe:[],ssubscribe:[]};if(e){let t=e.condition||e.prevCondition;t&&t.subscriber&&(c.subscribe=t.subscriber.channels(`subscribe`),c.psubscribe=t.subscriber.channels(`psubscribe`),c.ssubscribe=t.subscriber.channels(`ssubscribe`))}if(c.subscribe.length||c.psubscribe.length||c.ssubscribe.length){let e=0;for(let t of[`subscribe`,`psubscribe`,`ssubscribe`]){let n=c[t];if(n.length!=0)if(i(`%s %d channels`,t,n.length),t===`ssubscribe`)for(let r of n)e+=1,this.subscriber[t](r).then(()=>{--e||(this.lastActiveSubscriber=this.subscriber)}).catch(()=>{i(`failed to ssubscribe to channel: %s`,r)});else e+=1,this.subscriber[t](n).then(()=>{--e||(this.lastActiveSubscriber=this.subscriber)}).catch(()=>{i(`failed to %s %d channels`,t,n.length)})}}else this.lastActiveSubscriber=this.subscriber;for(let e of[`message`,`messageBuffer`])this.subscriber.on(e,(t,n)=>{this.emitter.emit(e,t,n)});for(let e of[`pmessage`,`pmessageBuffer`])this.subscriber.on(e,(t,n,r)=>{this.emitter.emit(e,t,n,r)});if(this.isSharded==1)for(let e of[`smessage`,`smessageBuffer`])this.subscriber.on(e,(t,n)=>{this.emitter.emit(e,t,n)})}}})),AF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`events`),n=gF(),r=OF(),i=XF(),a=(0,n.Debug)(`cluster:connectionPool`);e.default=class extends t.EventEmitter{constructor(e){super(),this.redisOptions=e,this.nodes={all:{},master:{},slave:{}},this.specifiedOptions={}}getNodes(e=`all`){let t=this.nodes[e];return Object.keys(t).map(e=>t[e])}getInstanceByKey(e){return this.nodes.all[e]}getSampleInstance(e){let t=Object.keys(this.nodes[e]),r=(0,n.sample)(t);return this.nodes[e][r]}addMasterNode(e){let t=(0,r.getNodeKey)(e.options),n=this.createRedisFromOptions(e,e.options.readOnly);return e.options.readOnly?!1:(this.nodes.all[t]=n,this.nodes.master[t]=n,!0)}createRedisFromOptions(e,t){return new i.default((0,n.defaults)({retryStrategy:null,enableOfflineQueue:!0,readOnly:t},e,this.redisOptions,{lazyConnect:!0}))}findOrCreate(e,t=!1){let i=(0,r.getNodeKey)(e);t=!!t,this.specifiedOptions[i]?Object.assign(e,this.specifiedOptions[i]):this.specifiedOptions[i]=e;let o;return this.nodes.all[i]?(o=this.nodes.all[i],o.options.readOnly!==t&&(o.options.readOnly=t,a(`Change role of %s to %s`,i,t?`slave`:`master`),o[t?`readonly`:`readwrite`]().catch(n.noop),t?(delete this.nodes.master[i],this.nodes.slave[i]=o):(delete this.nodes.slave[i],this.nodes.master[i]=o))):(a(`Connecting to %s as %s`,i,t?`slave`:`master`),o=this.createRedisFromOptions(e,t),this.nodes.all[i]=o,this.nodes[t?`slave`:`master`][i]=o,o.once(`end`,()=>{this.removeNode(i),this.emit(`-node`,o,i),Object.keys(this.nodes.all).length||this.emit(`drain`)}),this.emit(`+node`,o,i),o.on(`error`,function(e){this.emit(`nodeError`,e,i)})),o}reset(e){a(`Reset with %O`,e);let t={};e.forEach(e=>{let n=(0,r.getNodeKey)(e);e.readOnly&&t[n]||(t[n]=e)}),Object.keys(this.nodes.all).forEach(e=>{t[e]||(a(`Disconnect %s because the node does not hold any slot`,e),this.nodes.all[e].disconnect(),this.removeNode(e))}),Object.keys(t).forEach(e=>{let n=t[e];this.findOrCreate(n,n.readOnly)})}removeNode(e){let{nodes:t}=this;t.all[e]&&(a(`Remove %s from the pool`,e),delete t.all[e]),delete t.master[e],delete t.slave[e]}}})),jF=u(((e,t)=>{function n(e,t){var t=t||{};this._capacity=t.capacity,this._head=0,this._tail=0,Array.isArray(e)?this._fromArray(e):(this._capacityMask=3,this._list=[,,,,])}n.prototype.peekAt=function(e){var t=e;if(t===(t|0)){var n=this.size();if(!(t>=n||t<-n))return t<0&&(t+=n),t=this._head+t&this._capacityMask,this._list[t]}},n.prototype.get=function(e){return this.peekAt(e)},n.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},n.prototype.peekFront=function(){return this.peek()},n.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(n.prototype,`length`,{get:function(){return this.size()}}),n.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},n.prototype.unshift=function(e){if(arguments.length===0)return this.size();var t=this._list.length;return this._head=this._head-1+t&this._capacityMask,this._list[this._head]=e,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},n.prototype.shift=function(){var e=this._head;if(e!==this._tail){var t=this._list[e];return this._list[e]=void 0,this._head=e+1&this._capacityMask,e<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),t}},n.prototype.push=function(e){if(arguments.length===0)return this.size();var t=this._tail;return this._list[t]=e,this._tail=t+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},n.prototype.pop=function(){var e=this._tail;if(e!==this._head){var t=this._list.length;this._tail=e-1+t&this._capacityMask;var n=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&e>1e4&&e<=t>>>2&&this._shrinkArray(),n}},n.prototype.removeOne=function(e){var t=e;if(t===(t|0)&&this._head!==this._tail){var n=this.size(),r=this._list.length;if(!(t>=n||t<-n)){t<0&&(t+=n),t=this._head+t&this._capacityMask;var i=this._list[t],a;if(e<n/2){for(a=e;a>0;a--)this._list[t]=this._list[t=t-1+r&this._capacityMask];this._list[t]=void 0,this._head=this._head+1+r&this._capacityMask}else{for(a=n-1-e;a>0;a--)this._list[t]=this._list[t=t+1+r&this._capacityMask];this._list[t]=void 0,this._tail=this._tail-1+r&this._capacityMask}return i}}},n.prototype.remove=function(e,t){var n=e,r,i=t;if(n===(n|0)&&this._head!==this._tail){var a=this.size(),o=this._list.length;if(!(n>=a||n<-a||t<1)){if(n<0&&(n+=a),t===1||!t)return r=[,],r[0]=this.removeOne(n),r;if(n===0&&n+t>=a)return r=this.toArray(),this.clear(),r;n+t>a&&(t=a-n);var s;for(r=Array(t),s=0;s<t;s++)r[s]=this._list[this._head+n+s&this._capacityMask];if(n=this._head+n&this._capacityMask,e+t===a){for(this._tail=this._tail-t+o&this._capacityMask,s=t;s>0;s--)this._list[n=n+1+o&this._capacityMask]=void 0;return r}if(e===0){for(this._head=this._head+t+o&this._capacityMask,s=t-1;s>0;s--)this._list[n=n+1+o&this._capacityMask]=void 0;return r}if(n<a/2){for(this._head=this._head+e+t+o&this._capacityMask,s=e;s>0;s--)this.unshift(this._list[n=n-1+o&this._capacityMask]);for(n=this._head-1+o&this._capacityMask;i>0;)this._list[n=n-1+o&this._capacityMask]=void 0,i--;e<0&&(this._tail=n)}else{for(this._tail=n,n=n+t+o&this._capacityMask,s=a-(t+e);s>0;s--)this.push(this._list[n++]);for(n=this._tail;i>0;)this._list[n=n+1+o&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=o>>>2&&this._shrinkArray(),r}}},n.prototype.splice=function(e,t){var n=e;if(n===(n|0)){var r=this.size();if(n<0&&(n+=r),!(n>r))if(arguments.length>2){var i,a,o,s=arguments.length,c=this._list.length,l=2;if(!r||n<r/2){for(a=Array(n),i=0;i<n;i++)a[i]=this._list[this._head+i&this._capacityMask];for(t===0?(o=[],n>0&&(this._head=this._head+n+c&this._capacityMask)):(o=this.remove(n,t),this._head=this._head+n+c&this._capacityMask);s>l;)this.unshift(arguments[--s]);for(i=n;i>0;i--)this.unshift(a[i-1])}else{a=Array(r-(n+t));var u=a.length;for(i=0;i<u;i++)a[i]=this._list[this._head+n+t+i&this._capacityMask];for(t===0?(o=[],n!=r&&(this._tail=this._head+n+c&this._capacityMask)):(o=this.remove(n,t),this._tail=this._tail-u+c&this._capacityMask);l<s;)this.push(arguments[l++]);for(i=0;i<u;i++)this.push(a[i])}return o}else return this.remove(n,t)}},n.prototype.clear=function(){this._list=Array(this._list.length),this._head=0,this._tail=0},n.prototype.isEmpty=function(){return this._head===this._tail},n.prototype.toArray=function(){return this._copyArray(!1)},n.prototype._fromArray=function(e){var t=e.length,n=this._nextPowerOf2(t);this._list=Array(n),this._capacityMask=n-1,this._tail=t;for(var r=0;r<t;r++)this._list[r]=e[r]},n.prototype._copyArray=function(e,t){var n=this._list,r=n.length,i=this.length;if(t|=i,t==i&&this._head<this._tail)return this._list.slice(this._head,this._tail);var a=Array(t),o=0,s;if(e||this._head>this._tail){for(s=this._head;s<r;s++)a[o++]=n[s];for(s=0;s<this._tail;s++)a[o++]=n[s]}else for(s=this._head;s<this._tail;s++)a[o++]=n[s];return a},n.prototype._growArray=function(){if(this._head!=0){var e=this._copyArray(!0,this._list.length<<1);this._tail=this._list.length,this._head=0,this._list=e}else this._tail=this._list.length,this._list.length<<=1;this._capacityMask=this._capacityMask<<1|1},n.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},n.prototype._nextPowerOf2=function(e){var t=1<<Math.log(e)/Math.log(2)+1;return Math.max(t,4)},t.exports=n})),MF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=gF(),n=jF(),r=(0,t.Debug)(`delayqueue`);e.default=class{constructor(){this.queues={},this.timeouts={}}push(e,t,r){let i=r.callback||process.nextTick;this.queues[e]||(this.queues[e]=new n),this.queues[e].push(t),this.timeouts[e]||(this.timeouts[e]=setTimeout(()=>{i(()=>{this.timeouts[e]=null,this.execute(e)})},r.timeout))}execute(e){let t=this.queues[e];if(!t)return;let{length:n}=t;if(n)for(r(`send %d commands in %s queue`,n,e),this.queues[e]=null;t.length>0;)t.shift()()}}})),NF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=OF(),n=gF(),r=XF(),i=(0,n.Debug)(`cluster:subscriberGroup:shardedSubscriber`),a={IDLE:`idle`,STARTING:`starting`,CONNECTED:`connected`,STOPPING:`stopping`,ENDED:`ended`},o={[a.IDLE]:[a.STARTING,a.STOPPING,a.ENDED],[a.STARTING]:[a.CONNECTED,a.STOPPING,a.ENDED],[a.CONNECTED]:[a.STOPPING,a.ENDED],[a.STOPPING]:[a.ENDED],[a.ENDED]:[]};e.default=class{constructor(e,i,o){this.emitter=e,this.status=a.IDLE,this.instance=null,this.connectPromise=null,this.messageListeners=new Map,this.onEnd=()=>{this.updateStatus(a.ENDED),this.emitter.emit(`-node`,this.instance,this.nodeKey)},this.onError=e=>{this.emitter.emit(`nodeError`,e,this.nodeKey)},this.onMoved=()=>{this.emitter.emit(`moved`)},this.instance=new r.default((0,n.defaults)({enableReadyCheck:!1,enableOfflineQueue:!0,connectionName:(0,t.getConnectionName)(`ssubscriber`,i.connectionName),retryStrategy:null,lazyConnect:!0},i,o)),this.lazyConnect=o?.lazyConnect??!0,this.nodeKey=(0,t.getNodeKey)(i),this.instance.on(`end`,this.onEnd),this.instance.on(`error`,this.onError),this.instance.on(`moved`,this.onMoved);for(let e of[`smessage`,`smessageBuffer`]){let t=(...t)=>{this.emitter.emit(e,...t)};this.messageListeners.set(e,t),this.instance.on(e,t)}}async start(){if(this.connectPromise)return this.connectPromise;if(!(this.status===a.STARTING||this.status===a.CONNECTED)){if(this.status===a.ENDED||!this.instance)throw Error(`Sharded subscriber ${this.nodeKey} cannot be restarted once ended.`);this.updateStatus(a.STARTING),this.connectPromise=this.instance.connect();try{await this.connectPromise,this.updateStatus(a.CONNECTED)}catch(e){throw this.updateStatus(a.ENDED),e}finally{this.connectPromise=null}}}stop(){this.updateStatus(a.STOPPING),this.instance&&=(this.instance.disconnect(),this.instance.removeAllListeners(),this.messageListeners.clear(),null),this.updateStatus(a.ENDED),i(`stopped %s`,this.nodeKey)}isStarted(){return[a.CONNECTED,a.STARTING].includes(this.status)}get subscriberStatus(){return this.status}isHealthy(){return(this.status===a.IDLE||this.status===a.CONNECTED||this.status===a.STARTING)&&this.instance!==null}getInstance(){return this.instance}getNodeKey(){return this.nodeKey}isLazyConnect(){return this.lazyConnect}updateStatus(e){if(this.status!==e){if(!o[this.status].includes(e)){i(`Invalid status transition for %s: %s -> %s`,this.nodeKey,this.status,e);return}this.status=e}}}})),PF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=gF(),n=OF(),r=aF(),i=NF(),a=(0,t.Debug)(`cluster:subscriberGroup`);var o=class e{constructor(t,n){this.subscriberGroupEmitter=t,this.options=n,this.shardedSubscribers=new Map,this.clusterSlots=[],this.subscriberToSlotsIndex=new Map,this.channels=new Map,this.failedAttemptsByNode=new Map,this.isResetting=!1,this.pendingReset=null,this.handleSubscriberConnectFailed=(t,n)=>{let r=(this.failedAttemptsByNode.get(n)||0)+1;this.failedAttemptsByNode.set(n,r);let i=Math.min(r,e.MAX_RETRY_ATTEMPTS),o=Math.min(e.BASE_BACKOFF_MS*2**i,e.MAX_BACKOFF_MS),s=Math.floor((Math.random()-.5)*(o*.5)),c=Math.max(0,o+s);a(`Failed to connect subscriber for %s. Refreshing slots in %dms`,n,c),this.subscriberGroupEmitter.emit(`subscriberConnectFailed`,{delay:c,error:t})},this.handleSubscriberConnectSucceeded=e=>{this.failedAttemptsByNode.delete(e)}}getResponsibleSubscriber(e){let t=this.clusterSlots[e][0],n=this.shardedSubscribers.get(t);return n&&n.subscriberStatus===`idle`&&n.start().then(()=>{this.handleSubscriberConnectSucceeded(n.getNodeKey())}).catch(e=>{this.handleSubscriberConnectFailed(e,n.getNodeKey())}),n}addChannels(e){let t=r(e[0]);for(let n of e)if(r(n)!==t)return-1;let n=this.channels.get(t);return n?this.channels.set(t,n.concat(e)):this.channels.set(t,e),Array.from(this.channels.values()).reduce((e,t)=>e+t.length,0)}removeChannels(e){let t=r(e[0]);for(let n of e)if(r(n)!==t)return-1;let n=this.channels.get(t);if(n){let r=n.filter(t=>!e.includes(t));this.channels.set(t,r)}return Array.from(this.channels.values()).reduce((e,t)=>e+t.length,0)}stop(){for(let e of this.shardedSubscribers.values())e.stop();this.pendingReset=null,this.shardedSubscribers.clear(),this.subscriberToSlotsIndex.clear()}start(){let e=[];for(let t of this.shardedSubscribers.values())this.shouldStartSubscriber(t)&&(e.push(t.start().then(()=>{this.handleSubscriberConnectSucceeded(t.getNodeKey())}).catch(e=>{this.handleSubscriberConnectFailed(e,t.getNodeKey())})),this.subscriberGroupEmitter.emit(`+subscriber`));return Promise.all(e)}async reset(e,t){if(this.isResetting){this.pendingReset={slots:e,nodes:t};return}this.isResetting=!0;try{let r=this._refreshSlots(e),o=this.hasUnhealthySubscribers();if(!r&&!o){a(`No topology change detected or failed subscribers. Skipping reset.`);return}for(let[e,t]of this.shardedSubscribers){if(this.subscriberToSlotsIndex.has(e)&&t.isHealthy()){a(`Skipping deleting subscriber for %s`,e);continue}a(`Removing subscriber for %s`,e),t.stop(),this.shardedSubscribers.delete(e),this.subscriberGroupEmitter.emit(`-subscriber`)}let s=[];for(let[e,r]of this.subscriberToSlotsIndex){let r=this.shardedSubscribers.get(e);if(r&&r.isHealthy()){a(`Skipping creating new subscriber for %s`,e),!r.isStarted()&&this.shouldStartSubscriber(r)&&s.push(r.start().then(()=>{this.handleSubscriberConnectSucceeded(e)}).catch(t=>{this.handleSubscriberConnectFailed(t,e)}));continue}r&&!r.isHealthy()&&(a(`Replacing subscriber for %s`,e),r.stop(),this.shardedSubscribers.delete(e),this.subscriberGroupEmitter.emit(`-subscriber`)),a(`Creating new subscriber for %s`,e);let o=t.find(t=>(0,n.getNodeKey)(t.options)===e);if(!o){a(`Failed to find node for key %s`,e);continue}let c=new i.default(this.subscriberGroupEmitter,o.options,this.options.redisOptions);this.shardedSubscribers.set(e,c),this.shouldStartSubscriber(c)&&s.push(c.start().then(()=>{this.handleSubscriberConnectSucceeded(e)}).catch(t=>{this.handleSubscriberConnectFailed(t,e)})),this.subscriberGroupEmitter.emit(`+subscriber`)}await Promise.all(s),this._resubscribe(),this.subscriberGroupEmitter.emit(`subscribersReady`)}finally{if(this.isResetting=!1,this.pendingReset){let{slots:e,nodes:t}=this.pendingReset;this.pendingReset=null,await this.reset(e,t)}}}_refreshSlots(e){if(this._slotsAreEqual(e)&&this.subscriberToSlotsIndex.size>0)return a(`Nothing to refresh because the new cluster map is equal to the previous one.`),!1;a(`Refreshing the slots of the subscriber group.`),this.subscriberToSlotsIndex=new Map;for(let t=0;t<e.length;t++){let n=e[t][0];this.subscriberToSlotsIndex.has(n)||this.subscriberToSlotsIndex.set(n,[]),this.subscriberToSlotsIndex.get(n).push(Number(t))}return this.clusterSlots=JSON.parse(JSON.stringify(e)),!0}_resubscribe(){this.shardedSubscribers&&this.shardedSubscribers.forEach((e,t)=>{let n=this.subscriberToSlotsIndex.get(t);n&&n.forEach(n=>{let r=e.getInstance(),i=this.channels.get(n);if(i&&i.length>0){if(!r||r.status===`end`)return;r.status===`ready`?r.ssubscribe(...i).catch(e=>{a(`Failed to ssubscribe on node %s: %s`,t,e)}):r.once(`ready`,()=>{r.ssubscribe(...i).catch(e=>{a(`Failed to ssubscribe on node %s: %s`,t,e)})})}})})}_slotsAreEqual(e){return this.clusterSlots===void 0?!1:JSON.stringify(this.clusterSlots)===JSON.stringify(e)}hasUnhealthySubscribers(){let e=Array.from(this.shardedSubscribers.values()).some(e=>!e.isHealthy()),t=Array.from(this.subscriberToSlotsIndex.keys()).some(e=>!this.shardedSubscribers.has(e));return e||t}shouldStartSubscriber(e){if(e.isStarted())return!1;if(!e.isLazyConnect())return!0;let t=this.subscriberToSlotsIndex.get(e.getNodeKey());return t?t.some(e=>{let t=this.channels.get(e);return!!(t&&t.length>0)}):!1}};e.default=o,o.MAX_RETRY_ATTEMPTS=10,o.MAX_BACKOFF_MS=2e3,o.BASE_BACKOFF_MS=100})),FF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$P(),n=h(`events`),r=iF(),i=tF(),a=vF(),o=yF(),s=XF(),c=bF(),l=TF(),u=gF(),d=EF(),f=CF(),p=DF(),m=kF(),g=AF(),_=MF(),v=OF(),y=jF(),b=PF(),x=(0,u.Debug)(`cluster`),S=new WeakSet;var C=class e extends f.default{constructor(e,t={}){if(super(),this.slots=[],this._groupsIds={},this._groupsBySlot=Array(16384),this.isCluster=!0,this.retryAttempts=0,this.delayQueue=new _.default,this.offlineQueue=new y,this.isRefreshing=!1,this._refreshSlotsCacheCallbacks=[],this._autoPipelines=new Map,this._runningAutoPipelines=new Set,this._readyDelayedCallbacks=[],this.connectionEpoch=0,n.EventEmitter.call(this),this.startupNodes=e,this.options=(0,u.defaults)({},t,p.DEFAULT_CLUSTER_OPTIONS,this.options),this.options.shardedSubscribers&&this.createShardedSubscriberGroup(),this.options.redisOptions&&this.options.redisOptions.keyPrefix&&!this.options.keyPrefix&&(this.options.keyPrefix=this.options.redisOptions.keyPrefix),typeof this.options.scaleReads!=`function`&&[`all`,`master`,`slave`].indexOf(this.options.scaleReads)===-1)throw Error(`Invalid option scaleReads "`+this.options.scaleReads+`". Expected "all", "master", "slave" or a custom function`);this.connectionPool=new g.default(this.options.redisOptions),this.connectionPool.on(`-node`,(e,t)=>{this.emit(`-node`,e)}),this.connectionPool.on(`+node`,e=>{this.emit(`+node`,e)}),this.connectionPool.on(`drain`,()=>{this.setStatus(`close`)}),this.connectionPool.on(`nodeError`,(e,t)=>{this.emit(`node error`,e,t)}),this.subscriber=new m.default(this.connectionPool,this),this.options.scripts&&Object.entries(this.options.scripts).forEach(([e,t])=>{this.defineCommand(e,t)}),this.options.lazyConnect?this.setStatus(`wait`):this.connect().catch(e=>{x(`connecting failed: %s`,e)})}connect(){return new Promise((e,t)=>{if(this.status===`connecting`||this.status===`connect`||this.status===`ready`){t(Error(`Redis is already connecting/connected`));return}let n=++this.connectionEpoch;this.setStatus(`connecting`),this.resolveStartupNodeHostnames().then(i=>{if(this.connectionEpoch!==n){x(`discard connecting after resolving startup nodes because epoch not match: %d != %d`,n,this.connectionEpoch),t(new r.RedisError(`Connection is discarded because a new connection is made`));return}if(this.status!==`connecting`){x(`discard connecting after resolving startup nodes because the status changed to %s`,this.status),t(new r.RedisError(`Connection is aborted`));return}this.connectionPool.reset(i),this.options.shardedSubscribers&&this.shardedSubscribers.reset(this.slots,this.connectionPool.getNodes(`all`)).catch(e=>{x(`Error while starting subscribers: %s`,e)});let a=()=>{this.setStatus(`ready`),this.retryAttempts=0,this.executeOfflineCommands(),this.resetNodesRefreshInterval(),e()},c,l=()=>{this.invokeReadyDelayedCallbacks(void 0),this.removeListener(`close`,c),this.manuallyClosing=!1,this.setStatus(`connect`),this.options.enableReadyCheck?this.readyCheck((e,t)=>{e||t?(x(`Ready check failed (%s). Reconnecting...`,e||t),this.status===`connect`&&this.disconnect(!0)):a()}):a()};c=()=>{let e=Error(`None of startup nodes is available`);this.removeListener(`refresh`,l),this.invokeReadyDelayedCallbacks(e),t(e)},this.once(`refresh`,l),this.once(`close`,c),this.once(`close`,this.handleCloseEvent.bind(this)),this.refreshSlotsCache(e=>{e&&e.message===o.default.defaultMessage&&(s.default.prototype.silentEmit.call(this,`error`,e),this.connectionPool.reset([]))}),this.subscriber.start(),this.options.shardedSubscribers&&this.shardedSubscribers.start().catch(e=>{x(`Error while starting subscribers: %s`,e)})}).catch(e=>{this.setStatus(`close`),this.handleCloseEvent(e),this.invokeReadyDelayedCallbacks(e),t(e)})})}disconnect(e=!1){let t=this.status;this.setStatus(`disconnecting`),e||(this.manuallyClosing=!0),this.reconnectTimeout&&!e&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null,x(`Canceled reconnecting attempts`)),this.clearNodesRefreshInterval(),this.subscriber.stop(),this.options.shardedSubscribers&&this.shardedSubscribers.stop(),t===`wait`?(this.setStatus(`close`),this.handleCloseEvent()):this.connectionPool.reset([])}quit(e){let t=this.status;if(this.setStatus(`disconnecting`),this.manuallyClosing=!0,this.reconnectTimeout&&=(clearTimeout(this.reconnectTimeout),null),this.clearNodesRefreshInterval(),this.subscriber.stop(),this.options.shardedSubscribers&&this.shardedSubscribers.stop(),t===`wait`){let t=(0,i.default)(Promise.resolve(`OK`),e);return setImmediate(function(){this.setStatus(`close`),this.handleCloseEvent()}.bind(this)),t}return(0,i.default)(Promise.all(this.nodes().map(e=>e.quit().catch(e=>{if(e.message===u.CONNECTION_CLOSED_ERROR_MSG)return`OK`;throw e}))).then(()=>`OK`),e)}duplicate(t=[],n={}){return new e(t.length>0?t:this.startupNodes.slice(0),Object.assign({},this.options,n))}nodes(e=`all`){if(e!==`all`&&e!==`master`&&e!==`slave`)throw Error(`Invalid role "`+e+`". Expected "all", "master" or "slave"`);return this.connectionPool.getNodes(e)}delayUntilReady(e){this._readyDelayedCallbacks.push(e)}get autoPipelineQueueSize(){let e=0;for(let t of this._autoPipelines.values())e+=t.length;return e}refreshSlotsCache(e){if(e&&this._refreshSlotsCacheCallbacks.push(e),this.isRefreshing)return;this.isRefreshing=!0;let t=this,n=e=>{this.isRefreshing=!1;for(let t of this._refreshSlotsCacheCallbacks)t(e);this._refreshSlotsCacheCallbacks=[]},r=(0,u.shuffle)(this.connectionPool.getNodes()),i=null;function a(e){if(e===r.length)return n(new o.default(o.default.defaultMessage,i));let s=r[e],c=`${s.options.host}:${s.options.port}`;x(`getting slot cache from %s`,c),t.getInfoFromNode(s,function(r){switch(t.status){case`close`:case`end`:return n(Error(`Cluster is disconnected.`));case`disconnecting`:return n(Error(`Cluster is disconnecting.`))}r?(t.emit(`node error`,r,c),i=r,a(e+1)):(t.emit(`refresh`),n())})}a(0)}sendCommand(e,n,i){if(this.status===`wait`&&this.connect().catch(u.noop),this.status===`end`)return e.reject(Error(u.CONNECTION_CLOSED_ERROR_MSG)),e.promise;let o=this.options.scaleReads;o!==`master`&&(e.isReadOnly||(0,t.exists)(e.name)&&(0,t.hasFlag)(e.name,`readonly`)||(o=`master`));let s=i?i.slot:e.getSlot(),c={},l=this;if(!i&&!S.has(e)){S.add(e);let t=e.reject;e.reject=function(n){let r=d.bind(null,!0);l.handleError(n,c,{moved:function(t,n){x(`command %s is moved to %s`,e.name,n),s=Number(t),l.slots[t]?l.slots[t][0]=n:l.slots[t]=[n],l._groupsBySlot[t]=l._groupsIds[l.slots[t].join(`;`)],l.connectionPool.findOrCreate(l.natMapper(n)),d(),x(`refreshing slot caches... (triggered by MOVED error)`),l.refreshSlotsCache()},ask:function(t,n){x(`command %s is required to ask %s:%s`,e.name,n);let r=l.natMapper(n);l.connectionPool.findOrCreate(r),d(!1,`${r.host}:${r.port}`)},tryagain:r,clusterDown:r,connectionClosed:r,maxRedirections:function(n){t.call(e,n)},defaults:function(){t.call(e,n)}})}}d();function d(t,c){if(l.status===`end`){e.reject(new r.AbortError(`Cluster is ended.`));return}let d;if(l.status===`ready`||e.name===`cluster`){if(i&&i.redis)d=i.redis;else if(a.default.checkFlag(`ENTER_SUBSCRIBER_MODE`,e.name)||a.default.checkFlag(`EXIT_SUBSCRIBER_MODE`,e.name)){if(l.options.shardedSubscribers&&(e.name==`ssubscribe`||e.name==`sunsubscribe`)){let t=l.shardedSubscribers.getResponsibleSubscriber(s);if(!t){e.reject(new r.AbortError(`No sharded subscriber for slot: ${s}`));return}let n=-1;e.name==`ssubscribe`&&(n=l.shardedSubscribers.addChannels(e.getKeys())),e.name==`sunsubscribe`&&(n=l.shardedSubscribers.removeChannels(e.getKeys())),n===-1?e.reject(new r.AbortError(`Possible CROSSSLOT error: All channels must hash to the same slot`)):d=t.getInstance()}else d=l.subscriber.getInstance();if(!d){e.reject(new r.AbortError(`No subscriber for the cluster`));return}}else{if(!t){if(typeof s==`number`&&l.slots[s]){let t=l.slots[s];if(typeof o==`function`){let n=t.map(function(e){return l.connectionPool.getInstanceByKey(e)});d=o(n,e),Array.isArray(d)&&(d=(0,u.sample)(d)),d||=n[0]}else{let e;e=o===`all`?(0,u.sample)(t):o===`slave`&&t.length>1?(0,u.sample)(t,1):t[0],d=l.connectionPool.getInstanceByKey(e)}}c&&(d=l.connectionPool.getInstanceByKey(c),d.asking())}d||=(typeof o==`function`?null:l.connectionPool.getSampleInstance(o))||l.connectionPool.getSampleInstance(`all`)}i&&!i.redis&&(i.redis=d)}d?d.sendCommand(e,n):l.options.enableOfflineQueue?l.offlineQueue.push({command:e,stream:n,node:i}):e.reject(Error(`Cluster isn't ready and enableOfflineQueue options is false`))}return e.promise}sscanStream(e,t){return this.createScanStream(`sscan`,{key:e,options:t})}sscanBufferStream(e,t){return this.createScanStream(`sscanBuffer`,{key:e,options:t})}hscanStream(e,t){return this.createScanStream(`hscan`,{key:e,options:t})}hscanBufferStream(e,t){return this.createScanStream(`hscanBuffer`,{key:e,options:t})}zscanStream(e,t){return this.createScanStream(`zscan`,{key:e,options:t})}zscanBufferStream(e,t){return this.createScanStream(`zscanBuffer`,{key:e,options:t})}handleError(e,t,n){if(t.value===void 0?t.value=this.options.maxRedirections:--t.value,t.value<=0){n.maxRedirections(Error(`Too many Cluster redirections. Last error: `+e));return}let r=e.message.split(` `);if(r[0]===`MOVED`){let e=this.options.retryDelayOnMoved;e&&typeof e==`number`?this.delayQueue.push(`moved`,n.moved.bind(null,r[1],r[2]),{timeout:e}):n.moved(r[1],r[2])}else r[0]===`ASK`?n.ask(r[1],r[2]):r[0]===`TRYAGAIN`?this.delayQueue.push(`tryagain`,n.tryagain,{timeout:this.options.retryDelayOnTryAgain}):r[0]===`CLUSTERDOWN`&&this.options.retryDelayOnClusterDown>0?this.delayQueue.push(`clusterdown`,n.connectionClosed,{timeout:this.options.retryDelayOnClusterDown,callback:this.refreshSlotsCache.bind(this)}):e.message===u.CONNECTION_CLOSED_ERROR_MSG&&this.options.retryDelayOnFailover>0&&this.status===`ready`?this.delayQueue.push(`failover`,n.connectionClosed,{timeout:this.options.retryDelayOnFailover,callback:this.refreshSlotsCache.bind(this)}):n.defaults()}resetOfflineQueue(){this.offlineQueue=new y}clearNodesRefreshInterval(){this.slotsTimer&&=(clearTimeout(this.slotsTimer),null)}resetNodesRefreshInterval(){if(this.slotsTimer||!this.options.slotsRefreshInterval)return;let e=()=>{this.slotsTimer=setTimeout(()=>{x(`refreshing slot caches... (triggered by "slotsRefreshInterval" option)`),this.refreshSlotsCache(()=>{e()})},this.options.slotsRefreshInterval)};e()}setStatus(e){x(`status: %s -> %s`,this.status||`[empty]`,e),this.status=e,process.nextTick(()=>{this.emit(e)})}handleCloseEvent(e){var t;e&&x(`closed because %s`,e);let n;!this.manuallyClosing&&typeof this.options.clusterRetryStrategy==`function`&&(n=this.options.clusterRetryStrategy.call(this,++this.retryAttempts,e)),typeof n==`number`?(this.setStatus(`reconnecting`),this.reconnectTimeout=setTimeout(()=>{this.reconnectTimeout=null,x(`Cluster is disconnected. Retrying after %dms`,n),this.connect().catch(function(e){x(`Got error %s when reconnecting. Ignoring...`,e)})},n)):(this.options.shardedSubscribers&&((t=this.subscriberGroupEmitter)==null||t.removeAllListeners()),this.setStatus(`end`),this.flushQueue(Error(`None of startup nodes is available`)))}flushQueue(e){let t;for(;t=this.offlineQueue.shift();)t.command.reject(e)}executeOfflineCommands(){if(this.offlineQueue.length){x(`send %d commands in offline queue`,this.offlineQueue.length);let e=this.offlineQueue;this.resetOfflineQueue();let t;for(;t=e.shift();)this.sendCommand(t.command,t.stream,t.node)}}natMapper(e){let t=typeof e==`string`?e:`${e.host}:${e.port}`,n=null;return this.options.natMap&&typeof this.options.natMap==`function`?n=this.options.natMap(t):this.options.natMap&&typeof this.options.natMap==`object`&&(n=this.options.natMap[t]),n?(x(`NAT mapping %s -> %O`,t,n),Object.assign({},n)):typeof e==`string`?(0,v.nodeKeyToRedisOptions)(e):e}getInfoFromNode(e,t){if(!e)return t(Error(`Node is disconnected`));let n=e.duplicate({enableOfflineQueue:!0,enableReadyCheck:!1,retryStrategy:null,connectionName:(0,v.getConnectionName)(`refresher`,this.options.redisOptions&&this.options.redisOptions.connectionName)});n.on(`error`,u.noop),n.cluster(`SLOTS`,(0,u.timeout)((e,r)=>{if(n.disconnect(),e)return x(`error encountered running CLUSTER.SLOTS: %s`,e),t(e);if(this.status===`disconnecting`||this.status===`close`||this.status===`end`){x(`ignore CLUSTER.SLOTS results (count: %d) since cluster status is %s`,r.length,this.status),t();return}let i=[];x(`cluster slots result count: %d`,r.length);for(let e=0;e<r.length;++e){let t=r[e],n=t[0],a=t[1],o=[];for(let e=2;e<t.length;e++){if(!t[e][0])continue;let n=this.natMapper({host:t[e][0],port:t[e][1]});n.readOnly=e!==2,i.push(n),o.push(n.host+`:`+n.port)}x(`cluster slots result [%d]: slots %d~%d served by %s`,e,n,a,o);for(let e=n;e<=a;e++)this.slots[e]=o}this._groupsIds=Object.create(null);let a=0;for(let e=0;e<16384;e++){let t=(this.slots[e]||[]).join(`;`);if(!t.length){this._groupsBySlot[e]=void 0;continue}this._groupsIds[t]||(this._groupsIds[t]=++a),this._groupsBySlot[e]=this._groupsIds[t]}this.connectionPool.reset(i),this.options.shardedSubscribers&&this.shardedSubscribers.reset(this.slots,this.connectionPool.getNodes(`all`)).catch(e=>{x(`Error while starting subscribers: %s`,e)}),t()},this.options.slotsRefreshTimeout))}invokeReadyDelayedCallbacks(e){for(let t of this._readyDelayedCallbacks)process.nextTick(t,e);this._readyDelayedCallbacks=[]}readyCheck(e){this.cluster(`INFO`,(t,n)=>{if(t)return e(t);if(typeof n!=`string`)return e();let r,i=n.split(`\r
|
|
235
|
+
`);for(let e=0;e<i.length;++e){let t=i[e].split(`:`);if(t[0]===`cluster_state`){r=t[1];break}}r===`fail`?(x(`cluster state not ok (%s)`,r),e(null,r)):e()})}resolveSrv(e){return new Promise((t,n)=>{this.options.resolveSrv(e,(e,r)=>{if(e)return n(e);let i=this,a=(0,v.groupSrvRecords)(r),o=Object.keys(a).sort((e,t)=>parseInt(e)-parseInt(t));function s(e){if(!o.length)return n(e);let r=a[o[0]],c=(0,v.weightSrvRecords)(r);r.records.length||o.shift(),i.dnsLookup(c.name).then(e=>t({host:e,port:c.port}),s)}s()})})}dnsLookup(e){return new Promise((t,n)=>{this.options.dnsLookup(e,(r,i)=>{r?(x(`failed to resolve hostname %s to IP: %s`,e,r.message),n(r)):(x(`resolved hostname %s to IP %s`,e,i),t(i))})})}async resolveStartupNodeHostnames(){if(!Array.isArray(this.startupNodes)||this.startupNodes.length===0)throw Error("`startupNodes` should contain at least one node.");let e=(0,v.normalizeNodeOptions)(this.startupNodes),t=(0,v.getUniqueHostnamesFromOptions)(e);if(t.length===0)return e;let n=await Promise.all(t.map((this.options.useSRVRecords?this.resolveSrv:this.dnsLookup).bind(this))),r=(0,u.zipMap)(t,n);return e.map(e=>{let t=r.get(e.host);return t?this.options.useSRVRecords?Object.assign({},e,t):Object.assign({},e,{host:t}):e})}createScanStream(e,{key:t,options:n={}}){return new c.default({objectMode:!0,key:t,redis:this,command:e,...n})}createShardedSubscriberGroup(){this.subscriberGroupEmitter=new n.EventEmitter,this.shardedSubscribers=new b.default(this.subscriberGroupEmitter,this.options);let e=e=>{e instanceof o.default&&this.disconnect(!0)};this.subscriberGroupEmitter.on(`-node`,(t,n)=>{this.emit(`-node`,t,n),this.refreshSlotsCache(e)}),this.subscriberGroupEmitter.on(`subscriberConnectFailed`,({delay:t,error:n})=>{this.emit(`error`,n),setTimeout(()=>{this.refreshSlotsCache(e)},t)}),this.subscriberGroupEmitter.on(`moved`,()=>{this.refreshSlotsCache(e)}),this.subscriberGroupEmitter.on(`-subscriber`,()=>{this.emit(`-subscriber`)}),this.subscriberGroupEmitter.on(`+subscriber`,()=>{this.emit(`+subscriber`)}),this.subscriberGroupEmitter.on(`nodeError`,(e,t)=>{this.emit(`nodeError`,e,t)}),this.subscriberGroupEmitter.on(`subscribersReady`,()=>{this.emit(`subscribersReady`)});for(let e of[`smessage`,`smessageBuffer`])this.subscriberGroupEmitter.on(e,(t,n,r)=>{this.emit(e,t,n,r)})}};(0,d.default)(C,n.EventEmitter),(0,l.addTransactionSupport)(C.prototype),e.default=C})),IF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=(0,gF().Debug)(`AbstractConnector`);e.default=class{constructor(e){this.connecting=!1,this.disconnectTimeout=e}check(e){return!0}disconnect(){if(this.connecting=!1,this.stream){let e=this.stream,n=setTimeout(()=>{t(`stream %s:%s still open, destroying it`,e.remoteAddress,e.remotePort),e.destroy()},this.disconnectTimeout);e.on(`close`,()=>clearTimeout(n)),e.end()}}}})),LF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=h(`net`),n=h(`tls`),r=gF(),i=IF();e.default=class extends i.default{constructor(e){super(e.disconnectTimeout),this.options=e}connect(e){let{options:i}=this;this.connecting=!0;let a;return`path`in i&&i.path?a={path:i.path}:(a={},`port`in i&&i.port!=null&&(a.port=i.port),`host`in i&&i.host!=null&&(a.host=i.host),`family`in i&&i.family!=null&&(a.family=i.family)),i.tls&&Object.assign(a,i.tls),new Promise((e,o)=>{process.nextTick(()=>{if(!this.connecting){o(Error(r.CONNECTION_CLOSED_ERROR_MSG));return}try{i.tls?this.stream=(0,n.connect)(a):this.stream=(0,t.createConnection)(a)}catch(e){o(e);return}this.stream.once(`error`,e=>{this.firstError=e}),e(this.stream)})})}}})),RF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});function t(e,t){return(e.host||`127.0.0.1`)===(t.host||`127.0.0.1`)&&(e.port||26379)===(t.port||26379)}e.default=class{constructor(e){this.cursor=0,this.sentinels=e.slice(0)}next(){let e=this.cursor>=this.sentinels.length;return{done:e,value:e?void 0:this.sentinels[this.cursor++]}}reset(e){e&&this.sentinels.length>1&&this.cursor!==1&&this.sentinels.unshift(...this.sentinels.splice(this.cursor-1)),this.cursor=0}add(e){for(let n=0;n<this.sentinels.length;n++)if(t(e,this.sentinels[n]))return!1;return this.sentinels.push(e),!0}toString(){return`${JSON.stringify(this.sentinels)} @${this.cursor}`}}})),zF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.FailoverDetector=void 0;let t=(0,gF().Debug)(`FailoverDetector`),n=`+switch-master`;e.FailoverDetector=class{constructor(e,t){this.isDisconnected=!1,this.connector=e,this.sentinels=t}cleanup(){this.isDisconnected=!0;for(let e of this.sentinels)e.client.disconnect()}async subscribe(){t(`Starting FailoverDetector`);let e=[];for(let r of this.sentinels){let i=r.client.subscribe(n).catch(e=>{t(`Failed to subscribe to failover messages on sentinel %s:%s (%s)`,r.address.host||`127.0.0.1`,r.address.port||26739,e.message)});e.push(i),r.client.on(`message`,e=>{!this.isDisconnected&&e===n&&this.disconnect()})}await Promise.all(e)}disconnect(){this.isDisconnected=!0,t(`Failover detected, disconnecting`),this.connector.disconnect()}}})),BF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SentinelIterator=void 0;let t=h(`net`),n=gF(),r=h(`tls`),i=RF();e.SentinelIterator=i.default;let a=IF(),o=XF(),s=zF(),c=(0,n.Debug)(`SentinelConnector`);e.default=class extends a.default{constructor(e){if(super(e.disconnectTimeout),this.options=e,this.emitter=null,this.failoverDetector=null,!this.options.sentinels.length)throw Error(`Requires at least one sentinel to connect to.`);if(!this.options.name)throw Error(`Requires the name of master.`);this.sentinelIterator=new i.default(this.options.sentinels)}check(e){let t=!e.role||this.options.role===e.role;return t||(c(`role invalid, expected %s, but got %s`,this.options.role,e.role),this.sentinelIterator.next(),this.sentinelIterator.next(),this.sentinelIterator.reset(!0)),t}disconnect(){super.disconnect(),this.failoverDetector&&this.failoverDetector.cleanup()}connect(e){this.connecting=!0,this.retryAttempts=0;let i,a=async()=>{let o=this.sentinelIterator.next();if(o.done){this.sentinelIterator.reset(!1);let t=typeof this.options.sentinelRetryStrategy==`function`?this.options.sentinelRetryStrategy(++this.retryAttempts):null,n=typeof t==`number`?`All sentinels are unreachable. Retrying from scratch after ${t}ms.`:`All sentinels are unreachable and retry is disabled.`;i&&(n+=` Last error: ${i.message}`),c(n);let r=Error(n);if(typeof t==`number`)return e(`error`,r),await new Promise(e=>setTimeout(e,t)),a();throw r}let s=null,l=null;try{s=await this.resolve(o.value)}catch(e){l=e}if(!this.connecting)throw Error(n.CONNECTION_CLOSED_ERROR_MSG);let u=o.value.host+`:`+o.value.port;if(s)return c(`resolved: %s:%s from sentinel %s`,s.host,s.port,u),this.options.enableTLSForSentinelMode&&this.options.tls?(Object.assign(s,this.options.tls),this.stream=(0,r.connect)(s),this.stream.once(`secureConnect`,this.initFailoverDetector.bind(this))):(this.stream=(0,t.createConnection)(s),this.stream.once(`connect`,this.initFailoverDetector.bind(this))),this.stream.once(`error`,e=>{this.firstError=e}),this.stream;{let t=l?`failed to connect to sentinel `+u+` because `+l.message:`connected to sentinel `+u+` successfully, but got an invalid reply: `+s;return c(t),e(`sentinelError`,Error(t)),l&&(i=l),a()}};return a()}async updateSentinels(e){if(!this.options.updateSentinels)return;let t=await e.sentinel(`sentinels`,this.options.name);Array.isArray(t)&&(t.map(n.packObject).forEach(e=>{if((e.flags?e.flags.split(`,`):[]).indexOf(`disconnected`)===-1&&e.ip&&e.port){let t=this.sentinelNatResolve(u(e));this.sentinelIterator.add(t)&&c(`adding sentinel %s:%s`,t.host,t.port)}}),c(`Updated internal sentinels: %s`,this.sentinelIterator))}async resolveMaster(e){let t=await e.sentinel(`get-master-addr-by-name`,this.options.name);return await this.updateSentinels(e),this.sentinelNatResolve(Array.isArray(t)?{host:t[0],port:Number(t[1])}:null)}async resolveSlave(e){let t=await e.sentinel(`slaves`,this.options.name);if(!Array.isArray(t))return null;let r=t.map(n.packObject).filter(e=>e.flags&&!e.flags.match(/(disconnected|s_down|o_down)/));return this.sentinelNatResolve(l(r,this.options.preferredSlaves))}sentinelNatResolve(e){if(!e||!this.options.natMap)return e;let t=`${e.host}:${e.port}`,n=e;return typeof this.options.natMap==`function`?n=this.options.natMap(t)||e:typeof this.options.natMap==`object`&&(n=this.options.natMap[t]||e),n}connectToSentinel(e,t){return new o.default({port:e.port||26379,host:e.host,username:this.options.sentinelUsername||null,password:this.options.sentinelPassword||null,family:e.family||(`path`in this.options&&this.options.path?void 0:this.options.family),tls:this.options.sentinelTLS,retryStrategy:null,enableReadyCheck:!1,connectTimeout:this.options.connectTimeout,commandTimeout:this.options.sentinelCommandTimeout,...t})}async resolve(e){let t=this.connectToSentinel(e);t.on(`error`,d);try{return this.options.role===`slave`?await this.resolveSlave(t):await this.resolveMaster(t)}finally{t.disconnect()}}async initFailoverDetector(){var e;if(!this.options.failoverDetector)return;this.sentinelIterator.reset(!0);let t=[];for(;t.length<this.options.sentinelMaxConnections;){let{done:e,value:n}=this.sentinelIterator.next();if(e)break;let r=this.connectToSentinel(n,{lazyConnect:!0,retryStrategy:this.options.sentinelReconnectStrategy});r.on(`reconnecting`,()=>{var e;(e=this.emitter)==null||e.emit(`sentinelReconnecting`)}),t.push({address:n,client:r})}this.sentinelIterator.reset(!1),this.failoverDetector&&this.failoverDetector.cleanup(),this.failoverDetector=new s.FailoverDetector(this,t),await this.failoverDetector.subscribe(),(e=this.emitter)==null||e.emit(`failoverSubscribed`)}};function l(e,t){if(e.length===0)return null;let r;if(typeof t==`function`)r=t(e);else if(typeof t==`object`&&t){let n=Array.isArray(t)?t:[t];n.sort((e,t)=>(e.prio||=1,t.prio||=1,e.prio<t.prio?-1:e.prio>t.prio?1:0));for(let t=0;t<n.length;t++){for(let i=0;i<e.length;i++){let a=e[i];if(a.ip===n[t].ip&&a.port===n[t].port){r=a;break}}if(r)break}}return r||=(0,n.sample)(e),u(r)}function u(e){return{host:e.ip,port:Number(e.port)}}function d(){}})),VF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.SentinelConnector=e.StandaloneConnector=void 0,e.StandaloneConnector=LF().default,e.SentinelConnector=BF().default})),HF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=iF();e.default=class extends t.AbortError{constructor(e){let t=`Reached the max retries per request limit (which is ${e}). Refer to "maxRetriesPerRequest" option for details.`;super(t),Error.captureStackTrace(this,this.constructor)}get name(){return this.constructor.name}}})),UF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.MaxRetriesPerRequestError=void 0,e.MaxRetriesPerRequestError=HF().default})),WF=u(((e,t)=>{let n=h(`buffer`).Buffer,r=h(`string_decoder`).StringDecoder,i=new r,a=iF(),o=a.ReplyError,s=a.ParserError;var c=n.allocUnsafe(32*1024),l=0,u=null,d=0,f=0;function p(e){let t=e.buffer.length-1;var n=e.offset,r=0,i=1;for(e.buffer[n]===45&&(i=-1,n++);n<t;){let t=e.buffer[n++];if(t===13)return e.offset=n+1,i*r;r=r*10+(t-48)}}function m(e){let t=e.buffer.length-1;var n=e.offset,r=0,i=``;for(e.buffer[n]===45&&(i+=`-`,n++);n<t;){var a=e.buffer[n++];if(a===13)return e.offset=n+1,r!==0&&(i+=r),i;r>429496728?(i+=r*10+(a-48),r=0):a===48&&r===0?i+=0:r=r*10+(a-48)}}function g(e){let t=e.offset,n=e.buffer,r=n.length-1;for(var i=t;i<r;)if(n[i++]===13)return e.offset=i+1,e.optionReturnBuffers===!0?e.buffer.slice(t,i-1):e.buffer.toString(`utf8`,t,i-1)}function _(e){let t=e.buffer.length-1;for(var n=e.offset,r=0;n<t;){let t=e.buffer[n++];if(t===13)return e.offset=n+1,r;r=r*10+(t-48)}}function v(e){return e.optionStringNumbers===!0?m(e):p(e)}function y(e){let t=_(e);if(t===void 0)return;if(t<0)return null;let n=e.offset+t;if(n+2>e.buffer.length){e.bigStrSize=n+2,e.totalChunkSize=e.buffer.length,e.bufferCache.push(e.buffer);return}let r=e.offset;return e.offset=n+2,e.optionReturnBuffers===!0?e.buffer.slice(r,n):e.buffer.toString(`utf8`,r,n)}function b(e){var t=g(e);if(t!==void 0)return e.optionReturnBuffers===!0&&(t=t.toString()),new o(t)}function x(e,t){let n=new s(`Protocol error, got `+JSON.stringify(String.fromCharCode(t))+` as reply type byte`,JSON.stringify(e.buffer),e.offset);e.buffer=null,e.returnFatalError(n)}function S(e){let t=_(e);if(t!==void 0)return t<0?null:ee(e,Array(t),0)}function C(e,t,n){e.arrayCache.push(t),e.arrayPos.push(n)}function w(e){let t=e.arrayCache.pop();var n=e.arrayPos.pop();if(e.arrayCache.length){let r=w(e);if(r===void 0){C(e,t,n);return}t[n++]=r}return ee(e,t,n)}function ee(e,t,n){let r=e.buffer.length;for(;n<t.length;){let i=e.offset;if(e.offset>=r){C(e,t,n);return}let a=te(e,e.buffer[e.offset++]);if(a===void 0){e.arrayCache.length||e.bufferCache.length||(e.offset=i),C(e,t,n);return}t[n]=a,n++}return t}function te(e,t){switch(t){case 36:return y(e);case 43:return g(e);case 42:return S(e);case 58:return v(e);case 45:return b(e);default:return x(e,t)}}function T(){if(c.length>50*1024)if(d===1||f>d*2){let e=Math.floor(c.length/10),t=e<l?l:e;l=0,c=c.slice(t,c.length)}else f++,d--;else clearInterval(u),d=0,f=0,u=null}function E(e){if(c.length<e+l){let t=e>1024*1024*75?2:3;l>1024*1024*111&&(l=1024*1024*50),c=n.allocUnsafe(e*t+l),l=0,d++,u===null&&(u=setInterval(T,50))}}function ne(e){let t=e.bufferCache,n=e.offset;var r=t.length,a=e.bigStrSize-e.totalChunkSize;if(e.offset=a,a<=2){if(r===2)return t[0].toString(`utf8`,n,t[0].length+a-2);r--,a=t[t.length-2].length+a}for(var o=i.write(t[0].slice(n)),s=1;s<r-1;s++)o+=i.write(t[s]);return o+=i.end(t[s].slice(0,a-2)),o}function re(e){let t=e.bufferCache,n=e.offset,r=e.bigStrSize-n-2;var i=t.length,a=e.bigStrSize-e.totalChunkSize;if(e.offset=a,a<=2){if(i===2)return t[0].slice(n,t[0].length+a-2);i--,a=t[t.length-2].length+a}E(r);let o=l;t[0].copy(c,o,n,t[0].length),l+=t[0].length-n;for(var s=1;s<i-1;s++)t[s].copy(c,l),l+=t[s].length;return t[s].copy(c,l,0,a-2),l+=a-2,c.slice(o,l)}t.exports=class{constructor(e){if(!e)throw TypeError(`Options are mandatory.`);if(typeof e.returnError!=`function`||typeof e.returnReply!=`function`)throw TypeError(`The returnReply and returnError options have to be functions.`);this.setReturnBuffers(!!e.returnBuffers),this.setStringNumbers(!!e.stringNumbers),this.returnError=e.returnError,this.returnFatalError=e.returnFatalError||e.returnError,this.returnReply=e.returnReply,this.reset()}reset(){this.offset=0,this.buffer=null,this.bigStrSize=0,this.totalChunkSize=0,this.bufferCache=[],this.arrayCache=[],this.arrayPos=[]}setReturnBuffers(e){if(typeof e!=`boolean`)throw TypeError(`The returnBuffers argument has to be a boolean`);this.optionReturnBuffers=e}setStringNumbers(e){if(typeof e!=`boolean`)throw TypeError(`The stringNumbers argument has to be a boolean`);this.optionStringNumbers=e}execute(e){if(this.buffer===null)this.buffer=e,this.offset=0;else if(this.bigStrSize===0){let t=this.buffer.length,r=t-this.offset,i=n.allocUnsafe(r+e.length);if(this.buffer.copy(i,0,this.offset,t),e.copy(i,r,0,e.length),this.buffer=i,this.offset=0,this.arrayCache.length){let e=w(this);if(e===void 0)return;this.returnReply(e)}}else if(this.totalChunkSize+e.length>=this.bigStrSize){this.bufferCache.push(e);var t=this.optionReturnBuffers?re(this):ne(this);if(this.bigStrSize=0,this.bufferCache=[],this.buffer=e,this.arrayCache.length&&(this.arrayCache[0][this.arrayPos[0]++]=t,t=w(this),t===void 0))return;this.returnReply(t)}else{this.bufferCache.push(e),this.totalChunkSize+=e.length;return}for(;this.offset<this.buffer.length;){let e=this.offset,t=this.buffer[this.offset++],n=te(this,t);if(n===void 0){this.arrayCache.length||this.bufferCache.length||(this.offset=e);return}t===45?this.returnError(n):this.returnReply(n)}this.buffer=null}}})),GF=u(((e,t)=>{t.exports=WF()})),KF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=class{constructor(){this.set={subscribe:{},psubscribe:{},ssubscribe:{}}}add(e,n){this.set[t(e)][n]=!0}del(e,n){delete this.set[t(e)][n]}channels(e){return Object.keys(this.set[t(e)])}isEmpty(){return this.channels(`subscribe`).length===0&&this.channels(`psubscribe`).length===0&&this.channels(`ssubscribe`).length===0}};function t(e){return e===`unsubscribe`?`subscribe`:e===`punsubscribe`?`psubscribe`:e===`sunsubscribe`?`ssubscribe`:e}})),qF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=vF(),n=gF(),r=GF(),i=KF(),a=(0,n.Debug)(`dataHandler`);e.default=class{constructor(e,t){this.redis=e;let n=new r({stringNumbers:t.stringNumbers,returnBuffers:!0,returnError:e=>{this.returnError(e)},returnFatalError:e=>{this.returnFatalError(e)},returnReply:e=>{this.returnReply(e)}});e.stream.prependListener(`data`,e=>{n.execute(e)}),e.stream.resume()}returnFatalError(e){e.message+=`. Please report this.`,this.redis.recoverFromFatalError(e,e,{offlineQueue:!1})}returnError(e){let t=this.shiftCommand(e);if(t){if(e.command={name:t.command.name,args:t.command.args},t.command.name==`ssubscribe`&&e.message.includes(`MOVED`)){this.redis.emit(`moved`);return}this.redis.handleReconnection(e,t)}}returnReply(e){if(this.handleMonitorReply(e)||this.handleSubscriberReply(e))return;let n=this.shiftCommand(e);n&&(t.default.checkFlag(`ENTER_SUBSCRIBER_MODE`,n.command.name)?(this.redis.condition.subscriber=new i.default,this.redis.condition.subscriber.add(n.command.name,e[1].toString()),s(n.command,e[2])||this.redis.commandQueue.unshift(n)):t.default.checkFlag(`EXIT_SUBSCRIBER_MODE`,n.command.name)?c(n.command,e[2])||this.redis.commandQueue.unshift(n):n.command.resolve(e))}handleSubscriberReply(e){if(!this.redis.condition.subscriber)return!1;let t=Array.isArray(e)?e[0].toString():null;switch(a(`receive reply "%s" in subscriber mode`,t),t){case`message`:this.redis.listeners(`message`).length>0&&this.redis.emit(`message`,e[1].toString(),e[2]?e[2].toString():``),this.redis.emit(`messageBuffer`,e[1],e[2]);break;case`pmessage`:{let t=e[1].toString();this.redis.listeners(`pmessage`).length>0&&this.redis.emit(`pmessage`,t,e[2].toString(),e[3].toString()),this.redis.emit(`pmessageBuffer`,t,e[2],e[3]);break}case`smessage`:this.redis.listeners(`smessage`).length>0&&this.redis.emit(`smessage`,e[1].toString(),e[2]?e[2].toString():``),this.redis.emit(`smessageBuffer`,e[1],e[2]);break;case`ssubscribe`:case`subscribe`:case`psubscribe`:{let n=e[1].toString();this.redis.condition.subscriber.add(t,n);let r=this.shiftCommand(e);if(!r)return;s(r.command,e[2])||this.redis.commandQueue.unshift(r);break}case`sunsubscribe`:case`unsubscribe`:case`punsubscribe`:{let n=e[1]?e[1].toString():null;n&&this.redis.condition.subscriber.del(t,n);let r=e[2];Number(r)===0&&(this.redis.condition.subscriber=!1);let i=this.shiftCommand(e);if(!i)return;c(i.command,r)||this.redis.commandQueue.unshift(i);break}default:{let t=this.shiftCommand(e);if(!t)return;t.command.resolve(e)}}return!0}handleMonitorReply(e){if(this.redis.status!==`monitoring`)return!1;let t=e.toString();if(t===`OK`)return!1;let n=t.indexOf(` `),r=t.slice(0,n),i=t.indexOf(`"`),a=t.slice(i+1,-1).split(`" "`).map(e=>e.replace(/\\"/g,`"`)),o=t.slice(n+2,i-2).split(` `);return this.redis.emit(`monitor`,r,a,o[1],o[0]),!0}shiftCommand(e){let t=this.redis.commandQueue.shift();if(!t){let t=Error(`Command queue state error. If you can reproduce this, please report it.`+(e instanceof Error?` Last error: ${e.message}`:` Last reply: ${e.toString()}`));return this.redis.emit(`error`,t),null}return t}};let o=new WeakMap;function s(e,t){let n=o.has(e)?o.get(e):e.args.length;return--n,n<=0?(e.resolve(t),o.delete(e),!0):(o.set(e,n),!1)}function c(e,t){let n=o.has(e)?o.get(e):e.args.length;return n===0?Number(t)===0?(o.delete(e),e.resolve(t),!0):!1:(--n,n<=0?(e.resolve(t),!0):(o.set(e,n),!1))}})),JF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readyHandler=e.errorHandler=e.closeHandler=e.connectHandler=void 0;let t=iF(),n=vF(),r=UF(),i=gF(),a=qF(),o=(0,i.Debug)(`connection`);function s(t){return function(){t.setStatus(`connect`),t.resetCommandQueue();let n=!1,{connectionEpoch:r}=t;t.condition.auth&&t.auth(t.condition.auth,function(e){r===t.connectionEpoch&&e&&(e.message.indexOf(`no password is set`)===-1?e.message.indexOf(`without any password configured for the default user`)===-1?e.message.indexOf(`wrong number of arguments for 'auth' command`)===-1?(n=!0,t.recoverFromFatalError(e,e)):console.warn(`[ERROR] The server returned "wrong number of arguments for 'auth' command". You are probably passing both username and password to Redis version 5 or below. You should only pass the 'password' option for Redis version 5 and under.`):console.warn("[WARN] This Redis server's `default` user does not require a password, but a password was supplied"):console.warn(`[WARN] Redis server does not require a password, but a password was supplied.`))}),t.condition.select&&t.select(t.condition.select).catch(e=>{t.silentEmit(`error`,e)}),new a.default(t,{stringNumbers:t.options.stringNumbers});let s=[];t.options.connectionName&&(o(`set the connection name [%s]`,t.options.connectionName),s.push(t.client(`setname`,t.options.connectionName).catch(i.noop))),t.options.disableClientInfo||(o(`set the client info`),s.push((0,i.getPackageMeta)().then(e=>t.client(`SETINFO`,`LIB-VER`,e.version).catch(i.noop)).catch(i.noop)),s.push(t.client(`SETINFO`,`LIB-NAME`,t.options?.clientInfoTag?`ioredis(${t.options.clientInfoTag})`:`ioredis`).catch(i.noop))),Promise.all(s).catch(i.noop).finally(()=>{t.options.enableReadyCheck||e.readyHandler(t)(),t.options.enableReadyCheck&&t._readyCheck(function(i,a){r===t.connectionEpoch&&(i?n||t.recoverFromFatalError(Error(`Ready check failed: `+i.message),i):t.connector.check(a)?e.readyHandler(t)():t.disconnect(!0))})})}}e.connectHandler=s;function c(e){let n=new t.AbortError(`Command aborted due to connection close`);return n.command={name:e.name,args:e.args},n}function l(e){let t=0;for(let n=0;n<e.length;){let r=e.peekAt(n)?.command,i=r.pipelineIndex;if((i===void 0||i===0)&&(t=0),i!==void 0&&i!==t++){e.remove(n,1),r.reject(c(r));continue}n++}}function u(e){for(let t=0;t<e.length;){let n=e.peekAt(t)?.command;if(n.name===`multi`)break;if(n.name===`exec`){e.remove(t,1),n.reject(c(n));break}n.inTransaction?(e.remove(t,1),n.reject(c(n))):t++}}function d(e){return function(){let n=e.status;if(e.setStatus(`close`),e.commandQueue.length&&l(e.commandQueue),e.offlineQueue.length&&u(e.offlineQueue),n===`ready`&&(e.prevCondition||=e.condition,e.commandQueue.length&&(e.prevCommandQueue=e.commandQueue)),e.manuallyClosing)return e.manuallyClosing=!1,o(`skip reconnecting since the connection is manually closed.`),t();if(typeof e.options.retryStrategy!=`function`)return o("skip reconnecting because `retryStrategy` is not a function"),t();let a=e.options.retryStrategy(++e.retryAttempts);if(typeof a!=`number`)return o("skip reconnecting because `retryStrategy` doesn't return a number"),t();o(`reconnect in %sms`,a),e.setStatus(`reconnecting`,a),e.reconnectTimeout=setTimeout(function(){e.reconnectTimeout=null,e.connect().catch(i.noop)},a);let{maxRetriesPerRequest:s}=e.options;typeof s==`number`&&(s<0?o(`maxRetriesPerRequest is negative, ignoring...`):e.retryAttempts%(s+1)===0&&(o(`reach maxRetriesPerRequest limitation, flushing command queue...`),e.flushQueue(new r.MaxRetriesPerRequestError(s))))};function t(){e.setStatus(`end`),e.flushQueue(Error(i.CONNECTION_CLOSED_ERROR_MSG))}}e.closeHandler=d;function f(e){return function(t){o(`error: %s`,t),e.silentEmit(`error`,t)}}e.errorHandler=f;function p(e){return function(){if(e.setStatus(`ready`),e.retryAttempts=0,e.options.monitor){e.call(`monitor`).then(()=>e.setStatus(`monitoring`),t=>e.emit(`error`,t));let{sendCommand:t}=e;e.sendCommand=function(r){return n.default.checkFlag(`VALID_IN_MONITOR_MODE`,r.name)?t.call(e,r):(r.reject(Error(`Connection is in monitoring mode, can't process commands.`)),r.promise)},e.once(`close`,function(){delete e.sendCommand});return}let t=e.prevCondition?e.prevCondition.select:e.condition.select;if(e.options.readOnly&&(o(`set the connection to readonly mode`),e.readonly().catch(i.noop)),e.prevCondition){let n=e.prevCondition;if(e.prevCondition=null,n.subscriber&&e.options.autoResubscribe){e.condition.select!==t&&(o(`connect to db [%d]`,t),e.select(t));let r=n.subscriber.channels(`subscribe`);r.length&&(o(`subscribe %d channels`,r.length),e.subscribe(r));let i=n.subscriber.channels(`psubscribe`);i.length&&(o(`psubscribe %d channels`,i.length),e.psubscribe(i));let a=n.subscriber.channels(`ssubscribe`);if(a.length){o(`ssubscribe %s`,a.length);for(let t of a)e.ssubscribe(t)}}}if(e.prevCommandQueue)if(e.options.autoResendUnfulfilledCommands)for(o(`resend %d unfulfilled commands`,e.prevCommandQueue.length);e.prevCommandQueue.length>0;){let t=e.prevCommandQueue.shift();t.select!==e.condition.select&&t.command.name!==`select`&&e.select(t.select),e.sendCommand(t.command,t.stream)}else e.prevCommandQueue=null;if(e.offlineQueue.length){o(`send %d commands in offline queue`,e.offlineQueue.length);let t=e.offlineQueue;for(e.resetOfflineQueue();t.length>0;){let n=t.shift();n.select!==e.condition.select&&n.command.name!==`select`&&e.select(n.select),e.sendCommand(n.command,n.stream)}}e.condition.select!==t&&(o(`connect to db [%d]`,t),e.select(t))}}e.readyHandler=p})),YF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_REDIS_OPTIONS=void 0,e.DEFAULT_REDIS_OPTIONS={port:6379,host:`localhost`,family:0,connectTimeout:1e4,disconnectTimeout:2e3,retryStrategy:function(e){return Math.min(e*50,2e3)},keepAlive:0,noDelay:!0,connectionName:null,disableClientInfo:!1,clientInfoTag:void 0,sentinels:null,name:null,role:`master`,sentinelRetryStrategy:function(e){return Math.min(e*10,1e3)},sentinelReconnectStrategy:function(){return 6e4},natMap:null,enableTLSForSentinelMode:!1,updateSentinels:!0,failoverDetector:!1,username:null,password:null,db:0,enableOfflineQueue:!0,enableReadyCheck:!0,autoResubscribe:!0,autoResendUnfulfilledCommands:!0,lazyConnect:!1,keyPrefix:``,reconnectOnError:null,readOnly:!1,stringNumbers:!1,maxRetriesPerRequest:20,maxLoadingRetryTime:1e4,enableAutoPipelining:!1,autoPipeliningIgnoredCommands:[],sentinelMaxConnections:10,blockingTimeoutGrace:100}})),XF=u((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=$P(),n=h(`events`),r=tF(),i=FF(),a=vF(),o=VF(),s=BF(),c=JF(),l=YF(),u=bF(),d=TF(),f=gF(),p=EF(),m=CF(),g=cF(),_=jF(),v=(0,f.Debug)(`redis`);var y=class e extends m.default{constructor(e,t,r){if(super(),this.status=`wait`,this.isCluster=!1,this.reconnectTimeout=null,this.connectionEpoch=0,this.retryAttempts=0,this.manuallyClosing=!1,this._autoPipelines=new Map,this._runningAutoPipelines=new Set,this.parseOptions(e,t,r),n.EventEmitter.call(this),this.resetCommandQueue(),this.resetOfflineQueue(),this.options.Connector)this.connector=new this.options.Connector(this.options);else if(this.options.sentinels){let e=new s.default(this.options);e.emitter=this,this.connector=e}else this.connector=new o.StandaloneConnector(this.options);this.options.scripts&&Object.entries(this.options.scripts).forEach(([e,t])=>{this.defineCommand(e,t)}),this.options.lazyConnect?this.setStatus(`wait`):this.connect().catch(g.noop)}static createClient(...t){return new e(...t)}get autoPipelineQueueSize(){let e=0;for(let t of this._autoPipelines.values())e+=t.length;return e}connect(e){let t=new Promise((e,t)=>{if(this.status===`connecting`||this.status===`connect`||this.status===`ready`){t(Error(`Redis is already connecting/connected`));return}this.connectionEpoch+=1,this.setStatus(`connecting`);let{options:n}=this;this.condition={select:n.db,auth:n.username?[n.username,n.password]:n.password,subscriber:!1};let i=this;(0,r.default)(this.connector.connect(function(e,t){i.silentEmit(e,t)}),function(r,a){if(r){i.flushQueue(r),i.silentEmit(`error`,r),t(r),i.setStatus(`end`);return}let o=n.tls?`secureConnect`:`connect`;if(`sentinels`in n&&n.sentinels&&!n.enableTLSForSentinelMode&&(o=`connect`),i.stream=a,n.noDelay&&a.setNoDelay(!0),typeof n.keepAlive==`number`&&(a.connecting?a.once(o,()=>{a.setKeepAlive(!0,n.keepAlive)}):a.setKeepAlive(!0,n.keepAlive)),a.connecting){if(a.once(o,c.connectHandler(i)),n.connectTimeout){let e=!1;a.setTimeout(n.connectTimeout,function(){if(e)return;a.setTimeout(0),a.destroy();let t=Error(`connect ETIMEDOUT`);t.errorno=`ETIMEDOUT`,t.code=`ETIMEDOUT`,t.syscall=`connect`,c.errorHandler(i)(t)}),a.once(o,function(){e=!0,a.setTimeout(0)})}}else if(a.destroyed){let e=i.connector.firstError;e&&process.nextTick(()=>{c.errorHandler(i)(e)}),process.nextTick(c.closeHandler(i))}else process.nextTick(c.connectHandler(i));a.destroyed||(a.once(`error`,c.errorHandler(i)),a.once(`close`,c.closeHandler(i)));let s=function(){i.removeListener(`close`,l),e()};var l=function(){i.removeListener(`ready`,s),t(Error(f.CONNECTION_CLOSED_ERROR_MSG))};i.once(`ready`,s),i.once(`close`,l)})});return(0,r.default)(t,e)}disconnect(e=!1){e||(this.manuallyClosing=!0),this.reconnectTimeout&&!e&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.status===`wait`?c.closeHandler(this)():this.connector.disconnect()}end(){this.disconnect()}duplicate(t){return new e({...this.options,...t})}get mode(){return this.options.monitor?`monitor`:this.condition?.subscriber?`subscriber`:`normal`}monitor(e){let t=this.duplicate({monitor:!0,lazyConnect:!1});return(0,r.default)(new Promise(function(e,n){t.once(`error`,n),t.once(`monitoring`,function(){e(t)})}),e)}sendCommand(e,n){if(this.status===`wait`&&this.connect().catch(g.noop),this.status===`end`)return e.reject(Error(f.CONNECTION_CLOSED_ERROR_MSG)),e.promise;if(this.condition?.subscriber&&!a.default.checkFlag(`VALID_IN_SUBSCRIBER_MODE`,e.name))return e.reject(Error(`Connection in subscriber mode, only subscriber commands may be used`)),e.promise;typeof this.options.commandTimeout==`number`&&e.setTimeout(this.options.commandTimeout);let r=this.getBlockingTimeoutInMs(e),i=this.status===`ready`||!n&&this.status===`connect`&&(0,t.exists)(e.name,{caseInsensitive:!0})&&((0,t.hasFlag)(e.name,`loading`,{nameCaseInsensitive:!0})||a.default.checkFlag(`HANDSHAKE_COMMANDS`,e.name));if(this.stream&&this.stream.writable?this.stream._writableState&&this.stream._writableState.ended&&(i=!1):i=!1,i)v.enabled&&v(`write command[%s]: %d -> %s(%o)`,this._getDescription(),this.condition?.select,e.name,e.args),n?`isPipeline`in n&&n.isPipeline?n.write(e.toWritable(n.destination.redis.stream)):n.write(e.toWritable(n)):this.stream.write(e.toWritable(this.stream)),this.commandQueue.push({command:e,stream:n,select:this.condition.select}),r!==void 0&&e.setBlockingTimeout(r),a.default.checkFlag(`WILL_DISCONNECT`,e.name)&&(this.manuallyClosing=!0),this.options.socketTimeout!==void 0&&this.socketTimeoutTimer===void 0&&this.setSocketTimeout();else{if(!this.options.enableOfflineQueue)return e.reject(Error(`Stream isn't writeable and enableOfflineQueue options is false`)),e.promise;if(e.name===`quit`&&this.offlineQueue.length===0)return this.disconnect(),e.resolve(Buffer.from(`OK`)),e.promise;if(v.enabled&&v(`queue command[%s]: %d -> %s(%o)`,this._getDescription(),this.condition.select,e.name,e.args),this.offlineQueue.push({command:e,stream:n,select:this.condition.select}),a.default.checkFlag(`BLOCKING_COMMANDS`,e.name)){let t=this.getConfiguredBlockingTimeout();t!==void 0&&e.setBlockingTimeout(t)}}if(e.name===`select`&&(0,f.isInt)(e.args[0])){let t=parseInt(e.args[0],10);this.condition.select!==t&&(this.condition.select=t,this.emit(`select`,t),v(`switch to db [%d]`,this.condition.select))}return e.promise}getBlockingTimeoutInMs(e){if(!a.default.checkFlag(`BLOCKING_COMMANDS`,e.name))return;let t=this.getConfiguredBlockingTimeout();if(t===void 0)return;let n=e.extractBlockingTimeout();if(typeof n==`number`)return n>0?n+(this.options.blockingTimeoutGrace??l.DEFAULT_REDIS_OPTIONS.blockingTimeoutGrace):t;if(n===null)return t}getConfiguredBlockingTimeout(){if(typeof this.options.blockingTimeout==`number`&&this.options.blockingTimeout>0)return this.options.blockingTimeout}setSocketTimeout(){this.socketTimeoutTimer=setTimeout(()=>{this.stream.destroy(Error(`Socket timeout. Expecting data, but didn't receive any in ${this.options.socketTimeout}ms.`)),this.socketTimeoutTimer=void 0},this.options.socketTimeout),this.stream.once(`data`,()=>{clearTimeout(this.socketTimeoutTimer),this.socketTimeoutTimer=void 0,this.commandQueue.length!==0&&this.setSocketTimeout()})}scanStream(e){return this.createScanStream(`scan`,{options:e})}scanBufferStream(e){return this.createScanStream(`scanBuffer`,{options:e})}sscanStream(e,t){return this.createScanStream(`sscan`,{key:e,options:t})}sscanBufferStream(e,t){return this.createScanStream(`sscanBuffer`,{key:e,options:t})}hscanStream(e,t){return this.createScanStream(`hscan`,{key:e,options:t})}hscanBufferStream(e,t){return this.createScanStream(`hscanBuffer`,{key:e,options:t})}zscanStream(e,t){return this.createScanStream(`zscan`,{key:e,options:t})}zscanBufferStream(e,t){return this.createScanStream(`zscanBuffer`,{key:e,options:t})}silentEmit(e,t){let n;if(!(e===`error`&&(n=t,this.status===`end`||this.manuallyClosing&&n instanceof Error&&(n.message===f.CONNECTION_CLOSED_ERROR_MSG||n.syscall===`connect`||n.syscall===`read`))))return this.listeners(e).length>0?this.emit.apply(this,arguments):(n&&n instanceof Error&&console.error(`[ioredis] Unhandled error event:`,n.stack),!1)}recoverFromFatalError(e,t,n){this.flushQueue(t,n),this.silentEmit(`error`,t),this.disconnect(!0)}handleReconnection(e,t){let n=!1;switch(this.options.reconnectOnError&&!a.default.checkFlag(`IGNORE_RECONNECT_ON_ERROR`,t.command.name)&&(n=this.options.reconnectOnError(e)),n){case 1:case!0:this.status!==`reconnecting`&&this.disconnect(!0),t.command.reject(e);break;case 2:this.status!==`reconnecting`&&this.disconnect(!0),this.condition?.select!==t.select&&t.command.name!==`select`&&this.select(t.select),this.sendCommand(t.command);break;default:t.command.reject(e)}}_getDescription(){let e;return e=`path`in this.options&&this.options.path?this.options.path:this.stream&&this.stream.remoteAddress&&this.stream.remotePort?this.stream.remoteAddress+`:`+this.stream.remotePort:`host`in this.options&&this.options.host?this.options.host+`:`+this.options.port:``,this.options.connectionName&&(e+=` (${this.options.connectionName})`),e}resetCommandQueue(){this.commandQueue=new _}resetOfflineQueue(){this.offlineQueue=new _}parseOptions(...t){let n={},r=!1;for(let e=0;e<t.length;++e){let i=t[e];if(i!=null)if(typeof i==`object`)(0,g.defaults)(n,i);else if(typeof i==`string`)(0,g.defaults)(n,(0,f.parseURL)(i)),i.startsWith(`rediss://`)&&(r=!0);else if(typeof i==`number`)n.port=i;else throw Error(`Invalid argument `+i)}r&&(0,g.defaults)(n,{tls:!0}),(0,g.defaults)(n,e.defaultOptions),typeof n.port==`string`&&(n.port=parseInt(n.port,10)),typeof n.db==`string`&&(n.db=parseInt(n.db,10)),this.options=(0,f.resolveTLSProfile)(n)}setStatus(e,t){v.enabled&&v(`status[%s]: %s -> %s`,this._getDescription(),this.status||`[empty]`,e),this.status=e,process.nextTick(this.emit.bind(this,e,t))}createScanStream(e,{key:t,options:n={}}){return new u.default({objectMode:!0,key:t,redis:this,command:e,...n})}flushQueue(e,t){t=(0,g.defaults)({},t,{offlineQueue:!0,commandQueue:!0});let n;if(t.offlineQueue)for(;n=this.offlineQueue.shift();)n.command.reject(e);if(t.commandQueue&&this.commandQueue.length>0)for(this.stream&&this.stream.removeAllListeners(`data`);n=this.commandQueue.shift();)n.command.reject(e)}_readyCheck(e){let t=this;this.info(function(n,r){if(n)return n.message&&n.message.includes(`NOPERM`)?(console.warn(`Skipping the ready check because INFO command fails: "${n.message}". You can disable ready check with "enableReadyCheck". More: https://github.com/luin/ioredis/wiki/Disable-ready-check.`),e(null,{})):e(n);if(typeof r!=`string`)return e(null,r);let i={},a=r.split(`\r
|
|
236
|
+
`);for(let e=0;e<a.length;++e){let[t,...n]=a[e].split(`:`),r=n.join(`:`);r&&(i[t]=r)}if(!i.loading||i.loading===`0`)e(null,i);else{let n=(i.loading_eta_seconds||1)*1e3,r=t.options.maxLoadingRetryTime&&t.options.maxLoadingRetryTime<n?t.options.maxLoadingRetryTime:n;v(`Redis server still loading, trying again in `+r+`ms`),setTimeout(function(){t._readyCheck(e)},r)}}).catch(g.noop)}};y.Cluster=i.default,y.Command=a.default,y.defaultOptions=l.DEFAULT_REDIS_OPTIONS,(0,p.default)(y,n.EventEmitter),(0,d.addTransactionSupport)(y.prototype),e.default=y})),ZF=u(((e,t)=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.print=e.ReplyError=e.SentinelIterator=e.SentinelConnector=e.AbstractConnector=e.Pipeline=e.ScanStream=e.Command=e.Cluster=e.Redis=e.default=void 0,e=t.exports=XF().default;var n=XF();Object.defineProperty(e,`default`,{enumerable:!0,get:function(){return n.default}});var r=XF();Object.defineProperty(e,`Redis`,{enumerable:!0,get:function(){return r.default}});var i=FF();Object.defineProperty(e,`Cluster`,{enumerable:!0,get:function(){return i.default}});var a=vF();Object.defineProperty(e,`Command`,{enumerable:!0,get:function(){return a.default}});var o=bF();Object.defineProperty(e,`ScanStream`,{enumerable:!0,get:function(){return o.default}});var s=wF();Object.defineProperty(e,`Pipeline`,{enumerable:!0,get:function(){return s.default}});var c=IF();Object.defineProperty(e,`AbstractConnector`,{enumerable:!0,get:function(){return c.default}});var l=BF();Object.defineProperty(e,`SentinelConnector`,{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,`SentinelIterator`,{enumerable:!0,get:function(){return l.SentinelIterator}}),e.ReplyError=iF().ReplyError,Object.defineProperty(e,`Promise`,{get(){return console.warn(`ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used.`),Promise},set(e){console.warn(`ioredis v5 does not support plugging third-party Promise library anymore. Native Promise will be used.`)}});function u(e,t){e?console.log(`Error: `+e):console.log(`Reply: `+t)}e.print=u}))();const QF=e=>{let t=process.env.REDIS_HOST,n=Number(process.env.REDIS_PORT??6379),r=process.env.CHANNEL;if(!t||!r)return console.warn(`Relay disabled: missing REDIS_HOST or CHANNEL`),{async stop(){}};let i=new ZF.Redis({host:t,port:n,tls:{},keepAlive:0,noDelay:!0,enableReadyCheck:!1,connectTimeout:5e3,retryStrategy(e){return e>20?null:Math.min(e*500,5e3)}});return i.on(`error`,e=>{console.error(`Relay redis error`,e)}),i.on(`end`,()=>{console.error(`Relay redis connection ended`),process.exit(1)}),i.subscribe(r).catch(e=>{console.error(`Relay subscribe failed`,e),process.exit(1)}),i.on(`message`,(t,n)=>{let r;try{r=Le(n)}catch{return}if(typeof r!=`object`||!r||!(`topic`in r)||typeof r.topic!=`string`||!(`event`in r)||typeof r.event!=`string`)return;let i=`payload`in r&&typeof r.payload==`string`?r.payload:``;e.publish(r.topic,`${r.event} ${i}`)}),{async stop(){await i.quit().catch(()=>{})}}},$F=Number(process.env.PORT??3e3),eI=process.env.ORIGIN_SECRET,tI=(e,t)=>{let n=e.headers.get(`x-forwarded-for`);if(n){let e=n.split(`,`).map(e=>e.trim()).filter(Boolean);return e.length>=2?e[e.length-2]:e[0]}return t.requestIP(e)?.address},nI=Bun.serve({port:$F,routes:{"/health":()=>new Response(`ok`),"/ws":(e,n)=>{if(eI&&e.headers.get(`x-origin-secret`)!==eI)return new Response(`Forbidden`,{status:403});let r=tI(e,n);if(!r)return new Response(`Unable to determine the client address`,{status:400});if(!n.upgrade(e,{data:{id:t(),ip:r,authenticated:!1,allowed:[]}}))return new Response(`Upgrade failed`,{status:500})}},websocket:{data:{},sendPings:!0,idleTimeout:15,perMessageDeflate:!0,open(e){e.data.authTimeout=setTimeout(()=>{e.close(4001,`Authentication timeout`)},1e4)},async message(e,t){if(typeof t!=`string`){e.close(4e3,`Invalid message payload`);return}if(t===`PING`){e.send(`PONG`);return}let[n,...r]=t.split(` `);if(!e.data.authenticated){if(n!==`AUTH`||e.data.authenticating){e.close(4001,`Not authenticated`);return}e.data.authenticating=!0;let t=r.join(` `),i=await ZP(t===``?void 0:t);if(e.readyState!==WebSocket.OPEN)return;if(!i.authorized){e.close(4001,i.reason);return}clearTimeout(e.data.authTimeout),e.data.authenticated=!0,e.data.authenticating=!1,e.data.context=i.context,e.data.allowed=i.allowed,e.sendText(`ACK`),fd(e);return}let i=r.join(` `).split(`,`);if(n===`SUB`){md(e,i);return}if(n===`UNSUB`){hd(e,i);return}e.close(4e3,`Invalid message payload`)},close(e){clearTimeout(e.data.authTimeout),pd(e)}}}),rI=QF(nI);process.on(`SIGTERM`,async()=>{nI.stop(),await rI.stop(),process.exit(0)}),console.log(`Socket server running on port ${$F}`);export{};
|