gemi 0.4.113 → 0.4.114

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.
Files changed (58) hide show
  1. package/dist/app/index.js +1 -1
  2. package/dist/chunk-66tgc8cz.js +11 -0
  3. package/dist/{chunk-9txn8acf.js.map → chunk-66tgc8cz.js.map} +5 -5
  4. package/dist/chunk-67hdbhpe.js +4 -0
  5. package/dist/{chunk-bhxyhsqr.js.map → chunk-67hdbhpe.js.map} +4 -4
  6. package/dist/{chunk-rb7jfsvq.js → chunk-6mhs44ws.js} +2 -2
  7. package/dist/{chunk-rb7jfsvq.js.map → chunk-6mhs44ws.js.map} +1 -1
  8. package/dist/chunk-7461c8cq.js +5 -0
  9. package/dist/{chunk-2p10c4kh.js.map → chunk-7461c8cq.js.map} +4 -4
  10. package/dist/chunk-9gjnqk62.js +4 -0
  11. package/dist/{chunk-fc27f4cb.js.map → chunk-9gjnqk62.js.map} +2 -2
  12. package/dist/chunk-9n1nx7hm.js +4 -0
  13. package/dist/{chunk-yec7wnh4.js.map → chunk-9n1nx7hm.js.map} +4 -4
  14. package/dist/chunk-amata1t8.js +4 -0
  15. package/dist/{chunk-tr7zwxhw.js.map → chunk-amata1t8.js.map} +6 -6
  16. package/dist/chunk-cegxr8pr.js +4 -0
  17. package/dist/{chunk-11azhtfq.js.map → chunk-cegxr8pr.js.map} +5 -5
  18. package/dist/{chunk-tqey3r3k.js → chunk-g9trvvh2.js} +2 -2
  19. package/dist/{chunk-tqey3r3k.js.map → chunk-g9trvvh2.js.map} +1 -1
  20. package/dist/chunk-m8wz6y7g.js +8 -0
  21. package/dist/{chunk-tpdm7nax.js.map → chunk-m8wz6y7g.js.map} +2 -2
  22. package/dist/chunk-mmjscn0a.js +4 -0
  23. package/dist/{chunk-bn6dtgj4.js.map → chunk-mmjscn0a.js.map} +2 -2
  24. package/dist/chunk-tvs08p0g.js +3 -0
  25. package/dist/chunk-tvs08p0g.js.map +15 -0
  26. package/dist/chunk-xqjmzvvq.js +20 -0
  27. package/dist/{chunk-8mtrpdem.js.map → chunk-xqjmzvvq.js.map} +11 -6
  28. package/dist/{chunk-3ndk6f56.js → chunk-xy2tg7pf.js} +2 -2
  29. package/dist/{chunk-3ndk6f56.js.map → chunk-xy2tg7pf.js.map} +5 -5
  30. package/dist/chunk-yq29sh4p.js +4 -0
  31. package/dist/{chunk-mvmwz99e.js.map → chunk-yq29sh4p.js.map} +5 -5
  32. package/dist/chunk-z5ahmk6p.js +4 -0
  33. package/dist/{chunk-pd22hcnn.js.map → chunk-z5ahmk6p.js.map} +5 -5
  34. package/dist/chunk-z9vdyw9v.js +4 -0
  35. package/dist/{chunk-x2f9x5m1.js.map → chunk-z9vdyw9v.js.map} +2 -2
  36. package/dist/http/index.js +2 -2
  37. package/dist/http/index.js.map +3 -3
  38. package/dist/kernel/index.js +1 -1
  39. package/dist/services/index.js +11 -2
  40. package/dist/services/index.js.map +16 -5
  41. package/package.json +1 -1
  42. package/dist/chunk-11azhtfq.js +0 -4
  43. package/dist/chunk-2p10c4kh.js +0 -5
  44. package/dist/chunk-8mtrpdem.js +0 -20
  45. package/dist/chunk-9txn8acf.js +0 -11
  46. package/dist/chunk-bhxyhsqr.js +0 -4
  47. package/dist/chunk-bn6dtgj4.js +0 -4
  48. package/dist/chunk-cj78pfaa.js +0 -4
  49. package/dist/chunk-cj78pfaa.js.map +0 -10
  50. package/dist/chunk-fc27f4cb.js +0 -4
  51. package/dist/chunk-mvmwz99e.js +0 -4
  52. package/dist/chunk-pd22hcnn.js +0 -4
  53. package/dist/chunk-tpdm7nax.js +0 -8
  54. package/dist/chunk-tr7zwxhw.js +0 -4
  55. package/dist/chunk-x2f9x5m1.js +0 -4
  56. package/dist/chunk-yec7wnh4.js +0 -4
  57. /package/dist/{chunk-25y8fca8.js → chunk-ryhfg3pa.js} +0 -0
  58. /package/dist/{chunk-25y8fca8.js.map → chunk-ryhfg3pa.js.map} +0 -0
