gemi 0.4.63 → 0.4.64

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.
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-7ce930fe69575c87.js";import"./chunk-09dd89e1046786a5.js";import{nb as y,ob as K,pb as E,sb as C,tb as N} from"./chunk-92f6095a3be7f459.js";import{vb as i,wb as f} from"./chunk-73eed146ee78f681.js";var F=(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");var L=300000,_="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var I={},M=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-8e72aa06d4e47eca.js");if(I[e])return I[e];const s=new r({region:e});return I[e]=s,s};var H=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-8e72aa06d4e47eca.js");return(await M(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var v=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new f(`Token is expired. ${_}`,!1)};var m=(e,r,s=!1)=>{if(typeof r==="undefined")throw new f(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${_}`,!1)};import{promises as W} from"fs";var{writeFile:j}=W,b=(e,r)=>{const s=K(e),t=JSON.stringify(r,null,2);return j(s,t)};var G=new Date(0),U=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await N(e),s=y(e),t=r[s];if(!t)throw new f(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new f(`Profile '${s}' is missing required property 'sso_session'.`);const a=t.sso_session,c=(await C(e))[a];if(!c)throw new f(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!c[n])throw new f(`Sso session '${a}' is missing required property '${n}'.`,!1);const{sso_start_url:p,sso_region:S}=c;let o;try{o=await E(a)}catch(n){throw new f(`The SSO session token associated with profile=${s} was not found or is invalid. ${_}`,!1)}m("accessToken",o.accessToken),m("expiresAt",o.expiresAt);const{accessToken:x,expiresAt:u}=o,l={token:x,expiration:new Date(u)};if(l.expiration.getTime()-Date.now()>L)return l;if(Date.now()-G.getTime()<30000)return v(l),l;m("clientId",o.clientId,!0),m("clientSecret",o.clientSecret,!0),m("refreshToken",o.refreshToken,!0);try{G.setTime(Date.now());const n=await H(o,S);m("accessToken",n.accessToken),m("expiresIn",n.expiresIn);const h=new Date(Date.now()+n.expiresIn*1000);try{await b(a,{...o,accessToken:n.accessToken,expiresAt:h.toISOString(),refreshToken:n.refreshToken})}catch(O){}return{token:n.accessToken,expiration:h}}catch(n){return v(l),l}};var T=!1,P=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoClient:d,clientConfig:c,profile:p,logger:S})=>{let o;const x="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const g=await U({profile:p})();o={accessToken:g.token,expiresAt:new Date(g.expiration).toISOString()}}catch(g){throw new i(g.message,{tryNextLink:T,logger:S})}else try{o=await E(e)}catch(g){throw new i("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:T,logger:S})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new i("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:T,logger:S});const{accessToken:u}=o,{SSOClient:l,GetRoleCredentialsCommand:n}=await import("./chunk-81938d68b172446d.js"),h=d||new l(Object.assign({},c??{},{region:c?.region??t}));let O;try{O=await h.send(new n({accountId:s,roleName:a,accessToken:u}))}catch(g){throw new i(g,{tryNextLink:T,logger:S})}const{roleCredentials:{accessKeyId:w,secretAccessKey:k,sessionToken:R,expiration:D,credentialScope:A,accountId:$}={}}=O;if(!w||!k||!R||!D)throw new i("SSO returns an invalid temporary credential.",{tryNextLink:T,logger:S});return{accessKeyId:w,secretAccessKey:k,sessionToken:R,expiration:new Date(D),...A&&{credentialScope:A},...$&&{accountId:$}}};var q=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:a,sso_role_name:d}=e;if(!s||!t||!a||!d)throw new i('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:r});return e};var Ee=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoSession:d}=e,{ssoClient:c}=e,p=y(e);if(!r&&!s&&!t&&!a&&!d){const o=(await N(e))[p];if(!o)throw new i(`Profile ${p} was not found.`,{logger:e.logger});if(!F(o))throw new i(`Profile ${p} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const w=(await C(e))[o.sso_session],k=` configurations in profile ${p} and sso-session ${o.sso_session}`;if(t&&t!==w.sso_region)throw new i("Conflicting SSO region"+k,{tryNextLink:!1,logger:e.logger});if(r&&r!==w.sso_start_url)throw new i("Conflicting SSO start_url"+k,{tryNextLink:!1,logger:e.logger});o.sso_region=w.sso_region,o.sso_start_url=w.sso_start_url}const{sso_start_url:x,sso_account_id:u,sso_region:l,sso_role_name:n,sso_session:h}=q(o,e.logger);return P({ssoStartUrl:x,ssoSession:h,ssoAccountId:u,ssoRegion:l,ssoRoleName:n,ssoClient:c,clientConfig:e.clientConfig,profile:p})}else if(!r||!s||!t||!a)throw new i('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return P({ssoStartUrl:r,ssoSession:d,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoClient:c,clientConfig:e.clientConfig,profile:p})};export{q as validateSsoProfile,F as isSsoProfile,Ee as fromSSO};
2
+ import"./chunk-7ce930fe69575c87.js";import"./chunk-a0003b7feea6fae6.js";import{nb as y,ob as K,pb as E,sb as C,tb as N} from"./chunk-934ebff128f86ef1.js";import{vb as i,wb as f} from"./chunk-73eed146ee78f681.js";var F=(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");var L=300000,_="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var I={},M=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-095848ccb81718bf.js");if(I[e])return I[e];const s=new r({region:e});return I[e]=s,s};var H=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-095848ccb81718bf.js");return(await M(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var v=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new f(`Token is expired. ${_}`,!1)};var m=(e,r,s=!1)=>{if(typeof r==="undefined")throw new f(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${_}`,!1)};import{promises as W} from"fs";var{writeFile:j}=W,b=(e,r)=>{const s=K(e),t=JSON.stringify(r,null,2);return j(s,t)};var G=new Date(0),U=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await N(e),s=y(e),t=r[s];if(!t)throw new f(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new f(`Profile '${s}' is missing required property 'sso_session'.`);const a=t.sso_session,c=(await C(e))[a];if(!c)throw new f(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!c[n])throw new f(`Sso session '${a}' is missing required property '${n}'.`,!1);const{sso_start_url:p,sso_region:S}=c;let o;try{o=await E(a)}catch(n){throw new f(`The SSO session token associated with profile=${s} was not found or is invalid. ${_}`,!1)}m("accessToken",o.accessToken),m("expiresAt",o.expiresAt);const{accessToken:x,expiresAt:u}=o,l={token:x,expiration:new Date(u)};if(l.expiration.getTime()-Date.now()>L)return l;if(Date.now()-G.getTime()<30000)return v(l),l;m("clientId",o.clientId,!0),m("clientSecret",o.clientSecret,!0),m("refreshToken",o.refreshToken,!0);try{G.setTime(Date.now());const n=await H(o,S);m("accessToken",n.accessToken),m("expiresIn",n.expiresIn);const h=new Date(Date.now()+n.expiresIn*1000);try{await b(a,{...o,accessToken:n.accessToken,expiresAt:h.toISOString(),refreshToken:n.refreshToken})}catch(O){}return{token:n.accessToken,expiration:h}}catch(n){return v(l),l}};var T=!1,P=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoClient:d,clientConfig:c,profile:p,logger:S})=>{let o;const x="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const g=await U({profile:p})();o={accessToken:g.token,expiresAt:new Date(g.expiration).toISOString()}}catch(g){throw new i(g.message,{tryNextLink:T,logger:S})}else try{o=await E(e)}catch(g){throw new i("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:T,logger:S})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new i("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:T,logger:S});const{accessToken:u}=o,{SSOClient:l,GetRoleCredentialsCommand:n}=await import("./chunk-408fb31b8b0f97ee.js"),h=d||new l(Object.assign({},c??{},{region:c?.region??t}));let O;try{O=await h.send(new n({accountId:s,roleName:a,accessToken:u}))}catch(g){throw new i(g,{tryNextLink:T,logger:S})}const{roleCredentials:{accessKeyId:w,secretAccessKey:k,sessionToken:R,expiration:D,credentialScope:A,accountId:$}={}}=O;if(!w||!k||!R||!D)throw new i("SSO returns an invalid temporary credential.",{tryNextLink:T,logger:S});return{accessKeyId:w,secretAccessKey:k,sessionToken:R,expiration:new Date(D),...A&&{credentialScope:A},...$&&{accountId:$}}};var q=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:a,sso_role_name:d}=e;if(!s||!t||!a||!d)throw new i('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:r});return e};var Ee=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoSession:d}=e,{ssoClient:c}=e,p=y(e);if(!r&&!s&&!t&&!a&&!d){const o=(await N(e))[p];if(!o)throw new i(`Profile ${p} was not found.`,{logger:e.logger});if(!F(o))throw new i(`Profile ${p} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const w=(await C(e))[o.sso_session],k=` configurations in profile ${p} and sso-session ${o.sso_session}`;if(t&&t!==w.sso_region)throw new i("Conflicting SSO region"+k,{tryNextLink:!1,logger:e.logger});if(r&&r!==w.sso_start_url)throw new i("Conflicting SSO start_url"+k,{tryNextLink:!1,logger:e.logger});o.sso_region=w.sso_region,o.sso_start_url=w.sso_start_url}const{sso_start_url:x,sso_account_id:u,sso_region:l,sso_role_name:n,sso_session:h}=q(o,e.logger);return P({ssoStartUrl:x,ssoSession:h,ssoAccountId:u,ssoRegion:l,ssoRoleName:n,ssoClient:c,clientConfig:e.clientConfig,profile:p})}else if(!r||!s||!t||!a)throw new i('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return P({ssoStartUrl:r,ssoSession:d,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoClient:c,clientConfig:e.clientConfig,profile:p})};export{q as validateSsoProfile,F as isSsoProfile,Ee as fromSSO};
@@ -0,0 +1,18 @@
1
+ import{y as l,z as M} from"./chunk-7ce930fe69575c87.js";import{C as y,D as bw,E as o4,F as fz,I as iw,J as m6,M as i6,T as CW} from"./chunk-b009482e01114059.js";import{hb as M0} from"./chunk-a0003b7feea6fae6.js";import{ib as NZ,jb as I0,kb as Vw} from"./chunk-9b5649697d59dfb4.js";import{qb as Bw} from"./chunk-934ebff128f86ef1.js";import{zb as $X} from"./chunk-73eed146ee78f681.js";var s=M((UR,UU)=>{var{defineProperty:w1,getOwnPropertyDescriptor:YX,getOwnPropertyNames:IX}=Object,zX=Object.prototype.hasOwnProperty,$U=($,w)=>w1($,"name",{value:w,configurable:!0}),QX=($,w)=>{for(var U in w)w1($,U,{get:w[U],enumerable:!0})},EX=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of IX(w))if(!zX.call($,f)&&f!==U)w1($,f,{get:()=>w[f],enumerable:!(G=YX(w,f))||G.enumerable})}return $},RX=($)=>EX(w1({},"__esModule",{value:!0}),$),wU={};QX(wU,{getSmithyContext:()=>MX,normalizeProvider:()=>JX});UU.exports=RX(wU);var ew=M0(),MX=$U(($)=>$[ew.SMITHY_CONTEXT_KEY]||($[ew.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),JX=$U(($)=>{if(typeof $==="function")return $;const w=Promise.resolve($);return()=>w},"normalizeProvider")});var Y$=M((fR,XU)=>{var{defineProperty:U1,getOwnPropertyDescriptor:KX,getOwnPropertyNames:AX}=Object,OX=Object.prototype.hasOwnProperty,L0=($,w)=>U1($,"name",{value:w,configurable:!0}),BX=($,w)=>{for(var U in w)U1($,U,{get:w[U],enumerable:!0})},VX=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of AX(w))if(!OX.call($,f)&&f!==U)U1($,f,{get:()=>w[f],enumerable:!(G=KX(w,f))||G.enumerable})}return $},TX=($)=>VX(U1({},"__esModule",{value:!0}),$),fU={};BX(fU,{CredentialsProviderError:()=>HX,ProviderError:()=>f1,TokenProviderError:()=>CX,chain:()=>NX,fromStatic:()=>qX,memoize:()=>jX});XU.exports=TX(fU);var GU=class $ extends Error{constructor(w,U=!0){var G;let f,W=!0;if(typeof U==="boolean")f=void 0,W=U;else if(U!=null&&typeof U==="object")f=U.logger,W=U.tryNextLink??!0;super(w);this.name="ProviderError",this.tryNextLink=W,Object.setPrototypeOf(this,$.prototype),(G=f==null?void 0:f.debug)==null||G.call(f,`@smithy/property-provider ${W?"->":"(!)"} ${w}`)}static from(w,U=!0){return Object.assign(new this(w.message,U),w)}};L0(GU,"ProviderError");var f1=GU,WU=class $ extends f1{constructor(w,U=!0){super(w,U);this.name="CredentialsProviderError",Object.setPrototypeOf(this,$.prototype)}};L0(WU,"CredentialsProviderError");var HX=WU,LU=class $ extends f1{constructor(w,U=!0){super(w,U);this.name="TokenProviderError",Object.setPrototypeOf(this,$.prototype)}};L0(LU,"TokenProviderError");var CX=LU,NX=L0((...$)=>async()=>{if($.length===0)throw new f1("No providers in chain");let w;for(let U of $)try{return await U()}catch(G){if(w=G,G==null?void 0:G.tryNextLink)continue;throw G}throw w},"chain"),qX=L0(($)=>()=>Promise.resolve($),"fromStatic"),jX=L0(($,w,U)=>{let G,f,W,L=!1;const X=L0(async()=>{if(!f)f=$();try{G=await f,W=!0,L=!1}finally{f=void 0}return G},"coalesceProvider");if(w===void 0)return async(Z)=>{if(!W||(Z==null?void 0:Z.forceRefresh))G=await X();return G};return async(Z)=>{if(!W||(Z==null?void 0:Z.forceRefresh))G=await X();if(L)return G;if(U&&!U(G))return L=!0,G;if(w(G))return await X(),G;return G}},"memoize")});var J0=M((ZU)=>{Object.defineProperty(ZU,"__esModule",{value:!0});ZU.getHomeDir=void 0;var PX=import.meta.require("os"),SX=import.meta.require("path"),I$={},bX=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},hX=()=>{const{HOME:$,USERPROFILE:w,HOMEPATH:U,HOMEDRIVE:G=`C:${SX.sep}`}=process.env;if($)return $;if(w)return w;if(U)return`${G}${U}`;const f=bX();if(!I$[f])I$[f]=PX.homedir();return I$[f]};ZU.getHomeDir=hX});var z$=M((YU)=>{Object.defineProperty(YU,"__esModule",{value:!0});YU.getSSOTokenFilepath=void 0;var DX=import.meta.require("crypto"),kX=import.meta.require("path"),cX=J0(),vX=($)=>{const U=DX.createHash("sha1").update($).digest("hex");return kX.join(cX.getHomeDir(),".aws","sso","cache",`${U}.json`)};YU.getSSOTokenFilepath=vX});var EU=M((zU)=>{Object.defineProperty(zU,"__esModule",{value:!0});zU.getSSOTokenFromFile=void 0;var yX=import.meta.require("fs"),xX=z$(),{readFile:uX}=yX.promises,_X=async($)=>{const w=xX.getSSOTokenFilepath($),U=await uX(w,"utf8");return JSON.parse(U)};zU.getSSOTokenFromFile=_X});var E$=M((RU)=>{Object.defineProperty(RU,"__esModule",{value:!0});RU.slurpFile=void 0;var dX=import.meta.require("fs"),{readFile:pX}=dX.promises,Q$={},gX=($,w)=>{if(!Q$[$]||(w===null||w===void 0?void 0:w.ignoreCache))Q$[$]=pX($,"utf8");return Q$[$]};RU.slurpFile=gX});var K$=M((ZR,h0)=>{var{defineProperty:L1,getOwnPropertyDescriptor:lX,getOwnPropertyNames:nX}=Object,sX=Object.prototype.hasOwnProperty,x=($,w)=>L1($,"name",{value:w,configurable:!0}),mX=($,w)=>{for(var U in w)L1($,U,{get:w[U],enumerable:!0})},R$=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of nX(w))if(!sX.call($,f)&&f!==U)L1($,f,{get:()=>w[f],enumerable:!(G=lX(w,f))||G.enumerable})}return $},J$=($,w,U)=>(R$($,w,"default"),U&&R$(U,w,"default")),iX=($)=>R$(L1({},"__esModule",{value:!0}),$),b0={};mX(b0,{CONFIG_PREFIX_SEPARATOR:()=>X0,DEFAULT_PROFILE:()=>OU,ENV_PROFILE:()=>AU,getProfileName:()=>rX,loadSharedConfigFiles:()=>VU,loadSsoSessionData:()=>ZZ,parseKnownFiles:()=>YZ});h0.exports=iX(b0);J$(b0,J0(),h0.exports);var AU="AWS_PROFILE",OU="default",rX=x(($)=>$.profile||process.env[AU]||OU,"getProfileName");J$(b0,z$(),h0.exports);J$(b0,EU(),h0.exports);var G1=M0(),oX=x(($)=>Object.entries($).filter(([w])=>{const U=w.indexOf(X0);if(U===-1)return!1;return Object.values(G1.IniSectionType).includes(w.substring(0,U))}).reduce((w,[U,G])=>{const f=U.indexOf(X0),W=U.substring(0,f)===G1.IniSectionType.PROFILE?U.substring(f+1):U;return w[W]=G,w},{...$.default&&{default:$.default}}),"getConfigData"),W1=import.meta.require("path"),aX=J0(),tX="AWS_CONFIG_FILE",BU=x(()=>process.env[tX]||W1.join(aX.getHomeDir(),".aws","config"),"getConfigFilepath"),eX=J0(),$Z="AWS_SHARED_CREDENTIALS_FILE",wZ=x(()=>process.env[$Z]||W1.join(eX.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),UZ=J0(),fZ=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,GZ=["__proto__","profile __proto__"],M$=x(($)=>{const w={};let U,G;for(let f of $.split(/\r?\n/)){const W=f.split(/(^|\s)[;#]/)[0].trim();if(W[0]==="["&&W[W.length-1]==="]"){U=void 0,G=void 0;const X=W.substring(1,W.length-1),Z=fZ.exec(X);if(Z){const[,F,,Y]=Z;if(Object.values(G1.IniSectionType).includes(F))U=[F,Y].join(X0)}else U=X;if(GZ.includes(X))throw new Error(`Found invalid profile name "${X}"`)}else if(U){const X=W.indexOf("=");if(![0,-1].includes(X)){const[Z,F]=[W.substring(0,X).trim(),W.substring(X+1).trim()];if(F==="")G=Z;else{if(G&&f.trimStart()===f)G=void 0;w[U]=w[U]||{};const Y=G?[G,Z].join(X0):Z;w[U][Y]=F}}}}return w},"parseIni"),JU=E$(),KU=x(()=>({}),"swallowError"),X0=".",VU=x(async($={})=>{const{filepath:w=wZ(),configFilepath:U=BU()}=$,G=UZ.getHomeDir();let W=w;if(w.startsWith("~/"))W=W1.join(G,w.slice(2));let L=U;if(U.startsWith("~/"))L=W1.join(G,U.slice(2));const X=await Promise.all([JU.slurpFile(L,{ignoreCache:$.ignoreCache}).then(M$).then(oX).catch(KU),JU.slurpFile(W,{ignoreCache:$.ignoreCache}).then(M$).catch(KU)]);return{configFile:X[0],credentialsFile:X[1]}},"loadSharedConfigFiles"),WZ=x(($)=>Object.entries($).filter(([w])=>w.startsWith(G1.IniSectionType.SSO_SESSION+X0)).reduce((w,[U,G])=>({...w,[U.substring(U.indexOf(X0)+1)]:G}),{}),"getSsoSessionData"),LZ=E$(),XZ=x(()=>({}),"swallowError"),ZZ=x(async($={})=>LZ.slurpFile($.configFilepath??BU()).then(M$).then(WZ).catch(XZ),"loadSsoSessionData"),FZ=x((...$)=>{const w={};for(let U of $)for(let[G,f]of Object.entries(U))if(w[G]!==void 0)Object.assign(w[G],f);else w[G]=f;return w},"mergeConfigFiles"),YZ=x(async($)=>{const w=await VU($);return FZ(w.configFile,w.credentialsFile)},"parseKnownFiles")});var NU=M((FR,CU)=>{var A$=function($){try{const w=new Set(Array.from($.match(/([A-Z_]){3,}/g)??[]));return w.delete("CONFIG"),w.delete("CONFIG_PREFIX_SEPARATOR"),w.delete("ENV"),[...w].join(", ")}catch(w){return $}},X1=Object.defineProperty,IZ=Object.getOwnPropertyDescriptor,zZ=Object.getOwnPropertyNames,QZ=Object.prototype.hasOwnProperty,K0=($,w)=>X1($,"name",{value:w,configurable:!0}),EZ=($,w)=>{for(var U in w)X1($,U,{get:w[U],enumerable:!0})},RZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of zZ(w))if(!QZ.call($,f)&&f!==U)X1($,f,{get:()=>w[f],enumerable:!(G=IZ(w,f))||G.enumerable})}return $},MZ=($)=>RZ(X1({},"__esModule",{value:!0}),$),HU={};EZ(HU,{loadConfig:()=>BZ});CU.exports=MZ(HU);var D0=Y$();K0(A$,"getSelectorName");var JZ=K0(($,w)=>async()=>{try{const U=$(process.env);if(U===void 0)throw new Error;return U}catch(U){throw new D0.CredentialsProviderError(U.message||`Not found in ENV: ${A$($.toString())}`,{logger:w})}},"fromEnv"),TU=K$(),KZ=K0(($,{preferredFile:w="config",...U}={})=>async()=>{const G=TU.getProfileName(U),{configFile:f,credentialsFile:W}=await TU.loadSharedConfigFiles(U),L=W[G]||{},X=f[G]||{},Z=w==="config"?{...L,...X}:{...X,...L};try{const Y=$(Z,w==="config"?f:W);if(Y===void 0)throw new Error;return Y}catch(F){throw new D0.CredentialsProviderError(F.message||`Not found in config files w/ profile [${G}]: ${A$($.toString())}`,{logger:U.logger})}},"fromSharedConfigFiles"),AZ=K0(($)=>typeof $==="function","isFunction"),OZ=K0(($)=>AZ($)?async()=>await $():D0.fromStatic($),"fromStatic"),BZ=K0(({environmentVariableSelector:$,configFileSelector:w,default:U},G={})=>D0.memoize(D0.chain(JZ($),KZ(w,G),OZ(U))),"loadConfig")});var hU=M((SU)=>{Object.defineProperty(SU,"__esModule",{value:!0});SU.getEndpointUrlConfig=void 0;var qU=K$(),jU="AWS_ENDPOINT_URL",PU="endpoint_url",VZ=($)=>({environmentVariableSelector:(w)=>{const U=$.split(" ").map((W)=>W.toUpperCase()),G=w[[jU,...U].join("_")];if(G)return G;const f=w[jU];if(f)return f;return},configFileSelector:(w,U)=>{if(U&&w.services){const f=U[["services",w.services].join(qU.CONFIG_PREFIX_SEPARATOR)];if(f){const W=$.split(" ").map((X)=>X.toLowerCase()),L=f[[W.join("_"),PU].join(qU.CONFIG_PREFIX_SEPARATOR)];if(L)return L}}const G=w[PU];if(G)return G;return},default:void 0});SU.getEndpointUrlConfig=VZ});var cU=M((DU)=>{Object.defineProperty(DU,"__esModule",{value:!0});DU.getEndpointFromConfig=void 0;var TZ=NU(),HZ=hU(),CZ=async($)=>TZ.loadConfig(HZ.getEndpointUrlConfig($))();DU.getEndpointFromConfig=CZ});var uU=M((zR,xU)=>{var{defineProperty:Z1,getOwnPropertyDescriptor:qZ,getOwnPropertyNames:jZ}=Object,PZ=Object.prototype.hasOwnProperty,SZ=($,w)=>Z1($,"name",{value:w,configurable:!0}),bZ=($,w)=>{for(var U in w)Z1($,U,{get:w[U],enumerable:!0})},hZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of jZ(w))if(!PZ.call($,f)&&f!==U)Z1($,f,{get:()=>w[f],enumerable:!(G=qZ(w,f))||G.enumerable})}return $},DZ=($)=>hZ(Z1({},"__esModule",{value:!0}),$),vU={};bZ(vU,{parseUrl:()=>yU});xU.exports=DZ(vU);var kZ=NZ(),yU=SZ(($)=>{if(typeof $==="string")return yU(new URL($));const{hostname:w,pathname:U,port:G,protocol:f,search:W}=$;let L;if(W)L=kZ.parseQueryString(W);return{hostname:w,port:G?parseInt(G):void 0,protocol:f,path:U,query:L}},"parseUrl")});var B$=M((QR,sU)=>{var nU=function($,w,U){return{applyToStack:(G)=>{G.add(dU($,U),gU),G.add(pU($,w),lU)}}},F1=Object.defineProperty,cZ=Object.getOwnPropertyDescriptor,vZ=Object.getOwnPropertyNames,yZ=Object.prototype.hasOwnProperty,O$=($,w)=>F1($,"name",{value:w,configurable:!0}),xZ=($,w)=>{for(var U in w)F1($,U,{get:w[U],enumerable:!0})},uZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of vZ(w))if(!yZ.call($,f)&&f!==U)F1($,f,{get:()=>w[f],enumerable:!(G=cZ(w,f))||G.enumerable})}return $},_Z=($)=>uZ(F1({},"__esModule",{value:!0}),$),_U={};xZ(_U,{deserializerMiddleware:()=>dU,deserializerMiddlewareOption:()=>gU,getSerdePlugin:()=>nU,serializerMiddleware:()=>pU,serializerMiddlewareOption:()=>lU});sU.exports=_Z(_U);var dU=O$(($,w)=>(U)=>async(G)=>{const{response:f}=await U(G);try{const W=await w(f,$);return{response:f,output:W}}catch(W){if(Object.defineProperty(W,"$response",{value:f}),!("$metadata"in W)){if(W.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof W.$responseBodyText!=="undefined"){if(W.$response)W.$response.body=W.$responseBodyText}}throw W}},"deserializerMiddleware"),pU=O$(($,w)=>(U,G)=>async(f)=>{var W;const L=((W=G.endpointV2)==null?void 0:W.url)&&$.urlParser?async()=>$.urlParser(G.endpointV2.url):$.endpoint;if(!L)throw new Error("No valid endpoint provider available.");const X=await w(f.input,{...$,endpoint:L});return U({...f,request:X})},"serializerMiddleware"),gU={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},lU={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};O$(nU,"getSerdePlugin")});var $f=M((ER,eU)=>{var{defineProperty:I1,getOwnPropertyDescriptor:dZ,getOwnPropertyNames:pZ}=Object,gZ=Object.prototype.hasOwnProperty,d=($,w)=>I1($,"name",{value:w,configurable:!0}),lZ=($,w)=>{for(var U in w)I1($,U,{get:w[U],enumerable:!0})},nZ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of pZ(w))if(!gZ.call($,f)&&f!==U)I1($,f,{get:()=>w[f],enumerable:!(G=dZ(w,f))||G.enumerable})}return $},sZ=($)=>nZ(I1({},"__esModule",{value:!0}),$),iU={};lZ(iU,{endpointMiddleware:()=>aU,endpointMiddlewareOptions:()=>tU,getEndpointFromInstructions:()=>rU,getEndpointPlugin:()=>U2,resolveEndpointConfig:()=>f2,resolveParams:()=>oU,toEndpointV1:()=>V$});eU.exports=sZ(iU);var mZ=d(async($)=>{const w=($==null?void 0:$.Bucket)||"";if(typeof $.Bucket==="string")$.Bucket=w.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(tZ(w)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!aZ(w)||w.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||w.toLowerCase()!==w||w.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},"resolveParamsForS3"),iZ=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,rZ=/(\d+\.){3}\d+/,oZ=/\.\./,aZ=d(($)=>iZ.test($)&&!rZ.test($)&&!oZ.test($),"isDnsCompatibleBucketName"),tZ=d(($)=>{const[w,U,G,,,f]=$.split(":"),W=w==="arn"&&$.split(":").length>=6,L=Boolean(W&&U&&G&&f);if(W&&!L)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return L},"isArnBucketName"),eZ=d(($,w,U)=>{const G=d(async()=>{const f=U[$]??U[w];if(typeof f==="function")return f();return f},"configProvider");if($==="credentialScope"||w==="CredentialScope")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return(f==null?void 0:f.credentialScope)??(f==null?void 0:f.CredentialScope)};if($==="accountId"||w==="AccountId")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return(f==null?void 0:f.accountId)??(f==null?void 0:f.AccountId)};if($==="endpoint"||w==="endpoint")return async()=>{const f=await G();if(f&&typeof f==="object"){if("url"in f)return f.url.href;if("hostname"in f){const{protocol:W,hostname:L,port:X,path:Z}=f;return`${W}//${L}${X?":"+X:""}${Z}`}}return f};return G},"createConfigValueProvider"),$2=cU(),mU=uU(),V$=d(($)=>{if(typeof $==="object"){if("url"in $)return mU.parseUrl($.url);return $}return mU.parseUrl($)},"toEndpointV1"),rU=d(async($,w,U,G)=>{if(!U.endpoint){const L=await $2.getEndpointFromConfig(U.serviceId||"");if(L)U.endpoint=()=>Promise.resolve(V$(L))}const f=await oU($,w,U);if(typeof U.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return U.endpointProvider(f,G)},"getEndpointFromInstructions"),oU=d(async($,w,U)=>{var G;const f={},W=((G=w==null?void 0:w.getEndpointParameterInstructions)==null?void 0:G.call(w))||{};for(let[L,X]of Object.entries(W))switch(X.type){case"staticContextParams":f[L]=X.value;break;case"contextParams":f[L]=$[X.name];break;case"clientContextParams":case"builtInParams":f[L]=await eZ(X.name,L,U)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(X))}if(Object.keys(W).length===0)Object.assign(f,U);if(String(U.serviceId).toLowerCase()==="s3")await mZ(f);return f},"resolveParams"),Y1=s(),aU=d(({config:$,instructions:w})=>{return(U,G)=>async(f)=>{var W,L,X;const Z=await rU(f.input,{getEndpointParameterInstructions(){return w}},{...$},G);G.endpointV2=Z,G.authSchemes=(W=Z.properties)==null?void 0:W.authSchemes;const F=(L=G.authSchemes)==null?void 0:L[0];if(F){G.signing_region=F.signingRegion,G.signing_service=F.signingName;const Y=Y1.getSmithyContext(G),I=(X=Y==null?void 0:Y.selectedHttpAuthScheme)==null?void 0:X.httpAuthOption;if(I)I.signingProperties=Object.assign(I.signingProperties||{},{signing_region:F.signingRegion,signingRegion:F.signingRegion,signing_service:F.signingName,signingName:F.signingName,signingRegionSet:F.signingRegionSet},F.properties)}return U({...f})}},"endpointMiddleware"),w2=B$(),tU={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:w2.serializerMiddlewareOption.name},U2=d(($,w)=>({applyToStack:(U)=>{U.addRelativeTo(aU({config:$,instructions:w}),tU)}}),"getEndpointPlugin"),f2=d(($)=>{const w=$.tls??!0,{endpoint:U}=$,G=U!=null?async()=>V$(await Y1.normalizeProvider(U)()):void 0;return{...$,endpoint:G,tls:w,isCustomEndpoint:!!U,useDualstackEndpoint:Y1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:Y1.normalizeProvider($.useFipsEndpoint??!1)}},"resolveEndpointConfig")});var r=M((RR,Ff)=>{var Lf=function($){return Object.keys($).reduce((w,U)=>{const G=$[U];return{...w,[U]:Array.isArray(G)?[...G]:G}},{})},Zf=function($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)},z1=Object.defineProperty,G2=Object.getOwnPropertyDescriptor,W2=Object.getOwnPropertyNames,L2=Object.prototype.hasOwnProperty,e=($,w)=>z1($,"name",{value:w,configurable:!0}),X2=($,w)=>{for(var U in w)z1($,U,{get:w[U],enumerable:!0})},Z2=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of W2(w))if(!L2.call($,f)&&f!==U)z1($,f,{get:()=>w[f],enumerable:!(G=G2(w,f))||G.enumerable})}return $},F2=($)=>Z2(z1({},"__esModule",{value:!0}),$),wf={};X2(wf,{Field:()=>z2,Fields:()=>Q2,HttpRequest:()=>E2,HttpResponse:()=>R2,IHttpRequest:()=>Uf.HttpRequest,getHttpHandlerExtensionConfiguration:()=>Y2,isValidHostname:()=>Zf,resolveHttpHandlerRuntimeConfig:()=>I2});Ff.exports=F2(wf);var Y2=e(($)=>{let w=$.httpHandler;return{setHttpHandler(U){w=U},httpHandler(){return w},updateHttpClientConfig(U,G){w.updateHttpClientConfig(U,G)},httpHandlerConfigs(){return w.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),I2=e(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),Uf=M0(),ff=class ${constructor({name:w,kind:U=Uf.FieldPosition.HEADER,values:G=[]}){this.name=w,this.kind=U,this.values=G}add(w){this.values.push(w)}set(w){this.values=w}remove(w){this.values=this.values.filter((U)=>U!==w)}toString(){return this.values.map((w)=>w.includes(",")||w.includes(" ")?`"${w}"`:w).join(", ")}get(){return this.values}};e(ff,"Field");var z2=ff,Gf=class ${constructor({fields:w=[],encoding:U="utf-8"}){this.entries={},w.forEach(this.setField.bind(this)),this.encoding=U}setField(w){this.entries[w.name.toLowerCase()]=w}getField(w){return this.entries[w.toLowerCase()]}removeField(w){delete this.entries[w.toLowerCase()]}getByType(w){return Object.values(this.entries).filter((U)=>U.kind===w)}};e(Gf,"Fields");var Q2=Gf,Wf=class ${constructor(w){this.method=w.method||"GET",this.hostname=w.hostname||"localhost",this.port=w.port,this.query=w.query||{},this.headers=w.headers||{},this.body=w.body,this.protocol=w.protocol?w.protocol.slice(-1)!==":"?`${w.protocol}:`:w.protocol:"https:",this.path=w.path?w.path.charAt(0)!=="/"?`/${w.path}`:w.path:"/",this.username=w.username,this.password=w.password,this.fragment=w.fragment}static clone(w){const U=new $({...w,headers:{...w.headers}});if(U.query)U.query=Lf(U.query);return U}static isInstance(w){if(!w)return!1;const U=w;return"method"in U&&"protocol"in U&&"hostname"in U&&"path"in U&&typeof U.query==="object"&&typeof U.headers==="object"}clone(){return $.clone(this)}};e(Wf,"HttpRequest");var E2=Wf;e(Lf,"cloneQuery");var Xf=class ${constructor(w){this.statusCode=w.statusCode,this.reason=w.reason,this.headers=w.headers||{},this.body=w.body}static isInstance(w){if(!w)return!1;const U=w;return typeof U.statusCode==="number"&&typeof U.headers==="object"}};e(Xf,"HttpResponse");var R2=Xf;e(Zf,"isValidHostname")});var T$=M((Yf)=>{var J2=function($){return $&&$.__esModule?$:{default:$}},K2=function(){if(Q1>E1.length-16)M2.default.randomFillSync(E1),Q1=0;return E1.slice(Q1,Q1+=16)};Object.defineProperty(Yf,"__esModule",{value:!0});Yf.default=K2;var M2=J2(import.meta.require("crypto")),E1=new Uint8Array(256),Q1=E1.length});var Qf=M((If)=>{Object.defineProperty(If,"__esModule",{value:!0});If.default=void 0;var O2=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;If.default=O2});var k0=M((Ef)=>{var V2=function($){return $&&$.__esModule?$:{default:$}},T2=function($){return typeof $==="string"&&B2.default.test($)};Object.defineProperty(Ef,"__esModule",{value:!0});Ef.default=void 0;var B2=V2(Qf()),H2=T2;Ef.default=H2});var c0=M((Jf)=>{var N2=function($){return $&&$.__esModule?$:{default:$}},Mf=function($,w=0){return h[$[w+0]]+h[$[w+1]]+h[$[w+2]]+h[$[w+3]]+"-"+h[$[w+4]]+h[$[w+5]]+"-"+h[$[w+6]]+h[$[w+7]]+"-"+h[$[w+8]]+h[$[w+9]]+"-"+h[$[w+10]]+h[$[w+11]]+h[$[w+12]]+h[$[w+13]]+h[$[w+14]]+h[$[w+15]]},q2=function($,w=0){const U=Mf($,w);if(!C2.default(U))throw TypeError("Stringified UUID is invalid");return U};Object.defineProperty(Jf,"__esModule",{value:!0});Jf.default=void 0;Jf.unsafeStringify=Mf;var C2=N2(k0()),h=[];for(let $=0;$<256;++$)h.push(($+256).toString(16).slice(1));var j2=q2;Jf.default=j2});var Vf=M((Of)=>{var h2=function($){return $&&$.__esModule?$:{default:$}},D2=function($,w,U){let G=w&&U||0;const f=w||new Array(16);$=$||{};let W=$.node||Af,L=$.clockseq!==void 0?$.clockseq:H$;if(W==null||L==null){const Q=$.random||($.rng||S2.default)();if(W==null)W=Af=[Q[0]|1,Q[1],Q[2],Q[3],Q[4],Q[5]];if(L==null)L=H$=(Q[6]<<8|Q[7])&16383}let X=$.msecs!==void 0?$.msecs:Date.now(),Z=$.nsecs!==void 0?$.nsecs:N$+1;const F=X-C$+(Z-N$)/1e4;if(F<0&&$.clockseq===void 0)L=L+1&16383;if((F<0||X>C$)&&$.nsecs===void 0)Z=0;if(Z>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");C$=X,N$=Z,H$=L,X+=12219292800000;const Y=((X&268435455)*1e4+Z)%4294967296;f[G++]=Y>>>24&255,f[G++]=Y>>>16&255,f[G++]=Y>>>8&255,f[G++]=Y&255;const I=X/4294967296*1e4&268435455;f[G++]=I>>>8&255,f[G++]=I&255,f[G++]=I>>>24&15|16,f[G++]=I>>>16&255,f[G++]=L>>>8|128,f[G++]=L&255;for(let Q=0;Q<6;++Q)f[G+Q]=W[Q];return w||b2.unsafeStringify(f)};Object.defineProperty(Of,"__esModule",{value:!0});Of.default=void 0;var S2=h2(T$()),b2=c0(),Af,H$,C$=0,N$=0,k2=D2;Of.default=k2});var q$=M((Tf)=>{var v2=function($){return $&&$.__esModule?$:{default:$}},y2=function($){if(!c2.default($))throw TypeError("Invalid UUID");let w;const U=new Uint8Array(16);return U[0]=(w=parseInt($.slice(0,8),16))>>>24,U[1]=w>>>16&255,U[2]=w>>>8&255,U[3]=w&255,U[4]=(w=parseInt($.slice(9,13),16))>>>8,U[5]=w&255,U[6]=(w=parseInt($.slice(14,18),16))>>>8,U[7]=w&255,U[8]=(w=parseInt($.slice(19,23),16))>>>8,U[9]=w&255,U[10]=(w=parseInt($.slice(24,36),16))/1099511627776&255,U[11]=w/4294967296&255,U[12]=w>>>24&255,U[13]=w>>>16&255,U[14]=w>>>8&255,U[15]=w&255,U};Object.defineProperty(Tf,"__esModule",{value:!0});Tf.default=void 0;var c2=v2(k0()),x2=y2;Tf.default=x2});var j$=M((qf)=>{var d2=function($){return $&&$.__esModule?$:{default:$}},p2=function($){$=unescape(encodeURIComponent($));const w=[];for(let U=0;U<$.length;++U)w.push($.charCodeAt(U));return w},g2=function($,w,U){function G(f,W,L,X){var Z;if(typeof f==="string")f=p2(f);if(typeof W==="string")W=_2.default(W);if(((Z=W)===null||Z===void 0?void 0:Z.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let F=new Uint8Array(16+f.length);if(F.set(W),F.set(f,W.length),F=U(F),F[6]=F[6]&15|w,F[8]=F[8]&63|128,L){X=X||0;for(let Y=0;Y<16;++Y)L[X+Y]=F[Y];return L}return u2.unsafeStringify(F)}try{G.name=$}catch(f){}return G.DNS=Cf,G.URL=Nf,G};Object.defineProperty(qf,"__esModule",{value:!0});qf.URL=qf.DNS=void 0;qf.default=g2;var u2=c0(),_2=d2(q$()),Cf="6ba7b810-9dad-11d1-80b4-00c04fd430c8";qf.DNS=Cf;var Nf="6ba7b811-9dad-11d1-80b4-00c04fd430c8";qf.URL=Nf});var bf=M((Pf)=>{var m2=function($){return $&&$.__esModule?$:{default:$}},i2=function($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return s2.default.createHash("md5").update($).digest()};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.default=void 0;var s2=m2(import.meta.require("crypto")),r2=i2;Pf.default=r2});var cf=M((Df)=>{var hf=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(Df,"__esModule",{value:!0});Df.default=void 0;var o2=hf(j$()),a2=hf(bf()),t2=o2.default("v3",48,a2.default),e2=t2;Df.default=e2});var xf=M((vf)=>{var wF=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(vf,"__esModule",{value:!0});vf.default=void 0;var $F=wF(import.meta.require("crypto")),UF={randomUUID:$F.default.randomUUID};vf.default=UF});var gf=M((df)=>{var _f=function($){return $&&$.__esModule?$:{default:$}},WF=function($,w,U){if(uf.default.randomUUID&&!w&&!$)return uf.default.randomUUID();$=$||{};const G=$.random||($.rng||fF.default)();if(G[6]=G[6]&15|64,G[8]=G[8]&63|128,w){U=U||0;for(let f=0;f<16;++f)w[U+f]=G[f];return w}return GF.unsafeStringify(G)};Object.defineProperty(df,"__esModule",{value:!0});df.default=void 0;var uf=_f(xf()),fF=_f(T$()),GF=c0(),LF=WF;df.default=LF});var sf=M((lf)=>{var ZF=function($){return $&&$.__esModule?$:{default:$}},FF=function($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return XF.default.createHash("sha1").update($).digest()};Object.defineProperty(lf,"__esModule",{value:!0});lf.default=void 0;var XF=ZF(import.meta.require("crypto")),YF=FF;lf.default=YF});var af=M((rf)=>{var mf=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(rf,"__esModule",{value:!0});rf.default=void 0;var IF=mf(j$()),zF=mf(sf()),QF=IF.default("v5",80,zF.default),EF=QF;rf.default=EF});var $G=M((tf)=>{Object.defineProperty(tf,"__esModule",{value:!0});tf.default=void 0;var RF="00000000-0000-0000-0000-000000000000";tf.default=RF});var fG=M((wG)=>{var JF=function($){return $&&$.__esModule?$:{default:$}},KF=function($){if(!MF.default($))throw TypeError("Invalid UUID");return parseInt($.slice(14,15),16)};Object.defineProperty(wG,"__esModule",{value:!0});wG.default=void 0;var MF=JF(k0()),AF=KF;wG.default=AF});var P$=M((p)=>{var o=function($){return $&&$.__esModule?$:{default:$}};Object.defineProperty(p,"__esModule",{value:!0});Object.defineProperty(p,"NIL",{enumerable:!0,get:function(){return HF.default}});Object.defineProperty(p,"parse",{enumerable:!0,get:function(){return jF.default}});Object.defineProperty(p,"stringify",{enumerable:!0,get:function(){return qF.default}});Object.defineProperty(p,"v1",{enumerable:!0,get:function(){return OF.default}});Object.defineProperty(p,"v3",{enumerable:!0,get:function(){return BF.default}});Object.defineProperty(p,"v4",{enumerable:!0,get:function(){return VF.default}});Object.defineProperty(p,"v5",{enumerable:!0,get:function(){return TF.default}});Object.defineProperty(p,"validate",{enumerable:!0,get:function(){return NF.default}});Object.defineProperty(p,"version",{enumerable:!0,get:function(){return CF.default}});var OF=o(Vf()),BF=o(cf()),VF=o(gf()),TF=o(af()),HF=o($G()),CF=o(fG()),NF=o(k0()),qF=o(c0()),jF=o(q$())});var Z0=M((hR,XG)=>{var{defineProperty:R1,getOwnPropertyDescriptor:PF,getOwnPropertyNames:SF}=Object,bF=Object.prototype.hasOwnProperty,A0=($,w)=>R1($,"name",{value:w,configurable:!0}),hF=($,w)=>{for(var U in w)R1($,U,{get:w[U],enumerable:!0})},DF=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of SF(w))if(!bF.call($,f)&&f!==U)R1($,f,{get:()=>w[f],enumerable:!(G=PF(w,f))||G.enumerable})}return $},kF=($)=>DF(R1({},"__esModule",{value:!0}),$),GG={};hF(GG,{isClockSkewCorrectedError:()=>WG,isClockSkewError:()=>dF,isRetryableByTrait:()=>_F,isServerError:()=>gF,isThrottlingError:()=>pF,isTransientError:()=>LG});XG.exports=kF(GG);var cF=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],vF=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],yF=["TimeoutError","RequestTimeout","RequestTimeoutException"],xF=[500,502,503,504],uF=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],_F=A0(($)=>$.$retryable!==void 0,"isRetryableByTrait"),dF=A0(($)=>cF.includes($.name),"isClockSkewError"),WG=A0(($)=>{var w;return(w=$.$metadata)==null?void 0:w.clockSkewCorrected},"isClockSkewCorrectedError"),pF=A0(($)=>{var w,U;return((w=$.$metadata)==null?void 0:w.httpStatusCode)===429||vF.includes($.name)||((U=$.$retryable)==null?void 0:U.throttling)==!0},"isThrottlingError"),LG=A0(($)=>{var w;return WG($)||yF.includes($.name)||uF.includes(($==null?void 0:$.code)||"")||xF.includes(((w=$.$metadata)==null?void 0:w.httpStatusCode)||0)},"isTransientError"),gF=A0(($)=>{var w;if(((w=$.$metadata)==null?void 0:w.httpStatusCode)!==void 0){const U=$.$metadata.httpStatusCode;if(500<=U&&U<=599&&!LG($))return!0;return!1}return!1},"isServerError")});var BG=M((DR,OG)=>{var{defineProperty:M1,getOwnPropertyDescriptor:lF,getOwnPropertyNames:nF}=Object,sF=Object.prototype.hasOwnProperty,g=($,w)=>M1($,"name",{value:w,configurable:!0}),mF=($,w)=>{for(var U in w)M1($,U,{get:w[U],enumerable:!0})},iF=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of nF(w))if(!sF.call($,f)&&f!==U)M1($,f,{get:()=>w[f],enumerable:!(G=lF(w,f))||G.enumerable})}return $},rF=($)=>iF(M1({},"__esModule",{value:!0}),$),FG={};mF(FG,{AdaptiveRetryStrategy:()=>wY,ConfiguredRetryStrategy:()=>UY,DEFAULT_MAX_ATTEMPTS:()=>S$,DEFAULT_RETRY_DELAY_BASE:()=>v0,DEFAULT_RETRY_MODE:()=>oF,DefaultRateLimiter:()=>zG,INITIAL_RETRY_TOKENS:()=>b$,INVOCATION_ID_HEADER:()=>tF,MAXIMUM_RETRY_DELAY:()=>h$,NO_RETRY_INCREMENT:()=>MG,REQUEST_HEADER:()=>eF,RETRY_COST:()=>EG,RETRY_MODES:()=>YG,StandardRetryStrategy:()=>D$,THROTTLING_RETRY_DELAY_BASE:()=>QG,TIMEOUT_RETRY_COST:()=>RG});OG.exports=rF(FG);var YG=(($)=>{return $.STANDARD="standard",$.ADAPTIVE="adaptive",$})(YG||{}),S$=3,oF="standard",aF=Z0(),IG=class ${constructor(w){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(w==null?void 0:w.beta)??0.7,this.minCapacity=(w==null?void 0:w.minCapacity)??1,this.minFillRate=(w==null?void 0:w.minFillRate)??0.5,this.scaleConstant=(w==null?void 0:w.scaleConstant)??0.4,this.smooth=(w==null?void 0:w.smooth)??0.8;const U=this.getCurrentTimeInSeconds();this.lastThrottleTime=U,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(w){if(!this.enabled)return;if(this.refillTokenBucket(),w>this.currentCapacity){const U=(w-this.currentCapacity)/this.fillRate*1000;await new Promise((G)=>setTimeout(G,U))}this.currentCapacity=this.currentCapacity-w}refillTokenBucket(){const w=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=w;return}const U=(w-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+U),this.lastTimestamp=w}updateClientSendingRate(w){let U;if(this.updateMeasuredRate(),aF.isThrottlingError(w)){const f=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=f,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),U=this.cubicThrottle(f),this.enableTokenBucket()}else this.calculateTimeWindow(),U=this.cubicSuccess(this.getCurrentTimeInSeconds());const G=Math.min(U,2*this.measuredTxRate);this.updateTokenBucketRate(G)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(w){return this.getPrecise(w*this.beta)}cubicSuccess(w){return this.getPrecise(this.scaleConstant*Math.pow(w-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(w){this.refillTokenBucket(),this.fillRate=Math.max(w,this.minFillRate),this.maxCapacity=Math.max(w,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const w=this.getCurrentTimeInSeconds(),U=Math.floor(w*2)/2;if(this.requestCount++,U>this.lastTxRateBucket){const G=this.requestCount/(U-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(G*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=U}}getPrecise(w){return parseFloat(w.toFixed(8))}};g(IG,"DefaultRateLimiter");var zG=IG,v0=100,h$=20000,QG=500,b$=500,EG=5,RG=10,MG=1,tF="amz-sdk-invocation-id",eF="amz-sdk-request",$Y=g(()=>{let $=v0;return{computeNextBackoffDelay:g((G)=>{return Math.floor(Math.min(h$,Math.random()*2**G*$))},"computeNextBackoffDelay"),setDelayBase:g((G)=>{$=G},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),ZG=g(({retryDelay:$,retryCount:w,retryCost:U})=>{return{getRetryCount:g(()=>w,"getRetryCount"),getRetryDelay:g(()=>Math.min(h$,$),"getRetryDelay"),getRetryCost:g(()=>U,"getRetryCost")}},"createDefaultRetryToken"),JG=class ${constructor(w){this.maxAttempts=w,this.mode="standard",this.capacity=b$,this.retryBackoffStrategy=$Y(),this.maxAttemptsProvider=typeof w==="function"?w:async()=>w}async acquireInitialRetryToken(w){return ZG({retryDelay:v0,retryCount:0})}async refreshRetryTokenForRetry(w,U){const G=await this.getMaxAttempts();if(this.shouldRetry(w,U,G)){const f=U.errorType;this.retryBackoffStrategy.setDelayBase(f==="THROTTLING"?QG:v0);const W=this.retryBackoffStrategy.computeNextBackoffDelay(w.getRetryCount()),L=U.retryAfterHint?Math.max(U.retryAfterHint.getTime()-Date.now()||0,W):W,X=this.getCapacityCost(f);return this.capacity-=X,ZG({retryDelay:L,retryCount:w.getRetryCount()+1,retryCost:X})}throw new Error("No retry token available")}recordSuccess(w){this.capacity=Math.max(b$,this.capacity+(w.getRetryCost()??MG))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(w){return console.warn(`Max attempts provider could not resolve. Using default of ${S$}`),S$}}shouldRetry(w,U,G){return w.getRetryCount()+1<G&&this.capacity>=this.getCapacityCost(U.errorType)&&this.isRetryableError(U.errorType)}getCapacityCost(w){return w==="TRANSIENT"?RG:EG}isRetryableError(w){return w==="THROTTLING"||w==="TRANSIENT"}};g(JG,"StandardRetryStrategy");var D$=JG,KG=class ${constructor(w,U){this.maxAttemptsProvider=w,this.mode="adaptive";const{rateLimiter:G}=U??{};this.rateLimiter=G??new zG,this.standardRetryStrategy=new D$(w)}async acquireInitialRetryToken(w){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(w)}async refreshRetryTokenForRetry(w,U){return this.rateLimiter.updateClientSendingRate(U),this.standardRetryStrategy.refreshRetryTokenForRetry(w,U)}recordSuccess(w){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(w)}};g(KG,"AdaptiveRetryStrategy");var wY=KG,AG=class $ extends D${constructor(w,U=v0){super(typeof w==="function"?w:async()=>w);if(typeof U==="number")this.computeNextBackoffDelay=()=>U;else this.computeNextBackoffDelay=U}async refreshRetryTokenForRetry(w,U){const G=await super.refreshRetryTokenForRetry(w,U);return G.getRetryDelay=()=>this.computeNextBackoffDelay(G.getRetryCount()),G}};g(AG,"ConfiguredRetryStrategy");var UY=AG});var k$=M((kR,TG)=>{var{defineProperty:J1,getOwnPropertyDescriptor:fY,getOwnPropertyNames:GY}=Object,WY=Object.prototype.hasOwnProperty,LY=($,w)=>J1($,"name",{value:w,configurable:!0}),XY=($,w)=>{for(var U in w)J1($,U,{get:w[U],enumerable:!0})},ZY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of GY(w))if(!WY.call($,f)&&f!==U)J1($,f,{get:()=>w[f],enumerable:!(G=fY(w,f))||G.enumerable})}return $},FY=($)=>ZY(J1({},"__esModule",{value:!0}),$),VG={};XY(VG,{isArrayBuffer:()=>YY});TG.exports=FY(VG);var YY=LY(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var y0=M((cR,NG)=>{var{defineProperty:K1,getOwnPropertyDescriptor:IY,getOwnPropertyNames:zY}=Object,QY=Object.prototype.hasOwnProperty,HG=($,w)=>K1($,"name",{value:w,configurable:!0}),EY=($,w)=>{for(var U in w)K1($,U,{get:w[U],enumerable:!0})},RY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of zY(w))if(!QY.call($,f)&&f!==U)K1($,f,{get:()=>w[f],enumerable:!(G=IY(w,f))||G.enumerable})}return $},MY=($)=>RY(K1({},"__esModule",{value:!0}),$),CG={};EY(CG,{fromArrayBuffer:()=>KY,fromString:()=>AY});NG.exports=MY(CG);var JY=k$(),c$=import.meta.require("buffer"),KY=HG(($,w=0,U=$.byteLength-w)=>{if(!JY.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return c$.Buffer.from($,w,U)},"fromArrayBuffer"),AY=HG(($,w)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return w?c$.Buffer.from($,w):c$.Buffer.from($)},"fromString")});var PG=M((qG)=>{Object.defineProperty(qG,"__esModule",{value:!0});qG.fromBase64=void 0;var OY=y0(),BY=/^[A-Za-z0-9+/]*={0,2}$/,VY=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!BY.exec($))throw new TypeError("Invalid base64 string.");const w=OY.fromString($,"base64");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength)};qG.fromBase64=VY});var $0=M((yR,DG)=>{var{defineProperty:A1,getOwnPropertyDescriptor:TY,getOwnPropertyNames:HY}=Object,CY=Object.prototype.hasOwnProperty,v$=($,w)=>A1($,"name",{value:w,configurable:!0}),NY=($,w)=>{for(var U in w)A1($,U,{get:w[U],enumerable:!0})},qY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of HY(w))if(!CY.call($,f)&&f!==U)A1($,f,{get:()=>w[f],enumerable:!(G=TY(w,f))||G.enumerable})}return $},jY=($)=>qY(A1({},"__esModule",{value:!0}),$),SG={};NY(SG,{fromUtf8:()=>hG,toUint8Array:()=>PY,toUtf8:()=>SY});DG.exports=jY(SG);var bG=y0(),hG=v$(($)=>{const w=bG.fromString($,"utf8");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),PY=v$(($)=>{if(typeof $==="string")return hG($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),SY=v$(($)=>{if(typeof $==="string")return $;if(typeof $!=="object"||typeof $.byteOffset!=="number"||typeof $.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return bG.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var vG=M((kG)=>{Object.defineProperty(kG,"__esModule",{value:!0});kG.toBase64=void 0;var bY=y0(),hY=$0(),DY=($)=>{let w;if(typeof $==="string")w=hY.fromUtf8($);else w=$;if(typeof w!=="object"||typeof w.byteOffset!=="number"||typeof w.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return bY.fromArrayBuffer(w.buffer,w.byteOffset,w.byteLength).toString("base64")};kG.toBase64=DY});var B1=M((uR,O1)=>{var{defineProperty:yG,getOwnPropertyDescriptor:kY,getOwnPropertyNames:cY}=Object,vY=Object.prototype.hasOwnProperty,y$=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of cY(w))if(!vY.call($,f)&&f!==U)yG($,f,{get:()=>w[f],enumerable:!(G=kY(w,f))||G.enumerable})}return $},xG=($,w,U)=>(y$($,w,"default"),U&&y$(U,w,"default")),yY=($)=>y$(yG({},"__esModule",{value:!0}),$),x$={};O1.exports=yY(x$);xG(x$,PG(),O1.exports);xG(x$,vG(),O1.exports)});var dG=M((uG)=>{Object.defineProperty(uG,"__esModule",{value:!0});uG.getAwsChunkedEncodingStream=void 0;var xY=import.meta.require("stream"),uY=($,w)=>{const{base64Encoder:U,bodyLengthChecker:G,checksumAlgorithmFn:f,checksumLocationName:W,streamHasher:L}=w,X=U!==void 0&&f!==void 0&&W!==void 0&&L!==void 0,Z=X?L(f,$):void 0,F=new xY.Readable({read:()=>{}});return $.on("data",(Y)=>{const I=G(Y)||0;F.push(`${I.toString(16)}\r\n`),F.push(Y),F.push("\r\n")}),$.on("end",async()=>{if(F.push("0\r\n"),X){const Y=U(await Z);F.push(`${W}:${Y}\r\n`),F.push("\r\n")}F.push(null)}),F};uG.getAwsChunkedEncodingStream=uY});var _$=M((dR,lG)=>{var{defineProperty:V1,getOwnPropertyDescriptor:_Y,getOwnPropertyNames:dY}=Object,pY=Object.prototype.hasOwnProperty,u$=($,w)=>V1($,"name",{value:w,configurable:!0}),gY=($,w)=>{for(var U in w)V1($,U,{get:w[U],enumerable:!0})},lY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of dY(w))if(!pY.call($,f)&&f!==U)V1($,f,{get:()=>w[f],enumerable:!(G=_Y(w,f))||G.enumerable})}return $},nY=($)=>lY(V1({},"__esModule",{value:!0}),$),pG={};gY(pG,{escapeUri:()=>gG,escapeUriPath:()=>mY});lG.exports=nY(pG);var gG=u$(($)=>encodeURIComponent($).replace(/[!'()*]/g,sY),"escapeUri"),sY=u$(($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),mY=u$(($)=>$.split("/").map(gG).join("/"),"escapeUriPath")});var p$=M((pR,mG)=>{var sG=function($){const w=[];for(let U of Object.keys($).sort()){const G=$[U];if(U=d$.escapeUri(U),Array.isArray(G))for(let f=0,W=G.length;f<W;f++)w.push(`${U}=${d$.escapeUri(G[f])}`);else{let f=U;if(G||typeof G==="string")f+=`=${d$.escapeUri(G)}`;w.push(f)}}return w.join("&")},T1=Object.defineProperty,iY=Object.getOwnPropertyDescriptor,rY=Object.getOwnPropertyNames,oY=Object.prototype.hasOwnProperty,aY=($,w)=>T1($,"name",{value:w,configurable:!0}),tY=($,w)=>{for(var U in w)T1($,U,{get:w[U],enumerable:!0})},eY=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of rY(w))if(!oY.call($,f)&&f!==U)T1($,f,{get:()=>w[f],enumerable:!(G=iY(w,f))||G.enumerable})}return $},$I=($)=>eY(T1({},"__esModule",{value:!0}),$),nG={};tY(nG,{buildQueryString:()=>sG});mG.exports=$I(nG);var d$=_$();aY(sG,"buildQueryString")});var YW=M((gR,FW)=>{async function n$($,w,U=iG){const G=w.headers??{},f=G.Expect||G.expect;let W=-1,L=!1;if(f==="100-continue")await Promise.race([new Promise((X)=>{W=Number(setTimeout(X,Math.max(iG,U)))}),new Promise((X)=>{$.on("continue",()=>{clearTimeout(W),X()}),$.on("error",()=>{L=!0,clearTimeout(W),X()})})]);if(!L)UW($,w.body)}var UW=function($,w){if(w instanceof wW.Readable){w.pipe($);return}if(w){if(Buffer.isBuffer(w)||typeof w==="string"){$.end(w);return}const U=w;if(typeof U==="object"&&U.buffer&&typeof U.byteOffset==="number"&&typeof U.byteLength==="number"){$.end(Buffer.from(U.buffer,U.byteOffset,U.byteLength));return}$.end(Buffer.from(w));return}$.end()};async function ZW($){const w=[],U=$.getReader();let G=!1,f=0;while(!G){const{done:X,value:Z}=await U.read();if(Z)w.push(Z),f+=Z.length;G=X}const W=new Uint8Array(f);let L=0;for(let X of w)W.set(X,L),L+=X.length;return W}var{create:wI,defineProperty:x0,getOwnPropertyDescriptor:UI,getOwnPropertyNames:fI,getPrototypeOf:GI}=Object,WI=Object.prototype.hasOwnProperty,q=($,w)=>x0($,"name",{value:w,configurable:!0}),LI=($,w)=>{for(var U in w)x0($,U,{get:w[U],enumerable:!0})},oG=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of fI(w))if(!WI.call($,f)&&f!==U)x0($,f,{get:()=>w[f],enumerable:!(G=UI(w,f))||G.enumerable})}return $},XI=($,w,U)=>(U=$!=null?wI(GI($)):{},oG(w||!$||!$.__esModule?x0(U,"default",{value:$,enumerable:!0}):U,$)),ZI=($)=>oG(x0({},"__esModule",{value:!0}),$),aG={};LI(aG,{DEFAULT_REQUEST_TIMEOUT:()=>QI,NodeHttp2Handler:()=>KI,NodeHttpHandler:()=>EI,streamCollector:()=>OI});FW.exports=ZI(aG);var tG=r(),eG=p$(),g$=import.meta.require("http"),l$=import.meta.require("https"),FI=["ECONNRESET","EPIPE","ETIMEDOUT"],$W=q(($)=>{const w={};for(let U of Object.keys($)){const G=$[U];w[U]=Array.isArray(G)?G.join(","):G}return w},"getTransformedHeaders"),YI=q(($,w,U=0)=>{if(!U)return;const G=setTimeout(()=>{$.destroy(),w(Object.assign(new Error(`Socket timed out without establishing a connection within ${U} ms`),{name:"TimeoutError"}))},U);$.on("socket",(f)=>{if(f.connecting)f.on("connect",()=>{clearTimeout(G)});else clearTimeout(G)})},"setConnectionTimeout"),II=q(($,{keepAlive:w,keepAliveMsecs:U})=>{if(w!==!0)return;$.on("socket",(G)=>{G.setKeepAlive(w,U||0)})},"setSocketKeepAlive"),zI=q(($,w,U=0)=>{$.setTimeout(U,()=>{$.destroy(),w(Object.assign(new Error(`Connection timed out after ${U} ms`),{name:"TimeoutError"}))})},"setSocketTimeout"),wW=import.meta.require("stream"),iG=1000;q(n$,"writeRequestBody");q(UW,"writeBody");var QI=0,fW=class ${constructor(w){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((U,G)=>{if(typeof w==="function")w().then((f)=>{U(this.resolveDefaultConfig(f))}).catch(G);else U(this.resolveDefaultConfig(w))})}static create(w){if(typeof(w==null?void 0:w.handle)==="function")return w;return new $(w)}static checkSocketUsage(w,U,G=console){var f,W,L;const{sockets:X,requests:Z,maxSockets:F}=w;if(typeof F!=="number"||F===Infinity)return U;const Y=15000;if(Date.now()-Y<U)return U;if(X&&Z)for(let I in X){const Q=((f=X[I])==null?void 0:f.length)??0,z=((W=Z[I])==null?void 0:W.length)??0;if(Q>=F&&z>=2*F)return(L=G==null?void 0:G.warn)==null||L.call(G,`@smithy/node-http-handler:WARN - socket usage at capacity=${Q} and ${z} additional requests are enqueued.
2
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return U}resolveDefaultConfig(w){const{requestTimeout:U,connectionTimeout:G,socketTimeout:f,httpAgent:W,httpsAgent:L}=w||{};return{connectionTimeout:G,requestTimeout:U??f,httpAgent:(()=>{if(W instanceof g$.Agent||typeof(W==null?void 0:W.destroy)==="function")return W;return new g$.Agent({keepAlive:!0,maxSockets:50,...W})})(),httpsAgent:(()=>{if(L instanceof l$.Agent||typeof(L==null?void 0:L.destroy)==="function")return L;return new l$.Agent({keepAlive:!0,maxSockets:50,...L})})(),logger:console}}destroy(){var w,U,G,f;(U=(w=this.config)==null?void 0:w.httpAgent)==null||U.destroy(),(f=(G=this.config)==null?void 0:G.httpsAgent)==null||f.destroy()}async handle(w,{abortSignal:U}={}){if(!this.config)this.config=await this.configProvider;let G;return new Promise((f,W)=>{let L=void 0;const X=q(async(A)=>{await L,clearTimeout(G),f(A)},"resolve"),Z=q(async(A)=>{await L,clearTimeout(G),W(A)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(U==null?void 0:U.aborted){const A=new Error("Request aborted");A.name="AbortError",Z(A);return}const F=w.protocol==="https:",Y=F?this.config.httpsAgent:this.config.httpAgent;G=setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(Y,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const I=eG.buildQueryString(w.query||{});let Q=void 0;if(w.username!=null||w.password!=null){const A=w.username??"",B=w.password??"";Q=`${A}:${B}`}let z=w.path;if(I)z+=`?${I}`;if(w.fragment)z+=`#${w.fragment}`;const E={headers:w.headers,host:w.hostname,method:w.method,path:z,port:w.port,agent:Y,auth:Q},O=(F?l$.request:g$.request)(E,(A)=>{const B=new tG.HttpResponse({statusCode:A.statusCode||-1,reason:A.statusMessage,headers:$W(A.headers),body:A});X({response:B})});if(O.on("error",(A)=>{if(FI.includes(A.code))Z(Object.assign(A,{name:"TimeoutError"}));else Z(A)}),YI(O,Z,this.config.connectionTimeout),zI(O,Z,this.config.requestTimeout),U){const A=q(()=>{O.destroy();const B=new Error("Request aborted");B.name="AbortError",Z(B)},"onAbort");if(typeof U.addEventListener==="function"){const B=U;B.addEventListener("abort",A,{once:!0}),O.once("close",()=>B.removeEventListener("abort",A))}else U.onabort=A}const K=E.agent;if(typeof K==="object"&&"keepAlive"in K)II(O,{keepAlive:K.keepAlive,keepAliveMsecs:K.keepAliveMsecs});L=n$(O,w,this.config.requestTimeout).catch((A)=>{return clearTimeout(G),W(A)})})}updateHttpClientConfig(w,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return{...G,[w]:U}})}httpHandlerConfigs(){return this.config??{}}};q(fW,"NodeHttpHandler");var EI=fW,rG=import.meta.require("http2"),RI=XI(import.meta.require("http2")),GW=class ${constructor(w){this.sessions=[],this.sessions=w??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(w){this.sessions.push(w)}contains(w){return this.sessions.includes(w)}remove(w){this.sessions=this.sessions.filter((U)=>U!==w)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(w){for(let U of this.sessions)if(U===w){if(!U.destroyed)U.destroy()}}};q(GW,"NodeHttp2ConnectionPool");var MI=GW,WW=class ${constructor(w){if(this.sessionCache=new Map,this.config=w,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(w,U){const G=this.getUrlString(w),f=this.sessionCache.get(G);if(f){const Z=f.poll();if(Z&&!this.config.disableConcurrency)return Z}const W=RI.default.connect(G);if(this.config.maxConcurrency)W.settings({maxConcurrentStreams:this.config.maxConcurrency},(Z)=>{if(Z)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+w.destination.toString())});W.unref();const L=q(()=>{W.destroy(),this.deleteSession(G,W)},"destroySessionCb");if(W.on("goaway",L),W.on("error",L),W.on("frameError",L),W.on("close",()=>this.deleteSession(G,W)),U.requestTimeout)W.setTimeout(U.requestTimeout,L);const X=this.sessionCache.get(G)||new MI;return X.offerLast(W),this.sessionCache.set(G,X),W}deleteSession(w,U){const G=this.sessionCache.get(w);if(!G)return;if(!G.contains(U))return;G.remove(U),this.sessionCache.set(w,G)}release(w,U){var G;const f=this.getUrlString(w);(G=this.sessionCache.get(f))==null||G.offerLast(U)}destroy(){for(let[w,U]of this.sessionCache){for(let G of U){if(!G.destroyed)G.destroy();U.remove(G)}this.sessionCache.delete(w)}}setMaxConcurrentStreams(w){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=w}setDisableConcurrentStreams(w){this.config.disableConcurrency=w}getUrlString(w){return w.destination.toString()}};q(WW,"NodeHttp2ConnectionManager");var JI=WW,LW=class ${constructor(w){this.metadata={handlerProtocol:"h2"},this.connectionManager=new JI({}),this.configProvider=new Promise((U,G)=>{if(typeof w==="function")w().then((f)=>{U(f||{})}).catch(G);else U(w||{})})}static create(w){if(typeof(w==null?void 0:w.handle)==="function")return w;return new $(w)}destroy(){this.connectionManager.destroy()}async handle(w,{abortSignal:U}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:G,disableConcurrentStreams:f}=this.config;return new Promise((W,L)=>{var X;let Z=!1,F=void 0;const Y=q(async(N)=>{await F,W(N)},"resolve"),I=q(async(N)=>{await F,L(N)},"reject");if(U==null?void 0:U.aborted){Z=!0;const N=new Error("Request aborted");N.name="AbortError",I(N);return}const{hostname:Q,method:z,port:E,protocol:J,query:O}=w;let K="";if(w.username!=null||w.password!=null){const N=w.username??"",_=w.password??"";K=`${N}:${_}@`}const A=`${J}//${K}${Q}${E?`:${E}`:""}`,B={destination:new URL(A)},T=this.connectionManager.lease(B,{requestTimeout:(X=this.config)==null?void 0:X.sessionTimeout,disableConcurrentStreams:f||!1}),S=q((N)=>{if(f)this.destroySession(T);Z=!0,I(N)},"rejectWithDestroy"),aw=eG.buildQueryString(O||{});let F$=w.path;if(aw)F$+=`?${aw}`;if(w.fragment)F$+=`#${w.fragment}`;const v=T.request({...w.headers,[rG.constants.HTTP2_HEADER_PATH]:F$,[rG.constants.HTTP2_HEADER_METHOD]:z});if(T.ref(),v.on("response",(N)=>{const _=new tG.HttpResponse({statusCode:N[":status"]||-1,headers:$W(N),body:v});if(Z=!0,Y({response:_}),f)T.close(),this.connectionManager.deleteSession(A,T)}),G)v.setTimeout(G,()=>{v.close();const N=new Error(`Stream timed out because of no activity for ${G} ms`);N.name="TimeoutError",S(N)});if(U){const N=q(()=>{v.close();const _=new Error("Request aborted");_.name="AbortError",S(_)},"onAbort");if(typeof U.addEventListener==="function"){const _=U;_.addEventListener("abort",N,{once:!0}),v.once("close",()=>_.removeEventListener("abort",N))}else U.onabort=N}v.on("frameError",(N,_,wX)=>{S(new Error(`Frame type id ${N} in stream id ${wX} has failed with code ${_}.`))}),v.on("error",S),v.on("aborted",()=>{S(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${v.rstCode}.`))}),v.on("close",()=>{if(T.unref(),f)T.destroy();if(!Z)S(new Error("Unexpected error: http2 request did not get a response"))}),F=n$(v,w,G)})}updateHttpClientConfig(w,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return{...G,[w]:U}})}httpHandlerConfigs(){return this.config??{}}destroySession(w){if(!w.destroyed)w.destroy()}};q(LW,"NodeHttp2Handler");var KI=LW,XW=class $ extends wW.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(w,U,G){this.bufferedBytes.push(w),G()}};q(XW,"Collector");var AI=XW,OI=q(($)=>{if(BI($))return ZW($);return new Promise((w,U)=>{const G=new AI;$.pipe(G),$.on("error",(f)=>{G.end(),U(f)}),G.on("error",U),G.on("finish",function(){const f=new Uint8Array(Buffer.concat(this.bufferedBytes));w(f)})})},"streamCollector"),BI=q(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");q(ZW,"collectReadableStream")});var AW=M((lR,KW)=>{var QW=function($=0){return new Promise((w,U)=>{if($)setTimeout(()=>{const G=new Error(`Request did not complete within ${$} ms`);G.name="TimeoutError",U(G)},$)})};async function RW($){const w=await JW($),U=SI.fromBase64(w);return new Uint8Array(U)}async function MW($){const w=[],U=$.getReader();let G=!1,f=0;while(!G){const{done:X,value:Z}=await U.read();if(Z)w.push(Z),f+=Z.length;G=X}const W=new Uint8Array(f);let L=0;for(let X of w)W.set(X,L),L+=X.length;return W}var JW=function($){return new Promise((w,U)=>{const G=new FileReader;G.onloadend=()=>{if(G.readyState!==2)return U(new Error("Reader aborted too early"));const f=G.result??"",W=f.indexOf(","),L=W>-1?W+1:f.length;w(f.substring(L))},G.onabort=()=>U(new Error("Read aborted")),G.onerror=()=>U(G.error),G.readAsDataURL($)})},C1=Object.defineProperty,VI=Object.getOwnPropertyDescriptor,TI=Object.getOwnPropertyNames,HI=Object.prototype.hasOwnProperty,a=($,w)=>C1($,"name",{value:w,configurable:!0}),CI=($,w)=>{for(var U in w)C1($,U,{get:w[U],enumerable:!0})},NI=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of TI(w))if(!HI.call($,f)&&f!==U)C1($,f,{get:()=>w[f],enumerable:!(G=VI(w,f))||G.enumerable})}return $},qI=($)=>NI(C1({},"__esModule",{value:!0}),$),zW={};CI(zW,{FetchHttpHandler:()=>PI,keepAliveSupport:()=>H1,streamCollector:()=>bI});KW.exports=qI(zW);var IW=r(),jI=p$();a(QW,"requestTimeout");var H1={supported:void 0},EW=class ${static create(w){if(typeof(w==null?void 0:w.handle)==="function")return w;return new $(w)}constructor(w){if(typeof w==="function")this.configProvider=w().then((U)=>U||{});else this.config=w??{},this.configProvider=Promise.resolve(this.config);if(H1.supported===void 0)H1.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(w,{abortSignal:U}={}){if(!this.config)this.config=await this.configProvider;const G=this.config.requestTimeout,f=this.config.keepAlive===!0,W=this.config.credentials;if(U==null?void 0:U.aborted){const K=new Error("Request aborted");return K.name="AbortError",Promise.reject(K)}let L=w.path;const X=jI.buildQueryString(w.query||{});if(X)L+=`?${X}`;if(w.fragment)L+=`#${w.fragment}`;let Z="";if(w.username!=null||w.password!=null){const K=w.username??"",A=w.password??"";Z=`${K}:${A}@`}const{port:F,method:Y}=w,I=`${w.protocol}//${Z}${w.hostname}${F?`:${F}`:""}${L}`,Q=Y==="GET"||Y==="HEAD"?void 0:w.body,z={body:Q,headers:new Headers(w.headers),method:Y,credentials:W};if(Q)z.duplex="half";if(typeof AbortController!=="undefined")z.signal=U;if(H1.supported)z.keepalive=f;let E=a(()=>{},"removeSignalEventListener");const J=new Request(I,z),O=[fetch(J).then((K)=>{const A=K.headers,B={};for(let S of A.entries())B[S[0]]=S[1];if(K.body==null)return K.blob().then((S)=>({response:new IW.HttpResponse({headers:B,reason:K.statusText,statusCode:K.status,body:S})}));return{response:new IW.HttpResponse({headers:B,reason:K.statusText,statusCode:K.status,body:K.body})}}),QW(G)];if(U)O.push(new Promise((K,A)=>{const B=a(()=>{const T=new Error("Request aborted");T.name="AbortError",A(T)},"onAbort");if(typeof U.addEventListener==="function"){const T=U;T.addEventListener("abort",B,{once:!0}),E=a(()=>T.removeEventListener("abort",B),"removeSignalEventListener")}else U.onabort=B}));return Promise.race(O).finally(E)}updateHttpClientConfig(w,U){this.config=void 0,this.configProvider=this.configProvider.then((G)=>{return G[w]=U,G})}httpHandlerConfigs(){return this.config??{}}};a(EW,"FetchHttpHandler");var PI=EW,SI=B1(),bI=a(($)=>{if(typeof Blob==="function"&&$ instanceof Blob)return RW($);return MW($)},"streamCollector");a(RW,"collectBlob");a(MW,"collectStream");a(JW,"readToBase64")});var u0=M((OW)=>{Object.defineProperty(OW,"__esModule",{value:!0});OW.isReadableStream=void 0;var hI=($)=>{var w;return typeof ReadableStream==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===ReadableStream.name||$ instanceof ReadableStream)};OW.isReadableStream=hI});var jW=M((NW)=>{Object.defineProperty(NW,"__esModule",{value:!0});NW.sdkStreamMixin=void 0;var DI=AW(),kI=B1(),cI=CW(),vI=$0(),VW=u0(),TW="The stream has already been transformed.",yI=($)=>{var w,U;if(!HW($)&&!VW.isReadableStream($)){const L=((U=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||U===void 0?void 0:U.name)||$;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${L}`)}let G=!1;const f=async()=>{if(G)throw new Error(TW);return G=!0,await DI.streamCollector($)},W=(L)=>{if(typeof L.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return L.stream()};return Object.assign($,{transformToByteArray:f,transformToString:async(L)=>{const X=await f();if(L==="base64")return kI.toBase64(X);else if(L==="hex")return cI.toHex(X);else if(L===void 0||L==="utf8"||L==="utf-8")return vI.toUtf8(X);else if(typeof TextDecoder==="function")return new TextDecoder(L).decode(X);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(G)throw new Error(TW);if(G=!0,HW($))return W($);else if(VW.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};NW.sdkStreamMixin=yI;var HW=($)=>typeof Blob==="function"&&$ instanceof Blob});var hW=M((SW)=>{Object.defineProperty(SW,"__esModule",{value:!0});SW.sdkStreamMixin=void 0;var xI=YW(),uI=y0(),s$=import.meta.require("stream"),_I=import.meta.require("util"),dI=jW(),PW="The stream has already been transformed.",pI=($)=>{var w,U;if(!($ instanceof s$.Readable))try{return dI.sdkStreamMixin($)}catch(W){const L=((U=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||U===void 0?void 0:U.name)||$;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${L}`)}let G=!1;const f=async()=>{if(G)throw new Error(PW);return G=!0,await xI.streamCollector($)};return Object.assign($,{transformToByteArray:f,transformToString:async(W)=>{const L=await f();if(W===void 0||Buffer.isEncoding(W))return uI.fromArrayBuffer(L.buffer,L.byteOffset,L.byteLength).toString(W);else return new _I.TextDecoder(W).decode(L)},transformToWebStream:()=>{if(G)throw new Error(PW);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof s$.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return G=!0,s$.Readable.toWeb($)}})};SW.sdkStreamMixin=pI});var cW=M((DW)=>{async function gI($){if(typeof $.stream==="function")$=$.stream();return $.tee()}Object.defineProperty(DW,"__esModule",{value:!0});DW.splitStream=void 0;DW.splitStream=gI});var uW=M((yW)=>{async function sI($){if(nI.isReadableStream($))return lI.splitStream($);const w=new vW.PassThrough,U=new vW.PassThrough;return $.pipe(w),$.pipe(U),[w,U]}Object.defineProperty(yW,"__esModule",{value:!0});yW.splitStream=void 0;var vW=import.meta.require("stream"),lI=cW(),nI=u0();yW.splitStream=sI});var pW=M((_W)=>{async function mI($,w){var U;let G=0;const f=[],W=$.getReader();let L=!1;while(!L){const{done:F,value:Y}=await W.read();if(Y)f.push(Y),G+=(U=Y===null||Y===void 0?void 0:Y.byteLength)!==null&&U!==void 0?U:0;if(G>=w)break;L=F}W.releaseLock();const X=new Uint8Array(Math.min(w,G));let Z=0;for(let F of f){if(F.byteLength>X.byteLength-Z){X.set(F.subarray(0,X.byteLength-Z),Z);break}else X.set(F,Z);Z+=F.length}return X}Object.defineProperty(_W,"__esModule",{value:!0});_W.headStream=void 0;_W.headStream=mI});var sW=M((lW)=>{Object.defineProperty(lW,"__esModule",{value:!0});lW.headStream=void 0;var iI=import.meta.require("stream"),rI=pW(),oI=u0(),aI=($,w)=>{if(oI.isReadableStream($))return rI.headStream($,w);return new Promise((U,G)=>{const f=new gW;f.limit=w,$.pipe(f),$.on("error",(W)=>{f.end(),G(W)}),f.on("error",G),f.on("finish",function(){const W=new Uint8Array(Buffer.concat(this.buffers));U(W)})})};lW.headStream=aI;class gW extends iI.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write($,w,U){var G;if(this.buffers.push($),this.bytesBuffered+=(G=$.byteLength)!==null&&G!==void 0?G:0,this.bytesBuffered>=this.limit){const f=this.bytesBuffered-this.limit,W=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=W.subarray(0,W.byteLength-f),this.emit("finish")}U()}}});var tW=M((tR,Y0)=>{var rW=function($,w="utf-8"){if(w==="base64")return mW.toBase64($);return iW.toUtf8($)},oW=function($,w){if(w==="base64")return i$.mutate(mW.fromBase64($));return i$.mutate(iW.fromUtf8($))},N1=Object.defineProperty,tI=Object.getOwnPropertyDescriptor,eI=Object.getOwnPropertyNames,$z=Object.prototype.hasOwnProperty,r$=($,w)=>N1($,"name",{value:w,configurable:!0}),wz=($,w)=>{for(var U in w)N1($,U,{get:w[U],enumerable:!0})},m$=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of eI(w))if(!$z.call($,f)&&f!==U)N1($,f,{get:()=>w[f],enumerable:!(G=tI(w,f))||G.enumerable})}return $},_0=($,w,U)=>(m$($,w,"default"),U&&m$(U,w,"default")),Uz=($)=>m$(N1({},"__esModule",{value:!0}),$),F0={};wz(F0,{Uint8ArrayBlobAdapter:()=>i$});Y0.exports=Uz(F0);var mW=B1(),iW=$0();r$(rW,"transformToString");r$(oW,"transformFromString");var aW=class $ extends Uint8Array{static fromString(w,U="utf-8"){switch(typeof w){case"string":return oW(w,U);default:throw new Error(`Unsupported conversion from ${typeof w} to Uint8ArrayBlobAdapter.`)}}static mutate(w){return Object.setPrototypeOf(w,$.prototype),w}transformToString(w="utf-8"){return rW(this,w)}};r$(aW,"Uint8ArrayBlobAdapter");var i$=aW;_0(F0,dG(),Y0.exports);_0(F0,hW(),Y0.exports);_0(F0,uW(),Y0.exports);_0(F0,sW(),Y0.exports);_0(F0,u0(),Y0.exports)});var T0=M((eR,B8)=>{var z8=function($){const w=$.getUTCFullYear(),U=$.getUTCMonth(),G=$.getUTCDay(),f=$.getUTCDate(),W=$.getUTCHours(),L=$.getUTCMinutes(),X=$.getUTCSeconds(),Z=f<10?`0${f}`:`${f}`,F=W<10?`0${W}`:`${W}`,Y=L<10?`0${L}`:`${L}`,I=X<10?`0${X}`:`${X}`;return`${bz[G]}, ${Z} ${Lw[U]} ${w} ${F}:${Y}:${I} GMT`},P1=function($){return encodeURIComponent($).replace(/[!'()*]/g,function(w){return"%"+w.charCodeAt(0).toString(16).toUpperCase()})},Xw=function($,w,U){let G,f,W;if(typeof w==="undefined"&&typeof U==="undefined")G={},W=$;else if(G=$,typeof w==="function")return f=w,W=U,Y5(G,f,W);else W=w;for(let L of Object.keys(W)){if(!Array.isArray(W[L])){G[L]=W[L];continue}A8(G,null,W,L)}return G},O8=function($,w,U){if(U<=0||!Number.isInteger(U))throw new Error("Invalid number of delimiters ("+U+") for splitEvery.");const G=$.split(w);if(U===1)return G;const f=[];let W="";for(let L=0;L<G.length;L++){if(W==="")W=G[L];else W+=w+G[L];if((L+1)%U===0)f.push(W),W=""}if(W!=="")f.push(W);return f},S1=Object.defineProperty,Gz=Object.getOwnPropertyDescriptor,Wz=Object.getOwnPropertyNames,Lz=Object.prototype.hasOwnProperty,R=($,w)=>S1($,"name",{value:w,configurable:!0}),Xz=($,w)=>{for(var U in w)S1($,U,{get:w[U],enumerable:!0})},Zz=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of Wz(w))if(!Lz.call($,f)&&f!==U)S1($,f,{get:()=>w[f],enumerable:!(G=Gz(w,f))||G.enumerable})}return $},Fz=($)=>Zz(S1({},"__esModule",{value:!0}),$),$8={};Xz($8,{Client:()=>Iz,Command:()=>W8,LazyJsonString:()=>X5,NoOpLogger:()=>Yz,SENSITIVE_STRING:()=>Ez,ServiceException:()=>rz,StringWrapper:()=>n0,_json:()=>Uw,collectBody:()=>zz,convertMap:()=>Z5,createAggregatedClient:()=>Rz,dateToUtcString:()=>z8,decorateServiceException:()=>E8,emitWarningIfUnsupportedVersion:()=>ez,expectBoolean:()=>Jz,expectByte:()=>ww,expectFloat32:()=>q1,expectInt:()=>Az,expectInt32:()=>e$,expectLong:()=>g0,expectNonNull:()=>Bz,expectNumber:()=>p0,expectObject:()=>X8,expectShort:()=>$w,expectString:()=>Vz,expectUnion:()=>Tz,extendedEncodeURIComponent:()=>P1,getArrayIfSingleItem:()=>L5,getDefaultClientConfiguration:()=>G5,getDefaultExtensionConfiguration:()=>M8,getValueFromTextNode:()=>J8,handleFloat:()=>Nz,limitedParseDouble:()=>Ww,limitedParseFloat:()=>qz,limitedParseFloat32:()=>jz,loadConfigsForDefaultMode:()=>tz,logger:()=>l0,map:()=>Xw,parseBoolean:()=>Mz,parseEpochTimestamp:()=>_z,parseRfc3339DateTime:()=>Dz,parseRfc3339DateTimeWithOffset:()=>cz,parseRfc7231DateTime:()=>uz,resolveDefaultRuntimeConfig:()=>W5,resolvedPath:()=>Q5,serializeDateTime:()=>R5,serializeFloat:()=>E5,splitEvery:()=>O8,strictParseByte:()=>I8,strictParseDouble:()=>Gw,strictParseFloat:()=>Hz,strictParseFloat32:()=>Z8,strictParseInt:()=>Pz,strictParseInt32:()=>Sz,strictParseLong:()=>Y8,strictParseShort:()=>O0,take:()=>F5,throwDefaultError:()=>R8,withBaseException:()=>oz});B8.exports=Fz($8);var w8=class ${trace(){}debug(){}info(){}warn(){}error(){}};R(w8,"NoOpLogger");var Yz=w8,U8=fz(),f8=class ${constructor(w){this.middlewareStack=U8.constructStack(),this.config=w}send(w,U,G){const f=typeof U!=="function"?U:void 0,W=typeof U==="function"?U:G,L=w.resolveMiddleware(this.middlewareStack,this.config,f);if(W)L(w).then((X)=>W(null,X.output),(X)=>W(X)).catch(()=>{});else return L(w).then((X)=>X.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}};R(f8,"Client");var Iz=f8,o$=tW(),zz=R(async($=new Uint8Array,w)=>{if($ instanceof Uint8Array)return o$.Uint8ArrayBlobAdapter.mutate($);if(!$)return o$.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const U=w.streamCollector($);return o$.Uint8ArrayBlobAdapter.mutate(await U)},"collectBody"),t$=M0(),G8=class ${constructor(){this.middlewareStack=U8.constructStack()}static classBuilder(){return new Qz}resolveMiddlewareWithContext(w,U,G,{middlewareFn:f,clientName:W,commandName:L,inputFilterSensitiveLog:X,outputFilterSensitiveLog:Z,smithyContext:F,additionalContext:Y,CommandCtor:I}){for(let O of f.bind(this)(I,w,U,G))this.middlewareStack.use(O);const Q=w.concat(this.middlewareStack),{logger:z}=U,E={logger:z,clientName:W,commandName:L,inputFilterSensitiveLog:X,outputFilterSensitiveLog:Z,[t$.SMITHY_CONTEXT_KEY]:{commandInstance:this,...F},...Y},{requestHandler:J}=U;return Q.resolve((O)=>J.handle(O.request,G||{}),E)}};R(G8,"Command");var W8=G8,L8=class ${constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(w)=>w,this._outputFilterSensitiveLog=(w)=>w,this._serializer=null,this._deserializer=null}init(w){this._init=w}ep(w){return this._ep=w,this}m(w){return this._middlewareFn=w,this}s(w,U,G={}){return this._smithyContext={service:w,operation:U,...G},this}c(w={}){return this._additionalContext=w,this}n(w,U){return this._clientName=w,this._commandName=U,this}f(w=(G)=>G,U=(G)=>G){return this._inputFilterSensitiveLog=w,this._outputFilterSensitiveLog=U,this}ser(w){return this._serializer=w,this}de(w){return this._deserializer=w,this}build(){var w;const U=this;let G;return G=(w=class extends W8{constructor(...[f]){super();this.serialize=U._serializer,this.deserialize=U._deserializer,this.input=f??{},U._init(this)}static getEndpointParameterInstructions(){return U._ep}resolveMiddleware(f,W,L){return this.resolveMiddlewareWithContext(f,W,L,{CommandCtor:G,middlewareFn:U._middlewareFn,clientName:U._clientName,commandName:U._commandName,inputFilterSensitiveLog:U._inputFilterSensitiveLog,outputFilterSensitiveLog:U._outputFilterSensitiveLog,smithyContext:U._smithyContext,additionalContext:U._additionalContext})}},R(w,"CommandRef"),w)}};R(L8,"ClassBuilder");var Qz=L8,Ez="***SensitiveInformation***",Rz=R(($,w)=>{for(let U of Object.keys($)){const G=$[U],f=R(async function(L,X,Z){const F=new G(L);if(typeof X==="function")this.send(F,X);else if(typeof Z==="function"){if(typeof X!=="object")throw new Error(`Expected http options but got ${typeof X}`);this.send(F,X||{},Z)}else return this.send(F,X)},"methodImpl"),W=(U[0].toLowerCase()+U.slice(1)).replace(/Command$/,"");w.prototype[W]=f}},"createAggregatedClient"),Mz=R(($)=>{switch($){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${$}"`)}},"parseBoolean"),Jz=R(($)=>{if($===null||$===void 0)return;if(typeof $==="number"){if($===0||$===1)l0.warn(j1(`Expected boolean, got ${typeof $}: ${$}`));if($===0)return!1;if($===1)return!0}if(typeof $==="string"){const w=$.toLowerCase();if(w==="false"||w==="true")l0.warn(j1(`Expected boolean, got ${typeof $}: ${$}`));if(w==="false")return!1;if(w==="true")return!0}if(typeof $==="boolean")return $;throw new TypeError(`Expected boolean, got ${typeof $}: ${$}`)},"expectBoolean"),p0=R(($)=>{if($===null||$===void 0)return;if(typeof $==="string"){const w=parseFloat($);if(!Number.isNaN(w)){if(String(w)!==String($))l0.warn(j1(`Expected number but observed string: ${$}`));return w}}if(typeof $==="number")return $;throw new TypeError(`Expected number, got ${typeof $}: ${$}`)},"expectNumber"),Kz=Math.ceil(340282346638528860000000000000000000000),q1=R(($)=>{const w=p0($);if(w!==void 0&&!Number.isNaN(w)&&w!==Infinity&&w!==(-Infinity)){if(Math.abs(w)>Kz)throw new TypeError(`Expected 32-bit float, got ${$}`)}return w},"expectFloat32"),g0=R(($)=>{if($===null||$===void 0)return;if(Number.isInteger($)&&!Number.isNaN($))return $;throw new TypeError(`Expected integer, got ${typeof $}: ${$}`)},"expectLong"),Az=g0,e$=R(($)=>fw($,32),"expectInt32"),$w=R(($)=>fw($,16),"expectShort"),ww=R(($)=>fw($,8),"expectByte"),fw=R(($,w)=>{const U=g0($);if(U!==void 0&&Oz(U,w)!==U)throw new TypeError(`Expected ${w}-bit integer, got ${$}`);return U},"expectSizedInt"),Oz=R(($,w)=>{switch(w){case 32:return Int32Array.of($)[0];case 16:return Int16Array.of($)[0];case 8:return Int8Array.of($)[0]}},"castInt"),Bz=R(($,w)=>{if($===null||$===void 0){if(w)throw new TypeError(`Expected a non-null value for ${w}`);throw new TypeError("Expected a non-null value")}return $},"expectNonNull"),X8=R(($)=>{if($===null||$===void 0)return;if(typeof $==="object"&&!Array.isArray($))return $;const w=Array.isArray($)?"array":typeof $;throw new TypeError(`Expected object, got ${w}: ${$}`)},"expectObject"),Vz=R(($)=>{if($===null||$===void 0)return;if(typeof $==="string")return $;if(["boolean","number","bigint"].includes(typeof $))return l0.warn(j1(`Expected string, got ${typeof $}: ${$}`)),String($);throw new TypeError(`Expected string, got ${typeof $}: ${$}`)},"expectString"),Tz=R(($)=>{if($===null||$===void 0)return;const w=X8($),U=Object.entries(w).filter(([,G])=>G!=null).map(([G])=>G);if(U.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(U.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${U} were not null.`);return w},"expectUnion"),Gw=R(($)=>{if(typeof $=="string")return p0(V0($));return p0($)},"strictParseDouble"),Hz=Gw,Z8=R(($)=>{if(typeof $=="string")return q1(V0($));return q1($)},"strictParseFloat32"),Cz=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,V0=R(($)=>{const w=$.match(Cz);if(w===null||w[0].length!==$.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat($)},"parseNumber"),Ww=R(($)=>{if(typeof $=="string")return F8($);return p0($)},"limitedParseDouble"),Nz=Ww,qz=Ww,jz=R(($)=>{if(typeof $=="string")return F8($);return q1($)},"limitedParseFloat32"),F8=R(($)=>{switch($){case"NaN":return NaN;case"Infinity":return Infinity;case"-Infinity":return (-Infinity);default:throw new Error(`Unable to parse float value: ${$}`)}},"parseFloatString"),Y8=R(($)=>{if(typeof $==="string")return g0(V0($));return g0($)},"strictParseLong"),Pz=Y8,Sz=R(($)=>{if(typeof $==="string")return e$(V0($));return e$($)},"strictParseInt32"),O0=R(($)=>{if(typeof $==="string")return $w(V0($));return $w($)},"strictParseShort"),I8=R(($)=>{if(typeof $==="string")return ww(V0($));return ww($)},"strictParseByte"),j1=R(($)=>{return String(new TypeError($).stack||$).split("\n").slice(0,5).filter((w)=>!w.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),l0={warn:console.warn},bz=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Lw=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];R(z8,"dateToUtcString");var hz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Dz=R(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const w=hz.exec($);if(!w)throw new TypeError("Invalid RFC-3339 date-time value");const[U,G,f,W,L,X,Z,F]=w,Y=O0(B0(G)),I=m(f,"month",1,12),Q=m(W,"day",1,31);return d0(Y,I,Q,{hours:L,minutes:X,seconds:Z,fractionalMilliseconds:F})},"parseRfc3339DateTime"),kz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),cz=R(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const w=kz.exec($);if(!w)throw new TypeError("Invalid RFC-3339 date-time value");const[U,G,f,W,L,X,Z,F,Y]=w,I=O0(B0(G)),Q=m(f,"month",1,12),z=m(W,"day",1,31),E=d0(I,Q,z,{hours:L,minutes:X,seconds:Z,fractionalMilliseconds:F});if(Y.toUpperCase()!="Z")E.setTime(E.getTime()-iz(Y));return E},"parseRfc3339DateTimeWithOffset"),vz=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$/),yz=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$/),xz=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})$/),uz=R(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let w=vz.exec($);if(w){const[U,G,f,W,L,X,Z,F]=w;return d0(O0(B0(W)),a$(f),m(G,"day",1,31),{hours:L,minutes:X,seconds:Z,fractionalMilliseconds:F})}if(w=yz.exec($),w){const[U,G,f,W,L,X,Z,F]=w;return gz(d0(dz(W),a$(f),m(G,"day",1,31),{hours:L,minutes:X,seconds:Z,fractionalMilliseconds:F}))}if(w=xz.exec($),w){const[U,G,f,W,L,X,Z,F]=w;return d0(O0(B0(F)),a$(G),m(f.trimLeft(),"day",1,31),{hours:W,minutes:L,seconds:X,fractionalMilliseconds:Z})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),_z=R(($)=>{if($===null||$===void 0)return;let w;if(typeof $==="number")w=$;else if(typeof $==="string")w=Gw($);else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(w)||w===Infinity||w===(-Infinity))throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(w*1000))},"parseEpochTimestamp"),d0=R(($,w,U,G)=>{const f=w-1;return nz($,f,U),new Date(Date.UTC($,f,U,m(G.hours,"hour",0,23),m(G.minutes,"minute",0,59),m(G.seconds,"seconds",0,60),mz(G.fractionalMilliseconds)))},"buildDate"),dz=R(($)=>{const w=(new Date()).getUTCFullYear(),U=Math.floor(w/100)*100+O0(B0($));if(U<w)return U+100;return U},"parseTwoDigitYear"),pz=1576800000000,gz=R(($)=>{if($.getTime()-(new Date()).getTime()>pz)return new Date(Date.UTC($.getUTCFullYear()-100,$.getUTCMonth(),$.getUTCDate(),$.getUTCHours(),$.getUTCMinutes(),$.getUTCSeconds(),$.getUTCMilliseconds()));return $},"adjustRfc850Year"),a$=R(($)=>{const w=Lw.indexOf($);if(w<0)throw new TypeError(`Invalid month: ${$}`);return w+1},"parseMonthByShortName"),lz=[31,28,31,30,31,30,31,31,30,31,30,31],nz=R(($,w,U)=>{let G=lz[w];if(w===1&&sz($))G=29;if(U>G)throw new TypeError(`Invalid day for ${Lw[w]} in ${$}: ${U}`)},"validateDayOfMonth"),sz=R(($)=>{return $%4===0&&($%100!==0||$%400===0)},"isLeapYear"),m=R(($,w,U,G)=>{const f=I8(B0($));if(f<U||f>G)throw new TypeError(`${w} must be between ${U} and ${G}, inclusive`);return f},"parseDateValue"),mz=R(($)=>{if($===null||$===void 0)return 0;return Z8("0."+$)*1000},"parseMilliseconds"),iz=R(($)=>{const w=$[0];let U=1;if(w=="+")U=1;else if(w=="-")U=-1;else throw new TypeError(`Offset direction, ${w}, must be "+" or "-"`);const G=Number($.substring(1,3)),f=Number($.substring(4,6));return U*(G*60+f)*60*1000},"parseOffsetToMilliseconds"),B0=R(($)=>{let w=0;while(w<$.length-1&&$.charAt(w)==="0")w++;if(w===0)return $;return $.slice(w)},"stripLeadingZeroes"),Q8=class $ extends Error{constructor(w){super(w.message);Object.setPrototypeOf(this,$.prototype),this.name=w.name,this.$fault=w.$fault,this.$metadata=w.$metadata}};R(Q8,"ServiceException");var rz=Q8,E8=R(($,w={})=>{Object.entries(w).filter(([,G])=>G!==void 0).forEach(([G,f])=>{if($[G]==null||$[G]==="")$[G]=f});const U=$.message||$.Message||"UnknownError";return $.message=U,delete $.Message,$},"decorateServiceException"),R8=R(({output:$,parsedBody:w,exceptionCtor:U,errorCode:G})=>{const f=az($),W=f.httpStatusCode?f.httpStatusCode+"":void 0,L=new U({name:(w==null?void 0:w.code)||(w==null?void 0:w.Code)||G||W||"UnknownError",$fault:"client",$metadata:f});throw E8(L,w)},"throwDefaultError"),oz=R(($)=>{return({output:w,parsedBody:U,errorCode:G})=>{R8({output:w,parsedBody:U,exceptionCtor:$,errorCode:G})}},"withBaseException"),az=R(($)=>({httpStatusCode:$.statusCode,requestId:$.headers["x-amzn-requestid"]??$.headers["x-amzn-request-id"]??$.headers["x-amz-request-id"],extendedRequestId:$.headers["x-amz-id-2"],cfId:$.headers["x-amz-cf-id"]}),"deserializeMetadata"),tz=R(($)=>{switch($){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:30000};default:return{}}},"loadConfigsForDefaultMode"),eW=!1,ez=R(($)=>{if($&&!eW&&parseInt($.substring(1,$.indexOf(".")))<16)eW=!0},"emitWarningIfUnsupportedVersion"),$5=R(($)=>{const w=[];for(let U in t$.AlgorithmId){const G=t$.AlgorithmId[U];if($[G]===void 0)continue;w.push({algorithmId:()=>G,checksumConstructor:()=>$[G]})}return{_checksumAlgorithms:w,addChecksumAlgorithm(U){this._checksumAlgorithms.push(U)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),w5=R(($)=>{const w={};return $.checksumAlgorithms().forEach((U)=>{w[U.algorithmId()]=U.checksumConstructor()}),w},"resolveChecksumRuntimeConfig"),U5=R(($)=>{let w=$.retryStrategy;return{setRetryStrategy(U){w=U},retryStrategy(){return w}}},"getRetryConfiguration"),f5=R(($)=>{const w={};return w.retryStrategy=$.retryStrategy(),w},"resolveRetryRuntimeConfig"),M8=R(($)=>{return{...$5($),...U5($)}},"getDefaultExtensionConfiguration"),G5=M8,W5=R(($)=>{return{...w5($),...f5($)}},"resolveDefaultRuntimeConfig");R(P1,"extendedEncodeURIComponent");var L5=R(($)=>Array.isArray($)?$:[$],"getArrayIfSingleItem"),J8=R(($)=>{for(let U in $)if($.hasOwnProperty(U)&&$[U]["#text"]!==void 0)$[U]=$[U]["#text"];else if(typeof $[U]==="object"&&$[U]!==null)$[U]=J8($[U]);return $},"getValueFromTextNode"),n0=R(function(){const $=Object.getPrototypeOf(this).constructor,U=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(U,$.prototype),U},"StringWrapper");n0.prototype=Object.create(String.prototype,{constructor:{value:n0,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(n0,String);var K8=class $ extends n0{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject(w){if(w instanceof $)return w;else if(w instanceof String||typeof w==="string")return new $(w);return new $(JSON.stringify(w))}};R(K8,"LazyJsonString");var X5=K8;R(Xw,"map");var Z5=R(($)=>{const w={};for(let[U,G]of Object.entries($||{}))w[U]=[,G];return w},"convertMap"),F5=R(($,w)=>{const U={};for(let G in w)A8(U,$,w,G);return U},"take"),Y5=R(($,w,U)=>{return Xw($,Object.entries(U).reduce((G,[f,W])=>{if(Array.isArray(W))G[f]=W;else if(typeof W==="function")G[f]=[w,W()];else G[f]=[w,W];return G},{}))},"mapWithFilter"),A8=R(($,w,U,G)=>{if(w!==null){let L=U[G];if(typeof L==="function")L=[,L];const[X=I5,Z=z5,F=G]=L;if(typeof X==="function"&&X(w[F])||typeof X!=="function"&&!!X)$[G]=Z(w[F]);return}let[f,W]=U[G];if(typeof W==="function"){let L;const X=f===void 0&&(L=W())!=null,Z=typeof f==="function"&&!!f(void 0)||typeof f!=="function"&&!!f;if(X)$[G]=L;else if(Z)$[G]=W()}else{const L=f===void 0&&W!=null,X=typeof f==="function"&&!!f(W)||typeof f!=="function"&&!!f;if(L||X)$[G]=W}},"applyInstruction"),I5=R(($)=>$!=null,"nonNullish"),z5=R(($)=>$,"pass"),Q5=R(($,w,U,G,f,W)=>{if(w!=null&&w[U]!==void 0){const L=G();if(L.length<=0)throw new Error("Empty value provided for input HTTP label: "+U+".");$=$.replace(f,W?L.split("/").map((X)=>P1(X)).join("/"):P1(L))}else throw new Error("No value provided for input HTTP label: "+U+".");return $},"resolvedPath"),E5=R(($)=>{if($!==$)return"NaN";switch($){case Infinity:return"Infinity";case (-Infinity):return"-Infinity";default:return $}},"serializeFloat"),R5=R(($)=>$.toISOString().replace(".000Z","Z"),"serializeDateTime"),Uw=R(($)=>{if($==null)return{};if(Array.isArray($))return $.filter((w)=>w!=null).map(Uw);if(typeof $==="object"){const w={};for(let U of Object.keys($)){if($[U]==null)continue;w[U]=Uw($[U])}return w}return $},"_json");R(O8,"splitEvery")});var H8=M((V8)=>{Object.defineProperty(V8,"__esModule",{value:!0});V8.isStreamingPayload=void 0;var M5=import.meta.require("stream"),J5=($)=>($===null||$===void 0?void 0:$.body)instanceof M5.Readable||typeof ReadableStream!=="undefined"&&($===null||$===void 0?void 0:$.body)instanceof ReadableStream;V8.isStreamingPayload=J5});var p8=M((UM,d8)=>{var{defineProperty:b1,getOwnPropertyDescriptor:K5,getOwnPropertyNames:A5}=Object,O5=Object.prototype.hasOwnProperty,P=($,w)=>b1($,"name",{value:w,configurable:!0}),B5=($,w)=>{for(var U in w)b1($,U,{get:w[U],enumerable:!0})},V5=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of A5(w))if(!O5.call($,f)&&f!==U)b1($,f,{get:()=>w[f],enumerable:!(G=K5(w,f))||G.enumerable})}return $},T5=($)=>V5(b1({},"__esModule",{value:!0}),$),N8={};B5(N8,{AdaptiveRetryStrategy:()=>N5,CONFIG_MAX_ATTEMPTS:()=>Fw,CONFIG_RETRY_MODE:()=>c8,ENV_MAX_ATTEMPTS:()=>Zw,ENV_RETRY_MODE:()=>k8,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>q5,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>P5,StandardRetryStrategy:()=>h8,defaultDelayDecider:()=>j8,defaultRetryDecider:()=>P8,getOmitRetryHeadersPlugin:()=>S5,getRetryAfterHint:()=>_8,getRetryPlugin:()=>v5,omitRetryHeadersMiddleware:()=>v8,omitRetryHeadersMiddlewareOptions:()=>y8,resolveRetryConfig:()=>j5,retryMiddleware:()=>x8,retryMiddlewareOptions:()=>u8});d8.exports=T5(N8);var H0=r(),q8=P$(),C=BG(),H5=P(($,w)=>{const U=$,G=(w==null?void 0:w.noRetryIncrement)??C.NO_RETRY_INCREMENT,f=(w==null?void 0:w.retryCost)??C.RETRY_COST,W=(w==null?void 0:w.timeoutRetryCost)??C.TIMEOUT_RETRY_COST;let L=$;const X=P((I)=>I.name==="TimeoutError"?W:f,"getCapacityAmount"),Z=P((I)=>X(I)<=L,"hasRetryTokens");return Object.freeze({hasRetryTokens:Z,retrieveRetryTokens:P((I)=>{if(!Z(I))throw new Error("No retry token available");const Q=X(I);return L-=Q,Q},"retrieveRetryTokens"),releaseRetryTokens:P((I)=>{L+=I??G,L=Math.min(L,U)},"releaseRetryTokens")})},"getDefaultRetryQuota"),j8=P(($,w)=>Math.floor(Math.min(C.MAXIMUM_RETRY_DELAY,Math.random()*2**w*$)),"defaultDelayDecider"),w0=Z0(),P8=P(($)=>{if(!$)return!1;return w0.isRetryableByTrait($)||w0.isClockSkewError($)||w0.isThrottlingError($)||w0.isTransientError($)},"defaultRetryDecider"),S8=P(($)=>{if($ instanceof Error)return $;if($ instanceof Object)return Object.assign(new Error,$);if(typeof $==="string")return new Error($);return new Error(`AWS SDK error wrapper for ${$}`)},"asSdkError"),b8=class ${constructor(w,U){this.maxAttemptsProvider=w,this.mode=C.RETRY_MODES.STANDARD,this.retryDecider=(U==null?void 0:U.retryDecider)??P8,this.delayDecider=(U==null?void 0:U.delayDecider)??j8,this.retryQuota=(U==null?void 0:U.retryQuota)??H5(C.INITIAL_RETRY_TOKENS)}shouldRetry(w,U,G){return U<G&&this.retryDecider(w)&&this.retryQuota.hasRetryTokens(w)}async getMaxAttempts(){let w;try{w=await this.maxAttemptsProvider()}catch(U){w=C.DEFAULT_MAX_ATTEMPTS}return w}async retry(w,U,G){let f,W=0,L=0;const X=await this.getMaxAttempts(),{request:Z}=U;if(H0.HttpRequest.isInstance(Z))Z.headers[C.INVOCATION_ID_HEADER]=q8.v4();while(!0)try{if(H0.HttpRequest.isInstance(Z))Z.headers[C.REQUEST_HEADER]=`attempt=${W+1}; max=${X}`;if(G==null?void 0:G.beforeRequest)await G.beforeRequest();const{response:F,output:Y}=await w(U);if(G==null?void 0:G.afterRequest)G.afterRequest(F);return this.retryQuota.releaseRetryTokens(f),Y.$metadata.attempts=W+1,Y.$metadata.totalRetryDelay=L,{response:F,output:Y}}catch(F){const Y=S8(F);if(W++,this.shouldRetry(Y,W,X)){f=this.retryQuota.retrieveRetryTokens(Y);const I=this.delayDecider(w0.isThrottlingError(Y)?C.THROTTLING_RETRY_DELAY_BASE:C.DEFAULT_RETRY_DELAY_BASE,W),Q=C5(Y.$response),z=Math.max(Q||0,I);L+=z,await new Promise((E)=>setTimeout(E,z));continue}if(!Y.$metadata)Y.$metadata={};throw Y.$metadata.attempts=W,Y.$metadata.totalRetryDelay=L,Y}}};P(b8,"StandardRetryStrategy");var h8=b8,C5=P(($)=>{if(!H0.HttpResponse.isInstance($))return;const w=Object.keys($.headers).find((W)=>W.toLowerCase()==="retry-after");if(!w)return;const U=$.headers[w],G=Number(U);if(!Number.isNaN(G))return G*1000;return new Date(U).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),D8=class $ extends h8{constructor(w,U){const{rateLimiter:G,...f}=U??{};super(w,f);this.rateLimiter=G??new C.DefaultRateLimiter,this.mode=C.RETRY_MODES.ADAPTIVE}async retry(w,U){return super.retry(w,U,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(G)=>{this.rateLimiter.updateClientSendingRate(G)}})}};P(D8,"AdaptiveRetryStrategy");var N5=D8,C8=s(),Zw="AWS_MAX_ATTEMPTS",Fw="max_attempts",q5={environmentVariableSelector:($)=>{const w=$[Zw];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Environment variable ${Zw} mast be a number, got "${w}"`);return U},configFileSelector:($)=>{const w=$[Fw];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Shared config file entry ${Fw} mast be a number, got "${w}"`);return U},default:C.DEFAULT_MAX_ATTEMPTS},j5=P(($)=>{const{retryStrategy:w}=$,U=C8.normalizeProvider($.maxAttempts??C.DEFAULT_MAX_ATTEMPTS);return{...$,maxAttempts:U,retryStrategy:async()=>{if(w)return w;if(await C8.normalizeProvider($.retryMode)()===C.RETRY_MODES.ADAPTIVE)return new C.AdaptiveRetryStrategy(U);return new C.StandardRetryStrategy(U)}}},"resolveRetryConfig"),k8="AWS_RETRY_MODE",c8="retry_mode",P5={environmentVariableSelector:($)=>$[k8],configFileSelector:($)=>$[c8],default:C.DEFAULT_RETRY_MODE},v8=P(()=>($)=>async(w)=>{const{request:U}=w;if(H0.HttpRequest.isInstance(U))delete U.headers[C.INVOCATION_ID_HEADER],delete U.headers[C.REQUEST_HEADER];return $(w)},"omitRetryHeadersMiddleware"),y8={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},S5=P(($)=>({applyToStack:(w)=>{w.addRelativeTo(v8(),y8)}}),"getOmitRetryHeadersPlugin"),b5=T0(),h5=H8(),x8=P(($)=>(w,U)=>async(G)=>{var f;let W=await $.retryStrategy();const L=await $.maxAttempts();if(D5(W)){W=W;let X=await W.acquireInitialRetryToken(U.partition_id),Z=new Error,F=0,Y=0;const{request:I}=G,Q=H0.HttpRequest.isInstance(I);if(Q)I.headers[C.INVOCATION_ID_HEADER]=q8.v4();while(!0)try{if(Q)I.headers[C.REQUEST_HEADER]=`attempt=${F+1}; max=${L}`;const{response:z,output:E}=await w(G);return W.recordSuccess(X),E.$metadata.attempts=F+1,E.$metadata.totalRetryDelay=Y,{response:z,output:E}}catch(z){const E=k5(z);if(Z=S8(z),Q&&h5.isStreamingPayload(I))throw(f=U.logger instanceof b5.NoOpLogger?console:U.logger)==null||f.warn("An error was encountered in a non-retryable streaming request."),Z;try{X=await W.refreshRetryTokenForRetry(X,E)}catch(O){if(!Z.$metadata)Z.$metadata={};throw Z.$metadata.attempts=F+1,Z.$metadata.totalRetryDelay=Y,Z}F=X.getRetryCount();const J=X.getRetryDelay();Y+=J,await new Promise((O)=>setTimeout(O,J))}}else{if(W=W,W==null?void 0:W.mode)U.userAgent=[...U.userAgent||[],["cfg/retry-mode",W.mode]];return W.retry(w,G)}},"retryMiddleware"),D5=P(($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined","isRetryStrategyV2"),k5=P(($)=>{const w={error:$,errorType:c5($)},U=_8($.$response);if(U)w.retryAfterHint=U;return w},"getRetryErrorInfo"),c5=P(($)=>{if(w0.isThrottlingError($))return"THROTTLING";if(w0.isTransientError($))return"TRANSIENT";if(w0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),u8={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},v5=P(($)=>({applyToStack:(w)=>{w.add(x8($),u8)}}),"getRetryPlugin"),_8=P(($)=>{if(!H0.HttpResponse.isInstance($))return;const w=Object.keys($.headers).find((W)=>W.toLowerCase()==="retry-after");if(!w)return;const U=$.headers[w],G=Number(U);if(!Number.isNaN(G))return new Date(G*1000);return new Date(U)},"getRetryAfterHint")});var Iw=M((fM,X4)=>{var n8=function($){const w=new Map;for(let U of $)w.set(U.schemeId,U);return w},f4=function($,w){return new W4($,w)},L4=function($,w,U,G,f){return H(async function*W(L,X,...Z){let F=L.startingToken||void 0,Y=!0,I;while(Y){if(X[U]=F,f)X[f]=X[f]??L.pageSize;if(L.client instanceof $)I=await LQ(w,L.client,X,...Z);else throw new Error(`Invalid client, expected instance of ${$.name}`);yield I;const Q=F;F=XQ(I,G),Y=!!(F&&(!L.stopOnSameToken||F!==Q))}return},"paginateOperation")},D1=Object.defineProperty,y5=Object.getOwnPropertyDescriptor,x5=Object.getOwnPropertyNames,u5=Object.prototype.hasOwnProperty,H=($,w)=>D1($,"name",{value:w,configurable:!0}),_5=($,w)=>{for(var U in w)D1($,U,{get:w[U],enumerable:!0})},d5=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of x5(w))if(!u5.call($,f)&&f!==U)D1($,f,{get:()=>w[f],enumerable:!(G=y5(w,f))||G.enumerable})}return $},p5=($)=>d5(D1({},"__esModule",{value:!0}),$),g8={};_5(g8,{DefaultIdentityProviderConfig:()=>a5,EXPIRATION_MS:()=>w4,HttpApiKeyAuthSigner:()=>t5,HttpBearerAuthSigner:()=>e5,NoAuthSigner:()=>$Q,RequestBuilder:()=>W4,createIsIdentityExpiredFunction:()=>$4,createPaginator:()=>L4,doesIdentityRequireRefresh:()=>U4,getHttpAuthSchemeEndpointRuleSetPlugin:()=>l5,getHttpAuthSchemePlugin:()=>s5,getHttpSigningPlugin:()=>o5,getSmithyContext:()=>fQ,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>s8,httpAuthSchemeMiddleware:()=>Yw,httpAuthSchemeMiddlewareOptions:()=>m8,httpSigningMiddleware:()=>i8,httpSigningMiddlewareOptions:()=>r8,isIdentityExpired:()=>wQ,memoizeIdentityProvider:()=>UQ,normalizeProvider:()=>GQ,requestBuilder:()=>f4});X4.exports=p5(g8);var l8=s();H(n8,"convertHttpAuthSchemesToMap");var Yw=H(($,w)=>(U,G)=>async(f)=>{var W;const L=$.httpAuthSchemeProvider(await w.httpAuthSchemeParametersProvider($,G,f.input)),X=n8($.httpAuthSchemes),Z=l8.getSmithyContext(G),F=[];for(let Y of L){const I=X.get(Y.schemeId);if(!I){F.push(`HttpAuthScheme \`${Y.schemeId}\` was not enabled for this service.`);continue}const Q=I.identityProvider(await w.identityProviderConfigProvider($));if(!Q){F.push(`HttpAuthScheme \`${Y.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:z={},signingProperties:E={}}=((W=Y.propertiesExtractor)==null?void 0:W.call(Y,$,G))||{};Y.identityProperties=Object.assign(Y.identityProperties||{},z),Y.signingProperties=Object.assign(Y.signingProperties||{},E),Z.selectedHttpAuthScheme={httpAuthOption:Y,identity:await Q(Y.identityProperties),signer:I.signer};break}if(!Z.selectedHttpAuthScheme)throw new Error(F.join("\n"));return U(f)},"httpAuthSchemeMiddleware"),g5=$f(),s8={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:g5.endpointMiddlewareOptions.name},l5=H(($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U})=>({applyToStack:(G)=>{G.addRelativeTo(Yw($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U}),s8)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),n5=B$(),m8={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:n5.serializerMiddlewareOption.name},s5=H(($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U})=>({applyToStack:(G)=>{G.addRelativeTo(Yw($,{httpAuthSchemeParametersProvider:w,identityProviderConfigProvider:U}),m8)}}),"getHttpAuthSchemePlugin"),k1=r(),m5=H(($)=>(w)=>{throw w},"defaultErrorHandler"),i5=H(($,w)=>{},"defaultSuccessHandler"),i8=H(($)=>(w,U)=>async(G)=>{if(!k1.HttpRequest.isInstance(G.request))return w(G);const W=l8.getSmithyContext(U).selectedHttpAuthScheme;if(!W)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:L={}},identity:X,signer:Z}=W,F=await w({...G,request:await Z.sign(G.request,X,L)}).catch((Z.errorHandler||m5)(L));return(Z.successHandler||i5)(F.response,L),F},"httpSigningMiddleware"),r5=p8(),r8={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:r5.retryMiddlewareOptions.name},o5=H(($)=>({applyToStack:(w)=>{w.addRelativeTo(i8($),r8)}}),"getHttpSigningPlugin"),o8=class ${constructor(w){this.authSchemes=new Map;for(let[U,G]of Object.entries(w))if(G!==void 0)this.authSchemes.set(U,G)}getIdentityProvider(w){return this.authSchemes.get(w)}};H(o8,"DefaultIdentityProviderConfig");var a5=o8,h1=M0(),a8=class ${async sign(w,U,G){if(!G)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!G.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!G.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!U.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const f=k1.HttpRequest.clone(w);if(G.in===h1.HttpApiKeyAuthLocation.QUERY)f.query[G.name]=U.apiKey;else if(G.in===h1.HttpApiKeyAuthLocation.HEADER)f.headers[G.name]=G.scheme?`${G.scheme} ${U.apiKey}`:U.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+G.in+"`");return f}};H(a8,"HttpApiKeyAuthSigner");var t5=a8,t8=class ${async sign(w,U,G){const f=k1.HttpRequest.clone(w);if(!U.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return f.headers.Authorization=`Bearer ${U.token}`,f}};H(t8,"HttpBearerAuthSigner");var e5=t8,e8=class ${async sign(w,U,G){return w}};H(e8,"NoAuthSigner");var $Q=e8,$4=H(($)=>(w)=>U4(w)&&w.expiration.getTime()-Date.now()<$,"createIsIdentityExpiredFunction"),w4=300000,wQ=$4(w4),U4=H(($)=>$.expiration!==void 0,"doesIdentityRequireRefresh"),UQ=H(($,w,U)=>{if($===void 0)return;const G=typeof $!=="function"?async()=>Promise.resolve($):$;let f,W,L,X=!1;const Z=H(async(F)=>{if(!W)W=G(F);try{f=await W,L=!0,X=!1}finally{W=void 0}return f},"coalesceProvider");if(w===void 0)return async(F)=>{if(!L||(F==null?void 0:F.forceRefresh))f=await Z(F);return f};return async(F)=>{if(!L||(F==null?void 0:F.forceRefresh))f=await Z(F);if(X)return f;if(!U(f))return X=!0,f;if(w(f))return await Z(F),f;return f}},"memoizeIdentityProvider"),fQ=H(($)=>$[h1.SMITHY_CONTEXT_KEY]||($[h1.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),GQ=H(($)=>{if(typeof $==="function")return $;const w=Promise.resolve($);return()=>w},"normalizeProvider"),WQ=T0();H(f4,"requestBuilder");var G4=class ${constructor(w,U){this.input=w,this.context=U,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:w,protocol:U="https",port:G,path:f}=await this.context.endpoint();this.path=f;for(let W of this.resolvePathStack)W(this.path);return new k1.HttpRequest({protocol:U,hostname:this.hostname||w,port:G,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(w){return this.hostname=w,this}bp(w){return this.resolvePathStack.push((U)=>{this.path=`${(U==null?void 0:U.endsWith("/"))?U.slice(0,-1):U||""}`+w}),this}p(w,U,G,f){return this.resolvePathStack.push((W)=>{this.path=WQ.resolvedPath(W,this.input,w,U,G,f)}),this}h(w){return this.headers=w,this}q(w){return this.query=w,this}b(w){return this.body=w,this}m(w){return this.method=w,this}};H(G4,"RequestBuilder");var W4=G4,LQ=H(async($,w,U,...G)=>{return await w.send(new $(U),...G)},"makePagedClientRequest");H(L4,"createPaginator");var XQ=H(($,w)=>{let U=$;const G=w.split(".");for(let f of G){if(!U||typeof U!=="object")return;U=U[f]}return U},"get")});var HL=M((IB,e1)=>{var a4,t4,e4,$L,wL,UL,fL,GL,WL,LL,XL,ZL,FL,a1,hw,YL,IL,zL,P0,QL,EL,RL,ML,JL,KL,AL,OL,BL,t1,VL,TL;(function($){var w=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(G){$(U(w,U(G)))});else if(typeof e1==="object"&&typeof IB==="object")$(U(w,U(IB)));else $(U(w));function U(G,f){if(G!==w)if(typeof Object.create==="function")Object.defineProperty(G,"__esModule",{value:!0});else G.__esModule=!0;return function(W,L){return G[W]=f?f(W,L):L}}})(function($){var w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,W){f.__proto__=W}||function(f,W){for(var L in W)if(Object.prototype.hasOwnProperty.call(W,L))f[L]=W[L]};a4=function(f,W){if(typeof W!=="function"&&W!==null)throw new TypeError("Class extends value "+String(W)+" is not a constructor or null");w(f,W);function L(){this.constructor=f}f.prototype=W===null?Object.create(W):(L.prototype=W.prototype,new L)},t4=Object.assign||function(f){for(var W,L=1,X=arguments.length;L<X;L++){W=arguments[L];for(var Z in W)if(Object.prototype.hasOwnProperty.call(W,Z))f[Z]=W[Z]}return f},e4=function(f,W){var L={};for(var X in f)if(Object.prototype.hasOwnProperty.call(f,X)&&W.indexOf(X)<0)L[X]=f[X];if(f!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var Z=0,X=Object.getOwnPropertySymbols(f);Z<X.length;Z++)if(W.indexOf(X[Z])<0&&Object.prototype.propertyIsEnumerable.call(f,X[Z]))L[X[Z]]=f[X[Z]]}return L},$L=function(f,W,L,X){var Z=arguments.length,F=Z<3?W:X===null?X=Object.getOwnPropertyDescriptor(W,L):X,Y;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")F=Reflect.decorate(f,W,L,X);else for(var I=f.length-1;I>=0;I--)if(Y=f[I])F=(Z<3?Y(F):Z>3?Y(W,L,F):Y(W,L))||F;return Z>3&&F&&Object.defineProperty(W,L,F),F},wL=function(f,W){return function(L,X){W(L,X,f)}},UL=function(f,W,L,X,Z,F){function Y(S){if(S!==void 0&&typeof S!=="function")throw new TypeError("Function expected");return S}var I=X.kind,Q=I==="getter"?"get":I==="setter"?"set":"value",z=!W&&f?X.static?f:f.prototype:null,E=W||(z?Object.getOwnPropertyDescriptor(z,X.name):{}),J,O=!1;for(var K=L.length-1;K>=0;K--){var A={};for(var B in X)A[B]=B==="access"?{}:X[B];for(var B in X.access)A.access[B]=X.access[B];A.addInitializer=function(S){if(O)throw new TypeError("Cannot add initializers after decoration has completed");F.push(Y(S||null))};var T=L[K](I==="accessor"?{get:E.get,set:E.set}:E[Q],A);if(I==="accessor"){if(T===void 0)continue;if(T===null||typeof T!=="object")throw new TypeError("Object expected");if(J=Y(T.get))E.get=J;if(J=Y(T.set))E.set=J;if(J=Y(T.init))Z.unshift(J)}else if(J=Y(T))if(I==="field")Z.unshift(J);else E[Q]=J}if(z)Object.defineProperty(z,X.name,E);O=!0},fL=function(f,W,L){var X=arguments.length>2;for(var Z=0;Z<W.length;Z++)L=X?W[Z].call(f,L):W[Z].call(f);return X?L:void 0},GL=function(f){return typeof f==="symbol"?f:"".concat(f)},WL=function(f,W,L){if(typeof W==="symbol")W=W.description?"[".concat(W.description,"]"):"";return Object.defineProperty(f,"name",{configurable:!0,value:L?"".concat(L," ",W):W})},LL=function(f,W){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata(f,W)},XL=function(f,W,L,X){function Z(F){return F instanceof L?F:new L(function(Y){Y(F)})}return new(L||(L=Promise))(function(F,Y){function I(E){try{z(X.next(E))}catch(J){Y(J)}}function Q(E){try{z(X.throw(E))}catch(J){Y(J)}}function z(E){E.done?F(E.value):Z(E.value).then(I,Q)}z((X=X.apply(f,W||[])).next())})},ZL=function(f,W){var L={label:0,sent:function(){if(F[0]&1)throw F[1];return F[1]},trys:[],ops:[]},X,Z,F,Y;return Y={next:I(0),throw:I(1),return:I(2)},typeof Symbol==="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function I(z){return function(E){return Q([z,E])}}function Q(z){if(X)throw new TypeError("Generator is already executing.");while(Y&&(Y=0,z[0]&&(L=0)),L)try{if(X=1,Z&&(F=z[0]&2?Z.return:z[0]?Z.throw||((F=Z.return)&&F.call(Z),0):Z.next)&&!(F=F.call(Z,z[1])).done)return F;if(Z=0,F)z=[z[0]&2,F.value];switch(z[0]){case 0:case 1:F=z;break;case 4:return L.label++,{value:z[1],done:!1};case 5:L.label++,Z=z[1],z=[0];continue;case 7:z=L.ops.pop(),L.trys.pop();continue;default:if((F=L.trys,!(F=F.length>0&&F[F.length-1]))&&(z[0]===6||z[0]===2)){L=0;continue}if(z[0]===3&&(!F||z[1]>F[0]&&z[1]<F[3])){L.label=z[1];break}if(z[0]===6&&L.label<F[1]){L.label=F[1],F=z;break}if(F&&L.label<F[2]){L.label=F[2],L.ops.push(z);break}if(F[2])L.ops.pop();L.trys.pop();continue}z=W.call(f,L)}catch(E){z=[6,E],Z=0}finally{X=F=0}if(z[0]&5)throw z[1];return{value:z[0]?z[1]:void 0,done:!0}}},FL=function(f,W){for(var L in f)if(L!=="default"&&!Object.prototype.hasOwnProperty.call(W,L))t1(W,f,L)},t1=Object.create?function(f,W,L,X){if(X===void 0)X=L;var Z=Object.getOwnPropertyDescriptor(W,L);if(!Z||("get"in Z?!W.__esModule:Z.writable||Z.configurable))Z={enumerable:!0,get:function(){return W[L]}};Object.defineProperty(f,X,Z)}:function(f,W,L,X){if(X===void 0)X=L;f[X]=W[L]},a1=function(f){var W=typeof Symbol==="function"&&Symbol.iterator,L=W&&f[W],X=0;if(L)return L.call(f);if(f&&typeof f.length==="number")return{next:function(){if(f&&X>=f.length)f=void 0;return{value:f&&f[X++],done:!f}}};throw new TypeError(W?"Object is not iterable.":"Symbol.iterator is not defined.")},hw=function(f,W){var L=typeof Symbol==="function"&&f[Symbol.iterator];if(!L)return f;var X=L.call(f),Z,F=[],Y;try{while((W===void 0||W-- >0)&&!(Z=X.next()).done)F.push(Z.value)}catch(I){Y={error:I}}finally{try{if(Z&&!Z.done&&(L=X.return))L.call(X)}finally{if(Y)throw Y.error}}return F},YL=function(){for(var f=[],W=0;W<arguments.length;W++)f=f.concat(hw(arguments[W]));return f},IL=function(){for(var f=0,W=0,L=arguments.length;W<L;W++)f+=arguments[W].length;for(var X=Array(f),Z=0,W=0;W<L;W++)for(var F=arguments[W],Y=0,I=F.length;Y<I;Y++,Z++)X[Z]=F[Y];return X},zL=function(f,W,L){if(L||arguments.length===2){for(var X=0,Z=W.length,F;X<Z;X++)if(F||!(X in W)){if(!F)F=Array.prototype.slice.call(W,0,X);F[X]=W[X]}}return f.concat(F||Array.prototype.slice.call(W))},P0=function(f){return this instanceof P0?(this.v=f,this):new P0(f)},QL=function(f,W,L){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var X=L.apply(f,W||[]),Z,F=[];return Z={},I("next"),I("throw"),I("return",Y),Z[Symbol.asyncIterator]=function(){return this},Z;function Y(K){return function(A){return Promise.resolve(A).then(K,J)}}function I(K,A){if(X[K]){if(Z[K]=function(B){return new Promise(function(T,S){F.push([K,B,T,S])>1||Q(K,B)})},A)Z[K]=A(Z[K])}}function Q(K,A){try{z(X[K](A))}catch(B){O(F[0][3],B)}}function z(K){K.value instanceof P0?Promise.resolve(K.value.v).then(E,J):O(F[0][2],K)}function E(K){Q("next",K)}function J(K){Q("throw",K)}function O(K,A){if(K(A),F.shift(),F.length)Q(F[0][0],F[0][1])}},EL=function(f){var W,L;return W={},X("next"),X("throw",function(Z){throw Z}),X("return"),W[Symbol.iterator]=function(){return this},W;function X(Z,F){W[Z]=f[Z]?function(Y){return(L=!L)?{value:P0(f[Z](Y)),done:!1}:F?F(Y):Y}:F}},RL=function(f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var W=f[Symbol.asyncIterator],L;return W?W.call(f):(f=typeof a1==="function"?a1(f):f[Symbol.iterator](),L={},X("next"),X("throw"),X("return"),L[Symbol.asyncIterator]=function(){return this},L);function X(F){L[F]=f[F]&&function(Y){return new Promise(function(I,Q){Y=f[F](Y),Z(I,Q,Y.done,Y.value)})}}function Z(F,Y,I,Q){Promise.resolve(Q).then(function(z){F({value:z,done:I})},Y)}},ML=function(f,W){if(Object.defineProperty)Object.defineProperty(f,"raw",{value:W});else f.raw=W;return f};var U=Object.create?function(f,W){Object.defineProperty(f,"default",{enumerable:!0,value:W})}:function(f,W){f.default=W};JL=function(f){if(f&&f.__esModule)return f;var W={};if(f!=null){for(var L in f)if(L!=="default"&&Object.prototype.hasOwnProperty.call(f,L))t1(W,f,L)}return U(W,f),W},KL=function(f){return f&&f.__esModule?f:{default:f}},AL=function(f,W,L,X){if(L==="a"&&!X)throw new TypeError("Private accessor was defined without a getter");if(typeof W==="function"?f!==W||!X:!W.has(f))throw new TypeError("Cannot read private member from an object whose class did not declare it");return L==="m"?X:L==="a"?X.call(f):X?X.value:W.get(f)},OL=function(f,W,L,X,Z){if(X==="m")throw new TypeError("Private method is not writable");if(X==="a"&&!Z)throw new TypeError("Private accessor was defined without a setter");if(typeof W==="function"?f!==W||!Z:!W.has(f))throw new TypeError("Cannot write private member to an object whose class did not declare it");return X==="a"?Z.call(f,L):Z?Z.value=L:W.set(f,L),L},BL=function(f,W){if(W===null||typeof W!=="object"&&typeof W!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof f==="function"?W===f:f.has(W)},VL=function(f,W,L){if(W!==null&&W!==void 0){if(typeof W!=="object"&&typeof W!=="function")throw new TypeError("Object expected.");var X,Z;if(L){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");X=W[Symbol.asyncDispose]}if(X===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");if(X=W[Symbol.dispose],L)Z=X}if(typeof X!=="function")throw new TypeError("Object not disposable.");if(Z)X=function(){try{Z.call(this)}catch(F){return Promise.reject(F)}};f.stack.push({value:W,dispose:X,async:L})}else if(L)f.stack.push({async:!0});return W};var G=typeof SuppressedError==="function"?SuppressedError:function(f,W,L){var X=new Error(L);return X.name="SuppressedError",X.error=f,X.suppressed=W,X};TL=function(f){function W(X){f.error=f.hasError?new G(X,f.error,"An error was suppressed during disposal."):X,f.hasError=!0}function L(){while(f.stack.length){var X=f.stack.pop();try{var Z=X.dispose&&X.dispose.call(X.value);if(X.async)return Promise.resolve(Z).then(L,function(F){return W(F),L()})}catch(F){W(F)}}if(f.hasError)throw f.error}return L()},$("__extends",a4),$("__assign",t4),$("__rest",e4),$("__decorate",$L),$("__param",wL),$("__esDecorate",UL),$("__runInitializers",fL),$("__propKey",GL),$("__setFunctionName",WL),$("__metadata",LL),$("__awaiter",XL),$("__generator",ZL),$("__exportStar",FL),$("__createBinding",t1),$("__values",a1),$("__read",hw),$("__spread",YL),$("__spreadArrays",IL),$("__spreadArray",zL),$("__await",P0),$("__asyncGenerator",QL),$("__asyncDelegator",EL),$("__asyncValues",RL),$("__makeTemplateObject",ML),$("__importStar",JL),$("__importDefault",KL),$("__classPrivateFieldGet",AL),$("__classPrivateFieldSet",OL),$("__classPrivateFieldIn",BL),$("__addDisposableResource",VL),$("__disposeResources",TL)})});var jL=M((zB,qL)=>{var{defineProperty:$$,getOwnPropertyDescriptor:gQ,getOwnPropertyNames:lQ}=Object,nQ=Object.prototype.hasOwnProperty,sQ=($,w)=>$$($,"name",{value:w,configurable:!0}),mQ=($,w)=>{for(var U in w)$$($,U,{get:w[U],enumerable:!0})},iQ=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of lQ(w))if(!nQ.call($,f)&&f!==U)$$($,f,{get:()=>w[f],enumerable:!(G=gQ(w,f))||G.enumerable})}return $},rQ=($)=>iQ($$({},"__esModule",{value:!0}),$),NL={};mQ(NL,{emitWarningIfUnsupportedVersion:()=>oQ});qL.exports=rQ(NL);var CL=!1,oQ=sQ(($)=>{if($&&!CL&&parseInt($.substring(1,$.indexOf(".")))<18)CL=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
4
+ no longer support Node.js 16.x on January 6, 2025.
5
+
6
+ To continue receiving updates to AWS services, bug fixes, and security
7
+ updates please upgrade to a supported Node.js LTS version.
8
+
9
+ More information can be found at: https://a.co/74kJMmI`)},"emitWarningIfUnsupportedVersion")});var iL=M((QB,mL)=>{var yw=function($){for(let w=0;w<8;w++)$[w]^=255;for(let w=7;w>-1;w--)if($[w]++,$[w]!==0)break},W$=Object.defineProperty,aQ=Object.getOwnPropertyDescriptor,tQ=Object.getOwnPropertyNames,eQ=Object.prototype.hasOwnProperty,b=($,w)=>W$($,"name",{value:w,configurable:!0}),$9=($,w)=>{for(var U in w)W$($,U,{get:w[U],enumerable:!0})},w9=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of tQ(w))if(!eQ.call($,f)&&f!==U)W$($,f,{get:()=>w[f],enumerable:!(G=aQ(w,f))||G.enumerable})}return $},U9=($)=>w9(W$({},"__esModule",{value:!0}),$),DL={};$9(DL,{SignatureV4:()=>j9,clearCredentialCache:()=>A9,createScope:()=>f$,getCanonicalHeaders:()=>vw,getCanonicalQuery:()=>dL,getPayloadHash:()=>G$,getSigningKey:()=>_L,moveHeadersToQuery:()=>nL,prepareRequest:()=>xw});mL.exports=U9(DL);var PL=s(),Dw=$0(),f9="X-Amz-Algorithm",G9="X-Amz-Credential",kL="X-Amz-Date",W9="X-Amz-SignedHeaders",L9="X-Amz-Expires",cL="X-Amz-Signature",vL="X-Amz-Security-Token",yL="authorization",xL=kL.toLowerCase(),X9="date",Z9=[yL,xL,X9],F9=cL.toLowerCase(),cw="x-amz-content-sha256",Y9=vL.toLowerCase(),I9={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},z9=/^proxy-/,Q9=/^sec-/,kw="AWS4-HMAC-SHA256",E9="AWS4-HMAC-SHA256-PAYLOAD",R9="UNSIGNED-PAYLOAD",M9=50,uL="aws4_request",J9=604800,G0=CW(),K9=$0(),S0={},U$=[],f$=b(($,w,U)=>`${$}/${w}/${U}/${uL}`,"createScope"),_L=b(async($,w,U,G,f)=>{const W=await SL($,w.secretAccessKey,w.accessKeyId),L=`${U}:${G}:${f}:${G0.toHex(W)}:${w.sessionToken}`;if(L in S0)return S0[L];U$.push(L);while(U$.length>M9)delete S0[U$.shift()];let X=`AWS4${w.secretAccessKey}`;for(let Z of[U,G,f,uL])X=await SL($,X,Z);return S0[L]=X},"getSigningKey"),A9=b(()=>{U$.length=0,Object.keys(S0).forEach(($)=>{delete S0[$]})},"clearCredentialCache"),SL=b(($,w,U)=>{const G=new $(w);return G.update(K9.toUint8Array(U)),G.digest()},"hmac"),vw=b(({headers:$},w,U)=>{const G={};for(let f of Object.keys($).sort()){if($[f]==null)continue;const W=f.toLowerCase();if(W in I9||(w==null?void 0:w.has(W))||z9.test(W)||Q9.test(W)){if(!U||U&&!U.has(W))continue}G[W]=$[f].trim().replace(/\s+/g," ")}return G},"getCanonicalHeaders"),o0=_$(),dL=b(({query:$={}})=>{const w=[],U={};for(let G of Object.keys($).sort()){if(G.toLowerCase()===F9)continue;w.push(G);const f=$[G];if(typeof f==="string")U[G]=`${o0.escapeUri(G)}=${o0.escapeUri(f)}`;else if(Array.isArray(f))U[G]=f.slice(0).reduce((W,L)=>W.concat([`${o0.escapeUri(G)}=${o0.escapeUri(L)}`]),[]).sort().join("&")}return w.map((G)=>U[G]).filter((G)=>G).join("&")},"getCanonicalQuery"),O9=k$(),B9=$0(),G$=b(async({headers:$,body:w},U)=>{for(let G of Object.keys($))if(G.toLowerCase()===cw)return $[G];if(w==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof w==="string"||ArrayBuffer.isView(w)||O9.isArrayBuffer(w)){const G=new U;return G.update(B9.toUint8Array(w)),G0.toHex(await G.digest())}return R9},"getPayloadHash"),bL=$0(),pL=class ${format(w){const U=[];for(let W of Object.keys(w)){const L=bL.fromUtf8(W);U.push(Uint8Array.from([L.byteLength]),L,this.formatHeaderValue(w[W]))}const G=new Uint8Array(U.reduce((W,L)=>W+L.byteLength,0));let f=0;for(let W of U)G.set(W,f),f+=W.byteLength;return G}formatHeaderValue(w){switch(w.type){case"boolean":return Uint8Array.from([w.value?0:1]);case"byte":return Uint8Array.from([2,w.value]);case"short":const U=new DataView(new ArrayBuffer(3));return U.setUint8(0,3),U.setInt16(1,w.value,!1),new Uint8Array(U.buffer);case"integer":const G=new DataView(new ArrayBuffer(5));return G.setUint8(0,4),G.setInt32(1,w.value,!1),new Uint8Array(G.buffer);case"long":const f=new Uint8Array(9);return f[0]=5,f.set(w.value.bytes,1),f;case"binary":const W=new DataView(new ArrayBuffer(3+w.value.byteLength));W.setUint8(0,6),W.setUint16(1,w.value.byteLength,!1);const L=new Uint8Array(W.buffer);return L.set(w.value,3),L;case"string":const X=bL.fromUtf8(w.value),Z=new DataView(new ArrayBuffer(3+X.byteLength));Z.setUint8(0,7),Z.setUint16(1,X.byteLength,!1);const F=new Uint8Array(Z.buffer);return F.set(X,3),F;case"timestamp":const Y=new Uint8Array(9);return Y[0]=8,Y.set(H9.fromNumber(w.value.valueOf()).bytes,1),Y;case"uuid":if(!T9.test(w.value))throw new Error(`Invalid UUID received: ${w.value}`);const I=new Uint8Array(17);return I[0]=9,I.set(G0.fromHex(w.value.replace(/\-/g,"")),1),I}}};b(pL,"HeaderFormatter");var V9=pL,T9=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,gL=class ${constructor(w){if(this.bytes=w,w.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(w){if(w>9223372036854776000||w<-9223372036854776000)throw new Error(`${w} is too large (or, if negative, too small) to represent as an Int64`);const U=new Uint8Array(8);for(let G=7,f=Math.abs(Math.round(w));G>-1&&f>0;G--,f/=256)U[G]=f;if(w<0)yw(U);return new $(U)}valueOf(){const w=this.bytes.slice(0),U=w[0]&128;if(U)yw(w);return parseInt(G0.toHex(w),16)*(U?-1:1)}toString(){return String(this.valueOf())}};b(gL,"Int64");var H9=gL;b(yw,"negate");var C9=b(($,w)=>{$=$.toLowerCase();for(let U of Object.keys(w))if($===U.toLowerCase())return!0;return!1},"hasHeader"),lL=r(),nL=b(($,w={})=>{var U;const{headers:G,query:f={}}=lL.HttpRequest.clone($);for(let W of Object.keys(G)){const L=W.toLowerCase();if(L.slice(0,6)==="x-amz-"&&!((U=w.unhoistableHeaders)==null?void 0:U.has(L)))f[W]=G[W],delete G[W]}return{...$,headers:G,query:f}},"moveHeadersToQuery"),xw=b(($)=>{$=lL.HttpRequest.clone($);for(let w of Object.keys($.headers))if(Z9.indexOf(w.toLowerCase())>-1)delete $.headers[w];return $},"prepareRequest"),N9=b(($)=>q9($).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),q9=b(($)=>{if(typeof $==="number")return new Date($*1000);if(typeof $==="string"){if(Number($))return new Date(Number($)*1000);return new Date($)}return $},"toDate"),sL=class ${constructor({applyChecksum:w,credentials:U,region:G,service:f,sha256:W,uriEscapePath:L=!0}){this.headerFormatter=new V9,this.service=f,this.sha256=W,this.uriEscapePath=L,this.applyChecksum=typeof w==="boolean"?w:!0,this.regionProvider=PL.normalizeProvider(G),this.credentialProvider=PL.normalizeProvider(U)}async presign(w,U={}){const{signingDate:G=new Date,expiresIn:f=3600,unsignableHeaders:W,unhoistableHeaders:L,signableHeaders:X,signingRegion:Z,signingService:F}=U,Y=await this.credentialProvider();this.validateResolvedCredentials(Y);const I=Z??await this.regionProvider(),{longDate:Q,shortDate:z}=w$(G);if(f>J9)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const E=f$(z,I,F??this.service),J=nL(xw(w),{unhoistableHeaders:L});if(Y.sessionToken)J.query[vL]=Y.sessionToken;J.query[f9]=kw,J.query[G9]=`${Y.accessKeyId}/${E}`,J.query[kL]=Q,J.query[L9]=f.toString(10);const O=vw(J,W,X);return J.query[W9]=hL(O),J.query[cL]=await this.getSignature(Q,E,this.getSigningKey(Y,I,z,F),this.createCanonicalRequest(J,O,await G$(w,this.sha256))),J}async sign(w,U){if(typeof w==="string")return this.signString(w,U);else if(w.headers&&w.payload)return this.signEvent(w,U);else if(w.message)return this.signMessage(w,U);else return this.signRequest(w,U)}async signEvent({headers:w,payload:U},{signingDate:G=new Date,priorSignature:f,signingRegion:W,signingService:L}){const X=W??await this.regionProvider(),{shortDate:Z,longDate:F}=w$(G),Y=f$(Z,X,L??this.service),I=await G$({headers:{},body:U},this.sha256),Q=new this.sha256;Q.update(w);const z=G0.toHex(await Q.digest()),E=[E9,F,Y,f,z,I].join("\n");return this.signString(E,{signingDate:G,signingRegion:X,signingService:L})}async signMessage(w,{signingDate:U=new Date,signingRegion:G,signingService:f}){return this.signEvent({headers:this.headerFormatter.format(w.message.headers),payload:w.message.body},{signingDate:U,signingRegion:G,signingService:f,priorSignature:w.priorSignature}).then((L)=>{return{message:w.message,signature:L}})}async signString(w,{signingDate:U=new Date,signingRegion:G,signingService:f}={}){const W=await this.credentialProvider();this.validateResolvedCredentials(W);const L=G??await this.regionProvider(),{shortDate:X}=w$(U),Z=new this.sha256(await this.getSigningKey(W,L,X,f));return Z.update(Dw.toUint8Array(w)),G0.toHex(await Z.digest())}async signRequest(w,{signingDate:U=new Date,signableHeaders:G,unsignableHeaders:f,signingRegion:W,signingService:L}={}){const X=await this.credentialProvider();this.validateResolvedCredentials(X);const Z=W??await this.regionProvider(),F=xw(w),{longDate:Y,shortDate:I}=w$(U),Q=f$(I,Z,L??this.service);if(F.headers[xL]=Y,X.sessionToken)F.headers[Y9]=X.sessionToken;const z=await G$(F,this.sha256);if(!C9(cw,F.headers)&&this.applyChecksum)F.headers[cw]=z;const E=vw(F,f,G),J=await this.getSignature(Y,Q,this.getSigningKey(X,Z,I,L),this.createCanonicalRequest(F,E,z));return F.headers[yL]=`${kw} Credential=${X.accessKeyId}/${Q}, SignedHeaders=${hL(E)}, Signature=${J}`,F}createCanonicalRequest(w,U,G){const f=Object.keys(U).sort();return`${w.method}
10
+ ${this.getCanonicalPath(w)}
11
+ ${dL(w)}
12
+ ${f.map((W)=>`${W}:${U[W]}`).join("\n")}
13
+
14
+ ${f.join(";")}
15
+ ${G}`}async createStringToSign(w,U,G){const f=new this.sha256;f.update(Dw.toUint8Array(G));const W=await f.digest();return`${kw}
16
+ ${w}
17
+ ${U}
18
+ ${G0.toHex(W)}`}getCanonicalPath({path:w}){if(this.uriEscapePath){const U=[];for(let W of w.split("/")){if((W==null?void 0:W.length)===0)continue;if(W===".")continue;if(W==="..")U.pop();else U.push(W)}const G=`${(w==null?void 0:w.startsWith("/"))?"/":""}${U.join("/")}${U.length>0&&(w==null?void 0:w.endsWith("/"))?"/":""}`;return o0.escapeUri(G).replace(/%2F/g,"/")}return w}async getSignature(w,U,G,f){const W=await this.createStringToSign(w,U,f),L=new this.sha256(await G);return L.update(Dw.toUint8Array(W)),G0.toHex(await L.digest())}getSigningKey(w,U,G,f){return _L(this.sha256,w,G,U,f||this.service)}validateResolvedCredentials(w){if(typeof w!=="object"||typeof w.accessKeyId!=="string"||typeof w.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}};b(sL,"SignatureV4");var j9=sL,w$=b(($)=>{const w=N9($).replace(/[\-:]/g,"");return{longDate:w,shortDate:w.slice(0,8)}},"formatDate"),hL=b(($)=>Object.keys($).sort().join(";"),"getCanonicalHeaderList")});var G6=M((EB,f6)=>{var{defineProperty:L$,getOwnPropertyDescriptor:P9,getOwnPropertyNames:S9}=Object,b9=Object.prototype.hasOwnProperty,k=($,w)=>L$($,"name",{value:w,configurable:!0}),h9=($,w)=>{for(var U in w)L$($,U,{get:w[U],enumerable:!0})},D9=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of S9(w))if(!b9.call($,f)&&f!==U)L$($,f,{get:()=>w[f],enumerable:!(G=P9(w,f))||G.enumerable})}return $},k9=($)=>D9(L$({},"__esModule",{value:!0}),$),eL={};h9(eL,{AWSSDKSigV4Signer:()=>x9,AwsSdkSigV4ASigner:()=>_9,AwsSdkSigV4Signer:()=>dw,NODE_SIGV4A_CONFIG_OPTIONS:()=>g9,resolveAWSSDKSigV4Config:()=>l9,resolveAwsSdkSigV4AConfig:()=>p9,resolveAwsSdkSigV4Config:()=>U6,validateSigningProperties:()=>_w});f6.exports=k9(eL);var c9=r(),v9=r(),rL=k(($)=>{var w,U;return v9.HttpResponse.isInstance($)?((w=$.headers)==null?void 0:w.date)??((U=$.headers)==null?void 0:U.Date):void 0},"getDateHeader"),uw=k(($)=>new Date(Date.now()+$),"getSkewCorrectedDate"),y9=k(($,w)=>Math.abs(uw(w).getTime()-$)>=300000,"isClockSkewed"),oL=k(($,w)=>{const U=Date.parse($);if(y9(U,w))return U-Date.now();return w},"getUpdatedSystemClockOffset"),a0=k(($,w)=>{if(!w)throw new Error(`Property \`${$}\` is not resolved for AWS SDK SigV4Auth`);return w},"throwSigningPropertyError"),_w=k(async($)=>{var w,U,G;const f=a0("context",$.context),W=a0("config",$.config),L=(G=(U=(w=f.endpointV2)==null?void 0:w.properties)==null?void 0:U.authSchemes)==null?void 0:G[0],Z=await a0("signer",W.signer)(L),F=$==null?void 0:$.signingRegion,Y=$==null?void 0:$.signingRegionSet,I=$==null?void 0:$.signingName;return{config:W,signer:Z,signingRegion:F,signingRegionSet:Y,signingName:I}},"validateSigningProperties"),$6=class ${async sign(w,U,G){var f;if(!c9.HttpRequest.isInstance(w))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const W=await _w(G),{config:L,signer:X}=W;let{signingRegion:Z,signingName:F}=W;const Y=G.context;if(((f=Y==null?void 0:Y.authSchemes)==null?void 0:f.length)??0>1){const[Q,z]=Y.authSchemes;if((Q==null?void 0:Q.name)==="sigv4a"&&(z==null?void 0:z.name)==="sigv4")Z=(z==null?void 0:z.signingRegion)??Z,F=(z==null?void 0:z.signingName)??F}return await X.sign(w,{signingDate:uw(L.systemClockOffset),signingRegion:Z,signingService:F})}errorHandler(w){return(U)=>{const G=U.ServerTime??rL(U.$response);if(G){const f=a0("config",w.config),W=f.systemClockOffset;if(f.systemClockOffset=oL(G,f.systemClockOffset),f.systemClockOffset!==W&&U.$metadata)U.$metadata.clockSkewCorrected=!0}throw U}}successHandler(w,U){const G=rL(w);if(G){const f=a0("config",U.config);f.systemClockOffset=oL(G,f.systemClockOffset)}}};k($6,"AwsSdkSigV4Signer");var dw=$6,x9=dw,u9=r(),w6=class $ extends dw{async sign(w,U,G){var f;if(!u9.HttpRequest.isInstance(w))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:W,signer:L,signingRegion:X,signingRegionSet:Z,signingName:F}=await _w(G),I=(await((f=W.sigv4aSigningRegionSet)==null?void 0:f.call(W))??Z??[X]).join(",");return await L.sign(w,{signingDate:uw(W.systemClockOffset),signingRegion:I,signingService:F})}};k(w6,"AwsSdkSigV4ASigner");var _9=w6,d9=Iw(),aL=Y$(),p9=k(($)=>{return $.sigv4aSigningRegionSet=d9.normalizeProvider($.sigv4aSigningRegionSet),$},"resolveAwsSdkSigV4AConfig"),g9={environmentVariableSelector($){if($.AWS_SIGV4A_SIGNING_REGION_SET)return $.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((w)=>w.trim());throw new aL.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector($){if($.sigv4a_signing_region_set)return($.sigv4a_signing_region_set??"").split(",").map((w)=>w.trim());throw new aL.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},E0=Iw(),tL=iL(),U6=k(($)=>{let w;if($.credentials)w=E0.memoizeIdentityProvider($.credentials,E0.isIdentityExpired,E0.doesIdentityRequireRefresh);if(!w)if($.credentialDefaultProvider)w=E0.normalizeProvider($.credentialDefaultProvider(Object.assign({},$,{parentClientConfig:$})));else w=k(async()=>{throw new Error("`credentials` is missing")},"normalizedCreds");const{signingEscapePath:U=!0,systemClockOffset:G=$.systemClockOffset||0,sha256:f}=$;let W;if($.signer)W=E0.normalizeProvider($.signer);else if($.regionInfoProvider)W=k(()=>E0.normalizeProvider($.region)().then(async(L)=>[await $.regionInfoProvider(L,{useFipsEndpoint:await $.useFipsEndpoint(),useDualstackEndpoint:await $.useDualstackEndpoint()})||{},L]).then(([L,X])=>{const{signingRegion:Z,signingService:F}=L;$.signingRegion=$.signingRegion||Z||X,$.signingName=$.signingName||F||$.serviceId;const Y={...$,credentials:w,region:$.signingRegion,service:$.signingName,sha256:f,uriEscapePath:U};return new($.signerConstructor||tL.SignatureV4)(Y)}),"signer");else W=k(async(L)=>{L=Object.assign({},{name:"sigv4",signingName:$.signingName||$.defaultSigningName,signingRegion:await E0.normalizeProvider($.region)(),properties:{}},L);const{signingRegion:X,signingName:Z}=L;$.signingRegion=$.signingRegion||X,$.signingName=$.signingName||Z||$.serviceId;const F={...$,credentials:w,region:$.signingRegion,service:$.signingName,sha256:f,uriEscapePath:U};return new($.signerConstructor||tL.SignatureV4)(F)},"signer");return{...$,systemClockOffset:G,signingEscapePath:U,credentials:w,signer:W}},"resolveAwsSdkSigV4Config"),l9=U6});var X$=M((r9)=>{var n9=":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",W6="[: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]["+n9+"]*",s9=new RegExp("^"+W6+"$"),m9=function($,w){const U=[];let G=w.exec($);while(G){const f=[];f.startIndex=w.lastIndex-G[0].length;const W=G.length;for(let L=0;L<W;L++)f.push(G[L]);U.push(f),G=w.exec($)}return U},i9=function($){const w=s9.exec($);return!(w===null||typeof w==="undefined")};r9.isExist=function($){return typeof $!=="undefined"};r9.isEmptyObject=function($){return Object.keys($).length===0};r9.merge=function($,w,U){if(w){const G=Object.keys(w),f=G.length;for(let W=0;W<f;W++)if(U==="strict")$[G[W]]=[w[G[W]]];else $[G[W]]=w[G[W]]}};r9.getValue=function($){if(r9.isExist($))return $;else return""};r9.isName=i9;r9.getAllMatches=m9;r9.nameRegexp=W6});var gw=M((I7)=>{var X6=function($){return $===" "||$==="\t"||$==="\n"||$==="\r"},Z6=function($,w){const U=w;for(;w<$.length;w++)if($[w]=="?"||$[w]==" "){const G=$.substr(U,w-U);if(w>5&&G==="xml")return j("InvalidXml","XML declaration allowed only at the start of the document.",D($,w));else if($[w]=="?"&&$[w+1]==">"){w++;break}else continue}return w},F6=function($,w){if($.length>w+5&&$[w+1]==="-"&&$[w+2]==="-"){for(w+=3;w<$.length;w++)if($[w]==="-"&&$[w+1]==="-"&&$[w+2]===">"){w+=2;break}}else if($.length>w+8&&$[w+1]==="D"&&$[w+2]==="O"&&$[w+3]==="C"&&$[w+4]==="T"&&$[w+5]==="Y"&&$[w+6]==="P"&&$[w+7]==="E"){let U=1;for(w+=8;w<$.length;w++)if($[w]==="<")U++;else if($[w]===">"){if(U--,U===0)break}}else if($.length>w+9&&$[w+1]==="["&&$[w+2]==="C"&&$[w+3]==="D"&&$[w+4]==="A"&&$[w+5]==="T"&&$[w+6]==="A"&&$[w+7]==="["){for(w+=8;w<$.length;w++)if($[w]==="]"&&$[w+1]==="]"&&$[w+2]===">"){w+=2;break}}return w},W7=function($,w){let U="",G="",f=!1;for(;w<$.length;w++){if($[w]===f7||$[w]===G7)if(G==="")G=$[w];else if(G!==$[w]);else G="";else if($[w]===">"){if(G===""){f=!0;break}}U+=$[w]}if(G!=="")return!1;return{value:U,index:w,tagClosed:f}},Y6=function($,w){const U=pw.getAllMatches($,L7),G={};for(let f=0;f<U.length;f++){if(U[f][1].length===0)return j("InvalidAttr","Attribute '"+U[f][2]+"' has no space in starting.",t0(U[f]));else if(U[f][3]!==void 0&&U[f][4]===void 0)return j("InvalidAttr","Attribute '"+U[f][2]+"' is without value.",t0(U[f]));else if(U[f][3]===void 0&&!w.allowBooleanAttributes)return j("InvalidAttr","boolean attribute '"+U[f][2]+"' is not allowed.",t0(U[f]));const W=U[f][2];if(!F7(W))return j("InvalidAttr","Attribute '"+W+"' is an invalid name.",t0(U[f]));if(!G.hasOwnProperty(W))G[W]=1;else return j("InvalidAttr","Attribute '"+W+"' is repeated.",t0(U[f]))}return!0},X7=function($,w){let U=/\d/;if($[w]==="x")w++,U=/[\da-fA-F]/;for(;w<$.length;w++){if($[w]===";")return w;if(!$[w].match(U))break}return-1},Z7=function($,w){if(w++,$[w]===";")return-1;if($[w]==="#")return w++,X7($,w);let U=0;for(;w<$.length;w++,U++){if($[w].match(/\w/)&&U<20)continue;if($[w]===";")break;return-1}return w},j=function($,w,U){return{err:{code:$,msg:w,line:U.line||U,col:U.col}}},F7=function($){return pw.isName($)},Y7=function($){return pw.isName($)},D=function($,w){const U=$.substring(0,w).split(/\r?\n/);return{line:U.length,col:U[U.length-1].length+1}},t0=function($){return $.startIndex+$[1].length},pw=X$(),U7={allowBooleanAttributes:!1,unpairedTags:[]};I7.validate=function($,w){w=Object.assign({},U7,w);const U=[];let G=!1,f=!1;if($[0]==="\uFEFF")$=$.substr(1);for(let W=0;W<$.length;W++)if($[W]==="<"&&$[W+1]==="?"){if(W+=2,W=Z6($,W),W.err)return W}else if($[W]==="<"){let L=W;if(W++,$[W]==="!"){W=F6($,W);continue}else{let X=!1;if($[W]==="/")X=!0,W++;let Z="";for(;W<$.length&&$[W]!==">"&&$[W]!==" "&&$[W]!=="\t"&&$[W]!=="\n"&&$[W]!=="\r";W++)Z+=$[W];if(Z=Z.trim(),Z[Z.length-1]==="/")Z=Z.substring(0,Z.length-1),W--;if(!Y7(Z)){let I;if(Z.trim().length===0)I="Invalid space after '<'.";else I="Tag '"+Z+"' is an invalid name.";return j("InvalidTag",I,D($,W))}const F=W7($,W);if(F===!1)return j("InvalidAttr","Attributes for '"+Z+"' have open quote.",D($,W));let Y=F.value;if(W=F.index,Y[Y.length-1]==="/"){const I=W-Y.length;Y=Y.substring(0,Y.length-1);const Q=Y6(Y,w);if(Q===!0)G=!0;else return j(Q.err.code,Q.err.msg,D($,I+Q.err.line))}else if(X)if(!F.tagClosed)return j("InvalidTag","Closing tag '"+Z+"' doesn't have proper closing.",D($,W));else if(Y.trim().length>0)return j("InvalidTag","Closing tag '"+Z+"' can't have attributes or invalid starting.",D($,L));else if(U.length===0)return j("InvalidTag","Closing tag '"+Z+"' has not been opened.",D($,L));else{const I=U.pop();if(Z!==I.tagName){let Q=D($,I.tagStartPos);return j("InvalidTag","Expected closing tag '"+I.tagName+"' (opened in line "+Q.line+", col "+Q.col+") instead of closing tag '"+Z+"'.",D($,L))}if(U.length==0)f=!0}else{const I=Y6(Y,w);if(I!==!0)return j(I.err.code,I.err.msg,D($,W-Y.length+I.err.line));if(f===!0)return j("InvalidXml","Multiple possible root nodes found.",D($,W));else if(w.unpairedTags.indexOf(Z)!==-1);else U.push({tagName:Z,tagStartPos:L});G=!0}for(W++;W<$.length;W++)if($[W]==="<")if($[W+1]==="!"){W++,W=F6($,W);continue}else if($[W+1]==="?"){if(W=Z6($,++W),W.err)return W}else break;else if($[W]==="&"){const I=Z7($,W);if(I==-1)return j("InvalidChar","char '&' is not expected.",D($,W));W=I}else if(f===!0&&!X6($[W]))return j("InvalidXml","Extra text at the end",D($,W));if($[W]==="<")W--}}else{if(X6($[W]))continue;return j("InvalidChar","char '"+$[W]+"' is not expected.",D($,W))}if(!G)return j("InvalidXml","Start tag expected.",1);else if(U.length==1)return j("InvalidTag","Unclosed tag '"+U[0].tagName+"'.",D($,U[0].tagStartPos));else if(U.length>0)return j("InvalidXml","Invalid '"+JSON.stringify(U.map((W)=>W.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var f7='"',G7="'",L7=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var z6=M((E7)=>{var I6={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($,w){return w},attributeValueProcessor:function($,w){return w},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function($,w,U){return $}},Q7=function($){return Object.assign({},I6,$)};E7.buildOptions=Q7;E7.defaultOptions=I6});var R6=M((KB,E6)=>{class Q6{constructor($){this.tagname=$,this.child=[],this[":@"]={}}add($,w){if($==="__proto__")$="#__proto__";this.child.push({[$]:w})}addChild($){if($.tagname==="__proto__")$.tagname="#__proto__";if($[":@"]&&Object.keys($[":@"]).length>0)this.child.push({[$.tagname]:$.child,[":@"]:$[":@"]});else this.child.push({[$.tagname]:$.child})}}E6.exports=Q6});var J6=M((AB,M6)=>{var K7=function($,w){const U={};if($[w+3]==="O"&&$[w+4]==="C"&&$[w+5]==="T"&&$[w+6]==="Y"&&$[w+7]==="P"&&$[w+8]==="E"){w=w+9;let G=1,f=!1,W=!1,L="";for(;w<$.length;w++)if($[w]==="<"&&!W){if(f&&B7($,w)){if(w+=7,[entityName,val,w]=A7($,w+1),val.indexOf("&")===-1)U[C7(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(f&&V7($,w))w+=8;else if(f&&T7($,w))w+=8;else if(f&&H7($,w))w+=9;else if(O7)W=!0;else throw new Error("Invalid DOCTYPE");G++,L=""}else if($[w]===">"){if(W){if($[w-1]==="-"&&$[w-2]==="-")W=!1,G--}else G--;if(G===0)break}else if($[w]==="[")f=!0;else L+=$[w];if(G!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:U,i:w}},A7=function($,w){let U="";for(;w<$.length&&($[w]!=="'"&&$[w]!=='"');w++)U+=$[w];if(U=U.trim(),U.indexOf(" ")!==-1)throw new Error("External entites are not supported");const G=$[w++];let f="";for(;w<$.length&&$[w]!==G;w++)f+=$[w];return[U,f,w]},O7=function($,w){if($[w+1]==="!"&&$[w+2]==="-"&&$[w+3]==="-")return!0;return!1},B7=function($,w){if($[w+1]==="!"&&$[w+2]==="E"&&$[w+3]==="N"&&$[w+4]==="T"&&$[w+5]==="I"&&$[w+6]==="T"&&$[w+7]==="Y")return!0;return!1},V7=function($,w){if($[w+1]==="!"&&$[w+2]==="E"&&$[w+3]==="L"&&$[w+4]==="E"&&$[w+5]==="M"&&$[w+6]==="E"&&$[w+7]==="N"&&$[w+8]==="T")return!0;return!1},T7=function($,w){if($[w+1]==="!"&&$[w+2]==="A"&&$[w+3]==="T"&&$[w+4]==="T"&&$[w+5]==="L"&&$[w+6]==="I"&&$[w+7]==="S"&&$[w+8]==="T")return!0;return!1},H7=function($,w){if($[w+1]==="!"&&$[w+2]==="N"&&$[w+3]==="O"&&$[w+4]==="T"&&$[w+5]==="A"&&$[w+6]==="T"&&$[w+7]==="I"&&$[w+8]==="O"&&$[w+9]==="N")return!0;return!1},C7=function($){if(J7.isName($))return $;else throw new Error(`Invalid entity name ${$}`)},J7=X$();M6.exports=K7});var A6=M((OB,K6)=>{var P7=function($,w={}){if(w=Object.assign({},j7,w),!$||typeof $!=="string")return $;let U=$.trim();if(w.skipLike!==void 0&&w.skipLike.test(U))return $;else if(w.hex&&N7.test(U))return Number.parseInt(U,16);else{const G=q7.exec(U);if(G){const f=G[1],W=G[2];let L=S7(G[3]);const X=G[4]||G[6];if(!w.leadingZeros&&W.length>0&&f&&U[2]!==".")return $;else if(!w.leadingZeros&&W.length>0&&!f&&U[1]!==".")return $;else{const Z=Number(U),F=""+Z;if(F.search(/[eE]/)!==-1)if(w.eNotation)return Z;else return $;else if(X)if(w.eNotation)return Z;else return $;else if(U.indexOf(".")!==-1)if(F==="0"&&L==="")return Z;else if(F===L)return Z;else if(f&&F==="-"+L)return Z;else return $;if(W)if(L===F)return Z;else if(f+L===F)return Z;else return $;if(U===F)return Z;else if(U===f+F)return Z;return $}}else return $}},S7=function($){if($&&$.indexOf(".")!==-1){if($=$.replace(/0+$/,""),$===".")$="0";else if($[0]===".")$="0"+$;else if($[$.length-1]===".")$=$.substr(0,$.length-1);return $}return $},N7=/^[-+]?0x[a-fA-F0-9]+$/,q7=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt)Number.parseInt=window.parseInt;if(!Number.parseFloat&&window.parseFloat)Number.parseFloat=window.parseFloat;var j7={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};K6.exports=P7});var T6=M((BB,V6)=>{var D7=function($){const w=Object.keys($);for(let U=0;U<w.length;U++){const G=w[U];this.lastEntities[G]={regex:new RegExp("&"+G+";","g"),val:$[G]}}},k7=function($,w,U,G,f,W,L){if($!==void 0){if(this.options.trimValues&&!G)$=$.trim();if($.length>0){if(!L)$=this.replaceEntitiesValue($);const X=this.options.tagValueProcessor(w,$,U,f,W);if(X===null||X===void 0)return $;else if(typeof X!==typeof $||X!==$)return X;else if(this.options.trimValues)return nw($,this.options.parseTagValue,this.options.numberParseOptions);else if($.trim()===$)return nw($,this.options.parseTagValue,this.options.numberParseOptions);else return $}}},c7=function($){if(this.options.removeNSPrefix){const w=$.split(":"),U=$.charAt(0)==="/"?"/":"";if(w[0]==="xmlns")return"";if(w.length===2)$=U+w[1]}return $},y7=function($,w,U){if(!this.options.ignoreAttributes&&typeof $==="string"){const G=O6.getAllMatches($,v7),f=G.length,W={};for(let L=0;L<f;L++){const X=this.resolveNameSpace(G[L][1]);let Z=G[L][4],F=this.options.attributeNamePrefix+X;if(X.length){if(this.options.transformAttributeName)F=this.options.transformAttributeName(F);if(F==="__proto__")F="#__proto__";if(Z!==void 0){if(this.options.trimValues)Z=Z.trim();Z=this.replaceEntitiesValue(Z);const Y=this.options.attributeValueProcessor(X,Z,w);if(Y===null||Y===void 0)W[F]=Z;else if(typeof Y!==typeof Z||Y!==Z)W[F]=Y;else W[F]=nw(Z,this.options.parseAttributeValue,this.options.numberParseOptions)}else if(this.options.allowBooleanAttributes)W[F]=!0}}if(!Object.keys(W).length)return;if(this.options.attributesGroupName){const L={};return L[this.options.attributesGroupName]=W,L}return W}},u7=function($,w,U){const G=this.options.updateTag(w.tagname,U,w[":@"]);if(G===!1);else if(typeof G==="string")w.tagname=G,$.addChild(w);else $.addChild(w)},d7=function($,w,U,G){if($){if(G===void 0)G=Object.keys(w.child).length===0;if($=this.parseTextData($,w.tagname,U,!1,w[":@"]?Object.keys(w[":@"]).length!==0:!1,G),$!==void 0&&$!=="")w.add(this.options.textNodeName,$);$=""}return $},p7=function($,w,U){const G="*."+U;for(let f in $){const W=$[f];if(G===W||w===W)return!0}return!1},g7=function($,w,U=">"){let G,f="";for(let W=w;W<$.length;W++){let L=$[W];if(G){if(L===G)G=""}else if(L==='"'||L==="'")G=L;else if(L===U[0])if(U[1]){if($[W+1]===U[1])return{data:f,index:W}}else return{data:f,index:W};else if(L==="\t")L=" ";f+=L}},R0=function($,w,U,G){const f=$.indexOf(w,U);if(f===-1)throw new Error(G);else return f+w.length-1},lw=function($,w,U,G=">"){const f=g7($,w+1,G);if(!f)return;let W=f.data;const L=f.index,X=W.search(/\s/);let Z=W,F=!0;if(X!==-1)Z=W.substring(0,X),W=W.substring(X+1).trimStart();const Y=Z;if(U){const I=Z.indexOf(":");if(I!==-1)Z=Z.substr(I+1),F=Z!==f.data.substr(I+1)}return{tagName:Z,tagExp:W,closeIndex:L,attrExpPresent:F,rawTagName:Y}},l7=function($,w,U){const G=U;let f=1;for(;U<$.length;U++)if($[U]==="<")if($[U+1]==="/"){const W=R0($,">",U,`${w} is not closed`);if($.substring(U+2,W).trim()===w){if(f--,f===0)return{tagContent:$.substring(G,U),i:W}}U=W}else if($[U+1]==="?")U=R0($,"?>",U+1,"StopNode is not closed.");else if($.substr(U+1,3)==="!--")U=R0($,"-->",U+3,"StopNode is not closed.");else if($.substr(U+1,2)==="![")U=R0($,"]]>",U,"StopNode is not closed.")-2;else{const W=lw($,U,">");if(W){if((W&&W.tagName)===w&&W.tagExp[W.tagExp.length-1]!=="/")f++;U=W.closeIndex}}},nw=function($,w,U){if(w&&typeof $==="string"){const G=$.trim();if(G==="true")return!0;else if(G==="false")return!1;else return h7($,U)}else if(O6.isExist($))return $;else return""},O6=X$(),e0=R6(),b7=J6(),h7=A6();class B6{constructor($){this.options=$,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:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(w,U)=>String.fromCharCode(Number.parseInt(U,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(w,U)=>String.fromCharCode(Number.parseInt(U,16))}},this.addExternalEntities=D7,this.parseXml=x7,this.parseTextData=k7,this.resolveNameSpace=c7,this.buildAttributesMap=y7,this.isItStopNode=p7,this.replaceEntitiesValue=_7,this.readStopNodeData=l7,this.saveTextToParentTag=d7,this.addChild=u7}}var v7=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),x7=function($){$=$.replace(/\r\n?/g,"\n");const w=new e0("!xml");let U=w,G="",f="";for(let W=0;W<$.length;W++)if($[W]==="<")if($[W+1]==="/"){const X=R0($,">",W,"Closing Tag is not closed.");let Z=$.substring(W+2,X).trim();if(this.options.removeNSPrefix){const I=Z.indexOf(":");if(I!==-1)Z=Z.substr(I+1)}if(this.options.transformTagName)Z=this.options.transformTagName(Z);if(U)G=this.saveTextToParentTag(G,U,f);const F=f.substring(f.lastIndexOf(".")+1);if(Z&&this.options.unpairedTags.indexOf(Z)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${Z}>`);let Y=0;if(F&&this.options.unpairedTags.indexOf(F)!==-1)Y=f.lastIndexOf(".",f.lastIndexOf(".")-1),this.tagsNodeStack.pop();else Y=f.lastIndexOf(".");f=f.substring(0,Y),U=this.tagsNodeStack.pop(),G="",W=X}else if($[W+1]==="?"){let X=lw($,W,!1,"?>");if(!X)throw new Error("Pi Tag is not closed.");if(G=this.saveTextToParentTag(G,U,f),this.options.ignoreDeclaration&&X.tagName==="?xml"||this.options.ignorePiTags);else{const Z=new e0(X.tagName);if(Z.add(this.options.textNodeName,""),X.tagName!==X.tagExp&&X.attrExpPresent)Z[":@"]=this.buildAttributesMap(X.tagExp,f,X.tagName);this.addChild(U,Z,f)}W=X.closeIndex+1}else if($.substr(W+1,3)==="!--"){const X=R0($,"-->",W+4,"Comment is not closed.");if(this.options.commentPropName){const Z=$.substring(W+4,X-2);G=this.saveTextToParentTag(G,U,f),U.add(this.options.commentPropName,[{[this.options.textNodeName]:Z}])}W=X}else if($.substr(W+1,2)==="!D"){const X=b7($,W);this.docTypeEntities=X.entities,W=X.i}else if($.substr(W+1,2)==="!["){const X=R0($,"]]>",W,"CDATA is not closed.")-2,Z=$.substring(W+9,X);G=this.saveTextToParentTag(G,U,f);let F=this.parseTextData(Z,U.tagname,f,!0,!1,!0,!0);if(F==null)F="";if(this.options.cdataPropName)U.add(this.options.cdataPropName,[{[this.options.textNodeName]:Z}]);else U.add(this.options.textNodeName,F);W=X+2}else{let X=lw($,W,this.options.removeNSPrefix),Z=X.tagName;const F=X.rawTagName;let{tagExp:Y,attrExpPresent:I,closeIndex:Q}=X;if(this.options.transformTagName)Z=this.options.transformTagName(Z);if(U&&G){if(U.tagname!=="!xml")G=this.saveTextToParentTag(G,U,f,!1)}const z=U;if(z&&this.options.unpairedTags.indexOf(z.tagname)!==-1)U=this.tagsNodeStack.pop(),f=f.substring(0,f.lastIndexOf("."));if(Z!==w.tagname)f+=f?"."+Z:Z;if(this.isItStopNode(this.options.stopNodes,f,Z)){let E="";if(Y.length>0&&Y.lastIndexOf("/")===Y.length-1){if(Z[Z.length-1]==="/")Z=Z.substr(0,Z.length-1),f=f.substr(0,f.length-1),Y=Z;else Y=Y.substr(0,Y.length-1);W=X.closeIndex}else if(this.options.unpairedTags.indexOf(Z)!==-1)W=X.closeIndex;else{const O=this.readStopNodeData($,F,Q+1);if(!O)throw new Error(`Unexpected end of ${F}`);W=O.i,E=O.tagContent}const J=new e0(Z);if(Z!==Y&&I)J[":@"]=this.buildAttributesMap(Y,f,Z);if(E)E=this.parseTextData(E,Z,f,!0,I,!0,!0);f=f.substr(0,f.lastIndexOf(".")),J.add(this.options.textNodeName,E),this.addChild(U,J,f)}else{if(Y.length>0&&Y.lastIndexOf("/")===Y.length-1){if(Z[Z.length-1]==="/")Z=Z.substr(0,Z.length-1),f=f.substr(0,f.length-1),Y=Z;else Y=Y.substr(0,Y.length-1);if(this.options.transformTagName)Z=this.options.transformTagName(Z);const E=new e0(Z);if(Z!==Y&&I)E[":@"]=this.buildAttributesMap(Y,f,Z);this.addChild(U,E,f),f=f.substr(0,f.lastIndexOf("."))}else{const E=new e0(Z);if(this.tagsNodeStack.push(U),Z!==Y&&I)E[":@"]=this.buildAttributesMap(Y,f,Z);this.addChild(U,E,f),U=E}G="",W=Q}}else G+=$[W];return w.child},_7=function($){if(this.options.processEntities){for(let w in this.docTypeEntities){const U=this.docTypeEntities[w];$=$.replace(U.regx,U.val)}for(let w in this.lastEntities){const U=this.lastEntities[w];$=$.replace(U.regex,U.val)}if(this.options.htmlEntities)for(let w in this.htmlEntities){const U=this.htmlEntities[w];$=$.replace(U.regex,U.val)}$=$.replace(this.ampEntity.regex,this.ampEntity.val)}return $};V6.exports=B6});var C6=M((r7)=>{var n7=function($,w){return H6($,w)},H6=function($,w,U){let G;const f={};for(let W=0;W<$.length;W++){const L=$[W],X=s7(L);let Z="";if(U===void 0)Z=X;else Z=U+"."+X;if(X===w.textNodeName)if(G===void 0)G=L[X];else G+=""+L[X];else if(X===void 0)continue;else if(L[X]){let F=H6(L[X],w,Z);const Y=i7(F,w);if(L[":@"])m7(F,L[":@"],Z,w);else if(Object.keys(F).length===1&&F[w.textNodeName]!==void 0&&!w.alwaysCreateTextNode)F=F[w.textNodeName];else if(Object.keys(F).length===0)if(w.alwaysCreateTextNode)F[w.textNodeName]="";else F="";if(f[X]!==void 0&&f.hasOwnProperty(X)){if(!Array.isArray(f[X]))f[X]=[f[X]];f[X].push(F)}else if(w.isArray(X,Z,Y))f[X]=[F];else f[X]=F}}if(typeof G==="string"){if(G.length>0)f[w.textNodeName]=G}else if(G!==void 0)f[w.textNodeName]=G;return f},s7=function($){const w=Object.keys($);for(let U=0;U<w.length;U++){const G=w[U];if(G!==":@")return G}},m7=function($,w,U,G){if(w){const f=Object.keys(w),W=f.length;for(let L=0;L<W;L++){const X=f[L];if(G.isArray(X,U+"."+X,!0,!0))$[X]=[w[X]];else $[X]=w[X]}}},i7=function($,w){const{textNodeName:U}=w,G=Object.keys($).length;if(G===0)return!0;if(G===1&&($[U]||typeof $[U]==="boolean"||$[U]===0))return!0;return!1};r7.prettify=n7});var j6=M((TB,q6)=>{var{buildOptions:a7}=z6(),t7=T6(),{prettify:e7}=C6(),$E=gw();class N6{constructor($){this.externalEntities={},this.options=a7($)}parse($,w){if(typeof $==="string");else if($.toString)$=$.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(w){if(w===!0)w={};const f=$E.validate($,w);if(f!==!0)throw Error(`${f.err.msg}:${f.err.line}:${f.err.col}`)}const U=new t7(this.options);U.addExternalEntities(this.externalEntities);const G=U.parseXml($);if(this.options.preserveOrder||G===void 0)return G;else return e7(G,this.options)}addEntity($,w){if(w.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");else if($.indexOf("&")!==-1||$.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");else if(w==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[$]=w}}q6.exports=N6});var D6=M((HB,h6)=>{var wE=function($,w){let U="";if(w.format&&w.indentBy.length>0)U="\n";return S6($,w,"",U)},S6=function($,w,U,G){let f="",W=!1;for(let L=0;L<$.length;L++){const X=$[L],Z=UE(X);if(Z===void 0)continue;let F="";if(U.length===0)F=Z;else F=`${U}.${Z}`;if(Z===w.textNodeName){let E=X[Z];if(!fE(F,w))E=w.tagValueProcessor(Z,E),E=b6(E,w);if(W)f+=G;f+=E,W=!1;continue}else if(Z===w.cdataPropName){if(W)f+=G;f+=`<![CDATA[${X[Z][0][w.textNodeName]}]]>`,W=!1;continue}else if(Z===w.commentPropName){f+=G+`<!--${X[Z][0][w.textNodeName]}-->`,W=!0;continue}else if(Z[0]==="?"){const E=P6(X[":@"],w),J=Z==="?xml"?"":G;let O=X[Z][0][w.textNodeName];O=O.length!==0?" "+O:"",f+=J+`<${Z}${O}${E}?>`,W=!0;continue}let Y=G;if(Y!=="")Y+=w.indentBy;const I=P6(X[":@"],w),Q=G+`<${Z}${I}`,z=S6(X[Z],w,F,Y);if(w.unpairedTags.indexOf(Z)!==-1)if(w.suppressUnpairedNode)f+=Q+">";else f+=Q+"/>";else if((!z||z.length===0)&&w.suppressEmptyNode)f+=Q+"/>";else if(z&&z.endsWith(">"))f+=Q+`>${z}${G}</${Z}>`;else{if(f+=Q+">",z&&G!==""&&(z.includes("/>")||z.includes("</")))f+=G+w.indentBy+z+G;else f+=z;f+=`</${Z}>`}W=!0}return f},UE=function($){const w=Object.keys($);for(let U=0;U<w.length;U++){const G=w[U];if(!$.hasOwnProperty(G))continue;if(G!==":@")return G}},P6=function($,w){let U="";if($&&!w.ignoreAttributes)for(let G in $){if(!$.hasOwnProperty(G))continue;let f=w.attributeValueProcessor(G,$[G]);if(f=b6(f,w),f===!0&&w.suppressBooleanAttributes)U+=` ${G.substr(w.attributeNamePrefix.length)}`;else U+=` ${G.substr(w.attributeNamePrefix.length)}="${f}"`}return U},fE=function($,w){$=$.substr(0,$.length-w.textNodeName.length-1);let U=$.substr($.lastIndexOf(".")+1);for(let G in w.stopNodes)if(w.stopNodes[G]===$||w.stopNodes[G]==="*."+U)return!0;return!1},b6=function($,w){if($&&$.length>0&&w.processEntities)for(let U=0;U<w.entities.length;U++){const G=w.entities[U];$=$.replace(G.regex,G.val)}return $};h6.exports=wE});var c6=M((CB,k6)=>{var W0=function($){if(this.options=Object.assign({},WE,$),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ZE;if(this.processTextOrObjNode=LE,this.options.format)this.indentate=XE,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""},LE=function($,w,U){const G=this.j2x($,U+1);if($[this.options.textNodeName]!==void 0&&Object.keys($).length===1)return this.buildTextValNode($[this.options.textNodeName],w,G.attrStr,U);else return this.buildObjectNode(G.val,w,G.attrStr,U)},XE=function($){return this.options.indentBy.repeat($)},ZE=function($){if($.startsWith(this.options.attributeNamePrefix)&&$!==this.options.textNodeName)return $.substr(this.attrPrefixLen);else return!1},GE=D6(),WE={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function($,w){return w},attributeValueProcessor:function($,w){return w},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("\'","g"),val:"&apos;"},{regex:new RegExp("\"","g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};W0.prototype.build=function($){if(this.options.preserveOrder)return GE($,this.options);else{if(Array.isArray($)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)$={[this.options.arrayNodeName]:$};return this.j2x($,0).val}};W0.prototype.j2x=function($,w){let U="",G="";for(let f in $){if(!Object.prototype.hasOwnProperty.call($,f))continue;if(typeof $[f]==="undefined"){if(this.isAttribute(f))G+=""}else if($[f]===null)if(this.isAttribute(f))G+="";else if(f[0]==="?")G+=this.indentate(w)+"<"+f+"?"+this.tagEndChar;else G+=this.indentate(w)+"<"+f+"/"+this.tagEndChar;else if($[f]instanceof Date)G+=this.buildTextValNode($[f],f,"",w);else if(typeof $[f]!=="object"){const W=this.isAttribute(f);if(W)U+=this.buildAttrPairStr(W,""+$[f]);else if(f===this.options.textNodeName){let L=this.options.tagValueProcessor(f,""+$[f]);G+=this.replaceEntitiesValue(L)}else G+=this.buildTextValNode($[f],f,"",w)}else if(Array.isArray($[f])){const W=$[f].length;let L="",X="";for(let Z=0;Z<W;Z++){const F=$[f][Z];if(typeof F==="undefined");else if(F===null)if(f[0]==="?")G+=this.indentate(w)+"<"+f+"?"+this.tagEndChar;else G+=this.indentate(w)+"<"+f+"/"+this.tagEndChar;else if(typeof F==="object")if(this.options.oneListGroup){const Y=this.j2x(F,w+1);if(L+=Y.val,this.options.attributesGroupName&&F.hasOwnProperty(this.options.attributesGroupName))X+=Y.attrStr}else L+=this.processTextOrObjNode(F,f,w);else if(this.options.oneListGroup){let Y=this.options.tagValueProcessor(f,F);Y=this.replaceEntitiesValue(Y),L+=Y}else L+=this.buildTextValNode(F,f,"",w)}if(this.options.oneListGroup)L=this.buildObjectNode(L,f,X,w);G+=L}else if(this.options.attributesGroupName&&f===this.options.attributesGroupName){const W=Object.keys($[f]),L=W.length;for(let X=0;X<L;X++)U+=this.buildAttrPairStr(W[X],""+$[f][W[X]])}else G+=this.processTextOrObjNode($[f],f,w)}return{attrStr:U,val:G}};W0.prototype.buildAttrPairStr=function($,w){if(w=this.options.attributeValueProcessor($,""+w),w=this.replaceEntitiesValue(w),this.options.suppressBooleanAttributes&&w==="true")return" "+$;else return" "+$+'="'+w+'"'};W0.prototype.buildObjectNode=function($,w,U,G){if($==="")if(w[0]==="?")return this.indentate(G)+"<"+w+U+"?"+this.tagEndChar;else return this.indentate(G)+"<"+w+U+this.closeTag(w)+this.tagEndChar;else{let f="</"+w+this.tagEndChar,W="";if(w[0]==="?")W="?",f="";if((U||U==="")&&$.indexOf("<")===-1)return this.indentate(G)+"<"+w+U+W+">"+$+f;else if(this.options.commentPropName!==!1&&w===this.options.commentPropName&&W.length===0)return this.indentate(G)+`<!--${$}-->`+this.newLine;else return this.indentate(G)+"<"+w+U+W+this.tagEndChar+$+this.indentate(G)+f}};W0.prototype.closeTag=function($){let w="";if(this.options.unpairedTags.indexOf($)!==-1){if(!this.options.suppressUnpairedNode)w="/"}else if(this.options.suppressEmptyNode)w="/";else w=`></${$}`;return w};W0.prototype.buildTextValNode=function($,w,U,G){if(this.options.cdataPropName!==!1&&w===this.options.cdataPropName)return this.indentate(G)+`<![CDATA[${$}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&w===this.options.commentPropName)return this.indentate(G)+`<!--${$}-->`+this.newLine;else if(w[0]==="?")return this.indentate(G)+"<"+w+U+"?"+this.tagEndChar;else{let f=this.options.tagValueProcessor(w,$);if(f=this.replaceEntitiesValue(f),f==="")return this.indentate(G)+"<"+w+U+this.closeTag(w)+this.tagEndChar;else return this.indentate(G)+"<"+w+U+">"+f+"</"+w+this.tagEndChar}};W0.prototype.replaceEntitiesValue=function($){if($&&$.length>0&&this.options.processEntities)for(let w=0;w<this.options.entities.length;w++){const U=this.options.entities[w];$=$.replace(U.regex,U.val)}return $};k6.exports=W0});var y6=M((NB,v6)=>{var FE=gw(),YE=j6(),IE=c6();v6.exports={XMLParser:YE,XMLValidator:FE,XMLBuilder:IE}});var g6=M((qB,p6)=>{var{defineProperty:Z$,getOwnPropertyDescriptor:zE,getOwnPropertyNames:QE}=Object,EE=Object.prototype.hasOwnProperty,c=($,w)=>Z$($,"name",{value:w,configurable:!0}),RE=($,w)=>{for(var U in w)Z$($,U,{get:w[U],enumerable:!0})},ME=($,w,U,G)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let f of QE(w))if(!EE.call($,f)&&f!==U)Z$($,f,{get:()=>w[f],enumerable:!(G=zE(w,f))||G.enumerable})}return $},JE=($)=>ME(Z$({},"__esModule",{value:!0}),$),x6={};RE(x6,{_toBool:()=>AE,_toNum:()=>OE,_toStr:()=>KE,awsExpectUnion:()=>VE,loadRestJsonErrorCode:()=>CE,loadRestXmlErrorCode:()=>PE,parseJsonBody:()=>_6,parseJsonErrorBody:()=>HE,parseXmlBody:()=>d6,parseXmlErrorBody:()=>jE});p6.exports=JE(x6);var KE=c(($)=>{if($==null)return $;if(typeof $==="number"||typeof $==="bigint"){const w=new Error(`Received number ${$} where a string was expected.`);return w.name="Warning",console.warn(w),String($)}if(typeof $==="boolean"){const w=new Error(`Received boolean ${$} where a string was expected.`);return w.name="Warning",console.warn(w),String($)}return $},"_toStr"),AE=c(($)=>{if($==null)return $;if(typeof $==="string"){const w=$.toLowerCase();if($!==""&&w!=="false"&&w!=="true"){const U=new Error(`Received string "${$}" where a boolean was expected.`);U.name="Warning",console.warn(U)}return $!==""&&w!=="false"}return $},"_toBool"),OE=c(($)=>{if($==null)return $;if(typeof $==="string"){const w=Number($);if(w.toString()!==$){const U=new Error(`Received string "${$}" where a number was expected.`);return U.name="Warning",console.warn(U),$}return w}return $},"_toNum"),BE=T0(),VE=c(($)=>{if($==null)return;if(typeof $==="object"&&"__type"in $)delete $.__type;return BE.expectUnion($)},"awsExpectUnion"),TE=T0(),u6=c(($,w)=>TE.collectBody($,w).then((U)=>w.utf8Encoder(U)),"collectBodyString"),_6=c(($,w)=>u6($,w).then((U)=>{if(U.length)try{return JSON.parse(U)}catch(G){if((G==null?void 0:G.name)==="SyntaxError")Object.defineProperty(G,"$responseBodyText",{value:U});throw G}return{}}),"parseJsonBody"),HE=c(async($,w)=>{const U=await _6($,w);return U.message=U.message??U.Message,U},"parseJsonErrorBody"),CE=c(($,w)=>{const U=c((W,L)=>Object.keys(W).find((X)=>X.toLowerCase()===L.toLowerCase()),"findKey"),G=c((W)=>{let L=W;if(typeof L==="number")L=L.toString();if(L.indexOf(",")>=0)L=L.split(",")[0];if(L.indexOf(":")>=0)L=L.split(":")[0];if(L.indexOf("#")>=0)L=L.split("#")[1];return L},"sanitizeErrorCode"),f=U($.headers,"x-amzn-errortype");if(f!==void 0)return G($.headers[f]);if(w.code!==void 0)return G(w.code);if(w.__type!==void 0)return G(w.__type)},"loadRestJsonErrorCode"),NE=T0(),qE=y6(),d6=c(($,w)=>u6($,w).then((U)=>{if(U.length){const G=new qE.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(Z,F)=>F.trim()===""&&F.includes("\n")?"":void 0});G.addEntity("#xD","\r"),G.addEntity("#10","\n");let f;try{f=G.parse(U,!0)}catch(Z){if(Z&&typeof Z==="object")Object.defineProperty(Z,"$responseBodyText",{value:U});throw Z}const W="#text",L=Object.keys(f)[0],X=f[L];if(X[W])X[L]=X[W],delete X[W];return NE.getValueFromTextNode(X)}return{}}),"parseXmlBody"),jE=c(async($,w)=>{const U=await d6($,w);if(U.Error)U.Error.message=U.Error.message??U.Error.Message;return U},"parseXmlErrorBody"),PE=c(($,w)=>{var U;if(((U=w==null?void 0:w.Error)==null?void 0:U.Code)!==void 0)return w.Error.Code;if((w==null?void 0:w.Code)!==void 0)return w.Code;if($.statusCode==404)return"NotFound"},"loadRestXmlErrorCode")});var SE=M(($1)=>{Object.defineProperty($1,"__esModule",{value:!0});var sw=HL();sw.__exportStar(jL(),$1);sw.__exportStar(G6(),$1);sw.__exportStar(g6(),$1)});function sE($){return $}var UX=($)=>(w)=>async(U)=>{if(!y.isInstance(U.request))return w(U);const{request:G}=U,{handlerProtocol:f=""}=$.requestHandler.metadata||{};if(f.indexOf("h2")>=0&&!G.headers[":authority"])delete G.headers.host,G.headers[":authority"]=G.hostname+(G.port?":"+G.port:"");else if(!G.headers.host){let W=G.hostname;if(G.port!=null)W+=`:${G.port}`;G.headers.host=W}return w(U)},fX={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},mE=($)=>({applyToStack:(w)=>{w.add(UX($),fX)}});var GX=()=>($,w)=>async(U)=>{try{const G=await $(U),{clientName:f,commandName:W,logger:L,dynamoDbDocumentClientOptions:X={}}=w,{overrideInputFilterSensitiveLog:Z,overrideOutputFilterSensitiveLog:F}=X,Y=Z??w.inputFilterSensitiveLog,I=F??w.outputFilterSensitiveLog,{$metadata:Q,...z}=G.output;return L?.info?.({clientName:f,commandName:W,input:Y(U.input),output:I(z),metadata:Q}),G}catch(G){const{clientName:f,commandName:W,logger:L,dynamoDbDocumentClientOptions:X={}}=w,{overrideInputFilterSensitiveLog:Z}=X,F=Z??w.inputFilterSensitiveLog;throw L?.error?.({clientName:f,commandName:W,input:F(U.input),error:G,metadata:G.$metadata}),G}},WX={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},rE=($)=>({applyToStack:(w)=>{w.add(GX(),WX)}});var tw="X-Amzn-Trace-Id",LX="AWS_LAMBDA_FUNCTION_NAME",XX="_X_AMZN_TRACE_ID",ZX=($)=>(w)=>async(U)=>{const{request:G}=U;if(!y.isInstance(G)||$.runtime!=="node"||G.headers.hasOwnProperty(tw))return w(U);const f=process.env[LX],W=process.env[XX],L=(X)=>typeof X==="string"&&X.length>0;if(L(f)&&L(W))G.headers[tw]=W;return w({...U,request:G})},FX={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},$R=($)=>({applyToStack:(w)=>{w.add(ZX($),FX)}});function GM($){return{...$,customUserAgent:typeof $.customUserAgent==="string"?[[$.customUserAgent]]:$.customUserAgent}}var ZQ=new 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}$"),s0=($)=>ZQ.test($)||$.startsWith("[")&&$.endsWith("]");var FQ=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),m0=($,w=!1)=>{if(!w)return FQ.test($);const U=$.split(".");for(let G of U)if(!m0(G))return!1;return!0};var i0={};var t="endpoints";function u($){if(typeof $!=="object"||$==null)return $;if("ref"in $)return`\$${u($.ref)}`;if("fn"in $)return`${$.fn}(${($.argv||[]).map(u).join(", ")})`;return JSON.stringify($,null,2)}class V extends Error{constructor($){super($);this.name="EndpointError"}}var Z4=($,w)=>$===w;var F4=($)=>{const w=$.split("."),U=[];for(let G of w){const f=G.indexOf("[");if(f!==-1){if(G.indexOf("]")!==G.length-1)throw new V(`Path: '${$}' does not end with ']'`);const W=G.slice(f+1,-1);if(Number.isNaN(parseInt(W)))throw new V(`Invalid array index: '${W}' in path: '${$}'`);if(f!==0)U.push(G.slice(0,f));U.push(W)}else U.push(G)}return U};var c1=($,w)=>F4(w).reduce((U,G)=>{if(typeof U!=="object")throw new V(`Index '${G}' in '${w}' not found in '${JSON.stringify($)}'`);else if(Array.isArray(U))return U[parseInt(G)];return U[G]},$);var Y4=($)=>$!=null;var I4=($)=>!$;var v1=l(M0(),1);var zw={[v1.EndpointURLScheme.HTTP]:80,[v1.EndpointURLScheme.HTTPS]:443},z4=($)=>{const w=(()=>{try{if($ instanceof URL)return $;if(typeof $==="object"&&"hostname"in $){const{hostname:Q,port:z,protocol:E="",path:J="",query:O={}}=$,K=new URL(`${E}//${Q}${z?`:${z}`:""}${J}`);return K.search=Object.entries(O).map(([A,B])=>`${A}=${B}`).join("&"),K}return new URL($)}catch(Q){return null}})();if(!w)return console.error(`Unable to parse ${JSON.stringify($)} as a whatwg URL.`),null;const U=w.href,{host:G,hostname:f,pathname:W,protocol:L,search:X}=w;if(X)return null;const Z=L.slice(0,-1);if(!Object.values(v1.EndpointURLScheme).includes(Z))return null;const F=s0(f),Y=U.includes(`${G}:${zw[Z]}`)||typeof $==="string"&&$.includes(`${G}:${zw[Z]}`),I=`${G}${Y?`:${zw[Z]}`:""}`;return{scheme:Z,authority:I,path:W,normalizedPath:W.endsWith("/")?W:`${W}/`,isIp:F}};var Q4=($,w)=>$===w;var E4=($,w,U,G)=>{if(w>=U||$.length<U)return null;if(!G)return $.substring(w,U);return $.substring($.length-U,$.length-w)};var R4=($)=>encodeURIComponent($).replace(/[!*'()]/g,(w)=>`%${w.charCodeAt(0).toString(16).toUpperCase()}`);var M4={booleanEquals:Z4,getAttr:c1,isSet:Y4,isValidHostLabel:m0,not:I4,parseURL:z4,stringEquals:Q4,substring:E4,uriEncode:R4};var y1=($,w)=>{const U=[],G={...w.endpointParams,...w.referenceRecord};let f=0;while(f<$.length){const W=$.indexOf("{",f);if(W===-1){U.push($.slice(f));break}U.push($.slice(f,W));const L=$.indexOf("}",W);if(L===-1){U.push($.slice(W));break}if($[W+1]==="{"&&$[L+1]==="}")U.push($.slice(W+1,L)),f=L+2;const X=$.substring(W+1,L);if(X.includes("#")){const[Z,F]=X.split("#");U.push(c1(G[Z],F))}else U.push(G[X]);f=L+1}return U.join("")};var J4=({ref:$},w)=>{return{...w.endpointParams,...w.referenceRecord}[$]};var U0=($,w,U)=>{if(typeof $==="string")return y1($,U);else if($.fn)return x1($,U);else if($.ref)return J4($,U);throw new V(`'${w}': ${String($)} is not a string, function or reference.`)};var x1=({fn:$,argv:w},U)=>{const G=w.map((W)=>["boolean","number"].includes(typeof W)?W:U0(W,"arg",U)),f=$.split(".");if(f[0]in i0&&f[1]!=null)return i0[f[0]][f[1]](...G);return M4[$](...G)};var K4=({assign:$,...w},U)=>{if($&&$ in U.referenceRecord)throw new V(`'${$}' is already defined in Reference Record.`);const G=x1(w,U);return U.logger?.debug?.(`${t} evaluateCondition: ${u(w)} = ${u(G)}`),{result:G===""?!0:!!G,...$!=null&&{toAssign:{name:$,value:G}}}};var C0=($=[],w)=>{const U={};for(let G of $){const{result:f,toAssign:W}=K4(G,{...w,referenceRecord:{...w.referenceRecord,...U}});if(!f)return{result:f};if(W)U[W.name]=W.value,w.logger?.debug?.(`${t} assign: ${W.name} := ${u(W.value)}`)}return{result:!0,referenceRecord:U}};var A4=($,w)=>Object.entries($).reduce((U,[G,f])=>({...U,[G]:f.map((W)=>{const L=U0(W,"Header value entry",w);if(typeof L!=="string")throw new V(`Header '${G}' value '${L}' is not a string`);return L})}),{});var Qw=($,w)=>{if(Array.isArray($))return $.map((U)=>Qw(U,w));switch(typeof $){case"string":return y1($,w);case"object":if($===null)throw new V(`Unexpected endpoint property: ${$}`);return u1($,w);case"boolean":return $;default:throw new V(`Unexpected endpoint property type: ${typeof $}`)}};var u1=($,w)=>Object.entries($).reduce((U,[G,f])=>({...U,[G]:Qw(f,w)}),{});var O4=($,w)=>{const U=U0($,"Endpoint URL",w);if(typeof U==="string")try{return new URL(U)}catch(G){throw console.error(`Failed to construct URL with ${U}`,G),G}throw new V(`Endpoint URL must be a string, got ${typeof U}`)};var B4=($,w)=>{const{conditions:U,endpoint:G}=$,{result:f,referenceRecord:W}=C0(U,w);if(!f)return;const L={...w,referenceRecord:{...w.referenceRecord,...W}},{url:X,properties:Z,headers:F}=G;return w.logger?.debug?.(`${t} Resolving endpoint from template: ${u(G)}`),{...F!=null&&{headers:A4(F,L)},...Z!=null&&{properties:u1(Z,L)},url:O4(X,L)}};var V4=($,w)=>{const{conditions:U,error:G}=$,{result:f,referenceRecord:W}=C0(U,w);if(!f)return;throw new V(U0(G,"Error",{...w,referenceRecord:{...w.referenceRecord,...W}}))};var T4=($,w)=>{const{conditions:U,rules:G}=$,{result:f,referenceRecord:W}=C0(U,w);if(!f)return;return _1(G,{...w,referenceRecord:{...w.referenceRecord,...W}})};var _1=($,w)=>{for(let U of $)if(U.type==="endpoint"){const G=B4(U,w);if(G)return G}else if(U.type==="error")V4(U,w);else if(U.type==="tree"){const G=T4(U,w);if(G)return G}else throw new V(`Unknown endpoint rule: ${U}`);throw new V("Rules evaluation failed")};var YQ=($,w)=>{const{endpointParams:U,logger:G}=w,{parameters:f,rules:W}=$;w.logger?.debug?.(`${t} Initial EndpointParams: ${u(U)}`);const L=Object.entries(f).filter(([,F])=>F.default!=null).map(([F,Y])=>[F,Y.default]);if(L.length>0)for(let[F,Y]of L)U[F]=U[F]??Y;const X=Object.entries(f).filter(([,F])=>F.required).map(([F])=>F);for(let F of X)if(U[F]==null)throw new V(`Missing required parameter: '${F}'`);const Z=_1(W,{endpointParams:U,logger:G,referenceRecord:{}});if(w.endpointParams?.Endpoint)try{const F=new URL(w.endpointParams.Endpoint),{protocol:Y,port:I}=F;Z.url.protocol=Y,Z.url.port=I}catch(F){}return w.logger?.debug?.(`${t} Resolved endpoint: ${u(Z)}`),Z};var Ew=($,w=!1)=>{if(w){for(let U of $.split("."))if(!Ew(U))return!1;return!0}if(!m0($))return!1;if($.length<3||$.length>63)return!1;if($!==$.toLowerCase())return!1;if(s0($))return!1;return!0};var H4=($)=>{const w=$.split(":");if(w.length<6)return null;const[U,G,f,W,L,...X]=w;if(U!=="arn"||G===""||f===""||X[0]==="")return null;return{partition:G,service:f,region:W,accountId:L,resourceId:X[0].includes("/")?X[0].split("/"):X}};var C4={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)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"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)"},"aws-global":{description:"AWS Standard 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)"},"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 China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{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 GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) 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:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],version:"1.1"};var zQ=C4,QQ="",N4=($)=>{const{partitions:w}=zQ;for(let G of w){const{regions:f,outputs:W}=G;for(let[L,X]of Object.entries(f))if(L===$)return{...W,...X}}for(let G of w){const{regionRegex:f,outputs:W}=G;if(new RegExp(f).test($))return{...W}}const U=w.find((G)=>G.id==="aws");if(!U)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...U.outputs}};var q4=()=>QQ;var EQ={isVirtualHostableS3Bucket:Ew,parseArn:H4,partition:N4};i0.aws=EQ;var Rw="user-agent",d1="x-amz-user-agent",Mw=" ",p1="/",j4=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,P4=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,Jw="-";var RQ=($)=>(w,U)=>async(G)=>{const{request:f}=G;if(!y.isInstance(f))return w(G);const{headers:W}=f,L=U?.userAgent?.map(Kw)||[],X=(await $.defaultUserAgentProvider()).map(Kw),Z=$?.customUserAgent?.map(Kw)||[],F=q4(),Y=(F?[F]:[]).concat([...X,...L,...Z]).join(Mw),I=[...X.filter((Q)=>Q.startsWith("aws-sdk-")),...Z].join(Mw);if($.runtime!=="browser"){if(I)W[d1]=W[d1]?`${W[Rw]} ${I}`:I;W[Rw]=Y}else W[d1]=Y;return w({...G,request:f})},Kw=($)=>{const w=$[0].split(p1).map((L)=>L.replace(j4,Jw)).join(p1),U=$[1]?.replace(P4,Jw),G=w.indexOf(p1),f=w.substring(0,G);let W=w.substring(G+1);if(f==="api")W=W.toLowerCase();return[f,W,U].filter((L)=>L&&L.length>0).reduce((L,X,Z)=>{switch(Z){case 0:return X;case 1:return`${L}/${X}`;default:return`${L}#${X}`}},"")},MQ={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},y3=($)=>({applyToStack:(w)=>{w.add(RQ($),MQ)}});var g1=($)=>typeof $==="string"&&($.startsWith("fips-")||$.endsWith("-fips"));var Aw=($)=>g1($)?["fips-aws-global","aws-fips"].includes($)?"us-east-1":$.replace(/fips-(dkr-|prod-)?|-fips/,""):$;var m3=($)=>{const{region:w,useFipsEndpoint:U}=$;if(!w)throw new Error("Region is missing");return{...$,region:async()=>{if(typeof w==="string")return Aw(w);const G=await w();return Aw(G)},useFipsEndpoint:async()=>{const G=typeof w==="string"?w:await w();if(g1(G))return!0;return typeof U!=="function"?Promise.resolve(!!U):U()}}};var N0=($,w,U)=>{if(!(w in $))return;if($[w]==="true")return!0;if($[w]==="false")return!1;throw new Error(`Cannot load ${U} "${w}". Expected "true" or "false", got ${$[w]}.`)};var f0;(function($){$.ENV="env",$.CONFIG="shared config entry"})(f0||(f0={}));var JQ="AWS_USE_DUALSTACK_ENDPOINT",KQ="use_dualstack_endpoint";var fK={environmentVariableSelector:($)=>N0($,JQ,f0.ENV),configFileSelector:($)=>N0($,KQ,f0.CONFIG),default:!1};var AQ="AWS_USE_FIPS_ENDPOINT",OQ="use_fips_endpoint";var LK={environmentVariableSelector:($)=>N0($,AQ,f0.ENV),configFileSelector:($)=>N0($,OQ,f0.CONFIG),default:!1};var BQ=l(s(),1);var VQ=l(s(),1);var S4={environmentVariableSelector:($)=>$["AWS_REGION"],configFileSelector:($)=>$["region"],default:()=>{throw new Error("Region is missing")}},KK={preferredFile:"credentials"};function TQ($){return(w)=>async(U)=>{const G=U.request;if(y.isInstance(G)){const{body:f,headers:W}=G;if(f&&Object.keys(W).map((L)=>L.toLowerCase()).indexOf(b4)===-1)try{const L=$(f);G.headers={...G.headers,[b4]:String(L)}}catch(L){}}return w({...U,request:G})}}var b4="content-length",HQ={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},nK=($)=>({applyToStack:(w)=>{w.add(TQ($.bodyLengthChecker),HQ)}});var h4=($,w)=>(U)=>async(G)=>{const{response:f}=await U(G);try{const W=await w(f,$);return{response:f,output:W}}catch(W){if(Object.defineProperty(W,"$response",{value:f}),!("$metadata"in W)){if(W.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof W.$responseBodyText!=="undefined"){if(W.$response)W.$response.body=W.$responseBodyText}}throw W}};var D4=($,w)=>(U,G)=>async(f)=>{const W=G.endpointV2?.url&&$.urlParser?async()=>$.urlParser(G.endpointV2.url):$.endpoint;if(!W)throw new Error("No valid endpoint provider available.");const L=await w(f.input,{...$,endpoint:W});return U({...f,request:L})};function aK($,w,U){return{applyToStack:(G)=>{G.add(h4($,U),CQ),G.add(D4($,w),Ow)}}}var CQ={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Ow={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};var d4=l(s(),1);var k4=async($)=>{const w=$?.Bucket||"";if(typeof $.Bucket==="string")$.Bucket=w.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(SQ(w)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!PQ(w)||w.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||w.toLowerCase()!==w||w.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},NQ=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,qQ=/(\d+\.){3}\d+/,jQ=/\.\./;var PQ=($)=>NQ.test($)&&!qQ.test($)&&!jQ.test($),SQ=($)=>{const[w,U,G,,,f]=$.split(":"),W=w==="arn"&&$.split(":").length>=6,L=Boolean(W&&U&&G&&f);if(W&&!L)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return L};var c4=($,w,U)=>{const G=async()=>{const f=U[$]??U[w];if(typeof f==="function")return f();return f};if($==="credentialScope"||w==="CredentialScope")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return f?.credentialScope??f?.CredentialScope};if($==="accountId"||w==="AccountId")return async()=>{const f=typeof U.credentials==="function"?await U.credentials():U.credentials;return f?.accountId??f?.AccountId};if($==="endpoint"||w==="endpoint")return async()=>{const f=await G();if(f&&typeof f==="object"){if("url"in f)return f.url.href;if("hostname"in f){const{protocol:W,hostname:L,port:X,path:Z}=f;return`${W}//${L}${X?":"+X:""}${Z}`}}return f};return G};var v4="AWS_ENDPOINT_URL",y4="endpoint_url",x4=($)=>({environmentVariableSelector:(w)=>{const U=$.split(" ").map((W)=>W.toUpperCase()),G=w[[v4,...U].join("_")];if(G)return G;const f=w[v4];if(f)return f;return},configFileSelector:(w,U)=>{if(U&&w.services){const f=U[["services",w.services].join(Bw)];if(f){const W=$.split(" ").map((X)=>X.toLowerCase()),L=f[[W.join("_"),y4].join(Bw)];if(L)return L}}const G=w[y4];if(G)return G;return},default:void 0});var u4=async($)=>I0(x4($))();var l1=($)=>{if(typeof $==="object"){if("url"in $)return Vw($.url);return $}return Vw($)};var _4=async($,w,U,G)=>{if(!U.endpoint){const L=await u4(U.serviceId||"");if(L)U.endpoint=()=>Promise.resolve(l1(L))}const f=await bQ($,w,U);if(typeof U.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return U.endpointProvider(f,G)},bQ=async($,w,U)=>{const G={},f=w?.getEndpointParameterInstructions?.()||{};for(let[W,L]of Object.entries(f))switch(L.type){case"staticContextParams":G[W]=L.value;break;case"contextParams":G[W]=$[L.name];break;case"clientContextParams":case"builtInParams":G[W]=await c4(L.name,W,U)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(L))}if(Object.keys(f).length===0)Object.assign(G,U);if(String(U.serviceId).toLowerCase()==="s3")await k4(G);return G};var p4=({config:$,instructions:w})=>{return(U,G)=>async(f)=>{const W=await _4(f.input,{getEndpointParameterInstructions(){return w}},{...$},G);G.endpointV2=W,G.authSchemes=W.properties?.authSchemes;const L=G.authSchemes?.[0];if(L){G.signing_region=L.signingRegion,G.signing_service=L.signingName;const Z=d4.getSmithyContext(G)?.selectedHttpAuthScheme?.httpAuthOption;if(Z)Z.signingProperties=Object.assign(Z.signingProperties||{},{signing_region:L.signingRegion,signingRegion:L.signingRegion,signing_service:L.signingName,signingName:L.signingName,signingRegionSet:L.signingRegionSet},L.properties)}return U({...f})}};var hQ={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Ow.name},TA=($,w)=>({applyToStack:(U)=>{U.addRelativeTo(p4({config:$,instructions:w}),hQ)}});var n1=l(s(),1);var NA=($)=>{const w=$.tls??!0,{endpoint:U}=$,G=U!=null?async()=>l1(await n1.normalizeProvider(U)()):void 0;return{...$,endpoint:G,tls:w,isCustomEndpoint:!!U,useDualstackEndpoint:n1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:n1.normalizeProvider($.useFipsEndpoint??!1)}};var i=l(P$(),1),yA=i.default.v1,xA=i.default.v3,g4=i.default.v4,uA=i.default.v5,_A=i.default.NIL,dA=i.default.version,pA=i.default.validate,gA=i.default.stringify,lA=i.default.parse;var Pw=l(s(),1);var n;(function($){$.STANDARD="standard",$.ADAPTIVE="adaptive"})(n||(n={}));var z0=3,l4=n.STANDARD;var n4=l(Z0(),1);class s1{constructor($){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=$?.beta??0.7,this.minCapacity=$?.minCapacity??1,this.minFillRate=$?.minFillRate??0.5,this.scaleConstant=$?.scaleConstant??0.4,this.smooth=$?.smooth??0.8;const w=this.getCurrentTimeInSeconds();this.lastThrottleTime=w,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket($){if(!this.enabled)return;if(this.refillTokenBucket(),$>this.currentCapacity){const w=($-this.currentCapacity)/this.fillRate*1000;await new Promise((U)=>setTimeout(U,w))}this.currentCapacity=this.currentCapacity-$}refillTokenBucket(){const $=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=$;return}const w=($-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+w),this.lastTimestamp=$}updateClientSendingRate($){let w;if(this.updateMeasuredRate(),n4.isThrottlingError($)){const G=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=G,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),w=this.cubicThrottle(G),this.enableTokenBucket()}else this.calculateTimeWindow(),w=this.cubicSuccess(this.getCurrentTimeInSeconds());const U=Math.min(w,2*this.measuredTxRate);this.updateTokenBucketRate(U)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle($){return this.getPrecise($*this.beta)}cubicSuccess($){return this.getPrecise(this.scaleConstant*Math.pow($-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate($){this.refillTokenBucket(),this.fillRate=Math.max($,this.minFillRate),this.maxCapacity=Math.max($,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const $=this.getCurrentTimeInSeconds(),w=Math.floor($*2)/2;if(this.requestCount++,w>this.lastTxRateBucket){const U=this.requestCount/(w-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(U*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=w}}getPrecise($){return parseFloat($.toFixed(8))}}var Q0=100,r0=20000,Tw=500,m1=500,Hw=5,Cw=10,Nw=1,i1="amz-sdk-invocation-id",r1="amz-sdk-request";var s4=()=>{let $=Q0;return{computeNextBackoffDelay:(G)=>{return Math.floor(Math.min(r0,Math.random()*2**G*$))},setDelayBase:(G)=>{$=G}}};var qw=({retryDelay:$,retryCount:w,retryCost:U})=>{return{getRetryCount:()=>w,getRetryDelay:()=>Math.min(r0,$),getRetryCost:()=>U}};class q0{constructor($){this.maxAttempts=$,this.mode=n.STANDARD,this.capacity=m1,this.retryBackoffStrategy=s4(),this.maxAttemptsProvider=typeof $==="function"?$:async()=>$}async acquireInitialRetryToken($){return qw({retryDelay:Q0,retryCount:0})}async refreshRetryTokenForRetry($,w){const U=await this.getMaxAttempts();if(this.shouldRetry($,w,U)){const G=w.errorType;this.retryBackoffStrategy.setDelayBase(G==="THROTTLING"?Tw:Q0);const f=this.retryBackoffStrategy.computeNextBackoffDelay($.getRetryCount()),W=w.retryAfterHint?Math.max(w.retryAfterHint.getTime()-Date.now()||0,f):f,L=this.getCapacityCost(G);return this.capacity-=L,qw({retryDelay:W,retryCount:$.getRetryCount()+1,retryCost:L})}throw new Error("No retry token available")}recordSuccess($){this.capacity=Math.max(m1,this.capacity+($.getRetryCost()??Nw))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch($){return console.warn(`Max attempts provider could not resolve. Using default of ${z0}`),z0}}shouldRetry($,w,U){return $.getRetryCount()+1<U&&this.capacity>=this.getCapacityCost(w.errorType)&&this.isRetryableError(w.errorType)}getCapacityCost($){return $==="TRANSIENT"?Cw:Hw}isRetryableError($){return $==="THROTTLING"||$==="TRANSIENT"}}class jw{constructor($,w){this.maxAttemptsProvider=$,this.mode=n.ADAPTIVE;const{rateLimiter:U}=w??{};this.rateLimiter=U??new s1,this.standardRetryStrategy=new q0($)}async acquireInitialRetryToken($){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken($)}async refreshRetryTokenForRetry($,w){return this.rateLimiter.updateClientSendingRate(w),this.standardRetryStrategy.refreshRetryTokenForRetry($,w)}recordSuccess($){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess($)}}var m4="AWS_MAX_ATTEMPTS",i4="max_attempts",OO={environmentVariableSelector:($)=>{const w=$[m4];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Environment variable ${m4} mast be a number, got "${w}"`);return U},configFileSelector:($)=>{const w=$[i4];if(!w)return;const U=parseInt(w);if(Number.isNaN(U))throw new Error(`Shared config file entry ${i4} mast be a number, got "${w}"`);return U},default:z0},BO=($)=>{const{retryStrategy:w}=$,U=Pw.normalizeProvider($.maxAttempts??z0);return{...$,maxAttempts:U,retryStrategy:async()=>{if(w)return w;if(await Pw.normalizeProvider($.retryMode)()===n.ADAPTIVE)return new jw(U);return new q0(U)}}},DQ="AWS_RETRY_MODE",kQ="retry_mode",VO={environmentVariableSelector:($)=>$[DQ],configFileSelector:($)=>$[kQ],default:l4};var j0=l(Z0(),1);import{Readable as cQ} from"stream";var r4=($)=>$?.body instanceof cQ||typeof ReadableStream!=="undefined"&&$?.body instanceof ReadableStream;var Sw=($)=>{if($ instanceof Error)return $;if($ instanceof Object)return Object.assign(new Error,$);if(typeof $==="string")return new Error($);return new Error(`AWS SDK error wrapper for ${$}`)};var vQ=($)=>(w,U)=>async(G)=>{let f=await $.retryStrategy();const W=await $.maxAttempts();if(yQ(f)){f=f;let L=await f.acquireInitialRetryToken(U.partition_id),X=new Error,Z=0,F=0;const{request:Y}=G,I=y.isInstance(Y);if(I)Y.headers[i1]=g4();while(!0)try{if(I)Y.headers[r1]=`attempt=${Z+1}; max=${W}`;const{response:Q,output:z}=await w(G);return f.recordSuccess(L),z.$metadata.attempts=Z+1,z.$metadata.totalRetryDelay=F,{response:Q,output:z}}catch(Q){const z=xQ(Q);if(X=Sw(Q),I&&r4(Y))throw(U.logger instanceof o4?console:U.logger)?.warn("An error was encountered in a non-retryable streaming request."),X;try{L=await f.refreshRetryTokenForRetry(L,z)}catch(J){if(!X.$metadata)X.$metadata={};throw X.$metadata.attempts=Z+1,X.$metadata.totalRetryDelay=F,X}Z=L.getRetryCount();const E=L.getRetryDelay();F+=E,await new Promise((J)=>setTimeout(J,E))}}else{if(f=f,f?.mode)U.userAgent=[...U.userAgent||[],["cfg/retry-mode",f.mode]];return f.retry(w,G)}},yQ=($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined",xQ=($)=>{const w={error:$,errorType:uQ($)},U=dQ($.$response);if(U)w.retryAfterHint=U;return w},uQ=($)=>{if(j0.isThrottlingError($))return"THROTTLING";if(j0.isTransientError($))return"TRANSIENT";if(j0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},_Q={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},DO=($)=>({applyToStack:(w)=>{w.add(vQ($),_Q)}}),dQ=($)=>{if(!bw.isInstance($))return;const w=Object.keys($.headers).find((W)=>W.toLowerCase()==="retry-after");if(!w)return;const U=$.headers[w],G=Number(U);if(!Number.isNaN(G))return new Date(G*1000);return new Date(U)};var pQ=l(Z0(),1);var o1=l(Z0(),1);import{platform as bE,release as hE} from"os";import{env as n6,versions as DE} from"process";var mw={isCrtAvailable:!1};var l6=()=>{if(mw.isCrtAvailable)return["md/crt-avail"];return null};var kE="AWS_SDK_UA_APP_ID",cE="sdk-ua-app-id",vB=({serviceId:$,clientVersion:w})=>{const U=[["aws-sdk-js",w],["ua","2.0"],[`os/${bE()}`,hE()],["lang/js"],["md/nodejs",`${DE.node}`]],G=l6();if(G)U.push(G);if($)U.push([`api/${$}`,w]);if(n6.AWS_EXECUTION_ENV)U.push([`exec-env/${n6.AWS_EXECUTION_ENV}`]);const f=I0({environmentVariableSelector:(L)=>L[kE],configFileSelector:(L)=>L[cE],default:void 0})();let W=void 0;return async()=>{if(!W){const L=await f;W=L?[...U,[`app/${L}`]]:[...U]}return W}};import{Buffer as vE} from"buffer";import{createHash as yE,createHmac as xE} from"crypto";var s6=function($,w){if(vE.isBuffer($))return $;if(typeof $==="string")return m6($,w);if(ArrayBuffer.isView($))return iw($.buffer,$.byteOffset,$.byteLength);return iw($)};class uE{constructor($,w){this.algorithmIdentifier=$,this.secret=w,this.reset()}update($,w){this.hash.update(i6(s6($,w)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?xE(this.algorithmIdentifier,s6(this.secret)):yE(this.algorithmIdentifier)}}import{fstatSync as _E,lstatSync as dE} from"fs";var nB=($)=>{if(!$)return 0;if(typeof $==="string")return Buffer.byteLength($);else if(typeof $.byteLength==="number")return $.byteLength;else if(typeof $.size==="number")return $.size;else if(typeof $.start==="number"&&typeof $.end==="number")return $.end+1-$.start;else if(typeof $.path==="string"||Buffer.isBuffer($.path))return dE($.path).size;else if(typeof $.fd==="number")return _E($.fd).size;throw new Error(`Body Length computation failed for ${$}`)};var r6="AWS_EXECUTION_ENV",rw="AWS_REGION",ow="AWS_DEFAULT_REGION",o6="AWS_EC2_METADATA_DISABLED",a6=["in-region","cross-region","mobile","standard","legacy"],t6="/latest/meta-data/placement/region";var e6={environmentVariableSelector:($)=>{return $["AWS_DEFAULTS_MODE"]},configFileSelector:($)=>{return $["defaults_mode"]},default:"legacy"};var UV=({region:$=I0(S4),defaultsMode:w=I0(e6)}={})=>$X(async()=>{const U=typeof w==="function"?await w():w;switch(U?.toLowerCase()){case"auto":return pE($);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(U?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${a6.join(", ")}, got ${U}`)}}),pE=async($)=>{if($){const w=typeof $==="function"?await $():$,U=await gE();if(!U)return"standard";if(w===U)return"in-region";else return"cross-region"}return"standard"},gE=async()=>{if(process.env[r6]&&(process.env[rw]||process.env[ow]))return process.env[rw]??process.env[ow];if(!process.env[o6])try{const{getInstanceMetadataEndpoint:$,httpRequest:w}=await import("./chunk-322e991c2b56a79d.js"),U=await $();return(await w({...U,path:t6})).toString()}catch($){}};var LV=($)=>{let w=async()=>{if($.region===void 0)throw new Error("Region is missing from runtimeConfig");const U=$.region;if(typeof U==="string")return U;return U()};return{setRegion(U){w=U},region(){return w}}},XV=($)=>{return{region:$.region()}};export{sE as ya,mE as za,rE as Aa,$R as Ba,s as Ca,N0 as Da,f0 as Ea,Iw as Fa,GM as Ga,i0 as Ha,YQ as Ia,EQ as Ja,y3 as Ka,fK as La,LK as Ma,S4 as Na,KK as Oa,m3 as Pa,nK as Qa,bQ as Ra,aK as Sa,TA as Ta,NA as Ua,l4 as Va,g4 as Wa,OO as Xa,BO as Ya,VO as Za,DO as _a,HL as $a,SE as ab,vB as bb,uE as cb,nB as db,UV as eb,LV as fb,XV as gb};