@stacksjs/buddy 0.70.21 → 0.70.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/chunk-1nq7pv3c.js +7 -0
  2. package/dist/{chunk-ks9kq37e.js → chunk-29k4nndh.js} +1 -1
  3. package/dist/chunk-39dwerh8.js +5 -0
  4. package/dist/{chunk-cptthhq1.js → chunk-3zqgxrhy.js} +2 -2
  5. package/dist/chunk-496r9jw6.js +3 -0
  6. package/dist/{chunk-68apz1e2.js → chunk-4k60zpwd.js} +1 -1
  7. package/dist/chunk-51tnc6dm.js +2 -0
  8. package/dist/{chunk-2ddgyqnt.js → chunk-5nbczt72.js} +2 -2
  9. package/dist/chunk-6fsr2f40.js +10 -0
  10. package/dist/{chunk-88nz529r.js → chunk-7pg49t20.js} +1 -1
  11. package/dist/chunk-8d01gfhw.js +2 -0
  12. package/dist/{chunk-hjdz5p2e.js → chunk-8kjkww7q.js} +2 -2
  13. package/dist/{chunk-9j2yq17h.js → chunk-97pfgxpz.js} +1 -1
  14. package/dist/chunk-a47wfx2k.js +2 -0
  15. package/dist/{chunk-qgs8ygf0.js → chunk-ftse0wqn.js} +359 -359
  16. package/dist/{chunk-z4zm45jz.js → chunk-jffk6kjy.js} +1 -1
  17. package/dist/{chunk-whp9hjd8.js → chunk-kg8bv5wt.js} +1 -1
  18. package/dist/{chunk-x0ahr107.js → chunk-knytfag6.js} +1 -1
  19. package/dist/{chunk-2pj0cr49.js → chunk-ksjzw2hp.js} +1 -1
  20. package/dist/{chunk-dmewpnnj.js → chunk-mk0bde63.js} +1 -1
  21. package/dist/{chunk-am6xbcgg.js → chunk-qm8eqyn5.js} +1 -1
  22. package/dist/{chunk-tndmgyk5.js → chunk-rdgds02z.js} +1 -1
  23. package/dist/chunk-sk9vc7y5.js +1 -0
  24. package/dist/{chunk-d9bheak7.js → chunk-sq3kqg71.js} +2 -2
  25. package/dist/{chunk-fk8jrqrt.js → chunk-t2wb516a.js} +1 -1
  26. package/dist/{chunk-x46hz7dc.js → chunk-t4y0mz3y.js} +1 -1
  27. package/dist/{chunk-czbsbg0s.js → chunk-vgn2n3rk.js} +1 -1
  28. package/dist/chunk-wzns1fp3.js +1 -0
  29. package/dist/chunk-xc6fz0pt.js +2 -0
  30. package/dist/{chunk-nec9r4e3.js → chunk-xfhw9xck.js} +1 -1
  31. package/dist/{chunk-j2vy37bj.js → chunk-yzwe58rn.js} +2 -2
  32. package/dist/cli.js +1 -1
  33. package/dist/index.js +1 -1
  34. package/package.json +52 -46
  35. package/dist/chunk-29rpwqgr.js +0 -1
  36. package/dist/chunk-7v1e78ya.js +0 -2
  37. package/dist/chunk-90stqnfr.js +0 -6
  38. package/dist/chunk-dcgjjy48.js +0 -3
  39. package/dist/chunk-p4y8yzm3.js +0 -2
  40. package/dist/chunk-qwdsyzdj.js +0 -1
  41. package/dist/chunk-ran3mnve.js +0 -2
  42. package/dist/chunk-tr3hrxn5.js +0 -2
  43. package/dist/chunk-vm9jcwg8.js +0 -5
  44. package/dist/chunk-xn1pvpj0.js +0 -10
