@hot-updater/aws 0.26.0 → 0.26.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,37 +1,12 @@
1
- //#region rolldown:runtime
2
- var __create$1 = Object.create;
3
- var __defProp$2 = Object.defineProperty;
4
- var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames$2 = Object.getOwnPropertyNames;
6
- var __getProtoOf$1 = Object.getPrototypeOf;
7
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
8
- var __commonJS$1 = (cb, mod) => function() {
9
- return mod || (0, cb[__getOwnPropNames$2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
- };
11
- var __copyProps$2 = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$2(from), i = 0, n = keys.length, key; i < n; i++) {
13
- key = keys[i];
14
- if (!__hasOwnProp$2.call(to, key) && key !== except) __defProp$2(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc$2(from, key)) || desc.enumerable
17
- });
18
- }
19
- return to;
20
- };
21
- var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(__getProtoOf$1(mod)) : {}, __copyProps$2(isNodeMode || !mod || !mod.__esModule ? __defProp$2(target, "default", {
22
- value: mod,
23
- enumerable: true
24
- }) : target, mod));
25
-
26
- //#endregion
1
+ const require_dist_cjs$13 = require('./dist-cjs-Mm7FDWb8.cjs');
27
2
  let __aws_sdk_client_ssm = require("@aws-sdk/client-ssm");
28
- __aws_sdk_client_ssm = __toESM$1(__aws_sdk_client_ssm);
3
+ __aws_sdk_client_ssm = require_dist_cjs$13.__toESM(__aws_sdk_client_ssm);
29
4
  let path = require("path");
30
- path = __toESM$1(path);
5
+ path = require_dist_cjs$13.__toESM(path);
31
6
  let node_crypto = require("node:crypto");
32
- node_crypto = __toESM$1(node_crypto);
7
+ node_crypto = require_dist_cjs$13.__toESM(node_crypto);
33
8
  let __aws_sdk_client_s3 = require("@aws-sdk/client-s3");
34
- __aws_sdk_client_s3 = __toESM$1(__aws_sdk_client_s3);
9
+ __aws_sdk_client_s3 = require_dist_cjs$13.__toESM(__aws_sdk_client_s3);
35
10
 
36
11
  //#region ../../packages/core/dist/index.js
37
12
  const HOT_UPDATE_DIR_NAME = ".hot-updater";
@@ -1376,7 +1351,7 @@ var convertHeaders = (headers) => {
1376
1351
  };
