gemi 0.4.122 → 0.4.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/App.d.ts.map +1 -1
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +3 -3
- package/dist/bin/index.js +7 -3
- package/dist/broadcasting/index.js +1 -1
- package/dist/{chunk-en3dm124.js → chunk-1we4kcb2.js} +2 -2
- package/dist/{chunk-en3dm124.js.map → chunk-1we4kcb2.js.map} +1 -1
- package/dist/{chunk-35bsy26w.js → chunk-2c4nwgcj.js} +2 -2
- package/dist/{chunk-35bsy26w.js.map → chunk-2c4nwgcj.js.map} +1 -1
- package/dist/chunk-34x1c2ey.js +4 -0
- package/dist/{chunk-ke7espn1.js.map → chunk-34x1c2ey.js.map} +2 -2
- package/dist/{chunk-s9b02cxr.js → chunk-39kxd828.js} +2 -2
- package/dist/{chunk-s9b02cxr.js.map → chunk-39kxd828.js.map} +1 -1
- package/dist/chunk-3ynep2h9.js +4 -0
- package/dist/{chunk-ktwy9nyn.js.map → chunk-3ynep2h9.js.map} +1 -1
- package/dist/{chunk-qtw719ea.js → chunk-5bsvn385.js} +2 -2
- package/dist/{chunk-qtw719ea.js.map → chunk-5bsvn385.js.map} +1 -1
- package/dist/{chunk-td079vg9.js → chunk-6wj5qxwf.js} +2 -2
- package/dist/{chunk-td079vg9.js.map → chunk-6wj5qxwf.js.map} +1 -1
- package/dist/{chunk-cm1wsxdn.js → chunk-8vjfr0mp.js} +3 -3
- package/dist/{chunk-cm1wsxdn.js.map → chunk-8vjfr0mp.js.map} +1 -1
- package/dist/chunk-93r4rez6.js +4 -0
- package/dist/{chunk-rnrwx4ge.js.map → chunk-93r4rez6.js.map} +1 -1
- package/dist/chunk-9vb54d71.js +4 -0
- package/dist/{chunk-fjsnw41x.js.map → chunk-9vb54d71.js.map} +2 -2
- package/dist/chunk-9xeqzq5a.js +8 -0
- package/dist/{chunk-r2nsghf6.js.map → chunk-9xeqzq5a.js.map} +2 -2
- package/dist/chunk-cw23pjra.js +4 -0
- package/dist/{chunk-bh8r9220.js.map → chunk-cw23pjra.js.map} +6 -6
- package/dist/{chunk-jkce121q.js → chunk-d7hn6b85.js} +3 -3
- package/dist/{chunk-jkce121q.js.map → chunk-d7hn6b85.js.map} +1 -1
- package/dist/chunk-dq276gmc.js +4 -0
- package/dist/{chunk-dtkvdcf6.js.map → chunk-dq276gmc.js.map} +2 -2
- package/dist/{chunk-1599b26e.js → chunk-g290rywa.js} +3 -3
- package/dist/{chunk-1599b26e.js.map → chunk-g290rywa.js.map} +4 -3
- package/dist/chunk-g31vhvsw.js +3 -0
- package/dist/chunk-g31vhvsw.js.map +15 -0
- package/dist/{chunk-015evbr0.js → chunk-gz4h6jsy.js} +3 -3
- package/dist/{chunk-015evbr0.js.map → chunk-gz4h6jsy.js.map} +1 -1
- package/dist/chunk-hddz9z7a.js +11 -0
- package/dist/{chunk-rp64pvnb.js.map → chunk-hddz9z7a.js.map} +5 -5
- package/dist/chunk-j618jvh4.js +4 -0
- package/dist/{chunk-y4gsnyde.js.map → chunk-j618jvh4.js.map} +2 -2
- package/dist/chunk-k4rg25z3.js +4 -0
- package/dist/chunk-k4rg25z3.js.map +16 -0
- package/dist/chunk-kqyj62v4.js +4 -0
- package/dist/{chunk-nngte4x2.js.map → chunk-kqyj62v4.js.map} +2 -2
- package/dist/chunk-ksckhxbt.js +4 -0
- package/dist/{chunk-j96bxzdg.js.map → chunk-ksckhxbt.js.map} +5 -5
- package/dist/chunk-m1838202.js +20 -0
- package/dist/{chunk-0d2nt0w0.js.map → chunk-m1838202.js.map} +14 -11
- package/dist/chunk-m7wq4g1v.js +4 -0
- package/dist/{chunk-qf019x32.js.map → chunk-m7wq4g1v.js.map} +6 -6
- package/dist/chunk-t6cspqr4.js +4 -0
- package/dist/{chunk-b3y9gq5a.js.map → chunk-t6cspqr4.js.map} +2 -2
- package/dist/chunk-wrm0pxh2.js +4 -0
- package/dist/chunk-wrm0pxh2.js.map +14 -0
- package/dist/chunk-ycz2czq7.js +4 -0
- package/dist/{chunk-hbxhheve.js.map → chunk-ycz2czq7.js.map} +2 -2
- package/dist/client/WebsocketContext.d.ts.map +1 -1
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/Broadcast.d.ts +1 -1
- package/dist/facades/FileStorage.d.ts +1 -0
- package/dist/facades/FileStorage.d.ts.map +1 -1
- package/dist/facades/Log.d.ts +11 -0
- package/dist/facades/Log.d.ts.map +1 -0
- package/dist/facades/Url.d.ts +6 -0
- package/dist/facades/Url.d.ts.map +1 -0
- package/dist/facades/index.d.ts +2 -0
- package/dist/facades/index.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +11 -7
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/kernel/Kernel.d.ts +2 -0
- package/dist/kernel/Kernel.d.ts.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +3 -3
- package/dist/server/index.js +4 -4
- package/dist/server/index.js.map +3 -3
- package/dist/services/file-storage/drivers/FileStorageDriver.d.ts +1 -0
- package/dist/services/file-storage/drivers/FileStorageDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/FileSystemDriver.d.ts +1 -0
- package/dist/services/file-storage/drivers/FileSystemDriver.d.ts.map +1 -1
- package/dist/services/file-storage/drivers/S3Driver.d.ts +1 -0
- package/dist/services/file-storage/drivers/S3Driver.d.ts.map +1 -1
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -12
- package/dist/services/index.js.map +11 -20
- package/dist/services/logging/LoggingRouter.d.ts +7 -0
- package/dist/services/logging/LoggingRouter.d.ts.map +1 -0
- package/dist/services/logging/LoggingServiceContainer.d.ts +22 -0
- package/dist/services/logging/LoggingServiceContainer.d.ts.map +1 -0
- package/dist/services/logging/LoggingServiceProvider.d.ts +9 -0
- package/dist/services/logging/LoggingServiceProvider.d.ts.map +1 -0
- package/dist/services/logging/types.d.ts +9 -0
- package/dist/services/logging/types.d.ts.map +1 -0
- package/dist/services/pubsub/BroadcastingServiceContainer.d.ts.map +1 -1
- package/dist/services/router/ApiRouterServiceContainer.d.ts.map +1 -1
- package/dist/services/router/ApiRouterServiceProvider.d.ts +4 -0
- package/dist/services/router/ApiRouterServiceProvider.d.ts.map +1 -1
- package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -1
- package/dist/services/router/ViewRouterServiceProvider.d.ts +4 -0
- package/dist/services/router/ViewRouterServiceProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-0d2nt0w0.js +0 -20
- package/dist/chunk-b3y9gq5a.js +0 -4
- package/dist/chunk-bh8r9220.js +0 -4
- package/dist/chunk-dtkvdcf6.js +0 -4
- package/dist/chunk-fjsnw41x.js +0 -4
- package/dist/chunk-hbxhheve.js +0 -4
- package/dist/chunk-j96bxzdg.js +0 -4
- package/dist/chunk-ke7espn1.js +0 -4
- package/dist/chunk-kqs3rmad.js +0 -4
- package/dist/chunk-kqs3rmad.js.map +0 -10
- package/dist/chunk-ktwy9nyn.js +0 -4
- package/dist/chunk-nngte4x2.js +0 -4
- package/dist/chunk-qf019x32.js +0 -4
- package/dist/chunk-r2nsghf6.js +0 -8
- package/dist/chunk-rnrwx4ge.js +0 -4
- package/dist/chunk-rp64pvnb.js +0 -11
- package/dist/chunk-vkm736x8.js +0 -4
- package/dist/chunk-vkm736x8.js.map +0 -14
- package/dist/chunk-xqknth7r.js +0 -3
- package/dist/chunk-xqknth7r.js.map +0 -16
- package/dist/chunk-y4gsnyde.js +0 -4
package/dist/chunk-0d2nt0w0.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{I as x,J as R}from"./chunk-td079vg9.js";import{S as C3}from"./chunk-jkce121q.js";import{Ea as _,Fa as PU,Ha as lU,Ia as wL,Ka as QL,Ma as _X,Ra as D4,Ua as R6}from"./chunk-1599b26e.js";import{yb as A0}from"./chunk-cm1wsxdn.js";import{Ab as M0,zb as N8}from"./chunk-xqknth7r.js";import{Bb as T$}from"./chunk-kqs3rmad.js";import{Hb as VU}from"./chunk-en3dm124.js";var Y$=R((nU)=>{function VL($){return $&&$.__esModule?$:{default:$}}function HL(){if(W1>X1.length-16)BL.default.randomFillSync(X1),W1=0;return X1.slice(W1,W1+=16)}Object.defineProperty(nU,"__esModule",{value:!0});nU.default=HL;var BL=VL(import.meta.require("crypto")),X1=new Uint8Array(256),W1=X1.length});var oU=R((iU)=>{Object.defineProperty(iU,"__esModule",{value:!0});iU.default=void 0;var EL=/^(?:[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;iU.default=EL});var h0=R((aU)=>{function OL($){return $&&$.__esModule?$:{default:$}}function fL($){return typeof $==="string"&&TL.default.test($)}Object.defineProperty(aU,"__esModule",{value:!0});aU.default=void 0;var TL=OL(oU()),CL=fL;aU.default=CL});var x0=R(($G)=>{function NL($){return $&&$.__esModule?$:{default:$}}function eU($,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 PL($,U=0){const G=eU($,U);if(!qL.default(G))throw TypeError("Stringified UUID is invalid");return G}Object.defineProperty($G,"__esModule",{value:!0});$G.default=void 0;$G.unsafeStringify=eU;var qL=NL(h0()),b=[];for(let $=0;$<256;++$)b.push(($+256).toString(16).slice(1));var jL=PL;$G.default=jL});var ZG=R((WG)=>{function DL($){return $&&$.__esModule?$:{default:$}}function hL($,U,G){let W=U&&G||0;const X=U||new Array(16);$=$||{};let Z=$.node||GG,L=$.clockseq!==void 0?$.clockseq:w$;if(Z==null||L==null){const J=$.random||($.rng||kL.default)();if(Z==null)Z=GG=[J[0]|1,J[1],J[2],J[3],J[4],J[5]];if(L==null)L=w$=(J[6]<<8|J[7])&16383}let Y=$.msecs!==void 0?$.msecs:Date.now(),w=$.nsecs!==void 0?$.nsecs:z$+1;const Q=Y-Q$+(w-z$)/1e4;if(Q<0&&$.clockseq===void 0)L=L+1&16383;if((Q<0||Y>Q$)&&$.nsecs===void 0)w=0;if(w>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Q$=Y,z$=w,w$=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 J=0;J<6;++J)X[W+J]=Z[J];return U||bL.unsafeStringify(X)}Object.defineProperty(WG,"__esModule",{value:!0});WG.default=void 0;var kL=DL(Y$()),bL=x0(),GG,w$,Q$=0,z$=0,xL=hL;WG.default=xL});var F$=R((LG)=>{function cL($){return $&&$.__esModule?$:{default:$}}function yL($){if(!vL.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(LG,"__esModule",{value:!0});LG.default=void 0;var vL=cL(h0()),_L=yL;LG.default=_L});var J$=R((zG)=>{function gL($){return $&&$.__esModule?$:{default:$}}function pL($){$=unescape(encodeURIComponent($));const U=[];for(let G=0;G<$.length;++G)U.push($.charCodeAt(G));return U}function lL($,U,G){function W(X,Z,L,Y){var w;if(typeof X==="string")X=pL(X);if(typeof Z==="string")Z=dL.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 uL.unsafeStringify(Q)}try{W.name=$}catch(X){}return W.DNS=wG,W.URL=QG,W}Object.defineProperty(zG,"__esModule",{value:!0});zG.URL=zG.DNS=void 0;zG.default=lL;var uL=x0(),dL=gL(F$()),wG="6ba7b810-9dad-11d1-80b4-00c04fd430c8";zG.DNS=wG;var QG="6ba7b811-9dad-11d1-80b4-00c04fd430c8";zG.URL=QG});var KG=R((JG)=>{function iL($){return $&&$.__esModule?$:{default:$}}function rL($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return nL.default.createHash("md5").update($).digest()}Object.defineProperty(JG,"__esModule",{value:!0});JG.default=void 0;var nL=iL(import.meta.require("crypto")),oL=rL;JG.default=oL});var VG=R((RG)=>{function MG($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(RG,"__esModule",{value:!0});RG.default=void 0;var aL=MG(J$()),tL=MG(KG()),eL=aL.default("v3",48,tL.default),$Y=eL;RG.default=$Y});var EG=R((HG)=>{function GY($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(HG,"__esModule",{value:!0});HG.default=void 0;var UY=GY(import.meta.require("crypto")),WY={randomUUID:UY.default.randomUUID};HG.default=WY});var qG=R((fG)=>{function OG($){return $&&$.__esModule?$:{default:$}}function LY($,U,G){if(TG.default.randomUUID&&!U&&!$)return TG.default.randomUUID();$=$||{};const W=$.random||($.rng||XY.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 ZY.unsafeStringify(W)}Object.defineProperty(fG,"__esModule",{value:!0});fG.default=void 0;var TG=OG(EG()),XY=OG(Y$()),ZY=x0(),YY=LY;fG.default=YY});var jG=R((NG)=>{function QY($){return $&&$.__esModule?$:{default:$}}function zY($){if(Array.isArray($))$=Buffer.from($);else if(typeof $==="string")$=Buffer.from($,"utf8");return wY.default.createHash("sha1").update($).digest()}Object.defineProperty(NG,"__esModule",{value:!0});NG.default=void 0;var wY=QY(import.meta.require("crypto")),FY=zY;NG.default=FY});var DG=R((kG)=>{function SG($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(kG,"__esModule",{value:!0});kG.default=void 0;var JY=SG(J$()),IY=SG(jG()),KY=JY.default("v5",80,IY.default),MY=KY;kG.default=MY});var vG=R((hG)=>{Object.defineProperty(hG,"__esModule",{value:!0});hG.default=void 0;var RY="00000000-0000-0000-0000-000000000000";hG.default=RY});var _G=R((cG)=>{function VY($){return $&&$.__esModule?$:{default:$}}function HY($){if(!BY.default($))throw TypeError("Invalid UUID");return parseInt($.slice(14,15),16)}Object.defineProperty(cG,"__esModule",{value:!0});cG.default=void 0;var BY=VY(h0()),AY=HY;cG.default=AY});var I$=R((s)=>{function a($){return $&&$.__esModule?$:{default:$}}Object.defineProperty(s,"__esModule",{value:!0});Object.defineProperty(s,"NIL",{enumerable:!0,get:function(){return CY.default}});Object.defineProperty(s,"parse",{enumerable:!0,get:function(){return jY.default}});Object.defineProperty(s,"stringify",{enumerable:!0,get:function(){return PY.default}});Object.defineProperty(s,"v1",{enumerable:!0,get:function(){return EY.default}});Object.defineProperty(s,"v3",{enumerable:!0,get:function(){return TY.default}});Object.defineProperty(s,"v4",{enumerable:!0,get:function(){return OY.default}});Object.defineProperty(s,"v5",{enumerable:!0,get:function(){return fY.default}});Object.defineProperty(s,"validate",{enumerable:!0,get:function(){return NY.default}});Object.defineProperty(s,"version",{enumerable:!0,get:function(){return qY.default}});var EY=a(ZG()),TY=a(VG()),OY=a(qG()),fY=a(DG()),CY=a(vG()),qY=a(_G()),NY=a(h0()),PY=a(x0()),jY=a(F$())});var r=R((OI,sG)=>{var{defineProperty:Z1,getOwnPropertyDescriptor:yY,getOwnPropertyNames:_Y}=Object,uY=Object.prototype.hasOwnProperty,pG=($,U)=>Z1($,"name",{value:U,configurable:!0}),dY=($,U)=>{for(var G in U)Z1($,G,{get:U[G],enumerable:!0})},gY=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of _Y(U))if(!uY.call($,X)&&X!==G)Z1($,X,{get:()=>U[X],enumerable:!(W=yY(U,X))||W.enumerable})}return $},pY=($)=>gY(Z1({},"__esModule",{value:!0}),$),lG={};dY(lG,{getSmithyContext:()=>lY,normalizeProvider:()=>sY});sG.exports=pY(lG);var gG=A0(),lY=pG(($)=>$[gG.SMITHY_CONTEXT_KEY]||($[gG.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),sY=pG(($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U},"normalizeProvider")});var E0=R((mG)=>{Object.defineProperty(mG,"__esModule",{value:!0});mG.getHomeDir=void 0;var mY=import.meta.require("os"),nY=import.meta.require("path"),K$={},iY=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},rY=()=>{const{HOME:$,USERPROFILE:U,HOMEPATH:G,HOMEDRIVE:W=`C:${nY.sep}`}=process.env;if($)return $;if(U)return U;if(G)return`${W}${G}`;const X=iY();if(!K$[X])K$[X]=mY.homedir();return K$[X]};mG.getHomeDir=rY});var M$=R((iG)=>{Object.defineProperty(iG,"__esModule",{value:!0});iG.getSSOTokenFilepath=void 0;var oY=import.meta.require("crypto"),aY=import.meta.require("path"),tY=E0(),eY=($)=>{const G=oY.createHash("sha1").update($).digest("hex");return aY.join(tY.getHomeDir(),".aws","sso","cache",`${G}.json`)};iG.getSSOTokenFilepath=eY});var tG=R((oG)=>{Object.defineProperty(oG,"__esModule",{value:!0});oG.getSSOTokenFromFile=void 0;var $w=import.meta.require("fs"),Uw=M$(),{readFile:Gw}=$w.promises,Ww=async($)=>{const U=Uw.getSSOTokenFilepath($),G=await Gw(U,"utf8");return JSON.parse(G)};oG.getSSOTokenFromFile=Ww});var B$=R((eG)=>{Object.defineProperty(eG,"__esModule",{value:!0});eG.slurpFile=void 0;var Xw=import.meta.require("fs"),{readFile:Zw}=Xw.promises,R$={},Lw=($,U)=>{if(!R$[$]||(U===null||U===void 0?void 0:U.ignoreCache))R$[$]=Zw($,"utf8");return R$[$]};eG.slurpFile=Lw});var E$=R((PI,c0)=>{var{defineProperty:w1,getOwnPropertyDescriptor:Yw,getOwnPropertyNames:ww}=Object,Qw=Object.prototype.hasOwnProperty,u=($,U)=>w1($,"name",{value:U,configurable:!0}),zw=($,U)=>{for(var G in U)w1($,G,{get:U[G],enumerable:!0})},V$=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of ww(U))if(!Qw.call($,X)&&X!==G)w1($,X,{get:()=>U[X],enumerable:!(W=Yw(U,X))||W.enumerable})}return $},A$=($,U,G)=>(V$($,U,"default"),G&&V$(G,U,"default")),Fw=($)=>V$(w1({},"__esModule",{value:!0}),$),v0={};zw(v0,{CONFIG_PREFIX_SEPARATOR:()=>z0,DEFAULT_PROFILE:()=>X8,ENV_PROFILE:()=>W8,getProfileName:()=>Jw,loadSharedConfigFiles:()=>L8,loadSsoSessionData:()=>Cw,parseKnownFiles:()=>Nw});c0.exports=Fw(v0);A$(v0,E0(),c0.exports);var W8="AWS_PROFILE",X8="default",Jw=u(($)=>$.profile||process.env[W8]||X8,"getProfileName");A$(v0,M$(),c0.exports);A$(v0,tG(),c0.exports);var L1=A0(),Iw=u(($)=>Object.entries($).filter(([U])=>{const G=U.indexOf(z0);if(G===-1)return!1;return Object.values(L1.IniSectionType).includes(U.substring(0,G))}).reduce((U,[G,W])=>{const X=G.indexOf(z0),Z=G.substring(0,X)===L1.IniSectionType.PROFILE?G.substring(X+1):G;return U[Z]=W,U},{...$.default&&{default:$.default}}),"getConfigData"),Y1=import.meta.require("path"),Kw=E0(),Mw="AWS_CONFIG_FILE",Z8=u(()=>process.env[Mw]||Y1.join(Kw.getHomeDir(),".aws","config"),"getConfigFilepath"),Rw=E0(),Bw="AWS_SHARED_CREDENTIALS_FILE",Vw=u(()=>process.env[Bw]||Y1.join(Rw.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),Hw=E0(),Aw=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,Ew=["__proto__","profile __proto__"],H$=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=Aw.exec(Y);if(w){const[,Q,,z]=w;if(Object.values(L1.IniSectionType).includes(Q))G=[Q,z].join(z0)}else G=Y;if(Ew.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(z0):w;U[G][z]=Q}}}}return U},"parseIni"),U8=B$(),G8=u(()=>({}),"swallowError"),z0=".",L8=u(async($={})=>{const{filepath:U=Vw(),configFilepath:G=Z8()}=$,W=Hw.getHomeDir();let Z=U;if(U.startsWith("~/"))Z=Y1.join(W,U.slice(2));let L=G;if(G.startsWith("~/"))L=Y1.join(W,G.slice(2));const Y=await Promise.all([U8.slurpFile(L,{ignoreCache:$.ignoreCache}).then(H$).then(Iw).catch(G8),U8.slurpFile(Z,{ignoreCache:$.ignoreCache}).then(H$).catch(G8)]);return{configFile:Y[0],credentialsFile:Y[1]}},"loadSharedConfigFiles"),Tw=u(($)=>Object.entries($).filter(([U])=>U.startsWith(L1.IniSectionType.SSO_SESSION+z0)).reduce((U,[G,W])=>({...U,[G.substring(G.indexOf(z0)+1)]:W}),{}),"getSsoSessionData"),Ow=B$(),fw=u(()=>({}),"swallowError"),Cw=u(async($={})=>Ow.slurpFile($.configFilepath??Z8()).then(H$).then(Tw).catch(fw),"loadSsoSessionData"),qw=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"),Nw=u(async($)=>{const U=await L8($);return qw(U.configFile,U.credentialsFile)},"parseKnownFiles")});var z8=R((jI,Q8)=>{function O$($){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:Q1,getOwnPropertyDescriptor:Pw,getOwnPropertyNames:jw}=Object,Sw=Object.prototype.hasOwnProperty,T0=($,U)=>Q1($,"name",{value:U,configurable:!0}),kw=($,U)=>{for(var G in U)Q1($,G,{get:U[G],enumerable:!0})},bw=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of jw(U))if(!Sw.call($,X)&&X!==G)Q1($,X,{get:()=>U[X],enumerable:!(W=Pw(U,X))||W.enumerable})}return $},Dw=($)=>bw(Q1({},"__esModule",{value:!0}),$),w8={};kw(w8,{loadConfig:()=>yw});Q8.exports=Dw(w8);var y0=T$();T0(O$,"getSelectorName");var hw=T0(($,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: ${O$($.toString())}`,{logger:U})}},"fromEnv"),Y8=E$(),xw=T0(($,{preferredFile:U="config",...G}={})=>async()=>{const W=Y8.getProfileName(G),{configFile:X,credentialsFile:Z}=await Y8.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}]: ${O$($.toString())}`,{logger:G.logger})}},"fromSharedConfigFiles"),vw=T0(($)=>typeof $==="function","isFunction"),cw=T0(($)=>vw($)?async()=>await $():y0.fromStatic($),"fromStatic"),yw=T0(({environmentVariableSelector:$,configFileSelector:U,default:G},W={})=>y0.memoize(y0.chain(hw($),xw(U,W),cw(G))),"loadConfig")});var R8=R((K8)=>{Object.defineProperty(K8,"__esModule",{value:!0});K8.getEndpointUrlConfig=void 0;var F8=E$(),J8="AWS_ENDPOINT_URL",I8="endpoint_url",_w=($)=>({environmentVariableSelector:(U)=>{const G=$.split(" ").map((Z)=>Z.toUpperCase()),W=U[[J8,...G].join("_")];if(W)return W;const X=U[J8];if(X)return X;return},configFileSelector:(U,G)=>{if(G&&U.services){const X=G[["services",U.services].join(F8.CONFIG_PREFIX_SEPARATOR)];if(X){const Z=$.split(" ").map((Y)=>Y.toLowerCase()),L=X[[Z.join("_"),I8].join(F8.CONFIG_PREFIX_SEPARATOR)];if(L)return L}}const W=U[I8];if(W)return W;return},default:void 0});K8.getEndpointUrlConfig=_w});var f$=R((B8)=>{Object.defineProperty(B8,"__esModule",{value:!0});B8.getEndpointFromConfig=void 0;var uw=z8(),dw=R8(),gw=async($)=>uw.loadConfig(dw.getEndpointUrlConfig($!==null&&$!==void 0?$:""))();B8.getEndpointFromConfig=gw});var q$=R((bI,C8)=>{function f8($,U,G){return{applyToStack:(W)=>{W.add(A8($,G),T8),W.add(E8($,U),O8)}}}var{defineProperty:z1,getOwnPropertyDescriptor:pw,getOwnPropertyNames:lw}=Object,sw=Object.prototype.hasOwnProperty,C$=($,U)=>z1($,"name",{value:U,configurable:!0}),mw=($,U)=>{for(var G in U)z1($,G,{get:U[G],enumerable:!0})},nw=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of lw(U))if(!sw.call($,X)&&X!==G)z1($,X,{get:()=>U[X],enumerable:!(W=pw(U,X))||W.enumerable})}return $},iw=($)=>nw(z1({},"__esModule",{value:!0}),$),H8={};mw(H8,{deserializerMiddleware:()=>A8,deserializerMiddlewareOption:()=>T8,getSerdePlugin:()=>f8,serializerMiddleware:()=>E8,serializerMiddlewareOption:()=>O8});C8.exports=iw(H8);var A8=C$(($,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"),E8=C$(($,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"),T8={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},O8={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};C$(f8,"getSerdePlugin")});var h8=R((DI,D8)=>{var{defineProperty:J1,getOwnPropertyDescriptor:rw,getOwnPropertyNames:ow}=Object,aw=Object.prototype.hasOwnProperty,m=($,U)=>J1($,"name",{value:U,configurable:!0}),tw=($,U)=>{for(var G in U)J1($,G,{get:U[G],enumerable:!0})},ew=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of ow(U))if(!aw.call($,X)&&X!==G)J1($,X,{get:()=>U[X],enumerable:!(W=rw(U,X))||W.enumerable})}return $},$2=($)=>ew(J1({},"__esModule",{value:!0}),$),P8={};tw(P8,{endpointMiddleware:()=>k8,endpointMiddlewareOptions:()=>b8,getEndpointFromInstructions:()=>j8,getEndpointPlugin:()=>z2,resolveEndpointConfig:()=>J2,resolveParams:()=>S8,toEndpointV1:()=>N$});D8.exports=$2(P8);var U2=m(async($)=>{const U=($==null?void 0:$.Bucket)||"";if(typeof $.Bucket==="string")$.Bucket=U.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(L2(U)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!Z2(U)||U.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||U.toLowerCase()!==U||U.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},"resolveParamsForS3"),G2=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,W2=/(\d+\.){3}\d+/,X2=/\.\./,Z2=m(($)=>G2.test($)&&!W2.test($)&&!X2.test($),"isDnsCompatibleBucketName"),L2=m(($)=>{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"),Y2=m(($,U,G)=>{const W=m(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"),w2=f$(),q8=N8(),N$=m(($)=>{if(typeof $==="object"){if("url"in $)return q8.parseUrl($.url);return $}return q8.parseUrl($)},"toEndpointV1"),j8=m(async($,U,G,W)=>{if(!G.endpoint){let L;if(G.serviceConfiguredEndpoint)L=await G.serviceConfiguredEndpoint();else L=await w2.getEndpointFromConfig(G.serviceId);if(L)G.endpoint=()=>Promise.resolve(N$(L))}const X=await S8($,U,G);if(typeof G.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return G.endpointProvider(X,W)},"getEndpointFromInstructions"),S8=m(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 Y2(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 U2(X);return X},"resolveParams"),F1=r(),k8=m(({config:$,instructions:U})=>{return(G,W)=>async(X)=>{var Z,L,Y;const w=await j8(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=F1.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"),Q2=q$(),b8={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Q2.serializerMiddlewareOption.name},z2=m(($,U)=>({applyToStack:(G)=>{G.addRelativeTo(k8({config:$,instructions:U}),b8)}}),"getEndpointPlugin"),F2=f$(),J2=m(($)=>{const U=$.tls??!0,{endpoint:G}=$,W=G!=null?async()=>N$(await F1.normalizeProvider(G)()):void 0,Z={...$,endpoint:W,tls:U,isCustomEndpoint:!!G,useDualstackEndpoint:F1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:F1.normalizeProvider($.useFipsEndpoint??!1)};let L=void 0;return Z.serviceConfiguredEndpoint=async()=>{if($.serviceId&&!L)L=F2.getEndpointFromConfig($.serviceId);return L},Z},"resolveEndpointConfig")});var t=R((hI,p8)=>{function u8($){return Object.keys($).reduce((U,G)=>{const W=$[G];return{...U,[G]:Array.isArray(W)?[...W]:W}},{})}function g8($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)}var{defineProperty:I1,getOwnPropertyDescriptor:I2,getOwnPropertyNames:K2}=Object,M2=Object.prototype.hasOwnProperty,U0=($,U)=>I1($,"name",{value:U,configurable:!0}),R2=($,U)=>{for(var G in U)I1($,G,{get:U[G],enumerable:!0})},B2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of K2(U))if(!M2.call($,X)&&X!==G)I1($,X,{get:()=>U[X],enumerable:!(W=I2(U,X))||W.enumerable})}return $},V2=($)=>B2(I1({},"__esModule",{value:!0}),$),x8={};R2(x8,{Field:()=>E2,Fields:()=>T2,HttpRequest:()=>O2,HttpResponse:()=>f2,IHttpRequest:()=>v8.HttpRequest,getHttpHandlerExtensionConfiguration:()=>H2,isValidHostname:()=>g8,resolveHttpHandlerRuntimeConfig:()=>A2});p8.exports=V2(x8);var H2=U0(($)=>{let U=$.httpHandler;return{setHttpHandler(G){U=G},httpHandler(){return U},updateHttpClientConfig(G,W){U.updateHttpClientConfig(G,W)},httpHandlerConfigs(){return U.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),A2=U0(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),v8=A0(),c8=class ${constructor({name:U,kind:G=v8.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}};U0(c8,"Field");var E2=c8,y8=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)}};U0(y8,"Fields");var T2=y8,_8=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=u8(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)}};U0(_8,"HttpRequest");var O2=_8;U0(u8,"cloneQuery");var d8=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"}};U0(d8,"HttpResponse");var f2=d8;U0(g8,"isValidHostname")});var F0=R((xI,n8)=>{var{defineProperty:K1,getOwnPropertyDescriptor:C2,getOwnPropertyNames:q2}=Object,N2=Object.prototype.hasOwnProperty,O0=($,U)=>K1($,"name",{value:U,configurable:!0}),P2=($,U)=>{for(var G in U)K1($,G,{get:U[G],enumerable:!0})},j2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of q2(U))if(!N2.call($,X)&&X!==G)K1($,X,{get:()=>U[X],enumerable:!(W=C2(U,X))||W.enumerable})}return $},S2=($)=>j2(K1({},"__esModule",{value:!0}),$),l8={};P2(l8,{isClockSkewCorrectedError:()=>s8,isClockSkewError:()=>c2,isRetryableByTrait:()=>v2,isServerError:()=>_2,isThrottlingError:()=>y2,isTransientError:()=>m8});n8.exports=S2(l8);var k2=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],b2=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],D2=["TimeoutError","RequestTimeout","RequestTimeoutException"],h2=[500,502,503,504],x2=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],v2=O0(($)=>$.$retryable!==void 0,"isRetryableByTrait"),c2=O0(($)=>k2.includes($.name),"isClockSkewError"),s8=O0(($)=>{var U;return(U=$.$metadata)==null?void 0:U.clockSkewCorrected},"isClockSkewCorrectedError"),y2=O0(($)=>{var U,G;return((U=$.$metadata)==null?void 0:U.httpStatusCode)===429||b2.includes($.name)||((G=$.$retryable)==null?void 0:G.throttling)==!0},"isThrottlingError"),m8=O0(($)=>{var U;return s8($)||D2.includes($.name)||x2.includes(($==null?void 0:$.code)||"")||h2.includes(((U=$.$metadata)==null?void 0:U.httpStatusCode)||0)},"isTransientError"),_2=O0(($)=>{var U;if(((U=$.$metadata)==null?void 0:U.httpStatusCode)!==void 0){const G=$.$metadata.httpStatusCode;if(500<=G&&G<=599&&!m8($))return!0;return!1}return!1},"isServerError")});var Y4=R((vI,L4)=>{var{defineProperty:M1,getOwnPropertyDescriptor:u2,getOwnPropertyNames:d2}=Object,g2=Object.prototype.hasOwnProperty,n=($,U)=>M1($,"name",{value:U,configurable:!0}),p2=($,U)=>{for(var G in U)M1($,G,{get:U[G],enumerable:!0})},l2=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of d2(U))if(!g2.call($,X)&&X!==G)M1($,X,{get:()=>U[X],enumerable:!(W=u2(U,X))||W.enumerable})}return $},s2=($)=>l2(M1({},"__esModule",{value:!0}),$),r8={};p2(r8,{AdaptiveRetryStrategy:()=>a2,ConfiguredRetryStrategy:()=>t2,DEFAULT_MAX_ATTEMPTS:()=>P$,DEFAULT_RETRY_DELAY_BASE:()=>_0,DEFAULT_RETRY_MODE:()=>m2,DefaultRateLimiter:()=>t8,INITIAL_RETRY_TOKENS:()=>j$,INVOCATION_ID_HEADER:()=>i2,MAXIMUM_RETRY_DELAY:()=>S$,NO_RETRY_INCREMENT:()=>G4,REQUEST_HEADER:()=>r2,RETRY_COST:()=>$4,RETRY_MODES:()=>o8,StandardRetryStrategy:()=>k$,THROTTLING_RETRY_DELAY_BASE:()=>e8,TIMEOUT_RETRY_COST:()=>U4});L4.exports=s2(r8);var o8=(($)=>{return $.STANDARD="standard",$.ADAPTIVE="adaptive",$})(o8||{}),P$=3,m2="standard",n2=F0(),a8=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(),n2.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))}};n(a8,"DefaultRateLimiter");var t8=a8,_0=100,S$=20000,e8=500,j$=500,$4=5,U4=10,G4=1,i2="amz-sdk-invocation-id",r2="amz-sdk-request",o2=n(()=>{let $=_0;return{computeNextBackoffDelay:n((W)=>{return Math.floor(Math.min(S$,Math.random()*2**W*$))},"computeNextBackoffDelay"),setDelayBase:n((W)=>{$=W},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),i8=n(({retryDelay:$,retryCount:U,retryCost:G})=>{return{getRetryCount:n(()=>U,"getRetryCount"),getRetryDelay:n(()=>Math.min(S$,$),"getRetryDelay"),getRetryCost:n(()=>G,"getRetryCost")}},"createDefaultRetryToken"),W4=class ${constructor(U){this.maxAttempts=U,this.mode="standard",this.capacity=j$,this.retryBackoffStrategy=o2(),this.maxAttemptsProvider=typeof U==="function"?U:async()=>U}async acquireInitialRetryToken(U){return i8({retryDelay:_0,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"?e8:_0);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,i8({retryDelay:L,retryCount:U.getRetryCount()+1,retryCost:Y})}throw new Error("No retry token available")}recordSuccess(U){this.capacity=Math.max(j$,this.capacity+(U.getRetryCost()??G4))}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 ${P$}`),P$}}shouldRetry(U,G,W){return U.getRetryCount()+1<W&&this.capacity>=this.getCapacityCost(G.errorType)&&this.isRetryableError(G.errorType)}getCapacityCost(U){return U==="TRANSIENT"?U4:$4}isRetryableError(U){return U==="THROTTLING"||U==="TRANSIENT"}};n(W4,"StandardRetryStrategy");var k$=W4,X4=class ${constructor(U,G){this.maxAttemptsProvider=U,this.mode="adaptive";const{rateLimiter:W}=G??{};this.rateLimiter=W??new t8,this.standardRetryStrategy=new k$(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)}};n(X4,"AdaptiveRetryStrategy");var a2=X4,Z4=class $ extends k${constructor(U,G=_0){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}};n(Z4,"ConfiguredRetryStrategy");var t2=Z4});var J4=R((cI,F4)=>{var{defineProperty:R1,getOwnPropertyDescriptor:e2,getOwnPropertyNames:$5}=Object,U5=Object.prototype.hasOwnProperty,d=($,U)=>R1($,"name",{value:U,configurable:!0}),G5=($,U)=>{for(var G in U)R1($,G,{get:U[G],enumerable:!0})},W5=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of $5(U))if(!U5.call($,X)&&X!==G)R1($,X,{get:()=>U[X],enumerable:!(W=e2(U,X))||W.enumerable})}return $},X5=($)=>W5(R1({},"__esModule",{value:!0}),$),z4={};G5(z4,{constructStack:()=>b$});F4.exports=X5(z4);var J0=d(($,U)=>{const G=[];if($)G.push($);if(U)for(let W of U)G.push(W);return G},"getAllAliases"),G0=d(($,U)=>{return`${$||"anonymous"}${U&&U.length>0?` (a.k.a. ${U.join(",")})`:""}`},"getMiddlewareNameWithAliases"),b$=d(()=>{let $=[],U=[],G=!1;const W=new Set,X=d((F)=>F.sort((J,I)=>w4[I.step]-w4[J.step]||Q4[I.priority||"normal"]-Q4[J.priority||"normal"]),"sort"),Z=d((F)=>{let J=!1;const I=d((K)=>{const V=J0(K.name,K.aliases);if(V.includes(F)){J=!0;for(let B of V)W.delete(B);return!1}return!0},"filterCb");return $=$.filter(I),U=U.filter(I),J},"removeByName"),L=d((F)=>{let J=!1;const I=d((K)=>{if(K.middleware===F){J=!0;for(let V of J0(K.name,K.aliases))W.delete(V);return!1}return!0},"filterCb");return $=$.filter(I),U=U.filter(I),J},"removeByReference"),Y=d((F)=>{var J;return $.forEach((I)=>{F.add(I.middleware,{...I})}),U.forEach((I)=>{F.addRelativeTo(I.middleware,{...I})}),(J=F.identifyOnResolve)==null||J.call(F,z.identifyOnResolve()),F},"cloneTo"),w=d((F)=>{const J=[];return F.before.forEach((I)=>{if(I.before.length===0&&I.after.length===0)J.push(I);else J.push(...w(I))}),J.push(F),F.after.reverse().forEach((I)=>{if(I.before.length===0&&I.after.length===0)J.push(I);else J.push(...w(I))}),J},"expandRelativeMiddlewareList"),Q=d((F=!1)=>{const J=[],I=[],K={};return $.forEach((B)=>{const H={...B,before:[],after:[]};for(let A of J0(H.name,H.aliases))K[A]=H;J.push(H)}),U.forEach((B)=>{const H={...B,before:[],after:[]};for(let A of J0(H.name,H.aliases))K[A]=H;I.push(H)}),I.forEach((B)=>{if(B.toMiddleware){const H=K[B.toMiddleware];if(H===void 0){if(F)return;throw new Error(`${B.toMiddleware} is not found when adding ${G0(B.name,B.aliases)} middleware ${B.relation} ${B.toMiddleware}`)}if(B.relation==="after")H.after.push(B);if(B.relation==="before")H.before.push(B)}}),X(J).map(w).reduce((B,H)=>{return B.push(...H),B},[])},"getMiddlewareList"),z={add:(F,J={})=>{const{name:I,override:K,aliases:V}=J,B={step:"initialize",priority:"normal",middleware:F,...J},H=J0(I,V);if(H.length>0){if(H.some((A)=>W.has(A))){if(!K)throw new Error(`Duplicate middleware name '${G0(I,V)}'`);for(let A of H){const E=$.findIndex((S)=>{var h;return S.name===A||((h=S.aliases)==null?void 0:h.some((Q0)=>Q0===A))});if(E===-1)continue;const T=$[E];if(T.step!==B.step||B.priority!==T.priority)throw new Error(`"${G0(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${G0(I,V)}" middleware with ${B.priority} priority in ${B.step} step.`);$.splice(E,1)}}for(let A of H)W.add(A)}$.push(B)},addRelativeTo:(F,J)=>{const{name:I,override:K,aliases:V}=J,B={middleware:F,...J},H=J0(I,V);if(H.length>0){if(H.some((A)=>W.has(A))){if(!K)throw new Error(`Duplicate middleware name '${G0(I,V)}'`);for(let A of H){const E=U.findIndex((S)=>{var h;return S.name===A||((h=S.aliases)==null?void 0:h.some((Q0)=>Q0===A))});if(E===-1)continue;const T=U[E];if(T.toMiddleware!==B.toMiddleware||T.relation!==B.relation)throw new Error(`"${G0(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${G0(I,V)}" middleware ${B.relation} "${B.toMiddleware}" middleware.`);U.splice(E,1)}}for(let A of H)W.add(A)}U.push(B)},clone:()=>Y(b$()),use:(F)=>{F.applyToStack(z)},remove:(F)=>{if(typeof F==="string")return Z(F);else return L(F)},removeByTag:(F)=>{let J=!1;const I=d((K)=>{const{tags:V,name:B,aliases:H}=K;if(V&&V.includes(F)){const A=J0(B,H);for(let E of A)W.delete(E);return J=!0,!1}return!0},"filterCb");return $=$.filter(I),U=U.filter(I),J},concat:(F)=>{var J;const I=Y(b$());return I.use(F),I.identifyOnResolve(G||I.identifyOnResolve()||(((J=F.identifyOnResolve)==null?void 0:J.call(F))??!1)),I},applyToStack:Y,identify:()=>{return Q(!0).map((F)=>{const J=F.step??F.relation+" "+F.toMiddleware;return G0(F.name,F.aliases)+" - "+J})},identifyOnResolve(F){if(typeof F==="boolean")G=F;return G},resolve:(F,J)=>{for(let I of Q().map((K)=>K.middleware).reverse())F=I(F,J);if(G)console.log(z.identify());return F}};return z},"constructStack"),w4={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Q4={high:3,normal:2,low:1}});var D$=R((yI,K4)=>{var{defineProperty:B1,getOwnPropertyDescriptor:Z5,getOwnPropertyNames:L5}=Object,Y5=Object.prototype.hasOwnProperty,w5=($,U)=>B1($,"name",{value:U,configurable:!0}),Q5=($,U)=>{for(var G in U)B1($,G,{get:U[G],enumerable:!0})},z5=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of L5(U))if(!Y5.call($,X)&&X!==G)B1($,X,{get:()=>U[X],enumerable:!(W=Z5(U,X))||W.enumerable})}return $},F5=($)=>z5(B1({},"__esModule",{value:!0}),$),I4={};Q5(I4,{isArrayBuffer:()=>J5});K4.exports=F5(I4);var J5=w5(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var u0=R((_I,B4)=>{var{defineProperty:V1,getOwnPropertyDescriptor:I5,getOwnPropertyNames:K5}=Object,M5=Object.prototype.hasOwnProperty,M4=($,U)=>V1($,"name",{value:U,configurable:!0}),R5=($,U)=>{for(var G in U)V1($,G,{get:U[G],enumerable:!0})},B5=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of K5(U))if(!M5.call($,X)&&X!==G)V1($,X,{get:()=>U[X],enumerable:!(W=I5(U,X))||W.enumerable})}return $},V5=($)=>B5(V1({},"__esModule",{value:!0}),$),R4={};R5(R4,{fromArrayBuffer:()=>A5,fromString:()=>E5});B4.exports=V5(R4);var H5=D$(),h$=import.meta.require("buffer"),A5=M4(($,U=0,G=$.byteLength-U)=>{if(!H5.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return h$.Buffer.from($,U,G)},"fromArrayBuffer"),E5=M4(($,U)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return U?h$.Buffer.from($,U):h$.Buffer.from($)},"fromString")});var A4=R((V4)=>{Object.defineProperty(V4,"__esModule",{value:!0});V4.fromBase64=void 0;var T5=u0(),O5=/^[A-Za-z0-9+/]*={0,2}$/,f5=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!O5.exec($))throw new TypeError("Invalid base64 string.");const U=T5.fromString($,"base64");return new Uint8Array(U.buffer,U.byteOffset,U.byteLength)};V4.fromBase64=f5});var W0=R((dI,f4)=>{var{defineProperty:H1,getOwnPropertyDescriptor:C5,getOwnPropertyNames:q5}=Object,N5=Object.prototype.hasOwnProperty,x$=($,U)=>H1($,"name",{value:U,configurable:!0}),P5=($,U)=>{for(var G in U)H1($,G,{get:U[G],enumerable:!0})},j5=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of q5(U))if(!N5.call($,X)&&X!==G)H1($,X,{get:()=>U[X],enumerable:!(W=C5(U,X))||W.enumerable})}return $},S5=($)=>j5(H1({},"__esModule",{value:!0}),$),E4={};P5(E4,{fromUtf8:()=>O4,toUint8Array:()=>k5,toUtf8:()=>b5});f4.exports=S5(E4);var T4=u0(),O4=x$(($)=>{const U=T4.fromString($,"utf8");return new Uint8Array(U.buffer,U.byteOffset,U.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),k5=x$(($)=>{if(typeof $==="string")return O4($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),b5=x$(($)=>{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 T4.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var N4=R((C4)=>{Object.defineProperty(C4,"__esModule",{value:!0});C4.toBase64=void 0;var D5=u0(),h5=W0(),x5=($)=>{let U;if(typeof $==="string")U=h5.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 D5.fromArrayBuffer(U.buffer,U.byteOffset,U.byteLength).toString("base64")};C4.toBase64=x5});var E1=R((pI,A1)=>{var{defineProperty:P4,getOwnPropertyDescriptor:v5,getOwnPropertyNames:c5}=Object,y5=Object.prototype.hasOwnProperty,v$=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of c5(U))if(!y5.call($,X)&&X!==G)P4($,X,{get:()=>U[X],enumerable:!(W=v5(U,X))||W.enumerable})}return $},j4=($,U,G)=>(v$($,U,"default"),G&&v$(G,U,"default")),_5=($)=>v$(P4({},"__esModule",{value:!0}),$),c$={};A1.exports=_5(c$);j4(c$,A4(),A1.exports);j4(c$,N4(),A1.exports)});var b4=R((S4)=>{Object.defineProperty(S4,"__esModule",{value:!0});S4.getAwsChunkedEncodingStream=void 0;var u5=import.meta.require("stream"),d5=($,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 u5.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};S4.getAwsChunkedEncodingStream=d5});var _$=R((sI,v4)=>{function x4($){const U=[];for(let G of Object.keys($).sort()){const W=$[G];if(G=y$.escapeUri(G),Array.isArray(W))for(let X=0,Z=W.length;X<Z;X++)U.push(`${G}=${y$.escapeUri(W[X])}`);else{let X=G;if(W||typeof W==="string")X+=`=${y$.escapeUri(W)}`;U.push(X)}}return U.join("&")}var{defineProperty:T1,getOwnPropertyDescriptor:g5,getOwnPropertyNames:p5}=Object,l5=Object.prototype.hasOwnProperty,s5=($,U)=>T1($,"name",{value:U,configurable:!0}),m5=($,U)=>{for(var G in U)T1($,G,{get:U[G],enumerable:!0})},n5=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of p5(U))if(!l5.call($,X)&&X!==G)T1($,X,{get:()=>U[X],enumerable:!(W=g5(U,X))||W.enumerable})}return $},i5=($)=>n5(T1({},"__esModule",{value:!0}),$),h4={};m5(h4,{buildQueryString:()=>x4});v4.exports=i5(h4);var y$=D4();s5(x4,"buildQueryString")});var U6=R((mI,$6)=>{async function g$($,U,G=_4){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(_4,G)))}),new Promise((Y)=>{$.on("continue",()=>{clearTimeout(Z),Y()}),$.on("error",()=>{L=!0,clearTimeout(Z),Y()})})]);if(!L)n4($,U.body)}function n4($,U){if(U instanceof m4.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 e4($){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:r5,defineProperty:d0,getOwnPropertyDescriptor:o5,getOwnPropertyNames:a5,getPrototypeOf:t5}=Object,e5=Object.prototype.hasOwnProperty,O=($,U)=>d0($,"name",{value:U,configurable:!0}),$9=($,U)=>{for(var G in U)d0($,G,{get:U[G],enumerable:!0})},d4=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of a5(U))if(!e5.call($,X)&&X!==G)d0($,X,{get:()=>U[X],enumerable:!(W=o5(U,X))||W.enumerable})}return $},U9=($,U,G)=>(G=$!=null?r5(t5($)):{},d4(U||!$||!$.__esModule?d0(G,"default",{value:$,enumerable:!0}):G,$)),G9=($)=>d4(d0({},"__esModule",{value:!0}),$),g4={};$9(g4,{DEFAULT_REQUEST_TIMEOUT:()=>w9,NodeHttp2Handler:()=>I9,NodeHttpHandler:()=>Q9,streamCollector:()=>M9});$6.exports=G9(g4);var p4=t(),l4=_$(),u$=import.meta.require("http"),d$=import.meta.require("https"),W9=["ECONNRESET","EPIPE","ETIMEDOUT"],s4=O(($)=>{const U={};for(let G of Object.keys($)){const W=$[G];U[G]=Array.isArray(W)?W.join(","):W}return U},"getTransformedHeaders"),c4=1000,X9=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,c4),c4)},"setConnectionTimeout"),Z9=3000,L9=O(($,{keepAlive:U,keepAliveMsecs:G},W=Z9)=>{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"),y4=3000,Y9=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:y4),y4)},"setSocketTimeout"),m4=import.meta.require("stream"),_4=1000;O(g$,"writeRequestBody");O(n4,"writeBody");var w9=0,i4=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 J=((X=Y[F])==null?void 0:X.length)??0,I=((Z=w[F])==null?void 0:Z.length)??0;if(J>=Q&&I>=2*Q)return(L=W==null?void 0:W.warn)==null||L.call(W,`@smithy/node-http-handler:WARN - socket usage at capacity=${J} and ${I} 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 u$.Agent||typeof(Z==null?void 0:Z.destroy)==="function")return Z;return new u$.Agent({keepAlive:!0,maxSockets:50,...Z})})(),httpsAgent:(()=>{if(L instanceof d$.Agent||typeof(L==null?void 0:L.destroy)==="function")return L;return new d$.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(E)=>{await Z,L.forEach(clearTimeout),W(E)},"resolve"),w=O(async(E)=>{await Z,L.forEach(clearTimeout),X(E)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(G==null?void 0:G.aborted){const E=new Error("Request aborted");E.name="AbortError",w(E);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=l4.buildQueryString(U.query||{});let J=void 0;if(U.username!=null||U.password!=null){const E=U.username??"",T=U.password??"";J=`${E}:${T}`}let I=U.path;if(F)I+=`?${F}`;if(U.fragment)I+=`#${U.fragment}`;let K=U.hostname??"";if(K[0]==="["&&K.endsWith("]"))K=U.hostname.slice(1,-1);else K=U.hostname;const V={headers:U.headers,host:K,method:U.method,path:I,port:U.port,agent:z,auth:J},H=(Q?d$.request:u$.request)(V,(E)=>{const T=new p4.HttpResponse({statusCode:E.statusCode||-1,reason:E.statusMessage,headers:s4(E.headers),body:E});Y({response:T})});if(H.on("error",(E)=>{if(W9.includes(E.code))w(Object.assign(E,{name:"TimeoutError"}));else w(E)}),G){const E=O(()=>{H.destroy();const T=new Error("Request aborted");T.name="AbortError",w(T)},"onAbort");if(typeof G.addEventListener==="function"){const T=G;T.addEventListener("abort",E,{once:!0}),H.once("close",()=>T.removeEventListener("abort",E))}else G.onabort=E}L.push(X9(H,w,this.config.connectionTimeout)),L.push(Y9(H,w,this.config.requestTimeout));const A=V.agent;if(typeof A==="object"&&"keepAlive"in A)L.push(L9(H,{keepAlive:A.keepAlive,keepAliveMsecs:A.keepAliveMsecs}));Z=g$(H,U,this.config.requestTimeout).catch((E)=>{return L.forEach(clearTimeout),X(E)})})}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((W)=>{return{...W,[U]:G}})}httpHandlerConfigs(){return this.config??{}}};O(i4,"NodeHttpHandler");var Q9=i4,u4=import.meta.require("http2"),z9=U9(import.meta.require("http2")),r4=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(r4,"NodeHttp2ConnectionPool");var F9=r4,o4=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=z9.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 F9;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(o4,"NodeHttp2ConnectionManager");var J9=o4,a4=class ${constructor(U){this.metadata={handlerProtocol:"h2"},this.connectionManager=new J9({}),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:J,method:I,port:K,protocol:V,query:B}=U;let H="";if(U.username!=null||U.password!=null){const N=U.username??"",l=U.password??"";H=`${N}:${l}@`}const A=`${V}//${H}${J}${K?`:${K}`:""}`,E={destination:new URL(A)},T=this.connectionManager.lease(E,{requestTimeout:(Y=this.config)==null?void 0:Y.sessionTimeout,disableConcurrentStreams:X||!1}),S=O((N)=>{if(X)this.destroySession(T);w=!0,F(N)},"rejectWithDestroy"),h=l4.buildQueryString(B||{});let Q0=U.path;if(h)Q0+=`?${h}`;if(U.fragment)Q0+=`#${U.fragment}`;const y=T.request({...U.headers,[u4.constants.HTTP2_HEADER_PATH]:Q0,[u4.constants.HTTP2_HEADER_METHOD]:I});if(T.ref(),y.on("response",(N)=>{const l=new p4.HttpResponse({statusCode:N[":status"]||-1,headers:s4(N),body:y});if(w=!0,z({response:l}),X)T.close(),this.connectionManager.deleteSession(A,T)}),W)y.setTimeout(W,()=>{y.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(()=>{y.close();const l=new Error("Request aborted");l.name="AbortError",S(l)},"onAbort");if(typeof G.addEventListener==="function"){const l=G;l.addEventListener("abort",N,{once:!0}),y.once("close",()=>l.removeEventListener("abort",N))}else G.onabort=N}y.on("frameError",(N,l,RL)=>{S(new Error(`Frame type id ${N} in stream id ${RL} has failed with code ${l}.`))}),y.on("error",S),y.on("aborted",()=>{S(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${y.rstCode}.`))}),y.on("close",()=>{if(T.unref(),X)T.destroy();if(!w)S(new Error("Unexpected error: http2 request did not get a response"))}),Q=g$(y,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(a4,"NodeHttp2Handler");var I9=a4,t4=class $ extends m4.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(U,G,W){this.bufferedBytes.push(U),W()}};O(t4,"Collector");var K9=t4,M9=O(($)=>{if(R9($))return e4($);return new Promise((U,G)=>{const W=new K9;$.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"),R9=O(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");O(e4,"collectReadableStream")});var z6=R((nI,Q6)=>{function X6($=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 L6($){const U=await w6($),G=C9.fromBase64(U);return new Uint8Array(G)}async function Y6($){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 w6($){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:f1,getOwnPropertyDescriptor:B9,getOwnPropertyNames:V9}=Object,H9=Object.prototype.hasOwnProperty,e=($,U)=>f1($,"name",{value:U,configurable:!0}),A9=($,U)=>{for(var G in U)f1($,G,{get:U[G],enumerable:!0})},E9=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of V9(U))if(!H9.call($,X)&&X!==G)f1($,X,{get:()=>U[X],enumerable:!(W=B9(U,X))||W.enumerable})}return $},T9=($)=>E9(f1({},"__esModule",{value:!0}),$),W6={};A9(W6,{FetchHttpHandler:()=>f9,keepAliveSupport:()=>O1,streamCollector:()=>q9});Q6.exports=T9(W6);var G6=t(),O9=_$();e(X6,"requestTimeout");var O1={supported:void 0},Z6=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(O1.supported===void 0)O1.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 A=new Error("Request aborted");return A.name="AbortError",Promise.reject(A)}let Y=U.path;const w=O9.buildQueryString(U.query||{});if(w)Y+=`?${w}`;if(U.fragment)Y+=`#${U.fragment}`;let Q="";if(U.username!=null||U.password!=null){const A=U.username??"",E=U.password??"";Q=`${A}:${E}@`}const{port:z,method:F}=U,J=`${U.protocol}//${Q}${U.hostname}${z?`:${z}`:""}${Y}`,I=F==="GET"||F==="HEAD"?void 0:U.body,K={body:I,headers:new Headers(U.headers),method:F,credentials:L};if((W=this.config)==null?void 0:W.cache)K.cache=this.config.cache;if(I)K.duplex="half";if(typeof AbortController!=="undefined")K.signal=G;if(O1.supported)K.keepalive=Z;if(typeof this.config.requestInit==="function")Object.assign(K,this.config.requestInit(U));let V=e(()=>{},"removeSignalEventListener");const B=new Request(J,K),H=[fetch(B).then((A)=>{const E=A.headers,T={};for(let h of E.entries())T[h[0]]=h[1];if(A.body==null)return A.blob().then((h)=>({response:new G6.HttpResponse({headers:T,reason:A.statusText,statusCode:A.status,body:h})}));return{response:new G6.HttpResponse({headers:T,reason:A.statusText,statusCode:A.status,body:A.body})}}),X6(X)];if(G)H.push(new Promise((A,E)=>{const T=e(()=>{const S=new Error("Request aborted");S.name="AbortError",E(S)},"onAbort");if(typeof G.addEventListener==="function"){const S=G;S.addEventListener("abort",T,{once:!0}),V=e(()=>S.removeEventListener("abort",T),"removeSignalEventListener")}else G.onabort=T}));return Promise.race(H).finally(V)}updateHttpClientConfig(U,G){this.config=void 0,this.configProvider=this.configProvider.then((W)=>{return W[U]=G,W})}httpHandlerConfigs(){return this.config??{}}};e(Z6,"FetchHttpHandler");var f9=Z6,C9=E1(),q9=e(($)=>{if(typeof Blob==="function"&&$ instanceof Blob)return L6($);return Y6($)},"streamCollector");e(L6,"collectBlob");e(Y6,"collectStream");e(w6,"readToBase64")});var g0=R((F6)=>{Object.defineProperty(F6,"__esModule",{value:!0});F6.isReadableStream=void 0;var N9=($)=>{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)};F6.isReadableStream=N9});var H6=R((B6)=>{Object.defineProperty(B6,"__esModule",{value:!0});B6.sdkStreamMixin=void 0;var P9=z6(),j9=E1(),S9=R6(),k9=W0(),I6=g0(),K6="The stream has already been transformed.",b9=($)=>{var U,G;if(!M6($)&&!I6.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(K6);return W=!0,await P9.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 j9.toBase64(Y);else if(L==="hex")return S9.toHex(Y);else if(L===void 0||L==="utf8"||L==="utf-8")return k9.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(K6);if(W=!0,M6($))return Z($);else if(I6.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};B6.sdkStreamMixin=b9;var M6=($)=>typeof Blob==="function"&&$ instanceof Blob});var O6=R((E6)=>{Object.defineProperty(E6,"__esModule",{value:!0});E6.sdkStreamMixin=void 0;var D9=U6(),h9=u0(),p$=import.meta.require("stream"),x9=import.meta.require("util"),v9=H6(),A6="The stream has already been transformed.",c9=($)=>{var U,G;if(!($ instanceof p$.Readable))try{return v9.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(A6);return W=!0,await D9.streamCollector($)};return Object.assign($,{transformToByteArray:X,transformToString:async(Z)=>{const L=await X();if(Z===void 0||Buffer.isEncoding(Z))return h9.fromArrayBuffer(L.buffer,L.byteOffset,L.byteLength).toString(Z);else return new x9.TextDecoder(Z).decode(L)},transformToWebStream:()=>{if(W)throw new Error(A6);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof p$.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,p$.Readable.toWeb($)}})};E6.sdkStreamMixin=c9});var q6=R((f6)=>{async function y9($){if(typeof $.stream==="function")$=$.stream();return $.tee()}Object.defineProperty(f6,"__esModule",{value:!0});f6.splitStream=void 0;f6.splitStream=y9});var S6=R((P6)=>{async function d9($){if(u9.isReadableStream($))return _9.splitStream($);const U=new N6.PassThrough,G=new N6.PassThrough;return $.pipe(U),$.pipe(G),[U,G]}Object.defineProperty(P6,"__esModule",{value:!0});P6.splitStream=void 0;var N6=import.meta.require("stream"),_9=q6(),u9=g0();P6.splitStream=d9});var D6=R((k6)=>{async function g9($,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(k6,"__esModule",{value:!0});k6.headStream=void 0;k6.headStream=g9});var c6=R((x6)=>{Object.defineProperty(x6,"__esModule",{value:!0});x6.headStream=void 0;var p9=import.meta.require("stream"),l9=D6(),s9=g0(),m9=($,U)=>{if(s9.isReadableStream($))return l9.headStream($,U);return new Promise((G,W)=>{const X=new h6;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)})})};x6.headStream=m9;class h6 extends p9.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 p6=R((UK,K0)=>{function u6($,U="utf-8"){if(U==="base64")return y6.toBase64($);return _6.toUtf8($)}function d6($,U){if(U==="base64")return s$.mutate(y6.fromBase64($));return s$.mutate(_6.fromUtf8($))}var{defineProperty:C1,getOwnPropertyDescriptor:n9,getOwnPropertyNames:i9}=Object,r9=Object.prototype.hasOwnProperty,m$=($,U)=>C1($,"name",{value:U,configurable:!0}),o9=($,U)=>{for(var G in U)C1($,G,{get:U[G],enumerable:!0})},l$=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of i9(U))if(!r9.call($,X)&&X!==G)C1($,X,{get:()=>U[X],enumerable:!(W=n9(U,X))||W.enumerable})}return $},p0=($,U,G)=>(l$($,U,"default"),G&&l$(G,U,"default")),a9=($)=>l$(C1({},"__esModule",{value:!0}),$),I0={};o9(I0,{Uint8ArrayBlobAdapter:()=>s$});K0.exports=a9(I0);var y6=E1(),_6=W0();m$(u6,"transformToString");m$(d6,"transformFromString");var g6=class $ extends Uint8Array{static fromString(U,G="utf-8"){switch(typeof U){case"string":return d6(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 u6(this,U)}};m$(g6,"Uint8ArrayBlobAdapter");var s$=g6;p0(I0,b4(),K0.exports);p0(I0,O6(),K0.exports);p0(I0,S6(),K0.exports);p0(I0,c6(),K0.exports);p0(I0,g0(),K0.exports)});var N0=R((GK,JW)=>{function WW($){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`${CQ[W]}, ${w} ${WU[G]} ${U} ${Q}:${z}:${F} GMT`}function P1($){return encodeURIComponent($).replace(/[!'()*]/g,function(U){return"%"+U.charCodeAt(0).toString(16).toUpperCase()})}function XU($,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,X7(W,X,Z);else Z=U;for(let L of Object.keys(Z)){if(!Array.isArray(Z[L])){W[L]=Z[L];continue}zW(W,null,Z,L)}return W}function FW($,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:j1,getOwnPropertyDescriptor:t9,getOwnPropertyNames:e9}=Object,$Q=Object.prototype.hasOwnProperty,M=($,U)=>j1($,"name",{value:U,configurable:!0}),UQ=($,U)=>{for(var G in U)j1($,G,{get:U[G],enumerable:!0})},GQ=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of e9(U))if(!$Q.call($,X)&&X!==G)j1($,X,{get:()=>U[X],enumerable:!(W=t9(U,X))||W.enumerable})}return $},WQ=($)=>GQ(j1({},"__esModule",{value:!0}),$),s6={};UQ(s6,{Client:()=>ZQ,Command:()=>o6,LazyJsonString:()=>U7,NoOpLogger:()=>XQ,SENSITIVE_STRING:()=>wQ,ServiceException:()=>pQ,StringWrapper:()=>i0,_json:()=>e$,collectBody:()=>LQ,convertMap:()=>G7,createAggregatedClient:()=>QQ,dateToUtcString:()=>WW,decorateServiceException:()=>ZW,emitWarningIfUnsupportedVersion:()=>nQ,expectBoolean:()=>FQ,expectByte:()=>t$,expectFloat32:()=>q1,expectInt:()=>IQ,expectInt32:()=>o$,expectLong:()=>m0,expectNonNull:()=>MQ,expectNumber:()=>s0,expectObject:()=>t6,expectShort:()=>a$,expectString:()=>RQ,expectUnion:()=>BQ,extendedEncodeURIComponent:()=>P1,getArrayIfSingleItem:()=>$7,getDefaultClientConfiguration:()=>tQ,getDefaultExtensionConfiguration:()=>YW,getValueFromTextNode:()=>wW,handleFloat:()=>AQ,limitedParseDouble:()=>GU,limitedParseFloat:()=>EQ,limitedParseFloat32:()=>TQ,loadConfigsForDefaultMode:()=>mQ,logger:()=>n0,map:()=>XU,parseBoolean:()=>zQ,parseEpochTimestamp:()=>hQ,parseRfc3339DateTime:()=>NQ,parseRfc3339DateTimeWithOffset:()=>jQ,parseRfc7231DateTime:()=>DQ,resolveDefaultRuntimeConfig:()=>eQ,resolvedPath:()=>Y7,serializeDateTime:()=>Q7,serializeFloat:()=>w7,splitEvery:()=>FW,strictParseByte:()=>GW,strictParseDouble:()=>UU,strictParseFloat:()=>VQ,strictParseFloat32:()=>e6,strictParseInt:()=>OQ,strictParseInt32:()=>fQ,strictParseLong:()=>UW,strictParseShort:()=>f0,take:()=>W7,throwDefaultError:()=>LW,withBaseException:()=>lQ});JW.exports=WQ(s6);var m6=class ${trace(){}debug(){}info(){}warn(){}error(){}};M(m6,"NoOpLogger");var XQ=m6,n6=J4(),i6=class ${constructor(U){this.config=U,this.middlewareStack=n6.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}};M(i6,"Client");var ZQ=i6,n$=p6(),LQ=M(async($=new Uint8Array,U)=>{if($ instanceof Uint8Array)return n$.Uint8ArrayBlobAdapter.mutate($);if(!$)return n$.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const G=U.streamCollector($);return n$.Uint8ArrayBlobAdapter.mutate(await G)},"collectBody"),r$=A0(),r6=class ${constructor(){this.middlewareStack=n6.constructStack()}static classBuilder(){return new YQ}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 J=U.concat(this.middlewareStack),{logger:I}=G,K={logger:I,clientName:Z,commandName:L,inputFilterSensitiveLog:Y,outputFilterSensitiveLog:w,[r$.SMITHY_CONTEXT_KEY]:{commandInstance:this,...Q},...z},{requestHandler:V}=G;return J.resolve((B)=>V.handle(B.request,W||{}),K)}};M(r6,"Command");var o6=r6,a6=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 o6{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})}},M(U,"CommandRef"),U)}};M(a6,"ClassBuilder");var YQ=a6,wQ="***SensitiveInformation***",QQ=M(($,U)=>{for(let G of Object.keys($)){const W=$[G],X=M(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"),zQ=M(($)=>{switch($){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${$}"`)}},"parseBoolean"),FQ=M(($)=>{if($===null||$===void 0)return;if(typeof $==="number"){if($===0||$===1)n0.warn(N1(`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(N1(`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=M(($)=>{if($===null||$===void 0)return;if(typeof $==="string"){const U=parseFloat($);if(!Number.isNaN(U)){if(String(U)!==String($))n0.warn(N1(`Expected number but observed string: ${$}`));return U}}if(typeof $==="number")return $;throw new TypeError(`Expected number, got ${typeof $}: ${$}`)},"expectNumber"),JQ=Math.ceil(340282346638528860000000000000000000000),q1=M(($)=>{const U=s0($);if(U!==void 0&&!Number.isNaN(U)&&U!==1/0&&U!==-1/0){if(Math.abs(U)>JQ)throw new TypeError(`Expected 32-bit float, got ${$}`)}return U},"expectFloat32"),m0=M(($)=>{if($===null||$===void 0)return;if(Number.isInteger($)&&!Number.isNaN($))return $;throw new TypeError(`Expected integer, got ${typeof $}: ${$}`)},"expectLong"),IQ=m0,o$=M(($)=>$U($,32),"expectInt32"),a$=M(($)=>$U($,16),"expectShort"),t$=M(($)=>$U($,8),"expectByte"),$U=M(($,U)=>{const G=m0($);if(G!==void 0&&KQ(G,U)!==G)throw new TypeError(`Expected ${U}-bit integer, got ${$}`);return G},"expectSizedInt"),KQ=M(($,U)=>{switch(U){case 32:return Int32Array.of($)[0];case 16:return Int16Array.of($)[0];case 8:return Int8Array.of($)[0]}},"castInt"),MQ=M(($,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"),t6=M(($)=>{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"),RQ=M(($)=>{if($===null||$===void 0)return;if(typeof $==="string")return $;if(["boolean","number","bigint"].includes(typeof $))return n0.warn(N1(`Expected string, got ${typeof $}: ${$}`)),String($);throw new TypeError(`Expected string, got ${typeof $}: ${$}`)},"expectString"),BQ=M(($)=>{if($===null||$===void 0)return;const U=t6($),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"),UU=M(($)=>{if(typeof $=="string")return s0(q0($));return s0($)},"strictParseDouble"),VQ=UU,e6=M(($)=>{if(typeof $=="string")return q1(q0($));return q1($)},"strictParseFloat32"),HQ=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,q0=M(($)=>{const U=$.match(HQ);if(U===null||U[0].length!==$.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat($)},"parseNumber"),GU=M(($)=>{if(typeof $=="string")return $W($);return s0($)},"limitedParseDouble"),AQ=GU,EQ=GU,TQ=M(($)=>{if(typeof $=="string")return $W($);return q1($)},"limitedParseFloat32"),$W=M(($)=>{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"),UW=M(($)=>{if(typeof $==="string")return m0(q0($));return m0($)},"strictParseLong"),OQ=UW,fQ=M(($)=>{if(typeof $==="string")return o$(q0($));return o$($)},"strictParseInt32"),f0=M(($)=>{if(typeof $==="string")return a$(q0($));return a$($)},"strictParseShort"),GW=M(($)=>{if(typeof $==="string")return t$(q0($));return t$($)},"strictParseByte"),N1=M(($)=>{return String(new TypeError($).stack||$).split("\n").slice(0,5).filter((U)=>!U.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),n0={warn:console.warn},CQ=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],WU=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];M(WW,"dateToUtcString");var qQ=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),NQ=M(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const U=qQ.exec($);if(!U)throw new TypeError("Invalid RFC-3339 date-time value");const[G,W,X,Z,L,Y,w,Q]=U,z=f0(C0(W)),F=o(X,"month",1,12),J=o(Z,"day",1,31);return l0(z,F,J,{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q})},"parseRfc3339DateTime"),PQ=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),jQ=M(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const U=PQ.exec($);if(!U)throw new TypeError("Invalid RFC-3339 date-time value");const[G,W,X,Z,L,Y,w,Q,z]=U,F=f0(C0(W)),J=o(X,"month",1,12),I=o(Z,"day",1,31),K=l0(F,J,I,{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q});if(z.toUpperCase()!="Z")K.setTime(K.getTime()-gQ(z));return K},"parseRfc3339DateTimeWithOffset"),SQ=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$/),kQ=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$/),bQ=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})$/),DQ=M(($)=>{if($===null||$===void 0)return;if(typeof $!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let U=SQ.exec($);if(U){const[G,W,X,Z,L,Y,w,Q]=U;return l0(f0(C0(Z)),i$(X),o(W,"day",1,31),{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q})}if(U=kQ.exec($),U){const[G,W,X,Z,L,Y,w,Q]=U;return cQ(l0(xQ(Z),i$(X),o(W,"day",1,31),{hours:L,minutes:Y,seconds:w,fractionalMilliseconds:Q}))}if(U=bQ.exec($),U){const[G,W,X,Z,L,Y,w,Q]=U;return l0(f0(C0(Q)),i$(W),o(X.trimLeft(),"day",1,31),{hours:Z,minutes:L,seconds:Y,fractionalMilliseconds:w})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),hQ=M(($)=>{if($===null||$===void 0)return;let U;if(typeof $==="number")U=$;else if(typeof $==="string")U=UU($);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=M(($,U,G,W)=>{const X=U-1;return _Q($,X,G),new Date(Date.UTC($,X,G,o(W.hours,"hour",0,23),o(W.minutes,"minute",0,59),o(W.seconds,"seconds",0,60),dQ(W.fractionalMilliseconds)))},"buildDate"),xQ=M(($)=>{const U=new Date().getUTCFullYear(),G=Math.floor(U/100)*100+f0(C0($));if(G<U)return G+100;return G},"parseTwoDigitYear"),vQ=1576800000000,cQ=M(($)=>{if($.getTime()-new Date().getTime()>vQ)return new Date(Date.UTC($.getUTCFullYear()-100,$.getUTCMonth(),$.getUTCDate(),$.getUTCHours(),$.getUTCMinutes(),$.getUTCSeconds(),$.getUTCMilliseconds()));return $},"adjustRfc850Year"),i$=M(($)=>{const U=WU.indexOf($);if(U<0)throw new TypeError(`Invalid month: ${$}`);return U+1},"parseMonthByShortName"),yQ=[31,28,31,30,31,30,31,31,30,31,30,31],_Q=M(($,U,G)=>{let W=yQ[U];if(U===1&&uQ($))W=29;if(G>W)throw new TypeError(`Invalid day for ${WU[U]} in ${$}: ${G}`)},"validateDayOfMonth"),uQ=M(($)=>{return $%4===0&&($%100!==0||$%400===0)},"isLeapYear"),o=M(($,U,G,W)=>{const X=GW(C0($));if(X<G||X>W)throw new TypeError(`${U} must be between ${G} and ${W}, inclusive`);return X},"parseDateValue"),dQ=M(($)=>{if($===null||$===void 0)return 0;return e6("0."+$)*1000},"parseMilliseconds"),gQ=M(($)=>{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=M(($)=>{let U=0;while(U<$.length-1&&$.charAt(U)==="0")U++;if(U===0)return $;return $.slice(U)},"stripLeadingZeroes"),XW=class $ extends Error{constructor(U){super(U.message);Object.setPrototypeOf(this,$.prototype),this.name=U.name,this.$fault=U.$fault,this.$metadata=U.$metadata}};M(XW,"ServiceException");var pQ=XW,ZW=M(($,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"),LW=M(({output:$,parsedBody:U,exceptionCtor:G,errorCode:W})=>{const X=sQ($),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 ZW(L,U)},"throwDefaultError"),lQ=M(($)=>{return({output:U,parsedBody:G,errorCode:W})=>{LW({output:U,parsedBody:G,exceptionCtor:$,errorCode:W})}},"withBaseException"),sQ=M(($)=>({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"),mQ=M(($)=>{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"),l6=!1,nQ=M(($)=>{if($&&!l6&&parseInt($.substring(1,$.indexOf(".")))<16)l6=!0},"emitWarningIfUnsupportedVersion"),iQ=M(($)=>{const U=[];for(let G in r$.AlgorithmId){const W=r$.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"),rQ=M(($)=>{const U={};return $.checksumAlgorithms().forEach((G)=>{U[G.algorithmId()]=G.checksumConstructor()}),U},"resolveChecksumRuntimeConfig"),oQ=M(($)=>{let U=$.retryStrategy;return{setRetryStrategy(G){U=G},retryStrategy(){return U}}},"getRetryConfiguration"),aQ=M(($)=>{const U={};return U.retryStrategy=$.retryStrategy(),U},"resolveRetryRuntimeConfig"),YW=M(($)=>{return{...iQ($),...oQ($)}},"getDefaultExtensionConfiguration"),tQ=YW,eQ=M(($)=>{return{...rQ($),...aQ($)}},"resolveDefaultRuntimeConfig");M(P1,"extendedEncodeURIComponent");var $7=M(($)=>Array.isArray($)?$:[$],"getArrayIfSingleItem"),wW=M(($)=>{for(let G in $)if($.hasOwnProperty(G)&&$[G]["#text"]!==void 0)$[G]=$[G]["#text"];else if(typeof $[G]==="object"&&$[G]!==null)$[G]=wW($[G]);return $},"getValueFromTextNode"),i0=M(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 QW=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))}};M(QW,"LazyJsonString");var U7=QW;M(XU,"map");var G7=M(($)=>{const U={};for(let[G,W]of Object.entries($||{}))U[G]=[,W];return U},"convertMap"),W7=M(($,U)=>{const G={};for(let W in U)zW(G,$,U,W);return G},"take"),X7=M(($,U,G)=>{return XU($,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"),zW=M(($,U,G,W)=>{if(U!==null){let L=G[W];if(typeof L==="function")L=[,L];const[Y=Z7,w=L7,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"),Z7=M(($)=>$!=null,"nonNullish"),L7=M(($)=>$,"pass"),Y7=M(($,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)=>P1(Y)).join("/"):P1(L))}else throw new Error("No value provided for input HTTP label: "+G+".");return $},"resolvedPath"),w7=M(($)=>{if($!==$)return"NaN";switch($){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return $}},"serializeFloat"),Q7=M(($)=>$.toISOString().replace(".000Z","Z"),"serializeDateTime"),e$=M(($)=>{if($==null)return{};if(Array.isArray($))return $.filter((U)=>U!=null).map(e$);if(typeof $==="object"){const U={};for(let G of Object.keys($)){if($[G]==null)continue;U[G]=e$($[G])}return U}return $},"_json");M(FW,"splitEvery")});var MW=R((IW)=>{Object.defineProperty(IW,"__esModule",{value:!0});IW.isStreamingPayload=void 0;var z7=import.meta.require("stream"),F7=($)=>($===null||$===void 0?void 0:$.body)instanceof z7.Readable||typeof ReadableStream!=="undefined"&&($===null||$===void 0?void 0:$.body)instanceof ReadableStream;IW.isStreamingPayload=F7});var DW=R((ZK,bW)=>{var{defineProperty:S1,getOwnPropertyDescriptor:J7,getOwnPropertyNames:I7}=Object,K7=Object.prototype.hasOwnProperty,j=($,U)=>S1($,"name",{value:U,configurable:!0}),M7=($,U)=>{for(var G in U)S1($,G,{get:U[G],enumerable:!0})},R7=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of I7(U))if(!K7.call($,X)&&X!==G)S1($,X,{get:()=>U[X],enumerable:!(W=J7(U,X))||W.enumerable})}return $},B7=($)=>R7(S1({},"__esModule",{value:!0}),$),BW={};M7(BW,{AdaptiveRetryStrategy:()=>A7,CONFIG_MAX_ATTEMPTS:()=>LU,CONFIG_RETRY_MODE:()=>qW,ENV_MAX_ATTEMPTS:()=>ZU,ENV_RETRY_MODE:()=>CW,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>E7,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>O7,StandardRetryStrategy:()=>OW,defaultDelayDecider:()=>HW,defaultRetryDecider:()=>AW,getOmitRetryHeadersPlugin:()=>f7,getRetryAfterHint:()=>kW,getRetryPlugin:()=>S7,omitRetryHeadersMiddleware:()=>NW,omitRetryHeadersMiddlewareOptions:()=>PW,resolveRetryConfig:()=>T7,retryMiddleware:()=>jW,retryMiddlewareOptions:()=>SW});bW.exports=B7(BW);var P0=t(),VW=I$(),q=Y4(),V7=j(($,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=j((F)=>F.name==="TimeoutError"?Z:X,"getCapacityAmount"),w=j((F)=>Y(F)<=L,"hasRetryTokens");return Object.freeze({hasRetryTokens:w,retrieveRetryTokens:j((F)=>{if(!w(F))throw new Error("No retry token available");const J=Y(F);return L-=J,J},"retrieveRetryTokens"),releaseRetryTokens:j((F)=>{L+=F??W,L=Math.min(L,G)},"releaseRetryTokens")})},"getDefaultRetryQuota"),HW=j(($,U)=>Math.floor(Math.min(q.MAXIMUM_RETRY_DELAY,Math.random()*2**U*$)),"defaultDelayDecider"),X0=F0(),AW=j(($)=>{if(!$)return!1;return X0.isRetryableByTrait($)||X0.isClockSkewError($)||X0.isThrottlingError($)||X0.isTransientError($)},"defaultRetryDecider"),EW=j(($)=>{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"),TW=class ${constructor(U,G){this.maxAttemptsProvider=U,this.mode=q.RETRY_MODES.STANDARD,this.retryDecider=(G==null?void 0:G.retryDecider)??AW,this.delayDecider=(G==null?void 0:G.delayDecider)??HW,this.retryQuota=(G==null?void 0:G.retryQuota)??V7(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(P0.HttpRequest.isInstance(w))w.headers[q.INVOCATION_ID_HEADER]=VW.v4();while(!0)try{if(P0.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=EW(Q);if(Z++,this.shouldRetry(z,Z,Y)){X=this.retryQuota.retrieveRetryTokens(z);const F=this.delayDecider(X0.isThrottlingError(z)?q.THROTTLING_RETRY_DELAY_BASE:q.DEFAULT_RETRY_DELAY_BASE,Z),J=H7(z.$response),I=Math.max(J||0,F);L+=I,await new Promise((K)=>setTimeout(K,I));continue}if(!z.$metadata)z.$metadata={};throw z.$metadata.attempts=Z,z.$metadata.totalRetryDelay=L,z}}};j(TW,"StandardRetryStrategy");var OW=TW,H7=j(($)=>{if(!P0.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"),fW=class $ extends OW{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)}})}};j(fW,"AdaptiveRetryStrategy");var A7=fW,RW=r(),ZU="AWS_MAX_ATTEMPTS",LU="max_attempts",E7={environmentVariableSelector:($)=>{const U=$[ZU];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Environment variable ${ZU} mast be a number, got "${U}"`);return G},configFileSelector:($)=>{const U=$[LU];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Shared config file entry ${LU} mast be a number, got "${U}"`);return G},default:q.DEFAULT_MAX_ATTEMPTS},T7=j(($)=>{const{retryStrategy:U}=$,G=RW.normalizeProvider($.maxAttempts??q.DEFAULT_MAX_ATTEMPTS);return{...$,maxAttempts:G,retryStrategy:async()=>{if(U)return U;if(await RW.normalizeProvider($.retryMode)()===q.RETRY_MODES.ADAPTIVE)return new q.AdaptiveRetryStrategy(G);return new q.StandardRetryStrategy(G)}}},"resolveRetryConfig"),CW="AWS_RETRY_MODE",qW="retry_mode",O7={environmentVariableSelector:($)=>$[CW],configFileSelector:($)=>$[qW],default:q.DEFAULT_RETRY_MODE},NW=j(()=>($)=>async(U)=>{const{request:G}=U;if(P0.HttpRequest.isInstance(G))delete G.headers[q.INVOCATION_ID_HEADER],delete G.headers[q.REQUEST_HEADER];return $(U)},"omitRetryHeadersMiddleware"),PW={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},f7=j(($)=>({applyToStack:(U)=>{U.addRelativeTo(NW(),PW)}}),"getOmitRetryHeadersPlugin"),C7=N0(),q7=MW(),jW=j(($)=>(U,G)=>async(W)=>{var X;let Z=await $.retryStrategy();const L=await $.maxAttempts();if(N7(Z)){Z=Z;let Y=await Z.acquireInitialRetryToken(G.partition_id),w=new Error,Q=0,z=0;const{request:F}=W,J=P0.HttpRequest.isInstance(F);if(J)F.headers[q.INVOCATION_ID_HEADER]=VW.v4();while(!0)try{if(J)F.headers[q.REQUEST_HEADER]=`attempt=${Q+1}; max=${L}`;const{response:I,output:K}=await U(W);return Z.recordSuccess(Y),K.$metadata.attempts=Q+1,K.$metadata.totalRetryDelay=z,{response:I,output:K}}catch(I){const K=P7(I);if(w=EW(I),J&&q7.isStreamingPayload(F))throw(X=G.logger instanceof C7.NoOpLogger?console:G.logger)==null||X.warn("An error was encountered in a non-retryable streaming request."),w;try{Y=await Z.refreshRetryTokenForRetry(Y,K)}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"),N7=j(($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined","isRetryStrategyV2"),P7=j(($)=>{const U={error:$,errorType:j7($)},G=kW($.$response);if(G)U.retryAfterHint=G;return U},"getRetryErrorInfo"),j7=j(($)=>{if(X0.isThrottlingError($))return"THROTTLING";if(X0.isTransientError($))return"TRANSIENT";if(X0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),SW={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},S7=j(($)=>({applyToStack:(U)=>{U.add(jW($),SW)}}),"getRetryPlugin"),kW=j(($)=>{if(!P0.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 wU=R((LK,tW)=>{function vW($){const U=new Map;for(let G of $)U.set(G.schemeId,G);return U}function iW($,U){return new oW($,U)}function aW($,U,G,W,X){return C(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 $z(U,L.client,Y,...w);else throw new Error(`Invalid client, expected instance of ${$.name}`);yield F;const J=Q;Q=Uz(F,W),z=!!(Q&&(!L.stopOnSameToken||Q!==J))}return},"paginateOperation")}var{defineProperty:b1,getOwnPropertyDescriptor:k7,getOwnPropertyNames:b7}=Object,D7=Object.prototype.hasOwnProperty,C=($,U)=>b1($,"name",{value:U,configurable:!0}),h7=($,U)=>{for(var G in U)b1($,G,{get:U[G],enumerable:!0})},x7=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of b7(U))if(!D7.call($,X)&&X!==G)b1($,X,{get:()=>U[X],enumerable:!(W=k7(U,X))||W.enumerable})}return $},v7=($)=>x7(b1({},"__esModule",{value:!0}),$),hW={};h7(hW,{DefaultIdentityProviderConfig:()=>s7,EXPIRATION_MS:()=>mW,HttpApiKeyAuthSigner:()=>m7,HttpBearerAuthSigner:()=>n7,NoAuthSigner:()=>i7,RequestBuilder:()=>oW,createIsIdentityExpiredFunction:()=>sW,createPaginator:()=>aW,doesIdentityRequireRefresh:()=>nW,getHttpAuthSchemeEndpointRuleSetPlugin:()=>y7,getHttpAuthSchemePlugin:()=>u7,getHttpSigningPlugin:()=>l7,getSmithyContext:()=>a7,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>cW,httpAuthSchemeMiddleware:()=>YU,httpAuthSchemeMiddlewareOptions:()=>yW,httpSigningMiddleware:()=>_W,httpSigningMiddlewareOptions:()=>uW,isIdentityExpired:()=>r7,memoizeIdentityProvider:()=>o7,normalizeProvider:()=>t7,requestBuilder:()=>iW});tW.exports=v7(hW);var xW=r();C(vW,"convertHttpAuthSchemesToMap");var YU=C(($,U)=>(G,W)=>async(X)=>{var Z;const L=$.httpAuthSchemeProvider(await U.httpAuthSchemeParametersProvider($,W,X.input)),Y=vW($.httpAuthSchemes),w=xW.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 J=F.identityProvider(await U.identityProviderConfigProvider($));if(!J){Q.push(`HttpAuthScheme \`${z.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:I={},signingProperties:K={}}=((Z=z.propertiesExtractor)==null?void 0:Z.call(z,$,W))||{};z.identityProperties=Object.assign(z.identityProperties||{},I),z.signingProperties=Object.assign(z.signingProperties||{},K),w.selectedHttpAuthScheme={httpAuthOption:z,identity:await J(z.identityProperties),signer:F.signer};break}if(!w.selectedHttpAuthScheme)throw new Error(Q.join("\n"));return G(X)},"httpAuthSchemeMiddleware"),c7=h8(),cW={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:c7.endpointMiddlewareOptions.name},y7=C(($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G})=>({applyToStack:(W)=>{W.addRelativeTo(YU($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G}),cW)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),_7=q$(),yW={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:_7.serializerMiddlewareOption.name},u7=C(($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G})=>({applyToStack:(W)=>{W.addRelativeTo(YU($,{httpAuthSchemeParametersProvider:U,identityProviderConfigProvider:G}),yW)}}),"getHttpAuthSchemePlugin"),D1=t(),d7=C(($)=>(U)=>{throw U},"defaultErrorHandler"),g7=C(($,U)=>{},"defaultSuccessHandler"),_W=C(($)=>(U,G)=>async(W)=>{if(!D1.HttpRequest.isInstance(W.request))return U(W);const Z=xW.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||d7)(L));return(w.successHandler||g7)(Q.response,L),Q},"httpSigningMiddleware"),p7=DW(),uW={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:p7.retryMiddlewareOptions.name},l7=C(($)=>({applyToStack:(U)=>{U.addRelativeTo(_W($),uW)}}),"getHttpSigningPlugin"),dW=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)}};C(dW,"DefaultIdentityProviderConfig");var s7=dW,k1=A0(),gW=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=D1.HttpRequest.clone(U);if(W.in===k1.HttpApiKeyAuthLocation.QUERY)X.query[W.name]=G.apiKey;else if(W.in===k1.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}};C(gW,"HttpApiKeyAuthSigner");var m7=gW,pW=class ${async sign(U,G,W){const X=D1.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}};C(pW,"HttpBearerAuthSigner");var n7=pW,lW=class ${async sign(U,G,W){return U}};C(lW,"NoAuthSigner");var i7=lW,sW=C(($)=>(U)=>nW(U)&&U.expiration.getTime()-Date.now()<$,"createIsIdentityExpiredFunction"),mW=300000,r7=sW(mW),nW=C(($)=>$.expiration!==void 0,"doesIdentityRequireRefresh"),o7=C(($,U,G)=>{if($===void 0)return;const W=typeof $!=="function"?async()=>Promise.resolve($):$;let X,Z,L,Y=!1;const w=C(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"),a7=C(($)=>$[k1.SMITHY_CONTEXT_KEY]||($[k1.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),t7=C(($)=>{if(typeof $==="function")return $;const U=Promise.resolve($);return()=>U},"normalizeProvider"),e7=N0();C(iW,"requestBuilder");var rW=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 D1.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=e7.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}};C(rW,"RequestBuilder");var oW=rW,$z=C(async($,U,G,...W)=>{return await U.send(new $(G),...W)},"makePagedClientRequest");C(aW,"createPaginator");var Uz=C(($,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 pX=R((YA,gX)=>{var{defineProperty:a1,getOwnPropertyDescriptor:yz,getOwnPropertyNames:_z}=Object,uz=Object.prototype.hasOwnProperty,dz=($,U)=>a1($,"name",{value:U,configurable:!0}),gz=($,U)=>{for(var G in U)a1($,G,{get:U[G],enumerable:!0})},pz=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of _z(U))if(!uz.call($,X)&&X!==G)a1($,X,{get:()=>U[X],enumerable:!(W=yz(U,X))||W.enumerable})}return $},lz=($)=>pz(a1({},"__esModule",{value:!0}),$),dX={};gz(dX,{emitWarningIfUnsupportedVersion:()=>sz});gX.exports=lz(dX);var uX=!1,sz=dz(($)=>{if($&&!uX&&parseInt($.substring(1,$.indexOf(".")))<18)uX=!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 QZ=R((wA,wZ)=>{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:W$,getOwnPropertyDescriptor:mz,getOwnPropertyNames:nz}=Object,iz=Object.prototype.hasOwnProperty,k=($,U)=>W$($,"name",{value:U,configurable:!0}),rz=($,U)=>{for(var G in U)W$($,G,{get:U[G],enumerable:!0})},oz=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of nz(U))if(!iz.call($,X)&&X!==G)W$($,X,{get:()=>U[X],enumerable:!(W=mz(U,X))||W.enumerable})}return $},az=($)=>oz(W$({},"__esModule",{value:!0}),$),iX={};rz(iX,{SignatureV4:()=>OF,clearCredentialCache:()=>KF,createScope:()=>$$,getCanonicalHeaders:()=>bU,getCanonicalQuery:()=>GZ,getPayloadHash:()=>G$,getSigningKey:()=>UZ,moveHeadersToQuery:()=>LZ,prepareRequest:()=>hU});wZ.exports=az(iX);var lX=r(),jU=W0(),tz="X-Amz-Algorithm",ez="X-Amz-Credential",rX="X-Amz-Date",$F="X-Amz-SignedHeaders",UF="X-Amz-Expires",oX="X-Amz-Signature",aX="X-Amz-Security-Token",tX="authorization",eX=rX.toLowerCase(),GF="date",WF=[tX,eX,GF],XF=oX.toLowerCase(),kU="x-amz-content-sha256",ZF=aX.toLowerCase(),LF={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},YF=/^proxy-/,wF=/^sec-/,SU="AWS4-HMAC-SHA256",QF="AWS4-HMAC-SHA256-PAYLOAD",zF="UNSIGNED-PAYLOAD",FF=50,$Z="aws4_request",JF=604800,Y0=R6(),IF=W0(),D0={},e1=[],$$=k(($,U,G)=>`${$}/${U}/${G}/${$Z}`,"createScope"),UZ=k(async($,U,G,W,X)=>{const Z=await sX($,U.secretAccessKey,U.accessKeyId),L=`${G}:${W}:${X}:${Y0.toHex(Z)}:${U.sessionToken}`;if(L in D0)return D0[L];e1.push(L);while(e1.length>FF)delete D0[e1.shift()];let Y=`AWS4${U.secretAccessKey}`;for(let w of[G,W,X,$Z])Y=await sX($,Y,w);return D0[L]=Y},"getSigningKey"),KF=k(()=>{e1.length=0,Object.keys(D0).forEach(($)=>{delete D0[$]})},"clearCredentialCache"),sX=k(($,U,G)=>{const W=new $(U);return W.update(IF.toUint8Array(G)),W.digest()},"hmac"),bU=k(({headers:$},U,G)=>{const W={};for(let X of Object.keys($).sort()){if($[X]==null)continue;const Z=X.toLowerCase();if(Z in LF||(U==null?void 0:U.has(Z))||YF.test(Z)||wF.test(Z)){if(!G||G&&!G.has(Z))continue}W[Z]=$[X].trim().replace(/\s+/g," ")}return W},"getCanonicalHeaders"),U$=D4(),GZ=k(({query:$={}})=>{const U=[],G={};for(let W of Object.keys($)){if(W.toLowerCase()===XF)continue;const X=U$.escapeUri(W);U.push(X);const Z=$[W];if(typeof Z==="string")G[X]=`${X}=${U$.escapeUri(Z)}`;else if(Array.isArray(Z))G[X]=Z.slice(0).reduce((L,Y)=>L.concat([`${X}=${U$.escapeUri(Y)}`]),[]).sort().join("&")}return U.sort().map((W)=>G[W]).filter((W)=>W).join("&")},"getCanonicalQuery"),MF=D$(),RF=W0(),G$=k(async({headers:$,body:U},G)=>{for(let W of Object.keys($))if(W.toLowerCase()===kU)return $[W];if(U==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof U==="string"||ArrayBuffer.isView(U)||MF.isArrayBuffer(U)){const W=new G;return W.update(RF.toUint8Array(U)),Y0.toHex(await W.digest())}return zF},"getPayloadHash"),mX=W0(),WZ=class ${format(U){const G=[];for(let Z of Object.keys(U)){const L=mX.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=mX.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(HF.fromNumber(U.value.valueOf()).bytes,1),z;case"uuid":if(!VF.test(U.value))throw new Error(`Invalid UUID received: ${U.value}`);const F=new Uint8Array(17);return F[0]=9,F.set(Y0.fromHex(U.value.replace(/\-/g,"")),1),F}}};k(WZ,"HeaderFormatter");var BF=WZ,VF=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,XZ=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(Y0.toHex(U),16)*(G?-1:1)}toString(){return String(this.valueOf())}};k(XZ,"Int64");var HF=XZ;k(DU,"negate");var AF=k(($,U)=>{$=$.toLowerCase();for(let G of Object.keys(U))if($===G.toLowerCase())return!0;return!1},"hasHeader"),ZZ=t(),LZ=k(($,U={})=>{var G;const{headers:W,query:X={}}=ZZ.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"),hU=k(($)=>{$=ZZ.HttpRequest.clone($);for(let U of Object.keys($.headers))if(WF.indexOf(U.toLowerCase())>-1)delete $.headers[U];return $},"prepareRequest"),EF=k(($)=>TF($).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),TF=k(($)=>{if(typeof $==="number")return new Date($*1000);if(typeof $==="string"){if(Number($))return new Date(Number($)*1000);return new Date($)}return $},"toDate"),YZ=class ${constructor({applyChecksum:U,credentials:G,region:W,service:X,sha256:Z,uriEscapePath:L=!0}){this.headerFormatter=new BF,this.service=X,this.sha256=Z,this.uriEscapePath=L,this.applyChecksum=typeof U==="boolean"?U:!0,this.regionProvider=lX.normalizeProvider(W),this.credentialProvider=lX.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:J,shortDate:I}=t1(W);if(X>JF)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const K=$$(I,F,Q??this.service),V=LZ(hU(U),{unhoistableHeaders:L});if(z.sessionToken)V.query[aX]=z.sessionToken;V.query[tz]=SU,V.query[ez]=`${z.accessKeyId}/${K}`,V.query[rX]=J,V.query[UF]=X.toString(10);const B=bU(V,Z,Y);return V.query[$F]=nX(B),V.query[oX]=await this.getSignature(J,K,this.getSigningKey(z,F,I,Q),this.createCanonicalRequest(V,B,await G$(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}=t1(W),z=$$(w,Y,L??this.service),F=await G$({headers:{},body:G},this.sha256),J=new this.sha256;J.update(U);const I=Y0.toHex(await J.digest()),K=[QF,Q,z,X,I,F].join("\n");return this.signString(K,{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}=t1(G),w=new this.sha256(await this.getSigningKey(Z,L,Y,X));return w.update(jU.toUint8Array(U)),Y0.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=hU(U),{longDate:z,shortDate:F}=t1(G),J=$$(F,w,L??this.service);if(Q.headers[eX]=z,Y.sessionToken)Q.headers[ZF]=Y.sessionToken;const I=await G$(Q,this.sha256);if(!AF(kU,Q.headers)&&this.applyChecksum)Q.headers[kU]=I;const K=bU(Q,X,W),V=await this.getSignature(z,J,this.getSigningKey(Y,w,F,L),this.createCanonicalRequest(Q,K,I));return Q.headers[tX]=`${SU} Credential=${Y.accessKeyId}/${J}, SignedHeaders=${nX(K)}, Signature=${V}`,Q}createCanonicalRequest(U,G,W){const X=Object.keys(G).sort();return`${U.method}
|
|
10
|
-
${this.getCanonicalPath(U)}
|
|
11
|
-
${GZ(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(jU.toUint8Array(W));const Z=await X.digest();return`${SU}
|
|
16
|
-
${U}
|
|
17
|
-
${G}
|
|
18
|
-
${Y0.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 U$.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(jU.toUint8Array(Z)),Y0.toHex(await L.digest())}getSigningKey(U,G,W,X){return UZ(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")}};k(YZ,"SignatureV4");var OF=YZ,t1=k(($)=>{const U=EF($).replace(/[\-:]/g,"");return{longDate:U,shortDate:U.slice(0,8)}},"formatDate"),nX=k(($)=>Object.keys($).sort().join(";"),"getCanonicalHeaderList")});var HZ=R((QA,VZ)=>{var{defineProperty:X$,getOwnPropertyDescriptor:fF,getOwnPropertyNames:CF}=Object,qF=Object.prototype.hasOwnProperty,v=($,U)=>X$($,"name",{value:U,configurable:!0}),NF=($,U)=>{for(var G in U)X$($,G,{get:U[G],enumerable:!0})},PF=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of CF(U))if(!qF.call($,X)&&X!==G)X$($,X,{get:()=>U[X],enumerable:!(W=fF(U,X))||W.enumerable})}return $},jF=($)=>PF(X$({},"__esModule",{value:!0}),$),KZ={};NF(KZ,{AWSSDKSigV4Signer:()=>DF,AwsSdkSigV4ASigner:()=>xF,AwsSdkSigV4Signer:()=>cU,NODE_SIGV4A_CONFIG_OPTIONS:()=>yF,resolveAWSSDKSigV4Config:()=>_F,resolveAwsSdkSigV4AConfig:()=>cF,resolveAwsSdkSigV4Config:()=>BZ,validateSigningProperties:()=>vU});VZ.exports=jF(KZ);var SF=t(),kF=t(),zZ=v(($)=>{var U,G;return kF.HttpResponse.isInstance($)?((U=$.headers)==null?void 0:U.date)??((G=$.headers)==null?void 0:G.Date):void 0},"getDateHeader"),xU=v(($)=>new Date(Date.now()+$),"getSkewCorrectedDate"),bF=v(($,U)=>Math.abs(xU(U).getTime()-$)>=300000,"isClockSkewed"),FZ=v(($,U)=>{const G=Date.parse($);if(bF(G,U))return G-Date.now();return U},"getUpdatedSystemClockOffset"),e0=v(($,U)=>{if(!U)throw new Error(`Property \`${$}\` is not resolved for AWS SDK SigV4Auth`);return U},"throwSigningPropertyError"),vU=v(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"),MZ=class ${async sign(U,G,W){var X;if(!SF.HttpRequest.isInstance(U))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const Z=await vU(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[J,I]=z.authSchemes;if((J==null?void 0:J.name)==="sigv4a"&&(I==null?void 0:I.name)==="sigv4")w=(I==null?void 0:I.signingRegion)??w,Q=(I==null?void 0:I.signingName)??Q}return await Y.sign(U,{signingDate:xU(L.systemClockOffset),signingRegion:w,signingService:Q})}errorHandler(U){return(G)=>{const W=G.ServerTime??zZ(G.$response);if(W){const X=e0("config",U.config),Z=X.systemClockOffset;if(X.systemClockOffset=FZ(W,X.systemClockOffset),X.systemClockOffset!==Z&&G.$metadata)G.$metadata.clockSkewCorrected=!0}throw G}}successHandler(U,G){const W=zZ(U);if(W){const X=e0("config",G.config);X.systemClockOffset=FZ(W,X.systemClockOffset)}}};v(MZ,"AwsSdkSigV4Signer");var cU=MZ,DF=cU,hF=t(),RZ=class $ extends cU{async sign(U,G,W){var X;if(!hF.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 vU(W),F=(await((X=Z.sigv4aSigningRegionSet)==null?void 0:X.call(Z))??w??[Y]).join(",");return await L.sign(U,{signingDate:xU(Z.systemClockOffset),signingRegion:F,signingService:Q})}};v(RZ,"AwsSdkSigV4ASigner");var xF=RZ,vF=wU(),JZ=T$(),cF=v(($)=>{return $.sigv4aSigningRegionSet=vF.normalizeProvider($.sigv4aSigningRegionSet),$},"resolveAwsSdkSigV4AConfig"),yF={environmentVariableSelector($){if($.AWS_SIGV4A_SIGNING_REGION_SET)return $.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((U)=>U.trim());throw new JZ.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 JZ.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},V0=wU(),IZ=QZ(),BZ=v(($)=>{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=v(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=v(()=>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||IZ.SignatureV4)(z)}),"signer");else Z=v(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||IZ.SignatureV4)(Q)},"signer");return{...$,systemClockOffset:W,signingEscapePath:G,credentials:U,signer:Z}},"resolveAwsSdkSigV4Config"),_F=BZ});var Z$=R((lF)=>{var uF=":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",AZ="[: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]["+uF+"]*",dF=new RegExp("^"+AZ+"$"),gF=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},pF=function($){const U=dF.exec($);return!(U===null||typeof U==="undefined")};lF.isExist=function($){return typeof $!=="undefined"};lF.isEmptyObject=function($){return Object.keys($).length===0};lF.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]]}};lF.getValue=function($){if(lF.isExist($))return $;else return""};lF.isName=pF;lF.getAllMatches=gF;lF.nameRegexp=AZ});var _U=R((LJ)=>{function TZ($){return $===" "||$==="\t"||$==="\n"||$==="\r"}function OZ($,U){const G=U;for(;U<$.length;U++)if($[U]=="?"||$[U]==" "){const W=$.substr(G,U-G);if(U>5&&W==="xml")return P("InvalidXml","XML declaration allowed only at the start of the document.",D($,U));else if($[U]=="?"&&$[U+1]==">"){U++;break}else continue}return U}function fZ($,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 $J($,U){let G="",W="",X=!1;for(;U<$.length;U++){if($[U]===tF||$[U]===eF)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 CZ($,U){const G=yU.getAllMatches($,UJ),W={};for(let X=0;X<G.length;X++){if(G[X][1].length===0)return P("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 P("InvalidAttr","Attribute '"+G[X][2]+"' is without value.",$1(G[X]));else if(G[X][3]===void 0&&!U.allowBooleanAttributes)return P("InvalidAttr","boolean attribute '"+G[X][2]+"' is not allowed.",$1(G[X]));const Z=G[X][2];if(!XJ(Z))return P("InvalidAttr","Attribute '"+Z+"' is an invalid name.",$1(G[X]));if(!W.hasOwnProperty(Z))W[Z]=1;else return P("InvalidAttr","Attribute '"+Z+"' is repeated.",$1(G[X]))}return!0}function GJ($,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 WJ($,U){if(U++,$[U]===";")return-1;if($[U]==="#")return U++,GJ($,U);let G=0;for(;U<$.length;U++,G++){if($[U].match(/\w/)&&G<20)continue;if($[U]===";")break;return-1}return U}function P($,U,G){return{err:{code:$,msg:U,line:G.line||G,col:G.col}}}function XJ($){return yU.isName($)}function ZJ($){return yU.isName($)}function D($,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 yU=Z$(),aF={allowBooleanAttributes:!1,unpairedTags:[]};LJ.validate=function($,U){U=Object.assign({},aF,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=OZ($,Z),Z.err)return Z}else if($[Z]==="<"){let L=Z;if(Z++,$[Z]==="!"){Z=fZ($,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(!ZJ(w)){let F;if(w.trim().length===0)F="Invalid space after '<'.";else F="Tag '"+w+"' is an invalid name.";return P("InvalidTag",F,D($,Z))}const Q=$J($,Z);if(Q===!1)return P("InvalidAttr","Attributes for '"+w+"' have open quote.",D($,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 J=CZ(z,U);if(J===!0)W=!0;else return P(J.err.code,J.err.msg,D($,F+J.err.line))}else if(Y)if(!Q.tagClosed)return P("InvalidTag","Closing tag '"+w+"' doesn't have proper closing.",D($,Z));else if(z.trim().length>0)return P("InvalidTag","Closing tag '"+w+"' can't have attributes or invalid starting.",D($,L));else if(G.length===0)return P("InvalidTag","Closing tag '"+w+"' has not been opened.",D($,L));else{const F=G.pop();if(w!==F.tagName){let J=D($,F.tagStartPos);return P("InvalidTag","Expected closing tag '"+F.tagName+"' (opened in line "+J.line+", col "+J.col+") instead of closing tag '"+w+"'.",D($,L))}if(G.length==0)X=!0}else{const F=CZ(z,U);if(F!==!0)return P(F.err.code,F.err.msg,D($,Z-z.length+F.err.line));if(X===!0)return P("InvalidXml","Multiple possible root nodes found.",D($,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=fZ($,Z);continue}else if($[Z+1]==="?"){if(Z=OZ($,++Z),Z.err)return Z}else break;else if($[Z]==="&"){const F=WJ($,Z);if(F==-1)return P("InvalidChar","char '&' is not expected.",D($,Z));Z=F}else if(X===!0&&!TZ($[Z]))return P("InvalidXml","Extra text at the end",D($,Z));if($[Z]==="<")Z--}}else{if(TZ($[Z]))continue;return P("InvalidChar","char '"+$[Z]+"' is not expected.",D($,Z))}if(!W)return P("InvalidXml","Start tag expected.",1);else if(G.length==1)return P("InvalidTag","Unclosed tag '"+G[0].tagName+"'.",D($,G[0].tagStartPos));else if(G.length>0)return P("InvalidXml","Invalid '"+JSON.stringify(G.map((Z)=>Z.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var tF='"',eF="'",UJ=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var NZ=R((QJ)=>{var qZ={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 $}},wJ=function($){return Object.assign({},qZ,$)};QJ.buildOptions=wJ;QJ.defaultOptions=qZ});var SZ=R((IA,jZ)=>{class PZ{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})}}jZ.exports=PZ});var bZ=R((KA,kZ)=>{function IJ($,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&&RJ($,U)){if(U+=7,[entityName,val,U]=KJ($,U+1),val.indexOf("&")===-1)G[AJ(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if(X&&BJ($,U))U+=8;else if(X&&VJ($,U))U+=8;else if(X&&HJ($,U))U+=9;else if(MJ)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 KJ($,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 MJ($,U){if($[U+1]==="!"&&$[U+2]==="-"&&$[U+3]==="-")return!0;return!1}function RJ($,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 BJ($,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 VJ($,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 HJ($,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 AJ($){if(JJ.isName($))return $;else throw new Error(`Invalid entity name ${$}`)}var JJ=Z$();kZ.exports=IJ});var hZ=R((MA,DZ)=>{function fJ($,U={}){if(U=Object.assign({},OJ,U),!$||typeof $!=="string")return $;let G=$.trim();if(U.skipLike!==void 0&&U.skipLike.test(G))return $;else if(U.hex&&EJ.test(G))return Number.parseInt(G,16);else{const W=TJ.exec(G);if(W){const X=W[1],Z=W[2];let L=CJ(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 CJ($){if($&&$.indexOf(".")!==-1){if($=$.replace(/0+$/,""),$===".")$="0";else if($[0]===".")$="0"+$;else if($[$.length-1]===".")$=$.substr(0,$.length-1);return $}return $}var EJ=/^[-+]?0x[a-fA-F0-9]+$/,TJ=/^([\-\+])?(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 OJ={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};DZ.exports=fJ});var yZ=R((RA,cZ)=>{function PJ($){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 jJ($,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 dU($,this.options.parseTagValue,this.options.numberParseOptions);else if($.trim()===$)return dU($,this.options.parseTagValue,this.options.numberParseOptions);else return $}}}function SJ($){if(this.options.removeNSPrefix){const U=$.split(":"),G=$.charAt(0)==="/"?"/":"";if(U[0]==="xmlns")return"";if(U.length===2)$=G+U[1]}return $}function bJ($,U,G){if(!this.options.ignoreAttributes&&typeof $==="string"){const W=xZ.getAllMatches($,kJ),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]=dU(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 hJ($,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 vJ($,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 cJ($,U,G){const W="*."+G;for(let X in $){const Z=$[X];if(W===Z||U===Z)return!0}return!1}function yJ($,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 H0($,U,G,W){const X=$.indexOf(U,G);if(X===-1)throw new Error(W);else return X+U.length-1}function uU($,U,G,W=">"){const X=yJ($,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 _J($,U,G){const W=G;let X=1;for(;G<$.length;G++)if($[G]==="<")if($[G+1]==="/"){const Z=H0($,">",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=H0($,"?>",G+1,"StopNode is not closed.");else if($.substr(G+1,3)==="!--")G=H0($,"-->",G+3,"StopNode is not closed.");else if($.substr(G+1,2)==="![")G=H0($,"]]>",G,"StopNode is not closed.")-2;else{const Z=uU($,G,">");if(Z){if((Z&&Z.tagName)===U&&Z.tagExp[Z.tagExp.length-1]!=="/")X++;G=Z.closeIndex}}}function dU($,U,G){if(U&&typeof $==="string"){const W=$.trim();if(W==="true")return!0;else if(W==="false")return!1;else return NJ($,G)}else if(xZ.isExist($))return $;else return""}var xZ=Z$(),U1=SZ(),qJ=bZ(),NJ=hZ();class vZ{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=PJ,this.parseXml=DJ,this.parseTextData=jJ,this.resolveNameSpace=SJ,this.buildAttributesMap=bJ,this.isItStopNode=cJ,this.replaceEntitiesValue=xJ,this.readStopNodeData=_J,this.saveTextToParentTag=vJ,this.addChild=hJ}}var kJ=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),DJ=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=H0($,">",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=uU($,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=H0($,"-->",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=qJ($,Z);this.docTypeEntities=Y.entities,Z=Y.i}else if($.substr(Z+1,2)==="!["){const Y=H0($,"]]>",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=uU($,Z,this.options.removeNSPrefix),w=Y.tagName;const Q=Y.rawTagName;let{tagExp:z,attrExpPresent:F,closeIndex:J}=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 I=G;if(I&&this.options.unpairedTags.indexOf(I.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 K="";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,J+1);if(!B)throw new Error(`Unexpected end of ${Q}`);Z=B.i,K=B.tagContent}const V=new U1(w);if(w!==z&&F)V[":@"]=this.buildAttributesMap(z,X,w);if(K)K=this.parseTextData(K,w,X,!0,F,!0,!0);X=X.substr(0,X.lastIndexOf(".")),V.add(this.options.textNodeName,K),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 K=new U1(w);if(w!==z&&F)K[":@"]=this.buildAttributesMap(z,X,w);this.addChild(G,K,X),X=X.substr(0,X.lastIndexOf("."))}else{const K=new U1(w);if(this.tagsNodeStack.push(G),w!==z&&F)K[":@"]=this.buildAttributesMap(z,X,w);this.addChild(G,K,X),G=K}W="",Z=J}}else W+=$[Z];return U.child},xJ=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 $};cZ.exports=vZ});var uZ=R((lJ)=>{function uJ($,U){return _Z($,U)}function _Z($,U,G){let W;const X={};for(let Z=0;Z<$.length;Z++){const L=$[Z],Y=dJ(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=_Z(L[Y],U,w);const z=pJ(Q,U);if(L[":@"])gJ(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 dJ($){const U=Object.keys($);for(let G=0;G<U.length;G++){const W=U[G];if(W!==":@")return W}}function gJ($,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 pJ($,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}lJ.prettify=uJ});var pZ=R((VA,gZ)=>{var{buildOptions:mJ}=NZ(),nJ=yZ(),{prettify:iJ}=uZ(),rJ=_U();class dZ{constructor($){this.externalEntities={},this.options=mJ($)}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=rJ.validate($,U);if(X!==!0)throw Error(`${X.err.msg}:${X.err.line}:${X.err.col}`)}const G=new nJ(this.options);G.addExternalEntities(this.externalEntities);const W=G.parseXml($);if(this.options.preserveOrder||W===void 0)return W;else return iJ(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 '
'");else if(U==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[$]=U}}gZ.exports=dZ});var iZ=R((HA,nZ)=>{function oJ($,U){let G="";if(U.format&&U.indentBy.length>0)G="\n";return sZ($,U,"",G)}function sZ($,U,G,W){let X="",Z=!1;for(let L=0;L<$.length;L++){const Y=$[L],w=aJ(Y);if(w===void 0)continue;let Q="";if(G.length===0)Q=w;else Q=`${G}.${w}`;if(w===U.textNodeName){let K=Y[w];if(!tJ(Q,U))K=U.tagValueProcessor(w,K),K=mZ(K,U);if(Z)X+=W;X+=K,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 K=lZ(Y[":@"],U),V=w==="?xml"?"":W;let B=Y[w][0][U.textNodeName];B=B.length!==0?" "+B:"",X+=V+`<${w}${B}${K}?>`,Z=!0;continue}let z=W;if(z!=="")z+=U.indentBy;const F=lZ(Y[":@"],U),J=W+`<${w}${F}`,I=sZ(Y[w],U,Q,z);if(U.unpairedTags.indexOf(w)!==-1)if(U.suppressUnpairedNode)X+=J+">";else X+=J+"/>";else if((!I||I.length===0)&&U.suppressEmptyNode)X+=J+"/>";else if(I&&I.endsWith(">"))X+=J+`>${I}${W}</${w}>`;else{if(X+=J+">",I&&W!==""&&(I.includes("/>")||I.includes("</")))X+=W+U.indentBy+I+W;else X+=I;X+=`</${w}>`}Z=!0}return X}function aJ($){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 lZ($,U){let G="";if($&&!U.ignoreAttributes)for(let W in $){if(!$.hasOwnProperty(W))continue;let X=U.attributeValueProcessor(W,$[W]);if(X=mZ(X,U),X===!0&&U.suppressBooleanAttributes)G+=` ${W.substr(U.attributeNamePrefix.length)}`;else G+=` ${W.substr(U.attributeNamePrefix.length)}="${X}"`}return G}function tJ($,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 mZ($,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 $}nZ.exports=oJ});var oZ=R((AA,rZ)=>{function w0($){if(this.options=Object.assign({},$3,$),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=W3;if(this.processTextOrObjNode=U3,this.options.format)this.indentate=G3,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""}function U3($,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 G3($){return this.options.indentBy.repeat($)}function W3($){if($.startsWith(this.options.attributeNamePrefix)&&$!==this.options.textNodeName)return $.substr(this.attrPrefixLen);else return!1}var eJ=iZ(),$3={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:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("\'","g"),val:"'"},{regex:new RegExp("\"","g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};w0.prototype.build=function($){if(this.options.preserveOrder)return eJ($,this.options);else{if(Array.isArray($)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)$={[this.options.arrayNodeName]:$};return this.j2x($,0).val}};w0.prototype.j2x=function($,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}};w0.prototype.buildAttrPairStr=function($,U){if(U=this.options.attributeValueProcessor($,""+U),U=this.replaceEntitiesValue(U),this.options.suppressBooleanAttributes&&U==="true")return" "+$;else return" "+$+'="'+U+'"'};w0.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}};w0.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};w0.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}};w0.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 $};rZ.exports=w0});var tZ=R((EA,aZ)=>{var X3=_U(),Z3=pZ(),L3=oZ();aZ.exports={XMLParser:Z3,XMLValidator:X3,XMLBuilder:L3}});var XL=R((TA,WL)=>{var{defineProperty:L$,getOwnPropertyDescriptor:Y3,getOwnPropertyNames:w3}=Object,Q3=Object.prototype.hasOwnProperty,c=($,U)=>L$($,"name",{value:U,configurable:!0}),z3=($,U)=>{for(var G in U)L$($,G,{get:U[G],enumerable:!0})},F3=($,U,G,W)=>{if(U&&typeof U==="object"||typeof U==="function"){for(let X of w3(U))if(!Q3.call($,X)&&X!==G)L$($,X,{get:()=>U[X],enumerable:!(W=Y3(U,X))||W.enumerable})}return $},J3=($)=>F3(L$({},"__esModule",{value:!0}),$),eZ={};z3(eZ,{_toBool:()=>K3,_toNum:()=>M3,_toStr:()=>I3,awsExpectUnion:()=>B3,loadRestJsonErrorCode:()=>A3,loadRestXmlErrorCode:()=>f3,parseJsonBody:()=>UL,parseJsonErrorBody:()=>H3,parseXmlBody:()=>GL,parseXmlErrorBody:()=>O3});WL.exports=J3(eZ);var I3=c(($)=>{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"),K3=c(($)=>{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"),M3=c(($)=>{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"),R3=N0(),B3=c(($)=>{if($==null)return;if(typeof $==="object"&&"__type"in $)delete $.__type;return R3.expectUnion($)},"awsExpectUnion"),V3=N0(),$L=c(($,U)=>V3.collectBody($,U).then((G)=>U.utf8Encoder(G)),"collectBodyString"),UL=c(($,U)=>$L($,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"),H3=c(async($,U)=>{const G=await UL($,U);return G.message=G.message??G.Message,G},"parseJsonErrorBody"),A3=c(($,U)=>{const G=c((Z,L)=>Object.keys(Z).find((Y)=>Y.toLowerCase()===L.toLowerCase()),"findKey"),W=c((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"),E3=N0(),T3=tZ(),GL=c(($,U)=>$L($,U).then((G)=>{if(G.length){const W=new T3.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 E3.getValueFromTextNode(Y)}return{}}),"parseXmlBody"),O3=c(async($,U)=>{const G=await GL($,U);if(G.Error)G.Error.message=G.Error.message??G.Error.Message;return G},"parseXmlErrorBody"),f3=c(($,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 q3=R((G1)=>{Object.defineProperty(G1,"__esModule",{value:!0});var gU=C3();gU.__exportStar(pX(),G1);gU.__exportStar(HZ(),G1);gU.__exportStar(XL(),G1)});var i=x(I$(),1),WI=i.default.v1,XI=i.default.v3,uG=i.default.v4,ZI=i.default.v5,LI=i.default.NIL,YI=i.default.version,wI=i.default.validate,QI=i.default.stringify,zI=i.default.parse;function II($){return $}var SY=($)=>(U)=>async(G)=>{if(!_.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)},kY={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},KI=($)=>({applyToStack:(U)=>{U.add(SY($),kY)}});var bY=()=>($,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:J,...I}=W.output;return L?.info?.({clientName:X,commandName:Z,input:z(G.input),output:F(I),metadata:J}),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}},DY={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},RI=($)=>({applyToStack:(U)=>{U.add(bY(),DY)}});var dG="X-Amzn-Trace-Id",hY="AWS_LAMBDA_FUNCTION_NAME",xY="_X_AMZN_TRACE_ID",vY=($)=>(U)=>async(G)=>{const{request:W}=G;if(!_.isInstance(W)||$.runtime!=="node"||W.headers.hasOwnProperty(dG))return U(G);const X=process.env[hY],Z=process.env[xY],L=(Y)=>typeof Y==="string"&&Y.length>0;if(L(X)&&L(Z))W.headers[dG]=Z;return U({...G,request:W})},cY={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},EI=($)=>({applyToStack:(U)=>{U.add(vY($),cY)}});function YK($){return{...$,customUserAgent:typeof $.customUserAgent==="string"?[[$.customUserAgent]]:$.customUserAgent}}class Gz{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 Wz=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=($)=>Wz.test($)||$.startsWith("[")&&$.endsWith("]");var Xz=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),o0=($,U=!1)=>{if(!U)return Xz.test($);const G=$.split(".");for(let W of G)if(!o0(W))return!1;return!0};var a0={};var $0="endpoints";function g($){if(typeof $!=="object"||$==null)return $;if("ref"in $)return`\$${g($.ref)}`;if("fn"in $)return`${$.fn}(${($.argv||[]).map(g).join(", ")})`;return JSON.stringify($,null,2)}class f extends Error{constructor($){super($);this.name="EndpointError"}}var eW=($,U)=>$===U;var $X=($)=>{const U=$.split("."),G=[];for(let W of U){const X=W.indexOf("[");if(X!==-1){if(W.indexOf("]")!==W.length-1)throw new f(`Path: '${$}' does not end with ']'`);const Z=W.slice(X+1,-1);if(Number.isNaN(parseInt(Z)))throw new f(`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 h1=($,U)=>$X(U).reduce((G,W)=>{if(typeof G!=="object")throw new f(`Index '${W}' in '${U}' not found in '${JSON.stringify($)}'`);else if(Array.isArray(G))return G[parseInt(W)];return G[W]},$);var UX=($)=>$!=null;var GX=($)=>!$;var x1=x(A0(),1);var QU={[x1.EndpointURLScheme.HTTP]:80,[x1.EndpointURLScheme.HTTPS]:443},WX=($)=>{const U=(()=>{try{if($ instanceof URL)return $;if(typeof $==="object"&&"hostname"in $){const{hostname:J,port:I,protocol:K="",path:V="",query:B={}}=$,H=new URL(`${K}//${J}${I?`:${I}`:""}${V}`);return H.search=Object.entries(B).map(([A,E])=>`${A}=${E}`).join("&"),H}return new URL($)}catch(J){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(x1.EndpointURLScheme).includes(w))return null;const Q=r0(X),z=G.includes(`${W}:${QU[w]}`)||typeof $==="string"&&$.includes(`${W}:${QU[w]}`),F=`${W}${z?`:${QU[w]}`:""}`;return{scheme:w,authority:F,path:Z,normalizedPath:Z.endsWith("/")?Z:`${Z}/`,isIp:Q}};var XX=($,U)=>$===U;var ZX=($,U,G,W)=>{if(U>=G||$.length<G)return null;if(!W)return $.substring(U,G);return $.substring($.length-G,$.length-U)};var LX=($)=>encodeURIComponent($).replace(/[!*'()]/g,(U)=>`%${U.charCodeAt(0).toString(16).toUpperCase()}`);var YX={booleanEquals:eW,getAttr:h1,isSet:UX,isValidHostLabel:o0,not:GX,parseURL:WX,stringEquals:XX,substring:ZX,uriEncode:LX};var v1=($,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(h1(W[w],Q))}else G.push(W[Y]);X=L+1}return G.join("")};var wX=({ref:$},U)=>{return{...U.endpointParams,...U.referenceRecord}[$]};var Z0=($,U,G)=>{if(typeof $==="string")return v1($,G);else if($.fn)return c1($,G);else if($.ref)return wX($,G);throw new f(`'${U}': ${String($)} is not a string, function or reference.`)};var c1=({fn:$,argv:U},G)=>{const W=U.map((Z)=>["boolean","number"].includes(typeof Z)?Z:Z0(Z,"arg",G)),X=$.split(".");if(X[0]in a0&&X[1]!=null)return a0[X[0]][X[1]](...W);return YX[$](...W)};var QX=({assign:$,...U},G)=>{if($&&$ in G.referenceRecord)throw new f(`'${$}' is already defined in Reference Record.`);const W=c1(U,G);return G.logger?.debug?.(`${$0} evaluateCondition: ${g(U)} = ${g(W)}`),{result:W===""?!0:!!W,...$!=null&&{toAssign:{name:$,value:W}}}};var j0=($=[],U)=>{const G={};for(let W of $){const{result:X,toAssign:Z}=QX(W,{...U,referenceRecord:{...U.referenceRecord,...G}});if(!X)return{result:X};if(Z)G[Z.name]=Z.value,U.logger?.debug?.(`${$0} assign: ${Z.name} := ${g(Z.value)}`)}return{result:!0,referenceRecord:G}};var zX=($,U)=>Object.entries($).reduce((G,[W,X])=>({...G,[W]:X.map((Z)=>{const L=Z0(Z,"Header value entry",U);if(typeof L!=="string")throw new f(`Header '${W}' value '${L}' is not a string`);return L})}),{});var zU=($,U)=>{if(Array.isArray($))return $.map((G)=>zU(G,U));switch(typeof $){case"string":return v1($,U);case"object":if($===null)throw new f(`Unexpected endpoint property: ${$}`);return y1($,U);case"boolean":return $;default:throw new f(`Unexpected endpoint property type: ${typeof $}`)}};var y1=($,U)=>Object.entries($).reduce((G,[W,X])=>({...G,[W]:zU(X,U)}),{});var FX=($,U)=>{const G=Z0($,"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 f(`Endpoint URL must be a string, got ${typeof G}`)};var JX=($,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?.(`${$0} Resolving endpoint from template: ${g(W)}`),{...Q!=null&&{headers:zX(Q,L)},...w!=null&&{properties:y1(w,L)},url:FX(Y,L)}};var IX=($,U)=>{const{conditions:G,error:W}=$,{result:X,referenceRecord:Z}=j0(G,U);if(!X)return;throw new f(Z0(W,"Error",{...U,referenceRecord:{...U.referenceRecord,...Z}}))};var KX=($,U)=>{const{conditions:G,rules:W}=$,{result:X,referenceRecord:Z}=j0(G,U);if(!X)return;return _1(W,{...U,referenceRecord:{...U.referenceRecord,...Z}})};var _1=($,U)=>{for(let G of $)if(G.type==="endpoint"){const W=JX(G,U);if(W)return W}else if(G.type==="error")IX(G,U);else if(G.type==="tree"){const W=KX(G,U);if(W)return W}else throw new f(`Unknown endpoint rule: ${G}`);throw new f("Rules evaluation failed")};var Zz=($,U)=>{const{endpointParams:G,logger:W}=U,{parameters:X,rules:Z}=$;U.logger?.debug?.(`${$0} Initial EndpointParams: ${g(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 f(`Missing required parameter: '${Q}'`);const w=_1(Z,{endpointParams:G,logger:W,referenceRecord:{}});return U.logger?.debug?.(`${$0} Resolved endpoint: ${g(w)}`),w};var FU=($,U=!1)=>{if(U){for(let G of $.split("."))if(!FU(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 MX=($)=>{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 RX={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 Yz=RX,wz="",BX=($)=>{const{partitions:U}=Yz;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 VX=()=>wz;var Qz={isVirtualHostableS3Bucket:FU,parseArn:MX,partition:BX};a0.aws=Qz;var JU="user-agent",u1="x-amz-user-agent",IU=" ",d1="/",HX=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,AX=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,KU="-";var zz=($)=>(U,G)=>async(W)=>{const{request:X}=W;if(!_.isInstance(X))return U(W);const{headers:Z}=X,L=G?.userAgent?.map(MU)||[],Y=(await $.defaultUserAgentProvider()).map(MU),w=$?.customUserAgent?.map(MU)||[],Q=VX(),z=(Q?[Q]:[]).concat([...Y,...L,...w]).join(IU),F=[...Y.filter((J)=>J.startsWith("aws-sdk-")),...w].join(IU);if($.runtime!=="browser"){if(F)Z[u1]=Z[u1]?`${Z[JU]} ${F}`:F;Z[JU]=z}else Z[u1]=z;return U({...W,request:X})},MU=($)=>{const U=$[0].split(d1).map((L)=>L.replace(HX,KU)).join(d1),G=$[1]?.replace(AX,KU),W=U.indexOf(d1),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}`}},"")},Fz={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},gR=($)=>({applyToStack:(U)=>{U.add(zz($),Fz)}});var g1=($)=>typeof $==="string"&&($.startsWith("fips-")||$.endsWith("-fips"));var RU=($)=>g1($)?["fips-aws-global","aws-fips"].includes($)?"us-east-1":$.replace(/fips-(dkr-|prod-)?|-fips/,""):$;var tR=($)=>{const{region:U,useFipsEndpoint:G}=$;if(!U)throw new Error("Region is missing");return{...$,region:async()=>{if(typeof U==="string")return RU(U);const W=await U();return RU(W)},useFipsEndpoint:async()=>{const W=typeof U==="string"?U:await U();if(g1(W))return!0;return typeof G!=="function"?Promise.resolve(!!G):G()}}};var S0=($,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 L0;(function($){$.ENV="env",$.CONFIG="shared config entry"})(L0||(L0={}));var Jz="AWS_USE_DUALSTACK_ENDPOINT",Iz="use_dualstack_endpoint";var wB={environmentVariableSelector:($)=>S0($,Jz,L0.ENV),configFileSelector:($)=>S0($,Iz,L0.CONFIG),default:!1};var Kz="AWS_USE_FIPS_ENDPOINT",Mz="use_fips_endpoint";var FB={environmentVariableSelector:($)=>S0($,Kz,L0.ENV),configFileSelector:($)=>S0($,Mz,L0.CONFIG),default:!1};var Rz=x(r(),1);var Bz=x(r(),1);var EX={environmentVariableSelector:($)=>$.AWS_REGION,configFileSelector:($)=>$.region,default:()=>{throw new Error("Region is missing")}},OB={preferredFile:"credentials"};function Vz($){return(U)=>async(G)=>{const W=G.request;if(_.isInstance(W)){const{body:X,headers:Z}=W;if(X&&Object.keys(Z).map((L)=>L.toLowerCase()).indexOf(TX)===-1)try{const L=$(X);W.headers={...W.headers,[TX]:String(L)}}catch(L){}}return U({...G,request:W})}}var TX="content-length",Hz={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},oB=($)=>({applyToStack:(U)=>{U.add(Vz($.bodyLengthChecker),Hz)}});var OX=($,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 fX=($,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 GV($,U,G){return{applyToStack:(W)=>{W.add(OX($,G),Az),W.add(fX($,U),BU)}}}var Az={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},BU={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};var kX=x(r(),1);var CX=async($)=>{const U=$?.Bucket||"";if(typeof $.Bucket==="string")$.Bucket=U.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(Cz(U)){if($.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!fz(U)||U.indexOf(".")!==-1&&!String($.Endpoint).startsWith("http:")||U.toLowerCase()!==U||U.length<3)$.ForcePathStyle=!0;if($.DisableMultiRegionAccessPoints)$.disableMultiRegionAccessPoints=!0,$.DisableMRAP=!0;return $},Ez=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Tz=/(\d+\.){3}\d+/,Oz=/\.\./;var fz=($)=>Ez.test($)&&!Tz.test($)&&!Oz.test($),Cz=($)=>{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 qX=($,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 NX="AWS_ENDPOINT_URL",PX="endpoint_url",jX=($)=>({environmentVariableSelector:(U)=>{const G=$.split(" ").map((Z)=>Z.toUpperCase()),W=U[[NX,...G].join("_")];if(W)return W;const X=U[NX];if(X)return X;return},configFileSelector:(U,G)=>{if(G&&U.services){const X=G[["services",U.services].join(VU)];if(X){const Z=$.split(" ").map((Y)=>Y.toLowerCase()),L=X[[Z.join("_"),PX].join(VU)];if(L)return L}}const W=U[PX];if(W)return W;return},default:void 0});var p1=async($)=>M0(jX($??""))();var HU=x(N8(),1),l1=($)=>{if(typeof $==="object"){if("url"in $)return HU.parseUrl($.url);return $}return HU.parseUrl($)};var SX=async($,U,G,W)=>{if(!G.endpoint){let L;if(G.serviceConfiguredEndpoint)L=await G.serviceConfiguredEndpoint();else L=await p1(G.serviceId);if(L)G.endpoint=()=>Promise.resolve(l1(L))}const X=await qz($,U,G);if(typeof G.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return G.endpointProvider(X,W)},qz=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 qX(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 CX(W);return W};var bX=({config:$,instructions:U})=>{return(G,W)=>async(X)=>{const Z=await SX(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=kX.getSmithyContext(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 Nz={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:BU.name},NV=($,U)=>({applyToStack:(G)=>{G.addRelativeTo(bX({config:$,instructions:U}),Nz)}});var s1=x(r(),1);var kV=($)=>{const U=$.tls??!0,{endpoint:G}=$,W=G!=null?async()=>l1(await s1.normalizeProvider(G)()):void 0,Z={...$,endpoint:W,tls:U,isCustomEndpoint:!!G,useDualstackEndpoint:s1.normalizeProvider($.useDualstackEndpoint??!1),useFipsEndpoint:s1.normalizeProvider($.useFipsEndpoint??!1)};let L=void 0;return Z.serviceConfiguredEndpoint=async()=>{if($.serviceId&&!L)L=p1($.serviceId);return L},Z};var qU=x(r(),1);var p;(function($){$.STANDARD="standard",$.ADAPTIVE="adaptive"})(p||(p={}));var R0=3,DX=p.STANDARD;var hX=x(F0(),1);class m1{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(),hX.isThrottlingError($)){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,AU=500,n1=500,EU=5,TU=10,OU=1,i1="amz-sdk-invocation-id",r1="amz-sdk-request";var xX=()=>{let $=B0;return{computeNextBackoffDelay:(W)=>{return Math.floor(Math.min(t0,Math.random()*2**W*$))},setDelayBase:(W)=>{$=W}}};var fU=({retryDelay:$,retryCount:U,retryCost:G})=>{return{getRetryCount:()=>U,getRetryDelay:()=>Math.min(t0,$),getRetryCost:()=>G}};class k0{constructor($){this.maxAttempts=$,this.mode=p.STANDARD,this.capacity=n1,this.retryBackoffStrategy=xX(),this.maxAttemptsProvider=typeof $==="function"?$:async()=>$}async acquireInitialRetryToken($){return fU({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"?AU: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,fU({retryDelay:Z,retryCount:$.getRetryCount()+1,retryCost:L})}throw new Error("No retry token available")}recordSuccess($){this.capacity=Math.max(n1,this.capacity+($.getRetryCost()??OU))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch($){return console.warn(`Max attempts provider could not resolve. Using default of ${R0}`),R0}}shouldRetry($,U,G){return $.getRetryCount()+1<G&&this.capacity>=this.getCapacityCost(U.errorType)&&this.isRetryableError(U.errorType)}getCapacityCost($){return $==="TRANSIENT"?TU:EU}isRetryableError($){return $==="THROTTLING"||$==="TRANSIENT"}}class CU{constructor($,U){this.maxAttemptsProvider=$,this.mode=p.ADAPTIVE;const{rateLimiter:G}=U??{};this.rateLimiter=G??new m1,this.standardRetryStrategy=new k0($)}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 vX="AWS_MAX_ATTEMPTS",cX="max_attempts",RH={environmentVariableSelector:($)=>{const U=$[vX];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Environment variable ${vX} mast be a number, got "${U}"`);return G},configFileSelector:($)=>{const U=$[cX];if(!U)return;const G=parseInt(U);if(Number.isNaN(G))throw new Error(`Shared config file entry ${cX} mast be a number, got "${U}"`);return G},default:R0},BH=($)=>{const{retryStrategy:U}=$,G=qU.normalizeProvider($.maxAttempts??R0);return{...$,maxAttempts:G,retryStrategy:async()=>{if(U)return U;if(await qU.normalizeProvider($.retryMode)()===p.ADAPTIVE)return new CU(G);return new k0(G)}}},Pz="AWS_RETRY_MODE",jz="retry_mode",VH={environmentVariableSelector:($)=>$[Pz],configFileSelector:($)=>$[jz],default:DX};var b0=x(F0(),1);import{Readable as Sz}from"stream";var yX=($)=>$?.body instanceof Sz||typeof ReadableStream!=="undefined"&&$?.body instanceof ReadableStream;var NU=($)=>{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 kz=($)=>(U,G)=>async(W)=>{let X=await $.retryStrategy();const Z=await $.maxAttempts();if(bz(X)){X=X;let L=await X.acquireInitialRetryToken(G.partition_id),Y=new Error,w=0,Q=0;const{request:z}=W,F=_.isInstance(z);if(F)z.headers[i1]=uG();while(!0)try{if(F)z.headers[r1]=`attempt=${w+1}; max=${Z}`;const{response:J,output:I}=await U(W);return X.recordSuccess(L),I.$metadata.attempts=w+1,I.$metadata.totalRetryDelay=Q,{response:J,output:I}}catch(J){const I=Dz(J);if(Y=NU(J),F&&yX(z))throw(G.logger instanceof _X?console:G.logger)?.warn("An error was encountered in a non-retryable streaming request."),Y;try{L=await X.refreshRetryTokenForRetry(L,I)}catch(V){if(!Y.$metadata)Y.$metadata={};throw Y.$metadata.attempts=w+1,Y.$metadata.totalRetryDelay=Q,Y}w=L.getRetryCount();const K=L.getRetryDelay();Q+=K,await new Promise((V)=>setTimeout(V,K))}}else{if(X=X,X?.mode)G.userAgent=[...G.userAgent||[],["cfg/retry-mode",X.mode]];return X.retry(U,W)}},bz=($)=>typeof $.acquireInitialRetryToken!=="undefined"&&typeof $.refreshRetryTokenForRetry!=="undefined"&&typeof $.recordSuccess!=="undefined",Dz=($)=>{const U={error:$,errorType:hz($)},G=vz($.$response);if(G)U.retryAfterHint=G;return U},hz=($)=>{if(b0.isThrottlingError($))return"THROTTLING";if(b0.isTransientError($))return"TRANSIENT";if(b0.isServerError($))return"SERVER_ERROR";return"CLIENT_ERROR"},xz={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},jH=($)=>({applyToStack:(U)=>{U.add(kz($),xz)}}),vz=($)=>{if(!PU.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)};var cz=x(F0(),1);var o1=x(F0(),1);import{platform as N3,release as P3}from"os";import{env as LL,versions as j3}from"process";var pU={isCrtAvailable:!1};var ZL=()=>{if(pU.isCrtAvailable)return["md/crt-avail"];return null};var S3="AWS_SDK_UA_APP_ID",k3="sdk-ua-app-id",kA=({serviceId:$,clientVersion:U})=>{const G=[["aws-sdk-js",U],["ua","2.0"],[`os/${N3()}`,P3()],["lang/js"],["md/nodejs",`${j3.node}`]],W=ZL();if(W)G.push(W);if($)G.push([`api/${$}`,U]);if(LL.AWS_EXECUTION_ENV)G.push([`exec-env/${LL.AWS_EXECUTION_ENV}`]);const X=M0({environmentVariableSelector:(L)=>L[S3],configFileSelector:(L)=>L[k3],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 b3}from"buffer";import{createHash as D3,createHmac as h3}from"crypto";function YL($,U){if(b3.isBuffer($))return $;if(typeof $==="string")return wL($,U);if(ArrayBuffer.isView($))return lU($.buffer,$.byteOffset,$.byteLength);return lU($)}class x3{constructor($,U){this.algorithmIdentifier=$,this.secret=U,this.reset()}update($,U){this.hash.update(QL(YL($,U)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?h3(this.algorithmIdentifier,YL(this.secret)):D3(this.algorithmIdentifier)}}import{fstatSync as v3,lstatSync as c3}from"fs";var uA=($)=>{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 c3($.path).size;else if(typeof $.fd==="number")return v3($.fd).size;throw new Error(`Body Length computation failed for ${$}`)};var ML=x(T$(),1);var zL="AWS_EXECUTION_ENV",sU="AWS_REGION",mU="AWS_DEFAULT_REGION",FL="AWS_EC2_METADATA_DISABLED",JL=["in-region","cross-region","mobile","standard","legacy"],IL="/latest/meta-data/placement/region";var KL={environmentVariableSelector:($)=>{return $.AWS_DEFAULTS_MODE},configFileSelector:($)=>{return $.defaults_mode},default:"legacy"};var oA=({region:$=M0(EX),defaultsMode:U=M0(KL)}={})=>ML.memoize(async()=>{const G=typeof U==="function"?await U():U;switch(G?.toLowerCase()){case"auto":return y3($);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 ${JL.join(", ")}, got ${G}`)}}),y3=async($)=>{if($){const U=typeof $==="function"?await $():$,G=await _3();if(!G)return"standard";if(U===G)return"in-region";else return"cross-region"}return"standard"},_3=async()=>{if(process.env[zL]&&(process.env[sU]||process.env[mU]))return process.env[sU]??process.env[mU];if(!process.env[FL])try{const{getInstanceMetadataEndpoint:$,httpRequest:U}=await import("./chunk-bh8r9220.js"),G=await $();return(await U({...G,path:IL})).toString()}catch($){}};var $E=($)=>{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}}},UE=($)=>{return{region:$.region()}};export{uG as T,r as U,II as V,KI as W,RI as X,EI as Y,S0 as Z,L0 as _,wU as $,YK as aa,Gz as ba,a0 as ca,Zz as da,Qz as ea,gR as fa,wB as ga,FB as ha,EX as ia,OB as ja,tR as ka,oB as la,qz as ma,GV as na,NV as oa,kV as pa,DX as qa,RH as ra,BH as sa,VH as ta,jH as ua,q3 as va,kA as wa,x3 as xa,uA as ya,oA as za,$E as Aa,UE as Ba};
|
|
19
|
-
|
|
20
|
-
//# debugId=EF187C8A0D2F34D064756E2164756E21
|
package/dist/chunk-b3y9gq5a.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I as _}from"./chunk-td079vg9.js";import"./chunk-cm1wsxdn.js";import{Bb as y}from"./chunk-kqs3rmad.js";import{Eb as K,Kb as S}from"./chunk-en3dm124.js";var o=_(y(),1);import{exec as A}from"child_process";import{promisify as T}from"util";var i=(c,n,s)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){const t=new Date;if(new Date(n.Expiration)<t)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let e=n.AccountId;if(!e&&s?.[c]?.aws_account_id)e=s[c].aws_account_id;return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...e&&{accountId:e}}};var x=async(c,n,s)=>{const e=n[c];if(n[c]){const t=e.credential_process;if(t!==void 0){const u=T(A);try{const{stdout:r}=await u(t);let w;try{w=JSON.parse(r.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return i(c,w,n)}catch(r){throw new o.CredentialsProviderError(r.message,{logger:s})}}else throw new o.CredentialsProviderError(`Profile ${c} did not contain credential_process.`,{logger:s})}else throw new o.CredentialsProviderError(`Profile ${c} could not be found in shared credentials file.`,{logger:s})};var b=(c={})=>async()=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const n=await S(c);return x(K(c),n,c.logger)};export{b as fromProcess};
|
|
3
|
-
|
|
4
|
-
//# debugId=0D297D83F714B66F64756E2164756E21
|
package/dist/chunk-bh8r9220.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{I as f}from"./chunk-td079vg9.js";import"./chunk-cm1wsxdn.js";import{Ab as K,zb as cc}from"./chunk-xqknth7r.js";import{Bb as D}from"./chunk-kqs3rmad.js";import"./chunk-en3dm124.js";var z=f(D(),1);import{parse as o}from"url";var _=f(D(),1);import{Buffer as a}from"buffer";import{request as n}from"http";function u(c){return new Promise((I,x)=>{const T=n({method:"GET",...c,hostname:c.hostname?.replace(/^\[(.+)\]$/,"$1")});T.on("error",(N)=>{x(Object.assign(new _.ProviderError("Unable to connect to instance metadata service"),N)),T.destroy()}),T.on("timeout",()=>{x(new _.ProviderError("TimeoutError from instance metadata service")),T.destroy()}),T.on("response",(N)=>{const{statusCode:O=400}=N;if(O<200||300<=O)x(Object.assign(new _.ProviderError("Error response received from instance metadata service"),{statusCode:O})),T.destroy();const E=[];N.on("data",(y)=>{E.push(y)}),N.on("end",()=>{I(a.concat(E)),T.destroy()})}),T.end()})}var G=(c)=>Boolean(c)&&typeof c==="object"&&typeof c.AccessKeyId==="string"&&typeof c.SecretAccessKey==="string"&&typeof c.Token==="string"&&typeof c.Expiration==="string",Q=(c)=>({accessKeyId:c.AccessKeyId,secretAccessKey:c.SecretAccessKey,sessionToken:c.Token,expiration:new Date(c.Expiration),...c.AccountId&&{accountId:c.AccountId}});var Ec=1000,$c=0,X=({maxRetries:c=0,timeout:I=1000})=>({maxRetries:c,timeout:I});var m=(c,I)=>{let x=c();for(let T=0;T<I;T++)x=x.catch(c);return x};var v="AWS_CONTAINER_CREDENTIALS_FULL_URI",L="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",B="AWS_CONTAINER_AUTHORIZATION_TOKEN",_c=(c={})=>{const{timeout:I,maxRetries:x}=X(c);return()=>m(async()=>{const T=await d({logger:c.logger}),N=JSON.parse(await s(I,T));if(!G(N))throw new z.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:c.logger});return Q(N)},x)},s=async(c,I)=>{if(process.env[B])I.headers={...I.headers,Authorization:process.env[B]};return(await u({...I,timeout:c})).toString()},g="169.254.170.2",l={localhost:!0,"127.0.0.1":!0},r={"http:":!0,"https:":!0},d=async({logger:c})=>{if(process.env[L])return{hostname:g,path:process.env[L]};if(process.env[v]){const I=o(process.env[v]);if(!I.hostname||!(I.hostname in l))throw new z.CredentialsProviderError(`${I.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:c});if(!I.protocol||!(I.protocol in r))throw new z.CredentialsProviderError(`${I.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:c});return{...I,port:I.port?parseInt(I.port,10):void 0}}throw new z.CredentialsProviderError(`The container metadata credential provider cannot be used unless the ${L} or ${v} environment variable is set`,{tryNextLink:!1,logger:c})};var q=f(D(),1);var U=f(D(),1);class Z extends U.CredentialsProviderError{constructor(c,I=!0){super(c,I);this.tryNextLink=I,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Z.prototype)}}var P=f(cc(),1);var A;(function(c){c.IPv4="http://169.254.169.254",c.IPv6="http://[fd00:ec2::254]"})(A||(A={}));var t={environmentVariableSelector:(c)=>c.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(c)=>c.ec2_metadata_service_endpoint,default:void 0};var S;(function(c){c.IPv4="IPv4",c.IPv6="IPv6"})(S||(S={}));var e="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",i="ec2_metadata_service_endpoint_mode",F={environmentVariableSelector:(c)=>c[e],configFileSelector:(c)=>c[i],default:S.IPv4};var W=async()=>P.parseUrl(await Ic()||await Tc()),Ic=async()=>K(t)(),Tc=async()=>{const c=await K(F)();switch(c){case S.IPv4:return A.IPv4;case S.IPv6:return A.IPv6;default:throw new Error(`Unsupported endpoint mode: ${c}. Select from ${Object.values(S)}`)}};var b=(c,I)=>{const x=300+Math.floor(Math.random()*300),T=new Date(Date.now()+x*1000);I.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(T)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const N=c.originalExpiration??c.expiration;return{...c,...N?{originalExpiration:N}:{},expiration:T}};var V=(c,I={})=>{const x=I?.logger||console;let T;return async()=>{let N;try{if(N=await c(),N.expiration&&N.expiration.getTime()<Date.now())N=b(N,x)}catch(O){if(T)x.warn("Credential renew failed: ",O),N=b(T,x);else throw O}return T=N,N}};var k="/latest/meta-data/iam/security-credentials/",Nc="/latest/api/token",H="AWS_EC2_METADATA_V1_DISABLED",R="ec2_metadata_v1_disabled",M="x-aws-ec2-metadata-token",oc=(c={})=>V(xc(c),{logger:c.logger}),xc=(c={})=>{let I=!1;const{logger:x,profile:T}=c,{timeout:N,maxRetries:O}=X(c),E=async(y,$)=>{if(I||$.headers?.[M]==null){let w=!1,h=!1;const C=await K({environmentVariableSelector:(Y)=>{const j=Y[H];if(h=!!j&&j!=="false",j===void 0)throw new q.CredentialsProviderError(`${H} not set in env, checking config file next.`,{logger:c.logger});return h},configFileSelector:(Y)=>{const j=Y[R];return w=!!j&&j!=="false",w},default:!1},{profile:T})();if(c.ec2MetadataV1Disabled||C){const Y=[];if(c.ec2MetadataV1Disabled)Y.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(w)Y.push(`config file profile (${R})`);if(h)Y.push(`process environment variable (${H})`);throw new Z(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Y.join(", ")}].`)}}const p=(await m(async()=>{let w;try{w=await yc($)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)).trim();return m(async()=>{let w;try{w=await wc(p,$,c)}catch(h){if(h.statusCode===401)I=!1;throw h}return w},y)};return async()=>{const y=await W();if(I)return x?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),E(O,{...y,timeout:N});else{let $;try{$=(await Oc({...y,timeout:N})).toString()}catch(J){if(J?.statusCode===400)throw Object.assign(J,{message:"EC2 Metadata token request returned error"});else if(J.message==="TimeoutError"||[403,404,405].includes(J.statusCode))I=!0;return x?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),E(O,{...y,timeout:N})}return E(O,{...y,headers:{[M]:$},timeout:N})}}},Oc=async(c)=>u({...c,path:Nc,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),yc=async(c)=>(await u({...c,path:k})).toString(),wc=async(c,I,x)=>{const T=JSON.parse((await u({...I,path:k+c})).toString());if(!G(T))throw new q.CredentialsProviderError("Invalid response received from instance metadata service.",{logger:x.logger});return Q(T)};export{X as providerConfigFromInit,u as httpRequest,W as getInstanceMetadataEndpoint,oc as fromInstanceMetadata,_c as fromContainerMetadata,A as Endpoint,L as ENV_CMDS_RELATIVE_URI,v as ENV_CMDS_FULL_URI,B as ENV_CMDS_AUTH_TOKEN,Ec as DEFAULT_TIMEOUT,$c as DEFAULT_MAX_RETRIES};
|
|
3
|
-
|
|
4
|
-
//# debugId=712A29CDFFA2EED164756E2164756E21
|