@assinafy/cli 2.8.0 → 2.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.en.md +61 -59
  2. package/README.md +29 -23
  3. package/THIRD_PARTY_NOTICES.md +8 -8
  4. package/dist/api.cjs +199 -47
  5. package/dist/api.cjs.map +1 -1
  6. package/dist/api.js +197 -47
  7. package/dist/api.js.map +1 -1
  8. package/dist/cli.cjs +1388 -532
  9. package/dist/types/api/client.d.ts +2 -0
  10. package/dist/types/api/client.d.ts.map +1 -1
  11. package/dist/types/api/index.d.ts +1 -0
  12. package/dist/types/api/index.d.ts.map +1 -1
  13. package/dist/types/api/resources/assignments.d.ts +7 -1
  14. package/dist/types/api/resources/assignments.d.ts.map +1 -1
  15. package/dist/types/api/resources/documents.d.ts +5 -1
  16. package/dist/types/api/resources/documents.d.ts.map +1 -1
  17. package/dist/types/api/resources/envelopes.d.ts +7 -1
  18. package/dist/types/api/resources/envelopes.d.ts.map +1 -1
  19. package/dist/types/api/resources/scheduled-sends.d.ts +11 -0
  20. package/dist/types/api/resources/scheduled-sends.d.ts.map +1 -0
  21. package/dist/types/api/types.d.ts +35 -1
  22. package/dist/types/api/types.d.ts.map +1 -1
  23. package/dist/types/api/utils.d.ts +3 -0
  24. package/dist/types/api/utils.d.ts.map +1 -1
  25. package/docs/README.md +2 -0
  26. package/docs/api-operations-staging.json +1262 -0
  27. package/docs/api-operations.json +1 -1
  28. package/docs/api-reference-staging.md +18466 -0
  29. package/docs/api-reference.md +34 -7
  30. package/docs/assignments.md +46 -0
  31. package/docs/documents.md +31 -0
  32. package/docs/envelopes.md +29 -0
  33. package/docs/scheduled-sends.md +63 -0
  34. package/docs/sdk-reference.md +64 -2
  35. package/install.ps1 +1 -1
  36. package/install.sh +1 -1
  37. package/package.json +4 -4
