perstack 0.0.95 → 0.0.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1174 @@
1
+ import { i as __require, t as __commonJSMin } from "./chunk-D_gEzPfs.js";
2
+
3
+ //#region ../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
4
+ var require_ms = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5
+ /**
6
+ * Helpers.
7
+ */
8
+ var s = 1e3;
9
+ var m = s * 60;
10
+ var h = m * 60;
11
+ var d = h * 24;
12
+ var w = d * 7;
13
+ var y = d * 365.25;
14
+ /**
15
+ * Parse or format the given `val`.
16
+ *
17
+ * Options:
18
+ *
19
+ * - `long` verbose formatting [false]
20
+ *
21
+ * @param {String|Number} val
22
+ * @param {Object} [options]
23
+ * @throws {Error} throw an error if val is not a non-empty string or a number
24
+ * @return {String|Number}
25
+ * @api public
26
+ */
27
+ module.exports = function(val, options) {
28
+ options = options || {};
29
+ var type = typeof val;
30
+ if (type === "string" && val.length > 0) return parse(val);
31
+ else if (type === "number" && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
32
+ throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
33
+ };
34
+ /**
35
+ * Parse the given `str` and return milliseconds.
36
+ *
37
+ * @param {String} str
38
+ * @return {Number}
39
+ * @api private
40
+ */
41
+ function parse(str) {
42
+ str = String(str);
43
+ if (str.length > 100) return;
44
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
45
+ if (!match) return;
46
+ var n = parseFloat(match[1]);
47
+ switch ((match[2] || "ms").toLowerCase()) {
48
+ case "years":
49
+ case "year":
50
+ case "yrs":
51
+ case "yr":
52
+ case "y": return n * y;
53
+ case "weeks":
54
+ case "week":
55
+ case "w": return n * w;
56
+ case "days":
57
+ case "day":
58
+ case "d": return n * d;
59
+ case "hours":
60
+ case "hour":
61
+ case "hrs":
62
+ case "hr":
63
+ case "h": return n * h;
64
+ case "minutes":
65
+ case "minute":
66
+ case "mins":
67
+ case "min":
68
+ case "m": return n * m;
69
+ case "seconds":
70
+ case "second":
71
+ case "secs":
72
+ case "sec":
73
+ case "s": return n * s;
74
+ case "milliseconds":
75
+ case "millisecond":
76
+ case "msecs":
77
+ case "msec":
78
+ case "ms": return n;
79
+ default: return;
80
+ }
81
+ }
82
+ /**
83
+ * Short format for `ms`.
84
+ *
85
+ * @param {Number} ms
86
+ * @return {String}
87
+ * @api private
88
+ */
89
+ function fmtShort(ms) {
90
+ var msAbs = Math.abs(ms);
91
+ if (msAbs >= d) return Math.round(ms / d) + "d";
92
+ if (msAbs >= h) return Math.round(ms / h) + "h";
93
+ if (msAbs >= m) return Math.round(ms / m) + "m";
94
+ if (msAbs >= s) return Math.round(ms / s) + "s";
95
+ return ms + "ms";
96
+ }
97
+ /**
98
+ * Long format for `ms`.
99
+ *
100
+ * @param {Number} ms
101
+ * @return {String}
102
+ * @api private
103
+ */
104
+ function fmtLong(ms) {
105
+ var msAbs = Math.abs(ms);
106
+ if (msAbs >= d) return plural(ms, msAbs, d, "day");
107
+ if (msAbs >= h) return plural(ms, msAbs, h, "hour");
108
+ if (msAbs >= m) return plural(ms, msAbs, m, "minute");
109
+ if (msAbs >= s) return plural(ms, msAbs, s, "second");
110
+ return ms + " ms";
111
+ }
112
+ /**
113
+ * Pluralization helper.
114
+ */
115
+ function plural(ms, msAbs, n, name) {
116
+ var isPlural = msAbs >= n * 1.5;
117
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
118
+ }
119
+ }));
120
+
121
+ //#endregion
122
+ //#region ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js
123
+ var require_common = /* @__PURE__ */ __commonJSMin(((exports, module) => {
124
+ /**
125
+ * This is the common logic for both the Node.js and web browser
126
+ * implementations of `debug()`.
127
+ */
128
+ function setup(env) {
129
+ createDebug.debug = createDebug;
130
+ createDebug.default = createDebug;
131
+ createDebug.coerce = coerce;
132
+ createDebug.disable = disable;
133
+ createDebug.enable = enable;
134
+ createDebug.enabled = enabled;
135
+ createDebug.humanize = require_ms();
136
+ createDebug.destroy = destroy;
137
+ Object.keys(env).forEach((key) => {
138
+ createDebug[key] = env[key];
139
+ });
140
+ /**
141
+ * The currently active debug mode names, and names to skip.
142
+ */
143
+ createDebug.names = [];
144
+ createDebug.skips = [];
145
+ /**
146
+ * Map of special "%n" handling functions, for the debug "format" argument.
147
+ *
148
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
149
+ */
150
+ createDebug.formatters = {};
151
+ /**
152
+ * Selects a color for a debug namespace
153
+ * @param {String} namespace The namespace string for the debug instance to be colored
154
+ * @return {Number|String} An ANSI color code for the given namespace
155
+ * @api private
156
+ */
157
+ function selectColor(namespace) {
158
+ let hash = 0;
159
+ for (let i = 0; i < namespace.length; i++) {
160
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
161
+ hash |= 0;
162
+ }
163
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
164
+ }
165
+ createDebug.selectColor = selectColor;
166
+ /**
167
+ * Create a debugger with the given `namespace`.
168
+ *
169
+ * @param {String} namespace
170
+ * @return {Function}
171
+ * @api public
172
+ */
173
+ function createDebug(namespace) {
174
+ let prevTime;
175
+ let enableOverride = null;
176
+ let namespacesCache;
177
+ let enabledCache;
178
+ function debug(...args) {
179
+ if (!debug.enabled) return;
180
+ const self = debug;
181
+ const curr = Number(/* @__PURE__ */ new Date());
182
+ self.diff = curr - (prevTime || curr);
183
+ self.prev = prevTime;
184
+ self.curr = curr;
185
+ prevTime = curr;
186
+ args[0] = createDebug.coerce(args[0]);
187
+ if (typeof args[0] !== "string") args.unshift("%O");
188
+ let index = 0;
189
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
190
+ if (match === "%%") return "%";
191
+ index++;
192
+ const formatter = createDebug.formatters[format];
193
+ if (typeof formatter === "function") {
194
+ const val = args[index];
195
+ match = formatter.call(self, val);
196
+ args.splice(index, 1);
197
+ index--;
198
+ }
199
+ return match;
200
+ });
201
+ createDebug.formatArgs.call(self, args);
202
+ (self.log || createDebug.log).apply(self, args);
203
+ }
204
+ debug.namespace = namespace;
205
+ debug.useColors = createDebug.useColors();
206
+ debug.color = createDebug.selectColor(namespace);
207
+ debug.extend = extend;
208
+ debug.destroy = createDebug.destroy;
209
+ Object.defineProperty(debug, "enabled", {
210
+ enumerable: true,
211
+ configurable: false,
212
+ get: () => {
213
+ if (enableOverride !== null) return enableOverride;
214
+ if (namespacesCache !== createDebug.namespaces) {
215
+ namespacesCache = createDebug.namespaces;
216
+ enabledCache = createDebug.enabled(namespace);
217
+ }
218
+ return enabledCache;
219
+ },
220
+ set: (v) => {
221
+ enableOverride = v;
222
+ }
223
+ });
224
+ if (typeof createDebug.init === "function") createDebug.init(debug);
225
+ return debug;
226
+ }
227
+ function extend(namespace, delimiter) {
228
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
229
+ newDebug.log = this.log;
230
+ return newDebug;
231
+ }
232
+ /**
233
+ * Enables a debug mode by namespaces. This can include modes
234
+ * separated by a colon and wildcards.
235
+ *
236
+ * @param {String} namespaces
237
+ * @api public
238
+ */
239
+ function enable(namespaces) {
240
+ createDebug.save(namespaces);
241
+ createDebug.namespaces = namespaces;
242
+ createDebug.names = [];
243
+ createDebug.skips = [];
244
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
245
+ for (const ns of split) if (ns[0] === "-") createDebug.skips.push(ns.slice(1));
246
+ else createDebug.names.push(ns);
247
+ }
248
+ /**
249
+ * Checks if the given string matches a namespace template, honoring
250
+ * asterisks as wildcards.
251
+ *
252
+ * @param {String} search
253
+ * @param {String} template
254
+ * @return {Boolean}
255
+ */
256
+ function matchesTemplate(search, template) {
257
+ let searchIndex = 0;
258
+ let templateIndex = 0;
259
+ let starIndex = -1;
260
+ let matchIndex = 0;
261
+ while (searchIndex < search.length) if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) if (template[templateIndex] === "*") {
262
+ starIndex = templateIndex;
263
+ matchIndex = searchIndex;
264
+ templateIndex++;
265
+ } else {
266
+ searchIndex++;
267
+ templateIndex++;
268
+ }
269
+ else if (starIndex !== -1) {
270
+ templateIndex = starIndex + 1;
271
+ matchIndex++;
272
+ searchIndex = matchIndex;
273
+ } else return false;
274
+ while (templateIndex < template.length && template[templateIndex] === "*") templateIndex++;
275
+ return templateIndex === template.length;
276
+ }
277
+ /**
278
+ * Disable debug output.
279
+ *
280
+ * @return {String} namespaces
281
+ * @api public
282
+ */
283
+ function disable() {
284
+ const namespaces = [...createDebug.names, ...createDebug.skips.map((namespace) => "-" + namespace)].join(",");
285
+ createDebug.enable("");
286
+ return namespaces;
287
+ }
288
+ /**
289
+ * Returns true if the given mode name is enabled, false otherwise.
290
+ *
291
+ * @param {String} name
292
+ * @return {Boolean}
293
+ * @api public
294
+ */
295
+ function enabled(name) {
296
+ for (const skip of createDebug.skips) if (matchesTemplate(name, skip)) return false;
297
+ for (const ns of createDebug.names) if (matchesTemplate(name, ns)) return true;
298
+ return false;
299
+ }
300
+ /**
301
+ * Coerce `val`.
302
+ *
303
+ * @param {Mixed} val
304
+ * @return {Mixed}
305
+ * @api private
306
+ */
307
+ function coerce(val) {
308
+ if (val instanceof Error) return val.stack || val.message;
309
+ return val;
310
+ }
311
+ /**
312
+ * XXX DO NOT USE. This is a temporary stub function.
313
+ * XXX It WILL be removed in the next major release.
314
+ */
315
+ function destroy() {
316
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
317
+ }
318
+ createDebug.enable(createDebug.load());
319
+ return createDebug;
320
+ }
321
+ module.exports = setup;
322
+ }));
323
+
324
+ //#endregion
325
+ //#region ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js
326
+ var require_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
327
+ /**
328
+ * This is the web browser implementation of `debug()`.
329
+ */
330
+ exports.formatArgs = formatArgs;
331
+ exports.save = save;
332
+ exports.load = load;
333
+ exports.useColors = useColors;
334
+ exports.storage = localstorage();
335
+ exports.destroy = (() => {
336
+ let warned = false;
337
+ return () => {
338
+ if (!warned) {
339
+ warned = true;
340
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
341
+ }
342
+ };
343
+ })();
344
+ /**
345
+ * Colors.
346
+ */
347
+ exports.colors = [
348
+ "#0000CC",
349
+ "#0000FF",
350
+ "#0033CC",
351
+ "#0033FF",
352
+ "#0066CC",
353
+ "#0066FF",
354
+ "#0099CC",
355
+ "#0099FF",
356
+ "#00CC00",
357
+ "#00CC33",
358
+ "#00CC66",
359
+ "#00CC99",
360
+ "#00CCCC",
361
+ "#00CCFF",
362
+ "#3300CC",
363
+ "#3300FF",
364
+ "#3333CC",
365
+ "#3333FF",
366
+ "#3366CC",
367
+ "#3366FF",
368
+ "#3399CC",
369
+ "#3399FF",
370
+ "#33CC00",
371
+ "#33CC33",
372
+ "#33CC66",
373
+ "#33CC99",
374
+ "#33CCCC",
375
+ "#33CCFF",
376
+ "#6600CC",
377
+ "#6600FF",
378
+ "#6633CC",
379
+ "#6633FF",
380
+ "#66CC00",
381
+ "#66CC33",
382
+ "#9900CC",
383
+ "#9900FF",
384
+ "#9933CC",
385
+ "#9933FF",
386
+ "#99CC00",
387
+ "#99CC33",
388
+ "#CC0000",
389
+ "#CC0033",
390
+ "#CC0066",
391
+ "#CC0099",
392
+ "#CC00CC",
393
+ "#CC00FF",
394
+ "#CC3300",
395
+ "#CC3333",
396
+ "#CC3366",
397
+ "#CC3399",
398
+ "#CC33CC",
399
+ "#CC33FF",
400
+ "#CC6600",
401
+ "#CC6633",
402
+ "#CC9900",
403
+ "#CC9933",
404
+ "#CCCC00",
405
+ "#CCCC33",
406
+ "#FF0000",
407
+ "#FF0033",
408
+ "#FF0066",
409
+ "#FF0099",
410
+ "#FF00CC",
411
+ "#FF00FF",
412
+ "#FF3300",
413
+ "#FF3333",
414
+ "#FF3366",
415
+ "#FF3399",
416
+ "#FF33CC",
417
+ "#FF33FF",
418
+ "#FF6600",
419
+ "#FF6633",
420
+ "#FF9900",
421
+ "#FF9933",
422
+ "#FFCC00",
423
+ "#FFCC33"
424
+ ];
425
+ /**
426
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
427
+ * and the Firebug extension (any Firefox version) are known
428
+ * to support "%c" CSS customizations.
429
+ *
430
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
431
+ */
432
+ function useColors() {
433
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return true;
434
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
435
+ let m;
436
+ return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
437
+ }
438
+ /**
439
+ * Colorize log arguments if enabled.
440
+ *
441
+ * @api public
442
+ */
443
+ function formatArgs(args) {
444
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
445
+ if (!this.useColors) return;
446
+ const c = "color: " + this.color;
447
+ args.splice(1, 0, c, "color: inherit");
448
+ let index = 0;
449
+ let lastC = 0;
450
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
451
+ if (match === "%%") return;
452
+ index++;
453
+ if (match === "%c") lastC = index;
454
+ });
455
+ args.splice(lastC, 0, c);
456
+ }
457
+ /**
458
+ * Invokes `console.debug()` when available.
459
+ * No-op when `console.debug` is not a "function".
460
+ * If `console.debug` is not available, falls back
461
+ * to `console.log`.
462
+ *
463
+ * @api public
464
+ */
465
+ exports.log = console.debug || console.log || (() => {});
466
+ /**
467
+ * Save `namespaces`.
468
+ *
469
+ * @param {String} namespaces
470
+ * @api private
471
+ */
472
+ function save(namespaces) {
473
+ try {
474
+ if (namespaces) exports.storage.setItem("debug", namespaces);
475
+ else exports.storage.removeItem("debug");
476
+ } catch (error) {}
477
+ }
478
+ /**
479
+ * Load `namespaces`.
480
+ *
481
+ * @return {String} returns the previously persisted debug modes
482
+ * @api private
483
+ */
484
+ function load() {
485
+ let r;
486
+ try {
487
+ r = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
488
+ } catch (error) {}
489
+ if (!r && typeof process !== "undefined" && "env" in process) r = process.env.DEBUG;
490
+ return r;
491
+ }
492
+ /**
493
+ * Localstorage attempts to return the localstorage.
494
+ *
495
+ * This is necessary because safari throws
496
+ * when a user disables cookies/localstorage
497
+ * and you attempt to access it.
498
+ *
499
+ * @return {LocalStorage}
500
+ * @api private
501
+ */
502
+ function localstorage() {
503
+ try {
504
+ return localStorage;
505
+ } catch (error) {}
506
+ }
507
+ module.exports = require_common()(exports);
508
+ const { formatters } = module.exports;
509
+ /**
510
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
511
+ */
512
+ formatters.j = function(v) {
513
+ try {
514
+ return JSON.stringify(v);
515
+ } catch (error) {
516
+ return "[UnexpectedJSONParseError]: " + error.message;
517
+ }
518
+ };
519
+ }));
520
+
521
+ //#endregion
522
+ //#region ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js
523
+ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
524
+ /**
525
+ * Module dependencies.
526
+ */
527
+ const tty = __require("tty");
528
+ const util = __require("util");
529
+ /**
530
+ * This is the Node.js implementation of `debug()`.
531
+ */
532
+ exports.init = init;
533
+ exports.log = log;
534
+ exports.formatArgs = formatArgs;
535
+ exports.save = save;
536
+ exports.load = load;
537
+ exports.useColors = useColors;
538
+ exports.destroy = util.deprecate(() => {}, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
539
+ /**
540
+ * Colors.
541
+ */
542
+ exports.colors = [
543
+ 6,
544
+ 2,
545
+ 3,
546
+ 4,
547
+ 5,
548
+ 1
549
+ ];
550
+ try {
551
+ const supportsColor = __require("supports-color");
552
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
553
+ 20,
554
+ 21,
555
+ 26,
556
+ 27,
557
+ 32,
558
+ 33,
559
+ 38,
560
+ 39,
561
+ 40,
562
+ 41,
563
+ 42,
564
+ 43,
565
+ 44,
566
+ 45,
567
+ 56,
568
+ 57,
569
+ 62,
570
+ 63,
571
+ 68,
572
+ 69,
573
+ 74,
574
+ 75,
575
+ 76,
576
+ 77,
577
+ 78,
578
+ 79,
579
+ 80,
580
+ 81,
581
+ 92,
582
+ 93,
583
+ 98,
584
+ 99,
585
+ 112,
586
+ 113,
587
+ 128,
588
+ 129,
589
+ 134,
590
+ 135,
591
+ 148,
592
+ 149,
593
+ 160,
594
+ 161,
595
+ 162,
596
+ 163,
597
+ 164,
598
+ 165,
599
+ 166,
600
+ 167,
601
+ 168,
602
+ 169,
603
+ 170,
604
+ 171,
605
+ 172,
606
+ 173,
607
+ 178,
608
+ 179,
609
+ 184,
610
+ 185,
611
+ 196,
612
+ 197,
613
+ 198,
614
+ 199,
615
+ 200,
616
+ 201,
617
+ 202,
618
+ 203,
619
+ 204,
620
+ 205,
621
+ 206,
622
+ 207,
623
+ 208,
624
+ 209,
625
+ 214,
626
+ 215,
627
+ 220,
628
+ 221
629
+ ];
630
+ } catch (error) {}
631
+ /**
632
+ * Build up the default `inspectOpts` object from the environment variables.
633
+ *
634
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
635
+ */
636
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
637
+ return /^debug_/i.test(key);
638
+ }).reduce((obj, key) => {
639
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
640
+ return k.toUpperCase();
641
+ });
642
+ let val = process.env[key];
643
+ if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
644
+ else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
645
+ else if (val === "null") val = null;
646
+ else val = Number(val);
647
+ obj[prop] = val;
648
+ return obj;
649
+ }, {});
650
+ /**
651
+ * Is stdout a TTY? Colored output is enabled when `true`.
652
+ */
653
+ function useColors() {
654
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
655
+ }
656
+ /**
657
+ * Adds ANSI color escape codes if enabled.
658
+ *
659
+ * @api public
660
+ */
661
+ function formatArgs(args) {
662
+ const { namespace: name, useColors } = this;
663
+ if (useColors) {
664
+ const c = this.color;
665
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
666
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
667
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
668
+ args.push(colorCode + "m+" + module.exports.humanize(this.diff) + "\x1B[0m");
669
+ } else args[0] = getDate() + name + " " + args[0];
670
+ }
671
+ function getDate() {
672
+ if (exports.inspectOpts.hideDate) return "";
673
+ return (/* @__PURE__ */ new Date()).toISOString() + " ";
674
+ }
675
+ /**
676
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
677
+ */
678
+ function log(...args) {
679
+ return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + "\n");
680
+ }
681
+ /**
682
+ * Save `namespaces`.
683
+ *
684
+ * @param {String} namespaces
685
+ * @api private
686
+ */
687
+ function save(namespaces) {
688
+ if (namespaces) process.env.DEBUG = namespaces;
689
+ else delete process.env.DEBUG;
690
+ }
691
+ /**
692
+ * Load `namespaces`.
693
+ *
694
+ * @return {String} returns the previously persisted debug modes
695
+ * @api private
696
+ */
697
+ function load() {
698
+ return process.env.DEBUG;
699
+ }
700
+ /**
701
+ * Init logic for `debug` instances.
702
+ *
703
+ * Create a new `inspectOpts` object in case `useColors` is set
704
+ * differently for a particular `debug` instance.
705
+ */
706
+ function init(debug) {
707
+ debug.inspectOpts = {};
708
+ const keys = Object.keys(exports.inspectOpts);
709
+ for (let i = 0; i < keys.length; i++) debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
710
+ }
711
+ module.exports = require_common()(exports);
712
+ const { formatters } = module.exports;
713
+ /**
714
+ * Map %o to `util.inspect()`, all on a single line.
715
+ */
716
+ formatters.o = function(v) {
717
+ this.inspectOpts.colors = this.useColors;
718
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
719
+ };
720
+ /**
721
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
722
+ */
723
+ formatters.O = function(v) {
724
+ this.inspectOpts.colors = this.useColors;
725
+ return util.inspect(v, this.inspectOpts);
726
+ };
727
+ }));
728
+
729
+ //#endregion
730
+ //#region ../../node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js
731
+ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
732
+ /**
733
+ * Detect Electron renderer / nwjs process, which is node, but we should
734
+ * treat as a browser.
735
+ */
736
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) module.exports = require_browser();
737
+ else module.exports = require_node();
738
+ }));
739
+
740
+ //#endregion
741
+ //#region ../../node_modules/.bun/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js
742
+ var require_helpers = /* @__PURE__ */ __commonJSMin(((exports) => {
743
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
744
+ if (k2 === void 0) k2 = k;
745
+ var desc = Object.getOwnPropertyDescriptor(m, k);
746
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
747
+ enumerable: true,
748
+ get: function() {
749
+ return m[k];
750
+ }
751
+ };
752
+ Object.defineProperty(o, k2, desc);
753
+ }) : (function(o, m, k, k2) {
754
+ if (k2 === void 0) k2 = k;
755
+ o[k2] = m[k];
756
+ }));
757
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
758
+ Object.defineProperty(o, "default", {
759
+ enumerable: true,
760
+ value: v
761
+ });
762
+ }) : function(o, v) {
763
+ o["default"] = v;
764
+ });
765
+ var __importStar = exports && exports.__importStar || function(mod) {
766
+ if (mod && mod.__esModule) return mod;
767
+ var result = {};
768
+ if (mod != null) {
769
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
770
+ }
771
+ __setModuleDefault(result, mod);
772
+ return result;
773
+ };
774
+ Object.defineProperty(exports, "__esModule", { value: true });
775
+ exports.req = exports.json = exports.toBuffer = void 0;
776
+ const http$1 = __importStar(__require("http"));
777
+ const https = __importStar(__require("https"));
778
+ async function toBuffer(stream) {
779
+ let length = 0;
780
+ const chunks = [];
781
+ for await (const chunk of stream) {
782
+ length += chunk.length;
783
+ chunks.push(chunk);
784
+ }
785
+ return Buffer.concat(chunks, length);
786
+ }
787
+ exports.toBuffer = toBuffer;
788
+ async function json(stream) {
789
+ const str = (await toBuffer(stream)).toString("utf8");
790
+ try {
791
+ return JSON.parse(str);
792
+ } catch (_err) {
793
+ const err = _err;
794
+ err.message += ` (input: ${str})`;
795
+ throw err;
796
+ }
797
+ }
798
+ exports.json = json;
799
+ function req(url, opts = {}) {
800
+ const req = ((typeof url === "string" ? url : url.href).startsWith("https:") ? https : http$1).request(url, opts);
801
+ const promise = new Promise((resolve, reject) => {
802
+ req.once("response", resolve).once("error", reject).end();
803
+ });
804
+ req.then = promise.then.bind(promise);
805
+ return req;
806
+ }
807
+ exports.req = req;
808
+ }));
809
+
810
+ //#endregion
811
+ //#region ../../node_modules/.bun/agent-base@7.1.4/node_modules/agent-base/dist/index.js
812
+ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
813
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
814
+ if (k2 === void 0) k2 = k;
815
+ var desc = Object.getOwnPropertyDescriptor(m, k);
816
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
817
+ enumerable: true,
818
+ get: function() {
819
+ return m[k];
820
+ }
821
+ };
822
+ Object.defineProperty(o, k2, desc);
823
+ }) : (function(o, m, k, k2) {
824
+ if (k2 === void 0) k2 = k;
825
+ o[k2] = m[k];
826
+ }));
827
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
828
+ Object.defineProperty(o, "default", {
829
+ enumerable: true,
830
+ value: v
831
+ });
832
+ }) : function(o, v) {
833
+ o["default"] = v;
834
+ });
835
+ var __importStar = exports && exports.__importStar || function(mod) {
836
+ if (mod && mod.__esModule) return mod;
837
+ var result = {};
838
+ if (mod != null) {
839
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
840
+ }
841
+ __setModuleDefault(result, mod);
842
+ return result;
843
+ };
844
+ var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
845
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
846
+ };
847
+ Object.defineProperty(exports, "__esModule", { value: true });
848
+ exports.Agent = void 0;
849
+ const net$1 = __importStar(__require("net"));
850
+ const http = __importStar(__require("http"));
851
+ const https_1 = __require("https");
852
+ __exportStar(require_helpers(), exports);
853
+ const INTERNAL = Symbol("AgentBaseInternalState");
854
+ var Agent = class extends http.Agent {
855
+ constructor(opts) {
856
+ super(opts);
857
+ this[INTERNAL] = {};
858
+ }
859
+ /**
860
+ * Determine whether this is an `http` or `https` request.
861
+ */
862
+ isSecureEndpoint(options) {
863
+ if (options) {
864
+ if (typeof options.secureEndpoint === "boolean") return options.secureEndpoint;
865
+ if (typeof options.protocol === "string") return options.protocol === "https:";
866
+ }
867
+ const { stack } = /* @__PURE__ */ new Error();
868
+ if (typeof stack !== "string") return false;
869
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
870
+ }
871
+ incrementSockets(name) {
872
+ if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) return null;
873
+ if (!this.sockets[name]) this.sockets[name] = [];
874
+ const fakeSocket = new net$1.Socket({ writable: false });
875
+ this.sockets[name].push(fakeSocket);
876
+ this.totalSocketCount++;
877
+ return fakeSocket;
878
+ }
879
+ decrementSockets(name, socket) {
880
+ if (!this.sockets[name] || socket === null) return;
881
+ const sockets = this.sockets[name];
882
+ const index = sockets.indexOf(socket);
883
+ if (index !== -1) {
884
+ sockets.splice(index, 1);
885
+ this.totalSocketCount--;
886
+ if (sockets.length === 0) delete this.sockets[name];
887
+ }
888
+ }
889
+ getName(options) {
890
+ if (this.isSecureEndpoint(options)) return https_1.Agent.prototype.getName.call(this, options);
891
+ return super.getName(options);
892
+ }
893
+ createSocket(req, options, cb) {
894
+ const connectOpts = {
895
+ ...options,
896
+ secureEndpoint: this.isSecureEndpoint(options)
897
+ };
898
+ const name = this.getName(connectOpts);
899
+ const fakeSocket = this.incrementSockets(name);
900
+ Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
901
+ this.decrementSockets(name, fakeSocket);
902
+ if (socket instanceof http.Agent) try {
903
+ return socket.addRequest(req, connectOpts);
904
+ } catch (err) {
905
+ return cb(err);
906
+ }
907
+ this[INTERNAL].currentSocket = socket;
908
+ super.createSocket(req, options, cb);
909
+ }, (err) => {
910
+ this.decrementSockets(name, fakeSocket);
911
+ cb(err);
912
+ });
913
+ }
914
+ createConnection() {
915
+ const socket = this[INTERNAL].currentSocket;
916
+ this[INTERNAL].currentSocket = void 0;
917
+ if (!socket) throw new Error("No socket was returned in the `connect()` function");
918
+ return socket;
919
+ }
920
+ get defaultPort() {
921
+ return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
922
+ }
923
+ set defaultPort(v) {
924
+ if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
925
+ }
926
+ get protocol() {
927
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
928
+ }
929
+ set protocol(v) {
930
+ if (this[INTERNAL]) this[INTERNAL].protocol = v;
931
+ }
932
+ };
933
+ exports.Agent = Agent;
934
+ }));
935
+
936
+ //#endregion
937
+ //#region ../../node_modules/.bun/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js
938
+ var require_parse_proxy_response = /* @__PURE__ */ __commonJSMin(((exports) => {
939
+ var __importDefault = exports && exports.__importDefault || function(mod) {
940
+ return mod && mod.__esModule ? mod : { "default": mod };
941
+ };
942
+ Object.defineProperty(exports, "__esModule", { value: true });
943
+ exports.parseProxyResponse = void 0;
944
+ const debug = (0, __importDefault(require_src()).default)("https-proxy-agent:parse-proxy-response");
945
+ function parseProxyResponse(socket) {
946
+ return new Promise((resolve, reject) => {
947
+ let buffersLength = 0;
948
+ const buffers = [];
949
+ function read() {
950
+ const b = socket.read();
951
+ if (b) ondata(b);
952
+ else socket.once("readable", read);
953
+ }
954
+ function cleanup() {
955
+ socket.removeListener("end", onend);
956
+ socket.removeListener("error", onerror);
957
+ socket.removeListener("readable", read);
958
+ }
959
+ function onend() {
960
+ cleanup();
961
+ debug("onend");
962
+ reject(/* @__PURE__ */ new Error("Proxy connection ended before receiving CONNECT response"));
963
+ }
964
+ function onerror(err) {
965
+ cleanup();
966
+ debug("onerror %o", err);
967
+ reject(err);
968
+ }
969
+ function ondata(b) {
970
+ buffers.push(b);
971
+ buffersLength += b.length;
972
+ const buffered = Buffer.concat(buffers, buffersLength);
973
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
974
+ if (endOfHeaders === -1) {
975
+ debug("have not received end of HTTP headers yet...");
976
+ read();
977
+ return;
978
+ }
979
+ const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
980
+ const firstLine = headerParts.shift();
981
+ if (!firstLine) {
982
+ socket.destroy();
983
+ return reject(/* @__PURE__ */ new Error("No header received from proxy CONNECT response"));
984
+ }
985
+ const firstLineParts = firstLine.split(" ");
986
+ const statusCode = +firstLineParts[1];
987
+ const statusText = firstLineParts.slice(2).join(" ");
988
+ const headers = {};
989
+ for (const header of headerParts) {
990
+ if (!header) continue;
991
+ const firstColon = header.indexOf(":");
992
+ if (firstColon === -1) {
993
+ socket.destroy();
994
+ return reject(/* @__PURE__ */ new Error(`Invalid header from proxy CONNECT response: "${header}"`));
995
+ }
996
+ const key = header.slice(0, firstColon).toLowerCase();
997
+ const value = header.slice(firstColon + 1).trimStart();
998
+ const current = headers[key];
999
+ if (typeof current === "string") headers[key] = [current, value];
1000
+ else if (Array.isArray(current)) current.push(value);
1001
+ else headers[key] = value;
1002
+ }
1003
+ debug("got proxy server response: %o %o", firstLine, headers);
1004
+ cleanup();
1005
+ resolve({
1006
+ connect: {
1007
+ statusCode,
1008
+ statusText,
1009
+ headers
1010
+ },
1011
+ buffered
1012
+ });
1013
+ }
1014
+ socket.on("error", onerror);
1015
+ socket.on("end", onend);
1016
+ read();
1017
+ });
1018
+ }
1019
+ exports.parseProxyResponse = parseProxyResponse;
1020
+ }));
1021
+
1022
+ //#endregion
1023
+ //#region ../../node_modules/.bun/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js
1024
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
1025
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
1026
+ if (k2 === void 0) k2 = k;
1027
+ var desc = Object.getOwnPropertyDescriptor(m, k);
1028
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
1029
+ enumerable: true,
1030
+ get: function() {
1031
+ return m[k];
1032
+ }
1033
+ };
1034
+ Object.defineProperty(o, k2, desc);
1035
+ }) : (function(o, m, k, k2) {
1036
+ if (k2 === void 0) k2 = k;
1037
+ o[k2] = m[k];
1038
+ }));
1039
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
1040
+ Object.defineProperty(o, "default", {
1041
+ enumerable: true,
1042
+ value: v
1043
+ });
1044
+ }) : function(o, v) {
1045
+ o["default"] = v;
1046
+ });
1047
+ var __importStar = exports && exports.__importStar || function(mod) {
1048
+ if (mod && mod.__esModule) return mod;
1049
+ var result = {};
1050
+ if (mod != null) {
1051
+ for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
1052
+ }
1053
+ __setModuleDefault(result, mod);
1054
+ return result;
1055
+ };
1056
+ var __importDefault = exports && exports.__importDefault || function(mod) {
1057
+ return mod && mod.__esModule ? mod : { "default": mod };
1058
+ };
1059
+ Object.defineProperty(exports, "__esModule", { value: true });
1060
+ exports.HttpsProxyAgent = void 0;
1061
+ const net = __importStar(__require("net"));
1062
+ const tls = __importStar(__require("tls"));
1063
+ const assert_1 = __importDefault(__require("assert"));
1064
+ const debug_1 = __importDefault(require_src());
1065
+ const agent_base_1 = require_dist$1();
1066
+ const url_1 = __require("url");
1067
+ const parse_proxy_response_1 = require_parse_proxy_response();
1068
+ const debug = (0, debug_1.default)("https-proxy-agent");
1069
+ const setServernameFromNonIpHost = (options) => {
1070
+ if (options.servername === void 0 && options.host && !net.isIP(options.host)) return {
1071
+ ...options,
1072
+ servername: options.host
1073
+ };
1074
+ return options;
1075
+ };
1076
+ /**
1077
+ * The `HttpsProxyAgent` implements an HTTP Agent subclass that connects to
1078
+ * the specified "HTTP(s) proxy server" in order to proxy HTTPS requests.
1079
+ *
1080
+ * Outgoing HTTP requests are first tunneled through the proxy server using the
1081
+ * `CONNECT` HTTP request method to establish a connection to the proxy server,
1082
+ * and then the proxy server connects to the destination target and issues the
1083
+ * HTTP request from the proxy server.
1084
+ *
1085
+ * `https:` requests have their socket connection upgraded to TLS once
1086
+ * the connection to the proxy server has been established.
1087
+ */
1088
+ var HttpsProxyAgent = class extends agent_base_1.Agent {
1089
+ constructor(proxy, opts) {
1090
+ super(opts);
1091
+ this.options = { path: void 0 };
1092
+ this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
1093
+ this.proxyHeaders = opts?.headers ?? {};
1094
+ debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
1095
+ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
1096
+ const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
1097
+ this.connectOpts = {
1098
+ ALPNProtocols: ["http/1.1"],
1099
+ ...opts ? omit(opts, "headers") : null,
1100
+ host,
1101
+ port
1102
+ };
1103
+ }
1104
+ /**
1105
+ * Called when the node-core HTTP client library is creating a
1106
+ * new HTTP request.
1107
+ */
1108
+ async connect(req, opts) {
1109
+ const { proxy } = this;
1110
+ if (!opts.host) throw new TypeError("No \"host\" provided");
1111
+ let socket;
1112
+ if (proxy.protocol === "https:") {
1113
+ debug("Creating `tls.Socket`: %o", this.connectOpts);
1114
+ socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
1115
+ } else {
1116
+ debug("Creating `net.Socket`: %o", this.connectOpts);
1117
+ socket = net.connect(this.connectOpts);
1118
+ }
1119
+ const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
1120
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
1121
+ let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
1122
+ if (proxy.username || proxy.password) {
1123
+ const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
1124
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
1125
+ }
1126
+ headers.Host = `${host}:${opts.port}`;
1127
+ if (!headers["Proxy-Connection"]) headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
1128
+ for (const name of Object.keys(headers)) payload += `${name}: ${headers[name]}\r\n`;
1129
+ const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
1130
+ socket.write(`${payload}\r\n`);
1131
+ const { connect, buffered } = await proxyResponsePromise;
1132
+ req.emit("proxyConnect", connect);
1133
+ this.emit("proxyConnect", connect, req);
1134
+ if (connect.statusCode === 200) {
1135
+ req.once("socket", resume);
1136
+ if (opts.secureEndpoint) {
1137
+ debug("Upgrading socket connection to TLS");
1138
+ return tls.connect({
1139
+ ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
1140
+ socket
1141
+ });
1142
+ }
1143
+ return socket;
1144
+ }
1145
+ socket.destroy();
1146
+ const fakeSocket = new net.Socket({ writable: false });
1147
+ fakeSocket.readable = true;
1148
+ req.once("socket", (s) => {
1149
+ debug("Replaying proxy buffer for failed request");
1150
+ (0, assert_1.default)(s.listenerCount("data") > 0);
1151
+ s.push(buffered);
1152
+ s.push(null);
1153
+ });
1154
+ return fakeSocket;
1155
+ }
1156
+ };
1157
+ HttpsProxyAgent.protocols = ["http", "https"];
1158
+ exports.HttpsProxyAgent = HttpsProxyAgent;
1159
+ function resume(socket) {
1160
+ socket.resume();
1161
+ }
1162
+ function omit(obj, ...keys) {
1163
+ const ret = {};
1164
+ let key;
1165
+ for (key in obj) if (!keys.includes(key)) ret[key] = obj[key];
1166
+ return ret;
1167
+ }
1168
+ }));
1169
+
1170
+ //#endregion
1171
+ export default require_dist();
1172
+
1173
+ export { };
1174
+ //# sourceMappingURL=dist-CtJ4Bmgn.js.map