@dxos/hypercore 0.1.49 → 0.1.50-next.1bfebf8

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.
@@ -603,7 +603,7 @@ var require_inherits_browser = __commonJS({
603
603
  var require_inherits = __commonJS({
604
604
  "node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports, module2) {
605
605
  try {
606
- util2 = require("util");
606
+ util2 = require("node:util");
607
607
  if (typeof util2.inherits !== "function")
608
608
  throw "";
609
609
  module2.exports = util2.inherits;
@@ -2425,7 +2425,7 @@ var require_hypercore_crypto = __commonJS({
2425
2425
  // node_modules/.pnpm/inspect-custom-symbol@1.1.1/node_modules/inspect-custom-symbol/index.js
2426
2426
  var require_inspect_custom_symbol = __commonJS({
2427
2427
  "node_modules/.pnpm/inspect-custom-symbol@1.1.1/node_modules/inspect-custom-symbol/index.js"(exports, module2) {
2428
- var util2 = require("util");
2428
+ var util2 = require("node:util");
2429
2429
  var custom = util2.inspect.custom;
2430
2430
  module2.exports = custom || Symbol.for("nodejs.util.inspect.custom");
2431
2431
  }
@@ -6228,7 +6228,7 @@ var require_browser = __commonJS({
6228
6228
  // node_modules/.pnpm/timeout-refresh@1.0.3/node_modules/timeout-refresh/timers.js
6229
6229
  var require_timers = __commonJS({
6230
6230
  "node_modules/.pnpm/timeout-refresh@1.0.3/node_modules/timeout-refresh/timers.js"(exports, module2) {
6231
- var timers = require("timers");
6231
+ var timers = require("node:timers");
6232
6232
  var enroll = timers.enroll || noop;
6233
6233
  var active = timers._unrefActive || timers.active || noop;
6234
6234
  var unenroll = timers.unenroll || noop;
@@ -6423,6 +6423,762 @@ var require_abstract_extension = __commonJS({
6423
6423
  }
6424
6424
  });
6425
6425
 
6426
+ // node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js
6427
+ var require_ms = __commonJS({
6428
+ "node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js"(exports, module2) {
6429
+ var s = 1e3;
6430
+ var m = s * 60;
6431
+ var h = m * 60;
6432
+ var d = h * 24;
6433
+ var w = d * 7;
6434
+ var y = d * 365.25;
6435
+ module2.exports = function(val, options) {
6436
+ options = options || {};
6437
+ var type = typeof val;
6438
+ if (type === "string" && val.length > 0) {
6439
+ return parse(val);
6440
+ } else if (type === "number" && isFinite(val)) {
6441
+ return options.long ? fmtLong(val) : fmtShort(val);
6442
+ }
6443
+ throw new Error(
6444
+ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
6445
+ );
6446
+ };
6447
+ function parse(str) {
6448
+ str = String(str);
6449
+ if (str.length > 100) {
6450
+ return;
6451
+ }
6452
+ 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(
6453
+ str
6454
+ );
6455
+ if (!match) {
6456
+ return;
6457
+ }
6458
+ var n = parseFloat(match[1]);
6459
+ var type = (match[2] || "ms").toLowerCase();
6460
+ switch (type) {
6461
+ case "years":
6462
+ case "year":
6463
+ case "yrs":
6464
+ case "yr":
6465
+ case "y":
6466
+ return n * y;
6467
+ case "weeks":
6468
+ case "week":
6469
+ case "w":
6470
+ return n * w;
6471
+ case "days":
6472
+ case "day":
6473
+ case "d":
6474
+ return n * d;
6475
+ case "hours":
6476
+ case "hour":
6477
+ case "hrs":
6478
+ case "hr":
6479
+ case "h":
6480
+ return n * h;
6481
+ case "minutes":
6482
+ case "minute":
6483
+ case "mins":
6484
+ case "min":
6485
+ case "m":
6486
+ return n * m;
6487
+ case "seconds":
6488
+ case "second":
6489
+ case "secs":
6490
+ case "sec":
6491
+ case "s":
6492
+ return n * s;
6493
+ case "milliseconds":
6494
+ case "millisecond":
6495
+ case "msecs":
6496
+ case "msec":
6497
+ case "ms":
6498
+ return n;
6499
+ default:
6500
+ return void 0;
6501
+ }
6502
+ }
6503
+ function fmtShort(ms) {
6504
+ var msAbs = Math.abs(ms);
6505
+ if (msAbs >= d) {
6506
+ return Math.round(ms / d) + "d";
6507
+ }
6508
+ if (msAbs >= h) {
6509
+ return Math.round(ms / h) + "h";
6510
+ }
6511
+ if (msAbs >= m) {
6512
+ return Math.round(ms / m) + "m";
6513
+ }
6514
+ if (msAbs >= s) {
6515
+ return Math.round(ms / s) + "s";
6516
+ }
6517
+ return ms + "ms";
6518
+ }
6519
+ function fmtLong(ms) {
6520
+ var msAbs = Math.abs(ms);
6521
+ if (msAbs >= d) {
6522
+ return plural(ms, msAbs, d, "day");
6523
+ }
6524
+ if (msAbs >= h) {
6525
+ return plural(ms, msAbs, h, "hour");
6526
+ }
6527
+ if (msAbs >= m) {
6528
+ return plural(ms, msAbs, m, "minute");
6529
+ }
6530
+ if (msAbs >= s) {
6531
+ return plural(ms, msAbs, s, "second");
6532
+ }
6533
+ return ms + " ms";
6534
+ }
6535
+ function plural(ms, msAbs, n, name) {
6536
+ var isPlural = msAbs >= n * 1.5;
6537
+ return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
6538
+ }
6539
+ }
6540
+ });
6541
+
6542
+ // node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js
6543
+ var require_common = __commonJS({
6544
+ "node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/common.js"(exports, module2) {
6545
+ function setup(env) {
6546
+ createDebug.debug = createDebug;
6547
+ createDebug.default = createDebug;
6548
+ createDebug.coerce = coerce;
6549
+ createDebug.disable = disable;
6550
+ createDebug.enable = enable;
6551
+ createDebug.enabled = enabled;
6552
+ createDebug.humanize = require_ms();
6553
+ createDebug.destroy = destroy;
6554
+ Object.keys(env).forEach((key) => {
6555
+ createDebug[key] = env[key];
6556
+ });
6557
+ createDebug.names = [];
6558
+ createDebug.skips = [];
6559
+ createDebug.formatters = {};
6560
+ function selectColor(namespace) {
6561
+ let hash = 0;
6562
+ for (let i = 0; i < namespace.length; i++) {
6563
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
6564
+ hash |= 0;
6565
+ }
6566
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
6567
+ }
6568
+ createDebug.selectColor = selectColor;
6569
+ function createDebug(namespace) {
6570
+ let prevTime;
6571
+ let enableOverride = null;
6572
+ let namespacesCache;
6573
+ let enabledCache;
6574
+ function debug(...args) {
6575
+ if (!debug.enabled) {
6576
+ return;
6577
+ }
6578
+ const self = debug;
6579
+ const curr = Number(new Date());
6580
+ const ms = curr - (prevTime || curr);
6581
+ self.diff = ms;
6582
+ self.prev = prevTime;
6583
+ self.curr = curr;
6584
+ prevTime = curr;
6585
+ args[0] = createDebug.coerce(args[0]);
6586
+ if (typeof args[0] !== "string") {
6587
+ args.unshift("%O");
6588
+ }
6589
+ let index = 0;
6590
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
6591
+ if (match === "%%") {
6592
+ return "%";
6593
+ }
6594
+ index++;
6595
+ const formatter = createDebug.formatters[format];
6596
+ if (typeof formatter === "function") {
6597
+ const val = args[index];
6598
+ match = formatter.call(self, val);
6599
+ args.splice(index, 1);
6600
+ index--;
6601
+ }
6602
+ return match;
6603
+ });
6604
+ createDebug.formatArgs.call(self, args);
6605
+ const logFn = self.log || createDebug.log;
6606
+ logFn.apply(self, args);
6607
+ }
6608
+ debug.namespace = namespace;
6609
+ debug.useColors = createDebug.useColors();
6610
+ debug.color = createDebug.selectColor(namespace);
6611
+ debug.extend = extend;
6612
+ debug.destroy = createDebug.destroy;
6613
+ Object.defineProperty(debug, "enabled", {
6614
+ enumerable: true,
6615
+ configurable: false,
6616
+ get: () => {
6617
+ if (enableOverride !== null) {
6618
+ return enableOverride;
6619
+ }
6620
+ if (namespacesCache !== createDebug.namespaces) {
6621
+ namespacesCache = createDebug.namespaces;
6622
+ enabledCache = createDebug.enabled(namespace);
6623
+ }
6624
+ return enabledCache;
6625
+ },
6626
+ set: (v) => {
6627
+ enableOverride = v;
6628
+ }
6629
+ });
6630
+ if (typeof createDebug.init === "function") {
6631
+ createDebug.init(debug);
6632
+ }
6633
+ return debug;
6634
+ }
6635
+ function extend(namespace, delimiter) {
6636
+ const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
6637
+ newDebug.log = this.log;
6638
+ return newDebug;
6639
+ }
6640
+ function enable(namespaces) {
6641
+ createDebug.save(namespaces);
6642
+ createDebug.namespaces = namespaces;
6643
+ createDebug.names = [];
6644
+ createDebug.skips = [];
6645
+ let i;
6646
+ const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
6647
+ const len = split.length;
6648
+ for (i = 0; i < len; i++) {
6649
+ if (!split[i]) {
6650
+ continue;
6651
+ }
6652
+ namespaces = split[i].replace(/\*/g, ".*?");
6653
+ if (namespaces[0] === "-") {
6654
+ createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
6655
+ } else {
6656
+ createDebug.names.push(new RegExp("^" + namespaces + "$"));
6657
+ }
6658
+ }
6659
+ }
6660
+ function disable() {
6661
+ const namespaces = [
6662
+ ...createDebug.names.map(toNamespace),
6663
+ ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
6664
+ ].join(",");
6665
+ createDebug.enable("");
6666
+ return namespaces;
6667
+ }
6668
+ function enabled(name) {
6669
+ if (name[name.length - 1] === "*") {
6670
+ return true;
6671
+ }
6672
+ let i;
6673
+ let len;
6674
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
6675
+ if (createDebug.skips[i].test(name)) {
6676
+ return false;
6677
+ }
6678
+ }
6679
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
6680
+ if (createDebug.names[i].test(name)) {
6681
+ return true;
6682
+ }
6683
+ }
6684
+ return false;
6685
+ }
6686
+ function toNamespace(regexp) {
6687
+ return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
6688
+ }
6689
+ function coerce(val) {
6690
+ if (val instanceof Error) {
6691
+ return val.stack || val.message;
6692
+ }
6693
+ return val;
6694
+ }
6695
+ function destroy() {
6696
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
6697
+ }
6698
+ createDebug.enable(createDebug.load());
6699
+ return createDebug;
6700
+ }
6701
+ module2.exports = setup;
6702
+ }
6703
+ });
6704
+
6705
+ // node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js
6706
+ var require_browser2 = __commonJS({
6707
+ "node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/browser.js"(exports, module2) {
6708
+ exports.formatArgs = formatArgs;
6709
+ exports.save = save;
6710
+ exports.load = load;
6711
+ exports.useColors = useColors;
6712
+ exports.storage = localstorage();
6713
+ exports.destroy = (() => {
6714
+ let warned = false;
6715
+ return () => {
6716
+ if (!warned) {
6717
+ warned = true;
6718
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
6719
+ }
6720
+ };
6721
+ })();
6722
+ exports.colors = [
6723
+ "#0000CC",
6724
+ "#0000FF",
6725
+ "#0033CC",
6726
+ "#0033FF",
6727
+ "#0066CC",
6728
+ "#0066FF",
6729
+ "#0099CC",
6730
+ "#0099FF",
6731
+ "#00CC00",
6732
+ "#00CC33",
6733
+ "#00CC66",
6734
+ "#00CC99",
6735
+ "#00CCCC",
6736
+ "#00CCFF",
6737
+ "#3300CC",
6738
+ "#3300FF",
6739
+ "#3333CC",
6740
+ "#3333FF",
6741
+ "#3366CC",
6742
+ "#3366FF",
6743
+ "#3399CC",
6744
+ "#3399FF",
6745
+ "#33CC00",
6746
+ "#33CC33",
6747
+ "#33CC66",
6748
+ "#33CC99",
6749
+ "#33CCCC",
6750
+ "#33CCFF",
6751
+ "#6600CC",
6752
+ "#6600FF",
6753
+ "#6633CC",
6754
+ "#6633FF",
6755
+ "#66CC00",
6756
+ "#66CC33",
6757
+ "#9900CC",
6758
+ "#9900FF",
6759
+ "#9933CC",
6760
+ "#9933FF",
6761
+ "#99CC00",
6762
+ "#99CC33",
6763
+ "#CC0000",
6764
+ "#CC0033",
6765
+ "#CC0066",
6766
+ "#CC0099",
6767
+ "#CC00CC",
6768
+ "#CC00FF",
6769
+ "#CC3300",
6770
+ "#CC3333",
6771
+ "#CC3366",
6772
+ "#CC3399",
6773
+ "#CC33CC",
6774
+ "#CC33FF",
6775
+ "#CC6600",
6776
+ "#CC6633",
6777
+ "#CC9900",
6778
+ "#CC9933",
6779
+ "#CCCC00",
6780
+ "#CCCC33",
6781
+ "#FF0000",
6782
+ "#FF0033",
6783
+ "#FF0066",
6784
+ "#FF0099",
6785
+ "#FF00CC",
6786
+ "#FF00FF",
6787
+ "#FF3300",
6788
+ "#FF3333",
6789
+ "#FF3366",
6790
+ "#FF3399",
6791
+ "#FF33CC",
6792
+ "#FF33FF",
6793
+ "#FF6600",
6794
+ "#FF6633",
6795
+ "#FF9900",
6796
+ "#FF9933",
6797
+ "#FFCC00",
6798
+ "#FFCC33"
6799
+ ];
6800
+ function useColors() {
6801
+ if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
6802
+ return true;
6803
+ }
6804
+ if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
6805
+ return false;
6806
+ }
6807
+ 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 && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
6808
+ }
6809
+ function formatArgs(args) {
6810
+ args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
6811
+ if (!this.useColors) {
6812
+ return;
6813
+ }
6814
+ const c = "color: " + this.color;
6815
+ args.splice(1, 0, c, "color: inherit");
6816
+ let index = 0;
6817
+ let lastC = 0;
6818
+ args[0].replace(/%[a-zA-Z%]/g, (match) => {
6819
+ if (match === "%%") {
6820
+ return;
6821
+ }
6822
+ index++;
6823
+ if (match === "%c") {
6824
+ lastC = index;
6825
+ }
6826
+ });
6827
+ args.splice(lastC, 0, c);
6828
+ }
6829
+ exports.log = console.debug || console.log || (() => {
6830
+ });
6831
+ function save(namespaces) {
6832
+ try {
6833
+ if (namespaces) {
6834
+ exports.storage.setItem("debug", namespaces);
6835
+ } else {
6836
+ exports.storage.removeItem("debug");
6837
+ }
6838
+ } catch (error) {
6839
+ }
6840
+ }
6841
+ function load() {
6842
+ let r;
6843
+ try {
6844
+ r = exports.storage.getItem("debug");
6845
+ } catch (error) {
6846
+ }
6847
+ if (!r && typeof process !== "undefined" && "env" in process) {
6848
+ r = process.env.DEBUG;
6849
+ }
6850
+ return r;
6851
+ }
6852
+ function localstorage() {
6853
+ try {
6854
+ return localStorage;
6855
+ } catch (error) {
6856
+ }
6857
+ }
6858
+ module2.exports = require_common()(exports);
6859
+ var { formatters } = module2.exports;
6860
+ formatters.j = function(v) {
6861
+ try {
6862
+ return JSON.stringify(v);
6863
+ } catch (error) {
6864
+ return "[UnexpectedJSONParseError]: " + error.message;
6865
+ }
6866
+ };
6867
+ }
6868
+ });
6869
+
6870
+ // node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js
6871
+ var require_has_flag = __commonJS({
6872
+ "node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports, module2) {
6873
+ "use strict";
6874
+ module2.exports = (flag, argv = process.argv) => {
6875
+ const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
6876
+ const position = argv.indexOf(prefix + flag);
6877
+ const terminatorPosition = argv.indexOf("--");
6878
+ return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
6879
+ };
6880
+ }
6881
+ });
6882
+
6883
+ // node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js
6884
+ var require_supports_color = __commonJS({
6885
+ "node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js"(exports, module2) {
6886
+ "use strict";
6887
+ var os = require("node:os");
6888
+ var tty = require("node:tty");
6889
+ var hasFlag = require_has_flag();
6890
+ var { env } = process;
6891
+ var flagForceColor;
6892
+ if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
6893
+ flagForceColor = 0;
6894
+ } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
6895
+ flagForceColor = 1;
6896
+ }
6897
+ function envForceColor() {
6898
+ if ("FORCE_COLOR" in env) {
6899
+ if (env.FORCE_COLOR === "true") {
6900
+ return 1;
6901
+ }
6902
+ if (env.FORCE_COLOR === "false") {
6903
+ return 0;
6904
+ }
6905
+ return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
6906
+ }
6907
+ }
6908
+ function translateLevel(level) {
6909
+ if (level === 0) {
6910
+ return false;
6911
+ }
6912
+ return {
6913
+ level,
6914
+ hasBasic: true,
6915
+ has256: level >= 2,
6916
+ has16m: level >= 3
6917
+ };
6918
+ }
6919
+ function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
6920
+ const noFlagForceColor = envForceColor();
6921
+ if (noFlagForceColor !== void 0) {
6922
+ flagForceColor = noFlagForceColor;
6923
+ }
6924
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
6925
+ if (forceColor === 0) {
6926
+ return 0;
6927
+ }
6928
+ if (sniffFlags) {
6929
+ if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
6930
+ return 3;
6931
+ }
6932
+ if (hasFlag("color=256")) {
6933
+ return 2;
6934
+ }
6935
+ }
6936
+ if (haveStream && !streamIsTTY && forceColor === void 0) {
6937
+ return 0;
6938
+ }
6939
+ const min = forceColor || 0;
6940
+ if (env.TERM === "dumb") {
6941
+ return min;
6942
+ }
6943
+ if (process.platform === "win32") {
6944
+ const osRelease = os.release().split(".");
6945
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
6946
+ return Number(osRelease[2]) >= 14931 ? 3 : 2;
6947
+ }
6948
+ return 1;
6949
+ }
6950
+ if ("CI" in env) {
6951
+ if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
6952
+ return 1;
6953
+ }
6954
+ return min;
6955
+ }
6956
+ if ("TEAMCITY_VERSION" in env) {
6957
+ return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
6958
+ }
6959
+ if (env.COLORTERM === "truecolor") {
6960
+ return 3;
6961
+ }
6962
+ if ("TERM_PROGRAM" in env) {
6963
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
6964
+ switch (env.TERM_PROGRAM) {
6965
+ case "iTerm.app":
6966
+ return version >= 3 ? 3 : 2;
6967
+ case "Apple_Terminal":
6968
+ return 2;
6969
+ }
6970
+ }
6971
+ if (/-256(color)?$/i.test(env.TERM)) {
6972
+ return 2;
6973
+ }
6974
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
6975
+ return 1;
6976
+ }
6977
+ if ("COLORTERM" in env) {
6978
+ return 1;
6979
+ }
6980
+ return min;
6981
+ }
6982
+ function getSupportLevel(stream, options = {}) {
6983
+ const level = supportsColor(stream, {
6984
+ streamIsTTY: stream && stream.isTTY,
6985
+ ...options
6986
+ });
6987
+ return translateLevel(level);
6988
+ }
6989
+ module2.exports = {
6990
+ supportsColor: getSupportLevel,
6991
+ stdout: getSupportLevel({ isTTY: tty.isatty(1) }),
6992
+ stderr: getSupportLevel({ isTTY: tty.isatty(2) })
6993
+ };
6994
+ }
6995
+ });
6996
+
6997
+ // node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js
6998
+ var require_node = __commonJS({
6999
+ "node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/node.js"(exports, module2) {
7000
+ var tty = require("node:tty");
7001
+ var util2 = require("node:util");
7002
+ exports.init = init;
7003
+ exports.log = log;
7004
+ exports.formatArgs = formatArgs;
7005
+ exports.save = save;
7006
+ exports.load = load;
7007
+ exports.useColors = useColors;
7008
+ exports.destroy = util2.deprecate(
7009
+ () => {
7010
+ },
7011
+ "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
7012
+ );
7013
+ exports.colors = [6, 2, 3, 4, 5, 1];
7014
+ try {
7015
+ const supportsColor = require_supports_color();
7016
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
7017
+ exports.colors = [
7018
+ 20,
7019
+ 21,
7020
+ 26,
7021
+ 27,
7022
+ 32,
7023
+ 33,
7024
+ 38,
7025
+ 39,
7026
+ 40,
7027
+ 41,
7028
+ 42,
7029
+ 43,
7030
+ 44,
7031
+ 45,
7032
+ 56,
7033
+ 57,
7034
+ 62,
7035
+ 63,
7036
+ 68,
7037
+ 69,
7038
+ 74,
7039
+ 75,
7040
+ 76,
7041
+ 77,
7042
+ 78,
7043
+ 79,
7044
+ 80,
7045
+ 81,
7046
+ 92,
7047
+ 93,
7048
+ 98,
7049
+ 99,
7050
+ 112,
7051
+ 113,
7052
+ 128,
7053
+ 129,
7054
+ 134,
7055
+ 135,
7056
+ 148,
7057
+ 149,
7058
+ 160,
7059
+ 161,
7060
+ 162,
7061
+ 163,
7062
+ 164,
7063
+ 165,
7064
+ 166,
7065
+ 167,
7066
+ 168,
7067
+ 169,
7068
+ 170,
7069
+ 171,
7070
+ 172,
7071
+ 173,
7072
+ 178,
7073
+ 179,
7074
+ 184,
7075
+ 185,
7076
+ 196,
7077
+ 197,
7078
+ 198,
7079
+ 199,
7080
+ 200,
7081
+ 201,
7082
+ 202,
7083
+ 203,
7084
+ 204,
7085
+ 205,
7086
+ 206,
7087
+ 207,
7088
+ 208,
7089
+ 209,
7090
+ 214,
7091
+ 215,
7092
+ 220,
7093
+ 221
7094
+ ];
7095
+ }
7096
+ } catch (error) {
7097
+ }
7098
+ exports.inspectOpts = Object.keys(process.env).filter((key) => {
7099
+ return /^debug_/i.test(key);
7100
+ }).reduce((obj, key) => {
7101
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
7102
+ return k.toUpperCase();
7103
+ });
7104
+ let val = process.env[key];
7105
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
7106
+ val = true;
7107
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
7108
+ val = false;
7109
+ } else if (val === "null") {
7110
+ val = null;
7111
+ } else {
7112
+ val = Number(val);
7113
+ }
7114
+ obj[prop] = val;
7115
+ return obj;
7116
+ }, {});
7117
+ function useColors() {
7118
+ return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
7119
+ }
7120
+ function formatArgs(args) {
7121
+ const { namespace: name, useColors: useColors2 } = this;
7122
+ if (useColors2) {
7123
+ const c = this.color;
7124
+ const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
7125
+ const prefix = ` ${colorCode};1m${name} \x1B[0m`;
7126
+ args[0] = prefix + args[0].split("\n").join("\n" + prefix);
7127
+ args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
7128
+ } else {
7129
+ args[0] = getDate() + name + " " + args[0];
7130
+ }
7131
+ }
7132
+ function getDate() {
7133
+ if (exports.inspectOpts.hideDate) {
7134
+ return "";
7135
+ }
7136
+ return new Date().toISOString() + " ";
7137
+ }
7138
+ function log(...args) {
7139
+ return process.stderr.write(util2.format(...args) + "\n");
7140
+ }
7141
+ function save(namespaces) {
7142
+ if (namespaces) {
7143
+ process.env.DEBUG = namespaces;
7144
+ } else {
7145
+ delete process.env.DEBUG;
7146
+ }
7147
+ }
7148
+ function load() {
7149
+ return process.env.DEBUG;
7150
+ }
7151
+ function init(debug) {
7152
+ debug.inspectOpts = {};
7153
+ const keys = Object.keys(exports.inspectOpts);
7154
+ for (let i = 0; i < keys.length; i++) {
7155
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
7156
+ }
7157
+ }
7158
+ module2.exports = require_common()(exports);
7159
+ var { formatters } = module2.exports;
7160
+ formatters.o = function(v) {
7161
+ this.inspectOpts.colors = this.useColors;
7162
+ return util2.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
7163
+ };
7164
+ formatters.O = function(v) {
7165
+ this.inspectOpts.colors = this.useColors;
7166
+ return util2.inspect(v, this.inspectOpts);
7167
+ };
7168
+ }
7169
+ });
7170
+
7171
+ // node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js
7172
+ var require_src = __commonJS({
7173
+ "node_modules/.pnpm/debug@4.3.4/node_modules/debug/src/index.js"(exports, module2) {
7174
+ if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
7175
+ module2.exports = require_browser2();
7176
+ } else {
7177
+ module2.exports = require_node();
7178
+ }
7179
+ }
7180
+ });
7181
+
6426
7182
  // node_modules/.pnpm/hypercore-protocol@8.0.7/node_modules/hypercore-protocol/index.js
