@junando/core 0.16.1 → 0.16.3

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.
@@ -0,0 +1,2179 @@
1
+ import { n as __esmMin, r as __exportAll } from "./rolldown-runtime-BMI-E3GI.js";
2
+ import { t as require_dist_cjs } from "./dist-cjs-CBX4z-Yb.js";
3
+ import { createHash, createHmac, getRandomValues } from "node:crypto";
4
+ import { PassThrough, Readable, Writable } from "node:stream";
5
+ import { ReadStream, fstatSync, lstatSync } from "node:fs";
6
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/is-array-buffer/is-array-buffer.js
7
+ var isArrayBuffer;
8
+ var init_is_array_buffer = __esmMin((() => {
9
+ isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
10
+ }));
11
+ //#endregion
12
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-buffer-from/buffer-from.js
13
+ var fromArrayBuffer, fromString;
14
+ var init_buffer_from = __esmMin((() => {
15
+ init_is_array_buffer();
16
+ fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
17
+ if (!isArrayBuffer(input)) throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
18
+ return Buffer.from(input, offset, length);
19
+ };
20
+ fromString = (input, encoding) => {
21
+ if (typeof input !== "string") throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
22
+ return encoding ? Buffer.from(input, encoding) : Buffer.from(input);
23
+ };
24
+ }));
25
+ //#endregion
26
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js
27
+ var BASE64_REGEX, fromBase64;
28
+ var init_fromBase64 = __esmMin((() => {
29
+ init_buffer_from();
30
+ BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
31
+ fromBase64 = (input) => {
32
+ if (input.length * 3 % 4 !== 0) throw new TypeError(`Incorrect padding on base64 string.`);
33
+ if (!BASE64_REGEX.exec(input)) throw new TypeError(`Invalid base64 string.`);
34
+ const buffer = fromString(input, "base64");
35
+ return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
36
+ };
37
+ }));
38
+ //#endregion
39
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.js
40
+ var fromUtf8$1;
41
+ var init_fromUtf8 = __esmMin((() => {
42
+ init_buffer_from();
43
+ fromUtf8$1 = (input) => {
44
+ const buf = fromString(input, "utf8");
45
+ return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
46
+ };
47
+ }));
48
+ //#endregion
49
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js
50
+ var toBase64$1;
51
+ var init_toBase64 = __esmMin((() => {
52
+ init_buffer_from();
53
+ init_fromUtf8();
54
+ toBase64$1 = (_input) => {
55
+ let input;
56
+ if (typeof _input === "string") input = fromUtf8$1(_input);
57
+ else input = _input;
58
+ if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
59
+ return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64");
60
+ };
61
+ }));
62
+ //#endregion
63
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js
64
+ function bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {
65
+ return class Uint8ArrayBlobAdapter extends Uint8Array {
66
+ static fromString(source, encoding = "utf-8") {
67
+ if (typeof source === "string") {
68
+ if (encoding === "base64") return Uint8ArrayBlobAdapter.mutate(fromBase64(source));
69
+ return Uint8ArrayBlobAdapter.mutate(fromUtf8(source));
70
+ }
71
+ throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
72
+ }
73
+ static mutate(source) {
74
+ Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
75
+ return source;
76
+ }
77
+ transformToString(encoding = "utf-8") {
78
+ if (encoding === "base64") return toBase64(this);
79
+ return toUtf8(this);
80
+ }
81
+ };
82
+ }
83
+ var init_Uint8ArrayBlobAdapter = __esmMin((() => {}));
84
+ //#endregion
85
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.js
86
+ var toUtf8$1;
87
+ var init_toUtf8 = __esmMin((() => {
88
+ init_buffer_from();
89
+ toUtf8$1 = (input) => {
90
+ if (typeof input === "string") return input;
91
+ if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
92
+ return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
93
+ };
94
+ }));
95
+ //#endregion
96
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js
97
+ function bindV4(getRandomValues) {
98
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return () => crypto.randomUUID();
99
+ return () => {
100
+ const rnds = /* @__PURE__ */ new Uint8Array(16);
101
+ getRandomValues(rnds);
102
+ rnds[6] = rnds[6] & 15 | 64;
103
+ rnds[8] = rnds[8] & 63 | 128;
104
+ return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]];
105
+ };
106
+ }
107
+ var decimalToHex;
108
+ var init_v4 = __esmMin((() => {
109
+ decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
110
+ }));
111
+ //#endregion
112
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js
113
+ var copyDocumentWithTransform;
114
+ var init_copyDocumentWithTransform = __esmMin((() => {
115
+ copyDocumentWithTransform = (source, _schemaRef, _transform = (_) => _) => source;
116
+ }));
117
+ //#endregion
118
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/getSmithyContext.js
119
+ var import_dist_cjs, getSmithyContext;
120
+ var init_getSmithyContext = __esmMin((() => {
121
+ import_dist_cjs = require_dist_cjs();
122
+ getSmithyContext = (context) => context[import_dist_cjs.SMITHY_CONTEXT_KEY] || (context[import_dist_cjs.SMITHY_CONTEXT_KEY] = {});
123
+ }));
124
+ //#endregion
125
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/hasOwn.js
126
+ function hasOwn(o, k) {
127
+ return Object.prototype.hasOwnProperty.call(o, k);
128
+ }
129
+ var init_hasOwn = __esmMin((() => {}));
130
+ //#endregion
131
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/httpRequest.js
132
+ function cloneQuery(query) {
133
+ return Object.keys(query).reduce((carry, paramName) => {
134
+ const param = query[paramName];
135
+ return {
136
+ ...carry,
137
+ [paramName]: Array.isArray(param) ? [...param] : param
138
+ };
139
+ }, {});
140
+ }
141
+ var HttpRequest;
142
+ var init_httpRequest = __esmMin((() => {
143
+ HttpRequest = class HttpRequest {
144
+ method;
145
+ protocol;
146
+ hostname;
147
+ port;
148
+ path;
149
+ query;
150
+ headers;
151
+ username;
152
+ password;
153
+ fragment;
154
+ body;
155
+ constructor(options) {
156
+ this.method = options.method || "GET";
157
+ this.hostname = options.hostname || "localhost";
158
+ this.port = options.port;
159
+ this.query = options.query || {};
160
+ this.headers = options.headers || {};
161
+ this.body = options.body;
162
+ this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
163
+ this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
164
+ this.username = options.username;
165
+ this.password = options.password;
166
+ this.fragment = options.fragment;
167
+ }
168
+ static clone(request) {
169
+ const cloned = new HttpRequest({
170
+ ...request,
171
+ headers: { ...request.headers }
172
+ });
173
+ if (cloned.query) cloned.query = cloneQuery(cloned.query);
174
+ return cloned;
175
+ }
176
+ static isInstance(request) {
177
+ if (!request) return false;
178
+ const req = request;
179
+ return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
180
+ }
181
+ clone() {
182
+ return HttpRequest.clone(this);
183
+ }
184
+ };
185
+ }));
186
+ //#endregion
187
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/httpResponse.js
188
+ var HttpResponse;
189
+ var init_httpResponse = __esmMin((() => {
190
+ HttpResponse = class {
191
+ statusCode;
192
+ reason;
193
+ headers;
194
+ body;
195
+ constructor(options) {
196
+ this.statusCode = options.statusCode;
197
+ this.reason = options.reason;
198
+ this.headers = options.headers || {};
199
+ this.body = options.body;
200
+ }
201
+ static isInstance(response) {
202
+ if (!response) return false;
203
+ const resp = response;
204
+ return typeof resp.statusCode === "number" && typeof resp.headers === "object";
205
+ }
206
+ };
207
+ }));
208
+ //#endregion
209
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/isValidHostname.js
210
+ function isValidHostname(hostname) {
211
+ return /^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(hostname);
212
+ }
213
+ var init_isValidHostname = __esmMin((() => {}));
214
+ //#endregion
215
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/normalizeProvider.js
216
+ var normalizeProvider;
217
+ var init_normalizeProvider = __esmMin((() => {
218
+ normalizeProvider = (input) => {
219
+ if (typeof input === "function") return input;
220
+ const promisified = Promise.resolve(input);
221
+ return () => promisified;
222
+ };
223
+ }));
224
+ //#endregion
225
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/parseQueryString.js
226
+ function parseQueryString(querystring) {
227
+ const query = {};
228
+ querystring = querystring.replace(/^\?/, "");
229
+ if (querystring) for (const pair of querystring.split("&")) {
230
+ let [key, value = null] = pair.split("=");
231
+ key = decodeURIComponent(key);
232
+ if (value) value = decodeURIComponent(value);
233
+ if (!(key in query)) query[key] = value;
234
+ else if (Array.isArray(query[key])) query[key].push(value);
235
+ else query[key] = [query[key], value];
236
+ }
237
+ return query;
238
+ }
239
+ var init_parseQueryString = __esmMin((() => {}));
240
+ //#endregion
241
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/parseUrl.js
242
+ var parseUrl;
243
+ var init_parseUrl = __esmMin((() => {
244
+ init_parseQueryString();
245
+ parseUrl = (url) => {
246
+ if (typeof url === "string") return parseUrl(new URL(url));
247
+ const { hostname, pathname, port, protocol, search } = url;
248
+ let query;
249
+ if (search) query = parseQueryString(search);
250
+ return {
251
+ hostname,
252
+ port: port ? parseInt(port) : void 0,
253
+ protocol,
254
+ path: pathname,
255
+ query
256
+ };
257
+ };
258
+ }));
259
+ //#endregion
260
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/toEndpointV1.js
261
+ var toEndpointV1;
262
+ var init_toEndpointV1 = __esmMin((() => {
263
+ init_hasOwn();
264
+ init_parseUrl();
265
+ toEndpointV1 = (endpoint) => {
266
+ if (typeof endpoint === "object") {
267
+ if ("url" in endpoint) {
268
+ const v1Endpoint = parseUrl(endpoint.url);
269
+ if (endpoint.headers) {
270
+ v1Endpoint.headers = {};
271
+ for (const name in endpoint.headers) {
272
+ if (!hasOwn(endpoint.headers, name)) continue;
273
+ v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
274
+ }
275
+ }
276
+ return v1Endpoint;
277
+ }
278
+ return endpoint;
279
+ }
280
+ return parseUrl(endpoint);
281
+ };
282
+ }));
283
+ //#endregion
284
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/transport/index.js
285
+ var init_transport = __esmMin((() => {
286
+ init_getSmithyContext();
287
+ init_hasOwn();
288
+ init_httpRequest();
289
+ init_httpResponse();
290
+ init_isValidHostname();
291
+ init_normalizeProvider();
292
+ init_parseQueryString();
293
+ init_parseUrl();
294
+ init_toEndpointV1();
295
+ }));
296
+ //#endregion
297
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js
298
+ var parseBoolean, expectBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, expectUnion, strictParseDouble, strictParseFloat, strictParseFloat32, NUMBER_REGEX, parseNumber, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, parseFloatString, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger;
299
+ var init_parse_utils = __esmMin((() => {
300
+ init_transport();
301
+ parseBoolean = (value) => {
302
+ switch (value) {
303
+ case "true": return true;
304
+ case "false": return false;
305
+ default: throw new Error(`Unable to parse boolean value "${value}"`);
306
+ }
307
+ };
308
+ expectBoolean = (value) => {
309
+ if (value === null || value === void 0) return;
310
+ if (typeof value === "number") {
311
+ if (value === 0 || value === 1) logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
312
+ if (value === 0) return false;
313
+ if (value === 1) return true;
314
+ }
315
+ if (typeof value === "string") {
316
+ const lower = value.toLowerCase();
317
+ if (lower === "false" || lower === "true") logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
318
+ if (lower === "false") return false;
319
+ if (lower === "true") return true;
320
+ }
321
+ if (typeof value === "boolean") return value;
322
+ throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);
323
+ };
324
+ expectNumber = (value) => {
325
+ if (value === null || value === void 0) return;
326
+ if (typeof value === "string") {
327
+ const parsed = parseFloat(value);
328
+ if (!Number.isNaN(parsed)) {
329
+ if (String(parsed) !== String(value)) logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
330
+ return parsed;
331
+ }
332
+ }
333
+ if (typeof value === "number") return value;
334
+ throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
335
+ };
336
+ MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
337
+ expectFloat32 = (value) => {
338
+ const expected = expectNumber(value);
339
+ if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
340
+ if (Math.abs(expected) > MAX_FLOAT) throw new TypeError(`Expected 32-bit float, got ${value}`);
341
+ }
342
+ return expected;
343
+ };
344
+ expectLong = (value) => {
345
+ if (value === null || value === void 0) return;
346
+ if (Number.isInteger(value) && !Number.isNaN(value)) return value;
347
+ throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
348
+ };
349
+ expectInt = expectLong;
350
+ expectInt32 = (value) => expectSizedInt(value, 32);
351
+ expectShort = (value) => expectSizedInt(value, 16);
352
+ expectByte = (value) => expectSizedInt(value, 8);
353
+ expectSizedInt = (value, size) => {
354
+ const expected = expectLong(value);
355
+ if (expected !== void 0 && castInt(expected, size) !== expected) throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
356
+ return expected;
357
+ };
358
+ castInt = (value, size) => {
359
+ switch (size) {
360
+ case 32: return Int32Array.of(value)[0];
361
+ case 16: return Int16Array.of(value)[0];
362
+ case 8: return Int8Array.of(value)[0];
363
+ }
364
+ };
365
+ expectNonNull = (value, location) => {
366
+ if (value === null || value === void 0) {
367
+ if (location) throw new TypeError(`Expected a non-null value for ${location}`);
368
+ throw new TypeError("Expected a non-null value");
369
+ }
370
+ return value;
371
+ };
372
+ expectObject = (value) => {
373
+ if (value === null || value === void 0) return;
374
+ if (typeof value === "object" && !Array.isArray(value)) return value;
375
+ throw new TypeError(`Expected object, got ${Array.isArray(value) ? "array" : typeof value}: ${value}`);
376
+ };
377
+ expectString = (value) => {
378
+ if (value === null || value === void 0) return;
379
+ if (typeof value === "string") return value;
380
+ if ([
381
+ "boolean",
382
+ "number",
383
+ "bigint"
384
+ ].includes(typeof value)) {
385
+ logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
386
+ return String(value);
387
+ }
388
+ throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
389
+ };
390
+ expectUnion = (value) => {
391
+ if (value === null || value === void 0) return;
392
+ const asObject = expectObject(value);
393
+ const setKeys = [];
394
+ for (const k in asObject) {
395
+ if (!hasOwn(asObject, k)) continue;
396
+ if (asObject[k] != null) setKeys.push(k);
397
+ }
398
+ if (setKeys.length === 0) throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
399
+ if (setKeys.length > 1) throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
400
+ return asObject;
401
+ };
402
+ strictParseDouble = (value) => {
403
+ if (typeof value == "string") return expectNumber(parseNumber(value));
404
+ return expectNumber(value);
405
+ };
406
+ strictParseFloat = strictParseDouble;
407
+ strictParseFloat32 = (value) => {
408
+ if (typeof value == "string") return expectFloat32(parseNumber(value));
409
+ return expectFloat32(value);
410
+ };
411
+ NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
412
+ parseNumber = (value) => {
413
+ const matches = value.match(NUMBER_REGEX);
414
+ if (matches === null || matches[0].length !== value.length) throw new TypeError(`Expected real number, got implicit NaN`);
415
+ return parseFloat(value);
416
+ };
417
+ limitedParseDouble = (value) => {
418
+ if (typeof value == "string") return parseFloatString(value);
419
+ return expectNumber(value);
420
+ };
421
+ handleFloat = limitedParseDouble;
422
+ limitedParseFloat = limitedParseDouble;
423
+ limitedParseFloat32 = (value) => {
424
+ if (typeof value == "string") return parseFloatString(value);
425
+ return expectFloat32(value);
426
+ };
427
+ parseFloatString = (value) => {
428
+ switch (value) {
429
+ case "NaN": return NaN;
430
+ case "Infinity": return Infinity;
431
+ case "-Infinity": return -Infinity;
432
+ default: throw new Error(`Unable to parse float value: ${value}`);
433
+ }
434
+ };
435
+ strictParseLong = (value) => {
436
+ if (typeof value === "string") return expectLong(parseNumber(value));
437
+ return expectLong(value);
438
+ };
439
+ strictParseInt = strictParseLong;
440
+ strictParseInt32 = (value) => {
441
+ if (typeof value === "string") return expectInt32(parseNumber(value));
442
+ return expectInt32(value);
443
+ };
444
+ strictParseShort = (value) => {
445
+ if (typeof value === "string") return expectShort(parseNumber(value));
446
+ return expectShort(value);
447
+ };
448
+ strictParseByte = (value) => {
449
+ if (typeof value === "string") return expectByte(parseNumber(value));
450
+ return expectByte(value);
451
+ };
452
+ stackTraceWarning = (message) => {
453
+ return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n");
454
+ };
455
+ logger = { warn: console.warn };
456
+ }));
457
+ //#endregion
458
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js
459
+ function dateToUtcString(date) {
460
+ const year = date.getUTCFullYear();
461
+ const month = date.getUTCMonth();
462
+ const dayOfWeek = date.getUTCDay();
463
+ const dayOfMonthInt = date.getUTCDate();
464
+ const hoursInt = date.getUTCHours();
465
+ const minutesInt = date.getUTCMinutes();
466
+ const secondsInt = date.getUTCSeconds();
467
+ const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
468
+ const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
469
+ const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
470
+ const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
471
+ return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
472
+ }
473
+ var DAYS, MONTHS, RFC3339, parseRfc3339DateTime, RFC3339_WITH_OFFSET$1, parseRfc3339DateTimeWithOffset, IMF_FIXDATE$1, RFC_850_DATE$1, ASC_TIME$1, parseRfc7231DateTime, parseEpochTimestamp, buildDate, parseTwoDigitYear, FIFTY_YEARS_IN_MILLIS, adjustRfc850Year, parseMonthByShortName, DAYS_IN_MONTH, validateDayOfMonth, isLeapYear, parseDateValue, parseMilliseconds, parseOffsetToMilliseconds, stripLeadingZeroes;
474
+ var init_date_utils = __esmMin((() => {
475
+ init_parse_utils();
476
+ DAYS = [
477
+ "Sun",
478
+ "Mon",
479
+ "Tue",
480
+ "Wed",
481
+ "Thu",
482
+ "Fri",
483
+ "Sat"
484
+ ];
485
+ MONTHS = [
486
+ "Jan",
487
+ "Feb",
488
+ "Mar",
489
+ "Apr",
490
+ "May",
491
+ "Jun",
492
+ "Jul",
493
+ "Aug",
494
+ "Sep",
495
+ "Oct",
496
+ "Nov",
497
+ "Dec"
498
+ ];
499
+ RFC3339 = /* @__PURE__ */ new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
500
+ parseRfc3339DateTime = (value) => {
501
+ if (value === null || value === void 0) return;
502
+ if (typeof value !== "string") throw new TypeError("RFC-3339 date-times must be expressed as strings");
503
+ const match = RFC3339.exec(value);
504
+ if (!match) throw new TypeError("Invalid RFC-3339 date-time value");
505
+ const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
506
+ const year = strictParseShort(stripLeadingZeroes(yearStr));
507
+ const month = parseDateValue(monthStr, "month", 1, 12);
508
+ const day = parseDateValue(dayStr, "day", 1, 31);
509
+ return buildDate(year, month, day, {
510
+ hours,
511
+ minutes,
512
+ seconds,
513
+ fractionalMilliseconds
514
+ });
515
+ };
516
+ RFC3339_WITH_OFFSET$1 = /* @__PURE__ */ new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/);
517
+ parseRfc3339DateTimeWithOffset = (value) => {
518
+ if (value === null || value === void 0) return;
519
+ if (typeof value !== "string") throw new TypeError("RFC-3339 date-times must be expressed as strings");
520
+ const match = RFC3339_WITH_OFFSET$1.exec(value);
521
+ if (!match) throw new TypeError("Invalid RFC-3339 date-time value");
522
+ const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
523
+ const year = strictParseShort(stripLeadingZeroes(yearStr));
524
+ const month = parseDateValue(monthStr, "month", 1, 12);
525
+ const day = parseDateValue(dayStr, "day", 1, 31);
526
+ const date = buildDate(year, month, day, {
527
+ hours,
528
+ minutes,
529
+ seconds,
530
+ fractionalMilliseconds
531
+ });
532
+ if (offsetStr.toUpperCase() != "Z") date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
533
+ return date;
534
+ };
535
+ IMF_FIXDATE$1 = /* @__PURE__ */ 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$/);
536
+ RFC_850_DATE$1 = /* @__PURE__ */ 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$/);
537
+ ASC_TIME$1 = /* @__PURE__ */ 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})$/);
538
+ parseRfc7231DateTime = (value) => {
539
+ if (value === null || value === void 0) return;
540
+ if (typeof value !== "string") throw new TypeError("RFC-7231 date-times must be expressed as strings");
541
+ let match = IMF_FIXDATE$1.exec(value);
542
+ if (match) {
543
+ const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
544
+ return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
545
+ hours,
546
+ minutes,
547
+ seconds,
548
+ fractionalMilliseconds
549
+ });
550
+ }
551
+ match = RFC_850_DATE$1.exec(value);
552
+ if (match) {
553
+ const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
554
+ return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
555
+ hours,
556
+ minutes,
557
+ seconds,
558
+ fractionalMilliseconds
559
+ }));
560
+ }
561
+ match = ASC_TIME$1.exec(value);
562
+ if (match) {
563
+ const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
564
+ return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), {
565
+ hours,
566
+ minutes,
567
+ seconds,
568
+ fractionalMilliseconds
569
+ });
570
+ }
571
+ throw new TypeError("Invalid RFC-7231 date-time value");
572
+ };
573
+ parseEpochTimestamp = (value) => {
574
+ if (value === null || value === void 0) return;
575
+ let valueAsDouble;
576
+ if (typeof value === "number") valueAsDouble = value;
577
+ else if (typeof value === "string") valueAsDouble = strictParseDouble(value);
578
+ else if (typeof value === "object" && value.tag === 1) valueAsDouble = value.value;
579
+ else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");
580
+ if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
581
+ return new Date(Math.round(valueAsDouble * 1e3));
582
+ };
583
+ buildDate = (year, month, day, time) => {
584
+ const adjustedMonth = month - 1;
585
+ validateDayOfMonth(year, adjustedMonth, day);
586
+ return new Date(Date.UTC(year, adjustedMonth, day, parseDateValue(time.hours, "hour", 0, 23), parseDateValue(time.minutes, "minute", 0, 59), parseDateValue(time.seconds, "seconds", 0, 60), parseMilliseconds(time.fractionalMilliseconds)));
587
+ };
588
+ parseTwoDigitYear = (value) => {
589
+ const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear();
590
+ const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
591
+ if (valueInThisCentury < thisYear) return valueInThisCentury + 100;
592
+ return valueInThisCentury;
593
+ };
594
+ FIFTY_YEARS_IN_MILLIS = 15768e8;
595
+ adjustRfc850Year = (input) => {
596
+ if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) return new Date(Date.UTC(input.getUTCFullYear() - 100, input.getUTCMonth(), input.getUTCDate(), input.getUTCHours(), input.getUTCMinutes(), input.getUTCSeconds(), input.getUTCMilliseconds()));
597
+ return input;
598
+ };
599
+ parseMonthByShortName = (value) => {
600
+ const monthIdx = MONTHS.indexOf(value);
601
+ if (monthIdx < 0) throw new TypeError(`Invalid month: ${value}`);
602
+ return monthIdx + 1;
603
+ };
604
+ DAYS_IN_MONTH = [
605
+ 31,
606
+ 28,
607
+ 31,
608
+ 30,
609
+ 31,
610
+ 30,
611
+ 31,
612
+ 31,
613
+ 30,
614
+ 31,
615
+ 30,
616
+ 31
617
+ ];
618
+ validateDayOfMonth = (year, month, day) => {
619
+ let maxDays = DAYS_IN_MONTH[month];
620
+ if (month === 1 && isLeapYear(year)) maxDays = 29;
621
+ if (day > maxDays) throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
622
+ };
623
+ isLeapYear = (year) => {
624
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
625
+ };
626
+ parseDateValue = (value, type, lower, upper) => {
627
+ const dateVal = strictParseByte(stripLeadingZeroes(value));
628
+ if (dateVal < lower || dateVal > upper) throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
629
+ return dateVal;
630
+ };
631
+ parseMilliseconds = (value) => {
632
+ if (value === null || value === void 0) return 0;
633
+ return strictParseFloat32("0." + value) * 1e3;
634
+ };
635
+ parseOffsetToMilliseconds = (value) => {
636
+ const directionStr = value[0];
637
+ let direction = 1;
638
+ if (directionStr == "+") direction = 1;
639
+ else if (directionStr == "-") direction = -1;
640
+ else throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
641
+ const hour = Number(value.substring(1, 3));
642
+ const minute = Number(value.substring(4, 6));
643
+ return direction * (hour * 60 + minute) * 60 * 1e3;
644
+ };
645
+ stripLeadingZeroes = (value) => {
646
+ let idx = 0;
647
+ while (idx < value.length - 1 && value.charAt(idx) === "0") idx++;
648
+ if (idx === 0) return value;
649
+ return value.slice(idx);
650
+ };
651
+ }));
652
+ //#endregion
653
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js
654
+ var LazyJsonString;
655
+ var init_lazy_json = __esmMin((() => {
656
+ LazyJsonString = function LazyJsonString(val) {
657
+ return Object.assign(new String(val), {
658
+ deserializeJSON() {
659
+ return JSON.parse(String(val));
660
+ },
661
+ toString() {
662
+ return String(val);
663
+ },
664
+ toJSON() {
665
+ return String(val);
666
+ }
667
+ });
668
+ };
669
+ LazyJsonString.from = (object) => {
670
+ if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) return object;
671
+ else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) return LazyJsonString(String(object));
672
+ return LazyJsonString(JSON.stringify(object));
673
+ };
674
+ LazyJsonString.fromObject = LazyJsonString.from;
675
+ }));
676
+ //#endregion
677
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js
678
+ function quoteHeader(part) {
679
+ if (part.includes(",") || part.includes("\"")) part = `"${part.replace(/"/g, "\\\"")}"`;
680
+ return part;
681
+ }
682
+ var init_quote_header = __esmMin((() => {}));
683
+ //#endregion
684
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js
685
+ function range(v, min, max) {
686
+ const _v = Number(v);
687
+ if (_v < min || _v > max) throw new Error(`Value ${_v} out of range [${min}, ${max}]`);
688
+ }
689
+ var ddd, mmm, time, date, year, RFC3339_WITH_OFFSET, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, months, _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime;
690
+ var init_schema_date_utils = __esmMin((() => {
691
+ ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;
692
+ mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;
693
+ time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`;
694
+ date = `(\\d?\\d)`;
695
+ year = `(\\d{4})`;
696
+ RFC3339_WITH_OFFSET = /* @__PURE__ */ new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/);
697
+ IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);
698
+ RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`);
699
+ ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`);
700
+ months = [
701
+ "Jan",
702
+ "Feb",
703
+ "Mar",
704
+ "Apr",
705
+ "May",
706
+ "Jun",
707
+ "Jul",
708
+ "Aug",
709
+ "Sep",
710
+ "Oct",
711
+ "Nov",
712
+ "Dec"
713
+ ];
714
+ _parseEpochTimestamp = (value) => {
715
+ if (value == null) return;
716
+ let num = NaN;
717
+ if (typeof value === "number") num = value;
718
+ else if (typeof value === "string") {
719
+ if (!/^-?\d*\.?\d+$/.test(value)) throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);
720
+ num = Number.parseFloat(value);
721
+ } else if (typeof value === "object" && value.tag === 1) num = value.value;
722
+ if (isNaN(num) || Math.abs(num) === Infinity) throw new TypeError("Epoch timestamps must be valid finite numbers.");
723
+ return new Date(Math.round(num * 1e3));
724
+ };
725
+ _parseRfc3339DateTimeWithOffset = (value) => {
726
+ if (value == null) return;
727
+ if (typeof value !== "string") throw new TypeError("RFC3339 timestamps must be strings");
728
+ const matches = RFC3339_WITH_OFFSET.exec(value);
729
+ if (!matches) throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
730
+ const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
731
+ range(monthStr, 1, 12);
732
+ range(dayStr, 1, 31);
733
+ range(hours, 0, 23);
734
+ range(minutes, 0, 59);
735
+ range(seconds, 0, 60);
736
+ const date = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1e3) : 0));
737
+ date.setUTCFullYear(Number(yearStr));
738
+ if (offsetStr.toUpperCase() != "Z") {
739
+ const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [
740
+ void 0,
741
+ "+",
742
+ 0,
743
+ 0
744
+ ];
745
+ const scalar = sign === "-" ? 1 : -1;
746
+ date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3));
747
+ }
748
+ return date;
749
+ };
750
+ _parseRfc7231DateTime = (value) => {
751
+ if (value == null) return;
752
+ if (typeof value !== "string") throw new TypeError("RFC7231 timestamps must be strings.");
753
+ let day;
754
+ let month;
755
+ let year;
756
+ let hour;
757
+ let minute;
758
+ let second;
759
+ let fraction;
760
+ let matches;
761
+ if (matches = IMF_FIXDATE.exec(value)) [, day, month, year, hour, minute, second, fraction] = matches;
762
+ else if (matches = RFC_850_DATE.exec(value)) {
763
+ [, day, month, year, hour, minute, second, fraction] = matches;
764
+ year = (Number(year) + 1900).toString();
765
+ } else if (matches = ASC_TIME.exec(value)) [, month, day, hour, minute, second, fraction, year] = matches;
766
+ if (year && second) {
767
+ const timestamp = Date.UTC(Number(year), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1e3) : 0);
768
+ range(day, 1, 31);
769
+ range(hour, 0, 23);
770
+ range(minute, 0, 59);
771
+ range(second, 0, 60);
772
+ const date = new Date(timestamp);
773
+ date.setUTCFullYear(Number(year));
774
+ return date;
775
+ }
776
+ throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);
777
+ };
778
+ }));
779
+ //#endregion
780
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/split-every.js
781
+ function splitEvery(value, delimiter, numDelimiters) {
782
+ if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
783
+ const segments = value.split(delimiter);
784
+ if (numDelimiters === 1) return segments;
785
+ const compoundSegments = [];
786
+ let currentSegment = "";
787
+ for (let i = 0; i < segments.length; i++) {
788
+ if (currentSegment === "") currentSegment = segments[i];
789
+ else currentSegment += delimiter + segments[i];
790
+ if ((i + 1) % numDelimiters === 0) {
791
+ compoundSegments.push(currentSegment);
792
+ currentSegment = "";
793
+ }
794
+ }
795
+ if (currentSegment !== "") compoundSegments.push(currentSegment);
796
+ return compoundSegments;
797
+ }
798
+ var init_split_every = __esmMin((() => {}));
799
+ //#endregion
800
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/split-header.js
801
+ var splitHeader;
802
+ var init_split_header = __esmMin((() => {
803
+ splitHeader = (value) => {
804
+ const z = value.length;
805
+ const values = [];
806
+ let withinQuotes = false;
807
+ let prevChar = void 0;
808
+ let anchor = 0;
809
+ for (let i = 0; i < z; ++i) {
810
+ const char = value[i];
811
+ switch (char) {
812
+ case `"`:
813
+ if (prevChar !== "\\") withinQuotes = !withinQuotes;
814
+ break;
815
+ case ",": if (!withinQuotes) {
816
+ values.push(value.slice(anchor, i));
817
+ anchor = i + 1;
818
+ }
819
+ }
820
+ prevChar = char;
821
+ }
822
+ values.push(value.slice(anchor));
823
+ return values.map((v) => {
824
+ v = v.trim();
825
+ const z = v.length;
826
+ if (z < 2) return v;
827
+ if (v[0] === `"` && v[z - 1] === `"`) v = v.slice(1, z - 1);
828
+ return v.replace(/\\"/g, "\"");
829
+ });
830
+ };
831
+ }));
832
+ //#endregion
833
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js
834
+ function nv(input) {
835
+ return new NumericValue(String(input), "bigDecimal");
836
+ }
837
+ var format, NumericValue;
838
+ var init_NumericValue = __esmMin((() => {
839
+ format = /^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;
840
+ NumericValue = class NumericValue {
841
+ string;
842
+ type;
843
+ constructor(string, type) {
844
+ this.string = string;
845
+ this.type = type;
846
+ if (!format.test(string)) throw new Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${string}"`);
847
+ }
848
+ toString() {
849
+ return this.string;
850
+ }
851
+ static [Symbol.hasInstance](object) {
852
+ if (!object || typeof object !== "object") return false;
853
+ const _nv = object;
854
+ return NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string);
855
+ }
856
+ };
857
+ }));
858
+ //#endregion
859
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js
860
+ function fromHex(encoded) {
861
+ if (encoded.length % 2 !== 0) throw new Error("Hex encoded strings must have an even number length");
862
+ const out = new Uint8Array(encoded.length / 2);
863
+ for (let i = 0; i < encoded.length; i += 2) {
864
+ const encodedByte = encoded.slice(i, i + 2).toLowerCase();
865
+ if (encodedByte in HEX_TO_SHORT) out[i / 2] = HEX_TO_SHORT[encodedByte];
866
+ else throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
867
+ }
868
+ return out;
869
+ }
870
+ function toHex(bytes) {
871
+ let out = "";
872
+ for (let i = 0; i < bytes.byteLength; i++) out += SHORT_TO_HEX[bytes[i]];
873
+ return out;
874
+ }
875
+ var SHORT_TO_HEX, HEX_TO_SHORT;
876
+ var init_hex_encoding = __esmMin((() => {
877
+ SHORT_TO_HEX = {};
878
+ HEX_TO_SHORT = {};
879
+ for (let i = 0; i < 256; i++) {
880
+ let encodedByte = i.toString(16).toLowerCase();
881
+ if (encodedByte.length === 1) encodedByte = `0${encodedByte}`;
882
+ SHORT_TO_HEX[i] = encodedByte;
883
+ HEX_TO_SHORT[encodedByte] = i;
884
+ }
885
+ }));
886
+ //#endregion
887
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-body-length/calculateBodyLength.js
888
+ var calculateBodyLength;
889
+ var init_calculateBodyLength = __esmMin((() => {
890
+ calculateBodyLength = (body) => {
891
+ if (!body) return 0;
892
+ if (typeof body === "string") return Buffer.byteLength(body);
893
+ else if (typeof body.byteLength === "number") return body.byteLength;
894
+ else if (typeof body.size === "number") return body.size;
895
+ else if (typeof body.start === "number" && typeof body.end === "number") return body.end + 1 - body.start;
896
+ else if (body instanceof ReadStream) {
897
+ if (body.path != null) return lstatSync(body.path).size;
898
+ else if (typeof body.fd === "number") return fstatSync(body.fd).size;
899
+ }
900
+ throw new Error(`Body Length computation failed for ${body}`);
901
+ };
902
+ }));
903
+ //#endregion
904
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js
905
+ var toUint8Array;
906
+ var init_toUint8Array = __esmMin((() => {
907
+ init_fromUtf8();
908
+ toUint8Array = (data) => {
909
+ if (data instanceof Uint8Array) return data;
910
+ if (typeof data === "string") return fromUtf8$1(data);
911
+ if (ArrayBuffer.isView(data)) return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
912
+ return new Uint8Array(data);
913
+ };
914
+ }));
915
+ //#endregion
916
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/concatBytes.js
917
+ function concatBytes(arrays, length) {
918
+ if (length === void 0) {
919
+ length = 0;
920
+ for (const bytes of arrays) length += bytes.byteLength;
921
+ }
922
+ const result = new Uint8Array(length);
923
+ let offset = 0;
924
+ for (const buf of arrays) {
925
+ result.set(buf, offset);
926
+ offset += buf.byteLength;
927
+ }
928
+ return result;
929
+ }
930
+ var init_concatBytes = __esmMin((() => {}));
931
+ //#endregion
932
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/middleware-serde/deserializerMiddleware.js
933
+ var deserializerMiddleware, findHeader;
934
+ var init_deserializerMiddleware = __esmMin((() => {
935
+ init_transport();
936
+ deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
937
+ const { response } = await next(args);
938
+ try {
939
+ return {
940
+ response,
941
+ output: await deserializer(response, options)
942
+ };
943
+ } catch (error) {
944
+ Object.defineProperty(error, "$response", {
945
+ value: response,
946
+ enumerable: false,
947
+ writable: false,
948
+ configurable: false
949
+ });
950
+ if (!("$metadata" in error)) {
951
+ const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
952
+ try {
953
+ error.message += "\n " + hint;
954
+ } catch (ignored) {
955
+ if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") console.warn(hint);
956
+ else context.logger?.warn?.(hint);
957
+ }
958
+ if (typeof error.$responseBodyText !== "undefined") {
959
+ if (error.$response) error.$response.body = error.$responseBodyText;
960
+ }
961
+ try {
962
+ if (HttpResponse.isInstance(response)) {
963
+ const { headers = {} } = response;
964
+ const headerEntries = Object.entries(headers);
965
+ error.$metadata = {
966
+ httpStatusCode: response.statusCode,
967
+ requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
968
+ extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
969
+ cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
970
+ };
971
+ }
972
+ } catch (ignored) {}
973
+ }
974
+ throw error;
975
+ }
976
+ };
977
+ findHeader = (pattern, headers) => {
978
+ return (headers.find(([k]) => {
979
+ return k.match(pattern);
980
+ }) || [void 0, void 0])[1];
981
+ };
982
+ }));
983
+ //#endregion
984
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/schema/deref.js
985
+ var deref;
986
+ var init_deref = __esmMin((() => {
987
+ deref = (schemaRef) => {
988
+ if (typeof schemaRef === "function") return schemaRef();
989
+ return schemaRef;
990
+ };
991
+ }));
992
+ //#endregion
993
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js
994
+ function translateTraits(indicator) {
995
+ if (typeof indicator === "object") return indicator;
996
+ indicator = indicator | 0;
997
+ if (traitsCache[indicator]) return traitsCache[indicator];
998
+ const traits = {};
999
+ let i = 0;
1000
+ for (const trait of [
1001
+ "httpLabel",
1002
+ "idempotent",
1003
+ "idempotencyToken",
1004
+ "sensitive",
1005
+ "httpPayload",
1006
+ "httpResponseCode",
1007
+ "httpQueryParams"
1008
+ ]) if ((indicator >> i++ & 1) === 1) traits[trait] = 1;
1009
+ return traitsCache[indicator] = traits;
1010
+ }
1011
+ var traitsCache;
1012
+ var init_translateTraits = __esmMin((() => {
1013
+ traitsCache = [];
1014
+ }));
1015
+ //#endregion
1016
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js
1017
+ function member(memberSchema, memberName) {
1018
+ if (memberSchema instanceof NormalizedSchema) return Object.assign(memberSchema, {
1019
+ memberName,
1020
+ _isMemberSchema: true
1021
+ });
1022
+ return new NormalizedSchema(memberSchema, memberName);
1023
+ }
1024
+ var anno, simpleSchemaCacheN, simpleSchemaCacheS, NormalizedSchema, isMemberSchema, isStaticSchema;
1025
+ var init_NormalizedSchema = __esmMin((() => {
1026
+ init_deref();
1027
+ init_translateTraits();
1028
+ anno = {
1029
+ it: Symbol.for("@smithy/nor-struct-it"),
1030
+ ns: Symbol.for("@smithy/ns")
1031
+ };
1032
+ simpleSchemaCacheN = [];
1033
+ simpleSchemaCacheS = {};
1034
+ NormalizedSchema = class NormalizedSchema {
1035
+ ref;
1036
+ memberName;
1037
+ static symbol = Symbol.for("@smithy/nor");
1038
+ symbol = NormalizedSchema.symbol;
1039
+ name;
1040
+ schema;
1041
+ _isMemberSchema;
1042
+ traits;
1043
+ memberTraits;
1044
+ normalizedTraits;
1045
+ constructor(ref, memberName) {
1046
+ this.ref = ref;
1047
+ this.memberName = memberName;
1048
+ const traitStack = [];
1049
+ let _ref = ref;
1050
+ let schema = ref;
1051
+ this._isMemberSchema = false;
1052
+ while (isMemberSchema(_ref)) {
1053
+ traitStack.push(_ref[1]);
1054
+ _ref = _ref[0];
1055
+ schema = deref(_ref);
1056
+ this._isMemberSchema = true;
1057
+ }
1058
+ if (traitStack.length > 0) {
1059
+ this.memberTraits = {};
1060
+ for (let i = traitStack.length - 1; i >= 0; --i) {
1061
+ const traitSet = traitStack[i];
1062
+ Object.assign(this.memberTraits, translateTraits(traitSet));
1063
+ }
1064
+ } else this.memberTraits = 0;
1065
+ if (schema instanceof NormalizedSchema) {
1066
+ const computedMemberTraits = this.memberTraits;
1067
+ Object.assign(this, schema);
1068
+ this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
1069
+ this.normalizedTraits = void 0;
1070
+ this.memberName = memberName ?? schema.memberName;
1071
+ return;
1072
+ }
1073
+ this.schema = deref(schema);
1074
+ if (isStaticSchema(this.schema)) {
1075
+ this.name = `${this.schema[1]}#${this.schema[2]}`;
1076
+ this.traits = this.schema[3];
1077
+ } else {
1078
+ this.name = this.memberName ?? String(schema);
1079
+ this.traits = 0;
1080
+ }
1081
+ if (this._isMemberSchema && !memberName) throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
1082
+ }
1083
+ static [Symbol.hasInstance](lhs) {
1084
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
1085
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) return lhs.symbol === this.symbol;
1086
+ return isPrototype;
1087
+ }
1088
+ static of(ref) {
1089
+ const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null;
1090
+ if (typeof ref === "number") {
1091
+ if (simpleSchemaCacheN[ref]) return simpleSchemaCacheN[ref];
1092
+ } else if (typeof ref === "string") {
1093
+ if (simpleSchemaCacheS[ref]) return simpleSchemaCacheS[ref];
1094
+ } else if (keyAble) {
1095
+ if (ref[anno.ns]) return ref[anno.ns];
1096
+ }
1097
+ const sc = deref(ref);
1098
+ if (sc instanceof NormalizedSchema) return sc;
1099
+ if (isMemberSchema(sc)) {
1100
+ const [ns, traits] = sc;
1101
+ if (ns instanceof NormalizedSchema) {
1102
+ Object.assign(ns.getMergedTraits(), translateTraits(traits));
1103
+ return ns;
1104
+ }
1105
+ throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
1106
+ }
1107
+ const ns = new NormalizedSchema(sc);
1108
+ if (keyAble) return ref[anno.ns] = ns;
1109
+ if (typeof sc === "string") return simpleSchemaCacheS[sc] = ns;
1110
+ if (typeof sc === "number") return simpleSchemaCacheN[sc] = ns;
1111
+ return ns;
1112
+ }
1113
+ getSchema() {
1114
+ const sc = this.schema;
1115
+ if (Array.isArray(sc) && sc[0] === 0) return sc[4];
1116
+ return sc;
1117
+ }
1118
+ getName(withNamespace = false) {
1119
+ const { name } = this;
1120
+ return !withNamespace && name && name.includes("#") ? name.split("#")[1] : name || void 0;
1121
+ }
1122
+ getMemberName() {
1123
+ return this.memberName;
1124
+ }
1125
+ isMemberSchema() {
1126
+ return this._isMemberSchema;
1127
+ }
1128
+ isListSchema() {
1129
+ const sc = this.getSchema();
1130
+ return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
1131
+ }
1132
+ isMapSchema() {
1133
+ const sc = this.getSchema();
1134
+ return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
1135
+ }
1136
+ isStructSchema() {
1137
+ const sc = this.getSchema();
1138
+ if (typeof sc !== "object") return false;
1139
+ const id = sc[0];
1140
+ return id === 3 || id === -3 || id === 4;
1141
+ }
1142
+ isUnionSchema() {
1143
+ const sc = this.getSchema();
1144
+ if (typeof sc !== "object") return false;
1145
+ return sc[0] === 4;
1146
+ }
1147
+ isBlobSchema() {
1148
+ const sc = this.getSchema();
1149
+ return sc === 21 || sc === 42;
1150
+ }
1151
+ isTimestampSchema() {
1152
+ const sc = this.getSchema();
1153
+ return typeof sc === "number" && sc >= 4 && sc <= 7;
1154
+ }
1155
+ isUnitSchema() {
1156
+ return this.getSchema() === "unit";
1157
+ }
1158
+ isDocumentSchema() {
1159
+ return this.getSchema() === 15;
1160
+ }
1161
+ isStringSchema() {
1162
+ return this.getSchema() === 0;
1163
+ }
1164
+ isBooleanSchema() {
1165
+ return this.getSchema() === 2;
1166
+ }
1167
+ isNumericSchema() {
1168
+ return this.getSchema() === 1;
1169
+ }
1170
+ isBigIntegerSchema() {
1171
+ return this.getSchema() === 17;
1172
+ }
1173
+ isBigDecimalSchema() {
1174
+ return this.getSchema() === 19;
1175
+ }
1176
+ isStreaming() {
1177
+ const { streaming } = this.getMergedTraits();
1178
+ return !!streaming || this.getSchema() === 42;
1179
+ }
1180
+ isIdempotencyToken() {
1181
+ return !!this.getMergedTraits().idempotencyToken;
1182
+ }
1183
+ getMergedTraits() {
1184
+ return this.normalizedTraits ?? (this.normalizedTraits = {
1185
+ ...this.getOwnTraits(),
1186
+ ...this.getMemberTraits()
1187
+ });
1188
+ }
1189
+ getMemberTraits() {
1190
+ return translateTraits(this.memberTraits);
1191
+ }
1192
+ getOwnTraits() {
1193
+ return translateTraits(this.traits);
1194
+ }
1195
+ getKeySchema() {
1196
+ const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];
1197
+ if (!isDoc && !isMap) throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
1198
+ const schema = this.getSchema();
1199
+ return member([isDoc ? 15 : schema[4] ?? 0, 0], "key");
1200
+ }
1201
+ getValueSchema() {
1202
+ const sc = this.getSchema();
1203
+ const [isDoc, isMap, isList] = [
1204
+ this.isDocumentSchema(),
1205
+ this.isMapSchema(),
1206
+ this.isListSchema()
1207
+ ];
1208
+ const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0;
1209
+ if (memberSchema != null) return member([memberSchema, 0], isMap ? "value" : "member");
1210
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
1211
+ }
1212
+ getMemberSchema(memberName) {
1213
+ const struct = this.getSchema();
1214
+ if (this.isStructSchema() && struct[4].includes(memberName)) {
1215
+ const i = struct[4].indexOf(memberName);
1216
+ const memberSchema = struct[5][i];
1217
+ return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);
1218
+ }
1219
+ if (this.isDocumentSchema()) return member([15, 0], memberName);
1220
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`);
1221
+ }
1222
+ getMemberSchemas() {
1223
+ const buffer = {};
1224
+ try {
1225
+ for (const [k, v] of this.structIterator()) buffer[k] = v;
1226
+ } catch (ignored) {}
1227
+ return buffer;
1228
+ }
1229
+ getEventStreamMember() {
1230
+ if (this.isStructSchema()) {
1231
+ for (const [memberName, memberSchema] of this.structIterator()) if (memberSchema.isStreaming() && memberSchema.isStructSchema()) return memberName;
1232
+ }
1233
+ return "";
1234
+ }
1235
+ *structIterator() {
1236
+ if (this.isUnitSchema()) return;
1237
+ if (!this.isStructSchema()) throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
1238
+ const struct = this.getSchema();
1239
+ const z = struct[4].length;
1240
+ let it = struct[anno.it];
1241
+ if (it && z === it.length) {
1242
+ yield* it;
1243
+ return;
1244
+ }
1245
+ it = Array(z);
1246
+ for (let i = 0; i < z; ++i) {
1247
+ const k = struct[4][i];
1248
+ const v = member([struct[5][i], 0], k);
1249
+ yield it[i] = [k, v];
1250
+ }
1251
+ struct[anno.it] = it;
1252
+ }
1253
+ };
1254
+ isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
1255
+ isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
1256
+ }));
1257
+ //#endregion
1258
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js
1259
+ var TypeRegistry;
1260
+ var init_TypeRegistry = __esmMin((() => {
1261
+ TypeRegistry = class TypeRegistry {
1262
+ namespace;
1263
+ schemas;
1264
+ exceptions;
1265
+ static registries = /* @__PURE__ */ new Map();
1266
+ constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
1267
+ this.namespace = namespace;
1268
+ this.schemas = schemas;
1269
+ this.exceptions = exceptions;
1270
+ }
1271
+ static for(namespace) {
1272
+ if (!TypeRegistry.registries.has(namespace)) TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));
1273
+ return TypeRegistry.registries.get(namespace);
1274
+ }
1275
+ copyFrom(other) {
1276
+ const { schemas, exceptions } = this;
1277
+ for (const [k, v] of other.schemas) if (!schemas.has(k)) schemas.set(k, v);
1278
+ for (const [k, v] of other.exceptions) if (!exceptions.has(k)) exceptions.set(k, v);
1279
+ }
1280
+ register(shapeId, schema) {
1281
+ const qualifiedName = this.normalizeShapeId(shapeId);
1282
+ for (const r of [this, TypeRegistry.for(qualifiedName.split("#")[0])]) r.schemas.set(qualifiedName, schema);
1283
+ }
1284
+ getSchema(shapeId) {
1285
+ const id = this.normalizeShapeId(shapeId);
1286
+ if (!this.schemas.has(id)) {
1287
+ if (!shapeId.includes("#")) {
1288
+ const suffix = "#" + shapeId;
1289
+ const candidates = [];
1290
+ for (const [shapeId, schema] of this.schemas.entries()) if (shapeId.endsWith(suffix)) candidates.push(schema);
1291
+ if (candidates.length === 1) return candidates[0];
1292
+ }
1293
+ throw new Error(`@smithy/core/schema - schema not found for ${id}`);
1294
+ }
1295
+ return this.schemas.get(id);
1296
+ }
1297
+ registerError(es, ctor) {
1298
+ const $error = es;
1299
+ const ns = $error[1];
1300
+ for (const r of [this, TypeRegistry.for(ns)]) {
1301
+ r.schemas.set(ns + "#" + $error[2], $error);
1302
+ r.exceptions.set($error, ctor);
1303
+ }
1304
+ }
1305
+ getErrorCtor(es) {
1306
+ const $error = es;
1307
+ if (this.exceptions.has($error)) return this.exceptions.get($error);
1308
+ return TypeRegistry.for($error[1]).exceptions.get($error);
1309
+ }
1310
+ getBaseException() {
1311
+ for (const exceptionKey of this.exceptions.keys()) if (Array.isArray(exceptionKey)) {
1312
+ const [, ns, name] = exceptionKey;
1313
+ const id = ns + "#" + name;
1314
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) return exceptionKey;
1315
+ }
1316
+ }
1317
+ find(predicate) {
1318
+ for (const schema of this.schemas.values()) if (predicate(schema)) return schema;
1319
+ }
1320
+ clear() {
1321
+ this.schemas.clear();
1322
+ this.exceptions.clear();
1323
+ }
1324
+ normalizeShapeId(shapeId) {
1325
+ if (shapeId.includes("#")) return shapeId;
1326
+ return this.namespace + "#" + shapeId;
1327
+ }
1328
+ };
1329
+ }));
1330
+ //#endregion
1331
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/schema/index.js
1332
+ var init_schema = __esmMin((() => {
1333
+ init_deref();
1334
+ init_transport();
1335
+ init_NormalizedSchema();
1336
+ init_translateTraits();
1337
+ init_TypeRegistry();
1338
+ }));
1339
+ //#endregion
1340
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js
1341
+ var init_endpoints = __esmMin((() => {
1342
+ init_transport();
1343
+ }));
1344
+ //#endregion
1345
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/middleware-serde/serializerMiddleware.js
1346
+ var serializerMiddleware;
1347
+ var init_serializerMiddleware = __esmMin((() => {
1348
+ init_endpoints();
1349
+ serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
1350
+ const endpointConfig = options;
1351
+ const endpoint = context.endpointV2 ? async () => toEndpointV1(context.endpointV2) : endpointConfig.endpoint;
1352
+ if (!endpoint) throw new Error("No valid endpoint provider available.");
1353
+ const request = await serializer(args.input, {
1354
+ ...options,
1355
+ endpoint
1356
+ });
1357
+ return next({
1358
+ ...args,
1359
+ request
1360
+ });
1361
+ };
1362
+ }));
1363
+ //#endregion
1364
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/middleware-serde/serdePlugin.js
1365
+ function getSerdePlugin(config, serializer, deserializer) {
1366
+ return { applyToStack: (commandStack) => {
1367
+ commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
1368
+ commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
1369
+ } };
1370
+ }
1371
+ var deserializerMiddlewareOption, serializerMiddlewareOption;
1372
+ var init_serdePlugin = __esmMin((() => {
1373
+ init_deserializerMiddleware();
1374
+ init_serializerMiddleware();
1375
+ deserializerMiddlewareOption = {
1376
+ name: "deserializerMiddleware",
1377
+ step: "deserialize",
1378
+ tags: ["DESERIALIZER"],
1379
+ override: true
1380
+ };
1381
+ serializerMiddlewareOption = {
1382
+ name: "serializerMiddleware",
1383
+ step: "serialize",
1384
+ tags: ["SERIALIZER"],
1385
+ override: true
1386
+ };
1387
+ }));
1388
+ //#endregion
1389
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/hash-node/hash-node.js
1390
+ function castSourceData(toCast, encoding) {
1391
+ if (Buffer.isBuffer(toCast)) return toCast;
1392
+ if (typeof toCast === "string") return fromString(toCast, encoding);
1393
+ if (ArrayBuffer.isView(toCast)) return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
1394
+ return fromArrayBuffer(toCast);
1395
+ }
1396
+ var Hash;
1397
+ var init_hash_node = __esmMin((() => {
1398
+ init_buffer_from();
1399
+ init_toUint8Array();
1400
+ Hash = class {
1401
+ algorithmIdentifier;
1402
+ secret;
1403
+ hash;
1404
+ constructor(algorithmIdentifier, secret) {
1405
+ this.algorithmIdentifier = algorithmIdentifier;
1406
+ this.secret = secret;
1407
+ this.reset();
1408
+ }
1409
+ update(toHash, encoding) {
1410
+ this.hash.update(toUint8Array(castSourceData(toHash, encoding)));
1411
+ }
1412
+ digest() {
1413
+ return Promise.resolve(this.hash.digest());
1414
+ }
1415
+ reset() {
1416
+ this.hash = this.secret ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : createHash(this.algorithmIdentifier);
1417
+ }
1418
+ };
1419
+ }));
1420
+ //#endregion
1421
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.js
1422
+ var ChecksumStream$1;
1423
+ var init_ChecksumStream = __esmMin((() => {
1424
+ init_toBase64();
1425
+ ChecksumStream$1 = class extends Readable {
1426
+ expectedChecksum;
1427
+ checksumSourceLocation;
1428
+ checksum;
1429
+ source;
1430
+ base64Encoder;
1431
+ constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
1432
+ super();
1433
+ if (typeof source.pipe !== "function") throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
1434
+ this.source = source;
1435
+ this.base64Encoder = base64Encoder ?? toBase64$1;
1436
+ this.expectedChecksum = expectedChecksum;
1437
+ this.checksum = checksum;
1438
+ this.checksumSourceLocation = checksumSourceLocation;
1439
+ this.source.on("data", this.onSourceData);
1440
+ this.source.on("end", this.onSourceEnd);
1441
+ this.source.on("error", this.onSourceError);
1442
+ this.source.on("close", this.onSourceClose);
1443
+ this.source.pause();
1444
+ }
1445
+ onSourceData = (chunk) => {
1446
+ if (this.destroyed) return;
1447
+ try {
1448
+ this.checksum.update(chunk);
1449
+ } catch (e) {
1450
+ this.destroy(e);
1451
+ return;
1452
+ }
1453
+ if (!this.push(chunk)) this.source.pause();
1454
+ };
1455
+ onSourceEnd = async () => {
1456
+ if (this.destroyed) return;
1457
+ try {
1458
+ const digest = await this.checksum.digest();
1459
+ const received = this.base64Encoder(digest);
1460
+ if (this.expectedChecksum !== received) {
1461
+ this.destroy(/* @__PURE__ */ new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`));
1462
+ return;
1463
+ }
1464
+ } catch (e) {
1465
+ this.destroy(e);
1466
+ return;
1467
+ }
1468
+ this.push(null);
1469
+ };
1470
+ onSourceError = (error) => {
1471
+ this.destroy(error);
1472
+ };
1473
+ onSourceClose = () => {
1474
+ if (!this.destroyed && !this.source.readableEnded) this.destroy(/* @__PURE__ */ new Error("Connection lost or stream closed before all data was received."));
1475
+ };
1476
+ _read(_size) {
1477
+ this.source.resume();
1478
+ }
1479
+ _destroy(error, callback) {
1480
+ this.source?.removeListener("data", this.onSourceData);
1481
+ this.source?.removeListener("end", this.onSourceEnd);
1482
+ this.source?.removeListener("error", this.onSourceError);
1483
+ this.source?.removeListener("close", this.onSourceClose);
1484
+ this.source?.destroy();
1485
+ callback(error);
1486
+ }
1487
+ };
1488
+ }));
1489
+ //#endregion
1490
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-type-check.js
1491
+ var isReadableStream, isBlob;
1492
+ var init_stream_type_check = __esmMin((() => {
1493
+ isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
1494
+ isBlob = (blob) => {
1495
+ return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
1496
+ };
1497
+ }));
1498
+ //#endregion
1499
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.browser.js
1500
+ var fromUtf8;
1501
+ var init_fromUtf8_browser = __esmMin((() => {
1502
+ fromUtf8 = (input) => new TextEncoder().encode(input);
1503
+ })), chars, alphabetByValue;
1504
+ var init_constants_for_browser = __esmMin((() => {
1505
+ chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
1506
+ Object.entries(chars).reduce((acc, [i, c]) => {
1507
+ acc[c] = Number(i);
1508
+ return acc;
1509
+ }, {});
1510
+ alphabetByValue = chars.split("");
1511
+ }));
1512
+ //#endregion
1513
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.browser.js
1514
+ function toBase64(_input) {
1515
+ let input;
1516
+ if (typeof _input === "string") input = fromUtf8(_input);
1517
+ else input = _input;
1518
+ const isArrayLike = typeof input === "object" && typeof input.length === "number";
1519
+ const isUint8Array = typeof input === "object" && typeof input.byteOffset === "number" && typeof input.byteLength === "number";
1520
+ if (!isArrayLike && !isUint8Array) throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
1521
+ let str = "";
1522
+ for (let i = 0; i < input.length; i += 3) {
1523
+ let bits = 0;
1524
+ let bitLength = 0;
1525
+ for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {
1526
+ bits |= input[j] << (limit - j - 1) * 8;
1527
+ bitLength += 8;
1528
+ }
1529
+ const bitClusterCount = Math.ceil(bitLength / 6);
1530
+ bits <<= bitClusterCount * 6 - bitLength;
1531
+ for (let k = 1; k <= bitClusterCount; k++) {
1532
+ const offset = (bitClusterCount - k) * 6;
1533
+ str += alphabetByValue[(bits & 63 << offset) >> offset];
1534
+ }
1535
+ str += "==".slice(0, 4 - bitClusterCount);
1536
+ }
1537
+ return str;
1538
+ }
1539
+ var init_toBase64_browser = __esmMin((() => {
1540
+ init_fromUtf8_browser();
1541
+ init_constants_for_browser();
1542
+ }));
1543
+ //#endregion
1544
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/ChecksumStream.browser.js
1545
+ var ReadableStreamRef, ChecksumStream;
1546
+ var init_ChecksumStream_browser = __esmMin((() => {
1547
+ ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() {};
1548
+ ChecksumStream = class extends ReadableStreamRef {};
1549
+ }));
1550
+ //#endregion
1551
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/createChecksumStream.browser.js
1552
+ var createChecksumStream$1;
1553
+ var init_createChecksumStream_browser = __esmMin((() => {
1554
+ init_toBase64_browser();
1555
+ init_stream_type_check();
1556
+ init_ChecksumStream_browser();
1557
+ createChecksumStream$1 = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => {
1558
+ if (!isReadableStream(source)) throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
1559
+ const encoder = base64Encoder ?? toBase64;
1560
+ if (typeof TransformStream !== "function") throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
1561
+ const transform = new TransformStream({
1562
+ start() {},
1563
+ async transform(chunk, controller) {
1564
+ checksum.update(chunk);
1565
+ controller.enqueue(chunk);
1566
+ },
1567
+ async flush(controller) {
1568
+ const digest = await checksum.digest();
1569
+ const received = encoder(digest);
1570
+ if (expectedChecksum !== received) {
1571
+ const error = /* @__PURE__ */ new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`);
1572
+ controller.error(error);
1573
+ } else controller.terminate();
1574
+ }
1575
+ });
1576
+ source.pipeThrough(transform);
1577
+ const readable = transform.readable;
1578
+ Object.setPrototypeOf(readable, ChecksumStream.prototype);
1579
+ return readable;
1580
+ };
1581
+ }));
1582
+ //#endregion
1583
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/checksum/createChecksumStream.js
1584
+ function createChecksumStream(init) {
1585
+ if (typeof ReadableStream === "function" && isReadableStream(init.source)) return createChecksumStream$1(init);
1586
+ return new ChecksumStream$1(init);
1587
+ }
1588
+ var init_createChecksumStream = __esmMin((() => {
1589
+ init_stream_type_check();
1590
+ init_ChecksumStream();
1591
+ init_createChecksumStream_browser();
1592
+ }));
1593
+ //#endregion
1594
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/ByteArrayCollector.js
1595
+ var ByteArrayCollector;
1596
+ var init_ByteArrayCollector = __esmMin((() => {
1597
+ ByteArrayCollector = class {
1598
+ allocByteArray;
1599
+ byteLength = 0;
1600
+ byteArrays = [];
1601
+ constructor(allocByteArray) {
1602
+ this.allocByteArray = allocByteArray;
1603
+ }
1604
+ push(byteArray) {
1605
+ this.byteArrays.push(byteArray);
1606
+ this.byteLength += byteArray.byteLength;
1607
+ }
1608
+ flush() {
1609
+ if (this.byteArrays.length === 1) {
1610
+ const bytes = this.byteArrays[0];
1611
+ this.reset();
1612
+ return bytes;
1613
+ }
1614
+ const aggregation = this.allocByteArray(this.byteLength);
1615
+ let cursor = 0;
1616
+ for (let i = 0; i < this.byteArrays.length; ++i) {
1617
+ const bytes = this.byteArrays[i];
1618
+ aggregation.set(bytes, cursor);
1619
+ cursor += bytes.byteLength;
1620
+ }
1621
+ this.reset();
1622
+ return aggregation;
1623
+ }
1624
+ reset() {
1625
+ this.byteArrays = [];
1626
+ this.byteLength = 0;
1627
+ }
1628
+ };
1629
+ }));
1630
+ //#endregion
1631
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/createBufferedReadable.browser.js
1632
+ function createBufferedReadableStream(upstream, size, logger) {
1633
+ const reader = upstream.getReader();
1634
+ let streamBufferingLoggedWarning = false;
1635
+ let bytesSeen = 0;
1636
+ const buffers = ["", new ByteArrayCollector((size) => new Uint8Array(size))];
1637
+ let mode = -1;
1638
+ const pull = async (controller) => {
1639
+ const { value, done } = await reader.read();
1640
+ const chunk = value;
1641
+ if (done) {
1642
+ if (mode !== -1) {
1643
+ const remainder = flush(buffers, mode);
1644
+ if (sizeOf(remainder) > 0) controller.enqueue(remainder);
1645
+ }
1646
+ controller.close();
1647
+ } else {
1648
+ const chunkMode = modeOf(chunk, false);
1649
+ if (mode !== chunkMode) {
1650
+ if (mode >= 0) controller.enqueue(flush(buffers, mode));
1651
+ mode = chunkMode;
1652
+ }
1653
+ if (mode === -1) {
1654
+ controller.enqueue(chunk);
1655
+ return;
1656
+ }
1657
+ const chunkSize = sizeOf(chunk);
1658
+ bytesSeen += chunkSize;
1659
+ const bufferSize = sizeOf(buffers[mode]);
1660
+ if (chunkSize >= size && bufferSize === 0) controller.enqueue(chunk);
1661
+ else {
1662
+ const newSize = merge(buffers, mode, chunk);
1663
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
1664
+ streamBufferingLoggedWarning = true;
1665
+ logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
1666
+ }
1667
+ if (newSize >= size) controller.enqueue(flush(buffers, mode));
1668
+ else await pull(controller);
1669
+ }
1670
+ }
1671
+ };
1672
+ return new ReadableStream({ pull });
1673
+ }
1674
+ function merge(buffers, mode, chunk) {
1675
+ switch (mode) {
1676
+ case 0:
1677
+ buffers[0] += chunk;
1678
+ return sizeOf(buffers[0]);
1679
+ case 1:
1680
+ case 2:
1681
+ buffers[mode].push(chunk);
1682
+ return sizeOf(buffers[mode]);
1683
+ }
1684
+ }
1685
+ function flush(buffers, mode) {
1686
+ switch (mode) {
1687
+ case 0:
1688
+ const s = buffers[0];
1689
+ buffers[0] = "";
1690
+ return s;
1691
+ case 1:
1692
+ case 2: return buffers[mode].flush();
1693
+ }
1694
+ throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
1695
+ }
1696
+ function sizeOf(chunk) {
1697
+ return chunk?.byteLength ?? chunk?.length ?? 0;
1698
+ }
1699
+ function modeOf(chunk, allowBuffer = true) {
1700
+ if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) return 2;
1701
+ if (chunk instanceof Uint8Array) return 1;
1702
+ if (typeof chunk === "string") return 0;
1703
+ return -1;
1704
+ }
1705
+ var init_createBufferedReadable_browser = __esmMin((() => {
1706
+ init_ByteArrayCollector();
1707
+ }));
1708
+ //#endregion
1709
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/createBufferedReadable.js
1710
+ function createBufferedReadable(upstream, size, logger) {
1711
+ if (isReadableStream(upstream)) return createBufferedReadableStream(upstream, size, logger);
1712
+ const downstream = new Readable({ read() {} });
1713
+ let streamBufferingLoggedWarning = false;
1714
+ let bytesSeen = 0;
1715
+ const buffers = [
1716
+ "",
1717
+ new ByteArrayCollector((size) => new Uint8Array(size)),
1718
+ new ByteArrayCollector((size) => Buffer.from(new Uint8Array(size)))
1719
+ ];
1720
+ let mode = -1;
1721
+ upstream.on("data", (chunk) => {
1722
+ const chunkMode = modeOf(chunk, true);
1723
+ if (mode !== chunkMode) {
1724
+ if (mode >= 0) downstream.push(flush(buffers, mode));
1725
+ mode = chunkMode;
1726
+ }
1727
+ if (mode === -1) {
1728
+ downstream.push(chunk);
1729
+ return;
1730
+ }
1731
+ const chunkSize = sizeOf(chunk);
1732
+ bytesSeen += chunkSize;
1733
+ const bufferSize = sizeOf(buffers[mode]);
1734
+ if (chunkSize >= size && bufferSize === 0) downstream.push(chunk);
1735
+ else {
1736
+ const newSize = merge(buffers, mode, chunk);
1737
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
1738
+ streamBufferingLoggedWarning = true;
1739
+ logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
1740
+ }
1741
+ if (newSize >= size) downstream.push(flush(buffers, mode));
1742
+ }
1743
+ });
1744
+ upstream.on("end", () => {
1745
+ if (mode !== -1) {
1746
+ const remainder = flush(buffers, mode);
1747
+ if (sizeOf(remainder) > 0) downstream.push(remainder);
1748
+ }
1749
+ downstream.push(null);
1750
+ });
1751
+ return downstream;
1752
+ }
1753
+ var init_createBufferedReadable = __esmMin((() => {
1754
+ init_ByteArrayCollector();
1755
+ init_createBufferedReadable_browser();
1756
+ init_stream_type_check();
1757
+ }));
1758
+ //#endregion
1759
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js
1760
+ var getAwsChunkedEncodingStream$1;
1761
+ var init_getAwsChunkedEncodingStream_browser = __esmMin((() => {
1762
+ getAwsChunkedEncodingStream$1 = (readableStream, options) => {
1763
+ const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
1764
+ const checksumRequired = base64Encoder !== void 0 && bodyLengthChecker !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0;
1765
+ const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0;
1766
+ const reader = readableStream.getReader();
1767
+ return new ReadableStream({ async pull(controller) {
1768
+ const { value, done } = await reader.read();
1769
+ if (done) {
1770
+ controller.enqueue(`0\r\n`);
1771
+ if (checksumRequired) {
1772
+ const checksum = base64Encoder(await digest);
1773
+ controller.enqueue(`${checksumLocationName}:${checksum}\r\n`);
1774
+ controller.enqueue(`\r\n`);
1775
+ }
1776
+ controller.close();
1777
+ } else controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r\n${value}\r\n`);
1778
+ } });
1779
+ };
1780
+ }));
1781
+ //#endregion
1782
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js
1783
+ function getAwsChunkedEncodingStream(stream, options) {
1784
+ const readable = stream;
1785
+ const readableStream = stream;
1786
+ if (isReadableStream(readableStream)) return getAwsChunkedEncodingStream$1(readableStream, options);
1787
+ const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
1788
+ const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0;
1789
+ const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : void 0;
1790
+ const awsChunkedEncodingStream = new Readable({ read: () => {} });
1791
+ readable.on("data", (data) => {
1792
+ const length = bodyLengthChecker(data) || 0;
1793
+ if (length === 0) return;
1794
+ awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`);
1795
+ awsChunkedEncodingStream.push(data);
1796
+ awsChunkedEncodingStream.push("\r\n");
1797
+ });
1798
+ readable.on("end", async () => {
1799
+ awsChunkedEncodingStream.push(`0\r\n`);
1800
+ if (checksumRequired) {
1801
+ const checksum = base64Encoder(await digest);
1802
+ awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`);
1803
+ awsChunkedEncodingStream.push(`\r\n`);
1804
+ }
1805
+ awsChunkedEncodingStream.push(null);
1806
+ });
1807
+ return awsChunkedEncodingStream;
1808
+ }
1809
+ var init_getAwsChunkedEncodingStream = __esmMin((() => {
1810
+ init_getAwsChunkedEncodingStream_browser();
1811
+ init_stream_type_check();
1812
+ }));
1813
+ //#endregion
1814
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.browser.js
1815
+ async function headStream$1(stream, bytes) {
1816
+ let byteLengthCounter = 0;
1817
+ const chunks = [];
1818
+ const reader = stream.getReader();
1819
+ let isDone = false;
1820
+ while (!isDone) {
1821
+ const { done, value } = await reader.read();
1822
+ if (value) {
1823
+ chunks.push(value);
1824
+ byteLengthCounter += value?.byteLength ?? 0;
1825
+ }
1826
+ if (byteLengthCounter >= bytes) break;
1827
+ isDone = done;
1828
+ }
1829
+ reader.releaseLock();
1830
+ const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
1831
+ let offset = 0;
1832
+ for (const chunk of chunks) {
1833
+ if (chunk.byteLength > collected.byteLength - offset) {
1834
+ collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
1835
+ break;
1836
+ } else collected.set(chunk, offset);
1837
+ offset += chunk.length;
1838
+ }
1839
+ return collected;
1840
+ }
1841
+ var init_headStream_browser = __esmMin((() => {}));
1842
+ //#endregion
1843
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/headStream.js
1844
+ var headStream, Collector$1;
1845
+ var init_headStream = __esmMin((() => {
1846
+ init_concatBytes();
1847
+ init_headStream_browser();
1848
+ init_stream_type_check();
1849
+ headStream = (stream, bytes) => {
1850
+ if (isReadableStream(stream)) return headStream$1(stream, bytes);
1851
+ return new Promise((resolve, reject) => {
1852
+ const collector = new Collector$1();
1853
+ collector.limit = bytes;
1854
+ stream.pipe(collector);
1855
+ stream.on("error", (err) => {
1856
+ collector.end();
1857
+ reject(err);
1858
+ });
1859
+ collector.on("error", reject);
1860
+ collector.on("finish", function() {
1861
+ resolve(concatBytes(this.buffers));
1862
+ });
1863
+ });
1864
+ };
1865
+ Collector$1 = class extends Writable {
1866
+ buffers = [];
1867
+ limit = Infinity;
1868
+ bytesBuffered = 0;
1869
+ _write(chunk, encoding, callback) {
1870
+ this.buffers.push(chunk);
1871
+ this.bytesBuffered += chunk.byteLength ?? 0;
1872
+ if (this.bytesBuffered >= this.limit) {
1873
+ const excess = this.bytesBuffered - this.limit;
1874
+ const tailBuffer = this.buffers[this.buffers.length - 1];
1875
+ this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
1876
+ this.emit("finish");
1877
+ }
1878
+ callback();
1879
+ }
1880
+ };
1881
+ }));
1882
+ //#endregion
1883
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.browser.js
1884
+ var toUtf8;
1885
+ var init_toUtf8_browser = __esmMin((() => {
1886
+ toUtf8 = (input) => {
1887
+ if (typeof input === "string") return input;
1888
+ if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
1889
+ return new TextDecoder("utf-8").decode(input);
1890
+ };
1891
+ }));
1892
+ //#endregion
1893
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js
1894
+ async function collectBlob(blob) {
1895
+ return blob.arrayBuffer().then((ab) => new Uint8Array(ab));
1896
+ }
1897
+ async function collectReadableStream(stream) {
1898
+ const chunks = [];
1899
+ const reader = stream.getReader();
1900
+ let length = 0;
1901
+ while (true) {
1902
+ const { done, value } = await reader.read();
1903
+ if (value) {
1904
+ chunks.push(value);
1905
+ length += value.length;
1906
+ }
1907
+ if (done) break;
1908
+ }
1909
+ return concatBytes(chunks, length);
1910
+ }
1911
+ var streamCollector$1;
1912
+ var init_stream_collector_browser = __esmMin((() => {
1913
+ init_concatBytes();
1914
+ init_stream_type_check();
1915
+ streamCollector$1 = async (stream) => {
1916
+ if (isBlob(stream)) return collectBlob(stream);
1917
+ return collectReadableStream(stream);
1918
+ };
1919
+ }));
1920
+ //#endregion
1921
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.browser.js
1922
+ var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1, sdkStreamMixin$1, isBlobInstance;
1923
+ var init_sdk_stream_mixin_browser = __esmMin((() => {
1924
+ init_toBase64_browser();
1925
+ init_hex_encoding();
1926
+ init_toUtf8_browser();
1927
+ init_stream_collector_browser();
1928
+ init_stream_type_check();
1929
+ ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1 = "The stream has already been transformed.";
1930
+ sdkStreamMixin$1 = (stream) => {
1931
+ if (!isBlobInstance(stream) && !isReadableStream(stream)) {
1932
+ const name = stream?.__proto__?.constructor?.name || stream;
1933
+ throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
1934
+ }
1935
+ let transformed = false;
1936
+ const transformToByteArray = async () => {
1937
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
1938
+ transformed = true;
1939
+ return await streamCollector$1(stream);
1940
+ };
1941
+ const blobToWebStream = (blob) => {
1942
+ if (typeof blob.stream !== "function") throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
1943
+ return blob.stream();
1944
+ };
1945
+ return Object.assign(stream, {
1946
+ transformToByteArray,
1947
+ transformToString: async (encoding) => {
1948
+ const buf = await transformToByteArray();
1949
+ if (encoding === "base64") return toBase64(buf);
1950
+ else if (encoding === "hex") return toHex(buf);
1951
+ else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") return toUtf8(buf);
1952
+ else if (typeof TextDecoder === "function") return new TextDecoder(encoding).decode(buf);
1953
+ else throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
1954
+ },
1955
+ transformToWebStream: () => {
1956
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
1957
+ transformed = true;
1958
+ if (isBlobInstance(stream)) return blobToWebStream(stream);
1959
+ else if (isReadableStream(stream)) return stream;
1960
+ else throw new Error(`Cannot transform payload to web stream, got ${stream}`);
1961
+ }
1962
+ });
1963
+ };
1964
+ isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
1965
+ }));
1966
+ //#endregion
1967
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js
1968
+ var streamCollector, Collector;
1969
+ var init_stream_collector = __esmMin((() => {
1970
+ init_concatBytes();
1971
+ init_stream_collector_browser();
1972
+ init_stream_type_check();
1973
+ streamCollector = (stream) => {
1974
+ if (isBlob(stream)) return collectBlob(stream);
1975
+ if (isReadableStream(stream)) return collectReadableStream(stream);
1976
+ return new Promise((resolve, reject) => {
1977
+ const collector = new Collector();
1978
+ const nodeStream = stream;
1979
+ nodeStream.pipe(collector);
1980
+ nodeStream.on("error", (err) => {
1981
+ collector.end();
1982
+ reject(err);
1983
+ });
1984
+ collector.on("error", reject);
1985
+ collector.on("finish", function() {
1986
+ resolve(concatBytes(this.bufferedBytes));
1987
+ });
1988
+ });
1989
+ };
1990
+ Collector = class extends Writable {
1991
+ bufferedBytes = [];
1992
+ _write(chunk, encoding, callback) {
1993
+ this.bufferedBytes.push(chunk);
1994
+ callback();
1995
+ }
1996
+ };
1997
+ }));
1998
+ //#endregion
1999
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.js
2000
+ var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED, sdkStreamMixin;
2001
+ var init_sdk_stream_mixin = __esmMin((() => {
2002
+ init_buffer_from();
2003
+ init_sdk_stream_mixin_browser();
2004
+ init_stream_collector();
2005
+ ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
2006
+ sdkStreamMixin = (stream) => {
2007
+ if (!(stream instanceof Readable)) try {
2008
+ return sdkStreamMixin$1(stream);
2009
+ } catch (ignored) {
2010
+ const name = stream?.__proto__?.constructor?.name || stream;
2011
+ throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
2012
+ }
2013
+ let transformed = false;
2014
+ const transformToByteArray = async () => {
2015
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
2016
+ transformed = true;
2017
+ return await streamCollector(stream);
2018
+ };
2019
+ return Object.assign(stream, {
2020
+ transformToByteArray,
2021
+ transformToString: async (encoding) => {
2022
+ const buf = await transformToByteArray();
2023
+ if (encoding === void 0 || Buffer.isEncoding(encoding)) return fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
2024
+ else return new TextDecoder(encoding).decode(buf);
2025
+ },
2026
+ transformToWebStream: () => {
2027
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
2028
+ if (stream.readableFlowing !== null) throw new Error("The stream has been consumed by other callbacks.");
2029
+ if (typeof Readable.toWeb !== "function") throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
2030
+ transformed = true;
2031
+ return Readable.toWeb(stream);
2032
+ }
2033
+ });
2034
+ };
2035
+ }));
2036
+ //#endregion
2037
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/splitStream.browser.js
2038
+ async function splitStream$1(stream) {
2039
+ if (typeof stream.stream === "function") stream = stream.stream();
2040
+ return stream.tee();
2041
+ }
2042
+ var init_splitStream_browser = __esmMin((() => {}));
2043
+ //#endregion
2044
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/splitStream.js
2045
+ async function splitStream(stream) {
2046
+ if (isReadableStream(stream) || isBlob(stream)) return splitStream$1(stream);
2047
+ const stream1 = new PassThrough();
2048
+ const stream2 = new PassThrough();
2049
+ stream.pipe(stream1);
2050
+ stream.pipe(stream2);
2051
+ return [stream1, stream2];
2052
+ }
2053
+ var init_splitStream = __esmMin((() => {
2054
+ init_splitStream_browser();
2055
+ init_stream_type_check();
2056
+ }));
2057
+ //#endregion
2058
+ //#region ../../node_modules/.pnpm/@smithy+core@3.33.3/node_modules/@smithy/core/dist-es/submodules/serde/index.js
2059
+ var serde_exports = /* @__PURE__ */ __exportAll({
2060
+ ChecksumStream: () => ChecksumStream$1,
2061
+ Hash: () => Hash,
2062
+ LazyJsonString: () => LazyJsonString,
2063
+ NumericValue: () => NumericValue,
2064
+ Uint8ArrayBlobAdapter: () => Uint8ArrayBlobAdapter,
2065
+ _parseEpochTimestamp: () => _parseEpochTimestamp,
2066
+ _parseRfc3339DateTimeWithOffset: () => _parseRfc3339DateTimeWithOffset,
2067
+ _parseRfc7231DateTime: () => _parseRfc7231DateTime,
2068
+ calculateBodyLength: () => calculateBodyLength,
2069
+ concatBytes: () => concatBytes,
2070
+ copyDocumentWithTransform: () => copyDocumentWithTransform,
2071
+ createBufferedReadable: () => createBufferedReadable,
2072
+ createChecksumStream: () => createChecksumStream,
2073
+ dateToUtcString: () => dateToUtcString,
2074
+ deserializerMiddleware: () => deserializerMiddleware,
2075
+ deserializerMiddlewareOption: () => deserializerMiddlewareOption,
2076
+ expectBoolean: () => expectBoolean,
2077
+ expectByte: () => expectByte,
2078
+ expectFloat32: () => expectFloat32,
2079
+ expectInt: () => expectInt,
2080
+ expectInt32: () => expectInt32,
2081
+ expectLong: () => expectLong,
2082
+ expectNonNull: () => expectNonNull,
2083
+ expectNumber: () => expectNumber,
2084
+ expectObject: () => expectObject,
2085
+ expectShort: () => expectShort,
2086
+ expectString: () => expectString,
2087
+ expectUnion: () => expectUnion,
2088
+ fromArrayBuffer: () => fromArrayBuffer,
2089
+ fromBase64: () => fromBase64,
2090
+ fromHex: () => fromHex,
2091
+ fromString: () => fromString,
2092
+ fromUtf8: () => fromUtf8$1,
2093
+ generateIdempotencyToken: () => generateIdempotencyToken,
2094
+ getAwsChunkedEncodingStream: () => getAwsChunkedEncodingStream,
2095
+ getSerdePlugin: () => getSerdePlugin,
2096
+ handleFloat: () => handleFloat,
2097
+ hasOwn: () => hasOwn,
2098
+ headStream: () => headStream,
2099
+ isArrayBuffer: () => isArrayBuffer,
2100
+ isBlob: () => isBlob,
2101
+ isReadableStream: () => isReadableStream,
2102
+ limitedParseDouble: () => limitedParseDouble,
2103
+ limitedParseFloat: () => limitedParseFloat,
2104
+ limitedParseFloat32: () => limitedParseFloat32,
2105
+ logger: () => logger,
2106
+ nv: () => nv,
2107
+ parseBoolean: () => parseBoolean,
2108
+ parseEpochTimestamp: () => parseEpochTimestamp,
2109
+ parseRfc3339DateTime: () => parseRfc3339DateTime,
2110
+ parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset,
2111
+ parseRfc7231DateTime: () => parseRfc7231DateTime,
2112
+ quoteHeader: () => quoteHeader,
2113
+ sdkStreamMixin: () => sdkStreamMixin,
2114
+ serializerMiddleware: () => serializerMiddleware,
2115
+ serializerMiddlewareOption: () => serializerMiddlewareOption,
2116
+ splitEvery: () => splitEvery,
2117
+ splitHeader: () => splitHeader,
2118
+ splitStream: () => splitStream,
2119
+ streamCollector: () => streamCollector,
2120
+ strictParseByte: () => strictParseByte,
2121
+ strictParseDouble: () => strictParseDouble,
2122
+ strictParseFloat: () => strictParseFloat,
2123
+ strictParseFloat32: () => strictParseFloat32,
2124
+ strictParseInt: () => strictParseInt,
2125
+ strictParseInt32: () => strictParseInt32,
2126
+ strictParseLong: () => strictParseLong,
2127
+ strictParseShort: () => strictParseShort,
2128
+ toBase64: () => toBase64$1,
2129
+ toHex: () => toHex,
2130
+ toUint8Array: () => toUint8Array,
2131
+ toUtf8: () => toUtf8$1,
2132
+ v4: () => v4
2133
+ });
2134
+ var Uint8ArrayBlobAdapter, _getRandomValues, v4, generateIdempotencyToken;
2135
+ var init_serde = __esmMin((() => {
2136
+ init_fromBase64();
2137
+ init_toBase64();
2138
+ init_Uint8ArrayBlobAdapter();
2139
+ init_fromUtf8();
2140
+ init_toUtf8();
2141
+ init_v4();
2142
+ init_copyDocumentWithTransform();
2143
+ init_date_utils();
2144
+ init_lazy_json();
2145
+ init_parse_utils();
2146
+ init_quote_header();
2147
+ init_schema_date_utils();
2148
+ init_split_every();
2149
+ init_split_header();
2150
+ init_NumericValue();
2151
+ init_hex_encoding();
2152
+ init_calculateBodyLength();
2153
+ init_toUint8Array();
2154
+ init_concatBytes();
2155
+ init_buffer_from();
2156
+ init_is_array_buffer();
2157
+ init_deserializerMiddleware();
2158
+ init_serdePlugin();
2159
+ init_serializerMiddleware();
2160
+ init_hash_node();
2161
+ init_ChecksumStream();
2162
+ init_createChecksumStream();
2163
+ init_createBufferedReadable();
2164
+ init_getAwsChunkedEncodingStream();
2165
+ init_headStream();
2166
+ init_sdk_stream_mixin();
2167
+ init_splitStream();
2168
+ init_stream_type_check();
2169
+ init_stream_collector();
2170
+ init_transport();
2171
+ Uint8ArrayBlobAdapter = class extends bindUint8ArrayBlobAdapter(toUtf8$1, fromUtf8$1, toBase64$1, fromBase64) {};
2172
+ _getRandomValues = getRandomValues;
2173
+ v4 = bindV4(_getRandomValues);
2174
+ generateIdempotencyToken = v4;
2175
+ }));
2176
+ //#endregion
2177
+ export { toBase64$1 as $, init_lazy_json as A, init_isValidHostname as B, _parseEpochTimestamp as C, init_quote_header as D, init_schema_date_utils as E, parseUrl as F, init_httpRequest as G, HttpResponse as H, init_parseQueryString as I, getSmithyContext as J, hasOwn as K, parseQueryString as L, init_date_utils as M, init_transport as N, quoteHeader as O, init_parseUrl as P, init_toBase64 as Q, init_normalizeProvider as R, splitEvery as S, _parseRfc7231DateTime as T, init_httpResponse as U, isValidHostname as V, HttpRequest as W, init_toUtf8 as X, init_getSmithyContext as Y, toUtf8$1 as Z, NumericValue as _, init_sdk_stream_mixin as a, splitHeader as b, TypeRegistry as c, init_NormalizedSchema as d, fromUtf8$1 as et, init_translateTraits as f, toHex as g, init_hex_encoding as h, serde_exports as i, dateToUtcString as j, LazyJsonString as k, init_TypeRegistry as l, fromHex as m, generateIdempotencyToken as n, fromBase64 as nt, sdkStreamMixin as o, translateTraits as p, init_hasOwn as q, init_serde as r, init_fromBase64 as rt, init_schema as s, Uint8ArrayBlobAdapter as t, init_fromUtf8 as tt, NormalizedSchema as u, init_NumericValue as v, _parseRfc3339DateTimeWithOffset as w, init_split_every as x, init_split_header as y, normalizeProvider as z };
2178
+
2179
+ //# sourceMappingURL=serde-Cq0wappq.js.map