@@ -1,10 +0,0 @@
1
- import{Tc as U,Wc as h}from"./chunk-2pj0cr49.js";var E0=U((Zw,k0)=>{var{defineProperty:u,getOwnPropertyDescriptor:o6,getOwnPropertyNames:e6}=Object,$4=Object.prototype.hasOwnProperty,l=($,w)=>u($,"name",{value:w,configurable:!0}),w4=($,w)=>{for(var z in w)u($,z,{get:w[z],enumerable:!0})},z4=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of e6(w))if(!$4.call($,Z)&&Z!==z)u($,Z,{get:()=>w[Z],enumerable:!(Y=o6(w,Z))||Y.enumerable})}return $},Z4=($)=>z4(u({},"__esModule",{value:!0}),$),h0={};w4(h0,{AlgorithmId:()=>x0,EndpointURLScheme:()=>I0,FieldPosition:()=>A0,HttpApiKeyAuthLocation:()=>O0,HttpAuthLocation:()=>b0,IniSectionType:()=>S0,RequestHandlerProtocol:()=>T0,SMITHY_CONTEXT_KEY:()=>B4,getDefaultClientConfiguration:()=>X4,resolveDefaultRuntimeConfig:()=>G4});k0.exports=Z4(h0);var b0=(($)=>{return $.HEADER="header",$.QUERY="query",$})(b0||{}),O0=(($)=>{return $.HEADER="header",$.QUERY="query",$})(O0||{}),I0=(($)=>{return $.HTTP="http",$.HTTPS="https",$})(I0||{}),x0=(($)=>{return $.MD5="md5",$.CRC32="crc32",$.CRC32C="crc32c",$.SHA1="sha1",$.SHA256="sha256",$})(x0||{}),Y4=l(($)=>{let w=[];if($.sha256!==void 0)w.push({algorithmId:()=>"sha256",checksumConstructor:()=>$.sha256});if($.md5!=null)w.push({algorithmId:()=>"md5",checksumConstructor:()=>$.md5});return{addChecksumAlgorithm(z){w.push(z)},checksumAlgorithms(){return w}}},"getChecksumConfiguration"),Q4=l(($)=>{let w={};return $.checksumAlgorithms().forEach((z)=>{w[z.algorithmId()]=z.checksumConstructor()}),w},"resolveChecksumRuntimeConfig"),X4=l(($)=>{return Y4($)},"getDefaultClientConfiguration"),G4=l(($)=>{return Q4($)},"resolveDefaultRuntimeConfig"),A0=(($)=>{return $[$.HEADER=0]="HEADER",$[$.TRAILER=1]="TRAILER",$})(A0||{}),B4="__smithy_context",S0=(($)=>{return $.PROFILE="profile",$.SSO_SESSION="sso-session",$.SERVICES="services",$})(S0||{}),T0=(($)=>{return $.HTTP_0_9="http/0.9",$.HTTP_1_0="http/1.0",$.TDS_8_0="tds/8.0",$})(T0||{})});var _=U((Yw,g0)=>{var{defineProperty:d,getOwnPropertyDescriptor:K4,getOwnPropertyNames:V4}=Object,W4=Object.prototype.hasOwnProperty,k=($,w)=>d($,"name",{value:w,configurable:!0}),U4=($,w)=>{for(var z in w)d($,z,{get:w[z],enumerable:!0})},L4=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of V4(w))if(!W4.call($,Z)&&Z!==z)d($,Z,{get:()=>w[Z],enumerable:!(Y=K4(w,Z))||Y.enumerable})}return $},J4=($)=>L4(d({},"__esModule",{value:!0}),$),y0={};U4(y0,{Field:()=>D4,Fields:()=>v4,HttpRequest:()=>N4,HttpResponse:()=>C4,IHttpRequest:()=>f0.HttpRequest,getHttpHandlerExtensionConfiguration:()=>j4,isValidHostname:()=>q0,resolveHttpHandlerRuntimeConfig:()=>F4});g0.exports=J4(y0);var j4=k(($)=>{return{setHttpHandler(w){$.httpHandler=w},httpHandler(){return $.httpHandler},updateHttpClientConfig(w,z){$.httpHandler?.updateHttpClientConfig(w,z)},httpHandlerConfigs(){return $.httpHandler.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),F4=k(($)=>{return{httpHandler:$.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),f0=E0(),D4=class{static{k(this,"Field")}constructor({name:$,kind:w=f0.FieldPosition.HEADER,values:z=[]}){this.name=$,this.kind=w,this.values=z}add($){this.values.push($)}set($){this.values=$}remove($){this.values=this.values.filter((w)=>w!==$)}toString(){return this.values.map(($)=>$.includes(",")||$.includes(" ")?`"${$}"`:$).join(", ")}get(){return this.values}},v4=class{constructor({fields:$=[],encoding:w="utf-8"}){this.entries={},$.forEach(this.setField.bind(this)),this.encoding=w}static{k(this,"Fields")}setField($){this.entries[$.name.toLowerCase()]=$}getField($){return this.entries[$.toLowerCase()]}removeField($){delete this.entries[$.toLowerCase()]}getByType($){return Object.values(this.entries).filter((w)=>w.kind===$)}},N4=class ${static{k(this,"HttpRequest")}constructor(w){this.method=w.method||"GET",this.hostname=w.hostname||"localhost",this.port=w.port,this.query=w.query||{},this.headers=w.headers||{},this.body=w.body,this.protocol=w.protocol?w.protocol.slice(-1)!==":"?`${w.protocol}:`:w.protocol:"https:",this.path=w.path?w.path.charAt(0)!=="/"?`/${w.path}`:w.path:"/",this.username=w.username,this.password=w.password,this.fragment=w.fragment}static clone(w){let z=new $({...w,headers:{...w.headers}});if(z.query)z.query=P0(z.query);return z}static isInstance(w){if(!w)return!1;let z=w;return"method"in z&&"protocol"in z&&"hostname"in z&&"path"in z&&typeof z.query==="object"&&typeof z.headers==="object"}clone(){return $.clone(this)}};function P0($){return Object.keys($).reduce((w,z)=>{let Y=$[z];return{...w,[z]:Array.isArray(Y)?[...Y]:Y}},{})}k(P0,"cloneQuery");var C4=class{static{k(this,"HttpResponse")}constructor($){this.statusCode=$.statusCode,this.reason=$.reason,this.headers=$.headers||{},this.body=$.body}static isInstance($){if(!$)return!1;let w=$;return typeof w.statusCode==="number"&&typeof w.headers==="object"}};function q0($){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test($)}k(q0,"isValidHostname")});var d0=U((Bw,l0)=>{var{defineProperty:p,getOwnPropertyDescriptor:M4,getOwnPropertyNames:R4}=Object,H4=Object.prototype.hasOwnProperty,Z0=($,w)=>p($,"name",{value:w,configurable:!0}),h4=($,w)=>{for(var z in w)p($,z,{get:w[z],enumerable:!0})},b4=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of R4(w))if(!H4.call($,Z)&&Z!==z)p($,Z,{get:()=>w[Z],enumerable:!(Y=M4(w,Z))||Y.enumerable})}return $},O4=($)=>b4(p({},"__esModule",{value:!0}),$),c0={};h4(c0,{escapeUri:()=>u0,escapeUriPath:()=>x4});l0.exports=O4(c0);var u0=Z0(($)=>encodeURIComponent($).replace(/[!'()*]/g,I4),"escapeUri"),I4=Z0(($)=>`%${$.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),x4=Z0(($)=>$.split("/").map(u0).join("/"),"escapeUriPath")});var Q0=U((Kw,i0)=>{var{defineProperty:i,getOwnPropertyDescriptor:A4,getOwnPropertyNames:S4}=Object,T4=Object.prototype.hasOwnProperty,k4=($,w)=>i($,"name",{value:w,configurable:!0}),E4=($,w)=>{for(var z in w)i($,z,{get:w[z],enumerable:!0})},y4=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of S4(w))if(!T4.call($,Z)&&Z!==z)i($,Z,{get:()=>w[Z],enumerable:!(Y=A4(w,Z))||Y.enumerable})}return $},f4=($)=>y4(i({},"__esModule",{value:!0}),$),_0={};E4(_0,{buildQueryString:()=>p0});i0.exports=f4(_0);var Y0=d0();function p0($){let w=[];for(let z of Object.keys($).sort()){let Y=$[z];if(z=Y0.escapeUri(z),Array.isArray(Y))for(let Z=0,G=Y.length;Z<G;Z++)w.push(`${z}=${Y0.escapeUri(Y[Z])}`);else{let Z=z;if(Y||typeof Y==="string")Z+=`=${Y0.escapeUri(Y)}`;w.push(Z)}}return w.join("&")}k4(p0,"buildQueryString")});var X1=U((Vw,Q1)=>{var{create:P4,defineProperty:g,getOwnPropertyDescriptor:q4,getOwnPropertyNames:g4,getPrototypeOf:c4}=Object,u4=Object.prototype.hasOwnProperty,L=($,w)=>g($,"name",{value:w,configurable:!0}),l4=($,w)=>{for(var z in w)g($,z,{get:w[z],enumerable:!0})},r0=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of g4(w))if(!u4.call($,Z)&&Z!==z)g($,Z,{get:()=>w[Z],enumerable:!(Y=q4(w,Z))||Y.enumerable})}return $},d4=($,w,z)=>(z=$!=null?P4(c4($)):{},r0(w||!$||!$.__esModule?g(z,"default",{value:$,enumerable:!0}):z,$)),_4=($)=>r0(g({},"__esModule",{value:!0}),$),t0={};l4(t0,{DEFAULT_REQUEST_TIMEOUT:()=>Z1,NodeHttp2Handler:()=>e4,NodeHttpHandler:()=>s4,streamCollector:()=>w$});Q1.exports=_4(t0);var o0=_(),e0=Q0(),X0=h("node:http"),G0=h("node:https"),p4=["ECONNRESET","EPIPE","ETIMEDOUT"],$1=L(($)=>{let w={};for(let z of Object.keys($)){let Y=$[z];w[z]=Array.isArray(Y)?Y.join(","):Y}return w},"getTransformedHeaders"),M={setTimeout:($,w)=>setTimeout($,w),clearTimeout:($)=>clearTimeout($)},a0=1000,i4=L(($,w,z=0)=>{if(!z)return-1;let Y=L((Z)=>{let G=M.setTimeout(()=>{$.destroy(),w(Object.assign(new Error(`Socket timed out without establishing a connection within ${z} ms`),{name:"TimeoutError"}))},z-Z),Q=L((X)=>{if(X?.connecting)X.on("connect",()=>{M.clearTimeout(G)});else M.clearTimeout(G)},"doWithSocket");if($.socket)Q($.socket);else $.on("socket",Q)},"registerTimeout");if(z<2000)return Y(0),0;return M.setTimeout(Y.bind(null,a0),a0)},"setConnectionTimeout"),a4=3000,m4=L(($,{keepAlive:w,keepAliveMsecs:z},Y=a4)=>{if(w!==!0)return-1;let Z=L(()=>{if($.socket)$.socket.setKeepAlive(w,z||0);else $.on("socket",(G)=>{G.setKeepAlive(w,z||0)})},"registerListener");if(Y===0)return Z(),0;return M.setTimeout(Z,Y)},"setSocketKeepAlive"),m0=3000,n4=L(($,w,z=Z1)=>{let Y=L((Z)=>{let G=z-Z,Q=L(()=>{$.destroy(),w(Object.assign(new Error(`Connection timed out after ${z} ms`),{name:"TimeoutError"}))},"onTimeout");if($.socket)$.socket.setTimeout(G,Q),$.on("close",()=>$.socket?.removeListener("timeout",Q));else $.setTimeout(G,Q)},"registerTimeout");if(0<z&&z<6000)return Y(0),0;return M.setTimeout(Y.bind(null,z===0?0:m0),m0)},"setSocketTimeout"),w1=h("node:stream"),n0=6000;async function B0($,w,z=n0){let Y=w.headers??{},Z=Y.Expect||Y.expect,G=-1,Q=!0;if(Z==="100-continue")Q=await Promise.race([new Promise((X)=>{G=Number(M.setTimeout(()=>X(!0),Math.max(n0,z)))}),new Promise((X)=>{$.on("continue",()=>{M.clearTimeout(G),X(!0)}),$.on("response",()=>{M.clearTimeout(G),X(!1)}),$.on("error",()=>{M.clearTimeout(G),X(!1)})})]);if(Q)z1($,w.body)}L(B0,"writeRequestBody");function z1($,w){if(w instanceof w1.Readable){w.pipe($);return}if(w){if(Buffer.isBuffer(w)||typeof w==="string"){$.end(w);return}let z=w;if(typeof z==="object"&&z.buffer&&typeof z.byteOffset==="number"&&typeof z.byteLength==="number"){$.end(Buffer.from(z.buffer,z.byteOffset,z.byteLength));return}$.end(Buffer.from(w));return}$.end()}L(z1,"writeBody");var Z1=0,s4=class ${constructor(w){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((z,Y)=>{if(typeof w==="function")w().then((Z)=>{z(this.resolveDefaultConfig(Z))}).catch(Y);else z(this.resolveDefaultConfig(w))})}static{L(this,"NodeHttpHandler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}static checkSocketUsage(w,z,Y=console){let{sockets:Z,requests:G,maxSockets:Q}=w;if(typeof Q!=="number"||Q===1/0)return z;let X=15000;if(Date.now()-X<z)return z;if(Z&&G)for(let B in Z){let K=Z[B]?.length??0,W=G[B]?.length??0;if(K>=Q&&W>=2*Q)return Y?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${K} and ${W} additional requests are enqueued.
2
- See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
- or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return z}resolveDefaultConfig(w){let{requestTimeout:z,connectionTimeout:Y,socketTimeout:Z,socketAcquisitionWarningTimeout:G,httpAgent:Q,httpsAgent:X}=w||{},B=!0,K=50;return{connectionTimeout:Y,requestTimeout:z??Z,socketAcquisitionWarningTimeout:G,httpAgent:(()=>{if(Q instanceof X0.Agent||typeof Q?.destroy==="function")return Q;return new X0.Agent({keepAlive:!0,maxSockets:50,...Q})})(),httpsAgent:(()=>{if(X instanceof G0.Agent||typeof X?.destroy==="function")return X;return new G0.Agent({keepAlive:!0,maxSockets:50,...X})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(w,{abortSignal:z}={}){if(!this.config)this.config=await this.configProvider;return new Promise((Y,Z)=>{let G=void 0,Q=[],X=L(async(V)=>{await G,Q.forEach(M.clearTimeout),Y(V)},"resolve"),B=L(async(V)=>{await G,Q.forEach(M.clearTimeout),Z(V)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(z?.aborted){let V=new Error("Request aborted");V.name="AbortError",B(V);return}let K=w.protocol==="https:",W=K?this.config.httpsAgent:this.config.httpAgent;Q.push(M.setTimeout(()=>{this.socketWarningTimestamp=$.checkSocketUsage(W,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));let N=e0.buildQueryString(w.query||{}),v=void 0;if(w.username!=null||w.password!=null){let V=w.username??"",j=w.password??"";v=`${V}:${j}`}let D=w.path;if(N)D+=`?${N}`;if(w.fragment)D+=`#${w.fragment}`;let C=w.hostname??"";if(C[0]==="["&&C.endsWith("]"))C=w.hostname.slice(1,-1);else C=w.hostname;let S={headers:w.headers,host:C,method:w.method,path:D,port:w.port,agent:W,auth:v},J=(K?G0.request:X0.request)(S,(V)=>{let j=new o0.HttpResponse({statusCode:V.statusCode||-1,reason:V.statusMessage,headers:$1(V.headers),body:V});X({response:j})});if(J.on("error",(V)=>{if(p4.includes(V.code))B(Object.assign(V,{name:"TimeoutError"}));else B(V)}),z){let V=L(()=>{J.destroy();let j=new Error("Request aborted");j.name="AbortError",B(j)},"onAbort");if(typeof z.addEventListener==="function"){let j=z;j.addEventListener("abort",V,{once:!0}),J.once("close",()=>j.removeEventListener("abort",V))}else z.onabort=V}Q.push(i4(J,B,this.config.connectionTimeout)),Q.push(n4(J,B,this.config.requestTimeout));let R=S.agent;if(typeof R==="object"&&"keepAlive"in R)Q.push(m4(J,{keepAlive:R.keepAlive,keepAliveMsecs:R.keepAliveMsecs}));G=B0(J,w,this.config.requestTimeout).catch((V)=>{return Q.forEach(M.clearTimeout),Z(V)})})}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((Y)=>{return{...Y,[w]:z}})}httpHandlerConfigs(){return this.config??{}}},s0=h("node:http2"),r4=d4(h("node:http2")),t4=class{constructor($){this.sessions=[],this.sessions=$??[]}static{L(this,"NodeHttp2ConnectionPool")}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast($){this.sessions.push($)}contains($){return this.sessions.includes($)}remove($){this.sessions=this.sessions.filter((w)=>w!==$)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy($){for(let w of this.sessions)if(w===$){if(!w.destroyed)w.destroy()}}},o4=class{constructor($){if(this.sessionCache=new Map,this.config=$,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}static{L(this,"NodeHttp2ConnectionManager")}lease($,w){let z=this.getUrlString($),Y=this.sessionCache.get(z);if(Y){let X=Y.poll();if(X&&!this.config.disableConcurrency)return X}let Z=r4.default.connect(z);if(this.config.maxConcurrency)Z.settings({maxConcurrentStreams:this.config.maxConcurrency},(X)=>{if(X)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+$.destination.toString())});Z.unref();let G=L(()=>{Z.destroy(),this.deleteSession(z,Z)},"destroySessionCb");if(Z.on("goaway",G),Z.on("error",G),Z.on("frameError",G),Z.on("close",()=>this.deleteSession(z,Z)),w.requestTimeout)Z.setTimeout(w.requestTimeout,G);let Q=this.sessionCache.get(z)||new t4;return Q.offerLast(Z),this.sessionCache.set(z,Q),Z}deleteSession($,w){let z=this.sessionCache.get($);if(!z)return;if(!z.contains(w))return;z.remove(w),this.sessionCache.set($,z)}release($,w){let z=this.getUrlString($);this.sessionCache.get(z)?.offerLast(w)}destroy(){for(let[$,w]of this.sessionCache){for(let z of w){if(!z.destroyed)z.destroy();w.remove(z)}this.sessionCache.delete($)}}setMaxConcurrentStreams($){if($&&$<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=$}setDisableConcurrentStreams($){this.config.disableConcurrency=$}getUrlString($){return $.destination.toString()}},e4=class ${constructor(w){this.metadata={handlerProtocol:"h2"},this.connectionManager=new o4({}),this.configProvider=new Promise((z,Y)=>{if(typeof w==="function")w().then((Z)=>{z(Z||{})}).catch(Y);else z(w||{})})}static{L(this,"NodeHttp2Handler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}destroy(){this.connectionManager.destroy()}async handle(w,{abortSignal:z}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}let{requestTimeout:Y,disableConcurrentStreams:Z}=this.config;return new Promise((G,Q)=>{let X=!1,B=void 0,K=L(async(F)=>{await B,G(F)},"resolve"),W=L(async(F)=>{await B,Q(F)},"reject");if(z?.aborted){X=!0;let F=new Error("Request aborted");F.name="AbortError",W(F);return}let{hostname:N,method:v,port:D,protocol:C,query:S}=w,T="";if(w.username!=null||w.password!=null){let F=w.username??"",b=w.password??"";T=`${F}:${b}@`}let J=`${C}//${T}${N}${D?`:${D}`:""}`,R={destination:new URL(J)},V=this.connectionManager.lease(R,{requestTimeout:this.config?.sessionTimeout,disableConcurrentStreams:Z||!1}),j=L((F)=>{if(Z)this.destroySession(V);X=!0,W(F)},"rejectWithDestroy"),f=e0.buildQueryString(S||{}),z0=w.path;if(f)z0+=`?${f}`;if(w.fragment)z0+=`#${w.fragment}`;let H=V.request({...w.headers,[s0.constants.HTTP2_HEADER_PATH]:z0,[s0.constants.HTTP2_HEADER_METHOD]:v});if(V.ref(),H.on("response",(F)=>{let b=new o0.HttpResponse({statusCode:F[":status"]||-1,headers:$1(F),body:H});if(X=!0,K({response:b}),Z)V.close(),this.connectionManager.deleteSession(J,V)}),Y)H.setTimeout(Y,()=>{H.close();let F=new Error(`Stream timed out because of no activity for ${Y} ms`);F.name="TimeoutError",j(F)});if(z){let F=L(()=>{H.close();let b=new Error("Request aborted");b.name="AbortError",j(b)},"onAbort");if(typeof z.addEventListener==="function"){let b=z;b.addEventListener("abort",F,{once:!0}),H.once("close",()=>b.removeEventListener("abort",F))}else z.onabort=F}H.on("frameError",(F,b,t6)=>{j(new Error(`Frame type id ${F} in stream id ${t6} has failed with code ${b}.`))}),H.on("error",j),H.on("aborted",()=>{j(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${H.rstCode}.`))}),H.on("close",()=>{if(V.unref(),Z)V.destroy();if(!X)j(new Error("Unexpected error: http2 request did not get a response"))}),B=B0(H,w,Y)})}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((Y)=>{return{...Y,[w]:z}})}httpHandlerConfigs(){return this.config??{}}destroySession(w){if(!w.destroyed)w.destroy()}},$$=class extends w1.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}static{L(this,"Collector")}_write($,w,z){this.bufferedBytes.push($),z()}},w$=L(($)=>{if(z$($))return Y1($);return new Promise((w,z)=>{let Y=new $$;$.pipe(Y),$.on("error",(Z)=>{Y.end(),z(Z)}),Y.on("error",z),Y.on("finish",function(){let Z=new Uint8Array(Buffer.concat(this.bufferedBytes));w(Z)})})},"streamCollector"),z$=L(($)=>typeof ReadableStream==="function"&&$ instanceof ReadableStream,"isReadableStreamInstance");async function Y1($){let w=[],z=$.getReader(),Y=!1,Z=0;while(!Y){let{done:X,value:B}=await z.read();if(B)w.push(B),Z+=B.length;Y=X}let G=new Uint8Array(Z),Q=0;for(let X of w)G.set(X,Q),Q+=X.length;return G}L(Y1,"collectReadableStream")});var K1=U((Jw,B1)=>{var{defineProperty:a,getOwnPropertyDescriptor:Z$,getOwnPropertyNames:Y$}=Object,Q$=Object.prototype.hasOwnProperty,X$=($,w)=>a($,"name",{value:w,configurable:!0}),G$=($,w)=>{for(var z in w)a($,z,{get:w[z],enumerable:!0})},B$=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of Y$(w))if(!Q$.call($,Z)&&Z!==z)a($,Z,{get:()=>w[Z],enumerable:!(Y=Z$(w,Z))||Y.enumerable})}return $},K$=($)=>B$(a({},"__esModule",{value:!0}),$),G1={};G$(G1,{isArrayBuffer:()=>V$});B1.exports=K$(G1);var V$=X$(($)=>typeof ArrayBuffer==="function"&&$ instanceof ArrayBuffer||Object.prototype.toString.call($)==="[object ArrayBuffer]","isArrayBuffer")});var c=U((jw,U1)=>{var{defineProperty:m,getOwnPropertyDescriptor:W$,getOwnPropertyNames:U$}=Object,L$=Object.prototype.hasOwnProperty,V1=($,w)=>m($,"name",{value:w,configurable:!0}),J$=($,w)=>{for(var z in w)m($,z,{get:w[z],enumerable:!0})},j$=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of U$(w))if(!L$.call($,Z)&&Z!==z)m($,Z,{get:()=>w[Z],enumerable:!(Y=W$(w,Z))||Y.enumerable})}return $},F$=($)=>j$(m({},"__esModule",{value:!0}),$),W1={};J$(W1,{fromArrayBuffer:()=>v$,fromString:()=>N$});U1.exports=F$(W1);var D$=K1(),K0=h("node:buffer"),v$=V1(($,w=0,z=$.byteLength-w)=>{if(!D$.isArrayBuffer($))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof $} (${$})`);return K0.Buffer.from($,w,z)},"fromArrayBuffer"),N$=V1(($,w)=>{if(typeof $!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof $} (${$})`);return w?K0.Buffer.from($,w):K0.Buffer.from($)},"fromString")});var j1=U((L1)=>{Object.defineProperty(L1,"__esModule",{value:!0});L1.fromBase64=void 0;var C$=c(),M$=/^[A-Za-z0-9+/]*={0,2}$/,R$=($)=>{if($.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!M$.exec($))throw new TypeError("Invalid base64 string.");let w=C$.fromString($,"base64");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength)};L1.fromBase64=R$});var s=U((Dw,N1)=>{var{defineProperty:n,getOwnPropertyDescriptor:H$,getOwnPropertyNames:h$}=Object,b$=Object.prototype.hasOwnProperty,V0=($,w)=>n($,"name",{value:w,configurable:!0}),O$=($,w)=>{for(var z in w)n($,z,{get:w[z],enumerable:!0})},I$=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of h$(w))if(!b$.call($,Z)&&Z!==z)n($,Z,{get:()=>w[Z],enumerable:!(Y=H$(w,Z))||Y.enumerable})}return $},x$=($)=>I$(n({},"__esModule",{value:!0}),$),F1={};O$(F1,{fromUtf8:()=>v1,toUint8Array:()=>A$,toUtf8:()=>S$});N1.exports=x$(F1);var D1=c(),v1=V0(($)=>{let w=D1.fromString($,"utf8");return new Uint8Array(w.buffer,w.byteOffset,w.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),A$=V0(($)=>{if(typeof $==="string")return v1($);if(ArrayBuffer.isView($))return new Uint8Array($.buffer,$.byteOffset,$.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array($)},"toUint8Array"),S$=V0(($)=>{if(typeof $==="string")return $;if(typeof $!=="object"||typeof $.byteOffset!=="number"||typeof $.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return D1.fromArrayBuffer($.buffer,$.byteOffset,$.byteLength).toString("utf8")},"toUtf8")});var R1=U((C1)=>{Object.defineProperty(C1,"__esModule",{value:!0});C1.toBase64=void 0;var T$=c(),k$=s(),E$=($)=>{let w;if(typeof $==="string")w=k$.fromUtf8($);else w=$;if(typeof w!=="object"||typeof w.byteOffset!=="number"||typeof w.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return T$.fromArrayBuffer(w.buffer,w.byteOffset,w.byteLength).toString("base64")};C1.toBase64=E$});var P=U((Nw,r)=>{var{defineProperty:H1,getOwnPropertyDescriptor:y$,getOwnPropertyNames:f$}=Object,P$=Object.prototype.hasOwnProperty,W0=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of f$(w))if(!P$.call($,Z)&&Z!==z)H1($,Z,{get:()=>w[Z],enumerable:!(Y=y$(w,Z))||Y.enumerable})}return $},h1=($,w,z)=>(W0($,w,"default"),z&&W0(z,w,"default")),q$=($)=>W0(H1({},"__esModule",{value:!0}),$),U0={};r.exports=q$(U0);h1(U0,j1(),r.exports);h1(U0,R1(),r.exports)});var L0=U((O1)=>{Object.defineProperty(O1,"__esModule",{value:!0});O1.ChecksumStream=void 0;var g$=P(),c$=h("node:stream");class b1 extends c$.Duplex{constructor({expectedChecksum:$,checksum:w,source:z,checksumSourceLocation:Y,base64Encoder:Z}){var G,Q;super();if(typeof z.pipe==="function")this.source=z;else throw new Error(`@smithy/util-stream: unsupported source type ${(Q=(G=z===null||z===void 0?void 0:z.constructor)===null||G===void 0?void 0:G.name)!==null&&Q!==void 0?Q:z} in ChecksumStream.`);this.base64Encoder=Z!==null&&Z!==void 0?Z:g$.toBase64,this.expectedChecksum=$,this.checksum=w,this.checksumSourceLocation=Y,this.source.pipe(this)}_read($){}_write($,w,z){try{this.checksum.update($),this.push($)}catch(Y){return z(Y)}return z()}async _final($){try{let w=await this.checksum.digest(),z=this.base64Encoder(w);if(this.expectedChecksum!==z)return $(new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${z}" in response header "${this.checksumSourceLocation}".`))}catch(w){return $(w)}return this.push(null),$()}}O1.ChecksumStream=b1});var E=U((x1)=>{Object.defineProperty(x1,"__esModule",{value:!0});x1.isBlob=x1.isReadableStream=void 0;var u$=($)=>{var w;return typeof ReadableStream==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===ReadableStream.name||$ instanceof ReadableStream)};x1.isReadableStream=u$;var l$=($)=>{var w;return typeof Blob==="function"&&(((w=$===null||$===void 0?void 0:$.constructor)===null||w===void 0?void 0:w.name)===Blob.name||$ instanceof Blob)};x1.isBlob=l$});var E1=U((T1)=>{Object.defineProperty(T1,"__esModule",{value:!0});T1.ChecksumStream=void 0;var _$=typeof ReadableStream==="function"?ReadableStream:function(){};class S1 extends _${}T1.ChecksumStream=S1});var P1=U((y1)=>{Object.defineProperty(y1,"__esModule",{value:!0});y1.createChecksumStream=void 0;var p$=P(),i$=E(),a$=E1(),m$=({expectedChecksum:$,checksum:w,source:z,checksumSourceLocation:Y,base64Encoder:Z})=>{var G,Q;if(!i$.isReadableStream(z))throw new Error(`@smithy/util-stream: unsupported source type ${(Q=(G=z===null||z===void 0?void 0:z.constructor)===null||G===void 0?void 0:G.name)!==null&&Q!==void 0?Q:z} in ChecksumStream.`);let X=Z!==null&&Z!==void 0?Z:p$.toBase64;if(typeof TransformStream!=="function")throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let B=new TransformStream({start(){},async transform(W,N){w.update(W),N.enqueue(W)},async flush(W){let N=await w.digest(),v=X(N);if($!==v){let D=new Error(`Checksum mismatch: expected "${$}" but received "${v}" in response header "${Y}".`);W.error(D)}else W.terminate()}});z.pipeThrough(B);let K=B.readable;return Object.setPrototypeOf(K,a$.ChecksumStream.prototype),K};y1.createChecksumStream=m$});var c1=U((q1)=>{Object.defineProperty(q1,"__esModule",{value:!0});q1.createChecksumStream=void 0;var n$=E(),s$=L0(),r$=P1();function t$($){if(typeof ReadableStream==="function"&&n$.isReadableStream($.source))return r$.createChecksumStream($);return new s$.ChecksumStream($)}q1.createChecksumStream=t$});var J0=U((l1)=>{Object.defineProperty(l1,"__esModule",{value:!0});l1.ByteArrayCollector=void 0;class u1{constructor($){this.allocByteArray=$,this.byteLength=0,this.byteArrays=[]}push($){this.byteArrays.push($),this.byteLength+=$.byteLength}flush(){if(this.byteArrays.length===1){let z=this.byteArrays[0];return this.reset(),z}let $=this.allocByteArray(this.byteLength),w=0;for(let z=0;z<this.byteArrays.length;++z){let Y=this.byteArrays[z];$.set(Y,w),w+=Y.byteLength}return this.reset(),$}reset(){this.byteArrays=[],this.byteLength=0}}l1.ByteArrayCollector=u1});var n1=U((a1)=>{Object.defineProperty(a1,"__esModule",{value:!0});a1.modeOf=a1.sizeOf=a1.flush=a1.merge=a1.createBufferedReadable=a1.createBufferedReadableStream=void 0;var o$=J0();function _1($,w,z){let Y=$.getReader(),Z=!1,G=0,Q=["",new o$.ByteArrayCollector((K)=>new Uint8Array(K))],X=-1,B=async(K)=>{let{value:W,done:N}=await Y.read(),v=W;if(N){if(X!==-1){let D=t(Q,X);if(q(D)>0)K.enqueue(D)}K.close()}else{let D=i1(v,!1);if(X!==D){if(X>=0)K.enqueue(t(Q,X));X=D}if(X===-1){K.enqueue(v);return}let C=q(v);G+=C;let S=q(Q[X]);if(C>=w&&S===0)K.enqueue(v);else{let T=p1(Q,X,v);if(!Z&&G>w*2)Z=!0,z===null||z===void 0||z.warn(`@smithy/util-stream - stream chunk size ${C} is below threshold of ${w}, automatically buffering.`);if(T>=w)K.enqueue(t(Q,X));else await B(K)}}};return new ReadableStream({pull:B})}a1.createBufferedReadableStream=_1;a1.createBufferedReadable=_1;function p1($,w,z){switch(w){case 0:return $[0]+=z,q($[0]);case 1:case 2:return $[w].push(z),q($[w])}}a1.merge=p1;function t($,w){switch(w){case 0:let z=$[0];return $[0]="",z;case 1:case 2:return $[w].flush()}throw new Error(`@smithy/util-stream - invalid index ${w} given to flush()`)}a1.flush=t;function q($){var w,z;return(z=(w=$===null||$===void 0?void 0:$.byteLength)!==null&&w!==void 0?w:$===null||$===void 0?void 0:$.length)!==null&&z!==void 0?z:0}a1.sizeOf=q;function i1($,w=!0){if(w&&typeof Buffer!=="undefined"&&$ instanceof Buffer)return 2;if($ instanceof Uint8Array)return 1;if(typeof $==="string")return 0;return-1}a1.modeOf=i1});var o1=U((r1)=>{Object.defineProperty(r1,"__esModule",{value:!0});r1.createBufferedReadable=void 0;var Y8=h("node:stream"),s1=J0(),A=n1(),Q8=E();function X8($,w,z){if(Q8.isReadableStream($))return A.createBufferedReadableStream($,w,z);let Y=new Y8.Readable({read(){}}),Z=!1,G=0,Q=["",new s1.ByteArrayCollector((B)=>new Uint8Array(B)),new s1.ByteArrayCollector((B)=>Buffer.from(new Uint8Array(B)))],X=-1;return $.on("data",(B)=>{let K=A.modeOf(B,!0);if(X!==K){if(X>=0)Y.push(A.flush(Q,X));X=K}if(X===-1){Y.push(B);return}let W=A.sizeOf(B);G+=W;let N=A.sizeOf(Q[X]);if(W>=w&&N===0)Y.push(B);else{let v=A.merge(Q,X,B);if(!Z&&G>w*2)Z=!0,z===null||z===void 0||z.warn(`@smithy/util-stream - stream chunk size ${W} is below threshold of ${w}, automatically buffering.`);if(v>=w)Y.push(A.flush(Q,X))}}),$.on("end",()=>{if(X!==-1){let B=A.flush(Q,X);if(A.sizeOf(B)>0)Y.push(B)}Y.push(null)}),Y}r1.createBufferedReadable=X8});var w6=U((e1)=>{Object.defineProperty(e1,"__esModule",{value:!0});e1.getAwsChunkedEncodingStream=void 0;var G8=h("node:stream"),B8=($,w)=>{let{base64Encoder:z,bodyLengthChecker:Y,checksumAlgorithmFn:Z,checksumLocationName:G,streamHasher:Q}=w,X=z!==void 0&&Z!==void 0&&G!==void 0&&Q!==void 0,B=X?Q(Z,$):void 0,K=new G8.Readable({read:()=>{}});return $.on("data",(W)=>{let N=Y(W)||0;K.push(`${N.toString(16)}\r
4
- `),K.push(W),K.push(`\r
5
- `)}),$.on("end",async()=>{if(K.push(`0\r
6
- `),X){let W=z(await B);K.push(`${G}:${W}\r
7
- `),K.push(`\r
8
- `)}K.push(null)}),K};e1.getAwsChunkedEncodingStream=B8});var Y6=U((z6)=>{Object.defineProperty(z6,"__esModule",{value:!0});z6.headStream=void 0;async function K8($,w){var z;let Y=0,Z=[],G=$.getReader(),Q=!1;while(!Q){let{done:K,value:W}=await G.read();if(W)Z.push(W),Y+=(z=W===null||W===void 0?void 0:W.byteLength)!==null&&z!==void 0?z:0;if(Y>=w)break;Q=K}G.releaseLock();let X=new Uint8Array(Math.min(w,Y)),B=0;for(let K of Z){if(K.byteLength>X.byteLength-B){X.set(K.subarray(0,X.byteLength-B),B);break}else X.set(K,B);B+=K.length}return X}z6.headStream=K8});var B6=U((X6)=>{Object.defineProperty(X6,"__esModule",{value:!0});X6.headStream=void 0;var V8=h("node:stream"),W8=Y6(),U8=E(),L8=($,w)=>{if(U8.isReadableStream($))return W8.headStream($,w);return new Promise((z,Y)=>{let Z=new Q6;Z.limit=w,$.pipe(Z),$.on("error",(G)=>{Z.end(),Y(G)}),Z.on("error",Y),Z.on("finish",function(){let G=new Uint8Array(Buffer.concat(this.buffers));z(G)})})};X6.headStream=L8;class Q6 extends V8.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write($,w,z){var Y;if(this.buffers.push($),this.bytesBuffered+=(Y=$.byteLength)!==null&&Y!==void 0?Y:0,this.bytesBuffered>=this.limit){let Z=this.bytesBuffered-this.limit,G=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=G.subarray(0,G.byteLength-Z),this.emit("finish")}z()}}});var F6=U((Tw,j6)=>{var{defineProperty:e,getOwnPropertyDescriptor:J8,getOwnPropertyNames:j8}=Object,F8=Object.prototype.hasOwnProperty,O=($,w)=>e($,"name",{value:w,configurable:!0}),D8=($,w)=>{for(var z in w)e($,z,{get:w[z],enumerable:!0})},v8=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of j8(w))if(!F8.call($,Z)&&Z!==z)e($,Z,{get:()=>w[Z],enumerable:!(Y=J8(w,Z))||Y.enumerable})}return $},N8=($)=>v8(e({},"__esModule",{value:!0}),$),V6={};D8(V6,{FetchHttpHandler:()=>M8,keepAliveSupport:()=>o,streamCollector:()=>H8});j6.exports=N8(V6);var K6=_(),C8=Q0();function j0($,w){return new Request($,w)}O(j0,"createRequest");function W6($=0){return new Promise((w,z)=>{if($)setTimeout(()=>{let Y=new Error(`Request did not complete within ${$} ms`);Y.name="TimeoutError",z(Y)},$)})}O(W6,"requestTimeout");var o={supported:void 0},M8=class ${static{O(this,"FetchHttpHandler")}static create(w){if(typeof w?.handle==="function")return w;return new $(w)}constructor(w){if(typeof w==="function")this.configProvider=w().then((z)=>z||{});else this.config=w??{},this.configProvider=Promise.resolve(this.config);if(o.supported===void 0)o.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in j0("https://[::1]"))}destroy(){}async handle(w,{abortSignal:z}={}){if(!this.config)this.config=await this.configProvider;let Y=this.config.requestTimeout,Z=this.config.keepAlive===!0,G=this.config.credentials;if(z?.aborted){let J=new Error("Request aborted");return J.name="AbortError",Promise.reject(J)}let Q=w.path,X=C8.buildQueryString(w.query||{});if(X)Q+=`?${X}`;if(w.fragment)Q+=`#${w.fragment}`;let B="";if(w.username!=null||w.password!=null){let J=w.username??"",R=w.password??"";B=`${J}:${R}@`}let{port:K,method:W}=w,N=`${w.protocol}//${B}${w.hostname}${K?`:${K}`:""}${Q}`,v=W==="GET"||W==="HEAD"?void 0:w.body,D={body:v,headers:new Headers(w.headers),method:W,credentials:G};if(this.config?.cache)D.cache=this.config.cache;if(v)D.duplex="half";if(typeof AbortController!=="undefined")D.signal=z;if(o.supported)D.keepalive=Z;if(typeof this.config.requestInit==="function")Object.assign(D,this.config.requestInit(w));let C=O(()=>{},"removeSignalEventListener"),S=j0(N,D),T=[fetch(S).then((J)=>{let R=J.headers,V={};for(let f of R.entries())V[f[0]]=f[1];if(J.body==null)return J.blob().then((f)=>({response:new K6.HttpResponse({headers:V,reason:J.statusText,statusCode:J.status,body:f})}));return{response:new K6.HttpResponse({headers:V,reason:J.statusText,statusCode:J.status,body:J.body})}}),W6(Y)];if(z)T.push(new Promise((J,R)=>{let V=O(()=>{let j=new Error("Request aborted");j.name="AbortError",R(j)},"onAbort");if(typeof z.addEventListener==="function"){let j=z;j.addEventListener("abort",V,{once:!0}),C=O(()=>j.removeEventListener("abort",V),"removeSignalEventListener")}else z.onabort=V}));return Promise.race(T).finally(C)}updateHttpClientConfig(w,z){this.config=void 0,this.configProvider=this.configProvider.then((Y)=>{return Y[w]=z,Y})}httpHandlerConfigs(){return this.config??{}}},R8=P(),H8=O(async($)=>{if(typeof Blob==="function"&&$ instanceof Blob||$.constructor?.name==="Blob"){if(Blob.prototype.arrayBuffer!==void 0)return new Uint8Array(await $.arrayBuffer());return U6($)}return L6($)},"streamCollector");async function U6($){let w=await J6($),z=R8.fromBase64(w);return new Uint8Array(z)}O(U6,"collectBlob");async function L6($){let w=[],z=$.getReader(),Y=!1,Z=0;while(!Y){let{done:X,value:B}=await z.read();if(B)w.push(B),Z+=B.length;Y=X}let G=new Uint8Array(Z),Q=0;for(let X of w)G.set(X,Q),Q+=X.length;return G}O(L6,"collectStream");function J6($){return new Promise((w,z)=>{let Y=new FileReader;Y.onloadend=()=>{if(Y.readyState!==2)return z(new Error("Reader aborted too early"));let Z=Y.result??"",G=Z.indexOf(","),Q=G>-1?G+1:Z.length;w(Z.substring(Q))},Y.onabort=()=>z(new Error("Read aborted")),Y.onerror=()=>z(Y.error),Y.readAsDataURL($)})}O(J6,"readToBase64")});var H6=U((kw,R6)=>{var{defineProperty:$0,getOwnPropertyDescriptor:h8,getOwnPropertyNames:b8}=Object,O8=Object.prototype.hasOwnProperty,D6=($,w)=>$0($,"name",{value:w,configurable:!0}),I8=($,w)=>{for(var z in w)$0($,z,{get:w[z],enumerable:!0})},x8=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of b8(w))if(!O8.call($,Z)&&Z!==z)$0($,Z,{get:()=>w[Z],enumerable:!(Y=h8(w,Z))||Y.enumerable})}return $},A8=($)=>x8($0({},"__esModule",{value:!0}),$),v6={};I8(v6,{fromHex:()=>C6,toHex:()=>M6});R6.exports=A8(v6);var N6={},F0={};for(let $=0;$<256;$++){let w=$.toString(16).toLowerCase();if(w.length===1)w=`0${w}`;N6[$]=w,F0[w]=$}function C6($){if($.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let w=new Uint8Array($.length/2);for(let z=0;z<$.length;z+=2){let Y=$.slice(z,z+2).toLowerCase();if(Y in F0)w[z/2]=F0[Y];else throw new Error(`Cannot decode unrecognized sequence ${Y} as hexadecimal`)}return w}D6(C6,"fromHex");function M6($){let w="";for(let z=0;z<$.byteLength;z++)w+=N6[$[z]];return w}D6(M6,"toHex")});var A6=U((I6)=>{Object.defineProperty(I6,"__esModule",{value:!0});I6.sdkStreamMixin=void 0;var S8=F6(),T8=P(),k8=H6(),E8=s(),h6=E(),b6="The stream has already been transformed.",y8=($)=>{var w,z;if(!O6($)&&!h6.isReadableStream($)){let Q=((z=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||z===void 0?void 0:z.name)||$;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${Q}`)}let Y=!1,Z=async()=>{if(Y)throw new Error(b6);return Y=!0,await S8.streamCollector($)},G=(Q)=>{if(typeof Q.stream!=="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
9
- 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 Q.stream()};return Object.assign($,{transformToByteArray:Z,transformToString:async(Q)=>{let X=await Z();if(Q==="base64")return T8.toBase64(X);else if(Q==="hex")return k8.toHex(X);else if(Q===void 0||Q==="utf8"||Q==="utf-8")return E8.toUtf8(X);else if(typeof TextDecoder==="function")return new TextDecoder(Q).decode(X);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(Y)throw new Error(b6);if(Y=!0,O6($))return G($);else if(h6.isReadableStream($))return $;else throw new Error(`Cannot transform payload to web stream, got ${$}`)}})};I6.sdkStreamMixin=y8;var O6=($)=>typeof Blob==="function"&&$ instanceof Blob});var E6=U((T6)=>{Object.defineProperty(T6,"__esModule",{value:!0});T6.sdkStreamMixin=void 0;var f8=X1(),P8=c(),D0=h("node:stream"),q8=A6(),S6="The stream has already been transformed.",g8=($)=>{var w,z;if(!($ instanceof D0.Readable))try{return q8.sdkStreamMixin($)}catch(G){let Q=((z=(w=$===null||$===void 0?void 0:$.__proto__)===null||w===void 0?void 0:w.constructor)===null||z===void 0?void 0:z.name)||$;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${Q}`)}let Y=!1,Z=async()=>{if(Y)throw new Error(S6);return Y=!0,await f8.streamCollector($)};return Object.assign($,{transformToByteArray:Z,transformToString:async(G)=>{let Q=await Z();if(G===void 0||Buffer.isEncoding(G))return P8.fromArrayBuffer(Q.buffer,Q.byteOffset,Q.byteLength).toString(G);else return new TextDecoder(G).decode(Q)},transformToWebStream:()=>{if(Y)throw new Error(S6);if($.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof D0.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return Y=!0,D0.Readable.toWeb($)}})};T6.sdkStreamMixin=g8});var P6=U((y6)=>{Object.defineProperty(y6,"__esModule",{value:!0});y6.splitStream=void 0;async function c8($){if(typeof $.stream==="function")$=$.stream();return $.tee()}y6.splitStream=c8});var l6=U((c6)=>{Object.defineProperty(c6,"__esModule",{value:!0});c6.splitStream=void 0;var q6=h("node:stream"),u8=P6(),g6=E();async function l8($){if(g6.isReadableStream($)||g6.isBlob($))return u8.splitStream($);let w=new q6.PassThrough,z=new q6.PassThrough;return $.pipe(w),$.pipe(z),[w,z]}c6.splitStream=l8});var a6=U((qw,x)=>{var{defineProperty:w0,getOwnPropertyDescriptor:d8,getOwnPropertyNames:_8}=Object,p8=Object.prototype.hasOwnProperty,C0=($,w)=>w0($,"name",{value:w,configurable:!0}),i8=($,w)=>{for(var z in w)w0($,z,{get:w[z],enumerable:!0})},v0=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of _8(w))if(!p8.call($,Z)&&Z!==z)w0($,Z,{get:()=>w[Z],enumerable:!(Y=d8(w,Z))||Y.enumerable})}return $},y=($,w,z)=>(v0($,w,"default"),z&&v0(z,w,"default")),a8=($)=>v0(w0({},"__esModule",{value:!0}),$),I={};i8(I,{Uint8ArrayBlobAdapter:()=>N0});x.exports=a8(I);var d6=P(),_6=s();function p6($,w="utf-8"){if(w==="base64")return d6.toBase64($);return _6.toUtf8($)}C0(p6,"transformToString");function i6($,w){if(w==="base64")return N0.mutate(d6.fromBase64($));return N0.mutate(_6.fromUtf8($))}C0(i6,"transformFromString");var N0=class $ extends Uint8Array{static{C0(this,"Uint8ArrayBlobAdapter")}static fromString(w,z="utf-8"){switch(typeof w){case"string":return i6(w,z);default:throw new Error(`Unsupported conversion from ${typeof w} to Uint8ArrayBlobAdapter.`)}}static mutate(w){return Object.setPrototypeOf(w,$.prototype),w}transformToString(w="utf-8"){return p6(this,w)}};y(I,L0(),x.exports);y(I,c1(),x.exports);y(I,o1(),x.exports);y(I,w6(),x.exports);y(I,B6(),x.exports);y(I,E6(),x.exports);y(I,l6(),x.exports);y(I,E(),x.exports)});var zw=U((gw,r6)=>{var{defineProperty:H0,getOwnPropertyDescriptor:m8,getOwnPropertyNames:n8}=Object,s8=Object.prototype.hasOwnProperty,r8=($,w)=>{for(var z in w)H0($,z,{get:w[z],enumerable:!0})},t8=($,w,z,Y)=>{if(w&&typeof w==="object"||typeof w==="function"){for(let Z of n8(w))if(!s8.call($,Z)&&Z!==z)H0($,Z,{get:()=>w[Z],enumerable:!(Y=m8(w,Z))||Y.enumerable})}return $},o8=($)=>t8(H0({},"__esModule",{value:!0}),$),m6={};r8(m6,{RequestBuilder:()=>s6,collectBody:()=>e8,extendedEncodeURIComponent:()=>R0,requestBuilder:()=>ww,resolvedPath:()=>n6});r6.exports=o8(m6);var M0=a6(),e8=async($=new Uint8Array,w)=>{if($ instanceof Uint8Array)return M0.Uint8ArrayBlobAdapter.mutate($);if(!$)return M0.Uint8ArrayBlobAdapter.mutate(new Uint8Array);let z=w.streamCollector($);return M0.Uint8ArrayBlobAdapter.mutate(await z)};function R0($){return encodeURIComponent($).replace(/[!'()*]/g,function(w){return"%"+w.charCodeAt(0).toString(16).toUpperCase()})}var $w=_(),n6=($,w,z,Y,Z,G)=>{if(w!=null&&w[z]!==void 0){let Q=Y();if(Q.length<=0)throw new Error("Empty value provided for input HTTP label: "+z+".");$=$.replace(Z,G?Q.split("/").map((X)=>R0(X)).join("/"):R0(Q))}else throw new Error("No value provided for input HTTP label: "+z+".");return $};function ww($,w){return new s6($,w)}var s6=class{constructor($,w){this.input=$,this.context=w,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){let{hostname:$,protocol:w="https",port:z,path:Y}=await this.context.endpoint();this.path=Y;for(let Z of this.resolvePathStack)Z(this.path);return new $w.HttpRequest({protocol:w,hostname:this.hostname||$,port:z,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn($){return this.hostname=$,this}bp($){return this.resolvePathStack.push((w)=>{this.path=`${w?.endsWith("/")?w.slice(0,-1):w||""}`+$}),this}p($,w,z,Y){return this.resolvePathStack.push((Z)=>{this.path=n6(Z,this.input,$,w,z,Y)}),this}h($){return this.headers=$,this}q($){return this.query=$,this}b($){return this.body=$,this}m($){return this.method=$,this}}});
10
- export{E0 as oc,_ as pc,K1 as qc,c as rc,s as sc,P as tc,d0 as uc,Q0 as vc,X1 as wc,H6 as xc,a6 as yc,zw as zc};