@ghostlytools/sdk 1.7.4 → 1.8.0

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.
@@ -1091,6 +1091,14 @@ var REQUESTS_PER_MINUTE = 30;
1091
1091
  */
1092
1092
  var BACKGROUND_REQUESTS_PER_MINUTE = 20;
1093
1093
  /**
1094
+ * Of the background share, what background writes may spend in a minute on a relay (10 of the 20): the rest is kept
1095
+ * for background reads. Those writes are mostly the upkeep of chats whose contacts are away (the link's heartbeat, the
1096
+ * DHT floor's keep-alive, the capability record), about one a minute for every two chats. A profile with 200 such chats
1097
+ * spent the share on them, and on one relay 147 of its 200 contacts were not read once in 25 minutes: a contact back
1098
+ * then went unnoticed (bug hunt, 2026-11-01). Upkeep held back goes when a request of this share frees.
1099
+ */
1100
+ var BACKGROUND_WRITES_SHARE = 1 / 2;
1101
+ /**
1094
1102
  * A link's write the budget refused (its presence, its offer, its answer) goes first when the minute
1095
1103
  * frees a request: reads on that relay wait this long after the refusal. A link that polls fast for a
1096
1104
  * peer while its offer waits would otherwise take every request the minute frees, and the offer (the
@@ -1364,6 +1372,15 @@ function normalizeRelayUrl(input) {
1364
1372
  return null;
1365
1373
  }
1366
1374
  }
1375
+ /**
1376
+ * Why a line of a Pkarr relay list is not a relay `normalizeRelayUrl` keeps, with the line as typed; null when it is
1377
+ * one. A host alone or another scheme (`relay.example.org`, `wss://…`) was meant as an https:// relay.
1378
+ */
1379
+ function relayUrlProblem(input) {
1380
+ const line = input.trim();
1381
+ if (normalizeRelayUrl(line)) return null;
1382
+ return /^(?:[a-z][a-z\d+.-]*:\/\/)?[^\s/:]+\.[^\s]+$/i.test(line) ? `Use an https:// relay address: ${line}` : `Not a relay address: ${line}`;
1383
+ }
1367
1384
  /** A relay the breaker leaves alone for failing (`RelayBreaker`): nothing was asked of it now. */
1368
1385
  var RelayLeftAloneError = class extends Error {};
1369
1386
  /**
@@ -1406,6 +1423,8 @@ var RelayTransport = class {
1406
1423
  lastReadFrom = /* @__PURE__ */ new Map();
1407
1424
  spent = /* @__PURE__ */ new Map();
1408
1425
  spentBackground = /* @__PURE__ */ new Map();
1426
+ /** Background writes on each relay in the last minute (`BACKGROUND_WRITES_SHARE`). */
1427
+ spentBackgroundWrites = /* @__PURE__ */ new Map();
1409
1428
  /** Groups' urgent reads on each relay in the last `GROUP_BURST_MS`. */
1410
1429
  spentGroupUrgent = /* @__PURE__ */ new Map();
1411
1430
  /** Watch reads on each relay in the last `GROUP_RATION_WINDOW_MS` (`WATCH_SHARE`). */