package/dist/cli.cjs CHANGED
@@ -47,13 +47,13 @@ var require_picocolors = __commonJS({
47
47
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
48
48
  };
49
49
  var replaceClose = (string, close, replace, index) => {
50
- let result = "", cursor3 = 0;
50
+ let result = "", cursor2 = 0;
51
51
  do {
52
- result += string.substring(cursor3, index) + replace;
53
- cursor3 = index + close.length;
54
- index = string.indexOf(close, cursor3);
52
+ result += string.substring(cursor2, index) + replace;
53
+ cursor2 = index + close.length;
54
+ index = string.indexOf(close, cursor2);
55
55
  } while (~index);
56
- return result + string.substring(cursor3);
56
+ return result + string.substring(cursor2);
57
57
  };
58
58
  var createColors = (enabled = isColorSupported) => {
59
59
  let f = enabled ? formatter : () => String;
@@ -10802,8 +10802,8 @@ var require_browser = __commonJS({
10802
10802
  if (!this.useColors) {
10803
10803
  return;
10804
10804
  }
10805
- const c = "color: " + this.color;
10806
- args.splice(1, 0, c, "color: inherit");
10805
+ const c2 = "color: " + this.color;
10806
+ args.splice(1, 0, c2, "color: inherit");
10807
10807
  let index = 0;
10808
10808
  let lastC = 0;
10809
10809
  args[0].replace(/%[a-zA-Z%]/g, (match) => {
@@ -10815,7 +10815,7 @@ var require_browser = __commonJS({
10815
10815
  lastC = index;
10816
10816
  }
10817
10817
  });
10818
- args.splice(lastC, 0, c);
10818
+ args.splice(lastC, 0, c2);
10819
10819
  }
10820
10820
  exports2.log = console.debug || console.log || (() => {
10821
10821
  });
@@ -10985,8 +10985,8 @@ var require_node = __commonJS({
10985
10985
  function formatArgs(args) {
10986
10986
  const { namespace: name, useColors: useColors2 } = this;
10987
10987
  if (useColors2) {
10988
- const c = this.color;
10989
- const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
10988
+ const c2 = this.color;
10989
+ const colorCode = "\x1B[3" + (c2 < 8 ? c2 : "8;5;" + c2);
10990
10990
  const prefix = ` ${colorCode};1m${name} \x1B[0m`;
10991
10991
  args[0] = prefix + args[0].split("\n").join("\n" + prefix);
10992
10992
  args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
@@ -11085,7 +11085,7 @@ var require_src2 = __commonJS({
11085
11085
  const { stack } = new Error();
11086
11086
  if (typeof stack !== "string")
11087
11087
  return false;
11088
- return stack.split("\n").some((l2) => l2.indexOf("(https.js:") !== -1 || l2.indexOf("node:https:") !== -1);
11088
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
11089
11089
  }
11090
11090
  function createAgent(callback, opts) {
11091
11091
  return new createAgent.Agent(callback, opts);
@@ -12031,62 +12031,6 @@ var require_follow_redirects = __commonJS({
12031
12031
  }
12032
12032
  });
12033
12033
 
12034
- // node_modules/sisteransi/src/index.js
12035
- var require_src3 = __commonJS({
12036
- "node_modules/sisteransi/src/index.js"(exports2, module2) {
12037
- "use strict";
12038
- var ESC2 = "\x1B";
12039
- var CSI2 = `${ESC2}[`;
12040
- var beep = "\x07";
12041
- var cursor3 = {
12042
- to(x, y) {
12043
- if (!y) return `${CSI2}${x + 1}G`;
12044
- return `${CSI2}${y + 1};${x + 1}H`;
12045
- },
12046
- move(x, y) {
12047
- let ret = "";
12048
- if (x < 0) ret += `${CSI2}${-x}D`;
12049
- else if (x > 0) ret += `${CSI2}${x}C`;
12050
- if (y < 0) ret += `${CSI2}${-y}A`;
12051
- else if (y > 0) ret += `${CSI2}${y}B`;
12052
- return ret;
12053
- },
12054
- up: (count = 1) => `${CSI2}${count}A`,
12055
- down: (count = 1) => `${CSI2}${count}B`,
12056
- forward: (count = 1) => `${CSI2}${count}C`,
12057
- backward: (count = 1) => `${CSI2}${count}D`,
12058
- nextLine: (count = 1) => `${CSI2}E`.repeat(count),
12059
- prevLine: (count = 1) => `${CSI2}F`.repeat(count),
12060
- left: `${CSI2}G`,
12061
- hide: `${CSI2}?25l`,
12062
- show: `${CSI2}?25h`,
12063
- save: `${ESC2}7`,
12064
- restore: `${ESC2}8`
12065
- };
12066
- var scroll = {
12067
- up: (count = 1) => `${CSI2}S`.repeat(count),
12068
- down: (count = 1) => `${CSI2}T`.repeat(count)
12069
- };
12070
- var erase3 = {
12071
- screen: `${CSI2}2J`,
12072
- up: (count = 1) => `${CSI2}1J`.repeat(count),
12073
- down: (count = 1) => `${CSI2}J`.repeat(count),
12074
- line: `${CSI2}2K`,
12075
- lineEnd: `${CSI2}K`,
12076
- lineStart: `${CSI2}1K`,
12077
- lines(count) {
12078
- let clear = "";
12079
- for (let i2 = 0; i2 < count; i2++)
12080
- clear += this.line + (i2 < count - 1 ? cursor3.up() : "");
12081
- if (count)
12082
- clear += cursor3.left;
12083
- return clear;
12084
- }
12085
- };
12086
- module2.exports = { cursor: cursor3, scroll, erase: erase3, beep };
12087
- }
12088
- });
12089
-
12090
12034
  // node_modules/commander/lib/error.js
12091
12035
  var CommanderError = class extends Error {
12092
12036
  /**
@@ -12314,11 +12258,11 @@ var Help = class {
12314
12258
  visibleOptions.push(helpOption);
12315
12259
  } else if (helpOption.long && !removeLong) {
12316
12260
  visibleOptions.push(
12317
- cmd.createOption(helpOption.long, helpOption.description)
12261
+ cmd.createOption(helpOption.long, helpOption.description).helpGroup(helpOption.helpGroupHeading)
12318
12262
  );
12319
12263
  } else if (helpOption.short && !removeShort) {
12320
12264
  visibleOptions.push(
12321
- cmd.createOption(helpOption.short, helpOption.description)
12265
+ cmd.createOption(helpOption.short, helpOption.description).helpGroup(helpOption.helpGroupHeading)
12322
12266
  );
12323
12267
  }
12324
12268
  }
@@ -12850,7 +12794,7 @@ var Option = class {
12850
12794
  this.description = description || "";
12851
12795
  this.required = flags.includes("<");
12852
12796
  this.optional = flags.includes("[");
12853
- this.variadic = /\w\.\.\.[>\]]$/.test(flags);
12797
+ this.variadic = new RegExp("\\p{ID_Continue}\\.\\.\\.[>\\]]$", "u").test(flags);
12854
12798
  this.mandatory = false;
12855
12799
  const optionFlags = splitOptionFlags(flags);
12856
12800
  this.short = optionFlags.shortFlag;
@@ -14033,7 +13977,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
14033
13977
  getOptionValueSourceWithGlobals(key) {
14034
13978
  let source;
14035
13979
  this._getCommandAndAncestors().forEach((cmd) => {
14036
- if (cmd.getOptionValueSource(key) !== void 0) {
13980
+ if (Object.hasOwn(cmd._optionValueSources, key)) {
14037
13981
  source = cmd.getOptionValueSource(key);
14038
13982
  }
14039
13983
  });
@@ -14676,7 +14620,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
14676
14620
  return arg.length > 1 && arg[0] === "-";
14677
14621
  }
14678
14622
  const negativeNumberArg = (arg) => {
14679
- if (!/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(arg)) return false;
14623
+ if (!/^-(\d+|\d*\.\d+)([eE][+-]?\d+)?$/.test(arg)) return false;
14680
14624
  return !this._getCommandAndAncestors().some(
14681
14625
  (cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short))
14682
14626
  );
@@ -15124,7 +15068,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
15124
15068
  * (This does not override a group set directly on the subcommand using .helpGroup().)
15125
15069
  *
15126
15070
  * @example
15127
- * program.commandsGroup('Development Commands:);
15071
+ * program.commandsGroup('Development Commands:');
15128
15072
  * program.command('watch')...
15129
15073
  * program.command('lint')...
15130
15074
  * ...
@@ -15295,7 +15239,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
15295
15239
  * Pass in false to disable the built-in help option.
15296
15240
  *
15297
15241
  * @example
15298
- * program.helpOption('-?, --help' 'show help'); // customise
15242
+ * program.helpOption('-?, --help', 'show help'); // customise
15299
15243
  * program.helpOption(false); // disable
15300
15244
  *
15301
15245
  * @param {(string | boolean)} flags
@@ -15424,16 +15368,20 @@ function incrementNodeInspectorPort(args) {
15424
15368
  let debugHost = "127.0.0.1";
15425
15369
  let debugPort = "9229";
15426
15370
  let match;
15427
- if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
15371
+ if ((match = arg.match(/^(--inspect(-brk|-wait)?)$/)) !== null) {
15428
15372
  debugOption = match[1];
15429
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
15373
+ } else if ((match = arg.match(
15374
+ /^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+)$/
15375
+ )) !== null) {
15430
15376
  debugOption = match[1];
15431
15377
  if (/^\d+$/.test(match[3])) {
15432
15378
  debugPort = match[3];
15433
15379
  } else {
15434
15380
  debugHost = match[3];
15435
15381
  }
15436
- } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
15382
+ } else if ((match = arg.match(
15383
+ /^(--inspect(-brk|-port|-wait)?)=(\[[^\]]+\]|[^:]+):(\d+)$/
15384
+ )) !== null) {
15437
15385
  debugOption = match[1];
15438
15386
  debugHost = match[3];
15439
15387
  debugPort = match[4];
@@ -15580,10 +15528,16 @@ var isPlainObject = (val) => {
15580
15528
  return false;
15581
15529
  }
15582
15530
  const prototype2 = getPrototypeOf(val);
15583
- return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as
15584
- // evidence the value is tagged/iterable, while ignoring members reachable
15585
- // only through shared or terminal prototype boundaries.
15586
- !hasOwnInPrototypeChain(val, toStringTag) && !hasOwnInPrototypeChain(val, iterator);
15531
+ return (prototype2 === null || prototype2 === Object.prototype || getPrototypeOf(prototype2) === null) && // Treat own Symbol.toStringTag or Symbol.iterator members as evidence the
15532
+ // value is tagged/iterable, ignoring members reachable only through shared
15533
+ // or terminal prototype boundaries. This is exactly what
15534
+ // hasOwnInPrototypeChain(val, prop) computes here: every prototype admitted
15535
+ // above (null, Object.prototype, or a terminal null-prototype template) is
15536
+ // a boundary, so the walk never inspects anything but `val`'s own members,
15537
+ // and stops before even those when `val` is itself the boundary
15538
+ // Object.prototype. Checking that inline avoids allocating the walker's
15539
+ // `seen` list twice per call on the mergeConfig / merge hot path.
15540
+ (isPrototypeBoundary(val, prototype2, true) || !hasOwnProperty(val, toStringTag) && !hasOwnProperty(val, iterator));
15587
15541
  };
15588
15542
  var isEmptyObject = (val) => {
15589
15543
  if (!isObject(val) || isBuffer(val)) {
@@ -15639,12 +15593,12 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) {
15639
15593
  return;
15640
15594
  }
15641
15595
  let i2;
15642
- let l2;
15596
+ let l;
15643
15597
  if (typeof obj !== "object") {
15644
15598
  obj = [obj];
15645
15599
  }
15646
15600
  if (isArray(obj)) {
15647
- for (i2 = 0, l2 = obj.length; i2 < l2; i2++) {
15601
+ for (i2 = 0, l = obj.length; i2 < l; i2++) {
15648
15602
  fn.call(null, obj[i2], i2, obj);
15649
15603
  }
15650
15604
  } else {
@@ -15684,11 +15638,21 @@ var isContextDefined = (context) => !isUndefined(context) && context !== _global
15684
15638
  function merge(...objs) {
15685
15639
  const { caseless, skipUndefined } = isContextDefined(this) && this || {};
15686
15640
  const result = {};
15641
+ const lowerCaseKeys = caseless ? /* @__PURE__ */ Object.create(null) : null;
15687
15642
  const assignValue = (val, key) => {
15688
15643
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
15689
15644
  return;
15690
15645
  }
15691
- const targetKey = caseless && typeof key === "string" && findKey(result, key) || key;
15646
+ let targetKey = key;
15647
+ if (lowerCaseKeys && typeof key === "string") {
15648
+ const lowerKey = key.toLowerCase();
15649
+ const knownKey = lowerCaseKeys[lowerKey];
15650
+ if (knownKey !== void 0 && hasOwnProperty(result, knownKey)) {
15651
+ targetKey = knownKey;
15652
+ } else {
15653
+ lowerCaseKeys[lowerKey] = key;
15654
+ }
15655
+ }
15692
15656
  const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0;
15693
15657
  if (isPlainObject(existing) && isPlainObject(val)) {
15694
15658
  result[targetKey] = merge(existing, val);
@@ -15700,13 +15664,13 @@ function merge(...objs) {
15700
15664
  result[targetKey] = val;
15701
15665
  }
15702
15666
  };
15703
- for (let i2 = 0, l2 = objs.length; i2 < l2; i2++) {
15667
+ for (let i2 = 0, l = objs.length; i2 < l; i2++) {
15704
15668
  const source = objs[i2];
15705
15669
  if (!source || isBuffer(source)) {
15706
15670
  continue;
15707
15671
  }
15708
15672
  forEach(source, assignValue);
15709
- if (typeof source !== "object" || isArray(source)) {
15673
+ if (typeof source !== "object" || isArray(source) || !Object.getOwnPropertySymbols) {
15710
15674
  continue;
15711
15675
  }
15712
15676
  const symbols = Object.getOwnPropertySymbols(source);
@@ -15802,7 +15766,24 @@ var toArray = (thing) => {
15802
15766
  if (!thing) return null;
15803
15767
  if (isArray(thing)) return thing;
15804
15768
  let i2 = thing.length;
15805
- if (!isNumber(i2)) return null;
15769
+ if (!Number.isSafeInteger(i2) || i2 < 0 || i2 > 4294967295) return null;
15770
+ const indexes = /* @__PURE__ */ new Set();
15771
+ const seen = /* @__PURE__ */ new Set();
15772
+ let source = thing;
15773
+ while (source != null && indexes.size < i2) {
15774
+ if (seen.has(source)) return null;
15775
+ seen.add(source);
15776
+ const prototype2 = getPrototypeOf(source);
15777
+ if (isPrototypeBoundary(source, prototype2, source === thing)) break;
15778
+ Object.getOwnPropertyNames(source).forEach((key) => {
15779
+ const index = +key;
15780
+ if (Number.isInteger(index) && index >= 0 && index < i2 && String(index) === key && hasOwnProperty(source, key)) {
15781
+ indexes.add(index);
15782
+ }
15783
+ });
15784
+ source = prototype2;
15785
+ }
15786
+ if (indexes.size !== i2) return null;
15806
15787
  const arr = new Array(i2);
15807
15788
  while (i2-- > 0) {
15808
15789
  arr[i2] = thing[i2];
@@ -16034,7 +16015,7 @@ var ignoreDuplicateOf = utils_default.toObjectSet([
16034
16015
  "user-agent"
16035
16016
  ]);
16036
16017
  var parseHeaders_default = (rawHeaders) => {
16037
- const parsed = {};
16018
+ const parsed = /* @__PURE__ */ Object.create(null);
16038
16019
  let key;
16039
16020
  let val;
16040
16021
  let i2;
@@ -16202,9 +16183,11 @@ function parseParameters(value) {
16202
16183
  return parameters;
16203
16184
  }
16204
16185
  var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
16186
+ var PROTO_HEADER_SLOT = "__Proto__";
16187
+ var headerSlot = (name) => name === "__proto__" ? PROTO_HEADER_SLOT : name;
16205
16188
  function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
16206
16189
  if (utils_default.isFunction(filter2)) {
16207
- return filter2.call(this, value, header);
16190
+ return filter2.call(context, value, header);
16208
16191
  }
16209
16192
  if (isHeaderNameFilter) {
16210
16193
  value = header;
@@ -16249,7 +16232,7 @@ var AxiosHeaders = class {
16249
16232
  }
16250
16233
  const key = utils_default.findKey(self2, lHeader);
16251
16234
  if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
16252
- self2[key || _header] = normalizeValue(_value);
16235
+ self2[headerSlot(key || _header)] = normalizeValue(_value);
16253
16236
  }
16254
16237
  }
16255
16238
  const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
@@ -16342,7 +16325,7 @@ var AxiosHeaders = class {
16342
16325
  }
16343
16326
  normalize(format) {
16344
16327
  const self2 = this;
16345
- const headers = {};
16328
+ const headers = /* @__PURE__ */ Object.create(null);
16346
16329
  utils_default.forEach(this, (value, header) => {
16347
16330
  const key = utils_default.findKey(headers, header);
16348
16331
  if (key) {
@@ -16350,7 +16333,7 @@ var AxiosHeaders = class {
16350
16333
  delete self2[header];
16351
16334
  return;
16352
16335
  }
16353
- const normalized = format ? formatHeader(header) : String(header).trim();
16336
+ const normalized = headerSlot(format ? formatHeader(header) : String(header).trim());
16354
16337
  if (normalized !== header) {
16355
16338
  delete self2[header];
16356
16339
  }
@@ -16500,6 +16483,28 @@ function aggregateErrorMessage(error) {
16500
16483
  }).filter(Boolean).join("; ");
16501
16484
  return message || error.name || "AggregateError";
16502
16485
  }
16486
+ var CAUSED_BY_SEPARATOR = "\nCaused by: ";
16487
+ var $causeStack = /* @__PURE__ */ Symbol("causeStack");
16488
+ function getCauseStackIndex(error, stack) {
16489
+ const causeStack = utils_default.hasOwnProp(error, $causeStack) && error[$causeStack];
16490
+ return causeStack && stack.endsWith(causeStack) ? stack.length - causeStack.length : -1;
16491
+ }
16492
+ function appendCauseStack(target, source) {
16493
+ try {
16494
+ const sourceStack = source && source.stack;
16495
+ if (typeof sourceStack !== "string" || !sourceStack) {
16496
+ return;
16497
+ }
16498
+ const targetStack = target.stack;
16499
+ if (typeof targetStack !== "string" || !targetStack) {
16500
+ return;
16501
+ }
16502
+ const causeStack = CAUSED_BY_SEPARATOR + sourceStack;
16503
+ target.stack = targetStack + causeStack;
16504
+ Object.defineProperty(target, $causeStack, { __proto__: null, value: causeStack });
16505
+ } catch (e) {
16506
+ }
16507
+ }
16503
16508
  var AxiosError = class _AxiosError extends Error {
16504
16509
  static from(error, code, config, request, response, customProps) {
16505
16510
  let message = error.message;
@@ -16515,6 +16520,7 @@ var AxiosError = class _AxiosError extends Error {
16515
16520
  configurable: true
16516
16521
  });
16517
16522
  axiosError.name = error.name;
16523
+ appendCauseStack(axiosError, error);
16518
16524
  if (error.status != null && axiosError.status == null) {
16519
16525
  axiosError.status = error.status;
16520
16526
  }
@@ -16826,6 +16832,12 @@ function trimHandlers(handlers) {
16826
16832
  handlers.pop();
16827
16833
  }
16828
16834
  }
16835
+ function normalizeHandlerId(id) {
16836
+ if (typeof id === "string" && id !== "" && String(Number(id)) === id) {
16837
+ return Number(id);
16838
+ }
16839
+ return id;
16840
+ }
16829
16841
  function syncHandlerEntries(manager, internals) {
16830
16842
  const handlers = manager.handlers;
16831
16843
  const length = countHandlers(handlers);
@@ -16896,9 +16908,10 @@ var InterceptorManager = class {
16896
16908
  eject(id) {
16897
16909
  const internals = this[$internals2];
16898
16910
  syncHandlerEntries(this, internals);
16899
- const entry = internals.handlerEntries.get(id);
16911
+ const handlerId = normalizeHandlerId(id);
16912
+ const entry = internals.handlerEntries.get(handlerId);
16900
16913
  if (entry) {
16901
- internals.handlerEntries.delete(id);
16914
+ internals.handlerEntries.delete(handlerId);
16902
16915
  if (this.handlers[entry.index] !== entry.handler) {
16903
16916
  return;
16904
16917
  }
@@ -16958,7 +16971,8 @@ var transitional_default = {
16958
16971
  clarifyTimeoutError: false,
16959
16972
  legacyInterceptorReqResOrdering: true,
16960
16973
  advertiseZstdAcceptEncoding: false,
16961
- validateStatusUndefinedResolves: true
16974
+ validateStatusUndefinedResolves: true,
16975
+ encodeBasicAuthUsername: false
16962
16976
  };
16963
16977
 
16964
16978
  // node_modules/axios/lib/platform/node/index.js
@@ -17068,6 +17082,24 @@ function arrayToObject(arr) {
17068
17082
  }
17069
17083
  return obj;
17070
17084
  }
17085
+ function normalizeArray(value) {
17086
+ if (!utils_default.isArray(value)) return value;
17087
+ const keys = Object.keys(value);
17088
+ return keys.length !== value.length || keys.some((key, index) => key !== String(index)) ? arrayToObject(value) : value;
17089
+ }
17090
+ function normalizeArrays(obj) {
17091
+ const pending = [obj];
17092
+ while (pending.length) {
17093
+ const target = pending.pop();
17094
+ Object.keys(target).forEach((key) => {
17095
+ const value = target[key] = normalizeArray(target[key]);
17096
+ if (utils_default.isArray(value) || utils_default.isPlainObject(value)) {
17097
+ pending.push(value);
17098
+ }
17099
+ });
17100
+ }
17101
+ return obj;
17102
+ }
17071
17103
  function formDataToJSON(formData) {
17072
17104
  function buildPath(path6, value, target, index) {
17073
17105
  throwIfDepthExceeded(index);
@@ -17078,6 +17110,7 @@ function formDataToJSON(formData) {
17078
17110
  name = !name && utils_default.isArray(target) ? target.length : name;
17079
17111
  if (isLast) {
17080
17112
  if (utils_default.hasOwnProp(target, name)) {
17113
+ target[name] = normalizeArray(target[name]);
17081
17114
  target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value];
17082
17115
  } else {
17083
17116
  target[name] = value;
@@ -17098,7 +17131,7 @@ function formDataToJSON(formData) {
17098
17131
  utils_default.forEachEntry(formData, (name, value) => {
17099
17132
  buildPath(parsePropPath(name), value, obj, 0);
17100
17133
  });
17101
- return obj;
17134
+ return normalizeArrays(obj);
17102
17135
  }
17103
17136
  return null;
17104
17137
  }
@@ -17446,16 +17479,16 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
17446
17479
  var import_zlib = __toESM(require("zlib"), 1);
17447
17480
 
17448
17481
  // node_modules/axios/lib/env/data.js
17449
- var VERSION = "1.20.0";
17482
+ var VERSION = "1.21.0";
17450
17483
 
17451
17484
  // node_modules/axios/lib/helpers/parseProtocol.js
17452
17485
  function parseProtocol(url2) {
17453
17486
  const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url2);
17454
- return match && match[1] || "";
17487
+ return match && match[1].toLowerCase() || "";
17455
17488
  }
17456
17489
 
17457
17490
  // node_modules/axios/lib/helpers/fromDataURI.js
17458
- var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
17491
+ var DATA_URL_PATTERN = /^([^,;/]+\/[^,;/]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/i;
17459
17492
  function fromDataURI(uri, asBlob, options) {
17460
17493
  const _Blob = options && options.Blob || platform_default.classes.Blob;
17461
17494
  const protocol = parseProtocol(uri);
@@ -17478,7 +17511,10 @@ function fromDataURI(uri, asBlob, options) {
17478
17511
  } else if (params) {
17479
17512
  mime = "text/plain" + params;
17480
17513
  }
17481
- const buffer = encoding === "base64" ? Buffer.from(body, "base64") : Buffer.from(decodeURIComponent(body), encoding);
17514
+ const buffer = encoding === "base64" ? Buffer.from(
17515
+ body.replace(/%([\da-f]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))),
17516
+ "base64"
17517
+ ) : Buffer.from(decodeURIComponent(body), encoding);
17482
17518
  if (asBlob) {
17483
17519
  if (!_Blob) {
17484
17520
  throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
@@ -17564,7 +17600,10 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
17564
17600
  const timeWindow = internals.timeWindow;
17565
17601
  const divider = 1e3 / timeWindow;
17566
17602
  const bytesThreshold = maxRate / divider;
17567
- const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
17603
+ let minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
17604
+ if (maxRate) {
17605
+ minChunkSize = Math.min(bytesThreshold, minChunkSize);
17606
+ }
17568
17607
  const pushChunk = (_chunk, _callback) => {
17569
17608
  const bytes = Buffer.byteLength(_chunk);
17570
17609
  internals.bytesSeen += bytes;
@@ -17580,6 +17619,9 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
17580
17619
  }
17581
17620
  };
17582
17621
  const transformChunk = (_chunk, _callback) => {
17622
+ if (this.destroyed) {
17623
+ return _callback();
17624
+ }
17583
17625
  const chunkSize = Buffer.byteLength(_chunk);
17584
17626
  let chunkRemainder = null;
17585
17627
  let maxChunkSize = readableHighWaterMark;
@@ -17602,7 +17644,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
17602
17644
  }, timeWindow - passed);
17603
17645
  }
17604
17646
  if (bytesLeft < maxChunkSize) {
17605
- maxChunkSize = bytesLeft;
17647
+ maxChunkSize = Math.max(1, Math.floor(bytesLeft));
17606
17648
  }
17607
17649
  }
17608
17650
  if (maxChunkSize && chunkSize > maxChunkSize && chunkSize - maxChunkSize > minChunkSize) {
@@ -17660,9 +17702,9 @@ var CRLF_BYTES = textEncoder.encode(CRLF);
17660
17702
  var CRLF_BYTES_COUNT = 2;
17661
17703
  var FormDataPart = class {
17662
17704
  constructor(name, value) {
17663
- const { escapeName } = this.constructor;
17705
+ const { escapeName: escapeName2 } = this.constructor;
17664
17706
  const isStringValue = utils_default.isString(value);
17665
- let headers = `Content-Disposition: form-data; name="${escapeName(name)}"${!isStringValue && value.name ? `; filename="${escapeName(value.name)}"` : ""}${CRLF}`;
17707
+ let headers = `Content-Disposition: form-data; name="${escapeName2(name)}"${!isStringValue && value.name ? `; filename="${escapeName2(value.name)}"` : ""}${CRLF}`;
17666
17708
  if (isStringValue) {
17667
17709
  value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF));
17668
17710
  } else {
@@ -17823,7 +17865,7 @@ var Http2Sessions = class {
17823
17865
  timer = null;
17824
17866
  }
17825
17867
  stream4.once("close", () => {
17826
- if (!--streamsCount) {
17868
+ if (!--streamsCount && !removed) {
17827
17869
  timer = setTimeout(() => {
17828
17870
  timer = null;
17829
17871
  removeSession();
@@ -17835,6 +17877,7 @@ var Http2Sessions = class {
17835
17877
  }
17836
17878
  session2.once("close", removeSession);
17837
17879
  session2.once("error", removeSession);
17880
+ session2.once("goaway", removeSession);
17838
17881
  let entry = [session2, options];
17839
17882
  authoritySessions ? authoritySessions.push(entry) : authoritySessions = this.sessions[authority] = [entry];
17840
17883
  return session2;
@@ -17858,6 +17901,7 @@ var callbackify = (fn, reducer) => {
17858
17901
  var callbackify_default = callbackify;
17859
17902
 
17860
17903
  // node_modules/axios/lib/helpers/shouldBypassProxy.js
17904
+ var import_url2 = require("url");
17861
17905
  var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "0.0.0.0"]);
17862
17906
  var trimTrailingDots = (value) => {
17863
17907
  let end = value.length;
@@ -18051,7 +18095,20 @@ var normalizeNoProxyHost = (hostname) => {
18051
18095
  if (hostname.charAt(0) === "[" && hostname.charAt(hostname.length - 1) === "]") {
18052
18096
  hostname = hostname.slice(1, -1);
18053
18097
  }
18054
- const trimmed = trimTrailingDots(hostname);
18098
+ let trimmed = trimTrailingDots(hostname);
18099
+ if (trimmed.indexOf(":") !== -1) {
18100
+ try {
18101
+ trimmed = new URL("http://[" + trimmed + "]/").hostname.slice(1, -1);
18102
+ } catch (_err) {
18103
+ return trimmed;
18104
+ }
18105
+ } else if (/[\u0080-\uffff]/.test(trimmed)) {
18106
+ const prefix = /^[*.]+/.exec(trimmed);
18107
+ const start = prefix ? prefix[0] : "";
18108
+ const ascii = (0, import_url2.domainToASCII)(trimmed.slice(start.length));
18109
+ if (!ascii) return "";
18110
+ trimmed = start + trimTrailingDots(ascii);
18111
+ }
18055
18112
  const ipv4 = normalizeIPAddress(trimmed);
18056
18113
  if (ipv4 !== trimmed) {
18057
18114
  return ipv4;
@@ -18322,6 +18379,26 @@ var estimateBase64BufferAllocation = (body) => {
18322
18379
  }
18323
18380
  return Math.floor((len - padding) * 3 / 4);
18324
18381
  };
18382
+ var estimatePercentDecodedBase64BufferAllocation = (body) => {
18383
+ if (body.indexOf("%") === -1) {
18384
+ return estimateBase64BufferAllocation(body);
18385
+ }
18386
+ let length = 0;
18387
+ let previous = 0;
18388
+ let last = 0;
18389
+ for (let i2 = 0, len = body.length; i2 < len; i2++) {
18390
+ let code = body.charCodeAt(i2);
18391
+ if (code === 37 && isPercentEncodedByte(body, i2, len)) {
18392
+ code = hexValue(body.charCodeAt(i2 + 1)) * 16 + hexValue(body.charCodeAt(i2 + 2));
18393
+ i2 += 2;
18394
+ }
18395
+ length++;
18396
+ previous = last;
18397
+ last = code;
18398
+ }
18399
+ const padding = last === 61 ? previous === 61 ? 2 : 1 : 0;
18400
+ return Math.floor((length - padding) * 3 / 4);
18401
+ };
18325
18402
  var estimatePercentDecodedBase64Bytes = (body) => {
18326
18403
  const len = body.length;
18327
18404
  let significant = 0;
@@ -18351,28 +18428,28 @@ var estimatePercentDecodedBase64Bytes = (body) => {
18351
18428
  }
18352
18429
  return base64Bytes(significant);
18353
18430
  };
18354
- var estimateDataURLBytes = (url2, estimateBase64) => {
18431
+ var estimateDataURLBytes = (url2, estimateBase64, base64Pattern) => {
18355
18432
  if (!url2 || typeof url2 !== "string") return 0;
18356
- if (!url2.startsWith("data:")) return 0;
18433
+ if (!/^data:/i.test(url2)) return 0;
18357
18434
  const comma = url2.indexOf(",");
18358
18435
  if (comma < 0) return 0;
18359
18436
  const meta = url2.slice(5, comma);
18360
18437
  const body = url2.slice(comma + 1);
18361
- const isBase64 = /;base64/i.test(meta);
18438
+ const isBase64 = base64Pattern.test(meta);
18362
18439
  if (isBase64) {
18363
18440
  return estimateBase64(body);
18364
18441
  }
18365
18442
  let bytes = 0;
18366
18443
  for (let i2 = 0, len = body.length; i2 < len; i2++) {
18367
- const c = body.charCodeAt(i2);
18368
- if (c === 37 && isPercentEncodedByte(body, i2, len)) {
18444
+ const c2 = body.charCodeAt(i2);
18445
+ if (c2 === 37 && isPercentEncodedByte(body, i2, len)) {
18369
18446
  bytes += 1;
18370
18447
  i2 += 2;
18371
- } else if (c < 128) {
18448
+ } else if (c2 < 128) {
18372
18449
  bytes += 1;
18373
- } else if (c < 2048) {
18450
+ } else if (c2 < 2048) {
18374
18451
  bytes += 2;
18375
- } else if (c >= 55296 && c <= 56319 && i2 + 1 < len) {
18452
+ } else if (c2 >= 55296 && c2 <= 56319 && i2 + 1 < len) {
18376
18453
  const next = body.charCodeAt(i2 + 1);
18377
18454
  if (next >= 56320 && next <= 57343) {
18378
18455
  bytes += 4;
@@ -18390,11 +18467,12 @@ function estimateDataURLDecodedBytes(url2) {
18390
18467
  const fragmentIndex = typeof url2 === "string" ? url2.indexOf("#") : -1;
18391
18468
  return estimateDataURLBytes(
18392
18469
  fragmentIndex === -1 ? url2 : url2.slice(0, fragmentIndex),
18393
- estimatePercentDecodedBase64Bytes
18470
+ estimatePercentDecodedBase64Bytes,
18471
+ /; *base64[\t\n\f\r ]*$/i
18394
18472
  );
18395
18473
  }
18396
18474
  function estimateDataURLBufferAllocation(url2) {
18397
- return estimateDataURLBytes(url2, estimateBase64BufferAllocation);
18475
+ return estimateDataURLBytes(url2, estimatePercentDecodedBase64BufferAllocation, /;base64$/i);
18398
18476
  }
18399
18477
 
18400
18478
  // node_modules/axios/lib/adapters/http.js
@@ -18428,6 +18506,18 @@ function handleSocketError(err) {
18428
18506
  var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
18429
18507
  var tunnelingAgentCache = /* @__PURE__ */ new Map();
18430
18508
  var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
18509
+ var directAgents = /* @__PURE__ */ new WeakMap();
18510
+ var directAgentHooks = ["createConnection", "getName"];
18511
+ var nativeAgentPoolHooks = [
18512
+ "addRequest",
18513
+ "createSocket",
18514
+ "removeSocket",
18515
+ "keepSocketAlive",
18516
+ "reuseSocket",
18517
+ "_getSession",
18518
+ "_cacheSession",
18519
+ "_evictSession"
18520
+ ];
18431
18521
  var NODE_NATIVE_ENV_PROXY_SUPPORT = {
18432
18522
  22: 21,
18433
18523
  24: 5
@@ -18457,6 +18547,49 @@ function isNodeEnvProxyEnabled(agent, nodeVersion = process.versions && process.
18457
18547
  function getProxyEnvAgent(options, configHttpAgent, configHttpsAgent) {
18458
18548
  return isHttps.test(options.protocol) ? configHttpsAgent || import_https.default.globalAgent : configHttpAgent || import_http.default.globalAgent;
18459
18549
  }
18550
+ function getDirectAgent(configuredAgent, transport) {
18551
+ if (!process.allowedNodeEnvironmentFlags || !process.allowedNodeEnvironmentFlags.has("--use-env-proxy")) {
18552
+ return configuredAgent;
18553
+ }
18554
+ const agent = configuredAgent || transport.globalAgent;
18555
+ const options = agent && agent.options;
18556
+ if (!(agent instanceof transport.Agent) || agent.protocol !== transport.globalAgent.protocol || !options || !utils_default.hasOwnProp(options, "proxyEnv") || typeof options.proxyEnv !== "object" || options.proxyEnv === null) {
18557
+ return configuredAgent;
18558
+ }
18559
+ for (const hook of nativeAgentPoolHooks) {
18560
+ if (utils_default.isFunction(transport.Agent.prototype[hook]) && agent[hook] !== transport.Agent.prototype[hook]) {
18561
+ throw new AxiosError_default(
18562
+ "proxy: false cannot adapt an agent overriding " + hook + "; use an agent constructed without proxyEnv",
18563
+ AxiosError_default.ERR_BAD_OPTION_VALUE
18564
+ );
18565
+ }
18566
+ }
18567
+ let direct = directAgents.get(agent);
18568
+ if (!direct) {
18569
+ direct = new transport.Agent({ ...options, proxyEnv: void 0 });
18570
+ const destroy = agent.destroy;
18571
+ agent.destroy = function destroyWithDirectAgent() {
18572
+ try {
18573
+ return destroy.apply(this, arguments);
18574
+ } finally {
18575
+ direct.destroy();
18576
+ }
18577
+ };
18578
+ directAgents.set(agent, direct);
18579
+ }
18580
+ for (const hook of directAgentHooks) {
18581
+ direct[hook] = agent[hook] === transport.Agent.prototype[hook] ? transport.Agent.prototype[hook] : bind(agent[hook], agent);
18582
+ }
18583
+ return direct;
18584
+ }
18585
+ function setDirectAgent(options, configHttpAgent, configHttpsAgent) {
18586
+ const secure = isHttps.test(options.protocol);
18587
+ const agent = getDirectAgent(secure ? configHttpsAgent : configHttpAgent, secure ? import_https.default : import_http.default);
18588
+ options.agent = agent;
18589
+ if (options.agents) {
18590
+ options.agents[secure ? "https" : "http"] = agent;
18591
+ }
18592
+ }
18460
18593
  function getTunnelingAgent(agentOptions, userHttpsAgent) {
18461
18594
  const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
18462
18595
  const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache;
@@ -18464,13 +18597,12 @@ function getTunnelingAgent(agentOptions, userHttpsAgent) {
18464
18597
  if (agent) return agent;
18465
18598
  const merged = userHttpsAgent && userHttpsAgent.options ? { ...userHttpsAgent.options, ...agentOptions } : agentOptions;
18466
18599
  agent = new import_https_proxy_agent.default(merged);
18467
- if (userHttpsAgent && userHttpsAgent.options) {
18468
- const originTLSOptions = { ...userHttpsAgent.options };
18469
- const callback = agent.callback;
18470
- agent.callback = function axiosTunnelingAgentCallback(req, opts) {
18471
- return callback.call(this, req, { ...originTLSOptions, ...opts });
18472
- };
18473
- }
18600
+ const callback = agent.callback;
18601
+ agent.callback = function axiosTunnelingAgentCallback(req, opts) {
18602
+ const originTLSAgent = userHttpsAgent || import_https.default.globalAgent;
18603
+ const originTLSOptions = originTLSAgent && originTLSAgent.options;
18604
+ return callback.call(this, req, { ...originTLSOptions, ...opts });
18605
+ };
18474
18606
  agent[kAxiosInstalledTunnel] = true;
18475
18607
  cache.set(key, agent);
18476
18608
  return agent;
@@ -18494,6 +18626,10 @@ var flushOnFinish = (stream4, [throttled, flush]) => {
18494
18626
  };
18495
18627
  var http2Sessions = new Http2Sessions_default();
18496
18628
  function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
18629
+ if (!isSameOriginRedirect(options, requestDetails)) {
18630
+ stripMatchingHeaders(options.headers, /* @__PURE__ */ new Set(["authorization", "cookie"]));
18631
+ delete options.auth;
18632
+ }
18497
18633
  if (options.beforeRedirects.proxy) {
18498
18634
  options.beforeRedirects.proxy(options);
18499
18635
  }
@@ -18503,6 +18639,9 @@ function dispatchBeforeRedirect(options, responseDetails, requestDetails) {
18503
18639
  if (options.beforeRedirects.sensitiveHeaders) {
18504
18640
  options.beforeRedirects.sensitiveHeaders(options, requestDetails);
18505
18641
  }
18642
+ if (options.beforeRedirects.direct) {
18643
+ options.beforeRedirects.direct(options);
18644
+ }
18506
18645
  if (options.beforeRedirects.config) {
18507
18646
  options.beforeRedirects.config(options, responseDetails, requestDetails);
18508
18647
  }
@@ -18548,6 +18687,9 @@ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent,
18548
18687
  if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
18549
18688
  options.agent = void 0;
18550
18689
  }
18690
+ if (isRedirect && options.agents && options.agents.https && options.agents.https[kAxiosInstalledTunnel]) {
18691
+ options.agents.https = configHttpsAgent;
18692
+ }
18551
18693
  if (proxy) {
18552
18694
  const isProxyURL = proxy instanceof URL;
18553
18695
  const readProxyField = (key) => isProxyURL || utils_default.hasOwnProp(proxy, key) ? proxy[key] : void 0;
@@ -18728,9 +18870,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
18728
18870
  if (httpVersion === void 0) httpVersion = 1;
18729
18871
  const rawHttpVersion = httpVersion;
18730
18872
  let http2Options = own2("http2Options");
18873
+ const configProxy = own2("proxy");
18731
18874
  const httpAgent = own2("httpAgent");
18732
18875
  const httpsAgent = own2("httpsAgent");
18733
- const configProxy = own2("proxy");
18734
18876
  const responseType = own2("responseType");
18735
18877
  const responseEncoding = own2("responseEncoding");
18736
18878
  const socketPath = own2("socketPath");
@@ -18869,6 +19011,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
18869
19011
  } catch (err) {
18870
19012
  throw AxiosError_default.from(err, AxiosError_default.ERR_BAD_REQUEST, config);
18871
19013
  }
19014
+ if (maxContentLength > -1 && (responseType === "blob" ? convertedData.size : convertedData.length) > maxContentLength) {
19015
+ return reject(
19016
+ new AxiosError_default(
19017
+ "maxContentLength size of " + maxContentLength + " exceeded",
19018
+ AxiosError_default.ERR_BAD_RESPONSE,
19019
+ config
19020
+ )
19021
+ );
19022
+ }
18872
19023
  if (responseType === "text") {
18873
19024
  convertedData = convertedData.toString(responseEncoding);
18874
19025
  if (!responseEncoding || responseEncoding === "utf8") {
@@ -19071,9 +19222,13 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
19071
19222
  }
19072
19223
  let transport;
19073
19224
  let isNativeTransport = false;
19074
- let transportEnforcesMaxBodyLength = false;
19075
19225
  const isHttpsRequest = isHttps.test(options.protocol);
19076
- if (options.agent == null) {
19226
+ if (!isHttp2 && configProxy === false) {
19227
+ setDirectAgent(options, httpAgent, httpsAgent);
19228
+ options.beforeRedirects.direct = (redirectOptions) => {
19229
+ setDirectAgent(redirectOptions, httpAgent, httpsAgent);
19230
+ };
19231
+ } else if (options.agent == null) {
19077
19232
  options.agent = isHttpsRequest ? httpsAgent : httpAgent;
19078
19233
  }
19079
19234
  if (isHttp2) {
@@ -19095,7 +19250,6 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
19095
19250
  transport = isHttpsRequest ? import_https.default : import_http.default;
19096
19251
  isNativeTransport = true;
19097
19252
  } else {
19098
- transportEnforcesMaxBodyLength = true;
19099
19253
  options.sensitiveHeaders = [];
19100
19254
  if (maxRedirects) {
19101
19255
  options.maxRedirects = maxRedirects;
@@ -19381,7 +19535,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
19381
19535
  }
19382
19536
  });
19383
19537
  let uploadStream = data;
19384
- if (maxBodyLength > -1 && !transportEnforcesMaxBodyLength) {
19538
+ if (maxBodyLength > -1) {
19385
19539
  const limit = maxBodyLength;
19386
19540
  let bytesSent = 0;
19387
19541
  uploadStream = import_stream4.default.pipeline(
@@ -19418,16 +19572,14 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
19418
19572
  });
19419
19573
  };
19420
19574
 
19421
- // node_modules/axios/lib/helpers/isURLSameOrigin.js
19422
- var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url2) => {
19423
- url2 = new URL(url2, platform_default.origin);
19424
- return origin2.protocol === url2.protocol && origin2.host === url2.host && (isMSIE || origin2.port === url2.port);
19425
- })(
19426
- new URL(platform_default.origin),
19427
- platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent)
19428
- ) : () => true;
19429
-
19430
19575
  // node_modules/axios/lib/helpers/cookies.js
19576
+ var decodeCookieValue = (value) => {
19577
+ try {
19578
+ return decodeURIComponent(value);
19579
+ } catch (e) {
19580
+ return value;
19581
+ }
19582
+ };
19431
19583
  var cookies_default = platform_default.hasStandardBrowserEnv ? (
19432
19584
  // Standard browser envs support document.cookie
19433
19585
  {
@@ -19453,20 +19605,29 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? (
19453
19605
  },
19454
19606
  read(name) {
19455
19607
  if (typeof document === "undefined") return null;
19456
- const cookies = document.cookie.split(";");
19608
+ const cookieString = document.cookie;
19609
+ if (!cookieString) return null;
19610
+ const cookies = cookieString.split(";");
19457
19611
  for (let i2 = 0; i2 < cookies.length; i2++) {
19458
19612
  const cookie = cookies[i2].replace(/^\s+/, "");
19459
19613
  const eq = cookie.indexOf("=");
19460
19614
  if (eq !== -1 && cookie.slice(0, eq) === name) {
19461
- try {
19462
- return decodeURIComponent(cookie.slice(eq + 1));
19463
- } catch (e) {
19464
- return cookie.slice(eq + 1);
19465
- }
19615
+ return decodeCookieValue(cookie.slice(eq + 1));
19466
19616
  }
19467
19617
  }
19468
19618
  return null;
19469
19619
  },
19620
+ async readAsync(name) {
19621
+ try {
19622
+ const store = typeof window !== "undefined" && window.cookieStore;
19623
+ if (store && utils_default.isFunction(store.get)) {
19624
+ const cookie = await store.get(name);
19625
+ return cookie ? decodeCookieValue(cookie.value) : null;
19626
+ }
19627
+ } catch (e) {
19628
+ }
19629
+ return this.read(name);
19630
+ },
19470
19631
  remove(name) {
19471
19632
  this.write(name, "", Date.now() - 864e5, "/");
19472
19633
  }
@@ -19479,130 +19640,224 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? (
19479
19640
  read() {
19480
19641
  return null;
19481
19642
  },
19643
+ async readAsync() {
19644
+ return null;
19645
+ },
19482
19646
  remove() {
19483
19647
  }
19484
19648
  }
19485
19649
  );
19486
19650
 
19651
+ // node_modules/axios/lib/helpers/isURLSameOrigin.js
19652
+ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2) => (url2) => {
19653
+ url2 = new URL(url2, document.baseURI || platform_default.origin);
19654
+ return origin2.protocol === url2.protocol && origin2.host === url2.host && origin2.port === url2.port;
19655
+ })(new URL(platform_default.origin)) : () => true;
19656
+
19657
+ // node_modules/axios/lib/core/assertParamsAcyclic.js
19658
+ function assertParamsAcyclic(params) {
19659
+ const pending = [{ value: params }];
19660
+ const active = /* @__PURE__ */ new WeakSet();
19661
+ const visited = /* @__PURE__ */ new WeakSet();
19662
+ while (pending.length) {
19663
+ const { value, done } = pending.pop();
19664
+ if (!utils_default.isPlainObject(value) && !utils_default.isArray(value)) continue;
19665
+ if (done) {
19666
+ active.delete(value);
19667
+ continue;
19668
+ }
19669
+ if (active.has(value)) {
19670
+ throw new AxiosError_default(
19671
+ "Circular reference detected in params",
19672
+ AxiosError_default.ERR_BAD_OPTION_VALUE
19673
+ );
19674
+ }
19675
+ if (visited.has(value)) continue;
19676
+ visited.add(value);
19677
+ active.add(value);
19678
+ pending.push({ value, done: true });
19679
+ const keys = Object.keys(value);
19680
+ if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
19681
+ Object.getOwnPropertySymbols(value).forEach((key) => {
19682
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
19683
+ if (descriptor && descriptor.enumerable) keys.push(key);
19684
+ });
19685
+ }
19686
+ keys.forEach((key) => {
19687
+ if (key === "__proto__" || key === "constructor" || key === "prototype") {
19688
+ const descriptor = Object.getOwnPropertyDescriptor(value, key);
19689
+ if (descriptor && utils_default.hasOwnProp(descriptor, "value")) {
19690
+ pending.push({ value: descriptor.value });
19691
+ }
19692
+ } else {
19693
+ pending.push({ value: value[key] });
19694
+ }
19695
+ });
19696
+ }
19697
+ }
19698
+
19487
19699
  // node_modules/axios/lib/core/mergeConfig.js
19488
19700
  var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
19489
19701
  var ownEnumerableKeys = (thing) => {
19490
19702
  if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {
19491
19703
  return Object.keys(thing).concat(
19492
- Object.getOwnPropertySymbols(thing).filter(
19493
- (symbol2) => Object.getOwnPropertyDescriptor(thing, symbol2).enumerable
19494
- )
19704
+ Object.getOwnPropertySymbols(thing).filter((symbol2) => {
19705
+ const descriptor = Object.getOwnPropertyDescriptor(thing, symbol2);
19706
+ return descriptor && descriptor.enumerable;
19707
+ })
19495
19708
  );
19496
19709
  }
19497
19710
  return Object.keys(thing);
19498
19711
  };
19499
- function mergeConfig(config1, config2) {
19500
- config1 = config1 || {};
19501
- config2 = config2 || {};
19502
- const config = /* @__PURE__ */ Object.create(null);
19503
- Object.defineProperty(config, "hasOwnProperty", {
19504
- // Null-proto descriptor so a polluted Object.prototype.get cannot turn
19505
- // this data descriptor into an accessor descriptor on the way in.
19506
- __proto__: null,
19507
- value: Object.prototype.hasOwnProperty,
19508
- enumerable: false,
19509
- writable: true,
19510
- configurable: true
19511
- });
19512
- function getMergedValue(target, source, prop, caseless) {
19513
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
19514
- return utils_default.merge.call({ caseless }, target, source);
19515
- } else if (utils_default.isPlainObject(source)) {
19516
- return utils_default.merge({}, source);
19517
- } else if (utils_default.isArray(source)) {
19518
- return source.slice();
19519
- }
19520
- return source;
19712
+ function mergeParams(a2, b) {
19713
+ const pending = [];
19714
+ const copies = /* @__PURE__ */ new WeakMap();
19715
+ const empty = {};
19716
+ function copy(target, source) {
19717
+ if (!utils_default.isPlainObject(source)) {
19718
+ return utils_default.isArray(source) ? source.slice() : source;
19719
+ }
19720
+ const base = utils_default.isPlainObject(target) ? target : empty;
19721
+ let bases = copies.get(source);
19722
+ if (!bases) {
19723
+ bases = /* @__PURE__ */ new WeakMap();
19724
+ copies.set(source, bases);
19725
+ }
19726
+ if (bases.has(base)) return bases.get(base);
19727
+ const result2 = {};
19728
+ bases.set(base, result2);
19729
+ pending.push({ base, source, result: result2 });
19730
+ return result2;
19731
+ }
19732
+ const result = utils_default.isUndefined(b) ? copy(void 0, a2) : copy(a2, b);
19733
+ while (pending.length) {
19734
+ const { base, source, result: target } = pending.pop();
19735
+ const baseKeys = new Set(ownEnumerableKeys(base));
19736
+ const sourceKeys = new Set(ownEnumerableKeys(source));
19737
+ const keys = /* @__PURE__ */ new Set([...baseKeys, ...sourceKeys]);
19738
+ keys.forEach((key) => {
19739
+ if (key === "__proto__" || key === "constructor" || key === "prototype") return;
19740
+ const hasSource = sourceKeys.has(key);
19741
+ const value = hasSource ? source[key] : void 0;
19742
+ const previous = (!hasSource || utils_default.isPlainObject(value)) && baseKeys.has(key) ? base[key] : void 0;
19743
+ target[key] = hasSource ? copy(previous, value) : copy(void 0, previous);
19744
+ });
19521
19745
  }
19522
- function mergeDeepProperties(a2, b, prop, caseless) {
19523
- if (!utils_default.isUndefined(b)) {
19524
- return getMergedValue(a2, b, prop, caseless);
19525
- } else if (!utils_default.isUndefined(a2)) {
19526
- return getMergedValue(void 0, a2, prop, caseless);
19527
- }
19746
+ assertParamsAcyclic(result);
19747
+ return result;
19748
+ }
19749
+ function getMergedValue(target, source, prop, caseless) {
19750
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
19751
+ return utils_default.merge.call({ caseless }, target, source);
19752
+ } else if (utils_default.isPlainObject(source)) {
19753
+ return utils_default.merge({}, source);
19754
+ } else if (utils_default.isArray(source)) {
19755
+ return source.slice();
19756
+ }
19757
+ return source;
19758
+ }
19759
+ function mergeDeepProperties(a2, b, prop, caseless) {
19760
+ if (!utils_default.isUndefined(b)) {
19761
+ return getMergedValue(a2, b, prop, caseless);
19762
+ } else if (!utils_default.isUndefined(a2)) {
19763
+ return getMergedValue(void 0, a2, prop, caseless);
19528
19764
  }
19529
- function valueFromConfig2(a2, b) {
19530
- if (!utils_default.isUndefined(b)) {
19531
- return getMergedValue(void 0, b);
19532
- }
19765
+ }
19766
+ function valueFromConfig2(a2, b) {
19767
+ if (!utils_default.isUndefined(b)) {
19768
+ return getMergedValue(void 0, b);
19533
19769
  }
19534
- function defaultToConfig2(a2, b) {
19535
- if (!utils_default.isUndefined(b)) {
19536
- return getMergedValue(void 0, b);
19537
- } else if (!utils_default.isUndefined(a2)) {
19538
- return getMergedValue(void 0, a2);
19539
- }
19770
+ }
19771
+ function defaultToConfig2(a2, b) {
19772
+ if (!utils_default.isUndefined(b)) {
19773
+ return getMergedValue(void 0, b);
19774
+ } else if (!utils_default.isUndefined(a2)) {
19775
+ return getMergedValue(void 0, a2);
19540
19776
  }
19541
- function getMergedTransitionalOption(prop) {
19542
- const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
19543
- if (!utils_default.isUndefined(transitional2)) {
19544
- if (utils_default.isPlainObject(transitional2)) {
19545
- if (utils_default.hasOwnProp(transitional2, prop)) {
19546
- return transitional2[prop];
19547
- }
19548
- } else {
19549
- return void 0;
19777
+ }
19778
+ function getMergedTransitionalOption(config1, config2, prop) {
19779
+ const transitional2 = utils_default.hasOwnProp(config2, "transitional") ? config2.transitional : void 0;
19780
+ if (!utils_default.isUndefined(transitional2)) {
19781
+ if (utils_default.isPlainObject(transitional2)) {
19782
+ if (utils_default.hasOwnProp(transitional2, prop)) {
19783
+ return transitional2[prop];
19550
19784
  }
19785
+ } else {
19786
+ return void 0;
19551
19787
  }
19552
- const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
19553
- if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) {
19554
- return transitional1[prop];
19555
- }
19556
- return void 0;
19557
19788
  }
19558
- function mergeDirectKeys(a2, b, prop) {
19559
- if (utils_default.hasOwnProp(config2, prop)) {
19560
- return getMergedValue(a2, b);
19561
- } else if (utils_default.hasOwnProp(config1, prop)) {
19562
- return getMergedValue(void 0, a2);
19563
- }
19564
- }
19565
- const mergeMap = {
19566
- url: valueFromConfig2,
19567
- method: valueFromConfig2,
19568
- data: valueFromConfig2,
19569
- baseURL: defaultToConfig2,
19570
- transformRequest: defaultToConfig2,
19571
- transformResponse: defaultToConfig2,
19572
- paramsSerializer: defaultToConfig2,
19573
- timeout: defaultToConfig2,
19574
- timeoutErrorMessage: defaultToConfig2,
19575
- withCredentials: defaultToConfig2,
19576
- withXSRFToken: defaultToConfig2,
19577
- adapter: defaultToConfig2,
19578
- responseType: defaultToConfig2,
19579
- xsrfCookieName: defaultToConfig2,
19580
- xsrfHeaderName: defaultToConfig2,
19581
- onUploadProgress: defaultToConfig2,
19582
- onDownloadProgress: defaultToConfig2,
19583
- decompress: defaultToConfig2,
19584
- maxContentLength: defaultToConfig2,
19585
- maxBodyLength: defaultToConfig2,
19586
- beforeRedirect: defaultToConfig2,
19587
- transport: defaultToConfig2,
19588
- httpAgent: defaultToConfig2,
19589
- httpsAgent: defaultToConfig2,
19590
- cancelToken: defaultToConfig2,
19591
- socketPath: defaultToConfig2,
19592
- allowedSocketPaths: defaultToConfig2,
19593
- responseEncoding: defaultToConfig2,
19594
- validateStatus: mergeDirectKeys,
19595
- headers: (a2, b, prop) => mergeDeepProperties(headersToObject(a2), headersToObject(b), prop, true)
19596
- };
19597
- utils_default.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {
19598
- if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return;
19789
+ const transitional1 = utils_default.hasOwnProp(config1, "transitional") ? config1.transitional : void 0;
19790
+ if (utils_default.isPlainObject(transitional1) && utils_default.hasOwnProp(transitional1, prop)) {
19791
+ return transitional1[prop];
19792
+ }
19793
+ return void 0;
19794
+ }
19795
+ function mergeDirectKeys(a2, b, prop, config1, config2) {
19796
+ if (utils_default.hasOwnProp(config2, prop)) {
19797
+ return getMergedValue(a2, b);
19798
+ } else if (utils_default.hasOwnProp(config1, prop)) {
19799
+ return getMergedValue(void 0, a2);
19800
+ }
19801
+ }
19802
+ function mergeHeaders(a2, b, prop) {
19803
+ return mergeDeepProperties(headersToObject(a2), headersToObject(b), prop, true);
19804
+ }
19805
+ var hasOwnPropertyDescriptor = Object.freeze({
19806
+ __proto__: null,
19807
+ value: Object.prototype.hasOwnProperty,
19808
+ enumerable: false,
19809
+ writable: true,
19810
+ configurable: true
19811
+ });
19812
+ var mergeMap = {
19813
+ url: valueFromConfig2,
19814
+ method: valueFromConfig2,
19815
+ data: valueFromConfig2,
19816
+ baseURL: defaultToConfig2,
19817
+ transformRequest: defaultToConfig2,
19818
+ transformResponse: defaultToConfig2,
19819
+ params: mergeParams,
19820
+ paramsSerializer: defaultToConfig2,
19821
+ timeout: defaultToConfig2,
19822
+ timeoutErrorMessage: defaultToConfig2,
19823
+ withCredentials: defaultToConfig2,
19824
+ withXSRFToken: defaultToConfig2,
19825
+ adapter: defaultToConfig2,
19826
+ responseType: defaultToConfig2,
19827
+ xsrfCookieName: defaultToConfig2,
19828
+ xsrfHeaderName: defaultToConfig2,
19829
+ onUploadProgress: defaultToConfig2,
19830
+ onDownloadProgress: defaultToConfig2,
19831
+ decompress: defaultToConfig2,
19832
+ maxContentLength: defaultToConfig2,
19833
+ maxBodyLength: defaultToConfig2,
19834
+ beforeRedirect: defaultToConfig2,
19835
+ transport: defaultToConfig2,
19836
+ httpAgent: defaultToConfig2,
19837
+ httpsAgent: defaultToConfig2,
19838
+ cancelToken: defaultToConfig2,
19839
+ socketPath: defaultToConfig2,
19840
+ allowedSocketPaths: defaultToConfig2,
19841
+ responseEncoding: defaultToConfig2,
19842
+ validateStatus: mergeDirectKeys,
19843
+ headers: mergeHeaders
19844
+ };
19845
+ function mergeConfig(config1, config2) {
19846
+ config1 = config1 || {};
19847
+ config2 = config2 || {};
19848
+ const config = /* @__PURE__ */ Object.create(null);
19849
+ Object.defineProperty(config, "hasOwnProperty", hasOwnPropertyDescriptor);
19850
+ const keys = ownEnumerableKeys({ ...config1, ...config2 });
19851
+ for (let i2 = 0, len = keys.length; i2 < len; i2++) {
19852
+ const prop = keys[i2];
19853
+ if (prop === "__proto__" || prop === "constructor" || prop === "prototype") continue;
19599
19854
  const merge2 = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
19600
19855
  const a2 = utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0;
19601
19856
  const b = utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0;
19602
- const configValue = merge2(a2, b, prop);
19857
+ const configValue = merge2 === mergeDirectKeys ? merge2(a2, b, prop, config1, config2) : merge2(a2, b, prop);
19603
19858
  utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
19604
- });
19605
- if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption("validateStatusUndefinedResolves") === false) {
19859
+ }
19860
+ if (utils_default.hasOwnProp(config2, "validateStatus") && utils_default.isUndefined(config2.validateStatus) && getMergedTransitionalOption(config1, config2, "validateStatusUndefinedResolves") === false) {
19606
19861
  if (utils_default.hasOwnProp(config1, "validateStatus")) {
19607
19862
  config.validateStatus = getMergedValue(void 0, config1.validateStatus);
19608
19863
  } else {
@@ -19617,7 +19872,8 @@ var encodeUTF8 = (str) => encodeURIComponent(str).replace(
19617
19872
  /%([0-9A-F]{2})/gi,
19618
19873
  (_, hex) => String.fromCharCode(parseInt(hex, 16))
19619
19874
  );
19620
- function resolveConfig(config) {
19875
+ var readCookie = (name) => cookies_default.read(name);
19876
+ function resolveConfig(config, readXsrfCookie = readCookie) {
19621
19877
  const newConfig = mergeConfig({}, config);
19622
19878
  const own2 = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0;
19623
19879
  const data = own2("data");
@@ -19638,10 +19894,15 @@ function resolveConfig(config) {
19638
19894
  if (auth) {
19639
19895
  const username = utils_default.getSafeProp(auth, "username") || "";
19640
19896
  const password2 = utils_default.getSafeProp(auth, "password") || "";
19897
+ const transitional2 = own2("transitional");
19898
+ const encodeUsername = transitional2 && utils_default.hasOwnProp(transitional2, "encodeBasicAuthUsername") && transitional2.encodeBasicAuthUsername === true;
19641
19899
  try {
19642
19900
  headers.set(
19643
19901
  "Authorization",
19644
- "Basic " + btoa(username + ":" + (password2 ? encodeUTF8(password2) : ""))
19902
+ // Preserve legacy username bytes unless the caller opts in to UTF-8.
19903
+ "Basic " + btoa(
19904
+ (encodeUsername ? encodeUTF8(username) : username) + ":" + (password2 ? encodeUTF8(password2) : "")
19905
+ )
19645
19906
  );
19646
19907
  } catch (e) {
19647
19908
  throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_OPTION_VALUE, config);
@@ -19661,7 +19922,7 @@ function resolveConfig(config) {
19661
19922
  }
19662
19923
  const shouldSendXSRF = withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url);
19663
19924
  if (shouldSendXSRF) {
19664
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
19925
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && readXsrfCookie(xsrfCookieName);
19665
19926
  if (xsrfValue) {
19666
19927
  headers.set(xsrfHeaderName, xsrfValue);
19667
19928
  }
@@ -19675,16 +19936,50 @@ var resolveConfig_default = resolveConfig;
19675
19936
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
19676
19937
  var xhr_default = isXHRAdapterSupported && function(config) {
19677
19938
  return new Promise(function dispatchXhrRequest(resolve, reject) {
19678
- const _config = resolveConfig_default(config);
19939
+ let useAsyncXsrf;
19940
+ try {
19941
+ const store = platform_default.hasStandardBrowserEnv && typeof window !== "undefined" && window.cookieStore;
19942
+ useAsyncXsrf = store && utils_default.isFunction(store.get);
19943
+ } catch (e) {
19944
+ }
19945
+ let xsrfCookieName;
19946
+ const _config = resolveConfig_default(
19947
+ config,
19948
+ useAsyncXsrf ? (name) => {
19949
+ xsrfCookieName = name;
19950
+ return null;
19951
+ } : void 0
19952
+ );
19679
19953
  let requestData = _config.data;
19680
19954
  const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
19681
19955
  let { responseType, onUploadProgress, onDownloadProgress } = _config;
19682
19956
  let onCanceled;
19957
+ let timeoutId;
19683
19958
  let uploadThrottled, downloadThrottled;
19684
19959
  let flushUpload, flushDownload, flushDownloadWithEvent;
19685
19960
  function done() {
19686
- flushUpload && flushUpload();
19687
- flushDownload && flushDownload();
19961
+ clearTimeout(timeoutId);
19962
+ try {
19963
+ flushUpload && flushUpload();
19964
+ } catch (err) {
19965
+ setTimeout(() => {
19966
+ throw err;
19967
+ });
19968
+ }
19969
+ try {
19970
+ flushDownload && flushDownload();
19971
+ } catch (err) {
19972
+ setTimeout(() => {
19973
+ throw err;
19974
+ });
19975
+ }
19976
+ if (request) {
19977
+ downloadThrottled && request.removeEventListener("progress", downloadThrottled);
19978
+ if (request.upload) {
19979
+ uploadThrottled && request.upload.removeEventListener("progress", uploadThrottled);
19980
+ flushUpload && request.upload.removeEventListener("loadend", flushUpload);
19981
+ }
19982
+ }
19688
19983
  _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
19689
19984
  _config.signal && _config.signal.removeEventListener("abort", onCanceled);
19690
19985
  }
@@ -19770,6 +20065,7 @@ var xhr_default = isXHRAdapterSupported && function(config) {
19770
20065
  request = null;
19771
20066
  };
19772
20067
  request.ontimeout = function handleTimeout() {
20068
+ if (!request) return;
19773
20069
  let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
19774
20070
  const transitional2 = _config.transitional || transitional_default;
19775
20071
  if (_config.timeoutErrorMessage) {
@@ -19787,11 +20083,6 @@ var xhr_default = isXHRAdapterSupported && function(config) {
19787
20083
  request = null;
19788
20084
  };
19789
20085
  requestData === void 0 && requestHeaders.setContentType(null);
19790
- if ("setRequestHeader" in request) {
19791
- utils_default.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
19792
- request.setRequestHeader(key, val);
19793
- });
19794
- }
19795
20086
  if (!utils_default.isUndefined(_config.withCredentials)) {
19796
20087
  request.withCredentials = !!_config.withCredentials;
19797
20088
  }
@@ -19816,15 +20107,18 @@ var xhr_default = isXHRAdapterSupported && function(config) {
19816
20107
  return;
19817
20108
  }
19818
20109
  reject(!cancel2 || cancel2.type ? new CanceledError_default(null, config, request) : cancel2);
19819
- request.abort();
20110
+ const xhr = request;
19820
20111
  done();
19821
20112
  request = null;
20113
+ xhr.abort();
19822
20114
  };
19823
20115
  _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
20116
+ if (!request) return;
19824
20117
  if (_config.signal) {
19825
20118
  _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
19826
20119
  }
19827
20120
  }
20121
+ if (!request) return;
19828
20122
  const protocol = parseProtocol(_config.url);
19829
20123
  if (protocol && !platform_default.protocols.includes(protocol)) {
19830
20124
  reject(
@@ -19837,7 +20131,58 @@ var xhr_default = isXHRAdapterSupported && function(config) {
19837
20131
  done();
19838
20132
  return;
19839
20133
  }
19840
- request.send(requestData || null);
20134
+ const sendRequest = () => {
20135
+ if (!request) return;
20136
+ if ("setRequestHeader" in request) {
20137
+ utils_default.forEach(
20138
+ toByteStringHeaderObject(requestHeaders),
20139
+ function setRequestHeader(val, key) {
20140
+ request.setRequestHeader(key, val);
20141
+ }
20142
+ );
20143
+ }
20144
+ request.send(requestData || null);
20145
+ };
20146
+ if (xsrfCookieName) {
20147
+ const now = typeof performance !== "undefined" && utils_default.isFunction(performance.now) ? () => performance.now() : Date.now;
20148
+ const deadline = request.timeout > 0 ? now() + Number(request.timeout) : void 0;
20149
+ const abortOnTimeout = () => {
20150
+ if (!request) return;
20151
+ const xhr = request;
20152
+ xhr.ontimeout();
20153
+ xhr.abort();
20154
+ };
20155
+ if (deadline !== void 0) {
20156
+ const scheduleTimeout = () => {
20157
+ const remaining = deadline - now();
20158
+ if (remaining > 0) {
20159
+ timeoutId = setTimeout(scheduleTimeout, Math.min(remaining, 2147483647));
20160
+ } else {
20161
+ abortOnTimeout();
20162
+ }
20163
+ };
20164
+ scheduleTimeout();
20165
+ }
20166
+ cookies_default.readAsync(xsrfCookieName).then((value) => {
20167
+ if (!request) return;
20168
+ if (deadline !== void 0 && now() >= deadline) {
20169
+ abortOnTimeout();
20170
+ return;
20171
+ }
20172
+ if (value) {
20173
+ const headerName = utils_default.hasOwnProp(_config, "xsrfHeaderName") && _config.xsrfHeaderName;
20174
+ requestHeaders.set(headerName, value);
20175
+ }
20176
+ sendRequest();
20177
+ }).catch((error) => {
20178
+ if (!request) return;
20179
+ reject(AxiosError_default.from(error, null, config, request));
20180
+ done();
20181
+ request = null;
20182
+ });
20183
+ } else {
20184
+ sendRequest();
20185
+ }
19841
20186
  });
19842
20187
  };
19843
20188
 
@@ -19870,7 +20215,8 @@ var composeSignals = (signals, timeout) => {
19870
20215
  timer && clearTimeout(timer);
19871
20216
  timer = null;
19872
20217
  signals.forEach((signal2) => {
19873
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
20218
+ const unsubscribeSignal = utils_default.getSafeProp(signal2, "unsubscribe");
20219
+ utils_default.isFunction(unsubscribeSignal) ? unsubscribeSignal.call(signal2, onabort) : signal2.removeEventListener("abort", onabort);
19874
20220
  });
19875
20221
  signals = null;
19876
20222
  };
@@ -19970,6 +20316,110 @@ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
19970
20316
  );
19971
20317
  };
19972
20318
 
20319
+ // node_modules/axios/lib/helpers/formDataToBlob.js
20320
+ var CRLF2 = "\r\n";
20321
+ var normalizeLines = (value) => String(value).replace(/\r\n|\r|\n/g, CRLF2);
20322
+ var escapeName = (value) => String(value).replace(
20323
+ /[\r\n"]/g,
20324
+ (char) => char === "\r" ? "%0D" : char === "\n" ? "%0A" : "%22"
20325
+ );
20326
+ var stringBytes = (value, normalize) => {
20327
+ let length = 0;
20328
+ for (let i2 = 0; i2 < value.length; i2++) {
20329
+ const code = value.charCodeAt(i2);
20330
+ if (normalize && (code === 13 || code === 10)) {
20331
+ if (code === 13 && value.charCodeAt(i2 + 1) === 10) i2++;
20332
+ length += 2;
20333
+ } else if (code < 128) {
20334
+ length++;
20335
+ } else if (code < 2048) {
20336
+ length += 2;
20337
+ } else if (code >= 55296 && code <= 56319 && value.charCodeAt(i2 + 1) >= 56320 && value.charCodeAt(i2 + 1) <= 57343) {
20338
+ length += 4;
20339
+ i2++;
20340
+ } else {
20341
+ length += 3;
20342
+ }
20343
+ }
20344
+ return length;
20345
+ };
20346
+ var FormDataError = class extends TypeError {
20347
+ constructor(message, reason) {
20348
+ super(message);
20349
+ this.name = "FormDataError";
20350
+ this.reason = reason;
20351
+ }
20352
+ };
20353
+ function formDataToBlob(form, Blob2, limit, limitError, boundary) {
20354
+ if (!utils_default.isFunction(Blob2)) {
20355
+ throw new FormDataError("Blob is not supported", "blob");
20356
+ }
20357
+ if (!utils_default.isString(boundary) || !/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(boundary) || / $/.test(boundary)) {
20358
+ throw new FormDataError("Invalid multipart boundary", "boundary");
20359
+ }
20360
+ const footer = "--" + boundary + "--" + CRLF2;
20361
+ let length = footer.length;
20362
+ const parts = [];
20363
+ const checkLength = (extra) => {
20364
+ if (length + extra > limit) throw limitError();
20365
+ };
20366
+ checkLength(0);
20367
+ for (const [name, value] of form) {
20368
+ const isString2 = utils_default.isString(value);
20369
+ const valueLength = isString2 ? stringBytes(value, true) : value.size;
20370
+ if (!Number.isFinite(valueLength) || valueLength < 0) {
20371
+ throw new FormDataError("Unsupported FormData part size", "part");
20372
+ }
20373
+ checkLength(
20374
+ valueLength + stringBytes(name, true) + (!isString2 && value.name ? stringBytes(value.name, false) : 0) + (!isString2 && value.type ? stringBytes(value.type, false) : 0)
20375
+ );
20376
+ let header = "--" + boundary + CRLF2 + 'Content-Disposition: form-data; name="' + escapeName(normalizeLines(name)) + '"';
20377
+ if (!isString2) {
20378
+ header += '; filename="' + escapeName(utils_default.isString(value.name) ? value.name : "blob") + '"' + CRLF2 + "Content-Type: " + String(value.type || "application/octet-stream").replace(/[\r\n]/g, "");
20379
+ }
20380
+ header += CRLF2 + CRLF2;
20381
+ const partLength = stringBytes(header, false) + valueLength + CRLF2.length;
20382
+ checkLength(partLength);
20383
+ length += partLength;
20384
+ parts.push({ header, value, isString: isString2 });
20385
+ }
20386
+ const blobParts = [];
20387
+ for (const part of parts) {
20388
+ blobParts.push(part.header, part.isString ? normalizeLines(part.value) : part.value, CRLF2);
20389
+ }
20390
+ blobParts.push(footer);
20391
+ return new Blob2(blobParts, { type: "multipart/form-data; boundary=" + boundary });
20392
+ }
20393
+
20394
+ // node_modules/axios/lib/core/createMultipartBody.js
20395
+ function createMultipartBody(form, Blob2, limit, limitError, boundary) {
20396
+ if (!utils_default.isFunction(Blob2)) {
20397
+ throw new AxiosError_default("Blob is not supported", AxiosError_default.ERR_NOT_SUPPORT);
20398
+ }
20399
+ if (boundary === void 0) {
20400
+ if (utils_default.isFunction(platform_default.generateString)) {
20401
+ boundary = "axios-" + platform_default.generateString(36, "0123456789abcdef");
20402
+ } else {
20403
+ const crypto2 = utils_default.global.crypto;
20404
+ if (!crypto2 || !utils_default.isFunction(crypto2.getRandomValues)) {
20405
+ throw new AxiosError_default("Random byte generation is not supported", AxiosError_default.ERR_NOT_SUPPORT);
20406
+ }
20407
+ const random = new Uint8Array(18);
20408
+ crypto2.getRandomValues(random);
20409
+ boundary = "axios-" + Array.from(random, (value) => ("0" + value.toString(16)).slice(-2)).join("");
20410
+ }
20411
+ }
20412
+ try {
20413
+ return formDataToBlob(form, Blob2, limit, limitError, boundary);
20414
+ } catch (error) {
20415
+ if (error instanceof FormDataError) {
20416
+ const code = error.reason === "boundary" ? AxiosError_default.ERR_BAD_OPTION_VALUE : AxiosError_default.ERR_BAD_REQUEST;
20417
+ throw new AxiosError_default(error.message, code);
20418
+ }
20419
+ throw error;
20420
+ }
20421
+ }
20422
+
19973
20423
  // node_modules/axios/lib/adapters/fetch.js
19974
20424
  var DEFAULT_CHUNK_SIZE = 64 * 1024;
19975
20425
  var DEFAULT_REQUEST_OPTIONS = {
@@ -20022,11 +20472,13 @@ var factory = (env) => {
20022
20472
  },
20023
20473
  {
20024
20474
  Request: globalObject.Request,
20025
- Response: globalObject.Response
20475
+ Response: globalObject.Response,
20476
+ Blob: globalObject.Blob
20026
20477
  },
20027
20478
  env
20028
20479
  );
20029
- const { fetch: envFetch, Request, Response } = env;
20480
+ const envFetch = utils_default.hasOwnProp(env, "fetch") ? env.fetch : void 0;
20481
+ const { Request, Response, Blob: Blob2 } = env;
20030
20482
  const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function";
20031
20483
  const isRequestSupported = isFunction2(Request);
20032
20484
  const isResponseSupported = isFunction2(Response);
@@ -20052,6 +20504,13 @@ var factory = (env) => {
20052
20504
  return duplexAccessed && !hasContentType;
20053
20505
  });
20054
20506
  const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
20507
+ const requestDefaults = Object.assign(/* @__PURE__ */ Object.create(null), DEFAULT_REQUEST_OPTIONS);
20508
+ if (isRequestSupported && !test(() => new Request(platform_default.origin, requestDefaults))) {
20509
+ delete requestDefaults.cache;
20510
+ if (!test(() => new Request(platform_default.origin, requestDefaults))) {
20511
+ requestDefaults.cache = DEFAULT_REQUEST_OPTIONS.cache;
20512
+ }
20513
+ }
20055
20514
  const resolvers = {
20056
20515
  stream: supportsResponseStream && ((res) => res.body)
20057
20516
  };
@@ -20077,13 +20536,6 @@ var factory = (env) => {
20077
20536
  if (utils_default.isBlob(body)) {
20078
20537
  return body.size;
20079
20538
  }
20080
- if (utils_default.isSpecCompliantForm(body)) {
20081
- const _request = new Request(platform_default.origin, {
20082
- method: "POST",
20083
- body
20084
- });
20085
- return (await _request.arrayBuffer()).byteLength;
20086
- }
20087
20539
  if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
20088
20540
  return body.byteLength;
20089
20541
  }
@@ -20131,6 +20583,7 @@ var factory = (env) => {
20131
20583
  });
20132
20584
  let requestContentLength;
20133
20585
  let pendingBodyError = null;
20586
+ let pendingResponseError = null;
20134
20587
  const maxBodyLengthError = () => new AxiosError_default(
20135
20588
  "Request body larger than maxBodyLength limit",
20136
20589
  AxiosError_default.ERR_BAD_REQUEST,
@@ -20148,8 +20601,9 @@ var factory = (env) => {
20148
20601
  password: password2
20149
20602
  };
20150
20603
  }
20604
+ let parsedURL;
20151
20605
  if (maybeWithAuthCredentials(url2)) {
20152
- const parsedURL = new URL(url2, platform_default.origin);
20606
+ parsedURL = new URL(url2, platform_default.origin);
20153
20607
  if (!auth && (parsedURL.username || parsedURL.password)) {
20154
20608
  const urlUsername = decodeURIComponentSafe2(parsedURL.username);
20155
20609
  const urlPassword = decodeURIComponentSafe2(parsedURL.password);
@@ -20171,8 +20625,8 @@ var factory = (env) => {
20171
20625
  "Basic " + btoa(encodeUTF82((auth.username || "") + ":" + (auth.password || "")))
20172
20626
  );
20173
20627
  }
20174
- if (hasMaxContentLength && typeof url2 === "string" && url2.startsWith("data:")) {
20175
- const estimated = estimateDataURLDecodedBytes(url2);
20628
+ if (hasMaxContentLength && parsedURL && parsedURL.protocol === "data:") {
20629
+ const estimated = estimateDataURLDecodedBytes(parsedURL.href);
20176
20630
  if (estimated > maxContentLength) {
20177
20631
  throw new AxiosError_default(
20178
20632
  "maxContentLength size of " + maxContentLength + " exceeded",
@@ -20182,6 +20636,23 @@ var factory = (env) => {
20182
20636
  );
20183
20637
  }
20184
20638
  }
20639
+ const formContentType = utils_default.isSpecCompliantForm(data) && AxiosHeaders_default.from(own2("headers")).getContentType();
20640
+ let formBoundary;
20641
+ if (utils_default.isString(formContentType) && /^multipart\/form-data(?:\s*;|$)/i.test(formContentType.trim())) {
20642
+ const parameters = AxiosHeaders_default.parseParameters(formContentType);
20643
+ if (utils_default.hasOwnProp(parameters, "boundary")) formBoundary = parameters.boundary;
20644
+ }
20645
+ if (utils_default.isSpecCompliantForm(data) && method !== "get" && method !== "head" && (hasMaxBodyLength || onUploadProgress && supportsRequestStream || formBoundary !== void 0)) {
20646
+ data = createMultipartBody(
20647
+ data,
20648
+ Blob2,
20649
+ hasMaxBodyLength ? maxBodyLength : Infinity,
20650
+ maxBodyLengthError,
20651
+ formBoundary
20652
+ );
20653
+ headers.setContentType(formBoundary === void 0 ? data.type : formContentType);
20654
+ requestContentLength = data.size;
20655
+ }
20185
20656
  if (hasMaxBodyLength && method !== "get" && method !== "head") {
20186
20657
  const outboundLength = await getBodyLength(data);
20187
20658
  if (typeof outboundLength === "number" && isFinite(outboundLength)) {
@@ -20262,7 +20733,7 @@ var factory = (env) => {
20262
20733
  credentials: isCredentialsSupported ? withCredentials : void 0
20263
20734
  });
20264
20735
  if (isRequestSupported) {
20265
- utils_default.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {
20736
+ utils_default.forEach(requestDefaults, (value, key) => {
20266
20737
  if (resolvedOptions[key] === void 0) {
20267
20738
  resolvedOptions[key] = value;
20268
20739
  }
@@ -20310,7 +20781,7 @@ var factory = (env) => {
20310
20781
  if (hasMaxContentLength) {
20311
20782
  bytesRead = loadedBytes;
20312
20783
  if (bytesRead > maxContentLength) {
20313
- throw new AxiosError_default(
20784
+ throw pendingResponseError = new AxiosError_default(
20314
20785
  "maxContentLength size of " + maxContentLength + " exceeded",
20315
20786
  AxiosError_default.ERR_BAD_RESPONSE,
20316
20787
  config,
@@ -20385,6 +20856,9 @@ var factory = (env) => {
20385
20856
  request && !pendingBodyError.request && (pendingBodyError.request = request);
20386
20857
  throw pendingBodyError;
20387
20858
  }
20859
+ if (pendingResponseError) {
20860
+ throw pendingResponseError;
20861
+ }
20388
20862
  if (err instanceof AxiosError_default) {
20389
20863
  request && !err.request && (err.request = request);
20390
20864
  throw err;
@@ -20412,9 +20886,15 @@ var factory = (env) => {
20412
20886
  };
20413
20887
  var seedCache = /* @__PURE__ */ new Map();
20414
20888
  var getFetch = (config) => {
20415
- let env = config && config.env || {};
20416
- const { fetch: fetch2, Request, Response } = env;
20417
- const seeds = [Request, Response, fetch2];
20889
+ const env = /* @__PURE__ */ Object.create(null);
20890
+ const configuredEnv = config && utils_default.hasOwnProp(config, "env") && config.env;
20891
+ ["fetch", "Request", "Response", "Blob"].forEach((key) => {
20892
+ if (configuredEnv && utils_default.hasOwnProp(configuredEnv, key)) {
20893
+ env[key] = configuredEnv[key];
20894
+ }
20895
+ });
20896
+ const { fetch: fetch2, Request, Response, Blob: Blob2 } = env;
20897
+ const seeds = [Request, Response, fetch2, Blob2];
20418
20898
  let len = seeds.length, i2 = len, seed, target, map = seedCache;
20419
20899
  while (i2--) {
20420
20900
  seed = seeds[i2];
@@ -20500,6 +20980,9 @@ function throwIfCancellationRequested(config) {
20500
20980
  throw new CanceledError_default(null, config);
20501
20981
  }
20502
20982
  }
20983
+ function elapsedSince(start) {
20984
+ return Math.max(0, Date.now() - start);
20985
+ }
20503
20986
  function dispatchRequest(_config) {
20504
20987
  const config = utils_default.toSafeFlatObject(_config);
20505
20988
  throwIfCancellationRequested(config);
@@ -20509,9 +20992,11 @@ function dispatchRequest(_config) {
20509
20992
  config.headers.setContentType("application/x-www-form-urlencoded", false);
20510
20993
  }
20511
20994
  const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config);
20995
+ const start = Date.now();
20512
20996
  return adapter2(config).then(
20513
20997
  function onAdapterResolution(response) {
20514
20998
  throwIfCancellationRequested(config);
20999
+ response.duration = elapsedSince(start);
20515
21000
  config.response = response;
20516
21001
  try {
20517
21002
  response.data = transformData.call(config, config.transformResponse, response);
@@ -20525,6 +21010,7 @@ function dispatchRequest(_config) {
20525
21010
  if (!isCancel(reason)) {
20526
21011
  throwIfCancellationRequested(config);
20527
21012
  if (reason && reason.response) {
21013
+ reason.response.duration = elapsedSince(start);
20528
21014
  config.response = reason.response;
20529
21015
  try {
20530
21016
  reason.response.data = transformData.call(
@@ -20612,6 +21098,27 @@ var validator_default = {
20612
21098
 
20613
21099
  // node_modules/axios/lib/core/Axios.js
20614
21100
  var validators2 = validator_default.validators;
21101
+ var isHeadersBucket = (value) => {
21102
+ if (value == null || utils_default.isPlainObject(value) || value instanceof AxiosHeaders_default) {
21103
+ return true;
21104
+ }
21105
+ try {
21106
+ return utils_default.isObject(value) && utils_default.getSafeProp(value, Symbol.toStringTag) === "AxiosHeaders" && [
21107
+ "toJSON",
21108
+ "set",
21109
+ "get",
21110
+ "has",
21111
+ "delete",
21112
+ "clear",
21113
+ "normalize",
21114
+ "concat",
21115
+ "toString",
21116
+ Symbol.iterator
21117
+ ].every((method) => utils_default.isFunction(utils_default.getSafeProp(value, method)));
21118
+ } catch (e) {
21119
+ return false;
21120
+ }
21121
+ };
20615
21122
  var Axios = class {
20616
21123
  constructor(instanceConfig) {
20617
21124
  this.defaults = instanceConfig || {};
@@ -20647,9 +21154,13 @@ var Axios = class {
20647
21154
  } else if (stack) {
20648
21155
  const firstNewlineIndex = stack.indexOf("\n");
20649
21156
  const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1);
20650
- const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1);
20651
- if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
20652
- err.stack += "\n" + stack;
21157
+ const duplicateCheckSuffix = secondNewlineIndex === -1 ? stack : stack.slice(secondNewlineIndex + 1);
21158
+ const currentStack = String(err.stack);
21159
+ const causeIndex = getCauseStackIndex(err, currentStack);
21160
+ const stackHead = causeIndex === -1 ? currentStack : currentStack.slice(0, causeIndex);
21161
+ const causeSection = causeIndex === -1 ? "" : currentStack.slice(causeIndex);
21162
+ if (!stackHead.endsWith(duplicateCheckSuffix)) {
21163
+ err.stack = stackHead + "\n" + stack + causeSection;
20653
21164
  }
20654
21165
  }
20655
21166
  } catch (e) {
@@ -20676,7 +21187,8 @@ var Axios = class {
20676
21187
  clarifyTimeoutError: validators2.transitional(validators2.boolean),
20677
21188
  legacyInterceptorReqResOrdering: validators2.transitional(validators2.boolean),
20678
21189
  advertiseZstdAcceptEncoding: validators2.transitional(validators2.boolean),
20679
- validateStatusUndefinedResolves: validators2.transitional(validators2.boolean)
21190
+ validateStatusUndefinedResolves: validators2.transitional(validators2.boolean),
21191
+ encodeBasicAuthUsername: validators2.transitional(validators2.boolean)
20680
21192
  },
20681
21193
  false
20682
21194
  );
@@ -20698,7 +21210,7 @@ var Axios = class {
20698
21210
  }
20699
21211
  }
20700
21212
  if (config.allowAbsoluteUrls !== void 0) {
20701
- } else if (this.defaults.allowAbsoluteUrls !== void 0) {
21213
+ } else if (utils_default.hasOwnProp(this.defaults, "allowAbsoluteUrls") && this.defaults.allowAbsoluteUrls !== void 0) {
20702
21214
  config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;
20703
21215
  } else {
20704
21216
  config.allowAbsoluteUrls = true;
@@ -20712,9 +21224,16 @@ var Axios = class {
20712
21224
  true
20713
21225
  );
20714
21226
  config.method = (utils_default.getSafeProp(config, "method") || utils_default.getSafeProp(this.defaults, "method") || "get").toLowerCase();
20715
- let contextHeaders = headers && utils_default.merge(headers.common, headers[config.method]);
21227
+ const commonHeaders = utils_default.getSafeProp(headers, "common");
21228
+ const methodHeaders = utils_default.getSafeProp(headers, config.method);
21229
+ const contextHeaders = headers && utils_default.merge(
21230
+ isHeadersBucket(commonHeaders) ? commonHeaders : void 0,
21231
+ isHeadersBucket(methodHeaders) ? methodHeaders : void 0
21232
+ );
20716
21233
  headers && utils_default.forEach(methodList_default.concat("common"), (method) => {
20717
- delete headers[method];
21234
+ if (isHeadersBucket(utils_default.getSafeProp(headers, method))) {
21235
+ delete headers[method];
21236
+ }
20718
21237
  });
20719
21238
  config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
20720
21239
  const requestInterceptorChain = [];
@@ -20796,7 +21315,7 @@ var Axios = class {
20796
21315
  }
20797
21316
  };
20798
21317
  utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
20799
- Axios.prototype[method] = function(url2, config) {
21318
+ Axios.prototype[method] = async function(url2, config) {
20800
21319
  return this.request(
20801
21320
  mergeConfig(config || {}, {
20802
21321
  method,
@@ -20808,7 +21327,7 @@ utils_default.forEach(["delete", "get", "head", "options"], function forEachMeth
20808
21327
  });
20809
21328
  utils_default.forEach(["post", "put", "patch", "query"], function forEachMethodWithData(method) {
20810
21329
  function generateHTTPMethod(isForm) {
20811
- return function httpMethod(url2, data, config) {
21330
+ return async function httpMethod(url2, data, config) {
20812
21331
  return this.request(
20813
21332
  mergeConfig(config || {}, {
20814
21333
  method,
@@ -20915,8 +21434,8 @@ var CancelToken = class _CancelToken {
20915
21434
  */
20916
21435
  static source() {
20917
21436
  let cancel2;
20918
- const token = new _CancelToken(function executor(c) {
20919
- cancel2 = c;
21437
+ const token = new _CancelToken(function executor(c2) {
21438
+ cancel2 = c2;
20920
21439
  });
20921
21440
  return {
20922
21441
  token,
@@ -21166,6 +21685,60 @@ var PartialWorkflowError = class extends AssinafyError {
21166
21685
 
21167
21686
  // src/api/utils.ts
21168
21687
  var import_node_http = require("http");
21688
+
21689
+ // src/api/types.ts
21690
+ var SIGNER_CAPACITIES = [
21691
+ "Sign",
21692
+ "Approve",
21693
+ "Acknowledge",
21694
+ "Party",
21695
+ "Witness",
21696
+ "Intervening",
21697
+ "Receipt",
21698
+ "IssuerEndorserGuarantor",
21699
+ "IssuerEndorserGuarantorSurety",
21700
+ "Surety",
21701
+ "PartySurety",
21702
+ "JointDebtor",
21703
+ "PartyJointDebtor",
21704
+ "ContractingParty",
21705
+ "ContractedParty",
21706
+ "Landlord",
21707
+ "Tenant",
21708
+ "Buyer",
21709
+ "Seller",
21710
+ "AttorneyInFact",
21711
+ "LegalRepresentative",
21712
+ "Employer",
21713
+ "Employee"
21714
+ ];
21715
+ var PUSH_PREFERENCE_CODES = [
21716
+ "SignerViewed",
21717
+ "SignerSigned",
21718
+ "DocumentCompleted",
21719
+ "SignerDeclined",
21720
+ "DocumentAboutToExpire",
21721
+ "DocumentExpired",
21722
+ "SignerIdentityReviewRequired",
21723
+ "SignerWhatsappFailed"
21724
+ ];
21725
+ var NOTIFICATION_PREFERENCE_CODES = [
21726
+ "DocumentCompleted",
21727
+ "SignerDeclined",
21728
+ "DocumentCancelled",
21729
+ "DocumentAboutToExpire",
21730
+ "DocumentExpired",
21731
+ "DocumentExpirationReset",
21732
+ "DocumentProcessingFailed",
21733
+ "TemplateProcessingFailed",
21734
+ "SignerWhatsappFailed",
21735
+ "ContractRenewalNotice",
21736
+ "ContractExpiring",
21737
+ "ContractExpired",
21738
+ "ContractRenewed"
21739
+ ];
21740
+
21741
+ // src/api/utils.ts
21169
21742
  var DOCUMENT_ARTIFACT_NAMES = [
21170
21743
  "original",
21171
21744
  "certificated",
@@ -21276,6 +21849,16 @@ function requireExpiration(value, name = "expires_at") {
21276
21849
  requireIso8601(timestamp, name);
21277
21850
  return value;
21278
21851
  }
21852
+ function requireScheduledTime(value, name = "send_at") {
21853
+ if (typeof value === "number") {
21854
+ if (!Number.isSafeInteger(value))
21855
+ throw new ValidationError(`${name} must be an integer Unix time`);
21856
+ } else if (typeof value === "string") {
21857
+ requireExpiration(value, name);
21858
+ } else {
21859
+ throw new ValidationError(`${name} must be an ISO 8601 time or integer Unix time`);
21860
+ }
21861
+ }
21279
21862
  function requireEmail(value) {
21280
21863
  if (!value || !EMAIL_RE.test(value)) {
21281
21864
  throw new ValidationError("Invalid email address", { email: value });
@@ -21283,6 +21866,9 @@ function requireEmail(value) {
21283
21866
  return value;
21284
21867
  }
21285
21868
  function validateSignerOptions(input) {
21869
+ if (input.sign_as != null && !SIGNER_CAPACITIES.includes(input.sign_as)) {
21870
+ throw new ValidationError("sign_as must be a published signer capacity or null");
21871
+ }
21286
21872
  if (input.embedded !== void 0 && typeof input.embedded !== "boolean") {
21287
21873
  throw new ValidationError("embedded must be a boolean");
21288
21874
  }
@@ -21481,7 +22067,7 @@ var BaseResource = class {
21481
22067
  }
21482
22068
  };
21483
22069
  function safeIdentifier(value, name) {
21484
- if (value === "." || value === ".." || /[\s/?#\\%]/.test(value)) {
22070
+ if (typeof value !== "string" || value === "." || value === ".." || /[\s/?#\\%]/.test(value)) {
21485
22071
  throw new ValidationError(`${name} contains invalid URL characters`);
21486
22072
  }
21487
22073
  return value;
@@ -21516,11 +22102,15 @@ function toInt(value) {
21516
22102
 
21517
22103
  // src/api/resources/assignments.ts
21518
22104
  function buildAssignmentPayload(payload, options = {}) {
22105
+ if (!payload || typeof payload !== "object" || Array.isArray(payload)) {
22106
+ throw new ValidationError("Assignment payload must be an object");
22107
+ }
21519
22108
  if (payload.method !== void 0 && payload.method !== "virtual" && payload.method !== "collect") {
21520
22109
  throw new ValidationError("method must be virtual or collect");
21521
22110
  }
21522
22111
  const signers = extractSignerRefs(payload);
21523
22112
  validateCreditCeiling(payload.max_total_credits);
22113
+ if (payload.expires_at != null) requireScheduledTime(payload.expires_at, "expires_at");
21524
22114
  if (signers.length === 0) {
21525
22115
  throw new ValidationError("At least one signer is required", {
21526
22116
  signers: payload.signers ?? payload.signer_ids ?? payload.signerIds
@@ -21535,15 +22125,17 @@ function buildAssignmentPayload(payload, options = {}) {
21535
22125
  if (!options.skipDigitalCertificateStepValidation) {
21536
22126
  validateSigningSteps(normalisedSigners);
21537
22127
  }
21538
- return stripEmpty({
21539
- method,
21540
- signers: normalisedSigners,
21541
- message: payload.message,
21542
- expires_at: payload.expires_at === void 0 ? void 0 : requireExpiration(payload.expires_at),
21543
- copy_receivers: payload.copy_receivers,
21544
- entries: payload.entries,
21545
- max_total_credits: payload.max_total_credits
21546
- });
22128
+ return Object.fromEntries(
22129
+ Object.entries({
22130
+ method,
22131
+ signers: normalisedSigners,
22132
+ message: payload.message,
22133
+ expires_at: payload.expires_at,
22134
+ copy_receivers: payload.copy_receivers,
22135
+ entries: payload.entries,
22136
+ max_total_credits: payload.max_total_credits
22137
+ }).filter(([, value]) => value !== void 0)
22138
+ );
21547
22139
  }
21548
22140
  function extractSignerRefs(payload) {
21549
22141
  const populatedAliases = [payload.signers, payload.signer_ids, payload.signerIds].filter(
@@ -21560,21 +22152,24 @@ function extractSignerRefs(payload) {
21560
22152
  }
21561
22153
  function normaliseSignerRef(ref, options) {
21562
22154
  if (typeof ref === "string") {
21563
- if (!ref) throw new ValidationError("Signer ID cannot be empty");
22155
+ if (!ref.trim()) throw new ValidationError("Signer ID cannot be empty");
21564
22156
  return { id: ref };
21565
22157
  }
21566
22158
  if (ref && typeof ref === "object") {
21567
22159
  const input = ref;
21568
22160
  const id = input.id ?? input.signer_id;
21569
22161
  validateSignerOptions(input);
21570
- const normalised = stripEmpty({
21571
- id,
21572
- verification_method: input.verification_method,
21573
- notification_methods: input.notification_methods,
21574
- step: input.step,
21575
- embedded: input.embedded
21576
- });
21577
- if (typeof id === "string" && id.length > 0) {
22162
+ const normalised = Object.fromEntries(
22163
+ Object.entries({
22164
+ id,
22165
+ sign_as: input.sign_as,
22166
+ verification_method: input.verification_method,
22167
+ notification_methods: input.notification_methods,
22168
+ step: input.step,
22169
+ embedded: input.embedded
22170
+ }).filter(([, value]) => value !== void 0)
22171
+ );
22172
+ if (typeof id === "string" && id.trim().length > 0) {
21578
22173
  return normalised;
21579
22174
  }
21580
22175
  if (options.allowSignersWithoutId && Object.keys(normalised).length > 0) {
@@ -21587,6 +22182,30 @@ function normaliseSignerRef(ref, options) {
21587
22182
  throw new ValidationError("Invalid signer reference", { ref });
21588
22183
  }
21589
22184
  var AssignmentResource = class extends BaseResource {
22185
+ /** Keep a request for later; no invitation or charge until the server sends it (staging). */
22186
+ async schedule(documentId, payload) {
22187
+ const id = this.requireId(documentId, "Document ID");
22188
+ requireScheduledTime(payload?.send_at);
22189
+ const body = { ...buildAssignmentPayload(payload), send_at: payload.send_at };
22190
+ return this.call(
22191
+ "Failed to schedule assignment",
22192
+ () => this.http.post(`/documents/${id}/scheduled-sends`, body)
22193
+ );
22194
+ }
22195
+ async signerCapacities(documentId) {
22196
+ const id = this.requireId(documentId, "Document ID");
22197
+ return this.call(
22198
+ "Failed to fetch signer capacities",
22199
+ () => this.http.get(`/documents/${id}/signer-capacities`)
22200
+ );
22201
+ }
22202
+ async notificationHistory(documentId) {
22203
+ const id = this.requireId(documentId, "Document ID");
22204
+ return this.call(
22205
+ "Failed to fetch notification history",
22206
+ () => this.http.get(`/documents/${id}/notification-history`)
22207
+ );
22208
+ }
21590
22209
  /** Fetch an account review and available evidence for a signer's identity verification. */
21591
22210
  async getIdentityVerification(documentId, assignmentId, signerId) {
21592
22211
  const docId = this.requireId(documentId, "Document ID");
@@ -22050,6 +22669,25 @@ var FAILED_STATUSES = /* @__PURE__ */ new Set([
22050
22669
  "expired"
22051
22670
  ]);
22052
22671
  var DocumentResource = class extends BaseResource {
22672
+ /** Read contacts who receive a completion email without document access (staging). */
22673
+ async listWatchers(documentId) {
22674
+ const id = this.requireId(documentId, "Document ID");
22675
+ return this.call(
22676
+ "Failed to list document watchers",
22677
+ () => this.http.get(`/documents/${id}/watchers`)
22678
+ );
22679
+ }
22680
+ /** Replace all watchers; an empty list clears them. Owner credentials required (staging). */
22681
+ async setWatchers(documentId, watcherIds) {
22682
+ const id = this.requireId(documentId, "Document ID");
22683
+ if (!Array.isArray(watcherIds) || new Set(watcherIds).size > 10 || watcherIds.some((value) => typeof value !== "string" || !value.trim())) {
22684
+ throw new ValidationError("watcher_ids must contain at most 10 nonblank contact IDs");
22685
+ }
22686
+ return this.call(
22687
+ "Failed to set document watchers",
22688
+ () => this.http.put(`/documents/${id}/watchers`, { watcher_ids: watcherIds })
22689
+ );
22690
+ }
22053
22691
  /**
22054
22692
  * Upload a PDF to the workspace.
22055
22693
  *
@@ -22580,6 +23218,26 @@ function validateOrigin(value) {
22580
23218
 
22581
23219
  // src/api/resources/envelopes.ts
22582
23220
  var EnvelopeResource = class extends BaseResource {
23221
+ /** Schedule one envelope request; idempotency headers are not supported here (staging). */
23222
+ async schedule(payload, accountId) {
23223
+ const id = this.accountId(accountId);
23224
+ validateCreate(payload);
23225
+ requireScheduledTime(payload.send_at);
23226
+ return this.call(
23227
+ "Failed to schedule envelope",
23228
+ () => this.http.post(`/accounts/${id}/scheduled-sends`, payload)
23229
+ );
23230
+ }
23231
+ /** Estimate one reminder for the whole envelope without sending or charging (staging). */
23232
+ async estimateResendCost(envelopeId, signerId, accountId) {
23233
+ const id = this.accountId(accountId);
23234
+ const eid = this.requireId(envelopeId, "Envelope ID");
23235
+ const sid = this.requireId(signerId, "Signer ID");
23236
+ return this.call(
23237
+ "Failed to estimate envelope reminder cost",
23238
+ () => this.http.post(`/accounts/${id}/envelopes/${eid}/signers/${sid}/estimate-resend-cost`)
23239
+ );
23240
+ }
22583
23241
  async list(params = {}, accountId) {
22584
23242
  const id = this.accountId(accountId);
22585
23243
  if (params.status !== void 0 && !["open", "closed"].includes(params.status))
@@ -23079,6 +23737,35 @@ function httpsUrl(value, name) {
23079
23737
  return url2;
23080
23738
  }
23081
23739
 
23740
+ // src/api/resources/scheduled-sends.ts
23741
+ var ScheduledSendResource = class extends BaseResource {
23742
+ async list(params = {}, accountId) {
23743
+ const id = this.accountId(accountId);
23744
+ return this.callList(
23745
+ "Failed to list scheduled sends",
23746
+ () => this.http.get(`/accounts/${id}/scheduled-sends`, { params: cleanParams({ ...params }) })
23747
+ );
23748
+ }
23749
+ /** Cancel only a pending request; nothing is sent or charged. */
23750
+ async cancel(scheduledSendId, accountId) {
23751
+ const id = this.accountId(accountId);
23752
+ const sid = this.requireId(scheduledSendId, "Scheduled send ID");
23753
+ return this.call(
23754
+ "Failed to cancel scheduled send",
23755
+ () => this.http.put(`/accounts/${id}/scheduled-sends/${sid}/cancel`)
23756
+ );
23757
+ }
23758
+ /** Execute a pending request now, sending invitations and charging its current cost. */
23759
+ async send(scheduledSendId, accountId) {
23760
+ const id = this.accountId(accountId);
23761
+ const sid = this.requireId(scheduledSendId, "Scheduled send ID");
23762
+ return this.call(
23763
+ "Failed to send scheduled request",
23764
+ () => this.http.put(`/accounts/${id}/scheduled-sends/${sid}/send`)
23765
+ );
23766
+ }
23767
+ };
23768
+
23082
23769
  // src/api/resources/signer-documents.ts
23083
23770
  var SignerDocumentsResource = class extends BaseResource {
23084
23771
  /** `GET /signers/{signer_id}/document?signer-access-code=…` */
@@ -23685,33 +24372,6 @@ var TemplateResource = class extends BaseResource {
23685
24372
  }
23686
24373
  };
23687
24374
 
23688
- // src/api/types.ts
23689
- var PUSH_PREFERENCE_CODES = [
23690
- "SignerViewed",
23691
- "SignerSigned",
23692
- "DocumentCompleted",
23693
- "SignerDeclined",
23694
- "DocumentAboutToExpire",
23695
- "DocumentExpired",
23696
- "SignerIdentityReviewRequired",
23697
- "SignerWhatsappFailed"
23698
- ];
23699
- var NOTIFICATION_PREFERENCE_CODES = [
23700
- "DocumentCompleted",
23701
- "SignerDeclined",
23702
- "DocumentCancelled",
23703
- "DocumentAboutToExpire",
23704
- "DocumentExpired",
23705
- "DocumentExpirationReset",
23706
- "DocumentProcessingFailed",
23707
- "TemplateProcessingFailed",
23708
- "SignerWhatsappFailed",
23709
- "ContractRenewalNotice",
23710
- "ContractExpiring",
23711
- "ContractExpired",
23712
- "ContractRenewed"
23713
- ];
23714
-
23715
24375
  // src/api/resources/users.ts
23716
24376
  var UsersResource = class extends BaseResource {
23717
24377
  /** Fetch the authenticated user's profile. */
@@ -24226,6 +24886,7 @@ var AssinafyClient = class _AssinafyClient {
24226
24886
  contracts;
24227
24887
  signers;
24228
24888
  workspaces;
24889
+ scheduledSends;
24229
24890
  assignments;
24230
24891
  webhooks;
24231
24892
  templates;
@@ -24300,6 +24961,11 @@ var AssinafyClient = class _AssinafyClient {
24300
24961
  this.defaultAccountId,
24301
24962
  this.logger
24302
24963
  );
24964
+ this.scheduledSends = new ScheduledSendResource(
24965
+ this.axiosInstance,
24966
+ this.defaultAccountId,
24967
+ this.logger
24968
+ );
24303
24969
  this.webhooks = new WebhookResource(this.axiosInstance, this.defaultAccountId, this.logger);
24304
24970
  this.templates = new TemplateResource(this.axiosInstance, this.defaultAccountId, this.logger);
24305
24971
  this.tags = new TagResource(this.axiosInstance, this.defaultAccountId, this.logger);
@@ -24371,7 +25037,8 @@ var AssinafyClient = class _AssinafyClient {
24371
25037
  verification_method: signer.verification_method ?? (useWhatsapp ? "Whatsapp" : void 0),
24372
25038
  notification_methods: signer.notification_methods ?? (useWhatsapp ? ["Whatsapp"] : void 0),
24373
25039
  step: signer.step,
24374
- embedded: signer.embedded
25040
+ embedded: signer.embedded,
25041
+ sign_as: signer.sign_as
24375
25042
  };
24376
25043
  validateSignerOptions(reference);
24377
25044
  return { reference, payload };
@@ -24608,7 +25275,7 @@ function printError(err, config) {
24608
25275
  // node_modules/@clack/core/dist/index.mjs
24609
25276
  var import_node_util4 = require("util");
24610
25277
  var import_node_process2 = require("process");
24611
- var l = __toESM(require("readline"), 1);
25278
+ var f$1 = __toESM(require("readline"), 1);
24612
25279
  var import_node_readline = __toESM(require("readline"), 1);
24613
25280
 
24614
25281
  // node_modules/fast-string-truncated-width/dist/utils.js
@@ -24697,7 +25364,7 @@ var getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {})
24697
25364
  if (index >= length) {
24698
25365
  break outer;
24699
25366
  }
24700
- for (let i2 = 0, l2 = PARSE_BLOCKS.length; i2 < l2; i2++) {
25367
+ for (let i2 = 0, l = PARSE_BLOCKS.length; i2 < l; i2++) {
24701
25368
  const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i2];
24702
25369
  BLOCK_RE.lastIndex = index;
24703
25370
  if (BLOCK_RE.test(input)) {
@@ -24947,8 +25614,60 @@ function wrapAnsi(string, columns, options) {
24947
25614
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
24948
25615
  }
24949
25616
 
25617
+ // node_modules/sisteransi/dist/index.js
25618
+ var ESC2 = "\x1B";
25619
+ var CSI2 = `${ESC2}[`;
25620
+ var cursor = {
25621
+ to(x, y) {
25622
+ if (!y)
25623
+ return `${CSI2}${x + 1}G`;
25624
+ return `${CSI2}${y + 1};${x + 1}H`;
25625
+ },
25626
+ move(x, y) {
25627
+ let ret = "";
25628
+ if (x < 0)
25629
+ ret += `${CSI2}${-x}D`;
25630
+ else if (x > 0)
25631
+ ret += `${CSI2}${x}C`;
25632
+ if (y < 0)
25633
+ ret += `${CSI2}${-y}A`;
25634
+ else if (y > 0)
25635
+ ret += `${CSI2}${y}B`;
25636
+ return ret;
25637
+ },
25638
+ up: (count = 1) => `${CSI2}${count}A`,
25639
+ down: (count = 1) => `${CSI2}${count}B`,
25640
+ forward: (count = 1) => `${CSI2}${count}C`,
25641
+ backward: (count = 1) => `${CSI2}${count}D`,
25642
+ nextLine: (count = 1) => `${CSI2}E`.repeat(count),
25643
+ prevLine: (count = 1) => `${CSI2}F`.repeat(count),
25644
+ left: `${CSI2}G`,
25645
+ hide: `${CSI2}?25l`,
25646
+ show: `${CSI2}?25h`,
25647
+ save: `${ESC2}7`,
25648
+ restore: `${ESC2}8`
25649
+ };
25650
+ var erase = {
25651
+ screen: `${CSI2}2J`,
25652
+ up: (count = 1) => `${CSI2}1J`.repeat(count),
25653
+ down: (count = 1) => `${CSI2}J`.repeat(count),
25654
+ line: `${CSI2}2K`,
25655
+ lineEnd: `${CSI2}K`,
25656
+ lineStart: `${CSI2}1K`,
25657
+ lines(count) {
25658
+ let clear2 = "";
25659
+ for (let i2 = 0; i2 < count; i2++)
25660
+ clear2 += this.line + (i2 < count - 1 ? cursor.up() : "");
25661
+ if (count)
25662
+ clear2 += cursor.left;
25663
+ return clear2;
25664
+ }
25665
+ };
25666
+ var clear = {
25667
+ screen: `${ESC2}c`
25668
+ };
25669
+
24950
25670
  // node_modules/@clack/core/dist/index.mjs
24951
- var import_sisteransi = __toESM(require_src3(), 1);
24952
25671
  var import_node_tty = require("tty");
24953
25672
  var a$1 = ["up", "down", "left", "right", "space", "enter", "cancel"];
24954
25673
  var t = [
@@ -24982,6 +25701,7 @@ var settings = {
24982
25701
  error: "Something went wrong"
24983
25702
  },
24984
25703
  withGuide: true,
25704
+ accessible: void 0,
24985
25705
  date: {
24986
25706
  monthNames: [...t],
24987
25707
  messages: {
@@ -24993,6 +25713,12 @@ var settings = {
24993
25713
  }
24994
25714
  }
24995
25715
  };
25716
+ function isAccessible(n2) {
25717
+ if (n2 !== void 0) return n2;
25718
+ if (settings.accessible !== void 0) return settings.accessible;
25719
+ const e = process.env.ACCESSIBLE;
25720
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
25721
+ }
24996
25722
  function isActionKey(n2, e) {
24997
25723
  if (typeof n2 == "string")
24998
25724
  return settings.aliases.get(n2) === e;
@@ -25025,59 +25751,55 @@ function block({
25025
25751
  input: e = import_node_process2.stdin,
25026
25752
  output: r2 = import_node_process2.stdout,
25027
25753
  overwrite: o = true,
25028
- hideCursor: t2 = true
25754
+ hideCursor: n2 = true
25029
25755
  } = {}) {
25030
- const s = l.createInterface({
25756
+ const s = f$1.createInterface({
25031
25757
  input: e,
25032
25758
  output: r2,
25033
25759
  prompt: "",
25034
25760
  tabSize: 1
25035
25761
  });
25036
- l.emitKeypressEvents(e, s), e instanceof import_node_tty.ReadStream && e.isTTY && e.setRawMode(true);
25037
- const n2 = (f, { name: a2, sequence: p }) => {
25038
- const c = String(f);
25039
- if (isActionKey([c, a2, p], "cancel")) {
25040
- t2 && r2.write(import_sisteransi.cursor.show), process.exit(0);
25762
+ f$1.emitKeypressEvents(e, s), e instanceof import_node_tty.ReadStream && e.isTTY && e.setRawMode(true);
25763
+ const t2 = (l, { name: i2, sequence: p }) => {
25764
+ const w = String(l);
25765
+ if (isActionKey([w, i2, p], "cancel")) {
25766
+ n2 && r2.write(cursor.show), process.exit(0);
25041
25767
  return;
25042
25768
  }
25043
25769
  if (!o) return;
25044
- const i2 = a2 === "return" ? 0 : -1, m = a2 === "return" ? -1 : 0;
25045
- l.moveCursor(r2, i2, m, () => {
25046
- l.clearLine(r2, 1, () => {
25047
- e.once("keypress", n2);
25770
+ const c2 = i2 === "return" ? 0 : -1, a2 = i2 === "return" ? -1 : 0;
25771
+ f$1.moveCursor(r2, c2, a2, () => {
25772
+ f$1.clearLine(r2, 1, () => {
25773
+ e.once("keypress", t2);
25048
25774
  });
25049
25775
  });
25050
25776
  };
25051
- return t2 && r2.write(import_sisteransi.cursor.hide), e.once("keypress", n2), () => {
25052
- e.off("keypress", n2), t2 && r2.write(import_sisteransi.cursor.show), e instanceof import_node_tty.ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
25777
+ return n2 && r2.write(cursor.hide), e.once("keypress", t2), () => {
25778
+ e.off("keypress", t2), n2 && r2.write(cursor.show), e instanceof import_node_tty.ReadStream && e.isTTY && !R && e.setRawMode(false), s.terminal = false, s.close();
25053
25779
  };
25054
25780
  }
25055
25781
  var getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
25056
25782
  var getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
25057
- function wrapTextWithPrefix(e, r2, o, t2 = o, s = o, n2) {
25058
- const f = getColumns(e ?? import_node_process2.stdout);
25059
- return wrapAnsi(r2, f - o.length, {
25783
+ function wrapTextWithPrefix(e, r2, o, n2 = o, s = o, t2) {
25784
+ const l = getColumns(e ?? import_node_process2.stdout), i2 = dist_default2(o);
25785
+ return wrapAnsi(r2, l - i2, {
25060
25786
  hard: true,
25061
25787
  trim: false
25062
25788
  }).split(`
25063
- `).map((c, i2, m) => {
25064
- const d = n2 ? n2(c, i2) : c;
25065
- return i2 === 0 ? `${t2}${d}` : i2 === m.length - 1 ? `${s}${d}` : `${o}${d}`;
25789
+ `).map((c2, a2, g) => {
25790
+ const m = t2 ? t2(c2, a2) : c2;
25791
+ return a2 === 0 ? `${n2}${m}` : a2 === g.length - 1 ? `${s}${m}` : `${o}${m}`;
25066
25792
  }).join(`
25067
25793
  `);
25068
25794
  }
25069
- function runValidation(e, n2) {
25795
+ function runValidation(e, a2) {
25070
25796
  if ("~standard" in e) {
25071
- const a2 = e["~standard"].validate(n2);
25072
- if (a2 instanceof Promise)
25073
- throw new TypeError(
25074
- "Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic."
25075
- );
25076
- return a2.issues?.at(0)?.message;
25797
+ const n2 = e["~standard"].validate(a2);
25798
+ return n2 instanceof Promise ? n2.then((r2) => r2.issues?.at(0)?.message) : n2.issues?.at(0)?.message;
25077
25799
  }
25078
- return e(n2);
25800
+ return e(a2);
25079
25801
  }
25080
- var V = class {
25802
+ var C$1 = class C {
25081
25803
  input;
25082
25804
  output;
25083
25805
  _abortSignal;
@@ -25092,9 +25814,17 @@ var V = class {
25092
25814
  error = "";
25093
25815
  value;
25094
25816
  userInput = "";
25817
+ /**
25818
+ * Whether accessible (static, screen-reader friendly) output is enabled for
25819
+ * this prompt, resolved from the `accessible` option, the global setting,
25820
+ * and the `ACCESSIBLE` env var.
25821
+ */
25822
+ get accessible() {
25823
+ return isAccessible(this.opts.accessible);
25824
+ }
25095
25825
  constructor(t2, e = true) {
25096
- const { input: i2 = import_node_process2.stdin, output: n2 = import_node_process2.stdout, render: s, signal: r2, ...o } = t2;
25097
- this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = s.bind(this), this._track = e, this._abortSignal = r2, this.input = i2, this.output = n2;
25826
+ const { input: i2 = import_node_process2.stdin, output: s = import_node_process2.stdout, render: r2, signal: n2, ...o } = t2;
25827
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r2.bind(this), this._track = e, this._abortSignal = n2, this.input = i2, this.output = s;
25098
25828
  }
25099
25829
  /**
25100
25830
  * Unsubscribe all listeners
@@ -25132,11 +25862,11 @@ var V = class {
25132
25862
  * @param data - The data to pass to the callback
25133
25863
  */
25134
25864
  emit(t2, ...e) {
25135
- const i2 = this._subscribers.get(t2) ?? [], n2 = [];
25136
- for (const s of i2)
25137
- s.cb(...e), s.once && n2.push(() => i2.splice(i2.indexOf(s), 1));
25138
- for (const s of n2)
25139
- s();
25865
+ const i2 = this._subscribers.get(t2) ?? [], s = [];
25866
+ for (const r2 of i2)
25867
+ r2.cb(...e), r2.once && s.push(() => i2.splice(i2.indexOf(r2), 1));
25868
+ for (const r2 of s)
25869
+ r2();
25140
25870
  }
25141
25871
  prompt() {
25142
25872
  return new Promise((t2) => {
@@ -25158,9 +25888,9 @@ var V = class {
25158
25888
  escapeCodeTimeout: 50,
25159
25889
  terminal: true
25160
25890
  }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
25161
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
25891
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(this.value);
25162
25892
  }), this.once("cancel", () => {
25163
- this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
25893
+ this.output.write(cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t2(CANCEL_SYMBOL);
25164
25894
  });
25165
25895
  });
25166
25896
  }
@@ -25179,70 +25909,73 @@ var V = class {
25179
25909
  _clearUserInput() {
25180
25910
  this.rl?.write(null, { ctrl: true, name: "u" }), this._setUserInput("");
25181
25911
  }
25182
- onKeypress(t2, e) {
25183
- if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
25184
- if (this.opts.validate) {
25185
- const i2 = runValidation(this.opts.validate, this.value);
25186
- i2 && (this.error = i2 instanceof Error ? i2.message : i2, this.state = "error", this.rl?.write(this.userInput));
25912
+ async onKeypress(t2, e) {
25913
+ if (this.state !== "validating") {
25914
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t2, e) && this.rl?.write(null, { ctrl: true, name: "h" }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t2 && (t2.toLowerCase() === "y" || t2.toLowerCase() === "n") && this.emit("confirm", t2.toLowerCase() === "y"), this.emit("key", t2, e), e?.name === "return" && this._shouldSubmit(t2, e)) {
25915
+ if (this.opts.validate) {
25916
+ const i2 = runValidation(this.opts.validate, this.value);
25917
+ let s;
25918
+ i2 instanceof Promise ? (this.state = "validating", this.render(), s = await i2) : s = i2, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
25919
+ }
25920
+ this.state !== "error" && (this.state = "submit");
25187
25921
  }
25188
- this.state !== "error" && (this.state = "submit");
25922
+ isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
25189
25923
  }
25190
- isActionKey([t2, e?.name, e?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
25191
25924
  }
25192
25925
  close() {
25193
25926
  this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
25194
25927
  `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
25195
25928
  }
25196
25929
  restoreCursor() {
25197
- const t2 = wrapAnsi(this._prevFrame, process.stdout.columns, { hard: true, trim: false }).split(`
25930
+ const t2 = wrapAnsi(this._prevFrame, getColumns(this.output), { hard: true, trim: false }).split(`
25198
25931
  `).length - 1;
25199
- this.output.write(import_sisteransi.cursor.move(-999, t2 * -1));
25932
+ this.output.write(cursor.move(-999, t2 * -1));
25200
25933
  }
25201
25934
  render() {
25202
- const t2 = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
25935
+ const t2 = wrapAnsi(this._render(this) ?? "", getColumns(this.output), {
25203
25936
  hard: true,
25204
25937
  trim: false
25205
25938
  });
25206
25939
  if (t2 !== this._prevFrame) {
25207
25940
  if (this.state === "initial")
25208
- this.output.write(import_sisteransi.cursor.hide);
25941
+ this.output.write(cursor.hide);
25209
25942
  else {
25210
25943
  const e = diffLines(this._prevFrame, t2), i2 = getRows(this.output);
25211
25944
  if (this.restoreCursor(), e) {
25212
- const n2 = Math.max(0, e.numLinesAfter - i2), s = Math.max(0, e.numLinesBefore - i2);
25213
- let r2 = e.lines.find((o) => o >= n2);
25214
- if (r2 === void 0) {
25945
+ const s = Math.max(0, e.numLinesAfter - i2), r2 = Math.max(0, e.numLinesBefore - i2);
25946
+ let n2 = e.lines.find((o) => o >= s);
25947
+ if (n2 === void 0) {
25215
25948
  this._prevFrame = t2;
25216
25949
  return;
25217
25950
  }
25218
25951
  if (e.lines.length === 1) {
25219
- this.output.write(import_sisteransi.cursor.move(0, r2 - s)), this.output.write(import_sisteransi.erase.lines(1));
25952
+ this.output.write(cursor.move(0, n2 - r2)), this.output.write(erase.lines(1));
25220
25953
  const o = t2.split(`
25221
25954
  `);
25222
- this.output.write(o[r2]), this._prevFrame = t2, this.output.write(import_sisteransi.cursor.move(0, o.length - r2 - 1));
25955
+ this.output.write(o[n2]), this._prevFrame = t2, this.output.write(cursor.move(0, o.length - n2 - 1));
25223
25956
  return;
25224
25957
  } else if (e.lines.length > 1) {
25225
- if (n2 < s)
25226
- r2 = n2;
25958
+ if (s < r2)
25959
+ n2 = s;
25227
25960
  else {
25228
- const h2 = r2 - s;
25229
- h2 > 0 && this.output.write(import_sisteransi.cursor.move(0, h2));
25961
+ const h2 = n2 - r2;
25962
+ h2 > 0 && this.output.write(cursor.move(0, h2));
25230
25963
  }
25231
- this.output.write(import_sisteransi.erase.down());
25232
- const f = t2.split(`
25233
- `).slice(r2);
25234
- this.output.write(f.join(`
25964
+ this.output.write(erase.down());
25965
+ const m = t2.split(`
25966
+ `).slice(n2);
25967
+ this.output.write(m.join(`
25235
25968
  `)), this._prevFrame = t2;
25236
25969
  return;
25237
25970
  }
25238
25971
  }
25239
- this.output.write(import_sisteransi.erase.down());
25972
+ this.output.write(erase.down());
25240
25973
  }
25241
25974
  this.output.write(t2), this.state === "initial" && (this.state = "active"), this._prevFrame = t2;
25242
25975
  }
25243
25976
  }
25244
25977
  };
25245
- var r = class extends V {
25978
+ var r = class extends C$1 {
25246
25979
  get cursor() {
25247
25980
  return this.value ? 0 : 1;
25248
25981
  }
@@ -25253,13 +25986,13 @@ var r = class extends V {
25253
25986
  super(t2, false), this.value = !!t2.initialValue, this.on("userInput", () => {
25254
25987
  this.value = this._value;
25255
25988
  }), this.on("confirm", (i2) => {
25256
- this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
25989
+ this.output.write(cursor.move(0, -1)), this.value = i2, this.state = "submit", this.close();
25257
25990
  }), this.on("cursor", () => {
25258
25991
  this.value = !this.value;
25259
25992
  });
25260
25993
  }
25261
25994
  };
25262
- var u$1 = class u extends V {
25995
+ var u = class extends C$1 {
25263
25996
  _mask = "\u2022";
25264
25997
  get cursor() {
25265
25998
  return this._cursor;
@@ -25287,7 +26020,7 @@ var u$1 = class u extends V {
25287
26020
  });
25288
26021
  }
25289
26022
  };
25290
- var n = class extends V {
26023
+ var n = class extends C$1 {
25291
26024
  get userInputWithCursor() {
25292
26025
  if (this.state === "submit")
25293
26026
  return this.userInput;
@@ -25317,7 +26050,6 @@ var import_node_util5 = require("util");
25317
26050
  var import_node_process3 = __toESM(require("process"), 1);
25318
26051
  var import_node_fs3 = require("fs");
25319
26052
  var import_node_path3 = require("path");
25320
- var import_sisteransi2 = __toESM(require_src3(), 1);
25321
26053
  function isUnicodeSupported() {
25322
26054
  if (import_node_process3.default.platform !== "win32") {
25323
26055
  return import_node_process3.default.env.TERM !== "linux";
@@ -25326,7 +26058,7 @@ function isUnicodeSupported() {
25326
26058
  }
25327
26059
  var unicode = isUnicodeSupported();
25328
26060
  var isCI = () => process.env.CI === "true";
25329
- var unicodeOr = (o, e) => unicode ? o : e;
26061
+ var unicodeOr = (e, o) => unicode ? e : o;
25330
26062
  var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
25331
26063
  var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
25332
26064
  var S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -25352,8 +26084,8 @@ var S_INFO = unicodeOr("\u25CF", "\u2022");
25352
26084
  var S_SUCCESS = unicodeOr("\u25C6", "*");
25353
26085
  var S_WARN = unicodeOr("\u25B2", "!");
25354
26086
  var S_ERROR = unicodeOr("\u25A0", "x");
25355
- var symbol = (o) => {
25356
- switch (o) {
26087
+ var symbol = (e) => {
26088
+ switch (e) {
25357
26089
  case "initial":
25358
26090
  case "active":
25359
26091
  return (0, import_node_util5.styleText)("cyan", S_STEP_ACTIVE);
@@ -25363,41 +26095,43 @@ var symbol = (o) => {
25363
26095
  return (0, import_node_util5.styleText)("yellow", S_STEP_ERROR);
25364
26096
  case "submit":
25365
26097
  return (0, import_node_util5.styleText)("green", S_STEP_SUBMIT);
26098
+ case "validating":
26099
+ return (0, import_node_util5.styleText)("dim", S_STEP_ACTIVE);
25366
26100
  }
25367
26101
  };
25368
- var confirm = (i2) => {
25369
- const a2 = i2.active ?? "Yes", s = i2.inactive ?? "No";
26102
+ var confirm = (e) => {
26103
+ const a2 = e.active ?? "Yes", o = e.inactive ?? "No";
25370
26104
  return new r({
25371
26105
  active: a2,
25372
- inactive: s,
25373
- signal: i2.signal,
25374
- input: i2.input,
25375
- output: i2.output,
25376
- initialValue: i2.initialValue ?? true,
26106
+ inactive: o,
26107
+ signal: e.signal,
26108
+ input: e.input,
26109
+ output: e.output,
26110
+ initialValue: e.initialValue ?? true,
25377
26111
  render() {
25378
- const e = i2.withGuide ?? settings.withGuide, u4 = `${symbol(this.state)} `, l2 = e ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
25379
- i2.output,
25380
- i2.message,
25381
- l2,
25382
- u4
25383
- ), o = `${e ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
26112
+ const i2 = e.withGuide ?? settings.withGuide, u3 = `${symbol(this.state)} `, l = i2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
26113
+ e.output,
26114
+ e.message,
26115
+ l,
26116
+ u3
26117
+ ), s = `${i2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
25384
26118
  ` : ""}${f}
25385
- `, c = this.value ? a2 : s;
26119
+ `, c2 = this.value ? a2 : o;
25386
26120
  switch (this.state) {
25387
26121
  case "submit": {
25388
- const r2 = e ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "";
25389
- return `${o}${r2}${(0, import_node_util5.styleText)("dim", c)}`;
26122
+ const r2 = i2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "";
26123
+ return `${s}${r2}${(0, import_node_util5.styleText)("dim", c2)}`;
25390
26124
  }
25391
26125
  case "cancel": {
25392
- const r2 = e ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "";
25393
- return `${o}${r2}${(0, import_node_util5.styleText)(["strikethrough", "dim"], c)}${e ? `
26126
+ const r2 = i2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "";
26127
+ return `${s}${r2}${(0, import_node_util5.styleText)(["strikethrough", "dim"], c2)}${i2 ? `
25394
26128
  ${(0, import_node_util5.styleText)("gray", S_BAR)}` : ""}`;
25395
26129
  }
25396
26130
  default: {
25397
- const r2 = e ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", g = e ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
25398
- return `${o}${r2}${this.value ? `${(0, import_node_util5.styleText)("green", S_RADIO_ACTIVE)} ${a2}` : `${(0, import_node_util5.styleText)("dim", S_RADIO_INACTIVE)} ${(0, import_node_util5.styleText)("dim", a2)}`}${i2.vertical ? e ? `
26131
+ const r2 = i2 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", g = i2 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
26132
+ return `${s}${r2}${this.value ? `${(0, import_node_util5.styleText)("green", S_RADIO_ACTIVE)} ${a2}` : `${(0, import_node_util5.styleText)("dim", S_RADIO_INACTIVE)} ${(0, import_node_util5.styleText)("dim", a2)}`}${e.vertical ? i2 ? `
25399
26133
  ${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : `
25400
- ` : ` ${(0, import_node_util5.styleText)("dim", "/")} `}${this.value ? `${(0, import_node_util5.styleText)("dim", S_RADIO_INACTIVE)} ${(0, import_node_util5.styleText)("dim", s)}` : `${(0, import_node_util5.styleText)("green", S_RADIO_ACTIVE)} ${s}`}
26134
+ ` : ` ${(0, import_node_util5.styleText)("dim", "/")} `}${this.value ? `${(0, import_node_util5.styleText)("dim", S_RADIO_INACTIVE)} ${(0, import_node_util5.styleText)("dim", o)}` : `${(0, import_node_util5.styleText)("green", S_RADIO_ACTIVE)} ${o}`}
25401
26135
  ${g}
25402
26136
  `;
25403
26137
  }
@@ -25416,123 +26150,142 @@ var cancel = (o = "", t2) => {
25416
26150
 
25417
26151
  `);
25418
26152
  };
25419
- var password = (r2) => new u$1({
25420
- validate: r2.validate,
25421
- mask: r2.mask ?? S_PASSWORD_MASK,
25422
- signal: r2.signal,
25423
- input: r2.input,
25424
- output: r2.output,
26153
+ var password = (e) => new u({
26154
+ validate: e.validate,
26155
+ mask: e.mask ?? S_PASSWORD_MASK,
26156
+ signal: e.signal,
26157
+ input: e.input,
26158
+ output: e.output,
25425
26159
  render() {
25426
- const e = r2.withGuide ?? settings.withGuide, o = `${e ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
25427
- ` : ""}${symbol(this.state)} ${r2.message}
25428
- `, c = this.userInputWithCursor, i2 = this.masked;
26160
+ const r2 = e.withGuide ?? settings.withGuide, o = `${r2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
26161
+ ` : ""}${symbol(this.state)} ${e.message}
26162
+ `, m = this.userInputWithCursor, i2 = this.masked;
25429
26163
  switch (this.state) {
25430
26164
  case "error": {
25431
- const s = e ? `${(0, import_node_util5.styleText)("yellow", S_BAR)} ` : "", n2 = e ? `${(0, import_node_util5.styleText)("yellow", S_BAR_END)} ` : "", l2 = i2 ?? "";
25432
- return r2.clearOnError && this.clear(), `${o.trim()}
25433
- ${s}${l2}
26165
+ const s = r2 ? `${(0, import_node_util5.styleText)("yellow", S_BAR)} ` : "", n2 = r2 ? `${(0, import_node_util5.styleText)("yellow", S_BAR_END)} ` : "", d = i2 ?? "";
26166
+ return e.clearOnError && this.clear(), `${o.trim()}
26167
+ ${s}${d}
25434
26168
  ${n2}${(0, import_node_util5.styleText)("yellow", this.error)}
25435
26169
  `;
25436
26170
  }
25437
26171
  case "submit": {
25438
- const s = e ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", n2 = i2 ? (0, import_node_util5.styleText)("dim", i2) : "";
26172
+ const s = r2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", n2 = i2 ? (0, import_node_util5.styleText)("dim", i2) : "";
25439
26173
  return `${o}${s}${n2}`;
25440
26174
  }
25441
26175
  case "cancel": {
25442
- const s = e ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", n2 = i2 ? (0, import_node_util5.styleText)(["strikethrough", "dim"], i2) : "";
25443
- return `${o}${s}${n2}${i2 && e ? `
26176
+ const s = r2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)} ` : "", n2 = i2 ? (0, import_node_util5.styleText)(["strikethrough", "dim"], i2) : "";
26177
+ return `${o}${s}${n2}${i2 && r2 ? `
25444
26178
  ${(0, import_node_util5.styleText)("gray", S_BAR)}` : ""}`;
25445
26179
  }
25446
26180
  default: {
25447
- const s = e ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", n2 = e ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
25448
- return `${o}${s}${c}
26181
+ const s = r2 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", n2 = r2 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
26182
+ return `${o}${s}${m}
25449
26183
  ${n2}
25450
26184
  `;
25451
26185
  }
25452
26186
  }
25453
26187
  }
25454
26188
  }).prompt();
25455
- var W = (l2) => (0, import_node_util5.styleText)("magenta", l2);
26189
+ var Y = 3e4;
26190
+ var Z = (c2) => (0, import_node_util5.styleText)("magenta", c2);
25456
26191
  var spinner = ({
25457
- indicator: l2 = "dots",
25458
- onCancel: h2,
26192
+ indicator: c2 = "dots",
26193
+ onCancel: b,
25459
26194
  output: n2 = process.stdout,
25460
- cancelMessage: G2,
25461
- errorMessage: O,
25462
- frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
25463
- delay: F = unicode ? 80 : 120,
25464
- signal: m,
25465
- ...I
26195
+ cancelMessage: _,
26196
+ errorMessage: C2,
26197
+ frames: M = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
26198
+ delay: O = unicode ? 80 : 120,
26199
+ signal: g,
26200
+ ...E
25466
26201
  } = {}) => {
25467
- const u4 = isCI();
25468
- let M, T, d = false, S = false, s = "", p, w = performance.now();
25469
- const x = getColumns(n2), k = I?.styleFrame ?? W, g = (e) => {
25470
- const r2 = e > 1 ? O ?? settings.messages.error : G2 ?? settings.messages.cancel;
25471
- S = e === 1, d && (a2(r2, e), S && typeof h2 == "function" && h2());
25472
- }, f = () => g(2), i2 = () => g(1), A = () => {
25473
- process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i2), process.on("SIGTERM", i2), process.on("exit", g), m && m.addEventListener("abort", i2);
25474
- }, H = () => {
25475
- process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i2), process.removeListener("SIGTERM", i2), process.removeListener("exit", g), m && m.removeEventListener("abort", i2);
25476
- }, y = () => {
25477
- if (p === void 0) return;
25478
- u4 && n2.write(`
26202
+ const u3 = isCI(), h2 = isAccessible(E.accessible);
26203
+ let x, I, p = false, l = false, r2 = "", v, w = performance.now();
26204
+ const y = getColumns(n2), F = E?.styleFrame ?? Z, S = (e) => {
26205
+ const s = e > 1 ? C2 ?? settings.messages.error : _ ?? settings.messages.cancel;
26206
+ l = e === 1, p && (m(s, e), l && typeof b == "function" && b());
26207
+ }, $ = () => S(2), a2 = () => S(1), H = () => {
26208
+ process.on("uncaughtExceptionMonitor", $), process.on("unhandledRejection", $), process.on("SIGINT", a2), process.on("SIGTERM", a2), process.on("exit", S), g && g.addEventListener("abort", a2);
26209
+ }, B = () => {
26210
+ process.removeListener("uncaughtExceptionMonitor", $), process.removeListener("unhandledRejection", $), process.removeListener("SIGINT", a2), process.removeListener("SIGTERM", a2), process.removeListener("exit", S), g && g.removeEventListener("abort", a2);
26211
+ }, R2 = () => {
26212
+ if (v === void 0) return;
26213
+ u3 && n2.write(`
25479
26214
  `);
25480
- const r2 = wrapAnsi(p, x, {
26215
+ const s = wrapAnsi(v, y, {
25481
26216
  hard: true,
25482
26217
  trim: false
25483
26218
  }).split(`
25484
26219
  `);
25485
- r2.length > 1 && n2.write(import_sisteransi2.cursor.up(r2.length - 1)), n2.write(import_sisteransi2.cursor.to(0)), n2.write(import_sisteransi2.erase.down());
25486
- }, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
25487
- const r2 = (performance.now() - e) / 1e3, t2 = Math.floor(r2 / 60), o = Math.floor(r2 % 60);
25488
- return t2 > 0 ? `[${t2}m ${o}s]` : `[${o}s]`;
25489
- }, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
25490
- d = true, M = block({ output: n2 }), s = C(e), w = performance.now(), N && n2.write(`${(0, import_node_util5.styleText)("gray", S_BAR)}
26220
+ s.length > 1 && n2.write(cursor.up(s.length - 1)), n2.write(cursor.to(0)), n2.write(erase.down());
26221
+ }, L = (e) => e.replace(/\.+$/, ""), T = (e) => {
26222
+ const s = (performance.now() - e) / 1e3, i2 = Math.floor(s / 60), t2 = Math.floor(s % 60);
26223
+ return i2 > 0 ? `[${i2}m ${t2}s]` : `[${t2}s]`;
26224
+ }, N = E.withGuide ?? settings.withGuide, P = (e = "") => {
26225
+ if (p = true, l = false, r2 = L(e), w = performance.now(), H(), h2) {
26226
+ r2 !== "" && n2.write(`${r2}
26227
+ `), I = setInterval(() => {
26228
+ n2.write(r2 === "" ? `still working
26229
+ ` : `still working: ${r2}
26230
+ `);
26231
+ }, Y);
26232
+ return;
26233
+ }
26234
+ x = block({ output: n2 }), N && n2.write(`${(0, import_node_util5.styleText)("gray", S_BAR)}
25491
26235
  `);
25492
- let r2 = 0, t2 = 0;
25493
- A(), T = setInterval(() => {
25494
- if (u4 && s === p)
26236
+ let s = 0, i2 = 0;
26237
+ I = setInterval(() => {
26238
+ if (u3 && r2 === v)
25495
26239
  return;
25496
- y(), p = s;
25497
- const o = k(E[r2]);
25498
- let v;
25499
- if (u4)
25500
- v = `${o} ${s}...`;
25501
- else if (l2 === "timer")
25502
- v = `${o} ${s} ${_(w)}`;
26240
+ R2(), v = r2;
26241
+ const t2 = F(M[s]);
26242
+ let o;
26243
+ if (u3)
26244
+ o = `${t2} ${r2}...`;
26245
+ else if (c2 === "timer")
26246
+ o = `${t2} ${r2} ${T(w)}`;
25503
26247
  else {
25504
- const B = ".".repeat(Math.floor(t2)).slice(0, 3);
25505
- v = `${o} ${s}${B}`;
26248
+ const j = ".".repeat(Math.floor(i2)).slice(0, 3);
26249
+ o = `${t2} ${r2}${j}`;
25506
26250
  }
25507
- const j = wrapAnsi(v, x, {
26251
+ const D = wrapAnsi(o, y, {
25508
26252
  hard: true,
25509
26253
  trim: false
25510
26254
  });
25511
- n2.write(j), r2 = r2 + 1 < E.length ? r2 + 1 : 0, t2 = t2 < 4 ? t2 + 0.125 : 0;
25512
- }, F);
25513
- }, a2 = (e = "", r2 = 0, t2 = false) => {
25514
- if (!d) return;
25515
- d = false, clearInterval(T), y();
25516
- const o = r2 === 0 ? (0, import_node_util5.styleText)("green", S_STEP_SUBMIT) : r2 === 1 ? (0, import_node_util5.styleText)("red", S_STEP_CANCEL) : (0, import_node_util5.styleText)("red", S_STEP_ERROR);
25517
- s = e ?? s, t2 || (l2 === "timer" ? n2.write(`${o} ${s} ${_(w)}
25518
- `) : n2.write(`${o} ${s}
25519
- `)), H(), M();
26255
+ n2.write(D), s = s + 1 < M.length ? s + 1 : 0, i2 = i2 < 4 ? i2 + 0.125 : 0;
26256
+ }, O);
26257
+ }, m = (e = "", s = 0, i2 = false) => {
26258
+ if (p) {
26259
+ if (p = false, l = s === 1, clearInterval(I), h2 || R2(), r2 = e ?? r2, !i2)
26260
+ if (h2) {
26261
+ const t2 = s === 1 ? _ ?? settings.messages.cancel : s === 2 ? C2 ?? settings.messages.error : "Done", o = r2 || t2;
26262
+ c2 === "timer" ? n2.write(`${o} ${T(w)}
26263
+ `) : n2.write(`${o}
26264
+ `);
26265
+ } else {
26266
+ const t2 = s === 0 ? (0, import_node_util5.styleText)("green", S_STEP_SUBMIT) : s === 1 ? (0, import_node_util5.styleText)("red", S_STEP_CANCEL) : (0, import_node_util5.styleText)("red", S_STEP_ERROR);
26267
+ c2 === "timer" ? n2.write(`${t2} ${r2} ${T(w)}
26268
+ `) : n2.write(`${t2} ${r2}
26269
+ `);
26270
+ }
26271
+ B(), x?.();
26272
+ }
25520
26273
  };
25521
26274
  return {
25522
26275
  start: P,
25523
- stop: (e = "") => a2(e, 0),
26276
+ stop: (e = "") => m(e, 0),
25524
26277
  message: (e = "") => {
25525
- s = C(e ?? s);
26278
+ r2 = L(e ?? r2);
25526
26279
  },
25527
- cancel: (e = "") => a2(e, 1),
25528
- error: (e = "") => a2(e, 2),
25529
- clear: () => a2("", 0, true),
26280
+ cancel: (e = "") => m(e, 1),
26281
+ error: (e = "") => m(e, 2),
26282
+ clear: () => m("", 0, true),
25530
26283
  get isCancelled() {
25531
- return S;
26284
+ return l;
25532
26285
  }
25533
26286
  };
25534
26287
  };
25535
- var u3 = {
26288
+ var u2 = {
25536
26289
  light: unicodeOr("\u2500", "-"),
25537
26290
  heavy: unicodeOr("\u2501", "="),
25538
26291
  block: unicodeOr("\u2588", "#")
@@ -25542,42 +26295,48 @@ var SELECT_INSTRUCTIONS = [
25542
26295
  `${(0, import_node_util5.styleText)("dim", "Enter:")} confirm`
25543
26296
  ];
25544
26297
  var i = `${(0, import_node_util5.styleText)("gray", S_BAR)} `;
25545
- var text = (e) => new n({
25546
- validate: e.validate,
25547
- placeholder: e.placeholder,
25548
- defaultValue: e.defaultValue,
25549
- initialValue: e.initialValue,
25550
- output: e.output,
25551
- signal: e.signal,
25552
- input: e.input,
26298
+ var text = (t2) => new n({
26299
+ validate: t2.validate,
26300
+ placeholder: t2.placeholder,
26301
+ defaultValue: t2.defaultValue,
26302
+ initialValue: t2.initialValue,
26303
+ output: t2.output,
26304
+ signal: t2.signal,
26305
+ input: t2.input,
25553
26306
  render() {
25554
- const i2 = e?.withGuide ?? settings.withGuide, s = `${`${i2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
25555
- ` : ""}${symbol(this.state)} `}${e.message}
25556
- `, c = e.placeholder && e.placeholder.length > 0 ? (
26307
+ const r2 = t2?.withGuide ?? settings.withGuide, l = `${`${r2 ? `${(0, import_node_util5.styleText)("gray", S_BAR)}
26308
+ ` : ""}${symbol(this.state)} `}${t2.message}
26309
+ `, d = t2.placeholder && t2.placeholder.length > 0 ? (
25557
26310
  // biome-ignore lint/style/noNonNullAssertion: guarded by placeholder.length > 0
25558
- (0, import_node_util5.styleText)("inverse", e.placeholder[0]) + (0, import_node_util5.styleText)("dim", e.placeholder.slice(1))
25559
- ) : (0, import_node_util5.styleText)(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : c, l2 = this.value ?? "";
26311
+ (0, import_node_util5.styleText)("inverse", t2.placeholder[0]) + (0, import_node_util5.styleText)("dim", t2.placeholder.slice(1))
26312
+ ) : (0, import_node_util5.styleText)(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : d, s = this.value ?? "";
25560
26313
  switch (this.state) {
26314
+ case "validating": {
26315
+ const n2 = r2 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", i2 = r2 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "", c2 = (0, import_node_util5.styleText)("dim", o), $ = (0, import_node_util5.styleText)("dim", "Validating...");
26316
+ return `${l}${n2}${c2}
26317
+ ${i2} ${$}
26318
+ `;
26319
+ }
25561
26320
  case "error": {
25562
- const n2 = this.error ? ` ${(0, import_node_util5.styleText)("yellow", this.error)}` : "", r2 = i2 ? `${(0, import_node_util5.styleText)("yellow", S_BAR)} ` : "", d = i2 ? (0, import_node_util5.styleText)("yellow", S_BAR_END) : "";
25563
- return `${s.trim()}
25564
- ${r2}${o}
25565
- ${d}${n2}
26321
+ const n2 = this.error ? ` ${(0, import_node_util5.styleText)("yellow", this.error)}` : "", i2 = r2 ? `${(0, import_node_util5.styleText)("yellow", S_BAR)} ` : "", c2 = r2 ? (0, import_node_util5.styleText)("yellow", S_BAR_END) : "";
26322
+ return `${l.trim()}
26323
+ ${i2}${o}
26324
+ ${c2}${n2}
25566
26325
  `;
25567
26326
  }
25568
26327
  case "submit": {
25569
- const n2 = l2 ? ` ${(0, import_node_util5.styleText)("dim", l2)}` : "", r2 = i2 ? (0, import_node_util5.styleText)("gray", S_BAR) : "";
25570
- return `${s}${r2}${n2}`;
26328
+ const n2 = s ? `${r2 ? " " : ""}${(0, import_node_util5.styleText)("dim", s)}` : "", i2 = r2 ? (0, import_node_util5.styleText)("gray", S_BAR) : "";
26329
+ return `${l}${i2}${n2}`;
25571
26330
  }
25572
26331
  case "cancel": {
25573
- const n2 = l2 ? ` ${(0, import_node_util5.styleText)(["strikethrough", "dim"], l2)}` : "", r2 = i2 ? (0, import_node_util5.styleText)("gray", S_BAR) : "";
25574
- return `${s}${r2}${n2}${l2.trim() ? `
25575
- ${r2}` : ""}`;
26332
+ const n2 = s ? ` ${(0, import_node_util5.styleText)(["strikethrough", "dim"], s)}` : "", i2 = r2 ? (0, import_node_util5.styleText)("gray", S_BAR) : "";
26333
+ return `${l}${i2}${n2}${s.trim() ? `
26334
+ ${i2}` : ""}`;
25576
26335
  }
25577
26336
  default: {
25578
- const n2 = i2 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", r2 = i2 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
25579
- return `${s}${n2}${o}
25580
- ${r2}
26337
+ const n2 = r2 ? `${(0, import_node_util5.styleText)("cyan", S_BAR)} ` : "", i2 = r2 ? (0, import_node_util5.styleText)("cyan", S_BAR_END) : "";
26338
+ return `${l}${n2}${o}
26339
+ ${i2}
25581
26340
  `;
25582
26341
  }
25583
26342
  }
@@ -25970,8 +26729,8 @@ function renderTable(rows, columns) {
25970
26729
  if (rows.length === 0) {
25971
26730
  return import_picocolors4.default.dim("(no results)");
25972
26731
  }
25973
- const headers = columns.map((c) => sanitizeTerminalText(c.header));
25974
- const body = rows.map((row) => columns.map((c) => formatCell(c.value(row))));
26732
+ const headers = columns.map((c2) => sanitizeTerminalText(c2.header));
26733
+ const body = rows.map((row) => columns.map((c2) => formatCell(c2.value(row))));
25975
26734
  const widths = headers.map((header, i2) => {
25976
26735
  const cellMax = body.reduce((max, cells) => Math.max(max, displayWidth(cells[i2] ?? "")), 0);
25977
26736
  return Math.max(displayWidth(header), cellMax);
@@ -25979,7 +26738,7 @@ function renderTable(rows, columns) {
25979
26738
  const pad = (text2, width) => text2 + " ".repeat(Math.max(0, width - displayWidth(text2)));
25980
26739
  const headerLine = headers.map((h2, i2) => import_picocolors4.default.bold(pad(h2, widths[i2] ?? 0))).join(" ");
25981
26740
  const lines = body.map(
25982
- (cells) => cells.map((c, i2) => pad(c, widths[i2] ?? 0)).join(" ").trimEnd()
26741
+ (cells) => cells.map((c2, i2) => pad(c2, widths[i2] ?? 0)).join(" ").trimEnd()
25983
26742
  );
25984
26743
  return [headerLine, ...lines].join("\n");
25985
26744
  }
@@ -26234,6 +26993,31 @@ var reviewIdentityCommand = new Command("review-identity").description("Approve
26234
26993
  });
26235
26994
  });
26236
26995
  var assignmentsCommand = new Command("assignments").description("Create and manage signing assignments").addCommand(listCommand).addCommand(createCommand).addCommand(estimateCostCommand).addCommand(resetExpirationCommand).addCommand(resendCommand).addCommand(estimateResendCostCommand).addCommand(whatsappCommand).addCommand(identityVerificationCommand).addCommand(identityImageCommand).addCommand(reviewIdentityCommand);
26996
+ assignmentsCommand.addCommand(
26997
+ new Command("schedule").description("Schedule an assignment without sending or charging now (staging)").argument("<documentId>", "Document ID").requiredOption("--data <json>", "Assignment JSON with send_at (ISO 8601 or Unix seconds)").action(async (id, opts, command) => {
26998
+ await runWithClient(command, async ({ client, config }) => {
26999
+ const payload = parseJsonObject(
27000
+ opts.data,
27001
+ "--data"
27002
+ );
27003
+ printData(await client.assignments.schedule(id, payload), config);
27004
+ });
27005
+ })
27006
+ );
27007
+ for (const [name, method] of [
27008
+ ["signer-capacities", "signerCapacities"],
27009
+ ["notification-history", "notificationHistory"]
27010
+ ]) {
27011
+ assignmentsCommand.addCommand(
27012
+ new Command(name).description(
27013
+ name === "signer-capacities" ? "Read the capacities signers were assigned (staging)" : "Read notification delivery/open times (staging)"
27014
+ ).argument("<documentId>", "Document ID").action(async (id, _opts, command) => {
27015
+ await runWithClient(command, async ({ client, config }) => {
27016
+ printData(await client.assignments[method](id), config);
27017
+ });
27018
+ })
27019
+ );
27020
+ }
26237
27021
 
26238
27022
  // src/commands/auth.ts
26239
27023
  function resetPasswordPayload(email, resetToken, newPassword) {
@@ -27331,6 +28115,26 @@ var waitCommand = new Command("wait").description("Poll a document until it is r
27331
28115
  });
27332
28116
  });
27333
28117
  var documentsCommand = new Command("documents").description("Upload, list, download, and manage documents").addCommand(uploadCommand).addCommand(listCommand4).addCommand(searchCommand).addCommand(getCommand3).addCommand(renameCommand).addCommand(downloadCommand).addCommand(thumbnailCommand).addCommand(downloadPageCommand).addCommand(activitiesCommand).addCommand(deleteCommand).addCommand(tagsCommand).addCommand(tagsSetCommand).addCommand(tagsAddCommand).addCommand(tagsRemoveCommand).addCommand(createFromTemplateCommand).addCommand(estimateTemplateCostCommand).addCommand(verifyCommand).addCommand(statusesCommand).addCommand(publicCommand).addCommand(sendTokenCommand).addCommand(progressCommand).addCommand(waitCommand);
28118
+ documentsCommand.addCommand(
28119
+ new Command("watchers").description("List document watchers (staging; owner credentials required)").argument("<documentId>", "Document ID").action(async (id, _opts, command) => {
28120
+ await runWithClient(command, async ({ client, config }) => {
28121
+ printData(await client.documents.listWatchers(id), config);
28122
+ });
28123
+ })
28124
+ );
28125
+ documentsCommand.addCommand(
28126
+ new Command("set-watchers").description("Replace contacts notified when the document ends (staging)").argument("<documentId>", "Document ID").requiredOption("--watcher-ids <json>", "JSON array of contact IDs; [] removes all watchers").action(async (id, opts, command) => {
28127
+ await runWithClient(command, async ({ client, config }) => {
28128
+ printData(
28129
+ await client.documents.setWatchers(
28130
+ id,
28131
+ parseJsonArray(opts.watcherIds, "--watcher-ids")
28132
+ ),
28133
+ config
28134
+ );
28135
+ });
28136
+ })
28137
+ );
27334
28138
 
27335
28139
  // src/commands/embed.ts
27336
28140
  var origins = new Command("origins").description("Manage origins allowed to embed signing pages");
@@ -27533,6 +28337,27 @@ envelopesCommand.addCommand(
27533
28337
  });
27534
28338
  })
27535
28339
  );
28340
+ envelopesCommand.addCommand(
28341
+ new Command("schedule").description("Schedule an envelope without sending or charging now (staging)").requiredOption("--data <json>", "Envelope JSON with send_at (ISO 8601 or Unix seconds)").action(async (opts, command) => {
28342
+ await runWithClient(command, async ({ client, config }) => {
28343
+ const payload = parseJsonObject(
28344
+ opts.data,
28345
+ "--data"
28346
+ );
28347
+ printData(await client.envelopes.schedule(payload, requireAccountId(config)), config);
28348
+ });
28349
+ })
28350
+ );
28351
+ envelopesCommand.addCommand(
28352
+ new Command("estimate-resend-cost").description("Estimate one envelope reminder without sending or charging (staging)").argument("<envelopeId>", "Envelope ID").argument("<signerId>", "Signer ID").action(async (id, signerId, _opts, command) => {
28353
+ await runWithClient(command, async ({ client, config }) => {
28354
+ printData(
28355
+ await client.envelopes.estimateResendCost(id, signerId, requireAccountId(config)),
28356
+ config
28357
+ );
28358
+ });
28359
+ })
28360
+ );
27536
28361
 
27537
28362
  // src/commands/fields.ts
27538
28363
  var fieldColumns = [
@@ -27851,6 +28676,37 @@ var userinfoCommand = new Command("userinfo").description("Read OIDC claims usin
27851
28676
  });
27852
28677
  var oauthCommand = new Command("oauth").description("OAuth 2.1 authorization, PKCE, token rotation, and OpenID Connect").addCommand(connectCommand).addCommand(metadataCommand).addCommand(discoveryCommand).addCommand(authorizeCommand).addCommand(exchangeCommand).addCommand(refreshCommand).addCommand(revokeCommand).addCommand(userinfoCommand);
27853
28678
 
28679
+ // src/commands/scheduled-sends.ts
28680
+ var scheduledSendsCommand = new Command("scheduled-sends").description(
28681
+ "List, cancel or send queued requests (staging)"
28682
+ );
28683
+ scheduledSendsCommand.addCommand(
28684
+ addPaginationOptions(new Command("list").description("List queued assignments and envelopes")).option("--document <id>", "Filter by document ID").action(async (opts, command) => {
28685
+ await runWithClient(command, async ({ client, config }) => {
28686
+ printData(
28687
+ await client.scheduledSends.list(
28688
+ { ...listParams(opts), document_id: opts.document },
28689
+ requireAccountId(config)
28690
+ ),
28691
+ config
28692
+ );
28693
+ });
28694
+ })
28695
+ );
28696
+ for (const action of ["cancel", "send"]) {
28697
+ scheduledSendsCommand.addCommand(
28698
+ new Command(action).description(
28699
+ action === "send" ? "Send now, charging the current cost and notifying signers" : "Cancel a pending request without sending"
28700
+ ).argument("<scheduledSendId>", "Scheduled send ID").option("-y, --yes", "Skip confirmation").action(async (id, opts, command) => {
28701
+ await runWithClient(command, async ({ client, config }) => {
28702
+ if (!await confirmDestructive(`${action} scheduled request ${id}?`, Boolean(opts.yes)))
28703
+ return;
28704
+ printData(await client.scheduledSends[action](id, requireAccountId(config)), config);
28705
+ });
28706
+ })
28707
+ );
28708
+ }
28709
+
27854
28710
  // src/commands/send.ts
27855
28711
  var phonePattern = /^\+?[\d\s().-]*\d[\d\s().-]*$/;
27856
28712
  function parseSignerSpec(spec) {
@@ -29135,7 +29991,7 @@ function handleStreamError(err, fallback, exit = process.exit) {
29135
29991
  // package.json
29136
29992
  var package_default = {
29137
29993
  name: "@assinafy/cli",
29138
- version: "2.8.0",
29994
+ version: "2.9.1",
29139
29995
  description: "The official command-line interface for the Assinafy digital-signature API",
29140
29996
  license: "MIT",
29141
29997
  type: "module",
@@ -29209,7 +30065,7 @@ var package_default = {
29209
30065
  prepublishOnly: "npm run typecheck && npm run lint && npm run test && npm run build && npm run verify:bundle"
29210
30066
  },
29211
30067
  dependencies: {
29212
- "@types/node": "^22.20.1",
30068
+ "@types/node": "^26.6.6",
29213
30069
  axios: "^1.20.0"
29214
30070
  },
29215
30071
  devDependencies: {
@@ -29218,10 +30074,10 @@ var package_default = {
29218
30074
  "@commander-js/extra-typings": "^15.0.0",
29219
30075
  commander: "^15.0.0",
29220
30076
  picocolors: "^1.1.1",
29221
- tsup: "^8.3.5",
30077
+ tsup: "^9.0.0",
29222
30078
  tsx: "^4.23.12",
29223
30079
  typescript: "^7.0.2",
29224
- vitest: "^4.1.12"
30080
+ vitest: "^5.1.0"
29225
30081
  },
29226
30082
  overrides: {
29227
30083
  esbuild: "^0.28.2"
@@ -29251,7 +30107,7 @@ ${import_picocolors7.default.gray("Examples:")}
29251
30107
 
29252
30108
  ${import_picocolors7.default.gray("Sandbox:")} target it with ${import_picocolors7.default.blue("--base-url https://sandbox.assinafy.com.br/v1")}
29253
30109
  `
29254
- ).addCommand(sendCommand).addCommand(documentsCommand).addCommand(envelopesCommand).addCommand(embedCommand).addCommand(contractsCommand).addCommand(signersCommand).addCommand(assignmentsCommand).addCommand(templatesCommand).addCommand(tagsCommand2).addCommand(fieldsCommand).addCommand(webhooksCommand).addCommand(workspacesCommand).addCommand(usersCommand).addCommand(signerCommand).addCommand(authCommand).addCommand(oauthCommand).addCommand(loginCommand2).addCommand(logoutCommand).addCommand(whoamiCommand).addCommand(configCommand).addCommand(docsCommand);
30110
+ ).addCommand(sendCommand).addCommand(documentsCommand).addCommand(envelopesCommand).addCommand(embedCommand).addCommand(contractsCommand).addCommand(signersCommand).addCommand(assignmentsCommand).addCommand(scheduledSendsCommand).addCommand(templatesCommand).addCommand(tagsCommand2).addCommand(fieldsCommand).addCommand(webhooksCommand).addCommand(workspacesCommand).addCommand(usersCommand).addCommand(signerCommand).addCommand(authCommand).addCommand(oauthCommand).addCommand(loginCommand2).addCommand(logoutCommand).addCommand(whoamiCommand).addCommand(configCommand).addCommand(docsCommand);
29255
30111
  program2.parseAsync().catch((err) => {
29256
30112
  process.stderr.write(
29257
30113
  `${import_picocolors7.default.red("error:")} ${sanitizeTerminalText(err instanceof Error ? err.message : String(err))}