@@ -0,0 +1,20 @@
1
+ import{I as V$,J as M}from"./chunk-td079vg9.js";import{U as PI}from"./chunk-wfc30gdx.js";import{Ha as y,Ia as vU,Ka as tU,La as hL,Na as xL,Pa as FZ,Xa as y6}from"./chunk-7461c8cq.js";import{Bb as Q0}from"./chunk-6mhs44ws.js";import{Cb as K0,Db as jU}from"./chunk-z5ahmk6p.js";import{Jb as dL}from"./chunk-tvs08p0g.js";import{Pb as NU}from"./chunk-g9trvvh2.js";var F$=M((UG)=>{function lL($){return $&&$.__esModule?$:{default:$}}function sL(){if(W1>X1.length-16)pL.default.randomFillSync(X1),W1=0;return X1.slice(W1,W1+=16)}Object.defineProperty(UG,"__esModule",{value:!0});UG.default=sL;var pL=lL(import.meta.require("crypto")),X1=new Uint8Array(256),W1=X1.length});var XG=M((GG)=>{Object.defineProperty(GG,"__esModule",{value:!0});GG.default=void 0;var nL=/^(?:[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;GG.default=nL});var k0=M((ZG)=>{function rL($){return $&&$.__esModule?$:{default:$}}function oL($){return typeof $==="string"&&iL.default.test($)}Object.defineProperty(ZG,"__esModule",{value:!0});ZG.default=void 0;var iL=rL(XG()),aL=oL;ZG.default=aL});var h0=M((wG)=>{function eL($){return $&&$.__esModule?$:{default:$}}function YG($,U=0){return b[$[U+0]]+b[$[U+1]]+b[$[U+2]]+b[$[U+3]]+"-"+b[$[U+4]]+b[$[U+5]]+"-"+b[$[U+6]]+b[$[U+7]]+"-"+b[$[U+8]]+b[$[U+9]]+"-"+b[$[U+10]]+b[$[U+11]]+b[$[U+12]]+b[$[U+13]]+b[$[U+14]]+b[$[U+15]]}function $5($,U=0){const G=YG($,U);if(!tL.default(G))throw TypeError("Stringified UUID is invalid");return G}Object.defineProperty(wG,"__esModule",{value:!0});wG.default=void 0;wG.unsafeStringify=YG;var tL=eL(k0()),b=[];for(let $=0;$<256;++$)b.push(($+256).toString(16).slice(1));var U5=$5;wG.default=U5});var JG=M((FG)=>{function Z5($){return $&&$.__esModule?$:{default:$}}function L5($,U,G){let W=U&&G||0;const X=U||new Array(16);$=$||{};let Z=$.node||zG,L=$.clockseq!==void 0?$.clockseq:R$;if(Z==null||L==null){const R=$.random||($.rng||W5.default)();if(Z==null)Z=zG=[R[0]|1,R[1],R[2],R[3],R[4],R[5]];if(L==null)L=R$=(R[6]<<8|R[7])&16383}let Y=$.msecs!==void 0?$.msecs:Date.now(),w=$.nsecs!==void 0?$.nsecs:I$+1;const Q=Y-J$+(w-I$)/1e4;if(Q<0&&$.clockseq===void 0)L=L+1&16383;if((Q<0||Y>J$)&&$.nsecs===void 0)w=0;if(w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");J$=Y,I$=w,R$=L,Y+=12219292800000;const z=((Y&268435455)*1e4+w)%4294967296;X[W++]=z>>>24&255,X[W++]=z>>>16&255,X[W++]=z>>>8&255,X[W++]=z&255;const F=Y/4294967296*1e4&268435455;X[W++]=F>>>8&255,X[W++]=F&255,X[W++]=F>>>24&15|16,X[W++]=F>>>16&255,X[W++]=L>>>8|128,X[W++]=L&255;for(let R=0;R<6;++R)X[W+R]=Z[R];return U||X5.unsafeStringify(X)}Object.defineProperty(FG,"__esModule",{value:!0});FG.default=void 0;var W5=Z5(F$()),X5=h0(),zG,R$,J$=0,I$=0,Y5=L5;FG.default=Y5});var K$=M((IG)=>{function Q5($){return $&&$.__esModule?$:{default:$}}function z5($){if(!w5.default($))throw TypeError("Invalid UUID");let U;const G=new Uint8Array(16);return G[0]=(U=parseInt($.slice(0,8),16))>>>24,G[1]=U>>>16&255,G[2]=U>>>8&255,G[3]=U&255,G[4]=(U=parseInt($.slice(9,13),16))>>>8,G[5]=U&255,G[6]=(U=parseInt($.slice(14,18),16))>>>8,G[7]=U&255,G[8]=(U=parseInt($.slice(19,23),16))>>>8,G[9]=U&255,G[10]=(U=parseInt($.slice(24,36),16))/1099511627776&255,G[11]=U/4294967296&255,G[12]=U>>>24&255,G[13]=U>>>16&255,G[14]=U>>>8&255,G[15]=U&255,G}Object.defineProperty(IG,"__esModule",{value:!0});IG.default=void 0;var w5=Q5(k0()),F5=z5;IG.default=F5});var M$=M((VG)=>{function I5($){return $&&$.__esModule?$:{default:$}}function K5($){$=unescape(encodeURIComponent($));const U=[];for(let G=0;G<$.length;++G)U.push($.charCodeAt(G));return U}function M5($,U,G){function W(X,Z,L,Y){var w;if(typeof X==="string")X=K5(X);if(typeof Z==="string")Z=J5.default(Z);if(((w=Z)===null||w===void 0?void 0:w.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let Q=new Uint8Array(16+X.length);if(Q.set(Z),Q.set(X,Z.length),Q=G(Q),Q[6]=Q[6]&15|U,Q[8]=Q[8]&63|128,L){Y=Y||0;for(let z=0;z<16;++z)L[Y+z]=Q[z];return L}return R5.unsafeStringify(Q)}try{W.name=$}catch(X){}return W.DNS=MG,W.URL=BG,W}Object.defineProperty(VG,"__esModule",{value:!0});VG.URL=VG.DNS=void 0;VG.default=M5;var R5=h0(),J5=I5(K$()),MG="6ba7b810-9dad-11d1-80b4-00c04fd430c8";VG.DNS=MG;var BG="6ba7b811-9dad-11d1-80b4-00c04fd430c8";VG.URL=BG});var AG=M((TG)=>{function T5($){return $&&$.__esModule?$:{default:$}}function H5($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return E5.default.createHash("md5").update($).digest()}Object.defineProperty(TG,"__esModule",{value:!0});TG.default=void 0;var E5=T5(import.meta.require("crypto")),A5=H5;TG.default=A5});var qG=M((CG)=>{function OG($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(CG,"__esModule",{value:!0});CG.default=void 0;var O5=OG(M$()),C5=OG(AG()),f5=O5.default("v3",48,C5.default),q5=f5;CG.default=q5});var PG=M((NG)=>{function j5($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(NG,"__esModule",{value:!0});NG.default=void 0;var N5=j5(import.meta.require("crypto")),P5={randomUUID:N5.default.randomUUID};NG.default=P5});var hG=M((bG)=>{function DG($){return $&&$.__esModule?$:{default:$}}function b5($,U,G){if(SG.default.randomUUID&&!U&&!$)return SG.default.randomUUID();$=$||{};const W=$.random||($.rng||S5.default)();if(W[6]=W[6]&15|64,W[8]=W[8]&63|128,U){G=G||0;for(let X=0;X<16;++X)U[G+X]=W[X];return U}return D5.unsafeStringify(W)}Object.defineProperty(bG,"__esModule",{value:!0});bG.default=void 0;var SG=DG(PG()),S5=DG(F$()),D5=h0(),k5=b5;bG.default=k5});var cG=M((xG)=>{function x5($){return $&&$.__esModule?$:{default:$}}function v5($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return h5.default.createHash("sha1").update($).digest()}Object.defineProperty(xG,"__esModule",{value:!0});xG.default=void 0;var h5=x5(import.meta.require("crypto")),c5=v5;xG.default=c5});var dG=M((uG)=>{function yG($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(uG,"__esModule",{value:!0});uG.default=void 0;var y5=yG(M$()),u5=yG(cG()),_5=y5.default("v5",80,u5.default),d5=_5;uG.default=d5});var lG=M((gG)=>{Object.defineProperty(gG,"__esModule",{value:!0});gG.default=void 0;var g5="00000000-0000-0000-0000-000000000000";gG.default=g5});var nG=M((sG)=>{function l5($){return $&&$.__esModule?$:{default:$}}function s5($){if(!p5.default($))throw TypeError("Invalid UUID");return parseInt($.slice(14,15),16)}Object.defineProperty(sG,"__esModule",{value:!0});sG.default=void 0;var p5=l5(k0()),m5=s5;sG.default=m5});var B$=M((l)=>{function r($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(l,"__esModule",{value:!0});Object.defineProperty(l,"NIL",{enumerable:!0,get:function(){return a5.default}});Object.defineProperty(l,"parse",{enumerable:!0,get:function(){return UY.default}});Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return $Y.default}});Object.defineProperty(l,"v1",{enumerable:!0,get:function(){return n5.default}});Object.defineProperty(l,"v3",{enumerable:!0,get:function(){return i5.default}});Object.defineProperty(l,"v4",{enumerable:!0,get:function(){return r5.default}});Object.defineProperty(l,"v5",{enumerable:!0,get:function(){return o5.default}});Object.defineProperty(l,"validate",{enumerable:!0,get:function(){return e5.default}});Object.defineProperty(l,"version",{enumerable:!0,get:function(){return t5.default}});var n5=r(JG()),i5=r(qG()),r5=r(hG()),o5=r(dG()),a5=r(lG()),t5=r(nG()),e5=r(k0()),$Y=r(h0()),UY=r(K$())});var x0=M((N3,eG)=>{var{defineProperty:Z1,getOwnPropertyDescriptor:zY,getOwnPropertyNames:FY}=Object,RY=Object.prototype.hasOwnProperty,aG=($,U)=>Z1($,"name",{value:U,configurable:!0}),JY=($,U)=>{for(var G in U)Z1($,G,{get:U[G],enumerable:!0})},IY=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of FY(U))if(!RY.call($,X)&&X!==G)Z1($,X,{get:()=>U[X],enumerable:!(W=zY(U,X))||W.enumerable})}return $},KY=($)=>IY(Z1({},"__esModule",{value:!0}),$),tG={};JY(tG,{getSmithyContext:()=>MY,normalizeProvider:()=>BY});eG.exports=KY(tG);var oG=Q0(),MY=aG(($)=>$[oG.SMITHY_CONTEXT_KEY]||($[oG.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),BY=aG(($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U},"normalizeProvider")});var E$=M((j3,X8)=>{var{defineProperty:L1,getOwnPropertyDescriptor:VY,getOwnPropertyNames:EY}=Object,TY=Object.prototype.hasOwnProperty,z0=($,U)=>L1($,"name",{value:U,configurable:!0}),HY=($,U)=>{for(var G in U)L1($,G,{get:U[G],enumerable:!0})},AY=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of EY(U))if(!TY.call($,X)&&X!==G)L1($,X,{get:()=>U[X],enumerable:!(W=VY(U,X))||W.enumerable})}return $},OY=($)=>AY(L1({},"__esModule",{value:!0}),$),$8={};HY($8,{CredentialsProviderError:()=>CY,ProviderError:()=>Y1,TokenProviderError:()=>fY,chain:()=>qY,fromStatic:()=>NY,memoize:()=>jY});X8.exports=OY($8);var U8=class $ extends Error{constructor(U,G=!0){var W;let X,Z=!0;if(typeof G==="boolean")X=void 0,Z=G;else if(G!=null&&typeof G==="object")X=G.logger,Z=G.tryNextLink??!0;super(U);this.name="ProviderError",this.tryNextLink=Z,Object.setPrototypeOf(this,$.prototype),(W=X==null?void 0:X.debug)==null||W.call(X,`@smithy/property-provider ${Z?"->":"(!)"} ${U}`)}static from(U,G=!0){return Object.assign(new this(U.message,G),U)}};z0(U8,"ProviderError");var Y1=U8,G8=class $ extends Y1{constructor(U,G=!0){super(U,G);this.name="CredentialsProviderError",Object.setPrototypeOf(this,$.prototype)}};z0(G8,"CredentialsProviderError");var CY=G8,W8=class $ extends Y1{constructor(U,G=!0){super(U,G);this.name="TokenProviderError",Object.setPrototypeOf(this,$.prototype)}};z0(W8,"TokenProviderError");var fY=W8,qY=z0((...$)=>async()=>{if($.length===0)throw new Y1("No providers in chain");let U;for(let G of $)try{return await G()}catch(W){if(U=W,W==null?void 0:W.tryNextLink)continue;throw W}throw U},"chain"),NY=z0(($)=>()=>Promise.resolve($),"fromStatic"),jY=z0(($,U,G)=>{let W,X,Z,L=!1;const Y=z0(async()=>{if(!X)X=$();try{W=await X,Z=!0,L=!1}finally{X=void 0}return W},"coalesceProvider");if(U===void 0)return async(w)=>{if(!Z||(w==null?void 0:w.forceRefresh))W=await Y();return W};return async(w)=>{if(!Z||(w==null?void 0:w.forceRefresh))W=await Y();if(L)return W;if(G&&!G(W))return L=!0,W;if(U(W))return await Y(),W;return W}},"memoize")});var T0=M((Z8)=>{Object.defineProperty(Z8,"__esModule",{value:!0});Z8.getHomeDir=void 0;var PY=import.meta.require("os"),SY=import.meta.require("path"),T$={},DY=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},bY=()=>{const{HOME:$,USERPROFILE:U,HOMEPATH:G,HOMEDRIVE:W=`C:${SY.sep}`}=process.env;if($)return $;if(U)return U;if(G)return`${W}${G}`;const X=DY();if(!T$[X])T$[X]=PY.homedir();return T$[X]};Z8.getHomeDir=bY});var H$=M((Y8)=>{Object.defineProperty(Y8,"__esModule",{value:!0});Y8.getSSOTokenFilepath=void 0;var kY=import.meta.require("crypto"),hY=import.meta.require("path"),xY=T0(),vY=($)=>{const G=kY.createHash("sha1").update($).digest("hex");return hY.join(xY.getHomeDir(),".aws","sso","cache",`${G}.json`)};Y8.getSSOTokenFilepath=vY});var F8=M((Q8)=>{Object.defineProperty(Q8,"__esModule",{value:!0});Q8.getSSOTokenFromFile=void 0;var cY=import.meta.require("fs"),yY=H$(),{readFile:uY}=cY.promises,_Y=async($)=>{const U=yY.getSSOTokenFilepath($),G=await uY(U,"utf8");return JSON.parse(G)};Q8.getSSOTokenFromFile=_Y});var O$=M((R8)=>{Object.defineProperty(R8,"__esModule",{value:!0});R8.slurpFile=void 0;var dY=import.meta.require("fs"),{readFile:gY}=dY.promises,A$={},pY=($,U)=>{if(!A$[$]||(U===null||U===void 0?void 0:U.ignoreCache))A$[$]=gY($,"utf8");return A$[$]};R8.slurpFile=pY});var N$=M((k3,c0)=>{var{defineProperty:z1,getOwnPropertyDescriptor:lY,getOwnPropertyNames:sY}=Object,mY=Object.prototype.hasOwnProperty,u=($,U)=>z1($,"name",{value:U,configurable:!0}),nY=($,U)=>{for(var G in U)z1($,G,{get:U[G],enumerable:!0})},C$=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of sY(U))if(!mY.call($,X)&&X!==G)z1($,X,{get:()=>U[X],enumerable:!(W=lY(U,X))||W.enumerable})}return $},q$=($,U,G)=>(C$($,U,"default"),G&&C$(G,U,"default")),iY=($)=>C$(z1({},"__esModule",{value:!0}),$),v0={};nY(v0,{CONFIG_PREFIX_SEPARATOR:()=>F0,DEFAULT_PROFILE:()=>B8,ENV_PROFILE:()=>M8,getProfileName:()=>rY,loadSharedConfigFiles:()=>E8,loadSsoSessionData:()=>w2,parseKnownFiles:()=>z2});c0.exports=iY(v0);q$(v0,T0(),c0.exports);var M8="AWS_PROFILE",B8="default",rY=u(($)=>$.profile||process.env[M8]||B8,"getProfileName");q$(v0,H$(),c0.exports);q$(v0,F8(),c0.exports);var w1=Q0(),oY=u(($)=>Object.entries($).filter(([U])=>{const G=U.indexOf(F0);if(G===-1)return!1;return Object.values(w1.IniSectionType).includes(U.substring(0,G))}).reduce((U,[G,W])=>{const X=G.indexOf(F0),Z=G.substring(0,X)===w1.IniSectionType.PROFILE?G.substring(X+1):G;return U[Z]=W,U},{...$.default&&{default:$.default}}),"getConfigData"),Q1=import.meta.require("path"),aY=T0(),tY="AWS_CONFIG_FILE",V8=u(()=>process.env[tY]||Q1.join(aY.getHomeDir(),".aws","config"),"getConfigFilepath"),eY=T0(),$2="AWS_SHARED_CREDENTIALS_FILE",U2=u(()=>process.env[$2]||Q1.join(eY.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),G2=T0(),W2=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,X2=["__proto__","profile __proto__"],f$=u(($)=>{const U={};let G,W;for(let X of $.split(/\r?\n/)){const Z=X.split(/(^|\s)[;#]/)[0].trim();if(Z[0]==="["&&Z[Z.length-1]==="]"){G=void 0,W=void 0;const Y=Z.substring(1,Z.length-1),w=W2.exec(Y);if(w){const[,Q,,z]=w;if(Object.values(w1.IniSectionType).includes(Q))G=[Q,z].join(F0)}else G=Y;if(X2.includes(Y))throw new Error(`Found invalid profile name "${Y}"`)}else if(G){const Y=Z.indexOf("=");if(![0,-1].includes(Y)){const[w,Q]=[Z.substring(0,Y).trim(),Z.substring(Y+1).trim()];if(Q==="")W=w;else{if(W&&X.trimStart()===X)W=void 0;U[G]=U[G]||{};const z=W?[W,w].join(F0):w;U[G][z]=Q}}}}return U},"parseIni"),I8=O$(),K8=u(()=>({}),"swallowError"),F0=".",E8=u(async($={})=>{const{filepath:U=U2(),configFilepath:G=V8()}=$,W=G2.getHomeDir();let Z=U;if(U.startsWith("~/"))Z=Q1.join(W,U.slice(2));let L=G;if(G.startsWith("~/"))L=Q1.join(W,G.slice(2));const Y=await Promise.all([I8.slurpFile(L,{ignoreCache:$.ignoreCache}).then(f$).then(oY).catch(K8),I8.slurpFile(Z,{ignoreCache:$.ignoreCache}).then(f$).catch(K8)]);return{configFile:Y[0],credentialsFile:Y[1]}},"loadSharedConfigFiles"),Z2=u(($)=>Object.entries($).filter(([U])=>U.startsWith(w1.IniSectionType.SSO_SESSION+F0)).reduce((U,[G,W])=>({...U,[G.substring(G.indexOf(F0)+1)]:W}),{}),"getSsoSessionData"),L2=O$(),Y2=u(()=>({}),"swallowError"),w2=u(async($={})=>L2.slurpFile($.configFilepath??V8()).then(f$).then(Z2).catch(Y2),"loadSsoSessionData"),Q2=u((...$)=>{const U={};for(let G of $)for(let[W,X]of Object.entries(G))if(U[W]!==void 0)Object.assign(U[W],X);else U[W]=X;return U},"mergeConfigFiles"),z2=u(async($)=>{const U=await E8($);return Q2(U.configFile,U.credentialsFile)},"parseKnownFiles")});var O8=M((h3,A8)=>{function j$($){try{const U=new Set(Array.from($.match(/([A-Z_]){3,}/g)??[]));return U.delete("CONFIG"),U.delete("CONFIG_PREFIX_SEPARATOR"),U.delete("ENV"),[...U].join(", ")}catch(U){return $}}var{defineProperty:F1,getOwnPropertyDescriptor:F2,getOwnPropertyNames:R2}=Object,J2=Object.prototype.hasOwnProperty,H0=($,U)=>F1($,"name",{value:U,configurable:!0}),I2=($,U)=>{for(var G in U)F1($,G,{get:U[G],enumerable:!0})},K2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of R2(U))if(!J2.call($,X)&&X!==G)F1($,X,{get:()=>U[X],enumerable:!(W=F2(U,X))||W.enumerable})}return $},M2=($)=>K2(F1({},"__esModule",{value:!0}),$),H8={};I2(H8,{loadConfig:()=>H2});A8.exports=M2(H8);var y0=E$();H0(j$,"getSelectorName");var B2=H0(($,U)=>async()=>{try{const G=$(process.env);if(G===void 0)throw new Error;return G}catch(G){throw new y0.CredentialsProviderError(G.message||`Not found in ENV: ${j$($.toString())}`,{logger:U})}},"fromEnv"),T8=N$(),V2=H0(($,{preferredFile:U="config",...G}={})=>async()=>{const W=T8.getProfileName(G),{configFile:X,credentialsFile:Z}=await T8.loadSharedConfigFiles(G),L=Z[W]||{},Y=X[W]||{},w=U==="config"?{...L,...Y}:{...Y,...L};try{const z=$(w,U==="config"?X:Z);if(z===void 0)throw new Error;return z}catch(Q){throw new y0.CredentialsProviderError(Q.message||`Not found in config files w/ profile [${W}]: ${j$($.toString())}`,{logger:G.logger})}},"fromSharedConfigFiles"),E2=H0(($)=>typeof $==="function","isFunction"),T2=H0(($)=>E2($)?async()=>await $():y0.fromStatic($),"fromStatic"),H2=H0(({environmentVariableSelector:$,configFileSelector:U,default:G},W={})=>y0.memoize(y0.chain(B2($),V2(U,W),T2(G))),"loadConfig")});var P8=M((N8)=>{Object.defineProperty(N8,"__esModule",{value:!0});N8.getEndpointUrlConfig=void 0;var C8=N$(),f8="AWS_ENDPOINT_URL",q8="endpoint_url",A2=($)=>({environmentVariableSelector:(U)=>{const G=$.split(" ").map((Z)=>Z.toUpperCase()),W=U[[f8,...G].join("_")];if(W)return W;const X=U[f8];if(X)return X;return},configFileSelector:(U,G)=>{if(G&&U.services){const X=G[["services",U.services].join(C8.CONFIG_PREFIX_SEPARATOR)];if(X){const Z=$.split(" ").map((Y)=>Y.toLowerCase()),L=X[[Z.join("_"),q8].join(C8.CONFIG_PREFIX_SEPARATOR)];if(L)return L}}const W=U[q8];if(W)return W;return},default:void 0});N8.getEndpointUrlConfig=A2});var P$=M((S8)=>{Object.defineProperty(S8,"__esModule",{value:!0});S8.getEndpointFromConfig=void 0;var O2=O8(),C2=P8(),f2=async($)=>O2.loadConfig(C2.getEndpointUrlConfig($!==null&&$!==void 0?$:""))();S8.getEndpointFromConfig=f2});var x8=M((c3,h8)=>{function k8($){const U={};if($=$.replace(/^\?/,""),$)for(let G of $.split("&")){let[W,X=null]=G.split("=");if(W=decodeURIComponent(W),X)X=decodeURIComponent(X);if(!(W in U))U[W]=X;else if(Array.isArray(U[W]))U[W].push(X);else U[W]=[U[W],X]}return U}var{defineProperty:R1,getOwnPropertyDescriptor:q2,getOwnPropertyNames:N2}=Object,j2=Object.prototype.hasOwnProperty,P2=($,U)=>R1($,"name",{value:U,configurable:!0}),S2=($,U)=>{for(var G in U)R1($,G,{get:U[G],enumerable:!0})},D2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of N2(U))if(!j2.call($,X)&&X!==G)R1($,X,{get:()=>U[X],enumerable:!(W=q2(U,X))||W.enumerable})}return $},b2=($)=>D2(R1({},"__esModule",{value:!0}),$),b8={};S2(b8,{parseQueryString:()=>k8});h8.exports=b2(b8);P2(k8,"parseQueryString")});var u8=M((y3,y8)=>{var{defineProperty:J1,getOwnPropertyDescriptor:k2,getOwnPropertyNames:h2}=Object,x2=Object.prototype.hasOwnProperty,v2=($,U)=>J1($,"name",{value:U,configurable:!0}),c2=($,U)=>{for(var G in U)J1($,G,{get:U[G],enumerable:!0})},y2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of h2(U))if(!x2.call($,X)&&X!==G)J1($,X,{get:()=>U[X],enumerable:!(W=k2(U,X))||W.enumerable})}return $},u2=($)=>y2(J1({},"__esModule",{value:!0}),$),v8={};c2(v8,{parseUrl:()=>c8});y8.exports=u2(v8);var _2=x8(),c8=v2(($)=>{if(typeof $==="string")return c8(new URL($));const{hostname:U,pathname:G,port:W,protocol:X,search:Z}=$;let L;if(Z)L=_2.parseQueryString(Z);return{hostname:U,port:W?parseInt(W):void 0,protocol:X,path:G,query:L}},"parseUrl")});var D$=M((u3,m8)=>{function s8($,U,G){return{applyToStack:(W)=>{W.add(d8($,G),p8),W.add(g8($,U),l8)}}}var{defineProperty:I1,getOwnPropertyDescriptor:d2,getOwnPropertyNames:g2}=Object,p2=Object.prototype.hasOwnProperty,S$=($,U)=>I1($,"name",{value:U,configurable:!0}),l2=($,U)=>{for(var G in U)I1($,G,{get:U[G],enumerable:!0})},s2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of g2(U))if(!p2.call($,X)&&X!==G)I1($,X,{get:()=>U[X],enumerable:!(W=d2(U,X))||W.enumerable})}return $},m2=($)=>s2(I1({},"__esModule",{value:!0}),$),_8={};l2(_8,{deserializerMiddleware:()=>d8,deserializerMiddlewareOption:()=>p8,getSerdePlugin:()=>s8,serializerMiddleware:()=>g8,serializerMiddlewareOption:()=>l8});m8.exports=m2(_8);var d8=S$(($,U)=>(G)=>async(W)=>{const{response:X}=await G(W);try{const Z=await U(X,$);return{response:X,output:Z}}catch(Z){if(Object.defineProperty(Z,"$response",{value:X}),!("$metadata"in Z)){if(Z.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof Z.$responseBodyText!=="undefined"){if(Z.$response)Z.$response.body=Z.$responseBodyText}}throw Z}},"deserializerMiddleware"),g8=S$(($,U)=>(G,W)=>async(X)=>{var Z;const L=((Z=W.endpointV2)==null?void 0:Z.url)&&$.urlParser?async()=>$.urlParser(W.endpointV2.url):$.endpoint;if(!L)throw new Error("No valid endpoint provider available.");const Y=await U(X.input,{...$,endpoint:L});return G({...X,request:Y})},"serializerMiddleware"),p8={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},l8={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};S$(s8,"getSerdePlugin")});var $4=M((_3,e8)=>{var{defineProperty:M1,getOwnPropertyDescriptor:n2,getOwnPropertyNames:i2}=Object,r2=Object.prototype.hasOwnProperty,s=($,U)=>M1($,"name",{value:U,configurable:!0}),o2=($,U)=>{for(var G in U)M1($,G,{get:U[G],enumerable:!0})},a2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of i2(U))if(!r2.call($,X)&&X!==G)M1($,X,{get:()=>U[X],enumerable:!(W=n2(U,X))||W.enumerable})}return $},t2=($)=>a2(M1({},"__esModule",{value:!0}),$),i8={};o2(i8,{endpointMiddleware:()=>a8,endpointMiddlewareOptions:()=>t8,getEndpointFromInstructions:()=>r8,getEndpointPlugin:()=>w9,resolveEndpointConfig:()=>z9,resolveParams:()=>o8,toEndpointV1:()=>b$});e8.exports=t2(i8);var e2=s(async($)=>{const U=($==null?void 0:$.Bucket)||"";if(typeof $.Bucket==="string")$.Bucket=U.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(X9(U)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!W9(U)||U.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||U.toLowerCase()!==U||U.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},"resolveParamsForS3"),$9=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,U9=/(\d+\.){3}\d+/,G9=/\.\./,W9=s(($)=>$9.test($)&&!U9.test($)&&!G9.test($),"isDnsCompatibleBucketName"),X9=s(($)=>{const[U,G,W,,,X]=$.split(":"),Z=U==="arn"&&$.split(":").length>=6,L=Boolean(Z&&G&&W&&X);if(Z&&!L)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return L},"isArnBucketName"),Z9=s(($,U,G)=>{const W=s(async()=>{const X=G[$]??G[U];if(typeof X==="function")return X();return X},"configProvider");if($==="credentialScope"||U==="CredentialScope")return async()=>{const X=typeof G.credentials==="function"?await G.credentials():G.credentials;return(X==null?void 0:X.credentialScope)??(X==null?void 0:X.CredentialScope)};if($==="accountId"||U==="AccountId")return async()=>{const X=typeof G.credentials==="function"?await G.credentials():G.credentials;return(X==null?void 0:X.accountId)??(X==null?void 0:X.AccountId)};if($==="endpoint"||U==="endpoint")return async()=>{const X=await W();if(X&&typeof X==="object"){if("url"in X)return X.url.href;if("hostname"in X){const{protocol:Z,hostname:L,port:Y,path:w}=X;return`${Z}//${L}${Y?":"+Y:""}${w}`}}return X};return W},"createConfigValueProvider"),L9=P$(),n8=u8(),b$=s(($)=>{if(typeof $==="object"){if("url"in $)return n8.parseUrl($.url);return $}return n8.parseUrl($)},"toEndpointV1"),r8=s(async($,U,G,W)=>{if(!G.endpoint){let L;if(G.serviceConfiguredEndpoint)L=await G.serviceConfiguredEndpoint();else L=await L9.getEndpointFromConfig(G.serviceId);if(L)G.endpoint=()=>Promise.resolve(b$(L))}const X=await o8($,U,G);if(typeof G.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return G.endpointProvider(X,W)},"getEndpointFromInstructions"),o8=s(async($,U,G)=>{var W;const X={},Z=((W=U==null?void 0:U.getEndpointParameterInstructions)==null?void 0:W.call(U))||{};for(let[L,Y]of Object.entries(Z))switch(Y.type){case"staticContextParams":X[L]=Y.value;break;case"contextParams":X[L]=$[Y.name];break;case"clientContextParams":case"builtInParams":X[L]=await Z9(Y.name,L,G)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(Y))}if(Object.keys(Z).length===0)Object.assign(X,G);if(String(G.serviceId).toLowerCase()==="s3")await e2(X);return X},"resolveParams"),K1=x0(),a8=s(({config:$,instructions:U})=>{return(G,W)=>async(X)=>{var Z,L,Y;const w=await r8(X.input,{getEndpointParameterInstructions(){return U}},{...$},W);W.endpointV2=w,W.authSchemes=(Z=w.properties)==null?void 0:Z.authSchemes;const Q=(L=W.authSchemes)==null?void 0:L[0];if(Q){W.signing_region=Q.signingRegion,W.signing_service=Q.signingName;const z=K1.getSmithyContext(W),F=(Y=z==null?void 0:z.selectedHttpAuthScheme)==null?void 0:Y.httpAuthOption;if(F)F.signingProperties=Object.assign(F.signingProperties||{},{signing_region:Q.signingRegion,signingRegion:Q.signingRegion,signing_service:Q.signingName,signingName:Q.signingName,signingRegionSet:Q.signingRegionSet},Q.properties)}return G({...X})}},"endpointMiddleware"),Y9=D$(),t8={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Y9.serializerMiddlewareOption.name},w9=s(($,U)=>({applyToStack:(G)=>{G.addRelativeTo(a8({config:$,instructions:U}),t8)}}),"getEndpointPlugin"),Q9=P$(),z9=s(($)=>{const U=$.tls??!0,{endpoint:G}=$,W=G!=null?async()=>b$(await K1.normalizeProvider(G)()):void 0,Z={...$,endpoint:W,tls:U,isCustomEndpoint:!!G,useDualstackEndpoint:K1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:K1.normalizeProvider($.useFipsEndpoint??!1)};let L=void 0;return Z.serviceConfiguredEndpoint=async()=>{if($.serviceId&&!L)L=Q9.getEndpointFromConfig($.serviceId);return L},Z},"resolveEndpointConfig")});var o=M((d3,Q4)=>{function L4($){return Object.keys($).reduce((U,G)=>{const W=$[G];return{...U,[G]:Array.isArray(W)?[...W]:W}},{})}function w4($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)}var{defineProperty:B1,getOwnPropertyDescriptor:F9,getOwnPropertyNames:R9}=Object,J9=Object.prototype.hasOwnProperty,$0=($,U)=>B1($,"name",{value:U,configurable:!0}),I9=($,U)=>{for(var G in U)B1($,G,{get:U[G],enumerable:!0})},K9=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of R9(U))if(!J9.call($,X)&&X!==G)B1($,X,{get:()=>U[X],enumerable:!(W=F9(U,X))||W.enumerable})}return $},M9=($)=>K9(B1({},"__esModule",{value:!0}),$),U4={};I9(U4,{Field:()=>E9,Fields:()=>T9,HttpRequest:()=>H9,HttpResponse:()=>A9,IHttpRequest:()=>G4.HttpRequest,getHttpHandlerExtensionConfiguration:()=>B9,isValidHostname:()=>w4,resolveHttpHandlerRuntimeConfig:()=>V9});Q4.exports=M9(U4);var B9=$0(($)=>{let U=$.httpHandler;return{setHttpHandler(G){U=G},httpHandler(){return U},updateHttpClientConfig(G,W){U.updateHttpClientConfig(G,W)},httpHandlerConfigs(){return U.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),V9=$0(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),G4=Q0(),W4=class ${constructor({name:U,kind:G=G4.FieldPosition.HEADER,values:W=[]}){this.name=U,this.kind=G,this.values=W}add(U){this.values.push(U)}set(U){this.values=U}remove(U){this.values=this.values.filter((G)=>G!==U)}toString(){return this.values.map((U)=>U.includes(",")||U.includes(" ")?`"${U}"`:U).join(", ")}get(){return this.values}};$0(W4,"Field");var E9=W4,X4=class ${constructor({fields:U=[],encoding:G="utf-8"}){this.entries={},U.forEach(this.setField.bind(this)),this.encoding=G}setField(U){this.entries[U.name.toLowerCase()]=U}getField(U){return this.entries[U.toLowerCase()]}removeField(U){delete this.entries[U.toLowerCase()]}getByType(U){return Object.values(this.entries).filter((G)=>G.kind===U)}};$0(X4,"Fields");var T9=X4,Z4=class ${constructor(U){this.method=U.method||"GET",this.hostname=U.hostname||"localhost",this.port=U.port,this.query=U.query||{},this.headers=U.headers||{},this.body=U.body,this.protocol=U.protocol?U.protocol.slice(-1)!==":"?`${U.protocol}:`:U.protocol:"https:",this.path=U.path?U.path.charAt(0)!=="/"?`/${U.path}`:U.path:"/",this.username=U.username,this.password=U.password,this.fragment=U.fragment}static clone(U){const G=new $({...U,headers:{...U.headers}});if(G.query)G.query=L4(G.query);return G}static isInstance(U){if(!U)return!1;const G=U;return"method"in G&&"protocol"in G&&"hostname"in G&&"path"in G&&typeof G.query==="object"&&typeof G.headers==="object"}clone(){return $.clone(this)}};$0(Z4,"HttpRequest");var H9=Z4;$0(L4,"cloneQuery");var Y4=class ${constructor(U){this.statusCode=U.statusCode,this.reason=U.reason,this.headers=U.headers||{},this.body=U.body}static isInstance(U){if(!U)return!1;const G=U;return typeof G.statusCode==="number"&&typeof G.headers==="object"}};$0(Y4,"HttpResponse");var A9=Y4;$0(w4,"isValidHostname")});var k$=M((g3,J4)=>{var{defineProperty:V1,getOwnPropertyDescriptor:O9,getOwnPropertyNames:C9}=Object,f9=Object.prototype.hasOwnProperty,A0=($,U)=>V1($,"name",{value:U,configurable:!0}),q9=($,U)=>{for(var G in U)V1($,G,{get:U[G],enumerable:!0})},N9=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of C9(U))if(!f9.call($,X)&&X!==G)V1($,X,{get:()=>U[X],enumerable:!(W=O9(U,X))||W.enumerable})}return $},j9=($)=>N9(V1({},"__esModule",{value:!0}),$),z4={};q9(z4,{isClockSkewCorrectedError:()=>F4,isClockSkewError:()=>x9,isRetryableByTrait:()=>h9,isServerError:()=>c9,isThrottlingError:()=>v9,isTransientError:()=>R4});J4.exports=j9(z4);var P9=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],S9=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],D9=["TimeoutError","RequestTimeout","RequestTimeoutException"],b9=[500,502,503,504],k9=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],h9=A0(($)=>$.$retryable!==void 0,"isRetryableByTrait"),x9=A0(($)=>P9.includes($.name),"isClockSkewError"),F4=A0(($)=>{var U;return(U=$.$metadata)==null?void 0:U.clockSkewCorrected},"isClockSkewCorrectedError"),v9=A0(($)=>{var U,G;return((U=$.$metadata)==null?void 0:U.httpStatusCode)===429||S9.includes($.name)||((G=$.$retryable)==null?void 0:G.throttling)==!0},"isThrottlingError"),R4=A0(($)=>{var U;return F4($)||D9.includes($.name)||k9.includes(($==null?void 0:$.code)||"")||b9.includes(((U=$.$metadata)==null?void 0:U.httpStatusCode)||0)},"isTransientError"),c9=A0(($)=>{var U;if(((U=$.$metadata)==null?void 0:U.httpStatusCode)!==void 0){const G=$.$metadata.httpStatusCode;if(500<=G&&G<=599&&!R4($))return!0;return!1}return!1},"isServerError")});var N4=M((p3,q4)=>{var{defineProperty:E1,getOwnPropertyDescriptor:y9,getOwnPropertyNames:u9}=Object,_9=Object.prototype.hasOwnProperty,m=($,U)=>E1($,"name",{value:U,configurable:!0}),d9=($,U)=>{for(var G in U)E1($,G,{get:U[G],enumerable:!0})},g9=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of u9(U))if(!_9.call($,X)&&X!==G)E1($,X,{get:()=>U[X],enumerable:!(W=y9(U,X))||W.enumerable})}return $},p9=($)=>g9(E1({},"__esModule",{value:!0}),$),K4={};d9(K4,{AdaptiveRetryStrategy:()=>r9,ConfiguredRetryStrategy:()=>o9,DEFAULT_MAX_ATTEMPTS:()=>h$,DEFAULT_RETRY_DELAY_BASE:()=>u0,DEFAULT_RETRY_MODE:()=>l9,DefaultRateLimiter:()=>V4,INITIAL_RETRY_TOKENS:()=>x$,INVOCATION_ID_HEADER:()=>m9,MAXIMUM_RETRY_DELAY:()=>v$,NO_RETRY_INCREMENT:()=>A4,REQUEST_HEADER:()=>n9,RETRY_COST:()=>T4,RETRY_MODES:()=>M4,StandardRetryStrategy:()=>c$,THROTTLING_RETRY_DELAY_BASE:()=>E4,TIMEOUT_RETRY_COST:()=>H4});q4.exports=p9(K4);var M4=(($)=>{return $.STANDARD="standard",$.ADAPTIVE="adaptive",$})(M4||{}),h$=3,l9="standard",s9=k$(),B4=class ${constructor(U){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(U==null?void 0:U.beta)??0.7,this.minCapacity=(U==null?void 0:U.minCapacity)??1,this.minFillRate=(U==null?void 0:U.minFillRate)??0.5,this.scaleConstant=(U==null?void 0:U.scaleConstant)??0.4,this.smooth=(U==null?void 0:U.smooth)??0.8;const G=this.getCurrentTimeInSeconds();this.lastThrottleTime=G,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(U){if(!this.enabled)return;if(this.refillTokenBucket(),U>this.currentCapacity){const G=(U-this.currentCapacity)/this.fillRate*1000;await new Promise((W)=>setTimeout(W,G))}this.currentCapacity=this.currentCapacity-U}refillTokenBucket(){const U=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=U;return}const G=(U-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+G),this.lastTimestamp=U}updateClientSendingRate(U){let G;if(this.updateMeasuredRate(),s9.isThrottlingError(U)){const X=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=X,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),G=this.cubicThrottle(X),this.enableTokenBucket()}else this.calculateTimeWindow(),G=this.cubicSuccess(this.getCurrentTimeInSeconds());const W=Math.min(G,2*this.measuredTxRate);this.updateTokenBucketRate(W)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(U){return this.getPrecise(U*this.beta)}cubicSuccess(U){return this.getPrecise(this.scaleConstant*Math.pow(U-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(U){this.refillTokenBucket(),this.fillRate=Math.max(U,this.minFillRate),this.maxCapacity=Math.max(U,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const U=this.getCurrentTimeInSeconds(),G=Math.floor(U*2)/2;if(this.requestCount++,G>this.lastTxRateBucket){const W=this.requestCount/(G-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(W*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=G}}getPrecise(U){return parseFloat(U.toFixed(8))}};m(B4,"DefaultRateLimiter");var V4=B4,u0=100,v$=20000,E4=500,x$=500,T4=5,H4=10,A4=1,m9="amz-sdk-invocation-id",n9="amz-sdk-request",i9=m(()=>{let $=u0;return{computeNextBackoffDelay:m((W)=>{return Math.floor(Math.min(v$,Math.random()*2**W*$))},"computeNextBackoffDelay"),setDelayBase:m((W)=>{$=W},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),I4=m(({retryDelay:$,retryCount:U,retryCost:G})=>{return{getRetryCount:m(()=>U,"getRetryCount"),getRetryDelay:m(()=>Math.min(v$,$),"getRetryDelay"),getRetryCost:m(()=>G,"getRetryCost")}},"createDefaultRetryToken"),O4=class ${constructor(U){this.maxAttempts=U,this.mode="standard",this.capacity=x$,this.retryBackoffStrategy=i9(),this.maxAttemptsProvider=typeof U==="function"?U:async()=>U}async acquireInitialRetryToken(U){return I4({retryDelay:u0,retryCount:0})}async refreshRetryTokenForRetry(U,G){const W=await this.getMaxAttempts();if(this.shouldRetry(U,G,W)){const X=G.errorType;this.retryBackoffStrategy.setDelayBase(X==="THROTTLING"?E4:u0);const Z=this.retryBackoffStrategy.computeNextBackoffDelay(U.getRetryCount()),L=G.retryAfterHint?Math.max(G.retryAfterHint.getTime()-Date.now()||0,Z):Z,Y=this.getCapacityCost(X);return this.capacity-=Y,I4({retryDelay:L,retryCount:U.getRetryCount()+1,retryCost:Y})}throw new Error("No retry token available")}recordSuccess(U){this.capacity=Math.max(x$,this.capacity+(U.getRetryCost()??A4))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(U){return console.warn(`Max attempts provider could not resolve. Using default of ${h$}`),h$}}shouldRetry(U,G,W){return U.getRetryCount()+1<W&&this.capacity>=this.getCapacityCost(G.errorType)&&this.isRetryableError(G.errorType)}getCapacityCost(U){return U==="TRANSIENT"?H4:T4}isRetryableError(U){return U==="THROTTLING"||U==="TRANSIENT"}};m(O4,"StandardRetryStrategy");var c$=O4,C4=class ${constructor(U,G){this.maxAttemptsProvider=U,this.mode="adaptive";const{rateLimiter:W}=G??{};this.rateLimiter=W??new V4,this.standardRetryStrategy=new c$(U)}async acquireInitialRetryToken(U){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(U)}async refreshRetryTokenForRetry(U,G){return this.rateLimiter.updateClientSendingRate(G),this.standardRetryStrategy.refreshRetryTokenForRetry(U,G)}recordSuccess(U){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(U)}};m(C4,"AdaptiveRetryStrategy");var r9=C4,f4=class $ extends c${constructor(U,G=u0){super(typeof U==="function"?U:async()=>U);if(typeof G==="number")this.computeNextBackoffDelay=()=>G;else this.computeNextBackoffDelay=G}async refreshRetryTokenForRetry(U,G){const W=await super.refreshRetryTokenForRetry(U,G);return W.getRetryDelay=()=>this.computeNextBackoffDelay(W.getRetryCount()),W}};m(f4,"ConfiguredRetryStrategy");var o9=f4});var b4=M((l3,D4)=>{var{defineProperty:T1,getOwnPropertyDescriptor:a9,getOwnPropertyNames:t9}=Object,e9=Object.prototype.hasOwnProperty,_=($,U)=>T1($,"name",{value:U,configurable:!0}),$w=($,U)=>{for(var G in U)T1($,G,{get:U[G],enumerable:!0})},Uw=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of t9(U))if(!e9.call($,X)&&X!==G)T1($,X,{get:()=>U[X],enumerable:!(W=a9(U,X))||W.enumerable})}return $},Gw=($)=>Uw(T1({},"__esModule",{value:!0}),$),S4={};$w(S4,{constructStack:()=>y$});D4.exports=Gw(S4);var R0=_(($,U)=>{const G=[];if($)G.push($);if(U)for(let W of U)G.push(W);return G},"getAllAliases"),U0=_(($,U)=>{return`${$||"anonymous"}${U&&U.length>0?` (a.k.a. ${U.join(",")})`:""}`},"getMiddlewareNameWithAliases"),y$=_(()=>{let $=[],U=[],G=!1;const W=new Set,X=_((F)=>F.sort((R,J)=>j4[J.step]-j4[R.step]||P4[J.priority||"normal"]-P4[R.priority||"normal"]),"sort"),Z=_((F)=>{let R=!1;const J=_((I)=>{const V=R0(I.name,I.aliases);if(V.includes(F)){R=!0;for(let B of V)W.delete(B);return!1}return!0},"filterCb");return $=$.filter(J),U=U.filter(J),R},"removeByName"),L=_((F)=>{let R=!1;const J=_((I)=>{if(I.middleware===F){R=!0;for(let V of R0(I.name,I.aliases))W.delete(V);return!1}return!0},"filterCb");return $=$.filter(J),U=U.filter(J),R},"removeByReference"),Y=_((F)=>{var R;return $.forEach((J)=>{F.add(J.middleware,{...J})}),U.forEach((J)=>{F.addRelativeTo(J.middleware,{...J})}),(R=F.identifyOnResolve)==null||R.call(F,z.identifyOnResolve()),F},"cloneTo"),w=_((F)=>{const R=[];return F.before.forEach((J)=>{if(J.before.length===0&&J.after.length===0)R.push(J);else R.push(...w(J))}),R.push(F),F.after.reverse().forEach((J)=>{if(J.before.length===0&&J.after.length===0)R.push(J);else R.push(...w(J))}),R},"expandRelativeMiddlewareList"),Q=_((F=!1)=>{const R=[],J=[],I={};return $.forEach((B)=>{const E={...B,before:[],after:[]};for(let T of R0(E.name,E.aliases))I[T]=E;R.push(E)}),U.forEach((B)=>{const E={...B,before:[],after:[]};for(let T of R0(E.name,E.aliases))I[T]=E;J.push(E)}),J.forEach((B)=>{if(B.toMiddleware){const E=I[B.toMiddleware];if(E===void 0){if(F)return;throw new Error(`${B.toMiddleware} is not found when adding ${U0(B.name,B.aliases)} middleware ${B.relation} ${B.toMiddleware}`)}if(B.relation==="after")E.after.push(B);if(B.relation==="before")E.before.push(B)}}),X(R).map(w).reduce((B,E)=>{return B.push(...E),B},[])},"getMiddlewareList"),z={add:(F,R={})=>{const{name:J,override:I,aliases:V}=R,B={step:"initialize",priority:"normal",middleware:F,...R},E=R0(J,V);if(E.length>0){if(E.some((T)=>W.has(T))){if(!I)throw new Error(`Duplicate middleware name '${U0(J,V)}'`);for(let T of E){const H=$.findIndex((S)=>{var h;return S.name===T||((h=S.aliases)==null?void 0:h.some((w0)=>w0===T))});if(H===-1)continue;const A=$[H];if(A.step!==B.step||B.priority!==A.priority)throw new Error(`"${U0(A.name,A.aliases)}" middleware with ${A.priority} priority in ${A.step} step cannot be overridden by "${U0(J,V)}" middleware with ${B.priority} priority in ${B.step} step.`);$.splice(H,1)}}for(let T of E)W.add(T)}$.push(B)},addRelativeTo:(F,R)=>{const{name:J,override:I,aliases:V}=R,B={middleware:F,...R},E=R0(J,V);if(E.length>0){if(E.some((T)=>W.has(T))){if(!I)throw new Error(`Duplicate middleware name '${U0(J,V)}'`);for(let T of E){const H=U.findIndex((S)=>{var h;return S.name===T||((h=S.aliases)==null?void 0:h.some((w0)=>w0===T))});if(H===-1)continue;const A=U[H];if(A.toMiddleware!==B.toMiddleware||A.relation!==B.relation)throw new Error(`"${U0(A.name,A.aliases)}" middleware ${A.relation} "${A.toMiddleware}" middleware cannot be overridden by "${U0(J,V)}" middleware ${B.relation} "${B.toMiddleware}" middleware.`);U.splice(H,1)}}for(let T of E)W.add(T)}U.push(B)},clone:()=>Y(y$()),use:(F)=>{F.applyToStack(z)},remove:(F)=>{if(typeof F==="string")return Z(F);else return L(F)},removeByTag:(F)=>{let R=!1;const J=_((I)=>{const{tags:V,name:B,aliases:E}=I;if(V&&V.includes(F)){const T=R0(B,E);for(let H of T)W.delete(H);return R=!0,!1}return!0},"filterCb");return $=$.filter(J),U=U.filter(J),R},concat:(F)=>{var R;const J=Y(y$());return J.use(F),J.identifyOnResolve(G||J.identifyOnResolve()||(((R=F.identifyOnResolve)==null?void 0:R.call(F))??!1)),J},applyToStack:Y,identify:()=>{return Q(!0).map((F)=>{const R=F.step??F.relation+" "+F.toMiddleware;return U0(F.name,F.aliases)+" - "+R})},identifyOnResolve(F){if(typeof F==="boolean")G=F;return G},resolve:(F,R)=>{for(let J of Q().map((I)=>I.middleware).reverse())F=J(F,R);if(G)console.log(z.identify());return F}};return z},"constructStack"),j4={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},P4={high:3,normal:2,low:1}});var u$=M((s3,h4)=>{var{defineProperty:H1,getOwnPropertyDescriptor:Ww,getOwnPropertyNames:Xw}=Object,Zw=Object.prototype.hasOwnProperty,Lw=($,U)=>H1($,"name",{value:U,configurable:!0}),Yw=($,U)=>{for(var G in U)H1($,G,{get:U[G],enumerable:!0})},ww=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of Xw(U))if(!Zw.call($,X)&&X!==G)H1($,X,{get:()=>U[X],enumerable:!(W=Ww(U,X))||W.enumerable})}return $},Qw=($)=>ww(H1({},"__esModule",{value:!0}),$),k4={};Yw(k4,{isArrayBuffer:()=>zw});h4.exports=Qw(k4);var zw=Lw(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var _0=M((m3,c4)=>{var{defineProperty:A1,getOwnPropertyDescriptor:Fw,getOwnPropertyNames:Rw}=Object,Jw=Object.prototype.hasOwnProperty,x4=($,U)=>A1($,"name",{value:U,configurable:!0}),Iw=($,U)=>{for(var G in U)A1($,G,{get:U[G],enumerable:!0})},Kw=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of Rw(U))if(!Jw.call($,X)&&X!==G)A1($,X,{get:()=>U[X],enumerable:!(W=Fw(U,X))||W.enumerable})}return $},Mw=($)=>Kw(A1({},"__esModule",{value:!0}),$),v4={};Iw(v4,{fromArrayBuffer:()=>Vw,fromString:()=>Ew});c4.exports=Mw(v4);var Bw=u$(),_$=import.meta.require("buffer"),Vw=x4(($,U=0,G=$.byteLength-U)=>{if(!Bw.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return _$.Buffer.from($,U,G)},"fromArrayBuffer"),Ew=x4(($,U)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return U?_$.Buffer.from($,U):_$.Buffer.from($)},"fromString")});var _4=M((y4)=>{Object.defineProperty(y4,"__esModule",{value:!0});y4.fromBase64=void 0;var Tw=_0(),Hw=/^[A-Za-z0-9+/]*={0,2}$/,Aw=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Hw.exec($))throw new TypeError("Invalid base64 string.");const U=Tw.fromString($,"base64");return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)};y4.fromBase64=Aw});var G0=M((i3,l4)=>{var{defineProperty:O1,getOwnPropertyDescriptor:Ow,getOwnPropertyNames:Cw}=Object,fw=Object.prototype.hasOwnProperty,d$=($,U)=>O1($,"name",{value:U,configurable:!0}),qw=($,U)=>{for(var G in U)O1($,G,{get:U[G],enumerable:!0})},Nw=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of Cw(U))if(!fw.call($,X)&&X!==G)O1($,X,{get:()=>U[X],enumerable:!(W=Ow(U,X))||W.enumerable})}return $},jw=($)=>Nw(O1({},"__esModule",{value:!0}),$),d4={};qw(d4,{fromUtf8:()=>p4,toUint8Array:()=>Pw,toUtf8:()=>Sw});l4.exports=jw(d4);var g4=_0(),p4=d$(($)=>{const U=g4.fromString($,"utf8");return new Uint8Array(U.buffer,U.byteOffset,U.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Pw=d$(($)=>{if(typeof $==="string")return p4($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),Sw=d$(($)=>{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 g4.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var n4=M((s4)=>{Object.defineProperty(s4,"__esModule",{value:!0});s4.toBase64=void 0;var Dw=_0(),bw=G0(),kw=($)=>{let U;if(typeof $==="string")U=bw.fromUtf8($);else U=$;if(typeof U!=="object"||typeof U.byteOffset!=="number"||typeof U.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return Dw.fromArrayBuffer(U.buffer,U.byteOffset,U.byteLength).toString("base64")};s4.toBase64=kw});var f1=M((o3,C1)=>{var{defineProperty:i4,getOwnPropertyDescriptor:hw,getOwnPropertyNames:xw}=Object,vw=Object.prototype.hasOwnProperty,g$=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of xw(U))if(!vw.call($,X)&&X!==G)i4($,X,{get:()=>U[X],enumerable:!(W=hw(U,X))||W.enumerable})}return $},r4=($,U,G)=>(g$($,U,"default"),G&&g$(G,U,"default")),cw=($)=>g$(i4({},"__esModule",{value:!0}),$),p$={};C1.exports=cw(p$);r4(p$,_4(),C1.exports);r4(p$,n4(),C1.exports)});var t4=M((o4)=>{Object.defineProperty(o4,"__esModule",{value:!0});o4.getAwsChunkedEncodingStream=void 0;var yw=import.meta.require("stream"),uw=($,U)=>{const{base64Encoder:G,bodyLengthChecker:W,checksumAlgorithmFn:X,checksumLocationName:Z,streamHasher:L}=U,Y=G!==void 0&&X!==void 0&&Z!==void 0&&L!==void 0,w=Y?L(X,$):void 0,Q=new yw.Readable({read:()=>{}});return $.on("data",(z)=>{const F=W(z)||0;Q.push(`${F.toString(16)}\r\n`),Q.push(z),Q.push("\r\n")}),$.on("end",async()=>{if(Q.push("0\r\n"),Y){const z=G(await w);Q.push(`${Z}:${z}\r\n`),Q.push("\r\n")}Q.push(null)}),Q};o4.getAwsChunkedEncodingStream=uw});var s$=M((t3,U6)=>{var{defineProperty:q1,getOwnPropertyDescriptor:_w,getOwnPropertyNames:dw}=Object,gw=Object.prototype.hasOwnProperty,l$=($,U)=>q1($,"name",{value:U,configurable:!0}),pw=($,U)=>{for(var G in U)q1($,G,{get:U[G],enumerable:!0})},lw=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of dw(U))if(!gw.call($,X)&&X!==G)q1($,X,{get:()=>U[X],enumerable:!(W=_w(U,X))||W.enumerable})}return $},sw=($)=>lw(q1({},"__esModule",{value:!0}),$),e4={};pw(e4,{escapeUri:()=>$6,escapeUriPath:()=>nw});U6.exports=sw(e4);var $6=l$(($)=>encodeURIComponent($).replace(/[!'()*]/g,mw),"escapeUri"),mw=l$(($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),nw=l$(($)=>$.split("/").map($6).join("/"),"escapeUriPath")});var n$=M((e3,X6)=>{function W6($){const U=[];for(let G of Object.keys($).sort()){const W=$[G];if(G=m$.escapeUri(G),Array.isArray(W))for(let X=0,Z=W.length;X<Z;X++)U.push(`${G}=${m$.escapeUri(W[X])}`);else{let X=G;if(W||typeof W==="string")X+=`=${m$.escapeUri(W)}`;U.push(X)}}return U.join("&")}var{defineProperty:N1,getOwnPropertyDescriptor:iw,getOwnPropertyNames:rw}=Object,ow=Object.prototype.hasOwnProperty,aw=($,U)=>N1($,"name",{value:U,configurable:!0}),tw=($,U)=>{for(var G in U)N1($,G,{get:U[G],enumerable:!0})},ew=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of rw(U))if(!ow.call($,X)&&X!==G)N1($,X,{get:()=>U[X],enumerable:!(W=iw(U,X))||W.enumerable})}return $},$Q=($)=>ew(N1({},"__esModule",{value:!0}),$),G6={};tw(G6,{buildQueryString:()=>W6});X6.exports=$Q(G6);var m$=s$();aw(W6,"buildQueryString")});var O6=M(($K,A6)=>{async function o$($,U,G=Y6){const W=U.headers??{},X=W.Expect||W.expect;let Z=-1,L=!1;if(X==="100-continue")await Promise.race([new Promise((Y)=>{Z=Number(setTimeout(Y,Math.max(Y6,G)))}),new Promise((Y)=>{$.on("continue",()=>{clearTimeout(Z),Y()}),$.on("error",()=>{L=!0,clearTimeout(Z),Y()})})]);if(!L)K6($,U.body)}function K6($,U){if(U instanceof I6.Readable){U.pipe($);return}if(U){if(Buffer.isBuffer(U)||typeof U==="string"){$.end(U);return}const G=U;if(typeof G==="object"&&G.buffer&&typeof G.byteOffset==="number"&&typeof G.byteLength==="number"){$.end(Buffer.from(G.buffer,G.byteOffset,G.byteLength));return}$.end(Buffer.from(U));return}$.end()}async function H6($){const U=[],G=$.getReader();let W=!1,X=0;while(!W){const{done:Y,value:w}=await G.read();if(w)U.push(w),X+=w.length;W=Y}const Z=new Uint8Array(X);let L=0;for(let Y of U)Z.set(Y,L),L+=Y.length;return Z}var{create:UQ,defineProperty:d0,getOwnPropertyDescriptor:GQ,getOwnPropertyNames:WQ,getPrototypeOf:XQ}=Object,ZQ=Object.prototype.hasOwnProperty,O=($,U)=>d0($,"name",{value:U,configurable:!0}),LQ=($,U)=>{for(var G in U)d0($,G,{get:U[G],enumerable:!0})},Q6=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of WQ(U))if(!ZQ.call($,X)&&X!==G)d0($,X,{get:()=>U[X],enumerable:!(W=GQ(U,X))||W.enumerable})}return $},YQ=($,U,G)=>(G=$!=null?UQ(XQ($)):{},Q6(U||!$||!$.__esModule?d0(G,"default",{value:$,enumerable:!0}):G,$)),wQ=($)=>Q6(d0({},"__esModule",{value:!0}),$),z6={};LQ(z6,{DEFAULT_REQUEST_TIMEOUT:()=>IQ,NodeHttp2Handler:()=>EQ,NodeHttpHandler:()=>KQ,streamCollector:()=>HQ});A6.exports=wQ(z6);var F6=o(),R6=n$(),i$=import.meta.require("http"),r$=import.meta.require("https"),QQ=["ECONNRESET","EPIPE","ETIMEDOUT"],J6=O(($)=>{const U={};for(let G of Object.keys($)){const W=$[G];U[G]=Array.isArray(W)?W.join(","):W}return U},"getTransformedHeaders"),Z6=1000,zQ=O(($,U,G=0)=>{if(!G)return-1;const W=O((X)=>{const Z=setTimeout(()=>{$.destroy(),U(Object.assign(new Error(`Socket timed out without establishing a connection within ${G} ms`),{name:"TimeoutError"}))},G-X),L=O((Y)=>{if(Y==null?void 0:Y.connecting)Y.on("connect",()=>{clearTimeout(Z)});else clearTimeout(Z)},"doWithSocket");if($.socket)L($.socket);else $.on("socket",L)},"registerTimeout");if(G<2000)return W(0),0;return setTimeout(W.bind(null,Z6),Z6)},"setConnectionTimeout"),FQ=3000,RQ=O(($,{keepAlive:U,keepAliveMsecs:G},W=FQ)=>{if(U!==!0)return-1;const X=O(()=>{if($.socket)$.socket.setKeepAlive(U,G||0);else $.on("socket",(Z)=>{Z.setKeepAlive(U,G||0)})},"registerListener");if(W===0)return X(),0;return setTimeout(X,W)},"setSocketKeepAlive"),L6=3000,JQ=O(($,U,G=0)=>{const W=O((X)=>{$.setTimeout(G-X,()=>{$.destroy(),U(Object.assign(new Error(`Connection timed out after ${G} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<G&&G<6000)return W(0),0;return setTimeout(W.bind(null,G===0?0:L6),L6)},"setSocketTimeout"),I6=import.meta.require("stream"),Y6=1000;O(o$,"writeRequestBody");O(K6,"writeBody");var IQ=0,M6=class ${constructor(U){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((G,W)=>{if(typeof U==="function")U().then((X)=>{G(this.resolveDefaultConfig(X))}).catch(W);else G(this.resolveDefaultConfig(U))})}static create(U){if(typeof(U==null?void 0:U.handle)==="function")return U;return new $(U)}static checkSocketUsage(U,G,W=console){var X,Z,L;const{sockets:Y,requests:w,maxSockets:Q}=U;if(typeof Q!=="number"||Q===1/0)return G;const z=15000;if(Date.now()-z<G)return G;if(Y&&w)for(let F in Y){const R=((X=Y[F])==null?void 0:X.length)??0,J=((Z=w[F])==null?void 0:Z.length)??0;if(R>=Q&&J>=2*Q)return(L=W==null?void 0:W.warn)==null||L.call(W,`@smithy/node-http-handler:WARN - socket usage at capacity=${R} and ${J} 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 G}resolveDefaultConfig(U){const{requestTimeout:G,connectionTimeout:W,socketTimeout:X,httpAgent:Z,httpsAgent:L}=U||{};return{connectionTimeout:W,requestTimeout:G??X,httpAgent:(()=>{if(Z instanceof i$.Agent||typeof(Z==null?void 0:Z.destroy)==="function")return Z;return new i$.Agent({keepAlive:!0,maxSockets:50,...Z})})(),httpsAgent:(()=>{if(L instanceof r$.Agent||typeof(L==null?void 0:L.destroy)==="function")return L;return new r$.Agent({keepAlive:!0,maxSockets:50,...L})})(),logger:console}}destroy(){var U,G,W,X;(G=(U=this.config)==null?void 0:U.httpAgent)==null||G.destroy(),(X=(W=this.config)==null?void 0:W.httpsAgent)==null||X.destroy()}async handle(U,{abortSignal:G}={}){if(!this.config)this.config=await this.configProvider;return new Promise((W,X)=>{let Z=void 0;const L=[],Y=O(async(H)=>{await Z,L.forEach(clearTimeout),W(H)},"resolve"),w=O(async(H)=>{await Z,L.forEach(clearTimeout),X(H)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(G==null?void 0:G.aborted){const H=new Error("Request aborted");H.name="AbortError",w(H);return}const Q=U.protocol==="https:",z=Q?this.config.httpsAgent:this.config.httpAgent;L.push(setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(z,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const F=R6.buildQueryString(U.query||{});let R=void 0;if(U.username!=null||U.password!=null){const H=U.username??"",A=U.password??"";R=`${H}:${A}`}let J=U.path;if(F)J+=`?${F}`;if(U.fragment)J+=`#${U.fragment}`;let I=U.hostname??"";if(I[0]==="["&&I.endsWith("]"))I=U.hostname.slice(1,-1);else I=U.hostname;const V={headers:U.headers,host:I,method:U.method,path:J,port:U.port,agent:z,auth:R},E=(Q?r$.request:i$.request)(V,(H)=>{const A=new F6.HttpResponse({statusCode:H.statusCode||-1,reason:H.statusMessage,headers:J6(H.headers),body:H});Y({response:A})});if(E.on("error",(H)=>{if(QQ.includes(H.code))w(Object.assign(H,{name:"TimeoutError"}));else w(H)}),G){const H=O(()=>{E.destroy();const A=new Error("Request aborted");A.name="AbortError",w(A)},"onAbort");if(typeof G.addEventListener==="function"){const A=G;A.addEventListener("abort",H,{once:!0}),E.once("close",()=>A.removeEventListener("abort",H))}else G.onabort=H}L.push(zQ(E,w,this.config.connectionTimeout)),L.push(JQ(E,w,this.config.requestTimeout));const T=V.agent;if(typeof T==="object"&&"keepAlive"in T)L.push(RQ(E,{keepAlive:T.keepAlive,keepAliveMsecs:T.keepAliveMsecs}));Z=o$(E,U,this.config.requestTimeout).catch((H)=>{return L.forEach(clearTimeout),X(H)})})}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((W)=>{return{...W,[U]:G}})}httpHandlerConfigs(){return this.config??{}}};O(M6,"NodeHttpHandler");var KQ=M6,w6=import.meta.require("http2"),MQ=YQ(import.meta.require("http2")),B6=class ${constructor(U){this.sessions=[],this.sessions=U??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(U){this.sessions.push(U)}contains(U){return this.sessions.includes(U)}remove(U){this.sessions=this.sessions.filter((G)=>G!==U)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(U){for(let G of this.sessions)if(G===U){if(!G.destroyed)G.destroy()}}};O(B6,"NodeHttp2ConnectionPool");var BQ=B6,V6=class ${constructor(U){if(this.sessionCache=new Map,this.config=U,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(U,G){const W=this.getUrlString(U),X=this.sessionCache.get(W);if(X){const w=X.poll();if(w&&!this.config.disableConcurrency)return w}const Z=MQ.default.connect(W);if(this.config.maxConcurrency)Z.settings({maxConcurrentStreams:this.config.maxConcurrency},(w)=>{if(w)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+U.destination.toString())});Z.unref();const L=O(()=>{Z.destroy(),this.deleteSession(W,Z)},"destroySessionCb");if(Z.on("goaway",L),Z.on("error",L),Z.on("frameError",L),Z.on("close",()=>this.deleteSession(W,Z)),G.requestTimeout)Z.setTimeout(G.requestTimeout,L);const Y=this.sessionCache.get(W)||new BQ;return Y.offerLast(Z),this.sessionCache.set(W,Y),Z}deleteSession(U,G){const W=this.sessionCache.get(U);if(!W)return;if(!W.contains(G))return;W.remove(G),this.sessionCache.set(U,W)}release(U,G){var W;const X=this.getUrlString(U);(W=this.sessionCache.get(X))==null||W.offerLast(G)}destroy(){for(let[U,G]of this.sessionCache){for(let W of G){if(!W.destroyed)W.destroy();G.remove(W)}this.sessionCache.delete(U)}}setMaxConcurrentStreams(U){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=U}setDisableConcurrentStreams(U){this.config.disableConcurrency=U}getUrlString(U){return U.destination.toString()}};O(V6,"NodeHttp2ConnectionManager");var VQ=V6,E6=class ${constructor(U){this.metadata={handlerProtocol:"h2"},this.connectionManager=new VQ({}),this.configProvider=new Promise((G,W)=>{if(typeof U==="function")U().then((X)=>{G(X||{})}).catch(W);else G(U||{})})}static create(U){if(typeof(U==null?void 0:U.handle)==="function")return U;return new $(U)}destroy(){this.connectionManager.destroy()}async handle(U,{abortSignal:G}={}){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:W,disableConcurrentStreams:X}=this.config;return new Promise((Z,L)=>{var Y;let w=!1,Q=void 0;const z=O(async(N)=>{await Q,Z(N)},"resolve"),F=O(async(N)=>{await Q,L(N)},"reject");if(G==null?void 0:G.aborted){w=!0;const N=new Error("Request aborted");N.name="AbortError",F(N);return}const{hostname:R,method:J,port:I,protocol:V,query:B}=U;let E="";if(U.username!=null||U.password!=null){const N=U.username??"",p=U.password??"";E=`${N}:${p}@`}const T=`${V}//${E}${R}${I?`:${I}`:""}`,H={destination:new URL(T)},A=this.connectionManager.lease(H,{requestTimeout:(Y=this.config)==null?void 0:Y.sessionTimeout,disableConcurrentStreams:X||!1}),S=O((N)=>{if(X)this.destroySession(A);w=!0,F(N)},"rejectWithDestroy"),h=R6.buildQueryString(B||{});let w0=U.path;if(h)w0+=`?${h}`;if(U.fragment)w0+=`#${U.fragment}`;const c=A.request({...U.headers,[w6.constants.HTTP2_HEADER_PATH]:w0,[w6.constants.HTTP2_HEADER_METHOD]:J});if(A.ref(),c.on("response",(N)=>{const p=new F6.HttpResponse({statusCode:N[":status"]||-1,headers:J6(N),body:c});if(w=!0,z({response:p}),X)A.close(),this.connectionManager.deleteSession(T,A)}),W)c.setTimeout(W,()=>{c.close();const N=new Error(`Stream timed out because of no activity for ${W} ms`);N.name="TimeoutError",S(N)});if(G){const N=O(()=>{c.close();const p=new Error("Request aborted");p.name="AbortError",S(p)},"onAbort");if(typeof G.addEventListener==="function"){const p=G;p.addEventListener("abort",N,{once:!0}),c.once("close",()=>p.removeEventListener("abort",N))}else G.onabort=N}c.on("frameError",(N,p,gL)=>{S(new Error(`Frame type id ${N} in stream id ${gL} has failed with code ${p}.`))}),c.on("error",S),c.on("aborted",()=>{S(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${c.rstCode}.`))}),c.on("close",()=>{if(A.unref(),X)A.destroy();if(!w)S(new Error("Unexpected error: http2 request did not get a response"))}),Q=o$(c,U,W)})}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((W)=>{return{...W,[U]:G}})}httpHandlerConfigs(){return this.config??{}}destroySession(U){if(!U.destroyed)U.destroy()}};O(E6,"NodeHttp2Handler");var EQ=E6,T6=class $ extends I6.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(U,G,W){this.bufferedBytes.push(U),W()}};O(T6,"Collector");var TQ=T6,HQ=O(($)=>{if(AQ($))return H6($);return new Promise((U,G)=>{const W=new TQ;$.pipe(W),$.on("error",(X)=>{W.end(),G(X)}),W.on("error",G),W.on("finish",function(){const X=new Uint8Array(Buffer.concat(this.bufferedBytes));U(X)})})},"streamCollector"),AQ=O(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");O(H6,"collectReadableStream")});var b6=M((UK,D6)=>{function q6($=0){return new Promise((U,G)=>{if($)setTimeout(()=>{const W=new Error(`Request did not complete within ${$} ms`);W.name="TimeoutError",G(W)},$)})}async function j6($){const U=await S6($),G=DQ.fromBase64(U);return new Uint8Array(G)}async function P6($){const U=[],G=$.getReader();let W=!1,X=0;while(!W){const{done:Y,value:w}=await G.read();if(w)U.push(w),X+=w.length;W=Y}const Z=new Uint8Array(X);let L=0;for(let Y of U)Z.set(Y,L),L+=Y.length;return Z}function S6($){return new Promise((U,G)=>{const W=new FileReader;W.onloadend=()=>{if(W.readyState!==2)return G(new Error("Reader aborted too early"));const X=W.result??"",Z=X.indexOf(","),L=Z>-1?Z+1:X.length;U(X.substring(L))},W.onabort=()=>G(new Error("Read aborted")),W.onerror=()=>G(W.error),W.readAsDataURL($)})}var{defineProperty:P1,getOwnPropertyDescriptor:OQ,getOwnPropertyNames:CQ}=Object,fQ=Object.prototype.hasOwnProperty,a=($,U)=>P1($,"name",{value:U,configurable:!0}),qQ=($,U)=>{for(var G in U)P1($,G,{get:U[G],enumerable:!0})},NQ=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of CQ(U))if(!fQ.call($,X)&&X!==G)P1($,X,{get:()=>U[X],enumerable:!(W=OQ(U,X))||W.enumerable})}return $},jQ=($)=>NQ(P1({},"__esModule",{value:!0}),$),f6={};qQ(f6,{FetchHttpHandler:()=>SQ,keepAliveSupport:()=>j1,streamCollector:()=>bQ});D6.exports=jQ(f6);var C6=o(),PQ=n$();a(q6,"requestTimeout");var j1={supported:void 0},N6=class ${static create(U){if(typeof(U==null?void 0:U.handle)==="function")return U;return new $(U)}constructor(U){if(typeof U==="function")this.configProvider=U().then((G)=>G||{});else this.config=U??{},this.configProvider=Promise.resolve(this.config);if(j1.supported===void 0)j1.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(U,{abortSignal:G}={}){var W;if(!this.config)this.config=await this.configProvider;const X=this.config.requestTimeout,Z=this.config.keepAlive===!0,L=this.config.credentials;if(G==null?void 0:G.aborted){const T=new Error("Request aborted");return T.name="AbortError",Promise.reject(T)}let Y=U.path;const w=PQ.buildQueryString(U.query||{});if(w)Y+=`?${w}`;if(U.fragment)Y+=`#${U.fragment}`;let Q="";if(U.username!=null||U.password!=null){const T=U.username??"",H=U.password??"";Q=`${T}:${H}@`}const{port:z,method:F}=U,R=`${U.protocol}//${Q}${U.hostname}${z?`:${z}`:""}${Y}`,J=F==="GET"||F==="HEAD"?void 0:U.body,I={body:J,headers:new Headers(U.headers),method:F,credentials:L};if((W=this.config)==null?void 0:W.cache)I.cache=this.config.cache;if(J)I.duplex="half";if(typeof AbortController!=="undefined")I.signal=G;if(j1.supported)I.keepalive=Z;if(typeof this.config.requestInit==="function")Object.assign(I,this.config.requestInit(U));let V=a(()=>{},"removeSignalEventListener");const B=new Request(R,I),E=[fetch(B).then((T)=>{const H=T.headers,A={};for(let h of H.entries())A[h[0]]=h[1];if(T.body==null)return T.blob().then((h)=>({response:new C6.HttpResponse({headers:A,reason:T.statusText,statusCode:T.status,body:h})}));return{response:new C6.HttpResponse({headers:A,reason:T.statusText,statusCode:T.status,body:T.body})}}),q6(X)];if(G)E.push(new Promise((T,H)=>{const A=a(()=>{const S=new Error("Request aborted");S.name="AbortError",H(S)},"onAbort");if(typeof G.addEventListener==="function"){const S=G;S.addEventListener("abort",A,{once:!0}),V=a(()=>S.removeEventListener("abort",A),"removeSignalEventListener")}else G.onabort=A}));return Promise.race(E).finally(V)}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((W)=>{return W[U]=G,W})}httpHandlerConfigs(){return this.config??{}}};a(N6,"FetchHttpHandler");var SQ=N6,DQ=f1(),bQ=a(($)=>{if(typeof Blob==="function"&&$ instanceof Blob)return j6($);return P6($)},"streamCollector");a(j6,"collectBlob");a(P6,"collectStream");a(S6,"readToBase64")});var g0=M((k6)=>{Object.defineProperty(k6,"__esModule",{value:!0});k6.isReadableStream=void 0;var kQ=($)=>{var U;return typeof ReadableStream==="function"&&(((U=$===null||$===void 0?void 0:$.constructor)===null||U===void 0?void 0:U.name)===ReadableStream.name||$ instanceof ReadableStream)};k6.isReadableStream=kQ});var d6=M((u6)=>{Object.defineProperty(u6,"__esModule",{value:!0});u6.sdkStreamMixin=void 0;var hQ=b6(),xQ=f1(),vQ=y6(),cQ=G0(),x6=g0(),v6="The stream has already been transformed.",yQ=($)=>{var U,G;if(!c6($)&&!x6.isReadableStream($)){const L=((G=(U=$===null||$===void 0?void 0:$.__proto__)===null||U===void 0?void 0:U.constructor)===null||G===void 0?void 0:G.name)||$;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${L}`)}let W=!1;const X=async()=>{if(W)throw new Error(v6);return W=!0,await hQ.streamCollector($)},Z=(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:X,transformToString:async(L)=>{const Y=await X();if(L==="base64")return xQ.toBase64(Y);else if(L==="hex")return vQ.toHex(Y);else if(L===void 0||L==="utf8"||L==="utf-8")return cQ.toUtf8(Y);else if(typeof TextDecoder==="function")return new TextDecoder(L).decode(Y);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(W)throw new Error(v6);if(W=!0,c6($))return Z($);else if(x6.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};u6.sdkStreamMixin=yQ;var c6=($)=>typeof Blob==="function"&&$ instanceof Blob});var s6=M((p6)=>{Object.defineProperty(p6,"__esModule",{value:!0});p6.sdkStreamMixin=void 0;var uQ=O6(),_Q=_0(),a$=import.meta.require("stream"),dQ=import.meta.require("util"),gQ=d6(),g6="The stream has already been transformed.",pQ=($)=>{var U,G;if(!($ instanceof a$.Readable))try{return gQ.sdkStreamMixin($)}catch(Z){const L=((G=(U=$===null||$===void 0?void 0:$.__proto__)===null||U===void 0?void 0:U.constructor)===null||G===void 0?void 0:G.name)||$;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${L}`)}let W=!1;const X=async()=>{if(W)throw new Error(g6);return W=!0,await uQ.streamCollector($)};return Object.assign($,{transformToByteArray:X,transformToString:async(Z)=>{const L=await X();if(Z===void 0||Buffer.isEncoding(Z))return _Q.fromArrayBuffer(L.buffer,L.byteOffset,L.byteLength).toString(Z);else return new dQ.TextDecoder(Z).decode(L)},transformToWebStream:()=>{if(W)throw new Error(g6);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof a$.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 W=!0,a$.Readable.toWeb($)}})};p6.sdkStreamMixin=pQ});var i6=M((m6)=>{async function lQ($){if(typeof $.stream==="function")$=$.stream();return $.tee()}Object.defineProperty(m6,"__esModule",{value:!0});m6.splitStream=void 0;m6.splitStream=lQ});var t6=M((o6)=>{async function nQ($){if(mQ.isReadableStream($))return sQ.splitStream($);const U=new r6.PassThrough,G=new r6.PassThrough;return $.pipe(U),$.pipe(G),[U,G]}Object.defineProperty(o6,"__esModule",{value:!0});o6.splitStream=void 0;var r6=import.meta.require("stream"),sQ=i6(),mQ=g0();o6.splitStream=nQ});var UW=M((e6)=>{async function iQ($,U){var G;let W=0;const X=[],Z=$.getReader();let L=!1;while(!L){const{done:Q,value:z}=await Z.read();if(z)X.push(z),W+=(G=z===null||z===void 0?void 0:z.byteLength)!==null&&G!==void 0?G:0;if(W>=U)break;L=Q}Z.releaseLock();const Y=new Uint8Array(Math.min(U,W));let w=0;for(let Q of X){if(Q.byteLength>Y.byteLength-w){Y.set(Q.subarray(0,Y.byteLength-w),w);break}else Y.set(Q,w);w+=Q.length}return Y}Object.defineProperty(e6,"__esModule",{value:!0});e6.headStream=void 0;e6.headStream=iQ});var ZW=M((WW)=>{Object.defineProperty(WW,"__esModule",{value:!0});WW.headStream=void 0;var rQ=import.meta.require("stream"),oQ=UW(),aQ=g0(),tQ=($,U)=>{if(aQ.isReadableStream($))return oQ.headStream($,U);return new Promise((G,W)=>{const X=new GW;X.limit=U,$.pipe(X),$.on("error",(Z)=>{X.end(),W(Z)}),X.on("error",W),X.on("finish",function(){const Z=new Uint8Array(Buffer.concat(this.buffers));G(Z)})})};WW.headStream=tQ;class GW extends rQ.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write($,U,G){var W;if(this.buffers.push($),this.bytesBuffered+=(W=$.byteLength)!==null&&W!==void 0?W:0,this.bytesBuffered>=this.limit){const X=this.bytesBuffered-this.limit,Z=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=Z.subarray(0,Z.byteLength-X),this.emit("finish")}G()}}});var FW=M((QK,I0)=>{function wW($,U="utf-8"){if(U==="base64")return LW.toBase64($);return YW.toUtf8($)}function QW($,U){if(U==="base64")return e$.mutate(LW.fromBase64($));return e$.mutate(YW.fromUtf8($))}var{defineProperty:S1,getOwnPropertyDescriptor:eQ,getOwnPropertyNames:$7}=Object,U7=Object.prototype.hasOwnProperty,$U=($,U)=>S1($,"name",{value:U,configurable:!0}),G7=($,U)=>{for(var G in U)S1($,G,{get:U[G],enumerable:!0})},t$=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of $7(U))if(!U7.call($,X)&&X!==G)S1($,X,{get:()=>U[X],enumerable:!(W=eQ(U,X))||W.enumerable})}return $},p0=($,U,G)=>(t$($,U,"default"),G&&t$(G,U,"default")),W7=($)=>t$(S1({},"__esModule",{value:!0}),$),J0={};G7(J0,{Uint8ArrayBlobAdapter:()=>e$});I0.exports=W7(J0);var LW=f1(),YW=G0();$U(wW,"transformToString");$U(QW,"transformFromString");var zW=class $ extends Uint8Array{static fromString(U,G="utf-8"){switch(typeof U){case"string":return QW(U,G);default:throw new Error(`Unsupported conversion from ${typeof U} to Uint8ArrayBlobAdapter.`)}}static mutate(U){return Object.setPrototypeOf(U,$.prototype),U}transformToString(U="utf-8"){return wW(this,U)}};$U(zW,"Uint8ArrayBlobAdapter");var e$=zW;p0(J0,t4(),I0.exports);p0(J0,s6(),I0.exports);p0(J0,t6(),I0.exports);p0(J0,ZW(),I0.exports);p0(J0,g0(),I0.exports)});var q0=M((zK,hW)=>{function fW($){const U=$.getUTCFullYear(),G=$.getUTCMonth(),W=$.getUTCDay(),X=$.getUTCDate(),Z=$.getUTCHours(),L=$.getUTCMinutes(),Y=$.getUTCSeconds(),w=X<10?`0${X}`:`${X}`,Q=Z<10?`0${Z}`:`${Z}`,z=L<10?`0${L}`:`${L}`,F=Y<10?`0${Y}`:`${Y}`;return`${D7[W]}, ${w} ${FU[G]} ${U} ${Q}:${z}:${F} GMT`}function k1($){return encodeURIComponent($).replace(/[!'()*]/g,function(U){return"%"+U.charCodeAt(0).toString(16).toUpperCase()})}function RU($,U,G){let W,X,Z;if(typeof U==="undefined"&&typeof G==="undefined")W={},Z=$;else if(W=$,typeof U==="function")return X=U,Z=G,zz(W,X,Z);else Z=U;for(let L of Object.keys(Z)){if(!Array.isArray(Z[L])){W[L]=Z[L];continue}bW(W,null,Z,L)}return W}function kW($,U,G){if(G<=0||!Number.isInteger(G))throw new Error("Invalid number of delimiters ("+G+") for splitEvery.");const W=$.split(U);if(G===1)return W;const X=[];let Z="";for(let L=0;L<W.length;L++){if(Z==="")Z=W[L];else Z+=U+W[L];if((L+1)%G===0)X.push(Z),Z=""}if(Z!=="")X.push(Z);return X}var{defineProperty:h1,getOwnPropertyDescriptor:X7,getOwnPropertyNames:Z7}=Object,L7=Object.prototype.hasOwnProperty,K=($,U)=>h1($,"name",{value:U,configurable:!0}),Y7=($,U)=>{for(var G in U)h1($,G,{get:U[G],enumerable:!0})},w7=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of Z7(U))if(!L7.call($,X)&&X!==G)h1($,X,{get:()=>U[X],enumerable:!(W=X7(U,X))||W.enumerable})}return $},Q7=($)=>w7(h1({},"__esModule",{value:!0}),$),JW={};Y7(JW,{Client:()=>F7,Command:()=>VW,LazyJsonString:()=>Yz,NoOpLogger:()=>z7,SENSITIVE_STRING:()=>I7,ServiceException:()=>r7,StringWrapper:()=>i0,_json:()=>YU,collectBody:()=>R7,convertMap:()=>wz,createAggregatedClient:()=>K7,dateToUtcString:()=>fW,decorateServiceException:()=>NW,emitWarningIfUnsupportedVersion:()=>e7,expectBoolean:()=>B7,expectByte:()=>LU,expectFloat32:()=>D1,expectInt:()=>E7,expectInt32:()=>XU,expectLong:()=>m0,expectNonNull:()=>H7,expectNumber:()=>s0,expectObject:()=>TW,expectShort:()=>ZU,expectString:()=>A7,expectUnion:()=>O7,extendedEncodeURIComponent:()=>k1,getArrayIfSingleItem:()=>Lz,getDefaultClientConfiguration:()=>Xz,getDefaultExtensionConfiguration:()=>PW,getValueFromTextNode:()=>SW,handleFloat:()=>q7,limitedParseDouble:()=>zU,limitedParseFloat:()=>N7,limitedParseFloat32:()=>j7,loadConfigsForDefaultMode:()=>t7,logger:()=>n0,map:()=>RU,parseBoolean:()=>M7,parseEpochTimestamp:()=>_7,parseRfc3339DateTime:()=>k7,parseRfc3339DateTimeWithOffset:()=>x7,parseRfc7231DateTime:()=>u7,resolveDefaultRuntimeConfig:()=>Zz,resolvedPath:()=>Jz,serializeDateTime:()=>Kz,serializeFloat:()=>Iz,splitEvery:()=>kW,strictParseByte:()=>CW,strictParseDouble:()=>QU,strictParseFloat:()=>C7,strictParseFloat32:()=>HW,strictParseInt:()=>P7,strictParseInt32:()=>S7,strictParseLong:()=>OW,strictParseShort:()=>O0,take:()=>Qz,throwDefaultError:()=>jW,withBaseException:()=>o7});hW.exports=Q7(JW);var IW=class ${trace(){}debug(){}info(){}warn(){}error(){}};K(IW,"NoOpLogger");var z7=IW,KW=b4(),MW=class ${constructor(U){this.config=U,this.middlewareStack=KW.constructStack()}send(U,G,W){const X=typeof G!=="function"?G:void 0,Z=typeof G==="function"?G:W,L=X===void 0&&this.config.cacheMiddleware===!0;let Y;if(L){if(!this.handlers)this.handlers=new WeakMap;const w=this.handlers;if(w.has(U.constructor))Y=w.get(U.constructor);else Y=U.resolveMiddleware(this.middlewareStack,this.config,X),w.set(U.constructor,Y)}else delete this.handlers,Y=U.resolveMiddleware(this.middlewareStack,this.config,X);if(Z)Y(U).then((w)=>Z(null,w.output),(w)=>Z(w)).catch(()=>{});else return Y(U).then((w)=>w.output)}destroy(){var U,G,W;(W=(G=(U=this.config)==null?void 0:U.requestHandler)==null?void 0:G.destroy)==null||W.call(G),delete this.handlers}};K(MW,"Client");var F7=MW,UU=FW(),R7=K(async($=new Uint8Array,U)=>{if($ instanceof Uint8Array)return UU.Uint8ArrayBlobAdapter.mutate($);if(!$)return UU.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const G=U.streamCollector($);return UU.Uint8ArrayBlobAdapter.mutate(await G)},"collectBody"),WU=Q0(),BW=class ${constructor(){this.middlewareStack=KW.constructStack()}static classBuilder(){return new J7}resolveMiddlewareWithContext(U,G,W,{middlewareFn:X,clientName:Z,commandName:L,inputFilterSensitiveLog:Y,outputFilterSensitiveLog:w,smithyContext:Q,additionalContext:z,CommandCtor:F}){for(let B of X.bind(this)(F,U,G,W))this.middlewareStack.use(B);const R=U.concat(this.middlewareStack),{logger:J}=G,I={logger:J,clientName:Z,commandName:L,inputFilterSensitiveLog:Y,outputFilterSensitiveLog:w,[WU.SMITHY_CONTEXT_KEY]:{commandInstance:this,...Q},...z},{requestHandler:V}=G;return R.resolve((B)=>V.handle(B.request,W||{}),I)}};K(BW,"Command");var VW=BW,EW=class ${constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(U)=>U,this._outputFilterSensitiveLog=(U)=>U,this._serializer=null,this._deserializer=null}init(U){this._init=U}ep(U){return this._ep=U,this}m(U){return this._middlewareFn=U,this}s(U,G,W={}){return this._smithyContext={service:U,operation:G,...W},this}c(U={}){return this._additionalContext=U,this}n(U,G){return this._clientName=U,this._commandName=G,this}f(U=(W)=>W,G=(W)=>W){return this._inputFilterSensitiveLog=U,this._outputFilterSensitiveLog=G,this}ser(U){return this._serializer=U,this}de(U){return this._deserializer=U,this}build(){var U;const G=this;let W;return W=(U=class extends VW{constructor(...[X]){super();this.serialize=G._serializer,this.deserialize=G._deserializer,this.input=X??{},G._init(this)}static getEndpointParameterInstructions(){return G._ep}resolveMiddleware(X,Z,L){return this.resolveMiddlewareWithContext(X,Z,L,{CommandCtor:W,middlewareFn:G._middlewareFn,clientName:G._clientName,commandName:G._commandName,inputFilterSensitiveLog:G._inputFilterSensitiveLog,outputFilterSensitiveLog:G._outputFilterSensitiveLog,smithyContext:G._smithyContext,additionalContext:G._additionalContext})}},K(U,"CommandRef"),U)}};K(EW,"ClassBuilder");var J7=EW,I7="***SensitiveInformation***",K7=K(($,U)=>{for(let G of Object.keys($)){const W=$[G],X=K(async function(L,Y,w){const Q=new W(L);if(typeof Y==="function")this.send(Q,Y);else if(typeof w==="function"){if(typeof Y!=="object")throw new Error(`Expected http options but got ${typeof Y}`);this.send(Q,Y||{},w)}else return this.send(Q,Y)},"methodImpl"),Z=(G[0].toLowerCase()+G.slice(1)).replace(/Command$/,"");U.prototype[Z]=X}},"createAggregatedClient"),M7=K(($)=>{switch($){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${$}"`)}},"parseBoolean"),B7=K(($)=>{if($===null||$===void 0)return;if(typeof $==="number"){if($===0||$===1)n0.warn(b1(`Expected boolean, got ${typeof $}: ${$}`));if($===0)return!1;if($===1)return!0}if(typeof $==="string"){const U=$.toLowerCase();if(U==="false"||U==="true")n0.warn(b1(`Expected boolean, got ${typeof $}: ${$}`));if(U==="false")return!1;if(U==="true")return!0}if(typeof $==="boolean")return $;throw new TypeError(`Expected boolean, got ${typeof $}: ${$}`)},"expectBoolean"),s0=K(($)=>{if($===null||$===void 0)return;if(typeof $==="string"){const U=parseFloat($);if(!Number.isNaN(U)){if(String(U)!==String($))n0.warn(b1(`Expected number but observed string: ${$}`));return U}}if(typeof $==="number")return $;throw new TypeError(`Expected number, got ${typeof $}: ${$}`)},"expectNumber"),V7=Math.ceil(340282346638528860000000000000000000000),D1=K(($)=>{const U=s0($);if(U!==void 0&&!Number.isNaN(U)&&U!==1/0&&U!==-1/0){if(Math.abs(U)>V7)throw new TypeError(`Expected 32-bit float, got ${$}`)}return U},"expectFloat32"),m0=K(($)=>{if($===null||$===void 0)return;if(Number.isInteger($)&&!Number.isNaN($))return $;throw new TypeError(`Expected integer, got ${typeof $}: ${$}`)},"expectLong"),E7=m0,XU=K(($)=>wU($,32),"expectInt32"),ZU=K(($)=>wU($,16),"expectShort"),LU=K(($)=>wU($,8),"expectByte"),wU=K(($,U)=>{const G=m0($);if(G!==void 0&&T7(G,U)!==G)throw new TypeError(`Expected ${U}-bit integer, got ${$}`);return G},"expectSizedInt"),T7=K(($,U)=>{switch(U){case 32:return Int32Array.of($)[0];case 16:return Int16Array.of($)[0];case 8:return Int8Array.of($)[0]}},"castInt"),H7=K(($,U)=>{if($===null||$===void 0){if(U)throw new TypeError(`Expected a non-null value for ${U}`);throw new TypeError("Expected a non-null value")}return $},"expectNonNull"),TW=K(($)=>{if($===null||$===void 0)return;if(typeof $==="object"&&!Array.isArray($))return $;const U=Array.isArray($)?"array":typeof $;throw new TypeError(`Expected object, got ${U}: ${$}`)},"expectObject"),A7=K(($)=>{if($===null||$===void 0)return;if(typeof $==="string")return $;if(["boolean","number","bigint"].includes(typeof $))return n0.warn(b1(`Expected string, got ${typeof $}: ${$}`)),String($);throw new TypeError(`Expected string, got ${typeof $}: ${$}`)},"expectString"),O7=K(($)=>{if($===null||$===void 0)return;const U=TW($),G=Object.entries(U).filter(([,W])=>W!=null).map(([W])=>W);if(G.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(G.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${G} were not null.`);return U},"expectUnion"),QU=K(($)=>{if(typeof $=="string")return s0(f0($));return s0($)},"strictParseDouble"),C7=QU,HW=K(($)=>{if(typeof $=="string")return D1(f0($));return D1($)},"strictParseFloat32"),f7=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,f0=K(($)=>{const U=$.match(f7);if(U===null||U[0].length!==$.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat($)},"parseNumber"),zU=K(($)=>{if(typeof $=="string")return AW($);return s0($)},"limitedParseDouble"),q7=zU,N7=zU,j7=K(($)=>{if(typeof $=="string")return AW($);return D1($)},"limitedParseFloat32"),AW=K(($)=>{switch($){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${$}`)}},"parseFloatString"),OW=K(($)=>{if(typeof $==="string")return m0(f0($));return m0($)},"strictParseLong"),P7=OW,S7=K(($)=>{if(typeof $==="string")return XU(f0($));return XU($)},"strictParseInt32"),O0=K(($)=>{if(typeof $==="string")return ZU(f0($));return ZU($)},"strictParseShort"),CW=K(($)=>{if(typeof $==="string")return LU(f0($));return LU($)},"strictParseByte"),b1=K(($)=>{return String(new TypeError($).stack||$).split("\n").slice(0,5).filter((U)=>!U.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),n0={warn:console.warn},D7=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],FU=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];K(fW,"dateToUtcString");var b7=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),k7=K(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const U=b7.exec($);if(!U)throw new TypeError("Invalid RFC-3339 date-time value");const[G,W,X,Z,L,Y,w,Q]=U,z=O0(C0(W)),F=i(X,"month",1,12),R=i(Z,"day",1,31);return l0(z,F,R,{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q})},"parseRfc3339DateTime"),h7=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),x7=K(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const U=h7.exec($);if(!U)throw new TypeError("Invalid RFC-3339 date-time value");const[G,W,X,Z,L,Y,w,Q,z]=U,F=O0(C0(W)),R=i(X,"month",1,12),J=i(Z,"day",1,31),I=l0(F,R,J,{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q});if(z.toUpperCase()!="Z")I.setTime(I.getTime()-i7(z));return I},"parseRfc3339DateTimeWithOffset"),v7=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$/),c7=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$/),y7=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})$/),u7=K(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let U=v7.exec($);if(U){const[G,W,X,Z,L,Y,w,Q]=U;return l0(O0(C0(Z)),GU(X),i(W,"day",1,31),{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q})}if(U=c7.exec($),U){const[G,W,X,Z,L,Y,w,Q]=U;return p7(l0(d7(Z),GU(X),i(W,"day",1,31),{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q}))}if(U=y7.exec($),U){const[G,W,X,Z,L,Y,w,Q]=U;return l0(O0(C0(Q)),GU(W),i(X.trimLeft(),"day",1,31),{hours:Z,minutes:L,seconds:Y,fractionalMilliseconds:w})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),_7=K(($)=>{if($===null||$===void 0)return;let U;if(typeof $==="number")U=$;else if(typeof $==="string")U=QU($);else if(typeof $==="object"&&$.tag===1)U=$.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(U)||U===1/0||U===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(U*1000))},"parseEpochTimestamp"),l0=K(($,U,G,W)=>{const X=U-1;return s7($,X,G),new Date(Date.UTC($,X,G,i(W.hours,"hour",0,23),i(W.minutes,"minute",0,59),i(W.seconds,"seconds",0,60),n7(W.fractionalMilliseconds)))},"buildDate"),d7=K(($)=>{const U=new Date().getUTCFullYear(),G=Math.floor(U/100)*100+O0(C0($));if(G<U)return G+100;return G},"parseTwoDigitYear"),g7=1576800000000,p7=K(($)=>{if($.getTime()-new Date().getTime()>g7)return new Date(Date.UTC($.getUTCFullYear()-100,$.getUTCMonth(),$.getUTCDate(),$.getUTCHours(),$.getUTCMinutes(),$.getUTCSeconds(),$.getUTCMilliseconds()));return $},"adjustRfc850Year"),GU=K(($)=>{const U=FU.indexOf($);if(U<0)throw new TypeError(`Invalid month: ${$}`);return U+1},"parseMonthByShortName"),l7=[31,28,31,30,31,30,31,31,30,31,30,31],s7=K(($,U,G)=>{let W=l7[U];if(U===1&&m7($))W=29;if(G>W)throw new TypeError(`Invalid day for ${FU[U]} in ${$}: ${G}`)},"validateDayOfMonth"),m7=K(($)=>{return $%4===0&&($%100!==0||$%400===0)},"isLeapYear"),i=K(($,U,G,W)=>{const X=CW(C0($));if(X<G||X>W)throw new TypeError(`${U} must be between ${G} and ${W}, inclusive`);return X},"parseDateValue"),n7=K(($)=>{if($===null||$===void 0)return 0;return HW("0."+$)*1000},"parseMilliseconds"),i7=K(($)=>{const U=$[0];let G=1;if(U=="+")G=1;else if(U=="-")G=-1;else throw new TypeError(`Offset direction, ${U}, must be "+" or "-"`);const W=Number($.substring(1,3)),X=Number($.substring(4,6));return G*(W*60+X)*60*1000},"parseOffsetToMilliseconds"),C0=K(($)=>{let U=0;while(U<$.length-1&&$.charAt(U)==="0")U++;if(U===0)return $;return $.slice(U)},"stripLeadingZeroes"),qW=class $ extends Error{constructor(U){super(U.message);Object.setPrototypeOf(this,$.prototype),this.name=U.name,this.$fault=U.$fault,this.$metadata=U.$metadata}};K(qW,"ServiceException");var r7=qW,NW=K(($,U={})=>{Object.entries(U).filter(([,W])=>W!==void 0).forEach(([W,X])=>{if($[W]==null||$[W]==="")$[W]=X});const G=$.message||$.Message||"UnknownError";return $.message=G,delete $.Message,$},"decorateServiceException"),jW=K(({output:$,parsedBody:U,exceptionCtor:G,errorCode:W})=>{const X=a7($),Z=X.httpStatusCode?X.httpStatusCode+"":void 0,L=new G({name:(U==null?void 0:U.code)||(U==null?void 0:U.Code)||W||Z||"UnknownError",$fault:"client",$metadata:X});throw NW(L,U)},"throwDefaultError"),o7=K(($)=>{return({output:U,parsedBody:G,errorCode:W})=>{jW({output:U,parsedBody:G,exceptionCtor:$,errorCode:W})}},"withBaseException"),a7=K(($)=>({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"),t7=K(($)=>{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"),RW=!1,e7=K(($)=>{if($&&!RW&&parseInt($.substring(1,$.indexOf(".")))<16)RW=!0},"emitWarningIfUnsupportedVersion"),$z=K(($)=>{const U=[];for(let G in WU.AlgorithmId){const W=WU.AlgorithmId[G];if($[W]===void 0)continue;U.push({algorithmId:()=>W,checksumConstructor:()=>$[W]})}return{_checksumAlgorithms:U,addChecksumAlgorithm(G){this._checksumAlgorithms.push(G)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),Uz=K(($)=>{const U={};return $.checksumAlgorithms().forEach((G)=>{U[G.algorithmId()]=G.checksumConstructor()}),U},"resolveChecksumRuntimeConfig"),Gz=K(($)=>{let U=$.retryStrategy;return{setRetryStrategy(G){U=G},retryStrategy(){return U}}},"getRetryConfiguration"),Wz=K(($)=>{const U={};return U.retryStrategy=$.retryStrategy(),U},"resolveRetryRuntimeConfig"),PW=K(($)=>{return{...$z($),...Gz($)}},"getDefaultExtensionConfiguration"),Xz=PW,Zz=K(($)=>{return{...Uz($),...Wz($)}},"resolveDefaultRuntimeConfig");K(k1,"extendedEncodeURIComponent");var Lz=K(($)=>Array.isArray($)?$:[$],"getArrayIfSingleItem"),SW=K(($)=>{for(let G in $)if($.hasOwnProperty(G)&&$[G]["#text"]!==void 0)$[G]=$[G]["#text"];else if(typeof $[G]==="object"&&$[G]!==null)$[G]=SW($[G]);return $},"getValueFromTextNode"),i0=K(function(){const $=Object.getPrototypeOf(this).constructor,G=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(G,$.prototype),G},"StringWrapper");i0.prototype=Object.create(String.prototype,{constructor:{value:i0,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(i0,String);var DW=class $ extends i0{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject(U){if(U instanceof $)return U;else if(U instanceof String||typeof U==="string")return new $(U);return new $(JSON.stringify(U))}};K(DW,"LazyJsonString");var Yz=DW;K(RU,"map");var wz=K(($)=>{const U={};for(let[G,W]of Object.entries($||{}))U[G]=[,W];return U},"convertMap"),Qz=K(($,U)=>{const G={};for(let W in U)bW(G,$,U,W);return G},"take"),zz=K(($,U,G)=>{return RU($,Object.entries(G).reduce((W,[X,Z])=>{if(Array.isArray(Z))W[X]=Z;else if(typeof Z==="function")W[X]=[U,Z()];else W[X]=[U,Z];return W},{}))},"mapWithFilter"),bW=K(($,U,G,W)=>{if(U!==null){let L=G[W];if(typeof L==="function")L=[,L];const[Y=Fz,w=Rz,Q=W]=L;if(typeof Y==="function"&&Y(U[Q])||typeof Y!=="function"&&!!Y)$[W]=w(U[Q]);return}let[X,Z]=G[W];if(typeof Z==="function"){let L;const Y=X===void 0&&(L=Z())!=null,w=typeof X==="function"&&!!X(void 0)||typeof X!=="function"&&!!X;if(Y)$[W]=L;else if(w)$[W]=Z()}else{const L=X===void 0&&Z!=null,Y=typeof X==="function"&&!!X(Z)||typeof X!=="function"&&!!X;if(L||Y)$[W]=Z}},"applyInstruction"),Fz=K(($)=>$!=null,"nonNullish"),Rz=K(($)=>$,"pass"),Jz=K(($,U,G,W,X,Z)=>{if(U!=null&&U[G]!==void 0){const L=W();if(L.length<=0)throw new Error("Empty value provided for input HTTP label: "+G+".");$=$.replace(X,Z?L.split("/").map((Y)=>k1(Y)).join("/"):k1(L))}else throw new Error("No value provided for input HTTP label: "+G+".");return $},"resolvedPath"),Iz=K(($)=>{if($!==$)return"NaN";switch($){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return $}},"serializeFloat"),Kz=K(($)=>$.toISOString().replace(".000Z","Z"),"serializeDateTime"),YU=K(($)=>{if($==null)return{};if(Array.isArray($))return $.filter((U)=>U!=null).map(YU);if(typeof $==="object"){const U={};for(let G of Object.keys($)){if($[G]==null)continue;U[G]=YU($[G])}return U}return $},"_json");K(kW,"splitEvery")});var cW=M((xW)=>{Object.defineProperty(xW,"__esModule",{value:!0});xW.isStreamingPayload=void 0;var Mz=import.meta.require("stream"),Bz=($)=>($===null||$===void 0?void 0:$.body)instanceof Mz.Readable||typeof ReadableStream!=="undefined"&&($===null||$===void 0?void 0:$.body)instanceof ReadableStream;xW.isStreamingPayload=Bz});var UX=M((JK,$X)=>{var{defineProperty:x1,getOwnPropertyDescriptor:Vz,getOwnPropertyNames:Ez}=Object,Tz=Object.prototype.hasOwnProperty,P=($,U)=>x1($,"name",{value:U,configurable:!0}),Hz=($,U)=>{for(var G in U)x1($,G,{get:U[G],enumerable:!0})},Az=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of Ez(U))if(!Tz.call($,X)&&X!==G)x1($,X,{get:()=>U[X],enumerable:!(W=Vz(U,X))||W.enumerable})}return $},Oz=($)=>Az(x1({},"__esModule",{value:!0}),$),uW={};Hz(uW,{AdaptiveRetryStrategy:()=>qz,CONFIG_MAX_ATTEMPTS:()=>IU,CONFIG_RETRY_MODE:()=>iW,ENV_MAX_ATTEMPTS:()=>JU,ENV_RETRY_MODE:()=>nW,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>Nz,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>Pz,StandardRetryStrategy:()=>sW,defaultDelayDecider:()=>dW,defaultRetryDecider:()=>gW,getOmitRetryHeadersPlugin:()=>Sz,getRetryAfterHint:()=>eW,getRetryPlugin:()=>vz,omitRetryHeadersMiddleware:()=>rW,omitRetryHeadersMiddlewareOptions:()=>oW,resolveRetryConfig:()=>jz,retryMiddleware:()=>aW,retryMiddlewareOptions:()=>tW});$X.exports=Oz(uW);var N0=o(),_W=B$(),q=N4(),Cz=P(($,U)=>{const G=$,W=(U==null?void 0:U.noRetryIncrement)??q.NO_RETRY_INCREMENT,X=(U==null?void 0:U.retryCost)??q.RETRY_COST,Z=(U==null?void 0:U.timeoutRetryCost)??q.TIMEOUT_RETRY_COST;let L=$;const Y=P((F)=>F.name==="TimeoutError"?Z:X,"getCapacityAmount"),w=P((F)=>Y(F)<=L,"hasRetryTokens");return Object.freeze({hasRetryTokens:w,retrieveRetryTokens:P((F)=>{if(!w(F))throw new Error("No retry token available");const R=Y(F);return L-=R,R},"retrieveRetryTokens"),releaseRetryTokens:P((F)=>{L+=F??W,L=Math.min(L,G)},"releaseRetryTokens")})},"getDefaultRetryQuota"),dW=P(($,U)=>Math.floor(Math.min(q.MAXIMUM_RETRY_DELAY,Math.random()*2**U*$)),"defaultDelayDecider"),W0=k$(),gW=P(($)=>{if(!$)return!1;return W0.isRetryableByTrait($)||W0.isClockSkewError($)||W0.isThrottlingError($)||W0.isTransientError($)},"defaultRetryDecider"),pW=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"),lW=class ${constructor(U,G){this.maxAttemptsProvider=U,this.mode=q.RETRY_MODES.STANDARD,this.retryDecider=(G==null?void 0:G.retryDecider)??gW,this.delayDecider=(G==null?void 0:G.delayDecider)??dW,this.retryQuota=(G==null?void 0:G.retryQuota)??Cz(q.INITIAL_RETRY_TOKENS)}shouldRetry(U,G,W){return G<W&&this.retryDecider(U)&&this.retryQuota.hasRetryTokens(U)}async getMaxAttempts(){let U;try{U=await this.maxAttemptsProvider()}catch(G){U=q.DEFAULT_MAX_ATTEMPTS}return U}async retry(U,G,W){let X,Z=0,L=0;const Y=await this.getMaxAttempts(),{request:w}=G;if(N0.HttpRequest.isInstance(w))w.headers[q.INVOCATION_ID_HEADER]=_W.v4();while(!0)try{if(N0.HttpRequest.isInstance(w))w.headers[q.REQUEST_HEADER]=`attempt=${Z+1}; max=${Y}`;if(W==null?void 0:W.beforeRequest)await W.beforeRequest();const{response:Q,output:z}=await U(G);if(W==null?void 0:W.afterRequest)W.afterRequest(Q);return this.retryQuota.releaseRetryTokens(X),z.$metadata.attempts=Z+1,z.$metadata.totalRetryDelay=L,{response:Q,output:z}}catch(Q){const z=pW(Q);if(Z++,this.shouldRetry(z,Z,Y)){X=this.retryQuota.retrieveRetryTokens(z);const F=this.delayDecider(W0.isThrottlingError(z)?q.THROTTLING_RETRY_DELAY_BASE:q.DEFAULT_RETRY_DELAY_BASE,Z),R=fz(z.$response),J=Math.max(R||0,F);L+=J,await new Promise((I)=>setTimeout(I,J));continue}if(!z.$metadata)z.$metadata={};throw z.$metadata.attempts=Z,z.$metadata.totalRetryDelay=L,z}}};P(lW,"StandardRetryStrategy");var sW=lW,fz=P(($)=>{if(!N0.HttpResponse.isInstance($))return;const U=Object.keys($.headers).find((Z)=>Z.toLowerCase()==="retry-after");if(!U)return;const G=$.headers[U],W=Number(G);if(!Number.isNaN(W))return W*1000;return new Date(G).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),mW=class $ extends sW{constructor(U,G){const{rateLimiter:W,...X}=G??{};super(U,X);this.rateLimiter=W??new q.DefaultRateLimiter,this.mode=q.RETRY_MODES.ADAPTIVE}async retry(U,G){return super.retry(U,G,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(W)=>{this.rateLimiter.updateClientSendingRate(W)}})}};P(mW,"AdaptiveRetryStrategy");var qz=mW,yW=x0(),JU="AWS_MAX_ATTEMPTS",IU="max_attempts",Nz={environmentVariableSelector:($)=>{const U=$[JU];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Environment variable ${JU} mast be a number, got "${U}"`);return G},configFileSelector:($)=>{const U=$[IU];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Shared config file entry ${IU} mast be a number, got "${U}"`);return G},default:q.DEFAULT_MAX_ATTEMPTS},jz=P(($)=>{const{retryStrategy:U}=$,G=yW.normalizeProvider($.maxAttempts??q.DEFAULT_MAX_ATTEMPTS);return{...$,maxAttempts:G,retryStrategy:async()=>{if(U)return U;if(await yW.normalizeProvider($.retryMode)()===q.RETRY_MODES.ADAPTIVE)return new q.AdaptiveRetryStrategy(G);return new q.StandardRetryStrategy(G)}}},"resolveRetryConfig"),nW="AWS_RETRY_MODE",iW="retry_mode",Pz={environmentVariableSelector:($)=>$[nW],configFileSelector:($)=>$[iW],default:q.DEFAULT_RETRY_MODE},rW=P(()=>($)=>async(U)=>{const{request:G}=U;if(N0.HttpRequest.isInstance(G))delete G.headers[q.INVOCATION_ID_HEADER],delete G.headers[q.REQUEST_HEADER];return $(U)},"omitRetryHeadersMiddleware"),oW={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Sz=P(($)=>({applyToStack:(U)=>{U.addRelativeTo(rW(),oW)}}),"getOmitRetryHeadersPlugin"),Dz=q0(),bz=cW(),aW=P(($)=>(U,G)=>async(W)=>{var X;let Z=await $.retryStrategy();const L=await $.maxAttempts();if(kz(Z)){Z=Z;let Y=await Z.acquireInitialRetryToken(G.partition_id),w=new Error,Q=0,z=0;const{request:F}=W,R=N0.HttpRequest.isInstance(F);if(R)F.headers[q.INVOCATION_ID_HEADER]=_W.v4();while(!0)try{if(R)F.headers[q.REQUEST_HEADER]=`attempt=${Q+1}; max=${L}`;const{response:J,output:I}=await U(W);return Z.recordSuccess(Y),I.$metadata.attempts=Q+1,I.$metadata.totalRetryDelay=z,{response:J,output:I}}catch(J){const I=hz(J);if(w=pW(J),R&&bz.isStreamingPayload(F))throw(X=G.logger instanceof Dz.NoOpLogger?console:G.logger)==null||X.warn("An error was encountered in a non-retryable streaming request."),w;try{Y=await Z.refreshRetryTokenForRetry(Y,I)}catch(B){if(!w.$metadata)w.$metadata={};throw w.$metadata.attempts=Q+1,w.$metadata.totalRetryDelay=z,w}Q=Y.getRetryCount();const V=Y.getRetryDelay();z+=V,await new Promise((B)=>setTimeout(B,V))}}else{if(Z=Z,Z==null?void 0:Z.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",Z.mode]];return Z.retry(U,W)}},"retryMiddleware"),kz=P(($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined","isRetryStrategyV2"),hz=P(($)=>{const U={error:$,errorType:xz($)},G=eW($.$response);if(G)U.retryAfterHint=G;return U},"getRetryErrorInfo"),xz=P(($)=>{if(W0.isThrottlingError($))return"THROTTLING";if(W0.isTransientError($))return"TRANSIENT";if(W0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),tW={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},vz=P(($)=>({applyToStack:(U)=>{U.add(aW($),tW)}}),"getRetryPlugin"),eW=P(($)=>{if(!N0.HttpResponse.isInstance($))return;const U=Object.keys($.headers).find((Z)=>Z.toLowerCase()==="retry-after");if(!U)return;const G=$.headers[U],W=Number(G);if(!Number.isNaN(W))return new Date(W*1000);return new Date(G)},"getRetryAfterHint")});var MU=M((IK,TX)=>{function XX($){const U=new Map;for(let G of $)U.set(G.schemeId,G);return U}function MX($,U){return new VX($,U)}function EX($,U,G,W,X){return f(async function*Z(L,Y,...w){let Q=L.startingToken||void 0,z=!0,F;while(z){if(Y[G]=Q,X)Y[X]=Y[X]??L.pageSize;if(L.client instanceof $)F=await LF(U,L.client,Y,...w);else throw new Error(`Invalid client, expected instance of ${$.name}`);yield F;const R=Q;Q=YF(F,W),z=!!(Q&&(!L.stopOnSameToken||Q!==R))}return},"paginateOperation")}var{defineProperty:c1,getOwnPropertyDescriptor:cz,getOwnPropertyNames:yz}=Object,uz=Object.prototype.hasOwnProperty,f=($,U)=>c1($,"name",{value:U,configurable:!0}),_z=($,U)=>{for(var G in U)c1($,G,{get:U[G],enumerable:!0})},dz=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of yz(U))if(!uz.call($,X)&&X!==G)c1($,X,{get:()=>U[X],enumerable:!(W=cz(U,X))||W.enumerable})}return $},gz=($)=>dz(c1({},"__esModule",{value:!0}),$),GX={};_z(GX,{DefaultIdentityProviderConfig:()=>az,EXPIRATION_MS:()=>IX,HttpApiKeyAuthSigner:()=>tz,HttpBearerAuthSigner:()=>ez,NoAuthSigner:()=>$F,RequestBuilder:()=>VX,createIsIdentityExpiredFunction:()=>JX,createPaginator:()=>EX,doesIdentityRequireRefresh:()=>KX,getHttpAuthSchemeEndpointRuleSetPlugin:()=>lz,getHttpAuthSchemePlugin:()=>mz,getHttpSigningPlugin:()=>oz,getSmithyContext:()=>WF,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>ZX,httpAuthSchemeMiddleware:()=>KU,httpAuthSchemeMiddlewareOptions:()=>LX,httpSigningMiddleware:()=>YX,httpSigningMiddlewareOptions:()=>wX,isIdentityExpired:()=>UF,memoizeIdentityProvider:()=>GF,normalizeProvider:()=>XF,requestBuilder:()=>MX});TX.exports=gz(GX);var WX=x0();f(XX,"convertHttpAuthSchemesToMap");var KU=f(($,U)=>(G,W)=>async(X)=>{var Z;const L=$.httpAuthSchemeProvider(await U.httpAuthSchemeParametersProvider($,W,X.input)),Y=XX($.httpAuthSchemes),w=WX.getSmithyContext(W),Q=[];for(let z of L){const F=Y.get(z.schemeId);if(!F){Q.push(`HttpAuthScheme \`${z.schemeId}\` was not enabled for this service.`);continue}const R=F.identityProvider(await U.identityProviderConfigProvider($));if(!R){Q.push(`HttpAuthScheme \`${z.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:J={},signingProperties:I={}}=((Z=z.propertiesExtractor)==null?void 0:Z.call(z,$,W))||{};z.identityProperties=Object.assign(z.identityProperties||{},J),z.signingProperties=Object.assign(z.signingProperties||{},I),w.selectedHttpAuthScheme={httpAuthOption:z,identity:await R(z.identityProperties),signer:F.signer};break}if(!w.selectedHttpAuthScheme)throw new Error(Q.join("\n"));return G(X)},"httpAuthSchemeMiddleware"),pz=$4(),ZX={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:pz.endpointMiddlewareOptions.name},lz=f(($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G})=>({applyToStack:(W)=>{W.addRelativeTo(KU($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G}),ZX)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),sz=D$(),LX={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:sz.serializerMiddlewareOption.name},mz=f(($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G})=>({applyToStack:(W)=>{W.addRelativeTo(KU($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G}),LX)}}),"getHttpAuthSchemePlugin"),y1=o(),nz=f(($)=>(U)=>{throw U},"defaultErrorHandler"),iz=f(($,U)=>{},"defaultSuccessHandler"),YX=f(($)=>(U,G)=>async(W)=>{if(!y1.HttpRequest.isInstance(W.request))return U(W);const Z=WX.getSmithyContext(G).selectedHttpAuthScheme;if(!Z)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:L={}},identity:Y,signer:w}=Z,Q=await U({...W,request:await w.sign(W.request,Y,L)}).catch((w.errorHandler||nz)(L));return(w.successHandler||iz)(Q.response,L),Q},"httpSigningMiddleware"),rz=UX(),wX={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:rz.retryMiddlewareOptions.name},oz=f(($)=>({applyToStack:(U)=>{U.addRelativeTo(YX($),wX)}}),"getHttpSigningPlugin"),QX=class ${constructor(U){this.authSchemes=new Map;for(let[G,W]of Object.entries(U))if(W!==void 0)this.authSchemes.set(G,W)}getIdentityProvider(U){return this.authSchemes.get(U)}};f(QX,"DefaultIdentityProviderConfig");var az=QX,v1=Q0(),zX=class ${async sign(U,G,W){if(!W)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!W.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!W.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!G.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const X=y1.HttpRequest.clone(U);if(W.in===v1.HttpApiKeyAuthLocation.QUERY)X.query[W.name]=G.apiKey;else if(W.in===v1.HttpApiKeyAuthLocation.HEADER)X.headers[W.name]=W.scheme?`${W.scheme} ${G.apiKey}`:G.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+W.in+"`");return X}};f(zX,"HttpApiKeyAuthSigner");var tz=zX,FX=class ${async sign(U,G,W){const X=y1.HttpRequest.clone(U);if(!G.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return X.headers.Authorization=`Bearer ${G.token}`,X}};f(FX,"HttpBearerAuthSigner");var ez=FX,RX=class ${async sign(U,G,W){return U}};f(RX,"NoAuthSigner");var $F=RX,JX=f(($)=>(U)=>KX(U)&&U.expiration.getTime()-Date.now()<$,"createIsIdentityExpiredFunction"),IX=300000,UF=JX(IX),KX=f(($)=>$.expiration!==void 0,"doesIdentityRequireRefresh"),GF=f(($,U,G)=>{if($===void 0)return;const W=typeof $!=="function"?async()=>Promise.resolve($):$;let X,Z,L,Y=!1;const w=f(async(Q)=>{if(!Z)Z=W(Q);try{X=await Z,L=!0,Y=!1}finally{Z=void 0}return X},"coalesceProvider");if(U===void 0)return async(Q)=>{if(!L||(Q==null?void 0:Q.forceRefresh))X=await w(Q);return X};return async(Q)=>{if(!L||(Q==null?void 0:Q.forceRefresh))X=await w(Q);if(Y)return X;if(!G(X))return Y=!0,X;if(U(X))return await w(Q),X;return X}},"memoizeIdentityProvider"),WF=f(($)=>$[v1.SMITHY_CONTEXT_KEY]||($[v1.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),XF=f(($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U},"normalizeProvider"),ZF=q0();f(MX,"requestBuilder");var BX=class ${constructor(U,G){this.input=U,this.context=G,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:U,protocol:G="https",port:W,path:X}=await this.context.endpoint();this.path=X;for(let Z of this.resolvePathStack)Z(this.path);return new y1.HttpRequest({protocol:G,hostname:this.hostname||U,port:W,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(U){return this.hostname=U,this}bp(U){return this.resolvePathStack.push((G)=>{this.path=`${(G==null?void 0:G.endsWith("/"))?G.slice(0,-1):G||""}`+U}),this}p(U,G,W,X){return this.resolvePathStack.push((Z)=>{this.path=ZF.resolvedPath(Z,this.input,U,G,W,X)}),this}h(U){return this.headers=U,this}q(U){return this.query=U,this}b(U){return this.body=U,this}m(U){return this.method=U,this}};f(BX,"RequestBuilder");var VX=BX,LF=f(async($,U,G,...W)=>{return await U.send(new $(G),...W)},"makePagedClientRequest");f(EX,"createPaginator");var YF=f(($,U)=>{let G=$;const W=U.split(".");for(let X of W){if(!G||typeof G!=="object")return;G=G[X]}return G},"get")});var KZ=M((vH,IZ)=>{var{defineProperty:U$,getOwnPropertyDescriptor:gF,getOwnPropertyNames:pF}=Object,lF=Object.prototype.hasOwnProperty,sF=($,U)=>U$($,"name",{value:U,configurable:!0}),mF=($,U)=>{for(var G in U)U$($,G,{get:U[G],enumerable:!0})},nF=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of pF(U))if(!lF.call($,X)&&X!==G)U$($,X,{get:()=>U[X],enumerable:!(W=gF(U,X))||W.enumerable})}return $},iF=($)=>nF(U$({},"__esModule",{value:!0}),$),JZ={};mF(JZ,{emitWarningIfUnsupportedVersion:()=>rF});IZ.exports=iF(JZ);var RZ=!1,rF=sF(($)=>{if($&&!RZ&&parseInt($.substring(1,$.indexOf(".")))<18)RZ=!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 xZ=M((cH,hZ)=>{function dU($){for(let U=0;U<8;U++)$[U]^=255;for(let U=7;U>-1;U--)if($[U]++,$[U]!==0)break}var{defineProperty:Y$,getOwnPropertyDescriptor:oF,getOwnPropertyNames:aF}=Object,tF=Object.prototype.hasOwnProperty,D=($,U)=>Y$($,"name",{value:U,configurable:!0}),eF=($,U)=>{for(var G in U)Y$($,G,{get:U[G],enumerable:!0})},$R=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of aF(U))if(!tF.call($,X)&&X!==G)Y$($,X,{get:()=>U[X],enumerable:!(W=oF(U,X))||W.enumerable})}return $},UR=($)=>$R(Y$({},"__esModule",{value:!0}),$),TZ={};eF(TZ,{SignatureV4:()=>NR,clearCredentialCache:()=>VR,createScope:()=>X$,getCanonicalHeaders:()=>_U,getCanonicalQuery:()=>jZ,getPayloadHash:()=>L$,getSigningKey:()=>NZ,moveHeadersToQuery:()=>bZ,prepareRequest:()=>gU});hZ.exports=UR(TZ);var MZ=x0(),cU=G0(),GR="X-Amz-Algorithm",WR="X-Amz-Credential",HZ="X-Amz-Date",XR="X-Amz-SignedHeaders",ZR="X-Amz-Expires",AZ="X-Amz-Signature",OZ="X-Amz-Security-Token",CZ="authorization",fZ=HZ.toLowerCase(),LR="date",YR=[CZ,fZ,LR],wR=AZ.toLowerCase(),uU="x-amz-content-sha256",QR=OZ.toLowerCase(),zR={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},FR=/^proxy-/,RR=/^sec-/,yU="AWS4-HMAC-SHA256",JR="AWS4-HMAC-SHA256-PAYLOAD",IR="UNSIGNED-PAYLOAD",KR=50,qZ="aws4_request",MR=604800,L0=y6(),BR=G0(),b0={},W$=[],X$=D(($,U,G)=>`${$}/${U}/${G}/${qZ}`,"createScope"),NZ=D(async($,U,G,W,X)=>{const Z=await BZ($,U.secretAccessKey,U.accessKeyId),L=`${G}:${W}:${X}:${L0.toHex(Z)}:${U.sessionToken}`;if(L in b0)return b0[L];W$.push(L);while(W$.length>KR)delete b0[W$.shift()];let Y=`AWS4${U.secretAccessKey}`;for(let w of[G,W,X,qZ])Y=await BZ($,Y,w);return b0[L]=Y},"getSigningKey"),VR=D(()=>{W$.length=0,Object.keys(b0).forEach(($)=>{delete b0[$]})},"clearCredentialCache"),BZ=D(($,U,G)=>{const W=new $(U);return W.update(BR.toUint8Array(G)),W.digest()},"hmac"),_U=D(({headers:$},U,G)=>{const W={};for(let X of Object.keys($).sort()){if($[X]==null)continue;const Z=X.toLowerCase();if(Z in zR||(U==null?void 0:U.has(Z))||FR.test(Z)||RR.test(Z)){if(!G||G&&!G.has(Z))continue}W[Z]=$[X].trim().replace(/\s+/g," ")}return W},"getCanonicalHeaders"),Z$=s$(),jZ=D(({query:$={}})=>{const U=[],G={};for(let W of Object.keys($)){if(W.toLowerCase()===wR)continue;const X=Z$.escapeUri(W);U.push(X);const Z=$[W];if(typeof Z==="string")G[X]=`${X}=${Z$.escapeUri(Z)}`;else if(Array.isArray(Z))G[X]=Z.slice(0).reduce((L,Y)=>L.concat([`${X}=${Z$.escapeUri(Y)}`]),[]).sort().join("&")}return U.sort().map((W)=>G[W]).filter((W)=>W).join("&")},"getCanonicalQuery"),ER=u$(),TR=G0(),L$=D(async({headers:$,body:U},G)=>{for(let W of Object.keys($))if(W.toLowerCase()===uU)return $[W];if(U==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof U==="string"||ArrayBuffer.isView(U)||ER.isArrayBuffer(U)){const W=new G;return W.update(TR.toUint8Array(U)),L0.toHex(await W.digest())}return IR},"getPayloadHash"),VZ=G0(),PZ=class ${format(U){const G=[];for(let Z of Object.keys(U)){const L=VZ.fromUtf8(Z);G.push(Uint8Array.from([L.byteLength]),L,this.formatHeaderValue(U[Z]))}const W=new Uint8Array(G.reduce((Z,L)=>Z+L.byteLength,0));let X=0;for(let Z of G)W.set(Z,X),X+=Z.byteLength;return W}formatHeaderValue(U){switch(U.type){case"boolean":return Uint8Array.from([U.value?0:1]);case"byte":return Uint8Array.from([2,U.value]);case"short":const G=new DataView(new ArrayBuffer(3));return G.setUint8(0,3),G.setInt16(1,U.value,!1),new Uint8Array(G.buffer);case"integer":const W=new DataView(new ArrayBuffer(5));return W.setUint8(0,4),W.setInt32(1,U.value,!1),new Uint8Array(W.buffer);case"long":const X=new Uint8Array(9);return X[0]=5,X.set(U.value.bytes,1),X;case"binary":const Z=new DataView(new ArrayBuffer(3+U.value.byteLength));Z.setUint8(0,6),Z.setUint16(1,U.value.byteLength,!1);const L=new Uint8Array(Z.buffer);return L.set(U.value,3),L;case"string":const Y=VZ.fromUtf8(U.value),w=new DataView(new ArrayBuffer(3+Y.byteLength));w.setUint8(0,7),w.setUint16(1,Y.byteLength,!1);const Q=new Uint8Array(w.buffer);return Q.set(Y,3),Q;case"timestamp":const z=new Uint8Array(9);return z[0]=8,z.set(OR.fromNumber(U.value.valueOf()).bytes,1),z;case"uuid":if(!AR.test(U.value))throw new Error(`Invalid UUID received: ${U.value}`);const F=new Uint8Array(17);return F[0]=9,F.set(L0.fromHex(U.value.replace(/\-/g,"")),1),F}}};D(PZ,"HeaderFormatter");var HR=PZ,AR=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,SZ=class ${constructor(U){if(this.bytes=U,U.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(U){if(U>9223372036854776000||U<-9223372036854776000)throw new Error(`${U} is too large (or, if negative, too small) to represent as an Int64`);const G=new Uint8Array(8);for(let W=7,X=Math.abs(Math.round(U));W>-1&&X>0;W--,X/=256)G[W]=X;if(U<0)dU(G);return new $(G)}valueOf(){const U=this.bytes.slice(0),G=U[0]&128;if(G)dU(U);return parseInt(L0.toHex(U),16)*(G?-1:1)}toString(){return String(this.valueOf())}};D(SZ,"Int64");var OR=SZ;D(dU,"negate");var CR=D(($,U)=>{$=$.toLowerCase();for(let G of Object.keys(U))if($===G.toLowerCase())return!0;return!1},"hasHeader"),DZ=o(),bZ=D(($,U={})=>{var G;const{headers:W,query:X={}}=DZ.HttpRequest.clone($);for(let Z of Object.keys(W)){const L=Z.toLowerCase();if(L.slice(0,6)==="x-amz-"&&!((G=U.unhoistableHeaders)==null?void 0:G.has(L)))X[Z]=W[Z],delete W[Z]}return{...$,headers:W,query:X}},"moveHeadersToQuery"),gU=D(($)=>{$=DZ.HttpRequest.clone($);for(let U of Object.keys($.headers))if(YR.indexOf(U.toLowerCase())>-1)delete $.headers[U];return $},"prepareRequest"),fR=D(($)=>qR($).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),qR=D(($)=>{if(typeof $==="number")return new Date($*1000);if(typeof $==="string"){if(Number($))return new Date(Number($)*1000);return new Date($)}return $},"toDate"),kZ=class ${constructor({applyChecksum:U,credentials:G,region:W,service:X,sha256:Z,uriEscapePath:L=!0}){this.headerFormatter=new HR,this.service=X,this.sha256=Z,this.uriEscapePath=L,this.applyChecksum=typeof U==="boolean"?U:!0,this.regionProvider=MZ.normalizeProvider(W),this.credentialProvider=MZ.normalizeProvider(G)}async presign(U,G={}){const{signingDate:W=new Date,expiresIn:X=3600,unsignableHeaders:Z,unhoistableHeaders:L,signableHeaders:Y,signingRegion:w,signingService:Q}=G,z=await this.credentialProvider();this.validateResolvedCredentials(z);const F=w??await this.regionProvider(),{longDate:R,shortDate:J}=G$(W);if(X>MR)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const I=X$(J,F,Q??this.service),V=bZ(gU(U),{unhoistableHeaders:L});if(z.sessionToken)V.query[OZ]=z.sessionToken;V.query[GR]=yU,V.query[WR]=`${z.accessKeyId}/${I}`,V.query[HZ]=R,V.query[ZR]=X.toString(10);const B=_U(V,Z,Y);return V.query[XR]=EZ(B),V.query[AZ]=await this.getSignature(R,I,this.getSigningKey(z,F,J,Q),this.createCanonicalRequest(V,B,await L$(U,this.sha256))),V}async sign(U,G){if(typeof U==="string")return this.signString(U,G);else if(U.headers&&U.payload)return this.signEvent(U,G);else if(U.message)return this.signMessage(U,G);else return this.signRequest(U,G)}async signEvent({headers:U,payload:G},{signingDate:W=new Date,priorSignature:X,signingRegion:Z,signingService:L}){const Y=Z??await this.regionProvider(),{shortDate:w,longDate:Q}=G$(W),z=X$(w,Y,L??this.service),F=await L$({headers:{},body:G},this.sha256),R=new this.sha256;R.update(U);const J=L0.toHex(await R.digest()),I=[JR,Q,z,X,J,F].join("\n");return this.signString(I,{signingDate:W,signingRegion:Y,signingService:L})}async signMessage(U,{signingDate:G=new Date,signingRegion:W,signingService:X}){return this.signEvent({headers:this.headerFormatter.format(U.message.headers),payload:U.message.body},{signingDate:G,signingRegion:W,signingService:X,priorSignature:U.priorSignature}).then((L)=>{return{message:U.message,signature:L}})}async signString(U,{signingDate:G=new Date,signingRegion:W,signingService:X}={}){const Z=await this.credentialProvider();this.validateResolvedCredentials(Z);const L=W??await this.regionProvider(),{shortDate:Y}=G$(G),w=new this.sha256(await this.getSigningKey(Z,L,Y,X));return w.update(cU.toUint8Array(U)),L0.toHex(await w.digest())}async signRequest(U,{signingDate:G=new Date,signableHeaders:W,unsignableHeaders:X,signingRegion:Z,signingService:L}={}){const Y=await this.credentialProvider();this.validateResolvedCredentials(Y);const w=Z??await this.regionProvider(),Q=gU(U),{longDate:z,shortDate:F}=G$(G),R=X$(F,w,L??this.service);if(Q.headers[fZ]=z,Y.sessionToken)Q.headers[QR]=Y.sessionToken;const J=await L$(Q,this.sha256);if(!CR(uU,Q.headers)&&this.applyChecksum)Q.headers[uU]=J;const I=_U(Q,X,W),V=await this.getSignature(z,R,this.getSigningKey(Y,w,F,L),this.createCanonicalRequest(Q,I,J));return Q.headers[CZ]=`${yU} Credential=${Y.accessKeyId}/${R}, SignedHeaders=${EZ(I)}, Signature=${V}`,Q}createCanonicalRequest(U,G,W){const X=Object.keys(G).sort();return`${U.method}
10
+ ${this.getCanonicalPath(U)}
11
+ ${jZ(U)}
12
+ ${X.map((Z)=>`${Z}:${G[Z]}`).join("\n")}
13
+
14
+ ${X.join(";")}
15
+ ${W}`}async createStringToSign(U,G,W){const X=new this.sha256;X.update(cU.toUint8Array(W));const Z=await X.digest();return`${yU}
16
+ ${U}
17
+ ${G}
18
+ ${L0.toHex(Z)}`}getCanonicalPath({path:U}){if(this.uriEscapePath){const G=[];for(let Z of U.split("/")){if((Z==null?void 0:Z.length)===0)continue;if(Z===".")continue;if(Z==="..")G.pop();else G.push(Z)}const W=`${(U==null?void 0:U.startsWith("/"))?"/":""}${G.join("/")}${G.length>0&&(U==null?void 0:U.endsWith("/"))?"/":""}`;return Z$.escapeUri(W).replace(/%2F/g,"/")}return U}async getSignature(U,G,W,X){const Z=await this.createStringToSign(U,G,X),L=new this.sha256(await W);return L.update(cU.toUint8Array(Z)),L0.toHex(await L.digest())}getSigningKey(U,G,W,X){return NZ(this.sha256,U,W,G,X||this.service)}validateResolvedCredentials(U){if(typeof U!=="object"||typeof U.accessKeyId!=="string"||typeof U.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}};D(kZ,"SignatureV4");var NR=kZ,G$=D(($)=>{const U=fR($).replace(/[\-:]/g,"");return{longDate:U,shortDate:U.slice(0,8)}},"formatDate"),EZ=D(($)=>Object.keys($).sort().join(";"),"getCanonicalHeaderList")});var sZ=M((yH,lZ)=>{var{defineProperty:w$,getOwnPropertyDescriptor:jR,getOwnPropertyNames:PR}=Object,SR=Object.prototype.hasOwnProperty,x=($,U)=>w$($,"name",{value:U,configurable:!0}),DR=($,U)=>{for(var G in U)w$($,G,{get:U[G],enumerable:!0})},bR=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of PR(U))if(!SR.call($,X)&&X!==G)w$($,X,{get:()=>U[X],enumerable:!(W=jR(U,X))||W.enumerable})}return $},kR=($)=>bR(w$({},"__esModule",{value:!0}),$),_Z={};DR(_Z,{AWSSDKSigV4Signer:()=>cR,AwsSdkSigV4ASigner:()=>uR,AwsSdkSigV4Signer:()=>sU,NODE_SIGV4A_CONFIG_OPTIONS:()=>gR,resolveAWSSDKSigV4Config:()=>pR,resolveAwsSdkSigV4AConfig:()=>dR,resolveAwsSdkSigV4Config:()=>pZ,validateSigningProperties:()=>lU});lZ.exports=kR(_Z);var hR=o(),xR=o(),vZ=x(($)=>{var U,G;return xR.HttpResponse.isInstance($)?((U=$.headers)==null?void 0:U.date)??((G=$.headers)==null?void 0:G.Date):void 0},"getDateHeader"),pU=x(($)=>new Date(Date.now()+$),"getSkewCorrectedDate"),vR=x(($,U)=>Math.abs(pU(U).getTime()-$)>=300000,"isClockSkewed"),cZ=x(($,U)=>{const G=Date.parse($);if(vR(G,U))return G-Date.now();return U},"getUpdatedSystemClockOffset"),e0=x(($,U)=>{if(!U)throw new Error(`Property \`${$}\` is not resolved for AWS SDK SigV4Auth`);return U},"throwSigningPropertyError"),lU=x(async($)=>{var U,G,W;const X=e0("context",$.context),Z=e0("config",$.config),L=(W=(G=(U=X.endpointV2)==null?void 0:U.properties)==null?void 0:G.authSchemes)==null?void 0:W[0],w=await e0("signer",Z.signer)(L),Q=$==null?void 0:$.signingRegion,z=$==null?void 0:$.signingRegionSet,F=$==null?void 0:$.signingName;return{config:Z,signer:w,signingRegion:Q,signingRegionSet:z,signingName:F}},"validateSigningProperties"),dZ=class ${async sign(U,G,W){var X;if(!hR.HttpRequest.isInstance(U))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const Z=await lU(W),{config:L,signer:Y}=Z;let{signingRegion:w,signingName:Q}=Z;const z=W.context;if(((X=z==null?void 0:z.authSchemes)==null?void 0:X.length)??0>1){const[R,J]=z.authSchemes;if((R==null?void 0:R.name)==="sigv4a"&&(J==null?void 0:J.name)==="sigv4")w=(J==null?void 0:J.signingRegion)??w,Q=(J==null?void 0:J.signingName)??Q}return await Y.sign(U,{signingDate:pU(L.systemClockOffset),signingRegion:w,signingService:Q})}errorHandler(U){return(G)=>{const W=G.ServerTime??vZ(G.$response);if(W){const X=e0("config",U.config),Z=X.systemClockOffset;if(X.systemClockOffset=cZ(W,X.systemClockOffset),X.systemClockOffset!==Z&&G.$metadata)G.$metadata.clockSkewCorrected=!0}throw G}}successHandler(U,G){const W=vZ(U);if(W){const X=e0("config",G.config);X.systemClockOffset=cZ(W,X.systemClockOffset)}}};x(dZ,"AwsSdkSigV4Signer");var sU=dZ,cR=sU,yR=o(),gZ=class $ extends sU{async sign(U,G,W){var X;if(!yR.HttpRequest.isInstance(U))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:Z,signer:L,signingRegion:Y,signingRegionSet:w,signingName:Q}=await lU(W),F=(await((X=Z.sigv4aSigningRegionSet)==null?void 0:X.call(Z))??w??[Y]).join(",");return await L.sign(U,{signingDate:pU(Z.systemClockOffset),signingRegion:F,signingService:Q})}};x(gZ,"AwsSdkSigV4ASigner");var uR=gZ,_R=MU(),yZ=E$(),dR=x(($)=>{return $.sigv4aSigningRegionSet=_R.normalizeProvider($.sigv4aSigningRegionSet),$},"resolveAwsSdkSigV4AConfig"),gR={environmentVariableSelector($){if($.AWS_SIGV4A_SIGNING_REGION_SET)return $.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((U)=>U.trim());throw new yZ.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((U)=>U.trim());throw new yZ.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},V0=MU(),uZ=xZ(),pZ=x(($)=>{let U;if($.credentials)U=V0.memoizeIdentityProvider($.credentials,V0.isIdentityExpired,V0.doesIdentityRequireRefresh);if(!U)if($.credentialDefaultProvider)U=V0.normalizeProvider($.credentialDefaultProvider(Object.assign({},$,{parentClientConfig:$})));else U=x(async()=>{throw new Error("`credentials` is missing")},"normalizedCreds");const{signingEscapePath:G=!0,systemClockOffset:W=$.systemClockOffset||0,sha256:X}=$;let Z;if($.signer)Z=V0.normalizeProvider($.signer);else if($.regionInfoProvider)Z=x(()=>V0.normalizeProvider($.region)().then(async(L)=>[await $.regionInfoProvider(L,{useFipsEndpoint:await $.useFipsEndpoint(),useDualstackEndpoint:await $.useDualstackEndpoint()})||{},L]).then(([L,Y])=>{const{signingRegion:w,signingService:Q}=L;$.signingRegion=$.signingRegion||w||Y,$.signingName=$.signingName||Q||$.serviceId;const z={...$,credentials:U,region:$.signingRegion,service:$.signingName,sha256:X,uriEscapePath:G};return new($.signerConstructor||uZ.SignatureV4)(z)}),"signer");else Z=x(async(L)=>{L=Object.assign({},{name:"sigv4",signingName:$.signingName||$.defaultSigningName,signingRegion:await V0.normalizeProvider($.region)(),properties:{}},L);const{signingRegion:Y,signingName:w}=L;$.signingRegion=$.signingRegion||Y,$.signingName=$.signingName||w||$.serviceId;const Q={...$,credentials:U,region:$.signingRegion,service:$.signingName,sha256:X,uriEscapePath:G};return new($.signerConstructor||uZ.SignatureV4)(Q)},"signer");return{...$,systemClockOffset:W,signingEscapePath:G,credentials:U,signer:Z}},"resolveAwsSdkSigV4Config"),pR=pZ});var Q$=M((iR)=>{var lR=":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",mZ="[: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]["+lR+"]*",sR=new RegExp("^"+mZ+"$"),mR=function($,U){const G=[];let W=U.exec($);while(W){const X=[];X.startIndex=U.lastIndex-W[0].length;const Z=W.length;for(let L=0;L<Z;L++)X.push(W[L]);G.push(X),W=U.exec($)}return G},nR=function($){const U=sR.exec($);return!(U===null||typeof U==="undefined")};iR.isExist=function($){return typeof $!=="undefined"};iR.isEmptyObject=function($){return Object.keys($).length===0};iR.merge=function($,U,G){if(U){const W=Object.keys(U),X=W.length;for(let Z=0;Z<X;Z++)if(G==="strict")$[W[Z]]=[U[W[Z]]];else $[W[Z]]=U[W[Z]]}};iR.getValue=function($){if(iR.isExist($))return $;else return""};iR.isName=nR;iR.getAllMatches=mR;iR.nameRegexp=mZ});var nU=M((zJ)=>{function iZ($){return $===" "||$==="\t"||$==="\n"||$==="\r"}function rZ($,U){const G=U;for(;U<$.length;U++)if($[U]=="?"||$[U]==" "){const W=$.substr(G,U-G);if(U>5&&W==="xml")return j("InvalidXml","XML declaration allowed only at the start of the document.",k($,U));else if($[U]=="?"&&$[U+1]==">"){U++;break}else continue}return U}function oZ($,U){if($.length>U+5&&$[U+1]==="-"&&$[U+2]==="-"){for(U+=3;U<$.length;U++)if($[U]==="-"&&$[U+1]==="-"&&$[U+2]===">"){U+=2;break}}else if($.length>U+8&&$[U+1]==="D"&&$[U+2]==="O"&&$[U+3]==="C"&&$[U+4]==="T"&&$[U+5]==="Y"&&$[U+6]==="P"&&$[U+7]==="E"){let G=1;for(U+=8;U<$.length;U++)if($[U]==="<")G++;else if($[U]===">"){if(G--,G===0)break}}else if($.length>U+9&&$[U+1]==="["&&$[U+2]==="C"&&$[U+3]==="D"&&$[U+4]==="A"&&$[U+5]==="T"&&$[U+6]==="A"&&$[U+7]==="["){for(U+=8;U<$.length;U++)if($[U]==="]"&&$[U+1]==="]"&&$[U+2]===">"){U+=2;break}}return U}function XJ($,U){let G="",W="",X=!1;for(;U<$.length;U++){if($[U]===GJ||$[U]===WJ)if(W==="")W=$[U];else if(W!==$[U]);else W="";else if($[U]===">"){if(W===""){X=!0;break}}G+=$[U]}if(W!=="")return!1;return{value:G,index:U,tagClosed:X}}function aZ($,U){const G=mU.getAllMatches($,ZJ),W={};for(let X=0;X<G.length;X++){if(G[X][1].length===0)return j("InvalidAttr","Attribute '"+G[X][2]+"' has no space in starting.",$1(G[X]));else if(G[X][3]!==void 0&&G[X][4]===void 0)return j("InvalidAttr","Attribute '"+G[X][2]+"' is without value.",$1(G[X]));else if(G[X][3]===void 0&&!U.allowBooleanAttributes)return j("InvalidAttr","boolean attribute '"+G[X][2]+"' is not allowed.",$1(G[X]));const Z=G[X][2];if(!wJ(Z))return j("InvalidAttr","Attribute '"+Z+"' is an invalid name.",$1(G[X]));if(!W.hasOwnProperty(Z))W[Z]=1;else return j("InvalidAttr","Attribute '"+Z+"' is repeated.",$1(G[X]))}return!0}function LJ($,U){let G=/\d/;if($[U]==="x")U++,G=/[\da-fA-F]/;for(;U<$.length;U++){if($[U]===";")return U;if(!$[U].match(G))break}return-1}function YJ($,U){if(U++,$[U]===";")return-1;if($[U]==="#")return U++,LJ($,U);let G=0;for(;U<$.length;U++,G++){if($[U].match(/\w/)&&G<20)continue;if($[U]===";")break;return-1}return U}function j($,U,G){return{err:{code:$,msg:U,line:G.line||G,col:G.col}}}function wJ($){return mU.isName($)}function QJ($){return mU.isName($)}function k($,U){const G=$.substring(0,U).split(/\r?\n/);return{line:G.length,col:G[G.length-1].length+1}}function $1($){return $.startIndex+$[1].length}var mU=Q$(),UJ={allowBooleanAttributes:!1,unpairedTags:[]};zJ.validate=function($,U){U=Object.assign({},UJ,U);const G=[];let W=!1,X=!1;if($[0]==="\uFEFF")$=$.substr(1);for(let Z=0;Z<$.length;Z++)if($[Z]==="<"&&$[Z+1]==="?"){if(Z+=2,Z=rZ($,Z),Z.err)return Z}else if($[Z]==="<"){let L=Z;if(Z++,$[Z]==="!"){Z=oZ($,Z);continue}else{let Y=!1;if($[Z]==="/")Y=!0,Z++;let w="";for(;Z<$.length&&$[Z]!==">"&&$[Z]!==" "&&$[Z]!=="\t"&&$[Z]!=="\n"&&$[Z]!=="\r";Z++)w+=$[Z];if(w=w.trim(),w[w.length-1]==="/")w=w.substring(0,w.length-1),Z--;if(!QJ(w)){let F;if(w.trim().length===0)F="Invalid space after '<'.";else F="Tag '"+w+"' is an invalid name.";return j("InvalidTag",F,k($,Z))}const Q=XJ($,Z);if(Q===!1)return j("InvalidAttr","Attributes for '"+w+"' have open quote.",k($,Z));let z=Q.value;if(Z=Q.index,z[z.length-1]==="/"){const F=Z-z.length;z=z.substring(0,z.length-1);const R=aZ(z,U);if(R===!0)W=!0;else return j(R.err.code,R.err.msg,k($,F+R.err.line))}else if(Y)if(!Q.tagClosed)return j("InvalidTag","Closing tag '"+w+"' doesn't have proper closing.",k($,Z));else if(z.trim().length>0)return j("InvalidTag","Closing tag '"+w+"' can't have attributes or invalid starting.",k($,L));else if(G.length===0)return j("InvalidTag","Closing tag '"+w+"' has not been opened.",k($,L));else{const F=G.pop();if(w!==F.tagName){let R=k($,F.tagStartPos);return j("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+R.line+", col "+R.col+") instead of closing tag '"+w+"'.",k($,L))}if(G.length==0)X=!0}else{const F=aZ(z,U);if(F!==!0)return j(F.err.code,F.err.msg,k($,Z-z.length+F.err.line));if(X===!0)return j("InvalidXml","Multiple possible root nodes found.",k($,Z));else if(U.unpairedTags.indexOf(w)!==-1);else G.push({tagName:w,tagStartPos:L});W=!0}for(Z++;Z<$.length;Z++)if($[Z]==="<")if($[Z+1]==="!"){Z++,Z=oZ($,Z);continue}else if($[Z+1]==="?"){if(Z=rZ($,++Z),Z.err)return Z}else break;else if($[Z]==="&"){const F=YJ($,Z);if(F==-1)return j("InvalidChar","char '&' is not expected.",k($,Z));Z=F}else if(X===!0&&!iZ($[Z]))return j("InvalidXml","Extra text at the end",k($,Z));if($[Z]==="<")Z--}}else{if(iZ($[Z]))continue;return j("InvalidChar","char '"+$[Z]+"' is not expected.",k($,Z))}if(!W)return j("InvalidXml","Start tag expected.",1);else if(G.length==1)return j("InvalidTag","Unclosed tag '"+G[0].tagName+"'.",k($,G[0].tagStartPos));else if(G.length>0)return j("InvalidXml","Invalid '"+JSON.stringify(G.map((Z)=>Z.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var GJ='"',WJ="'",ZJ=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var eZ=M((JJ)=>{var tZ={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($,U){return U},attributeValueProcessor:function($,U){return U},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function($,U,G){return $}},RJ=function($){return Object.assign({},tZ,$)};JJ.buildOptions=RJ;JJ.defaultOptions=tZ});var GL=M((gH,UL)=>{class $L{constructor($){this.tagname=$,this.child=[],this[":@"]={}}add($,U){if($==="__proto__")$="#__proto__";this.child.push({[$]:U})}addChild($){if($.tagname==="__proto__")$.tagname="#__proto__";if($[":@"]&&Object.keys($[":@"]).length>0)this.child.push({[$.tagname]:$.child,[":@"]:$[":@"]});else this.child.push({[$.tagname]:$.child})}}UL.exports=$L});var XL=M((pH,WL)=>{function BJ($,U){const G={};if($[U+3]==="O"&&$[U+4]==="C"&&$[U+5]==="T"&&$[U+6]==="Y"&&$[U+7]==="P"&&$[U+8]==="E"){U=U+9;let W=1,X=!1,Z=!1,L="";for(;U<$.length;U++)if($[U]==="<"&&!Z){if(X&&TJ($,U)){if(U+=7,[entityName,val,U]=VJ($,U+1),val.indexOf("&")===-1)G[CJ(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(X&&HJ($,U))U+=8;else if(X&&AJ($,U))U+=8;else if(X&&OJ($,U))U+=9;else if(EJ)Z=!0;else throw new Error("Invalid DOCTYPE");W++,L=""}else if($[U]===">"){if(Z){if($[U-1]==="-"&&$[U-2]==="-")Z=!1,W--}else W--;if(W===0)break}else if($[U]==="[")X=!0;else L+=$[U];if(W!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:G,i:U}}function VJ($,U){let G="";for(;U<$.length&&($[U]!=="'"&&$[U]!=='"');U++)G+=$[U];if(G=G.trim(),G.indexOf(" ")!==-1)throw new Error("External entites are not supported");const W=$[U++];let X="";for(;U<$.length&&$[U]!==W;U++)X+=$[U];return[G,X,U]}function EJ($,U){if($[U+1]==="!"&&$[U+2]==="-"&&$[U+3]==="-")return!0;return!1}function TJ($,U){if($[U+1]==="!"&&$[U+2]==="E"&&$[U+3]==="N"&&$[U+4]==="T"&&$[U+5]==="I"&&$[U+6]==="T"&&$[U+7]==="Y")return!0;return!1}function HJ($,U){if($[U+1]==="!"&&$[U+2]==="E"&&$[U+3]==="L"&&$[U+4]==="E"&&$[U+5]==="M"&&$[U+6]==="E"&&$[U+7]==="N"&&$[U+8]==="T")return!0;return!1}function AJ($,U){if($[U+1]==="!"&&$[U+2]==="A"&&$[U+3]==="T"&&$[U+4]==="T"&&$[U+5]==="L"&&$[U+6]==="I"&&$[U+7]==="S"&&$[U+8]==="T")return!0;return!1}function OJ($,U){if($[U+1]==="!"&&$[U+2]==="N"&&$[U+3]==="O"&&$[U+4]==="T"&&$[U+5]==="A"&&$[U+6]==="T"&&$[U+7]==="I"&&$[U+8]==="O"&&$[U+9]==="N")return!0;return!1}function CJ($){if(MJ.isName($))return $;else throw new Error(`Invalid entity name ${$}`)}var MJ=Q$();WL.exports=BJ});var LL=M((lH,ZL)=>{function jJ($,U={}){if(U=Object.assign({},NJ,U),!$||typeof $!=="string")return $;let G=$.trim();if(U.skipLike!==void 0&&U.skipLike.test(G))return $;else if(U.hex&&fJ.test(G))return Number.parseInt(G,16);else{const W=qJ.exec(G);if(W){const X=W[1],Z=W[2];let L=PJ(W[3]);const Y=W[4]||W[6];if(!U.leadingZeros&&Z.length>0&&X&&G[2]!==".")return $;else if(!U.leadingZeros&&Z.length>0&&!X&&G[1]!==".")return $;else{const w=Number(G),Q=""+w;if(Q.search(/[eE]/)!==-1)if(U.eNotation)return w;else return $;else if(Y)if(U.eNotation)return w;else return $;else if(G.indexOf(".")!==-1)if(Q==="0"&&L==="")return w;else if(Q===L)return w;else if(X&&Q==="-"+L)return w;else return $;if(Z)if(L===Q)return w;else if(X+L===Q)return w;else return $;if(G===Q)return w;else if(G===X+Q)return w;return $}}else return $}}function PJ($){if($&&$.indexOf(".")!==-1){if($=$.replace(/0+$/,""),$===".")$="0";else if($[0]===".")$="0"+$;else if($[$.length-1]===".")$=$.substr(0,$.length-1);return $}return $}var fJ=/^[-+]?0x[a-fA-F0-9]+$/,qJ=/^([\-\+])?(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 NJ={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};ZL.exports=jJ});var zL=M((sH,QL)=>{function bJ($){const U=Object.keys($);for(let G=0;G<U.length;G++){const W=U[G];this.lastEntities[W]={regex:new RegExp("&"+W+";","g"),val:$[W]}}}function kJ($,U,G,W,X,Z,L){if($!==void 0){if(this.options.trimValues&&!W)$=$.trim();if($.length>0){if(!L)$=this.replaceEntitiesValue($);const Y=this.options.tagValueProcessor(U,$,G,X,Z);if(Y===null||Y===void 0)return $;else if(typeof Y!==typeof $||Y!==$)return Y;else if(this.options.trimValues)return rU($,this.options.parseTagValue,this.options.numberParseOptions);else if($.trim()===$)return rU($,this.options.parseTagValue,this.options.numberParseOptions);else return $}}}function hJ($){if(this.options.removeNSPrefix){const U=$.split(":"),G=$.charAt(0)==="/"?"/":"";if(U[0]==="xmlns")return"";if(U.length===2)$=G+U[1]}return $}function vJ($,U,G){if(!this.options.ignoreAttributes&&typeof $==="string"){const W=YL.getAllMatches($,xJ),X=W.length,Z={};for(let L=0;L<X;L++){const Y=this.resolveNameSpace(W[L][1]);let w=W[L][4],Q=this.options.attributeNamePrefix+Y;if(Y.length){if(this.options.transformAttributeName)Q=this.options.transformAttributeName(Q);if(Q==="__proto__")Q="#__proto__";if(w!==void 0){if(this.options.trimValues)w=w.trim();w=this.replaceEntitiesValue(w);const z=this.options.attributeValueProcessor(Y,w,U);if(z===null||z===void 0)Z[Q]=w;else if(typeof z!==typeof w||z!==w)Z[Q]=z;else Z[Q]=rU(w,this.options.parseAttributeValue,this.options.numberParseOptions)}else if(this.options.allowBooleanAttributes)Z[Q]=!0}}if(!Object.keys(Z).length)return;if(this.options.attributesGroupName){const L={};return L[this.options.attributesGroupName]=Z,L}return Z}}function yJ($,U,G){const W=this.options.updateTag(U.tagname,G,U[":@"]);if(W===!1);else if(typeof W==="string")U.tagname=W,$.addChild(U);else $.addChild(U)}function _J($,U,G,W){if($){if(W===void 0)W=Object.keys(U.child).length===0;if($=this.parseTextData($,U.tagname,G,!1,U[":@"]?Object.keys(U[":@"]).length!==0:!1,W),$!==void 0&&$!=="")U.add(this.options.textNodeName,$);$=""}return $}function dJ($,U,G){const W="*."+G;for(let X in $){const Z=$[X];if(W===Z||U===Z)return!0}return!1}function gJ($,U,G=">"){let W,X="";for(let Z=U;Z<$.length;Z++){let L=$[Z];if(W){if(L===W)W=""}else if(L==='"'||L==="'")W=L;else if(L===G[0])if(G[1]){if($[Z+1]===G[1])return{data:X,index:Z}}else return{data:X,index:Z};else if(L==="\t")L=" ";X+=L}}function E0($,U,G,W){const X=$.indexOf(U,G);if(X===-1)throw new Error(W);else return X+U.length-1}function iU($,U,G,W=">"){const X=gJ($,U+1,W);if(!X)return;let Z=X.data;const L=X.index,Y=Z.search(/\s/);let w=Z,Q=!0;if(Y!==-1)w=Z.substring(0,Y),Z=Z.substring(Y+1).trimStart();const z=w;if(G){const F=w.indexOf(":");if(F!==-1)w=w.substr(F+1),Q=w!==X.data.substr(F+1)}return{tagName:w,tagExp:Z,closeIndex:L,attrExpPresent:Q,rawTagName:z}}function pJ($,U,G){const W=G;let X=1;for(;G<$.length;G++)if($[G]==="<")if($[G+1]==="/"){const Z=E0($,">",G,`${U} is not closed`);if($.substring(G+2,Z).trim()===U){if(X--,X===0)return{tagContent:$.substring(W,G),i:Z}}G=Z}else if($[G+1]==="?")G=E0($,"?>",G+1,"StopNode is not closed.");else if($.substr(G+1,3)==="!--")G=E0($,"-->",G+3,"StopNode is not closed.");else if($.substr(G+1,2)==="![")G=E0($,"]]>",G,"StopNode is not closed.")-2;else{const Z=iU($,G,">");if(Z){if((Z&&Z.tagName)===U&&Z.tagExp[Z.tagExp.length-1]!=="/")X++;G=Z.closeIndex}}}function rU($,U,G){if(U&&typeof $==="string"){const W=$.trim();if(W==="true")return!0;else if(W==="false")return!1;else return DJ($,G)}else if(YL.isExist($))return $;else return""}var YL=Q$(),U1=GL(),SJ=XL(),DJ=LL();class wL{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:(U,G)=>String.fromCharCode(Number.parseInt(G,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(U,G)=>String.fromCharCode(Number.parseInt(G,16))}},this.addExternalEntities=bJ,this.parseXml=cJ,this.parseTextData=kJ,this.resolveNameSpace=hJ,this.buildAttributesMap=vJ,this.isItStopNode=dJ,this.replaceEntitiesValue=uJ,this.readStopNodeData=pJ,this.saveTextToParentTag=_J,this.addChild=yJ}}var xJ=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),cJ=function($){$=$.replace(/\r\n?/g,"\n");const U=new U1("!xml");let G=U,W="",X="";for(let Z=0;Z<$.length;Z++)if($[Z]==="<")if($[Z+1]==="/"){const Y=E0($,">",Z,"Closing Tag is not closed.");let w=$.substring(Z+2,Y).trim();if(this.options.removeNSPrefix){const F=w.indexOf(":");if(F!==-1)w=w.substr(F+1)}if(this.options.transformTagName)w=this.options.transformTagName(w);if(G)W=this.saveTextToParentTag(W,G,X);const Q=X.substring(X.lastIndexOf(".")+1);if(w&&this.options.unpairedTags.indexOf(w)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${w}>`);let z=0;if(Q&&this.options.unpairedTags.indexOf(Q)!==-1)z=X.lastIndexOf(".",X.lastIndexOf(".")-1),this.tagsNodeStack.pop();else z=X.lastIndexOf(".");X=X.substring(0,z),G=this.tagsNodeStack.pop(),W="",Z=Y}else if($[Z+1]==="?"){let Y=iU($,Z,!1,"?>");if(!Y)throw new Error("Pi Tag is not closed.");if(W=this.saveTextToParentTag(W,G,X),this.options.ignoreDeclaration&&Y.tagName==="?xml"||this.options.ignorePiTags);else{const w=new U1(Y.tagName);if(w.add(this.options.textNodeName,""),Y.tagName!==Y.tagExp&&Y.attrExpPresent)w[":@"]=this.buildAttributesMap(Y.tagExp,X,Y.tagName);this.addChild(G,w,X)}Z=Y.closeIndex+1}else if($.substr(Z+1,3)==="!--"){const Y=E0($,"-->",Z+4,"Comment is not closed.");if(this.options.commentPropName){const w=$.substring(Z+4,Y-2);W=this.saveTextToParentTag(W,G,X),G.add(this.options.commentPropName,[{[this.options.textNodeName]:w}])}Z=Y}else if($.substr(Z+1,2)==="!D"){const Y=SJ($,Z);this.docTypeEntities=Y.entities,Z=Y.i}else if($.substr(Z+1,2)==="!["){const Y=E0($,"]]>",Z,"CDATA is not closed.")-2,w=$.substring(Z+9,Y);W=this.saveTextToParentTag(W,G,X);let Q=this.parseTextData(w,G.tagname,X,!0,!1,!0,!0);if(Q==null)Q="";if(this.options.cdataPropName)G.add(this.options.cdataPropName,[{[this.options.textNodeName]:w}]);else G.add(this.options.textNodeName,Q);Z=Y+2}else{let Y=iU($,Z,this.options.removeNSPrefix),w=Y.tagName;const Q=Y.rawTagName;let{tagExp:z,attrExpPresent:F,closeIndex:R}=Y;if(this.options.transformTagName)w=this.options.transformTagName(w);if(G&&W){if(G.tagname!=="!xml")W=this.saveTextToParentTag(W,G,X,!1)}const J=G;if(J&&this.options.unpairedTags.indexOf(J.tagname)!==-1)G=this.tagsNodeStack.pop(),X=X.substring(0,X.lastIndexOf("."));if(w!==U.tagname)X+=X?"."+w:w;if(this.isItStopNode(this.options.stopNodes,X,w)){let I="";if(z.length>0&&z.lastIndexOf("/")===z.length-1){if(w[w.length-1]==="/")w=w.substr(0,w.length-1),X=X.substr(0,X.length-1),z=w;else z=z.substr(0,z.length-1);Z=Y.closeIndex}else if(this.options.unpairedTags.indexOf(w)!==-1)Z=Y.closeIndex;else{const B=this.readStopNodeData($,Q,R+1);if(!B)throw new Error(`Unexpected end of ${Q}`);Z=B.i,I=B.tagContent}const V=new U1(w);if(w!==z&&F)V[":@"]=this.buildAttributesMap(z,X,w);if(I)I=this.parseTextData(I,w,X,!0,F,!0,!0);X=X.substr(0,X.lastIndexOf(".")),V.add(this.options.textNodeName,I),this.addChild(G,V,X)}else{if(z.length>0&&z.lastIndexOf("/")===z.length-1){if(w[w.length-1]==="/")w=w.substr(0,w.length-1),X=X.substr(0,X.length-1),z=w;else z=z.substr(0,z.length-1);if(this.options.transformTagName)w=this.options.transformTagName(w);const I=new U1(w);if(w!==z&&F)I[":@"]=this.buildAttributesMap(z,X,w);this.addChild(G,I,X),X=X.substr(0,X.lastIndexOf("."))}else{const I=new U1(w);if(this.tagsNodeStack.push(G),w!==z&&F)I[":@"]=this.buildAttributesMap(z,X,w);this.addChild(G,I,X),G=I}W="",Z=R}}else W+=$[Z];return U.child},uJ=function($){if(this.options.processEntities){for(let U in this.docTypeEntities){const G=this.docTypeEntities[U];$=$.replace(G.regx,G.val)}for(let U in this.lastEntities){const G=this.lastEntities[U];$=$.replace(G.regex,G.val)}if(this.options.htmlEntities)for(let U in this.htmlEntities){const G=this.htmlEntities[U];$=$.replace(G.regex,G.val)}$=$.replace(this.ampEntity.regex,this.ampEntity.val)}return $};QL.exports=wL});var RL=M((iJ)=>{function lJ($,U){return FL($,U)}function FL($,U,G){let W;const X={};for(let Z=0;Z<$.length;Z++){const L=$[Z],Y=sJ(L);let w="";if(G===void 0)w=Y;else w=G+"."+Y;if(Y===U.textNodeName)if(W===void 0)W=L[Y];else W+=""+L[Y];else if(Y===void 0)continue;else if(L[Y]){let Q=FL(L[Y],U,w);const z=nJ(Q,U);if(L[":@"])mJ(Q,L[":@"],w,U);else if(Object.keys(Q).length===1&&Q[U.textNodeName]!==void 0&&!U.alwaysCreateTextNode)Q=Q[U.textNodeName];else if(Object.keys(Q).length===0)if(U.alwaysCreateTextNode)Q[U.textNodeName]="";else Q="";if(X[Y]!==void 0&&X.hasOwnProperty(Y)){if(!Array.isArray(X[Y]))X[Y]=[X[Y]];X[Y].push(Q)}else if(U.isArray(Y,w,z))X[Y]=[Q];else X[Y]=Q}}if(typeof W==="string"){if(W.length>0)X[U.textNodeName]=W}else if(W!==void 0)X[U.textNodeName]=W;return X}function sJ($){const U=Object.keys($);for(let G=0;G<U.length;G++){const W=U[G];if(W!==":@")return W}}function mJ($,U,G,W){if(U){const X=Object.keys(U),Z=X.length;for(let L=0;L<Z;L++){const Y=X[L];if(W.isArray(Y,G+"."+Y,!0,!0))$[Y]=[U[Y]];else $[Y]=U[Y]}}}function nJ($,U){const{textNodeName:G}=U,W=Object.keys($).length;if(W===0)return!0;if(W===1&&($[G]||typeof $[G]==="boolean"||$[G]===0))return!0;return!1}iJ.prettify=lJ});var KL=M((nH,IL)=>{var{buildOptions:oJ}=eZ(),aJ=zL(),{prettify:tJ}=RL(),eJ=nU();class JL{constructor($){this.externalEntities={},this.options=oJ($)}parse($,U){if(typeof $==="string");else if($.toString)$=$.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(U){if(U===!0)U={};const X=eJ.validate($,U);if(X!==!0)throw Error(`${X.err.msg}:${X.err.line}:${X.err.col}`)}const G=new aJ(this.options);G.addExternalEntities(this.externalEntities);const W=G.parseXml($);if(this.options.preserveOrder||W===void 0)return W;else return tJ(W,this.options)}addEntity($,U){if(U.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(U==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[$]=U}}IL.exports=JL});var TL=M((iH,EL)=>{function $I($,U){let G="";if(U.format&&U.indentBy.length>0)G="\n";return BL($,U,"",G)}function BL($,U,G,W){let X="",Z=!1;for(let L=0;L<$.length;L++){const Y=$[L],w=UI(Y);if(w===void 0)continue;let Q="";if(G.length===0)Q=w;else Q=`${G}.${w}`;if(w===U.textNodeName){let I=Y[w];if(!GI(Q,U))I=U.tagValueProcessor(w,I),I=VL(I,U);if(Z)X+=W;X+=I,Z=!1;continue}else if(w===U.cdataPropName){if(Z)X+=W;X+=`<![CDATA[${Y[w][0][U.textNodeName]}]]>`,Z=!1;continue}else if(w===U.commentPropName){X+=W+`<!--${Y[w][0][U.textNodeName]}-->`,Z=!0;continue}else if(w[0]==="?"){const I=ML(Y[":@"],U),V=w==="?xml"?"":W;let B=Y[w][0][U.textNodeName];B=B.length!==0?" "+B:"",X+=V+`<${w}${B}${I}?>`,Z=!0;continue}let z=W;if(z!=="")z+=U.indentBy;const F=ML(Y[":@"],U),R=W+`<${w}${F}`,J=BL(Y[w],U,Q,z);if(U.unpairedTags.indexOf(w)!==-1)if(U.suppressUnpairedNode)X+=R+">";else X+=R+"/>";else if((!J||J.length===0)&&U.suppressEmptyNode)X+=R+"/>";else if(J&&J.endsWith(">"))X+=R+`>${J}${W}</${w}>`;else{if(X+=R+">",J&&W!==""&&(J.includes("/>")||J.includes("</")))X+=W+U.indentBy+J+W;else X+=J;X+=`</${w}>`}Z=!0}return X}function UI($){const U=Object.keys($);for(let G=0;G<U.length;G++){const W=U[G];if(!$.hasOwnProperty(W))continue;if(W!==":@")return W}}function ML($,U){let G="";if($&&!U.ignoreAttributes)for(let W in $){if(!$.hasOwnProperty(W))continue;let X=U.attributeValueProcessor(W,$[W]);if(X=VL(X,U),X===!0&&U.suppressBooleanAttributes)G+=` ${W.substr(U.attributeNamePrefix.length)}`;else G+=` ${W.substr(U.attributeNamePrefix.length)}="${X}"`}return G}function GI($,U){$=$.substr(0,$.length-U.textNodeName.length-1);let G=$.substr($.lastIndexOf(".")+1);for(let W in U.stopNodes)if(U.stopNodes[W]===$||U.stopNodes[W]==="*."+G)return!0;return!1}function VL($,U){if($&&$.length>0&&U.processEntities)for(let G=0;G<U.entities.length;G++){const W=U.entities[G];$=$.replace(W.regex,W.val)}return $}EL.exports=$I});var AL=M((rH,HL)=>{function Y0($){if(this.options=Object.assign({},XI,$),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=YI;if(this.processTextOrObjNode=ZI,this.options.format)this.indentate=LI,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""}function ZI($,U,G){const W=this.j2x($,G+1);if($[this.options.textNodeName]!==void 0&&Object.keys($).length===1)return this.buildTextValNode($[this.options.textNodeName],U,W.attrStr,G);else return this.buildObjectNode(W.val,U,W.attrStr,G)}function LI($){return this.options.indentBy.repeat($)}function YI($){if($.startsWith(this.options.attributeNamePrefix)&&$!==this.options.textNodeName)return $.substr(this.attrPrefixLen);else return!1}var WI=TL(),XI={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function($,U){return U},attributeValueProcessor:function($,U){return U},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};Y0.prototype.build=function($){if(this.options.preserveOrder)return WI($,this.options);else{if(Array.isArray($)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)$={[this.options.arrayNodeName]:$};return this.j2x($,0).val}};Y0.prototype.j2x=function($,U){let G="",W="";for(let X in $){if(!Object.prototype.hasOwnProperty.call($,X))continue;if(typeof $[X]==="undefined"){if(this.isAttribute(X))W+=""}else if($[X]===null)if(this.isAttribute(X))W+="";else if(X[0]==="?")W+=this.indentate(U)+"<"+X+"?"+this.tagEndChar;else W+=this.indentate(U)+"<"+X+"/"+this.tagEndChar;else if($[X]instanceof Date)W+=this.buildTextValNode($[X],X,"",U);else if(typeof $[X]!=="object"){const Z=this.isAttribute(X);if(Z)G+=this.buildAttrPairStr(Z,""+$[X]);else if(X===this.options.textNodeName){let L=this.options.tagValueProcessor(X,""+$[X]);W+=this.replaceEntitiesValue(L)}else W+=this.buildTextValNode($[X],X,"",U)}else if(Array.isArray($[X])){const Z=$[X].length;let L="",Y="";for(let w=0;w<Z;w++){const Q=$[X][w];if(typeof Q==="undefined");else if(Q===null)if(X[0]==="?")W+=this.indentate(U)+"<"+X+"?"+this.tagEndChar;else W+=this.indentate(U)+"<"+X+"/"+this.tagEndChar;else if(typeof Q==="object")if(this.options.oneListGroup){const z=this.j2x(Q,U+1);if(L+=z.val,this.options.attributesGroupName&&Q.hasOwnProperty(this.options.attributesGroupName))Y+=z.attrStr}else L+=this.processTextOrObjNode(Q,X,U);else if(this.options.oneListGroup){let z=this.options.tagValueProcessor(X,Q);z=this.replaceEntitiesValue(z),L+=z}else L+=this.buildTextValNode(Q,X,"",U)}if(this.options.oneListGroup)L=this.buildObjectNode(L,X,Y,U);W+=L}else if(this.options.attributesGroupName&&X===this.options.attributesGroupName){const Z=Object.keys($[X]),L=Z.length;for(let Y=0;Y<L;Y++)G+=this.buildAttrPairStr(Z[Y],""+$[X][Z[Y]])}else W+=this.processTextOrObjNode($[X],X,U)}return{attrStr:G,val:W}};Y0.prototype.buildAttrPairStr=function($,U){if(U=this.options.attributeValueProcessor($,""+U),U=this.replaceEntitiesValue(U),this.options.suppressBooleanAttributes&&U==="true")return" "+$;else return" "+$+'="'+U+'"'};Y0.prototype.buildObjectNode=function($,U,G,W){if($==="")if(U[0]==="?")return this.indentate(W)+"<"+U+G+"?"+this.tagEndChar;else return this.indentate(W)+"<"+U+G+this.closeTag(U)+this.tagEndChar;else{let X="</"+U+this.tagEndChar,Z="";if(U[0]==="?")Z="?",X="";if((G||G==="")&&$.indexOf("<")===-1)return this.indentate(W)+"<"+U+G+Z+">"+$+X;else if(this.options.commentPropName!==!1&&U===this.options.commentPropName&&Z.length===0)return this.indentate(W)+`<!--${$}-->`+this.newLine;else return this.indentate(W)+"<"+U+G+Z+this.tagEndChar+$+this.indentate(W)+X}};Y0.prototype.closeTag=function($){let U="";if(this.options.unpairedTags.indexOf($)!==-1){if(!this.options.suppressUnpairedNode)U="/"}else if(this.options.suppressEmptyNode)U="/";else U=`></${$}`;return U};Y0.prototype.buildTextValNode=function($,U,G,W){if(this.options.cdataPropName!==!1&&U===this.options.cdataPropName)return this.indentate(W)+`<![CDATA[${$}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&U===this.options.commentPropName)return this.indentate(W)+`<!--${$}-->`+this.newLine;else if(U[0]==="?")return this.indentate(W)+"<"+U+G+"?"+this.tagEndChar;else{let X=this.options.tagValueProcessor(U,$);if(X=this.replaceEntitiesValue(X),X==="")return this.indentate(W)+"<"+U+G+this.closeTag(U)+this.tagEndChar;else return this.indentate(W)+"<"+U+G+">"+X+"</"+U+this.tagEndChar}};Y0.prototype.replaceEntitiesValue=function($){if($&&$.length>0&&this.options.processEntities)for(let U=0;U<this.options.entities.length;U++){const G=this.options.entities[U];$=$.replace(G.regex,G.val)}return $};HL.exports=Y0});var CL=M((oH,OL)=>{var wI=nU(),QI=KL(),zI=AL();OL.exports={XMLParser:QI,XMLValidator:wI,XMLBuilder:zI}});var SL=M((aH,PL)=>{var{defineProperty:z$,getOwnPropertyDescriptor:FI,getOwnPropertyNames:RI}=Object,JI=Object.prototype.hasOwnProperty,v=($,U)=>z$($,"name",{value:U,configurable:!0}),II=($,U)=>{for(var G in U)z$($,G,{get:U[G],enumerable:!0})},KI=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of RI(U))if(!JI.call($,X)&&X!==G)z$($,X,{get:()=>U[X],enumerable:!(W=FI(U,X))||W.enumerable})}return $},MI=($)=>KI(z$({},"__esModule",{value:!0}),$),fL={};II(fL,{_toBool:()=>VI,_toNum:()=>EI,_toStr:()=>BI,awsExpectUnion:()=>HI,loadRestJsonErrorCode:()=>CI,loadRestXmlErrorCode:()=>jI,parseJsonBody:()=>NL,parseJsonErrorBody:()=>OI,parseXmlBody:()=>jL,parseXmlErrorBody:()=>NI});PL.exports=MI(fL);var BI=v(($)=>{if($==null)return $;if(typeof $==="number"||typeof $==="bigint"){const U=new Error(`Received number ${$} where a string was expected.`);return U.name="Warning",console.warn(U),String($)}if(typeof $==="boolean"){const U=new Error(`Received boolean ${$} where a string was expected.`);return U.name="Warning",console.warn(U),String($)}return $},"_toStr"),VI=v(($)=>{if($==null)return $;if(typeof $==="string"){const U=$.toLowerCase();if($!==""&&U!=="false"&&U!=="true"){const G=new Error(`Received string "${$}" where a boolean was expected.`);G.name="Warning",console.warn(G)}return $!==""&&U!=="false"}return $},"_toBool"),EI=v(($)=>{if($==null)return $;if(typeof $==="string"){const U=Number($);if(U.toString()!==$){const G=new Error(`Received string "${$}" where a number was expected.`);return G.name="Warning",console.warn(G),$}return U}return $},"_toNum"),TI=q0(),HI=v(($)=>{if($==null)return;if(typeof $==="object"&&"__type"in $)delete $.__type;return TI.expectUnion($)},"awsExpectUnion"),AI=q0(),qL=v(($,U)=>AI.collectBody($,U).then((G)=>U.utf8Encoder(G)),"collectBodyString"),NL=v(($,U)=>qL($,U).then((G)=>{if(G.length)try{return JSON.parse(G)}catch(W){if((W==null?void 0:W.name)==="SyntaxError")Object.defineProperty(W,"$responseBodyText",{value:G});throw W}return{}}),"parseJsonBody"),OI=v(async($,U)=>{const G=await NL($,U);return G.message=G.message??G.Message,G},"parseJsonErrorBody"),CI=v(($,U)=>{const G=v((Z,L)=>Object.keys(Z).find((Y)=>Y.toLowerCase()===L.toLowerCase()),"findKey"),W=v((Z)=>{let L=Z;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"),X=G($.headers,"x-amzn-errortype");if(X!==void 0)return W($.headers[X]);if(U.code!==void 0)return W(U.code);if(U.__type!==void 0)return W(U.__type)},"loadRestJsonErrorCode"),fI=q0(),qI=CL(),jL=v(($,U)=>qL($,U).then((G)=>{if(G.length){const W=new qI.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(w,Q)=>Q.trim()===""&&Q.includes("\n")?"":void 0});W.addEntity("#xD","\r"),W.addEntity("#10","\n");let X;try{X=W.parse(G,!0)}catch(w){if(w&&typeof w==="object")Object.defineProperty(w,"$responseBodyText",{value:G});throw w}const Z="#text",L=Object.keys(X)[0],Y=X[L];if(Y[Z])Y[L]=Y[Z],delete Y[Z];return fI.getValueFromTextNode(Y)}return{}}),"parseXmlBody"),NI=v(async($,U)=>{const G=await jL($,U);if(G.Error)G.Error.message=G.Error.message??G.Error.Message;return G},"parseXmlErrorBody"),jI=v(($,U)=>{var G;if(((G=U==null?void 0:U.Error)==null?void 0:G.Code)!==void 0)return U.Error.Code;if((U==null?void 0:U.Code)!==void 0)return U.Code;if($.statusCode==404)return"NotFound"},"loadRestXmlErrorCode")});var SI=M((G1)=>{Object.defineProperty(G1,"__esModule",{value:!0});var oU=PI();oU.__exportStar(KZ(),G1);oU.__exportStar(sZ(),G1);oU.__exportStar(SL(),G1)});var n=V$(B$(),1),Y3=n.default.v1,w3=n.default.v3,iG=n.default.v4,Q3=n.default.v5,z3=n.default.NIL,F3=n.default.version,R3=n.default.validate,J3=n.default.stringify,I3=n.default.parse;function B3($){return $}var GY=($)=>(U)=>async(G)=>{if(!y.isInstance(G.request))return U(G);const{request:W}=G,{handlerProtocol:X=""}=$.requestHandler.metadata||{};if(X.indexOf("h2")>=0&&!W.headers[":authority"])delete W.headers.host,W.headers[":authority"]=W.hostname+(W.port?":"+W.port:"");else if(!W.headers.host){let Z=W.hostname;if(W.port!=null)Z+=`:${W.port}`;W.headers.host=Z}return U(G)},WY={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},V3=($)=>({applyToStack:(U)=>{U.add(GY($),WY)}});var XY=()=>($,U)=>async(G)=>{try{const W=await $(G),{clientName:X,commandName:Z,logger:L,dynamoDbDocumentClientOptions:Y={}}=U,{overrideInputFilterSensitiveLog:w,overrideOutputFilterSensitiveLog:Q}=Y,z=w??U.inputFilterSensitiveLog,F=Q??U.outputFilterSensitiveLog,{$metadata:R,...J}=W.output;return L?.info?.({clientName:X,commandName:Z,input:z(G.input),output:F(J),metadata:R}),W}catch(W){const{clientName:X,commandName:Z,logger:L,dynamoDbDocumentClientOptions:Y={}}=U,{overrideInputFilterSensitiveLog:w}=Y,Q=w??U.inputFilterSensitiveLog;throw L?.error?.({clientName:X,commandName:Z,input:Q(G.input),error:W,metadata:W.$metadata}),W}},ZY={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},T3=($)=>({applyToStack:(U)=>{U.add(XY(),ZY)}});var rG="X-Amzn-Trace-Id",LY="AWS_LAMBDA_FUNCTION_NAME",YY="_X_AMZN_TRACE_ID",wY=($)=>(U)=>async(G)=>{const{request:W}=G;if(!y.isInstance(W)||$.runtime!=="node"||W.headers.hasOwnProperty(rG))return U(G);const X=process.env[LY],Z=process.env[YY],L=(Y)=>typeof Y==="string"&&Y.length>0;if(L(X)&&L(Z))W.headers[rG]=Z;return U({...G,request:W})},QY={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},f3=($)=>({applyToStack:(U)=>{U.add(wY($),QY)}});function KK($){return{...$,customUserAgent:typeof $.customUserAgent==="string"?[[$.customUserAgent]]:$.customUserAgent}}class wF{constructor({size:$,params:U}){if(this.data=new Map,this.parameters=[],this.capacity=$??50,U)this.parameters=U}get($,U){const G=this.hash($);if(G===!1)return U();if(!this.data.has(G)){if(this.data.size>this.capacity+10){const W=this.data.keys();let X=0;while(!0){const{value:Z,done:L}=W.next();if(this.data.delete(Z),L||++X>10)break}}this.data.set(G,U())}return this.data.get(G)}size(){return this.data.size}hash($){let U="";const{parameters:G}=this;if(G.length===0)return!1;for(let W of G){const X=String($[W]??"");if(X.includes("|;"))return!1;U+=X+"|;"}return U}}var QF=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}$"),r0=($)=>QF.test($)||$.startsWith("[")&&$.endsWith("]");var zF=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),o0=($,U=!1)=>{if(!U)return zF.test($);const G=$.split(".");for(let W of G)if(!o0(W))return!1;return!0};var a0={};var t="endpoints";function d($){if(typeof $!=="object"||$==null)return $;if("ref"in $)return`\$${d($.ref)}`;if("fn"in $)return`${$.fn}(${($.argv||[]).map(d).join(", ")})`;return JSON.stringify($,null,2)}class C extends Error{constructor($){super($);this.name="EndpointError"}}var HX=($,U)=>$===U;var AX=($)=>{const U=$.split("."),G=[];for(let W of U){const X=W.indexOf("[");if(X!==-1){if(W.indexOf("]")!==W.length-1)throw new C(`Path: '${$}' does not end with ']'`);const Z=W.slice(X+1,-1);if(Number.isNaN(parseInt(Z)))throw new C(`Invalid array index: '${Z}' in path: '${$}'`);if(X!==0)G.push(W.slice(0,X));G.push(Z)}else G.push(W)}return G};var u1=($,U)=>AX(U).reduce((G,W)=>{if(typeof G!=="object")throw new C(`Index '${W}' in '${U}' not found in '${JSON.stringify($)}'`);else if(Array.isArray(G))return G[parseInt(W)];return G[W]},$);var OX=($)=>$!=null;var CX=($)=>!$;var _1=V$(Q0(),1);var BU={[_1.EndpointURLScheme.HTTP]:80,[_1.EndpointURLScheme.HTTPS]:443},fX=($)=>{const U=(()=>{try{if($ instanceof URL)return $;if(typeof $==="object"&&"hostname"in $){const{hostname:R,port:J,protocol:I="",path:V="",query:B={}}=$,E=new URL(`${I}//${R}${J?`:${J}`:""}${V}`);return E.search=Object.entries(B).map(([T,H])=>`${T}=${H}`).join("&"),E}return new URL($)}catch(R){return null}})();if(!U)return console.error(`Unable to parse ${JSON.stringify($)} as a whatwg URL.`),null;const G=U.href,{host:W,hostname:X,pathname:Z,protocol:L,search:Y}=U;if(Y)return null;const w=L.slice(0,-1);if(!Object.values(_1.EndpointURLScheme).includes(w))return null;const Q=r0(X),z=G.includes(`${W}:${BU[w]}`)||typeof $==="string"&&$.includes(`${W}:${BU[w]}`),F=`${W}${z?`:${BU[w]}`:""}`;return{scheme:w,authority:F,path:Z,normalizedPath:Z.endsWith("/")?Z:`${Z}/`,isIp:Q}};var qX=($,U)=>$===U;var NX=($,U,G,W)=>{if(U>=G||$.length<G)return null;if(!W)return $.substring(U,G);return $.substring($.length-G,$.length-U)};var jX=($)=>encodeURIComponent($).replace(/[!*'()]/g,(U)=>`%${U.charCodeAt(0).toString(16).toUpperCase()}`);var PX={booleanEquals:HX,getAttr:u1,isSet:OX,isValidHostLabel:o0,not:CX,parseURL:fX,stringEquals:qX,substring:NX,uriEncode:jX};var d1=($,U)=>{const G=[],W={...U.endpointParams,...U.referenceRecord};let X=0;while(X<$.length){const Z=$.indexOf("{",X);if(Z===-1){G.push($.slice(X));break}G.push($.slice(X,Z));const L=$.indexOf("}",Z);if(L===-1){G.push($.slice(Z));break}if($[Z+1]==="{"&&$[L+1]==="}")G.push($.slice(Z+1,L)),X=L+2;const Y=$.substring(Z+1,L);if(Y.includes("#")){const[w,Q]=Y.split("#");G.push(u1(W[w],Q))}else G.push(W[Y]);X=L+1}return G.join("")};var SX=({ref:$},U)=>{return{...U.endpointParams,...U.referenceRecord}[$]};var X0=($,U,G)=>{if(typeof $==="string")return d1($,G);else if($.fn)return g1($,G);else if($.ref)return SX($,G);throw new C(`'${U}': ${String($)} is not a string, function or reference.`)};var g1=({fn:$,argv:U},G)=>{const W=U.map((Z)=>["boolean","number"].includes(typeof Z)?Z:X0(Z,"arg",G)),X=$.split(".");if(X[0]in a0&&X[1]!=null)return a0[X[0]][X[1]](...W);return PX[$](...W)};var DX=({assign:$,...U},G)=>{if($&&$ in G.referenceRecord)throw new C(`'${$}' is already defined in Reference Record.`);const W=g1(U,G);return G.logger?.debug?.(`${t} evaluateCondition: ${d(U)} = ${d(W)}`),{result:W===""?!0:!!W,...$!=null&&{toAssign:{name:$,value:W}}}};var j0=($=[],U)=>{const G={};for(let W of $){const{result:X,toAssign:Z}=DX(W,{...U,referenceRecord:{...U.referenceRecord,...G}});if(!X)return{result:X};if(Z)G[Z.name]=Z.value,U.logger?.debug?.(`${t} assign: ${Z.name} := ${d(Z.value)}`)}return{result:!0,referenceRecord:G}};var bX=($,U)=>Object.entries($).reduce((G,[W,X])=>({...G,[W]:X.map((Z)=>{const L=X0(Z,"Header value entry",U);if(typeof L!=="string")throw new C(`Header '${W}' value '${L}' is not a string`);return L})}),{});var VU=($,U)=>{if(Array.isArray($))return $.map((G)=>VU(G,U));switch(typeof $){case"string":return d1($,U);case"object":if($===null)throw new C(`Unexpected endpoint property: ${$}`);return p1($,U);case"boolean":return $;default:throw new C(`Unexpected endpoint property type: ${typeof $}`)}};var p1=($,U)=>Object.entries($).reduce((G,[W,X])=>({...G,[W]:VU(X,U)}),{});var kX=($,U)=>{const G=X0($,"Endpoint URL",U);if(typeof G==="string")try{return new URL(G)}catch(W){throw console.error(`Failed to construct URL with ${G}`,W),W}throw new C(`Endpoint URL must be a string, got ${typeof G}`)};var hX=($,U)=>{const{conditions:G,endpoint:W}=$,{result:X,referenceRecord:Z}=j0(G,U);if(!X)return;const L={...U,referenceRecord:{...U.referenceRecord,...Z}},{url:Y,properties:w,headers:Q}=W;return U.logger?.debug?.(`${t} Resolving endpoint from template: ${d(W)}`),{...Q!=null&&{headers:bX(Q,L)},...w!=null&&{properties:p1(w,L)},url:kX(Y,L)}};var xX=($,U)=>{const{conditions:G,error:W}=$,{result:X,referenceRecord:Z}=j0(G,U);if(!X)return;throw new C(X0(W,"Error",{...U,referenceRecord:{...U.referenceRecord,...Z}}))};var vX=($,U)=>{const{conditions:G,rules:W}=$,{result:X,referenceRecord:Z}=j0(G,U);if(!X)return;return l1(W,{...U,referenceRecord:{...U.referenceRecord,...Z}})};var l1=($,U)=>{for(let G of $)if(G.type==="endpoint"){const W=hX(G,U);if(W)return W}else if(G.type==="error")xX(G,U);else if(G.type==="tree"){const W=vX(G,U);if(W)return W}else throw new C(`Unknown endpoint rule: ${G}`);throw new C("Rules evaluation failed")};var FF=($,U)=>{const{endpointParams:G,logger:W}=U,{parameters:X,rules:Z}=$;U.logger?.debug?.(`${t} Initial EndpointParams: ${d(G)}`);const L=Object.entries(X).filter(([,Q])=>Q.default!=null).map(([Q,z])=>[Q,z.default]);if(L.length>0)for(let[Q,z]of L)G[Q]=G[Q]??z;const Y=Object.entries(X).filter(([,Q])=>Q.required).map(([Q])=>Q);for(let Q of Y)if(G[Q]==null)throw new C(`Missing required parameter: '${Q}'`);const w=l1(Z,{endpointParams:G,logger:W,referenceRecord:{}});return U.logger?.debug?.(`${t} Resolved endpoint: ${d(w)}`),w};var EU=($,U=!1)=>{if(U){for(let G of $.split("."))if(!EU(G))return!1;return!0}if(!o0($))return!1;if($.length<3||$.length>63)return!1;if($!==$.toLowerCase())return!1;if(r0($))return!1;return!0};var cX=($)=>{const U=$.split(":");if(U.length<6)return null;const[G,W,X,Z,L,...Y]=U;if(G!=="arn"||W===""||X===""||Y.join(":")==="")return null;const w=Y.map((Q)=>Q.split("/")).flat();return{partition:W,service:X,region:Z,accountId:L,resourceId:w}};var yX={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"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 JF=yX,IF="",uX=($)=>{const{partitions:U}=JF;for(let W of U){const{regions:X,outputs:Z}=W;for(let[L,Y]of Object.entries(X))if(L===$)return{...Z,...Y}}for(let W of U){const{regionRegex:X,outputs:Z}=W;if(new RegExp(X).test($))return{...Z}}const G=U.find((W)=>W.id==="aws");if(!G)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...G.outputs}};var _X=()=>IF;var KF={isVirtualHostableS3Bucket:EU,parseArn:cX,partition:uX};a0.aws=KF;var TU="user-agent",s1="x-amz-user-agent",HU=" ",m1="/",dX=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,gX=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,AU="-";var MF=($)=>(U,G)=>async(W)=>{const{request:X}=W;if(!y.isInstance(X))return U(W);const{headers:Z}=X,L=G?.userAgent?.map(OU)||[],Y=(await $.defaultUserAgentProvider()).map(OU),w=$?.customUserAgent?.map(OU)||[],Q=_X(),z=(Q?[Q]:[]).concat([...Y,...L,...w]).join(HU),F=[...Y.filter((R)=>R.startsWith("aws-sdk-")),...w].join(HU);if($.runtime!=="browser"){if(F)Z[s1]=Z[s1]?`${Z[TU]} ${F}`:F;Z[TU]=z}else Z[s1]=z;return U({...W,request:X})},OU=($)=>{const U=$[0].split(m1).map((L)=>L.replace(dX,AU)).join(m1),G=$[1]?.replace(gX,AU),W=U.indexOf(m1),X=U.substring(0,W);let Z=U.substring(W+1);if(X==="api")Z=Z.toLowerCase();return[X,Z,G].filter((L)=>L&&L.length>0).reduce((L,Y,w)=>{switch(w){case 0:return Y;case 1:return`${L}/${Y}`;default:return`${L}#${Y}`}},"")},BF={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},oB=($)=>({applyToStack:(U)=>{U.add(MF($),BF)}});var n1=($)=>typeof $==="string"&&($.startsWith("fips-")||$.endsWith("-fips"));var CU=($)=>n1($)?["fips-aws-global","aws-fips"].includes($)?"us-east-1":$.replace(/fips-(dkr-|prod-)?|-fips/,""):$;var LV=($)=>{const{region:U,useFipsEndpoint:G}=$;if(!U)throw new Error("Region is missing");return{...$,region:async()=>{if(typeof U==="string")return CU(U);const W=await U();return CU(W)},useFipsEndpoint:async()=>{const W=typeof U==="string"?U:await U();if(n1(W))return!0;return typeof G!=="function"?Promise.resolve(!!G):G()}}};var P0=($,U,G)=>{if(!(U in $))return;if($[U]==="true")return!0;if($[U]==="false")return!1;throw new Error(`Cannot load ${G} "${U}". Expected "true" or "false", got ${$[U]}.`)};var Z0;(function($){$.ENV="env",$.CONFIG="shared config entry"})(Z0||(Z0={}));var VF="AWS_USE_DUALSTACK_ENDPOINT",EF="use_dualstack_endpoint";var MV={environmentVariableSelector:($)=>P0($,VF,Z0.ENV),configFileSelector:($)=>P0($,EF,Z0.CONFIG),default:!1};var TF="AWS_USE_FIPS_ENDPOINT",HF="use_fips_endpoint";var EV={environmentVariableSelector:($)=>P0($,TF,Z0.ENV),configFileSelector:($)=>P0($,HF,Z0.CONFIG),default:!1};var fU=V$(Q0(),1),pX=($)=>$[fU.SMITHY_CONTEXT_KEY]||($[fU.SMITHY_CONTEXT_KEY]={});var e=($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U};var lX={environmentVariableSelector:($)=>$.AWS_REGION,configFileSelector:($)=>$.region,default:()=>{throw new Error("Region is missing")}},yV={preferredFile:"credentials"};function AF($){return(U)=>async(G)=>{const W=G.request;if(y.isInstance(W)){const{body:X,headers:Z}=W;if(X&&Object.keys(Z).map((L)=>L.toLowerCase()).indexOf(sX)===-1)try{const L=$(X);W.headers={...W.headers,[sX]:String(L)}}catch(L){}}return U({...G,request:W})}}var sX="content-length",OF={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},FE=($)=>({applyToStack:(U)=>{U.add(AF($.bodyLengthChecker),OF)}});var mX=($,U)=>(G)=>async(W)=>{const{response:X}=await G(W);try{const Z=await U(X,$);return{response:X,output:Z}}catch(Z){if(Object.defineProperty(Z,"$response",{value:X}),!("$metadata"in Z)){if(Z.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof Z.$responseBodyText!=="undefined"){if(Z.$response)Z.$response.body=Z.$responseBodyText}}throw Z}};var nX=($,U)=>(G,W)=>async(X)=>{const Z=W.endpointV2?.url&&$.urlParser?async()=>$.urlParser(W.endpointV2.url):$.endpoint;if(!Z)throw new Error("No valid endpoint provider available.");const L=await U(X.input,{...$,endpoint:Z});return G({...X,request:L})};function BE($,U,G){return{applyToStack:(W)=>{W.add(mX($,G),CF),W.add(nX($,U),qU)}}}var CF={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},qU={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};var iX=async($)=>{const U=$?.Bucket||"";if(typeof $.Bucket==="string")$.Bucket=U.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(PF(U)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!jF(U)||U.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||U.toLowerCase()!==U||U.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},fF=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,qF=/(\d+\.){3}\d+/,NF=/\.\./;var jF=($)=>fF.test($)&&!qF.test($)&&!NF.test($),PF=($)=>{const[U,G,W,,,X]=$.split(":"),Z=U==="arn"&&$.split(":").length>=6,L=Boolean(Z&&G&&W&&X);if(Z&&!L)throw new Error(`Invalid ARN: ${$} was an invalid ARN.`);return L};var rX=($,U,G)=>{const W=async()=>{const X=G[$]??G[U];if(typeof X==="function")return X();return X};if($==="credentialScope"||U==="CredentialScope")return async()=>{const X=typeof G.credentials==="function"?await G.credentials():G.credentials;return X?.credentialScope??X?.CredentialScope};if($==="accountId"||U==="AccountId")return async()=>{const X=typeof G.credentials==="function"?await G.credentials():G.credentials;return X?.accountId??X?.AccountId};if($==="endpoint"||U==="endpoint")return async()=>{const X=await W();if(X&&typeof X==="object"){if("url"in X)return X.url.href;if("hostname"in X){const{protocol:Z,hostname:L,port:Y,path:w}=X;return`${Z}//${L}${Y?":"+Y:""}${w}`}}return X};return W};var oX="AWS_ENDPOINT_URL",aX="endpoint_url",tX=($)=>({environmentVariableSelector:(U)=>{const G=$.split(" ").map((Z)=>Z.toUpperCase()),W=U[[oX,...G].join("_")];if(W)return W;const X=U[oX];if(X)return X;return},configFileSelector:(U,G)=>{if(G&&U.services){const X=G[["services",U.services].join(NU)];if(X){const Z=$.split(" ").map((Y)=>Y.toLowerCase()),L=X[[Z.join("_"),aX].join(NU)];if(L)return L}}const W=U[aX];if(W)return W;return},default:void 0});var i1=async($)=>K0(tX($??""))();var r1=($)=>{if(typeof $==="object"){if("url"in $)return jU($.url);return $}return jU($)};var eX=async($,U,G,W)=>{if(!G.endpoint){let L;if(G.serviceConfiguredEndpoint)L=await G.serviceConfiguredEndpoint();else L=await i1(G.serviceId);if(L)G.endpoint=()=>Promise.resolve(r1(L))}const X=await SF($,U,G);if(typeof G.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return G.endpointProvider(X,W)},SF=async($,U,G)=>{const W={},X=U?.getEndpointParameterInstructions?.()||{};for(let[Z,L]of Object.entries(X))switch(L.type){case"staticContextParams":W[Z]=L.value;break;case"contextParams":W[Z]=$[L.name];break;case"clientContextParams":case"builtInParams":W[Z]=await rX(L.name,Z,G)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(L))}if(Object.keys(X).length===0)Object.assign(W,G);if(String(G.serviceId).toLowerCase()==="s3")await iX(W);return W};var $Z=({config:$,instructions:U})=>{return(G,W)=>async(X)=>{const Z=await eX(X.input,{getEndpointParameterInstructions(){return U}},{...$},W);W.endpointV2=Z,W.authSchemes=Z.properties?.authSchemes;const L=W.authSchemes?.[0];if(L){W.signing_region=L.signingRegion,W.signing_service=L.signingName;const w=pX(W)?.selectedHttpAuthScheme?.httpAuthOption;if(w)w.signingProperties=Object.assign(w.signingProperties||{},{signing_region:L.signingRegion,signingRegion:L.signingRegion,signing_service:L.signingName,signingName:L.signingName,signingRegionSet:L.signingRegionSet},L.properties)}return G({...X})}};var DF={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:qU.name},lE=($,U)=>({applyToStack:(G)=>{G.addRelativeTo($Z({config:$,instructions:U}),DF)}});var rE=($)=>{const U=$.tls??!0,{endpoint:G}=$,W=G!=null?async()=>r1(await e(G)()):void 0,Z={...$,endpoint:W,tls:U,isCustomEndpoint:!!G,useDualstackEndpoint:e($.useDualstackEndpoint??!1),useFipsEndpoint:e($.useFipsEndpoint??!1)};let L=void 0;return Z.serviceConfiguredEndpoint=async()=>{if($.serviceId&&!L)L=i1($.serviceId);return L},Z};var g;(function($){$.STANDARD="standard",$.ADAPTIVE="adaptive"})(g||(g={}));var M0=3,UZ=g.STANDARD;var GZ=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],WZ=["TimeoutError","RequestTimeout","RequestTimeoutException"],XZ=[500,502,503,504],ZZ=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];var bF=($)=>$.$metadata?.clockSkewCorrected,S0=($)=>$.$metadata?.httpStatusCode===429||GZ.includes($.name)||$.$retryable?.throttling==!0,o1=($)=>bF($)||WZ.includes($.name)||ZZ.includes($?.code||"")||XZ.includes($.$metadata?.httpStatusCode||0),LZ=($)=>{if($.$metadata?.httpStatusCode!==void 0){const U=$.$metadata.httpStatusCode;if(500<=U&&U<=599&&!o1($))return!0;return!1}return!1};class a1{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 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($){if(!this.enabled)return;if(this.refillTokenBucket(),$>this.currentCapacity){const U=($-this.currentCapacity)/this.fillRate*1000;await new Promise((G)=>setTimeout(G,U))}this.currentCapacity=this.currentCapacity-$}refillTokenBucket(){const $=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=$;return}const U=($-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+U),this.lastTimestamp=$}updateClientSendingRate($){let U;if(this.updateMeasuredRate(),S0($)){const W=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=W,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),U=this.cubicThrottle(W),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($){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(),U=Math.floor($*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($){return parseFloat($.toFixed(8))}}var B0=100,t0=20000,PU=500,t1=500,SU=5,DU=10,bU=1,e1="amz-sdk-invocation-id",$$="amz-sdk-request";var YZ=()=>{let $=B0;return{computeNextBackoffDelay:(W)=>{return Math.floor(Math.min(t0,Math.random()*2**W*$))},setDelayBase:(W)=>{$=W}}};var kU=({retryDelay:$,retryCount:U,retryCost:G})=>{return{getRetryCount:()=>U,getRetryDelay:()=>Math.min(t0,$),getRetryCost:()=>G}};class D0{constructor($){this.maxAttempts=$,this.mode=g.STANDARD,this.capacity=t1,this.retryBackoffStrategy=YZ(),this.maxAttemptsProvider=typeof $==="function"?$:async()=>$}async acquireInitialRetryToken($){return kU({retryDelay:B0,retryCount:0})}async refreshRetryTokenForRetry($,U){const G=await this.getMaxAttempts();if(this.shouldRetry($,U,G)){const W=U.errorType;this.retryBackoffStrategy.setDelayBase(W==="THROTTLING"?PU:B0);const X=this.retryBackoffStrategy.computeNextBackoffDelay($.getRetryCount()),Z=U.retryAfterHint?Math.max(U.retryAfterHint.getTime()-Date.now()||0,X):X,L=this.getCapacityCost(W);return this.capacity-=L,kU({retryDelay:Z,retryCount:$.getRetryCount()+1,retryCost:L})}throw new Error("No retry token available")}recordSuccess($){this.capacity=Math.max(t1,this.capacity+($.getRetryCost()??bU))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch($){return console.warn(`Max attempts provider could not resolve. Using default of ${M0}`),M0}}shouldRetry($,U,G){return $.getRetryCount()+1<G&&this.capacity>=this.getCapacityCost(U.errorType)&&this.isRetryableError(U.errorType)}getCapacityCost($){return $==="TRANSIENT"?DU:SU}isRetryableError($){return $==="THROTTLING"||$==="TRANSIENT"}}class hU{constructor($,U){this.maxAttemptsProvider=$,this.mode=g.ADAPTIVE;const{rateLimiter:G}=U??{};this.rateLimiter=G??new a1,this.standardRetryStrategy=new D0($)}async acquireInitialRetryToken($){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken($)}async refreshRetryTokenForRetry($,U){return this.rateLimiter.updateClientSendingRate(U),this.standardRetryStrategy.refreshRetryTokenForRetry($,U)}recordSuccess($){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess($)}}var wZ="AWS_MAX_ATTEMPTS",QZ="max_attempts",_T={environmentVariableSelector:($)=>{const U=$[wZ];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Environment variable ${wZ} mast be a number, got "${U}"`);return G},configFileSelector:($)=>{const U=$[QZ];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Shared config file entry ${QZ} mast be a number, got "${U}"`);return G},default:M0},dT=($)=>{const{retryStrategy:U}=$,G=e($.maxAttempts??M0);return{...$,maxAttempts:G,retryStrategy:async()=>{if(U)return U;if(await e($.retryMode)()===g.ADAPTIVE)return new hU(G);return new D0(G)}}},kF="AWS_RETRY_MODE",hF="retry_mode",gT={environmentVariableSelector:($)=>$[kF],configFileSelector:($)=>$[hF],default:UZ};import{Readable as xF}from"stream";var zZ=($)=>$?.body instanceof xF||typeof ReadableStream!=="undefined"&&$?.body instanceof ReadableStream;var xU=($)=>{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 vF=($)=>(U,G)=>async(W)=>{let X=await $.retryStrategy();const Z=await $.maxAttempts();if(cF(X)){X=X;let L=await X.acquireInitialRetryToken(G.partition_id),Y=new Error,w=0,Q=0;const{request:z}=W,F=y.isInstance(z);if(F)z.headers[e1]=iG();while(!0)try{if(F)z.headers[$$]=`attempt=${w+1}; max=${Z}`;const{response:R,output:J}=await U(W);return X.recordSuccess(L),J.$metadata.attempts=w+1,J.$metadata.totalRetryDelay=Q,{response:R,output:J}}catch(R){const J=yF(R);if(Y=xU(R),F&&zZ(z))throw(G.logger instanceof FZ?console:G.logger)?.warn("An error was encountered in a non-retryable streaming request."),Y;try{L=await X.refreshRetryTokenForRetry(L,J)}catch(V){if(!Y.$metadata)Y.$metadata={};throw Y.$metadata.attempts=w+1,Y.$metadata.totalRetryDelay=Q,Y}w=L.getRetryCount();const I=L.getRetryDelay();Q+=I,await new Promise((V)=>setTimeout(V,I))}}else{if(X=X,X?.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",X.mode]];return X.retry(U,W)}},cF=($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined",yF=($)=>{const U={error:$,errorType:uF($)},G=dF($.$response);if(G)U.retryAfterHint=G;return U},uF=($)=>{if(S0($))return"THROTTLING";if(o1($))return"TRANSIENT";if(LZ($))return"SERVER_ERROR";return"CLIENT_ERROR"},_F={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},$H=($)=>({applyToStack:(U)=>{U.add(vF($),_F)}}),dF=($)=>{if(!vU.isInstance($))return;const U=Object.keys($.headers).find((Z)=>Z.toLowerCase()==="retry-after");if(!U)return;const G=$.headers[U],W=Number(G);if(!Number.isNaN(W))return new Date(W*1000);return new Date(G)};import{platform as DI,release as bI}from"os";import{env as bL,versions as kI}from"process";var aU={isCrtAvailable:!1};var DL=()=>{if(aU.isCrtAvailable)return["md/crt-avail"];return null};var hI="AWS_SDK_UA_APP_ID",xI="sdk-ua-app-id",LA=({serviceId:$,clientVersion:U})=>{const G=[["aws-sdk-js",U],["ua","2.0"],[`os/${DI()}`,bI()],["lang/js"],["md/nodejs",`${kI.node}`]],W=DL();if(W)G.push(W);if($)G.push([`api/${$}`,U]);if(bL.AWS_EXECUTION_ENV)G.push([`exec-env/${bL.AWS_EXECUTION_ENV}`]);const X=K0({environmentVariableSelector:(L)=>L[hI],configFileSelector:(L)=>L[xI],default:void 0})();let Z=void 0;return async()=>{if(!Z){const L=await X;Z=L?[...G,[`app/${L}`]]:[...G]}return Z}};import{Buffer as vI}from"buffer";import{createHash as cI,createHmac as yI}from"crypto";function kL($,U){if(vI.isBuffer($))return $;if(typeof $==="string")return hL($,U);if(ArrayBuffer.isView($))return tU($.buffer,$.byteOffset,$.byteLength);return tU($)}class uI{constructor($,U){this.algorithmIdentifier=$,this.secret=U,this.reset()}update($,U){this.hash.update(xL(kL($,U)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?yI(this.algorithmIdentifier,kL(this.secret)):cI(this.algorithmIdentifier)}}import{fstatSync as _I,lstatSync as dI}from"fs";var KA=($)=>{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 dI($.path).size;else if(typeof $.fd==="number")return _I($.fd).size;throw new Error(`Body Length computation failed for ${$}`)};var vL="AWS_EXECUTION_ENV",eU="AWS_REGION",$G="AWS_DEFAULT_REGION",cL="AWS_EC2_METADATA_DISABLED",yL=["in-region","cross-region","mobile","standard","legacy"],uL="/latest/meta-data/placement/region";var _L={environmentVariableSelector:($)=>{return $.AWS_DEFAULTS_MODE},configFileSelector:($)=>{return $.defaults_mode},default:"legacy"};var qA=({region:$=K0(lX),defaultsMode:U=K0(_L)}={})=>dL(async()=>{const G=typeof U==="function"?await U():U;switch(G?.toLowerCase()){case"auto":return gI($);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(G?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${yL.join(", ")}, got ${G}`)}}),gI=async($)=>{if($){const U=typeof $==="function"?await $():$,G=await pI();if(!G)return"standard";if(U===G)return"in-region";else return"cross-region"}return"standard"},pI=async()=>{if(process.env[vL]&&(process.env[eU]||process.env[$G]))return process.env[eU]??process.env[$G];if(!process.env[cL])try{const{getInstanceMetadataEndpoint:$,httpRequest:U}=await import("./chunk-yq29sh4p.js"),G=await $();return(await U({...G,path:uL})).toString()}catch($){}};var SA=($)=>{let U=async()=>{if($.region===void 0)throw new Error("Region is missing from runtimeConfig");const G=$.region;if(typeof G==="string")return G;return G()};return{setRegion(G){U=G},region(){return U}}},DA=($)=>{return{region:$.region()}};export{iG as V,pX as W,e as X,B3 as Y,V3 as Z,T3 as _,f3 as $,P0 as aa,Z0 as ba,MU as ca,KK as da,wF as ea,a0 as fa,FF as ga,KF as ha,oB as ia,MV as ja,EV as ka,lX as la,yV as ma,LV as na,FE as oa,SF as pa,BE as qa,lE as ra,rE as sa,UZ as ta,_T as ua,dT as va,gT as wa,$H as xa,SI as ya,LA as za,uI as Aa,KA as Ba,qA as Ca,SA as Da,DA as Ea};
19
+
20
+ //# debugId=A50D7507BD6280FF64756E2164756E21