1377
1352
  var handle = (app$1) => {
1378
1353
  return async (event, context, callback) => {
1379
- return createResult(await app$1.fetch(createRequest(event), {
1354
+ return createResult(await app$1.fetch(createRequest$1(event), {
1380
1355
  event,
1381
1356
  context,
1382
1357
  callback: (err, result) => {
@@ -1398,7 +1373,7 @@ var createResult = async (res) => {
1398
1373
  ...isBase64Encoded ? { bodyEncoding: "base64" } : {}
1399
1374
  };
1400
1375
  };
1401
- var createRequest = (event) => {
1376
+ var createRequest$1 = (event) => {
1402
1377
  const queryString = event.Records[0].cf.request.querystring;
1403
1378
  const urlPath = `https://${event.Records[0].cf.config.distributionDomainName}${event.Records[0].cf.request.uri}`;
1404
1379
  const url = queryString ? `${urlPath}?${queryString}` : urlPath;
@@ -1434,25 +1409,25 @@ const SHARED_EDGE_CACHE_CONTROL = `public, max-age=0, s-maxage=${ONE_YEAR_IN_SEC
1434
1409
  //#endregion
1435
1410
  //#region ../js/dist/index.js
1436
1411
  var __create = Object.create;
1437
- var __defProp$1 = Object.defineProperty;
1438
- var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
1439
- var __getOwnPropNames$1 = Object.getOwnPropertyNames;
1412
+ var __defProp = Object.defineProperty;
1413
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1414
+ var __getOwnPropNames = Object.getOwnPropertyNames;
1440
1415
  var __getProtoOf = Object.getPrototypeOf;
1441
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
1416
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
1442
1417
  var __commonJS = (cb, mod) => function() {
1443
- return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1418
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
1444
1419
  };
1445
- var __copyProps$1 = (to, from, except, desc) => {
1446
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames$1(from), i = 0, n = keys.length, key; i < n; i++) {
1420
+ var __copyProps = (to, from, except, desc) => {
1421
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
1447
1422
  key = keys[i];
1448
- if (!__hasOwnProp$1.call(to, key) && key !== except) __defProp$1(to, key, {
1423
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
1449
1424
  get: ((k) => from[k]).bind(null, key),
1450
- enumerable: !(desc = __getOwnPropDesc$1(from, key)) || desc.enumerable
1425
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
1451
1426
  });
1452
1427
  }
1453
1428
  return to;
1454
1429
  };
1455
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps$1(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
1430
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
1456
1431
  value: mod,
1457
1432
  enumerable: true
1458
1433
  }) : target, mod));
@@ -2004,20 +1979,20 @@ var require_lrucache = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/se
2004
1979
  var require_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/classes/range.js": ((exports$1, module$1) => {
2005
1980
  const SPACE_CHARACTERS = /\s+/g;
2006
1981
  module$1.exports = class Range$11 {
2007
- constructor(range, options) {
1982
+ constructor(range$1, options) {
2008
1983
  options = parseOptions$1(options);
2009
- if (range instanceof Range$11) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
2010
- else return new Range$11(range.raw, options);
2011
- if (range instanceof Comparator$4) {
2012
- this.raw = range.value;
2013
- this.set = [[range]];
1984
+ if (range$1 instanceof Range$11) if (range$1.loose === !!options.loose && range$1.includePrerelease === !!options.includePrerelease) return range$1;
1985
+ else return new Range$11(range$1.raw, options);
1986
+ if (range$1 instanceof Comparator$4) {
1987
+ this.raw = range$1.value;
1988
+ this.set = [[range$1]];
2014
1989
  this.formatted = void 0;
2015
1990
  return this;
2016
1991
  }
2017
1992
  this.options = options;
2018
1993
  this.loose = !!options.loose;
2019
1994
  this.includePrerelease = !!options.includePrerelease;
2020
- this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
1995
+ this.raw = range$1.trim().replace(SPACE_CHARACTERS, " ");
2021
1996
  this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
2022
1997
  if (!this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
2023
1998
  if (this.set.length > 1) {
@@ -2053,21 +2028,21 @@ var require_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semve
2053
2028
  toString() {
2054
2029
  return this.range;
2055
2030
  }
2056
- parseRange(range) {
2057
- const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
2031
+ parseRange(range$1) {
2032
+ const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range$1;
2058
2033
  const cached = cache$1.get(memoKey);
2059
2034
  if (cached) return cached;
2060
2035
  const loose = this.options.loose;
2061
2036
  const hr = loose ? re$1[t$1.HYPHENRANGELOOSE] : re$1[t$1.HYPHENRANGE];
2062
- range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
2063
- debug$1("hyphen replace", range);
2064
- range = range.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
2065
- debug$1("comparator trim", range);
2066
- range = range.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
2067
- debug$1("tilde trim", range);
2068
- range = range.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
2069
- debug$1("caret trim", range);
2070
- let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
2037
+ range$1 = range$1.replace(hr, hyphenReplace(this.options.includePrerelease));
2038
+ debug$1("hyphen replace", range$1);
2039
+ range$1 = range$1.replace(re$1[t$1.COMPARATORTRIM], comparatorTrimReplace);
2040
+ debug$1("comparator trim", range$1);
2041
+ range$1 = range$1.replace(re$1[t$1.TILDETRIM], tildeTrimReplace);
2042
+ debug$1("tilde trim", range$1);
2043
+ range$1 = range$1.replace(re$1[t$1.CARETTRIM], caretTrimReplace);
2044
+ debug$1("caret trim", range$1);
2045
+ let rangeList = range$1.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
2071
2046
  if (loose) rangeList = rangeList.filter((comp) => {
2072
2047
  debug$1("loose invalid filter", comp, this.options);
2073
2048
  return !!comp.match(re$1[t$1.COMPARATORLOOSE]);
@@ -2084,10 +2059,10 @@ var require_range = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semve
2084
2059
  cache$1.set(memoKey, result);
2085
2060
  return result;
2086
2061
  }
2087
- intersects(range, options) {
2088
- if (!(range instanceof Range$11)) throw new TypeError("a Range is required");
2062
+ intersects(range$1, options) {
2063
+ if (!(range$1 instanceof Range$11)) throw new TypeError("a Range is required");
2089
2064
  return this.set.some((thisComparators) => {
2090
- return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
2065
+ return isSatisfiable(thisComparators, options) && range$1.set.some((rangeComparators) => {
2091
2066
  return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
2092
2067
  return rangeComparators.every((rangeComparator) => {
2093
2068
  return thisComparator.intersects(rangeComparator, options);
@@ -2340,30 +2315,30 @@ var require_comparator = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
2340
2315
  }) });
2341
2316
  var require_satisfies = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/functions/satisfies.js": ((exports$1, module$1) => {
2342
2317
  const Range$9 = require_range();
2343
- const satisfies$4 = (version, range, options) => {
2318
+ const satisfies$4 = (version, range$1, options) => {
2344
2319
  try {
2345
- range = new Range$9(range, options);
2320
+ range$1 = new Range$9(range$1, options);
2346
2321
  } catch (er) {
2347
2322
  return false;
2348
2323
  }
2349
- return range.test(version);
2324
+ return range$1.test(version);
2350
2325
  };
2351
2326
  module$1.exports = satisfies$4;
2352
2327
  }) });
2353
2328
  var require_to_comparators = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/to-comparators.js": ((exports$1, module$1) => {
2354
2329
  const Range$8 = require_range();
2355
- const toComparators$1 = (range, options) => new Range$8(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
2330
+ const toComparators$1 = (range$1, options) => new Range$8(range$1, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
2356
2331
  module$1.exports = toComparators$1;
2357
2332
  }) });
2358
2333
  var require_max_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/max-satisfying.js": ((exports$1, module$1) => {
2359
2334
  const SemVer$4 = require_semver$1();
2360
2335
  const Range$7 = require_range();
2361
- const maxSatisfying$1 = (versions, range, options) => {
2336
+ const maxSatisfying$1 = (versions, range$1, options) => {
2362
2337
  let max = null;
2363
2338
  let maxSV = null;
2364
2339
  let rangeObj = null;
2365
2340
  try {
2366
- rangeObj = new Range$7(range, options);
2341
+ rangeObj = new Range$7(range$1, options);
2367
2342
  } catch (er) {
2368
2343
  return null;
2369
2344
  }
@@ -2382,12 +2357,12 @@ var require_max_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.p
2382
2357
  var require_min_satisfying = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/min-satisfying.js": ((exports$1, module$1) => {
2383
2358
  const SemVer$3 = require_semver$1();
2384
2359
  const Range$6 = require_range();
2385
- const minSatisfying$1 = (versions, range, options) => {
2360
+ const minSatisfying$1 = (versions, range$1, options) => {
2386
2361
  let min = null;
2387
2362
  let minSV = null;
2388
2363
  let rangeObj = null;
2389
2364
  try {
2390
- rangeObj = new Range$6(range, options);
2365
+ rangeObj = new Range$6(range$1, options);
2391
2366
  } catch (er) {
2392
2367
  return null;
2393
2368
  }
@@ -2407,15 +2382,15 @@ var require_min_version = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
2407
2382
  const SemVer$2 = require_semver$1();
2408
2383
  const Range$5 = require_range();
2409
2384
  const gt$2 = require_gt();
2410
- const minVersion$1 = (range, loose) => {
2411
- range = new Range$5(range, loose);
2385
+ const minVersion$1 = (range$1, loose) => {
2386
+ range$1 = new Range$5(range$1, loose);
2412
2387
  let minver = new SemVer$2("0.0.0");
2413
- if (range.test(minver)) return minver;
2388
+ if (range$1.test(minver)) return minver;
2414
2389
  minver = new SemVer$2("0.0.0-0");
2415
- if (range.test(minver)) return minver;
2390
+ if (range$1.test(minver)) return minver;
2416
2391
  minver = null;
2417
- for (let i = 0; i < range.set.length; ++i) {
2418
- const comparators = range.set[i];
2392
+ for (let i = 0; i < range$1.set.length; ++i) {
2393
+ const comparators = range$1.set[i];
2419
2394
  let setMin = null;
2420
2395
  comparators.forEach((comparator) => {
2421
2396
  const compver = new SemVer$2(comparator.semver.version);
@@ -2435,16 +2410,16 @@ var require_min_version = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm
2435
2410
  });
2436
2411
  if (setMin && (!minver || gt$2(minver, setMin))) minver = setMin;
2437
2412
  }
2438
- if (minver && range.test(minver)) return minver;
2413
+ if (minver && range$1.test(minver)) return minver;
2439
2414
  return null;
2440
2415
  };
2441
2416
  module$1.exports = minVersion$1;
2442
2417
  }) });
2443
2418
  var require_valid = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/valid.js": ((exports$1, module$1) => {
2444
2419
  const Range$4 = require_range();
2445
- const validRange$1 = (range, options) => {
2420
+ const validRange$1 = (range$1, options) => {
2446
2421
  try {
2447
- return new Range$4(range, options).range || "*";
2422
+ return new Range$4(range$1, options).range || "*";
2448
2423
  } catch (er) {
2449
2424
  return null;
2450
2425
  }
@@ -2461,9 +2436,9 @@ var require_outside = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/sem
2461
2436
  const lt$1 = require_lt();
2462
2437
  const lte$1 = require_lte();
2463
2438
  const gte$1 = require_gte();
2464
- const outside$3 = (version, range, hilo, options) => {
2439
+ const outside$3 = (version, range$1, hilo, options) => {
2465
2440
  version = new SemVer$1(version, options);
2466
- range = new Range$3(range, options);
2441
+ range$1 = new Range$3(range$1, options);
2467
2442
  let gtfn, ltefn, ltfn, comp, ecomp;
2468
2443
  switch (hilo) {
2469
2444
  case ">":
@@ -2482,9 +2457,9 @@ var require_outside = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/sem
2482
2457
  break;
2483
2458
  default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
2484
2459
  }
2485
- if (satisfies$3(version, range, options)) return false;
2486
- for (let i = 0; i < range.set.length; ++i) {
2487
- const comparators = range.set[i];
2460
+ if (satisfies$3(version, range$1, options)) return false;
2461
+ for (let i = 0; i < range$1.set.length; ++i) {
2462
+ const comparators = range$1.set[i];
2488
2463
  let high = null;
2489
2464
  let low = null;
2490
2465
  comparators.forEach((comparator) => {
@@ -2504,12 +2479,12 @@ var require_outside = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/sem
2504
2479
  }) });
2505
2480
  var require_gtr = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/gtr.js": ((exports$1, module$1) => {
2506
2481
  const outside$2 = require_outside();
2507
- const gtr$1 = (version, range, options) => outside$2(version, range, ">", options);
2482
+ const gtr$1 = (version, range$1, options) => outside$2(version, range$1, ">", options);
2508
2483
  module$1.exports = gtr$1;
2509
2484
  }) });
2510
2485
  var require_ltr = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/ltr.js": ((exports$1, module$1) => {
2511
2486
  const outside$1 = require_outside();
2512
- const ltr$1 = (version, range, options) => outside$1(version, range, "<", options);
2487
+ const ltr$1 = (version, range$1, options) => outside$1(version, range$1, "<", options);
2513
2488
  module$1.exports = ltr$1;
2514
2489
  }) });
2515
2490
  var require_intersects = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/intersects.js": ((exports$1, module$1) => {
@@ -2524,12 +2499,12 @@ var require_intersects = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/
2524
2499
  var require_simplify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/simplify.js": ((exports$1, module$1) => {
2525
2500
  const satisfies$2 = require_satisfies();
2526
2501
  const compare$2 = require_compare();
2527
- module$1.exports = (versions, range, options) => {
2502
+ module$1.exports = (versions, range$1, options) => {
2528
2503
  const set = [];
2529
2504
  let first = null;
2530
2505
  let prev = null;
2531
2506
  const v = versions.sort((a, b) => compare$2(a, b, options));
2532
- for (const version of v) if (satisfies$2(version, range, options)) {
2507
+ for (const version of v) if (satisfies$2(version, range$1, options)) {
2533
2508
  prev = version;
2534
2509
  if (!first) first = version;
2535
2510
  } else {
@@ -2545,8 +2520,8 @@ var require_simplify = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/se
2545
2520
  else if (min === v[0]) ranges.push(`<=${max}`);
2546
2521
  else ranges.push(`${min} - ${max}`);
2547
2522
  const simplified = ranges.join(" || ");
2548
- const original = typeof range.raw === "string" ? range.raw : String(range);
2549
- return simplified.length < original.length ? simplified : range;
2523
+ const original = typeof range$1.raw === "string" ? range$1.raw : String(range$1);
2524
+ return simplified.length < original.length ? simplified : range$1;
2550
2525
  };
2551
2526
  }) });
2552
2527
  var require_subset = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/semver@7.7.2/node_modules/semver/ranges/subset.js": ((exports$1, module$1) => {
@@ -2816,7 +2791,7 @@ const minute = 60;
2816
2791
  const hour = minute * 60;
2817
2792
  const day = hour * 24;
2818
2793
  const week = day * 7;
2819
- const year = day * 365.25;
2794
+ const year$1 = day * 365.25;
2820
2795
 
2821
2796
  //#endregion
2822
2797
  //#region lambda/getUpdateInfo.ts
@@ -2880,107 +2855,3963 @@ const fingerprintStrategy = async ({ readManifestJson }, { platform, fingerprint
2880
2855
  };
2881
2856
 
2882
2857
  //#endregion
2883
- //#region ../../node_modules/.pnpm/@aws-sdk+cloudfront-signer@3.772.0/node_modules/@aws-sdk/cloudfront-signer/dist-cjs/index.js
2884
- var require_dist_cjs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/@aws-sdk+cloudfront-signer@3.772.0/node_modules/@aws-sdk/cloudfront-signer/dist-cjs/index.js": ((exports, module) => {
2885
- var __defProp = Object.defineProperty;
2886
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2887
- var __getOwnPropNames = Object.getOwnPropertyNames;
2888
- var __hasOwnProp = Object.prototype.hasOwnProperty;
2889
- var __name = (target, value) => __defProp(target, "name", {
2890
- value,
2891
- configurable: true
2858
+ //#region ../../node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/fromBase64.js
2859
+ var require_fromBase64 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/fromBase64.js": ((exports) => {
2860
+ Object.defineProperty(exports, "__esModule", { value: true });
2861
+ const util_buffer_from_1$2 = require_dist_cjs$13.require_dist_cjs$1();
2862
+ const BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
2863
+ const fromBase64$2 = (input) => {
2864
+ if (input.length * 3 % 4 !== 0) throw new TypeError(`Incorrect padding on base64 string.`);
2865
+ if (!BASE64_REGEX.exec(input)) throw new TypeError(`Invalid base64 string.`);
2866
+ const buffer = (0, util_buffer_from_1$2.fromString)(input, "base64");
2867
+ return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
2868
+ };
2869
+ exports.fromBase64 = fromBase64$2;
2870
+ }) });
2871
+
2872
+ //#endregion
2873
+ //#region ../../node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/toBase64.js
2874
+ var require_toBase64 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/toBase64.js": ((exports) => {
2875
+ Object.defineProperty(exports, "__esModule", { value: true });
2876
+ const util_buffer_from_1$1 = require_dist_cjs$13.require_dist_cjs$1();
2877
+ const util_utf8_1$1 = require_dist_cjs$13.require_dist_cjs();
2878
+ const toBase64$2 = (_input) => {
2879
+ let input;
2880
+ if (typeof _input === "string") input = (0, util_utf8_1$1.fromUtf8)(_input);
2881
+ else input = _input;
2882
+ 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.");
2883
+ return (0, util_buffer_from_1$1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64");
2884
+ };
2885
+ exports.toBase64 = toBase64$2;
2886
+ }) });
2887
+
2888
+ //#endregion
2889
+ //#region ../../node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/index.js
2890
+ var require_dist_cjs$10 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/index.js": ((exports) => {
2891
+ var fromBase64$1 = require_fromBase64();
2892
+ var toBase64$1 = require_toBase64();
2893
+ Object.prototype.hasOwnProperty.call(fromBase64$1, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
2894
+ enumerable: true,
2895
+ value: fromBase64$1["__proto__"]
2892
2896
  });
2893
- var __export = (target, all) => {
2894
- for (var name in all) __defProp(target, name, {
2895
- get: all[name],
2896
- enumerable: true
2897
+ Object.keys(fromBase64$1).forEach(function(k) {
2898
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = fromBase64$1[k];
2899
+ });
2900
+ Object.prototype.hasOwnProperty.call(toBase64$1, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
2901
+ enumerable: true,
2902
+ value: toBase64$1["__proto__"]
2903
+ });
2904
+ Object.keys(toBase64$1).forEach(function(k) {
2905
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = toBase64$1[k];
2906
+ });
2907
+ }) });
2908
+
2909
+ //#endregion
2910
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js
2911
+ var require_ChecksumStream = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.js": ((exports) => {
2912
+ Object.defineProperty(exports, "__esModule", { value: true });
2913
+ const util_base64_1$2 = require_dist_cjs$10();
2914
+ const stream_1$3 = require("stream");
2915
+ var ChecksumStream$2 = class extends stream_1$3.Duplex {
2916
+ expectedChecksum;
2917
+ checksumSourceLocation;
2918
+ checksum;
2919
+ source;
2920
+ base64Encoder;
2921
+ pendingCallback = null;
2922
+ constructor({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) {
2923
+ super();
2924
+ if (typeof source.pipe === "function") this.source = source;
2925
+ else throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
2926
+ this.base64Encoder = base64Encoder ?? util_base64_1$2.toBase64;
2927
+ this.expectedChecksum = expectedChecksum;
2928
+ this.checksum = checksum;
2929
+ this.checksumSourceLocation = checksumSourceLocation;
2930
+ this.source.pipe(this);
2931
+ }
2932
+ _read(size) {
2933
+ if (this.pendingCallback) {
2934
+ const callback = this.pendingCallback;
2935
+ this.pendingCallback = null;
2936
+ callback();
2937
+ }
2938
+ }
2939
+ _write(chunk, encoding, callback) {
2940
+ try {
2941
+ this.checksum.update(chunk);
2942
+ if (!this.push(chunk)) {
2943
+ this.pendingCallback = callback;
2944
+ return;
2945
+ }
2946
+ } catch (e) {
2947
+ return callback(e);
2948
+ }
2949
+ return callback();
2950
+ }
2951
+ async _final(callback) {
2952
+ try {
2953
+ const digest = await this.checksum.digest();
2954
+ const received = this.base64Encoder(digest);
2955
+ if (this.expectedChecksum !== received) return callback(/* @__PURE__ */ new Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${received}" in response header "${this.checksumSourceLocation}".`));
2956
+ } catch (e) {
2957
+ return callback(e);
2958
+ }
2959
+ this.push(null);
2960
+ return callback();
2961
+ }
2962
+ };
2963
+ exports.ChecksumStream = ChecksumStream$2;
2964
+ }) });
2965
+
2966
+ //#endregion
2967
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js
2968
+ var require_stream_type_check = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/stream-type-check.js": ((exports) => {
2969
+ Object.defineProperty(exports, "__esModule", { value: true });
2970
+ const isReadableStream = (stream$1) => typeof ReadableStream === "function" && (stream$1?.constructor?.name === ReadableStream.name || stream$1 instanceof ReadableStream);
2971
+ exports.isReadableStream = isReadableStream;
2972
+ const isBlob = (blob) => {
2973
+ return typeof Blob === "function" && (blob?.constructor?.name === Blob.name || blob instanceof Blob);
2974
+ };
2975
+ exports.isBlob = isBlob;
2976
+ }) });
2977
+
2978
+ //#endregion
2979
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js
2980
+ var require_ChecksumStream_browser = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/ChecksumStream.browser.js": ((exports) => {
2981
+ Object.defineProperty(exports, "__esModule", { value: true });
2982
+ const ReadableStreamRef = typeof ReadableStream === "function" ? ReadableStream : function() {};
2983
+ var ChecksumStream$1 = class extends ReadableStreamRef {};
2984
+ exports.ChecksumStream = ChecksumStream$1;
2985
+ }) });
2986
+
2987
+ //#endregion
2988
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js
2989
+ var require_createChecksumStream_browser = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.browser.js": ((exports) => {
2990
+ Object.defineProperty(exports, "__esModule", { value: true });
2991
+ const util_base64_1$1 = require_dist_cjs$10();
2992
+ const stream_type_check_1$6 = require_stream_type_check();
2993
+ const ChecksumStream_browser_1 = require_ChecksumStream_browser();
2994
+ const createChecksumStream$2 = ({ expectedChecksum, checksum, source, checksumSourceLocation, base64Encoder }) => {
2995
+ if (!(0, stream_type_check_1$6.isReadableStream)(source)) throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
2996
+ const encoder$1 = base64Encoder ?? util_base64_1$1.toBase64;
2997
+ if (typeof TransformStream !== "function") throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
2998
+ const transform = new TransformStream({
2999
+ start() {},
3000
+ async transform(chunk, controller) {
3001
+ checksum.update(chunk);
3002
+ controller.enqueue(chunk);
3003
+ },
3004
+ async flush(controller) {
3005
+ const received = encoder$1(await checksum.digest());
3006
+ if (expectedChecksum !== received) {
3007
+ const error = /* @__PURE__ */ new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`);
3008
+ controller.error(error);
3009
+ } else controller.terminate();
3010
+ }
2897
3011
  });
3012
+ source.pipeThrough(transform);
3013
+ const readable = transform.readable;
3014
+ Object.setPrototypeOf(readable, ChecksumStream_browser_1.ChecksumStream.prototype);
3015
+ return readable;
2898
3016
  };
2899
- var __copyProps = (to, from, except, desc) => {
2900
- if (from && typeof from === "object" || typeof from === "function") {
2901
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
2902
- get: () => from[key],
2903
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
2904
- });
3017
+ exports.createChecksumStream = createChecksumStream$2;
3018
+ }) });
3019
+
3020
+ //#endregion
3021
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js
3022
+ var require_createChecksumStream = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js": ((exports) => {
3023
+ Object.defineProperty(exports, "__esModule", { value: true });
3024
+ exports.createChecksumStream = createChecksumStream$1;
3025
+ const stream_type_check_1$5 = require_stream_type_check();
3026
+ const ChecksumStream_1 = require_ChecksumStream();
3027
+ const createChecksumStream_browser_1 = require_createChecksumStream_browser();
3028
+ function createChecksumStream$1(init) {
3029
+ if (typeof ReadableStream === "function" && (0, stream_type_check_1$5.isReadableStream)(init.source)) return (0, createChecksumStream_browser_1.createChecksumStream)(init);
3030
+ return new ChecksumStream_1.ChecksumStream(init);
3031
+ }
3032
+ }) });
3033
+
3034
+ //#endregion
3035
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js
3036
+ var require_ByteArrayCollector = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/ByteArrayCollector.js": ((exports) => {
3037
+ Object.defineProperty(exports, "__esModule", { value: true });
3038
+ var ByteArrayCollector = class {
3039
+ allocByteArray;
3040
+ byteLength = 0;
3041
+ byteArrays = [];
3042
+ constructor(allocByteArray) {
3043
+ this.allocByteArray = allocByteArray;
3044
+ }
3045
+ push(byteArray) {
3046
+ this.byteArrays.push(byteArray);
3047
+ this.byteLength += byteArray.byteLength;
3048
+ }
3049
+ flush() {
3050
+ if (this.byteArrays.length === 1) {
3051
+ const bytes = this.byteArrays[0];
3052
+ this.reset();
3053
+ return bytes;
3054
+ }
3055
+ const aggregation = this.allocByteArray(this.byteLength);
3056
+ let cursor = 0;
3057
+ for (let i = 0; i < this.byteArrays.length; ++i) {
3058
+ const bytes = this.byteArrays[i];
3059
+ aggregation.set(bytes, cursor);
3060
+ cursor += bytes.byteLength;
3061
+ }
3062
+ this.reset();
3063
+ return aggregation;
3064
+ }
3065
+ reset() {
3066
+ this.byteArrays = [];
3067
+ this.byteLength = 0;
2905
3068
  }
2906
- return to;
2907
3069
  };
2908
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2909
- var index_exports = {};
2910
- __export(index_exports, {
2911
- getSignedCookies: () => getSignedCookies,
2912
- getSignedUrl: () => getSignedUrl$1
2913
- });
2914
- module.exports = __toCommonJS(index_exports);
2915
- var import_crypto = require("crypto");
2916
- function getSignedUrl$1({ dateLessThan, dateGreaterThan, url, keyPairId, privateKey, ipAddress, policy, passphrase }) {
2917
- const cloudfrontSignBuilder = new CloudfrontSignBuilder({
2918
- keyPairId,
2919
- privateKey,
2920
- passphrase
3070
+ exports.ByteArrayCollector = ByteArrayCollector;
3071
+ }) });
3072
+
3073
+ //#endregion
3074
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js
3075
+ var require_createBufferedReadableStream = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js": ((exports) => {
3076
+ Object.defineProperty(exports, "__esModule", { value: true });
3077
+ exports.createBufferedReadableStream = createBufferedReadableStream;
3078
+ exports.merge = merge;
3079
+ exports.flush = flush;
3080
+ exports.sizeOf = sizeOf;
3081
+ exports.modeOf = modeOf;
3082
+ const ByteArrayCollector_1$1 = require_ByteArrayCollector();
3083
+ function createBufferedReadableStream(upstream, size, logger) {
3084
+ const reader = upstream.getReader();
3085
+ let streamBufferingLoggedWarning = false;
3086
+ let bytesSeen = 0;
3087
+ const buffers = ["", new ByteArrayCollector_1$1.ByteArrayCollector((size$1) => new Uint8Array(size$1))];
3088
+ let mode = -1;
3089
+ const pull = async (controller) => {
3090
+ const { value, done } = await reader.read();
3091
+ const chunk = value;
3092
+ if (done) {
3093
+ if (mode !== -1) {
3094
+ const remainder = flush(buffers, mode);
3095
+ if (sizeOf(remainder) > 0) controller.enqueue(remainder);
3096
+ }
3097
+ controller.close();
3098
+ } else {
3099
+ const chunkMode = modeOf(chunk, false);
3100
+ if (mode !== chunkMode) {
3101
+ if (mode >= 0) controller.enqueue(flush(buffers, mode));
3102
+ mode = chunkMode;
3103
+ }
3104
+ if (mode === -1) {
3105
+ controller.enqueue(chunk);
3106
+ return;
3107
+ }
3108
+ const chunkSize = sizeOf(chunk);
3109
+ bytesSeen += chunkSize;
3110
+ const bufferSize = sizeOf(buffers[mode]);
3111
+ if (chunkSize >= size && bufferSize === 0) controller.enqueue(chunk);
3112
+ else {
3113
+ const newSize = merge(buffers, mode, chunk);
3114
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
3115
+ streamBufferingLoggedWarning = true;
3116
+ logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
3117
+ }
3118
+ if (newSize >= size) controller.enqueue(flush(buffers, mode));
3119
+ else await pull(controller);
3120
+ }
3121
+ }
3122
+ };
3123
+ return new ReadableStream({ pull });
3124
+ }
3125
+ exports.createBufferedReadable = createBufferedReadableStream;
3126
+ function merge(buffers, mode, chunk) {
3127
+ switch (mode) {
3128
+ case 0:
3129
+ buffers[0] += chunk;
3130
+ return sizeOf(buffers[0]);
3131
+ case 1:
3132
+ case 2:
3133
+ buffers[mode].push(chunk);
3134
+ return sizeOf(buffers[mode]);
3135
+ }
3136
+ }
3137
+ function flush(buffers, mode) {
3138
+ switch (mode) {
3139
+ case 0:
3140
+ const s = buffers[0];
3141
+ buffers[0] = "";
3142
+ return s;
3143
+ case 1:
3144
+ case 2: return buffers[mode].flush();
3145
+ }
3146
+ throw new Error(`@smithy/util-stream - invalid index ${mode} given to flush()`);
3147
+ }
3148
+ function sizeOf(chunk) {
3149
+ return chunk?.byteLength ?? chunk?.length ?? 0;
3150
+ }
3151
+ function modeOf(chunk, allowBuffer = true) {
3152
+ if (allowBuffer && typeof Buffer !== "undefined" && chunk instanceof Buffer) return 2;
3153
+ if (chunk instanceof Uint8Array) return 1;
3154
+ if (typeof chunk === "string") return 0;
3155
+ return -1;
3156
+ }
3157
+ }) });
3158
+
3159
+ //#endregion
3160
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js
3161
+ var require_createBufferedReadable = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js": ((exports) => {
3162
+ Object.defineProperty(exports, "__esModule", { value: true });
3163
+ exports.createBufferedReadable = createBufferedReadable$1;
3164
+ const node_stream_1$1 = require("node:stream");
3165
+ const ByteArrayCollector_1 = require_ByteArrayCollector();
3166
+ const createBufferedReadableStream_1 = require_createBufferedReadableStream();
3167
+ const stream_type_check_1$4 = require_stream_type_check();
3168
+ function createBufferedReadable$1(upstream, size, logger) {
3169
+ if ((0, stream_type_check_1$4.isReadableStream)(upstream)) return (0, createBufferedReadableStream_1.createBufferedReadableStream)(upstream, size, logger);
3170
+ const downstream = new node_stream_1$1.Readable({ read() {} });
3171
+ let streamBufferingLoggedWarning = false;
3172
+ let bytesSeen = 0;
3173
+ const buffers = [
3174
+ "",
3175
+ new ByteArrayCollector_1.ByteArrayCollector((size$1) => new Uint8Array(size$1)),
3176
+ new ByteArrayCollector_1.ByteArrayCollector((size$1) => Buffer.from(new Uint8Array(size$1)))
3177
+ ];
3178
+ let mode = -1;
3179
+ upstream.on("data", (chunk) => {
3180
+ const chunkMode = (0, createBufferedReadableStream_1.modeOf)(chunk, true);
3181
+ if (mode !== chunkMode) {
3182
+ if (mode >= 0) downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
3183
+ mode = chunkMode;
3184
+ }
3185
+ if (mode === -1) {
3186
+ downstream.push(chunk);
3187
+ return;
3188
+ }
3189
+ const chunkSize = (0, createBufferedReadableStream_1.sizeOf)(chunk);
3190
+ bytesSeen += chunkSize;
3191
+ const bufferSize = (0, createBufferedReadableStream_1.sizeOf)(buffers[mode]);
3192
+ if (chunkSize >= size && bufferSize === 0) downstream.push(chunk);
3193
+ else {
3194
+ const newSize = (0, createBufferedReadableStream_1.merge)(buffers, mode, chunk);
3195
+ if (!streamBufferingLoggedWarning && bytesSeen > size * 2) {
3196
+ streamBufferingLoggedWarning = true;
3197
+ logger?.warn(`@smithy/util-stream - stream chunk size ${chunkSize} is below threshold of ${size}, automatically buffering.`);
3198
+ }
3199
+ if (newSize >= size) downstream.push((0, createBufferedReadableStream_1.flush)(buffers, mode));
3200
+ }
2921
3201
  });
2922
- if (!url && !policy) throw new Error("@aws-sdk/cloudfront-signer: Please provide 'url' or 'policy'.");
2923
- if (policy) cloudfrontSignBuilder.setCustomPolicy(policy);
2924
- else cloudfrontSignBuilder.setPolicyParameters({
2925
- url,
2926
- dateLessThan,
2927
- dateGreaterThan,
2928
- ipAddress
3202
+ upstream.on("end", () => {
3203
+ if (mode !== -1) {
3204
+ const remainder = (0, createBufferedReadableStream_1.flush)(buffers, mode);
3205
+ if ((0, createBufferedReadableStream_1.sizeOf)(remainder) > 0) downstream.push(remainder);
3206
+ }
3207
+ downstream.push(null);
2929
3208
  });
2930
- let baseUrl;
2931
- if (url) baseUrl = url;
2932
- else if (policy) {
2933
- const resources = getPolicyResources(policy);
2934
- if (!resources[0]) throw new Error("@aws-sdk/cloudfront-signer: No URL provided and unable to determine URL from first policy statement resource.");
2935
- baseUrl = resources[0].replace("*://", "https://");
3209
+ return downstream;
3210
+ }
3211
+ }) });
3212
+
3213
+ //#endregion
3214
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js
3215
+ var require_getAwsChunkedEncodingStream_browser = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.browser.js": ((exports) => {
3216
+ Object.defineProperty(exports, "__esModule", { value: true });
3217
+ const getAwsChunkedEncodingStream$2 = (readableStream, options) => {
3218
+ const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
3219
+ const checksumRequired = base64Encoder !== void 0 && bodyLengthChecker !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0;
3220
+ const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readableStream) : void 0;
3221
+ const reader = readableStream.getReader();
3222
+ return new ReadableStream({ async pull(controller) {
3223
+ const { value, done } = await reader.read();
3224
+ if (done) {
3225
+ controller.enqueue(`0\r\n`);
3226
+ if (checksumRequired) {
3227
+ const checksum = base64Encoder(await digest);
3228
+ controller.enqueue(`${checksumLocationName}:${checksum}\r\n`);
3229
+ controller.enqueue(`\r\n`);
3230
+ }
3231
+ controller.close();
3232
+ } else controller.enqueue(`${(bodyLengthChecker(value) || 0).toString(16)}\r\n${value}\r\n`);
3233
+ } });
3234
+ };
3235
+ exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream$2;
3236
+ }) });
3237
+
3238
+ //#endregion
3239
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js
3240
+ var require_getAwsChunkedEncodingStream = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/getAwsChunkedEncodingStream.js": ((exports) => {
3241
+ Object.defineProperty(exports, "__esModule", { value: true });
3242
+ exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream$1;
3243
+ const node_stream_1 = require("node:stream");
3244
+ const getAwsChunkedEncodingStream_browser_1 = require_getAwsChunkedEncodingStream_browser();
3245
+ const stream_type_check_1$3 = require_stream_type_check();
3246
+ function getAwsChunkedEncodingStream$1(stream$1, options) {
3247
+ const readable = stream$1;
3248
+ const readableStream = stream$1;
3249
+ if ((0, stream_type_check_1$3.isReadableStream)(readableStream)) return (0, getAwsChunkedEncodingStream_browser_1.getAwsChunkedEncodingStream)(readableStream, options);
3250
+ const { base64Encoder, bodyLengthChecker, checksumAlgorithmFn, checksumLocationName, streamHasher } = options;
3251
+ const checksumRequired = base64Encoder !== void 0 && checksumAlgorithmFn !== void 0 && checksumLocationName !== void 0 && streamHasher !== void 0;
3252
+ const digest = checksumRequired ? streamHasher(checksumAlgorithmFn, readable) : void 0;
3253
+ const awsChunkedEncodingStream = new node_stream_1.Readable({ read: () => {} });
3254
+ readable.on("data", (data) => {
3255
+ const length = bodyLengthChecker(data) || 0;
3256
+ if (length === 0) return;
3257
+ awsChunkedEncodingStream.push(`${length.toString(16)}\r\n`);
3258
+ awsChunkedEncodingStream.push(data);
3259
+ awsChunkedEncodingStream.push("\r\n");
3260
+ });
3261
+ readable.on("end", async () => {
3262
+ awsChunkedEncodingStream.push(`0\r\n`);
3263
+ if (checksumRequired) {
3264
+ const checksum = base64Encoder(await digest);
3265
+ awsChunkedEncodingStream.push(`${checksumLocationName}:${checksum}\r\n`);
3266
+ awsChunkedEncodingStream.push(`\r\n`);
3267
+ }
3268
+ awsChunkedEncodingStream.push(null);
3269
+ });
3270
+ return awsChunkedEncodingStream;
3271
+ }
3272
+ }) });
3273
+
3274
+ //#endregion
3275
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js
3276
+ var require_headStream_browser = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js": ((exports) => {
3277
+ Object.defineProperty(exports, "__esModule", { value: true });
3278
+ exports.headStream = headStream$2;
3279
+ async function headStream$2(stream$1, bytes) {
3280
+ let byteLengthCounter = 0;
3281
+ const chunks = [];
3282
+ const reader = stream$1.getReader();
3283
+ let isDone = false;
3284
+ while (!isDone) {
3285
+ const { done, value } = await reader.read();
3286
+ if (value) {
3287
+ chunks.push(value);
3288
+ byteLengthCounter += value?.byteLength ?? 0;
3289
+ }
3290
+ if (byteLengthCounter >= bytes) break;
3291
+ isDone = done;
3292
+ }
3293
+ reader.releaseLock();
3294
+ const collected = new Uint8Array(Math.min(bytes, byteLengthCounter));
3295
+ let offset = 0;
3296
+ for (const chunk of chunks) {
3297
+ if (chunk.byteLength > collected.byteLength - offset) {
3298
+ collected.set(chunk.subarray(0, collected.byteLength - offset), offset);
3299
+ break;
3300
+ } else collected.set(chunk, offset);
3301
+ offset += chunk.length;
2936
3302
  }
2937
- const newURL = new URL(baseUrl);
2938
- newURL.search = Array.from(newURL.searchParams.entries()).concat(Object.entries(cloudfrontSignBuilder.createCloudfrontAttribute())).filter(([, value]) => value !== void 0).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&");
2939
- return getResource(newURL);
3303
+ return collected;
2940
3304
  }
2941
- __name(getSignedUrl$1, "getSignedUrl");
2942
- function getSignedCookies({ ipAddress, url, privateKey, keyPairId, dateLessThan, dateGreaterThan, policy, passphrase }) {
2943
- const cloudfrontSignBuilder = new CloudfrontSignBuilder({
2944
- keyPairId,
2945
- privateKey,
2946
- passphrase
3305
+ }) });
3306
+
3307
+ //#endregion
3308
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/headStream.js
3309
+ var require_headStream = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/headStream.js": ((exports) => {
3310
+ Object.defineProperty(exports, "__esModule", { value: true });
3311
+ const stream_1$2 = require("stream");
3312
+ const headStream_browser_1 = require_headStream_browser();
3313
+ const stream_type_check_1$2 = require_stream_type_check();
3314
+ const headStream$1 = (stream$1, bytes) => {
3315
+ if ((0, stream_type_check_1$2.isReadableStream)(stream$1)) return (0, headStream_browser_1.headStream)(stream$1, bytes);
3316
+ return new Promise((resolve, reject) => {
3317
+ const collector = new Collector$1();
3318
+ collector.limit = bytes;
3319
+ stream$1.pipe(collector);
3320
+ stream$1.on("error", (err) => {
3321
+ collector.end();
3322
+ reject(err);
3323
+ });
3324
+ collector.on("error", reject);
3325
+ collector.on("finish", function() {
3326
+ resolve(new Uint8Array(Buffer.concat(this.buffers)));
3327
+ });
2947
3328
  });
2948
- if (policy) cloudfrontSignBuilder.setCustomPolicy(policy);
2949
- else cloudfrontSignBuilder.setPolicyParameters({
2950
- url,
2951
- dateLessThan,
2952
- dateGreaterThan,
2953
- ipAddress
3329
+ };
3330
+ exports.headStream = headStream$1;
3331
+ var Collector$1 = class extends stream_1$2.Writable {
3332
+ buffers = [];
3333
+ limit = Infinity;
3334
+ bytesBuffered = 0;
3335
+ _write(chunk, encoding, callback) {
3336
+ this.buffers.push(chunk);
3337
+ this.bytesBuffered += chunk.byteLength ?? 0;
3338
+ if (this.bytesBuffered >= this.limit) {
3339
+ const excess = this.bytesBuffered - this.limit;
3340
+ const tailBuffer = this.buffers[this.buffers.length - 1];
3341
+ this.buffers[this.buffers.length - 1] = tailBuffer.subarray(0, tailBuffer.byteLength - excess);
3342
+ this.emit("finish");
3343
+ }
3344
+ callback();
3345
+ }
3346
+ };
3347
+ }) });
3348
+
3349
+ //#endregion
3350
+ //#region ../../node_modules/.pnpm/@smithy+types@4.13.1/node_modules/@smithy/types/dist-cjs/index.js
3351
+ var require_dist_cjs$9 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+types@4.13.1/node_modules/@smithy/types/dist-cjs/index.js": ((exports) => {
3352
+ exports.HttpAuthLocation = void 0;
3353
+ (function(HttpAuthLocation) {
3354
+ HttpAuthLocation["HEADER"] = "header";
3355
+ HttpAuthLocation["QUERY"] = "query";
3356
+ })(exports.HttpAuthLocation || (exports.HttpAuthLocation = {}));
3357
+ exports.HttpApiKeyAuthLocation = void 0;
3358
+ (function(HttpApiKeyAuthLocation) {
3359
+ HttpApiKeyAuthLocation["HEADER"] = "header";
3360
+ HttpApiKeyAuthLocation["QUERY"] = "query";
3361
+ })(exports.HttpApiKeyAuthLocation || (exports.HttpApiKeyAuthLocation = {}));
3362
+ exports.EndpointURLScheme = void 0;
3363
+ (function(EndpointURLScheme) {
3364
+ EndpointURLScheme["HTTP"] = "http";
3365
+ EndpointURLScheme["HTTPS"] = "https";
3366
+ })(exports.EndpointURLScheme || (exports.EndpointURLScheme = {}));
3367
+ exports.AlgorithmId = void 0;
3368
+ (function(AlgorithmId) {
3369
+ AlgorithmId["MD5"] = "md5";
3370
+ AlgorithmId["CRC32"] = "crc32";
3371
+ AlgorithmId["CRC32C"] = "crc32c";
3372
+ AlgorithmId["SHA1"] = "sha1";
3373
+ AlgorithmId["SHA256"] = "sha256";
3374
+ })(exports.AlgorithmId || (exports.AlgorithmId = {}));
3375
+ const getChecksumConfiguration = (runtimeConfig) => {
3376
+ const checksumAlgorithms = [];
3377
+ if (runtimeConfig.sha256 !== void 0) checksumAlgorithms.push({
3378
+ algorithmId: () => exports.AlgorithmId.SHA256,
3379
+ checksumConstructor: () => runtimeConfig.sha256
3380
+ });
3381
+ if (runtimeConfig.md5 != void 0) checksumAlgorithms.push({
3382
+ algorithmId: () => exports.AlgorithmId.MD5,
3383
+ checksumConstructor: () => runtimeConfig.md5
3384
+ });
3385
+ return {
3386
+ addChecksumAlgorithm(algo) {
3387
+ checksumAlgorithms.push(algo);
3388
+ },
3389
+ checksumAlgorithms() {
3390
+ return checksumAlgorithms;
3391
+ }
3392
+ };
3393
+ };
3394
+ const resolveChecksumRuntimeConfig = (clientConfig) => {
3395
+ const runtimeConfig = {};
3396
+ clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
3397
+ runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
2954
3398
  });
2955
- const cloudfrontCookieAttributes = cloudfrontSignBuilder.createCloudfrontAttribute();
2956
- const cookies = {
2957
- "CloudFront-Key-Pair-Id": cloudfrontCookieAttributes["Key-Pair-Id"],
2958
- "CloudFront-Signature": cloudfrontCookieAttributes["Signature"]
3399
+ return runtimeConfig;
3400
+ };
3401
+ const getDefaultClientConfiguration = (runtimeConfig) => {
3402
+ return getChecksumConfiguration(runtimeConfig);
3403
+ };
3404
+ const resolveDefaultRuntimeConfig = (config) => {
3405
+ return resolveChecksumRuntimeConfig(config);
3406
+ };
3407
+ exports.FieldPosition = void 0;
3408
+ (function(FieldPosition) {
3409
+ FieldPosition[FieldPosition["HEADER"] = 0] = "HEADER";
3410
+ FieldPosition[FieldPosition["TRAILER"] = 1] = "TRAILER";
3411
+ })(exports.FieldPosition || (exports.FieldPosition = {}));
3412
+ const SMITHY_CONTEXT_KEY = "__smithy_context";
3413
+ exports.IniSectionType = void 0;
3414
+ (function(IniSectionType) {
3415
+ IniSectionType["PROFILE"] = "profile";
3416
+ IniSectionType["SSO_SESSION"] = "sso-session";
3417
+ IniSectionType["SERVICES"] = "services";
3418
+ })(exports.IniSectionType || (exports.IniSectionType = {}));
3419
+ exports.RequestHandlerProtocol = void 0;
3420
+ (function(RequestHandlerProtocol) {
3421
+ RequestHandlerProtocol["HTTP_0_9"] = "http/0.9";
3422
+ RequestHandlerProtocol["HTTP_1_0"] = "http/1.0";
3423
+ RequestHandlerProtocol["TDS_8_0"] = "tds/8.0";
3424
+ })(exports.RequestHandlerProtocol || (exports.RequestHandlerProtocol = {}));
3425
+ exports.SMITHY_CONTEXT_KEY = SMITHY_CONTEXT_KEY;
3426
+ exports.getDefaultClientConfiguration = getDefaultClientConfiguration;
3427
+ exports.resolveDefaultRuntimeConfig = resolveDefaultRuntimeConfig;
3428
+ }) });
3429
+
3430
+ //#endregion
3431
+ //#region ../../node_modules/.pnpm/@smithy+protocol-http@5.3.12/node_modules/@smithy/protocol-http/dist-cjs/index.js
3432
+ var require_dist_cjs$8 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+protocol-http@5.3.12/node_modules/@smithy/protocol-http/dist-cjs/index.js": ((exports) => {
3433
+ var types = require_dist_cjs$9();
3434
+ const getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
3435
+ return {
3436
+ setHttpHandler(handler$1) {
3437
+ runtimeConfig.httpHandler = handler$1;
3438
+ },
3439
+ httpHandler() {
3440
+ return runtimeConfig.httpHandler;
3441
+ },
3442
+ updateHttpClientConfig(key, value) {
3443
+ runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
3444
+ },
3445
+ httpHandlerConfigs() {
3446
+ return runtimeConfig.httpHandler.httpHandlerConfigs();
3447
+ }
2959
3448
  };
2960
- if (cloudfrontCookieAttributes["Expires"]) cookies["CloudFront-Expires"] = cloudfrontCookieAttributes["Expires"];
2961
- if (cloudfrontCookieAttributes["Policy"]) cookies["CloudFront-Policy"] = cloudfrontCookieAttributes["Policy"];
2962
- return cookies;
3449
+ };
3450
+ const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
3451
+ return { httpHandler: httpHandlerExtensionConfiguration.httpHandler() };
3452
+ };
3453
+ var Field = class {
3454
+ name;
3455
+ kind;
3456
+ values;
3457
+ constructor({ name, kind = types.FieldPosition.HEADER, values = [] }) {
3458
+ this.name = name;
3459
+ this.kind = kind;
3460
+ this.values = values;
3461
+ }
3462
+ add(value) {
3463
+ this.values.push(value);
3464
+ }
3465
+ set(values) {
3466
+ this.values = values;
3467
+ }
3468
+ remove(value) {
3469
+ this.values = this.values.filter((v) => v !== value);
3470
+ }
3471
+ toString() {
3472
+ return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", ");
3473
+ }
3474
+ get() {
3475
+ return this.values;
3476
+ }
3477
+ };
3478
+ var Fields = class {
3479
+ entries = {};
3480
+ encoding;
3481
+ constructor({ fields = [], encoding = "utf-8" }) {
3482
+ fields.forEach(this.setField.bind(this));
3483
+ this.encoding = encoding;
3484
+ }
3485
+ setField(field) {
3486
+ this.entries[field.name.toLowerCase()] = field;
3487
+ }
3488
+ getField(name) {
3489
+ return this.entries[name.toLowerCase()];
3490
+ }
3491
+ removeField(name) {
3492
+ delete this.entries[name.toLowerCase()];
3493
+ }
3494
+ getByType(kind) {
3495
+ return Object.values(this.entries).filter((field) => field.kind === kind);
3496
+ }
3497
+ };
3498
+ var HttpRequest$4 = class HttpRequest$4 {
3499
+ method;
3500
+ protocol;
3501
+ hostname;
3502
+ port;
3503
+ path;
3504
+ query;
3505
+ headers;
3506
+ username;
3507
+ password;
3508
+ fragment;
3509
+ body;
3510
+ constructor(options) {
3511
+ this.method = options.method || "GET";
3512
+ this.hostname = options.hostname || "localhost";
3513
+ this.port = options.port;
3514
+ this.query = options.query || {};
3515
+ this.headers = options.headers || {};
3516
+ this.body = options.body;
3517
+ this.protocol = options.protocol ? options.protocol.slice(-1) !== ":" ? `${options.protocol}:` : options.protocol : "https:";
3518
+ this.path = options.path ? options.path.charAt(0) !== "/" ? `/${options.path}` : options.path : "/";
3519
+ this.username = options.username;
3520
+ this.password = options.password;
3521
+ this.fragment = options.fragment;
3522
+ }
3523
+ static clone(request) {
3524
+ const cloned = new HttpRequest$4({
3525
+ ...request,
3526
+ headers: { ...request.headers }
3527
+ });
3528
+ if (cloned.query) cloned.query = cloneQuery(cloned.query);
3529
+ return cloned;
3530
+ }
3531
+ static isInstance(request) {
3532
+ if (!request) return false;
3533
+ const req = request;
3534
+ return "method" in req && "protocol" in req && "hostname" in req && "path" in req && typeof req["query"] === "object" && typeof req["headers"] === "object";
3535
+ }
3536
+ clone() {
3537
+ return HttpRequest$4.clone(this);
3538
+ }
3539
+ };
3540
+ function cloneQuery(query) {
3541
+ return Object.keys(query).reduce((carry, paramName) => {
3542
+ const param = query[paramName];
3543
+ return {
3544
+ ...carry,
3545
+ [paramName]: Array.isArray(param) ? [...param] : param
3546
+ };
3547
+ }, {});
2963
3548
  }
2964
- __name(getSignedCookies, "getSignedCookies");
2965
- function getPolicyResources(policy) {
2966
- return ((typeof policy === "string" ? JSON.parse(policy) : policy)?.Statement ?? []).map((s) => s.Resource);
3549
+ var HttpResponse$1 = class {
3550
+ statusCode;
3551
+ reason;
3552
+ headers;
3553
+ body;
3554
+ constructor(options) {
3555
+ this.statusCode = options.statusCode;
3556
+ this.reason = options.reason;
3557
+ this.headers = options.headers || {};
3558
+ this.body = options.body;
3559
+ }
3560
+ static isInstance(response) {
3561
+ if (!response) return false;
3562
+ const resp = response;
3563
+ return typeof resp.statusCode === "number" && typeof resp.headers === "object";
3564
+ }
3565
+ };
3566
+ function isValidHostname(hostname) {
3567
+ return /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(hostname);
2967
3568
  }
2968
- __name(getPolicyResources, "getPolicyResources");
2969
- function getResource(url) {
2970
- switch (url.protocol) {
2971
- case "http:":
2972
- case "https:":
2973
- case "ws:":
2974
- case "wss:": return url.toString();
2975
- case "rtmp:": return url.pathname.replace(/^\//, "") + url.search + url.hash;
2976
- default: throw new Error("Invalid URI scheme. Scheme must be one of http, https, or rtmp");
3569
+ exports.Field = Field;
3570
+ exports.Fields = Fields;
3571
+ exports.HttpRequest = HttpRequest$4;
3572
+ exports.HttpResponse = HttpResponse$1;
3573
+ exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration;
3574
+ exports.isValidHostname = isValidHostname;
3575
+ exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig;
3576
+ }) });
3577
+
3578
+ //#endregion
3579
+ //#region ../../node_modules/.pnpm/@smithy+util-uri-escape@4.2.2/node_modules/@smithy/util-uri-escape/dist-cjs/index.js
3580
+ var require_dist_cjs$7 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-uri-escape@4.2.2/node_modules/@smithy/util-uri-escape/dist-cjs/index.js": ((exports) => {
3581
+ const escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
3582
+ const hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
3583
+ const escapeUriPath = (uri) => uri.split("/").map(escapeUri).join("/");
3584
+ exports.escapeUri = escapeUri;
3585
+ exports.escapeUriPath = escapeUriPath;
3586
+ }) });
3587
+
3588
+ //#endregion
3589
+ //#region ../../node_modules/.pnpm/@smithy+querystring-builder@4.2.12/node_modules/@smithy/querystring-builder/dist-cjs/index.js
3590
+ var require_dist_cjs$6 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+querystring-builder@4.2.12/node_modules/@smithy/querystring-builder/dist-cjs/index.js": ((exports) => {
3591
+ var utilUriEscape = require_dist_cjs$7();
3592
+ function buildQueryString(query) {
3593
+ const parts = [];
3594
+ for (let key of Object.keys(query).sort()) {
3595
+ const value = query[key];
3596
+ key = utilUriEscape.escapeUri(key);
3597
+ if (Array.isArray(value)) for (let i = 0, iLen = value.length; i < iLen; i++) parts.push(`${key}=${utilUriEscape.escapeUri(value[i])}`);
3598
+ else {
3599
+ let qsEntry = key;
3600
+ if (value || typeof value === "string") qsEntry += `=${utilUriEscape.escapeUri(value)}`;
3601
+ parts.push(qsEntry);
3602
+ }
2977
3603
  }
3604
+ return parts.join("&");
2978
3605
  }
2979
- __name(getResource, "getResource");
2980
- var CloudfrontSignBuilder = class {
2981
- static {
2982
- __name(this, "CloudfrontSignBuilder");
3606
+ exports.buildQueryString = buildQueryString;
3607
+ }) });
3608
+
3609
+ //#endregion
3610
+ //#region ../../node_modules/.pnpm/@smithy+node-http-handler@4.4.16/node_modules/@smithy/node-http-handler/dist-cjs/index.js
3611
+ var require_dist_cjs$5 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+node-http-handler@4.4.16/node_modules/@smithy/node-http-handler/dist-cjs/index.js": ((exports) => {
3612
+ var protocolHttp$1 = require_dist_cjs$8();
3613
+ var querystringBuilder$1 = require_dist_cjs$6();
3614
+ var http = require("http");
3615
+ var https = require("https");
3616
+ var stream = require("stream");
3617
+ var http2 = require("http2");
3618
+ function buildAbortError$1(abortSignal) {
3619
+ const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0;
3620
+ if (reason) {
3621
+ if (reason instanceof Error) {
3622
+ const abortError$2 = /* @__PURE__ */ new Error("Request aborted");
3623
+ abortError$2.name = "AbortError";
3624
+ abortError$2.cause = reason;
3625
+ return abortError$2;
3626
+ }
3627
+ const abortError$1 = new Error(String(reason));
3628
+ abortError$1.name = "AbortError";
3629
+ return abortError$1;
3630
+ }
3631
+ const abortError = /* @__PURE__ */ new Error("Request aborted");
3632
+ abortError.name = "AbortError";
3633
+ return abortError;
3634
+ }
3635
+ const NODEJS_TIMEOUT_ERROR_CODES = [
3636
+ "ECONNRESET",
3637
+ "EPIPE",
3638
+ "ETIMEDOUT"
3639
+ ];
3640
+ const getTransformedHeaders = (headers) => {
3641
+ const transformedHeaders = {};
3642
+ for (const name of Object.keys(headers)) {
3643
+ const headerValues = headers[name];
3644
+ transformedHeaders[name] = Array.isArray(headerValues) ? headerValues.join(",") : headerValues;
3645
+ }
3646
+ return transformedHeaders;
3647
+ };
3648
+ const timing = {
3649
+ setTimeout: (cb, ms) => setTimeout(cb, ms),
3650
+ clearTimeout: (timeoutId) => clearTimeout(timeoutId)
3651
+ };
3652
+ const DEFER_EVENT_LISTENER_TIME$2 = 1e3;
3653
+ const setConnectionTimeout = (request, reject, timeoutInMs = 0) => {
3654
+ if (!timeoutInMs) return -1;
3655
+ const registerTimeout = (offset) => {
3656
+ const timeoutId = timing.setTimeout(() => {
3657
+ request.destroy();
3658
+ reject(Object.assign(/* @__PURE__ */ new Error(`@smithy/node-http-handler - the request socket did not establish a connection with the server within the configured timeout of ${timeoutInMs} ms.`), { name: "TimeoutError" }));
3659
+ }, timeoutInMs - offset);
3660
+ const doWithSocket = (socket) => {
3661
+ if (socket?.connecting) socket.on("connect", () => {
3662
+ timing.clearTimeout(timeoutId);
3663
+ });
3664
+ else timing.clearTimeout(timeoutId);
3665
+ };
3666
+ if (request.socket) doWithSocket(request.socket);
3667
+ else request.on("socket", doWithSocket);
3668
+ };
3669
+ if (timeoutInMs < 2e3) {
3670
+ registerTimeout(0);
3671
+ return 0;
3672
+ }
3673
+ return timing.setTimeout(registerTimeout.bind(null, DEFER_EVENT_LISTENER_TIME$2), DEFER_EVENT_LISTENER_TIME$2);
3674
+ };
3675
+ const setRequestTimeout = (req, reject, timeoutInMs = 0, throwOnRequestTimeout, logger) => {
3676
+ if (timeoutInMs) return timing.setTimeout(() => {
3677
+ let msg = `@smithy/node-http-handler - [${throwOnRequestTimeout ? "ERROR" : "WARN"}] a request has exceeded the configured ${timeoutInMs} ms requestTimeout.`;
3678
+ if (throwOnRequestTimeout) {
3679
+ const error = Object.assign(new Error(msg), {
3680
+ name: "TimeoutError",
3681
+ code: "ETIMEDOUT"
3682
+ });
3683
+ req.destroy(error);
3684
+ reject(error);
3685
+ } else {
3686
+ msg += ` Init client requestHandler with throwOnRequestTimeout=true to turn this into an error.`;
3687
+ logger?.warn?.(msg);
3688
+ }
3689
+ }, timeoutInMs);
3690
+ return -1;
3691
+ };
3692
+ const DEFER_EVENT_LISTENER_TIME$1 = 3e3;
3693
+ const setSocketKeepAlive = (request, { keepAlive, keepAliveMsecs }, deferTimeMs = DEFER_EVENT_LISTENER_TIME$1) => {
3694
+ if (keepAlive !== true) return -1;
3695
+ const registerListener = () => {
3696
+ if (request.socket) request.socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
3697
+ else request.on("socket", (socket) => {
3698
+ socket.setKeepAlive(keepAlive, keepAliveMsecs || 0);
3699
+ });
3700
+ };
3701
+ if (deferTimeMs === 0) {
3702
+ registerListener();
3703
+ return 0;
3704
+ }
3705
+ return timing.setTimeout(registerListener, deferTimeMs);
3706
+ };
3707
+ const DEFER_EVENT_LISTENER_TIME = 3e3;
3708
+ const setSocketTimeout = (request, reject, timeoutInMs = 0) => {
3709
+ const registerTimeout = (offset) => {
3710
+ const timeout = timeoutInMs - offset;
3711
+ const onTimeout = () => {
3712
+ request.destroy();
3713
+ reject(Object.assign(/* @__PURE__ */ new Error(`@smithy/node-http-handler - the request socket timed out after ${timeoutInMs} ms of inactivity (configured by client requestHandler).`), { name: "TimeoutError" }));
3714
+ };
3715
+ if (request.socket) {
3716
+ request.socket.setTimeout(timeout, onTimeout);
3717
+ request.on("close", () => request.socket?.removeListener("timeout", onTimeout));
3718
+ } else request.setTimeout(timeout, onTimeout);
3719
+ };
3720
+ if (0 < timeoutInMs && timeoutInMs < 6e3) {
3721
+ registerTimeout(0);
3722
+ return 0;
3723
+ }
3724
+ return timing.setTimeout(registerTimeout.bind(null, timeoutInMs === 0 ? 0 : DEFER_EVENT_LISTENER_TIME), DEFER_EVENT_LISTENER_TIME);
3725
+ };
3726
+ const MIN_WAIT_TIME = 6e3;
3727
+ async function writeRequestBody(httpRequest, request, maxContinueTimeoutMs = MIN_WAIT_TIME, externalAgent = false) {
3728
+ const headers = request.headers ?? {};
3729
+ const expect = headers.Expect || headers.expect;
3730
+ let timeoutId = -1;
3731
+ let sendBody = true;
3732
+ if (!externalAgent && expect === "100-continue") sendBody = await Promise.race([new Promise((resolve) => {
3733
+ timeoutId = Number(timing.setTimeout(() => resolve(true), Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));
3734
+ }), new Promise((resolve) => {
3735
+ httpRequest.on("continue", () => {
3736
+ timing.clearTimeout(timeoutId);
3737
+ resolve(true);
3738
+ });
3739
+ httpRequest.on("response", () => {
3740
+ timing.clearTimeout(timeoutId);
3741
+ resolve(false);
3742
+ });
3743
+ httpRequest.on("error", () => {
3744
+ timing.clearTimeout(timeoutId);
3745
+ resolve(false);
3746
+ });
3747
+ })]);
3748
+ if (sendBody) writeBody(httpRequest, request.body);
3749
+ }
3750
+ function writeBody(httpRequest, body) {
3751
+ if (body instanceof stream.Readable) {
3752
+ body.pipe(httpRequest);
3753
+ return;
3754
+ }
3755
+ if (body) {
3756
+ const isBuffer = Buffer.isBuffer(body);
3757
+ if (isBuffer || typeof body === "string") {
3758
+ if (isBuffer && body.byteLength === 0) httpRequest.end();
3759
+ else httpRequest.end(body);
3760
+ return;
3761
+ }
3762
+ const uint8 = body;
3763
+ if (typeof uint8 === "object" && uint8.buffer && typeof uint8.byteOffset === "number" && typeof uint8.byteLength === "number") {
3764
+ httpRequest.end(Buffer.from(uint8.buffer, uint8.byteOffset, uint8.byteLength));
3765
+ return;
3766
+ }
3767
+ httpRequest.end(Buffer.from(body));
3768
+ return;
3769
+ }
3770
+ httpRequest.end();
3771
+ }
3772
+ const DEFAULT_REQUEST_TIMEOUT = 0;
3773
+ var NodeHttpHandler = class NodeHttpHandler {
3774
+ config;
3775
+ configProvider;
3776
+ socketWarningTimestamp = 0;
3777
+ externalAgent = false;
3778
+ metadata = { handlerProtocol: "http/1.1" };
3779
+ static create(instanceOrOptions) {
3780
+ if (typeof instanceOrOptions?.handle === "function") return instanceOrOptions;
3781
+ return new NodeHttpHandler(instanceOrOptions);
2983
3782
  }
3783
+ static checkSocketUsage(agent, socketWarningTimestamp, logger = console) {
3784
+ const { sockets, requests, maxSockets } = agent;
3785
+ if (typeof maxSockets !== "number" || maxSockets === Infinity) return socketWarningTimestamp;
3786
+ if (Date.now() - 15e3 < socketWarningTimestamp) return socketWarningTimestamp;
3787
+ if (sockets && requests) for (const origin in sockets) {
3788
+ const socketsInUse = sockets[origin]?.length ?? 0;
3789
+ const requestsEnqueued = requests[origin]?.length ?? 0;
3790
+ if (socketsInUse >= maxSockets && requestsEnqueued >= 2 * maxSockets) {
3791
+ logger?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${socketsInUse} and ${requestsEnqueued} additional requests are enqueued.
3792
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3793
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`);
3794
+ return Date.now();
3795
+ }
3796
+ }
3797
+ return socketWarningTimestamp;
3798
+ }
3799
+ constructor(options) {
3800
+ this.configProvider = new Promise((resolve, reject) => {
3801
+ if (typeof options === "function") options().then((_options) => {
3802
+ resolve(this.resolveDefaultConfig(_options));
3803
+ }).catch(reject);
3804
+ else resolve(this.resolveDefaultConfig(options));
3805
+ });
3806
+ }
3807
+ resolveDefaultConfig(options) {
3808
+ const { requestTimeout: requestTimeout$1, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger } = options || {};
3809
+ const keepAlive = true;
3810
+ const maxSockets = 50;
3811
+ return {
3812
+ connectionTimeout,
3813
+ requestTimeout: requestTimeout$1,
3814
+ socketTimeout,
3815
+ socketAcquisitionWarningTimeout,
3816
+ throwOnRequestTimeout,
3817
+ httpAgent: (() => {
3818
+ if (httpAgent instanceof http.Agent || typeof httpAgent?.destroy === "function") {
3819
+ this.externalAgent = true;
3820
+ return httpAgent;
3821
+ }
3822
+ return new http.Agent({
3823
+ keepAlive,
3824
+ maxSockets,
3825
+ ...httpAgent
3826
+ });
3827
+ })(),
3828
+ httpsAgent: (() => {
3829
+ if (httpsAgent instanceof https.Agent || typeof httpsAgent?.destroy === "function") {
3830
+ this.externalAgent = true;
3831
+ return httpsAgent;
3832
+ }
3833
+ return new https.Agent({
3834
+ keepAlive,
3835
+ maxSockets,
3836
+ ...httpsAgent
3837
+ });
3838
+ })(),
3839
+ logger
3840
+ };
3841
+ }
3842
+ destroy() {
3843
+ this.config?.httpAgent?.destroy();
3844
+ this.config?.httpsAgent?.destroy();
3845
+ }
3846
+ async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) {
3847
+ if (!this.config) this.config = await this.configProvider;
3848
+ return new Promise((_resolve, _reject) => {
3849
+ const config = this.config;
3850
+ let writeRequestBodyPromise = void 0;
3851
+ const timeouts = [];
3852
+ const resolve = async (arg) => {
3853
+ await writeRequestBodyPromise;
3854
+ timeouts.forEach(timing.clearTimeout);
3855
+ _resolve(arg);
3856
+ };
3857
+ const reject = async (arg) => {
3858
+ await writeRequestBodyPromise;
3859
+ timeouts.forEach(timing.clearTimeout);
3860
+ _reject(arg);
3861
+ };
3862
+ if (abortSignal?.aborted) {
3863
+ reject(buildAbortError$1(abortSignal));
3864
+ return;
3865
+ }
3866
+ const isSSL = request.protocol === "https:";
3867
+ const headers = request.headers ?? {};
3868
+ const expectContinue = (headers.Expect ?? headers.expect) === "100-continue";
3869
+ let agent = isSSL ? config.httpsAgent : config.httpAgent;
3870
+ if (expectContinue && !this.externalAgent) agent = new (isSSL ? https.Agent : http.Agent)({
3871
+ keepAlive: false,
3872
+ maxSockets: Infinity
3873
+ });
3874
+ timeouts.push(timing.setTimeout(() => {
3875
+ this.socketWarningTimestamp = NodeHttpHandler.checkSocketUsage(agent, this.socketWarningTimestamp, config.logger);
3876
+ }, config.socketAcquisitionWarningTimeout ?? (config.requestTimeout ?? 2e3) + (config.connectionTimeout ?? 1e3)));
3877
+ const queryString = querystringBuilder$1.buildQueryString(request.query || {});
3878
+ let auth = void 0;
3879
+ if (request.username != null || request.password != null) auth = `${request.username ?? ""}:${request.password ?? ""}`;
3880
+ let path$2 = request.path;
3881
+ if (queryString) path$2 += `?${queryString}`;
3882
+ if (request.fragment) path$2 += `#${request.fragment}`;
3883
+ let hostname = request.hostname ?? "";
3884
+ if (hostname[0] === "[" && hostname.endsWith("]")) hostname = request.hostname.slice(1, -1);
3885
+ else hostname = request.hostname;
3886
+ const nodeHttpsOptions = {
3887
+ headers: request.headers,
3888
+ host: hostname,
3889
+ method: request.method,
3890
+ path: path$2,
3891
+ port: request.port,
3892
+ agent,
3893
+ auth
3894
+ };
3895
+ const req = (isSSL ? https.request : http.request)(nodeHttpsOptions, (res) => {
3896
+ resolve({ response: new protocolHttp$1.HttpResponse({
3897
+ statusCode: res.statusCode || -1,
3898
+ reason: res.statusMessage,
3899
+ headers: getTransformedHeaders(res.headers),
3900
+ body: res
3901
+ }) });
3902
+ });
3903
+ req.on("error", (err) => {
3904
+ if (NODEJS_TIMEOUT_ERROR_CODES.includes(err.code)) reject(Object.assign(err, { name: "TimeoutError" }));
3905
+ else reject(err);
3906
+ });
3907
+ if (abortSignal) {
3908
+ const onAbort = () => {
3909
+ req.destroy();
3910
+ reject(buildAbortError$1(abortSignal));
3911
+ };
3912
+ if (typeof abortSignal.addEventListener === "function") {
3913
+ const signal = abortSignal;
3914
+ signal.addEventListener("abort", onAbort, { once: true });
3915
+ req.once("close", () => signal.removeEventListener("abort", onAbort));
3916
+ } else abortSignal.onabort = onAbort;
3917
+ }
3918
+ const effectiveRequestTimeout = requestTimeout$1 ?? config.requestTimeout;
3919
+ timeouts.push(setConnectionTimeout(req, reject, config.connectionTimeout));
3920
+ timeouts.push(setRequestTimeout(req, reject, effectiveRequestTimeout, config.throwOnRequestTimeout, config.logger ?? console));
3921
+ timeouts.push(setSocketTimeout(req, reject, config.socketTimeout));
3922
+ const httpAgent = nodeHttpsOptions.agent;
3923
+ if (typeof httpAgent === "object" && "keepAlive" in httpAgent) timeouts.push(setSocketKeepAlive(req, {
3924
+ keepAlive: httpAgent.keepAlive,
3925
+ keepAliveMsecs: httpAgent.keepAliveMsecs
3926
+ }));
3927
+ writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout, this.externalAgent).catch((e) => {
3928
+ timeouts.forEach(timing.clearTimeout);
3929
+ return _reject(e);
3930
+ });
3931
+ });
3932
+ }
3933
+ updateHttpClientConfig(key, value) {
3934
+ this.config = void 0;
3935
+ this.configProvider = this.configProvider.then((config) => {
3936
+ return {
3937
+ ...config,
3938
+ [key]: value
3939
+ };
3940
+ });
3941
+ }
3942
+ httpHandlerConfigs() {
3943
+ return this.config ?? {};
3944
+ }
3945
+ };
3946
+ var NodeHttp2ConnectionPool = class {
3947
+ sessions = [];
3948
+ constructor(sessions) {
3949
+ this.sessions = sessions ?? [];
3950
+ }
3951
+ poll() {
3952
+ if (this.sessions.length > 0) return this.sessions.shift();
3953
+ }
3954
+ offerLast(session) {
3955
+ this.sessions.push(session);
3956
+ }
3957
+ contains(session) {
3958
+ return this.sessions.includes(session);
3959
+ }
3960
+ remove(session) {
3961
+ this.sessions = this.sessions.filter((s) => s !== session);
3962
+ }
3963
+ [Symbol.iterator]() {
3964
+ return this.sessions[Symbol.iterator]();
3965
+ }
3966
+ destroy(connection) {
3967
+ for (const session of this.sessions) if (session === connection) {
3968
+ if (!session.destroyed) session.destroy();
3969
+ }
3970
+ }
3971
+ };
3972
+ var NodeHttp2ConnectionManager = class {
3973
+ constructor(config) {
3974
+ this.config = config;
3975
+ if (this.config.maxConcurrency && this.config.maxConcurrency <= 0) throw new RangeError("maxConcurrency must be greater than zero.");
3976
+ }
3977
+ config;
3978
+ sessionCache = /* @__PURE__ */ new Map();
3979
+ lease(requestContext, connectionConfiguration) {
3980
+ const url = this.getUrlString(requestContext);
3981
+ const existingPool = this.sessionCache.get(url);
3982
+ if (existingPool) {
3983
+ const existingSession = existingPool.poll();
3984
+ if (existingSession && !this.config.disableConcurrency) return existingSession;
3985
+ }
3986
+ const session = http2.connect(url);
3987
+ if (this.config.maxConcurrency) session.settings({ maxConcurrentStreams: this.config.maxConcurrency }, (err) => {
3988
+ if (err) throw new Error("Fail to set maxConcurrentStreams to " + this.config.maxConcurrency + "when creating new session for " + requestContext.destination.toString());
3989
+ });
3990
+ session.unref();
3991
+ const destroySessionCb = () => {
3992
+ session.destroy();
3993
+ this.deleteSession(url, session);
3994
+ };
3995
+ session.on("goaway", destroySessionCb);
3996
+ session.on("error", destroySessionCb);
3997
+ session.on("frameError", destroySessionCb);
3998
+ session.on("close", () => this.deleteSession(url, session));
3999
+ if (connectionConfiguration.requestTimeout) session.setTimeout(connectionConfiguration.requestTimeout, destroySessionCb);
4000
+ const connectionPool = this.sessionCache.get(url) || new NodeHttp2ConnectionPool();
4001
+ connectionPool.offerLast(session);
4002
+ this.sessionCache.set(url, connectionPool);
4003
+ return session;
4004
+ }
4005
+ deleteSession(authority, session) {
4006
+ const existingConnectionPool = this.sessionCache.get(authority);
4007
+ if (!existingConnectionPool) return;
4008
+ if (!existingConnectionPool.contains(session)) return;
4009
+ existingConnectionPool.remove(session);
4010
+ this.sessionCache.set(authority, existingConnectionPool);
4011
+ }
4012
+ release(requestContext, session) {
4013
+ const cacheKey = this.getUrlString(requestContext);
4014
+ this.sessionCache.get(cacheKey)?.offerLast(session);
4015
+ }
4016
+ destroy() {
4017
+ for (const [key, connectionPool] of this.sessionCache) {
4018
+ for (const session of connectionPool) {
4019
+ if (!session.destroyed) session.destroy();
4020
+ connectionPool.remove(session);
4021
+ }
4022
+ this.sessionCache.delete(key);
4023
+ }
4024
+ }
4025
+ setMaxConcurrentStreams(maxConcurrentStreams) {
4026
+ if (maxConcurrentStreams && maxConcurrentStreams <= 0) throw new RangeError("maxConcurrentStreams must be greater than zero.");
4027
+ this.config.maxConcurrency = maxConcurrentStreams;
4028
+ }
4029
+ setDisableConcurrentStreams(disableConcurrentStreams) {
4030
+ this.config.disableConcurrency = disableConcurrentStreams;
4031
+ }
4032
+ getUrlString(request) {
4033
+ return request.destination.toString();
4034
+ }
4035
+ };
4036
+ var NodeHttp2Handler = class NodeHttp2Handler {
4037
+ config;
4038
+ configProvider;
4039
+ metadata = { handlerProtocol: "h2" };
4040
+ connectionManager = new NodeHttp2ConnectionManager({});
4041
+ static create(instanceOrOptions) {
4042
+ if (typeof instanceOrOptions?.handle === "function") return instanceOrOptions;
4043
+ return new NodeHttp2Handler(instanceOrOptions);
4044
+ }
4045
+ constructor(options) {
4046
+ this.configProvider = new Promise((resolve, reject) => {
4047
+ if (typeof options === "function") options().then((opts) => {
4048
+ resolve(opts || {});
4049
+ }).catch(reject);
4050
+ else resolve(options || {});
4051
+ });
4052
+ }
4053
+ destroy() {
4054
+ this.connectionManager.destroy();
4055
+ }
4056
+ async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) {
4057
+ if (!this.config) {
4058
+ this.config = await this.configProvider;
4059
+ this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);
4060
+ if (this.config.maxConcurrentStreams) this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);
4061
+ }
4062
+ const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
4063
+ const effectiveRequestTimeout = requestTimeout$1 ?? configRequestTimeout;
4064
+ return new Promise((_resolve, _reject) => {
4065
+ let fulfilled = false;
4066
+ let writeRequestBodyPromise = void 0;
4067
+ const resolve = async (arg) => {
4068
+ await writeRequestBodyPromise;
4069
+ _resolve(arg);
4070
+ };
4071
+ const reject = async (arg) => {
4072
+ await writeRequestBodyPromise;
4073
+ _reject(arg);
4074
+ };
4075
+ if (abortSignal?.aborted) {
4076
+ fulfilled = true;
4077
+ reject(buildAbortError$1(abortSignal));
4078
+ return;
4079
+ }
4080
+ const { hostname, method, port, protocol, query } = request;
4081
+ let auth = "";
4082
+ if (request.username != null || request.password != null) auth = `${request.username ?? ""}:${request.password ?? ""}@`;
4083
+ const authority = `${protocol}//${auth}${hostname}${port ? `:${port}` : ""}`;
4084
+ const requestContext = { destination: new URL(authority) };
4085
+ const session = this.connectionManager.lease(requestContext, {
4086
+ requestTimeout: this.config?.sessionTimeout,
4087
+ disableConcurrentStreams: disableConcurrentStreams || false
4088
+ });
4089
+ const rejectWithDestroy = (err) => {
4090
+ if (disableConcurrentStreams) this.destroySession(session);
4091
+ fulfilled = true;
4092
+ reject(err);
4093
+ };
4094
+ const queryString = querystringBuilder$1.buildQueryString(query || {});
4095
+ let path$2 = request.path;
4096
+ if (queryString) path$2 += `?${queryString}`;
4097
+ if (request.fragment) path$2 += `#${request.fragment}`;
4098
+ const req = session.request({
4099
+ ...request.headers,
4100
+ [http2.constants.HTTP2_HEADER_PATH]: path$2,
4101
+ [http2.constants.HTTP2_HEADER_METHOD]: method
4102
+ });
4103
+ session.ref();
4104
+ req.on("response", (headers) => {
4105
+ const httpResponse = new protocolHttp$1.HttpResponse({
4106
+ statusCode: headers[":status"] || -1,
4107
+ headers: getTransformedHeaders(headers),
4108
+ body: req
4109
+ });
4110
+ fulfilled = true;
4111
+ resolve({ response: httpResponse });
4112
+ if (disableConcurrentStreams) {
4113
+ session.close();
4114
+ this.connectionManager.deleteSession(authority, session);
4115
+ }
4116
+ });
4117
+ if (effectiveRequestTimeout) req.setTimeout(effectiveRequestTimeout, () => {
4118
+ req.close();
4119
+ const timeoutError = /* @__PURE__ */ new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`);
4120
+ timeoutError.name = "TimeoutError";
4121
+ rejectWithDestroy(timeoutError);
4122
+ });
4123
+ if (abortSignal) {
4124
+ const onAbort = () => {
4125
+ req.close();
4126
+ rejectWithDestroy(buildAbortError$1(abortSignal));
4127
+ };
4128
+ if (typeof abortSignal.addEventListener === "function") {
4129
+ const signal = abortSignal;
4130
+ signal.addEventListener("abort", onAbort, { once: true });
4131
+ req.once("close", () => signal.removeEventListener("abort", onAbort));
4132
+ } else abortSignal.onabort = onAbort;
4133
+ }
4134
+ req.on("frameError", (type, code, id) => {
4135
+ rejectWithDestroy(/* @__PURE__ */ new Error(`Frame type id ${type} in stream id ${id} has failed with code ${code}.`));
4136
+ });
4137
+ req.on("error", rejectWithDestroy);
4138
+ req.on("aborted", () => {
4139
+ rejectWithDestroy(/* @__PURE__ */ new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${req.rstCode}.`));
4140
+ });
4141
+ req.on("close", () => {
4142
+ session.unref();
4143
+ if (disableConcurrentStreams) session.destroy();
4144
+ if (!fulfilled) rejectWithDestroy(/* @__PURE__ */ new Error("Unexpected error: http2 request did not get a response"));
4145
+ });
4146
+ writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout);
4147
+ });
4148
+ }
4149
+ updateHttpClientConfig(key, value) {
4150
+ this.config = void 0;
4151
+ this.configProvider = this.configProvider.then((config) => {
4152
+ return {
4153
+ ...config,
4154
+ [key]: value
4155
+ };
4156
+ });
4157
+ }
4158
+ httpHandlerConfigs() {
4159
+ return this.config ?? {};
4160
+ }
4161
+ destroySession(session) {
4162
+ if (!session.destroyed) session.destroy();
4163
+ }
4164
+ };
4165
+ var Collector = class extends stream.Writable {
4166
+ bufferedBytes = [];
4167
+ _write(chunk, encoding, callback) {
4168
+ this.bufferedBytes.push(chunk);
4169
+ callback();
4170
+ }
4171
+ };
4172
+ const streamCollector$1 = (stream$1) => {
4173
+ if (isReadableStreamInstance(stream$1)) return collectReadableStream(stream$1);
4174
+ return new Promise((resolve, reject) => {
4175
+ const collector = new Collector();
4176
+ stream$1.pipe(collector);
4177
+ stream$1.on("error", (err) => {
4178
+ collector.end();
4179
+ reject(err);
4180
+ });
4181
+ collector.on("error", reject);
4182
+ collector.on("finish", function() {
4183
+ resolve(new Uint8Array(Buffer.concat(this.bufferedBytes)));
4184
+ });
4185
+ });
4186
+ };
4187
+ const isReadableStreamInstance = (stream$1) => typeof ReadableStream === "function" && stream$1 instanceof ReadableStream;
4188
+ async function collectReadableStream(stream$1) {
4189
+ const chunks = [];
4190
+ const reader = stream$1.getReader();
4191
+ let isDone = false;
4192
+ let length = 0;
4193
+ while (!isDone) {
4194
+ const { done, value } = await reader.read();
4195
+ if (value) {
4196
+ chunks.push(value);
4197
+ length += value.length;
4198
+ }
4199
+ isDone = done;
4200
+ }
4201
+ const collected = new Uint8Array(length);
4202
+ let offset = 0;
4203
+ for (const chunk of chunks) {
4204
+ collected.set(chunk, offset);
4205
+ offset += chunk.length;
4206
+ }
4207
+ return collected;
4208
+ }
4209
+ exports.DEFAULT_REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT;
4210
+ exports.NodeHttp2Handler = NodeHttp2Handler;
4211
+ exports.NodeHttpHandler = NodeHttpHandler;
4212
+ exports.streamCollector = streamCollector$1;
4213
+ }) });
4214
+
4215
+ //#endregion
4216
+ //#region ../../node_modules/.pnpm/@smithy+fetch-http-handler@5.3.15/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js
4217
+ var require_dist_cjs$4 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+fetch-http-handler@5.3.15/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js": ((exports) => {
4218
+ var protocolHttp = require_dist_cjs$8();
4219
+ var querystringBuilder = require_dist_cjs$6();
4220
+ var utilBase64$1 = require_dist_cjs$10();
4221
+ function createRequest(url, requestOptions) {
4222
+ return new Request(url, requestOptions);
4223
+ }
4224
+ function requestTimeout(timeoutInMs = 0) {
4225
+ return new Promise((resolve, reject) => {
4226
+ if (timeoutInMs) setTimeout(() => {
4227
+ const timeoutError = /* @__PURE__ */ new Error(`Request did not complete within ${timeoutInMs} ms`);
4228
+ timeoutError.name = "TimeoutError";
4229
+ reject(timeoutError);
4230
+ }, timeoutInMs);
4231
+ });
4232
+ }
4233
+ const keepAliveSupport = { supported: void 0 };
4234
+ var FetchHttpHandler = class FetchHttpHandler {
4235
+ config;
4236
+ configProvider;
4237
+ static create(instanceOrOptions) {
4238
+ if (typeof instanceOrOptions?.handle === "function") return instanceOrOptions;
4239
+ return new FetchHttpHandler(instanceOrOptions);
4240
+ }
4241
+ constructor(options) {
4242
+ if (typeof options === "function") this.configProvider = options().then((opts) => opts || {});
4243
+ else {
4244
+ this.config = options ?? {};
4245
+ this.configProvider = Promise.resolve(this.config);
4246
+ }
4247
+ if (keepAliveSupport.supported === void 0) keepAliveSupport.supported = Boolean(typeof Request !== "undefined" && "keepalive" in createRequest("https://[::1]"));
4248
+ }
4249
+ destroy() {}
4250
+ async handle(request, { abortSignal, requestTimeout: requestTimeout$1 } = {}) {
4251
+ if (!this.config) this.config = await this.configProvider;
4252
+ const requestTimeoutInMs = requestTimeout$1 ?? this.config.requestTimeout;
4253
+ const keepAlive = this.config.keepAlive === true;
4254
+ const credentials = this.config.credentials;
4255
+ if (abortSignal?.aborted) {
4256
+ const abortError = buildAbortError(abortSignal);
4257
+ return Promise.reject(abortError);
4258
+ }
4259
+ let path$2 = request.path;
4260
+ const queryString = querystringBuilder.buildQueryString(request.query || {});
4261
+ if (queryString) path$2 += `?${queryString}`;
4262
+ if (request.fragment) path$2 += `#${request.fragment}`;
4263
+ let auth = "";
4264
+ if (request.username != null || request.password != null) auth = `${request.username ?? ""}:${request.password ?? ""}@`;
4265
+ const { port, method } = request;
4266
+ const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path$2}`;
4267
+ const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
4268
+ const requestOptions = {
4269
+ body,
4270
+ headers: new Headers(request.headers),
4271
+ method,
4272
+ credentials
4273
+ };
4274
+ if (this.config?.cache) requestOptions.cache = this.config.cache;
4275
+ if (body) requestOptions.duplex = "half";
4276
+ if (typeof AbortController !== "undefined") requestOptions.signal = abortSignal;
4277
+ if (keepAliveSupport.supported) requestOptions.keepalive = keepAlive;
4278
+ if (typeof this.config.requestInit === "function") Object.assign(requestOptions, this.config.requestInit(request));
4279
+ let removeSignalEventListener = () => {};
4280
+ const fetchRequest = createRequest(url, requestOptions);
4281
+ const raceOfPromises = [fetch(fetchRequest).then((response) => {
4282
+ const fetchHeaders = response.headers;
4283
+ const transformedHeaders = {};
4284
+ for (const pair of fetchHeaders.entries()) transformedHeaders[pair[0]] = pair[1];
4285
+ if (!(response.body != void 0)) return response.blob().then((body$1) => ({ response: new protocolHttp.HttpResponse({
4286
+ headers: transformedHeaders,
4287
+ reason: response.statusText,
4288
+ statusCode: response.status,
4289
+ body: body$1
4290
+ }) }));
4291
+ return { response: new protocolHttp.HttpResponse({
4292
+ headers: transformedHeaders,
4293
+ reason: response.statusText,
4294
+ statusCode: response.status,
4295
+ body: response.body
4296
+ }) };
4297
+ }), requestTimeout(requestTimeoutInMs)];
4298
+ if (abortSignal) raceOfPromises.push(new Promise((resolve, reject) => {
4299
+ const onAbort = () => {
4300
+ reject(buildAbortError(abortSignal));
4301
+ };
4302
+ if (typeof abortSignal.addEventListener === "function") {
4303
+ const signal = abortSignal;
4304
+ signal.addEventListener("abort", onAbort, { once: true });
4305
+ removeSignalEventListener = () => signal.removeEventListener("abort", onAbort);
4306
+ } else abortSignal.onabort = onAbort;
4307
+ }));
4308
+ return Promise.race(raceOfPromises).finally(removeSignalEventListener);
4309
+ }
4310
+ updateHttpClientConfig(key, value) {
4311
+ this.config = void 0;
4312
+ this.configProvider = this.configProvider.then((config) => {
4313
+ config[key] = value;
4314
+ return config;
4315
+ });
4316
+ }
4317
+ httpHandlerConfigs() {
4318
+ return this.config ?? {};
4319
+ }
4320
+ };
4321
+ function buildAbortError(abortSignal) {
4322
+ const reason = abortSignal && typeof abortSignal === "object" && "reason" in abortSignal ? abortSignal.reason : void 0;
4323
+ if (reason) {
4324
+ if (reason instanceof Error) {
4325
+ const abortError$2 = /* @__PURE__ */ new Error("Request aborted");
4326
+ abortError$2.name = "AbortError";
4327
+ abortError$2.cause = reason;
4328
+ return abortError$2;
4329
+ }
4330
+ const abortError$1 = new Error(String(reason));
4331
+ abortError$1.name = "AbortError";
4332
+ return abortError$1;
4333
+ }
4334
+ const abortError = /* @__PURE__ */ new Error("Request aborted");
4335
+ abortError.name = "AbortError";
4336
+ return abortError;
4337
+ }
4338
+ const streamCollector = async (stream$1) => {
4339
+ if (typeof Blob === "function" && stream$1 instanceof Blob || stream$1.constructor?.name === "Blob") {
4340
+ if (Blob.prototype.arrayBuffer !== void 0) return new Uint8Array(await stream$1.arrayBuffer());
4341
+ return collectBlob(stream$1);
4342
+ }
4343
+ return collectStream(stream$1);
4344
+ };
4345
+ async function collectBlob(blob) {
4346
+ const base64 = await readToBase64(blob);
4347
+ const arrayBuffer = utilBase64$1.fromBase64(base64);
4348
+ return new Uint8Array(arrayBuffer);
4349
+ }
4350
+ async function collectStream(stream$1) {
4351
+ const chunks = [];
4352
+ const reader = stream$1.getReader();
4353
+ let isDone = false;
4354
+ let length = 0;
4355
+ while (!isDone) {
4356
+ const { done, value } = await reader.read();
4357
+ if (value) {
4358
+ chunks.push(value);
4359
+ length += value.length;
4360
+ }
4361
+ isDone = done;
4362
+ }
4363
+ const collected = new Uint8Array(length);
4364
+ let offset = 0;
4365
+ for (const chunk of chunks) {
4366
+ collected.set(chunk, offset);
4367
+ offset += chunk.length;
4368
+ }
4369
+ return collected;
4370
+ }
4371
+ function readToBase64(blob) {
4372
+ return new Promise((resolve, reject) => {
4373
+ const reader = new FileReader();
4374
+ reader.onloadend = () => {
4375
+ if (reader.readyState !== 2) return reject(/* @__PURE__ */ new Error("Reader aborted too early"));
4376
+ const result = reader.result ?? "";
4377
+ const commaIndex = result.indexOf(",");
4378
+ const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
4379
+ resolve(result.substring(dataOffset));
4380
+ };
4381
+ reader.onabort = () => reject(/* @__PURE__ */ new Error("Read aborted"));
4382
+ reader.onerror = () => reject(reader.error);
4383
+ reader.readAsDataURL(blob);
4384
+ });
4385
+ }
4386
+ exports.FetchHttpHandler = FetchHttpHandler;
4387
+ exports.keepAliveSupport = keepAliveSupport;
4388
+ exports.streamCollector = streamCollector;
4389
+ }) });
4390
+
4391
+ //#endregion
4392
+ //#region ../../node_modules/.pnpm/@smithy+util-hex-encoding@4.2.2/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js
4393
+ var require_dist_cjs$3 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-hex-encoding@4.2.2/node_modules/@smithy/util-hex-encoding/dist-cjs/index.js": ((exports) => {
4394
+ const SHORT_TO_HEX = {};
4395
+ const HEX_TO_SHORT = {};
4396
+ for (let i = 0; i < 256; i++) {
4397
+ let encodedByte = i.toString(16).toLowerCase();
4398
+ if (encodedByte.length === 1) encodedByte = `0${encodedByte}`;
4399
+ SHORT_TO_HEX[i] = encodedByte;
4400
+ HEX_TO_SHORT[encodedByte] = i;
4401
+ }
4402
+ function fromHex(encoded) {
4403
+ if (encoded.length % 2 !== 0) throw new Error("Hex encoded strings must have an even number length");
4404
+ const out = new Uint8Array(encoded.length / 2);
4405
+ for (let i = 0; i < encoded.length; i += 2) {
4406
+ const encodedByte = encoded.slice(i, i + 2).toLowerCase();
4407
+ if (encodedByte in HEX_TO_SHORT) out[i / 2] = HEX_TO_SHORT[encodedByte];
4408
+ else throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);
4409
+ }
4410
+ return out;
4411
+ }
4412
+ function toHex(bytes) {
4413
+ let out = "";
4414
+ for (let i = 0; i < bytes.byteLength; i++) out += SHORT_TO_HEX[bytes[i]];
4415
+ return out;
4416
+ }
4417
+ exports.fromHex = fromHex;
4418
+ exports.toHex = toHex;
4419
+ }) });
4420
+
4421
+ //#endregion
4422
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js
4423
+ var require_sdk_stream_mixin_browser = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.browser.js": ((exports) => {
4424
+ Object.defineProperty(exports, "__esModule", { value: true });
4425
+ const fetch_http_handler_1 = require_dist_cjs$4();
4426
+ const util_base64_1 = require_dist_cjs$10();
4427
+ const util_hex_encoding_1 = require_dist_cjs$3();
4428
+ const util_utf8_1 = require_dist_cjs$13.require_dist_cjs();
4429
+ const stream_type_check_1$1 = require_stream_type_check();
4430
+ const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1 = "The stream has already been transformed.";
4431
+ const sdkStreamMixin$3 = (stream$1) => {
4432
+ if (!isBlobInstance(stream$1) && !(0, stream_type_check_1$1.isReadableStream)(stream$1)) {
4433
+ const name = stream$1?.__proto__?.constructor?.name || stream$1;
4434
+ throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
4435
+ }
4436
+ let transformed = false;
4437
+ const transformToByteArray = async () => {
4438
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
4439
+ transformed = true;
4440
+ return await (0, fetch_http_handler_1.streamCollector)(stream$1);
4441
+ };
4442
+ const blobToWebStream = (blob) => {
4443
+ 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");
4444
+ return blob.stream();
4445
+ };
4446
+ return Object.assign(stream$1, {
4447
+ transformToByteArray,
4448
+ transformToString: async (encoding) => {
4449
+ const buf = await transformToByteArray();
4450
+ if (encoding === "base64") return (0, util_base64_1.toBase64)(buf);
4451
+ else if (encoding === "hex") return (0, util_hex_encoding_1.toHex)(buf);
4452
+ else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") return (0, util_utf8_1.toUtf8)(buf);
4453
+ else if (typeof TextDecoder === "function") return new TextDecoder(encoding).decode(buf);
4454
+ else throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
4455
+ },
4456
+ transformToWebStream: () => {
4457
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
4458
+ transformed = true;
4459
+ if (isBlobInstance(stream$1)) return blobToWebStream(stream$1);
4460
+ else if ((0, stream_type_check_1$1.isReadableStream)(stream$1)) return stream$1;
4461
+ else throw new Error(`Cannot transform payload to web stream, got ${stream$1}`);
4462
+ }
4463
+ });
4464
+ };
4465
+ exports.sdkStreamMixin = sdkStreamMixin$3;
4466
+ const isBlobInstance = (stream$1) => typeof Blob === "function" && stream$1 instanceof Blob;
4467
+ }) });
4468
+
4469
+ //#endregion
4470
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js
4471
+ var require_sdk_stream_mixin = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/sdk-stream-mixin.js": ((exports) => {
4472
+ Object.defineProperty(exports, "__esModule", { value: true });
4473
+ const node_http_handler_1 = require_dist_cjs$5();
4474
+ const util_buffer_from_1 = require_dist_cjs$13.require_dist_cjs$1();
4475
+ const stream_1$1 = require("stream");
4476
+ const sdk_stream_mixin_browser_1 = require_sdk_stream_mixin_browser();
4477
+ const ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
4478
+ const sdkStreamMixin$2 = (stream$1) => {
4479
+ if (!(stream$1 instanceof stream_1$1.Readable)) try {
4480
+ return (0, sdk_stream_mixin_browser_1.sdkStreamMixin)(stream$1);
4481
+ } catch (e) {
4482
+ const name = stream$1?.__proto__?.constructor?.name || stream$1;
4483
+ throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
4484
+ }
4485
+ let transformed = false;
4486
+ const transformToByteArray = async () => {
4487
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
4488
+ transformed = true;
4489
+ return await (0, node_http_handler_1.streamCollector)(stream$1);
4490
+ };
4491
+ return Object.assign(stream$1, {
4492
+ transformToByteArray,
4493
+ transformToString: async (encoding) => {
4494
+ const buf = await transformToByteArray();
4495
+ if (encoding === void 0 || Buffer.isEncoding(encoding)) return (0, util_buffer_from_1.fromArrayBuffer)(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
4496
+ else return new TextDecoder(encoding).decode(buf);
4497
+ },
4498
+ transformToWebStream: () => {
4499
+ if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
4500
+ if (stream$1.readableFlowing !== null) throw new Error("The stream has been consumed by other callbacks.");
4501
+ if (typeof stream_1$1.Readable.toWeb !== "function") throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
4502
+ transformed = true;
4503
+ return stream_1$1.Readable.toWeb(stream$1);
4504
+ }
4505
+ });
4506
+ };
4507
+ exports.sdkStreamMixin = sdkStreamMixin$2;
4508
+ }) });
4509
+
4510
+ //#endregion
4511
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js
4512
+ var require_splitStream_browser = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js": ((exports) => {
4513
+ Object.defineProperty(exports, "__esModule", { value: true });
4514
+ exports.splitStream = splitStream$2;
4515
+ async function splitStream$2(stream$1) {
4516
+ if (typeof stream$1.stream === "function") stream$1 = stream$1.stream();
4517
+ return stream$1.tee();
4518
+ }
4519
+ }) });
4520
+
4521
+ //#endregion
4522
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/splitStream.js
4523
+ var require_splitStream = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/splitStream.js": ((exports) => {
4524
+ Object.defineProperty(exports, "__esModule", { value: true });
4525
+ exports.splitStream = splitStream$1;
4526
+ const stream_1 = require("stream");
4527
+ const splitStream_browser_1 = require_splitStream_browser();
4528
+ const stream_type_check_1 = require_stream_type_check();
4529
+ async function splitStream$1(stream$1) {
4530
+ if ((0, stream_type_check_1.isReadableStream)(stream$1) || (0, stream_type_check_1.isBlob)(stream$1)) return (0, splitStream_browser_1.splitStream)(stream$1);
4531
+ const stream1 = new stream_1.PassThrough();
4532
+ const stream2 = new stream_1.PassThrough();
4533
+ stream$1.pipe(stream1);
4534
+ stream$1.pipe(stream2);
4535
+ return [stream1, stream2];
4536
+ }
4537
+ }) });
4538
+
4539
+ //#endregion
4540
+ //#region ../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/index.js
4541
+ var require_dist_cjs$2 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+util-stream@4.5.19/node_modules/@smithy/util-stream/dist-cjs/index.js": ((exports) => {
4542
+ var utilBase64 = require_dist_cjs$10();
4543
+ var utilUtf8 = require_dist_cjs$13.require_dist_cjs();
4544
+ var ChecksumStream = require_ChecksumStream();
4545
+ var createChecksumStream = require_createChecksumStream();
4546
+ var createBufferedReadable = require_createBufferedReadable();
4547
+ var getAwsChunkedEncodingStream = require_getAwsChunkedEncodingStream();
4548
+ var headStream = require_headStream();
4549
+ var sdkStreamMixin$1 = require_sdk_stream_mixin();
4550
+ var splitStream = require_splitStream();
4551
+ var streamTypeCheck = require_stream_type_check();
4552
+ var Uint8ArrayBlobAdapter$1 = class Uint8ArrayBlobAdapter$1 extends Uint8Array {
4553
+ static fromString(source, encoding = "utf-8") {
4554
+ if (typeof source === "string") {
4555
+ if (encoding === "base64") return Uint8ArrayBlobAdapter$1.mutate(utilBase64.fromBase64(source));
4556
+ return Uint8ArrayBlobAdapter$1.mutate(utilUtf8.fromUtf8(source));
4557
+ }
4558
+ throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
4559
+ }
4560
+ static mutate(source) {
4561
+ Object.setPrototypeOf(source, Uint8ArrayBlobAdapter$1.prototype);
4562
+ return source;
4563
+ }
4564
+ transformToString(encoding = "utf-8") {
4565
+ if (encoding === "base64") return utilBase64.toBase64(this);
4566
+ return utilUtf8.toUtf8(this);
4567
+ }
4568
+ };
4569
+ exports.isBlob = streamTypeCheck.isBlob;
4570
+ exports.isReadableStream = streamTypeCheck.isReadableStream;
4571
+ exports.Uint8ArrayBlobAdapter = Uint8ArrayBlobAdapter$1;
4572
+ Object.prototype.hasOwnProperty.call(ChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4573
+ enumerable: true,
4574
+ value: ChecksumStream["__proto__"]
4575
+ });
4576
+ Object.keys(ChecksumStream).forEach(function(k) {
4577
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = ChecksumStream[k];
4578
+ });
4579
+ Object.prototype.hasOwnProperty.call(createChecksumStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4580
+ enumerable: true,
4581
+ value: createChecksumStream["__proto__"]
4582
+ });
4583
+ Object.keys(createChecksumStream).forEach(function(k) {
4584
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = createChecksumStream[k];
4585
+ });
4586
+ Object.prototype.hasOwnProperty.call(createBufferedReadable, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4587
+ enumerable: true,
4588
+ value: createBufferedReadable["__proto__"]
4589
+ });
4590
+ Object.keys(createBufferedReadable).forEach(function(k) {
4591
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = createBufferedReadable[k];
4592
+ });
4593
+ Object.prototype.hasOwnProperty.call(getAwsChunkedEncodingStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4594
+ enumerable: true,
4595
+ value: getAwsChunkedEncodingStream["__proto__"]
4596
+ });
4597
+ Object.keys(getAwsChunkedEncodingStream).forEach(function(k) {
4598
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getAwsChunkedEncodingStream[k];
4599
+ });
4600
+ Object.prototype.hasOwnProperty.call(headStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4601
+ enumerable: true,
4602
+ value: headStream["__proto__"]
4603
+ });
4604
+ Object.keys(headStream).forEach(function(k) {
4605
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = headStream[k];
4606
+ });
4607
+ Object.prototype.hasOwnProperty.call(sdkStreamMixin$1, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4608
+ enumerable: true,
4609
+ value: sdkStreamMixin$1["__proto__"]
4610
+ });
4611
+ Object.keys(sdkStreamMixin$1).forEach(function(k) {
4612
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = sdkStreamMixin$1[k];
4613
+ });
4614
+ Object.prototype.hasOwnProperty.call(splitStream, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
4615
+ enumerable: true,
4616
+ value: splitStream["__proto__"]
4617
+ });
4618
+ Object.keys(splitStream).forEach(function(k) {
4619
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = splitStream[k];
4620
+ });
4621
+ }) });
4622
+
4623
+ //#endregion
4624
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
4625
+ var import_dist_cjs$11, collectBody;
4626
+ var init_collect_stream_body = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js": (() => {
4627
+ import_dist_cjs$11 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$2());
4628
+ collectBody = async (streamBody = new Uint8Array(), context) => {
4629
+ if (streamBody instanceof Uint8Array) return import_dist_cjs$11.Uint8ArrayBlobAdapter.mutate(streamBody);
4630
+ if (!streamBody) return import_dist_cjs$11.Uint8ArrayBlobAdapter.mutate(new Uint8Array());
4631
+ const fromContext = context.streamCollector(streamBody);
4632
+ return import_dist_cjs$11.Uint8ArrayBlobAdapter.mutate(await fromContext);
4633
+ };
4634
+ }) });
4635
+
4636
+ //#endregion
4637
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
4638
+ function extendedEncodeURIComponent(str) {
4639
+ return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
4640
+ return "%" + c.charCodeAt(0).toString(16).toUpperCase();
4641
+ });
4642
+ }
4643
+ var init_extended_encode_uri_component = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js": (() => {}) });
4644
+
4645
+ //#endregion
4646
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/deref.js
4647
+ var deref;
4648
+ var init_deref = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/deref.js": (() => {
4649
+ deref = (schemaRef) => {
4650
+ if (typeof schemaRef === "function") return schemaRef();
4651
+ return schemaRef;
4652
+ };
4653
+ }) });
4654
+
4655
+ //#endregion
4656
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js
4657
+ var init_operation = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/operation.js": (() => {}) });
4658
+
4659
+ //#endregion
4660
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js
4661
+ var init_getSchemaSerdePlugin = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js": (() => {}) });
4662
+
4663
+ //#endregion
4664
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js
4665
+ var Schema;
4666
+ var init_Schema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js": (() => {
4667
+ Schema = class {
4668
+ name;
4669
+ namespace;
4670
+ traits;
4671
+ static assign(instance, values) {
4672
+ return Object.assign(instance, values);
4673
+ }
4674
+ static [Symbol.hasInstance](lhs) {
4675
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
4676
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) return lhs.symbol === this.symbol;
4677
+ return isPrototype;
4678
+ }
4679
+ getName() {
4680
+ return this.namespace + "#" + this.name;
4681
+ }
4682
+ };
4683
+ }) });
4684
+
4685
+ //#endregion
4686
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js
4687
+ var ListSchema;
4688
+ var init_ListSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js": (() => {
4689
+ init_Schema();
4690
+ ListSchema = class ListSchema extends Schema {
4691
+ static symbol = Symbol.for("@smithy/lis");
4692
+ name;
4693
+ traits;
4694
+ valueSchema;
4695
+ symbol = ListSchema.symbol;
4696
+ };
4697
+ }) });
4698
+
4699
+ //#endregion
4700
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js
4701
+ var MapSchema;
4702
+ var init_MapSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js": (() => {
4703
+ init_Schema();
4704
+ MapSchema = class MapSchema extends Schema {
4705
+ static symbol = Symbol.for("@smithy/map");
4706
+ name;
4707
+ traits;
4708
+ keySchema;
4709
+ valueSchema;
4710
+ symbol = MapSchema.symbol;
4711
+ };
4712
+ }) });
4713
+
4714
+ //#endregion
4715
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js
4716
+ var OperationSchema;
4717
+ var init_OperationSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js": (() => {
4718
+ init_Schema();
4719
+ OperationSchema = class OperationSchema extends Schema {
4720
+ static symbol = Symbol.for("@smithy/ope");
4721
+ name;
4722
+ traits;
4723
+ input;
4724
+ output;
4725
+ symbol = OperationSchema.symbol;
4726
+ };
4727
+ }) });
4728
+
4729
+ //#endregion
4730
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js
4731
+ var StructureSchema;
4732
+ var init_StructureSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js": (() => {
4733
+ init_Schema();
4734
+ StructureSchema = class StructureSchema extends Schema {
4735
+ static symbol = Symbol.for("@smithy/str");
4736
+ name;
4737
+ traits;
4738
+ memberNames;
4739
+ memberList;
4740
+ symbol = StructureSchema.symbol;
4741
+ };
4742
+ }) });
4743
+
4744
+ //#endregion
4745
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js
4746
+ var ErrorSchema;
4747
+ var init_ErrorSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js": (() => {
4748
+ init_StructureSchema();
4749
+ ErrorSchema = class ErrorSchema extends StructureSchema {
4750
+ static symbol = Symbol.for("@smithy/err");
4751
+ ctor;
4752
+ symbol = ErrorSchema.symbol;
4753
+ };
4754
+ }) });
4755
+
4756
+ //#endregion
4757
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js
4758
+ function translateTraits(indicator) {
4759
+ if (typeof indicator === "object") return indicator;
4760
+ indicator = indicator | 0;
4761
+ if (traitsCache[indicator]) return traitsCache[indicator];
4762
+ const traits = {};
4763
+ let i = 0;
4764
+ for (const trait of [
4765
+ "httpLabel",
4766
+ "idempotent",
4767
+ "idempotencyToken",
4768
+ "sensitive",
4769
+ "httpPayload",
4770
+ "httpResponseCode",
4771
+ "httpQueryParams"
4772
+ ]) if ((indicator >> i++ & 1) === 1) traits[trait] = 1;
4773
+ return traitsCache[indicator] = traits;
4774
+ }
4775
+ var traitsCache;
4776
+ var init_translateTraits = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js": (() => {
4777
+ traitsCache = [];
4778
+ }) });
4779
+
4780
+ //#endregion
4781
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js
4782
+ function member(memberSchema, memberName) {
4783
+ if (memberSchema instanceof NormalizedSchema) return Object.assign(memberSchema, {
4784
+ memberName,
4785
+ _isMemberSchema: true
4786
+ });
4787
+ return new NormalizedSchema(memberSchema, memberName);
4788
+ }
4789
+ var anno, simpleSchemaCacheN, simpleSchemaCacheS, NormalizedSchema, isMemberSchema, isStaticSchema;
4790
+ var init_NormalizedSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js": (() => {
4791
+ init_deref();
4792
+ init_translateTraits();
4793
+ anno = {
4794
+ it: Symbol.for("@smithy/nor-struct-it"),
4795
+ ns: Symbol.for("@smithy/ns")
4796
+ };
4797
+ simpleSchemaCacheN = [];
4798
+ simpleSchemaCacheS = {};
4799
+ NormalizedSchema = class NormalizedSchema {
4800
+ ref;
4801
+ memberName;
4802
+ static symbol = Symbol.for("@smithy/nor");
4803
+ symbol = NormalizedSchema.symbol;
4804
+ name;
4805
+ schema;
4806
+ _isMemberSchema;
4807
+ traits;
4808
+ memberTraits;
4809
+ normalizedTraits;
4810
+ constructor(ref, memberName) {
4811
+ this.ref = ref;
4812
+ this.memberName = memberName;
4813
+ const traitStack = [];
4814
+ let _ref = ref;
4815
+ let schema = ref;
4816
+ this._isMemberSchema = false;
4817
+ while (isMemberSchema(_ref)) {
4818
+ traitStack.push(_ref[1]);
4819
+ _ref = _ref[0];
4820
+ schema = deref(_ref);
4821
+ this._isMemberSchema = true;
4822
+ }
4823
+ if (traitStack.length > 0) {
4824
+ this.memberTraits = {};
4825
+ for (let i = traitStack.length - 1; i >= 0; --i) {
4826
+ const traitSet = traitStack[i];
4827
+ Object.assign(this.memberTraits, translateTraits(traitSet));
4828
+ }
4829
+ } else this.memberTraits = 0;
4830
+ if (schema instanceof NormalizedSchema) {
4831
+ const computedMemberTraits = this.memberTraits;
4832
+ Object.assign(this, schema);
4833
+ this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
4834
+ this.normalizedTraits = void 0;
4835
+ this.memberName = memberName ?? schema.memberName;
4836
+ return;
4837
+ }
4838
+ this.schema = deref(schema);
4839
+ if (isStaticSchema(this.schema)) {
4840
+ this.name = `${this.schema[1]}#${this.schema[2]}`;
4841
+ this.traits = this.schema[3];
4842
+ } else {
4843
+ this.name = this.memberName ?? String(schema);
4844
+ this.traits = 0;
4845
+ }
4846
+ if (this._isMemberSchema && !memberName) throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
4847
+ }
4848
+ static [Symbol.hasInstance](lhs) {
4849
+ const isPrototype = this.prototype.isPrototypeOf(lhs);
4850
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) return lhs.symbol === this.symbol;
4851
+ return isPrototype;
4852
+ }
4853
+ static of(ref) {
4854
+ const keyAble = typeof ref === "function" || typeof ref === "object" && ref !== null;
4855
+ if (typeof ref === "number") {
4856
+ if (simpleSchemaCacheN[ref]) return simpleSchemaCacheN[ref];
4857
+ } else if (typeof ref === "string") {
4858
+ if (simpleSchemaCacheS[ref]) return simpleSchemaCacheS[ref];
4859
+ } else if (keyAble) {
4860
+ if (ref[anno.ns]) return ref[anno.ns];
4861
+ }
4862
+ const sc = deref(ref);
4863
+ if (sc instanceof NormalizedSchema) return sc;
4864
+ if (isMemberSchema(sc)) {
4865
+ const [ns$1, traits] = sc;
4866
+ if (ns$1 instanceof NormalizedSchema) {
4867
+ Object.assign(ns$1.getMergedTraits(), translateTraits(traits));
4868
+ return ns$1;
4869
+ }
4870
+ throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
4871
+ }
4872
+ const ns = new NormalizedSchema(sc);
4873
+ if (keyAble) return ref[anno.ns] = ns;
4874
+ if (typeof sc === "string") return simpleSchemaCacheS[sc] = ns;
4875
+ if (typeof sc === "number") return simpleSchemaCacheN[sc] = ns;
4876
+ return ns;
4877
+ }
4878
+ getSchema() {
4879
+ const sc = this.schema;
4880
+ if (Array.isArray(sc) && sc[0] === 0) return sc[4];
4881
+ return sc;
4882
+ }
4883
+ getName(withNamespace = false) {
4884
+ const { name } = this;
4885
+ return !withNamespace && name && name.includes("#") ? name.split("#")[1] : name || void 0;
4886
+ }
4887
+ getMemberName() {
4888
+ return this.memberName;
4889
+ }
4890
+ isMemberSchema() {
4891
+ return this._isMemberSchema;
4892
+ }
4893
+ isListSchema() {
4894
+ const sc = this.getSchema();
4895
+ return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
4896
+ }
4897
+ isMapSchema() {
4898
+ const sc = this.getSchema();
4899
+ return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
4900
+ }
4901
+ isStructSchema() {
4902
+ const sc = this.getSchema();
4903
+ if (typeof sc !== "object") return false;
4904
+ const id = sc[0];
4905
+ return id === 3 || id === -3 || id === 4;
4906
+ }
4907
+ isUnionSchema() {
4908
+ const sc = this.getSchema();
4909
+ if (typeof sc !== "object") return false;
4910
+ return sc[0] === 4;
4911
+ }
4912
+ isBlobSchema() {
4913
+ const sc = this.getSchema();
4914
+ return sc === 21 || sc === 42;
4915
+ }
4916
+ isTimestampSchema() {
4917
+ const sc = this.getSchema();
4918
+ return typeof sc === "number" && sc >= 4 && sc <= 7;
4919
+ }
4920
+ isUnitSchema() {
4921
+ return this.getSchema() === "unit";
4922
+ }
4923
+ isDocumentSchema() {
4924
+ return this.getSchema() === 15;
4925
+ }
4926
+ isStringSchema() {
4927
+ return this.getSchema() === 0;
4928
+ }
4929
+ isBooleanSchema() {
4930
+ return this.getSchema() === 2;
4931
+ }
4932
+ isNumericSchema() {
4933
+ return this.getSchema() === 1;
4934
+ }
4935
+ isBigIntegerSchema() {
4936
+ return this.getSchema() === 17;
4937
+ }
4938
+ isBigDecimalSchema() {
4939
+ return this.getSchema() === 19;
4940
+ }
4941
+ isStreaming() {
4942
+ const { streaming } = this.getMergedTraits();
4943
+ return !!streaming || this.getSchema() === 42;
4944
+ }
4945
+ isIdempotencyToken() {
4946
+ return !!this.getMergedTraits().idempotencyToken;
4947
+ }
4948
+ getMergedTraits() {
4949
+ return this.normalizedTraits ?? (this.normalizedTraits = {
4950
+ ...this.getOwnTraits(),
4951
+ ...this.getMemberTraits()
4952
+ });
4953
+ }
4954
+ getMemberTraits() {
4955
+ return translateTraits(this.memberTraits);
4956
+ }
4957
+ getOwnTraits() {
4958
+ return translateTraits(this.traits);
4959
+ }
4960
+ getKeySchema() {
4961
+ const [isDoc, isMap] = [this.isDocumentSchema(), this.isMapSchema()];
4962
+ if (!isDoc && !isMap) throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
4963
+ const schema = this.getSchema();
4964
+ return member([isDoc ? 15 : schema[4] ?? 0, 0], "key");
4965
+ }
4966
+ getValueSchema() {
4967
+ const sc = this.getSchema();
4968
+ const [isDoc, isMap, isList] = [
4969
+ this.isDocumentSchema(),
4970
+ this.isMapSchema(),
4971
+ this.isListSchema()
4972
+ ];
4973
+ const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0;
4974
+ if (memberSchema != null) return member([memberSchema, 0], isMap ? "value" : "member");
4975
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
4976
+ }
4977
+ getMemberSchema(memberName) {
4978
+ const struct = this.getSchema();
4979
+ if (this.isStructSchema() && struct[4].includes(memberName)) {
4980
+ const i = struct[4].indexOf(memberName);
4981
+ const memberSchema = struct[5][i];
4982
+ return member(isMemberSchema(memberSchema) ? memberSchema : [memberSchema, 0], memberName);
4983
+ }
4984
+ if (this.isDocumentSchema()) return member([15, 0], memberName);
4985
+ throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${memberName}.`);
4986
+ }
4987
+ getMemberSchemas() {
4988
+ const buffer = {};
4989
+ try {
4990
+ for (const [k, v] of this.structIterator()) buffer[k] = v;
4991
+ } catch (ignored) {}
4992
+ return buffer;
4993
+ }
4994
+ getEventStreamMember() {
4995
+ if (this.isStructSchema()) {
4996
+ for (const [memberName, memberSchema] of this.structIterator()) if (memberSchema.isStreaming() && memberSchema.isStructSchema()) return memberName;
4997
+ }
4998
+ return "";
4999
+ }
5000
+ *structIterator() {
5001
+ if (this.isUnitSchema()) return;
5002
+ if (!this.isStructSchema()) throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
5003
+ const struct = this.getSchema();
5004
+ const z = struct[4].length;
5005
+ let it = struct[anno.it];
5006
+ if (it && z === it.length) {
5007
+ yield* it;
5008
+ return;
5009
+ }
5010
+ it = Array(z);
5011
+ for (let i = 0; i < z; ++i) {
5012
+ const k = struct[4][i];
5013
+ yield it[i] = [k, member([struct[5][i], 0], k)];
5014
+ }
5015
+ struct[anno.it] = it;
5016
+ }
5017
+ };
5018
+ isMemberSchema = (sc) => Array.isArray(sc) && sc.length === 2;
5019
+ isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
5020
+ }) });
5021
+
5022
+ //#endregion
5023
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js
5024
+ var SimpleSchema;
5025
+ var init_SimpleSchema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js": (() => {
5026
+ init_Schema();
5027
+ SimpleSchema = class SimpleSchema extends Schema {
5028
+ static symbol = Symbol.for("@smithy/sim");
5029
+ name;
5030
+ schemaRef;
5031
+ traits;
5032
+ symbol = SimpleSchema.symbol;
5033
+ };
5034
+ }) });
5035
+
5036
+ //#endregion
5037
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js
5038
+ var init_sentinels = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js": (() => {}) });
5039
+
5040
+ //#endregion
5041
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js
5042
+ var TypeRegistry;
5043
+ var init_TypeRegistry = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js": (() => {
5044
+ TypeRegistry = class TypeRegistry {
5045
+ namespace;
5046
+ schemas;
5047
+ exceptions;
5048
+ static registries = /* @__PURE__ */ new Map();
5049
+ constructor(namespace, schemas = /* @__PURE__ */ new Map(), exceptions = /* @__PURE__ */ new Map()) {
5050
+ this.namespace = namespace;
5051
+ this.schemas = schemas;
5052
+ this.exceptions = exceptions;
5053
+ }
5054
+ static for(namespace) {
5055
+ if (!TypeRegistry.registries.has(namespace)) TypeRegistry.registries.set(namespace, new TypeRegistry(namespace));
5056
+ return TypeRegistry.registries.get(namespace);
5057
+ }
5058
+ copyFrom(other) {
5059
+ const { schemas, exceptions } = this;
5060
+ for (const [k, v] of other.schemas) if (!schemas.has(k)) schemas.set(k, v);
5061
+ for (const [k, v] of other.exceptions) if (!exceptions.has(k)) exceptions.set(k, v);
5062
+ }
5063
+ register(shapeId, schema) {
5064
+ const qualifiedName = this.normalizeShapeId(shapeId);
5065
+ for (const r of [this, TypeRegistry.for(qualifiedName.split("#")[0])]) r.schemas.set(qualifiedName, schema);
5066
+ }
5067
+ getSchema(shapeId) {
5068
+ const id = this.normalizeShapeId(shapeId);
5069
+ if (!this.schemas.has(id)) throw new Error(`@smithy/core/schema - schema not found for ${id}`);
5070
+ return this.schemas.get(id);
5071
+ }
5072
+ registerError(es, ctor) {
5073
+ const $error = es;
5074
+ const ns = $error[1];
5075
+ for (const r of [this, TypeRegistry.for(ns)]) {
5076
+ r.schemas.set(ns + "#" + $error[2], $error);
5077
+ r.exceptions.set($error, ctor);
5078
+ }
5079
+ }
5080
+ getErrorCtor(es) {
5081
+ const $error = es;
5082
+ if (this.exceptions.has($error)) return this.exceptions.get($error);
5083
+ return TypeRegistry.for($error[1]).exceptions.get($error);
5084
+ }
5085
+ getBaseException() {
5086
+ for (const exceptionKey of this.exceptions.keys()) if (Array.isArray(exceptionKey)) {
5087
+ const [, ns, name] = exceptionKey;
5088
+ const id = ns + "#" + name;
5089
+ if (id.startsWith("smithy.ts.sdk.synthetic.") && id.endsWith("ServiceException")) return exceptionKey;
5090
+ }
5091
+ }
5092
+ find(predicate) {
5093
+ return [...this.schemas.values()].find(predicate);
5094
+ }
5095
+ clear() {
5096
+ this.schemas.clear();
5097
+ this.exceptions.clear();
5098
+ }
5099
+ normalizeShapeId(shapeId) {
5100
+ if (shapeId.includes("#")) return shapeId;
5101
+ return this.namespace + "#" + shapeId;
5102
+ }
5103
+ };
5104
+ }) });
5105
+
5106
+ //#endregion
5107
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/index.js
5108
+ var init_schema = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/schema/index.js": (() => {
5109
+ init_deref();
5110
+ init_getSchemaSerdePlugin();
5111
+ init_ListSchema();
5112
+ init_MapSchema();
5113
+ init_OperationSchema();
5114
+ init_operation();
5115
+ init_ErrorSchema();
5116
+ init_NormalizedSchema();
5117
+ init_Schema();
5118
+ init_SimpleSchema();
5119
+ init_StructureSchema();
5120
+ init_sentinels();
5121
+ init_translateTraits();
5122
+ init_TypeRegistry();
5123
+ }) });
5124
+
5125
+ //#endregion
5126
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js
5127
+ var init_copyDocumentWithTransform = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js": (() => {}) });
5128
+
5129
+ //#endregion
5130
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js
5131
+ var MAX_FLOAT;
5132
+ var init_parse_utils = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/parse-utils.js": (() => {
5133
+ MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
5134
+ }) });
5135
+
5136
+ //#endregion
5137
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js
5138
+ function dateToUtcString(date$1) {
5139
+ const year$2 = date$1.getUTCFullYear();
5140
+ const month = date$1.getUTCMonth();
5141
+ const dayOfWeek = date$1.getUTCDay();
5142
+ const dayOfMonthInt = date$1.getUTCDate();
5143
+ const hoursInt = date$1.getUTCHours();
5144
+ const minutesInt = date$1.getUTCMinutes();
5145
+ const secondsInt = date$1.getUTCSeconds();
5146
+ const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
5147
+ const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
5148
+ const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
5149
+ const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
5150
+ return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year$2} ${hoursString}:${minutesString}:${secondsString} GMT`;
5151
+ }
5152
+ var DAYS, MONTHS, FIFTY_YEARS_IN_MILLIS;
5153
+ var init_date_utils = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/date-utils.js": (() => {
5154
+ DAYS = [
5155
+ "Sun",
5156
+ "Mon",
5157
+ "Tue",
5158
+ "Wed",
5159
+ "Thu",
5160
+ "Fri",
5161
+ "Sat"
5162
+ ];
5163
+ MONTHS = [
5164
+ "Jan",
5165
+ "Feb",
5166
+ "Mar",
5167
+ "Apr",
5168
+ "May",
5169
+ "Jun",
5170
+ "Jul",
5171
+ "Aug",
5172
+ "Sep",
5173
+ "Oct",
5174
+ "Nov",
5175
+ "Dec"
5176
+ ];
5177
+ FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;
5178
+ }) });
5179
+
5180
+ //#endregion
5181
+ //#region ../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs
5182
+ var tslib_es6_exports = /* @__PURE__ */ require_dist_cjs$13.__export({
5183
+ __addDisposableResource: () => __addDisposableResource,
5184
+ __assign: () => __assign,
5185
+ __asyncDelegator: () => __asyncDelegator,
5186
+ __asyncGenerator: () => __asyncGenerator,
5187
+ __asyncValues: () => __asyncValues,
5188
+ __await: () => __await,
5189
+ __awaiter: () => __awaiter,
5190
+ __classPrivateFieldGet: () => __classPrivateFieldGet,
5191
+ __classPrivateFieldIn: () => __classPrivateFieldIn,
5192
+ __classPrivateFieldSet: () => __classPrivateFieldSet,
5193
+ __createBinding: () => __createBinding,
5194
+ __decorate: () => __decorate,
5195
+ __disposeResources: () => __disposeResources,
5196
+ __esDecorate: () => __esDecorate,
5197
+ __exportStar: () => __exportStar,
5198
+ __extends: () => __extends,
5199
+ __generator: () => __generator,
5200
+ __importDefault: () => __importDefault,
5201
+ __importStar: () => __importStar,
5202
+ __makeTemplateObject: () => __makeTemplateObject,
5203
+ __metadata: () => __metadata,
5204
+ __param: () => __param,
5205
+ __propKey: () => __propKey,
5206
+ __read: () => __read,
5207
+ __rest: () => __rest,
5208
+ __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
5209
+ __runInitializers: () => __runInitializers,
5210
+ __setFunctionName: () => __setFunctionName,
5211
+ __spread: () => __spread,
5212
+ __spreadArray: () => __spreadArray,
5213
+ __spreadArrays: () => __spreadArrays,
5214
+ __values: () => __values,
5215
+ default: () => tslib_es6_default
5216
+ });
5217
+ function __extends(d, b) {
5218
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
5219
+ extendStatics(d, b);
5220
+ function __() {
5221
+ this.constructor = d;
5222
+ }
5223
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5224
+ }
5225
+ function __rest(s, e) {
5226
+ var t = {};
5227
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
5228
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") {
5229
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
5230
+ }
5231
+ return t;
5232
+ }
5233
+ function __decorate(decorators, target, key, desc) {
5234
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5235
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5236
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5237
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
5238
+ }
5239
+ function __param(paramIndex, decorator) {
5240
+ return function(target, key) {
5241
+ decorator(target, key, paramIndex);
5242
+ };
5243
+ }
5244
+ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
5245
+ function accept(f) {
5246
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
5247
+ return f;
5248
+ }
5249
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
5250
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5251
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
5252
+ var _, done = false;
5253
+ for (var i = decorators.length - 1; i >= 0; i--) {
5254
+ var context = {};
5255
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
5256
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
5257
+ context.addInitializer = function(f) {
5258
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
5259
+ extraInitializers.push(accept(f || null));
5260
+ };
5261
+ var result = (0, decorators[i])(kind === "accessor" ? {
5262
+ get: descriptor.get,
5263
+ set: descriptor.set
5264
+ } : descriptor[key], context);
5265
+ if (kind === "accessor") {
5266
+ if (result === void 0) continue;
5267
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
5268
+ if (_ = accept(result.get)) descriptor.get = _;
5269
+ if (_ = accept(result.set)) descriptor.set = _;
5270
+ if (_ = accept(result.init)) initializers.unshift(_);
5271
+ } else if (_ = accept(result)) if (kind === "field") initializers.unshift(_);
5272
+ else descriptor[key] = _;
5273
+ }
5274
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
5275
+ done = true;
5276
+ }
5277
+ function __runInitializers(thisArg, initializers, value) {
5278
+ var useValue = arguments.length > 2;
5279
+ for (var i = 0; i < initializers.length; i++) value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5280
+ return useValue ? value : void 0;
5281
+ }
5282
+ function __propKey(x) {
5283
+ return typeof x === "symbol" ? x : "".concat(x);
5284
+ }
5285
+ function __setFunctionName(f, name, prefix) {
5286
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
5287
+ return Object.defineProperty(f, "name", {
5288
+ configurable: true,
5289
+ value: prefix ? "".concat(prefix, " ", name) : name
5290
+ });
5291
+ }
5292
+ function __metadata(metadataKey, metadataValue) {
5293
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
5294
+ }
5295
+ function __awaiter(thisArg, _arguments, P, generator) {
5296
+ function adopt(value) {
5297
+ return value instanceof P ? value : new P(function(resolve) {
5298
+ resolve(value);
5299
+ });
5300
+ }
5301
+ return new (P || (P = Promise))(function(resolve, reject) {
5302
+ function fulfilled(value) {
5303
+ try {
5304
+ step(generator.next(value));
5305
+ } catch (e) {
5306
+ reject(e);
5307
+ }
5308
+ }
5309
+ function rejected(value) {
5310
+ try {
5311
+ step(generator["throw"](value));
5312
+ } catch (e) {
5313
+ reject(e);
5314
+ }
5315
+ }
5316
+ function step(result) {
5317
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
5318
+ }
5319
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
5320
+ });
5321
+ }
5322
+ function __generator(thisArg, body) {
5323
+ var _ = {
5324
+ label: 0,
5325
+ sent: function() {
5326
+ if (t[0] & 1) throw t[1];
5327
+ return t[1];
5328
+ },
5329
+ trys: [],
5330
+ ops: []
5331
+ }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
5332
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
5333
+ return this;
5334
+ }), g;
5335
+ function verb(n) {
5336
+ return function(v) {
5337
+ return step([n, v]);
5338
+ };
5339
+ }
5340
+ function step(op) {
5341
+ if (f) throw new TypeError("Generator is already executing.");
5342
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
5343
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
5344
+ if (y = 0, t) op = [op[0] & 2, t.value];
5345
+ switch (op[0]) {
5346
+ case 0:
5347
+ case 1:
5348
+ t = op;
5349
+ break;
5350
+ case 4:
5351
+ _.label++;
5352
+ return {
5353
+ value: op[1],
5354
+ done: false
5355
+ };
5356
+ case 5:
5357
+ _.label++;
5358
+ y = op[1];
5359
+ op = [0];
5360
+ continue;
5361
+ case 7:
5362
+ op = _.ops.pop();
5363
+ _.trys.pop();
5364
+ continue;
5365
+ default:
5366
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
5367
+ _ = 0;
5368
+ continue;
5369
+ }
5370
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
5371
+ _.label = op[1];
5372
+ break;
5373
+ }
5374
+ if (op[0] === 6 && _.label < t[1]) {
5375
+ _.label = t[1];
5376
+ t = op;
5377
+ break;
5378
+ }
5379
+ if (t && _.label < t[2]) {
5380
+ _.label = t[2];
5381
+ _.ops.push(op);
5382
+ break;
5383
+ }
5384
+ if (t[2]) _.ops.pop();
5385
+ _.trys.pop();
5386
+ continue;
5387
+ }
5388
+ op = body.call(thisArg, _);
5389
+ } catch (e) {
5390
+ op = [6, e];
5391
+ y = 0;
5392
+ } finally {
5393
+ f = t = 0;
5394
+ }
5395
+ if (op[0] & 5) throw op[1];
5396
+ return {
5397
+ value: op[0] ? op[1] : void 0,
5398
+ done: true
5399
+ };
5400
+ }
5401
+ }
5402
+ function __exportStar(m, o) {
5403
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
5404
+ }
5405
+ function __values(o) {
5406
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
5407
+ if (m) return m.call(o);
5408
+ if (o && typeof o.length === "number") return { next: function() {
5409
+ if (o && i >= o.length) o = void 0;
5410
+ return {
5411
+ value: o && o[i++],
5412
+ done: !o
5413
+ };
5414
+ } };
5415
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
5416
+ }
5417
+ function __read(o, n) {
5418
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
5419
+ if (!m) return o;
5420
+ var i = m.call(o), r, ar = [], e;
5421
+ try {
5422
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
5423
+ } catch (error) {
5424
+ e = { error };
5425
+ } finally {
5426
+ try {
5427
+ if (r && !r.done && (m = i["return"])) m.call(i);
5428
+ } finally {
5429
+ if (e) throw e.error;
5430
+ }
5431
+ }
5432
+ return ar;
5433
+ }
5434
+ /** @deprecated */
5435
+ function __spread() {
5436
+ for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
5437
+ return ar;
5438
+ }
5439
+ /** @deprecated */
5440
+ function __spreadArrays() {
5441
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
5442
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
5443
+ return r;
5444
+ }
5445
+ function __spreadArray(to, from, pack) {
5446
+ if (pack || arguments.length === 2) {
5447
+ for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
5448
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5449
+ ar[i] = from[i];
5450
+ }
5451
+ }
5452
+ return to.concat(ar || Array.prototype.slice.call(from));
5453
+ }
5454
+ function __await(v) {
5455
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
5456
+ }
5457
+ function __asyncGenerator(thisArg, _arguments, generator) {
5458
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5459
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
5460
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function() {
5461
+ return this;
5462
+ }, i;
5463
+ function awaitReturn(f) {
5464
+ return function(v) {
5465
+ return Promise.resolve(v).then(f, reject);
5466
+ };
5467
+ }
5468
+ function verb(n, f) {
5469
+ if (g[n]) {
5470
+ i[n] = function(v) {
5471
+ return new Promise(function(a, b) {
5472
+ q.push([
5473
+ n,
5474
+ v,
5475
+ a,
5476
+ b
5477
+ ]) > 1 || resume(n, v);
5478
+ });
5479
+ };
5480
+ if (f) i[n] = f(i[n]);
5481
+ }
5482
+ }
5483
+ function resume(n, v) {
5484
+ try {
5485
+ step(g[n](v));
5486
+ } catch (e) {
5487
+ settle(q[0][3], e);
5488
+ }
5489
+ }
5490
+ function step(r) {
5491
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
5492
+ }
5493
+ function fulfill(value) {
5494
+ resume("next", value);
5495
+ }
5496
+ function reject(value) {
5497
+ resume("throw", value);
5498
+ }
5499
+ function settle(f, v) {
5500
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
5501
+ }
5502
+ }
5503
+ function __asyncDelegator(o) {
5504
+ var i, p;
5505
+ return i = {}, verb("next"), verb("throw", function(e) {
5506
+ throw e;
5507
+ }), verb("return"), i[Symbol.iterator] = function() {
5508
+ return this;
5509
+ }, i;
5510
+ function verb(n, f) {
5511
+ i[n] = o[n] ? function(v) {
5512
+ return (p = !p) ? {
5513
+ value: __await(o[n](v)),
5514
+ done: false
5515
+ } : f ? f(v) : v;
5516
+ } : f;
5517
+ }
5518
+ }
5519
+ function __asyncValues(o) {
5520
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5521
+ var m = o[Symbol.asyncIterator], i;
5522
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() {
5523
+ return this;
5524
+ }, i);
5525
+ function verb(n) {
5526
+ i[n] = o[n] && function(v) {
5527
+ return new Promise(function(resolve, reject) {
5528
+ v = o[n](v), settle(resolve, reject, v.done, v.value);
5529
+ });
5530
+ };
5531
+ }
5532
+ function settle(resolve, reject, d, v) {
5533
+ Promise.resolve(v).then(function(v$1) {
5534
+ resolve({
5535
+ value: v$1,
5536
+ done: d
5537
+ });
5538
+ }, reject);
5539
+ }
5540
+ }
5541
+ function __makeTemplateObject(cooked, raw$1) {
5542
+ if (Object.defineProperty) Object.defineProperty(cooked, "raw", { value: raw$1 });
5543
+ else cooked.raw = raw$1;
5544
+ return cooked;
5545
+ }
5546
+ function __importStar(mod) {
5547
+ if (mod && mod.__esModule) return mod;
5548
+ var result = {};
5549
+ if (mod != null) {
5550
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
5551
+ }
5552
+ __setModuleDefault(result, mod);
5553
+ return result;
5554
+ }
5555
+ function __importDefault(mod) {
5556
+ return mod && mod.__esModule ? mod : { default: mod };
5557
+ }
5558
+ function __classPrivateFieldGet(receiver, state, kind, f) {
5559
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
5560
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
5561
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5562
+ }
5563
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
5564
+ if (kind === "m") throw new TypeError("Private method is not writable");
5565
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5566
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5567
+ return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
5568
+ }
5569
+ function __classPrivateFieldIn(state, receiver) {
5570
+ if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
5571
+ return typeof state === "function" ? receiver === state : state.has(receiver);
5572
+ }
5573
+ function __addDisposableResource(env, value, async) {
5574
+ if (value !== null && value !== void 0) {
5575
+ if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
5576
+ var dispose, inner;
5577
+ if (async) {
5578
+ if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
5579
+ dispose = value[Symbol.asyncDispose];
5580
+ }
5581
+ if (dispose === void 0) {
5582
+ if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
5583
+ dispose = value[Symbol.dispose];
5584
+ if (async) inner = dispose;
5585
+ }
5586
+ if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
5587
+ if (inner) dispose = function() {
5588
+ try {
5589
+ inner.call(this);
5590
+ } catch (e) {
5591
+ return Promise.reject(e);
5592
+ }
5593
+ };
5594
+ env.stack.push({
5595
+ value,
5596
+ dispose,
5597
+ async
5598
+ });
5599
+ } else if (async) env.stack.push({ async: true });
5600
+ return value;
5601
+ }
5602
+ function __disposeResources(env) {
5603
+ function fail(e) {
5604
+ env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
5605
+ env.hasError = true;
5606
+ }
5607
+ var r, s = 0;
5608
+ function next() {
5609
+ while (r = env.stack.pop()) try {
5610
+ if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
5611
+ if (r.dispose) {
5612
+ var result = r.dispose.call(r.value);
5613
+ if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) {
5614
+ fail(e);
5615
+ return next();
5616
+ });
5617
+ } else s |= 1;
5618
+ } catch (e) {
5619
+ fail(e);
5620
+ }
5621
+ if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
5622
+ if (env.hasError) throw env.error;
5623
+ }
5624
+ return next();
5625
+ }
5626
+ function __rewriteRelativeImportExtension(path$2, preserveJsx) {
5627
+ if (typeof path$2 === "string" && /^\.\.?\//.test(path$2)) return path$2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) {
5628
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js";
5629
+ });
5630
+ return path$2;
5631
+ }
5632
+ var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
5633
+ var init_tslib_es6 = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.mjs": (() => {
5634
+ extendStatics = function(d, b) {
5635
+ extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d$1, b$1) {
5636
+ d$1.__proto__ = b$1;
5637
+ } || function(d$1, b$1) {
5638
+ for (var p in b$1) if (Object.prototype.hasOwnProperty.call(b$1, p)) d$1[p] = b$1[p];
5639
+ };
5640
+ return extendStatics(d, b);
5641
+ };
5642
+ __assign = function() {
5643
+ __assign = Object.assign || function __assign$1(t) {
5644
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5645
+ s = arguments[i];
5646
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
5647
+ }
5648
+ return t;
5649
+ };
5650
+ return __assign.apply(this, arguments);
5651
+ };
5652
+ __createBinding = Object.create ? (function(o, m, k, k2) {
5653
+ if (k2 === void 0) k2 = k;
5654
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5655
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
5656
+ enumerable: true,
5657
+ get: function() {
5658
+ return m[k];
5659
+ }
5660
+ };
5661
+ Object.defineProperty(o, k2, desc);
5662
+ }) : (function(o, m, k, k2) {
5663
+ if (k2 === void 0) k2 = k;
5664
+ o[k2] = m[k];
5665
+ });
5666
+ __setModuleDefault = Object.create ? (function(o, v) {
5667
+ Object.defineProperty(o, "default", {
5668
+ enumerable: true,
5669
+ value: v
5670
+ });
5671
+ }) : function(o, v) {
5672
+ o["default"] = v;
5673
+ };
5674
+ ownKeys = function(o) {
5675
+ ownKeys = Object.getOwnPropertyNames || function(o$1) {
5676
+ var ar = [];
5677
+ for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
5678
+ return ar;
5679
+ };
5680
+ return ownKeys(o);
5681
+ };
5682
+ _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
5683
+ var e = new Error(message);
5684
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
5685
+ };
5686
+ tslib_es6_default = {
5687
+ __extends,
5688
+ __assign,
5689
+ __rest,
5690
+ __decorate,
5691
+ __param,
5692
+ __esDecorate,
5693
+ __runInitializers,
5694
+ __propKey,
5695
+ __setFunctionName,
5696
+ __metadata,
5697
+ __awaiter,
5698
+ __generator,
5699
+ __createBinding,
5700
+ __exportStar,
5701
+ __values,
5702
+ __read,
5703
+ __spread,
5704
+ __spreadArrays,
5705
+ __spreadArray,
5706
+ __await,
5707
+ __asyncGenerator,
5708
+ __asyncDelegator,
5709
+ __asyncValues,
5710
+ __makeTemplateObject,
5711
+ __importStar,
5712
+ __importDefault,
5713
+ __classPrivateFieldGet,
5714
+ __classPrivateFieldSet,
5715
+ __classPrivateFieldIn,
5716
+ __addDisposableResource,
5717
+ __disposeResources,
5718
+ __rewriteRelativeImportExtension
5719
+ };
5720
+ }) });
5721
+
5722
+ //#endregion
5723
+ //#region ../../node_modules/.pnpm/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/randomUUID.js
5724
+ var require_randomUUID = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/randomUUID.js": ((exports) => {
5725
+ Object.defineProperty(exports, "__esModule", { value: true });
5726
+ const crypto_1 = (init_tslib_es6(), require_dist_cjs$13.__toCommonJS(tslib_es6_exports)).__importDefault(require("crypto"));
5727
+ exports.randomUUID = crypto_1.default.randomUUID.bind(crypto_1.default);
5728
+ }) });
5729
+
5730
+ //#endregion
5731
+ //#region ../../node_modules/.pnpm/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/index.js
5732
+ var require_dist_cjs$1 = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@smithy+uuid@1.1.2/node_modules/@smithy/uuid/dist-cjs/index.js": ((exports) => {
5733
+ var randomUUID = require_randomUUID();
5734
+ const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
5735
+ const v4 = () => {
5736
+ if (randomUUID.randomUUID) return randomUUID.randomUUID();
5737
+ const rnds = new Uint8Array(16);
5738
+ crypto.getRandomValues(rnds);
5739
+ rnds[6] = rnds[6] & 15 | 64;
5740
+ rnds[8] = rnds[8] & 63 | 128;
5741
+ 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]];
5742
+ };
5743
+ exports.v4 = v4;
5744
+ }) });
5745
+
5746
+ //#endregion
5747
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js
5748
+ var import_dist_cjs$10;
5749
+ var init_generateIdempotencyToken = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/generateIdempotencyToken.js": (() => {
5750
+ import_dist_cjs$10 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$1());
5751
+ }) });
5752
+
5753
+ //#endregion
5754
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js
5755
+ var LazyJsonString;
5756
+ var init_lazy_json = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js": (() => {
5757
+ LazyJsonString = function LazyJsonString$1(val) {
5758
+ return Object.assign(new String(val), {
5759
+ deserializeJSON() {
5760
+ return JSON.parse(String(val));
5761
+ },
5762
+ toString() {
5763
+ return String(val);
5764
+ },
5765
+ toJSON() {
5766
+ return String(val);
5767
+ }
5768
+ });
5769
+ };
5770
+ LazyJsonString.from = (object) => {
5771
+ if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) return object;
5772
+ else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) return LazyJsonString(String(object));
5773
+ return LazyJsonString(JSON.stringify(object));
5774
+ };
5775
+ LazyJsonString.fromObject = LazyJsonString.from;
5776
+ }) });
5777
+
5778
+ //#endregion
5779
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js
5780
+ function quoteHeader(part) {
5781
+ if (part.includes(",") || part.includes("\"")) part = `"${part.replace(/"/g, "\\\"")}"`;
5782
+ return part;
5783
+ }
5784
+ var init_quote_header = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js": (() => {}) });
5785
+
5786
+ //#endregion
5787
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js
5788
+ function range(v, min, max) {
5789
+ const _v = Number(v);
5790
+ if (_v < min || _v > max) throw new Error(`Value ${_v} out of range [${min}, ${max}]`);
5791
+ }
5792
+ var ddd, mmm, time, date, year, RFC3339_WITH_OFFSET, IMF_FIXDATE, RFC_850_DATE, ASC_TIME, months, _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime;
5793
+ var init_schema_date_utils = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js": (() => {
5794
+ ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;
5795
+ mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;
5796
+ time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`;
5797
+ date = `(\\d?\\d)`;
5798
+ year = `(\\d{4})`;
5799
+ 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])$/);
5800
+ IMF_FIXDATE = /* @__PURE__ */ new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);
5801
+ RFC_850_DATE = /* @__PURE__ */ new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`);
5802
+ ASC_TIME = /* @__PURE__ */ new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`);
5803
+ months = [
5804
+ "Jan",
5805
+ "Feb",
5806
+ "Mar",
5807
+ "Apr",
5808
+ "May",
5809
+ "Jun",
5810
+ "Jul",
5811
+ "Aug",
5812
+ "Sep",
5813
+ "Oct",
5814
+ "Nov",
5815
+ "Dec"
5816
+ ];
5817
+ _parseEpochTimestamp = (value) => {
5818
+ if (value == null) return;
5819
+ let num = NaN;
5820
+ if (typeof value === "number") num = value;
5821
+ else if (typeof value === "string") {
5822
+ if (!/^-?\d*\.?\d+$/.test(value)) throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);
5823
+ num = Number.parseFloat(value);
5824
+ } else if (typeof value === "object" && value.tag === 1) num = value.value;
5825
+ if (isNaN(num) || Math.abs(num) === Infinity) throw new TypeError("Epoch timestamps must be valid finite numbers.");
5826
+ return new Date(Math.round(num * 1e3));
5827
+ };
5828
+ _parseRfc3339DateTimeWithOffset = (value) => {
5829
+ if (value == null) return;
5830
+ if (typeof value !== "string") throw new TypeError("RFC3339 timestamps must be strings");
5831
+ const matches = RFC3339_WITH_OFFSET.exec(value);
5832
+ if (!matches) throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
5833
+ const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
5834
+ range(monthStr, 1, 12);
5835
+ range(dayStr, 1, 31);
5836
+ range(hours, 0, 23);
5837
+ range(minutes, 0, 59);
5838
+ range(seconds, 0, 60);
5839
+ const date$1 = 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));
5840
+ date$1.setUTCFullYear(Number(yearStr));
5841
+ if (offsetStr.toUpperCase() != "Z") {
5842
+ const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [
5843
+ void 0,
5844
+ "+",
5845
+ 0,
5846
+ 0
5847
+ ];
5848
+ const scalar = sign === "-" ? 1 : -1;
5849
+ date$1.setTime(date$1.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3));
5850
+ }
5851
+ return date$1;
5852
+ };
5853
+ _parseRfc7231DateTime = (value) => {
5854
+ if (value == null) return;
5855
+ if (typeof value !== "string") throw new TypeError("RFC7231 timestamps must be strings.");
5856
+ let day$1;
5857
+ let month;
5858
+ let year$2;
5859
+ let hour$1;
5860
+ let minute$1;
5861
+ let second;
5862
+ let fraction;
5863
+ let matches;
5864
+ if (matches = IMF_FIXDATE.exec(value)) [, day$1, month, year$2, hour$1, minute$1, second, fraction] = matches;
5865
+ else if (matches = RFC_850_DATE.exec(value)) {
5866
+ [, day$1, month, year$2, hour$1, minute$1, second, fraction] = matches;
5867
+ year$2 = (Number(year$2) + 1900).toString();
5868
+ } else if (matches = ASC_TIME.exec(value)) [, month, day$1, hour$1, minute$1, second, fraction, year$2] = matches;
5869
+ if (year$2 && second) {
5870
+ const timestamp = Date.UTC(Number(year$2), months.indexOf(month), Number(day$1), Number(hour$1), Number(minute$1), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1e3) : 0);
5871
+ range(day$1, 1, 31);
5872
+ range(hour$1, 0, 23);
5873
+ range(minute$1, 0, 59);
5874
+ range(second, 0, 60);
5875
+ const date$1 = new Date(timestamp);
5876
+ date$1.setUTCFullYear(Number(year$2));
5877
+ return date$1;
5878
+ }
5879
+ throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);
5880
+ };
5881
+ }) });
5882
+
5883
+ //#endregion
5884
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/split-every.js
5885
+ function splitEvery(value, delimiter, numDelimiters) {
5886
+ if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
5887
+ const segments = value.split(delimiter);
5888
+ if (numDelimiters === 1) return segments;
5889
+ const compoundSegments = [];
5890
+ let currentSegment = "";
5891
+ for (let i = 0; i < segments.length; i++) {
5892
+ if (currentSegment === "") currentSegment = segments[i];
5893
+ else currentSegment += delimiter + segments[i];
5894
+ if ((i + 1) % numDelimiters === 0) {
5895
+ compoundSegments.push(currentSegment);
5896
+ currentSegment = "";
5897
+ }
5898
+ }
5899
+ if (currentSegment !== "") compoundSegments.push(currentSegment);
5900
+ return compoundSegments;
5901
+ }
5902
+ var init_split_every = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/split-every.js": (() => {}) });
5903
+
5904
+ //#endregion
5905
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/split-header.js
5906
+ var splitHeader;
5907
+ var init_split_header = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/split-header.js": (() => {
5908
+ splitHeader = (value) => {
5909
+ const z = value.length;
5910
+ const values = [];
5911
+ let withinQuotes = false;
5912
+ let prevChar = void 0;
5913
+ let anchor = 0;
5914
+ for (let i = 0; i < z; ++i) {
5915
+ const char = value[i];
5916
+ switch (char) {
5917
+ case `"`:
5918
+ if (prevChar !== "\\") withinQuotes = !withinQuotes;
5919
+ break;
5920
+ case ",":
5921
+ if (!withinQuotes) {
5922
+ values.push(value.slice(anchor, i));
5923
+ anchor = i + 1;
5924
+ }
5925
+ break;
5926
+ default:
5927
+ }
5928
+ prevChar = char;
5929
+ }
5930
+ values.push(value.slice(anchor));
5931
+ return values.map((v) => {
5932
+ v = v.trim();
5933
+ const z$1 = v.length;
5934
+ if (z$1 < 2) return v;
5935
+ if (v[0] === `"` && v[z$1 - 1] === `"`) v = v.slice(1, z$1 - 1);
5936
+ return v.replace(/\\"/g, "\"");
5937
+ });
5938
+ };
5939
+ }) });
5940
+
5941
+ //#endregion
5942
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js
5943
+ var format, NumericValue;
5944
+ var init_NumericValue = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js": (() => {
5945
+ format = /^-?\d*(\.\d+)?$/;
5946
+ NumericValue = class NumericValue {
5947
+ string;
5948
+ type;
5949
+ constructor(string, type) {
5950
+ this.string = string;
5951
+ this.type = type;
5952
+ if (!format.test(string)) throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
5953
+ }
5954
+ toString() {
5955
+ return this.string;
5956
+ }
5957
+ static [Symbol.hasInstance](object) {
5958
+ if (!object || typeof object !== "object") return false;
5959
+ const _nv = object;
5960
+ return NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string);
5961
+ }
5962
+ };
5963
+ }) });
5964
+
5965
+ //#endregion
5966
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/index.js
5967
+ var init_serde = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/serde/index.js": (() => {
5968
+ init_copyDocumentWithTransform();
5969
+ init_date_utils();
5970
+ init_generateIdempotencyToken();
5971
+ init_lazy_json();
5972
+ init_parse_utils();
5973
+ init_quote_header();
5974
+ init_schema_date_utils();
5975
+ init_split_every();
5976
+ init_split_header();
5977
+ init_NumericValue();
5978
+ }) });
5979
+
5980
+ //#endregion
5981
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js
5982
+ var SerdeContext;
5983
+ var init_SerdeContext = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js": (() => {
5984
+ SerdeContext = class {
5985
+ serdeContext;
5986
+ setSerdeContext(serdeContext) {
5987
+ this.serdeContext = serdeContext;
5988
+ }
5989
+ };
5990
+ }) });
5991
+
5992
+ //#endregion
5993
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js
5994
+ var import_dist_cjs$9, HttpProtocol;
5995
+ var init_HttpProtocol = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js": (() => {
5996
+ init_schema();
5997
+ import_dist_cjs$9 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$8());
5998
+ init_SerdeContext();
5999
+ HttpProtocol = class extends SerdeContext {
6000
+ options;
6001
+ compositeErrorRegistry;
6002
+ constructor(options) {
6003
+ super();
6004
+ this.options = options;
6005
+ this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace);
6006
+ for (const etr of options.errorTypeRegistries ?? []) this.compositeErrorRegistry.copyFrom(etr);
6007
+ }
6008
+ getRequestType() {
6009
+ return import_dist_cjs$9.HttpRequest;
6010
+ }
6011
+ getResponseType() {
6012
+ return import_dist_cjs$9.HttpResponse;
6013
+ }
6014
+ setSerdeContext(serdeContext) {
6015
+ this.serdeContext = serdeContext;
6016
+ this.serializer.setSerdeContext(serdeContext);
6017
+ this.deserializer.setSerdeContext(serdeContext);
6018
+ if (this.getPayloadCodec()) this.getPayloadCodec().setSerdeContext(serdeContext);
6019
+ }
6020
+ updateServiceEndpoint(request, endpoint) {
6021
+ if ("url" in endpoint) {
6022
+ request.protocol = endpoint.url.protocol;
6023
+ request.hostname = endpoint.url.hostname;
6024
+ request.port = endpoint.url.port ? Number(endpoint.url.port) : void 0;
6025
+ request.path = endpoint.url.pathname;
6026
+ request.fragment = endpoint.url.hash || void 0;
6027
+ request.username = endpoint.url.username || void 0;
6028
+ request.password = endpoint.url.password || void 0;
6029
+ if (!request.query) request.query = {};
6030
+ for (const [k, v] of endpoint.url.searchParams.entries()) request.query[k] = v;
6031
+ if (endpoint.headers) for (const [name, values] of Object.entries(endpoint.headers)) request.headers[name] = values.join(", ");
6032
+ return request;
6033
+ } else {
6034
+ request.protocol = endpoint.protocol;
6035
+ request.hostname = endpoint.hostname;
6036
+ request.port = endpoint.port ? Number(endpoint.port) : void 0;
6037
+ request.path = endpoint.path;
6038
+ request.query = { ...endpoint.query };
6039
+ if (endpoint.headers) for (const [name, value] of Object.entries(endpoint.headers)) request.headers[name] = value;
6040
+ return request;
6041
+ }
6042
+ }
6043
+ setHostPrefix(request, operationSchema, input) {
6044
+ if (this.serdeContext?.disableHostPrefix) return;
6045
+ const inputNs = NormalizedSchema.of(operationSchema.input);
6046
+ const opTraits = translateTraits(operationSchema.traits ?? {});
6047
+ if (opTraits.endpoint) {
6048
+ let hostPrefix = opTraits.endpoint?.[0];
6049
+ if (typeof hostPrefix === "string") {
6050
+ const hostLabelInputs = [...inputNs.structIterator()].filter(([, member$1]) => member$1.getMergedTraits().hostLabel);
6051
+ for (const [name] of hostLabelInputs) {
6052
+ const replacement = input[name];
6053
+ if (typeof replacement !== "string") throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
6054
+ hostPrefix = hostPrefix.replace(`{${name}}`, replacement);
6055
+ }
6056
+ request.hostname = hostPrefix + request.hostname;
6057
+ }
6058
+ }
6059
+ }
6060
+ deserializeMetadata(output) {
6061
+ return {
6062
+ httpStatusCode: output.statusCode,
6063
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
6064
+ extendedRequestId: output.headers["x-amz-id-2"],
6065
+ cfId: output.headers["x-amz-cf-id"]
6066
+ };
6067
+ }
6068
+ async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
6069
+ return (await this.loadEventStreamCapability()).serializeEventStream({
6070
+ eventStream,
6071
+ requestSchema,
6072
+ initialRequest
6073
+ });
6074
+ }
6075
+ async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
6076
+ return (await this.loadEventStreamCapability()).deserializeEventStream({
6077
+ response,
6078
+ responseSchema,
6079
+ initialResponseContainer
6080
+ });
6081
+ }
6082
+ async loadEventStreamCapability() {
6083
+ const { EventStreamSerde } = await Promise.resolve().then(() => require("./event-streams-0D7SB645.cjs"));
6084
+ return new EventStreamSerde({
6085
+ marshaller: this.getEventStreamMarshaller(),
6086
+ serializer: this.serializer,
6087
+ deserializer: this.deserializer,
6088
+ serdeContext: this.serdeContext,
6089
+ defaultContentType: this.getDefaultContentType()
6090
+ });
6091
+ }
6092
+ getDefaultContentType() {
6093
+ throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
6094
+ }
6095
+ async deserializeHttpMessage(schema, context, response, arg4, arg5) {
6096
+ return [];
6097
+ }
6098
+ getEventStreamMarshaller() {
6099
+ const context = this.serdeContext;
6100
+ if (!context.eventStreamMarshaller) throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
6101
+ return context.eventStreamMarshaller;
6102
+ }
6103
+ };
6104
+ }) });
6105
+
6106
+ //#endregion
6107
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js
6108
+ var import_dist_cjs$7, import_dist_cjs$8, HttpBindingProtocol;
6109
+ var init_HttpBindingProtocol = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js": (() => {
6110
+ init_schema();
6111
+ init_serde();
6112
+ import_dist_cjs$7 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$8());
6113
+ import_dist_cjs$8 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$2());
6114
+ init_collect_stream_body();
6115
+ init_extended_encode_uri_component();
6116
+ init_HttpProtocol();
6117
+ HttpBindingProtocol = class extends HttpProtocol {
6118
+ async serializeRequest(operationSchema, _input, context) {
6119
+ const input = { ..._input ?? {} };
6120
+ const serializer = this.serializer;
6121
+ const query = {};
6122
+ const headers = {};
6123
+ const endpoint = await context.endpoint();
6124
+ const ns = NormalizedSchema.of(operationSchema?.input);
6125
+ const payloadMemberNames = [];
6126
+ const payloadMemberSchemas = [];
6127
+ let hasNonHttpBindingMember = false;
6128
+ let payload;
6129
+ const request = new import_dist_cjs$7.HttpRequest({
6130
+ protocol: "",
6131
+ hostname: "",
6132
+ port: void 0,
6133
+ path: "",
6134
+ fragment: void 0,
6135
+ query,
6136
+ headers,
6137
+ body: void 0
6138
+ });
6139
+ if (endpoint) {
6140
+ this.updateServiceEndpoint(request, endpoint);
6141
+ this.setHostPrefix(request, operationSchema, input);
6142
+ const opTraits = translateTraits(operationSchema.traits);
6143
+ if (opTraits.http) {
6144
+ request.method = opTraits.http[0];
6145
+ const [path$2, search] = opTraits.http[1].split("?");
6146
+ if (request.path == "/") request.path = path$2;
6147
+ else request.path += path$2;
6148
+ const traitSearchParams = new URLSearchParams(search ?? "");
6149
+ Object.assign(query, Object.fromEntries(traitSearchParams));
6150
+ }
6151
+ }
6152
+ for (const [memberName, memberNs] of ns.structIterator()) {
6153
+ const memberTraits = memberNs.getMergedTraits() ?? {};
6154
+ const inputMemberValue = input[memberName];
6155
+ if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
6156
+ if (memberTraits.httpLabel) {
6157
+ if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) throw new Error(`No value provided for input HTTP label: ${memberName}.`);
6158
+ }
6159
+ continue;
6160
+ }
6161
+ if (memberTraits.httpPayload) {
6162
+ if (memberNs.isStreaming()) if (memberNs.isStructSchema()) {
6163
+ if (input[memberName]) payload = await this.serializeEventStream({
6164
+ eventStream: input[memberName],
6165
+ requestSchema: ns
6166
+ });
6167
+ } else payload = inputMemberValue;
6168
+ else {
6169
+ serializer.write(memberNs, inputMemberValue);
6170
+ payload = serializer.flush();
6171
+ }
6172
+ delete input[memberName];
6173
+ } else if (memberTraits.httpLabel) {
6174
+ serializer.write(memberNs, inputMemberValue);
6175
+ const replacement = serializer.flush();
6176
+ if (request.path.includes(`{${memberName}+}`)) request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
6177
+ else if (request.path.includes(`{${memberName}}`)) request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
6178
+ delete input[memberName];
6179
+ } else if (memberTraits.httpHeader) {
6180
+ serializer.write(memberNs, inputMemberValue);
6181
+ headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
6182
+ delete input[memberName];
6183
+ } else if (typeof memberTraits.httpPrefixHeaders === "string") {
6184
+ for (const [key, val] of Object.entries(inputMemberValue)) {
6185
+ const amalgam = memberTraits.httpPrefixHeaders + key;
6186
+ serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
6187
+ headers[amalgam.toLowerCase()] = serializer.flush();
6188
+ }
6189
+ delete input[memberName];
6190
+ } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
6191
+ this.serializeQuery(memberNs, inputMemberValue, query);
6192
+ delete input[memberName];
6193
+ } else {
6194
+ hasNonHttpBindingMember = true;
6195
+ payloadMemberNames.push(memberName);
6196
+ payloadMemberSchemas.push(memberNs);
6197
+ }
6198
+ }
6199
+ if (hasNonHttpBindingMember && input) {
6200
+ const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
6201
+ const requiredMembers = ns.getSchema()[6];
6202
+ const payloadSchema = [
6203
+ 3,
6204
+ namespace,
6205
+ name,
6206
+ ns.getMergedTraits(),
6207
+ payloadMemberNames,
6208
+ payloadMemberSchemas,
6209
+ void 0
6210
+ ];
6211
+ if (requiredMembers) payloadSchema[6] = requiredMembers;
6212
+ else payloadSchema.pop();
6213
+ serializer.write(payloadSchema, input);
6214
+ payload = serializer.flush();
6215
+ }
6216
+ request.headers = headers;
6217
+ request.query = query;
6218
+ request.body = payload;
6219
+ return request;
6220
+ }
6221
+ serializeQuery(ns, data, query) {
6222
+ const serializer = this.serializer;
6223
+ const traits = ns.getMergedTraits();
6224
+ if (traits.httpQueryParams) {
6225
+ for (const [key, val] of Object.entries(data)) if (!(key in query)) {
6226
+ const valueSchema = ns.getValueSchema();
6227
+ Object.assign(valueSchema.getMergedTraits(), {
6228
+ ...traits,
6229
+ httpQuery: key,
6230
+ httpQueryParams: void 0
6231
+ });
6232
+ this.serializeQuery(valueSchema, val, query);
6233
+ }
6234
+ return;
6235
+ }
6236
+ if (ns.isListSchema()) {
6237
+ const sparse = !!ns.getMergedTraits().sparse;
6238
+ const buffer = [];
6239
+ for (const item of data) {
6240
+ serializer.write([ns.getValueSchema(), traits], item);
6241
+ const serializable = serializer.flush();
6242
+ if (sparse || serializable !== void 0) buffer.push(serializable);
6243
+ }
6244
+ query[traits.httpQuery] = buffer;
6245
+ } else {
6246
+ serializer.write([ns, traits], data);
6247
+ query[traits.httpQuery] = serializer.flush();
6248
+ }
6249
+ }
6250
+ async deserializeResponse(operationSchema, context, response) {
6251
+ const deserializer = this.deserializer;
6252
+ const ns = NormalizedSchema.of(operationSchema.output);
6253
+ const dataObject = {};
6254
+ if (response.statusCode >= 300) {
6255
+ const bytes = await collectBody(response.body, context);
6256
+ if (bytes.byteLength > 0) Object.assign(dataObject, await deserializer.read(15, bytes));
6257
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
6258
+ throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
6259
+ }
6260
+ for (const header in response.headers) {
6261
+ const value = response.headers[header];
6262
+ delete response.headers[header];
6263
+ response.headers[header.toLowerCase()] = value;
6264
+ }
6265
+ const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
6266
+ if (nonHttpBindingMembers.length) {
6267
+ const bytes = await collectBody(response.body, context);
6268
+ if (bytes.byteLength > 0) {
6269
+ const dataFromBody = await deserializer.read(ns, bytes);
6270
+ for (const member$1 of nonHttpBindingMembers) if (dataFromBody[member$1] != null) dataObject[member$1] = dataFromBody[member$1];
6271
+ }
6272
+ } else if (nonHttpBindingMembers.discardResponseBody) await collectBody(response.body, context);
6273
+ dataObject.$metadata = this.deserializeMetadata(response);
6274
+ return dataObject;
6275
+ }
6276
+ async deserializeHttpMessage(schema, context, response, arg4, arg5) {
6277
+ let dataObject;
6278
+ if (arg4 instanceof Set) dataObject = arg5;
6279
+ else dataObject = arg4;
6280
+ let discardResponseBody = true;
6281
+ const deserializer = this.deserializer;
6282
+ const ns = NormalizedSchema.of(schema);
6283
+ const nonHttpBindingMembers = [];
6284
+ for (const [memberName, memberSchema] of ns.structIterator()) {
6285
+ const memberTraits = memberSchema.getMemberTraits();
6286
+ if (memberTraits.httpPayload) {
6287
+ discardResponseBody = false;
6288
+ if (memberSchema.isStreaming()) if (memberSchema.isStructSchema()) dataObject[memberName] = await this.deserializeEventStream({
6289
+ response,
6290
+ responseSchema: ns
6291
+ });
6292
+ else dataObject[memberName] = (0, import_dist_cjs$8.sdkStreamMixin)(response.body);
6293
+ else if (response.body) {
6294
+ const bytes = await collectBody(response.body, context);
6295
+ if (bytes.byteLength > 0) dataObject[memberName] = await deserializer.read(memberSchema, bytes);
6296
+ }
6297
+ } else if (memberTraits.httpHeader) {
6298
+ const key = String(memberTraits.httpHeader).toLowerCase();
6299
+ const value = response.headers[key];
6300
+ if (null != value) if (memberSchema.isListSchema()) {
6301
+ const headerListValueSchema = memberSchema.getValueSchema();
6302
+ headerListValueSchema.getMergedTraits().httpHeader = key;
6303
+ let sections;
6304
+ if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) sections = splitEvery(value, ",", 2);
6305
+ else sections = splitHeader(value);
6306
+ const list = [];
6307
+ for (const section of sections) list.push(await deserializer.read(headerListValueSchema, section.trim()));
6308
+ dataObject[memberName] = list;
6309
+ } else dataObject[memberName] = await deserializer.read(memberSchema, value);
6310
+ } else if (memberTraits.httpPrefixHeaders !== void 0) {
6311
+ dataObject[memberName] = {};
6312
+ for (const [header, value] of Object.entries(response.headers)) if (header.startsWith(memberTraits.httpPrefixHeaders)) {
6313
+ const valueSchema = memberSchema.getValueSchema();
6314
+ valueSchema.getMergedTraits().httpHeader = header;
6315
+ dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
6316
+ }
6317
+ } else if (memberTraits.httpResponseCode) dataObject[memberName] = response.statusCode;
6318
+ else nonHttpBindingMembers.push(memberName);
6319
+ }
6320
+ nonHttpBindingMembers.discardResponseBody = discardResponseBody;
6321
+ return nonHttpBindingMembers;
6322
+ }
6323
+ };
6324
+ }) });
6325
+
6326
+ //#endregion
6327
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js
6328
+ var import_dist_cjs$6, RpcProtocol;
6329
+ var init_RpcProtocol = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js": (() => {
6330
+ init_schema();
6331
+ import_dist_cjs$6 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$8());
6332
+ init_collect_stream_body();
6333
+ init_HttpProtocol();
6334
+ RpcProtocol = class extends HttpProtocol {
6335
+ async serializeRequest(operationSchema, input, context) {
6336
+ const serializer = this.serializer;
6337
+ const query = {};
6338
+ const headers = {};
6339
+ const endpoint = await context.endpoint();
6340
+ const ns = NormalizedSchema.of(operationSchema?.input);
6341
+ const schema = ns.getSchema();
6342
+ let payload;
6343
+ const request = new import_dist_cjs$6.HttpRequest({
6344
+ protocol: "",
6345
+ hostname: "",
6346
+ port: void 0,
6347
+ path: "/",
6348
+ fragment: void 0,
6349
+ query,
6350
+ headers,
6351
+ body: void 0
6352
+ });
6353
+ if (endpoint) {
6354
+ this.updateServiceEndpoint(request, endpoint);
6355
+ this.setHostPrefix(request, operationSchema, input);
6356
+ }
6357
+ const _input = { ...input };
6358
+ if (input) {
6359
+ const eventStreamMember = ns.getEventStreamMember();
6360
+ if (eventStreamMember) {
6361
+ if (_input[eventStreamMember]) {
6362
+ const initialRequest = {};
6363
+ for (const [memberName, memberSchema] of ns.structIterator()) if (memberName !== eventStreamMember && _input[memberName]) {
6364
+ serializer.write(memberSchema, _input[memberName]);
6365
+ initialRequest[memberName] = serializer.flush();
6366
+ }
6367
+ payload = await this.serializeEventStream({
6368
+ eventStream: _input[eventStreamMember],
6369
+ requestSchema: ns,
6370
+ initialRequest
6371
+ });
6372
+ }
6373
+ } else {
6374
+ serializer.write(schema, _input);
6375
+ payload = serializer.flush();
6376
+ }
6377
+ }
6378
+ request.headers = Object.assign(request.headers, headers);
6379
+ request.query = query;
6380
+ request.body = payload;
6381
+ request.method = "POST";
6382
+ return request;
6383
+ }
6384
+ async deserializeResponse(operationSchema, context, response) {
6385
+ const deserializer = this.deserializer;
6386
+ const ns = NormalizedSchema.of(operationSchema.output);
6387
+ const dataObject = {};
6388
+ if (response.statusCode >= 300) {
6389
+ const bytes = await collectBody(response.body, context);
6390
+ if (bytes.byteLength > 0) Object.assign(dataObject, await deserializer.read(15, bytes));
6391
+ await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
6392
+ throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
6393
+ }
6394
+ for (const header in response.headers) {
6395
+ const value = response.headers[header];
6396
+ delete response.headers[header];
6397
+ response.headers[header.toLowerCase()] = value;
6398
+ }
6399
+ const eventStreamMember = ns.getEventStreamMember();
6400
+ if (eventStreamMember) dataObject[eventStreamMember] = await this.deserializeEventStream({
6401
+ response,
6402
+ responseSchema: ns,
6403
+ initialResponseContainer: dataObject
6404
+ });
6405
+ else {
6406
+ const bytes = await collectBody(response.body, context);
6407
+ if (bytes.byteLength > 0) Object.assign(dataObject, await deserializer.read(ns, bytes));
6408
+ }
6409
+ dataObject.$metadata = this.deserializeMetadata(response);
6410
+ return dataObject;
6411
+ }
6412
+ };
6413
+ }) });
6414
+
6415
+ //#endregion
6416
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js
6417
+ var resolvedPath;
6418
+ var init_resolve_path = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js": (() => {
6419
+ init_extended_encode_uri_component();
6420
+ resolvedPath = (resolvedPath$1, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
6421
+ if (input != null && input[memberName] !== void 0) {
6422
+ const labelValue = labelValueProvider();
6423
+ if (labelValue == null || labelValue.length <= 0) throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
6424
+ resolvedPath$1 = resolvedPath$1.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue));
6425
+ } else throw new Error("No value provided for input HTTP label: " + memberName + ".");
6426
+ return resolvedPath$1;
6427
+ };
6428
+ }) });
6429
+
6430
+ //#endregion
6431
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js
6432
+ function requestBuilder(input, context) {
6433
+ return new RequestBuilder(input, context);
6434
+ }
6435
+ var import_dist_cjs$5, RequestBuilder;
6436
+ var init_requestBuilder = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js": (() => {
6437
+ import_dist_cjs$5 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$8());
6438
+ init_resolve_path();
6439
+ RequestBuilder = class {
6440
+ input;
6441
+ context;
6442
+ query = {};
6443
+ method = "";
6444
+ headers = {};
6445
+ path = "";
6446
+ body = null;
6447
+ hostname = "";
6448
+ resolvePathStack = [];
6449
+ constructor(input, context) {
6450
+ this.input = input;
6451
+ this.context = context;
6452
+ }
6453
+ async build() {
6454
+ const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
6455
+ this.path = basePath;
6456
+ for (const resolvePath of this.resolvePathStack) resolvePath(this.path);
6457
+ return new import_dist_cjs$5.HttpRequest({
6458
+ protocol,
6459
+ hostname: this.hostname || hostname,
6460
+ port,
6461
+ method: this.method,
6462
+ path: this.path,
6463
+ query: this.query,
6464
+ body: this.body,
6465
+ headers: this.headers
6466
+ });
6467
+ }
6468
+ hn(hostname) {
6469
+ this.hostname = hostname;
6470
+ return this;
6471
+ }
6472
+ bp(uriLabel) {
6473
+ this.resolvePathStack.push((basePath) => {
6474
+ this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
6475
+ });
6476
+ return this;
6477
+ }
6478
+ p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
6479
+ this.resolvePathStack.push((path$2) => {
6480
+ this.path = resolvedPath(path$2, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
6481
+ });
6482
+ return this;
6483
+ }
6484
+ h(headers) {
6485
+ this.headers = headers;
6486
+ return this;
6487
+ }
6488
+ q(query) {
6489
+ this.query = query;
6490
+ return this;
6491
+ }
6492
+ b(body) {
6493
+ this.body = body;
6494
+ return this;
6495
+ }
6496
+ m(method) {
6497
+ this.method = method;
6498
+ return this;
6499
+ }
6500
+ };
6501
+ }) });
6502
+
6503
+ //#endregion
6504
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js
6505
+ function determineTimestampFormat(ns, settings) {
6506
+ if (settings.timestampFormat.useTrait) {
6507
+ if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) return ns.getSchema();
6508
+ }
6509
+ const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
6510
+ return (settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : void 0 : void 0) ?? settings.timestampFormat.default;
6511
+ }
6512
+ var init_determineTimestampFormat = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js": (() => {}) });
6513
+
6514
+ //#endregion
6515
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js
6516
+ var import_dist_cjs$3, import_dist_cjs$4, FromStringShapeDeserializer;
6517
+ var init_FromStringShapeDeserializer = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js": (() => {
6518
+ init_schema();
6519
+ init_serde();
6520
+ import_dist_cjs$3 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$10());
6521
+ import_dist_cjs$4 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$13.require_dist_cjs());
6522
+ init_SerdeContext();
6523
+ init_determineTimestampFormat();
6524
+ FromStringShapeDeserializer = class extends SerdeContext {
6525
+ settings;
6526
+ constructor(settings) {
6527
+ super();
6528
+ this.settings = settings;
6529
+ }
6530
+ read(_schema, data) {
6531
+ const ns = NormalizedSchema.of(_schema);
6532
+ if (ns.isListSchema()) return splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));
6533
+ if (ns.isBlobSchema()) return (this.serdeContext?.base64Decoder ?? import_dist_cjs$3.fromBase64)(data);
6534
+ if (ns.isTimestampSchema()) switch (determineTimestampFormat(ns, this.settings)) {
6535
+ case 5: return _parseRfc3339DateTimeWithOffset(data);
6536
+ case 6: return _parseRfc7231DateTime(data);
6537
+ case 7: return _parseEpochTimestamp(data);
6538
+ default:
6539
+ console.warn("Missing timestamp format, parsing value with Date constructor:", data);
6540
+ return new Date(data);
6541
+ }
6542
+ if (ns.isStringSchema()) {
6543
+ const mediaType = ns.getMergedTraits().mediaType;
6544
+ let intermediateValue = data;
6545
+ if (mediaType) {
6546
+ if (ns.getMergedTraits().httpHeader) intermediateValue = this.base64ToUtf8(intermediateValue);
6547
+ if (mediaType === "application/json" || mediaType.endsWith("+json")) intermediateValue = LazyJsonString.from(intermediateValue);
6548
+ return intermediateValue;
6549
+ }
6550
+ }
6551
+ if (ns.isNumericSchema()) return Number(data);
6552
+ if (ns.isBigIntegerSchema()) return BigInt(data);
6553
+ if (ns.isBigDecimalSchema()) return new NumericValue(data, "bigDecimal");
6554
+ if (ns.isBooleanSchema()) return String(data).toLowerCase() === "true";
6555
+ return data;
6556
+ }
6557
+ base64ToUtf8(base64String) {
6558
+ return (this.serdeContext?.utf8Encoder ?? import_dist_cjs$4.toUtf8)((this.serdeContext?.base64Decoder ?? import_dist_cjs$3.fromBase64)(base64String));
6559
+ }
6560
+ };
6561
+ }) });
6562
+
6563
+ //#endregion
6564
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js
6565
+ var import_dist_cjs$2, HttpInterceptingShapeDeserializer;
6566
+ var init_HttpInterceptingShapeDeserializer = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js": (() => {
6567
+ init_schema();
6568
+ import_dist_cjs$2 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$13.require_dist_cjs());
6569
+ init_SerdeContext();
6570
+ init_FromStringShapeDeserializer();
6571
+ HttpInterceptingShapeDeserializer = class extends SerdeContext {
6572
+ codecDeserializer;
6573
+ stringDeserializer;
6574
+ constructor(codecDeserializer, codecSettings) {
6575
+ super();
6576
+ this.codecDeserializer = codecDeserializer;
6577
+ this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);
6578
+ }
6579
+ setSerdeContext(serdeContext) {
6580
+ this.stringDeserializer.setSerdeContext(serdeContext);
6581
+ this.codecDeserializer.setSerdeContext(serdeContext);
6582
+ this.serdeContext = serdeContext;
6583
+ }
6584
+ read(schema, data) {
6585
+ const ns = NormalizedSchema.of(schema);
6586
+ const traits = ns.getMergedTraits();
6587
+ const toString = this.serdeContext?.utf8Encoder ?? import_dist_cjs$2.toUtf8;
6588
+ if (traits.httpHeader || traits.httpResponseCode) return this.stringDeserializer.read(ns, toString(data));
6589
+ if (traits.httpPayload) {
6590
+ if (ns.isBlobSchema()) {
6591
+ const toBytes = this.serdeContext?.utf8Decoder ?? import_dist_cjs$2.fromUtf8;
6592
+ if (typeof data === "string") return toBytes(data);
6593
+ return data;
6594
+ } else if (ns.isStringSchema()) {
6595
+ if ("byteLength" in data) return toString(data);
6596
+ return data;
6597
+ }
6598
+ }
6599
+ return this.codecDeserializer.read(ns, data);
6600
+ }
6601
+ };
6602
+ }) });
6603
+
6604
+ //#endregion
6605
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js
6606
+ var import_dist_cjs$1, ToStringShapeSerializer;
6607
+ var init_ToStringShapeSerializer = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js": (() => {
6608
+ init_schema();
6609
+ init_serde();
6610
+ import_dist_cjs$1 = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs$10());
6611
+ init_SerdeContext();
6612
+ init_determineTimestampFormat();
6613
+ ToStringShapeSerializer = class extends SerdeContext {
6614
+ settings;
6615
+ stringBuffer = "";
6616
+ constructor(settings) {
6617
+ super();
6618
+ this.settings = settings;
6619
+ }
6620
+ write(schema, value) {
6621
+ const ns = NormalizedSchema.of(schema);
6622
+ switch (typeof value) {
6623
+ case "object":
6624
+ if (value === null) {
6625
+ this.stringBuffer = "null";
6626
+ return;
6627
+ }
6628
+ if (ns.isTimestampSchema()) {
6629
+ if (!(value instanceof Date)) throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
6630
+ switch (determineTimestampFormat(ns, this.settings)) {
6631
+ case 5:
6632
+ this.stringBuffer = value.toISOString().replace(".000Z", "Z");
6633
+ break;
6634
+ case 6:
6635
+ this.stringBuffer = dateToUtcString(value);
6636
+ break;
6637
+ case 7:
6638
+ this.stringBuffer = String(value.getTime() / 1e3);
6639
+ break;
6640
+ default:
6641
+ console.warn("Missing timestamp format, using epoch seconds", value);
6642
+ this.stringBuffer = String(value.getTime() / 1e3);
6643
+ }
6644
+ return;
6645
+ }
6646
+ if (ns.isBlobSchema() && "byteLength" in value) {
6647
+ this.stringBuffer = (this.serdeContext?.base64Encoder ?? import_dist_cjs$1.toBase64)(value);
6648
+ return;
6649
+ }
6650
+ if (ns.isListSchema() && Array.isArray(value)) {
6651
+ let buffer = "";
6652
+ for (const item of value) {
6653
+ this.write([ns.getValueSchema(), ns.getMergedTraits()], item);
6654
+ const headerItem = this.flush();
6655
+ const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem);
6656
+ if (buffer !== "") buffer += ", ";
6657
+ buffer += serialized;
6658
+ }
6659
+ this.stringBuffer = buffer;
6660
+ return;
6661
+ }
6662
+ this.stringBuffer = JSON.stringify(value, null, 2);
6663
+ break;
6664
+ case "string":
6665
+ const mediaType = ns.getMergedTraits().mediaType;
6666
+ let intermediateValue = value;
6667
+ if (mediaType) {
6668
+ if (mediaType === "application/json" || mediaType.endsWith("+json")) intermediateValue = LazyJsonString.from(intermediateValue);
6669
+ if (ns.getMergedTraits().httpHeader) {
6670
+ this.stringBuffer = (this.serdeContext?.base64Encoder ?? import_dist_cjs$1.toBase64)(intermediateValue.toString());
6671
+ return;
6672
+ }
6673
+ }
6674
+ this.stringBuffer = value;
6675
+ break;
6676
+ default: if (ns.isIdempotencyToken()) this.stringBuffer = (0, import_dist_cjs$10.v4)();
6677
+ else this.stringBuffer = String(value);
6678
+ }
6679
+ }
6680
+ flush() {
6681
+ const buffer = this.stringBuffer;
6682
+ this.stringBuffer = "";
6683
+ return buffer;
6684
+ }
6685
+ };
6686
+ }) });
6687
+
6688
+ //#endregion
6689
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js
6690
+ var HttpInterceptingShapeSerializer;
6691
+ var init_HttpInterceptingShapeSerializer = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js": (() => {
6692
+ init_schema();
6693
+ init_ToStringShapeSerializer();
6694
+ HttpInterceptingShapeSerializer = class {
6695
+ codecSerializer;
6696
+ stringSerializer;
6697
+ buffer;
6698
+ constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) {
6699
+ this.codecSerializer = codecSerializer;
6700
+ this.stringSerializer = stringSerializer;
6701
+ }
6702
+ setSerdeContext(serdeContext) {
6703
+ this.codecSerializer.setSerdeContext(serdeContext);
6704
+ this.stringSerializer.setSerdeContext(serdeContext);
6705
+ }
6706
+ write(schema, value) {
6707
+ const ns = NormalizedSchema.of(schema);
6708
+ const traits = ns.getMergedTraits();
6709
+ if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {
6710
+ this.stringSerializer.write(ns, value);
6711
+ this.buffer = this.stringSerializer.flush();
6712
+ return;
6713
+ }
6714
+ return this.codecSerializer.write(ns, value);
6715
+ }
6716
+ flush() {
6717
+ if (this.buffer !== void 0) {
6718
+ const buffer = this.buffer;
6719
+ this.buffer = void 0;
6720
+ return buffer;
6721
+ }
6722
+ return this.codecSerializer.flush();
6723
+ }
6724
+ };
6725
+ }) });
6726
+
6727
+ //#endregion
6728
+ //#region ../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/index.js
6729
+ var protocols_exports = /* @__PURE__ */ require_dist_cjs$13.__export({
6730
+ FromStringShapeDeserializer: () => FromStringShapeDeserializer,
6731
+ HttpBindingProtocol: () => HttpBindingProtocol,
6732
+ HttpInterceptingShapeDeserializer: () => HttpInterceptingShapeDeserializer,
6733
+ HttpInterceptingShapeSerializer: () => HttpInterceptingShapeSerializer,
6734
+ HttpProtocol: () => HttpProtocol,
6735
+ RequestBuilder: () => RequestBuilder,
6736
+ RpcProtocol: () => RpcProtocol,
6737
+ SerdeContext: () => SerdeContext,
6738
+ ToStringShapeSerializer: () => ToStringShapeSerializer,
6739
+ collectBody: () => collectBody,
6740
+ determineTimestampFormat: () => determineTimestampFormat,
6741
+ extendedEncodeURIComponent: () => extendedEncodeURIComponent,
6742
+ requestBuilder: () => requestBuilder,
6743
+ resolvedPath: () => resolvedPath
6744
+ });
6745
+ var init_protocols = require_dist_cjs$13.__esm({ "../../node_modules/.pnpm/@smithy+core@3.23.11/node_modules/@smithy/core/dist-es/submodules/protocols/index.js": (() => {
6746
+ init_collect_stream_body();
6747
+ init_extended_encode_uri_component();
6748
+ init_HttpBindingProtocol();
6749
+ init_HttpProtocol();
6750
+ init_RpcProtocol();
6751
+ init_requestBuilder();
6752
+ init_resolve_path();
6753
+ init_FromStringShapeDeserializer();
6754
+ init_HttpInterceptingShapeDeserializer();
6755
+ init_HttpInterceptingShapeSerializer();
6756
+ init_ToStringShapeSerializer();
6757
+ init_determineTimestampFormat();
6758
+ init_SerdeContext();
6759
+ }) });
6760
+
6761
+ //#endregion
6762
+ //#region ../../node_modules/.pnpm/@aws-sdk+cloudfront-signer@3.1005.0/node_modules/@aws-sdk/cloudfront-signer/dist-cjs/index.js
6763
+ var require_dist_cjs = /* @__PURE__ */ require_dist_cjs$13.__commonJS({ "../../node_modules/.pnpm/@aws-sdk+cloudfront-signer@3.1005.0/node_modules/@aws-sdk/cloudfront-signer/dist-cjs/index.js": ((exports) => {
6764
+ var protocols = (init_protocols(), require_dist_cjs$13.__toCommonJS(protocols_exports));
6765
+ var node_crypto$1 = require("node:crypto");
6766
+ function getSignedUrl$1({ dateLessThan, dateGreaterThan, url, keyPairId, privateKey, ipAddress, policy, passphrase }) {
6767
+ const cloudfrontSignBuilder = new CloudfrontSignBuilder({
6768
+ keyPairId,
6769
+ privateKey,
6770
+ passphrase
6771
+ });
6772
+ if (!url && !policy) throw new Error("@aws-sdk/cloudfront-signer: Please provide 'url' or 'policy'.");
6773
+ if (policy) cloudfrontSignBuilder.setCustomPolicy(policy);
6774
+ else cloudfrontSignBuilder.setPolicyParameters({
6775
+ url,
6776
+ dateLessThan,
6777
+ dateGreaterThan,
6778
+ ipAddress
6779
+ });
6780
+ let baseUrl;
6781
+ if (url) baseUrl = url;
6782
+ else if (policy) {
6783
+ const resources = getPolicyResources(policy);
6784
+ if (!resources[0]) throw new Error("@aws-sdk/cloudfront-signer: No URL provided and unable to determine URL from first policy statement resource.");
6785
+ baseUrl = resources[0].replace("*://", "https://");
6786
+ }
6787
+ const startFlag = baseUrl.includes("?") ? "&" : "?";
6788
+ const params = Object.entries(cloudfrontSignBuilder.createCloudfrontAttribute()).filter(([, value]) => value !== void 0).map(([key, value]) => `${protocols.extendedEncodeURIComponent(key)}=${protocols.extendedEncodeURIComponent(value)}`).join("&");
6789
+ function encodeBaseUrlQuery(url$1) {
6790
+ if (url$1.includes("?")) {
6791
+ const [hostAndPath, query] = url$1.split("?");
6792
+ return `${hostAndPath}?${[...new URLSearchParams(query).entries()].map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")}`;
6793
+ }
6794
+ return url$1;
6795
+ }
6796
+ return getResource(encodeBaseUrlQuery(baseUrl) + startFlag + params);
6797
+ }
6798
+ function getPolicyResources(policy) {
6799
+ return ((typeof policy === "string" ? JSON.parse(policy) : policy)?.Statement ?? []).map((s) => s.Resource);
6800
+ }
6801
+ function getResource(urlString) {
6802
+ const protocol = urlString.slice(0, urlString.indexOf("//"));
6803
+ switch (protocol) {
6804
+ case "http:":
6805
+ case "https:":
6806
+ case "ws:":
6807
+ case "wss:": return urlString;
6808
+ case "rtmp:":
6809
+ const origin = `${protocol}//${new URL(urlString).hostname}`;
6810
+ return urlString.substring(origin.length).replace(/(?::\d+)?\//, "");
6811
+ default: throw new Error("Invalid URI scheme. Scheme must be one of http, https, or rtmp");
6812
+ }
6813
+ }
6814
+ var CloudfrontSignBuilder = class {
2984
6815
  keyPairId;
2985
6816
  privateKey;
2986
6817
  passphrase;
@@ -3047,12 +6878,12 @@ var require_dist_cjs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
3047
6878
  else throw new Error(`${errMessage}.`);
3048
6879
  }
3049
6880
  }
3050
- epochTime(date) {
3051
- return Math.round(date.getTime() / 1e3);
6881
+ epochTime(date$1) {
6882
+ return Math.round(date$1.getTime() / 1e3);
3052
6883
  }
3053
- parseDate(date) {
3054
- if (!date) return;
3055
- const parsedDate = new Date(date);
6884
+ parseDate(date$1) {
6885
+ if (!date$1) return;
6886
+ const parsedDate = new Date(date$1);
3056
6887
  return isNaN(parsedDate.getTime()) ? void 0 : this.epochTime(parsedDate);
3057
6888
  }
3058
6889
  parseDateWindow(expiration, start) {
@@ -3064,7 +6895,7 @@ var require_dist_cjs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
3064
6895
  };
3065
6896
  }
3066
6897
  signData(data, privateKey, passphrase) {
3067
- const sign = (0, import_crypto.createSign)("RSA-SHA1");
6898
+ const sign = node_crypto$1.createSign("RSA-SHA1");
3068
6899
  sign.update(data);
3069
6900
  return sign.sign({
3070
6901
  key: privateKey,
@@ -3080,7 +6911,7 @@ var require_dist_cjs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
3080
6911
  }
3081
6912
  setPolicyParameters({ url, dateLessThan, dateGreaterThan, ipAddress }) {
3082
6913
  if (!url || !dateLessThan) return false;
3083
- const resource = getResource(new URL(url));
6914
+ const resource = getResource(url);
3084
6915
  const parsedDates = this.parseDateWindow(dateLessThan, dateGreaterThan);
3085
6916
  this.dateLessThan = parsedDates.dateLessThan;
3086
6917
  this.customPolicy = Boolean(parsedDates.dateGreaterThan) || Boolean(ipAddress);
@@ -3102,11 +6933,12 @@ var require_dist_cjs = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/
3102
6933
  };
3103
6934
  }
3104
6935
  };
6936
+ exports.getSignedUrl = getSignedUrl$1;
3105
6937
  }) });
3106
6938
 
3107
6939
  //#endregion
3108
6940
  //#region lambda/withSignedUrl.ts
3109
- var import_dist_cjs = /* @__PURE__ */ __toESM$1(require_dist_cjs(), 1);
6941
+ var import_dist_cjs = /* @__PURE__ */ require_dist_cjs$13.__toESM(require_dist_cjs(), 1);
3110
6942
  /**
3111
6943
  * Creates a CloudFront signed URL based on the provided update information.
3112
6944
  *