6427
7183
  var require_hypercore_protocol = __commonJS({
6428
7184
  "node_modules/.pnpm/hypercore-protocol@8.0.7/node_modules/hypercore-protocol/index.js"(exports, module2) {
@@ -6434,7 +7190,7 @@ var require_hypercore_protocol = __commonJS({
6434
7190
  var pretty = require_pretty_hash();
6435
7191
  var Message = require_abstract_extension();
6436
7192
  var { Duplex } = require("streamx");
6437
- var debug = require("debug")("hypercore-protocol");
7193
+ var debug = require_src()("hypercore-protocol");
6438
7194
  var StreamExtension = class extends Message {
6439
7195
  send(message) {
6440
7196
  const stream = this.local.handlers;
@@ -8047,7 +8803,7 @@ var require_replicate = __commonJS({
8047
8803
  // node_modules/.pnpm/nanoresource@1.3.0/node_modules/nanoresource/emitter.js
8048
8804
  var require_emitter = __commonJS({
8049
8805
  "node_modules/.pnpm/nanoresource@1.3.0/node_modules/nanoresource/emitter.js"(exports, module2) {
8050
- var events = require("events");
8806
+ var events = require("node:events");
8051
8807
  var inherits = require_inherits();
8052
8808
  var opening = Symbol("opening queue");
8053
8809
  var preclosing = Symbol("closing when inactive");
@@ -8182,792 +8938,14 @@ var require_emitter = __commonJS({
8182
8938
  }
8183
8939
  });
8184
8940
 
8185
- // node_modules/.pnpm/queue-tick@1.0.1/node_modules/queue-tick/queue-microtask.js
8186
- var require_queue_microtask = __commonJS({
8187
- "node_modules/.pnpm/queue-tick@1.0.1/node_modules/queue-tick/queue-microtask.js"(exports, module2) {
8188
- module2.exports = typeof queueMicrotask === "function" ? queueMicrotask : (fn) => Promise.resolve().then(fn);
8189
- }
8190
- });
8191
-
8192
- // node_modules/.pnpm/queue-tick@1.0.1/node_modules/queue-tick/process-next-tick.js
8193
- var require_process_next_tick = __commonJS({
8194
- "node_modules/.pnpm/queue-tick@1.0.1/node_modules/queue-tick/process-next-tick.js"(exports, module2) {
8195
- module2.exports = typeof process !== "undefined" && typeof process.nextTick === "function" ? process.nextTick.bind(process) : require_queue_microtask();
8196
- }
8197
- });
8198
-
8199
- // node_modules/.pnpm/random-access-storage@1.4.3/node_modules/random-access-storage/index.js
8200
- var require_random_access_storage = __commonJS({
8201
- "node_modules/.pnpm/random-access-storage@1.4.3/node_modules/random-access-storage/index.js"(exports, module2) {
8202
- var events = require("events");
8203
- var inherits = require_inherits();
8204
- var queueTick = require_process_next_tick();
8205
- var NOT_READABLE = defaultImpl(new Error("Not readable"));
8206
- var NOT_WRITABLE = defaultImpl(new Error("Not writable"));
8207
- var NOT_DELETABLE = defaultImpl(new Error("Not deletable"));
8208
- var NOT_STATABLE = defaultImpl(new Error("Not statable"));
8209
- var NO_OPEN_READABLE = defaultImpl(new Error("No readonly open"));
8210
- var READ_OP = 0;
8211
- var WRITE_OP = 1;
8212
- var DEL_OP = 2;
8213
- var STAT_OP = 3;
8214
- var OPEN_OP = 4;
8215
- var CLOSE_OP = 5;
8216
- var DESTROY_OP = 6;
8217
- module2.exports = RandomAccess;
8218
- function RandomAccess(opts) {
8219
- if (!(this instanceof RandomAccess))
8220
- return new RandomAccess(opts);
8221
- events.EventEmitter.call(this);
8222
- this._queued = [];
8223
- this._pending = 0;
8224
- this._needsOpen = true;
8225
- this.opened = false;
8226
- this.closed = false;
8227
- this.destroyed = false;
8228
- if (opts) {
8229
- if (opts.openReadonly)
8230
- this._openReadonly = opts.openReadonly;
8231
- if (opts.open)
8232
- this._open = opts.open;
8233
- if (opts.read)
8234
- this._read = opts.read;
8235
- if (opts.write)
8236
- this._write = opts.write;
8237
- if (opts.del)
8238
- this._del = opts.del;
8239
- if (opts.stat)
8240
- this._stat = opts.stat;
8241
- if (opts.close)
8242
- this._close = opts.close;
8243
- if (opts.destroy)
8244
- this._destroy = opts.destroy;
8245
- }
8246
- this.preferReadonly = this._openReadonly !== NO_OPEN_READABLE;
8247
- this.readable = this._read !== NOT_READABLE;
8248
- this.writable = this._write !== NOT_WRITABLE;
8249
- this.deletable = this._del !== NOT_DELETABLE;
8250
- this.statable = this._stat !== NOT_STATABLE;
8251
- }
8252
- inherits(RandomAccess, events.EventEmitter);
8253
- RandomAccess.prototype.read = function(offset, size, cb) {
8254
- this.run(new Request(this, READ_OP, offset, size, null, cb));
8255
- };
8256
- RandomAccess.prototype._read = NOT_READABLE;
8257
- RandomAccess.prototype.write = function(offset, data, cb) {
8258
- if (!cb)
8259
- cb = noop;
8260
- openWritable(this);
8261
- this.run(new Request(this, WRITE_OP, offset, data.length, data, cb));
8262
- };
8263
- RandomAccess.prototype._write = NOT_WRITABLE;
8264
- RandomAccess.prototype.del = function(offset, size, cb) {
8265
- if (!cb)
8266
- cb = noop;
8267
- openWritable(this);
8268
- this.run(new Request(this, DEL_OP, offset, size, null, cb));
8269
- };
8270
- RandomAccess.prototype._del = NOT_DELETABLE;
8271
- RandomAccess.prototype.stat = function(cb) {
8272
- this.run(new Request(this, STAT_OP, 0, 0, null, cb));
8273
- };
8274
- RandomAccess.prototype._stat = NOT_STATABLE;
8275
- RandomAccess.prototype.open = function(cb) {
8276
- if (!cb)
8277
- cb = noop;
8278
- if (this.opened && !this._needsOpen)
8279
- return queueTick(() => cb(null));
8280
- queueAndRun(this, new Request(this, OPEN_OP, 0, 0, null, cb));
8281
- };
8282
- RandomAccess.prototype._open = defaultImpl(null);
8283
- RandomAccess.prototype._openReadonly = NO_OPEN_READABLE;
8284
- RandomAccess.prototype.close = function(cb) {
8285
- if (!cb)
8286
- cb = noop;
8287
- if (this.closed)
8288
- return queueTick(() => cb(null));
8289
- queueAndRun(this, new Request(this, CLOSE_OP, 0, 0, null, cb));
8290
- };
8291
- RandomAccess.prototype._close = defaultImpl(null);
8292
- RandomAccess.prototype.destroy = function(cb) {
8293
- if (!cb)
8294
- cb = noop;
8295
- if (!this.closed)
8296
- this.close(noop);
8297
- queueAndRun(this, new Request(this, DESTROY_OP, 0, 0, null, cb));
8298
- };
8299
- RandomAccess.prototype._destroy = defaultImpl(null);
8300
- RandomAccess.prototype.run = function(req) {
8301
- if (this._needsOpen)
8302
- this.open(noop);
8303
- if (this._queued.length)
8304
- this._queued.push(req);
8305
- else
8306
- req._run();
8307
- };
8308
- function noop() {
8309
- }
8310
- function Request(self, type, offset, size, data, cb) {
8311
- this.type = type;
8312
- this.offset = offset;
8313
- this.data = data;
8314
- this.size = size;
8315
- this.storage = self;
8316
- this._sync = false;
8317
- this._callback = cb;
8318
- this._openError = null;
8319
- }
8320
- Request.prototype._maybeOpenError = function(err) {
8321
- if (this.type !== OPEN_OP)
8322
- return;
8323
- var queued = this.storage._queued;
8324
- for (var i = 0; i < queued.length; i++)
8325
- queued[i]._openError = err;
8326
- };
8327
- Request.prototype._unqueue = function(err) {
8328
- var ra = this.storage;
8329
- var queued = ra._queued;
8330
- if (!err) {
8331
- switch (this.type) {
8332
- case OPEN_OP:
8333
- if (!ra.opened) {
8334
- ra.opened = true;
8335
- ra.emit("open");
8336
- }
8337
- break;
8338
- case CLOSE_OP:
8339
- if (!ra.closed) {
8340
- ra.closed = true;
8341
- ra.emit("close");
8342
- }
8343
- break;
8344
- case DESTROY_OP:
8345
- if (!ra.destroyed) {
8346
- ra.destroyed = true;
8347
- ra.emit("destroy");
8348
- }
8349
- break;
8350
- }
8351
- } else {
8352
- this._maybeOpenError(err);
8353
- }
8354
- if (queued.length && queued[0] === this)
8355
- queued.shift();
8356
- if (!--ra._pending)
8357
- drainQueue(ra);
8358
- };
8359
- Request.prototype.callback = function(err, val) {
8360
- if (this._sync)
8361
- return nextTick(this, err, val);
8362
- this._unqueue(err);
8363
- this._callback(err, val);
8364
- };
8365
- Request.prototype._openAndNotClosed = function() {
8366
- var ra = this.storage;
8367
- if (ra.opened && !ra.closed)
8368
- return true;
8369
- if (!ra.opened)
8370
- nextTick(this, this._openError || new Error("Not opened"));
8371
- else if (ra.closed)
8372
- nextTick(this, new Error("Closed"));
8373
- return false;
8374
- };
8375
- Request.prototype._open = function() {
8376
- var ra = this.storage;
8377
- if (ra.opened && !ra._needsOpen)
8378
- return nextTick(this, null);
8379
- if (ra.closed)
8380
- return nextTick(this, new Error("Closed"));
8381
- ra._needsOpen = false;
8382
- if (ra.preferReadonly)
8383
- ra._openReadonly(this);
8384
- else
8385
- ra._open(this);
8386
- };
8387
- Request.prototype._run = function() {
8388
- var ra = this.storage;
8389
- ra._pending++;
8390
- this._sync = true;
8391
- switch (this.type) {
8392
- case READ_OP:
8393
- if (this._openAndNotClosed())
8394
- ra._read(this);
8395
- break;
8396
- case WRITE_OP:
8397
- if (this._openAndNotClosed())
8398
- ra._write(this);
8399
- break;
8400
- case DEL_OP:
8401
- if (this._openAndNotClosed())
8402
- ra._del(this);
8403
- break;
8404
- case STAT_OP:
8405
- if (this._openAndNotClosed())
8406
- ra._stat(this);
8407
- break;
8408
- case OPEN_OP:
8409
- this._open();
8410
- break;
8411
- case CLOSE_OP:
8412
- if (ra.closed || !ra.opened)
8413
- nextTick(this, null);
8414
- else
8415
- ra._close(this);
8416
- break;
8417
- case DESTROY_OP:
8418
- if (ra.destroyed)
8419
- nextTick(this, null);
8420
- else
8421
- ra._destroy(this);
8422
- break;
8423
- }
8424
- this._sync = false;
8425
- };
8426
- function queueAndRun(self, req) {
8427
- self._queued.push(req);
8428
- if (!self._pending)
8429
- req._run();
8430
- }
8431
- function drainQueue(self) {
8432
- var queued = self._queued;
8433
- while (queued.length > 0) {
8434
- var blocking = queued[0].type > 3;
8435
- if (!blocking || !self._pending)
8436
- queued[0]._run();
8437
- if (blocking)
8438
- return;
8439
- queued.shift();
8440
- }
8441
- }
8442
- function openWritable(self) {
8443
- if (self.preferReadonly) {
8444
- self._needsOpen = true;
8445
- self.preferReadonly = false;
8446
- }
8447
- }
8448
- function defaultImpl(err) {
8449
- return overridable;
8450
- function overridable(req) {
8451
- nextTick(req, err);
8452
- }
8453
- }
8454
- function nextTick(req, err, val) {
8455
- queueTick(() => req.callback(err, val));
8456
- }
8457
- }
8458
- });
8459
-
8460
- // node_modules/.pnpm/mkdirp-classic@0.5.3/node_modules/mkdirp-classic/index.js
8461
- var require_mkdirp_classic = __commonJS({
8462
- "node_modules/.pnpm/mkdirp-classic@0.5.3/node_modules/mkdirp-classic/index.js"(exports, module2) {
8463
- var path = require("path");
8464
- var fs = require("fs");
8465
- var _0777 = parseInt("0777", 8);
8466
- module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
8467
- function mkdirP(p, opts, f, made) {
8468
- if (typeof opts === "function") {
8469
- f = opts;
8470
- opts = {};
8471
- } else if (!opts || typeof opts !== "object") {
8472
- opts = { mode: opts };
8473
- }
8474
- var mode = opts.mode;
8475
- var xfs = opts.fs || fs;
8476
- if (mode === void 0) {
8477
- mode = _0777 & ~process.umask();
8478
- }
8479
- if (!made)
8480
- made = null;
8481
- var cb = f || function() {
8482
- };
8483
- p = path.resolve(p);
8484
- xfs.mkdir(p, mode, function(er) {
8485
- if (!er) {
8486
- made = made || p;
8487
- return cb(null, made);
8488
- }
8489
- switch (er.code) {
8490
- case "ENOENT":
8491
- mkdirP(path.dirname(p), opts, function(er2, made2) {
8492
- if (er2)
8493
- cb(er2, made2);
8494
- else
8495
- mkdirP(p, opts, cb, made2);
8496
- });
8497
- break;
8498
- default:
8499
- xfs.stat(p, function(er2, stat) {
8500
- if (er2 || !stat.isDirectory())
8501
- cb(er, made);
8502
- else
8503
- cb(null, made);
8504
- });
8505
- break;
8506
- }
8507
- });
8508
- }
8509
- mkdirP.sync = function sync(p, opts, made) {
8510
- if (!opts || typeof opts !== "object") {
8511
- opts = { mode: opts };
8512
- }
8513
- var mode = opts.mode;
8514
- var xfs = opts.fs || fs;
8515
- if (mode === void 0) {
8516
- mode = _0777 & ~process.umask();
8517
- }
8518
- if (!made)
8519
- made = null;
8520
- p = path.resolve(p);
8521
- try {
8522
- xfs.mkdirSync(p, mode);
8523
- made = made || p;
8524
- } catch (err0) {
8525
- switch (err0.code) {
8526
- case "ENOENT":
8527
- made = sync(path.dirname(p), opts, made);
8528
- sync(p, opts, made);
8529
- break;
8530
- default:
8531
- var stat;
8532
- try {
8533
- stat = xfs.statSync(p);
8534
- } catch (err1) {
8535
- throw err0;
8536
- }
8537
- if (!stat.isDirectory())
8538
- throw err0;
8539
- break;
8540
- }
8541
- }
8542
- return made;
8543
- };
8544
- }
8545
- });
8546
-
8547
- // node_modules/.pnpm/random-access-file@2.2.1/node_modules/random-access-file/index.js
8548
- var require_random_access_file = __commonJS({
8549
- "node_modules/.pnpm/random-access-file@2.2.1/node_modules/random-access-file/index.js"(exports, module2) {
8550
- var inherits = require("util").inherits;
8551
- var RandomAccess = require_random_access_storage();
8552
- var fs = require("fs");
8553
- var mkdirp = require_mkdirp_classic();
8554
- var path = require("path");
8555
- var constants = fs.constants || require("constants");
8556
- var READONLY = constants.O_RDONLY;
8557
- var READWRITE = constants.O_RDWR | constants.O_CREAT;
8558
- module2.exports = RandomAccessFile;
8559
- function RandomAccessFile(filename, opts) {
8560
- if (!(this instanceof RandomAccessFile))
8561
- return new RandomAccessFile(filename, opts);
8562
- RandomAccess.call(this);
8563
- if (!opts)
8564
- opts = {};
8565
- if (opts.directory)
8566
- filename = path.join(opts.directory, path.resolve("/", filename).replace(/^\w+:\\/, ""));
8567
- this.directory = opts.directory || null;
8568
- this.filename = filename;
8569
- this.fd = 0;
8570
- if (opts.writable || opts.truncate)
8571
- this.preferReadonly = false;
8572
- this._size = opts.size || opts.length || 0;
8573
- this._truncate = !!opts.truncate || this._size > 0;
8574
- this._rmdir = !!opts.rmdir;
8575
- this._lock = opts.lock || noLock;
8576
- this._sparse = opts.sparse || noLock;
8577
- this._alloc = opts.alloc || Buffer.allocUnsafe;
8578
- }
8579
- inherits(RandomAccessFile, RandomAccess);
8580
- RandomAccessFile.prototype._open = function(req) {
8581
- var self = this;
8582
- mkdirp(path.dirname(this.filename), ondir);
8583
- function ondir(err) {
8584
- if (err)
8585
- return req.callback(err);
8586
- open(self, READWRITE, req);
8587
- }
8588
- };
8589
- RandomAccessFile.prototype._openReadonly = function(req) {
8590
- open(this, READONLY, req);
8591
- };
8592
- RandomAccessFile.prototype._write = function(req) {
8593
- var data = req.data;
8594
- var fd = this.fd;
8595
- fs.write(fd, data, 0, req.size, req.offset, onwrite);
8596
- function onwrite(err, wrote) {
8597
- if (err)
8598
- return req.callback(err);
8599
- req.size -= wrote;
8600
- req.offset += wrote;
8601
- if (!req.size)
8602
- return req.callback(null);
8603
- fs.write(fd, data, data.length - req.size, req.size, req.offset, onwrite);
8604
- }
8605
- };
8606
- RandomAccessFile.prototype._read = function(req) {
8607
- var self = this;
8608
- var data = req.data || this._alloc(req.size);
8609
- var fd = this.fd;
8610
- if (!req.size)
8611
- return process.nextTick(readEmpty, req);
8612
- fs.read(fd, data, 0, req.size, req.offset, onread);
8613
- function onread(err, read) {
8614
- if (err)
8615
- return req.callback(err);
8616
- if (!read)
8617
- return req.callback(createReadError(self.filename, req.offset, req.size));
8618
- req.size -= read;
8619
- req.offset += read;
8620
- if (!req.size)
8621
- return req.callback(null, data);
8622
- fs.read(fd, data, data.length - req.size, req.size, req.offset, onread);
8623
- }
8624
- };
8625
- RandomAccessFile.prototype._del = function(req) {
8626
- var fd = this.fd;
8627
- fs.fstat(fd, onstat);
8628
- function onstat(err, st) {
8629
- if (err)
8630
- return req.callback(err);
8631
- if (req.offset + req.size < st.size)
8632
- return req.callback(null);
8633
- fs.ftruncate(fd, req.offset, ontruncate);
8634
- }
8635
- function ontruncate(err) {
8636
- req.callback(err);
8637
- }
8638
- };
8639
- RandomAccessFile.prototype._stat = function(req) {
8640
- fs.fstat(this.fd, onstat);
8641
- function onstat(err, st) {
8642
- req.callback(err, st);
8643
- }
8644
- };
8645
- RandomAccessFile.prototype._close = function(req) {
8646
- var self = this;
8647
- fs.close(this.fd, onclose);
8648
- function onclose(err) {
8649
- if (err)
8650
- return req.callback(err);
8651
- self.fd = 0;
8652
- req.callback(null);
8653
- }
8654
- };
8655
- RandomAccessFile.prototype._destroy = function(req) {
8656
- var self = this;
8657
- var root = this.directory && path.resolve(path.join(this.directory, "."));
8658
- var dir = path.resolve(path.dirname(this.filename));
8659
- fs.unlink(this.filename, onunlink);
8660
- function onunlink(err) {
8661
- if (!self._rmdir || !root || dir === root)
8662
- return req.callback(err);
8663
- fs.rmdir(dir, onrmdir);
8664
- }
8665
- function onrmdir(err) {
8666
- dir = path.join(dir, "..");
8667
- if (err || dir === root)
8668
- return req.callback(null);
8669
- fs.rmdir(dir, onrmdir);
8670
- }
8671
- };
8672
- function open(self, mode, req) {
8673
- if (self.fd)
8674
- fs.close(self.fd, oncloseold);
8675
- else
8676
- fs.open(self.filename, mode, onopen);
8677
- function onopen(err, fd) {
8678
- if (err)
8679
- return req.callback(err);
8680
- self.fd = fd;
8681
- if (!self._lock(self.fd))
8682
- return req.callback(createLockError(self.filename));
8683
- if (!self._sparse(self.fd))
8684
- return req.callback(createSparseError(self.filename));
8685
- if (!self._truncate || mode === READONLY)
8686
- return req.callback(null);
8687
- fs.ftruncate(self.fd, self._size, ontruncate);
8688
- }
8689
- function oncloseold(err) {
8690
- if (err)
8691
- return onerrorafteropen(err);
8692
- self.fd = 0;
8693
- fs.open(self.filename, mode, onopen);
8694
- }
8695
- function ontruncate(err) {
8696
- if (err)
8697
- return onerrorafteropen(err);
8698
- req.callback(null);
8699
- }
8700
- function onerrorafteropen(err) {
8701
- fs.close(self.fd, function() {
8702
- self.fd = 0;
8703
- req.callback(err);
8704
- });
8941
+ // packages/common/hypercore/src/empty.ts
8942
+ var require_empty = __commonJS({
8943
+ "packages/common/hypercore/src/empty.ts"(exports, module2) {
8944
+ module2.exports = new Proxy({}, {
8945
+ get: (target, prop) => {
8946
+ throw new Error("Package has been stripped");
8705
8947
  }
8706
- }
8707
- function readEmpty(req) {
8708
- req.callback(null, Buffer.alloc(0));
8709
- }
8710
- function noLock(fd) {
8711
- return true;
8712
- }
8713
- function createSparseError(path2) {
8714
- var err = new Error("ENOTSPARSE: File could not be marked as sparse");
8715
- err.code = "ENOTSPARSE";
8716
- err.path = path2;
8717
- return err;
8718
- }
8719
- function createLockError(path2) {
8720
- var err = new Error("ELOCKED: File is locked");
8721
- err.code = "ELOCKED";
8722
- err.path = path2;
8723
- return err;
8724
- }
8725
- function createReadError(path2, offset, size) {
8726
- var err = new Error("Could not satisfy length");
8727
- err.code = "EPARTIALREAD";
8728
- err.path = path2;
8729
- err.offset = offset;
8730
- err.size = size;
8731
- return err;
8732
- }
8733
- }
8734
- });
8735
-
8736
- // node_modules/.pnpm/node-gyp-build@4.5.0/node_modules/node-gyp-build/index.js
8737
- var require_node_gyp_build = __commonJS({
8738
- "node_modules/.pnpm/node-gyp-build@4.5.0/node_modules/node-gyp-build/index.js"(exports, module2) {
8739
- var fs = require("fs");
8740
- var path = require("path");
8741
- var os = require("os");
8742
- var runtimeRequire = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
8743
- var vars = process.config && process.config.variables || {};
8744
- var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
8745
- var abi = process.versions.modules;
8746
- var runtime = isElectron() ? "electron" : isNwjs() ? "node-webkit" : "node";
8747
- var arch = process.env.npm_config_arch || os.arch();
8748
- var platform = process.env.npm_config_platform || os.platform();
8749
- var libc = process.env.LIBC || (isAlpine(platform) ? "musl" : "glibc");
8750
- var armv = process.env.ARM_VERSION || (arch === "arm64" ? "8" : vars.arm_version) || "";
8751
- var uv = (process.versions.uv || "").split(".")[0];
8752
- module2.exports = load;
8753
- function load(dir) {
8754
- return runtimeRequire(load.path(dir));
8755
- }
8756
- load.path = function(dir) {
8757
- dir = path.resolve(dir || ".");
8758
- try {
8759
- var name = runtimeRequire(path.join(dir, "package.json")).name.toUpperCase().replace(/-/g, "_");
8760
- if (process.env[name + "_PREBUILD"])
8761
- dir = process.env[name + "_PREBUILD"];
8762
- } catch (err) {
8763
- }
8764
- if (!prebuildsOnly) {
8765
- var release = getFirst(path.join(dir, "build/Release"), matchBuild);
8766
- if (release)
8767
- return release;
8768
- var debug = getFirst(path.join(dir, "build/Debug"), matchBuild);
8769
- if (debug)
8770
- return debug;
8771
- }
8772
- var prebuild = resolve(dir);
8773
- if (prebuild)
8774
- return prebuild;
8775
- var nearby = resolve(path.dirname(process.execPath));
8776
- if (nearby)
8777
- return nearby;
8778
- var target = [
8779
- "platform=" + platform,
8780
- "arch=" + arch,
8781
- "runtime=" + runtime,
8782
- "abi=" + abi,
8783
- "uv=" + uv,
8784
- armv ? "armv=" + armv : "",
8785
- "libc=" + libc,
8786
- "node=" + process.versions.node,
8787
- process.versions.electron ? "electron=" + process.versions.electron : "",
8788
- typeof __webpack_require__ === "function" ? "webpack=true" : ""
8789
- // eslint-disable-line
8790
- ].filter(Boolean).join(" ");
8791
- throw new Error("No native build was found for " + target + "\n loaded from: " + dir + "\n");
8792
- function resolve(dir2) {
8793
- var tuples = readdirSync(path.join(dir2, "prebuilds")).map(parseTuple);
8794
- var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];
8795
- if (!tuple)
8796
- return;
8797
- var prebuilds = path.join(dir2, "prebuilds", tuple.name);
8798
- var parsed = readdirSync(prebuilds).map(parseTags);
8799
- var candidates = parsed.filter(matchTags(runtime, abi));
8800
- var winner = candidates.sort(compareTags(runtime))[0];
8801
- if (winner)
8802
- return path.join(prebuilds, winner.file);
8803
- }
8804
- };
8805
- function readdirSync(dir) {
8806
- try {
8807
- return fs.readdirSync(dir);
8808
- } catch (err) {
8809
- return [];
8810
- }
8811
- }
8812
- function getFirst(dir, filter) {
8813
- var files = readdirSync(dir).filter(filter);
8814
- return files[0] && path.join(dir, files[0]);
8815
- }
8816
- function matchBuild(name) {
8817
- return /\.node$/.test(name);
8818
- }
8819
- function parseTuple(name) {
8820
- var arr = name.split("-");
8821
- if (arr.length !== 2)
8822
- return;
8823
- var platform2 = arr[0];
8824
- var architectures = arr[1].split("+");
8825
- if (!platform2)
8826
- return;
8827
- if (!architectures.length)
8828
- return;
8829
- if (!architectures.every(Boolean))
8830
- return;
8831
- return { name, platform: platform2, architectures };
8832
- }
8833
- function matchTuple(platform2, arch2) {
8834
- return function(tuple) {
8835
- if (tuple == null)
8836
- return false;
8837
- if (tuple.platform !== platform2)
8838
- return false;
8839
- return tuple.architectures.includes(arch2);
8840
- };
8841
- }
8842
- function compareTuples(a, b) {
8843
- return a.architectures.length - b.architectures.length;
8844
- }
8845
- function parseTags(file) {
8846
- var arr = file.split(".");
8847
- var extension = arr.pop();
8848
- var tags = { file, specificity: 0 };
8849
- if (extension !== "node")
8850
- return;
8851
- for (var i = 0; i < arr.length; i++) {
8852
- var tag = arr[i];
8853
- if (tag === "node" || tag === "electron" || tag === "node-webkit") {
8854
- tags.runtime = tag;
8855
- } else if (tag === "napi") {
8856
- tags.napi = true;
8857
- } else if (tag.slice(0, 3) === "abi") {
8858
- tags.abi = tag.slice(3);
8859
- } else if (tag.slice(0, 2) === "uv") {
8860
- tags.uv = tag.slice(2);
8861
- } else if (tag.slice(0, 4) === "armv") {
8862
- tags.armv = tag.slice(4);
8863
- } else if (tag === "glibc" || tag === "musl") {
8864
- tags.libc = tag;
8865
- } else {
8866
- continue;
8867
- }
8868
- tags.specificity++;
8869
- }
8870
- return tags;
8871
- }
8872
- function matchTags(runtime2, abi2) {
8873
- return function(tags) {
8874
- if (tags == null)
8875
- return false;
8876
- if (tags.runtime !== runtime2 && !runtimeAgnostic(tags))
8877
- return false;
8878
- if (tags.abi !== abi2 && !tags.napi)
8879
- return false;
8880
- if (tags.uv && tags.uv !== uv)
8881
- return false;
8882
- if (tags.armv && tags.armv !== armv)
8883
- return false;
8884
- if (tags.libc && tags.libc !== libc)
8885
- return false;
8886
- return true;
8887
- };
8888
- }
8889
- function runtimeAgnostic(tags) {
8890
- return tags.runtime === "node" && tags.napi;
8891
- }
8892
- function compareTags(runtime2) {
8893
- return function(a, b) {
8894
- if (a.runtime !== b.runtime) {
8895
- return a.runtime === runtime2 ? -1 : 1;
8896
- } else if (a.abi !== b.abi) {
8897
- return a.abi ? -1 : 1;
8898
- } else if (a.specificity !== b.specificity) {
8899
- return a.specificity > b.specificity ? -1 : 1;
8900
- } else {
8901
- return 0;
8902
- }
8903
- };
8904
- }
8905
- function isNwjs() {
8906
- return !!(process.versions && process.versions.nw);
8907
- }
8908
- function isElectron() {
8909
- if (process.versions && process.versions.electron)
8910
- return true;
8911
- if (process.env.ELECTRON_RUN_AS_NODE)
8912
- return true;
8913
- return typeof window !== "undefined" && window.process && window.process.type === "renderer";
8914
- }
8915
- function isAlpine(platform2) {
8916
- return platform2 === "linux" && fs.existsSync("/etc/alpine-release");
8917
- }
8918
- load.parseTags = parseTags;
8919
- load.matchTags = matchTags;
8920
- load.compareTags = compareTags;
8921
- load.parseTuple = parseTuple;
8922
- load.matchTuple = matchTuple;
8923
- load.compareTuples = compareTuples;
8924
- }
8925
- });
8926
-
8927
- // node_modules/.pnpm/fsctl@1.0.0/node_modules/fsctl/index.js
8928
- var require_fsctl = __commonJS({
8929
- "node_modules/.pnpm/fsctl@1.0.0/node_modules/fsctl/index.js"(exports, module2) {
8930
- var binding = require_node_gyp_build()(__dirname);
8931
- module2.exports = {
8932
- lock(fd) {
8933
- return binding.fsctl_native_lock(fd) > 0;
8934
- },
8935
- unlock(fd) {
8936
- return binding.fsctl_native_unlock(fd) > 0;
8937
- },
8938
- sparse(fd) {
8939
- return binding.fsctl_native_sparse(fd) > 0;
8940
- }
8941
- };
8942
- }
8943
- });
8944
-
8945
- // node_modules/.pnpm/hypercore-default-storage@1.1.1/node_modules/hypercore-default-storage/index.js
8946
- var require_hypercore_default_storage = __commonJS({
8947
- "node_modules/.pnpm/hypercore-default-storage@1.1.1/node_modules/hypercore-default-storage/index.js"(exports, module2) {
8948
- var RAF = require_random_access_file();
8949
- var lock = null;
8950
- var sparse = null;
8951
- try {
8952
- const fsctl = require_fsctl();
8953
- lock = fsctl.lock;
8954
- sparse = null;
8955
- } catch (_) {
8956
- }
8957
- module2.exports = defaultStorage;
8958
- function defaultStorage(name, opts) {
8959
- if (isTree(name))
8960
- return new RAF(name, { sparse, alloc: Buffer.alloc, ...opts });
8961
- if (!isBitfield(name))
8962
- return new RAF(name, { sparse, ...opts });
8963
- return new RAF(name, { lock, sparse, ...opts });
8964
- }
8965
- function isTree(name) {
8966
- return name === "tree" || name.endsWith("/tree");
8967
- }
8968
- function isBitfield(name) {
8969
- return name === "bitfield" || name.endsWith("/bitfield");
8970
- }
8948
+ });
8971
8949
  }
8972
8950
  });
8973
8951
 
@@ -9073,7 +9051,7 @@ var require_hypercore = __commonJS({
9073
9051
  var Protocol = require_hypercore_protocol();
9074
9052
  var Message = require_abstract_extension();
9075
9053
  var Nanoresource = require_emitter();
9076
- var defaultStorage = require_hypercore_default_storage();
9054
+ var defaultStorage = require_empty();
9077
9055
  var { WriteStream, ReadStream } = require_hypercore_streams();
9078
9056
  var Extension = class extends Message {
9079
9057
  broadcast(message) {