casualos 3.3.12 → 3.3.13

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 (2) hide show
  1. package/dist/cli.js +1857 -737
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -17458,8 +17458,8 @@ var require_base64_js = __commonJS({
17458
17458
  "../../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js"(exports) {
17459
17459
  "use strict";
17460
17460
  exports.byteLength = byteLength;
17461
- exports.toByteArray = toByteArray13;
17462
- exports.fromByteArray = fromByteArray14;
17461
+ exports.toByteArray = toByteArray15;
17462
+ exports.fromByteArray = fromByteArray16;
17463
17463
  var lookup2 = [];
17464
17464
  var revLookup = [];
17465
17465
  var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
@@ -17492,7 +17492,7 @@ var require_base64_js = __commonJS({
17492
17492
  function _byteLength(b64, validLen, placeHoldersLen) {
17493
17493
  return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
17494
17494
  }
17495
- function toByteArray13(b64) {
17495
+ function toByteArray15(b64) {
17496
17496
  var tmp;
17497
17497
  var lens = getLens(b64);
17498
17498
  var validLen = lens[0];
@@ -17530,7 +17530,7 @@ var require_base64_js = __commonJS({
17530
17530
  }
17531
17531
  return output.join("");
17532
17532
  }
17533
- function fromByteArray14(uint8) {
17533
+ function fromByteArray16(uint8) {
17534
17534
  var tmp;
17535
17535
  var len2 = uint8.length;
17536
17536
  var extraBytes = len2 % 3;
@@ -21177,7 +21177,7 @@ var require_lodash = __commonJS({
21177
21177
  }
21178
21178
  return func(collection, getIteratee(predicate, 3));
21179
21179
  }
21180
- function filter3(collection, predicate) {
21180
+ function filter4(collection, predicate) {
21181
21181
  var func = isArray3(collection) ? arrayFilter : baseFilter;
21182
21182
  return func(collection, getIteratee(predicate, 3));
21183
21183
  }
@@ -22580,7 +22580,7 @@ var require_lodash = __commonJS({
22580
22580
  lodash.dropRightWhile = dropRightWhile;
22581
22581
  lodash.dropWhile = dropWhile;
22582
22582
  lodash.fill = fill;
22583
- lodash.filter = filter3;
22583
+ lodash.filter = filter4;
22584
22584
  lodash.flatMap = flatMap7;
22585
22585
  lodash.flatMapDeep = flatMapDeep;
22586
22586
  lodash.flatMapDepth = flatMapDepth;
@@ -25364,7 +25364,7 @@ var require_firstValueFrom = __commonJS({
25364
25364
  exports.firstValueFrom = void 0;
25365
25365
  var Observable_js_1 = require_Observable();
25366
25366
  var EmptyError_js_1 = require_EmptyError();
25367
- function firstValueFrom2(source, config2) {
25367
+ function firstValueFrom3(source, config2) {
25368
25368
  const hasConfig = typeof config2 === "object";
25369
25369
  return new Promise((resolve2, reject) => {
25370
25370
  const subscriber = new Observable_js_1.Subscriber({
@@ -25384,7 +25384,7 @@ var require_firstValueFrom = __commonJS({
25384
25384
  source.subscribe(subscriber);
25385
25385
  });
25386
25386
  }
25387
- exports.firstValueFrom = firstValueFrom2;
25387
+ exports.firstValueFrom = firstValueFrom3;
25388
25388
  }
25389
25389
  });
25390
25390
 
@@ -26606,13 +26606,13 @@ var require_filter = __commonJS({
26606
26606
  Object.defineProperty(exports, "__esModule", { value: true });
26607
26607
  exports.filter = void 0;
26608
26608
  var Observable_js_1 = require_Observable();
26609
- function filter3(predicate, thisArg) {
26609
+ function filter4(predicate, thisArg) {
26610
26610
  return (source) => new Observable_js_1.Observable((destination) => {
26611
26611
  let index = 0;
26612
26612
  source.subscribe((0, Observable_js_1.operate)({ destination, next: (value) => predicate.call(thisArg, value, index++) && destination.next(value) }));
26613
26613
  });
26614
26614
  }
26615
- exports.filter = filter3;
26615
+ exports.filter = filter4;
26616
26616
  }
26617
26617
  });
26618
26618
 
@@ -28878,12 +28878,12 @@ var require_startWith = __commonJS({
28878
28878
  Object.defineProperty(exports, "__esModule", { value: true });
28879
28879
  exports.startWith = void 0;
28880
28880
  var Observable_js_1 = require_Observable();
28881
- function startWith2(...values2) {
28881
+ function startWith3(...values2) {
28882
28882
  return (source) => new Observable_js_1.Observable((destination) => {
28883
28883
  (0, Observable_js_1.subscribeToArray)(values2, (0, Observable_js_1.operate)({ destination, complete: () => source.subscribe(destination) }));
28884
28884
  });
28885
28885
  }
28886
- exports.startWith = startWith2;
28886
+ exports.startWith = startWith3;
28887
28887
  }
28888
28888
  });
28889
28889
 
@@ -44279,9 +44279,9 @@ var require_asynckit = __commonJS({
44279
44279
  }
44280
44280
  });
44281
44281
 
44282
- // ../../node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/populate.js
44282
+ // ../../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/populate.js
44283
44283
  var require_populate = __commonJS({
44284
- "../../node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/populate.js"(exports, module2) {
44284
+ "../../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/populate.js"(exports, module2) {
44285
44285
  module2.exports = function(dst, src) {
44286
44286
  Object.keys(src).forEach(function(prop) {
44287
44287
  dst[prop] = dst[prop] || src[prop];
@@ -44291,9 +44291,9 @@ var require_populate = __commonJS({
44291
44291
  }
44292
44292
  });
44293
44293
 
44294
- // ../../node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js
44294
+ // ../../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/form_data.js
44295
44295
  var require_form_data = __commonJS({
44296
- "../../node_modules/.pnpm/form-data@4.0.0/node_modules/form-data/lib/form_data.js"(exports, module2) {
44296
+ "../../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/form_data.js"(exports, module2) {
44297
44297
  var CombinedStream = require_combined_stream();
44298
44298
  var util5 = require("util");
44299
44299
  var path6 = require("path");
@@ -44331,7 +44331,7 @@ var require_form_data = __commonJS({
44331
44331
  if (typeof value == "number") {
44332
44332
  value = "" + value;
44333
44333
  }
44334
- if (util5.isArray(value)) {
44334
+ if (Array.isArray(value)) {
44335
44335
  this._error(new Error("Arrays are not supported."));
44336
44336
  return;
44337
44337
  }
@@ -45424,9 +45424,9 @@ var require_src2 = __commonJS({
45424
45424
  }
45425
45425
  });
45426
45426
 
45427
- // ../../node_modules/.pnpm/follow-redirects@1.15.3/node_modules/follow-redirects/debug.js
45427
+ // ../../node_modules/.pnpm/follow-redirects@1.15.9/node_modules/follow-redirects/debug.js
45428
45428
  var require_debug2 = __commonJS({
45429
- "../../node_modules/.pnpm/follow-redirects@1.15.3/node_modules/follow-redirects/debug.js"(exports, module2) {
45429
+ "../../node_modules/.pnpm/follow-redirects@1.15.9/node_modules/follow-redirects/debug.js"(exports, module2) {
45430
45430
  var debug4;
45431
45431
  module2.exports = function() {
45432
45432
  if (!debug4) {
@@ -45444,9 +45444,9 @@ var require_debug2 = __commonJS({
45444
45444
  }
45445
45445
  });
45446
45446
 
45447
- // ../../node_modules/.pnpm/follow-redirects@1.15.3/node_modules/follow-redirects/index.js
45447
+ // ../../node_modules/.pnpm/follow-redirects@1.15.9/node_modules/follow-redirects/index.js
45448
45448
  var require_follow_redirects = __commonJS({
45449
- "../../node_modules/.pnpm/follow-redirects@1.15.3/node_modules/follow-redirects/index.js"(exports, module2) {
45449
+ "../../node_modules/.pnpm/follow-redirects@1.15.9/node_modules/follow-redirects/index.js"(exports, module2) {
45450
45450
  var url2 = require("url");
45451
45451
  var URL3 = url2.URL;
45452
45452
  var http2 = require("http");
@@ -45454,6 +45454,33 @@ var require_follow_redirects = __commonJS({
45454
45454
  var Writable = require("stream").Writable;
45455
45455
  var assert2 = require("assert");
45456
45456
  var debug4 = require_debug2();
45457
+ (function detectUnsupportedEnvironment() {
45458
+ var looksLikeNode = typeof process !== "undefined";
45459
+ var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
45460
+ var looksLikeV8 = isFunction5(Error.captureStackTrace);
45461
+ if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
45462
+ console.warn("The follow-redirects package should be excluded from browser builds.");
45463
+ }
45464
+ })();
45465
+ var useNativeURL = false;
45466
+ try {
45467
+ assert2(new URL3(""));
45468
+ } catch (error) {
45469
+ useNativeURL = error.code === "ERR_INVALID_URL";
45470
+ }
45471
+ var preservedUrlFields = [
45472
+ "auth",
45473
+ "host",
45474
+ "hostname",
45475
+ "href",
45476
+ "path",
45477
+ "pathname",
45478
+ "port",
45479
+ "protocol",
45480
+ "query",
45481
+ "search",
45482
+ "hash"
45483
+ ];
45457
45484
  var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
45458
45485
  var eventHandlers = /* @__PURE__ */ Object.create(null);
45459
45486
  events.forEach(function(event) {
@@ -45472,7 +45499,8 @@ var require_follow_redirects = __commonJS({
45472
45499
  );
45473
45500
  var TooManyRedirectsError = createErrorType(
45474
45501
  "ERR_FR_TOO_MANY_REDIRECTS",
45475
- "Maximum number of redirects exceeded"
45502
+ "Maximum number of redirects exceeded",
45503
+ RedirectionError
45476
45504
  );
45477
45505
  var MaxBodyLengthExceededError = createErrorType(
45478
45506
  "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
@@ -45498,7 +45526,11 @@ var require_follow_redirects = __commonJS({
45498
45526
  }
45499
45527
  var self2 = this;
45500
45528
  this._onNativeResponse = function(response) {
45501
- self2._processResponse(response);
45529
+ try {
45530
+ self2._processResponse(response);
45531
+ } catch (cause) {
45532
+ self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
45533
+ }
45502
45534
  };
45503
45535
  this._performRequest();
45504
45536
  }
@@ -45657,8 +45689,7 @@ var require_follow_redirects = __commonJS({
45657
45689
  var protocol = this._options.protocol;
45658
45690
  var nativeProtocol = this._options.nativeProtocols[protocol];
45659
45691
  if (!nativeProtocol) {
45660
- this.emit("error", new TypeError("Unsupported protocol " + protocol));
45661
- return;
45692
+ throw new TypeError("Unsupported protocol " + protocol);
45662
45693
  }
45663
45694
  if (this._options.agents) {
45664
45695
  var scheme = protocol.slice(0, -1);
@@ -45714,8 +45745,7 @@ var require_follow_redirects = __commonJS({
45714
45745
  destroyRequest(this._currentRequest);
45715
45746
  response.destroy();
45716
45747
  if (++this._redirectCount > this._options.maxRedirects) {
45717
- this.emit("error", new TooManyRedirectsError());
45718
- return;
45748
+ throw new TooManyRedirectsError();
45719
45749
  }
45720
45750
  var requestHeaders;
45721
45751
  var beforeRedirect = this._options.beforeRedirect;
@@ -45736,22 +45766,15 @@ var require_follow_redirects = __commonJS({
45736
45766
  removeMatchingHeaders(/^content-/i, this._options.headers);
45737
45767
  }
45738
45768
  var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
45739
- var currentUrlParts = url2.parse(this._currentUrl);
45769
+ var currentUrlParts = parseUrl2(this._currentUrl);
45740
45770
  var currentHost = currentHostHeader || currentUrlParts.host;
45741
45771
  var currentUrl = /^\w+:/.test(location2) ? this._currentUrl : url2.format(Object.assign(currentUrlParts, { host: currentHost }));
45742
- var redirectUrl;
45743
- try {
45744
- redirectUrl = url2.resolve(currentUrl, location2);
45745
- } catch (cause) {
45746
- this.emit("error", new RedirectionError({ cause }));
45747
- return;
45748
- }
45749
- debug4("redirecting to", redirectUrl);
45772
+ var redirectUrl = resolveUrl(location2, currentUrl);
45773
+ debug4("redirecting to", redirectUrl.href);
45750
45774
  this._isRedirect = true;
45751
- var redirectUrlParts = url2.parse(redirectUrl);
45752
- Object.assign(this._options, redirectUrlParts);
45753
- if (redirectUrlParts.protocol !== currentUrlParts.protocol && redirectUrlParts.protocol !== "https:" || redirectUrlParts.host !== currentHost && !isSubdomain(redirectUrlParts.host, currentHost)) {
45754
- removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
45775
+ spreadUrlObject(redirectUrl, this._options);
45776
+ if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
45777
+ removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
45755
45778
  }
45756
45779
  if (isFunction5(beforeRedirect)) {
45757
45780
  var responseDetails = {
@@ -45763,19 +45786,10 @@ var require_follow_redirects = __commonJS({
45763
45786
  method,
45764
45787
  headers: requestHeaders
45765
45788
  };
45766
- try {
45767
- beforeRedirect(this._options, responseDetails, requestDetails);
45768
- } catch (err) {
45769
- this.emit("error", err);
45770
- return;
45771
- }
45789
+ beforeRedirect(this._options, responseDetails, requestDetails);
45772
45790
  this._sanitizeOptions(this._options);
45773
45791
  }
45774
- try {
45775
- this._performRequest();
45776
- } catch (cause) {
45777
- this.emit("error", new RedirectionError({ cause }));
45778
- }
45792
+ this._performRequest();
45779
45793
  };
45780
45794
  function wrap3(protocols) {
45781
45795
  var exports2 = {
@@ -45788,22 +45802,13 @@ var require_follow_redirects = __commonJS({
45788
45802
  var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
45789
45803
  var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
45790
45804
  function request2(input2, options, callback) {
45791
- if (isString4(input2)) {
45792
- var parsed;
45793
- try {
45794
- parsed = urlToOptions(new URL3(input2));
45795
- } catch (err) {
45796
- parsed = url2.parse(input2);
45797
- }
45798
- if (!isString4(parsed.protocol)) {
45799
- throw new InvalidUrlError({ input: input2 });
45800
- }
45801
- input2 = parsed;
45802
- } else if (URL3 && input2 instanceof URL3) {
45803
- input2 = urlToOptions(input2);
45805
+ if (isURL(input2)) {
45806
+ input2 = spreadUrlObject(input2);
45807
+ } else if (isString4(input2)) {
45808
+ input2 = spreadUrlObject(parseUrl2(input2));
45804
45809
  } else {
45805
45810
  callback = options;
45806
- options = input2;
45811
+ options = validateUrl(input2);
45807
45812
  input2 = { protocol };
45808
45813
  }
45809
45814
  if (isFunction5(options)) {
@@ -45836,23 +45841,43 @@ var require_follow_redirects = __commonJS({
45836
45841
  }
45837
45842
  function noop4() {
45838
45843
  }
45839
- function urlToOptions(urlObject) {
45840
- var options = {
45841
- protocol: urlObject.protocol,
45842
- hostname: urlObject.hostname.startsWith("[") ? (
45843
- /* istanbul ignore next */
45844
- urlObject.hostname.slice(1, -1)
45845
- ) : urlObject.hostname,
45846
- hash: urlObject.hash,
45847
- search: urlObject.search,
45848
- pathname: urlObject.pathname,
45849
- path: urlObject.pathname + urlObject.search,
45850
- href: urlObject.href
45851
- };
45852
- if (urlObject.port !== "") {
45853
- options.port = Number(urlObject.port);
45844
+ function parseUrl2(input2) {
45845
+ var parsed;
45846
+ if (useNativeURL) {
45847
+ parsed = new URL3(input2);
45848
+ } else {
45849
+ parsed = validateUrl(url2.parse(input2));
45850
+ if (!isString4(parsed.protocol)) {
45851
+ throw new InvalidUrlError({ input: input2 });
45852
+ }
45854
45853
  }
45855
- return options;
45854
+ return parsed;
45855
+ }
45856
+ function resolveUrl(relative, base) {
45857
+ return useNativeURL ? new URL3(relative, base) : parseUrl2(url2.resolve(base, relative));
45858
+ }
45859
+ function validateUrl(input2) {
45860
+ if (/^\[/.test(input2.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input2.hostname)) {
45861
+ throw new InvalidUrlError({ input: input2.href || input2 });
45862
+ }
45863
+ if (/^\[/.test(input2.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input2.host)) {
45864
+ throw new InvalidUrlError({ input: input2.href || input2 });
45865
+ }
45866
+ return input2;
45867
+ }
45868
+ function spreadUrlObject(urlObject, target) {
45869
+ var spread3 = target || {};
45870
+ for (var key of preservedUrlFields) {
45871
+ spread3[key] = urlObject[key];
45872
+ }
45873
+ if (spread3.hostname.startsWith("[")) {
45874
+ spread3.hostname = spread3.hostname.slice(1, -1);
45875
+ }
45876
+ if (spread3.port !== "") {
45877
+ spread3.port = Number(spread3.port);
45878
+ }
45879
+ spread3.path = spread3.search ? spread3.pathname + spread3.search : spread3.pathname;
45880
+ return spread3;
45856
45881
  }
45857
45882
  function removeMatchingHeaders(regex2, headers) {
45858
45883
  var lastValue;
@@ -45866,14 +45891,24 @@ var require_follow_redirects = __commonJS({
45866
45891
  }
45867
45892
  function createErrorType(code, message2, baseClass) {
45868
45893
  function CustomError(properties) {
45869
- Error.captureStackTrace(this, this.constructor);
45894
+ if (isFunction5(Error.captureStackTrace)) {
45895
+ Error.captureStackTrace(this, this.constructor);
45896
+ }
45870
45897
  Object.assign(this, properties || {});
45871
45898
  this.code = code;
45872
45899
  this.message = this.cause ? message2 + ": " + this.cause.message : message2;
45873
45900
  }
45874
45901
  CustomError.prototype = new (baseClass || Error)();
45875
- CustomError.prototype.constructor = CustomError;
45876
- CustomError.prototype.name = "Error [" + code + "]";
45902
+ Object.defineProperties(CustomError.prototype, {
45903
+ constructor: {
45904
+ value: CustomError,
45905
+ enumerable: false
45906
+ },
45907
+ name: {
45908
+ value: "Error [" + code + "]",
45909
+ enumerable: false
45910
+ }
45911
+ });
45877
45912
  return CustomError;
45878
45913
  }
45879
45914
  function destroyRequest(request2, error) {
@@ -45897,6 +45932,9 @@ var require_follow_redirects = __commonJS({
45897
45932
  function isBuffer2(value) {
45898
45933
  return typeof value === "object" && "length" in value;
45899
45934
  }
45935
+ function isURL(value) {
45936
+ return URL3 && value instanceof URL3;
45937
+ }
45900
45938
  module2.exports = wrap3({ http: http2, https: https2 });
45901
45939
  module2.exports.wrap = wrap3;
45902
45940
  }
@@ -52224,18 +52262,18 @@ var require_lib4 = __commonJS({
52224
52262
  return parse_url(urlStr);
52225
52263
  }
52226
52264
  var streamDestructionSupported = "destroy" in Stream3.Readable.prototype;
52227
- function isRequest(input2) {
52265
+ function isRequest2(input2) {
52228
52266
  return typeof input2 === "object" && typeof input2[INTERNALS$2] === "object";
52229
52267
  }
52230
52268
  function isAbortSignal(signal) {
52231
52269
  const proto = signal && typeof signal === "object" && Object.getPrototypeOf(signal);
52232
52270
  return !!(proto && proto.constructor.name === "AbortSignal");
52233
52271
  }
52234
- var Request5 = class _Request {
52272
+ var Request6 = class _Request {
52235
52273
  constructor(input2) {
52236
52274
  let init = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
52237
52275
  let parsedURL;
52238
- if (!isRequest(input2)) {
52276
+ if (!isRequest2(input2)) {
52239
52277
  if (input2 && input2.href) {
52240
52278
  parsedURL = parseURL(input2.href);
52241
52279
  } else {
@@ -52247,10 +52285,10 @@ var require_lib4 = __commonJS({
52247
52285
  }
52248
52286
  let method = init.method || input2.method || "GET";
52249
52287
  method = method.toUpperCase();
52250
- if ((init.body != null || isRequest(input2) && input2.body !== null) && (method === "GET" || method === "HEAD")) {
52288
+ if ((init.body != null || isRequest2(input2) && input2.body !== null) && (method === "GET" || method === "HEAD")) {
52251
52289
  throw new TypeError("Request with GET/HEAD method cannot have body");
52252
52290
  }
52253
- let inputBody = init.body != null ? init.body : isRequest(input2) && input2.body !== null ? clone3(input2) : null;
52291
+ let inputBody = init.body != null ? init.body : isRequest2(input2) && input2.body !== null ? clone3(input2) : null;
52254
52292
  Body.call(this, inputBody, {
52255
52293
  timeout: init.timeout || input2.timeout || 0,
52256
52294
  size: init.size || input2.size || 0
@@ -52262,7 +52300,7 @@ var require_lib4 = __commonJS({
52262
52300
  headers.append("Content-Type", contentType);
52263
52301
  }
52264
52302
  }
52265
- let signal = isRequest(input2) ? input2.signal : null;
52303
+ let signal = isRequest2(input2) ? input2.signal : null;
52266
52304
  if ("signal" in init)
52267
52305
  signal = init.signal;
52268
52306
  if (signal != null && !isAbortSignal(signal)) {
@@ -52304,14 +52342,14 @@ var require_lib4 = __commonJS({
52304
52342
  return new _Request(this);
52305
52343
  }
52306
52344
  };
52307
- Body.mixIn(Request5.prototype);
52308
- Object.defineProperty(Request5.prototype, Symbol.toStringTag, {
52345
+ Body.mixIn(Request6.prototype);
52346
+ Object.defineProperty(Request6.prototype, Symbol.toStringTag, {
52309
52347
  value: "Request",
52310
52348
  writable: false,
52311
52349
  enumerable: false,
52312
52350
  configurable: true
52313
52351
  });
52314
- Object.defineProperties(Request5.prototype, {
52352
+ Object.defineProperties(Request6.prototype, {
52315
52353
  method: { enumerable: true },
52316
52354
  url: { enumerable: true },
52317
52355
  headers: { enumerable: true },
@@ -52390,7 +52428,7 @@ var require_lib4 = __commonJS({
52390
52428
  }
52391
52429
  Body.Promise = fetch6.Promise;
52392
52430
  return new fetch6.Promise(function(resolve2, reject) {
52393
- const request2 = new Request5(url2, opts);
52431
+ const request2 = new Request6(url2, opts);
52394
52432
  const options = getNodeRequestOptions(request2);
52395
52433
  const send = (options.protocol === "https:" ? https2 : http2).request;
52396
52434
  const signal = request2.signal;
@@ -52524,7 +52562,7 @@ var require_lib4 = __commonJS({
52524
52562
  requestOpts.body = void 0;
52525
52563
  requestOpts.headers.delete("content-length");
52526
52564
  }
52527
- resolve2(fetch6(new Request5(locationURL, requestOpts)));
52565
+ resolve2(fetch6(new Request6(locationURL, requestOpts)));
52528
52566
  finalize();
52529
52567
  return;
52530
52568
  }
@@ -52625,7 +52663,7 @@ var require_lib4 = __commonJS({
52625
52663
  Object.defineProperty(exports, "__esModule", { value: true });
52626
52664
  exports.default = exports;
52627
52665
  exports.Headers = Headers6;
52628
- exports.Request = Request5;
52666
+ exports.Request = Request6;
52629
52667
  exports.Response = Response6;
52630
52668
  exports.FetchError = FetchError;
52631
52669
  exports.AbortError = AbortError;
@@ -52653,7 +52691,7 @@ var require_node_ponyfill = __commonJS({
52653
52691
  }
52654
52692
  });
52655
52693
 
52656
- // ../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs
52694
+ // ../../node_modules/.pnpm/tslib@2.8.0/node_modules/tslib/tslib.es6.mjs
52657
52695
  var tslib_es6_exports = {};
52658
52696
  __export(tslib_es6_exports, {
52659
52697
  __addDisposableResource: () => __addDisposableResource,
@@ -52681,6 +52719,7 @@ __export(tslib_es6_exports, {
52681
52719
  __propKey: () => __propKey,
52682
52720
  __read: () => __read5,
52683
52721
  __rest: () => __rest,
52722
+ __rewriteRelativeImportExtension: () => __rewriteRelativeImportExtension,
52684
52723
  __runInitializers: () => __runInitializers,
52685
52724
  __setFunctionName: () => __setFunctionName,
52686
52725
  __spread: () => __spread,
@@ -52820,8 +52859,8 @@ function __generator(thisArg, body) {
52820
52859
  if (t2[0] & 1)
52821
52860
  throw t2[1];
52822
52861
  return t2[1];
52823
- }, trys: [], ops: [] }, f2, y2, t2, g2;
52824
- return g2 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
52862
+ }, trys: [], ops: [] }, f2, y2, t2, g2 = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
52863
+ return g2.next = verb(0), g2["throw"] = verb(1), g2["return"] = verb(2), typeof Symbol === "function" && (g2[Symbol.iterator] = function() {
52825
52864
  return this;
52826
52865
  }), g2;
52827
52866
  function verb(n3) {
@@ -52962,16 +53001,24 @@ function __asyncGenerator2(thisArg, _arguments, generator) {
52962
53001
  if (!Symbol.asyncIterator)
52963
53002
  throw new TypeError("Symbol.asyncIterator is not defined.");
52964
53003
  var g2 = generator.apply(thisArg, _arguments || []), i2, q2 = [];
52965
- return i2 = {}, verb("next"), verb("throw"), verb("return"), i2[Symbol.asyncIterator] = function() {
53004
+ return i2 = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i2[Symbol.asyncIterator] = function() {
52966
53005
  return this;
52967
53006
  }, i2;
52968
- function verb(n3) {
52969
- if (g2[n3])
53007
+ function awaitReturn(f2) {
53008
+ return function(v2) {
53009
+ return Promise.resolve(v2).then(f2, reject);
53010
+ };
53011
+ }
53012
+ function verb(n3, f2) {
53013
+ if (g2[n3]) {
52970
53014
  i2[n3] = function(v2) {
52971
53015
  return new Promise(function(a3, b2) {
52972
53016
  q2.push([n3, v2, a3, b2]) > 1 || resume(n3, v2);
52973
53017
  });
52974
53018
  };
53019
+ if (f2)
53020
+ i2[n3] = f2(i2[n3]);
53021
+ }
52975
53022
  }
52976
53023
  function resume(n3, v2) {
52977
53024
  try {
@@ -53075,7 +53122,7 @@ function __addDisposableResource(env2, value, async) {
53075
53122
  if (value !== null && value !== void 0) {
53076
53123
  if (typeof value !== "object" && typeof value !== "function")
53077
53124
  throw new TypeError("Object expected.");
53078
- var dispose;
53125
+ var dispose, inner;
53079
53126
  if (async) {
53080
53127
  if (!Symbol.asyncDispose)
53081
53128
  throw new TypeError("Symbol.asyncDispose is not defined.");
@@ -53085,9 +53132,19 @@ function __addDisposableResource(env2, value, async) {
53085
53132
  if (!Symbol.dispose)
53086
53133
  throw new TypeError("Symbol.dispose is not defined.");
53087
53134
  dispose = value[Symbol.dispose];
53135
+ if (async)
53136
+ inner = dispose;
53088
53137
  }
53089
53138
  if (typeof dispose !== "function")
53090
53139
  throw new TypeError("Object not disposable.");
53140
+ if (inner)
53141
+ dispose = function() {
53142
+ try {
53143
+ inner.call(this);
53144
+ } catch (e2) {
53145
+ return Promise.reject(e2);
53146
+ }
53147
+ };
53091
53148
  env2.stack.push({ value, dispose, async });
53092
53149
  } else if (async) {
53093
53150
  env2.stack.push({ async: true });
@@ -53099,28 +53156,43 @@ function __disposeResources(env2) {
53099
53156
  env2.error = env2.hasError ? new _SuppressedError(e2, env2.error, "An error was suppressed during disposal.") : e2;
53100
53157
  env2.hasError = true;
53101
53158
  }
53159
+ var r2, s3 = 0;
53102
53160
  function next() {
53103
- while (env2.stack.length) {
53104
- var rec = env2.stack.pop();
53161
+ while (r2 = env2.stack.pop()) {
53105
53162
  try {
53106
- var result = rec.dispose && rec.dispose.call(rec.value);
53107
- if (rec.async)
53108
- return Promise.resolve(result).then(next, function(e2) {
53109
- fail(e2);
53110
- return next();
53111
- });
53163
+ if (!r2.async && s3 === 1)
53164
+ return s3 = 0, env2.stack.push(r2), Promise.resolve().then(next);
53165
+ if (r2.dispose) {
53166
+ var result = r2.dispose.call(r2.value);
53167
+ if (r2.async)
53168
+ return s3 |= 2, Promise.resolve(result).then(next, function(e2) {
53169
+ fail(e2);
53170
+ return next();
53171
+ });
53172
+ } else
53173
+ s3 |= 1;
53112
53174
  } catch (e2) {
53113
53175
  fail(e2);
53114
53176
  }
53115
53177
  }
53178
+ if (s3 === 1)
53179
+ return env2.hasError ? Promise.reject(env2.error) : Promise.resolve();
53116
53180
  if (env2.hasError)
53117
53181
  throw env2.error;
53118
53182
  }
53119
53183
  return next();
53120
53184
  }
53185
+ function __rewriteRelativeImportExtension(path6, preserveJsx) {
53186
+ if (typeof path6 === "string" && /^\.\.?\//.test(path6)) {
53187
+ return path6.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m2, tsx, d2, ext, cm) {
53188
+ return tsx ? preserveJsx ? ".jsx" : ".js" : d2 && (!ext || !cm) ? m2 : d2 + ext + "." + cm.toLowerCase() + "js";
53189
+ });
53190
+ }
53191
+ return path6;
53192
+ }
53121
53193
  var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default;
53122
53194
  var init_tslib_es6 = __esm({
53123
- "../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs"() {
53195
+ "../../node_modules/.pnpm/tslib@2.8.0/node_modules/tslib/tslib.es6.mjs"() {
53124
53196
  extendStatics = function(d2, b2) {
53125
53197
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) {
53126
53198
  d3.__proto__ = b3;
@@ -53173,6 +53245,10 @@ var init_tslib_es6 = __esm({
53173
53245
  __rest,
53174
53246
  __decorate,
53175
53247
  __param,
53248
+ __esDecorate,
53249
+ __runInitializers,
53250
+ __propKey,
53251
+ __setFunctionName,
53176
53252
  __metadata,
53177
53253
  __awaiter: __awaiter2,
53178
53254
  __generator,
@@ -53194,7 +53270,8 @@ var init_tslib_es6 = __esm({
53194
53270
  __classPrivateFieldSet,
53195
53271
  __classPrivateFieldIn,
53196
53272
  __addDisposableResource,
53197
- __disposeResources
53273
+ __disposeResources,
53274
+ __rewriteRelativeImportExtension
53198
53275
  };
53199
53276
  }
53200
53277
  });
@@ -53828,7 +53905,7 @@ var require_utils3 = __commonJS({
53828
53905
  }
53829
53906
  return 64;
53830
53907
  }
53831
- function test(incoming) {
53908
+ function test2(incoming) {
53832
53909
  return incoming === 64 ? 0 : incoming;
53833
53910
  }
53834
53911
  let i2 = 0;
@@ -53838,9 +53915,9 @@ var require_utils3 = __commonJS({
53838
53915
  const enc2 = i2 >= input2.length ? 0 : indexOf(input2.charAt(i2++));
53839
53916
  const enc3 = i2 >= input2.length ? 0 : indexOf(input2.charAt(i2++));
53840
53917
  const enc4 = i2 >= input2.length ? 0 : indexOf(input2.charAt(i2++));
53841
- const chr1 = test(enc1) << 2 | test(enc2) >> 4;
53842
- const chr2 = (test(enc2) & 15) << 4 | test(enc3) >> 2;
53843
- const chr3 = (test(enc3) & 3) << 6 | test(enc4);
53918
+ const chr1 = test2(enc1) << 2 | test2(enc2) >> 4;
53919
+ const chr2 = (test2(enc2) & 15) << 4 | test2(enc3) >> 2;
53920
+ const chr3 = (test2(enc3) & 3) << 6 | test2(enc4);
53844
53921
  output += String.fromCharCode(chr1);
53845
53922
  if (enc3 !== 64) {
53846
53923
  output += String.fromCharCode(chr2);
@@ -86322,7 +86399,7 @@ function stateUpdatedEvent(state, version = null) {
86322
86399
  }
86323
86400
 
86324
86401
  // ../aux-common/partitions/PartitionUtils.ts
86325
- var import_base64_js3 = __toESM(require_base64_js());
86402
+ var import_base64_js4 = __toESM(require_base64_js());
86326
86403
 
86327
86404
  // ../../node_modules/.pnpm/lib0@0.2.88/node_modules/lib0/map.js
86328
86405
  var create = () => /* @__PURE__ */ new Map();
@@ -87312,11 +87389,11 @@ var createIterator = (next) => ({
87312
87389
  // @ts-ignore
87313
87390
  next
87314
87391
  });
87315
- var iteratorFilter = (iterator2, filter3) => createIterator(() => {
87392
+ var iteratorFilter = (iterator2, filter4) => createIterator(() => {
87316
87393
  let res;
87317
87394
  do {
87318
87395
  res = iterator2.next();
87319
- } while (!res.done && !filter3(res.value));
87396
+ } while (!res.done && !filter4(res.value));
87320
87397
  return res;
87321
87398
  });
87322
87399
  var iteratorMap = (iterator2, fmap) => createIterator(() => {
@@ -87608,8 +87685,8 @@ var Doc = class _Doc extends Observable {
87608
87685
  *
87609
87686
  * @public
87610
87687
  */
87611
- transact(f2, origin = null) {
87612
- return transact(this, f2, origin);
87688
+ transact(f2, origin2 = null) {
87689
+ return transact(this, f2, origin2);
87613
87690
  }
87614
87691
  /**
87615
87692
  * Define a shared data type.
@@ -88617,6 +88694,38 @@ var AbsolutePosition = class {
88617
88694
  }
88618
88695
  };
88619
88696
  var createAbsolutePosition = (type, index, assoc = 0) => new AbsolutePosition(type, index, assoc);
88697
+ var createRelativePosition = (type, item, assoc) => {
88698
+ let typeid = null;
88699
+ let tname = null;
88700
+ if (type._item === null) {
88701
+ tname = findRootTypeKey(type);
88702
+ } else {
88703
+ typeid = createID(type._item.id.client, type._item.id.clock);
88704
+ }
88705
+ return new RelativePosition(typeid, tname, item, assoc);
88706
+ };
88707
+ var createRelativePositionFromTypeIndex = (type, index, assoc = 0) => {
88708
+ let t2 = type._start;
88709
+ if (assoc < 0) {
88710
+ if (index === 0) {
88711
+ return createRelativePosition(type, null, assoc);
88712
+ }
88713
+ index--;
88714
+ }
88715
+ while (t2 !== null) {
88716
+ if (!t2.deleted && t2.countable) {
88717
+ if (t2.length > index) {
88718
+ return createRelativePosition(type, createID(t2.id.client, t2.id.clock + index), assoc);
88719
+ }
88720
+ index -= t2.length;
88721
+ }
88722
+ if (t2.right === null && assoc < 0) {
88723
+ return createRelativePosition(type, t2.lastId, assoc);
88724
+ }
88725
+ t2 = t2.right;
88726
+ }
88727
+ return createRelativePosition(type, null, assoc);
88728
+ };
88620
88729
  var createAbsolutePositionFromRelativePosition = (rpos, doc) => {
88621
88730
  const store = doc.store;
88622
88731
  const rightID = rpos.item;
@@ -88818,7 +88927,7 @@ var Transaction = class {
88818
88927
  * @param {any} origin
88819
88928
  * @param {boolean} local
88820
88929
  */
88821
- constructor(doc, origin, local) {
88930
+ constructor(doc, origin2, local) {
88822
88931
  this.doc = doc;
88823
88932
  this.deleteSet = new DeleteSet();
88824
88933
  this.beforeState = getStateVector(doc.store);
@@ -88826,7 +88935,7 @@ var Transaction = class {
88826
88935
  this.changed = /* @__PURE__ */ new Map();
88827
88936
  this.changedParentTypes = /* @__PURE__ */ new Map();
88828
88937
  this._mergeStructs = [];
88829
- this.origin = origin;
88938
+ this.origin = origin2;
88830
88939
  this.meta = /* @__PURE__ */ new Map();
88831
88940
  this.local = local;
88832
88941
  this.subdocsAdded = /* @__PURE__ */ new Set();
@@ -89026,13 +89135,13 @@ var cleanupTransactions = (transactionCleanups, i2) => {
89026
89135
  }
89027
89136
  }
89028
89137
  };
89029
- var transact = (doc, f2, origin = null, local = true) => {
89138
+ var transact = (doc, f2, origin2 = null, local = true) => {
89030
89139
  const transactionCleanups = doc._transactionCleanups;
89031
89140
  let initialCall = false;
89032
89141
  let result = null;
89033
89142
  if (doc._transaction === null) {
89034
89143
  initialCall = true;
89035
- doc._transaction = new Transaction(doc, origin, local);
89144
+ doc._transaction = new Transaction(doc, origin2, local);
89036
89145
  transactionCleanups.push(doc._transaction);
89037
89146
  if (transactionCleanups.length === 1) {
89038
89147
  doc.emit("beforeAllTransactions", [doc]);
@@ -91729,8 +91838,8 @@ var YXmlFragment = class _YXmlFragment extends AbstractType {
91729
91838
  *
91730
91839
  * @public
91731
91840
  */
91732
- createTreeWalker(filter3) {
91733
- return new YXmlTreeWalker(this, filter3);
91841
+ createTreeWalker(filter4) {
91842
+ return new YXmlTreeWalker(this, filter4);
91734
91843
  }
91735
91844
  /**
91736
91845
  * Returns the first YXmlElement that matches the query.
@@ -93316,9 +93425,9 @@ var Item = class _Item extends AbstractStruct {
93316
93425
  * @param {string | null} parentSub
93317
93426
  * @param {AbstractContent} content
93318
93427
  */
93319
- constructor(id2, left, origin, right, rightOrigin, parent, parentSub, content) {
93428
+ constructor(id2, left, origin2, right, rightOrigin, parent, parentSub, content) {
93320
93429
  super(id2, content.getLength());
93321
- this.origin = origin;
93430
+ this.origin = origin2;
93322
93431
  this.left = left;
93323
93432
  this.right = right;
93324
93433
  this.rightOrigin = rightOrigin;
@@ -93623,20 +93732,20 @@ var Item = class _Item extends AbstractStruct {
93623
93732
  * @param {number} offset
93624
93733
  */
93625
93734
  write(encoder2, offset2) {
93626
- const origin = offset2 > 0 ? createID(this.id.client, this.id.clock + offset2 - 1) : this.origin;
93735
+ const origin2 = offset2 > 0 ? createID(this.id.client, this.id.clock + offset2 - 1) : this.origin;
93627
93736
  const rightOrigin = this.rightOrigin;
93628
93737
  const parentSub = this.parentSub;
93629
- const info = this.content.getRef() & BITS5 | (origin === null ? 0 : BIT8) | // origin is defined
93738
+ const info = this.content.getRef() & BITS5 | (origin2 === null ? 0 : BIT8) | // origin is defined
93630
93739
  (rightOrigin === null ? 0 : BIT7) | // right origin is defined
93631
93740
  (parentSub === null ? 0 : BIT6);
93632
93741
  encoder2.writeInfo(info);
93633
- if (origin !== null) {
93634
- encoder2.writeLeftID(origin);
93742
+ if (origin2 !== null) {
93743
+ encoder2.writeLeftID(origin2);
93635
93744
  }
93636
93745
  if (rightOrigin !== null) {
93637
93746
  encoder2.writeRightID(rightOrigin);
93638
93747
  }
93639
- if (origin === null && rightOrigin === null) {
93748
+ if (origin2 === null && rightOrigin === null) {
93640
93749
  const parent = (
93641
93750
  /** @type {AbstractType<any>} */
93642
93751
  this.parent
@@ -93749,7 +93858,6 @@ if (glo[importIdentifier] === true) {
93749
93858
  glo[importIdentifier] = true;
93750
93859
 
93751
93860
  // ../aux-common/partitions/YjsPartition.ts
93752
- var import_rxjs3 = __toESM(require_cjs());
93753
93861
  var import_lodash8 = __toESM(require_lodash());
93754
93862
 
93755
93863
  // ../aux-common/partitions/MemoryPartition.ts
@@ -94081,7 +94189,7 @@ function createRelativePositionFromStateVector(text, vector, index, assoc = 0, i
94081
94189
  let t2 = text._start;
94082
94190
  if (assoc < 0) {
94083
94191
  if (index === 0) {
94084
- return createRelativePosition(text, null, assoc);
94192
+ return createRelativePosition2(text, null, assoc);
94085
94193
  }
94086
94194
  index--;
94087
94195
  }
@@ -94090,7 +94198,7 @@ function createRelativePositionFromStateVector(text, vector, index, assoc = 0, i
94090
94198
  if (typeof clientVersion === "number" && t2.id.clock <= clientVersion) {
94091
94199
  if ((!t2.deleted || includeDeleted) && t2.countable) {
94092
94200
  if (t2.length > index) {
94093
- return createRelativePosition(
94201
+ return createRelativePosition2(
94094
94202
  text,
94095
94203
  createID(t2.id.client, t2.id.clock + index),
94096
94204
  assoc
@@ -94099,14 +94207,14 @@ function createRelativePositionFromStateVector(text, vector, index, assoc = 0, i
94099
94207
  index -= t2.length;
94100
94208
  }
94101
94209
  if (t2.right === null && assoc < 0) {
94102
- return createRelativePosition(text, t2.lastId, assoc);
94210
+ return createRelativePosition2(text, t2.lastId, assoc);
94103
94211
  }
94104
94212
  }
94105
94213
  t2 = t2.right;
94106
94214
  }
94107
- return createRelativePosition(text, null, assoc);
94215
+ return createRelativePosition2(text, null, assoc);
94108
94216
  }
94109
- function createRelativePosition(type, item, assoc) {
94217
+ function createRelativePosition2(type, item, assoc) {
94110
94218
  let typeid = null;
94111
94219
  let tname = null;
94112
94220
  if (type._item === null) {
@@ -94117,6 +94225,13 @@ function createRelativePosition(type, item, assoc) {
94117
94225
  return new RelativePosition(typeid, tname, item, assoc);
94118
94226
  }
94119
94227
 
94228
+ // ../aux-common/partitions/YjsPartition.ts
94229
+ var import_base64_js3 = __toESM(require_base64_js());
94230
+
94231
+ // ../aux-common/documents/YjsSharedDocument.ts
94232
+ var import_rxjs3 = __toESM(require_cjs());
94233
+ var import_base64_js2 = __toESM(require_base64_js());
94234
+
94120
94235
  // ../../node_modules/.pnpm/lib0@0.2.49/node_modules/lib0/promise.js
94121
94236
  var create6 = (f2) => (
94122
94237
  /** @type {Promise<T>} */
@@ -94342,8 +94457,8 @@ var YjsIndexedDBPersistence = class {
94342
94457
  afterApplyUpdatesCallback
94343
94458
  );
94344
94459
  }
94345
- _storeUpdate(update, origin) {
94346
- if (this.db && origin !== this) {
94460
+ _storeUpdate(update, origin2) {
94461
+ if (this.db && origin2 !== this) {
94347
94462
  const [updatesStore] = transact2(this.db, [updatesStoreName]);
94348
94463
  addAutoKey(updatesStore, update);
94349
94464
  if (++this._dbsize >= PREFERRED_TRIM_SIZE) {
@@ -94417,31 +94532,31 @@ var YjsIndexedDBPersistence = class {
94417
94532
  }
94418
94533
  };
94419
94534
 
94420
- // ../aux-common/partitions/YjsPartition.ts
94421
- var import_base64_js2 = __toESM(require_base64_js());
94535
+ // ../aux-common/documents/YjsSharedDocument.ts
94422
94536
  var APPLY_UPDATES_TO_INST_TRANSACTION_ORIGIN = "__apply_updates_to_inst";
94423
- var YjsPartitionImpl = class _YjsPartitionImpl {
94537
+ var YjsSharedDocument = class {
94424
94538
  constructor(config2) {
94539
+ this._onUpdates = new import_rxjs3.Subject();
94425
94540
  this._onError = new import_rxjs3.Subject();
94426
94541
  this._onEvents = new import_rxjs3.Subject();
94427
94542
  this._onStatusUpdated = new import_rxjs3.Subject();
94428
- this._hasRegisteredSubs = false;
94543
+ this._onClientError = new import_rxjs3.Subject();
94429
94544
  this._sub = new import_rxjs3.Subscription();
94430
94545
  this._doc = new Doc();
94431
- this._isRemoteUpdate = false;
94432
94546
  this._isLocalTransaction = true;
94433
- this.type = "yjs";
94434
- this.private = config2.private || false;
94547
+ this._isRemoteUpdate = false;
94548
+ this._maps = /* @__PURE__ */ new Map();
94549
+ this._arrays = /* @__PURE__ */ new Map();
94550
+ this._texts = /* @__PURE__ */ new Map();
94551
+ Object.defineProperty(this._doc, "__sharedDoc", {
94552
+ value: this,
94553
+ enumerable: false,
94554
+ writable: false
94555
+ });
94556
+ this._branch = config2.branch;
94435
94557
  this._persistence = config2.localPersistence;
94436
- this._remoteEvents = config2.remoteEvents;
94437
- this._connectionId = config2.connectionId;
94438
94558
  this._localId = this._doc.clientID;
94439
94559
  this._remoteId = new Doc().clientID;
94440
- this._bots = this._doc.getMap("bots");
94441
- this._masks = this._doc.getMap("masks");
94442
- this._doc.on("afterTransaction", (transaction) => {
94443
- this._processTransaction(transaction);
94444
- });
94445
94560
  this._currentVersion = {
94446
94561
  currentSite: this._localId.toString(),
94447
94562
  remoteSite: this._remoteId.toString(),
@@ -94450,6 +94565,583 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94450
94565
  this._onVersionUpdated = new import_rxjs3.BehaviorSubject(
94451
94566
  this._currentVersion
94452
94567
  );
94568
+ this._onUpdates = new import_rxjs3.Subject();
94569
+ }
94570
+ get recordName() {
94571
+ return this._recordName;
94572
+ }
94573
+ get address() {
94574
+ return this._inst;
94575
+ }
94576
+ get branch() {
94577
+ return this._branch;
94578
+ }
94579
+ get clientId() {
94580
+ return this._doc.clientID;
94581
+ }
94582
+ get closed() {
94583
+ return this._sub.closed;
94584
+ }
94585
+ get onVersionUpdated() {
94586
+ return this._onVersionUpdated;
94587
+ }
94588
+ get onError() {
94589
+ return this._onError;
94590
+ }
94591
+ get onEvents() {
94592
+ return this._onEvents;
94593
+ }
94594
+ get onClientError() {
94595
+ return this._onClientError;
94596
+ }
94597
+ get onStatusUpdated() {
94598
+ return this._onStatusUpdated;
94599
+ }
94600
+ get site() {
94601
+ return this._currentSite;
94602
+ }
94603
+ get onUpdates() {
94604
+ return this._onUpdates.pipe(
94605
+ (0, import_rxjs3.startWith)([(0, import_base64_js2.fromByteArray)(encodeStateAsUpdate(this._doc))])
94606
+ );
94607
+ }
94608
+ get doc() {
94609
+ return this._doc;
94610
+ }
94611
+ get _remoteSite() {
94612
+ return this._remoteId.toString();
94613
+ }
94614
+ get _currentSite() {
94615
+ return this._localId.toString();
94616
+ }
94617
+ unsubscribe() {
94618
+ this._sub.unsubscribe();
94619
+ }
94620
+ getMap(name) {
94621
+ let map2 = this._maps.get(name);
94622
+ if (!map2) {
94623
+ map2 = new YjsSharedMap(this._doc.getMap(name));
94624
+ this._maps.set(name, map2);
94625
+ }
94626
+ return map2;
94627
+ }
94628
+ getArray(name) {
94629
+ let array = this._arrays.get(name);
94630
+ if (!array) {
94631
+ array = new YjsSharedArray(this._doc.getArray(name));
94632
+ this._arrays.set(name, array);
94633
+ }
94634
+ return array;
94635
+ }
94636
+ getText(name) {
94637
+ let text = this._texts.get(name);
94638
+ if (!text) {
94639
+ text = new YjsSharedText(this._doc.getText(name));
94640
+ this._texts.set(name, text);
94641
+ }
94642
+ return text;
94643
+ }
94644
+ createMap() {
94645
+ return new YjsSharedMap(new YMap());
94646
+ }
94647
+ createArray() {
94648
+ return new YjsSharedArray(new YArray());
94649
+ }
94650
+ async init() {
94651
+ }
94652
+ connect() {
94653
+ if (this._persistence?.saveToIndexedDb && this._branch) {
94654
+ console.log("[YjsPartition] Using IndexedDB persistence");
94655
+ this._indexeddb = new YjsIndexedDBPersistence(
94656
+ this._branch,
94657
+ this._doc,
94658
+ { broadcastChanges: true }
94659
+ );
94660
+ }
94661
+ this._onStatusUpdated.next({
94662
+ type: "connection",
94663
+ connected: true
94664
+ });
94665
+ this._onStatusUpdated.next({
94666
+ type: "authentication",
94667
+ authenticated: true
94668
+ });
94669
+ this._onStatusUpdated.next({
94670
+ type: "authorization",
94671
+ authorized: true
94672
+ });
94673
+ if (this._indexeddb) {
94674
+ this._indexeddb.waitForInit().then(() => {
94675
+ this._onStatusUpdated.next({
94676
+ type: "sync",
94677
+ synced: true
94678
+ });
94679
+ });
94680
+ } else {
94681
+ this._onStatusUpdated.next({
94682
+ type: "sync",
94683
+ synced: true
94684
+ });
94685
+ }
94686
+ }
94687
+ transact(callback) {
94688
+ return this._doc.transact(callback);
94689
+ }
94690
+ getStateUpdate() {
94691
+ const update = {
94692
+ id: 0,
94693
+ timestamp: Date.now(),
94694
+ update: (0, import_base64_js2.fromByteArray)(encodeStateAsUpdate(this._doc))
94695
+ };
94696
+ return update;
94697
+ }
94698
+ applyStateUpdates(updates) {
94699
+ this._applyUpdates(
94700
+ updates.map((u2) => u2.update),
94701
+ APPLY_UPDATES_TO_INST_TRANSACTION_ORIGIN
94702
+ );
94703
+ }
94704
+ /**
94705
+ * Applies the given updates to the YJS document.
94706
+ * @param updates The updates to apply.
94707
+ * @param transactionOrigin The origin of the transaction.
94708
+ */
94709
+ _applyUpdates(updates, transactionOrigin) {
94710
+ try {
94711
+ this._isRemoteUpdate = true;
94712
+ for (let updateBase64 of updates) {
94713
+ const update = (0, import_base64_js2.toByteArray)(updateBase64);
94714
+ applyUpdate(this._doc, update, transactionOrigin);
94715
+ }
94716
+ } finally {
94717
+ this._isRemoteUpdate = false;
94718
+ }
94719
+ }
94720
+ };
94721
+ function convertEvent(event) {
94722
+ if (event instanceof YMapEvent) {
94723
+ return {
94724
+ type: "map",
94725
+ target: event.target.__sharedType,
94726
+ changes: event.changes.keys
94727
+ };
94728
+ } else if (event instanceof YArrayEvent) {
94729
+ return {
94730
+ type: "array",
94731
+ target: event.target.__sharedType,
94732
+ delta: convertArrayDelta(event.delta)
94733
+ };
94734
+ } else if (event instanceof YTextEvent) {
94735
+ return {
94736
+ type: "text",
94737
+ target: event.target.__sharedType,
94738
+ delta: convertTextDelta(event.delta)
94739
+ };
94740
+ }
94741
+ return null;
94742
+ }
94743
+ function convertArrayDelta(delta) {
94744
+ let ops = [];
94745
+ for (let op of delta) {
94746
+ if (op.insert) {
94747
+ ops.push({
94748
+ type: "insert",
94749
+ values: op.insert
94750
+ });
94751
+ } else if (op.delete) {
94752
+ ops.push({
94753
+ type: "delete",
94754
+ count: op.delete
94755
+ });
94756
+ } else {
94757
+ ops.push({
94758
+ type: "preserve",
94759
+ count: op.retain
94760
+ });
94761
+ }
94762
+ }
94763
+ return ops;
94764
+ }
94765
+ function convertTextDelta(delta) {
94766
+ let ops = [];
94767
+ for (let op of delta) {
94768
+ if (op.insert) {
94769
+ ops.push({
94770
+ type: "insert",
94771
+ text: op.insert,
94772
+ attributes: op.attributes
94773
+ });
94774
+ } else if (op.delete) {
94775
+ ops.push({
94776
+ type: "delete",
94777
+ count: op.delete
94778
+ });
94779
+ } else {
94780
+ ops.push({
94781
+ type: "preserve",
94782
+ count: op.retain
94783
+ });
94784
+ }
94785
+ }
94786
+ return ops;
94787
+ }
94788
+ function changesObservable(type) {
94789
+ return new import_rxjs3.Observable((observer) => {
94790
+ const f2 = (event) => {
94791
+ observer.next(convertEvent(event));
94792
+ };
94793
+ type.observe(f2);
94794
+ return () => {
94795
+ type.unobserve(f2);
94796
+ };
94797
+ });
94798
+ }
94799
+ function deepChangesObservable(type) {
94800
+ return new import_rxjs3.Observable((observer) => {
94801
+ const f2 = (event) => {
94802
+ observer.next(event.map(convertEvent));
94803
+ };
94804
+ type.observeDeep(f2);
94805
+ return () => {
94806
+ type.unobserveDeep(f2);
94807
+ };
94808
+ });
94809
+ }
94810
+ var YjsSharedType = class {
94811
+ get type() {
94812
+ return this._type;
94813
+ }
94814
+ get doc() {
94815
+ return this._type.doc?.__sharedDoc;
94816
+ }
94817
+ get parent() {
94818
+ return this._type.parent?.__sharedType;
94819
+ }
94820
+ get changes() {
94821
+ return this._changes;
94822
+ }
94823
+ get deepChanges() {
94824
+ return this._deepChanges;
94825
+ }
94826
+ constructor(type) {
94827
+ this._type = type;
94828
+ Object.defineProperty(this._type, "__sharedType", {
94829
+ value: this,
94830
+ enumerable: false,
94831
+ writable: false
94832
+ });
94833
+ this._changes = changesObservable(this._type);
94834
+ this._deepChanges = deepChangesObservable(this._type);
94835
+ }
94836
+ };
94837
+ var YjsSharedMap = class _YjsSharedMap extends YjsSharedType {
94838
+ constructor(map2) {
94839
+ let ymap;
94840
+ if (map2 instanceof YMap) {
94841
+ ymap = map2;
94842
+ } else {
94843
+ ymap = new YMap(map2);
94844
+ }
94845
+ super(ymap);
94846
+ }
94847
+ get size() {
94848
+ return this.type.size;
94849
+ }
94850
+ set(key, value) {
94851
+ if (value instanceof YjsSharedType) {
94852
+ if (value.doc) {
94853
+ throw new Error(
94854
+ "Cannot set a top-level map inside another map."
94855
+ );
94856
+ }
94857
+ value = value.type;
94858
+ }
94859
+ this.type.set(key, value);
94860
+ }
94861
+ get(key) {
94862
+ const val = this.type.get(key);
94863
+ return valueOrSharedType(val);
94864
+ }
94865
+ delete(key) {
94866
+ this.type.delete(key);
94867
+ }
94868
+ has(key) {
94869
+ return this.type.has(key);
94870
+ }
94871
+ clear() {
94872
+ this.type.clear();
94873
+ }
94874
+ clone() {
94875
+ return new _YjsSharedMap(this.type.clone());
94876
+ }
94877
+ toJSON() {
94878
+ return this.type.toJSON();
94879
+ }
94880
+ forEach(callback) {
94881
+ return this.type.forEach((value, key) => callback(value, key, this));
94882
+ }
94883
+ entries() {
94884
+ return this.type.entries();
94885
+ }
94886
+ keys() {
94887
+ return this.type.keys();
94888
+ }
94889
+ values() {
94890
+ return this.type.values();
94891
+ }
94892
+ [Symbol.iterator]() {
94893
+ return this.type[Symbol.iterator]();
94894
+ }
94895
+ };
94896
+ var YjsSharedArray = class _YjsSharedArray extends YjsSharedType {
94897
+ get length() {
94898
+ return this.type.length;
94899
+ }
94900
+ get size() {
94901
+ return this.type.length;
94902
+ }
94903
+ constructor(arr) {
94904
+ let yarray;
94905
+ if (arr instanceof YArray) {
94906
+ yarray = arr;
94907
+ } else {
94908
+ yarray = YArray.from(arr);
94909
+ }
94910
+ super(yarray);
94911
+ }
94912
+ insert(index, items) {
94913
+ this.type.insert(index, this._mapItems(items));
94914
+ }
94915
+ delete(index, count2) {
94916
+ this.type.delete(index, count2);
94917
+ }
94918
+ applyDelta(delta) {
94919
+ let index = 0;
94920
+ for (let op of delta) {
94921
+ if (op.type === "preserve") {
94922
+ index += op.count;
94923
+ } else if (op.type === "insert") {
94924
+ this.type.insert(index, op.values);
94925
+ index += op.values.length;
94926
+ } else if (op.type === "delete") {
94927
+ this.type.delete(index, op.count);
94928
+ }
94929
+ }
94930
+ }
94931
+ push(...items) {
94932
+ this.type.push(this._mapItems(items));
94933
+ }
94934
+ pop() {
94935
+ let lastIndex = this.type.length - 1;
94936
+ if (lastIndex < 0) {
94937
+ return void 0;
94938
+ } else {
94939
+ const lastItem = this.type.get(lastIndex);
94940
+ this.type.delete(lastIndex, 1);
94941
+ return lastItem;
94942
+ }
94943
+ }
94944
+ unshift(...items) {
94945
+ this.type.unshift(this._mapItems(items));
94946
+ }
94947
+ shift() {
94948
+ if (this.type.length <= 0) {
94949
+ return void 0;
94950
+ } else {
94951
+ const firstItem = this.type.get(0);
94952
+ this.type.delete(0, 1);
94953
+ return firstItem;
94954
+ }
94955
+ }
94956
+ get(index) {
94957
+ return valueOrSharedType(this.type.get(index));
94958
+ }
94959
+ slice(start, end) {
94960
+ return this.type.slice(start, end);
94961
+ }
94962
+ splice(start, deleteCount, ...items) {
94963
+ if (this.type.length <= 0) {
94964
+ if (items.length > 0) {
94965
+ this.push(...items);
94966
+ }
94967
+ return [];
94968
+ }
94969
+ const len = this.type.length;
94970
+ if (start < -len) {
94971
+ start = 0;
94972
+ } else if (-len <= start && start < 0) {
94973
+ start = len + start;
94974
+ } else if (start >= len) {
94975
+ start = len;
94976
+ }
94977
+ if (start >= len) {
94978
+ deleteCount = 0;
94979
+ } else if (typeof deleteCount === "undefined") {
94980
+ deleteCount = 0;
94981
+ } else if (deleteCount >= len - start) {
94982
+ deleteCount = len - start;
94983
+ } else if (deleteCount < 0) {
94984
+ deleteCount = 0;
94985
+ }
94986
+ let deleted = [];
94987
+ if (deleteCount > 0) {
94988
+ deleted = this.type.slice(start, start + deleteCount);
94989
+ this.delete(start, deleteCount);
94990
+ }
94991
+ if (items.length > 0) {
94992
+ this.insert(start, items);
94993
+ }
94994
+ return deleted;
94995
+ }
94996
+ toArray() {
94997
+ return this.type.toArray();
94998
+ }
94999
+ toJSON() {
95000
+ return this.type.toJSON();
95001
+ }
95002
+ forEach(callback) {
95003
+ this.type.forEach((value, index) => callback(value, index, this));
95004
+ }
95005
+ map(callback) {
95006
+ return this.type.map((value, index) => callback(value, index, this));
95007
+ }
95008
+ filter(predicate) {
95009
+ let arr = [];
95010
+ for (let i2 = 0; i2 < this.type.length; i2++) {
95011
+ const val = this.type.get(i2);
95012
+ if (predicate(val, i2, this)) {
95013
+ arr.push(val);
95014
+ }
95015
+ }
95016
+ return arr;
95017
+ }
95018
+ clone() {
95019
+ return new _YjsSharedArray(this.type.clone());
95020
+ }
95021
+ [Symbol.iterator]() {
95022
+ return this.type[Symbol.iterator]();
95023
+ }
95024
+ _mapItems(items) {
95025
+ let containsSharedType = false;
95026
+ for (let i2 of items) {
95027
+ if (i2 instanceof YjsSharedType) {
95028
+ if (i2.doc) {
95029
+ throw new Error(
95030
+ "Cannot push a top-level array inside another array."
95031
+ );
95032
+ }
95033
+ containsSharedType = true;
95034
+ break;
95035
+ }
95036
+ }
95037
+ if (containsSharedType) {
95038
+ items = items.map((i2) => i2 instanceof YjsSharedType ? i2.type : i2);
95039
+ }
95040
+ return items;
95041
+ }
95042
+ };
95043
+ var YjsSharedText = class _YjsSharedText {
95044
+ get doc() {
95045
+ return this._text.doc?.__sharedDoc;
95046
+ }
95047
+ get parent() {
95048
+ return this._text.parent?.__sharedType;
95049
+ }
95050
+ get length() {
95051
+ return this._text.length;
95052
+ }
95053
+ get size() {
95054
+ return this._text.length;
95055
+ }
95056
+ get changes() {
95057
+ return this._changes;
95058
+ }
95059
+ get deepChanges() {
95060
+ return this._deepChanges;
95061
+ }
95062
+ constructor(text) {
95063
+ if (text instanceof YText) {
95064
+ this._text = text;
95065
+ } else {
95066
+ this._text = new YText(text);
95067
+ }
95068
+ Object.defineProperty(this._text, "__sharedType", {
95069
+ value: this,
95070
+ enumerable: false,
95071
+ writable: false
95072
+ });
95073
+ this._changes = changesObservable(
95074
+ this._text
95075
+ );
95076
+ this._deepChanges = deepChangesObservable(this._text);
95077
+ }
95078
+ insert(index, text, attribtues) {
95079
+ this._text.insert(index, text, attribtues);
95080
+ }
95081
+ delete(index, count2) {
95082
+ this._text.delete(index, count2);
95083
+ }
95084
+ applyDelta(delta) {
95085
+ let d2 = [];
95086
+ for (let op of delta) {
95087
+ if (op.type === "preserve") {
95088
+ d2.push({ retain: op.count });
95089
+ } else if (op.type === "insert") {
95090
+ d2.push({ insert: op.text, attributes: op.attributes });
95091
+ } else if (op.type === "delete") {
95092
+ d2.push({ delete: op.count });
95093
+ }
95094
+ }
95095
+ this._text.applyDelta(d2);
95096
+ }
95097
+ toDelta() {
95098
+ return convertTextDelta(this._text.toDelta());
95099
+ }
95100
+ encodeRelativePosition(index, assoc) {
95101
+ return createRelativePositionFromTypeIndex(this._text, index, assoc);
95102
+ }
95103
+ decodeRelativePosition(position) {
95104
+ const pos = createAbsolutePositionFromRelativePosition(
95105
+ position,
95106
+ this._text.doc
95107
+ );
95108
+ return pos.index;
95109
+ }
95110
+ slice(start, end) {
95111
+ return this._text.toString().slice(start, end);
95112
+ }
95113
+ toString() {
95114
+ return this._text.toString();
95115
+ }
95116
+ toJSON() {
95117
+ return this._text.toJSON();
95118
+ }
95119
+ clone() {
95120
+ return new _YjsSharedText(this._text.clone());
95121
+ }
95122
+ };
95123
+ function valueOrSharedType(val) {
95124
+ if (val instanceof AbstractType) {
95125
+ return val.__sharedType;
95126
+ }
95127
+ return val;
95128
+ }
95129
+
95130
+ // ../aux-common/partitions/YjsPartition.ts
95131
+ var APPLY_UPDATES_TO_INST_TRANSACTION_ORIGIN2 = "__apply_updates_to_inst";
95132
+ var YjsPartitionImpl = class _YjsPartitionImpl extends YjsSharedDocument {
95133
+ constructor(config2) {
95134
+ super(config2);
95135
+ this._hasRegisteredSubs = false;
95136
+ this.type = "yjs";
95137
+ this.private = config2.private || false;
95138
+ this._remoteEvents = config2.remoteEvents;
95139
+ this._connectionId = config2.connectionId;
95140
+ this._bots = this._doc.getMap("bots");
95141
+ this._masks = this._doc.getMap("masks");
95142
+ this._doc.on("afterTransaction", (transaction) => {
95143
+ this._processTransaction(transaction);
95144
+ });
94453
95145
  this._internalPartition = new MemoryPartitionImpl({
94454
95146
  type: "memory",
94455
95147
  initialState: {},
@@ -94495,24 +95187,12 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94495
95187
  get onStateUpdated() {
94496
95188
  return this._internalPartition.onStateUpdated;
94497
95189
  }
94498
- get onVersionUpdated() {
94499
- return this._onVersionUpdated;
94500
- }
94501
- get onError() {
94502
- return this._onError;
94503
- }
94504
- get onEvents() {
94505
- return this._onEvents;
94506
- }
94507
- get onStatusUpdated() {
94508
- return this._onStatusUpdated;
94509
- }
94510
95190
  unsubscribe() {
94511
95191
  return this._sub.unsubscribe();
94512
95192
  }
94513
- get closed() {
94514
- return this._sub.closed;
94515
- }
95193
+ // get doc() {
95194
+ // return this._doc;
95195
+ // }
94516
95196
  get state() {
94517
95197
  return this._internalPartition.state;
94518
95198
  }
@@ -94525,15 +95205,6 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94525
95205
  get realtimeStrategy() {
94526
95206
  return "immediate";
94527
95207
  }
94528
- get doc() {
94529
- return this._doc;
94530
- }
94531
- get _remoteSite() {
94532
- return this._remoteId.toString();
94533
- }
94534
- get _currentSite() {
94535
- return this._localId.toString();
94536
- }
94537
95208
  async sendRemoteEvents(events) {
94538
95209
  if (!this._remoteEvents) {
94539
95210
  return;
@@ -94559,7 +95230,7 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94559
95230
  {
94560
95231
  id: 0,
94561
95232
  timestamp: Date.now(),
94562
- update: (0, import_base64_js2.fromByteArray)(
95233
+ update: (0, import_base64_js3.fromByteArray)(
94563
95234
  encodeStateAsUpdate(this._doc)
94564
95235
  )
94565
95236
  }
@@ -94577,7 +95248,7 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94577
95248
  type: "yjs"
94578
95249
  });
94579
95250
  for (let { update } of action2.updates) {
94580
- const updateBytes = (0, import_base64_js2.toByteArray)(update);
95251
+ const updateBytes = (0, import_base64_js3.toByteArray)(update);
94581
95252
  applyUpdate(partition3.doc, updateBytes);
94582
95253
  }
94583
95254
  this._onEvents.next([
@@ -94596,7 +95267,7 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94596
95267
  let instUpdate = {
94597
95268
  id: 0,
94598
95269
  timestamp: Date.now(),
94599
- update: (0, import_base64_js2.fromByteArray)(update)
95270
+ update: (0, import_base64_js3.fromByteArray)(update)
94600
95271
  };
94601
95272
  this._onEvents.next([
94602
95273
  asyncResult(event.taskId, instUpdate, false)
@@ -94615,7 +95286,7 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94615
95286
  try {
94616
95287
  this._applyUpdates(
94617
95288
  action2.updates.map((u2) => u2.update),
94618
- APPLY_UPDATES_TO_INST_TRANSACTION_ORIGIN
95289
+ APPLY_UPDATES_TO_INST_TRANSACTION_ORIGIN2
94619
95290
  );
94620
95291
  this._onEvents.next([
94621
95292
  asyncResult(event.taskId, null, false)
@@ -94629,7 +95300,7 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94629
95300
  const update = {
94630
95301
  id: 0,
94631
95302
  timestamp: Date.now(),
94632
- update: (0, import_base64_js2.fromByteArray)(
95303
+ update: (0, import_base64_js3.fromByteArray)(
94633
95304
  encodeStateAsUpdate(this._doc)
94634
95305
  )
94635
95306
  };
@@ -94656,43 +95327,6 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94656
95327
  this._applyEvents(finalEvents);
94657
95328
  return [];
94658
95329
  }
94659
- async init() {
94660
- }
94661
- connect() {
94662
- if (this._persistence?.saveToIndexedDb) {
94663
- console.log("[YjsPartition] Using IndexedDB persistence");
94664
- this._indexeddb = new YjsIndexedDBPersistence(
94665
- this._persistence.database,
94666
- this._doc,
94667
- { broadcastChanges: true }
94668
- );
94669
- }
94670
- this._onStatusUpdated.next({
94671
- type: "connection",
94672
- connected: true
94673
- });
94674
- this._onStatusUpdated.next({
94675
- type: "authentication",
94676
- authenticated: true
94677
- });
94678
- this._onStatusUpdated.next({
94679
- type: "authorization",
94680
- authorized: true
94681
- });
94682
- if (this._indexeddb) {
94683
- this._indexeddb.waitForInit().then(() => {
94684
- this._onStatusUpdated.next({
94685
- type: "sync",
94686
- synced: true
94687
- });
94688
- });
94689
- } else {
94690
- this._onStatusUpdated.next({
94691
- type: "sync",
94692
- synced: true
94693
- });
94694
- }
94695
- }
94696
95330
  _applyEvents(events) {
94697
95331
  this._isLocalTransaction = true;
94698
95332
  this._doc.transact((t2) => {
@@ -94769,17 +95403,6 @@ var YjsPartitionImpl = class _YjsPartitionImpl {
94769
95403
  }
94770
95404
  });
94771
95405
  }
94772
- _applyUpdates(updates, transactionOrigin) {
94773
- try {
94774
- this._isRemoteUpdate = true;
94775
- for (let updateBase64 of updates) {
94776
- const update = (0, import_base64_js2.toByteArray)(updateBase64);
94777
- applyUpdate(this._doc, update, transactionOrigin);
94778
- }
94779
- } finally {
94780
- this._isRemoteUpdate = false;
94781
- }
94782
- }
94783
95406
  async _processTransaction(transaction) {
94784
95407
  let memoryEvents = [];
94785
95408
  const version = getStateVector2(this._doc);
@@ -95204,7 +95827,10 @@ var import_lodash10 = __toESM(require_lodash());
95204
95827
  var import_lodash11 = __toESM(require_lodash());
95205
95828
 
95206
95829
  // ../aux-common/partitions/RemoteYjsPartition.ts
95207
- var import_base64_js4 = __toESM(require_base64_js());
95830
+ var import_base64_js6 = __toESM(require_base64_js());
95831
+
95832
+ // ../aux-common/documents/RemoteYjsSharedDocument.ts
95833
+ var import_base64_js5 = __toESM(require_base64_js());
95208
95834
 
95209
95835
  // ../aux-common/DebugHelpers.ts
95210
95836
  var import_lodash12 = __toESM(require_lodash());
@@ -95666,7 +96292,7 @@ function getSchemaMetadata(schema) {
95666
96292
 
95667
96293
  // ../aux-records/AuthUtils.js
95668
96294
  var import_hash = __toESM(require_hash());
95669
- var import_base64_js5 = __toESM(require_base64_js());
96295
+ var import_base64_js7 = __toESM(require_base64_js());
95670
96296
  var REFRESH_LIFETIME_MS = 1e3 * 60 * 60 * 24 * 7;
95671
96297
  function parseSessionKey(key) {
95672
96298
  return parseV1SessionKey(key);
@@ -95810,7 +96436,7 @@ var import_tweetnacl2 = __toESM(require_nacl_fast());
95810
96436
  // ../crypto/Encryption.ts
95811
96437
  var import_tweetnacl = __toESM(require_nacl_fast());
95812
96438
  var import_scrypt_js = __toESM(require_scrypt());
95813
- var import_base64_js6 = __toESM(require_base64_js());
96439
+ var import_base64_js8 = __toESM(require_base64_js());
95814
96440
  var ITERATIONS = 16384;
95815
96441
  var BLOCK_SIZE = 8;
95816
96442
  var PARALLELISM = 1;
@@ -95831,7 +96457,7 @@ function deriveKey(password, salt) {
95831
96457
  }
95832
96458
 
95833
96459
  // ../crypto/HashHelpers.js
95834
- var import_base64_js7 = __toESM(require_base64_js());
96460
+ var import_base64_js9 = __toESM(require_base64_js());
95835
96461
  function hashLowEntropyPasswordWithSalt(password, salt) {
95836
96462
  if (!password) {
95837
96463
  throw new Error("Invalid password. Must not be null or undefined.");
@@ -95841,9 +96467,9 @@ function hashLowEntropyPasswordWithSalt(password, salt) {
95841
96467
  }
95842
96468
  const textEncoder2 = new TextEncoder();
95843
96469
  const passwordBytes = textEncoder2.encode(password);
95844
- const saltBytes = (0, import_base64_js7.toByteArray)(salt);
96470
+ const saltBytes = (0, import_base64_js9.toByteArray)(salt);
95845
96471
  const hashBytes = deriveKey(passwordBytes, saltBytes);
95846
- return `vH1.${(0, import_base64_js7.fromByteArray)(hashBytes.hash)}`;
96472
+ return `vH1.${(0, import_base64_js9.fromByteArray)(hashBytes.hash)}`;
95847
96473
  }
95848
96474
  function hashHighEntropyPasswordWithSalt(password, salt) {
95849
96475
  if (!password) {
@@ -95854,11 +96480,11 @@ function hashHighEntropyPasswordWithSalt(password, salt) {
95854
96480
  }
95855
96481
  const textEncoder2 = new TextEncoder();
95856
96482
  const passwordBytes = textEncoder2.encode(password);
95857
- const saltBytes = (0, import_base64_js7.toByteArray)(salt);
96483
+ const saltBytes = (0, import_base64_js9.toByteArray)(salt);
95858
96484
  const h2 = (0, import_hash2.hmac)(import_hash2.sha256, saltBytes);
95859
96485
  h2.update(passwordBytes);
95860
96486
  const hashBytes = new Uint8Array(h2.digest());
95861
- return `vH2.${(0, import_base64_js7.fromByteArray)(hashBytes)}`;
96487
+ return `vH2.${(0, import_base64_js9.fromByteArray)(hashBytes)}`;
95862
96488
  }
95863
96489
  function verifyPasswordAgainstHashes(password, salt, hashes) {
95864
96490
  if (!password) {
@@ -95884,12 +96510,12 @@ function verifyPasswordAgainstHashes(password, salt, hashes) {
95884
96510
  }
95885
96511
  const textEncoder2 = new TextEncoder();
95886
96512
  const passwordBytes = textEncoder2.encode(password);
95887
- const saltBytes = (0, import_base64_js7.toByteArray)(salt);
96513
+ const saltBytes = (0, import_base64_js9.toByteArray)(salt);
95888
96514
  if (version2Hashes.length > 0) {
95889
96515
  const h2 = (0, import_hash2.hmac)(import_hash2.sha256, saltBytes);
95890
96516
  h2.update(passwordBytes);
95891
96517
  const hashBytes = new Uint8Array(h2.digest());
95892
- const hashBase64 = (0, import_base64_js7.fromByteArray)(hashBytes);
96518
+ const hashBase64 = (0, import_base64_js9.fromByteArray)(hashBytes);
95893
96519
  for (const hash of version2Hashes) {
95894
96520
  const withoutVersion = hash.slice("vH2.".length);
95895
96521
  if (withoutVersion === hashBase64) {
@@ -95899,7 +96525,7 @@ function verifyPasswordAgainstHashes(password, salt, hashes) {
95899
96525
  }
95900
96526
  if (version1Hashes.length > 0) {
95901
96527
  const passwordHash = deriveKey(passwordBytes, saltBytes);
95902
- const passwordHashBase64 = (0, import_base64_js7.fromByteArray)(passwordHash.hash);
96528
+ const passwordHashBase64 = (0, import_base64_js9.fromByteArray)(passwordHash.hash);
95903
96529
  for (const hash of version1Hashes) {
95904
96530
  const withoutVersion = hash.slice("vH1.".length);
95905
96531
  if (withoutVersion === passwordHashBase64) {
@@ -96914,7 +97540,7 @@ var trace = TraceAPI.getInstance();
96914
97540
  function hashLowEntropyPasswordWithSalt2(password, salt) {
96915
97541
  const tracer = trace.getTracer(
96916
97542
  "InstrumentedHashHelpers",
96917
- false ? void 0 : "v3.3.12"
97543
+ false ? void 0 : "v3.3.13"
96918
97544
  );
96919
97545
  return tracer.startActiveSpan(
96920
97546
  "hashLowEntropyPasswordWithSalt",
@@ -96932,7 +97558,7 @@ function hashLowEntropyPasswordWithSalt2(password, salt) {
96932
97558
  function hashHighEntropyPasswordWithSalt2(password, salt) {
96933
97559
  const tracer = trace.getTracer(
96934
97560
  "InstrumentedHashHelpers",
96935
- false ? void 0 : "v3.3.12"
97561
+ false ? void 0 : "v3.3.13"
96936
97562
  );
96937
97563
  return tracer.startActiveSpan(
96938
97564
  "hashHighEntropyPasswordWithSalt",
@@ -96950,7 +97576,7 @@ function hashHighEntropyPasswordWithSalt2(password, salt) {
96950
97576
  function verifyPasswordAgainstHashes2(password, salt, hashes) {
96951
97577
  const tracer = trace.getTracer(
96952
97578
  "InstrumentedHashHelpers",
96953
- false ? void 0 : "v3.3.12"
97579
+ false ? void 0 : "v3.3.13"
96954
97580
  );
96955
97581
  return tracer.startActiveSpan(
96956
97582
  "verifyPasswordAgainstHashes",
@@ -96968,20 +97594,20 @@ function verifyPasswordAgainstHashes2(password, salt, hashes) {
96968
97594
  }
96969
97595
 
96970
97596
  // ../aux-records/AuthController.ts
96971
- var import_base64_js9 = __toESM(require_base64_js());
97597
+ var import_base64_js11 = __toESM(require_base64_js());
96972
97598
 
96973
97599
  // ../aux-records/Utils.ts
96974
97600
  var import_lodash14 = __toESM(require_lodash());
96975
97601
  var import_hash3 = __toESM(require_hash());
96976
97602
 
96977
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/bind.js
97603
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/bind.js
96978
97604
  function bind(fn, thisArg) {
96979
97605
  return function wrap3() {
96980
97606
  return fn.apply(thisArg, arguments);
96981
97607
  };
96982
97608
  }
96983
97609
 
96984
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/utils.js
97610
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/utils.js
96985
97611
  var { toString } = Object.prototype;
96986
97612
  var { getPrototypeOf } = Object;
96987
97613
  var kindOf = /* @__PURE__ */ ((cache2) => (thing) => {
@@ -97031,6 +97657,7 @@ var isFormData = (thing) => {
97031
97657
  kind3 === "object" && isFunction2(thing.toString) && thing.toString() === "[object FormData]"));
97032
97658
  };
97033
97659
  var isURLSearchParams = kindOfTest("URLSearchParams");
97660
+ var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
97034
97661
  var trim = (str2) => str2.trim ? str2.trim() : str2.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
97035
97662
  function forEach2(obj, fn, { allOwnKeys = false } = {}) {
97036
97663
  if (obj === null || typeof obj === "undefined") {
@@ -97118,7 +97745,7 @@ var inherits = (constructor, superConstructor, props, descriptors2) => {
97118
97745
  });
97119
97746
  props && Object.assign(constructor.prototype, props);
97120
97747
  };
97121
- var toFlatObject = (sourceObj, destObj, filter3, propFilter) => {
97748
+ var toFlatObject = (sourceObj, destObj, filter4, propFilter) => {
97122
97749
  let props;
97123
97750
  let i2;
97124
97751
  let prop;
@@ -97136,8 +97763,8 @@ var toFlatObject = (sourceObj, destObj, filter3, propFilter) => {
97136
97763
  merged[prop] = true;
97137
97764
  }
97138
97765
  }
97139
- sourceObj = filter3 !== false && getPrototypeOf(sourceObj);
97140
- } while (sourceObj && (!filter3 || filter3(sourceObj, destObj)) && sourceObj !== Object.prototype);
97766
+ sourceObj = filter4 !== false && getPrototypeOf(sourceObj);
97767
+ } while (sourceObj && (!filter4 || filter4(sourceObj, destObj)) && sourceObj !== Object.prototype);
97141
97768
  return destObj;
97142
97769
  };
97143
97770
  var endsWith = (str2, searchString, position) => {
@@ -97240,8 +97867,7 @@ var toObjectSet = (arrayOrString, delimiter) => {
97240
97867
  var noop = () => {
97241
97868
  };
97242
97869
  var toFiniteNumber = (value, defaultValue) => {
97243
- value = +value;
97244
- return Number.isFinite(value) ? value : defaultValue;
97870
+ return value != null && Number.isFinite(value = +value) ? value : defaultValue;
97245
97871
  };
97246
97872
  var ALPHA = "abcdefghijklmnopqrstuvwxyz";
97247
97873
  var DIGIT = "0123456789";
@@ -97285,6 +97911,26 @@ var toJSONObject = (obj) => {
97285
97911
  };
97286
97912
  var isAsyncFn = kindOfTest("AsyncFunction");
97287
97913
  var isThenable = (thing) => thing && (isObject3(thing) || isFunction2(thing)) && isFunction2(thing.then) && isFunction2(thing.catch);
97914
+ var _setImmediate = ((setImmediateSupported, postMessageSupported) => {
97915
+ if (setImmediateSupported) {
97916
+ return setImmediate;
97917
+ }
97918
+ return postMessageSupported ? ((token, callbacks) => {
97919
+ _global2.addEventListener("message", ({ source, data }) => {
97920
+ if (source === _global2 && data === token) {
97921
+ callbacks.length && callbacks.shift()();
97922
+ }
97923
+ }, false);
97924
+ return (cb) => {
97925
+ callbacks.push(cb);
97926
+ _global2.postMessage(token, "*");
97927
+ };
97928
+ })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
97929
+ })(
97930
+ typeof setImmediate === "function",
97931
+ isFunction2(_global2.postMessage)
97932
+ );
97933
+ var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global2) : typeof process !== "undefined" && process.nextTick || _setImmediate;
97288
97934
  var utils_default = {
97289
97935
  isArray: isArray2,
97290
97936
  isArrayBuffer,
@@ -97296,6 +97942,10 @@ var utils_default = {
97296
97942
  isBoolean,
97297
97943
  isObject: isObject3,
97298
97944
  isPlainObject,
97945
+ isReadableStream,
97946
+ isRequest,
97947
+ isResponse,
97948
+ isHeaders,
97299
97949
  isUndefined: isUndefined3,
97300
97950
  isDate: isDate2,
97301
97951
  isFile,
@@ -97337,10 +97987,12 @@ var utils_default = {
97337
97987
  isSpecCompliantForm,
97338
97988
  toJSONObject,
97339
97989
  isAsyncFn,
97340
- isThenable
97990
+ isThenable,
97991
+ setImmediate: _setImmediate,
97992
+ asap
97341
97993
  };
97342
97994
 
97343
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/AxiosError.js
97995
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/AxiosError.js
97344
97996
  function AxiosError(message2, code, config2, request2, response) {
97345
97997
  Error.call(this);
97346
97998
  if (Error.captureStackTrace) {
@@ -97353,7 +98005,10 @@ function AxiosError(message2, code, config2, request2, response) {
97353
98005
  code && (this.code = code);
97354
98006
  config2 && (this.config = config2);
97355
98007
  request2 && (this.request = request2);
97356
- response && (this.response = response);
98008
+ if (response) {
98009
+ this.response = response;
98010
+ this.status = response.status ? response.status : null;
98011
+ }
97357
98012
  }
97358
98013
  utils_default.inherits(AxiosError, Error, {
97359
98014
  toJSON: function toJSON() {
@@ -97372,7 +98027,7 @@ utils_default.inherits(AxiosError, Error, {
97372
98027
  // Axios
97373
98028
  config: utils_default.toJSONObject(this.config),
97374
98029
  code: this.code,
97375
- status: this.response && this.response.status ? this.response.status : null
98030
+ status: this.status
97376
98031
  };
97377
98032
  }
97378
98033
  });
@@ -97399,7 +98054,7 @@ Object.defineProperties(AxiosError, descriptors);
97399
98054
  Object.defineProperty(prototype, "isAxiosError", { value: true });
97400
98055
  AxiosError.from = (error, code, config2, request2, response, customProps) => {
97401
98056
  const axiosError = Object.create(prototype);
97402
- utils_default.toFlatObject(error, axiosError, function filter3(obj) {
98057
+ utils_default.toFlatObject(error, axiosError, function filter4(obj) {
97403
98058
  return obj !== Error.prototype;
97404
98059
  }, (prop) => {
97405
98060
  return prop !== "isAxiosError";
@@ -97412,11 +98067,11 @@ AxiosError.from = (error, code, config2, request2, response, customProps) => {
97412
98067
  };
97413
98068
  var AxiosError_default = AxiosError;
97414
98069
 
97415
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/platform/node/classes/FormData.js
98070
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/node/classes/FormData.js
97416
98071
  var import_form_data = __toESM(require_form_data(), 1);
97417
98072
  var FormData_default = import_form_data.default;
97418
98073
 
97419
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/toFormData.js
98074
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/toFormData.js
97420
98075
  function isVisitable(thing) {
97421
98076
  return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
97422
98077
  }
@@ -97434,7 +98089,7 @@ function renderKey(path6, key, dots) {
97434
98089
  function isFlatArray(arr) {
97435
98090
  return utils_default.isArray(arr) && !arr.some(isVisitable);
97436
98091
  }
97437
- var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter2(prop) {
98092
+ var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter3(prop) {
97438
98093
  return /^is[A-Z]/.test(prop);
97439
98094
  });
97440
98095
  function toFormData(obj, formData, options) {
@@ -97531,7 +98186,7 @@ function toFormData(obj, formData, options) {
97531
98186
  }
97532
98187
  var toFormData_default = toFormData;
97533
98188
 
97534
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
98189
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/AxiosURLSearchParams.js
97535
98190
  function encode(str2) {
97536
98191
  const charMap = {
97537
98192
  "!": "%21",
@@ -97564,7 +98219,7 @@ prototype2.toString = function toString2(encoder2) {
97564
98219
  };
97565
98220
  var AxiosURLSearchParams_default = AxiosURLSearchParams;
97566
98221
 
97567
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/buildURL.js
98222
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/buildURL.js
97568
98223
  function encode2(val) {
97569
98224
  return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
97570
98225
  }
@@ -97590,7 +98245,7 @@ function buildURL(url2, params2, options) {
97590
98245
  return url2;
97591
98246
  }
97592
98247
 
97593
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/InterceptorManager.js
98248
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/InterceptorManager.js
97594
98249
  var InterceptorManager = class {
97595
98250
  constructor() {
97596
98251
  this.handlers = [];
@@ -97654,18 +98309,18 @@ var InterceptorManager = class {
97654
98309
  };
97655
98310
  var InterceptorManager_default = InterceptorManager;
97656
98311
 
97657
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/defaults/transitional.js
98312
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/defaults/transitional.js
97658
98313
  var transitional_default = {
97659
98314
  silentJSONParsing: true,
97660
98315
  forcedJSONParsing: true,
97661
98316
  clarifyTimeoutError: false
97662
98317
  };
97663
98318
 
97664
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
98319
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/node/classes/URLSearchParams.js
97665
98320
  var import_url = __toESM(require("url"), 1);
97666
98321
  var URLSearchParams_default = import_url.default.URLSearchParams;
97667
98322
 
97668
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/platform/node/index.js
98323
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/node/index.js
97669
98324
  var node_default2 = {
97670
98325
  isNode: true,
97671
98326
  classes: {
@@ -97676,29 +98331,31 @@ var node_default2 = {
97676
98331
  protocols: ["http", "https", "file", "data"]
97677
98332
  };
97678
98333
 
97679
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/platform/common/utils.js
98334
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/common/utils.js
97680
98335
  var utils_exports = {};
97681
98336
  __export(utils_exports, {
97682
98337
  hasBrowserEnv: () => hasBrowserEnv,
97683
98338
  hasStandardBrowserEnv: () => hasStandardBrowserEnv,
97684
- hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv
98339
+ hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv,
98340
+ navigator: () => _navigator,
98341
+ origin: () => origin
97685
98342
  });
97686
98343
  var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
97687
- var hasStandardBrowserEnv = ((product) => {
97688
- return hasBrowserEnv && ["ReactNative", "NativeScript", "NS"].indexOf(product) < 0;
97689
- })(typeof navigator !== "undefined" && navigator.product);
98344
+ var _navigator = typeof navigator === "object" && navigator || void 0;
98345
+ var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
97690
98346
  var hasStandardBrowserWebWorkerEnv = (() => {
97691
98347
  return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
97692
98348
  self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
97693
98349
  })();
98350
+ var origin = hasBrowserEnv && window.location.href || "http://localhost";
97694
98351
 
97695
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/platform/index.js
98352
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/platform/index.js
97696
98353
  var platform_default = {
97697
98354
  ...utils_exports,
97698
98355
  ...node_default2
97699
98356
  };
97700
98357
 
97701
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/toURLEncodedForm.js
98358
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/toURLEncodedForm.js
97702
98359
  function toURLEncodedForm(data, options) {
97703
98360
  return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({
97704
98361
  visitor: function(value, key, path6, helpers) {
@@ -97711,7 +98368,7 @@ function toURLEncodedForm(data, options) {
97711
98368
  }, options));
97712
98369
  }
97713
98370
 
97714
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/formDataToJSON.js
98371
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/formDataToJSON.js
97715
98372
  function parsePropPath(name) {
97716
98373
  return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match2) => {
97717
98374
  return match2[0] === "[]" ? "" : match2[1] || match2[0];
@@ -97732,6 +98389,8 @@ function arrayToObject(arr) {
97732
98389
  function formDataToJSON(formData) {
97733
98390
  function buildPath(path6, value, target, index) {
97734
98391
  let name = path6[index++];
98392
+ if (name === "__proto__")
98393
+ return true;
97735
98394
  const isNumericKey = Number.isFinite(+name);
97736
98395
  const isLast = index >= path6.length;
97737
98396
  name = !name && utils_default.isArray(target) ? target.length : name;
@@ -97763,7 +98422,7 @@ function formDataToJSON(formData) {
97763
98422
  }
97764
98423
  var formDataToJSON_default = formDataToJSON;
97765
98424
 
97766
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/defaults/index.js
98425
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/defaults/index.js
97767
98426
  function stringifySafely(rawValue, parser4, encoder2) {
97768
98427
  if (utils_default.isString(rawValue)) {
97769
98428
  try {
@@ -97779,7 +98438,7 @@ function stringifySafely(rawValue, parser4, encoder2) {
97779
98438
  }
97780
98439
  var defaults = {
97781
98440
  transitional: transitional_default,
97782
- adapter: ["xhr", "http"],
98441
+ adapter: ["xhr", "http", "fetch"],
97783
98442
  transformRequest: [function transformRequest(data, headers) {
97784
98443
  const contentType = headers.getContentType() || "";
97785
98444
  const hasJSONContentType = contentType.indexOf("application/json") > -1;
@@ -97789,12 +98448,9 @@ var defaults = {
97789
98448
  }
97790
98449
  const isFormData3 = utils_default.isFormData(data);
97791
98450
  if (isFormData3) {
97792
- if (!hasJSONContentType) {
97793
- return data;
97794
- }
97795
98451
  return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
97796
98452
  }
97797
- if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
98453
+ if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) {
97798
98454
  return data;
97799
98455
  }
97800
98456
  if (utils_default.isArrayBufferView(data)) {
@@ -97828,6 +98484,9 @@ var defaults = {
97828
98484
  const transitional2 = this.transitional || defaults.transitional;
97829
98485
  const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
97830
98486
  const JSONRequested = this.responseType === "json";
98487
+ if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) {
98488
+ return data;
98489
+ }
97831
98490
  if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
97832
98491
  const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
97833
98492
  const strictJSONParsing = !silentJSONParsing && JSONRequested;
@@ -97872,7 +98531,7 @@ utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method
97872
98531
  });
97873
98532
  var defaults_default = defaults;
97874
98533
 
97875
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/parseHeaders.js
98534
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/parseHeaders.js
97876
98535
  var ignoreDuplicateOf = utils_default.toObjectSet([
97877
98536
  "age",
97878
98537
  "authorization",
@@ -97917,7 +98576,7 @@ var parseHeaders_default = (rawHeaders) => {
97917
98576
  return parsed;
97918
98577
  };
97919
98578
 
97920
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/AxiosHeaders.js
98579
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/AxiosHeaders.js
97921
98580
  var $internals = Symbol("internals");
97922
98581
  function normalizeHeader(header) {
97923
98582
  return header && String(header).trim().toLowerCase();
@@ -97938,20 +98597,20 @@ function parseTokens(str2) {
97938
98597
  return tokens;
97939
98598
  }
97940
98599
  var isValidHeaderName = (str2) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str2.trim());
97941
- function matchHeaderValue(context, value, header, filter3, isHeaderNameFilter) {
97942
- if (utils_default.isFunction(filter3)) {
97943
- return filter3.call(this, value, header);
98600
+ function matchHeaderValue(context, value, header, filter4, isHeaderNameFilter) {
98601
+ if (utils_default.isFunction(filter4)) {
98602
+ return filter4.call(this, value, header);
97944
98603
  }
97945
98604
  if (isHeaderNameFilter) {
97946
98605
  value = header;
97947
98606
  }
97948
98607
  if (!utils_default.isString(value))
97949
98608
  return;
97950
- if (utils_default.isString(filter3)) {
97951
- return value.indexOf(filter3) !== -1;
98609
+ if (utils_default.isString(filter4)) {
98610
+ return value.indexOf(filter4) !== -1;
97952
98611
  }
97953
- if (utils_default.isRegExp(filter3)) {
97954
- return filter3.test(value);
98612
+ if (utils_default.isRegExp(filter4)) {
98613
+ return filter4.test(value);
97955
98614
  }
97956
98615
  }
97957
98616
  function formatHeader(header) {
@@ -97991,6 +98650,10 @@ var AxiosHeaders = class {
97991
98650
  setHeaders(header, valueOrRewrite);
97992
98651
  } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
97993
98652
  setHeaders(parseHeaders_default(header), valueOrRewrite);
98653
+ } else if (utils_default.isHeaders(header)) {
98654
+ for (const [key, value] of header.entries()) {
98655
+ setHeader(value, key, rewrite);
98656
+ }
97994
98657
  } else {
97995
98658
  header != null && setHeader(valueOrRewrite, header, rewrite);
97996
98659
  }
@@ -98135,7 +98798,7 @@ utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
98135
98798
  utils_default.freezeMethods(AxiosHeaders);
98136
98799
  var AxiosHeaders_default = AxiosHeaders;
98137
98800
 
98138
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/transformData.js
98801
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/transformData.js
98139
98802
  function transformData(fns, response) {
98140
98803
  const config2 = this || defaults_default;
98141
98804
  const context = response || config2;
@@ -98148,12 +98811,12 @@ function transformData(fns, response) {
98148
98811
  return data;
98149
98812
  }
98150
98813
 
98151
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/cancel/isCancel.js
98814
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/cancel/isCancel.js
98152
98815
  function isCancel(value) {
98153
98816
  return !!(value && value.__CANCEL__);
98154
98817
  }
98155
98818
 
98156
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/cancel/CanceledError.js
98819
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/cancel/CanceledError.js
98157
98820
  function CanceledError(message2, config2, request2) {
98158
98821
  AxiosError_default.call(this, message2 == null ? "canceled" : message2, AxiosError_default.ERR_CANCELED, config2, request2);
98159
98822
  this.name = "CanceledError";
@@ -98163,7 +98826,7 @@ utils_default.inherits(CanceledError, AxiosError_default, {
98163
98826
  });
98164
98827
  var CanceledError_default = CanceledError;
98165
98828
 
98166
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/settle.js
98829
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/settle.js
98167
98830
  function settle(resolve2, reject, response) {
98168
98831
  const validateStatus2 = response.config.validateStatus;
98169
98832
  if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
@@ -98179,17 +98842,17 @@ function settle(resolve2, reject, response) {
98179
98842
  }
98180
98843
  }
98181
98844
 
98182
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/isAbsoluteURL.js
98845
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/isAbsoluteURL.js
98183
98846
  function isAbsoluteURL(url2) {
98184
98847
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url2);
98185
98848
  }
98186
98849
 
98187
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/combineURLs.js
98850
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/combineURLs.js
98188
98851
  function combineURLs(baseURL, relativeURL) {
98189
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
98852
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
98190
98853
  }
98191
98854
 
98192
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/buildFullPath.js
98855
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/buildFullPath.js
98193
98856
  function buildFullPath(baseURL, requestedURL) {
98194
98857
  if (baseURL && !isAbsoluteURL(requestedURL)) {
98195
98858
  return combineURLs(baseURL, requestedURL);
@@ -98197,7 +98860,7 @@ function buildFullPath(baseURL, requestedURL) {
98197
98860
  return requestedURL;
98198
98861
  }
98199
98862
 
98200
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/adapters/http.js
98863
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/http.js
98201
98864
  var import_proxy_from_env = __toESM(require_proxy_from_env(), 1);
98202
98865
  var import_http = __toESM(require("http"), 1);
98203
98866
  var import_https = __toESM(require("https"), 1);
@@ -98205,16 +98868,16 @@ var import_util16 = __toESM(require("util"), 1);
98205
98868
  var import_follow_redirects = __toESM(require_follow_redirects(), 1);
98206
98869
  var import_zlib = __toESM(require("zlib"), 1);
98207
98870
 
98208
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/env/data.js
98209
- var VERSION2 = "1.6.2";
98871
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/env/data.js
98872
+ var VERSION2 = "1.7.7";
98210
98873
 
98211
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/parseProtocol.js
98874
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/parseProtocol.js
98212
98875
  function parseProtocol(url2) {
98213
98876
  const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url2);
98214
98877
  return match2 && match2[1] || "";
98215
98878
  }
98216
98879
 
98217
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/fromDataURI.js
98880
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/fromDataURI.js
98218
98881
  var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
98219
98882
  function fromDataURI(uri, asBlob, options) {
98220
98883
  const _Blob = options && options.Blob || platform_default.classes.Blob;
@@ -98243,75 +98906,11 @@ function fromDataURI(uri, asBlob, options) {
98243
98906
  throw new AxiosError_default("Unsupported protocol " + protocol, AxiosError_default.ERR_NOT_SUPPORT);
98244
98907
  }
98245
98908
 
98246
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/adapters/http.js
98909
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/http.js
98247
98910
  var import_stream4 = __toESM(require("stream"), 1);
98248
98911
 
98249
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/AxiosTransformStream.js
98912
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/AxiosTransformStream.js
98250
98913
  var import_stream = __toESM(require("stream"), 1);
98251
-
98252
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/throttle.js
98253
- function throttle(fn, freq) {
98254
- let timestamp = 0;
98255
- const threshold = 1e3 / freq;
98256
- let timer = null;
98257
- return function throttled(force, args2) {
98258
- const now2 = Date.now();
98259
- if (force || now2 - timestamp > threshold) {
98260
- if (timer) {
98261
- clearTimeout(timer);
98262
- timer = null;
98263
- }
98264
- timestamp = now2;
98265
- return fn.apply(null, args2);
98266
- }
98267
- if (!timer) {
98268
- timer = setTimeout(() => {
98269
- timer = null;
98270
- timestamp = Date.now();
98271
- return fn.apply(null, args2);
98272
- }, threshold - (now2 - timestamp));
98273
- }
98274
- };
98275
- }
98276
- var throttle_default = throttle;
98277
-
98278
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/speedometer.js
98279
- function speedometer(samplesCount, min2) {
98280
- samplesCount = samplesCount || 10;
98281
- const bytes = new Array(samplesCount);
98282
- const timestamps = new Array(samplesCount);
98283
- let head = 0;
98284
- let tail = 0;
98285
- let firstSampleTS;
98286
- min2 = min2 !== void 0 ? min2 : 1e3;
98287
- return function push(chunkLength) {
98288
- const now2 = Date.now();
98289
- const startedAt = timestamps[tail];
98290
- if (!firstSampleTS) {
98291
- firstSampleTS = now2;
98292
- }
98293
- bytes[head] = chunkLength;
98294
- timestamps[head] = now2;
98295
- let i2 = tail;
98296
- let bytesCount = 0;
98297
- while (i2 !== head) {
98298
- bytesCount += bytes[i2++];
98299
- i2 = i2 % samplesCount;
98300
- }
98301
- head = (head + 1) % samplesCount;
98302
- if (head === tail) {
98303
- tail = (tail + 1) % samplesCount;
98304
- }
98305
- if (now2 - firstSampleTS < min2) {
98306
- return;
98307
- }
98308
- const passed = startedAt && now2 - startedAt;
98309
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
98310
- };
98311
- }
98312
- var speedometer_default = speedometer;
98313
-
98314
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/AxiosTransformStream.js
98315
98914
  var kInternals = Symbol("internals");
98316
98915
  var AxiosTransformStream = class extends import_stream.default.Transform {
98317
98916
  constructor(options) {
@@ -98328,11 +98927,8 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98328
98927
  super({
98329
98928
  readableHighWaterMark: options.chunkSize
98330
98929
  });
98331
- const self2 = this;
98332
98930
  const internals = this[kInternals] = {
98333
- length: options.length,
98334
98931
  timeWindow: options.timeWindow,
98335
- ticksRate: options.ticksRate,
98336
98932
  chunkSize: options.chunkSize,
98337
98933
  maxRate: options.maxRate,
98338
98934
  minChunkSize: options.minChunkSize,
@@ -98343,7 +98939,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98343
98939
  bytes: 0,
98344
98940
  onReadCallback: null
98345
98941
  };
98346
- const _speedometer = speedometer_default(internals.ticksRate * options.samplesCount, internals.timeWindow);
98347
98942
  this.on("newListener", (event) => {
98348
98943
  if (event === "progress") {
98349
98944
  if (!internals.isCaptured) {
@@ -98351,31 +98946,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98351
98946
  }
98352
98947
  }
98353
98948
  });
98354
- let bytesNotified = 0;
98355
- internals.updateProgress = throttle_default(function throttledHandler() {
98356
- const totalBytes = internals.length;
98357
- const bytesTransferred = internals.bytesSeen;
98358
- const progressBytes = bytesTransferred - bytesNotified;
98359
- if (!progressBytes || self2.destroyed)
98360
- return;
98361
- const rate = _speedometer(progressBytes);
98362
- bytesNotified = bytesTransferred;
98363
- process.nextTick(() => {
98364
- self2.emit("progress", {
98365
- "loaded": bytesTransferred,
98366
- "total": totalBytes,
98367
- "progress": totalBytes ? bytesTransferred / totalBytes : void 0,
98368
- "bytes": progressBytes,
98369
- "rate": rate ? rate : void 0,
98370
- "estimated": rate && totalBytes && bytesTransferred <= totalBytes ? (totalBytes - bytesTransferred) / rate : void 0
98371
- });
98372
- });
98373
- }, internals.ticksRate);
98374
- const onFinish = () => {
98375
- internals.updateProgress(true);
98376
- };
98377
- this.once("end", onFinish);
98378
- this.once("error", onFinish);
98379
98949
  }
98380
98950
  _read(size) {
98381
98951
  const internals = this[kInternals];
@@ -98385,7 +98955,6 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98385
98955
  return super._read(size);
98386
98956
  }
98387
98957
  _transform(chunk, encoding, callback) {
98388
- const self2 = this;
98389
98958
  const internals = this[kInternals];
98390
98959
  const maxRate = internals.maxRate;
98391
98960
  const readableHighWaterMark = this.readableHighWaterMark;
@@ -98393,14 +98962,12 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98393
98962
  const divider = 1e3 / timeWindow;
98394
98963
  const bytesThreshold = maxRate / divider;
98395
98964
  const minChunkSize = internals.minChunkSize !== false ? Math.max(internals.minChunkSize, bytesThreshold * 0.01) : 0;
98396
- function pushChunk(_chunk, _callback) {
98965
+ const pushChunk = (_chunk, _callback) => {
98397
98966
  const bytes = Buffer.byteLength(_chunk);
98398
98967
  internals.bytesSeen += bytes;
98399
98968
  internals.bytes += bytes;
98400
- if (internals.isCaptured) {
98401
- internals.updateProgress();
98402
- }
98403
- if (self2.push(_chunk)) {
98969
+ internals.isCaptured && this.emit("progress", internals.bytesSeen);
98970
+ if (this.push(_chunk)) {
98404
98971
  process.nextTick(_callback);
98405
98972
  } else {
98406
98973
  internals.onReadCallback = () => {
@@ -98408,7 +98975,7 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98408
98975
  process.nextTick(_callback);
98409
98976
  };
98410
98977
  }
98411
- }
98978
+ };
98412
98979
  const transformChunk = (_chunk, _callback) => {
98413
98980
  const chunkSize = Buffer.byteLength(_chunk);
98414
98981
  let chunkRemainder = null;
@@ -98454,21 +99021,17 @@ var AxiosTransformStream = class extends import_stream.default.Transform {
98454
99021
  }
98455
99022
  });
98456
99023
  }
98457
- setLength(length3) {
98458
- this[kInternals].length = +length3;
98459
- return this;
98460
- }
98461
99024
  };
98462
99025
  var AxiosTransformStream_default = AxiosTransformStream;
98463
99026
 
98464
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/adapters/http.js
98465
- var import_events = __toESM(require("events"), 1);
99027
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/http.js
99028
+ var import_events = require("events");
98466
99029
 
98467
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/formDataToStream.js
99030
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/formDataToStream.js
98468
99031
  var import_util15 = require("util");
98469
99032
  var import_stream2 = require("stream");
98470
99033
 
98471
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/readBlob.js
99034
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/readBlob.js
98472
99035
  var { asyncIterator } = Symbol;
98473
99036
  var readBlob = async function* (blob) {
98474
99037
  if (blob.stream) {
@@ -98483,7 +99046,7 @@ var readBlob = async function* (blob) {
98483
99046
  };
98484
99047
  var readBlob_default = readBlob;
98485
99048
 
98486
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/formDataToStream.js
99049
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/formDataToStream.js
98487
99050
  var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_";
98488
99051
  var textEncoder = new import_util15.TextEncoder();
98489
99052
  var CRLF = "\r\n";
@@ -98562,7 +99125,7 @@ var formDataToStream = (form, headersHandler, options) => {
98562
99125
  };
98563
99126
  var formDataToStream_default = formDataToStream;
98564
99127
 
98565
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
99128
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js
98566
99129
  var import_stream3 = __toESM(require("stream"), 1);
98567
99130
  var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
98568
99131
  __transform(chunk, encoding, callback) {
@@ -98584,7 +99147,7 @@ var ZlibHeaderTransformStream = class extends import_stream3.default.Transform {
98584
99147
  };
98585
99148
  var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream;
98586
99149
 
98587
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/callbackify.js
99150
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/callbackify.js
98588
99151
  var callbackify = (fn, reducer) => {
98589
99152
  return utils_default.isAsyncFn(fn) ? function(...args2) {
98590
99153
  const cb = args2.pop();
@@ -98599,7 +99162,113 @@ var callbackify = (fn, reducer) => {
98599
99162
  };
98600
99163
  var callbackify_default = callbackify;
98601
99164
 
98602
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/adapters/http.js
99165
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/speedometer.js
99166
+ function speedometer(samplesCount, min2) {
99167
+ samplesCount = samplesCount || 10;
99168
+ const bytes = new Array(samplesCount);
99169
+ const timestamps = new Array(samplesCount);
99170
+ let head = 0;
99171
+ let tail = 0;
99172
+ let firstSampleTS;
99173
+ min2 = min2 !== void 0 ? min2 : 1e3;
99174
+ return function push(chunkLength) {
99175
+ const now2 = Date.now();
99176
+ const startedAt = timestamps[tail];
99177
+ if (!firstSampleTS) {
99178
+ firstSampleTS = now2;
99179
+ }
99180
+ bytes[head] = chunkLength;
99181
+ timestamps[head] = now2;
99182
+ let i2 = tail;
99183
+ let bytesCount = 0;
99184
+ while (i2 !== head) {
99185
+ bytesCount += bytes[i2++];
99186
+ i2 = i2 % samplesCount;
99187
+ }
99188
+ head = (head + 1) % samplesCount;
99189
+ if (head === tail) {
99190
+ tail = (tail + 1) % samplesCount;
99191
+ }
99192
+ if (now2 - firstSampleTS < min2) {
99193
+ return;
99194
+ }
99195
+ const passed = startedAt && now2 - startedAt;
99196
+ return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
99197
+ };
99198
+ }
99199
+ var speedometer_default = speedometer;
99200
+
99201
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/throttle.js
99202
+ function throttle(fn, freq) {
99203
+ let timestamp = 0;
99204
+ let threshold = 1e3 / freq;
99205
+ let lastArgs;
99206
+ let timer;
99207
+ const invoke = (args2, now2 = Date.now()) => {
99208
+ timestamp = now2;
99209
+ lastArgs = null;
99210
+ if (timer) {
99211
+ clearTimeout(timer);
99212
+ timer = null;
99213
+ }
99214
+ fn.apply(null, args2);
99215
+ };
99216
+ const throttled = (...args2) => {
99217
+ const now2 = Date.now();
99218
+ const passed = now2 - timestamp;
99219
+ if (passed >= threshold) {
99220
+ invoke(args2, now2);
99221
+ } else {
99222
+ lastArgs = args2;
99223
+ if (!timer) {
99224
+ timer = setTimeout(() => {
99225
+ timer = null;
99226
+ invoke(lastArgs);
99227
+ }, threshold - passed);
99228
+ }
99229
+ }
99230
+ };
99231
+ const flush = () => lastArgs && invoke(lastArgs);
99232
+ return [throttled, flush];
99233
+ }
99234
+ var throttle_default = throttle;
99235
+
99236
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/progressEventReducer.js
99237
+ var progressEventReducer = (listener, isDownloadStream, freq = 3) => {
99238
+ let bytesNotified = 0;
99239
+ const _speedometer = speedometer_default(50, 250);
99240
+ return throttle_default((e2) => {
99241
+ const loaded = e2.loaded;
99242
+ const total = e2.lengthComputable ? e2.total : void 0;
99243
+ const progressBytes = loaded - bytesNotified;
99244
+ const rate = _speedometer(progressBytes);
99245
+ const inRange = loaded <= total;
99246
+ bytesNotified = loaded;
99247
+ const data = {
99248
+ loaded,
99249
+ total,
99250
+ progress: total ? loaded / total : void 0,
99251
+ bytes: progressBytes,
99252
+ rate: rate ? rate : void 0,
99253
+ estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
99254
+ event: e2,
99255
+ lengthComputable: total != null,
99256
+ [isDownloadStream ? "download" : "upload"]: true
99257
+ };
99258
+ listener(data);
99259
+ }, freq);
99260
+ };
99261
+ var progressEventDecorator = (total, throttled) => {
99262
+ const lengthComputable = total != null;
99263
+ return [(loaded) => throttled[0]({
99264
+ lengthComputable,
99265
+ total,
99266
+ loaded
99267
+ }), throttled[1]];
99268
+ };
99269
+ var asyncDecorator = (fn) => (...args2) => utils_default.asap(() => fn(...args2));
99270
+
99271
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/http.js
98603
99272
  var zlibOptions = {
98604
99273
  flush: import_zlib.default.constants.Z_SYNC_FLUSH,
98605
99274
  finishFlush: import_zlib.default.constants.Z_SYNC_FLUSH
@@ -98614,12 +99283,16 @@ var isHttps = /https:?/;
98614
99283
  var supportedProtocols = platform_default.protocols.map((protocol) => {
98615
99284
  return protocol + ":";
98616
99285
  });
98617
- function dispatchBeforeRedirect(options) {
99286
+ var flushOnFinish = (stream4, [throttled, flush]) => {
99287
+ stream4.on("end", flush).on("error", flush);
99288
+ return throttled;
99289
+ };
99290
+ function dispatchBeforeRedirect(options, responseDetails) {
98618
99291
  if (options.beforeRedirects.proxy) {
98619
99292
  options.beforeRedirects.proxy(options);
98620
99293
  }
98621
99294
  if (options.beforeRedirects.config) {
98622
- options.beforeRedirects.config(options);
99295
+ options.beforeRedirects.config(options, responseDetails);
98623
99296
  }
98624
99297
  }
98625
99298
  function setProxy(options, configProxy, location2) {
@@ -98699,12 +99372,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
98699
99372
  const _lookup = callbackify_default(lookup2, (value) => utils_default.isArray(value) ? value : [value]);
98700
99373
  lookup2 = (hostname, opt, cb) => {
98701
99374
  _lookup(hostname, opt, (err, arg0, arg1) => {
99375
+ if (err) {
99376
+ return cb(err);
99377
+ }
98702
99378
  const addresses = utils_default.isArray(arg0) ? arg0.map((addr) => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
98703
99379
  opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
98704
99380
  });
98705
99381
  };
98706
99382
  }
98707
- const emitter = new import_events.default();
99383
+ const emitter = new import_events.EventEmitter();
98708
99384
  const onFinished = () => {
98709
99385
  if (config2.cancelToken) {
98710
99386
  config2.cancelToken.unsubscribe(abort);
@@ -98732,7 +99408,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
98732
99408
  }
98733
99409
  }
98734
99410
  const fullPath = buildFullPath(config2.baseURL, config2.url);
98735
- const parsed = new URL(fullPath, "http://localhost");
99411
+ const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
98736
99412
  const protocol = parsed.protocol || supportedProtocols[0];
98737
99413
  if (protocol === "data:") {
98738
99414
  let convertedData;
@@ -98776,8 +99452,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
98776
99452
  }
98777
99453
  const headers = AxiosHeaders_default.from(config2.headers).normalize();
98778
99454
  headers.set("User-Agent", "axios/" + VERSION2, false);
98779
- const onDownloadProgress = config2.onDownloadProgress;
98780
- const onUploadProgress = config2.onUploadProgress;
99455
+ const { onUploadProgress, onDownloadProgress } = config2;
98781
99456
  const maxRate = config2.maxRate;
98782
99457
  let maxUploadRate = void 0;
98783
99458
  let maxDownloadRate = void 0;
@@ -98836,14 +99511,15 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
98836
99511
  data = import_stream4.default.Readable.from(data, { objectMode: false });
98837
99512
  }
98838
99513
  data = import_stream4.default.pipeline([data, new AxiosTransformStream_default({
98839
- length: contentLength,
98840
99514
  maxRate: utils_default.toFiniteNumber(maxUploadRate)
98841
99515
  })], utils_default.noop);
98842
- onUploadProgress && data.on("progress", (progress) => {
98843
- onUploadProgress(Object.assign(progress, {
98844
- upload: true
98845
- }));
98846
- });
99516
+ onUploadProgress && data.on("progress", flushOnFinish(
99517
+ data,
99518
+ progressEventDecorator(
99519
+ contentLength,
99520
+ progressEventReducer(asyncDecorator(onUploadProgress), false, 3)
99521
+ )
99522
+ ));
98847
99523
  }
98848
99524
  let auth7 = void 0;
98849
99525
  if (config2.auth) {
@@ -98891,7 +99567,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
98891
99567
  if (config2.socketPath) {
98892
99568
  options.socketPath = config2.socketPath;
98893
99569
  } else {
98894
- options.hostname = parsed.hostname;
99570
+ options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
98895
99571
  options.port = parsed.port;
98896
99572
  setProxy(options, config2.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
98897
99573
  }
@@ -98924,16 +99600,17 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
98924
99600
  return;
98925
99601
  const streams = [res];
98926
99602
  const responseLength = +res.headers["content-length"];
98927
- if (onDownloadProgress) {
99603
+ if (onDownloadProgress || maxDownloadRate) {
98928
99604
  const transformStream = new AxiosTransformStream_default({
98929
- length: utils_default.toFiniteNumber(responseLength),
98930
99605
  maxRate: utils_default.toFiniteNumber(maxDownloadRate)
98931
99606
  });
98932
- onDownloadProgress && transformStream.on("progress", (progress) => {
98933
- onDownloadProgress(Object.assign(progress, {
98934
- download: true
98935
- }));
98936
- });
99607
+ onDownloadProgress && transformStream.on("progress", flushOnFinish(
99608
+ transformStream,
99609
+ progressEventDecorator(
99610
+ responseLength,
99611
+ progressEventReducer(asyncDecorator(onDownloadProgress), true, 3)
99612
+ )
99613
+ ));
98937
99614
  streams.push(transformStream);
98938
99615
  }
98939
99616
  let responseStream = res;
@@ -99095,45 +99772,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
99095
99772
  });
99096
99773
  };
99097
99774
 
99098
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/cookies.js
99099
- var cookies_default = platform_default.hasStandardBrowserEnv ? (
99100
- // Standard browser envs support document.cookie
99101
- {
99102
- write(name, value, expires, path6, domain, secure) {
99103
- const cookie = [name + "=" + encodeURIComponent(value)];
99104
- utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
99105
- utils_default.isString(path6) && cookie.push("path=" + path6);
99106
- utils_default.isString(domain) && cookie.push("domain=" + domain);
99107
- secure === true && cookie.push("secure");
99108
- document.cookie = cookie.join("; ");
99109
- },
99110
- read(name) {
99111
- const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
99112
- return match2 ? decodeURIComponent(match2[3]) : null;
99113
- },
99114
- remove(name) {
99115
- this.write(name, "", Date.now() - 864e5);
99116
- }
99117
- }
99118
- ) : (
99119
- // Non-standard browser env (web workers, react-native) lack needed support.
99120
- {
99121
- write() {
99122
- },
99123
- read() {
99124
- return null;
99125
- },
99126
- remove() {
99127
- }
99128
- }
99129
- );
99130
-
99131
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/isURLSameOrigin.js
99775
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/isURLSameOrigin.js
99132
99776
  var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
99133
99777
  // Standard browser envs have full support of the APIs needed to test
99134
99778
  // whether the request URL is of the same origin as current location.
99135
99779
  function standardBrowserEnv() {
99136
- const msie = /(msie|trident)/i.test(navigator.userAgent);
99780
+ const msie = platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent);
99137
99781
  const urlParsingNode = document.createElement("a");
99138
99782
  let originURL;
99139
99783
  function resolveURL(url2) {
@@ -99169,63 +99813,172 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? (
99169
99813
  }()
99170
99814
  );
99171
99815
 
99172
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/adapters/xhr.js
99173
- function progressEventReducer(listener, isDownloadStream) {
99174
- let bytesNotified = 0;
99175
- const _speedometer = speedometer_default(50, 250);
99176
- return (e2) => {
99177
- const loaded = e2.loaded;
99178
- const total = e2.lengthComputable ? e2.total : void 0;
99179
- const progressBytes = loaded - bytesNotified;
99180
- const rate = _speedometer(progressBytes);
99181
- const inRange = loaded <= total;
99182
- bytesNotified = loaded;
99183
- const data = {
99184
- loaded,
99185
- total,
99186
- progress: total ? loaded / total : void 0,
99187
- bytes: progressBytes,
99188
- rate: rate ? rate : void 0,
99189
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
99190
- event: e2
99191
- };
99192
- data[isDownloadStream ? "download" : "upload"] = true;
99193
- listener(data);
99816
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/cookies.js
99817
+ var cookies_default = platform_default.hasStandardBrowserEnv ? (
99818
+ // Standard browser envs support document.cookie
99819
+ {
99820
+ write(name, value, expires, path6, domain, secure) {
99821
+ const cookie = [name + "=" + encodeURIComponent(value)];
99822
+ utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString());
99823
+ utils_default.isString(path6) && cookie.push("path=" + path6);
99824
+ utils_default.isString(domain) && cookie.push("domain=" + domain);
99825
+ secure === true && cookie.push("secure");
99826
+ document.cookie = cookie.join("; ");
99827
+ },
99828
+ read(name) {
99829
+ const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
99830
+ return match2 ? decodeURIComponent(match2[3]) : null;
99831
+ },
99832
+ remove(name) {
99833
+ this.write(name, "", Date.now() - 864e5);
99834
+ }
99835
+ }
99836
+ ) : (
99837
+ // Non-standard browser env (web workers, react-native) lack needed support.
99838
+ {
99839
+ write() {
99840
+ },
99841
+ read() {
99842
+ return null;
99843
+ },
99844
+ remove() {
99845
+ }
99846
+ }
99847
+ );
99848
+
99849
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/mergeConfig.js
99850
+ var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? { ...thing } : thing;
99851
+ function mergeConfig(config1, config2) {
99852
+ config2 = config2 || {};
99853
+ const config3 = {};
99854
+ function getMergedValue(target, source, caseless) {
99855
+ if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
99856
+ return utils_default.merge.call({ caseless }, target, source);
99857
+ } else if (utils_default.isPlainObject(source)) {
99858
+ return utils_default.merge({}, source);
99859
+ } else if (utils_default.isArray(source)) {
99860
+ return source.slice();
99861
+ }
99862
+ return source;
99863
+ }
99864
+ function mergeDeepProperties(a3, b2, caseless) {
99865
+ if (!utils_default.isUndefined(b2)) {
99866
+ return getMergedValue(a3, b2, caseless);
99867
+ } else if (!utils_default.isUndefined(a3)) {
99868
+ return getMergedValue(void 0, a3, caseless);
99869
+ }
99870
+ }
99871
+ function valueFromConfig2(a3, b2) {
99872
+ if (!utils_default.isUndefined(b2)) {
99873
+ return getMergedValue(void 0, b2);
99874
+ }
99875
+ }
99876
+ function defaultToConfig2(a3, b2) {
99877
+ if (!utils_default.isUndefined(b2)) {
99878
+ return getMergedValue(void 0, b2);
99879
+ } else if (!utils_default.isUndefined(a3)) {
99880
+ return getMergedValue(void 0, a3);
99881
+ }
99882
+ }
99883
+ function mergeDirectKeys(a3, b2, prop) {
99884
+ if (prop in config2) {
99885
+ return getMergedValue(a3, b2);
99886
+ } else if (prop in config1) {
99887
+ return getMergedValue(void 0, a3);
99888
+ }
99889
+ }
99890
+ const mergeMap = {
99891
+ url: valueFromConfig2,
99892
+ method: valueFromConfig2,
99893
+ data: valueFromConfig2,
99894
+ baseURL: defaultToConfig2,
99895
+ transformRequest: defaultToConfig2,
99896
+ transformResponse: defaultToConfig2,
99897
+ paramsSerializer: defaultToConfig2,
99898
+ timeout: defaultToConfig2,
99899
+ timeoutMessage: defaultToConfig2,
99900
+ withCredentials: defaultToConfig2,
99901
+ withXSRFToken: defaultToConfig2,
99902
+ adapter: defaultToConfig2,
99903
+ responseType: defaultToConfig2,
99904
+ xsrfCookieName: defaultToConfig2,
99905
+ xsrfHeaderName: defaultToConfig2,
99906
+ onUploadProgress: defaultToConfig2,
99907
+ onDownloadProgress: defaultToConfig2,
99908
+ decompress: defaultToConfig2,
99909
+ maxContentLength: defaultToConfig2,
99910
+ maxBodyLength: defaultToConfig2,
99911
+ beforeRedirect: defaultToConfig2,
99912
+ transport: defaultToConfig2,
99913
+ httpAgent: defaultToConfig2,
99914
+ httpsAgent: defaultToConfig2,
99915
+ cancelToken: defaultToConfig2,
99916
+ socketPath: defaultToConfig2,
99917
+ responseEncoding: defaultToConfig2,
99918
+ validateStatus: mergeDirectKeys,
99919
+ headers: (a3, b2) => mergeDeepProperties(headersToObject(a3), headersToObject(b2), true)
99194
99920
  };
99921
+ utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
99922
+ const merge6 = mergeMap[prop] || mergeDeepProperties;
99923
+ const configValue = merge6(config1[prop], config2[prop], prop);
99924
+ utils_default.isUndefined(configValue) && merge6 !== mergeDirectKeys || (config3[prop] = configValue);
99925
+ });
99926
+ return config3;
99195
99927
  }
99928
+
99929
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/resolveConfig.js
99930
+ var resolveConfig_default = (config2) => {
99931
+ const newConfig = mergeConfig({}, config2);
99932
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth: auth7 } = newConfig;
99933
+ newConfig.headers = headers = AxiosHeaders_default.from(headers);
99934
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config2.params, config2.paramsSerializer);
99935
+ if (auth7) {
99936
+ headers.set(
99937
+ "Authorization",
99938
+ "Basic " + btoa((auth7.username || "") + ":" + (auth7.password ? unescape(encodeURIComponent(auth7.password)) : ""))
99939
+ );
99940
+ }
99941
+ let contentType;
99942
+ if (utils_default.isFormData(data)) {
99943
+ if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
99944
+ headers.setContentType(void 0);
99945
+ } else if ((contentType = headers.getContentType()) !== false) {
99946
+ const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
99947
+ headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
99948
+ }
99949
+ }
99950
+ if (platform_default.hasStandardBrowserEnv) {
99951
+ withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
99952
+ if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) {
99953
+ const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName);
99954
+ if (xsrfValue) {
99955
+ headers.set(xsrfHeaderName, xsrfValue);
99956
+ }
99957
+ }
99958
+ }
99959
+ return newConfig;
99960
+ };
99961
+
99962
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/xhr.js
99196
99963
  var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
99197
99964
  var xhr_default = isXHRAdapterSupported && function(config2) {
99198
99965
  return new Promise(function dispatchXhrRequest(resolve2, reject) {
99199
- let requestData = config2.data;
99200
- const requestHeaders = AxiosHeaders_default.from(config2.headers).normalize();
99201
- let { responseType, withXSRFToken } = config2;
99966
+ const _config = resolveConfig_default(config2);
99967
+ let requestData = _config.data;
99968
+ const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
99969
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
99202
99970
  let onCanceled;
99971
+ let uploadThrottled, downloadThrottled;
99972
+ let flushUpload, flushDownload;
99203
99973
  function done() {
99204
- if (config2.cancelToken) {
99205
- config2.cancelToken.unsubscribe(onCanceled);
99206
- }
99207
- if (config2.signal) {
99208
- config2.signal.removeEventListener("abort", onCanceled);
99209
- }
99210
- }
99211
- let contentType;
99212
- if (utils_default.isFormData(requestData)) {
99213
- if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) {
99214
- requestHeaders.setContentType(false);
99215
- } else if ((contentType = requestHeaders.getContentType()) !== false) {
99216
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
99217
- requestHeaders.setContentType([type || "multipart/form-data", ...tokens].join("; "));
99218
- }
99974
+ flushUpload && flushUpload();
99975
+ flushDownload && flushDownload();
99976
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
99977
+ _config.signal && _config.signal.removeEventListener("abort", onCanceled);
99219
99978
  }
99220
99979
  let request2 = new XMLHttpRequest();
99221
- if (config2.auth) {
99222
- const username = config2.auth.username || "";
99223
- const password = config2.auth.password ? unescape(encodeURIComponent(config2.auth.password)) : "";
99224
- requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
99225
- }
99226
- const fullPath = buildFullPath(config2.baseURL, config2.url);
99227
- request2.open(config2.method.toUpperCase(), buildURL(fullPath, config2.params, config2.paramsSerializer), true);
99228
- request2.timeout = config2.timeout;
99980
+ request2.open(_config.method.toUpperCase(), _config.url, true);
99981
+ request2.timeout = _config.timeout;
99229
99982
  function onloadend() {
99230
99983
  if (!request2) {
99231
99984
  return;
@@ -99276,10 +100029,10 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
99276
100029
  request2 = null;
99277
100030
  };
99278
100031
  request2.ontimeout = function handleTimeout() {
99279
- let timeoutErrorMessage = config2.timeout ? "timeout of " + config2.timeout + "ms exceeded" : "timeout exceeded";
99280
- const transitional2 = config2.transitional || transitional_default;
99281
- if (config2.timeoutErrorMessage) {
99282
- timeoutErrorMessage = config2.timeoutErrorMessage;
100032
+ let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded";
100033
+ const transitional2 = _config.transitional || transitional_default;
100034
+ if (_config.timeoutErrorMessage) {
100035
+ timeoutErrorMessage = _config.timeoutErrorMessage;
99283
100036
  }
99284
100037
  reject(new AxiosError_default(
99285
100038
  timeoutErrorMessage,
@@ -99289,34 +100042,28 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
99289
100042
  ));
99290
100043
  request2 = null;
99291
100044
  };
99292
- if (platform_default.hasStandardBrowserEnv) {
99293
- withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config2));
99294
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(fullPath)) {
99295
- const xsrfValue = config2.xsrfHeaderName && config2.xsrfCookieName && cookies_default.read(config2.xsrfCookieName);
99296
- if (xsrfValue) {
99297
- requestHeaders.set(config2.xsrfHeaderName, xsrfValue);
99298
- }
99299
- }
99300
- }
99301
100045
  requestData === void 0 && requestHeaders.setContentType(null);
99302
100046
  if ("setRequestHeader" in request2) {
99303
100047
  utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
99304
100048
  request2.setRequestHeader(key, val);
99305
100049
  });
99306
100050
  }
99307
- if (!utils_default.isUndefined(config2.withCredentials)) {
99308
- request2.withCredentials = !!config2.withCredentials;
100051
+ if (!utils_default.isUndefined(_config.withCredentials)) {
100052
+ request2.withCredentials = !!_config.withCredentials;
99309
100053
  }
99310
100054
  if (responseType && responseType !== "json") {
99311
- request2.responseType = config2.responseType;
100055
+ request2.responseType = _config.responseType;
99312
100056
  }
99313
- if (typeof config2.onDownloadProgress === "function") {
99314
- request2.addEventListener("progress", progressEventReducer(config2.onDownloadProgress, true));
100057
+ if (onDownloadProgress) {
100058
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
100059
+ request2.addEventListener("progress", downloadThrottled);
99315
100060
  }
99316
- if (typeof config2.onUploadProgress === "function" && request2.upload) {
99317
- request2.upload.addEventListener("progress", progressEventReducer(config2.onUploadProgress));
100061
+ if (onUploadProgress && request2.upload) {
100062
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
100063
+ request2.upload.addEventListener("progress", uploadThrottled);
100064
+ request2.upload.addEventListener("loadend", flushUpload);
99318
100065
  }
99319
- if (config2.cancelToken || config2.signal) {
100066
+ if (_config.cancelToken || _config.signal) {
99320
100067
  onCanceled = (cancel) => {
99321
100068
  if (!request2) {
99322
100069
  return;
@@ -99325,12 +100072,12 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
99325
100072
  request2.abort();
99326
100073
  request2 = null;
99327
100074
  };
99328
- config2.cancelToken && config2.cancelToken.subscribe(onCanceled);
99329
- if (config2.signal) {
99330
- config2.signal.aborted ? onCanceled() : config2.signal.addEventListener("abort", onCanceled);
100075
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
100076
+ if (_config.signal) {
100077
+ _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled);
99331
100078
  }
99332
100079
  }
99333
- const protocol = parseProtocol(fullPath);
100080
+ const protocol = parseProtocol(_config.url);
99334
100081
  if (protocol && platform_default.protocols.indexOf(protocol) === -1) {
99335
100082
  reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config2));
99336
100083
  return;
@@ -99339,10 +100086,288 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
99339
100086
  });
99340
100087
  };
99341
100088
 
99342
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/adapters/adapters.js
100089
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/composeSignals.js
100090
+ var composeSignals = (signals, timeout) => {
100091
+ const { length: length3 } = signals = signals ? signals.filter(Boolean) : [];
100092
+ if (timeout || length3) {
100093
+ let controller = new AbortController();
100094
+ let aborted;
100095
+ const onabort = function(reason) {
100096
+ if (!aborted) {
100097
+ aborted = true;
100098
+ unsubscribe();
100099
+ const err = reason instanceof Error ? reason : this.reason;
100100
+ controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
100101
+ }
100102
+ };
100103
+ let timer = timeout && setTimeout(() => {
100104
+ timer = null;
100105
+ onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
100106
+ }, timeout);
100107
+ const unsubscribe = () => {
100108
+ if (signals) {
100109
+ timer && clearTimeout(timer);
100110
+ timer = null;
100111
+ signals.forEach((signal2) => {
100112
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
100113
+ });
100114
+ signals = null;
100115
+ }
100116
+ };
100117
+ signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
100118
+ const { signal } = controller;
100119
+ signal.unsubscribe = () => utils_default.asap(unsubscribe);
100120
+ return signal;
100121
+ }
100122
+ };
100123
+ var composeSignals_default = composeSignals;
100124
+
100125
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/trackStream.js
100126
+ var streamChunk = function* (chunk, chunkSize) {
100127
+ let len = chunk.byteLength;
100128
+ if (!chunkSize || len < chunkSize) {
100129
+ yield chunk;
100130
+ return;
100131
+ }
100132
+ let pos = 0;
100133
+ let end;
100134
+ while (pos < len) {
100135
+ end = pos + chunkSize;
100136
+ yield chunk.slice(pos, end);
100137
+ pos = end;
100138
+ }
100139
+ };
100140
+ var readBytes = async function* (iterable, chunkSize) {
100141
+ for await (const chunk of readStream(iterable)) {
100142
+ yield* streamChunk(chunk, chunkSize);
100143
+ }
100144
+ };
100145
+ var readStream = async function* (stream4) {
100146
+ if (stream4[Symbol.asyncIterator]) {
100147
+ yield* stream4;
100148
+ return;
100149
+ }
100150
+ const reader = stream4.getReader();
100151
+ try {
100152
+ for (; ; ) {
100153
+ const { done, value } = await reader.read();
100154
+ if (done) {
100155
+ break;
100156
+ }
100157
+ yield value;
100158
+ }
100159
+ } finally {
100160
+ await reader.cancel();
100161
+ }
100162
+ };
100163
+ var trackStream = (stream4, chunkSize, onProgress, onFinish) => {
100164
+ const iterator2 = readBytes(stream4, chunkSize);
100165
+ let bytes = 0;
100166
+ let done;
100167
+ let _onFinish = (e2) => {
100168
+ if (!done) {
100169
+ done = true;
100170
+ onFinish && onFinish(e2);
100171
+ }
100172
+ };
100173
+ return new ReadableStream({
100174
+ async pull(controller) {
100175
+ try {
100176
+ const { done: done2, value } = await iterator2.next();
100177
+ if (done2) {
100178
+ _onFinish();
100179
+ controller.close();
100180
+ return;
100181
+ }
100182
+ let len = value.byteLength;
100183
+ if (onProgress) {
100184
+ let loadedBytes = bytes += len;
100185
+ onProgress(loadedBytes);
100186
+ }
100187
+ controller.enqueue(new Uint8Array(value));
100188
+ } catch (err) {
100189
+ _onFinish(err);
100190
+ throw err;
100191
+ }
100192
+ },
100193
+ cancel(reason) {
100194
+ _onFinish(reason);
100195
+ return iterator2.return();
100196
+ }
100197
+ }, {
100198
+ highWaterMark: 2
100199
+ });
100200
+ };
100201
+
100202
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/fetch.js
100203
+ var isFetchSupported = typeof fetch === "function" && typeof Request === "function" && typeof Response === "function";
100204
+ var isReadableStreamSupported = isFetchSupported && typeof ReadableStream === "function";
100205
+ var encodeText = isFetchSupported && (typeof TextEncoder === "function" ? /* @__PURE__ */ ((encoder2) => (str2) => encoder2.encode(str2))(new TextEncoder()) : async (str2) => new Uint8Array(await new Response(str2).arrayBuffer()));
100206
+ var test = (fn, ...args2) => {
100207
+ try {
100208
+ return !!fn(...args2);
100209
+ } catch (e2) {
100210
+ return false;
100211
+ }
100212
+ };
100213
+ var supportsRequestStream = isReadableStreamSupported && test(() => {
100214
+ let duplexAccessed = false;
100215
+ const hasContentType = new Request(platform_default.origin, {
100216
+ body: new ReadableStream(),
100217
+ method: "POST",
100218
+ get duplex() {
100219
+ duplexAccessed = true;
100220
+ return "half";
100221
+ }
100222
+ }).headers.has("Content-Type");
100223
+ return duplexAccessed && !hasContentType;
100224
+ });
100225
+ var DEFAULT_CHUNK_SIZE = 64 * 1024;
100226
+ var supportsResponseStream = isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body));
100227
+ var resolvers = {
100228
+ stream: supportsResponseStream && ((res) => res.body)
100229
+ };
100230
+ isFetchSupported && ((res) => {
100231
+ ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => {
100232
+ !resolvers[type] && (resolvers[type] = utils_default.isFunction(res[type]) ? (res2) => res2[type]() : (_3, config2) => {
100233
+ throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config2);
100234
+ });
100235
+ });
100236
+ })(new Response());
100237
+ var getBodyLength = async (body) => {
100238
+ if (body == null) {
100239
+ return 0;
100240
+ }
100241
+ if (utils_default.isBlob(body)) {
100242
+ return body.size;
100243
+ }
100244
+ if (utils_default.isSpecCompliantForm(body)) {
100245
+ const _request = new Request(platform_default.origin, {
100246
+ method: "POST",
100247
+ body
100248
+ });
100249
+ return (await _request.arrayBuffer()).byteLength;
100250
+ }
100251
+ if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) {
100252
+ return body.byteLength;
100253
+ }
100254
+ if (utils_default.isURLSearchParams(body)) {
100255
+ body = body + "";
100256
+ }
100257
+ if (utils_default.isString(body)) {
100258
+ return (await encodeText(body)).byteLength;
100259
+ }
100260
+ };
100261
+ var resolveBodyLength = async (headers, body) => {
100262
+ const length3 = utils_default.toFiniteNumber(headers.getContentLength());
100263
+ return length3 == null ? getBodyLength(body) : length3;
100264
+ };
100265
+ var fetch_default = isFetchSupported && (async (config2) => {
100266
+ let {
100267
+ url: url2,
100268
+ method,
100269
+ data,
100270
+ signal,
100271
+ cancelToken,
100272
+ timeout,
100273
+ onDownloadProgress,
100274
+ onUploadProgress,
100275
+ responseType,
100276
+ headers,
100277
+ withCredentials = "same-origin",
100278
+ fetchOptions
100279
+ } = resolveConfig_default(config2);
100280
+ responseType = responseType ? (responseType + "").toLowerCase() : "text";
100281
+ let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
100282
+ let request2;
100283
+ const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
100284
+ composedSignal.unsubscribe();
100285
+ });
100286
+ let requestContentLength;
100287
+ try {
100288
+ if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
100289
+ let _request = new Request(url2, {
100290
+ method: "POST",
100291
+ body: data,
100292
+ duplex: "half"
100293
+ });
100294
+ let contentTypeHeader;
100295
+ if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) {
100296
+ headers.setContentType(contentTypeHeader);
100297
+ }
100298
+ if (_request.body) {
100299
+ const [onProgress, flush] = progressEventDecorator(
100300
+ requestContentLength,
100301
+ progressEventReducer(asyncDecorator(onUploadProgress))
100302
+ );
100303
+ data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);
100304
+ }
100305
+ }
100306
+ if (!utils_default.isString(withCredentials)) {
100307
+ withCredentials = withCredentials ? "include" : "omit";
100308
+ }
100309
+ const isCredentialsSupported = "credentials" in Request.prototype;
100310
+ request2 = new Request(url2, {
100311
+ ...fetchOptions,
100312
+ signal: composedSignal,
100313
+ method: method.toUpperCase(),
100314
+ headers: headers.normalize().toJSON(),
100315
+ body: data,
100316
+ duplex: "half",
100317
+ credentials: isCredentialsSupported ? withCredentials : void 0
100318
+ });
100319
+ let response = await fetch(request2);
100320
+ const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
100321
+ if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
100322
+ const options = {};
100323
+ ["status", "statusText", "headers"].forEach((prop) => {
100324
+ options[prop] = response[prop];
100325
+ });
100326
+ const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length"));
100327
+ const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
100328
+ responseContentLength,
100329
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
100330
+ ) || [];
100331
+ response = new Response(
100332
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
100333
+ flush && flush();
100334
+ unsubscribe && unsubscribe();
100335
+ }),
100336
+ options
100337
+ );
100338
+ }
100339
+ responseType = responseType || "text";
100340
+ let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config2);
100341
+ !isStreamResponse && unsubscribe && unsubscribe();
100342
+ return await new Promise((resolve2, reject) => {
100343
+ settle(resolve2, reject, {
100344
+ data: responseData,
100345
+ headers: AxiosHeaders_default.from(response.headers),
100346
+ status: response.status,
100347
+ statusText: response.statusText,
100348
+ config: config2,
100349
+ request: request2
100350
+ });
100351
+ });
100352
+ } catch (err) {
100353
+ unsubscribe && unsubscribe();
100354
+ if (err && err.name === "TypeError" && /fetch/i.test(err.message)) {
100355
+ throw Object.assign(
100356
+ new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config2, request2),
100357
+ {
100358
+ cause: err.cause || err
100359
+ }
100360
+ );
100361
+ }
100362
+ throw AxiosError_default.from(err, err && err.code, config2, request2);
100363
+ }
100364
+ });
100365
+
100366
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/adapters/adapters.js
99343
100367
  var knownAdapters = {
99344
100368
  http: http_default,
99345
- xhr: xhr_default
100369
+ xhr: xhr_default,
100370
+ fetch: fetch_default
99346
100371
  };
99347
100372
  utils_default.forEach(knownAdapters, (fn, value) => {
99348
100373
  if (fn) {
@@ -99392,7 +100417,7 @@ var adapters_default = {
99392
100417
  adapters: knownAdapters
99393
100418
  };
99394
100419
 
99395
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/dispatchRequest.js
100420
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/dispatchRequest.js
99396
100421
  function throwIfCancellationRequested(config2) {
99397
100422
  if (config2.cancelToken) {
99398
100423
  config2.cancelToken.throwIfRequested();
@@ -99437,87 +100462,7 @@ function dispatchRequest(config2) {
99437
100462
  });
99438
100463
  }
99439
100464
 
99440
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/mergeConfig.js
99441
- var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
99442
- function mergeConfig(config1, config2) {
99443
- config2 = config2 || {};
99444
- const config3 = {};
99445
- function getMergedValue(target, source, caseless) {
99446
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
99447
- return utils_default.merge.call({ caseless }, target, source);
99448
- } else if (utils_default.isPlainObject(source)) {
99449
- return utils_default.merge({}, source);
99450
- } else if (utils_default.isArray(source)) {
99451
- return source.slice();
99452
- }
99453
- return source;
99454
- }
99455
- function mergeDeepProperties(a3, b2, caseless) {
99456
- if (!utils_default.isUndefined(b2)) {
99457
- return getMergedValue(a3, b2, caseless);
99458
- } else if (!utils_default.isUndefined(a3)) {
99459
- return getMergedValue(void 0, a3, caseless);
99460
- }
99461
- }
99462
- function valueFromConfig2(a3, b2) {
99463
- if (!utils_default.isUndefined(b2)) {
99464
- return getMergedValue(void 0, b2);
99465
- }
99466
- }
99467
- function defaultToConfig2(a3, b2) {
99468
- if (!utils_default.isUndefined(b2)) {
99469
- return getMergedValue(void 0, b2);
99470
- } else if (!utils_default.isUndefined(a3)) {
99471
- return getMergedValue(void 0, a3);
99472
- }
99473
- }
99474
- function mergeDirectKeys(a3, b2, prop) {
99475
- if (prop in config2) {
99476
- return getMergedValue(a3, b2);
99477
- } else if (prop in config1) {
99478
- return getMergedValue(void 0, a3);
99479
- }
99480
- }
99481
- const mergeMap = {
99482
- url: valueFromConfig2,
99483
- method: valueFromConfig2,
99484
- data: valueFromConfig2,
99485
- baseURL: defaultToConfig2,
99486
- transformRequest: defaultToConfig2,
99487
- transformResponse: defaultToConfig2,
99488
- paramsSerializer: defaultToConfig2,
99489
- timeout: defaultToConfig2,
99490
- timeoutMessage: defaultToConfig2,
99491
- withCredentials: defaultToConfig2,
99492
- withXSRFToken: defaultToConfig2,
99493
- adapter: defaultToConfig2,
99494
- responseType: defaultToConfig2,
99495
- xsrfCookieName: defaultToConfig2,
99496
- xsrfHeaderName: defaultToConfig2,
99497
- onUploadProgress: defaultToConfig2,
99498
- onDownloadProgress: defaultToConfig2,
99499
- decompress: defaultToConfig2,
99500
- maxContentLength: defaultToConfig2,
99501
- maxBodyLength: defaultToConfig2,
99502
- beforeRedirect: defaultToConfig2,
99503
- transport: defaultToConfig2,
99504
- httpAgent: defaultToConfig2,
99505
- httpsAgent: defaultToConfig2,
99506
- cancelToken: defaultToConfig2,
99507
- socketPath: defaultToConfig2,
99508
- responseEncoding: defaultToConfig2,
99509
- validateStatus: mergeDirectKeys,
99510
- headers: (a3, b2) => mergeDeepProperties(headersToObject(a3), headersToObject(b2), true)
99511
- };
99512
- utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
99513
- const merge6 = mergeMap[prop] || mergeDeepProperties;
99514
- const configValue = merge6(config1[prop], config2[prop], prop);
99515
- utils_default.isUndefined(configValue) && merge6 !== mergeDirectKeys || (config3[prop] = configValue);
99516
- });
99517
- return config3;
99518
- }
99519
-
99520
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/validator.js
100465
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/validator.js
99521
100466
  var validators = {};
99522
100467
  ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i2) => {
99523
100468
  validators[type] = function validator(thing) {
@@ -99575,7 +100520,7 @@ var validator_default = {
99575
100520
  validators
99576
100521
  };
99577
100522
 
99578
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/core/Axios.js
100523
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/core/Axios.js
99579
100524
  var validators2 = validator_default.validators;
99580
100525
  var Axios = class {
99581
100526
  constructor(instanceConfig) {
@@ -99593,7 +100538,27 @@ var Axios = class {
99593
100538
  *
99594
100539
  * @returns {Promise} The Promise to be fulfilled
99595
100540
  */
99596
- request(configOrUrl, config2) {
100541
+ async request(configOrUrl, config2) {
100542
+ try {
100543
+ return await this._request(configOrUrl, config2);
100544
+ } catch (err) {
100545
+ if (err instanceof Error) {
100546
+ let dummy;
100547
+ Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : dummy = new Error();
100548
+ const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : "";
100549
+ try {
100550
+ if (!err.stack) {
100551
+ err.stack = stack;
100552
+ } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) {
100553
+ err.stack += "\n" + stack;
100554
+ }
100555
+ } catch (e2) {
100556
+ }
100557
+ }
100558
+ throw err;
100559
+ }
100560
+ }
100561
+ _request(configOrUrl, config2) {
99597
100562
  if (typeof configOrUrl === "string") {
99598
100563
  config2 = config2 || {};
99599
100564
  config2.url = configOrUrl;
@@ -99718,7 +100683,7 @@ utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(m
99718
100683
  });
99719
100684
  var Axios_default = Axios;
99720
100685
 
99721
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/cancel/CancelToken.js
100686
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/cancel/CancelToken.js
99722
100687
  var CancelToken = class _CancelToken {
99723
100688
  constructor(executor) {
99724
100689
  if (typeof executor !== "function") {
@@ -99791,6 +100756,15 @@ var CancelToken = class _CancelToken {
99791
100756
  this._listeners.splice(index, 1);
99792
100757
  }
99793
100758
  }
100759
+ toAbortSignal() {
100760
+ const controller = new AbortController();
100761
+ const abort = (err) => {
100762
+ controller.abort(err);
100763
+ };
100764
+ this.subscribe(abort);
100765
+ controller.signal.unsubscribe = () => this.unsubscribe(abort);
100766
+ return controller.signal;
100767
+ }
99794
100768
  /**
99795
100769
  * Returns an object that contains a new `CancelToken` and a function that, when called,
99796
100770
  * cancels the `CancelToken`.
@@ -99808,19 +100782,19 @@ var CancelToken = class _CancelToken {
99808
100782
  };
99809
100783
  var CancelToken_default = CancelToken;
99810
100784
 
99811
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/spread.js
100785
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/spread.js
99812
100786
  function spread(callback) {
99813
100787
  return function wrap3(arr) {
99814
100788
  return callback.apply(null, arr);
99815
100789
  };
99816
100790
  }
99817
100791
 
99818
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/isAxiosError.js
100792
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/isAxiosError.js
99819
100793
  function isAxiosError(payload) {
99820
100794
  return utils_default.isObject(payload) && payload.isAxiosError === true;
99821
100795
  }
99822
100796
 
99823
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/helpers/HttpStatusCode.js
100797
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/helpers/HttpStatusCode.js
99824
100798
  var HttpStatusCode = {
99825
100799
  Continue: 100,
99826
100800
  SwitchingProtocols: 101,
@@ -99891,7 +100865,7 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
99891
100865
  });
99892
100866
  var HttpStatusCode_default = HttpStatusCode;
99893
100867
 
99894
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/lib/axios.js
100868
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/lib/axios.js
99895
100869
  function createInstance(defaultConfig) {
99896
100870
  const context = new Axios_default(defaultConfig);
99897
100871
  const instance = bind(Axios_default.prototype.request, context);
@@ -99924,7 +100898,7 @@ axios.HttpStatusCode = HttpStatusCode_default;
99924
100898
  axios.default = axios;
99925
100899
  var axios_default = axios;
99926
100900
 
99927
- // ../../node_modules/.pnpm/axios@1.6.2/node_modules/axios/index.js
100901
+ // ../../node_modules/.pnpm/axios@1.7.7/node_modules/axios/index.js
99928
100902
  var {
99929
100903
  Axios: Axios2,
99930
100904
  AxiosError: AxiosError2,
@@ -100068,7 +101042,7 @@ function byteLengthOfString(str2) {
100068
101042
 
100069
101043
  // ../aux-records/AuthUtils.ts
100070
101044
  var import_hash4 = __toESM(require_hash());
100071
- var import_base64_js8 = __toESM(require_base64_js());
101045
+ var import_base64_js10 = __toESM(require_base64_js());
100072
101046
  var REFRESH_LIFETIME_MS2 = 1e3 * 60 * 60 * 24 * 7;
100073
101047
  function formatV1SessionKey(userId, sessionId, sessionSecret, expireTimeMs) {
100074
101048
  return `vSK1.${toBase64String(userId)}.${toBase64String(
@@ -100141,7 +101115,7 @@ function formatV1ConnectionKey(userId, sessionId, connectionSecret, expireTimeMs
100141
101115
  )}`;
100142
101116
  }
100143
101117
  function v1ConnectionTokenHmac(connectionSecret, connectionId, recordName, inst) {
100144
- const hash = (0, import_hash4.hmac)(import_hash4.sha256, (0, import_base64_js8.toByteArray)(connectionSecret), "hex");
101118
+ const hash = (0, import_hash4.hmac)(import_hash4.sha256, (0, import_base64_js10.toByteArray)(connectionSecret), "hex");
100145
101119
  hash.update(connectionId);
100146
101120
  hash.update(recordName);
100147
101121
  hash.update(inst);
@@ -103249,7 +104223,7 @@ async function verifyRegistrationResponse(options) {
103249
104223
  throw new Error(`Unexpected credential type ${credentialType}, expected "public-key"`);
103250
104224
  }
103251
104225
  const clientDataJSON = decodeClientDataJSON(attestationResponse.clientDataJSON);
103252
- const { type, origin, challenge, tokenBinding } = clientDataJSON;
104226
+ const { type, origin: origin2, challenge, tokenBinding } = clientDataJSON;
103253
104227
  if (Array.isArray(expectedType)) {
103254
104228
  if (!expectedType.includes(type)) {
103255
104229
  const joinedExpectedType = expectedType.join(", ");
@@ -103270,12 +104244,12 @@ async function verifyRegistrationResponse(options) {
103270
104244
  throw new Error(`Unexpected registration response challenge "${challenge}", expected "${expectedChallenge}"`);
103271
104245
  }
103272
104246
  if (Array.isArray(expectedOrigin)) {
103273
- if (!expectedOrigin.includes(origin)) {
103274
- throw new Error(`Unexpected registration response origin "${origin}", expected one of: ${expectedOrigin.join(", ")}`);
104247
+ if (!expectedOrigin.includes(origin2)) {
104248
+ throw new Error(`Unexpected registration response origin "${origin2}", expected one of: ${expectedOrigin.join(", ")}`);
103275
104249
  }
103276
104250
  } else {
103277
- if (origin !== expectedOrigin) {
103278
- throw new Error(`Unexpected registration response origin "${origin}", expected "${expectedOrigin}"`);
104251
+ if (origin2 !== expectedOrigin) {
104252
+ throw new Error(`Unexpected registration response origin "${origin2}", expected "${expectedOrigin}"`);
103279
104253
  }
103280
104254
  }
103281
104255
  if (tokenBinding) {
@@ -103426,7 +104400,7 @@ async function verifyAuthenticationResponse(options) {
103426
104400
  throw new Error("Credential response clientDataJSON was not a string");
103427
104401
  }
103428
104402
  const clientDataJSON = decodeClientDataJSON(assertionResponse.clientDataJSON);
103429
- const { type, origin, challenge, tokenBinding } = clientDataJSON;
104403
+ const { type, origin: origin2, challenge, tokenBinding } = clientDataJSON;
103430
104404
  if (Array.isArray(expectedType)) {
103431
104405
  if (!expectedType.includes(type)) {
103432
104406
  const joinedExpectedType = expectedType.join(", ");
@@ -103447,13 +104421,13 @@ async function verifyAuthenticationResponse(options) {
103447
104421
  throw new Error(`Unexpected authentication response challenge "${challenge}", expected "${expectedChallenge}"`);
103448
104422
  }
103449
104423
  if (Array.isArray(expectedOrigin)) {
103450
- if (!expectedOrigin.includes(origin)) {
104424
+ if (!expectedOrigin.includes(origin2)) {
103451
104425
  const joinedExpectedOrigin = expectedOrigin.join(", ");
103452
- throw new Error(`Unexpected authentication response origin "${origin}", expected one of: ${joinedExpectedOrigin}`);
104426
+ throw new Error(`Unexpected authentication response origin "${origin2}", expected one of: ${joinedExpectedOrigin}`);
103453
104427
  }
103454
104428
  } else {
103455
- if (origin !== expectedOrigin) {
103456
- throw new Error(`Unexpected authentication response origin "${origin}", expected "${expectedOrigin}"`);
104429
+ if (origin2 !== expectedOrigin) {
104430
+ throw new Error(`Unexpected authentication response origin "${origin2}", expected "${expectedOrigin}"`);
103457
104431
  }
103458
104432
  }
103459
104433
  if (!isoBase64URL_exports.isBase64url(assertionResponse.authenticatorData)) {
@@ -103554,7 +104528,7 @@ var import_semantic_conventions = __toESM(require_src3());
103554
104528
  function traced(tracerName, options = {}, metricOptions = {}) {
103555
104529
  const tracer = trace.getTracer(
103556
104530
  tracerName,
103557
- false ? void 0 : "v3.3.12"
104531
+ false ? void 0 : "v3.3.13"
103558
104532
  );
103559
104533
  return function(target, propertyKey, descriptor) {
103560
104534
  const originalMethod = descriptor.value;
@@ -103632,7 +104606,7 @@ function getHistogram(meter) {
103632
104606
  }
103633
104607
  return metrics.getMeter(
103634
104608
  meter.meter,
103635
- false ? void 0 : "v3.3.12"
104609
+ false ? void 0 : "v3.3.13"
103636
104610
  ).createHistogram(meter.name, meter.options);
103637
104611
  }
103638
104612
  function getCounter(meter) {
@@ -103641,7 +104615,7 @@ function getCounter(meter) {
103641
104615
  }
103642
104616
  return metrics.getMeter(
103643
104617
  meter.meter,
103644
- false ? void 0 : "v3.3.12"
104618
+ false ? void 0 : "v3.3.13"
103645
104619
  ).createCounter(meter.name, meter.options);
103646
104620
  }
103647
104621
  function traceHttpResponse(options = {}) {
@@ -103895,7 +104869,7 @@ var AuthController = class {
103895
104869
  };
103896
104870
  }
103897
104871
  const requestTime = Date.now();
103898
- const requestId = (0, import_base64_js9.fromByteArray)(
104872
+ const requestId = (0, import_base64_js11.fromByteArray)(
103899
104873
  (0, import_tweetnacl4.randomBytes)(LOGIN_REQUEST_ID_BYTE_LENGTH)
103900
104874
  );
103901
104875
  const code = randomCode();
@@ -106004,11 +106978,11 @@ var AuthController = class {
106004
106978
  ...rest
106005
106979
  }) {
106006
106980
  const now2 = Date.now();
106007
- const newSessionId = (0, import_base64_js9.fromByteArray)((0, import_tweetnacl4.randomBytes)(SESSION_ID_BYTE_LENGTH));
106008
- const newSessionSecret = (0, import_base64_js9.fromByteArray)(
106981
+ const newSessionId = (0, import_base64_js11.fromByteArray)((0, import_tweetnacl4.randomBytes)(SESSION_ID_BYTE_LENGTH));
106982
+ const newSessionSecret = (0, import_base64_js11.fromByteArray)(
106009
106983
  (0, import_tweetnacl4.randomBytes)(SESSION_SECRET_BYTE_LENGTH)
106010
106984
  );
106011
- const newConnectionSecret = (0, import_base64_js9.fromByteArray)(
106985
+ const newConnectionSecret = (0, import_base64_js11.fromByteArray)(
106012
106986
  (0, import_tweetnacl4.randomBytes)(SESSION_SECRET_BYTE_LENGTH)
106013
106987
  );
106014
106988
  const newSession = {
@@ -106230,7 +107204,7 @@ function findRelyingPartyForOrigin(relyingParties, originOrHost) {
106230
107204
 
106231
107205
  // ../aux-records/RecordsController.ts
106232
107206
  var import_tweetnacl5 = __toESM(require_nacl_fast());
106233
- var import_base64_js10 = __toESM(require_base64_js());
107207
+ var import_base64_js12 = __toESM(require_base64_js());
106234
107208
 
106235
107209
  // ../aux-records/SubscriptionConfiguration.ts
106236
107210
  var subscriptionFeaturesSchema = z.object({
@@ -106295,7 +107269,10 @@ var subscriptionFeaturesSchema = z.object({
106295
107269
  ),
106296
107270
  maxTokensPerPeriod: z.number().describe(
106297
107271
  "The maximum number of AI chat tokens allowed per subscription period. If omitted, then there is no limit."
106298
- ).int().positive().optional()
107272
+ ).int().positive().optional(),
107273
+ allowedModels: z.array(z.string()).describe(
107274
+ "The list of model IDs that are allowed for the subscription. If omitted, then all models are allowed."
107275
+ ).optional()
106299
107276
  }),
106300
107277
  images: z.object({
106301
107278
  allowed: z.boolean().describe(
@@ -106425,6 +107402,24 @@ var subscriptionFeaturesSchema = z.object({
106425
107402
  "The configuration for notification features. Defaults to not allowed."
106426
107403
  ).optional().default({
106427
107404
  allowed: false
107405
+ }),
107406
+ documents: z.object({
107407
+ allowed: z.boolean().describe(
107408
+ "Whether document features are allowed for the subscription."
107409
+ ),
107410
+ maxItems: z.number().describe(
107411
+ "The maximum number of document items that are allowed for the subscription. If not specified, then there is no limit."
107412
+ ).int().positive().optional(),
107413
+ maxBytesPerItem: z.number().describe(
107414
+ "The maximum number of bytes that can be stored in a document. If omitted, then there is no limit."
107415
+ ).int().positive().optional(),
107416
+ maxActiveConnectionsPerItem: z.number().describe(
107417
+ "The maximum number of active websocket connections that a document can have. If omitted, then there is no limit."
107418
+ ).int().positive().optional()
107419
+ }).describe(
107420
+ "The configuration for document features. Defaults to not allowed."
107421
+ ).optional().default({
107422
+ allowed: false
106428
107423
  })
106429
107424
  });
106430
107425
  var subscriptionConfigSchema = z.object({
@@ -106941,7 +107936,7 @@ var RecordsController = class {
106941
107936
  `[RecordsController] [action: recordKey.create recordName: ${name}, userId: ${userId}] Creating record key.`
106942
107937
  );
106943
107938
  const passwordBytes = (0, import_tweetnacl5.randomBytes)(16);
106944
- const password = (0, import_base64_js10.fromByteArray)(passwordBytes);
107939
+ const password = (0, import_base64_js12.fromByteArray)(passwordBytes);
106945
107940
  const salt = record.secretSalt;
106946
107941
  const passwordHash = this.hashHighEntropyPasswordWithSalt(
106947
107942
  password,
@@ -107213,9 +108208,9 @@ var RecordsController = class {
107213
108208
  };
107214
108209
  }
107215
108210
  }
107216
- async _doesSubscriptionAllowToCreateRecord(filter3) {
108211
+ async _doesSubscriptionAllowToCreateRecord(filter4) {
107217
108212
  const { features, metrics: metrics3 } = await this._getSubscriptionFeatures(
107218
- filter3
108213
+ filter4
107219
108214
  );
107220
108215
  if (!features.records?.allowed) {
107221
108216
  return {
@@ -107236,9 +108231,9 @@ var RecordsController = class {
107236
108231
  success: true
107237
108232
  };
107238
108233
  }
107239
- async _getSubscriptionFeatures(filter3) {
108234
+ async _getSubscriptionFeatures(filter4) {
107240
108235
  const metrics3 = await this._metrics.getSubscriptionRecordMetrics(
107241
- filter3
108236
+ filter4
107242
108237
  );
107243
108238
  const config2 = await this._config.getSubscriptionConfiguration();
107244
108239
  return {
@@ -107958,7 +108953,7 @@ var RecordsController = class {
107958
108953
  }
107959
108954
  }
107960
108955
  _createSalt() {
107961
- return (0, import_base64_js10.fromByteArray)((0, import_tweetnacl5.randomBytes)(16));
108956
+ return (0, import_base64_js12.fromByteArray)((0, import_tweetnacl5.randomBytes)(16));
107962
108957
  }
107963
108958
  };
107964
108959
  __decorateClass([
@@ -108581,7 +109576,7 @@ function deviceError(info, error, taskId) {
108581
109576
  }
108582
109577
 
108583
109578
  // ../aux-records/websockets/WebsocketController.ts
108584
- var import_base64_js11 = __toESM(require_base64_js());
109579
+ var import_base64_js13 = __toESM(require_base64_js());
108585
109580
 
108586
109581
  // ../aux-common/websockets/WebsocketEvents.js
108587
109582
  var WebsocketEventTypes2;
@@ -108986,7 +109981,10 @@ var WebsocketController = class {
108986
109981
  errorMessage: "You are not authorized to access this inst.",
108987
109982
  recordName: event.recordName,
108988
109983
  inst: event.inst,
108989
- branch: event.branch
109984
+ branch: event.branch,
109985
+ reason: {
109986
+ type: "invalid_token"
109987
+ }
108990
109988
  });
108991
109989
  return;
108992
109990
  }
@@ -109241,7 +110239,10 @@ var WebsocketController = class {
109241
110239
  errorMessage: "You are not authorized to access this inst.",
109242
110240
  recordName: event.recordName,
109243
110241
  inst: event.inst,
109244
- branch: event.branch
110242
+ branch: event.branch,
110243
+ reason: {
110244
+ type: "invalid_token"
110245
+ }
109245
110246
  });
109246
110247
  return;
109247
110248
  }
@@ -109577,7 +110578,13 @@ var WebsocketController = class {
109577
110578
  await this.sendError(connectionId, -1, {
109578
110579
  success: false,
109579
110580
  errorCode: "not_authorized",
109580
- errorMessage: "You are not authorized to access this inst."
110581
+ errorMessage: "You are not authorized to access this inst.",
110582
+ recordName: event.recordName,
110583
+ inst: event.inst,
110584
+ branch: event.branch,
110585
+ reason: {
110586
+ type: "invalid_token"
110587
+ }
109581
110588
  });
109582
110589
  return;
109583
110590
  }
@@ -109677,7 +110684,13 @@ var WebsocketController = class {
109677
110684
  await this.sendError(connectionId, -1, {
109678
110685
  success: false,
109679
110686
  errorCode: "not_authorized",
109680
- errorMessage: "You are not authorized to access this inst."
110687
+ errorMessage: "You are not authorized to access this inst.",
110688
+ recordName,
110689
+ inst,
110690
+ branch,
110691
+ reason: {
110692
+ type: "invalid_token"
110693
+ }
109681
110694
  });
109682
110695
  return;
109683
110696
  }
@@ -109756,7 +110769,13 @@ var WebsocketController = class {
109756
110769
  await this.sendError(connectionId, -1, {
109757
110770
  success: false,
109758
110771
  errorCode: "not_authorized",
109759
- errorMessage: "You are not authorized to access this inst."
110772
+ errorMessage: "You are not authorized to access this inst.",
110773
+ recordName,
110774
+ inst,
110775
+ branch,
110776
+ reason: {
110777
+ type: "invalid_token"
110778
+ }
109760
110779
  });
109761
110780
  return;
109762
110781
  }
@@ -109823,7 +110842,7 @@ var WebsocketController = class {
109823
110842
  if (auxVersion === 1) {
109824
110843
  const partition3 = new YjsPartitionImpl({ type: "yjs" });
109825
110844
  for (let updateBase64 of updates.updates) {
109826
- const update = (0, import_base64_js11.toByteArray)(updateBase64);
110845
+ const update = (0, import_base64_js13.toByteArray)(updateBase64);
109827
110846
  applyUpdate(partition3.doc, update);
109828
110847
  }
109829
110848
  return {
@@ -109958,7 +110977,10 @@ var WebsocketController = class {
109958
110977
  errorMessage: "You are not authorized to access this inst.",
109959
110978
  recordName,
109960
110979
  inst,
109961
- branch
110980
+ branch,
110981
+ reason: {
110982
+ type: "invalid_token"
110983
+ }
109962
110984
  });
109963
110985
  return;
109964
110986
  }
@@ -110705,11 +111727,11 @@ var WebsocketController = class {
110705
111727
  gc: true
110706
111728
  });
110707
111729
  for (let update of updates.updates) {
110708
- const bytes = (0, import_base64_js11.toByteArray)(update);
111730
+ const bytes = (0, import_base64_js13.toByteArray)(update);
110709
111731
  applyUpdate(doc, bytes);
110710
111732
  }
110711
111733
  const mergedBytes = encodeStateAsUpdate(doc);
110712
- const mergedBase64 = (0, import_base64_js11.fromByteArray)(mergedBytes);
111734
+ const mergedBase64 = (0, import_base64_js13.fromByteArray)(mergedBytes);
110713
111735
  const permanentReplaceResult = await store.perm.replaceCurrentUpdates(
110714
111736
  branch.recordName,
110715
111737
  branch.inst,
@@ -115613,7 +116635,7 @@ var RecordsServer = class {
115613
116635
  this._notificationsController = notificationsController;
115614
116636
  this._tracer = trace.getTracer(
115615
116637
  "RecordsServer",
115616
- false ? void 0 : "v3.3.12"
116638
+ false ? void 0 : "v3.3.13"
115617
116639
  );
115618
116640
  this._procedures = this._createProcedures();
115619
116641
  this._setupRoutes();
@@ -117947,8 +118969,8 @@ var RecordsServer = class {
117947
118969
  return {
117948
118970
  success: true,
117949
118971
  ...metadata,
117950
- version: true ? "v3.3.12" : void 0,
117951
- versionHash: true ? "5507724657ea76238f342fdb898380e3f6cc29ad" : void 0
118972
+ version: true ? "v3.3.13" : void 0,
118973
+ versionHash: true ? "dfd33895a860f63dca1a0698a694fe7ca8d0e4c8" : void 0
117952
118974
  };
117953
118975
  })
117954
118976
  };
@@ -121233,10 +122255,10 @@ function returnProcedureOutput(result) {
121233
122255
  }
121234
122256
  }
121235
122257
  function validateOrigin(request2, origins) {
121236
- const origin = request2.headers.origin;
121237
- return origins.has(origin) || // If the origin is not included, then the request is a same-origin request
122258
+ const origin2 = request2.headers.origin;
122259
+ return origins.has(origin2) || // If the origin is not included, then the request is a same-origin request
121238
122260
  // if the method is either GET or HEAD.
121239
- !origin && (request2.method === "GET" || request2.method === "HEAD");
122261
+ !origin2 && (request2.method === "GET" || request2.method === "HEAD");
121240
122262
  }
121241
122263
  function getSessionKey(event) {
121242
122264
  const authorization = event.headers.authorization;
@@ -121250,13 +122272,13 @@ function parseAuthorization(authorization) {
121250
122272
  return null;
121251
122273
  }
121252
122274
  function formatResponse(request2, response, origins) {
121253
- const origin = request2.headers["origin"];
122275
+ const origin2 = request2.headers["origin"];
121254
122276
  let headers = {
121255
122277
  ...response.headers || {}
121256
122278
  };
121257
- if (!!origin && (origins === true || typeof origins === "object" && validateOrigin(request2, origins))) {
122279
+ if (!!origin2 && (origins === true || typeof origins === "object" && validateOrigin(request2, origins))) {
121258
122280
  if (!headers["Access-Control-Allow-Origin"]) {
121259
- headers["Access-Control-Allow-Origin"] = origin;
122281
+ headers["Access-Control-Allow-Origin"] = origin2;
121260
122282
  }
121261
122283
  if (!headers["Access-Control-Allow-Headers"]) {
121262
122284
  headers["Access-Control-Allow-Headers"] = "Content-Type, Authorization";
@@ -122283,7 +123305,7 @@ var VERSION4 = "4.47.1";
122283
123305
  var auto = false;
122284
123306
  var kind = void 0;
122285
123307
  var fetch4 = void 0;
122286
- var Request = void 0;
123308
+ var Request2 = void 0;
122287
123309
  var Response2 = void 0;
122288
123310
  var Headers2 = void 0;
122289
123311
  var FormData3 = void 0;
@@ -122304,7 +123326,7 @@ function setShims(shims, options = { auto: false }) {
122304
123326
  auto = options.auto;
122305
123327
  kind = shims.kind;
122306
123328
  fetch4 = shims.fetch;
122307
- Request = shims.Request;
123329
+ Request2 = shims.Request;
122308
123330
  Response2 = shims.Response;
122309
123331
  Headers2 = shims.Headers;
122310
123332
  FormData3 = shims.FormData;
@@ -128479,7 +129501,7 @@ var VERSION5 = "0.24.3";
128479
129501
  var auto2 = false;
128480
129502
  var kind2 = void 0;
128481
129503
  var fetch5 = void 0;
128482
- var Request3 = void 0;
129504
+ var Request4 = void 0;
128483
129505
  var Response4 = void 0;
128484
129506
  var Headers4 = void 0;
128485
129507
  var FormData5 = void 0;
@@ -128500,7 +129522,7 @@ function setShims2(shims, options = { auto: false }) {
128500
129522
  auto2 = options.auto;
128501
129523
  kind2 = shims.kind;
128502
129524
  fetch5 = shims.fetch;
128503
- Request3 = shims.Request;
129525
+ Request4 = shims.Request;
128504
129526
  Response4 = shims.Response;
128505
129527
  Headers4 = shims.Headers;
128506
129528
  FormData5 = shims.FormData;
@@ -130931,17 +131953,17 @@ var ModerationController = class {
130931
131953
  console.log(
130932
131954
  "[ModerationController] Starting file moderation job..."
130933
131955
  );
130934
- let filter3 = {};
131956
+ let filter4 = {};
130935
131957
  if (config2.jobs.files.fileExtensions) {
130936
- filter3.fileExtensions = config2.jobs.files.fileExtensions.slice();
131958
+ filter4.fileExtensions = config2.jobs.files.fileExtensions.slice();
130937
131959
  }
130938
131960
  const lastFileJob = await this._store.findMostRecentJobOfType(
130939
131961
  "files"
130940
131962
  );
130941
131963
  if (lastFileJob) {
130942
- filter3.uploadedAfterMs = lastFileJob.createdAtMs;
131964
+ filter4.uploadedAfterMs = lastFileJob.createdAtMs;
130943
131965
  }
130944
- const job = await this._jobProvider.startFilesJob(filter3);
131966
+ const job = await this._jobProvider.startFilesJob(filter4);
130945
131967
  await this._store.addModerationJob(job);
130946
131968
  jobs.push(job);
130947
131969
  console.log(
@@ -132726,12 +133748,12 @@ var WEBHOOK_STATE_SCHEMA = z.discriminatedUnion("type", [
132726
133748
  var import_hash6 = __toESM(require_hash());
132727
133749
 
132728
133750
  // ../crypto/utils.ts
132729
- var import_base64_js12 = __toESM(require_base64_js());
133751
+ var import_base64_js14 = __toESM(require_base64_js());
132730
133752
 
132731
133753
  // ../crypto/HashHelpers.ts
132732
133754
  var import_hash5 = __toESM(require_hash());
132733
133755
  var import_tweetnacl6 = __toESM(require_nacl_fast());
132734
- var import_base64_js13 = __toESM(require_base64_js());
133756
+ var import_base64_js15 = __toESM(require_base64_js());
132735
133757
  function getHash(obj) {
132736
133758
  const json = fast_json_stable_stringify_default(obj);
132737
133759
  let sha = (0, import_hash5.sha256)();
@@ -132741,7 +133763,7 @@ function getHash(obj) {
132741
133763
 
132742
133764
  // ../crypto/Signatures.ts
132743
133765
  var import_tweetnacl7 = __toESM(require_nacl_fast());
132744
- var import_base64_js14 = __toESM(require_base64_js());
133766
+ var import_base64_js16 = __toESM(require_base64_js());
132745
133767
 
132746
133768
  // ../aux-records/webhooks/WebhookRecordsController.ts
132747
133769
  var TRACE_NAME21 = "WebhookRecordsController";
@@ -137635,7 +138657,7 @@ async function githubAppJwt({
137635
138657
  };
137636
138658
  }
137637
138659
 
137638
- // ../../node_modules/.pnpm/lru-cache@10.1.0/node_modules/lru-cache/dist/esm/index.js
138660
+ // ../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.js
137639
138661
  var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
137640
138662
  var warned = /* @__PURE__ */ new Set();
137641
138663
  var PROCESS = typeof process === "object" && !!process ? process : {};
@@ -137717,14 +138739,13 @@ var Stack = class _Stack {
137717
138739
  }
137718
138740
  };
137719
138741
  var LRUCache = class _LRUCache {
137720
- // properties coming in from the options of these, only max and maxSize
137721
- // really *need* to be protected. The rest can be modified, as they just
137722
- // set defaults for various methods.
138742
+ // options that cannot be changed without disaster
137723
138743
  #max;
137724
138744
  #maxSize;
137725
138745
  #dispose;
137726
138746
  #disposeAfter;
137727
138747
  #fetchMethod;
138748
+ #memoMethod;
137728
138749
  /**
137729
138750
  * {@link LRUCache.OptionsBase.ttl}
137730
138751
  */
@@ -137870,6 +138891,9 @@ var LRUCache = class _LRUCache {
137870
138891
  get fetchMethod() {
137871
138892
  return this.#fetchMethod;
137872
138893
  }
138894
+ get memoMethod() {
138895
+ return this.#memoMethod;
138896
+ }
137873
138897
  /**
137874
138898
  * {@link LRUCache.OptionsBase.dispose} (read-only)
137875
138899
  */
@@ -137883,7 +138907,7 @@ var LRUCache = class _LRUCache {
137883
138907
  return this.#disposeAfter;
137884
138908
  }
137885
138909
  constructor(options) {
137886
- const { max: max2 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
138910
+ const { max: max2 = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
137887
138911
  if (max2 !== 0 && !isPosInt(max2)) {
137888
138912
  throw new TypeError("max option must be a nonnegative integer");
137889
138913
  }
@@ -137903,6 +138927,10 @@ var LRUCache = class _LRUCache {
137903
138927
  throw new TypeError("sizeCalculation set to non-function");
137904
138928
  }
137905
138929
  }
138930
+ if (memoMethod !== void 0 && typeof memoMethod !== "function") {
138931
+ throw new TypeError("memoMethod must be a function if defined");
138932
+ }
138933
+ this.#memoMethod = memoMethod;
137906
138934
  if (fetchMethod !== void 0 && typeof fetchMethod !== "function") {
137907
138935
  throw new TypeError("fetchMethod must be a function if specified");
137908
138936
  }
@@ -137973,7 +139001,8 @@ var LRUCache = class _LRUCache {
137973
139001
  }
137974
139002
  }
137975
139003
  /**
137976
- * Return the remaining TTL time for a given entry key
139004
+ * Return the number of ms left in the item's TTL. If item is not in cache,
139005
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
137977
139006
  */
137978
139007
  getRemainingTTL(key) {
137979
139008
  return this.#keyMap.has(key) ? Infinity : 0;
@@ -137989,7 +139018,7 @@ var LRUCache = class _LRUCache {
137989
139018
  if (ttl !== 0 && this.ttlAutopurge) {
137990
139019
  const t2 = setTimeout(() => {
137991
139020
  if (this.#isStale(index)) {
137992
- this.delete(this.#keyList[index]);
139021
+ this.#delete(this.#keyList[index], "expire");
137993
139022
  }
137994
139023
  }, ttl + 1);
137995
139024
  if (t2.unref) {
@@ -138225,9 +139254,15 @@ var LRUCache = class _LRUCache {
138225
139254
  [Symbol.iterator]() {
138226
139255
  return this.entries();
138227
139256
  }
139257
+ /**
139258
+ * A String value that is used in the creation of the default string
139259
+ * description of an object. Called by the built-in method
139260
+ * `Object.prototype.toString`.
139261
+ */
139262
+ [Symbol.toStringTag] = "LRUCache";
138228
139263
  /**
138229
139264
  * Find a value for which the supplied fn method returns a truthy value,
138230
- * similar to Array.find(). fn is called as fn(value, key, cache).
139265
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
138231
139266
  */
138232
139267
  find(fn, getOptions = {}) {
138233
139268
  for (const i2 of this.#indexes()) {
@@ -138241,10 +139276,15 @@ var LRUCache = class _LRUCache {
138241
139276
  }
138242
139277
  }
138243
139278
  /**
138244
- * Call the supplied function on each item in the cache, in order from
138245
- * most recently used to least recently used. fn is called as
138246
- * fn(value, key, cache). Does not update age or recenty of use.
138247
- * Does not iterate over stale values.
139279
+ * Call the supplied function on each item in the cache, in order from most
139280
+ * recently used to least recently used.
139281
+ *
139282
+ * `fn` is called as `fn(value, key, cache)`.
139283
+ *
139284
+ * If `thisp` is provided, function will be called in the `this`-context of
139285
+ * the provided object, or the cache if no `thisp` object is provided.
139286
+ *
139287
+ * Does not update age or recenty of use, or iterate over stale values.
138248
139288
  */
138249
139289
  forEach(fn, thisp = this) {
138250
139290
  for (const i2 of this.#indexes()) {
@@ -138276,7 +139316,7 @@ var LRUCache = class _LRUCache {
138276
139316
  let deleted = false;
138277
139317
  for (const i2 of this.#rindexes({ allowStale: true })) {
138278
139318
  if (this.#isStale(i2)) {
138279
- this.delete(this.#keyList[i2]);
139319
+ this.#delete(this.#keyList[i2], "expire");
138280
139320
  deleted = true;
138281
139321
  }
138282
139322
  }
@@ -138284,9 +139324,15 @@ var LRUCache = class _LRUCache {
138284
139324
  }
138285
139325
  /**
138286
139326
  * Get the extended info about a given entry, to get its value, size, and
138287
- * TTL info simultaneously. Like {@link LRUCache#dump}, but just for a
138288
- * single key. Always returns stale values, if their info is found in the
138289
- * cache, so be sure to check for expired TTLs if relevant.
139327
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
139328
+ *
139329
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
139330
+ * serialization, the `start` value is always the current timestamp, and the
139331
+ * `ttl` is a calculated remaining time to live (negative if expired).
139332
+ *
139333
+ * Always returns stale values, if their info is found in the cache, so be
139334
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
139335
+ * if relevant.
138290
139336
  */
138291
139337
  info(key) {
138292
139338
  const i2 = this.#keyMap.get(key);
@@ -138313,7 +139359,16 @@ var LRUCache = class _LRUCache {
138313
139359
  }
138314
139360
  /**
138315
139361
  * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
138316
- * passed to cache.load()
139362
+ * passed to {@link LRLUCache#load}.
139363
+ *
139364
+ * The `start` fields are calculated relative to a portable `Date.now()`
139365
+ * timestamp, even if `performance.now()` is available.
139366
+ *
139367
+ * Stale entries are always included in the `dump`, even if
139368
+ * {@link LRUCache.OptionsBase.allowStale} is false.
139369
+ *
139370
+ * Note: this returns an actual array, not a generator, so it can be more
139371
+ * easily passed around.
138317
139372
  */
138318
139373
  dump() {
138319
139374
  const arr = [];
@@ -138338,8 +139393,12 @@ var LRUCache = class _LRUCache {
138338
139393
  }
138339
139394
  /**
138340
139395
  * Reset the cache and load in the items in entries in the order listed.
138341
- * Note that the shape of the resulting cache may be different if the
138342
- * same options are not used in both caches.
139396
+ *
139397
+ * The shape of the resulting cache may be different if the same options are
139398
+ * not used in both caches.
139399
+ *
139400
+ * The `start` fields are assumed to be calculated relative to a portable
139401
+ * `Date.now()` timestamp, even if `performance.now()` is available.
138343
139402
  */
138344
139403
  load(arr) {
138345
139404
  this.clear();
@@ -138356,6 +139415,30 @@ var LRUCache = class _LRUCache {
138356
139415
  *
138357
139416
  * Note: if `undefined` is specified as a value, this is an alias for
138358
139417
  * {@link LRUCache#delete}
139418
+ *
139419
+ * Fields on the {@link LRUCache.SetOptions} options param will override
139420
+ * their corresponding values in the constructor options for the scope
139421
+ * of this single `set()` operation.
139422
+ *
139423
+ * If `start` is provided, then that will set the effective start
139424
+ * time for the TTL calculation. Note that this must be a previous
139425
+ * value of `performance.now()` if supported, or a previous value of
139426
+ * `Date.now()` if not.
139427
+ *
139428
+ * Options object may also include `size`, which will prevent
139429
+ * calling the `sizeCalculation` function and just use the specified
139430
+ * number if it is a positive integer, and `noDisposeOnSet` which
139431
+ * will prevent calling a `dispose` function in the case of
139432
+ * overwrites.
139433
+ *
139434
+ * If the `size` (or return value of `sizeCalculation`) for a given
139435
+ * entry is greater than `maxEntrySize`, then the item will not be
139436
+ * added to the cache.
139437
+ *
139438
+ * Will update the recency of the entry.
139439
+ *
139440
+ * If the value is `undefined`, then this is an alias for
139441
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
138359
139442
  */
138360
139443
  set(k2, v2, setOptions = {}) {
138361
139444
  if (v2 === void 0) {
@@ -138370,7 +139453,7 @@ var LRUCache = class _LRUCache {
138370
139453
  status.set = "miss";
138371
139454
  status.maxEntrySizeExceeded = true;
138372
139455
  }
138373
- this.delete(k2);
139456
+ this.#delete(k2, "set");
138374
139457
  return this;
138375
139458
  }
138376
139459
  let index = this.#size === 0 ? void 0 : this.#keyMap.get(k2);
@@ -138504,6 +139587,14 @@ var LRUCache = class _LRUCache {
138504
139587
  * Will return false if the item is stale, even though it is technically
138505
139588
  * in the cache.
138506
139589
  *
139590
+ * Check if a key is in the cache, without updating the recency of
139591
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
139592
+ * to `true` in either the options or the constructor.
139593
+ *
139594
+ * Will return `false` if the item is stale, even though it is technically in
139595
+ * the cache. The difference can be determined (if it matters) by using a
139596
+ * `status` argument, and inspecting the `has` field.
139597
+ *
138507
139598
  * Will not update item age unless
138508
139599
  * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
138509
139600
  */
@@ -138586,7 +139677,7 @@ var LRUCache = class _LRUCache {
138586
139677
  if (bf2.__staleWhileFetching) {
138587
139678
  this.#valList[index] = bf2.__staleWhileFetching;
138588
139679
  } else {
138589
- this.delete(k2);
139680
+ this.#delete(k2, "fetch");
138590
139681
  }
138591
139682
  } else {
138592
139683
  if (options.status)
@@ -138612,7 +139703,7 @@ var LRUCache = class _LRUCache {
138612
139703
  if (this.#valList[index] === p2) {
138613
139704
  const del3 = !noDelete || bf2.__staleWhileFetching === void 0;
138614
139705
  if (del3) {
138615
- this.delete(k2);
139706
+ this.#delete(k2, "fetch");
138616
139707
  } else if (!allowStaleAborted) {
138617
139708
  this.#valList[index] = bf2.__staleWhileFetching;
138618
139709
  }
@@ -138750,6 +139841,28 @@ var LRUCache = class _LRUCache {
138750
139841
  return staleVal ? p2.__staleWhileFetching : p2.__returned = p2;
138751
139842
  }
138752
139843
  }
139844
+ async forceFetch(k2, fetchOptions = {}) {
139845
+ const v2 = await this.fetch(k2, fetchOptions);
139846
+ if (v2 === void 0)
139847
+ throw new Error("fetch() returned undefined");
139848
+ return v2;
139849
+ }
139850
+ memo(k2, memoOptions = {}) {
139851
+ const memoMethod = this.#memoMethod;
139852
+ if (!memoMethod) {
139853
+ throw new Error("no memoMethod provided to constructor");
139854
+ }
139855
+ const { context, forceRefresh, ...options } = memoOptions;
139856
+ const v2 = this.get(k2, options);
139857
+ if (!forceRefresh && v2 !== void 0)
139858
+ return v2;
139859
+ const vv = memoMethod(k2, v2, {
139860
+ options,
139861
+ context
139862
+ });
139863
+ this.set(k2, vv, options);
139864
+ return vv;
139865
+ }
138753
139866
  /**
138754
139867
  * Return a value from the cache. Will update the recency of the cache
138755
139868
  * entry found.
@@ -138769,7 +139882,7 @@ var LRUCache = class _LRUCache {
138769
139882
  status.get = "stale";
138770
139883
  if (!fetching) {
138771
139884
  if (!noDeleteOnStaleGet) {
138772
- this.delete(k2);
139885
+ this.#delete(k2, "expire");
138773
139886
  }
138774
139887
  if (status && allowStale)
138775
139888
  status.returnedStale = true;
@@ -138813,16 +139926,20 @@ var LRUCache = class _LRUCache {
138813
139926
  }
138814
139927
  /**
138815
139928
  * Deletes a key out of the cache.
139929
+ *
138816
139930
  * Returns true if the key was deleted, false otherwise.
138817
139931
  */
138818
139932
  delete(k2) {
139933
+ return this.#delete(k2, "delete");
139934
+ }
139935
+ #delete(k2, reason) {
138819
139936
  let deleted = false;
138820
139937
  if (this.#size !== 0) {
138821
139938
  const index = this.#keyMap.get(k2);
138822
139939
  if (index !== void 0) {
138823
139940
  deleted = true;
138824
139941
  if (this.#size === 1) {
138825
- this.clear();
139942
+ this.#clear(reason);
138826
139943
  } else {
138827
139944
  this.#removeItemSize(index);
138828
139945
  const v2 = this.#valList[index];
@@ -138830,10 +139947,10 @@ var LRUCache = class _LRUCache {
138830
139947
  v2.__abortController.abort(new Error("deleted"));
138831
139948
  } else if (this.#hasDispose || this.#hasDisposeAfter) {
138832
139949
  if (this.#hasDispose) {
138833
- this.#dispose?.(v2, k2, "delete");
139950
+ this.#dispose?.(v2, k2, reason);
138834
139951
  }
138835
139952
  if (this.#hasDisposeAfter) {
138836
- this.#disposed?.push([v2, k2, "delete"]);
139953
+ this.#disposed?.push([v2, k2, reason]);
138837
139954
  }
138838
139955
  }
138839
139956
  this.#keyMap.delete(k2);
@@ -138867,6 +139984,9 @@ var LRUCache = class _LRUCache {
138867
139984
  * Clear the cache entirely, throwing away all values.
138868
139985
  */
138869
139986
  clear() {
139987
+ return this.#clear("delete");
139988
+ }
139989
+ #clear(reason) {
138870
139990
  for (const index of this.#rindexes({ allowStale: true })) {
138871
139991
  const v2 = this.#valList[index];
138872
139992
  if (this.#isBackgroundFetch(v2)) {
@@ -138874,10 +139994,10 @@ var LRUCache = class _LRUCache {
138874
139994
  } else {
138875
139995
  const k2 = this.#keyList[index];
138876
139996
  if (this.#hasDispose) {
138877
- this.#dispose?.(v2, k2, "delete");
139997
+ this.#dispose?.(v2, k2, reason);
138878
139998
  }
138879
139999
  if (this.#hasDisposeAfter) {
138880
- this.#disposed?.push([v2, k2, "delete"]);
140000
+ this.#disposed?.push([v2, k2, reason]);
138881
140001
  }
138882
140002
  }
138883
140003
  }
@@ -140848,8 +141968,8 @@ var init_util = __esm2({
140848
141968
  objectToString2 = Object.prototype.toString.call.bind(Object.prototype.toString);
140849
141969
  }
140850
141970
  });
140851
- function filterType(input2, filter3, def) {
140852
- if (filter3(input2)) {
141971
+ function filterType(input2, filter4, def) {
141972
+ if (filter4(input2)) {
140853
141973
  return input2;
140854
141974
  }
140855
141975
  return arguments.length > 2 ? def : void 0;
@@ -141320,7 +142440,7 @@ function cleanTask(mode, customArgs) {
141320
142440
  };
141321
142441
  }
141322
142442
  function isCleanOptionsArray(input2) {
141323
- return Array.isArray(input2) && input2.every((test) => CleanOptionValues.has(test));
142443
+ return Array.isArray(input2) && input2.every((test2) => CleanOptionValues.has(test2));
141324
142444
  }
141325
142445
  function getCleanOptions(input2) {
141326
142446
  let cleanMode;
@@ -145387,7 +146507,7 @@ var config = new Conf({
145387
146507
  projectName: "casualos-cli"
145388
146508
  });
145389
146509
  var program2 = new Command();
145390
- program2.name("casualos").description("A CLI for CasualOS").version("v3.3.12").option(
146510
+ program2.name("casualos").description("A CLI for CasualOS").version("v3.3.13").option(
145391
146511
  "-e, --endpoint <url>",
145392
146512
  "The endpoint to use for queries. Can be used to override the current endpoint."
145393
146513
  );
@@ -145412,12 +146532,12 @@ program2.command("set-endpoint").argument(
145412
146532
  } else {
145413
146533
  endpoint2 = await updateEndpoint();
145414
146534
  }
145415
- const origin = getOrigin(endpoint2);
145416
- if (origin !== endpoint2) {
146535
+ const origin2 = getOrigin(endpoint2);
146536
+ if (origin2 !== endpoint2) {
145417
146537
  const response = await (0, import_prompts3.default)({
145418
146538
  type: "confirm",
145419
146539
  name: "confirm",
145420
- message: `The origin for the endpoint (${origin}) is different from the endpoint (${endpoint2}) itself. Do you want to keep it?`,
146540
+ message: `The origin for the endpoint (${origin2}) is different from the endpoint (${endpoint2}) itself. Do you want to keep it?`,
145421
146541
  initial: true,
145422
146542
  onState
145423
146543
  });
@@ -145870,13 +146990,13 @@ function saveCurrentEndpoint(endpoint2) {
145870
146990
  config.set("currentEndpoint", endpoint2);
145871
146991
  console.log("Endpoint updated to:", endpoint2);
145872
146992
  }
145873
- function saveOrigin(endpoint2, origin) {
145874
- config.set(`${endpoint2}:origin`, origin);
146993
+ function saveOrigin(endpoint2, origin2) {
146994
+ config.set(`${endpoint2}:origin`, origin2);
145875
146995
  }
145876
146996
  function getOrigin(endpoint2) {
145877
- let origin = config.get(`${endpoint2}:origin`);
145878
- if (typeof origin === "string" && origin) {
145879
- return origin;
146997
+ let origin2 = config.get(`${endpoint2}:origin`);
146998
+ if (typeof origin2 === "string" && origin2) {
146999
+ return origin2;
145880
147000
  }
145881
147001
  return endpoint2;
145882
147002
  }