@uniformdev/next-app-router 20.70.0 → 20.70.1-alpha.10

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.
package/dist/handler.js CHANGED
@@ -5,6 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __typeError = (msg) => {
9
+ throw TypeError(msg);
10
+ };
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
12
  var __commonJS = (cb, mod) => function __require() {
9
13
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
14
  };
@@ -29,12 +33,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
33
  mod
30
34
  ));
31
35
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
37
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
38
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
39
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
40
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
41
+ var __privateWrapper = (obj, member, setter, getter) => ({
42
+ set _(value) {
43
+ __privateSet(obj, member, value, setter);
44
+ },
45
+ get _() {
46
+ return __privateGet(obj, member, getter);
47
+ }
48
+ });
32
49
 
33
50
  // ../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js
34
51
  var require_yocto_queue = __commonJS({
35
52
  "../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
36
53
  "use strict";
37
- var Node = class {
54
+ var Node2 = class {
38
55
  /// value;
39
56
  /// next;
40
57
  constructor(value) {
@@ -42,7 +59,7 @@ var require_yocto_queue = __commonJS({
42
59
  this.next = void 0;
43
60
  }
44
61
  };
45
- var Queue = class {
62
+ var Queue2 = class {
46
63
  // TODO: Use private class fields when targeting Node.js 12.
47
64
  // #_head;
48
65
  // #_tail;
@@ -51,7 +68,7 @@ var require_yocto_queue = __commonJS({
51
68
  this.clear();
52
69
  }
53
70
  enqueue(value) {
54
- const node = new Node(value);
71
+ const node = new Node2(value);
55
72
  if (this._head) {
56
73
  this._tail.next = node;
57
74
  this._tail = node;
@@ -86,7 +103,7 @@ var require_yocto_queue = __commonJS({
86
103
  }
87
104
  }
88
105
  };
89
- module2.exports = Queue;
106
+ module2.exports = Queue2;
90
107
  }
91
108
  });
92
109
 
@@ -94,12 +111,12 @@ var require_yocto_queue = __commonJS({
94
111
  var require_p_limit = __commonJS({
95
112
  "../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
96
113
  "use strict";
97
- var Queue = require_yocto_queue();
98
- var pLimit2 = (concurrency) => {
114
+ var Queue2 = require_yocto_queue();
115
+ var pLimit3 = (concurrency) => {
99
116
  if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
100
117
  throw new TypeError("Expected `concurrency` to be a number from 1 and up");
101
118
  }
102
- const queue = new Queue();
119
+ const queue = new Queue2();
103
120
  let activeCount = 0;
104
121
  const next = () => {
105
122
  activeCount--;
@@ -144,7 +161,238 @@ var require_p_limit = __commonJS({
144
161
  });
145
162
  return generator;
146
163
  };
147
- module2.exports = pLimit2;
164
+ module2.exports = pLimit3;
165
+ }
166
+ });
167
+
168
+ // ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js
169
+ var require_retry_operation = __commonJS({
170
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
171
+ "use strict";
172
+ function RetryOperation(timeouts, options) {
173
+ if (typeof options === "boolean") {
174
+ options = { forever: options };
175
+ }
176
+ this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
177
+ this._timeouts = timeouts;
178
+ this._options = options || {};
179
+ this._maxRetryTime = options && options.maxRetryTime || Infinity;
180
+ this._fn = null;
181
+ this._errors = [];
182
+ this._attempts = 1;
183
+ this._operationTimeout = null;
184
+ this._operationTimeoutCb = null;
185
+ this._timeout = null;
186
+ this._operationStart = null;
187
+ this._timer = null;
188
+ if (this._options.forever) {
189
+ this._cachedTimeouts = this._timeouts.slice(0);
190
+ }
191
+ }
192
+ module2.exports = RetryOperation;
193
+ RetryOperation.prototype.reset = function() {
194
+ this._attempts = 1;
195
+ this._timeouts = this._originalTimeouts.slice(0);
196
+ };
197
+ RetryOperation.prototype.stop = function() {
198
+ if (this._timeout) {
199
+ clearTimeout(this._timeout);
200
+ }
201
+ if (this._timer) {
202
+ clearTimeout(this._timer);
203
+ }
204
+ this._timeouts = [];
205
+ this._cachedTimeouts = null;
206
+ };
207
+ RetryOperation.prototype.retry = function(err) {
208
+ if (this._timeout) {
209
+ clearTimeout(this._timeout);
210
+ }
211
+ if (!err) {
212
+ return false;
213
+ }
214
+ var currentTime = (/* @__PURE__ */ new Date()).getTime();
215
+ if (err && currentTime - this._operationStart >= this._maxRetryTime) {
216
+ this._errors.push(err);
217
+ this._errors.unshift(new Error("RetryOperation timeout occurred"));
218
+ return false;
219
+ }
220
+ this._errors.push(err);
221
+ var timeout = this._timeouts.shift();
222
+ if (timeout === void 0) {
223
+ if (this._cachedTimeouts) {
224
+ this._errors.splice(0, this._errors.length - 1);
225
+ timeout = this._cachedTimeouts.slice(-1);
226
+ } else {
227
+ return false;
228
+ }
229
+ }
230
+ var self = this;
231
+ this._timer = setTimeout(function() {
232
+ self._attempts++;
233
+ if (self._operationTimeoutCb) {
234
+ self._timeout = setTimeout(function() {
235
+ self._operationTimeoutCb(self._attempts);
236
+ }, self._operationTimeout);
237
+ if (self._options.unref) {
238
+ self._timeout.unref();
239
+ }
240
+ }
241
+ self._fn(self._attempts);
242
+ }, timeout);
243
+ if (this._options.unref) {
244
+ this._timer.unref();
245
+ }
246
+ return true;
247
+ };
248
+ RetryOperation.prototype.attempt = function(fn, timeoutOps) {
249
+ this._fn = fn;
250
+ if (timeoutOps) {
251
+ if (timeoutOps.timeout) {
252
+ this._operationTimeout = timeoutOps.timeout;
253
+ }
254
+ if (timeoutOps.cb) {
255
+ this._operationTimeoutCb = timeoutOps.cb;
256
+ }
257
+ }
258
+ var self = this;
259
+ if (this._operationTimeoutCb) {
260
+ this._timeout = setTimeout(function() {
261
+ self._operationTimeoutCb();
262
+ }, self._operationTimeout);
263
+ }
264
+ this._operationStart = (/* @__PURE__ */ new Date()).getTime();
265
+ this._fn(this._attempts);
266
+ };
267
+ RetryOperation.prototype.try = function(fn) {
268
+ console.log("Using RetryOperation.try() is deprecated");
269
+ this.attempt(fn);
270
+ };
271
+ RetryOperation.prototype.start = function(fn) {
272
+ console.log("Using RetryOperation.start() is deprecated");
273
+ this.attempt(fn);
274
+ };
275
+ RetryOperation.prototype.start = RetryOperation.prototype.try;
276
+ RetryOperation.prototype.errors = function() {
277
+ return this._errors;
278
+ };
279
+ RetryOperation.prototype.attempts = function() {
280
+ return this._attempts;
281
+ };
282
+ RetryOperation.prototype.mainError = function() {
283
+ if (this._errors.length === 0) {
284
+ return null;
285
+ }
286
+ var counts = {};
287
+ var mainError = null;
288
+ var mainErrorCount = 0;
289
+ for (var i = 0; i < this._errors.length; i++) {
290
+ var error = this._errors[i];
291
+ var message = error.message;
292
+ var count = (counts[message] || 0) + 1;
293
+ counts[message] = count;
294
+ if (count >= mainErrorCount) {
295
+ mainError = error;
296
+ mainErrorCount = count;
297
+ }
298
+ }
299
+ return mainError;
300
+ };
301
+ }
302
+ });
303
+
304
+ // ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js
305
+ var require_retry = __commonJS({
306
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports2) {
307
+ "use strict";
308
+ var RetryOperation = require_retry_operation();
309
+ exports2.operation = function(options) {
310
+ var timeouts = exports2.timeouts(options);
311
+ return new RetryOperation(timeouts, {
312
+ forever: options && (options.forever || options.retries === Infinity),
313
+ unref: options && options.unref,
314
+ maxRetryTime: options && options.maxRetryTime
315
+ });
316
+ };
317
+ exports2.timeouts = function(options) {
318
+ if (options instanceof Array) {
319
+ return [].concat(options);
320
+ }
321
+ var opts = {
322
+ retries: 10,
323
+ factor: 2,
324
+ minTimeout: 1 * 1e3,
325
+ maxTimeout: Infinity,
326
+ randomize: false
327
+ };
328
+ for (var key in options) {
329
+ opts[key] = options[key];
330
+ }
331
+ if (opts.minTimeout > opts.maxTimeout) {
332
+ throw new Error("minTimeout is greater than maxTimeout");
333
+ }
334
+ var timeouts = [];
335
+ for (var i = 0; i < opts.retries; i++) {
336
+ timeouts.push(this.createTimeout(i, opts));
337
+ }
338
+ if (options && options.forever && !timeouts.length) {
339
+ timeouts.push(this.createTimeout(i, opts));
340
+ }
341
+ timeouts.sort(function(a, b) {
342
+ return a - b;
343
+ });
344
+ return timeouts;
345
+ };
346
+ exports2.createTimeout = function(attempt, opts) {
347
+ var random = opts.randomize ? Math.random() + 1 : 1;
348
+ var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
349
+ timeout = Math.min(timeout, opts.maxTimeout);
350
+ return timeout;
351
+ };
352
+ exports2.wrap = function(obj, options, methods) {
353
+ if (options instanceof Array) {
354
+ methods = options;
355
+ options = null;
356
+ }
357
+ if (!methods) {
358
+ methods = [];
359
+ for (var key in obj) {
360
+ if (typeof obj[key] === "function") {
361
+ methods.push(key);
362
+ }
363
+ }
364
+ }
365
+ for (var i = 0; i < methods.length; i++) {
366
+ var method = methods[i];
367
+ var original = obj[method];
368
+ obj[method] = function retryWrapper(original2) {
369
+ var op = exports2.operation(options);
370
+ var args = Array.prototype.slice.call(arguments, 1);
371
+ var callback = args.pop();
372
+ args.push(function(err) {
373
+ if (op.retry(err)) {
374
+ return;
375
+ }
376
+ if (err) {
377
+ arguments[0] = op.mainError();
378
+ }
379
+ callback.apply(this, arguments);
380
+ });
381
+ op.attempt(function() {
382
+ original2.apply(obj, args);
383
+ });
384
+ }.bind(obj, original);
385
+ obj[method].options = options;
386
+ }
387
+ };
388
+ }
389
+ });
390
+
391
+ // ../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js
392
+ var require_retry2 = __commonJS({
393
+ "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports2, module2) {
394
+ "use strict";
395
+ module2.exports = require_retry();
148
396
  }
149
397
  });
150
398
 
@@ -160,14 +408,14 @@ module.exports = __toCommonJS(handler_exports);
160
408
  // ../context/dist/api/api.mjs
161
409
  var import_p_limit = __toESM(require_p_limit(), 1);
162
410
  var __defProp2 = Object.defineProperty;
163
- var __typeError = (msg) => {
411
+ var __typeError2 = (msg) => {
164
412
  throw TypeError(msg);
165
413
  };
166
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
167
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
168
- var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
169
- var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
170
- var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
414
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
415
+ var __publicField2 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
416
+ var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
417
+ var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
418
+ var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
171
419
  var defaultLimitPolicy = (0, import_p_limit.default)(6);
172
420
  var ApiClientError = class _ApiClientError extends Error {
173
421
  constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
@@ -175,18 +423,18 @@ var ApiClientError = class _ApiClientError extends Error {
175
423
  `${errorMessage}
176
424
  ${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
177
425
  );
178
- this.errorMessage = errorMessage;
179
- this.fetchMethod = fetchMethod;
180
- this.fetchUri = fetchUri;
181
- this.statusCode = statusCode;
182
- this.statusText = statusText;
183
- this.requestId = requestId;
426
+ __publicField2(this, "errorMessage", errorMessage);
427
+ __publicField2(this, "fetchMethod", fetchMethod);
428
+ __publicField2(this, "fetchUri", fetchUri);
429
+ __publicField2(this, "statusCode", statusCode);
430
+ __publicField2(this, "statusText", statusText);
431
+ __publicField2(this, "requestId", requestId);
184
432
  Object.setPrototypeOf(this, _ApiClientError.prototype);
185
433
  }
186
434
  };
187
435
  var ApiClient = class _ApiClient {
188
436
  constructor(options) {
189
- __publicField(this, "options");
437
+ __publicField2(this, "options");
190
438
  var _a, _b, _c, _d, _e;
191
439
  if (!options.apiKey && !options.bearerToken) {
192
440
  throw new Error("You must provide an API key or a bearer token");
@@ -356,12 +604,12 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
356
604
  /** Fetches all aggregates for a project */
357
605
  async get(options) {
358
606
  const { projectId } = this.options;
359
- const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url), { ...options, projectId });
607
+ const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url), { ...options, projectId });
360
608
  return await this.apiClient(fetchUri);
361
609
  }
362
610
  /** Updates or creates (based on id) an Aggregate */
363
611
  async upsert(body) {
364
- const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
612
+ const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
365
613
  await this.apiClient(fetchUri, {
366
614
  method: "PUT",
367
615
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -370,7 +618,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
370
618
  }
371
619
  /** Deletes an Aggregate */
372
620
  async remove(body) {
373
- const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
621
+ const fetchUri = this.createUrl(__privateGet2(_AggregateClient2, _url));
374
622
  await this.apiClient(fetchUri, {
375
623
  method: "DELETE",
376
624
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -379,7 +627,7 @@ var _AggregateClient = class _AggregateClient2 extends ApiClient {
379
627
  }
380
628
  };
381
629
  _url = /* @__PURE__ */ new WeakMap();
382
- __privateAdd(_AggregateClient, _url, "/api/v2/aggregate");
630
+ __privateAdd2(_AggregateClient, _url, "/api/v2/aggregate");
383
631
  var _url2;
384
632
  var _DimensionClient = class _DimensionClient2 extends ApiClient {
385
633
  constructor(options) {
@@ -388,12 +636,12 @@ var _DimensionClient = class _DimensionClient2 extends ApiClient {
388
636
  /** Fetches the known score dimensions for a project */
389
637
  async get(options) {
390
638
  const { projectId } = this.options;
391
- const fetchUri = this.createUrl(__privateGet(_DimensionClient2, _url2), { ...options, projectId });
639
+ const fetchUri = this.createUrl(__privateGet2(_DimensionClient2, _url2), { ...options, projectId });
392
640
  return await this.apiClient(fetchUri);
393
641
  }
394
642
  };
395
643
  _url2 = /* @__PURE__ */ new WeakMap();
396
- __privateAdd(_DimensionClient, _url2, "/api/v2/dimension");
644
+ __privateAdd2(_DimensionClient, _url2, "/api/v2/dimension");
397
645
  var _url3;
398
646
  var _valueUrl;
399
647
  var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
@@ -403,12 +651,12 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
403
651
  /** Fetches all enrichments and values for a project, grouped by category */
404
652
  async get(options) {
405
653
  const { projectId } = this.options;
406
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3), { ...options, projectId });
654
+ const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3), { ...options, projectId });
407
655
  return await this.apiClient(fetchUri);
408
656
  }
409
657
  /** Updates or creates (based on id) an enrichment category */
410
658
  async upsertCategory(body) {
411
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
659
+ const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
412
660
  await this.apiClient(fetchUri, {
413
661
  method: "PUT",
414
662
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -417,7 +665,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
417
665
  }
418
666
  /** Deletes an enrichment category */
419
667
  async removeCategory(body) {
420
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
668
+ const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _url3));
421
669
  await this.apiClient(fetchUri, {
422
670
  method: "DELETE",
423
671
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -426,7 +674,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
426
674
  }
427
675
  /** Updates or creates (based on id) an enrichment value within an enrichment category */
428
676
  async upsertValue(body) {
429
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
677
+ const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
430
678
  await this.apiClient(fetchUri, {
431
679
  method: "PUT",
432
680
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -435,7 +683,7 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
435
683
  }
436
684
  /** Deletes an enrichment value within an enrichment category. The category is left alone. */
437
685
  async removeValue(body) {
438
- const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
686
+ const fetchUri = this.createUrl(__privateGet2(_EnrichmentClient2, _valueUrl));
439
687
  await this.apiClient(fetchUri, {
440
688
  method: "DELETE",
441
689
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -445,8 +693,8 @@ var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
445
693
  };
446
694
  _url3 = /* @__PURE__ */ new WeakMap();
447
695
  _valueUrl = /* @__PURE__ */ new WeakMap();
448
- __privateAdd(_EnrichmentClient, _url3, "/api/v1/enrichments");
449
- __privateAdd(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
696
+ __privateAdd2(_EnrichmentClient, _url3, "/api/v1/enrichments");
697
+ __privateAdd2(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
450
698
  var _url4;
451
699
  var _ManifestClient = class _ManifestClient2 extends ApiClient {
452
700
  constructor(options) {
@@ -455,7 +703,7 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
455
703
  /** Fetches the Context manifest for a project */
456
704
  async get(options) {
457
705
  const { projectId } = this.options;
458
- const fetchUri = this.createUrl(__privateGet(_ManifestClient2, _url4), { ...options, projectId });
706
+ const fetchUri = this.createUrl(__privateGet2(_ManifestClient2, _url4), { ...options, projectId });
459
707
  return await this.apiClient(fetchUri);
460
708
  }
461
709
  /** Publishes the Context manifest for a project */
@@ -469,489 +717,290 @@ var _ManifestClient = class _ManifestClient2 extends ApiClient {
469
717
  }
470
718
  };
471
719
  _url4 = /* @__PURE__ */ new WeakMap();
472
- __privateAdd(_ManifestClient, _url4, "/api/v2/manifest");
720
+ __privateAdd2(_ManifestClient, _url4, "/api/v2/manifest");
473
721
  var _url5;
474
722
  var _QuirkClient = class _QuirkClient2 extends ApiClient {
475
723
  constructor(options) {
476
724
  super(options);
477
725
  }
478
- /** Fetches all Quirks for a project */
479
- async get(options) {
480
- const { projectId } = this.options;
481
- const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5), { ...options, projectId });
482
- return await this.apiClient(fetchUri);
483
- }
484
- /** Updates or creates (based on id) a Quirk */
485
- async upsert(body) {
486
- const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
487
- await this.apiClient(fetchUri, {
488
- method: "PUT",
489
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
490
- expectNoContent: true
491
- });
492
- }
493
- /** Deletes a Quirk */
494
- async remove(body) {
495
- const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
496
- await this.apiClient(fetchUri, {
497
- method: "DELETE",
498
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
499
- expectNoContent: true
500
- });
501
- }
502
- };
503
- _url5 = /* @__PURE__ */ new WeakMap();
504
- __privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
505
- var _url6;
506
- var _SignalClient = class _SignalClient2 extends ApiClient {
507
- constructor(options) {
508
- super(options);
509
- }
510
- /** Fetches all Signals for a project */
511
- async get(options) {
512
- const { projectId } = this.options;
513
- const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6), { ...options, projectId });
514
- return await this.apiClient(fetchUri);
515
- }
516
- /** Updates or creates (based on id) a Signal */
517
- async upsert(body) {
518
- const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
519
- await this.apiClient(fetchUri, {
520
- method: "PUT",
521
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
522
- expectNoContent: true
523
- });
524
- }
525
- /** Deletes a Signal */
526
- async remove(body) {
527
- const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
528
- await this.apiClient(fetchUri, {
529
- method: "DELETE",
530
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
531
- expectNoContent: true
532
- });
533
- }
534
- };
535
- _url6 = /* @__PURE__ */ new WeakMap();
536
- __privateAdd(_SignalClient, _url6, "/api/v2/signal");
537
- var _url7;
538
- var _TestClient = class _TestClient2 extends ApiClient {
539
- constructor(options) {
540
- super(options);
541
- }
542
- /** Fetches all Tests for a project */
543
- async get(options) {
544
- const { projectId } = this.options;
545
- const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
546
- return await this.apiClient(fetchUri);
547
- }
548
- /** Updates or creates (based on id) a Test */
549
- async upsert(body) {
550
- const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
551
- await this.apiClient(fetchUri, {
552
- method: "PUT",
553
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
554
- expectNoContent: true
555
- });
556
- }
557
- /** Deletes a Test */
558
- async remove(body) {
559
- const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
560
- await this.apiClient(fetchUri, {
561
- method: "DELETE",
562
- body: JSON.stringify({ ...body, projectId: this.options.projectId }),
563
- expectNoContent: true
564
- });
565
- }
566
- };
567
- _url7 = /* @__PURE__ */ new WeakMap();
568
- __privateAdd(_TestClient, _url7, "/api/v2/test");
569
-
570
- // ../canvas/dist/index.mjs
571
- var __create2 = Object.create;
572
- var __defProp3 = Object.defineProperty;
573
- var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
574
- var __getOwnPropNames2 = Object.getOwnPropertyNames;
575
- var __getProtoOf2 = Object.getPrototypeOf;
576
- var __hasOwnProp2 = Object.prototype.hasOwnProperty;
577
- var __typeError2 = (msg) => {
578
- throw TypeError(msg);
579
- };
580
- var __commonJS2 = (cb, mod) => function __require() {
581
- return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
582
- };
583
- var __copyProps2 = (to, from, except, desc) => {
584
- if (from && typeof from === "object" || typeof from === "function") {
585
- for (let key of __getOwnPropNames2(from))
586
- if (!__hasOwnProp2.call(to, key) && key !== except)
587
- __defProp3(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
588
- }
589
- return to;
590
- };
591
- var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
592
- // If the importer is in node compatibility mode or this is not an ESM
593
- // file that has been converted to a CommonJS file using a Babel-
594
- // compatible transform (i.e. "__esModule" has not been set), then set
595
- // "default" to the CommonJS "module.exports" for node compatibility.
596
- isNodeMode || !mod || !mod.__esModule ? __defProp3(target, "default", { value: mod, enumerable: true }) : target,
597
- mod
598
- ));
599
- var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
600
- var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
601
- var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
602
- var require_yocto_queue2 = __commonJS2({
603
- "../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports2, module2) {
604
- "use strict";
605
- var Node = class {
606
- /// value;
607
- /// next;
608
- constructor(value) {
609
- this.value = value;
610
- this.next = void 0;
611
- }
612
- };
613
- var Queue = class {
614
- // TODO: Use private class fields when targeting Node.js 12.
615
- // #_head;
616
- // #_tail;
617
- // #_size;
618
- constructor() {
619
- this.clear();
620
- }
621
- enqueue(value) {
622
- const node = new Node(value);
623
- if (this._head) {
624
- this._tail.next = node;
625
- this._tail = node;
626
- } else {
627
- this._head = node;
628
- this._tail = node;
629
- }
630
- this._size++;
631
- }
632
- dequeue() {
633
- const current = this._head;
634
- if (!current) {
635
- return;
636
- }
637
- this._head = this._head.next;
638
- this._size--;
639
- return current.value;
640
- }
641
- clear() {
642
- this._head = void 0;
643
- this._tail = void 0;
644
- this._size = 0;
645
- }
646
- get size() {
647
- return this._size;
648
- }
649
- *[Symbol.iterator]() {
650
- let current = this._head;
651
- while (current) {
652
- yield current.value;
653
- current = current.next;
654
- }
655
- }
656
- };
657
- module2.exports = Queue;
658
- }
659
- });
660
- var require_p_limit2 = __commonJS2({
661
- "../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports2, module2) {
662
- "use strict";
663
- var Queue = require_yocto_queue2();
664
- var pLimit2 = (concurrency) => {
665
- if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
666
- throw new TypeError("Expected `concurrency` to be a number from 1 and up");
667
- }
668
- const queue = new Queue();
669
- let activeCount = 0;
670
- const next = () => {
671
- activeCount--;
672
- if (queue.size > 0) {
673
- queue.dequeue()();
674
- }
675
- };
676
- const run = async (fn, resolve, ...args) => {
677
- activeCount++;
678
- const result = (async () => fn(...args))();
679
- resolve(result);
680
- try {
681
- await result;
682
- } catch (e) {
683
- }
684
- next();
685
- };
686
- const enqueue = (fn, resolve, ...args) => {
687
- queue.enqueue(run.bind(null, fn, resolve, ...args));
688
- (async () => {
689
- await Promise.resolve();
690
- if (activeCount < concurrency && queue.size > 0) {
691
- queue.dequeue()();
692
- }
693
- })();
694
- };
695
- const generator = (fn, ...args) => new Promise((resolve) => {
696
- enqueue(fn, resolve, ...args);
697
- });
698
- Object.defineProperties(generator, {
699
- activeCount: {
700
- get: () => activeCount
701
- },
702
- pendingCount: {
703
- get: () => queue.size
704
- },
705
- clearQueue: {
706
- value: () => {
707
- queue.clear();
708
- }
709
- }
710
- });
711
- return generator;
712
- };
713
- module2.exports = pLimit2;
714
- }
715
- });
716
- var require_retry_operation = __commonJS2({
717
- "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js"(exports2, module2) {
718
- "use strict";
719
- function RetryOperation(timeouts, options) {
720
- if (typeof options === "boolean") {
721
- options = { forever: options };
722
- }
723
- this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));
724
- this._timeouts = timeouts;
725
- this._options = options || {};
726
- this._maxRetryTime = options && options.maxRetryTime || Infinity;
727
- this._fn = null;
728
- this._errors = [];
729
- this._attempts = 1;
730
- this._operationTimeout = null;
731
- this._operationTimeoutCb = null;
732
- this._timeout = null;
733
- this._operationStart = null;
734
- this._timer = null;
735
- if (this._options.forever) {
736
- this._cachedTimeouts = this._timeouts.slice(0);
737
- }
738
- }
739
- module2.exports = RetryOperation;
740
- RetryOperation.prototype.reset = function() {
741
- this._attempts = 1;
742
- this._timeouts = this._originalTimeouts.slice(0);
743
- };
744
- RetryOperation.prototype.stop = function() {
745
- if (this._timeout) {
746
- clearTimeout(this._timeout);
747
- }
748
- if (this._timer) {
749
- clearTimeout(this._timer);
750
- }
751
- this._timeouts = [];
752
- this._cachedTimeouts = null;
753
- };
754
- RetryOperation.prototype.retry = function(err) {
755
- if (this._timeout) {
756
- clearTimeout(this._timeout);
757
- }
758
- if (!err) {
759
- return false;
760
- }
761
- var currentTime = (/* @__PURE__ */ new Date()).getTime();
762
- if (err && currentTime - this._operationStart >= this._maxRetryTime) {
763
- this._errors.push(err);
764
- this._errors.unshift(new Error("RetryOperation timeout occurred"));
765
- return false;
766
- }
767
- this._errors.push(err);
768
- var timeout = this._timeouts.shift();
769
- if (timeout === void 0) {
770
- if (this._cachedTimeouts) {
771
- this._errors.splice(0, this._errors.length - 1);
772
- timeout = this._cachedTimeouts.slice(-1);
773
- } else {
774
- return false;
775
- }
776
- }
777
- var self = this;
778
- this._timer = setTimeout(function() {
779
- self._attempts++;
780
- if (self._operationTimeoutCb) {
781
- self._timeout = setTimeout(function() {
782
- self._operationTimeoutCb(self._attempts);
783
- }, self._operationTimeout);
784
- if (self._options.unref) {
785
- self._timeout.unref();
786
- }
787
- }
788
- self._fn(self._attempts);
789
- }, timeout);
790
- if (this._options.unref) {
791
- this._timer.unref();
792
- }
793
- return true;
794
- };
795
- RetryOperation.prototype.attempt = function(fn, timeoutOps) {
796
- this._fn = fn;
797
- if (timeoutOps) {
798
- if (timeoutOps.timeout) {
799
- this._operationTimeout = timeoutOps.timeout;
800
- }
801
- if (timeoutOps.cb) {
802
- this._operationTimeoutCb = timeoutOps.cb;
803
- }
804
- }
805
- var self = this;
806
- if (this._operationTimeoutCb) {
807
- this._timeout = setTimeout(function() {
808
- self._operationTimeoutCb();
809
- }, self._operationTimeout);
810
- }
811
- this._operationStart = (/* @__PURE__ */ new Date()).getTime();
812
- this._fn(this._attempts);
813
- };
814
- RetryOperation.prototype.try = function(fn) {
815
- console.log("Using RetryOperation.try() is deprecated");
816
- this.attempt(fn);
817
- };
818
- RetryOperation.prototype.start = function(fn) {
819
- console.log("Using RetryOperation.start() is deprecated");
820
- this.attempt(fn);
821
- };
822
- RetryOperation.prototype.start = RetryOperation.prototype.try;
823
- RetryOperation.prototype.errors = function() {
824
- return this._errors;
825
- };
826
- RetryOperation.prototype.attempts = function() {
827
- return this._attempts;
828
- };
829
- RetryOperation.prototype.mainError = function() {
830
- if (this._errors.length === 0) {
831
- return null;
832
- }
833
- var counts = {};
834
- var mainError = null;
835
- var mainErrorCount = 0;
836
- for (var i = 0; i < this._errors.length; i++) {
837
- var error = this._errors[i];
838
- var message = error.message;
839
- var count = (counts[message] || 0) + 1;
840
- counts[message] = count;
841
- if (count >= mainErrorCount) {
842
- mainError = error;
843
- mainErrorCount = count;
844
- }
845
- }
846
- return mainError;
847
- };
726
+ /** Fetches all Quirks for a project */
727
+ async get(options) {
728
+ const { projectId } = this.options;
729
+ const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5), { ...options, projectId });
730
+ return await this.apiClient(fetchUri);
848
731
  }
849
- });
850
- var require_retry = __commonJS2({
851
- "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js"(exports2) {
852
- "use strict";
853
- var RetryOperation = require_retry_operation();
854
- exports2.operation = function(options) {
855
- var timeouts = exports2.timeouts(options);
856
- return new RetryOperation(timeouts, {
857
- forever: options && (options.forever || options.retries === Infinity),
858
- unref: options && options.unref,
859
- maxRetryTime: options && options.maxRetryTime
860
- });
861
- };
862
- exports2.timeouts = function(options) {
863
- if (options instanceof Array) {
864
- return [].concat(options);
865
- }
866
- var opts = {
867
- retries: 10,
868
- factor: 2,
869
- minTimeout: 1 * 1e3,
870
- maxTimeout: Infinity,
871
- randomize: false
872
- };
873
- for (var key in options) {
874
- opts[key] = options[key];
875
- }
876
- if (opts.minTimeout > opts.maxTimeout) {
877
- throw new Error("minTimeout is greater than maxTimeout");
878
- }
879
- var timeouts = [];
880
- for (var i = 0; i < opts.retries; i++) {
881
- timeouts.push(this.createTimeout(i, opts));
882
- }
883
- if (options && options.forever && !timeouts.length) {
884
- timeouts.push(this.createTimeout(i, opts));
732
+ /** Updates or creates (based on id) a Quirk */
733
+ async upsert(body) {
734
+ const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
735
+ await this.apiClient(fetchUri, {
736
+ method: "PUT",
737
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
738
+ expectNoContent: true
739
+ });
740
+ }
741
+ /** Deletes a Quirk */
742
+ async remove(body) {
743
+ const fetchUri = this.createUrl(__privateGet2(_QuirkClient2, _url5));
744
+ await this.apiClient(fetchUri, {
745
+ method: "DELETE",
746
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
747
+ expectNoContent: true
748
+ });
749
+ }
750
+ };
751
+ _url5 = /* @__PURE__ */ new WeakMap();
752
+ __privateAdd2(_QuirkClient, _url5, "/api/v2/quirk");
753
+ var _url6;
754
+ var _SignalClient = class _SignalClient2 extends ApiClient {
755
+ constructor(options) {
756
+ super(options);
757
+ }
758
+ /** Fetches all Signals for a project */
759
+ async get(options) {
760
+ const { projectId } = this.options;
761
+ const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6), { ...options, projectId });
762
+ return await this.apiClient(fetchUri);
763
+ }
764
+ /** Updates or creates (based on id) a Signal */
765
+ async upsert(body) {
766
+ const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
767
+ await this.apiClient(fetchUri, {
768
+ method: "PUT",
769
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
770
+ expectNoContent: true
771
+ });
772
+ }
773
+ /** Deletes a Signal */
774
+ async remove(body) {
775
+ const fetchUri = this.createUrl(__privateGet2(_SignalClient2, _url6));
776
+ await this.apiClient(fetchUri, {
777
+ method: "DELETE",
778
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
779
+ expectNoContent: true
780
+ });
781
+ }
782
+ };
783
+ _url6 = /* @__PURE__ */ new WeakMap();
784
+ __privateAdd2(_SignalClient, _url6, "/api/v2/signal");
785
+ var _url7;
786
+ var _TestClient = class _TestClient2 extends ApiClient {
787
+ constructor(options) {
788
+ super(options);
789
+ }
790
+ /** Fetches all Tests for a project */
791
+ async get(options) {
792
+ const { projectId } = this.options;
793
+ const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7), { ...options, projectId });
794
+ return await this.apiClient(fetchUri);
795
+ }
796
+ /** Updates or creates (based on id) a Test */
797
+ async upsert(body) {
798
+ const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
799
+ await this.apiClient(fetchUri, {
800
+ method: "PUT",
801
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
802
+ expectNoContent: true
803
+ });
804
+ }
805
+ /** Deletes a Test */
806
+ async remove(body) {
807
+ const fetchUri = this.createUrl(__privateGet2(_TestClient2, _url7));
808
+ await this.apiClient(fetchUri, {
809
+ method: "DELETE",
810
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
811
+ expectNoContent: true
812
+ });
813
+ }
814
+ };
815
+ _url7 = /* @__PURE__ */ new WeakMap();
816
+ __privateAdd2(_TestClient, _url7, "/api/v2/test");
817
+
818
+ // ../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js
819
+ var Node = class {
820
+ constructor(value) {
821
+ __publicField(this, "value");
822
+ __publicField(this, "next");
823
+ this.value = value;
824
+ }
825
+ };
826
+ var _head, _tail, _size;
827
+ var Queue = class {
828
+ constructor() {
829
+ __privateAdd(this, _head);
830
+ __privateAdd(this, _tail);
831
+ __privateAdd(this, _size);
832
+ this.clear();
833
+ }
834
+ enqueue(value) {
835
+ const node = new Node(value);
836
+ if (__privateGet(this, _head)) {
837
+ __privateGet(this, _tail).next = node;
838
+ __privateSet(this, _tail, node);
839
+ } else {
840
+ __privateSet(this, _head, node);
841
+ __privateSet(this, _tail, node);
842
+ }
843
+ __privateWrapper(this, _size)._++;
844
+ }
845
+ dequeue() {
846
+ const current = __privateGet(this, _head);
847
+ if (!current) {
848
+ return;
849
+ }
850
+ __privateSet(this, _head, __privateGet(this, _head).next);
851
+ __privateWrapper(this, _size)._--;
852
+ if (!__privateGet(this, _head)) {
853
+ __privateSet(this, _tail, void 0);
854
+ }
855
+ return current.value;
856
+ }
857
+ peek() {
858
+ if (!__privateGet(this, _head)) {
859
+ return;
860
+ }
861
+ return __privateGet(this, _head).value;
862
+ }
863
+ clear() {
864
+ __privateSet(this, _head, void 0);
865
+ __privateSet(this, _tail, void 0);
866
+ __privateSet(this, _size, 0);
867
+ }
868
+ get size() {
869
+ return __privateGet(this, _size);
870
+ }
871
+ *[Symbol.iterator]() {
872
+ let current = __privateGet(this, _head);
873
+ while (current) {
874
+ yield current.value;
875
+ current = current.next;
876
+ }
877
+ }
878
+ *drain() {
879
+ while (__privateGet(this, _head)) {
880
+ yield this.dequeue();
881
+ }
882
+ }
883
+ };
884
+ _head = new WeakMap();
885
+ _tail = new WeakMap();
886
+ _size = new WeakMap();
887
+
888
+ // ../../node_modules/.pnpm/p-limit@6.2.0/node_modules/p-limit/index.js
889
+ function pLimit2(concurrency) {
890
+ validateConcurrency(concurrency);
891
+ const queue = new Queue();
892
+ let activeCount = 0;
893
+ const resumeNext = () => {
894
+ if (activeCount < concurrency && queue.size > 0) {
895
+ queue.dequeue()();
896
+ activeCount++;
897
+ }
898
+ };
899
+ const next = () => {
900
+ activeCount--;
901
+ resumeNext();
902
+ };
903
+ const run = async (function_, resolve, arguments_) => {
904
+ const result = (async () => function_(...arguments_))();
905
+ resolve(result);
906
+ try {
907
+ await result;
908
+ } catch (e) {
909
+ }
910
+ next();
911
+ };
912
+ const enqueue = (function_, resolve, arguments_) => {
913
+ new Promise((internalResolve) => {
914
+ queue.enqueue(internalResolve);
915
+ }).then(
916
+ run.bind(void 0, function_, resolve, arguments_)
917
+ );
918
+ (async () => {
919
+ await Promise.resolve();
920
+ if (activeCount < concurrency) {
921
+ resumeNext();
885
922
  }
886
- timeouts.sort(function(a, b) {
887
- return a - b;
888
- });
889
- return timeouts;
890
- };
891
- exports2.createTimeout = function(attempt, opts) {
892
- var random = opts.randomize ? Math.random() + 1 : 1;
893
- var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));
894
- timeout = Math.min(timeout, opts.maxTimeout);
895
- return timeout;
896
- };
897
- exports2.wrap = function(obj, options, methods) {
898
- if (options instanceof Array) {
899
- methods = options;
900
- options = null;
923
+ })();
924
+ };
925
+ const generator = (function_, ...arguments_) => new Promise((resolve) => {
926
+ enqueue(function_, resolve, arguments_);
927
+ });
928
+ Object.defineProperties(generator, {
929
+ activeCount: {
930
+ get: () => activeCount
931
+ },
932
+ pendingCount: {
933
+ get: () => queue.size
934
+ },
935
+ clearQueue: {
936
+ value() {
937
+ queue.clear();
901
938
  }
902
- if (!methods) {
903
- methods = [];
904
- for (var key in obj) {
905
- if (typeof obj[key] === "function") {
906
- methods.push(key);
939
+ },
940
+ concurrency: {
941
+ get: () => concurrency,
942
+ set(newConcurrency) {
943
+ validateConcurrency(newConcurrency);
944
+ concurrency = newConcurrency;
945
+ queueMicrotask(() => {
946
+ while (activeCount < concurrency && queue.size > 0) {
947
+ resumeNext();
907
948
  }
908
- }
909
- }
910
- for (var i = 0; i < methods.length; i++) {
911
- var method = methods[i];
912
- var original = obj[method];
913
- obj[method] = function retryWrapper(original2) {
914
- var op = exports2.operation(options);
915
- var args = Array.prototype.slice.call(arguments, 1);
916
- var callback = args.pop();
917
- args.push(function(err) {
918
- if (op.retry(err)) {
919
- return;
920
- }
921
- if (err) {
922
- arguments[0] = op.mainError();
923
- }
924
- callback.apply(this, arguments);
925
- });
926
- op.attempt(function() {
927
- original2.apply(obj, args);
928
- });
929
- }.bind(obj, original);
930
- obj[method].options = options;
949
+ });
931
950
  }
932
- };
933
- }
934
- });
935
- var require_retry2 = __commonJS2({
936
- "../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js"(exports2, module2) {
937
- "use strict";
938
- module2.exports = require_retry();
951
+ }
952
+ });
953
+ return generator;
954
+ }
955
+ function validateConcurrency(concurrency) {
956
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
957
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
939
958
  }
940
- });
941
- var import_p_limit2 = __toESM2(require_p_limit2());
942
- var import_retry = __toESM2(require_retry2(), 1);
943
- var networkErrorMsgs = /* @__PURE__ */ new Set([
944
- "Failed to fetch",
959
+ }
960
+
961
+ // ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
962
+ var import_retry = __toESM(require_retry2(), 1);
963
+
964
+ // ../../node_modules/.pnpm/is-network-error@1.3.2/node_modules/is-network-error/index.js
965
+ var objectToString = Object.prototype.toString;
966
+ var isError = (value) => objectToString.call(value) === "[object Error]";
967
+ var errorMessages = /* @__PURE__ */ new Set([
968
+ "network error",
945
969
  // Chrome
946
970
  "NetworkError when attempting to fetch resource.",
947
971
  // Firefox
948
972
  "The Internet connection appears to be offline.",
949
- // Safari
973
+ // Safari 16
950
974
  "Network request failed",
951
975
  // `cross-fetch`
952
- "fetch failed"
976
+ "fetch failed",
977
+ // Undici (Node.js)
978
+ "terminated",
953
979
  // Undici (Node.js)
980
+ " A network error occurred.",
981
+ // Bun (WebKit)
982
+ "Network connection lost"
983
+ // Cloudflare Workers (fetch)
954
984
  ]);
985
+ function isNetworkError(error) {
986
+ const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
987
+ if (!isValid) {
988
+ return false;
989
+ }
990
+ const { message, stack } = error;
991
+ if (message === "Load failed" || message.startsWith("Load failed (") && message.endsWith(")")) {
992
+ return stack === void 0 || "__sentry_captured__" in error;
993
+ }
994
+ if (message.startsWith("error sending request for url")) {
995
+ return true;
996
+ }
997
+ if (message === "Failed to fetch" || message.startsWith("Failed to fetch (") && message.endsWith(")")) {
998
+ return true;
999
+ }
1000
+ return errorMessages.has(message);
1001
+ }
1002
+
1003
+ // ../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
955
1004
  var AbortError = class extends Error {
956
1005
  constructor(message) {
957
1006
  super();
@@ -972,63 +1021,71 @@ var decorateErrorWithCounts = (error, attemptNumber, options) => {
972
1021
  error.retriesLeft = retriesLeft;
973
1022
  return error;
974
1023
  };
975
- var isNetworkError = (errorMessage) => networkErrorMsgs.has(errorMessage);
976
- var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new Error(errorMessage) : new DOMException(errorMessage);
977
1024
  async function pRetry(input, options) {
978
1025
  return new Promise((resolve, reject) => {
979
- options = {
980
- onFailedAttempt() {
981
- },
982
- retries: 10,
983
- ...options
1026
+ var _a, _b, _c;
1027
+ options = { ...options };
1028
+ (_a = options.onFailedAttempt) != null ? _a : options.onFailedAttempt = () => {
984
1029
  };
1030
+ (_b = options.shouldRetry) != null ? _b : options.shouldRetry = () => true;
1031
+ (_c = options.retries) != null ? _c : options.retries = 10;
985
1032
  const operation = import_retry.default.operation(options);
1033
+ const abortHandler = () => {
1034
+ var _a2;
1035
+ operation.stop();
1036
+ reject((_a2 = options.signal) == null ? void 0 : _a2.reason);
1037
+ };
1038
+ if (options.signal && !options.signal.aborted) {
1039
+ options.signal.addEventListener("abort", abortHandler, { once: true });
1040
+ }
1041
+ const cleanUp = () => {
1042
+ var _a2;
1043
+ (_a2 = options.signal) == null ? void 0 : _a2.removeEventListener("abort", abortHandler);
1044
+ operation.stop();
1045
+ };
986
1046
  operation.attempt(async (attemptNumber) => {
987
1047
  try {
988
- resolve(await input(attemptNumber));
1048
+ const result = await input(attemptNumber);
1049
+ cleanUp();
1050
+ resolve(result);
989
1051
  } catch (error) {
990
- if (!(error instanceof Error)) {
991
- reject(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
992
- return;
993
- }
994
- if (error instanceof AbortError) {
995
- operation.stop();
996
- reject(error.originalError);
997
- } else if (error instanceof TypeError && !isNetworkError(error.message)) {
998
- operation.stop();
999
- reject(error);
1000
- } else {
1052
+ try {
1053
+ if (!(error instanceof Error)) {
1054
+ throw new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`);
1055
+ }
1056
+ if (error instanceof AbortError) {
1057
+ throw error.originalError;
1058
+ }
1059
+ if (error instanceof TypeError && !isNetworkError(error)) {
1060
+ throw error;
1061
+ }
1001
1062
  decorateErrorWithCounts(error, attemptNumber, options);
1002
- try {
1003
- await options.onFailedAttempt(error);
1004
- } catch (error2) {
1005
- reject(error2);
1006
- return;
1063
+ if (!await options.shouldRetry(error)) {
1064
+ operation.stop();
1065
+ reject(error);
1007
1066
  }
1067
+ await options.onFailedAttempt(error);
1008
1068
  if (!operation.retry(error)) {
1009
- reject(operation.mainError());
1069
+ throw operation.mainError();
1010
1070
  }
1071
+ } catch (finalError) {
1072
+ decorateErrorWithCounts(finalError, attemptNumber, options);
1073
+ cleanUp();
1074
+ reject(finalError);
1011
1075
  }
1012
1076
  }
1013
1077
  });
1014
- if (options.signal && !options.signal.aborted) {
1015
- options.signal.addEventListener("abort", () => {
1016
- operation.stop();
1017
- const reason = options.signal.reason === void 0 ? getDOMException("The operation was aborted.") : options.signal.reason;
1018
- reject(reason instanceof Error ? reason : getDOMException(reason));
1019
- }, {
1020
- once: true
1021
- });
1022
- }
1023
1078
  });
1024
1079
  }