@@ -1484,16 +1503,16 @@ var RelayTransport = class {
1484
1503
  this.perMinuteGiven = options.requestsPerMinute !== void 0;
1485
1504
  this.backgroundPerMinute = this.perMinute === 30 ? 20 : Math.ceil(this.perMinute * 2 / 3);
1486
1505
  this.backgroundWhileSignaling = this.perMinute === 30 ? 5 : Math.ceil(this.perMinute / 6);
1487
- const log = options.log ?? ((line) => console.info(`[ghostly:relay] ${line}`));
1506
+ const log = options.log ?? ((line) => console.info(`ghostly: ${line}`));
1488
1507
  this.breaker = new RelayBreaker({
1489
1508
  ...options.breaker,
1490
1509
  onTrip: (relay, reason, forMs) => {
1491
- log(`${new URL(relay).host} tripped (${reason}); left alone for ${Math.round(forMs / 1e3)} s`);
1510
+ log(`relay ${new URL(relay).host} ${reason === "no answer" ? "did not answer" : reason === "slow" ? "answered too slowly" : `failed (${reason})`}; asked again in ${Math.round(forMs / 1e3)} s`);
1492
1511
  options.breaker?.onTrip?.(relay, reason, forMs);
1493
1512
  this.changed("tripped");
1494
1513
  },
1495
1514
  onRecover: (relay) => {
1496
- log(`${new URL(relay).host} answered again`);
1515
+ log(`relay ${new URL(relay).host} answers again`);
1497
1516
  options.breaker?.onRecover?.(relay);
1498
1517
  this.changed("recovered");
1499
1518
  }
@@ -2177,13 +2196,13 @@ var RelayTransport = class {
2177
2196
  let response;
2178
2197
  try {
2179
2198
  response = await request;
2180
- } catch (error) {
2199
+ } catch {
2181
2200
  this.networkCooldown.set(`PUT ${relay}`, Date.now() + NETWORK_ERROR_COOLDOWN_MS);
2182
2201
  this.answered(relay, {
2183
2202
  kind: "error",
2184
2203
  reason: "no answer"
2185
2204
  });
2186
- throw error;
2205
+ throw new Error(`${relay} did not answer`);
2187
2206
  }
2188
2207
  if (response.status === 429) this.answered(relay, {
2189
2208
  kind: "throttled",
@@ -2237,6 +2256,7 @@ var RelayTransport = class {
2237
2256
  if (departedOver) this.departedOverAdd(key, now);
2238
2257
  this.spent.get(relay).push(now);
2239
2258
  if (who.background) this.spentBackground.get(relay).push(now);
2259
+ if (who.background && who.write) this.spentBackgroundWrites.get(relay).push(now);
2240
2260
  if (isGroupUrgentRead(who)) this.spentGroupUrgent.get(relay).push(now);
2241
2261
  if (isWatch(who)) this.spentWatch.get(relay).push(now);
2242
2262
  if (isChatWatch(who) && !departedOver) this.spentChatWatch.get(relay).push(now);
@@ -2270,6 +2290,8 @@ var RelayTransport = class {
2270
2290
  const recentBackground = (this.spentBackground.get(relay) ?? []).filter((at) => now - at < 6e4);
2271
2291
  this.spent.set(relay, recent);
2272
2292
  this.spentBackground.set(relay, recentBackground);
2293
+ const recentBackgroundWrites = (this.spentBackgroundWrites.get(relay) ?? []).filter((at) => now - at < 6e4);
2294
+ this.spentBackgroundWrites.set(relay, recentBackgroundWrites);
2273
2295
  const over = (list, limit) => list.length >= limit ? list[list.length - limit] + 6e4 - now : 0;
2274
2296
  const limit = this.limitOf(relay);
2275
2297
  const departed = isDepartedRead(who) && key !== void 0 && recent.length >= limit && this.departedReads(key, now) < 6;
@@ -2284,7 +2306,9 @@ var RelayTransport = class {
2284
2306
  this.spentGroupOver.set(relay, groupOver);
2285
2307
  if (isGroupSignal(who) && !who.write && recent.length >= limit && groupOver.length > 0) wait = Math.max(wait, groupOver[groupOver.length - 1] + GROUP_OVER_PACE_MS - now);
2286
2308
  if (who.background && !starved) {
2287
- wait = Math.max(wait, over(recentBackground, Math.min(this.backgroundPerMinute, Math.ceil(limit * 2 / 3))));
2309
+ const backgroundShare = Math.min(this.backgroundPerMinute, Math.ceil(limit * 2 / 3));
2310
+ wait = Math.max(wait, over(recentBackground, backgroundShare));
2311
+ if (who.write) wait = Math.max(wait, over(recentBackgroundWrites, Math.max(1, Math.floor(backgroundShare * BACKGROUND_WRITES_SHARE))));
2288
2312
  const signaling = this.urgentAt + SIGNALING_WINDOW_MS - now;
2289
2313
  if (signaling > 0 && !who.door) wait = Math.max(wait, Math.min(signaling, over(recentBackground, Math.min(this.backgroundWhileSignaling, Math.ceil(limit / 6)))));
2290
2314
  }
@@ -2815,13 +2839,13 @@ function turnName(name) {
2815
2839
  }
2816
2840
  return hasVisible(out) ? out.trimEnd() : "";
2817
2841
  }
2818
- function u32$3(value) {
2842
+ function u32$4(value) {
2819
2843
  return Uint8Array.of(value >>> 24 & 255, value >>> 16 & 255, value >>> 8 & 255, value & 255);
2820
2844
  }
2821
2845
  /** What a release signs: `"ghostly-turn-release" || turnAddress(32) || turn(4) || toKey(32) || H(32)`. */
2822
2846
  function turnReleaseMessage(address, turn, toKey, h) {
2823
2847
  if (address.length !== 32 || toKey.length !== 32 || h.length !== 32) throw new Error("A release names 32-byte values");
2824
- return concatBytes(RELEASE_DOMAIN, address, u32$3(turn), toKey, h);
2848
+ return concatBytes(RELEASE_DOMAIN, address, u32$4(turn), toKey, h);
2825
2849
  }
2826
2850
  /** What the author signs: `"ghostly-turn" || turnAddress(32) || body[0..310]`. */
2827
2851
  function turnSignedMessage(address, unsigned) {
@@ -2839,8 +2863,8 @@ function encodeTurnFields(fields) {
2839
2863
  if (tombstone ? fields.active !== 255 : !held(fields.active)) throw new Error(tombstone ? "A tombstone names no active device" : "The active device has no slot");
2840
2864
  const body = /* @__PURE__ */ new Uint8Array(310);
2841
2865
  body[OFFSET.version] = 1;
2842
- body.set(u32$3(fields.turn), OFFSET.turn);
2843
- body.set(u32$3(fields.rev).subarray(1), OFFSET.rev);
2866
+ body.set(u32$4(fields.turn), OFFSET.turn);
2867
+ body.set(u32$4(fields.rev).subarray(1), OFFSET.rev);
2844
2868
  body[OFFSET.author] = fields.author;
2845
2869
  body[OFFSET.active] = fields.active;
2846
2870
  body[OFFSET.count] = fields.slots.filter(Boolean).length;
@@ -3105,7 +3129,7 @@ var TURN_RAISE_READ_TIMEOUT_MS = 5e3;
3105
3129
  var TURN_VISIBLE_MS = 1e4;
3106
3130
  /** `T`: how long a device that raised the turn waits, from the end of its put, before the read that may make it active. `T >= P + 2V`. */
3107
3131
  var TURN_SETTLE_MS = 3e4;
3108
- function compareBytes$3(a, b) {
3132
+ function compareBytes$4(a, b) {
3109
3133
  for (let i = 0; i < Math.min(a.length, b.length); i++) if (a[i] !== b[i]) return a[i] - b[i];
3110
3134
  return a.length - b.length;
3111
3135
  }
@@ -3116,7 +3140,7 @@ function compareBytes$3(a, b) {
3116
3140
  * reader still agrees.
3117
3141
  */
3118
3142
  function keptAtEqualSequence(a, b) {
3119
- return compareBytes$3(a.record.instance, b.record.instance) || compareBytes$3(a.record.body, b.record.body) || compareBytes$3(a.payload, b.payload);
3143
+ return compareBytes$4(a.record.instance, b.record.instance) || compareBytes$4(a.record.body, b.record.body) || compareBytes$4(a.payload, b.payload);
3120
3144
  }
3121
3145
  var kept = (f) => ({
3122
3146
  record: f.read.record,
@@ -4904,7 +4928,7 @@ function checkAppManifest(value, options = {}) {
4904
4928
  function appDigest(manifestBytes) {
4905
4929
  return toBase64Url(sha256(manifestBytes));
4906
4930
  }
4907
- var u32$2 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
4931
+ var u32$3 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
4908
4932
  /**
4909
4933
  * Lets the thread go for one turn: what waits (input, drawing, timers, port messages, IndexedDB answers) runs, then the
4910
4934
  * caller goes on. A message to itself, queued behind the page's other tasks. Never `scheduler.yield()`: in Chromium its
@@ -4980,7 +5004,7 @@ function readAppBundleHead(bytes) {
4980
5004
  ok: false,
4981
5005
  reason: "truncated"
4982
5006
  };
4983
- const manifestLength = u32$2(bytes, at);
5007
+ const manifestLength = u32$3(bytes, at);
4984
5008
  at += 4;
4985
5009
  if (manifestLength > APP_BUNDLE_LIMITS.manifestBytes) return {
4986
5010
  ok: false,
@@ -4992,7 +5016,7 @@ function readAppBundleHead(bytes) {
4992
5016
  };
4993
5017
  const manifestBytes = bytes.subarray(at, at + manifestLength);
4994
5018
  at += manifestLength;
4995
- const statementLength = u32$2(bytes, at);
5019
+ const statementLength = u32$3(bytes, at);
4996
5020
  at += 4;
4997
5021
  if (bytes.length < at + statementLength) return {
4998
5022
  ok: false,
@@ -5184,9 +5208,9 @@ var ContactRequestError = class extends Error {
5184
5208
  this.name = "ContactRequestError";
5185
5209
  }
5186
5210
  };
5187
- var label = (text) => utf8Encode(text);
5211
+ var label$1 = (text) => utf8Encode(text);
5188
5212
  function derive(linkKeyZ32, info) {
5189
- return hkdf(sha256, publicKeyFromZ32(linkKeyZ32), label("ghostly-contact/1"), label(info), 32);
5213
+ return hkdf(sha256, publicKeyFromZ32(linkKeyZ32), label$1("ghostly-contact/1"), label$1(info), 32);
5190
5214
  }
5191
5215
  /** The UTC day number of a time: a stamp is made for one. */
5192
5216
  function contactDay(ms) {
@@ -5194,7 +5218,7 @@ function contactDay(ms) {
5194
5218
  }
5195
5219
  /** The `seen` entry of an asker key on a link: the first 9 bytes of a hash, so the record names nobody. */
5196
5220
  function seenEntry(linkKeyZ32, askerZ32) {
5197
- return toBase64Url(sha256(concatBytes(label("ghostly-contact/1 seen"), publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32))).slice(0, 9));
5221
+ return toBase64Url(sha256(concatBytes(label$1("ghostly-contact/1 seen"), publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32))).slice(0, 9));
5198
5222
  }
5199
5223
  function linkRecords(record) {
5200
5224
  if (!Number.isInteger(record.bits) || record.bits < 16 || record.bits > 24) throw new Error("A link asks for 16 to 24 bits");
@@ -5232,7 +5256,7 @@ function readLinkRecord(records) {
5232
5256
  function stampPrefix(linkKeyZ32, askerZ32, day) {
5233
5257
  const tail = /* @__PURE__ */ new Uint8Array(4);
5234
5258
  new DataView(tail.buffer).setUint32(0, day);
5235
- return concatBytes(label("ghostly-contact/1 stamp"), publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32), tail);
5259
+ return concatBytes(label$1("ghostly-contact/1 stamp"), publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32), tail);
5236
5260
  }
5237
5261
  function leadingZeroBits(hash) {
5238
5262
  let bits = 0;
@@ -5294,7 +5318,7 @@ function knockSlotOf(linkKeyZ32, askerZ32) {
5294
5318
  }
5295
5319
  function knockSlotRecords(linkKeyZ32, knocks) {
5296
5320
  const nonce = randomBytes(NONCE_LENGTH$3);
5297
- const body = label(JSON.stringify(knocks.slice(-6).map((k) => [
5321
+ const body = label$1(JSON.stringify(knocks.slice(-6).map((k) => [
5298
5322
  k.key,
5299
5323
  k.day,
5300
5324
  k.stamp
@@ -5329,9 +5353,9 @@ function mergeContactKnocks(existing, mine, now) {
5329
5353
  return [...existing.filter((k) => k.key !== mine.key && k.day >= today - 1 && k.day <= today + 1).slice(-5), mine];
5330
5354
  }
5331
5355
  function requestKey(linkKeyZ32, askerZ32, shared) {
5332
- return hkdf(sha256, shared, label("ghostly-contact/1 request"), concatBytes(publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32)), 32);
5356
+ return hkdf(sha256, shared, label$1("ghostly-contact/1 request"), concatBytes(publicKeyFromZ32(linkKeyZ32), publicKeyFromZ32(askerZ32)), 32);
5333
5357
  }
5334
- var REQUEST_AAD = label("ghostly-contact/1 request");
5358
+ var REQUEST_AAD = label$1("ghostly-contact/1 request");
5335
5359
  /** The value of a request's record for a plaintext of `length` bytes. */
5336
5360
  var sealedValueLength = (length) => Math.ceil((NONCE_LENGTH$3 + length + TAG_LENGTH) * 4 / 3);
5337
5361
  var plaintextBytes;
@@ -5369,7 +5393,7 @@ function requestRecords(askerSeedB64, linkKeyZ32, request) {
5369
5393
  if (!inviteHolds(request.invite)) throw new ContactRequestError("invite");
5370
5394
  if (!Number.isSafeInteger(request.issued) || !Number.isSafeInteger(request.expires) || request.expires <= request.issued || request.expires - request.issued > 6048e5) throw new ContactRequestError("dates");
5371
5395
  const asker = identityFromSeedB64(askerSeedB64);
5372
- const json = label(JSON.stringify([
5396
+ const json = label$1(JSON.stringify([
5373
5397
  1,
5374
5398
  request.invite,
5375
5399
  request.name,
@@ -8436,6 +8460,13 @@ var UNUSED_INVITE_WAIT_MAX_MS = 18e4;
8436
8460
  * hunt 1014-0136, 2026-10-14).
8437
8461
  */
8438
8462
  var UNUSED_INVITE_READS_PER_MINUTE = 10;
8463
+ /**
8464
+ * An invite this side made that nobody used, once no longer awaited, puts its key and its mailbox out this often, not
8465
+ * every `PRESENCE_HEARTBEAT`: 20 of them added about 17 relay writes a minute for as long as the app ran (bug hunt,
8466
+ * 2026-10-30). Not longer: a joiner goes live sooner while it finds both still good, the packet within `PRESENCE_WINDOW`
8467
+ * and the envelope unexpired. At 30 minutes the slowest of 6 joins took 235 s, against 86 s of 9 at the heartbeat's pace.
8468
+ */
8469
+ var UNUSED_INVITE_UPKEEP_MS = 48e4;
8439
8470
  /** The keys and mailboxes of unused invites read slowly over each transport (an app's relays). */
8440
8471
  var unusedInviteReaders = /* @__PURE__ */ new WeakMap();
8441
8472
  /** Counts `reader` (an invite's key or mailbox) among the unused ones read over `transport` while `unused`, or no longer: how many there are. */
@@ -8532,6 +8563,8 @@ var LinkSession = class {
8532
8563
  awaitingSince;
8533
8564
  /** This side's invite, nobody used yet (`LinkSessionOptions.invite`). */
8534
8565
  invite;
8566
+ /** This side's own invite, nobody used yet (`LinkSessionOptions.ownInvite`). */
8567
+ ownInvite;
8535
8568
  intervals;
8536
8569
  fastPollUntil = 0;
8537
8570
  /** An offer to a saved contact is out: from then on its fast window looks less often (`OFFER_FAST_MS`); 0 for none. */
@@ -8600,6 +8633,7 @@ var LinkSession = class {
8600
8633
  this.resumeReads = !!options.resumed;
8601
8634
  this.awaitingSince = Math.min(options.awaitingSince ?? this.startedAt, this.startedAt);
8602
8635
  this.invite = options.invite ?? (() => false);
8636
+ this.ownInvite = options.ownInvite ?? (() => false);
8603
8637
  }
8604
8638
  get peerPresence() {
8605
8639
  return this.presence;
@@ -8890,10 +8924,15 @@ var LinkSession = class {
8890
8924
  if (this.heartbeatTimer) clearTimeout(this.heartbeatTimer);
8891
8925
  this.heartbeatTimer = setTimeout(() => {
8892
8926
  if (!this.running) return;
8893
- if (this.getServices() !== void 0) this.publish(true).catch(() => {});
8927
+ if (this.getServices() !== void 0 && !this.upkeepWaits()) this.publish(true).catch(() => {});
8894
8928
  this.scheduleHeartbeat();
8895
8929
  }, PRESENCE_HEARTBEAT);
8896
8930
  }
8931
+ /** An unused invite of this side's, no longer awaited, whose packet went out less than `UNUSED_INVITE_UPKEEP_MS` ago. */
8932
+ upkeepWaits() {
8933
+ const now = Date.now();
8934
+ return this.ownInvite() && !this.presence.online && !this.connected && now - this.awaitingSince >= 6e5 && now - this.lastPublishedAt < 36e4;
8935
+ }
8897
8936
  /**
8898
8937
  * Coalesces publishes: at most one in flight and one queued behind it. `upkeep`: nothing new to say (the heartbeat, a
8899
8938
  * retry of what waits): with nothing else asked for since, the packet goes as upkeep (`publishOnce`).
@@ -9747,6 +9786,476 @@ var DataLink = class {
9747
9786
  }
9748
9787
  };
9749
9788
  //#endregion
9789
+ //#region ../core/src/ratchet.ts
9790
+ /**
9791
+ * The ratchet of a 1:1 chat's stored paths (WISP 4xx-ratchet, reserved number 407): what goes on the DHT floor
9792
+ * (WISP 403) and what is held (WISP 404) is sealed with a key used once, from a double ratchet in the manner of
9793
+ * Signal's (an X25519 step each time the turn passes, a one-way chain per message), so a participation key stolen
9794
+ * later opens none of it once the turn has passed. The live session needs none: its transports agree fresh keys on
9795
+ * every connection.
9796
+ *
9797
+ * Pure: every call takes a state and returns the next one. The caller holds one lock per chat from reading the state
9798
+ * to saving the next (an open's until what it opened is stored), and saves a seal's state before the sealed bytes
9799
+ * leave the device. Nothing here reads a clock or the network but through its options.
9800
+ */
9801
+ var RATCHET_CAPABILITY = "ratchet/1";
9802
+ var LANE = {
9803
+ floor: 1,
9804
+ hold: 2
9805
+ };
9806
+ var VERSION$1 = 1;
9807
+ var SID_BYTES = 8;
9808
+ /** version, lane, session id, the sender's ratchet key, the hold lane's previous chain length, the message number. */
9809
+ var RATCHET_HEADER_BYTES = 50;
9810
+ /** What sealing adds to a plaintext: the header and the 16-byte tag (the nonce is derived, never sent). */
9811
+ var RATCHET_OVERHEAD = 66;
9812
+ /**
9813
+ * How far a message may be ahead of the last one opened on its chain. A mailbox shows only its newest envelope, so the
9814
+ * floor's between were replaced unread: their keys are stepped over and never kept. A held item's are kept. A sender
9815
+ * whose chain reaches the bound without the turn passing starts a new session rather than seal past it.
9816
+ */
9817
+ var MAX_SKIP = {
9818
+ floor: 4096,
9819
+ hold: 512
9820
+ };
9821
+ /** Keys kept for held items not opened yet, at most, oldest dropped first. */
9822
+ var MAX_SKIPPED_KEYS = 512;
9823
+ /** A kept key, and a session only received on, is dropped this long after it was last of use: a held item lives 7 days. */
9824
+ var RATCHET_KEEP_MS = 6912e5;
9825
+ /**
9826
+ * A session that lost (`lost`) becomes current when its floor envelopes keep rising in sequence while the current one
9827
+ * has opened no floor envelope for this long: two that started at once settle within one keep-alive (about four
9828
+ * minutes), and a contact that lost its state meanwhile seals in its own session from then on.
9829
+ */
9830
+ var FOLLOW_MS = 6e5;
9831
+ var emptyRatchetState = () => ({
9832
+ v: 1,
9833
+ others: [],
9834
+ skipped: [],
9835
+ retired: [],
9836
+ heard: {}
9837
+ });
9838
+ /** Sessions only opened with, at most. */
9839
+ var MAX_OTHERS = 2;
9840
+ var b64 = toBase64Url;
9841
+ var unb64 = fromBase64Url;
9842
+ var label = (text) => utf8Encode(`ghostly-ratchet/1 ${text}`);
9843
+ var mac = (key, text) => hmac(sha256, key, label(text));
9844
+ function u32$2(n) {
9845
+ if (!Number.isSafeInteger(n) || n < 0 || n > 4294967295) throw new Error("Ratchet counter out of range");
9846
+ return new Uint8Array([
9847
+ n >>> 24,
9848
+ n >>> 16 & 255,
9849
+ n >>> 8 & 255,
9850
+ n & 255
9851
+ ]);
9852
+ }
9853
+ var readU32 = (b, at) => (b[at] << 24 >>> 0) + (b[at + 1] << 16) + (b[at + 2] << 8) + b[at + 3];
9854
+ function compareBytes$3(a, b) {
9855
+ for (let i = 0; i < Math.min(a.length, b.length); i++) if (a[i] !== b[i]) return a[i] - b[i];
9856
+ return a.length - b.length;
9857
+ }
9858
+ /** X25519, or null for a key that gives no secret (a low-order point): such an item does not open. */
9859
+ function agree(secret, pub) {
9860
+ try {
9861
+ return x25519.getSharedSecret(secret, pub);
9862
+ } catch {
9863
+ return null;
9864
+ }
9865
+ }
9866
+ function context(keys) {
9867
+ const secret = ed25519.utils.toMontgomerySecret(keys.seed);
9868
+ return {
9869
+ keys,
9870
+ secret,
9871
+ pub: x25519.getPublicKey(secret),
9872
+ peer: ed25519.utils.toMontgomery(publicKeyFromZ32(keys.peer)),
9873
+ first: compareBytes$3(publicKeyFromZ32(keys.self), publicKeyFromZ32(keys.peer)) < 0
9874
+ };
9875
+ }
9876
+ function root(c, sid) {
9877
+ const { keys } = c;
9878
+ const info = utf8Encode(JSON.stringify([
9879
+ "ghostly-ratchet/1",
9880
+ [...keys.rendezvous].sort(),
9881
+ [keys.self, keys.peer].sort()
9882
+ ]));
9883
+ const salt = hkdf(sha256, keys.secret, info, label("salt"), 32);
9884
+ return hkdf(sha256, x25519.getSharedSecret(c.secret, c.peer), salt, concatBytes(label("root"), sid), 32);
9885
+ }
9886
+ /** The root key a session starts from: the two participation keys' agreement, salted by the invite and the chat, per session id. */
9887
+ var ratchetRoot = (keys, sid) => root(context(keys), sid);
9888
+ /** A ratchet step: the next root key and the chain key it gives, from an X25519 output. */
9889
+ function stepRoot(rk, dh) {
9890
+ const okm = hkdf(sha256, dh, rk, label("step"), 64);
9891
+ return [okm.slice(0, 32), okm.slice(32)];
9892
+ }
9893
+ var lanes = (ck) => ({
9894
+ floor: {
9895
+ k: b64(mac(ck, "lane floor")),
9896
+ n: 0
9897
+ },
9898
+ hold: {
9899
+ k: b64(mac(ck, "lane hold")),
9900
+ n: 0
9901
+ }
9902
+ });
9903
+ /** One message key off a chain, and the chain moved past it. */
9904
+ function advance(chain) {
9905
+ const ck = unb64(chain.k);
9906
+ return [hmac(sha256, ck, new Uint8Array([1])), {
9907
+ k: b64(hmac(sha256, ck, new Uint8Array([2]))),
9908
+ n: chain.n + 1
9909
+ }];
9910
+ }
9911
+ function newSession(c, sid, random, now) {
9912
+ const rk0 = root(c, sid);
9913
+ const initial = lanes(mac(rk0, "initial"));
9914
+ const base = {
9915
+ sid: b64(sid),
9916
+ pnHold: 0,
9917
+ heard: false,
9918
+ fs: false,
9919
+ at: now,
9920
+ made: now
9921
+ };
9922
+ if (!c.first) return {
9923
+ ...base,
9924
+ rk: b64(rk0),
9925
+ dhs: null,
9926
+ dhsPub: b64(c.pub),
9927
+ dhr: null,
9928
+ send: initial,
9929
+ recv: null
9930
+ };
9931
+ const dhs = random(32);
9932
+ const [rk, ck] = stepRoot(rk0, x25519.getSharedSecret(dhs, c.peer));
9933
+ return {
9934
+ ...base,
9935
+ rk: b64(rk),
9936
+ dhs: b64(dhs),
9937
+ dhsPub: b64(x25519.getPublicKey(dhs)),
9938
+ dhr: b64(c.peer),
9939
+ send: lanes(ck),
9940
+ recv: initial
9941
+ };
9942
+ }
9943
+ function messageKeys(mk) {
9944
+ const okm = hkdf(sha256, mk, /* @__PURE__ */ new Uint8Array(32), label("message"), 56);
9945
+ return {
9946
+ key: okm.slice(0, 32),
9947
+ nonce: okm.slice(32)
9948
+ };
9949
+ }
9950
+ function aad(lane, sender, recipient, header) {
9951
+ return concatBytes(utf8Encode("ghostly-ratchet/1"), new Uint8Array([LANE[lane]]), publicKeyFromZ32(sender), publicKeyFromZ32(recipient), header);
9952
+ }
9953
+ function header$1(lane, session, n) {
9954
+ return concatBytes(new Uint8Array([VERSION$1, LANE[lane]]), unb64(session.sid), unb64(session.dhsPub), u32$2(session.pnHold), u32$2(n));
9955
+ }
9956
+ function parseHeader(sealed) {
9957
+ if (sealed.length < 66 || sealed[0] !== VERSION$1 || sealed[1] !== 1 && sealed[1] !== 2) return null;
9958
+ const at = 42;
9959
+ return {
9960
+ lane: sealed[1] === 1 ? "floor" : "hold",
9961
+ sid: b64(sealed.slice(2, 10)),
9962
+ dh: b64(sealed.slice(10, at)),
9963
+ pnHold: readU32(sealed, at),
9964
+ n: readU32(sealed, 46)
9965
+ };
9966
+ }
9967
+ function prune(state, now) {
9968
+ state.skipped = state.skipped.filter((k) => k.at + RATCHET_KEEP_MS > now).slice(-512);
9969
+ for (const old of state.others.filter((o) => o.at + RATCHET_KEEP_MS <= now)) retire(state, old);
9970
+ state.others = state.others.filter((o) => o.at + RATCHET_KEEP_MS > now);
9971
+ }
9972
+ function retire(state, session) {
9973
+ if (!session) return;
9974
+ if (!state.retired.includes(session.sid)) state.retired = [...state.retired, session.sid].slice(-16);
9975
+ state.skipped = state.skipped.filter((k) => k.s !== session.sid);
9976
+ }
9977
+ /** `session` is only opened with from now on; past `MAX_OTHERS`, the one used least lately is retired. */
9978
+ function demote(state, session) {
9979
+ state.others = [...state.others.filter((o) => o.sid !== session.sid), session].sort((a, b) => a.at - b.at);
9980
+ while (state.others.length > MAX_OTHERS) retire(state, state.others.shift());
9981
+ }
9982
+ /**
9983
+ * Seals one item for the contact on a lane, with the current session (started here when there is none, or when its
9984
+ * chain on this lane reached `MAX_SKIP` without the turn passing: past it the contact could not step over to it). The
9985
+ * state returned MUST be saved before the sealed bytes leave the device: a key is used once, and a crash between the
9986
+ * two that kept the old state would use it again on other bytes.
9987
+ */
9988
+ function ratchetSeal(prev, keys, lane, plaintext, options = {}) {
9989
+ const now = options.now ?? Date.now(), random = options.random ?? randomBytes;
9990
+ const state = structuredClone(prev);
9991
+ prune(state, now);
9992
+ if (state.current && state.current.send[lane].n >= MAX_SKIP[lane]) {
9993
+ demote(state, state.current);
9994
+ delete state.current;
9995
+ }
9996
+ const session = state.current ??= newSession(context(keys), random(SID_BYTES), random, now);
9997
+ const [mk, next] = advance(session.send[lane]);
9998
+ const head = header$1(lane, session, session.send[lane].n);
9999
+ session.send[lane] = next;
10000
+ session.at = now;
10001
+ const { key, nonce } = messageKeys(mk);
10002
+ return {
10003
+ state,
10004
+ sealed: concatBytes(head, xchacha20poly1305(key, nonce, aad(lane, keys.self, keys.peer, head)).encrypt(plaintext))
10005
+ };
10006
+ }
10007
+ /**
10008
+ * Opens `sealed` under `session`, changing it and `state` in place (both are a copy the caller throws away on null).
10009
+ * Every bound is checked before any X25519 or chain step.
10010
+ */
10011
+ function openWith(state, session, c, h, sealed, random, now) {
10012
+ const decrypt = (mk) => {
10013
+ const { key, nonce } = messageKeys(mk);
10014
+ try {
10015
+ return xchacha20poly1305(key, nonce, aad(h.lane, c.keys.peer, c.keys.self, sealed.subarray(0, 50))).decrypt(sealed.subarray(50));
10016
+ } catch {
10017
+ return null;
10018
+ }
10019
+ };
10020
+ if (h.lane === "hold") {
10021
+ const i = state.skipped.findIndex((k) => k.s === session.sid && k.d === h.dh && k.n === h.n);
10022
+ if (i >= 0) {
10023
+ const plain = decrypt(unb64(state.skipped[i].k));
10024
+ if (plain) state.skipped.splice(i, 1);
10025
+ return plain;
10026
+ }
10027
+ }
10028
+ const keep = (lane, dh, from, until) => {
10029
+ let chain = from;
10030
+ while (chain.n < until) {
10031
+ const [mk, next] = advance(chain);
10032
+ if (lane === "hold") state.skipped.push({
10033
+ s: session.sid,
10034
+ d: dh,
10035
+ n: chain.n,
10036
+ k: b64(mk),
10037
+ at: now
10038
+ });
10039
+ chain = next;
10040
+ }
10041
+ return chain;
10042
+ };
10043
+ const bound = MAX_SKIP[h.lane];
10044
+ if (h.dh !== session.dhr) {
10045
+ const old = session.recv && session.dhr ? session.recv.hold : null;
10046
+ if (h.n > bound || old && h.pnHold > old.n && h.pnHold - old.n > MAX_SKIP.hold) return null;
10047
+ const received = agree(session.dhs ? unb64(session.dhs) : c.secret, unb64(h.dh));
10048
+ if (!received) return null;
10049
+ if (old && session.dhr) keep("hold", session.dhr, old, h.pnHold);
10050
+ let [rk, ck] = stepRoot(unb64(session.rk), received);
10051
+ const steppedWithOwn = session.dhs !== null;
10052
+ session.recv = lanes(ck);
10053
+ session.dhr = h.dh;
10054
+ session.pnHold = session.send.hold.n;
10055
+ const dhs = random(32);
10056
+ [rk, ck] = stepRoot(rk, x25519.getSharedSecret(dhs, unb64(h.dh)));
10057
+ session.rk = b64(rk);
10058
+ session.dhs = b64(dhs);
10059
+ session.dhsPub = b64(x25519.getPublicKey(dhs));
10060
+ session.send = lanes(ck);
10061
+ if (steppedWithOwn && h.dh !== b64(c.peer)) session.fs = true;
10062
+ }
10063
+ if (!session.recv) return null;
10064
+ const chain = session.recv[h.lane];
10065
+ if (h.n < chain.n || h.n - chain.n > bound) return null;
10066
+ const [mk, next] = advance(keep(h.lane, h.dh, chain, h.n));
10067
+ const plain = decrypt(mk);
10068
+ if (!plain) return null;
10069
+ session.recv[h.lane] = next;
10070
+ session.heard = true;
10071
+ session.at = now;
10072
+ return plain;
10073
+ }
10074
+ /**
10075
+ * Opens an item the contact sealed. Null: not a ratcheted item of this chat on this lane, or one already opened, or
10076
+ * past the bounds. Otherwise the plaintext, and `finish`, which gives the state to save once the item is stored and
10077
+ * passed its path's own checks (a newer DHT sequence, a held item not taken before): those, not the ratchet, are what
10078
+ * refuse a replay. `order`: a floor envelope's sequence, read from the body once opened. `fresh`: it came under a
10079
+ * session this side did not know.
10080
+ */
10081
+ function ratchetOpen(prev, keys, lane, sealed, options = {}) {
10082
+ const now = options.now ?? Date.now(), random = options.random ?? randomBytes;
10083
+ const h = parseHeader(sealed);
10084
+ if (!h || h.lane !== lane) return null;
10085
+ const state = structuredClone(prev);
10086
+ prune(state, now);
10087
+ const c = context(keys);
10088
+ const seen = (session, order) => {
10089
+ if (lane !== "floor" || order === void 0 || !Number.isSafeInteger(order)) return false;
10090
+ const rising = session.floorSeq !== void 0 && order > session.floorSeq;
10091
+ session.floorSeq = Math.max(session.floorSeq ?? 0, order);
10092
+ session.floorAt = now;
10093
+ return rising;
10094
+ };
10095
+ const done = () => {
10096
+ state.heard[lane] = true;
10097
+ prune(state, now);
10098
+ return state;
10099
+ };
10100
+ const known = state.current?.sid === h.sid ? state.current : state.others.find((o) => o.sid === h.sid);
10101
+ if (known) {
10102
+ const plaintext = openWith(state, known, c, h, sealed, random, now);
10103
+ if (!plaintext) return null;
10104
+ return {
10105
+ plaintext,
10106
+ fresh: false,
10107
+ finish: (order) => {
10108
+ const rising = seen(known, order), current = state.current;
10109
+ if (rising && known.lost && current && known !== current && current.floorSeq === void 0 && now - (current.floorAt ?? current.made) > 6e5) {
10110
+ state.others = state.others.filter((o) => o.sid !== known.sid);
10111
+ delete known.lost;
10112
+ demote(state, current);
10113
+ state.current = known;
10114
+ }
10115
+ return done();
10116
+ }
10117
+ };
10118
+ }
10119
+ if (state.retired.includes(h.sid)) return null;
10120
+ if (h.n > MAX_SKIP[lane] || h.pnHold > MAX_SKIP.hold) return null;
10121
+ const fresh = newSession(c, unb64(h.sid), random, now);
10122
+ const plaintext = openWith(state, fresh, c, h, sealed, random, now);
10123
+ if (!plaintext) return null;
10124
+ return {
10125
+ plaintext,
10126
+ fresh: true,
10127
+ finish: (order) => {
10128
+ seen(fresh, order);
10129
+ const current = state.current;
10130
+ if (!current) state.current = fresh;
10131
+ else if (current.floorSeq === void 0) {
10132
+ if (compareBytes$3(unb64(h.sid), unb64(current.sid)) > 0) {
10133
+ current.lost = true;
10134
+ demote(state, current);
10135
+ state.current = fresh;
10136
+ } else {
10137
+ fresh.lost = true;
10138
+ demote(state, fresh);
10139
+ }
10140
+ } else if (lane === "floor" && fresh.floorSeq !== void 0 && fresh.floorSeq > current.floorSeq) {
10141
+ demote(state, current);
10142
+ state.current = fresh;
10143
+ } else if (lane === "floor") {
10144
+ fresh.lost = true;
10145
+ demote(state, fresh);
10146
+ } else state.skipped = state.skipped.filter((k) => k.s !== fresh.sid);
10147
+ return done();
10148
+ }
10149
+ };
10150
+ }
10151
+ /** Whether `sealed` is shaped as a ratcheted item of this lane (it may still not open). */
10152
+ var isRatcheted = (sealed, lane) => parseHeader(sealed)?.lane === lane;
10153
+ /** The session a ratcheted item of this lane names (its `sid`, base64url), as its header says; undefined for anything else. */
10154
+ var ratchetSessionOf = (sealed, lane) => {
10155
+ const h = parseHeader(sealed);
10156
+ return h?.lane === lane ? h.sid : void 0;
10157
+ };
10158
+ /**
10159
+ * Whether `sealed` names a session this side has no state of and did not retire: neither the current one nor one of the
10160
+ * others. What the contact sealed in the session it shares with a device this profile was on before (a Move, a restore:
10161
+ * WISP 4xx § Several devices) is such an item, once the turn passed there; so is anything under a made-up `sid`. It says
10162
+ * nothing of whether the item is genuine: only that this side could not tell, having never had the session.
10163
+ */
10164
+ function ratchetUnknownSession(state, sealed, lane) {
10165
+ const h = parseHeader(sealed);
10166
+ if (!h || h.lane !== lane) return false;
10167
+ const s = state ?? emptyRatchetState();
10168
+ return s.current?.sid !== h.sid && !s.others.some((o) => o.sid === h.sid) && !s.retired.includes(h.sid);
10169
+ }
10170
+ /** Whether forward secrecy is on for this chat: the turn passed both ways in the session this side seals with. */
10171
+ var ratchetOn = (state) => !!state?.current?.fs;
10172
+ /** Whether a lane refuses plain items from the contact: a ratcheted one opened there (WISP 4xx § Downgrade). */
10173
+ var ratchetHeard = (state, lane) => !!state?.heard[lane];
10174
+ /**
10175
+ * One chat's ratchet, shared by its two lanes (the DHT floor and held items): the one lock per chat of WISP 4xx §
10176
+ * Saving state, and the order of saving. Every change goes through `lock`, so a seal and an open never start from the
10177
+ * same state.
10178
+ */
10179
+ var RatchetBox = class {
10180
+ keys;
10181
+ state;
10182
+ save;
10183
+ chain = Promise.resolve();
10184
+ constructor(keys, state, save) {
10185
+ this.keys = keys;
10186
+ this.state = state;
10187
+ this.save = save;
10188
+ }
10189
+ /** Runs `fn` alone among this chat's ratchet changes; `seal` and `open` are called inside it only. */
10190
+ lock(fn) {
10191
+ const run = this.chain.then(() => fn(this.transaction()));
10192
+ this.chain = run.then(() => {}, () => {});
10193
+ return run;
10194
+ }
10195
+ transaction() {
10196
+ return {
10197
+ seal: async (lane, plaintext) => {
10198
+ const { state, sealed } = ratchetSeal(this.state, this.keys(), lane, plaintext);
10199
+ await this.save(state);
10200
+ this.state = state;
10201
+ return sealed;
10202
+ },
10203
+ open: (lane, sealed) => {
10204
+ const opened = ratchetOpen(this.state, this.keys(), lane, sealed);
10205
+ if (!opened) return null;
10206
+ return {
10207
+ plaintext: opened.plaintext,
10208
+ fresh: opened.fresh,
10209
+ commit: async (order) => {
10210
+ const state = opened.finish(order);
10211
+ await this.save(state);
10212
+ this.state = state;
10213
+ }
10214
+ };
10215
+ }
10216
+ };
10217
+ }
10218
+ /**
10219
+ * Opens without keeping anything, and without the lock: a look from another profile, or the first half of a receive
10220
+ * whose content is then stored with no lock held (`commitOpen` keeps it).
10221
+ */
10222
+ peek(lane, sealed) {
10223
+ return ratchetOpen(this.state, this.keys(), lane, sealed)?.plaintext ?? null;
10224
+ }
10225
+ /**
10226
+ * The second half of a receive, once what `peek` gave is stored: opened again under the lock on the state as it is now
10227
+ * (a seal or another open may have moved it meanwhile), and that state saved. False: it no longer opens (taken by a
10228
+ * receive of the same item meanwhile), and nothing moved. So the lock is never held while content is stored, which
10229
+ * may call back into the other lane.
10230
+ */
10231
+ commitOpen(lane, sealed, order) {
10232
+ return this.lock(async (tx) => {
10233
+ const opened = tx.open(lane, sealed);
10234
+ if (!opened) return false;
10235
+ await opened.commit(order);
10236
+ return true;
10237
+ });
10238
+ }
10239
+ heard(lane) {
10240
+ return ratchetHeard(this.state, lane);
10241
+ }
10242
+ /** A ratcheted item from the contact opened on either lane: this side seals with the ratchet whatever the contact's record says. */
10243
+ get heardAny() {
10244
+ return this.heard("floor") || this.heard("hold");
10245
+ }
10246
+ get on() {
10247
+ return ratchetOn(this.state);
10248
+ }
10249
+ /** The session this side seals with now, if any (its `sid`). */
10250
+ get session() {
10251
+ return this.state.current?.sid;
10252
+ }
10253
+ /** `ratchetUnknownSession` on the state as it is: an item under a session this side never had. */
10254
+ unknownSession(lane, sealed) {
10255
+ return ratchetUnknownSession(this.state, sealed, lane);
10256
+ }
10257
+ };
10258
+ //#endregion
9750
10259
  //#region ../core/src/groupCrypto.ts
9751
10260
  /**
9752
10261
  * The cryptography of the `group-mesh/1` profile (WISP 900 / 902 group mesh).
@@ -12003,6 +12512,11 @@ var DhtDelivery = class DhtDelivery {
12003
12512
  live = false;
12004
12513
  active = false;
12005
12514
  startedAt = Date.now();
12515
+ /**
12516
+ * When an envelope of the contact's newer than any before was last read here, in this run. A contact that is there
12517
+ * puts a keep-alive every four minutes: none in `PRESENCE_WINDOW`, it is away (`publish`).
12518
+ */
12519
+ peerNewAt = -Infinity;
12006
12520
  /** The next read was asked for (a refresh, a fresh packet of the contact): it is not a background one. */
12007
12521
  urgent = false;
12008
12522
  /** Reads left that are signaling: the contact is leaving DHT only, and the live link waits on them (`expect`). */
@@ -12076,9 +12590,29 @@ var DhtDelivery = class DhtDelivery {
12076
12590
  maxTextBytes: 256,
12077
12591
  ...this.lastPublished && { lastPublished: this.lastPublished },
12078
12592
  ...this.foreignKeySeenAt && { foreignKeySeenAt: this.foreignKeySeenAt },
12079
- ...this.state.inviteTaken && { inviteTaken: true }
12593
+ ...this.state.inviteTaken && { inviteTaken: true },
12594
+ ...this.forwardSecrecy && { forwardSecrecy: this.forwardSecrecy }
12080
12595
  };
12081
12596
  }
12597
+ get forwardSecrecy() {
12598
+ const ratchet = this.options.ratchet;
12599
+ if (!ratchet || !this.options.credentials.peerKey) return void 0;
12600
+ const supports = ratchet.peerSupports();
12601
+ return ratchet.box.on && supports ? "on" : !supports ? ratchet.box.heardAny ? "stopped" : "unsupported" : "starting";
12602
+ }
12603
+ /**
12604
+ * Whether an envelope to `recipient` is sealed with the ratchet: the contact is pinned and its record lists
12605
+ * `ratchet/1`, or a ratcheted envelope of its was opened here, after which nothing goes plain (WISP 4xx § Downgrade).
12606
+ * And the contact pinned this side too (an envelope of its sealed to this side read, or a live session had): a joiner
12607
+ * pins its inviter from the invite, and its first contact sealed with the ratchet would reach an inviter that has no key
12608
+ * to open it with, and so never pins it.
12609
+ */
12610
+ ratcheted(recipient) {
12611
+ const ratchet = this.options.ratchet, peer = this.options.credentials.peerKey;
12612
+ if (!ratchet || !peer || recipient !== peer) return false;
12613
+ if (ratchet.box.heardAny) return true;
12614
+ return ratchet.peerSupports() && (!!this.state.peerPinned || !!this.state.wasLive);
12615
+ }
12082
12616
  /**
12083
12617
  * This side joined, and its inviter never answered (`DhtDeliveryState.unanswered`): no envelope of its newer than the
12084
12618
  * one that pinned it, none sealed to this side, no text confirmed, never live (as `sealedToAnother` asks too).
@@ -12117,6 +12651,14 @@ var DhtDelivery = class DhtDelivery {
12117
12651
  return this.pinnedBoxes;
12118
12652
  }
12119
12653
  lastPublished;
12654
+ /** The envelope a trace line was last said for, per step: a packet read again says nothing new (a Desktop logs every line). */
12655
+ traced = /* @__PURE__ */ new Map();
12656
+ traceOnce(step, record, detail) {
12657
+ const seen = record.slice(-24);
12658
+ if (this.traced.get(step) === seen) return;
12659
+ this.traced.set(step, seen);
12660
+ traceLink(this.from, step, detail);
12661
+ }
12120
12662
  /** The sealed record's nonce is its first 24 bytes: 32 characters of base64. */
12121
12663
  static facts(body, records, key) {
12122
12664
  return {
@@ -12172,6 +12714,13 @@ var DhtDelivery = class DhtDelivery {
12172
12714
  ]));
12173
12715
  }
12174
12716
  records(body, recipient = this.options.credentials.peerKey) {
12717
+ return this.envelope(body, recipient).records;
12718
+ }
12719
+ /**
12720
+ * The envelope's records. Ratcheted (`ratcheted`), its `_dr` record is the right length but not sealed yet: `seal`
12721
+ * gives its bytes, under the chat's lock, once the publication is sure to go. Measuring a packet takes no key.
12722
+ */
12723
+ envelope(body, recipient = this.options.credentials.peerKey) {
12175
12724
  const signature = toBase64Url(sign(this.signed(body, recipient), this.participation.seed));
12176
12725
  const plaintext = JSON.stringify([body, signature]);
12177
12726
  const hint = recipient ? [{
@@ -12179,20 +12728,46 @@ var DhtDelivery = class DhtDelivery {
12179
12728
  value: encrypt(this.participation.pubKeyZ32, this.key),
12180
12729
  ttl: ENVELOPE_TTL
12181
12730
  }] : [];
12731
+ const ratchet = this.ratcheted(recipient);
12732
+ const sealedBytes = (bytes) => ratchet ? 4 * Math.ceil((66 + bytes) / 3) : sealedLength(bytes);
12733
+ const label = ratchet ? "_dr" : "_dm";
12182
12734
  const fits = (bytes) => bytes <= MAX_ENVELOPE_PLAINTEXT && measureRecords(this.identity.pubKeyZ32, [{
12183
- label: "_dm",
12184
- value: "A".repeat(sealedLength(bytes)),
12735
+ label,
12736
+ value: "A".repeat(sealedBytes(bytes)),
12185
12737
  ttl: ENVELOPE_TTL
12186
12738
  }, ...hint]) <= ENVELOPE_PACKET_BYTES;
12187
12739
  const bytes = utf8Encode(plaintext).length;
12188
12740
  if (!fits(bytes)) throw new Error("Text and authentication exceed the DHT packet budget. Shorten the message.");
12189
12741
  let padded = bytes;
12190
12742
  for (let step = 512; step >= 1; step >>= 1) if (fits(padded + step)) padded += step;
12191
- return [{
12192
- label: "_dm",
12193
- value: encrypt(plaintext + " ".repeat(padded - bytes), recipient ? this.sealedKey(recipient) : this.key),
12743
+ const full = plaintext + " ".repeat(padded - bytes);
12744
+ if (ratchet) return {
12745
+ records: [{
12746
+ label,
12747
+ value: "A".repeat(sealedBytes(padded)),
12748
+ ttl: ENVELOPE_TTL
12749
+ }, ...hint],
12750
+ plaintext: full
12751
+ };
12752
+ return { records: [{
12753
+ label,
12754
+ value: encrypt(full, recipient ? this.sealedKey(recipient) : this.key),
12194
12755
  ttl: ENVELOPE_TTL
12195
- }, ...hint];
12756
+ }, ...hint] };
12757
+ }
12758
+ /**
12759
+ * The records to publish: a ratcheted one sealed now, its state saved first (seal, save, send), from the plaintext
12760
+ * the envelope was measured with.
12761
+ */
12762
+ async sealed(envelope) {
12763
+ const { records, plaintext } = envelope;
12764
+ if (records[0]?.label !== "_dr") return records;
12765
+ if (plaintext === void 0) throw new Error("A ratcheted envelope without its plaintext");
12766
+ const sealed = await this.options.ratchet.box.lock((tx) => tx.seal("floor", utf8Encode(plaintext)));
12767
+ return [{
12768
+ ...records[0],
12769
+ value: toBase64(sealed)
12770
+ }, ...records.slice(1)];
12196
12771
  }
12197
12772
  async start() {
12198
12773
  if (this.running) return;
@@ -12311,6 +12886,7 @@ var DhtDelivery = class DhtDelivery {
12311
12886
  }
12312
12887
  validate(text, timestamp, id, reply, edit) {
12313
12888
  if (this.options.peerAcceptsText?.() === false) return DHT_TEXT_REFUSED;
12889
+ if (this.forwardSecrecy === "stopped") return DHT_RATCHET_STOPPED;
12314
12890
  if (!ID$3.test(id) || !Number.isSafeInteger(timestamp) || timestamp <= 0 || reply !== void 0 && !REPLY_TO.test(reply)) return "Invalid message.";
12315
12891
  if (edit !== void 0 && (reply !== void 0 || !ID$3.test(edit[0]) || !validEditNumber(edit[1]))) return "Invalid message.";
12316
12892
  if (utf8Encode(text).length > 256) return DHT_TEXT_TOO_LONG;
@@ -12585,10 +13161,10 @@ var DhtDelivery = class DhtDelivery {
12585
13161
  for (let count = pending.length; count > 0; count--) {
12586
13162
  const body = this.body(sequence, issued, expires, message, receipt, reply, pending.slice(0, count), edit, forwarded, file);
12587
13163
  try {
12588
- const records = this.records(body);
13164
+ const envelope = this.envelope(body);
12589
13165
  if (utf8Encode(JSON.stringify([body, "x".repeat(86)])).length <= MAX_ENVELOPE_PLAINTEXT) return {
12590
13166
  body,
12591
- records,
13167
+ ...envelope,
12592
13168
  reactions: count
12593
13169
  };
12594
13170
  } catch {}
@@ -12596,7 +13172,7 @@ var DhtDelivery = class DhtDelivery {
12596
13172
  const body = this.body(sequence, issued, expires, message, receipt, reply, [], edit, forwarded, file);
12597
13173
  return {
12598
13174
  body,
12599
- records: this.records(body),
13175
+ ...this.envelope(body),
12600
13176
  reactions: 0
12601
13177
  };
12602
13178
  }
@@ -12611,10 +13187,21 @@ var DhtDelivery = class DhtDelivery {
12611
13187
  if (keepAlive && (this.controlDue > now || this.state.inviteTaken)) return;
12612
13188
  const expires = pending?.expires ?? now - 12e4 + CONTROL_TTL;
12613
13189
  const issued = Math.min(now, Math.max(now - DHT_ISSUED_BACK_MS, expires - (pending ? DHT_MESSAGE_TTL : CONTROL_TTL), (pending?.message[1] ?? 0) - 3e4));
12614
- const { body, records, reactions } = this.fitted(this.sequence + 1, issued, expires, pending?.message ?? null, receipt?.id ?? null, pending?.reply, pending?.edit, pending?.forwarded, pending?.file);
13190
+ const identity = !reseal && this.state.peerPinned && this.state.peerPinned !== "can" && this.pinned()?.identity || this.identity;
13191
+ const away = !!this.options.credentials.peerKey && now - this.peerNewAt >= 6e5;
13192
+ const options = keepAlive && (this.live || away) ? { background: true } : void 0;
13193
+ const held = this.options.transport.publishHeld?.(identity.pubKeyZ32, options);
13194
+ if (held) {
13195
+ await this.heldBack(held, now, {
13196
+ lastPublish: this.lastPublish,
13197
+ controlDue: this.controlDue
13198
+ }, void 0, void 0);
13199
+ throw held;
13200
+ }
13201
+ const fittedEnvelope = this.fitted(this.sequence + 1, issued, expires, pending?.message ?? null, receipt?.id ?? null, pending?.reply, pending?.edit, pending?.forwarded, pending?.file);
13202
+ const { body, reactions } = fittedEnvelope;
12615
13203
  const reactionsWereDue = this.reactionsDue;
12616
13204
  this.reactionsDue = !reactions && !!this.options.reactions?.().length;
12617
- const identity = !reseal && this.state.peerPinned && this.state.peerPinned !== "can" && this.pinned()?.identity || this.identity;
12618
13205
  const sequence = body[1];
12619
13206
  await this.persist({
12620
13207
  ...this.state,
@@ -12631,20 +13218,23 @@ var DhtDelivery = class DhtDelivery {
12631
13218
  } : this.state.receipt
12632
13219
  });
12633
13220
  this.sequence = sequence;
13221
+ const records = await this.sealed(fittedEnvelope);
12634
13222
  const before = {
12635
13223
  lastPublish: this.lastPublish,
12636
13224
  controlDue: this.controlDue
12637
13225
  };
13226
+ const ownInvite = !this.options.credentials.expectedPeerKey && !this.active && this.unusedInviteAge(now) !== void 0;
12638
13227
  this.lastPublish = now;
12639
- this.controlDue = now + 24e4;
13228
+ this.controlDue = now + (ownInvite ? UNUSED_INVITE_UPKEEP_MS : 24e4);
12640
13229
  traceLink(this.from, "dht-publish", {
12641
13230
  mode: this.mode,
12642
13231
  seq: body[1],
12643
- ...identity !== this.identity && { pinned: true }
13232
+ ...identity !== this.identity && { pinned: true },
13233
+ ...records[0]?.label === "_dr" && { ratchet: true }
12644
13234
  });
12645
13235
  if (pending) this.lastPublished = DhtDelivery.facts(body, records, identity.pubKeyZ32);
12646
13236
  try {
12647
- await this.options.transport.publish(identity, records, keepAlive && this.live ? { background: true } : void 0);
13237
+ await this.options.transport.publish(identity, records, options);
12648
13238
  } catch (error) {
12649
13239
  this.reactionsDue ||= reactionsWereDue;
12650
13240
  if (isDiscoveryBudgetError(error)) await this.heldBack(error, now, before, pending, receipt);
@@ -12670,7 +13260,7 @@ var DhtDelivery = class DhtDelivery {
12670
13260
  this.lastPublish = before.lastPublish;
12671
13261
  this.controlDue = Math.min(before.controlDue, at);
12672
13262
  traceLink(this.from, "dht-publish-waits", { retryInMs: at - now });
12673
- await this.persist({
13263
+ if (pending || receipt) await this.persist({
12674
13264
  ...this.state,
12675
13265
  pending: pending ?? this.state.pending,
12676
13266
  receipt: receipt ?? this.state.receipt
@@ -12681,22 +13271,44 @@ var DhtDelivery = class DhtDelivery {
12681
13271
  * one sealed record, a well-formed body within its times, signed by the key it names. Null: not an envelope of the
12682
13272
  * contact's (the pin rules are the caller's).
12683
13273
  */
12684
- open(packet, box) {
13274
+ open(packet, box, ratchet) {
12685
13275
  const address = box === "pinned" ? this.pinned()?.peerAddress : this.peerAddress;
12686
13276
  if (!address || packet.pubKeyZ32 !== address || measureRecords(packet.pubKeyZ32, packet.records) > 1e3) return null;
12687
- const records = packet.records.filter((r) => r.label === "_dm");
12688
- if (records.length !== 1) return null;
13277
+ const records = packet.records.filter((r) => r.label === "_dm"), ratcheted = packet.records.filter((r) => r.label === "_dr");
13278
+ if (records.length + ratcheted.length !== 1) return null;
12689
13279
  const hints = packet.records.filter((r) => r.label === "_dmk");
12690
13280
  if (hints.length > 1) return null;
12691
13281
  const sender = hints.length ? tryDecrypt(hints[0].value, this.key) : null;
12692
13282
  if (hints.length && !sender) return null;
13283
+ const peer = this.options.credentials.peerKey;
12693
13284
  let plaintext;
12694
- try {
12695
- plaintext = tryDecrypt(records[0].value, sender ? this.sealedKey(sender) : this.key);
12696
- } catch {
12697
- plaintext = null;
13285
+ if (ratcheted.length) {
13286
+ const closed = box === "invite" && sender ? { sealedToAnother: sender } : null;
13287
+ if (!ratchet || !peer || sender !== peer) return closed;
13288
+ let opened;
13289
+ try {
13290
+ opened = ratchet(fromBase64(ratcheted[0].value));
13291
+ } catch {
13292
+ opened = null;
13293
+ }
13294
+ if (!opened) return closed;
13295
+ try {
13296
+ plaintext = utf8Decode(opened);
13297
+ } catch {
13298
+ return null;
13299
+ }
13300
+ } else {
13301
+ if (peer && this.options.ratchet?.box.heard("floor") && (!sender || sender === peer)) {
13302
+ this.traceOnce("dht-plain-refused", records[0].value, { box });
13303
+ return null;
13304
+ }
13305
+ try {
13306
+ plaintext = tryDecrypt(records[0].value, sender ? this.sealedKey(sender) : this.key);
13307
+ } catch {
13308
+ plaintext = null;
13309
+ }
13310
+ if (!plaintext && sender) return { sealedToAnother: sender };
12698
13311
  }
12699
- if (!plaintext && sender) return { sealedToAnother: sender };
12700
13312
  if (!plaintext || utf8Encode(plaintext).length > MAX_ENVELOPE_PLAINTEXT) return null;
12701
13313
  let envelope;
12702
13314
  try {
@@ -12776,7 +13388,41 @@ var DhtDelivery = class DhtDelivery {
12776
13388
  * can write to) or `pinned`. `none`: nothing from the contact in it; `old`: the contact's, already read; `new`: taken.
12777
13389
  */
12778
13390
  async receive(packet, box) {
12779
- const opened = this.open(packet, box);
13391
+ const ratcheted = packet.records.find((r) => r.label === "_dr");
13392
+ if (!ratcheted) return this.take(packet, box, this.open(packet, box));
13393
+ const digest = toBase64Url(sha256(utf8Encode(ratcheted.value)).slice(0, 16));
13394
+ if (digest === this.state.lastDr) return "old";
13395
+ const ratchet = this.options.ratchet;
13396
+ if (!ratchet) return "none";
13397
+ let sealed;
13398
+ const opened = this.open(packet, box, (bytes) => {
13399
+ const plain = ratchet.box.peek("floor", bytes);
13400
+ if (plain) sealed = bytes;
13401
+ return plain;
13402
+ });
13403
+ if (!sealed) this.traceOnce("dht-ratchet-closed", ratcheted.value, {
13404
+ box,
13405
+ pinned: !!this.options.credentials.peerKey
13406
+ });
13407
+ if (!sealed && box === "pinned" && packet.pubKeyZ32 === this.pinned()?.peerAddress && this.state.peerPinned !== "seen") {
13408
+ await this.persist({
13409
+ ...this.state,
13410
+ peerPinned: "seen"
13411
+ });
13412
+ traceLink(this.from, "dht-peer-pinned", {
13413
+ peerPinned: "seen",
13414
+ ratchet: true
13415
+ });
13416
+ }
13417
+ return this.take(packet, box, opened, sealed && {
13418
+ commit: async (order) => {
13419
+ if (!await ratchet.box.commitOpen("floor", sealed, order)) throw new Error("A ratcheted envelope no longer opens");
13420
+ },
13421
+ digest
13422
+ });
13423
+ }
13424
+ /** `ratchet`: the envelope was ratcheted; its state is saved once what it carried is stored, with its digest. */
13425
+ async take(packet, box, opened, ratchet) {
12780
13426
  if (!opened) return "none";
12781
13427
  if ("sealedToAnother" in opened) {
12782
13428
  if (opened.sealedToAnother) await this.sealedToAnother(opened.sealedToAnother);
@@ -12803,6 +13449,7 @@ var DhtDelivery = class DhtDelivery {
12803
13449
  if (message !== null && (!Array.isArray(message) || message.length !== 3 || typeof message[0] !== "string" || !ID$3.test(message[0]) || !Number.isSafeInteger(message[1]) || message[1] <= 0 || message[1] > issued + 3e4 || typeof message[2] !== "string" || utf8Encode(message[2]).length > 256 || expires - issued > 3e5)) return "none";
12804
13450
  if (receipt !== null && (typeof receipt !== "string" || !ID$3.test(receipt))) return "none";
12805
13451
  const unanswered = !this.options.credentials.peerKey && !!this.options.credentials.expectedPeerKey && !sender && !this.live;
13452
+ this.peerNewAt = Date.now();
12806
13453
  await this.options.pin(author);
12807
13454
  this.options.credentials.peerKey = author;
12808
13455
  this.options.credentials.requireSignedSignals = true;
@@ -12846,6 +13493,7 @@ var DhtDelivery = class DhtDelivery {
12846
13493
  if (peerPinned !== this.state.peerPinned) traceLink(this.from, "dht-peer-pinned", { peerPinned });
12847
13494
  if (this.state.inviteTaken) traceLink(this.from, "invite-untaken", {});
12848
13495
  const { inviteTaken: _taken, ...kept } = this.state;
13496
+ if (ratchet) await ratchet.commit(sequence);
12849
13497
  await this.persist({
12850
13498
  ...kept,
12851
13499
  peerSequence: sequence,
@@ -12854,6 +13502,7 @@ var DhtDelivery = class DhtDelivery {
12854
13502
  confirmed,
12855
13503
  ...peerPinned && { peerPinned },
12856
13504
  ...unanswered && { unanswered: sequence },
13505
+ ...ratchet && { lastDr: ratchet.digest },
12857
13506
  pending: confirmed && this.state.pending?.message[0] === confirmed ? void 0 : this.state.pending,
12858
13507
  ...newest > (this.state.reactionsTaken ?? 0) && { reactionsTaken: newest }
12859
13508
  });
@@ -12908,7 +13557,12 @@ var DhtDelivery = class DhtDelivery {
12908
13557
  for (const box of boxes) {
12909
13558
  const packet = await this.options.transport.resolve(box === "pinned" ? pinned.peerAddress : this.peerAddress, options);
12910
13559
  reads++;
12911
- const opened = packet && this.open(packet, box);
13560
+ const dr = packet?.records.find((r) => r.label === "_dr");
13561
+ if (dr && toBase64Url(sha256(utf8Encode(dr.value)).slice(0, 16)) === this.state.lastDr) return {
13562
+ reads,
13563
+ text: null
13564
+ };
13565
+ const opened = packet && this.open(packet, box, (sealed) => this.options.ratchet?.box.peek("floor", sealed) ?? null);
12912
13566
  if (!opened || "sealedToAnother" in opened || opened.author !== expected) continue;
12913
13567
  const { sequence, message } = opened;
12914
13568
  const fresh = Array.isArray(message) && typeof message[0] === "string" && ID$3.test(message[0]) && sequence > this.state.peerSequence && this.state.receipt?.id !== message[0];
@@ -13023,6 +13677,7 @@ var DhtDelivery = class DhtDelivery {
13023
13677
  }
13024
13678
  };
13025
13679
  var DHT_TEXT_REFUSED = "Your contact's app does not accept text over the DHT. It is sent when you are live.";
13680
+ var DHT_RATCHET_STOPPED = "Your contact's app no longer reads protected messages over the DHT. It is sent when you are live.";
13026
13681
  var DHT_FILE_REFUSED = "Your contact's app shows a file only once it comes. It is sent when you are live.";
13027
13682
  var DHT_FILE_TOO_LARGE = "This file's name is too long to say over the DHT. It is sent when you are live.";
13028
13683
  /**
@@ -13033,17 +13688,29 @@ function peekDhtMailbox(options) {
13033
13688
  const refuse = async () => {
13034
13689
  throw new Error("A peek saves nothing");
13035
13690
  };
13691
+ const credentials = { ...options.credentials }, peer = credentials.peerKey;
13692
+ const box = options.ratchet && peer ? new RatchetBox(() => ({
13693
+ seed: fromBase64Url(credentials.seedB64),
13694
+ self: identityFromSeedB64(credentials.seedB64).pubKeyZ32,
13695
+ peer,
13696
+ rendezvous: [identityFromSeedB64(options.params.seedB64).pubKeyZ32, options.params.peerPubKeyZ32],
13697
+ secret: fromBase64Url(options.params.encKeyB64)
13698
+ }), options.ratchet, refuse) : void 0;
13036
13699
  return new DhtDelivery({
13037
13700
  params: options.params,
13038
13701
  mode: "stream",
13039
13702
  state: options.state,
13040
- credentials: { ...options.credentials },
13703
+ credentials,
13041
13704
  transport: options.transport,
13042
13705
  save: refuse,
13043
13706
  pin: refuse,
13044
13707
  message: refuse,
13045
13708
  receipt: refuse,
13046
- changed: () => {}
13709
+ changed: () => {},
13710
+ ...box && { ratchet: {
13711
+ box,
13712
+ peerSupports: () => true
13713
+ } }
13047
13714
  }).peek(options.background ? { background: true } : void 0);
13048
13715
  }
13049
13716
  //#endregion
@@ -14085,7 +14752,7 @@ async function verifyPeerProof(event, c, readStorage) {
14085
14752
  if (sig.length !== 64 || !verify(sig, data, fromZ32(c.externalKey))) throw new Error("Invalid Pubky signature");
14086
14753
  } else if (c.adapter === "keet-import") {
14087
14754
  if (sig.length !== 107 || sig[0] !== 1 || sig[41] !== 0 || sig[42] !== 1) throw new Error("Unsupported Keet attestation");
14088
- const { default: IdentityKey } = await import("./keet-identity-key-BRKv78jp.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
14755
+ const { default: IdentityKey } = await import("./keet-identity-key-Db5KY0V1.js").then((m) => /* @__PURE__ */ __toESM(m.default, 1));
14089
14756
  if (!IdentityKey.verify(b4a.from(sig), b4a.from(data), { expectedIdentity: b4a.from(unhex(c.externalKey)) })) throw new Error("Invalid Keet attestation");
14090
14757
  } else throw new Error("Unsupported proof adapter");
14091
14758
  }
@@ -15441,17 +16108,23 @@ var CapsExchange = class {
15441
16108
  return;
15442
16109
  }
15443
16110
  if (due) {
16111
+ const options = changed || unpublished ? void 0 : { background: true };
16112
+ const held = this.options.transport.publishHeld?.(this.keys.identity.pubKeyZ32, options);
16113
+ if (held) {
16114
+ this.schedule(budgetRetryMs(held, 1e3, 6e4));
16115
+ throw held;
16116
+ }
15444
16117
  const rev = changed ? this.state.rev + 1 : this.state.rev;
15445
16118
  const { records, dropped } = this.keys.seal(content, rev, peerKey, now);
15446
16119
  this.dropped = dropped;
15447
- await this.persist({
16120
+ if (!(rev === this.state.rev && digest === this.state.digest && peerKey === this.state.sealedFor && this.state.publishedAt === void 0)) await this.persist({
15448
16121
  rev,
15449
16122
  digest,
15450
16123
  sealedFor: peerKey,
15451
16124
  publishedAt: void 0
15452
16125
  });
15453
16126
  try {
15454
- await this.options.transport.publish(this.keys.identity, records, changed || unpublished ? void 0 : { background: true });
16127
+ await this.options.transport.publish(this.keys.identity, records, options);
15455
16128
  } catch (error) {
15456
16129
  this.schedule(isDiscoveryBudgetError(error) ? budgetRetryMs(error, 1e3, 6e4) : 6e4);
15457
16130
  throw error;
@@ -15746,14 +16419,15 @@ function parseDomainTxt(value) {
15746
16419
  var addRecord = (list, r) => {
15747
16420
  if (!list.some((x) => x.key === r.key && x.proof === r.proof)) list.push(r);
15748
16421
  };
15749
- /** All records among the TXT strings of `_ghostly.<domain>`; other strings are skipped. */
16422
+ /** All records among the first 32 TXT strings of `_ghostly.<domain>`; other strings are skipped. A TXT set has
16423
+ * no order, so every record is kept: the one a proof needs may come in any position. */
15750
16424
  function recordsFromTxt(values) {
15751
16425
  const out = [];
15752
16426
  for (const value of values.slice(0, 32)) {
15753
16427
  const r = parseDomainTxt(value);
15754
16428
  if (r) addRecord(out, r);
15755
16429
  }
15756
- return out.slice(0, 8);
16430
+ return out;
15757
16431
  }
15758
16432
  /** The body of `/.well-known/ghostly.json`. */
15759
16433
  function domainWellKnownFile(records) {
@@ -15770,7 +16444,7 @@ function parseJson(text) {
15770
16444
  if (typeof text !== "string" || utf8Encode(text).length > 16384) throw new Error("File too large");
15771
16445
  return JSON.parse(text);
15772
16446
  }
15773
- /** Records from `ghostly.json`. Throws on a malformed file; [] when it names none. */
16447
+ /** Records from the first 32 entries of `ghostly.json`. Throws on a malformed file; [] when it names none. */
15774
16448
  function recordsFromWellKnown(text) {
15775
16449
  const body = parseJson(text);
15776
16450
  if (!body || typeof body !== "object" || Array.isArray(body) || body.ghostly !== 1 || !Array.isArray(body.proofs)) throw new Error("Not a Ghostly domain file");
@@ -15783,7 +16457,7 @@ function recordsFromWellKnown(text) {
15783
16457
  };
15784
16458
  if (validDomainRecord(r)) addRecord(out, r);
15785
16459
  }
15786
- return out.slice(0, 8);
16460
+ return out;
15787
16461
  }
15788
16462
  /** NIP-05: only the root name `_` speaks for the domain itself. Undefined when absent. */
15789
16463
  function nip05RootKey(text) {
@@ -15966,9 +16640,13 @@ var SIG$3 = /^[A-Za-z0-9_-]{86}$/;
15966
16640
  var MAGIC$1 = utf8Encode("GHLD");
15967
16641
  var VERSION = 1;
15968
16642
  var NONCE$2 = 24;
16643
+ /** A bundle sealed by the chat's ratchet (WISP 4xx § Held items). */
16644
+ var RATCHETED = 2;
15969
16645
  /** Why a bundle, manifest or pointer was refused. Never a reason to trust it a little. */
15970
16646
  var HoldRefusedError = class extends Error {
15971
16647
  reason;
16648
+ /** The bytes the chat's ratchet opened, when it opened them before the item was refused: the caller commits them. */
16649
+ ratcheted;
15972
16650
  constructor(reason, message) {
15973
16651
  super(message);
15974
16652
  this.reason = reason;
@@ -16008,6 +16686,19 @@ var HoldKeys = class {
16008
16686
  }
16009
16687
  /** Seals one item for the contact: signed with my participation key, encrypted to our shared key. */
16010
16688
  seal(item, body) {
16689
+ const nonce = randomBytes(NONCE$2);
16690
+ const box = xsalsa20poly1305(this.sealKey, nonce).encrypt(this.inner(item, body));
16691
+ return concatBytes(MAGIC$1, new Uint8Array([VERSION]), nonce, box);
16692
+ }
16693
+ /**
16694
+ * The same item as a version-2 bundle (WISP 4xx § Held items): the same plaintext, sealed by the chat's ratchet
16695
+ * (`seal`, which saves the ratchet's state before it returns), so the bundle can be uploaded once this returns.
16696
+ */
16697
+ async sealRatcheted(item, body, seal) {
16698
+ return concatBytes(MAGIC$1, new Uint8Array([RATCHETED]), await seal(this.inner(item, body)));
16699
+ }
16700
+ /** What a bundle seals: the header's length, the signed header, the body. */
16701
+ inner(item, body) {
16011
16702
  const fields = [
16012
16703
  VERSION,
16013
16704
  this.from,
@@ -16027,26 +16718,51 @@ var HoldKeys = class {
16027
16718
  const header = utf8Encode(JSON.stringify([fields, signature]));
16028
16719
  const length = /* @__PURE__ */ new Uint8Array(4);
16029
16720
  new DataView(length.buffer).setUint32(0, header.length);
16030
- const nonce = randomBytes(NONCE$2);
16031
- const box = xsalsa20poly1305(this.sealKey, nonce).encrypt(concatBytes(length, header, body));
16032
- return concatBytes(MAGIC$1, new Uint8Array([VERSION]), nonce, box);
16721
+ return concatBytes(length, header, body);
16033
16722
  }
16034
16723
  /**
16035
16724
  * Opens a bundle the contact sealed for me. Everything is checked before anything is returned: the
16036
16725
  * authenticated encryption, the header's shape, that it names this link, this contact and me, the
16037
16726
  * signature, the body digest and the limits of its kind. `loopback`: see `isHoldUrl`.
16038
16727
  */
16728
+ /**
16729
+ * `ratchet`: opens a version-2 bundle's sealed bytes (WISP 4xx), without keeping anything; absent, one is from a newer
16730
+ * Ghostly. `refusePlain`: a ratcheted item from this contact opened here, so a version-1 item other than the manifest is
16731
+ * refused (WISP 4xx § Downgrade). `ratcheted` in the result: the bytes the ratchet opened, for the caller to commit once
16732
+ * the item is stored.
16733
+ */
16039
16734
  open(bytes, expect = {}) {
16040
16735
  const now = expect.now ?? Date.now();
16041
16736
  if (bytes.length > (expect.maxBytes ?? HOLD_LIMITS.maxBundleBytes)) throw new HoldRefusedError("size", "The held item is larger than allowed");
16042
- if (bytes.length < MAGIC$1.length + 1 + NONCE$2 + 16 + 4 || !MAGIC$1.every((b, i) => bytes[i] === b)) throw new HoldRefusedError("format", "Not a held item");
16043
- if (bytes[MAGIC$1.length] !== VERSION) throw new HoldRefusedError("format", "Held item from a newer Ghostly");
16044
- let plain;
16737
+ if (bytes.length < MAGIC$1.length + 1 + 16 + 4 || !MAGIC$1.every((b, i) => bytes[i] === b)) throw new HoldRefusedError("format", "Not a held item");
16738
+ const version = bytes[MAGIC$1.length];
16739
+ if (version !== VERSION && (version !== RATCHETED || !expect.ratchet)) throw new HoldRefusedError("format", "Held item from a newer Ghostly");
16740
+ let plain, ratcheted;
16741
+ if (version === RATCHETED) {
16742
+ ratcheted = bytes.subarray(MAGIC$1.length + 1);
16743
+ try {
16744
+ plain = expect.ratchet(ratcheted);
16745
+ } catch {
16746
+ plain = null;
16747
+ }
16748
+ if (!plain) throw new HoldRefusedError("tampered", "The held item was changed, is not for this chat, or was opened already");
16749
+ } else {
16750
+ if (bytes.length < MAGIC$1.length + 1 + NONCE$2 + 16 + 4) throw new HoldRefusedError("format", "Not a held item");
16751
+ try {
16752
+ plain = xsalsa20poly1305(this.sealKey, bytes.subarray(MAGIC$1.length + 1, MAGIC$1.length + 1 + NONCE$2)).decrypt(bytes.subarray(MAGIC$1.length + 1 + NONCE$2));
16753
+ } catch {
16754
+ throw new HoldRefusedError("tampered", "The held item was changed or is not for this chat");
16755
+ }
16756
+ }
16045
16757
  try {
16046
- plain = xsalsa20poly1305(this.sealKey, bytes.subarray(MAGIC$1.length + 1, MAGIC$1.length + 1 + NONCE$2)).decrypt(bytes.subarray(MAGIC$1.length + 1 + NONCE$2));
16047
- } catch {
16048
- throw new HoldRefusedError("tampered", "The held item was changed or is not for this chat");
16758
+ return this.read(plain, ratcheted, expect, now);
16759
+ } catch (error) {
16760
+ if (error instanceof HoldRefusedError && ratcheted) error.ratcheted = ratcheted;
16761
+ throw error;
16049
16762
  }
16763
+ }
16764
+ /** The checks of `open` once the bundle is decrypted. */
16765
+ read(plain, ratcheted, expect, now) {
16050
16766
  if (plain.length < 4) throw new HoldRefusedError("format", "Not a held item");
16051
16767
  const headerLength = new DataView(plain.buffer, plain.byteOffset, 4).getUint32(0);
16052
16768
  if (headerLength > 131072 || 4 + headerLength > plain.length) throw new HoldRefusedError("format", "Not a held item");
@@ -16088,10 +16804,12 @@ var HoldKeys = class {
16088
16804
  digest,
16089
16805
  expires
16090
16806
  };
16807
+ if (!ratcheted && expect.refusePlain && kind !== "manifest") throw new HoldRefusedError("plain", "The held item was sealed without forward secrecy, which this chat no longer takes");
16091
16808
  checkKind(header, body, expect.loopback);
16092
16809
  return {
16093
16810
  header,
16094
- body
16811
+ body,
16812
+ ...ratcheted && { ratcheted }
16095
16813
  };
16096
16814
  }
16097
16815
  /** My pointer, as records to publish under `identity`. Throws when it cannot fit a packet. */
@@ -18374,6 +19092,15 @@ var FINAL = /* @__PURE__ */ new Set([
18374
19092
  ]);
18375
19093
  var transferEnded = (record) => FINAL.has(record.state);
18376
19094
  /**
19095
+ * Whether a file sent from here arrived whole (the receiver confirmed every byte, and may be checking it): too late
19096
+ * for its person to cancel. The receiver's check comes before a `pf-abort` behind it, so it would keep the file while
19097
+ * the sender said it was cancelled. Not once the receiver asks about it again (`asking`), nor paused here.
19098
+ */
19099
+ function sentWhole(record) {
19100
+ if (record.direction !== "out" || transferEnded(record)) return false;
19101
+ return record.state === "verifying" || record.file.size > 0 && record.confirmed === record.file.size && record.state !== "asking" && record.state !== "paused";
19102
+ }
19103
+ /**
18377
19104
  * Whether an unfinished transfer is stuck, so its person is offered to push it: "Send again" (sending) or "Ask again"
18378
19105
  * (receiving). `movedAt` is when its bytes last moved, `restored` that it has not moved since the app started. What
18379
19106
  * waits for a person (an answer, a pause) is not stuck, and a failed one has its own "Retry".
@@ -18765,6 +19492,11 @@ var ChatFiles = class {
18765
19492
  id: entry.record.id,
18766
19493
  offset: entry.in.written
18767
19494
  });
19495
+ else if (entry.record.state === "asking") this.send({
19496
+ t: "pf-wait",
19497
+ id: entry.record.id,
19498
+ why: "consent"
19499
+ });
18768
19500
  }
18769
19501
  }
18770
19502
  /** The session went: nothing moves until the next one. What was received is made durable. */
@@ -18802,10 +19534,13 @@ var ChatFiles = class {
18802
19534
  ].includes(record.state) || record.since + FILE_LIMITS.offerTtlMs > now) continue;
18803
19535
  if (record.direction === "in" && record.state === "queued" && (entry.in?.starting || this.moved(entry) > 0)) continue;
18804
19536
  this.end(entry, "failed", record.direction === "in" ? "The offer expired" : record.state === "queued" ? "Not delivered in time" : "Not accepted in time");
18805
- if (record.direction === "in") this.send({
19537
+ this.send(record.direction === "in" ? {
18806
19538
  t: "pf-refuse",
18807
19539
  id: record.id,
18808
19540
  why: "expired"
19541
+ } : {
19542
+ t: "pf-abort",
19543
+ id: record.id
18809
19544
  });
18810
19545
  }
18811
19546
  }
@@ -19543,7 +20278,8 @@ var ChatFiles = class {
19543
20278
  return;
19544
20279
  }
19545
20280
  if (!outgoing || transferEnded(outgoing.record)) {
19546
- if (outgoing?.record.state === "cancelled" && frame.t !== "pf-refuse") this.send({
20281
+ const asked = frame.t === "pf-accept" || frame.t === "pf-wait";
20282
+ if (outgoing?.record.state === "cancelled" ? frame.t !== "pf-refuse" : asked && outgoing?.record.state !== "done") this.send({
19547
20283
  t: "pf-abort",
19548
20284
  id
19549
20285
  });
@@ -20950,7 +21686,8 @@ var PairingTracker = class {
20950
21686
  * none of these (a mint's own words, a provider's) stays as it is.
20951
21687
  *
20952
21688
  * `{name}` in a template is a value: a host or domain (no spaces), a network ("Mainnet" or "Testnet"), a chain's name,
20953
- * an ecash unit ("usd"), or an amount (digits, with the separators of whatever locale wrote it).
21689
+ * an ecash unit ("usd"), an amount (digits, with the separators of whatever locale wrote it), or a server's own `{reason}`
21690
+ * (one line, last in its text).
20954
21691
  */
20955
21692
  var ENGINE_ERRORS = {
20956
21693
  mintUnreachable: "Could not reach {host}. Check the address: it should be a Cashu mint.",
@@ -20967,13 +21704,16 @@ var ENGINE_ERRORS = {
20967
21704
  mintNotHttps: "Mints must use https",
20968
21705
  notEnoughSats: "Not enough sats in your wallet",
20969
21706
  notEnoughForFee: "Not enough sats in your wallet: {amount} sats leave room for the fee",
21707
+ mintsNoAnyAmount: "None of your mints can pay an invoice with no amount",
20970
21708
  noSharedMint: "You share no mint with this contact",
20971
21709
  ecashAlreadySpent: "This ecash was already spent somewhere else",
20972
21710
  ecashBeingReceived: "This ecash is already being received",
21711
+ ecashFeeTakesAll: "The mint keeps all {amount} sats of this ecash as its fee to take it in: nothing was redeemed, and its sender can still take it back",
20973
21712
  ecashOtherUnit: "This ecash is in {unit}: only sat ecash can be redeemed here",
20974
21713
  reviewedEcashSpent: "The ecash for this payment was already spent somewhere else. Nothing was sent, and your balance now shows what the mint still holds.",
20975
21714
  reviewedSatsGone: "The sats this payment was reviewed with went to another payment. Nothing was sent: review it again.",
20976
21715
  lightningFeeTooHigh: "The Lightning fee ({fee} sats) is too high",
21716
+ lightningRefused: "The mint refused this Lightning payment, and no sats left your wallet: it is safe to try again. The mint said: {reason}",
20977
21717
  invoiceExpired: "That invoice has expired",
20978
21718
  lnurlExactly: "{domain} asks for exactly {amount} sats",
20979
21719
  lnurlRange: "{domain} takes between {min} and {max} sats",
@@ -21751,6 +22491,7 @@ var GhostLink = class {
21751
22491
  peerCapsRev: options.dht.peerCapsRev,
21752
22492
  peerAcceptsText: options.dht.peerAcceptsText,
21753
22493
  peerAcceptsFile: options.dht.peerAcceptsFile,
22494
+ ...options.dht.ratchet && { ratchet: options.dht.ratchet },
21754
22495
  ...options.reactionsSupport && {
21755
22496
  reactions: options.dht.reactions,
21756
22497
  reaction: async (reaction) => {
@@ -21840,6 +22581,7 @@ var GhostLink = class {
21840
22581
  pollIntervals: options.pollIntervals,
21841
22582
  awaitingSince: options.madeAt,
21842
22583
  ...backsOff && { invite: () => !options.pairing.credentials.peerKey || !!this.dht?.unanswered },
22584
+ ...invite && { ownInvite: () => !options.pairing.credentials.peerKey && !options.pairing.credentials.expectedPeerKey },
21843
22585
  getServices: options.getServices,
21844
22586
  firstPublish: options.firstPublish ?? (this.tracker && options.pairingProgress?.role === "joiner" && options.rtcAvailable !== false || this.resuming ? "after-first-poll" : "at-start"),
21845
22587
  resumed: !!this.resuming,
@@ -23685,6 +24427,10 @@ var GhostLink = class {
23685
24427
  get liveAttempt() {
23686
24428
  return this.isDataLinkOpen ? void 0 : this.lastAttempt;
23687
24429
  }
24430
+ /** Automatic dials since the link was last live or its wait started over (`wake`), the one under way included. */
24431
+ get dialAttempts() {
24432
+ return this.autoConnectFailures;
24433
+ }
23688
24434
  /**
23689
24435
  * Which side dials this chat to go live: the lower rendezvous key, or the joiner of a first pairing (WISP 100). The
23690
24436
  * other side answers, so what it can tell of a failed attempt is only what reached it.
@@ -25302,6 +26048,7 @@ var GhostLink = class {
25302
26048
  if (oldChannel) this.retire(oldChannel, () => {
25303
26049
  if (oldRtc && this.activeBinding && this.dataLink.connection === oldRtc) this.dataLink.close();
25304
26050
  }, !oldBinding);
26051
+ if (migration.plan && binding && oldBinding && WEBRTC_ATTEMPT.has(this.dataLink.state)) this.dataLink.close();
25305
26052
  this.session.setDataLinkOpen(true);
25306
26053
  if (migration.plan) switched = {
25307
26054
  from,
@@ -33392,6 +34139,18 @@ var CommunitySession = class {
33392
34139
  get entryKey() {
33393
34140
  return this.state.entry.key;
33394
34141
  }
34142
+ /**
34143
+ * The entry key of the link my admission that lost was let in by (the one its branch named), where I ask again: a
34144
+ * link replaced since keeps me out as it does anyone. `entryKey` once that admission is no longer held.
34145
+ */
34146
+ get lostEntryKey() {
34147
+ const side = this.state.side;
34148
+ for (let i = side.length - 1; i >= 0; i--) if (side[i].k === "add" && side[i].s === this.myKey) {
34149
+ for (const c of this.ancestry(side[i].p)) if (c.x !== void 0) return c.x;
34150
+ return "";
34151
+ }
34152
+ return this.entryKey;
34153
+ }
33395
34154
  role(key) {
33396
34155
  return this.roster.find(([k]) => k === key)?.[1];
33397
34156
  }
@@ -33399,10 +34158,62 @@ var CommunitySession = class {
33399
34158
  get picture() {
33400
34159
  return groupMetaPicture(this.state.meta);
33401
34160
  }
33402
- /** Members of any epoch in the window: whom a frame may come from. */
34161
+ /**
34162
+ * Members of any epoch in the window: whom a frame may come from. A side commit's roster counts only while its branch
34163
+ * could still win (`mayWin`): one let in only on a branch that lost is not in the roster anyone sees, and the main
34164
+ * branch past where they part, a later link among it, is not its business (`lostAt`).
34165
+ */
33403
34166
  isRecentMember(key) {
33404
- for (const roster of this.rosters.values()) if (rosterHas(roster, key)) return true;
33405
- return false;
34167
+ let side = false;
34168
+ for (const [h, roster] of this.rosters) if (rosterHas(roster, key)) {
34169
+ if (this.mainIndex.has(h)) return true;
34170
+ side = true;
34171
+ }
34172
+ return side && [...this.mayWin()].some((h) => rosterHas(this.rosters.get(h) ?? [], key));
34173
+ }
34174
+ /**
34175
+ * The side commits whose branch could still win: it does not drop an admin change the main branch holds (one that
34176
+ * does never wins, see `better`), and it parts within the window. Kept until the tip or the side moves.
34177
+ */
34178
+ mayWin() {
34179
+ const side = this.state.side, at = `${this.topHash}:${side.length}:${side.length ? communityCommitHash(side[side.length - 1]) : ""}`;
34180
+ if (this.winning?.at === at) return this.winning.set;
34181
+ const counts = this.adminCounts(), main = this.branch(this.topHash), set = /* @__PURE__ */ new Set();
34182
+ for (const c of side) {
34183
+ const h = communityCommitHash(c), branch = this.rosters.has(h) ? this.branch(h) : null;
34184
+ if (!branch || !branch.path.length) continue;
34185
+ const { parent, admin } = this.parting(branch, main, counts);
34186
+ if (!(admin[1] && !admin[0]) && parent >= this.epoch - COMMUNITY_LIMITS.window) set.add(h);
34187
+ }
34188
+ this.winning = {
34189
+ at,
34190
+ set
34191
+ };
34192
+ return set;
34193
+ }
34194
+ winning;
34195
+ /**
34196
+ * For a key that is no recent member, let in on a branch that lost: the main-branch index it parts from, and that of
34197
+ * the commit that makes it lose (the latest over its branches). Undefined for anyone else.
34198
+ */
34199
+ lostAt(key) {
34200
+ const side = this.state.side, parents = new Set(side.map((c) => c.p)), counts = this.adminCounts();
34201
+ let lost;
34202
+ for (const c of side) {
34203
+ const h = communityCommitHash(c);
34204
+ if (parents.has(h)) continue;
34205
+ const branch = this.branch(h);
34206
+ if (!branch || !branch.path.some((x) => rosterHas(this.rosters.get(x) ?? [], key))) continue;
34207
+ for (let j = branch.fork + 1; j < this.state.chain.length; j++) {
34208
+ if (this.better(branch, this.branch(communityCommitHash(this.state.chain[j])), counts)) continue;
34209
+ lost = {
34210
+ fork: Math.min(lost?.fork ?? j, branch.fork),
34211
+ end: Math.max(lost?.end ?? j, j)
34212
+ };
34213
+ break;
34214
+ }
34215
+ }
34216
+ return lost;
33406
34217
  }
33407
34218
  /**
33408
34219
  * Whether `key` could read message `messageId` (`<s>:<e>:<h>:<n>`) and still can: a member of the roster it was sealed
@@ -34952,10 +35763,23 @@ var CommunitySession = class {
34952
35763
  for (const { from, frame } of ready) await this.receiveMessage(from, frame);
34953
35764
  }
34954
35765
  async receiveSync(from, frame) {
34955
- if (!this.isRecentMember(from) || !isZ32Key(from) || !Number.isSafeInteger(frame.e) || typeof frame.h !== "string") return;
35766
+ if (!isZ32Key(from) || !Number.isSafeInteger(frame.e) || typeof frame.h !== "string") return;
35767
+ const recent = this.isRecentMember(from), lost = recent ? void 0 : this.lostAt(from);
35768
+ if (!recent && !lost) return;
34956
35769
  let answered = this.syncsAnswered.get(from);
34957
35770
  if (!answered) this.syncsAnswered.set(from, answered = new RateWindow(COMMUNITY_LIMITS.syncAnswers, COMMUNITY_LIMITS.syncWindowMs, () => this.hooks.clock?.() ?? Date.now()));
34958
35771
  if (!answered.take()) return;
35772
+ if (lost) {
35773
+ const at = this.mainIndex.get(frame.h);
35774
+ const commits = this.state.chain.slice(at !== void 0 ? at + 1 : lost.fork + 1, lost.end + 1);
35775
+ if (commits.length) this.answers.handOut(from, commits.map((commit) => ({
35776
+ t: "group-commit",
35777
+ v: 2,
35778
+ g: this.id,
35779
+ commit
35780
+ })));
35781
+ return;
35782
+ }
34959
35783
  const answer = [];
34960
35784
  const ask = () => {
34961
35785
  const sync = this.question(from);
@@ -36544,6 +37368,6 @@ function x401ApprovalDigest(subject) {
36544
37368
  return toBase64Url(sha256(utf8Encode(canonical)));
36545
37369
  }
36546
37370
  //#endregion
36547
- export { COMMUNITY_LIMITS as $, bytesEqual as $C, WRITE_FIRST_MS as $S, newHandoffId as $_, LIVENESS_PING_MS as $a, INVITE_LINK_ORIGIN as $b, isServeId as $c, emptyDhtDeliveryState as $d, LINK_PREVIEW_LIMITS as $f, HANDOFF_ATTEMPTS as $g, decodeChunk as $h, sparkAddressKind as $i, DOMAIN_FILE_MAX_BYTES as $l, ANSWER_REFUSED_REDIALS as $m, bip322MessageHash as $n, meshHubs as $o, cardEditNumber as $p, checkDidJws as $r, GROUP_PIN_FRAME as $s, carryMentions as $t, identityRevocationValue as $u, inboxRecord as $v, TURN_SEALED_BYTES as $x, isAppPath as $y, readX401ProofResponseHeader as A, IDENTITY_MEMO_SIZE as AC, CHAT_WATCH_SHARE as AS, handoffBusyFrame as A_, ENDPOINT as Aa, imageSize as Ab, wakeRequest as Ac, ringAuthorization as Ad, isPlayableVideoType as Af, sdpHasCandidates as Ag, TRANSPORTS_GONE_MS as Ah, openDidDhtPayload as Ai, SERVICES_CAPABILITY as Al, expectedRoster as Am, parseGroupMetaFrame as An, fetchesByItself as Ao, wireReaction as Ap, shortAtprotoDid as Ar, FileUplink as As, mergeKnocks as At, dialDescriptors as Au, ENROLL_GRANT as Av, devicePingFrame as Ax, openRequest as Ay, APP_STORE_KINDS as B, sealedLength as BC, HEDGE_MS as BS, handoffHaveFrames as B_, CROSSED_FRESH_MS as Ba, createContactLink as Bb, APP_RANGE_DATA_KIND as Bc, irohDescriptor as Bd, MAX_EDITS_PER_MESSAGE as Bf, HTTP_SERVICE_PROTO as Bg, formatLocalTarget as Bh, USDT_PUBLIC_RPC as Bi, PairedSession as Bl, GROUP_PROFILE as Bm, SshSigError as Bn, GROUP_VERSION_SIGNALS as Bo, BUTTON_ID as Bp, parseAtprotoVerificationKey as Br, TYPING_REFRESH_MS as Bs, mentionedMembers as Bt, IDENTITY_MAX_FRAME as Bu, enrollProofFrame as Bv, TURN_VISIBLE_MS as Bx, APP_CLIENT_NAME as By, buildX401TokenObject as C, parseRelayPayload as CC, turnStatedVerifier as CS, NO_ATTEMPTS as C_, parseLightningDestination as Ca, setAppSignatureFastPath as Cb, newWakeToken as Cc, storageProof as Cd, voiceFileName as Cf, decompressSdp as Cg, OFFER_LOOK_MS as Ch, didDhtDocument as Ci, CALLS_CAPABILITY as Cl, MAX_GROUP_CHAIN as Cm, groupMetaTag as Cn, parseEngineError as Co, reactedFrame as Cp, atprotoDidMethod as Cr, PAIRED_CALL_FRAME as Cs, MAX_KNOCKS as Ct, CAPS_PUBLISH_SPACING_MS as Cu, setUpdateMessage as Cv, deviceFrameCapability as Cx, knockSlotIdentity as Cy, readX401ProofRequest as D, decodeTxtPacket as DC, CHAT_RESERVE as DS, handoffAttemptAllowed as D_, BOLT11_PATTERN as Da, verifyAppSignature as Db, relayRequest as Dc, verifyNostrProof as Dd, PLAYABLE_VIDEO as Df, keepsToRelays as Dg, RELAY_POLL_INTERVALS as Dh, encodeDidDhtDeactivated as Di, KNOWN_SESSION_CAPABILITIES as Dl, SAID_AGAIN as Dm, nextGroupMetaRevision as Dn, GROUP_VERSION_FILES as Do, readDhtReactions as Dp, isAtprotoDid as Dr, FILE_DATA_KIND as Ds, groupEntryUrl as Dt, CapsRefusedError as Du, ENROLL_CANCEL as Dv, deviceLinkRendezvousSeed as Dx, makeStamp as Dy, isX401Protocol as E, decodeDnsAnswers as EC, BACKGROUND_WHILE_SIGNALING as ES, handoffAckFrame as E_, resolveLightningDestination as Ea, verifyAppRevocation as Eb, readWakePayload as Ec, validExternalKey as Ed, voicePeaksOf as Ef, isGlobalIpv4Host as Eg, PRESENCE_WINDOW as Eh, didDhtRecords as Ei, FILES_CAPABILITY as El, OWN_FRAME_LIMIT as Em, keepPastGroupMeta as En, GROUP_HAVE_FRAME as Eo, reactionIsNewer as Ep, checkAtprotoProofRecord as Er, ChatFiles as Es, entryParams as Et, CapsKeys as Eu, DEVICE_KINDS as Ev, deviceLinkParams as Ex, linkRecords as Ey, appRevocationFor as F, sign as FC, GROUP_BURST_ONE_LINK as FS, handoffDigest as F_, parseCashuRequestPayload as Fa, canonicalJson as Fb, encryptPushPayload as Fc, verifyRingEvidence as Fd, EDIT_BUFFER_MS as Ff, RECORD_TTL as Fg, presenceSeenAt as Fh, ONCHAIN_PROVIDER as Fi, UPGRADE_CAPABILITY as Fl, signCommit as Fm, wrapGroupMeta as Fn, readGroupWant as Fo, pairedReplyAuthor as Fp, decodeDagCbor as Fr, transferStalled as Fs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ft, IDENTITY_CHECK_UNAVAILABLE as Fu, enrollDigits as Fv, seedSigner as Fx, seenEntry as Fy, readAppStore as G, sanitizeAvatar as GC, RelaysFailedError as GS, handoffReleaseFrame as G_, DHT_PIN_GRACE_MS as Ga, DEVICE_INVITE_OWN_DEVICE as Gb, appRangeCancelFrame as Gc, ACTIVE_DHT_POLL_MS as Gd, editFrame as Gf, encodeServices as Gg, sanitizeResponseHeaders as Gh, formatPaymentAmount as Gi, HOLD_LIMITS as Gl, encryptText as Gm, sshKeyDigestHex as Gn, SIGNAL_PROVEN_MS as Go, PR_STATES as Gp, DID_DOCUMENT_MAX_BYTES as Gr, TypingSender as Gs, GroupSession as Gt, IDENTITY_REVOCATION_LABEL as Gu, FLOOD_PER_DAY as Gv, TOMBSTONE_TURN as Gx, APP_VIEWS as Gy, checkAppListing as H, MAX_AVATAR_LENGTH as HC, RELAY_REQUESTS_PER_MINUTE as HS, handoffManifestFrames as H_, CROSSED_WAIT_MS as Ha, readContactLink as Hb, APP_RANGE_FRAMES as Hc, rankTransports as Hd, REMOVED_TEXT as Hf, MAX_SERVICES as Hg, relativizeLocation as Hh, arkAddressPrefix as Hi, SESSION_RECEIVE_PENDING as Hl, confirmationTag as Hm, parseSshSignature as Hn, SIGNAL_CARRIERS as Ho, CRON_LINE as Hp, unsignedCommitBytes as Hr, TYPING_STATUS_MAX as Hs, GROUP_LIMITS as Ht, IDENTITY_MAX_VALIDITY as Hu, readEnrollGrant as Hv, keptAtEqualSequence as Hx, APP_ICON_PATH as Hy, appStoreDecision as I, verify as IC, GROUP_OVER_PACE_MS as IS, handoffDoneFrame as I_, parseFedimintRequestPayload as Ia, canonicalJsonBytes as Ib, generateVapidKeys as Ic, RELAY_URL as Id, EDIT_FRAME as If, buildLinkRecords as Ig, unusedInviteWait as Ih, PaymentPreflightError as Ii, WAKE_SESSION_CAPABILITY as Il, sortRoster as Im, SSHSIG_MAX_ARMOR as In, readGroupWantNo as Io, readReply as Ip, encodeDagCbor as Ir, TYPING_FRAME as Is, GROUP_WAKE_RECEIVE_LIMIT as It, IDENTITY_CLOCK_SKEW as Iu, enrollDoneFrame as Iv, webCryptoSigner as Ix, stampHolds as Iy, GROUP_TYPING_FRAME as J, sanitizeDisplayText as JC, SLOW_DEMOTE_MS as JS, handoffStreamKey as J_, GhostLink as Ja, deviceInviteJoinerParams as Jb, appRangeEndFrame as Jc, DHT_MESSAGE_TTL as Jd, parseEditedFrame as Jf, serviceIdFromName as Jg, CHUNK_FLAG_END as Jh, validatePaymentTarget as Ji, isHoldUrl as Jl, openPair as Jm, isLegacySignature as Jn, readGroupSignal as Jo, RUN_RESULTS as Jp, DID_JWS_ALGS as Jr, sanitizeTypingStatus as Js, frameBytes as Jt, IdentityCheckUnavailable as Ju, MAX_WAITING as Jv, TURN_LAST_SEQUENCE as Jx, assembleAppBundle as Jy, readAppStoreSteps as K, MAX_NICK_LENGTH as KC, SIGNALING_ALLOWANCE_SHARE as KS, handoffRequestFrame as K_, EARLY_DIAL_JOIN_MS as Ka, createDeviceInvite as Kb, appRangeChunk as Kc, DHT_FILE_REFUSED as Kd, editedFrame as Kf, isValidServiceId as Kg, viewerResponseHeaders as Kh, isWalletNetwork as Ki, HoldKeys as Kl, epochKeys as Km, sshSignCommand as Kn, SIGNAL_REPLY_MS as Ko, REMOVABLE_KINDS as Kp, DID_FILE_MAX_BYTES as Kr, parseTypingActivity as Ks, asWritten as Kt, IDENTITY_STATEMENT_PREFIX as Ku, MAX_DONE as Kv, TURN_BODY_BYTES as Kx, appDigest as Ky, appUpdateDecision as L, decrypt as LC, GROUP_RATION_WINDOW_MS as LS, handoffEphemeral as L_, ANSWERS_REFUSED_PAUSES as La, readCanonicalJson as Lb, pushRequest as Lc, TRANSPORTS as Ld, EDIT_RATE_WINDOW_MS as Lf, emptyLinkRecords as Lg, GhostlyHttpError as Lh, SEPOLIA_TEST_USDT as Li, parseSessionCapabilities as Ll, verifyChain as Lm, SSHSIG_NAMESPACE as Ln, CARRIED_DEFER_MS as Lo, replySnippet as Lp, findInMst as Lr, TYPING_KINDS as Ls, GroupWakeLimiter as Lt, IDENTITY_FRAME_LIMIT as Lu, enrollGrantFrame as Lv, TURN_PUT_WINDOW_MS as Lx, APP_BUNDLE_LIMITS as Ly, readX401ProofResultHeader as M, identityFromSeed as MC, DEPARTED_READS as MS, handoffContext as M_, fedimintRequestPayload as Ma, parseImageMeta as Mb, WebPushError as Mc, ringEvidence as Md, parseVideoMeta as Mf, waitForIceGathering as Mg, UNUSED_INVITE_WAIT_MAX_MS as Mh, signDidDhtPacket as Mi, STATUS_CARD_CAPABILITY as Ml, rememberAlone as Mm, parseGroupMetaTag as Mn, isGroupMessageId as Mo, REPLY_ID as Mp, AtprotoProofError as Mr, encodeFileData as Ms, GROUP_WAKE_FRAME as Mt, encodePacketTransports as Mu, ENROLL_PROOF as Mv, signDeviceTransports as Mx, readLinkRecord as My, x401AnswerableRequests as N, identityFromSeedB64 as NC, FRESH_READ_MS as NS, handoffContextProof as N_, findEndpoint as Na, previewable as Nb, checkPushEndpoint as Nc, validRingKey as Nd, EDITED_FRAME as Nf, LABEL$1 as Ng, WATCH_PEER_MS as Nh, ETHEREUM_USDT as Ni, SessionCapabilities as Nl, rosterAdmin as Nm, signGroupMeta as Nn, readGroupFileMeta as No, REPLY_LIMITS as Np, atprotoCidFor as Nr, refusalText as Ns, GROUP_WAKE_GROUP_LIMIT as Nt, parsePacketTransports as Nu, enrollCancelFrame as Nv, unsignedDeviceTransports as Nx, requestPlaintextBytes as Ny, readX401ProofRequestHeader as O, encodeTxtPacket as OC, CHAT_RESERVE_MOST_SHARE as OS, handoffAttemptFailed as O_, decodeBolt11 as Oa, verifyAppStatementBytes as Ob, wakeFrame as Oc, verifyPeerProof as Od, VIDEO_LIMITS as Of, parseCallSignal as Og, SIGNAL_OUT_READS as Oh, encodeDidDhtPacket as Oi, PIN_CAPABILITY as Ol, commitHash as Om, openGroupMeta as On, GROUP_WANT_FRAME as Oo, readReaction as Op, normalizeAtprotoHandle as Or, FILE_FRAMES as Os, knockIdentity as Ot, DHT_TEXT_CAPABILITY as Ou, ENROLL_CANCEL_REASONS as Ov, deviceLinkSealKey as Ox, makeStampPaced as Oy, addedAppPermissions as P, publicKeyFromZ32 as PC, GROUP_BURST_MS as PS, handoffDataFrame as P_, isFederationId as Pa, readImageMeta as Pb, decryptPushPayload as Pc, verifyRingAuthorization as Pd, EDIT_BUFFER_MAX as Pf, MAX_MSGS_PAYLOAD_B64 as Pg, countUnusedInvite as Ph, EVM_TEST_CHAINS as Pi, TYPING_CAPABILITY as Pl, rosterHas as Pm, verifyGroupMetaSignature as Pn, readGroupHave as Po, groupReplyAuthor as Pp, decodeAtprotoCommit as Pr, transferEnded as Ps, GROUP_WAKE_GROUP_WINDOW_MS as Pt, IDENTITY_CHALLENGE_WINDOW as Pu, enrollCancelReason as Pv, verifyDeviceTransports as Px, requestRecords as Py, sealGroupTyping as Q, unwrapPasted as QC, WAY_BACK_SHARE as QS, isHandoffPartName as Q_, LIVENESS_MISSED_PINGS as Qa, INVITE_HRP as Qb, encodeAppRangeData as Qc, LIVE_POLL_MS as Qd, LINK_MAX_CHARS as Qf, HANDOFF_ACK as Qg, PROTOCOL_VERSION as Qh, isSparkAddress as Qi, DNS_TYPE as Ql, sha256Hex as Qm, MessageRefusal as Qn, mayBeHub as Qo, buttonLabelClash as Qp, DidError as Qr, COMMUNITY_PIN_FRAME as Qs, GROUP_EDIT_TEXT_BYTES as Qt, identityPresentationBytes as Qu, endedRequests as Qv, TURN_REV_LIMIT as Qx, isAppLicense as Qy, checkAppBeforeRun as R, encrypt as RC, GROUP_SIGNALING_ALLOWANCE_SHARE as RS, handoffFileMissingFrame as R_, ANSWERS_REFUSED_PAUSE_MS as Ra, CONTACT_LINK_BYTES as Rb, vapidAuthorization as Rc, automaticTransport as Rd, EDIT_RECEIVE_LIMIT as Rf, isEmptyLinkPacket as Rg, HttpClient as Rh, SEPOLIA_TEST_USDT_FAUCET as Ri, sessionCapabilitiesFrame as Rl, verifyCommit as Rm, SSH_KEY_TYPES as Rn, CarriedTransport as Ro, wireReply as Rp, parseAtprotoCar as Rr, TYPING_RATE_LIMIT as Rs, groupWakeFrame as Rt, IDENTITY_FRAME_WINDOW_MS as Ru, enrollHelloFrame as Rv, TURN_RAISE_READ_TIMEOUT_MS as Rx, APP_BUNDLE_MAGIC as Ry, buildX401ResultArtifact as S, openRelayPayload as SC, turnSignedMessage as SS, HANDOFF_WINDOW as S_, parseInvoiceCallback as Sa, readAppSignature as Sb, deviceWakeRequest as Sc, proofStatement as Sd, voiceDownloadName as Sf, contactRtcConfig as Sg, OFFER_FAST_MS as Sh, decodeDidDhtPacket as Si, BUTTONS_CAPABILITY as Sl, LEGACY_GROUP_MEMBERS as Sm, groupMetaPicture as Sn, engineText as So, queueReaction as Sp, ATPROTO_PROOF_SCOPE as Sr, MAX_PAIRED_CALL_SIGNAL as Ss, KNOCK_TTL_MS as St, CAPS_LIMITS as Su, setUpdateFrame as Sv, deviceEchoNonce as Sx, knockHolds as Sy, encodeX401Header as T, signRelayPayload as TC, BACKGROUND_REQUESTS_PER_MINUTE as TS, filePartName as T_, requestLnurlInvoice as Ta, signAppRevocation as Tb, readWake as Tc, storageProofPath as Td, voiceLevelsOf as Tf, heardCallSignal as Tg, PRESENCE_HEARTBEAT as Th, didDhtKey as Ti, FILES_BINARY_CAPABILITY as Tl, MEMBER_KEY as Tm, groupName as Tn, GROUP_FILE_LIMITS as To, reactionFrame as Tp, atprotoProofRkey as Tr, parsePairedCallFrame as Ts, encodeGroupEntryLink as Tt, CapsExchange as Tu, verifySetUpdate as Tv, deviceLinkPairing as Tx, knockSlotRecords as Ty, checkAppStoreIndex as U, MAX_AVATAR_SIDE as UC, REQUESTS_PER_MINUTE as US, handoffOfferFrame as U_, DEMOTE_AFTER_FAILURES as Ua, DEVICE_INVITE_BYTES as Ub, APP_RANGE_LIMITS as Uc, relayedTransports as Ud, RateWindow as Uf, SERVICES_VERSION as Ug, resolveTargetUrl as Uh, assertTokenUnits as Ui, HOLD_CAPABILITY as Ul, decryptText as Um, sameSshKey as Un, SIGNAL_FRESH_MS as Uo, ITEM_STATES as Up, verifyAtprotoRecordProof as Ur, TYPING_TIMEOUT_MS as Us, GROUP_REACTED_FRAME as Ut, IDENTITY_PROOF_CAPABILITY as Uu, readEnrollHello as Uv, turnPutSummary as Ux, APP_PERMISSIONS as Uy, APP_STORE_LIMITS as V, tryDecrypt as VC, PREVIOUS_DEFAULT_RELAYS as VS, handoffHelloFrame as V_, CROSSED_PROBE_MS as Va, encodeContactLink as Vb, APP_RANGE_ERRORS as Vc, irohRelayUrl as Vd, MAX_REMOVAL_NUMBER as Vf, LEGACY_SERVICES as Vg, parseLocalTarget as Vh, WALLET_NETWORKS as Vi, SESSION_FRAME_MAX as Vl, confirmationMatches as Vm, parseSshPublicKey as Vn, SIGNALS_PER_MINUTE as Vo, BUTTON_STYLES as Vp, readAtprotoCid as Vr, TYPING_SEND_LIMIT as Vs, parseGroupWakeFrame as Vt, IDENTITY_MAX_RECEIVED as Vu, formatEnrollDigits as Vv, classifyTurnRead as Vx, APP_FORBIDDEN_KEYS as Vy, readAppListing as W, jpegSize$1 as WC, RelayTransport as WS, handoffPakeFrame as W_, DEMOTE_MS as Wa, DEVICE_INVITE_LIFETIME_S as Wb, AppRanges as Wc, transportOrder as Wd, dhtEditId as Wf, decodeServices as Wg, sanitizeRequestHeaders as Wh, assertWholeSats as Wi, HOLD_DATED_BACK_MS as Wl, edgeParams as Wm, sshFingerprint as Wn, SIGNAL_HOLD_MS as Wo, PR_CHECKS as Wp, verifyAtprotoSignature as Wr, TypingReceiver as Ws, GROUP_READ_NOTE as Wt, IDENTITY_PROVIDER_ID as Wu, verifyEnrollProof as Wv, TOMBSTONE_SEQUENCE as Wx, APP_SCREENSHOTS_DIR as Wy, groupTypingEpoch as X, stripHidden as XC, TURN_SOURCE_TIMEOUT_MS as XS, handoffVerifiedMessage as X_, INVITER_DIAL_GRACE_MS as Xa, readDeviceInvite as Xb, appRangeGetFrame as Xc, DHT_TEXT_REFUSED as Xd, validEditNumber as Xf, servicesToWire as Xg, LIMITS as Xh, SPARK_NETWORKS as Xi, readManifest as Xl, sealPair as Xm, verifyBitcoinMessage as Xn, MESH_HUBS as Xo, TASK_STATUSES as Xp, DID_MAX_LENGTH as Xr, typingFrame as Xs, COMMUNITY_EDIT_FRAME as Xt, boundVerifiedIdentity as Xu, REOPEN_BELOW as Xv, TURN_NAME_BYTES as Xx, checkAppManifest as Xy, GroupTypingBoard as Y, sanitizeNick as YC, SLOW_MS as YS, handoffVerifiedFrame as Y_, HANDLED_WAIT_MS as Ya, encodeDeviceInvite as Yb, appRangeErrorFrame as Yc, DHT_TEXT_BYTES as Yd, validEditMessage as Yf, servicesFromWire as Yg, CHUNK_KIND as Yh, walletNetworkOf as Yi, newMailbox as Yl, openSecret as Ym, legacyMessageHash as Yn, GROUP_VERSION_HUBS as Yo, STATUS_CARD_LIMITS as Yp, DID_JWS_MAX_LENGTH as Yr, typingActivity as Ys, groupMessageId as Yt, IdentityExchange as Yu, NEW_PER_HOUR as Yv, TURN_MAX as Yx, buildAppBundle as Yy, openGroupTyping as Z, trimEndOf as ZC, WATCH_SHARE as ZS, handoffVersions as Z_, INVITE_TAKEN as Za, DEVICE_INVITE_VERSION as Zb, decodeAppRangeData as Zc, DhtDelivery as Zd, validRemovalNumber as Zf, viewerTag as Zg, MAX_CHUNK_PAYLOAD_BYTES as Zh, SPARK_PROVIDER as Zi, DNS_LABEL as Zl, sealSecret as Zm, BIP322_REVISION as Zn, NO_HUB_POLICY as Zo, appCardId as Zp, DID_METHODS as Zr, typingKindOf as Zs, GROUP_EDIT_FRAME as Zt, emptyIdentityLedger as Zu, clearMissed as Zv, TURN_NO_ACTIVE as Zx, findAppForbiddenKey as Zy, X401_PROTOCOLS as _, PacketTooLargeError as _C, turnName as _S, HANDOFF_RELEASE as __, LIGHTNING_DESTINATION_PATTERN as _a, isAppRef as _b, WAKE_FRAME as _c, importedProof as _d, fileMessageText as _f, answersOffer as _g, EXPECT_PEER_MS as _h, DID_DHT_MAX_PAYLOAD as _i, isChatAppId as _l, shownTime as _m, encodeGroupMetaBody as _n, parsePaymentNetworks as _o, REACTION_LIMITS as _p, u64 as _r, readBeacon as _s, shortHash as _t, txtValue as _u, SET_ACK as _v, DEVICE_ECHO_FRAME as _x, REQUEST_TEXT_BYTES as _y, X401_DCQL_LIMITS as a, BREAKER_ALL_DOWN_PROBE_MS as aC, encodeTurnFields as aS, HANDOFF_DONE as a_, PUBKY_PROOF_ROOT as aa, yieldThread as ab, nextPinNumber as ac, revokesIdentity as ad, FileTransfers as af, DATA_CHANNEL_ID as ag, OFFER_HOST_GATHER_MS as ah, didWebFile as ai, APP_RATE_LIMIT as al, readStatusCard as am, MENTION_EVERYONE as an, RACE_ANSWERED_MS as ao, parseLinkPreview as ap, ByteReader as ar, beaconKeys as as, communityHasFrame as at, decodeDnsResponse as au, readHandoffDone as av, randomBytes as aw, decodeInviteCode as ax, CONTACT_RECORD_TTL as ay, buildX401ProofRequest as b, measureRecords as bC, turnReleaseMessage as bS, HANDOFF_VERIFIED as b_, findLightningDestination as ba, readAppRevocationShape as bb, WAKE_TTL_SECONDS as bc, proofCapability as bd, parseVoiceMeta as bf, callSignalHeardAt as bg, LinkSession as bh, DID_DHT_VERSION as bi, APPS_CAPABILITY as bl, GROUP_MEMBER_CAP as bm, groupMetaChange as bn, EngineError as bo, parseReactedFrame as bp, ATPROTO_FULL_SCOPE as br, shouldBeHub as bs, verifyCommunityCommit as bt, CAPS_ISSUED_BACK_MS as bu, readSetUpdate as bv, HANDOFF_CAPABILITY as bx, STAMP_BITS_MIN as by, readX401DcqlQuery as c, BREAKER_THRESHOLD as cC, openTurnValue as cS, HANDOFF_HAVE as c_, newPubkyProofFolder as ca, APP_STATEMENT_LIMITS as cb, pinFrame as cc, IDENTITY_TIMELINE_MAX as cd, safeBlobType as cf, RTC_SIGNAL_MAX_AGE_MS as cg, DIRECT_EVIDENCE_MS as ch, didWebHost as ci, APP_SEND_LIMIT as cl, statusCardBytes as cm, mentionsMember as cn, REDESCRIBED_GRACE_MS as co, FORWARD_LIMITS as cp, decodeBitcoinAddress as cr, freshHubs as cs, communityUntaggedHash as ct, domainWellKnownFile as cu, readHandoffHello as cv, toZ32 as cw, inviteLink as cx, KNOCK_SLOT_LABEL as cy, newX401HolderKey as d, budgetRetryMs as dC, sealTurnBody as dS, HANDOFF_LIST_PER_FRAME as d_, pubkyProofFile as da, appRefPublisher as db, pinnedFrame as dc, PROOF_ADAPTERS as dd, PLAYABLE_AUDIO as df, offerIsFresh as dg, DirectPathWatch as dh, parseDidDocument as di, appCloseFrame as dl, usageLeft as dm, GROUP_META_PAST as dn, SWITCH_RETIRE_MS as do, readForwarded as dp, encodeTx as dr, lobbyRecords as ds, encodeCommunityLink as dt, nip05RootKey as du, readHandoffRelease as dv, __commonJSMin as dw, inviteQrText as dx, MAX_SLOT_KNOCKS as dy, currentRelays as eC, TURN_SIGNED_BYTES as eS, HANDOFF_BUSY as e_, sparkInvoiceDetails as ea, isAppUrl as eb, PINNED_FRAME as ec, identityStatement as ed, peekDhtMailbox as ef, decodeControl as eg, CONNECT_TIMEOUT_MS as eh, checkDidSignature as ei, parseAppRangeFrame as el, cardLine as em, communityEditFrame as en, MAX_PAIRED_MESSAGE_FRAME as eo, LINK_TRAILING as ep, bip322ToSign as er, meshRendezvous as es, COMMUNITY_PROFILE as et, DOMAIN_MAX_RECORDS as eu, openHandoffPiece as ev, concatBytes as ew, INVITE_MAX_LENGTH as ex, newInbox as ey, readX401SdJwtVc as f, heldBackError as fC, signTurnBody as fS, HANDOFF_MANIFEST as f_, pubkyProofPath as fa, appRevocationId as fb, readPin as fc, PROOF_CAPABILITY as fd, RECORDING_TYPES as ff, parseRtcSignal as fg, directBlocked as fh, parseDidJws as fi, appDataBytes as fl, MESSAGE_CLOCK_SKEW_MS as fm, GROUP_META_PAST_CHARS as fn, UNPROVEN_AUTH_MS as fo, COMMUNITY_REACTION_FRAME as fp, encodeWitness as fr, mergeBeacon as fs, leaveStands as ft, normalizeDomain as fu, readHandoffTurnFrame as fv, __esmMin as fw, ownInviteRefusal as fx, REQUEST_CLOCK_SKEW_MS as fy, X401_LIMITS as g, PKARR_FUTURE_SKEW_MS as gC, turnKeys as gS, HANDOFF_PIECE_OVERHEAD as g_, pubkyHomeserverOf as ga, isAppKey as gb, WAKE_CALL_WAIT_MS as gc, emptyProofLedger as gd, downsamplePeaks as gf, RTC_CONFIG as gg, DHT_POLL_INTERVALS as gh, strictBase64Url as gi, isAppVersion as gl, receivedTimestamp as gm, MAX_GROUP_PICTURE_LENGTH as gn, pairedMessageFrame as go, REACTION_FRAME as gp, u32$1 as gr, rankHubs as gs, rosterHash as gt, recordsName as gu, sortParts as gv, DEVICE_CAPABILITIES as gx, REQUEST_PACKET_BYTES as gy, X401_HEADERS as h, MAX_DNS_PACKET_BYTES as hC, turnInstance as hS, HANDOFF_PIECE_BYTES as h_, homeserverWebEndpoint as ha, isAppHash as hb, WAKE_CALL_TTL_SECONDS as hc, STORAGE_ROOT as hd, baseMime as hf, PAIRED_CALL_CANDIDATES as hg, DEPARTED_READ_MS as hh, staticDidDocument as hi, chatAppId as hl, heardTime as hm, MAX_GROUP_NAME_LENGTH as hn, pairedMessageFits as ho, REACTED_FRAME as hp, txHash as hr, pickHubs as hs, leftStatement as ht, recordsFromWellKnown as hu, sealHandoffPiece as hv, __toCommonJS as hw, DEVICES_CAPABILITY as hx, REQUEST_NAME_UNITS as hy, x401ApprovalDigest as i, traceLink as iC, TurnRecordError as iS, HANDOFF_DATA as i_, PUBKY_PROOF_MAX_BYTES as ia, sha256Paced as ib, mayPin as ic, receivedIdentityStatus as id, readDhtFile as if, wrapDataChannel as ig, GATHER_STALL_MS as ih, didWebDocumentUrl as ii, APP_PEER_OPEN_MAX as il, checkStatusCard as im, validEditText as in, PONG_WAIT_MS as io, linksIn as ip, BitcoinAddressError as ir, COMMUNITY_TOPOLOGY as is, communityGroupId as it, WELL_KNOWN_PATH as iu, readHandoffData as iv, isZ32Key as iw, createLink as ix, turnOff as iy, readX401ProofResult as j, createIdentity as jC, DEFAULT_RELAYS as jS, handoffCancelFrame as j_, cashuRequestPayload as ja, isImageMime as jb, PUSH_SERVICE_HOSTS as jc, ringClaims as jd, isVideoMime as jf, signalHasVideo as jg, UNUSED_INVITE_READS_PER_MINUTE as jh, resolveDidDht as ji, SESSION_CAPABILITIES_FRAME as jl, parseGroupCommit as jm, parseGroupMetaStatement as jn, groupFileFallback as jo, PAIRED_REPLY_AUTHORS as jp, AtprotoCid as jr, decodeFileData as js, readKnocks as jt, emptyCapsState as ju, ENROLL_HELLO as jv, newDeviceSetSecret as jx, readKnockSlot as jy, readX401ProofResponse as k, readDnsName as kC, CHAT_RESERVE_PER_CHAT as kS, handoffAttemptSucceeded as k_, findBolt11 as ka, IMAGE_LIMITS as kb, wakePayload as kc, RING_LIFETIME as kd, formatVideoDuration as kf, pickCallCandidates as kg, STALLED_LOOK_MS as kh, jwkThumbprint as ki, REACTIONS_CAPABILITY as kl, commitUntaggedHash as km, parseGroupMetaBody as kn, GROUP_WANT_NO_FRAME as ko, validReactionNumber as kp, parseAtprotoDidDocument as kr, FILE_LIMITS as ks, knockRecords as kt, capsDescriptors as ku, ENROLL_DONE as kv, deviceLinkSecret as kx, mergeContactKnocks as ky, x401VpToken as l, RelayBreaker as lC, readTurnBody as lS, HANDOFF_HELLO as l_, normalizePubkyKey as la, appFingerprint as lb, pinIsNewer as lc, applyIdentityEvent as ld, sanitizeFileName as lf, buildDataSdp as lg, DIRECT_OWN_ATTEMPTS as lh, normalizeDid as li, APP_VERSION_MAX as ll, statusCardText as lm, validMentions as ln, RESUME_WAIT_MS as lo, forwardedAgain as lp, decodeTx as lr, hubRank as ls, decodeCommunityLink as lt, encodeDnsQuery as lu, readHandoffManifest as lv, utf8Decode as lw, inviteOwnership as lx, LINK_RECORD_LABEL as ly, x401HolderJwk as m, withRequestOptions as mC, signTurnRelease as mS, HANDOFF_PAKE as m_, encodeSvcbPacket as ma, checkAppRevokeStatement as mb, WAKE_CALL_INTERVAL_MS as mc, STORAGE_LIFETIME as md, VOICE_METER as mf, CALL_SIGNAL_MAX_AGE_MS as mg, AWAITING_PEER_MS as mh, signingKeys as mi, appOpenFrame as ml, claimedTime as mm, MAX_GROUP_NAME_BYTES as mn, WAKE_LOST_MS as mo, QUICK_REACTIONS as mp, sha256d as mr, newerHead as ms, leaveStatement3 as mt, recordsFromTxt as mu, sameDigest as mv, __require as mw, readInviteCode as mx, REQUEST_LIFETIME_MS as my, X401_RESPONSE_MODES as n, readRelayBody as nC, TURN_TTL as nS, HANDOFF_CANCEL as n_, BITCOIN_NETWORKS as na, readAppBundle as nb, PIN_FRAME as nc, isIdentityBinding as nd, dhtFileElements as nf, encodeControl as ng, DataLink as nh, didJwsAlg as ni, APP_DATA_MAX_BYTES as nl, cardTimeUtc as nm, meshMessageRef as nn, PAIRING_ATTEMPT_MS as no, linkEnd as np, decodeBase64 as nr, pickMeshHubs as ns, GROUP_READ_NOTE_COMMUNITY as nt, DOMAIN_TXT_MAX_BYTES as nu, readHandoffBusy as nv, fromBase64Url as nw, OwnInviteError as nx, settleRequest as ny, matchX401Dcql as o, BREAKER_BASE_MS as oC, firstDeviceSetSecret as oS, HANDOFF_FILE_MISSING as o_, isPubkyKey as oa, APP_NAME as ob, parsePinFrame as oc, signIdentityPresentation as od, PREVIEWABLE_IMAGE as of, DATA_CHANNEL_LABEL as og, REANSWERS as oh, didWebFileNames as oi, APP_RATE_WINDOW_MS as ol, removedCardText as om, MENTION_LIMITS as on, RACE_DIRECT_MS as oo, previewImageSize as op, compactSize as or, beaconRecords as os, communityMessageId as ot, dnsProofName as ou, readHandoffFileFrame as ov, toBase64 as ow, encodeGhostlyInvite as ox, ContactRequestError as oy, sameX401HolderJwk as p, isDiscoveryBudgetError as pC, signTurnPacket as pS, HANDOFF_OFFER as p_, decodeSvcbRecords as pa, appSignedBytes as pb, DEVICE_WAKE_TTL_SECONDS as pc, PeerProofs as pd, VOICE_LIMITS as pf, CALL_SIGNAL_FUTURE_MS as pg, symmetricNat as ph, parseDidSignaturePaste as pi, appDataFrame as pl, arrivalKey as pm, MAX_GROUP_META_BODY as pn, WAKE_ANSWER_GRACE_MS as po, GROUP_REACTION_FRAME as pp, hash160 as pr, mergeLobby as ps, leaveStatement as pt, parseDomainTxt as pu, readHandoffVerified as pv, __exportAll as pw, pastedAgain as px, REQUEST_LABEL as py, signAppStore as q, hasVisible as qC, SIGNALING_WINDOW_MS as qS, handoffRetryAfter as q_, FIRST_PAIRING_PACE_MS as qa, deviceInviteJoinerKeyZ32 as qb, appRangeDataFrame as qc, DHT_FILE_TOO_LARGE as qd, parseEditFrame as qf, isViewerTag as qg, webLocalFetch as qh, parsePaymentAmount as qi, HoldRefusedError as ql, newEpochSecret as qm, verifySshSignature as qn, groupSignalFrame as qo, ROUTINE_STATES as qp, DID_GHOSTLY_SERVICE as qr, parseTypingFrame as qs, chainPieces as qt, IDENTITY_SUBJECT as qu, MAX_MISSED as qv, TURN_LABEL as qx, appViewOf as qy, readX401OpenId4VpRequest as r, setLinkTraceSink as rC, TURN_VERSION as rS, HANDOFF_CANCEL_REASONS as r_, isBitcoinAddress as ra, readAppBundleAsync as rb, PIN_LIMITS as rc, newIdentityBinding as rd, dhtFileId as rf, sendBody as rg, GATHER_ATTEMPTS as rh, didSignedMessages as ri, APP_FRAME as rl, cardUrl as rm, parseCommunityEdit as rn, PAIRING_RETRY_MS as ro, linkStop as rp, verifyBip322 as rr, wireHubPolicy as rs, communityCommitHash as rt, NIP05_PATH as ru, readHandoffCancel as rv, fromZ32 as rw, createChatInvite as rx, takeRequest as ry, presentX401SdJwtVc as s, BREAKER_MAX_MS as sC, nextTurnPosition as sS, HANDOFF_FILE_REQUEST as s_, isPubkyProofFolder as sa, APP_PREFIXES as sb, parsePinnedFrame as sc, verifyIdentityPresentation as sd, formatFileSize as sf, RTC_SIGNAL_FUTURE_MS as sg, STALLED_EVIDENCE_MS as sh, didWebFileUrl as si, APP_RESUME_GRACE_MS as sl, sameButtonText as sm, mentionsBytes as sn, RACE_RELAYED_MS as so, sanitizePreviewImage as sp, decodeAnyBitcoinAddress as sr, doorHubs as ss, communityRoster as st, domainTxtRecord as su, readHandoffHave as sv, toBase64Url as sw, encodeInviteCode as sx, KNOCK_SLOTS as sy, X401_REQUEST_LIMITS as t, normalizeRelayUrl as tC, TURN_SLOTS as tS, HANDOFF_BUSY_REASONS as t_, sparkNetworkOf as ta, pacer as tb, PIN_CLOCK_SKEW_MS as tc, identityStatementText as td, DHT_FILE_CAPABILITY as tf, encodeChunk as tg, DATA_SETTLE_MS as th, didGhostlyServiceEntry as ti, readAppRangeFrame as tl, cardLinkHost as tm, communityMessageAuthor as tn, PAIRED_FRAME_TOO_LARGE as to, canonicalUrl as tp, bip322ToSpend as tr, parseHubPolicy as ts, CommunitySession as tt, DOMAIN_METHODS as tu, readHandoffAck as tv, fromBase64 as tw, INVITE_VERSION as tx, planKnocks as ty, X401_CREDENTIAL_LIMITS as u, DiscoveryBudgetError as uC, readTurnPacket as uS, HANDOFF_LATER_BYTES as u_, pubkyProofCapability as ua, appRef as ub, pinNumberHolds as uc, lastSharedWithMe as ud, sanitizeMime as uf, extractRtcParams as ug, DIRECT_PEERS as uh, parseDid as ui, AppSessions as ul, taskProgress as um, wireMentions as un, RTC_UNSTARTED_MS as uo, forwardedMany as up, decodeWitness as ur, lobbyKeys as us, derivedSecret as ut, isPublicAddress as uu, readHandoffPake as uv, utf8Encode as uw, inviteQrSegments as ux, MAX_SEEN as uy, X401_SCHEME as v, RELAY_PAYLOAD_MAX_BYTES as vC, turnPacket as vS, HANDOFF_REQUEST as v_, LNURL_LIMITS as va, isAppSignature as vb, WAKE_INTERVAL_MS as vc, isProofAdapter as vd, formatVoiceDuration as vf, buildSdpFromSignal as vg, FIRST_PUBLISH_MAX_MS as vh, DID_DHT_PREFIX as vi, parseAppFrame as vl, GROUP_ADMIN_OFF_ERROR as vm, groupDisplayName as vn, publishFailure as vo, ReactionWindow as vp, varBytes as vr, readBeaconHead as vs, signCommunity as vt, validDomainRecord as vu, SET_UPDATE as vv, DEVICE_PING_FRAME as vx, STAMP_BITS_DEFAULT as vy, decodeX401Header as w, readOwnRelayPayload as wC, turnVerifierMark as wS, filePartDigest as w_, parsePayParams as wa, signAppObject as wb, parseWakeFrame as wc, storageProofBody as wd, voiceLevel as wf, extractParamsFromSdp as wg, OFFER_STEP_MAX as wh, didDhtFromPublicKey as wi, EDIT_CAPABILITY as wl, MAX_GROUP_MEMBERS as wm, groupMetaToHand as wn, PairingTracker as wo, reactionEmoji as wp, atprotoProofRecord as wr, PairedCalls as ws, decodeGroupEntryLink as wt, CAPS_REFRESH_MS as wu, signTombstone as wv, deviceKeyZ32 as wx, knockSlotOf as wy, buildX401ProofResult as x, newerPacket as xC, turnSequence as xS, HANDOFF_VERSION as x_, invoiceCallbackUrl as xa, readAppRevocations as xb, WakeLimiter as xc, proofHash as xd, recordingMime as xf, compressSdp as xg, MAX_DHT_TEXT_BYTES as xh, DidDhtError as xi, APP_RANGES_CAPABILITY as xl, GROUP_VERSION_LARGE as xm, groupMetaNewer as xn, engineError as xo, parseReactionFrame as xp, ATPROTO_PROOF_COLLECTION as xr, validHead as xs, GROUP_ENTRY_PROFILE as xt, CAPS_LABEL as xu, setAckFrame as xv, deviceEchoFrame as xx, contactDay as xy, X401_VERSION as y, createRelayPayload as yC, turnPayloadSequence as yS, HANDOFF_TIMINGS as y_, fetchLnurlJson as ya, readAppRevocation as yb, WAKE_SUBJECT as yc, nostrProofTemplate as yd, isPlayableAudioType as yf, callRtcConfig as yg, IDLE_THRESHOLD as yh, DID_DHT_TTL as yi, readAppFrame as yl, GROUP_ID as ym, groupMetaBody as yn, ENGINE_ERRORS as yo, nextReactionNumber as yp, ATPROTO_DECLARED_SCOPE as yr, readLobby as ys, verifyCommunityChain as yt, wellKnownUrl as yu, encodeSetSlots as yv, ENROLL_CAPABILITY as yx, STAMP_BITS_MAX as yy, planAppUpdate as z, generateEncryptionKey as zC, HEDGE_MISSING_MS as zS, handoffFileRequestFrame as z_, BLOCKED_DIAL_WAIT_MS as za, CONTACT_LINK_VERSION as zb, vapidKeysMatch as zc, checkedDescriptors as zd, EDIT_SEND_LIMIT as zf, parseLinkRecords as zg, HttpHost as zh, TEST_USDT_FAUCET_AMOUNT as zi, PAIRED_PROFILE as zl, verifyCommitSignature as zm, SSH_PUBLIC_KEY_MAX as zn, GROUP_SIGNAL_FRAME as zo, ACTIVE_TASK_STATUSES as zp, parseAtprotoDidKey as zr, TYPING_RATE_WINDOW_MS as zs, groupWakes as zt, IDENTITY_MAX_EVIDENCE as zu, enrollMessage as zv, TURN_SETTLE_MS as zx, APP_CLIENTS as zy };
37371
+ export { COMMUNITY_LIMITS as $, identityFromSeed as $C, FRESH_READ_MS as $S, handoffDataFrame as $_, LIVENESS_PING_MS as $a, readImageMeta as $b, encodeAppRangeData as $c, LIVE_POLL_MS as $d, LINK_MAX_CHARS as $f, MAX_MSGS_PAYLOAD_B64 as $g, countUnusedInvite as $h, sparkAddressKind as $i, DNS_TYPE as $l, sha256Hex as $m, bip322MessageHash as $n, meshHubs as $o, buttonLabelClash as $p, checkDidJws as $r, COMMUNITY_PIN_FRAME as $s, carryMentions as $t, identityPresentationBytes as $u, enrollCancelReason as $v, verifyDeviceTransports as $x, requestRecords as $y, readX401ProofResponseHeader as A, RelayBreaker as AC, sealTurnBody as AS, HANDOFF_LIST_PER_FRAME as A_, ENDPOINT as Aa, appRefPublisher as Ab, wakePayload as Ac, RING_LIFETIME as Ad, formatVideoDuration as Af, offerIsFresh as Ag, directBlocked as Ah, openDidDhtPayload as Ai, REACTIONS_CAPABILITY as Al, commitUntaggedHash as Am, parseGroupMetaFrame as An, fetchesByItself as Ao, validReactionNumber as Ap, shortAtprotoDid as Ar, FileUplink as As, mergeKnocks as At, capsDescriptors as Au, readHandoffRelease as Av, utf8Decode as Aw, inviteQrText as Ax, MAX_SLOT_KNOCKS as Ay, APP_STORE_KINDS as B, createRelayPayload as BC, turnSequence as BS, HANDOFF_VERSION as B_, CROSSED_FRESH_MS as Ba, readAppRevocations as Bb, vapidKeysMatch as Bc, checkedDescriptors as Bd, EDIT_SEND_LIMIT as Bf, compressSdp as Bg, OFFER_FAST_MS as Bh, USDT_PUBLIC_RPC as Bi, PAIRED_PROFILE as Bl, verifyCommitSignature as Bm, SshSigError as Bn, GROUP_VERSION_SIGNALS as Bo, ACTIVE_TASK_STATUSES as Bp, parseAtprotoVerificationKey as Br, TYPING_RATE_WINDOW_MS as Bs, mentionedMembers as Bt, IDENTITY_MAX_EVIDENCE as Bu, setAckFrame as Bv, deviceEchoFrame as Bx, contactDay as By, buildX401TokenObject as C, relayUrlProblem as CC, TurnRecordError as CS, HANDOFF_DATA as C_, parseLightningDestination as Ca, sha256Paced as Cb, deviceWakeRequest as Cc, proofStatement as Cd, voiceDownloadName as Cf, wrapDataChannel as Cg, OFFER_HOST_GATHER_MS as Ch, didDhtDocument as Ci, BUTTONS_CAPABILITY as Cl, LEGACY_GROUP_MEMBERS as Cm, groupMetaTag as Cn, parseEngineError as Co, queueReaction as Cp, atprotoDidMethod as Cr, PAIRED_CALL_FRAME as Cs, MAX_KNOCKS as Ct, CAPS_LIMITS as Cu, readHandoffData as Cv, fromBase64Url as Cw, createLink as Cx, turnOff as Cy, readX401ProofRequest as D, BREAKER_BASE_MS as DC, openTurnValue as DS, HANDOFF_HAVE as D_, BOLT11_PATTERN as Da, APP_STATEMENT_LIMITS as Db, readWakePayload as Dc, validExternalKey as Dd, voicePeaksOf as Df, RTC_SIGNAL_MAX_AGE_MS as Dg, DIRECT_OWN_ATTEMPTS as Dh, encodeDidDhtDeactivated as Di, FILES_CAPABILITY as Dl, OWN_FRAME_LIMIT as Dm, nextGroupMetaRevision as Dn, GROUP_VERSION_FILES as Do, reactionIsNewer as Dp, isAtprotoDid as Dr, FILE_DATA_KIND as Ds, groupEntryUrl as Dt, CapsKeys as Du, readHandoffHello as Dv, toBase64 as Dw, inviteLink as Dx, KNOCK_SLOT_LABEL as Dy, isX401Protocol as E, BREAKER_ALL_DOWN_PROBE_MS as EC, nextTurnPosition as ES, HANDOFF_FILE_REQUEST as E_, resolveLightningDestination as Ea, APP_PREFIXES as Eb, readWake as Ec, storageProofPath as Ed, voiceLevelsOf as Ef, RTC_SIGNAL_FUTURE_MS as Eg, DIRECT_EVIDENCE_MS as Eh, didDhtRecords as Ei, FILES_BINARY_CAPABILITY as El, MEMBER_KEY as Em, keepPastGroupMeta as En, GROUP_HAVE_FRAME as Eo, reactionFrame as Ep, checkAtprotoProofRecord as Er, ChatFiles as Es, entryParams as Et, CapsExchange as Eu, readHandoffHave as Ev, randomBytes as Ew, encodeInviteCode as Ex, KNOCK_SLOTS as Ey, appRevocationFor as F, withRequestOptions as FC, turnKeys as FS, HANDOFF_PIECE_OVERHEAD as F_, parseCashuRequestPayload as Fa, isAppKey as Fb, decryptPushPayload as Fc, verifyRingAuthorization as Fd, EDIT_BUFFER_MAX as Ff, RTC_CONFIG as Fg, EXPECT_PEER_MS as Fh, ONCHAIN_PROVIDER as Fi, TYPING_CAPABILITY as Fl, rosterHas as Fm, wrapGroupMeta as Fn, readGroupWant as Fo, groupReplyAuthor as Fp, decodeDagCbor as Fr, transferEnded as Fs, GROUP_WAKE_MEMBER_INTERVAL_MS as Ft, IDENTITY_CHALLENGE_WINDOW as Fu, sortParts as Fv, __require as Fw, DEVICE_CAPABILITIES as Fx, REQUEST_PACKET_BYTES as Fy, readAppStore as G, readOwnRelayPayload as GC, BACKGROUND_WHILE_SIGNALING as GS, handoffAckFrame as G_, DHT_PIN_GRACE_MS as Ga, verifyAppRevocation as Gb, AppRanges as Gc, transportOrder as Gd, dhtEditId as Gf, isGlobalIpv4Host as Gg, RELAY_POLL_INTERVALS as Gh, formatPaymentAmount as Gi, HOLD_DATED_BACK_MS as Gl, edgeParams as Gm, sshKeyDigestHex as Gn, SIGNAL_PROVEN_MS as Go, PR_CHECKS as Gp, DID_DOCUMENT_MAX_BYTES as Gr, TypingReceiver as Gs, GroupSession as Gt, IDENTITY_PROVIDER_ID as Gu, DEVICE_KINDS as Gv, deviceLinkParams as Gx, linkRecords as Gy, checkAppListing as H, newerPacket as HC, turnStatedVerifier as HS, NO_ATTEMPTS as H_, CROSSED_WAIT_MS as Ha, setAppSignatureFastPath as Hb, APP_RANGE_ERRORS as Hc, irohRelayUrl as Hd, MAX_REMOVAL_NUMBER as Hf, decompressSdp as Hg, OFFER_STEP_MAX as Hh, arkAddressPrefix as Hi, SESSION_FRAME_MAX as Hl, confirmationMatches as Hm, parseSshSignature as Hn, SIGNAL_CARRIERS as Ho, BUTTON_STYLES as Hp, unsignedCommitBytes as Hr, TYPING_SEND_LIMIT as Hs, GROUP_LIMITS as Ht, IDENTITY_MAX_RECEIVED as Hu, setUpdateMessage as Hv, deviceFrameCapability as Hx, knockSlotIdentity as Hy, appStoreDecision as I, MAX_DNS_PACKET_BYTES as IC, turnName as IS, HANDOFF_RELEASE as I_, parseFedimintRequestPayload as Ia, isAppRef as Ib, encryptPushPayload as Ic, verifyRingEvidence as Id, EDIT_BUFFER_MS as If, answersOffer as Ig, FIRST_PUBLISH_MAX_MS as Ih, PaymentPreflightError as Ii, UPGRADE_CAPABILITY as Il, signCommit as Im, SSHSIG_MAX_ARMOR as In, readGroupWantNo as Io, pairedReplyAuthor as Ip, encodeDagCbor as Ir, transferStalled as Is, GROUP_WAKE_RECEIVE_LIMIT as It, IDENTITY_CHECK_UNAVAILABLE as Iu, SET_ACK as Iv, __toCommonJS as Iw, DEVICE_ECHO_FRAME as Ix, REQUEST_TEXT_BYTES as Iy, GROUP_TYPING_FRAME as J, decodeTxtPacket as JC, CHAT_RESERVE_MOST_SHARE as JS, handoffAttemptSucceeded as J_, GhostLink as Ja, IMAGE_LIMITS as Jb, appRangeDataFrame as Jc, DHT_FILE_TOO_LARGE as Jd, parseEditFrame as Jf, pickCallCandidates as Jg, TRANSPORTS_GONE_MS as Jh, validatePaymentTarget as Ji, HoldRefusedError as Jl, newEpochSecret as Jm, isLegacySignature as Jn, readGroupSignal as Jo, ROUTINE_STATES as Jp, DID_JWS_ALGS as Jr, parseTypingFrame as Js, frameBytes as Jt, IDENTITY_SUBJECT as Ju, ENROLL_DONE as Jv, deviceLinkSecret as Jx, mergeContactKnocks as Jy, readAppStoreSteps as K, signRelayPayload as KC, BACKGROUND_WRITES_SHARE as KS, handoffAttemptAllowed as K_, EARLY_DIAL_JOIN_MS as Ka, verifyAppSignature as Kb, appRangeCancelFrame as Kc, ACTIVE_DHT_POLL_MS as Kd, editFrame as Kf, keepsToRelays as Kg, SIGNAL_OUT_READS as Kh, isWalletNetwork as Ki, HOLD_LIMITS as Kl, encryptText as Km, sshSignCommand as Kn, SIGNAL_REPLY_MS as Ko, PR_STATES as Kp, DID_FILE_MAX_BYTES as Kr, TypingSender as Ks, asWritten as Kt, IDENTITY_REVOCATION_LABEL as Ku, ENROLL_CANCEL as Kv, deviceLinkRendezvousSeed as Kx, makeStamp as Ky, appUpdateDecision as L, PKARR_FUTURE_SKEW_MS as LC, turnPacket as LS, HANDOFF_REQUEST as L_, ANSWERS_REFUSED_PAUSES as La, isAppSignature as Lb, generateVapidKeys as Lc, RELAY_URL as Ld, EDIT_FRAME as Lf, buildSdpFromSignal as Lg, IDLE_THRESHOLD as Lh, SEPOLIA_TEST_USDT as Li, WAKE_SESSION_CAPABILITY as Ll, sortRoster as Lm, SSHSIG_NAMESPACE as Ln, CARRIED_DEFER_MS as Lo, readReply as Lp, findInMst as Lr, TYPING_FRAME as Ls, GroupWakeLimiter as Lt, IDENTITY_CLOCK_SKEW as Lu, SET_UPDATE as Lv, DEVICE_PING_FRAME as Lx, STAMP_BITS_DEFAULT as Ly, readX401ProofResultHeader as M, budgetRetryMs as MC, signTurnPacket as MS, HANDOFF_OFFER as M_, fedimintRequestPayload as Ma, appSignedBytes as Mb, PUSH_SERVICE_HOSTS as Mc, ringClaims as Md, isVideoMime as Mf, CALL_SIGNAL_FUTURE_MS as Mg, AWAITING_PEER_MS as Mh, signDidDhtPacket as Mi, SESSION_CAPABILITIES_FRAME as Ml, parseGroupCommit as Mm, parseGroupMetaTag as Mn, isGroupMessageId as Mo, PAIRED_REPLY_AUTHORS as Mp, AtprotoProofError as Mr, encodeFileData as Ms, GROUP_WAKE_FRAME as Mt, emptyCapsState as Mu, readHandoffVerified as Mv, __commonJSMin as Mw, pastedAgain as Mx, REQUEST_LABEL as My, x401AnswerableRequests as N, heldBackError as NC, signTurnRelease as NS, HANDOFF_PAKE as N_, findEndpoint as Na, checkAppRevokeStatement as Nb, WebPushError as Nc, ringEvidence as Nd, parseVideoMeta as Nf, CALL_SIGNAL_MAX_AGE_MS as Ng, DEPARTED_READ_MS as Nh, ETHEREUM_USDT as Ni, STATUS_CARD_CAPABILITY as Nl, rememberAlone as Nm, signGroupMeta as Nn, readGroupFileMeta as No, REPLY_ID as Np, atprotoCidFor as Nr, refusalText as Ns, GROUP_WAKE_GROUP_LIMIT as Nt, encodePacketTransports as Nu, sameDigest as Nv, __esmMin as Nw, readInviteCode as Nx, REQUEST_LIFETIME_MS as Ny, readX401ProofRequestHeader as O, BREAKER_MAX_MS as OC, readTurnBody as OS, HANDOFF_HELLO as O_, decodeBolt11 as Oa, appFingerprint as Ob, relayRequest as Oc, verifyNostrProof as Od, PLAYABLE_VIDEO as Of, buildDataSdp as Og, DIRECT_PEERS as Oh, encodeDidDhtPacket as Oi, KNOWN_SESSION_CAPABILITIES as Ol, SAID_AGAIN as Om, openGroupMeta as On, GROUP_WANT_FRAME as Oo, readDhtReactions as Op, normalizeAtprotoHandle as Or, FILE_FRAMES as Os, knockIdentity as Ot, CapsRefusedError as Ou, readHandoffManifest as Ov, toBase64Url as Ow, inviteOwnership as Ox, LINK_RECORD_LABEL as Oy, addedAppPermissions as P, isDiscoveryBudgetError as PC, turnInstance as PS, HANDOFF_PIECE_BYTES as P_, isFederationId as Pa, isAppHash as Pb, checkPushEndpoint as Pc, validRingKey as Pd, EDITED_FRAME as Pf, PAIRED_CALL_CANDIDATES as Pg, DHT_POLL_INTERVALS as Ph, EVM_TEST_CHAINS as Pi, SessionCapabilities as Pl, rosterAdmin as Pm, verifyGroupMetaSignature as Pn, readGroupHave as Po, REPLY_LIMITS as Pp, decodeAtprotoCommit as Pr, sentWhole as Ps, GROUP_WAKE_GROUP_WINDOW_MS as Pt, parsePacketTransports as Pu, sealHandoffPiece as Pv, __exportAll as Pw, DEVICES_CAPABILITY as Px, REQUEST_NAME_UNITS as Py, sealGroupTyping as Q, createIdentity as QC, DEPARTED_READS as QS, handoffContextProof as Q_, LIVENESS_MISSED_PINGS as Qa, previewable as Qb, decodeAppRangeData as Qc, DhtDelivery as Qd, validRemovalNumber as Qf, LABEL$1 as Qg, WATCH_PEER_MS as Qh, isSparkAddress as Qi, DNS_LABEL as Ql, sealSecret as Qm, MessageRefusal as Qn, mayBeHub as Qo, appCardId as Qp, DidError as Qr, typingKindOf as Qs, GROUP_EDIT_TEXT_BYTES as Qt, emptyIdentityLedger as Qu, enrollCancelFrame as Qv, unsignedDeviceTransports as Qx, requestPlaintextBytes as Qy, checkAppBeforeRun as R, PacketTooLargeError as RC, turnPayloadSequence as RS, HANDOFF_TIMINGS as R_, ANSWERS_REFUSED_PAUSE_MS as Ra, readAppRevocation as Rb, pushRequest as Rc, TRANSPORTS as Rd, EDIT_RATE_WINDOW_MS as Rf, callRtcConfig as Rg, LinkSession as Rh, SEPOLIA_TEST_USDT_FAUCET as Ri, parseSessionCapabilities as Rl, verifyChain as Rm, SSH_KEY_TYPES as Rn, CarriedTransport as Ro, replySnippet as Rp, parseAtprotoCar as Rr, TYPING_KINDS as Rs, groupWakeFrame as Rt, IDENTITY_FRAME_LIMIT as Ru, encodeSetSlots as Rv, ENROLL_CAPABILITY as Rx, STAMP_BITS_MAX as Ry, buildX401ResultArtifact as S, readRelayBody as SC, TURN_VERSION as SS, HANDOFF_CANCEL_REASONS as S_, parseInvoiceCallback as Sa, readAppBundleAsync as Sb, WakeLimiter as Sc, proofHash as Sd, recordingMime as Sf, sendBody as Sg, GATHER_STALL_MS as Sh, decodeDidDhtPacket as Si, APP_RANGES_CAPABILITY as Sl, GROUP_VERSION_LARGE as Sm, groupMetaPicture as Sn, engineText as So, parseReactionFrame as Sp, ATPROTO_PROOF_SCOPE as Sr, MAX_PAIRED_CALL_SIGNAL as Ss, KNOCK_TTL_MS as St, CAPS_LABEL as Su, readHandoffCancel as Sv, fromBase64 as Sw, createChatInvite as Sx, takeRequest as Sy, encodeX401Header as T, traceLink as TC, firstDeviceSetSecret as TS, HANDOFF_FILE_MISSING as T_, requestLnurlInvoice as Ta, APP_NAME as Tb, parseWakeFrame as Tc, storageProofBody as Td, voiceLevel as Tf, DATA_CHANNEL_LABEL as Tg, STALLED_EVIDENCE_MS as Th, didDhtKey as Ti, EDIT_CAPABILITY as Tl, MAX_GROUP_MEMBERS as Tm, groupName as Tn, GROUP_FILE_LIMITS as To, reactionEmoji as Tp, atprotoProofRkey as Tr, parsePairedCallFrame as Ts, encodeGroupEntryLink as Tt, CAPS_REFRESH_MS as Tu, readHandoffFileFrame as Tv, isZ32Key as Tw, encodeGhostlyInvite as Tx, ContactRequestError as Ty, checkAppStoreIndex as U, openRelayPayload as UC, turnVerifierMark as US, filePartDigest as U_, DEMOTE_AFTER_FAILURES as Ua, signAppObject as Ub, APP_RANGE_FRAMES as Uc, rankTransports as Ud, REMOVED_TEXT as Uf, extractParamsFromSdp as Ug, PRESENCE_HEARTBEAT as Uh, assertTokenUnits as Ui, SESSION_RECEIVE_PENDING as Ul, confirmationTag as Um, sameSshKey as Un, SIGNAL_FRESH_MS as Uo, CRON_LINE as Up, verifyAtprotoRecordProof as Ur, TYPING_STATUS_MAX as Us, GROUP_REACTED_FRAME as Ut, IDENTITY_MAX_VALIDITY as Uu, signTombstone as Uv, deviceKeyZ32 as Ux, knockSlotOf as Uy, APP_STORE_LIMITS as V, measureRecords as VC, turnSignedMessage as VS, HANDOFF_WINDOW as V_, CROSSED_PROBE_MS as Va, readAppSignature as Vb, APP_RANGE_DATA_KIND as Vc, irohDescriptor as Vd, MAX_EDITS_PER_MESSAGE as Vf, contactRtcConfig as Vg, OFFER_LOOK_MS as Vh, WALLET_NETWORKS as Vi, PairedSession as Vl, GROUP_PROFILE as Vm, parseSshPublicKey as Vn, SIGNALS_PER_MINUTE as Vo, BUTTON_ID as Vp, readAtprotoCid as Vr, TYPING_REFRESH_MS as Vs, parseGroupWakeFrame as Vt, IDENTITY_MAX_FRAME as Vu, setUpdateFrame as Vv, deviceEchoNonce as Vx, knockHolds as Vy, readAppListing as W, parseRelayPayload as WC, BACKGROUND_REQUESTS_PER_MINUTE as WS, filePartName as W_, DEMOTE_MS as Wa, signAppRevocation as Wb, APP_RANGE_LIMITS as Wc, relayedTransports as Wd, RateWindow as Wf, heardCallSignal as Wg, PRESENCE_WINDOW as Wh, assertWholeSats as Wi, HOLD_CAPABILITY as Wl, decryptText as Wm, sshFingerprint as Wn, SIGNAL_HOLD_MS as Wo, ITEM_STATES as Wp, verifyAtprotoSignature as Wr, TYPING_TIMEOUT_MS as Ws, GROUP_READ_NOTE as Wt, IDENTITY_PROOF_CAPABILITY as Wu, verifySetUpdate as Wv, deviceLinkPairing as Wx, knockSlotRecords as Wy, groupTypingEpoch as X, readDnsName as XC, CHAT_WATCH_SHARE as XS, handoffCancelFrame as X_, INVITER_DIAL_GRACE_MS as Xa, isImageMime as Xb, appRangeErrorFrame as Xc, DHT_TEXT_BYTES as Xd, validEditMessage as Xf, signalHasVideo as Xg, UNUSED_INVITE_UPKEEP_MS as Xh, SPARK_NETWORKS as Xi, newMailbox as Xl, openSecret as Xm, verifyBitcoinMessage as Xn, MESH_HUBS as Xo, STATUS_CARD_LIMITS as Xp, DID_MAX_LENGTH as Xr, typingActivity as Xs, COMMUNITY_EDIT_FRAME as Xt, IdentityExchange as Xu, ENROLL_HELLO as Xv, newDeviceSetSecret as Xx, readKnockSlot as Xy, GroupTypingBoard as Y, encodeTxtPacket as YC, CHAT_RESERVE_PER_CHAT as YS, handoffBusyFrame as Y_, HANDLED_WAIT_MS as Ya, imageSize as Yb, appRangeEndFrame as Yc, DHT_MESSAGE_TTL as Yd, parseEditedFrame as Yf, sdpHasCandidates as Yg, UNUSED_INVITE_READS_PER_MINUTE as Yh, walletNetworkOf as Yi, isHoldUrl as Yl, openPair as Ym, legacyMessageHash as Yn, GROUP_VERSION_HUBS as Yo, RUN_RESULTS as Yp, DID_JWS_MAX_LENGTH as Yr, sanitizeTypingStatus as Ys, groupMessageId as Yt, IdentityCheckUnavailable as Yu, ENROLL_GRANT as Yv, devicePingFrame as Yx, openRequest as Yy, openGroupTyping as Z, IDENTITY_MEMO_SIZE as ZC, DEFAULT_RELAYS as ZS, handoffContext as Z_, INVITE_TAKEN as Za, parseImageMeta as Zb, appRangeGetFrame as Zc, DHT_TEXT_REFUSED as Zd, validEditNumber as Zf, waitForIceGathering as Zg, UNUSED_INVITE_WAIT_MAX_MS as Zh, SPARK_PROVIDER as Zi, readManifest as Zl, sealPair as Zm, BIP322_REVISION as Zn, NO_HUB_POLICY as Zo, TASK_STATUSES as Zp, DID_METHODS as Zr, typingFrame as Zs, GROUP_EDIT_FRAME as Zt, boundVerifiedIdentity as Zu, ENROLL_PROOF as Zv, signDeviceTransports as Zx, readLinkRecord as Zy, X401_PROTOCOLS as _, WATCH_SHARE as _C, TURN_REV_LIMIT as _S, HANDOFF_ACK as __, LIGHTNING_DESTINATION_PATTERN as _a, isAppLicense as _b, WAKE_CALL_WAIT_MS as _c, emptyProofLedger as _d, downsamplePeaks as _f, PROTOCOL_VERSION as _g, ANSWER_REFUSED_REDIALS as _h, DID_DHT_MAX_PAYLOAD as _i, isAppVersion as _l, receivedTimestamp as _m, encodeGroupMetaBody as _n, parsePaymentNetworks as _o, REACTION_FRAME as _p, u64 as _r, readBeacon as _s, shortHash as _t, recordsName as _u, isHandoffPartName as _v, stripHidden as _w, INVITE_HRP as _x, endedRequests as _y, X401_DCQL_LIMITS as a, HEDGE_MISSING_MS as aC, TURN_VISIBLE_MS as aS, HTTP_SERVICE_PROTO as a_, PUBKY_PROOF_ROOT as aa, APP_CLIENT_NAME as ab, mayPin as ac, receivedIdentityStatus as ad, readDhtFile as af, formatLocalTarget as ag, RATCHET_KEEP_MS as ah, didWebFile as ai, APP_PEER_OPEN_MAX as al, checkStatusCard as am, MENTION_EVERYONE as an, RACE_ANSWERED_MS as ao, linksIn as ap, ByteReader as ar, beaconKeys as as, communityHasFrame as at, WELL_KNOWN_PATH as au, handoffHaveFrames as av, encrypt as aw, createContactLink as ax, enrollProofFrame as ay, buildX401ProofRequest as b, currentRelays as bC, TURN_SLOTS as bS, HANDOFF_BUSY_REASONS as b_, findLightningDestination as ba, pacer as bb, WAKE_SUBJECT as bc, nostrProofTemplate as bd, isPlayableAudioType as bf, encodeChunk as bg, DataLink as bh, DID_DHT_VERSION as bi, readAppFrame as bl, GROUP_ID as bm, groupMetaChange as bn, EngineError as bo, nextReactionNumber as bp, ATPROTO_FULL_SCOPE as br, shouldBeHub as bs, verifyCommunityCommit as bt, wellKnownUrl as bu, readHandoffAck as bv, bytesEqual as bw, INVITE_VERSION as bx, planKnocks as by, readX401DcqlQuery as c, RELAY_REQUESTS_PER_MINUTE as cC, turnPutSummary as cS, SERVICES_VERSION as c_, newPubkyProofFolder as ca, APP_PERMISSIONS as cb, parsePinnedFrame as cc, verifyIdentityPresentation as cd, formatFileSize as cf, resolveTargetUrl as cg, emptyRatchetState as ch, didWebHost as ci, APP_RESUME_GRACE_MS as cl, sameButtonText as cm, mentionsMember as cn, REDESCRIBED_GRACE_MS as co, sanitizePreviewImage as cp, decodeBitcoinAddress as cr, freshHubs as cs, communityUntaggedHash as ct, domainTxtRecord as cu, handoffOfferFrame as cv, tryDecrypt as cw, DEVICE_INVITE_BYTES as cx, readEnrollHello as cy, newX401HolderKey as d, RelaysFailedError as dC, TURN_BODY_BYTES as dS, isValidServiceId as d_, pubkyProofFile as da, appDigest as db, pinNumberHolds as dc, lastSharedWithMe as dd, sanitizeMime as df, viewerResponseHeaders as dg, ratchetOn as dh, parseDidDocument as di, AppSessions as dl, taskProgress as dm, GROUP_META_PAST as dn, SWITCH_RETIRE_MS as do, forwardedMany as dp, encodeTx as dr, lobbyRecords as ds, encodeCommunityLink as dt, isPublicAddress as du, handoffRequestFrame as dv, jpegSize$1 as dw, createDeviceInvite as dx, MAX_DONE as dy, GROUP_BURST_MS as eC, seedSigner as eS, RECORD_TTL as e_, sparkInvoiceDetails as ea, seenEntry as eb, GROUP_PIN_FRAME as ec, identityRevocationValue as ed, emptyDhtDeliveryState as ef, presenceSeenAt as eg, FOLLOW_MS as eh, checkDidSignature as ei, isServeId as el, cardEditNumber as em, communityEditFrame as en, MAX_PAIRED_MESSAGE_FRAME as eo, LINK_PREVIEW_LIMITS as ep, bip322ToSign as er, meshRendezvous as es, COMMUNITY_PROFILE as et, DOMAIN_FILE_MAX_BYTES as eu, handoffDigest as ev, identityFromSeedB64 as ew, canonicalJson as ex, enrollDigits as ey, readX401SdJwtVc as f, SIGNALING_ALLOWANCE_SHARE as fC, TURN_LABEL as fS, isViewerTag as f_, pubkyProofPath as fa, appViewOf as fb, pinnedFrame as fc, PROOF_ADAPTERS as fd, PLAYABLE_AUDIO as ff, webLocalFetch as fg, ratchetOpen as fh, parseDidJws as fi, appCloseFrame as fl, usageLeft as fm, GROUP_META_PAST_CHARS as fn, UNPROVEN_AUTH_MS as fo, readForwarded as fp, encodeWitness as fr, mergeBeacon as fs, leaveStands as ft, nip05RootKey as fu, handoffRetryAfter as fv, sanitizeAvatar as fw, deviceInviteJoinerKeyZ32 as fx, MAX_MISSED as fy, X401_LIMITS as g, TURN_SOURCE_TIMEOUT_MS as gC, TURN_NO_ACTIVE as gS, viewerTag as g_, pubkyHomeserverOf as ga, findAppForbiddenKey as gb, WAKE_CALL_TTL_SECONDS as gc, STORAGE_ROOT as gd, baseMime as gf, MAX_CHUNK_PAYLOAD_BYTES as gg, ratchetUnknownSession as gh, strictBase64Url as gi, chatAppId as gl, heardTime as gm, MAX_GROUP_PICTURE_LENGTH as gn, pairedMessageFrame as go, REACTED_FRAME as gp, u32$1 as gr, rankHubs as gs, rosterHash as gt, recordsFromWellKnown as gu, handoffVersions as gv, sanitizeNick as gw, DEVICE_INVITE_VERSION as gx, clearMissed as gy, X401_HEADERS as h, SLOW_MS as hC, TURN_NAME_BYTES as hS, servicesToWire as h_, homeserverWebEndpoint as ha, checkAppManifest as hb, WAKE_CALL_INTERVAL_MS as hc, STORAGE_LIFETIME as hd, VOICE_METER as hf, LIMITS as hg, ratchetSessionOf as hh, staticDidDocument as hi, appOpenFrame as hl, claimedTime as hm, MAX_GROUP_NAME_LENGTH as hn, pairedMessageFits as ho, QUICK_REACTIONS as hp, txHash as hr, pickHubs as hs, leftStatement as ht, recordsFromTxt as hu, handoffVerifiedMessage as hv, sanitizeDisplayText as hw, readDeviceInvite as hx, REOPEN_BELOW as hy, x401ApprovalDigest as i, GROUP_SIGNALING_ALLOWANCE_SHARE as iC, TURN_SETTLE_MS as iS, parseLinkRecords as i_, PUBKY_PROOF_MAX_BYTES as ia, APP_CLIENTS as ib, PIN_LIMITS as ic, newIdentityBinding as id, dhtFileId as if, HttpHost as ig, RATCHET_HEADER_BYTES as ih, didWebDocumentUrl as ii, APP_FRAME as il, cardUrl as im, validEditText as in, PONG_WAIT_MS as io, linkStop as ip, BitcoinAddressError as ir, COMMUNITY_TOPOLOGY as is, communityGroupId as it, NIP05_PATH as iu, handoffFileRequestFrame as iv, decrypt as iw, CONTACT_LINK_VERSION as ix, enrollMessage as iy, readX401ProofResult as j, DiscoveryBudgetError as jC, signTurnBody as jS, HANDOFF_MANIFEST as j_, cashuRequestPayload as ja, appRevocationId as jb, wakeRequest as jc, ringAuthorization as jd, isPlayableVideoType as jf, parseRtcSignal as jg, symmetricNat as jh, resolveDidDht as ji, SERVICES_CAPABILITY as jl, expectedRoster as jm, parseGroupMetaStatement as jn, groupFileFallback as jo, wireReaction as jp, AtprotoCid as jr, decodeFileData as js, readKnocks as jt, dialDescriptors as ju, readHandoffTurnFrame as jv, utf8Encode as jw, ownInviteRefusal as jx, REQUEST_CLOCK_SKEW_MS as jy, readX401ProofResponse as k, BREAKER_THRESHOLD as kC, readTurnPacket as kS, HANDOFF_LATER_BYTES as k_, findBolt11 as ka, appRef as kb, wakeFrame as kc, verifyPeerProof as kd, VIDEO_LIMITS as kf, extractRtcParams as kg, DirectPathWatch as kh, jwkThumbprint as ki, PIN_CAPABILITY as kl, commitHash as km, parseGroupMetaBody as kn, GROUP_WANT_NO_FRAME as ko, readReaction as kp, parseAtprotoDidDocument as kr, FILE_LIMITS as ks, knockRecords as kt, DHT_TEXT_CAPABILITY as ku, readHandoffPake as kv, toZ32 as kw, inviteQrSegments as kx, MAX_SEEN as ky, x401VpToken as l, REQUESTS_PER_MINUTE as lC, TOMBSTONE_SEQUENCE as lS, decodeServices as l_, normalizePubkyKey as la, APP_SCREENSHOTS_DIR as lb, pinFrame as lc, IDENTITY_TIMELINE_MAX as ld, safeBlobType as lf, sanitizeRequestHeaders as lg, isRatcheted as lh, normalizeDid as li, APP_SEND_LIMIT as ll, statusCardBytes as lm, validMentions as ln, RESUME_WAIT_MS as lo, FORWARD_LIMITS as lp, decodeTx as lr, hubRank as ls, decodeCommunityLink as lt, domainWellKnownFile as lu, handoffPakeFrame as lv, MAX_AVATAR_LENGTH as lw, DEVICE_INVITE_LIFETIME_S as lx, verifyEnrollProof as ly, x401HolderJwk as m, SLOW_DEMOTE_MS as mC, TURN_MAX as mS, servicesFromWire as m_, encodeSvcbPacket as ma, buildAppBundle as mb, DEVICE_WAKE_TTL_SECONDS as mc, PeerProofs as md, VOICE_LIMITS as mf, CHUNK_KIND as mg, ratchetSeal as mh, signingKeys as mi, appDataFrame as ml, arrivalKey as mm, MAX_GROUP_NAME_BYTES as mn, WAKE_LOST_MS as mo, GROUP_REACTION_FRAME as mp, sha256d as mr, newerHead as ms, leaveStatement3 as mt, parseDomainTxt as mu, handoffVerifiedFrame as mv, hasVisible as mw, encodeDeviceInvite as mx, NEW_PER_HOUR as my, X401_RESPONSE_MODES as n, GROUP_OVER_PACE_MS as nC, TURN_PUT_WINDOW_MS as nS, emptyLinkRecords as n_, BITCOIN_NETWORKS as na, APP_BUNDLE_LIMITS as nb, PIN_CLOCK_SKEW_MS as nc, identityStatementText as nd, DHT_FILE_CAPABILITY as nf, GhostlyHttpError as ng, MAX_SKIPPED_KEYS as nh, didJwsAlg as ni, readAppRangeFrame as nl, cardLinkHost as nm, meshMessageRef as nn, PAIRING_ATTEMPT_MS as no, canonicalUrl as np, decodeBase64 as nr, pickMeshHubs as ns, GROUP_READ_NOTE_COMMUNITY as nt, DOMAIN_METHODS as nu, handoffEphemeral as nv, sign as nw, readCanonicalJson as nx, enrollGrantFrame as ny, matchX401Dcql as o, HEDGE_MS as oC, classifyTurnRead as oS, LEGACY_SERVICES as o_, isPubkyKey as oa, APP_FORBIDDEN_KEYS as ob, nextPinNumber as oc, revokesIdentity as od, FileTransfers as of, parseLocalTarget as og, RATCHET_OVERHEAD as oh, didWebFileNames as oi, APP_RATE_LIMIT as ol, readStatusCard as om, MENTION_LIMITS as on, RACE_DIRECT_MS as oo, parseLinkPreview as op, compactSize as or, beaconRecords as os, communityMessageId as ot, decodeDnsResponse as ou, handoffHelloFrame as ov, generateEncryptionKey as ow, encodeContactLink as ox, formatEnrollDigits as oy, sameX401HolderJwk as p, SIGNALING_WINDOW_MS as pC, TURN_LAST_SEQUENCE as pS, serviceIdFromName as p_, decodeSvcbRecords as pa, assembleAppBundle as pb, readPin as pc, PROOF_CAPABILITY as pd, RECORDING_TYPES as pf, CHUNK_FLAG_END as pg, ratchetRoot as ph, parseDidSignaturePaste as pi, appDataBytes as pl, MESSAGE_CLOCK_SKEW_MS as pm, MAX_GROUP_META_BODY as pn, WAKE_ANSWER_GRACE_MS as po, COMMUNITY_REACTION_FRAME as pp, hash160 as pr, mergeLobby as ps, leaveStatement as pt, normalizeDomain as pu, handoffStreamKey as pv, MAX_NICK_LENGTH as pw, deviceInviteJoinerParams as px, MAX_WAITING as py, signAppStore as q, decodeDnsAnswers as qC, CHAT_RESERVE as qS, handoffAttemptFailed as q_, FIRST_PAIRING_PACE_MS as qa, verifyAppStatementBytes as qb, appRangeChunk as qc, DHT_FILE_REFUSED as qd, editedFrame as qf, parseCallSignal as qg, STALLED_LOOK_MS as qh, parsePaymentAmount as qi, HoldKeys as ql, epochKeys as qm, verifySshSignature as qn, groupSignalFrame as qo, REMOVABLE_KINDS as qp, DID_GHOSTLY_SERVICE as qr, parseTypingActivity as qs, chainPieces as qt, IDENTITY_STATEMENT_PREFIX as qu, ENROLL_CANCEL_REASONS as qv, deviceLinkSealKey as qx, makeStampPaced as qy, readX401OpenId4VpRequest as r, GROUP_RATION_WINDOW_MS as rC, TURN_RAISE_READ_TIMEOUT_MS as rS, isEmptyLinkPacket as r_, isBitcoinAddress as ra, APP_BUNDLE_MAGIC as rb, PIN_FRAME as rc, isIdentityBinding as rd, dhtFileElements as rf, HttpClient as rg, RATCHET_CAPABILITY as rh, didSignedMessages as ri, APP_DATA_MAX_BYTES as rl, cardTimeUtc as rm, parseCommunityEdit as rn, PAIRING_RETRY_MS as ro, linkEnd as rp, verifyBip322 as rr, wireHubPolicy as rs, communityCommitHash as rt, DOMAIN_TXT_MAX_BYTES as ru, handoffFileMissingFrame as rv, verify as rw, CONTACT_LINK_BYTES as rx, enrollHelloFrame as ry, presentX401SdJwtVc as s, PREVIOUS_DEFAULT_RELAYS as sC, keptAtEqualSequence as sS, MAX_SERVICES as s_, isPubkyProofFolder as sa, APP_ICON_PATH as sb, parsePinFrame as sc, signIdentityPresentation as sd, PREVIEWABLE_IMAGE as sf, relativizeLocation as sg, RatchetBox as sh, didWebFileUrl as si, APP_RATE_WINDOW_MS as sl, removedCardText as sm, mentionsBytes as sn, RACE_RELAYED_MS as so, previewImageSize as sp, decodeAnyBitcoinAddress as sr, doorHubs as ss, communityRoster as st, dnsProofName as su, handoffManifestFrames as sv, sealedLength as sw, readContactLink as sx, readEnrollGrant as sy, X401_REQUEST_LIMITS as t, GROUP_BURST_ONE_LINK as tC, webCryptoSigner as tS, buildLinkRecords as t_, sparkNetworkOf as ta, stampHolds as tb, PINNED_FRAME as tc, identityStatement as td, peekDhtMailbox as tf, unusedInviteWait as tg, MAX_SKIP as th, didGhostlyServiceEntry as ti, parseAppRangeFrame as tl, cardLine as tm, communityMessageAuthor as tn, PAIRED_FRAME_TOO_LARGE as to, LINK_TRAILING as tp, bip322ToSpend as tr, parseHubPolicy as ts, CommunitySession as tt, DOMAIN_MAX_RECORDS as tu, handoffDoneFrame as tv, publicKeyFromZ32 as tw, canonicalJsonBytes as tx, enrollDoneFrame as ty, X401_CREDENTIAL_LIMITS as u, RelayTransport as uC, TOMBSTONE_TURN as uS, encodeServices as u_, pubkyProofCapability as ua, APP_VIEWS as ub, pinIsNewer as uc, applyIdentityEvent as ud, sanitizeFileName as uf, sanitizeResponseHeaders as ug, ratchetHeard as uh, parseDid as ui, APP_VERSION_MAX as ul, statusCardText as um, wireMentions as un, RTC_UNSTARTED_MS as uo, forwardedAgain as up, decodeWitness as ur, lobbyKeys as us, derivedSecret as ut, encodeDnsQuery as uu, handoffReleaseFrame as uv, MAX_AVATAR_SIDE as uw, DEVICE_INVITE_OWN_DEVICE as ux, FLOOD_PER_DAY as uy, X401_SCHEME as v, WAY_BACK_SHARE as vC, TURN_SEALED_BYTES as vS, HANDOFF_ATTEMPTS as v_, LNURL_LIMITS as va, isAppPath as vb, WAKE_FRAME as vc, importedProof as vd, fileMessageText as vf, decodeChunk as vg, CONNECT_TIMEOUT_MS as vh, DID_DHT_PREFIX as vi, isChatAppId as vl, shownTime as vm, groupDisplayName as vn, publishFailure as vo, REACTION_LIMITS as vp, varBytes as vr, readBeaconHead as vs, signCommunity as vt, txtValue as vu, newHandoffId as vv, trimEndOf as vw, INVITE_LINK_ORIGIN as vx, inboxRecord as vy, decodeX401Header as w, setLinkTraceSink as wC, encodeTurnFields as wS, HANDOFF_DONE as w_, parsePayParams as wa, yieldThread as wb, newWakeToken as wc, storageProof as wd, voiceFileName as wf, DATA_CHANNEL_ID as wg, REANSWERS as wh, didDhtFromPublicKey as wi, CALLS_CAPABILITY as wl, MAX_GROUP_CHAIN as wm, groupMetaToHand as wn, PairingTracker as wo, reactedFrame as wp, atprotoProofRecord as wr, PairedCalls as ws, decodeGroupEntryLink as wt, CAPS_PUBLISH_SPACING_MS as wu, readHandoffDone as wv, fromZ32 as ww, decodeInviteCode as wx, CONTACT_RECORD_TTL as wy, buildX401ProofResult as x, normalizeRelayUrl as xC, TURN_TTL as xS, HANDOFF_CANCEL as x_, invoiceCallbackUrl as xa, readAppBundle as xb, WAKE_TTL_SECONDS as xc, proofCapability as xd, parseVoiceMeta as xf, encodeControl as xg, GATHER_ATTEMPTS as xh, DidDhtError as xi, APPS_CAPABILITY as xl, GROUP_MEMBER_CAP as xm, groupMetaNewer as xn, engineError as xo, parseReactedFrame as xp, ATPROTO_PROOF_COLLECTION as xr, validHead as xs, GROUP_ENTRY_PROFILE as xt, CAPS_ISSUED_BACK_MS as xu, readHandoffBusy as xv, concatBytes as xw, OwnInviteError as xx, settleRequest as xy, X401_VERSION as y, WRITE_FIRST_MS as yC, TURN_SIGNED_BYTES as yS, HANDOFF_BUSY as y_, fetchLnurlJson as ya, isAppUrl as yb, WAKE_INTERVAL_MS as yc, isProofAdapter as yd, formatVoiceDuration as yf, decodeControl as yg, DATA_SETTLE_MS as yh, DID_DHT_TTL as yi, parseAppFrame as yl, GROUP_ADMIN_OFF_ERROR as ym, groupMetaBody as yn, ENGINE_ERRORS as yo, ReactionWindow as yp, ATPROTO_DECLARED_SCOPE as yr, readLobby as ys, verifyCommunityChain as yt, validDomainRecord as yu, openHandoffPiece as yv, unwrapPasted as yw, INVITE_MAX_LENGTH as yx, newInbox as yy, planAppUpdate as z, RELAY_PAYLOAD_MAX_BYTES as zC, turnReleaseMessage as zS, HANDOFF_VERIFIED as z_, BLOCKED_DIAL_WAIT_MS as za, readAppRevocationShape as zb, vapidAuthorization as zc, automaticTransport as zd, EDIT_RECEIVE_LIMIT as zf, callSignalHeardAt as zg, MAX_DHT_TEXT_BYTES as zh, TEST_USDT_FAUCET_AMOUNT as zi, sessionCapabilitiesFrame as zl, verifyCommit as zm, SSH_PUBLIC_KEY_MAX as zn, GROUP_SIGNAL_FRAME as zo, wireReply as zp, parseAtprotoDidKey as zr, TYPING_RATE_LIMIT as zs, groupWakes as zt, IDENTITY_FRAME_WINDOW_MS as zu, readSetUpdate as zv, HANDOFF_CAPABILITY as zx, STAMP_BITS_MIN as zy };
36548
37372
 
36549
- //# sourceMappingURL=src-B5uLojgn.js.map
37373
+ //# sourceMappingURL=src-CfpOdLVf.js.map