dispach 0.2.0 → 0.2.2
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/README.md +144 -49
- package/dist/APEv2Parser-etzjd528.js +5 -0
- package/dist/{FlacParser-6jwner07.js.map → APEv2Parser-etzjd528.js.map} +1 -1
- package/dist/{AiffParser-n65syezh.js → AiffParser-y21k3fak.js} +3 -3
- package/dist/{AiffParser-n65syezh.js.map → AiffParser-y21k3fak.js.map} +1 -1
- package/dist/App-4w3qkcs4.js +11 -0
- package/dist/{App-pmqmzsb3.js.map → App-4w3qkcs4.js.map} +1 -1
- package/dist/{AsfParser-da1fqvxz.js → AsfParser-wd98k2h4.js} +3 -3
- package/dist/{AsfParser-da1fqvxz.js.map → AsfParser-wd98k2h4.js.map} +1 -1
- package/dist/{ConfigEditor-4nqbeejh.js → ConfigEditor-vk7vxaa6.js} +3 -3
- package/dist/{ConfigEditor-4nqbeejh.js.map → ConfigEditor-vk7vxaa6.js.map} +1 -1
- package/dist/{DsdiffParser-gk95sj7t.js → DsdiffParser-cbfaj500.js} +3 -3
- package/dist/{DsdiffParser-gk95sj7t.js.map → DsdiffParser-cbfaj500.js.map} +1 -1
- package/dist/{DsfParser-b0enevjw.js → DsfParser-tybrja4x.js} +3 -3
- package/dist/{DsfParser-b0enevjw.js.map → DsfParser-tybrja4x.js.map} +1 -1
- package/dist/FlacParser-7t7da7qy.js +5 -0
- package/dist/{APEv2Parser-jdp5yp24.js.map → FlacParser-7t7da7qy.js.map} +1 -1
- package/dist/{KeyProbe-rspsxpsr.js → KeyProbe-5anphmb7.js} +3 -3
- package/dist/{KeyProbe-rspsxpsr.js.map → KeyProbe-5anphmb7.js.map} +1 -1
- package/dist/{MP4Parser-ph7rv2fn.js → MP4Parser-gc94h1n9.js} +3 -3
- package/dist/{MP4Parser-ph7rv2fn.js.map → MP4Parser-gc94h1n9.js.map} +1 -1
- package/dist/{MatroskaParser-fjk1mpct.js → MatroskaParser-cy2k4fac.js} +3 -3
- package/dist/{MatroskaParser-fjk1mpct.js.map → MatroskaParser-cy2k4fac.js.map} +1 -1
- package/dist/{MpegParser-vp7cj8ts.js → MpegParser-c460fwf0.js} +3 -3
- package/dist/{MpegParser-vp7cj8ts.js.map → MpegParser-c460fwf0.js.map} +1 -1
- package/dist/{MusepackParser-v22gft1f.js → MusepackParser-8mq2eabg.js} +3 -3
- package/dist/{MusepackParser-v22gft1f.js.map → MusepackParser-8mq2eabg.js.map} +1 -1
- package/dist/OggParser-7dnc6apg.js +5 -0
- package/dist/{OggParser-as1m8xsa.js.map → OggParser-7dnc6apg.js.map} +1 -1
- package/dist/Picker-j7txnm7w.js +5 -0
- package/dist/{Picker-jkmd5xnx.js.map → Picker-j7txnm7w.js.map} +1 -1
- package/dist/SessionPicker-hpv2ncsb.js +5 -0
- package/dist/{SessionPicker-3712ke3k.js.map → SessionPicker-hpv2ncsb.js.map} +3 -3
- package/dist/SkillBrowser-qc542n71.js +5 -0
- package/dist/{SkillBrowser-qhsyszt4.js.map → SkillBrowser-qc542n71.js.map} +1 -1
- package/dist/{WavPackParser-b4qqavzg.js → WavPackParser-kt7cds9c.js} +3 -3
- package/dist/{WavPackParser-b4qqavzg.js.map → WavPackParser-kt7cds9c.js.map} +1 -1
- package/dist/{WaveParser-fqs1h38f.js → WaveParser-g47ja0vy.js} +3 -3
- package/dist/{WaveParser-fqs1h38f.js.map → WaveParser-g47ja0vy.js.map} +1 -1
- package/dist/WizardApp-q4p979d1.js +5 -0
- package/dist/{WizardApp-qrq36nv8.js.map → WizardApp-q4p979d1.js.map} +3 -3
- package/dist/{channels-gf31stv7.js → channels-4t89qpdt.js} +18 -18
- package/dist/{channels-gf31stv7.js.map → channels-4t89qpdt.js.map} +1 -1
- package/dist/client.d.ts +242 -1
- package/dist/client.js +11 -11
- package/dist/client.js.map +5 -5
- package/dist/config-35r6n1gh.js +24 -0
- package/dist/{config-z2cd0c5f.js.map → config-35r6n1gh.js.map} +1 -1
- package/dist/credential-dpdgg4j6.js +19 -0
- package/dist/{credential-h0wmsjsw.js.map → credential-dpdgg4j6.js.map} +1 -1
- package/dist/{index-3s2q0m64.js → index-0444sh6x.js} +4 -4
- package/dist/{index-3s2q0m64.js.map → index-0444sh6x.js.map} +1 -1
- package/dist/{index-v271gbaz.js → index-095hrkyr.js} +6 -6
- package/dist/{index-v271gbaz.js.map → index-095hrkyr.js.map} +1 -1
- package/dist/index-1x8mzvz7.js +6 -0
- package/dist/{index-rhv6gqpt.js.map → index-1x8mzvz7.js.map} +1 -1
- package/dist/index-2bsardvh.js +5 -0
- package/dist/{index-tny7c703.js.map → index-2bsardvh.js.map} +2 -2
- package/dist/{index-9m6b14b4.js → index-2zjh5zd5.js} +4 -4
- package/dist/{index-9m6b14b4.js.map → index-2zjh5zd5.js.map} +1 -1
- package/dist/{index-t6xnecdx.js → index-323jvr1g.js} +4 -4
- package/dist/{index-t6xnecdx.js.map → index-323jvr1g.js.map} +1 -1
- package/dist/{index-gace5ac7.js → index-3826kf9t.js} +5 -5
- package/dist/{index-gace5ac7.js.map → index-3826kf9t.js.map} +1 -1
- package/dist/index-38gs9anh.js +9 -0
- package/dist/{index-b7qc21s7.js.map → index-38gs9anh.js.map} +1 -1
- package/dist/index-3c5jt6by.js +5 -0
- package/dist/{index-3mvenfbg.js.map → index-3c5jt6by.js.map} +2 -2
- package/dist/{index-k2q76dhw.js → index-3vzf253k.js} +7 -7
- package/dist/{index-k2q76dhw.js.map → index-3vzf253k.js.map} +1 -1
- package/dist/{index-t5d8ey5t.js → index-42e29zs4.js} +4 -4
- package/dist/{index-t5d8ey5t.js.map → index-42e29zs4.js.map} +1 -1
- package/dist/{index-v7mz396x.js → index-4fj1k64j.js} +4 -4
- package/dist/{index-v7mz396x.js.map → index-4fj1k64j.js.map} +1 -1
- package/dist/{index-gqbny9gy.js → index-51x0n5z0.js} +6 -6
- package/dist/{index-gqbny9gy.js.map → index-51x0n5z0.js.map} +1 -1
- package/dist/index-664xcamy.js +110 -0
- package/dist/index-664xcamy.js.map +13 -0
- package/dist/index-7mn8ack9.js +6 -0
- package/dist/{index-qe3ybzh6.js.map → index-7mn8ack9.js.map} +2 -2
- package/dist/index-8edck2pr.js +6 -0
- package/dist/{index-kktaw552.js.map → index-8edck2pr.js.map} +1 -1
- package/dist/index-8h6kewy1.js +9 -0
- package/dist/{index-s4a28ctb.js.map → index-8h6kewy1.js.map} +1 -1
- package/dist/index-8tmv33mr.js +6 -0
- package/dist/{index-v6taf4vn.js.map → index-8tmv33mr.js.map} +1 -1
- package/dist/index-9914wh1d.js +6 -0
- package/dist/index-9914wh1d.js.map +10 -0
- package/dist/{index-y6r1k2yd.js → index-a2eh8dnk.js} +7 -7
- package/dist/{index-y6r1k2yd.js.map → index-a2eh8dnk.js.map} +1 -1
- package/dist/{index-81vj1bxe.js → index-bqdkm3de.js} +4 -4
- package/dist/{index-81vj1bxe.js.map → index-bqdkm3de.js.map} +1 -1
- package/dist/{index-rfa0ztab.js → index-dzy19wtf.js} +4 -4
- package/dist/{index-rfa0ztab.js.map → index-dzy19wtf.js.map} +1 -1
- package/dist/{index-c2qjdz4q.js → index-eqqd4k4f.js} +9 -9
- package/dist/{index-c2qjdz4q.js.map → index-eqqd4k4f.js.map} +1 -1
- package/dist/{index-g1d06ct5.js → index-ew997be5.js} +7 -7
- package/dist/{index-g1d06ct5.js.map → index-ew997be5.js.map} +1 -1
- package/dist/{index-0v2gw4mk.js → index-fa9wvpyw.js} +3 -3
- package/dist/{index-0v2gw4mk.js.map → index-fa9wvpyw.js.map} +1 -1
- package/dist/{index-rvq7t636.js → index-fbsrhcga.js} +4 -4
- package/dist/{index-rvq7t636.js.map → index-fbsrhcga.js.map} +1 -1
- package/dist/index-fcsg95m5.js +11 -0
- package/dist/{index-5nprb9px.js.map → index-fcsg95m5.js.map} +1 -1
- package/dist/{index-dgrwpzz9.js → index-gbkma7ds.js} +4 -4
- package/dist/{index-dgrwpzz9.js.map → index-gbkma7ds.js.map} +1 -1
- package/dist/{index-0m0x1454.js → index-gq1npngp.js} +4 -4
- package/dist/{index-0m0x1454.js.map → index-gq1npngp.js.map} +1 -1
- package/dist/index-haypwvzd.js +308 -0
- package/dist/index-haypwvzd.js.map +21 -0
- package/dist/{index-g8n8rhtr.js → index-jc4kmfwa.js} +4 -4
- package/dist/{index-g8n8rhtr.js.map → index-jc4kmfwa.js.map} +1 -1
- package/dist/index-kjqksgch.js +429 -0
- package/dist/index-kjqksgch.js.map +12 -0
- package/dist/{index-es4bgkbh.js → index-m6fqx0ch.js} +7 -7
- package/dist/{index-es4bgkbh.js.map → index-m6fqx0ch.js.map} +1 -1
- package/dist/{index-60jxyzbe.js → index-ma6p7bt4.js} +4 -4
- package/dist/{index-60jxyzbe.js.map → index-ma6p7bt4.js.map} +1 -1
- package/dist/index-nvc24414.js +6 -0
- package/dist/{index-2yj11ykt.js.map → index-nvc24414.js.map} +1 -1
- package/dist/index-nxhqf597.js +6 -0
- package/dist/{index-m5rmhcez.js.map → index-nxhqf597.js.map} +1 -1
- package/dist/{index-jmnjcw61.js → index-p1zy871m.js} +4 -4
- package/dist/{index-jmnjcw61.js.map → index-p1zy871m.js.map} +1 -1
- package/dist/{index-2pzgta33.js → index-p6ya59m6.js} +5 -5
- package/dist/{index-2pzgta33.js.map → index-p6ya59m6.js.map} +1 -1
- package/dist/{index-6c4p19m1.js → index-pszmnhgq.js} +2 -2
- package/dist/index-qg9bn980.js +1213 -0
- package/dist/{index-1h9pqnec.js.map → index-qg9bn980.js.map} +28 -25
- package/dist/index-qgsdgbk8.js +5 -0
- package/dist/{index-ak304afj.js.map → index-qgsdgbk8.js.map} +2 -2
- package/dist/index-r4ax3x4d.js +74 -0
- package/dist/index-r4ax3x4d.js.map +13 -0
- package/dist/{index-m01mb74d.js → index-snz49ndn.js} +4 -4
- package/dist/{index-m01mb74d.js.map → index-snz49ndn.js.map} +1 -1
- package/dist/index-twn9bfm2.js +8 -0
- package/dist/{index-dwxmy0kx.js.map → index-twn9bfm2.js.map} +2 -2
- package/dist/{index-0p9p6fvc.js → index-wc4entme.js} +10 -10
- package/dist/{index-0p9p6fvc.js.map → index-wc4entme.js.map} +3 -3
- package/dist/{index-wxmqyv4c.js → index-ynsvkqgb.js} +4 -4
- package/dist/{index-wxmqyv4c.js.map → index-ynsvkqgb.js.map} +1 -1
- package/dist/index-ytxbw8py.js +63 -0
- package/dist/{index-fcqy46mh.js.map → index-ytxbw8py.js.map} +2 -2
- package/dist/index-yw3fby4n.js +6 -0
- package/dist/{index-dh2g58s1.js.map → index-yw3fby4n.js.map} +2 -2
- package/dist/{index-ccpq4k6r.js → index-z157at3s.js} +28 -28
- package/dist/{index-ccpq4k6r.js.map → index-z157at3s.js.map} +1 -1
- package/dist/{index-s78sq9g1.js → index-zce9gy22.js} +64 -64
- package/dist/{index-s78sq9g1.js.map → index-zce9gy22.js.map} +1 -1
- package/dist/{index-jv7egrh2.js → index-zw6wyas6.js} +4 -4
- package/dist/{index-jv7egrh2.js.map → index-zw6wyas6.js.map} +1 -1
- package/dist/index.js +308 -292
- package/dist/index.js.map +15 -12
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-template.d.ts +5 -0
- package/dist/lib/agent-template.d.ts.map +1 -1
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/init-flow.d.ts +7 -30
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/owner.d.ts +49 -0
- package/dist/lib/owner.d.ts.map +1 -0
- package/dist/lib/presets.d.ts +44 -0
- package/dist/lib/presets.d.ts.map +1 -0
- package/dist/lib/provision.d.ts +8 -1
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/relay-client.d.ts +17 -0
- package/dist/lib/relay-client.d.ts.map +1 -0
- package/dist/lib/schema.d.ts +2 -0
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/sessions-view.d.ts +2 -0
- package/dist/lib/sessions-view.d.ts.map +1 -1
- package/dist/lib/source.d.ts +17 -0
- package/dist/lib/source.d.ts.map +1 -1
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/owner.d.ts +16 -0
- package/dist/owner.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/web-zph4h3p9.js +14 -0
- package/dist/{web-stkkwyka.js.map → web-zph4h3p9.js.map} +1 -1
- package/dist/wire.d.ts +31 -0
- package/dist/wire.js +2 -2
- package/dist/wire.js.map +4 -4
- package/dist/wrapper-f662ny3r.js +5 -0
- package/dist/{wrapper-bwxbqa53.js.map → wrapper-f662ny3r.js.map} +1 -1
- package/package.json +5 -2
- package/dist/APEv2Parser-jdp5yp24.js +0 -5
- package/dist/App-pmqmzsb3.js +0 -11
- package/dist/FlacParser-6jwner07.js +0 -5
- package/dist/OggParser-as1m8xsa.js +0 -5
- package/dist/Picker-jkmd5xnx.js +0 -5
- package/dist/SessionPicker-3712ke3k.js +0 -5
- package/dist/SkillBrowser-qhsyszt4.js +0 -5
- package/dist/WizardApp-qrq36nv8.js +0 -5
- package/dist/config-z2cd0c5f.js +0 -24
- package/dist/credential-h0wmsjsw.js +0 -19
- package/dist/index-026q0y3a.js +0 -6
- package/dist/index-026q0y3a.js.map +0 -10
- package/dist/index-1h9pqnec.js +0 -1194
- package/dist/index-1wxw30j1.js +0 -74
- package/dist/index-1wxw30j1.js.map +0 -13
- package/dist/index-2yj11ykt.js +0 -6
- package/dist/index-358nsn9t.js +0 -65
- package/dist/index-358nsn9t.js.map +0 -21
- package/dist/index-3mvenfbg.js +0 -5
- package/dist/index-5nprb9px.js +0 -11
- package/dist/index-ak304afj.js +0 -5
- package/dist/index-b7qc21s7.js +0 -9
- package/dist/index-dh2g58s1.js +0 -6
- package/dist/index-dwxmy0kx.js +0 -8
- package/dist/index-fcqy46mh.js +0 -63
- package/dist/index-kktaw552.js +0 -6
- package/dist/index-m5rmhcez.js +0 -6
- package/dist/index-qe3ybzh6.js +0 -6
- package/dist/index-rhv6gqpt.js +0 -6
- package/dist/index-s4a28ctb.js +0 -9
- package/dist/index-tny7c703.js +0 -5
- package/dist/index-v6taf4vn.js +0 -6
- package/dist/index-y605a1rj.js +0 -429
- package/dist/index-y605a1rj.js.map +0 -11
- package/dist/index-z88f35vs.js +0 -96
- package/dist/index-z88f35vs.js.map +0 -13
- package/dist/web-stkkwyka.js +0 -14
- package/dist/wrapper-bwxbqa53.js +0 -5
- /package/dist/{index-6c4p19m1.js.map → index-pszmnhgq.js.map} +0 -0
package/dist/index-fcqy46mh.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{e,c}from"./index-t6xnecdx.js";var bt=e(function(_w){var Ho;(function(t){t.HEADER="header",t.QUERY="query"})(Ho||(Ho={}));var zo;(function(t){t.HEADER="header",t.QUERY="query"})(zo||(zo={}));var qo;(function(t){t.HTTP="http",t.HTTPS="https"})(qo||(qo={}));var Rr;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Rr||(Rr={}));var yw=(t)=>{let r=[];if(t.sha256!==void 0)r.push({algorithmId:()=>Rr.SHA256,checksumConstructor:()=>t.sha256});if(t.md5!=null)r.push({algorithmId:()=>Rr.MD5,checksumConstructor:()=>t.md5});return{addChecksumAlgorithm(n){r.push(n)},checksumAlgorithms(){return r}}},Sw=(t)=>{let r={};return t.checksumAlgorithms().forEach((n)=>{r[n.algorithmId()]=n.checksumConstructor()}),r},ww=(t)=>yw(t),Ew=(t)=>Sw(t),Vo;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(Vo||(Vo={}));var bw="__smithy_context",jo;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(jo||(jo={}));var Wo;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(Wo||(Wo={}));_w.AlgorithmId=Rr;_w.EndpointURLScheme=qo;_w.FieldPosition=Vo;_w.HttpApiKeyAuthLocation=zo;_w.HttpAuthLocation=Ho;_w.IniSectionType=jo;_w.RequestHandlerProtocol=Wo;_w.SMITHY_CONTEXT_KEY=bw;_w.getDefaultClientConfiguration=ww;_w.resolveDefaultRuntimeConfig=Ew});var me=e(function($w){var{SMITHY_CONTEXT_KEY:hu}=bt(),kw=(t)=>t[hu]||(t[hu]={});function pu(t,r){return Object.prototype.hasOwnProperty.call(t,r)}class Rn{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){let r=new Rn({...t,headers:{...t.headers}});if(r.query)r.query=Mw(r.query);return r}static isInstance(t){if(!t)return!1;let r=t;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query==="object"&&typeof r.headers==="object"}clone(){return Rn.clone(this)}}function Mw(t){return Object.keys(t).reduce((r,n)=>{let s=t[n];return{...r,[n]:Array.isArray(s)?[...s]:s}},{})}class gu{statusCode;reason;headers;body;constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;let r=t;return typeof r.statusCode==="number"&&typeof r.headers==="object"}}var Dw=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),mu=(t,r=!1)=>{if(!r)return Dw.test(t);let n=t.split(".");for(let s of n)if(!mu(s))return!1;return!0};function Fw(t){return/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(t)}var Lw=(t)=>{if(typeof t==="function")return t;let r=Promise.resolve(t);return()=>r};function yu(t){let r={};if(t=t.replace(/^\?/,""),t)for(let n of t.split("&")){let[s,o=null]=n.split("=");if(s=decodeURIComponent(s),o)o=decodeURIComponent(o);if(!(s in r))r[s]=o;else if(Array.isArray(r[s]))r[s].push(o);else r[s]=[r[s],o]}return r}var vn=(t)=>{if(typeof t==="string")return vn(new URL(t));let{hostname:r,pathname:n,port:s,protocol:o,search:i}=t,u;if(i)u=yu(i);return{hostname:r,port:s?parseInt(s):void 0,protocol:o,path:n,query:u}},Uw=(t)=>{if(typeof t==="object"){if("url"in t){let r=vn(t.url);if(t.headers){r.headers={};for(let n in t.headers){if(!pu(t.headers,n))continue;r.headers[n.toLowerCase()]=t.headers[n].join(", ")}}return r}return t}return vn(t)};$w.HttpRequest=Rn;$w.HttpResponse=gu;$w.getSmithyContext=kw;$w.hasOwn=pu;$w.isValidHostLabel=mu;$w.isValidHostname=Fw;$w.normalizeProvider=Lw;$w.parseQueryString=yu;$w.parseUrl=vn;$w.toEndpointV1=Uw});var Te=e(function(uE){var{getSmithyContext:Su,HttpResponse:Xw,toEndpointV1:Yw}=me(),Nn=(t)=>{if(typeof t==="function")return t();return t},Qo=(t,r,n,s,o)=>({name:r,namespace:t,traits:n,input:s,output:o}),Jw=(t)=>(r,n)=>async(s)=>{let{response:o}=await r(s),{operationSchema:i}=Su(n),[,u,a,d,l,h]=i??[];try{let f=await t.protocol.deserializeResponse(Qo(u,a,d,l,h),{...t,...n},o);return{response:o,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:o,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){try{f.message+=`
|
|
3
|
-
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(g){if(!n.logger||n.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else n.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof f.$responseBodyText<"u"){if(f.$response)f.$response.body=f.$responseBodyText}try{if(Xw.isInstance(o)){let{headers:g={},statusCode:m}=o,y=Object.entries(g);f.$metadata={httpStatusCode:m,requestId:Go(/^x-[\w-]+-request-?id$/,y),extendedRequestId:Go(/^x-[\w-]+-id-2$/,y),cfId:Go(/^x-[\w-]+-cf-id$/,y)}}}catch(g){}}throw f}},Go=(t,r)=>(r.find(([n])=>n.match(t))||[void 0,void 0])[1],Zw=(t)=>(r,n)=>async(s)=>{let{operationSchema:o}=Su(n),[,i,u,a,d,l]=o??[],h=n.endpointV2?async()=>Yw(n.endpointV2):t.endpoint,f=await t.protocol.serializeRequest(Qo(i,u,a,d,l),s.input,{...t,...n,endpoint:h});return r({...s,request:f})},wu={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Eu={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function eE(t){return{applyToStack:(r)=>{r.add(Zw(t),Eu),r.add(Jw(t),wu),t.protocol.setSerdeContext(t)}}}class he{name;namespace;traits;static assign(t,r){return Object.assign(t,r)}static[Symbol.hasInstance](t){let r=this.prototype.isPrototypeOf(t);if(!r&&typeof t==="object"&&t!==null)return t.symbol===this.symbol;return r}getName(){return this.namespace+"#"+this.name}}class Mn extends he{static symbol=Symbol.for("@smithy/lis");valueSchema;symbol=Mn.symbol}var tE=(t,r,n,s)=>he.assign(new Mn,{name:r,namespace:t,traits:n,valueSchema:s});class Dn extends he{static symbol=Symbol.for("@smithy/map");keySchema;valueSchema;symbol=Dn.symbol}var rE=(t,r,n,s,o)=>he.assign(new Dn,{name:r,namespace:t,traits:n,keySchema:s,valueSchema:o});class Fn extends he{static symbol=Symbol.for("@smithy/ope");input;output;symbol=Fn.symbol}var nE=(t,r,n,s,o)=>he.assign(new Fn,{name:r,namespace:t,traits:n,input:s,output:o});class Pr extends he{static symbol=Symbol.for("@smithy/str");memberNames;memberList;symbol=Pr.symbol}var sE=(t,r,n,s,o)=>he.assign(new Pr,{name:r,namespace:t,traits:n,memberNames:s,memberList:o});class Ln extends Pr{static symbol=Symbol.for("@smithy/err");ctor;symbol=Ln.symbol}var oE=(t,r,n,s,o,i)=>he.assign(new Ln,{name:r,namespace:t,traits:n,memberNames:s,memberList:o,ctor:null}),On=[];function Or(t){if(typeof t==="object")return t;if(t=t|0,On[t])return On[t];let r={},n=0;for(let s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])if((t>>n++&1)===1)r[s]=1;return On[t]=r}var vr={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},Pn=[],kn={};class We{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=We.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(t,r){this.ref=t,this.memberName=r;let n=[],s=t,o=t;this._isMemberSchema=!1;while(Ko(s))n.push(s[1]),s=s[0],o=Nn(s),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let i=n.length-1;i>=0;--i){let u=n[i];Object.assign(this.memberTraits,Or(u))}}else this.memberTraits=0;if(o instanceof We){let i=this.memberTraits;Object.assign(this,o),this.memberTraits=Object.assign({},i,o.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??o.memberName;return}if(this.schema=Nn(o),bu(this.schema))this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3];else this.name=this.memberName??String(o),this.traits=0;if(this._isMemberSchema&&!r)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](t){let r=this.prototype.isPrototypeOf(t);if(!r&&typeof t==="object"&&t!==null)return t.symbol===this.symbol;return r}static of(t){let r=typeof t==="function"||typeof t==="object"&&t!==null;if(typeof t==="number"){if(Pn[t])return Pn[t]}else if(typeof t==="string"){if(kn[t])return kn[t]}else if(r){if(t[vr.ns])return t[vr.ns]}let n=Nn(t);if(n instanceof We)return n;if(Ko(n)){let[o,i]=n;if(o instanceof We)return Object.assign(o.getMergedTraits(),Or(i)),o;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(t,null,2)}.`)}let s=new We(n);if(r)return t[vr.ns]=s;if(typeof n==="string")return kn[n]=s;if(typeof n==="number")return Pn[n]=s;return s}getSchema(){let t=this.schema;if(Array.isArray(t)&&t[0]===0)return t[4];return t}getName(t=!1){let{name:r}=this;return!t&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let t=this.getSchema();return typeof t==="number"?t>=64&&t<128:t[0]===1}isMapSchema(){let t=this.getSchema();return typeof t==="number"?t>=128&&t<=255:t[0]===2}isStructSchema(){let t=this.getSchema();if(typeof t!=="object")return!1;let r=t[0];return r===3||r===-3||r===4}isUnionSchema(){let t=this.getSchema();if(typeof t!=="object")return!1;return t[0]===4}isBlobSchema(){let t=this.getSchema();return t===21||t===42}isTimestampSchema(){let t=this.getSchema();return typeof t==="number"&&t>=4&&t<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:t}=this.getMergedTraits();return!!t||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Or(this.memberTraits)}getOwnTraits(){return Or(this.traits)}getKeySchema(){let[t,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!t&&!r)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let n=this.getSchema(),s=t?15:n[4]??0;return Nr([s,0],"key")}getValueSchema(){let t=this.getSchema(),[r,n,s]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],o=typeof t==="number"?63&t:t&&typeof t==="object"&&(n||s)?t[3+t[0]]:r?15:void 0;if(o!=null)return Nr([o,0],n?"value":"member");throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(t){let r=this.getSchema();if(this.isStructSchema()&&r[4].includes(t)){let n=r[4].indexOf(t),s=r[5][n];return Nr(Ko(s)?s:[s,0],t)}if(this.isDocumentSchema())return Nr([15,0],t);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${t}.`)}getMemberSchemas(){let t={};try{for(let[r,n]of this.structIterator())t[r]=n}catch(r){}return t}getEventStreamMember(){if(this.isStructSchema()){for(let[t,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return t}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error("@smithy/core/schema - cannot iterate non-struct schema.");let t=this.getSchema(),r=t[4].length,n=t[vr.it];if(n&&r===n.length){yield*n;return}n=Array(r);for(let s=0;s<r;++s){let o=t[4][s],i=Nr([t[5][s],0],o);yield n[s]=[o,i]}t[vr.it]=n}}function Nr(t,r){if(t instanceof We)return Object.assign(t,{memberName:r,_isMemberSchema:!0});return new We(t,r)}var Ko=(t)=>Array.isArray(t)&&t.length===2,bu=(t)=>Array.isArray(t)&&t.length>=5;class kr extends he{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=kr.symbol}var iE=(t,r,n,s)=>he.assign(new kr,{name:r,namespace:t,traits:s,schemaRef:n}),aE=(t,r,n,s)=>he.assign(new kr,{name:r,namespace:t,traits:n,schemaRef:s}),cE={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class je{namespace;schemas;exceptions;static registries=new Map;constructor(t,r=new Map,n=new Map){if(this.namespace=t,this.schemas=r,this.exceptions=n,!je.registries.has(t))je.registries.set(t,this)}static for(t){return je.registries.get(t)??new je(t)}copyFrom(t){let{schemas:r,exceptions:n}=this;for(let[s,o]of t.schemas)if(!r.has(s))r.set(s,o);for(let[s,o]of t.exceptions)if(!n.has(s))n.set(s,o)}register(t,r){let n=this.normalizeShapeId(t);for(let s of[this,je.for(n.split("#")[0])])if(!s.schemas.has(n))s.schemas.set(n,r)}getSchema(t){let r=this.normalizeShapeId(t);if(!this.schemas.has(r)){if(!t.includes("#")){let n="#"+t,s=[];for(let[o,i]of this.schemas.entries())if(o.endsWith(n))s.push(i);if(s.length===1)return s[0]}throw Error(`@smithy/core/schema - schema not found for ${r}`)}return this.schemas.get(r)}registerError(t,r){let n=t,s=n[1],o=s+"#"+n[2];for(let i of[this,je.for(s)])if(!i.schemas.has(o)&&!i.exceptions.has(n))i.schemas.set(o,n),i.exceptions.set(n,r)}getErrorCtor(t){let r=t;if(this.exceptions.has(r))return this.exceptions.get(r);return je.for(r[1]).exceptions.get(r)}getBaseException(){for(let t of this.exceptions.keys())if(Array.isArray(t)){let[,r,n]=t,s=r+"#"+n;if(s.startsWith("smithy.ts.sdk.synthetic.")&&s.endsWith("ServiceException"))return t}return}find(t){for(let r of this.schemas.values())if(t(r))return r;return}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(t){if(t.includes("#"))return t;return this.namespace+"#"+t}}uE.ErrorSchema=Ln;uE.ListSchema=Mn;uE.MapSchema=Dn;uE.NormalizedSchema=We;uE.OperationSchema=Fn;uE.SCHEMA=cE;uE.Schema=he;uE.SimpleSchema=kr;uE.StructureSchema=Pr;uE.TypeRegistry=je;uE.deref=Nn;uE.deserializerMiddlewareOption=wu;uE.error=oE;uE.getSchemaSerdePlugin=eE;uE.isStaticSchema=bu;uE.list=tE;uE.map=rE;uE.op=nE;uE.operation=Qo;uE.serializerMiddlewareOption=Eu;uE.sim=iE;uE.simAdapter=aE;uE.simpleSchemaCacheN=Pn;uE.simpleSchemaCacheS=kn;uE.struct=sE;uE.traitsCache=On;uE.translateTraits=Or});var le=e(function(gb){var{hasOwn:Fr}=me(),{getSmithyContext:LE,normalizeProvider:UE}=me();gb.getSmithyContext=LE;gb.normalizeProvider=UE;var{SMITHY_CONTEXT_KEY:_u,AlgorithmId:Mr}=bt();gb.AlgorithmId=Mr;var{NormalizedSchema:$E}=Te(),_t=(t,r)=>{let n=[];if(t)n.push(t);if(r)for(let s of r)n.push(s);return n},tt=(t,r)=>`${t||"anonymous"}${r&&r.length>0?` (a.k.a. ${r.join(",")})`:""}`,Dr=()=>{let t=[],r=[],n=!1,s=new Set,o=(f)=>f.sort((p,g)=>Au[g.step]-Au[p.step]||xu[g.priority||"normal"]-xu[p.priority||"normal"]),i=(f)=>{let p=!1,g=(m)=>{let y=_t(m.name,m.aliases);if(y.includes(f)){p=!0;for(let S of y)s.delete(S);return!1}return!0};return t=t.filter(g),r=r.filter(g),p},u=(f)=>{let p=!1,g=(m)=>{if(m.middleware===f){p=!0;for(let y of _t(m.name,m.aliases))s.delete(y);return!1}return!0};return t=t.filter(g),r=r.filter(g),p},a=(f)=>(t.forEach((p)=>{f.add(p.middleware,{...p})}),r.forEach((p)=>{f.addRelativeTo(p.middleware,{...p})}),f.identifyOnResolve?.(h.identifyOnResolve()),f),d=(f)=>{let p=[];return f.before.forEach((g)=>{if(g.before.length===0&&g.after.length===0)p.push(g);else p.push(...d(g))}),p.push(f),f.after.reverse().forEach((g)=>{if(g.before.length===0&&g.after.length===0)p.push(g);else p.push(...d(g))}),p},l=(f=!1)=>{let p=[],g=[],m={};return t.forEach((S)=>{let w={...S,before:[],after:[]};for(let E of _t(w.name,w.aliases))m[E]=w;p.push(w)}),r.forEach((S)=>{let w={...S,before:[],after:[]};for(let E of _t(w.name,w.aliases))m[E]=w;g.push(w)}),g.forEach((S)=>{if(S.toMiddleware){let w=m[S.toMiddleware];if(w===void 0){if(f)return;throw Error(`${S.toMiddleware} is not found when adding ${tt(S.name,S.aliases)} middleware ${S.relation} ${S.toMiddleware}`)}if(S.relation==="after")w.after.push(S);if(S.relation==="before")w.before.push(S)}}),o(p).map(d).reduce((S,w)=>(S.push(...w),S),[])},h={add:(f,p={})=>{let{name:g,override:m,aliases:y}=p,S={step:"initialize",priority:"normal",middleware:f,...p},w=_t(g,y);if(w.length>0){if(w.some((E)=>s.has(E))){if(!m)throw Error(`Duplicate middleware name '${tt(g,y)}'`);for(let E of w){let A=t.findIndex((L)=>L.name===E||L.aliases?.some((k)=>k===E));if(A===-1)continue;let v=t[A];if(v.step!==S.step||S.priority!==v.priority)throw Error(`"${tt(v.name,v.aliases)}" middleware with ${v.priority} priority in ${v.step} step cannot be overridden by "${tt(g,y)}" middleware with ${S.priority} priority in ${S.step} step.`);t.splice(A,1)}}for(let E of w)s.add(E)}t.push(S)},addRelativeTo:(f,p)=>{let{name:g,override:m,aliases:y}=p,S={middleware:f,...p},w=_t(g,y);if(w.length>0){if(w.some((E)=>s.has(E))){if(!m)throw Error(`Duplicate middleware name '${tt(g,y)}'`);for(let E of w){let A=r.findIndex((L)=>L.name===E||L.aliases?.some((k)=>k===E));if(A===-1)continue;let v=r[A];if(v.toMiddleware!==S.toMiddleware||v.relation!==S.relation)throw Error(`"${tt(v.name,v.aliases)}" middleware ${v.relation} "${v.toMiddleware}" middleware cannot be overridden by "${tt(g,y)}" middleware ${S.relation} "${S.toMiddleware}" middleware.`);r.splice(A,1)}}for(let E of w)s.add(E)}r.push(S)},clone:()=>a(Dr()),use:(f)=>{f.applyToStack(h)},remove:(f)=>{if(typeof f==="string")return i(f);else return u(f)},removeByTag:(f)=>{let p=!1,g=(m)=>{let{tags:y,name:S,aliases:w}=m;if(y&&y.includes(f)){let E=_t(S,w);for(let A of E)s.delete(A);return p=!0,!1}return!0};return t=t.filter(g),r=r.filter(g),p},concat:(f)=>{let p=a(Dr());return p.use(f),p.identifyOnResolve(n||p.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),p},applyToStack:a,identify:()=>l(!0).map((f)=>{let p=f.step??f.relation+" "+f.toMiddleware;return tt(f.name,f.aliases)+" - "+p}),identifyOnResolve(f){if(typeof f==="boolean")n=f;return n},resolve:(f,p)=>{for(let g of l().map((m)=>m.middleware).reverse())f=g(f,p);if(n)console.log(h.identify());return f}};return h},Au={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},xu={high:3,normal:2,low:1},BE=(t)=>()=>{throw Error(t)},HE=(t)=>()=>Promise.reject(t),Un=()=>{let t=new WeakSet;return(r,n)=>{if(typeof n==="object"&&n!==null){if(t.has(n))return"[Circular]";t.add(n)}return n}},zE=(t)=>new Promise((r)=>setTimeout(r,t*1000)),Iu={minDelay:2,maxDelay:120},Me;(function(t){t.ABORTED="ABORTED",t.FAILURE="FAILURE",t.SUCCESS="SUCCESS",t.RETRY="RETRY",t.TIMEOUT="TIMEOUT"})(Me||(Me={}));var qE=(t)=>{if(t.state===Me.ABORTED){let r=Error(`${JSON.stringify({...t,reason:"Request was aborted"},Un())}`);throw r.name="AbortError",r}else if(t.state===Me.TIMEOUT){let r=Error(`${JSON.stringify({...t,reason:"Waiter has timed out"},Un())}`);throw r.name="TimeoutError",r}else if(t.state!==Me.SUCCESS)throw Error(`${JSON.stringify(t,Un())}`);return t},VE=async({minDelay:t,maxDelay:r,maxWaitTime:n,abortController:s,client:o,abortSignal:i},u,a)=>{let d={},[l,h]=[t*1000,r*1000],f=0,p=Date.now()+n*1000,g=Date.now()+60000,m=!1;while(!0){if(f>0){let w=GE(l,h,f,p);if(s?.signal?.aborted||i?.aborted)return d["AbortController signal aborted."]|=0,d["AbortController signal aborted."]+=1,{state:Me.ABORTED,observedResponses:d};if(Date.now()+w>p)return{state:Me.TIMEOUT,observedResponses:d};await zE(w/1000)}let{state:y,reason:S}=await a(o,u);if(S){let w=WE(S);d[w]|=0,d[w]+=1}if(y!==Me.RETRY)return{state:y,reason:S,final:S,observedResponses:d};if(f+=1,!m&&Date.now()>=g)jE(d,o),m=!0}},jE=(t={},r)=>{let n=Object.keys(t),s=0;for(let u of n){let a=t[u]|0;if(u.startsWith("403:"))s+=a}let o=r?.config?.logger,i=typeof o?.warn==="function"&&!o.constructor?.name?.includes?.("NoOpLogger")?o:console;if(s>=3||n[n.length-1]?.startsWith("403:"))i.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},WE=(t)=>{let r=t?.$response?.statusCode??t?.$metadata?.httpStatusCode;if(t?.$responseBodyText)return`${r?r+": ":""}Deserialization error for body: ${t.$responseBodyText}`;if(r){if(t?.$response||t?.message)return`${r??"Unknown"}: ${t?.message}`;return`${r}: OK`}return String(t?.message??JSON.stringify(t,Un())??"Unknown")},GE=(t,r,n,s)=>{let o=Math.log(r/t)/Math.log(2)+1;if(n>o)return r;let i=t*2**(n-1),u=Math.min(i,r),a=KE(t,u);if(Date.now()+a>s){let d=s-Date.now();return Math.max(0,d-500)}return a},KE=(t,r)=>t+Math.random()*(r-t),QE=(t)=>{if(t.maxWaitTime<=0)throw Error("WaiterConfiguration.maxWaitTime must be greater than 0");else if(t.minDelay<=0)throw Error("WaiterConfiguration.minDelay must be greater than 0");else if(t.maxDelay<=0)throw Error("WaiterConfiguration.maxDelay must be greater than 0");else if(t.maxWaitTime<=t.minDelay)throw Error(`WaiterConfiguration.maxWaitTime [${t.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`);else if(t.maxDelay<t.minDelay)throw Error(`WaiterConfiguration.maxDelay [${t.maxDelay}] must be greater than WaiterConfiguration.minDelay [${t.minDelay}] for this waiter`)},Tu=(t)=>{let r,n=new Promise((s)=>{if(r=()=>s({state:Me.ABORTED}),typeof t.addEventListener==="function")t.addEventListener("abort",r);else t.onabort=r});return{clearListener(){if(typeof t.removeEventListener==="function")t.removeEventListener("abort",r)},aborted:n}},XE=async(t,r,n)=>{let s={...Iu,...t};QE(s);let o=[VE(s,r,n)],i=[];if(t.abortSignal){let{aborted:u,clearListener:a}=Tu(t.abortSignal);i.push(a),o.push(u)}if(t.abortController?.signal){let{aborted:u,clearListener:a}=Tu(t.abortController.signal);i.push(a),o.push(u)}return Promise.race(o).then((u)=>{for(let a of i)a();return u})};class Ru{config;middlewareStack=Dr();initConfig;handlers;constructor(t){this.config=t;let{protocol:r,protocolSettings:n}=t;if(n){if(typeof r==="function")t.protocol=new r(n)}}send(t,r,n){let s=typeof r!=="function"?r:void 0,o=typeof r==="function"?r:n,i=s===void 0&&this.config.cacheMiddleware===!0,u;if(i){if(!this.handlers)this.handlers=new WeakMap;let a=this.handlers;if(a.has(t.constructor))u=a.get(t.constructor);else u=t.resolveMiddleware(this.middlewareStack,this.config,s),a.set(t.constructor,u)}else delete this.handlers,u=t.resolveMiddleware(this.middlewareStack,this.config,s);if(o)u(t).then((a)=>o(null,a.output),(a)=>o(a)).catch(()=>{});else return u(t).then((a)=>a.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var Xo="***SensitiveInformation***";function $n(t,r){if(r==null)return r;let n=$E.of(t);if(n.getMergedTraits().sensitive)return Xo;if(n.isListSchema()){if(!!n.getValueSchema().getMergedTraits().sensitive)return Xo}else if(n.isMapSchema()){if(!!n.getKeySchema().getMergedTraits().sensitive||!!n.getValueSchema().getMergedTraits().sensitive)return Xo}else if(n.isStructSchema()&&typeof r==="object"){let s=r,o={};for(let[i,u]of n.structIterator())if(s[i]!=null)o[i]=$n(u,s[i]);return o}return r}class Bn{middlewareStack=Dr();schema;static classBuilder(){return new vu}resolveMiddlewareWithContext(t,r,n,{middlewareFn:s,clientName:o,commandName:i,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,smithyContext:d,additionalContext:l,CommandCtor:h}){for(let w of s.bind(this)(h,t,r,n))this.middlewareStack.use(w);let f=t.concat(this.middlewareStack),{logger:p}=r,g=l[_u],m={logger:p,clientName:o,commandName:i,inputFilterSensitiveLog:u,outputFilterSensitiveLog:a,...l,[_u]:{...g,commandInstance:this,...d,...n?.metricsRecorder===void 0?{}:{metricsRecorder:n.metricsRecorder}}},{requestHandler:y}=r,S=n??{};if(S.metricsRecorder)S={...S},delete S.metricsRecorder;if(d.eventStream)S={isEventStream:!0,...S};return f.resolve((w)=>y.handle(w.request,S),m)}}class vu{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(t){this._init=t}ep(t){return this._ep=t,this}m(t){return this._middlewareFn=t,this}s(t,r,n={}){return this._smithyContext={service:t,operation:r,...n},this}c(t={}){return this._additionalContext=t,this}n(t,r){return this._clientName=t,this._commandName=r,this}f(t=(n)=>n,r=(n)=>n){return this._inputFilterSensitiveLog=t,this._outputFilterSensitiveLog=r,this}ser(t){return this._serializer=t,this}de(t){return this._deserializer=t,this}sc(t){return this._operationSchema=t,this._smithyContext.operationSchema=t,this}build(){let t=this,r;return r=class extends Bn{input;static getEndpointParameterInstructions(){return t._ep}constructor(...[n]){super();this.input=n??{},t._init(this),this.schema=t._operationSchema}resolveMiddleware(n,s,o){let i=t._operationSchema,u=i?.[4]??i?.input,a=i?.[5]??i?.output;return this.resolveMiddlewareWithContext(n,s,o,{CommandCtor:r,middlewareFn:t._middlewareFn,clientName:t._clientName,commandName:t._commandName,inputFilterSensitiveLog:t._inputFilterSensitiveLog??(i?$n.bind(null,u):(d)=>d),outputFilterSensitiveLog:t._outputFilterSensitiveLog??(i?$n.bind(null,a):(d)=>d),smithyContext:t._smithyContext,additionalContext:t._additionalContext})}serialize=t._serializer;deserialize=t._deserializer}}}var YE="***SensitiveInformation***",JE=(t,r,n)=>{for(let[i,u]of Object.entries(t)){let a=async function(l,h,f){let p=new u(l);if(typeof h==="function")this.send(p,h);else if(typeof f==="function"){if(typeof h!=="object")throw Error(`Expected http options but got ${typeof h}`);this.send(p,h||{},f)}else return this.send(p,h)},d=(i[0].toLowerCase()+i.slice(1)).replace(/Command$/,"");r.prototype[d]=a}let{paginators:s={},waiters:o={}}=n??{};for(let[i,u]of Object.entries(s))if(r.prototype[i]===void 0)r.prototype[i]=function(a={},d,...l){return u({...d,client:this},a,...l)};for(let[i,u]of Object.entries(o))if(r.prototype[i]===void 0)r.prototype[i]=async function(a={},d,...l){let h=d;if(typeof d==="number")h={maxWaitTime:d};return u({...h,client:this},a,...l)}};class Gt extends Error{$fault;$response;$retryable;$metadata;constructor(t){super(t.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=t.name,this.$fault=t.$fault,this.$metadata=t.$metadata}static isInstance(t){if(!t)return!1;let r=t;return Gt.prototype.isPrototypeOf(r)||Boolean(r.$fault)&&Boolean(r.$metadata)&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](t){if(!t)return!1;let r=t;if(this===Gt)return Gt.isInstance(t);if(Gt.isInstance(t)){if(this.prototype.isPrototypeOf(t))return!0;let n=this.name;if(!n||!r.name)return!1;if(r.name===n)return!0;let s=Object.getPrototypeOf(r);while(s&&s!==Object.prototype){let o=s.constructor?.name;if(o&&o!=="Error"&&o===n)return!0;s=Object.getPrototypeOf(s)}return!1}return!1}}var Nu=(t,r={})=>{Object.entries(r).filter(([,s])=>s!==void 0).forEach(([s,o])=>{if(t[s]==null||t[s]==="")t[s]=o});let n=t.message||t.Message||"UnknownError";return t.message=n,delete t.Message,t},Ou=({output:t,parsedBody:r,exceptionCtor:n,errorCode:s})=>{let o=eb(t),i=o.httpStatusCode?o.httpStatusCode+"":void 0,u=new n({name:r?.code||r?.Code||s||i||"UnknownError",$fault:"client",$metadata:o});throw Nu(u,r)},ZE=(t)=>({output:r,parsedBody:n,errorCode:s})=>{Ou({output:r,parsedBody:n,exceptionCtor:t,errorCode:s})},eb=(t)=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),tb=(t)=>{switch(t){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{}}},Cu=!1,rb=(t)=>{if(t&&!Cu&&parseInt(t.substring(1,t.indexOf(".")))<16)Cu=!0},Pu=Object.values(Mr),ku=(t)=>{let r=[];for(let n in Mr){if(!Fr(Mr,n))continue;let s=Mr[n];if(t[s]===void 0)continue;r.push({algorithmId:()=>s,checksumConstructor:()=>t[s]})}for(let[n,s]of Object.entries(t.checksumAlgorithms??{}))r.push({algorithmId:()=>n,checksumConstructor:()=>s});return{addChecksumAlgorithm(n){t.checksumAlgorithms=t.checksumAlgorithms??{};let s=n.algorithmId(),o=n.checksumConstructor();if(Pu.includes(s))t.checksumAlgorithms[s.toUpperCase()]=o;else t.checksumAlgorithms[s]=o;r.push(n)},checksumAlgorithms(){return r}}},Mu=(t)=>{let r={};return t.checksumAlgorithms().forEach((n)=>{let s=n.algorithmId();if(Pu.includes(s))r[s]=n.checksumConstructor()}),r},Du=(t)=>({setRetryStrategy(r){t.retryStrategy=r},retryStrategy(){return t.retryStrategy}}),Fu=(t)=>{let r={};return r.retryStrategy=t.retryStrategy(),r},Lu=(t)=>Object.assign(ku(t),Du(t)),nb=Lu,sb=(t)=>Object.assign(Mu(t),Fu(t)),ob=(t)=>Array.isArray(t)?t:[t],Uu=(t)=>{for(let n in t){if(!Fr(t,n))continue;if(t[n]["#text"]!==void 0)t[n]=t[n]["#text"];else if(typeof t[n]==="object"&&t[n]!==null)t[n]=Uu(t[n])}return t},ib=(t)=>t!=null;class $u{trace(){}debug(){}info(){}warn(){}error(){}}function Bu(t,r,n){let s,o,i;if(typeof r>"u"&&typeof n>"u")s={},i=t;else if(s=t,typeof r==="function")return o=r,i=n,ub(s,o,i);else i=r;for(let u in i){if(!Fr(i,u))continue;if(!Array.isArray(i[u])){s[u]=i[u];continue}Hu(s,null,i,u)}return s}var ab=(t)=>{let r={};for(let[n,s]of Object.entries(t||{}))r[n]=[,s];return r},cb=(t,r)=>{let n={};for(let s in r){if(!Fr(r,s))continue;Hu(n,t,r,s)}return n},ub=(t,r,n)=>Bu(t,Object.entries(n).reduce((s,[o,i])=>{if(Array.isArray(i))s[o]=i;else if(typeof i==="function")s[o]=[r,i()];else s[o]=[r,i];return s},{})),Hu=(t,r,n,s)=>{if(r!==null){let u=n[s];if(typeof u==="function")u=[,u];let[a=db,d=lb,l=s]=u;if(typeof a==="function"&&a(r[l])||typeof a!=="function"&&!!a)t[s]=d(r[l]);return}let[o,i]=n[s];if(typeof i==="function"){let u,a=o===void 0&&(u=i())!=null,d=typeof o==="function"&&!!o(void 0)||typeof o!=="function"&&!!o;if(a)t[s]=u;else if(d)t[s]=i()}else{let u=o===void 0&&i!=null,a=typeof o==="function"&&!!o(i)||typeof o!=="function"&&!!o;if(u||a)t[s]=i}},db=(t)=>t!=null,lb=(t)=>t,fb=(t)=>{if(t!==t)return"NaN";switch(t){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return t}},hb=(t)=>t.toISOString().replace(".000Z","Z"),Yo=(t)=>{if(t==null)return{};if(Array.isArray(t))return t.filter((r)=>r!=null).map(Yo);if(typeof t==="object"){let r={};for(let n in t){if(!Fr(t,n))continue;if(t[n]==null)continue;r[n]=Yo(t[n])}return r}return t};function pb(t,r,n,s){return function(i,u,a,d,l={}){let h=Object.assign({},t,i);return Bn.classBuilder().ep(h).m(function(f,p,g,m){let y=u.call(this,f,p,g,m);return y.unshift(s(g,f.getEndpointParameterInstructions())),y}).s(r,a,l).n(n,a.charAt(0).toUpperCase()+a.slice(1)+"Command").sc(d).build()}}gb.Client=Ru;gb.Command=Bn;gb.NoOpLogger=$u;gb.SENSITIVE_STRING=YE;gb.ServiceException=Gt;gb.WaiterState=Me;gb._json=Yo;gb.checkExceptions=qE;gb.constructStack=Dr;gb.convertMap=ab;gb.createAggregatedClient=JE;gb.createWaiter=XE;gb.decorateServiceException=Nu;gb.emitWarningIfUnsupportedVersion=rb;gb.getArrayIfSingleItem=ob;gb.getChecksumConfiguration=ku;gb.getDefaultClientConfiguration=nb;gb.getDefaultExtensionConfiguration=Lu;gb.getRetryConfiguration=Du;gb.getValueFromTextNode=Uu;gb.invalidFunction=BE;gb.invalidProvider=HE;gb.isSerializableHeaderValue=ib;gb.loadConfigsForDefaultMode=tb;gb.makeBuilder=pb;gb.map=Bu;gb.resolveChecksumRuntimeConfig=Mu;gb.resolveDefaultRuntimeConfig=sb;gb.resolveRetryRuntimeConfig=Fu;gb.schemaLogFilter=$n;gb.serializeDateTime=hb;gb.serializeFloat=fb;gb.take=cb;gb.throwDefaultError=Ou;gb.waiterServiceDefaults=Iu;gb.withBaseException=ZE});var V=e(function(tA){var{homedir:t_}=c("node:os"),{sep:r_,join:Lr}=c("node:path"),{createHash:n_}=c("node:crypto"),{readFile:Xu}=c("node:fs/promises"),{IniSectionType:Hn}=bt(),{normalizeProvider:zn}=le(),{isValidHostLabel:s_}=me();class Kt extends Error{name="ProviderError";tryNextLink;constructor(t,r=!0){let n,s=!0;if(typeof r==="boolean")n=void 0,s=r;else if(r!=null&&typeof r==="object")n=r.logger,s=r.tryNextLink??!0;super(t);this.tryNextLink=s,Object.setPrototypeOf(this,Kt.prototype),n?.debug?.(`@smithy/property-provider ${s?"->":"(!)"} ${t}`)}static from(t,r=!0){return Object.assign(new this(t.message,r),t)}}class Ur extends Kt{name="CredentialsProviderError";constructor(t,r=!0){super(t,r);Object.setPrototypeOf(this,Ur.prototype)}}class ri extends Kt{name="TokenProviderError";constructor(t,r=!0){super(t,r);Object.setPrototypeOf(this,ri.prototype)}}var Yu=(...t)=>async()=>{if(t.length===0)throw new Kt("No providers in chain");let r;for(let n of t)try{return await n()}catch(s){if(r=s,s?.tryNextLink)continue;throw s}throw r},Ju=(t)=>()=>Promise.resolve(t),ni=(t,r,n)=>{let s,o,i,u=!1,a=async()=>{if(!o)o=t();try{s=await o,i=!0,u=!1}finally{o=void 0}return s};if(r===void 0)return async(d)=>{if(!i||d?.forceRefresh)s=await a();return s};return async(d)=>{if(!i||d?.forceRefresh)s=await a();if(u)return s;if(n&&!n(s))return u=!0,s;if(r(s))return await a(),s;return s}},Ge=(t,r,n)=>{if(!(r in t))return;if(t[r]==="true")return!0;if(t[r]==="false")return!1;throw Error(`Cannot load ${n} "${r}". Expected "true" or "false", got ${t[r]}.`)},o_=(t,r,n)=>{if(!(r in t))return;let s=parseInt(t[r],10);if(Number.isNaN(s))throw TypeError(`Cannot load ${n} '${r}'. Expected number, got '${t[r]}'.`);return s},_e;(function(t){t.ENV="env",t.CONFIG="shared config entry"})(_e||(_e={}));var Jo={},i_=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},$r=()=>{let{HOME:t,USERPROFILE:r,HOMEPATH:n,HOMEDRIVE:s=`C:${r_}`}=process.env;if(t)return t;if(r)return r;if(n)return`${s}${n}`;let o=i_();if(!Jo[o])Jo[o]=t_();return Jo[o]},Zu="AWS_PROFILE",ed="default",td=(t)=>t.profile||process.env[Zu]||ed,rd=(t)=>{let n=n_("sha1").update(t).digest("hex");return Lr($r(),".aws","sso","cache",`${n}.json`)},qn={},a_=async(t)=>{if(qn[t])return qn[t];let r=rd(t),n=await Xu(r,"utf8");return JSON.parse(n)},At=".",c_=(t)=>Object.entries(t).filter(([r])=>{let n=r.indexOf(At);if(n===-1)return!1;return Object.values(Hn).includes(r.substring(0,n))}).reduce((r,[n,s])=>{let o=n.indexOf(At),i=n.substring(0,o)===Hn.PROFILE?n.substring(o+1):n;return r[i]=s,r},{...t.default&&{default:t.default}}),u_="AWS_CONFIG_FILE",nd=()=>process.env[u_]||Lr($r(),".aws","config"),d_="AWS_SHARED_CREDENTIALS_FILE",l_=()=>process.env[d_]||Lr($r(),".aws","credentials"),f_=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,h_=["__proto__","profile __proto__"],ei=(t)=>{let r={},n,s;for(let o of t.split(/\r?\n/)){let i=o.split(/(^|\s)[;#]/)[0].trim();if(i[0]==="["&&i[i.length-1]==="]"){n=void 0,s=void 0;let a=i.substring(1,i.length-1),d=f_.exec(a);if(d){let[,l,,h]=d;if(Object.values(Hn).includes(l))n=[l,h].join(At)}else n=a;if(h_.includes(a))throw Error(`Found invalid profile name "${a}"`)}else if(n){let a=i.indexOf("=");if(![0,-1].includes(a)){let[d,l]=[i.substring(0,a).trim(),i.substring(a+1).trim()];if(l==="")s=d;else{if(s&&o.trimStart()===o)s=void 0;r[n]=r[n]||{};let h=s?[s,d].join(At):d;r[n][h]=l}}}}return r},Zo={},Vn={},jn=(t,r)=>{if(Vn[t]!==void 0)return Vn[t];if(!Zo[t]||r?.ignoreCache)Zo[t]=Xu(t,"utf8");return Zo[t]},zu=()=>({}),si=async(t={})=>{let{filepath:r=l_(),configFilepath:n=nd()}=t,s=$r(),o="~/",i=r;if(r.startsWith("~/"))i=Lr(s,r.slice(2));let u=n;if(n.startsWith("~/"))u=Lr(s,n.slice(2));let a=await Promise.all([jn(u,{ignoreCache:t.ignoreCache}).then(ei).then(c_).catch(zu),jn(i,{ignoreCache:t.ignoreCache}).then(ei).catch(zu)]);return{configFile:a[0],credentialsFile:a[1]}},p_=(t)=>Object.entries(t).filter(([r])=>r.startsWith(Hn.SSO_SESSION+At)).reduce((r,[n,s])=>({...r,[n.substring(n.indexOf(At)+1)]:s}),{}),g_=()=>({}),m_=async(t={})=>jn(t.configFilepath??nd()).then(ei).then(p_).catch(g_),y_=(...t)=>{let r={};for(let n of t)for(let[s,o]of Object.entries(n))if(r[s]!==void 0)Object.assign(r[s],o);else r[s]=o;return r},S_=async(t)=>{let r=await si(t);return y_(r.configFile,r.credentialsFile)},w_={getFileRecord(){return Vn},interceptFile(t,r){Vn[t]=Promise.resolve(r)},getTokenRecord(){return qn},interceptToken(t,r){qn[t]=r}};function sd(t){try{let r=new Set(Array.from(t.match(/([A-Z_]){3,}/g)??[]));return r.delete("CONFIG"),r.delete("CONFIG_PREFIX_SEPARATOR"),r.delete("ENV"),[...r].join(", ")}catch(r){return t}}var E_=(t,r)=>async()=>{try{let n=t(process.env,r);if(n===void 0)throw Error();return n}catch(n){throw new Ur(n.message||`Not found in ENV: ${sd(t.toString())}`,{logger:r?.logger})}},b_=(t,{preferredFile:r="config",...n}={})=>async()=>{let s=td(n),{configFile:o,credentialsFile:i}=await si(n),u=i[s]||{},a=o[s]||{},d=r==="config"?{...u,...a}:{...a,...u};try{let h=t(d,r==="config"?o:i);if(h===void 0)throw Error();return h}catch(l){throw new Ur(l.message||`Not found in config files w/ profile [${s}]: ${sd(t.toString())}`,{logger:n.logger})}},__=(t)=>typeof t==="function",od=(t)=>__(t)?async()=>await t():Ju(t),ti=({environmentVariableSelector:t,configFileSelector:r,default:n},s={})=>{let{signingName:o,logger:i}=s;return ni(Yu(E_(t,{signingName:o,logger:i}),b_(r,s),od(n)))},oi="AWS_USE_DUALSTACK_ENDPOINT",ii="use_dualstack_endpoint",A_=!1,x_={environmentVariableSelector:(t)=>Ge(t,oi,_e.ENV),configFileSelector:(t)=>Ge(t,ii,_e.CONFIG),default:!1},T_={environmentVariableSelector:(t)=>Ge(t,oi,_e.ENV),configFileSelector:(t)=>Ge(t,ii,_e.CONFIG),default:void 0},ai="AWS_USE_FIPS_ENDPOINT",ci="use_fips_endpoint",C_=!1,I_={environmentVariableSelector:(t)=>Ge(t,ai,_e.ENV),configFileSelector:(t)=>Ge(t,ci,_e.CONFIG),default:!1},R_={environmentVariableSelector:(t)=>Ge(t,ai,_e.ENV),configFileSelector:(t)=>Ge(t,ci,_e.CONFIG),default:void 0},v_=(t)=>{let{tls:r,endpoint:n,urlParser:s,useDualstackEndpoint:o}=t;return Object.assign(t,{tls:r??!0,endpoint:zn(typeof n==="string"?s(n):n),isCustomEndpoint:!0,useDualstackEndpoint:zn(o??!1)})},N_=async(t)=>{let{tls:r=!0}=t,n=await t.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(n))throw Error("Invalid region in client config");let o=await t.useDualstackEndpoint(),i=await t.useFipsEndpoint(),{hostname:u}=await t.regionInfoProvider(n,{useDualstackEndpoint:o,useFipsEndpoint:i})??{};if(!u)throw Error("Cannot resolve hostname from client config");return t.urlParser(`${r?"https:":"http:"}//${u}`)},O_=(t)=>{let r=zn(t.useDualstackEndpoint??!1),{endpoint:n,useFipsEndpoint:s,urlParser:o,tls:i}=t;return Object.assign(t,{tls:i??!0,endpoint:n?zn(typeof n==="string"?o(n):n):()=>N_({...t,useDualstackEndpoint:r,useFipsEndpoint:s}),isCustomEndpoint:!!n,useDualstackEndpoint:r})},P_="AWS_EXECUTION_ENV",qu="AWS_REGION",Vu="AWS_DEFAULT_REGION",k_="AWS_EC2_METADATA_DISABLED",M_=["in-region","cross-region","mobile","standard","legacy"],D_="/latest/meta-data/placement/region",F_="/latest/api/token",L_="x-aws-ec2-metadata-token",U_="x-aws-ec2-metadata-token-ttl-seconds",ju=1000,$_=60000,id=0,ad=async()=>{if(process.env[k_])return;if(Date.now()<id)return;try{let t=B_(),r=(await Gu({...t,path:F_,method:"PUT",headers:{[U_]:"21600"}})).toString();return(await Gu({...t,path:D_,method:"GET",headers:{[L_]:r}})).toString().trim()||Wu()}catch{return Wu()}},Wu=()=>{id=Date.now()+$_;return},B_=()=>{let t=process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;if(t){let r=new URL(t);return{hostname:r.hostname.replace(/^\[(.+)]$/,"$1"),port:r.port?Number(r.port):void 0}}if(process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE==="IPv6")return{hostname:"fd00:ec2::254"};return{hostname:"169.254.169.254"}},Gu=async(t)=>{let{request:r}=c("node:http");return new Promise((n,s)=>{let o=r({hostname:t.hostname,port:t.port,path:t.path,method:t.method,headers:t.headers,timeout:ju,signal:AbortSignal.timeout(ju)});o.on("error",(i)=>{s(i),o.destroy()}),o.on("timeout",()=>{s(Error("TimeoutError from instance metadata service")),o.destroy()}),o.on("response",(i)=>{let{statusCode:u=400}=i;if(u<200||u>=300){s(Object.assign(Error("Error response received from instance metadata service"),{statusCode:u})),o.destroy();return}let a=[];i.on("data",(d)=>a.push(d)),i.on("end",()=>{n(Buffer.concat(a)),o.destroy()})}),o.end()})},cd="AWS_REGION",ud="region",dd={environmentVariableSelector:(t)=>t[cd],configFileSelector:(t)=>t[ud],default:async()=>{let t=await ad();if(t)return t;throw Error("Region is missing")}},H_={preferredFile:"credentials"},Ku=new Set,z_=(t,r=s_)=>{if(!Ku.has(t)&&!r(t))if(t==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw Error(`Region not accepted: region="${t}" is not a valid hostname component.`);else Ku.add(t)},ld=(t)=>typeof t==="string"&&(t.startsWith("fips-")||t.endsWith("-fips")),q_=(t)=>ld(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t,V_=(t)=>{let{region:r,useFipsEndpoint:n}=t;if(!r)throw Error("Region is missing");return Object.assign(t,{region:async()=>{let s=typeof r==="function"?await r():r,o=q_(s);return z_(o),o},useFipsEndpoint:async()=>{let s=typeof r==="string"?r:await r();if(ld(s))return!0;return typeof n!=="function"?Promise.resolve(!!n):n()}})},Qu=(t=[],{useFipsEndpoint:r,useDualstackEndpoint:n})=>t.find(({tags:s})=>r===s.includes("fips")&&n===s.includes("dualstack"))?.hostname,j_=(t,{regionHostname:r,partitionHostname:n})=>r?r:n?n.replace("{region}",t):void 0,W_=(t,{partitionHash:r})=>Object.keys(r||{}).find((n)=>r[n].regions.includes(t))??"aws",G_=(t,{signingRegion:r,regionRegex:n,useFipsEndpoint:s})=>{if(r)return r;else if(s){let o=n.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),i=t.match(o);if(i)return i[0].slice(1,-1)}},K_=(t,{useFipsEndpoint:r=!1,useDualstackEndpoint:n=!1,signingService:s,regionHash:o,partitionHash:i})=>{let u=W_(t,{partitionHash:i}),a=t in o?t:i[u]?.endpoint??t,d={useFipsEndpoint:r,useDualstackEndpoint:n},l=Qu(o[a]?.variants,d),h=Qu(i[u]?.variants,d),f=j_(a,{regionHostname:l,partitionHostname:h});if(f===void 0)throw Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:r,useDualstackEndpoint:n}}`);let p=G_(f,{signingRegion:o[a]?.signingRegion,regionRegex:i[u].regionRegex,useFipsEndpoint:r});return{partition:u,signingService:s,hostname:f,...p&&{signingRegion:p},...o[a]?.signingService&&{signingService:o[a].signingService}}},Q_="AWS_DEFAULTS_MODE",X_="defaults_mode",Y_={environmentVariableSelector:(t)=>t[Q_],configFileSelector:(t)=>t[X_],default:"legacy"},J_=({region:t=ti(dd),defaultsMode:r=ti(Y_)}={})=>ni(async()=>{let n=typeof r==="function"?await r():r;switch(n?.toLowerCase()){case"auto":return Z_(t);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(n?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw Error(`Invalid parameter for "defaultsMode", expect ${M_.join(", ")}, got ${n}`)}}),Z_=async(t)=>{if(t){let r=typeof t==="function"?await t():t,n=await eA();if(!n)return"standard";if(r===n)return"in-region";else return"cross-region"}return"standard"},eA=async()=>{if(process.env[P_]&&(process.env[qu]||process.env[Vu]))return process.env[qu]??process.env[Vu];return ad()};tA.CONFIG_PREFIX_SEPARATOR=At;tA.CONFIG_USE_DUALSTACK_ENDPOINT=ii;tA.CONFIG_USE_FIPS_ENDPOINT=ci;tA.CredentialsProviderError=Ur;tA.DEFAULT_PROFILE=ed;tA.DEFAULT_USE_DUALSTACK_ENDPOINT=A_;tA.DEFAULT_USE_FIPS_ENDPOINT=C_;tA.ENV_PROFILE=Zu;tA.ENV_USE_DUALSTACK_ENDPOINT=oi;tA.ENV_USE_FIPS_ENDPOINT=ai;tA.NODE_REGION_CONFIG_FILE_OPTIONS=H_;tA.NODE_REGION_CONFIG_OPTIONS=dd;tA.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=x_;tA.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=I_;tA.ProviderError=Kt;tA.REGION_ENV_NAME=cd;tA.REGION_INI_NAME=ud;tA.SelectorType=_e;tA.TokenProviderError=ri;tA.booleanSelector=Ge;tA.chain=Yu;tA.externalDataInterceptor=w_;tA.fromStatic=od;tA.fromValue=Ju;tA.getHomeDir=$r;tA.getProfileName=td;tA.getRegionInfo=K_;tA.getSSOTokenFilepath=rd;tA.getSSOTokenFromFile=a_;tA.loadConfig=ti;tA.loadSharedConfigFiles=si;tA.loadSsoSessionData=m_;tA.memoize=ni;tA.nodeDualstackConfigSelectors=T_;tA.nodeFipsConfigSelectors=R_;tA.numberSelector=o_;tA.parseKnownFiles=S_;tA.readFile=jn;tA.resolveCustomEndpointsConfig=v_;tA.resolveDefaultsModeConfig=J_;tA.resolveEndpointsConfig=O_;tA.resolveRegionConfig=V_});var He=e(function(Fx){var{CONFIG_PREFIX_SEPARATOR:fd,booleanSelector:hd,SelectorType:pd,loadConfig:gd}=V(),{toEndpointV1:Wn,getSmithyContext:KA,normalizeProvider:ui,isValidHostLabel:Sd,hasOwn:XA}=me();Fx.isValidHostLabel=Sd;Fx.middlewareEndpointToEndpointV1=Wn;Fx.toEndpointV1=Wn;var{EndpointURLScheme:fi}=bt(),md="AWS_ENDPOINT_URL",yd="endpoint_url",YA=(t)=>({environmentVariableSelector:(r)=>{let n=t.split(" ").map((i)=>i.toUpperCase()),s=r[[md,...n].join("_")];if(s)return s;let o=r[md];if(o)return o;return},configFileSelector:(r,n)=>{if(r.services){let o=["services",r.services].join(fd);if(!n||!n[o])throw Error(`The services section "${r.services}" specified in the profile is not present in the shared configuration file.`);let i=n[o],u=t.split(" ").map((d)=>d.toLowerCase()),a=i[[u.join("_"),yd].join(fd)];if(a)return a}let s=r[yd];if(s)return s;return},default:void 0}),JA="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",ZA="ignore_configured_endpoint_urls",ex={environmentVariableSelector:(t)=>hd(t,JA,pd.ENV),configFileSelector:(t)=>hd(t,ZA,pd.CONFIG),default:!1},Gn=async(t)=>{if(await gd(ex)())return;return gd(YA(t??""))()},tx=async(t)=>{let r=t?.Bucket||"";if(typeof t.Bucket==="string")t.Bucket=r.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(ix(r)){if(t.ForcePathStyle===!0)throw Error("Path-style addressing cannot be used with ARN buckets")}else if(!ox(r)||r.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||r.toLowerCase()!==r||r.length<3)t.ForcePathStyle=!0;if(t.DisableMultiRegionAccessPoints)t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0;return t},rx=/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,nx=/(\d+\.){3}\d+/,sx=/\.\./,ox=(t)=>rx.test(t)&&!nx.test(t)&&!sx.test(t),ix=(t)=>{let[r,n,s,,,o]=t.split(":"),i=r==="arn"&&t.split(":").length>=6,u=Boolean(i&&n&&s&&o);if(i&&!u)throw Error(`Invalid ARN: ${t} was an invalid ARN.`);return u},ax=(t,r,n,s=!1)=>{let o=async()=>{let i;if(s)i=n.clientContextParams?.[t]??n[t]??n[r];else i=n[t]??n[r];if(typeof i==="function")return i();return i};if(t==="credentialScope"||r==="CredentialScope")return async()=>{let i=typeof n.credentials==="function"?await n.credentials():n.credentials;return i?.credentialScope??i?.CredentialScope};if(t==="accountId"||r==="AccountId")return async()=>{let i=typeof n.credentials==="function"?await n.credentials():n.credentials;return i?.accountId??i?.AccountId};if(t==="endpoint"||r==="endpoint")return async()=>{if(n.isCustomEndpoint===!1)return;let i=await o();if(i&&typeof i==="object"){if("url"in i)return i.url.href;if("hostname"in i){let{protocol:u,hostname:a,port:d,path:l}=i;return`${u}//${a}${d?":"+d:""}${l}`}}return i};return o};function wd(t){return async(r,n,s,o)=>{if(!s.isCustomEndpoint&&!s.ignoreConfiguredEndpointUrls){let a;if(s.serviceConfiguredEndpoint)a=await s.serviceConfiguredEndpoint();else a=await t(s.serviceId);if(a)s.endpoint=()=>Promise.resolve(Wn(a)),s.isCustomEndpoint=!0,o?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${a}`)}let i=await Ed(r,n,s);if(typeof s.endpointProvider!=="function")throw Error("config.endpointProvider is not set.");let u=s.endpointProvider(i,o);if(s.isCustomEndpoint&&s.endpoint){let a=await s.endpoint();if(a?.headers){u.headers??={};for(let[d,l]of Object.entries(a.headers))u.headers[d]=Array.isArray(l)?l:[l]}}return u}}var Ed=async(t,r,n)=>{let s={},o=r?.getEndpointParameterInstructions?.()||{};for(let[i,u]of Object.entries(o))switch(u.type){case"staticContextParams":s[i]=u.value;break;case"contextParams":s[i]=t[u.name];break;case"clientContextParams":case"builtInParams":s[i]=await ax(u.name,i,n,u.type!=="builtInParams")();break;case"operationContextParams":s[i]=u.get(t);break;default:throw Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(u))}if(Object.keys(o).length===0)Object.assign(s,n);if(String(n.serviceId).toLowerCase()==="s3")await tx(s);return s};function cx(t,r,n){if(!t.__smithy_context)t.__smithy_context={features:{}};else if(!t.__smithy_context.features)t.__smithy_context.features={};t.__smithy_context.features[r]=n}function bd(t){let r=wd(t);return({config:n,instructions:s})=>(o,i)=>async(u)=>{if(n.isCustomEndpoint)cx(i,"ENDPOINT_OVERRIDE","N");let a=await r(u.input,{getEndpointParameterInstructions(){return s}},{...n},i);i.endpointV2=a,i.authSchemes=a.properties?.authSchemes;let d=i.authSchemes?.[0];if(d){i.signing_region=d.signingRegion,i.signing_service=d.signingName;let h=KA(i)?.selectedHttpAuthScheme?.httpAuthOption;if(h)h.signingProperties=Object.assign(h.signingProperties||{},{signing_region:d.signingRegion,signingRegion:d.signingRegion,signing_service:d.signingName,signingName:d.signingName,signingRegionSet:d.signingRegionSet},d.properties)}return o({...u})}}var ux={name:"serializerMiddleware"},_d={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:ux.name};function dx(t){let r=bd(t);return(n,s)=>({applyToStack:(o)=>{o.addRelativeTo(r({config:n,instructions:s}),_d)}})}function lx(t){return(r)=>{let n=r.tls??!0,{endpoint:s,useDualstackEndpoint:o,useFipsEndpoint:i}=r,u=s!=null?async()=>Wn(await ui(s)()):void 0,d=Object.assign(r,{endpoint:u,tls:n,isCustomEndpoint:!!s,useDualstackEndpoint:ui(o??!1),useFipsEndpoint:ui(i??!1),ignoreConfiguredEndpointUrls:!!r.ignoreConfiguredEndpointUrls}),l=void 0;return d.serviceConfiguredEndpoint=async()=>{if(r.serviceId&&!l)l=t(r.serviceId);return l},d}}class hi{nodes;root;conditions;results;constructor(t,r,n,s){this.nodes=t,this.root=r,this.conditions=n,this.results=s}static from(t,r,n,s){return new hi(t,r,n,s)}}class Ad{capacity;data=new Map;parameters=[];constructor({size:t,params:r}){if(this.capacity=t??50,r)this.parameters=r}get(t,r){let n=this.hash(t);if(n===!1)return r();if(!this.data.has(n)){if(this.data.size>this.capacity+10){let s=this.data.keys(),o=0;while(!0){let{value:i,done:u}=s.next();if(this.data.delete(i),u||++o>10)break}}this.data.set(n,r())}return this.data.get(n)}size(){return this.data.size}hash(t){let r="",{parameters:n}=this;if(n.length===0)return!1;for(let s of n){let o=String(t[s]??"");if(o.includes("|;"))return!1;r+=o+"|;"}return r}}class Z extends Error{constructor(t){super(t);this.name="EndpointError"}}var Br="endpoints";function rt(t){if(typeof t!=="object"||t==null)return t;if("ref"in t)return`$${rt(t.ref)}`;if("fn"in t)return`${t.fn}(${(t.argv||[]).map(rt).join(", ")})`;return JSON.stringify(t,null,2)}var xd={},fx=(t,r)=>t===r;function hx(...t){for(let r of t)if(r!=null)return r;return}var px=(t)=>{let r=t.split("."),n=[];for(let s of r){let o=s.indexOf("[");if(o!==-1){if(s.indexOf("]")!==s.length-1)throw new Z(`Path: '${t}' does not end with ']'`);let i=s.slice(o+1,-1);if(Number.isNaN(parseInt(i)))throw new Z(`Invalid array index: '${i}' in path: '${t}'`);if(o!==0)n.push(s.slice(0,o));n.push(i)}else n.push(s)}return n},Td=(t,r)=>px(r).reduce((n,s)=>{if(typeof n!=="object")throw new Z(`Index '${s}' in '${r}' not found in '${JSON.stringify(t)}'`);else if(Array.isArray(n)){let o=parseInt(s);return n[o<0?n.length+o:o]}return n[s]},t),gx=(t)=>t!=null;function mx(t,r,n){return t?r:n}var yx=(t)=>!t,Sx=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}$"),Cd=(t)=>Sx.test(t)||t.startsWith("[")&&t.endsWith("]"),di={[fi.HTTP]:80,[fi.HTTPS]:443},wx=(t)=>{let r=(()=>{try{if(t instanceof URL)return t;if(typeof t==="object"&&"hostname"in t){let{hostname:p,port:g,protocol:m="",path:y="",query:S={}}=t,w=new URL(`${m}//${p}${g?`:${g}`:""}${y}`);return w.search=Object.entries(S).map(([E,A])=>`${E}=${A}`).join("&"),w}return new URL(t)}catch(p){return null}})();if(!r)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;let n=r.href,{host:s,hostname:o,pathname:i,protocol:u,search:a}=r;if(a)return null;let d=u.slice(0,-1);if(!Object.values(fi).includes(d))return null;let l=Cd(o),h=n.includes(`${s}:${di[d]}`)||typeof t==="string"&&t.includes(`${s}:${di[d]}`),f=`${s}${h?`:${di[d]}`:""}`;return{scheme:d,authority:f,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:l}};function Ex(t,r,n){if(n===1)return[t];if(t==="")return[""];let s=t.split(r);if(n===0)return s;return s.slice(0,n-1).concat(s.slice(1).join(r))}var bx=(t,r)=>t===r,_x=(t,r,n,s)=>{if(t==null||r>=n||t.length<n||/[^\u0000-\u007f]/.test(t))return null;if(!s)return t.substring(r,n);return t.substring(t.length-n,t.length-r)},Ax=(t)=>encodeURIComponent(t).replace(/[!*'()]/g,(r)=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`),xx={booleanEquals:fx,coalesce:hx,getAttr:Td,isSet:gx,isValidHostLabel:Sd,ite:mx,not:yx,parseURL:wx,split:Ex,stringEquals:bx,substring:_x,uriEncode:Ax},Id=(t,r)=>{let n=[],{referenceRecord:s,endpointParams:o}=r,i=0;while(i<t.length){let u=t.indexOf("{",i);if(u===-1){n.push(t.slice(i));break}n.push(t.slice(i,u));let a=t.indexOf("}",u);if(a===-1){n.push(t.slice(u));break}if(t[u+1]==="{"&&t[a+1]==="}")n.push(t.slice(u+1,a)),i=a+2;let d=t.substring(u+1,a);if(d.includes("#")){let[l,h]=d.split("#");n.push(Td(s[l]??o[l],h))}else n.push(s[d]??o[d]);i=a+1}return n.join("")},Tx=({ref:t},r)=>r.referenceRecord[t]??r.endpointParams[t],Hr=(t,r,n)=>{if(typeof t==="string")return Id(t,n);else if(t.fn)return vd.callFunction(t,n);else if(t.ref)return Tx(t,n);throw new Z(`'${r}': ${String(t)} is not a string, function or reference.`)},Rd=({fn:t,argv:r},n)=>{let s=Array(r.length);for(let u=0;u<s.length;++u){let a=r[u];if(typeof a==="boolean"||typeof a==="number")s[u]=a;else s[u]=vd.evaluateExpression(a,"arg",n)}let o=t.indexOf(".");if(o!==-1){let a=xd[t.slice(0,o)]?.[t.slice(o+1)];if(typeof a==="function")return a(...s)}let i=xx[t];if(typeof i==="function")return i(...s);throw Error(`function ${t} not loaded in endpointFunctions.`)},vd={evaluateExpression:Hr,callFunction:Rd},Nd=(t,r)=>{let{assign:n}=t;if(n&&n in r.referenceRecord)throw new Z(`'${n}' is already defined in Reference Record.`);let s=Rd(t,r);r.logger?.debug?.(`${Br} evaluateCondition: ${rt(t)} = ${rt(s)}`);let o=s===""?!0:!!s;if(n!=null)return{result:o,toAssign:{name:n,value:s}};return{result:o}},Od=(t,r)=>Object.entries(t??{}).reduce((n,[s,o])=>(n[s]=o.map((i)=>{let u=Hr(i,"Header value entry",r);if(typeof u!=="string")throw new Z(`Header '${s}' value '${u}' is not a string`);return u}),n),{}),pi=(t,r)=>Object.entries(t).reduce((n,[s,o])=>(n[s]=kd.getEndpointProperty(o,r),n),{}),Pd=(t,r)=>{if(Array.isArray(t))return t.map((n)=>Pd(n,r));switch(typeof t){case"string":return Id(t,r);case"object":if(t===null)throw new Z(`Unexpected endpoint property: ${t}`);return kd.getEndpointProperties(t,r);case"boolean":return t;default:throw new Z(`Unexpected endpoint property type: ${typeof t}`)}},kd={getEndpointProperty:Pd,getEndpointProperties:pi},Md=(t,r)=>{let n=Hr(t,"Endpoint URL",r);if(typeof n==="string")try{return new URL(n)}catch(s){throw console.error(`Failed to construct URL with ${n}`,s),s}throw new Z(`Endpoint URL must be a string, got ${typeof n}`)},li=1e8,Cx=(t,r)=>{let{nodes:n,root:s,results:o,conditions:i}=t,u=s,a={},d={referenceRecord:a,endpointParams:r.endpointParams,logger:r.logger};while(u!==1&&u!==-1&&u<li){let l=3*(Math.abs(u)-1),[h,f,p]=[n[l],n[l+1],n[l+2]],[g,m,y]=i[h],S=Nd({fn:g,assign:y,argv:m},d);if(S.toAssign){let{name:w,value:E}=S.toAssign;a[w]=E}u=u>=0===S.result?f:p}if(u>=li){let l=o[u-li];if(l[0]===-1){let[,g]=l;throw new Z(Hr(g,"Error",d))}let[h,f,p]=l;return{url:Md(h,d),properties:pi(f,d),headers:Od(p??{},d)}}throw new Z("No matching endpoint.")},gi=(t=[],r)=>{let n={},s={...r,referenceRecord:{...r.referenceRecord}},o=!1;for(let i of t){let{result:u,toAssign:a}=Nd(i,s);if(!u)return{result:u};if(a)o=!0,n[a.name]=a.value,s.referenceRecord[a.name]=a.value,r.logger?.debug?.(`${Br} assign: ${a.name} := ${rt(a.value)}`)}if(o)return{result:!0,referenceRecord:n};return{result:!0}},Ix=(t,r)=>{let{conditions:n,endpoint:s}=t,{result:o,referenceRecord:i}=gi(n,r);if(!o)return;let u=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r,{url:a,properties:d,headers:l}=s;r.logger?.debug?.(`${Br} Resolving endpoint from template: ${rt(s)}`);let h={url:Md(a,u)};if(l!=null)h.headers=Od(l,u);if(d!=null)h.properties=pi(d,u);return h},Rx=(t,r)=>{let{conditions:n,error:s}=t,{result:o,referenceRecord:i}=gi(n,r);if(!o)return;let u=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r;throw new Z(Hr(s,"Error",u))},Dd=(t,r)=>{for(let n of t)if(n.type==="endpoint"){let s=Ix(n,r);if(s)return s}else if(n.type==="error")Rx(n,r);else if(n.type==="tree"){let s=Fd.evaluateTreeRule(n,r);if(s)return s}else throw new Z(`Unknown endpoint rule: ${n}`);throw new Z("Rules evaluation failed")},vx=(t,r)=>{let{conditions:n,rules:s}=t,{result:o,referenceRecord:i}=gi(n,r);if(!o)return;let u=i?{...r,referenceRecord:{...r.referenceRecord,...i}}:r;return Fd.evaluateRules(s,u)},Fd={evaluateRules:Dd,evaluateTreeRule:vx},Nx=(t,r)=>{let{endpointParams:n,logger:s}=r,{parameters:o,rules:i}=t;r.logger?.debug?.(`${Br} Initial EndpointParams: ${rt(n)}`);for(let a in o){if(!XA(o,a))continue;let d=o[a],l=n[a];if(l==null&&d.default!=null){n[a]=d.default;continue}if(d.required&&l==null)throw new Z(`Missing required parameter: '${a}'`)}let u=Dd(i,{endpointParams:n,logger:s,referenceRecord:{}});return r.logger?.debug?.(`${Br} Resolved endpoint: ${rt(u)}`),u},Ox=(t)=>{let{endpoint:r}=t;if(r===void 0)t.endpoint=async()=>{throw Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")};return t},Px=wd(Gn),kx=lx(Gn),Mx=bd(Gn),Dx=dx(Gn);Fx.BinaryDecisionDiagram=hi;Fx.EndpointCache=Ad;Fx.EndpointError=Z;Fx.customEndpointFunctions=xd;Fx.decideEndpoint=Cx;Fx.endpointMiddleware=Mx;Fx.endpointMiddlewareOptions=_d;Fx.getEndpointFromInstructions=Px;Fx.getEndpointPlugin=Dx;Fx.isIpAddress=Cd;Fx.resolveEndpoint=Nx;Fx.resolveEndpointConfig=kx;Fx.resolveEndpointRequiredConfig=Ox;Fx.resolveParams=Ed});var X=e(function(RT){var{createHmac:e0,createHash:t0,getRandomValues:r0}=c("node:crypto"),{hasOwn:Vd,HttpResponse:n0}=me();RT.hasOwn=Vd;var{ReadStream:s0,lstatSync:o0,fstatSync:i0}=c("node:fs"),{toEndpointV1:a0}=He(),{Readable:Qt,Writable:jd,PassThrough:Ld}=c("node:stream"),Wd=(t)=>typeof ArrayBuffer==="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",Yt=(t,r=0,n=t.byteLength-r)=>{if(!Wd(t))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Buffer.from(t,r,n)},Yn=(t,r)=>{if(typeof t!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return r?Buffer.from(t,r):Buffer.from(t)},c0=/^[A-Za-z0-9+/]*={0,2}$/,Gd=(t)=>{if(t.length*3%4!==0)throw TypeError("Incorrect padding on base64 string.");if(!c0.exec(t))throw TypeError("Invalid base64 string.");let r=Yn(t,"base64");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)},Jn=(t)=>{let r=Yn(t,"utf8");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Ai=(t)=>{let r;if(typeof t==="string")r=Jn(t);else r=t;if(typeof r!=="object"||typeof r.byteOffset!=="number"||typeof r.byteLength!=="number")throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return Yt(r.buffer,r.byteOffset,r.byteLength).toString("base64")};function u0(t,r,n,s){return class o extends Uint8Array{static fromString(i,u="utf-8"){if(typeof i==="string"){if(u==="base64")return o.mutate(s(i));return o.mutate(r(i))}throw Error(`Unsupported conversion from ${typeof i} to Uint8ArrayBlobAdapter.`)}static mutate(i){return Object.setPrototypeOf(i,o.prototype),i}transformToString(i="utf-8"){if(i==="base64")return n(this);return t(this)}}}var Kd=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return Yt(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},ie=Array.from({length:256},(t,r)=>r.toString(16).padStart(2,"0"));function d0(t){if(typeof crypto<"u"&&typeof crypto.randomUUID==="function")return()=>crypto.randomUUID();return()=>{let r=new Uint8Array(16);return t(r),r[6]=r[6]&15|64,r[8]=r[8]&63|128,ie[r[0]]+ie[r[1]]+ie[r[2]]+ie[r[3]]+"-"+ie[r[4]]+ie[r[5]]+"-"+ie[r[6]]+ie[r[7]]+"-"+ie[r[8]]+ie[r[9]]+"-"+ie[r[10]]+ie[r[11]]+ie[r[12]]+ie[r[13]]+ie[r[14]]+ie[r[15]]}}var l0=(t,r,n=(s)=>s)=>t,f0=(t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw Error(`Unable to parse boolean value "${t}"`)}},h0=(t)=>{if(t===null||t===void 0)return;if(typeof t==="number"){if(t===0||t===1)jr.warn(Qn(`Expected boolean, got ${typeof t}: ${t}`));if(t===0)return!1;if(t===1)return!0}if(typeof t==="string"){let r=t.toLowerCase();if(r==="false"||r==="true")jr.warn(Qn(`Expected boolean, got ${typeof t}: ${t}`));if(r==="false")return!1;if(r==="true")return!0}if(typeof t==="boolean")return t;throw TypeError(`Expected boolean, got ${typeof t}: ${t}`)},qr=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string"){let r=parseFloat(t);if(!Number.isNaN(r)){if(String(r)!==String(t))jr.warn(Qn(`Expected number but observed string: ${t}`));return r}}if(typeof t==="number")return t;throw TypeError(`Expected number, got ${typeof t}: ${t}`)},p0=Math.ceil(340282346638528860000000000000000000000),Kn=(t)=>{let r=qr(t);if(r!==void 0&&!Number.isNaN(r)&&r!==1/0&&r!==-1/0){if(Math.abs(r)>p0)throw TypeError(`Expected 32-bit float, got ${t}`)}return r},Vr=(t)=>{if(t===null||t===void 0)return;if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw TypeError(`Expected integer, got ${typeof t}: ${t}`)},g0=Vr,wi=(t)=>xi(t,32),Ei=(t)=>xi(t,16),bi=(t)=>xi(t,8),xi=(t,r)=>{let n=Vr(t);if(n!==void 0&&m0(n,r)!==n)throw TypeError(`Expected ${r}-bit integer, got ${t}`);return n},m0=(t,r)=>{switch(r){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},y0=(t,r)=>{if(t===null||t===void 0){if(r)throw TypeError(`Expected a non-null value for ${r}`);throw TypeError("Expected a non-null value")}return t},Qd=(t)=>{if(t===null||t===void 0)return;if(typeof t==="object"&&!Array.isArray(t))return t;let r=Array.isArray(t)?"array":typeof t;throw TypeError(`Expected object, got ${r}: ${t}`)},S0=(t)=>{if(t===null||t===void 0)return;if(typeof t==="string")return t;if(["boolean","number","bigint"].includes(typeof t))return jr.warn(Qn(`Expected string, got ${typeof t}: ${t}`)),String(t);throw TypeError(`Expected string, got ${typeof t}: ${t}`)},w0=(t)=>{if(t===null||t===void 0)return;let r=Qd(t),n=[];for(let s in r){if(!Vd(r,s))continue;if(r[s]!=null)n.push(s)}if(n.length===0)throw TypeError("Unions must have exactly one non-null member. None were found.");if(n.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${n} were not null.`);return r},Ti=(t)=>{if(typeof t=="string")return qr(tr(t));return qr(t)},E0=Ti,Xd=(t)=>{if(typeof t=="string")return Kn(tr(t));return Kn(t)},b0=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,tr=(t)=>{let r=t.match(b0);if(r===null||r[0].length!==t.length)throw TypeError("Expected real number, got implicit NaN");return parseFloat(t)},Ci=(t)=>{if(typeof t=="string")return Yd(t);return qr(t)},_0=Ci,A0=Ci,x0=(t)=>{if(typeof t=="string")return Yd(t);return Kn(t)},Yd=(t)=>{switch(t){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw Error(`Unable to parse float value: ${t}`)}},Jd=(t)=>{if(typeof t==="string")return Vr(tr(t));return Vr(t)},T0=Jd,C0=(t)=>{if(typeof t==="string")return wi(tr(t));return wi(t)},Jt=(t)=>{if(typeof t==="string")return Ei(tr(t));return Ei(t)},Zd=(t)=>{if(typeof t==="string")return bi(tr(t));return bi(t)},Qn=(t)=>String(TypeError(t).stack||t).split(`
|
|
4
|
-
`).slice(0,5).filter((r)=>!r.includes("stackTraceWarning")).join(`
|
|
5
|
-
`),jr={warn:console.warn},I0=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ii=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R0(t){let r=t.getUTCFullYear(),n=t.getUTCMonth(),s=t.getUTCDay(),o=t.getUTCDate(),i=t.getUTCHours(),u=t.getUTCMinutes(),a=t.getUTCSeconds(),d=o<10?`0${o}`:`${o}`,l=i<10?`0${i}`:`${i}`,h=u<10?`0${u}`:`${u}`,f=a<10?`0${a}`:`${a}`;return`${I0[s]}, ${d} ${Ii[n]} ${r} ${l}:${h}:${f} GMT`}var v0=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),N0=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let r=v0.exec(t);if(!r)throw TypeError("Invalid RFC-3339 date-time value");let[n,s,o,i,u,a,d,l]=r,h=Jt(er(s)),f=De(o,"month",1,12),p=De(i,"day",1,31);return zr(h,f,p,{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l})},O0=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/),P0=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let r=O0.exec(t);if(!r)throw TypeError("Invalid RFC-3339 date-time value");let[n,s,o,i,u,a,d,l,h]=r,f=Jt(er(s)),p=De(o,"month",1,12),g=De(i,"day",1,31),m=zr(f,p,g,{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l});if(h.toUpperCase()!="Z")m.setTime(m.getTime()-j0(h));return m},k0=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$/),M0=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$/),D0=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})$/),F0=(t)=>{if(t===null||t===void 0)return;if(typeof t!=="string")throw TypeError("RFC-7231 date-times must be expressed as strings");let r=k0.exec(t);if(r){let[n,s,o,i,u,a,d,l]=r;return zr(Jt(er(i)),mi(o),De(s,"day",1,31),{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l})}if(r=M0.exec(t),r){let[n,s,o,i,u,a,d,l]=r;return B0(zr(U0(i),mi(o),De(s,"day",1,31),{hours:u,minutes:a,seconds:d,fractionalMilliseconds:l}))}if(r=D0.exec(t),r){let[n,s,o,i,u,a,d,l]=r;return zr(Jt(er(l)),mi(s),De(o.trimLeft(),"day",1,31),{hours:i,minutes:u,seconds:a,fractionalMilliseconds:d})}throw TypeError("Invalid RFC-7231 date-time value")},L0=(t)=>{if(t===null||t===void 0)return;let r;if(typeof t==="number")r=t;else if(typeof t==="string")r=Ti(t);else if(typeof t==="object"&&t.tag===1)r=t.value;else throw TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(r)||r===1/0||r===-1/0)throw TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(r*1000))},zr=(t,r,n,s)=>{let o=r-1;return z0(t,o,n),new Date(Date.UTC(t,o,n,De(s.hours,"hour",0,23),De(s.minutes,"minute",0,59),De(s.seconds,"seconds",0,60),V0(s.fractionalMilliseconds)))},U0=(t)=>{let r=new Date().getUTCFullYear(),n=Math.floor(r/100)*100+Jt(er(t));if(n<r)return n+100;return n},$0=1576800000000,B0=(t)=>{if(t.getTime()-new Date().getTime()>$0)return new Date(Date.UTC(t.getUTCFullYear()-100,t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()));return t},mi=(t)=>{let r=Ii.indexOf(t);if(r<0)throw TypeError(`Invalid month: ${t}`);return r+1},H0=[31,28,31,30,31,30,31,31,30,31,30,31],z0=(t,r,n)=>{let s=H0[r];if(r===1&&q0(t))s=29;if(n>s)throw TypeError(`Invalid day for ${Ii[r]} in ${t}: ${n}`)},q0=(t)=>t%4===0&&(t%100!==0||t%400===0),De=(t,r,n,s)=>{let o=Zd(er(t));if(o<n||o>s)throw TypeError(`${r} must be between ${n} and ${s}, inclusive`);return o},V0=(t)=>{if(t===null||t===void 0)return 0;return Xd("0."+t)*1000},j0=(t)=>{let r=t[0],n=1;if(r=="+")n=1;else if(r=="-")n=-1;else throw TypeError(`Offset direction, ${r}, must be "+" or "-"`);let s=Number(t.substring(1,3)),o=Number(t.substring(4,6));return n*(s*60+o)*60*1000},er=(t)=>{let r=0;while(r<t.length-1&&t.charAt(r)==="0")r++;if(r===0)return t;return t.slice(r)},xt=function(r){return Object.assign(new String(r),{deserializeJSON(){return JSON.parse(String(r))},toString(){return String(r)},toJSON(){return String(r)}})};xt.from=(t)=>{if(t&&typeof t==="object"&&(t instanceof xt||("deserializeJSON"in t)))return t;else if(typeof t==="string"||Object.getPrototypeOf(t)===String.prototype)return xt(String(t));return xt(JSON.stringify(t))};xt.fromObject=xt.from;function W0(t){if(t.includes(",")||t.includes('"'))t=`"${t.replace(/"/g,"\\\"")}"`;return t}var Ri="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",vi="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",Ni="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",el="(\\d?\\d)",tl="(\\d{4})",G0=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),K0=new RegExp(`^${Ri}, ${el} ${vi} ${tl} ${Ni} GMT$`),Q0=new RegExp(`^${Ri}, ${el}-${vi}-(\\d\\d) ${Ni} GMT$`),X0=new RegExp(`^${Ri} ${vi} ( [1-9]|\\d\\d) ${Ni} ${tl}$`),Y0=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],J0=(t)=>{if(t==null)return;let r=NaN;if(typeof t==="number")r=t;else if(typeof t==="string"){if(!/^-?\d*\.?\d+$/.test(t))throw TypeError("parseEpochTimestamp - numeric string invalid.");r=Number.parseFloat(t)}else if(typeof t==="object"&&t.tag===1)r=t.value;if(isNaN(r)||Math.abs(r)===1/0)throw TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(r*1000))},Z0=(t)=>{if(t==null)return;if(typeof t!=="string")throw TypeError("RFC3339 timestamps must be strings");let r=G0.exec(t);if(!r)throw TypeError(`Invalid RFC3339 timestamp format ${t}`);let[,n,s,o,i,u,a,,d,l]=r;Ke(s,1,12),Ke(o,1,31),Ke(i,0,23),Ke(u,0,59),Ke(a,0,60);let h=new Date(Date.UTC(Number(n),Number(s)-1,Number(o),Number(i),Number(u),Number(a),Number(d)?Math.round(parseFloat(`0.${d}`)*1000):0));if(h.setUTCFullYear(Number(n)),l.toUpperCase()!="Z"){let[,f,p,g]=/([+-])(\d\d):(\d\d)/.exec(l)||[void 0,"+",0,0],m=f==="-"?1:-1;h.setTime(h.getTime()+m*(Number(p)*60*60*1000+Number(g)*60*1000))}return h},eT=(t)=>{if(t==null)return;if(typeof t!=="string")throw TypeError("RFC7231 timestamps must be strings.");let r,n,s,o,i,u,a,d;if(d=K0.exec(t))[,r,n,s,o,i,u,a]=d;else if(d=Q0.exec(t))[,r,n,s,o,i,u,a]=d,s=(Number(s)+1900).toString();else if(d=X0.exec(t))[,n,r,o,i,u,a,s]=d;if(s&&u){let l=Date.UTC(Number(s),Y0.indexOf(n),Number(r),Number(o),Number(i),Number(u),a?Math.round(parseFloat(`0.${a}`)*1000):0);Ke(r,1,31),Ke(o,0,23),Ke(i,0,59),Ke(u,0,60);let h=new Date(l);return h.setUTCFullYear(Number(s)),h}throw TypeError(`Invalid RFC7231 date-time value ${t}.`)};function Ke(t,r,n){let s=Number(t);if(s<r||s>n)throw Error(`Value ${s} out of range [${r}, ${n}]`)}function tT(t,r,n){if(n<=0||!Number.isInteger(n))throw Error("Invalid number of delimiters ("+n+") for splitEvery.");let s=t.split(r);if(n===1)return s;let o=[],i="";for(let u=0;u<s.length;u++){if(i==="")i=s[u];else i+=r+s[u];if((u+1)%n===0)o.push(i),i=""}if(i!=="")o.push(i);return o}var rT=(t)=>{let r=t.length,n=[],s=!1,o=void 0,i=0;for(let u=0;u<r;++u){let a=t[u];switch(a){case'"':if(o!=="\\")s=!s;break;case",":if(!s)n.push(t.slice(i,u)),i=u+1;break}o=a}return n.push(t.slice(i)),n.map((u)=>{u=u.trim();let a=u.length;if(a<2)return u;if(u[0]==='"'&&u[a-1]==='"')u=u.slice(1,a-1);return u.replace(/\\"/g,'"')})},Ud=/^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;class Zn{string;type;constructor(t,r){if(this.string=t,this.type=r,!Ud.test(t))throw Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${t}"`)}toString(){return this.string}static[Symbol.hasInstance](t){if(!t||typeof t!=="object")return!1;let r=t;return Zn.prototype.isPrototypeOf(t)||r.type==="bigDecimal"&&Ud.test(r.string)}}function nT(t){return new Zn(String(t),"bigDecimal")}var rl={},_i={};for(let t=0;t<256;t++){let r=t.toString(16).toLowerCase();if(r.length===1)r=`0${r}`;rl[t]=r,_i[r]=t}function sT(t){if(t.length%2!==0)throw Error("Hex encoded strings must have an even number length");let r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2){let s=t.slice(n,n+2).toLowerCase();if(s in _i)r[n/2]=_i[s];else throw Error(`Cannot decode unrecognized sequence ${s} as hexadecimal`)}return r}function nl(t){let r="";for(let n=0;n<t.byteLength;n++)r+=rl[t[n]];return r}var oT=(t)=>{if(!t)return 0;if(typeof t==="string")return Buffer.byteLength(t);else if(typeof t.byteLength==="number")return t.byteLength;else if(typeof t.size==="number")return t.size;else if(typeof t.start==="number"&&typeof t.end==="number")return t.end+1-t.start;else if(t instanceof s0){if(t.path!=null)return o0(t.path).size;else if(typeof t.fd==="number")return i0(t.fd).size}throw Error(`Body Length computation failed for ${t}`)},sl=(t)=>{if(t instanceof Uint8Array)return t;if(typeof t==="string")return Jn(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(t)};function es(t,r){if(r===void 0){r=0;for(let o of t)r+=o.byteLength}let n=new Uint8Array(r),s=0;for(let o of t)n.set(o,s),s+=o.byteLength;return n}var ol=(t,r)=>(n,s)=>async(o)=>{let{response:i}=await n(o);try{let u=await r(i,t);return{response:i,output:u}}catch(u){if(Object.defineProperty(u,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in u)){try{u.message+=`
|
|
6
|
-
Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(d){if(!s.logger||s.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else s.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof u.$responseBodyText<"u"){if(u.$response)u.$response.body=u.$responseBodyText}try{if(n0.isInstance(i)){let{headers:d={}}=i,l=Object.entries(d);u.$metadata={httpStatusCode:i.statusCode,requestId:yi(/^x-[\w-]+-request-?id$/,l),extendedRequestId:yi(/^x-[\w-]+-id-2$/,l),cfId:yi(/^x-[\w-]+-cf-id$/,l)}}}catch(d){}}throw u}},yi=(t,r)=>(r.find(([n])=>n.match(t))||[void 0,void 0])[1],il=(t,r)=>(n,s)=>async(o)=>{let i=t,u=s.endpointV2?async()=>a0(s.endpointV2):i.endpoint;if(!u)throw Error("No valid endpoint provider available.");let a=await r(o.input,{...t,endpoint:u});return n({...o,request:a})},al={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},cl={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function iT(t,r,n){return{applyToStack:(s)=>{s.add(ol(t,n),al),s.add(il(t,r),cl)}}}class ul{algorithmIdentifier;secret;hash;constructor(t,r){this.algorithmIdentifier=t,this.secret=r,this.reset()}update(t,r){this.hash.update(sl($d(t,r)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?e0(this.algorithmIdentifier,$d(this.secret)):t0(this.algorithmIdentifier)}}function $d(t,r){if(Buffer.isBuffer(t))return t;if(typeof t==="string")return Yn(t,r);if(ArrayBuffer.isView(t))return Yt(t.buffer,t.byteOffset,t.byteLength);return Yt(t)}var dl=class extends Qt{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;constructor({expectedChecksum:r,checksum:n,source:s,checksumSourceLocation:o,base64Encoder:i}){super();if(typeof s.pipe!=="function")throw Error(`@smithy/util-stream: unsupported source type ${s?.constructor?.name??s} in ChecksumStream.`);this.source=s,this.base64Encoder=i??Ai,this.expectedChecksum=r,this.checksum=n,this.checksumSourceLocation=o,this.source.on("data",this.onSourceData),this.source.on("end",this.onSourceEnd),this.source.on("error",this.onSourceError),this.source.on("close",this.onSourceClose),this.source.pause()}onSourceData=(r)=>{if(this.destroyed)return;try{this.checksum.update(r)}catch(n){this.destroy(n);return}if(!this.push(r))this.source.pause()};onSourceEnd=async()=>{if(this.destroyed)return;try{let r=await this.checksum.digest(),n=this.base64Encoder(r);if(this.expectedChecksum!==n){this.destroy(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${n}" in response header "${this.checksumSourceLocation}".`));return}}catch(r){this.destroy(r);return}this.push(null)};onSourceError=(r)=>{this.destroy(r)};onSourceClose=()=>{if(!this.destroyed&&!this.source.readableEnded)this.destroy(Error("Connection lost or stream closed before all data was received."))};_read(r){this.source.resume()}_destroy(r,n){this.source?.removeListener("data",this.onSourceData),this.source?.removeListener("end",this.onSourceEnd),this.source?.removeListener("error",this.onSourceError),this.source?.removeListener("close",this.onSourceClose),this.source?.destroy(),n(r)}},Fe=(t)=>typeof ReadableStream==="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream),ts=(t)=>typeof Blob==="function"&&(t?.constructor?.name===Blob.name||t instanceof Blob),aT=(t)=>new TextEncoder().encode(t),ll="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Object.entries(ll).reduce((t,[r,n])=>(t[n]=Number(r),t),{});var cT=ll.split(""),Si=6,Bd=8,uT=63;function fl(t){let r;if(typeof t==="string")r=aT(t);else r=t;let n=typeof r==="object"&&typeof r.length==="number",s=typeof r==="object"&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number";if(!n&&!s)throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let i=0;i<r.length;i+=3){let u=0,a=0;for(let l=i,h=Math.min(i+3,r.length);l<h;l++)u|=r[l]<<(h-l-1)*Bd,a+=Bd;let d=Math.ceil(a/Si);u<<=d*Si-a;for(let l=1;l<=d;l++){let h=(d-l)*Si;o+=cT[(u&uT<<h)>>h]}o+="==".slice(0,4-d)}return o}var dT=typeof ReadableStream==="function"?ReadableStream:function(){};class hl extends dT{}var lT=({expectedChecksum:t,checksum:r,source:n,checksumSourceLocation:s,base64Encoder:o})=>{if(!Fe(n))throw Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);let i=o??fl;if(typeof TransformStream!=="function")throw Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let u=new TransformStream({start(){},async transform(d,l){r.update(d),l.enqueue(d)},async flush(d){let l=await r.digest(),h=i(l);if(t!==h){let f=Error(`Checksum mismatch: expected "${t}" but received "${h}" in response header "${s}".`);d.error(f)}else d.terminate()}});n.pipeThrough(u);let a=u.readable;return Object.setPrototypeOf(a,hl.prototype),a};function fT(t){if(typeof ReadableStream==="function"&&Fe(t.source))return lT(t);return new dl(t)}class Xn{allocByteArray;byteLength=0;byteArrays=[];constructor(t){this.allocByteArray=t}push(t){this.byteArrays.push(t),this.byteLength+=t.byteLength}flush(){if(this.byteArrays.length===1){let n=this.byteArrays[0];return this.reset(),n}let t=this.allocByteArray(this.byteLength),r=0;for(let n=0;n<this.byteArrays.length;++n){let s=this.byteArrays[n];t.set(s,r),r+=s.byteLength}return this.reset(),t}reset(){this.byteArrays=[],this.byteLength=0}}function hT(t,r,n){let s=t.getReader(),o=!1,i=0,u=["",new Xn((l)=>new Uint8Array(l))],a=-1,d=async(l)=>{let{value:h,done:f}=await s.read(),p=h;if(f){if(a!==-1){let g=Xt(u,a);if(nt(g)>0)l.enqueue(g)}l.close()}else{let g=gl(p,!1);if(a!==g){if(a>=0)l.enqueue(Xt(u,a));a=g}if(a===-1){l.enqueue(p);return}let m=nt(p);i+=m;let y=nt(u[a]);if(m>=r&&y===0)l.enqueue(p);else{let S=pl(u,a,p);if(!o&&i>r*2)o=!0,n?.warn(`@smithy/util-stream - stream chunk size ${m} is below threshold of ${r}, automatically buffering.`);if(S>=r)l.enqueue(Xt(u,a));else await d(l)}}};return new ReadableStream({pull:d})}function pl(t,r,n){switch(r){case 0:return t[0]+=n,nt(t[0]);case 1:case 2:return t[r].push(n),nt(t[r])}}function Xt(t,r){switch(r){case 0:let n=t[0];return t[0]="",n;case 1:case 2:return t[r].flush()}throw Error(`@smithy/util-stream - invalid index ${r} given to flush()`)}function nt(t){return t?.byteLength??t?.length??0}function gl(t,r=!0){if(r&&typeof Buffer<"u"&&t instanceof Buffer)return 2;if(t instanceof Uint8Array)return 1;if(typeof t==="string")return 0;return-1}function pT(t,r,n){if(Fe(t))return hT(t,r,n);let s=new Qt({read(){}}),o=!1,i=0,u=["",new Xn((d)=>new Uint8Array(d)),new Xn((d)=>Buffer.from(new Uint8Array(d)))],a=-1;return t.on("data",(d)=>{let l=gl(d,!0);if(a!==l){if(a>=0)s.push(Xt(u,a));a=l}if(a===-1){s.push(d);return}let h=nt(d);i+=h;let f=nt(u[a]);if(h>=r&&f===0)s.push(d);else{let p=pl(u,a,d);if(!o&&i>r*2)o=!0,n?.warn(`@smithy/util-stream - stream chunk size ${h} is below threshold of ${r}, automatically buffering.`);if(p>=r)s.push(Xt(u,a))}}),t.on("end",()=>{if(a!==-1){let d=Xt(u,a);if(nt(d)>0)s.push(d)}s.push(null)}),s}var gT=(t,r)=>{let{base64Encoder:n,bodyLengthChecker:s,checksumAlgorithmFn:o,checksumLocationName:i,streamHasher:u}=r,a=n!==void 0&&s!==void 0&&o!==void 0&&i!==void 0&&u!==void 0,d=a?u(o,t):void 0;Promise.resolve(d).catch(()=>{});let l=t.getReader();return new ReadableStream({async pull(h){let{value:f,done:p}=await l.read();if(p){if(h.enqueue(`0\r
|
|
7
|
-
`),a){let g=n(await d);h.enqueue(`${i}:${g}\r
|
|
8
|
-
`),h.enqueue(`\r
|
|
9
|
-
`)}h.close()}else h.enqueue(`${(s(f)||0).toString(16)}\r
|
|
10
|
-
${f}\r
|
|
11
|
-
`)}})};function mT(t,r){let n=t,s=t;if(Fe(s))return gT(s,r);let{base64Encoder:o,bodyLengthChecker:i,checksumAlgorithmFn:u,checksumLocationName:a,streamHasher:d}=r,l=o!==void 0&&u!==void 0&&a!==void 0&&d!==void 0,h=l?d(u,n):void 0;Promise.resolve(h).catch(()=>{});let f=new Qt({read(){n.resume()}});return n.on("data",(p)=>{let g=i(p)||0;if(g===0)return;if(f.push(`${g.toString(16)}\r
|
|
12
|
-
`),f.push(p),!f.push(`\r
|
|
13
|
-
`))n.pause()}),n.on("error",(p)=>{f.destroy(p)}),n.pause(),n.on("end",async()=>{try{if(f.push(`0\r
|
|
14
|
-
`),l){let p=o(await h);f.push(`${a}:${p}\r
|
|
15
|
-
`),f.push(`\r
|
|
16
|
-
`)}f.push(null)}catch(p){f.destroy(p)}}),f}async function yT(t,r){let n=0,s=[],o=t.getReader(),i=!1;while(!i){let{done:d,value:l}=await o.read();if(l)s.push(l),n+=l?.byteLength??0;if(n>=r)break;i=d}o.releaseLock();let u=new Uint8Array(Math.min(r,n)),a=0;for(let d of s){if(d.byteLength>u.byteLength-a){u.set(d.subarray(0,u.byteLength-a),a);break}else u.set(d,a);a+=d.length}return u}var ST=(t,r)=>{if(Fe(t))return yT(t,r);return new Promise((n,s)=>{let o=new wT;o.limit=r,t.pipe(o),t.on("error",(i)=>{o.end(),s(i)}),o.on("error",s),o.on("finish",function(){let i=es(this.buffers);n(i)})})},wT=class extends jd{buffers=[];limit=1/0;bytesBuffered=0;_write(r,n,s){if(this.buffers.push(r),this.bytesBuffered+=r.byteLength??0,this.bytesBuffered>=this.limit){let o=this.bytesBuffered-this.limit,i=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=i.subarray(0,i.byteLength-o),this.emit("finish")}s()}},ET=(t)=>{if(typeof t==="string")return t;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)},bT=async(t)=>{if(ts(t))return ml(t);return yl(t)};async function ml(t){return t.arrayBuffer().then((r)=>new Uint8Array(r))}async function yl(t){let r=[],n=t.getReader(),s=0;while(!0){let{done:o,value:i}=await n.read();if(i)r.push(i),s+=i.length;if(o)break}return es(r,s)}var Hd="The stream has already been transformed.",_T=(t)=>{if(!zd(t)&&!Fe(t)){let o=t?.__proto__?.constructor?.name||t;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let r=!1,n=async()=>{if(r)throw Error(Hd);return r=!0,await bT(t)},s=(o)=>{if(typeof o.stream!=="function")throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
|
|
17
|
-
If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(t,{transformToByteArray:n,transformToString:async(o)=>{let i=await n();if(o==="base64")return fl(i);else if(o==="hex")return nl(i);else if(o===void 0||o==="utf8"||o==="utf-8")return ET(i);else if(typeof TextDecoder==="function")return new TextDecoder(o).decode(i);else throw Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(r)throw Error(Hd);if(r=!0,zd(t))return s(t);else if(Fe(t))return t;else throw Error(`Cannot transform payload to web stream, got ${t}`)}})},zd=(t)=>typeof Blob==="function"&&t instanceof Blob,Sl=(t)=>{if(ts(t))return ml(t);if(Fe(t))return yl(t);return new Promise((r,n)=>{let s=new wl,o=t;o.pipe(s),o.on("error",(i)=>{s.end(),n(i)}),s.on("error",n),s.on("finish",function(){let i=es(this.bufferedBytes);r(i)})})};class wl extends jd{bufferedBytes=[];_write(t,r,n){this.bufferedBytes.push(t),n()}}var qd="The stream has already been transformed.",AT=(t)=>{if(!(t instanceof Qt))try{return _T(t)}catch(s){let o=t?.__proto__?.constructor?.name||t;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${o}`)}let r=!1,n=async()=>{if(r)throw Error(qd);return r=!0,await Sl(t)};return Object.assign(t,{transformToByteArray:n,transformToString:async(s)=>{let o=await n();if(s===void 0||Buffer.isEncoding(s))return Yt(o.buffer,o.byteOffset,o.byteLength).toString(s);else return new TextDecoder(s).decode(o)},transformToWebStream:()=>{if(r)throw Error(qd);if(t.readableFlowing!==null)throw Error("The stream has been consumed by other callbacks.");if(typeof Qt.toWeb!=="function")throw Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return r=!0,Qt.toWeb(t)}})};async function xT(t){if(typeof t.stream==="function")t=t.stream();return t.tee()}async function TT(t){if(Fe(t)||ts(t))return xT(t);let r=new Ld,n=new Ld;return t.pipe(r),t.pipe(n),[r,n]}class El extends u0(Kd,Jn,Ai,Gd){}var CT=r0,bl=d0(CT),IT=bl;RT.ChecksumStream=dl;RT.Hash=ul;RT.LazyJsonString=xt;RT.NumericValue=Zn;RT.Uint8ArrayBlobAdapter=El;RT._parseEpochTimestamp=J0;RT._parseRfc3339DateTimeWithOffset=Z0;RT._parseRfc7231DateTime=eT;RT.calculateBodyLength=oT;RT.concatBytes=es;RT.copyDocumentWithTransform=l0;RT.createBufferedReadable=pT;RT.createChecksumStream=fT;RT.dateToUtcString=R0;RT.deserializerMiddleware=ol;RT.deserializerMiddlewareOption=al;RT.expectBoolean=h0;RT.expectByte=bi;RT.expectFloat32=Kn;RT.expectInt=g0;RT.expectInt32=wi;RT.expectLong=Vr;RT.expectNonNull=y0;RT.expectNumber=qr;RT.expectObject=Qd;RT.expectShort=Ei;RT.expectString=S0;RT.expectUnion=w0;RT.fromArrayBuffer=Yt;RT.fromBase64=Gd;RT.fromHex=sT;RT.fromString=Yn;RT.fromUtf8=Jn;RT.generateIdempotencyToken=IT;RT.getAwsChunkedEncodingStream=mT;RT.getSerdePlugin=iT;RT.handleFloat=_0;RT.headStream=ST;RT.isArrayBuffer=Wd;RT.isBlob=ts;RT.isReadableStream=Fe;RT.limitedParseDouble=Ci;RT.limitedParseFloat=A0;RT.limitedParseFloat32=x0;RT.logger=jr;RT.nv=nT;RT.parseBoolean=f0;RT.parseEpochTimestamp=L0;RT.parseRfc3339DateTime=N0;RT.parseRfc3339DateTimeWithOffset=P0;RT.parseRfc7231DateTime=F0;RT.quoteHeader=W0;RT.sdkStreamMixin=AT;RT.serializerMiddleware=il;RT.serializerMiddlewareOption=cl;RT.splitEvery=tT;RT.splitHeader=rT;RT.splitStream=TT;RT.streamCollector=Sl;RT.strictParseByte=Zd;RT.strictParseDouble=Ti;RT.strictParseFloat=E0;RT.strictParseFloat32=Xd;RT.strictParseInt=T0;RT.strictParseInt32=C0;RT.strictParseLong=Jd;RT.strictParseShort=Jt;RT.toBase64=Ai;RT.toHex=nl;RT.toUint8Array=sl;RT.toUtf8=Kd;RT.v4=bl});var gA=e(function(mI){var{createReadStream:KC}=c("node:fs"),{Writable:QC}=c("node:stream"),{toUint8Array:rr,concatBytes:XC}=X(),{createHash:Wr,createHmac:YC}=c("node:crypto"),ns=c("node:zlib");async function Cl(t,r,n=1048576){let s=t.size,o=0;while(o<s){let i=t.slice(o,Math.min(s,o+n));r(new Uint8Array(await i.arrayBuffer())),o+=i.size}}var JC=async function(r,n){let s=new r;return await Cl(n,(o)=>{s.update(o)}),s.digest()};class ki extends QC{hash;constructor(t,r){super(r);this.hash=t}_write(t,r,n){try{this.hash.update(rr(t))}catch(s){return n(s)}n()}}var ZC=(t,r)=>new Promise((n,s)=>{if(!eI(r)){s(Error("Unable to calculate hash for non-file streams."));return}let o=KC(r.path,{start:r.start,end:r.end}),i=new t,u=new ki(i);o.pipe(u),o.on("error",(a)=>{u.end(),s(a)}),u.on("error",s),u.on("finish",function(){i.digest().then(n).catch(s)})}),eI=(t)=>typeof t.path==="string",tI=(t,r)=>{if(r.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let n=new t,s=new ki(n);return r.pipe(s),new Promise((o,i)=>{r.on("error",(u)=>{s.end(),i(u)}),s.on("error",i),s.on("finish",()=>{n.digest().then(o).catch(i)})})};class Mi{digestLength=16;state=Uint32Array.from(_l);writeBuffer=new DataView(new ArrayBuffer(64));bufferLength=0;bytesHashed=0;update(t){let r=rr(t),n=0,s=r.byteLength;this.bytesHashed+=s;while(s>0)if(this.writeBuffer.setUint8(this.bufferLength++,r[n++]),--s,this.bufferLength===64)Oi(this.state,this.writeBuffer),this.bufferLength=0}async digest(){let t=Uint32Array.from(this.state),r=new DataView(this.writeBuffer.buffer.slice(0)),n=this.bufferLength,s=this.bytesHashed*8;if(r.setUint8(n++,128),this.bufferLength%64>=56){for(let u=n;u<64;++u)r.setUint8(u,0);Oi(t,r),n=0}for(let u=n;u<56;++u)r.setUint8(u,0);r.setUint32(56,s>>>0,!0),r.setUint32(60,Math.floor(s/4294967296),!0),Oi(t,r);let o=new Uint8Array(16),i=new DataView(o.buffer);for(let u=0;u<4;++u)i.setUint32(u*4,t[u],!0);return o}reset(){this.state.set(_l),this.writeBuffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0}}var _l=[1732584193,4023233417,2562383102,271733878],st=4294967295,rI=Uint8Array.of(7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21),nI=Array.from({length:64},(t,r)=>Math.abs(Math.sin(r+1))*4294967296>>>0);function Oi(t,r){let n=t[0],s=t[1],o=t[2],i=t[3];for(let u=0;u<64;++u){let a,d;if(u<16)a=s&o|~s&i,d=u;else if(u<32)a=i&s|o&~i,d=(5*u+1)%16;else if(u<48)a=s^o^i,d=(3*u+5)%16;else a=o^(s|~i),d=7*u%16;let l=r.getUint32(d*4,!0),h=i;i=o,o=s;let f=rI[(u>>4)*4+(u&3)],p=(n+a&st)+(l+nI[u]&st)&st;s=s+((p<<f|p>>>32-f)>>>0)&st,n=h}t[0]=t[0]+n&st,t[1]=t[1]+s&st,t[2]=t[2]+o&st,t[3]=t[3]+i&st}var sI=(()=>{try{return Wr("md5"),!0}catch{return!1}})(),Il=sI?oI():Mi;function oI(){return class{digestLength=16;hash=Wr("md5");update(r){this.hash.update(rr(r))}async digest(){let r=this.hash.copy().digest();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}reset(){this.hash=Wr("md5")}}}var Rl=new Uint32Array(256);for(let t=0;t<256;++t){let r=t;for(let n=0;n<8;++n)r=r&1?3988292384^r>>>1:r>>>1;Rl[t]=r>>>0}var Pi=4294967295;class Di{digestLength=4;checksum=Pi;update(t){for(let r=0;r<t.length;++r)this.checksum=this.checksum>>>8^Rl[(this.checksum^t[r])&255]}digestSync(){return(this.checksum^Pi)>>>0}async digest(){let t=this.digestSync(),r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,t,!1),r}reset(){this.checksum=Pi}}var Al=typeof ns.crc32==="function"?ns.crc32:void 0,vl=Al?iI(Al):Di;function iI(t){return class{digestLength=4;value=0;update(n){this.value=t(n,this.value)}digestSync(){return this.value>>>0}async digest(){let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,this.digestSync(),!1),n}reset(){this.value=0}}}var ee=64,xl=32,aI=9007199254740991;class Qe{digestLength=xl;state=Int32Array.from(Tl);w;buffer=new Uint8Array(64);bufferLength=0;bytesHashed=0;finished=!1;inner;outer;constructor(t){if(t){let r=Qe.normalizeKey(t);this.inner=new Qe,this.outer=new Qe;let{inner:n,outer:s}=this,o=new Uint8Array(ee*2);for(let i=0;i<ee;++i)o[i]=54^r[i],o[i+ee]=92^r[i];n.update(o.subarray(0,ee)),s.update(o.subarray(ee))}}update(t){if(this.finished)throw Error("Attempted to update an already finished HMAC.");if(this.inner){this.inner.update(t);return}let r=rr(t),n=0,{byteLength:s}=r;if(this.bytesHashed+=s,this.bytesHashed*8>aI)throw Error("Cannot hash more than 2^53 - 1 bits");while(s>0)if(this.buffer[this.bufferLength++]=r[n++],s--,this.bufferLength===ee)this.hashBuffer(),this.bufferLength=0}async digest(){let{inner:t,outer:r}=this;if(t&&r){if(this.finished)throw Error("Attempted to digest an already finished HMAC.");this.finished=!0;let n=t.digestSync();return r.update(n),r.digestSync()}return this.digestSync()}reset(){this.state=Int32Array.from(Tl),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0}digestSync(){let t=this.state.slice(),r=this.buffer.slice(),n=this.bufferLength,s=this.bytesHashed*8,o=new DataView(r.buffer,r.byteOffset,r.byteLength);if(o.setUint8(n++,128),(n-1)%ee>=ee-8){for(let u=n;u<ee;++u)o.setUint8(u,0);this.hashBufferWith(t,r),n=0}for(let u=n;u<ee-8;++u)o.setUint8(u,0);o.setUint32(ee-8,Math.floor(s/4294967296),!1),o.setUint32(ee-4,s,!1),this.hashBufferWith(t,r);let i=new Uint8Array(xl);for(let u=0;u<8;++u)i[u*4]=t[u]>>>24&255,i[u*4+1]=t[u]>>>16&255,i[u*4+2]=t[u]>>>8&255,i[u*4+3]=t[u]>>>0&255;return i}static normalizeKey(t){let r=rr(t);if(r.byteLength>ee){let n=new Qe;n.update(r);let s=n.digestSync(),o=new Uint8Array(ee);return o.set(s),o}if(r.byteLength<ee){let n=new Uint8Array(ee);return n.set(r),n}return r}hashBuffer(){this.hashBufferWith(this.state,this.buffer)}hashBufferWith(t,r){let n=this.w??=new Int32Array(64),s=t[0],o=t[1],i=t[2],u=t[3],a=t[4],d=t[5],l=t[6],h=t[7];for(let f=0;f<ee;++f){if(f<16)n[f]=(r[f*4]&255)<<24|(r[f*4+1]&255)<<16|(r[f*4+2]&255)<<8|r[f*4+3]&255;else{let m=n[f-2],y=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10;m=n[f-15];let S=(m>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;n[f]=(y+n[f-7]|0)+(S+n[f-16]|0)}let p=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&d^~a&l)|0)+(h+(cI[f]+n[f]|0)|0)|0,g=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+(s&o^s&i^o&i)|0;h=l,l=d,d=a,a=u+p|0,u=i,i=o,o=s,s=p+g|0}t[0]+=s,t[1]+=o,t[2]+=i,t[3]+=u,t[4]+=a,t[5]+=d,t[6]+=l,t[7]+=h}}var Tl=new Int32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cI=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),uI=(()=>{try{return Wr("sha256"),!0}catch{return!1}})(),Nl=uI?dI():Qe;function dI(){return class{digestLength=32;secret;hash;isHmac;finished=!1;constructor(r){this.secret=r,this.isHmac=!!r,this.hash=this.createHash()}update(r){if(this.finished)throw Error("Attempted to update an already finished hash.");this.hash.update(r)}async digest(){let r;if(this.isHmac)this.finished=!0,r=this.hash.digest();else r=this.hash.copy().digest();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}reset(){this.hash=this.createHash(),this.finished=!1}createHash(){return this.secret?YC("sha256",lI(this.secret)):Wr("sha256")}}}function lI(t){if(typeof t==="string")return t;if(ArrayBuffer.isView(t))return Buffer.from(t.buffer,t.byteOffset,t.byteLength);return Buffer.from(t)}var{digest:fI,sign:hI,importKey:pI}=globalThis?.crypto?.subtle??{},rs=typeof fI==="function"&&typeof hI==="function"&&typeof pI==="function"?globalThis.crypto.subtle:void 0,gI=8388608;class Ol{digestLength=32;secret;pending=[];pendingBytes=0;fallback;finished=!1;constructor(t){if(t)this.secret=rr(t)}update(t){if(this.finished)throw Error("Attempted to update an already finished HMAC.");if(this.fallback){this.fallback.update(t);return}if(this.pending.push(t.slice()),this.pendingBytes+=t.byteLength,this.pendingBytes>=gI)this.switchToFallback()}async digest(){if(this.fallback)return this.fallback.digest();if(this.secret&&this.finished)throw Error("Attempted to digest an already finished HMAC.");let t=XC(this.pending);if(rs){if(this.secret){this.finished=!0;let s=await rs.importKey("raw",this.secret,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await rs.sign("HMAC",s,t);return new Uint8Array(o)}let n=await rs.digest("SHA-256",t);return new Uint8Array(n)}let r=new Qe(this.secret);return r.update(t),r.digest()}reset(){this.pending=[],this.pendingBytes=0,this.fallback=void 0,this.finished=!1}switchToFallback(){let t=new Qe(this.secret);for(let r of this.pending)t.update(r);this.fallback=t,this.pending=[],this.pendingBytes=0}}mI.Crc32=vl;mI.Crc32Js=Di;mI.Crc32Node=vl;mI.Md5=Il;mI.Md5Js=Mi;mI.Md5Node=Il;mI.Sha256=Nl;mI.Sha256Js=Qe;mI.Sha256Node=Nl;mI.Sha256WebCrypto=Ol;mI.blobHasher=JC;mI.blobReader=Cl;mI.fileStreamHasher=ZC;mI.readableStreamHasher=tI});var yA=e(function(eR){var{Crc32:Dl}=gA(),{hasOwn:ss}=me(),{toHex:nr,fromHex:OI,toUtf8:PI,fromUtf8:kI}=X(),{Readable:MI}=c("node:stream"),{TypeRegistry:DI}=Te();class sr{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;if(t<0)Pl(r);return new sr(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;if(r)Pl(t);return parseInt(nr(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Pl(t){for(let r=0;r<8;r++)t[r]^=255;for(let r=7;r>-1;r--)if(t[r]++,t[r]!==0)break}class Fi{toUtf8;fromUtf8;constructor(t,r){this.toUtf8=t,this.fromUtf8=r}format(t){let r=[];for(let o in t){if(!ss(t,o))continue;let i=this.fromUtf8(o);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(t[o]))}let n=new Uint8Array(r.reduce((o,i)=>o+i.byteLength,0)),s=0;for(let o of r)n.set(o,s),s+=o.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":let n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":let s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":let o=new DataView(new ArrayBuffer(3+t.value.byteLength));o.setUint8(0,6),o.setUint16(1,t.value.byteLength,!1);let i=new Uint8Array(o.buffer);return i.set(t.value,3),i;case"string":let u=this.fromUtf8(t.value),a=new DataView(new ArrayBuffer(3+u.byteLength));a.setUint8(0,7),a.setUint16(1,u.byteLength,!1);let d=new Uint8Array(a.buffer);return d.set(u,3),d;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(sr.fromNumber(t.value.valueOf()).bytes,1),l;case"uuid":if(!VI.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let h=new Uint8Array(17);return h[0]=9,h.set(OI(t.value.replace(/-/g,"")),1),h}}parse(t){let r={},n=0;while(n<t.byteLength){let s=t.getUint8(n++),o=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,s));switch(n+=s,t.getUint8(n++)){case 0:r[o]={type:Ml,value:!0};break;case 1:r[o]={type:Ml,value:!1};break;case 2:r[o]={type:FI,value:t.getInt8(n++)};break;case 3:r[o]={type:LI,value:t.getInt16(n,!1)},n+=2;break;case 4:r[o]={type:UI,value:t.getInt32(n,!1)},n+=4;break;case 5:r[o]={type:$I,value:new sr(new Uint8Array(t.buffer,t.byteOffset+n,8))},n+=8;break;case 6:let i=t.getUint16(n,!1);n+=2,r[o]={type:BI,value:new Uint8Array(t.buffer,t.byteOffset+n,i)},n+=i;break;case 7:let u=t.getUint16(n,!1);n+=2,r[o]={type:HI,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+n,u))},n+=u;break;case 8:r[o]={type:zI,value:new Date(new sr(new Uint8Array(t.buffer,t.byteOffset+n,8)).valueOf())},n+=8;break;case 9:let a=new Uint8Array(t.buffer,t.byteOffset+n,16);n+=16,r[o]={type:qI,value:`${nr(a.subarray(0,4))}-${nr(a.subarray(4,6))}-${nr(a.subarray(6,8))}-${nr(a.subarray(8,10))}-${nr(a.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return r}}var kl;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(kl||(kl={}));var Ml="boolean",FI="byte",LI="short",UI="integer",$I="long",BI="binary",HI="string",zI="timestamp",qI="uuid",VI=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,Fl=4,ot=Fl*2,Tt=4,jI=ot+Tt*2;function WI({byteLength:t,byteOffset:r,buffer:n}){if(t<jI)throw Error("Provided message too short to accommodate event stream message overhead");let s=new DataView(n,r,t),o=s.getUint32(0,!1);if(t!==o)throw Error("Reported message length does not match received message length");let i=s.getUint32(Fl,!1),u=s.getUint32(ot,!1),a=s.getUint32(t-Tt,!1),d=new Dl;if(d.update(new Uint8Array(n,r,ot)),u!==d.digestSync())throw Error(`The prelude checksum specified in the message (${u}) does not match the calculated CRC32 checksum (${d.digestSync()})`);if(d.update(new Uint8Array(n,r+ot,t-(ot+Tt))),a!==d.digestSync())throw Error(`The message checksum (${d.digestSync()}) did not match the expected value of ${a}`);return{headers:new DataView(n,r+ot+Tt,i),body:new Uint8Array(n,r+ot+Tt+i,o-i-(ot+Tt+Tt))}}class Li{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,r){this.headerMarshaller=new Fi(t,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return r}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let r=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return r}}}encode({headers:t,body:r}){let n=this.headerMarshaller.format(t),s=n.byteLength+r.byteLength+16,o=new Uint8Array(s),i=new DataView(o.buffer,o.byteOffset,o.byteLength),u=new Dl;return i.setUint32(0,s,!1),i.setUint32(4,n.byteLength,!1),u.update(o.subarray(0,8)),i.setUint32(8,u.digestSync(),!1),o.set(n,12),o.set(r,n.byteLength+12),u.update(o.subarray(8,s-4)),i.setUint32(s-4,u.digestSync(),!1),o}decode(t){let{headers:r,body:n}=WI(t);return{headers:this.headerMarshaller.parse(r),body:n}}formatHeaders(t){return this.headerMarshaller.format(t)}}class Ui{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.inputStream)yield this.options.decoder.decode(t)}}class $i{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.messageStream)yield this.options.encoder.encode(t);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Bi{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.messageStream){let r=await this.options.deserializer(t);if(r===void 0)continue;yield r}}}class Hi{options;constructor(t){this.options=t}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let t of this.options.inputStream)yield this.options.serializer(t)}}function Ll(t){let r=0,n=0,s=null,o=null,i=(a)=>{if(typeof a!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+a);r=a,n=4,s=new Uint8Array(a),new DataView(s.buffer).setUint32(0,a,!1)},u=async function*(){let a=t[Symbol.asyncIterator]();while(!0){let{value:d,done:l}=await a.next();if(l){if(!r)return;else if(r===n)yield s;else throw Error("Truncated event message received.");return}let h=d.length,f=0;while(f<h){if(!s){let g=h-f;if(!o)o=new Uint8Array(4);let m=Math.min(4-n,g);if(o.set(d.slice(f,f+m),n),n+=m,f+=m,n<4)break;i(new DataView(o.buffer).getUint32(0,!1)),o=null}let p=Math.min(r-n,h-f);if(s.set(d.slice(f,f+p),n),n+=p,f+=p,r&&r===n)yield s,s=null,r=0,n=0}}};return{[Symbol.asyncIterator]:u}}function GI(t,r){let n=zi(r.deserializer,r.toUtf8);return{[Symbol.asyncIterator]:async function*(){for await(let s of t){let o=r.eventStreamCodec.decode(s),i=await n(o);if(i===void 0)continue;yield i}}}}function zi(t,r){return async function(n){let{value:s}=n.headers[":message-type"];if(s==="error"){let o=Error(n.headers[":error-message"].value||"UnknownError");throw o.name=n.headers[":error-code"].value,o}else if(s==="exception"){let o=n.headers[":exception-type"].value,i={[o]:n},u=await t(i);if(u.$unknown){let a=Error(r(n.body));throw a.name=o,a}throw u[o]}else if(s==="event"){let o={[n.headers[":event-type"].value]:n},i=await t(o);if(i.$unknown)return;return i}else throw Error(`Unrecognizable event type: ${n.headers[":event-type"].value}`)}}var qi=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:r,utf8Decoder:n}){this.eventStreamCodec=new Li(r,n),this.utfEncoder=r}deserialize(r,n){let s=Ll(r);return new Bi({messageStream:new Ui({inputStream:s,decoder:this.eventStreamCodec}),deserializer:zi(n,this.utfEncoder)})}serialize(r,n){return new $i({messageStream:new Hi({inputStream:r,serializer:n}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},KI=(t)=>new qi(t);class Vi{universalMarshaller;constructor({utf8Encoder:t,utf8Decoder:r}){this.universalMarshaller=new qi({utf8Decoder:r,utf8Encoder:t})}deserialize(t,r){let n=typeof t[Symbol.asyncIterator]==="function"?t:XI(t);return this.universalMarshaller.deserialize(n,r)}serialize(t,r){return MI.from(this.universalMarshaller.serialize(t,r))}}var QI=(t)=>new Vi(t);async function*XI(t){let r=!1,n=!1,s=[];t.on("error",(o)=>{if(!r)r=!0;if(o)throw o}),t.on("data",(o)=>{s.push(o)}),t.on("end",()=>{r=!0});while(!n){let o=await new Promise((i)=>setTimeout(()=>i(s.shift()),0));if(o)yield o;n=r&&s.length===0}}var YI=(t)=>({[Symbol.asyncIterator]:async function*(){let r=t.getReader();try{while(!0){let{done:n,value:s}=await r.read();if(n)return;yield s}}finally{r.releaseLock()}}}),JI=(t)=>{let r=t[Symbol.asyncIterator]();return new ReadableStream({async pull(n){let{done:s,value:o}=await r.next();if(s)return n.close();n.enqueue(o)}})},ZI=(t)=>Object.assign(t,{eventStreamMarshaller:t.eventStreamSerdeProvider(t)});class Ul{marshaller;serializer;deserializer;serdeContext;defaultContentType;compositeErrorRegistry;constructor({marshaller:t,serializer:r,deserializer:n,serdeContext:s,defaultContentType:o,compositeErrorRegistry:i}){this.marshaller=t,this.serializer=r,this.deserializer=n,this.serdeContext=s,this.defaultContentType=o,this.compositeErrorRegistry=i}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n,initialMessageType:s}){let o=this.marshaller,i=r.getEventStreamMember(),u=r.getMemberSchema(i),a=this.serializer,d=this.defaultContentType,l=Symbol("initialRequestMarker"),h={async*[Symbol.asyncIterator](){if(n){let f={":event-type":{type:"string",value:s??"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:d}};a.write(r,n);let p=a.flush();yield{[l]:!0,headers:f,body:p}}for await(let f of t)yield f}};return o.serialize(h,(f)=>{if(f[l])return{headers:f.headers,body:f.body};let p="";for(let E in f){if(!ss(f,E))continue;if(E!=="__type"){p=E;break}}let{additionalHeaders:g,body:m,eventType:y,explicitPayloadContentType:S}=this.writeEventBody(p,u,f);return{headers:{":event-type":{type:"string",value:y},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:S??d},...g},body:m}})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n,initialMessageType:s}){let o=this.marshaller,i=r.getEventStreamMember(),a=r.getMemberSchema(i).getMemberSchemas(),d=Symbol("initialResponseMarker"),l=o.deserialize(t.body,async(p)=>{let g="";for(let y in p){if(!ss(p,y))continue;if(y!=="__type"){g=y;break}}let m=p[g].body;if(g===(s??"initial-response")){let y=await this.deserializer.read(r,m);return delete y[i],{[d]:!0,...y}}else if(g in a){let y=a[g];if(y.isStructSchema()){let S={},w=!1;for(let[E,A]of y.structIterator()){let{eventHeader:v,eventPayload:L}=A.getMergedTraits();if(w=w||Boolean(v||L),L){if(A.isBlobSchema())S[E]=m;else if(A.isStringSchema())S[E]=(this.serdeContext?.utf8Encoder??PI)(m);else if(A.isStructSchema())S[E]=await this.deserializer.read(A,m)}else if(v){let k=p[g].headers[E]?.value;if(k!=null)if(A.isNumericSchema())if(k&&typeof k==="object"&&"bytes"in k)S[E]=BigInt(k.toString());else S[E]=Number(k);else S[E]=k}}return{[g]:await this.readEventMember(y,m,w,S)}}return{[g]:await this.deserializer.read(y,m)}}else return{$unknown:p}}),h=l[Symbol.asyncIterator](),f=await h.next();if(f.done)return l;if(f.value?.[d]){if(!r)throw Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let p in f.value){if(!ss(f.value,p))continue;n[p]=f.value[p]}}return{async*[Symbol.asyncIterator](){if(!f?.value?.[d])yield f.value;while(!0){let{done:p,value:g}=await h.next();if(p)break;yield g}}}}async readEventMember(t,r,n,s){let o,i=t.getSchema();if(Array.isArray(i)&&i[0]===-3){let a=i[1],d=DI.for(a);this.compositeErrorRegistry?.copyFrom(d),o=(this.compositeErrorRegistry??d)?.getErrorCtor(i)}let u=n?s:r.byteLength===0?{}:await this.deserializer.read(t,r);if(o){let a=u.message??u.Message??"Unknown",d={},l=t.getMergedTraits().error;if(l)d.$fault=l;return Object.assign(new o({}),d,{message:a},u)}return u}writeEventBody(t,r,n){let s=this.serializer,o=t,i=null,u,a=(()=>r.getSchema()[4].includes(t))(),d={};if(!a){let[f,p]=n[t];o=f,s.write(15,p)}else{let f=r.getMemberSchema(t);if(f.isStructSchema()){for(let[p,g]of f.structIterator()){let{eventHeader:m,eventPayload:y}=g.getMergedTraits();if(y)i=p;else if(m){let S=n[t][p],w="binary";if(g.isNumericSchema())if(-2147483648<=S&&S<=2147483647)w="integer";else w="long";else if(g.isTimestampSchema())w="timestamp";else if(g.isStringSchema())w="string";else if(g.isBooleanSchema())w="boolean";if(S!=null)d[p]={type:w,value:S},delete n[t][p]}}if(i!==null){let p=f.getMemberSchema(i);if(p.isBlobSchema())u="application/octet-stream";else if(p.isStringSchema())u="text/plain";s.write(p,n[t][i])}else s.write(f,n[t])}else if(f.isUnitSchema())s.write(f,{});else throw Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}let l=s.flush()??new Uint8Array;return{body:typeof l==="string"?(this.serdeContext?.utf8Decoder??kI)(l):l,eventType:o,explicitPayloadContentType:u,additionalHeaders:d}}}eR.EventStreamCodec=Li;eR.EventStreamMarshaller=Vi;eR.EventStreamSerde=Ul;eR.HeaderMarshaller=Fi;eR.Int64=sr;eR.MessageDecoderStream=Ui;eR.MessageEncoderStream=$i;eR.SmithyMessageDecoderStream=Bi;eR.SmithyMessageEncoderStream=Hi;eR.UniversalEventStreamMarshaller=qi;eR.eventStreamSerdeProvider=QI;eR.getChunkedStream=Ll;eR.getMessageUnmarshaller=zi;eR.getUnmarshalledStream=GI;eR.iterableToReadableStream=JI;eR.readableStreamToIterable=YI;eR.resolveEventStreamSerdeConfig=ZI;eR.universalEventStreamSerdeProvider=KI});var K=e(function(BR){var{Uint8ArrayBlobAdapter:ji,sdkStreamMixin:wR,splitEvery:ER,splitHeader:zl,fromBase64:$l,_parseEpochTimestamp:bR,_parseRfc7231DateTime:_R,_parseRfc3339DateTimeWithOffset:AR,LazyJsonString:ql,NumericValue:xR,toUtf8:Vl,fromUtf8:TR,generateIdempotencyToken:CR,toBase64:Bl,dateToUtcString:IR,quoteHeader:RR}=X(),{HttpRequest:or,HttpResponse:jl,hasOwn:Ct,isValidHostname:Wl}=me(),{parseQueryString:vR,parseUrl:NR}=me();BR.HttpRequest=or;BR.HttpResponse=jl;BR.isValidHostname=Wl;BR.parseQueryString=vR;BR.parseUrl=NR;var{TypeRegistry:OR,NormalizedSchema:Le,translateTraits:Gl}=Te(),{FieldPosition:PR}=bt(),It=async(t=new Uint8Array,r)=>{if(t instanceof Uint8Array)return ji.mutate(t);if(!t)return ji.mutate(new Uint8Array);let n=r.streamCollector(t);return ji.mutate(await n)};function Kr(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})}class ir{serdeContext;setSerdeContext(t){this.serdeContext=t}}class os extends ir{options;compositeErrorRegistry;constructor(t){super();this.options=t,this.compositeErrorRegistry=new OR(t.defaultNamespace);for(let r of t.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(r)}getRequestType(){return or}getResponseType(){return jl}setSerdeContext(t){if(this.serdeContext=t,this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t),this.getPayloadCodec())this.getPayloadCodec().setSerdeContext(t)}updateServiceEndpoint(t,r){if("url"in r){if(t.protocol=r.url.protocol,t.hostname=r.url.hostname,t.port=r.url.port?Number(r.url.port):void 0,t.path=r.url.pathname,t.fragment=r.url.hash||void 0,t.username=r.url.username||void 0,t.password=r.url.password||void 0,!t.query)t.query={};for(let[n,s]of r.url.searchParams.entries())t.query[n]=s;if(r.headers)for(let n in r.headers){if(!Ct(r.headers,n))continue;t.headers[n]=r.headers[n].join(", ")}return t}else{if(t.protocol=r.protocol,t.hostname=r.hostname,t.port=r.port?Number(r.port):void 0,t.path=r.path,t.query={...r.query},r.headers)for(let n in r.headers){if(!Ct(r.headers,n))continue;t.headers[n]=r.headers[n]}return t}}setHostPrefix(t,r,n){if(this.serdeContext?.disableHostPrefix)return;let s=Le.of(r.input),o=Gl(r.traits??{});if(o.endpoint){let i=o.endpoint?.[0];if(typeof i==="string"){for(let[u,a]of s.structIterator()){if(!a.getMergedTraits().hostLabel)continue;let d=n[u];if(typeof d!=="string")throw Error(`@smithy/core/schema - ${u} in input must be a string as hostLabel.`);i=i.replace(`{${u}}`,d)}if(t.hostname=i+t.hostname,!Wl(t.hostname))throw Error(`[${t.hostname}] is not a valid hostname.`)}}}deserializeMetadata(t){return{httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}}resolveError(t,r,n){let s=[-3,"","Error",0,[],[],0],o;for(let i of n)for(let u of r)try{if(u==="*")o=i.getSchema(t);else o=i.getSchema(u+"#"+t);let a=i.getErrorCtor(o);if(a)return[o,a,"modeled"];else{let d=i.getBaseException();if(d){let l=i.getErrorCtor(d);if(l)return[o,l,"synthetic"]}}}catch(a){}for(let i of n){let u=i.getBaseException();if(u){let a=i.getErrorCtor(u);if(a)return[u,a,"synthetic"]}}return[s,Error,"native"]}async serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:t,requestSchema:r,initialRequest:n})}async deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:t,responseSchema:r,initialResponseContainer:n})}async loadEventStreamCapability(){let{EventStreamSerde:t,eventStreamSerdeProvider:r}=yA(),n=this.resolveEventStreamMarshaller(r);return new t({marshaller:n,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType(),compositeErrorRegistry:this.compositeErrorRegistry})}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(t,r,n,s,o){return[]}getEventStreamMarshaller(){let t=this.serdeContext;if(!t.eventStreamMarshaller)throw Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return t.eventStreamMarshaller}resolveEventStreamMarshaller(t){let r=this.serdeContext;if(r.eventStreamMarshaller)return r.eventStreamMarshaller;return t(this.serdeContext)}}class Kl extends os{async serializeRequest(t,r,n){let s=r&&typeof r==="object"?r:{},o=this.serializer,i={},u={},a=await n.endpoint(),d=Le.of(t?.input),l=[],h=[],f=!1,p,g=new or({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:i,headers:u,body:void 0});if(a){this.updateServiceEndpoint(g,a),this.setHostPrefix(g,t,s);let m=Gl(t.traits);if(m.http){g.method=m.http[0];let[y,S]=m.http[1].split("?");if(g.path=="/")g.path=y;else g.path+=y;let w=new URLSearchParams(S??"");for(let[E,A]of w)i[E]=A}}for(let[m,y]of d.structIterator()){let S=y.getMergedTraits()??{},w=s[m];if(w==null&&!y.isIdempotencyToken()){if(S.httpLabel){if(g.path.includes(`{${m}+}`)||g.path.includes(`{${m}}`))throw Error(`No value provided for input HTTP label: ${m}.`)}continue}if(S.httpPayload)if(y.isStreaming())if(y.isStructSchema()){if(s[m])p=await this.serializeEventStream({eventStream:s[m],requestSchema:d})}else p=w;else o.write(y,w),p=o.flush();else if(S.httpLabel){o.write(y,w);let E=o.flush();if(g.path.includes(`{${m}+}`))g.path=g.path.replace(`{${m}+}`,E.split("/").map(Kr).join("/"));else if(g.path.includes(`{${m}}`))g.path=g.path.replace(`{${m}}`,Kr(E))}else if(S.httpHeader)o.write(y,w),u[S.httpHeader.toLowerCase()]=String(o.flush());else if(typeof S.httpPrefixHeaders==="string")for(let E in w){if(!Ct(w,E))continue;let A=w[E],v=S.httpPrefixHeaders+E;o.write([y.getValueSchema(),{httpHeader:v}],A),u[v.toLowerCase()]=o.flush()}else if(S.httpQuery||S.httpQueryParams)this.serializeQuery(y,w,i);else f=!0,l.push(m),h.push(y)}if(f&&s){let[m,y]=(d.getName(!0)??"#Unknown").split("#"),S=d.getSchema()[6],w=[3,m,y,d.getMergedTraits(),l,h,void 0];if(S)w[6]=S;else w.pop();o.write(w,s),p=o.flush()}return g.headers=u,g.query=i,g.body=p,g}serializeQuery(t,r,n){let s=this.serializer,o=t.getMergedTraits();if(o.httpQueryParams){for(let i in r){if(!Ct(r,i))continue;if(!(i in n)){let u=r[i],a=t.getValueSchema();Object.assign(a.getMergedTraits(),{...o,httpQuery:i,httpQueryParams:void 0}),this.serializeQuery(a,u,n)}}return}if(t.isListSchema()){let i=!!t.getMergedTraits().sparse,u=[];for(let a of r){s.write([t.getValueSchema(),o],a);let d=s.flush();if(i||d!==void 0)u.push(d)}n[o.httpQuery]=u}else s.write([t,o],r),n[o.httpQuery]=s.flush()}async deserializeResponse(t,r,n){let s=this.deserializer,o=Le.of(t.output),i={};if(n.statusCode>=300){let a=await It(n.body,r);if(a.byteLength>0)Object.assign(i,await s.read(15,a));throw await this.handleError(t,r,n,i,this.deserializeMetadata(n)),Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let a in n.headers){if(!Ct(n.headers,a))continue;let d=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=d}let u=await this.deserializeHttpMessage(o,r,n,i);if(u.length){let a=await It(n.body,r);if(a.byteLength>0){let d=await s.read(o,a);for(let l of u)if(d[l]!=null)i[l]=d[l]}}else if(u.discardResponseBody)await It(n.body,r);return i.$metadata=this.deserializeMetadata(n),i}async deserializeHttpMessage(t,r,n,s,o){let i;if(s instanceof Set)i=o;else i=s;let u=!0,a=this.deserializer,d=Le.of(t),l=[];for(let[h,f]of d.structIterator()){let p=f.getMemberTraits();if(p.httpPayload){if(u=!1,f.isStreaming())if(f.isStructSchema())i[h]=await this.deserializeEventStream({response:n,responseSchema:d});else i[h]=wR(n.body);else if(n.body){let m=await It(n.body,r);if(m.byteLength>0)i[h]=await a.read(f,m)}}else if(p.httpHeader){let g=String(p.httpHeader).toLowerCase(),m=n.headers[g];if(m!=null)if(f.isListSchema()){let y=f.getValueSchema();y.getMergedTraits().httpHeader=g;let S;if(y.isTimestampSchema()&&y.getSchema()===4)S=ER(m,",",2);else S=zl(m);let w=[];for(let E of S)w.push(await a.read(y,E.trim()));i[h]=w}else i[h]=await a.read(f,m)}else if(p.httpPrefixHeaders!==void 0){i[h]={};for(let g in n.headers){if(!Ct(n.headers,g))continue;if(g.startsWith(p.httpPrefixHeaders)){let m=n.headers[g],y=f.getValueSchema();y.getMergedTraits().httpHeader=g,i[h][g.slice(p.httpPrefixHeaders.length)]=await a.read(y,m)}}}else if(p.httpResponseCode)i[h]=n.statusCode;else l.push(h)}return l.discardResponseBody=u,l}}class Ql extends os{async serializeRequest(t,r,n){let s=this.serializer,o={},i={},u=await n.endpoint(),a=Le.of(t?.input),d=a.getSchema(),l,h=r&&typeof r==="object"?r:{},f=new or({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:o,headers:i,body:void 0});if(u)this.updateServiceEndpoint(f,u),this.setHostPrefix(f,t,h);if(h){let p=a.getEventStreamMember();if(p){if(h[p]){let g={};for(let[m]of a.structIterator())if(m!==p&&h[m]!=null)g[m]=h[m];l=await this.serializeEventStream({eventStream:h[p],requestSchema:a,initialRequest:g})}}else s.write(d,h),l=s.flush()}return f.headers=Object.assign(f.headers,i),f.query=o,f.body=l,f.method="POST",f}async deserializeResponse(t,r,n){let s=this.deserializer,o=Le.of(t.output),i={};if(n.statusCode>=300){let a=await It(n.body,r);if(a.byteLength>0)Object.assign(i,await s.read(15,a));throw await this.handleError(t,r,n,i,this.deserializeMetadata(n)),Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let a in n.headers){if(!Ct(n.headers,a))continue;let d=n.headers[a];delete n.headers[a],n.headers[a.toLowerCase()]=d}let u=o.getEventStreamMember();if(u)i[u]=await this.deserializeEventStream({response:n,responseSchema:o,initialResponseContainer:i});else{let a=await It(n.body,r);if(a.byteLength>0)Object.assign(i,await s.read(o,a))}return i.$metadata=this.deserializeMetadata(n),i}}var Xl=(t,r,n,s,o,i)=>{if(r!=null&&r[n]!==void 0){let u=s();if(u==null||u.length<=0)throw Error("Empty value provided for input HTTP label: "+n+".");t=t.replace(o,i?u.split("/").map((a)=>Kr(a)).join("/"):Kr(u))}else throw Error("No value provided for input HTTP label: "+n+".");return t};function kR(t,r){return new Wi(t,r)}class Wi{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(t,r){this.input=t,this.context=r}async build(){let{hostname:t,protocol:r="https",port:n,path:s}=await this.context.endpoint();this.path=s;for(let o of this.resolvePathStack)o(this.path);return new or({protocol:r,hostname:this.hostname||t,port:n,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(t){return this.hostname=t,this}bp(t){return this.resolvePathStack.push((r)=>{this.path=`${r?.endsWith("/")?r.slice(0,-1):r||""}`+t}),this}p(t,r,n,s){return this.resolvePathStack.push((o)=>{this.path=Xl(o,this.input,t,r,n,s)}),this}h(t){return this.headers=t,this}q(t){return this.query=t,this}b(t){return this.body=t,this}m(t){return this.method=t,this}}function Gi(t,r){if(r.timestampFormat.useTrait){if(t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema()}let{httpLabel:n,httpPrefixHeaders:s,httpHeader:o,httpQuery:i}=t.getMergedTraits();return(r.httpBindings?typeof s==="string"||Boolean(o)?6:Boolean(i)||Boolean(n)?5:void 0:void 0)??r.timestampFormat.default}class Ki extends ir{settings;constructor(t){super();this.settings=t}read(t,r){let n=Le.of(t);if(n.isListSchema())return zl(r).map((s)=>this.read(n.getValueSchema(),s));if(n.isBlobSchema())return(this.serdeContext?.base64Decoder??$l)(r);if(n.isTimestampSchema())switch(Gi(n,this.settings)){case 5:return AR(r);case 6:return _R(r);case 7:return bR(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(n.isStringSchema()){let s=n.getMergedTraits().mediaType,o=r;if(s){if(n.getMergedTraits().httpHeader)o=this.base64ToUtf8(o);if(s==="application/json"||s.endsWith("+json"))o=ql.from(o);return o}}if(n.isNumericSchema())return Number(r);if(n.isBigIntegerSchema())return BigInt(r);if(n.isBigDecimalSchema())return new xR(r,"bigDecimal");if(n.isBooleanSchema())return String(r).toLowerCase()==="true";return r}base64ToUtf8(t){return(this.serdeContext?.utf8Encoder??Vl)((this.serdeContext?.base64Decoder??$l)(t))}}class Yl extends ir{codecDeserializer;stringDeserializer;constructor(t,r){super();this.codecDeserializer=t,this.stringDeserializer=new Ki(r)}setSerdeContext(t){this.stringDeserializer.setSerdeContext(t),this.codecDeserializer.setSerdeContext(t),this.serdeContext=t}read(t,r){let n=Le.of(t),s=n.getMergedTraits(),o=this.serdeContext?.utf8Encoder??Vl;if(s.httpHeader||s.httpResponseCode)return this.stringDeserializer.read(n,o(r));if(s.httpPayload){if(n.isBlobSchema()){let i=this.serdeContext?.utf8Decoder??TR;if(typeof r==="string")return i(r);return r}else if(n.isStringSchema()){if("byteLength"in r)return o(r);return r}}return this.codecDeserializer.read(n,r)}}class Qi extends ir{settings;stringBuffer="";constructor(t){super();this.settings=t}write(t,r){let n=Le.of(t);switch(typeof r){case"object":if(r===null){this.stringBuffer="null";return}if(n.isTimestampSchema()){if(!(r instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${r} when schema expected Date in ${n.getName(!0)}`);switch(Gi(n,this.settings)){case 5:this.stringBuffer=r.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=IR(r);break;case 7:this.stringBuffer=String(r.getTime()/1000);break;default:console.warn("Missing timestamp format, using epoch seconds",r),this.stringBuffer=String(r.getTime()/1000)}return}if(n.isBlobSchema()&&"byteLength"in r){this.stringBuffer=(this.serdeContext?.base64Encoder??Bl)(r);return}if(n.isListSchema()&&Array.isArray(r)){let i="";for(let u of r){this.write([n.getValueSchema(),n.getMergedTraits()],u);let a=this.flush(),d=n.getValueSchema().isTimestampSchema()?a:RR(a);if(i!=="")i+=", ";i+=d}this.stringBuffer=i;return}this.stringBuffer=JSON.stringify(r,null,2);break;case"string":let s=n.getMergedTraits().mediaType,o=r;if(s){if(s==="application/json"||s.endsWith("+json"))o=ql.from(o);if(n.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??Bl)(o.toString());return}}this.stringBuffer=r;break;default:if(n.isIdempotencyToken())this.stringBuffer=CR();else this.stringBuffer=String(r)}}flush(){let t=this.stringBuffer;return this.stringBuffer="",t}}class Jl{codecSerializer;stringSerializer;buffer;constructor(t,r,n=new Qi(r)){this.codecSerializer=t,this.stringSerializer=n}setSerdeContext(t){this.codecSerializer.setSerdeContext(t),this.stringSerializer.setSerdeContext(t)}write(t,r){let n=Le.of(t),s=n.getMergedTraits();if(s.httpHeader||s.httpLabel||s.httpQuery){this.stringSerializer.write(n,r),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(n,r)}flush(){if(this.buffer!==void 0){let t=this.buffer;return this.buffer=void 0,t}return this.codecSerializer.flush()}}class Zl{name;kind;values;constructor({name:t,kind:r=PR.HEADER,values:n=[]}){this.name=t,this.kind=r,this.values=n}add(t){this.values.push(t)}set(t){this.values=t}remove(t){this.values=this.values.filter((r)=>r!==t)}toString(){return this.values.map((t)=>t.includes(",")||t.includes(" ")?`"${t}"`:t).join(", ")}get(){return this.values}}class ef{entries={};encoding;constructor({fields:t=[],encoding:r="utf-8"}){t.forEach(this.setField.bind(this)),this.encoding=r}setField(t){this.entries[t.name.toLowerCase()]=t}getField(t){return this.entries[t.toLowerCase()]}removeField(t){delete this.entries[t.toLowerCase()]}getByType(t){return Object.values(this.entries).filter((r)=>r.kind===t)}}var MR=(t)=>{if(t.logger&&t.logger.constructor?.name!=="NoOpLogger")t.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"),t.logger);return{setHttpHandler(r){t.requestHandler=r},httpHandler(){return t.requestHandler},updateHttpClientConfig(r,n){t.requestHandler?.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return t.requestHandler.httpHandlerConfigs()}}},DR=(t)=>({requestHandler:t.httpHandler()}),Hl="content-length";function tf(t){return(r)=>async(n)=>{let s=n.request;if(or.isInstance(s)){let{body:o,headers:i}=s;if(o&&Object.keys(i).map((u)=>u.toLowerCase()).indexOf(Hl)===-1)try{let u=t(o);if(u!=null)s.headers={...s.headers,[Hl]:String(u)}}catch(u){}}return r({...n,request:s})}}var rf={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},FR=(t)=>({applyToStack:(r)=>{r.add(tf(t.bodyLengthChecker),rf)}}),Gr=(t)=>encodeURIComponent(t).replace(/[!'()*]/g,LR),LR=(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,UR=(t)=>t.split("/").map(Gr).join("/");function $R(t){let r=[];for(let n of Object.keys(t).sort()){let s=t[n];if(n=Gr(n),Array.isArray(s))for(let o=0,i=s.length;o<i;o++)r.push(`${n}=${Gr(s[o])}`);else{let o=n;if(s||typeof s==="string")o+=`=${Gr(s)}`;r.push(o)}}return r.join("&")}BR.Field=Zl;BR.Fields=ef;BR.FromStringShapeDeserializer=Ki;BR.HttpBindingProtocol=Kl;BR.HttpInterceptingShapeDeserializer=Yl;BR.HttpInterceptingShapeSerializer=Jl;BR.HttpProtocol=os;BR.RequestBuilder=Wi;BR.RpcProtocol=Ql;BR.SerdeContext=ir;BR.ToStringShapeSerializer=Qi;BR.buildQueryString=$R;BR.collectBody=It;BR.contentLengthMiddleware=tf;BR.contentLengthMiddlewareOptions=rf;BR.determineTimestampFormat=Gi;BR.escapeUri=Gr;BR.escapeUriPath=UR;BR.extendedEncodeURIComponent=Kr;BR.getContentLengthPlugin=FR;BR.getHttpHandlerExtensionConfiguration=MR;BR.requestBuilder=kR;BR.resolveHttpHandlerRuntimeConfig=DR;BR.resolvedPath=Xl});var cA=e(function(Bv){var{Readable:mv}=c("node:stream"),{NoOpLogger:yv,normalizeProvider:nf}=le(),{HttpResponse:sf,HttpRequest:as}=K(),{parseRfc7231DateTime:Sv,v4:of}=X(),{hasOwn:wv}=me(),af=(t)=>t?.body instanceof mv||typeof ReadableStream<"u"&&t?.body instanceof ReadableStream,Ev=["AccessDeniedException","AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],bv=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],_v=["TimeoutError","RequestTimeout","RequestTimeoutException"],Av=[500,502,503,504],xv=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Tv=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND","EAI_AGAIN"],Zi=(t)=>t?.$retryable!==void 0,cf=(t)=>Ev.includes(t.name),uf=(t)=>t.$metadata?.clockSkewCorrected,df=(t)=>{let r=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);if(!(t&&t instanceof TypeError))return!1;return r.has(t.message)},Xr=(t)=>t.$metadata?.httpStatusCode===429||bv.includes(t.name)||t.$retryable?.throttling==!0,Yr=(t,r=0)=>t?.name!=="AbortError"&&(Zi(t)||uf(t)||t.name==="InvalidSignatureException"&&t.message?.includes("Signature expired")||_v.includes(t.name)||xv.includes(t?.code||"")||Tv.includes(t?.code||"")||Av.includes(t.$metadata?.httpStatusCode||0)||df(t)||ff(t)||t.cause!==void 0&&r<=10&&Yr(t.cause,r+1)),lf=(t)=>{if(t.$metadata?.httpStatusCode!==void 0){let r=t.$metadata.httpStatusCode;if(500<=r&&r<=599&&!Yr(t))return!0;return!1}return!1};function ff(t){return t.code==="ERR_HTTP2_STREAM_ERROR"&&t.message.includes("NGHTTP2_REFUSED_STREAM")}var hf=100,us=20000,pf=500,cs=500,gf=5,mf=10,ea=1,ds="amz-sdk-invocation-id",ls="amz-sdk-request";function yf(t,r){if(!sf.isInstance(t))return;for(let n in t.headers){if(!wv(t.headers,n))continue;let s=n.toLowerCase();if(s==="retry-after"){let o=t.headers[n],i=NaN;if(o.endsWith("GMT"))try{i=(Sv(o).getTime()-Date.now())/1000}catch(u){r?.trace?.("Failed to parse retry-after header"),r?.trace?.(u)}else if(o.match(/ GMT, ((\d+)|(\d+\.\d+))$/))i=Number(o.match(/ GMT, ([\d.]+)$/)?.[1]);else if(o.match(/^((\d+)|(\d+\.\d+))$/))i=Number(o);else if(Date.parse(o)>=Date.now())i=(Date.parse(o)-Date.now())/1000;if(isNaN(i))return;return new Date(Date.now()+i*1000)}else if(s==="x-amz-retry-after"){let o=t.headers[n],i=Number(o);if(isNaN(i)){r?.trace?.(`Failed to parse x-amz-retry-after=${o}`);return}return new Date(Date.now()+i)}}}function Cv(t,r){return yf(t,r)}var Sf=(t)=>{if(t instanceof Error)return t;if(t instanceof Object)return Object.assign(Error(),t);if(typeof t==="string")return Error(t);return Error(`AWS SDK error wrapper for ${t}`)};function wf(t){return(r)=>(n,s)=>async(o)=>{let i=await r.retryStrategy(),u=await r.maxAttempts();if(Rv(i)){i=i;let a=await i.acquireInitialRetryToken((s.partition_id??"")+(s.__retryLongPoll?":longpoll":"")),d=Error(),l=0,h=0,{request:f}=o,p=as.isInstance(f);if(p)f.headers[ds]=of();while(!0)try{if(p)f.headers[ls]=`attempt=${l+1}; max=${u}`;let{response:g,output:m}=await n(o);return i.recordSuccess(a),m.$metadata.attempts=l+1,m.$metadata.totalRetryDelay=h,{response:g,output:m}}catch(g){let m=vv(g,r.logger);if(d=Sf(g),p&&t(f))throw(s.logger instanceof yv?console:s.logger)?.warn("An error was encountered in a non-retryable streaming request."),d;try{a=await i.refreshRetryTokenForRetry(a,m)}catch(S){if(!d.$metadata)d.$metadata={};throw d.$metadata.attempts=l+1,d.$metadata.totalRetryDelay=h,d}l=a.getRetryCount();let y=a.getRetryDelay();if(h+=(a?.$retryLog?.acquisitionDelay??0)+y,y>0)await Iv(y)}}else{if(i=i,i?.mode)s.userAgent=[...s.userAgent||[],["cfg/retry-mode",i.mode]];return i.retry(n,o)}}}var Iv=(t)=>new Promise((r)=>setTimeout(r,t)),Rv=(t)=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",vv=(t,r)=>{let n={error:t,errorType:Nv(t)},s=yf(t.$response,r);if(s)n.retryAfterHint=s;return n},Nv=(t)=>{if(Xr(t))return"THROTTLING";if(Yr(t))return"TRANSIENT";if(lf(t))return"SERVER_ERROR";return"CLIENT_ERROR"},Ef={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0};function Ov(t){let r=wf(t);return(n)=>({applyToStack:(s)=>{s.add(r(n),Ef)}})}class Jr{static setTimeoutFn=(t,r)=>setTimeout(t,r);beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(t){this.beta=t?.beta??0.7,this.minCapacity=t?.minCapacity??1,this.minFillRate=t?.minFillRate??0.5,this.scaleConstant=t?.scaleConstant??0.4,this.smooth=t?.smooth??0.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(t){let r;this.updateMeasuredRate();let n=t;if(n?.errorType==="THROTTLING"||Xr(n?.error??t)){let i=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=i,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(i),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let o=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(o)}getCurrentTimeInSeconds(){return Date.now()/1000}async acquireTokenBucket(t){if(!this.enabled)return;this.refillTokenBucket();while(t>this.availableTokens){let r=(t-this.availableTokens)/this.fillRate*1000;await new Promise((n)=>Jr.setTimeoutFn(n,r)),this.refillTokenBucket()}this.availableTokens=this.availableTokens-t}refillTokenBucket(){let t=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=t;return}let r=(t-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+r),this.lastTimestamp=t}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(t){return this.getPrecise(t*this.beta)}cubicSuccess(t){return this.getPrecise(this.scaleConstant*Math.pow(t-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(t){this.refillTokenBucket(),this.fillRate=Math.max(t,this.minFillRate),this.maxCapacity=Math.max(t,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){let t=this.getCurrentTimeInSeconds(),r=Math.floor(t*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(t){return parseFloat(t.toFixed(8))}}class Q{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Q.v2026?50:100}static throttlingDelay(){return Q.v2026?1000:500}static cost(){return Q.v2026?14:5}static throttlingCost(){return Q.v2026?5:10}static modifiedCostType(){return Q.v2026?"THROTTLING":"TRANSIENT"}}class bf{x=Q.delay();computeNextBackoffDelay(t){let r=Math.random(),n=2,s=r*Math.min(this.x*2**t,us);return Math.floor(s)}setDelayBase(t){this.x=t}}class Xi{delay;count;cost;longPoll;$retryLog={acquisitionDelay:0};constructor(t,r,n,s){this.delay=t,this.count=r,this.cost=n,this.longPoll=s}getRetryCount(){return this.count}getRetryDelay(){return Math.min(us,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}var Ye;(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(Ye||(Ye={}));var Rt=3,_f=Ye.STANDARD,is={incompatible:1,attempts:2,capacity:3},Qr=class{mode=Ye.STANDARD;retryBackoffStrategy;capacity=cs;maxAttemptsProvider;baseDelay;constructor(r){if(typeof r==="number")this.maxAttemptsProvider=async()=>r;else if(typeof r==="function")this.maxAttemptsProvider=r;else if(r&&typeof r==="object")this.maxAttemptsProvider=async()=>r.maxAttempts,this.baseDelay=r.baseDelay,this.retryBackoffStrategy=r.backoff;this.maxAttemptsProvider??=async()=>Rt,this.baseDelay??=Q.delay(),this.retryBackoffStrategy??=new bf}async acquireInitialRetryToken(r){return new Xi(Q.delay(),0,void 0,Q.v2026&&r.includes(":longpoll"))}async refreshRetryTokenForRetry(r,n){let s=await this.getMaxAttempts(),o=this.retryCode(r,n,s),i=o===0,u=r.isLongPoll?.();if(i||u){let a=n.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?Q.throttlingDelay():this.baseDelay);let d=this.retryBackoffStrategy.computeNextBackoffDelay(r.getRetryCount()),l=d;if(n.retryAfterHint instanceof Date)l=Math.max(d,Math.min(n.retryAfterHint.getTime()-Date.now(),d+5000));if(!i){let h=Q.v2026&&o===is.capacity&&u?l:0;if(h>0)await new Promise((f)=>setTimeout(f,h))}else{let h=this.getCapacityCost(a);this.capacity-=h;let f=new Xi(0,r.getRetryCount()+1,h,r.isLongPoll?.()??!1);return await new Promise((p)=>setTimeout(p,l)),f.$retryLog.acquisitionDelay=l,f}}throw Error("No retry token available")}recordSuccess(r){this.capacity=Math.min(cs,this.capacity+(r.getRetryCost()??ea))}getCapacity(){return this.capacity}async maxAttempts(){return this.maxAttemptsProvider()}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(r){return console.warn(`Max attempts provider could not resolve. Using default of ${Rt}`),Rt}}retryCode(r,n,s){let o=r.getRetryCount()+1,i=this.isRetryableError(n.errorType)?0:is.incompatible,u=o<s?0:is.attempts,a=this.capacity>=this.getCapacityCost(n.errorType)?0:is.capacity;return i||u||a}getCapacityCost(r){return r===Q.modifiedCostType()?Q.throttlingCost():Q.cost()}isRetryableError(r){return r==="THROTTLING"||r==="TRANSIENT"}},Af=class{mode=Ye.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(r,n){let{rateLimiter:s}=n??{};this.rateLimiter=s??new Jr,this.standardRetryStrategy=n?new Qr({maxAttempts:typeof r==="number"?r:3,...n}):new Qr(r)}async acquireInitialRetryToken(r){let n=await this.standardRetryStrategy.acquireInitialRetryToken(r);return await this.rateLimiter.getSendToken(),n}async refreshRetryTokenForRetry(r,n){this.rateLimiter.updateClientSendingRate(n);let s=await this.standardRetryStrategy.refreshRetryTokenForRetry(r,n);return await this.rateLimiter.getSendToken(),s}recordSuccess(r){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(r)}async maxAttemptsProvider(){return this.standardRetryStrategy.maxAttempts()}};class xf extends Qr{computeNextBackoffDelay;constructor(t,r=Q.delay()){super(typeof t==="function"?t:async()=>t);if(typeof r==="number")this.computeNextBackoffDelay=()=>r;else this.computeNextBackoffDelay=r;this.retryBackoffStrategy.computeNextBackoffDelay=(n)=>{let s=n+1;return this.computeNextBackoffDelay(s)}}}var Pv=(t,r)=>{let n=t,s=ea,o=gf,i=mf,u=t,a=(f)=>f.name==="TimeoutError"?i:o,d=(f)=>a(f)<=u;return Object.freeze({hasRetryTokens:d,retrieveRetryTokens:(f)=>{if(!d(f))throw Error("No retry token available");let p=a(f);return u-=p,p},releaseRetryTokens:(f)=>{u+=f??s,u=Math.min(u,n)}})},Tf=(t,r)=>Math.floor(Math.min(us,Math.random()*2**r*t)),Cf=(t)=>{if(!t)return!1;return Zi(t)||cf(t)||Xr(t)||Yr(t)};class ta{maxAttemptsProvider;retryDecider;delayDecider;retryQuota;mode=Ye.STANDARD;constructor(t,r){this.maxAttemptsProvider=t,this.retryDecider=r?.retryDecider??Cf,this.delayDecider=r?.delayDecider??Tf,this.retryQuota=r?.retryQuota??Pv(cs)}shouldRetry(t,r,n){return r<n&&this.retryDecider(t)&&this.retryQuota.hasRetryTokens(t)}async getMaxAttempts(){let t;try{t=await this.maxAttemptsProvider()}catch(r){t=Rt}return t}async retry(t,r,n){let s,o=0,i=0,u=await this.getMaxAttempts(),{request:a}=r;if(as.isInstance(a))a.headers[ds]=of();while(!0)try{if(as.isInstance(a))a.headers[ls]=`attempt=${o+1}; max=${u}`;if(n?.beforeRequest)await n.beforeRequest();let{response:d,output:l}=await t(r);if(n?.afterRequest)n.afterRequest(d);return this.retryQuota.releaseRetryTokens(s),l.$metadata.attempts=o+1,l.$metadata.totalRetryDelay=i,{response:d,output:l}}catch(d){let l=Sf(d);if(o++,this.shouldRetry(l,o,u)){s=this.retryQuota.retrieveRetryTokens(l);let h=this.delayDecider(Xr(l)?pf:hf,o),f=kv(l.$response),p=Math.max(f||0,h);i+=p,await new Promise((g)=>setTimeout(g,p));continue}if(!l.$metadata)l.$metadata={};throw l.$metadata.attempts=o,l.$metadata.totalRetryDelay=i,l}}}var kv=(t)=>{if(!sf.isInstance(t))return;let r=Object.keys(t.headers).find((i)=>i.toLowerCase()==="retry-after");if(!r)return;let n=t.headers[r],s=Number(n);if(!Number.isNaN(s))return Math.min(s*1000,20000);let o=new Date(n);return Math.min(o.getTime()-Date.now(),20000)};class If extends ta{rateLimiter;constructor(t,r){let{rateLimiter:n,...s}=r??{};super(t,s);this.rateLimiter=n??new Jr,this.mode=Ye.ADAPTIVE}async retry(t,r){return super.retry(t,r,{beforeRequest:async()=>this.rateLimiter.getSendToken(),afterRequest:(n)=>{this.rateLimiter.updateClientSendingRate(n)}})}}var Yi="AWS_MAX_ATTEMPTS",Ji="max_attempts",Mv={environmentVariableSelector:(t)=>{let r=t[Yi];if(!r)return;let n=parseInt(r);if(Number.isNaN(n))throw Error(`Environment variable ${Yi} mast be a number, got "${r}"`);return n},configFileSelector:(t)=>{let r=t[Ji];if(!r)return;let n=parseInt(r);if(Number.isNaN(n))throw Error(`Shared config file entry ${Ji} mast be a number, got "${r}"`);return n},default:Rt},Dv=(t,r)=>{let{retryStrategy:n,retryMode:s}=t,{defaultMaxAttempts:o=Rt,defaultBaseDelay:i=Q.delay()}=r??{},u=nf(t.maxAttempts??o),a=n?Promise.resolve(n):void 0,d=async()=>{let l=await u();if(await nf(s)()===Ye.ADAPTIVE)return new Af(u,{maxAttempts:l,baseDelay:i});return new Qr({maxAttempts:l,baseDelay:i})};return Object.assign(t,{maxAttempts:u,retryStrategy:()=>a??=d()})},Rf="AWS_RETRY_MODE",vf="retry_mode",Fv={environmentVariableSelector:(t)=>t[Rf],configFileSelector:(t)=>t[vf],default:_f},Nf=()=>(t)=>async(r)=>{let{request:n}=r;if(as.isInstance(n))delete n.headers[ds],delete n.headers[ls];return t(r)},Of={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Lv=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Nf(),Of)}}),Uv=wf(af),$v=Ov(af);Bv.AdaptiveRetryStrategy=Af;Bv.CONFIG_MAX_ATTEMPTS=Ji;Bv.CONFIG_RETRY_MODE=vf;Bv.ConfiguredRetryStrategy=xf;Bv.DEFAULT_MAX_ATTEMPTS=Rt;Bv.DEFAULT_RETRY_DELAY_BASE=hf;Bv.DEFAULT_RETRY_MODE=_f;Bv.DefaultRateLimiter=Jr;Bv.DeprecatedAdaptiveRetryStrategy=If;Bv.DeprecatedStandardRetryStrategy=ta;Bv.ENV_MAX_ATTEMPTS=Yi;Bv.ENV_RETRY_MODE=Rf;Bv.INITIAL_RETRY_TOKENS=cs;Bv.INVOCATION_ID_HEADER=ds;Bv.MAXIMUM_RETRY_DELAY=us;Bv.NODE_MAX_ATTEMPT_CONFIG_OPTIONS=Mv;Bv.NODE_RETRY_MODE_CONFIG_OPTIONS=Fv;Bv.NO_RETRY_INCREMENT=ea;Bv.REQUEST_HEADER=ls;Bv.RETRY_COST=gf;Bv.RETRY_MODES=Ye;Bv.Retry=Q;Bv.StandardRetryStrategy=Qr;Bv.THROTTLING_RETRY_DELAY_BASE=pf;Bv.TIMEOUT_RETRY_COST=mf;Bv.defaultDelayDecider=Tf;Bv.defaultRetryDecider=Cf;Bv.getOmitRetryHeadersPlugin=Lv;Bv.getRetryAfterHint=Cv;Bv.getRetryPlugin=$v;Bv.isBrowserNetworkError=df;Bv.isClockSkewCorrectedError=uf;Bv.isClockSkewError=cf;Bv.isNodeJsHttp2TransientError=ff;Bv.isRetryableByTrait=Zi;Bv.isServerError=lf;Bv.isThrottlingError=Xr;Bv.isTransientError=Yr;Bv.omitRetryHeadersMiddleware=Nf;Bv.omitRetryHeadersMiddlewareOptions=Of;Bv.resolveRetryConfig=Dv;Bv.retryMiddleware=Uv;Bv.retryMiddlewareOptions=Ef});var kf=e(function(NN){var it={REQUEST_ID:Symbol.for("_AWS_LAMBDA_REQUEST_ID"),X_RAY_TRACE_ID:Symbol.for("_AWS_LAMBDA_X_RAY_TRACE_ID"),TENANT_ID:Symbol.for("_AWS_LAMBDA_TENANT_ID"),TRACEPARENT:Symbol.for("_AWS_LAMBDA_TRACEPARENT"),TRACESTATE:Symbol.for("_AWS_LAMBDA_TRACESTATE"),BAGGAGE:Symbol.for("_AWS_LAMBDA_BAGGAGE")},ra=["true","1"].includes(process.env?.AWS_LAMBDA_NODEJS_NO_GLOBAL_AWSLAMBDA??"");if(!ra)globalThis.awslambda=globalThis.awslambda||{};class fs{static PROTECTED_KEYS=it;isProtectedKey(t){return Object.values(it).includes(t)}getRequestId(){return this.get(it.REQUEST_ID)??"-"}getXRayTraceId(){return this.get(it.X_RAY_TRACE_ID)}getTenantId(){return this.get(it.TENANT_ID)}getTraceparent(){return this.get(it.TRACEPARENT)}getTracestate(){return this.get(it.TRACESTATE)}getBaggage(){return this.get(it.BAGGAGE)}}class Pf extends fs{currentContext;getContext(){return this.currentContext}hasContext(){return this.currentContext!==void 0}get(t){return this.currentContext?.[t]}set(t,r){if(this.isProtectedKey(t))throw Error(`Cannot modify protected Lambda context field: ${String(t)}`);this.currentContext=this.currentContext||{},this.currentContext[t]=r}run(t,r){return this.currentContext=t,r()}}class sa extends fs{als;static async create(){let t=new sa,r=await import("node:async_hooks");return t.als=new r.AsyncLocalStorage,t}getContext(){return this.als.getStore()}hasContext(){return this.als.getStore()!==void 0}get(t){return this.als.getStore()?.[t]}set(t,r){if(this.isProtectedKey(t))throw Error(`Cannot modify protected Lambda context field: ${String(t)}`);let n=this.als.getStore();if(!n)throw Error("No context available");n[t]=r}run(t,r){return this.als.run(t,r)}}NN.InvokeStore=void 0;(function(t){let r=null;async function n(s){if(!r)r=(async()=>{let i=s===!0||"AWS_LAMBDA_MAX_CONCURRENCY"in process.env?await sa.create():new Pf;if(!ra&&globalThis.awslambda?.InvokeStore)return globalThis.awslambda.InvokeStore;else if(!ra&&globalThis.awslambda)return globalThis.awslambda.InvokeStore=i,i;else return i})();return r}t.getInstanceAsync=n,t._testing=process.env.AWS_LAMBDA_BENCHMARK_MODE==="1"?{reset:()=>{if(r=null,globalThis.awslambda?.InvokeStore)delete globalThis.awslambda.InvokeStore;globalThis.awslambda={InvokeStore:void 0}}}:void 0})(NN.InvokeStore||(NN.InvokeStore={}));NN.InvokeStoreBase=fs});var Xe=e(function(KN){var{getSmithyContext:oa,hasOwn:PN}=me();KN.getSmithyContext=oa;var{HttpRequest:ia}=K(),{requestBuilder:kN}=K();KN.requestBuilder=kN;var{HttpApiKeyAuthLocation:Mf}=bt(),MN=(t,r)=>{if(!r||r.length===0)return t;let n=[];for(let s of r)for(let o of t)if(o.schemeId.split("#")[1]===s)n.push(o);for(let s of t)if(!n.find(({schemeId:o})=>o===s.schemeId))n.push(s);return n};function DN(t){let r=new Map;for(let n of t)r.set(n.schemeId,n);return r}var aa=(t,r)=>(n,s)=>async(o)=>{let i=t.httpAuthSchemeProvider(await r.httpAuthSchemeParametersProvider(t,s,o.input)),u=t.authSchemePreference?await t.authSchemePreference():[],a=MN(i,u),d=DN(t.httpAuthSchemes),l=oa(s),h=[];for(let f of a){let p=d.get(f.schemeId);if(!p){h.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}let g=p.identityProvider(await r.identityProviderConfigProvider(t));if(!g){h.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:m={},signingProperties:y={}}=f.propertiesExtractor?.(t,s)||{};f.identityProperties=Object.assign(f.identityProperties||{},m),f.signingProperties=Object.assign(f.signingProperties||{},y),l.selectedHttpAuthScheme={httpAuthOption:f,identity:await g(f.identityProperties),signer:p.signer};break}if(!l.selectedHttpAuthScheme)throw Error(h.join(`
|
|
18
|
-
`));return n(o)},Df={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},FN=(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n})=>({applyToStack:(s)=>{s.addRelativeTo(aa(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n}),Df)}}),Ff={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"serializerMiddleware"},LN=(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n})=>({applyToStack:(s)=>{s.addRelativeTo(aa(t,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:n}),Ff)}}),UN=(t)=>(r)=>{throw r},$N=(t,r)=>{},Lf=(t)=>(r,n)=>async(s)=>{if(!ia.isInstance(s.request))return r(s);let i=oa(n).selectedHttpAuthScheme;if(!i)throw Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:u={}},identity:a,signer:d}=i,l=await r({...s,request:await d.sign(s.request,a,u)}).catch((d.errorHandler||UN)(u));return(d.successHandler||$N)(l.response,u),l},Uf={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},BN=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Lf(),Uf)}}),HN=(t)=>{if(typeof t==="function")return t;let r=Promise.resolve(t);return()=>r},zN=async(t,r,n,s=(i)=>i,...o)=>{let i=new t(n);return i=s(i)??i,await r.send(i,...o)};function qN(t,r,n,s,o){return async function*(u,a,...d){let l=a,h=u.startingToken??l[n],f=!0,p;while(f){if(l[n]=h,o)l[o]=l[o]??u.pageSize;if(u.client instanceof t)p=await zN(r,u.client,a,u.withCommand,...d);else throw Error(`Invalid client, expected instance of ${t.name}`);yield p;let g=h;h=VN(p,s),f=!!(h&&(!u.stopOnSameToken||h!==g))}return}}var VN=(t,r)=>{let n=t,s=r.split(".");for(let o of s){if(!n||typeof n!=="object")return;n=n[o]}return n};function jN(t,r,n){if(!t.__smithy_context)t.__smithy_context={features:{}};else if(!t.__smithy_context.features)t.__smithy_context.features={};t.__smithy_context.features[r]=n}class $f{authSchemes=new Map;constructor(t){for(let r in t){if(!PN(t,r))continue;let n=t[r];if(n!==void 0)this.authSchemes.set(r,n)}}getIdentityProvider(t){return this.authSchemes.get(t)}}class Bf{async sign(t,r,n){if(!n)throw Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!n.name)throw Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!n.in)throw Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!r.apiKey)throw Error("request could not be signed with `apiKey` since the `apiKey` is not defined");let s=ia.clone(t);if(n.in===Mf.QUERY)s.query[n.name]=r.apiKey;else if(n.in===Mf.HEADER)s.headers[n.name]=n.scheme?`${n.scheme} ${r.apiKey}`:r.apiKey;else throw Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+n.in+"`");return s}}class Hf{async sign(t,r,n){let s=ia.clone(t);if(!r.token)throw Error("request could not be signed with `token` since the `token` is not defined");return s.headers.Authorization=`Bearer ${r.token}`,s}}class zf{async sign(t,r,n){return t}}var qf=(t)=>function(n){return jf(n)&&n.expiration.getTime()-Date.now()<t},Vf=300000,WN=qf(Vf),jf=(t)=>t.expiration!==void 0,GN=(t,r,n)=>{if(t===void 0)return;let s=typeof t!=="function"?async()=>Promise.resolve(t):t,o,i,u,a=!1,d=async(l)=>{if(!i)i=s(l);try{o=await i,u=!0,a=!1}finally{i=void 0}return o};if(r===void 0)return async(l)=>{if(!u||l?.forceRefresh)o=await d(l);return o};return async(l)=>{if(!u||l?.forceRefresh)o=await d(l);if(a)return o;if(!n(o))return a=!0,o;if(r(o))return await d(l),o;return o}};KN.DefaultIdentityProviderConfig=$f;KN.EXPIRATION_MS=Vf;KN.HttpApiKeyAuthSigner=Bf;KN.HttpBearerAuthSigner=Hf;KN.NoAuthSigner=zf;KN.createIsIdentityExpiredFunction=qf;KN.createPaginator=qN;KN.doesIdentityRequireRefresh=jf;KN.getHttpAuthSchemeEndpointRuleSetPlugin=FN;KN.getHttpAuthSchemePlugin=LN;KN.getHttpSigningPlugin=BN;KN.httpAuthSchemeEndpointRuleSetMiddlewareOptions=Df;KN.httpAuthSchemeMiddleware=aa;KN.httpAuthSchemeMiddlewareOptions=Ff;KN.httpSigningMiddleware=Lf;KN.httpSigningMiddlewareOptions=Uf;KN.isIdentityExpired=WN;KN.memoizeIdentityProvider=GN;KN.normalizeProvider=HN;KN.setFeature=jN});var Wf=e(function(Zr,ca){(function(t,r){typeof Zr=="object"&&typeof ca=="object"?ca.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Zr=="object"?Zr.bowser=r():t.bowser=r()})(Zr,function(){return function(t){var r={};function n(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=r,n.d=function(s,o,i){n.o(s,o)||Object.defineProperty(s,o,{enumerable:!0,get:i})},n.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},n.t=function(s,o){if(1&o&&(s=n(s)),8&o)return s;if(4&o&&typeof s=="object"&&s&&s.__esModule)return s;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:s}),2&o&&typeof s!="string")for(var u in s)n.d(i,u,function(a){return s[a]}.bind(null,u));return i},n.n=function(s){var o=s&&s.__esModule?function(){return s.default}:function(){return s};return n.d(o,"a",o),o},n.o=function(s,o){return Object.prototype.hasOwnProperty.call(s,o)},n.p="",n(n.s=90)}({17:function(t,r,n){r.__esModule=!0,r.default=void 0;var s=n(18),o=function(){function i(){}return i.getFirstMatch=function(u,a){var d=a.match(u);return d&&d.length>0&&d[1]||""},i.getSecondMatch=function(u,a){var d=a.match(u);return d&&d.length>1&&d[2]||""},i.matchAndReturnConst=function(u,a,d){if(u.test(a))return d},i.getWindowsVersionName=function(u){switch(u){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},i.getMacOSVersionName=function(u){var a=u.split(".").splice(0,2).map(function(h){return parseInt(h,10)||0});a.push(0);var d=a[0],l=a[1];if(d===10)switch(l){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(d){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}},i.getAndroidVersionName=function(u){var a=u.split(".").splice(0,2).map(function(d){return parseInt(d,10)||0});if(a.push(0),!(a[0]===1&&a[1]<5))return a[0]===1&&a[1]<6?"Cupcake":a[0]===1&&a[1]>=6?"Donut":a[0]===2&&a[1]<2?"Eclair":a[0]===2&&a[1]===2?"Froyo":a[0]===2&&a[1]>2?"Gingerbread":a[0]===3?"Honeycomb":a[0]===4&&a[1]<1?"Ice Cream Sandwich":a[0]===4&&a[1]<4?"Jelly Bean":a[0]===4&&a[1]>=4?"KitKat":a[0]===5?"Lollipop":a[0]===6?"Marshmallow":a[0]===7?"Nougat":a[0]===8?"Oreo":a[0]===9?"Pie":void 0},i.getVersionPrecision=function(u){return u.split(".").length},i.compareVersions=function(u,a,d){d===void 0&&(d=!1);var l=i.getVersionPrecision(u),h=i.getVersionPrecision(a),f=Math.max(l,h),p=0,g=i.map([u,a],function(m){var y=f-i.getVersionPrecision(m),S=m+Array(y+1).join(".0");return i.map(S.split("."),function(w){return Array(20-w.length).join("0")+w}).reverse()});for(d&&(p=f-Math.min(l,h)),f-=1;f>=p;){if(g[0][f]>g[1][f])return 1;if(g[0][f]===g[1][f]){if(f===p)return 0;f-=1}else if(g[0][f]<g[1][f])return-1}},i.map=function(u,a){var d,l=[];if(Array.prototype.map)return Array.prototype.map.call(u,a);for(d=0;d<u.length;d+=1)l.push(a(u[d]));return l},i.find=function(u,a){var d,l;if(Array.prototype.find)return Array.prototype.find.call(u,a);for(d=0,l=u.length;d<l;d+=1){var h=u[d];if(a(h,d))return h}},i.assign=function(u){for(var a,d,l=u,h=arguments.length,f=Array(h>1?h-1:0),p=1;p<h;p++)f[p-1]=arguments[p];if(Object.assign)return Object.assign.apply(Object,[u].concat(f));var g=function(){var m=f[a];typeof m=="object"&&m!==null&&Object.keys(m).forEach(function(y){l[y]=m[y]})};for(a=0,d=f.length;a<d;a+=1)g();return u},i.getBrowserAlias=function(u){return s.BROWSER_ALIASES_MAP[u]},i.getBrowserTypeByAlias=function(u){return s.BROWSER_MAP[u]||""},i}();r.default=o,t.exports=r.default},18:function(t,r,n){r.__esModule=!0,r.ENGINE_MAP=r.OS_MAP=r.PLATFORMS_MAP=r.BROWSER_MAP=r.BROWSER_ALIASES_MAP=void 0,r.BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",Brave:"brave",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",DuckDuckGo:"duckduckgo",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Linespider:"linespider",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SlackBot:"slackbot",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},r.BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",brave:"Brave",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",duckduckgo:"DuckDuckGo",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",linespider:"Linespider",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",slackbot:"SlackBot",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},r.PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},r.OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},r.ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"}},90:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(91))&&s.__esModule?s:{default:s},i=n(18);function u(d,l){for(var h=0;h<l.length;h++){var f=l[h];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}var a=function(){function d(){}var l,h,f;return d.getParser=function(p,g,m){if(g===void 0&&(g=!1),m===void 0&&(m=null),typeof p!="string")throw Error("UserAgent should be a string");return new o.default(p,g,m)},d.parse=function(p,g){return g===void 0&&(g=null),new o.default(p,g).getResult()},l=d,f=[{key:"BROWSER_MAP",get:function(){return i.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return i.ENGINE_MAP}},{key:"OS_MAP",get:function(){return i.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return i.PLATFORMS_MAP}}],(h=null)&&u(l.prototype,h),f&&u(l,f),d}();r.default=a,t.exports=r.default},91:function(t,r,n){r.__esModule=!0,r.default=void 0;var s=d(n(92)),o=d(n(93)),i=d(n(94)),u=d(n(95)),a=d(n(17));function d(h){return h&&h.__esModule?h:{default:h}}var l=function(){function h(p,g,m){if(g===void 0&&(g=!1),m===void 0&&(m=null),p==null||p==="")throw Error("UserAgent parameter can't be empty");this._ua=p;var y=!1;typeof g=="boolean"?(y=g,this._hints=m):this._hints=g!=null&&typeof g=="object"?g:null,this.parsedResult={},y!==!0&&this.parse()}var f=h.prototype;return f.getHints=function(){return this._hints},f.hasBrand=function(p){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var g=p.toLowerCase();return this._hints.brands.some(function(m){return m.brand&&m.brand.toLowerCase()===g})},f.getBrandVersion=function(p){if(this._hints&&Array.isArray(this._hints.brands)){var g=p.toLowerCase(),m=this._hints.brands.find(function(y){return y.brand&&y.brand.toLowerCase()===g});return m?m.version:void 0}},f.getUA=function(){return this._ua},f.test=function(p){return p.test(this._ua)},f.parseBrowser=function(){var p=this;this.parsedResult.browser={};var g=a.default.find(s.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.browser=g.describe(this.getUA(),this)),this.parsedResult.browser},f.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},f.getBrowserName=function(p){return p?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},f.getBrowserVersion=function(){return this.getBrowser().version},f.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},f.parseOS=function(){var p=this;this.parsedResult.os={};var g=a.default.find(o.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.os=g.describe(this.getUA())),this.parsedResult.os},f.getOSName=function(p){var g=this.getOS().name;return p?String(g).toLowerCase()||"":g||""},f.getOSVersion=function(){return this.getOS().version},f.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},f.getPlatformType=function(p){p===void 0&&(p=!1);var g=this.getPlatform().type;return p?String(g).toLowerCase()||"":g||""},f.parsePlatform=function(){var p=this;this.parsedResult.platform={};var g=a.default.find(i.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.platform=g.describe(this.getUA())),this.parsedResult.platform},f.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},f.getEngineName=function(p){return p?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},f.parseEngine=function(){var p=this;this.parsedResult.engine={};var g=a.default.find(u.default,function(m){if(typeof m.test=="function")return m.test(p);if(Array.isArray(m.test))return m.test.some(function(y){return p.test(y)});throw Error("Browser's test function is not valid")});return g&&(this.parsedResult.engine=g.describe(this.getUA())),this.parsedResult.engine},f.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},f.getResult=function(){return a.default.assign({},this.parsedResult)},f.satisfies=function(p){var g=this,m={},y=0,S={},w=0;if(Object.keys(p).forEach(function(q){var W=p[q];typeof W=="string"?(S[q]=W,w+=1):typeof W=="object"&&(m[q]=W,y+=1)}),y>0){var E=Object.keys(m),A=a.default.find(E,function(q){return g.isOS(q)});if(A){var v=this.satisfies(m[A]);if(v!==void 0)return v}var L=a.default.find(E,function(q){return g.isPlatform(q)});if(L){var k=this.satisfies(m[L]);if(k!==void 0)return k}}if(w>0){var U=Object.keys(S),de=a.default.find(U,function(q){return g.isBrowser(q,!0)});if(de!==void 0)return this.compareVersion(S[de])}},f.isBrowser=function(p,g){g===void 0&&(g=!1);var m=this.getBrowserName().toLowerCase(),y=p.toLowerCase(),S=a.default.getBrowserTypeByAlias(y);return g&&S&&(y=S.toLowerCase()),y===m},f.compareVersion=function(p){var g=[0],m=p,y=!1,S=this.getBrowserVersion();if(typeof S=="string")return p[0]===">"||p[0]==="<"?(m=p.substr(1),p[1]==="="?(y=!0,m=p.substr(2)):g=[],p[0]===">"?g.push(1):g.push(-1)):p[0]==="="?m=p.substr(1):p[0]==="~"&&(y=!0,m=p.substr(1)),g.indexOf(a.default.compareVersions(S,m,y))>-1},f.isOS=function(p){return this.getOSName(!0)===String(p).toLowerCase()},f.isPlatform=function(p){return this.getPlatformType(!0)===String(p).toLowerCase()},f.isEngine=function(p){return this.getEngineName(!0)===String(p).toLowerCase()},f.is=function(p,g){return g===void 0&&(g=!1),this.isBrowser(p,g)||this.isOS(p)||this.isPlatform(p)},f.some=function(p){var g=this;return p===void 0&&(p=[]),p.some(function(m){return g.is(m)})},h}();r.default=l,t.exports=r.default},92:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=/version\/(\d+(\.?_?\d+)+)/i,u=[{test:[/gptbot/i],describe:function(a){var d={name:"GPTBot"},l=o.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/chatgpt-user/i],describe:function(a){var d={name:"ChatGPT-User"},l=o.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/oai-searchbot/i],describe:function(a){var d={name:"OAI-SearchBot"},l=o.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(a){var d={name:"ClaudeBot"},l=o.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(a){var d={name:"Omgilibot"},l=o.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/diffbot/i],describe:function(a){var d={name:"Diffbot"},l=o.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/perplexitybot/i],describe:function(a){var d={name:"PerplexityBot"},l=o.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/perplexity-user/i],describe:function(a){var d={name:"Perplexity-User"},l=o.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/youbot/i],describe:function(a){var d={name:"YouBot"},l=o.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-webindexer/i],describe:function(a){var d={name:"Meta-WebIndexer"},l=o.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-externalads/i],describe:function(a){var d={name:"Meta-ExternalAds"},l=o.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-externalagent/i],describe:function(a){var d={name:"Meta-ExternalAgent"},l=o.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/meta-externalfetcher/i],describe:function(a){var d={name:"Meta-ExternalFetcher"},l=o.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/googlebot/i],describe:function(a){var d={name:"Googlebot"},l=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/linespider/i],describe:function(a){var d={name:"Linespider"},l=o.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/amazonbot/i],describe:function(a){var d={name:"AmazonBot"},l=o.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/bingbot/i],describe:function(a){var d={name:"BingCrawler"},l=o.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/baiduspider/i],describe:function(a){var d={name:"BaiduSpider"},l=o.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/duckduckbot/i],describe:function(a){var d={name:"DuckDuckBot"},l=o.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/ia_archiver/i],describe:function(a){var d={name:"InternetArchiveCrawler"},l=o.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:"FacebookExternalHit"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(a){var d={name:"SlackBot"},l=o.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe:function(){return{name:"PingdomBot"}}},{test:[/opera/i],describe:function(a){var d={name:"Opera"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/opr\/|opios/i],describe:function(a){var d={name:"Opera"},l=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/SamsungBrowser/i],describe:function(a){var d={name:"Samsung Internet for Android"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/Whale/i],describe:function(a){var d={name:"NAVER Whale Browser"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/PaleMoon/i],describe:function(a){var d={name:"Pale Moon"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/MZBrowser/i],describe:function(a){var d={name:"MZ Browser"},l=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/focus/i],describe:function(a){var d={name:"Focus"},l=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/swing/i],describe:function(a){var d={name:"Swing"},l=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/coast/i],describe:function(a){var d={name:"Opera Coast"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(a){var d={name:"Opera Touch"},l=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/yabrowser/i],describe:function(a){var d={name:"Yandex Browser"},l=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/ucbrowser/i],describe:function(a){var d={name:"UC Browser"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/Maxthon|mxios/i],describe:function(a){var d={name:"Maxthon"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/epiphany/i],describe:function(a){var d={name:"Epiphany"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/puffin/i],describe:function(a){var d={name:"Puffin"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/sleipnir/i],describe:function(a){var d={name:"Sleipnir"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/k-meleon/i],describe:function(a){var d={name:"K-Meleon"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/micromessenger/i],describe:function(a){var d={name:"WeChat"},l=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/qqbrowser/i],describe:function(a){var d={name:/qqbrowserlite/i.test(a)?"QQ Browser Lite":"QQ Browser"},l=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/msie|trident/i],describe:function(a){var d={name:"Internet Explorer"},l=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/\sedg\//i],describe:function(a){var d={name:"Microsoft Edge"},l=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/edg([ea]|ios)/i],describe:function(a){var d={name:"Microsoft Edge"},l=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/vivaldi/i],describe:function(a){var d={name:"Vivaldi"},l=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/seamonkey/i],describe:function(a){var d={name:"SeaMonkey"},l=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/sailfish/i],describe:function(a){var d={name:"Sailfish"},l=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,a);return l&&(d.version=l),d}},{test:[/silk/i],describe:function(a){var d={name:"Amazon Silk"},l=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/phantom/i],describe:function(a){var d={name:"PhantomJS"},l=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/slimerjs/i],describe:function(a){var d={name:"SlimerJS"},l=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var d={name:"BlackBerry"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var d={name:"WebOS Browser"},l=o.default.getFirstMatch(i,a)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/bada/i],describe:function(a){var d={name:"Bada"},l=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/tizen/i],describe:function(a){var d={name:"Tizen"},l=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/qupzilla/i],describe:function(a){var d={name:"QupZilla"},l=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/librewolf/i],describe:function(a){var d={name:"LibreWolf"},l=o.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/firefox|iceweasel|fxios/i],describe:function(a){var d={name:"Firefox"},l=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/electron/i],describe:function(a){var d={name:"Electron"},l=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(a){var d={name:"Sogou Browser"},l=o.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,a),h=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a),f=o.default.getFirstMatch(/se ([\d.]+)x/i,a),p=l||h||f;return p&&(d.version=p),d}},{test:[/MiuiBrowser/i],describe:function(a){var d={name:"Miui"},l=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){return!!a.hasBrand("DuckDuckGo")||a.test(/\sDdg\/[\d.]+$/i)},describe:function(a,d){var l={name:"DuckDuckGo"};if(d){var h=d.getBrandVersion("DuckDuckGo");if(h)return l.version=h,l}var f=o.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,a);return f&&(l.version=f),l}},{test:function(a){return a.hasBrand("Brave")},describe:function(a,d){var l={name:"Brave"};if(d){var h=d.getBrandVersion("Brave");if(h)return l.version=h,l}return l}},{test:[/chromium/i],describe:function(a){var d={name:"Chromium"},l=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,a)||o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/chrome|crios|crmo/i],describe:function(a){var d={name:"Chrome"},l=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/GSA/i],describe:function(a){var d={name:"Google Search"},l=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){var d=!a.test(/like android/i),l=a.test(/android/i);return d&&l},describe:function(a){var d={name:"Android Browser"},l=o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/playstation 4/i],describe:function(a){var d={name:"PlayStation 4"},l=o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/safari|applewebkit/i],describe:function(a){var d={name:"Safari"},l=o.default.getFirstMatch(i,a);return l&&(d.version=l),d}},{test:[/.*/i],describe:function(a){var d=a.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(d,a),version:o.default.getSecondMatch(d,a)}}}];r.default=u,t.exports=r.default},93:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=n(18),u=[{test:[/Roku\/DVP/],describe:function(a){var d=o.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,a);return{name:i.OS_MAP.Roku,version:d}}},{test:[/windows phone/i],describe:function(a){var d=o.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.WindowsPhone,version:d}}},{test:[/windows /i],describe:function(a){var d=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,a),l=o.default.getWindowsVersionName(d);return{name:i.OS_MAP.Windows,version:d,versionName:l}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(a){var d={name:i.OS_MAP.iOS},l=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,a);return l&&(d.version=l),d}},{test:[/macintosh/i],describe:function(a){var d=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,a).replace(/[_\s]/g,"."),l=o.default.getMacOSVersionName(d),h={name:i.OS_MAP.MacOS,version:d};return l&&(h.versionName=l),h}},{test:[/(ipod|iphone|ipad)/i],describe:function(a){var d=o.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,a).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:d}}},{test:[/OpenHarmony/i],describe:function(a){var d=o.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.HarmonyOS,version:d}}},{test:function(a){var d=!a.test(/like android/i),l=a.test(/android/i);return d&&l},describe:function(a){var d=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,a),l=o.default.getAndroidVersionName(d),h={name:i.OS_MAP.Android,version:d};return l&&(h.versionName=l),h}},{test:[/(web|hpw)[o0]s/i],describe:function(a){var d=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,a),l={name:i.OS_MAP.WebOS};return d&&d.length&&(l.version=d),l}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(a){var d=o.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,a)||o.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,a)||o.default.getFirstMatch(/\bbb(\d+)/i,a);return{name:i.OS_MAP.BlackBerry,version:d}}},{test:[/bada/i],describe:function(a){var d=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Bada,version:d}}},{test:[/tizen/i],describe:function(a){var d=o.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.Tizen,version:d}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(a){var d=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,a);return{name:i.OS_MAP.PlayStation4,version:d}}}];r.default=u,t.exports=r.default},94:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=n(18),u=[{test:[/googlebot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/linespider/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Line"}}},{test:[/amazonbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Slack"}}},{test:[/yahoo/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe:function(){return{type:i.PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe:function(a){var d=o.default.getFirstMatch(/(can-l01)/i,a)&&"Nova",l={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return d&&(l.model=d),l}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(a){var d=a.test(/ipod|iphone/i),l=a.test(/like (ipod|iphone)/i);return d&&!l},describe:function(a){var d=o.default.getFirstMatch(/(ipod|iphone)/i,a);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:d}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe:function(a){var d=o.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,a),l={type:i.PLATFORMS_MAP.mobile,vendor:"Nokia"};return d&&(l.model=d),l}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName(!0)==="blackberry"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(a){return a.getBrowserName(!0)==="bada"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(a){return a.getBrowserName()==="windows phone"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(a){var d=Number(String(a.getOSVersion()).split(".")[0]);return a.getOSName(!0)==="android"&&d>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(a){return a.getOSName(!0)==="android"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="macos"},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(a){return a.getOSName(!0)==="windows"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="linux"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(a){return a.getOSName(!0)==="playstation 4"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(a){return a.getOSName(!0)==="roku"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];r.default=u,t.exports=r.default},95:function(t,r,n){r.__esModule=!0,r.default=void 0;var s,o=(s=n(17))&&s.__esModule?s:{default:s},i=n(18),u=[{test:function(a){return a.getBrowserName(!0)==="microsoft edge"},describe:function(a){if(/\sedg\//i.test(a))return{name:i.ENGINE_MAP.Blink};var d=o.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,a);return{name:i.ENGINE_MAP.EdgeHTML,version:d}}},{test:[/trident/i],describe:function(a){var d={name:i.ENGINE_MAP.Trident},l=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){return a.test(/presto/i)},describe:function(a){var d={name:i.ENGINE_MAP.Presto},l=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:function(a){var d=a.test(/gecko/i),l=a.test(/like gecko/i);return d&&!l},describe:function(a){var d={name:i.ENGINE_MAP.Gecko},l=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(a){var d={name:i.ENGINE_MAP.WebKit},l=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,a);return l&&(d.version=l),d}}];r.default=u,t.exports=r.default}})})});var Ce=e(function(lP){var{Retry:yO,RETRY_MODES:Gf}=cA(),{HttpRequest:pa,parseUrl:SO}=K(),{InvokeStore:Kf}=kf(),{normalizeProvider:wO}=Xe(),{platform:EO,release:bO}=c("node:os"),{versions:ua,env:Qf}=c("node:process"),{isValidHostLabel:_O,isIpAddress:eh,customEndpointFunctions:AO}=He(),{EndpointError:xO,resolveEndpoint:TO}=He();lP.EndpointError=xO;lP.isIpAddress=eh;lP.resolveEndpoint=TO;var{loadConfig:CO,NODE_REGION_CONFIG_OPTIONS:th,NODE_REGION_CONFIG_FILE_OPTIONS:rh}=V(),{REGION_ENV_NAME:IO,REGION_INI_NAME:RO,resolveRegionConfig:vO}=V();lP.NODE_REGION_CONFIG_FILE_OPTIONS=rh;lP.NODE_REGION_CONFIG_OPTIONS=th;lP.REGION_ENV_NAME=IO;lP.REGION_INI_NAME=RO;lP.resolveRegionConfig=vO;var ps={warningEmitted:!1},NO=(t)=>{if(t&&!ps.warningEmitted){if(process.env.AWS_SDK_JS_NODE_VERSION_SUPPORT_WARNING_DISABLED==="true"){ps.warningEmitted=!0;return}let r=parseInt(t.substring(1,t.indexOf("."))),n=22;if(r<n)ps.warningEmitted=!0,process.emitWarning(`NodeVersionSupportWarning: The AWS SDK for JavaScript (v3)
|
|
19
|
-
versions published after the first week of January 2027
|
|
20
|
-
will require node >=${n}. You are running node ${t}.
|
|
21
|
-
|
|
22
|
-
To continue receiving updates to AWS services, bug fixes,
|
|
23
|
-
and security updates please upgrade to node >=${n}.
|
|
24
|
-
|
|
25
|
-
More information can be found at: https://a.co/c895JFp`)}},OO=()=>(t,r)=>async(n)=>(r.__retryLongPoll=!0,t(n)),PO={name:"longPollMiddleware",tags:["RETRY"],step:"initialize",override:!0},kO=(t)=>({applyToStack:(r)=>{r.add(OO(),PO)}});function MO(t,r,n){if(!t.$source)t.$source={};return t.$source[r]=n,t}yO.v2026||=typeof process==="object"&&process.env?.AWS_NEW_RETRIES_2026==="true";function Ue(t,r,n){if(!t.__aws_sdk_context)t.__aws_sdk_context={features:{}};else if(!t.__aws_sdk_context.features)t.__aws_sdk_context.features={};t.__aws_sdk_context.features[r]=n}function DO(t,r,n){if(!t.$source)t.$source={};return t.$source[r]=n,t}function FO(t){return t}var nh=(t)=>(r)=>async(n)=>{if(!pa.isInstance(n.request))return r(n);let{request:s}=n,{handlerProtocol:o=""}=t.requestHandler.metadata||{};if(o.indexOf("h2")>=0&&!s.headers[":authority"])delete s.headers.host,s.headers[":authority"]=s.hostname+(s.port?":"+s.port:"");else if(!s.headers.host){let i=s.hostname;if(s.port!=null)i+=`:${s.port}`;s.headers.host=i}return r(n)},sh={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},LO=(t)=>({applyToStack:(r)=>{r.add(nh(t),sh)}}),oh=()=>(t,r)=>async(n)=>{try{let s=await t(n),{clientName:o,commandName:i,logger:u,dynamoDbDocumentClientOptions:a={}}=r,{overrideInputFilterSensitiveLog:d,overrideOutputFilterSensitiveLog:l}=a,h=d??r.inputFilterSensitiveLog,f=l??r.outputFilterSensitiveLog,{$metadata:p,...g}=s.output;return u?.info?.({clientName:o,commandName:i,input:h(n.input),output:f(g),metadata:p}),s}catch(s){let{clientName:o,commandName:i,logger:u,dynamoDbDocumentClientOptions:a={}}=r,{overrideInputFilterSensitiveLog:d}=a,l=d??r.inputFilterSensitiveLog;throw u?.error?.({clientName:o,commandName:i,input:l(n.input),error:s,metadata:s.$metadata}),s}},ih={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},UO=(t)=>({applyToStack:(r)=>{r.add(oh(),ih)}}),ah={step:"build",tags:["RECURSION_DETECTION","TRACE_CONTEXT_PROPAGATION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},$O="AWS_LAMBDA_FUNCTION_NAME",BO="_X_AMZN_TRACE_ID",da="X-Amzn-Trace-Id",ha="traceparent",ch="tracestate",uh="baggage",dh=()=>(t)=>async(r)=>{let{request:n}=r;if(!pa.isInstance(n))return t(r);let s;{let o=Object.keys(n.headers??{}).find((i)=>i.toLowerCase()===da.toLowerCase())??da;if(!n.headers.hasOwnProperty(o)){let i=process.env[$O],u=process.env[BO];s??=await Kf.getInstanceAsync();let d=s?.getXRayTraceId()??u,l=(h)=>typeof h==="string"&&h.length>0;if(l(i)&&l(d))n.headers[da]=d}}if(HO(n.headers),!n.headers[ha]){let i=(s??=await Kf.getInstanceAsync())?.getTraceparent?.();if(i){n.headers[ha]=i;let u=s?.getTracestate?.();if(u)n.headers[ch]=u;let a=s?.getBaggage?.();if(a)n.headers[uh]=a}}return t(r)};function HO(t){for(let r of Object.keys(t)){let n=r.toLowerCase();if(r!==n&&(n===ha||n===ch||n===uh))t[n]=t[r],delete t[r]}}var zO=(t)=>({applyToStack:(r)=>{r.add(dh(),ah)}}),ga=void 0;function qO(t){if(t===void 0)return!0;return typeof t==="string"&&t.length<=50}function VO(t){let r=wO(t.userAgentAppId??ga),{customUserAgent:n}=t;return Object.assign(t,{customUserAgent:typeof n==="string"?[[n]]:n,userAgentAppId:async()=>{let s=await r();if(!qO(s)){let o=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;if(typeof s!=="string")o?.warn("userAgentAppId must be a string or undefined.");else if(s.length>50)o?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return s}})}var lh={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-east-2":{description:"Asia Pacific (Taipei)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"mx-central-1":{description:"Mexico (Central)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"aws-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"AWS European Sovereign Cloud (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"aws-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],version:"1.1"},fh=lh,hh="",ph=(t)=>{let{partitions:r}=fh;for(let s of r){let{regions:o,outputs:i}=s;for(let[u,a]of Object.entries(o))if(u===t)return{...i,...a}}for(let s of r){let{regionRegex:o,outputs:i}=s;if(new RegExp(o).test(t))return{...i}}let n=r.find((s)=>s.id==="aws");if(!n)throw Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...n.outputs}},gh=(t,r="")=>{fh=t,hh=r},jO=()=>{gh(lh,"")},mh=()=>hh,WO=/\d{12}\.ddb/;async function GO(t,r,n){if(n.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor")Ue(t,"PROTOCOL_RPC_V2_CBOR","M");if(typeof r.retryStrategy==="function"){let i=await r.retryStrategy();if(typeof i.mode==="string")switch(i.mode){case Gf.ADAPTIVE:Ue(t,"RETRY_MODE_ADAPTIVE","F");break;case Gf.STANDARD:Ue(t,"RETRY_MODE_STANDARD","E");break}}if(typeof r.accountIdEndpointMode==="function"){let i=t.endpointV2;if(String(i?.url?.hostname).match(WO))Ue(t,"ACCOUNT_ID_ENDPOINT","O");switch(await r.accountIdEndpointMode?.()){case"disabled":Ue(t,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Ue(t,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Ue(t,"ACCOUNT_ID_MODE_REQUIRED","R");break}}let o=t.__smithy_context?.selectedHttpAuthScheme?.identity;if(o?.$source){let i=o;if(i.accountId)Ue(t,"RESOLVED_ACCOUNT_ID","T");for(let[u,a]of Object.entries(i.$source??{}))Ue(t,u,a)}}var Xf="user-agent",la="x-amz-user-agent",Yf=" ",fa="/",KO=/[^!$%&'*+\-.^_`|~\w]/g,QO=/[^!$%&'*+\-.^_`|~\w#]/g,Jf="-",XO=1024;function YO(t){let r="";for(let n in t){let s=t[n];if(r.length+s.length+1<=XO){if(r.length)r+=","+s;else r+=s;continue}break}return r}var yh=(t)=>(r,n)=>async(s)=>{let{request:o}=s;if(!pa.isInstance(o))return r(s);let{headers:i}=o,u=n?.userAgent?.map(hs)||[],a=(await t.defaultUserAgentProvider()).map(hs);await GO(n,t,s);let d=n;a.push(`m/${YO(Object.assign({},n.__smithy_context?.features,d.__aws_sdk_context?.features))}`);let l=t?.customUserAgent?.map(hs)||[],h=await t.userAgentAppId();if(h)a.push(hs(["app",`${h}`]));let f=mh(),p=(f?[f]:[]).concat([...a,...u,...l]).join(Yf),g=[...a.filter((m)=>m.startsWith("aws-sdk-")),...l].join(Yf);if(t.runtime!=="browser"){if(g)i[la]=i[la]?`${i[Xf]} ${g}`:g;i[Xf]=p}else i[la]=p;return r({...s,request:o})},hs=(t)=>{let r=t[0].split(fa).map((u)=>u.replace(KO,Jf)).join(fa),n=t[1]?.replace(QO,Jf),s=r.indexOf(fa),o=r.substring(0,s),i=r.substring(s+1);if(o==="api")i=i.toLowerCase();return[o,i,n].filter((u)=>u&&u.length>0).reduce((u,a,d)=>{switch(d){case 0:return a;case 1:return`${u}/${a}`;default:return`${u}#${a}`}},"")},Sh={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},JO=(t)=>({applyToStack:(r)=>{r.add(yh(t),Sh)}}),ZO=()=>{let t=["deno","bun","llrt"];for(let r of t)if(ua[r])return[`md/${r}`,ua[r]];return["md/nodejs",ua.node]},wh={isCrtAvailable:!1},eP=()=>{if(wh.isCrtAvailable)return["md/crt-avail"];return null},Eh=({serviceId:t,clientVersion:r})=>{let n=ZO();return async(s)=>{let o=[["aws-sdk-js",r],["ua","2.1"],[`os/${EO()}`,bO()],["lang/js"],n],i=eP();if(i)o.push(i);if(t)o.push([`api/${t}`,r]);if(Qf.AWS_EXECUTION_ENV)o.push([`exec-env/${Qf.AWS_EXECUTION_ENV}`]);let u=await s?.userAgentAppId?.();return u?[...o,[`app/${u}`]]:[...o]}},tP=Eh,bh="AWS_SDK_UA_APP_ID",_h="sdk_ua_app_id",rP="sdk-ua-app-id",nP={environmentVariableSelector:(t)=>t[bh],configFileSelector:(t)=>t[_h]??t[rP],default:ga},sP=({serviceId:t,clientVersion:r})=>async(n)=>{let s=Wf(),o=s.parse??s.default.parse??(()=>""),i=typeof window<"u"&&window?.navigator?.userAgent?o(window.navigator.userAgent):void 0,u=[["aws-sdk-js",r],["ua","2.1"],[`os/${i?.os?.name||"other"}`,i?.os?.version],["lang/js"],["md/browser",`${i?.browser?.name??"unknown"}_${i?.browser?.version??"unknown"}`]];if(t)u.push([`api/${t}`,r]);let a=await n?.userAgentAppId?.();if(a)u.push([`app/${a}`]);return u},oP={os(t){if(/iPhone|iPad|iPod/.test(t))return"iOS";if(/Macintosh|Mac OS X/.test(t))return"macOS";if(/Windows NT/.test(t))return"Windows";if(/Android/.test(t))return"Android";if(/Linux/.test(t))return"Linux";return},browser(t){if(/EdgiOS|EdgA|Edg\//.test(t))return"Microsoft Edge";if(/Firefox\//.test(t))return"Firefox";if(/Chrome\//.test(t))return"Chrome";if(/Safari\//.test(t))return"Safari";return}},ma=(t,r=!1)=>{if(r){for(let n of t.split("."))if(!ma(n))return!1;return!0}if(!_O(t))return!1;if(t.length<3||t.length>63)return!1;if(t!==t.toLowerCase())return!1;if(eh(t))return!1;return!0},Zf=":",iP="/",Ah=(t)=>{let r=t.split(Zf);if(r.length<6)return null;let[n,s,o,i,u,...a]=r;if(n!=="arn"||s===""||o===""||a.join(Zf)==="")return null;let d=a.map((l)=>l.split(iP)).flat();return{partition:s,service:o,region:i,accountId:u,resourceId:d}},xh={isVirtualHostableS3Bucket:ma,parseArn:Ah,partition:ph};AO.aws=xh;var aP=(t)=>{if(typeof t.endpointProvider!=="function")throw Error("@aws-sdk/util-endpoint - endpointProvider and endpoint missing in config for this client.");let{endpoint:r}=t;if(r===void 0)t.endpoint=async()=>Th(t.endpointProvider({Region:typeof t.region==="function"?await t.region():t.region,UseDualStack:typeof t.useDualstackEndpoint==="function"?await t.useDualstackEndpoint():t.useDualstackEndpoint,UseFIPS:typeof t.useFipsEndpoint==="function"?await t.useFipsEndpoint():t.useFipsEndpoint,Endpoint:void 0},{logger:t.logger}));return t},Th=(t)=>SO(t.url);function cP(t={}){return CO({...th,async default(){if(!Ch.silence)console.warn("@aws-sdk - WARN - default STS region of us-east-1 used. See @aws-sdk/credential-providers README and set a region explicitly.");return"us-east-1"}},{...rh,...t})}var Ch={silence:!1},uP=(t)=>({setRegion(r){t.region=r},region(){return t.region}}),dP=(t)=>({region:t.region()});lP.DEFAULT_UA_APP_ID=ga;lP.NODE_APP_ID_CONFIG_OPTIONS=nP;lP.UA_APP_ID_ENV_NAME=bh;lP.UA_APP_ID_INI_NAME=_h;lP.awsEndpointFunctions=xh;lP.createDefaultUserAgentProvider=Eh;lP.createUserAgentStringParsingProvider=sP;lP.crtAvailability=wh;lP.defaultUserAgent=tP;lP.emitWarningIfUnsupportedVersion=NO;lP.fallback=oP;lP.getAwsRegionExtensionConfiguration=uP;lP.getHostHeaderPlugin=LO;lP.getLoggerPlugin=UO;lP.getLongPollPlugin=kO;lP.getRecursionDetectionPlugin=zO;lP.getUserAgentMiddlewareOptions=Sh;lP.getUserAgentPlugin=JO;lP.getUserAgentPrefix=mh;lP.hostHeaderMiddleware=nh;lP.hostHeaderMiddlewareOptions=sh;lP.isVirtualHostableS3Bucket=ma;lP.loggerMiddleware=oh;lP.loggerMiddlewareOptions=ih;lP.parseArn=Ah;lP.partition=ph;lP.recursionDetectionMiddleware=dh;lP.recursionDetectionMiddlewareOptions=ah;lP.resolveAwsRegionExtensionConfiguration=dP;lP.resolveDefaultAwsRegionalEndpointsConfig=aP;lP.resolveHostHeaderConfig=FO;lP.resolveUserAgentConfig=VO;lP.setCredentialFeature=MO;lP.setFeature=Ue;lP.setPartitionInfo=gh;lP.setTokenFeature=DO;lP.state=ps;lP.stsRegionDefaultResolver=cP;lP.stsRegionWarning=Ch;lP.toEndpointV1=Th;lP.useDefaultPartitionInfo=jO;lP.userAgentMiddleware=yh});var Wt=e(function(dk){var{HttpRequest:Ih}=K();function ck(t){let{signer:r,signer:n}=t,s=Object.assign(t,{eventSigner:r,messageSigner:n}),o=s.eventStreamPayloadHandlerProvider(s);return Object.assign(s,{eventStreamPayloadHandler:o})}var Rh=(t)=>(r,n)=>async(s)=>{let{request:o}=s;if(!Ih.isInstance(o))return r(s);return t.eventStreamPayloadHandler.handle(r,s,n)},vh={tags:["EVENT_STREAM","SIGNATURE","HANDLE"],name:"eventStreamHandlingMiddleware",relation:"after",toMiddleware:"awsAuthMiddleware",override:!0},Nh=(t)=>async(r)=>{let{request:n}=r;if(!Ih.isInstance(n))return t(r);return n.headers={...n.headers,"content-type":"application/vnd.amazon.eventstream","x-amz-content-sha256":"STREAMING-AWS4-HMAC-SHA256-EVENTS"},t({...r,request:n})},Oh={step:"build",tags:["EVENT_STREAM","HEADER","CONTENT_TYPE","CONTENT_SHA256"],name:"eventStreamHeaderMiddleware",override:!0},uk=(t)=>({applyToStack:(r)=>{r.addRelativeTo(Rh(t),vh),r.add(Nh,Oh)}});dk.eventStreamHandlingMiddleware=Rh;dk.eventStreamHandlingMiddlewareOptions=vh;dk.eventStreamHeaderMiddleware=Nh;dk.eventStreamHeaderMiddlewareOptions=Oh;dk.getEventStreamPlugin=uk;dk.resolveEventStreamConfig=ck});var Ia=e(function(Rk){var{hasOwn:cr,fromUtf8:Ph,fromHex:yk,toHex:vt,toUint8Array:en,isArrayBuffer:Sk}=X(),{normalizeProvider:kh}=le(),{escapeUri:gs,HttpRequest:Lh}=K();class Uh{format(t){let r=[];for(let o in t){if(!cr(t,o))continue;let i=Ph(o);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(t[o]))}let n=new Uint8Array(r.reduce((o,i)=>o+i.byteLength,0)),s=0;for(let o of r)n.set(o,s),s+=o.byteLength;return n}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,t.value,!1),new Uint8Array(r.buffer);case"integer":let n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,t.value,!1),new Uint8Array(n.buffer);case"long":let s=new Uint8Array(9);return s[0]=5,s.set(t.value.bytes,1),s;case"binary":let o=new DataView(new ArrayBuffer(3+t.value.byteLength));o.setUint8(0,6),o.setUint16(1,t.value.byteLength,!1);let i=new Uint8Array(o.buffer);return i.set(t.value,3),i;case"string":let u=Ph(t.value),a=new DataView(new ArrayBuffer(3+u.byteLength));a.setUint8(0,7),a.setUint16(1,u.byteLength,!1);let d=new Uint8Array(a.buffer);return d.set(u,3),d;case"timestamp":let l=new Uint8Array(9);return l[0]=8,l.set(wa.fromNumber(t.value.valueOf()).bytes,1),l;case"uuid":if(!wk.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let h=new Uint8Array(17);return h[0]=9,h.set(yk(t.value.replace(/-/g,"")),1),h}}}var Mh;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(Mh||(Mh={}));var wk=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class wa{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,s=Math.abs(Math.round(t));n>-1&&s>0;n--,s/=256)r[n]=s;if(t<0)Dh(r);return new wa(r)}valueOf(){let t=this.bytes.slice(0),r=t[0]&128;if(r)Dh(t);return parseInt(vt(t),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function Dh(t){for(let r=0;r<8;r++)t[r]^=255;for(let r=7;r>-1;r--)if(t[r]++,t[r]!==0)break}var $h="X-Amz-Algorithm",Bh="X-Amz-Credential",Ea="X-Amz-Date",Hh="X-Amz-SignedHeaders",zh="X-Amz-Expires",ba="X-Amz-Signature",_a="X-Amz-Security-Token",Ek="X-Amz-Region-Set",Aa="authorization",xa=Ea.toLowerCase(),qh="date",Vh=[Aa,xa,qh],jh=ba.toLowerCase(),Es="x-amz-content-sha256",Wh=_a.toLowerCase(),bk="host",Gh={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},Kh=/^proxy-/,Qh=/^sec-/,_k=[/^proxy-/i,/^sec-/i],ms="AWS4-HMAC-SHA256",Ak="AWS4-ECDSA-P256-SHA256",Xh="AWS4-HMAC-SHA256-PAYLOAD",Yh="UNSIGNED-PAYLOAD",Jh=50,Ta="aws4_request",Zh=604800,ep=({query:t={}})=>{let r=[],n={};for(let s in t){if(!cr(t,s))continue;if(s.toLowerCase()===jh)continue;let o=gs(s);r.push(o);let i=t[s];if(typeof i==="string")n[o]=`${o}=${gs(i)}`;else if(Array.isArray(i))n[o]=i.slice(0).reduce((u,a)=>u.concat([`${o}=${gs(a)}`]),[]).sort().join("&")}return r.sort().map((s)=>n[s]).filter((s)=>s).join("&")},xk=(t)=>Tk(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Tk=(t)=>{if(typeof t==="number")return new Date(t*1000);if(typeof t==="string"){if(Number(t))return new Date(Number(t)*1000);return new Date(t)}return t};class Ca{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:o,uriEscapePath:i=!0}){this.service=s,this.sha256=o,this.uriEscapePath=i,this.applyChecksum=typeof t==="boolean"?t:!0,this.regionProvider=kh(n),this.credentialProvider=kh(r)}createCanonicalRequest(t,r,n){let s=Object.keys(r).sort();return`${t.method}
|
|
26
|
-
${this.getCanonicalPath(t)}
|
|
27
|
-
${ep(t)}
|
|
28
|
-
${s.map((o)=>`${o}:${r[o]}`).join(`
|
|
29
|
-
`)}
|
|
30
|
-
|
|
31
|
-
${s.join(";")}
|
|
32
|
-
${n}`}async createStringToSign(t,r,n,s){let o=new this.sha256;o.update(en(n));let i=await o.digest();return`${s}
|
|
33
|
-
${t}
|
|
34
|
-
${r}
|
|
35
|
-
${vt(i)}`}getCanonicalPath({path:t}){if(this.uriEscapePath){let r=[];for(let o of t.split("/")){if(o?.length===0)continue;if(o===".")continue;if(o==="..")r.pop();else r.push(o)}let n=`${t?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&t?.endsWith("/")?"/":""}`;return gs(n).replace(/%2F/g,"/")}return t}validateResolvedCredentials(t){if(typeof t!=="object"||typeof t.accessKeyId!=="string"||typeof t.secretAccessKey!=="string")throw Error("Resolved credential object is not valid")}formatDate(t){let r=xk(t).replace(/[-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(t){return Object.keys(t).sort().join(";")}}var ar={},ys=[],Ss=(t,r,n)=>`${t}/${r}/${n}/${Ta}`,tp=async(t,r,n,s,o)=>{let i=await Fh(t,r.secretAccessKey,r.accessKeyId),u=`${n}:${s}:${o}:${vt(i)}:${r.sessionToken}`;if(u in ar)return ar[u];ys.push(u);while(ys.length>Jh)delete ar[ys.shift()];let a=`AWS4${r.secretAccessKey}`;for(let d of[n,s,o,Ta])a=await Fh(t,a,d);return ar[u]=a},Ck=()=>{ys.length=0,Object.keys(ar).forEach((t)=>{delete ar[t]})},Fh=(t,r,n)=>{let s=new t(r);return s.update(en(n)),s.digest()},ya=({headers:t},r,n)=>{let s={};for(let o of Object.keys(t).sort()){if(t[o]==null)continue;let i=o.toLowerCase();if(i in Gh||r?.has(i)||Kh.test(i)||Qh.test(i)){if(!n||n&&!n.has(i))continue}s[i]=t[o].replace(/[\r\n]/g," ").replace(/[ \t]+/g," ").replace(/^ | $/g,"")}return s},ws=async({headers:t,body:r},n)=>{for(let s in t){if(!cr(t,s))continue;if(s.toLowerCase()===Es)return t[s]}if(r==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof r==="string"||ArrayBuffer.isView(r)||Sk(r)){let s=new n;return s.update(en(r)),vt(await s.digest())}return Yh},rp=(t,r)=>{t=t.toLowerCase();for(let n in r){if(!cr(r,n))continue;if(t===n.toLowerCase())return!0}return!1},np=(t,r={})=>{let{headers:n,query:s={}}=Lh.clone(t);for(let o in n){if(!cr(n,o))continue;let i=o.toLowerCase();if(i.slice(0,6)==="x-amz-"&&!r.unhoistableHeaders?.has(i)||r.hoistableHeaders?.has(i))s[o]=n[o],delete n[o]}return{...t,headers:n,query:s}},Sa=(t)=>{t=Lh.clone(t);for(let r in t.headers){if(!cr(t.headers,r))continue;if(Vh.indexOf(r.toLowerCase())>-1)delete t.headers[r]}return t};class sp extends Ca{headerFormatter=new Uh;constructor({applyChecksum:t,credentials:r,region:n,service:s,sha256:o,uriEscapePath:i=!0}){super({applyChecksum:t,credentials:r,region:n,service:s,sha256:o,uriEscapePath:i})}async presign(t,r={}){let{signingDate:n=new Date,expiresIn:s=3600,unsignableHeaders:o,unhoistableHeaders:i,signableHeaders:u,hoistableHeaders:a,signingRegion:d,signingService:l}=r,h=await this.credentialProvider();this.validateResolvedCredentials(h);let f=d??await this.regionProvider(),{longDate:p,shortDate:g}=this.formatDate(n);if(s>Zh)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let m=Ss(g,f,l??this.service),y=np(Sa(t),{unhoistableHeaders:i,hoistableHeaders:a});if(h.sessionToken)y.query[_a]=h.sessionToken;y.query[$h]=ms,y.query[Bh]=`${h.accessKeyId}/${m}`,y.query[Ea]=p,y.query[zh]=s.toString(10);let S=ya(y,o,u);return y.query[Hh]=this.getCanonicalHeaderList(S),y.query[ba]=await this.getSignature(p,m,this.getSigningKey(h,f,g,l),this.createCanonicalRequest(y,S,await ws(t,this.sha256))),y}async sign(t,r){if(typeof t==="string")return this.signString(t,r);else if(t.headers&&t.payload)return this.signEvent(t,r);else if(t.message)return this.signMessage(t,r);else return this.signRequest(t,r)}async signEvent({headers:t,payload:r},{signingDate:n=new Date,priorSignature:s,signingRegion:o,signingService:i,eventStreamCredentials:u}){let a=o??await this.regionProvider(),{shortDate:d,longDate:l}=this.formatDate(n),h=Ss(d,a,i??this.service),f=await ws({headers:{},body:r},this.sha256),p=new this.sha256;p.update(t);let g=vt(await p.digest()),m=[Xh,l,h,s,g,f].join(`
|
|
36
|
-
`);return this.signString(m,{signingDate:n,signingRegion:a,signingService:i,eventStreamCredentials:u})}async signMessage(t,{signingDate:r=new Date,signingRegion:n,signingService:s,eventStreamCredentials:o}){return this.signEvent({headers:this.headerFormatter.format(t.message.headers),payload:t.message.body},{signingDate:r,signingRegion:n,signingService:s,priorSignature:t.priorSignature,eventStreamCredentials:o}).then((u)=>({message:t.message,signature:u}))}async signString(t,{signingDate:r=new Date,signingRegion:n,signingService:s,eventStreamCredentials:o}={}){let i=o??await this.credentialProvider();this.validateResolvedCredentials(i);let u=n??await this.regionProvider(),{shortDate:a}=this.formatDate(r),d=new this.sha256(await this.getSigningKey(i,u,a,s));return d.update(en(t)),vt(await d.digest())}async signRequest(t,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:s,signingRegion:o,signingService:i}={}){let u=await this.credentialProvider();this.validateResolvedCredentials(u);let a=o??await this.regionProvider(),d=Sa(t),{longDate:l,shortDate:h}=this.formatDate(r),f=Ss(h,a,i??this.service);if(d.headers[xa]=l,u.sessionToken)d.headers[Wh]=u.sessionToken;let p=await ws(d,this.sha256);if(!rp(Es,d.headers)&&this.applyChecksum)d.headers[Es]=p;let g=ya(d,s,n),m=await this.getSignature(l,f,this.getSigningKey(u,a,h,i),this.createCanonicalRequest(d,g,p));return d.headers[Aa]=`${ms} Credential=${u.accessKeyId}/${f}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${m}`,d}async getSignature(t,r,n,s){let o=await this.createStringToSign(t,r,s,ms),i=new this.sha256(await n);return i.update(en(o)),vt(await i.digest())}getSigningKey(t,r,n,s){return tp(this.sha256,t,n,r,s||this.service)}}var Ik={SignatureV4a:null};Rk.ALGORITHM_IDENTIFIER=ms;Rk.ALGORITHM_IDENTIFIER_V4A=Ak;Rk.ALGORITHM_QUERY_PARAM=$h;Rk.ALWAYS_UNSIGNABLE_HEADERS=Gh;Rk.AMZ_DATE_HEADER=xa;Rk.AMZ_DATE_QUERY_PARAM=Ea;Rk.AUTH_HEADER=Aa;Rk.CREDENTIAL_QUERY_PARAM=Bh;Rk.DATE_HEADER=qh;Rk.EVENT_ALGORITHM_IDENTIFIER=Xh;Rk.EXPIRES_QUERY_PARAM=zh;Rk.GENERATED_HEADERS=Vh;Rk.HOST_HEADER=bk;Rk.KEY_TYPE_IDENTIFIER=Ta;Rk.MAX_CACHE_SIZE=Jh;Rk.MAX_PRESIGNED_TTL=Zh;Rk.PROXY_HEADER_PATTERN=Kh;Rk.REGION_SET_PARAM=Ek;Rk.SEC_HEADER_PATTERN=Qh;Rk.SHA256_HEADER=Es;Rk.SIGNATURE_HEADER=jh;Rk.SIGNATURE_QUERY_PARAM=ba;Rk.SIGNED_HEADERS_QUERY_PARAM=Hh;Rk.SignatureV4=sp;Rk.SignatureV4Base=Ca;Rk.TOKEN_HEADER=Wh;Rk.TOKEN_QUERY_PARAM=_a;Rk.UNSIGNABLE_PATTERNS=_k;Rk.UNSIGNED_PAYLOAD=Yh;Rk.clearCredentialCache=Ck;Rk.createScope=Ss;Rk.getCanonicalHeaders=ya;Rk.getCanonicalQuery=ep;Rk.getPayloadHash=ws;Rk.getSigningKey=tp;Rk.hasHeader=rp;Rk.moveHeadersToQuery=np;Rk.prepareRequest=Sa;Rk.signatureV4aContainer=Ik});var $e=e(function(O1){var{ProviderError:op,booleanSelector:ip,SelectorType:ap,loadConfig:p1}=V(),{setCredentialFeature:g1}=Ce(),{normalizeProvider:ur,memoizeIdentityProvider:m1,isIdentityExpired:y1,doesIdentityRequireRefresh:S1}=Xe(),{SignatureV4:cp}=Ia(),{HttpResponse:gp,HttpRequest:mp}=K(),up=(t)=>gp.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,dp=(t)=>gp.isInstance(t)?t.headers?.age??t.headers?.Age:void 0,yp=(t)=>new Date(Date.now()+t),lp=(t,r,n,s)=>{if(s!==void 0)return r;let o=Date.parse(t),i=Date.now();if(n!==void 0&&i-n>900000)return r;return n!==void 0?o-(n+i)/2:o-i},tn=(t,r)=>{if(!r)throw Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return r},Ra=async(t)=>{let r=tn("context",t.context),n=tn("config",t.config),s=r.endpointV2?.properties?.authSchemes?.[0],i=await tn("signer",n.signer)(s),u=t?.signingRegion,a=t?.signingRegionSet,d=t?.signingName;return{config:n,signer:i,signingRegion:u,signingRegionSet:a,signingName:d}};class bs{async sign(t,r,n){if(!mp.isInstance(t))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let s=await Ra(n),{config:o,signer:i}=s,{signingRegion:u,signingName:a}=s,d=n.context;if(d?.authSchemes?.length??!1){let[f,p]=d.authSchemes;if(f?.name==="sigv4a"&&p?.name==="sigv4")u=p?.signingRegion??u,a=p?.signingName??a}let l=await o.disableClockSkewCorrection?.()===!0;if(n._disableClockSkewCorrection=l,!l)n._preRequestSystemClockOffset=o.systemClockOffset,n._requestSentAt=Date.now();return await i.sign(t,{signingDate:l?new Date:yp(o.systemClockOffset),signingRegion:u,signingService:a})}errorHandler(t){return(r)=>{let n=r;if(!t._disableClockSkewCorrection){let s=n.ServerTime??up(n.$response);if(s){let o=tn("config",t.config),{_preRequestSystemClockOffset:i,_requestSentAt:u}=t,a=dp(n.$response),d=lp(s,o.systemClockOffset,u,a);if(o.systemClockOffset=d,Math.abs(d)>=240000&&(d!==i||i!==void 0&&i!==d)&&n.$metadata)n.$metadata.clockSkewCorrected=!0}}throw r}}successHandler(t,r){if(r._disableClockSkewCorrection)return;let n=up(t);if(n){let s=tn("config",r.config),o=r._requestSentAt,i=dp(t);s.systemClockOffset=lp(n,s.systemClockOffset,o,i)}}}var w1=bs;class Sp extends bs{async sign(t,r,n){if(!mp.isInstance(t))throw Error("The request is not an instance of `HttpRequest` and cannot be signed");let{config:s,signer:o,signingRegion:i,signingRegionSet:u,signingName:a}=await Ra(n),l=(await s.sigv4aSigningRegionSet?.()??u??[i]).join(","),h=await s.disableClockSkewCorrection?.()===!0;if(n._disableClockSkewCorrection=h,!h)n._preRequestSystemClockOffset=s.systemClockOffset,n._requestSentAt=Date.now();return await o.sign(t,{signingDate:h?new Date:yp(s.systemClockOffset),signingRegion:l,signingService:a})}}var fp=(t)=>typeof t==="string"&&t.length>0?t.split(",").map((r)=>r.trim()):[],wp=(t)=>`AWS_BEARER_TOKEN_${t.replace(/[\s-]/g,"_").toUpperCase()}`,hp="AWS_AUTH_SCHEME_PREFERENCE",pp="auth_scheme_preference",E1={environmentVariableSelector:(t,r)=>{if(r?.signingName){if(wp(r.signingName)in t)return["httpBearerAuth"]}if(!(hp in t))return;return fp(t[hp])},configFileSelector:(t)=>{if(!(pp in t))return;return fp(t[pp])},default:[]},b1=(t)=>(t.sigv4aSigningRegionSet=ur(t.sigv4aSigningRegionSet),t),_1={environmentVariableSelector(t){if(t.AWS_SIGV4A_SIGNING_REGION_SET)return t.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((r)=>r.trim());throw new op("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(t){if(t.sigv4a_signing_region_set)return(t.sigv4a_signing_region_set??"").split(",").map((r)=>r.trim());throw new op("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},A1=(t)=>(r)=>{let n=r.credentials,s=!!r.credentials,o=void 0;Object.defineProperty(r,"credentials",{set(h){if(h&&h!==n&&h!==o)s=!0;n=h;let f=x1(r,{credentials:n,credentialDefaultProvider:r.credentialDefaultProvider}),p=T1(r,f);if(s&&!p.attributed){let g=typeof n==="object"&&n!==null;o=async(m)=>{let S=await p(m);if(g&&(!S.$source||Object.keys(S.$source).length===0))return g1(S,"CREDENTIALS_CODE","e");return S},o.memoized=p.memoized,o.configBound=p.configBound,o.attributed=!0}else o=p},get(){return o},enumerable:!0,configurable:!0}),r.credentials=n;let{signingEscapePath:i=!0,systemClockOffset:u=r.systemClockOffset||0,sha256:a}=r,d;if(r.signer)d=ur(r.signer);else if(r.regionInfoProvider)d=()=>ur(r.region)().then(async(h)=>[await r.regionInfoProvider(h,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},h]).then(([h,f])=>{let{signingRegion:p,signingService:g}=h;r.signingRegion=r.signingRegion||p||f,r.signingName=r.signingName||g||r.serviceId;let m={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:a,uriEscapePath:i};return new(r.signerConstructor||cp)(m)});else d=async(h)=>{h=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await ur(r.region)(),properties:{}},h);let f=h.signingRegion,p=h.signingName;r.signingRegion=r.signingRegion||f,r.signingName=r.signingName||p||r.serviceId;let g={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:a,uriEscapePath:i};return new(r.signerConstructor||cp)(g)};return Object.assign(r,{systemClockOffset:u,signingEscapePath:i,signer:d,disableClockSkewCorrection:ur(r.disableClockSkewCorrection??t)})};function x1(t,{credentials:r,credentialDefaultProvider:n}){let s;if(r)if(!r?.memoized)s=m1(r,y1,S1);else s=r;else if(n)s=ur(n(Object.assign({},t,{parentClientConfig:t})));else s=async()=>{throw Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")};return s.memoized=!0,s}function T1(t,r){if(r.configBound)return r;let n=async(s)=>r({...s,callerClientConfig:t});return n.memoized=r.memoized,n.configBound=!0,n}var C1="AWS_DISABLE_CLOCK_SKEW_CORRECTION",I1="disable_clock_skew_correction",R1={environmentVariableSelector:(t)=>ip(t,C1,ap.ENV),configFileSelector:(t)=>ip(t,I1,ap.CONFIG),default:!1},v1=p1(R1),Ep=A1(v1),N1=Ep;O1.AWSSDKSigV4Signer=w1;O1.AwsSdkSigV4ASigner=Sp;O1.AwsSdkSigV4Signer=bs;O1.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS=E1;O1.NODE_SIGV4A_CONFIG_OPTIONS=_1;O1.getBearerTokenEnvKey=wp;O1.resolveAWSSDKSigV4Config=N1;O1.resolveAwsSdkSigV4AConfig=b1;O1.resolveAwsSdkSigV4Config=Ep;O1.validateSigningProperties=Ra});var va=e(function(j1){var{setCredentialFeature:z1}=Ce(),{CredentialsProviderError:q1}=V(),V1=(t)=>async()=>{t?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");let r=process.env.AWS_ACCESS_KEY_ID,n=process.env.AWS_SECRET_ACCESS_KEY,s=process.env.AWS_SESSION_TOKEN,o=process.env.AWS_CREDENTIAL_EXPIRATION,i=process.env.AWS_CREDENTIAL_SCOPE,u=process.env.AWS_ACCOUNT_ID;if(r&&n){let a={accessKeyId:r,secretAccessKey:n,...s&&{sessionToken:s},...o&&{expiration:new Date(o)},...i&&{credentialScope:i},...u&&{accountId:u}};return z1(a,"CREDENTIALS_ENV_VARS","g"),a}throw new q1("Unable to find environment variable credentials.",{logger:t?.logger})};j1.ENV_ACCOUNT_ID="AWS_ACCOUNT_ID";j1.ENV_CREDENTIAL_SCOPE="AWS_CREDENTIAL_SCOPE";j1.ENV_EXPIRATION="AWS_CREDENTIAL_EXPIRATION";j1.ENV_KEY="AWS_ACCESS_KEY_ID";j1.ENV_SECRET="AWS_SECRET_ACCESS_KEY";j1.ENV_SESSION="AWS_SESSION_TOKEN";j1.fromEnv=V1});var As=e(function(xM){var{ProviderError:Na,CredentialsProviderError:at,loadConfig:Ma}=V(),xp=c("node:http"),{parseUrl:Z1}=K(),Tp=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.AccessKeyId==="string"&&typeof t.SecretAccessKey==="string"&&typeof t.Token==="string"&&typeof t.Expiration==="string",Cp=(t)=>({accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:new Date(t.Expiration),...t.AccountId&&{accountId:t.AccountId}}),Da=({maxRetries:t=0,timeout:r=1000})=>({maxRetries:t,timeout:r});function sn(t){return new Promise((r,n)=>{let s=xp.request({method:"GET",...t,hostname:t.hostname?.replace(/^\[(.+)\]$/,"$1")});s.on("error",(o)=>{n(Object.assign(new Na("Unable to connect to instance metadata service"),o)),s.destroy()}),s.on("timeout",()=>{n(new Na("TimeoutError from instance metadata service")),s.destroy()}),s.on("response",(o)=>{let{statusCode:i=400}=o;if(i<200||300<=i)n(Object.assign(new Na("Error response received from instance metadata service"),{statusCode:i})),s.destroy();let u=[];o.on("data",(a)=>{u.push(a)}),o.on("end",()=>{r(Buffer.concat(u)),s.destroy()})}),s.end()})}var Pa=(t,r)=>{let n=t();for(let s=0;s<r;s++)n=n.catch(t);return n},rn="AWS_CONTAINER_CREDENTIALS_FULL_URI",_s="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",ka="AWS_CONTAINER_AUTHORIZATION_TOKEN",eM=(t={})=>{let{timeout:r,maxRetries:n}=Da(t);return()=>Pa(async()=>{let s=await oM({logger:t.logger}),o=JSON.parse(await tM(r,s));if(!Tp(o))throw new at("Invalid response received from instance metadata service.",{logger:t.logger});return Cp(o)},n)},tM=async(t,r)=>{if(process.env[ka])r.headers={...r.headers,Authorization:process.env[ka]};return(await sn({...r,timeout:t})).toString()},rM="169.254.170.2",nM=new Set(["localhost","127.0.0.1"]),sM=new Set(["http:","https:"]),oM=async({logger:t})=>{if(process.env[_s])return{hostname:rM,path:process.env[_s]};if(process.env[rn]){let r;try{r=new URL(process.env[rn])}catch{throw new at(`${process.env[rn]} is not a valid container metadata service URL`,{tryNextLink:!1,logger:t})}if(!r.hostname||!nM.has(r.hostname))throw new at(`${r.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:t});if(!r.protocol||!sM.has(r.protocol))throw new at(`${r.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:t});return{protocol:r.protocol,hostname:r.hostname,path:r.pathname+r.search,port:r.port?parseInt(r.port,10):void 0}}throw new at(`The container metadata credential provider cannot be used unless the ${_s} or ${rn} environment variable is set`,{tryNextLink:!1,logger:t})};class Fa extends at{tryNextLink;name="InstanceMetadataV1FallbackError";constructor(t,r=!0){super(t,r);this.tryNextLink=r,Object.setPrototypeOf(this,Fa.prototype)}}var nn;(function(t){t.IPv4="http://169.254.169.254",t.IPv6="http://[fd00:ec2::254]"})(nn||(nn={}));var iM="AWS_EC2_METADATA_SERVICE_ENDPOINT",aM="ec2_metadata_service_endpoint",cM={environmentVariableSelector:(t)=>t[iM],configFileSelector:(t)=>t[aM],default:void 0},dr;(function(t){t.IPv4="IPv4",t.IPv6="IPv6"})(dr||(dr={}));var uM="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",dM="ec2_metadata_service_endpoint_mode",lM={environmentVariableSelector:(t)=>t[uM],configFileSelector:(t)=>t[dM],default:dr.IPv4},Ip=async()=>Z1(await fM()||await hM()),fM=async()=>Ma(cM)(),hM=async()=>{let t=await Ma(lM)();switch(t){case dr.IPv4:return nn.IPv4;case dr.IPv6:return nn.IPv6;default:throw Error(`Unsupported endpoint mode: ${t}. Select from ${Object.values(dr)}`)}},pM=300,gM=300,mM="https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html",bp=(t,r)=>{let n=pM+Math.floor(Math.random()*gM),s=new Date(Date.now()+n*1000);r.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(s)}.
|
|
37
|
-
For more information, please visit: `+mM);let o=t.originalExpiration??t.expiration;return{...t,...o?{originalExpiration:o}:{},expiration:s}},yM=(t,r={})=>{let n=r?.logger||console,s;return async()=>{let o;try{if(o=await t(),o.expiration&&o.expiration.getTime()<Date.now())o=bp(o,n)}catch(i){if(s)n.warn("Credential renew failed: ",i),o=bp(s,n);else throw i}return s=o,o}},Rp="/latest/meta-data/iam/security-credentials/",SM="/latest/api/token",Oa="AWS_EC2_METADATA_V1_DISABLED",_p="ec2_metadata_v1_disabled",Ap="x-aws-ec2-metadata-token",wM=(t={})=>yM(EM(t),{logger:t.logger}),EM=(t={})=>{let r=!1,{logger:n,profile:s}=t,{timeout:o,maxRetries:i}=Da(t),u=async(a,d)=>{if(r||d.headers?.[Ap]==null){let f=!1,p=!1,g=await Ma({environmentVariableSelector:(m)=>{let y=m[Oa];if(p=!!y&&y!=="false",y===void 0)throw new at(`${Oa} not set in env, checking config file next.`,{logger:t.logger});return p},configFileSelector:(m)=>{let y=m[_p];return f=!!y&&y!=="false",f},default:!1},{profile:s})();if(t.ec2MetadataV1Disabled||g){let m=[];if(t.ec2MetadataV1Disabled)m.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(f)m.push(`config file profile (${_p})`);if(p)m.push(`process environment variable (${Oa})`);throw new Fa(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${m.join(", ")}].`)}}let h=(await Pa(async()=>{let f;try{f=await _M(d)}catch(p){if(p.statusCode===401)r=!1;throw p}return f},a)).trim();return Pa(async()=>{let f;try{f=await AM(h,d,t)}catch(p){if(p.statusCode===401)r=!1;throw p}return f},a)};return async()=>{let a=await Ip();if(r)return n?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),u(i,{...a,timeout:o});else{let d;try{d=(await bM({...a,timeout:o})).toString()}catch(l){if(l?.statusCode===400)throw Object.assign(l,{message:"EC2 Metadata token request returned error"});else if(l.message==="TimeoutError"||[403,404,405].includes(l.statusCode))r=!0;return n?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),u(i,{...a,timeout:o})}return u(i,{...a,headers:{[Ap]:d},timeout:o})}}},bM=async(t)=>sn({...t,path:SM,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),_M=async(t)=>(await sn({...t,path:Rp})).toString(),AM=async(t,r,n)=>{let s=JSON.parse((await sn({...r,path:Rp+t})).toString());if(!Tp(s))throw new at("Invalid response received from instance metadata service.",{logger:n.logger});return Cp(s)};xM.DEFAULT_MAX_RETRIES=0;xM.DEFAULT_TIMEOUT=1000;xM.ENV_CMDS_AUTH_TOKEN=ka;xM.ENV_CMDS_FULL_URI=rn;xM.ENV_CMDS_RELATIVE_URI=_s;xM.Endpoint=nn;xM.fromContainerMetadata=eM;xM.fromInstanceMetadata=wM;xM.getInstanceMetadataEndpoint=Ip;xM.httpRequest=sn;xM.providerConfigFromInit=Da});var lA=e(function(GM){var{hasOwn:Mp}=X(),{streamCollector:FM}=X();GM.streamCollector=FM;var{buildQueryString:Dp,HttpResponse:Fp}=K(),ct=c("node:https"),{Readable:LM}=c("node:stream"),on=c("node:http2");function Ts(t){let r=t&&typeof t==="object"&&"reason"in t?t.reason:void 0;if(r){if(r instanceof Error){let o=Error("Request aborted");return o.name="AbortError",o.cause=r,o}let s=Error(String(r));return s.name="AbortError",s}let n=Error("Request aborted");return n.name="AbortError",n}var UM=["ECONNRESET","EPIPE","ETIMEDOUT"],Lp=(t)=>{let r={};for(let n in t){if(!Mp(t,n))continue;let s=t[n];r[n]=Array.isArray(s)?s.join(","):s}return r},te={setTimeout:(t,r)=>setTimeout(t,r),clearTimeout:(t)=>clearTimeout(t)},vp=1000,$M=(t,r,n=0)=>{if(!n)return-1;let s=(o)=>{let i=te.setTimeout(()=>{t.destroy(),r(Object.assign(Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${n} ms.`),{name:"TimeoutError"}))},n-o),u=(a)=>{if(a?.connecting)a.on("connect",()=>{te.clearTimeout(i)});else te.clearTimeout(i)};if(t.socket)u(t.socket);else t.on("socket",u)};if(n<2000)return s(0),0;return te.setTimeout(s.bind(null,vp),vp)},BM=(t,r,n=0,s,o)=>{if(n)return te.setTimeout(()=>{let i=`@smithy/node-http-handler - [${s?"ERROR":"WARN"}] a request has exceeded the configured ${n} ms requestTimeout.`;if(s){let u=Object.assign(Error(i),{name:"TimeoutError",code:"ETIMEDOUT"});t.destroy(u),r(u)}else i+=" Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.",o?.warn?.(i)},n);return-1},HM=3000,zM=(t,{keepAlive:r,keepAliveMsecs:n},s=HM)=>{if(r!==!0)return-1;let o=()=>{if(t.socket)t.socket.setKeepAlive(r,n||0);else t.on("socket",(i)=>{i.setKeepAlive(r,n||0)})};if(s===0)return o(),0;return te.setTimeout(o,s)},Np=3000,qM=(t,r,n=0)=>{let s=(o)=>{let i=n-o,u=()=>{t.destroy(),r(Object.assign(Error(`@smithy/node-http-handler - the request socket timed out after ${n} ms of inactivity (configured by client requestHandler).`),{name:"TimeoutError"}))};if(t.socket)t.socket.setTimeout(i,u),t.on("close",()=>t.socket?.removeListener("timeout",u));else t.setTimeout(i,u)};if(0<n&&n<6000)return s(0),0;return te.setTimeout(s.bind(null,n===0?0:Np),Np)},Op=6000;async function Up(t,r,n=Op,s=!1){let o=r.headers,i=o?o.Expect||o.expect:void 0,u=-1,a=!0;if(!s&&i==="100-continue")a=await Promise.race([new Promise((d)=>{u=Number(te.setTimeout(()=>d(!0),Math.max(Op,n)))}),new Promise((d)=>{t.on("continue",()=>{te.clearTimeout(u),d(!0)}),t.on("response",()=>{te.clearTimeout(u),d(!1)}),t.on("error",()=>{te.clearTimeout(u),d(!1)})})]);if(a)VM(t,r.body)}function VM(t,r){if(r instanceof LM){r.pipe(t);return}if(r){let n=Buffer.isBuffer(r);if(n||typeof r==="string"){if(n&&r.byteLength===0)t.end();else t.end(r);return}let o=r;if(typeof o==="object"&&o.buffer&&typeof o.byteOffset==="number"&&typeof o.byteLength==="number"){t.end(Buffer.from(o.buffer,o.byteOffset,o.byteLength));return}t.end(Buffer.from(r));return}t.end()}var jM=0,xs=void 0,Pp=void 0;class Cs{config;configProvider;socketWarningTimestamp=0;externalAgent=!1;metadata={handlerProtocol:"http/1.1"};static create(t){if(typeof t?.handle==="function")return t;return new Cs(t)}static checkSocketUsage(t,r,n=console){let{sockets:s,requests:o,maxSockets:i}=t;if(typeof i!=="number"||i===1/0)return r;let u=15000;if(Date.now()-u<r)return r;if(s&&o)for(let a in s){if(!Mp(s,a))continue;let d=s[a]?.length??0,l=o[a]?.length??0;if(d>=i&&l>=2*i)return n?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${d} and ${l} additional requests are enqueued.
|
|
38
|
-
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
39
|
-
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return r}constructor(t){this.configProvider=new Promise((r,n)=>{if(typeof t==="function")t().then((s)=>{r(this.resolveDefaultConfig(s))}).catch(n);else r(this.resolveDefaultConfig(t))})}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(t,{abortSignal:r,requestTimeout:n}={}){if(!this.config)this.config=await this.configProvider;let s=this.config,o=s.logger,i=t.protocol==="https:";if(!i&&!this.config.httpAgent)this.config.httpAgent=await this.config.httpAgentProvider();return new Promise((u,a)=>{let d=void 0,l=-1,h=-1,f=-1,p=-1,g=-1,m=()=>{te.clearTimeout(l),te.clearTimeout(h),te.clearTimeout(f),te.clearTimeout(p),te.clearTimeout(g)},y=async(C)=>{await d,m(),u(C)},S=async(C)=>{await d,m(),a(C)};if(r?.aborted){let C=Ts(r);S(C);return}let w=t.headers,E=w?(w.Expect??w.expect)==="100-continue":!1,A=i?s.httpsAgent:s.httpAgent;if(E&&!this.externalAgent)A=new(i?ct.Agent:xs)({keepAlive:!1,maxSockets:1/0});l=te.setTimeout(()=>{this.socketWarningTimestamp=Cs.checkSocketUsage(A,this.socketWarningTimestamp,o)},s.socketAcquisitionWarningTimeout??(s.requestTimeout??2000)+(s.connectionTimeout??1000));let v=t.query?Dp(t.query):"",L=void 0;if(t.username!=null||t.password!=null){let C=t.username??"",G=t.password??"";L=`${C}:${G}`}let k=t.path;if(v)k+=`?${v}`;if(t.fragment)k+=`#${t.fragment}`;let U=t.hostname??"";if(U[0]==="["&&U.endsWith("]"))U=t.hostname.slice(1,-1);else U=t.hostname;let de={headers:t.headers,host:U,method:t.method,path:k,port:t.port,agent:A,auth:L},W=(i?ct.request:Pp)(de,(C)=>{let G=new Fp({statusCode:C.statusCode||-1,reason:C.statusMessage,headers:Lp(C.headers),body:C});y({response:G})});if(W.on("error",(C)=>{if(UM.includes(C.code))S(Object.assign(C,{name:"TimeoutError"}));else S(C)}),r){let C=()=>{W.destroy();let G=Ts(r);S(G)};if(typeof r.addEventListener==="function"){let G=r;G.addEventListener("abort",C,{once:!0}),W.once("close",()=>G.removeEventListener("abort",C))}else r.onabort=C}let ke=n??s.requestTimeout;h=$M(W,S,s.connectionTimeout),f=BM(W,S,ke,s.throwOnRequestTimeout,o??console),p=qM(W,S,s.socketTimeout);let D=de.agent;if(typeof D==="object"&&"keepAlive"in D)g=zM(W,{keepAlive:D.keepAlive,keepAliveMsecs:D.keepAliveMsecs});d=Up(W,t,ke,this.externalAgent).catch((C)=>(m(),a(C)))})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then((n)=>{if(t===Symbol.for("logger"))return{...n,logger:n.logger??r};return{...n,[t]:r}})}httpHandlerConfigs(){return this.config??{}}resolveDefaultConfig(t){let{requestTimeout:r,connectionTimeout:n,socketTimeout:s,socketAcquisitionWarningTimeout:o,httpAgent:i,httpsAgent:u,throwOnRequestTimeout:a,logger:d}=t||{},l=!0,h=50;return{connectionTimeout:n,requestTimeout:r,socketTimeout:s,socketAcquisitionWarningTimeout:o,throwOnRequestTimeout:a,httpAgentProvider:async()=>{let f=c("node:http"),{Agent:p,request:g}=f.default??f;if(Pp=g,xs=p,i instanceof xs||typeof i?.destroy==="function")return this.externalAgent=!0,i;return new xs({keepAlive:!0,maxSockets:50,...i})},httpsAgent:(()=>{if(u instanceof ct.Agent||typeof u?.destroy==="function")return this.externalAgent=!0,u;return new ct.Agent({keepAlive:!0,maxSockets:50,...u})})(),logger:d}}}var WM=new Uint16Array(1);class Is{id=WM[0]++;total=0;max=0;session;refs=0;constructor(t){t.unref(),this.session=t}retain(){if(this.session.destroyed)throw Error("@smithy/node-http-handler - cannot acquire reference to destroyed session.");this.refs+=1,this.total+=1,this.max=Math.max(this.refs,this.max),this.session.ref()}free(){if(this.session.destroyed)return;if(this.refs-=1,this.refs===0)this.session.unref();if(this.refs<0)throw Error("@smithy/node-http-handler - ClientHttp2Session refcount at zero, cannot decrement.")}deref(){return this.session}close(){if(!this.session.closed)this.session.close()}destroy(){if(this.refs=0,!this.session.destroyed)this.session.setTimeout(0),this.session.destroy()}useCount(){return this.refs}}class $p{sessions=[];maxConcurrency=0;constructor(t){this.sessions=(t??[]).map((r)=>new Is(r))}poll(){let t=!1;for(let r of this.sessions){if(r.deref().destroyed){t=!0;continue}if(!this.maxConcurrency||r.useCount()<this.maxConcurrency)return r}if(t){for(let r of this.sessions)if(r.deref().destroyed)this.remove(r)}}offerLast(t){this.sessions.push(t)}remove(t){let r=this.sessions.indexOf(t);if(r>-1)this.sessions.splice(r,1)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}setMaxConcurrency(t){this.maxConcurrency=t}destroy(t){this.remove(t),t.destroy()}}class Bp{config;connectOptions;connectionPools=new Map;constructor(t){if(this.config=t,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw RangeError("maxConcurrency must be greater than zero.")}lease(t,r){let n=this.getUrlString(t),s=this.getPool(n);if(!this.config.disableConcurrency&&!r.isEventStream){let d=s.poll();if(d)return d.retain(),d}let o=new Is(this.connect(n)),i=o.deref();if(this.config.maxConcurrency)i.settings({maxConcurrentStreams:this.config.maxConcurrency},(d)=>{if(d)throw Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+t.destination.toString())});let u=()=>{this.removeFromPoolAndClose(n,o)},a=()=>{this.removeFromPoolAndCheckedDestroy(n,o)};if(i.on("goaway",u),i.on("error",a),i.on("frameError",a),i.on("close",a),r.requestTimeout)i.setTimeout(r.requestTimeout,a);return s.offerLast(o),o.retain(),o}release(t,r){r.free()}createIsolatedSession(t,r){let n=this.getUrlString(t),s=new Is(this.connect(n)),o=s.deref();o.settings({maxConcurrentStreams:1});let i=()=>{s.destroy()};o.on("error",i),o.on("frameError",i),o.on("close",i);let u=r.requestTimeout??300000;return o.setTimeout(u,i),s.retain(),s}destroy(){for(let[t,r]of this.connectionPools){for(let n of[...r])n.destroy();this.connectionPools.delete(t)}}setMaxConcurrentStreams(t){if(t&&t<=0)throw RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=t;for(let r of this.connectionPools.values())r.setMaxConcurrency(t)}setDisableConcurrentStreams(t){this.config.disableConcurrency=t}setNodeHttp2ConnectOptions(t){this.connectOptions=t}debug(){let t={};for(let[r,n]of this.connectionPools){let s=[];for(let o of n)s.push({id:o.id,active:o.useCount(),maxConcurrent:o.max,totalRequests:o.total});t[r]={sessions:s}}return t}removeFromPoolAndClose(t,r){this.connectionPools.get(t)?.remove(r),r.close()}removeFromPoolAndCheckedDestroy(t,r){this.connectionPools.get(t)?.remove(r),r.destroy()}getPool(t){if(!this.connectionPools.has(t)){let r=new $p;if(this.config.maxConcurrency)r.setMaxConcurrency(this.config.maxConcurrency);this.connectionPools.set(t,r)}return this.connectionPools.get(t)}getUrlString(t){return t.destination.toString()}connect(t){return this.connectOptions===void 0?on.connect(t):on.connect(t,this.connectOptions)}}var{constants:kp}=on;class La{config;configProvider;metadata={handlerProtocol:"h2"};connectionManager=new Bp({});static create(t){if(typeof t?.handle==="function")return t;return new La(t)}constructor(t){this.configProvider=new Promise((r,n)=>{if(typeof t==="function")t().then((s)=>{r(s||{})}).catch(n);else r(t||{})})}destroy(){this.connectionManager.destroy()}async handle(t,{abortSignal:r,requestTimeout:n,isEventStream:s}={}){if(!this.config){this.config=await this.configProvider;let{disableConcurrentStreams:d,maxConcurrentStreams:l,nodeHttp2ConnectOptions:h}=this.config;if(this.connectionManager.setDisableConcurrentStreams(d??!1),l)this.connectionManager.setMaxConcurrentStreams(l);if(h)this.connectionManager.setNodeHttp2ConnectOptions(h)}let{requestTimeout:o,disableConcurrentStreams:i}=this.config,u=i||s,a=n??o;return new Promise((d,l)=>{let h=!1,f=void 0,p=async(C)=>{await f,d(C)},g=async(C)=>{await f,l(C)};if(r?.aborted){h=!0;let C=Ts(r);g(C);return}let{hostname:m,method:y,port:S,protocol:w,query:E}=t,A="";if(t.username!=null||t.password!=null){let C=t.username??"",G=t.password??"";A=`${C}:${G}@`}let v=`${w}//${A}${m}${S?`:${S}`:""}`,L={destination:new URL(v)},k={requestTimeout:this.config?.sessionTimeout,isEventStream:s},U=u?this.connectionManager.createIsolatedSession(L,k):this.connectionManager.lease(L,k),de=U.deref(),q=(C)=>{if(u)U.destroy();h=!0,g(C)},W=E?Dp(E):"",ke=t.path;if(W)ke+=`?${W}`;if(t.fragment)ke+=`#${t.fragment}`;let D=de.request({...t.headers,[kp.HTTP2_HEADER_PATH]:ke,[kp.HTTP2_HEADER_METHOD]:y});if(a)D.setTimeout(a,()=>{D.close();let C=Error(`Stream timed out because of no activity for ${a} ms`);C.name="TimeoutError",q(C)});if(r){let C=()=>{D.close();let G=Ts(r);q(G)};if(typeof r.addEventListener==="function"){let G=r;G.addEventListener("abort",C,{once:!0}),D.once("close",()=>G.removeEventListener("abort",C))}else r.onabort=C}D.on("frameError",(C,G,mw)=>{q(Error(`Frame type id ${C} in stream id ${mw} has failed with code ${G}.`))}),D.on("error",q),D.on("aborted",()=>{q(Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${D.rstCode}.`))}),D.on("response",(C)=>{let G=new Fp({statusCode:C[":status"]??-1,headers:Lp(C),body:D});if(h=!0,p({response:G}),u)de.close(),D.on("end",()=>{U.destroy()})}),D.on("close",()=>{if(u)U.destroy();else this.connectionManager.release(L,U);if(!h){let C=Error("Unexpected error: http2 request did not get a response");if(de.destroyed)C.name="TimeoutError";q(C)}}),f=Up(D,t,a)})}updateHttpClientConfig(t,r){this.config=void 0,this.configProvider=this.configProvider.then((n)=>({...n,[t]:r}))}httpHandlerConfigs(){return this.config??{}}}GM.DEFAULT_REQUEST_TIMEOUT=jM;GM.NodeHttp2Handler=La;GM.NodeHttpHandler=Cs});var Ua=e(function(hD){var{setCredentialFeature:JM}=Ce(),{CredentialsProviderError:Nt}=V(),{NodeHttpHandler:ZM}=lA(),zp=c("node:fs/promises"),{HttpRequest:eD}=K(),{sdkStreamMixin:tD,parseRfc3339DateTime:rD}=X(),nD=(t,r)=>{if(t.protocol==="https:")return;if(t.hostname==="169.254.170.2"||t.hostname==="169.254.170.23"||t.hostname==="[fd00:ec2::23]")return;if(t.hostname.includes("[")){if(t.hostname==="[::1]"||t.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(t.hostname==="localhost")return;let n=t.hostname.split("."),s=(o)=>{let i=parseInt(o,10);return 0<=i&&i<=255};if(n[0]==="127"&&s(n[1])&&s(n[2])&&s(n[3])&&n.length===4)return}throw new Nt(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
40
|
-
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
41
|
-
- ECS container host 169.254.170.2
|
|
42
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:r})};function sD(t){return new eD({protocol:t.protocol,hostname:t.hostname,port:Number(t.port),path:t.pathname,query:Array.from(t.searchParams.entries()).reduce((r,[n,s])=>(r[n]=s,r),{}),fragment:t.hash})}async function oD(t,r){let s=await tD(t.body).transformToString();if(t.statusCode===200){let o=JSON.parse(s);if(typeof o.AccessKeyId!=="string"||typeof o.SecretAccessKey!=="string"||typeof o.Token!=="string"||typeof o.Expiration!=="string")throw new Nt("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:r});return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.Token,expiration:rD(o.Expiration)}}if(t.statusCode>=400&&t.statusCode<500){let o={};try{o=JSON.parse(s)}catch(i){}throw Object.assign(new Nt(`Server responded with status: ${t.statusCode}`,{logger:r}),{Code:o.Code,Message:o.Message})}throw new Nt(`Server responded with status: ${t.statusCode}`,{logger:r})}var iD=(t,r,n)=>async()=>{for(let s=0;s<r;++s)try{return await t()}catch(o){await new Promise((i)=>setTimeout(i,n))}return await t()},aD="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",cD="http://169.254.170.2",uD="AWS_CONTAINER_CREDENTIALS_FULL_URI",dD="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",lD="AWS_CONTAINER_AUTHORIZATION_TOKEN",fD=(t={})=>{t.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let r,n=t.awsContainerCredentialsRelativeUri??process.env[aD],s=t.awsContainerCredentialsFullUri??process.env[uD],o=t.awsContainerAuthorizationToken??process.env[lD],i=t.awsContainerAuthorizationTokenFile??process.env[dD],u=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?.warn?console.warn:t.logger.warn.bind(t.logger);if(n&&s)u("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),u("awsContainerCredentialsRelativeUri will take precedence.");if(o&&i)u("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),u("awsContainerAuthorizationTokenFile will take precedence.");if(n)r=`${cD}${n}`;else if(s)r=s;else throw new Nt(`No HTTP credential provider host provided.
|
|
43
|
-
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:t.logger});let a=new URL(r);nD(a,t.logger);let d=ZM.create({connectionTimeout:t.timeout??1000}),l=t.timeout??1000,h=iD(async()=>{let f=sD(a);if(i)f.headers.Authorization=Hp((await zp.readFile(i)).toString());else if(o)f.headers.Authorization=Hp(o);try{let p=await d.handle(f,{requestTimeout:l});return oD(p.response).then((g)=>JM(g,"CREDENTIALS_HTTP","z"))}catch(p){throw new Nt(String(p),{logger:t.logger})}},t.maxRetries??3,t.timeout??1000);return async()=>{try{return await h()}finally{d.destroy?.()}}},Hp=(t)=>{if(t.includes(`\r
|
|
44
|
-
`))throw new Nt("Authorization token contains invalid \\r\\n sequence.");return t};hD.fromHttp=fD});var gg=e(function(cF){var{nv:Zp,NumericValue:fn,calculateBodyLength:gD,generateIdempotencyToken:eg,fromBase64:Qa,_parseEpochTimestamp:dn}=X(),{hasOwn:ae,getSmithyContext:mD}=me(),{HttpRequest:yD,collectBody:SD,SerdeContext:hn,RpcProtocol:wD}=K(),{NormalizedSchema:we,deref:ED,TypeRegistry:qp}=Te();function yr(t){return typeof Buffer<"u"?Buffer.alloc(t):new Uint8Array(t)}var pn=Symbol("@smithy/core/cbor::tagSymbol");function Xa(t){return t[pn]=!0,t}var tg=typeof Buffer<"u",Ya=new TextDecoder,N=yr(0),Ja=!1,Ae=new DataView(N.buffer,N.byteOffset,N.byteLength),I=0;function bD(t){N=t,Ja=tg&&N instanceof Buffer,Ae=new DataView(N.buffer,N.byteOffset,N.byteLength)}function dt(t,r){if(t>=r)throw Error("unexpected end of (decode) payload.");let n=(N[t]&224)>>5,s=N[t]&31;if(s===31&&2<=n&&n<=5)return _D(t,r);switch(n){case 0:case 1:case 6:{let o,i;if(s<24)o=s,i=1;else switch(s){case 24:if(r-t<2)Be(1);o=N[t+1],i=2;break;case 25:if(r-t<3)Be(2);o=Ae.getUint16(t+1),i=3;break;case 26:if(r-t<5)Be(4);o=Ae.getUint32(t+1),i=5;break;case 27:if(r-t<9)Be(8);{let u=Ae.getUint32(t+1);if(u<2097152)o=u*4294967296+Ae.getUint32(t+5);else o=Ae.getBigUint64(t+1)}i=9;break;default:ec(s)}if(n===0)return I=i,Va(o);else if(n===1){let u;if(typeof o==="bigint")u=BigInt(-1)-o;else u=-1-o;return I=i,Va(u)}else return ND(t,r,s,o,i)}case 3:return ln(t,r);case 5:return xD(t,r);case 4:return ID(t,r);case 2:return Za(t,r);default:return OD(t,r)}}function _D(t,r){let n=(N[t]&224)>>5;if((N[t]&31)===31)switch(n){case 3:return MD(t,r);case 5:return PD(t,r);case 4:return kD(t,r);case 2:return DD(t,r)}}function AD(t,r){let n=t>>7,s=(t&124)>>2,o=(t&3)<<8|r,i=n===0?1:-1;if(s===0){if(o===0)return 0;return i*(Math.pow(2,-14)*(o/1024))}else if(s===31){if(o===0)return i*(1/0);return NaN}return i*(Math.pow(2,s-15)*(1+o/1024))}function xD(t,r){let n=gn(t,r);if(n<25)return CD(t,r,n);return TD(t,r,n)}function TD(t,r,n){let s=I;t+=s;let o=t,i=Object.create(null);for(let u=0;u<n;++u){let a=ln(t,r);if(t+=I,(N[t]&224)>>5===3)i[a]=ln(t,r);else i[a]=dt(t,r);t+=I}return I=s+(t-o),Object.setPrototypeOf(i,Object.prototype),i}function CD(t,r,n){let s=I;t+=s;let o=t,i={};for(let u=0;u<n;++u){let a=ln(t,r);t+=I,i[a]=dt(t,r),t+=I}return I=s+(t-o),i}function ID(t,r){let n=gn(t,r),s=I;t+=s;let o=t,i=Array(n);for(let u=0;u<n;++u)i[u]=dt(t,r),t+=I;return I=s+(t-o),i}function ln(t,r){let n=gn(t,r),s=I;if(t+=s,r-t<n)Be(n);if(I=s+n,n<24)return vD(t,n);if(Ja)return N.toString("utf-8",t,t+n);return Ya.decode(N.subarray(t,t+n))}var Vp=Array(2048),$a=new Uint16Array(2048),an=0;function RD(){an=an+1&65535}function vD(t,r){let n=r;for(let u=0;u<r;++u)n=n*31+N[t+u]|0;let s=n>>>0&2047,o=Vp[s];if(o!==void 0){if(o.length===r){let u=!0;for(let a=0;a<r;++a)if(o.charCodeAt(a)!==N[t+a]){u=!1;break}if(u)return $a[s]=an,o}}let i=Ja?N.toString("utf-8",t,t+r):Ya.decode(N.subarray(t,t+r));if($a[s]!==an)Vp[s]=i,$a[s]=an;return i}function Za(t,r){let n=gn(t,r),s=I;if(t+=s,r-t<n)Be(n);let o=N.subarray(t,t+n);return I=s+n,o}function ND(t,r,n,s,o){if(n===2||n===3){let i=gn(t+o,r),u=BigInt(0),a=t+o+I;for(let d=a;d<a+i;++d)u=u<<BigInt(8)|BigInt(N[d]);return I=o+I+i,n===3?-u-BigInt(1):u}else if(n===4){let i=dt(t+o,r),[u,a]=i,d=a<0?-1:1,l=BigInt(d)*BigInt(a),h=String(l),f=a<0?"-":"",p;if(typeof u==="number"&&Math.abs(u)<=268435456){let m=u,y="0".repeat(Math.abs(m)+1)+h;if(p=m===0?y:y.slice(0,y.length+m)+"."+y.slice(m),p=p.replace(/^0+/g,""),p==="")p="0";if(p[0]===".")p="0"+p;p=f+p}else{let m=BigInt(u);if(h.length===1)p=f+h+"e"+String(m);else{let y=m+BigInt(h.length-1);p=f+h[0]+"."+h.slice(1)+"e"+String(y)}}return I=o+I,Zp(p)}else{let i=dt(t+o,r);return I=o+I,Xa({tag:Va(s),value:i})}}function OD(t,r){let n=N[t]&31;switch(n){case 21:case 20:return I=1,n===21;case 22:return I=1,null;case 23:return I=1,null;case 25:if(r-t<3)throw Error("incomplete float16 at end of buf.");return I=3,AD(N[t+1],N[t+2]);case 26:if(r-t<5)throw Error("incomplete float32 at end of buf.");return I=5,Ae.getFloat32(t+1);case 27:if(r-t<9)throw Error("incomplete float64 at end of buf.");return I=9,Ae.getFloat64(t+1);default:ec(n)}}function gn(t,r){let n=N[t]&31;if(n<24)return I=1,n;switch(n){case 24:if(r-t<2)Be(1);return I=2,N[t+1];case 25:if(r-t<3)Be(2);return I=3,Ae.getUint16(t+1);case 26:if(r-t<5)Be(4);return I=5,Ae.getUint32(t+1);case 27:if(r-t<9)Be(8);return I=9,FD(Ae.getBigUint64(t+1));default:ec(n)}}function PD(t,r){t+=1;let n=t,s={};for(;t<r;){if(N[t]===255)return I=t-n+2,s;let o=ln(t,r);t+=I,s[o]=dt(t,r),t+=I}throw Error("expected break marker.")}function kD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255)return I=t-s+2,n;n.push(dt(t,r)),t+=I}throw Error("expected break marker.")}function MD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255){let d=yr(n.length);if(d.set(n,0),I=t-s+2,tg)return d.toString("utf-8",0,d.length);return Ya.decode(d)}let o=(N[t]&224)>>5,i=N[t]&31;if(o!==3)rg(o);if(i===31)throw Error("nested indefinite string.");let u=Za(t,r);t+=I;for(let d=0;d<u.length;++d)n.push(u[d])}throw Error("expected break marker.")}function DD(t,r){t+=1;let n=[];for(let s=t;t<r;){if(N[t]===255){let d=yr(n.length);return d.set(n,0),I=t-s+2,d}let o=(N[t]&224)>>5,i=N[t]&31;if(o!==2)rg(o);if(i===31)throw Error("nested indefinite string.");let u=Za(t,r);t+=I;for(let d=0;d<u.length;++d)n.push(u[d])}throw Error("expected break marker.")}function Va(t){if(typeof t==="number")return t;let r=Number(t);if(Number.MIN_SAFE_INTEGER<=r&&r<=Number.MAX_SAFE_INTEGER)return r;return t}function FD(t){let r=Number(t);if(r<Number.MIN_SAFE_INTEGER||Number.MAX_SAFE_INTEGER<r)console.warn(Error(`@smithy/core/cbor - truncating BigInt(${t}) to ${r} with loss of precision.`));return r}function Be(t){throw Error(`length ${t} greater than remaining buf len.`)}function ec(t){throw Error(`unexpected minor value ${t}.`)}function rg(t){throw Error(`unexpected major type ${t} in indefinite string.`)}var LD=typeof Buffer<"u",lr=new Map,cn=0,ja=!1,UD=2048,x=yr(UD),Se=new DataView(x.buffer,x.byteOffset,x.byteLength),b=0;function $D(t){let r=[t];while(r.length){let n=r.pop();if(typeof n==="string"){let s=n.length;if(LD)if(fr(s*3+9),s>23)Ba(3,Buffer.byteLength(n)),b+=x.write(n,b);else HD(n);else{let o=s*3;fr(o+9);let i=b,a=new TextEncoder().encodeInto(n,x.subarray(b+9)).written,d;if(a<24)d=1;else if(a<256)d=2;else if(a<65536)d=3;else if(a<4294967296)d=5;else d=9;if(d<9)x.copyWithin(i+d,i+9,i+9+a);b=i,Ot(3,a),b+=a}continue}if(x.byteLength-b<9)fr(64);if(typeof n==="number"){if(Number.isInteger(n)&&n>=-9007199254740992&&n<=9007199254740991){let s=n>=0,o=s?0:1,i=s?n:-n-1;if(i<24)x[b++]=o<<5|i;else if(i<256)x[b++]=o<<5|24,x[b++]=i;else if(i<65536)x[b++]=o<<5|25,x[b++]=i>>8,x[b++]=i&255;else if(i<4294967296)x[b++]=o<<5|26,Se.setUint32(b,i),b+=4;else{x[b++]=o<<5|27;let u=i/4294967296|0,a=i-u*4294967296|0;Se.setUint32(b,u),Se.setUint32(b+4,a),b+=8}continue}x[b++]=251,Se.setFloat64(b,n),b+=8;continue}else if(typeof n==="bigint"){let s=n>=0,o=s?0:1,i=s?n:-n-BigInt(1);if(i<BigInt("18446744073709551616")){let u=Number(i);if(u<4294967296)Ot(o,u);else x[b++]=o<<5|27,Se.setBigUint64(b,i),b+=8}else{let u=i.toString(2),a=new Uint8Array(Math.ceil(u.length/8)),d=i,l=0;while(a.byteLength-++l>=0)a[a.byteLength-l]=Number(d&BigInt(255)),d>>=BigInt(8);fr(a.byteLength*2+16),x[b++]=s?194:195,Ba(2,a.byteLength),x.set(a,b),b+=a.byteLength}continue}else if(n===null){x[b++]=246;continue}else if(typeof n==="boolean"){x[b++]=224|(n?21:20);continue}else if(typeof n>"u")throw Error("@smithy/core/cbor: client may not serialize undefined value.");else if(Array.isArray(n)){Ot(4,n.length),fr(n.length*9+64);for(let s=n.length-1;s>=0;--s)r.push(n[s]);continue}else if(typeof n.byteLength==="number"){fr(n.length*2+9),Ot(2,n.length),x.set(n,b),b+=n.byteLength;continue}else if(typeof n==="object"){if(n instanceof fn){let i=n.string,u=BigInt(0),a=i.search(/[eE]/);if(a!==-1)u=BigInt(i.slice(a+1)),i=i.slice(0,a);let d=i.indexOf("."),l=d===-1?0:i.length-d-1,h=u-BigInt(l),f=BigInt(i.replace(".",""));x[b++]=196,Ot(4,2),r.push(f),r.push(h>=-0x20000000000000n&&h<=0x1fffffffffffffn?Number(h):h);continue}if(n[pn])if("tag"in n&&"value"in n){r.push(n.value),Ba(6,n.tag);continue}else throw Error("tag encountered with missing fields, need 'tag' and 'value', found: "+JSON.stringify(n));let s=Object.keys(n),o=s.length;Ot(5,o);for(let i=o-1;i>=0;--i)r.push(n[s[i]]),r.push(s[i]);continue}throw Error(`data type ${n?.constructor?.name??typeof n} not compatible for encoding.`)}}function BD(){cn=cn+1&65535,ja=!1}function jp(){let t=yr(b);return t.set(x.subarray(0,b),0),b=0,t}function Wa(t){let r=x;if(x=yr(t),r)if(r.copy)r.copy(x,0,0,r.byteLength);else x.set(r,0);Se=new DataView(x.buffer,x.byteOffset,x.byteLength)}function HD(t){let r=lr.get(t);if(r!==void 0){x.set(r.bytes,b),b+=r.bytes.length,r.epoch=cn;return}let n=b,s=Buffer.byteLength(t);Ot(3,s),b+=x.write(t,b);let o=Uint8Array.prototype.slice.call(x,n,b);if(lr.size>=2048){if(ja)return;let i=0;for(let[u,a]of lr){if(i>=1024)break;if(a.epoch!==cn)lr.delete(u),i++}if(i===0){ja=!0;return}}if(lr.size<2048)lr.set(t,{epoch:cn,bytes:o})}function fr(t){if(x.byteLength-b<t)if(b<16000000)Wa(Math.max(x.byteLength*4,x.byteLength+t));else Wa(x.byteLength+t+16000000)}function Ba(t,r){if(r<24)x[b++]=t<<5|r;else if(r<256)x[b++]=t<<5|24,x[b++]=r;else if(r<65536)x[b++]=t<<5|25,Se.setUint16(b,r),b+=2;else if(r<4294967296)x[b++]=t<<5|26,Se.setUint32(b,r),b+=4;else x[b++]=t<<5|27,Se.setBigUint64(b,typeof r==="bigint"?r:BigInt(r)),b+=8}function Ot(t,r){if(r<24)x[b++]=t<<5|r;else if(r<256)x[b++]=t<<5|24,x[b++]=r;else if(r<65536)x[b++]=t<<5|25,x[b++]=r>>8,x[b++]=r&255;else if(r<4294967296)x[b++]=t<<5|26,Se.setUint32(b,r),b+=4;else{x[b++]=t<<5|27;let n=r/4294967296|0,s=r-n*4294967296|0;Se.setUint32(b,n),Se.setUint32(b+4,s),b+=8}}var Ps={deserialize(t){return RD(),bD(t),dt(0,t.length)},serialize(t){BD();try{return $D(t),jp()}catch(r){throw jp(),r}},resizeEncodingBuffer(t){Wa(t)}},ng=(t,r)=>SD(t,r).then(async(n)=>{if(n.length)try{return Ps.deserialize(n)}catch(s){throw Object.defineProperty(s,"$responseBodyText",{value:r.utf8Encoder(n)}),s}return{}}),Rs=(t)=>Xa({tag:1,value:t.getTime()/1000}),zD=async(t,r)=>{let n=await ng(t,r);return n.message=n.message??n.Message,n},sg=(t,r)=>{let n=(s)=>{let o=s;if(typeof o==="number")o=o.toString();if(o.indexOf(",")>=0)o=o.split(",")[0];if(o.indexOf(":")>=0)o=o.split(":")[0];return o};if(r.__type!==void 0)return n(r.__type)},qD=(t)=>{if(String(t.headers["smithy-protocol"]).toLowerCase()!=="rpc-v2-cbor")throw Error("Malformed RPCv2 CBOR response, status: "+t.statusCode)},VD=async(t,r,n,s,o)=>{let i=await t.endpoint(),{hostname:u,protocol:a="https",port:d,path:l}=i,h={protocol:a,hostname:u,port:d,method:"POST",path:l.endsWith("/")?l.slice(0,-1)+n:l+n,headers:{...r}};if(s!==void 0)h.hostname=s;if(i.headers)for(let f in i.headers){if(!ae(i.headers,f))continue;h.headers[f]=i.headers[f]}if(o!==void 0){h.body=o;try{h.headers["content-length"]=String(gD(o))}catch(f){}}return new yD(h)};class tc extends hn{write(t,r){T=0;let n=we.of(t);pr(n,r,void 0,this.serdeContext)}flush(){let t=R.subarray(0,T);return T=0,R=og(Ga),Pt=new DataView(R.buffer,R.byteOffset,R.byteLength),t}}var Wp=Symbol.for("@smithy/cbor-struct-cache");function rc(t){let r=t.getSchema(),n=r[Wp];if(n)return n;let s=[],o=[];for(let[a,d]of t.structIterator())s.push(a),o.push(d);let i=Array(s.length);for(let a=0;a<s.length;++a)i[a]=jD(s[a]);let u={memberNames:s,memberSchemas:o,encodedKeys:i};return r[Wp]=u,u}function jD(t){let r;if(ks)r=Buffer.from(t,"utf-8");else r=new TextEncoder().encode(t);let n=r.length,s;if(n<24)s=1;else if(n<256)s=2;else s=3;let o=new Uint8Array(s+n);if(s===1)o[0]=96|n;else if(s===2)o[0]=120,o[1]=n;else o[0]=121,o[1]=n>>8,o[2]=n&255;return o.set(r,s),o}var ks=typeof Buffer<"u",WD=new TextEncoder,Ga=2048,R=ks?Buffer.allocUnsafe(Ga):new Uint8Array(Ga),Pt=new DataView(R.buffer,R.byteOffset,R.byteLength),T=0,Gp=2048,hr=new Map,Ha=0,Kp=!1;function og(t){return ks?Buffer.allocUnsafe(t):new Uint8Array(t)}function pr(t,r,n,s){if(r==null){if(r===void 0&&t.isIdempotencyToken()){ze(eg());return}M(1),R[T++]=246;return}if(t.isUnitSchema()){M(1),J(5,0);return}if(typeof r==="object"){if(t.isBlobSchema()){if(r instanceof Uint8Array){vs(r);return}}if(t.isTimestampSchema()){if(r instanceof Date){Ka(r);return}}if(t.isStructSchema()){GD(t,r,s);return}if(Array.isArray(r)&&(t.isListSchema()||t.isDocumentSchema())){Qp(t,r,t.isDocumentSchema(),s);return}if(t.isMapSchema()){za(t,r,!1,s);return}if(r instanceof Date){Ka(r);return}if(r instanceof Uint8Array){vs(r);return}if(r instanceof fn){cg(r);return}if(r[pn]){let i=r;ag(i.tag,i.value);return}if(t.isDocumentSchema()){if(Array.isArray(r))Qp(t,r,!0,s);else za(t,r,!0,s);return}if(t.isBigDecimalSchema()){gr(r);return}za(t,r,!0,s);return}if(typeof r==="string"){if(t.isBlobSchema()){let i=(s?.base64Decoder??Qa)(r);vs(i);return}ze(r);return}if(typeof r==="number"){if(M(9),Number.isInteger(r)&&r>=-9007199254740992&&r<=9007199254740991)Ms(r);else nc(r);return}if(typeof r==="boolean"){M(1),R[T++]=224|(r?21:20);return}if(typeof r==="bigint"){Os(r);return}ze(String(r))}function GD(t,r,n){if(t.isUnionSchema()){let f=!1;for(let[p,g]of t.structIterator()){let m=r[p];if(m!=null){M(9),J(5,1),ze(p),pr(g,m,t,n),f=!0;break}}if(!f){let{$unknown:p}=r;if(Array.isArray(p))M(9),J(5,1),ze(p[0]),gr(p[1]);else M(9),J(5,0)}return}let s=rc(t),{memberNames:o,memberSchemas:i,encodedKeys:u}=s,a=o.length,d;if(a<24)d=1;else if(a<256)d=2;else d=3;M(d);let l=T;T+=d;let h=0;for(let f=0;f<a;++f){let p=r[o[f]];if(p==null&&!i[f].isIdempotencyToken())continue;let g=u[f];M(g.length),R.set(g,T),T+=g.length,pr(i[f],p,t,n),++h}if(typeof r.__type==="string")for(let f in r){if(!ae(r,f))continue;if(!o.includes(f))ze(f),gr(r[f]),++h}if(d===1)R[l]=160|h;else if(d===2)R[l]=184,R[l+1]=h;else R[l]=185,R[l+1]=h>>8,R[l+2]=h&255}function Qp(t,r,n,s){let o=!!t.getMergedTraits().sparse,i=t.getValueSchema();if(n||o){let u=[];for(let a=0;a<r.length;++a){let d=r[a];if(n){if(d!==void 0)u.push(d)}else if(d!=null||o)u.push(d)}M(9),J(4,u.length);for(let a=0;a<u.length;++a)pr(i,u[a],void 0,s)}else{let u=0;for(let a=0;a<r.length;++a)if(r[a]!=null)++u;M(9),J(4,u);for(let a=0;a<r.length;++a)if(r[a]!=null)pr(i,r[a],void 0,s)}}function za(t,r,n,s){let o=!!t.getMergedTraits().sparse,i=t.getValueSchema(),u=[];for(let a in r){if(!ae(r,a))continue;let d=r[a];if(n?d!==void 0:d!=null||o)u.push(a)}M(9),J(5,u.length);for(let a=0;a<u.length;++a){let d=u[a];ze(d),pr(i,r[d],void 0,s)}}function gr(t){if(t==null){M(1),R[T++]=246;return}if(typeof t==="string"){ze(t);return}if(typeof t==="number"){if(M(9),Number.isInteger(t)&&t>=-9007199254740992&&t<=9007199254740991)Ms(t);else nc(t);return}if(typeof t==="boolean"){M(1),R[T++]=224|(t?21:20);return}if(typeof t==="bigint"){Os(t);return}if(t instanceof Uint8Array){vs(t);return}if(t instanceof Date){Ka(t);return}if(t instanceof fn){cg(t);return}if(t[pn]){let r=t;ag(r.tag,r.value);return}if(Array.isArray(t)){M(9),J(4,t.length);for(let r=0;r<t.length;++r)gr(t[r]);return}if(typeof t==="object"){let r=Object.keys(t);M(9),J(5,r.length);for(let n=0;n<r.length;++n)ze(r[n]),gr(t[r[n]]);return}ze(String(t))}function M(t){if(T+t>R.length){let r=R.length*2;while(r<T+t)r*=2;let n=og(r);n.set(R.subarray(0,T)),R=n,Pt=new DataView(n.buffer,n.byteOffset,n.byteLength)}}function J(t,r){if(r<24)R[T++]=t<<5|r;else if(r<256)R[T++]=t<<5|24,R[T++]=r;else if(r<65536)R[T++]=t<<5|25,R[T++]=r>>8,R[T++]=r&255;else if(r<4294967296)R[T++]=t<<5|26,Pt.setUint32(T,r),T+=4;else{R[T++]=t<<5|27;let n=r/4294967296|0,s=r-n*4294967296|0;Pt.setUint32(T,n),Pt.setUint32(T+4,s),T+=8}}function ig(t,r){let n=Number(r);if(n<4294967296){J(t,n);return}R[T++]=t<<5|27,Pt.setBigUint64(T,r),T+=8}function ze(t){let r=t.length;if(r<=23){let n=hr.get(t);if(n){M(n.bytes.length),R.set(n.bytes,T),T+=n.bytes.length,n.epoch=Ha;return}let s=T;Xp(t,r);let o=T,i=Uint8Array.prototype.slice.call(R,s,o);if(hr.size>=Gp){if(Kp)return;let u=0;for(let[a,d]of hr){if(u>=1024)break;if(d.epoch!==Ha)hr.delete(a),++u}if(u===0){Kp=!0;return}}if(hr.size<Gp)hr.set(t,{epoch:Ha,bytes:i});return}Xp(t,r)}function Xp(t,r){if(ks){let n=r*3;M(n+9);let s=Buffer.byteLength(t);J(3,s),T+=R.write(t,T)}else{let n=r*3;M(n+9);let s=T,i=WD.encodeInto(t,R.subarray(s+9)).written,u;if(i<24)u=1;else if(i<256)u=2;else if(i<65536)u=3;else if(i<4294967296)u=5;else u=9;if(u<9)R.copyWithin(s+u,s+9,s+9+i);T=s,J(3,i),T+=i}}function nc(t){M(9),R[T++]=251,Pt.setFloat64(T,t),T+=8}function Ms(t){M(9);let r=t>=0,n=r?0:1,s=r?t:-t-1;J(n,s)}function Os(t){let r=t>=0,n=r?0:1,s=r?t:-t-BigInt(1);if(s<BigInt("18446744073709551616"))M(9),ig(n,s);else{let o=s.toString(2),i=Math.ceil(o.length/8),u=new Uint8Array(i),a=s;for(let d=i-1;d>=0;--d)u[d]=Number(a&BigInt(255)),a>>=BigInt(8);M(i+16),R[T++]=r?194:195,J(2,i),R.set(u,T),T+=i}}function vs(t){M(t.length+9),J(2,t.length),R.set(t,T),T+=t.length}function ag(t,r){if(M(9),typeof t==="bigint")ig(6,t);else J(6,t);gr(r)}function cg(t){let r=t.string,n=BigInt(0),s=r.search(/[eE]/);if(s!==-1)n=BigInt(r.slice(s+1)),r=r.slice(0,s);let o=r.indexOf("."),i=o===-1?0:r.length-o-1,u=n-BigInt(i),a=BigInt(r.replace(".",""));if(M(9),R[T++]=196,J(4,2),M(9),u>=-0x20000000000000n&&u<=0x1fffffffffffffn)Ms(Number(u));else Os(u);Os(a)}function Ka(t){M(18),J(6,1);let r=t.getTime()/1000;if(Number.isInteger(r))Ms(r);else nc(r)}class sc extends hn{read(t,r){return H=r,ic=ug&&r instanceof Buffer,ut=new DataView(r.buffer,r.byteOffset,r.byteLength),_=0,Y=r.length,un=un+1&65535,ye(we.of(t))}readValue(t,r){return Ns(we.of(t),r)}}var ug=typeof Buffer<"u",oc=new TextDecoder,H=new Uint8Array(0),ic=!1,ut=new DataView(new ArrayBuffer(0)),_=0,Y=0,ac=2048,Yp=Array(ac),qa=new Uint16Array(ac),un=0;function ye(t){if(_>=Y)throw Error("unexpected end of CBOR payload.");let r=(H[_]&224)>>5;if((H[_]&31)===31&&r>=2&&r<=5)return JD(t,r);switch(r){case 0:return nF();case 1:return sF();case 2:return Ls();case 3:return mr();case 4:return KD(t);case 5:return QD(t);case 6:return YD();case 7:return iF();default:throw Error(`unexpected CBOR major type ${r}.`)}}function KD(t){let r=Fs(),n=t.isListSchema()?t.getValueSchema():t,s=Array(r);for(let o=0;o<r;++o)s[o]=ye(n);return s}function QD(t){let r=Fs();if(t.isStructSchema())return XD(t,r,_);let n=t.isMapSchema()?t.getValueSchema():t,s={};for(let o=0;o<r;++o){let i=mr();s[i]=ye(n)}return s}function XD(t,r,n){let s=t.isUnionSchema(),o=rc(t),{memberSchemas:i,encodedKeys:u,memberNames:a}=o,d=u.length,l={},h,f,p=0,g=!1,m=0;for(let y=0;y<r;++y){let S=dg(u,d,m);if(S>=0){if(m=S+1,m>=d)m=0;let w=ye(i[S]);if(w!=null)l[a[S]]=w}else{let w=mr(),E=ye(we.of(15));if(w==="__type"&&typeof E==="string")g=!0;else h=w,f=E,++p}}if(s){let y=!0;for(let S in l){if(!ae(l,S))continue;y=!1;break}if(y&&p===1)l.$unknown=[h,f]}else if(g){_=n;let y=we.of(15);for(let S=0;S<r;++S){let w=mr(),E=ye(y);if(!(w in l))l[w]=E}}return l}function YD(t){let r=Ds(),n=typeof r==="bigint"?Number(r):r;if(n===1){let i=we.of(15),u=ye(i);return dn(u)}if(n===2||n===3){let i=Ls(),u=BigInt(0);for(let a=0;a<i.length;++a)u=u<<BigInt(8)|BigInt(i[a]);return n===3?-u-BigInt(1):u}if(n===4){let i=we.of(15),u=ye(i),[a,d]=u,l=d<0?-1:1,h=BigInt(l)*BigInt(d),f=String(h),p=d<0?"-":"",g;if(typeof a==="number"&&Math.abs(a)<=268435456){let y=a,S="0".repeat(Math.abs(y)+1)+f;if(g=y===0?S:S.slice(0,S.length+y)+"."+S.slice(y),g=g.replace(/^0+/g,""),g==="")g="0";if(g[0]===".")g="0"+g;g=p+g}else{let y=BigInt(a);if(f.length===1)g=p+f+"e"+String(y);else{let S=y+BigInt(f.length-1);g=p+f[0]+"."+f.slice(1)+"e"+String(S)}}return Zp(g)}let s=we.of(15),o=ye(s);return{tag:lg(r),value:o}}function JD(t,r){switch(r){case 3:return ZD();case 2:return eF();case 4:return tF(t);case 5:return rF(t);default:throw Error(`unexpected indefinite length for major ${r}.`)}}function ZD(){_+=1;let t=[],r=0;while(_<Y){if(H[_]===255){_+=1;let s=new Uint8Array(r),o=0;for(let i=0;i<t.length;++i)s.set(t[i],o),o+=t[i].length;if(ug)return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString("utf-8");return oc.decode(s)}let n=Ls();t.push(n),r+=n.length}throw Error("expected break marker.")}function eF(){_+=1;let t=[],r=0;while(_<Y){if(H[_]===255){_+=1;let s=new Uint8Array(r),o=0;for(let i=0;i<t.length;++i)s.set(t[i],o),o+=t[i].length;return s}let n=Ls();t.push(n),r+=n.length}throw Error("expected break marker.")}function tF(t){_+=1;let r=t.isListSchema()?t.getValueSchema():t,n=[];while(_<Y){if(H[_]===255)return _+=1,n;n.push(ye(r))}throw Error("expected break marker.")}function rF(t){if(_+=1,t.isStructSchema()){let s=rc(t),{memberSchemas:o,encodedKeys:i,memberNames:u}=s,a=i.length,d=t.isUnionSchema(),l={},h,f,p=0,g=0;while(_<Y){if(H[_]===255){if(_+=1,d){let y=!0;for(let S in l){if(!ae(l,S))continue;y=!1;break}if(y&&p===1)l.$unknown=[h,f]}return l}let m=dg(i,a,g);if(m>=0){if(g=m+1,g>=a)g=0;let y=ye(o[m]);if(y!=null)l[u[m]]=y}else{let y=mr(),S=ye(we.of(15));if(y!=="__type")h=y,f=S,++p}}throw Error("expected break marker.")}let r=t.isMapSchema()?t.getValueSchema():t,n={};while(_<Y){if(H[_]===255)return _+=1,n;let s=mr();n[s]=ye(r)}throw Error("expected break marker.")}function dg(t,r,n){let s=t[n];if(_+s.length<=Y&&Jp(_,s))return _+=s.length,n;for(let o=0;o<r;++o){if(o===n)continue;let i=t[o];if(_+i.length<=Y&&Jp(_,i))return _+=i.length,o}return-1}function Jp(t,r){let n=r.length;if(H[t]!==r[0])return!1;for(let s=1;s<n;++s)if(H[t+s]!==r[s])return!1;return!0}function Ds(){let t=H[_]&31;if(t<24)return _+=1,t;switch(t){case 24:if(Y-_<2)Je(1);return _+=2,H[_-1];case 25:if(Y-_<3)Je(2);return _+=3,ut.getUint16(_-2);case 26:if(Y-_<5)Je(4);return _+=5,ut.getUint32(_-4);case 27:{if(Y-_<9)Je(8);_+=9;let r=ut.getUint32(_-8);if(r<2097152)return r*4294967296+ut.getUint32(_-4);return ut.getBigUint64(_-8)}default:throw Error(`unexpected minor value ${t}.`)}}function Fs(){let t=Ds();return typeof t==="bigint"?Number(t):t}function nF(){let t=Ds();return lg(t)}function sF(){let t=Ds();if(typeof t==="bigint")return BigInt(-1)-t;return-1-t}function Ls(){let t=Fs();if(Y-_<t)Je(t);let r=_;return _+=t,H.subarray(r,r+t)}function mr(){let t=Fs();if(Y-_<t)Je(t);let r=_;if(_+=t,t<24)return oF(r,t);if(ic)return H.toString("utf-8",r,r+t);return oc.decode(H.subarray(r,r+t))}function oF(t,r){let n=r;for(let u=0;u<r;++u)n=n*31+H[t+u]|0;let s=n>>>0&ac-1,o=Yp[s];if(o!==void 0&&o.length===r){let u=!0;for(let a=0;a<r;++a)if(o.charCodeAt(a)!==H[t+a]){u=!1;break}if(u)return qa[s]=un,o}let i=ic?H.toString("utf-8",t,t+r):oc.decode(H.subarray(t,t+r));if(qa[s]!==un)Yp[s]=i,qa[s]=un;return i}function iF(){let t=_,r=H[t]&31;switch(r){case 21:return _=t+1,!0;case 20:return _=t+1,!1;case 22:return _=t+1,null;case 23:return _=t+1,null;case 25:{if(Y-t<3)Je(2);return _=t+3,aF(H[t+1],H[t+2])}case 26:{if(Y-t<5)Je(4);return _=t+5,ut.getFloat32(t+1)}case 27:{if(Y-t<9)Je(8);return _=t+9,ut.getFloat64(t+1)}default:throw Error(`unexpected minor value ${r} for major 7.`)}}function aF(t,r){let n=t>>7,s=(t&124)>>2,o=(t&3)<<8|r,i=n===0?1:-1;if(s===0){if(o===0)return 0;return i*(Math.pow(2,-14)*(o/1024))}else if(s===31){if(o===0)return i*(1/0);return NaN}return i*(Math.pow(2,s-15)*(1+o/1024))}function lg(t){if(typeof t==="number")return t;let r=Number(t);if(Number.MIN_SAFE_INTEGER<=r&&r<=Number.MAX_SAFE_INTEGER)return r;return t}function Je(t){throw Error(`CBOR: length ${t} greater than remaining buffer length.`)}function Ns(t,r){if(t.isTimestampSchema()){if(typeof r==="number")return dn(r);if(typeof r==="object"&&r!==null){if(r.tag===1&&"value"in r)return dn(r.value)}}if(t.isBlobSchema())return r;if(typeof r>"u"||typeof r==="boolean"||typeof r==="number"||typeof r==="string"||typeof r==="bigint"||typeof r==="symbol")return r;if(typeof r!=="object"||r===null)return r;if("byteLength"in r)return r;if(r instanceof Date)return r;if(r instanceof fn)return r;if(t.isDocumentSchema())return r;if(t.isListSchema()){let s=t.getValueSchema(),o=[];for(let i of r)o.push(Ns(s,i));return o}let n={};if(t.isMapSchema()){let s=t.getValueSchema();for(let o in r){if(!ae(r,o))continue;n[o]=Ns(s,r[o])}}else if(t.isStructSchema()){let s=t.isUnionSchema(),o;if(s){o=new Set;for(let i in r){if(!ae(r,i))continue;if(i!=="__type")o.add(i)}}for(let[i,u]of t.structIterator()){if(s)o.delete(i);if(r[i]!=null)n[i]=Ns(u,r[i])}if(s&&o?.size===1){let i=!0;for(let u in n){if(!ae(n,u))continue;i=!1;break}if(i){let u=o.values().next().value;n.$unknown=[u,r[u]]}}else if(typeof r.__type==="string")for(let i in r){if(!ae(r,i))continue;if(!(i in n))n[i]=r[i]}}return n}class cc extends hn{createSerializer(){let t=new tc;return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new sc;return t.setSerdeContext(this.serdeContext),t}}class fg extends wD{codec=new cc;serializer=this.codec.createSerializer();deserializer=this.codec.createDeserializer();constructor({defaultNamespace:t,errorTypeRegistries:r}){super({defaultNamespace:t,errorTypeRegistries:r})}getShapeId(){return"smithy.protocols#rpcv2Cbor"}getPayloadCodec(){return this.codec}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(Object.assign(s.headers,{"content-type":this.getDefaultContentType(),"smithy-protocol":"rpc-v2-cbor",accept:this.getDefaultContentType()}),ED(t.input)==="unit")delete s.body,delete s.headers["content-type"];else{if(!s.body)this.serializer.write(15,{}),s.body=this.serializer.flush();if(s.body instanceof Uint8Array)s.headers["content-length"]=String(s.body.byteLength)}let{service:o,operation:i}=mD(n),u=`/service/${o}/operation/${i}`;if(s.path.endsWith("/"))s.path+=u.slice(1);else s.path+=u;return s}async deserializeResponse(t,r,n){return super.deserializeResponse(t,r,n)}async handleError(t,r,n,s,o){let i=sg(n,s)??"Unknown",u=["*"],{defaultNamespace:a}=this.options;u.unshift(a);let[d,l]=(()=>{if(i.includes("#"))return i.split("#");return[void 0,i]})();if(d)u.unshift(d);let h={$metadata:o,$fault:n.statusCode<500?"client":"server"},f=[this.compositeErrorRegistry];if(d)f.push(qp.for(d));f.push(qp.for(a));let[p,g,m]=this.resolveError(l,u,f);if(m==="native"||m==="synthetic"){if(s.Message)s.message=s.Message;let A=m==="synthetic"?new g({name:l}):Error(l);throw Object.assign(A,h,s)}let y=we.of(p),S=s.message??s.Message??"Unknown",w=new g({}),E={};for(let[A,v]of y.structIterator())E[A]=this.deserializer.readValue(v,s[A]);throw Object.assign(w,h,{$fault:y.getMergedTraits().error,message:S},E)}getDefaultContentType(){return"application/cbor"}}class hg extends hn{value;write(t,r){this.value=this.serialize(t,r)}serialize(t,r){let n=we.of(t);if(r==null){if(n.isIdempotencyToken())return eg();return r}if(n.isBlobSchema()){if(typeof r==="string")return(this.serdeContext?.base64Decoder??Qa)(r);return r}if(n.isTimestampSchema()){if(typeof r==="number"||typeof r==="bigint")return Rs(new Date(Number(r)/1000|0));return Rs(r)}if(typeof r==="function"||typeof r==="object"){let s=r;if(n.isListSchema()&&Array.isArray(s)){let i=!!n.getMergedTraits().sparse,u=[],a=0;for(let d of s){let l=this.serialize(n.getValueSchema(),d);if(l!=null||i)u[a++]=l}return u}if(s instanceof Date)return Rs(s);let o={};if(n.isMapSchema()){let i=!!n.getMergedTraits().sparse;for(let u in s){if(!ae(s,u))continue;let a=this.serialize(n.getValueSchema(),s[u]);if(a!=null||i)o[u]=a}}else if(n.isStructSchema()){for(let[u,a]of n.structIterator()){let d=this.serialize(a,s[u]);if(d!=null)o[u]=d}if(n.isUnionSchema()&&Array.isArray(s.$unknown)){let[u,a]=s.$unknown;o[u]=a}else if(typeof s.__type==="string")for(let u in s){if(!ae(s,u))continue;if(!(u in o))o[u]=this.serialize(15,s[u])}}else if(n.isDocumentSchema()){if(Array.isArray(s)){let i=[],u=0;for(let a of s)i[u++]=this.serialize(n.getValueSchema(),a);return i}for(let i in s){if(!ae(s,i))continue;o[i]=this.serialize(n.getValueSchema(),s[i])}}else if(n.isBigDecimalSchema())return s;return o}return r}flush(){let t=Ps.serialize(this.value);return this.value=void 0,t}}class pg extends hn{read(t,r){let n=Ps.deserialize(r);return this.readValue(t,n)}readValue(t,r){let n=we.of(t);if(n.isTimestampSchema()){if(typeof r==="number")return dn(r);if(typeof r==="object"){if(r.tag===1&&"value"in r)return dn(r.value)}}if(n.isBlobSchema()){if(typeof r==="string")return(this.serdeContext?.base64Decoder??Qa)(r);return r}if(typeof r>"u"||typeof r==="boolean"||typeof r==="number"||typeof r==="string"||typeof r==="bigint"||typeof r==="symbol")return r;else if(typeof r==="object"){if(r===null)return null;if("byteLength"in r)return r;if(r instanceof Date)return r;if(n.isDocumentSchema())return r;if(n.isListSchema()){let o=[],i=n.getValueSchema();for(let u of r){let a=this.readValue(i,u);o.push(a)}return o}let s={};if(n.isMapSchema()){let o=n.getValueSchema();for(let i in r){if(!ae(r,i))continue;let u=this.readValue(o,r[i]);s[i]=u}}else if(n.isStructSchema()){let o=n.isUnionSchema(),i;if(o){i=new Set;for(let u in r){if(!ae(r,u))continue;if(u!=="__type")i.add(u)}}for(let[u,a]of n.structIterator()){if(o)i.delete(u);if(r[u]!=null)s[u]=this.readValue(a,r[u])}if(o&&i?.size===1){let u=!0;for(let a in s){if(!ae(s,a))continue;u=!1;break}if(u){let a=i.values().next().value;s.$unknown=[a,r[a]]}}else if(typeof r.__type==="string")for(let u in r){if(!ae(r,u))continue;if(!(u in s))s[u]=r[u]}}else if(r instanceof fn)return r;return s}else return r}}cF.CborCodec=cc;cF.CborShapeDeserializer=pg;cF.CborShapeDeserializer2=sc;cF.CborShapeSerializer=hg;cF.CborShapeSerializer2=tc;cF.SmithyRpcV2CborProtocol=fg;cF.buildHttpRpcRequest=VD;cF.cbor=Ps;cF.checkCborResponse=qD;cF.dateToTag=Rs;cF.loadSmithyRpcV2CborErrorCode=sg;cF.parseCborBody=ng;cF.parseCborErrorBody=zD;cF.tag=Xa;cF.tagSymbol=pn});var mg=e(function(OF){var xF=/[&<>"]/g,TF={"&":"&","<":"<",">":">",'"':"""};function CF(t){return t.replace(xF,(r)=>TF[r])}var IF=/[&"'<>\r\n\u0085\u2028]/g,RF={"&":"&",'"':""","'":"'","<":"<",">":">","\r":"
","\n":"
","
":"…","\u2028":"
"};function vF(t){return t.replace(IF,(r)=>RF[r])}class dc{value;constructor(t){this.value=t}toString(){return vF(""+this.value)}}class mn{name;children;attributes={};static of(t,r,n){let s=new mn(t);if(r!==void 0)s.addChildNode(new dc(r));if(n!==void 0)s.withName(n);return s}constructor(t,r=[]){this.name=t,this.children=r}withName(t){return this.name=t,this}addAttribute(t,r){return this.attributes[t]=r,this}addChildNode(t){return this.children.push(t),this}removeAttribute(t){return delete this.attributes[t],this}n(t){return this.name=t,this}c(t){return this.children.push(t),this}a(t,r){if(r!=null)this.attributes[t]=r;return this}cc(t,r,n=r){if(t[r]!=null){let s=mn.of(r,t[r]).withName(n);this.c(s)}}l(t,r,n,s){if(t[r]!=null)s().map((i)=>{i.withName(n),this.c(i)})}lc(t,r,n,s){if(t[r]!=null){let o=s(),i=new mn(n);o.map((u)=>{i.c(u)}),this.c(i)}}toString(){let t=Boolean(this.children.length),r=`<${this.name}`,n=this.attributes;for(let s of Object.keys(n)){let o=n[s];if(o!=null)r+=` ${s}="${CF(""+o)}"`}return r+=!t?"/>":`>${this.children.map((s)=>s.toString()).join("")}</${this.name}>`}}function uc(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}function NF(t){return new lc(t).parse()}class lc{x;i=0;z;constructor(t){this.x=t,this.x=t.replace(/\r\n?/g,`
|
|
45
|
-
`),this.z=this.x.length}parse(){let t=this,{z:r}=t;while(t.i<r){if(t.trim(),t.i>=r)break;if(t.isNext("<?"))t.readTo("?>"),t.trim();else if(t.isNext("<!--"))t.readTo("-->"),t.trim();else if(t.isNext("<!DOCTYPE",!1))t.skipDoctype(),t.trim();else if(t.x[t.i]==="<"){let n=t.parseTag();return{[n.tag]:n.value}}else throw Error("@aws-sdk XML parse error: unexpected content.")}throw Error("@aws-sdk XML parse error: no root element.")}isNext(t,r=!0){let n=this;if(r)return n.x.startsWith(t,n.i);return n.x.toLowerCase().startsWith(t.toLowerCase(),n.i)}readTo(t){let r=this,n=r.x.indexOf(t,r.i);if(n===-1)throw Error(`@aws-sdk XML parse error: expected "${t}" not found.`);let s=r.x.slice(r.i,n);return r.i=n+t.length,s}trim(){let t=this;while(t.i<t.z&&` \r
|
|
46
|
-
`.includes(t.x[t.i]))++t.i}readAttrValue(){let t=this,r=t.x[t.i];++t.i;let n="";while(t.i<t.z&&t.x[t.i]!==r)n+=t.x[t.i++];return++t.i,t.decodeEntities(n)}parseTag(){let t=this;++t.i;let r="";while(t.i<t.z&&!` \r
|
|
47
|
-
>/`.includes(t.x[t.i]))r+=t.x[t.i++];let n=!1,s={};while(t.i<t.z){if(t.trim(),">/".includes(t.x[t.i]))break;let l="";while(t.i<t.z&&!`= \r
|
|
48
|
-
>/?`.includes(t.x[t.i]))l+=t.x[t.i++];if(t.trim(),t.x[t.i]!=="=")break;if(++t.i,t.trim(),l==="__proto__")uc(s);s[l]=t.readAttrValue(),n=!0}if(t.i>=t.z)throw Error("@aws-sdk XML parse error: unexpected end of input.");if(t.x[t.i]==="/"){if(++t.i,t.i>=t.z||t.x[t.i]!==">")throw Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");return++t.i,{tag:r,value:n?s:""}}if(t.x[t.i]!==">")throw Error("@aws-sdk XML parse error: expected > at the end of opening tag.");++t.i;let o=[],i=[],u=!1;while(t.i<t.z){if(t.isNext("</"))break;if(t.x[t.i]==="<")if(t.isNext("<!--"))t.readTo("-->");else if(t.isNext("<![CDATA["))t.i+=9,o.push(t.readTo("]]>"));else if(t.isNext("<?"))t.readTo("?>");else u=!0,i.push(t.parseTag());else{let l="";while(t.i<t.z&&t.x[t.i]!=="<")l+=t.x[t.i++];o.push(t.decodeEntities(l))}}if(!t.isNext("</"))throw Error(`@aws-sdk XML parse error: missing closing tag </${r}>.`);t.i+=2;let a=t.readTo(">").trim();if(a!==r)throw Error(`@aws-sdk XML parse error: mismatched tags <${r}> and </${a}>.`);if(!n&&o.length===0&&!u)return{tag:r,value:""};if(!n&&!u){let l=o.length===1?o[0]:o.join("");if(l.trim()===""&&l.includes(`
|
|
49
|
-
`))return{tag:r,value:""};return{tag:r,value:l}}let d={};for(let l of o){if(l.trim()===""&&l.includes(`
|
|
50
|
-
`))continue;d["#text"]="#text"in d?d["#text"]+l:l}for(let l of i){if(l.tag==="__proto__")uc(d);if(l.tag in d)if(Array.isArray(d[l.tag]))d[l.tag].push(l.value);else d[l.tag]=[d[l.tag],l.value];else d[l.tag]=l.value}for(let[l,h]of Object.entries(s)){if(l==="__proto__")uc(d);d[l]=h}return{tag:r,value:d}}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'"};skipDoctype(){let t=this;t.i+=9;let r=0;while(t.i<t.z){let n=t.x[t.i];if(n==="[")++r;else if(n==="]")--r;else if(n===">"&&r===0){++t.i;return}++t.i}throw Error("@aws-sdk XML parse error: unclosed DOCTYPE.")}decodeEntities(t){return t.replace(/&(?:#x([0-9a-fA-F]{1,6})|#(\d{1,7})|([a-zA-Z][a-zA-Z0-9]{0,30}));/g,(r,n,s,o)=>{if(n)return String.fromCharCode(parseInt(n,16));if(s)return String.fromCharCode(parseInt(s,10));return lc.ENTITIES[o]??""})}}OF.XmlNode=mn;OF.XmlText=dc;OF.parseXML=NF});var QA=e(function(ZF){var{SmithyRpcV2CborProtocol:DF,loadSmithyRpcV2CborErrorCode:FF}=gg(),{TypeRegistry:yg,NormalizedSchema:F,deref:Rg}=Te(),{decorateServiceException:Sg,getValueFromTextNode:vg}=le(),{collectBody:Hs,determineTimestampFormat:Er,RpcProtocol:Ng,HttpBindingProtocol:Og,HttpInterceptingShapeSerializer:Pg,HttpInterceptingShapeDeserializer:kg,FromStringShapeDeserializer:LF,extendedEncodeURIComponent:wg}=K(),{NumericValue:re,toUtf8:mc,fromBase64:yc,LazyJsonString:Vs,parseEpochTimestamp:Mg,parseRfc7231DateTime:Dg,parseRfc3339DateTimeWithOffset:Fg,generateIdempotencyToken:js,toBase64:wr,dateToUtcString:Sn,expectUnion:UF}=X(),{parseXML:Lg,XmlNode:xe,XmlText:Eg}=mg();class br{queryCompat;errorRegistry;constructor(t=!1){this.queryCompat=t}resolveRestContentType(t,r){let n=r.getMemberSchemas(),s=Object.values(n).find((o)=>!!o.getMergedTraits().httpPayload);if(s){let o=s.getMergedTraits().mediaType;if(o)return o;else if(s.isStringSchema())return"text/plain";else if(s.isBlobSchema())return"application/octet-stream";else return t}else if(!r.isUnitSchema()){if(Object.values(n).find((i)=>{let{httpQuery:u,httpQueryParams:a,httpHeader:d,httpLabel:l,httpPrefixHeaders:h}=i.getMergedTraits();return!u&&!a&&!d&&!l&&h===void 0}))return t}}async getErrorSchemaOrThrowBaseException(t,r,n,s,o,i){let u=t;if(t.includes("#"))[,u]=t.split("#");let a={$metadata:o,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:i?.(this.errorRegistry,u)??this.errorRegistry.getSchema(t),errorMetadata:a}}catch(d){s.message=s.message??s.Message??"UnknownError";let l=this.errorRegistry,h=l.getBaseException();if(h){let g=l.getErrorCtor(h)??Error;throw this.decorateServiceException(Object.assign(new g({name:u}),a),s)}let f=s,p=f?.message??f?.Message??f?.Error?.Message??f?.Error?.message;throw this.decorateServiceException(Object.assign(Error(p),{name:u},a),s)}}compose(t,r,n){let s=n;if(r.includes("#"))[s]=r.split("#");let o=yg.for(s),i=yg.for("smithy.ts.sdk.synthetic."+n);t.copyFrom(o),t.copyFrom(i),this.errorRegistry=t}decorateServiceException(t,r={}){if(this.queryCompat){let n=t.Message??r.Message,s=Sg(t,r);if(n)s.message=n;let o=s.Error??{};o.Type=s.Error?.Type,o.Code=s.Error?.Code,o.Message=s.Error?.message??s.Error?.Message??n,s.Error=o;let i=s.$metadata.requestId;if(i)s.RequestId=i;return s}return Sg(t,r)}setQueryCompatError(t,r){let n=r.headers?.["x-amzn-query-error"];if(t!==void 0&&n!=null){let[s,o]=n.split(";"),i=Object.keys(t),u={Code:s,Type:o};t.Code=s,t.Type=o;for(let a=0;a<i.length;a++){let d=i[a];u[d==="message"?"Message":d]=t[d]}delete u.__type,t.Error=u}}queryCompatOutput(t,r){if(t.Error)r.Error=t.Error;if(t.Type)r.Type=t.Type;if(t.Code)r.Code=t.Code}findQueryCompatibleError(t,r){try{return t.getSchema(r)}catch(n){return t.find((s)=>F.of(s).getMergedTraits().awsQueryError?.[0]===r)}}}class Ug extends DF{awsQueryCompatible;mixin;constructor({defaultNamespace:t,errorTypeRegistries:r,awsQueryCompatible:n}){super({defaultNamespace:t,errorTypeRegistries:r});this.awsQueryCompatible=!!n,this.mixin=new br(this.awsQueryCompatible)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(this.awsQueryCompatible)s.headers["x-amzn-query-mode"]="true";return s}async handleError(t,r,n,s,o){if(this.awsQueryCompatible)this.mixin.setQueryCompatError(s,n);let i=(()=>{let g=n.headers["x-amzn-query-error"];if(g&&this.awsQueryCompatible)return g.split(";")[0];return FF(n,s)??"Unknown"})();this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let{errorSchema:u,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),d=F.of(u),l=s.message??s.Message??"UnknownError",f=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({}),p={};for(let[g,m]of d.structIterator())if(s[g]!=null)p[g]=this.deserializer.readValue(m,s[g]);if(this.awsQueryCompatible)this.mixin.queryCompatOutput(s,p);throw this.mixin.decorateServiceException(Object.assign(f,a,{$fault:d.getMergedTraits().error,message:l},p),s)}}class Ie{serdeContext;setSerdeContext(t){this.serdeContext=t}}class Ws{from;to;keys;constructor(t,r){this.from=t,this.to=r;let n=Object.keys(this.from),s=new Set(n);s.delete("__type"),this.keys=s}mark(t){this.keys.delete(t)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){let t=this.keys.values().next().value,r=this.from[t];this.to.$unknown=[t,r]}}}var yn;function $g(){if(yn===void 0)try{if(typeof Buffer!=="function")yn=!1;else{let t=JSON.parse(Buffer.from([123,125]));yn=t!==null&&typeof t==="object"}}catch{yn=!1}return yn}function Sc(t,r,n){if(n?.source){let s=n.source;if(typeof r==="number")if(r<=Number.MAX_SAFE_INTEGER&&r>=Number.MIN_SAFE_INTEGER){if(BF(s,r))return r;return new re(s,"bigDecimal")}else{if($F(s))return new re(s,"bigDecimal");if(/[eE]/.test(s))return HF(s);return BigInt(s)}}return r}function $F(t){let r=t.indexOf(".");if(r===-1)return!1;let n=t.search(/[eE]/);if(n===-1)return!0;let s=n-r-1;return parseInt(t.slice(n+1),10)<s}function BF(t,r){if(t===String(r))return!0;if(Object.is(r,-0))return!0;if(/[eE]/.test(t))return fc(t)===fc(String(r));let n=t.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,""),s=String(r);if(n===s)return!0;if(/[eE]/.test(s))return n===fc(s);return!1}function fc(t){let r=t.startsWith("-"),n=r?t.slice(1):t,s=n.search(/[eE]/),o;if(s===-1)o=n;else{let i=parseInt(n.slice(s+1),10),u=n.slice(0,s),a=u.indexOf("."),d,l;if(a===-1)d=u,l=u.length;else d=u.slice(0,a)+u.slice(a+1),l=a;d=d.replace(/0+$/,"")||"0";let h=l+i;if(d==="0")o="0";else if(h<=0)o="0."+"0".repeat(-h)+d;else if(h>=d.length)o=d+"0".repeat(h-d.length);else o=d.slice(0,h)+"."+d.slice(h)}if(o.includes("."))o=o.replace(/(\.\d*?)0+$/,"$1").replace(/\.$/,"");return(r?"-":"")+o}function HF(t){let r=t.search(/[eE]/),n=parseInt(t.slice(r+1),10),s=t.startsWith("-"),o=t.slice(s?1:0,r),i=o.indexOf("."),u,a;if(i===-1)u=o,a=n;else{u=o.slice(0,i)+o.slice(i+1);let l=o.length-i-1;a=n-l}u=u.replace(/0+$/,"")||"0";let d=BigInt(u)*10n**BigInt(a+(o.replace(".","").length-u.length));return s?-d:d}var hc=Symbol.for("@aws-sdk/reviver");function wc(t){let r=F.of(t),n=r.getSchema();if(Array.isArray(n)&&r.isStructSchema()){if(hc in n)return n[hc];let s=zs(r,new Set);return n[hc]=s,s}return zs(r,new Set)}function zs(t,r){let n=t.getSchema();if(r.has(n))return!1;if(r.add(n),t.isBigIntegerSchema()||t.isBigDecimalSchema())return!0;if(t.isStructSchema()){for(let[,s]of t.structIterator())if(zs(s,r))return!0}else if(t.isListSchema()||t.isMapSchema()){if(zs(t.getValueSchema(),r))return!0}else if(t.isDocumentSchema())return!0;return!1}var Bg=(t,r)=>Hs(t,r).then((n)=>(r?.utf8Encoder??mc)(n));async function Gs(t,r,n){let s;if($g()&&typeof t?.[Symbol.asyncIterator]==="function"){let i=await Hs(t,r);if(typeof Buffer==="function")if(Buffer.isBuffer(i))s=i;else s=Buffer.from(i.buffer,i.byteOffset,i.byteLength)}if(!s)s=await Bg(t,r);if(s.length===0)return{};let o=n&&wc(n)?Sc:void 0;try{return JSON.parse(s,o)}catch(i){if(i?.name==="SyntaxError")Object.defineProperty(i,"$responseBodyText",{value:typeof s==="string"?s:s.toString("utf8")});throw i}}var zF=async(t,r)=>{let n=await Gs(t,r);return n.message=n.message??n.Message,n},bg=(t,r)=>Object.keys(t).find((n)=>n.toLowerCase()===r.toLowerCase()),pc=(t)=>{let r=t;if(typeof r==="number")r=r.toString();if(r.indexOf(",")>=0)r=r.split(",")[0];if(r.indexOf(":")>=0)r=r.split(":")[0];if(r.indexOf("#")>=0)r=r.split("#")[1];return r},Hg=(t,r)=>qg(t,r,["header","code","type"]),zg=(t,r,n=!1)=>qg(t,r,n?["code","header","type"]:["type","code","header"]),qg=({headers:t},r,n)=>{while(n.length>0)switch(n.shift()){case"header":let o=bg(t??{},"x-amzn-errortype");if(o!==void 0)return pc(t[o]);break;case"code":let i=bg(r??{},"code");if(i&&r[i]!==void 0)return pc(r[i]);break;case"type":if(r?.__type!==void 0)return pc(r.__type);break}};function lt(t){Object.defineProperty(t,"__proto__",{value:void 0,writable:!0,enumerable:!0,configurable:!0})}class Ec extends Ie{settings;constructor(t){super();this.settings=t}async read(t,r){let n=wc(t)?Sc:void 0,s;if(typeof r==="string"){if(r.length===0)return{};s=JSON.parse(r,n)}else if(r instanceof Uint8Array&&$g()){if(r.byteLength===0)return{};let o=Buffer.isBuffer(r)?r:Buffer.from(r.buffer,r.byteOffset,r.byteLength);s=JSON.parse(o,n)}else s=await Gs(r,this.serdeContext,t);return this._read(t,s)}readObject(t,r){return this._read(t,r)}_read(t,r){let n=r!==null&&typeof r==="object",s=F.of(t);if(n){if(s.isStructSchema())return this._readStruct(s,r);if(Array.isArray(r)&&s.isListSchema()){let i=s.getValueSchema();if(this.needsTransform(i))for(let u=0;u<r.length;++u)r[u]=this._read(i,r[u]);return r}if(s.isMapSchema()){let i=s.getValueSchema(),u=r;if(this.needsTransform(i))for(let a in u){if(a==="__proto__")lt(u);u[a]=this._read(i,u[a])}return u}}if(s.isBlobSchema()&&typeof r==="string")return yc(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r==="string"&&o){if(o==="application/json"||o.endsWith("+json"))return Vs.from(r);return r}if(s.isTimestampSchema()&&r!=null)switch(Er(s,this.settings)){case 5:return Fg(r);case 6:return Dg(r);case 7:return Mg(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(s.isBigIntegerSchema()&&(typeof r==="number"||typeof r==="string"))return BigInt(r);if(s.isBigDecimalSchema()&&r!=null){if(r instanceof re)return r;let i=r;if(i.type==="bigDecimal"&&"string"in i)return new re(i.string,i.type);return new re(String(r),"bigDecimal")}if(s.isNumericSchema()&&typeof r==="string"){switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return r}if(s.isDocumentSchema()){if(n)if(Array.isArray(r))for(let i=0;i<r.length;++i){let u=r[i];if(!(u instanceof re))r[i]=this._read(s,u)}else{let i=r;for(let u in i){if(u==="__proto__")lt(i);let a=i[u];if(!(a instanceof re))i[u]=this._read(s,a)}}}return r}_readStruct(t,r){let n=t.isUnionSchema(),s={},o,i=typeof r.__type==="string",{jsonName:u}=this.settings;if(u&&i)o={};let a;if(n)a=new Ws(r,s);for(let[d,l]of t.structIterator()){let h=d;if(u){if(h=l.getMergedTraits().jsonName??h,i)o[h]=d}if(n)a.mark(h);if(r[h]!=null)s[d]=this._read(l,r[h])}if(n)a.writeUnknown();else if(i)for(let d in r){let l=r[d],h=u?o[d]??d:d;if(!(h in s))s[h]=l}return s}needsTransform(t){if(t.isBlobSchema()||t.isTimestampSchema()||t.isBigIntegerSchema()||t.isBigDecimalSchema())return!0;if(t.isDocumentSchema()||t.isStructSchema()||t.isListSchema()||t.isMapSchema())return!0;if(t.isStringSchema()&&t.getMergedTraits().mediaType)return!0;return!1}}class qs extends Uint8Array{string=null;static allocUnsafe(t){if(typeof Buffer==="function"){let r=Buffer.allocUnsafe(t);return new qs(r.buffer,r.byteOffset,r.byteLength)}return new qs(t)}toString(){return this.s()}valueOf(){return this.s()}includes(t,r){if(typeof t==="string")return this.s().includes(t,r);return Uint8Array.prototype.includes.call(this,t,r)}indexOf(t,r){if(typeof t==="string")return this.s().indexOf(t,r);return Uint8Array.prototype.indexOf.call(this,t,r)}lastIndexOf(t,r){if(typeof t==="string")return this.s().lastIndexOf(t,r);let n=Uint8Array.prototype.lastIndexOf;if(r!==void 0)return n.call(this,t,r);return n.call(this,t)}startsWith(t,r){return this.s().startsWith(t,r)}endsWith(t,r){return this.s().endsWith(t,r)}match(t){return this.s().match(t)}replace(t,r){return this.s().replace(t,r)}search(t){return this.s().search(t)}split(t,r){return this.s().split(t,r)}substring(t,r){return this.s().substring(t,r)}trim(){return this.s().trim()}trimStart(){return this.s().trimStart()}trimEnd(){return this.s().trimEnd()}charAt(t){return this.s().charAt(t)}charCodeAt(t){return this.s().charCodeAt(t)}padStart(t,r){return this.s().padStart(t,r)}padEnd(t,r){return this.s().padEnd(t,r)}repeat(t){return this.s().repeat(t)}toUpperCase(){return this.s().toUpperCase()}toLowerCase(){return this.s().toLowerCase()}s(){if(this.string==null){let t=Date.now();if(t>_g+60000)console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. It has been automatically converted to string. In a future version this will throw an error."),_g=t;this.string=mc(this)}return this.string}}var _g=0,Us=new TextEncoder,Ag=123,xg=125,qF=91,VF=93,Sr=34,$s=58,Bs=44,Tg=92,jF=new Uint8Array([116,114,117,101]),WF=new Uint8Array([102,97,108,115,101]),GF=new Uint8Array([110,117,108,108]),qe=Array(128).fill(null);qe[8]="b";qe[9]="t";qe[10]="n";qe[12]="f";qe[13]="r";qe[34]='"';qe[92]="\\";for(let t=0;t<32;t++)if(qe[t]===null)qe[t]="u00"+t.toString(16).padStart(2,"0");var Cg=2048;function gc(t){return qs.allocUnsafe(t)}class Ks extends Ie{settings;json;i=0;rootSchema;rawValue;passthrough=!1;constructor(t){super();this.settings=t,this.json=gc(Cg)}write(t,r){if(this.i=0,this.rawValue=r,this.rootSchema=F.of(t),this.passthrough=this.rootSchema.isBlobSchema()||this.rootSchema.isStringSchema(),!this.passthrough)this.writeValue(this.rootSchema,r,void 0)}writeDiscriminatedDocument(t,r){this.i=0,this.rootSchema=F.of(t);let n=this.rootSchema;if(n.isStructSchema()&&r!=null&&typeof r==="object"){this.writeValue(n,r,void 0);let s=`"__type":"${n.getName(!0)??"Unknown"}",`,o=s.length;this.ensure(o),this.json.copyWithin(1+o,1,this.i),Us.encodeInto(s,this.json.subarray(1)),this.i+=o}else this.writeValue(n,r,void 0)}flush(){this.rootSchema=void 0;let t=this.i;this.i=0;let r=this.rawValue;if(this.rawValue=void 0,t===0)return r;let n=this.json.subarray(0,t);return this.json=gc(Cg),n}ensure(t){let{i:r,json:n}=this;if(r+t>n.length){let s=n.length*2;while(s<r+t)s*=2;let o=gc(s);o.set(this.json),this.json=o}}writeAscii(t){let r=t.length;this.ensure(r);let{i:n,json:s}=this;for(let o=0;o<r;++o)s[n]=t.charCodeAt(o),n+=1;this.i=n}writeAsciiQuoted(t){let r=t.length;this.ensure(r+4);let{json:n,i:s}=this;n[s++]=Sr;for(let o=0;o<r;++o)n[s++]=t.charCodeAt(o);n[s++]=Sr,this.i=s}writeJsonString(t){this.ensure(t.length*3+2),this.json[this.i++]=Sr;let r=t.length;for(let n=0;n<r;++n){let s=t.charCodeAt(n);if(s>34&&s<92)this.json[this.i++]=s;else if(s<128){let o=qe[s];if(o!==null){this.ensure(o.length+1),this.json[this.i++]=Tg;for(let i=0;i<o.length;i++)this.json[this.i++]=o.charCodeAt(i)}else this.json[this.i++]=s}else if(s>=55296&&s<=56319){let o=n+1<r?t.charCodeAt(n+1):0;if(o>=56320&&o<=57343){this.ensure(4);let{written:i}=Us.encodeInto(t.substring(n,n+2),this.json.subarray(this.i));this.i+=i,++n}else this.ensure(6),this.writeUnicodeEscape(s)}else if(s>=56320&&s<=57343)this.ensure(6),this.writeUnicodeEscape(s);else{let{i:o,json:i}=this;if(s<2048)i[o++]=192|s>>6,i[o++]=128|s&63;else i[o++]=224|s>>12,i[o++]=128|s>>6&63,i[o++]=128|s&63;this.i=o}}this.json[this.i++]=Sr}writeUnicodeEscape(t){let{json:r,i:n}=this;r[n++]=Tg,r[n++]=117;let s=t.toString(16).padStart(4,"0");for(let o=0;o<4;++o)r[n++]=s.charCodeAt(o);this.i=n}static B64=(()=>{let r=new Uint8Array(64);for(let n=0;n<64;++n)r[n]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(n);return r})();writeBase64(t){let r=Math.ceil(t.length/3)*4;this.ensure(r+2);let n=this.json,s=Ks.B64,o=this.i;n[o++]=Sr;let i=t.length,u=i%3,a=i-u;for(let d=0;d<a;d+=3){let l=t[d],h=t[d+1],f=t[d+2];n[o++]=s[l>>2],n[o++]=s[(l&3)<<4|h>>4],n[o++]=s[(h&15)<<2|f>>6],n[o++]=s[f&63]}if(u===2){let d=t[a],l=t[a+1];n[o++]=s[d>>2],n[o++]=s[(d&3)<<4|l>>4],n[o++]=s[(l&15)<<2],n[o++]=61}else if(u===1){let d=t[a];n[o++]=s[d>>2],n[o++]=s[(d&3)<<4],n[o++]=61,n[o++]=61}n[o++]=Sr,this.i=o}writeValue(t,r,n){if(r==null){if(n?.isStructSchema()){if(r===void 0){if(F.of(t).isIdempotencyToken()){this.writeAsciiQuoted(js());return}}return}this.ensure(4),this.json.set(GF,this.i),this.i+=4;return}let s=F.of(t),o=typeof r==="object";if(s.isStringSchema()){let i=s.getMergedTraits().mediaType;if(i){if(i==="application/json"||i.endsWith("+json")){this.writeJsonString(Vs.from(r).toString());return}}}if(o){if(s.isStructSchema()){this.writeStruct(s,r);return}if(Array.isArray(r)&&(s.isListSchema()||s.isDocumentSchema())){this.writeList(s,r,s.isDocumentSchema());return}if(s.isMapSchema()){this.writeMap(s,r,!1);return}if(r instanceof Uint8Array&&(s.isBlobSchema()||s.isDocumentSchema())){this.writeBase64(r);return}if(r instanceof Date&&(s.isTimestampSchema()||s.isDocumentSchema())){this.writeTimestamp(s,r);return}if(r instanceof re){this.writeAscii(r.string);return}if(s.isDocumentSchema()){if(Array.isArray(r))this.writeList(s,r,!0);else this.writeMap(s,r,!0);return}let i=JSON.stringify(r);this.writeAscii(i);return}if(typeof r==="string"){if(s.isBlobSchema()){let i=(this.serdeContext?.base64Encoder??wr)(r);this.writeAsciiQuoted(i);return}this.writeJsonString(r);return}if(typeof r==="number"){if(Math.abs(r)===1/0||Number.isNaN(r)){this.writeAsciiQuoted(String(r));return}let i=String(r);this.writeAscii(i);return}if(typeof r==="boolean"){this.ensure(5);let{i,json:u}=this;if(r)u.set(jF,i),i+=4;else u.set(WF,i),i+=5;this.i=i;return}if(typeof r==="bigint"){this.writeAscii(r.toString());return}this.writeAscii(String(r))}writeStruct(t,r){this.ensure(2),this.json[this.i++]=Ag;let n=!1,s=typeof r.__type==="string",o;if(s)o=new Set;for(let[i,u]of t.structIterator()){let a=r[i];if(a==null&&!u.isIdempotencyToken())continue;if(n)this.ensure(1),this.json[this.i++]=Bs;n=!0;let d=this.settings.jsonName?u.getMergedTraits().jsonName??i:i;if(o)o.add(i),o.add(d);this.writeAsciiQuoted(d),this.json[this.i++]=$s,this.writeValue(u,a,t)}if(!n&&t.isUnionSchema()){let{$unknown:i}=r;if(Array.isArray(i)){let[u,a]=i;this.writeAsciiQuoted(u),this.ensure(1),this.json[this.i++]=$s,this.writeValue(15,a,t)}}else if(s)for(let i in r){if(o.has(i))continue;o.add(i);let u=r[i];if(n)this.ensure(1),this.json[this.i++]=Bs;n=!0,this.writeAsciiQuoted(i),this.ensure(1),this.json[this.i++]=$s,this.writeValue(15,u,void 0)}this.ensure(1),this.json[this.i++]=xg}writeList(t,r,n){let s=!!t.getMergedTraits().sparse,o=t.getValueSchema();if(!n){if(o.isStringSchema()||o.isNumericSchema()||o.isBooleanSchema()){let u=!1;for(let d=0;d<r.length;++d){let l=r[d];if(Number.isNaN(l)||l===1/0||l===-1/0||l==null&&!s){u=!0;break}}let a;if(!u)a=JSON.stringify(r);else{let d=[];for(let l=0;l<r.length;++l){let h=r[l];if(h==null&&!s)continue;if(Number.isNaN(h)||h===1/0||h===-1/0)d.push(String(h));else d.push(h)}a=JSON.stringify(d)}this.ensure(a.length*3),this.i+=Us.encodeInto(a,this.json.subarray(this.i)).written;return}}this.ensure(2),this.json[this.i++]=qF;let i=!1;for(let u=0;u<r.length;++u){let a=r[u];if(n?a===void 0:a==null&&!s)continue;if(i)this.ensure(1),this.json[this.i++]=Bs;this.writeValue(o,a,void 0),i=!0}this.ensure(1),this.json[this.i++]=VF}writeMap(t,r,n){let s=!!t.getMergedTraits().sparse,o=t.getValueSchema();if(!n){if(o.isStringSchema()||o.isNumericSchema()||o.isBooleanSchema()){let u;for(let d in r){let l=r[d];if(Number.isNaN(l)||l===1/0||l===-1/0)(u??={})[d]=l,r[d]=String(l);else if(l===null&&!s)(u??={})[d]=null,r[d]=void 0}let a=JSON.stringify(r);if(u)Object.assign(r,u);this.ensure(a.length*3),this.i+=Us.encodeInto(a,this.json.subarray(this.i)).written;return}}this.ensure(2),this.json[this.i++]=Ag;let i=!0;for(let u in r){let a=r[u];if(n?a===void 0:a==null&&!s)continue;if(!i)this.ensure(1),this.json[this.i++]=Bs;i=!1,this.writeJsonString(u),this.ensure(1),this.json[this.i++]=$s,this.writeValue(o,a,void 0)}this.ensure(1),this.json[this.i++]=xg}writeTimestamp(t,r){switch(Er(t,this.settings)){case 5:{let s=r.toISOString().replace(".000Z","Z");this.writeAsciiQuoted(s);return}case 6:{this.writeAsciiQuoted(Sn(r));return}case 7:{let s=String(r.getTime()/1000);this.writeAscii(s);return}default:{let s=String(r.getTime()/1000);this.writeAscii(s);return}}}}class Qs extends Ie{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Ks(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new Ec(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Xs extends Ng{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r});this.serviceTarget=n,this.codec=o??new Qs({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!s,this.mixin=new br(this.awsQueryCompatible)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(!s.path.endsWith("/"))s.path+="/";if(s.headers["content-type"]=`application/x-amz-json-${this.getJsonRpcVersion()}`,s.headers["x-amz-target"]=`${this.serviceTarget}.${t.name}`,this.awsQueryCompatible)s.headers["x-amzn-query-mode"]="true";if(Rg(t.input)==="unit"||!s.body)s.body="{}";return s}getPayloadCodec(){return this.codec}async handleError(t,r,n,s,o){let{awsQueryCompatible:i}=this;if(i)this.mixin.setQueryCompatError(s,n);let u=zg(n,s,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,u,this.options.defaultNamespace);let{errorSchema:a,errorMetadata:d}=await this.mixin.getErrorSchemaOrThrowBaseException(u,this.options.defaultNamespace,n,s,o,i?this.mixin.findQueryCompatibleError:void 0),l=F.of(a),h=s.message??s.Message??"UnknownError",p=new(this.compositeErrorRegistry.getErrorCtor(a)??Error)({}),g={},m=this.codec.createDeserializer();for(let[y,S]of l.structIterator())if(s[y]!=null)g[y]=m.readObject(S,s[y]);if(i)this.mixin.queryCompatOutput(s,g);throw this.mixin.decorateServiceException(Object.assign(p,d,{$fault:l.getMergedTraits().error,message:h},g),s)}}class Vg extends Xs{constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o})}getShapeId(){return"aws.protocols#awsJson1_0"}getJsonRpcVersion(){return"1.0"}getDefaultContentType(){return"application/x-amz-json-1.0"}}class jg extends Xs{constructor({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o}){super({defaultNamespace:t,errorTypeRegistries:r,serviceTarget:n,awsQueryCompatible:s,jsonCodec:o})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}class Wg extends Og{serializer;deserializer;codec;mixin=new br;constructor({defaultNamespace:t,errorTypeRegistries:r,jsonCodec:n}){super({defaultNamespace:t,errorTypeRegistries:r});let s={timestampFormat:{useTrait:!0,default:7},httpBindings:!0,jsonName:!0};this.codec=n??new Qs(s),this.serializer=new Pg(this.codec.createSerializer(),s),this.deserializer=new kg(this.codec.createDeserializer(),s)}getShapeId(){return"aws.protocols#restJson1"}getPayloadCodec(){return this.codec}setSerdeContext(t){this.codec.setSerdeContext(t),super.setSerdeContext(t)}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n),o=F.of(t.input);if(!s.headers["content-type"]){let i=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);if(i)s.headers["content-type"]=i}if(s.body==null&&s.headers["content-type"]===this.getDefaultContentType())s.body="{}";return s}async deserializeResponse(t,r,n){let s=await super.deserializeResponse(t,r,n),o=F.of(t.output);for(let[i,u]of o.structIterator())if(u.getMemberTraits().httpPayload&&!(i in s))s[i]=null;return s}async handleError(t,r,n,s,o){let i=Hg(n,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let{errorSchema:u,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o),d=F.of(u),l=s.message??s.Message??"UnknownError",f=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({});await this.deserializeHttpMessage(u,r,n,s);let p={},g=this.codec.createDeserializer();for(let[m,y]of d.structIterator()){let S=y.getMergedTraits().jsonName??m;p[m]=g.readObject(y,s[S])}throw this.mixin.decorateServiceException(Object.assign(f,a,{$fault:d.getMergedTraits().error,message:l},p),s)}getDefaultContentType(){return"application/json"}}class bc extends Ie{settings;constructor(t){super();this.settings=t}async read(t,r){let n=wc(t)?Sc:void 0;return this._read(t,typeof r==="string"?JSON.parse(r,n):await Gs(r,this.serdeContext,t))}readObject(t,r){return this._read(t,r)}_read(t,r){let n=r!==null&&typeof r==="object",s=F.of(t);if(n){if(s.isStructSchema()){let i=r,u=s.isUnionSchema(),a={},d=void 0,{jsonName:l}=this.settings;if(l)d={};let h;if(u)h=new Ws(i,a);for(let[f,p]of s.structIterator()){let g=f;if(l)g=p.getMergedTraits().jsonName??g,d[g]=f;if(u)h.mark(g);if(i[g]!=null)a[f]=this._read(p,i[g])}if(u)h.writeUnknown();else if(typeof i.__type==="string")for(let f in i){let p=i[f],g=l?d[f]??f:f;if(!(g in a))a[g]=p}return a}if(Array.isArray(r)&&s.isListSchema()){let i=s.getValueSchema(),u=[];for(let a of r)u.push(this._read(i,a));return u}if(s.isMapSchema()){let i=s.getValueSchema(),u={};for(let a in r){if(a==="__proto__")lt(u);u[a]=this._read(i,r[a])}return u}}if(s.isBlobSchema()&&typeof r==="string")return yc(r);let o=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof r==="string"&&o){if(o==="application/json"||o.endsWith("+json"))return Vs.from(r);return r}if(s.isTimestampSchema()&&r!=null)switch(Er(s,this.settings)){case 5:return Fg(r);case 6:return Dg(r);case 7:return Mg(r);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",r),new Date(r)}if(s.isBigIntegerSchema()&&(typeof r==="number"||typeof r==="string"))return BigInt(r);if(s.isBigDecimalSchema()&&r!=null){if(r instanceof re)return r;let i=r;if(i.type==="bigDecimal"&&"string"in i)return new re(i.string,i.type);return new re(String(r),"bigDecimal")}if(s.isNumericSchema()&&typeof r==="string"){switch(r){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return r}if(s.isDocumentSchema())if(n){let i=Array.isArray(r)?[]:{};for(let u in r){if(u==="__proto__")lt(i);let a=r[u];if(a instanceof re)i[u]=a;else i[u]=this._read(s,a)}return i}else return structuredClone(r);return r}}var Ig=String.fromCharCode(925);class Gg{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,r)=>{if(r instanceof re){let n=`${Ig+"nv"+this.counter++}_`+r.string;return this.values.set(`"${n}"`,r.string),n}if(typeof r==="bigint"){let n=r.toString(),s=`${Ig+"b"+this.counter++}_`+n;return this.values.set(`"${s}"`,n),s}return r}}replaceInJson(t){if(this.stage===0)throw Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(let[r,n]of this.values)t=t.replace(r,n);return t}}class _c extends Ie{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super();this.settings=t}write(t,r){this.rootSchema=F.of(t),this.buffer=this._write(this.rootSchema,r)}flush(){let{rootSchema:t,useReplacer:r}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!r)return JSON.stringify(this.buffer);let n=new Gg;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}writeDiscriminatedDocument(t,r){if(this.write(t,r),typeof this.buffer==="object")this.buffer.__type=F.of(t).getName(!0)}_write(t,r,n){let s=r!==null&&typeof r==="object",o=F.of(t);if(s){if(o.isStructSchema()){let i=r,u={},{jsonName:a}=this.settings,d=void 0;if(a)d={};let l=0;for(let[h,f]of o.structIterator()){let p=this._write(f,i[h],o);if(p!==void 0){let g=h;if(a)g=f.getMergedTraits().jsonName??h,d[h]=g;u[g]=p,l++}}if(o.isUnionSchema()&&l===0){let{$unknown:h}=i;if(Array.isArray(h)){let[f,p]=h;if(f==="__proto__")lt(u);u[f]=this._write(15,p)}}else if(typeof i.__type==="string")for(let h in i){let f=i[h],p=a?d[h]??h:h;if(!(p in u))u[p]=this._write(15,f)}return u}if(Array.isArray(r)&&o.isListSchema()){let i=o.getValueSchema(),u=[],a=!!o.getMergedTraits().sparse;for(let d of r)if(a||d!=null)u.push(this._write(i,d));return u}if(o.isMapSchema()){let i=o.getValueSchema(),u={},a=!!o.getMergedTraits().sparse;for(let d in r){let l=r[d];if(a||l!=null){if(d==="__proto__")lt(u);u[d]=this._write(i,l)}}return u}if(r instanceof Uint8Array&&o.isBlobSchema()){if(o===this.rootSchema)return r;return(this.serdeContext?.base64Encoder??wr)(r)}if(r instanceof Date&&(o.isTimestampSchema()||o.isDocumentSchema()))switch(Er(o,this.settings)){case 5:return r.toISOString().replace(".000Z","Z");case 6:return Sn(r);case 7:return r.getTime()/1000;default:return console.warn("Missing timestamp format, using epoch seconds",r),r.getTime()/1000}if(r instanceof re)this.useReplacer=!0}if(r===null&&n?.isStructSchema())return;if(o.isStringSchema()){if(typeof r>"u"&&o.isIdempotencyToken())return js();let i=o.getMergedTraits().mediaType;if(r!=null&&i){if(i==="application/json"||i.endsWith("+json"))return Vs.from(r)}return r}if(typeof r==="number"){if(Math.abs(r)===1/0||isNaN(r))return String(r);return r}if(typeof r==="string"&&o.isBlobSchema()){if(o===this.rootSchema)return r;return(this.serdeContext?.base64Encoder??wr)(r)}if(typeof r==="bigint")this.useReplacer=!0;if(o.isDocumentSchema())if(s){if(r instanceof Uint8Array)return(this.serdeContext?.base64Encoder??wr)(r);let i=Array.isArray(r)?[]:{};for(let u in r){let a=r[u];if(u==="__proto__")lt(i);if(a instanceof re)this.useReplacer=!0,i[u]=a;else i[u]=this._write(o,a)}return i}else return structuredClone(r);return r}}class Kg extends Ie{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new _c(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new bc(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Ys extends Ie{settings;stringDeserializer;constructor(t){super();this.settings=t,this.stringDeserializer=new LF(t)}setSerdeContext(t){this.serdeContext=t,this.stringDeserializer.setSerdeContext(t)}read(t,r,n){let s=F.of(t),o=s.getMemberSchemas();if(s.isStructSchema()&&s.isMemberSchema()&&!!Object.values(o).find((d)=>!!d.getMemberTraits().eventPayload)){let d={},l=Object.keys(o)[0];if(o[l].isBlobSchema())d[l]=r;else d[l]=this.read(o[l],r);return d}let u=(this.serdeContext?.utf8Encoder??mc)(r),a=this.parseXml(u);return this.readSchema(t,n?a[n]:a)}readSchema(t,r){let n=F.of(t);if(n.isUnitSchema())return;let s=n.getMergedTraits();if(n.isListSchema()&&!Array.isArray(r))return this.readSchema(n,[r]);if(r==null)return r;if(typeof r==="object"){let o=!!s.xmlFlattened;if(n.isListSchema()){let u=n.getValueSchema(),a=[],d=u.getMergedTraits().xmlName??"member",l=o?r:(r[0]??r)[d];if(l==null)return a;let h=Array.isArray(l)?l:[l];for(let f of h)a.push(this.readSchema(u,f));return a}let i={};if(n.isMapSchema()){let u=n.getKeySchema(),a=n.getValueSchema(),d;if(o)d=Array.isArray(r)?r:[r];else d=Array.isArray(r.entry)?r.entry:[r.entry];let l=u.getMergedTraits().xmlName??"key",h=a.getMergedTraits().xmlName??"value";for(let f of d){let p=f[l],g=f[h];if(p==="__proto__")lt(i);i[p]=this.readSchema(a,g)}return i}if(n.isStructSchema()){let u=n.isUnionSchema(),a;if(u)a=new Ws(r,i);for(let[d,l]of n.structIterator()){let h=l.getMergedTraits(),f=!h.httpPayload?l.getMemberTraits().xmlName??d:h.xmlName??l.getName();if(u)a.mark(f);if(r[f]!=null)i[d]=this.readSchema(l,r[f])}if(u)a.writeUnknown();return i}if(n.isDocumentSchema())return r;throw Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${n.getName(!0)}`)}if(n.isListSchema())return[];if(n.isMapSchema()||n.isStructSchema())return{};return this.stringDeserializer.read(n,r)}parseXml(t){if(t.length){let r;try{r=Lg(t)}catch(i){if(i&&typeof i==="object")Object.defineProperty(i,"$responseBodyText",{value:t});throw i}let n="#text",s=Object.keys(r)[0],o=r[s];if(o[n])o[s]=o[n],delete o[n];return vg(o)}return{}}}class Ac extends Ie{settings;buffer;constructor(t){super();this.settings=t}write(t,r,n=""){if(this.buffer===void 0)this.buffer="";let s=F.of(t);if(n&&!n.endsWith("."))n+=".";if(s.isBlobSchema()){if(typeof r==="string"||r instanceof Uint8Array)this.writeKey(n),this.writeValue((this.serdeContext?.base64Encoder??wr)(r))}else if(s.isBooleanSchema()||s.isNumericSchema()||s.isStringSchema()){if(r!=null)this.writeKey(n),this.writeValue(String(r));else if(s.isIdempotencyToken())this.writeKey(n),this.writeValue(js())}else if(s.isBigIntegerSchema()){if(r!=null)this.writeKey(n),this.writeValue(String(r))}else if(s.isBigDecimalSchema()){if(r!=null)this.writeKey(n),this.writeValue(r instanceof re?r.string:String(r))}else if(s.isTimestampSchema()){if(r instanceof Date)switch(this.writeKey(n),Er(s,this.settings)){case 5:this.writeValue(r.toISOString().replace(".000Z","Z"));break;case 6:this.writeValue(Sn(r));break;case 7:this.writeValue(String(r.getTime()/1000));break}}else if(s.isDocumentSchema())if(Array.isArray(r))this.write(79,r,n);else if(r instanceof Date)this.write(4,r,n);else if(r instanceof Uint8Array)this.write(21,r,n);else if(r&&typeof r==="object")this.write(143,r,n);else this.writeKey(n),this.writeValue(String(r));else if(s.isListSchema()){if(Array.isArray(r))if(r.length===0){if(this.settings.serializeEmptyLists)this.writeKey(n),this.writeValue("")}else{let o=s.getValueSchema(),i=this.settings.flattenLists||s.getMergedTraits().xmlFlattened,u=1;for(let a of r){if(a==null)continue;let d=o.getMergedTraits(),l=this.getKey("member",d.xmlName,d.ec2QueryName),h=i?`${n}${u}`:`${n}${l}.${u}`;this.write(o,a,h),++u}}}else if(s.isMapSchema()){if(r&&typeof r==="object"){let o=s.getKeySchema(),i=s.getValueSchema(),u=s.getMergedTraits().xmlFlattened,a=1;for(let d in r){let l=r[d];if(l==null)continue;let h=o.getMergedTraits(),f=this.getKey("key",h.xmlName,h.ec2QueryName),p=u?`${n}${a}.${f}`:`${n}entry.${a}.${f}`,g=i.getMergedTraits(),m=this.getKey("value",g.xmlName,g.ec2QueryName),y=u?`${n}${a}.${m}`:`${n}entry.${a}.${m}`;this.write(o,d,p),this.write(i,l,y),++a}}}else if(s.isStructSchema()){if(r&&typeof r==="object"){let o=!1;for(let[i,u]of s.structIterator()){if(r[i]==null&&!u.isIdempotencyToken())continue;let a=u.getMergedTraits(),d=this.getKey(i,a.xmlName,a.ec2QueryName,"struct"),l=`${n}${d}`;this.write(u,r[i],l),o=!0}if(!o&&s.isUnionSchema()){let{$unknown:i}=r;if(Array.isArray(i)){let[u,a]=i,d=`${n}${u}`;this.write(15,a,d)}}}}else if(s.isUnitSchema());else throw Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${s.getName(!0)}`)}flush(){if(this.buffer===void 0)throw Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");let t=this.buffer;return delete this.buffer,t}getKey(t,r,n,s){let{ec2:o,capitalizeKeys:i}=this.settings;if(o&&n)return n;let u=r??t;if(i&&s==="struct")return u[0].toUpperCase()+u.slice(1);return u}writeKey(t){if(t.endsWith("."))t=t.slice(0,t.length-1);this.buffer+=`&${wg(t)}=`}writeValue(t){this.buffer+=wg(t)}}class xc extends Ng{options;serializer;deserializer;mixin=new br;constructor(t){super({defaultNamespace:t.defaultNamespace,errorTypeRegistries:t.errorTypeRegistries});this.options=t;let r={timestampFormat:{useTrait:!0,default:5},httpBindings:!1,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace,serializeEmptyLists:!0};this.serializer=new Ac(r),this.deserializer=new Ys(r)}getShapeId(){return"aws.protocols#awsQuery"}setSerdeContext(t){this.serializer.setSerdeContext(t),this.deserializer.setSerdeContext(t)}getPayloadCodec(){throw Error("AWSQuery protocol has no payload codec.")}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n);if(!s.path.endsWith("/"))s.path+="/";if(s.headers["content-type"]="application/x-www-form-urlencoded",Rg(t.input)==="unit"||!s.body)s.body="";let o=t.name.split("#")[1]??t.name;if(s.body=`Action=${o}&Version=${this.options.version}`+s.body,s.body.endsWith("&"))s.body=s.body.slice(-1);return s}async deserializeResponse(t,r,n){let s=this.deserializer,o=F.of(t.output),i={};if(n.statusCode>=300){let l=await Hs(n.body,r);if(l.byteLength>0)Object.assign(i,await s.read(15,l));await this.handleError(t,r,n,i,this.deserializeMetadata(n))}for(let l in n.headers){let h=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=h}let u=t.name.split("#")[1]??t.name,a=o.isStructSchema()&&this.useNestedResult()?u+"Result":void 0,d=await Hs(n.body,r);if(d.byteLength>0)Object.assign(i,await s.read(o,d,a));return i.$metadata=this.deserializeMetadata(n),i}useNestedResult(){return!0}async handleError(t,r,n,s,o){let i=this.loadQueryErrorCode(n,s)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace);let u=this.loadQueryError(s)??{},a=this.loadQueryErrorMessage(s);u.message=a,u.Error={Type:u.Type,Code:u.Code,Message:a};let{errorSchema:d,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,u,o,this.mixin.findQueryCompatibleError),h=F.of(d),p=new(this.compositeErrorRegistry.getErrorCtor(d)??Error)({}),g={Type:u.Error.Type,Code:u.Error.Code,Error:u.Error};for(let[m,y]of h.structIterator()){let S=y.getMergedTraits().xmlName??m,w=u[S]??s[S];g[m]=this.deserializer.readSchema(y,w)}throw this.mixin.decorateServiceException(Object.assign(p,l,{$fault:h.getMergedTraits().error,message:a},g),s)}loadQueryErrorCode(t,r){let n=(r.Errors?.[0]?.Error??r.Errors?.Error??r.Error)?.Code;if(n!==void 0)return n;if(t.statusCode==404)return"NotFound"}loadQueryError(t){return t.Errors?.[0]?.Error??t.Errors?.Error??t.Error}loadQueryErrorMessage(t){let r=this.loadQueryError(t);return r?.message??r?.Message??t.message??t.Message??"Unknown"}getDefaultContentType(){return"application/x-www-form-urlencoded"}}class Qg extends xc{options;constructor(t){super(t);this.options=t;let r={capitalizeKeys:!0,flattenLists:!0,serializeEmptyLists:!1,ec2:!0};Object.assign(this.serializer.settings,r)}getShapeId(){return"aws.protocols#ec2Query"}useNestedResult(){return!1}}var Xg=(t,r)=>Bg(t,r).then((n)=>{if(n.length){let s;try{s=Lg(n)}catch(a){if(a&&typeof a==="object")Object.defineProperty(a,"$responseBodyText",{value:n});throw a}let o="#text",i=Object.keys(s)[0],u=s[i];if(u[o])u[i]=u[o],delete u[o];return vg(u)}return{}}),KF=async(t,r)=>{let n=await Xg(t,r);if(n.Error)n.Error.message=n.Error.message??n.Error.Message;return n},Yg=(t,r)=>{if(r?.Error?.Code!==void 0)return r.Error.Code;if(r?.Code!==void 0)return r.Code;if(t.statusCode==404)return"NotFound"};class Tc extends Ie{settings;stringBuffer;byteBuffer;buffer;constructor(t){super();this.settings=t}write(t,r){let n=F.of(t);if(n.isStringSchema()&&typeof r==="string")this.stringBuffer=r;else if(n.isBlobSchema())this.byteBuffer="byteLength"in r?r:(this.serdeContext?.base64Decoder??yc)(r);else{this.buffer=this.writeStruct(n,r,void 0);let s=n.getMergedTraits();if(s.httpPayload&&!s.xmlName)this.buffer.withName(n.getName())}}flush(){if(this.byteBuffer!==void 0){let r=this.byteBuffer;return delete this.byteBuffer,r}if(this.stringBuffer!==void 0){let r=this.stringBuffer;return delete this.stringBuffer,r}let t=this.buffer;if(this.settings.xmlNamespace){if(!t?.attributes?.xmlns)t.addAttribute("xmlns",this.settings.xmlNamespace)}return delete this.buffer,t.toString()}writeStruct(t,r,n){let s=t.getMergedTraits(),o=t.isMemberSchema()&&!s.httpPayload?t.getMemberTraits().xmlName??t.getMemberName():s.xmlName??t.getName();if(!o||!t.isStructSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${t.getName(!0)}.`);let i=xe.of(o),[u,a]=this.getXmlnsAttribute(t,n);for(let[l,h]of t.structIterator()){let f=r[l];if(f!=null||h.isIdempotencyToken()){if(h.getMergedTraits().xmlAttribute){i.addAttribute(h.getMergedTraits().xmlName??l,this.writeSimple(h,f));continue}if(h.isListSchema())this.writeList(h,f,i,a);else if(h.isMapSchema())this.writeMap(h,f,i,a);else if(h.isStructSchema())i.addChildNode(this.writeStruct(h,f,a));else{let p=xe.of(h.getMergedTraits().xmlName??h.getMemberName());this.writeSimpleInto(h,f,p,a),i.addChildNode(p)}}}let{$unknown:d}=r;if(d&&t.isUnionSchema()&&Array.isArray(d)&&Object.keys(r).length===1){let[l,h]=d,f=xe.of(l);if(typeof h!=="string")if(r instanceof xe||r instanceof Eg)i.addChildNode(r);else throw Error("@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.");this.writeSimpleInto(0,h,f,a),i.addChildNode(f)}if(a)i.addAttribute(u,a);return i}writeList(t,r,n,s){if(!t.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${t.getName(!0)}`);let o=t.getMergedTraits(),i=t.getValueSchema(),u=i.getMergedTraits(),a=!!u.sparse,d=!!o.xmlFlattened,[l,h]=this.getXmlnsAttribute(t,s),f=(p,g)=>{if(i.isListSchema())this.writeList(i,Array.isArray(g)?g:[g],p,h);else if(i.isMapSchema())this.writeMap(i,g,p,h);else if(i.isStructSchema()){let m=this.writeStruct(i,g,h);p.addChildNode(m.withName(d?o.xmlName??t.getMemberName():u.xmlName??"member"))}else{let m=xe.of(d?o.xmlName??t.getMemberName():u.xmlName??"member");this.writeSimpleInto(i,g,m,h),p.addChildNode(m)}};if(d){for(let p of r)if(a||p!=null)f(n,p)}else{let p=xe.of(o.xmlName??t.getMemberName());if(h)p.addAttribute(l,h);for(let g of r)if(a||g!=null)f(p,g);n.addChildNode(p)}}writeMap(t,r,n,s,o=!1){if(!t.isMemberSchema())throw Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${t.getName(!0)}`);let i=t.getMergedTraits(),u=t.getKeySchema(),d=u.getMergedTraits().xmlName??"key",l=t.getValueSchema(),h=l.getMergedTraits(),f=h.xmlName??"value",p=!!h.sparse,g=!!i.xmlFlattened,[m,y]=this.getXmlnsAttribute(t,s),S=(w,E,A)=>{let v=xe.of(d,E),[L,k]=this.getXmlnsAttribute(u,y);if(k)v.addAttribute(L,k);w.addChildNode(v);let U=xe.of(f);if(l.isListSchema())this.writeList(l,A,U,y);else if(l.isMapSchema())this.writeMap(l,A,U,y,!0);else if(l.isStructSchema())U=this.writeStruct(l,A,y);else this.writeSimpleInto(l,A,U,y);w.addChildNode(U)};if(g)for(let w in r){let E=r[w];if(p||E!=null){let A=xe.of(i.xmlName??t.getMemberName());S(A,w,E),n.addChildNode(A)}}else{let w;if(!o){if(w=xe.of(i.xmlName??t.getMemberName()),y)w.addAttribute(m,y);n.addChildNode(w)}for(let E in r){let A=r[E];if(p||A!=null){let v=xe.of("entry");S(v,E,A),(o?n:w).addChildNode(v)}}}}writeSimple(t,r){if(r===null)throw Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");let n=F.of(t),s=null;if(r&&typeof r==="object")if(n.isBlobSchema())s=(this.serdeContext?.base64Encoder??wr)(r);else if(n.isTimestampSchema()&&r instanceof Date)switch(Er(n,this.settings)){case 5:s=r.toISOString().replace(".000Z","Z");break;case 6:s=Sn(r);break;case 7:s=String(r.getTime()/1000);break;default:console.warn("Missing timestamp format, using http date",r),s=Sn(r);break}else if(n.isBigDecimalSchema()&&r){if(r instanceof re)return r.string;return String(r)}else if(n.isMapSchema()||n.isListSchema())throw Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.");else throw Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${n.getName(!0)}`);if(n.isBooleanSchema()||n.isNumericSchema()||n.isBigIntegerSchema()||n.isBigDecimalSchema())s=String(r);if(n.isStringSchema())if(r===void 0&&n.isIdempotencyToken())s=js();else s=String(r);if(s===null)throw Error(`Unhandled schema-value pair ${n.getName(!0)}=${r}`);return s}writeSimpleInto(t,r,n,s){let o=this.writeSimple(t,r),i=F.of(t),u=new Eg(o),[a,d]=this.getXmlnsAttribute(i,s);if(d)n.addAttribute(a,d);n.addChildNode(u)}getXmlnsAttribute(t,r){let n=t.getMergedTraits(),[s,o]=n.xmlNamespace??[];if(o&&o!==r)return[s?`xmlns:${s}`:"xmlns",o];return[void 0,void 0]}}class Cc extends Ie{settings;constructor(t){super();this.settings=t}createSerializer(){let t=new Tc(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){let t=new Ys(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Jg extends Og{codec;serializer;deserializer;mixin=new br;constructor(t){super(t);let r={timestampFormat:{useTrait:!0,default:5},httpBindings:!0,xmlNamespace:t.xmlNamespace,serviceNamespace:t.defaultNamespace};this.codec=new Cc(r),this.serializer=new Pg(this.codec.createSerializer(),r),this.deserializer=new kg(this.codec.createDeserializer(),r)}getPayloadCodec(){return this.codec}getShapeId(){return"aws.protocols#restXml"}async serializeRequest(t,r,n){let s=await super.serializeRequest(t,r,n),o=F.of(t.input);if(!s.headers["content-type"]){let i=this.mixin.resolveRestContentType(this.getDefaultContentType(),o);if(i)s.headers["content-type"]=i}if(typeof s.body==="string"&&s.headers["content-type"]===this.getDefaultContentType()&&!s.body.startsWith("<?xml ")&&!this.hasUnstructuredPayloadBinding(o))s.body='<?xml version="1.0" encoding="UTF-8"?>'+s.body;return s}async deserializeResponse(t,r,n){return super.deserializeResponse(t,r,n)}async handleError(t,r,n,s,o){let i=Yg(n,s)??"Unknown";if(this.mixin.compose(this.compositeErrorRegistry,i,this.options.defaultNamespace),s.Error&&typeof s.Error==="object"){for(let m of Object.keys(s.Error))if(s[m]=s.Error[m],m.toLowerCase()==="message")s.message=s.Error[m]}if(s.RequestId&&!o.requestId)o.requestId=s.RequestId;let{errorSchema:u,errorMetadata:a}=await this.mixin.getErrorSchemaOrThrowBaseException(i,this.options.defaultNamespace,n,s,o),d=F.of(u),l=s.Error?.message??s.Error?.Message??s.message??s.Message??"UnknownError",f=new(this.compositeErrorRegistry.getErrorCtor(u)??Error)({});await this.deserializeHttpMessage(u,r,n,s);let p={},g=this.codec.createDeserializer();for(let[m,y]of d.structIterator()){let S=y.getMergedTraits().xmlName??m,w=s.Error?.[S]??s[S];p[m]=g.readSchema(y,w)}throw this.mixin.decorateServiceException(Object.assign(f,a,{$fault:d.getMergedTraits().error,message:l},p),s)}getDefaultContentType(){return"application/xml"}hasUnstructuredPayloadBinding(t){for(let[,r]of t.structIterator())if(r.getMergedTraits().httpPayload)return!(r.isStructSchema()||r.isMapSchema()||r.isListSchema());return!1}}var QF=(t)=>{if(t==null)return;if(typeof t==="object"&&"__type"in t)delete t.__type;return UF(t)},XF=(t)=>{if(t==null)return t;if(typeof t==="number"||typeof t==="bigint"){let r=Error(`Received number ${t} where a string was expected.`);return r.name="Warning",console.warn(r),String(t)}if(typeof t==="boolean"){let r=Error(`Received boolean ${t} where a string was expected.`);return r.name="Warning",console.warn(r),String(t)}return t},YF=(t)=>{if(t==null)return t;if(typeof t==="string"){let r=t.toLowerCase();if(t!==""&&r!=="false"&&r!=="true"){let n=Error(`Received string "${t}" where a boolean was expected.`);n.name="Warning",console.warn(n)}return t!==""&&r!=="false"}return t},JF=(t)=>{if(t==null)return t;if(typeof t==="string"){let r=Number(t);if(r.toString()!==t){let n=Error(`Received string "${t}" where a number was expected.`);return n.name="Warning",console.warn(n),t}return r}return t};ZF.AwsEc2QueryProtocol=Qg;ZF.AwsJson1_0Protocol=Vg;ZF.AwsJson1_1Protocol=jg;ZF.AwsJsonRpcProtocol=Xs;ZF.AwsQueryProtocol=xc;ZF.AwsRestJsonProtocol=Wg;ZF.AwsRestXmlProtocol=Jg;ZF.AwsSmithyRpcV2CborProtocol=Ug;ZF.JsonCodec=Kg;ZF.JsonCodec2=Qs;ZF.JsonShapeDeserializer=bc;ZF.JsonShapeDeserializer2=Ec;ZF.JsonShapeSerializer=_c;ZF.JsonShapeSerializer2=Ks;ZF.QueryShapeSerializer=Ac;ZF.XmlCodec=Cc;ZF.XmlShapeDeserializer=Ys;ZF.XmlShapeSerializer=Tc;ZF._toBool=YF;ZF._toNum=JF;ZF._toStr=XF;ZF.awsExpectUnion=QF;ZF.loadJsonRpcErrorCode=zg;ZF.loadRestJsonErrorCode=Hg;ZF.loadRestXmlErrorCode=Yg;ZF.parseJsonBody=Gs;ZF.parseJsonErrorBody=zF;ZF.parseXmlBody=Xg;ZF.parseXmlErrorBody=KF});var bn=e(function(q$){var{awsEndpointFunctions:vL,emitWarningIfUnsupportedVersion:NL,createDefaultUserAgentProvider:OL,NODE_APP_ID_CONFIG_OPTIONS:PL,getAwsRegionExtensionConfiguration:kL,resolveAwsRegionExtensionConfiguration:ML,resolveUserAgentConfig:DL,resolveHostHeaderConfig:FL,getUserAgentPlugin:LL,getHostHeaderPlugin:UL,getLoggerPlugin:$L,getRecursionDetectionPlugin:BL}=Ce(),{NoAuthSigner:HL,getHttpAuthSchemeEndpointRuleSetPlugin:zL,DefaultIdentityProviderConfig:qL,getHttpSigningPlugin:VL}=Xe(),{normalizeProvider:nm,getSmithyContext:jL,ServiceException:WL,NoOpLogger:GL,emitWarningIfUnsupportedVersion:KL,loadConfigsForDefaultMode:QL,getDefaultExtensionConfiguration:XL,resolveDefaultRuntimeConfig:YL,Client:sm,makeBuilder:JL,createAggregatedClient:ZL}=le(),{Command:eU}=le();q$.$Command=eU;q$.__Client=sm;var{resolveDefaultsModeConfig:tU,loadConfig:kt,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rU,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:nU,NODE_REGION_CONFIG_OPTIONS:sU,NODE_REGION_CONFIG_FILE_OPTIONS:oU,resolveRegionConfig:iU}=V(),{BinaryDecisionDiagram:aU,EndpointCache:cU,decideEndpoint:uU,customEndpointFunctions:dU,resolveEndpointConfig:lU,getEndpointPlugin:fU}=He(),{parseUrl:hU,getHttpHandlerExtensionConfiguration:pU,resolveHttpHandlerRuntimeConfig:gU,getContentLengthPlugin:mU}=K(),{DEFAULT_RETRY_MODE:yU,NODE_RETRY_MODE_CONFIG_OPTIONS:SU,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:wU,resolveRetryConfig:EU,getRetryPlugin:bU}=cA(),{TypeRegistry:om,getSchemaSerdePlugin:_U}=Te(),{resolveAwsSdkSigV4Config:AU,AwsSdkSigV4Signer:xU,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:TU}=$e(),{toUtf8:CU,fromUtf8:IU,toBase64:RU,fromBase64:vU,calculateBodyLength:NU}=X(),{streamCollector:OU,NodeHttpHandler:PU}=lA(),{AwsRestJsonProtocol:kU}=QA(),{Sha256:MU}=gA(),DU=async(t,r,n)=>({operation:jL(r).operation,region:await nm(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function FU(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function LU(t){return{schemeId:"smithy.api#noAuth"}}var UU=(t)=>{let r=[];switch(t.operation){case"CreateToken":{r.push(LU());break}default:r.push(FU(t))}return r},$U=(t)=>{let r=AU(t);return Object.assign(r,{authSchemePreference:nm(t.authSchemePreference??[])})},BU=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),HU={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},zU="3.997.45",qU={version:zU},wn="ref",Mt=-1,Js=!0,Zg="isSet",im="PartitionResult",Zs="booleanEquals",Ic="getAttr",em={[wn]:"Endpoint"},Rc={[wn]:im},_r={},tm=[{[wn]:"Region"}],rm={conditions:[[Zg,[em]],[Zg,tm],["aws.partition",tm,im],[Zs,[{[wn]:"UseFIPS"},Js]],[Zs,[{[wn]:"UseDualStack"},Js]],[Zs,[{fn:Ic,argv:[Rc,"supportsDualStack"]},Js]],[Zs,[{fn:Ic,argv:[Rc,"supportsFIPS"]},Js]],["stringEquals",[{fn:Ic,argv:[Rc,"name"]},"aws-us-gov"]]],results:[[Mt],[Mt,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Mt,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[em,_r],["https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",_r],[Mt,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://oidc.{Region}.amazonaws.com",_r],["https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",_r],[Mt,"FIPS is enabled but this partition does not support FIPS"],["https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",_r],[Mt,"DualStack is enabled but this partition does not support DualStack"],["https://oidc.{Region}.{PartitionResult#dnsSuffix}",_r],[Mt,"Invalid Configuration: Missing Region"]]},VU=2,pe=1e8,jU=new Int32Array([-1,1,-1,0,13,3,1,4,pe+12,2,5,pe+12,3,8,6,4,7,pe+11,5,pe+9,pe+10,4,11,9,6,10,pe+8,7,pe+6,pe+7,5,12,pe+5,6,pe+4,pe+5,3,pe+1,14,4,pe+2,pe+3]),WU=aU.from(jU,VU,rm.conditions,rm.results),GU=new cU({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),KU=(t,r={})=>GU.get(t,()=>uU(WU,{endpointParams:t,logger:r.logger}));dU.aws=vL;class fe extends WL{constructor(t){super(t);Object.setPrototypeOf(this,fe.prototype)}}class eo extends fe{name="AccessDeniedException";$fault="client";error;reason;error_description;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t});Object.setPrototypeOf(this,eo.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}}class to extends fe{name="AuthorizationPendingException";$fault="client";error;error_description;constructor(t){super({name:"AuthorizationPendingException",$fault:"client",...t});Object.setPrototypeOf(this,to.prototype),this.error=t.error,this.error_description=t.error_description}}class ro extends fe{name="ExpiredTokenException";$fault="client";error;error_description;constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t});Object.setPrototypeOf(this,ro.prototype),this.error=t.error,this.error_description=t.error_description}}class no extends fe{name="InternalServerException";$fault="server";error;error_description;constructor(t){super({name:"InternalServerException",$fault:"server",...t});Object.setPrototypeOf(this,no.prototype),this.error=t.error,this.error_description=t.error_description}}class so extends fe{name="InvalidClientException";$fault="client";error;error_description;constructor(t){super({name:"InvalidClientException",$fault:"client",...t});Object.setPrototypeOf(this,so.prototype),this.error=t.error,this.error_description=t.error_description}}class oo extends fe{name="InvalidGrantException";$fault="client";error;error_description;constructor(t){super({name:"InvalidGrantException",$fault:"client",...t});Object.setPrototypeOf(this,oo.prototype),this.error=t.error,this.error_description=t.error_description}}class io extends fe{name="InvalidRequestException";$fault="client";error;reason;error_description;constructor(t){super({name:"InvalidRequestException",$fault:"client",...t});Object.setPrototypeOf(this,io.prototype),this.error=t.error,this.reason=t.reason,this.error_description=t.error_description}}class ao extends fe{name="InvalidScopeException";$fault="client";error;error_description;constructor(t){super({name:"InvalidScopeException",$fault:"client",...t});Object.setPrototypeOf(this,ao.prototype),this.error=t.error,this.error_description=t.error_description}}class co extends fe{name="SlowDownException";$fault="client";error;error_description;constructor(t){super({name:"SlowDownException",$fault:"client",...t});Object.setPrototypeOf(this,co.prototype),this.error=t.error,this.error_description=t.error_description}}class uo extends fe{name="UnauthorizedClientException";$fault="client";error;error_description;constructor(t){super({name:"UnauthorizedClientException",$fault:"client",...t});Object.setPrototypeOf(this,uo.prototype),this.error=t.error,this.error_description=t.error_description}}class lo extends fe{name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(t){super({name:"UnsupportedGrantTypeException",$fault:"client",...t});Object.setPrototypeOf(this,lo.prototype),this.error=t.error,this.error_description=t.error_description}}var QU="AccessDeniedException",XU="AuthorizationPendingException",YU="AccessToken",JU="ClientSecret",ZU="CreateToken",e$="CreateTokenRequest",t$="CreateTokenResponse",r$="CodeVerifier",n$="ExpiredTokenException",s$="InvalidClientException",o$="InvalidGrantException",i$="InvalidRequestException",a$="InternalServerException",c$="InvalidScopeException",u$="IdToken",d$="RefreshToken",l$="SlowDownException",f$="UnauthorizedClientException",h$="UnsupportedGrantTypeException",p$="accessToken",Ve="client",g$="clientId",m$="clientSecret",y$="codeVerifier",S$="code",w$="deviceCode",z="error",E$="expiresIn",Re="error_description",b$="grantType",_$="http",ve="httpError",A$="idToken",am="reason",cm="refreshToken",x$="redirectUri",um="smithy.ts.sdk.synthetic.com.amazonaws.ssooidc",T$="scope",C$="server",I$="tokenType",j="com.amazonaws.ssooidc",dm=new om(um),lm=[-3,um,"SSOOIDCServiceException",0,[],[]];dm.registerError(lm,fe);var Ee=new om(j),fm=[-3,j,QU,{[z]:Ve,[ve]:400},[z,am,Re],[0,0,0]];Ee.registerError(fm,eo);var hm=[-3,j,XU,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(hm,to);var pm=[-3,j,n$,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(pm,ro);var gm=[-3,j,a$,{[z]:C$,[ve]:500},[z,Re],[0,0]];Ee.registerError(gm,no);var mm=[-3,j,s$,{[z]:Ve,[ve]:401},[z,Re],[0,0]];Ee.registerError(mm,so);var ym=[-3,j,o$,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(ym,oo);var Sm=[-3,j,i$,{[z]:Ve,[ve]:400},[z,am,Re],[0,0,0]];Ee.registerError(Sm,io);var wm=[-3,j,c$,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(wm,ao);var Em=[-3,j,l$,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(Em,co);var bm=[-3,j,f$,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(bm,uo);var _m=[-3,j,h$,{[z]:Ve,[ve]:400},[z,Re],[0,0]];Ee.registerError(_m,lo);var Am=[dm,Ee],R$=[0,j,YU,8,0],v$=[0,j,JU,8,0],N$=[0,j,r$,8,0],O$=[0,j,u$,8,0],xm=[0,j,d$,8,0],Tm=[3,j,e$,0,[g$,m$,b$,w$,S$,cm,T$,x$,y$],[0,[()=>v$,0],0,0,0,[()=>xm,0],64,0,[()=>N$,0]],3],Cm=[3,j,t$,0,[p$,I$,E$,cm,A$],[[()=>R$,0],0,1,[()=>xm,0],[()=>O$,0]]],Im=[9,j,ZU,{[_$]:["POST","/token",200]},()=>Tm,()=>Cm],P$=(t)=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??vU,base64Encoder:t?.base64Encoder??RU,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??KU,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??UU,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new xU},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new HL}],logger:t?.logger??new GL,protocol:t?.protocol??kU,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.ssooidc",errorTypeRegistries:Am,version:"2019-06-10",serviceTarget:"AWSSSOOIDCService"},serviceId:t?.serviceId??"SSO OIDC",sha256:t?.sha256??MU,urlParser:t?.urlParser??hU,utf8Decoder:t?.utf8Decoder??IU,utf8Encoder:t?.utf8Encoder??CU}),k$=(t)=>{KL(process.version);let r=tU(t),n=()=>r().then(QL),s=P$(t);NL(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??kt(TU,o),bodyLengthChecker:t?.bodyLengthChecker??NU,defaultUserAgentProvider:t?.defaultUserAgentProvider??OL({serviceId:s.serviceId,clientVersion:qU.version}),maxAttempts:t?.maxAttempts??kt(wU,t),region:t?.region??kt(sU,{...oU,...o}),requestHandler:PU.create(t?.requestHandler??n),retryMode:t?.retryMode??kt({...SU,default:async()=>(await n()).retryMode||yU},t),streamCollector:t?.streamCollector??OU,useDualstackEndpoint:t?.useDualstackEndpoint??kt(nU,o),useFipsEndpoint:t?.useFipsEndpoint??kt(rU,o),userAgentAppId:t?.userAgentAppId??kt(PL,o)}},M$=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},D$=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),F$=(t,r)=>{let n=Object.assign(kL(t),XL(t),pU(t),M$(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,ML(n),YL(n),gU(n),D$(n))};class vc extends sm{config;constructor(...[t]){let r=k$(t||{});super(r);this.initConfig=r;let n=BU(r),s=DL(n),o=EU(s),i=iU(o),u=FL(i),a=lU(u),d=$U(a),l=F$(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(_U(this.config)),this.middlewareStack.use(LL(this.config)),this.middlewareStack.use(bU(this.config)),this.middlewareStack.use(mU(this.config)),this.middlewareStack.use(UL(this.config)),this.middlewareStack.use($L(this.config)),this.middlewareStack.use(BL(this.config)),this.middlewareStack.use(zL(this.config,{httpAuthSchemeParametersProvider:DU,identityProviderConfigProvider:async(h)=>new qL({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(VL(this.config))}destroy(){super.destroy()}}var L$=JL(HU,"AWSSSOOIDCService","SSOOIDCClient",fU),U$={},$$=(t,r,n,s)=>[];class Nc extends L$(U$,$$,"CreateToken",Im){}var B$={CreateTokenCommand:Nc};class Oc extends vc{}ZL(B$,Oc);var H$={KMS_ACCESS_DENIED:"KMS_AccessDeniedException"},z$={KMS_DISABLED_KEY:"KMS_DisabledException",KMS_INVALID_KEY_USAGE:"KMS_InvalidKeyUsageException",KMS_INVALID_STATE:"KMS_InvalidStateException",KMS_KEY_NOT_FOUND:"KMS_NotFoundException"};q$.AccessDeniedException=eo;q$.AccessDeniedException$=fm;q$.AccessDeniedExceptionReason=H$;q$.AuthorizationPendingException=to;q$.AuthorizationPendingException$=hm;q$.CreateToken$=Im;q$.CreateTokenCommand=Nc;q$.CreateTokenRequest$=Tm;q$.CreateTokenResponse$=Cm;q$.ExpiredTokenException=ro;q$.ExpiredTokenException$=pm;q$.InternalServerException=no;q$.InternalServerException$=gm;q$.InvalidClientException=so;q$.InvalidClientException$=mm;q$.InvalidGrantException=oo;q$.InvalidGrantException$=ym;q$.InvalidRequestException=io;q$.InvalidRequestException$=Sm;q$.InvalidRequestExceptionReason=z$;q$.InvalidScopeException=ao;q$.InvalidScopeException$=wm;q$.SSOOIDC=Oc;q$.SSOOIDCClient=vc;q$.SSOOIDCServiceException=fe;q$.SSOOIDCServiceException$=lm;q$.SlowDownException=co;q$.SlowDownException$=Em;q$.UnauthorizedClientException=uo;q$.UnauthorizedClientException$=bm;q$.UnsupportedGrantTypeException=lo;q$.UnsupportedGrantTypeException$=_m;q$.errorTypeRegistries=Am});var Om=e(function(z2){var{setTokenFeature:T2}=Ce(),{getBearerTokenEnvKey:C2}=$e(),{TokenProviderError:Ne,getSSOTokenFilepath:I2,parseKnownFiles:R2,getProfileName:v2,loadSsoSessionData:N2,getSSOTokenFromFile:O2,memoize:P2,chain:k2}=V(),{promises:M2}=c("node:fs"),D2=({logger:t,signingName:r}={})=>async()=>{if(t?.debug?.("@aws-sdk/token-providers - fromEnvSigningName"),!r)throw new Ne("Please pass 'signingName' to compute environment variable key",{logger:t});let n=C2(r);if(!(n in process.env))throw new Ne(`Token not present in '${n}' environment variable`,{logger:t});let s={token:process.env[n]};return T2(s,"BEARER_SERVICE_ENV_VARS","3"),s},F2=async(t,r={},n)=>{let{SSOOIDCClient:s}=bn(),o=(u)=>r.clientConfig?.[u]??r.parentClientConfig?.[u]??n?.[u];return new s(Object.assign({},r.clientConfig??{},{region:t??r.clientConfig?.region,logger:o("logger"),userAgentAppId:o("userAgentAppId")}))},L2=async(t,r,n={},s)=>{let{CreateTokenCommand:o}=bn();return(await F2(r,n,s)).send(new o({clientId:t.clientId,clientSecret:t.clientSecret,refreshToken:t.refreshToken,grantType:"refresh_token"}))},Rm=(t)=>{if(t.expiration&&t.expiration.getTime()<Date.now())throw new Ne("Token is expired. To refresh this SSO session run 'aws sso login' with the corresponding profile.",!1)},Dt=(t,r,n=!1)=>{if(typeof r>"u")throw new Ne(`Value not present for '${t}' in SSO Token${n?". Cannot refresh":""}. To refresh this SSO session run 'aws sso login' with the corresponding profile.`,!1)},{writeFile:U2}=M2,$2=(t,r)=>{let n=I2(t),s=JSON.stringify(r,null,2);return U2(n,s)},vm=new Map,Nm=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/token-providers - fromSso");let n=await R2(t),s=v2({profile:t.profile??r?.profile}),o=n[s];if(!o)throw new Ne(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!o.sso_session)throw new Ne(`Profile '${s}' is missing required property 'sso_session'.`);let i=o.sso_session,a=(await N2(t))[i];if(!a)throw new Ne(`Sso session '${i}' could not be found in shared credentials file.`,!1);for(let m of["sso_start_url","sso_region"])if(!a[m])throw new Ne(`Sso session '${i}' is missing required property '${m}'.`,!1);a.sso_start_url;let d=a.sso_region,l;try{l=await O2(i)}catch(m){throw new Ne(`The SSO session token associated with profile=${s} was not found or is invalid. To refresh this SSO session run 'aws sso login' with the corresponding profile.`,!1)}Dt("accessToken",l.accessToken),Dt("expiresAt",l.expiresAt);let{accessToken:h,expiresAt:f}=l,p={token:h,expiration:new Date(f)};if(p.expiration.getTime()-Date.now()>300000)return p;let g=vm.get(i)??0;if(Date.now()-g<30000)return Rm(p),p;Dt("clientId",l.clientId,!0),Dt("clientSecret",l.clientSecret,!0),Dt("refreshToken",l.refreshToken,!0);try{vm.set(i,Date.now());let m=await L2(l,d,t,r);Dt("accessToken",m.accessToken),Dt("expiresIn",m.expiresIn);let y=new Date(Date.now()+m.expiresIn*1000);try{await $2(i,{...l,accessToken:m.accessToken,expiresAt:y.toISOString(),refreshToken:m.refreshToken})}catch(S){}return{token:m.accessToken,expiration:y}}catch(m){return Rm(p),p}},B2=({token:t,logger:r})=>async()=>{if(r?.debug("@aws-sdk/token-providers - fromStatic"),!t||!t.token)throw new Ne("Please pass a valid token to fromStatic",!1);return t},H2=(t={})=>P2(k2(Nm(t),async()=>{throw new Ne("Could not load token from any providers",!1)}),(r)=>r.expiration!==void 0&&r.expiration.getTime()-Date.now()<300000,(r)=>r.expiration!==void 0);z2.fromEnvSigningName=D2;z2.fromSso=Nm;z2.fromStatic=B2;z2.nodeProvider=H2});var Zm=e(function(Q4){var{awsEndpointFunctions:G2,emitWarningIfUnsupportedVersion:K2,createDefaultUserAgentProvider:Q2,NODE_APP_ID_CONFIG_OPTIONS:X2,getAwsRegionExtensionConfiguration:Y2,resolveAwsRegionExtensionConfiguration:J2,resolveUserAgentConfig:Z2,resolveHostHeaderConfig:eB,getUserAgentPlugin:tB,getHostHeaderPlugin:rB,getLoggerPlugin:nB,getRecursionDetectionPlugin:sB}=Ce(),{NoAuthSigner:oB,getHttpAuthSchemeEndpointRuleSetPlugin:iB,DefaultIdentityProviderConfig:aB,getHttpSigningPlugin:cB}=Xe(),{normalizeProvider:Lm,getSmithyContext:uB,ServiceException:dB,NoOpLogger:lB,emitWarningIfUnsupportedVersion:fB,loadConfigsForDefaultMode:hB,getDefaultExtensionConfiguration:pB,resolveDefaultRuntimeConfig:gB,Client:Um,makeBuilder:mB,createAggregatedClient:yB}=le(),{Command:SB}=le();Q4.$Command=SB;Q4.__Client=Um;var{resolveDefaultsModeConfig:wB,loadConfig:Ft,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:EB,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:bB,NODE_REGION_CONFIG_OPTIONS:_B,NODE_REGION_CONFIG_FILE_OPTIONS:AB,resolveRegionConfig:xB}=V(),{BinaryDecisionDiagram:TB,EndpointCache:CB,decideEndpoint:IB,customEndpointFunctions:RB,resolveEndpointConfig:vB,getEndpointPlugin:NB}=He(),{parseUrl:OB,getHttpHandlerExtensionConfiguration:PB,resolveHttpHandlerRuntimeConfig:kB,getContentLengthPlugin:MB}=K(),{DEFAULT_RETRY_MODE:DB,NODE_RETRY_MODE_CONFIG_OPTIONS:FB,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:LB,resolveRetryConfig:UB,getRetryPlugin:$B}=cA(),{TypeRegistry:$m,getSchemaSerdePlugin:BB}=Te(),{resolveAwsSdkSigV4Config:HB,AwsSdkSigV4Signer:zB,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:qB}=$e(),{toUtf8:VB,fromUtf8:jB,toBase64:WB,fromBase64:GB,calculateBodyLength:KB}=X(),{streamCollector:QB,NodeHttpHandler:XB}=lA(),{AwsRestJsonProtocol:YB}=QA(),{Sha256:JB}=gA(),ZB=async(t,r,n)=>({operation:uB(r).operation,region:await Lm(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function e4(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function t4(t){return{schemeId:"smithy.api#noAuth"}}var r4=(t)=>{let r=[];switch(t.operation){case"GetRoleCredentials":{r.push(t4());break}default:r.push(e4(t))}return r},n4=(t)=>{let r=HB(t);return Object.assign(r,{authSchemePreference:Lm(t.authSchemePreference??[])})},s4=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}),o4={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},i4="3.997.45",a4={version:i4},En="ref",Lt=-1,fo=!0,Pm="isSet",Bm="PartitionResult",ho="booleanEquals",Pc="getAttr",km={[En]:"Endpoint"},kc={[En]:Bm},Ar={},Mm=[{[En]:"Region"}],Dm={conditions:[[Pm,[km]],[Pm,Mm],["aws.partition",Mm,Bm],[ho,[{[En]:"UseFIPS"},fo]],[ho,[{[En]:"UseDualStack"},fo]],[ho,[{fn:Pc,argv:[kc,"supportsDualStack"]},fo]],[ho,[{fn:Pc,argv:[kc,"supportsFIPS"]},fo]],["stringEquals",[{fn:Pc,argv:[kc,"name"]},"aws-us-gov"]]],results:[[Lt],[Lt,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Lt,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[km,Ar],["https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",Ar],[Lt,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://portal.sso.{Region}.amazonaws.com",Ar],["https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",Ar],[Lt,"FIPS is enabled but this partition does not support FIPS"],["https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",Ar],[Lt,"DualStack is enabled but this partition does not support DualStack"],["https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",Ar],[Lt,"Invalid Configuration: Missing Region"]]},c4=2,ge=1e8,u4=new Int32Array([-1,1,-1,0,13,3,1,4,ge+12,2,5,ge+12,3,8,6,4,7,ge+11,5,ge+9,ge+10,4,11,9,6,10,ge+8,7,ge+6,ge+7,5,12,ge+5,6,ge+4,ge+5,3,ge+1,14,4,ge+2,ge+3]),d4=TB.from(u4,c4,Dm.conditions,Dm.results),l4=new CB({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),f4=(t,r={})=>l4.get(t,()=>IB(d4,{endpointParams:t,logger:r.logger}));RB.aws=G2;class ft extends dB{constructor(t){super(t);Object.setPrototypeOf(this,ft.prototype)}}class po extends ft{name="InvalidRequestException";$fault="client";constructor(t){super({name:"InvalidRequestException",$fault:"client",...t});Object.setPrototypeOf(this,po.prototype)}}class go extends ft{name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t});Object.setPrototypeOf(this,go.prototype)}}class mo extends ft{name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t});Object.setPrototypeOf(this,mo.prototype)}}class yo extends ft{name="UnauthorizedException";$fault="client";constructor(t){super({name:"UnauthorizedException",$fault:"client",...t});Object.setPrototypeOf(this,yo.prototype)}}var h4="AccessTokenType",p4="GetRoleCredentials",g4="GetRoleCredentialsRequest",m4="GetRoleCredentialsResponse",y4="InvalidRequestException",S4="RoleCredentials",w4="ResourceNotFoundException",E4="SecretAccessKeyType",b4="SessionTokenType",_4="TooManyRequestsException",A4="UnauthorizedException",x4="accountId",T4="accessKeyId",C4="accessToken",I4="account_id",So="client",wo="error",R4="expiration",v4="http",Eo="httpError",N4="httpHeader",Fm="httpQuery",bo="message",O4="roleCredentials",P4="roleName",k4="role_name",Hm="smithy.ts.sdk.synthetic.com.amazonaws.sso",M4="secretAccessKey",D4="sessionToken",F4="x-amz-sso_bearer_token",be="com.amazonaws.sso",zm=new $m(Hm),qm=[-3,Hm,"SSOServiceException",0,[],[]];zm.registerError(qm,ft);var _n=new $m(be),Vm=[-3,be,y4,{[wo]:So,[Eo]:400},[bo],[0]];_n.registerError(Vm,po);var jm=[-3,be,w4,{[wo]:So,[Eo]:404},[bo],[0]];_n.registerError(jm,go);var Wm=[-3,be,_4,{[wo]:So,[Eo]:429},[bo],[0]];_n.registerError(Wm,mo);var Gm=[-3,be,A4,{[wo]:So,[Eo]:401},[bo],[0]];_n.registerError(Gm,yo);var Km=[zm,_n],L4=[0,be,h4,8,0],U4=[0,be,E4,8,0],$4=[0,be,b4,8,0],Qm=[3,be,g4,0,[P4,x4,C4],[[0,{[Fm]:k4}],[0,{[Fm]:I4}],[()=>L4,{[N4]:F4}]],3],Xm=[3,be,m4,0,[O4],[[()=>Ym,0]]],Ym=[3,be,S4,0,[T4,M4,D4,R4],[0,[()=>U4,0],[()=>$4,0],1]],Jm=[9,be,p4,{[v4]:["GET","/federation/credentials",200]},()=>Qm,()=>Xm],B4=(t)=>({apiVersion:"2019-06-10",base64Decoder:t?.base64Decoder??GB,base64Encoder:t?.base64Encoder??WB,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??f4,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??r4,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new zB},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new oB}],logger:t?.logger??new lB,protocol:t?.protocol??YB,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sso",errorTypeRegistries:Km,version:"2019-06-10",serviceTarget:"SWBPortalService"},serviceId:t?.serviceId??"SSO",sha256:t?.sha256??JB,urlParser:t?.urlParser??OB,utf8Decoder:t?.utf8Decoder??jB,utf8Encoder:t?.utf8Encoder??VB}),H4=(t)=>{fB(process.version);let r=wB(t),n=()=>r().then(hB),s=B4(t);K2(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??Ft(qB,o),bodyLengthChecker:t?.bodyLengthChecker??KB,defaultUserAgentProvider:t?.defaultUserAgentProvider??Q2({serviceId:s.serviceId,clientVersion:a4.version}),maxAttempts:t?.maxAttempts??Ft(LB,t),region:t?.region??Ft(_B,{...AB,...o}),requestHandler:XB.create(t?.requestHandler??n),retryMode:t?.retryMode??Ft({...FB,default:async()=>(await n()).retryMode||DB},t),streamCollector:t?.streamCollector??QB,useDualstackEndpoint:t?.useDualstackEndpoint??Ft(bB,o),useFipsEndpoint:t?.useFipsEndpoint??Ft(EB,o),userAgentAppId:t?.userAgentAppId??Ft(X2,o)}},z4=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},q4=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),V4=(t,r)=>{let n=Object.assign(Y2(t),pB(t),PB(t),z4(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,J2(n),gB(n),kB(n),q4(n))};class Mc extends Um{config;constructor(...[t]){let r=H4(t||{});super(r);this.initConfig=r;let n=s4(r),s=Z2(n),o=UB(s),i=xB(o),u=eB(i),a=vB(u),d=n4(a),l=V4(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(BB(this.config)),this.middlewareStack.use(tB(this.config)),this.middlewareStack.use($B(this.config)),this.middlewareStack.use(MB(this.config)),this.middlewareStack.use(rB(this.config)),this.middlewareStack.use(nB(this.config)),this.middlewareStack.use(sB(this.config)),this.middlewareStack.use(iB(this.config,{httpAuthSchemeParametersProvider:ZB,identityProviderConfigProvider:async(h)=>new aB({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(cB(this.config))}destroy(){super.destroy()}}var j4=mB(o4,"SWBPortalService","SSOClient",NB),W4={},G4=(t,r,n,s)=>[];class Dc extends j4(W4,G4,"GetRoleCredentials",Jm){}var K4={GetRoleCredentialsCommand:Dc};class Fc extends Mc{}yB(K4,Fc);Q4.GetRoleCredentials$=Jm;Q4.GetRoleCredentialsCommand=Dc;Q4.GetRoleCredentialsRequest$=Qm;Q4.GetRoleCredentialsResponse$=Xm;Q4.InvalidRequestException=po;Q4.InvalidRequestException$=Vm;Q4.ResourceNotFoundException=go;Q4.ResourceNotFoundException$=jm;Q4.RoleCredentials$=Ym;Q4.SSO=Fc;Q4.SSOClient=Mc;Q4.SSOServiceException=ft;Q4.SSOServiceException$=qm;Q4.TooManyRequestsException=mo;Q4.TooManyRequestsException$=Wm;Q4.UnauthorizedException=yo;Q4.UnauthorizedException$=Gm;Q4.errorTypeRegistries=Km});var ey=e(function(SH){var{GetRoleCredentialsCommand:mH,SSOClient:yH}=Zm();SH.GetRoleCredentialsCommand=mH;SH.SSOClient=yH});var Lc=e(function(IH){var{CredentialsProviderError:Oe,getSSOTokenFromFile:bH,getProfileName:_H,parseKnownFiles:AH,loadSsoSessionData:xH}=V(),{setCredentialFeature:ty}=Ce(),{fromSso:TH}=Om(),ny=(t)=>t&&(typeof t.sso_start_url==="string"||typeof t.sso_account_id==="string"||typeof t.sso_session==="string"||typeof t.sso_region==="string"||typeof t.sso_role_name==="string"),ry=async({ssoStartUrl:t,ssoSession:r,ssoAccountId:n,ssoRegion:s,ssoRoleName:o,ssoClient:i,clientConfig:u,parentClientConfig:a,callerClientConfig:d,profile:l,filepath:h,configFilepath:f,ignoreCache:p,logger:g})=>{let m,y="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{let D=await TH({profile:l,filepath:h,configFilepath:f,ignoreCache:p,clientConfig:u,parentClientConfig:a,logger:g})({callerClientConfig:d});m={accessToken:D.token,expiresAt:new Date(D.expiration).toISOString()}}catch(D){throw new Oe(D.message,{tryNextLink:!1,logger:g})}else try{m=await bH(t)}catch(D){throw new Oe("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:!1,logger:g})}if(new Date(m.expiresAt).getTime()-Date.now()<=0)throw new Oe("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:!1,logger:g});let{accessToken:S}=m,{SSOClient:w,GetRoleCredentialsCommand:E}=ey(),A=i||new w(Object.assign({},u??{},{logger:u?.logger??d?.logger??a?.logger,region:u?.region??s,userAgentAppId:u?.userAgentAppId??d?.userAgentAppId??a?.userAgentAppId})),v;try{v=await A.send(new E({accountId:n,roleName:o,accessToken:S}))}catch(D){throw new Oe(D,{tryNextLink:!1,logger:g})}let{roleCredentials:{accessKeyId:L,secretAccessKey:k,sessionToken:U,expiration:de,credentialScope:q,accountId:W}={}}=v;if(!L||!k||!U||!de)throw new Oe("SSO returns an invalid temporary credential.",{tryNextLink:!1,logger:g});let ke={accessKeyId:L,secretAccessKey:k,sessionToken:U,expiration:new Date(de),...q&&{credentialScope:q},...W&&{accountId:W}};if(r)ty(ke,"CREDENTIALS_SSO","s");else ty(ke,"CREDENTIALS_SSO_LEGACY","u");return ke},sy=(t,r)=>{let{sso_start_url:n,sso_account_id:s,sso_region:o,sso_role_name:i}=t;if(!n||!s||!o||!i)throw new Oe(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(t).join(", ")}
|
|
51
|
-
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:r});return t},CH=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:n,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoSession:u}=t,{ssoClient:a}=t,d=_H({profile:t.profile??r?.profile});if(!n&&!s&&!o&&!i&&!u){let h=(await AH(t))[d];if(!h)throw new Oe(`Profile ${d} was not found.`,{logger:t.logger});if(!ny(h))throw new Oe(`Profile ${d} is not configured with SSO credentials.`,{logger:t.logger});if(h?.sso_session){let w=(await xH(t))[h.sso_session],E=` configurations in profile ${d} and sso-session ${h.sso_session}`;if(o&&o!==w.sso_region)throw new Oe("Conflicting SSO region"+E,{tryNextLink:!1,logger:t.logger});if(n&&n!==w.sso_start_url)throw new Oe("Conflicting SSO start_url"+E,{tryNextLink:!1,logger:t.logger});h.sso_region=w.sso_region,h.sso_start_url=w.sso_start_url}let{sso_start_url:f,sso_account_id:p,sso_region:g,sso_role_name:m,sso_session:y}=sy(h,t.logger);return ry({ssoStartUrl:f,ssoSession:y,ssoAccountId:p,ssoRegion:g,ssoRoleName:m,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:d,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})}else if(!n||!s||!o||!i)throw new Oe('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:t.logger});else return ry({ssoStartUrl:n,ssoSession:u,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoClient:a,clientConfig:t.clientConfig,parentClientConfig:t.parentClientConfig,callerClientConfig:t.callerClientConfig,profile:d,filepath:t.filepath,configFilepath:t.configFilepath,ignoreCache:t.ignoreCache,logger:t.logger})};IH.fromSSO=CH;IH.isSsoProfile=ny;IH.validateSsoProfile=sy});var dy=e(function(PH){var{SignatureV4:OH,signatureV4aContainer:oy}=Ia(),An={CrtSignerV4:null},iy="X-Amz-S3session-Token".toLowerCase();class Uc extends OH{async signWithCredentials(t,r,n){let s=ay(r);t.headers[iy]=r.sessionToken;let o=this;return cy(o,s),o.signRequest(t,n??{})}async presignWithCredentials(t,r,n){let s=ay(r);return delete t.headers[iy],t.headers["X-Amz-S3session-Token"]=r.sessionToken,t.query=t.query??{},t.query["X-Amz-S3session-Token"]=r.sessionToken,cy(this,s),this.presign(t,n)}}function ay(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,expiration:t.expiration}}function cy(t,r){let n=t.credentialProvider;t.credentialProvider=()=>(t.credentialProvider=n,Promise.resolve(r))}class uy{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof An.CrtSignerV4==="function")return"crt";else if(typeof oy.SignatureV4a==="function")return"js";return"none"}constructor(t){this.sigv4Signer=new Uc(t),this.signerOptions=t}async sign(t,r={}){if(r.signingRegion==="*")return this.getSigv4aSigner().sign(t,r);return this.sigv4Signer.sign(t,r)}async signWithCredentials(t,r,n={}){if(n.signingRegion==="*"){let s=this.getSigv4aSigner(),o=An.CrtSignerV4;if(o&&s instanceof o)return s.signWithCredentials(t,r,n);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(t,r,n)}async presign(t,r={}){if(r.signingRegion==="*"){let n=this.getSigv4aSigner(),s=An.CrtSignerV4;if(s&&n instanceof s)return n.presign(t,r);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(t,r)}async presignWithCredentials(t,r,n={}){if(n.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(t,r,n)}getSigv4aSigner(){if(!this.sigv4aSigner){let t=An.CrtSignerV4,r=oy.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!t&&!r)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(t&&typeof t==="function")this.sigv4aSigner=new t({...this.signerOptions,signingAlgorithm:1});else if(r&&typeof r==="function")this.sigv4aSigner=new r({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!r||typeof r!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new r({...this.signerOptions})}}return this.sigv4aSigner}}PH.SignatureV4MultiRegion=uy;PH.SignatureV4SignWithCredentials=Uc;PH.signatureV4CrtContainer=An});var Qc=e(function(iq){var{awsEndpointFunctions:FH,emitWarningIfUnsupportedVersion:LH,createDefaultUserAgentProvider:UH,NODE_APP_ID_CONFIG_OPTIONS:$H,getAwsRegionExtensionConfiguration:BH,resolveAwsRegionExtensionConfiguration:HH,resolveUserAgentConfig:zH,resolveHostHeaderConfig:qH,getUserAgentPlugin:VH,getHostHeaderPlugin:jH,getLoggerPlugin:WH,getRecursionDetectionPlugin:GH,setCredentialFeature:Hc,stsRegionDefaultResolver:KH}=Ce(),{NoAuthSigner:wy,getHttpAuthSchemeEndpointRuleSetPlugin:QH,DefaultIdentityProviderConfig:XH,getHttpSigningPlugin:YH}=Xe(),{normalizeProvider:Ey,getSmithyContext:by,ServiceException:JH,NoOpLogger:ZH,emitWarningIfUnsupportedVersion:ez,loadConfigsForDefaultMode:tz,getDefaultExtensionConfiguration:rz,resolveDefaultRuntimeConfig:nz,Client:_y,makeBuilder:sz,createAggregatedClient:oz}=le(),{Command:iz}=le();iq.$Command=iz;iq.__Client=_y;var{resolveDefaultsModeConfig:az,loadConfig:ht,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:cz,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:uz,NODE_REGION_CONFIG_OPTIONS:dz,NODE_REGION_CONFIG_FILE_OPTIONS:lz,resolveRegionConfig:fz}=V(),{BinaryDecisionDiagram:hz,EndpointCache:pz,decideEndpoint:gz,customEndpointFunctions:mz,resolveParams:yz,resolveEndpointConfig:Sz,getEndpointPlugin:wz}=He(),{parseUrl:Ez,getHttpHandlerExtensionConfiguration:bz,resolveHttpHandlerRuntimeConfig:_z,getContentLengthPlugin:Az}=K(),{DEFAULT_RETRY_MODE:xz,NODE_RETRY_MODE_CONFIG_OPTIONS:Tz,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Cz,resolveRetryConfig:Iz,getRetryPlugin:Rz}=cA(),{TypeRegistry:Ay,getSchemaSerdePlugin:vz}=Te(),{resolveAwsSdkSigV4Config:Nz,resolveAwsSdkSigV4AConfig:Oz,AwsSdkSigV4Signer:xy,AwsSdkSigV4ASigner:Ty,NODE_SIGV4A_CONFIG_OPTIONS:Pz,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:kz}=$e(),{SignatureV4MultiRegion:Cy}=dy(),{toUtf8:Mz,fromUtf8:Dz,toBase64:Fz,fromBase64:Lz,calculateBodyLength:Uz}=X(),{streamCollector:$z,NodeHttpHandler:Bz}=lA(),{AwsQueryProtocol:Hz}=QA(),{Sha256:zz}=gA(),Tr="ref",Ut=-1,xn=!0,ly="isSet",Iy="PartitionResult",Tn="booleanEquals",ne="stringEquals",$c="getAttr",fy="us-east-1",hy="sigv4",py="sts",gy="https://sts.{Region}.{PartitionResult#dnsSuffix}",my={[Tr]:"Endpoint"},se={[Tr]:"Region"},Bc={[Tr]:Iy},xr={},yy=[se],Sy={conditions:[[ly,[my]],[ly,yy],["aws.partition",yy,Iy],[Tn,[{[Tr]:"UseFIPS"},xn]],[Tn,[{[Tr]:"UseDualStack"},xn]],[ne,[se,"aws-global"]],[Tn,[{[Tr]:"UseGlobalEndpoint"},xn]],[ne,[se,"eu-central-1"]],[Tn,[{fn:$c,argv:[Bc,"supportsDualStack"]},xn]],[Tn,[{fn:$c,argv:[Bc,"supportsFIPS"]},xn]],[ne,[se,"ap-south-1"]],[ne,[se,"eu-north-1"]],[ne,[se,"eu-west-1"]],[ne,[se,"eu-west-2"]],[ne,[se,"eu-west-3"]],[ne,[se,"sa-east-1"]],[ne,[se,fy]],[ne,[se,"us-east-2"]],[ne,[se,"us-west-2"]],[ne,[se,"us-west-1"]],[ne,[se,"ca-central-1"]],[ne,[se,"ap-southeast-1"]],[ne,[se,"ap-northeast-1"]],[ne,[se,"ap-southeast-2"]],[ne,[{fn:$c,argv:[Bc,"name"]},"aws-us-gov"]]],results:[[Ut],["https://sts.amazonaws.com",{authSchemes:[{name:hy,signingName:py,signingRegion:fy}]}],[gy,{authSchemes:[{name:hy,signingName:py,signingRegion:"{Region}"}]}],[Ut,"Invalid Configuration: FIPS and custom endpoint are not supported"],[Ut,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[my,xr],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",xr],[Ut,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",xr],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",xr],[Ut,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",xr],[Ut,"DualStack is enabled but this partition does not support DualStack"],[gy,xr],[Ut,"Invalid Configuration: Missing Region"]]},qz=2,P=1e8,Vz=new Int32Array([-1,1,-1,0,30,3,1,4,P+14,2,5,P+14,3,25,6,4,24,7,5,P+1,8,6,9,P+13,7,P+1,10,10,P+1,11,11,P+1,12,12,P+1,13,13,P+1,14,14,P+1,15,15,P+1,16,16,P+1,17,17,P+1,18,18,P+1,19,19,P+1,20,20,P+1,21,21,P+1,22,22,P+1,23,23,P+1,P+2,8,P+11,P+12,4,28,26,9,27,P+10,24,P+8,P+9,8,29,P+7,9,P+6,P+7,3,P+3,31,4,P+4,P+5]),jz=hz.from(Vz,qz,Sy.conditions,Sy.results),Wz=new pz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),Ry=(t,r={})=>Wz.get(t,()=>gz(jz,{endpointParams:t,logger:r.logger}));mz.aws=FH;var Gz=(t)=>async(r,n,s)=>{if(!s)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let o=await t(r,n,s),i=by(n)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!i)throw Error(`getEndpointParameterInstructions() is not defined on '${n.commandName}'`);let u=await yz(s,{getEndpointParameterInstructions:i},r);return Object.assign(o,u)},Kz=async(t,r,n)=>({operation:by(r).operation,region:await Ey(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Qz=Gz(Kz);function vy(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function zc(t){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function Ny(t){return{schemeId:"smithy.api#noAuth"}}var Xz=(t,r,n)=>(o)=>{let u=t(o).properties?.authSchemes;if(!u)return r(o);let a=[];for(let d of u){let{name:l,properties:h={},...f}=d,p=l.toLowerCase();if(l!==p)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${l}' to '${p}'`);let g;if(p==="sigv4a"){g="aws.auth#sigv4a";let S=u.find((w)=>{let E=w.name.toLowerCase();return E!=="sigv4a"&&E.startsWith("sigv4")});if(Cy.sigv4aDependency()==="none"&&S)continue}else if(p.startsWith("sigv4"))g="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${p}'`);let m=n[g];if(!m)throw Error(`Could not find HttpAuthOption create function for '${g}'`);let y=m(o);y.schemeId=g,y.signingProperties={...y.signingProperties||{},...f,...h},a.push(y)}return a},Yz=(t)=>{let r=[];switch(t.operation){case"AssumeRoleWithWebIdentity":{r.push(Ny()),r.push(zc(t));break}default:r.push(vy(t)),r.push(zc(t))}return r},Jz=Xz(Ry,Yz,{"aws.auth#sigv4":vy,"aws.auth#sigv4a":zc,"smithy.api#noAuth":Ny}),Zz=(t)=>{let r=Nz(t),n=Oz(r);return Object.assign(n,{authSchemePreference:Ey(t.authSchemePreference??[])})},e3=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,defaultSigningName:"sts"}),t3={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},r3="3.997.45",n3={version:r3};class Pe extends JH{constructor(t){super(t);Object.setPrototypeOf(this,Pe.prototype)}}class _o extends Pe{name="ExpiredTokenException";$fault="client";constructor(t){super({name:"ExpiredTokenException",$fault:"client",...t});Object.setPrototypeOf(this,_o.prototype)}}class Ao extends Pe{name="MalformedPolicyDocumentException";$fault="client";constructor(t){super({name:"MalformedPolicyDocumentException",$fault:"client",...t});Object.setPrototypeOf(this,Ao.prototype)}}class xo extends Pe{name="PackedPolicyTooLargeException";$fault="client";constructor(t){super({name:"PackedPolicyTooLargeException",$fault:"client",...t});Object.setPrototypeOf(this,xo.prototype)}}class To extends Pe{name="RegionDisabledException";$fault="client";constructor(t){super({name:"RegionDisabledException",$fault:"client",...t});Object.setPrototypeOf(this,To.prototype)}}class Co extends Pe{name="IDPRejectedClaimException";$fault="client";constructor(t){super({name:"IDPRejectedClaimException",$fault:"client",...t});Object.setPrototypeOf(this,Co.prototype)}}class Io extends Pe{name="InvalidIdentityTokenException";$fault="client";constructor(t){super({name:"InvalidIdentityTokenException",$fault:"client",...t});Object.setPrototypeOf(this,Io.prototype)}}class Ro extends Pe{name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(t){super({name:"IDPCommunicationErrorException",$fault:"client",...t});Object.setPrototypeOf(this,Ro.prototype)}}var s3="Arn",o3="AccessKeyId",i3="AssumeRole",a3="AssumedRoleId",c3="AssumeRoleRequest",u3="AssumeRoleResponse",qc="AssumedRoleUser",d3="AssumeRoleWithWebIdentity",l3="AssumeRoleWithWebIdentityRequest",f3="AssumeRoleWithWebIdentityResponse",h3="Audience",Vc="Credentials",p3="ContextAssertion",Oy="DurationSeconds",g3="Expiration",m3="ExternalId",y3="ExpiredTokenException",S3="IDPCommunicationErrorException",w3="IDPRejectedClaimException",E3="InvalidIdentityTokenException",b3="Key",_3="MalformedPolicyDocumentException",Py="MinimumSessionTokenSize",ky="Policy",My="PolicyArns",A3="ProviderArn",x3="ProvidedContexts",T3="ProvidedContextsListType",C3="ProvidedContext",I3="PolicyDescriptorType",R3="ProviderId",Dy="PackedPolicySize",v3="PackedPolicyTooLargeException",N3="Provider",Fy="RoleArn",O3="RegionDisabledException",Ly="RoleSessionName",P3="SecretAccessKey",k3="SubjectFromWebIdentityToken",jc="SourceIdentity",M3="SerialNumber",D3="SessionToken",Uy="SessionTokenSize",$y="SessionTokenUtilization",F3="Tags",L3="TokenCode",U3="TransitiveTagKeys",$3="Tag",B3="Value",H3="WebIdentityToken",z3="arn",q3="accessKeySecretType",$t="awsQueryError",Bt="client",V3="clientTokenType",Ht="error",qt="httpError",Vt="message",j3="policyDescriptorListType",By="smithy.ts.sdk.synthetic.com.amazonaws.sts",W3="tagListType",B="com.amazonaws.sts",Hy=new Ay(By),zy=[-3,By,"STSServiceException",0,[],[]];Hy.registerError(zy,Pe);var pt=new Ay(B),qy=[-3,B,y3,{[$t]:["ExpiredTokenException",400],[Ht]:Bt,[qt]:400},[Vt],[0]];pt.registerError(qy,_o);var Vy=[-3,B,S3,{[$t]:["IDPCommunicationError",400],[Ht]:Bt,[qt]:400},[Vt],[0]];pt.registerError(Vy,Ro);var jy=[-3,B,w3,{[$t]:["IDPRejectedClaim",403],[Ht]:Bt,[qt]:403},[Vt],[0]];pt.registerError(jy,Co);var Wy=[-3,B,E3,{[$t]:["InvalidIdentityToken",400],[Ht]:Bt,[qt]:400},[Vt],[0]];pt.registerError(Wy,Io);var Gy=[-3,B,_3,{[$t]:["MalformedPolicyDocument",400],[Ht]:Bt,[qt]:400},[Vt],[0]];pt.registerError(Gy,Ao);var Ky=[-3,B,v3,{[$t]:["PackedPolicyTooLarge",400],[Ht]:Bt,[qt]:400},[Vt],[0]];pt.registerError(Ky,xo);var Qy=[-3,B,O3,{[$t]:["RegionDisabledException",403],[Ht]:Bt,[qt]:403},[Vt],[0]];pt.registerError(Qy,To);var Xy=[Hy,pt],G3=[0,B,q3,8,0],K3=[0,B,V3,8,0],Wc=[3,B,qc,0,[a3,s3],[0,0],2],Yy=[3,B,c3,0,[Fy,Ly,My,ky,Oy,F3,U3,m3,M3,L3,jc,x3,Py],[0,0,()=>sS,0,1,()=>X3,64,0,0,0,0,()=>Q3,1],2],Jy=[3,B,u3,0,[Vc,qc,Dy,jc,$y,Uy],[[()=>Gc,0],()=>Wc,1,0,1,1]],Zy=[3,B,l3,0,[Fy,Ly,H3,R3,My,ky,Oy,Py],[0,0,[()=>K3,0],0,()=>sS,0,1,1],3],eS=[3,B,f3,0,[Vc,k3,qc,Dy,N3,h3,jc,$y,Uy],[[()=>Gc,0],0,()=>Wc,1,0,0,0,1,1]],Gc=[3,B,Vc,0,[o3,P3,D3,g3],[0,[()=>G3,0],0,4],4],tS=[3,B,I3,0,[z3],[0]],rS=[3,B,C3,0,[A3,p3],[0,0]],nS=[3,B,$3,0,[b3,B3],[0,0],2],sS=[1,B,j3,0,()=>tS],Q3=[1,B,T3,0,()=>rS],X3=[1,B,W3,0,()=>nS],oS=[9,B,i3,0,()=>Yy,()=>Jy],iS=[9,B,d3,0,()=>Zy,()=>eS],Y3=(t)=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??Lz,base64Encoder:t?.base64Encoder??Fz,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??Ry,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Jz,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new xy},{schemeId:"aws.auth#sigv4a",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4a"),signer:new Ty},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new wy}],logger:t?.logger??new ZH,protocol:t?.protocol??Hz,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:Xy,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:t?.serviceId??"STS",sha256:t?.sha256??zz,signerConstructor:t?.signerConstructor??Cy,urlParser:t?.urlParser??Ez,utf8Decoder:t?.utf8Decoder??Dz,utf8Encoder:t?.utf8Encoder??Mz}),J3=(t)=>{ez(process.version);let r=az(t),n=()=>r().then(tz),s=Y3(t);LH(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??ht(kz,o),bodyLengthChecker:t?.bodyLengthChecker??Uz,defaultUserAgentProvider:t?.defaultUserAgentProvider??UH({serviceId:s.serviceId,clientVersion:n3.version}),httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(i)=>i.getIdentityProvider("aws.auth#sigv4")||(async(u)=>await t.credentialDefaultProvider(u?.__config||{})()),signer:new xy},{schemeId:"aws.auth#sigv4a",identityProvider:(i)=>i.getIdentityProvider("aws.auth#sigv4a"),signer:new Ty},{schemeId:"smithy.api#noAuth",identityProvider:(i)=>i.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new wy}],maxAttempts:t?.maxAttempts??ht(Cz,t),region:t?.region??ht(dz,{...lz,...o}),requestHandler:Bz.create(t?.requestHandler??n),retryMode:t?.retryMode??ht({...Tz,default:async()=>(await n()).retryMode||xz},t),sigv4aSigningRegionSet:t?.sigv4aSigningRegionSet??ht(Pz,o),streamCollector:t?.streamCollector??$z,useDualstackEndpoint:t?.useDualstackEndpoint??ht(uz,o),useFipsEndpoint:t?.useFipsEndpoint??ht(cz,o),userAgentAppId:t?.userAgentAppId??ht($H,o)}},Z3=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},eq=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),tq=(t,r)=>{let n=Object.assign(BH(t),rz(t),bz(t),Z3(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,HH(n),nz(n),_z(n),eq(n))};class Cn extends _y{config;constructor(...[t]){let r=J3(t||{});super(r);this.initConfig=r;let n=e3(r),s=zH(n),o=Iz(s),i=fz(o),u=qH(i),a=Sz(u),d=Zz(a),l=tq(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(vz(this.config)),this.middlewareStack.use(VH(this.config)),this.middlewareStack.use(Rz(this.config)),this.middlewareStack.use(Az(this.config)),this.middlewareStack.use(jH(this.config)),this.middlewareStack.use(WH(this.config)),this.middlewareStack.use(GH(this.config)),this.middlewareStack.use(QH(this.config,{httpAuthSchemeParametersProvider:Qz,identityProviderConfigProvider:async(h)=>new XH({"aws.auth#sigv4":h.credentials,"aws.auth#sigv4a":h.credentials})})),this.middlewareStack.use(YH(this.config))}destroy(){super.destroy()}}var aS=sz(t3,"AWSSecurityTokenServiceV20110615","STSClient",wz),cS={},uS=(t,r,n,s)=>[];class vo extends aS(cS,uS,"AssumeRole",oS){}class No extends aS(cS,uS,"AssumeRoleWithWebIdentity",iS){}var rq={AssumeRoleCommand:vo,AssumeRoleWithWebIdentityCommand:No};class Kc extends Cn{}oz(rq,Kc);var dS=(t)=>{if(typeof t?.Arn==="string"){let r=t.Arn.split(":");if(r.length>4&&r[4]!=="")return r[4]}return},lS=async(t,r,n,s={})=>{let o=typeof t==="function"?await t():t,i=typeof r==="function"?await r():r,u="",a=o??i??(u=await KH(s)());return n?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${o} (credential provider clientConfig)`,`${i} (contextual client)`,`${u} (STS default: AWS_REGION, profile region, or us-east-1)`),a},nq=(t,r)=>{let n,s;return async(o,i)=>{if(s=o,!n){let{logger:h=t?.parentClientConfig?.logger,profile:f=t?.parentClientConfig?.profile,region:p,requestHandler:g=t?.parentClientConfig?.requestHandler,credentialProviderLogger:m,userAgentAppId:y=t?.parentClientConfig?.userAgentAppId}=t,S=await lS(p,t?.parentClientConfig?.region,m,{logger:h,profile:f}),w=!fS(g);n=new r({...t,userAgentAppId:y,profile:f,credentialDefaultProvider:()=>async()=>s,region:S,requestHandler:w?g:void 0,logger:h})}let{Credentials:u,AssumedRoleUser:a}=await n.send(new vo(i));if(!u||!u.AccessKeyId||!u.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);let d=dS(a),l={accessKeyId:u.AccessKeyId,secretAccessKey:u.SecretAccessKey,sessionToken:u.SessionToken,expiration:u.Expiration,...u.CredentialScope&&{credentialScope:u.CredentialScope},...d&&{accountId:d}};return Hc(l,"CREDENTIALS_STS_ASSUME_ROLE","i"),l}},sq=(t,r)=>{let n;return async(s)=>{if(!n){let{logger:d=t?.parentClientConfig?.logger,profile:l=t?.parentClientConfig?.profile,region:h,requestHandler:f=t?.parentClientConfig?.requestHandler,credentialProviderLogger:p,userAgentAppId:g=t?.parentClientConfig?.userAgentAppId}=t,m=await lS(h,t?.parentClientConfig?.region,p,{logger:d,profile:l}),y=!fS(f);n=new r({...t,userAgentAppId:g,profile:l,region:m,requestHandler:y?f:void 0,logger:d})}let{Credentials:o,AssumedRoleUser:i}=await n.send(new No(s));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${s.RoleArn}`);let u=dS(i),a={accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...u&&{accountId:u}};if(u)Hc(a,"RESOLVED_ACCOUNT_ID","T");return Hc(a,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),a}},fS=(t)=>t?.metadata?.handlerProtocol==="h2",hS=(t,r)=>{if(!r)return t;else return class extends t{constructor(s){super(s);for(let o of r)this.middlewareStack.use(o)}}},pS=(t={},r)=>nq(t,hS(Cn,r)),gS=(t={},r)=>sq(t,hS(Cn,r)),oq=(t)=>(r)=>t({roleAssumer:pS(r),roleAssumerWithWebIdentity:gS(r),...r});iq.AssumeRole$=oS;iq.AssumeRoleCommand=vo;iq.AssumeRoleRequest$=Yy;iq.AssumeRoleResponse$=Jy;iq.AssumeRoleWithWebIdentity$=iS;iq.AssumeRoleWithWebIdentityCommand=No;iq.AssumeRoleWithWebIdentityRequest$=Zy;iq.AssumeRoleWithWebIdentityResponse$=eS;iq.AssumedRoleUser$=Wc;iq.Credentials$=Gc;iq.ExpiredTokenException=_o;iq.ExpiredTokenException$=qy;iq.IDPCommunicationErrorException=Ro;iq.IDPCommunicationErrorException$=Vy;iq.IDPRejectedClaimException=Co;iq.IDPRejectedClaimException$=jy;iq.InvalidIdentityTokenException=Io;iq.InvalidIdentityTokenException$=Wy;iq.MalformedPolicyDocumentException=Ao;iq.MalformedPolicyDocumentException$=Gy;iq.PackedPolicyTooLargeException=xo;iq.PackedPolicyTooLargeException$=Ky;iq.PolicyDescriptorType$=tS;iq.ProvidedContext$=rS;iq.RegionDisabledException=To;iq.RegionDisabledException$=Qy;iq.STS=Kc;iq.STSClient=Cn;iq.STSServiceException=Pe;iq.STSServiceException$=zy;iq.Tag$=nS;iq.decorateDefaultCredentialProvider=oq;iq.errorTypeRegistries=Xy;iq.getDefaultRoleAssumer=pS;iq.getDefaultRoleAssumerWithWebIdentity=gS});var rw=e(function(VV){var{awsEndpointFunctions:Vq,emitWarningIfUnsupportedVersion:jq,createDefaultUserAgentProvider:Wq,NODE_APP_ID_CONFIG_OPTIONS:Gq,getAwsRegionExtensionConfiguration:Kq,resolveAwsRegionExtensionConfiguration:Qq,resolveUserAgentConfig:Xq,resolveHostHeaderConfig:Yq,getUserAgentPlugin:Jq,getHostHeaderPlugin:Zq,getLoggerPlugin:e6,getRecursionDetectionPlugin:t6}=Ce(),{NoAuthSigner:r6,getHttpAuthSchemeEndpointRuleSetPlugin:n6,DefaultIdentityProviderConfig:s6,getHttpSigningPlugin:o6}=Xe(),{normalizeProvider:OS,getSmithyContext:i6,ServiceException:a6,NoOpLogger:c6,emitWarningIfUnsupportedVersion:u6,loadConfigsForDefaultMode:d6,getDefaultExtensionConfiguration:l6,resolveDefaultRuntimeConfig:f6,Client:PS,makeBuilder:h6,createAggregatedClient:p6}=le(),{Command:g6}=le();VV.$Command=g6;VV.__Client=PS;var{resolveDefaultsModeConfig:m6,loadConfig:jt,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:y6,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:S6,NODE_REGION_CONFIG_OPTIONS:w6,NODE_REGION_CONFIG_FILE_OPTIONS:E6,resolveRegionConfig:b6}=V(),{BinaryDecisionDiagram:_6,EndpointCache:A6,decideEndpoint:x6,customEndpointFunctions:T6,resolveEndpointConfig:C6,getEndpointPlugin:I6}=He(),{parseUrl:R6,getHttpHandlerExtensionConfiguration:v6,resolveHttpHandlerRuntimeConfig:N6,getContentLengthPlugin:O6}=K(),{DEFAULT_RETRY_MODE:P6,NODE_RETRY_MODE_CONFIG_OPTIONS:k6,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:M6,resolveRetryConfig:D6,getRetryPlugin:F6}=cA(),{TypeRegistry:kS,getSchemaSerdePlugin:L6}=Te(),{resolveAwsSdkSigV4Config:U6,AwsSdkSigV4Signer:$6,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:B6}=$e(),{toUtf8:H6,fromUtf8:z6,toBase64:q6,fromBase64:V6,calculateBodyLength:j6}=X(),{streamCollector:W6,NodeHttpHandler:G6}=lA(),{AwsRestJsonProtocol:K6}=QA(),{Sha256:Q6}=gA(),X6=async(t,r,n)=>({operation:i6(r).operation,region:await OS(t.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Y6(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:t.region},propertiesExtractor:(r,n)=>({signingProperties:{config:r,context:n}})}}function J6(t){return{schemeId:"smithy.api#noAuth"}}var Z6=(t)=>{let r=[];switch(t.operation){case"CreateOAuth2Token":{r.push(J6());break}default:r.push(Y6(t))}return r},eV=(t)=>{let r=U6(t);return Object.assign(r,{authSchemePreference:OS(t.authSchemePreference??[])})},tV=(t)=>Object.assign(t,{useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"signin"}),rV={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},nV="3.997.45",sV={version:nV},yt="ref",gt=-1,mS=!1,Cr=!0,yS="isSet",Ir="booleanEquals",SS="coalesce",tu="PartitionResult",Ze="stringEquals",Xc="getAttr",wS="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",ES={[yt]:"Endpoint"},mt={fn:Xc,argv:[{[yt]:tu},"name"]},MS={[yt]:"Region"},bS={[yt]:tu},Oo={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},ce={},_S=[MS],AS={conditions:[[yS,_S],[Ir,[{fn:SS,argv:[{[yt]:"IsControlPlane"},mS]},Cr]],[yS,[ES]],["aws.partition",_S,tu],[Ir,[{[yt]:"UseFIPS"},Cr]],[Ze,[mt,"aws"]],[Ir,[{fn:SS,argv:[{[yt]:"IsOAuthEndpoint"},mS]},Cr]],[Ir,[{[yt]:"UseDualStack"},Cr]],[Ze,[mt,"aws-cn"]],[Ze,[MS,"us-gov-west-1"]],[Ze,[mt,"aws-us-gov"]],[Ir,[{fn:Xc,argv:[bS,"supportsFIPS"]},Cr]],[Ze,[mt,"aws-iso"]],[Ze,[mt,"aws-iso-b"]],[Ze,[mt,"aws-iso-f"]],[Ze,[mt,"aws-iso-e"]],[Ze,[mt,"aws-eusc"]],[Ir,[{fn:Xc,argv:[bS,"supportsDualStack"]},Cr]]],results:[[gt],["https://signin.{Region}.api.aws",Oo],["https://signin.{Region}.api.amazonwebservices.com.cn",Oo],[wS,Oo],[gt,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",Oo],["https://{Region}.signin.aws.amazon.com",ce],["https://{Region}.signin.amazonaws.cn",ce],["https://{Region}.signin.amazonaws-us-gov.com",ce],["https://{Region}.signin.c2shome.ic.gov",ce],["https://{Region}.signin.sc2shome.sgov.gov",ce],["https://{Region}.signin.csphome.hci.ic.gov",ce],["https://{Region}.signin.csphome.adc-e.uk",ce],["https://{Region}.signin.amazonaws-eusc.eu",ce],["https://signin-fips.amazonaws-us-gov.com",ce],["https://{Region}.signin-fips.amazonaws-us-gov.com",ce],["https://{Region}.signin.{PartitionResult#dnsSuffix}",ce],[gt,"Invalid Configuration: FIPS and custom endpoint are not supported"],[gt,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[ES,ce],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",ce],[gt,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",ce],[gt,"FIPS is enabled but this partition does not support FIPS"],[wS,ce],[gt,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",ce],[gt,"Invalid Configuration: Missing Region"]]},oV=2,O=1e8,iV=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,O+27,6,O+4,O+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,O+7,13,10,O+8,14,12,O+9,15,13,O+10,16,14,O+11,17,15,O+12,18,16,O+13,O+16,6,O+5,20,7,21,O+6,17,O+24,O+25,6,O+4,23,7,27,24,9,O+14,25,10,O+15,26,11,O+22,O+23,11,28,O+21,17,O+20,O+21,2,35,30,3,39,31,4,32,O+27,6,O+4,33,7,O+27,34,9,O+14,O+27,3,39,36,4,38,37,7,O+18,O+19,6,O+4,O+17,5,O+1,40,8,O+2,O+3]),aV=_6.from(iV,oV,AS.conditions,AS.results),cV=new A6({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),uV=(t,r={})=>cV.get(t,()=>x6(aV,{endpointParams:t,logger:r.logger}));T6.aws=Vq;class wt extends a6{constructor(t){super(t);Object.setPrototypeOf(this,wt.prototype)}}class ko extends wt{name="AccessDeniedException";$fault="client";error;constructor(t){super({name:"AccessDeniedException",$fault:"client",...t});Object.setPrototypeOf(this,ko.prototype),this.error=t.error}}class Mo extends wt{name="InternalServerException";$fault="server";error;constructor(t){super({name:"InternalServerException",$fault:"server",...t});Object.setPrototypeOf(this,Mo.prototype),this.error=t.error}}class Do extends wt{name="TooManyRequestsError";$fault="client";error;constructor(t){super({name:"TooManyRequestsError",$fault:"client",...t});Object.setPrototypeOf(this,Do.prototype),this.error=t.error}}class Fo extends wt{name="ValidationException";$fault="client";error;constructor(t){super({name:"ValidationException",$fault:"client",...t});Object.setPrototypeOf(this,Fo.prototype),this.error=t.error}}var dV="AccessDeniedException",lV="AccessToken",fV="CreateOAuth2Token",hV="CreateOAuth2TokenRequest",pV="CreateOAuth2TokenRequestBody",gV="CreateOAuth2TokenResponseBody",mV="CreateOAuth2TokenResponse",yV="CreateOAuth2TokenWithIAM",SV="CreateOAuth2TokenWithIAMRequest",wV="CreateOAuth2TokenWithIAMResponse",EV="InternalServerException",bV="OAuthAccessToken",_V="RefreshToken",AV="TooManyRequestsError",xV="ValidationException",xS="accessKeyId",Yc="accessToken",TV="access_token",ru="client",TS="clientId",CS="codeVerifier",CV="code",St="error",Jc="expiresIn",IV="expires_in",Zc="grantType",RV="grant_type",DS="http",nu="httpError",IS="idToken",oe="jsonName",Lo="message",vV="resource",Po="refreshToken",RS="redirectUri",FS="smithy.ts.sdk.synthetic.com.amazonaws.signin",vS="secretAccessKey",NS="sessionToken",NV="server",OV="tokenInput",PV="tokenOutput",eu="tokenType",kV="token_type",ue="com.amazonaws.signin",LS=new kS(FS),US=[-3,FS,"SigninServiceException",0,[],[]];LS.registerError(US,wt);var In=new kS(ue),$S=[-3,ue,dV,{[St]:ru},[St,Lo],[0,0],2];In.registerError($S,ko);var BS=[-3,ue,EV,{[St]:NV,[nu]:500},[St,Lo],[0,0],2];In.registerError(BS,Mo);var HS=[-3,ue,AV,{[St]:ru,[nu]:429},[St,Lo],[0,0],2];In.registerError(HS,Do);var zS=[-3,ue,xV,{[St]:ru,[nu]:400},[St,Lo],[0,0],2];In.registerError(zS,Fo);var qS=[LS,In],MV=[0,ue,bV,8,0],VS=[0,ue,_V,8,0],jS=[3,ue,lV,8,[xS,vS,NS],[[0,{[oe]:xS}],[0,{[oe]:vS}],[0,{[oe]:NS}]],3],WS=[3,ue,hV,0,[OV],[[()=>GS,16]],1],GS=[3,ue,pV,0,[TS,Zc,CV,RS,CS,Po],[[0,{[oe]:TS}],[0,{[oe]:Zc}],0,[0,{[oe]:RS}],[0,{[oe]:CS}],[()=>VS,{[oe]:Po}]],2],KS=[3,ue,mV,0,[PV],[[()=>QS,16]],1],QS=[3,ue,gV,0,[Yc,eu,Jc,Po,IS],[[()=>jS,{[oe]:Yc}],[0,{[oe]:eu}],[1,{[oe]:Jc}],[()=>VS,{[oe]:Po}],[0,{[oe]:IS}]],4],XS=[3,ue,SV,0,[Zc,vV],[[0,{[oe]:RV}],0],2],YS=[3,ue,wV,0,[Yc,eu,Jc],[[()=>MV,{[oe]:TV}],[0,{[oe]:kV}],[1,{[oe]:IV}]],3],JS=[9,ue,fV,{[DS]:["POST","/v1/token",200]},()=>WS,()=>KS],ZS=[9,ue,yV,{[DS]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>XS,()=>YS],DV=(t)=>({apiVersion:"2023-01-01",base64Decoder:t?.base64Decoder??V6,base64Encoder:t?.base64Encoder??q6,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??uV,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??Z6,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new $6},{schemeId:"smithy.api#noAuth",identityProvider:(r)=>r.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new r6}],logger:t?.logger??new c6,protocol:t?.protocol??K6,protocolSettings:t?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:qS,version:"2023-01-01",serviceTarget:"Signin"},serviceId:t?.serviceId??"Signin",sha256:t?.sha256??Q6,urlParser:t?.urlParser??R6,utf8Decoder:t?.utf8Decoder??z6,utf8Encoder:t?.utf8Encoder??H6}),FV=(t)=>{u6(process.version);let r=m6(t),n=()=>r().then(d6),s=DV(t);jq(process.version);let o={profile:t?.profile,logger:s.logger};return{...s,...t,runtime:"node",defaultsMode:r,authSchemePreference:t?.authSchemePreference??jt(B6,o),bodyLengthChecker:t?.bodyLengthChecker??j6,defaultUserAgentProvider:t?.defaultUserAgentProvider??Wq({serviceId:s.serviceId,clientVersion:sV.version}),maxAttempts:t?.maxAttempts??jt(M6,t),region:t?.region??jt(w6,{...E6,...o}),requestHandler:G6.create(t?.requestHandler??n),retryMode:t?.retryMode??jt({...k6,default:async()=>(await n()).retryMode||P6},t),streamCollector:t?.streamCollector??W6,useDualstackEndpoint:t?.useDualstackEndpoint??jt(S6,o),useFipsEndpoint:t?.useFipsEndpoint??jt(y6,o),userAgentAppId:t?.userAgentAppId??jt(Gq,o)}},LV=(t)=>{let{httpAuthSchemes:r,httpAuthSchemeProvider:n,credentials:s}=t;return{setHttpAuthScheme(o){let i=r.findIndex((u)=>u.schemeId===o.schemeId);if(i===-1)r.push(o);else r.splice(i,1,o)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(o){n=o},httpAuthSchemeProvider(){return n},setCredentials(o){s=o},credentials(){return s}}},UV=(t)=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()}),$V=(t,r)=>{let n=Object.assign(Kq(t),l6(t),v6(t),LV(t));return r.forEach((s)=>s.configure(n)),Object.assign(t,Qq(n),f6(n),N6(n),UV(n))};class su extends PS{config;constructor(...[t]){let r=FV(t||{});super(r);this.initConfig=r;let n=tV(r),s=Xq(n),o=D6(s),i=b6(o),u=Yq(i),a=C6(u),d=eV(a),l=$V(d,t?.extensions||[]);this.config=l,this.middlewareStack.use(L6(this.config)),this.middlewareStack.use(Jq(this.config)),this.middlewareStack.use(F6(this.config)),this.middlewareStack.use(O6(this.config)),this.middlewareStack.use(Zq(this.config)),this.middlewareStack.use(e6(this.config)),this.middlewareStack.use(t6(this.config)),this.middlewareStack.use(n6(this.config,{httpAuthSchemeParametersProvider:X6,identityProviderConfigProvider:async(h)=>new s6({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(o6(this.config))}destroy(){super.destroy()}}var ew=h6(rV,"Signin","SigninClient",I6),BV={IsControlPlane:{type:"staticContextParams",value:!1}},HV={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},tw=(t,r,n,s)=>[];class ou extends ew(BV,tw,"CreateOAuth2Token",JS){}class iu extends ew(HV,tw,"CreateOAuth2TokenWithIAM",ZS){}var zV={CreateOAuth2TokenCommand:ou,CreateOAuth2TokenWithIAMCommand:iu};class au extends su{}p6(zV,au);var qV={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};VV.AccessDeniedException=ko;VV.AccessDeniedException$=$S;VV.AccessToken$=jS;VV.CreateOAuth2Token$=JS;VV.CreateOAuth2TokenCommand=ou;VV.CreateOAuth2TokenRequest$=WS;VV.CreateOAuth2TokenRequestBody$=GS;VV.CreateOAuth2TokenResponse$=KS;VV.CreateOAuth2TokenResponseBody$=QS;VV.CreateOAuth2TokenWithIAM$=ZS;VV.CreateOAuth2TokenWithIAMCommand=iu;VV.CreateOAuth2TokenWithIAMRequest$=XS;VV.CreateOAuth2TokenWithIAMResponse$=YS;VV.InternalServerException=Mo;VV.InternalServerException$=BS;VV.OAuth2ErrorCode=qV;VV.Signin=au;VV.SigninClient=su;VV.SigninServiceException=wt;VV.SigninServiceException$=US;VV.TooManyRequestsError=Do;VV.TooManyRequestsError$=HS;VV.ValidationException=Fo;VV.ValidationException$=zS;VV.errorTypeRegistries=qS});var sw=e(function(vj){var{setCredentialFeature:Sj}=Ce(),{CredentialsProviderError:Et,parseKnownFiles:wj,getProfileName:Ej}=V(),{HttpRequest:bj}=K(),{createHash:_j,createPrivateKey:Aj,createPublicKey:xj,sign:Tj}=c("node:crypto"),{promises:cu}=c("node:fs"),{homedir:Cj}=c("node:os"),{dirname:Ij,join:nw}=c("node:path");class Uo{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(t,r,n){this.profileData=t,this.init=r,this.callerClientConfig=n}async loadCredentials(){let t=await this.loadToken();if(!t)throw new Et(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let r=t.accessToken,n=Date.now();if(new Date(r.expiresAt).getTime()-n<=Uo.REFRESH_THRESHOLD)return this.refresh(t);return this.toCredentials(t.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(t){return{accessKeyId:t.accessKeyId,secretAccessKey:t.secretAccessKey,sessionToken:t.sessionToken,accountId:t.accountId,expiration:new Date(t.expiresAt)}}async refresh(t){let r=await this.loadToken().catch(()=>t),n=Date.now(),s=new Date(r.accessToken.expiresAt).getTime(),o=new Date(t.accessToken.expiresAt).getTime(),i=s<=n&&o>n?t:r;if(new Date(i.accessToken.expiresAt).getTime()-Date.now()>Uo.REFRESH_THRESHOLD)return this.toCredentials(i.accessToken);let{SigninClient:a,CreateOAuth2TokenCommand:d}=rw(),{logger:l,userAgentAppId:h}=this.callerClientConfig??{},p=((S)=>S?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,g=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,m=new a({credentials:{accessKeyId:"",secretAccessKey:""},region:g,requestHandler:p,logger:l,userAgentAppId:h,...this.init?.clientConfig});this.createDPoPInterceptor(m.middlewareStack);let y={tokenInput:{clientId:i.clientId,refreshToken:i.refreshToken,grantType:"refresh_token"}};try{let S=await m.send(new d(y)),{accessKeyId:w,secretAccessKey:E,sessionToken:A}=S.tokenOutput?.accessToken??{},{refreshToken:v,expiresIn:L}=S.tokenOutput??{};if(!w||!E||!A||!v)throw new Et("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let k=(L??900)*1000,U=new Date(Date.now()+k),de={...i,accessToken:{...i.accessToken,accessKeyId:w,secretAccessKey:E,sessionToken:A,expiresAt:U.toISOString()},refreshToken:v};return await this.saveToken(de),this.toCredentials(de.accessToken)}catch(S){if(S.name==="AccessDeniedException"){let E=S.error,A;switch(E){case"TOKEN_EXPIRED":A="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":A="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":A="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:A=`Failed to refresh token: ${String(S)}. Please re-authenticate using \`aws login\``}throw new Et(A,{logger:this.logger,tryNextLink:!1})}if(new Date(i.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(S)}. Using existing token until expiry.`),this.toCredentials(i.accessToken);throw new Et(`Failed to refresh token: ${String(S)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let t=this.getTokenFilePath();try{let r=await cu.readFile(t,"utf8"),n=JSON.parse(r),s=["accessToken","clientId","refreshToken","dpopKey"].filter((o)=>!n[o]);if(!n.accessToken?.accountId)s.push("accountId");if(s.length>0)throw new Et(`Token validation failed, missing fields: ${s.join(", ")}`,{logger:this.logger,tryNextLink:!1});return n}catch(r){throw new Et(`Failed to load token from ${t}: ${String(r)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(t){let r=this.getTokenFilePath(),n=Ij(r);try{await cu.mkdir(n,{recursive:!0})}catch(s){}await cu.writeFile(r,JSON.stringify(t,null,2),"utf8")}getTokenFilePath(){let t=process.env.AWS_LOGIN_CACHE_DIRECTORY??nw(Cj(),".aws","login","cache"),r=Buffer.from(this.loginSession,"utf8"),n=_j("sha256").update(r).digest("hex");return nw(t,`${n}.json`)}derToRawSignature(t){let r=2;if(t[r]!==2)throw Error("Invalid DER signature");r++;let n=t[r++],s=t.subarray(r,r+n);if(r+=n,t[r]!==2)throw Error("Invalid DER signature");r++;let o=t[r++],i=t.subarray(r,r+o);s=s[0]===0?s.subarray(1):s,i=i[0]===0?i.subarray(1):i;let u=Buffer.concat([Buffer.alloc(32-s.length),s]),a=Buffer.concat([Buffer.alloc(32-i.length),i]);return Buffer.concat([u,a])}createDPoPInterceptor(t){t.add((r)=>async(n)=>{if(bj.isInstance(n.request)){let s=n.request,o=`${s.protocol}//${s.hostname}${s.port?`:${s.port}`:""}${s.path}`,i=await this.generateDpop(s.method,o);s.headers={...s.headers,DPoP:i}}return r(n)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(t="POST",r){let n=await this.loadToken();try{let s=Aj({key:n.dpopKey,format:"pem",type:"sec1"}),i=xj(s).export({format:"der",type:"spki"}),u=-1;for(let w=0;w<i.length;w++)if(i[w]===4){u=w;break}let a=i.slice(u+1,u+33),d=i.slice(u+33,u+65),l={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:a.toString("base64url"),y:d.toString("base64url")}},h={jti:crypto.randomUUID(),htm:t,htu:r,iat:Math.floor(Date.now()/1000)},f=Buffer.from(JSON.stringify(l)).toString("base64url"),p=Buffer.from(JSON.stringify(h)).toString("base64url"),g=`${f}.${p}`,m=Tj("sha256",Buffer.from(g),s),S=this.derToRawSignature(m).toString("base64url");return`${g}.${S}`}catch(s){throw new Et(`Failed to generate Dpop proof: ${s instanceof Error?s.message:String(s)}`,{logger:this.logger,tryNextLink:!1})}}}var Rj=(t)=>async({callerClientConfig:r}={})=>{t?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let n=await wj(t||{}),s=Ej({profile:t?.profile??r?.profile}),o=n[s];if(!o?.login_session)throw new Et(`Profile ${s} does not contain login_session.`,{tryNextLink:!0,logger:t?.logger});let u=await new Uo(o,t,r).loadCredentials();return Sj(u,"CREDENTIALS_LOGIN","AD")};vj.fromLoginCredentials=Rj});var du=e(function(Bj){var{externalDataInterceptor:Oj,CredentialsProviderError:uu,parseKnownFiles:Pj,getProfileName:kj}=V(),{exec:Mj}=c("node:child_process"),{promisify:Dj}=c("node:util"),{setCredentialFeature:Fj}=Ce(),Lj=(t,r,n)=>{if(r.Version!==1)throw Error(`Profile ${t} credential_process did not return Version 1.`);if(r.AccessKeyId===void 0||r.SecretAccessKey===void 0)throw Error(`Profile ${t} credential_process returned invalid credentials.`);if(r.Expiration){let i=new Date;if(new Date(r.Expiration)<i)throw Error(`Profile ${t} credential_process returned expired credentials.`)}let s=r.AccountId;if(!s&&n?.[t]?.aws_account_id)s=n[t].aws_account_id;let o={accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,...r.SessionToken&&{sessionToken:r.SessionToken},...r.Expiration&&{expiration:new Date(r.Expiration)},...r.CredentialScope&&{credentialScope:r.CredentialScope},...s&&{accountId:s}};return Fj(o,"CREDENTIALS_PROCESS","w"),o},Uj=async(t,r,n)=>{let s=r[t];if(r[t]){let o=s.credential_process;if(o!==void 0){let i=Dj(Oj?.getTokenRecord?.().exec??Mj);try{let{stdout:u}=await i(o),a;try{a=JSON.parse(u.trim())}catch{throw Error(`Profile ${t} credential_process returned invalid JSON.`)}return Lj(t,a,r)}catch(u){throw new uu(u.message,{logger:n})}}else throw new uu(`Profile ${t} did not contain credential_process.`,{logger:n})}else throw new uu(`Profile ${t} could not be found in shared credentials file.`,{logger:n})},$j=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");let n=await Pj(t);return Uj(kj({profile:t.profile??r?.profile}),n,t.logger)};Bj.fromProcess=$j});var lu=e(function(Gj){var{setCredentialFeature:zj}=Ce(),{CredentialsProviderError:qj,externalDataInterceptor:Vj}=V(),{readFileSync:jj}=c("node:fs"),ow=(t)=>async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:n,roleSessionName:s,webIdentityToken:o,providerId:i,policyArns:u,policy:a,durationSeconds:d}=t,{roleAssumerWithWebIdentity:l}=t;if(!l){let{getDefaultRoleAssumerWithWebIdentity:h}=Qc();l=h({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:{...r?.callerClientConfig,...t.parentClientConfig}},t.clientPlugins)}return l({RoleArn:n,RoleSessionName:s??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:o,ProviderId:i,PolicyArns:u,Policy:a,DurationSeconds:d})},Wj=(t={})=>async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let n=t?.webIdentityTokenFile??process.env.AWS_WEB_IDENTITY_TOKEN_FILE,s=t?.roleArn??process.env.AWS_ROLE_ARN,o=t?.roleSessionName??process.env.AWS_ROLE_SESSION_NAME;if(!n||!s)throw new qj("Web identity configuration not specified",{logger:t.logger});let i=await ow({...t,webIdentityToken:Vj?.getTokenRecord?.()[n]??jj(n,{encoding:"ascii"}),roleArn:s,roleSessionName:o})(r);if(n===process.env.AWS_WEB_IDENTITY_TOKEN_FILE)zj(i,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return i};Gj.fromTokenFile=Wj;Gj.fromWebToken=ow});var lw=e(function(f8){var{CredentialsProviderError:$o,chain:Xj,getProfileName:uw,parseKnownFiles:Yj}=V(),{setCredentialFeature:et}=Ce(),Jj=(t,r,n)=>{let s={EcsContainer:async(o)=>{let{fromHttp:i}=Ua(),{fromContainerMetadata:u}=As();return n?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>Xj(i(o??{}),u(o))().then(fu)},Ec2InstanceMetadata:async(o)=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");let{fromInstanceMetadata:i}=As();return async()=>i(o)().then(fu)},Environment:async(o)=>{n?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");let{fromEnv:i}=va();return async()=>i(o)().then(fu)}};if(t in s)return s[t];else throw new $o(`Unsupported credential source in profile ${r}. Got ${t}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:n})},fu=(t)=>et(t,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p"),Zj=(t,{profile:r="default",logger:n}={})=>Boolean(t)&&typeof t==="object"&&typeof t.role_arn==="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1&&["undefined","string"].indexOf(typeof t.external_id)>-1&&["undefined","string"].indexOf(typeof t.mfa_serial)>-1&&(e8(t,{profile:r,logger:n})||t8(t,{profile:r,logger:n})),e8=(t,{profile:r,logger:n})=>{let s=typeof t.source_profile==="string"&&typeof t.credential_source>"u";if(s)n?.debug?.(` ${r} isAssumeRoleWithSourceProfile source_profile=${t.source_profile}`);return s},t8=(t,{profile:r,logger:n})=>{let s=typeof t.credential_source==="string"&&typeof t.source_profile>"u";if(s)n?.debug?.(` ${r} isCredentialSourceProfile credential_source=${t.credential_source}`);return s},r8=async(t,r,n,s,o={},i)=>{n.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");let u=r[t],{source_profile:a,region:d}=u;if(!n.roleAssumer){let{getDefaultRoleAssumer:h}=Qc();n.roleAssumer=h({...n.clientConfig,credentialProviderLogger:n.logger,parentClientConfig:{...s,...n?.parentClientConfig,region:d??n?.parentClientConfig?.region??s?.region}},n.clientPlugins)}if(a&&a in o)throw new $o(`Detected a cycle attempting to resolve credentials for profile ${uw(n)}. Profiles visited: `+Object.keys(o).join(", "),{logger:n.logger});n.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${a?`source_profile=[${a}]`:`profile=[${t}]`}`);let l=a?i(a,r,n,s,{...o,[a]:!0},iw(r[a]??{})):(await Jj(u.credential_source,t,n.logger)(n))();if(iw(u))return l.then((h)=>et(h,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{let h={RoleArn:u.role_arn,RoleSessionName:u.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:u.external_id,DurationSeconds:parseInt(u.duration_seconds||"3600",10)},{mfa_serial:f}=u;if(f){if(!n.mfaCodeProvider)throw new $o(`Profile ${t} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:n.logger,tryNextLink:!1});h.SerialNumber=f,h.TokenCode=await n.mfaCodeProvider(f)}let p=await l;return n.roleAssumer(p,h).then((g)=>et(g,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},iw=(t)=>!t.role_arn&&!!t.credential_source,n8=(t)=>Boolean(t&&t.login_session),s8=async(t,r,n)=>{let{fromLoginCredentials:s}=sw(),o=await s({...r,profile:t})({callerClientConfig:n});return et(o,"CREDENTIALS_PROFILE_LOGIN","AC")},o8=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.credential_process==="string",i8=async(t,r)=>{let{fromProcess:n}=du(),s=await n({...t,profile:r})();return et(s,"CREDENTIALS_PROFILE_PROCESS","v")},a8=async(t,r,n={},s)=>{let{fromSSO:o}=Lc();return o({profile:t,logger:n.logger,parentClientConfig:n.parentClientConfig,clientConfig:n.clientConfig})({callerClientConfig:s}).then((i)=>{if(r.sso_session)return et(i,"CREDENTIALS_PROFILE_SSO","r");else return et(i,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},c8=(t)=>t&&(typeof t.sso_start_url==="string"||typeof t.sso_account_id==="string"||typeof t.sso_session==="string"||typeof t.sso_region==="string"||typeof t.sso_role_name==="string"),aw=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.aws_access_key_id==="string"&&typeof t.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof t.aws_session_token)>-1&&["undefined","string"].indexOf(typeof t.aws_account_id)>-1,cw=async(t,r)=>{r?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");let n={accessKeyId:t.aws_access_key_id,secretAccessKey:t.aws_secret_access_key,sessionToken:t.aws_session_token,...t.aws_credential_scope&&{credentialScope:t.aws_credential_scope},...t.aws_account_id&&{accountId:t.aws_account_id}};return et(n,"CREDENTIALS_PROFILE","n")},u8=(t)=>Boolean(t)&&typeof t==="object"&&typeof t.web_identity_token_file==="string"&&typeof t.role_arn==="string"&&["undefined","string"].indexOf(typeof t.role_session_name)>-1,d8=async(t,r,n)=>{let{fromTokenFile:s}=lu(),o=await s({webIdentityTokenFile:t.web_identity_token_file,roleArn:t.role_arn,roleSessionName:t.role_session_name,roleAssumerWithWebIdentity:r.roleAssumerWithWebIdentity,logger:r.logger,parentClientConfig:r.parentClientConfig})({callerClientConfig:n});return et(o,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")},dw=async(t,r,n,s,o={},i=!1)=>{let u=r[t];if(Object.keys(o).length>0&&aw(u))return cw(u,n);if(i||Zj(u,{profile:t,logger:n.logger}))return r8(t,r,n,s,o,dw);if(aw(u))return cw(u,n);if(u8(u))return d8(u,n,s);if(o8(u))return i8(n,t);if(c8(u))return await a8(t,u,n,s);if(n8(u))return s8(t,n,s);throw new $o(`Could not resolve credentials using profile: [${t}] in configuration/credentials file(s).`,{logger:n.logger})},l8=(t={})=>async({callerClientConfig:r}={})=>{t.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");let n=await Yj(t);return dw(uw({profile:t.profile??r?.profile}),n,t,r)};f8.fromIni=l8});var zt=e(function(x8){var{ENV_KEY:p8,ENV_SECRET:g8,fromEnv:m8}=va(),{chain:y8,CredentialsProviderError:Bo,ENV_PROFILE:S8}=V(),w8=async(t)=>{let{ENV_CMDS_FULL_URI:r,ENV_CMDS_RELATIVE_URI:n,fromContainerMetadata:s,fromInstanceMetadata:o}=As();if(process.env[n]||process.env[r]){t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");let{fromHttp:i}=Ua();return y8(i(t),s(t))}if(process.env.AWS_EC2_METADATA_DISABLED&&process.env.AWS_EC2_METADATA_DISABLED!=="false")return async()=>{throw new Bo("EC2 Instance Metadata Service access disabled",{logger:t.logger})};return t.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),o(t)};function E8(t,r){let n=b8(t),s,o,i,u,a=async(d)=>{if(d?.forceRefresh){if(!u)u=n(d).then((l)=>{i=l}).finally(()=>{u=void 0});return await u,i}if(i?.expiration){if(i?.expiration?.getTime()<Date.now())i=void 0}if(s)await s;else if(!i||r?.(i))if(i){if(!o)o=n(d).then((l)=>{i=l}).catch(()=>{}).finally(()=>{o=void 0})}else return s=n(d).then((l)=>{i=l}).finally(()=>{s=void 0}),a(d);return i};return a}var b8=(t)=>async(r)=>{let n;for(let s of t)try{return await s(r)}catch(o){if(n=o,o?.tryNextLink)continue;throw o}throw n},fw=!1,_8=(t={})=>E8([async()=>{if(t.profile??process.env[S8]){if(process.env[p8]&&process.env[g8]){if(!fw)(t.logger?.warn&&t.logger?.constructor?.name!=="NoOpLogger"?t.logger.warn.bind(t.logger):console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
52
|
-
Multiple credential sources detected:
|
|
53
|
-
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
54
|
-
This SDK will proceed with the AWS_PROFILE value.
|
|
55
|
-
|
|
56
|
-
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
57
|
-
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
58
|
-
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
59
|
-
`),fw=!0}throw new Bo("AWS_PROFILE is set, skipping fromEnv provider.",{logger:t.logger,tryNextLink:!0})}return t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),m8(t)()},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");let{ssoStartUrl:n,ssoAccountId:s,ssoRegion:o,ssoRoleName:i,ssoSession:u}=t;if(!n&&!s&&!o&&!i&&!u)throw new Bo("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:t.logger});let{fromSSO:a}=Lc();return a(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");let{fromIni:n}=lw();return n(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");let{fromProcess:n}=du();return n(t)(r)},async(r)=>{t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");let{fromTokenFile:n}=lu();return n(t)(r)},async()=>(t.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await w8(t))()),async()=>{throw new Bo("Could not load credentials from any providers",{tryNextLink:!1,logger:t.logger})}],hw),A8=(t)=>t?.expiration!==void 0,hw=(t)=>t?.expiration!==void 0&&t.expiration.getTime()-Date.now()<300000;x8.credentialsTreatedAsExpired=hw;x8.credentialsWillNeedRefresh=A8;x8.defaultProvider=_8});var Zt=e(function(D8){var{EventStreamCodec:R8}=yA(),{Transform:v8,Readable:N8,PassThrough:O8,pipeline:P8}=c("node:stream");class pw extends v8{priorSignature;messageSigner;eventStreamCodec;systemClockOffsetProvider;staticCredentials;constructor(t){super({autoDestroy:!0,readableObjectMode:!0,writableObjectMode:!0,...t});this.priorSignature=t.priorSignature,this.eventStreamCodec=t.eventStreamCodec,this.messageSigner=t.messageSigner,this.systemClockOffsetProvider=t.systemClockOffsetProvider,this.staticCredentials=t.credentials?.()}async _transform(t,r,n){try{let s=new Date(Date.now()+await this.systemClockOffsetProvider()),o={":date":{type:"timestamp",value:s}},i=await this.messageSigner.sign({message:{body:t,headers:o},priorSignature:this.priorSignature},{signingDate:s,eventStreamCredentials:await this.staticCredentials});this.priorSignature=i.signature;let u=this.eventStreamCodec.encode({headers:{...o,":chunk-signature":{type:"binary",value:k8(i.signature)}},body:t});return this.push(u),n()}catch(s){n(s)}}}function k8(t){let r=Buffer.from(t,"hex");return new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT)}class gw{messageSigner;eventStreamCodec;systemClockOffsetProvider;credentials;constructor(t){this.messageSigner=t.messageSigner,this.eventStreamCodec=new R8(t.utf8Encoder,t.utf8Decoder),this.systemClockOffsetProvider=async()=>t.systemClockOffset??0,this.credentials=t.credentials}async handle(t,r,n={}){let s=r.request,{body:o,query:i}=s;if(!(o instanceof N8))throw Error("Eventstream payload must be a Readable stream.");s.body=new O8({objectMode:!0});let a=s.headers?.authorization?.match(/Signature=([\w]+)$/)?.[1]??i?.["X-Amz-Signature"]??"";if(n.__staticSignature)a="";let d=new pw({priorSignature:a,eventStreamCodec:this.eventStreamCodec,messageSigner:await this.messageSigner(),systemClockOffsetProvider:this.systemClockOffsetProvider,credentials:this.credentials}),l,h=new Promise((p,g)=>{l=()=>p(void 0),P8(o,d,s.body,(m)=>{if(m)g(Error(`Pipeline error in @aws-sdk/eventstream-handler-node: ${m.message}`,{cause:m}))})}),f;try{f=await Promise.race([t(r),h])}catch(p){throw s.body.end(),p}finally{l()}return f}}var M8=(t)=>new gw(t);D8.eventStreamPayloadHandlerProvider=M8});
|
|
60
|
-
export{Te,le,V,He,X,gA,yA,K,cA,Xe,Ce,Wt,$e,lA,QA,bn,zt,Zt};
|
|
61
|
-
|
|
62
|
-
//# debugId=6DB9D8ADBEB34B9E64756E2164756E21
|
|
63
|
-
//# sourceMappingURL=index-fcqy46mh.js.map
|