1080
+
1081
+ // ../../node_modules/.pnpm/p-throttle@6.2.0/node_modules/p-throttle/index.js
1025
1082
  var AbortError2 = class extends Error {
1026
1083
  constructor() {
1027
1084
  super("Throttled function aborted");
1028
1085
  this.name = "AbortError";
1029
1086
  }
1030
1087
  };
1031
- function pThrottle({ limit, interval, strict }) {
1088
+ function pThrottle({ limit, interval, strict, onDelay }) {
1032
1089
  if (!Number.isFinite(limit)) {
1033
1090
  throw new TypeError("Expected `limit` to be a finite number");
1034
1091
  }
@@ -1056,32 +1113,38 @@ function pThrottle({ limit, interval, strict }) {
1056
1113
  const strictTicks = [];
1057
1114
  function strictDelay() {
1058
1115
  const now = Date.now();
1059
- if (strictTicks.length < limit) {
1060
- strictTicks.push(now);
1061
- return 0;
1116
+ if (strictTicks.length > 0 && now - strictTicks.at(-1) > interval) {
1117
+ strictTicks.length = 0;
1062
1118
  }
1063
- const earliestTime = strictTicks.shift() + interval;
1064
- if (now >= earliestTime) {
1119
+ if (strictTicks.length < limit) {
1065
1120
  strictTicks.push(now);
1066
1121
  return 0;
1067
1122
  }
1068
- strictTicks.push(earliestTime);
1069
- return earliestTime - now;
1123
+ const nextExecutionTime = strictTicks[0] + interval;
1124
+ strictTicks.shift();
1125
+ strictTicks.push(nextExecutionTime);
1126
+ return Math.max(0, nextExecutionTime - now);
1070
1127
  }
1071
1128
  const getDelay = strict ? strictDelay : windowedDelay;
1072
1129
  return (function_) => {
1073
- const throttled = function(...args) {
1130
+ const throttled = function(...arguments_) {
1074
1131
  if (!throttled.isEnabled) {
1075
- return (async () => function_.apply(this, args))();
1132
+ return (async () => function_.apply(this, arguments_))();
1076
1133
  }
1077
- let timeout;
1134
+ let timeoutId;
1078
1135
  return new Promise((resolve, reject) => {
1079
1136
  const execute = () => {
1080
- resolve(function_.apply(this, args));
1081
- queue.delete(timeout);
1137
+ resolve(function_.apply(this, arguments_));
1138
+ queue.delete(timeoutId);
1082
1139
  };
1083
- timeout = setTimeout(execute, getDelay());
1084
- queue.set(timeout, reject);
1140
+ const delay = getDelay();
1141
+ if (delay > 0) {
1142
+ timeoutId = setTimeout(execute, delay);
1143
+ queue.set(timeoutId, reject);
1144
+ onDelay == null ? void 0 : onDelay(...arguments_);
1145
+ } else {
1146
+ execute();
1147
+ }
1085
1148
  });
1086
1149
  };
1087
1150
  throttled.abort = () => {
@@ -1093,16 +1156,29 @@ function pThrottle({ limit, interval, strict }) {
1093
1156
  strictTicks.splice(0, strictTicks.length);
1094
1157
  };
1095
1158
  throttled.isEnabled = true;
1159
+ Object.defineProperty(throttled, "queueSize", {
1160
+ get() {
1161
+ return queue.size;
1162
+ }
1163
+ });
1096
1164
  return throttled;
1097
1165
  };
1098
1166
  }
1167
+
1168
+ // ../canvas/dist/index.mjs
1169
+ var __typeError3 = (msg) => {
1170
+ throw TypeError(msg);
1171
+ };
1172
+ var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
1173
+ var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
1174
+ var __privateAdd3 = (obj, member, value) => member.has(obj) ? __typeError3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
1099
1175
  function createLimitPolicy({
1100
1176
  throttle = { interval: 1e3, limit: 10 },
1101
- retry: retry2 = { retries: 1, factor: 1.66 },
1177
+ retry: retry3 = { retries: 1, factor: 1.66 },
1102
1178
  limit = 10
1103
1179
  }) {
1104
1180
  const throttler = throttle ? pThrottle(throttle) : null;
1105
- const limiter = limit ? (0, import_p_limit2.default)(limit) : null;
1181
+ const limiter = limit ? pLimit2(limit) : null;
1106
1182
  return function limitPolicy(func) {
1107
1183
  let currentFunc = async () => await func();
1108
1184
  if (throttler) {
@@ -1113,13 +1189,13 @@ function createLimitPolicy({
1113
1189
  const limitFunc = currentFunc;
1114
1190
  currentFunc = () => limiter(limitFunc);
1115
1191
  }
1116
- if (retry2) {
1192
+ if (retry3) {
1117
1193
  const retryFunc = currentFunc;
1118
1194
  currentFunc = () => pRetry(retryFunc, {
1119
- ...retry2,
1195
+ ...retry3,
1120
1196
  onFailedAttempt: async (error) => {
1121
- if (retry2.onFailedAttempt) {
1122
- await retry2.onFailedAttempt(error);
1197
+ if (retry3.onFailedAttempt) {
1198
+ await retry3.onFailedAttempt(error);
1123
1199
  }
1124
1200
  if (error instanceof ApiClientError && typeof error.statusCode === "number" && error.statusCode >= 400 && error.statusCode < 500 && error.statusCode !== 429 && error.statusCode !== 408) {
1125
1201
  throw error;
@@ -1259,7 +1335,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1259
1335
  }
1260
1336
  getContentTypes(options) {
1261
1337
  const { projectId } = this.options;
1262
- const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl), { ...options, projectId });
1338
+ const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl), { ...options, projectId });
1263
1339
  return this.apiClient(fetchUri);
1264
1340
  }
1265
1341
  getEntries(options) {
@@ -1267,11 +1343,11 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1267
1343
  const { skipDataResolution, filters, ...params } = options;
1268
1344
  const rewrittenFilters = rewriteFiltersForApi(filters);
1269
1345
  if (skipDataResolution) {
1270
- const url = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
1346
+ const url = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl), { ...params, ...rewrittenFilters, projectId });
1271
1347
  return this.apiClient(url);
1272
1348
  }
1273
1349
  const edgeUrl = this.createUrl(
1274
- __privateGet2(_ContentClient2, _entriesUrl),
1350
+ __privateGet3(_ContentClient2, _entriesUrl),
1275
1351
  { ...this.getEdgeOptions(params), ...rewrittenFilters },
1276
1352
  this.edgeApiHost
1277
1353
  );
@@ -1289,7 +1365,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1289
1365
  return this.apiClient(historyUrl);
1290
1366
  }
1291
1367
  async upsertContentType(body, opts = {}) {
1292
- const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
1368
+ const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
1293
1369
  if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
1294
1370
  delete body.contentType.slugSettings;
1295
1371
  }
@@ -1301,7 +1377,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1301
1377
  });
1302
1378
  }
1303
1379
  async upsertEntry(body, options) {
1304
- const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
1380
+ const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
1305
1381
  const headers = {};
1306
1382
  if (options == null ? void 0 : options.ifUnmodifiedSince) {
1307
1383
  headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
@@ -1315,7 +1391,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1315
1391
  return { modified: response.headers.get("x-modified-at") };
1316
1392
  }
1317
1393
  async deleteContentType(body) {
1318
- const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _contentTypesUrl));
1394
+ const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _contentTypesUrl));
1319
1395
  await this.apiClient(fetchUri, {
1320
1396
  method: "DELETE",
1321
1397
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -1323,7 +1399,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1323
1399
  });
1324
1400
  }
1325
1401
  async deleteEntry(body) {
1326
- const fetchUri = this.createUrl(__privateGet2(_ContentClient2, _entriesUrl));
1402
+ const fetchUri = this.createUrl(__privateGet3(_ContentClient2, _entriesUrl));
1327
1403
  await this.apiClient(fetchUri, {
1328
1404
  method: "DELETE",
1329
1405
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -1342,8 +1418,8 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
1342
1418
  };
1343
1419
  _contentTypesUrl = /* @__PURE__ */ new WeakMap();
1344
1420
  _entriesUrl = /* @__PURE__ */ new WeakMap();
1345
- __privateAdd2(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
1346
- __privateAdd2(_ContentClient, _entriesUrl, "/api/v1/entries");
1421
+ __privateAdd3(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
1422
+ __privateAdd3(_ContentClient, _entriesUrl, "/api/v1/entries");
1347
1423
  var _url8;
1348
1424
  var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1349
1425
  constructor(options) {
@@ -1352,12 +1428,12 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1352
1428
  /** Fetches all DataTypes for a project */
1353
1429
  async get(options) {
1354
1430
  const { projectId } = this.options;
1355
- const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
1431
+ const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8), { ...options, projectId });
1356
1432
  return await this.apiClient(fetchUri);
1357
1433
  }
1358
1434
  /** Updates or creates (based on id) a DataType */
1359
1435
  async upsert(body) {
1360
- const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
1436
+ const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
1361
1437
  await this.apiClient(fetchUri, {
1362
1438
  method: "PUT",
1363
1439
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -1366,7 +1442,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1366
1442
  }
1367
1443
  /** Deletes a DataType */
1368
1444
  async remove(body) {
1369
- const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
1445
+ const fetchUri = this.createUrl(__privateGet3(_DataTypeClient2, _url8));
1370
1446
  await this.apiClient(fetchUri, {
1371
1447
  method: "DELETE",
1372
1448
  body: JSON.stringify({ ...body, projectId: this.options.projectId }),
@@ -1375,7 +1451,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
1375
1451
  }
1376
1452
  };
1377
1453
  _url8 = /* @__PURE__ */ new WeakMap();
1378
- __privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
1454
+ __privateAdd3(_DataTypeClient, _url8, "/api/v1/data-types");
1379
1455
  var CANVAS_DRAFT_STATE = 0;
1380
1456
  var CANVAS_EDITOR_STATE = 63;
1381
1457
  var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
@@ -1471,7 +1547,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
1471
1547
  * Gets a list of property type and hook names for the current team, including public integrations' hooks.
1472
1548
  */
1473
1549
  get(options) {
1474
- const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl), {
1550
+ const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl), {
1475
1551
  ...options,
1476
1552
  teamId: this.teamId
1477
1553
  });
@@ -1481,7 +1557,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
1481
1557
  * Creates or updates a custom AI property editor on a Mesh app.
1482
1558
  */
1483
1559
  async deploy(body) {
1484
- const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
1560
+ const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
1485
1561
  await this.apiClient(fetchUri, {
1486
1562
  method: "PUT",
1487
1563
  body: JSON.stringify({ ...body, teamId: this.teamId }),
@@ -1492,7 +1568,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
1492
1568
  * Removes a custom AI property editor from a Mesh app.
1493
1569
  */
1494
1570
  async delete(body) {
1495
- const fetchUri = this.createUrl(__privateGet2(_IntegrationPropertyEditorsClient2, _baseUrl));
1571
+ const fetchUri = this.createUrl(__privateGet3(_IntegrationPropertyEditorsClient2, _baseUrl));
1496
1572
  await this.apiClient(fetchUri, {
1497
1573
  method: "DELETE",
1498
1574
  body: JSON.stringify({ ...body, teamId: this.teamId }),
@@ -1501,7 +1577,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
1501
1577
  }
1502
1578
  };
1503
1579
  _baseUrl = /* @__PURE__ */ new WeakMap();
1504
- __privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
1580
+ __privateAdd3(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
1505
1581
  var _url22;
1506
1582
  var _projectsUrl;
1507
1583
  var _ProjectClient = class _ProjectClient2 extends ApiClient {
@@ -1510,7 +1586,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1510
1586
  }
1511
1587
  /** Fetches single Project */
1512
1588
  async get(options) {
1513
- const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22), { ...options });
1589
+ const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22), { ...options });
1514
1590
  return await this.apiClient(fetchUri);
1515
1591
  }
1516
1592
  /**
@@ -1519,12 +1595,12 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1519
1595
  * When omitted, returns all accessible teams and their projects.
1520
1596
  */
1521
1597
  async getProjects(options) {
1522
- const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
1598
+ const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
1523
1599
  return await this.apiClient(fetchUri);
1524
1600
  }
1525
1601
  /** Updates or creates (based on id) a Project */
1526
1602
  async upsert(body) {
1527
- const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
1603
+ const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
1528
1604
  return await this.apiClient(fetchUri, {
1529
1605
  method: "PUT",
1530
1606
  body: JSON.stringify({ ...body })
@@ -1532,7 +1608,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1532
1608
  }
1533
1609
  /** Deletes a Project */
1534
1610
  async delete(body) {
1535
- const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url22));
1611
+ const fetchUri = this.createUrl(__privateGet3(_ProjectClient2, _url22));
1536
1612
  await this.apiClient(fetchUri, {
1537
1613
  method: "DELETE",
1538
1614
  body: JSON.stringify({ ...body }),
@@ -1542,8 +1618,8 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
1542
1618
  };
1543
1619
  _url22 = /* @__PURE__ */ new WeakMap();
1544
1620
  _projectsUrl = /* @__PURE__ */ new WeakMap();
1545
- __privateAdd2(_ProjectClient, _url22, "/api/v1/project");
1546
- __privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
1621
+ __privateAdd3(_ProjectClient, _url22, "/api/v1/project");
1622
+ __privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
1547
1623
  var isAllowedReferrer = (referrer) => {
1548
1624
  return Boolean(referrer == null ? void 0 : referrer.match(/(^https:\/\/|\.)(uniform.app|uniform.wtf|localhost:\d{4})\//));
1549
1625
  };
@@ -1940,7 +2016,7 @@ function createLimiter(concurrency) {
1940
2016
  });
1941
2017
  };
1942
2018
  }
1943
- async function retry(fn, options) {
2019
+ async function retry2(fn, options) {
1944
2020
  let lastError;
1945
2021
  let delay = 1e3;
1946
2022
  for (let attempt = 1; attempt <= options.retries + 1; attempt++) {
@@ -1980,7 +2056,7 @@ function createLimitPolicy2({
1980
2056
  }
1981
2057
  if (retryOptions) {
1982
2058
  const retryFunc = currentFunc;
1983
- currentFunc = () => retry(retryFunc, {
2059
+ currentFunc = () => retry2(retryFunc, {
1984
2060
  ...retryOptions,
1985
2061
  onFailedAttempt: async (error) => {
1986
2062
  if (retryOptions.onFailedAttempt) {
@@ -2054,14 +2130,14 @@ var getCanvasClient = (options) => {
2054
2130
  var import_server_only2 = require("server-only");
2055
2131
 
2056
2132
  // ../project-map/dist/index.mjs
2057
- var __typeError3 = (msg) => {
2133
+ var __typeError4 = (msg) => {
2058
2134
  throw TypeError(msg);
2059
2135
  };
2060
- var __accessCheck3 = (obj, member, msg) => member.has(obj) || __typeError3("Cannot " + msg);
2061
- var __privateGet3 = (obj, member, getter) => (__accessCheck3(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
2062
- var __privateAdd3 = (obj, member, value) => member.has(obj) ? __typeError3("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2063
- var __privateSet = (obj, member, value, setter) => (__accessCheck3(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
2064
- var __privateMethod = (obj, member, method) => (__accessCheck3(obj, member, "access private method"), method);
2136
+ var __accessCheck4 = (obj, member, msg) => member.has(obj) || __typeError4("Cannot " + msg);
2137
+ var __privateGet4 = (obj, member, getter) => (__accessCheck4(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
2138
+ var __privateAdd4 = (obj, member, value) => member.has(obj) ? __typeError4("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2139
+ var __privateSet2 = (obj, member, value, setter) => (__accessCheck4(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
2140
+ var __privateMethod = (obj, member, method) => (__accessCheck4(obj, member, "access private method"), method);
2065
2141
  var ProjectMapClient = class extends ApiClient {
2066
2142
  constructor(options) {
2067
2143
  super(options);
@@ -2208,12 +2284,12 @@ var isDynamicRouteSegment_fn;
2208
2284
  var _Route = class _Route2 {
2209
2285
  constructor(route) {
2210
2286
  this.route = route;
2211
- __privateAdd3(this, _routeInfo);
2287
+ __privateAdd4(this, _routeInfo);
2212
2288
  var _a;
2213
- __privateSet(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
2289
+ __privateSet2(this, _routeInfo, __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
2214
2290
  }
2215
2291
  get dynamicSegmentCount() {
2216
- return __privateGet3(this, _routeInfo).segments.reduce(
2292
+ return __privateGet4(this, _routeInfo).segments.reduce(
2217
2293
  (count, segment) => {
2218
2294
  var _a;
2219
2295
  return __privateMethod(_a = _Route2, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
@@ -2225,7 +2301,7 @@ var _Route = class _Route2 {
2225
2301
  matches(path) {
2226
2302
  var _a, _b;
2227
2303
  const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route2, _Route_static, parseRouteOrPath_fn).call(_a, path);
2228
- const { segments: routeSegments } = __privateGet3(this, _routeInfo);
2304
+ const { segments: routeSegments } = __privateGet4(this, _routeInfo);
2229
2305
  if (pathSegments.length !== routeSegments.length) {
2230
2306
  return { match: false };
2231
2307
  }
@@ -2246,7 +2322,7 @@ var _Route = class _Route2 {
2246
2322
  return { match: false };
2247
2323
  }
2248
2324
  }
2249
- for (const [key, value] of __privateGet3(this, _routeInfo).queryParams) {
2325
+ for (const [key, value] of __privateGet4(this, _routeInfo).queryParams) {
2250
2326
  possibleMatch.queryParams[key] = pathQuery.has(key) ? pathQuery.get(key) : value;
2251
2327
  }
2252
2328
  return possibleMatch;
@@ -2256,7 +2332,7 @@ var _Route = class _Route2 {
2256
2332
  */
2257
2333
  expand(options) {
2258
2334
  const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
2259
- const path = __privateGet3(this, _routeInfo).segments.map((segment) => {
2335
+ const path = __privateGet4(this, _routeInfo).segments.map((segment) => {
2260
2336
  const dynamicSegmentName = _Route2.getDynamicRouteSegmentName(segment);
2261
2337
  if (!dynamicSegmentName) {
2262
2338
  return segment;
@@ -2307,7 +2383,7 @@ isDynamicRouteSegment_fn = function(segment) {
2307
2383
  }
2308
2384
  return segment.startsWith(_Route.dynamicSegmentPrefix);
2309
2385
  };
2310
- __privateAdd3(_Route, _Route_static);
2386
+ __privateAdd4(_Route, _Route_static);
2311
2387
  _Route.dynamicSegmentPrefix = ":";
2312
2388
  function encodeRouteComponent(value, doNotEscapeVariables) {
2313
2389
  if (!doNotEscapeVariables) {